@expressivecss/expressive 0.3.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.
- package/README.md +1 -1
- package/dist/css/expressive.css +1011 -1339
- package/dist/css/expressive.css.map +1 -1
- package/dist/css/expressive.min.css +1 -1
- package/dist/css/expressive.min.css.map +1 -1
- package/dist/js/expressive.cjs +701 -853
- package/dist/js/expressive.cjs.map +4 -4
- package/dist/js/expressive.js +701 -853
- package/dist/js/expressive.js.map +4 -4
- package/dist/js/expressive.min.js +10 -20
- package/dist/js/expressive.min.js.map +4 -4
- package/dist/js/expressive.mjs +701 -854
- package/dist/js/expressive.mjs.map +4 -4
- package/dist/types/components/autocomplete.d.ts +2 -9
- package/dist/types/components/buttons.d.ts +2 -2
- package/dist/types/components/cards.d.ts +3 -6
- package/dist/types/components/carousel.d.ts +3 -3
- package/dist/types/components/characterCounter.d.ts +3 -5
- package/dist/types/components/chips.d.ts +2 -2
- package/dist/types/components/collapsible.d.ts +6 -23
- package/dist/types/components/datepicker.d.ts +2 -8
- package/dist/types/components/dropdown.d.ts +11 -2
- package/dist/types/components/index.d.ts +0 -1
- package/dist/types/components/lightbox.d.ts +2 -2
- package/dist/types/components/parallax.d.ts +2 -8
- package/dist/types/components/pushpin.d.ts +2 -2
- package/dist/types/components/range.d.ts +2 -2
- package/dist/types/components/registry.d.ts +0 -4
- package/dist/types/components/scrollspy.d.ts +26 -50
- package/dist/types/components/select.d.ts +20 -6
- package/dist/types/components/sidenav.d.ts +40 -55
- package/dist/types/components/slider.d.ts +2 -2
- package/dist/types/components/tabs.d.ts +2 -2
- package/dist/types/components/tapTarget.d.ts +2 -2
- package/dist/types/components/timepicker.d.ts +2 -4
- package/dist/types/components/tooltip.d.ts +2 -2
- package/dist/types/core/component.d.ts +4 -4
- package/dist/types/index.d.ts +1 -1
- package/package.json +2 -2
- package/src/sass/README.md +2 -6
- package/src/sass/abstracts/_breakpoints.scss +0 -16
- package/src/sass/abstracts/_variables.scss +0 -21
- package/src/sass/base/_grid.scss +0 -19
- package/src/sass/components/_badges.scss +1 -1
- package/src/sass/components/_buttons.scss +22 -54
- package/src/sass/components/_cards.scss +50 -123
- package/src/sass/components/_carousel.scss +4 -6
- package/src/sass/components/_collapsible.scss +13 -15
- package/src/sass/components/_collection.scss +9 -27
- package/src/sass/components/_datepicker.scss +1 -15
- package/src/sass/components/_dropdown.scss +110 -14
- package/src/sass/components/_index.scss +1 -0
- package/src/sass/components/_modal.scss +13 -31
- package/src/sass/components/_navbar.scss +9 -6
- package/src/sass/components/_page-footer.scss +134 -15
- package/src/sass/components/_parallax.scss +7 -28
- package/src/sass/components/_preloader.scss +145 -300
- package/src/sass/components/_scrollspy.scss +18 -0
- package/src/sass/components/_sidenav.scss +226 -120
- package/src/sass/components/_table_of_contents.scss +30 -14
- package/src/sass/components/_tabs.scss +54 -35
- package/src/sass/components/_tapTarget.scss +2 -6
- package/src/sass/components/_toast.scss +10 -11
- package/src/sass/components/_toolbar.scss +2 -2
- package/src/sass/components/_tooltip.scss +4 -9
- package/src/sass/components/_transitions.scss +0 -5
- package/src/sass/components/forms/_index.scss +0 -5
- package/src/sass/components/forms/_input-fields.scss +49 -52
- package/src/sass/components/forms/_select.scss +175 -60
- package/src/sass/components/forms/_switches.scss +21 -8
- package/src/sass/utilities/_helpers.scss +1 -3
- package/src/sass/utilities/_typescale.scss +0 -5
- package/src/sass/utilities/_visibility.scss +2 -2
- 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,
|
|
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 |
|
|
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,
|
|
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.
|
|
@@ -30,7 +30,7 @@ export declare class FloatingActionButton extends Component<FloatingActionButton
|
|
|
30
30
|
constructor(el: HTMLElement, options: Partial<FloatingActionButtonOptions>);
|
|
31
31
|
static get defaults(): FloatingActionButtonOptions;
|
|
32
32
|
static init(el: HTMLElement, options?: Partial<FloatingActionButtonOptions>): FloatingActionButton;
|
|
33
|
-
static init(els: InitElements<
|
|
33
|
+
static init(els: InitElements<InitElement>, options?: Partial<FloatingActionButtonOptions>): FloatingActionButton[];
|
|
34
34
|
static getInstance(el: HTMLElement): FloatingActionButton;
|
|
35
35
|
destroy(): void;
|
|
36
36
|
/**
|
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
import { Component, BaseOptions, InitElements,
|
|
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 = "
|
|
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<
|
|
33
|
+
static init(els: InitElements<InitElement>, options?: Partial<CardsOptions>): Cards[];
|
|
37
34
|
static getInstance(el: HTMLElement): Cards;
|
|
38
35
|
/**
|
|
39
36
|
* {@inheritDoc}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Component, BaseOptions, InitElements,
|
|
1
|
+
import { Component, BaseOptions, InitElements, InitElement } from '../core/component';
|
|
2
2
|
export interface CarouselOptions extends BaseOptions {
|
|
3
3
|
/**
|
|
4
4
|
* Transition duration in milliseconds (coverflow). Snap mode uses CSS.
|
|
@@ -27,7 +27,7 @@ export interface CarouselOptions extends BaseOptions {
|
|
|
27
27
|
numVisible: number;
|
|
28
28
|
/**
|
|
29
29
|
* Linear snap track instead of 3D coverflow.
|
|
30
|
-
* Also implied by `.flat
|
|
30
|
+
* Also implied by `.flat`.
|
|
31
31
|
* @default false
|
|
32
32
|
*/
|
|
33
33
|
fullWidth: boolean;
|
|
@@ -86,7 +86,7 @@ export declare class Carousel extends Component<CarouselOptions> {
|
|
|
86
86
|
constructor(el: HTMLElement, options: Partial<CarouselOptions>);
|
|
87
87
|
static get defaults(): CarouselOptions;
|
|
88
88
|
static init(el: HTMLElement, options?: Partial<CarouselOptions>): Carousel;
|
|
89
|
-
static init(els: InitElements<
|
|
89
|
+
static init(els: InitElements<InitElement>, options?: Partial<CarouselOptions>): Carousel[];
|
|
90
90
|
static getInstance(el: HTMLElement): Carousel;
|
|
91
91
|
destroy(): void;
|
|
92
92
|
private _collectItems;
|
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
import { Component, InitElements,
|
|
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<
|
|
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 |
|
|
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,
|
|
2
|
+
import { Component, BaseOptions, InitElements, InitElement } from '../core/component';
|
|
3
3
|
export interface ChipData {
|
|
4
4
|
/**
|
|
5
5
|
* Unique identifier.
|
|
@@ -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<
|
|
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,25 +1,13 @@
|
|
|
1
|
-
import { Component, BaseOptions, InitElements,
|
|
1
|
+
import { Component, BaseOptions, InitElements, InitElement } from '../core/component';
|
|
2
2
|
export interface CollapsibleOptions extends BaseOptions {
|
|
3
3
|
/**
|
|
4
4
|
* If accordion versus collapsible. When omitted, `.expandable` on the
|
|
5
5
|
* element turns accordion off. `<details>` with the same `name` already
|
|
6
|
-
* exclusive-open in the browser; this option
|
|
7
|
-
*
|
|
6
|
+
* exclusive-open in the browser; this option assigns `name` when it
|
|
7
|
+
* is missing.
|
|
8
8
|
* @default true
|
|
9
9
|
*/
|
|
10
10
|
accordion: boolean;
|
|
11
|
-
/**
|
|
12
|
-
* @deprecated Duration is CSS (`--md-comp-collapsible-duration`).
|
|
13
|
-
* Accepted so existing init calls keep compiling, and ignored.
|
|
14
|
-
* @default 300
|
|
15
|
-
*/
|
|
16
|
-
inDuration: number;
|
|
17
|
-
/**
|
|
18
|
-
* @deprecated Duration is CSS (`--md-comp-collapsible-duration`).
|
|
19
|
-
* Accepted so existing init calls keep compiling, and ignored.
|
|
20
|
-
* @default 300
|
|
21
|
-
*/
|
|
22
|
-
outDuration: number;
|
|
23
11
|
/**
|
|
24
12
|
* Callback function called before collapsible is opened.
|
|
25
13
|
* @default null
|
|
@@ -42,9 +30,8 @@ export interface CollapsibleOptions extends BaseOptions {
|
|
|
42
30
|
onCloseEnd: (el: Element) => void;
|
|
43
31
|
}
|
|
44
32
|
/**
|
|
45
|
-
* Collapsible. Open/close is HTML (`<details>` / `[open]
|
|
46
|
-
*
|
|
47
|
-
* for the alias, and aria on non-native headers.
|
|
33
|
+
* Collapsible. Open/close is HTML (`<details>` / `[open]`). Height is CSS.
|
|
34
|
+
* This class is the public API and accordion `name` assignment.
|
|
48
35
|
*/
|
|
49
36
|
export declare class Collapsible extends Component<CollapsibleOptions> {
|
|
50
37
|
private _items;
|
|
@@ -64,7 +51,7 @@ export declare class Collapsible extends Component<CollapsibleOptions> {
|
|
|
64
51
|
* @param els HTML elements.
|
|
65
52
|
* @param options Component options.
|
|
66
53
|
*/
|
|
67
|
-
static init(els: InitElements<
|
|
54
|
+
static init(els: InitElements<InitElement>, options?: Partial<CollapsibleOptions>): Collapsible[];
|
|
68
55
|
static getInstance(el: HTMLElement): Collapsible;
|
|
69
56
|
destroy(): void;
|
|
70
57
|
/**
|
|
@@ -81,15 +68,11 @@ export declare class Collapsible extends Component<CollapsibleOptions> {
|
|
|
81
68
|
private _setupItems;
|
|
82
69
|
private _isOpen;
|
|
83
70
|
private _setOpen;
|
|
84
|
-
private _headerOf;
|
|
85
71
|
private _wrapDetailsBodies;
|
|
86
72
|
private _unwrapDetailsBodies;
|
|
87
73
|
private _bodyOf;
|
|
88
|
-
private _syncAria;
|
|
89
74
|
private _setupEventHandlers;
|
|
90
75
|
private _removeEventHandlers;
|
|
91
|
-
private _handleClick;
|
|
92
|
-
private _handleKeydown;
|
|
93
76
|
private _handleToggle;
|
|
94
77
|
private _notify;
|
|
95
78
|
private _durationMs;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BaseOptions, Component, I18nOptions, InitElements,
|
|
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 |
|
|
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,
|
|
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<
|
|
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,
|
|
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<
|
|
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,11 +1,5 @@
|
|
|
1
|
-
import { Component, BaseOptions, InitElements,
|
|
1
|
+
import { Component, BaseOptions, InitElements, InitElement } from '../core/component';
|
|
2
2
|
export interface ParallaxOptions extends BaseOptions {
|
|
3
|
-
/**
|
|
4
|
-
* @deprecated Motion is CSS (`animation-timeline: view()`). This value
|
|
5
|
-
* is accepted so existing AutoInit calls keep compiling, and is ignored.
|
|
6
|
-
* @default 0
|
|
7
|
-
*/
|
|
8
|
-
responsiveThreshold: number;
|
|
9
3
|
}
|
|
10
4
|
/**
|
|
11
5
|
* Parallax. The effect is CSS (see components/_parallax.scss). This class
|
|
@@ -16,7 +10,7 @@ export declare class Parallax extends Component<ParallaxOptions> {
|
|
|
16
10
|
constructor(el: HTMLElement, options: Partial<ParallaxOptions>);
|
|
17
11
|
static get defaults(): ParallaxOptions;
|
|
18
12
|
static init(el: HTMLElement, options?: Partial<ParallaxOptions>): Parallax;
|
|
19
|
-
static init(els: InitElements<
|
|
13
|
+
static init(els: InitElements<InitElement>, options?: Partial<ParallaxOptions>): Parallax[];
|
|
20
14
|
static getInstance(el: HTMLElement): Parallax;
|
|
21
15
|
destroy(): void;
|
|
22
16
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Component, BaseOptions, InitElements,
|
|
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<
|
|
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,
|
|
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 |
|
|
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;
|
|
@@ -1,12 +1,8 @@
|
|
|
1
|
-
import { Component, BaseOptions, InitElements,
|
|
1
|
+
import { Component, BaseOptions, InitElements, InitElement } from '../core/component';
|
|
2
2
|
export interface ScrollSpyOptions extends BaseOptions {
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*/
|
|
7
|
-
throttle: number;
|
|
8
|
-
/**
|
|
9
|
-
* Offset for centering element when scrolled to.
|
|
4
|
+
* Offset used as IntersectionObserver rootMargin and as
|
|
5
|
+
* `--md-comp-scrollspy-offset` (scroll-margin on the section).
|
|
10
6
|
* @default 200
|
|
11
7
|
*/
|
|
12
8
|
scrollOffset: number;
|
|
@@ -16,62 +12,42 @@ export interface ScrollSpyOptions extends BaseOptions {
|
|
|
16
12
|
*/
|
|
17
13
|
activeClass: string;
|
|
18
14
|
/**
|
|
19
|
-
*
|
|
15
|
+
* Returns a CSS selector for the TOC link. The default is unused: links
|
|
16
|
+
* are found by comparing `a[href^="#"]` to `#id`. A custom function
|
|
17
|
+
* still runs through `querySelector` (escape any author id yourself).
|
|
20
18
|
* @default id => 'a[href="#' + id + '"]'
|
|
21
19
|
*/
|
|
22
20
|
getActiveElement: (id: string) => string;
|
|
23
21
|
/**
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
* If there is no last top element,
|
|
28
|
-
* then the active one will be the first element.
|
|
29
|
-
*
|
|
22
|
+
* If true, keep the last section above the viewport active when nothing
|
|
23
|
+
* intersects. If there is no such section, the first one stays active.
|
|
30
24
|
* @default false
|
|
31
25
|
*/
|
|
32
26
|
keepTopElementActive: boolean;
|
|
33
|
-
/**
|
|
34
|
-
* Used to set scroll animation duration in milliseconds.
|
|
35
|
-
* @default null (browser's native animation implementation/duration)
|
|
36
|
-
*/
|
|
37
|
-
animationDuration: number | null;
|
|
38
27
|
}
|
|
28
|
+
/**
|
|
29
|
+
* ScrollSpy. IntersectionObserver decides which section is current.
|
|
30
|
+
* Hash links are left to the browser (`scroll-margin` + `scroll-behavior`).
|
|
31
|
+
*/
|
|
39
32
|
export declare class ScrollSpy extends Component<ScrollSpyOptions> {
|
|
40
33
|
static _elements: ScrollSpy[];
|
|
41
|
-
static
|
|
42
|
-
static
|
|
43
|
-
static
|
|
44
|
-
static _visibleElements: HTMLElement[];
|
|
45
|
-
static _ticks: number;
|
|
46
|
-
static _keptTopActiveElement: HTMLElement | null;
|
|
47
|
-
private static _throttledScroll;
|
|
48
|
-
private static _throttledResize;
|
|
49
|
-
private tickId;
|
|
50
|
-
private id;
|
|
34
|
+
private static _observer;
|
|
35
|
+
private static _ratios;
|
|
36
|
+
private static _active;
|
|
51
37
|
constructor(el: HTMLElement, options: Partial<ScrollSpyOptions>);
|
|
52
38
|
static get defaults(): ScrollSpyOptions;
|
|
53
|
-
/**
|
|
54
|
-
* Initializes instance of ScrollSpy.
|
|
55
|
-
* @param el HTML element.
|
|
56
|
-
* @param options Component options.
|
|
57
|
-
*/
|
|
58
39
|
static init(el: HTMLElement, options?: Partial<ScrollSpyOptions>): ScrollSpy;
|
|
59
|
-
|
|
60
|
-
* Initializes instances of ScrollSpy.
|
|
61
|
-
* @param els HTML elements.
|
|
62
|
-
* @param options Component options.
|
|
63
|
-
*/
|
|
64
|
-
static init(els: InitElements<MElement>, options?: Partial<ScrollSpyOptions>): ScrollSpy[];
|
|
40
|
+
static init(els: InitElements<InitElement>, options?: Partial<ScrollSpyOptions>): ScrollSpy[];
|
|
65
41
|
static getInstance(el: HTMLElement): ScrollSpy;
|
|
66
42
|
destroy(): void;
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
static
|
|
70
|
-
static
|
|
71
|
-
static
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
43
|
+
private static _ensureObserver;
|
|
44
|
+
private static _onIntersect;
|
|
45
|
+
private static _syncActive;
|
|
46
|
+
private static _nearestAbove;
|
|
47
|
+
private static _clearActive;
|
|
48
|
+
/**
|
|
49
|
+
* Default lookup compares href attributes (no interpolated selector).
|
|
50
|
+
* A custom getActiveElement still returns a selector.
|
|
51
|
+
*/
|
|
52
|
+
static _linkFor(id: string, options: ScrollSpyOptions): Element | null;
|
|
77
53
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Dropdown, DropdownOptions } from './dropdown';
|
|
2
|
-
import { Component, BaseOptions, InitElements,
|
|
2
|
+
import { Component, BaseOptions, InitElements, InitElement } from '../core/component';
|
|
3
3
|
export interface FormSelectOptions extends BaseOptions {
|
|
4
4
|
/**
|
|
5
5
|
* Classes to be added to the select wrapper element.
|
|
@@ -25,16 +25,18 @@ export declare class FormSelect extends Component<FormSelectOptions> {
|
|
|
25
25
|
* Is "null", if not detected.
|
|
26
26
|
*/
|
|
27
27
|
labelEl: HTMLLabelElement;
|
|
28
|
-
/** Dropdown
|
|
29
|
-
dropdownOptions:
|
|
28
|
+
/** Dropdown menu element. */
|
|
29
|
+
dropdownOptions: HTMLElement;
|
|
30
30
|
/** Text input that shows current selected option. */
|
|
31
31
|
input: HTMLInputElement;
|
|
32
32
|
/** Instance of the dropdown plugin for this select. */
|
|
33
33
|
dropdown: Dropdown;
|
|
34
|
-
/** The
|
|
34
|
+
/** The field wrapper around the native select. */
|
|
35
35
|
wrapper: HTMLDivElement;
|
|
36
36
|
selectOptions: (HTMLOptionElement | HTMLOptGroupElement)[];
|
|
37
37
|
private _values;
|
|
38
|
+
private _createdWrapper;
|
|
39
|
+
private _originalLabelFor;
|
|
38
40
|
nativeTabIndex: number;
|
|
39
41
|
constructor(el: HTMLSelectElement, options: FormSelectOptions);
|
|
40
42
|
static get defaults(): FormSelectOptions;
|
|
@@ -49,7 +51,7 @@ export declare class FormSelect extends Component<FormSelectOptions> {
|
|
|
49
51
|
* @param els HTML elements.
|
|
50
52
|
* @param options Component options.
|
|
51
53
|
*/
|
|
52
|
-
static init(els: InitElements<HTMLSelectElement |
|
|
54
|
+
static init(els: InitElements<HTMLSelectElement | InitElement>, options?: Partial<FormSelectOptions>): FormSelect[];
|
|
53
55
|
static getInstance(el: HTMLElement): FormSelect;
|
|
54
56
|
destroy(): void;
|
|
55
57
|
/**
|
|
@@ -57,18 +59,30 @@ export declare class FormSelect extends Component<FormSelectOptions> {
|
|
|
57
59
|
*
|
|
58
60
|
* Assigning `select.value` from script fires no `change` event, so nothing
|
|
59
61
|
* else syncs the visible input text or the `.selected` state on the virtual
|
|
60
|
-
* options.
|
|
62
|
+
* options. Adding or removing `<option>`s also requires this — the menu is
|
|
63
|
+
* rebuilt from the native list, the field and Dropdown instance stay put.
|
|
61
64
|
*/
|
|
62
65
|
refresh(): void;
|
|
63
66
|
_setupEventHandlers(): void;
|
|
64
67
|
_removeEventHandlers(): void;
|
|
68
|
+
private _setupOptionHandlers;
|
|
69
|
+
private _removeOptionHandlers;
|
|
65
70
|
_handleSelectChange: () => void;
|
|
66
71
|
_handleOptionKeydown: (e: KeyboardEvent) => void;
|
|
67
72
|
_handleOptionClick: (e: MouseEvent | KeyboardEvent) => void;
|
|
73
|
+
private _handleOptionFocus;
|
|
68
74
|
_arraysEqual<T, E>(a: T[], b: (E | T)[]): boolean;
|
|
69
75
|
_selectOptionElement(virtualOption: HTMLElement): void;
|
|
70
76
|
_handleInputClick: () => void;
|
|
71
77
|
_setupDropdown(): void;
|
|
78
|
+
private _setupWrapper;
|
|
79
|
+
private _hideNativeSelect;
|
|
80
|
+
private _buildInput;
|
|
81
|
+
private _buildCaret;
|
|
82
|
+
private _initDropdown;
|
|
83
|
+
private _nativeOptions;
|
|
84
|
+
private _buildOptions;
|
|
85
|
+
private _rebuildOptions;
|
|
72
86
|
_addOptionToValues(realOption: HTMLOptionElement, virtualOption: HTMLElement): void;
|
|
73
87
|
_removeDropdown(): void;
|
|
74
88
|
_createAndAppendOptionWithIcon(realOption: HTMLOptionElement | HTMLOptGroupElement, type: string): HTMLLIElement;
|