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