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
@@ -0,0 +1,4994 @@
1
+ /**
2
+ * @typedef {object} ChooserBadge
3
+ * @property {string} text
4
+ * @property {'success'|'info'|'warning'|'danger'|'primary'} [type='primary']
5
+ */
6
+ /**
7
+ * @typedef {object} ChooserOption
8
+ * @property {string|number} value
9
+ * @property {string} label
10
+ * @property {string} [icon] - Domma icon name
11
+ * @property {string} [description] - Card variant, comfortable density only
12
+ * @property {string} [tooltip]
13
+ * @property {ChooserBadge} [badge]
14
+ * @property {boolean} [recommended]
15
+ * @property {boolean} [disabled]
16
+ */
17
+ /** @typedef {'primary'|'success'|'info'|'warning'|'danger'} ChooserSemanticColour */
18
+ /**
19
+ * @typedef {object} ChooserOptions
20
+ * @property {ChooserOption[]} options - The choices
21
+ * @property {'card'|'chip'} [variant='card']
22
+ * @property {boolean} [multiple=false] - Multi-select
23
+ * @property {'comfortable'|'compact'} [density='comfortable']
24
+ * @property {number} [columns=3] - Grid columns (card variant)
25
+ * @property {string} [label] - Label rendered above
26
+ * @property {boolean} [required=false] - Required indicator
27
+ * @property {string} [name] - Hidden-input name for native form submission
28
+ * @property {string|string[]|null} [value] - Initial selection
29
+ * @property {ChooserSemanticColour|string} [accent='primary'] - Selected/recommended highlight colour - semantic name or any CSS colour string
30
+ * @property {'border'|'solid'|'glow'|'overlay'|'underline'} [accentStyle='border'] - Visual style of the selected state
31
+ * @property {boolean} [glow=false] - Soft outer glow on the selected option
32
+ * @property {ChooserSemanticColour|string|null} [glowColour=null] - Glow colour override - semantic name or any CSS colour string. Defaults to the accent colour.
33
+ * @property {'none'|'sm'|'md'|'lg'|'xl'} [shadow='none'] - Shadow weight applied to every option
34
+ * @property {string|null} [shadowColour=null] - Optional shadow tint - any CSS colour string
35
+ * @property {(value: string|string[]|null) => void} [onChange] - Called with the new value (user changes only, not setValue)
36
+ */
37
+ /**
38
+ * What `E.chooser()` returns. A missing host gets an inert one (`element` null, methods do nothing).
39
+ * @typedef {{
40
+ * readonly element: HTMLElement|null,
41
+ * _root: HTMLElement|null,
42
+ * getValue(): string|string[]|null,
43
+ * setValue(value: string|string[]|null): void,
44
+ * disable(): void,
45
+ * enable(): void,
46
+ * destroy(): void
47
+ * }} ChooserInstance
48
+ */
49
+ /**
50
+ * `Domma.elements` / `E` - every UI component factory.
51
+ * @typedef {object} Elements
52
+ * @property {(selector: import('./components/shared.js').ComponentTarget, options?: import('./components/card.js').CardOptions) => import('./components/card.js').CardInstance|null} card
53
+ * Create a Card component (null when nothing matches)
54
+ * @property {{
55
+ * (selector: string|Element|ArrayLike<Element>, options?: import('./components/modal.js').ModalOptions): import('./components/modal.js').ModalInstance|null,
56
+ * (options: import('./components/modal.js').ModalOptions): import('./components/modal.js').ModalInstance
57
+ * }} modal
58
+ * Create a Modal: on an element (null when nothing matches), or - given only an options object - a new
59
+ * modal in the shared dialog container
60
+ * @property {(selector: string|HTMLElement, options?: TabsOptions) => TabsInstance} tabs - Create a Tabs component
61
+ * @property {(selector: string|HTMLElement, options?: AccordionOptions) => AccordionInstance} accordion - Create an Accordion component
62
+ * @property {{
63
+ * (selector: import('./components/shared.js').ComponentTarget, options?: import('./components/tooltip.js').TooltipOptions): (import('./components/tooltip.js').TooltipInstance & {all(): import('./components/tooltip.js').TooltipInstance[]})|null,
64
+ * all(selector: import('./components/shared.js').ComponentTarget, options?: import('./components/tooltip.js').TooltipOptions): import('./components/tooltip.js').TooltipInstance[]
65
+ * }} tooltip
66
+ * A tooltip on every match; returns the first (with `all()` for the rest), or null.
67
+ * `E.tooltip.all()` returns them as an array.
68
+ * @property {(selector: import('./components/shared.js').ComponentTarget, options?: import('./components/badge.js').BadgeOptions) => import('./components/badge.js').BadgeInstance|null} badge
69
+ * Create a Badge (null when nothing matches)
70
+ * @property {(selector: import('./components/shared.js').ComponentTarget, options?: import('./components/badge.js').NumberBadgeOptions) => import('./components/badge.js').NumberBadgeInstance|null} numberBadge
71
+ * Create a NumberBadge notification counter on an element (null when nothing matches)
72
+ * @property {(selector: string|HTMLElement, options?: DropdownOptions) => DropdownInstance} dropdown - Create a Dropdown component
73
+ * @property {(selector: string|HTMLElement, options?: CarouselOptions) => CarouselInstance} carousel - Create a Carousel component
74
+ * @property {(options?: CookieConsentOptions) => CookieConsentInstance} cookieConsent - The page's cookie consent banner (one per page)
75
+ * @property {(selector?: string|HTMLElement|null, options?: import('./components/back-to-top.js').BackToTopOptions) => import('./components/back-to-top.js').BackToTopInstance} backToTop
76
+ * Create a BackToTop button: a button / link selector is used as the button, anything else adds one
77
+ * @property {{
78
+ * (selector: string|HTMLElement, options?: ButtonGroupOptions): (ButtonGroupInstance & {all(): ButtonGroup[]})|null,
79
+ * all(selector: string|HTMLElement, options?: ButtonGroupOptions): ButtonGroup[]
80
+ * }} buttonGroup
81
+ * A button group on every match; returns the first (with `all()` for the rest). `E.buttonGroup.all()`
82
+ * returns them as an array. A selector that matches nothing returns null.
83
+ * @property {(selector: import('./components/shared.js').ComponentTarget, options?: import('./components/loader.js').LoaderOptions) => import('./components/loader.js').LoaderInstance|null} loader
84
+ * Create a Loader on an element (null when nothing matches)
85
+ * @property {(selector: import('./components/shared.js').ComponentTarget, options?: import('./components/loader.js').LoaderOptions) => import('./components/loader.js').LoaderInstance|null} showLoader
86
+ * Show the element's loader, creating it if needed
87
+ * @property {(selector: import('./components/shared.js').ComponentTarget) => import('./components/loader.js').LoaderInstance|undefined} hideLoader
88
+ * Hide the element's loader
89
+ * @property {(text?: string, options?: {type?: string, size?: string, color?: string}) => import('./components/loader.js').LoaderInstance} fullscreenLoader
90
+ * A full-screen loader (`#dm-loader-fullscreen`), reused on later calls
91
+ * @property {(selector: string|HTMLElement, options?: BreadcrumbsOptions) => BreadcrumbsInstance} breadcrumbs - Render breadcrumbs into an element
92
+ * @property {(selector: string|HTMLElement, options?: NavbarOptions) => NavbarInstance} navbar - Render a navbar into an element
93
+ * @property {(selector: string|HTMLElement, options?: SidebarOptions) => SidebarInstance} sidebar - Render a sidebar into an element
94
+ * @property {(selector: string|HTMLElement, options?: FooterOptions) => FooterInstance} footer - Render a footer into an element
95
+ * @property {(options?: DesktopNotificationOptions) => DesktopNotification} notification - A desktop notification (call show())
96
+ * @property {(title: string|DesktopNotificationOptions, options?: DesktopNotificationOptions) => DesktopNotification} notify
97
+ * Show a desktop notification now: notify(title, options) or notify({title, ...})
98
+ * @property {(selector?: string|HTMLElement|null, options?: TimerOptions) => TimerInstance} timer
99
+ * A countdown timer; with no selector it is headless
100
+ * @property {(options?: AlarmOptions) => AlarmInstance} alarm - The page's alarm manager (a singleton)
101
+ * @property {(selector: string|HTMLElement, options?: AutocompleteOptions) => AutocompleteInstance} autocomplete - Suggestions under a text input
102
+ * @property {(selector: string|HTMLElement, options?: PillboxOptions) => PillboxInstance} pillbox - Multi-value pill input
103
+ * @property {(selector: string|HTMLElement, options?: DatePickerOptions) => DatePickerInstance} datePicker
104
+ * A themed calendar attached to an input, writing ISO `YYYY-MM-DD`
105
+ * @property {(selector: string|HTMLElement, options: ChooserOptions) => ChooserInstance} chooser
106
+ * Visual option-picker - card or chip variants, single or multi-select, with rich per-option metadata
107
+ * (icon, description, tooltip, badge, recommended, disabled)
108
+ * @property {{
109
+ * (selector: string|HTMLElement, options?: import('./context-menu.js').ContextMenuOptions): import('./context-menu.js').ContextMenuInstance,
110
+ * closeAll(): void,
111
+ * active(): import('./context-menu.js').ContextMenuInstance|null,
112
+ * registry(forElement?: HTMLElement|null): import('./context-menu.js').ContextMenuInstance[]
113
+ * }} contextMenu
114
+ * Bind a right-click menu to a container and, by delegation, its children. Menus nest: an inner menu
115
+ * shadows its parent for the region it covers, and by default appends the parent's items beneath its own.
116
+ * `closeAll()` closes the open one, `active()` returns it, `registry(el?)` lists bound menus (for an
117
+ * element, its resolution chain, innermost first).
118
+ * @property {(selector: string|HTMLElement, options?: import('./sortable.js').SortableOptions) => import('./sortable.js').SortableInstance} sortable
119
+ * Drag-to-reorder for a container's children, by pointer, touch and keyboard
120
+ * @property {import('./skeleton.js').SkeletonStatic} skeleton
121
+ * Shimmering placeholders shaped like the content on its way; `.while(target, promise, opts)`, `.get`,
122
+ * `.remove`, `.scan`, `.markup`
123
+ * @property {import('./avatar.js').AvatarStatic} avatar - A picture, initials or icon; `.scan()` for data-avatar
124
+ * @property {import('./avatar.js').AvatarGroupStatic} avatarGroup - Overlapping avatars with "+N"
125
+ * @property {(selector: string|HTMLElement, options?: import('./input-group.js').InputGroupOptions) => import('./input-group.js').InputGroupInstance} inputGroup
126
+ * Join an icon or short text (and reveal / clear / stepper / counter extras) to an input already on the page
127
+ * @property {{
128
+ * (trigger: string|HTMLElement|ArrayLike<HTMLElement>, options?: import('./popover.js').PopoverOptions): import('./popover.js').PopoverInstance,
129
+ * scan(root?: string|Element|Document): import('./popover.js').PopoverInstance[],
130
+ * closeAll(group?: string|null): void,
131
+ * getInstance(trigger: string|HTMLElement): import('./popover.js').PopoverInstance|null,
132
+ * open(): import('./popover.js').PopoverInstance[]
133
+ * }} popover
134
+ * Anchor a rich panel (title, text/DOM content, close button) to a trigger, opened by click, hover, focus
135
+ * or code. `scan(root)` reads `data-popover` markup, `closeAll(group?)`, `getInstance(trigger)`, `open()`
136
+ * lists the open ones.
137
+ * @property {(selector: string|HTMLElement, options?: import('./treeview.js').TreeViewOptions) => import('./treeview.js').TreeViewInstance} treeView
138
+ * A tree of expandable nodes
139
+ * @property {{
140
+ * (options: SlideoverCreateOptions): SlideoverInstance,
141
+ * (selector: string|HTMLElement, options?: SlideoverOptions): SlideoverInstance
142
+ * }} slideover
143
+ * A panel sliding in from an edge: on an element, or - given only an options object - a new one
144
+ * (`Slideover.create()`)
145
+ * @property {(selector: string|HTMLElement, options?: ProgressionOptions) => ProgressionInstance} progression
146
+ * A timeline or roadmap
147
+ * @property {{
148
+ * (selector: string|HTMLElement, options?: ListGroupOptions): (ListGroupInstance & {all(): ListGroup[]})|null,
149
+ * all(selector: string|HTMLElement, options?: ListGroupOptions): ListGroup[]
150
+ * }} listGroup
151
+ * A list group on every match; returns the first (with `all()` for the rest). `E.listGroup.all()`
152
+ * returns them as an array. A selector that matches nothing returns null.
153
+ * @property {import('./components/toast.js').ToastStatic} toast
154
+ * Toast notifications: `E.toast(message, options)` plus `.show/.success/.error/.warning/.info/.closeAll`
155
+ * @property {{
156
+ * alert(message: string|DialogOptions, options?: DialogOptions): Promise<undefined|false>,
157
+ * confirm(message: string|DialogOptions, options?: DialogOptions): Promise<boolean>,
158
+ * prompt(message: string|DialogOptions, options?: DialogOptions): Promise<string|null>
159
+ * }} dialog
160
+ * Promise-based alert, confirm and prompt dialogs
161
+ * @property {(message: string|DialogOptions, options?: DialogOptions) => Promise<undefined|false>} alert
162
+ * An alert dialog; resolves undefined on OK, false when dismissed
163
+ * @property {(message: string|DialogOptions, options?: DialogOptions) => Promise<boolean>} confirm
164
+ * A confirm dialog; true if confirmed
165
+ * @property {(message: string|DialogOptions, options?: DialogOptions) => Promise<string|null>} prompt
166
+ * A prompt dialog; the input value, or null if cancelled
167
+ * @property {(options?: import('./components/modal.js').ModalOptions) => import('./components/modal.js').ModalInstance} createModal
168
+ * A new modal in the shared dialog container
169
+ * @property {(options?: import('./components/modal.js').ModalOptions) => Promise<string|null>} showModal
170
+ * Open a new modal and resolve with the button pressed (null when dismissed)
171
+ * @property {(selector: string|HTMLElement, options?: SignatureOptions) => SignatureInstance} signature - Create a Signature capture pad
172
+ * @property {import('./components/focus-trap.js').FocusTrapFactory} focusTrap
173
+ * Keep Tab and focus inside containers while active (null when nothing matched); `.tabbables()`, `.top()`
174
+ * @property {import('./components/command-palette.js').CommandPaletteFactory} commandPalette
175
+ * A Cmd/Ctrl+K command palette (builds its own overlay); `.formatShortcut`, `.fuzzyMatch`, `.claims`
176
+ * @property {(selector: import('./components/shared.js').ComponentTarget, options?: import('./components/split-pane.js').SplitPaneOptions) => import('./components/split-pane.js').SplitPaneInstance|null} splitPane
177
+ * Resizable panes from a container's children; null when nothing matches
178
+ * @property {<T = any>(selector: import('./components/shared.js').ComponentTarget, options?: import('./components/virtual-list.js').VirtualListOptions<T>) => import('./components/virtual-list.js').VirtualListInstance<T>|null} virtualList
179
+ * A scrolling list that renders only the visible rows; null when nothing matches
180
+ * @property {(target: import('./components/shared.js').ComponentTarget, options?: import('./components/dropzone.js').DropzoneOptions) => import('./components/dropzone.js').DropzoneInstance|null} dropzone
181
+ * A file drop / browse / paste area over a real file input; null when the target matches nothing
182
+ * @property {(target: import('./components/shared.js').ComponentTarget, options?: import('./components/range-slider.js').RangeSliderOptions) => import('./components/range-slider.js').RangeSliderInstance|null} rangeSlider
183
+ * A one- or two-thumb slider over real range inputs; null when the target matches nothing
184
+ * @property {(target: import('./components/shared.js').ComponentTarget, options?: import('./components/range-slider.js').RangeSliderOptions) => import('./components/range-slider.js').RangeSliderInstance|null} slider
185
+ * Alias of rangeSlider()
186
+ * @property {<T = import('./component.js').ComponentInstance>(selector: string|Element|null|undefined, name?: string) => T|undefined} get
187
+ * The component on an element - including ones made by a factory (`E.slideover({...})`) or another
188
+ * component. `name` is the componentName ('slideover', 'popover', ...) when an element hosts several.
189
+ * @property {(selector: string|Element|null|undefined, name?: string) => void} destroy - Destroy the component on an element
190
+ * @property {() => void} destroyAll - Destroy every component made through this object
191
+ * @property {(name: string, ComponentClass: new (selector: any, options?: any) => any) => void} register
192
+ * Register a custom component class for create()
193
+ * @property {(name: string, selector: string|HTMLElement, options?: Record<string, any>) => import('./component.js').ComponentInstance} create
194
+ * Create a registered custom component (throws for an unknown name)
195
+ */
196
+ /** @type {Elements} */
197
+ export const elements: Elements;
198
+ export type AnimationType = "fade" | "slide" | "zoom" | "none";
199
+ export type TooltipPosition = "top" | "bottom" | "left" | "right";
200
+ export type DropdownPosition = "bottom-start" | "bottom-end" | "top-start" | "top-end" | "left-start" | "left-end" | "right-start" | "right-end";
201
+ export type ToastPosition = "top-left" | "top-right" | "top-center" | "bottom-left" | "bottom-right" | "bottom-center";
202
+ export type ToastType = "default" | "success" | "error" | "warning" | "info";
203
+ export type BadgeVariant = "primary" | "secondary" | "success" | "danger" | "warning" | "info" | "light" | "dark";
204
+ export type BadgeSize = "small" | "medium" | "large";
205
+ export type ShadowSize = "none" | "small" | "medium" | "large";
206
+ export type BackToTopPosition = "bottom-right" | "bottom-left";
207
+ /**
208
+ * Fired when the active tab changes (onChange option / `.on('change')`).
209
+ */
210
+ export type TabChangeEvent = {
211
+ /**
212
+ * - The new active index
213
+ */
214
+ index: number;
215
+ /**
216
+ * - The previous active index
217
+ */
218
+ oldIndex: number;
219
+ /**
220
+ * - The new active tab
221
+ */
222
+ tab: HTMLElement;
223
+ /**
224
+ * - Its panel
225
+ */
226
+ panel: HTMLElement;
227
+ };
228
+ export type TabsOptions = {
229
+ /**
230
+ * - Initially active tab index
231
+ */
232
+ active?: number;
233
+ /**
234
+ * - Panel animation
235
+ */
236
+ animation?: "fade" | "none";
237
+ /**
238
+ * - Animation duration in ms
239
+ */
240
+ animationDuration?: number;
241
+ /**
242
+ * - Selector for tab items
243
+ */
244
+ tabSelector?: string;
245
+ /**
246
+ * - Selector for tab panels
247
+ */
248
+ panelSelector?: string;
249
+ /**
250
+ * - CSS class for the active tab
251
+ */
252
+ activeClass?: string;
253
+ /**
254
+ * - Called when the active tab changes
255
+ */
256
+ onChange?: ((event: TabChangeEvent) => void) | null;
257
+ };
258
+ /**
259
+ * Tabs: tab items paired by index with panels, with ARIA roles set up.
260
+ */
261
+ export type TabsInstance = Tabs;
262
+ /**
263
+ * Fired when a panel opens or closes through toggle() (onChange option / `.on('change')`).
264
+ */
265
+ export type AccordionChangeEvent = {
266
+ index: number;
267
+ /**
268
+ * - Whether the panel is now open
269
+ */
270
+ isOpen: boolean;
271
+ header: HTMLElement;
272
+ content: HTMLElement;
273
+ };
274
+ export type AccordionOptions = {
275
+ /**
276
+ * - Allow several panels open at once
277
+ */
278
+ allowMultiple?: boolean;
279
+ /**
280
+ * - Alias of allowMultiple (wins when set)
281
+ */
282
+ multiExpand?: boolean | null;
283
+ /**
284
+ * - Initially open panel index(es); null keeps the markup's active class
285
+ */
286
+ activeIndex?: number | number[] | null;
287
+ /**
288
+ * - Animate the height
289
+ */
290
+ animation?: boolean;
291
+ /**
292
+ * - Animation duration in ms
293
+ */
294
+ animationDuration?: number;
295
+ /**
296
+ * - Selector for headers
297
+ */
298
+ headerSelector?: string;
299
+ /**
300
+ * - Selector for panels (outermost matches only)
301
+ */
302
+ contentSelector?: string;
303
+ /**
304
+ * - Class put on the open item (the header's parent)
305
+ */
306
+ activeClass?: string;
307
+ /**
308
+ * - Called when toggle() opens or closes a panel
309
+ */
310
+ onChange?: ((event: AccordionChangeEvent) => void) | null;
311
+ };
312
+ export type AccordionInstance = Accordion;
313
+ export type ListGroupVariant = "primary" | "secondary" | "success" | "danger" | "warning" | "info";
314
+ export type ListGroupOptions = {
315
+ /**
316
+ * - Items can be selected (role="listbox")
317
+ */
318
+ selectable?: boolean;
319
+ /**
320
+ * - Allow several selected items at once
321
+ */
322
+ multiSelect?: boolean;
323
+ /**
324
+ * - Class on selected items
325
+ */
326
+ activeClass?: string;
327
+ /**
328
+ * - Class marking disabled items
329
+ */
330
+ disabledClass?: string;
331
+ /**
332
+ * - Selector for the items
333
+ */
334
+ itemSelector?: string;
335
+ /**
336
+ * - Arrow keys, Home/End, Enter/Space
337
+ */
338
+ keyboard?: boolean;
339
+ /**
340
+ * - Keyboard navigation wraps from last to first
341
+ */
342
+ loop?: boolean;
343
+ /**
344
+ * - Focus the first enabled item on init
345
+ */
346
+ focusOnInit?: boolean;
347
+ /**
348
+ * - Selection changed; the selected items
349
+ */
350
+ onChange?: ((selected: HTMLElement[], event: Event | null) => void) | null;
351
+ /**
352
+ * - An item was selected
353
+ */
354
+ onSelect?: ((item: HTMLElement, index: number, event: Event | null) => void) | null;
355
+ /**
356
+ * - An item was deselected
357
+ */
358
+ onDeselect?: ((item: HTMLElement, index: number, event: Event | null) => void) | null;
359
+ };
360
+ /**
361
+ * A list group. `E.listGroup()` returns the first instance; `all()` (non-enumerable) lists every
362
+ * instance the selector made.
363
+ */
364
+ export type ListGroupInstance = ListGroup & {
365
+ all(): ListGroup[];
366
+ };
367
+ /**
368
+ * A menu item. A plain string is an item whose label and value are the string.
369
+ */
370
+ export type DropdownItem = {
371
+ /**
372
+ * - Display text
373
+ */
374
+ label?: string;
375
+ /**
376
+ * - Alternative to label
377
+ */
378
+ text?: string;
379
+ /**
380
+ * - Alternative to label
381
+ */
382
+ name?: string;
383
+ /**
384
+ * - Value when selected (default: the item's index)
385
+ */
386
+ value?: any;
387
+ /**
388
+ * - Icon HTML
389
+ */
390
+ icon?: string;
391
+ /**
392
+ * - Shown greyed, not selectable
393
+ */
394
+ disabled?: boolean;
395
+ /**
396
+ * - Render as a divider
397
+ */
398
+ divider?: boolean;
399
+ /**
400
+ * - Render as a header with this text
401
+ */
402
+ header?: string;
403
+ };
404
+ /**
405
+ * Passed to onSelect / `.on('select')`.
406
+ */
407
+ export type DropdownSelectEvent = {
408
+ item: DropdownItem | string;
409
+ index: number;
410
+ value: any;
411
+ };
412
+ export type DropdownOptions = {
413
+ /**
414
+ * - 'hover' also opens on click (touch has no hover)
415
+ */
416
+ trigger?: "click" | "hover";
417
+ /**
418
+ * - Preferred menu position - flipped or clamped if it would open off screen
419
+ */
420
+ position?: DropdownPosition;
421
+ /**
422
+ * - Position offset [x, y]
423
+ */
424
+ offset?: [number, number];
425
+ /**
426
+ * - Flip to the opposite side and clamp to the viewport rather than open off screen
427
+ */
428
+ flip?: boolean;
429
+ /**
430
+ * - Fade the menu
431
+ */
432
+ animation?: boolean;
433
+ /**
434
+ * - Animation duration in ms
435
+ */
436
+ animationDuration?: number;
437
+ /**
438
+ * - ms before a hover opens the menu
439
+ */
440
+ hoverOpenDelay?: number;
441
+ /**
442
+ * - ms of grace before a hover menu closes once the pointer has left trigger, menu and the gap between
443
+ */
444
+ hoverCloseDelay?: number;
445
+ /**
446
+ * - Close after an item is chosen
447
+ */
448
+ closeOnSelect?: boolean;
449
+ /**
450
+ * - Close on a click outside
451
+ */
452
+ closeOnClickOutside?: boolean;
453
+ /**
454
+ * - Close on Esc and restore focus to the trigger
455
+ */
456
+ closeOnEscape?: boolean;
457
+ /**
458
+ * - Opening this dropdown closes any other open one
459
+ */
460
+ closeOthers?: boolean;
461
+ /**
462
+ * - Menu items
463
+ */
464
+ items?: (DropdownItem | string)[];
465
+ /**
466
+ * - A Domma Model holding the items array (with modelKey)
467
+ */
468
+ model?: any;
469
+ /**
470
+ * - Model key for the items array
471
+ */
472
+ modelKey?: string | null;
473
+ /**
474
+ * - Model key the selected value is written to (default `<modelKey>_selected`)
475
+ */
476
+ selectedKey?: string;
477
+ /**
478
+ * - Item HTML for object items
479
+ */
480
+ itemTemplate?: ((item: DropdownItem, index: number) => string) | null;
481
+ /**
482
+ * - Return false to keep it closed
483
+ */
484
+ onBeforeOpen?: ((dropdown: DropdownInstance) => boolean | void) | null;
485
+ /**
486
+ * - Menu opened
487
+ */
488
+ onOpen?: ((dropdown: DropdownInstance) => void) | null;
489
+ /**
490
+ * - Return false to keep it open
491
+ */
492
+ onBeforeClose?: ((dropdown: DropdownInstance) => boolean | void) | null;
493
+ /**
494
+ * - Menu closed
495
+ */
496
+ onClose?: ((dropdown: DropdownInstance) => void) | null;
497
+ /**
498
+ * - An item was chosen
499
+ */
500
+ onSelect?: ((event: DropdownSelectEvent, dropdown: DropdownInstance) => void) | null;
501
+ };
502
+ export type DropdownInstance = Dropdown;
503
+ export type DesktopNotificationOptions = {
504
+ /**
505
+ * - Notification title
506
+ */
507
+ title?: string;
508
+ /**
509
+ * - Body text
510
+ */
511
+ body?: string;
512
+ /**
513
+ * - Icon URL
514
+ */
515
+ icon?: string | null;
516
+ /**
517
+ * - Badge URL
518
+ */
519
+ badge?: string | null;
520
+ /**
521
+ * - Tag: a new notification with the same tag replaces the old one
522
+ */
523
+ tag?: string | null;
524
+ /**
525
+ * - Stay until the user dismisses it
526
+ */
527
+ requireInteraction?: boolean;
528
+ /**
529
+ * - No sound or vibration
530
+ */
531
+ silent?: boolean;
532
+ /**
533
+ * - Data kept on the native notification
534
+ */
535
+ data?: any;
536
+ /**
537
+ * - Notification clicked
538
+ */
539
+ onClick?: ((event: Event, notification: DesktopNotification) => void) | null;
540
+ /**
541
+ * - Notification closed
542
+ */
543
+ onClose?: ((event: Event, notification: DesktopNotification) => void) | null;
544
+ /**
545
+ * - Unsupported, permission denied, or the native notification failed
546
+ */
547
+ onError?: ((error: Error | Event, notification?: DesktopNotification) => void) | null;
548
+ /**
549
+ * - Notification shown
550
+ */
551
+ onShow?: ((event: Event, notification: DesktopNotification) => void) | null;
552
+ };
553
+ export type TimerOptions = {
554
+ /**
555
+ * - Countdown length in ms
556
+ */
557
+ duration?: number;
558
+ /**
559
+ * - Start at once
560
+ */
561
+ autoStart?: boolean;
562
+ /**
563
+ * - Display format (case-insensitive)
564
+ */
565
+ format?: "hh:mm:ss" | "mm:ss" | "ss" | string;
566
+ /**
567
+ * - Show start/pause/reset buttons
568
+ */
569
+ showControls?: boolean;
570
+ /**
571
+ * - Tick interval in ms
572
+ */
573
+ updateInterval?: number;
574
+ /**
575
+ * - Desktop notification on completion
576
+ */
577
+ notification?: boolean;
578
+ /**
579
+ * - Options for that notification
580
+ */
581
+ notificationOptions?: DesktopNotificationOptions;
582
+ /**
583
+ * - Play soundUrl on completion
584
+ */
585
+ sound?: boolean;
586
+ /**
587
+ * - Sound to play
588
+ */
589
+ soundUrl?: string | null;
590
+ /**
591
+ * - Every tick, with the ms remaining
592
+ */
593
+ onTick?: ((remaining: number) => void) | null;
594
+ /**
595
+ * - Reached zero
596
+ */
597
+ onComplete?: (() => void) | null;
598
+ /**
599
+ * - Started
600
+ */
601
+ onStart?: (() => void) | null;
602
+ /**
603
+ * - Paused
604
+ */
605
+ onPause?: (() => void) | null;
606
+ /**
607
+ * - Reset
608
+ */
609
+ onReset?: (() => void) | null;
610
+ };
611
+ export type TimerInstance = Timer;
612
+ /**
613
+ * One alarm. add() fills in the defaults and the id.
614
+ */
615
+ export type AlarmItem = {
616
+ /**
617
+ * - Assigned by add() ('alarm-<n>')
618
+ */
619
+ id?: string;
620
+ /**
621
+ * - Time of day, 'HH:MM'
622
+ */
623
+ time: string;
624
+ /**
625
+ * - Shown in the notification
626
+ */
627
+ label?: string;
628
+ enabled?: boolean;
629
+ /**
630
+ * - null = once; an array of day names ('monday', ...)
631
+ */
632
+ repeat?: null | "daily" | "weekdays" | "weekends" | string[];
633
+ /**
634
+ * - Desktop notification when it goes off
635
+ */
636
+ notification?: boolean;
637
+ /**
638
+ * - Options for that notification
639
+ */
640
+ notificationOptions?: DesktopNotificationOptions;
641
+ /**
642
+ * - Play soundUrl
643
+ */
644
+ sound?: boolean;
645
+ soundUrl?: string | null;
646
+ /**
647
+ * - Timestamp (ms) it last went off
648
+ */
649
+ lastTriggered?: number | null;
650
+ /**
651
+ * - Timestamp (ms) a snooze ends
652
+ */
653
+ snoozedUntil?: number | null;
654
+ /**
655
+ * - Set on the copy getNextAlarm() returns
656
+ */
657
+ nextTrigger?: Date;
658
+ };
659
+ export type AlarmOptions = {
660
+ /**
661
+ * - Initial alarms, used when storage holds none
662
+ */
663
+ alarms?: AlarmItem[];
664
+ /**
665
+ * - Not read: times are local
666
+ */
667
+ timezone?: string;
668
+ /**
669
+ * - How often alarms are checked, in ms
670
+ */
671
+ checkInterval?: number;
672
+ /**
673
+ * - localStorage key
674
+ */
675
+ storageKey?: string;
676
+ /**
677
+ * - An alarm went off
678
+ */
679
+ onTrigger?: ((alarm: AlarmItem) => void) | null;
680
+ /**
681
+ * - An alarm was snoozed
682
+ */
683
+ onSnooze?: ((alarm: AlarmItem, duration: number) => void) | null;
684
+ /**
685
+ * - Not called by the current code
686
+ */
687
+ onDismiss?: (() => void) | null;
688
+ /**
689
+ * - add() added one
690
+ */
691
+ onAlarmAdd?: ((alarm: AlarmItem) => void) | null;
692
+ /**
693
+ * - removeAlarm() removed one
694
+ */
695
+ onAlarmRemove?: ((alarm: AlarmItem) => void) | null;
696
+ };
697
+ export type AlarmInstance = Alarm;
698
+ /**
699
+ * Passed to onChange / `.on('change')`.
700
+ */
701
+ export type CarouselChangeEvent = {
702
+ index: number;
703
+ oldIndex: number;
704
+ slide: HTMLElement;
705
+ };
706
+ export type CarouselOptions = {
707
+ /**
708
+ * - Advance on a timer
709
+ */
710
+ autoplay?: boolean;
711
+ /**
712
+ * - Autoplay interval in ms
713
+ */
714
+ interval?: number;
715
+ /**
716
+ * - Pause autoplay on hover
717
+ */
718
+ pauseOnHover?: boolean;
719
+ /**
720
+ * - Wrap from the last slide to the first
721
+ */
722
+ loop?: boolean;
723
+ /**
724
+ * - 'slide' (track translate), 'fade' (clean swap), or 'crossfade' (overlapping opacity)
725
+ */
726
+ animation?: "slide" | "fade" | "crossfade";
727
+ /**
728
+ * - Animation duration in ms
729
+ */
730
+ animationDuration?: number;
731
+ /**
732
+ * - Any CSS timing function ('ease', 'linear', 'ease-in-out', 'cubic-bezier(...)' etc.)
733
+ */
734
+ animationEasing?: string;
735
+ /**
736
+ * - Image carousels: 'crop' = the shortest image, 'average' = halfway between shortest and tallest
737
+ */
738
+ heightMode?: "crop" | "average";
739
+ /**
740
+ * - Fixed viewport height in px
741
+ */
742
+ height?: number | null;
743
+ /**
744
+ * - Previous / next arrows
745
+ */
746
+ showArrows?: boolean;
747
+ /**
748
+ * - Indicator dots
749
+ */
750
+ showIndicators?: boolean;
751
+ /**
752
+ * - Selector for slides
753
+ */
754
+ slideSelector?: string;
755
+ /**
756
+ * - Class on the active slide
757
+ */
758
+ activeClass?: string;
759
+ /**
760
+ * - The slide changed
761
+ */
762
+ onChange?: ((event: CarouselChangeEvent) => void) | null;
763
+ };
764
+ export type CarouselInstance = Carousel;
765
+ /**
766
+ * A cookie category in the customise panel.
767
+ */
768
+ export type CookieCategory = {
769
+ label: string;
770
+ description?: string;
771
+ /**
772
+ * - Always on; cannot be switched off
773
+ */
774
+ required?: boolean;
775
+ };
776
+ export type CookieConsentState = "accepted" | "rejected" | "customized" | "undecided";
777
+ export type CookieConsentOptions = {
778
+ /**
779
+ * - Banner text
780
+ */
781
+ message?: string;
782
+ acceptAllText?: string;
783
+ rejectAllText?: string;
784
+ customizeText?: string;
785
+ savePreferencesText?: string;
786
+ privacyPolicyText?: string;
787
+ privacyPolicyUrl?: string | null;
788
+ cookiePolicyText?: string;
789
+ cookiePolicyUrl?: string | null;
790
+ /**
791
+ * - Default: necessary, functional, analytics, marketing
792
+ */
793
+ categories?: Record<string, CookieCategory>;
794
+ position?: "bottom" | "top" | "bottom-left" | "bottom-right" | "center-modal";
795
+ /**
796
+ * - 'auto' follows the system
797
+ */
798
+ theme?: "light" | "dark" | "auto";
799
+ layout?: "bar" | "box" | "modal";
800
+ animation?: boolean;
801
+ /**
802
+ * - Backdrop behind the modal layout
803
+ */
804
+ backdrop?: boolean;
805
+ /**
806
+ * - Show on a first visit
807
+ */
808
+ autoShow?: boolean;
809
+ /**
810
+ * - Hide once a choice is made
811
+ */
812
+ hideAfterAction?: boolean;
813
+ /**
814
+ * - Elements that reopen the banner
815
+ */
816
+ reopenSelector?: string;
817
+ storageKey?: string;
818
+ /**
819
+ * - Days the choice is remembered
820
+ */
821
+ storageDuration?: number;
822
+ defaultState?: CookieConsentState;
823
+ /**
824
+ * - GDPR mode: optional categories start off
825
+ */
826
+ requireExplicitConsent?: boolean;
827
+ /**
828
+ * - Bump when the policy changes to ask again
829
+ */
830
+ consentVersion?: string;
831
+ /**
832
+ * - The stored choice was for another version
833
+ */
834
+ onVersionMismatch?: ((oldVersion: string, newVersion: string) => void) | null;
835
+ /**
836
+ * - Accept all, or saved custom preferences
837
+ */
838
+ onAccept?: ((preferences: Record<string, boolean>) => void) | null;
839
+ onReject?: (() => void) | null;
840
+ /**
841
+ * - The customise panel opened
842
+ */
843
+ onCustomize?: ((preferences: Record<string, boolean>) => void) | null;
844
+ onChange?: ((state: CookieConsentState, preferences: Record<string, boolean>) => void) | null;
845
+ onShow?: (() => void) | null;
846
+ onHide?: (() => void) | null;
847
+ };
848
+ export type CookieConsentInstance = CookieConsent;
849
+ /**
850
+ * Options for E.alert / E.confirm / E.prompt (and E.dialog.*).
851
+ */
852
+ export type DialogOptions = {
853
+ /**
854
+ * - Heading (basic HTML, sanitised)
855
+ */
856
+ title?: string;
857
+ /**
858
+ * - Message (basic HTML, sanitised); the first argument wins
859
+ */
860
+ message?: string;
861
+ /**
862
+ * - Confirm button label
863
+ */
864
+ confirmText?: string;
865
+ /**
866
+ * - Cancel button label (confirm and prompt)
867
+ */
868
+ cancelText?: string;
869
+ /**
870
+ * - Prompt: input placeholder
871
+ */
872
+ inputPlaceholder?: string;
873
+ /**
874
+ * - Prompt: initial value
875
+ */
876
+ inputValue?: string;
877
+ /**
878
+ * - Prompt: input type
879
+ */
880
+ inputType?: string;
881
+ animation?: boolean;
882
+ backdrop?: boolean;
883
+ /**
884
+ * - A backdrop click cancels
885
+ */
886
+ backdropClose?: boolean;
887
+ /**
888
+ * - Esc cancels, Enter confirms
889
+ */
890
+ keyboard?: boolean;
891
+ /**
892
+ * - Danger-styled confirm; focus starts on Cancel
893
+ */
894
+ danger?: boolean;
895
+ /**
896
+ * - Tab stays in the dialog
897
+ */
898
+ trapFocus?: boolean;
899
+ /**
900
+ * - Answering puts focus back where it was
901
+ */
902
+ returnFocus?: boolean;
903
+ /**
904
+ * - Extra class on the dialog
905
+ */
906
+ className?: string;
907
+ };
908
+ export type ButtonGroupOptions = {
909
+ /**
910
+ * - 'single' behaves like radios, 'multiple' like checkboxes
911
+ */
912
+ mode?: "single" | "multiple";
913
+ /**
914
+ * - Class on active buttons
915
+ */
916
+ activeClass?: string;
917
+ /**
918
+ * - Single mode: clicking the active button deselects it
919
+ */
920
+ allowEmpty?: boolean;
921
+ /**
922
+ * - Selection changed (index -1 from selectAll/deselectAll)
923
+ */
924
+ onChange?: ((value: number | number[] | null, index: number, button: HTMLElement | null) => void) | null;
925
+ };
926
+ /**
927
+ * A button group. `E.buttonGroup()` returns the first instance; `all()` (non-enumerable) lists every
928
+ * instance the selector made.
929
+ */
930
+ export type ButtonGroupInstance = ButtonGroup & {
931
+ all(): ButtonGroup[];
932
+ };
933
+ /**
934
+ * A breadcrumb. A plain string is a crumb with that text and no link.
935
+ */
936
+ export type BreadcrumbItem = {
937
+ /**
938
+ * - Label (HTML)
939
+ */
940
+ text: string;
941
+ /**
942
+ * - Link (default '#'); the last item is never a link
943
+ */
944
+ url?: string;
945
+ /**
946
+ * - Render as the current page
947
+ */
948
+ active?: boolean;
949
+ };
950
+ export type BreadcrumbsOptions = {
951
+ items?: (BreadcrumbItem | string)[];
952
+ /**
953
+ * - A preset, or custom HTML
954
+ */
955
+ separator?: "/" | ">" | "\u2192" | "chevron" | string;
956
+ /**
957
+ * - Home icon on the first item
958
+ */
959
+ homeIcon?: boolean;
960
+ /**
961
+ * - Collapse on small screens
962
+ */
963
+ responsive?: boolean;
964
+ /**
965
+ * - A crumb link was clicked (setting it prevents navigation)
966
+ */
967
+ onChange?: ((item: BreadcrumbItem | string, index: number, event: MouseEvent) => void) | null;
968
+ };
969
+ export type BreadcrumbsInstance = Breadcrumbs;
970
+ /**
971
+ * A navbar link; `items` makes it a dropdown (nested `items` make flyouts).
972
+ */
973
+ export type NavbarItem = {
974
+ /**
975
+ * - Label
976
+ */
977
+ text?: string;
978
+ /**
979
+ * - Link
980
+ */
981
+ url?: string;
982
+ /**
983
+ * - Domma icon name
984
+ */
985
+ icon?: string;
986
+ /**
987
+ * - Highlighted as the current page
988
+ */
989
+ active?: boolean;
990
+ /**
991
+ * - Opens in a new tab
992
+ */
993
+ external?: boolean;
994
+ /**
995
+ * - Inside a dropdown: a divider
996
+ */
997
+ divider?: boolean;
998
+ /**
999
+ * - Dropdown entries
1000
+ */
1001
+ items?: NavbarItem[];
1002
+ };
1003
+ export type NavbarBrand = {
1004
+ text?: string;
1005
+ /**
1006
+ * - Logo image URL
1007
+ */
1008
+ logo?: string;
1009
+ /**
1010
+ * - Brand link
1011
+ */
1012
+ url?: string;
1013
+ /**
1014
+ * - Brand markup instead of text/logo
1015
+ */
1016
+ html?: string;
1017
+ };
1018
+ export type NavbarAction = {
1019
+ text?: string;
1020
+ url?: string;
1021
+ /**
1022
+ * - Domma icon name
1023
+ */
1024
+ icon?: string;
1025
+ /**
1026
+ * - Button variant ('primary', 'outline', ...)
1027
+ */
1028
+ variant?: string;
1029
+ };
1030
+ export type NavbarOptions = {
1031
+ brand?: NavbarBrand | null;
1032
+ items?: NavbarItem[];
1033
+ position?: "static" | "fixed" | "sticky";
1034
+ variant?: "light" | "dark" | "transparent" | string;
1035
+ /**
1036
+ * - Hamburger menu on small screens
1037
+ */
1038
+ collapsible?: boolean;
1039
+ /**
1040
+ * - Below this width (px) the bar is collapsed
1041
+ */
1042
+ collapseAt?: number;
1043
+ /**
1044
+ * - Desktop: open dropdowns/flyouts on hover (click still works)
1045
+ */
1046
+ appearOnHover?: boolean;
1047
+ /**
1048
+ * - ms of grace when the pointer leaves the bar
1049
+ */
1050
+ hoverCloseDelay?: number;
1051
+ /**
1052
+ * - Right-side buttons
1053
+ */
1054
+ actions?: NavbarAction[];
1055
+ /**
1056
+ * - A link was clicked (sub-items also get the parent)
1057
+ */
1058
+ onItemClick?: ((item: NavbarItem, index: number, event: MouseEvent, parent?: NavbarItem) => void) | null;
1059
+ };
1060
+ export type NavbarInstance = Navbar;
1061
+ /**
1062
+ * A sidebar entry: a link, a heading, a divider, or (with `items`) an expandable group.
1063
+ */
1064
+ export type SidebarItem = {
1065
+ /**
1066
+ * - Label (HTML)
1067
+ */
1068
+ text?: string;
1069
+ /**
1070
+ * - Link
1071
+ */
1072
+ url?: string;
1073
+ /**
1074
+ * - Domma icon name
1075
+ */
1076
+ icon?: string;
1077
+ /**
1078
+ * - Section key; setActive(section) highlights it, and clicking it makes it active
1079
+ */
1080
+ section?: string;
1081
+ /**
1082
+ * - Badge text
1083
+ */
1084
+ badge?: string | number;
1085
+ /**
1086
+ * - Render as a heading with this text
1087
+ */
1088
+ heading?: string;
1089
+ /**
1090
+ * - Render as a divider
1091
+ */
1092
+ divider?: boolean;
1093
+ /**
1094
+ * - Children (an expandable group)
1095
+ */
1096
+ items?: SidebarItem[];
1097
+ };
1098
+ export type SidebarOptions = {
1099
+ position?: "left" | "right";
1100
+ /**
1101
+ * - Fixed rather than static positioning
1102
+ */
1103
+ fixed?: boolean;
1104
+ width?: string;
1105
+ /**
1106
+ * - Top offset, e.g. '60px' under a navbar
1107
+ */
1108
+ top?: string;
1109
+ /**
1110
+ * - Header; `toggle: false` hides its close button
1111
+ */
1112
+ header?: {
1113
+ title?: string;
1114
+ toggle?: boolean;
1115
+ icon?: string;
1116
+ } | null;
1117
+ items?: SidebarItem[];
1118
+ footer?: {
1119
+ text?: string;
1120
+ html?: string;
1121
+ } | null;
1122
+ /**
1123
+ * - 'theme' follows the active theme
1124
+ */
1125
+ variant?: "light" | "dark" | "theme";
1126
+ /**
1127
+ * - Toggle on small screens
1128
+ */
1129
+ collapsible?: boolean;
1130
+ /**
1131
+ * - Breakpoint in px
1132
+ */
1133
+ collapseAt?: number;
1134
+ /**
1135
+ * - Initially active section
1136
+ */
1137
+ activeSection?: string | null;
1138
+ /**
1139
+ * - Initially expanded groups (their paths)
1140
+ */
1141
+ expandedSections?: string[];
1142
+ /**
1143
+ * - Remember expanded groups in localStorage
1144
+ */
1145
+ persistExpanded?: boolean;
1146
+ /**
1147
+ * - Storage key for that
1148
+ */
1149
+ persistKey?: string | null;
1150
+ /**
1151
+ * - ms
1152
+ */
1153
+ animationDuration?: number;
1154
+ /**
1155
+ * - Push the content aside rather than overlay it
1156
+ */
1157
+ push?: boolean;
1158
+ /**
1159
+ * - The content pushed aside
1160
+ */
1161
+ contentSelector?: string;
1162
+ /**
1163
+ * - Track the active section while scrolling
1164
+ */
1165
+ scrollSpy?: boolean;
1166
+ /**
1167
+ * - IntersectionObserver rootMargin
1168
+ */
1169
+ scrollSpyOffset?: string;
1170
+ /**
1171
+ * - IntersectionObserver threshold
1172
+ */
1173
+ scrollSpyThreshold?: number;
1174
+ /**
1175
+ * - Floating toggle at the bottom left
1176
+ */
1177
+ floating?: boolean;
1178
+ /**
1179
+ * - HTML to show instead of items
1180
+ */
1181
+ customContent?: string | null;
1182
+ /**
1183
+ * - Desktop collapse to icons only
1184
+ */
1185
+ collapsibleDesktop?: boolean;
1186
+ /**
1187
+ * - Width when collapsed
1188
+ */
1189
+ collapsedWidth?: string;
1190
+ /**
1191
+ * - Remember the collapsed state
1192
+ */
1193
+ persistCollapsed?: boolean;
1194
+ /**
1195
+ * - Storage key for that
1196
+ */
1197
+ persistCollapseKey?: string | null;
1198
+ /**
1199
+ * - A link was clicked; path is its index path ('2.0')
1200
+ */
1201
+ onItemClick?: ((item: SidebarItem | null, path: string, event: MouseEvent) => void) | null;
1202
+ /**
1203
+ * - Return false to keep it closed
1204
+ */
1205
+ onBeforeOpen?: (() => boolean | void) | null;
1206
+ /**
1207
+ * - Return false to keep it open
1208
+ */
1209
+ onBeforeClose?: (() => boolean | void) | null;
1210
+ /**
1211
+ * - Opened or closed
1212
+ */
1213
+ onToggle?: ((isOpen: boolean) => void) | null;
1214
+ /**
1215
+ * - A group expanded (no arguments: the desktop sidebar expanded)
1216
+ */
1217
+ onExpand?: ((item?: SidebarItem, depth?: number) => void) | null;
1218
+ /**
1219
+ * - A group collapsed (no arguments: the desktop sidebar collapsed)
1220
+ */
1221
+ onCollapse?: ((item?: SidebarItem, depth?: number) => void) | null;
1222
+ };
1223
+ export type SidebarInstance = Sidebar;
1224
+ export type FooterLink = {
1225
+ text?: string;
1226
+ url?: string;
1227
+ /**
1228
+ * - Domma icon name
1229
+ */
1230
+ icon?: string;
1231
+ };
1232
+ export type FooterBrand = {
1233
+ text?: string;
1234
+ /**
1235
+ * - Logo image URL
1236
+ */
1237
+ logo?: string;
1238
+ url?: string;
1239
+ description?: string;
1240
+ };
1241
+ export type FooterColumn = {
1242
+ title?: string;
1243
+ links?: FooterLink[];
1244
+ };
1245
+ export type FooterSocial = {
1246
+ /**
1247
+ * - Domma icon name
1248
+ */
1249
+ icon: string;
1250
+ url?: string;
1251
+ /**
1252
+ * - Accessible name (default: the icon name)
1253
+ */
1254
+ label?: string;
1255
+ };
1256
+ export type FooterOptions = {
1257
+ variant?: "light" | "dark" | "transparent" | string;
1258
+ layout?: "simple" | "columns" | "minimal";
1259
+ brand?: FooterBrand | null;
1260
+ /**
1261
+ * - For the 'columns' layout
1262
+ */
1263
+ columns?: FooterColumn[];
1264
+ /**
1265
+ * - Simple link list
1266
+ */
1267
+ links?: FooterLink[];
1268
+ /**
1269
+ * - Social icons
1270
+ */
1271
+ social?: FooterSocial[];
1272
+ /**
1273
+ * - Text, or the year for '© <year> All rights reserved'
1274
+ */
1275
+ copyright?: string | {
1276
+ text?: string;
1277
+ year?: number;
1278
+ } | null;
1279
+ /**
1280
+ * - Extra classes
1281
+ */
1282
+ className?: string;
1283
+ position?: "static" | "fixed" | "sticky";
1284
+ };
1285
+ export type FooterInstance = Footer;
1286
+ /**
1287
+ * A suggestion: a string, or an object shown by `label` and written as `value`.
1288
+ */
1289
+ export type AutocompleteItem = string | {
1290
+ label?: string;
1291
+ value?: string;
1292
+ [key: string]: any;
1293
+ };
1294
+ export type AutocompleteOptions = {
1295
+ /**
1296
+ * - Suggestions to filter
1297
+ */
1298
+ data?: AutocompleteItem[];
1299
+ /**
1300
+ * - Fetch suggestions instead of filtering data
1301
+ */
1302
+ dataSource?: ((query: string) => AutocompleteItem[] | Promise<AutocompleteItem[]>) | null;
1303
+ /**
1304
+ * - Characters typed before suggesting
1305
+ */
1306
+ minChars?: number;
1307
+ maxResults?: number;
1308
+ /**
1309
+ * - ms
1310
+ */
1311
+ debounce?: number;
1312
+ /**
1313
+ * - Replaces the default contains-match
1314
+ */
1315
+ filterFn?: ((item: AutocompleteItem, query: string) => boolean) | null;
1316
+ /**
1317
+ * - Suggestion HTML or a node
1318
+ */
1319
+ renderItem?: ((item: AutocompleteItem, query: string) => string | Node) | null;
1320
+ highlightMatches?: boolean;
1321
+ /**
1322
+ * - Where the list opens; 'auto' picks the side with room
1323
+ */
1324
+ position?: "auto" | "above" | "below";
1325
+ placeholder?: string;
1326
+ emptyMessage?: string;
1327
+ loadingMessage?: string;
1328
+ caseSensitive?: boolean;
1329
+ selectOnEnter?: boolean;
1330
+ /**
1331
+ * - Empty the input after a choice
1332
+ */
1333
+ clearOnSelect?: boolean;
1334
+ /**
1335
+ * - A Domma Model the typed value is written to (with modelKey)
1336
+ */
1337
+ model?: any;
1338
+ modelKey?: string;
1339
+ /**
1340
+ * - A suggestion was chosen
1341
+ */
1342
+ onSelect?: ((item: AutocompleteItem, event: {
1343
+ target: HTMLElement;
1344
+ }) => void) | null;
1345
+ /**
1346
+ * - The input's value changed
1347
+ */
1348
+ onChange?: ((value: string, event: Event) => void) | null;
1349
+ /**
1350
+ * - Return false to keep it closed
1351
+ */
1352
+ onBeforeOpen?: (() => boolean | void) | null;
1353
+ onOpen?: (() => void) | null;
1354
+ /**
1355
+ * - Return false to keep it open
1356
+ */
1357
+ onBeforeClose?: (() => boolean | void) | null;
1358
+ onClose?: (() => void) | null;
1359
+ /**
1360
+ * - May return a replacement result list
1361
+ */
1362
+ onFilter?: ((results: AutocompleteItem[], query: string) => AutocompleteItem[] | void) | null;
1363
+ };
1364
+ export type AutocompleteInstance = Autocomplete;
1365
+ /**
1366
+ * An option: a string, or an object shown by `label` and stored as `value`.
1367
+ */
1368
+ export type PillboxItem = string | {
1369
+ value: string;
1370
+ label?: string;
1371
+ disabled?: boolean;
1372
+ [key: string]: any;
1373
+ };
1374
+ export type PillboxOptions = {
1375
+ /**
1376
+ * - Options to choose from
1377
+ */
1378
+ data?: PillboxItem[];
1379
+ /**
1380
+ * - Initial values
1381
+ */
1382
+ value?: string[];
1383
+ placeholder?: string;
1384
+ /**
1385
+ * - Filter the options while typing
1386
+ */
1387
+ searchable?: boolean;
1388
+ /**
1389
+ * - Enter adds typed text that is not an option
1390
+ */
1391
+ creatable?: boolean;
1392
+ maxItems?: number | null;
1393
+ duplicates?: boolean;
1394
+ /**
1395
+ * - Clear-all button
1396
+ */
1397
+ clearable?: boolean;
1398
+ size?: "small" | "medium" | "large" | string;
1399
+ /**
1400
+ * - Pill HTML or a node
1401
+ */
1402
+ renderPill?: ((pill: {
1403
+ value: string;
1404
+ label: string;
1405
+ }) => string | Node) | null;
1406
+ /**
1407
+ * - Option HTML or a node
1408
+ */
1409
+ renderOption?: ((item: PillboxItem) => string | Node) | null;
1410
+ /**
1411
+ * - Pill HTML when there is no renderPill
1412
+ */
1413
+ pillTemplate?: string;
1414
+ /**
1415
+ * - true/undefined accepts; a string is the error message
1416
+ */
1417
+ validatePill?: ((value: string) => boolean | string | void) | null;
1418
+ maxItemsMessage?: string;
1419
+ duplicateMessage?: string;
1420
+ noResultsMessage?: string;
1421
+ /**
1422
+ * - A Domma Model the values are kept in (with modelKey)
1423
+ */
1424
+ model?: any;
1425
+ modelKey?: string;
1426
+ /**
1427
+ * - Return false to keep it closed
1428
+ */
1429
+ onBeforeOpen?: (() => boolean | void) | null;
1430
+ onOpen?: (() => void) | null;
1431
+ /**
1432
+ * - Return false to keep it open
1433
+ */
1434
+ onBeforeClose?: (() => boolean | void) | null;
1435
+ onClose?: (() => void) | null;
1436
+ onAdd?: ((value: string, pill: HTMLElement) => void) | null;
1437
+ onRemove?: ((value: string, pill: HTMLElement) => void) | null;
1438
+ onChange?: ((values: string[]) => void) | null;
1439
+ /**
1440
+ * - Typed text was added (creatable)
1441
+ */
1442
+ onCreate?: ((text: string) => void) | null;
1443
+ onMaxReached?: (() => void) | null;
1444
+ onValidationError?: ((error: string, value: string) => void) | null;
1445
+ };
1446
+ export type PillboxInstance = Pillbox;
1447
+ export type SlideoverSize = "sm" | "md" | "lg" | "xl" | "full";
1448
+ export type SlideoverOptions = {
1449
+ /**
1450
+ * - Edge it slides from
1451
+ */
1452
+ position?: "left" | "right" | "top" | "bottom";
1453
+ /**
1454
+ * - A preset (sm 25%, md 50%, lg 75%, xl 90%, full), a customSizes key, or a CSS length ('400px', '60%', '30rem')
1455
+ */
1456
+ size?: SlideoverSize | string;
1457
+ backdrop?: boolean;
1458
+ /**
1459
+ * - A backdrop click closes it
1460
+ */
1461
+ backdropClose?: boolean;
1462
+ /**
1463
+ * - Esc closes it (with closeOnEscape)
1464
+ */
1465
+ keyboard?: boolean;
1466
+ animation?: boolean;
1467
+ /**
1468
+ * - ms
1469
+ */
1470
+ animationDuration?: number;
1471
+ closeOnEscape?: boolean;
1472
+ /**
1473
+ * - Title (create(): the header text)
1474
+ */
1475
+ title?: string;
1476
+ /**
1477
+ * - Body (create(): HTML or an element)
1478
+ */
1479
+ content?: string | Element;
1480
+ /**
1481
+ * - Close button in the header (create())
1482
+ */
1483
+ closable?: boolean;
1484
+ /**
1485
+ * - Domma icon name for it (create())
1486
+ */
1487
+ closeIcon?: string;
1488
+ headerClass?: string;
1489
+ bodyClass?: string;
1490
+ footerClass?: string;
1491
+ /**
1492
+ * - Named sizes, e.g. {wide: '640px'}
1493
+ */
1494
+ customSizes?: Record<string, string>;
1495
+ /**
1496
+ * - Tab stays in the panel; default off when backdrop is false unless given
1497
+ */
1498
+ trapFocus?: boolean;
1499
+ /**
1500
+ * - Closing puts focus back where it was
1501
+ */
1502
+ returnFocus?: boolean;
1503
+ /**
1504
+ * - Return false to keep it closed
1505
+ */
1506
+ onBeforeOpen?: ((slideover: SlideoverInstance) => boolean | void) | null;
1507
+ onOpen?: ((slideover: SlideoverInstance) => void) | null;
1508
+ /**
1509
+ * - Return false to keep it open
1510
+ */
1511
+ onBeforeClose?: ((slideover: SlideoverInstance) => boolean | void) | null;
1512
+ /**
1513
+ * - Closing (before the animation)
1514
+ */
1515
+ onClose?: ((slideover: SlideoverInstance) => void) | null;
1516
+ /**
1517
+ * - After the close animation
1518
+ */
1519
+ onClosed?: ((slideover: SlideoverInstance) => void) | null;
1520
+ };
1521
+ /**
1522
+ * Options for `E.slideover({...})` / `Slideover.create()`: a new panel at the end of `<body>`.
1523
+ */
1524
+ export type SlideoverCreateOptions = SlideoverOptions & {
1525
+ schema?: object;
1526
+ data?: Record<string, any>;
1527
+ onSave?: (formData: Record<string, any>, form: any, slideover: SlideoverInstance) => void;
1528
+ };
1529
+ export type SlideoverInstance = Slideover;
1530
+ export type ProgressionStatus = "planned" | "in-progress" | "completed" | "blocked" | "cancelled";
1531
+ /**
1532
+ * A timeline event or roadmap milestone.
1533
+ */
1534
+ export type ProgressionItem = {
1535
+ /**
1536
+ * - Lets methods find it by id instead of index
1537
+ */
1538
+ id?: string | number;
1539
+ title?: string;
1540
+ /**
1541
+ * - Text (HTML when allowHtml, sanitised)
1542
+ */
1543
+ description?: string;
1544
+ date?: string;
1545
+ /**
1546
+ * - Timeline marker (default: date)
1547
+ */
1548
+ year?: string | number;
1549
+ /**
1550
+ * - Roadmap status
1551
+ */
1552
+ status?: ProgressionStatus | string;
1553
+ /**
1554
+ * - 0-100, shown for 'in-progress'
1555
+ */
1556
+ progress?: number;
1557
+ priority?: string;
1558
+ tags?: string[];
1559
+ assignee?: string;
1560
+ };
1561
+ export type ProgressionOptions = {
1562
+ mode?: "timeline" | "roadmap";
1563
+ items?: ProgressionItem[];
1564
+ layout?: "vertical" | "horizontal" | "centered";
1565
+ /**
1566
+ * - Items animate in
1567
+ */
1568
+ animation?: boolean;
1569
+ /**
1570
+ * - ms between items
1571
+ */
1572
+ animationDelay?: number;
1573
+ responsive?: boolean;
1574
+ theme?: "default" | "minimal" | "corporate" | "modern";
1575
+ clickable?: boolean;
1576
+ onItemClick?: ((item: ProgressionItem, index: number, element: HTMLElement) => void) | null;
1577
+ /**
1578
+ * - HTML in descriptions (sanitised)
1579
+ */
1580
+ allowHtml?: boolean;
1581
+ /**
1582
+ * - Timeline
1583
+ */
1584
+ yearWidth?: string;
1585
+ /**
1586
+ * - Timeline
1587
+ */
1588
+ contentMaxWidth?: string;
1589
+ /**
1590
+ * - Timeline
1591
+ */
1592
+ dateFormat?: string;
1593
+ /**
1594
+ * - Timeline
1595
+ */
1596
+ showConnector?: boolean;
1597
+ /**
1598
+ * - Roadmap: overall progress bar
1599
+ */
1600
+ showProgress?: boolean;
1601
+ /**
1602
+ * - Roadmap
1603
+ */
1604
+ progressPosition?: "top" | "bottom" | "none";
1605
+ /**
1606
+ * - Roadmap
1607
+ */
1608
+ statusIcons?: boolean;
1609
+ /**
1610
+ * - Roadmap: status can be changed from the UI
1611
+ */
1612
+ allowStatusChange?: boolean;
1613
+ onStatusChange?: ((item: ProgressionItem, oldStatus: string | undefined, status: string) => void) | null;
1614
+ /**
1615
+ * - Roadmap: the current item's id or index
1616
+ */
1617
+ currentItem?: string | number | null;
1618
+ completedAnimation?: boolean;
1619
+ /**
1620
+ * - Domma icon name per status
1621
+ */
1622
+ icons?: Partial<Record<ProgressionStatus, string>>;
1623
+ /**
1624
+ * - CSS colour per status
1625
+ */
1626
+ colors?: Partial<Record<ProgressionStatus, string>>;
1627
+ };
1628
+ export type ProgressionInstance = Progression;
1629
+ /**
1630
+ * A drawn stroke, as onBegin / onEnd receive it.
1631
+ */
1632
+ export type SignatureStroke = {
1633
+ points: {
1634
+ x: number;
1635
+ y: number;
1636
+ pressure: number;
1637
+ }[];
1638
+ colour: string;
1639
+ width: number;
1640
+ };
1641
+ export type SignatureOptions = {
1642
+ /**
1643
+ * - Not read: the pad fills its container
1644
+ */
1645
+ width?: number | null;
1646
+ /**
1647
+ * - Canvas height in px
1648
+ */
1649
+ height?: number;
1650
+ /**
1651
+ * - Default pen colour
1652
+ */
1653
+ penColour?: string;
1654
+ /**
1655
+ * - Default pen width in px
1656
+ */
1657
+ penWidth?: number;
1658
+ /**
1659
+ * - Export format
1660
+ */
1661
+ format?: "png" | "svg";
1662
+ /**
1663
+ * - Toolbar label text
1664
+ */
1665
+ label?: string;
1666
+ /**
1667
+ * - Dashed guide line
1668
+ */
1669
+ guideLine?: boolean;
1670
+ placeholder?: string;
1671
+ /**
1672
+ * - Colour swatches in the toolbar
1673
+ */
1674
+ colours?: string[];
1675
+ /**
1676
+ * - Pen widths in the toolbar
1677
+ */
1678
+ widths?: number[];
1679
+ /**
1680
+ * - Show the toolbar
1681
+ */
1682
+ toolbar?: boolean;
1683
+ /**
1684
+ * - Name of the hidden input
1685
+ */
1686
+ name?: string;
1687
+ disabled?: boolean;
1688
+ /**
1689
+ * - Draw / Type toggle
1690
+ */
1691
+ typeFallback?: boolean;
1692
+ /**
1693
+ * - Points needed to keep a stroke
1694
+ */
1695
+ minStrokeLength?: number;
1696
+ /**
1697
+ * - Honour prefers-reduced-motion
1698
+ */
1699
+ respectMotionPreference?: boolean;
1700
+ /**
1701
+ * - The signature changed - receives the data URL ('' when empty)
1702
+ */
1703
+ onChange?: ((base64: string) => void) | null;
1704
+ onClear?: (() => void) | null;
1705
+ /**
1706
+ * - A stroke began
1707
+ */
1708
+ onBegin?: ((stroke: SignatureStroke) => void) | null;
1709
+ /**
1710
+ * - A stroke ended
1711
+ */
1712
+ onEnd?: ((stroke: SignatureStroke) => void) | null;
1713
+ };
1714
+ export type SignatureInstance = Signature;
1715
+ export type DatePickerOptions = {
1716
+ /**
1717
+ * - Initial date; null reads the input
1718
+ */
1719
+ value?: string | Date | null;
1720
+ /**
1721
+ * - What the input shows (YYYY YY MMMM MMM MM M DDDD DDD DD D); the value stays ISO
1722
+ */
1723
+ format?: string;
1724
+ /**
1725
+ * - Earliest selectable date
1726
+ */
1727
+ min?: string | Date | null;
1728
+ /**
1729
+ * - Latest selectable date
1730
+ */
1731
+ max?: string | Date | null;
1732
+ /**
1733
+ * - First day of the week: 0 Sunday, 1 Monday
1734
+ */
1735
+ firstDay?: number;
1736
+ /**
1737
+ * - true means unavailable
1738
+ */
1739
+ disabledDates?: ((date: Date) => boolean) | null;
1740
+ openOnFocus?: boolean;
1741
+ closeOnSelect?: boolean;
1742
+ closeOnClickOutside?: boolean;
1743
+ closeOnEscape?: boolean;
1744
+ /**
1745
+ * - Clear button
1746
+ */
1747
+ clearable?: boolean;
1748
+ todayButton?: boolean;
1749
+ /**
1750
+ * - Stop typing; only the calendar sets it
1751
+ */
1752
+ readonlyInput?: boolean;
1753
+ /**
1754
+ * - Render in place instead of as a popup
1755
+ */
1756
+ inline?: boolean;
1757
+ /**
1758
+ * - Popup position
1759
+ */
1760
+ position?: DropdownPosition;
1761
+ /**
1762
+ * - Popup offset [x, y]
1763
+ */
1764
+ offset?: [number, number];
1765
+ /**
1766
+ * - ISO week numbers
1767
+ */
1768
+ weekNumbers?: boolean;
1769
+ /**
1770
+ * - Default: the format
1771
+ */
1772
+ placeholder?: string | null;
1773
+ /**
1774
+ * - ISO value ('' when cleared)
1775
+ */
1776
+ onChange?: ((value: string, date: Date | null, picker: DatePickerInstance) => void) | null;
1777
+ /**
1778
+ * - Return false to keep it closed
1779
+ */
1780
+ onBeforeOpen?: ((picker: DatePickerInstance) => boolean | void) | null;
1781
+ onOpen?: ((picker: DatePickerInstance) => void) | null;
1782
+ /**
1783
+ * - Return false to keep it open
1784
+ */
1785
+ onBeforeClose?: ((picker: DatePickerInstance) => boolean | void) | null;
1786
+ onClose?: ((picker: DatePickerInstance) => void) | null;
1787
+ };
1788
+ export type DatePickerInstance = DatePicker;
1789
+ export type ChooserBadge = {
1790
+ text: string;
1791
+ type?: "success" | "info" | "warning" | "danger" | "primary";
1792
+ };
1793
+ export type ChooserOption = {
1794
+ value: string | number;
1795
+ label: string;
1796
+ /**
1797
+ * - Domma icon name
1798
+ */
1799
+ icon?: string;
1800
+ /**
1801
+ * - Card variant, comfortable density only
1802
+ */
1803
+ description?: string;
1804
+ tooltip?: string;
1805
+ badge?: ChooserBadge;
1806
+ recommended?: boolean;
1807
+ disabled?: boolean;
1808
+ };
1809
+ export type ChooserSemanticColour = "primary" | "success" | "info" | "warning" | "danger";
1810
+ export type ChooserOptions = {
1811
+ /**
1812
+ * - The choices
1813
+ */
1814
+ options: ChooserOption[];
1815
+ variant?: "card" | "chip";
1816
+ /**
1817
+ * - Multi-select
1818
+ */
1819
+ multiple?: boolean;
1820
+ density?: "comfortable" | "compact";
1821
+ /**
1822
+ * - Grid columns (card variant)
1823
+ */
1824
+ columns?: number;
1825
+ /**
1826
+ * - Label rendered above
1827
+ */
1828
+ label?: string;
1829
+ /**
1830
+ * - Required indicator
1831
+ */
1832
+ required?: boolean;
1833
+ /**
1834
+ * - Hidden-input name for native form submission
1835
+ */
1836
+ name?: string;
1837
+ /**
1838
+ * - Initial selection
1839
+ */
1840
+ value?: string | string[] | null;
1841
+ /**
1842
+ * - Selected/recommended highlight colour - semantic name or any CSS colour string
1843
+ */
1844
+ accent?: ChooserSemanticColour | string;
1845
+ /**
1846
+ * - Visual style of the selected state
1847
+ */
1848
+ accentStyle?: "border" | "solid" | "glow" | "overlay" | "underline";
1849
+ /**
1850
+ * - Soft outer glow on the selected option
1851
+ */
1852
+ glow?: boolean;
1853
+ /**
1854
+ * - Glow colour override - semantic name or any CSS colour string. Defaults to the accent colour.
1855
+ */
1856
+ glowColour?: ChooserSemanticColour | string | null;
1857
+ /**
1858
+ * - Shadow weight applied to every option
1859
+ */
1860
+ shadow?: "none" | "sm" | "md" | "lg" | "xl";
1861
+ /**
1862
+ * - Optional shadow tint - any CSS colour string
1863
+ */
1864
+ shadowColour?: string | null;
1865
+ /**
1866
+ * - Called with the new value (user changes only, not setValue)
1867
+ */
1868
+ onChange?: (value: string | string[] | null) => void;
1869
+ };
1870
+ /**
1871
+ * What `E.chooser()` returns. A missing host gets an inert one (`element` null, methods do nothing).
1872
+ */
1873
+ export type ChooserInstance = {
1874
+ readonly element: HTMLElement | null;
1875
+ _root: HTMLElement | null;
1876
+ getValue(): string | string[] | null;
1877
+ setValue(value: string | string[] | null): void;
1878
+ disable(): void;
1879
+ enable(): void;
1880
+ destroy(): void;
1881
+ };
1882
+ /**
1883
+ * `Domma.elements` / `E` - every UI component factory.
1884
+ */
1885
+ export type Elements = {
1886
+ /**
1887
+ * Create a Card component (null when nothing matches)
1888
+ */
1889
+ card: (selector: import("./components/shared.js").ComponentTarget, options?: import("./components/card.js").CardOptions) => import("./components/card.js").CardInstance | null;
1890
+ /**
1891
+ * Create a Modal: on an element (null when nothing matches), or - given only an options object - a new
1892
+ * modal in the shared dialog container
1893
+ */
1894
+ modal: {
1895
+ (selector: string | Element | ArrayLike<Element>, options?: import("./components/modal.js").ModalOptions): import("./components/modal.js").ModalInstance | null;
1896
+ (options: import("./components/modal.js").ModalOptions): import("./components/modal.js").ModalInstance;
1897
+ };
1898
+ /**
1899
+ * - Create a Tabs component
1900
+ */
1901
+ tabs: (selector: string | HTMLElement, options?: TabsOptions) => TabsInstance;
1902
+ /**
1903
+ * - Create an Accordion component
1904
+ */
1905
+ accordion: (selector: string | HTMLElement, options?: AccordionOptions) => AccordionInstance;
1906
+ /**
1907
+ * A tooltip on every match; returns the first (with `all()` for the rest), or null.
1908
+ * `E.tooltip.all()` returns them as an array.
1909
+ */
1910
+ tooltip: {
1911
+ (selector: import("./components/shared.js").ComponentTarget, options?: import("./components/tooltip.js").TooltipOptions): (import("./components/tooltip.js").TooltipInstance & {
1912
+ all(): import("./components/tooltip.js").TooltipInstance[];
1913
+ }) | null;
1914
+ all(selector: import("./components/shared.js").ComponentTarget, options?: import("./components/tooltip.js").TooltipOptions): import("./components/tooltip.js").TooltipInstance[];
1915
+ };
1916
+ /**
1917
+ * Create a Badge (null when nothing matches)
1918
+ */
1919
+ badge: (selector: import("./components/shared.js").ComponentTarget, options?: import("./components/badge.js").BadgeOptions) => import("./components/badge.js").BadgeInstance | null;
1920
+ /**
1921
+ * Create a NumberBadge notification counter on an element (null when nothing matches)
1922
+ */
1923
+ numberBadge: (selector: import("./components/shared.js").ComponentTarget, options?: import("./components/badge.js").NumberBadgeOptions) => import("./components/badge.js").NumberBadgeInstance | null;
1924
+ /**
1925
+ * - Create a Dropdown component
1926
+ */
1927
+ dropdown: (selector: string | HTMLElement, options?: DropdownOptions) => DropdownInstance;
1928
+ /**
1929
+ * - Create a Carousel component
1930
+ */
1931
+ carousel: (selector: string | HTMLElement, options?: CarouselOptions) => CarouselInstance;
1932
+ /**
1933
+ * - The page's cookie consent banner (one per page)
1934
+ */
1935
+ cookieConsent: (options?: CookieConsentOptions) => CookieConsentInstance;
1936
+ /**
1937
+ * Create a BackToTop button: a button / link selector is used as the button, anything else adds one
1938
+ */
1939
+ backToTop: (selector?: string | HTMLElement | null, options?: import("./components/back-to-top.js").BackToTopOptions) => import("./components/back-to-top.js").BackToTopInstance;
1940
+ /**
1941
+ * A button group on every match; returns the first (with `all()` for the rest). `E.buttonGroup.all()`
1942
+ * returns them as an array. A selector that matches nothing returns null.
1943
+ */
1944
+ buttonGroup: {
1945
+ (selector: string | HTMLElement, options?: ButtonGroupOptions): (ButtonGroupInstance & {
1946
+ all(): ButtonGroup[];
1947
+ }) | null;
1948
+ all(selector: string | HTMLElement, options?: ButtonGroupOptions): ButtonGroup[];
1949
+ };
1950
+ /**
1951
+ * Create a Loader on an element (null when nothing matches)
1952
+ */
1953
+ loader: (selector: import("./components/shared.js").ComponentTarget, options?: import("./components/loader.js").LoaderOptions) => import("./components/loader.js").LoaderInstance | null;
1954
+ /**
1955
+ * Show the element's loader, creating it if needed
1956
+ */
1957
+ showLoader: (selector: import("./components/shared.js").ComponentTarget, options?: import("./components/loader.js").LoaderOptions) => import("./components/loader.js").LoaderInstance | null;
1958
+ /**
1959
+ * Hide the element's loader
1960
+ */
1961
+ hideLoader: (selector: import("./components/shared.js").ComponentTarget) => import("./components/loader.js").LoaderInstance | undefined;
1962
+ /**
1963
+ * A full-screen loader (`#dm-loader-fullscreen`), reused on later calls
1964
+ */
1965
+ fullscreenLoader: (text?: string, options?: {
1966
+ type?: string;
1967
+ size?: string;
1968
+ color?: string;
1969
+ }) => import("./components/loader.js").LoaderInstance;
1970
+ /**
1971
+ * - Render breadcrumbs into an element
1972
+ */
1973
+ breadcrumbs: (selector: string | HTMLElement, options?: BreadcrumbsOptions) => BreadcrumbsInstance;
1974
+ /**
1975
+ * - Render a navbar into an element
1976
+ */
1977
+ navbar: (selector: string | HTMLElement, options?: NavbarOptions) => NavbarInstance;
1978
+ /**
1979
+ * - Render a sidebar into an element
1980
+ */
1981
+ sidebar: (selector: string | HTMLElement, options?: SidebarOptions) => SidebarInstance;
1982
+ /**
1983
+ * - Render a footer into an element
1984
+ */
1985
+ footer: (selector: string | HTMLElement, options?: FooterOptions) => FooterInstance;
1986
+ /**
1987
+ * - A desktop notification (call show())
1988
+ */
1989
+ notification: (options?: DesktopNotificationOptions) => DesktopNotification;
1990
+ /**
1991
+ * Show a desktop notification now: notify(title, options) or notify({title, ...})
1992
+ */
1993
+ notify: (title: string | DesktopNotificationOptions, options?: DesktopNotificationOptions) => DesktopNotification;
1994
+ /**
1995
+ * A countdown timer; with no selector it is headless
1996
+ */
1997
+ timer: (selector?: string | HTMLElement | null, options?: TimerOptions) => TimerInstance;
1998
+ /**
1999
+ * - The page's alarm manager (a singleton)
2000
+ */
2001
+ alarm: (options?: AlarmOptions) => AlarmInstance;
2002
+ /**
2003
+ * - Suggestions under a text input
2004
+ */
2005
+ autocomplete: (selector: string | HTMLElement, options?: AutocompleteOptions) => AutocompleteInstance;
2006
+ /**
2007
+ * - Multi-value pill input
2008
+ */
2009
+ pillbox: (selector: string | HTMLElement, options?: PillboxOptions) => PillboxInstance;
2010
+ /**
2011
+ * A themed calendar attached to an input, writing ISO `YYYY-MM-DD`
2012
+ */
2013
+ datePicker: (selector: string | HTMLElement, options?: DatePickerOptions) => DatePickerInstance;
2014
+ /**
2015
+ * Visual option-picker - card or chip variants, single or multi-select, with rich per-option metadata
2016
+ * (icon, description, tooltip, badge, recommended, disabled)
2017
+ */
2018
+ chooser: (selector: string | HTMLElement, options: ChooserOptions) => ChooserInstance;
2019
+ /**
2020
+ * Bind a right-click menu to a container and, by delegation, its children. Menus nest: an inner menu
2021
+ * shadows its parent for the region it covers, and by default appends the parent's items beneath its own.
2022
+ * `closeAll()` closes the open one, `active()` returns it, `registry(el?)` lists bound menus (for an
2023
+ * element, its resolution chain, innermost first).
2024
+ */
2025
+ contextMenu: {
2026
+ (selector: string | HTMLElement, options?: import("./context-menu.js").ContextMenuOptions): import("./context-menu.js").ContextMenuInstance;
2027
+ closeAll(): void;
2028
+ active(): import("./context-menu.js").ContextMenuInstance | null;
2029
+ registry(forElement?: HTMLElement | null): import("./context-menu.js").ContextMenuInstance[];
2030
+ };
2031
+ /**
2032
+ * Drag-to-reorder for a container's children, by pointer, touch and keyboard
2033
+ */
2034
+ sortable: (selector: string | HTMLElement, options?: import("./sortable.js").SortableOptions) => import("./sortable.js").SortableInstance;
2035
+ /**
2036
+ * Shimmering placeholders shaped like the content on its way; `.while(target, promise, opts)`, `.get`,
2037
+ * `.remove`, `.scan`, `.markup`
2038
+ */
2039
+ skeleton: import("./skeleton.js").SkeletonStatic;
2040
+ /**
2041
+ * - A picture, initials or icon; `.scan()` for data-avatar
2042
+ */
2043
+ avatar: import("./avatar.js").AvatarStatic;
2044
+ /**
2045
+ * - Overlapping avatars with "+N"
2046
+ */
2047
+ avatarGroup: import("./avatar.js").AvatarGroupStatic;
2048
+ /**
2049
+ * Join an icon or short text (and reveal / clear / stepper / counter extras) to an input already on the page
2050
+ */
2051
+ inputGroup: (selector: string | HTMLElement, options?: import("./input-group.js").InputGroupOptions) => import("./input-group.js").InputGroupInstance;
2052
+ /**
2053
+ * Anchor a rich panel (title, text/DOM content, close button) to a trigger, opened by click, hover, focus
2054
+ * or code. `scan(root)` reads `data-popover` markup, `closeAll(group?)`, `getInstance(trigger)`, `open()`
2055
+ * lists the open ones.
2056
+ */
2057
+ popover: {
2058
+ (trigger: string | HTMLElement | ArrayLike<HTMLElement>, options?: import("./popover.js").PopoverOptions): import("./popover.js").PopoverInstance;
2059
+ scan(root?: string | Element | Document): import("./popover.js").PopoverInstance[];
2060
+ closeAll(group?: string | null): void;
2061
+ getInstance(trigger: string | HTMLElement): import("./popover.js").PopoverInstance | null;
2062
+ open(): import("./popover.js").PopoverInstance[];
2063
+ };
2064
+ /**
2065
+ * A tree of expandable nodes
2066
+ */
2067
+ treeView: (selector: string | HTMLElement, options?: import("./treeview.js").TreeViewOptions) => import("./treeview.js").TreeViewInstance;
2068
+ /**
2069
+ * A panel sliding in from an edge: on an element, or - given only an options object - a new one
2070
+ * (`Slideover.create()`)
2071
+ */
2072
+ slideover: {
2073
+ (options: SlideoverCreateOptions): SlideoverInstance;
2074
+ (selector: string | HTMLElement, options?: SlideoverOptions): SlideoverInstance;
2075
+ };
2076
+ /**
2077
+ * A timeline or roadmap
2078
+ */
2079
+ progression: (selector: string | HTMLElement, options?: ProgressionOptions) => ProgressionInstance;
2080
+ /**
2081
+ * A list group on every match; returns the first (with `all()` for the rest). `E.listGroup.all()`
2082
+ * returns them as an array. A selector that matches nothing returns null.
2083
+ */
2084
+ listGroup: {
2085
+ (selector: string | HTMLElement, options?: ListGroupOptions): (ListGroupInstance & {
2086
+ all(): ListGroup[];
2087
+ }) | null;
2088
+ all(selector: string | HTMLElement, options?: ListGroupOptions): ListGroup[];
2089
+ };
2090
+ /**
2091
+ * Toast notifications: `E.toast(message, options)` plus `.show/.success/.error/.warning/.info/.closeAll`
2092
+ */
2093
+ toast: import("./components/toast.js").ToastStatic;
2094
+ /**
2095
+ * Promise-based alert, confirm and prompt dialogs
2096
+ */
2097
+ dialog: {
2098
+ alert(message: string | DialogOptions, options?: DialogOptions): Promise<undefined | false>;
2099
+ confirm(message: string | DialogOptions, options?: DialogOptions): Promise<boolean>;
2100
+ prompt(message: string | DialogOptions, options?: DialogOptions): Promise<string | null>;
2101
+ };
2102
+ /**
2103
+ * An alert dialog; resolves undefined on OK, false when dismissed
2104
+ */
2105
+ alert: (message: string | DialogOptions, options?: DialogOptions) => Promise<undefined | false>;
2106
+ /**
2107
+ * A confirm dialog; true if confirmed
2108
+ */
2109
+ confirm: (message: string | DialogOptions, options?: DialogOptions) => Promise<boolean>;
2110
+ /**
2111
+ * A prompt dialog; the input value, or null if cancelled
2112
+ */
2113
+ prompt: (message: string | DialogOptions, options?: DialogOptions) => Promise<string | null>;
2114
+ /**
2115
+ * A new modal in the shared dialog container
2116
+ */
2117
+ createModal: (options?: import("./components/modal.js").ModalOptions) => import("./components/modal.js").ModalInstance;
2118
+ /**
2119
+ * Open a new modal and resolve with the button pressed (null when dismissed)
2120
+ */
2121
+ showModal: (options?: import("./components/modal.js").ModalOptions) => Promise<string | null>;
2122
+ /**
2123
+ * - Create a Signature capture pad
2124
+ */
2125
+ signature: (selector: string | HTMLElement, options?: SignatureOptions) => SignatureInstance;
2126
+ /**
2127
+ * Keep Tab and focus inside containers while active (null when nothing matched); `.tabbables()`, `.top()`
2128
+ */
2129
+ focusTrap: import("./components/focus-trap.js").FocusTrapFactory;
2130
+ /**
2131
+ * A Cmd/Ctrl+K command palette (builds its own overlay); `.formatShortcut`, `.fuzzyMatch`, `.claims`
2132
+ */
2133
+ commandPalette: import("./components/command-palette.js").CommandPaletteFactory;
2134
+ /**
2135
+ * Resizable panes from a container's children; null when nothing matches
2136
+ */
2137
+ splitPane: (selector: import("./components/shared.js").ComponentTarget, options?: import("./components/split-pane.js").SplitPaneOptions) => import("./components/split-pane.js").SplitPaneInstance | null;
2138
+ /**
2139
+ * A scrolling list that renders only the visible rows; null when nothing matches
2140
+ */
2141
+ virtualList: <T = any>(selector: import("./components/shared.js").ComponentTarget, options?: import("./components/virtual-list.js").VirtualListOptions<T>) => import("./components/virtual-list.js").VirtualListInstance<T> | null;
2142
+ /**
2143
+ * A file drop / browse / paste area over a real file input; null when the target matches nothing
2144
+ */
2145
+ dropzone: (target: import("./components/shared.js").ComponentTarget, options?: import("./components/dropzone.js").DropzoneOptions) => import("./components/dropzone.js").DropzoneInstance | null;
2146
+ /**
2147
+ * A one- or two-thumb slider over real range inputs; null when the target matches nothing
2148
+ */
2149
+ rangeSlider: (target: import("./components/shared.js").ComponentTarget, options?: import("./components/range-slider.js").RangeSliderOptions) => import("./components/range-slider.js").RangeSliderInstance | null;
2150
+ /**
2151
+ * Alias of rangeSlider()
2152
+ */
2153
+ slider: (target: import("./components/shared.js").ComponentTarget, options?: import("./components/range-slider.js").RangeSliderOptions) => import("./components/range-slider.js").RangeSliderInstance | null;
2154
+ /**
2155
+ * The component on an element - including ones made by a factory (`E.slideover({...})`) or another
2156
+ * component. `name` is the componentName ('slideover', 'popover', ...) when an element hosts several.
2157
+ */
2158
+ get: <T = import("./component.js").ComponentInstance>(selector: string | Element | null | undefined, name?: string) => T | undefined;
2159
+ /**
2160
+ * - Destroy the component on an element
2161
+ */
2162
+ destroy: (selector: string | Element | null | undefined, name?: string) => void;
2163
+ /**
2164
+ * - Destroy every component made through this object
2165
+ */
2166
+ destroyAll: () => void;
2167
+ /**
2168
+ * Register a custom component class for create()
2169
+ */
2170
+ register: (name: string, ComponentClass: new (selector: any, options?: any) => any) => void;
2171
+ /**
2172
+ * Create a registered custom component (throws for an unknown name)
2173
+ */
2174
+ create: (name: string, selector: string | HTMLElement, options?: Record<string, any>) => import("./component.js").ComponentInstance;
2175
+ };
2176
+ /**
2177
+ * @typedef {object} DesktopNotificationOptions
2178
+ * @property {string} [title='Notification'] - Notification title
2179
+ * @property {string} [body=''] - Body text
2180
+ * @property {string|null} [icon=null] - Icon URL
2181
+ * @property {string|null} [badge=null] - Badge URL
2182
+ * @property {string|null} [tag=null] - Tag: a new notification with the same tag replaces the old one
2183
+ * @property {boolean} [requireInteraction=false] - Stay until the user dismisses it
2184
+ * @property {boolean} [silent=false] - No sound or vibration
2185
+ * @property {any} [data=null] - Data kept on the native notification
2186
+ * @property {((event: Event, notification: DesktopNotification) => void)|null} [onClick] - Notification clicked
2187
+ * @property {((event: Event, notification: DesktopNotification) => void)|null} [onClose] - Notification closed
2188
+ * @property {((error: Error|Event, notification?: DesktopNotification) => void)|null} [onError] - Unsupported, permission denied, or the native notification failed
2189
+ * @property {((event: Event, notification: DesktopNotification) => void)|null} [onShow] - Notification shown
2190
+ */
2191
+ /**
2192
+ * DesktopNotification - Browser native notification wrapper
2193
+ * Provides a clean API for desktop notifications with permission handling
2194
+ */
2195
+ export class DesktopNotification {
2196
+ static permission: NotificationPermission;
2197
+ static isSupported: boolean;
2198
+ static _instances: any[];
2199
+ static defaults: {
2200
+ title: string;
2201
+ body: string;
2202
+ icon: any;
2203
+ badge: any;
2204
+ tag: any;
2205
+ requireInteraction: boolean;
2206
+ silent: boolean;
2207
+ data: any;
2208
+ onClick: any;
2209
+ onClose: any;
2210
+ onError: any;
2211
+ onShow: any;
2212
+ };
2213
+ /**
2214
+ * Request notification permission
2215
+ * @returns {Promise<NotificationPermission>} Permission state: 'granted', 'denied', or 'default'
2216
+ */
2217
+ static requestPermission(): Promise<NotificationPermission>;
2218
+ /**
2219
+ * Quick static method to show a notification
2220
+ * @param {string} title - Notification title
2221
+ * @param {DesktopNotificationOptions} [options] - Notification options
2222
+ * @returns {DesktopNotification} The notification (shown asynchronously; onError reports unsupported/denied)
2223
+ */
2224
+ static notify(title: string, options?: DesktopNotificationOptions): DesktopNotification;
2225
+ /**
2226
+ * Close all active notifications
2227
+ * @returns {void}
2228
+ */
2229
+ static closeAll(): void;
2230
+ /**
2231
+ * Constructor
2232
+ * @param {DesktopNotificationOptions} [options] - Notification options
2233
+ */
2234
+ constructor(options?: DesktopNotificationOptions);
2235
+ /** The options in force. @type {DesktopNotificationOptions} */
2236
+ options: DesktopNotificationOptions;
2237
+ /** The native notification once shown. @type {Notification|null} */
2238
+ notification: Notification | null;
2239
+ _shown: boolean;
2240
+ /**
2241
+ * Show the notification (asks for permission first when it has not been decided)
2242
+ * @returns {Promise<this>} Resolves once shown, or at once when unsupported/denied (onError is called)
2243
+ */
2244
+ show(): Promise<this>;
2245
+ /**
2246
+ * Close the notification
2247
+ * @returns {this}
2248
+ */
2249
+ close(): this;
2250
+ /**
2251
+ * Check if notification is currently shown
2252
+ * @returns {boolean}
2253
+ */
2254
+ isShown(): boolean;
2255
+ }
2256
+ import TreeView from './treeview.js';
2257
+ import ContextMenu from './context-menu.js';
2258
+ import Sortable from './sortable.js';
2259
+ import InputGroup from './input-group.js';
2260
+ import Popover from './popover.js';
2261
+ import FocusTrap from './components/focus-trap.js';
2262
+ import CommandPalette from './components/command-palette.js';
2263
+ import SplitPane from './components/split-pane.js';
2264
+ import VirtualList from './components/virtual-list.js';
2265
+ import Dropzone from './components/dropzone.js';
2266
+ import RangeSlider from './components/range-slider.js';
2267
+ /**
2268
+ * Fired when the active tab changes (onChange option / `.on('change')`).
2269
+ * @typedef {object} TabChangeEvent
2270
+ * @property {number} index - The new active index
2271
+ * @property {number} oldIndex - The previous active index
2272
+ * @property {HTMLElement} tab - The new active tab
2273
+ * @property {HTMLElement} panel - Its panel
2274
+ */
2275
+ /**
2276
+ * @typedef {object} TabsOptions
2277
+ * @property {number} [active=0] - Initially active tab index
2278
+ * @property {'fade'|'none'} [animation='fade'] - Panel animation
2279
+ * @property {number} [animationDuration=200] - Animation duration in ms
2280
+ * @property {string} [tabSelector='.tab-item, [data-tab]'] - Selector for tab items
2281
+ * @property {string} [panelSelector='.tab-panel, [data-panel]'] - Selector for tab panels
2282
+ * @property {string} [activeClass='active'] - CSS class for the active tab
2283
+ * @property {((event: TabChangeEvent) => void)|null} [onChange] - Called when the active tab changes
2284
+ */
2285
+ /**
2286
+ * Tabs: tab items paired by index with panels, with ARIA roles set up.
2287
+ * @typedef {Tabs} TabsInstance
2288
+ */
2289
+ /**
2290
+ * Tabs component.
2291
+ */
2292
+ declare class Tabs extends Component {
2293
+ static defaults: {
2294
+ active: number;
2295
+ animation: string;
2296
+ animationDuration: number;
2297
+ tabSelector: string;
2298
+ panelSelector: string;
2299
+ activeClass: string;
2300
+ onChange: any;
2301
+ };
2302
+ /**
2303
+ * @param {string|HTMLElement} selector - The tabs container
2304
+ * @param {TabsOptions} [options]
2305
+ */
2306
+ constructor(selector: string | HTMLElement, options?: TabsOptions);
2307
+ _activeIndex: any;
2308
+ _init(): void;
2309
+ _tabs: NodeListOf<any>;
2310
+ _panels: NodeListOf<any>;
2311
+ /**
2312
+ * Activate a tab by index, or by its `data-tab` / `href` value.
2313
+ * @param {number|string} index
2314
+ * @returns {this}
2315
+ */
2316
+ activate(index: number | string): this;
2317
+ _updateState(): void;
2318
+ /**
2319
+ * The active tab index.
2320
+ * @returns {number}
2321
+ */
2322
+ getActive(): number;
2323
+ /**
2324
+ * Alias of activate().
2325
+ * @param {number|string} index
2326
+ * @returns {this}
2327
+ */
2328
+ show(index: number | string): this;
2329
+ /**
2330
+ * Go to the next tab (wraps).
2331
+ * @returns {this}
2332
+ */
2333
+ next(): this;
2334
+ /**
2335
+ * Go to the previous tab (wraps).
2336
+ * @returns {this}
2337
+ */
2338
+ prev(): this;
2339
+ }
2340
+ /**
2341
+ * Fired when a panel opens or closes through toggle() (onChange option / `.on('change')`).
2342
+ * @typedef {object} AccordionChangeEvent
2343
+ * @property {number} index
2344
+ * @property {boolean} isOpen - Whether the panel is now open
2345
+ * @property {HTMLElement} header
2346
+ * @property {HTMLElement} content
2347
+ */
2348
+ /**
2349
+ * @typedef {object} AccordionOptions
2350
+ * @property {boolean} [allowMultiple=false] - Allow several panels open at once
2351
+ * @property {boolean|null} [multiExpand=null] - Alias of allowMultiple (wins when set)
2352
+ * @property {number|number[]|null} [activeIndex=null] - Initially open panel index(es); null keeps the markup's active class
2353
+ * @property {boolean} [animation=true] - Animate the height
2354
+ * @property {number} [animationDuration=300] - Animation duration in ms
2355
+ * @property {string} [headerSelector='.accordion-header, [data-accordion-header]'] - Selector for headers
2356
+ * @property {string} [contentSelector='.accordion-body, .accordion-content, [data-accordion-content]'] - Selector for panels (outermost matches only)
2357
+ * @property {string} [activeClass='active'] - Class put on the open item (the header's parent)
2358
+ * @property {((event: AccordionChangeEvent) => void)|null} [onChange] - Called when toggle() opens or closes a panel
2359
+ */
2360
+ /**
2361
+ * @typedef {Accordion} AccordionInstance
2362
+ */
2363
+ /**
2364
+ * Accordion component.
2365
+ */
2366
+ declare class Accordion extends Component {
2367
+ static defaults: {
2368
+ allowMultiple: boolean;
2369
+ multiExpand: any;
2370
+ activeIndex: any;
2371
+ animation: boolean;
2372
+ animationDuration: number;
2373
+ headerSelector: string;
2374
+ contentSelector: string;
2375
+ activeClass: string;
2376
+ onChange: any;
2377
+ };
2378
+ /**
2379
+ * @param {string|HTMLElement} selector - The accordion container
2380
+ * @param {AccordionOptions} [options]
2381
+ */
2382
+ constructor(selector: string | HTMLElement, options?: AccordionOptions);
2383
+ _init(): void;
2384
+ _headers: NodeListOf<any>;
2385
+ _contents: any[];
2386
+ /**
2387
+ * Open or close a panel; closes the others unless allowMultiple.
2388
+ * @param {number} index
2389
+ * @returns {this}
2390
+ */
2391
+ toggle(index: number): this;
2392
+ _open(index: any): void;
2393
+ _close(index: any): void;
2394
+ /**
2395
+ * Open a panel by index.
2396
+ * @param {number} index
2397
+ * @returns {this}
2398
+ */
2399
+ open(index: number): this;
2400
+ /**
2401
+ * Close a panel by index.
2402
+ * @param {number} index
2403
+ * @returns {this}
2404
+ */
2405
+ close(index: number): this;
2406
+ /**
2407
+ * Open every panel.
2408
+ * @returns {this}
2409
+ */
2410
+ openAll(): this;
2411
+ /**
2412
+ * Close every panel.
2413
+ * @returns {this}
2414
+ */
2415
+ closeAll(): this;
2416
+ }
2417
+ /**
2418
+ * @typedef {'primary'|'secondary'|'success'|'danger'|'warning'|'info'} ListGroupVariant
2419
+ */
2420
+ /**
2421
+ * @typedef {object} ListGroupOptions
2422
+ * @property {boolean} [selectable=false] - Items can be selected (role="listbox")
2423
+ * @property {boolean} [multiSelect=false] - Allow several selected items at once
2424
+ * @property {string} [activeClass='active'] - Class on selected items
2425
+ * @property {string} [disabledClass='disabled'] - Class marking disabled items
2426
+ * @property {string} [itemSelector='.list-group-item'] - Selector for the items
2427
+ * @property {boolean} [keyboard=true] - Arrow keys, Home/End, Enter/Space
2428
+ * @property {boolean} [loop=true] - Keyboard navigation wraps from last to first
2429
+ * @property {boolean} [focusOnInit=false] - Focus the first enabled item on init
2430
+ * @property {((selected: HTMLElement[], event: Event|null) => void)|null} [onChange] - Selection changed; the selected items
2431
+ * @property {((item: HTMLElement, index: number, event: Event|null) => void)|null} [onSelect] - An item was selected
2432
+ * @property {((item: HTMLElement, index: number, event: Event|null) => void)|null} [onDeselect] - An item was deselected
2433
+ */
2434
+ /**
2435
+ * A list group. `E.listGroup()` returns the first instance; `all()` (non-enumerable) lists every
2436
+ * instance the selector made.
2437
+ * @typedef {ListGroup & {all(): ListGroup[]}} ListGroupInstance
2438
+ */
2439
+ /**
2440
+ * ListGroup component.
2441
+ */
2442
+ declare class ListGroup extends Component {
2443
+ static defaults: {
2444
+ selectable: boolean;
2445
+ multiSelect: boolean;
2446
+ activeClass: string;
2447
+ disabledClass: string;
2448
+ itemSelector: string;
2449
+ keyboard: boolean;
2450
+ loop: boolean;
2451
+ focusOnInit: boolean;
2452
+ onChange: any;
2453
+ onSelect: any;
2454
+ onDeselect: any;
2455
+ };
2456
+ /**
2457
+ * @param {string|HTMLElement} selector - The list-group element
2458
+ * @param {ListGroupOptions} [options]
2459
+ */
2460
+ constructor(selector: string | HTMLElement, options?: ListGroupOptions);
2461
+ _items: any[];
2462
+ _focusedIndex: number;
2463
+ _init(): void;
2464
+ _initTabindex(): void;
2465
+ _setupKeyboard(): void;
2466
+ _nextEnabledIndex(from: any, direction: any): any;
2467
+ _firstEnabledIndex(): number;
2468
+ _lastEnabledIndex(): number;
2469
+ _moveFocus(index: any): void;
2470
+ _handleItemClick(index: any, event: any): void;
2471
+ _updateAriaSelected(): void;
2472
+ /**
2473
+ * Select item at index
2474
+ * @param {number} index
2475
+ * @returns {this}
2476
+ */
2477
+ select(index: number): this;
2478
+ /**
2479
+ * Deselect item at index
2480
+ * @param {number} index
2481
+ * @returns {this}
2482
+ */
2483
+ deselect(index: number): this;
2484
+ /**
2485
+ * Toggle selection at index
2486
+ * @param {number} index
2487
+ * @returns {this}
2488
+ */
2489
+ toggle(index: number): this;
2490
+ /**
2491
+ * Select all non-disabled items (multiSelect mode only)
2492
+ * @returns {this}
2493
+ */
2494
+ selectAll(): this;
2495
+ /**
2496
+ * Deselect all items
2497
+ * @returns {this}
2498
+ */
2499
+ deselectAll(): this;
2500
+ /**
2501
+ * Return array of selected DOM elements
2502
+ * @returns {HTMLElement[]}
2503
+ */
2504
+ getSelected(): HTMLElement[];
2505
+ /**
2506
+ * Return whether item at index is selected
2507
+ * @param {number} index
2508
+ * @returns {boolean}
2509
+ */
2510
+ isSelected(index: number): boolean;
2511
+ /**
2512
+ * Enable item at index (remove disabled class)
2513
+ * @param {number} index
2514
+ * @returns {this}
2515
+ */
2516
+ enable(index: number): this;
2517
+ /**
2518
+ * Disable item at index (add disabled class)
2519
+ * @param {number} index
2520
+ * @returns {this}
2521
+ */
2522
+ disable(index: number): this;
2523
+ /**
2524
+ * Return all item elements as array
2525
+ * @returns {HTMLElement[]}
2526
+ */
2527
+ getItems(): HTMLElement[];
2528
+ /**
2529
+ * Return single item element at index
2530
+ * @param {number} index
2531
+ * @returns {HTMLElement|null}
2532
+ */
2533
+ getItem(index: number): HTMLElement | null;
2534
+ /**
2535
+ * Re-query items from the DOM (call after dynamic DOM changes)
2536
+ * @returns {this}
2537
+ */
2538
+ refresh(): this;
2539
+ }
2540
+ /**
2541
+ * A menu item. A plain string is an item whose label and value are the string.
2542
+ * @typedef {object} DropdownItem
2543
+ * @property {string} [label] - Display text
2544
+ * @property {string} [text] - Alternative to label
2545
+ * @property {string} [name] - Alternative to label
2546
+ * @property {any} [value] - Value when selected (default: the item's index)
2547
+ * @property {string} [icon] - Icon HTML
2548
+ * @property {boolean} [disabled] - Shown greyed, not selectable
2549
+ * @property {boolean} [divider] - Render as a divider
2550
+ * @property {string} [header] - Render as a header with this text
2551
+ */
2552
+ /**
2553
+ * Passed to onSelect / `.on('select')`.
2554
+ * @typedef {object} DropdownSelectEvent
2555
+ * @property {DropdownItem|string} item
2556
+ * @property {number} index
2557
+ * @property {any} value
2558
+ */
2559
+ /**
2560
+ * @typedef {object} DropdownOptions
2561
+ * @property {'click'|'hover'} [trigger='click'] - 'hover' also opens on click (touch has no hover)
2562
+ * @property {DropdownPosition} [position='bottom-start'] - Preferred menu position - flipped or clamped if it would open off screen
2563
+ * @property {[number, number]} [offset=[0, 4]] - Position offset [x, y]
2564
+ * @property {boolean} [flip=true] - Flip to the opposite side and clamp to the viewport rather than open off screen
2565
+ * @property {boolean} [animation=true] - Fade the menu
2566
+ * @property {number} [animationDuration=150] - Animation duration in ms
2567
+ * @property {number} [hoverOpenDelay=0] - ms before a hover opens the menu
2568
+ * @property {number} [hoverCloseDelay=300] - ms of grace before a hover menu closes once the pointer has left trigger, menu and the gap between
2569
+ * @property {boolean} [closeOnSelect=true] - Close after an item is chosen
2570
+ * @property {boolean} [closeOnClickOutside=true] - Close on a click outside
2571
+ * @property {boolean} [closeOnEscape=true] - Close on Esc and restore focus to the trigger
2572
+ * @property {boolean} [closeOthers=true] - Opening this dropdown closes any other open one
2573
+ * @property {(DropdownItem|string)[]} [items=[]] - Menu items
2574
+ * @property {any} [model=null] - A Domma Model holding the items array (with modelKey)
2575
+ * @property {string|null} [modelKey=null] - Model key for the items array
2576
+ * @property {string} [selectedKey] - Model key the selected value is written to (default `<modelKey>_selected`)
2577
+ * @property {((item: DropdownItem, index: number) => string)|null} [itemTemplate=null] - Item HTML for object items
2578
+ * @property {((dropdown: DropdownInstance) => boolean|void)|null} [onBeforeOpen] - Return false to keep it closed
2579
+ * @property {((dropdown: DropdownInstance) => void)|null} [onOpen] - Menu opened
2580
+ * @property {((dropdown: DropdownInstance) => boolean|void)|null} [onBeforeClose] - Return false to keep it open
2581
+ * @property {((dropdown: DropdownInstance) => void)|null} [onClose] - Menu closed
2582
+ * @property {((event: DropdownSelectEvent, dropdown: DropdownInstance) => void)|null} [onSelect] - An item was chosen
2583
+ */
2584
+ /**
2585
+ * @typedef {Dropdown} DropdownInstance
2586
+ */
2587
+ /**
2588
+ * Dropdown menu attached to a trigger element.
2589
+ */
2590
+ declare class Dropdown extends Component {
2591
+ static defaults: {
2592
+ trigger: string;
2593
+ position: string;
2594
+ offset: number[];
2595
+ animation: boolean;
2596
+ animationDuration: number;
2597
+ hoverOpenDelay: number;
2598
+ hoverCloseDelay: number;
2599
+ closeOnSelect: boolean;
2600
+ closeOnClickOutside: boolean;
2601
+ closeOnEscape: boolean;
2602
+ closeOthers: boolean;
2603
+ flip: boolean;
2604
+ items: any[];
2605
+ model: any;
2606
+ modelKey: any;
2607
+ itemTemplate: any;
2608
+ onBeforeOpen: any;
2609
+ onOpen: any;
2610
+ onBeforeClose: any;
2611
+ onClose: any;
2612
+ onSelect: any;
2613
+ };
2614
+ static _open: Set<any>;
2615
+ /**
2616
+ * @param {string|HTMLElement} selector - The trigger element
2617
+ * @param {DropdownOptions} [options]
2618
+ */
2619
+ constructor(selector: string | HTMLElement, options?: DropdownOptions);
2620
+ _menu: HTMLDivElement;
2621
+ _isOpen: boolean;
2622
+ _items: any[];
2623
+ _selectedValue: any;
2624
+ _modelUnsubscribe: any;
2625
+ _hoverOpenTimer: number;
2626
+ _hoverCloseTimer: any;
2627
+ _removeTimer: any;
2628
+ _init(): void;
2629
+ _outsideClickHandler: (e: any) => void;
2630
+ _keydownHandler: (e: any) => void;
2631
+ _bindToModel(model: any, key: any): void;
2632
+ /**
2633
+ * Open the menu (onBeforeOpen may refuse).
2634
+ * @returns {this}
2635
+ */
2636
+ open(): this;
2637
+ /**
2638
+ * Close the menu (onBeforeClose may refuse).
2639
+ * @returns {this}
2640
+ */
2641
+ close(): this;
2642
+ /**
2643
+ * @returns {this}
2644
+ */
2645
+ toggle(): this;
2646
+ show(...args: any[]): this;
2647
+ hide(...args: any[]): this;
2648
+ isVisible(): boolean;
2649
+ _hoverIn(): void;
2650
+ _hoverOut(): void;
2651
+ _scheduleHoverClose(): void;
2652
+ /**
2653
+ * Is the pointer somewhere that should keep a hover menu open?
2654
+ *
2655
+ * mouseenter/mouseleave alone cannot answer this. The menu is a document.body
2656
+ * sibling separated from its trigger by `offset`, so the two boxes never
2657
+ * touch, and the path a user takes between them is whatever angle they
2658
+ * happen to choose. Leaving the trigger therefore looks identical to leaving
2659
+ * for good, and the menu closed out from under the pointer.
2660
+ *
2661
+ * So while the menu is open we watch the pointer itself and treat three
2662
+ * regions as "still here": the trigger, the menu, and the corridor spanning
2663
+ * the gap between them. That is geometric, so it holds for any `offset`, for
2664
+ * a diagonal approach, and for a menu that has been flipped to the other
2665
+ * side of its trigger.
2666
+ */
2667
+ _pointerInSafeZone(x: any, y: any): boolean;
2668
+ _bindOpenListeners(): void;
2669
+ _openListenersBound: boolean;
2670
+ _repositionHandler: () => void;
2671
+ _pointerMoveHandler: (e: any) => void;
2672
+ _pointerLeaveHandler: () => void;
2673
+ _unbindOpenListeners(): void;
2674
+ _createMenu(): void;
2675
+ _renderMenu(): void;
2676
+ _selectItem(item: any, index: any, value: any): void;
2677
+ /**
2678
+ * Place the menu against its trigger and keep it on screen. `position` is a
2679
+ * preference, not a promise: a menu that would run off the bottom or the
2680
+ * right edge is flipped to the opposite side when there is room there, and
2681
+ * clamped to the viewport either way.
2682
+ */
2683
+ _positionMenu(): void;
2684
+ /**
2685
+ * Replace the menu items.
2686
+ * @param {(DropdownItem|string)[]} items
2687
+ * @returns {this}
2688
+ */
2689
+ setItems(items: (DropdownItem | string)[]): this;
2690
+ /**
2691
+ * @param {DropdownItem|string} item
2692
+ * @returns {this}
2693
+ */
2694
+ addItem(item: DropdownItem | string): this;
2695
+ /**
2696
+ * @param {number} index
2697
+ * @returns {this}
2698
+ */
2699
+ removeItem(index: number): this;
2700
+ /**
2701
+ * The value of the last chosen item, or null.
2702
+ * @returns {any}
2703
+ */
2704
+ getSelected(): any;
2705
+ /**
2706
+ * @returns {boolean}
2707
+ */
2708
+ isOpen(): boolean;
2709
+ }
2710
+ /**
2711
+ * @typedef {object} TimerOptions
2712
+ * @property {number} [duration=60000] - Countdown length in ms
2713
+ * @property {boolean} [autoStart=false] - Start at once
2714
+ * @property {'hh:mm:ss'|'mm:ss'|'ss'|string} [format='mm:ss'] - Display format (case-insensitive)
2715
+ * @property {boolean} [showControls=false] - Show start/pause/reset buttons
2716
+ * @property {number} [updateInterval=100] - Tick interval in ms
2717
+ * @property {boolean} [notification=false] - Desktop notification on completion
2718
+ * @property {DesktopNotificationOptions} [notificationOptions] - Options for that notification
2719
+ * @property {boolean} [sound=false] - Play soundUrl on completion
2720
+ * @property {string|null} [soundUrl=null] - Sound to play
2721
+ * @property {((remaining: number) => void)|null} [onTick] - Every tick, with the ms remaining
2722
+ * @property {(() => void)|null} [onComplete] - Reached zero
2723
+ * @property {(() => void)|null} [onStart] - Started
2724
+ * @property {(() => void)|null} [onPause] - Paused
2725
+ * @property {(() => void)|null} [onReset] - Reset
2726
+ */
2727
+ /**
2728
+ * @typedef {Timer} TimerInstance
2729
+ */
2730
+ /**
2731
+ * Timer - Countdown timer with optional visual display
2732
+ * Works in both visual mode (with DOM element) and headless mode (pure logic)
2733
+ */
2734
+ declare class Timer extends Component {
2735
+ static defaults: {
2736
+ duration: number;
2737
+ autoStart: boolean;
2738
+ format: string;
2739
+ showControls: boolean;
2740
+ updateInterval: number;
2741
+ notification: boolean;
2742
+ notificationOptions: {};
2743
+ sound: boolean;
2744
+ soundUrl: any;
2745
+ onTick: any;
2746
+ onComplete: any;
2747
+ onStart: any;
2748
+ onPause: any;
2749
+ onReset: any;
2750
+ };
2751
+ /**
2752
+ * @param {string|HTMLElement|null} [selector] - Where to draw the display; null for a headless timer
2753
+ * @param {TimerOptions} [options]
2754
+ */
2755
+ constructor(selector?: string | HTMLElement | null, options?: TimerOptions);
2756
+ _running: boolean;
2757
+ _remaining: any;
2758
+ _intervalId: number;
2759
+ _startTime: number;
2760
+ _pausedTime: number;
2761
+ _display: HTMLDivElement;
2762
+ _controls: HTMLDivElement;
2763
+ _audio: HTMLAudioElement;
2764
+ _init(): void;
2765
+ /**
2766
+ * Create visual display
2767
+ * @private
2768
+ */
2769
+ private _createDisplay;
2770
+ _container: HTMLDivElement;
2771
+ /**
2772
+ * Create control buttons
2773
+ * @private
2774
+ */
2775
+ private _createControls;
2776
+ _startBtn: HTMLButtonElement;
2777
+ _pauseBtn: HTMLButtonElement;
2778
+ _resetBtn: HTMLButtonElement;
2779
+ /**
2780
+ * Update visual display
2781
+ * @private
2782
+ */
2783
+ private _updateDisplay;
2784
+ /**
2785
+ * Format milliseconds to time string
2786
+ * @param {number} ms - Milliseconds
2787
+ * @returns {string} Formatted time
2788
+ * @private
2789
+ */
2790
+ private _formatTime;
2791
+ /**
2792
+ * Timer tick - called on each update interval
2793
+ * @private
2794
+ */
2795
+ private _tick;
2796
+ /**
2797
+ * Timer completion handler
2798
+ * @private
2799
+ */
2800
+ private _complete;
2801
+ /**
2802
+ * Start the timer
2803
+ * @returns {this}
2804
+ */
2805
+ start(): this;
2806
+ /**
2807
+ * Pause the timer
2808
+ * @returns {this}
2809
+ */
2810
+ pause(): this;
2811
+ /**
2812
+ * Reset the timer to initial duration
2813
+ * @returns {this}
2814
+ */
2815
+ reset(): this;
2816
+ /**
2817
+ * Stop the timer (pause without resuming)
2818
+ * @returns {this}
2819
+ */
2820
+ stop(): this;
2821
+ /**
2822
+ * Add time to the timer
2823
+ * @param {number} ms - Milliseconds to add
2824
+ * @returns {this}
2825
+ */
2826
+ add(ms: number): this;
2827
+ /**
2828
+ * Subtract time from the timer
2829
+ * @param {number} ms - Milliseconds to subtract
2830
+ * @returns {this}
2831
+ */
2832
+ subtract(ms: number): this;
2833
+ /**
2834
+ * Set a new duration
2835
+ * @param {number} ms - New duration in milliseconds
2836
+ * @returns {this}
2837
+ */
2838
+ setDuration(ms: number): this;
2839
+ /**
2840
+ * Check if timer is running
2841
+ * @returns {boolean}
2842
+ */
2843
+ isRunning(): boolean;
2844
+ /**
2845
+ * Get remaining time
2846
+ * @returns {number} Remaining time in milliseconds
2847
+ */
2848
+ getRemaining(): number;
2849
+ /**
2850
+ * Get elapsed time
2851
+ * @returns {number} Elapsed time in milliseconds
2852
+ */
2853
+ getElapsed(): number;
2854
+ }
2855
+ /**
2856
+ * One alarm. add() fills in the defaults and the id.
2857
+ * @typedef {object} AlarmItem
2858
+ * @property {string} [id] - Assigned by add() ('alarm-<n>')
2859
+ * @property {string} time - Time of day, 'HH:MM'
2860
+ * @property {string} [label] - Shown in the notification
2861
+ * @property {boolean} [enabled=true]
2862
+ * @property {null|'daily'|'weekdays'|'weekends'|string[]} [repeat=null] - null = once; an array of day names ('monday', ...)
2863
+ * @property {boolean} [notification=true] - Desktop notification when it goes off
2864
+ * @property {DesktopNotificationOptions} [notificationOptions] - Options for that notification
2865
+ * @property {boolean} [sound=false] - Play soundUrl
2866
+ * @property {string|null} [soundUrl=null]
2867
+ * @property {number|null} [lastTriggered=null] - Timestamp (ms) it last went off
2868
+ * @property {number|null} [snoozedUntil=null] - Timestamp (ms) a snooze ends
2869
+ * @property {Date} [nextTrigger] - Set on the copy getNextAlarm() returns
2870
+ */
2871
+ /**
2872
+ * @typedef {object} AlarmOptions
2873
+ * @property {AlarmItem[]} [alarms=[]] - Initial alarms, used when storage holds none
2874
+ * @property {string} [timezone='local'] - Not read: times are local
2875
+ * @property {number} [checkInterval=30000] - How often alarms are checked, in ms
2876
+ * @property {string} [storageKey='domma-alarms'] - localStorage key
2877
+ * @property {((alarm: AlarmItem) => void)|null} [onTrigger] - An alarm went off
2878
+ * @property {((alarm: AlarmItem, duration: number) => void)|null} [onSnooze] - An alarm was snoozed
2879
+ * @property {(() => void)|null} [onDismiss] - Not called by the current code
2880
+ * @property {((alarm: AlarmItem) => void)|null} [onAlarmAdd] - add() added one
2881
+ * @property {((alarm: AlarmItem) => void)|null} [onAlarmRemove] - removeAlarm() removed one
2882
+ */
2883
+ /**
2884
+ * @typedef {Alarm} AlarmInstance
2885
+ */
2886
+ /**
2887
+ * Alarm - Scheduled time-based alerts with localStorage persistence
2888
+ * Singleton pattern - only one instance manages all alarms
2889
+ */
2890
+ declare class Alarm {
2891
+ static defaults: {
2892
+ alarms: any[];
2893
+ timezone: string;
2894
+ checkInterval: number;
2895
+ storageKey: string;
2896
+ onTrigger: any;
2897
+ onSnooze: any;
2898
+ onDismiss: any;
2899
+ onAlarmAdd: any;
2900
+ onAlarmRemove: any;
2901
+ };
2902
+ static _instance: any;
2903
+ static _checkInterval: any;
2904
+ static _nextAlarmId: number;
2905
+ /**
2906
+ * Constructor - implements singleton pattern
2907
+ * @param {AlarmOptions} [options] - Alarm options (ignored once the instance exists)
2908
+ */
2909
+ constructor(options?: AlarmOptions);
2910
+ /** @type {AlarmOptions} */
2911
+ options: AlarmOptions;
2912
+ _alarms: any[];
2913
+ /**
2914
+ * Initialize alarm system
2915
+ * @private
2916
+ */
2917
+ private _init;
2918
+ /**
2919
+ * Load alarms from localStorage
2920
+ * @private
2921
+ */
2922
+ private _loadAlarms;
2923
+ /**
2924
+ * Save alarms to localStorage
2925
+ * @private
2926
+ */
2927
+ private _saveAlarms;
2928
+ /**
2929
+ * Start checking alarms at regular interval
2930
+ * @private
2931
+ */
2932
+ private _startChecking;
2933
+ /**
2934
+ * Stop checking alarms
2935
+ * @private
2936
+ */
2937
+ private _stopChecking;
2938
+ /**
2939
+ * Check all alarms and trigger if needed
2940
+ * @private
2941
+ */
2942
+ private _checkAlarms;
2943
+ /**
2944
+ * Check if alarm should trigger at the given time
2945
+ * @param {Object} alarm - Alarm object
2946
+ * @param {Date} now - Current time
2947
+ * @returns {boolean}
2948
+ * @private
2949
+ */
2950
+ private _shouldTrigger;
2951
+ /**
2952
+ * Parse time string (HH:MM format)
2953
+ * @param {string} timeString - Time in HH:MM format
2954
+ * @returns {Object} { hours, minutes }
2955
+ * @private
2956
+ */
2957
+ private _parseTime;
2958
+ /**
2959
+ * Check if alarm matches repeat pattern for given date
2960
+ * @param {Object} alarm - Alarm object
2961
+ * @param {Date} date - Date to check
2962
+ * @returns {boolean}
2963
+ * @private
2964
+ */
2965
+ private _matchesRepeatPattern;
2966
+ /**
2967
+ * Trigger an alarm
2968
+ * @param {Object} alarm - Alarm to trigger
2969
+ * @private
2970
+ */
2971
+ private _triggerAlarm;
2972
+ /**
2973
+ * Add a new alarm
2974
+ * @param {AlarmItem} alarm - Alarm configuration
2975
+ * @returns {AlarmItem} Created alarm with ID
2976
+ */
2977
+ add(alarm: AlarmItem): AlarmItem;
2978
+ /**
2979
+ * Remove an alarm by ID. remove(id) is a permanent alias - removeAlarm is the name,
2980
+ * because remove() means "take this component away" elsewhere and destroy() does that here.
2981
+ * @param {string} id - Alarm ID
2982
+ * @returns {boolean} True if removed
2983
+ */
2984
+ removeAlarm(id: string): boolean;
2985
+ /**
2986
+ * Alias of removeAlarm(id), looked up by name at call time.
2987
+ * @param {string} id
2988
+ * @returns {boolean}
2989
+ */
2990
+ remove(id: string): boolean;
2991
+ /**
2992
+ * Update an alarm
2993
+ * @param {string} id - Alarm ID
2994
+ * @param {Partial<AlarmItem>} changes - Changes to apply
2995
+ * @returns {AlarmItem|null} Updated alarm or null if not found
2996
+ */
2997
+ update(id: string, changes: Partial<AlarmItem>): AlarmItem | null;
2998
+ /**
2999
+ * Enable an alarm
3000
+ * @param {string} id - Alarm ID
3001
+ * @returns {boolean} True if enabled
3002
+ */
3003
+ enable(id: string): boolean;
3004
+ /**
3005
+ * Disable an alarm
3006
+ * @param {string} id - Alarm ID
3007
+ * @returns {boolean} True if disabled
3008
+ */
3009
+ disable(id: string): boolean;
3010
+ /**
3011
+ * Toggle alarm enabled state
3012
+ * @param {string} id - Alarm ID
3013
+ * @returns {boolean|null} New enabled state or null if not found
3014
+ */
3015
+ toggle(id: string): boolean | null;
3016
+ /**
3017
+ * Snooze an alarm for a duration
3018
+ * @param {string} id - Alarm ID
3019
+ * @param {number} [duration=300000] - Snooze duration in milliseconds (default 5 minutes)
3020
+ * @returns {boolean} True if snoozed
3021
+ */
3022
+ snooze(id: string, duration?: number): boolean;
3023
+ /**
3024
+ * Get all alarms
3025
+ * @returns {AlarmItem[]} Array of alarm objects
3026
+ */
3027
+ getAlarms(): AlarmItem[];
3028
+ /**
3029
+ * Get a specific alarm by ID
3030
+ * @param {string} id - Alarm ID
3031
+ * @returns {AlarmItem|null} Alarm object or null
3032
+ */
3033
+ getAlarm(id: string): AlarmItem | null;
3034
+ /**
3035
+ * Get the next alarm that will trigger
3036
+ * @returns {AlarmItem|null} Next alarm object with trigger time (`nextTrigger`)
3037
+ */
3038
+ getNextAlarm(): AlarmItem | null;
3039
+ /**
3040
+ * Get next occurrence time for an alarm
3041
+ * @param {Object} alarm - Alarm object
3042
+ * @param {Date} from - Start date
3043
+ * @returns {Date|null} Next occurrence date
3044
+ * @private
3045
+ */
3046
+ private _getNextOccurrence;
3047
+ /**
3048
+ * Clear all alarms
3049
+ * @returns {this}
3050
+ */
3051
+ clearAll(): this;
3052
+ /**
3053
+ * Destroy alarm system
3054
+ */
3055
+ destroy(): void;
3056
+ }
3057
+ /**
3058
+ * Passed to onChange / `.on('change')`.
3059
+ * @typedef {object} CarouselChangeEvent
3060
+ * @property {number} index
3061
+ * @property {number} oldIndex
3062
+ * @property {HTMLElement} slide
3063
+ */
3064
+ /**
3065
+ * @typedef {object} CarouselOptions
3066
+ * @property {boolean} [autoplay=false] - Advance on a timer
3067
+ * @property {number} [interval=5000] - Autoplay interval in ms
3068
+ * @property {boolean} [pauseOnHover=true] - Pause autoplay on hover
3069
+ * @property {boolean} [loop=true] - Wrap from the last slide to the first
3070
+ * @property {'slide'|'fade'|'crossfade'} [animation='slide'] - 'slide' (track translate), 'fade' (clean swap), or 'crossfade' (overlapping opacity)
3071
+ * @property {number} [animationDuration=500] - Animation duration in ms
3072
+ * @property {string} [animationEasing='ease'] - Any CSS timing function ('ease', 'linear', 'ease-in-out', 'cubic-bezier(...)' etc.)
3073
+ * @property {'crop'|'average'} [heightMode='crop'] - Image carousels: 'crop' = the shortest image, 'average' = halfway between shortest and tallest
3074
+ * @property {number|null} [height=null] - Fixed viewport height in px
3075
+ * @property {boolean} [showArrows=true] - Previous / next arrows
3076
+ * @property {boolean} [showIndicators=true] - Indicator dots
3077
+ * @property {string} [slideSelector='.carousel-slide, [data-slide]'] - Selector for slides
3078
+ * @property {string} [activeClass='active'] - Class on the active slide
3079
+ * @property {((event: CarouselChangeEvent) => void)|null} [onChange] - The slide changed
3080
+ */
3081
+ /**
3082
+ * @typedef {Carousel} CarouselInstance
3083
+ */
3084
+ /**
3085
+ * Carousel component.
3086
+ */
3087
+ declare class Carousel extends Component {
3088
+ static defaults: {
3089
+ autoplay: boolean;
3090
+ interval: number;
3091
+ pauseOnHover: boolean;
3092
+ loop: boolean;
3093
+ animation: string;
3094
+ animationDuration: number;
3095
+ animationEasing: string;
3096
+ heightMode: string;
3097
+ height: any;
3098
+ showArrows: boolean;
3099
+ showIndicators: boolean;
3100
+ slideSelector: string;
3101
+ activeClass: string;
3102
+ onChange: any;
3103
+ };
3104
+ /**
3105
+ * @param {string|HTMLElement} selector - The carousel element
3106
+ * @param {CarouselOptions} [options]
3107
+ */
3108
+ constructor(selector: string | HTMLElement, options?: CarouselOptions);
3109
+ _currentIndex: number;
3110
+ _autoplayTimer: number;
3111
+ _isAnimating: boolean;
3112
+ _init(): void;
3113
+ _slides: NodeListOf<any>;
3114
+ _track: Element;
3115
+ _initHeight(): void;
3116
+ _images: any[];
3117
+ _originalHeight: string;
3118
+ _originalHeightPriority: string;
3119
+ _wasSized: boolean;
3120
+ _heightObserver: ResizeObserver;
3121
+ _sizeSlides(): void;
3122
+ _applyOptions(): void;
3123
+ _createArrows(): void;
3124
+ _prevBtn: HTMLButtonElement;
3125
+ _nextBtn: HTMLButtonElement;
3126
+ _createIndicators(): void;
3127
+ _indicators: HTMLDivElement;
3128
+ _updateState(oldIndex?: any): void;
3129
+ _applyCrossfade(oldIndex: any, newIndex: any): void;
3130
+ _crossfadeSwapTimer: any;
3131
+ _startAutoplay(): void;
3132
+ _stopAutoplay(): void;
3133
+ /**
3134
+ * Go to a slide (wraps when loop is on; ignored mid-animation).
3135
+ * @param {number} index
3136
+ * @returns {this}
3137
+ */
3138
+ goTo(index: number): this;
3139
+ /**
3140
+ * @returns {this}
3141
+ */
3142
+ next(): this;
3143
+ /**
3144
+ * @returns {this}
3145
+ */
3146
+ prev(): this;
3147
+ /**
3148
+ * Start autoplay.
3149
+ * @returns {this}
3150
+ */
3151
+ play(): this;
3152
+ /**
3153
+ * Stop autoplay.
3154
+ * @returns {this}
3155
+ */
3156
+ pause(): this;
3157
+ /**
3158
+ * The current slide index.
3159
+ * @returns {number}
3160
+ */
3161
+ getIndex(): number;
3162
+ /**
3163
+ * A slide element (default: the current one).
3164
+ * @param {number} [index]
3165
+ * @returns {HTMLElement|undefined}
3166
+ */
3167
+ getSlide(index?: number): HTMLElement | undefined;
3168
+ }
3169
+ /**
3170
+ * A cookie category in the customise panel.
3171
+ * @typedef {object} CookieCategory
3172
+ * @property {string} label
3173
+ * @property {string} [description]
3174
+ * @property {boolean} [required] - Always on; cannot be switched off
3175
+ */
3176
+ /**
3177
+ * @typedef {'accepted'|'rejected'|'customized'|'undecided'} CookieConsentState
3178
+ */
3179
+ /**
3180
+ * @typedef {object} CookieConsentOptions
3181
+ * @property {string} [message] - Banner text
3182
+ * @property {string} [acceptAllText='Accept All']
3183
+ * @property {string} [rejectAllText='Reject All']
3184
+ * @property {string} [customizeText='Customize']
3185
+ * @property {string} [savePreferencesText='Save Preferences']
3186
+ * @property {string} [privacyPolicyText='Privacy Policy']
3187
+ * @property {string|null} [privacyPolicyUrl='/privacy-policy']
3188
+ * @property {string} [cookiePolicyText='Cookie Policy']
3189
+ * @property {string|null} [cookiePolicyUrl=null]
3190
+ * @property {Record<string, CookieCategory>} [categories] - Default: necessary, functional, analytics, marketing
3191
+ * @property {'bottom'|'top'|'bottom-left'|'bottom-right'|'center-modal'} [position='bottom']
3192
+ * @property {'light'|'dark'|'auto'} [theme='light'] - 'auto' follows the system
3193
+ * @property {'bar'|'box'|'modal'} [layout='bar']
3194
+ * @property {boolean} [animation=true]
3195
+ * @property {boolean} [backdrop=false] - Backdrop behind the modal layout
3196
+ * @property {boolean} [autoShow=true] - Show on a first visit
3197
+ * @property {boolean} [hideAfterAction=true] - Hide once a choice is made
3198
+ * @property {string} [reopenSelector='[data-cookie-consent-open]'] - Elements that reopen the banner
3199
+ * @property {string} [storageKey='domma-cookie-consent']
3200
+ * @property {number} [storageDuration=365] - Days the choice is remembered
3201
+ * @property {CookieConsentState} [defaultState='undecided']
3202
+ * @property {boolean} [requireExplicitConsent=true] - GDPR mode: optional categories start off
3203
+ * @property {string} [consentVersion='1.0'] - Bump when the policy changes to ask again
3204
+ * @property {((oldVersion: string, newVersion: string) => void)|null} [onVersionMismatch] - The stored choice was for another version
3205
+ * @property {((preferences: Record<string, boolean>) => void)|null} [onAccept] - Accept all, or saved custom preferences
3206
+ * @property {(() => void)|null} [onReject]
3207
+ * @property {((preferences: Record<string, boolean>) => void)|null} [onCustomize] - The customise panel opened
3208
+ * @property {((state: CookieConsentState, preferences: Record<string, boolean>) => void)|null} [onChange]
3209
+ * @property {(() => void)|null} [onShow]
3210
+ * @property {(() => void)|null} [onHide]
3211
+ */
3212
+ /**
3213
+ * @typedef {CookieConsent} CookieConsentInstance
3214
+ */
3215
+ /**
3216
+ * Cookie consent banner (one per page).
3217
+ */
3218
+ declare class CookieConsent extends Component {
3219
+ static defaults: {
3220
+ message: string;
3221
+ acceptAllText: string;
3222
+ rejectAllText: string;
3223
+ customizeText: string;
3224
+ savePreferencesText: string;
3225
+ privacyPolicyText: string;
3226
+ privacyPolicyUrl: string;
3227
+ cookiePolicyText: string;
3228
+ cookiePolicyUrl: any;
3229
+ categories: {
3230
+ necessary: {
3231
+ label: string;
3232
+ description: string;
3233
+ required: boolean;
3234
+ };
3235
+ functional: {
3236
+ label: string;
3237
+ description: string;
3238
+ required: boolean;
3239
+ };
3240
+ analytics: {
3241
+ label: string;
3242
+ description: string;
3243
+ required: boolean;
3244
+ };
3245
+ marketing: {
3246
+ label: string;
3247
+ description: string;
3248
+ required: boolean;
3249
+ };
3250
+ };
3251
+ position: string;
3252
+ theme: string;
3253
+ layout: string;
3254
+ animation: boolean;
3255
+ backdrop: boolean;
3256
+ autoShow: boolean;
3257
+ hideAfterAction: boolean;
3258
+ reopenSelector: string;
3259
+ storageKey: string;
3260
+ storageDuration: number;
3261
+ defaultState: string;
3262
+ requireExplicitConsent: boolean;
3263
+ consentVersion: string;
3264
+ onVersionMismatch: any;
3265
+ onAccept: any;
3266
+ onReject: any;
3267
+ onCustomize: any;
3268
+ onChange: any;
3269
+ onShow: any;
3270
+ onHide: any;
3271
+ };
3272
+ /**
3273
+ * @param {CookieConsentOptions} [options]
3274
+ */
3275
+ constructor(options?: CookieConsentOptions);
3276
+ _state: any;
3277
+ _preferences: {};
3278
+ _customizeModal: HTMLDivElement;
3279
+ _isVisible: boolean;
3280
+ _init(): void;
3281
+ _loadPreferences(): void;
3282
+ _savePreferences(): void;
3283
+ _hasConsented(): boolean;
3284
+ _createUI(): void;
3285
+ _createCustomizeModal(): void;
3286
+ _setupEventHandlers(): void;
3287
+ _setupModalHandlers(): void;
3288
+ _setupReopenTriggers(): void;
3289
+ /**
3290
+ * Show the banner.
3291
+ * @returns {this}
3292
+ */
3293
+ open(): this;
3294
+ /**
3295
+ * Hide the banner.
3296
+ * @returns {this}
3297
+ */
3298
+ close(): this;
3299
+ /**
3300
+ * @returns {this}
3301
+ */
3302
+ toggle(): this;
3303
+ /**
3304
+ * @returns {boolean}
3305
+ */
3306
+ isOpen(): boolean;
3307
+ /**
3308
+ * Alias of open().
3309
+ * @param {...any} args
3310
+ * @returns {this}
3311
+ */
3312
+ show(...args: any[]): this;
3313
+ /**
3314
+ * Alias of close().
3315
+ * @param {...any} args
3316
+ * @returns {this}
3317
+ */
3318
+ hide(...args: any[]): this;
3319
+ /**
3320
+ * Alias of isOpen().
3321
+ * @returns {boolean}
3322
+ */
3323
+ isVisible(): boolean;
3324
+ /**
3325
+ * Accept every category.
3326
+ * @returns {void}
3327
+ */
3328
+ accept(): void;
3329
+ /**
3330
+ * Reject every optional category.
3331
+ * @returns {void}
3332
+ */
3333
+ reject(): void;
3334
+ /**
3335
+ * Open the customise panel.
3336
+ * @returns {void}
3337
+ */
3338
+ showCustomize(): void;
3339
+ /**
3340
+ * @returns {void}
3341
+ */
3342
+ hideCustomize(): void;
3343
+ /**
3344
+ * Save the customise panel's toggles.
3345
+ * @returns {void}
3346
+ */
3347
+ saveCustomPreferences(): void;
3348
+ /**
3349
+ * @returns {CookieConsentState|null}
3350
+ */
3351
+ getState(): CookieConsentState | null;
3352
+ /**
3353
+ * A copy of the per-category choices.
3354
+ * @returns {Record<string, boolean>}
3355
+ */
3356
+ getPreferences(): Record<string, boolean>;
3357
+ /**
3358
+ * Whether a category was accepted, or (no category) whether consent was given.
3359
+ * @param {string|null} [category]
3360
+ * @returns {boolean}
3361
+ */
3362
+ isAccepted(category?: string | null): boolean;
3363
+ /**
3364
+ * Forget the stored choice.
3365
+ * @returns {void}
3366
+ */
3367
+ reset(): void;
3368
+ }
3369
+ /**
3370
+ * @typedef {object} ButtonGroupOptions
3371
+ * @property {'single'|'multiple'} [mode='single'] - 'single' behaves like radios, 'multiple' like checkboxes
3372
+ * @property {string} [activeClass='active'] - Class on active buttons
3373
+ * @property {boolean} [allowEmpty=false] - Single mode: clicking the active button deselects it
3374
+ * @property {((value: number|number[]|null, index: number, button: HTMLElement|null) => void)|null} [onChange] - Selection changed (index -1 from selectAll/deselectAll)
3375
+ */
3376
+ /**
3377
+ * A button group. `E.buttonGroup()` returns the first instance; `all()` (non-enumerable) lists every
3378
+ * instance the selector made.
3379
+ * @typedef {ButtonGroup & {all(): ButtonGroup[]}} ButtonGroupInstance
3380
+ */
3381
+ /**
3382
+ * Toggle group over a container's `.btn` children.
3383
+ */
3384
+ declare class ButtonGroup extends Component {
3385
+ static defaults: {
3386
+ mode: string;
3387
+ activeClass: string;
3388
+ allowEmpty: boolean;
3389
+ onChange: any;
3390
+ };
3391
+ /**
3392
+ * @param {string|HTMLElement} selector - The group container
3393
+ * @param {ButtonGroupOptions} [options]
3394
+ */
3395
+ constructor(selector: string | HTMLElement, options?: ButtonGroupOptions);
3396
+ _init(): void;
3397
+ buttons: Element[];
3398
+ _handleClick(btn: any, index: any): void;
3399
+ /**
3400
+ * Get the current value(s)
3401
+ * @returns {number|number[]|null} Index (single) or array of indices (multiple)
3402
+ */
3403
+ getValue(): number | number[] | null;
3404
+ /**
3405
+ * Get the active button element(s)
3406
+ * @returns {HTMLElement|HTMLElement[]|null}
3407
+ */
3408
+ getActive(): HTMLElement | HTMLElement[] | null;
3409
+ /**
3410
+ * Set the active button(s) by index
3411
+ * @param {number|number[]} value - Index or array of indices
3412
+ * @returns {this}
3413
+ */
3414
+ setValue(value: number | number[]): this;
3415
+ /**
3416
+ * Toggle a specific button by index
3417
+ * @param {number} index
3418
+ * @returns {this}
3419
+ */
3420
+ toggle(index: number): this;
3421
+ /**
3422
+ * Select all buttons (multiple mode only)
3423
+ * @returns {this}
3424
+ */
3425
+ selectAll(): this;
3426
+ /**
3427
+ * Deselect all buttons
3428
+ * @returns {this}
3429
+ */
3430
+ deselectAll(): this;
3431
+ }
3432
+ /**
3433
+ * A breadcrumb. A plain string is a crumb with that text and no link.
3434
+ * @typedef {object} BreadcrumbItem
3435
+ * @property {string} text - Label (HTML)
3436
+ * @property {string} [url] - Link (default '#'); the last item is never a link
3437
+ * @property {boolean} [active] - Render as the current page
3438
+ */
3439
+ /**
3440
+ * @typedef {object} BreadcrumbsOptions
3441
+ * @property {(BreadcrumbItem|string)[]} [items=[]]
3442
+ * @property {'/'|'>'|'→'|'chevron'|string} [separator='/'] - A preset, or custom HTML
3443
+ * @property {boolean} [homeIcon=false] - Home icon on the first item
3444
+ * @property {boolean} [responsive=true] - Collapse on small screens
3445
+ * @property {((item: BreadcrumbItem|string, index: number, event: MouseEvent) => void)|null} [onChange] - A crumb link was clicked (setting it prevents navigation)
3446
+ */
3447
+ /**
3448
+ * @typedef {Breadcrumbs} BreadcrumbsInstance
3449
+ */
3450
+ /**
3451
+ * Breadcrumb trail rendered into an element.
3452
+ */
3453
+ declare class Breadcrumbs extends Component {
3454
+ static defaults: {
3455
+ items: any[];
3456
+ separator: string;
3457
+ homeIcon: boolean;
3458
+ responsive: boolean;
3459
+ onChange: any;
3460
+ };
3461
+ static separators: {
3462
+ '/': string;
3463
+ '>': string;
3464
+ '\u2192': string;
3465
+ chevron: string;
3466
+ };
3467
+ /**
3468
+ * @param {string|HTMLElement} selector - The element to render into
3469
+ * @param {BreadcrumbsOptions} [options]
3470
+ */
3471
+ constructor(selector: string | HTMLElement, options?: BreadcrumbsOptions);
3472
+ _init(): void;
3473
+ _getSeparatorHTML(): any;
3474
+ _render(): void;
3475
+ _injectStyles(): void;
3476
+ _bindEvents(): void;
3477
+ /**
3478
+ * @param {(BreadcrumbItem|string)[]} items
3479
+ * @returns {this}
3480
+ */
3481
+ setItems(items: (BreadcrumbItem | string)[]): this;
3482
+ /**
3483
+ * Append a crumb (it becomes the current page).
3484
+ * @param {BreadcrumbItem|string} item
3485
+ * @returns {this}
3486
+ */
3487
+ addItem(item: BreadcrumbItem | string): this;
3488
+ /**
3489
+ * @param {number} index
3490
+ * @returns {this}
3491
+ */
3492
+ removeItem(index: number): this;
3493
+ /**
3494
+ * @returns {(BreadcrumbItem|string)[]}
3495
+ */
3496
+ getItems(): (BreadcrumbItem | string)[];
3497
+ }
3498
+ /**
3499
+ * A navbar link; `items` makes it a dropdown (nested `items` make flyouts).
3500
+ * @typedef {object} NavbarItem
3501
+ * @property {string} [text] - Label
3502
+ * @property {string} [url] - Link
3503
+ * @property {string} [icon] - Domma icon name
3504
+ * @property {boolean} [active] - Highlighted as the current page
3505
+ * @property {boolean} [external] - Opens in a new tab
3506
+ * @property {boolean} [divider] - Inside a dropdown: a divider
3507
+ * @property {NavbarItem[]} [items] - Dropdown entries
3508
+ */
3509
+ /**
3510
+ * @typedef {object} NavbarBrand
3511
+ * @property {string} [text]
3512
+ * @property {string} [logo] - Logo image URL
3513
+ * @property {string} [url] - Brand link
3514
+ * @property {string} [html] - Brand markup instead of text/logo
3515
+ */
3516
+ /**
3517
+ * @typedef {object} NavbarAction
3518
+ * @property {string} [text]
3519
+ * @property {string} [url]
3520
+ * @property {string} [icon] - Domma icon name
3521
+ * @property {string} [variant] - Button variant ('primary', 'outline', ...)
3522
+ */
3523
+ /**
3524
+ * @typedef {object} NavbarOptions
3525
+ * @property {NavbarBrand|null} [brand=null]
3526
+ * @property {NavbarItem[]} [items=[]]
3527
+ * @property {'static'|'fixed'|'sticky'} [position='static']
3528
+ * @property {'light'|'dark'|'transparent'|string} [variant='light']
3529
+ * @property {boolean} [collapsible=true] - Hamburger menu on small screens
3530
+ * @property {number} [collapseAt=993] - Below this width (px) the bar is collapsed
3531
+ * @property {boolean} [appearOnHover=false] - Desktop: open dropdowns/flyouts on hover (click still works)
3532
+ * @property {number} [hoverCloseDelay=250] - ms of grace when the pointer leaves the bar
3533
+ * @property {NavbarAction[]} [actions=[]] - Right-side buttons
3534
+ * @property {((item: NavbarItem, index: number, event: MouseEvent, parent?: NavbarItem) => void)|null} [onItemClick] - A link was clicked (sub-items also get the parent)
3535
+ */
3536
+ /**
3537
+ * @typedef {Navbar} NavbarInstance
3538
+ */
3539
+ /**
3540
+ * Responsive navigation bar rendered into an element.
3541
+ */
3542
+ declare class Navbar extends Component {
3543
+ static defaults: {
3544
+ brand: any;
3545
+ items: any[];
3546
+ position: string;
3547
+ variant: string;
3548
+ collapsible: boolean;
3549
+ collapseAt: number;
3550
+ appearOnHover: boolean;
3551
+ hoverCloseDelay: number;
3552
+ actions: any[];
3553
+ onItemClick: any;
3554
+ };
3555
+ /**
3556
+ * @param {string|HTMLElement} selector - The element to render into
3557
+ * @param {NavbarOptions} [options]
3558
+ */
3559
+ constructor(selector: string | HTMLElement, options?: NavbarOptions);
3560
+ _isCollapsed: boolean;
3561
+ _pinned: any;
3562
+ _hoverSuppressed: any;
3563
+ _navCloseTimer: number;
3564
+ _init(): void;
3565
+ _render(): void;
3566
+ _toggle: Element;
3567
+ _collapse: Element;
3568
+ /**
3569
+ * Render a list of nav items as <li> markup, recursing into `items` so
3570
+ * dropdowns can nest to arbitrary depth.
3571
+ * depth 0 -> top-level bar items (button toggle / plain link)
3572
+ * depth >0 -> dropdown-menu entries (submenu toggle / dropdown item)
3573
+ * `pathPrefix` is the dotted index path of the parent ('' at the root),
3574
+ * emitted as data-path so click handling works at any depth.
3575
+ */
3576
+ _renderItems(list: any, depth: any, pathPrefix: any): string;
3577
+ _scanIcons(): void;
3578
+ _bindEvents(): void;
3579
+ /**
3580
+ * Open every .navbar-dropdown on the path from `target` up to the navbar - so
3581
+ * a hovered flyout keeps its parents open - and close the rest. A pinned
3582
+ * dropdown is added to that path whatever the pointer is doing, unless
3583
+ * `force` says the pin itself is being cleared.
3584
+ */
3585
+ _reconcileDropdowns(target: any, force?: boolean): void;
3586
+ /**
3587
+ * Keep an opening dropdown/flyout inside the viewport. Dropdown menus are
3588
+ * absolutely positioned (top-level opens downward at left:0; nested submenus
3589
+ * fly out at left:100%/top:0) with no built-in collision handling, so deep or
3590
+ * low menus would run off the right/bottom edge and be unreachable. On open we
3591
+ * measure and reposition: flip horizontally past the right edge, and either
3592
+ * shift a flyout up or cap+scroll a top-level list past the bottom edge.
3593
+ * Desktop only - below collapseAt the menu renders inline in the drawer.
3594
+ */
3595
+ _positionMenu(dropdown: any): void;
3596
+ /**
3597
+ * Mark one top-level item active.
3598
+ * @param {number} index
3599
+ * @returns {this}
3600
+ */
3601
+ setActive(index: number): this;
3602
+ /**
3603
+ * @param {NavbarItem[]} items
3604
+ * @returns {this}
3605
+ */
3606
+ setItems(items: NavbarItem[]): this;
3607
+ /**
3608
+ * Open the collapsed (mobile) menu.
3609
+ * @returns {this}
3610
+ */
3611
+ expand(): this;
3612
+ /**
3613
+ * Close the collapsed (mobile) menu.
3614
+ * @returns {this}
3615
+ */
3616
+ collapse(): this;
3617
+ /**
3618
+ * @returns {this}
3619
+ */
3620
+ toggle(): this;
3621
+ /**
3622
+ * @returns {boolean}
3623
+ */
3624
+ isCollapsed(): boolean;
3625
+ }
3626
+ /**
3627
+ * A sidebar entry: a link, a heading, a divider, or (with `items`) an expandable group.
3628
+ * @typedef {object} SidebarItem
3629
+ * @property {string} [text] - Label (HTML)
3630
+ * @property {string} [url] - Link
3631
+ * @property {string} [icon] - Domma icon name
3632
+ * @property {string} [section] - Section key; setActive(section) highlights it, and clicking it makes it active
3633
+ * @property {string|number} [badge] - Badge text
3634
+ * @property {string} [heading] - Render as a heading with this text
3635
+ * @property {boolean} [divider] - Render as a divider
3636
+ * @property {SidebarItem[]} [items] - Children (an expandable group)
3637
+ */
3638
+ /**
3639
+ * @typedef {object} SidebarOptions
3640
+ * @property {'left'|'right'} [position='left']
3641
+ * @property {boolean} [fixed=true] - Fixed rather than static positioning
3642
+ * @property {string} [width='250px']
3643
+ * @property {string} [top='0'] - Top offset, e.g. '60px' under a navbar
3644
+ * @property {{title?: string, toggle?: boolean, icon?: string}|null} [header=null] - Header; `toggle: false` hides its close button
3645
+ * @property {SidebarItem[]} [items=[]]
3646
+ * @property {{text?: string, html?: string}|null} [footer=null]
3647
+ * @property {'light'|'dark'|'theme'} [variant='dark'] - 'theme' follows the active theme
3648
+ * @property {boolean} [collapsible=true] - Toggle on small screens
3649
+ * @property {number} [collapseAt=768] - Breakpoint in px
3650
+ * @property {string|null} [activeSection=null] - Initially active section
3651
+ * @property {string[]} [expandedSections=[]] - Initially expanded groups (their paths)
3652
+ * @property {boolean} [persistExpanded=false] - Remember expanded groups in localStorage
3653
+ * @property {string|null} [persistKey=null] - Storage key for that
3654
+ * @property {number} [animationDuration=200] - ms
3655
+ * @property {boolean} [push=true] - Push the content aside rather than overlay it
3656
+ * @property {string} [contentSelector='.main-content'] - The content pushed aside
3657
+ * @property {boolean} [scrollSpy=false] - Track the active section while scrolling
3658
+ * @property {string} [scrollSpyOffset='-100px 0px -50% 0px'] - IntersectionObserver rootMargin
3659
+ * @property {number} [scrollSpyThreshold=0.5] - IntersectionObserver threshold
3660
+ * @property {boolean} [floating=false] - Floating toggle at the bottom left
3661
+ * @property {string|null} [customContent=null] - HTML to show instead of items
3662
+ * @property {boolean} [collapsibleDesktop=false] - Desktop collapse to icons only
3663
+ * @property {string} [collapsedWidth='60px'] - Width when collapsed
3664
+ * @property {boolean} [persistCollapsed=false] - Remember the collapsed state
3665
+ * @property {string|null} [persistCollapseKey=null] - Storage key for that
3666
+ * @property {((item: SidebarItem|null, path: string, event: MouseEvent) => void)|null} [onItemClick] - A link was clicked; path is its index path ('2.0')
3667
+ * @property {(() => boolean|void)|null} [onBeforeOpen] - Return false to keep it closed
3668
+ * @property {(() => boolean|void)|null} [onBeforeClose] - Return false to keep it open
3669
+ * @property {((isOpen: boolean) => void)|null} [onToggle] - Opened or closed
3670
+ * @property {((item?: SidebarItem, depth?: number) => void)|null} [onExpand] - A group expanded (no arguments: the desktop sidebar expanded)
3671
+ * @property {((item?: SidebarItem, depth?: number) => void)|null} [onCollapse] - A group collapsed (no arguments: the desktop sidebar collapsed)
3672
+ */
3673
+ /**
3674
+ * @typedef {Sidebar} SidebarInstance
3675
+ */
3676
+ /**
3677
+ * Navigation sidebar rendered into an element.
3678
+ */
3679
+ declare class Sidebar extends Component {
3680
+ static defaults: {
3681
+ position: string;
3682
+ fixed: boolean;
3683
+ width: string;
3684
+ top: string;
3685
+ header: any;
3686
+ items: any[];
3687
+ footer: any;
3688
+ variant: string;
3689
+ collapsible: boolean;
3690
+ collapseAt: number;
3691
+ activeSection: any;
3692
+ expandedSections: any[];
3693
+ persistExpanded: boolean;
3694
+ persistKey: any;
3695
+ animationDuration: number;
3696
+ push: boolean;
3697
+ contentSelector: string;
3698
+ scrollSpy: boolean;
3699
+ scrollSpyOffset: string;
3700
+ scrollSpyThreshold: number;
3701
+ floating: boolean;
3702
+ customContent: any;
3703
+ collapsibleDesktop: boolean;
3704
+ collapsedWidth: string;
3705
+ persistCollapsed: boolean;
3706
+ persistCollapseKey: any;
3707
+ onItemClick: any;
3708
+ onBeforeOpen: any;
3709
+ onBeforeClose: any;
3710
+ onToggle: any;
3711
+ onExpand: any;
3712
+ onCollapse: any;
3713
+ };
3714
+ /**
3715
+ * @param {string|HTMLElement} selector - The element to render into
3716
+ * @param {SidebarOptions} [options]
3717
+ */
3718
+ constructor(selector: string | HTMLElement, options?: SidebarOptions);
3719
+ _isOpen: boolean;
3720
+ _isCollapsed: boolean;
3721
+ _expandedItems: Set<any>;
3722
+ _init(): void;
3723
+ _findContentElement(): void;
3724
+ _contentElement: any;
3725
+ _handleInitialPushState(): void;
3726
+ _render(): void;
3727
+ _toggle: Element;
3728
+ _nav: Element;
3729
+ _overlay: HTMLDivElement;
3730
+ _floatingToggle: HTMLButtonElement;
3731
+ _renderItems(items: any, depth?: number, parentPath?: string): string;
3732
+ _bindEvents(): void;
3733
+ _toggleSubmenu(itemElement: any, path: any): void;
3734
+ _expandSubmenu(itemElement: any, submenu: any): void;
3735
+ _collapseSubmenu(itemElement: any, submenu: any): void;
3736
+ _getItemByPath(path: any): any;
3737
+ _scanIcons(): void;
3738
+ _loadExpandedState(): void;
3739
+ _saveExpandedState(): void;
3740
+ _loadCollapsedState(): void;
3741
+ _saveCollapsedState(): void;
3742
+ _initScrollSpy(): void;
3743
+ _scrollSpyObserver: IntersectionObserver;
3744
+ _createOverlay(): void;
3745
+ _removeOverlay(): void;
3746
+ _applyPush(): void;
3747
+ _removePush(): void;
3748
+ /**
3749
+ * Open (small screens; onBeforeOpen may refuse).
3750
+ * @returns {this}
3751
+ */
3752
+ open(): this;
3753
+ /**
3754
+ * Close (onBeforeClose may refuse).
3755
+ * @returns {this}
3756
+ */
3757
+ close(): this;
3758
+ /**
3759
+ * @returns {this}
3760
+ */
3761
+ toggle(): this;
3762
+ /**
3763
+ * @returns {boolean}
3764
+ */
3765
+ isOpen(): boolean;
3766
+ /**
3767
+ * Alias of open().
3768
+ * @param {...any} args
3769
+ * @returns {this}
3770
+ */
3771
+ show(...args: any[]): this;
3772
+ /**
3773
+ * Alias of close().
3774
+ * @param {...any} args
3775
+ * @returns {this}
3776
+ */
3777
+ hide(...args: any[]): this;
3778
+ /**
3779
+ * Alias of isOpen().
3780
+ * @returns {boolean}
3781
+ */
3782
+ isVisible(): boolean;
3783
+ /**
3784
+ * Desktop: collapse to icons only (collapsibleDesktop).
3785
+ * @returns {this}
3786
+ */
3787
+ collapse(): this;
3788
+ /**
3789
+ * Desktop: expand from icons only.
3790
+ * @returns {this}
3791
+ */
3792
+ expand(): this;
3793
+ _createFloatingToggle(): void;
3794
+ _removeFloatingToggle(): void;
3795
+ _updateToggleIcon(iconName: any): void;
3796
+ /**
3797
+ * @returns {this}
3798
+ */
3799
+ toggleCollapse(): this;
3800
+ /**
3801
+ * @returns {boolean}
3802
+ */
3803
+ isCollapsed(): boolean;
3804
+ /**
3805
+ * Highlight the links of a section.
3806
+ * @param {string} section
3807
+ * @returns {this}
3808
+ */
3809
+ setActive(section: string): this;
3810
+ /**
3811
+ * @param {SidebarItem[]} items
3812
+ * @returns {this}
3813
+ */
3814
+ setItems(items: SidebarItem[]): this;
3815
+ /**
3816
+ * @param {SidebarItem} item
3817
+ * @param {number|null} [index=null] - Position; null appends
3818
+ * @returns {this}
3819
+ */
3820
+ addItem(item: SidebarItem, index?: number | null): this;
3821
+ /**
3822
+ * @param {number} index
3823
+ * @returns {this}
3824
+ */
3825
+ removeItem(index: number): this;
3826
+ /**
3827
+ * Expand every group.
3828
+ * @returns {this}
3829
+ */
3830
+ expandAll(): this;
3831
+ /**
3832
+ * Collapse every group.
3833
+ * @returns {this}
3834
+ */
3835
+ collapseAll(): this;
3836
+ }
3837
+ /**
3838
+ * @typedef {object} FooterLink
3839
+ * @property {string} [text]
3840
+ * @property {string} [url]
3841
+ * @property {string} [icon] - Domma icon name
3842
+ */
3843
+ /**
3844
+ * @typedef {object} FooterBrand
3845
+ * @property {string} [text]
3846
+ * @property {string} [logo] - Logo image URL
3847
+ * @property {string} [url]
3848
+ * @property {string} [description]
3849
+ */
3850
+ /**
3851
+ * @typedef {object} FooterColumn
3852
+ * @property {string} [title]
3853
+ * @property {FooterLink[]} [links]
3854
+ */
3855
+ /**
3856
+ * @typedef {object} FooterSocial
3857
+ * @property {string} icon - Domma icon name
3858
+ * @property {string} [url]
3859
+ * @property {string} [label] - Accessible name (default: the icon name)
3860
+ */
3861
+ /**
3862
+ * @typedef {object} FooterOptions
3863
+ * @property {'light'|'dark'|'transparent'|string} [variant='light']
3864
+ * @property {'simple'|'columns'|'minimal'} [layout='simple']
3865
+ * @property {FooterBrand|null} [brand=null]
3866
+ * @property {FooterColumn[]} [columns=[]] - For the 'columns' layout
3867
+ * @property {FooterLink[]} [links=[]] - Simple link list
3868
+ * @property {FooterSocial[]} [social=[]] - Social icons
3869
+ * @property {string|{text?: string, year?: number}|null} [copyright=null] - Text, or the year for '© <year> All rights reserved'
3870
+ * @property {string} [className=''] - Extra classes
3871
+ * @property {'static'|'fixed'|'sticky'} [position='static']
3872
+ */
3873
+ /**
3874
+ * @typedef {Footer} FooterInstance
3875
+ */
3876
+ /**
3877
+ * Site footer rendered into an element.
3878
+ */
3879
+ declare class Footer extends Component {
3880
+ static defaults: {
3881
+ variant: string;
3882
+ layout: string;
3883
+ brand: any;
3884
+ columns: any[];
3885
+ links: any[];
3886
+ social: any[];
3887
+ copyright: any;
3888
+ className: string;
3889
+ position: string;
3890
+ };
3891
+ /**
3892
+ * @param {string|HTMLElement} selector - The element to render into
3893
+ * @param {FooterOptions} [options]
3894
+ */
3895
+ constructor(selector: string | HTMLElement, options?: FooterOptions);
3896
+ _init(): void;
3897
+ _render(): void;
3898
+ _renderSimpleLayout(brand: any, links: any, social: any, copyright: any): string;
3899
+ _renderColumnsLayout(brand: any, columns: any, social: any, copyright: any): string;
3900
+ _renderMinimalLayout(copyright: any, social: any): string;
3901
+ _renderSocial(social: any): string;
3902
+ _renderCopyright(copyright: any): string;
3903
+ _scanIcons(): void;
3904
+ /**
3905
+ * @param {FooterBrand|null} brand
3906
+ * @returns {this}
3907
+ */
3908
+ setBrand(brand: FooterBrand | null): this;
3909
+ /**
3910
+ * @param {FooterLink[]} links
3911
+ * @returns {this}
3912
+ */
3913
+ setLinks(links: FooterLink[]): this;
3914
+ /**
3915
+ * @param {FooterColumn[]} columns
3916
+ * @returns {this}
3917
+ */
3918
+ setColumns(columns: FooterColumn[]): this;
3919
+ /**
3920
+ * @param {FooterSocial[]} social
3921
+ * @returns {this}
3922
+ */
3923
+ setSocial(social: FooterSocial[]): this;
3924
+ /**
3925
+ * @param {string|{text?: string, year?: number}|null} copyright
3926
+ * @returns {this}
3927
+ */
3928
+ setCopyright(copyright: string | {
3929
+ text?: string;
3930
+ year?: number;
3931
+ } | null): this;
3932
+ }
3933
+ /**
3934
+ * A suggestion: a string, or an object shown by `label` and written as `value`.
3935
+ * @typedef {string|{label?: string, value?: string, [key: string]: any}} AutocompleteItem
3936
+ */
3937
+ /**
3938
+ * @typedef {object} AutocompleteOptions
3939
+ * @property {AutocompleteItem[]} [data=[]] - Suggestions to filter
3940
+ * @property {((query: string) => AutocompleteItem[]|Promise<AutocompleteItem[]>)|null} [dataSource=null] - Fetch suggestions instead of filtering data
3941
+ * @property {number} [minChars=1] - Characters typed before suggesting
3942
+ * @property {number} [maxResults=10]
3943
+ * @property {number} [debounce=300] - ms
3944
+ * @property {((item: AutocompleteItem, query: string) => boolean)|null} [filterFn=null] - Replaces the default contains-match
3945
+ * @property {((item: AutocompleteItem, query: string) => string|Node)|null} [renderItem=null] - Suggestion HTML or a node
3946
+ * @property {boolean} [highlightMatches=true]
3947
+ * @property {'auto'|'above'|'below'} [position='auto'] - Where the list opens; 'auto' picks the side with room
3948
+ * @property {string} [placeholder='']
3949
+ * @property {string} [emptyMessage='No results found']
3950
+ * @property {string} [loadingMessage='Loading...']
3951
+ * @property {boolean} [caseSensitive=false]
3952
+ * @property {boolean} [selectOnEnter=true]
3953
+ * @property {boolean} [clearOnSelect=false] - Empty the input after a choice
3954
+ * @property {any} [model] - A Domma Model the typed value is written to (with modelKey)
3955
+ * @property {string} [modelKey]
3956
+ * @property {((item: AutocompleteItem, event: {target: HTMLElement}) => void)|null} [onSelect] - A suggestion was chosen
3957
+ * @property {((value: string, event: Event) => void)|null} [onChange] - The input's value changed
3958
+ * @property {(() => boolean|void)|null} [onBeforeOpen] - Return false to keep it closed
3959
+ * @property {(() => void)|null} [onOpen]
3960
+ * @property {(() => boolean|void)|null} [onBeforeClose] - Return false to keep it open
3961
+ * @property {(() => void)|null} [onClose]
3962
+ * @property {((results: AutocompleteItem[], query: string) => AutocompleteItem[]|void)|null} [onFilter] - May return a replacement result list
3963
+ */
3964
+ /**
3965
+ * @typedef {Autocomplete} AutocompleteInstance
3966
+ */
3967
+ /**
3968
+ * Suggestions under a text input.
3969
+ */
3970
+ declare class Autocomplete extends Component {
3971
+ static defaults: {
3972
+ data: any[];
3973
+ dataSource: any;
3974
+ minChars: number;
3975
+ maxResults: number;
3976
+ debounce: number;
3977
+ filterFn: any;
3978
+ renderItem: any;
3979
+ highlightMatches: boolean;
3980
+ position: string;
3981
+ placeholder: string;
3982
+ emptyMessage: string;
3983
+ loadingMessage: string;
3984
+ caseSensitive: boolean;
3985
+ selectOnEnter: boolean;
3986
+ clearOnSelect: boolean;
3987
+ onSelect: any;
3988
+ onChange: any;
3989
+ onBeforeOpen: any;
3990
+ onOpen: any;
3991
+ onBeforeClose: any;
3992
+ onClose: any;
3993
+ onFilter: any;
3994
+ };
3995
+ /**
3996
+ * @param {string|HTMLElement} selector - The input
3997
+ * @param {AutocompleteOptions} [options]
3998
+ */
3999
+ constructor(selector: string | HTMLElement, options?: AutocompleteOptions);
4000
+ model: any;
4001
+ modelKey: string;
4002
+ _isOpen: boolean;
4003
+ _activeIndex: number;
4004
+ _filteredData: any[];
4005
+ _loading: boolean;
4006
+ _debounceTimer: number;
4007
+ _dropdown: HTMLDivElement;
4008
+ _list: HTMLUListElement;
4009
+ _loadingEl: HTMLDivElement;
4010
+ _emptyEl: HTMLDivElement;
4011
+ _modelUnsubscribe: any;
4012
+ _init(): void;
4013
+ _createDropdown(): void;
4014
+ _bindEvents(): void;
4015
+ _handleInput(e: any): void;
4016
+ _handleKeydown(e: any): void;
4017
+ _filterData(query: any): Promise<void>;
4018
+ _defaultFilter(item: any, query: any): any;
4019
+ _renderResults(query: any): void;
4020
+ _highlightMatch(text: any, query: any): any;
4021
+ _escapeRegex(str: any): any;
4022
+ _updateActive(): void;
4023
+ _selectItem(index: any): void;
4024
+ _setLoading(loading: any): void;
4025
+ _updatePosition(): void;
4026
+ /**
4027
+ * @returns {this}
4028
+ */
4029
+ open(): this;
4030
+ /**
4031
+ * @returns {this}
4032
+ */
4033
+ close(): this;
4034
+ /**
4035
+ * @returns {this}
4036
+ */
4037
+ toggle(): this;
4038
+ /**
4039
+ * @returns {boolean}
4040
+ */
4041
+ isOpen(): boolean;
4042
+ /**
4043
+ * Alias of open().
4044
+ * @param {...any} args
4045
+ * @returns {this}
4046
+ */
4047
+ show(...args: any[]): this;
4048
+ /**
4049
+ * Alias of close().
4050
+ * @param {...any} args
4051
+ * @returns {this}
4052
+ */
4053
+ hide(...args: any[]): this;
4054
+ /**
4055
+ * Alias of isOpen().
4056
+ * @returns {boolean}
4057
+ */
4058
+ isVisible(): boolean;
4059
+ /**
4060
+ * Set the input's value (no events).
4061
+ * @param {string} value
4062
+ * @returns {this}
4063
+ */
4064
+ setValue(value: string): this;
4065
+ /**
4066
+ * @returns {string}
4067
+ */
4068
+ getValue(): string;
4069
+ /**
4070
+ * Replace the suggestions.
4071
+ * @param {AutocompleteItem[]} data
4072
+ * @returns {this}
4073
+ */
4074
+ setData(data: AutocompleteItem[]): this;
4075
+ /**
4076
+ * Filter again for the current value.
4077
+ * @returns {this}
4078
+ */
4079
+ refresh(): this;
4080
+ /**
4081
+ * @returns {this}
4082
+ */
4083
+ focus(): this;
4084
+ /**
4085
+ * Empty the input and close the list.
4086
+ * @returns {this}
4087
+ */
4088
+ clearValue(): this;
4089
+ }
4090
+ /**
4091
+ * An option: a string, or an object shown by `label` and stored as `value`.
4092
+ * @typedef {string|{value: string, label?: string, disabled?: boolean, [key: string]: any}} PillboxItem
4093
+ */
4094
+ /**
4095
+ * @typedef {object} PillboxOptions
4096
+ * @property {PillboxItem[]} [data=[]] - Options to choose from
4097
+ * @property {string[]} [value=[]] - Initial values
4098
+ * @property {string} [placeholder='Add items...']
4099
+ * @property {boolean} [searchable=true] - Filter the options while typing
4100
+ * @property {boolean} [creatable=false] - Enter adds typed text that is not an option
4101
+ * @property {number|null} [maxItems=null]
4102
+ * @property {boolean} [duplicates=false]
4103
+ * @property {boolean} [clearable=true] - Clear-all button
4104
+ * @property {'small'|'medium'|'large'|string} [size='medium']
4105
+ * @property {((pill: {value: string, label: string}) => string|Node)|null} [renderPill=null] - Pill HTML or a node
4106
+ * @property {((item: PillboxItem) => string|Node)|null} [renderOption=null] - Option HTML or a node
4107
+ * @property {string} [pillTemplate='<span>{label}</span>'] - Pill HTML when there is no renderPill
4108
+ * @property {((value: string) => boolean|string|void)|null} [validatePill=null] - true/undefined accepts; a string is the error message
4109
+ * @property {string} [maxItemsMessage='Maximum {max} items allowed']
4110
+ * @property {string} [duplicateMessage='Item already exists']
4111
+ * @property {string} [noResultsMessage='No results found']
4112
+ * @property {any} [model] - A Domma Model the values are kept in (with modelKey)
4113
+ * @property {string} [modelKey]
4114
+ * @property {(() => boolean|void)|null} [onBeforeOpen] - Return false to keep it closed
4115
+ * @property {(() => void)|null} [onOpen]
4116
+ * @property {(() => boolean|void)|null} [onBeforeClose] - Return false to keep it open
4117
+ * @property {(() => void)|null} [onClose]
4118
+ * @property {((value: string, pill: HTMLElement) => void)|null} [onAdd]
4119
+ * @property {((value: string, pill: HTMLElement) => void)|null} [onRemove]
4120
+ * @property {((values: string[]) => void)|null} [onChange]
4121
+ * @property {((text: string) => void)|null} [onCreate] - Typed text was added (creatable)
4122
+ * @property {(() => void)|null} [onMaxReached]
4123
+ * @property {((error: string, value: string) => void)|null} [onValidationError]
4124
+ */
4125
+ /**
4126
+ * @typedef {Pillbox} PillboxInstance
4127
+ */
4128
+ /**
4129
+ * Multi-value input that shows each value as a removable pill.
4130
+ */
4131
+ declare class Pillbox extends Component {
4132
+ static defaults: {
4133
+ data: any[];
4134
+ value: any[];
4135
+ placeholder: string;
4136
+ searchable: boolean;
4137
+ creatable: boolean;
4138
+ maxItems: any;
4139
+ duplicates: boolean;
4140
+ clearable: boolean;
4141
+ size: string;
4142
+ renderPill: any;
4143
+ renderOption: any;
4144
+ pillTemplate: string;
4145
+ validatePill: any;
4146
+ maxItemsMessage: string;
4147
+ duplicateMessage: string;
4148
+ noResultsMessage: string;
4149
+ onBeforeOpen: any;
4150
+ onOpen: any;
4151
+ onBeforeClose: any;
4152
+ onClose: any;
4153
+ onAdd: any;
4154
+ onRemove: any;
4155
+ onChange: any;
4156
+ onCreate: any;
4157
+ onMaxReached: any;
4158
+ onValidationError: any;
4159
+ };
4160
+ /**
4161
+ * @param {string|HTMLElement} selector - The input (or select) to enhance
4162
+ * @param {PillboxOptions} [options]
4163
+ */
4164
+ constructor(selector: string | HTMLElement, options?: PillboxOptions);
4165
+ model: any;
4166
+ modelKey: string;
4167
+ _pills: any[];
4168
+ _isOpen: boolean;
4169
+ _activeIndex: number;
4170
+ _container: HTMLDivElement;
4171
+ _input: HTMLInputElement;
4172
+ _clearBtn: HTMLButtonElement;
4173
+ _dropdown: HTMLDivElement;
4174
+ _optionsList: HTMLUListElement;
4175
+ _filteredData: any[];
4176
+ _modelUnsubscribe: any;
4177
+ _init(): void;
4178
+ _createStructure(): void;
4179
+ _wrapper: HTMLDivElement;
4180
+ _bindEvents(): void;
4181
+ _handleInput(e: any): void;
4182
+ _handleKeydown(e: any): void;
4183
+ _filterOptions(query: any): void;
4184
+ _renderOptions(): void;
4185
+ _updateActive(): void;
4186
+ _selectOption(index: any): void;
4187
+ _createPill(text: any): void;
4188
+ _addPill(value: any, label: any): void;
4189
+ _removePill(pillElement: any): void;
4190
+ _validate(value: any): any;
4191
+ _findItemByValue(value: any): any;
4192
+ _updateHiddenInput(): void;
4193
+ _triggerChange(): void;
4194
+ /**
4195
+ * @returns {this}
4196
+ */
4197
+ open(): this;
4198
+ /**
4199
+ * @returns {this}
4200
+ */
4201
+ close(): this;
4202
+ /**
4203
+ * @returns {this}
4204
+ */
4205
+ toggle(): this;
4206
+ /**
4207
+ * @returns {boolean}
4208
+ */
4209
+ isOpen(): boolean;
4210
+ /**
4211
+ * Alias of open().
4212
+ * @param {...any} args
4213
+ * @returns {this}
4214
+ */
4215
+ show(...args: any[]): this;
4216
+ /**
4217
+ * Alias of close().
4218
+ * @param {...any} args
4219
+ * @returns {this}
4220
+ */
4221
+ hide(...args: any[]): this;
4222
+ /**
4223
+ * Alias of isOpen().
4224
+ * @returns {boolean}
4225
+ */
4226
+ isVisible(): boolean;
4227
+ /**
4228
+ * The pill values, in order.
4229
+ * @returns {string[]}
4230
+ */
4231
+ getValue(): string[];
4232
+ /**
4233
+ * Replace every pill.
4234
+ * @param {string[]} values
4235
+ * @returns {this}
4236
+ */
4237
+ setValue(values: string[]): this;
4238
+ /**
4239
+ * @param {string} value
4240
+ * @param {string} [label] - Default: the value
4241
+ * @returns {this}
4242
+ */
4243
+ addPill(value: string, label?: string): this;
4244
+ /**
4245
+ * @param {string} value
4246
+ * @returns {this}
4247
+ */
4248
+ removePill(value: string): this;
4249
+ /**
4250
+ * @param {number} index
4251
+ * @returns {this}
4252
+ */
4253
+ removePillAt(index: number): this;
4254
+ /**
4255
+ * Remove every pill.
4256
+ * @returns {this}
4257
+ */
4258
+ clear(): this;
4259
+ /**
4260
+ * @returns {number}
4261
+ */
4262
+ getCount(): number;
4263
+ /**
4264
+ * Replace the options.
4265
+ * @param {PillboxItem[]} data
4266
+ * @returns {this}
4267
+ */
4268
+ setData(data: PillboxItem[]): this;
4269
+ /**
4270
+ * @returns {this}
4271
+ */
4272
+ focus(): this;
4273
+ /**
4274
+ * @returns {this}
4275
+ */
4276
+ enable(): this;
4277
+ /**
4278
+ * @returns {this}
4279
+ */
4280
+ disable(): this;
4281
+ }
4282
+ /**
4283
+ * @typedef {'sm'|'md'|'lg'|'xl'|'full'} SlideoverSize
4284
+ */
4285
+ /**
4286
+ * @typedef {object} SlideoverOptions
4287
+ * @property {'left'|'right'|'top'|'bottom'} [position='right'] - Edge it slides from
4288
+ * @property {SlideoverSize|string} [size='lg'] - A preset (sm 25%, md 50%, lg 75%, xl 90%, full), a customSizes key, or a CSS length ('400px', '60%', '30rem')
4289
+ * @property {boolean} [backdrop=true]
4290
+ * @property {boolean} [backdropClose=true] - A backdrop click closes it
4291
+ * @property {boolean} [keyboard=true] - Esc closes it (with closeOnEscape)
4292
+ * @property {boolean} [animation=true]
4293
+ * @property {number} [animationDuration=300] - ms
4294
+ * @property {boolean} [closeOnEscape=true]
4295
+ * @property {string} [title=''] - Title (create(): the header text)
4296
+ * @property {string|Element} [content=''] - Body (create(): HTML or an element)
4297
+ * @property {boolean} [closable=true] - Close button in the header (create())
4298
+ * @property {string} [closeIcon='x'] - Domma icon name for it (create())
4299
+ * @property {string} [headerClass='']
4300
+ * @property {string} [bodyClass='']
4301
+ * @property {string} [footerClass='']
4302
+ * @property {Record<string, string>} [customSizes={}] - Named sizes, e.g. {wide: '640px'}
4303
+ * @property {boolean} [trapFocus=true] - Tab stays in the panel; default off when backdrop is false unless given
4304
+ * @property {boolean} [returnFocus=true] - Closing puts focus back where it was
4305
+ * @property {((slideover: SlideoverInstance) => boolean|void)|null} [onBeforeOpen] - Return false to keep it closed
4306
+ * @property {((slideover: SlideoverInstance) => void)|null} [onOpen]
4307
+ * @property {((slideover: SlideoverInstance) => boolean|void)|null} [onBeforeClose] - Return false to keep it open
4308
+ * @property {((slideover: SlideoverInstance) => void)|null} [onClose] - Closing (before the animation)
4309
+ * @property {((slideover: SlideoverInstance) => void)|null} [onClosed] - After the close animation
4310
+ */
4311
+ /**
4312
+ * Options for `E.slideover({...})` / `Slideover.create()`: a new panel at the end of `<body>`.
4313
+ * @typedef {SlideoverOptions & {schema?: object, data?: Record<string, any>, onSave?: (formData: Record<string, any>, form: any, slideover: SlideoverInstance) => void}} SlideoverCreateOptions
4314
+ */
4315
+ /**
4316
+ * @typedef {Slideover} SlideoverInstance
4317
+ */
4318
+ /**
4319
+ * Panel that slides in from an edge of the viewport.
4320
+ */
4321
+ declare class Slideover extends Component {
4322
+ /**
4323
+ * Open slideovers, oldest first. Escape closes only the last one: every
4324
+ * open slideover listens on document, so without this one key press
4325
+ * closed the whole stack.
4326
+ */
4327
+ static _stack: any[];
4328
+ /** The top-most slideover that is still open and on the page. */
4329
+ static _top(): any;
4330
+ /** Drop slideovers that were closed or taken off the page without close(). */
4331
+ static _prune(): void;
4332
+ static _removeFromStack(instance: any): void;
4333
+ static defaults: {
4334
+ position: string;
4335
+ size: string;
4336
+ backdrop: boolean;
4337
+ backdropClose: boolean;
4338
+ keyboard: boolean;
4339
+ animation: boolean;
4340
+ animationDuration: number;
4341
+ closeOnEscape: boolean;
4342
+ title: string;
4343
+ content: string;
4344
+ closable: boolean;
4345
+ closeIcon: string;
4346
+ headerClass: string;
4347
+ bodyClass: string;
4348
+ footerClass: string;
4349
+ customSizes: {};
4350
+ trapFocus: boolean;
4351
+ returnFocus: boolean;
4352
+ onBeforeOpen: any;
4353
+ onOpen: any;
4354
+ onBeforeClose: any;
4355
+ onClose: any;
4356
+ onClosed: any;
4357
+ };
4358
+ /**
4359
+ * Build a slideover (header, close button, body) at the end of `<body>`. With `schema`, the body
4360
+ * is a Domma form built on open, and `onSave` gets its data.
4361
+ * @param {SlideoverCreateOptions} [options]
4362
+ * @returns {Slideover}
4363
+ */
4364
+ static create(options?: SlideoverCreateOptions): Slideover;
4365
+ /**
4366
+ * @param {string|HTMLElement} selector - The panel element
4367
+ * @param {SlideoverOptions} [options]
4368
+ */
4369
+ constructor(selector: string | HTMLElement, options?: SlideoverOptions);
4370
+ _isOpen: boolean;
4371
+ _backdrop: HTMLDivElement;
4372
+ _trap: FocusTrap;
4373
+ _trapAsked: boolean;
4374
+ _originalBodyOverflow: string;
4375
+ _keydownHandler: (e: any) => void;
4376
+ _init(): void;
4377
+ _setupElement(): void;
4378
+ _applyPosition(): void;
4379
+ _applySize(): void;
4380
+ _getSizeValue(): any;
4381
+ _applyAnimation(): void;
4382
+ _getBoxShadow(): "2px 0 8px rgba(0,0,0,0.15)" | "-2px 0 8px rgba(0,0,0,0.15)" | "0 2px 8px rgba(0,0,0,0.15)" | "0 -2px 8px rgba(0,0,0,0.15)";
4383
+ _bindEvents(): void;
4384
+ _createBackdrop(): void;
4385
+ _showBackdrop(): void;
4386
+ _hideBackdrop(): void;
4387
+ _getOpenPosition(): {
4388
+ left: string;
4389
+ right: string;
4390
+ top?: undefined;
4391
+ bottom?: undefined;
4392
+ } | {
4393
+ top: string;
4394
+ bottom: string;
4395
+ left?: undefined;
4396
+ right?: undefined;
4397
+ };
4398
+ /**
4399
+ * Open (onBeforeOpen may refuse).
4400
+ * @returns {this}
4401
+ */
4402
+ open(): this;
4403
+ /** Whether this open traps focus: on by default, except beside a page left usable (no backdrop). */
4404
+ _wantsTrap(): boolean;
4405
+ /**
4406
+ * Keep Tab inside the panel while it is open. Focus moves to the panel itself (so
4407
+ * the first Tab reaches its first control) unless something inside already has it;
4408
+ * a caller focusing a field after open() is unaffected.
4409
+ */
4410
+ _startTrap(): void;
4411
+ _addedTabindex: boolean;
4412
+ _stopTrap(): void;
4413
+ _createForm(): void;
4414
+ _formaForm: any;
4415
+ /**
4416
+ * Close (onBeforeClose may refuse).
4417
+ * @returns {this}
4418
+ */
4419
+ close(): this;
4420
+ /**
4421
+ * @returns {this}
4422
+ */
4423
+ toggle(): this;
4424
+ /**
4425
+ * @returns {boolean}
4426
+ */
4427
+ isOpen(): boolean;
4428
+ /**
4429
+ * Alias of open().
4430
+ * @param {...any} args
4431
+ * @returns {this}
4432
+ */
4433
+ show(...args: any[]): this;
4434
+ /**
4435
+ * Alias of close().
4436
+ * @param {...any} args
4437
+ * @returns {this}
4438
+ */
4439
+ hide(...args: any[]): this;
4440
+ /**
4441
+ * Alias of isOpen().
4442
+ * @returns {boolean}
4443
+ */
4444
+ isVisible(): boolean;
4445
+ /**
4446
+ * @param {string} title - Set as text
4447
+ * @returns {this}
4448
+ */
4449
+ setTitle(title: string): this;
4450
+ /**
4451
+ * Replace the body: an HTML string (sanitised) or an element.
4452
+ * @param {string|Element} content
4453
+ * @returns {this}
4454
+ */
4455
+ setContent(content: string | Element): this;
4456
+ /**
4457
+ * @param {SlideoverSize|string} size
4458
+ * @returns {this}
4459
+ */
4460
+ setSize(size: SlideoverSize | string): this;
4461
+ /**
4462
+ * @param {'left'|'right'|'top'|'bottom'} position
4463
+ * @returns {this}
4464
+ */
4465
+ setPosition(position: "left" | "right" | "top" | "bottom"): this;
4466
+ }
4467
+ /**
4468
+ * @typedef {'planned'|'in-progress'|'completed'|'blocked'|'cancelled'} ProgressionStatus
4469
+ */
4470
+ /**
4471
+ * A timeline event or roadmap milestone.
4472
+ * @typedef {object} ProgressionItem
4473
+ * @property {string|number} [id] - Lets methods find it by id instead of index
4474
+ * @property {string} [title]
4475
+ * @property {string} [description] - Text (HTML when allowHtml, sanitised)
4476
+ * @property {string} [date]
4477
+ * @property {string|number} [year] - Timeline marker (default: date)
4478
+ * @property {ProgressionStatus|string} [status] - Roadmap status
4479
+ * @property {number} [progress] - 0-100, shown for 'in-progress'
4480
+ * @property {string} [priority]
4481
+ * @property {string[]} [tags]
4482
+ * @property {string} [assignee]
4483
+ */
4484
+ /**
4485
+ * @typedef {object} ProgressionOptions
4486
+ * @property {'timeline'|'roadmap'} [mode='timeline']
4487
+ * @property {ProgressionItem[]} [items=[]]
4488
+ * @property {'vertical'|'horizontal'|'centered'} [layout='vertical']
4489
+ * @property {boolean} [animation=true] - Items animate in
4490
+ * @property {number} [animationDelay=100] - ms between items
4491
+ * @property {boolean} [responsive=true]
4492
+ * @property {'default'|'minimal'|'corporate'|'modern'} [theme='default']
4493
+ * @property {boolean} [clickable=false]
4494
+ * @property {((item: ProgressionItem, index: number, element: HTMLElement) => void)|null} [onItemClick]
4495
+ * @property {boolean} [allowHtml=false] - HTML in descriptions (sanitised)
4496
+ * @property {string} [yearWidth='80px'] - Timeline
4497
+ * @property {string} [contentMaxWidth='600px'] - Timeline
4498
+ * @property {string} [dateFormat='YYYY'] - Timeline
4499
+ * @property {boolean} [showConnector=true] - Timeline
4500
+ * @property {boolean} [showProgress=true] - Roadmap: overall progress bar
4501
+ * @property {'top'|'bottom'|'none'} [progressPosition='top'] - Roadmap
4502
+ * @property {boolean} [statusIcons=true] - Roadmap
4503
+ * @property {boolean} [allowStatusChange=false] - Roadmap: status can be changed from the UI
4504
+ * @property {((item: ProgressionItem, oldStatus: string|undefined, status: string) => void)|null} [onStatusChange]
4505
+ * @property {string|number|null} [currentItem=null] - Roadmap: the current item's id or index
4506
+ * @property {boolean} [completedAnimation=true]
4507
+ * @property {Partial<Record<ProgressionStatus, string>>} [icons] - Domma icon name per status
4508
+ * @property {Partial<Record<ProgressionStatus, string>>} [colors] - CSS colour per status
4509
+ */
4510
+ /**
4511
+ * @typedef {Progression} ProgressionInstance
4512
+ */
4513
+ /**
4514
+ * Progression Component - Unified timeline and roadmap component
4515
+ * Features: Timeline mode (chronological events), Roadmap mode (status-driven milestones)
4516
+ * Layouts: vertical, horizontal, centered
4517
+ * Backwards compatible with Timeline component
4518
+ */
4519
+ declare class Progression extends Component {
4520
+ static defaults: {
4521
+ mode: string;
4522
+ items: any[];
4523
+ layout: string;
4524
+ animation: boolean;
4525
+ animationDelay: number;
4526
+ responsive: boolean;
4527
+ theme: string;
4528
+ clickable: boolean;
4529
+ onItemClick: any;
4530
+ allowHtml: boolean;
4531
+ yearWidth: string;
4532
+ contentMaxWidth: string;
4533
+ dateFormat: string;
4534
+ showConnector: boolean;
4535
+ showProgress: boolean;
4536
+ progressPosition: string;
4537
+ statusIcons: boolean;
4538
+ allowStatusChange: boolean;
4539
+ onStatusChange: any;
4540
+ currentItem: any;
4541
+ completedAnimation: boolean;
4542
+ icons: {
4543
+ planned: string;
4544
+ 'in-progress': string;
4545
+ completed: string;
4546
+ blocked: string;
4547
+ cancelled: string;
4548
+ };
4549
+ colors: {
4550
+ planned: string;
4551
+ 'in-progress': string;
4552
+ completed: string;
4553
+ blocked: string;
4554
+ cancelled: string;
4555
+ };
4556
+ };
4557
+ /**
4558
+ * @param {string|HTMLElement} selector - The element to render into
4559
+ * @param {ProgressionOptions} [options]
4560
+ */
4561
+ constructor(selector: string | HTMLElement, options?: ProgressionOptions);
4562
+ _init(): void;
4563
+ _renderItems(): void;
4564
+ _renderTimelineItem(item: any, index: any): HTMLDivElement;
4565
+ _renderRoadmapItem(item: any, index: any): HTMLDivElement;
4566
+ _renderProgressBar(): void;
4567
+ _attachEvents(): void;
4568
+ _cycleStatus(item: any, index: any): void;
4569
+ _animateItems(): void;
4570
+ _escapeHtml(text: any): string;
4571
+ _sanitizeHtml(html: any): any;
4572
+ _renderContent(content: any): any;
4573
+ _findItemIndex(indexOrId: any): any;
4574
+ /**
4575
+ * @param {ProgressionItem[]} items
4576
+ * @returns {this}
4577
+ */
4578
+ setItems(items: ProgressionItem[]): this;
4579
+ /**
4580
+ * @param {ProgressionItem} item
4581
+ * @returns {this}
4582
+ */
4583
+ addItem(item: ProgressionItem): this;
4584
+ /**
4585
+ * @returns {ProgressionItem[]}
4586
+ */
4587
+ getItems(): ProgressionItem[];
4588
+ /**
4589
+ * A copy of an item, by index or id.
4590
+ * @param {number|string} indexOrId
4591
+ * @returns {ProgressionItem|null}
4592
+ */
4593
+ getItem(indexOrId: number | string): ProgressionItem | null;
4594
+ /**
4595
+ * Merge data into an item.
4596
+ * @param {number|string} indexOrId
4597
+ * @param {Partial<ProgressionItem>} data
4598
+ * @returns {this}
4599
+ */
4600
+ updateItem(indexOrId: number | string, data: Partial<ProgressionItem>): this;
4601
+ /**
4602
+ * @param {number|string} indexOrId
4603
+ * @returns {this}
4604
+ */
4605
+ removeItem(indexOrId: number | string): this;
4606
+ /**
4607
+ * @param {'vertical'|'horizontal'|'centered'} layout
4608
+ * @returns {this}
4609
+ */
4610
+ setLayout(layout: "vertical" | "horizontal" | "centered"): this;
4611
+ /**
4612
+ * @param {'default'|'minimal'|'corporate'|'modern'} theme
4613
+ * @returns {this}
4614
+ */
4615
+ setTheme(theme: "default" | "minimal" | "corporate" | "modern"): this;
4616
+ /**
4617
+ * @param {'timeline'|'roadmap'} mode
4618
+ * @returns {this}
4619
+ */
4620
+ setMode(mode: "timeline" | "roadmap"): this;
4621
+ /**
4622
+ * @returns {'timeline'|'roadmap'}
4623
+ */
4624
+ getMode(): "timeline" | "roadmap";
4625
+ /**
4626
+ * Re-render the items.
4627
+ * @returns {this}
4628
+ */
4629
+ refresh(): this;
4630
+ /**
4631
+ * Roadmap: set an item's status (fires statuschange).
4632
+ * @param {number|string} indexOrId
4633
+ * @param {ProgressionStatus|string} status
4634
+ * @returns {this}
4635
+ */
4636
+ setStatus(indexOrId: number | string, status: ProgressionStatus | string): this;
4637
+ /**
4638
+ * @param {number|string} indexOrId
4639
+ * @returns {string|null}
4640
+ */
4641
+ getStatus(indexOrId: number | string): string | null;
4642
+ /**
4643
+ * @param {ProgressionStatus|string} status
4644
+ * @returns {ProgressionItem[]}
4645
+ */
4646
+ getItemsByStatus(status: ProgressionStatus | string): ProgressionItem[];
4647
+ /**
4648
+ * Roadmap: mark the current item.
4649
+ * @param {number|string} indexOrId
4650
+ * @returns {this}
4651
+ */
4652
+ setCurrent(indexOrId: number | string): this;
4653
+ /**
4654
+ * @returns {ProgressionItem|null}
4655
+ */
4656
+ getCurrent(): ProgressionItem | null;
4657
+ /**
4658
+ * Roadmap: percentage of items completed (0 in timeline mode).
4659
+ * @returns {number}
4660
+ */
4661
+ getProgress(): number;
4662
+ /**
4663
+ * @param {number|string} indexOrId
4664
+ * @returns {this}
4665
+ */
4666
+ markComplete(indexOrId: number | string): this;
4667
+ /**
4668
+ * @param {number|string} indexOrId
4669
+ * @returns {this}
4670
+ */
4671
+ markInProgress(indexOrId: number | string): this;
4672
+ /**
4673
+ * @param {number|string} indexOrId
4674
+ * @returns {this}
4675
+ */
4676
+ markBlocked(indexOrId: number | string): this;
4677
+ }
4678
+ /**
4679
+ * A drawn stroke, as onBegin / onEnd receive it.
4680
+ * @typedef {object} SignatureStroke
4681
+ * @property {{x: number, y: number, pressure: number}[]} points
4682
+ * @property {string} colour
4683
+ * @property {number} width
4684
+ */
4685
+ /**
4686
+ * @typedef {object} SignatureOptions
4687
+ * @property {number|null} [width=null] - Not read: the pad fills its container
4688
+ * @property {number} [height=180] - Canvas height in px
4689
+ * @property {string} [penColour='#000000'] - Default pen colour
4690
+ * @property {number} [penWidth=2] - Default pen width in px
4691
+ * @property {'png'|'svg'} [format='png'] - Export format
4692
+ * @property {string} [label='Signature'] - Toolbar label text
4693
+ * @property {boolean} [guideLine=true] - Dashed guide line
4694
+ * @property {string} [placeholder='Sign here']
4695
+ * @property {string[]} [colours] - Colour swatches in the toolbar
4696
+ * @property {number[]} [widths=[1, 2, 4]] - Pen widths in the toolbar
4697
+ * @property {boolean} [toolbar=true] - Show the toolbar
4698
+ * @property {string} [name='signature'] - Name of the hidden input
4699
+ * @property {boolean} [disabled=false]
4700
+ * @property {boolean} [typeFallback=false] - Draw / Type toggle
4701
+ * @property {number} [minStrokeLength=3] - Points needed to keep a stroke
4702
+ * @property {boolean} [respectMotionPreference=true] - Honour prefers-reduced-motion
4703
+ * @property {((base64: string) => void)|null} [onChange] - The signature changed - receives the data URL ('' when empty)
4704
+ * @property {(() => void)|null} [onClear]
4705
+ * @property {((stroke: SignatureStroke) => void)|null} [onBegin] - A stroke began
4706
+ * @property {((stroke: SignatureStroke) => void)|null} [onEnd] - A stroke ended
4707
+ */
4708
+ /**
4709
+ * @typedef {Signature} SignatureInstance
4710
+ */
4711
+ /**
4712
+ * Signature capture pad on a canvas, with an optional typed fallback.
4713
+ */
4714
+ declare class Signature extends Component {
4715
+ static defaults: {
4716
+ width: any;
4717
+ height: number;
4718
+ penColour: string;
4719
+ penWidth: number;
4720
+ format: string;
4721
+ label: string;
4722
+ guideLine: boolean;
4723
+ placeholder: string;
4724
+ colours: string[];
4725
+ widths: number[];
4726
+ toolbar: boolean;
4727
+ name: string;
4728
+ disabled: boolean;
4729
+ typeFallback: boolean;
4730
+ minStrokeLength: number;
4731
+ respectMotionPreference: boolean;
4732
+ onChange: any;
4733
+ onClear: any;
4734
+ onBegin: any;
4735
+ onEnd: any;
4736
+ };
4737
+ /**
4738
+ * @param {string|HTMLElement} selector - The container
4739
+ * @param {SignatureOptions} [options]
4740
+ */
4741
+ constructor(selector: string | HTMLElement, options?: SignatureOptions);
4742
+ _strokes: any[];
4743
+ _undoneStrokes: any[];
4744
+ _currentStroke: {
4745
+ points: {
4746
+ x: number;
4747
+ y: number;
4748
+ pressure: any;
4749
+ }[];
4750
+ colour: any;
4751
+ width: any;
4752
+ };
4753
+ _mode: string;
4754
+ _isDrawing: boolean;
4755
+ _currentColour: any;
4756
+ _currentWidth: any;
4757
+ _resizeObserver: ResizeObserver;
4758
+ _canvas: Element;
4759
+ _ctx: any;
4760
+ _canvasW: number;
4761
+ _canvasH: number;
4762
+ _dpr: number;
4763
+ _esc(str: any): string;
4764
+ _render(): void;
4765
+ _wrapper: Element;
4766
+ _placeholder: Element;
4767
+ _statusEl: Element;
4768
+ _hiddenInput: Element;
4769
+ _typeInput: Element;
4770
+ _initCanvas(): void;
4771
+ _scaleCanvas(): void;
4772
+ _initEvents(): void;
4773
+ _onPointerDown(e: any): void;
4774
+ _onPointerMove(e: any): void;
4775
+ _onPointerUp(e: any): void;
4776
+ _getPoint(e: any): {
4777
+ x: number;
4778
+ y: number;
4779
+ };
4780
+ _redraw(): void;
4781
+ _redrawCurrentStroke(): void;
4782
+ _drawStroke(ctx: any, stroke: any, w: any, h: any): void;
4783
+ _updateState(): void;
4784
+ _setColour(colour: any): void;
4785
+ _setPenWidth(width: any): void;
4786
+ _setMode(mode: any): void;
4787
+ _renderTypeToCanvas(): void;
4788
+ _updateHiddenInput(): void;
4789
+ /**
4790
+ * Export the signature as a base64 data URL.
4791
+ * @param {'png'|'svg'} [format] - Override the instance format: 'png' or 'svg'
4792
+ * @returns {string} Base64-encoded data URL
4793
+ */
4794
+ toBase64(format?: "png" | "svg"): string;
4795
+ _toSVGBase64(): string;
4796
+ /**
4797
+ * Check whether the pad contains any drawn content.
4798
+ * @returns {boolean}
4799
+ */
4800
+ isEmpty(): boolean;
4801
+ /**
4802
+ * Clear the signature. Undoable unless silent=true.
4803
+ * @param {boolean} [silent=false]
4804
+ */
4805
+ clear(silent?: boolean): void;
4806
+ /**
4807
+ * Undo the last stroke.
4808
+ */
4809
+ undo(): void;
4810
+ /**
4811
+ * Redo the last undone stroke.
4812
+ */
4813
+ redo(): void;
4814
+ /**
4815
+ * Disable the signature pad.
4816
+ */
4817
+ disable(): void;
4818
+ /**
4819
+ * Enable the signature pad.
4820
+ */
4821
+ enable(): void;
4822
+ }
4823
+ /**
4824
+ * @typedef {object} DatePickerOptions
4825
+ * @property {string|Date|null} [value=null] - Initial date; null reads the input
4826
+ * @property {string} [format='YYYY-MM-DD'] - What the input shows (YYYY YY MMMM MMM MM M DDDD DDD DD D); the value stays ISO
4827
+ * @property {string|Date|null} [min=null] - Earliest selectable date
4828
+ * @property {string|Date|null} [max=null] - Latest selectable date
4829
+ * @property {number} [firstDay=1] - First day of the week: 0 Sunday, 1 Monday
4830
+ * @property {((date: Date) => boolean)|null} [disabledDates=null] - true means unavailable
4831
+ * @property {boolean} [openOnFocus=true]
4832
+ * @property {boolean} [closeOnSelect=true]
4833
+ * @property {boolean} [closeOnClickOutside=true]
4834
+ * @property {boolean} [closeOnEscape=true]
4835
+ * @property {boolean} [clearable=true] - Clear button
4836
+ * @property {boolean} [todayButton=true]
4837
+ * @property {boolean} [readonlyInput=false] - Stop typing; only the calendar sets it
4838
+ * @property {boolean} [inline=false] - Render in place instead of as a popup
4839
+ * @property {DropdownPosition} [position='bottom-start'] - Popup position
4840
+ * @property {[number, number]} [offset=[0, 4]] - Popup offset [x, y]
4841
+ * @property {boolean} [weekNumbers=false] - ISO week numbers
4842
+ * @property {string|null} [placeholder=null] - Default: the format
4843
+ * @property {((value: string, date: Date|null, picker: DatePickerInstance) => void)|null} [onChange] - ISO value ('' when cleared)
4844
+ * @property {((picker: DatePickerInstance) => boolean|void)|null} [onBeforeOpen] - Return false to keep it closed
4845
+ * @property {((picker: DatePickerInstance) => void)|null} [onOpen]
4846
+ * @property {((picker: DatePickerInstance) => boolean|void)|null} [onBeforeClose] - Return false to keep it open
4847
+ * @property {((picker: DatePickerInstance) => void)|null} [onClose]
4848
+ */
4849
+ /**
4850
+ * @typedef {DatePicker} DatePickerInstance
4851
+ */
4852
+ /**
4853
+ * A calendar, attached to an input.
4854
+ *
4855
+ * ## Why this exists
4856
+ *
4857
+ * `<input type="date">` is a different control in every engine, cannot be
4858
+ * themed at all, and writes a string that `M.types.date` then refuses - which
4859
+ * is why a Forma field declared `type: 'date'` could never be submitted. This
4860
+ * is one control everywhere, built from `--dm-*` tokens so it takes the host's
4861
+ * theme, and it writes the same ISO string a model expects.
4862
+ *
4863
+ * ## Contract with the input
4864
+ *
4865
+ * The INPUT keeps the value; the popup only edits it. So `data-model`,
4866
+ * `form.getData()`, a `name` in a real form and anything else reading the
4867
+ * element keep working, and every change dispatches `input` and `change`
4868
+ * exactly as typing would - without which a bound model would never hear about
4869
+ * a click on the calendar.
4870
+ *
4871
+ * The stored value is ISO `YYYY-MM-DD` and `getValue()` always returns that.
4872
+ * `format` changes what is DISPLAYED; when it differs from ISO the element
4873
+ * carries the real value in `data-date` as well, because the displayed text is
4874
+ * then no longer the value.
4875
+ */
4876
+ declare class DatePicker extends Component {
4877
+ static defaults: {
4878
+ value: any;
4879
+ format: string;
4880
+ min: any;
4881
+ max: any;
4882
+ firstDay: number;
4883
+ disabledDates: any;
4884
+ openOnFocus: boolean;
4885
+ closeOnSelect: boolean;
4886
+ closeOnClickOutside: boolean;
4887
+ closeOnEscape: boolean;
4888
+ clearable: boolean;
4889
+ todayButton: boolean;
4890
+ readonlyInput: boolean;
4891
+ inline: boolean;
4892
+ position: string;
4893
+ offset: number[];
4894
+ weekNumbers: boolean;
4895
+ placeholder: any;
4896
+ onChange: any;
4897
+ onBeforeOpen: any;
4898
+ onOpen: any;
4899
+ onBeforeClose: any;
4900
+ onClose: any;
4901
+ };
4902
+ /** Only one popup is ever open, exactly as with a dropdown. */
4903
+ static _open: any;
4904
+ /**
4905
+ * @param {string|HTMLElement} selector - The input to attach to
4906
+ * @param {DatePickerOptions} [options]
4907
+ */
4908
+ constructor(selector: string | HTMLElement, options?: DatePickerOptions);
4909
+ _panel: HTMLDivElement;
4910
+ _isOpen: boolean;
4911
+ _value: any;
4912
+ _view: any;
4913
+ _focused: any;
4914
+ _init(): void;
4915
+ /**
4916
+ * The ISO date currently held, or ''.
4917
+ * @returns {string}
4918
+ */
4919
+ getValue(): string;
4920
+ /**
4921
+ * The Date currently held, or null.
4922
+ * @returns {Date|null}
4923
+ */
4924
+ getDate(): Date | null;
4925
+ /**
4926
+ * @param {string|Date|null} value
4927
+ * @param {{silent?: boolean, fromInput?: boolean}} [options]
4928
+ * @returns {this}
4929
+ */
4930
+ setValue(value: string | Date | null, { silent, fromInput }?: {
4931
+ silent?: boolean;
4932
+ fromInput?: boolean;
4933
+ }): this;
4934
+ _suppress: boolean;
4935
+ /** @returns {this} */
4936
+ clear(): this;
4937
+ _renderInput(): void;
4938
+ _min(): Date;
4939
+ _max(): Date;
4940
+ /** Pull a date inside min/max, or null if there is no date. */
4941
+ _clamp(date: any): any;
4942
+ /** Is this day off limits? */
4943
+ _disabled(date: any): boolean;
4944
+ _buildPanel(): void;
4945
+ _grid: HTMLDivElement;
4946
+ _foot: HTMLDivElement;
4947
+ _monthSelect: HTMLSelectElement;
4948
+ _yearSelect: HTMLSelectElement;
4949
+ _shiftMonth(delta: any): void;
4950
+ /** Redraw the month on screen. */
4951
+ _paint(): void;
4952
+ _paintFoot(): void;
4953
+ /** ISO week number, for `weekNumbers`. */
4954
+ _weekNumber(date: any): number;
4955
+ /** @returns {this} */
4956
+ open(): this;
4957
+ _onOutside: (e: any) => void;
4958
+ _onReposition: () => void;
4959
+ /**
4960
+ * @param {{focus?: boolean}} [options] - focus true returns the caret to the input
4961
+ * @returns {this}
4962
+ */
4963
+ close({ focus }?: {
4964
+ focus?: boolean;
4965
+ }): this;
4966
+ /** @returns {this} */
4967
+ toggle(): this;
4968
+ /** @returns {boolean} */
4969
+ isOpen(): boolean;
4970
+ /**
4971
+ * Alias of open().
4972
+ * @param {...any} args
4973
+ * @returns {this}
4974
+ */
4975
+ show(...args: any[]): this;
4976
+ /**
4977
+ * Alias of close().
4978
+ * @param {...any} args
4979
+ * @returns {this}
4980
+ */
4981
+ hide(...args: any[]): this;
4982
+ /**
4983
+ * Alias of isOpen().
4984
+ * @returns {boolean}
4985
+ */
4986
+ isVisible(): boolean;
4987
+ _position(): void;
4988
+ _onInputKey(e: any): void;
4989
+ _onPanelKey(e: any): void;
4990
+ /** Move the keyboard cursor, following it into the next month if need be. */
4991
+ _moveFocus(date: any): void;
4992
+ }
4993
+ import Component from './component.js';
4994
+ export { TreeView, ContextMenu, Sortable, InputGroup, Popover, FocusTrap, CommandPalette, SplitPane, VirtualList, Dropzone, RangeSlider };