@materializecss/materialize 2.2.1 → 2.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (57) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +94 -94
  3. package/dist/css/materialize.colors.min.css +6 -0
  4. package/dist/css/materialize.css +9624 -8820
  5. package/dist/css/materialize.min.css +6 -8
  6. package/dist/css/materialize.min.css.map +1 -1
  7. package/dist/js/materialize.cjs.js +8370 -7926
  8. package/dist/js/materialize.d.ts +2552 -2491
  9. package/dist/js/materialize.js +8375 -7931
  10. package/dist/js/materialize.min.js +6 -6
  11. package/dist/js/materialize.mjs +8342 -7898
  12. package/package.json +95 -79
  13. package/sass/{components/_color-variables.scss → _colors.scss} +403 -370
  14. package/sass/{components/_global.scss → _global.scss} +490 -558
  15. package/sass/{components/_grid.scss → _grid.scss} +172 -170
  16. package/sass/{components/_table_of_contents.scss → _table_of_contents.scss} +28 -32
  17. package/sass/{components/_tapTarget.scss → _tapTarget.scss} +102 -103
  18. package/sass/{components/_typography.scss → _typography.scss} +59 -62
  19. package/sass/{components/_variables.scss → _variables.scss} +57 -56
  20. package/sass/components/forms/_forms.scss +19 -24
  21. package/sass/materialize.scss +48 -47
  22. package/sass/mixins.module.scss +168 -0
  23. package/sass/components/_badges.scss +0 -75
  24. package/sass/components/_buttons.scss +0 -455
  25. package/sass/components/_cards.scss +0 -210
  26. package/sass/components/_carousel.scss +0 -95
  27. package/sass/components/_chips.scss +0 -148
  28. package/sass/components/_collapsible.scss +0 -80
  29. package/sass/components/_collection.scss +0 -115
  30. package/sass/components/_color-classes.scss +0 -32
  31. package/sass/components/_datepicker.scss +0 -216
  32. package/sass/components/_dropdown.scss +0 -78
  33. package/sass/components/_icons-material-design.scss +0 -6
  34. package/sass/components/_materialbox.scss +0 -43
  35. package/sass/components/_modal.scss +0 -68
  36. package/sass/components/_navbar.scss +0 -231
  37. package/sass/components/_normalize.scss +0 -349
  38. package/sass/components/_preloader.scss +0 -418
  39. package/sass/components/_pulse.scss +0 -35
  40. package/sass/components/_sidenav.scss +0 -249
  41. package/sass/components/_slider.scss +0 -121
  42. package/sass/components/_tabs.scss +0 -155
  43. package/sass/components/_timepicker.scss +0 -279
  44. package/sass/components/_toast.scss +0 -65
  45. package/sass/components/_tooltip.scss +0 -48
  46. package/sass/components/_transitions.scss +0 -13
  47. package/sass/components/colors.module.scss +0 -74
  48. package/sass/components/forms/_checkboxes.scss +0 -200
  49. package/sass/components/forms/_file-input.scss +0 -43
  50. package/sass/components/forms/_input-fields.scss +0 -350
  51. package/sass/components/forms/_radio-buttons.scss +0 -112
  52. package/sass/components/forms/_range.scss +0 -153
  53. package/sass/components/forms/_select.scss +0 -195
  54. package/sass/components/forms/_switches.scss +0 -122
  55. package/sass/components/theme.module.scss +0 -140
  56. package/sass/components/tokens.module.scss +0 -272
  57. package/sass/components/typography.module.scss +0 -150
@@ -1,2491 +1,2552 @@
1
- /**
2
- * Base options for component initialization.
3
- */
4
- interface BaseOptions$1 {
5
- }
6
- type MElement = HTMLElement | Element;
7
- type InitElements<T extends MElement> = NodeListOf<T> | HTMLCollectionOf<T>;
8
- type ComponentConstructor<T extends Component<O>, O extends BaseOptions$1> = {
9
- new (el: HTMLElement, options: Partial<O>): T;
10
- };
11
- type ComponentType<C extends Component<O>, O extends BaseOptions$1> = ComponentConstructor<C, O> & typeof Component<O>;
12
- interface I18nOptions {
13
- cancel: string;
14
- clear: string;
15
- done: string;
16
- }
17
- interface Openable {
18
- isOpen: boolean;
19
- open(): void;
20
- close(): void;
21
- }
22
- /**
23
- * Base class implementation for Materialize components.
24
- */
25
- declare class Component<O extends BaseOptions$1> {
26
- /**
27
- * The DOM element the plugin was initialized with.
28
- */
29
- el: HTMLElement;
30
- /**
31
- * The options the instance was initialized with.
32
- */
33
- options: O;
34
- /**
35
- * Constructs component instance and set everything up.
36
- */
37
- constructor(el: HTMLElement, options: Partial<O>, classDef: ComponentType<Component<O>, O>);
38
- /**
39
- * Initializes component instance.
40
- * @param el HTML element.
41
- * @param options Component options.
42
- * @param classDef Class definition.
43
- */
44
- protected static init<I extends HTMLElement, O extends BaseOptions$1, C extends Component<O>>(el: I, options: O, classDef: ComponentType<C, O>): C;
45
- /**
46
- * Initializes component instances.
47
- * @param els HTML elements.
48
- * @param options Component options.
49
- * @param classDef Class definition.
50
- */
51
- protected static init<I extends MElement, O extends BaseOptions$1, C extends Component<O>>(els: InitElements<I>, options: Partial<O>, classDef: ComponentType<C, O>): C[];
52
- /**
53
- * Initializes component instances.
54
- * @param els HTML elements.
55
- * @param options Component options.
56
- * @param classDef Class definition.
57
- */
58
- protected static init<I extends MElement, O extends BaseOptions$1, C extends Component<O>>(els: I | InitElements<I>, options: Partial<O>, classDef: ComponentType<C, O>): C | C[];
59
- /**
60
- * @returns default options for component instance.
61
- */
62
- static get defaults(): BaseOptions$1;
63
- /**
64
- * Retrieves component instance for the given element.
65
- * @param el Associated HTML Element.
66
- */
67
- static getInstance(el: HTMLElement): Component<BaseOptions$1>;
68
- /**
69
- * Destroy plugin instance and teardown.
70
- */
71
- destroy(): void;
72
- }
73
-
74
- interface DropdownOptions extends BaseOptions$1 {
75
- /**
76
- * Defines the edge the menu is aligned to.
77
- * @default 'left'
78
- */
79
- alignment: 'left' | 'right';
80
- /**
81
- * If true, automatically focus dropdown el for keyboard.
82
- * @default true
83
- */
84
- autoFocus: boolean;
85
- /**
86
- * If true, constrainWidth to the size of the dropdown activator.
87
- * @default true
88
- */
89
- constrainWidth: boolean;
90
- /**
91
- * Provide an element that will be the bounding container of the dropdown.
92
- * @default null
93
- */
94
- container: Element;
95
- /**
96
- * If false, the dropdown will show below the trigger.
97
- * @default true
98
- */
99
- coverTrigger: boolean;
100
- /**
101
- * If true, close dropdown on item click.
102
- * @default true
103
- */
104
- closeOnClick: boolean;
105
- /**
106
- * If true, the dropdown will open on hover.
107
- * @default false
108
- */
109
- hover: boolean;
110
- /**
111
- * The duration of the transition enter in milliseconds.
112
- * @default 150
113
- */
114
- inDuration: number;
115
- /**
116
- * The duration of the transition out in milliseconds.
117
- * @default 250
118
- */
119
- outDuration: number;
120
- /**
121
- * Function called when dropdown starts entering.
122
- * @default null
123
- */
124
- onOpenStart: (el: HTMLElement) => void;
125
- /**
126
- * Function called when dropdown finishes entering.
127
- * @default null
128
- */
129
- onOpenEnd: (el: HTMLElement) => void;
130
- /**
131
- * Function called when dropdown starts exiting.
132
- * @default null
133
- */
134
- onCloseStart: (el: HTMLElement) => void;
135
- /**
136
- * Function called when dropdown finishes exiting.
137
- * @default null
138
- */
139
- onCloseEnd: (el: HTMLElement) => void;
140
- /**
141
- * Function called when item is clicked.
142
- * @default null
143
- */
144
- onItemClick: (el: HTMLLIElement) => void;
145
- }
146
- declare class Dropdown extends Component<DropdownOptions> implements Openable {
147
- static _dropdowns: Dropdown[];
148
- /** ID of the dropdown element. */
149
- id: string;
150
- /** The DOM element of the dropdown. */
151
- dropdownEl: HTMLElement;
152
- /** If the dropdown is open. */
153
- isOpen: boolean;
154
- /** If the dropdown content is scrollable. */
155
- isScrollable: boolean;
156
- isTouchMoving: boolean;
157
- /** The index of the item focused. */
158
- focusedIndex: number;
159
- filterQuery: string[];
160
- filterTimeout: NodeJS.Timeout | number;
161
- constructor(el: HTMLElement, options: Partial<DropdownOptions>);
162
- static get defaults(): DropdownOptions;
163
- /**
164
- * Initializes instance of Dropdown.
165
- * @param el HTML element.
166
- * @param options Component options.
167
- */
168
- static init(el: HTMLElement, options?: Partial<DropdownOptions>): Dropdown;
169
- /**
170
- * Initializes instances of Dropdown.
171
- * @param els HTML elements.
172
- * @param options Component options.
173
- */
174
- static init(els: InitElements<MElement>, options?: Partial<DropdownOptions>): Dropdown[];
175
- static getInstance(el: HTMLElement): Dropdown;
176
- destroy(): void;
177
- _setupEventHandlers(): void;
178
- _removeEventHandlers(): void;
179
- _setupTemporaryEventHandlers(): void;
180
- _removeTemporaryEventHandlers(): void;
181
- _handleClick: (e: MouseEvent) => void;
182
- _handleMouseEnter: (e: any) => void;
183
- _handleMouseLeave: (e: MouseEvent) => void;
184
- _handleDocumentClick: (e: MouseEvent) => void;
185
- _handleTriggerKeydown: (e: KeyboardEvent) => void;
186
- _handleDocumentTouchmove: (e: TouchEvent) => void;
187
- _handleDropdownClick: (e: MouseEvent) => void;
188
- _handleDropdownKeydown: (e: KeyboardEvent) => void;
189
- _handleWindowResize: () => void;
190
- _resetFilterQuery: () => void;
191
- _resetDropdownStyles(): void;
192
- _resetDropdownPositioningStyles(): void;
193
- _moveDropdown(containerEl?: HTMLElement): void;
194
- _makeDropdownFocusable(): void;
195
- _focusFocusedItem(): void;
196
- _getDropdownPosition(closestOverflowParent: HTMLElement): {
197
- x: number;
198
- y: number;
199
- verticalAlignment: string;
200
- horizontalAlignment: "left" | "right";
201
- height: number;
202
- width: number;
203
- };
204
- _animateIn(): void;
205
- _animateOut(): void;
206
- private _getClosestAncestor;
207
- _placeDropdown(): void;
208
- /**
209
- * Open dropdown.
210
- */
211
- open: () => void;
212
- /**
213
- * Close dropdown.
214
- */
215
- close: () => void;
216
- /**
217
- * While dropdown is open, you can recalculate its dimensions if its contents have changed.
218
- */
219
- recalculateDimensions: () => void;
220
- }
221
-
222
- interface AutocompleteData {
223
- /**
224
- * A primitive value that can be converted to string.
225
- * If "text" is not provided, it will also be used as "option text" as well
226
- */
227
- id: string | number;
228
- /**
229
- * This optional attribute is used as "display value" for the current entry.
230
- * When provided, it will also be taken into consideration by the standard search function.
231
- */
232
- text?: string;
233
- /**
234
- * This optional attribute is used to provide a valid image URL to the current option.
235
- */
236
- image?: string;
237
- /**
238
- * Optional attributes which describes the option.
239
- */
240
- description?: string;
241
- }
242
- interface AutocompleteOptions extends BaseOptions$1 {
243
- /**
244
- * Data object defining autocomplete options with
245
- * optional icon strings.
246
- */
247
- data: AutocompleteData[];
248
- /**
249
- * Flag which can be set if multiple values can be selected. The Result will be an Array.
250
- * @default false
251
- */
252
- isMultiSelect: boolean;
253
- /**
254
- * Callback for when autocompleted.
255
- */
256
- onAutocomplete: (entries: AutocompleteData[]) => void;
257
- /**
258
- * Minimum number of characters before autocomplete starts.
259
- * @default 1
260
- */
261
- minLength: number;
262
- /**
263
- * The height of the Menu which can be set via css-property.
264
- * @default '300px'
265
- */
266
- maxDropDownHeight: string;
267
- /**
268
- * Function is called when the input text is altered and data can also be loaded asynchronously.
269
- * If the results are collected the items in the list can be updated via the function setMenuItems(collectedItems).
270
- * @param text Searched text.
271
- * @param autocomplete Current autocomplete instance.
272
- */
273
- onSearch: (text: string, autocomplete: Autocomplete) => void;
274
- /**
275
- * If true will render the key from each item directly as HTML.
276
- * User input MUST be properly sanitized first.
277
- * @default false
278
- */
279
- allowUnsafeHTML: boolean;
280
- /**
281
- * Pass options object to select dropdown initialization.
282
- * @default {}
283
- */
284
- dropdownOptions: Partial<DropdownOptions>;
285
- }
286
- declare class Autocomplete extends Component<AutocompleteOptions> {
287
- el: HTMLInputElement;
288
- /** If the autocomplete is open. */
289
- isOpen: boolean;
290
- /** Number of matching autocomplete options. */
291
- count: number;
292
- /** Index of the current selected option. */
293
- activeIndex: number;
294
- private oldVal;
295
- private $active;
296
- private _mousedown;
297
- container: HTMLElement;
298
- /** Instance of the dropdown plugin for this autocomplete. */
299
- dropdown: Dropdown;
300
- static _keydown: boolean;
301
- selectedValues: AutocompleteData[];
302
- menuItems: AutocompleteData[];
303
- constructor(el: HTMLInputElement, options: Partial<AutocompleteOptions>);
304
- static get defaults(): AutocompleteOptions;
305
- /**
306
- * Initializes instance of Autocomplete.
307
- * @param el HTML element.
308
- * @param options Component options.
309
- */
310
- static init(el: HTMLInputElement, options?: Partial<AutocompleteOptions>): Autocomplete;
311
- /**
312
- * Initializes instances of Autocomplete.
313
- * @param els HTML elements.
314
- * @param options Component options.
315
- */
316
- static init(els: InitElements<HTMLInputElement | MElement>, options?: Partial<AutocompleteOptions>): Autocomplete[];
317
- static getInstance(el: HTMLElement): Autocomplete;
318
- destroy(): void;
319
- _setupEventHandlers(): void;
320
- _removeEventHandlers(): void;
321
- _setupDropdown(): void;
322
- _removeDropdown(): void;
323
- _handleInputBlur: () => void;
324
- _handleInputKeyup: (e: KeyboardEvent) => void;
325
- _handleInputFocus: () => void;
326
- _inputChangeDetection: (value: string) => void;
327
- _handleInputKeydown: (e: KeyboardEvent) => void;
328
- _handleInputClick: () => void;
329
- _handleContainerMousedownAndTouchstart: () => void;
330
- _handleContainerMouseupAndTouchend: () => void;
331
- _resetCurrentElementPosition(): void;
332
- _resetAutocomplete(): void;
333
- _highlightPartialText(input: string, label: string): string[];
334
- _createDropdownItem(entry: AutocompleteData): HTMLLIElement;
335
- _renderDropdown(): void;
336
- _setStatusLoading(): void;
337
- _updateSelectedInfo(): void;
338
- _refreshInputText(): void;
339
- _triggerChanged(): void;
340
- /**
341
- * Show autocomplete.
342
- */
343
- open: () => void;
344
- /**
345
- * Hide autocomplete.
346
- */
347
- close: () => void;
348
- /**
349
- * Updates the visible or selectable items shown in the menu.
350
- * @param menuItems Items to be available.
351
- */
352
- setMenuItems(menuItems: AutocompleteData[]): void;
353
- /**
354
- * Sets selected values.
355
- * @param entries
356
- */
357
- setValues(entries: AutocompleteData[]): void;
358
- /**
359
- * Select a specific autocomplete option via id-property.
360
- * @param id The id of a data-entry.
361
- */
362
- selectOption(id: number | string): void;
363
- }
364
-
365
- interface FloatingActionButtonOptions extends BaseOptions$1 {
366
- /**
367
- * Direction FAB menu opens.
368
- * @default "top"
369
- */
370
- direction: 'top' | 'right' | 'bottom' | 'left';
371
- /**
372
- * true: FAB menu appears on hover, false: FAB menu appears on click.
373
- * @default true
374
- */
375
- hoverEnabled: boolean;
376
- /**
377
- * Enable transit the FAB into a toolbar on click.
378
- * @default false
379
- */
380
- toolbarEnabled: boolean;
381
- }
382
- declare class FloatingActionButton extends Component<FloatingActionButtonOptions> implements Openable {
383
- /**
384
- * Describes open/close state of FAB.
385
- */
386
- isOpen: boolean;
387
- private _anchor;
388
- private _menu;
389
- private _floatingBtns;
390
- private _floatingBtnsReverse;
391
- offsetY: number;
392
- offsetX: number;
393
- btnBottom: number;
394
- btnLeft: number;
395
- btnWidth: number;
396
- constructor(el: HTMLElement, options: Partial<FloatingActionButtonOptions>);
397
- static get defaults(): FloatingActionButtonOptions;
398
- /**
399
- * Initializes instance of FloatingActionButton.
400
- * @param el HTML element.
401
- * @param options Component options.
402
- */
403
- static init(el: HTMLElement, options?: Partial<FloatingActionButtonOptions>): FloatingActionButton;
404
- /**
405
- * Initializes instances of FloatingActionButton.
406
- * @param els HTML elements.
407
- * @param options Component options.
408
- */
409
- static init(els: InitElements<MElement>, options?: Partial<FloatingActionButtonOptions>): FloatingActionButton[];
410
- static getInstance(el: HTMLElement): FloatingActionButton;
411
- destroy(): void;
412
- _setupEventHandlers(): void;
413
- _removeEventHandlers(): void;
414
- _handleFABClick: () => void;
415
- _handleDocumentClick: (e: MouseEvent) => void;
416
- /**
417
- * Open FAB.
418
- */
419
- open: () => void;
420
- /**
421
- * Close FAB.
422
- */
423
- close: () => void;
424
- _animateInFAB(): void;
425
- _animateOutFAB(): void;
426
- _animateInToolbar(): void;
427
- }
428
-
429
- interface CardsOptions extends BaseOptions$1 {
430
- onOpen: (el: Element) => void;
431
- onClose: (el: Element) => void;
432
- inDuration: number;
433
- outDuration: number;
434
- }
435
- declare class Cards extends Component<CardsOptions> implements Openable {
436
- isOpen: boolean;
437
- private readonly cardReveal;
438
- private readonly initialOverflow;
439
- private _activators;
440
- private cardRevealClose;
441
- constructor(el: HTMLElement, options: Partial<CardsOptions>);
442
- static get defaults(): CardsOptions;
443
- /**
444
- * Initializes instance of Cards.
445
- * @param el HTML element.
446
- * @param options Component options.
447
- */
448
- static init(el: HTMLElement, options?: Partial<CardsOptions>): Cards;
449
- /**
450
- * Initializes instances of Cards.
451
- * @param els HTML elements.
452
- * @param options Component options.
453
- */
454
- static init(els: InitElements<MElement>, options?: Partial<CardsOptions>): Cards[];
455
- static getInstance(el: HTMLElement): Cards;
456
- /**
457
- * {@inheritDoc}
458
- */
459
- destroy(): void;
460
- _setupEventHandlers: () => void;
461
- _removeEventHandlers: () => void;
462
- _handleClickInteraction: () => void;
463
- _handleKeypressEvent: (e: KeyboardEvent) => void;
464
- _handleRevealEvent: () => void;
465
- _setupRevealCloseEventHandlers: () => void;
466
- _removeRevealCloseEventHandlers: () => void;
467
- _handleKeypressCloseEvent: (e: KeyboardEvent) => void;
468
- /**
469
- * Show card reveal.
470
- */
471
- open: () => void;
472
- /**
473
- * Hide card reveal.
474
- */
475
- close: () => void;
476
- }
477
-
478
- interface CarouselOptions extends BaseOptions$1 {
479
- /**
480
- * Transition duration in milliseconds.
481
- * @default 200
482
- */
483
- duration: number;
484
- /**
485
- * Perspective zoom. If 0, all items are the same size.
486
- * @default -100
487
- */
488
- dist: number;
489
- /**
490
- * Set the spacing of the center item.
491
- * @default 0
492
- */
493
- shift: number;
494
- /**
495
- * Set the padding between non center items.
496
- * @default 0
497
- */
498
- padding: number;
499
- /**
500
- * Set the number of visible items.
501
- * @default 5
502
- */
503
- numVisible: number;
504
- /**
505
- * Make the carousel a full width slider like the second example.
506
- * @default false
507
- */
508
- fullWidth: boolean;
509
- /**
510
- * Set to true to show indicators.
511
- * @default false
512
- */
513
- indicators: boolean;
514
- /**
515
- * Don't wrap around and cycle through items.
516
- * @default false
517
- */
518
- noWrap: boolean;
519
- /**
520
- * Callback for when a new slide is cycled to.
521
- * @default null
522
- */
523
- onCycleTo: (current: Element, dragged: boolean) => void;
524
- }
525
- declare class Carousel extends Component<CarouselOptions> {
526
- hasMultipleSlides: boolean;
527
- showIndicators: boolean;
528
- noWrap: boolean;
529
- /** If the carousel is being clicked or tapped. */
530
- pressed: boolean;
531
- /** If the carousel is currently being dragged. */
532
- dragged: boolean;
533
- offset: number;
534
- target: number;
535
- images: HTMLElement[];
536
- itemWidth: number;
537
- itemHeight: number;
538
- dim: number;
539
- _indicators: HTMLUListElement;
540
- count: number;
541
- xform: string;
542
- verticalDragged: boolean;
543
- reference: number;
544
- referenceY: number;
545
- velocity: number;
546
- frame: number;
547
- timestamp: number;
548
- ticker: string | number | NodeJS.Timeout;
549
- amplitude: number;
550
- /** The index of the center carousel item. */
551
- center: number;
552
- imageHeight: number;
553
- scrollingTimeout: number | NodeJS.Timeout;
554
- oneTimeCallback: (current: Element, dragged: boolean) => void | null;
555
- constructor(el: HTMLElement, options: Partial<CarouselOptions>);
556
- static get defaults(): CarouselOptions;
557
- /**
558
- * Initializes instance of Carousel.
559
- * @param el HTML element.
560
- * @param options Component options.
561
- */
562
- static init(el: HTMLElement, options?: Partial<CarouselOptions>): Carousel;
563
- /**
564
- * Initializes instances of Carousel.
565
- * @param els HTML elements.
566
- * @param options Component options.
567
- */
568
- static init(els: InitElements<MElement>, options?: Partial<CarouselOptions>): Carousel[];
569
- static getInstance(el: HTMLElement): Carousel;
570
- destroy(): void;
571
- _setupEventHandlers(): void;
572
- _removeEventHandlers(): void;
573
- _handleThrottledResize: () => void;
574
- _handleCarouselTap: (e: MouseEvent | TouchEvent) => void;
575
- _handleCarouselDrag: (e: MouseEvent | TouchEvent) => boolean;
576
- _handleCarouselRelease: (e: MouseEvent | TouchEvent) => boolean;
577
- _handleCarouselClick: (e: MouseEvent | TouchEvent) => boolean;
578
- _handleIndicatorClick: (e: Event) => void;
579
- _handleIndicatorKeyPress: (e: KeyboardEvent) => void;
580
- _handleIndicatorInteraction: (e: Event) => void;
581
- _handleResize: () => void;
582
- _setCarouselHeight(imageOnly?: boolean): void;
583
- _xpos(e: MouseEvent | TouchEvent): number;
584
- _ypos(e: MouseEvent | TouchEvent): number;
585
- _wrap(x: number): any;
586
- _track: () => void;
587
- _autoScroll: () => void;
588
- _scroll(x?: number): void;
589
- _updateItemStyle(el: HTMLElement, opacity: number, zIndex: number, transform: string): void;
590
- _cycleTo(n: number, callback?: CarouselOptions['onCycleTo']): void;
591
- /**
592
- * Move carousel to next slide or go forward a given amount of slides.
593
- * @param n How many times the carousel slides.
594
- */
595
- next(n?: number): void;
596
- /**
597
- * Move carousel to previous slide or go back a given amount of slides.
598
- * @param n How many times the carousel slides.
599
- */
600
- prev(n?: number): void;
601
- /**
602
- * Move carousel to nth slide.
603
- * @param n Index of slide.
604
- * @param callback "onCycleTo" optional callback.
605
- */
606
- set(n: number, callback?: CarouselOptions['onCycleTo']): void;
607
- }
608
-
609
- interface ChipData {
610
- /**
611
- * Unique identifier.
612
- */
613
- id: number | string;
614
- /**
615
- * Chip text. If not specified, "id" will be used.
616
- */
617
- text?: string;
618
- /**
619
- * Chip image (URL).
620
- */
621
- image?: string;
622
- }
623
- interface ChipsOptions extends BaseOptions$1 {
624
- /**
625
- * Set the chip data.
626
- * @default []
627
- */
628
- data: ChipData[];
629
- /**
630
- * Set first placeholder when there are no tags.
631
- * @default ""
632
- */
633
- placeholder: string;
634
- /**
635
- * Set second placeholder when adding additional tags.
636
- * @default ""
637
- */
638
- secondaryPlaceholder: string;
639
- /**
640
- * Set autocomplete options.
641
- * @default {}
642
- */
643
- autocompleteOptions: Partial<AutocompleteOptions>;
644
- /**
645
- * Toggles abililty to add custom value not in autocomplete list.
646
- * @default false
647
- */
648
- autocompleteOnly: boolean;
649
- /**
650
- * Set chips limit.
651
- * @default Infinity
652
- */
653
- limit: number;
654
- /**
655
- * Specifies class to be used in "close" button (useful when working with Material Symbols icon set).
656
- * @default 'material-icons'
657
- */
658
- closeIconClass: string;
659
- /**
660
- * Specifies option to render user input field
661
- * @default false;
662
- */
663
- allowUserInput: boolean;
664
- /**
665
- * Callback for chip add.
666
- * @default null
667
- */
668
- onChipAdd: (element: HTMLElement, chip: HTMLElement) => void;
669
- /**
670
- * Callback for chip select.
671
- * @default null
672
- */
673
- onChipSelect: (element: HTMLElement, chip: HTMLElement) => void;
674
- /**
675
- * Callback for chip delete.
676
- * @default null
677
- */
678
- onChipDelete: (element: HTMLElement, chip: HTMLElement) => void;
679
- }
680
- declare class Chips extends Component<ChipsOptions> {
681
- /** Array of the current chips data. */
682
- chipsData: ChipData[];
683
- /** If the chips has autocomplete enabled. */
684
- hasAutocomplete: boolean;
685
- /** Autocomplete instance, if any. */
686
- autocomplete: Autocomplete;
687
- _input: HTMLInputElement;
688
- _label: HTMLLabelElement;
689
- _chips: HTMLElement[];
690
- static _keydown: boolean;
691
- private _selectedChip;
692
- constructor(el: HTMLElement, options: Partial<ChipsOptions>);
693
- static get defaults(): ChipsOptions;
694
- /**
695
- * Initializes instance of Chips.
696
- * @param el HTML element.
697
- * @param options Component options.
698
- */
699
- static init(el: HTMLElement, options?: Partial<ChipsOptions>): Chips;
700
- /**
701
- * Initializes instances of Chips.
702
- * @param els HTML elements.
703
- * @param options Component options.
704
- */
705
- static init(els: InitElements<MElement>, options?: Partial<ChipsOptions>): Chips[];
706
- static getInstance(el: HTMLElement): Chips;
707
- getData(): ChipData[];
708
- destroy(): void;
709
- _setupEventHandlers(): void;
710
- _removeEventHandlers(): void;
711
- _handleChipClick: (e: MouseEvent) => void;
712
- static _handleChipsKeydown(e: KeyboardEvent): void;
713
- static _handleChipsKeyup(): void;
714
- static _handleChipsBlur(e: Event): void;
715
- _handleInputFocus: () => void;
716
- _handleInputBlur: () => void;
717
- _handleInputKeydown: (e: KeyboardEvent) => void;
718
- _renderChip(chip: ChipData): HTMLDivElement;
719
- _renderChips(): void;
720
- _setupAutocomplete(): void;
721
- _setupInput(): void;
722
- _setupLabel(): void;
723
- _setPlaceholder(): void;
724
- _isValidAndNotExist(chip: ChipData): boolean;
725
- /**
726
- * Add chip to input.
727
- * @param chip Chip data object
728
- */
729
- addChip(chip: ChipData): void;
730
- /**
731
- * Delete nth chip.
732
- * @param chipIndex Index of chip
733
- */
734
- deleteChip(chipIndex: number): void;
735
- /**
736
- * Select nth chip.
737
- * @param chipIndex Index of chip
738
- */
739
- selectChip(chipIndex: number): void;
740
- static Init(): void;
741
- }
742
-
743
- interface CollapsibleOptions extends BaseOptions$1 {
744
- /**
745
- * If accordion versus collapsible.
746
- * @default true
747
- */
748
- accordion: boolean;
749
- /**
750
- * Transition in duration in milliseconds.
751
- * @default 300
752
- */
753
- inDuration: number;
754
- /**
755
- * Transition out duration in milliseconds.
756
- * @default 300
757
- */
758
- outDuration: number;
759
- /**
760
- * Callback function called before collapsible is opened.
761
- * @default null
762
- */
763
- onOpenStart: (el: Element) => void;
764
- /**
765
- * Callback function called after collapsible is opened.
766
- * @default null
767
- */
768
- onOpenEnd: (el: Element) => void;
769
- /**
770
- * Callback function called before collapsible is closed.
771
- * @default null
772
- */
773
- onCloseStart: (el: Element) => void;
774
- /**
775
- * Callback function called after collapsible is closed.
776
- * @default null
777
- */
778
- onCloseEnd: (el: Element) => void;
779
- }
780
- declare class Collapsible extends Component<CollapsibleOptions> {
781
- private _headers;
782
- constructor(el: HTMLElement, options: Partial<CollapsibleOptions>);
783
- static get defaults(): CollapsibleOptions;
784
- /**
785
- * Initializes instance of Collapsible.
786
- * @param el HTML element.
787
- * @param options Component options.
788
- */
789
- static init(el: HTMLElement, options?: Partial<CollapsibleOptions>): Collapsible;
790
- /**
791
- * Initializes instances of Collapsible.
792
- * @param els HTML elements.
793
- * @param options Component options.
794
- */
795
- static init(els: InitElements<MElement>, options?: Partial<CollapsibleOptions>): Collapsible[];
796
- static getInstance(el: HTMLElement): Collapsible;
797
- destroy(): void;
798
- _setupEventHandlers(): void;
799
- _removeEventHandlers(): void;
800
- _handleCollapsibleClick: (e: MouseEvent | KeyboardEvent) => void;
801
- _handleCollapsibleKeydown: (e: KeyboardEvent) => void;
802
- private _setExpanded;
803
- _animateIn(index: number): void;
804
- _animateOut(index: number): void;
805
- /**
806
- * Open collapsible section.
807
- * @param n Nth section to open.
808
- */
809
- open: (index: number) => void;
810
- /**
811
- * Close collapsible section.
812
- * @param n Nth section to close.
813
- */
814
- close: (index: number) => void;
815
- }
816
-
817
- interface DateI18nOptions extends I18nOptions {
818
- previousMonth: string;
819
- nextMonth: string;
820
- months: string[];
821
- monthsShort: string[];
822
- weekdays: string[];
823
- weekdaysShort: string[];
824
- weekdaysAbbrev: string[];
825
- }
826
- interface DatepickerOptions extends BaseOptions$1 {
827
- /**
828
- * The date output format for the input field value
829
- * or a function taking the date and outputting the
830
- * formatted date string.
831
- * @default 'mmm dd, yyyy'
832
- */
833
- format: string | ((d: Date) => string);
834
- /**
835
- * Used to create date object from current input string.
836
- * @default null
837
- */
838
- parse: ((value: string, format: string) => Date) | null;
839
- /**
840
- * The initial condition if the datepicker is based on date range.
841
- * @default false
842
- */
843
- isDateRange: boolean;
844
- /**
845
- * The initial condition if the datepicker is based on multiple date selection.
846
- * @default false
847
- */
848
- isMultipleSelection: boolean;
849
- /**
850
- * The initial date to view when first opened.
851
- * @default null
852
- */
853
- defaultDate: Date | null;
854
- /**
855
- * The initial end date to view when first opened.
856
- * @default null
857
- */
858
- defaultEndDate: Date | null;
859
- /**
860
- * Make the `defaultDate` the initial selected value.
861
- * @default false
862
- */
863
- setDefaultDate: boolean;
864
- /**
865
- * Make the `defaultEndDate` the initial selected value.
866
- * @default false
867
- */
868
- setDefaultEndDate: boolean;
869
- /**
870
- * Prevent selection of any date on the weekend.
871
- * @default false
872
- */
873
- disableWeekends: boolean;
874
- /**
875
- * Custom function to disable certain days.
876
- * @default null
877
- */
878
- disableDayFn: ((day: Date) => boolean) | null;
879
- /**
880
- * First day of week (0: Sunday, 1: Monday etc).
881
- * @default 0
882
- */
883
- firstDay: number;
884
- /**
885
- * The earliest date that can be selected.
886
- * @default null
887
- */
888
- minDate: Date | null;
889
- /**
890
- * The latest date that can be selected.
891
- * @default null
892
- */
893
- maxDate: Date | null;
894
- /**
895
- * Number of years either side, or array of upper/lower range.
896
- * @default 10
897
- */
898
- yearRange: number | number[];
899
- /**
900
- * Sort year range in reverse order.
901
- * @default false
902
- */
903
- yearRangeReverse: boolean;
904
- /**
905
- * Changes Datepicker to RTL.
906
- * @default false
907
- */
908
- isRTL: boolean;
909
- /**
910
- * Show month after year in Datepicker title.
911
- * @default false
912
- */
913
- showMonthAfterYear: boolean;
914
- /**
915
- * Render days of the calendar grid that fall in the next
916
- * or previous month.
917
- * @default false
918
- */
919
- showDaysInNextAndPreviousMonths: boolean;
920
- /**
921
- * Specify a DOM element OR selector for a DOM element to render
922
- * the calendar in, by default it will be placed before the input.
923
- * @default null
924
- */
925
- container: HTMLElement | string | null;
926
- /**
927
- * Show the clear button in the datepicker.
928
- * @default false
929
- */
930
- showClearBtn: boolean;
931
- /**
932
- * Internationalization options.
933
- */
934
- i18n: Partial<DateI18nOptions>;
935
- /**
936
- * An array of string returned by `Date.toDateString()`,
937
- * indicating there are events in the specified days.
938
- * @default []
939
- */
940
- events: string[];
941
- /**
942
- * Callback function when date is selected,
943
- * first parameter is the newly selected date.
944
- * @default null
945
- */
946
- onSelect: ((selectedDate: Date) => void) | null;
947
- /**
948
- * Callback function when Datepicker is closed.
949
- * @default null
950
- */
951
- /**
952
- * Callback function when Datepicker HTML is refreshed.
953
- * @default null
954
- */
955
- onDraw: (() => void) | null;
956
- /** Field used for internal calculations DO NOT CHANGE IT */
957
- minYear?: number;
958
- /** Field used for internal calculations DO NOT CHANGE IT */
959
- maxYear?: number;
960
- /** Field used for internal calculations DO NOT CHANGE IT */
961
- minMonth?: number;
962
- /** Field used for internal calculations DO NOT CHANGE IT */
963
- maxMonth?: number;
964
- /** Field used for internal calculations DO NOT CHANGE IT */
965
- startRange?: Date;
966
- /** Field used for internal calculations DO NOT CHANGE IT */
967
- endRange?: Date;
968
- }
969
- declare class Datepicker extends Component<DatepickerOptions> {
970
- el: HTMLInputElement;
971
- id: string;
972
- multiple: boolean;
973
- calendarEl: HTMLElement;
974
- /** CLEAR button instance. */
975
- clearBtn: HTMLElement;
976
- /** DONE button instance */
977
- doneBtn: HTMLElement;
978
- cancelBtn: HTMLElement;
979
- modalEl: HTMLElement;
980
- yearTextEl: HTMLElement;
981
- dateTextEl: HTMLElement;
982
- endDateEl: HTMLInputElement;
983
- dateEls: HTMLInputElement[];
984
- /** The selected Date. */
985
- date: Date;
986
- endDate: null | Date;
987
- dates: Date[];
988
- formats: object;
989
- calendars: [{
990
- month: number;
991
- year: number;
992
- }];
993
- private _y;
994
- private _m;
995
- static _template: string;
996
- constructor(el: HTMLInputElement, options: Partial<DatepickerOptions>);
997
- static get defaults(): DatepickerOptions;
998
- /**
999
- * Initializes instance of Datepicker.
1000
- * @param el HTML element.
1001
- * @param options Component options.
1002
- */
1003
- static init(el: HTMLInputElement, options?: Partial<DatepickerOptions>): Datepicker;
1004
- /**
1005
- * Initializes instances of Datepicker.
1006
- * @param els HTML elements.
1007
- * @param options Component options.
1008
- */
1009
- static init(els: InitElements<HTMLInputElement | MElement>, options?: Partial<DatepickerOptions>): Datepicker[];
1010
- static _isDate(obj: any): boolean;
1011
- static _isWeekend(date: any): boolean;
1012
- /**
1013
- * @deprecated as this function has no effect without any return statement or global parameter setter.
1014
- */
1015
- static _setToStartOfDay(date: any): void;
1016
- static _getDaysInMonth(year: any, month: any): number;
1017
- static _isLeapYear(year: any): boolean;
1018
- static _compareDates(a: any, b: any): boolean;
1019
- static _compareWithinRange(day: Date, date: Date, dateEnd: Date): boolean;
1020
- static _comparePastDate(a: Date, b: Date): boolean;
1021
- static getInstance(el: HTMLElement): Datepicker;
1022
- destroy(): void;
1023
- destroySelects(): void;
1024
- _insertHTMLIntoDOM(): void;
1025
- /**
1026
- * Gets a string representation of the given date.
1027
- */
1028
- toString(date?: Date, format?: string | ((d: Date) => string)): string;
1029
- /**
1030
- * Returns the formatted date.
1031
- */
1032
- formatDate(date: Date, format: string): string;
1033
- /**
1034
- * Sets date from input field.
1035
- */
1036
- setDateFromInput(el: HTMLInputElement): void;
1037
- /**
1038
- * Set a date on the datepicker.
1039
- * @param date Date to set on the datepicker.
1040
- * @param preventOnSelect Undocumented as of 5 March 2018.
1041
- * @param isEndDate
1042
- * @param fromUserInput
1043
- */
1044
- setDate(date?: Date, preventOnSelect?: boolean, isEndDate?: boolean, fromUserInput?: boolean): void;
1045
- validateDate(date: Date): void | Date;
1046
- /**
1047
- * Set a single date on the datepicker.
1048
- * @param date Date to set on the datepicker.
1049
- * @param isEndDate
1050
- */
1051
- setSingleDate(date: Date, isEndDate: boolean): void;
1052
- /**
1053
- * Set a multi date on the datepicker.
1054
- * @param date Date to set on the datepicker.
1055
- */
1056
- setMultiDate(date: Date): void;
1057
- /**
1058
- * Sets the data-date attribute on the date input field
1059
- */
1060
- setDataDate(el: any, date: any): void;
1061
- /**
1062
- * Sets dates on the input values.
1063
- */
1064
- setInputValues(): void;
1065
- setMultipleSelectionInputValues(): void;
1066
- /**
1067
- * Sets given date as the input value on the given element.
1068
- */
1069
- setInputValue(el: any, date: any): void;
1070
- /**
1071
- * Renders the date in the modal head section.
1072
- */
1073
- _renderDateDisplay(date: Date, endDate?: Date): void;
1074
- /**
1075
- * Change date view to a specific date on the datepicker.
1076
- * @param date Date to show on the datepicker.
1077
- */
1078
- gotoDate(date: Date): void;
1079
- adjustCalendars(): void;
1080
- adjustCalendar(calendar: any): any;
1081
- nextMonth(): void;
1082
- prevMonth(): void;
1083
- render(year: any, month: any, randId: any): string;
1084
- renderDay(opts: any): string;
1085
- renderRow(days: any, isRTL: any, isRowSelected: any): string;
1086
- renderTable(opts: any, data: any, randId: any): string;
1087
- renderHead(opts: any): string;
1088
- renderBody(rows: any): string;
1089
- renderTitle(instance: any, c: any, year: any, month: any, refYear: any, randId: any): string;
1090
- draw(): void;
1091
- _setupEventHandlers(): void;
1092
- _setupVariables(): void;
1093
- _removeEventHandlers(): void;
1094
- _handleInputClick: (e: any) => void;
1095
- _handleInputKeydown: (e: KeyboardEvent) => void;
1096
- _handleCalendarClick: (e: any) => void;
1097
- _handleDateRangeCalendarClick: (date: Date) => void;
1098
- _handleClearClick: () => void;
1099
- _clearDates: () => void;
1100
- _handleMonthChange: (e: any) => void;
1101
- _handleYearChange: (e: any) => void;
1102
- gotoMonth(month: any): void;
1103
- gotoYear(year: any): void;
1104
- _handleInputChange: (e: Event) => void;
1105
- renderDayName(opts: any, day: any, abbr?: boolean): any;
1106
- createDateInput(): HTMLInputElement;
1107
- _finishSelection: () => void;
1108
- open(): this;
1109
- close(): this;
1110
- }
1111
-
1112
- interface MaterialboxOptions extends BaseOptions$1 {
1113
- /**
1114
- * Transition in duration in milliseconds.
1115
- * @default 275
1116
- */
1117
- inDuration: number;
1118
- /**
1119
- * Transition out duration in milliseconds.
1120
- * @default 200
1121
- */
1122
- outDuration: number;
1123
- /**
1124
- * Callback function called before materialbox is opened.
1125
- * @default null
1126
- */
1127
- onOpenStart: (el: Element) => void;
1128
- /**
1129
- * Callback function called after materialbox is opened.
1130
- * @default null
1131
- */
1132
- onOpenEnd: (el: Element) => void;
1133
- /**
1134
- * Callback function called before materialbox is closed.
1135
- * @default null
1136
- */
1137
- onCloseStart: (el: Element) => void;
1138
- /**
1139
- * Callback function called after materialbox is closed.
1140
- * @default null
1141
- */
1142
- onCloseEnd: (el: Element) => void;
1143
- }
1144
- declare class Materialbox extends Component<MaterialboxOptions> {
1145
- /** If the materialbox overlay is showing. */
1146
- overlayActive: boolean;
1147
- /** If the materialbox is no longer being animated. */
1148
- doneAnimating: boolean;
1149
- /** Caption, if specified. */
1150
- caption: string;
1151
- /** Original width of image. */
1152
- originalWidth: number;
1153
- /** Original height of image. */
1154
- originalHeight: number;
1155
- private originInlineStyles;
1156
- private placeholder;
1157
- private _changedAncestorList;
1158
- private newHeight;
1159
- private newWidth;
1160
- private windowWidth;
1161
- private windowHeight;
1162
- private attrWidth;
1163
- private attrHeight;
1164
- private _overlay;
1165
- private _photoCaption;
1166
- constructor(el: HTMLElement, options: Partial<MaterialboxOptions>);
1167
- static get defaults(): MaterialboxOptions;
1168
- /**
1169
- * Initializes instance of MaterialBox.
1170
- * @param el HTML element.
1171
- * @param options Component options.
1172
- */
1173
- static init(el: HTMLElement, options?: Partial<MaterialboxOptions>): Materialbox;
1174
- /**
1175
- * Initializes instances of MaterialBox.
1176
- * @param els HTML elements.
1177
- * @param options Component options.
1178
- */
1179
- static init(els: InitElements<MElement>, options?: Partial<MaterialboxOptions>): Materialbox[];
1180
- static getInstance(el: HTMLElement): Materialbox;
1181
- destroy(): void;
1182
- private _setupEventHandlers;
1183
- private _removeEventHandlers;
1184
- private _handleMaterialboxClick;
1185
- private _handleMaterialboxKeypress;
1186
- private _handleMaterialboxToggle;
1187
- private _handleWindowScroll;
1188
- private _handleWindowResize;
1189
- private _handleWindowEscape;
1190
- private _makeAncestorsOverflowVisible;
1191
- private _offset;
1192
- private _updateVars;
1193
- private _animateImageIn;
1194
- private _animateImageOut;
1195
- private _addCaption;
1196
- private _removeCaption;
1197
- private _addOverlay;
1198
- private _removeOverlay;
1199
- /**
1200
- * Open materialbox.
1201
- */
1202
- open: () => void;
1203
- /**
1204
- * Close materialbox.
1205
- */
1206
- close: () => void;
1207
- }
1208
-
1209
- interface ModalOptions extends BaseOptions$1 {
1210
- opacity: number;
1211
- inDuration: number;
1212
- outDuration: number;
1213
- preventScrolling: boolean;
1214
- onOpenStart: (this: Modal, el: HTMLElement) => void;
1215
- onOpenEnd: (this: Modal, el: HTMLElement) => void;
1216
- onCloseStart: (el: HTMLElement) => void;
1217
- onCloseEnd: (el: HTMLElement) => void;
1218
- dismissible: boolean;
1219
- startingTop: string;
1220
- endingTop: string;
1221
- }
1222
- declare class Modal extends Component<ModalOptions> {
1223
- #private;
1224
- constructor(el: HTMLElement, options: Partial<ModalOptions>);
1225
- static get defaults(): {
1226
- opacity: number;
1227
- inDuration: number;
1228
- outDuration: number;
1229
- onOpenStart: any;
1230
- onOpenEnd: any;
1231
- onCloseStart: any;
1232
- onCloseEnd: any;
1233
- preventScrolling: boolean;
1234
- dismissible: boolean;
1235
- startingTop: string;
1236
- endingTop: string;
1237
- };
1238
- static init(el: HTMLElement, options?: Partial<ModalOptions>): Modal;
1239
- static init(els: InitElements<MElement>, options?: Partial<ModalOptions>): Modal[];
1240
- static getInstance(el: HTMLElement): Modal;
1241
- destroy(): void;
1242
- _setupEventHandlers(): void;
1243
- _removeEventHandlers(): void;
1244
- _handleTriggerClick(): void;
1245
- _handleOverlayClick(): void;
1246
- _handleModalCloseClick(): void;
1247
- _handleKeydown(): void;
1248
- _handleFocus(): void;
1249
- open(): this;
1250
- close(): this;
1251
- static create(config: any): string | HTMLDialogElement;
1252
- }
1253
-
1254
- declare class Edges {
1255
- top: boolean;
1256
- right: boolean;
1257
- bottom: boolean;
1258
- left: boolean;
1259
- }
1260
-
1261
- declare class Bounding {
1262
- left: number;
1263
- top: number;
1264
- width: number;
1265
- height: number;
1266
- }
1267
-
1268
- /**
1269
- * Class with utilitary functions for global usage.
1270
- */
1271
- declare class Utils {
1272
- /** Specifies wether tab is pressed or not. */
1273
- static tabPressed: boolean;
1274
- /** Specifies wether there is a key pressed. */
1275
- static keyDown: boolean;
1276
- /**
1277
- * Key maps.
1278
- */
1279
- static keys: {
1280
- TAB: string[];
1281
- ENTER: string[];
1282
- ESC: string[];
1283
- BACKSPACE: string[];
1284
- ARROW_UP: string[];
1285
- ARROW_DOWN: string[];
1286
- ARROW_LEFT: string[];
1287
- ARROW_RIGHT: string[];
1288
- DELETE: string[];
1289
- };
1290
- /**
1291
- * Detects when a key is pressed.
1292
- * @param e Event instance.
1293
- */
1294
- static docHandleKeydown(e: KeyboardEvent): void;
1295
- /**
1296
- * Detects when a key is released.
1297
- * @param e Event instance.
1298
- */
1299
- static docHandleKeyup(e: KeyboardEvent): void;
1300
- /**
1301
- * Detects when document is focused.
1302
- * @param e Event instance.
1303
- */
1304
- static docHandleFocus(e: FocusEvent): void;
1305
- /**
1306
- * Detects when document is not focused.
1307
- * @param e Event instance.
1308
- */
1309
- static docHandleBlur(e: FocusEvent): void;
1310
- /**
1311
- * Generates a unique string identifier.
1312
- */
1313
- static guid(): string;
1314
- /**
1315
- * Checks for exceeded edges
1316
- * @param container Container element.
1317
- * @param bounding Bounding rect.
1318
- * @param offset Element offset.
1319
- */
1320
- static checkWithinContainer(container: HTMLElement, bounding: Bounding, offset: number): Edges;
1321
- /**
1322
- * Checks if element can be aligned in multiple directions.
1323
- * @param el Element to be inspected.
1324
- * @param container Container element.
1325
- * @param bounding Bounding rect.
1326
- * @param offset Element offset.
1327
- */
1328
- static checkPossibleAlignments(el: HTMLElement, container: HTMLElement, bounding: Bounding, offset: number): {
1329
- top: boolean;
1330
- right: boolean;
1331
- bottom: boolean;
1332
- left: boolean;
1333
- spaceOnTop: number;
1334
- spaceOnRight: number;
1335
- spaceOnBottom: number;
1336
- spaceOnLeft: number;
1337
- };
1338
- /**
1339
- * Retrieves target element id from trigger.
1340
- * @param trigger Trigger element.
1341
- */
1342
- static getIdFromTrigger(trigger: HTMLElement): string;
1343
- /**
1344
- * Retrieves document scroll postion from top.
1345
- */
1346
- static getDocumentScrollTop(): number;
1347
- /**
1348
- * Retrieves document scroll postion from left.
1349
- */
1350
- static getDocumentScrollLeft(): number;
1351
- /**
1352
- * Fires the given function after a certain ammount of time.
1353
- * @param func Function to be fired.
1354
- * @param wait Wait time.
1355
- * @param options Additional options.
1356
- */
1357
- static throttle(func: (Function: object) => void, wait: number, options?: Partial<{
1358
- leading: boolean;
1359
- trailing: boolean;
1360
- }>): (...args: any[]) => any;
1361
- }
1362
-
1363
- interface ParallaxOptions extends BaseOptions$1 {
1364
- /**
1365
- * The minimum width of the screen, in pixels, where the parallax functionality starts working.
1366
- * @default 0
1367
- */
1368
- responsiveThreshold: number;
1369
- }
1370
- declare class Parallax extends Component<ParallaxOptions> {
1371
- private _enabled;
1372
- private _img;
1373
- static _parallaxes: Parallax[];
1374
- static _handleScrollThrottled: () => Utils;
1375
- static _handleWindowResizeThrottled: () => Utils;
1376
- constructor(el: HTMLElement, options: Partial<ParallaxOptions>);
1377
- static get defaults(): ParallaxOptions;
1378
- /**
1379
- * Initializes instance of Parallax.
1380
- * @param el HTML element.
1381
- * @param options Component options.
1382
- */
1383
- static init(el: HTMLElement, options?: Partial<ParallaxOptions>): Parallax;
1384
- /**
1385
- * Initializes instances of Parallax.
1386
- * @param els HTML elements.
1387
- * @param options Component options.
1388
- */
1389
- static init(els: InitElements<MElement>, options?: Partial<ParallaxOptions>): Parallax[];
1390
- static getInstance(el: HTMLElement): Parallax;
1391
- destroy(): void;
1392
- static _handleScroll(): void;
1393
- static _handleWindowResize(): void;
1394
- _setupEventHandlers(): void;
1395
- _removeEventHandlers(): void;
1396
- _setupStyles(): void;
1397
- _handleImageLoad: () => void;
1398
- private _offset;
1399
- _updateParallax(): void;
1400
- }
1401
-
1402
- interface PushpinOptions extends BaseOptions$1 {
1403
- /**
1404
- * The distance in pixels from the top of the page where
1405
- * the element becomes fixed.
1406
- * @default 0
1407
- */
1408
- top: number;
1409
- /**
1410
- * The distance in pixels from the top of the page where
1411
- * the elements stops being fixed.
1412
- * @default Infinity
1413
- */
1414
- bottom: number;
1415
- /**
1416
- * The offset from the top the element will be fixed at.
1417
- * @default 0
1418
- */
1419
- offset: number;
1420
- /**
1421
- * Callback function called when pushpin position changes.
1422
- * You are provided with a position string.
1423
- * @default null
1424
- */
1425
- onPositionChange: (position: 'pinned' | 'pin-top' | 'pin-bottom') => void;
1426
- }
1427
- declare class Pushpin extends Component<PushpinOptions> {
1428
- static _pushpins: Pushpin[];
1429
- originalOffset: number;
1430
- constructor(el: HTMLElement, options: Partial<PushpinOptions>);
1431
- static get defaults(): PushpinOptions;
1432
- /**
1433
- * Initializes instance of Pushpin.
1434
- * @param el HTML element.
1435
- * @param options Component options.
1436
- */
1437
- static init(el: HTMLElement, options?: Partial<PushpinOptions>): Pushpin;
1438
- /**
1439
- * Initializes instances of Pushpin.
1440
- * @param els HTML elements.
1441
- * @param options Component options.
1442
- */
1443
- static init(els: InitElements<MElement>, options?: Partial<PushpinOptions>): Pushpin[];
1444
- static getInstance(el: HTMLElement): Pushpin;
1445
- destroy(): void;
1446
- static _updateElements(): void;
1447
- _setupEventHandlers(): void;
1448
- _removeEventHandlers(): void;
1449
- _updatePosition(): void;
1450
- _removePinClasses(): void;
1451
- }
1452
-
1453
- interface ScrollSpyOptions extends BaseOptions$1 {
1454
- /**
1455
- * Throttle of scroll handler.
1456
- * @default 100
1457
- */
1458
- throttle: number;
1459
- /**
1460
- * Offset for centering element when scrolled to.
1461
- * @default 200
1462
- */
1463
- scrollOffset: number;
1464
- /**
1465
- * Class applied to active elements.
1466
- * @default 'active'
1467
- */
1468
- activeClass: string;
1469
- /**
1470
- * Used to find active element.
1471
- * @default id => 'a[href="#' + id + '"]'
1472
- */
1473
- getActiveElement: (id: string) => string;
1474
- /**
1475
- * Used to keep last top element active even if
1476
- * scrollbar goes outside of scrollspy elements.
1477
- *
1478
- * If there is no last top element,
1479
- * then the active one will be the first element.
1480
- *
1481
- * @default false
1482
- */
1483
- keepTopElementActive: boolean;
1484
- /**
1485
- * Used to set scroll animation duration in milliseconds.
1486
- * @default null (browser's native animation implementation/duration)
1487
- */
1488
- animationDuration: number | null;
1489
- }
1490
- declare class ScrollSpy extends Component<ScrollSpyOptions> {
1491
- static _elements: ScrollSpy[];
1492
- static _count: number;
1493
- static _increment: number;
1494
- static _elementsInView: ScrollSpy[];
1495
- static _visibleElements: HTMLElement[];
1496
- static _ticks: number;
1497
- static _keptTopActiveElement: HTMLElement | null;
1498
- private tickId;
1499
- private id;
1500
- constructor(el: HTMLElement, options: Partial<ScrollSpyOptions>);
1501
- static get defaults(): ScrollSpyOptions;
1502
- /**
1503
- * Initializes instance of ScrollSpy.
1504
- * @param el HTML element.
1505
- * @param options Component options.
1506
- */
1507
- static init(el: HTMLElement, options?: Partial<ScrollSpyOptions>): ScrollSpy;
1508
- /**
1509
- * Initializes instances of ScrollSpy.
1510
- * @param els HTML elements.
1511
- * @param options Component options.
1512
- */
1513
- static init(els: InitElements<MElement>, options?: Partial<ScrollSpyOptions>): ScrollSpy[];
1514
- static getInstance(el: HTMLElement): ScrollSpy;
1515
- destroy(): void;
1516
- _setupEventHandlers(): void;
1517
- _removeEventHandlers(): void;
1518
- _handleThrottledResize: () => void;
1519
- _handleTriggerClick: (e: MouseEvent) => void;
1520
- _handleWindowScroll: () => void;
1521
- static _offset(el: any): {
1522
- top: number;
1523
- left: number;
1524
- };
1525
- static _findElements(top: number, right: number, bottom: number, left: number): ScrollSpy[];
1526
- _enter(): void;
1527
- _exit(): void;
1528
- private _resetKeptTopActiveElementIfNeeded;
1529
- private static _getDistanceToViewport;
1530
- private static _smoothScrollIntoView;
1531
- }
1532
-
1533
- interface FormSelectOptions extends BaseOptions$1 {
1534
- /**
1535
- * Classes to be added to the select wrapper element.
1536
- * @default ""
1537
- */
1538
- classes: string;
1539
- /**
1540
- * Pass options object to select dropdown initialization.
1541
- * @default {}
1542
- */
1543
- dropdownOptions: Partial<DropdownOptions>;
1544
- }
1545
- type ValueStruct = {
1546
- el: HTMLOptionElement;
1547
- optionEl: HTMLElement;
1548
- };
1549
- declare class FormSelect extends Component<FormSelectOptions> {
1550
- el: HTMLSelectElement;
1551
- /** If this is a multiple select. */
1552
- isMultiple: boolean;
1553
- /**
1554
- * Label associated with the current select element.
1555
- * Is "null", if not detected.
1556
- */
1557
- labelEl: HTMLLabelElement;
1558
- /** Dropdown UL element. */
1559
- dropdownOptions: HTMLUListElement;
1560
- /** Text input that shows current selected option. */
1561
- input: HTMLInputElement;
1562
- /** Instance of the dropdown plugin for this select. */
1563
- dropdown: Dropdown;
1564
- /** The select wrapper element. */
1565
- wrapper: HTMLDivElement;
1566
- selectOptions: (HTMLOptionElement | HTMLOptGroupElement)[];
1567
- private _values;
1568
- constructor(el: HTMLSelectElement, options: FormSelectOptions);
1569
- static get defaults(): FormSelectOptions;
1570
- /**
1571
- * Initializes instance of FormSelect.
1572
- * @param el HTML element.
1573
- * @param options Component options.
1574
- */
1575
- static init(el: HTMLSelectElement, options?: Partial<FormSelectOptions>): FormSelect;
1576
- /**
1577
- * Initializes instances of FormSelect.
1578
- * @param els HTML elements.
1579
- * @param options Component options.
1580
- */
1581
- static init(els: InitElements<HTMLSelectElement | MElement>, options?: Partial<FormSelectOptions>): FormSelect[];
1582
- static getInstance(el: HTMLElement): FormSelect;
1583
- destroy(): void;
1584
- _setupEventHandlers(): void;
1585
- _removeEventHandlers(): void;
1586
- _handleSelectChange: () => void;
1587
- _handleOptionClick: (e: MouseEvent | KeyboardEvent) => void;
1588
- _arraysEqual<T, E>(a: T[], b: (E | T)[]): boolean;
1589
- _selectOptionElement(virtualOption: HTMLElement): void;
1590
- _handleInputClick: () => void;
1591
- _setupDropdown(): void;
1592
- _addOptionToValues(realOption: HTMLOptionElement, virtualOption: HTMLElement): void;
1593
- _removeDropdown(): void;
1594
- _createAndAppendOptionWithIcon(realOption: HTMLOptionElement | HTMLOptGroupElement, type: string): HTMLLIElement;
1595
- _selectValue(value: ValueStruct): void;
1596
- _deselectValue(value: ValueStruct): void;
1597
- _deselectAll(): void;
1598
- _isValueSelected(value: ValueStruct): boolean;
1599
- _toggleEntryFromArray(value: ValueStruct): void;
1600
- _getSelectedOptions(): HTMLOptionElement[];
1601
- _setValueToInput(): void;
1602
- _setSelectedStates(): void;
1603
- _activateOption(ul: HTMLElement, li: HTMLElement): void;
1604
- getSelectedValues(): string[];
1605
- }
1606
-
1607
- interface SidenavOptions extends BaseOptions$1 {
1608
- /**
1609
- * Side of screen on which Sidenav appears.
1610
- * @default 'left'
1611
- */
1612
- edge: 'left' | 'right';
1613
- /**
1614
- * Allow swipe gestures to open/close Sidenav.
1615
- * @default true
1616
- */
1617
- draggable: boolean;
1618
- /**
1619
- * Width of the area where you can start dragging.
1620
- * @default '10px'
1621
- */
1622
- dragTargetWidth: string;
1623
- /**
1624
- * Length in ms of enter transition.
1625
- * @default 250
1626
- */
1627
- inDuration: number;
1628
- /**
1629
- * Length in ms of exit transition.
1630
- * @default 200
1631
- */
1632
- outDuration: number;
1633
- /**
1634
- * Prevent page from scrolling while sidenav is open.
1635
- * @default true
1636
- */
1637
- preventScrolling: boolean;
1638
- /**
1639
- * Function called when sidenav starts entering.
1640
- */
1641
- onOpenStart: (elem: HTMLElement) => void;
1642
- /**
1643
- * Function called when sidenav finishes entering.
1644
- */
1645
- onOpenEnd: (elem: HTMLElement) => void;
1646
- /**
1647
- * Function called when sidenav starts exiting.
1648
- */
1649
- onCloseStart: (elem: HTMLElement) => void;
1650
- /**
1651
- * Function called when sidenav finishes exiting.
1652
- */
1653
- onCloseEnd: (elem: HTMLElement) => void;
1654
- }
1655
- declare class Sidenav extends Component<SidenavOptions> implements Openable {
1656
- id: string;
1657
- /** Describes open/close state of Sidenav. */
1658
- isOpen: boolean;
1659
- /** Describes if sidenav is fixed. */
1660
- isFixed: boolean;
1661
- /** Describes if Sidenav is being dragged. */
1662
- isDragged: boolean;
1663
- lastWindowWidth: number;
1664
- lastWindowHeight: number;
1665
- static _sidenavs: Sidenav[];
1666
- private _overlay;
1667
- dragTarget: Element;
1668
- private _startingXpos;
1669
- private _xPos;
1670
- private _time;
1671
- private _width;
1672
- private _initialScrollTop;
1673
- private _verticallyScrolling;
1674
- private deltaX;
1675
- private velocityX;
1676
- private percentOpen;
1677
- constructor(el: HTMLElement, options: Partial<SidenavOptions>);
1678
- static get defaults(): SidenavOptions;
1679
- /**
1680
- * Initializes instance of Sidenav.
1681
- * @param el HTML element.
1682
- * @param options Component options.
1683
- */
1684
- static init(el: HTMLElement, options?: Partial<SidenavOptions>): Sidenav;
1685
- /**
1686
- * Initializes instances of Sidenav.
1687
- * @param els HTML elements.
1688
- * @param options Component options.
1689
- */
1690
- static init(els: InitElements<MElement>, options?: Partial<SidenavOptions>): Sidenav[];
1691
- static getInstance(el: HTMLElement): Sidenav;
1692
- destroy(): void;
1693
- private _createOverlay;
1694
- private _setupEventHandlers;
1695
- private _removeEventHandlers;
1696
- private _handleTriggerClick;
1697
- private _startDrag;
1698
- private _dragMoveUpdate;
1699
- private _handleDragTargetDrag;
1700
- private _handleDragTargetRelease;
1701
- private _handleCloseDrag;
1702
- private _calculateDelta;
1703
- private _handleCloseRelease;
1704
- private _handleCloseTriggerClick;
1705
- private _handleWindowResize;
1706
- private _setupClasses;
1707
- private _removeClasses;
1708
- private _setupFixed;
1709
- private _isDraggable;
1710
- private _isCurrentlyFixed;
1711
- private _createDragTarget;
1712
- private _preventBodyScrolling;
1713
- private _enableBodyScrolling;
1714
- /**
1715
- * Opens Sidenav.
1716
- */
1717
- open: () => void;
1718
- /**
1719
- * Closes Sidenav.
1720
- */
1721
- close: () => void;
1722
- private _animateIn;
1723
- private _animateOut;
1724
- private _animateSidenavIn;
1725
- private _animateSidenavOut;
1726
- private _animateOverlayIn;
1727
- private _animateOverlayOut;
1728
- private _setAriaHidden;
1729
- private _setTabIndex;
1730
- }
1731
-
1732
- interface TabsOptions extends BaseOptions$1 {
1733
- /**
1734
- * Transition duration in milliseconds.
1735
- * @default 300
1736
- */
1737
- duration: number;
1738
- /**
1739
- * Callback for when a new tab content is shown.
1740
- * @default null
1741
- */
1742
- onShow: (newContent: Element) => void;
1743
- /**
1744
- * Set to true to enable swipeable tabs.
1745
- * This also uses the responsiveThreshold option.
1746
- * @default false
1747
- */
1748
- swipeable: boolean;
1749
- /**
1750
- * The maximum width of the screen, in pixels,
1751
- * where the swipeable functionality initializes.
1752
- * @default infinity
1753
- */
1754
- responsiveThreshold: number;
1755
- }
1756
- declare class Tabs extends Component<TabsOptions> {
1757
- _tabLinks: NodeListOf<HTMLAnchorElement>;
1758
- _index: number;
1759
- _indicator: HTMLLIElement;
1760
- _tabWidth: number;
1761
- _tabsWidth: number;
1762
- _tabsCarousel: Carousel;
1763
- _activeTabLink: HTMLAnchorElement;
1764
- _content: HTMLElement;
1765
- constructor(el: HTMLElement, options: Partial<TabsOptions>);
1766
- static get defaults(): TabsOptions;
1767
- /**
1768
- * Initializes instance of Tabs.
1769
- * @param el HTML element.
1770
- * @param options Component options.
1771
- */
1772
- static init(el: HTMLElement, options?: Partial<TabsOptions>): Tabs;
1773
- /**
1774
- * Initializes instances of Tabs.
1775
- * @param els HTML elements.
1776
- * @param options Component options.
1777
- */
1778
- static init(els: InitElements<MElement>, options?: Partial<TabsOptions>): Tabs[];
1779
- static getInstance(el: HTMLElement): Tabs;
1780
- destroy(): void;
1781
- /**
1782
- * The index of tab that is currently shown.
1783
- */
1784
- get index(): number;
1785
- _setupEventHandlers(): void;
1786
- _removeEventHandlers(): void;
1787
- _handleWindowResize: () => void;
1788
- _handleTabClick: (e: MouseEvent) => void;
1789
- _createIndicator(): void;
1790
- _setupActiveTabLink(): void;
1791
- _setupSwipeableTabs(): void;
1792
- _teardownSwipeableTabs(): void;
1793
- _setupNormalTabs(): void;
1794
- _teardownNormalTabs(): void;
1795
- _setTabsAndTabWidth(): void;
1796
- _calcRightPos(el: any): number;
1797
- _calcLeftPos(el: any): number;
1798
- /**
1799
- * Recalculate tab indicator position. This is useful when
1800
- * the indicator position is not correct.
1801
- */
1802
- updateTabIndicator(): void;
1803
- _animateIndicator(prevIndex: any): void;
1804
- /**
1805
- * Show tab content that corresponds to the tab with the id.
1806
- * @param tabId The id of the tab that you want to switch to.
1807
- */
1808
- select(tabId: string): void;
1809
- }
1810
-
1811
- interface TapTargetOptions extends BaseOptions$1 {
1812
- /**
1813
- * Callback function called when Tap Target is opened.
1814
- * @default null
1815
- */
1816
- onOpen: (origin: HTMLElement) => void;
1817
- /**
1818
- * Callback function called when Tap Target is closed.
1819
- * @default null
1820
- */
1821
- onClose: (origin: HTMLElement) => void;
1822
- }
1823
- declare class TapTarget extends Component<TapTargetOptions> implements Openable {
1824
- /**
1825
- * If the tap target is open.
1826
- */
1827
- isOpen: boolean;
1828
- static _taptargets: TapTarget[];
1829
- private wrapper;
1830
- private originEl;
1831
- private waveEl;
1832
- private contentEl;
1833
- constructor(el: HTMLElement, options: Partial<TapTargetOptions>);
1834
- static get defaults(): TapTargetOptions;
1835
- /**
1836
- * Initializes instance of TapTarget.
1837
- * @param el HTML element.
1838
- * @param options Component options.
1839
- */
1840
- static init(el: HTMLElement, options?: Partial<TapTargetOptions>): TapTarget;
1841
- /**
1842
- * Initializes instances of TapTarget.
1843
- * @param els HTML elements.
1844
- * @param options Component options.
1845
- */
1846
- static init(els: InitElements<MElement>, options?: Partial<TapTargetOptions>): TapTarget[];
1847
- static getInstance(el: HTMLElement): TapTarget;
1848
- destroy(): void;
1849
- _setupEventHandlers(): void;
1850
- _removeEventHandlers(): void;
1851
- _handleThrottledResize: () => void;
1852
- _handleKeyboardInteraction: (e: KeyboardEvent) => void;
1853
- _handleTargetToggle: () => void;
1854
- _handleResize: () => void;
1855
- _handleDocumentClick: (e: MouseEvent | TouchEvent | KeyboardEvent) => void;
1856
- _setup(): void;
1857
- private _offset;
1858
- _calculatePositioning(): void;
1859
- /**
1860
- * Open Tap Target.
1861
- */
1862
- open: () => void;
1863
- /**
1864
- * Close Tap Target.
1865
- */
1866
- close: () => void;
1867
- }
1868
-
1869
- type Views = 'hours' | 'minutes';
1870
- interface TimepickerOptions extends BaseOptions$1 {
1871
- /**
1872
- * Dial radius.
1873
- * @default 135
1874
- */
1875
- dialRadius: number;
1876
- /**
1877
- * Outer radius.
1878
- * @default 105
1879
- */
1880
- outerRadius: number;
1881
- /**
1882
- * Inner radius.
1883
- * @default 70
1884
- */
1885
- innerRadius: number;
1886
- /**
1887
- * Tick radius.
1888
- * @default 20
1889
- */
1890
- tickRadius: number;
1891
- /**
1892
- * Duration of the transition from/to the hours/minutes view.
1893
- * @default 350
1894
- */
1895
- duration: number;
1896
- /**
1897
- * Specify a DOM element OR selector for a DOM element to render
1898
- * the time picker in, by default it will be placed before the input.
1899
- * @default null
1900
- */
1901
- container: HTMLElement | string | null;
1902
- /**
1903
- * Show the clear button in the Timepicker.
1904
- * @default false
1905
- */
1906
- showClearBtn: boolean;
1907
- /**
1908
- * Default time to set on the timepicker 'now' or '13:14'.
1909
- * @default 'now';
1910
- */
1911
- defaultTime: string;
1912
- /**
1913
- * Millisecond offset from the defaultTime.
1914
- * @default 0
1915
- */
1916
- fromNow: number;
1917
- /**
1918
- * Internationalization options.
1919
- */
1920
- i18n: Partial<I18nOptions>;
1921
- /**
1922
- * Use 12 hour AM/PM clock instead of 24 hour clock.
1923
- * @default true
1924
- */
1925
- twelveHour: boolean;
1926
- /**
1927
- * Vibrate device when dragging clock hand.
1928
- * @default true
1929
- */
1930
- vibrate: boolean;
1931
- /**
1932
- * Callback function when a time is selected.
1933
- * @default null
1934
- */
1935
- onSelect: (hour: number, minute: number) => void;
1936
- }
1937
- type Point = {
1938
- x: number;
1939
- y: number;
1940
- };
1941
- declare class Timepicker extends Component<TimepickerOptions> {
1942
- el: HTMLInputElement;
1943
- id: string;
1944
- modalEl: HTMLElement;
1945
- plate: HTMLElement;
1946
- digitalClock: HTMLElement;
1947
- inputHours: HTMLInputElement;
1948
- inputMinutes: HTMLInputElement;
1949
- x0: number;
1950
- y0: number;
1951
- moved: boolean;
1952
- dx: number;
1953
- dy: number;
1954
- /**
1955
- * Current view on the timepicker.
1956
- * @default 'hours'
1957
- */
1958
- currentView: Views;
1959
- hand: SVGElement;
1960
- minutesView: HTMLElement;
1961
- hours: number;
1962
- minutes: number;
1963
- /** The selected time. */
1964
- time: string;
1965
- /**
1966
- * If the time is AM or PM on twelve-hour clock.
1967
- * @default 'PM'
1968
- */
1969
- amOrPm: 'AM' | 'PM';
1970
- static _template: any;
1971
- /** Vibrate device when dragging clock hand. */
1972
- vibrate: 'vibrate' | 'webkitVibrate' | null;
1973
- _canvas: HTMLElement;
1974
- hoursView: HTMLElement;
1975
- spanAmPm: HTMLSpanElement;
1976
- footer: HTMLElement;
1977
- private _amBtn;
1978
- private _pmBtn;
1979
- bg: Element;
1980
- bearing: Element;
1981
- g: Element;
1982
- toggleViewTimer: string | number | NodeJS.Timeout;
1983
- vibrateTimer: NodeJS.Timeout | number;
1984
- constructor(el: HTMLInputElement, options: Partial<TimepickerOptions>);
1985
- static get defaults(): TimepickerOptions;
1986
- /**
1987
- * Initializes instance of Timepicker.
1988
- * @param el HTML element.
1989
- * @param options Component options.
1990
- */
1991
- static init(el: HTMLInputElement, options?: Partial<TimepickerOptions>): Timepicker;
1992
- /**
1993
- * Initializes instances of Timepicker.
1994
- * @param els HTML elements.
1995
- * @param options Component options.
1996
- */
1997
- static init(els: InitElements<HTMLInputElement | MElement>, options?: Partial<TimepickerOptions>): Timepicker[];
1998
- static _addLeadingZero(num: number): string;
1999
- static _createSVGEl(name: string): SVGElement;
2000
- static _Pos(e: TouchEvent | MouseEvent): Point;
2001
- static getInstance(el: HTMLElement): Timepicker;
2002
- destroy(): void;
2003
- _setupEventHandlers(): void;
2004
- _removeEventHandlers(): void;
2005
- _handleInputClick: () => void;
2006
- _handleInputKeydown: (e: KeyboardEvent) => void;
2007
- _handleTimeInputEnterKey: (e: KeyboardEvent) => void;
2008
- _handleClockClickStart: (e: any) => void;
2009
- _handleDocumentClickMove: (e: any) => void;
2010
- _handleDocumentClickEnd: (e: any) => void;
2011
- _insertHTMLIntoDOM(): void;
2012
- _setupVariables(): void;
2013
- private _createButton;
2014
- _pickerSetup(): void;
2015
- _clockSetup(): void;
2016
- _buildSVGClock(): void;
2017
- _buildHoursView(): void;
2018
- _buildHoursTick(i: number, radian: number, radius: number): void;
2019
- _buildMinutesView(): void;
2020
- _handleAmPmClick: (e: any) => void;
2021
- _updateAmPmView(): void;
2022
- _updateTimeFromInput(): void;
2023
- /**
2024
- * Show hours or minutes view on timepicker.
2025
- * @param view The name of the view you want to switch to, 'hours' or 'minutes'.
2026
- * @param delay
2027
- */
2028
- showView: (view: Views, delay?: number) => void;
2029
- resetClock(delay: any): void;
2030
- _inputFromTextField: () => void;
2031
- drawClockFromTimeInput(value: any, isHours: any): void;
2032
- setHand(x: any, y: any, roundBy5?: boolean): void;
2033
- setClockAttributes(radian: number, radius: number): void;
2034
- formatHours(): void;
2035
- formatMinutes(): void;
2036
- setHoursDefault(): void;
2037
- done: (e?: any, clearValue?: any) => any;
2038
- clear: () => void;
2039
- open(): this;
2040
- close(): this;
2041
- }
2042
-
2043
- type TooltipPosition = 'top' | 'right' | 'bottom' | 'left';
2044
- interface TooltipOptions extends BaseOptions$1 {
2045
- /**
2046
- * Delay time before tooltip disappears.
2047
- * @default 200
2048
- */
2049
- exitDelay: number;
2050
- /**
2051
- * Delay time before tooltip appears.
2052
- * @default 0
2053
- */
2054
- enterDelay: number;
2055
- /**
2056
- * Element Id for the tooltip.
2057
- * @default ""
2058
- */
2059
- tooltipId?: string;
2060
- /**
2061
- * Text string for the tooltip.
2062
- * @default ""
2063
- */
2064
- text: string;
2065
- /**
2066
- * Set distance tooltip appears away from its activator
2067
- * excluding transitionMovement.
2068
- * @default 5
2069
- */
2070
- margin: number;
2071
- /**
2072
- * Enter transition duration.
2073
- * @default 300
2074
- */
2075
- inDuration: number;
2076
- /**
2077
- * Opacity of the tooltip.
2078
- * @default 1
2079
- */
2080
- opacity: number;
2081
- /**
2082
- * Exit transition duration.
2083
- * @default 250
2084
- */
2085
- outDuration: number;
2086
- /**
2087
- * Set the direction of the tooltip.
2088
- * @default 'bottom'
2089
- */
2090
- position: TooltipPosition;
2091
- /**
2092
- * Amount in px that the tooltip moves during its transition.
2093
- * @default 10
2094
- */
2095
- transitionMovement: number;
2096
- }
2097
- declare class Tooltip extends Component<TooltipOptions> {
2098
- /**
2099
- * If tooltip is open.
2100
- */
2101
- isOpen: boolean;
2102
- /**
2103
- * If tooltip is hovered.
2104
- */
2105
- isHovered: boolean;
2106
- /**
2107
- * If tooltip is focused.
2108
- */
2109
- isFocused: boolean;
2110
- tooltipEl: HTMLElement;
2111
- private _exitDelayTimeout;
2112
- private _enterDelayTimeout;
2113
- xMovement: number;
2114
- yMovement: number;
2115
- constructor(el: HTMLElement, options: Partial<TooltipOptions>);
2116
- static get defaults(): TooltipOptions;
2117
- /**
2118
- * Initializes instance of Tooltip.
2119
- * @param el HTML element.
2120
- * @param options Component options.
2121
- */
2122
- static init(el: HTMLElement, options?: Partial<TooltipOptions>): Tooltip;
2123
- /**
2124
- * Initializes instances of Tooltip.
2125
- * @param els HTML elements.
2126
- * @param options Component options.
2127
- */
2128
- static init(els: InitElements<MElement>, options?: Partial<TooltipOptions>): Tooltip[];
2129
- static getInstance(el: HTMLElement): Tooltip;
2130
- destroy(): void;
2131
- _appendTooltipEl(): void;
2132
- _setTooltipContent(tooltipContentEl: HTMLElement): void;
2133
- _updateTooltipContent(): void;
2134
- _setupEventHandlers(): void;
2135
- _removeEventHandlers(): void;
2136
- /**
2137
- * Show tooltip.
2138
- */
2139
- open: (isManual: boolean) => void;
2140
- /**
2141
- * Hide tooltip.
2142
- */
2143
- close: () => void;
2144
- _setExitDelayTimeout(): void;
2145
- _setEnterDelayTimeout(isManual: any): void;
2146
- _positionTooltip(): void;
2147
- _repositionWithinScreen(x: number, y: number, width: number, height: number): {
2148
- x: number;
2149
- y: number;
2150
- };
2151
- _animateIn(): void;
2152
- _animateOut(): void;
2153
- _handleMouseEnter: () => void;
2154
- _handleMouseLeave: () => void;
2155
- _handleFocus: () => void;
2156
- _handleBlur: () => void;
2157
- _getAttributeOptions(): Partial<TooltipOptions>;
2158
- }
2159
-
2160
- interface BaseOptions {
2161
- }
2162
- type InputElement = HTMLInputElement | HTMLTextAreaElement;
2163
- declare class CharacterCounter extends Component<object> {
2164
- el: InputElement;
2165
- /** Stores the reference to the counter HTML element. */
2166
- counterEl: HTMLSpanElement;
2167
- /** Specifies whether the input is valid or not. */
2168
- isInvalid: boolean;
2169
- /** Specifies whether the input text has valid length or not. */
2170
- isValidLength: boolean;
2171
- constructor(el: HTMLInputElement | HTMLTextAreaElement, options: Partial<BaseOptions>);
2172
- static get defaults(): BaseOptions;
2173
- /**
2174
- * Initializes instance of CharacterCounter.
2175
- * @param el HTML element.
2176
- * @param options Component options.
2177
- */
2178
- static init(el: InputElement, options?: Partial<BaseOptions>): CharacterCounter;
2179
- /**
2180
- * Initializes instances of CharacterCounter.
2181
- * @param els HTML elements.
2182
- * @param options Component options.
2183
- */
2184
- static init(els: InitElements<InputElement | MElement>, options?: Partial<BaseOptions>): CharacterCounter[];
2185
- static getInstance(el: InputElement): CharacterCounter;
2186
- destroy(): void;
2187
- _setupEventHandlers(): void;
2188
- _removeEventHandlers(): void;
2189
- _setupCounter(): void;
2190
- _removeCounter(): void;
2191
- updateCounter: () => void;
2192
- _validateInput(): void;
2193
- }
2194
-
2195
- declare class Forms {
2196
- /**
2197
- * Checks if the label has validation and apply
2198
- * the correct class and styles
2199
- * @param textfield
2200
- */
2201
- static validateField(textfield: HTMLInputElement): void;
2202
- /**
2203
- * Resizes the given TextArea after updating the
2204
- * value content dynamically.
2205
- * @param e EventTarget
2206
- */
2207
- static textareaAutoResize(e: EventTarget): void;
2208
- static Init(): void;
2209
- static InitTextarea(textarea: HTMLTextAreaElement): void;
2210
- static InitFileInputPath(fileInput: HTMLInputElement): void;
2211
- }
2212
-
2213
- interface SliderOptions extends BaseOptions$1 {
2214
- /**
2215
- * Set to false to hide slide indicators.
2216
- * @default true
2217
- */
2218
- indicators: boolean;
2219
- /**
2220
- * Set height of slider.
2221
- * @default 400
2222
- */
2223
- height: number;
2224
- /**
2225
- * Set the duration of the transition animation in ms.
2226
- * @default 500
2227
- */
2228
- duration: number;
2229
- /**
2230
- * Set the duration between transitions in ms.
2231
- * @default 6000
2232
- */
2233
- interval: number;
2234
- /**
2235
- * If slider should pause when keyboard focus is received.
2236
- * @default true
2237
- */
2238
- pauseOnFocus: boolean;
2239
- /**
2240
- * If slider should pause when is hovered by a pointer.
2241
- * @default true
2242
- */
2243
- pauseOnHover: boolean;
2244
- /**
2245
- * Optional function used to generate ARIA label to indicators (for accessibility purposes).
2246
- * @param index Current index, starting from "1".
2247
- * @param current A which indicates whether it is the current element or not
2248
- * @returns a string to be used as label indicator.
2249
- * @default null
2250
- */
2251
- indicatorLabelFunc: (index: number, current: boolean) => string;
2252
- }
2253
- declare class Slider extends Component<SliderOptions> {
2254
- /** Index of current slide. */
2255
- activeIndex: number;
2256
- interval: string | number | NodeJS.Timeout;
2257
- eventPause: boolean;
2258
- _slider: HTMLUListElement;
2259
- _slides: HTMLLIElement[];
2260
- _activeSlide: HTMLLIElement;
2261
- _indicators: HTMLLIElement[];
2262
- _hovered: boolean;
2263
- _focused: boolean;
2264
- _focusCurrent: boolean;
2265
- _sliderId: string;
2266
- constructor(el: HTMLElement, options: Partial<SliderOptions>);
2267
- static get defaults(): SliderOptions;
2268
- /**
2269
- * Initializes instance of Slider.
2270
- * @param el HTML element.
2271
- * @param options Component options.
2272
- */
2273
- static init(el: HTMLElement, options?: Partial<SliderOptions>): Slider;
2274
- /**
2275
- * Initializes instances of Slider.
2276
- * @param els HTML elements.
2277
- * @param options Component options.
2278
- */
2279
- static init(els: InitElements<MElement>, options?: Partial<SliderOptions>): Slider[];
2280
- static getInstance(el: HTMLElement): Slider;
2281
- destroy(): void;
2282
- private _setupEventHandlers;
2283
- private _removeEventHandlers;
2284
- private _handleIndicatorClick;
2285
- private _handleAutoPauseHover;
2286
- private _handleAutoPauseFocus;
2287
- private _handleAutoStartHover;
2288
- private _handleAutoStartFocus;
2289
- private _handleInterval;
2290
- private _animateSlide;
2291
- private _setSliderHeight;
2292
- private _setupIndicators;
2293
- private _removeIndicators;
2294
- set(index: number): void;
2295
- _pause(fromEvent: boolean): void;
2296
- /**
2297
- * Pause slider autoslide.
2298
- */
2299
- pause: () => void;
2300
- /**
2301
- * Start slider autoslide.
2302
- */
2303
- start: () => void;
2304
- /**
2305
- * Move to next slider.
2306
- */
2307
- next: () => void;
2308
- /**
2309
- * Move to prev slider.
2310
- */
2311
- prev: () => void;
2312
- }
2313
-
2314
- interface ToastOptions extends BaseOptions$1 {
2315
- /**
2316
- * The content of the Toast.
2317
- * @default ""
2318
- */
2319
- text: string;
2320
- /**
2321
- * Element Id for the tooltip.
2322
- * @default ""
2323
- */
2324
- toastId?: string;
2325
- /**
2326
- * Length in ms the Toast stays before dismissal.
2327
- * @default 4000
2328
- */
2329
- displayLength: number;
2330
- /**
2331
- * Transition in duration in milliseconds.
2332
- * @default 300
2333
- */
2334
- inDuration: number;
2335
- /**
2336
- * Transition out duration in milliseconds.
2337
- * @default 375
2338
- */
2339
- outDuration: number;
2340
- /**
2341
- * Classes to be added to the toast element.
2342
- * @default ""
2343
- */
2344
- classes: string;
2345
- /**
2346
- * Callback function called when toast is dismissed.
2347
- * @default null
2348
- */
2349
- completeCallback: () => void;
2350
- /**
2351
- * The percentage of the toast's width it takes fora drag
2352
- * to dismiss a Toast.
2353
- * @default 0.8
2354
- */
2355
- activationPercent: number;
2356
- }
2357
- declare class Toast {
2358
- /** The toast element. */
2359
- el: HTMLElement;
2360
- /**
2361
- * The remaining amount of time in ms that the toast
2362
- * will stay before dismissal.
2363
- */
2364
- timeRemaining: number;
2365
- /**
2366
- * Describes the current pan state of the Toast.
2367
- */
2368
- panning: boolean;
2369
- options: ToastOptions;
2370
- message: string;
2371
- counterInterval: NodeJS.Timeout | number;
2372
- wasSwiped: boolean;
2373
- startingXPos: number;
2374
- xPos: number;
2375
- time: number;
2376
- deltaX: number;
2377
- velocityX: number;
2378
- static _toasts: Toast[];
2379
- static _container: HTMLElement;
2380
- static _draggedToast: Toast;
2381
- constructor(options: Partial<ToastOptions>);
2382
- static get defaults(): ToastOptions;
2383
- static getInstance(el: HTMLElement): Toast;
2384
- static _createContainer(): void;
2385
- static _removeContainer(): void;
2386
- static _onDragStart(e: TouchEvent | MouseEvent): void;
2387
- static _onDragMove(e: TouchEvent | MouseEvent): void;
2388
- static _onDragEnd(): void;
2389
- static _xPos(e: TouchEvent | MouseEvent): number;
2390
- /**
2391
- * dismiss all toasts.
2392
- */
2393
- static dismissAll(): void;
2394
- _createToast(): HTMLElement;
2395
- _animateIn(): void;
2396
- /**
2397
- * Create setInterval which automatically removes toast when timeRemaining >= 0
2398
- * has been reached.
2399
- */
2400
- _setTimer(): void;
2401
- /**
2402
- * Dismiss toast with animation.
2403
- */
2404
- dismiss(): void;
2405
- }
2406
-
2407
- type RGBColor = {
2408
- r: number;
2409
- g: number;
2410
- b: number;
2411
- };
2412
- type Position = {
2413
- x: number;
2414
- y: number;
2415
- };
2416
- declare class Waves {
2417
- private static _offset;
2418
- static renderWaveEffect(targetElement: HTMLElement, position?: Position | null, color?: RGBColor | null): void;
2419
- static Init(): void;
2420
- }
2421
-
2422
- interface RangeOptions extends BaseOptions$1 {
2423
- }
2424
- declare class Range extends Component<RangeOptions> {
2425
- el: HTMLInputElement;
2426
- private _mousedown;
2427
- value: HTMLElement;
2428
- thumb: HTMLElement;
2429
- constructor(el: HTMLInputElement, options: Partial<RangeOptions>);
2430
- static get defaults(): RangeOptions;
2431
- /**
2432
- * Initializes instance of Range.
2433
- * @param el HTML element.
2434
- * @param options Component options.
2435
- */
2436
- static init(el: HTMLInputElement, options?: Partial<RangeOptions>): Range;
2437
- /**
2438
- * Initializes instances of Range.
2439
- * @param els HTML elements.
2440
- * @param options Component options.
2441
- */
2442
- static init(els: InitElements<HTMLInputElement | MElement>, options?: Partial<RangeOptions>): Range[];
2443
- static getInstance(el: HTMLInputElement): Range;
2444
- destroy(): void;
2445
- _setupEventHandlers(): void;
2446
- _removeEventHandlers(): void;
2447
- _handleRangeChange: () => void;
2448
- _handleRangeMousedownTouchstart: (e: MouseEvent | TouchEvent) => void;
2449
- _handleRangeInputMousemoveTouchmove: () => void;
2450
- _handleRangeMouseupTouchend: () => void;
2451
- _handleRangeBlurMouseoutTouchleave: () => void;
2452
- _setupThumb(): void;
2453
- _removeThumb(): void;
2454
- _showRangeBubble(): void;
2455
- _calcRangeOffset(): number;
2456
- /**
2457
- * Initializes every range input in the current document.
2458
- */
2459
- static Init(): void;
2460
- }
2461
-
2462
- declare const version = "2.2.1";
2463
- interface AutoInitOptions {
2464
- Autocomplete?: Partial<AutocompleteOptions>;
2465
- Cards?: Partial<CardsOptions>;
2466
- Carousel?: Partial<CarouselOptions>;
2467
- Chips?: Partial<ChipsOptions>;
2468
- Collapsible?: Partial<CollapsibleOptions>;
2469
- Datepicker?: Partial<DatepickerOptions>;
2470
- Dropdown?: Partial<DropdownOptions>;
2471
- Materialbox?: Partial<MaterialboxOptions>;
2472
- Modal?: Partial<ModalOptions>;
2473
- Parallax?: Partial<ParallaxOptions>;
2474
- Pushpin?: Partial<PushpinOptions>;
2475
- ScrollSpy?: Partial<ScrollSpyOptions>;
2476
- FormSelect?: Partial<FormSelectOptions>;
2477
- Sidenav?: Partial<SidenavOptions>;
2478
- Tabs?: Partial<TabsOptions>;
2479
- TapTarget?: Partial<TapTargetOptions>;
2480
- Timepicker?: Partial<TimepickerOptions>;
2481
- Tooltip?: Partial<TooltipOptions>;
2482
- FloatingActionButton?: Partial<FloatingActionButtonOptions>;
2483
- }
2484
- /**
2485
- * Automatically initialize components.
2486
- * @param context Root element to initialize. Defaults to `document.body`.
2487
- * @param options Options for each component.
2488
- */
2489
- declare function AutoInit(context?: HTMLElement, options?: Partial<AutoInitOptions>): void;
2490
-
2491
- export { AutoInit, type AutoInitOptions, Autocomplete, Cards, Carousel, CharacterCounter, Chips, Collapsible, Datepicker, Dropdown, FloatingActionButton, FormSelect, Forms, Materialbox, Modal, Parallax, Pushpin, Range, ScrollSpy, Sidenav, Slider, Tabs, TapTarget, Timepicker, Toast, Tooltip, Waves, version };
1
+ /**
2
+ * Base options for component initialization.
3
+ */
4
+ interface BaseOptions$1 {
5
+ }
6
+ type MElement = HTMLElement | Element;
7
+ type InitElements<T extends MElement> = NodeListOf<T> | HTMLCollectionOf<T>;
8
+ type ComponentConstructor<T extends Component<O>, O extends BaseOptions$1> = {
9
+ new (el: HTMLElement, options: Partial<O>): T;
10
+ };
11
+ type ComponentType<C extends Component<O>, O extends BaseOptions$1> = ComponentConstructor<C, O> & typeof Component<O>;
12
+ interface I18nOptions {
13
+ cancel: string;
14
+ clear: string;
15
+ done: string;
16
+ }
17
+ interface Openable {
18
+ isOpen: boolean;
19
+ open(): void;
20
+ close(): void;
21
+ }
22
+ /**
23
+ * Base class implementation for Materialize components.
24
+ */
25
+ declare class Component<O extends BaseOptions$1> {
26
+ /**
27
+ * The DOM element the plugin was initialized with.
28
+ */
29
+ el: HTMLElement;
30
+ /**
31
+ * The options the instance was initialized with.
32
+ */
33
+ options: O;
34
+ /**
35
+ * Constructs component instance and set everything up.
36
+ */
37
+ constructor(el: HTMLElement, options: Partial<O>, classDef: ComponentType<Component<O>, O>);
38
+ /**
39
+ * Initializes component instance.
40
+ * @param el HTML element.
41
+ * @param options Component options.
42
+ * @param classDef Class definition.
43
+ */
44
+ protected static init<I extends HTMLElement, O extends BaseOptions$1, C extends Component<O>>(el: I, options: O, classDef: ComponentType<C, O>): C;
45
+ /**
46
+ * Initializes component instances.
47
+ * @param els HTML elements.
48
+ * @param options Component options.
49
+ * @param classDef Class definition.
50
+ */
51
+ protected static init<I extends MElement, O extends BaseOptions$1, C extends Component<O>>(els: InitElements<I>, options: Partial<O>, classDef: ComponentType<C, O>): C[];
52
+ /**
53
+ * Initializes component instances.
54
+ * @param els HTML elements.
55
+ * @param options Component options.
56
+ * @param classDef Class definition.
57
+ */
58
+ protected static init<I extends MElement, O extends BaseOptions$1, C extends Component<O>>(els: I | InitElements<I>, options: Partial<O>, classDef: ComponentType<C, O>): C | C[];
59
+ /**
60
+ * @returns default options for component instance.
61
+ */
62
+ static get defaults(): BaseOptions$1;
63
+ /**
64
+ * Retrieves component instance for the given element.
65
+ * @param el Associated HTML Element.
66
+ */
67
+ static getInstance(el: HTMLElement): Component<BaseOptions$1>;
68
+ /**
69
+ * Destroy plugin instance and teardown.
70
+ */
71
+ destroy(): void;
72
+ }
73
+
74
+ interface DropdownOptions extends BaseOptions$1 {
75
+ /**
76
+ * Defines the edge the menu is aligned to.
77
+ * @default 'left'
78
+ */
79
+ alignment: 'left' | 'right';
80
+ /**
81
+ * If true, automatically focus dropdown el for keyboard.
82
+ * @default true
83
+ */
84
+ autoFocus: boolean;
85
+ /**
86
+ * If true, constrainWidth to the size of the dropdown activator.
87
+ * @default true
88
+ */
89
+ constrainWidth: boolean;
90
+ /**
91
+ * Provide an element that will be the bounding container of the dropdown.
92
+ * @default null
93
+ */
94
+ container: Element;
95
+ /**
96
+ * If false, the dropdown will show below the trigger.
97
+ * @default true
98
+ */
99
+ coverTrigger: boolean;
100
+ /**
101
+ * If true, close dropdown on item click.
102
+ * @default true
103
+ */
104
+ closeOnClick: boolean;
105
+ /**
106
+ * If true, the dropdown will open on hover.
107
+ * @default false
108
+ */
109
+ hover: boolean;
110
+ /**
111
+ * The duration of the transition enter in milliseconds.
112
+ * @default 150
113
+ */
114
+ inDuration: number;
115
+ /**
116
+ * The duration of the transition out in milliseconds.
117
+ * @default 250
118
+ */
119
+ outDuration: number;
120
+ /**
121
+ * Function called when dropdown starts entering.
122
+ * @default null
123
+ */
124
+ onOpenStart: (el: HTMLElement) => void;
125
+ /**
126
+ * Function called when dropdown finishes entering.
127
+ * @default null
128
+ */
129
+ onOpenEnd: (el: HTMLElement) => void;
130
+ /**
131
+ * Function called when dropdown starts exiting.
132
+ * @default null
133
+ */
134
+ onCloseStart: (el: HTMLElement) => void;
135
+ /**
136
+ * Function called when dropdown finishes exiting.
137
+ * @default null
138
+ */
139
+ onCloseEnd: (el: HTMLElement) => void;
140
+ /**
141
+ * Function called when item is clicked.
142
+ * @default null
143
+ */
144
+ onItemClick: (el: HTMLLIElement) => void;
145
+ }
146
+ declare class Dropdown extends Component<DropdownOptions> implements Openable {
147
+ static _dropdowns: Dropdown[];
148
+ /** ID of the dropdown element. */
149
+ id: string;
150
+ /** The DOM element of the dropdown. */
151
+ dropdownEl: HTMLElement;
152
+ /** If the dropdown is open. */
153
+ isOpen: boolean;
154
+ /** If the dropdown content is scrollable. */
155
+ isScrollable: boolean;
156
+ isTouchMoving: boolean;
157
+ /** The index of the item focused. */
158
+ focusedIndex: number;
159
+ filterQuery: string[];
160
+ filterTimeout: NodeJS.Timeout | number;
161
+ constructor(el: HTMLElement, options: Partial<DropdownOptions>);
162
+ static get defaults(): DropdownOptions;
163
+ /**
164
+ * Initializes instance of Dropdown.
165
+ * @param el HTML element.
166
+ * @param options Component options.
167
+ */
168
+ static init(el: HTMLElement, options?: Partial<DropdownOptions>): Dropdown;
169
+ /**
170
+ * Initializes instances of Dropdown.
171
+ * @param els HTML elements.
172
+ * @param options Component options.
173
+ */
174
+ static init(els: InitElements<MElement>, options?: Partial<DropdownOptions>): Dropdown[];
175
+ static getInstance(el: HTMLElement): Dropdown;
176
+ destroy(): void;
177
+ _setupEventHandlers(): void;
178
+ _removeEventHandlers(): void;
179
+ _setupTemporaryEventHandlers(): void;
180
+ _removeTemporaryEventHandlers(): void;
181
+ _handleClick: (e: MouseEvent) => void;
182
+ _handleMouseEnter: () => void;
183
+ _handleMouseLeave: (e: MouseEvent) => void;
184
+ _handleDocumentClick: (e: MouseEvent) => void;
185
+ _handleTriggerKeydown: (e: KeyboardEvent) => void;
186
+ _handleDocumentTouchmove: (e: TouchEvent) => void;
187
+ _handleDropdownClick: (e: MouseEvent) => void;
188
+ _handleDropdownKeydown: (e: KeyboardEvent) => void;
189
+ _handleWindowResize: () => void;
190
+ _resetFilterQuery: () => void;
191
+ _resetDropdownStyles(): void;
192
+ _resetDropdownPositioningStyles(): void;
193
+ _moveDropdownToElement(containerEl?: HTMLElement): void;
194
+ _makeDropdownFocusable(): void;
195
+ _focusFocusedItem(): void;
196
+ _getDropdownPosition(closestOverflowParent: HTMLElement): {
197
+ x: number;
198
+ y: number;
199
+ verticalAlignment: string;
200
+ horizontalAlignment: "left" | "right";
201
+ height: number;
202
+ width: number;
203
+ };
204
+ _animateIn(): void;
205
+ _animateOut(): void;
206
+ private _getClosestAncestor;
207
+ _placeDropdown(): void;
208
+ /**
209
+ * Open dropdown.
210
+ */
211
+ open: () => void;
212
+ /**
213
+ * Close dropdown.
214
+ */
215
+ close: () => void;
216
+ /**
217
+ * While dropdown is open, you can recalculate its dimensions if its contents have changed.
218
+ */
219
+ recalculateDimensions: () => void;
220
+ }
221
+
222
+ interface AutocompleteData {
223
+ /**
224
+ * A primitive value that can be converted to string.
225
+ * If "text" is not provided, it will also be used as "option text" as well
226
+ */
227
+ id: string | number;
228
+ /**
229
+ * This optional attribute is used as "display value" for the current entry.
230
+ * When provided, it will also be taken into consideration by the standard search function.
231
+ */
232
+ text?: string;
233
+ /**
234
+ * This optional attribute is used to provide a valid image URL to the current option.
235
+ */
236
+ image?: string;
237
+ /**
238
+ * Optional attributes which describes the option.
239
+ */
240
+ description?: string;
241
+ }
242
+ interface AutocompleteOptions extends BaseOptions$1 {
243
+ /**
244
+ * Data object defining autocomplete options with
245
+ * optional icon strings.
246
+ */
247
+ data: AutocompleteData[];
248
+ /**
249
+ * Flag which can be set if multiple values can be selected. The Result will be an Array.
250
+ * @default false
251
+ */
252
+ isMultiSelect: boolean;
253
+ /**
254
+ * Callback for when autocompleted.
255
+ */
256
+ onAutocomplete: (entries: AutocompleteData[]) => void;
257
+ /**
258
+ * Minimum number of characters before autocomplete starts.
259
+ * @default 1
260
+ */
261
+ minLength: number;
262
+ /**
263
+ * The height of the Menu which can be set via css-property.
264
+ * @default '300px'
265
+ */
266
+ maxDropDownHeight: string;
267
+ /**
268
+ * Function is called when the input text is altered and data can also be loaded asynchronously.
269
+ * If the results are collected the items in the list can be updated via the function setMenuItems(collectedItems).
270
+ * @param text Searched text.
271
+ * @param autocomplete Current autocomplete instance.
272
+ */
273
+ onSearch: (text: string, autocomplete: Autocomplete) => void;
274
+ /**
275
+ * If true will render the key from each item directly as HTML.
276
+ * User input MUST be properly sanitized first.
277
+ * @default false
278
+ */
279
+ allowUnsafeHTML: boolean;
280
+ /**
281
+ * Pass options object to select dropdown initialization.
282
+ * @default {}
283
+ */
284
+ dropdownOptions: Partial<DropdownOptions>;
285
+ /**
286
+ * Predefined selected values
287
+ */
288
+ selected: number[] | string[];
289
+ }
290
+ declare class Autocomplete extends Component<AutocompleteOptions> {
291
+ el: HTMLInputElement;
292
+ /** If the autocomplete is open. */
293
+ isOpen: boolean;
294
+ /** Number of matching autocomplete options. */
295
+ count: number;
296
+ /** Index of the current selected option. */
297
+ activeIndex: number;
298
+ private oldVal;
299
+ private $active;
300
+ private _mousedown;
301
+ container: HTMLElement;
302
+ /** Instance of the dropdown plugin for this autocomplete. */
303
+ dropdown: Dropdown;
304
+ static _keydown: boolean;
305
+ selectedValues: AutocompleteData[];
306
+ menuItems: AutocompleteData[];
307
+ data: AutocompleteData[];
308
+ constructor(el: HTMLInputElement, options: Partial<AutocompleteOptions>);
309
+ static get defaults(): AutocompleteOptions;
310
+ /**
311
+ * Initializes instance of Autocomplete.
312
+ * @param el HTML element.
313
+ * @param options Component options.
314
+ */
315
+ static init(el: HTMLInputElement, options?: Partial<AutocompleteOptions>): Autocomplete;
316
+ /**
317
+ * Initializes instances of Autocomplete.
318
+ * @param els HTML elements.
319
+ * @param options Component options.
320
+ */
321
+ static init(els: InitElements<HTMLInputElement | MElement>, options?: Partial<AutocompleteOptions>): Autocomplete[];
322
+ static getInstance(el: HTMLElement): Autocomplete;
323
+ destroy(): void;
324
+ _setupEventHandlers(): void;
325
+ _removeEventHandlers(): void;
326
+ _setupDropdown(): void;
327
+ _removeDropdown(): void;
328
+ _handleInputBlur: () => void;
329
+ _handleInputKeyup: (e: KeyboardEvent) => void;
330
+ _handleInputFocus: () => void;
331
+ _inputChangeDetection: (value: string) => void;
332
+ _handleInputKeydown: (e: KeyboardEvent) => void;
333
+ _handleInputClick: () => void;
334
+ _handleContainerMousedownAndTouchstart: () => void;
335
+ _handleContainerMouseupAndTouchend: () => void;
336
+ _resetCurrentElementPosition(): void;
337
+ _resetAutocomplete(): void;
338
+ _highlightPartialText(input: string, label: string): string[];
339
+ _createDropdownItem(entry: AutocompleteData): HTMLLIElement;
340
+ _renderDropdown(): void;
341
+ _setStatusLoading(): void;
342
+ _updateSelectedInfo(): void;
343
+ _refreshInputText(): void;
344
+ _triggerChanged(): void;
345
+ /**
346
+ * Show autocomplete.
347
+ */
348
+ open: () => void;
349
+ /**
350
+ * Hide autocomplete.
351
+ */
352
+ close: () => void;
353
+ /**
354
+ * Updates the visible or selectable items shown in the menu.
355
+ * @param menuItems Items to be available.
356
+ * @param selected Selected item ids
357
+ * @param open Option to conditionally open dropdown
358
+ * @param initial Condition to set initial data
359
+ */
360
+ setMenuItems(menuItems: AutocompleteData[], selected?: number[] | string[], open?: boolean, initial?: boolean): void;
361
+ /**
362
+ * Sets selected values.
363
+ * @deprecated @see https://github.com/materializecss/materialize/issues/552
364
+ * @param entries
365
+ */
366
+ setValues(entries: AutocompleteData[]): void;
367
+ /**
368
+ * Select a specific autocomplete option via id-property.
369
+ * @param id The id of a data-entry.
370
+ */
371
+ selectOption(id: number | string): void;
372
+ selectOptions(ids: []): void;
373
+ }
374
+
375
+ interface FloatingActionButtonOptions extends BaseOptions$1 {
376
+ /**
377
+ * Direction FAB menu opens.
378
+ * @default "top"
379
+ */
380
+ direction: 'top' | 'right' | 'bottom' | 'left';
381
+ /**
382
+ * true: FAB menu appears on hover, false: FAB menu appears on click.
383
+ * @default true
384
+ */
385
+ hoverEnabled: boolean;
386
+ /**
387
+ * Enable transit the FAB into a toolbar on click.
388
+ * @default false
389
+ */
390
+ toolbarEnabled: boolean;
391
+ }
392
+ declare class FloatingActionButton extends Component<FloatingActionButtonOptions> implements Openable {
393
+ #private;
394
+ /**
395
+ * Describes open/close state of FAB.
396
+ */
397
+ isOpen: boolean;
398
+ offsetY: number;
399
+ offsetX: number;
400
+ btnBottom: number;
401
+ btnLeft: number;
402
+ btnWidth: number;
403
+ constructor(el: HTMLElement, options: Partial<FloatingActionButtonOptions>);
404
+ static get defaults(): FloatingActionButtonOptions;
405
+ /**
406
+ * Initializes instance of FloatingActionButton.
407
+ * @param el HTML element.
408
+ * @param options Component options.
409
+ */
410
+ static init(el: HTMLElement, options?: Partial<FloatingActionButtonOptions>): FloatingActionButton;
411
+ /**
412
+ * Initializes instances of FloatingActionButton.
413
+ * @param els HTML elements.
414
+ * @param options Component options.
415
+ */
416
+ static init(els: InitElements<MElement>, options?: Partial<FloatingActionButtonOptions>): FloatingActionButton[];
417
+ static getInstance(el: HTMLElement): FloatingActionButton;
418
+ destroy(): void;
419
+ /**
420
+ * Open FAB.
421
+ */
422
+ open: () => void;
423
+ /**
424
+ * Close FAB.
425
+ */
426
+ close: () => void;
427
+ }
428
+
429
+ interface CardsOptions extends BaseOptions$1 {
430
+ onOpen: (el: Element) => void;
431
+ onClose: (el: Element) => void;
432
+ inDuration: number;
433
+ outDuration: number;
434
+ }
435
+ declare class Cards extends Component<CardsOptions> implements Openable {
436
+ #private;
437
+ isOpen: boolean;
438
+ constructor(el: HTMLElement, options: Partial<CardsOptions>);
439
+ static get defaults(): CardsOptions;
440
+ /**
441
+ * Initializes instance of Cards.
442
+ * @param el HTML element.
443
+ * @param options Component options.
444
+ */
445
+ static init(el: HTMLElement, options?: Partial<CardsOptions>): Cards;
446
+ /**
447
+ * Initializes instances of Cards.
448
+ * @param els HTML elements.
449
+ * @param options Component options.
450
+ */
451
+ static init(els: InitElements<MElement>, options?: Partial<CardsOptions>): Cards[];
452
+ static getInstance(el: HTMLElement): Cards;
453
+ /**
454
+ * {@inheritDoc}
455
+ */
456
+ destroy(): void;
457
+ /**
458
+ * Show card reveal.
459
+ */
460
+ open: () => void;
461
+ /**
462
+ * Hide card reveal.
463
+ */
464
+ close: () => void;
465
+ static Init(): void;
466
+ }
467
+
468
+ interface CarouselOptions extends BaseOptions$1 {
469
+ /**
470
+ * Transition duration in milliseconds.
471
+ * @default 200
472
+ */
473
+ duration: number;
474
+ /**
475
+ * Perspective zoom. If 0, all items are the same size.
476
+ * @default -100
477
+ */
478
+ dist: number;
479
+ /**
480
+ * Set the spacing of the center item.
481
+ * @default 0
482
+ */
483
+ shift: number;
484
+ /**
485
+ * Set the padding between non center items.
486
+ * @default 0
487
+ */
488
+ padding: number;
489
+ /**
490
+ * Set the number of visible items.
491
+ * @default 5
492
+ */
493
+ numVisible: number;
494
+ /**
495
+ * Make the carousel a full width slider like the second example.
496
+ * @default false
497
+ */
498
+ fullWidth: boolean;
499
+ /**
500
+ * Set to true to show indicators.
501
+ * @default false
502
+ */
503
+ indicators: boolean;
504
+ /**
505
+ * Don't wrap around and cycle through items.
506
+ * @default false
507
+ */
508
+ noWrap: boolean;
509
+ /**
510
+ * Callback for when a new slide is cycled to.
511
+ * @default null
512
+ */
513
+ onCycleTo: (current: Element, dragged: boolean) => void;
514
+ }
515
+ declare class Carousel extends Component<CarouselOptions> {
516
+ hasMultipleSlides: boolean;
517
+ showIndicators: boolean;
518
+ noWrap: boolean;
519
+ /** If the carousel is being clicked or tapped. */
520
+ pressed: boolean;
521
+ /** If the carousel is currently being dragged. */
522
+ dragged: boolean;
523
+ offset: number;
524
+ target: number;
525
+ images: HTMLElement[];
526
+ itemWidth: number;
527
+ itemHeight: number;
528
+ dim: number;
529
+ _indicators: HTMLUListElement;
530
+ count: number;
531
+ xform: string;
532
+ verticalDragged: boolean;
533
+ reference: number;
534
+ referenceY: number;
535
+ velocity: number;
536
+ frame: number;
537
+ timestamp: number;
538
+ ticker: string | number | NodeJS.Timeout;
539
+ amplitude: number;
540
+ /** The index of the center carousel item. */
541
+ center: number;
542
+ imageHeight: number;
543
+ scrollingTimeout: number | NodeJS.Timeout;
544
+ oneTimeCallback: (current: Element, dragged: boolean) => void | null;
545
+ constructor(el: HTMLElement, options: Partial<CarouselOptions>);
546
+ static get defaults(): CarouselOptions;
547
+ /**
548
+ * Initializes instance of Carousel.
549
+ * @param el HTML element.
550
+ * @param options Component options.
551
+ */
552
+ static init(el: HTMLElement, options?: Partial<CarouselOptions>): Carousel;
553
+ /**
554
+ * Initializes instances of Carousel.
555
+ * @param els HTML elements.
556
+ * @param options Component options.
557
+ */
558
+ static init(els: InitElements<MElement>, options?: Partial<CarouselOptions>): Carousel[];
559
+ static getInstance(el: HTMLElement): Carousel;
560
+ destroy(): void;
561
+ _setupEventHandlers(): void;
562
+ _removeEventHandlers(): void;
563
+ _handleThrottledResize: () => void;
564
+ _handleCarouselTap: (e: MouseEvent | TouchEvent) => void;
565
+ _handleCarouselDrag: (e: MouseEvent | TouchEvent) => boolean;
566
+ _handleCarouselRelease: (e: MouseEvent | TouchEvent) => boolean;
567
+ _handleCarouselClick: (e: MouseEvent | TouchEvent) => boolean;
568
+ _handleIndicatorClick: (e: Event) => void;
569
+ _handleIndicatorKeyPress: (e: KeyboardEvent) => void;
570
+ _handleIndicatorInteraction: (e: Event) => void;
571
+ _handleResize: () => void;
572
+ _setCarouselHeight(imageOnly?: boolean): void;
573
+ _xpos(e: MouseEvent | TouchEvent): number;
574
+ _ypos(e: MouseEvent | TouchEvent): number;
575
+ _wrap(x: number): any;
576
+ _track: () => void;
577
+ _autoScroll: () => void;
578
+ _scroll(x?: number): void;
579
+ _updateItemStyle(el: HTMLElement, opacity: number, zIndex: number, transform: string): void;
580
+ _cycleTo(n: number, callback?: CarouselOptions['onCycleTo']): void;
581
+ /**
582
+ * Move carousel to next slide or go forward a given amount of slides.
583
+ * @param n How many times the carousel slides.
584
+ */
585
+ next(n?: number): void;
586
+ /**
587
+ * Move carousel to previous slide or go back a given amount of slides.
588
+ * @param n How many times the carousel slides.
589
+ */
590
+ prev(n?: number): void;
591
+ /**
592
+ * Move carousel to nth slide.
593
+ * @param n Index of slide.
594
+ * @param callback "onCycleTo" optional callback.
595
+ */
596
+ set(n: number, callback?: CarouselOptions['onCycleTo']): void;
597
+ }
598
+
599
+ interface ChipData {
600
+ /** Unique identifier. */
601
+ id: number | string;
602
+ /** Chip text. If not specified, "id" will be used. */
603
+ text?: string;
604
+ /** Chip image (URL). */
605
+ image?: string;
606
+ }
607
+ interface ChipsOptions extends BaseOptions$1 {
608
+ /**
609
+ * Set the chip data.
610
+ * @default []
611
+ */
612
+ data: ChipData[];
613
+ /**
614
+ * Set first placeholder when there are no tags.
615
+ * @default ""
616
+ */
617
+ placeholder: string;
618
+ /**
619
+ * Set second placeholder when adding additional tags.
620
+ * @default ""
621
+ */
622
+ secondaryPlaceholder: string;
623
+ /**
624
+ * Set autocomplete options.
625
+ * @default {}
626
+ */
627
+ autocompleteOptions: Partial<AutocompleteOptions>;
628
+ /**
629
+ * Toggles abililty to add custom value not in autocomplete list.
630
+ * @default false
631
+ */
632
+ autocompleteOnly: boolean;
633
+ /**
634
+ * Set chips limit.
635
+ * @default Infinity
636
+ */
637
+ limit: number;
638
+ /**
639
+ * Specifies class to be used in "close" button (useful when working with Material Symbols icon set).
640
+ * @default 'material-icons'
641
+ */
642
+ closeIconClass: string;
643
+ /**
644
+ * Specifies option to render user input field
645
+ * @default false;
646
+ */
647
+ allowUserInput: boolean;
648
+ /**
649
+ * Callback for chip add.
650
+ * @default null
651
+ */
652
+ onChipAdd: (element: HTMLElement, chip: HTMLElement) => void;
653
+ /**
654
+ * Callback for chip select.
655
+ * @default null
656
+ */
657
+ onChipSelect: (element: HTMLElement, chip: HTMLElement) => void;
658
+ /**
659
+ * Callback for chip delete.
660
+ * @default null
661
+ */
662
+ onChipDelete: (element: HTMLElement, chip: HTMLElement) => void;
663
+ }
664
+ declare class Chips extends Component<ChipsOptions> {
665
+ #private;
666
+ /** Array of the current chips data. */
667
+ chipsData: ChipData[];
668
+ /** If the chips has autocomplete enabled. */
669
+ hasAutocomplete: boolean;
670
+ /** Autocomplete instance, if any. */
671
+ autocomplete: Autocomplete;
672
+ constructor(el: HTMLElement, options: Partial<ChipsOptions>);
673
+ static get defaults(): ChipsOptions;
674
+ /**
675
+ * Initializes instance of Chips.
676
+ * @param el HTML element.
677
+ * @param options Component options.
678
+ */
679
+ static init(el: HTMLElement, options?: Partial<ChipsOptions>): Chips;
680
+ /**
681
+ * Initializes instances of Chips.
682
+ * @param els HTML elements.
683
+ * @param options Component options.
684
+ */
685
+ static init(els: InitElements<MElement>, options?: Partial<ChipsOptions>): Chips[];
686
+ static getInstance(el: HTMLElement): Chips;
687
+ getData(): ChipData[];
688
+ destroy(): void;
689
+ /**
690
+ * Add chip to input.
691
+ * @param chip Chip data object
692
+ */
693
+ addChip(chip: ChipData): void;
694
+ /**
695
+ * Delete nth chip.
696
+ * @param chipIndex Index of chip
697
+ */
698
+ deleteChip(chipIndex: number): void;
699
+ /**
700
+ * Select nth chip.
701
+ * @param chipIndex Index of chip
702
+ */
703
+ selectChip(chipIndex: number): void;
704
+ static Init(): void;
705
+ }
706
+
707
+ interface CollapsibleOptions extends BaseOptions$1 {
708
+ /**
709
+ * If accordion versus collapsible.
710
+ * @default true
711
+ */
712
+ accordion: boolean;
713
+ /**
714
+ * Transition in duration in milliseconds.
715
+ * @default 300
716
+ */
717
+ inDuration: number;
718
+ /**
719
+ * Transition out duration in milliseconds.
720
+ * @default 300
721
+ */
722
+ outDuration: number;
723
+ /**
724
+ * Callback function called before collapsible is opened.
725
+ * @default null
726
+ */
727
+ onOpenStart: (el: Element) => void;
728
+ /**
729
+ * Callback function called after collapsible is opened.
730
+ * @default null
731
+ */
732
+ onOpenEnd: (el: Element) => void;
733
+ /**
734
+ * Callback function called before collapsible is closed.
735
+ * @default null
736
+ */
737
+ onCloseStart: (el: Element) => void;
738
+ /**
739
+ * Callback function called after collapsible is closed.
740
+ * @default null
741
+ */
742
+ onCloseEnd: (el: Element) => void;
743
+ }
744
+ declare class Collapsible extends Component<CollapsibleOptions> {
745
+ private _headers;
746
+ constructor(el: HTMLElement, options: Partial<CollapsibleOptions>);
747
+ static get defaults(): CollapsibleOptions;
748
+ /**
749
+ * Initializes instance of Collapsible.
750
+ * @param el HTML element.
751
+ * @param options Component options.
752
+ */
753
+ static init(el: HTMLElement, options?: Partial<CollapsibleOptions>): Collapsible;
754
+ /**
755
+ * Initializes instances of Collapsible.
756
+ * @param els HTML elements.
757
+ * @param options Component options.
758
+ */
759
+ static init(els: InitElements<MElement>, options?: Partial<CollapsibleOptions>): Collapsible[];
760
+ static getInstance(el: HTMLElement): Collapsible;
761
+ destroy(): void;
762
+ _setupEventHandlers(): void;
763
+ _removeEventHandlers(): void;
764
+ _handleCollapsibleClick: (e: MouseEvent | KeyboardEvent) => void;
765
+ _handleCollapsibleKeydown: (e: KeyboardEvent) => void;
766
+ private _setExpanded;
767
+ _animateIn(index: number): void;
768
+ _animateOut(index: number): void;
769
+ /**
770
+ * Open collapsible section.
771
+ * @param n Nth section to open.
772
+ */
773
+ open: (index: number) => void;
774
+ /**
775
+ * Close collapsible section.
776
+ * @param n Nth section to close.
777
+ */
778
+ close: (index: number) => void;
779
+ }
780
+
781
+ interface DateI18nOptions extends I18nOptions {
782
+ previousMonth: string;
783
+ nextMonth: string;
784
+ months: string[];
785
+ monthsShort: string[];
786
+ weekdays: string[];
787
+ weekdaysShort: string[];
788
+ weekdaysAbbrev: string[];
789
+ }
790
+ interface DatepickerOptions extends BaseOptions$1 {
791
+ /**
792
+ * The date output format for the input field value
793
+ * or a function taking the date and outputting the
794
+ * formatted date string.
795
+ * @default 'mmm dd, yyyy'
796
+ */
797
+ format: string | ((d: Date) => string);
798
+ /**
799
+ * Used to create date object from current input string.
800
+ * @default null
801
+ */
802
+ parse: ((value: string, format: string) => Date) | null;
803
+ /**
804
+ * The initial condition if the datepicker is based on date range.
805
+ * @default false
806
+ */
807
+ isDateRange: boolean;
808
+ /**
809
+ * The selector of the user specified date range end element
810
+ */
811
+ dateRangeEndEl: string | null;
812
+ /**
813
+ * The initial condition if the datepicker is based on multiple date selection.
814
+ * @default false
815
+ */
816
+ isMultipleSelection: boolean;
817
+ /**
818
+ * The initial date to view when first opened.
819
+ * @default null
820
+ */
821
+ defaultDate: Date | null;
822
+ /**
823
+ * The initial end date to view when first opened.
824
+ * @default null
825
+ */
826
+ defaultEndDate: Date | null;
827
+ /**
828
+ * Make the `defaultDate` the initial selected value.
829
+ * @default false
830
+ */
831
+ setDefaultDate: boolean;
832
+ /**
833
+ * Make the `defaultEndDate` the initial selected value.
834
+ * @default false
835
+ */
836
+ setDefaultEndDate: boolean;
837
+ /**
838
+ * Prevent selection of any date on the weekend.
839
+ * @default false
840
+ */
841
+ disableWeekends: boolean;
842
+ /**
843
+ * Custom function to disable certain days.
844
+ * @default null
845
+ */
846
+ disableDayFn: ((day: Date) => boolean) | null;
847
+ /**
848
+ * First day of week (0: Sunday, 1: Monday etc).
849
+ * @default 0
850
+ */
851
+ firstDay: number;
852
+ /**
853
+ * The earliest date that can be selected.
854
+ * @default null
855
+ */
856
+ minDate: Date | null;
857
+ /**
858
+ * The latest date that can be selected.
859
+ * @default null
860
+ */
861
+ maxDate: Date | null;
862
+ /**
863
+ * Number of years either side, or array of upper/lower range.
864
+ * @default 10
865
+ */
866
+ yearRange: number | number[];
867
+ /**
868
+ * Sort year range in reverse order.
869
+ * @default false
870
+ */
871
+ yearRangeReverse: boolean;
872
+ /**
873
+ * Changes Datepicker to RTL.
874
+ * @default false
875
+ */
876
+ isRTL: boolean;
877
+ /**
878
+ * Show month after year in Datepicker title.
879
+ * @default false
880
+ */
881
+ showMonthAfterYear: boolean;
882
+ /**
883
+ * Render days of the calendar grid that fall in the next
884
+ * or previous month.
885
+ * @default false
886
+ */
887
+ showDaysInNextAndPreviousMonths: boolean;
888
+ /**
889
+ * Specify if the docked datepicker is in open state by default
890
+ */
891
+ openByDefault: boolean;
892
+ /**
893
+ * Specify a DOM element OR selector for a DOM element to render
894
+ * the calendar in, by default it will be placed before the input.
895
+ * @default null
896
+ */
897
+ container: HTMLElement | string | null;
898
+ /**
899
+ * Show the clear button in the datepicker.
900
+ * @default false
901
+ */
902
+ showClearBtn: boolean;
903
+ /**
904
+ * Autosubmit calendar day select to input field
905
+ * @default false
906
+ */
907
+ autoSubmit: true;
908
+ /**
909
+ * Internationalization options.
910
+ */
911
+ i18n: Partial<DateI18nOptions>;
912
+ /**
913
+ * An array of string returned by `Date.toDateString()`,
914
+ * indicating there are events in the specified days.
915
+ * @default []
916
+ */
917
+ events: string[];
918
+ /**
919
+ * Callback function when date is selected,
920
+ * first parameter is the newly selected date.
921
+ * @default null
922
+ */
923
+ onSelect: ((selectedDate: Date) => void) | null;
924
+ /**
925
+ * Callback function when Datepicker is closed.
926
+ * @default null
927
+ */
928
+ /**
929
+ * Callback function when Datepicker HTML is refreshed.
930
+ * @default null
931
+ */
932
+ onDraw: (() => void) | null;
933
+ /**
934
+ * Callback function for interaction with input field.
935
+ * @default null
936
+ */
937
+ onInputInteraction: (() => void) | null;
938
+ /**
939
+ * Callback function for interaction with confirm button.
940
+ * @default null
941
+ */
942
+ onConfirm: (() => void) | null;
943
+ /**
944
+ * Callback function for interaction with close button.
945
+ * @default null
946
+ */
947
+ onCancel: (() => void) | null;
948
+ /** Field used for internal calculations DO NOT CHANGE IT */
949
+ minYear?: number;
950
+ /** Field used for internal calculations DO NOT CHANGE IT */
951
+ maxYear?: number;
952
+ /** Field used for internal calculations DO NOT CHANGE IT */
953
+ minMonth?: number;
954
+ /** Field used for internal calculations DO NOT CHANGE IT */
955
+ maxMonth?: number;
956
+ /** Field used for internal calculations DO NOT CHANGE IT */
957
+ startRange?: Date;
958
+ /** Field used for internal calculations DO NOT CHANGE IT */
959
+ endRange?: Date;
960
+ /**
961
+ * Display plugin
962
+ */
963
+ displayPlugin: string;
964
+ /**
965
+ * Configurable display plugin options
966
+ */
967
+ displayPluginOptions: object;
968
+ }
969
+ declare class Datepicker extends Component<DatepickerOptions> {
970
+ el: HTMLInputElement;
971
+ id: string;
972
+ multiple: boolean;
973
+ calendarEl: HTMLElement;
974
+ /** CLEAR button instance. */
975
+ /** DONE button instance */
976
+ containerEl: HTMLElement;
977
+ yearTextEl: HTMLElement;
978
+ dateTextEl: HTMLElement;
979
+ endDateEl: HTMLInputElement;
980
+ dateEls: HTMLInputElement[];
981
+ /** The selected Date. */
982
+ date: Date;
983
+ endDate: null | Date;
984
+ dates: Date[];
985
+ formats: object;
986
+ calendars: [{
987
+ month: number;
988
+ year: number;
989
+ }];
990
+ private _y;
991
+ private _m;
992
+ private displayPlugin;
993
+ private footer;
994
+ static _template: string;
995
+ constructor(el: HTMLInputElement, options: Partial<DatepickerOptions>);
996
+ static get defaults(): DatepickerOptions;
997
+ /**
998
+ * Initializes instance of Datepicker.
999
+ * @param el HTML element.
1000
+ * @param options Component options.
1001
+ */
1002
+ static init(el: HTMLInputElement, options?: Partial<DatepickerOptions>): Datepicker;
1003
+ /**
1004
+ * Initializes instances of Datepicker.
1005
+ * @param els HTML elements.
1006
+ * @param options Component options.
1007
+ */
1008
+ static init(els: InitElements<HTMLInputElement | MElement>, options?: Partial<DatepickerOptions>): Datepicker[];
1009
+ static _isDate(obj: any): boolean;
1010
+ static _isWeekend(date: any): boolean;
1011
+ /**
1012
+ * @deprecated as this function has no effect without any return statement or global parameter setter.
1013
+ */
1014
+ static _setToStartOfDay(date: any): void;
1015
+ static _getDaysInMonth(year: any, month: any): number;
1016
+ static _isLeapYear(year: any): boolean;
1017
+ static _compareDates(a: any, b: any): boolean;
1018
+ static _compareWithinRange(day: Date, date: Date, dateEnd: Date): boolean;
1019
+ static _comparePastDate(a: Date, b: Date): boolean;
1020
+ static getInstance(el: HTMLElement): Datepicker;
1021
+ destroy(): void;
1022
+ destroySelects(): void;
1023
+ _insertHTMLIntoDOM(): void;
1024
+ /**
1025
+ * Renders the date input format
1026
+ */
1027
+ _renderDateInputFormat(el: HTMLInputElement): void;
1028
+ /**
1029
+ * Gets a string representation of the given date.
1030
+ */
1031
+ toString(date?: Date, format?: string | ((d: Date) => string)): string;
1032
+ /**
1033
+ * Returns the formatted date.
1034
+ */
1035
+ formatDate(date: Date, format: string): string;
1036
+ /**
1037
+ * Sets date from input field.
1038
+ */
1039
+ setDateFromInput(el: HTMLInputElement): void;
1040
+ /**
1041
+ * Set a date on the datepicker.
1042
+ * @param date Date to set on the datepicker.
1043
+ * @param preventOnSelect Undocumented as of 5 March 2018.
1044
+ * @param isEndDate
1045
+ * @param fromUserInput
1046
+ */
1047
+ setDate(date?: Date, preventOnSelect?: boolean, isEndDate?: boolean, fromUserInput?: boolean): void;
1048
+ validateDate(date: Date): void | Date;
1049
+ /**
1050
+ * Set a single date on the datepicker.
1051
+ * @param date Date to set on the datepicker.
1052
+ * @param isEndDate
1053
+ */
1054
+ setSingleDate(date: Date, isEndDate: boolean): void;
1055
+ /**
1056
+ * Set a multi date on the datepicker.
1057
+ * @param date Date to set on the datepicker.
1058
+ */
1059
+ setMultiDate(date: Date): void;
1060
+ /**
1061
+ * Sets the data-date attribute on the date input field
1062
+ */
1063
+ setDataDate(el: any, date: any): void;
1064
+ /**
1065
+ * Sets dates on the input values.
1066
+ */
1067
+ setInputValues(): void;
1068
+ setMultipleSelectionInputValues(): void;
1069
+ /**
1070
+ * Sets given date as the input value on the given element.
1071
+ */
1072
+ setInputValue(el: any, date: any): void;
1073
+ /**
1074
+ * Display plugin setup.
1075
+ */
1076
+ _setupDisplayPlugin(): void;
1077
+ /**
1078
+ * Renders the date in the modal head section.
1079
+ */
1080
+ _renderDateDisplay(date: Date, endDate?: Date): void;
1081
+ /**
1082
+ * Change date view to a specific date on the datepicker.
1083
+ * @param date Date to show on the datepicker.
1084
+ */
1085
+ gotoDate(date: Date): void;
1086
+ adjustCalendars(): void;
1087
+ adjustCalendar(calendar: any): any;
1088
+ nextMonth(): void;
1089
+ prevMonth(): void;
1090
+ render(year: any, month: any, randId: any): string;
1091
+ renderDay(opts: any): string;
1092
+ renderRow(days: any, isRTL: any, isRowSelected: any): string;
1093
+ renderTable(opts: any, data: any, randId: any): string;
1094
+ renderHead(opts: any): string;
1095
+ renderBody(rows: any): string;
1096
+ renderTitle(instance: any, c: any, year: any, month: any, refYear: any, randId: any): string;
1097
+ draw(): void;
1098
+ _setupEventHandlers(): void;
1099
+ _setupVariables(): void;
1100
+ _pickerSetup(): void;
1101
+ _removeEventHandlers(): void;
1102
+ _handleInputClick: (e: any) => void;
1103
+ _handleInputKeydown: (e: KeyboardEvent) => void;
1104
+ _handleCalendarClick: (e: any) => void;
1105
+ _handleDateRangeCalendarClick: (date: Date) => void;
1106
+ _handleClearClick: () => void;
1107
+ _clearDates: () => void;
1108
+ _handleMonthChange: (e: any) => void;
1109
+ _handleYearChange: (e: any) => void;
1110
+ gotoMonth(month: any): void;
1111
+ gotoYear(year: any): void;
1112
+ _handleInputChange: (e: Event) => void;
1113
+ renderDayName(opts: any, day: any, abbr?: boolean): any;
1114
+ createDateInput(): HTMLInputElement;
1115
+ _finishSelection: () => void;
1116
+ _confirm: () => void;
1117
+ _cancel: () => void;
1118
+ open(): this;
1119
+ close(): this;
1120
+ }
1121
+
1122
+ declare class Forms {
1123
+ /**
1124
+ * Checks if the label has validation and apply
1125
+ * the correct class and styles
1126
+ * @param textfield
1127
+ */
1128
+ static validateField(textfield: HTMLInputElement): void;
1129
+ /**
1130
+ * Resizes the given TextArea after updating the
1131
+ * value content dynamically.
1132
+ * @param e EventTarget
1133
+ */
1134
+ static textareaAutoResize(e: EventTarget): void;
1135
+ static Init(): void;
1136
+ static InitTextarea(textarea: HTMLTextAreaElement): void;
1137
+ static InitFileInputPath(fileInput: HTMLInputElement): void;
1138
+ }
1139
+
1140
+ interface MaterialboxOptions extends BaseOptions$1 {
1141
+ /**
1142
+ * Transition in duration in milliseconds.
1143
+ * @default 275
1144
+ */
1145
+ inDuration: number;
1146
+ /**
1147
+ * Transition out duration in milliseconds.
1148
+ * @default 200
1149
+ */
1150
+ outDuration: number;
1151
+ /**
1152
+ * Callback function called before materialbox is opened.
1153
+ * @default null
1154
+ */
1155
+ onOpenStart: (el: Element) => void;
1156
+ /**
1157
+ * Callback function called after materialbox is opened.
1158
+ * @default null
1159
+ */
1160
+ onOpenEnd: (el: Element) => void;
1161
+ /**
1162
+ * Callback function called before materialbox is closed.
1163
+ * @default null
1164
+ */
1165
+ onCloseStart: (el: Element) => void;
1166
+ /**
1167
+ * Callback function called after materialbox is closed.
1168
+ * @default null
1169
+ */
1170
+ onCloseEnd: (el: Element) => void;
1171
+ }
1172
+ declare class Materialbox extends Component<MaterialboxOptions> {
1173
+ /** If the materialbox overlay is showing. */
1174
+ overlayActive: boolean;
1175
+ /** If the materialbox is no longer being animated. */
1176
+ doneAnimating: boolean;
1177
+ /** Caption, if specified. */
1178
+ caption: string;
1179
+ /** Original width of image. */
1180
+ originalWidth: number;
1181
+ /** Original height of image. */
1182
+ originalHeight: number;
1183
+ private originInlineStyles;
1184
+ private placeholder;
1185
+ private _changedAncestorList;
1186
+ private newHeight;
1187
+ private newWidth;
1188
+ private windowWidth;
1189
+ private windowHeight;
1190
+ private attrWidth;
1191
+ private attrHeight;
1192
+ private _overlay;
1193
+ private _photoCaption;
1194
+ constructor(el: HTMLElement, options: Partial<MaterialboxOptions>);
1195
+ static get defaults(): MaterialboxOptions;
1196
+ /**
1197
+ * Initializes instance of MaterialBox.
1198
+ * @param el HTML element.
1199
+ * @param options Component options.
1200
+ */
1201
+ static init(el: HTMLElement, options?: Partial<MaterialboxOptions>): Materialbox;
1202
+ /**
1203
+ * Initializes instances of MaterialBox.
1204
+ * @param els HTML elements.
1205
+ * @param options Component options.
1206
+ */
1207
+ static init(els: InitElements<MElement>, options?: Partial<MaterialboxOptions>): Materialbox[];
1208
+ static getInstance(el: HTMLElement): Materialbox;
1209
+ destroy(): void;
1210
+ private _setupEventHandlers;
1211
+ private _removeEventHandlers;
1212
+ private _handleMaterialboxClick;
1213
+ private _handleMaterialboxKeypress;
1214
+ private _handleMaterialboxToggle;
1215
+ private _handleWindowScroll;
1216
+ private _handleWindowResize;
1217
+ private _handleWindowEscape;
1218
+ private _makeAncestorsOverflowVisible;
1219
+ private _offset;
1220
+ private _updateVars;
1221
+ private _animateImageIn;
1222
+ private _animateImageOut;
1223
+ private _addCaption;
1224
+ private _removeCaption;
1225
+ private _addOverlay;
1226
+ private _removeOverlay;
1227
+ /**
1228
+ * Open materialbox.
1229
+ */
1230
+ open: () => void;
1231
+ /**
1232
+ * Close materialbox.
1233
+ */
1234
+ close: () => void;
1235
+ }
1236
+
1237
+ interface ModalOptions extends BaseOptions$1 {
1238
+ opacity: number;
1239
+ inDuration: number;
1240
+ outDuration: number;
1241
+ preventScrolling: boolean;
1242
+ onOpenStart: (this: Modal, el: HTMLElement) => void;
1243
+ onOpenEnd: (this: Modal, el: HTMLElement) => void;
1244
+ onCloseStart: (el: HTMLElement) => void;
1245
+ onCloseEnd: (el: HTMLElement) => void;
1246
+ dismissible: boolean;
1247
+ startingTop: string;
1248
+ endingTop: string;
1249
+ }
1250
+ declare class Modal extends Component<ModalOptions> {
1251
+ #private;
1252
+ constructor(el: HTMLElement, options: Partial<ModalOptions>);
1253
+ static get defaults(): {
1254
+ opacity: number;
1255
+ inDuration: number;
1256
+ outDuration: number;
1257
+ onOpenStart: any;
1258
+ onOpenEnd: any;
1259
+ onCloseStart: any;
1260
+ onCloseEnd: any;
1261
+ preventScrolling: boolean;
1262
+ dismissible: boolean;
1263
+ startingTop: string;
1264
+ endingTop: string;
1265
+ };
1266
+ static init(el: HTMLElement, options?: Partial<ModalOptions>): Modal;
1267
+ static init(els: InitElements<MElement>, options?: Partial<ModalOptions>): Modal[];
1268
+ static getInstance(el: HTMLElement): Modal;
1269
+ destroy(): void;
1270
+ _setupEventHandlers(): void;
1271
+ _removeEventHandlers(): void;
1272
+ _handleTriggerClick(): void;
1273
+ _handleOverlayClick(): void;
1274
+ _handleModalCloseClick(): void;
1275
+ _handleKeydown(): void;
1276
+ _handleFocus(): void;
1277
+ open(): this;
1278
+ close(): this;
1279
+ static create(config: any): string | HTMLDialogElement;
1280
+ }
1281
+
1282
+ interface FormSelectOptions extends BaseOptions$1 {
1283
+ /**
1284
+ * Classes to be added to the select wrapper element.
1285
+ * @default ""
1286
+ */
1287
+ classes: string;
1288
+ /**
1289
+ * Pass options object to select dropdown initialization.
1290
+ * @default {}
1291
+ */
1292
+ dropdownOptions: Partial<DropdownOptions>;
1293
+ }
1294
+ type ValueStruct = {
1295
+ el: HTMLOptionElement;
1296
+ optionEl: HTMLElement;
1297
+ };
1298
+ declare class FormSelect extends Component<FormSelectOptions> {
1299
+ el: HTMLSelectElement;
1300
+ /** If this is a multiple select. */
1301
+ isMultiple: boolean;
1302
+ /**
1303
+ * Label associated with the current select element.
1304
+ * Is "null", if not detected.
1305
+ */
1306
+ labelEl: HTMLLabelElement;
1307
+ /** Dropdown UL element. */
1308
+ dropdownOptions: HTMLUListElement;
1309
+ /** Text input that shows current selected option. */
1310
+ input: HTMLInputElement;
1311
+ /** Instance of the dropdown plugin for this select. */
1312
+ dropdown: Dropdown;
1313
+ /** The select wrapper element. */
1314
+ wrapper: HTMLDivElement;
1315
+ selectOptions: (HTMLOptionElement | HTMLOptGroupElement)[];
1316
+ private _values;
1317
+ nativeTabIndex: number;
1318
+ constructor(el: HTMLSelectElement, options: FormSelectOptions);
1319
+ static get defaults(): FormSelectOptions;
1320
+ /**
1321
+ * Initializes instance of FormSelect.
1322
+ * @param el HTML element.
1323
+ * @param options Component options.
1324
+ */
1325
+ static init(el: HTMLSelectElement, options?: Partial<FormSelectOptions>): FormSelect;
1326
+ /**
1327
+ * Initializes instances of FormSelect.
1328
+ * @param els HTML elements.
1329
+ * @param options Component options.
1330
+ */
1331
+ static init(els: InitElements<HTMLSelectElement | MElement>, options?: Partial<FormSelectOptions>): FormSelect[];
1332
+ static getInstance(el: HTMLElement): FormSelect;
1333
+ destroy(): void;
1334
+ _setupEventHandlers(): void;
1335
+ _removeEventHandlers(): void;
1336
+ _handleSelectChange: () => void;
1337
+ _handleOptionClick: (e: MouseEvent | KeyboardEvent) => void;
1338
+ _arraysEqual<T, E>(a: T[], b: (E | T)[]): boolean;
1339
+ _selectOptionElement(virtualOption: HTMLElement): void;
1340
+ _handleInputClick: () => void;
1341
+ _setupDropdown(): void;
1342
+ _addOptionToValues(realOption: HTMLOptionElement, virtualOption: HTMLElement): void;
1343
+ _removeDropdown(): void;
1344
+ _createAndAppendOptionWithIcon(realOption: HTMLOptionElement | HTMLOptGroupElement, type: string): HTMLLIElement;
1345
+ _selectValue(value: ValueStruct): void;
1346
+ _deselectValue(value: ValueStruct): void;
1347
+ _deselectAll(): void;
1348
+ _isValueSelected(value: ValueStruct): boolean;
1349
+ _toggleEntryFromArray(value: ValueStruct): void;
1350
+ _getSelectedOptions(): HTMLOptionElement[];
1351
+ _setValueToInput(): void;
1352
+ _setSelectedStates(): void;
1353
+ _activateOption(ul: HTMLElement, li: HTMLElement): void;
1354
+ getSelectedValues(): string[];
1355
+ }
1356
+
1357
+ interface SidenavOptions extends BaseOptions$1 {
1358
+ /**
1359
+ * Side of screen on which Sidenav appears.
1360
+ * @default 'left'
1361
+ */
1362
+ edge: 'left' | 'right';
1363
+ /**
1364
+ * Allow swipe gestures to open/close Sidenav.
1365
+ * @default true
1366
+ */
1367
+ draggable: boolean;
1368
+ /**
1369
+ * Width of the area where you can start dragging.
1370
+ * @default '10px'
1371
+ */
1372
+ dragTargetWidth: string;
1373
+ /**
1374
+ * Length in ms of enter transition.
1375
+ * @default 250
1376
+ */
1377
+ inDuration: number;
1378
+ /**
1379
+ * Length in ms of exit transition.
1380
+ * @default 200
1381
+ */
1382
+ outDuration: number;
1383
+ /**
1384
+ * Prevent page from scrolling while sidenav is open.
1385
+ * @default true
1386
+ */
1387
+ preventScrolling: boolean;
1388
+ /**
1389
+ * Function called when sidenav starts entering.
1390
+ */
1391
+ onOpenStart: (elem: HTMLElement) => void;
1392
+ /**
1393
+ * Function called when sidenav finishes entering.
1394
+ */
1395
+ onOpenEnd: (elem: HTMLElement) => void;
1396
+ /**
1397
+ * Function called when sidenav starts exiting.
1398
+ */
1399
+ onCloseStart: (elem: HTMLElement) => void;
1400
+ /**
1401
+ * Function called when sidenav finishes exiting.
1402
+ */
1403
+ onCloseEnd: (elem: HTMLElement) => void;
1404
+ }
1405
+ declare class Sidenav extends Component<SidenavOptions> implements Openable {
1406
+ id: string;
1407
+ /** Describes open/close state of Sidenav. */
1408
+ isOpen: boolean;
1409
+ /** Describes if sidenav is fixed. */
1410
+ isFixed: boolean;
1411
+ /** Describes if Sidenav is being dragged. */
1412
+ isDragged: boolean;
1413
+ lastWindowWidth: number;
1414
+ lastWindowHeight: number;
1415
+ static _sidenavs: Sidenav[];
1416
+ private _overlay;
1417
+ dragTarget: Element;
1418
+ private _startingXpos;
1419
+ private _xPos;
1420
+ private _time;
1421
+ private _width;
1422
+ private _initialScrollTop;
1423
+ private _verticallyScrolling;
1424
+ private deltaX;
1425
+ private velocityX;
1426
+ private percentOpen;
1427
+ constructor(el: HTMLElement, options: Partial<SidenavOptions>);
1428
+ static get defaults(): SidenavOptions;
1429
+ /**
1430
+ * Initializes instance of Sidenav.
1431
+ * @param el HTML element.
1432
+ * @param options Component options.
1433
+ */
1434
+ static init(el: HTMLElement, options?: Partial<SidenavOptions>): Sidenav;
1435
+ /**
1436
+ * Initializes instances of Sidenav.
1437
+ * @param els HTML elements.
1438
+ * @param options Component options.
1439
+ */
1440
+ static init(els: InitElements<MElement>, options?: Partial<SidenavOptions>): Sidenav[];
1441
+ static getInstance(el: HTMLElement): Sidenav;
1442
+ destroy(): void;
1443
+ private _createOverlay;
1444
+ private _setupEventHandlers;
1445
+ private _removeEventHandlers;
1446
+ private _handleTriggerClick;
1447
+ private _startDrag;
1448
+ private _dragMoveUpdate;
1449
+ private _handleDragTargetDrag;
1450
+ private _handleDragTargetRelease;
1451
+ private _handleCloseDrag;
1452
+ private _calculateDelta;
1453
+ private _handleCloseRelease;
1454
+ private _handleCloseTriggerClick;
1455
+ private _handleWindowResize;
1456
+ private _setupClasses;
1457
+ private _removeClasses;
1458
+ private _setupFixed;
1459
+ private _isDraggable;
1460
+ private _isCurrentlyFixed;
1461
+ private _createDragTarget;
1462
+ private _preventBodyScrolling;
1463
+ private _enableBodyScrolling;
1464
+ /**
1465
+ * Opens Sidenav.
1466
+ */
1467
+ open: () => void;
1468
+ /**
1469
+ * Closes Sidenav.
1470
+ */
1471
+ close: () => void;
1472
+ private _animateIn;
1473
+ private _animateOut;
1474
+ private _animateSidenavIn;
1475
+ private _animateSidenavOut;
1476
+ private _animateOverlayIn;
1477
+ private _animateOverlayOut;
1478
+ private _setAriaHidden;
1479
+ private _setTabIndex;
1480
+ }
1481
+
1482
+ interface SliderOptions extends BaseOptions$1 {
1483
+ /**
1484
+ * Set to false to hide slide indicators.
1485
+ * @default true
1486
+ */
1487
+ indicators: boolean;
1488
+ /**
1489
+ * Set height of slider.
1490
+ * @default 400
1491
+ */
1492
+ height: number;
1493
+ /**
1494
+ * Set the duration of the transition animation in ms.
1495
+ * @default 500
1496
+ */
1497
+ duration: number;
1498
+ /**
1499
+ * Set the duration between transitions in ms.
1500
+ * @default 6000
1501
+ */
1502
+ interval: number;
1503
+ /**
1504
+ * If slider should pause when keyboard focus is received.
1505
+ * @default true
1506
+ */
1507
+ pauseOnFocus: boolean;
1508
+ /**
1509
+ * If slider should pause when is hovered by a pointer.
1510
+ * @default true
1511
+ */
1512
+ pauseOnHover: boolean;
1513
+ /**
1514
+ * Optional function used to generate ARIA label to indicators (for accessibility purposes).
1515
+ * @param index Current index, starting from "1".
1516
+ * @param current A which indicates whether it is the current element or not
1517
+ * @returns a string to be used as label indicator.
1518
+ * @default null
1519
+ */
1520
+ indicatorLabelFunc: (index: number, current: boolean) => string;
1521
+ }
1522
+ declare class Slider extends Component<SliderOptions> {
1523
+ /** Index of current slide. */
1524
+ activeIndex: number;
1525
+ interval: string | number | NodeJS.Timeout;
1526
+ eventPause: boolean;
1527
+ _slider: HTMLUListElement;
1528
+ _slides: HTMLLIElement[];
1529
+ _activeSlide: HTMLLIElement;
1530
+ _indicators: HTMLLIElement[];
1531
+ _hovered: boolean;
1532
+ _focused: boolean;
1533
+ _focusCurrent: boolean;
1534
+ _sliderId: string;
1535
+ constructor(el: HTMLElement, options: Partial<SliderOptions>);
1536
+ static get defaults(): SliderOptions;
1537
+ /**
1538
+ * Initializes instance of Slider.
1539
+ * @param el HTML element.
1540
+ * @param options Component options.
1541
+ */
1542
+ static init(el: HTMLElement, options?: Partial<SliderOptions>): Slider;
1543
+ /**
1544
+ * Initializes instances of Slider.
1545
+ * @param els HTML elements.
1546
+ * @param options Component options.
1547
+ */
1548
+ static init(els: InitElements<MElement>, options?: Partial<SliderOptions>): Slider[];
1549
+ static getInstance(el: HTMLElement): Slider;
1550
+ destroy(): void;
1551
+ private _setupEventHandlers;
1552
+ private _removeEventHandlers;
1553
+ private _handleIndicatorClick;
1554
+ private _handleAutoPauseHover;
1555
+ private _handleAutoPauseFocus;
1556
+ private _handleAutoStartHover;
1557
+ private _handleAutoStartFocus;
1558
+ private _handleInterval;
1559
+ private _animateSlide;
1560
+ private _setSliderHeight;
1561
+ private _setupIndicators;
1562
+ private _removeIndicators;
1563
+ set(index: number): void;
1564
+ _pause(fromEvent: boolean): void;
1565
+ /**
1566
+ * Pause slider autoslide.
1567
+ */
1568
+ pause: () => void;
1569
+ /**
1570
+ * Start slider autoslide.
1571
+ */
1572
+ start: () => void;
1573
+ /**
1574
+ * Move to next slider.
1575
+ */
1576
+ next: () => void;
1577
+ /**
1578
+ * Move to prev slider.
1579
+ */
1580
+ prev: () => void;
1581
+ }
1582
+
1583
+ interface TabsOptions extends BaseOptions$1 {
1584
+ /**
1585
+ * Transition duration in milliseconds.
1586
+ * @default 300
1587
+ */
1588
+ duration: number;
1589
+ /**
1590
+ * Callback for when a new tab content is shown.
1591
+ * @default null
1592
+ */
1593
+ onShow: (newContent: Element) => void;
1594
+ /**
1595
+ * Set to true to enable swipeable tabs.
1596
+ * This also uses the responsiveThreshold option.
1597
+ * @default false
1598
+ */
1599
+ swipeable: boolean;
1600
+ /**
1601
+ * The maximum width of the screen, in pixels,
1602
+ * where the swipeable functionality initializes.
1603
+ * @default infinity
1604
+ */
1605
+ responsiveThreshold: number;
1606
+ }
1607
+ declare class Tabs extends Component<TabsOptions> {
1608
+ _tabLinks: NodeListOf<HTMLAnchorElement>;
1609
+ _index: number;
1610
+ _indicator: HTMLLIElement;
1611
+ _tabWidth: number;
1612
+ _tabsWidth: number;
1613
+ _tabsCarousel: Carousel;
1614
+ _activeTabLink: HTMLAnchorElement;
1615
+ _content: HTMLElement;
1616
+ constructor(el: HTMLElement, options: Partial<TabsOptions>);
1617
+ static get defaults(): TabsOptions;
1618
+ /**
1619
+ * Initializes instance of Tabs.
1620
+ * @param el HTML element.
1621
+ * @param options Component options.
1622
+ */
1623
+ static init(el: HTMLElement, options?: Partial<TabsOptions>): Tabs;
1624
+ /**
1625
+ * Initializes instances of Tabs.
1626
+ * @param els HTML elements.
1627
+ * @param options Component options.
1628
+ */
1629
+ static init(els: InitElements<MElement>, options?: Partial<TabsOptions>): Tabs[];
1630
+ static getInstance(el: HTMLElement): Tabs;
1631
+ destroy(): void;
1632
+ /**
1633
+ * The index of tab that is currently shown.
1634
+ */
1635
+ get index(): number;
1636
+ _setupEventHandlers(): void;
1637
+ _removeEventHandlers(): void;
1638
+ _handleWindowResize: () => void;
1639
+ _handleTabClick: (e: MouseEvent) => void;
1640
+ _createIndicator(): void;
1641
+ _setupActiveTabLink(): void;
1642
+ _setupSwipeableTabs(): void;
1643
+ _teardownSwipeableTabs(): void;
1644
+ _setupNormalTabs(): void;
1645
+ _teardownNormalTabs(): void;
1646
+ _setTabsAndTabWidth(): void;
1647
+ _calcRightPos(el: any): number;
1648
+ _calcLeftPos(el: any): number;
1649
+ /**
1650
+ * Recalculate tab indicator position. This is useful when
1651
+ * the indicator position is not correct.
1652
+ */
1653
+ updateTabIndicator(): void;
1654
+ _animateIndicator(prevIndex: any): void;
1655
+ /**
1656
+ * Show tab content that corresponds to the tab with the id.
1657
+ * @param tabId The id of the tab that you want to switch to.
1658
+ */
1659
+ select(tabId: string): void;
1660
+ }
1661
+
1662
+ type Views = 'hours' | 'minutes';
1663
+ interface TimepickerOptions extends BaseOptions$1 {
1664
+ /**
1665
+ * Dial radius.
1666
+ * @default 135
1667
+ */
1668
+ dialRadius: number;
1669
+ /**
1670
+ * Outer radius.
1671
+ * @default 105
1672
+ */
1673
+ outerRadius: number;
1674
+ /**
1675
+ * Inner radius.
1676
+ * @default 70
1677
+ */
1678
+ innerRadius: number;
1679
+ /**
1680
+ * Tick radius.
1681
+ * @default 20
1682
+ */
1683
+ tickRadius: number;
1684
+ /**
1685
+ * Duration of the transition from/to the hours/minutes view.
1686
+ * @default 350
1687
+ */
1688
+ duration: number;
1689
+ /**
1690
+ * Specify a DOM element OR selector for a DOM element to render
1691
+ * the time picker in, by default it will be placed before the input.
1692
+ * @default null
1693
+ */
1694
+ container: HTMLElement | string | null;
1695
+ /**
1696
+ * Show the clear button in the Timepicker.
1697
+ * @default false
1698
+ */
1699
+ showClearBtn: boolean;
1700
+ /**
1701
+ * Autosubmit timepicker selection to input field
1702
+ * @default true
1703
+ */
1704
+ autoSubmit: true;
1705
+ /**
1706
+ * Default time to set on the timepicker 'now' or '13:14'.
1707
+ * @default 'now';
1708
+ */
1709
+ defaultTime: string;
1710
+ /**
1711
+ * Millisecond offset from the defaultTime.
1712
+ * @default 0
1713
+ */
1714
+ fromNow: number;
1715
+ /**
1716
+ * Internationalization options.
1717
+ */
1718
+ i18n: Partial<I18nOptions>;
1719
+ /**
1720
+ * Use 12 hour AM/PM clock instead of 24 hour clock.
1721
+ * @default true
1722
+ */
1723
+ twelveHour: boolean;
1724
+ /**
1725
+ * Vibrate device when dragging clock hand.
1726
+ * @default true
1727
+ */
1728
+ vibrate: boolean;
1729
+ /**
1730
+ * Callback function when a time is selected.
1731
+ * @default null
1732
+ */
1733
+ onSelect: (hour: number, minute: number) => void;
1734
+ /**
1735
+ * Callback function for interaction with input field.
1736
+ * @default null
1737
+ */
1738
+ onInputInteraction: (() => void) | null;
1739
+ /**
1740
+ * Callback function for done.
1741
+ * @default null
1742
+ */
1743
+ onDone: (() => void) | null;
1744
+ /**
1745
+ * Callback function for cancel.
1746
+ * @default null
1747
+ */
1748
+ onCancel: (() => void) | null;
1749
+ /**
1750
+ * Display plugin
1751
+ */
1752
+ displayPlugin: string;
1753
+ /**
1754
+ * Configurable display plugin options
1755
+ */
1756
+ displayPluginOptions: object;
1757
+ }
1758
+ type Point = {
1759
+ x: number;
1760
+ y: number;
1761
+ };
1762
+ declare class Timepicker extends Component<TimepickerOptions> {
1763
+ el: HTMLInputElement;
1764
+ id: string;
1765
+ containerEl: HTMLElement;
1766
+ plate: HTMLElement;
1767
+ digitalClock: HTMLElement;
1768
+ inputHours: HTMLInputElement;
1769
+ inputMinutes: HTMLInputElement;
1770
+ x0: number;
1771
+ y0: number;
1772
+ moved: boolean;
1773
+ dx: number;
1774
+ dy: number;
1775
+ /**
1776
+ * Current view on the timepicker.
1777
+ * @default 'hours'
1778
+ */
1779
+ currentView: Views;
1780
+ hand: SVGElement;
1781
+ minutesView: HTMLElement;
1782
+ hours: number;
1783
+ minutes: number;
1784
+ /** The selected time. */
1785
+ time: string;
1786
+ /**
1787
+ * If the time is AM or PM on twelve-hour clock.
1788
+ * @default 'PM'
1789
+ */
1790
+ amOrPm: 'AM' | 'PM';
1791
+ static _template: any;
1792
+ /** Vibrate device when dragging clock hand. */
1793
+ vibrate: 'vibrate' | 'webkitVibrate' | null;
1794
+ _canvas: HTMLElement;
1795
+ hoursView: HTMLElement;
1796
+ spanAmPm: HTMLSpanElement;
1797
+ footer: HTMLElement;
1798
+ private _amBtn;
1799
+ private _pmBtn;
1800
+ bg: Element;
1801
+ bearing: Element;
1802
+ g: Element;
1803
+ toggleViewTimer: string | number | NodeJS.Timeout;
1804
+ vibrateTimer: NodeJS.Timeout | number;
1805
+ private displayPlugin;
1806
+ constructor(el: HTMLInputElement, options: Partial<TimepickerOptions>);
1807
+ static get defaults(): TimepickerOptions;
1808
+ /**
1809
+ * Initializes instance of Timepicker.
1810
+ * @param el HTML element.
1811
+ * @param options Component options.
1812
+ */
1813
+ static init(el: HTMLInputElement, options?: Partial<TimepickerOptions>): Timepicker;
1814
+ /**
1815
+ * Initializes instances of Timepicker.
1816
+ * @param els HTML elements.
1817
+ * @param options Component options.
1818
+ */
1819
+ static init(els: InitElements<HTMLInputElement | MElement>, options?: Partial<TimepickerOptions>): Timepicker[];
1820
+ static _addLeadingZero(num: number): string;
1821
+ static _createSVGEl(name: string): SVGElement;
1822
+ static _Pos(e: TouchEvent | MouseEvent): Point;
1823
+ static getInstance(el: HTMLElement): Timepicker;
1824
+ destroy(): void;
1825
+ _setupEventHandlers(): void;
1826
+ _removeEventHandlers(): void;
1827
+ _handleInputClick: () => void;
1828
+ _handleInputKeydown: (e: KeyboardEvent) => void;
1829
+ _handleTimeInputEnterKey: (e: KeyboardEvent) => void;
1830
+ _handleClockClickStart: (e: any) => void;
1831
+ _handleDocumentClickMove: (e: any) => void;
1832
+ _handleDocumentClickEnd: (e: any) => void;
1833
+ _insertHTMLIntoDOM(): void;
1834
+ _setupVariables(): void;
1835
+ _pickerSetup(): void;
1836
+ private _setupDisplayPlugin;
1837
+ _clockSetup(): void;
1838
+ _buildSVGClock(): void;
1839
+ _buildHoursView(): void;
1840
+ _buildHoursTick(i: number, radian: number, radius: number): void;
1841
+ _buildMinutesView(): void;
1842
+ _handleAmPmClick: (e: MouseEvent) => void;
1843
+ _handleAmPmKeypress: (e: KeyboardEvent) => void;
1844
+ _handleAmPmInteraction: (e: HTMLElement) => void;
1845
+ _updateAmPmView(): void;
1846
+ _updateTimeFromInput(): void;
1847
+ /**
1848
+ * Show hours or minutes view on timepicker.
1849
+ * @param view The name of the view you want to switch to, 'hours' or 'minutes'.
1850
+ * @param delay
1851
+ */
1852
+ showView: (view: Views, delay?: number) => void;
1853
+ resetClock(delay: any): void;
1854
+ _inputFromTextField: () => void;
1855
+ drawClockFromTimeInput(value: any, isHours: any): void;
1856
+ setHand(x: any, y: any, roundBy5?: boolean): void;
1857
+ setClockAttributes(radian: number, radius: number): void;
1858
+ formatHours(): void;
1859
+ formatMinutes(): void;
1860
+ setHoursDefault(): void;
1861
+ done: (clearValue?: any) => void;
1862
+ confirm: () => void;
1863
+ cancel: () => void;
1864
+ clear: () => void;
1865
+ open(): this;
1866
+ close(): this;
1867
+ }
1868
+
1869
+ interface ToastOptions extends BaseOptions$1 {
1870
+ /**
1871
+ * The content of the Toast.
1872
+ * @default ""
1873
+ */
1874
+ text: string;
1875
+ /**
1876
+ * Element Id for the tooltip.
1877
+ * @default ""
1878
+ */
1879
+ toastId?: string;
1880
+ /**
1881
+ * Length in ms the Toast stays before dismissal.
1882
+ * @default 4000
1883
+ */
1884
+ displayLength: number;
1885
+ /**
1886
+ * Transition in duration in milliseconds.
1887
+ * @default 300
1888
+ */
1889
+ inDuration: number;
1890
+ /**
1891
+ * Transition out duration in milliseconds.
1892
+ * @default 375
1893
+ */
1894
+ outDuration: number;
1895
+ /**
1896
+ * Classes to be added to the toast element.
1897
+ * @default ""
1898
+ */
1899
+ classes: string;
1900
+ /**
1901
+ * Callback function called when toast is dismissed.
1902
+ * @default null
1903
+ */
1904
+ completeCallback: () => void;
1905
+ /**
1906
+ * The percentage of the toast's width it takes fora drag
1907
+ * to dismiss a Toast.
1908
+ * @default 0.8
1909
+ */
1910
+ activationPercent: number;
1911
+ }
1912
+ declare class Toast {
1913
+ /** The toast element. */
1914
+ el: HTMLElement;
1915
+ /**
1916
+ * The remaining amount of time in ms that the toast
1917
+ * will stay before dismissal.
1918
+ */
1919
+ timeRemaining: number;
1920
+ /**
1921
+ * Describes the current pan state of the Toast.
1922
+ */
1923
+ panning: boolean;
1924
+ options: ToastOptions;
1925
+ message: string;
1926
+ counterInterval: NodeJS.Timeout | number;
1927
+ wasSwiped: boolean;
1928
+ startingXPos: number;
1929
+ xPos: number;
1930
+ time: number;
1931
+ deltaX: number;
1932
+ velocityX: number;
1933
+ static _toasts: Toast[];
1934
+ static _container: HTMLElement;
1935
+ static _draggedToast: Toast;
1936
+ constructor(options: Partial<ToastOptions>);
1937
+ static get defaults(): ToastOptions;
1938
+ static getInstance(el: HTMLElement): Toast;
1939
+ static _createContainer(): void;
1940
+ static _removeContainer(): void;
1941
+ static _onDragStart(e: TouchEvent | MouseEvent): void;
1942
+ static _onDragMove(e: TouchEvent | MouseEvent): void;
1943
+ static _onDragEnd(): void;
1944
+ static _xPos(e: TouchEvent | MouseEvent): number;
1945
+ /**
1946
+ * dismiss all toasts.
1947
+ */
1948
+ static dismissAll(): void;
1949
+ _createToast(): HTMLElement;
1950
+ _animateIn(): void;
1951
+ /**
1952
+ * Create setInterval which automatically removes toast when timeRemaining >= 0
1953
+ * has been reached.
1954
+ */
1955
+ _setTimer(): void;
1956
+ /**
1957
+ * Dismiss toast with animation.
1958
+ */
1959
+ dismiss(): void;
1960
+ }
1961
+
1962
+ type TooltipPosition = 'top' | 'right' | 'bottom' | 'left';
1963
+ interface TooltipOptions extends BaseOptions$1 {
1964
+ /**
1965
+ * Delay time before tooltip disappears.
1966
+ * @default 200
1967
+ */
1968
+ exitDelay: number;
1969
+ /**
1970
+ * Delay time before tooltip appears.
1971
+ * @default 0
1972
+ */
1973
+ enterDelay: number;
1974
+ /**
1975
+ * Element Id for the tooltip.
1976
+ * @default ""
1977
+ */
1978
+ tooltipId?: string;
1979
+ /**
1980
+ * Text string for the tooltip.
1981
+ * @default ""
1982
+ */
1983
+ text: string;
1984
+ /**
1985
+ * Set distance tooltip appears away from its activator
1986
+ * excluding transitionMovement.
1987
+ * @default 5
1988
+ */
1989
+ margin: number;
1990
+ /**
1991
+ * Enter transition duration.
1992
+ * @default 300
1993
+ */
1994
+ inDuration: number;
1995
+ /**
1996
+ * Opacity of the tooltip.
1997
+ * @default 1
1998
+ */
1999
+ opacity: number;
2000
+ /**
2001
+ * Exit transition duration.
2002
+ * @default 250
2003
+ */
2004
+ outDuration: number;
2005
+ /**
2006
+ * Set the direction of the tooltip.
2007
+ * @default 'bottom'
2008
+ */
2009
+ position: TooltipPosition;
2010
+ /**
2011
+ * Amount in px that the tooltip moves during its transition.
2012
+ * @default 10
2013
+ */
2014
+ transitionMovement: number;
2015
+ }
2016
+ declare class Tooltip extends Component<TooltipOptions> {
2017
+ /**
2018
+ * If tooltip is open.
2019
+ */
2020
+ isOpen: boolean;
2021
+ /**
2022
+ * If tooltip is hovered.
2023
+ */
2024
+ isHovered: boolean;
2025
+ /**
2026
+ * If tooltip is focused.
2027
+ */
2028
+ isFocused: boolean;
2029
+ tooltipEl: HTMLElement;
2030
+ private _exitDelayTimeout;
2031
+ private _enterDelayTimeout;
2032
+ xMovement: number;
2033
+ yMovement: number;
2034
+ constructor(el: HTMLElement, options: Partial<TooltipOptions>);
2035
+ static get defaults(): TooltipOptions;
2036
+ /**
2037
+ * Initializes instance of Tooltip.
2038
+ * @param el HTML element.
2039
+ * @param options Component options.
2040
+ */
2041
+ static init(el: HTMLElement, options?: Partial<TooltipOptions>): Tooltip;
2042
+ /**
2043
+ * Initializes instances of Tooltip.
2044
+ * @param els HTML elements.
2045
+ * @param options Component options.
2046
+ */
2047
+ static init(els: InitElements<MElement>, options?: Partial<TooltipOptions>): Tooltip[];
2048
+ static getInstance(el: HTMLElement): Tooltip;
2049
+ destroy(): void;
2050
+ _appendTooltipEl(): void;
2051
+ _setTooltipContent(tooltipContentEl: HTMLElement): void;
2052
+ _updateTooltipContent(): void;
2053
+ _setupEventHandlers(): void;
2054
+ _removeEventHandlers(): void;
2055
+ /**
2056
+ * Show tooltip.
2057
+ */
2058
+ open: (isManual: boolean) => void;
2059
+ /**
2060
+ * Hide tooltip.
2061
+ */
2062
+ close: () => void;
2063
+ _setExitDelayTimeout(): void;
2064
+ _setEnterDelayTimeout(isManual: any): void;
2065
+ _positionTooltip(): void;
2066
+ _repositionWithinScreen(x: number, y: number, width: number, height: number): {
2067
+ x: number;
2068
+ y: number;
2069
+ };
2070
+ _animateIn(): void;
2071
+ _animateOut(): void;
2072
+ _handleMouseEnter: () => void;
2073
+ _handleMouseLeave: () => void;
2074
+ _handleFocus: () => void;
2075
+ _handleBlur: () => void;
2076
+ _getAttributeOptions(): Partial<TooltipOptions>;
2077
+ }
2078
+
2079
+ interface RangeOptions extends BaseOptions$1 {
2080
+ }
2081
+ declare class Range extends Component<RangeOptions> {
2082
+ el: HTMLInputElement;
2083
+ private _mousedown;
2084
+ value: HTMLElement;
2085
+ thumb: HTMLElement;
2086
+ constructor(el: HTMLInputElement, options: Partial<RangeOptions>);
2087
+ static get defaults(): RangeOptions;
2088
+ /**
2089
+ * Initializes instance of Range.
2090
+ * @param el HTML element.
2091
+ * @param options Component options.
2092
+ */
2093
+ static init(el: HTMLInputElement, options?: Partial<RangeOptions>): Range;
2094
+ /**
2095
+ * Initializes instances of Range.
2096
+ * @param els HTML elements.
2097
+ * @param options Component options.
2098
+ */
2099
+ static init(els: InitElements<HTMLInputElement | MElement>, options?: Partial<RangeOptions>): Range[];
2100
+ static getInstance(el: HTMLInputElement): Range;
2101
+ destroy(): void;
2102
+ _setupEventHandlers(): void;
2103
+ _removeEventHandlers(): void;
2104
+ _handleRangeChange: () => void;
2105
+ _handleRangeMousedownTouchstart: (e: MouseEvent | TouchEvent) => void;
2106
+ _handleRangeInputMousemoveTouchmove: () => void;
2107
+ _handleRangeMouseupTouchend: () => void;
2108
+ _handleRangeBlurMouseoutTouchleave: () => void;
2109
+ _setupThumb(): void;
2110
+ _removeThumb(): void;
2111
+ _showRangeBubble(): void;
2112
+ _calcRangeOffset(): number;
2113
+ /**
2114
+ * Initializes every range input in the current document.
2115
+ */
2116
+ static Init(): void;
2117
+ }
2118
+
2119
+ interface TapTargetOptions extends BaseOptions$1 {
2120
+ /**
2121
+ * Callback function called when Tap Target is opened.
2122
+ * @default null
2123
+ */
2124
+ onOpen: (origin: HTMLElement) => void;
2125
+ /**
2126
+ * Callback function called when Tap Target is closed.
2127
+ * @default null
2128
+ */
2129
+ onClose: (origin: HTMLElement) => void;
2130
+ }
2131
+ declare class TapTarget extends Component<TapTargetOptions> implements Openable {
2132
+ /**
2133
+ * If the tap target is open.
2134
+ */
2135
+ isOpen: boolean;
2136
+ static _taptargets: TapTarget[];
2137
+ private wrapper;
2138
+ private originEl;
2139
+ private waveEl;
2140
+ private contentEl;
2141
+ constructor(el: HTMLElement, options: Partial<TapTargetOptions>);
2142
+ static get defaults(): TapTargetOptions;
2143
+ /**
2144
+ * Initializes instance of TapTarget.
2145
+ * @param el HTML element.
2146
+ * @param options Component options.
2147
+ */
2148
+ static init(el: HTMLElement, options?: Partial<TapTargetOptions>): TapTarget;
2149
+ /**
2150
+ * Initializes instances of TapTarget.
2151
+ * @param els HTML elements.
2152
+ * @param options Component options.
2153
+ */
2154
+ static init(els: InitElements<MElement>, options?: Partial<TapTargetOptions>): TapTarget[];
2155
+ static getInstance(el: HTMLElement): TapTarget;
2156
+ destroy(): void;
2157
+ _setupEventHandlers(): void;
2158
+ _removeEventHandlers(): void;
2159
+ _handleThrottledResize: () => void;
2160
+ _handleKeyboardInteraction: (e: KeyboardEvent) => void;
2161
+ _handleTargetToggle: () => void;
2162
+ _handleResize: () => void;
2163
+ _handleDocumentClick: (e: MouseEvent | TouchEvent | KeyboardEvent) => void;
2164
+ _setup(): void;
2165
+ private _offset;
2166
+ _calculatePositioning(): void;
2167
+ /**
2168
+ * Open Tap Target.
2169
+ */
2170
+ open: () => void;
2171
+ /**
2172
+ * Close Tap Target.
2173
+ */
2174
+ close: () => void;
2175
+ }
2176
+
2177
+ interface BaseOptions {
2178
+ }
2179
+ type InputElement = HTMLInputElement | HTMLTextAreaElement;
2180
+ declare class CharacterCounter extends Component<object> {
2181
+ el: InputElement;
2182
+ /** Stores the reference to the counter HTML element. */
2183
+ counterEl: HTMLSpanElement;
2184
+ /** Specifies whether the input is valid or not. */
2185
+ isInvalid: boolean;
2186
+ /** Specifies whether the input text has valid length or not. */
2187
+ isValidLength: boolean;
2188
+ constructor(el: HTMLInputElement | HTMLTextAreaElement, options: Partial<BaseOptions>);
2189
+ static get defaults(): BaseOptions;
2190
+ /**
2191
+ * Initializes instance of CharacterCounter.
2192
+ * @param el HTML element.
2193
+ * @param options Component options.
2194
+ */
2195
+ static init(el: InputElement, options?: Partial<BaseOptions>): CharacterCounter;
2196
+ /**
2197
+ * Initializes instances of CharacterCounter.
2198
+ * @param els HTML elements.
2199
+ * @param options Component options.
2200
+ */
2201
+ static init(els: InitElements<InputElement | MElement>, options?: Partial<BaseOptions>): CharacterCounter[];
2202
+ static getInstance(el: InputElement): CharacterCounter;
2203
+ destroy(): void;
2204
+ _setupEventHandlers(): void;
2205
+ _removeEventHandlers(): void;
2206
+ _setupCounter(): void;
2207
+ _removeCounter(): void;
2208
+ updateCounter: () => void;
2209
+ _validateInput(): void;
2210
+ }
2211
+
2212
+ declare class Edges {
2213
+ top: boolean;
2214
+ right: boolean;
2215
+ bottom: boolean;
2216
+ left: boolean;
2217
+ }
2218
+
2219
+ declare class Bounding {
2220
+ left: number;
2221
+ top: number;
2222
+ width: number;
2223
+ height: number;
2224
+ }
2225
+
2226
+ /**
2227
+ * Class with utilitary functions for global usage.
2228
+ */
2229
+ declare class Utils {
2230
+ /** Specifies wether tab is pressed or not. */
2231
+ static tabPressed: boolean;
2232
+ /** Specifies wether there is a key pressed. */
2233
+ static keyDown: boolean;
2234
+ /**
2235
+ * Key maps.
2236
+ */
2237
+ static keys: {
2238
+ TAB: string[];
2239
+ ENTER: string[];
2240
+ ESC: string[];
2241
+ BACKSPACE: string[];
2242
+ ARROW_UP: string[];
2243
+ ARROW_DOWN: string[];
2244
+ ARROW_LEFT: string[];
2245
+ ARROW_RIGHT: string[];
2246
+ DELETE: string[];
2247
+ };
2248
+ /**
2249
+ * Detects when a key is pressed.
2250
+ * @param e Event instance.
2251
+ */
2252
+ static docHandleKeydown(e: KeyboardEvent): void;
2253
+ /**
2254
+ * Detects when a key is released.
2255
+ * @param e Event instance.
2256
+ */
2257
+ static docHandleKeyup(e: KeyboardEvent): void;
2258
+ /**
2259
+ * Detects when document is focused.
2260
+ * @param e Event instance.
2261
+ */
2262
+ static docHandleFocus(e: FocusEvent): void;
2263
+ /**
2264
+ * Detects when document is not focused.
2265
+ * @param e Event instance.
2266
+ */
2267
+ static docHandleBlur(e: FocusEvent): void;
2268
+ /**
2269
+ * Generates a unique string identifier.
2270
+ */
2271
+ static guid(): string;
2272
+ /**
2273
+ * Checks for exceeded edges
2274
+ * @param container Container element.
2275
+ * @param bounding Bounding rect.
2276
+ * @param offset Element offset.
2277
+ */
2278
+ static checkWithinContainer(container: HTMLElement, bounding: Bounding, offset: number): Edges;
2279
+ /**
2280
+ * Checks if element can be aligned in multiple directions.
2281
+ * @param el Element to be inspected.
2282
+ * @param container Container element.
2283
+ * @param bounding Bounding rect.
2284
+ * @param offset Element offset.
2285
+ */
2286
+ static checkPossibleAlignments(el: HTMLElement, container: HTMLElement, bounding: Bounding, offset: number): {
2287
+ top: boolean;
2288
+ right: boolean;
2289
+ bottom: boolean;
2290
+ left: boolean;
2291
+ spaceOnTop: number;
2292
+ spaceOnRight: number;
2293
+ spaceOnBottom: number;
2294
+ spaceOnLeft: number;
2295
+ };
2296
+ /**
2297
+ * Retrieves target element id from trigger.
2298
+ * @param trigger Trigger element.
2299
+ */
2300
+ static getIdFromTrigger(trigger: HTMLElement): string;
2301
+ /**
2302
+ * Retrieves document scroll postion from top.
2303
+ */
2304
+ static getDocumentScrollTop(): number;
2305
+ /**
2306
+ * Retrieves document scroll postion from left.
2307
+ */
2308
+ static getDocumentScrollLeft(): number;
2309
+ /**
2310
+ * Fires the given function after a certain ammount of time.
2311
+ * @param func Function to be fired.
2312
+ * @param wait Wait time.
2313
+ * @param options Additional options.
2314
+ */
2315
+ static throttle(func: (Function: object) => void, wait: number, options?: Partial<{
2316
+ leading: boolean;
2317
+ trailing: boolean;
2318
+ }>): (...args: any[]) => any;
2319
+ /**
2320
+ * Renders confirm/close buttons with callback function
2321
+ */
2322
+ static createConfirmationContainer(container: HTMLElement, confirmText: string, cancelText: string, onConfirm: (Function: object) => void, onCancel: (Function: object) => void): void;
2323
+ /**
2324
+ * Renders a button with optional callback function
2325
+ */
2326
+ static createButton(container: HTMLElement, text: string, className?: string[], visibility?: boolean, callback?: (Function: object) => void): void;
2327
+ static _setAbsolutePosition(origin: HTMLElement, container: HTMLElement, position: string, margin: number, transitionMovement: number, align?: string): {
2328
+ x: number;
2329
+ y: number;
2330
+ };
2331
+ static _repositionWithinScreen(x: number, y: number, width: number, height: number, margin: number, transitionMovement: number, align: string): {
2332
+ x: number;
2333
+ y: number;
2334
+ };
2335
+ }
2336
+
2337
+ interface ParallaxOptions extends BaseOptions$1 {
2338
+ /**
2339
+ * The minimum width of the screen, in pixels, where the parallax functionality starts working.
2340
+ * @default 0
2341
+ */
2342
+ responsiveThreshold: number;
2343
+ }
2344
+ declare class Parallax extends Component<ParallaxOptions> {
2345
+ private _enabled;
2346
+ private _img;
2347
+ static _parallaxes: Parallax[];
2348
+ static _handleScrollThrottled: () => Utils;
2349
+ static _handleWindowResizeThrottled: () => Utils;
2350
+ constructor(el: HTMLElement, options: Partial<ParallaxOptions>);
2351
+ static get defaults(): ParallaxOptions;
2352
+ /**
2353
+ * Initializes instance of Parallax.
2354
+ * @param el HTML element.
2355
+ * @param options Component options.
2356
+ */
2357
+ static init(el: HTMLElement, options?: Partial<ParallaxOptions>): Parallax;
2358
+ /**
2359
+ * Initializes instances of Parallax.
2360
+ * @param els HTML elements.
2361
+ * @param options Component options.
2362
+ */
2363
+ static init(els: InitElements<MElement>, options?: Partial<ParallaxOptions>): Parallax[];
2364
+ static getInstance(el: HTMLElement): Parallax;
2365
+ destroy(): void;
2366
+ static _handleScroll(): void;
2367
+ static _handleWindowResize(): void;
2368
+ _setupEventHandlers(): void;
2369
+ _removeEventHandlers(): void;
2370
+ _setupStyles(): void;
2371
+ _handleImageLoad: () => void;
2372
+ private _offset;
2373
+ _updateParallax(): void;
2374
+ }
2375
+
2376
+ interface PushpinOptions extends BaseOptions$1 {
2377
+ /**
2378
+ * The distance in pixels from the top of the page where
2379
+ * the element becomes fixed.
2380
+ * @default 0
2381
+ */
2382
+ top: number;
2383
+ /**
2384
+ * The distance in pixels from the top of the page where
2385
+ * the elements stops being fixed.
2386
+ * @default Infinity
2387
+ */
2388
+ bottom: number;
2389
+ /**
2390
+ * The offset from the top the element will be fixed at.
2391
+ * @default 0
2392
+ */
2393
+ offset: number;
2394
+ /**
2395
+ * Callback function called when pushpin position changes.
2396
+ * You are provided with a position string.
2397
+ * @default null
2398
+ */
2399
+ onPositionChange: (position: 'pinned' | 'pin-top' | 'pin-bottom') => void;
2400
+ }
2401
+ declare class Pushpin extends Component<PushpinOptions> {
2402
+ static _pushpins: Pushpin[];
2403
+ originalOffset: number;
2404
+ constructor(el: HTMLElement, options: Partial<PushpinOptions>);
2405
+ static get defaults(): PushpinOptions;
2406
+ /**
2407
+ * Initializes instance of Pushpin.
2408
+ * @param el HTML element.
2409
+ * @param options Component options.
2410
+ */
2411
+ static init(el: HTMLElement, options?: Partial<PushpinOptions>): Pushpin;
2412
+ /**
2413
+ * Initializes instances of Pushpin.
2414
+ * @param els HTML elements.
2415
+ * @param options Component options.
2416
+ */
2417
+ static init(els: InitElements<MElement>, options?: Partial<PushpinOptions>): Pushpin[];
2418
+ static getInstance(el: HTMLElement): Pushpin;
2419
+ destroy(): void;
2420
+ static _updateElements(): void;
2421
+ _setupEventHandlers(): void;
2422
+ _removeEventHandlers(): void;
2423
+ _updatePosition(): void;
2424
+ _removePinClasses(): void;
2425
+ }
2426
+
2427
+ interface ScrollSpyOptions extends BaseOptions$1 {
2428
+ /**
2429
+ * Throttle of scroll handler.
2430
+ * @default 100
2431
+ */
2432
+ throttle: number;
2433
+ /**
2434
+ * Offset for centering element when scrolled to.
2435
+ * @default 200
2436
+ */
2437
+ scrollOffset: number;
2438
+ /**
2439
+ * Class applied to active elements.
2440
+ * @default 'active'
2441
+ */
2442
+ activeClass: string;
2443
+ /**
2444
+ * Used to find active element.
2445
+ * @default id => 'a[href="#' + id + '"]'
2446
+ */
2447
+ getActiveElement: (id: string) => string;
2448
+ /**
2449
+ * Used to keep last top element active even if
2450
+ * scrollbar goes outside of scrollspy elements.
2451
+ *
2452
+ * If there is no last top element,
2453
+ * then the active one will be the first element.
2454
+ *
2455
+ * @default false
2456
+ */
2457
+ keepTopElementActive: boolean;
2458
+ /**
2459
+ * Used to set scroll animation duration in milliseconds.
2460
+ * @default null (browser's native animation implementation/duration)
2461
+ */
2462
+ animationDuration: number | null;
2463
+ }
2464
+ declare class ScrollSpy extends Component<ScrollSpyOptions> {
2465
+ static _elements: ScrollSpy[];
2466
+ static _count: number;
2467
+ static _increment: number;
2468
+ static _elementsInView: ScrollSpy[];
2469
+ static _visibleElements: HTMLElement[];
2470
+ static _ticks: number;
2471
+ static _keptTopActiveElement: HTMLElement | null;
2472
+ private tickId;
2473
+ private id;
2474
+ constructor(el: HTMLElement, options: Partial<ScrollSpyOptions>);
2475
+ static get defaults(): ScrollSpyOptions;
2476
+ /**
2477
+ * Initializes instance of ScrollSpy.
2478
+ * @param el HTML element.
2479
+ * @param options Component options.
2480
+ */
2481
+ static init(el: HTMLElement, options?: Partial<ScrollSpyOptions>): ScrollSpy;
2482
+ /**
2483
+ * Initializes instances of ScrollSpy.
2484
+ * @param els HTML elements.
2485
+ * @param options Component options.
2486
+ */
2487
+ static init(els: InitElements<MElement>, options?: Partial<ScrollSpyOptions>): ScrollSpy[];
2488
+ static getInstance(el: HTMLElement): ScrollSpy;
2489
+ destroy(): void;
2490
+ _setupEventHandlers(): void;
2491
+ _removeEventHandlers(): void;
2492
+ _handleThrottledResize: () => void;
2493
+ _handleTriggerClick: (e: MouseEvent) => void;
2494
+ _handleWindowScroll: () => void;
2495
+ static _offset(el: any): {
2496
+ top: number;
2497
+ left: number;
2498
+ };
2499
+ static _findElements(top: number, right: number, bottom: number, left: number): ScrollSpy[];
2500
+ _enter(): void;
2501
+ _exit(): void;
2502
+ private _resetKeptTopActiveElementIfNeeded;
2503
+ private static _getDistanceToViewport;
2504
+ private static _smoothScrollIntoView;
2505
+ }
2506
+
2507
+ type RGBColor = {
2508
+ r: number;
2509
+ g: number;
2510
+ b: number;
2511
+ };
2512
+ type Position = {
2513
+ x: number;
2514
+ y: number;
2515
+ };
2516
+ declare class Waves {
2517
+ private static _offset;
2518
+ static renderWaveEffect(targetElement: HTMLElement, position?: Position | null, color?: RGBColor | null): void;
2519
+ static Init(): void;
2520
+ }
2521
+
2522
+ declare const version = "2.3.0";
2523
+ interface AutoInitOptions {
2524
+ Autocomplete?: Partial<AutocompleteOptions>;
2525
+ Cards?: Partial<CardsOptions>;
2526
+ Carousel?: Partial<CarouselOptions>;
2527
+ Chips?: Partial<ChipsOptions>;
2528
+ Collapsible?: Partial<CollapsibleOptions>;
2529
+ Datepicker?: Partial<DatepickerOptions>;
2530
+ Dropdown?: Partial<DropdownOptions>;
2531
+ Materialbox?: Partial<MaterialboxOptions>;
2532
+ Modal?: Partial<ModalOptions>;
2533
+ Parallax?: Partial<ParallaxOptions>;
2534
+ Pushpin?: Partial<PushpinOptions>;
2535
+ ScrollSpy?: Partial<ScrollSpyOptions>;
2536
+ FormSelect?: Partial<FormSelectOptions>;
2537
+ Sidenav?: Partial<SidenavOptions>;
2538
+ Tabs?: Partial<TabsOptions>;
2539
+ TapTarget?: Partial<TapTargetOptions>;
2540
+ Timepicker?: Partial<TimepickerOptions>;
2541
+ Tooltip?: Partial<TooltipOptions>;
2542
+ FloatingActionButton?: Partial<FloatingActionButtonOptions>;
2543
+ }
2544
+ /**
2545
+ * Automatically initialize components.
2546
+ * @param context Root element to initialize. Defaults to `document.body`.
2547
+ * @param options Options for each component.
2548
+ */
2549
+ declare function AutoInit(context?: HTMLElement, options?: Partial<AutoInitOptions>): void;
2550
+
2551
+ export { AutoInit, Autocomplete, Cards, Carousel, CharacterCounter, Chips, Collapsible, Datepicker, Dropdown, FloatingActionButton, FormSelect, Forms, Materialbox, Modal, Parallax, Pushpin, Range, ScrollSpy, Sidenav, Slider, Tabs, TapTarget, Timepicker, Toast, Tooltip, Waves, version };
2552
+ export type { AutoInitOptions };