domma-js 0.56.0 → 0.57.0
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/assets/types/generated/public/assets/flags/africa.d.ts +6 -0
- package/assets/types/generated/public/assets/flags/americas.d.ts +6 -0
- package/assets/types/generated/public/assets/flags/asia.d.ts +6 -0
- package/assets/types/generated/public/assets/flags/europe.d.ts +9 -0
- package/assets/types/generated/public/assets/flags/index.d.ts +11 -0
- package/assets/types/generated/public/assets/flags/oceania.d.ts +2 -0
- package/assets/types/generated/public/assets/icons/buildings.d.ts +6 -0
- package/assets/types/generated/public/assets/icons/code.d.ts +2 -0
- package/assets/types/generated/public/assets/icons/commerce.d.ts +7 -0
- package/assets/types/generated/public/assets/icons/communication.d.ts +7 -0
- package/assets/types/generated/public/assets/icons/devices.d.ts +6 -0
- package/assets/types/generated/public/assets/icons/emojis.d.ts +6 -0
- package/assets/types/generated/public/assets/icons/files.d.ts +7 -0
- package/assets/types/generated/public/assets/icons/finance.d.ts +6 -0
- package/assets/types/generated/public/assets/icons/forms.d.ts +5 -0
- package/assets/types/generated/public/assets/icons/health.d.ts +6 -0
- package/assets/types/generated/public/assets/icons/index.d.ts +24 -0
- package/assets/types/generated/public/assets/icons/media.d.ts +7 -0
- package/assets/types/generated/public/assets/icons/navigation.d.ts +7 -0
- package/assets/types/generated/public/assets/icons/seasonal.d.ts +6 -0
- package/assets/types/generated/public/assets/icons/social.d.ts +7 -0
- package/assets/types/generated/public/assets/icons/sport.d.ts +6 -0
- package/assets/types/generated/public/assets/icons/status.d.ts +7 -0
- package/assets/types/generated/public/assets/icons/transport.d.ts +7 -0
- package/assets/types/generated/public/assets/icons/ui.d.ts +7 -0
- package/assets/types/generated/public/assets/icons/weather.d.ts +6 -0
- package/assets/types/generated/src/auth.d.ts +424 -0
- package/assets/types/generated/src/avatar.d.ts +270 -0
- package/assets/types/generated/src/binding-source.d.ts +58 -0
- package/assets/types/generated/src/butterfly-drawing.d.ts +2 -0
- package/assets/types/generated/src/component-factory.d.ts +150 -0
- package/assets/types/generated/src/component.d.ts +162 -0
- package/assets/types/generated/src/components/back-to-top.d.ts +150 -0
- package/assets/types/generated/src/components/badge.d.ts +208 -0
- package/assets/types/generated/src/components/card.d.ts +189 -0
- package/assets/types/generated/src/components/command-palette.d.ts +352 -0
- package/assets/types/generated/src/components/dropzone.d.ts +342 -0
- package/assets/types/generated/src/components/focus-trap.d.ts +238 -0
- package/assets/types/generated/src/components/loader.d.ts +133 -0
- package/assets/types/generated/src/components/modal.d.ts +341 -0
- package/assets/types/generated/src/components/range-slider.d.ts +267 -0
- package/assets/types/generated/src/components/shared.d.ts +91 -0
- package/assets/types/generated/src/components/split-pane.d.ts +239 -0
- package/assets/types/generated/src/components/toast.d.ts +284 -0
- package/assets/types/generated/src/components/tooltip.d.ts +200 -0
- package/assets/types/generated/src/components/virtual-list.d.ts +340 -0
- package/assets/types/generated/src/config.d.ts +193 -0
- package/assets/types/generated/src/context-cursor.d.ts +69 -0
- package/assets/types/generated/src/context-menu.d.ts +596 -0
- package/assets/types/generated/src/dates.d.ts +367 -0
- package/assets/types/generated/src/dom.d.ts +1221 -0
- package/assets/types/generated/src/effects.d.ts +1281 -0
- package/assets/types/generated/src/elements.d.ts +4996 -0
- package/assets/types/generated/src/escape.d.ts +5 -0
- package/assets/types/generated/src/flags-bundle.d.ts +4 -0
- package/assets/types/generated/src/flags.d.ts +338 -0
- package/assets/types/generated/src/forms.d.ts +1060 -0
- package/assets/types/generated/src/globals.d.ts +45 -0
- package/assets/types/generated/src/http.d.ts +131 -0
- package/assets/types/generated/src/i18n.d.ts +261 -0
- package/assets/types/generated/src/icons.d.ts +213 -0
- package/assets/types/generated/src/index.d.ts +249 -0
- package/assets/types/generated/src/input-group.d.ts +135 -0
- package/assets/types/generated/src/models.d.ts +968 -0
- package/assets/types/generated/src/popover.d.ts +412 -0
- package/assets/types/generated/src/router.d.ts +344 -0
- package/assets/types/generated/src/safe-url.d.ts +10 -0
- package/assets/types/generated/src/sanitize.d.ts +97 -0
- package/assets/types/generated/src/schema-builder.d.ts +420 -0
- package/assets/types/generated/src/skeleton.d.ts +135 -0
- package/assets/types/generated/src/smooth-caret.d.ts +61 -0
- package/assets/types/generated/src/sortable.d.ts +369 -0
- package/assets/types/generated/src/storage.d.ts +93 -0
- package/assets/types/generated/src/tables.d.ts +901 -0
- package/assets/types/generated/src/theme.d.ts +277 -0
- package/assets/types/generated/src/ticker-tape-drawing.d.ts +2 -0
- package/assets/types/generated/src/treeview.d.ts +504 -0
- package/assets/types/generated/src/utils.d.ts +1667 -0
- package/assets/types/generated/src/web-components/base/domma-element.d.ts +134 -0
- package/assets/types/generated/src/web-components/index.d.ts +14 -0
- package/assets/types/generated/vendor/domma-reactive.d.ts +587 -0
- package/assets/types/index.d.ts +104 -226
- package/package.json +5 -2
- package/public/dist/bundles/domma-complete.css +20 -14
- package/public/dist/bundles/domma-data-focused.css +20 -14
- package/public/dist/bundles/domma-essentials.css +20 -14
- package/public/dist/bundles/domma-full.css +20 -14
- package/public/dist/bundles/domma-minimal.css +8 -8
- package/public/dist/domma-flags.esm.js +3 -3
- package/public/dist/domma-flags.esm.js.map +1 -1
- package/public/dist/domma-flags.min.js +3 -3
- package/public/dist/domma-flags.min.js.map +1 -1
- package/public/dist/domma-syntax.min.js +3 -3
- package/public/dist/domma.css +3 -3
- package/public/dist/domma.esm.js +5 -5
- package/public/dist/domma.esm.js.map +1 -1
- package/public/dist/domma.min.js +5 -5
- package/public/dist/domma.min.js.map +1 -1
- package/public/dist/elements.css +9 -3
- package/public/dist/grid.css +3 -3
- package/public/dist/syntax.css +3 -3
- package/public/dist/themes/domma-themes.css +3 -3
- package/templates/kickstart/frontend/types/domma.d.ts +2 -1
- package/assets/types/config.d.ts +0 -136
- package/assets/types/dates.d.ts +0 -209
- package/assets/types/dom.d.ts +0 -448
- package/assets/types/elements.d.ts +0 -1168
- package/assets/types/flags.d.ts +0 -130
- package/assets/types/http.d.ts +0 -97
- package/assets/types/i18n.d.ts +0 -99
- package/assets/types/icons.d.ts +0 -147
- package/assets/types/models.d.ts +0 -260
- package/assets/types/smooth-caret.d.ts +0 -12
- package/assets/types/storage.d.ts +0 -93
- package/assets/types/tables.d.ts +0 -327
- package/assets/types/theme.d.ts +0 -137
- package/assets/types/utils.d.ts +0 -675
|
@@ -0,0 +1,369 @@
|
|
|
1
|
+
export default Sortable;
|
|
2
|
+
/**
|
|
3
|
+
* Where an indicator-mode drop lands relative to its target.
|
|
4
|
+
*/
|
|
5
|
+
export type SortableZone = "before" | "after" | "into";
|
|
6
|
+
export type SortableStartDetail = {
|
|
7
|
+
item: HTMLElement;
|
|
8
|
+
/**
|
|
9
|
+
* - Index of the item when the drag began
|
|
10
|
+
*/
|
|
11
|
+
from: number;
|
|
12
|
+
};
|
|
13
|
+
export type SortableMoveDetail = {
|
|
14
|
+
item: HTMLElement;
|
|
15
|
+
/**
|
|
16
|
+
* - The item under the pointer (indicator mode: the accepted drop target), or null
|
|
17
|
+
*/
|
|
18
|
+
target: HTMLElement | null;
|
|
19
|
+
/**
|
|
20
|
+
* - Indicator mode only; null in live mode
|
|
21
|
+
*/
|
|
22
|
+
zone: SortableZone | null;
|
|
23
|
+
x: number;
|
|
24
|
+
y: number;
|
|
25
|
+
};
|
|
26
|
+
export type SortableSortDetail = {
|
|
27
|
+
item: HTMLElement;
|
|
28
|
+
from: number;
|
|
29
|
+
to: number;
|
|
30
|
+
/**
|
|
31
|
+
* - Every item's key, in the new order
|
|
32
|
+
*/
|
|
33
|
+
order: (string | null)[];
|
|
34
|
+
/**
|
|
35
|
+
* - Every item's key, in the order before the drag
|
|
36
|
+
*/
|
|
37
|
+
previous: (string | null)[];
|
|
38
|
+
};
|
|
39
|
+
export type SortableDropDetail = {
|
|
40
|
+
/**
|
|
41
|
+
* - The dragged element (it has not moved - the host re-renders)
|
|
42
|
+
*/
|
|
43
|
+
item: HTMLElement;
|
|
44
|
+
/**
|
|
45
|
+
* - The item it was dropped on or beside
|
|
46
|
+
*/
|
|
47
|
+
target: HTMLElement;
|
|
48
|
+
zone: SortableZone;
|
|
49
|
+
/**
|
|
50
|
+
* - Value of the `key` attribute on the dragged item
|
|
51
|
+
*/
|
|
52
|
+
key: string | null;
|
|
53
|
+
/**
|
|
54
|
+
* - Value of the `key` attribute on the target
|
|
55
|
+
*/
|
|
56
|
+
targetKey: string | null;
|
|
57
|
+
};
|
|
58
|
+
export type SortableEndDetail = {
|
|
59
|
+
item: HTMLElement;
|
|
60
|
+
/**
|
|
61
|
+
* - Whether the order changed
|
|
62
|
+
*/
|
|
63
|
+
changed: boolean;
|
|
64
|
+
};
|
|
65
|
+
export type SortableOptions = {
|
|
66
|
+
/**
|
|
67
|
+
* - Selector for the sortable items; null = the container's direct children
|
|
68
|
+
*/
|
|
69
|
+
items?: string | null;
|
|
70
|
+
/**
|
|
71
|
+
* - Selector inside an item that starts a drag; null = the whole item
|
|
72
|
+
*/
|
|
73
|
+
handle?: string | null;
|
|
74
|
+
/**
|
|
75
|
+
* - Adds an "into" drop zone and switches to indicator mode (for trees)
|
|
76
|
+
*/
|
|
77
|
+
nest?: boolean;
|
|
78
|
+
/**
|
|
79
|
+
* - null = !nest. true = siblings slide aside while you drag; false = indicator mode
|
|
80
|
+
*/
|
|
81
|
+
live?: boolean | null;
|
|
82
|
+
/**
|
|
83
|
+
* - 'y' for a column, 'x' for a row
|
|
84
|
+
*/
|
|
85
|
+
axis?: "x" | "y";
|
|
86
|
+
/**
|
|
87
|
+
* - Attribute that identifies an item across re-renders (default 'data-id')
|
|
88
|
+
*/
|
|
89
|
+
key?: string;
|
|
90
|
+
/**
|
|
91
|
+
* - Animation duration in ms; 0 turns it off. Reduced motion always does
|
|
92
|
+
*/
|
|
93
|
+
animation?: number;
|
|
94
|
+
/**
|
|
95
|
+
* - CSS easing for every glide
|
|
96
|
+
*/
|
|
97
|
+
easing?: string;
|
|
98
|
+
/**
|
|
99
|
+
* - Pixels the pointer must travel before a press becomes a drag (default 4)
|
|
100
|
+
*/
|
|
101
|
+
threshold?: number;
|
|
102
|
+
/**
|
|
103
|
+
* - Ms a finger must rest on an item with no handle before it drags (default 220)
|
|
104
|
+
*/
|
|
105
|
+
touchDelay?: number;
|
|
106
|
+
/**
|
|
107
|
+
* - Share of an item's height, centred, that means "into" (default 0.5)
|
|
108
|
+
*/
|
|
109
|
+
nestZone?: number;
|
|
110
|
+
/**
|
|
111
|
+
* - Veto a drop. Live mode passes 'before' or 'after'
|
|
112
|
+
*/
|
|
113
|
+
accepts?: ((item: HTMLElement, target: HTMLElement, zone: SortableZone) => boolean) | null;
|
|
114
|
+
/**
|
|
115
|
+
* - Start disabled
|
|
116
|
+
*/
|
|
117
|
+
disabled?: boolean;
|
|
118
|
+
/**
|
|
119
|
+
* - Alt+Arrow moves the focused item (live mode). Default true
|
|
120
|
+
*/
|
|
121
|
+
keyboard?: boolean;
|
|
122
|
+
/**
|
|
123
|
+
* - Storage key (or true = the container's id): remember the order. Live mode
|
|
124
|
+
*/
|
|
125
|
+
persist?: string | boolean;
|
|
126
|
+
/**
|
|
127
|
+
* - Scroll the nearest scrolling ancestor (or the page) near its edges. Default true
|
|
128
|
+
*/
|
|
129
|
+
autoScroll?: boolean;
|
|
130
|
+
/**
|
|
131
|
+
* - Where the dragged copy is appended; null = the container
|
|
132
|
+
*/
|
|
133
|
+
ghostParent?: HTMLElement | null;
|
|
134
|
+
onStart?: ((detail: SortableStartDetail) => void) | null;
|
|
135
|
+
onMove?: ((detail: SortableMoveDetail) => void) | null;
|
|
136
|
+
/**
|
|
137
|
+
* - Live mode: the order changed
|
|
138
|
+
*/
|
|
139
|
+
onSort?: ((detail: SortableSortDetail) => void) | null;
|
|
140
|
+
/**
|
|
141
|
+
* - Indicator mode: update your data and re-render here. Return false (or a promise that rejects) to refuse; a returned promise is awaited before animating.
|
|
142
|
+
*/
|
|
143
|
+
onDrop?: ((detail: SortableDropDetail) => boolean | void | Promise<any>) | null;
|
|
144
|
+
/**
|
|
145
|
+
* - Esc, a refused drop, or a drop over nothing
|
|
146
|
+
*/
|
|
147
|
+
onCancel?: ((detail: {
|
|
148
|
+
item: HTMLElement;
|
|
149
|
+
}) => void) | null;
|
|
150
|
+
/**
|
|
151
|
+
* - Every drag, keyboard move and cancel ends here
|
|
152
|
+
*/
|
|
153
|
+
onEnd?: ((detail: SortableEndDetail) => void) | null;
|
|
154
|
+
};
|
|
155
|
+
export type SortableInstance = Sortable;
|
|
156
|
+
/**
|
|
157
|
+
* Where an indicator-mode drop lands relative to its target.
|
|
158
|
+
* @typedef {'before'|'after'|'into'} SortableZone
|
|
159
|
+
*/
|
|
160
|
+
/**
|
|
161
|
+
* @typedef {object} SortableStartDetail
|
|
162
|
+
* @property {HTMLElement} item
|
|
163
|
+
* @property {number} from - Index of the item when the drag began
|
|
164
|
+
*/
|
|
165
|
+
/**
|
|
166
|
+
* @typedef {object} SortableMoveDetail
|
|
167
|
+
* @property {HTMLElement} item
|
|
168
|
+
* @property {HTMLElement|null} target - The item under the pointer (indicator mode: the accepted drop target), or null
|
|
169
|
+
* @property {SortableZone|null} zone - Indicator mode only; null in live mode
|
|
170
|
+
* @property {number} x
|
|
171
|
+
* @property {number} y
|
|
172
|
+
*/
|
|
173
|
+
/**
|
|
174
|
+
* @typedef {object} SortableSortDetail
|
|
175
|
+
* @property {HTMLElement} item
|
|
176
|
+
* @property {number} from
|
|
177
|
+
* @property {number} to
|
|
178
|
+
* @property {(string|null)[]} order - Every item's key, in the new order
|
|
179
|
+
* @property {(string|null)[]} previous - Every item's key, in the order before the drag
|
|
180
|
+
*/
|
|
181
|
+
/**
|
|
182
|
+
* @typedef {object} SortableDropDetail
|
|
183
|
+
* @property {HTMLElement} item - The dragged element (it has not moved - the host re-renders)
|
|
184
|
+
* @property {HTMLElement} target - The item it was dropped on or beside
|
|
185
|
+
* @property {SortableZone} zone
|
|
186
|
+
* @property {string|null} key - Value of the `key` attribute on the dragged item
|
|
187
|
+
* @property {string|null} targetKey - Value of the `key` attribute on the target
|
|
188
|
+
*/
|
|
189
|
+
/**
|
|
190
|
+
* @typedef {object} SortableEndDetail
|
|
191
|
+
* @property {HTMLElement} item
|
|
192
|
+
* @property {boolean} changed - Whether the order changed
|
|
193
|
+
*/
|
|
194
|
+
/**
|
|
195
|
+
* @typedef {object} SortableOptions
|
|
196
|
+
* @property {string|null} [items] - Selector for the sortable items; null = the container's direct children
|
|
197
|
+
* @property {string|null} [handle] - Selector inside an item that starts a drag; null = the whole item
|
|
198
|
+
* @property {boolean} [nest] - Adds an "into" drop zone and switches to indicator mode (for trees)
|
|
199
|
+
* @property {boolean|null} [live] - null = !nest. true = siblings slide aside while you drag; false = indicator mode
|
|
200
|
+
* @property {'x'|'y'} [axis] - 'y' for a column, 'x' for a row
|
|
201
|
+
* @property {string} [key] - Attribute that identifies an item across re-renders (default 'data-id')
|
|
202
|
+
* @property {number} [animation] - Animation duration in ms; 0 turns it off. Reduced motion always does
|
|
203
|
+
* @property {string} [easing] - CSS easing for every glide
|
|
204
|
+
* @property {number} [threshold] - Pixels the pointer must travel before a press becomes a drag (default 4)
|
|
205
|
+
* @property {number} [touchDelay] - Ms a finger must rest on an item with no handle before it drags (default 220)
|
|
206
|
+
* @property {number} [nestZone] - Share of an item's height, centred, that means "into" (default 0.5)
|
|
207
|
+
* @property {((item: HTMLElement, target: HTMLElement, zone: SortableZone) => boolean)|null} [accepts] - Veto a drop. Live mode passes 'before' or 'after'
|
|
208
|
+
* @property {boolean} [disabled] - Start disabled
|
|
209
|
+
* @property {boolean} [keyboard] - Alt+Arrow moves the focused item (live mode). Default true
|
|
210
|
+
* @property {string|boolean} [persist] - Storage key (or true = the container's id): remember the order. Live mode
|
|
211
|
+
* @property {boolean} [autoScroll] - Scroll the nearest scrolling ancestor (or the page) near its edges. Default true
|
|
212
|
+
* @property {HTMLElement|null} [ghostParent] - Where the dragged copy is appended; null = the container
|
|
213
|
+
* @property {((detail: SortableStartDetail) => void)|null} [onStart]
|
|
214
|
+
* @property {((detail: SortableMoveDetail) => void)|null} [onMove]
|
|
215
|
+
* @property {((detail: SortableSortDetail) => void)|null} [onSort] - Live mode: the order changed
|
|
216
|
+
* @property {((detail: SortableDropDetail) => boolean|void|Promise<any>)|null} [onDrop] - Indicator mode: update your data and re-render here. Return false (or a promise that rejects) to refuse; a returned promise is awaited before animating.
|
|
217
|
+
* @property {((detail: {item: HTMLElement}) => void)|null} [onCancel] - Esc, a refused drop, or a drop over nothing
|
|
218
|
+
* @property {((detail: SortableEndDetail) => void)|null} [onEnd] - Every drag, keyboard move and cancel ends here
|
|
219
|
+
*/
|
|
220
|
+
/** @typedef {Sortable} SortableInstance */
|
|
221
|
+
declare class Sortable extends Component {
|
|
222
|
+
/** @type {SortableOptions} */
|
|
223
|
+
static defaults: SortableOptions;
|
|
224
|
+
/**
|
|
225
|
+
* @param {string|HTMLElement} selector - The container whose items are sorted
|
|
226
|
+
* @param {SortableOptions} [options]
|
|
227
|
+
*/
|
|
228
|
+
constructor(selector: string | HTMLElement, options?: SortableOptions);
|
|
229
|
+
_drag: {
|
|
230
|
+
item: Element;
|
|
231
|
+
pointerId: any;
|
|
232
|
+
ghost: Node;
|
|
233
|
+
rect: DOMRect;
|
|
234
|
+
offsetX: number;
|
|
235
|
+
offsetY: number;
|
|
236
|
+
x: any;
|
|
237
|
+
y: any;
|
|
238
|
+
from: number;
|
|
239
|
+
previous: string[];
|
|
240
|
+
origin: {
|
|
241
|
+
parent: ParentNode;
|
|
242
|
+
next: ChildNode;
|
|
243
|
+
};
|
|
244
|
+
key: string;
|
|
245
|
+
target: any;
|
|
246
|
+
zone: any;
|
|
247
|
+
indicator: any;
|
|
248
|
+
scrollRaf: any;
|
|
249
|
+
};
|
|
250
|
+
_pending: {
|
|
251
|
+
item: Element;
|
|
252
|
+
pointerId: any;
|
|
253
|
+
startX: any;
|
|
254
|
+
startY: any;
|
|
255
|
+
ready: boolean;
|
|
256
|
+
timer: any;
|
|
257
|
+
};
|
|
258
|
+
_animating: WeakSet<object>;
|
|
259
|
+
_flips: WeakMap<object, any>;
|
|
260
|
+
_docHandlers: any[];
|
|
261
|
+
_observer: MutationObserver;
|
|
262
|
+
/**
|
|
263
|
+
* The keys of the items, in their current order.
|
|
264
|
+
* @returns {(string|null)[]}
|
|
265
|
+
*/
|
|
266
|
+
toArray(): (string | null)[];
|
|
267
|
+
/**
|
|
268
|
+
* Put the items in the order of `keys`. Items not named keep their slots.
|
|
269
|
+
* @param {(string|number)[]} keys
|
|
270
|
+
* @param {{animate?: boolean}} [options]
|
|
271
|
+
* @returns {this}
|
|
272
|
+
*/
|
|
273
|
+
sort(keys: (string | number)[], { animate }?: {
|
|
274
|
+
animate?: boolean;
|
|
275
|
+
}): this;
|
|
276
|
+
/**
|
|
277
|
+
* Re-apply the saved order (live mode with `persist`).
|
|
278
|
+
* @returns {this}
|
|
279
|
+
*/
|
|
280
|
+
restore(): this;
|
|
281
|
+
/**
|
|
282
|
+
* Forget the saved order.
|
|
283
|
+
* @returns {this}
|
|
284
|
+
*/
|
|
285
|
+
forget(): this;
|
|
286
|
+
/**
|
|
287
|
+
* Run `mutate` (which may re-render the container) and animate every item
|
|
288
|
+
* from where it was to where it is afterwards, matched by `key`.
|
|
289
|
+
* Returns whatever `mutate` returns; a promise is awaited before animating.
|
|
290
|
+
* @template T
|
|
291
|
+
* @param {() => T} mutate
|
|
292
|
+
* @returns {T}
|
|
293
|
+
*/
|
|
294
|
+
animate<T>(mutate: () => T): T;
|
|
295
|
+
/**
|
|
296
|
+
* Re-arm dragging.
|
|
297
|
+
* @returns {this}
|
|
298
|
+
*/
|
|
299
|
+
enable(): this;
|
|
300
|
+
/**
|
|
301
|
+
* Stop dragging; a drag in progress is cancelled.
|
|
302
|
+
* @returns {this}
|
|
303
|
+
*/
|
|
304
|
+
disable(): this;
|
|
305
|
+
/**
|
|
306
|
+
* Whether a drag is in progress.
|
|
307
|
+
* @returns {boolean}
|
|
308
|
+
*/
|
|
309
|
+
get dragging(): boolean;
|
|
310
|
+
_applyOptions(): void;
|
|
311
|
+
_isLive(): boolean;
|
|
312
|
+
_items(): any[];
|
|
313
|
+
/** The sortable container an element belongs to - a nested sortable claims its own. */
|
|
314
|
+
_ownerOf(el: any): any;
|
|
315
|
+
_itemFrom(node: any): Element;
|
|
316
|
+
_keyOf(el: any): string;
|
|
317
|
+
_byKey(key: any): any;
|
|
318
|
+
_markHandles(): void;
|
|
319
|
+
_storageKey(): string;
|
|
320
|
+
_duration(): number;
|
|
321
|
+
_onPointerDown(e: any): void;
|
|
322
|
+
_onPointerMove(e: any): void;
|
|
323
|
+
/**
|
|
324
|
+
* Run pointer/keyboard work so that a host callback which throws cannot
|
|
325
|
+
* leave the page stuck mid-drag (ghost on screen, grab cursor, listeners on).
|
|
326
|
+
*/
|
|
327
|
+
_guard(fn: any): any;
|
|
328
|
+
_onPointerUp(e: any): void;
|
|
329
|
+
_onPointerCancel(e: any): void;
|
|
330
|
+
_listenDoc(event: any, handler: any, opts: any): void;
|
|
331
|
+
_listenWin(event: any, handler: any, opts: any): void;
|
|
332
|
+
_unlistenDoc(): void;
|
|
333
|
+
_clearPending(): void;
|
|
334
|
+
_begin(startX: any, startY: any): void;
|
|
335
|
+
_moveTo(x: any, y: any): void;
|
|
336
|
+
/**
|
|
337
|
+
* Move the placeholder past `target` once the pointer is far enough over it
|
|
338
|
+
* that, after the move, the pointer would sit on the placeholder. Anything
|
|
339
|
+
* less oscillates when the two differ in size.
|
|
340
|
+
*/
|
|
341
|
+
_liveSwap(target: any, x: any, y: any): void;
|
|
342
|
+
_zoneFor(target: any, x: any, y: any): "before" | "after" | "into";
|
|
343
|
+
_indicate(target: any, x: any, y: any): void;
|
|
344
|
+
_placeIndicator(): void;
|
|
345
|
+
_drop(): void;
|
|
346
|
+
_cancel(): void;
|
|
347
|
+
/** Land the ghost on the item's (possibly new) element, then tidy up. */
|
|
348
|
+
_finish(landed: any): void;
|
|
349
|
+
/** A drag that ends over an item must not also click it. */
|
|
350
|
+
_suppressClick(): void;
|
|
351
|
+
_scrollLoop(): void;
|
|
352
|
+
_onKeyDown(e: any): void;
|
|
353
|
+
/** Tell screen readers where the item now sits. */
|
|
354
|
+
_announce(item: any): void;
|
|
355
|
+
_liveRegion: HTMLDivElement;
|
|
356
|
+
/** Where every item is now, by element and by key. */
|
|
357
|
+
_snapshot({ withDragged }?: {
|
|
358
|
+
withDragged?: boolean;
|
|
359
|
+
}): Map<any, any>;
|
|
360
|
+
/** Animate each item from its rect in `before` to where it is now. */
|
|
361
|
+
_playFlip(before: any): void;
|
|
362
|
+
/** Live mode: move elements and slide everything, the slot included, into place. */
|
|
363
|
+
_flipItems(mutate: any): void;
|
|
364
|
+
_save(order: any): void;
|
|
365
|
+
/** The onX callback, .on() listeners and `dm:sortable:<name>`, then the older `sortable:<name>` (kept until 1.0). */
|
|
366
|
+
_signal(name: any, detail: any): void;
|
|
367
|
+
_dispatch(name: any, detail: any): void;
|
|
368
|
+
}
|
|
369
|
+
import Component from './component.js';
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
export namespace storage {
|
|
2
|
+
export { STORAGE_PREFIX as _prefix };
|
|
3
|
+
export let _available: boolean | null;
|
|
4
|
+
/**
|
|
5
|
+
* Check if localStorage is available
|
|
6
|
+
* @returns {boolean}
|
|
7
|
+
*/
|
|
8
|
+
export function isAvailable(): boolean;
|
|
9
|
+
/**
|
|
10
|
+
* Get the prefixed key
|
|
11
|
+
* @param {string} key - Raw key
|
|
12
|
+
* @returns {string} - Prefixed key
|
|
13
|
+
* @private
|
|
14
|
+
*/
|
|
15
|
+
export function _prefixKey(key: string): string;
|
|
16
|
+
/**
|
|
17
|
+
* Remove prefix from key
|
|
18
|
+
* @param {string} prefixedKey - Prefixed key
|
|
19
|
+
* @returns {string} - Raw key
|
|
20
|
+
* @private
|
|
21
|
+
*/
|
|
22
|
+
export function _unprefixKey(prefixedKey: string): string;
|
|
23
|
+
/**
|
|
24
|
+
* Retrieve and auto-parse a value from localStorage
|
|
25
|
+
* @template [T=any]
|
|
26
|
+
* @param {string} key - Storage key (without prefix)
|
|
27
|
+
* @param {T} [defaultValue=null] - Default if key doesn't exist
|
|
28
|
+
* @returns {T} - Parsed value or defaultValue
|
|
29
|
+
*/
|
|
30
|
+
export function get<T = any>(key: string, defaultValue?: T): T;
|
|
31
|
+
/**
|
|
32
|
+
* Store a value with auto-stringify
|
|
33
|
+
* @param {string} key - Storage key (without prefix)
|
|
34
|
+
* @param {any} value - Value to store (will be JSON stringified)
|
|
35
|
+
* @returns {boolean} - True if successful
|
|
36
|
+
*/
|
|
37
|
+
export function set(key: string, value: any): boolean;
|
|
38
|
+
/**
|
|
39
|
+
* Remove a key from storage
|
|
40
|
+
* @param {string} key - Storage key (without prefix)
|
|
41
|
+
* @returns {boolean} - True if successful
|
|
42
|
+
*/
|
|
43
|
+
export function remove(key: string): boolean;
|
|
44
|
+
/**
|
|
45
|
+
* Check if a key exists
|
|
46
|
+
* @param {string} key - Storage key (without prefix)
|
|
47
|
+
* @returns {boolean}
|
|
48
|
+
*/
|
|
49
|
+
export function has(key: string): boolean;
|
|
50
|
+
/**
|
|
51
|
+
* Clear all Domma-prefixed keys (not all localStorage)
|
|
52
|
+
* @returns {number} - Number of keys cleared
|
|
53
|
+
*/
|
|
54
|
+
export function clear(): number;
|
|
55
|
+
/**
|
|
56
|
+
* List all Domma-prefixed keys (without prefix)
|
|
57
|
+
* @returns {string[]}
|
|
58
|
+
*/
|
|
59
|
+
export function keys(): string[];
|
|
60
|
+
/**
|
|
61
|
+
* Get the size of stored data for a key (in bytes)
|
|
62
|
+
* @param {string} key - Storage key (without prefix)
|
|
63
|
+
* @returns {number} - Size in bytes, 0 if not found
|
|
64
|
+
*/
|
|
65
|
+
export function size(key: string): number;
|
|
66
|
+
/**
|
|
67
|
+
* Get total size of all Domma storage (in bytes)
|
|
68
|
+
* @returns {number}
|
|
69
|
+
*/
|
|
70
|
+
export function totalSize(): number;
|
|
71
|
+
/**
|
|
72
|
+
* Get all stored data as an object
|
|
73
|
+
* @returns {Record<string, any>}
|
|
74
|
+
*/
|
|
75
|
+
export function getAll(): Record<string, any>;
|
|
76
|
+
/**
|
|
77
|
+
* Set multiple values at once
|
|
78
|
+
* @param {Record<string, any>} data - Key-value pairs to store
|
|
79
|
+
* @returns {boolean} - True if all successful
|
|
80
|
+
*/
|
|
81
|
+
export function setAll(data: Record<string, any>): boolean;
|
|
82
|
+
}
|
|
83
|
+
export default storage;
|
|
84
|
+
/**
|
|
85
|
+
* localStorage wrapper: values are JSON-serialised and keys carry the `domma:` prefix.
|
|
86
|
+
* Every method fails soft (false / 0 / the default) when localStorage is unavailable.
|
|
87
|
+
*/
|
|
88
|
+
export type Storage = typeof storage;
|
|
89
|
+
/**
|
|
90
|
+
* Domma Storage Module
|
|
91
|
+
* localStorage wrapper with auto-serialisation and key prefixing
|
|
92
|
+
*/
|
|
93
|
+
declare const STORAGE_PREFIX: "domma:";
|