domma-js 0.56.0 → 0.57.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/types/generated/public/assets/flags/africa.d.ts +6 -0
- package/assets/types/generated/public/assets/flags/americas.d.ts +6 -0
- package/assets/types/generated/public/assets/flags/asia.d.ts +6 -0
- package/assets/types/generated/public/assets/flags/europe.d.ts +9 -0
- package/assets/types/generated/public/assets/flags/index.d.ts +11 -0
- package/assets/types/generated/public/assets/flags/oceania.d.ts +2 -0
- package/assets/types/generated/public/assets/icons/buildings.d.ts +6 -0
- package/assets/types/generated/public/assets/icons/code.d.ts +2 -0
- package/assets/types/generated/public/assets/icons/commerce.d.ts +7 -0
- package/assets/types/generated/public/assets/icons/communication.d.ts +7 -0
- package/assets/types/generated/public/assets/icons/devices.d.ts +6 -0
- package/assets/types/generated/public/assets/icons/emojis.d.ts +6 -0
- package/assets/types/generated/public/assets/icons/files.d.ts +7 -0
- package/assets/types/generated/public/assets/icons/finance.d.ts +6 -0
- package/assets/types/generated/public/assets/icons/forms.d.ts +5 -0
- package/assets/types/generated/public/assets/icons/health.d.ts +6 -0
- package/assets/types/generated/public/assets/icons/index.d.ts +24 -0
- package/assets/types/generated/public/assets/icons/media.d.ts +7 -0
- package/assets/types/generated/public/assets/icons/navigation.d.ts +7 -0
- package/assets/types/generated/public/assets/icons/seasonal.d.ts +6 -0
- package/assets/types/generated/public/assets/icons/social.d.ts +7 -0
- package/assets/types/generated/public/assets/icons/sport.d.ts +6 -0
- package/assets/types/generated/public/assets/icons/status.d.ts +7 -0
- package/assets/types/generated/public/assets/icons/transport.d.ts +7 -0
- package/assets/types/generated/public/assets/icons/ui.d.ts +7 -0
- package/assets/types/generated/public/assets/icons/weather.d.ts +6 -0
- package/assets/types/generated/src/auth.d.ts +424 -0
- package/assets/types/generated/src/avatar.d.ts +270 -0
- package/assets/types/generated/src/binding-source.d.ts +58 -0
- package/assets/types/generated/src/butterfly-drawing.d.ts +2 -0
- package/assets/types/generated/src/component-factory.d.ts +150 -0
- package/assets/types/generated/src/component.d.ts +162 -0
- package/assets/types/generated/src/components/back-to-top.d.ts +150 -0
- package/assets/types/generated/src/components/badge.d.ts +208 -0
- package/assets/types/generated/src/components/card.d.ts +189 -0
- package/assets/types/generated/src/components/command-palette.d.ts +352 -0
- package/assets/types/generated/src/components/dropzone.d.ts +342 -0
- package/assets/types/generated/src/components/focus-trap.d.ts +238 -0
- package/assets/types/generated/src/components/loader.d.ts +133 -0
- package/assets/types/generated/src/components/modal.d.ts +341 -0
- package/assets/types/generated/src/components/range-slider.d.ts +267 -0
- package/assets/types/generated/src/components/shared.d.ts +91 -0
- package/assets/types/generated/src/components/split-pane.d.ts +239 -0
- package/assets/types/generated/src/components/toast.d.ts +284 -0
- package/assets/types/generated/src/components/tooltip.d.ts +200 -0
- package/assets/types/generated/src/components/virtual-list.d.ts +340 -0
- package/assets/types/generated/src/config.d.ts +193 -0
- package/assets/types/generated/src/context-cursor.d.ts +69 -0
- package/assets/types/generated/src/context-menu.d.ts +596 -0
- package/assets/types/generated/src/dates.d.ts +367 -0
- package/assets/types/generated/src/dom.d.ts +1221 -0
- package/assets/types/generated/src/effects.d.ts +1281 -0
- package/assets/types/generated/src/elements.d.ts +4996 -0
- package/assets/types/generated/src/escape.d.ts +5 -0
- package/assets/types/generated/src/flags-bundle.d.ts +4 -0
- package/assets/types/generated/src/flags.d.ts +338 -0
- package/assets/types/generated/src/forms.d.ts +1060 -0
- package/assets/types/generated/src/globals.d.ts +45 -0
- package/assets/types/generated/src/http.d.ts +131 -0
- package/assets/types/generated/src/i18n.d.ts +261 -0
- package/assets/types/generated/src/icons.d.ts +213 -0
- package/assets/types/generated/src/index.d.ts +249 -0
- package/assets/types/generated/src/input-group.d.ts +135 -0
- package/assets/types/generated/src/models.d.ts +968 -0
- package/assets/types/generated/src/popover.d.ts +412 -0
- package/assets/types/generated/src/router.d.ts +344 -0
- package/assets/types/generated/src/safe-url.d.ts +10 -0
- package/assets/types/generated/src/sanitize.d.ts +97 -0
- package/assets/types/generated/src/schema-builder.d.ts +420 -0
- package/assets/types/generated/src/skeleton.d.ts +135 -0
- package/assets/types/generated/src/smooth-caret.d.ts +61 -0
- package/assets/types/generated/src/sortable.d.ts +369 -0
- package/assets/types/generated/src/storage.d.ts +93 -0
- package/assets/types/generated/src/tables.d.ts +901 -0
- package/assets/types/generated/src/theme.d.ts +277 -0
- package/assets/types/generated/src/ticker-tape-drawing.d.ts +2 -0
- package/assets/types/generated/src/treeview.d.ts +504 -0
- package/assets/types/generated/src/utils.d.ts +1667 -0
- package/assets/types/generated/src/web-components/base/domma-element.d.ts +134 -0
- package/assets/types/generated/src/web-components/index.d.ts +14 -0
- package/assets/types/generated/vendor/domma-reactive.d.ts +587 -0
- package/assets/types/index.d.ts +104 -226
- package/package.json +5 -2
- package/public/dist/bundles/domma-complete.css +20 -14
- package/public/dist/bundles/domma-data-focused.css +20 -14
- package/public/dist/bundles/domma-essentials.css +20 -14
- package/public/dist/bundles/domma-full.css +20 -14
- package/public/dist/bundles/domma-minimal.css +8 -8
- package/public/dist/domma-flags.esm.js +3 -3
- package/public/dist/domma-flags.esm.js.map +1 -1
- package/public/dist/domma-flags.min.js +3 -3
- package/public/dist/domma-flags.min.js.map +1 -1
- package/public/dist/domma-syntax.min.js +3 -3
- package/public/dist/domma.css +3 -3
- package/public/dist/domma.esm.js +5 -5
- package/public/dist/domma.esm.js.map +1 -1
- package/public/dist/domma.min.js +5 -5
- package/public/dist/domma.min.js.map +1 -1
- package/public/dist/elements.css +9 -3
- package/public/dist/grid.css +3 -3
- package/public/dist/syntax.css +3 -3
- package/public/dist/themes/domma-themes.css +3 -3
- package/templates/kickstart/frontend/types/domma.d.ts +2 -1
- package/assets/types/config.d.ts +0 -136
- package/assets/types/dates.d.ts +0 -209
- package/assets/types/dom.d.ts +0 -448
- package/assets/types/elements.d.ts +0 -1168
- package/assets/types/flags.d.ts +0 -130
- package/assets/types/http.d.ts +0 -97
- package/assets/types/i18n.d.ts +0 -99
- package/assets/types/icons.d.ts +0 -147
- package/assets/types/models.d.ts +0 -260
- package/assets/types/smooth-caret.d.ts +0 -12
- package/assets/types/storage.d.ts +0 -93
- package/assets/types/tables.d.ts +0 -327
- package/assets/types/theme.d.ts +0 -137
- package/assets/types/utils.d.ts +0 -675
|
@@ -0,0 +1,238 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The floating layer an outside element belongs to, or null when it is part of the
|
|
3
|
+
* page. A layer is the nearest of:
|
|
4
|
+
* - an element carrying `data-focus-trap-allow` (an opt-in for anything else);
|
|
5
|
+
* - an element with `position: fixed` (toasts, popovers, context menus, palettes,
|
|
6
|
+
* another overlay that did not trap focus);
|
|
7
|
+
* - a direct child of <body> that is absolutely positioned (portalled pickers and
|
|
8
|
+
* dropdowns), or that was put there after `since` was taken - something opened
|
|
9
|
+
* while the trap was on top.
|
|
10
|
+
* @param {Element} target
|
|
11
|
+
* @param {Set<Element>} [since] - the children <body> had when the trap activated
|
|
12
|
+
* @returns {Element|null}
|
|
13
|
+
*/
|
|
14
|
+
export function layerOf(target: Element, since?: Set<Element>): Element | null;
|
|
15
|
+
/**
|
|
16
|
+
* The tabbable elements in some containers, in Tab order: positive tabindex first (in
|
|
17
|
+
* ascending order), then the rest in document order. Of a radio group only the checked
|
|
18
|
+
* button - or the first, when none is - takes part, as the browser does.
|
|
19
|
+
* @param {Element|Element[]} containers
|
|
20
|
+
* @param {{shadow?: boolean}} [opts] - shadow: false skips shadow roots
|
|
21
|
+
* @returns {HTMLElement[]}
|
|
22
|
+
*/
|
|
23
|
+
export function tabbables(containers: Element | Element[], opts?: {
|
|
24
|
+
shadow?: boolean;
|
|
25
|
+
}): HTMLElement[];
|
|
26
|
+
/**
|
|
27
|
+
* A trap round some containers - the small util other components use.
|
|
28
|
+
* @param {FocusTarget|Element|Array<FocusTarget|Element>} containers
|
|
29
|
+
* @param {FocusTrapOptions} [options]
|
|
30
|
+
* @returns {FocusTrap}
|
|
31
|
+
*/
|
|
32
|
+
export function createFocusTrap(containers: FocusTarget | Element | Array<FocusTarget | Element>, options?: FocusTrapOptions): FocusTrap;
|
|
33
|
+
/** Marks an element (and what is inside it) as a layer any trap lets focus into. */
|
|
34
|
+
export const ALLOW_ATTR: "data-focus-trap-allow";
|
|
35
|
+
export class FocusTrap extends Component {
|
|
36
|
+
/** @type {FocusTrapOptions} */
|
|
37
|
+
static defaults: FocusTrapOptions;
|
|
38
|
+
/**
|
|
39
|
+
* @param {FocusTarget|Element|Array<FocusTarget|Element>} containers
|
|
40
|
+
* @returns {HTMLElement[]}
|
|
41
|
+
* @protected
|
|
42
|
+
*/
|
|
43
|
+
protected static _resolve(containers: FocusTarget | Element | Array<FocusTarget | Element>): HTMLElement[];
|
|
44
|
+
/**
|
|
45
|
+
* The trap that currently listens: the newest active one.
|
|
46
|
+
* @returns {FocusTrap|null}
|
|
47
|
+
*/
|
|
48
|
+
static top(): FocusTrap | null;
|
|
49
|
+
/**
|
|
50
|
+
* @param {FocusTarget|Element|Array<FocusTarget|Element>} containers - one container, or several
|
|
51
|
+
* @param {FocusTrapOptions} [options]
|
|
52
|
+
*/
|
|
53
|
+
constructor(containers: FocusTarget | Element | Array<FocusTarget | Element>, options?: FocusTrapOptions);
|
|
54
|
+
_containers: HTMLElement[];
|
|
55
|
+
_bodyAtStart: Set<Element>;
|
|
56
|
+
_pendingTab: {
|
|
57
|
+
shift: any;
|
|
58
|
+
fromInside: boolean;
|
|
59
|
+
};
|
|
60
|
+
_active: boolean;
|
|
61
|
+
_paused: boolean;
|
|
62
|
+
_returnTo: Element;
|
|
63
|
+
_lastFocused: any;
|
|
64
|
+
_madeFocusable: any[];
|
|
65
|
+
_inerted: any[];
|
|
66
|
+
_bound: boolean;
|
|
67
|
+
/** Capture phase: Escape, and a note of the Tab that is on its way. */
|
|
68
|
+
_onKeyDown(e: any): void;
|
|
69
|
+
/** Bubble phase on window: move focus, unless something on the way used the key. */
|
|
70
|
+
_onTab(e: any): void;
|
|
71
|
+
_onFocusIn(e: any): void;
|
|
72
|
+
_onPointerDown(e: any): void;
|
|
73
|
+
_onClick(e: any): void;
|
|
74
|
+
/**
|
|
75
|
+
* Capture phase: an event aimed inside the trap opens a short window in which focus may
|
|
76
|
+
* leave - until the handlers of this event, and anything they chain with
|
|
77
|
+
* Promise.then, have run. A Tab never opens it (Tab is the trap's own business).
|
|
78
|
+
*/
|
|
79
|
+
_onInsideEvent(e: any): void;
|
|
80
|
+
/**
|
|
81
|
+
* Start trapping. Pauses the trap that was on top, if any, and moves focus in.
|
|
82
|
+
* @param {{initialFocus?: FocusTrapOptions['initialFocus']}} [opts] - overrides the option for this activation
|
|
83
|
+
* @returns {this}
|
|
84
|
+
*/
|
|
85
|
+
activate(opts?: {
|
|
86
|
+
initialFocus?: FocusTrapOptions["initialFocus"];
|
|
87
|
+
}): this;
|
|
88
|
+
/**
|
|
89
|
+
* Stop trapping. Unpauses the trap beneath, and returns focus unless told not to.
|
|
90
|
+
* @param {{returnFocus?: boolean|FocusTarget}} [opts]
|
|
91
|
+
* @returns {this}
|
|
92
|
+
*/
|
|
93
|
+
deactivate(opts?: {
|
|
94
|
+
returnFocus?: boolean | FocusTarget;
|
|
95
|
+
}): this;
|
|
96
|
+
/**
|
|
97
|
+
* Stop listening without deactivating - another trap has taken over.
|
|
98
|
+
* @returns {this}
|
|
99
|
+
*/
|
|
100
|
+
pause(): this;
|
|
101
|
+
/**
|
|
102
|
+
* Listen again after pause(). Focus comes back into the containers if it is outside.
|
|
103
|
+
* @param {{focus?: boolean}} [opts] - focus: false leaves focus where it is
|
|
104
|
+
* @returns {this}
|
|
105
|
+
*/
|
|
106
|
+
unpause(opts?: {
|
|
107
|
+
focus?: boolean;
|
|
108
|
+
}): this;
|
|
109
|
+
/**
|
|
110
|
+
* Trap a different set of containers (takes effect at the next key press).
|
|
111
|
+
* @param {FocusTarget|Element|Array<FocusTarget|Element>} containers
|
|
112
|
+
* @returns {this}
|
|
113
|
+
*/
|
|
114
|
+
updateContainers(containers: FocusTarget | Element | Array<FocusTarget | Element>): this;
|
|
115
|
+
/** @returns {HTMLElement[]} the trapped containers */
|
|
116
|
+
containers(): HTMLElement[];
|
|
117
|
+
/** @returns {boolean} active (paused or not) */
|
|
118
|
+
isActive(): boolean;
|
|
119
|
+
/** @returns {boolean} active but paused by a trap above it */
|
|
120
|
+
isPaused(): boolean;
|
|
121
|
+
/**
|
|
122
|
+
* The tabbable elements in the containers right now, in Tab order.
|
|
123
|
+
* @returns {HTMLElement[]}
|
|
124
|
+
*/
|
|
125
|
+
tabbables(): HTMLElement[];
|
|
126
|
+
_destroyed: boolean;
|
|
127
|
+
_contains(node: any): boolean;
|
|
128
|
+
_eventInside(e: any): boolean;
|
|
129
|
+
_bind(): void;
|
|
130
|
+
_unbind(): void;
|
|
131
|
+
/** A container that can hold focus itself, for when there is nothing tabbable. */
|
|
132
|
+
_fallback(): any;
|
|
133
|
+
_clearFocusable(): void;
|
|
134
|
+
_firstTarget(): any;
|
|
135
|
+
_focusInitial(initial: any): void;
|
|
136
|
+
_focus(el: any, scroll?: boolean): void;
|
|
137
|
+
/**
|
|
138
|
+
* A move Tab asked for: scrolls the element into view as native Tab does
|
|
139
|
+
* (`preventScroll` is for activation and return only). Should the element not take
|
|
140
|
+
* focus after all, the next candidate in `list` is tried, so Tab never sticks.
|
|
141
|
+
*/
|
|
142
|
+
_tabTo(el: any, list: any, back?: boolean): void;
|
|
143
|
+
/**
|
|
144
|
+
* Containers that left the page (a view removed the overlay without closing it)
|
|
145
|
+
* leave nothing to trap: the trap lets go rather than hold focus nowhere.
|
|
146
|
+
* @returns {boolean} true when it let go
|
|
147
|
+
*/
|
|
148
|
+
_gone(): boolean;
|
|
149
|
+
/** Whether focus may stay on an element outside the containers. */
|
|
150
|
+
_mayFocusOutside(target: any, e: any): boolean;
|
|
151
|
+
/** The tabbable after (or before) a non-tabbable element inside the containers. */
|
|
152
|
+
_nextFrom(active: any, list: any, back: any): any;
|
|
153
|
+
/**
|
|
154
|
+
* Tab inside a floating layer the trap let focus into (a popover opened from the
|
|
155
|
+
* overlay, a toast's button): it moves through the layer, and off either end it
|
|
156
|
+
* comes back to the overlay as though the layer sat just after what had focus
|
|
157
|
+
* before - Shift+Tab to that element, Tab to the one after it.
|
|
158
|
+
*/
|
|
159
|
+
_tabInLayer(e: any, layer: any, active: any): void;
|
|
160
|
+
_scriptTurn: {};
|
|
161
|
+
/**
|
|
162
|
+
* `inert` on every sibling of the containers and of their ancestors, up to <body>, so
|
|
163
|
+
* the rest of the page cannot be reached by anything - pointer, Tab or a screen
|
|
164
|
+
* reader's virtual cursor. What was inert already is left alone and stays so.
|
|
165
|
+
*/
|
|
166
|
+
_applyInert(): void;
|
|
167
|
+
_clearInert(): void;
|
|
168
|
+
}
|
|
169
|
+
export default FocusTrap;
|
|
170
|
+
/**
|
|
171
|
+
* A container or element: a CSS selector or the element itself.
|
|
172
|
+
*/
|
|
173
|
+
export type FocusTarget = string | HTMLElement;
|
|
174
|
+
export type FocusTrapOptions = {
|
|
175
|
+
/**
|
|
176
|
+
* Where focus goes on activate: a selector, an element, a function returning one, or false to leave it. Default: focus already inside stays, else the first tabbable, else the container.
|
|
177
|
+
*/
|
|
178
|
+
initialFocus?: FocusTarget | (() => HTMLElement | null) | false;
|
|
179
|
+
/**
|
|
180
|
+
* Where focus goes when nothing is tabbable (default: the first container, given tabindex="-1")
|
|
181
|
+
*/
|
|
182
|
+
fallbackFocus?: FocusTarget | (() => HTMLElement | null);
|
|
183
|
+
/**
|
|
184
|
+
* true (default): back to what had focus before activate(); or an element / selector; false: nowhere
|
|
185
|
+
*/
|
|
186
|
+
returnFocus?: boolean | FocusTarget;
|
|
187
|
+
/**
|
|
188
|
+
* Escape deactivates (default false - the owning overlay decides)
|
|
189
|
+
*/
|
|
190
|
+
escapeDeactivates?: boolean | ((e: KeyboardEvent) => boolean);
|
|
191
|
+
/**
|
|
192
|
+
* A press outside deactivates (default false)
|
|
193
|
+
*/
|
|
194
|
+
clickOutsideDeactivates?: boolean | ((e: MouseEvent) => boolean);
|
|
195
|
+
/**
|
|
196
|
+
* Let clicks outside through (default false: they are blocked)
|
|
197
|
+
*/
|
|
198
|
+
allowOutsideClick?: boolean | ((e: MouseEvent) => boolean);
|
|
199
|
+
/**
|
|
200
|
+
* Let a click, key or input handler on something inside the trap move focus outside on purpose - e.g. "Insert" focusing the editor behind a slideover before closing it (default false; the overlays turn it on)
|
|
201
|
+
*/
|
|
202
|
+
allowScriptFocus?: boolean;
|
|
203
|
+
/**
|
|
204
|
+
* Let focus stay outside: true, 'layers' (floating layers such as toasts and popovers, never the page or a trap beneath), or a function (default false)
|
|
205
|
+
*/
|
|
206
|
+
allowOutsideFocus?: boolean | "layers" | ((el: Element, e: Event | null) => boolean);
|
|
207
|
+
/**
|
|
208
|
+
* false: keep the trap out of E.get(container) (default true)
|
|
209
|
+
*/
|
|
210
|
+
register?: boolean;
|
|
211
|
+
/**
|
|
212
|
+
* Set `inert` on everything outside the containers while active (default false)
|
|
213
|
+
*/
|
|
214
|
+
inert?: boolean;
|
|
215
|
+
/**
|
|
216
|
+
* Walk open shadow roots (default true)
|
|
217
|
+
*/
|
|
218
|
+
shadow?: boolean;
|
|
219
|
+
/**
|
|
220
|
+
* Focus without scrolling (default true)
|
|
221
|
+
*/
|
|
222
|
+
preventScroll?: boolean;
|
|
223
|
+
onActivate?: ((trap: FocusTrapInstance) => void) | null;
|
|
224
|
+
onDeactivate?: ((trap: FocusTrapInstance) => void) | null;
|
|
225
|
+
onPause?: ((trap: FocusTrapInstance) => void) | null;
|
|
226
|
+
onUnpause?: ((trap: FocusTrapInstance) => void) | null;
|
|
227
|
+
};
|
|
228
|
+
export type FocusTrapInstance = FocusTrap;
|
|
229
|
+
/**
|
|
230
|
+
* `E.focusTrap(containers, options)` - null when nothing matched - with its helpers.
|
|
231
|
+
*/
|
|
232
|
+
export type FocusTrapFactory = ((containers: FocusTarget | FocusTarget[], options?: FocusTrapOptions) => FocusTrapInstance | null) & {
|
|
233
|
+
tabbables: (containers: Element | Element[], opts?: {
|
|
234
|
+
shadow?: boolean;
|
|
235
|
+
}) => HTMLElement[];
|
|
236
|
+
top: () => FocusTrapInstance | null;
|
|
237
|
+
};
|
|
238
|
+
import Component from '../component.js';
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
/** @typedef {'spinner'|'dots'|'pulse'|'bars'} LoaderType */
|
|
2
|
+
/**
|
|
3
|
+
* @typedef {object} LoaderOptions
|
|
4
|
+
* @property {LoaderType} [type='spinner'] - Animation
|
|
5
|
+
* @property {'small'|'sm'|'medium'|'md'|'large'|'lg'|number} [size='medium'] - Named size or px
|
|
6
|
+
* @property {string} [color='primary'] - Theme colour name, 'white', 'dark', or any CSS colour
|
|
7
|
+
* @property {boolean} [overlay=false] - Cover the container with a backdrop
|
|
8
|
+
* @property {string} [text] - Text under the indicator (also its accessible name)
|
|
9
|
+
* @property {boolean} [centered=true] - Centre in the container
|
|
10
|
+
* @property {boolean} [visible=true] - Show at once
|
|
11
|
+
* @property {boolean} [fullscreen=false] - (fullscreenLoader) the container is shown and hidden with it
|
|
12
|
+
* @property {string} [label='Loading'] - Accessible name when there is no text
|
|
13
|
+
* @property {((loader: LoaderInstance) => void)|null} [onShow] - When the loader shows
|
|
14
|
+
* @property {((loader: LoaderInstance) => void)|null} [onHide] - When the loader hides
|
|
15
|
+
*/
|
|
16
|
+
/** @typedef {Loader} LoaderInstance */
|
|
17
|
+
export class Loader extends Component {
|
|
18
|
+
static defaults: {
|
|
19
|
+
type: string;
|
|
20
|
+
size: string;
|
|
21
|
+
color: string;
|
|
22
|
+
overlay: boolean;
|
|
23
|
+
text: string;
|
|
24
|
+
centered: boolean;
|
|
25
|
+
visible: boolean;
|
|
26
|
+
fullscreen: boolean;
|
|
27
|
+
label: string;
|
|
28
|
+
onShow: any;
|
|
29
|
+
onHide: any;
|
|
30
|
+
};
|
|
31
|
+
/**
|
|
32
|
+
* @param {import('./shared.js').ComponentTarget} selector - The container
|
|
33
|
+
* @param {LoaderOptions} [options]
|
|
34
|
+
*/
|
|
35
|
+
constructor(selector: import("./shared.js").ComponentTarget, options?: LoaderOptions);
|
|
36
|
+
/** The `.dm-loader` element. @type {HTMLDivElement} */
|
|
37
|
+
indicator: HTMLDivElement;
|
|
38
|
+
_visible: boolean;
|
|
39
|
+
_render(): void;
|
|
40
|
+
_textEl: HTMLSpanElement;
|
|
41
|
+
_setShown(shown: any): void;
|
|
42
|
+
/** @returns {this} */
|
|
43
|
+
show(): this;
|
|
44
|
+
/** @returns {this} */
|
|
45
|
+
hide(): this;
|
|
46
|
+
/**
|
|
47
|
+
* Alias of show(), by name - the overlay verbs every component shares.
|
|
48
|
+
* @returns {this}
|
|
49
|
+
*/
|
|
50
|
+
open(...args: any[]): this;
|
|
51
|
+
/**
|
|
52
|
+
* Alias of hide(), by name.
|
|
53
|
+
* @returns {this}
|
|
54
|
+
*/
|
|
55
|
+
close(...args: any[]): this;
|
|
56
|
+
/** @returns {this} */
|
|
57
|
+
toggle(): this;
|
|
58
|
+
/** @returns {boolean} */
|
|
59
|
+
isVisible(): boolean;
|
|
60
|
+
/** @returns {boolean} */
|
|
61
|
+
isOpen(): boolean;
|
|
62
|
+
/**
|
|
63
|
+
* @param {string} text
|
|
64
|
+
* @returns {this}
|
|
65
|
+
*/
|
|
66
|
+
setText(text: string): this;
|
|
67
|
+
/**
|
|
68
|
+
* @param {LoaderType} type
|
|
69
|
+
* @returns {this}
|
|
70
|
+
*/
|
|
71
|
+
setType(type: LoaderType): this;
|
|
72
|
+
/**
|
|
73
|
+
* @param {LoaderOptions['size']} size
|
|
74
|
+
* @returns {this}
|
|
75
|
+
*/
|
|
76
|
+
setSize(size: LoaderOptions["size"]): this;
|
|
77
|
+
/**
|
|
78
|
+
* @param {string} color
|
|
79
|
+
* @returns {this}
|
|
80
|
+
*/
|
|
81
|
+
setColor(color: string): this;
|
|
82
|
+
_applyOptions(): void;
|
|
83
|
+
}
|
|
84
|
+
export default Loader;
|
|
85
|
+
export type LoaderType = "spinner" | "dots" | "pulse" | "bars";
|
|
86
|
+
export type LoaderOptions = {
|
|
87
|
+
/**
|
|
88
|
+
* - Animation
|
|
89
|
+
*/
|
|
90
|
+
type?: LoaderType;
|
|
91
|
+
/**
|
|
92
|
+
* - Named size or px
|
|
93
|
+
*/
|
|
94
|
+
size?: "small" | "sm" | "medium" | "md" | "large" | "lg" | number;
|
|
95
|
+
/**
|
|
96
|
+
* - Theme colour name, 'white', 'dark', or any CSS colour
|
|
97
|
+
*/
|
|
98
|
+
color?: string;
|
|
99
|
+
/**
|
|
100
|
+
* - Cover the container with a backdrop
|
|
101
|
+
*/
|
|
102
|
+
overlay?: boolean;
|
|
103
|
+
/**
|
|
104
|
+
* - Text under the indicator (also its accessible name)
|
|
105
|
+
*/
|
|
106
|
+
text?: string;
|
|
107
|
+
/**
|
|
108
|
+
* - Centre in the container
|
|
109
|
+
*/
|
|
110
|
+
centered?: boolean;
|
|
111
|
+
/**
|
|
112
|
+
* - Show at once
|
|
113
|
+
*/
|
|
114
|
+
visible?: boolean;
|
|
115
|
+
/**
|
|
116
|
+
* - (fullscreenLoader) the container is shown and hidden with it
|
|
117
|
+
*/
|
|
118
|
+
fullscreen?: boolean;
|
|
119
|
+
/**
|
|
120
|
+
* - Accessible name when there is no text
|
|
121
|
+
*/
|
|
122
|
+
label?: string;
|
|
123
|
+
/**
|
|
124
|
+
* - When the loader shows
|
|
125
|
+
*/
|
|
126
|
+
onShow?: ((loader: LoaderInstance) => void) | null;
|
|
127
|
+
/**
|
|
128
|
+
* - When the loader hides
|
|
129
|
+
*/
|
|
130
|
+
onHide?: ((loader: LoaderInstance) => void) | null;
|
|
131
|
+
};
|
|
132
|
+
export type LoaderInstance = Loader;
|
|
133
|
+
import Component from '../component.js';
|