@redvars/peacock 3.10.0 → 3.11.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/dist/BaseInput-CV0pZgSb.js +58 -0
- package/dist/BaseInput-CV0pZgSb.js.map +1 -0
- package/dist/app-bar.js +16 -16
- package/dist/assets/styles.css +1 -1
- package/dist/assets/styles.css.map +1 -1
- package/dist/assets/theme.d.ts +66 -0
- package/dist/assets/theme.js +134 -0
- package/dist/assets/tokens.css +1 -1
- package/dist/assets/tokens.css.map +1 -1
- package/dist/base-progress-CLZTRveO.js +33 -0
- package/dist/base-progress-CLZTRveO.js.map +1 -0
- package/dist/bottom-sheet.js +1 -1
- package/dist/button-group.js +9 -7
- package/dist/button-group.js.map +1 -1
- package/dist/button.js +225 -187
- package/dist/button.js.map +1 -1
- package/dist/{chart-bar-CapLbc2e.js → chart-bar-D5dGFJfK.js} +2 -2
- package/dist/{chart-bar-CapLbc2e.js.map → chart-bar-D5dGFJfK.js.map} +1 -1
- package/dist/chart-bar.js +1 -1
- package/dist/chart-stacked-bar.js +1 -1
- package/dist/checkbox.js +78 -53
- package/dist/checkbox.js.map +1 -1
- package/dist/chip-set.js +52 -0
- package/dist/chip-set.js.map +1 -0
- package/dist/chip.js +8 -6
- package/dist/chip.js.map +1 -1
- package/dist/circular-progress.js +177 -0
- package/dist/circular-progress.js.map +1 -0
- package/dist/code-editor.js +129 -72
- package/dist/code-editor.js.map +1 -1
- package/dist/code-highlighter.js +2 -38
- package/dist/code-highlighter.js.map +1 -1
- package/dist/color-field.js +309 -0
- package/dist/color-field.js.map +1 -0
- package/dist/color-picker.js +26 -15
- package/dist/color-picker.js.map +1 -1
- package/dist/copy-to-clipboard-upGx-Ueo.js +39 -0
- package/dist/copy-to-clipboard-upGx-Ueo.js.map +1 -0
- package/dist/custom-elements-jsdocs.json +1044 -382
- package/dist/custom-elements.json +8620 -4714
- package/dist/date-picker.js +241 -0
- package/dist/date-picker.js.map +1 -0
- package/dist/{element-internals-2CMts_0M.js → delegate-py-Ets8N.js} +2 -43
- package/dist/delegate-py-Ets8N.js.map +1 -0
- package/dist/element-internals-QME0yEz4.js +43 -0
- package/dist/element-internals-QME0yEz4.js.map +1 -0
- package/dist/fab.js +51 -49
- package/dist/fab.js.map +1 -1
- package/dist/field.js +34 -4
- package/dist/field.js.map +1 -1
- package/dist/flow.js +5 -5
- package/dist/form-associated-Bhwwr6dT.js +162 -0
- package/dist/form-associated-Bhwwr6dT.js.map +1 -0
- package/dist/{form-associated-BXADnjOB.js → form-submitter-DPI4L6gj.js} +3 -159
- package/dist/form-submitter-DPI4L6gj.js.map +1 -0
- package/dist/html-editor.js +3 -1
- package/dist/html-editor.js.map +1 -1
- package/dist/icon-button.js +195 -156
- package/dist/icon-button.js.map +1 -1
- package/dist/image.js +2 -2
- package/dist/index.js +32 -8
- package/dist/index.js.map +1 -1
- package/dist/input.js +259 -0
- package/dist/input.js.map +1 -0
- package/dist/item.js +2 -1
- package/dist/item.js.map +1 -1
- package/dist/linear-progress.js +192 -0
- package/dist/linear-progress.js.map +1 -0
- package/dist/{list-AdO-PUq_.js → list-item.js} +12 -222
- package/dist/list-item.js.map +1 -0
- package/dist/list.js +225 -6
- package/dist/list.js.map +1 -1
- package/dist/loader-full.js +31 -8
- package/dist/loader-full.js.map +1 -1
- package/dist/loader.js +52 -12
- package/dist/loader.js.map +1 -1
- package/dist/markdown-editor.js +5 -3
- package/dist/markdown-editor.js.map +1 -1
- package/dist/menu-item.js +30 -30
- package/dist/menu.js +1 -1
- package/dist/navigation-bar-item.js +41 -0
- package/dist/navigation-bar-item.js.map +1 -0
- package/dist/navigation-bar.js +128 -0
- package/dist/navigation-bar.js.map +1 -0
- package/dist/navigation-drawer-item.js +236 -0
- package/dist/navigation-drawer-item.js.map +1 -0
- package/dist/navigation-drawer.js +293 -0
- package/dist/navigation-drawer.js.map +1 -0
- package/dist/navigation-rail.js +1 -1
- package/dist/number-field.js +280 -0
- package/dist/number-field.js.map +1 -0
- package/dist/option.js +17 -0
- package/dist/option.js.map +1 -1
- package/dist/pagination.js +1 -1
- package/dist/radio-group.js +209 -0
- package/dist/radio-group.js.map +1 -0
- package/dist/radio.js +47 -37
- package/dist/radio.js.map +1 -1
- package/dist/segmented-button-group.js +12 -0
- package/dist/segmented-button-group.js.map +1 -1
- package/dist/segmented-button.js +10 -6
- package/dist/segmented-button.js.map +1 -1
- package/dist/select.js +653 -0
- package/dist/select.js.map +1 -0
- package/dist/side-sheet.js +1 -1
- package/dist/sidebar-menu-item.js +273 -0
- package/dist/sidebar-menu-item.js.map +1 -0
- package/dist/sidebar-menu.js +193 -0
- package/dist/sidebar-menu.js.map +1 -0
- package/dist/sidebar-sub-menu.js +301 -0
- package/dist/sidebar-sub-menu.js.map +1 -0
- package/dist/slider.js +76 -24
- package/dist/slider.js.map +1 -1
- package/dist/snackbar.js +3 -3
- package/dist/snackbar.js.map +1 -1
- package/dist/split-button.js +2 -2
- package/dist/src/__internal/utils/size.d.ts +9 -0
- package/dist/src/button/ButtonTypes.d.ts +1 -1
- package/dist/src/checkbox/checkbox.d.ts +28 -22
- package/dist/src/chip/chip/chip.d.ts +3 -0
- package/dist/src/chip/tag/tag.d.ts +5 -1
- package/dist/src/code-editor/code-editor.d.ts +37 -10
- package/dist/src/color-field/color-field.d.ts +55 -0
- package/dist/src/color-field/index.d.ts +1 -0
- package/dist/src/color-picker/color-picker.d.ts +1 -1
- package/dist/src/date-picker/date-picker.d.ts +0 -1
- package/dist/src/field/field.d.ts +2 -0
- package/dist/src/index.d.ts +4 -3
- package/dist/src/input/BaseInput.d.ts +21 -3
- package/dist/src/input/input.d.ts +15 -7
- package/dist/src/navigation-bar/index.d.ts +2 -0
- package/dist/src/navigation-bar/navigation-bar-item.d.ts +23 -0
- package/dist/src/navigation-bar/navigation-bar.d.ts +44 -0
- package/dist/src/navigation-drawer/index.d.ts +2 -0
- package/dist/src/navigation-drawer/navigation-drawer-item.d.ts +48 -0
- package/dist/src/navigation-drawer/navigation-drawer.d.ts +70 -0
- package/dist/src/number-field/number-field.d.ts +0 -1
- package/dist/src/radio/index.d.ts +1 -0
- package/dist/src/radio/radio-group.d.ts +50 -0
- package/dist/src/radio/radio.d.ts +18 -18
- package/dist/src/segmented-button/segmented-button-group.d.ts +5 -0
- package/dist/src/segmented-button/segmented-button.d.ts +2 -1
- package/dist/src/select/select.d.ts +7 -0
- package/dist/src/slider/slider.d.ts +14 -5
- package/dist/src/switch/switch.d.ts +22 -26
- package/dist/src/tabs/tabs.d.ts +3 -0
- package/dist/src/textarea/textarea.d.ts +0 -1
- package/dist/src/time-picker/time-picker.d.ts +0 -1
- package/dist/src/toolbar/toolbar.d.ts +7 -4
- package/dist/src/url-field/url-field.d.ts +0 -1
- package/dist/svg.js +5 -5
- package/dist/switch.js +413 -0
- package/dist/switch.js.map +1 -0
- package/dist/tab.js +2 -1
- package/dist/tab.js.map +1 -1
- package/dist/tabs.js +10 -8
- package/dist/tabs.js.map +1 -1
- package/dist/tag.js +349 -0
- package/dist/tag.js.map +1 -0
- package/dist/test/code-editor.test.d.ts +1 -0
- package/dist/test/color-field.test.d.ts +1 -0
- package/dist/test/color-picker.test.d.ts +1 -0
- package/dist/test/field.test.d.ts +1 -0
- package/dist/test/form-controls.test.d.ts +1 -0
- package/dist/test/icon.test.d.ts +1 -1
- package/dist/test/input.test.d.ts +1 -0
- package/dist/test/navigation.test.d.ts +1 -0
- package/dist/test/segmented-button.test.d.ts +1 -0
- package/dist/test/select.test.d.ts +1 -0
- package/dist/test/slider.test.d.ts +1 -0
- package/dist/textarea.js +237 -0
- package/dist/textarea.js.map +1 -0
- package/dist/time-picker.js +241 -0
- package/dist/time-picker.js.map +1 -0
- package/dist/toolbar.js +26 -9
- package/dist/toolbar.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/url-field.js +298 -0
- package/dist/url-field.js.map +1 -0
- package/package.json +29 -8
- package/readme.md +2 -2
- package/scss/tokens.css +175 -18
- package/src/__internal/utils/size.ts +23 -0
- package/src/app-bar/app-bar.scss +4 -16
- package/src/bottom-sheet/bottom-sheet.scss +1 -1
- package/src/button/ButtonTypes.ts +2 -0
- package/src/button/button/button-base.scss +84 -84
- package/src/button/button/button-colors.scss +14 -2
- package/src/button/button/button-layers.scss +71 -71
- package/src/button/button/button-shapes.scss +2 -2
- package/src/button/button/button-sizes.scss +35 -35
- package/src/button/button/button.scss +1 -1
- package/src/button/button/button.ts +1 -2
- package/src/button/button-group/button-group.scss +5 -5
- package/src/button/fab/fab-sizes.scss +15 -15
- package/src/button/fab/fab.scss +32 -32
- package/src/button/icon-button/icon-button-sizes.scss +7 -7
- package/src/chart-bar/chart-bar.scss +1 -1
- package/src/checkbox/checkbox.scss +7 -6
- package/src/checkbox/checkbox.ts +92 -40
- package/src/chip/chip/chip.ts +8 -5
- package/src/chip/chip-set/chip-set.ts +2 -0
- package/src/chip/tag/tag-colors.scss +1 -1
- package/src/chip/tag/tag-sizes.scss +9 -0
- package/src/chip/tag/tag.scss +1 -1
- package/src/chip/tag/tag.ts +20 -9
- package/src/code-editor/code-editor.scss +8 -3
- package/src/code-editor/code-editor.ts +148 -79
- package/src/code-highlighter/code-highlighter.scss +1 -1
- package/src/color-field/color-field.scss +48 -0
- package/src/color-field/color-field.ts +239 -0
- package/src/color-field/index.ts +1 -0
- package/src/color-picker/color-picker.scss +33 -15
- package/src/color-picker/color-picker.ts +2 -1
- package/src/date-picker/date-picker.ts +2 -3
- package/src/field/field.scss +31 -0
- package/src/field/field.ts +5 -1
- package/src/flow/flow.scss +5 -5
- package/src/image/image.scss +2 -2
- package/src/index.ts +7 -3
- package/src/input/BaseInput.ts +54 -4
- package/src/input/input.ts +104 -79
- package/src/list/list-item.ts +2 -0
- package/src/loader.ts +28 -6
- package/src/markdown-editor/markdown-editor.scss +2 -2
- package/src/menu/menu/menu.scss +1 -1
- package/src/menu/menu-item/menu-item.scss +30 -30
- package/src/navigation-bar/index.ts +2 -0
- package/src/navigation-bar/navigation-bar-item.ts +25 -0
- package/src/navigation-bar/navigation-bar.scss +27 -0
- package/src/navigation-bar/navigation-bar.ts +96 -0
- package/src/navigation-drawer/index.ts +2 -0
- package/src/navigation-drawer/navigation-drawer-item.scss +82 -0
- package/src/navigation-drawer/navigation-drawer-item.ts +133 -0
- package/src/navigation-drawer/navigation-drawer.scss +99 -0
- package/src/navigation-drawer/navigation-drawer.ts +196 -0
- package/src/navigation-rail/navigation-rail.scss +1 -1
- package/src/number-field/number-field.ts +2 -3
- package/src/pagination/pagination.scss +1 -1
- package/src/progress/circular-progress/circular-progress.ts +2 -0
- package/src/progress/linear-progress/linear-progress.ts +2 -0
- package/src/radio/index.ts +1 -0
- package/src/radio/radio-group.scss +39 -0
- package/src/radio/radio-group.ts +167 -0
- package/src/radio/radio.ts +74 -31
- package/src/segmented-button/segmented-button-group.ts +12 -0
- package/src/segmented-button/segmented-button.ts +12 -6
- package/src/select/option.ts +17 -0
- package/src/select/select.ts +33 -8
- package/src/side-sheet/side-sheet.scss +1 -1
- package/src/sidebar-menu/sidebar-menu-item.scss +1 -1
- package/src/sidebar-menu/sidebar-menu-item.ts +2 -0
- package/src/sidebar-menu/sidebar-menu.ts +2 -0
- package/src/sidebar-menu/sidebar-sub-menu.scss +1 -1
- package/src/sidebar-menu/sidebar-sub-menu.ts +2 -0
- package/src/slider/slider.scss +3 -3
- package/src/slider/slider.ts +119 -31
- package/src/snackbar/snackbar.ts +3 -3
- package/src/split-button/split-button-colors.scss +2 -2
- package/src/svg/svg.scss +5 -5
- package/src/switch/switch.scss +0 -1
- package/src/switch/switch.ts +82 -47
- package/src/tabs/tab.scss +2 -1
- package/src/tabs/tabs.ts +14 -8
- package/src/textarea/textarea.ts +2 -3
- package/src/time-picker/time-picker.ts +2 -3
- package/src/toolbar/toolbar.scss +4 -4
- package/src/toolbar/toolbar.ts +12 -5
- package/src/url-field/url-field.ts +2 -3
- package/dist/BaseInput-CU1zZYKc.js +0 -27
- package/dist/BaseInput-CU1zZYKc.js.map +0 -1
- package/dist/brand-loader.js +0 -358
- package/dist/brand-loader.js.map +0 -1
- package/dist/element-internals-2CMts_0M.js.map +0 -1
- package/dist/form-associated-BXADnjOB.js.map +0 -1
- package/dist/list-AdO-PUq_.js.map +0 -1
- package/dist/select-CnnPbvpQ.js +0 -3955
- package/dist/select-CnnPbvpQ.js.map +0 -1
- package/dist/src/brand-loader/brand-loader.d.ts +0 -33
- package/dist/src/brand-loader/index.d.ts +0 -2
- package/src/brand-loader/brand-loader.scss +0 -270
- package/src/brand-loader/brand-loader.ts +0 -115
- package/src/brand-loader/index.ts +0 -2
- /package/dist/test/{brand-loader.test.d.ts → button.test.d.ts} +0 -0
package/src/slider/slider.ts
CHANGED
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
import { LitElement, html } from 'lit';
|
|
2
2
|
import { property, state, query } from 'lit/decorators.js';
|
|
3
3
|
import { styleMap } from 'lit/directives/style-map.js';
|
|
4
|
+
import { mixinElementInternals } from '@/__internal/mixins/element-internals.js';
|
|
5
|
+
import {
|
|
6
|
+
type FormRestoreState,
|
|
7
|
+
type FormValue,
|
|
8
|
+
getFormValue,
|
|
9
|
+
mixinFormAssociated,
|
|
10
|
+
} from '@/__internal/mixins/form-associated.js';
|
|
4
11
|
import sliderStyles from './slider.scss';
|
|
5
12
|
import IndividualComponent from '@/IndividualComponent.js';
|
|
6
13
|
|
|
@@ -10,6 +17,9 @@ import IndividualComponent from '@/IndividualComponent.js';
|
|
|
10
17
|
* @rawTag slider
|
|
11
18
|
*
|
|
12
19
|
* @summary Sliders allow users to make selections from a range of values.
|
|
20
|
+
* @overview
|
|
21
|
+
* <p>The slider is form-associated: its <code>value</code> is submitted under its <code>name</code>,
|
|
22
|
+
* and <code>form.reset()</code> restores the starting value.</p>
|
|
13
23
|
*
|
|
14
24
|
* @fires {CustomEvent} input - Dispatched when the slider value changes during interaction.
|
|
15
25
|
* @fires {CustomEvent} change - Dispatched when the slider interaction ends.
|
|
@@ -18,11 +28,19 @@ import IndividualComponent from '@/IndividualComponent.js';
|
|
|
18
28
|
* ```html
|
|
19
29
|
* <wc-slider min="0" max="100" value="50"></wc-slider>
|
|
20
30
|
* ```
|
|
31
|
+
* @tags input, form
|
|
21
32
|
*/
|
|
22
33
|
@IndividualComponent
|
|
23
|
-
export class Slider extends
|
|
34
|
+
export class Slider extends mixinFormAssociated(
|
|
35
|
+
mixinElementInternals(LitElement),
|
|
36
|
+
) {
|
|
37
|
+
// ── Static ───────────────────────────────────────────────────────────────
|
|
38
|
+
|
|
24
39
|
static styles = [sliderStyles];
|
|
25
40
|
|
|
41
|
+
// ── Properties ───────────────────────────────────────────────────────────
|
|
42
|
+
// `name` and `disabled` come from mixinFormAssociated.
|
|
43
|
+
|
|
26
44
|
/**
|
|
27
45
|
* The minimum value of the slider.
|
|
28
46
|
*/
|
|
@@ -43,11 +61,6 @@ export class Slider extends LitElement {
|
|
|
43
61
|
*/
|
|
44
62
|
@property({ type: Number }) step = 1;
|
|
45
63
|
|
|
46
|
-
/**
|
|
47
|
-
* Whether the slider is disabled.
|
|
48
|
-
*/
|
|
49
|
-
@property({ type: Boolean, reflect: true }) disabled = false;
|
|
50
|
-
|
|
51
64
|
/**
|
|
52
65
|
* Whether to show labels on the slider.
|
|
53
66
|
*/
|
|
@@ -58,46 +71,90 @@ export class Slider extends LitElement {
|
|
|
58
71
|
*/
|
|
59
72
|
@property({ type: Boolean, attribute: 'show-value' }) showValue = false;
|
|
60
73
|
|
|
74
|
+
// ── State ────────────────────────────────────────────────────────────────
|
|
75
|
+
|
|
61
76
|
/** True while the user is actively dragging the thumb. */
|
|
62
77
|
@state() private isDragging = false;
|
|
63
78
|
|
|
79
|
+
// ── Queries ──────────────────────────────────────────────────────────────
|
|
80
|
+
|
|
64
81
|
@query('.slider-container') private container!: HTMLElement;
|
|
65
82
|
|
|
66
83
|
@query('.thumb') private thumbElement!: HTMLElement;
|
|
67
84
|
|
|
85
|
+
// ── Private fields ───────────────────────────────────────────────────────
|
|
86
|
+
|
|
87
|
+
/** `value` when first connected; `form.reset()` returns to it. */
|
|
88
|
+
private defaultValue?: number;
|
|
89
|
+
|
|
90
|
+
// ── Lifecycle ────────────────────────────────────────────────────────────
|
|
91
|
+
|
|
92
|
+
override connectedCallback() {
|
|
93
|
+
super.connectedCallback();
|
|
94
|
+
this.defaultValue ??= this.value;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
// ── Form association ─────────────────────────────────────────────────────
|
|
98
|
+
|
|
99
|
+
override [getFormValue](): FormValue | null {
|
|
100
|
+
return String(this.value);
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
formResetCallback() {
|
|
104
|
+
this.value = this.defaultValue ?? this.value;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
formStateRestoreCallback(state: FormRestoreState | null) {
|
|
108
|
+
const restored = Number(state);
|
|
109
|
+
if (typeof state === 'string' && !Number.isNaN(restored)) {
|
|
110
|
+
this.value = restored;
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
// ── Private methods ──────────────────────────────────────────────────────
|
|
115
|
+
|
|
68
116
|
private handleInput(event: MouseEvent | TouchEvent) {
|
|
69
117
|
if (this.disabled) return;
|
|
70
|
-
|
|
118
|
+
|
|
71
119
|
const rect = this.container.getBoundingClientRect();
|
|
72
|
-
const clientX =
|
|
73
|
-
|
|
120
|
+
const clientX =
|
|
121
|
+
'touches' in event
|
|
122
|
+
? event.touches[0].clientX
|
|
123
|
+
: (event as MouseEvent).clientX;
|
|
124
|
+
|
|
74
125
|
// Calculate percentage relative to track width
|
|
75
126
|
let percentage = (clientX - rect.left) / rect.width;
|
|
76
127
|
percentage = Math.max(0, Math.min(1, percentage));
|
|
77
|
-
|
|
128
|
+
|
|
78
129
|
const rawValue = this.min + percentage * (this.max - this.min);
|
|
79
130
|
const steppedValue = Math.round(rawValue / this.step) * this.step;
|
|
80
|
-
|
|
131
|
+
|
|
81
132
|
const oldValue = this.value;
|
|
82
133
|
this.value = Math.max(this.min, Math.min(this.max, steppedValue));
|
|
83
134
|
|
|
84
135
|
if (oldValue !== this.value) {
|
|
85
|
-
this.dispatchEvent(
|
|
136
|
+
this.dispatchEvent(
|
|
137
|
+
new CustomEvent('input', {
|
|
138
|
+
detail: { value: this.value },
|
|
139
|
+
bubbles: true,
|
|
140
|
+
composed: true,
|
|
141
|
+
}),
|
|
142
|
+
);
|
|
86
143
|
}
|
|
87
144
|
}
|
|
88
145
|
|
|
89
146
|
private onMouseDown(e: MouseEvent | TouchEvent) {
|
|
90
147
|
if (this.disabled) return;
|
|
91
|
-
|
|
148
|
+
|
|
92
149
|
e.preventDefault();
|
|
93
150
|
this.isDragging = true;
|
|
94
|
-
|
|
151
|
+
|
|
95
152
|
// Add dragging class for CSS state
|
|
96
153
|
this.container.classList.add('dragging');
|
|
97
154
|
this.thumbElement.classList.add('dragging');
|
|
98
|
-
|
|
155
|
+
|
|
99
156
|
this.handleInput(e);
|
|
100
|
-
|
|
157
|
+
|
|
101
158
|
window.addEventListener('mousemove', this.onMouseMove);
|
|
102
159
|
window.addEventListener('mouseup', this.onMouseUp);
|
|
103
160
|
window.addEventListener('touchmove', this.onMouseMove, { passive: false });
|
|
@@ -114,13 +171,19 @@ export class Slider extends LitElement {
|
|
|
114
171
|
|
|
115
172
|
private onMouseUp = () => {
|
|
116
173
|
if (!this.isDragging) return;
|
|
117
|
-
|
|
174
|
+
|
|
118
175
|
this.isDragging = false;
|
|
119
176
|
this.container.classList.remove('dragging');
|
|
120
177
|
this.thumbElement.classList.remove('dragging');
|
|
121
|
-
|
|
122
|
-
this.dispatchEvent(
|
|
123
|
-
|
|
178
|
+
|
|
179
|
+
this.dispatchEvent(
|
|
180
|
+
new CustomEvent('change', {
|
|
181
|
+
detail: { value: this.value },
|
|
182
|
+
bubbles: true,
|
|
183
|
+
composed: true,
|
|
184
|
+
}),
|
|
185
|
+
);
|
|
186
|
+
|
|
124
187
|
window.removeEventListener('mousemove', this.onMouseMove);
|
|
125
188
|
window.removeEventListener('mouseup', this.onMouseUp);
|
|
126
189
|
window.removeEventListener('touchmove', this.onMouseMove);
|
|
@@ -130,7 +193,7 @@ export class Slider extends LitElement {
|
|
|
130
193
|
|
|
131
194
|
private handleKeyDown(e: KeyboardEvent) {
|
|
132
195
|
if (this.disabled) return;
|
|
133
|
-
|
|
196
|
+
|
|
134
197
|
const increment = e.shiftKey ? this.step * 10 : this.step;
|
|
135
198
|
let newValue = this.value;
|
|
136
199
|
|
|
@@ -150,27 +213,44 @@ export class Slider extends LitElement {
|
|
|
150
213
|
|
|
151
214
|
if (newValue !== this.value) {
|
|
152
215
|
this.value = newValue;
|
|
153
|
-
this.dispatchEvent(
|
|
154
|
-
|
|
216
|
+
this.dispatchEvent(
|
|
217
|
+
new CustomEvent('input', {
|
|
218
|
+
detail: { value: this.value },
|
|
219
|
+
bubbles: true,
|
|
220
|
+
composed: true,
|
|
221
|
+
}),
|
|
222
|
+
);
|
|
223
|
+
this.dispatchEvent(
|
|
224
|
+
new CustomEvent('change', {
|
|
225
|
+
detail: { value: this.value },
|
|
226
|
+
bubbles: true,
|
|
227
|
+
composed: true,
|
|
228
|
+
}),
|
|
229
|
+
);
|
|
155
230
|
}
|
|
156
231
|
}
|
|
157
232
|
|
|
233
|
+
// ── Render ───────────────────────────────────────────────────────────────
|
|
234
|
+
|
|
158
235
|
render() {
|
|
159
236
|
const percentage = ((this.value - this.min) / (this.max - this.min)) * 100;
|
|
160
237
|
|
|
161
238
|
return html`
|
|
162
239
|
<div class="slider ${this.showValue ? 'with-value' : ''}">
|
|
163
|
-
<div
|
|
240
|
+
<div
|
|
164
241
|
class="slider-container ${this.disabled ? 'disabled' : ''}"
|
|
165
242
|
@mousedown=${this.onMouseDown}
|
|
166
243
|
@touchstart=${this.onMouseDown}
|
|
167
244
|
>
|
|
168
245
|
<div class="track">
|
|
169
|
-
<div
|
|
246
|
+
<div
|
|
247
|
+
class="track-active"
|
|
248
|
+
style=${styleMap({ width: `${percentage}%` })}
|
|
249
|
+
></div>
|
|
170
250
|
</div>
|
|
171
251
|
|
|
172
|
-
<div
|
|
173
|
-
class="thumb"
|
|
252
|
+
<div
|
|
253
|
+
class="thumb"
|
|
174
254
|
role="slider"
|
|
175
255
|
aria-label="Slider"
|
|
176
256
|
tabindex="${this.disabled ? -1 : 0}"
|
|
@@ -178,15 +258,23 @@ export class Slider extends LitElement {
|
|
|
178
258
|
aria-valuemax=${this.max}
|
|
179
259
|
aria-valuenow=${this.value}
|
|
180
260
|
aria-disabled=${this.disabled}
|
|
181
|
-
style=${styleMap({
|
|
261
|
+
style=${styleMap({
|
|
262
|
+
left: `calc(${percentage}% - var(--thumb-half))`,
|
|
263
|
+
})}
|
|
182
264
|
@keydown=${this.handleKeyDown}
|
|
183
265
|
>
|
|
184
|
-
${this.labeled
|
|
266
|
+
${this.labeled
|
|
267
|
+
? html`<div class="value-label">${this.value}</div>`
|
|
268
|
+
: ''}
|
|
185
269
|
</div>
|
|
186
270
|
</div>
|
|
187
271
|
|
|
188
|
-
${this.showValue
|
|
272
|
+
${this.showValue
|
|
273
|
+
? html`<output class="value-display" aria-live="polite"
|
|
274
|
+
>${this.value}</output
|
|
275
|
+
>`
|
|
276
|
+
: ''}
|
|
189
277
|
</div>
|
|
190
278
|
`;
|
|
191
279
|
}
|
|
192
|
-
}
|
|
280
|
+
}
|
package/src/snackbar/snackbar.ts
CHANGED
|
@@ -224,7 +224,7 @@ export class Snackbar extends LitElement {
|
|
|
224
224
|
</div>
|
|
225
225
|
|
|
226
226
|
${this.actionLabel
|
|
227
|
-
? html`<wc-button class="action" variant='text' size='
|
|
227
|
+
? html`<wc-button class="action" variant='text' size='sm' @click=${this.handleActionClick}>
|
|
228
228
|
${this.actionLabel}
|
|
229
229
|
</wc-button>`
|
|
230
230
|
: nothing}
|
|
@@ -232,8 +232,8 @@ export class Snackbar extends LitElement {
|
|
|
232
232
|
${this.showCloseIcon
|
|
233
233
|
? html`<wc-icon-button
|
|
234
234
|
class="close"
|
|
235
|
-
variant='text'
|
|
236
|
-
size='
|
|
235
|
+
variant='text'
|
|
236
|
+
size='sm'
|
|
237
237
|
aria-label="Dismiss notification"
|
|
238
238
|
@click=${this.handleCloseClick}
|
|
239
239
|
>
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
--filled-split-button-container-color: var(--color-on-surface);
|
|
38
38
|
--filled-split-button-label-text-color: var(--color-surface);
|
|
39
39
|
|
|
40
|
-
--tonal-split-button-container-color: var(--color-on-surface-
|
|
40
|
+
--tonal-split-button-container-color: var(--color-on-surface-variant);
|
|
41
41
|
--tonal-split-button-label-text-color: var(--color-surface-container-high);
|
|
42
42
|
|
|
43
43
|
--outlined-split-button-outline-color: var(--color-on-surface);
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
--filled-split-button-label-text-color: var(--color-on-surface);
|
|
50
50
|
|
|
51
51
|
--tonal-split-button-container-color: var(--color-surface-container-high);
|
|
52
|
-
--tonal-split-button-label-text-color: var(--color-on-surface
|
|
52
|
+
--tonal-split-button-label-text-color: var(--color-on-surface);
|
|
53
53
|
|
|
54
54
|
--outlined-split-button-outline-color: var(--color-on-surface);
|
|
55
55
|
--outlined-split-button-label-text-color: var(--color-on-surface);
|
package/src/svg/svg.scss
CHANGED
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
position: fixed;
|
|
47
47
|
inset: 0;
|
|
48
48
|
z-index: 9999;
|
|
49
|
-
background:
|
|
49
|
+
background: color-mix(in srgb, var(--color-scrim) 85%, transparent);
|
|
50
50
|
align-items: center;
|
|
51
51
|
justify-content: center;
|
|
52
52
|
cursor: zoom-out;
|
|
@@ -62,14 +62,14 @@
|
|
|
62
62
|
right: 1rem;
|
|
63
63
|
background: transparent;
|
|
64
64
|
border: none;
|
|
65
|
-
color:
|
|
65
|
+
color: var(--color-white);
|
|
66
66
|
font-size: 1.5rem;
|
|
67
67
|
cursor: pointer;
|
|
68
68
|
line-height: 1;
|
|
69
69
|
padding: 0.25rem 0.5rem;
|
|
70
70
|
|
|
71
71
|
&:focus-visible {
|
|
72
|
-
outline: 2px solid
|
|
72
|
+
outline: 2px solid var(--color-white);
|
|
73
73
|
outline-offset: 2px;
|
|
74
74
|
}
|
|
75
75
|
}
|
|
@@ -85,7 +85,7 @@
|
|
|
85
85
|
svg {
|
|
86
86
|
max-width: 90vw;
|
|
87
87
|
max-height: 90vh;
|
|
88
|
-
box-shadow: 0 8px 40px
|
|
89
|
-
border-radius:
|
|
88
|
+
box-shadow: 0 8px 40px color-mix(in srgb, var(--color-shadow) 60%, transparent);
|
|
89
|
+
border-radius: var(--shape-corner-extra-small);
|
|
90
90
|
}
|
|
91
91
|
}
|
package/src/switch/switch.scss
CHANGED
|
@@ -52,7 +52,6 @@
|
|
|
52
52
|
justify-content: center;
|
|
53
53
|
border-radius: var(--shape-corner-full);
|
|
54
54
|
transition: all var(--duration-short2) var(--easing-standard);
|
|
55
|
-
background: white;
|
|
56
55
|
height: var(--switch-handle-radius);
|
|
57
56
|
width: var(--switch-handle-radius);
|
|
58
57
|
background: var(--switch-handle-color);
|
package/src/switch/switch.ts
CHANGED
|
@@ -3,6 +3,13 @@ import { property, query, state } from 'lit/decorators.js';
|
|
|
3
3
|
import { classMap } from 'lit/directives/class-map.js';
|
|
4
4
|
|
|
5
5
|
import { spread } from '@/__internal/directive/spread.js';
|
|
6
|
+
import {
|
|
7
|
+
type FormRestoreState,
|
|
8
|
+
type FormValue,
|
|
9
|
+
getFormState,
|
|
10
|
+
getFormValue,
|
|
11
|
+
} from '@/__internal/mixins/form-associated.js';
|
|
12
|
+
import IndividualComponent from '@/IndividualComponent.js';
|
|
6
13
|
|
|
7
14
|
import styles from './switch.scss';
|
|
8
15
|
import BaseInput from '../input/BaseInput.js';
|
|
@@ -15,6 +22,7 @@ import BaseInput from '../input/BaseInput.js';
|
|
|
15
22
|
* @summary Captures boolean input with an on/off switch interaction.
|
|
16
23
|
* @overview
|
|
17
24
|
* <p>Toggles are used to enable or disable a single option. They provide immediate feedback about whether an option is active or inactive.</p>
|
|
25
|
+
* <p>The switch is form-associated: when <code>checked</code>, it submits <code>on</code> under its <code>name</code>.</p>
|
|
18
26
|
*
|
|
19
27
|
* @cssprop --switch-track-color: Color of the switch track when checked.
|
|
20
28
|
* @cssprop --switch-track-off-color: Color of the switch track when unchecked.
|
|
@@ -23,27 +31,41 @@ import BaseInput from '../input/BaseInput.js';
|
|
|
23
31
|
* @cssprop --switch-handle-radius: Size of the switch handle.
|
|
24
32
|
* @cssprop --switch-handle-color: Color of the switch handle.
|
|
25
33
|
*
|
|
26
|
-
* @fires {CustomEvent} change - Dispatched when the switch value
|
|
34
|
+
* @fires {CustomEvent} change - Dispatched when the switch is toggled. Detail: `{ checked, value, originalEvent }`.
|
|
27
35
|
* @fires {CustomEvent} blur - Dispatched when the switch loses focus.
|
|
28
36
|
* @fires {CustomEvent} focus - Dispatched when the switch receives focus.
|
|
29
37
|
*
|
|
30
38
|
* @example
|
|
31
39
|
* ```html
|
|
32
|
-
* <wc-switch
|
|
40
|
+
* <wc-switch checked label="Wi-Fi"></wc-switch>
|
|
33
41
|
* ```
|
|
34
42
|
* @tags input, form
|
|
35
43
|
*/
|
|
44
|
+
@IndividualComponent
|
|
36
45
|
export class Switch extends BaseInput {
|
|
46
|
+
// ── Static ───────────────────────────────────────────────────────────────
|
|
47
|
+
|
|
37
48
|
static styles = [styles];
|
|
38
49
|
|
|
39
|
-
|
|
40
|
-
value: boolean = false;
|
|
50
|
+
// ── Properties ───────────────────────────────────────────────────────────
|
|
41
51
|
|
|
42
52
|
/**
|
|
43
|
-
*
|
|
53
|
+
* Whether the switch is on.
|
|
44
54
|
*/
|
|
45
|
-
@property({ type:
|
|
46
|
-
|
|
55
|
+
@property({ type: Boolean, reflect: true })
|
|
56
|
+
checked: boolean = false;
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* @deprecated Use `checked`. Kept as an alias of `checked`.
|
|
60
|
+
*/
|
|
61
|
+
@property({ type: Boolean })
|
|
62
|
+
get value(): boolean {
|
|
63
|
+
return this.checked;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
set value(value: boolean) {
|
|
67
|
+
this.checked = Boolean(value);
|
|
68
|
+
}
|
|
47
69
|
|
|
48
70
|
/**
|
|
49
71
|
* The switch label.
|
|
@@ -57,24 +79,6 @@ export class Switch extends BaseInput {
|
|
|
57
79
|
@property({ type: Boolean })
|
|
58
80
|
rounded: boolean = true;
|
|
59
81
|
|
|
60
|
-
/**
|
|
61
|
-
* If true, required icon is shown. Defaults to `false`.
|
|
62
|
-
*/
|
|
63
|
-
@property({ type: Boolean, reflect: true })
|
|
64
|
-
required: boolean = false;
|
|
65
|
-
|
|
66
|
-
/**
|
|
67
|
-
* If true, the toggle is readonly. Defaults to `false`.
|
|
68
|
-
*/
|
|
69
|
-
@property({ type: Boolean, reflect: true })
|
|
70
|
-
readonly: boolean = false;
|
|
71
|
-
|
|
72
|
-
/**
|
|
73
|
-
* If true, the user cannot interact with the toggle. Defaults to `false`.
|
|
74
|
-
*/
|
|
75
|
-
@property({ type: Boolean, reflect: true })
|
|
76
|
-
disabled: boolean = false;
|
|
77
|
-
|
|
78
82
|
@property({ type: Boolean, reflect: true, attribute: 'with-icon' })
|
|
79
83
|
withIcon: boolean = false;
|
|
80
84
|
|
|
@@ -84,6 +88,8 @@ export class Switch extends BaseInput {
|
|
|
84
88
|
@property({ type: Object })
|
|
85
89
|
configAria: Record<string, string> = {};
|
|
86
90
|
|
|
91
|
+
// ── State ────────────────────────────────────────────────────────────────
|
|
92
|
+
|
|
87
93
|
@state()
|
|
88
94
|
private hasFocus = false;
|
|
89
95
|
|
|
@@ -93,14 +99,17 @@ export class Switch extends BaseInput {
|
|
|
93
99
|
@state()
|
|
94
100
|
private slotHasContent = false;
|
|
95
101
|
|
|
102
|
+
// ── Queries ──────────────────────────────────────────────────────────────
|
|
103
|
+
|
|
96
104
|
@query('.track')
|
|
97
105
|
private trackElement?: HTMLElement;
|
|
98
106
|
|
|
99
|
-
|
|
100
|
-
private nativeElement?: HTMLInputElement;
|
|
107
|
+
// ── Private fields ───────────────────────────────────────────────────────
|
|
101
108
|
|
|
102
109
|
private tabindex?: string;
|
|
103
110
|
|
|
111
|
+
// ── Lifecycle ────────────────────────────────────────────────────────────
|
|
112
|
+
|
|
104
113
|
connectedCallback() {
|
|
105
114
|
super.connectedCallback();
|
|
106
115
|
this.handleInitialAttributes();
|
|
@@ -118,6 +127,38 @@ export class Switch extends BaseInput {
|
|
|
118
127
|
this.slotHasContent = this.hasChildNodes();
|
|
119
128
|
}
|
|
120
129
|
|
|
130
|
+
// ── Public methods ───────────────────────────────────────────────────────
|
|
131
|
+
|
|
132
|
+
/**
|
|
133
|
+
* Sets focus on the toggle.
|
|
134
|
+
*/
|
|
135
|
+
focus() {
|
|
136
|
+
this.trackElement?.focus();
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
/**
|
|
140
|
+
* Removes focus from the toggle.
|
|
141
|
+
*/
|
|
142
|
+
blur() {
|
|
143
|
+
this.trackElement?.blur();
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
// ── Form association ─────────────────────────────────────────────────────
|
|
147
|
+
|
|
148
|
+
override [getFormValue](): FormValue | null {
|
|
149
|
+
return this.checked ? 'on' : null;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
override [getFormState](): FormValue | null {
|
|
153
|
+
return String(this.checked);
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
override formStateRestoreCallback(state: FormRestoreState | null) {
|
|
157
|
+
this.checked = state === 'true';
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
// ── Private methods ──────────────────────────────────────────────────────
|
|
161
|
+
|
|
121
162
|
private handleInitialAttributes() {
|
|
122
163
|
if (this.hasAttribute('tabindex')) {
|
|
123
164
|
this.tabindex = this.getAttribute('tabindex') || undefined;
|
|
@@ -158,10 +199,14 @@ export class Switch extends BaseInput {
|
|
|
158
199
|
|
|
159
200
|
private clickHandler = (ev: MouseEvent | KeyboardEvent) => {
|
|
160
201
|
if (!this.disabled && !this.readonly) {
|
|
161
|
-
this.
|
|
202
|
+
this.checked = !this.checked;
|
|
162
203
|
this.dispatchEvent(
|
|
163
204
|
new CustomEvent('change', {
|
|
164
|
-
detail: {
|
|
205
|
+
detail: {
|
|
206
|
+
checked: this.checked,
|
|
207
|
+
value: this.checked,
|
|
208
|
+
originalEvent: ev,
|
|
209
|
+
},
|
|
165
210
|
bubbles: true,
|
|
166
211
|
composed: true,
|
|
167
212
|
}),
|
|
@@ -198,33 +243,23 @@ export class Switch extends BaseInput {
|
|
|
198
243
|
}
|
|
199
244
|
};
|
|
200
245
|
|
|
201
|
-
|
|
202
|
-
* Sets focus on the toggle.
|
|
203
|
-
*/
|
|
204
|
-
focus() {
|
|
205
|
-
this.trackElement?.focus();
|
|
206
|
-
}
|
|
207
|
-
|
|
208
|
-
/**
|
|
209
|
-
* Removes focus from the toggle.
|
|
210
|
-
*/
|
|
211
|
-
blur() {
|
|
212
|
-
this.trackElement?.blur();
|
|
213
|
-
}
|
|
246
|
+
// ── Render helpers ───────────────────────────────────────────────────────
|
|
214
247
|
|
|
215
248
|
__renderIcon() {
|
|
216
249
|
if (this.withIcon) {
|
|
217
|
-
if (this.
|
|
250
|
+
if (this.checked)
|
|
218
251
|
return html`<wc-icon name="check" class="icon"></wc-icon>`;
|
|
219
252
|
return html`<wc-icon name="close" class="icon"></wc-icon>`;
|
|
220
253
|
}
|
|
221
254
|
return nothing;
|
|
222
255
|
}
|
|
223
256
|
|
|
257
|
+
// ── Render ───────────────────────────────────────────────────────────────
|
|
258
|
+
|
|
224
259
|
render() {
|
|
225
260
|
const cssClasses = {
|
|
226
261
|
switch: true,
|
|
227
|
-
'state-checked': this.
|
|
262
|
+
'state-checked': this.checked,
|
|
228
263
|
'has-focus': this.hasFocus,
|
|
229
264
|
active: this.isActive,
|
|
230
265
|
disabled: this.disabled,
|
|
@@ -244,10 +279,10 @@ export class Switch extends BaseInput {
|
|
|
244
279
|
@keydown=${this.keyDownHandler}
|
|
245
280
|
@blur=${this.blurHandler}
|
|
246
281
|
@focus=${this.focusHandler}
|
|
247
|
-
role="
|
|
282
|
+
role="switch"
|
|
248
283
|
aria-disabled=${this.disabled}
|
|
249
284
|
aria-required=${this.required}
|
|
250
|
-
aria-checked=${this.
|
|
285
|
+
aria-checked=${this.checked}
|
|
251
286
|
${spread(this.configAria)}
|
|
252
287
|
>
|
|
253
288
|
<div class="handle">${this.__renderIcon()}</div>
|
|
@@ -257,7 +292,7 @@ export class Switch extends BaseInput {
|
|
|
257
292
|
type="checkbox"
|
|
258
293
|
class="input-native"
|
|
259
294
|
name=${this.name}
|
|
260
|
-
.checked=${this.
|
|
295
|
+
.checked=${this.checked}
|
|
261
296
|
aria-hidden="true"
|
|
262
297
|
?required=${this.required}
|
|
263
298
|
tabindex="-1"
|
package/src/tabs/tab.scss
CHANGED
|
@@ -150,7 +150,8 @@
|
|
|
150
150
|
--_container-shape-end-start: var(--shape-corner-small);
|
|
151
151
|
--_container-shape-end-end: var(--shape-corner-small);
|
|
152
152
|
--_active-indicator-color: var(--color-primary);
|
|
153
|
-
--_active-indicator-shape:
|
|
153
|
+
--_active-indicator-shape: var(--shape-corner-extra-small)
|
|
154
|
+
var(--shape-corner-extra-small) 0 0;
|
|
154
155
|
--_active-indicator-height: 2px;
|
|
155
156
|
|
|
156
157
|
.focus-ring {
|
package/src/tabs/tabs.ts
CHANGED
|
@@ -13,6 +13,9 @@ import IndividualComponent from '@/IndividualComponent.js';
|
|
|
13
13
|
* @overview
|
|
14
14
|
* <p>Tabs holds the tab buttons and manages their layout.</p>
|
|
15
15
|
*
|
|
16
|
+
* @fires {CustomEvent<{index: number, value: string}>} change - Dispatched when the user activates a tab.
|
|
17
|
+
* @fires {CustomEvent<{index: number, value: string}>} tab-click - Deprecated alias of `change`, fired alongside it.
|
|
18
|
+
*
|
|
16
19
|
* @example
|
|
17
20
|
* ```html
|
|
18
21
|
* <wc-tabs>
|
|
@@ -176,14 +179,17 @@ export class Tabs extends LitElement {
|
|
|
176
179
|
this.__animateIndicatorTransition(previousActiveTab, clickedTab);
|
|
177
180
|
this.__lastActiveTab = clickedTab;
|
|
178
181
|
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
182
|
+
const detail = {
|
|
183
|
+
index: clickedIndex,
|
|
184
|
+
value: (clickedTab as Tab).value,
|
|
185
|
+
};
|
|
186
|
+
this.dispatchEvent(
|
|
187
|
+
new CustomEvent('change', { bubbles: true, composed: true, detail }),
|
|
188
|
+
);
|
|
189
|
+
// Deprecated name, still what wc-tab-group listens for.
|
|
190
|
+
this.dispatchEvent(
|
|
191
|
+
new CustomEvent('tab-click', { bubbles: true, composed: true, detail }),
|
|
192
|
+
);
|
|
187
193
|
};
|
|
188
194
|
|
|
189
195
|
render() {
|
package/src/textarea/textarea.ts
CHANGED
|
@@ -4,6 +4,7 @@ import { property, query, state } from 'lit/decorators.js';
|
|
|
4
4
|
import { redispatchEvent } from '@/__internal/utils/dispatch-event-utils.js';
|
|
5
5
|
import { spread } from '@/__internal/directive/spread.js';
|
|
6
6
|
|
|
7
|
+
import IndividualComponent from '@/IndividualComponent.js';
|
|
7
8
|
import BaseInput from '../input/BaseInput.js';
|
|
8
9
|
import styles from './textarea.scss';
|
|
9
10
|
|
|
@@ -19,15 +20,13 @@ import styles from './textarea.scss';
|
|
|
19
20
|
* <wc-textarea label="Description" placeholder="Enter text"></wc-textarea>
|
|
20
21
|
* ```
|
|
21
22
|
*/
|
|
23
|
+
@IndividualComponent
|
|
22
24
|
export class Textarea extends BaseInput {
|
|
23
25
|
static styles = [styles];
|
|
24
26
|
|
|
25
27
|
@property({ type: String })
|
|
26
28
|
value = '';
|
|
27
29
|
|
|
28
|
-
@property({ type: String })
|
|
29
|
-
name: string = '';
|
|
30
|
-
|
|
31
30
|
@property({ type: String }) placeholder = '';
|
|
32
31
|
|
|
33
32
|
@property({ type: String }) label = '';
|