domma-js 0.56.0 → 0.58.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.
Files changed (121) hide show
  1. package/README.md +2 -2
  2. package/assets/types/generated/public/assets/flags/africa.d.ts +6 -0
  3. package/assets/types/generated/public/assets/flags/americas.d.ts +6 -0
  4. package/assets/types/generated/public/assets/flags/asia.d.ts +6 -0
  5. package/assets/types/generated/public/assets/flags/europe.d.ts +9 -0
  6. package/assets/types/generated/public/assets/flags/index.d.ts +11 -0
  7. package/assets/types/generated/public/assets/flags/oceania.d.ts +2 -0
  8. package/assets/types/generated/public/assets/icons/buildings.d.ts +6 -0
  9. package/assets/types/generated/public/assets/icons/code.d.ts +2 -0
  10. package/assets/types/generated/public/assets/icons/commerce.d.ts +7 -0
  11. package/assets/types/generated/public/assets/icons/communication.d.ts +7 -0
  12. package/assets/types/generated/public/assets/icons/devices.d.ts +6 -0
  13. package/assets/types/generated/public/assets/icons/emojis.d.ts +6 -0
  14. package/assets/types/generated/public/assets/icons/files.d.ts +7 -0
  15. package/assets/types/generated/public/assets/icons/finance.d.ts +6 -0
  16. package/assets/types/generated/public/assets/icons/forms.d.ts +5 -0
  17. package/assets/types/generated/public/assets/icons/health.d.ts +6 -0
  18. package/assets/types/generated/public/assets/icons/index.d.ts +24 -0
  19. package/assets/types/generated/public/assets/icons/media.d.ts +7 -0
  20. package/assets/types/generated/public/assets/icons/navigation.d.ts +7 -0
  21. package/assets/types/generated/public/assets/icons/seasonal.d.ts +6 -0
  22. package/assets/types/generated/public/assets/icons/social.d.ts +7 -0
  23. package/assets/types/generated/public/assets/icons/sport.d.ts +6 -0
  24. package/assets/types/generated/public/assets/icons/status.d.ts +7 -0
  25. package/assets/types/generated/public/assets/icons/transport.d.ts +7 -0
  26. package/assets/types/generated/public/assets/icons/ui.d.ts +7 -0
  27. package/assets/types/generated/public/assets/icons/weather.d.ts +6 -0
  28. package/assets/types/generated/src/auth.d.ts +424 -0
  29. package/assets/types/generated/src/avatar.d.ts +270 -0
  30. package/assets/types/generated/src/binding-source.d.ts +58 -0
  31. package/assets/types/generated/src/butterfly-drawing.d.ts +2 -0
  32. package/assets/types/generated/src/component-factory.d.ts +150 -0
  33. package/assets/types/generated/src/component.d.ts +162 -0
  34. package/assets/types/generated/src/components/back-to-top.d.ts +150 -0
  35. package/assets/types/generated/src/components/badge.d.ts +208 -0
  36. package/assets/types/generated/src/components/card.d.ts +189 -0
  37. package/assets/types/generated/src/components/command-palette.d.ts +352 -0
  38. package/assets/types/generated/src/components/dropzone.d.ts +342 -0
  39. package/assets/types/generated/src/components/focus-trap.d.ts +238 -0
  40. package/assets/types/generated/src/components/loader.d.ts +133 -0
  41. package/assets/types/generated/src/components/modal.d.ts +339 -0
  42. package/assets/types/generated/src/components/range-slider.d.ts +267 -0
  43. package/assets/types/generated/src/components/shared.d.ts +91 -0
  44. package/assets/types/generated/src/components/split-pane.d.ts +239 -0
  45. package/assets/types/generated/src/components/toast.d.ts +284 -0
  46. package/assets/types/generated/src/components/tooltip.d.ts +200 -0
  47. package/assets/types/generated/src/components/virtual-list.d.ts +340 -0
  48. package/assets/types/generated/src/config.d.ts +193 -0
  49. package/assets/types/generated/src/context-cursor.d.ts +69 -0
  50. package/assets/types/generated/src/context-menu.d.ts +596 -0
  51. package/assets/types/generated/src/dates.d.ts +367 -0
  52. package/assets/types/generated/src/dom.d.ts +1221 -0
  53. package/assets/types/generated/src/effects.d.ts +1281 -0
  54. package/assets/types/generated/src/elements.d.ts +4994 -0
  55. package/assets/types/generated/src/escape.d.ts +5 -0
  56. package/assets/types/generated/src/flags-bundle.d.ts +4 -0
  57. package/assets/types/generated/src/flags.d.ts +338 -0
  58. package/assets/types/generated/src/forms.d.ts +1060 -0
  59. package/assets/types/generated/src/globals.d.ts +45 -0
  60. package/assets/types/generated/src/http.d.ts +131 -0
  61. package/assets/types/generated/src/i18n.d.ts +261 -0
  62. package/assets/types/generated/src/icons.d.ts +213 -0
  63. package/assets/types/generated/src/index.d.ts +249 -0
  64. package/assets/types/generated/src/input-group.d.ts +135 -0
  65. package/assets/types/generated/src/models.d.ts +968 -0
  66. package/assets/types/generated/src/popover.d.ts +413 -0
  67. package/assets/types/generated/src/router.d.ts +344 -0
  68. package/assets/types/generated/src/safe-url.d.ts +10 -0
  69. package/assets/types/generated/src/sanitize.d.ts +97 -0
  70. package/assets/types/generated/src/schema-builder.d.ts +420 -0
  71. package/assets/types/generated/src/skeleton.d.ts +135 -0
  72. package/assets/types/generated/src/smooth-caret.d.ts +61 -0
  73. package/assets/types/generated/src/sortable.d.ts +368 -0
  74. package/assets/types/generated/src/storage.d.ts +93 -0
  75. package/assets/types/generated/src/tables.d.ts +901 -0
  76. package/assets/types/generated/src/theme.d.ts +262 -0
  77. package/assets/types/generated/src/ticker-tape-drawing.d.ts +2 -0
  78. package/assets/types/generated/src/treeview.d.ts +504 -0
  79. package/assets/types/generated/src/utils.d.ts +1667 -0
  80. package/assets/types/generated/src/web-components/base/domma-element.d.ts +134 -0
  81. package/assets/types/generated/src/web-components/index.d.ts +14 -0
  82. package/assets/types/generated/vendor/domma-reactive.d.ts +587 -0
  83. package/assets/types/index.d.ts +104 -226
  84. package/package.json +5 -2
  85. package/public/dist/bundles/domma-complete.css +20 -14
  86. package/public/dist/bundles/domma-data-focused.css +20 -14
  87. package/public/dist/bundles/domma-essentials.css +20 -14
  88. package/public/dist/bundles/domma-full.css +20 -14
  89. package/public/dist/bundles/domma-minimal.css +8 -8
  90. package/public/dist/domma-flags.esm.js +3 -3
  91. package/public/dist/domma-flags.esm.js.map +1 -1
  92. package/public/dist/domma-flags.min.js +3 -3
  93. package/public/dist/domma-flags.min.js.map +1 -1
  94. package/public/dist/domma-syntax.min.js +3 -3
  95. package/public/dist/domma.css +3 -3
  96. package/public/dist/domma.esm.js +5 -5
  97. package/public/dist/domma.esm.js.map +1 -1
  98. package/public/dist/domma.min.js +5 -5
  99. package/public/dist/domma.min.js.map +1 -1
  100. package/public/dist/elements.css +9 -3
  101. package/public/dist/grid.css +3 -3
  102. package/public/dist/syntax.css +3 -3
  103. package/public/dist/themes/domma-themes.css +3 -3
  104. package/templates/kickstart/.claude/snippets.md +1 -1
  105. package/templates/kickstart/CLAUDE.md +1 -1
  106. package/templates/kickstart/frontend/types/domma.d.ts +7 -4
  107. package/templates/kickstart-spa/.claude/snippets.md +1 -1
  108. package/assets/types/config.d.ts +0 -136
  109. package/assets/types/dates.d.ts +0 -209
  110. package/assets/types/dom.d.ts +0 -448
  111. package/assets/types/elements.d.ts +0 -1168
  112. package/assets/types/flags.d.ts +0 -130
  113. package/assets/types/http.d.ts +0 -97
  114. package/assets/types/i18n.d.ts +0 -99
  115. package/assets/types/icons.d.ts +0 -147
  116. package/assets/types/models.d.ts +0 -260
  117. package/assets/types/smooth-caret.d.ts +0 -12
  118. package/assets/types/storage.d.ts +0 -93
  119. package/assets/types/tables.d.ts +0 -327
  120. package/assets/types/theme.d.ts +0 -137
  121. package/assets/types/utils.d.ts +0 -675
@@ -1,1168 +0,0 @@
1
- /**
2
- * Domma Elements Module - TypeScript Declarations
3
- * UI Components: Card, Modal, Tabs, Accordion, Tooltip, Badge, Dropdown, Toast, Carousel, BackToTop
4
- */
5
-
6
- // ============================================
7
- // Common Types
8
- // ============================================
9
-
10
- export type AnimationType = 'fade' | 'slide' | 'zoom' | 'none';
11
- export type TooltipPosition = 'top' | 'bottom' | 'left' | 'right';
12
- export type DropdownPosition = 'bottom-start' | 'bottom-end' | 'top-start' | 'top-end';
13
- export type ToastPosition = 'top-left' | 'top-right' | 'top-center' | 'bottom-left' | 'bottom-right' | 'bottom-center';
14
- export type ToastType = 'default' | 'success' | 'error' | 'warning' | 'info';
15
- export type BadgeVariant = 'primary' | 'secondary' | 'success' | 'danger' | 'warning' | 'info' | 'light' | 'dark';
16
- export type BadgeSize = 'small' | 'medium' | 'large';
17
- export type ShadowSize = 'none' | 'small' | 'medium' | 'large';
18
- export type BackToTopPosition = 'bottom-right' | 'bottom-left';
19
-
20
- // ============================================
21
- // Base Component
22
- // ============================================
23
-
24
- export interface ComponentInstance {
25
- /** The DOM element this component is attached to */
26
- element: HTMLElement | null;
27
- /** Component options */
28
- options: Record<string, any>;
29
-
30
- /** Update component options at runtime */
31
- setOptions(newOptions: Record<string, any>): this;
32
-
33
- /**
34
- * Listen for a component event - the name of an `onX` option without `on`, lower-cased
35
- * ('change', 'open', 'beforeclose'). The handler gets the same arguments as the option;
36
- * returning false from a `before...` handler cancels. The same event is dispatched on
37
- * `element` as `dm:<component>:<event>` with `detail = {instance, args}`.
38
- */
39
- on(event: string, handler: (...args: any[]) => any): this;
40
- /** Listen once */
41
- once(event: string, handler: (...args: any[]) => any): this;
42
- /** Stop listening (every handler for the event when none is given) */
43
- off(event: string, handler?: (...args: any[]) => any): this;
44
-
45
- /** Destroy the component and cleanup event listeners */
46
- destroy(): void;
47
- }
48
-
49
- // ============================================
50
- // Card Component
51
- // ============================================
52
-
53
- export interface CardOptions {
54
- /** Enable hover effects */
55
- hoverable?: boolean;
56
- /** Shadow size: 'none', 'small', 'medium', 'large' */
57
- shadow?: ShadowSize;
58
- /** Apply border radius */
59
- rounded?: boolean;
60
- /** Enable animations */
61
- animation?: boolean;
62
- /** Animation duration in ms */
63
- animationDuration?: number;
64
- /** Callback on mouse enter */
65
- onHover?: (event: MouseEvent, card: CardInstance) => void;
66
- /** Callback on mouse leave */
67
- onLeave?: (event: MouseEvent, card: CardInstance) => void;
68
- /** Callback on click */
69
- onClick?: (event: MouseEvent, card: CardInstance) => void;
70
- }
71
-
72
- export interface CardInstance extends ComponentInstance {
73
- /** Set the shadow size */
74
- setShadow(size: ShadowSize): this;
75
- }
76
-
77
- // ============================================
78
- // Modal Component
79
- // ============================================
80
-
81
- export interface ModalOptions {
82
- /** Show backdrop overlay */
83
- backdrop?: boolean;
84
- /** Close modal when clicking backdrop */
85
- backdropClose?: boolean;
86
- /** Close modal on Escape key */
87
- keyboard?: boolean;
88
- /** Animation type: 'fade', 'slide', 'zoom' */
89
- animation?: AnimationType;
90
- /** Animation duration in ms */
91
- animationDuration?: number;
92
- /** Show close button */
93
- closeButton?: boolean;
94
- /** Return false to keep the modal closed (also `.on('beforeopen')`, `dm:modal:beforeopen`) */
95
- onBeforeOpen?: (modal: ModalInstance) => boolean | void;
96
- /** Return false to keep the modal open (also `.on('beforeclose')`, `dm:modal:beforeclose`) */
97
- onBeforeClose?: (modal: ModalInstance) => boolean | void;
98
- /** Modal content (HTML, sanitised like $().html() unless `safe: false`) */
99
- content?: string;
100
- /** false: insert `content` as trusted markup */
101
- safe?: boolean;
102
- /** Callback before opening */
103
- onOpen?: (modal: ModalInstance) => void;
104
- /** Callback after open animation completes */
105
- onOpened?: (modal: ModalInstance) => void;
106
- /** Callback before closing */
107
- onClose?: (modal: ModalInstance) => void;
108
- /** Callback after close animation completes */
109
- onClosed?: (modal: ModalInstance) => void;
110
- }
111
-
112
- export interface ModalInstance extends ComponentInstance {
113
- /** Open the modal */
114
- open(): this;
115
-
116
- /** Close the modal */
117
- close(): this;
118
-
119
- /** Toggle modal visibility */
120
- toggle(): this;
121
-
122
- /** Check if modal is currently open */
123
- isOpen(): boolean;
124
- }
125
-
126
- // ============================================
127
- // Tabs Component
128
- // ============================================
129
-
130
- export interface TabChangeEvent {
131
- index: number;
132
- oldIndex: number;
133
- tab: HTMLElement;
134
- panel: HTMLElement;
135
- }
136
-
137
- export interface TabsOptions {
138
- /** Initially active tab index */
139
- active?: number;
140
- /** Animation type */
141
- animation?: 'fade' | 'none';
142
- /** Animation duration in ms */
143
- animationDuration?: number;
144
- /** Selector for tab items */
145
- tabSelector?: string;
146
- /** Selector for tab panels */
147
- panelSelector?: string;
148
- /** CSS class for active state */
149
- activeClass?: string;
150
- /** Callback when tab changes */
151
- onChange?: (event: TabChangeEvent) => void;
152
- }
153
-
154
- export interface TabsInstance extends ComponentInstance {
155
- /** Activate a tab by index */
156
- activate(index: number): this;
157
-
158
- /** Alias for activate */
159
- show(index: number): this;
160
-
161
- /** Get the current active tab index */
162
- getActive(): number;
163
-
164
- /** Go to the next tab */
165
- next(): this;
166
-
167
- /** Go to the previous tab */
168
- prev(): this;
169
- }
170
-
171
- // ============================================
172
- // Accordion Component
173
- // ============================================
174
-
175
- export interface AccordionChangeEvent {
176
- index: number;
177
- isOpen: boolean;
178
- header: HTMLElement;
179
- content: HTMLElement;
180
- }
181
-
182
- export interface AccordionOptions {
183
- /** Allow multiple panels open at once */
184
- allowMultiple?: boolean;
185
- /** Alias for allowMultiple */
186
- multiExpand?: boolean;
187
- /** Initially open panel index(es) */
188
- activeIndex?: number | number[] | null;
189
- /** Enable animations */
190
- animation?: boolean;
191
- /** Animation duration in ms */
192
- animationDuration?: number;
193
- /** Selector for accordion headers */
194
- headerSelector?: string;
195
- /** Selector for accordion content */
196
- contentSelector?: string;
197
- /** CSS class for active state */
198
- activeClass?: string;
199
- /** Callback when panel state changes */
200
- onChange?: (event: AccordionChangeEvent) => void;
201
- }
202
-
203
- export interface AccordionInstance extends ComponentInstance {
204
- /** Toggle a panel by index */
205
- toggle(index: number): this;
206
-
207
- /** Open a panel by index */
208
- open(index: number): this;
209
-
210
- /** Close a panel by index */
211
- close(index: number): this;
212
-
213
- /** Open all panels */
214
- openAll(): this;
215
-
216
- /** Close all panels */
217
- closeAll(): this;
218
- }
219
-
220
- // ============================================
221
- // Tooltip Component
222
- // ============================================
223
-
224
- export interface TooltipDelay {
225
- show: number;
226
- hide: number;
227
- }
228
-
229
- export interface TooltipOptions {
230
- /** Tooltip content */
231
- content?: string;
232
- /** Position relative to element */
233
- position?: TooltipPosition;
234
- /** How to trigger: 'hover', 'click', 'focus' */
235
- trigger?: 'hover' | 'click' | 'focus';
236
- /** Show/hide delay in ms */
237
- delay?: TooltipDelay;
238
- /** Enable animations */
239
- animation?: boolean;
240
- /** Animation duration in ms */
241
- animationDuration?: number;
242
- /** Allow HTML content */
243
- html?: boolean;
244
- /** Position offset [x, y] */
245
- offset?: [number, number];
246
- /** Container element for tooltip */
247
- container?: HTMLElement | null;
248
- /** Callback when tooltip shows */
249
- onShow?: (tooltip: TooltipInstance) => void;
250
- /** Callback when tooltip hides */
251
- onHide?: (tooltip: TooltipInstance) => void;
252
- }
253
-
254
- export interface TooltipInstance extends ComponentInstance {
255
- /** Show the tooltip */
256
- show(): this;
257
-
258
- /** Hide the tooltip */
259
- hide(): this;
260
-
261
- /** Toggle tooltip visibility */
262
- toggle(): this;
263
-
264
- /** Update tooltip content */
265
- setContent(content: string): this;
266
- }
267
-
268
- // ============================================
269
- // Badge Component
270
- // ============================================
271
-
272
- export interface BadgeOptions {
273
- /** Badge variant/colour */
274
- variant?: BadgeVariant;
275
- /** Badge size */
276
- size?: BadgeSize;
277
- /** Use pill/rounded style */
278
- pill?: boolean;
279
- /** Use outline style */
280
- outline?: boolean;
281
- /** Show remove button */
282
- removable?: boolean;
283
- /** Callback on click */
284
- onClick?: (event: MouseEvent, badge: BadgeInstance) => void;
285
- /** Callback on remove */
286
- onRemove?: (event: MouseEvent, badge: BadgeInstance) => void;
287
- }
288
-
289
- export interface BadgeInstance extends ComponentInstance {
290
- /** Set the badge variant */
291
- setVariant(variant: BadgeVariant): this;
292
-
293
- /** Set the badge text */
294
- setText(text: string): this;
295
-
296
- /** Remove the badge from DOM */
297
- remove(): void;
298
- }
299
-
300
- /** Number badge colour variant */
301
- export type NumberBadgeVariant = 'primary' | 'secondary' | 'success' | 'danger' | 'warning' | 'info' | 'light' | 'dark';
302
-
303
- export interface NumberBadgeOptions {
304
- /** Initial count to display */
305
- count?: number;
306
- /** Colour variant (default: 'danger') */
307
- variant?: NumberBadgeVariant;
308
- /** Show as dot indicator instead of number */
309
- dot?: boolean;
310
- /** Enable pulse animation */
311
- pulse?: boolean;
312
- /** Custom border ring colour */
313
- borderColor?: string;
314
- }
315
-
316
- export interface NumberBadgeInstance {
317
- /** The wrapper web component element */
318
- element: HTMLElement;
319
-
320
- /** Set the badge count */
321
- setCount(count: number): this;
322
-
323
- /** Increment the badge count */
324
- increment(by?: number): this;
325
-
326
- /** Decrement the badge count (min 0) */
327
- decrement(by?: number): this;
328
-
329
- /** Toggle dot mode */
330
- setDot(dot: boolean): this;
331
-
332
- /** Set the colour variant */
333
- setVariant(variant: NumberBadgeVariant): this;
334
-
335
- /** Toggle pulse animation */
336
- setPulse(pulse: boolean): this;
337
-
338
- /** Get the current count */
339
- getCount(): number;
340
-
341
- /** Remove the badge and unwrap the element */
342
- remove(): void;
343
-
344
- /** Destroy the component */
345
- destroy(): void;
346
- }
347
-
348
- // ============================================
349
- // Dropdown Component
350
- // ============================================
351
-
352
- export interface DropdownItem {
353
- /** Display text */
354
- label?: string;
355
- /** Alternative to label */
356
- text?: string;
357
- /** Alternative to label */
358
- name?: string;
359
- /** Value when selected */
360
- value?: any;
361
- /** Icon HTML */
362
- icon?: string;
363
- /** Disable item */
364
- disabled?: boolean;
365
- /** Render as divider */
366
- divider?: boolean;
367
- /** Render as header */
368
- header?: string;
369
- }
370
-
371
- export interface DropdownSelectEvent {
372
- item: DropdownItem | string;
373
- index: number;
374
- value: any;
375
- }
376
-
377
- export interface DropdownOptions {
378
- /** How to trigger: 'click' or 'hover' */
379
- trigger?: 'click' | 'hover';
380
- /** Menu position */
381
- position?: DropdownPosition;
382
- /** Position offset [x, y] */
383
- offset?: [number, number];
384
- /** Enable animations */
385
- animation?: boolean;
386
- /** Animation duration in ms */
387
- animationDuration?: number;
388
- /** Close menu after item selection */
389
- closeOnSelect?: boolean;
390
- /** Close menu when clicking outside */
391
- closeOnClickOutside?: boolean;
392
- /** Menu items */
393
- items?: (DropdownItem | string)[];
394
- /** Bind to a Domma Model */
395
- model?: any;
396
- /** Model key for items array */
397
- modelKey?: string;
398
- /** Custom item template function */
399
- itemTemplate?: (item: DropdownItem, index: number) => string;
400
- /** Callback when menu opens */
401
- onOpen?: (dropdown: DropdownInstance) => void;
402
- /** Callback when menu closes */
403
- onClose?: (dropdown: DropdownInstance) => void;
404
- /** Callback when item is selected */
405
- onSelect?: (event: DropdownSelectEvent, dropdown: DropdownInstance) => void;
406
- }
407
-
408
- export interface DropdownInstance extends ComponentInstance {
409
- /** Open the dropdown menu */
410
- open(): this;
411
-
412
- /** Close the dropdown menu */
413
- close(): this;
414
-
415
- /** Toggle dropdown visibility */
416
- toggle(): this;
417
-
418
- /** Check if dropdown is open */
419
- isOpen(): boolean;
420
-
421
- /** Set menu items */
422
- setItems(items: (DropdownItem | string)[]): this;
423
-
424
- /** Add a menu item */
425
- addItem(item: DropdownItem | string): this;
426
-
427
- /** Remove item by index */
428
- removeItem(index: number): this;
429
-
430
- /** Get currently selected value */
431
- getSelected(): any;
432
- }
433
-
434
- // ============================================
435
- // Toast Component
436
- // ============================================
437
-
438
- export interface ToastAction {
439
- /** Button label */
440
- label: string;
441
- /** Click handler */
442
- onClick?: (toast: ToastInstance) => void;
443
- /** Close toast on click */
444
- closeOnClick?: boolean;
445
- /** Primary style */
446
- primary?: boolean;
447
- }
448
-
449
- export interface ToastOptions {
450
- /** Toast position */
451
- position?: ToastPosition;
452
- /** Auto-dismiss duration in ms (0 = no auto-dismiss) */
453
- duration?: number;
454
- /** Pause countdown on hover */
455
- pauseOnHover?: boolean;
456
- /** Show progress bar */
457
- showProgress?: boolean;
458
- /** Animation style */
459
- animation?: 'slide' | 'fade';
460
- /** Animation duration in ms */
461
- animationDuration?: number;
462
- /** Show close button */
463
- closable?: boolean;
464
- /** Maximum number of toasts */
465
- maxToasts?: number;
466
- /** Toast type */
467
- type?: ToastType;
468
- /** Toast title */
469
- title?: string;
470
- /** Custom icon HTML */
471
- icon?: string;
472
- /** Allow HTML content */
473
- html?: boolean;
474
- /** Action buttons */
475
- actions?: ToastAction[];
476
- /** Callback when toast closes */
477
- onClose?: (toast: ToastInstance) => void;
478
- }
479
-
480
- export interface ToastInstance {
481
- /** Close the toast */
482
- close(): void;
483
-
484
- /** Update toast message */
485
- update(message: string, options?: { html?: boolean }): this;
486
- }
487
-
488
- export interface ToastStatic {
489
- /** Default options */
490
- defaults: ToastOptions;
491
-
492
- /** Show a toast message */
493
- show(message: string, options?: ToastOptions): ToastInstance;
494
-
495
- /** Show success toast */
496
- success(message: string, options?: ToastOptions): ToastInstance;
497
-
498
- /** Show error toast */
499
- error(message: string, options?: ToastOptions): ToastInstance;
500
-
501
- /** Show warning toast */
502
- warning(message: string, options?: ToastOptions): ToastInstance;
503
-
504
- /** Show info toast */
505
- info(message: string, options?: ToastOptions): ToastInstance;
506
-
507
- /** Close all toasts */
508
- closeAll(): void;
509
- }
510
-
511
- // ============================================
512
- // Carousel Component
513
- // ============================================
514
-
515
- export interface CarouselChangeEvent {
516
- index: number;
517
- oldIndex: number;
518
- slide: HTMLElement;
519
- }
520
-
521
- export interface CarouselOptions {
522
- /** Enable autoplay */
523
- autoplay?: boolean;
524
- /** Autoplay interval in ms */
525
- interval?: number;
526
- /** Pause autoplay on hover */
527
- pauseOnHover?: boolean;
528
- /** Loop back to start */
529
- loop?: boolean;
530
- /** Animation type */
531
- animation?: 'slide' | 'fade' | 'crossfade';
532
- /** Use the shortest scaled image height, or the midpoint of shortest and tallest */
533
- heightMode?: 'crop' | 'average';
534
- /** Optional fixed viewport height in pixels */
535
- height?: number;
536
- /** Animation duration in ms */
537
- animationDuration?: number;
538
- /** Show navigation arrows */
539
- showArrows?: boolean;
540
- /** Show indicator dots */
541
- showIndicators?: boolean;
542
- /** Selector for slide elements */
543
- slideSelector?: string;
544
- /** CSS class for active state */
545
- activeClass?: string;
546
- /** Callback when slide changes */
547
- onChange?: (event: CarouselChangeEvent) => void;
548
- }
549
-
550
- export interface CarouselInstance extends ComponentInstance {
551
- /** Go to a specific slide */
552
- goTo(index: number): this;
553
-
554
- /** Go to next slide */
555
- next(): this;
556
-
557
- /** Go to previous slide */
558
- prev(): this;
559
-
560
- /** Start autoplay */
561
- play(): this;
562
-
563
- /** Stop autoplay */
564
- pause(): this;
565
-
566
- /** Get current slide index */
567
- getIndex(): number;
568
-
569
- /** Get slide element by index */
570
- getSlide(index?: number): HTMLElement;
571
- }
572
-
573
- // ============================================
574
- // BackToTop Component
575
- // ============================================
576
-
577
- export interface BackToTopScrollEvent {
578
- scrollY: number;
579
- isVisible: boolean;
580
- }
581
-
582
- export interface BackToTopShowEvent {
583
- button: HTMLElement;
584
- }
585
-
586
- export interface BackToTopOptions {
587
- /** Scroll distance to show button (null = viewport height) */
588
- showAfter?: number | null;
589
- /** Scroll animation duration in ms */
590
- duration?: number;
591
- /** Button position */
592
- position?: BackToTopPosition;
593
- /** Distance from edge in px */
594
- offset?: number;
595
- /** Existing button selector (null = create new) */
596
- target?: string | HTMLElement | null;
597
- /** z-index for button */
598
- zIndex?: number;
599
- /** Callback when button shows */
600
- onShow?: (event: BackToTopShowEvent) => void;
601
- /** Callback when button hides */
602
- onHide?: (event: BackToTopShowEvent) => void;
603
- /** Callback on scroll */
604
- onScroll?: (event: BackToTopScrollEvent) => void;
605
- }
606
-
607
- export interface BackToTopInstance extends ComponentInstance {
608
- /** Scroll to top */
609
- scroll(): this;
610
-
611
- /** Show the button */
612
- show(): this;
613
-
614
- /** Hide the button */
615
- hide(): this;
616
-
617
- /** Toggle button visibility */
618
- toggle(): this;
619
-
620
- /** Check if button is visible */
621
- isVisible(): boolean;
622
-
623
- /** Get the button element */
624
- getButton(): HTMLElement;
625
- }
626
-
627
- // ============================================
628
- // Split Pane
629
- // ============================================
630
-
631
- /** A pane size limit: px as a number, or a percentage string such as '20%' */
632
- export type SplitPaneSize = number | string;
633
-
634
- export interface SplitPaneOptions {
635
- /** 'horizontal' = side by side (default), 'vertical' = stacked */
636
- direction?: 'horizontal' | 'vertical';
637
- /** Percentages, one per pane (scaled to add up to 100); equal by default */
638
- sizes?: number[];
639
- /** Minimum size, one value or one per pane (default 0) */
640
- minSize?: SplitPaneSize | SplitPaneSize[];
641
- /** Maximum size, one value or one per pane (default none) */
642
- maxSize?: SplitPaneSize | null | Array<SplitPaneSize | null>;
643
- /** Gutter thickness in px (default 8) */
644
- gutterSize?: number;
645
- /** Snap to a limit when dragged within this many px of it (default 0) */
646
- snapOffset?: number;
647
- /** Which panes the gutter gestures may collapse */
648
- collapsible?: boolean | boolean[];
649
- /** What a collapsed pane shrinks to (default 0) */
650
- collapsedSize?: SplitPaneSize | SplitPaneSize[];
651
- /** A small toggle button in gutters next to a collapsible pane */
652
- collapseButton?: boolean;
653
- /** Remember sizes and collapse state with S under 'split-pane:<key>' */
654
- persistKey?: string | null;
655
- /** Gutter cursor (default col-resize / row-resize) */
656
- cursor?: string | null;
657
- disabled?: boolean;
658
- /** Percent per arrow key (default 1) */
659
- step?: number;
660
- /** Percent per Shift+arrow (default 10) */
661
- largeStep?: number;
662
- /** The gutters' aria-label */
663
- gutterLabel?: string;
664
- /** Return false to refuse a drag */
665
- onBeforeDrag?: (gutterIndex: number, event: PointerEvent) => boolean | void;
666
- onDragStart?: (sizes: number[], gutterIndex: number) => void;
667
- onDrag?: (sizes: number[], gutterIndex: number) => void;
668
- onDragEnd?: (sizes: number[], gutterIndex: number) => void;
669
- /** Any size change: drag, keys, setSizes, collapse */
670
- onResize?: (sizes: number[]) => void;
671
- onCollapse?: (paneIndex: number) => void;
672
- onExpand?: (paneIndex: number) => void;
673
- }
674
-
675
- export interface SplitPaneInstance extends ComponentInstance {
676
- /** The pane elements */
677
- readonly panes: HTMLElement[];
678
- /** Current sizes, percentages that add up to 100 */
679
- getSizes(): number[];
680
- /** Set every pane's size (clamped to the limits) */
681
- setSizes(sizes: number[]): this;
682
- collapse(index: number): this;
683
- expand(index: number): this;
684
- isCollapsed(index: number): boolean;
685
- /** Remove the gutters and listeners and restore the panes' own styles */
686
- destroy(): void;
687
- }
688
-
689
- // ============================================
690
- // Virtual List
691
- // ============================================
692
-
693
- export interface VirtualListRange {
694
- /** First index, inclusive */
695
- start: number;
696
- /** Last index, inclusive (-1 for an empty list) */
697
- end: number;
698
- }
699
-
700
- export type VirtualListTemplate = string | Node | ((error?: unknown) => string | Node | null) | null;
701
-
702
- export interface VirtualListOptions<T = any> {
703
- items?: T[] | null;
704
- /** With getItem, instead of items */
705
- count?: number;
706
- getItem?: ((index: number) => T) | null;
707
- /** px, or 'auto' to measure each row (default 40) */
708
- itemHeight?: number | 'auto';
709
- /** Height assumed for unmeasured rows in 'auto' mode (default 40) */
710
- estimatedItemHeight?: number;
711
- /** Rows rendered beyond each edge (default 4) */
712
- overscan?: number;
713
- /** A string is HTML (sanitised unless safe: false); an Element goes in as it is */
714
- render?: ((item: T, index: number) => string | Node) | null;
715
- /** false: render() strings are inserted unsanitised (default true) */
716
- safe?: boolean;
717
- /** Property name or function giving each item a stable key (default: the index) */
718
- keyField?: string | ((item: T, index: number) => unknown) | null;
719
- /** aria-label for the list */
720
- label?: string | null;
721
- /** Extra class on every row */
722
- rowClass?: string;
723
- /** Called near the end; resolves to the next items, or {items, done} */
724
- loadMore?: ((info: {count: number; page: number}) => Promise<T[] | {items: T[]; done?: boolean}>) | null;
725
- /** px from the end at which loadMore is called (default 200) */
726
- threshold?: number;
727
- loadingTemplate?: VirtualListTemplate;
728
- endTemplate?: VirtualListTemplate;
729
- /** A [data-vlist-retry] element inside it retries */
730
- errorTemplate?: VirtualListTemplate;
731
- onRender?: (range: VirtualListRange) => void;
732
- onScroll?: (visible: VirtualListRange) => void;
733
- onLoadMore?: (info: {count: number; page: number}) => void;
734
- onLoaded?: (items: T[]) => void;
735
- onEnd?: () => void;
736
- onError?: (error: unknown) => void;
737
- onItemClick?: (item: T, index: number, event: MouseEvent | KeyboardEvent) => void;
738
- }
739
-
740
- export interface VirtualListInstance<T = any> extends ComponentInstance {
741
- /** Number of rows */
742
- readonly count: number;
743
- setItems(items: T[]): this;
744
- append(items: T[]): this;
745
- /** Add at the start without moving what is on screen */
746
- prepend(items: T[]): this;
747
- /** A number is an index; anything else is a key */
748
- update(indexOrKey: number | unknown, item: T): this;
749
- indexOfKey(key: unknown): number;
750
- scrollToIndex(index: number, options?: {align?: 'start' | 'center' | 'end' | 'auto'; smooth?: boolean}): this;
751
- /** Scroll to a row and focus it */
752
- focusIndex(index: number): this;
753
- /** Re-render (and re-measure) the rendered rows */
754
- refresh(): this;
755
- /** Rows at least partly on screen */
756
- getVisibleRange(): VirtualListRange;
757
- /** Rows in the DOM, overscan included */
758
- getRenderedRange(): VirtualListRange;
759
- /** Retry a failed load */
760
- retry(): this;
761
- /** Whether loadMore has said there is nothing more */
762
- isDone(): boolean;
763
- /** Count mode: change the number of rows */
764
- setCount(count: number): this;
765
- /** Remove the rows and listeners and give the container its children back */
766
- destroy(): void;
767
- }
768
-
769
- // ============================================
770
- // Elements Module
771
- // ============================================
772
-
773
- // ============================================
774
- // Focus trap
775
- // ============================================
776
-
777
- type FocusTarget = string | HTMLElement;
778
-
779
- export interface FocusTrapOptions {
780
- /** Where focus goes on activate: a selector, an element, a function returning one, or false to leave it. Default: focus already inside stays, else the first tabbable, else the container. */
781
- initialFocus?: FocusTarget | (() => HTMLElement | null) | false;
782
- /** Where focus goes when nothing is tabbable (default: the first container, given tabindex="-1") */
783
- fallbackFocus?: FocusTarget | (() => HTMLElement | null);
784
- /** true (default): back to what had focus before activate(); or an element / selector; false: nowhere */
785
- returnFocus?: boolean | FocusTarget;
786
- /** Escape deactivates (default false - the owning overlay decides) */
787
- escapeDeactivates?: boolean | ((e: KeyboardEvent) => boolean);
788
- /** A press outside deactivates (default false) */
789
- clickOutsideDeactivates?: boolean | ((e: MouseEvent) => boolean);
790
- /** Let clicks outside through (default false: they are blocked) */
791
- allowOutsideClick?: boolean | ((e: MouseEvent) => boolean);
792
- /** Set `inert` on everything outside the containers while active (default false) */
793
- inert?: boolean;
794
- /** Walk open shadow roots (default true) */
795
- shadow?: boolean;
796
- preventScroll?: boolean;
797
- onActivate?: (trap: FocusTrapInstance) => void;
798
- onDeactivate?: (trap: FocusTrapInstance) => void;
799
- onPause?: (trap: FocusTrapInstance) => void;
800
- onUnpause?: (trap: FocusTrapInstance) => void;
801
- }
802
-
803
- export interface FocusTrapInstance extends ComponentInstance {
804
- /** Start trapping; pauses the trap that was on top */
805
- activate(opts?: {initialFocus?: FocusTrapOptions['initialFocus']}): this;
806
- /** Stop trapping; unpauses the trap beneath */
807
- deactivate(opts?: {returnFocus?: boolean | FocusTarget}): this;
808
- pause(): this;
809
- unpause(opts?: {focus?: boolean}): this;
810
- updateContainers(containers: FocusTarget | FocusTarget[]): this;
811
- containers(): HTMLElement[];
812
- isActive(): boolean;
813
- isPaused(): boolean;
814
- /** The tabbable elements in the containers right now, in Tab order */
815
- tabbables(): HTMLElement[];
816
- destroy(): void;
817
- }
818
-
819
- export interface FocusTrapFactory {
820
- (containers: FocusTarget | FocusTarget[], options?: FocusTrapOptions): FocusTrapInstance | null;
821
- /** What Tab would reach in some containers, in order */
822
- tabbables(containers: HTMLElement | HTMLElement[], opts?: {shadow?: boolean}): HTMLElement[];
823
- /** The trap that currently listens */
824
- top(): FocusTrapInstance | null;
825
- }
826
-
827
- // ============================================
828
- // Command palette
829
- // ============================================
830
-
831
- export interface PaletteCommand {
832
- id?: string;
833
- title: string;
834
- subtitle?: string;
835
- /** Heading the command is listed under */
836
- group?: string;
837
- /** Domma icon name */
838
- icon?: string;
839
- /** More words that find it */
840
- keywords?: string[];
841
- /** Shown as a hint, e.g. 'mod+s' (mod = Cmd on a Mac, Ctrl elsewhere) */
842
- shortcut?: string;
843
- /** Followed when run (http(s), mailto, tel or relative only) */
844
- href?: string;
845
- /** '_blank' opens href in a new tab */
846
- target?: string;
847
- action?: (command: PaletteCommand, palette: CommandPaletteInstance, event?: Event) => void;
848
- disabled?: boolean;
849
- hidden?: boolean;
850
- /** Running it leaves the palette open */
851
- keepOpen?: boolean;
852
- /** A nested page: a list, or a function returning one (called once on entering) */
853
- children?: PaletteCommand[] | ((command: PaletteCommand, ctx: {signal?: AbortSignal, palette: CommandPaletteInstance}) => Promise<PaletteCommand[]> | PaletteCommand[]);
854
- /** Placeholder for the box while this command's page is open */
855
- placeholder?: string;
856
- [key: string]: any;
857
- }
858
-
859
- export interface CommandPaletteOptions {
860
- commands?: PaletteCommand[];
861
- /** Search elsewhere: debounced, the previous request aborted through `signal` */
862
- source?: (query: string, ctx: {signal?: AbortSignal, palette: CommandPaletteInstance}) => Promise<PaletteCommand[]> | PaletteCommand[];
863
- /** ms (default 150) */
864
- debounce?: number;
865
- /** 'mod+k' (default), several, or false */
866
- hotkey?: string | string[] | false;
867
- placeholder?: string;
868
- /** Accessible name of the dialog and list (default 'Command palette') */
869
- label?: string;
870
- maxResults?: number;
871
- /** Storage (S) key for recent commands; null (default) = off */
872
- recentKey?: string | null;
873
- recentLimit?: number;
874
- recentLabel?: string;
875
- sourceGroup?: string | null;
876
- emptyText?: string;
877
- loadingText?: string;
878
- /** While a nested page's async children load (default 'Loading…') */
879
- pageLoadingText?: string;
880
- errorText?: string;
881
- backLabel?: string;
882
- /** Key hints under the list (default true) */
883
- footer?: boolean;
884
- resultsText?: (count: number) => string;
885
- /** Replaces the default navigation for href commands */
886
- navigate?: (href: string, ctx: {newTab: boolean, command: PaletteCommand}) => void;
887
- animationDuration?: number;
888
- className?: string;
889
- /** Force Mac (true) or other (false) key names; default detects */
890
- mac?: boolean;
891
- onBeforeOpen?: (palette: CommandPaletteInstance) => boolean | void;
892
- onOpen?: (palette: CommandPaletteInstance) => void;
893
- onBeforeClose?: (palette: CommandPaletteInstance) => boolean | void;
894
- onClose?: (palette: CommandPaletteInstance) => void;
895
- onQuery?: (query: string, palette: CommandPaletteInstance) => void;
896
- onBeforeSelect?: (command: PaletteCommand, palette: CommandPaletteInstance) => boolean | void;
897
- onSelect?: (command: PaletteCommand, palette: CommandPaletteInstance) => void;
898
- onRun?: (command: PaletteCommand, palette: CommandPaletteInstance) => void;
899
- }
900
-
901
- export interface CommandPaletteInstance extends ComponentInstance {
902
- open(query?: string): this;
903
- close(): this;
904
- toggle(query?: string): this;
905
- isOpen(): boolean;
906
- show(query?: string): this;
907
- hide(): this;
908
- isVisible(): boolean;
909
- setCommands(list: PaletteCommand[]): this;
910
- addCommands(list: PaletteCommand | PaletteCommand[]): this;
911
- removeCommand(id: string): this;
912
- getCommands(): PaletteCommand[];
913
- /** Up one nested page; false at the top */
914
- back(): boolean;
915
- query(): string;
916
- recent(): string[];
917
- clearRecent(): this;
918
- destroy(): void;
919
- }
920
-
921
- export interface CommandPaletteFactory {
922
- (options?: CommandPaletteOptions): CommandPaletteInstance;
923
- formatShortcut(combo: string, mac?: boolean): string[];
924
- fuzzyMatch(query: string, text: string): {score: number, indices: number[]} | null;
925
- /** Whether a live palette's hotkey answers this keydown (for page scripts with their own shortcut) */
926
- claims(e: KeyboardEvent): boolean;
927
- }
928
-
929
- export interface Elements {
930
- /** Create a Card component */
931
- card(selector: string | HTMLElement, options?: CardOptions): CardInstance;
932
-
933
- /** Create a Modal component */
934
- modal(selector: string | HTMLElement, options?: ModalOptions): ModalInstance;
935
-
936
- /** Create a Tabs component */
937
- tabs(selector: string | HTMLElement, options?: TabsOptions): TabsInstance;
938
-
939
- /** Create an Accordion component */
940
- accordion(selector: string | HTMLElement, options?: AccordionOptions): AccordionInstance;
941
-
942
- /** Create Tooltip(s) - returns array if multiple elements match */
943
- /** Sets up every match; returns the first, with `all()` for every instance */
944
- tooltip(selector: string | HTMLElement, options?: TooltipOptions): TooltipInstance & {all(): TooltipInstance[]};
945
-
946
- /** Create Badge(s) - returns array if multiple elements match */
947
- badge(selector: string | HTMLElement, options?: BadgeOptions): BadgeInstance | BadgeInstance[];
948
-
949
- /** Create a NumberBadge notification counter on an element */
950
- numberBadge(selector: string | HTMLElement, options?: NumberBadgeOptions): NumberBadgeInstance;
951
-
952
- /** Create a Dropdown component */
953
- dropdown(selector: string | HTMLElement, options?: DropdownOptions): DropdownInstance;
954
-
955
- /** Create a Carousel component */
956
- carousel(selector: string | HTMLElement, options?: CarouselOptions): CarouselInstance;
957
-
958
- /** Create a BackToTop component */
959
- backToTop(selector?: string | HTMLElement, options?: BackToTopOptions): BackToTopInstance;
960
-
961
- /** Toast notification system */
962
- toast: ToastStatic;
963
-
964
- /** Keep Tab and focus inside containers while active */
965
- focusTrap: FocusTrapFactory;
966
-
967
- /** A Cmd/Ctrl+K command palette (builds its own overlay) */
968
- commandPalette: CommandPaletteFactory;
969
-
970
- /** Resizable panes from a container's children; null when nothing matches */
971
- splitPane(container: string | HTMLElement, options?: SplitPaneOptions): SplitPaneInstance | null;
972
-
973
- /** A scrolling list that renders only the visible rows; null when nothing matches */
974
- virtualList<T = any>(container: string | HTMLElement, options?: VirtualListOptions<T>): VirtualListInstance<T> | null;
975
-
976
- /** A file drop / browse / paste area over a real file input. Null when the target matches nothing. */
977
- dropzone(target: string | HTMLElement, options?: DropzoneOptions): DropzoneInstance | null;
978
-
979
- /** A one- or two-thumb slider over real range inputs. Null when the target matches nothing. */
980
- rangeSlider(target: string | HTMLElement, options?: RangeSliderOptions): RangeSliderInstance | null;
981
-
982
- /** Alias of rangeSlider() */
983
- slider(target: string | HTMLElement, options?: RangeSliderOptions): RangeSliderInstance | null;
984
-
985
- /** Get the component on an element - factory-made ones too. `name` picks one when an element hosts several. */
986
- get(selector: string | HTMLElement, name?: string): ComponentInstance | undefined;
987
-
988
- /** Destroy a component */
989
- destroy(selector: string | HTMLElement): void;
990
-
991
- /** Destroy all components */
992
- destroyAll(): void;
993
-
994
- /** Register a custom component class */
995
- register(name: string, ComponentClass: new (selector: any, options?: any) => ComponentInstance): void;
996
-
997
- /** Create a registered custom component */
998
- create(name: string, selector: string | HTMLElement, options?: Record<string, any>): ComponentInstance;
999
- }
1000
-
1001
- export declare const elements: Elements;
1002
-
1003
- // ============================================
1004
- // Dropzone
1005
- // ============================================
1006
-
1007
- export type DropzoneStatus = 'queued' | 'uploading' | 'done' | 'error' | 'cancelled';
1008
- export type DropzoneRejectReason = 'type' | 'size' | 'count';
1009
-
1010
- /** One file in a dropzone, as every event hands it over */
1011
- export interface DropzoneEntry {
1012
- id: string;
1013
- file: File;
1014
- name: string;
1015
- size: number;
1016
- type: string;
1017
- status: DropzoneStatus;
1018
- /** Upload progress, 0-100 */
1019
- progress: number;
1020
- /** The upload's response (parsed when it was JSON) */
1021
- response: any;
1022
- error: DropzoneUploadError | null;
1023
- /** Object URL of an image preview, revoked when the file goes */
1024
- preview: string | null;
1025
- }
1026
-
1027
- export interface DropzoneUploadError {
1028
- /** HTTP status, 0 for a network failure */
1029
- status: number;
1030
- message: string;
1031
- response: any;
1032
- }
1033
-
1034
- export interface DropzoneUploadOptions {
1035
- url: string | ((entry: DropzoneEntry) => string);
1036
- /** Default 'POST' */
1037
- method?: string;
1038
- /** FormData field for the file. Default 'file' */
1039
- field?: string;
1040
- headers?: Record<string, string> | ((entry: DropzoneEntry) => Record<string, string>);
1041
- withCredentials?: boolean;
1042
- /** Files sent at once. Default 2 */
1043
- concurrency?: number;
1044
- /** Extra FormData fields */
1045
- data?: Record<string, string | Blob> | ((entry: DropzoneEntry) => Record<string, string | Blob>);
1046
- /** Make the request object (tests, pages without a server). Default: new XMLHttpRequest() */
1047
- xhr?: (entry: DropzoneEntry) => XMLHttpRequest;
1048
- }
1049
-
1050
- export interface DropzoneOptions {
1051
- /** Like the input's accept: '.pdf,image/*' or ['.pdf', 'image/*']. Default: the input's */
1052
- accept?: string | string[] | null;
1053
- /** Default: the input's `multiple`, or true when the component makes the input */
1054
- multiple?: boolean | null;
1055
- maxFiles?: number | null;
1056
- /** Bytes */
1057
- maxSize?: number | null;
1058
- /** Bytes */
1059
- minSize?: number | null;
1060
- /** Image thumbnails. Default true */
1061
- previews?: boolean;
1062
- /** Form field name. Default: the input's */
1063
- name?: string | null;
1064
- /** The file input, when it is not inside or next to the area */
1065
- input?: string | HTMLInputElement | null;
1066
- /** true = after the area (default), an element/selector to draw into, false = no list */
1067
- list?: boolean | string | HTMLElement;
1068
- upload?: DropzoneUploadOptions | null;
1069
- /** Default true */
1070
- autoUpload?: boolean;
1071
- /** Automatic retries per file. Default 0 */
1072
- retry?: number;
1073
- /** Text: prompt, hint, remove, retry, cancel, added, removed, type, size, small, count, uploading, done, failed, cancelled, required ({name}, {max}, {min}, {percent}) */
1074
- labels?: Record<string, string>;
1075
- disabled?: boolean;
1076
- className?: string;
1077
- /** Return false to refuse the file */
1078
- onBeforeAdd?: (entry: DropzoneEntry) => boolean | void;
1079
- onAdd?: (entry: DropzoneEntry) => void;
1080
- onReject?: (entry: DropzoneEntry, reason: DropzoneRejectReason) => void;
1081
- onRemove?: (entry: DropzoneEntry) => void;
1082
- onChange?: (files: File[]) => void;
1083
- onUploadStart?: (entry: DropzoneEntry) => void;
1084
- onProgress?: (entry: DropzoneEntry, percent: number) => void;
1085
- onSuccess?: (entry: DropzoneEntry, response: any) => void;
1086
- onError?: (entry: DropzoneEntry, error: DropzoneUploadError) => void;
1087
- onComplete?: (entries: DropzoneEntry[]) => void;
1088
- }
1089
-
1090
- export interface DropzoneInstance extends ComponentInstance {
1091
- /** The drop area (the element, or the one drawn after a file input given as the target) */
1092
- zone: HTMLElement;
1093
- /** The real file input */
1094
- input: HTMLInputElement;
1095
- getFiles(): File[];
1096
- getEntries(): DropzoneEntry[];
1097
- addFiles(files: FileList | File[] | File): DropzoneEntry[];
1098
- removeFile(ref: string | DropzoneEntry | File): boolean;
1099
- clear(): this;
1100
- /** Open the file picker */
1101
- browse(): this;
1102
- upload(): this;
1103
- retry(ref?: string | DropzoneEntry | File): this;
1104
- cancel(ref?: string | DropzoneEntry | File): this;
1105
- enable(): this;
1106
- disable(): this;
1107
- isDisabled(): boolean;
1108
- }
1109
-
1110
- // ============================================
1111
- // Range slider
1112
- // ============================================
1113
-
1114
- export type RangeSliderValue = number | [number, number];
1115
-
1116
- export interface RangeSliderMark {
1117
- value: number;
1118
- label?: string;
1119
- }
1120
-
1121
- export interface RangeSliderOptions {
1122
- /** Default: the input's min, else 0 */
1123
- min?: number;
1124
- /** Default: the input's max, else 100 */
1125
- max?: number;
1126
- /** Default: the input's step, else 1 */
1127
- step?: number | 'any';
1128
- /** A number, or [low, high] / "low,high" with range: true */
1129
- value?: RangeSliderValue | string | null;
1130
- /** Two thumbs; two inputs, sharing `name` unless `names` is given */
1131
- range?: boolean;
1132
- orientation?: 'horizontal' | 'vertical';
1133
- /** true = every step, n = every n units, or the values to draw at */
1134
- ticks?: boolean | number | number[];
1135
- /** Label the ticks (always on for an array) */
1136
- tickLabels?: boolean;
1137
- /** Formats the value for ticks, marks, the tooltip and aria-valuetext */
1138
- labels?: ((value: number, where: 'tick' | 'mark' | 'tooltip' | 'aria') => string) | null;
1139
- /** Default 'hover' (also shown on focus and while dragging) */
1140
- tooltip?: 'always' | 'hover' | 'never';
1141
- marks?: RangeSliderMark[] | null;
1142
- disabled?: boolean;
1143
- name?: string | null;
1144
- /** [lowName, highName] for range: true */
1145
- names?: [string, string] | null;
1146
- /** range: true - the closest the thumbs may come */
1147
- minDistance?: number;
1148
- /** null = follow the page's direction */
1149
- rtl?: boolean | null;
1150
- ariaLabel?: string | null;
1151
- ariaLabels?: [string, string] | null;
1152
- className?: string;
1153
- /** While dragging, and on each key press */
1154
- onInput?: (value: RangeSliderValue) => void;
1155
- /** When the value is committed */
1156
- onChange?: (value: RangeSliderValue) => void;
1157
- /** Return false to refuse a move */
1158
- onBeforeChange?: (next: RangeSliderValue, current: RangeSliderValue) => boolean | void;
1159
- }
1160
-
1161
- export interface RangeSliderInstance extends ComponentInstance {
1162
- getValue(): RangeSliderValue;
1163
- setValue(value: RangeSliderValue | string, opts?: {silent?: boolean}): this;
1164
- setRange(min: number, max: number): this;
1165
- enable(): this;
1166
- disable(): this;
1167
- isDisabled(): boolean;
1168
- }