@expressivecss/expressive 0.1.0-alpha.3
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/LICENSE +21 -0
- package/README.md +82 -0
- package/dist/css/expressive.css +9914 -0
- package/dist/css/expressive.min.css +1 -0
- package/dist/js/components/autocomplete.d.ts +152 -0
- package/dist/js/components/buttons.d.ts +66 -0
- package/dist/js/components/cards.d.ts +50 -0
- package/dist/js/components/carousel.d.ts +131 -0
- package/dist/js/components/chips.d.ts +135 -0
- package/dist/js/components/collapsible.d.ts +74 -0
- package/dist/js/components/datepicker.d.ts +336 -0
- package/dist/js/components/dropdown.d.ts +148 -0
- package/dist/js/components/index.d.ts +21 -0
- package/dist/js/components/materialbox.d.ts +97 -0
- package/dist/js/components/modal.d.ts +45 -0
- package/dist/js/components/parallax.d.ts +40 -0
- package/dist/js/components/pushpin.d.ts +51 -0
- package/dist/js/components/scrollspy.d.ts +80 -0
- package/dist/js/components/sidenav.d.ts +125 -0
- package/dist/js/components/slider.d.ts +101 -0
- package/dist/js/components/tabs.d.ts +80 -0
- package/dist/js/components/tap-target.d.ts +58 -0
- package/dist/js/components/timepicker.d.ts +207 -0
- package/dist/js/components/toast.d.ts +93 -0
- package/dist/js/components/tooltip.d.ts +117 -0
- package/dist/js/components/waves.d.ts +15 -0
- package/dist/js/expressive.js +8239 -0
- package/dist/js/expressive.js.map +1 -0
- package/dist/js/expressive.min.js +2 -0
- package/dist/js/expressive.min.js.map +1 -0
- package/dist/js/expressive.mjs +8206 -0
- package/dist/js/expressive.mjs.map +1 -0
- package/dist/js/forms/character-counter.d.ts +36 -0
- package/dist/js/forms/forms.d.ts +17 -0
- package/dist/js/forms/index.d.ts +4 -0
- package/dist/js/forms/range.d.ts +40 -0
- package/dist/js/forms/select.d.ts +77 -0
- package/dist/js/foundation/component.d.ts +73 -0
- package/dist/js/foundation/index.d.ts +2 -0
- package/dist/js/foundation/utils.d.ts +122 -0
- package/dist/js/index.d.ts +52 -0
- package/dist/js/plugins/docked-display.d.ts +34 -0
- package/dist/js/plugins/index.d.ts +1 -0
- package/package.json +71 -0
- package/src/scss/components/_appbar.scss +454 -0
- package/src/scss/components/_badges.scss +77 -0
- package/src/scss/components/_breadcrumb.scss +27 -0
- package/src/scss/components/_buttons.scss +412 -0
- package/src/scss/components/_cards.scss +267 -0
- package/src/scss/components/_carousel.scss +93 -0
- package/src/scss/components/_chips.scss +147 -0
- package/src/scss/components/_collapsible.scss +84 -0
- package/src/scss/components/_collection.scss +114 -0
- package/src/scss/components/_date-picker.scss +268 -0
- package/src/scss/components/_dropdown.scss +98 -0
- package/src/scss/components/_index.scss +28 -0
- package/src/scss/components/_material-box.scss +42 -0
- package/src/scss/components/_material-icons.scss +6 -0
- package/src/scss/components/_modal.scss +84 -0
- package/src/scss/components/_pagination.scss +45 -0
- package/src/scss/components/_parallax.scss +26 -0
- package/src/scss/components/_preloader.scss +422 -0
- package/src/scss/components/_pulse.scss +35 -0
- package/src/scss/components/_sidenav.scss +229 -0
- package/src/scss/components/_slider.scss +119 -0
- package/src/scss/components/_table-of-contents.scss +32 -0
- package/src/scss/components/_tabs.scss +176 -0
- package/src/scss/components/_tap-target.scss +102 -0
- package/src/scss/components/_time-picker.scss +294 -0
- package/src/scss/components/_toast.scss +70 -0
- package/src/scss/components/_tooltip.scss +49 -0
- package/src/scss/components/_transitions.scss +19 -0
- package/src/scss/components/_video.scss +15 -0
- package/src/scss/expressive.scss +7 -0
- package/src/scss/forms/_checkboxes.scss +199 -0
- package/src/scss/forms/_file-input.scss +41 -0
- package/src/scss/forms/_index.scss +17 -0
- package/src/scss/forms/_input-fields.scss +360 -0
- package/src/scss/forms/_radio-buttons.scss +114 -0
- package/src/scss/forms/_range.scss +148 -0
- package/src/scss/forms/_select.scss +108 -0
- package/src/scss/forms/_switches.scss +127 -0
- package/src/scss/foundation/_base.scss +71 -0
- package/src/scss/foundation/_color-palette.scss +402 -0
- package/src/scss/foundation/_index.scss +10 -0
- package/src/scss/foundation/_mixins.scss +198 -0
- package/src/scss/foundation/_motion.scss +70 -0
- package/src/scss/foundation/_normalize.scss +349 -0
- package/src/scss/foundation/_shape.scss +30 -0
- package/src/scss/foundation/_state-layers.scss +68 -0
- package/src/scss/foundation/_theme.scss +238 -0
- package/src/scss/foundation/_tokens.scss +511 -0
- package/src/scss/foundation/_variables.scss +57 -0
- package/src/scss/layout/_footer.scss +26 -0
- package/src/scss/layout/_grid.scss +172 -0
- package/src/scss/layout/_index.scss +3 -0
- package/src/scss/layout/_table.scss +119 -0
- package/src/scss/utilities/_a11y.scss +77 -0
- package/src/scss/utilities/_colors.scss +74 -0
- package/src/scss/utilities/_elevation.scss +63 -0
- package/src/scss/utilities/_helpers.scss +50 -0
- package/src/scss/utilities/_index.scss +7 -0
- package/src/scss/utilities/_responsive.scss +62 -0
- package/src/scss/utilities/_spacing.scss +38 -0
- package/src/scss/utilities/_typography.scss +115 -0
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { Component, BaseOptions, InitElements, MElement } from '../foundation/component';
|
|
2
|
+
export interface PushpinOptions extends BaseOptions {
|
|
3
|
+
/**
|
|
4
|
+
* The distance in pixels from the top of the page where
|
|
5
|
+
* the element becomes fixed.
|
|
6
|
+
* @default 0
|
|
7
|
+
*/
|
|
8
|
+
top: number;
|
|
9
|
+
/**
|
|
10
|
+
* The distance in pixels from the top of the page where
|
|
11
|
+
* the elements stops being fixed.
|
|
12
|
+
* @default Infinity
|
|
13
|
+
*/
|
|
14
|
+
bottom: number;
|
|
15
|
+
/**
|
|
16
|
+
* The offset from the top the element will be fixed at.
|
|
17
|
+
* @default 0
|
|
18
|
+
*/
|
|
19
|
+
offset: number;
|
|
20
|
+
/**
|
|
21
|
+
* Callback function called when pushpin position changes.
|
|
22
|
+
* You are provided with a position string.
|
|
23
|
+
* @default null
|
|
24
|
+
*/
|
|
25
|
+
onPositionChange: (position: 'pinned' | 'pin-top' | 'pin-bottom') => void;
|
|
26
|
+
}
|
|
27
|
+
export declare class Pushpin extends Component<PushpinOptions> {
|
|
28
|
+
static _pushpins: Pushpin[];
|
|
29
|
+
originalOffset: number;
|
|
30
|
+
constructor(el: HTMLElement, options: Partial<PushpinOptions>);
|
|
31
|
+
static get defaults(): PushpinOptions;
|
|
32
|
+
/**
|
|
33
|
+
* Initializes instance of Pushpin.
|
|
34
|
+
* @param el HTML element.
|
|
35
|
+
* @param options Component options.
|
|
36
|
+
*/
|
|
37
|
+
static init(el: HTMLElement, options?: Partial<PushpinOptions>): Pushpin;
|
|
38
|
+
/**
|
|
39
|
+
* Initializes instances of Pushpin.
|
|
40
|
+
* @param els HTML elements.
|
|
41
|
+
* @param options Component options.
|
|
42
|
+
*/
|
|
43
|
+
static init(els: InitElements<MElement>, options?: Partial<PushpinOptions>): Pushpin[];
|
|
44
|
+
static getInstance(el: HTMLElement): Pushpin;
|
|
45
|
+
destroy(): void;
|
|
46
|
+
static _updateElements(): void;
|
|
47
|
+
_setupEventHandlers(): void;
|
|
48
|
+
_removeEventHandlers(): void;
|
|
49
|
+
_updatePosition(): void;
|
|
50
|
+
_removePinClasses(): void;
|
|
51
|
+
}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { Component, BaseOptions, InitElements, MElement } from '../foundation/component';
|
|
2
|
+
export interface ScrollSpyOptions extends BaseOptions {
|
|
3
|
+
/**
|
|
4
|
+
* Throttle of scroll handler.
|
|
5
|
+
* @default 100
|
|
6
|
+
*/
|
|
7
|
+
throttle: number;
|
|
8
|
+
/**
|
|
9
|
+
* Offset for centering element when scrolled to.
|
|
10
|
+
* @default 200
|
|
11
|
+
*/
|
|
12
|
+
scrollOffset: number;
|
|
13
|
+
/**
|
|
14
|
+
* Class applied to active elements.
|
|
15
|
+
* @default 'active'
|
|
16
|
+
*/
|
|
17
|
+
activeClass: string;
|
|
18
|
+
/**
|
|
19
|
+
* Used to find active element.
|
|
20
|
+
* @default id => 'a[href="#' + id + '"]'
|
|
21
|
+
*/
|
|
22
|
+
getActiveElement: (id: string) => string;
|
|
23
|
+
/**
|
|
24
|
+
* Used to keep last top element active even if
|
|
25
|
+
* scrollbar goes outside of scrollspy elements.
|
|
26
|
+
*
|
|
27
|
+
* If there is no last top element,
|
|
28
|
+
* then the active one will be the first element.
|
|
29
|
+
*
|
|
30
|
+
* @default false
|
|
31
|
+
*/
|
|
32
|
+
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
|
+
}
|
|
39
|
+
export declare class ScrollSpy extends Component<ScrollSpyOptions> {
|
|
40
|
+
static _elements: ScrollSpy[];
|
|
41
|
+
static _count: number;
|
|
42
|
+
static _increment: number;
|
|
43
|
+
static _elementsInView: ScrollSpy[];
|
|
44
|
+
static _visibleElements: HTMLElement[];
|
|
45
|
+
static _ticks: number;
|
|
46
|
+
static _keptTopActiveElement: HTMLElement | null;
|
|
47
|
+
private tickId;
|
|
48
|
+
private id;
|
|
49
|
+
constructor(el: HTMLElement, options: Partial<ScrollSpyOptions>);
|
|
50
|
+
static get defaults(): ScrollSpyOptions;
|
|
51
|
+
/**
|
|
52
|
+
* Initializes instance of ScrollSpy.
|
|
53
|
+
* @param el HTML element.
|
|
54
|
+
* @param options Component options.
|
|
55
|
+
*/
|
|
56
|
+
static init(el: HTMLElement, options?: Partial<ScrollSpyOptions>): ScrollSpy;
|
|
57
|
+
/**
|
|
58
|
+
* Initializes instances of ScrollSpy.
|
|
59
|
+
* @param els HTML elements.
|
|
60
|
+
* @param options Component options.
|
|
61
|
+
*/
|
|
62
|
+
static init(els: InitElements<MElement>, options?: Partial<ScrollSpyOptions>): ScrollSpy[];
|
|
63
|
+
static getInstance(el: HTMLElement): ScrollSpy;
|
|
64
|
+
destroy(): void;
|
|
65
|
+
_setupEventHandlers(): void;
|
|
66
|
+
_removeEventHandlers(): void;
|
|
67
|
+
_handleThrottledResize: () => void;
|
|
68
|
+
_handleTriggerClick: (e: MouseEvent) => void;
|
|
69
|
+
_handleWindowScroll: () => void;
|
|
70
|
+
static _offset(el: any): {
|
|
71
|
+
top: number;
|
|
72
|
+
left: number;
|
|
73
|
+
};
|
|
74
|
+
static _findElements(top: number, right: number, bottom: number, left: number): ScrollSpy[];
|
|
75
|
+
_enter(): void;
|
|
76
|
+
_exit(): void;
|
|
77
|
+
private _resetKeptTopActiveElementIfNeeded;
|
|
78
|
+
private static _getDistanceToViewport;
|
|
79
|
+
private static _smoothScrollIntoView;
|
|
80
|
+
}
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import { Component, BaseOptions, InitElements, MElement, Openable } from '../foundation/component';
|
|
2
|
+
export interface SidenavOptions extends BaseOptions {
|
|
3
|
+
/**
|
|
4
|
+
* Side of screen on which Sidenav appears.
|
|
5
|
+
* @default 'left'
|
|
6
|
+
*/
|
|
7
|
+
edge: 'left' | 'right';
|
|
8
|
+
/**
|
|
9
|
+
* Allow swipe gestures to open/close Sidenav.
|
|
10
|
+
* @default true
|
|
11
|
+
*/
|
|
12
|
+
draggable: boolean;
|
|
13
|
+
/**
|
|
14
|
+
* Width of the area where you can start dragging.
|
|
15
|
+
* @default '10px'
|
|
16
|
+
*/
|
|
17
|
+
dragTargetWidth: string;
|
|
18
|
+
/**
|
|
19
|
+
* Length in ms of enter transition.
|
|
20
|
+
* @default 250
|
|
21
|
+
*/
|
|
22
|
+
inDuration: number;
|
|
23
|
+
/**
|
|
24
|
+
* Length in ms of exit transition.
|
|
25
|
+
* @default 200
|
|
26
|
+
*/
|
|
27
|
+
outDuration: number;
|
|
28
|
+
/**
|
|
29
|
+
* Prevent page from scrolling while sidenav is open.
|
|
30
|
+
* @default true
|
|
31
|
+
*/
|
|
32
|
+
preventScrolling: boolean;
|
|
33
|
+
/**
|
|
34
|
+
* Function called when sidenav starts entering.
|
|
35
|
+
*/
|
|
36
|
+
onOpenStart: (elem: HTMLElement) => void;
|
|
37
|
+
/**
|
|
38
|
+
* Function called when sidenav finishes entering.
|
|
39
|
+
*/
|
|
40
|
+
onOpenEnd: (elem: HTMLElement) => void;
|
|
41
|
+
/**
|
|
42
|
+
* Function called when sidenav starts exiting.
|
|
43
|
+
*/
|
|
44
|
+
onCloseStart: (elem: HTMLElement) => void;
|
|
45
|
+
/**
|
|
46
|
+
* Function called when sidenav finishes exiting.
|
|
47
|
+
*/
|
|
48
|
+
onCloseEnd: (elem: HTMLElement) => void;
|
|
49
|
+
}
|
|
50
|
+
export declare class Sidenav extends Component<SidenavOptions> implements Openable {
|
|
51
|
+
id: string;
|
|
52
|
+
/** Describes open/close state of Sidenav. */
|
|
53
|
+
isOpen: boolean;
|
|
54
|
+
/** Describes if sidenav is fixed. */
|
|
55
|
+
isFixed: boolean;
|
|
56
|
+
/** Describes if Sidenav is being dragged. */
|
|
57
|
+
isDragged: boolean;
|
|
58
|
+
lastWindowWidth: number;
|
|
59
|
+
lastWindowHeight: number;
|
|
60
|
+
static _sidenavs: Sidenav[];
|
|
61
|
+
private _overlay;
|
|
62
|
+
dragTarget: Element;
|
|
63
|
+
private _startingXpos;
|
|
64
|
+
private _xPos;
|
|
65
|
+
private _time;
|
|
66
|
+
private _width;
|
|
67
|
+
private _initialScrollTop;
|
|
68
|
+
private _verticallyScrolling;
|
|
69
|
+
private deltaX;
|
|
70
|
+
private velocityX;
|
|
71
|
+
private percentOpen;
|
|
72
|
+
constructor(el: HTMLElement, options: Partial<SidenavOptions>);
|
|
73
|
+
static get defaults(): SidenavOptions;
|
|
74
|
+
/**
|
|
75
|
+
* Initializes instance of Sidenav.
|
|
76
|
+
* @param el HTML element.
|
|
77
|
+
* @param options Component options.
|
|
78
|
+
*/
|
|
79
|
+
static init(el: HTMLElement, options?: Partial<SidenavOptions>): Sidenav;
|
|
80
|
+
/**
|
|
81
|
+
* Initializes instances of Sidenav.
|
|
82
|
+
* @param els HTML elements.
|
|
83
|
+
* @param options Component options.
|
|
84
|
+
*/
|
|
85
|
+
static init(els: InitElements<MElement>, options?: Partial<SidenavOptions>): Sidenav[];
|
|
86
|
+
static getInstance(el: HTMLElement): Sidenav;
|
|
87
|
+
destroy(): void;
|
|
88
|
+
private _createOverlay;
|
|
89
|
+
private _setupEventHandlers;
|
|
90
|
+
private _removeEventHandlers;
|
|
91
|
+
private _handleTriggerClick;
|
|
92
|
+
private _startDrag;
|
|
93
|
+
private _dragMoveUpdate;
|
|
94
|
+
private _handleDragTargetDrag;
|
|
95
|
+
private _handleDragTargetRelease;
|
|
96
|
+
private _handleCloseDrag;
|
|
97
|
+
private _calculateDelta;
|
|
98
|
+
private _handleCloseRelease;
|
|
99
|
+
private _handleCloseTriggerClick;
|
|
100
|
+
private _handleWindowResize;
|
|
101
|
+
private _setupClasses;
|
|
102
|
+
private _removeClasses;
|
|
103
|
+
private _setupFixed;
|
|
104
|
+
private _isDraggable;
|
|
105
|
+
private _isCurrentlyFixed;
|
|
106
|
+
private _createDragTarget;
|
|
107
|
+
private _preventBodyScrolling;
|
|
108
|
+
private _enableBodyScrolling;
|
|
109
|
+
/**
|
|
110
|
+
* Opens Sidenav.
|
|
111
|
+
*/
|
|
112
|
+
open: () => void;
|
|
113
|
+
/**
|
|
114
|
+
* Closes Sidenav.
|
|
115
|
+
*/
|
|
116
|
+
close: () => void;
|
|
117
|
+
private _animateIn;
|
|
118
|
+
private _animateOut;
|
|
119
|
+
private _animateSidenavIn;
|
|
120
|
+
private _animateSidenavOut;
|
|
121
|
+
private _animateOverlayIn;
|
|
122
|
+
private _animateOverlayOut;
|
|
123
|
+
private _setAriaHidden;
|
|
124
|
+
private _setTabIndex;
|
|
125
|
+
}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import { Component, BaseOptions, InitElements, MElement } from '../foundation/component';
|
|
2
|
+
export interface SliderOptions extends BaseOptions {
|
|
3
|
+
/**
|
|
4
|
+
* Set to false to hide slide indicators.
|
|
5
|
+
* @default true
|
|
6
|
+
*/
|
|
7
|
+
indicators: boolean;
|
|
8
|
+
/**
|
|
9
|
+
* Set height of slider.
|
|
10
|
+
* @default 400
|
|
11
|
+
*/
|
|
12
|
+
height: number;
|
|
13
|
+
/**
|
|
14
|
+
* Set the duration of the transition animation in ms.
|
|
15
|
+
* @default 500
|
|
16
|
+
*/
|
|
17
|
+
duration: number;
|
|
18
|
+
/**
|
|
19
|
+
* Set the duration between transitions in ms.
|
|
20
|
+
* @default 6000
|
|
21
|
+
*/
|
|
22
|
+
interval: number;
|
|
23
|
+
/**
|
|
24
|
+
* If slider should pause when keyboard focus is received.
|
|
25
|
+
* @default true
|
|
26
|
+
*/
|
|
27
|
+
pauseOnFocus: boolean;
|
|
28
|
+
/**
|
|
29
|
+
* If slider should pause when is hovered by a pointer.
|
|
30
|
+
* @default true
|
|
31
|
+
*/
|
|
32
|
+
pauseOnHover: boolean;
|
|
33
|
+
/**
|
|
34
|
+
* Optional function used to generate ARIA label to indicators (for accessibility purposes).
|
|
35
|
+
* @param index Current index, starting from "1".
|
|
36
|
+
* @param current A which indicates whether it is the current element or not
|
|
37
|
+
* @returns a string to be used as label indicator.
|
|
38
|
+
* @default null
|
|
39
|
+
*/
|
|
40
|
+
indicatorLabelFunc: (index: number, current: boolean) => string;
|
|
41
|
+
}
|
|
42
|
+
export declare class Slider extends Component<SliderOptions> {
|
|
43
|
+
/** Index of current slide. */
|
|
44
|
+
activeIndex: number;
|
|
45
|
+
interval: string | number | NodeJS.Timeout;
|
|
46
|
+
eventPause: boolean;
|
|
47
|
+
_slider: HTMLUListElement;
|
|
48
|
+
_slides: HTMLLIElement[];
|
|
49
|
+
_activeSlide: HTMLLIElement;
|
|
50
|
+
_indicators: HTMLLIElement[];
|
|
51
|
+
_hovered: boolean;
|
|
52
|
+
_focused: boolean;
|
|
53
|
+
_focusCurrent: boolean;
|
|
54
|
+
_sliderId: string;
|
|
55
|
+
constructor(el: HTMLElement, options: Partial<SliderOptions>);
|
|
56
|
+
static get defaults(): SliderOptions;
|
|
57
|
+
/**
|
|
58
|
+
* Initializes instance of Slider.
|
|
59
|
+
* @param el HTML element.
|
|
60
|
+
* @param options Component options.
|
|
61
|
+
*/
|
|
62
|
+
static init(el: HTMLElement, options?: Partial<SliderOptions>): Slider;
|
|
63
|
+
/**
|
|
64
|
+
* Initializes instances of Slider.
|
|
65
|
+
* @param els HTML elements.
|
|
66
|
+
* @param options Component options.
|
|
67
|
+
*/
|
|
68
|
+
static init(els: InitElements<MElement>, options?: Partial<SliderOptions>): Slider[];
|
|
69
|
+
static getInstance(el: HTMLElement): Slider;
|
|
70
|
+
destroy(): void;
|
|
71
|
+
private _setupEventHandlers;
|
|
72
|
+
private _removeEventHandlers;
|
|
73
|
+
private _handleIndicatorClick;
|
|
74
|
+
private _handleAutoPauseHover;
|
|
75
|
+
private _handleAutoPauseFocus;
|
|
76
|
+
private _handleAutoStartHover;
|
|
77
|
+
private _handleAutoStartFocus;
|
|
78
|
+
private _handleInterval;
|
|
79
|
+
private _animateSlide;
|
|
80
|
+
private _setSliderHeight;
|
|
81
|
+
private _setupIndicators;
|
|
82
|
+
private _removeIndicators;
|
|
83
|
+
set(index: number): void;
|
|
84
|
+
_pause(fromEvent: boolean): void;
|
|
85
|
+
/**
|
|
86
|
+
* Pause slider autoslide.
|
|
87
|
+
*/
|
|
88
|
+
pause: () => void;
|
|
89
|
+
/**
|
|
90
|
+
* Start slider autoslide.
|
|
91
|
+
*/
|
|
92
|
+
start: () => void;
|
|
93
|
+
/**
|
|
94
|
+
* Move to next slider.
|
|
95
|
+
*/
|
|
96
|
+
next: () => void;
|
|
97
|
+
/**
|
|
98
|
+
* Move to prev slider.
|
|
99
|
+
*/
|
|
100
|
+
prev: () => void;
|
|
101
|
+
}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { Carousel } from './carousel';
|
|
2
|
+
import { Component, BaseOptions, InitElements, MElement } from '../foundation/component';
|
|
3
|
+
export interface TabsOptions extends BaseOptions {
|
|
4
|
+
/**
|
|
5
|
+
* Transition duration in milliseconds.
|
|
6
|
+
* @default 300
|
|
7
|
+
*/
|
|
8
|
+
duration: number;
|
|
9
|
+
/**
|
|
10
|
+
* Callback for when a new tab content is shown.
|
|
11
|
+
* @default null
|
|
12
|
+
*/
|
|
13
|
+
onShow: (newContent: Element) => void;
|
|
14
|
+
/**
|
|
15
|
+
* Set to true to enable swipeable tabs.
|
|
16
|
+
* This also uses the responsiveThreshold option.
|
|
17
|
+
* @default false
|
|
18
|
+
*/
|
|
19
|
+
swipeable: boolean;
|
|
20
|
+
/**
|
|
21
|
+
* The maximum width of the screen, in pixels,
|
|
22
|
+
* where the swipeable functionality initializes.
|
|
23
|
+
* @default infinity
|
|
24
|
+
*/
|
|
25
|
+
responsiveThreshold: number;
|
|
26
|
+
}
|
|
27
|
+
export declare class Tabs extends Component<TabsOptions> {
|
|
28
|
+
_tabLinks: NodeListOf<HTMLAnchorElement>;
|
|
29
|
+
_index: number;
|
|
30
|
+
_indicator: HTMLLIElement;
|
|
31
|
+
_tabWidth: number;
|
|
32
|
+
_tabsWidth: number;
|
|
33
|
+
_tabsCarousel: Carousel;
|
|
34
|
+
_activeTabLink: HTMLAnchorElement;
|
|
35
|
+
_content: HTMLElement;
|
|
36
|
+
constructor(el: HTMLElement, options: Partial<TabsOptions>);
|
|
37
|
+
static get defaults(): TabsOptions;
|
|
38
|
+
/**
|
|
39
|
+
* Initializes instance of Tabs.
|
|
40
|
+
* @param el HTML element.
|
|
41
|
+
* @param options Component options.
|
|
42
|
+
*/
|
|
43
|
+
static init(el: HTMLElement, options?: Partial<TabsOptions>): Tabs;
|
|
44
|
+
/**
|
|
45
|
+
* Initializes instances of Tabs.
|
|
46
|
+
* @param els HTML elements.
|
|
47
|
+
* @param options Component options.
|
|
48
|
+
*/
|
|
49
|
+
static init(els: InitElements<MElement>, options?: Partial<TabsOptions>): Tabs[];
|
|
50
|
+
static getInstance(el: HTMLElement): Tabs;
|
|
51
|
+
destroy(): void;
|
|
52
|
+
/**
|
|
53
|
+
* The index of tab that is currently shown.
|
|
54
|
+
*/
|
|
55
|
+
get index(): number;
|
|
56
|
+
_setupEventHandlers(): void;
|
|
57
|
+
_removeEventHandlers(): void;
|
|
58
|
+
_handleWindowResize: () => void;
|
|
59
|
+
_handleTabClick: (e: MouseEvent) => void;
|
|
60
|
+
_createIndicator(): void;
|
|
61
|
+
_setupActiveTabLink(): void;
|
|
62
|
+
_setupSwipeableTabs(): void;
|
|
63
|
+
_teardownSwipeableTabs(): void;
|
|
64
|
+
_setupNormalTabs(): void;
|
|
65
|
+
_teardownNormalTabs(): void;
|
|
66
|
+
_setTabsAndTabWidth(): void;
|
|
67
|
+
_calcRightPos(el: any): number;
|
|
68
|
+
_calcLeftPos(el: any): number;
|
|
69
|
+
/**
|
|
70
|
+
* Recalculate tab indicator position. This is useful when
|
|
71
|
+
* the indicator position is not correct.
|
|
72
|
+
*/
|
|
73
|
+
updateTabIndicator(): void;
|
|
74
|
+
_animateIndicator(prevIndex: any): void;
|
|
75
|
+
/**
|
|
76
|
+
* Show tab content that corresponds to the tab with the id.
|
|
77
|
+
* @param tabId The id of the tab that you want to switch to.
|
|
78
|
+
*/
|
|
79
|
+
select(tabId: string): void;
|
|
80
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { Component, BaseOptions, InitElements, MElement, Openable } from '../foundation/component';
|
|
2
|
+
export interface TapTargetOptions extends BaseOptions {
|
|
3
|
+
/**
|
|
4
|
+
* Callback function called when Tap Target is opened.
|
|
5
|
+
* @default null
|
|
6
|
+
*/
|
|
7
|
+
onOpen: (origin: HTMLElement) => void;
|
|
8
|
+
/**
|
|
9
|
+
* Callback function called when Tap Target is closed.
|
|
10
|
+
* @default null
|
|
11
|
+
*/
|
|
12
|
+
onClose: (origin: HTMLElement) => void;
|
|
13
|
+
}
|
|
14
|
+
export declare class TapTarget extends Component<TapTargetOptions> implements Openable {
|
|
15
|
+
/**
|
|
16
|
+
* If the tap target is open.
|
|
17
|
+
*/
|
|
18
|
+
isOpen: boolean;
|
|
19
|
+
static _taptargets: TapTarget[];
|
|
20
|
+
private wrapper;
|
|
21
|
+
private originEl;
|
|
22
|
+
private waveEl;
|
|
23
|
+
private contentEl;
|
|
24
|
+
constructor(el: HTMLElement, options: Partial<TapTargetOptions>);
|
|
25
|
+
static get defaults(): TapTargetOptions;
|
|
26
|
+
/**
|
|
27
|
+
* Initializes instance of TapTarget.
|
|
28
|
+
* @param el HTML element.
|
|
29
|
+
* @param options Component options.
|
|
30
|
+
*/
|
|
31
|
+
static init(el: HTMLElement, options?: Partial<TapTargetOptions>): TapTarget;
|
|
32
|
+
/**
|
|
33
|
+
* Initializes instances of TapTarget.
|
|
34
|
+
* @param els HTML elements.
|
|
35
|
+
* @param options Component options.
|
|
36
|
+
*/
|
|
37
|
+
static init(els: InitElements<MElement>, options?: Partial<TapTargetOptions>): TapTarget[];
|
|
38
|
+
static getInstance(el: HTMLElement): TapTarget;
|
|
39
|
+
destroy(): void;
|
|
40
|
+
_setupEventHandlers(): void;
|
|
41
|
+
_removeEventHandlers(): void;
|
|
42
|
+
_handleThrottledResize: () => void;
|
|
43
|
+
_handleKeyboardInteraction: (e: KeyboardEvent) => void;
|
|
44
|
+
_handleTargetToggle: () => void;
|
|
45
|
+
_handleResize: () => void;
|
|
46
|
+
_handleDocumentClick: (e: MouseEvent | TouchEvent | KeyboardEvent) => void;
|
|
47
|
+
_setup(): void;
|
|
48
|
+
private _offset;
|
|
49
|
+
_calculatePositioning(): void;
|
|
50
|
+
/**
|
|
51
|
+
* Open Tap Target.
|
|
52
|
+
*/
|
|
53
|
+
open: () => void;
|
|
54
|
+
/**
|
|
55
|
+
* Close Tap Target.
|
|
56
|
+
*/
|
|
57
|
+
close: () => void;
|
|
58
|
+
}
|
|
@@ -0,0 +1,207 @@
|
|
|
1
|
+
import { Component, BaseOptions, InitElements, MElement, I18nOptions } from '../foundation/component';
|
|
2
|
+
export type Views = 'hours' | 'minutes';
|
|
3
|
+
export interface TimepickerOptions extends BaseOptions {
|
|
4
|
+
/**
|
|
5
|
+
* Dial radius.
|
|
6
|
+
* @default 135
|
|
7
|
+
*/
|
|
8
|
+
dialRadius: number;
|
|
9
|
+
/**
|
|
10
|
+
* Outer radius.
|
|
11
|
+
* @default 105
|
|
12
|
+
*/
|
|
13
|
+
outerRadius: number;
|
|
14
|
+
/**
|
|
15
|
+
* Inner radius.
|
|
16
|
+
* @default 70
|
|
17
|
+
*/
|
|
18
|
+
innerRadius: number;
|
|
19
|
+
/**
|
|
20
|
+
* Tick radius.
|
|
21
|
+
* @default 20
|
|
22
|
+
*/
|
|
23
|
+
tickRadius: number;
|
|
24
|
+
/**
|
|
25
|
+
* Duration of the transition from/to the hours/minutes view.
|
|
26
|
+
* @default 350
|
|
27
|
+
*/
|
|
28
|
+
duration: number;
|
|
29
|
+
/**
|
|
30
|
+
* Specify a DOM element OR selector for a DOM element to render
|
|
31
|
+
* the time picker in, by default it will be placed before the input.
|
|
32
|
+
* @default null
|
|
33
|
+
*/
|
|
34
|
+
container: HTMLElement | string | null;
|
|
35
|
+
/**
|
|
36
|
+
* Show the clear button in the Timepicker.
|
|
37
|
+
* @default false
|
|
38
|
+
*/
|
|
39
|
+
showClearBtn: boolean;
|
|
40
|
+
/**
|
|
41
|
+
* Autosubmit timepicker selection to input field
|
|
42
|
+
* @default true
|
|
43
|
+
*/
|
|
44
|
+
autoSubmit: true;
|
|
45
|
+
/**
|
|
46
|
+
* Default time to set on the timepicker 'now' or '13:14'.
|
|
47
|
+
* @default 'now';
|
|
48
|
+
*/
|
|
49
|
+
defaultTime: string;
|
|
50
|
+
/**
|
|
51
|
+
* Millisecond offset from the defaultTime.
|
|
52
|
+
* @default 0
|
|
53
|
+
*/
|
|
54
|
+
fromNow: number;
|
|
55
|
+
/**
|
|
56
|
+
* Internationalization options.
|
|
57
|
+
*/
|
|
58
|
+
i18n: Partial<I18nOptions>;
|
|
59
|
+
/**
|
|
60
|
+
* Use 12 hour AM/PM clock instead of 24 hour clock.
|
|
61
|
+
* @default true
|
|
62
|
+
*/
|
|
63
|
+
twelveHour: boolean;
|
|
64
|
+
/**
|
|
65
|
+
* Vibrate device when dragging clock hand.
|
|
66
|
+
* @default true
|
|
67
|
+
*/
|
|
68
|
+
vibrate: boolean;
|
|
69
|
+
/**
|
|
70
|
+
* Callback function when a time is selected.
|
|
71
|
+
* @default null
|
|
72
|
+
*/
|
|
73
|
+
onSelect: (hour: number, minute: number) => void;
|
|
74
|
+
/**
|
|
75
|
+
* Callback function for interaction with input field.
|
|
76
|
+
* @default null
|
|
77
|
+
*/
|
|
78
|
+
onInputInteraction: (() => void) | null;
|
|
79
|
+
/**
|
|
80
|
+
* Callback function for done.
|
|
81
|
+
* @default null
|
|
82
|
+
*/
|
|
83
|
+
onDone: (() => void) | null;
|
|
84
|
+
/**
|
|
85
|
+
* Callback function for cancel.
|
|
86
|
+
* @default null
|
|
87
|
+
*/
|
|
88
|
+
onCancel: (() => void) | null;
|
|
89
|
+
/**
|
|
90
|
+
* Display plugin
|
|
91
|
+
*/
|
|
92
|
+
displayPlugin: string;
|
|
93
|
+
/**
|
|
94
|
+
* Configurable display plugin options
|
|
95
|
+
*/
|
|
96
|
+
displayPluginOptions: object;
|
|
97
|
+
}
|
|
98
|
+
type Point = {
|
|
99
|
+
x: number;
|
|
100
|
+
y: number;
|
|
101
|
+
};
|
|
102
|
+
export declare class Timepicker extends Component<TimepickerOptions> {
|
|
103
|
+
el: HTMLInputElement;
|
|
104
|
+
id: string;
|
|
105
|
+
containerEl: HTMLElement;
|
|
106
|
+
plate: HTMLElement;
|
|
107
|
+
digitalClock: HTMLElement;
|
|
108
|
+
inputHours: HTMLInputElement;
|
|
109
|
+
inputMinutes: HTMLInputElement;
|
|
110
|
+
x0: number;
|
|
111
|
+
y0: number;
|
|
112
|
+
moved: boolean;
|
|
113
|
+
dx: number;
|
|
114
|
+
dy: number;
|
|
115
|
+
/**
|
|
116
|
+
* Current view on the timepicker.
|
|
117
|
+
* @default 'hours'
|
|
118
|
+
*/
|
|
119
|
+
currentView: Views;
|
|
120
|
+
hand: SVGElement;
|
|
121
|
+
minutesView: HTMLElement;
|
|
122
|
+
hours: number;
|
|
123
|
+
minutes: number;
|
|
124
|
+
/** The selected time. */
|
|
125
|
+
time: string;
|
|
126
|
+
/**
|
|
127
|
+
* If the time is AM or PM on twelve-hour clock.
|
|
128
|
+
* @default 'PM'
|
|
129
|
+
*/
|
|
130
|
+
amOrPm: 'AM' | 'PM';
|
|
131
|
+
static _template: any;
|
|
132
|
+
/** Vibrate device when dragging clock hand. */
|
|
133
|
+
vibrate: 'vibrate' | 'webkitVibrate' | null;
|
|
134
|
+
_canvas: HTMLElement;
|
|
135
|
+
hoursView: HTMLElement;
|
|
136
|
+
spanAmPm: HTMLSpanElement;
|
|
137
|
+
footer: HTMLElement;
|
|
138
|
+
private _amBtn;
|
|
139
|
+
private _pmBtn;
|
|
140
|
+
bg: Element;
|
|
141
|
+
bearing: Element;
|
|
142
|
+
g: Element;
|
|
143
|
+
toggleViewTimer: string | number | NodeJS.Timeout;
|
|
144
|
+
vibrateTimer: NodeJS.Timeout | number;
|
|
145
|
+
private displayPlugin;
|
|
146
|
+
constructor(el: HTMLInputElement, options: Partial<TimepickerOptions>);
|
|
147
|
+
static get defaults(): TimepickerOptions;
|
|
148
|
+
/**
|
|
149
|
+
* Initializes instance of Timepicker.
|
|
150
|
+
* @param el HTML element.
|
|
151
|
+
* @param options Component options.
|
|
152
|
+
*/
|
|
153
|
+
static init(el: HTMLInputElement, options?: Partial<TimepickerOptions>): Timepicker;
|
|
154
|
+
/**
|
|
155
|
+
* Initializes instances of Timepicker.
|
|
156
|
+
* @param els HTML elements.
|
|
157
|
+
* @param options Component options.
|
|
158
|
+
*/
|
|
159
|
+
static init(els: InitElements<HTMLInputElement | MElement>, options?: Partial<TimepickerOptions>): Timepicker[];
|
|
160
|
+
static _addLeadingZero(num: number): string;
|
|
161
|
+
static _createSVGEl(name: string): SVGElement;
|
|
162
|
+
static _Pos(e: TouchEvent | MouseEvent): Point;
|
|
163
|
+
static getInstance(el: HTMLElement): Timepicker;
|
|
164
|
+
destroy(): void;
|
|
165
|
+
_setupEventHandlers(): void;
|
|
166
|
+
_removeEventHandlers(): void;
|
|
167
|
+
_handleInputClick: () => void;
|
|
168
|
+
_handleInputKeydown: (e: KeyboardEvent) => void;
|
|
169
|
+
_handleTimeInputEnterKey: (e: KeyboardEvent) => void;
|
|
170
|
+
_handleClockClickStart: (e: any) => void;
|
|
171
|
+
_handleDocumentClickMove: (e: any) => void;
|
|
172
|
+
_handleDocumentClickEnd: (e: any) => void;
|
|
173
|
+
_insertHTMLIntoDOM(): void;
|
|
174
|
+
_setupVariables(): void;
|
|
175
|
+
_pickerSetup(): void;
|
|
176
|
+
_clockSetup(): void;
|
|
177
|
+
_buildSVGClock(): void;
|
|
178
|
+
_buildHoursView(): void;
|
|
179
|
+
_buildHoursTick(i: number, radian: number, radius: number): void;
|
|
180
|
+
_buildMinutesView(): void;
|
|
181
|
+
_handleAmPmClick: (e: MouseEvent) => void;
|
|
182
|
+
_handleAmPmKeypress: (e: KeyboardEvent) => void;
|
|
183
|
+
_handleAmPmInteraction: (e: HTMLElement) => void;
|
|
184
|
+
_updateAmPmView(): void;
|
|
185
|
+
_updateTimeFromInput(): void;
|
|
186
|
+
/**
|
|
187
|
+
* Show hours or minutes view on timepicker.
|
|
188
|
+
* @param view The name of the view you want to switch to, 'hours' or 'minutes'.
|
|
189
|
+
* @param delay
|
|
190
|
+
*/
|
|
191
|
+
showView: (view: Views, delay?: number) => void;
|
|
192
|
+
resetClock(delay: any): void;
|
|
193
|
+
_inputFromTextField: () => void;
|
|
194
|
+
drawClockFromTimeInput(value: any, isHours: any): void;
|
|
195
|
+
setHand(x: any, y: any, roundBy5?: boolean): void;
|
|
196
|
+
setClockAttributes(radian: number, radius: number): void;
|
|
197
|
+
formatHours(): void;
|
|
198
|
+
formatMinutes(): void;
|
|
199
|
+
setHoursDefault(): void;
|
|
200
|
+
done: (clearValue?: any) => void;
|
|
201
|
+
confirm: () => void;
|
|
202
|
+
cancel: () => void;
|
|
203
|
+
clear: () => void;
|
|
204
|
+
open(): this;
|
|
205
|
+
close(): this;
|
|
206
|
+
}
|
|
207
|
+
export {};
|