@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.
Files changed (139) hide show
  1. package/README.md +0 -0
  2. package/components/Fab.svelte +112 -34
  3. package/components/Fab.svelte.d.ts +17 -17
  4. package/components/Floating_container.svelte +86 -21
  5. package/components/Floating_container.svelte.d.ts +21 -21
  6. package/components/Grid.menu.svelte.d.ts +25 -25
  7. package/components/button.svelte.d.ts +26 -26
  8. package/components/checkbox.svelte.d.ts +26 -26
  9. package/components/combo/combo.d.ts +19 -19
  10. package/components/combo/combo.item.svelte.d.ts +20 -20
  11. package/components/combo/combo.js +19 -19
  12. package/components/combo/combo.source.svelte.d.ts +23 -23
  13. package/components/combo/combo.svelte +64 -30
  14. package/components/combo/combo.svelte.d.ts +44 -44
  15. package/components/contextmenu.svelte +97 -30
  16. package/components/contextmenu.svelte.d.ts +26 -26
  17. package/components/date.svelte +40 -30
  18. package/components/date.svelte.d.ts +33 -33
  19. package/components/delayed.spinner.svelte.d.ts +19 -19
  20. package/components/document/editor.svelte +33 -6
  21. package/components/document/editor.svelte.d.ts +35 -35
  22. package/components/document/internal/Document_command.d.ts +12 -11
  23. package/components/document/internal/Document_command.js +12 -11
  24. package/components/document/internal/Selection_helper.d.ts +7 -7
  25. package/components/document/internal/Selection_helper.js +133 -133
  26. package/components/document/internal/Selection_range.d.ts +26 -26
  27. package/components/document/internal/Selection_range.js +58 -58
  28. package/components/document/internal/findSuggestionMatch.d.ts +16 -16
  29. package/components/document/internal/findSuggestionMatch.js +51 -51
  30. package/components/document/internal/h1.icon.svelte.d.ts +23 -23
  31. package/components/document/internal/h2.icon.svelte.d.ts +23 -23
  32. package/components/document/internal/h3.icon.svelte.d.ts +23 -23
  33. package/components/document/internal/h4.icon.svelte.d.ts +23 -23
  34. package/components/document/internal/palette.row.big.svelte.d.ts +46 -46
  35. package/components/document/internal/palette.row.svelte +1 -1
  36. package/components/document/internal/palette.row.svelte.d.ts +46 -46
  37. package/components/document/internal/palette.svelte +23 -15
  38. package/components/document/internal/palette.svelte.d.ts +82 -82
  39. package/components/document/internal/suggestion.d.ts +158 -158
  40. package/components/document/internal/suggestion.js +194 -194
  41. package/components/document/rich.edit.svelte.d.ts +34 -34
  42. package/components/edit.field.svelte.d.ts +31 -31
  43. package/components/file.loader.svelte.d.ts +25 -25
  44. package/components/icon.ex.svelte.d.ts +62 -62
  45. package/components/icon.svelte.d.ts +62 -62
  46. package/components/input.text.svelte.d.ts +29 -29
  47. package/components/inputbox.ltop.svelte.d.ts +59 -59
  48. package/components/kanban/Kanban.d.ts +47 -47
  49. package/components/kanban/Kanban.js +105 -105
  50. package/components/kanban/internal/kanban.card.svelte +5 -3
  51. package/components/kanban/internal/kanban.card.svelte.d.ts +32 -32
  52. package/components/kanban/internal/kanban.column.svelte.d.ts +53 -53
  53. package/components/kanban/internal/kanban.inserter.svelte.d.ts +18 -18
  54. package/components/kanban/internal/kanban.move.menu.svelte +135 -135
  55. package/components/kanban/internal/kanban.move.menu.svelte.d.ts +22 -22
  56. package/components/kanban/internal/kanban.props.svelte.d.ts +19 -19
  57. package/components/kanban/kanban.callbacks.svelte +1 -1
  58. package/components/kanban/kanban.callbacks.svelte.d.ts +18 -18
  59. package/components/kanban/kanban.column.svelte.d.ts +21 -21
  60. package/components/kanban/kanban.combo.svelte.d.ts +25 -25
  61. package/components/kanban/kanban.date.svelte +1 -1
  62. package/components/kanban/kanban.date.svelte.d.ts +21 -21
  63. package/components/kanban/kanban.source.svelte.d.ts +23 -23
  64. package/components/kanban/kanban.static.svelte.d.ts +20 -20
  65. package/components/kanban/kanban.summary.svelte.d.ts +18 -18
  66. package/components/kanban/kanban.svelte.d.ts +65 -65
  67. package/components/kanban/kanban.tags.svelte.d.ts +24 -24
  68. package/components/kanban/kanban.title.svelte.d.ts +21 -21
  69. package/components/list/List.d.ts +46 -46
  70. package/components/list/List.js +54 -54
  71. package/components/list/internal/list.element.props.svelte +2 -2
  72. package/components/list/internal/list.element.props.svelte.d.ts +21 -21
  73. package/components/list/internal/list.element.summary.svelte +46 -46
  74. package/components/list/internal/list.element.summary.svelte.d.ts +24 -24
  75. package/components/list/internal/list.element.svelte +8 -6
  76. package/components/list/internal/list.element.svelte.d.ts +31 -31
  77. package/components/list/internal/list.inserter.svelte.d.ts +19 -19
  78. package/components/list/list.combo.svelte.d.ts +22 -22
  79. package/components/list/list.date.svelte.d.ts +18 -18
  80. package/components/list/list.inserter.svelte.d.ts +17 -17
  81. package/components/list/list.static.svelte.d.ts +17 -17
  82. package/components/list/list.summary.svelte.d.ts +19 -19
  83. package/components/list/list.svelte.d.ts +59 -59
  84. package/components/list/list.title.svelte.d.ts +22 -22
  85. package/components/menu.d.ts +5 -5
  86. package/components/menu.js +57 -57
  87. package/components/radio.svelte.d.ts +26 -26
  88. package/components/sidebar/sidebar.brand.svelte.d.ts +33 -33
  89. package/components/sidebar/sidebar.group.svelte +2 -2
  90. package/components/sidebar/sidebar.group.svelte.d.ts +33 -33
  91. package/components/sidebar/sidebar.item.svelte +52 -29
  92. package/components/sidebar/sidebar.item.svelte.d.ts +32 -32
  93. package/components/sidebar/sidebar.list.svelte +4 -2
  94. package/components/sidebar/sidebar.list.svelte.d.ts +38 -38
  95. package/components/sidebar/sidebar.svelte.d.ts +27 -27
  96. package/components/simple.table.svelte.d.ts +41 -41
  97. package/components/table/_template.table.svelte.d.ts +57 -57
  98. package/components/table/column.svelte.d.ts +19 -19
  99. package/components/table/item.svelte.d.ts +17 -17
  100. package/components/table/table.d.ts +11 -11
  101. package/components/table/table.js +11 -11
  102. package/components/table/table.svelte +6 -3
  103. package/components/table/table.svelte.d.ts +75 -75
  104. package/components/tag.colors.svelte.d.ts +17 -17
  105. package/components/tag.svelte +12 -9
  106. package/components/tag.svelte.d.ts +20 -20
  107. package/components/tags.svelte +13 -11
  108. package/components/tags.svelte.d.ts +32 -32
  109. package/components/textarea.ltop.svelte.d.ts +35 -35
  110. package/components/tile.title.svelte.d.ts +29 -29
  111. package/console.svelte.d.ts +23 -23
  112. package/desk.svelte +60 -27
  113. package/desk.svelte.d.ts +23 -23
  114. package/form.box.svelte.d.ts +35 -35
  115. package/horizontal.toolbar.svelte +3 -3
  116. package/horizontal.toolbar.svelte.d.ts +25 -25
  117. package/index.d.ts +63 -63
  118. package/index.js +69 -69
  119. package/internal/configurable.content.svelte.d.ts +29 -29
  120. package/internal/loading.svelte.d.ts +23 -23
  121. package/modal.svelte.d.ts +39 -39
  122. package/operations.svelte +37 -8
  123. package/operations.svelte.d.ts +16 -16
  124. package/package.json +9 -9
  125. package/page.row.svelte.d.ts +31 -31
  126. package/page.svelte +7 -2
  127. package/page.svelte.d.ts +47 -47
  128. package/stores.d.ts +45 -44
  129. package/stores.js +3 -2
  130. package/tenant.members.svelte +69 -39
  131. package/tenant.members.svelte.d.ts +33 -33
  132. package/tile.svelte.d.ts +33 -33
  133. package/tiles.row.svelte.d.ts +31 -31
  134. package/tiles.vertical.row.svelte.d.ts +29 -29
  135. package/updates.d.ts +4 -4
  136. package/utils.d.ts +50 -50
  137. package/utils.js +36 -7
  138. package/vertical.toolbar.svelte +1 -1
  139. package/vertical.toolbar.svelte.d.ts +27 -27
package/README.md CHANGED
File without changes
@@ -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
- update($pageToolbarOperations, $contextToolbarOperations);
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 isMain = false;
15
- function update(...args) {
16
- if ($contextToolbarOperations && $contextToolbarOperations.length > 0)
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 = $pageToolbarOperations;
20
- if (operations && operations.length > 0 && operations[0].main) {
21
- isMain = true;
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
- isMain = false;
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
- let right = 0;
104
- let result = `bottom: 10px; right:${right}px`;
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
- return false;
176
+ if (!operation.fab)
177
+ return false;
178
+ return true;
109
179
  }
110
180
  </script>
111
181
 
112
- {#if isMain}
182
+ {#if isDirectPositioningMode}
113
183
  {#if operations && operations.length > 0}
114
- {#each operations as operation, idx}
115
- {#if operationVisible(operation)}
116
- <button
117
- class="text-white bg-blue-700 hover:bg-blue-800 focus:outline-none focus:ring-4 focus:ring-blue-300
118
- font-medium rounded-full text-sm text-center shadow-md
119
- w-[55px] h-[55px]
120
- fixed m-0 absolute bottom-0
121
- dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800
122
- flex items-center justify-center
123
- disable-dbl-tap-zoom"
124
- style={calculatePosition(operation)}
125
- on:click|stopPropagation={(e) => {on_click(e, mainOperation)}}
126
- on:mousedown={mousedown} >
127
- <div class="w-7 h-7"><svelte:component this={operation.icon}/></div>
128
- </button>
129
- {/if}
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 absolute bottom-0 right-[0px]
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 absolute bottom-[10px] right-[60px]">
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 absolute bottom-[70px] right-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
- afterUpdate(() => {
56
- if (!root_element)
57
- return;
58
- let rect = root_element.getBoundingClientRect();
59
- if (rect.height == 0)
60
- return;
61
- const m = 15;
62
- let container_rect = new DOMRect(m, 0, window.innerWidth - 2 * m, window.innerHeight);
63
- if (rect.right > container_rect.right)
64
- x = container_rect.right - rect.width;
65
- if (rect.bottom > container_rect.bottom)
66
- y = container_rect.bottom - rect.height - around_rect.height;
67
- if (rect.left < container_rect.left)
68
- x = container_rect.left;
69
- if (rect.top < container_rect.top)
70
- y = container_rect.top;
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 {display} z-30"
76
- style="left:{x}px; top:{y}px; width: max-content; height:max-content"
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
- onHide?: any;
6
- operations?: any[] | undefined;
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
- onHide?: any;
18
- operations?: any[] | undefined;
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>>;