@expressivecss/expressive 0.2.0 → 0.4.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 (80) hide show
  1. package/README.md +8 -8
  2. package/dist/css/expressive.css +1915 -1566
  3. package/dist/css/expressive.css.map +1 -1
  4. package/dist/css/expressive.min.css +1 -1
  5. package/dist/css/expressive.min.css.map +1 -1
  6. package/dist/js/expressive.cjs +1338 -1528
  7. package/dist/js/expressive.cjs.map +4 -4
  8. package/dist/js/expressive.js +1338 -1528
  9. package/dist/js/expressive.js.map +4 -4
  10. package/dist/js/expressive.min.js +10 -20
  11. package/dist/js/expressive.min.js.map +4 -4
  12. package/dist/js/expressive.mjs +1338 -1529
  13. package/dist/js/expressive.mjs.map +4 -4
  14. package/dist/types/components/autocomplete.d.ts +2 -9
  15. package/dist/types/components/buttons.d.ts +19 -43
  16. package/dist/types/components/cards.d.ts +3 -6
  17. package/dist/types/components/carousel.d.ts +42 -48
  18. package/dist/types/components/characterCounter.d.ts +3 -5
  19. package/dist/types/components/chips.d.ts +4 -4
  20. package/dist/types/components/collapsible.d.ts +28 -23
  21. package/dist/types/components/datepicker.d.ts +2 -8
  22. package/dist/types/components/dropdown.d.ts +11 -2
  23. package/dist/types/components/index.d.ts +0 -1
  24. package/dist/types/components/lightbox.d.ts +2 -2
  25. package/dist/types/components/parallax.d.ts +7 -37
  26. package/dist/types/components/pushpin.d.ts +2 -2
  27. package/dist/types/components/range.d.ts +2 -2
  28. package/dist/types/components/registry.d.ts +0 -4
  29. package/dist/types/components/scrollspy.d.ts +26 -50
  30. package/dist/types/components/select.d.ts +20 -6
  31. package/dist/types/components/sidenav.d.ts +40 -55
  32. package/dist/types/components/slider.d.ts +2 -2
  33. package/dist/types/components/tabs.d.ts +2 -2
  34. package/dist/types/components/tapTarget.d.ts +25 -26
  35. package/dist/types/components/timepicker.d.ts +2 -4
  36. package/dist/types/components/tooltip.d.ts +2 -2
  37. package/dist/types/core/component.d.ts +4 -4
  38. package/dist/types/index.d.ts +1 -1
  39. package/package.json +2 -2
  40. package/src/sass/README.md +3 -6
  41. package/src/sass/abstracts/_breakpoints.scss +0 -16
  42. package/src/sass/abstracts/_variables.scss +0 -21
  43. package/src/sass/base/_grid.scss +0 -19
  44. package/src/sass/components/_badges.scss +6 -5
  45. package/src/sass/components/_breadcrumb.scss +93 -16
  46. package/src/sass/components/_buttons.scss +212 -145
  47. package/src/sass/components/_cards.scss +50 -123
  48. package/src/sass/components/_carousel.scss +128 -63
  49. package/src/sass/components/_chips.scss +1 -1
  50. package/src/sass/components/_collapsible.scss +158 -60
  51. package/src/sass/components/_collection.scss +146 -80
  52. package/src/sass/components/_datepicker.scss +1 -15
  53. package/src/sass/components/_dropdown.scss +110 -14
  54. package/src/sass/components/_icons-material-design.scss +77 -4
  55. package/src/sass/components/_index.scss +1 -0
  56. package/src/sass/components/_lightbox.scss +4 -0
  57. package/src/sass/components/_modal.scss +13 -31
  58. package/src/sass/components/_navbar.scss +24 -6
  59. package/src/sass/components/_page-footer.scss +134 -15
  60. package/src/sass/components/_pagination.scss +131 -25
  61. package/src/sass/components/_parallax.scss +96 -21
  62. package/src/sass/components/_preloader.scss +145 -300
  63. package/src/sass/components/_scrollspy.scss +18 -0
  64. package/src/sass/components/_sidenav.scss +230 -119
  65. package/src/sass/components/_slider.scss +8 -0
  66. package/src/sass/components/_table_of_contents.scss +30 -14
  67. package/src/sass/components/_tabs.scss +54 -35
  68. package/src/sass/components/_tapTarget.scss +128 -45
  69. package/src/sass/components/_toast.scss +10 -11
  70. package/src/sass/components/_toolbar.scss +2 -2
  71. package/src/sass/components/_tooltip.scss +4 -9
  72. package/src/sass/components/_transitions.scss +0 -5
  73. package/src/sass/components/forms/_index.scss +0 -5
  74. package/src/sass/components/forms/_input-fields.scss +49 -52
  75. package/src/sass/components/forms/_select.scss +175 -60
  76. package/src/sass/components/forms/_switches.scss +21 -8
  77. package/src/sass/utilities/_helpers.scss +1 -3
  78. package/src/sass/utilities/_typescale.scss +0 -5
  79. package/src/sass/utilities/_visibility.scss +2 -2
  80. package/dist/types/components/modal.d.ts +0 -45
@@ -1,5 +1,5 @@
1
1
  import { Dropdown, DropdownOptions } from './dropdown';
2
- import { Component, BaseOptions, InitElements, MElement } from '../core/component';
2
+ import { Component, BaseOptions, InitElements, InitElement } from '../core/component';
3
3
  export interface AutocompleteData {
4
4
  /**
5
5
  * A primitive value that can be converted to string.
@@ -98,7 +98,7 @@ export declare class Autocomplete extends Component<AutocompleteOptions> {
98
98
  * @param els HTML elements.
99
99
  * @param options Component options.
100
100
  */
101
- static init(els: InitElements<HTMLInputElement | MElement>, options?: Partial<AutocompleteOptions>): Autocomplete[];
101
+ static init(els: InitElements<HTMLInputElement | InitElement>, options?: Partial<AutocompleteOptions>): Autocomplete[];
102
102
  static getInstance(el: HTMLElement): Autocomplete;
103
103
  /**
104
104
  * The three-dot loading indicator, parsed once and cloned thereafter.
@@ -146,16 +146,9 @@ export declare class Autocomplete extends Component<AutocompleteOptions> {
146
146
  * @param open Option to conditionally open dropdown
147
147
  */
148
148
  setMenuItems(menuItems: AutocompleteData[], selected?: number[] | string[], open?: boolean): void;
149
- /**
150
- * Sets selected values.
151
- * @deprecated @see https://github.com/materializecss/materialize/issues/552
152
- * @param entries
153
- */
154
- setValues(entries: AutocompleteData[]): void;
155
149
  /**
156
150
  * Select a specific autocomplete option via id-property.
157
151
  * @param id The id of a data-entry.
158
152
  */
159
153
  selectOption(id: number | string): void;
160
- selectOptions(ids: []): void;
161
154
  }
@@ -1,4 +1,4 @@
1
- import { Component, BaseOptions, InitElements, MElement, Openable } from "../core/component";
1
+ import { Component, BaseOptions, InitElements, InitElement, Openable } from "../core/component";
2
2
  export interface FloatingActionButtonOptions extends BaseOptions {
3
3
  /**
4
4
  * Direction FAB menu opens.
@@ -6,54 +6,33 @@ export interface FloatingActionButtonOptions extends BaseOptions {
6
6
  */
7
7
  direction: 'top' | 'right' | 'bottom' | 'left';
8
8
  /**
9
- * true: FAB menu appears on hover, false: FAB menu appears on click.
9
+ * true: FAB menu appears on hover (CSS, when the pointer can hover).
10
+ * false: FAB menu toggles on click. `.click-to-toggle` is the markup switch.
10
11
  * @default true
11
12
  */
12
13
  hoverEnabled: boolean;
13
14
  /**
14
- * Enable transit the FAB into a toolbar on click.
15
+ * Expand the FAB into a toolbar on click. Prefer a hover or click menu.
16
+ * `.toolbar` on the element is the markup switch.
15
17
  * @default false
16
18
  */
17
19
  toolbarEnabled: boolean;
18
20
  }
21
+ /**
22
+ * Speed dial around a FAB. Open/close is the `.active` class; motion is
23
+ * CSS. Hover is CSS (`:hover` when the pointer can hover). This class
24
+ * toggles the class, wires keyboard / click-outside, and stamps direction.
25
+ */
19
26
  export declare class FloatingActionButton extends Component<FloatingActionButtonOptions> implements Openable {
20
- /**
21
- * Describes open/close state of FAB.
22
- */
23
27
  isOpen: boolean;
24
28
  private _anchor;
25
29
  private _menu;
26
- private _floatingBtns;
27
- private _floatingBtnsReverse;
28
- /** Toolbar-mode backdrop, kept so closing can take it back out. */
29
- private _backdrop;
30
- offsetY: number;
31
- offsetX: number;
32
- btnBottom: number;
33
- btnLeft: number;
34
- btnWidth: number;
35
30
  constructor(el: HTMLElement, options: Partial<FloatingActionButtonOptions>);
36
31
  static get defaults(): FloatingActionButtonOptions;
37
- /**
38
- * Initializes instance of FloatingActionButton.
39
- * @param el HTML element.
40
- * @param options Component options.
41
- */
42
32
  static init(el: HTMLElement, options?: Partial<FloatingActionButtonOptions>): FloatingActionButton;
43
- /**
44
- * Initializes instances of FloatingActionButton.
45
- * @param els HTML elements.
46
- * @param options Component options.
47
- */
48
- static init(els: InitElements<MElement>, options?: Partial<FloatingActionButtonOptions>): FloatingActionButton[];
33
+ static init(els: InitElements<InitElement>, options?: Partial<FloatingActionButtonOptions>): FloatingActionButton[];
49
34
  static getInstance(el: HTMLElement): FloatingActionButton;
50
35
  destroy(): void;
51
- _setupEventHandlers(): void;
52
- _removeEventHandlers(): void;
53
- _handleFABClick: () => void;
54
- _handleFABKeyPress: (e: any) => void;
55
- _handleFABToggle: () => void;
56
- _handleDocumentClick: (e: MouseEvent) => void;
57
36
  /**
58
37
  * Open FAB.
59
38
  */
@@ -62,15 +41,12 @@ export declare class FloatingActionButton extends Component<FloatingActionButton
62
41
  * Close FAB.
63
42
  */
64
43
  close: () => void;
65
- _animateInFAB(): void;
66
- _animateOutFAB(): void;
67
- _animateInToolbar(): void;
68
- /**
69
- * Reverse {@link _animateInToolbar}.
70
- *
71
- * Closing used to only unbind the listeners, leaving the FAB stretched
72
- * across the viewport with its backdrop still in the DOM - and a fresh
73
- * backdrop appended on every subsequent open.
74
- */
75
- _animateOutToolbar(): void;
44
+ private _directionFromClass;
45
+ private _setupEventHandlers;
46
+ private _removeEventHandlers;
47
+ private _handleFABClick;
48
+ private _handleAnchorKeydown;
49
+ private _handleDocumentKeydown;
50
+ private _handleDocumentClick;
51
+ private _toggle;
76
52
  }
@@ -1,9 +1,7 @@
1
- import { Component, BaseOptions, InitElements, MElement, Openable } from '../core/component';
1
+ import { Component, BaseOptions, InitElements, InitElement, Openable } from '../core/component';
2
2
  export interface CardsOptions extends BaseOptions {
3
3
  onOpen: (el: Element) => void;
4
4
  onClose: (el: Element) => void;
5
- inDuration: number;
6
- outDuration: number;
7
5
  }
8
6
  /**
9
7
  * What counts as a card.
@@ -13,11 +11,10 @@ export interface CardsOptions extends BaseOptions {
13
11
  * actually initializes, so the AutoInit entry was dead while `Cards.Init()`
14
12
  * quietly did the work through the selector below.
15
13
  */
16
- export declare const CARDS_SELECTOR = ".card, article:has(> aside), article:has(.card-reveal)";
14
+ export declare const CARDS_SELECTOR = "article:has(> aside)";
17
15
  export declare class Cards extends Component<CardsOptions> implements Openable {
18
16
  isOpen: boolean;
19
17
  private readonly cardReveal;
20
- private readonly initialOverflow;
21
18
  private _activators;
22
19
  private cardRevealClose;
23
20
  constructor(el: HTMLElement, options: Partial<CardsOptions>);
@@ -33,7 +30,7 @@ export declare class Cards extends Component<CardsOptions> implements Openable {
33
30
  * @param els HTML elements.
34
31
  * @param options Component options.
35
32
  */
36
- static init(els: InitElements<MElement>, options?: Partial<CardsOptions>): Cards[];
33
+ static init(els: InitElements<InitElement>, options?: Partial<CardsOptions>): Cards[];
37
34
  static getInstance(el: HTMLElement): Cards;
38
35
  /**
39
36
  * {@inheritDoc}
@@ -1,47 +1,49 @@
1
- import { Component, BaseOptions, InitElements, MElement } from '../core/component';
1
+ import { Component, BaseOptions, InitElements, InitElement } from '../core/component';
2
2
  export interface CarouselOptions extends BaseOptions {
3
3
  /**
4
- * Transition duration in milliseconds.
4
+ * Transition duration in milliseconds (coverflow). Snap mode uses CSS.
5
5
  * @default 200
6
6
  */
7
7
  duration: number;
8
8
  /**
9
- * Perspective zoom. If 0, all items are the same size.
9
+ * Perspective zoom. If 0, all items are the same size. Coverflow only.
10
10
  * @default -100
11
11
  */
12
12
  dist: number;
13
13
  /**
14
- * Set the spacing of the center item.
14
+ * Extra spacing on the center item. Coverflow only.
15
15
  * @default 0
16
16
  */
17
17
  shift: number;
18
18
  /**
19
- * Set the padding between non center items.
19
+ * Padding between items that are not in the center. Coverflow only.
20
20
  * @default 0
21
21
  */
22
22
  padding: number;
23
23
  /**
24
- * Set the number of visible items.
24
+ * How many items stay visible. Coverflow only.
25
25
  * @default 5
26
26
  */
27
27
  numVisible: number;
28
28
  /**
29
- * Make the carousel a full width slider like the second example.
29
+ * Linear snap track instead of 3D coverflow.
30
+ * Also implied by `.flat`.
30
31
  * @default false
31
32
  */
32
33
  fullWidth: boolean;
33
34
  /**
34
- * Set to true to show indicators.
35
+ * Show paging dots. Only drawn when there is more than one item.
35
36
  * @default false
36
37
  */
37
38
  indicators: boolean;
38
39
  /**
39
- * Don't wrap around and cycle through items.
40
+ * Stop at the first and last items instead of wrapping. Coverflow only.
41
+ * Snap tracks do not wrap.
40
42
  * @default false
41
43
  */
42
44
  noWrap: boolean;
43
45
  /**
44
- * Callback for when a new slide is cycled to.
46
+ * Called when a new item becomes the center.
45
47
  * @default null
46
48
  */
47
49
  onCycleTo: (current: Element, dragged: boolean) => void;
@@ -50,9 +52,7 @@ export declare class Carousel extends Component<CarouselOptions> {
50
52
  hasMultipleSlides: boolean;
51
53
  showIndicators: boolean;
52
54
  noWrap: boolean;
53
- /** If the carousel is being clicked or tapped. */
54
55
  pressed: boolean;
55
- /** If the carousel is currently being dragged. */
56
56
  dragged: boolean;
57
57
  offset: number;
58
58
  target: number;
@@ -60,7 +60,7 @@ export declare class Carousel extends Component<CarouselOptions> {
60
60
  itemWidth: number;
61
61
  itemHeight: number;
62
62
  dim: number;
63
- _indicators: HTMLUListElement;
63
+ _indicators: HTMLUListElement | HTMLElement;
64
64
  count: number;
65
65
  verticalDragged: boolean;
66
66
  reference: number;
@@ -68,63 +68,57 @@ export declare class Carousel extends Component<CarouselOptions> {
68
68
  velocity: number;
69
69
  frame: number;
70
70
  timestamp: number;
71
- ticker: ReturnType<typeof setTimeout>;
72
71
  amplitude: number;
73
- /** The index of the center carousel item. */
74
72
  center: number;
75
73
  imageHeight: number;
76
74
  scrollingTimeout: ReturnType<typeof setTimeout>;
77
75
  oneTimeCallback: (current: Element, dragged: boolean) => void | null;
76
+ private _flat;
77
+ private _ownIndicators;
78
+ private _trackEl;
79
+ private _ignoreScroll;
80
+ private _trackRaf;
81
+ private _started;
82
+ private get _scroller();
83
+ private static _live;
84
+ private static _resizeListening;
85
+ private static _onResize;
78
86
  constructor(el: HTMLElement, options: Partial<CarouselOptions>);
79
87
  static get defaults(): CarouselOptions;
80
- /**
81
- * Initializes instance of Carousel.
82
- * @param el HTML element.
83
- * @param options Component options.
84
- */
85
88
  static init(el: HTMLElement, options?: Partial<CarouselOptions>): Carousel;
86
- /**
87
- * Initializes instances of Carousel.
88
- * @param els HTML elements.
89
- * @param options Component options.
90
- */
91
- static init(els: InitElements<MElement>, options?: Partial<CarouselOptions>): Carousel[];
89
+ static init(els: InitElements<InitElement>, options?: Partial<CarouselOptions>): Carousel[];
92
90
  static getInstance(el: HTMLElement): Carousel;
93
91
  destroy(): void;
92
+ private _collectItems;
93
+ private _setupIndicators;
94
94
  _setupEventHandlers(): void;
95
95
  _removeEventHandlers(): void;
96
+ private _teardown;
96
97
  _handleThrottledResize: (...args: unknown[]) => any;
97
- _handleCarouselTap: (e: MouseEvent | TouchEvent) => void;
98
- _handleCarouselDrag: (e: MouseEvent | TouchEvent) => boolean;
99
- _handleCarouselRelease: (e: MouseEvent | TouchEvent) => boolean;
100
- _handleCarouselClick: (e: MouseEvent | TouchEvent) => boolean;
98
+ _handleCarouselTap: (e: PointerEvent) => void;
99
+ _handleCarouselDrag: (e: PointerEvent) => void;
100
+ _handleCarouselRelease: (e: PointerEvent) => void;
101
+ _handleCarouselClick: (e: MouseEvent) => void;
101
102
  _handleIndicatorClick: (e: Event) => void;
102
- _handleIndicatorKeyPress: (e: KeyboardEvent) => void;
103
- _handleIndicatorInteraction: (e: Event) => void;
103
+ _handleKeydown: (e: KeyboardEvent) => void;
104
+ _handleFlatScroll: () => void;
104
105
  _handleResize: () => void;
105
- _setCarouselHeight(imageOnly?: boolean): void;
106
- _xpos(e: MouseEvent | TouchEvent): number;
107
- _ypos(e: MouseEvent | TouchEvent): number;
106
+ _xpos(e: PointerEvent | MouseEvent | TouchEvent): number;
107
+ _ypos(e: PointerEvent | MouseEvent | TouchEvent): number;
108
108
  _wrap(x: number): any;
109
109
  _track: () => void;
110
110
  _autoScroll: () => void;
111
111
  _scroll(x?: number): void;
112
112
  _updateItemStyle(el: HTMLElement, opacity: number, zIndex: number, transform: string): void;
113
+ private _paintIndicators;
114
+ private _syncA11y;
115
+ private _syncActive;
116
+ private _wrapTrack;
117
+ private _unwrapTrack;
118
+ private _nearestIndex;
119
+ private _scrollToIndex;
113
120
  _cycleTo(n: number, callback?: CarouselOptions['onCycleTo']): void;
114
- /**
115
- * Move carousel to next slide or go forward a given amount of slides.
116
- * @param n How many times the carousel slides.
117
- */
118
121
  next(n?: number): void;
119
- /**
120
- * Move carousel to previous slide or go back a given amount of slides.
121
- * @param n How many times the carousel slides.
122
- */
123
122
  prev(n?: number): void;
124
- /**
125
- * Move carousel to nth slide.
126
- * @param n Index of slide.
127
- * @param callback "onCycleTo" optional callback.
128
- */
129
123
  set(n: number, callback?: CarouselOptions['onCycleTo']): void;
130
124
  }
@@ -1,8 +1,6 @@
1
- import { Component, InitElements, MElement } from '../core/component';
2
- export interface BaseOptions {
3
- }
1
+ import { Component, BaseOptions, InitElements, InitElement } from '../core/component';
4
2
  type InputElement = HTMLInputElement | HTMLTextAreaElement;
5
- export declare class CharacterCounter extends Component<object> {
3
+ export declare class CharacterCounter extends Component<BaseOptions> {
6
4
  el: InputElement;
7
5
  /** Stores the reference to the counter HTML element. */
8
6
  counterEl: HTMLSpanElement;
@@ -23,7 +21,7 @@ export declare class CharacterCounter extends Component<object> {
23
21
  * @param els HTML elements.
24
22
  * @param options Component options.
25
23
  */
26
- static init(els: InitElements<InputElement | MElement>, options?: Partial<BaseOptions>): CharacterCounter[];
24
+ static init(els: InitElements<InputElement | InitElement>, options?: Partial<BaseOptions>): CharacterCounter[];
27
25
  static getInstance(el: InputElement): CharacterCounter;
28
26
  destroy(): void;
29
27
  _setupEventHandlers(): void;
@@ -1,5 +1,5 @@
1
1
  import { Autocomplete, AutocompleteOptions } from './autocomplete';
2
- import { Component, BaseOptions, InitElements, MElement } from '../core/component';
2
+ import { Component, BaseOptions, InitElements, InitElement } from '../core/component';
3
3
  export interface ChipData {
4
4
  /**
5
5
  * Unique identifier.
@@ -46,8 +46,8 @@ export interface ChipsOptions extends BaseOptions {
46
46
  */
47
47
  limit: number;
48
48
  /**
49
- * Specifies class to be used in "close" button (useful when working with Material Symbols icon set).
50
- * @default 'material-icons'
49
+ * Specifies class to be used in "close" button.
50
+ * @default 'material-symbols'
51
51
  */
52
52
  closeIconClass: string;
53
53
  /**
@@ -96,7 +96,7 @@ export declare class Chips extends Component<ChipsOptions> {
96
96
  * @param els HTML elements.
97
97
  * @param options Component options.
98
98
  */
99
- static init(els: InitElements<MElement>, options?: Partial<ChipsOptions>): Chips[];
99
+ static init(els: InitElements<InitElement>, options?: Partial<ChipsOptions>): Chips[];
100
100
  static getInstance(el: HTMLElement): Chips;
101
101
  getData(): ChipData[];
102
102
  destroy(): void;
@@ -1,20 +1,13 @@
1
- import { Component, BaseOptions, InitElements, MElement } from '../core/component';
1
+ import { Component, BaseOptions, InitElements, InitElement } from '../core/component';
2
2
  export interface CollapsibleOptions extends BaseOptions {
3
3
  /**
4
- * If accordion versus collapsible.
4
+ * If accordion versus collapsible. When omitted, `.expandable` on the
5
+ * element turns accordion off. `<details>` with the same `name` already
6
+ * exclusive-open in the browser; this option assigns `name` when it
7
+ * is missing.
5
8
  * @default true
6
9
  */
7
10
  accordion: boolean;
8
- /**
9
- * Transition in duration in milliseconds.
10
- * @default 300
11
- */
12
- inDuration: number;
13
- /**
14
- * Transition out duration in milliseconds.
15
- * @default 300
16
- */
17
- outDuration: number;
18
11
  /**
19
12
  * Callback function called before collapsible is opened.
20
13
  * @default null
@@ -36,8 +29,15 @@ export interface CollapsibleOptions extends BaseOptions {
36
29
  */
37
30
  onCloseEnd: (el: Element) => void;
38
31
  }
32
+ /**
33
+ * Collapsible. Open/close is HTML (`<details>` / `[open]`). Height is CSS.
34
+ * This class is the public API and accordion `name` assignment.
35
+ */
39
36
  export declare class Collapsible extends Component<CollapsibleOptions> {
40
- private _headers;
37
+ private _items;
38
+ private _groupName;
39
+ private _endTimers;
40
+ private _wrappedBodies;
41
41
  constructor(el: HTMLElement, options: Partial<CollapsibleOptions>);
42
42
  static get defaults(): CollapsibleOptions;
43
43
  /**
@@ -51,24 +51,29 @@ export declare class Collapsible extends Component<CollapsibleOptions> {
51
51
  * @param els HTML elements.
52
52
  * @param options Component options.
53
53
  */
54
- static init(els: InitElements<MElement>, options?: Partial<CollapsibleOptions>): Collapsible[];
54
+ static init(els: InitElements<InitElement>, options?: Partial<CollapsibleOptions>): Collapsible[];
55
55
  static getInstance(el: HTMLElement): Collapsible;
56
56
  destroy(): void;
57
- _setupEventHandlers(): void;
58
- _removeEventHandlers(): void;
59
- _handleCollapsibleClick: (e: MouseEvent | KeyboardEvent) => void;
60
- _handleCollapsibleKeydown: (e: KeyboardEvent) => void;
61
- private _setExpanded;
62
- _animateIn(index: number): void;
63
- _animateOut(index: number): void;
64
57
  /**
65
58
  * Open collapsible section.
66
- * @param n Nth section to open.
59
+ * @param index 0-based index of the section to open.
67
60
  */
68
61
  open: (index: number) => void;
69
62
  /**
70
63
  * Close collapsible section.
71
- * @param n Nth section to close.
64
+ * @param index 0-based index of the section to close.
72
65
  */
73
66
  close: (index: number) => void;
67
+ private _collectItems;
68
+ private _setupItems;
69
+ private _isOpen;
70
+ private _setOpen;
71
+ private _wrapDetailsBodies;
72
+ private _unwrapDetailsBodies;
73
+ private _bodyOf;
74
+ private _setupEventHandlers;
75
+ private _removeEventHandlers;
76
+ private _handleToggle;
77
+ private _notify;
78
+ private _durationMs;
74
79
  }
@@ -1,4 +1,4 @@
1
- import { BaseOptions, Component, I18nOptions, InitElements, MElement } from '../core/component';
1
+ import { BaseOptions, Component, I18nOptions, InitElements, InitElement } from '../core/component';
2
2
  export interface DateI18nOptions extends I18nOptions {
3
3
  previousMonth: string;
4
4
  nextMonth: string;
@@ -142,10 +142,6 @@ export interface DatepickerOptions extends BaseOptions {
142
142
  * @default null
143
143
  */
144
144
  onSelect: ((selectedDate: Date) => void) | null;
145
- /**
146
- * Callback function when Datepicker is closed.
147
- * @default null
148
- */
149
145
  /**
150
146
  * Callback function when Datepicker HTML is refreshed.
151
147
  * @default null
@@ -234,7 +230,7 @@ export declare class Datepicker extends Component<DatepickerOptions> {
234
230
  * @param els HTML elements.
235
231
  * @param options Component options.
236
232
  */
237
- static init(els: InitElements<HTMLInputElement | MElement>, options?: Partial<DatepickerOptions>): Datepicker[];
233
+ static init(els: InitElements<HTMLInputElement | InitElement>, options?: Partial<DatepickerOptions>): Datepicker[];
238
234
  /**
239
235
  * Escape a value for interpolation into the calendar markup.
240
236
  *
@@ -392,6 +388,4 @@ export declare class Datepicker extends Component<DatepickerOptions> {
392
388
  _finishSelection: () => void;
393
389
  _confirm: () => void;
394
390
  _cancel: () => void;
395
- open(): this;
396
- close(): this;
397
391
  }
@@ -1,4 +1,4 @@
1
- import { Component, BaseOptions, InitElements, MElement, Openable } from '../core/component';
1
+ import { Component, BaseOptions, InitElements, InitElement, Openable } from '../core/component';
2
2
  export interface DropdownOptions extends BaseOptions {
3
3
  /**
4
4
  * Defines the edge the menu is aligned to.
@@ -99,7 +99,7 @@ export declare class Dropdown extends Component<DropdownOptions> implements Open
99
99
  * @param els HTML elements.
100
100
  * @param options Component options.
101
101
  */
102
- static init(els: InitElements<MElement>, options?: Partial<DropdownOptions>): Dropdown[];
102
+ static init(els: InitElements<InitElement>, options?: Partial<DropdownOptions>): Dropdown[];
103
103
  static getInstance(el: HTMLElement): Dropdown;
104
104
  destroy(): void;
105
105
  _setupEventHandlers(): void;
@@ -113,6 +113,15 @@ export declare class Dropdown extends Component<DropdownOptions> implements Open
113
113
  _handleTriggerKeydown: (e: KeyboardEvent) => void;
114
114
  _handleDocumentTouchmove: (e: TouchEvent) => void;
115
115
  _handleDropdownClick: (e: MouseEvent) => void;
116
+ private _isSubmenuTriggerClick;
117
+ private _setupSubmenus;
118
+ private _toggleSubmenu;
119
+ private _syncSubmenuAria;
120
+ private _handleSubmenuAlign;
121
+ private _alignSubmenu;
122
+ private _closeSubmenus;
123
+ private _containingSubmenu;
124
+ private _focusedRow;
116
125
  _handleDropdownKeydown: (e: KeyboardEvent) => void;
117
126
  _handleWindowResize: () => void;
118
127
  _resetFilterQuery: () => void;
@@ -8,7 +8,6 @@ export { Collapsible } from './collapsible';
8
8
  export { Datepicker } from './datepicker';
9
9
  export { Dropdown } from './dropdown';
10
10
  export { Lightbox } from './lightbox';
11
- export { Modal } from './modal';
12
11
  export { Parallax } from './parallax';
13
12
  export { Pushpin } from './pushpin';
14
13
  export { Range } from './range';
@@ -1,4 +1,4 @@
1
- import { BaseOptions, Component, InitElements, MElement } from '../core/component';
1
+ import { BaseOptions, Component, InitElements, InitElement } from '../core/component';
2
2
  export interface LightboxOptions extends BaseOptions {
3
3
  /**
4
4
  * Transition in duration in milliseconds.
@@ -66,7 +66,7 @@ export declare class Lightbox extends Component<LightboxOptions> {
66
66
  * @param els HTML elements.
67
67
  * @param options Component options.
68
68
  */
69
- static init(els: InitElements<MElement>, options?: Partial<LightboxOptions>): Lightbox[];
69
+ static init(els: InitElements<InitElement>, options?: Partial<LightboxOptions>): Lightbox[];
70
70
  static getInstance(el: HTMLElement): Lightbox;
71
71
  destroy(): void;
72
72
  private _setupEventHandlers;
@@ -1,46 +1,16 @@
1
- import { Component, BaseOptions, InitElements, MElement } from '../core/component';
1
+ import { Component, BaseOptions, InitElements, InitElement } from '../core/component';
2
2
  export interface ParallaxOptions extends BaseOptions {
3
- /**
4
- * The minimum width of the screen, in pixels, where the parallax functionality starts working.
5
- * @default 0
6
- */
7
- responsiveThreshold: number;
8
3
  }
4
+ /**
5
+ * Parallax. The effect is CSS (see components/_parallax.scss). This class
6
+ * exists so AutoInit / getInstance / destroy keep working; it does not
7
+ * attach scroll or resize listeners.
8
+ */
9
9
  export declare class Parallax extends Component<ParallaxOptions> {
10
- private _enabled;
11
- private _img;
12
- static _parallaxes: Parallax[];
13
- static _handleWindowResizeThrottled: (...args: unknown[]) => void;
14
- private static _scrollFrame;
15
10
  constructor(el: HTMLElement, options: Partial<ParallaxOptions>);
16
11
  static get defaults(): ParallaxOptions;
17
- /**
18
- * Initializes instance of Parallax.
19
- * @param el HTML element.
20
- * @param options Component options.
21
- */
22
12
  static init(el: HTMLElement, options?: Partial<ParallaxOptions>): Parallax;
23
- /**
24
- * Initializes instances of Parallax.
25
- * @param els HTML elements.
26
- * @param options Component options.
27
- */
28
- static init(els: InitElements<MElement>, options?: Partial<ParallaxOptions>): Parallax[];
13
+ static init(els: InitElements<InitElement>, options?: Partial<ParallaxOptions>): Parallax[];
29
14
  static getInstance(el: HTMLElement): Parallax;
30
15
  destroy(): void;
31
- static _handleScroll(): void;
32
- /**
33
- * Coalesce scroll events onto animation frames.
34
- *
35
- * The handler reads layout and then writes a transform, so running it more
36
- * than once per frame is wasted work - and the 5ms throttle it replaces was
37
- * short enough to let several run per frame anyway.
38
- */
39
- static _requestScrollUpdate: () => void;
40
- static _handleWindowResize(): void;
41
- _setupEventHandlers(): void;
42
- _removeEventHandlers(): void;
43
- _setupStyles(): void;
44
- _handleImageLoad: () => void;
45
- _updateParallax(): void;
46
16
  }
@@ -1,4 +1,4 @@
1
- import { Component, BaseOptions, InitElements, MElement } from '../core/component';
1
+ import { Component, BaseOptions, InitElements, InitElement } from '../core/component';
2
2
  export interface PushpinOptions extends BaseOptions {
3
3
  /**
4
4
  * The distance in pixels from the top of the page where
@@ -40,7 +40,7 @@ export declare class Pushpin extends Component<PushpinOptions> {
40
40
  * @param els HTML elements.
41
41
  * @param options Component options.
42
42
  */
43
- static init(els: InitElements<MElement>, options?: Partial<PushpinOptions>): Pushpin[];
43
+ static init(els: InitElements<InitElement>, options?: Partial<PushpinOptions>): Pushpin[];
44
44
  static getInstance(el: HTMLElement): Pushpin;
45
45
  destroy(): void;
46
46
  static _updateElements(): void;
@@ -1,4 +1,4 @@
1
- import { Component, BaseOptions, InitElements, MElement } from '../core/component';
1
+ import { Component, BaseOptions, InitElements, InitElement } from '../core/component';
2
2
  export interface RangeOptions extends BaseOptions {
3
3
  }
4
4
  export declare class Range extends Component<RangeOptions> {
@@ -19,7 +19,7 @@ export declare class Range extends Component<RangeOptions> {
19
19
  * @param els HTML elements.
20
20
  * @param options Component options.
21
21
  */
22
- static init(els: InitElements<HTMLInputElement | MElement>, options?: Partial<RangeOptions>): Range[];
22
+ static init(els: InitElements<HTMLInputElement | InitElement>, options?: Partial<RangeOptions>): Range[];
23
23
  static getInstance(el: HTMLInputElement): Range;
24
24
  destroy(): void;
25
25
  _setupEventHandlers(): void;
@@ -45,10 +45,6 @@ export declare const AUTO_INIT_COMPONENTS: {
45
45
  component: typeof Components.Lightbox;
46
46
  selector: string;
47
47
  };
48
- Modal: {
49
- component: typeof Components.Modal;
50
- selector: string;
51
- };
52
48
  Parallax: {
53
49
  component: typeof Components.Parallax;
54
50
  selector: string;