@humandialog/forms.svelte 1.3.11 → 1.3.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +0 -0
- package/components/Fab.svelte +112 -34
- package/components/Fab.svelte.d.ts +17 -17
- package/components/Floating_container.svelte +86 -21
- package/components/Floating_container.svelte.d.ts +21 -21
- package/components/Grid.menu.svelte.d.ts +25 -25
- package/components/button.svelte.d.ts +26 -26
- package/components/checkbox.svelte.d.ts +26 -26
- package/components/combo/combo.d.ts +19 -19
- package/components/combo/combo.item.svelte.d.ts +20 -20
- package/components/combo/combo.js +19 -19
- package/components/combo/combo.source.svelte.d.ts +23 -23
- package/components/combo/combo.svelte +64 -30
- package/components/combo/combo.svelte.d.ts +44 -44
- package/components/contextmenu.svelte +97 -30
- package/components/contextmenu.svelte.d.ts +26 -26
- package/components/date.svelte +40 -30
- package/components/date.svelte.d.ts +33 -33
- package/components/delayed.spinner.svelte.d.ts +19 -19
- package/components/document/editor.svelte +33 -6
- package/components/document/editor.svelte.d.ts +35 -35
- package/components/document/internal/Document_command.d.ts +12 -11
- package/components/document/internal/Document_command.js +12 -11
- package/components/document/internal/Selection_helper.d.ts +7 -7
- package/components/document/internal/Selection_helper.js +133 -133
- package/components/document/internal/Selection_range.d.ts +26 -26
- package/components/document/internal/Selection_range.js +58 -58
- package/components/document/internal/findSuggestionMatch.d.ts +16 -16
- package/components/document/internal/findSuggestionMatch.js +51 -51
- package/components/document/internal/h1.icon.svelte.d.ts +23 -23
- package/components/document/internal/h2.icon.svelte.d.ts +23 -23
- package/components/document/internal/h3.icon.svelte.d.ts +23 -23
- package/components/document/internal/h4.icon.svelte.d.ts +23 -23
- package/components/document/internal/palette.row.big.svelte.d.ts +46 -46
- package/components/document/internal/palette.row.svelte +1 -1
- package/components/document/internal/palette.row.svelte.d.ts +46 -46
- package/components/document/internal/palette.svelte +23 -15
- package/components/document/internal/palette.svelte.d.ts +82 -82
- package/components/document/internal/suggestion.d.ts +158 -158
- package/components/document/internal/suggestion.js +194 -194
- package/components/document/rich.edit.svelte.d.ts +34 -34
- package/components/edit.field.svelte.d.ts +31 -31
- package/components/file.loader.svelte.d.ts +25 -25
- package/components/icon.ex.svelte.d.ts +62 -62
- package/components/icon.svelte.d.ts +62 -62
- package/components/input.text.svelte.d.ts +29 -29
- package/components/inputbox.ltop.svelte.d.ts +59 -59
- package/components/kanban/Kanban.d.ts +47 -47
- package/components/kanban/Kanban.js +105 -105
- package/components/kanban/internal/kanban.card.svelte +5 -3
- package/components/kanban/internal/kanban.card.svelte.d.ts +32 -32
- package/components/kanban/internal/kanban.column.svelte.d.ts +53 -53
- package/components/kanban/internal/kanban.inserter.svelte.d.ts +18 -18
- package/components/kanban/internal/kanban.move.menu.svelte +135 -135
- package/components/kanban/internal/kanban.move.menu.svelte.d.ts +22 -22
- package/components/kanban/internal/kanban.props.svelte.d.ts +19 -19
- package/components/kanban/kanban.callbacks.svelte +1 -1
- package/components/kanban/kanban.callbacks.svelte.d.ts +18 -18
- package/components/kanban/kanban.column.svelte.d.ts +21 -21
- package/components/kanban/kanban.combo.svelte.d.ts +25 -25
- package/components/kanban/kanban.date.svelte +1 -1
- package/components/kanban/kanban.date.svelte.d.ts +21 -21
- package/components/kanban/kanban.source.svelte.d.ts +23 -23
- package/components/kanban/kanban.static.svelte.d.ts +20 -20
- package/components/kanban/kanban.summary.svelte.d.ts +18 -18
- package/components/kanban/kanban.svelte.d.ts +65 -65
- package/components/kanban/kanban.tags.svelte.d.ts +24 -24
- package/components/kanban/kanban.title.svelte.d.ts +21 -21
- package/components/list/List.d.ts +46 -46
- package/components/list/List.js +54 -54
- package/components/list/internal/list.element.props.svelte +2 -2
- package/components/list/internal/list.element.props.svelte.d.ts +21 -21
- package/components/list/internal/list.element.summary.svelte +46 -46
- package/components/list/internal/list.element.summary.svelte.d.ts +24 -24
- package/components/list/internal/list.element.svelte +8 -6
- package/components/list/internal/list.element.svelte.d.ts +31 -31
- package/components/list/internal/list.inserter.svelte.d.ts +19 -19
- package/components/list/list.combo.svelte.d.ts +22 -22
- package/components/list/list.date.svelte.d.ts +18 -18
- package/components/list/list.inserter.svelte.d.ts +17 -17
- package/components/list/list.static.svelte.d.ts +17 -17
- package/components/list/list.summary.svelte.d.ts +19 -19
- package/components/list/list.svelte.d.ts +59 -59
- package/components/list/list.title.svelte.d.ts +22 -22
- package/components/menu.d.ts +5 -5
- package/components/menu.js +57 -57
- package/components/radio.svelte.d.ts +26 -26
- package/components/sidebar/sidebar.brand.svelte.d.ts +33 -33
- package/components/sidebar/sidebar.group.svelte +2 -2
- package/components/sidebar/sidebar.group.svelte.d.ts +33 -33
- package/components/sidebar/sidebar.item.svelte +52 -29
- package/components/sidebar/sidebar.item.svelte.d.ts +32 -32
- package/components/sidebar/sidebar.list.svelte +4 -2
- package/components/sidebar/sidebar.list.svelte.d.ts +38 -38
- package/components/sidebar/sidebar.svelte.d.ts +27 -27
- package/components/simple.table.svelte.d.ts +41 -41
- package/components/table/_template.table.svelte.d.ts +57 -57
- package/components/table/column.svelte.d.ts +19 -19
- package/components/table/item.svelte.d.ts +17 -17
- package/components/table/table.d.ts +11 -11
- package/components/table/table.js +11 -11
- package/components/table/table.svelte +6 -3
- package/components/table/table.svelte.d.ts +75 -75
- package/components/tag.colors.svelte.d.ts +17 -17
- package/components/tag.svelte +12 -9
- package/components/tag.svelte.d.ts +20 -20
- package/components/tags.svelte +13 -11
- package/components/tags.svelte.d.ts +32 -32
- package/components/textarea.ltop.svelte.d.ts +35 -35
- package/components/tile.title.svelte.d.ts +29 -29
- package/console.svelte.d.ts +23 -23
- package/desk.svelte +60 -27
- package/desk.svelte.d.ts +23 -23
- package/form.box.svelte.d.ts +35 -35
- package/horizontal.toolbar.svelte +3 -3
- package/horizontal.toolbar.svelte.d.ts +25 -25
- package/index.d.ts +63 -63
- package/index.js +69 -69
- package/internal/configurable.content.svelte.d.ts +29 -29
- package/internal/loading.svelte.d.ts +23 -23
- package/modal.svelte.d.ts +39 -39
- package/operations.svelte +37 -8
- package/operations.svelte.d.ts +16 -16
- package/package.json +9 -9
- package/page.row.svelte.d.ts +31 -31
- package/page.svelte +7 -2
- package/page.svelte.d.ts +47 -47
- package/stores.d.ts +45 -44
- package/stores.js +3 -2
- package/tenant.members.svelte +69 -39
- package/tenant.members.svelte.d.ts +33 -33
- package/tile.svelte.d.ts +33 -33
- package/tiles.row.svelte.d.ts +31 -31
- package/tiles.vertical.row.svelte.d.ts +29 -29
- package/updates.d.ts +4 -4
- package/utils.d.ts +50 -50
- package/utils.js +36 -7
- package/vertical.toolbar.svelte +1 -1
- package/vertical.toolbar.svelte.d.ts +27 -27
package/README.md
CHANGED
|
File without changes
|
package/components/Fab.svelte
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
<script>import { each } from "svelte/internal";
|
|
2
|
-
import { contextToolbarOperations, pageToolbarOperations, contextItemsStore } from "../stores.js";
|
|
2
|
+
import { contextToolbarOperations, pageToolbarOperations, contextItemsStore, toolsActionsOperations } from "../stores.js";
|
|
3
3
|
import { showFloatingToolbar, showMenu, showGridMenu } from "./menu.js";
|
|
4
4
|
import { FaChevronUp, FaChevronDown, FaChevronLeft, FaChevronRight, FaCircle } from "svelte-icons/fa/";
|
|
5
5
|
$:
|
|
6
|
-
|
|
6
|
+
setupCurrentContextOperations($pageToolbarOperations, $contextToolbarOperations, $toolsActionsOperations);
|
|
7
7
|
let operations = [];
|
|
8
8
|
let mainOperation = null;
|
|
9
9
|
let secondaryOperation = null;
|
|
@@ -11,17 +11,32 @@ let toolboxOperations = [];
|
|
|
11
11
|
let isExpandable = false;
|
|
12
12
|
let vToolboxExpanded = false;
|
|
13
13
|
let hToolboxExpanded = false;
|
|
14
|
-
let
|
|
15
|
-
function
|
|
16
|
-
|
|
14
|
+
let isDirectPositioningMode = false;
|
|
15
|
+
function setupCurrentContextOperations(...args) {
|
|
16
|
+
isDirectPositioningMode = false;
|
|
17
|
+
if ($toolsActionsOperations && Array.isArray($toolsActionsOperations) && toolsActionsOperations.length > 0) {
|
|
18
|
+
operations = $toolsActionsOperations;
|
|
19
|
+
} else if ($toolsActionsOperations && $toolsActionsOperations.operations && $toolsActionsOperations.operations.length > 0) {
|
|
20
|
+
operations = $toolsActionsOperations.operations;
|
|
21
|
+
if ($toolsActionsOperations.opver && $toolsActionsOperations.opver == 1)
|
|
22
|
+
isDirectPositioningMode = true;
|
|
23
|
+
} else if ($contextToolbarOperations && Array.isArray($contextToolbarOperations) && $contextToolbarOperations.length > 0) {
|
|
17
24
|
operations = $contextToolbarOperations;
|
|
18
|
-
else
|
|
19
|
-
operations = $
|
|
20
|
-
|
|
21
|
-
|
|
25
|
+
} else if ($contextToolbarOperations && $contextToolbarOperations.operations && $contextToolbarOperations.operations.length > 0) {
|
|
26
|
+
operations = $contextToolbarOperations.operations;
|
|
27
|
+
if ($contextToolbarOperations.opver && $contextToolbarOperations.opver == 1)
|
|
28
|
+
isDirectPositioningMode = true;
|
|
22
29
|
} else {
|
|
23
|
-
|
|
30
|
+
if (Array.isArray($pageToolbarOperations))
|
|
31
|
+
operations = $pageToolbarOperations;
|
|
32
|
+
else {
|
|
33
|
+
operations = $pageToolbarOperations.operations;
|
|
34
|
+
if ($pageToolbarOperations.opver && $pageToolbarOperations.opver == 1)
|
|
35
|
+
isDirectPositioningMode = true;
|
|
36
|
+
}
|
|
24
37
|
}
|
|
38
|
+
if (isDirectPositioningMode)
|
|
39
|
+
return;
|
|
25
40
|
if (operations.length > 0)
|
|
26
41
|
mainOperation = operations[0];
|
|
27
42
|
else
|
|
@@ -46,7 +61,6 @@ export function activateMainOperation() {
|
|
|
46
61
|
const mainOperationButton = document.getElementById("__hd_fab_mainOperation");
|
|
47
62
|
if (!mainOperationButton)
|
|
48
63
|
return;
|
|
49
|
-
console.log("activateMainOperation");
|
|
50
64
|
mainOperationButton.click();
|
|
51
65
|
}
|
|
52
66
|
function on_click(e, operation) {
|
|
@@ -100,33 +114,97 @@ function getSelectionPos() {
|
|
|
100
114
|
return 0;
|
|
101
115
|
}
|
|
102
116
|
function calculatePosition(operation) {
|
|
103
|
-
|
|
104
|
-
let result =
|
|
117
|
+
const isLeftHanded = false;
|
|
118
|
+
let result = "";
|
|
119
|
+
const fab = operation.fab;
|
|
120
|
+
if (fab.length != 3)
|
|
121
|
+
return "";
|
|
122
|
+
const section = fab[0];
|
|
123
|
+
const col_no = parseInt(fab[1]);
|
|
124
|
+
const row_no = parseInt(fab[2]);
|
|
125
|
+
if (col_no == NaN || row_no == NaN)
|
|
126
|
+
return "";
|
|
127
|
+
const width = 55;
|
|
128
|
+
const height = 55;
|
|
129
|
+
const margin = 10;
|
|
130
|
+
if (!isLeftHanded) {
|
|
131
|
+
switch (section) {
|
|
132
|
+
case "M":
|
|
133
|
+
result = `right: ${margin + col_no * width}px; bottom: ${margin + row_no * height}px`;
|
|
134
|
+
break;
|
|
135
|
+
case "S":
|
|
136
|
+
result = `left: ${margin + col_no * width}px; bottom: ${margin + row_no * height}px`;
|
|
137
|
+
break;
|
|
138
|
+
case "A":
|
|
139
|
+
result = `right: ${margin + col_no * width}px; top: calc(50vh - ${row_no * height}px)`;
|
|
140
|
+
break;
|
|
141
|
+
case "C":
|
|
142
|
+
result = `left: ${margin + col_no * width}px; top: calc(50vh - ${row_no * height}px)`;
|
|
143
|
+
break;
|
|
144
|
+
case "T":
|
|
145
|
+
result = `right: ${margin + col_no * width}px; top: ${margin + row_no * height}px`;
|
|
146
|
+
break;
|
|
147
|
+
case "F":
|
|
148
|
+
result = `left: ${margin + col_no * width}px; top: ${margin + row_no * height}px`;
|
|
149
|
+
break;
|
|
150
|
+
}
|
|
151
|
+
} else {
|
|
152
|
+
switch (section) {
|
|
153
|
+
case "M":
|
|
154
|
+
result = `left: ${margin + col_no * width}px; bottom: ${margin + row_no * height}px`;
|
|
155
|
+
break;
|
|
156
|
+
case "S":
|
|
157
|
+
result = `right: ${margin + col_no * width}px; bottom: ${margin + row_no * height}px`;
|
|
158
|
+
break;
|
|
159
|
+
case "A":
|
|
160
|
+
result = `left: ${margin + col_no * width}px; top: calc(50vh - ${row_no * height}px)`;
|
|
161
|
+
break;
|
|
162
|
+
case "C":
|
|
163
|
+
result = `right: ${margin + col_no * width}px; top: calc(50vh - ${row_no * height}px)`;
|
|
164
|
+
break;
|
|
165
|
+
case "T":
|
|
166
|
+
result = `left: ${margin + col_no * width}px; top: ${margin + row_no * height}px`;
|
|
167
|
+
break;
|
|
168
|
+
case "F":
|
|
169
|
+
result = `right: ${margin + col_no * width}px; top: ${margin + row_no * height}px`;
|
|
170
|
+
break;
|
|
171
|
+
}
|
|
172
|
+
}
|
|
105
173
|
return result;
|
|
106
174
|
}
|
|
107
175
|
function operationVisible(operation) {
|
|
108
|
-
|
|
176
|
+
if (!operation.fab)
|
|
177
|
+
return false;
|
|
178
|
+
return true;
|
|
109
179
|
}
|
|
110
180
|
</script>
|
|
111
181
|
|
|
112
|
-
{#if
|
|
182
|
+
{#if isDirectPositioningMode}
|
|
113
183
|
{#if operations && operations.length > 0}
|
|
114
|
-
{#each operations as
|
|
115
|
-
{#if
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
184
|
+
{#each operations as group}
|
|
185
|
+
{#if group.operations && group.operations.length > 0}
|
|
186
|
+
{#each group.operations as operation}
|
|
187
|
+
{#if operationVisible(operation)}
|
|
188
|
+
{@const position = calculatePosition(operation)}
|
|
189
|
+
{#if position}
|
|
190
|
+
<button
|
|
191
|
+
class="text-white bg-blue-700/70 hover:bg-blue-800 focus:outline-none focus:ring-4 focus:ring-blue-300
|
|
192
|
+
font-medium rounded-full text-sm text-center shadow-md
|
|
193
|
+
w-[35px] h-[35px]
|
|
194
|
+
fixed m-0
|
|
195
|
+
dark:bg-blue-600/50 dark:hover:bg-blue-700 dark:focus:ring-blue-800
|
|
196
|
+
flex items-center justify-center
|
|
197
|
+
disable-dbl-tap-zoom
|
|
198
|
+
cursor-pointer z-40"
|
|
199
|
+
style={position}
|
|
200
|
+
on:click|stopPropagation={(e) => {on_click(e, operation)}}
|
|
201
|
+
on:mousedown={mousedown} >
|
|
202
|
+
<div class="w-5 h-5"><svelte:component this={operation.icon}/></div>
|
|
203
|
+
</button>
|
|
204
|
+
{/if}
|
|
205
|
+
{/if}
|
|
206
|
+
{/each}
|
|
207
|
+
{/if}
|
|
130
208
|
{/each}
|
|
131
209
|
{/if}
|
|
132
210
|
{:else}
|
|
@@ -138,7 +216,7 @@ function operationVisible(operation) {
|
|
|
138
216
|
class="text-white bg-blue-700 hover:bg-blue-800 focus:outline-none focus:ring-4 focus:ring-blue-300
|
|
139
217
|
font-medium rounded-full text-sm text-center shadow-md
|
|
140
218
|
w-[55px] h-[55px]
|
|
141
|
-
fixed m-0
|
|
219
|
+
fixed m-0 bottom-0 right-[0px]
|
|
142
220
|
dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800
|
|
143
221
|
flex items-center justify-center
|
|
144
222
|
disable-dbl-tap-zoom"
|
|
@@ -151,7 +229,7 @@ function operationVisible(operation) {
|
|
|
151
229
|
{#if secondaryOperation || isExpandable}
|
|
152
230
|
|
|
153
231
|
<!-- horizontal container -->
|
|
154
|
-
<div class="flex flex-row m-0
|
|
232
|
+
<div class="flex flex-row m-0 fixed bottom-[10px] right-[60px]">
|
|
155
233
|
|
|
156
234
|
{#if isExpandable}
|
|
157
235
|
<!-- Expander -->
|
|
@@ -238,7 +316,7 @@ function operationVisible(operation) {
|
|
|
238
316
|
|
|
239
317
|
{#if operations.length > 2} <!-- has vertical operations -->
|
|
240
318
|
<!-- vertical tools container -->
|
|
241
|
-
<ul class="list-none m-0
|
|
319
|
+
<ul class="list-none m-0 fixed bottom-[70px] right-0">
|
|
242
320
|
{#if (isExpandable && vToolboxExpanded) || !isExpandable}
|
|
243
321
|
{@const verticalOperations = operations.slice(2).reverse()}
|
|
244
322
|
{#each verticalOperations as operation}
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { SvelteComponentTyped } from "svelte";
|
|
2
|
-
declare const __propDef: {
|
|
3
|
-
props: {
|
|
4
|
-
activateMainOperation?: (() => void) | undefined;
|
|
5
|
-
};
|
|
6
|
-
events: {
|
|
7
|
-
[evt: string]: CustomEvent<any>;
|
|
8
|
-
};
|
|
9
|
-
slots: {};
|
|
10
|
-
};
|
|
11
|
-
export type FabProps = typeof __propDef.props;
|
|
12
|
-
export type FabEvents = typeof __propDef.events;
|
|
13
|
-
export type FabSlots = typeof __propDef.slots;
|
|
14
|
-
export default class Fab extends SvelteComponentTyped<FabProps, FabEvents, FabSlots> {
|
|
15
|
-
get activateMainOperation(): () => void;
|
|
16
|
-
}
|
|
17
|
-
export {};
|
|
1
|
+
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
declare const __propDef: {
|
|
3
|
+
props: {
|
|
4
|
+
activateMainOperation?: (() => void) | undefined;
|
|
5
|
+
};
|
|
6
|
+
events: {
|
|
7
|
+
[evt: string]: CustomEvent<any>;
|
|
8
|
+
};
|
|
9
|
+
slots: {};
|
|
10
|
+
};
|
|
11
|
+
export type FabProps = typeof __propDef.props;
|
|
12
|
+
export type FabEvents = typeof __propDef.events;
|
|
13
|
+
export type FabSlots = typeof __propDef.slots;
|
|
14
|
+
export default class Fab extends SvelteComponentTyped<FabProps, FabEvents, FabSlots> {
|
|
15
|
+
get activateMainOperation(): () => void;
|
|
16
|
+
}
|
|
17
|
+
export {};
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
<script>import { tick, afterUpdate } from "svelte";
|
|
2
|
+
import { isDeviceSmallerThan } from "../utils";
|
|
3
|
+
import { toolsActionsOperations } from "../stores";
|
|
4
|
+
import { FaTimes } from "svelte-icons/fa";
|
|
2
5
|
let x;
|
|
3
6
|
let y;
|
|
4
7
|
let visible = false;
|
|
@@ -6,8 +9,6 @@ let toolbar;
|
|
|
6
9
|
let props = {};
|
|
7
10
|
let around_rect;
|
|
8
11
|
let root_element;
|
|
9
|
-
$:
|
|
10
|
-
display = visible ? "fixed" : "hidden";
|
|
11
12
|
export async function show(around, _toolbar, _props = {}) {
|
|
12
13
|
if (around instanceof DOMRect) {
|
|
13
14
|
x = around.left;
|
|
@@ -22,20 +23,44 @@ export async function show(around, _toolbar, _props = {}) {
|
|
|
22
23
|
visible = true;
|
|
23
24
|
toolbar = _toolbar;
|
|
24
25
|
props = _props;
|
|
26
|
+
cssPosition = calculatePosition(x, y, around_rect, true, true);
|
|
25
27
|
props.onHide = () => {
|
|
26
28
|
hide();
|
|
27
29
|
};
|
|
28
30
|
hide_window_indicator = 0;
|
|
29
31
|
window.addEventListener("click", on_before_window_click, true);
|
|
32
|
+
if (isDeviceSmallerThan("sm")) {
|
|
33
|
+
$toolsActionsOperations = {
|
|
34
|
+
opver: 1,
|
|
35
|
+
operations: [
|
|
36
|
+
{
|
|
37
|
+
caption: "Menu",
|
|
38
|
+
operations: [
|
|
39
|
+
{
|
|
40
|
+
icon: FaTimes,
|
|
41
|
+
action: (f) => {
|
|
42
|
+
hide();
|
|
43
|
+
},
|
|
44
|
+
fab: "M00",
|
|
45
|
+
tbr: "A"
|
|
46
|
+
}
|
|
47
|
+
]
|
|
48
|
+
}
|
|
49
|
+
]
|
|
50
|
+
};
|
|
51
|
+
}
|
|
30
52
|
await tick();
|
|
31
53
|
if (!was_visible)
|
|
32
54
|
root_element.addEventListener("click", on_before_container_click, true);
|
|
55
|
+
cssPosition = calculatePosition(x, y, around_rect, true, false);
|
|
33
56
|
}
|
|
34
57
|
export function isVisible() {
|
|
35
58
|
return visible;
|
|
36
59
|
}
|
|
37
60
|
export function hide() {
|
|
38
61
|
visible = false;
|
|
62
|
+
cssPosition = calculatePosition(x, y, around_rect, false, false);
|
|
63
|
+
$toolsActionsOperations = [];
|
|
39
64
|
window.removeEventListener("click", on_before_window_click, true);
|
|
40
65
|
root_element.removeEventListener("click", on_before_container_click, true);
|
|
41
66
|
}
|
|
@@ -52,28 +77,68 @@ function on_before_window_click() {
|
|
|
52
77
|
function on_before_container_click() {
|
|
53
78
|
hide_window_indicator--;
|
|
54
79
|
}
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
80
|
+
let cssPosition = "";
|
|
81
|
+
function calculatePosition(x2, y2, around, visible2, fresh) {
|
|
82
|
+
let result = "";
|
|
83
|
+
if (!visible2) {
|
|
84
|
+
result = "display: none";
|
|
85
|
+
} else if (isDeviceSmallerThan("sm")) {
|
|
86
|
+
let screenRect = new DOMRect();
|
|
87
|
+
screenRect.x = 0;
|
|
88
|
+
screenRect.y = 0;
|
|
89
|
+
screenRect.width = window.innerWidth;
|
|
90
|
+
screenRect.height = window.innerHeight;
|
|
91
|
+
const margin = 5;
|
|
92
|
+
let myRect = null;
|
|
93
|
+
if (!fresh) {
|
|
94
|
+
myRect = root_element.getBoundingClientRect();
|
|
95
|
+
if (myRect && myRect.height == 0)
|
|
96
|
+
myRect = null;
|
|
97
|
+
}
|
|
98
|
+
if (myRect) {
|
|
99
|
+
let maxHeight = screenRect.height / 2 - margin;
|
|
100
|
+
if (myRect.height < maxHeight)
|
|
101
|
+
maxHeight = myRect.height;
|
|
102
|
+
const width = screenRect.width - 2 * margin;
|
|
103
|
+
x2 = margin;
|
|
104
|
+
y2 = screenRect.bottom - maxHeight - margin;
|
|
105
|
+
result = `left: ${x2}px; top: ${y2}px; width: ${width}px; max-height: ${maxHeight}px; display: block`;
|
|
106
|
+
} else {
|
|
107
|
+
const maxHeight = screenRect.height / 2 - margin;
|
|
108
|
+
const width = screenRect.width - 2 * margin;
|
|
109
|
+
x2 = margin;
|
|
110
|
+
y2 = screenRect.bottom - maxHeight - margin;
|
|
111
|
+
result = `left: ${x2}px; top: ${y2}px; width: ${width}px; max-height: ${maxHeight}px; display: block`;
|
|
112
|
+
}
|
|
113
|
+
} else {
|
|
114
|
+
let myRect = null;
|
|
115
|
+
if (!fresh) {
|
|
116
|
+
myRect = root_element.getBoundingClientRect();
|
|
117
|
+
if (myRect && myRect.height == 0)
|
|
118
|
+
myRect = null;
|
|
119
|
+
}
|
|
120
|
+
const m = 15;
|
|
121
|
+
let screenRect = new DOMRect(m, 0, window.innerWidth - 2 * m, window.innerHeight);
|
|
122
|
+
if (myRect) {
|
|
123
|
+
if (myRect.right > screenRect.right)
|
|
124
|
+
x2 = screenRect.right - myRect.width;
|
|
125
|
+
if (myRect.bottom > screenRect.bottom)
|
|
126
|
+
y2 = screenRect.bottom - myRect.height - around_rect.height;
|
|
127
|
+
if (myRect.left < screenRect.left)
|
|
128
|
+
x2 = screenRect.left;
|
|
129
|
+
if (myRect.top < screenRect.top)
|
|
130
|
+
y2 = screenRect.top;
|
|
131
|
+
}
|
|
132
|
+
result = `left:${x2}px; top:${y2}px; width: max-content; height:max-content; display: block`;
|
|
133
|
+
}
|
|
134
|
+
console.log(result);
|
|
135
|
+
return result;
|
|
136
|
+
}
|
|
72
137
|
</script>
|
|
73
138
|
|
|
74
139
|
<div id="__hd_svelte_floating_container"
|
|
75
|
-
class="p-2 bg-stone-100 dark:bg-stone-800 rounded-lg shadow
|
|
76
|
-
style=
|
|
140
|
+
class="p-2 bg-stone-100 dark:bg-stone-800 rounded-lg shadow z-30 fixed"
|
|
141
|
+
style={cssPosition}
|
|
77
142
|
bind:this={root_element}>
|
|
78
143
|
<svelte:component this={toolbar} {...props} />
|
|
79
144
|
</div>
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import { SvelteComponentTyped } from "svelte";
|
|
2
|
-
declare const __propDef: {
|
|
3
|
-
props: {
|
|
4
|
-
show?: ((around: DOMRect | DOMPoint, _toolbar: any, _props?: {}) => Promise<void>) | undefined;
|
|
5
|
-
isVisible?: (() => boolean) | undefined;
|
|
6
|
-
hide?: (() => void) | undefined;
|
|
7
|
-
};
|
|
8
|
-
events: {
|
|
9
|
-
[evt: string]: CustomEvent<any>;
|
|
10
|
-
};
|
|
11
|
-
slots: {};
|
|
12
|
-
};
|
|
13
|
-
export type FloatingContainerProps = typeof __propDef.props;
|
|
14
|
-
export type FloatingContainerEvents = typeof __propDef.events;
|
|
15
|
-
export type FloatingContainerSlots = typeof __propDef.slots;
|
|
16
|
-
export default class FloatingContainer extends SvelteComponentTyped<FloatingContainerProps, FloatingContainerEvents, FloatingContainerSlots> {
|
|
17
|
-
get show(): (around: DOMRect | DOMPoint, _toolbar: any, _props?: {}) => Promise<void>;
|
|
18
|
-
get isVisible(): () => boolean;
|
|
19
|
-
get hide(): () => void;
|
|
20
|
-
}
|
|
21
|
-
export {};
|
|
1
|
+
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
declare const __propDef: {
|
|
3
|
+
props: {
|
|
4
|
+
show?: ((around: DOMRect | DOMPoint, _toolbar: any, _props?: {}) => Promise<void>) | undefined;
|
|
5
|
+
isVisible?: (() => boolean) | undefined;
|
|
6
|
+
hide?: (() => void) | undefined;
|
|
7
|
+
};
|
|
8
|
+
events: {
|
|
9
|
+
[evt: string]: CustomEvent<any>;
|
|
10
|
+
};
|
|
11
|
+
slots: {};
|
|
12
|
+
};
|
|
13
|
+
export type FloatingContainerProps = typeof __propDef.props;
|
|
14
|
+
export type FloatingContainerEvents = typeof __propDef.events;
|
|
15
|
+
export type FloatingContainerSlots = typeof __propDef.slots;
|
|
16
|
+
export default class FloatingContainer extends SvelteComponentTyped<FloatingContainerProps, FloatingContainerEvents, FloatingContainerSlots> {
|
|
17
|
+
get show(): (around: DOMRect | DOMPoint, _toolbar: any, _props?: {}) => Promise<void>;
|
|
18
|
+
get isVisible(): () => boolean;
|
|
19
|
+
get hide(): () => void;
|
|
20
|
+
}
|
|
21
|
+
export {};
|
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
/** @typedef {typeof __propDef.props} GridProps */
|
|
2
|
-
/** @typedef {typeof __propDef.events} GridEvents */
|
|
3
|
-
/** @typedef {typeof __propDef.slots} GridSlots */
|
|
4
|
-
export default class Grid extends SvelteComponentTyped<{
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
}, {
|
|
8
|
-
[evt: string]: CustomEvent<any>;
|
|
9
|
-
}, {}> {
|
|
10
|
-
}
|
|
11
|
-
export type GridProps = typeof __propDef.props;
|
|
12
|
-
export type GridEvents = typeof __propDef.events;
|
|
13
|
-
export type GridSlots = typeof __propDef.slots;
|
|
14
|
-
import { SvelteComponentTyped } from "svelte";
|
|
15
|
-
declare const __propDef: {
|
|
16
|
-
props: {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
};
|
|
20
|
-
events: {
|
|
21
|
-
[evt: string]: CustomEvent<any>;
|
|
22
|
-
};
|
|
23
|
-
slots: {};
|
|
24
|
-
};
|
|
25
|
-
export {};
|
|
1
|
+
/** @typedef {typeof __propDef.props} GridProps */
|
|
2
|
+
/** @typedef {typeof __propDef.events} GridEvents */
|
|
3
|
+
/** @typedef {typeof __propDef.slots} GridSlots */
|
|
4
|
+
export default class Grid extends SvelteComponentTyped<{
|
|
5
|
+
operations?: any[] | undefined;
|
|
6
|
+
onHide?: any;
|
|
7
|
+
}, {
|
|
8
|
+
[evt: string]: CustomEvent<any>;
|
|
9
|
+
}, {}> {
|
|
10
|
+
}
|
|
11
|
+
export type GridProps = typeof __propDef.props;
|
|
12
|
+
export type GridEvents = typeof __propDef.events;
|
|
13
|
+
export type GridSlots = typeof __propDef.slots;
|
|
14
|
+
import { SvelteComponentTyped } from "svelte";
|
|
15
|
+
declare const __propDef: {
|
|
16
|
+
props: {
|
|
17
|
+
operations?: any[] | undefined;
|
|
18
|
+
onHide?: any;
|
|
19
|
+
};
|
|
20
|
+
events: {
|
|
21
|
+
[evt: string]: CustomEvent<any>;
|
|
22
|
+
};
|
|
23
|
+
slots: {};
|
|
24
|
+
};
|
|
25
|
+
export {};
|
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
import { SvelteComponentTyped } from "svelte";
|
|
2
|
-
declare const __propDef: {
|
|
3
|
-
props: {
|
|
4
|
-
[x: string]: any;
|
|
5
|
-
self?: null | undefined;
|
|
6
|
-
operation?: string | undefined;
|
|
7
|
-
params?: null | undefined;
|
|
8
|
-
context?: string | undefined;
|
|
9
|
-
typename?: string | undefined;
|
|
10
|
-
action?: null | undefined;
|
|
11
|
-
hiddenFunc?: undefined;
|
|
12
|
-
disabledFunc?: undefined;
|
|
13
|
-
};
|
|
14
|
-
events: {
|
|
15
|
-
[evt: string]: CustomEvent<any>;
|
|
16
|
-
};
|
|
17
|
-
slots: {
|
|
18
|
-
default: {};
|
|
19
|
-
};
|
|
20
|
-
};
|
|
21
|
-
export type ButtonProps = typeof __propDef.props;
|
|
22
|
-
export type ButtonEvents = typeof __propDef.events;
|
|
23
|
-
export type ButtonSlots = typeof __propDef.slots;
|
|
24
|
-
export default class Button extends SvelteComponentTyped<ButtonProps, ButtonEvents, ButtonSlots> {
|
|
25
|
-
}
|
|
26
|
-
export {};
|
|
1
|
+
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
declare const __propDef: {
|
|
3
|
+
props: {
|
|
4
|
+
[x: string]: any;
|
|
5
|
+
self?: null | undefined;
|
|
6
|
+
operation?: string | undefined;
|
|
7
|
+
params?: null | undefined;
|
|
8
|
+
context?: string | undefined;
|
|
9
|
+
typename?: string | undefined;
|
|
10
|
+
action?: null | undefined;
|
|
11
|
+
hiddenFunc?: undefined;
|
|
12
|
+
disabledFunc?: undefined;
|
|
13
|
+
};
|
|
14
|
+
events: {
|
|
15
|
+
[evt: string]: CustomEvent<any>;
|
|
16
|
+
};
|
|
17
|
+
slots: {
|
|
18
|
+
default: {};
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
export type ButtonProps = typeof __propDef.props;
|
|
22
|
+
export type ButtonEvents = typeof __propDef.events;
|
|
23
|
+
export type ButtonSlots = typeof __propDef.slots;
|
|
24
|
+
export default class Button extends SvelteComponentTyped<ButtonProps, ButtonEvents, ButtonSlots> {
|
|
25
|
+
}
|
|
26
|
+
export {};
|
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
import { SvelteComponentTyped } from "svelte";
|
|
2
|
-
declare const __propDef: {
|
|
3
|
-
props: {
|
|
4
|
-
[x: string]: any;
|
|
5
|
-
checked?: boolean | undefined;
|
|
6
|
-
disabled?: boolean | undefined;
|
|
7
|
-
self?: null | undefined;
|
|
8
|
-
a?: string | undefined;
|
|
9
|
-
context?: string | undefined;
|
|
10
|
-
typename?: string | undefined;
|
|
11
|
-
c?: string | undefined;
|
|
12
|
-
pushChangesImmediately?: boolean | undefined;
|
|
13
|
-
};
|
|
14
|
-
events: {
|
|
15
|
-
[evt: string]: CustomEvent<any>;
|
|
16
|
-
};
|
|
17
|
-
slots: {
|
|
18
|
-
default: {};
|
|
19
|
-
};
|
|
20
|
-
};
|
|
21
|
-
export type CheckboxProps = typeof __propDef.props;
|
|
22
|
-
export type CheckboxEvents = typeof __propDef.events;
|
|
23
|
-
export type CheckboxSlots = typeof __propDef.slots;
|
|
24
|
-
export default class Checkbox extends SvelteComponentTyped<CheckboxProps, CheckboxEvents, CheckboxSlots> {
|
|
25
|
-
}
|
|
26
|
-
export {};
|
|
1
|
+
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
declare const __propDef: {
|
|
3
|
+
props: {
|
|
4
|
+
[x: string]: any;
|
|
5
|
+
checked?: boolean | undefined;
|
|
6
|
+
disabled?: boolean | undefined;
|
|
7
|
+
self?: null | undefined;
|
|
8
|
+
a?: string | undefined;
|
|
9
|
+
context?: string | undefined;
|
|
10
|
+
typename?: string | undefined;
|
|
11
|
+
c?: string | undefined;
|
|
12
|
+
pushChangesImmediately?: boolean | undefined;
|
|
13
|
+
};
|
|
14
|
+
events: {
|
|
15
|
+
[evt: string]: CustomEvent<any>;
|
|
16
|
+
};
|
|
17
|
+
slots: {
|
|
18
|
+
default: {};
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
export type CheckboxProps = typeof __propDef.props;
|
|
22
|
+
export type CheckboxEvents = typeof __propDef.events;
|
|
23
|
+
export type CheckboxSlots = typeof __propDef.slots;
|
|
24
|
+
export default class Checkbox extends SvelteComponentTyped<CheckboxProps, CheckboxEvents, CheckboxSlots> {
|
|
25
|
+
}
|
|
26
|
+
export {};
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
export declare class rCombo_item {
|
|
2
|
-
Key: any | undefined;
|
|
3
|
-
Name: string | undefined;
|
|
4
|
-
Avatar: string | undefined;
|
|
5
|
-
Color: string | undefined;
|
|
6
|
-
Icon: any | undefined;
|
|
7
|
-
}
|
|
8
|
-
export declare class rCombo_definition {
|
|
9
|
-
source: rCombo_item[];
|
|
10
|
-
collection_expr: string | undefined;
|
|
11
|
-
collection_path: string | undefined;
|
|
12
|
-
collection: object[] | undefined;
|
|
13
|
-
onCollect: undefined;
|
|
14
|
-
element_key: string | undefined;
|
|
15
|
-
element_name: string | undefined;
|
|
16
|
-
element_avatar: string | undefined;
|
|
17
|
-
element_icon: string | undefined;
|
|
18
|
-
}
|
|
19
|
-
export declare const cached_sources: Map<string, Promise<object>>;
|
|
1
|
+
export declare class rCombo_item {
|
|
2
|
+
Key: any | undefined;
|
|
3
|
+
Name: string | undefined;
|
|
4
|
+
Avatar: string | undefined;
|
|
5
|
+
Color: string | undefined;
|
|
6
|
+
Icon: any | undefined;
|
|
7
|
+
}
|
|
8
|
+
export declare class rCombo_definition {
|
|
9
|
+
source: rCombo_item[];
|
|
10
|
+
collection_expr: string | undefined;
|
|
11
|
+
collection_path: string | undefined;
|
|
12
|
+
collection: object[] | undefined;
|
|
13
|
+
onCollect: undefined;
|
|
14
|
+
element_key: string | undefined;
|
|
15
|
+
element_name: string | undefined;
|
|
16
|
+
element_avatar: string | undefined;
|
|
17
|
+
element_icon: string | undefined;
|
|
18
|
+
}
|
|
19
|
+
export declare const cached_sources: Map<string, Promise<object>>;
|