@expressivecss/expressive 0.3.0 → 0.5.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/CHANGELOG.md +96 -0
- package/README.md +4 -9
- package/dist/css/expressive.css +3183 -2150
- 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 +1254 -1567
- package/dist/js/expressive.cjs.map +4 -4
- package/dist/js/expressive.js +1254 -1567
- package/dist/js/expressive.js.map +4 -4
- package/dist/js/expressive.min.js +12 -22
- package/dist/js/expressive.min.js.map +4 -4
- package/dist/js/expressive.mjs +1254 -1568
- package/dist/js/expressive.mjs.map +4 -4
- package/dist/types/behaviors/bottomSheets.d.ts +18 -0
- package/dist/types/behaviors/sideSheets.d.ts +18 -0
- package/dist/types/components/autocomplete.d.ts +13 -20
- 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/datepicker.d.ts +2 -8
- package/dist/types/components/index.d.ts +3 -6
- package/dist/types/components/lightbox.d.ts +2 -2
- package/dist/types/components/{dropdown.d.ts → menu.d.ts} +48 -38
- package/dist/types/components/navigationRail.d.ts +53 -0
- package/dist/types/components/parallax.d.ts +2 -8
- package/dist/types/components/range.d.ts +5 -2
- package/dist/types/components/registry.d.ts +7 -19
- package/dist/types/components/scrollspy.d.ts +26 -50
- package/dist/types/components/select.d.ts +28 -14
- package/dist/types/components/sidenav.d.ts +40 -55
- package/dist/types/components/slider.d.ts +2 -2
- package/dist/types/components/{toasts.d.ts → snackbar.d.ts} +28 -25
- package/dist/types/components/tabs.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 +3 -1
- package/package.json +4 -3
- package/src/sass/README.md +13 -15
- package/src/sass/abstracts/_breakpoints.scss +14 -19
- package/src/sass/abstracts/_mixins.scss +3 -3
- package/src/sass/abstracts/_variables.scss +27 -23
- package/src/sass/base/_global.scss +1 -1
- package/src/sass/base/_grid.scss +64 -133
- package/src/sass/base/_index.scss +1 -1
- package/src/sass/components/_badges.scss +76 -61
- package/src/sass/components/_bottom-sheet.scss +137 -0
- package/src/sass/components/_buttons.scss +22 -54
- package/src/sass/components/_cards.scss +54 -127
- package/src/sass/components/_carousel.scss +4 -6
- package/src/sass/components/_chips.scss +6 -5
- package/src/sass/components/_datepicker.scss +1 -15
- package/src/sass/components/_dialog.scss +268 -0
- package/src/sass/components/_index.scss +9 -7
- package/src/sass/components/_list.scss +253 -0
- package/src/sass/components/_menu.scss +341 -0
- package/src/sass/components/_navbar.scss +68 -117
- package/src/sass/components/_navigation-bar.scss +165 -0
- package/src/sass/components/_navigation-rail.scss +308 -0
- package/src/sass/components/_page-footer.scss +138 -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/_side-sheet.scss +193 -0
- package/src/sass/components/_sidenav.scss +281 -146
- package/src/sass/components/{_toast.scss → _snackbar.scss} +43 -43
- package/src/sass/components/_table_of_contents.scss +30 -14
- package/src/sass/components/_tabs.scss +43 -50
- package/src/sass/components/_toolbar.scss +93 -27
- package/src/sass/components/_tooltip.scss +5 -10
- package/src/sass/components/_transitions.scss +0 -5
- package/src/sass/components/forms/_fieldset.scss +1 -1
- package/src/sass/components/forms/_index.scss +0 -5
- package/src/sass/components/forms/_input-fields.scss +52 -55
- package/src/sass/components/forms/_range.scss +423 -98
- package/src/sass/components/forms/_select.scss +177 -60
- package/src/sass/components/forms/_switches.scss +21 -8
- package/src/sass/tokens/_reference.scss +37 -13
- package/src/sass/tokens/_theme.scss +5 -13
- package/src/sass/utilities/_colors.scss +16 -74
- package/src/sass/utilities/_helpers.scss +1 -3
- package/src/sass/utilities/_typescale.scss +0 -5
- package/src/sass/utilities/_visibility.scss +10 -2
- package/dist/types/components/collapsible.d.ts +0 -96
- package/dist/types/components/modal.d.ts +0 -45
- package/dist/types/components/pushpin.d.ts +0 -51
- package/dist/types/components/tapTarget.d.ts +0 -57
- package/src/sass/components/_collapsible.scss +0 -181
- package/src/sass/components/_collection.scss +0 -198
- package/src/sass/components/_dropdown.scss +0 -129
- package/src/sass/components/_modal.scss +0 -208
- package/src/sass/components/_pushpin.scss +0 -11
- package/src/sass/components/_tapTarget.scss +0 -191
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Drag-to-dismiss for `dialog.bottom-sheet` / `dialog.bottom`.
|
|
3
|
+
*
|
|
4
|
+
* The handle is the top 48dp of the sheet (or an explicit `.handle`).
|
|
5
|
+
* A downward drag past 96dp, or a flick, closes. Anything else snaps back.
|
|
6
|
+
* Content below the handle scrolls normally. Light-dismiss on the scrim
|
|
7
|
+
* stays with {@link Dialogs}.
|
|
8
|
+
*/
|
|
9
|
+
export declare class BottomSheets {
|
|
10
|
+
private static _drag;
|
|
11
|
+
static Init(): void;
|
|
12
|
+
static _onDown(event: PointerEvent): void;
|
|
13
|
+
static _onMove(event: PointerEvent): void;
|
|
14
|
+
static _onUp(event: PointerEvent): void;
|
|
15
|
+
static _onCancel(): void;
|
|
16
|
+
private static _sheet;
|
|
17
|
+
private static _inHandle;
|
|
18
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Drag-to-dismiss for side sheets (`dialog.side-sheet` / `.right` / `.left`).
|
|
3
|
+
*
|
|
4
|
+
* Grab the header or the inner 24dp edge and drag toward the docked side.
|
|
5
|
+
* Past 96dp, or a flick, closes. Light-dismiss on the scrim stays with
|
|
6
|
+
* {@link Dialogs}.
|
|
7
|
+
*/
|
|
8
|
+
export declare class SideSheets {
|
|
9
|
+
private static _drag;
|
|
10
|
+
static Init(): void;
|
|
11
|
+
static _onDown(event: PointerEvent): void;
|
|
12
|
+
static _onMove(event: PointerEvent): void;
|
|
13
|
+
static _onUp(event: PointerEvent): void;
|
|
14
|
+
static _onCancel(): void;
|
|
15
|
+
private static _sheet;
|
|
16
|
+
private static _startDocked;
|
|
17
|
+
private static _inHandle;
|
|
18
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { Component, BaseOptions, InitElements,
|
|
1
|
+
import { Menu, MenuOptions } from './menu';
|
|
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.
|
|
@@ -44,7 +44,7 @@ export interface AutocompleteOptions extends BaseOptions {
|
|
|
44
44
|
* The height of the Menu which can be set via css-property.
|
|
45
45
|
* @default '300px'
|
|
46
46
|
*/
|
|
47
|
-
|
|
47
|
+
maxMenuHeight: string;
|
|
48
48
|
/**
|
|
49
49
|
* Function is called when the input text is altered and data can also be loaded asynchronously.
|
|
50
50
|
* If the results are collected the items in the list can be updated via the function setMenuItems(collectedItems).
|
|
@@ -59,10 +59,10 @@ export interface AutocompleteOptions extends BaseOptions {
|
|
|
59
59
|
*/
|
|
60
60
|
allowUnsafeHTML: boolean;
|
|
61
61
|
/**
|
|
62
|
-
* Pass options object to select
|
|
62
|
+
* Pass options object to select menu initialization.
|
|
63
63
|
* @default {}
|
|
64
64
|
*/
|
|
65
|
-
|
|
65
|
+
menuOptions: Partial<MenuOptions>;
|
|
66
66
|
/**
|
|
67
67
|
* Predefined selected values
|
|
68
68
|
*/
|
|
@@ -80,8 +80,8 @@ export declare class Autocomplete extends Component<AutocompleteOptions> {
|
|
|
80
80
|
private $active;
|
|
81
81
|
private _mousedown;
|
|
82
82
|
container: HTMLElement;
|
|
83
|
-
/** Instance of the
|
|
84
|
-
|
|
83
|
+
/** Instance of the menu plugin for this autocomplete. */
|
|
84
|
+
menu: Menu;
|
|
85
85
|
static _keydown: boolean;
|
|
86
86
|
selectedValues: AutocompleteData[];
|
|
87
87
|
menuItems: AutocompleteData[];
|
|
@@ -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.
|
|
@@ -112,8 +112,8 @@ export declare class Autocomplete extends Component<AutocompleteOptions> {
|
|
|
112
112
|
destroy(): void;
|
|
113
113
|
_setupEventHandlers(): void;
|
|
114
114
|
_removeEventHandlers(): void;
|
|
115
|
-
|
|
116
|
-
|
|
115
|
+
_setupMenu(): void;
|
|
116
|
+
_removeMenu(): void;
|
|
117
117
|
_handleInputBlur: () => void;
|
|
118
118
|
_handleInputKeyup: (e: KeyboardEvent) => void;
|
|
119
119
|
_handleInputFocus: () => void;
|
|
@@ -125,8 +125,8 @@ export declare class Autocomplete extends Component<AutocompleteOptions> {
|
|
|
125
125
|
_resetCurrentElementPosition(): void;
|
|
126
126
|
_resetAutocomplete(): void;
|
|
127
127
|
_highlightPartialText(input: string, label: string): string[];
|
|
128
|
-
|
|
129
|
-
|
|
128
|
+
_createMenuItem(entry: AutocompleteData): HTMLLIElement;
|
|
129
|
+
_renderMenu(): void;
|
|
130
130
|
_setStatusLoading(): void;
|
|
131
131
|
_updateSelectedInfo(): void;
|
|
132
132
|
_refreshInputText(): void;
|
|
@@ -143,19 +143,12 @@ export declare class Autocomplete extends Component<AutocompleteOptions> {
|
|
|
143
143
|
* Updates the visible or selectable items shown in the menu.
|
|
144
144
|
* @param menuItems Items to be available.
|
|
145
145
|
* @param selected Selected item ids
|
|
146
|
-
* @param open Option to conditionally open
|
|
146
|
+
* @param open Option to conditionally open menu
|
|
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,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
|
}
|
|
@@ -4,20 +4,17 @@ export { Cards } from './cards';
|
|
|
4
4
|
export { Carousel } from './carousel';
|
|
5
5
|
export { CharacterCounter } from './characterCounter';
|
|
6
6
|
export { Chips } from './chips';
|
|
7
|
-
export { Collapsible } from './collapsible';
|
|
8
7
|
export { Datepicker } from './datepicker';
|
|
9
|
-
export {
|
|
8
|
+
export { Menu } from './menu';
|
|
10
9
|
export { Lightbox } from './lightbox';
|
|
11
|
-
export { Modal } from './modal';
|
|
12
10
|
export { Parallax } from './parallax';
|
|
13
|
-
export { Pushpin } from './pushpin';
|
|
14
11
|
export { Range } from './range';
|
|
15
12
|
export { ScrollSpy } from './scrollspy';
|
|
16
13
|
export { FormSelect } from './select';
|
|
17
14
|
export { Sidenav } from './sidenav';
|
|
15
|
+
export { NavigationRail } from './navigationRail';
|
|
18
16
|
export { Slider } from './slider';
|
|
19
17
|
export { Tabs } from './tabs';
|
|
20
|
-
export { TapTarget } from './tapTarget';
|
|
21
18
|
export { Timepicker } from './timepicker';
|
|
22
|
-
export {
|
|
19
|
+
export { Snackbar } from './snackbar';
|
|
23
20
|
export { Tooltip } from './tooltip';
|
|
@@ -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,37 +1,38 @@
|
|
|
1
|
-
import { Component, BaseOptions, InitElements,
|
|
2
|
-
export interface
|
|
1
|
+
import { Component, BaseOptions, InitElements, InitElement, Openable } from '../core/component';
|
|
2
|
+
export interface MenuOptions extends BaseOptions {
|
|
3
3
|
/**
|
|
4
4
|
* Defines the edge the menu is aligned to.
|
|
5
5
|
* @default 'left'
|
|
6
6
|
*/
|
|
7
7
|
alignment: 'left' | 'right';
|
|
8
8
|
/**
|
|
9
|
-
* If true, automatically focus
|
|
9
|
+
* If true, automatically focus menu el for keyboard.
|
|
10
10
|
* @default true
|
|
11
11
|
*/
|
|
12
12
|
autoFocus: boolean;
|
|
13
13
|
/**
|
|
14
|
-
* If true, constrainWidth to the size of the
|
|
14
|
+
* If true, constrainWidth to the size of the menu activator.
|
|
15
15
|
* @default true
|
|
16
16
|
*/
|
|
17
17
|
constrainWidth: boolean;
|
|
18
18
|
/**
|
|
19
|
-
* Provide an element that will be the bounding container of the
|
|
19
|
+
* Provide an element that will be the bounding container of the menu.
|
|
20
20
|
* @default null
|
|
21
21
|
*/
|
|
22
22
|
container: Element;
|
|
23
23
|
/**
|
|
24
|
-
* If false, the
|
|
25
|
-
*
|
|
24
|
+
* If false, the menu will show below the trigger.
|
|
25
|
+
* That is the M3 placement. Pass `true` to cover the trigger.
|
|
26
|
+
* @default false
|
|
26
27
|
*/
|
|
27
28
|
coverTrigger: boolean;
|
|
28
29
|
/**
|
|
29
|
-
* If true, close
|
|
30
|
+
* If true, close menu on item click.
|
|
30
31
|
* @default true
|
|
31
32
|
*/
|
|
32
33
|
closeOnClick: boolean;
|
|
33
34
|
/**
|
|
34
|
-
* If true, the
|
|
35
|
+
* If true, the menu will open on hover.
|
|
35
36
|
* @default false
|
|
36
37
|
*/
|
|
37
38
|
hover: boolean;
|
|
@@ -46,22 +47,22 @@ export interface DropdownOptions extends BaseOptions {
|
|
|
46
47
|
*/
|
|
47
48
|
outDuration: number;
|
|
48
49
|
/**
|
|
49
|
-
* Function called when
|
|
50
|
+
* Function called when menu starts entering.
|
|
50
51
|
* @default null
|
|
51
52
|
*/
|
|
52
53
|
onOpenStart: (el: HTMLElement) => void;
|
|
53
54
|
/**
|
|
54
|
-
* Function called when
|
|
55
|
+
* Function called when menu finishes entering.
|
|
55
56
|
* @default null
|
|
56
57
|
*/
|
|
57
58
|
onOpenEnd: (el: HTMLElement) => void;
|
|
58
59
|
/**
|
|
59
|
-
* Function called when
|
|
60
|
+
* Function called when menu starts exiting.
|
|
60
61
|
* @default null
|
|
61
62
|
*/
|
|
62
63
|
onCloseStart: (el: HTMLElement) => void;
|
|
63
64
|
/**
|
|
64
|
-
* Function called when
|
|
65
|
+
* Function called when menu finishes exiting.
|
|
65
66
|
* @default null
|
|
66
67
|
*/
|
|
67
68
|
onCloseEnd: (el: HTMLElement) => void;
|
|
@@ -71,36 +72,36 @@ export interface DropdownOptions extends BaseOptions {
|
|
|
71
72
|
*/
|
|
72
73
|
onItemClick: (el: HTMLLIElement) => void;
|
|
73
74
|
}
|
|
74
|
-
export declare class
|
|
75
|
-
static
|
|
76
|
-
/** ID of the
|
|
75
|
+
export declare class Menu extends Component<MenuOptions> implements Openable {
|
|
76
|
+
static _menus: Menu[];
|
|
77
|
+
/** ID of the menu element. */
|
|
77
78
|
id: string;
|
|
78
|
-
/** The DOM element of the
|
|
79
|
-
|
|
80
|
-
/** If the
|
|
79
|
+
/** The DOM element of the menu. */
|
|
80
|
+
menuEl: HTMLElement;
|
|
81
|
+
/** If the menu is open. */
|
|
81
82
|
isOpen: boolean;
|
|
82
|
-
/** If the
|
|
83
|
+
/** If the menu content is scrollable. */
|
|
83
84
|
isScrollable: boolean;
|
|
84
85
|
isTouchMoving: boolean;
|
|
85
86
|
/** The index of the item focused. */
|
|
86
87
|
focusedIndex: number;
|
|
87
88
|
filterQuery: string[];
|
|
88
89
|
filterTimeout: ReturnType<typeof setTimeout>;
|
|
89
|
-
constructor(el: HTMLElement, options: Partial<
|
|
90
|
-
static get defaults():
|
|
90
|
+
constructor(el: HTMLElement, options: Partial<MenuOptions>);
|
|
91
|
+
static get defaults(): MenuOptions;
|
|
91
92
|
/**
|
|
92
|
-
* Initializes instance of
|
|
93
|
+
* Initializes instance of Menu.
|
|
93
94
|
* @param el HTML element.
|
|
94
95
|
* @param options Component options.
|
|
95
96
|
*/
|
|
96
|
-
static init(el: HTMLElement, options?: Partial<
|
|
97
|
+
static init(el: HTMLElement, options?: Partial<MenuOptions>): Menu;
|
|
97
98
|
/**
|
|
98
|
-
* Initializes instances of
|
|
99
|
+
* Initializes instances of Menu.
|
|
99
100
|
* @param els HTML elements.
|
|
100
101
|
* @param options Component options.
|
|
101
102
|
*/
|
|
102
|
-
static init(els: InitElements<
|
|
103
|
-
static getInstance(el: HTMLElement):
|
|
103
|
+
static init(els: InitElements<InitElement>, options?: Partial<MenuOptions>): Menu[];
|
|
104
|
+
static getInstance(el: HTMLElement): Menu;
|
|
104
105
|
destroy(): void;
|
|
105
106
|
_setupEventHandlers(): void;
|
|
106
107
|
_removeEventHandlers(): void;
|
|
@@ -112,16 +113,25 @@ export declare class Dropdown extends Component<DropdownOptions> implements Open
|
|
|
112
113
|
_handleDocumentClick: (e: MouseEvent) => void;
|
|
113
114
|
_handleTriggerKeydown: (e: KeyboardEvent) => void;
|
|
114
115
|
_handleDocumentTouchmove: (e: TouchEvent) => void;
|
|
115
|
-
|
|
116
|
-
|
|
116
|
+
_handleMenuClick: (e: MouseEvent) => void;
|
|
117
|
+
private _isSubmenuTriggerClick;
|
|
118
|
+
private _setupSubmenus;
|
|
119
|
+
private _toggleSubmenu;
|
|
120
|
+
private _syncSubmenuAria;
|
|
121
|
+
private _handleSubmenuAlign;
|
|
122
|
+
private _alignSubmenu;
|
|
123
|
+
private _closeSubmenus;
|
|
124
|
+
private _containingSubmenu;
|
|
125
|
+
private _focusedRow;
|
|
126
|
+
_handleMenuKeydown: (e: KeyboardEvent) => void;
|
|
117
127
|
_handleWindowResize: () => void;
|
|
118
128
|
_resetFilterQuery: () => void;
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
129
|
+
_resetMenuStyles(): void;
|
|
130
|
+
_resetMenuPositioningStyles(): void;
|
|
131
|
+
_moveMenuToElement(containerEl?: HTMLElement): void;
|
|
132
|
+
_makeMenuFocusable(): void;
|
|
123
133
|
_focusFocusedItem(): void;
|
|
124
|
-
|
|
134
|
+
_getMenuPosition(closestOverflowParent: HTMLElement): {
|
|
125
135
|
x: number;
|
|
126
136
|
y: number;
|
|
127
137
|
verticalAlignment: string;
|
|
@@ -132,17 +142,17 @@ export declare class Dropdown extends Component<DropdownOptions> implements Open
|
|
|
132
142
|
_animateIn(): void;
|
|
133
143
|
_animateOut(): void;
|
|
134
144
|
private _getClosestAncestor;
|
|
135
|
-
|
|
145
|
+
_placeMenu(): void;
|
|
136
146
|
/**
|
|
137
|
-
* Open
|
|
147
|
+
* Open menu.
|
|
138
148
|
*/
|
|
139
149
|
open: () => void;
|
|
140
150
|
/**
|
|
141
|
-
* Close
|
|
151
|
+
* Close menu.
|
|
142
152
|
*/
|
|
143
153
|
close: () => void;
|
|
144
154
|
/**
|
|
145
|
-
* While
|
|
155
|
+
* While menu is open, you can recalculate its dimensions if its contents have changed.
|
|
146
156
|
*/
|
|
147
157
|
recalculateDimensions: () => void;
|
|
148
158
|
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { Component, BaseOptions, InitElements, InitElement } from '../core/component';
|
|
2
|
+
export interface NavigationRailOptions extends BaseOptions {
|
|
3
|
+
/**
|
|
4
|
+
* Called before the rail expands.
|
|
5
|
+
*/
|
|
6
|
+
onOpenStart: (el: HTMLElement) => void;
|
|
7
|
+
/**
|
|
8
|
+
* Called after the rail expands.
|
|
9
|
+
*/
|
|
10
|
+
onOpenEnd: (el: HTMLElement) => void;
|
|
11
|
+
/**
|
|
12
|
+
* Called before the rail collapses.
|
|
13
|
+
*/
|
|
14
|
+
onCloseStart: (el: HTMLElement) => void;
|
|
15
|
+
/**
|
|
16
|
+
* Called after the rail collapses.
|
|
17
|
+
*/
|
|
18
|
+
onCloseEnd: (el: HTMLElement) => void;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Navigation rail. Layout is CSS (collapsed / .expanded). This class
|
|
22
|
+
* toggles that class from the menu button, closes a compact overlay on
|
|
23
|
+
* Escape or a scrim tap, and keeps aria-expanded in sync.
|
|
24
|
+
*/
|
|
25
|
+
export declare class NavigationRail extends Component<NavigationRailOptions> {
|
|
26
|
+
isExpanded: boolean;
|
|
27
|
+
private _toggle;
|
|
28
|
+
private _mql;
|
|
29
|
+
constructor(el: HTMLElement, options: Partial<NavigationRailOptions>);
|
|
30
|
+
static get defaults(): NavigationRailOptions;
|
|
31
|
+
static init(el: HTMLElement, options?: Partial<NavigationRailOptions>): NavigationRail;
|
|
32
|
+
static init(els: InitElements<InitElement>, options?: Partial<NavigationRailOptions>): NavigationRail[];
|
|
33
|
+
static getInstance(el: HTMLElement): NavigationRail;
|
|
34
|
+
destroy(): void;
|
|
35
|
+
/**
|
|
36
|
+
* Expands the rail. On compact windows the overlay (scrim) is CSS.
|
|
37
|
+
*/
|
|
38
|
+
expand: () => void;
|
|
39
|
+
/**
|
|
40
|
+
* Collapses the rail.
|
|
41
|
+
*/
|
|
42
|
+
collapse: () => void;
|
|
43
|
+
/**
|
|
44
|
+
* Toggles expanded / collapsed.
|
|
45
|
+
*/
|
|
46
|
+
toggle: () => void;
|
|
47
|
+
private _findToggle;
|
|
48
|
+
private _isCompact;
|
|
49
|
+
private _isModal;
|
|
50
|
+
private _sync;
|
|
51
|
+
private _onClick;
|
|
52
|
+
private _onKeyDown;
|
|
53
|
+
}
|
|
@@ -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 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;
|
|
@@ -32,6 +32,9 @@ export declare class Range extends Component<RangeOptions> {
|
|
|
32
32
|
_setupThumb(): void;
|
|
33
33
|
_removeThumb(): void;
|
|
34
34
|
_isVertical(): boolean;
|
|
35
|
+
_host(): HTMLElement | null;
|
|
36
|
+
_clampDual(): void;
|
|
37
|
+
_fraction(el: HTMLInputElement): number;
|
|
35
38
|
_sync(): void;
|
|
36
39
|
/**
|
|
37
40
|
* Initializes every range input in the current document.
|
|
@@ -9,7 +9,7 @@ import * as Components from './index';
|
|
|
9
9
|
* ./index.ts) - not four hand-synchronized edits that fail silently when one
|
|
10
10
|
* is forgotten.
|
|
11
11
|
*
|
|
12
|
-
* A component that should only ever be constructed explicitly (
|
|
12
|
+
* A component that should only ever be constructed explicitly (Snackbar,
|
|
13
13
|
* CharacterCounter, Range, ...) simply stays out of this table.
|
|
14
14
|
*/
|
|
15
15
|
export declare const AUTO_INIT_COMPONENTS: {
|
|
@@ -29,34 +29,22 @@ export declare const AUTO_INIT_COMPONENTS: {
|
|
|
29
29
|
component: typeof Components.Chips;
|
|
30
30
|
selector: string;
|
|
31
31
|
};
|
|
32
|
-
Collapsible: {
|
|
33
|
-
component: typeof Components.Collapsible;
|
|
34
|
-
selector: string;
|
|
35
|
-
};
|
|
36
32
|
Datepicker: {
|
|
37
33
|
component: typeof Components.Datepicker;
|
|
38
34
|
selector: string;
|
|
39
35
|
};
|
|
40
|
-
|
|
41
|
-
component: typeof Components.
|
|
36
|
+
Menu: {
|
|
37
|
+
component: typeof Components.Menu;
|
|
42
38
|
selector: string;
|
|
43
39
|
};
|
|
44
40
|
Lightbox: {
|
|
45
41
|
component: typeof Components.Lightbox;
|
|
46
42
|
selector: string;
|
|
47
43
|
};
|
|
48
|
-
Modal: {
|
|
49
|
-
component: typeof Components.Modal;
|
|
50
|
-
selector: string;
|
|
51
|
-
};
|
|
52
44
|
Parallax: {
|
|
53
45
|
component: typeof Components.Parallax;
|
|
54
46
|
selector: string;
|
|
55
47
|
};
|
|
56
|
-
Pushpin: {
|
|
57
|
-
component: typeof Components.Pushpin;
|
|
58
|
-
selector: string;
|
|
59
|
-
};
|
|
60
48
|
ScrollSpy: {
|
|
61
49
|
component: typeof Components.ScrollSpy;
|
|
62
50
|
selector: string;
|
|
@@ -69,12 +57,12 @@ export declare const AUTO_INIT_COMPONENTS: {
|
|
|
69
57
|
component: typeof Components.Sidenav;
|
|
70
58
|
selector: string;
|
|
71
59
|
};
|
|
72
|
-
|
|
73
|
-
component: typeof Components.
|
|
60
|
+
NavigationRail: {
|
|
61
|
+
component: typeof Components.NavigationRail;
|
|
74
62
|
selector: string;
|
|
75
63
|
};
|
|
76
|
-
|
|
77
|
-
component: typeof Components.
|
|
64
|
+
Tabs: {
|
|
65
|
+
component: typeof Components.Tabs;
|
|
78
66
|
selector: string;
|
|
79
67
|
};
|
|
80
68
|
Timepicker: {
|