@webtides/element-library 0.1.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 +109 -0
- package/LICENSE +21 -0
- package/README.md +125 -0
- package/all.js +26 -0
- package/custom-elements.json +7683 -0
- package/index.js +3 -0
- package/package.json +132 -0
- package/patches/@glidejs+glide+3.6.2.patch +11 -0
- package/src/components/accordion/accordion.changelog.md +47 -0
- package/src/components/accordion/accordion.define.js +3 -0
- package/src/components/accordion/accordion.events.js +3 -0
- package/src/components/accordion/accordion.js +144 -0
- package/src/components/accordion/accordion.readme.md +71 -0
- package/src/components/accordion/accordion.style.js +64 -0
- package/src/components/accordion-group/accordion-group.changelog.md +35 -0
- package/src/components/accordion-group/accordion-group.define.js +3 -0
- package/src/components/accordion-group/accordion-group.js +63 -0
- package/src/components/accordion-group/accordion-group.readme.md +56 -0
- package/src/components/amount-field/amount-field.changelog.md +40 -0
- package/src/components/amount-field/amount-field.define.js +3 -0
- package/src/components/amount-field/amount-field.js +91 -0
- package/src/components/amount-field/amount-field.readme.md +65 -0
- package/src/components/amount-field/amount-field.style.js +58 -0
- package/src/components/button/button.changelog.md +19 -0
- package/src/components/button/button.define.js +3 -0
- package/src/components/button/button.js +174 -0
- package/src/components/button/button.readme.md +91 -0
- package/src/components/button/button.style.js +251 -0
- package/src/components/carousel/carousel.changelog.md +58 -0
- package/src/components/carousel/carousel.define.js +3 -0
- package/src/components/carousel/carousel.events.js +3 -0
- package/src/components/carousel/carousel.js +232 -0
- package/src/components/carousel/carousel.readme.md +78 -0
- package/src/components/carousel/carousel.style.js +142 -0
- package/src/components/carousel/glide/components/ShadowAnchors.js +12 -0
- package/src/components/carousel/glide/components/ShadowClones.js +41 -0
- package/src/components/carousel/glide/components/ShadowGaps.js +28 -0
- package/src/components/carousel/glide/components/ShadowHtml.js +32 -0
- package/src/components/checkbox-field/checkbox-field.changelog.md +47 -0
- package/src/components/checkbox-field/checkbox-field.define.js +3 -0
- package/src/components/checkbox-field/checkbox-field.js +102 -0
- package/src/components/checkbox-field/checkbox-field.readme.md +66 -0
- package/src/components/checkbox-field/checkbox-field.style.js +69 -0
- package/src/components/dialog/dialog.changelog.md +24 -0
- package/src/components/dialog/dialog.define.js +3 -0
- package/src/components/dialog/dialog.events.js +8 -0
- package/src/components/dialog/dialog.js +271 -0
- package/src/components/dialog/dialog.readme.md +122 -0
- package/src/components/dialog/dialog.style.js +124 -0
- package/src/components/dropdown/dropdown.changelog.md +39 -0
- package/src/components/dropdown/dropdown.define.js +3 -0
- package/src/components/dropdown/dropdown.js +98 -0
- package/src/components/dropdown/dropdown.readme.md +69 -0
- package/src/components/dropdown/dropdown.style.js +17 -0
- package/src/components/form-field/form-field.changelog.md +35 -0
- package/src/components/form-field/form-field.define.js +3 -0
- package/src/components/form-field/form-field.events.js +4 -0
- package/src/components/form-field/form-field.js +210 -0
- package/src/components/form-field/form-field.readme.md +80 -0
- package/src/components/form-field/form-field.style.js +25 -0
- package/src/components/input-field/input-field.changelog.md +39 -0
- package/src/components/input-field/input-field.define.js +3 -0
- package/src/components/input-field/input-field.js +71 -0
- package/src/components/input-field/input-field.readme.md +90 -0
- package/src/components/input-field/input-field.style.js +33 -0
- package/src/components/lazy-src/lazy-src.changelog.md +57 -0
- package/src/components/lazy-src/lazy-src.define.js +3 -0
- package/src/components/lazy-src/lazy-src.events.js +5 -0
- package/src/components/lazy-src/lazy-src.js +100 -0
- package/src/components/lazy-src/lazy-src.readme.md +63 -0
- package/src/components/notification/notification.changelog.md +22 -0
- package/src/components/notification/notification.define.js +3 -0
- package/src/components/notification/notification.events.js +6 -0
- package/src/components/notification/notification.js +280 -0
- package/src/components/notification/notification.readme.md +98 -0
- package/src/components/notification/notification.style.js +113 -0
- package/src/components/password-field/password-field.changelog.md +22 -0
- package/src/components/password-field/password-field.define.js +3 -0
- package/src/components/password-field/password-field.js +113 -0
- package/src/components/password-field/password-field.readme.md +60 -0
- package/src/components/password-field/password-field.style.js +62 -0
- package/src/components/radio-field/radio-field.changelog.md +21 -0
- package/src/components/radio-field/radio-field.define.js +3 -0
- package/src/components/radio-field/radio-field.js +140 -0
- package/src/components/radio-field/radio-field.readme.md +72 -0
- package/src/components/radio-field/radio-field.style.js +108 -0
- package/src/components/scroll-to/scroll-to.changelog.md +39 -0
- package/src/components/scroll-to/scroll-to.define.js +3 -0
- package/src/components/scroll-to/scroll-to.js +40 -0
- package/src/components/scroll-to/scroll-to.readme.md +50 -0
- package/src/components/scroll-to-top/scroll-to-top.changelog.md +39 -0
- package/src/components/scroll-to-top/scroll-to-top.define.js +3 -0
- package/src/components/scroll-to-top/scroll-to-top.js +78 -0
- package/src/components/scroll-to-top/scroll-to-top.readme.md +48 -0
- package/src/components/scroll-to-top/scroll-to-top.style.js +9 -0
- package/src/components/select-field/select-field.changelog.md +30 -0
- package/src/components/select-field/select-field.define.js +3 -0
- package/src/components/select-field/select-field.js +83 -0
- package/src/components/select-field/select-field.readme.md +131 -0
- package/src/components/select-field/select-field.style.js +24 -0
- package/src/components/slider/slider.changelog.md +177 -0
- package/src/components/slider/slider.define.js +3 -0
- package/src/components/slider/slider.events.js +4 -0
- package/src/components/slider/slider.js +338 -0
- package/src/components/slider/slider.readme.md +87 -0
- package/src/components/slider/slider.style.js +107 -0
- package/src/components/sticky/sticky.changelog.md +43 -0
- package/src/components/sticky/sticky.define.js +3 -0
- package/src/components/sticky/sticky.js +105 -0
- package/src/components/sticky/sticky.readme.md +63 -0
- package/src/components/sticky/sticky.style.js +21 -0
- package/src/components/svg-use/svg-use.changelog.md +41 -0
- package/src/components/svg-use/svg-use.define.js +3 -0
- package/src/components/svg-use/svg-use.js +39 -0
- package/src/components/svg-use/svg-use.readme.md +50 -0
- package/src/components/svg-use/svg-use.style.js +20 -0
- package/src/components/switch-field/switch-field.changelog.md +21 -0
- package/src/components/switch-field/switch-field.define.js +3 -0
- package/src/components/switch-field/switch-field.js +99 -0
- package/src/components/switch-field/switch-field.readme.md +58 -0
- package/src/components/switch-field/switch-field.style.js +98 -0
- package/src/components/tab-group/tab-group.changelog.md +35 -0
- package/src/components/tab-group/tab-group.define.js +3 -0
- package/src/components/tab-group/tab-group.js +109 -0
- package/src/components/tab-group/tab-group.readme.md +61 -0
- package/src/components/tab-group/tab-group.style.js +7 -0
- package/src/components/tab-link/tab-link.changelog.md +35 -0
- package/src/components/tab-link/tab-link.define.js +3 -0
- package/src/components/tab-link/tab-link.js +50 -0
- package/src/components/tab-link/tab-link.readme.md +66 -0
- package/src/components/tab-link/tab-link.style.js +32 -0
- package/src/components/tab-panel/tab-panel.changelog.md +39 -0
- package/src/components/tab-panel/tab-panel.define.js +3 -0
- package/src/components/tab-panel/tab-panel.js +30 -0
- package/src/components/tab-panel/tab-panel.readme.md +57 -0
- package/src/components/tab-panel/tab-panel.style.js +7 -0
- package/src/components/textarea-field/textarea-field.changelog.md +39 -0
- package/src/components/textarea-field/textarea-field.define.js +3 -0
- package/src/components/textarea-field/textarea-field.js +62 -0
- package/src/components/textarea-field/textarea-field.readme.md +102 -0
- package/src/components/textarea-field/textarea-field.style.js +7 -0
- package/src/components/transition-classes/transition-classes.changelog.md +39 -0
- package/src/components/transition-classes/transition-classes.define.js +3 -0
- package/src/components/transition-classes/transition-classes.js +154 -0
- package/src/components/transition-classes/transition-classes.readme.md +71 -0
- package/src/themes/default.css +165 -0
- package/src/themes/high-contrast.css +147 -0
- package/src/themes/sketchy.css +238 -0
- package/types/all.d.ts +1 -0
- package/types/index.d.ts +1 -0
- package/types/src/components/accordion/accordion.d.ts +60 -0
- package/types/src/components/accordion/accordion.define.d.ts +1 -0
- package/types/src/components/accordion/accordion.events.d.ts +4 -0
- package/types/src/components/accordion/accordion.style.d.ts +2 -0
- package/types/src/components/accordion-group/accordion-group.d.ts +28 -0
- package/types/src/components/accordion-group/accordion-group.define.d.ts +1 -0
- package/types/src/components/amount-field/amount-field.d.ts +53 -0
- package/types/src/components/amount-field/amount-field.define.d.ts +1 -0
- package/types/src/components/amount-field/amount-field.style.d.ts +2 -0
- package/types/src/components/button/button.d.ts +73 -0
- package/types/src/components/button/button.define.d.ts +1 -0
- package/types/src/components/button/button.style.d.ts +2 -0
- package/types/src/components/carousel/carousel.d.ts +79 -0
- package/types/src/components/carousel/carousel.define.d.ts +1 -0
- package/types/src/components/carousel/carousel.events.d.ts +4 -0
- package/types/src/components/carousel/carousel.style.d.ts +2 -0
- package/types/src/components/carousel/glide/components/ShadowAnchors.d.ts +1 -0
- package/types/src/components/carousel/glide/components/ShadowClones.d.ts +1 -0
- package/types/src/components/carousel/glide/components/ShadowGaps.d.ts +1 -0
- package/types/src/components/carousel/glide/components/ShadowHtml.d.ts +1 -0
- package/types/src/components/checkbox-field/checkbox-field.d.ts +69 -0
- package/types/src/components/checkbox-field/checkbox-field.define.d.ts +1 -0
- package/types/src/components/checkbox-field/checkbox-field.style.d.ts +2 -0
- package/types/src/components/dialog/dialog.d.ts +103 -0
- package/types/src/components/dialog/dialog.define.d.ts +1 -0
- package/types/src/components/dialog/dialog.events.d.ts +9 -0
- package/types/src/components/dialog/dialog.style.d.ts +2 -0
- package/types/src/components/dropdown/dropdown.d.ts +45 -0
- package/types/src/components/dropdown/dropdown.define.d.ts +1 -0
- package/types/src/components/dropdown/dropdown.style.d.ts +2 -0
- package/types/src/components/form-field/form-field.d.ts +110 -0
- package/types/src/components/form-field/form-field.define.d.ts +1 -0
- package/types/src/components/form-field/form-field.events.d.ts +5 -0
- package/types/src/components/form-field/form-field.style.d.ts +2 -0
- package/types/src/components/input-field/input-field.d.ts +38 -0
- package/types/src/components/input-field/input-field.define.d.ts +1 -0
- package/types/src/components/input-field/input-field.style.d.ts +2 -0
- package/types/src/components/lazy-src/lazy-src.d.ts +46 -0
- package/types/src/components/lazy-src/lazy-src.define.d.ts +1 -0
- package/types/src/components/lazy-src/lazy-src.events.d.ts +6 -0
- package/types/src/components/notification/notification.d.ts +92 -0
- package/types/src/components/notification/notification.define.d.ts +1 -0
- package/types/src/components/notification/notification.events.d.ts +7 -0
- package/types/src/components/notification/notification.style.d.ts +2 -0
- package/types/src/components/password-field/password-field.d.ts +66 -0
- package/types/src/components/password-field/password-field.define.d.ts +1 -0
- package/types/src/components/password-field/password-field.style.d.ts +2 -0
- package/types/src/components/radio-field/radio-field.d.ts +62 -0
- package/types/src/components/radio-field/radio-field.define.d.ts +1 -0
- package/types/src/components/radio-field/radio-field.style.d.ts +2 -0
- package/types/src/components/scroll-to/scroll-to.d.ts +24 -0
- package/types/src/components/scroll-to/scroll-to.define.d.ts +1 -0
- package/types/src/components/scroll-to-top/scroll-to-top.d.ts +32 -0
- package/types/src/components/scroll-to-top/scroll-to-top.define.d.ts +1 -0
- package/types/src/components/scroll-to-top/scroll-to-top.style.d.ts +2 -0
- package/types/src/components/select-field/select-field.d.ts +39 -0
- package/types/src/components/select-field/select-field.define.d.ts +1 -0
- package/types/src/components/select-field/select-field.style.d.ts +2 -0
- package/types/src/components/slider/slider.d.ts +129 -0
- package/types/src/components/slider/slider.define.d.ts +1 -0
- package/types/src/components/slider/slider.events.d.ts +5 -0
- package/types/src/components/slider/slider.style.d.ts +2 -0
- package/types/src/components/sticky/sticky.d.ts +47 -0
- package/types/src/components/sticky/sticky.define.d.ts +1 -0
- package/types/src/components/sticky/sticky.style.d.ts +2 -0
- package/types/src/components/svg-use/svg-use.d.ts +18 -0
- package/types/src/components/svg-use/svg-use.define.d.ts +1 -0
- package/types/src/components/svg-use/svg-use.style.d.ts +2 -0
- package/types/src/components/switch-field/switch-field.d.ts +67 -0
- package/types/src/components/switch-field/switch-field.define.d.ts +1 -0
- package/types/src/components/switch-field/switch-field.style.d.ts +2 -0
- package/types/src/components/tab-group/tab-group.d.ts +48 -0
- package/types/src/components/tab-group/tab-group.define.d.ts +1 -0
- package/types/src/components/tab-group/tab-group.style.d.ts +2 -0
- package/types/src/components/tab-link/tab-link.d.ts +30 -0
- package/types/src/components/tab-link/tab-link.define.d.ts +1 -0
- package/types/src/components/tab-link/tab-link.style.d.ts +2 -0
- package/types/src/components/tab-panel/tab-panel.d.ts +18 -0
- package/types/src/components/tab-panel/tab-panel.define.d.ts +1 -0
- package/types/src/components/tab-panel/tab-panel.style.d.ts +2 -0
- package/types/src/components/textarea-field/textarea-field.d.ts +34 -0
- package/types/src/components/textarea-field/textarea-field.define.d.ts +1 -0
- package/types/src/components/textarea-field/textarea-field.style.d.ts +2 -0
- package/types/src/components/transition-classes/transition-classes.d.ts +52 -0
- package/types/src/components/transition-classes/transition-classes.define.d.ts +1 -0
- package/types/src/utils/body-scroll.d.ts +4 -0
- package/types/src/utils/transitions.d.ts +9 -0
- package/web-types.json +3956 -0
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
export function define(): void;
|
|
2
|
+
/**
|
|
3
|
+
* A notification / alert that can be shown inline or as a transient toast. Built for both feedback
|
|
4
|
+
* after an action and inline status messages. Semantic variants, an optional close button, and
|
|
5
|
+
* optional auto-dismiss. API modelled on Shoelace's `<sl-alert>`.
|
|
6
|
+
*
|
|
7
|
+
* The host is exposed as an ARIA live region — `role="alert"` (assertive) for `danger` / `warning`
|
|
8
|
+
* variants, `role="status"` (polite) otherwise — so toasts are announced when they appear.
|
|
9
|
+
*
|
|
10
|
+
* @element el-notification
|
|
11
|
+
*
|
|
12
|
+
* @fires {CustomEvent} notification-show - Fired when the notification starts to open.
|
|
13
|
+
* @fires {CustomEvent} notification-after-show - Fired once the open transition has finished.
|
|
14
|
+
* @fires {CustomEvent} notification-hide - Fired when the notification starts to close.
|
|
15
|
+
* @fires {CustomEvent} notification-after-hide - Fired once the close transition has finished.
|
|
16
|
+
*
|
|
17
|
+
* @slot - The notification's message.
|
|
18
|
+
* @slot icon - A leading icon. Falls back to a variant-appropriate default icon.
|
|
19
|
+
*
|
|
20
|
+
* @csspart base - The animated outer wrapper.
|
|
21
|
+
* @csspart panel - The visual surface (background, border, variant accent).
|
|
22
|
+
* @csspart icon - The leading icon container.
|
|
23
|
+
* @csspart message - The message wrapper around the default slot.
|
|
24
|
+
* @csspart close-button - The optional close button.
|
|
25
|
+
*
|
|
26
|
+
* @cssstate open - Set while the notification is shown.
|
|
27
|
+
*
|
|
28
|
+
* @property {boolean} open - Whether the notification is shown. Reflected to the `open` attribute.
|
|
29
|
+
* @property {'default'|'primary'|'success'|'neutral'|'warning'|'danger'} variant - Visual + semantic
|
|
30
|
+
* variant. Default `'default'`.
|
|
31
|
+
* @property {boolean} closable - Whether to render a close button. Default `false`.
|
|
32
|
+
* @property {number} duration - Auto-dismiss delay in milliseconds; `Infinity` (default) never
|
|
33
|
+
* auto-dismisses. The countdown pauses while the pointer or focus is inside the notification.
|
|
34
|
+
*/
|
|
35
|
+
export default class Notification {
|
|
36
|
+
properties(): {
|
|
37
|
+
open: boolean;
|
|
38
|
+
variant: string;
|
|
39
|
+
closable: boolean;
|
|
40
|
+
duration: number;
|
|
41
|
+
};
|
|
42
|
+
connected(): void;
|
|
43
|
+
disconnected(): void;
|
|
44
|
+
watch(): {
|
|
45
|
+
open: (open: any) => void;
|
|
46
|
+
};
|
|
47
|
+
events(): {
|
|
48
|
+
'[data-close]': {
|
|
49
|
+
click: () => Promise<void>;
|
|
50
|
+
};
|
|
51
|
+
"[part~='base']": {
|
|
52
|
+
mouseenter: () => void;
|
|
53
|
+
mouseleave: () => void;
|
|
54
|
+
focusin: () => void;
|
|
55
|
+
focusout: () => void;
|
|
56
|
+
};
|
|
57
|
+
};
|
|
58
|
+
/**
|
|
59
|
+
* Shows the notification.
|
|
60
|
+
* @returns {Promise<void>} Resolves after the open transition has finished.
|
|
61
|
+
*/
|
|
62
|
+
show(): Promise<void>;
|
|
63
|
+
open: boolean;
|
|
64
|
+
/**
|
|
65
|
+
* Hides the notification.
|
|
66
|
+
* @returns {Promise<void>} Resolves after the close transition has finished.
|
|
67
|
+
*/
|
|
68
|
+
hide(): Promise<void>;
|
|
69
|
+
/**
|
|
70
|
+
* Moves the notification into the shared top-right toast stack and shows it.
|
|
71
|
+
* @returns {Promise<void>} Resolves after the open transition has finished.
|
|
72
|
+
*/
|
|
73
|
+
toast(): Promise<void>;
|
|
74
|
+
/** @private */
|
|
75
|
+
private _applyOpen;
|
|
76
|
+
/** @private */
|
|
77
|
+
private _applyClose;
|
|
78
|
+
/** @private */
|
|
79
|
+
private _startAutoHide;
|
|
80
|
+
_autoHideTimer: number;
|
|
81
|
+
/** @private */
|
|
82
|
+
private _removeFromToastStack;
|
|
83
|
+
/** @private */
|
|
84
|
+
private _once;
|
|
85
|
+
/** @private */
|
|
86
|
+
private closeButtonTemplate;
|
|
87
|
+
template(): any;
|
|
88
|
+
/** @private */
|
|
89
|
+
private variantIconTemplate;
|
|
90
|
+
}
|
|
91
|
+
export { Events };
|
|
92
|
+
import Events from './notification.events.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
export function define(): void;
|
|
2
|
+
/**
|
|
3
|
+
* A password input with an optional show/hide reveal toggle. Extends `InputField` (and therefore
|
|
4
|
+
* `FormField`), inheriting the label / help / error / validation surface; it pins the input `type`
|
|
5
|
+
* to `password` and flips it to `text` while revealed.
|
|
6
|
+
*
|
|
7
|
+
* @element el-password-field
|
|
8
|
+
*
|
|
9
|
+
* @fires {CustomEvent<string>} input-change - Fired when the input's value changes. `detail` is
|
|
10
|
+
* the new value. Bubbles.
|
|
11
|
+
*
|
|
12
|
+
* @property {boolean} passwordToggle - Whether to render the show/hide reveal button. Default `true`.
|
|
13
|
+
* @property {boolean} passwordVisible - Whether the value is currently revealed as plain text.
|
|
14
|
+
* Default `false`.
|
|
15
|
+
*/
|
|
16
|
+
export default class PasswordField extends InputField {
|
|
17
|
+
properties(): {
|
|
18
|
+
type: string;
|
|
19
|
+
passwordToggle: boolean;
|
|
20
|
+
passwordVisible: boolean;
|
|
21
|
+
placeholder: string;
|
|
22
|
+
pattern: boolean;
|
|
23
|
+
name: string;
|
|
24
|
+
value: any;
|
|
25
|
+
required: boolean;
|
|
26
|
+
disabled: boolean;
|
|
27
|
+
label: string;
|
|
28
|
+
labelScreenReaderOnly: boolean;
|
|
29
|
+
errorMessage: string;
|
|
30
|
+
helpMessage: string;
|
|
31
|
+
valid: boolean;
|
|
32
|
+
touched: boolean;
|
|
33
|
+
};
|
|
34
|
+
/**
|
|
35
|
+
* Toggles between masked (`password`) and revealed (`text`) input.
|
|
36
|
+
* @returns {void}
|
|
37
|
+
*/
|
|
38
|
+
togglePasswordVisibility(): void;
|
|
39
|
+
passwordVisible: any;
|
|
40
|
+
type: string;
|
|
41
|
+
events(): {
|
|
42
|
+
'[data-password-toggle]': {
|
|
43
|
+
click: () => void;
|
|
44
|
+
};
|
|
45
|
+
'[ref=input]': {
|
|
46
|
+
focus: () => void;
|
|
47
|
+
blur: () => void;
|
|
48
|
+
keyup: (event: any) => void;
|
|
49
|
+
change: () => void;
|
|
50
|
+
};
|
|
51
|
+
'.is-invalid': {
|
|
52
|
+
focus: () => void;
|
|
53
|
+
};
|
|
54
|
+
'[data-clear-input]': {
|
|
55
|
+
click: () => void;
|
|
56
|
+
touchstart: () => void;
|
|
57
|
+
};
|
|
58
|
+
};
|
|
59
|
+
/** @private */
|
|
60
|
+
private toggleTemplate;
|
|
61
|
+
/** @private */
|
|
62
|
+
private eyeIconTemplate;
|
|
63
|
+
/** @private */
|
|
64
|
+
private eyeOffIconTemplate;
|
|
65
|
+
}
|
|
66
|
+
import InputField from '../input-field/input-field.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
export function define(): void;
|
|
2
|
+
/**
|
|
3
|
+
* A single-choice radio group with a custom indicator, label, help text and validation. Renders a
|
|
4
|
+
* native `<fieldset>`/`<legend>` wrapping mutually-exclusive `<input type="radio">`s (so keyboard
|
|
5
|
+
* navigation, grouping and form submission are all native). Extends `FormField` and inherits its
|
|
6
|
+
* help / error / required / touched-state surface; the `label` becomes the group's `<legend>`.
|
|
7
|
+
*
|
|
8
|
+
* @element el-radio-field
|
|
9
|
+
*
|
|
10
|
+
* @fires {CustomEvent<string>} input-change - Fired when the selected value changes. `detail` is
|
|
11
|
+
* the newly selected value. Bubbles.
|
|
12
|
+
*
|
|
13
|
+
* @cssstate touched - Set once the user has focused and blurred the group. Inherits `valid` and
|
|
14
|
+
* `invalid` from `FormField`.
|
|
15
|
+
*
|
|
16
|
+
* @property {string} value - The selected option's value.
|
|
17
|
+
* @property {Array<string | { value: string, label?: string, disabled?: boolean }>} options -
|
|
18
|
+
* Options to render. Accepts plain strings (`['Yes', 'No']`) or option objects
|
|
19
|
+
* (`[{ value, label, disabled? }]`). Strings are used as both value and label.
|
|
20
|
+
*/
|
|
21
|
+
export default class RadioField extends FormField {
|
|
22
|
+
/** @private */
|
|
23
|
+
private uuid;
|
|
24
|
+
properties(): {
|
|
25
|
+
options: any[];
|
|
26
|
+
name: string;
|
|
27
|
+
value: any;
|
|
28
|
+
required: boolean;
|
|
29
|
+
disabled: boolean;
|
|
30
|
+
label: string;
|
|
31
|
+
labelScreenReaderOnly: boolean;
|
|
32
|
+
errorMessage: string;
|
|
33
|
+
helpMessage: string;
|
|
34
|
+
valid: boolean;
|
|
35
|
+
touched: boolean;
|
|
36
|
+
};
|
|
37
|
+
events(): {
|
|
38
|
+
'input[type="radio"]': {
|
|
39
|
+
change: (event: any) => void;
|
|
40
|
+
focus: () => void;
|
|
41
|
+
blur: () => void;
|
|
42
|
+
};
|
|
43
|
+
};
|
|
44
|
+
/**
|
|
45
|
+
* Whether the group currently passes validation. A radio group's only native constraint is
|
|
46
|
+
* `required`, so this is timing-independent (no rendered input needed): required ⇒ a value
|
|
47
|
+
* must be selected.
|
|
48
|
+
* @private
|
|
49
|
+
*/
|
|
50
|
+
private _computeValid;
|
|
51
|
+
/**
|
|
52
|
+
* The label is rendered as the group's `<legend>` (see `template`), so the base FormField
|
|
53
|
+
* `<label>` is suppressed.
|
|
54
|
+
* @returns {null}
|
|
55
|
+
*/
|
|
56
|
+
labelTemplate(): null;
|
|
57
|
+
/** @private */
|
|
58
|
+
private legendTemplate;
|
|
59
|
+
/** @private */
|
|
60
|
+
private fieldTemplate;
|
|
61
|
+
}
|
|
62
|
+
import FormField from '../form-field/form-field.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export function define(): void;
|
|
2
|
+
/**
|
|
3
|
+
* Wraps any click-emitting child (`<a>`, `<button>`, …) and scrolls to the element
|
|
4
|
+
* matched by `selector` when the child is clicked.
|
|
5
|
+
*
|
|
6
|
+
* @element el-scroll-to
|
|
7
|
+
*
|
|
8
|
+
* @slot - Default slot. Any child that emits a `click` event will trigger the scroll.
|
|
9
|
+
*
|
|
10
|
+
* @property {string} selector - CSS selector for the element to scroll into view on click.
|
|
11
|
+
* @property {boolean} preventDefault - When `true`, the captured click's default action is
|
|
12
|
+
* suppressed (e.g. an `<a href>`'s navigation).
|
|
13
|
+
*/
|
|
14
|
+
export default class ScrollTo {
|
|
15
|
+
properties(): {
|
|
16
|
+
selector: string;
|
|
17
|
+
preventDefault: boolean;
|
|
18
|
+
};
|
|
19
|
+
events(): {
|
|
20
|
+
this: {
|
|
21
|
+
click: (e: any) => void;
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
export function define(): void;
|
|
2
|
+
/**
|
|
3
|
+
* Wraps any click-emitting child (`<a>`, `<button>`, …) and smoothly scrolls the window
|
|
4
|
+
* to the top when the child is clicked.
|
|
5
|
+
*
|
|
6
|
+
* @element el-scroll-to-top
|
|
7
|
+
*
|
|
8
|
+
* @slot - Default slot. Any child that emits a `click` event will trigger the scroll.
|
|
9
|
+
*
|
|
10
|
+
* @property {number} duration - Duration of the easing animation in milliseconds. Ignored
|
|
11
|
+
* when the page's `html` element has `scroll-behavior: smooth` (the browser drives the
|
|
12
|
+
* scroll in that case).
|
|
13
|
+
* @property {boolean} preventDefault - When `true`, the captured click's default action is
|
|
14
|
+
* suppressed.
|
|
15
|
+
*/
|
|
16
|
+
export default class ScrollToTop {
|
|
17
|
+
properties(): {
|
|
18
|
+
duration: number;
|
|
19
|
+
preventDefault: boolean;
|
|
20
|
+
};
|
|
21
|
+
connected(): void;
|
|
22
|
+
events(): {
|
|
23
|
+
this: {
|
|
24
|
+
click: (e: any) => void;
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
/**
|
|
28
|
+
* Scroll the window to the top.
|
|
29
|
+
* @returns {void}
|
|
30
|
+
*/
|
|
31
|
+
scrollToTop(): void;
|
|
32
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
export function define(): void;
|
|
2
|
+
/**
|
|
3
|
+
* Native `<select>` wrapper with label, help text, validation feedback and a custom
|
|
4
|
+
* dropdown indicator. Extends `FormField` and inherits its label / help / error /
|
|
5
|
+
* required surface.
|
|
6
|
+
*
|
|
7
|
+
* @element el-select-field
|
|
8
|
+
*
|
|
9
|
+
* @fires {CustomEvent<string>} input-change - Fired when the selected value changes.
|
|
10
|
+
* `detail` is the new value. Bubbles.
|
|
11
|
+
*
|
|
12
|
+
* @property {string} placeholder - Placeholder text rendered as the first disabled `<option>`
|
|
13
|
+
* when no selection has been made.
|
|
14
|
+
* @property {Array<string | { value: string, label?: string, selected?: boolean }>} options -
|
|
15
|
+
* Options to render. Accepts plain strings (`['Apple', 'Pear']`) or option objects
|
|
16
|
+
* (`[{ value, label, selected? }]`). Strings are used as both value and label.
|
|
17
|
+
*/
|
|
18
|
+
export default class SelectField extends FormField {
|
|
19
|
+
constructor();
|
|
20
|
+
properties(): {
|
|
21
|
+
placeholder: string;
|
|
22
|
+
options: any[];
|
|
23
|
+
name: string;
|
|
24
|
+
value: any;
|
|
25
|
+
required: boolean;
|
|
26
|
+
disabled: boolean;
|
|
27
|
+
label: string;
|
|
28
|
+
labelScreenReaderOnly: boolean;
|
|
29
|
+
errorMessage: string;
|
|
30
|
+
helpMessage: string;
|
|
31
|
+
valid: boolean;
|
|
32
|
+
touched: boolean;
|
|
33
|
+
};
|
|
34
|
+
/** @private */
|
|
35
|
+
private fieldTemplate;
|
|
36
|
+
/** @private */
|
|
37
|
+
private dropdownIndicatorTemplate;
|
|
38
|
+
}
|
|
39
|
+
import FormField from '../form-field/form-field.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
export function define(): void;
|
|
2
|
+
/**
|
|
3
|
+
* CSS-scroll-snap based carousel. Direct children matched by `itemSelector` are arranged
|
|
4
|
+
* horizontally and navigated via the rendered dot pager and arrow buttons, by setting
|
|
5
|
+
* `selectedIndex`, or by calling `next()` / `previous()` / `goTo()`.
|
|
6
|
+
*
|
|
7
|
+
* @element el-slider
|
|
8
|
+
*
|
|
9
|
+
* @fires {CustomEvent<number>} SliderRun - Fired when `selectedIndex` changes.
|
|
10
|
+
* `detail` is the new index.
|
|
11
|
+
* @fires {CustomEvent<number>} SliderResize - Fired after the host element resizes and
|
|
12
|
+
* the slider re-aligns to the current index. `detail` is the current index.
|
|
13
|
+
*
|
|
14
|
+
* @slot - Default slot. Place item nodes here; each must match `itemSelector`.
|
|
15
|
+
* @slot arrow-left - Content of the "previous" navigation button (defaults to `⟨`).
|
|
16
|
+
* @slot arrow-right - Content of the "next" navigation button (defaults to `⟩`).
|
|
17
|
+
*
|
|
18
|
+
* @csspart scroller - The horizontally scrolling track.
|
|
19
|
+
* @csspart controls - Applied to both the dots wrapper and the arrows wrapper.
|
|
20
|
+
* @csspart dots - The dot pager wrapper.
|
|
21
|
+
* @csspart dot - Applied to each pager dot.
|
|
22
|
+
* @csspart selected-dot - Added to the dot representing the active slide.
|
|
23
|
+
* @csspart arrows - The arrow buttons wrapper.
|
|
24
|
+
* @csspart arrow - Applied to both arrow buttons.
|
|
25
|
+
* @csspart arrow-left - Applied to the previous button (in addition to `arrow`).
|
|
26
|
+
* @csspart arrow-right - Applied to the next button (in addition to `arrow`).
|
|
27
|
+
* @csspart arrow-disabled - Added to an arrow button when it cannot navigate further.
|
|
28
|
+
*
|
|
29
|
+
* @property {string} itemSelector - CSS selector used to find item nodes among the slotted
|
|
30
|
+
* children.
|
|
31
|
+
* @property {number} itemsToShow - Number of items visible per slide step. Used to compute
|
|
32
|
+
* the per-item width.
|
|
33
|
+
* @property {number} itemsToScroll - Number of items advanced by each `next()` / `previous()`
|
|
34
|
+
* call.
|
|
35
|
+
* @property {boolean} rewind - When `true`, navigating past the last (or before the first)
|
|
36
|
+
* item wraps around.
|
|
37
|
+
* @property {number} selectedIndex - Currently focused item index.
|
|
38
|
+
* @property {boolean} autoSelect - When `true`, navigation skips items that are already fully
|
|
39
|
+
* visible.
|
|
40
|
+
* @property {boolean} dots - Whether to render the dot pager.
|
|
41
|
+
* @property {boolean} arrows - Whether to render the previous/next arrow buttons.
|
|
42
|
+
* @property {boolean} setIndexAfterResize - When `true`, the slider re-aligns to
|
|
43
|
+
* `selectedIndex` after the host resizes.
|
|
44
|
+
* @property {number} manualScrollEndDelay - Debounce window (ms) used to detect the end of a
|
|
45
|
+
* manual scroll.
|
|
46
|
+
*/
|
|
47
|
+
export default class Slider {
|
|
48
|
+
constructor(options: any);
|
|
49
|
+
/** @private */
|
|
50
|
+
private itemsCount;
|
|
51
|
+
/** @private */
|
|
52
|
+
private items;
|
|
53
|
+
properties(): {
|
|
54
|
+
itemSelector: string;
|
|
55
|
+
itemsToShow: number;
|
|
56
|
+
itemsToScroll: number;
|
|
57
|
+
rewind: boolean;
|
|
58
|
+
selectedIndex: number;
|
|
59
|
+
autoSelect: boolean;
|
|
60
|
+
dots: boolean;
|
|
61
|
+
arrows: boolean;
|
|
62
|
+
setIndexAfterResize: boolean;
|
|
63
|
+
manualScrollEndDelay: number;
|
|
64
|
+
};
|
|
65
|
+
/**
|
|
66
|
+
* `true` when the slider's content overflows its viewport (i.e. there is anything
|
|
67
|
+
* to scroll through).
|
|
68
|
+
*/
|
|
69
|
+
get canSlide(): boolean;
|
|
70
|
+
/** `true` when `selectedIndex` can be decremented. */
|
|
71
|
+
get canSlideLeft(): boolean;
|
|
72
|
+
/** `true` when `selectedIndex` can be incremented. */
|
|
73
|
+
get canSlideRight(): boolean;
|
|
74
|
+
connected(): void;
|
|
75
|
+
/** @private */
|
|
76
|
+
private indexItems;
|
|
77
|
+
events(): {
|
|
78
|
+
'.scroller': {
|
|
79
|
+
scroll: () => void;
|
|
80
|
+
};
|
|
81
|
+
'.dot': {
|
|
82
|
+
click: (e: any) => void;
|
|
83
|
+
};
|
|
84
|
+
'.arrow-left': {
|
|
85
|
+
click: () => void;
|
|
86
|
+
};
|
|
87
|
+
'.arrow-right': {
|
|
88
|
+
click: () => void;
|
|
89
|
+
};
|
|
90
|
+
};
|
|
91
|
+
selectedIndex: any;
|
|
92
|
+
watch(): {
|
|
93
|
+
selectedIndex: () => void;
|
|
94
|
+
};
|
|
95
|
+
/**
|
|
96
|
+
* Advance to the next item (by `itemsToScroll`).
|
|
97
|
+
* @returns {void}
|
|
98
|
+
*/
|
|
99
|
+
next(): void;
|
|
100
|
+
/**
|
|
101
|
+
* Move to the previous item (by `itemsToScroll`).
|
|
102
|
+
* @returns {void}
|
|
103
|
+
*/
|
|
104
|
+
previous(): void;
|
|
105
|
+
/**
|
|
106
|
+
* Jump directly to `index`.
|
|
107
|
+
* @param {number} index - Target item index.
|
|
108
|
+
* @param {boolean} [smooth=true] - When `true` the scroll animates; otherwise it
|
|
109
|
+
* jumps instantly.
|
|
110
|
+
* @returns {void}
|
|
111
|
+
*/
|
|
112
|
+
goTo(index: number, smooth?: boolean): void;
|
|
113
|
+
/** @private */
|
|
114
|
+
private startScrollEndTimer;
|
|
115
|
+
/** @private */
|
|
116
|
+
private scrollToIndex;
|
|
117
|
+
/** @private */
|
|
118
|
+
private onManualScrollEnd;
|
|
119
|
+
/** @private */
|
|
120
|
+
private addResizeListener;
|
|
121
|
+
template(): any;
|
|
122
|
+
/** @private */
|
|
123
|
+
private dotsTemplate;
|
|
124
|
+
/** @private */
|
|
125
|
+
private arrowsTemplate;
|
|
126
|
+
#private;
|
|
127
|
+
}
|
|
128
|
+
import SliderEvents from './slider.events.js';
|
|
129
|
+
export { html, defineElement, SliderEvents };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
export function define(): void;
|
|
2
|
+
/**
|
|
3
|
+
* Sticky positioning helper. Toggles `sticky`, `up` and `down` custom states on the host
|
|
4
|
+
* element based on the page's scroll position and direction so consumers can drive styling
|
|
5
|
+
* from CSS (e.g. `el-sticky:state(sticky):state(up) { … }`). Publishes the host's
|
|
6
|
+
* height as the `--sticky-height` custom property.
|
|
7
|
+
*
|
|
8
|
+
* @element el-sticky
|
|
9
|
+
*
|
|
10
|
+
* @slot - Default slot for the sticky content (e.g. a `<nav>`).
|
|
11
|
+
*
|
|
12
|
+
* @cssstate sticky - Set when the element has scrolled past its initial position.
|
|
13
|
+
* @cssstate up - Set while the page is scrolling up past the threshold.
|
|
14
|
+
* @cssstate down - Set while the page is scrolling down past the threshold.
|
|
15
|
+
*
|
|
16
|
+
* @cssproperty --sticky-height - Auto-set to the host's `clientHeight`. Maintained via a
|
|
17
|
+
* `ResizeObserver` and useful for transform calculations or layout offsets.
|
|
18
|
+
*
|
|
19
|
+
* @property {boolean} forceDown - When `true`, the element always shows the `down` state
|
|
20
|
+
* regardless of scroll direction. Useful for navigation that should remain visible.
|
|
21
|
+
*/
|
|
22
|
+
export default class Sticky {
|
|
23
|
+
/** @private */
|
|
24
|
+
private height;
|
|
25
|
+
/** @private */
|
|
26
|
+
private lastScrollTop;
|
|
27
|
+
/** @private */
|
|
28
|
+
private resizeObserver;
|
|
29
|
+
properties(): {
|
|
30
|
+
forceDown: boolean;
|
|
31
|
+
};
|
|
32
|
+
connected(): void;
|
|
33
|
+
disconnected(): void;
|
|
34
|
+
events(): {
|
|
35
|
+
document: {
|
|
36
|
+
scroll: () => void;
|
|
37
|
+
};
|
|
38
|
+
window: {
|
|
39
|
+
load: () => void;
|
|
40
|
+
resize: () => void;
|
|
41
|
+
};
|
|
42
|
+
};
|
|
43
|
+
/** @private */
|
|
44
|
+
private calcCSSProperties;
|
|
45
|
+
/** @private */
|
|
46
|
+
private hasScrolled;
|
|
47
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export function define(): void;
|
|
2
|
+
/**
|
|
3
|
+
* Thin wrapper around `<svg><use href>` that references a symbol from an SVG sprite
|
|
4
|
+
* (either external via `spritePath` or embedded in the parent document).
|
|
5
|
+
*
|
|
6
|
+
* @element el-svg-use
|
|
7
|
+
*
|
|
8
|
+
* @property {string} name - `id` of the `<symbol>` to render from the sprite.
|
|
9
|
+
* @property {string} spritePath - Path to an external SVG sprite. When empty, the symbol is
|
|
10
|
+
* assumed to be embedded in the parent document.
|
|
11
|
+
*/
|
|
12
|
+
export default class SvgUse {
|
|
13
|
+
properties(): {
|
|
14
|
+
name: string;
|
|
15
|
+
spritePath: string;
|
|
16
|
+
};
|
|
17
|
+
template(): string;
|
|
18
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
export function define(): void;
|
|
2
|
+
/**
|
|
3
|
+
* An on/off toggle switch. Renders a native `<input type="checkbox">` with `role="switch"` (so it
|
|
4
|
+
* is announced as a switch and submits with forms) behind a custom track/thumb. Extends
|
|
5
|
+
* `FormField` and inherits its label / help / error / required surface.
|
|
6
|
+
*
|
|
7
|
+
* @element el-switch-field
|
|
8
|
+
*
|
|
9
|
+
* @fires {CustomEvent<string>} input-change - Fired when the on/off state changes. `detail` is the
|
|
10
|
+
* input's `value`. Bubbles.
|
|
11
|
+
*
|
|
12
|
+
* @cssstate checked - Set on the host while the switch is on. Style with
|
|
13
|
+
* `el-switch-field:state(checked) { … }`. Inherits `touched`, `valid` and `invalid` from
|
|
14
|
+
* `FormField`.
|
|
15
|
+
*
|
|
16
|
+
* @property {boolean} checked - Whether the switch is on. Reflected to the `checked` attribute.
|
|
17
|
+
*/
|
|
18
|
+
export default class SwitchField extends FormField {
|
|
19
|
+
/** @private */
|
|
20
|
+
private uuid;
|
|
21
|
+
properties(): {
|
|
22
|
+
checked: boolean;
|
|
23
|
+
name: string;
|
|
24
|
+
value: any;
|
|
25
|
+
required: boolean;
|
|
26
|
+
disabled: boolean;
|
|
27
|
+
label: string;
|
|
28
|
+
labelScreenReaderOnly: boolean;
|
|
29
|
+
errorMessage: string;
|
|
30
|
+
helpMessage: string;
|
|
31
|
+
valid: boolean;
|
|
32
|
+
touched: boolean;
|
|
33
|
+
};
|
|
34
|
+
watch(): {
|
|
35
|
+
checked: (checked: any) => void;
|
|
36
|
+
value: (value: any) => void;
|
|
37
|
+
valid: () => void;
|
|
38
|
+
touched: () => void;
|
|
39
|
+
};
|
|
40
|
+
events(): {
|
|
41
|
+
input: {
|
|
42
|
+
change: () => void;
|
|
43
|
+
};
|
|
44
|
+
'[ref=input]': {
|
|
45
|
+
focus: () => void;
|
|
46
|
+
blur: () => void;
|
|
47
|
+
keyup: (event: any) => void;
|
|
48
|
+
change: () => void;
|
|
49
|
+
};
|
|
50
|
+
'.is-invalid': {
|
|
51
|
+
focus: () => void;
|
|
52
|
+
};
|
|
53
|
+
'[data-clear-input]': {
|
|
54
|
+
click: () => void;
|
|
55
|
+
touchstart: () => void;
|
|
56
|
+
};
|
|
57
|
+
};
|
|
58
|
+
checked: any;
|
|
59
|
+
/**
|
|
60
|
+
* The switch renders its label inline next to the track (see `fieldTemplate`), so the base
|
|
61
|
+
* FormField label is suppressed.
|
|
62
|
+
* @returns {null}
|
|
63
|
+
*/
|
|
64
|
+
labelTemplate(): null;
|
|
65
|
+
fieldTemplate(): any;
|
|
66
|
+
}
|
|
67
|
+
import FormField from '../form-field/form-field.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|