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