@redvars/peacock 3.3.1 → 3.3.2
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/{IndividualComponent-tDnXrOLV.js → IndividualComponent-Dt5xirYG.js} +2 -2
- package/dist/{IndividualComponent-tDnXrOLV.js.map → IndividualComponent-Dt5xirYG.js.map} +1 -1
- package/dist/array-D5vjT2Xm.js +14 -0
- package/dist/array-D5vjT2Xm.js.map +1 -0
- package/dist/{button-trIfcqC7.js → button-ClzS8JLq.js} +3 -3
- package/dist/{button-trIfcqC7.js.map → button-ClzS8JLq.js.map} +1 -1
- package/dist/{button-group-DA7xoziD.js → button-group-BMS5WvaF.js} +4 -4
- package/dist/{button-group-DA7xoziD.js.map → button-group-BMS5WvaF.js.map} +1 -1
- package/dist/button-group.js +4 -4
- package/dist/button.js +3 -3
- package/dist/card.js +104 -0
- package/dist/card.js.map +1 -0
- package/dist/chart-bar-DbnXQgvS.js +1121 -0
- package/dist/chart-bar-DbnXQgvS.js.map +1 -0
- package/dist/chart-bar.js +259 -0
- package/dist/chart-bar.js.map +1 -0
- package/dist/chart-donut.js +4 -2
- package/dist/chart-donut.js.map +1 -1
- package/dist/chart-doughnut.js +4 -2
- package/dist/chart-doughnut.js.map +1 -1
- package/dist/chart-pie.js +4 -2
- package/dist/chart-pie.js.map +1 -1
- package/dist/chart-stacked-bar.js +401 -0
- package/dist/chart-stacked-bar.js.map +1 -0
- package/dist/{class-map-hJdvjl-W.js → class-map-59YGWLnx.js} +2 -2
- package/dist/{class-map-hJdvjl-W.js.map → class-map-59YGWLnx.js.map} +1 -1
- package/dist/clock.js +1 -1
- package/dist/code-editor.js +3 -3
- package/dist/code-highlighter.js +3 -3
- package/dist/custom-elements-jsdocs.json +2308 -766
- package/dist/custom-elements.json +909 -25
- package/dist/index.js +16 -9
- package/dist/index.js.map +1 -1
- package/dist/number-counter.js +2 -2
- package/dist/{observe-theme-change-BISF-Gl5.js → observe-theme-change-pALI5fmV.js} +2 -2
- package/dist/{observe-theme-change-BISF-Gl5.js.map → observe-theme-change-pALI5fmV.js.map} +1 -1
- package/dist/peacock-loader.js +22 -526
- package/dist/peacock-loader.js.map +1 -1
- package/dist/pie-Dz0IDiPt.js +537 -0
- package/dist/pie-Dz0IDiPt.js.map +1 -0
- package/dist/{tree-view-CLolVlU0.js → snackbar-74YCdMPL.js} +1005 -143
- package/dist/snackbar-74YCdMPL.js.map +1 -0
- package/dist/src/card/card.d.ts +27 -0
- package/dist/src/card/index.d.ts +1 -0
- package/dist/src/chart-bar/chart-bar.d.ts +53 -0
- package/dist/src/chart-bar/chart-stacked-bar.d.ts +78 -0
- package/dist/src/chart-bar/index.d.ts +2 -0
- package/dist/src/index.d.ts +5 -0
- package/dist/src/menu/menu-item/menu-item.d.ts +1 -1
- package/dist/src/snackbar/index.d.ts +1 -0
- package/dist/src/snackbar/snackbar.d.ts +40 -0
- package/dist/src/tabs/tab-group.d.ts +1 -1
- package/dist/src/tabs/tab-panel.d.ts +1 -0
- package/dist/src/tabs/tab.d.ts +2 -1
- package/dist/{style-map-CfNHEkQp.js → style-map-DcB52w-l.js} +2 -2
- package/dist/{style-map-CfNHEkQp.js.map → style-map-DcB52w-l.js.map} +1 -1
- package/dist/test/card.test.d.ts +1 -0
- package/dist/test/chart-bar.test.d.ts +1 -0
- package/dist/test/snackbar.test.d.ts +1 -0
- package/dist/{transform-DRuHEvar.js → transform-DSwFSqzD.js} +13 -558
- package/dist/transform-DSwFSqzD.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/{unsafe-html-CV6Je6HL.js → unsafe-html-C2r3PyzF.js} +2 -2
- package/dist/{unsafe-html-CV6Je6HL.js.map → unsafe-html-C2r3PyzF.js.map} +1 -1
- package/package.json +1 -1
- package/readme.md +2 -2
- package/src/card/card.scss +61 -0
- package/src/card/card.ts +38 -0
- package/src/card/index.ts +1 -0
- package/src/chart-bar/chart-bar.scss +58 -0
- package/src/chart-bar/chart-bar.ts +306 -0
- package/src/chart-bar/chart-stacked-bar.ts +402 -0
- package/src/chart-bar/index.ts +2 -0
- package/src/index.ts +5 -0
- package/src/menu/menu-item/menu-item.ts +1 -1
- package/src/peacock-loader.ts +14 -0
- package/src/snackbar/demo/index.html +29 -0
- package/src/snackbar/index.ts +1 -0
- package/src/snackbar/snackbar.scss +73 -0
- package/src/snackbar/snackbar.ts +151 -0
- package/src/tabs/tab-group.ts +57 -28
- package/src/tabs/tab-panel.scss +3 -3
- package/src/tabs/tab-panel.ts +2 -0
- package/src/tabs/tab.scss +76 -2
- package/src/tabs/tab.ts +28 -6
- package/src/tabs/tabs.ts +15 -3
- package/dist/transform-DRuHEvar.js.map +0 -1
- package/dist/tree-view-CLolVlU0.js.map +0 -1
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { i, _ as __decorate, n,
|
|
2
|
-
import { r, e as e$3 } from './class-map-
|
|
1
|
+
import { a as i, _ as __decorate, n, i as i$1, b, A, c as __classPrivateFieldGet, w } from './IndividualComponent-Dt5xirYG.js';
|
|
2
|
+
import { r, e as e$3 } from './class-map-59YGWLnx.js';
|
|
3
3
|
import { e as e$1 } from './directive-Cuw6h7YA.js';
|
|
4
|
-
import { e as e$2, o as o$4 } from './unsafe-html-
|
|
4
|
+
import { e as e$2, o as o$4 } from './unsafe-html-C2r3PyzF.js';
|
|
5
5
|
import { c as createCacheFetch, s as sanitizeSvg, o as observerSlotChangesWithCallback, r as redispatchEvent, a as isDarkMode, i as isActivationClick, d as dispatchActivationClick, t as throttle } from './dispatch-event-utils-B4odODQf.js';
|
|
6
6
|
import { a as e, e as e$4 } from './query-QBcUV-L_.js';
|
|
7
|
-
import { o as o$3 } from './style-map-
|
|
8
|
-
import { B as BaseInput, o as observeThemeChange } from './observe-theme-change-
|
|
9
|
-
import { s as spread } from './button-
|
|
7
|
+
import { o as o$3 } from './style-map-DcB52w-l.js';
|
|
8
|
+
import { B as BaseInput, o as observeThemeChange } from './observe-theme-change-pALI5fmV.js';
|
|
9
|
+
import { s as spread } from './button-ClzS8JLq.js';
|
|
10
10
|
|
|
11
11
|
/**
|
|
12
12
|
* @license
|
|
@@ -39,7 +39,7 @@ async function fetchIcon(name, provider = 'material-symbols') {
|
|
|
39
39
|
return fetchSVG(PROVIDERS[provider](name));
|
|
40
40
|
}
|
|
41
41
|
|
|
42
|
-
var css_248z$
|
|
42
|
+
var css_248z$K = i`* {
|
|
43
43
|
box-sizing: border-box;
|
|
44
44
|
}
|
|
45
45
|
|
|
@@ -168,7 +168,7 @@ class Icon extends i$1 {
|
|
|
168
168
|
}
|
|
169
169
|
}
|
|
170
170
|
}
|
|
171
|
-
Icon.styles = [css_248z$
|
|
171
|
+
Icon.styles = [css_248z$K];
|
|
172
172
|
__decorate([
|
|
173
173
|
n({ type: String, reflect: true })
|
|
174
174
|
], Icon.prototype, "name", void 0);
|
|
@@ -188,7 +188,7 @@ __decorate([
|
|
|
188
188
|
r()
|
|
189
189
|
], Icon.prototype, "error", void 0);
|
|
190
190
|
|
|
191
|
-
var css_248z$
|
|
191
|
+
var css_248z$J = i`* {
|
|
192
192
|
box-sizing: border-box;
|
|
193
193
|
}
|
|
194
194
|
|
|
@@ -279,7 +279,7 @@ class Avatar extends i$1 {
|
|
|
279
279
|
return `${first.charAt(0)}${last.charAt(0)}`.toUpperCase();
|
|
280
280
|
}
|
|
281
281
|
}
|
|
282
|
-
Avatar.styles = [css_248z$
|
|
282
|
+
Avatar.styles = [css_248z$J];
|
|
283
283
|
__decorate([
|
|
284
284
|
n({ type: String, reflect: true })
|
|
285
285
|
], Avatar.prototype, "name", void 0);
|
|
@@ -287,7 +287,7 @@ __decorate([
|
|
|
287
287
|
n({ type: String, reflect: true })
|
|
288
288
|
], Avatar.prototype, "src", void 0);
|
|
289
289
|
|
|
290
|
-
var css_248z$
|
|
290
|
+
var css_248z$I = i`* {
|
|
291
291
|
box-sizing: border-box;
|
|
292
292
|
}
|
|
293
293
|
|
|
@@ -359,12 +359,12 @@ class Badge extends i$1 {
|
|
|
359
359
|
</div>`;
|
|
360
360
|
}
|
|
361
361
|
}
|
|
362
|
-
Badge.styles = [css_248z$
|
|
362
|
+
Badge.styles = [css_248z$I];
|
|
363
363
|
__decorate([
|
|
364
364
|
n({ type: String })
|
|
365
365
|
], Badge.prototype, "value", void 0);
|
|
366
366
|
|
|
367
|
-
var css_248z$
|
|
367
|
+
var css_248z$H = i`* {
|
|
368
368
|
box-sizing: border-box;
|
|
369
369
|
}
|
|
370
370
|
|
|
@@ -473,7 +473,7 @@ class Divider extends i$1 {
|
|
|
473
473
|
</div>`;
|
|
474
474
|
}
|
|
475
475
|
}
|
|
476
|
-
Divider.styles = [css_248z$
|
|
476
|
+
Divider.styles = [css_248z$H];
|
|
477
477
|
__decorate([
|
|
478
478
|
n({ type: Boolean, reflect: true })
|
|
479
479
|
], Divider.prototype, "vertical", void 0);
|
|
@@ -481,7 +481,7 @@ __decorate([
|
|
|
481
481
|
r()
|
|
482
482
|
], Divider.prototype, "slotHasContent", void 0);
|
|
483
483
|
|
|
484
|
-
var css_248z$
|
|
484
|
+
var css_248z$G = i`/**
|
|
485
485
|
* Derived from Material Design Elevation
|
|
486
486
|
* https://github.com/material-components/material-web/blob/main/elevation/internal/_elevation.scss
|
|
487
487
|
*/
|
|
@@ -554,9 +554,9 @@ class Elevation extends i$1 {
|
|
|
554
554
|
return b `<span class="shadow"></span>`;
|
|
555
555
|
}
|
|
556
556
|
}
|
|
557
|
-
Elevation.styles = [css_248z$
|
|
557
|
+
Elevation.styles = [css_248z$G];
|
|
558
558
|
|
|
559
|
-
var css_248z$
|
|
559
|
+
var css_248z$F = i`:host {
|
|
560
560
|
display: none;
|
|
561
561
|
pointer-events: none;
|
|
562
562
|
position: absolute;
|
|
@@ -651,7 +651,7 @@ class FocusRing extends i$1 {
|
|
|
651
651
|
this._control = undefined;
|
|
652
652
|
}
|
|
653
653
|
}
|
|
654
|
-
FocusRing.styles = [css_248z$
|
|
654
|
+
FocusRing.styles = [css_248z$F];
|
|
655
655
|
__decorate([
|
|
656
656
|
n({ type: Boolean, reflect: true })
|
|
657
657
|
], FocusRing.prototype, "visible", void 0);
|
|
@@ -1112,7 +1112,7 @@ __decorate([
|
|
|
1112
1112
|
e$4('.surface')
|
|
1113
1113
|
], Ripple.prototype, "mdRoot", void 0);
|
|
1114
1114
|
|
|
1115
|
-
var css_248z$
|
|
1115
|
+
var css_248z$E = i`* {
|
|
1116
1116
|
box-sizing: border-box;
|
|
1117
1117
|
}
|
|
1118
1118
|
|
|
@@ -1282,7 +1282,7 @@ class AccordionItem extends i$1 {
|
|
|
1282
1282
|
}
|
|
1283
1283
|
}
|
|
1284
1284
|
_AccordionItem_id = new WeakMap();
|
|
1285
|
-
AccordionItem.styles = [css_248z$
|
|
1285
|
+
AccordionItem.styles = [css_248z$E];
|
|
1286
1286
|
__decorate([
|
|
1287
1287
|
n({ type: String, reflect: true })
|
|
1288
1288
|
], AccordionItem.prototype, "heading", void 0);
|
|
@@ -1296,7 +1296,7 @@ __decorate([
|
|
|
1296
1296
|
e$4('.accordion-heading')
|
|
1297
1297
|
], AccordionItem.prototype, "buttonElement", void 0);
|
|
1298
1298
|
|
|
1299
|
-
var css_248z$
|
|
1299
|
+
var css_248z$D = i`* {
|
|
1300
1300
|
box-sizing: border-box;
|
|
1301
1301
|
}
|
|
1302
1302
|
|
|
@@ -1415,7 +1415,7 @@ class Accordion extends i$1 {
|
|
|
1415
1415
|
return b `<div class="accordion"><slot></slot></div>`;
|
|
1416
1416
|
}
|
|
1417
1417
|
}
|
|
1418
|
-
Accordion.styles = [css_248z$
|
|
1418
|
+
Accordion.styles = [css_248z$D];
|
|
1419
1419
|
Accordion.Item = AccordionItem;
|
|
1420
1420
|
__decorate([
|
|
1421
1421
|
n({ type: Boolean, attribute: 'allow-multiple' })
|
|
@@ -1424,7 +1424,7 @@ __decorate([
|
|
|
1424
1424
|
o$2({ selector: 'p-accordion-item' })
|
|
1425
1425
|
], Accordion.prototype, "items", void 0);
|
|
1426
1426
|
|
|
1427
|
-
var css_248z$
|
|
1427
|
+
var css_248z$C = i`* {
|
|
1428
1428
|
box-sizing: border-box;
|
|
1429
1429
|
}
|
|
1430
1430
|
|
|
@@ -1495,7 +1495,7 @@ class Link extends i$1 {
|
|
|
1495
1495
|
</a>`;
|
|
1496
1496
|
}
|
|
1497
1497
|
}
|
|
1498
|
-
Link.styles = [css_248z$
|
|
1498
|
+
Link.styles = [css_248z$C];
|
|
1499
1499
|
__decorate([
|
|
1500
1500
|
n({ reflect: true })
|
|
1501
1501
|
], Link.prototype, "href", void 0);
|
|
@@ -1506,7 +1506,7 @@ __decorate([
|
|
|
1506
1506
|
r()
|
|
1507
1507
|
], Link.prototype, "tabIndexValue", void 0);
|
|
1508
1508
|
|
|
1509
|
-
var css_248z$
|
|
1509
|
+
var css_248z$B = i`* {
|
|
1510
1510
|
box-sizing: border-box;
|
|
1511
1511
|
}
|
|
1512
1512
|
|
|
@@ -1643,7 +1643,7 @@ slot::slotted(*) {
|
|
|
1643
1643
|
--_container-state-opacity: 0.08;
|
|
1644
1644
|
}`;
|
|
1645
1645
|
|
|
1646
|
-
var css_248z$
|
|
1646
|
+
var css_248z$A = i`:host([color=default]) {
|
|
1647
1647
|
--filled-tag-container-color: var(--color-surface);
|
|
1648
1648
|
--filled-tag-label-text-color: var(--color-on-surface);
|
|
1649
1649
|
--tonal-tag-container-color: var(--color-surface-container);
|
|
@@ -1709,7 +1709,7 @@ var css_248z$y = i`:host([color=default]) {
|
|
|
1709
1709
|
--outlined-tag-label-text-color: var(--color-purple);
|
|
1710
1710
|
}`;
|
|
1711
1711
|
|
|
1712
|
-
var css_248z$
|
|
1712
|
+
var css_248z$z = i`.tag {
|
|
1713
1713
|
font-family: var(--font-family-sans) !important;
|
|
1714
1714
|
}
|
|
1715
1715
|
|
|
@@ -1808,7 +1808,7 @@ class Tag extends i$1 {
|
|
|
1808
1808
|
}
|
|
1809
1809
|
// Define styles (Lit handles Scoping via Shadow DOM by default)
|
|
1810
1810
|
// You would typically import your tag.scss.js here or use the css tag
|
|
1811
|
-
Tag.styles = [css_248z$
|
|
1811
|
+
Tag.styles = [css_248z$B, css_248z$A, css_248z$z];
|
|
1812
1812
|
__decorate([
|
|
1813
1813
|
n({ type: Boolean })
|
|
1814
1814
|
], Tag.prototype, "dismissible", void 0);
|
|
@@ -1822,7 +1822,7 @@ __decorate([
|
|
|
1822
1822
|
n()
|
|
1823
1823
|
], Tag.prototype, "size", void 0);
|
|
1824
1824
|
|
|
1825
|
-
var css_248z$
|
|
1825
|
+
var css_248z$y = i`* {
|
|
1826
1826
|
box-sizing: border-box;
|
|
1827
1827
|
}
|
|
1828
1828
|
|
|
@@ -1934,7 +1934,7 @@ var css_248z$w = i`* {
|
|
|
1934
1934
|
color: var(--background);
|
|
1935
1935
|
}`;
|
|
1936
1936
|
|
|
1937
|
-
var css_248z$
|
|
1937
|
+
var css_248z$x = i`:host([color=red]) {
|
|
1938
1938
|
--chip-container-color: var(--color-red-container);
|
|
1939
1939
|
--chip-outline-color: var(--color-on-red-container);
|
|
1940
1940
|
}
|
|
@@ -1963,7 +1963,7 @@ var css_248z$v = i`:host([color=red]) {
|
|
|
1963
1963
|
--chip-outline-color: var(--color-on-purple-container);
|
|
1964
1964
|
}`;
|
|
1965
1965
|
|
|
1966
|
-
var css_248z$
|
|
1966
|
+
var css_248z$w = i`.tag {
|
|
1967
1967
|
font-family: var(--font-family-sans) !important;
|
|
1968
1968
|
}
|
|
1969
1969
|
|
|
@@ -2101,7 +2101,7 @@ class Chip extends i$1 {
|
|
|
2101
2101
|
}
|
|
2102
2102
|
// Define styles (Lit handles Scoping via Shadow DOM by default)
|
|
2103
2103
|
// You would typically import your tag.scss.js here or use the css tag
|
|
2104
|
-
Chip.styles = [css_248z$
|
|
2104
|
+
Chip.styles = [css_248z$y, css_248z$x, css_248z$w];
|
|
2105
2105
|
__decorate([
|
|
2106
2106
|
n({ type: Boolean })
|
|
2107
2107
|
], Chip.prototype, "dismissible", void 0);
|
|
@@ -2118,7 +2118,7 @@ __decorate([
|
|
|
2118
2118
|
n({ type: String })
|
|
2119
2119
|
], Chip.prototype, "imageSrc", void 0);
|
|
2120
2120
|
|
|
2121
|
-
var css_248z$
|
|
2121
|
+
var css_248z$v = i`:host {
|
|
2122
2122
|
display: block;
|
|
2123
2123
|
--progress-height: 0.25rem;
|
|
2124
2124
|
--progress-container-color: var(--color-primary);
|
|
@@ -2324,9 +2324,9 @@ class LinearProgress extends BaseProgress {
|
|
|
2324
2324
|
}
|
|
2325
2325
|
}
|
|
2326
2326
|
// Lit components use static styles for better performance
|
|
2327
|
-
LinearProgress.styles = [css_248z$
|
|
2327
|
+
LinearProgress.styles = [css_248z$v];
|
|
2328
2328
|
|
|
2329
|
-
var css_248z$
|
|
2329
|
+
var css_248z$u = i`:host {
|
|
2330
2330
|
display: inline-block;
|
|
2331
2331
|
--progress-height: 1.5rem;
|
|
2332
2332
|
--progress-line-thickness: 4px;
|
|
@@ -2489,9 +2489,9 @@ class CircularProgress extends BaseProgress {
|
|
|
2489
2489
|
}
|
|
2490
2490
|
}
|
|
2491
2491
|
// Lit components use static styles for better performance
|
|
2492
|
-
CircularProgress.styles = [css_248z$
|
|
2492
|
+
CircularProgress.styles = [css_248z$u];
|
|
2493
2493
|
|
|
2494
|
-
var css_248z$
|
|
2494
|
+
var css_248z$t = i`:host {
|
|
2495
2495
|
--skeleton-container-color: var(--color-surface-container);
|
|
2496
2496
|
--skeleton-element: var(--color-on-surface);
|
|
2497
2497
|
display: inline-block;
|
|
@@ -2595,12 +2595,12 @@ class Skeleton extends i$1 {
|
|
|
2595
2595
|
return b ` <div class="skeleton"></div>`;
|
|
2596
2596
|
}
|
|
2597
2597
|
}
|
|
2598
|
-
Skeleton.styles = [css_248z$
|
|
2598
|
+
Skeleton.styles = [css_248z$t];
|
|
2599
2599
|
__decorate([
|
|
2600
2600
|
n({ type: Boolean, reflect: true })
|
|
2601
2601
|
], Skeleton.prototype, "visible", void 0);
|
|
2602
2602
|
|
|
2603
|
-
var css_248z$
|
|
2603
|
+
var css_248z$s = i`* {
|
|
2604
2604
|
box-sizing: border-box;
|
|
2605
2605
|
}
|
|
2606
2606
|
|
|
@@ -2773,7 +2773,7 @@ class Input extends BaseInput {
|
|
|
2773
2773
|
`;
|
|
2774
2774
|
}
|
|
2775
2775
|
}
|
|
2776
|
-
Input.styles = [css_248z$
|
|
2776
|
+
Input.styles = [css_248z$s];
|
|
2777
2777
|
__decorate([
|
|
2778
2778
|
n({ type: String })
|
|
2779
2779
|
], Input.prototype, "value", void 0);
|
|
@@ -2832,7 +2832,7 @@ __decorate([
|
|
|
2832
2832
|
e$4('.input-element')
|
|
2833
2833
|
], Input.prototype, "inputElement", void 0);
|
|
2834
2834
|
|
|
2835
|
-
var css_248z$
|
|
2835
|
+
var css_248z$r = i`* {
|
|
2836
2836
|
box-sizing: border-box;
|
|
2837
2837
|
}
|
|
2838
2838
|
|
|
@@ -3200,7 +3200,7 @@ class Field extends i$1 {
|
|
|
3200
3200
|
return b `<div class="text-count">${this.textCount}</div>`;
|
|
3201
3201
|
}
|
|
3202
3202
|
}
|
|
3203
|
-
Field.styles = [css_248z$
|
|
3203
|
+
Field.styles = [css_248z$r];
|
|
3204
3204
|
__decorate([
|
|
3205
3205
|
n({ type: String })
|
|
3206
3206
|
], Field.prototype, "label", void 0);
|
|
@@ -3256,7 +3256,7 @@ __decorate([
|
|
|
3256
3256
|
r()
|
|
3257
3257
|
], Field.prototype, "slotEndHasContent", void 0);
|
|
3258
3258
|
|
|
3259
|
-
var css_248z$
|
|
3259
|
+
var css_248z$q = i`* {
|
|
3260
3260
|
box-sizing: border-box;
|
|
3261
3261
|
}
|
|
3262
3262
|
|
|
@@ -3453,7 +3453,7 @@ class NumberField extends BaseInput {
|
|
|
3453
3453
|
}
|
|
3454
3454
|
}
|
|
3455
3455
|
_NumberField_id = new WeakMap();
|
|
3456
|
-
NumberField.styles = [css_248z$
|
|
3456
|
+
NumberField.styles = [css_248z$q];
|
|
3457
3457
|
__decorate([
|
|
3458
3458
|
n({ type: Number })
|
|
3459
3459
|
], NumberField.prototype, "value", void 0);
|
|
@@ -3515,7 +3515,7 @@ __decorate([
|
|
|
3515
3515
|
e$4('.input-element')
|
|
3516
3516
|
], NumberField.prototype, "inputElement", void 0);
|
|
3517
3517
|
|
|
3518
|
-
var css_248z$
|
|
3518
|
+
var css_248z$p = i`* {
|
|
3519
3519
|
box-sizing: border-box;
|
|
3520
3520
|
}
|
|
3521
3521
|
|
|
@@ -3682,7 +3682,7 @@ class DatePicker extends BaseInput {
|
|
|
3682
3682
|
`;
|
|
3683
3683
|
}
|
|
3684
3684
|
}
|
|
3685
|
-
DatePicker.styles = [css_248z$
|
|
3685
|
+
DatePicker.styles = [css_248z$p];
|
|
3686
3686
|
__decorate([
|
|
3687
3687
|
n({ type: String })
|
|
3688
3688
|
], DatePicker.prototype, "value", void 0);
|
|
@@ -3738,7 +3738,7 @@ __decorate([
|
|
|
3738
3738
|
e$4('.input-element')
|
|
3739
3739
|
], DatePicker.prototype, "inputElement", void 0);
|
|
3740
3740
|
|
|
3741
|
-
var css_248z$
|
|
3741
|
+
var css_248z$o = i`* {
|
|
3742
3742
|
box-sizing: border-box;
|
|
3743
3743
|
}
|
|
3744
3744
|
|
|
@@ -3905,7 +3905,7 @@ class TimePicker extends BaseInput {
|
|
|
3905
3905
|
`;
|
|
3906
3906
|
}
|
|
3907
3907
|
}
|
|
3908
|
-
TimePicker.styles = [css_248z$
|
|
3908
|
+
TimePicker.styles = [css_248z$o];
|
|
3909
3909
|
__decorate([
|
|
3910
3910
|
n({ type: String })
|
|
3911
3911
|
], TimePicker.prototype, "value", void 0);
|
|
@@ -3961,7 +3961,7 @@ __decorate([
|
|
|
3961
3961
|
e$4('.input-element')
|
|
3962
3962
|
], TimePicker.prototype, "inputElement", void 0);
|
|
3963
3963
|
|
|
3964
|
-
var css_248z$
|
|
3964
|
+
var css_248z$n = i`* {
|
|
3965
3965
|
box-sizing: border-box;
|
|
3966
3966
|
}
|
|
3967
3967
|
|
|
@@ -4121,7 +4121,7 @@ class Textarea extends BaseInput {
|
|
|
4121
4121
|
`;
|
|
4122
4122
|
}
|
|
4123
4123
|
}
|
|
4124
|
-
Textarea.styles = [css_248z$
|
|
4124
|
+
Textarea.styles = [css_248z$n];
|
|
4125
4125
|
__decorate([
|
|
4126
4126
|
n({ type: String })
|
|
4127
4127
|
], Textarea.prototype, "value", void 0);
|
|
@@ -4180,7 +4180,7 @@ __decorate([
|
|
|
4180
4180
|
e$4('.input-element')
|
|
4181
4181
|
], Textarea.prototype, "inputElement", void 0);
|
|
4182
4182
|
|
|
4183
|
-
var css_248z$
|
|
4183
|
+
var css_248z$m = i`* {
|
|
4184
4184
|
box-sizing: border-box;
|
|
4185
4185
|
}
|
|
4186
4186
|
|
|
@@ -4521,7 +4521,7 @@ class Switch extends BaseInput {
|
|
|
4521
4521
|
`;
|
|
4522
4522
|
}
|
|
4523
4523
|
}
|
|
4524
|
-
Switch.styles = [css_248z$
|
|
4524
|
+
Switch.styles = [css_248z$m];
|
|
4525
4525
|
__decorate([
|
|
4526
4526
|
n({ type: Boolean })
|
|
4527
4527
|
], Switch.prototype, "value", void 0);
|
|
@@ -4536,36 +4536,553 @@ __decorate([
|
|
|
4536
4536
|
], Switch.prototype, "rounded", void 0);
|
|
4537
4537
|
__decorate([
|
|
4538
4538
|
n({ type: Boolean, reflect: true })
|
|
4539
|
-
], Switch.prototype, "required", void 0);
|
|
4539
|
+
], Switch.prototype, "required", void 0);
|
|
4540
|
+
__decorate([
|
|
4541
|
+
n({ type: Boolean, reflect: true })
|
|
4542
|
+
], Switch.prototype, "readonly", void 0);
|
|
4543
|
+
__decorate([
|
|
4544
|
+
n({ type: Boolean, reflect: true })
|
|
4545
|
+
], Switch.prototype, "disabled", void 0);
|
|
4546
|
+
__decorate([
|
|
4547
|
+
n({ type: Boolean, reflect: true, attribute: 'with-icon' })
|
|
4548
|
+
], Switch.prototype, "withIcon", void 0);
|
|
4549
|
+
__decorate([
|
|
4550
|
+
n({ type: Object })
|
|
4551
|
+
], Switch.prototype, "configAria", void 0);
|
|
4552
|
+
__decorate([
|
|
4553
|
+
r()
|
|
4554
|
+
], Switch.prototype, "hasFocus", void 0);
|
|
4555
|
+
__decorate([
|
|
4556
|
+
r()
|
|
4557
|
+
], Switch.prototype, "isActive", void 0);
|
|
4558
|
+
__decorate([
|
|
4559
|
+
r()
|
|
4560
|
+
], Switch.prototype, "slotHasContent", void 0);
|
|
4561
|
+
__decorate([
|
|
4562
|
+
e$4('.track')
|
|
4563
|
+
], Switch.prototype, "trackElement", void 0);
|
|
4564
|
+
__decorate([
|
|
4565
|
+
e$4('.input-native')
|
|
4566
|
+
], Switch.prototype, "nativeElement", void 0);
|
|
4567
|
+
|
|
4568
|
+
var css_248z$l = i`* {
|
|
4569
|
+
box-sizing: border-box;
|
|
4570
|
+
}
|
|
4571
|
+
|
|
4572
|
+
.screen-reader-only {
|
|
4573
|
+
display: none !important;
|
|
4574
|
+
}
|
|
4575
|
+
|
|
4576
|
+
:host {
|
|
4577
|
+
display: inline-block;
|
|
4578
|
+
--checkbox-size: 18px;
|
|
4579
|
+
--checkbox-icon-size: 12px;
|
|
4580
|
+
--checkbox-selected-color: var(--color-primary);
|
|
4581
|
+
--checkbox-unselected-color: var(--color-on-surface-variant);
|
|
4582
|
+
--checkbox-checkmark-color: var(--color-on-primary);
|
|
4583
|
+
--checkbox-state-layer-size: 40px;
|
|
4584
|
+
--checkbox-disabled-opacity: 0.38;
|
|
4585
|
+
--checkbox-border-radius: 2px;
|
|
4586
|
+
}
|
|
4587
|
+
|
|
4588
|
+
.checkbox {
|
|
4589
|
+
position: relative;
|
|
4590
|
+
display: inline-flex;
|
|
4591
|
+
align-items: center;
|
|
4592
|
+
cursor: pointer;
|
|
4593
|
+
user-select: none;
|
|
4594
|
+
vertical-align: middle;
|
|
4595
|
+
font-family: var(--typography-body-medium-font-family) !important;
|
|
4596
|
+
font-size: var(--typography-body-medium-font-size) !important;
|
|
4597
|
+
font-weight: var(--typography-body-medium-font-weight) !important;
|
|
4598
|
+
line-height: var(--typography-body-medium-line-height) !important;
|
|
4599
|
+
letter-spacing: var(--typography-body-medium-letter-spacing) !important;
|
|
4600
|
+
}
|
|
4601
|
+
.checkbox.has-content {
|
|
4602
|
+
gap: 8px;
|
|
4603
|
+
}
|
|
4604
|
+
.checkbox .input-native {
|
|
4605
|
+
position: absolute;
|
|
4606
|
+
width: 1px;
|
|
4607
|
+
height: 1px;
|
|
4608
|
+
padding: 0;
|
|
4609
|
+
margin: -1px;
|
|
4610
|
+
overflow: hidden;
|
|
4611
|
+
clip: rect(0, 0, 0, 0);
|
|
4612
|
+
border: 0;
|
|
4613
|
+
}
|
|
4614
|
+
.checkbox .container {
|
|
4615
|
+
position: relative;
|
|
4616
|
+
display: inline-flex;
|
|
4617
|
+
align-items: center;
|
|
4618
|
+
justify-content: center;
|
|
4619
|
+
width: var(--checkbox-state-layer-size);
|
|
4620
|
+
height: var(--checkbox-state-layer-size);
|
|
4621
|
+
cursor: inherit;
|
|
4622
|
+
outline: none;
|
|
4623
|
+
flex-shrink: 0;
|
|
4624
|
+
}
|
|
4625
|
+
.checkbox .state-layer {
|
|
4626
|
+
position: absolute;
|
|
4627
|
+
inset: 0;
|
|
4628
|
+
border-radius: 50%;
|
|
4629
|
+
opacity: 0;
|
|
4630
|
+
transition: opacity var(--duration-short2) var(--easing-standard);
|
|
4631
|
+
}
|
|
4632
|
+
.checkbox .outline {
|
|
4633
|
+
position: absolute;
|
|
4634
|
+
width: var(--checkbox-size);
|
|
4635
|
+
height: var(--checkbox-size);
|
|
4636
|
+
border: 2px solid var(--checkbox-unselected-color);
|
|
4637
|
+
border-radius: var(--checkbox-border-radius);
|
|
4638
|
+
box-sizing: border-box;
|
|
4639
|
+
transition: border-color var(--duration-short2) var(--easing-standard);
|
|
4640
|
+
}
|
|
4641
|
+
.checkbox .background {
|
|
4642
|
+
position: absolute;
|
|
4643
|
+
width: var(--checkbox-size);
|
|
4644
|
+
height: var(--checkbox-size);
|
|
4645
|
+
background: var(--checkbox-selected-color);
|
|
4646
|
+
border-radius: var(--checkbox-border-radius);
|
|
4647
|
+
opacity: 0;
|
|
4648
|
+
transform: scale(0);
|
|
4649
|
+
transition: transform var(--duration-short2) var(--easing-standard), opacity var(--duration-short2) var(--easing-standard);
|
|
4650
|
+
}
|
|
4651
|
+
.checkbox .icon {
|
|
4652
|
+
position: absolute;
|
|
4653
|
+
width: var(--checkbox-icon-size);
|
|
4654
|
+
height: var(--checkbox-icon-size);
|
|
4655
|
+
fill: none;
|
|
4656
|
+
stroke: var(--checkbox-checkmark-color);
|
|
4657
|
+
stroke-width: 2;
|
|
4658
|
+
stroke-linecap: round;
|
|
4659
|
+
stroke-linejoin: round;
|
|
4660
|
+
opacity: 0;
|
|
4661
|
+
transition: opacity var(--duration-short1) var(--easing-standard);
|
|
4662
|
+
}
|
|
4663
|
+
.checkbox .icon .checkmark {
|
|
4664
|
+
stroke-dasharray: 14;
|
|
4665
|
+
stroke-dashoffset: 14;
|
|
4666
|
+
transition: stroke-dashoffset var(--duration-short4) var(--easing-emphasized);
|
|
4667
|
+
}
|
|
4668
|
+
.checkbox .icon .indeterminate {
|
|
4669
|
+
transform-origin: center;
|
|
4670
|
+
opacity: 0;
|
|
4671
|
+
transition: opacity var(--duration-short1) var(--easing-standard);
|
|
4672
|
+
}
|
|
4673
|
+
.checkbox .label {
|
|
4674
|
+
color: var(--color-on-surface);
|
|
4675
|
+
cursor: inherit;
|
|
4676
|
+
}
|
|
4677
|
+
.checkbox:hover:not(.disabled):not(.readonly) .state-layer {
|
|
4678
|
+
opacity: 0.08;
|
|
4679
|
+
background: var(--color-on-surface);
|
|
4680
|
+
}
|
|
4681
|
+
.checkbox:hover:not(.disabled):not(.readonly).state-checked .state-layer, .checkbox:hover:not(.disabled):not(.readonly).state-indeterminate .state-layer {
|
|
4682
|
+
background: var(--checkbox-selected-color);
|
|
4683
|
+
}
|
|
4684
|
+
.checkbox.has-focus:not(.active):not(.disabled):not(.readonly) .state-layer {
|
|
4685
|
+
opacity: 0.12;
|
|
4686
|
+
background: var(--color-on-surface);
|
|
4687
|
+
}
|
|
4688
|
+
.checkbox.has-focus:not(.active):not(.disabled):not(.readonly) .container {
|
|
4689
|
+
outline: 3px solid var(--color-primary);
|
|
4690
|
+
outline-offset: 2px;
|
|
4691
|
+
border-radius: 50%;
|
|
4692
|
+
}
|
|
4693
|
+
.checkbox.has-focus:not(.active):not(.disabled):not(.readonly).state-checked .state-layer, .checkbox.has-focus:not(.active):not(.disabled):not(.readonly).state-indeterminate .state-layer {
|
|
4694
|
+
background: var(--checkbox-selected-color);
|
|
4695
|
+
}
|
|
4696
|
+
.checkbox.active:not(.disabled):not(.readonly) .state-layer {
|
|
4697
|
+
opacity: 0.12;
|
|
4698
|
+
background: var(--color-on-surface);
|
|
4699
|
+
}
|
|
4700
|
+
.checkbox.active:not(.disabled):not(.readonly).state-checked .state-layer, .checkbox.active:not(.disabled):not(.readonly).state-indeterminate .state-layer {
|
|
4701
|
+
background: var(--checkbox-selected-color);
|
|
4702
|
+
}
|
|
4703
|
+
.checkbox.rounded {
|
|
4704
|
+
--checkbox-border-radius: 18px;
|
|
4705
|
+
}
|
|
4706
|
+
|
|
4707
|
+
.checkbox.state-checked .outline {
|
|
4708
|
+
border-color: transparent;
|
|
4709
|
+
}
|
|
4710
|
+
.checkbox.state-checked .background {
|
|
4711
|
+
opacity: 1;
|
|
4712
|
+
transform: scale(1);
|
|
4713
|
+
}
|
|
4714
|
+
.checkbox.state-checked .icon {
|
|
4715
|
+
opacity: 1;
|
|
4716
|
+
}
|
|
4717
|
+
.checkbox.state-checked .icon .checkmark {
|
|
4718
|
+
stroke-dashoffset: 0;
|
|
4719
|
+
}
|
|
4720
|
+
|
|
4721
|
+
.checkbox.state-indeterminate .outline {
|
|
4722
|
+
border-color: transparent;
|
|
4723
|
+
}
|
|
4724
|
+
.checkbox.state-indeterminate .background {
|
|
4725
|
+
opacity: 1;
|
|
4726
|
+
transform: scale(1);
|
|
4727
|
+
}
|
|
4728
|
+
.checkbox.state-indeterminate .icon {
|
|
4729
|
+
opacity: 1;
|
|
4730
|
+
fill: var(--checkbox-checkmark-color);
|
|
4731
|
+
}
|
|
4732
|
+
.checkbox.state-indeterminate .icon .indeterminate {
|
|
4733
|
+
opacity: 1;
|
|
4734
|
+
}
|
|
4735
|
+
|
|
4736
|
+
.checkbox.size-sm {
|
|
4737
|
+
--checkbox-size: 16px;
|
|
4738
|
+
--checkbox-icon-size: 10px;
|
|
4739
|
+
--checkbox-state-layer-size: 36px;
|
|
4740
|
+
font-size: var(--font-size-body-small);
|
|
4741
|
+
line-height: var(--line-height-body-small);
|
|
4742
|
+
}
|
|
4743
|
+
.checkbox.size-sm .icon {
|
|
4744
|
+
stroke-width: 1.5;
|
|
4745
|
+
}
|
|
4746
|
+
|
|
4747
|
+
.checkbox.size-md {
|
|
4748
|
+
--checkbox-size: 18px;
|
|
4749
|
+
--checkbox-icon-size: 12px;
|
|
4750
|
+
--checkbox-state-layer-size: 40px;
|
|
4751
|
+
}
|
|
4752
|
+
.checkbox.size-md .icon {
|
|
4753
|
+
stroke-width: 2;
|
|
4754
|
+
}
|
|
4755
|
+
|
|
4756
|
+
.checkbox.size-lg {
|
|
4757
|
+
--checkbox-size: 24px;
|
|
4758
|
+
--checkbox-icon-size: 16px;
|
|
4759
|
+
--checkbox-state-layer-size: 48px;
|
|
4760
|
+
font-size: var(--font-size-body-large);
|
|
4761
|
+
line-height: var(--line-height-body-large);
|
|
4762
|
+
}
|
|
4763
|
+
.checkbox.size-lg .icon {
|
|
4764
|
+
stroke-width: 2.5;
|
|
4765
|
+
}
|
|
4766
|
+
|
|
4767
|
+
.checkbox.readonly {
|
|
4768
|
+
cursor: default;
|
|
4769
|
+
}
|
|
4770
|
+
.checkbox.readonly .label {
|
|
4771
|
+
color: var(--color-on-surface);
|
|
4772
|
+
}
|
|
4773
|
+
.checkbox.readonly .outline {
|
|
4774
|
+
border-color: var(--color-on-surface-variant);
|
|
4775
|
+
}
|
|
4776
|
+
.checkbox.readonly.state-checked .background, .checkbox.readonly.state-indeterminate .background {
|
|
4777
|
+
background: var(--color-on-surface-variant);
|
|
4778
|
+
}
|
|
4779
|
+
.checkbox.readonly .state-layer {
|
|
4780
|
+
display: none;
|
|
4781
|
+
}
|
|
4782
|
+
|
|
4783
|
+
.checkbox.disabled {
|
|
4784
|
+
cursor: not-allowed;
|
|
4785
|
+
opacity: var(--checkbox-disabled-opacity);
|
|
4786
|
+
}
|
|
4787
|
+
.checkbox.disabled .label {
|
|
4788
|
+
color: var(--color-on-surface);
|
|
4789
|
+
}
|
|
4790
|
+
.checkbox.disabled .outline {
|
|
4791
|
+
border-color: var(--color-on-surface);
|
|
4792
|
+
}
|
|
4793
|
+
.checkbox.disabled.state-checked .background, .checkbox.disabled.state-indeterminate .background {
|
|
4794
|
+
background: var(--color-on-surface);
|
|
4795
|
+
}
|
|
4796
|
+
.checkbox.disabled .state-layer {
|
|
4797
|
+
display: none;
|
|
4798
|
+
}`;
|
|
4799
|
+
|
|
4800
|
+
/**
|
|
4801
|
+
* @label Checkbox
|
|
4802
|
+
* @tag wc-checkbox
|
|
4803
|
+
* @rawTag checkbox
|
|
4804
|
+
* @summary Captures boolean input with an optional indeterminate mode.
|
|
4805
|
+
* @overview
|
|
4806
|
+
* <p>Checkboxes allow users to select one or more items from a set. Checkboxes can turn an option on or off.</p>
|
|
4807
|
+
* <p>Material Design 3 checkboxes feature a smooth animation and clear visual states for checked, unchecked, and indeterminate.</p>
|
|
4808
|
+
* @cssprop --checkbox-size: Size of the checkbox container.
|
|
4809
|
+
* @cssprop --checkbox-selected-color: Color of the checkbox when selected.
|
|
4810
|
+
* @cssprop --checkbox-unselected-color: Color of the checkbox border when unselected.
|
|
4811
|
+
* @cssprop --checkbox-checkmark-color: Color of the checkmark icon.
|
|
4812
|
+
* @cssprop --checkbox-state-layer-size: Size of the state layer for touch target.
|
|
4813
|
+
* @fires {CustomEvent} change - Dispatched when the checkbox value changes.
|
|
4814
|
+
* @fires {CustomEvent} blur - Dispatched when the checkbox loses focus.
|
|
4815
|
+
* @fires {CustomEvent} focus - Dispatched when the checkbox receives focus.
|
|
4816
|
+
* @tags input, form
|
|
4817
|
+
*
|
|
4818
|
+
* @example
|
|
4819
|
+
* ```html
|
|
4820
|
+
* <wc-checkbox label="Accept terms"></wc-checkbox>
|
|
4821
|
+
* ```
|
|
4822
|
+
*/
|
|
4823
|
+
class Checkbox extends i$1 {
|
|
4824
|
+
constructor() {
|
|
4825
|
+
super(...arguments);
|
|
4826
|
+
/**
|
|
4827
|
+
* The input field name.
|
|
4828
|
+
*/
|
|
4829
|
+
this.name = '';
|
|
4830
|
+
/**
|
|
4831
|
+
* The checkbox label.
|
|
4832
|
+
*/
|
|
4833
|
+
this.label = '';
|
|
4834
|
+
/**
|
|
4835
|
+
* The input field value (checked state).
|
|
4836
|
+
*/
|
|
4837
|
+
this.value = false;
|
|
4838
|
+
/**
|
|
4839
|
+
* If true, displays the checkbox in an indeterminate state.
|
|
4840
|
+
*/
|
|
4841
|
+
this.indeterminate = false;
|
|
4842
|
+
/**
|
|
4843
|
+
* If true, the checkbox has rounded corners. Defaults to `false`.
|
|
4844
|
+
*/
|
|
4845
|
+
this.rounded = false;
|
|
4846
|
+
/**
|
|
4847
|
+
* The checkbox size.
|
|
4848
|
+
* Possible values are: `"sm"`, `"md"`, `"lg"`. Defaults to `"md"`.
|
|
4849
|
+
*/
|
|
4850
|
+
this.size = 'md';
|
|
4851
|
+
/**
|
|
4852
|
+
* If true, required icon is shown. Defaults to `false`.
|
|
4853
|
+
*/
|
|
4854
|
+
this.required = false;
|
|
4855
|
+
/**
|
|
4856
|
+
* If true, the checkbox is readonly. Defaults to `false`.
|
|
4857
|
+
*/
|
|
4858
|
+
this.readonly = false;
|
|
4859
|
+
/**
|
|
4860
|
+
* If true, the user cannot interact with the checkbox. Defaults to `false`.
|
|
4861
|
+
*/
|
|
4862
|
+
this.disabled = false;
|
|
4863
|
+
/**
|
|
4864
|
+
* Configuration object for aria attributes.
|
|
4865
|
+
*/
|
|
4866
|
+
this.configAria = {};
|
|
4867
|
+
this.hasFocus = false;
|
|
4868
|
+
this.isActive = false;
|
|
4869
|
+
this.slotHasContent = false;
|
|
4870
|
+
this.windowMouseUp = () => {
|
|
4871
|
+
if (this.isActive) {
|
|
4872
|
+
this.isActive = false;
|
|
4873
|
+
}
|
|
4874
|
+
};
|
|
4875
|
+
this.windowKeyUp = (evt) => {
|
|
4876
|
+
if (this.isActive && evt.key === ' ') {
|
|
4877
|
+
this.isActive = false;
|
|
4878
|
+
}
|
|
4879
|
+
};
|
|
4880
|
+
this.mouseDownHandler = () => {
|
|
4881
|
+
this.isActive = true;
|
|
4882
|
+
};
|
|
4883
|
+
this.keyDownHandler = (evt) => {
|
|
4884
|
+
if (evt.key === ' ') {
|
|
4885
|
+
evt.preventDefault();
|
|
4886
|
+
this.isActive = true;
|
|
4887
|
+
this.clickHandler(evt);
|
|
4888
|
+
}
|
|
4889
|
+
};
|
|
4890
|
+
this.clickHandler = (ev) => {
|
|
4891
|
+
if (!this.disabled && !this.readonly) {
|
|
4892
|
+
this.value = !this.value;
|
|
4893
|
+
this.indeterminate = false;
|
|
4894
|
+
this.dispatchEvent(new CustomEvent('change', {
|
|
4895
|
+
detail: { value: this.value, originalEvent: ev },
|
|
4896
|
+
bubbles: true,
|
|
4897
|
+
composed: true,
|
|
4898
|
+
}));
|
|
4899
|
+
this.containerElement?.focus();
|
|
4900
|
+
}
|
|
4901
|
+
};
|
|
4902
|
+
this.blurHandler = (ev) => {
|
|
4903
|
+
this.hasFocus = false;
|
|
4904
|
+
this.dispatchEvent(new CustomEvent('blur', {
|
|
4905
|
+
detail: ev,
|
|
4906
|
+
bubbles: true,
|
|
4907
|
+
composed: true,
|
|
4908
|
+
}));
|
|
4909
|
+
};
|
|
4910
|
+
this.focusHandler = (ev) => {
|
|
4911
|
+
this.hasFocus = true;
|
|
4912
|
+
this.dispatchEvent(new CustomEvent('focus', {
|
|
4913
|
+
detail: ev,
|
|
4914
|
+
bubbles: true,
|
|
4915
|
+
composed: true,
|
|
4916
|
+
}));
|
|
4917
|
+
};
|
|
4918
|
+
this.handleKeyUp = (evt) => {
|
|
4919
|
+
if (evt.key === 'Enter') {
|
|
4920
|
+
this.clickHandler(evt);
|
|
4921
|
+
}
|
|
4922
|
+
};
|
|
4923
|
+
}
|
|
4924
|
+
connectedCallback() {
|
|
4925
|
+
super.connectedCallback();
|
|
4926
|
+
this.handleInitialAttributes();
|
|
4927
|
+
window.addEventListener('mouseup', this.windowMouseUp);
|
|
4928
|
+
window.addEventListener('keyup', this.windowKeyUp);
|
|
4929
|
+
}
|
|
4930
|
+
disconnectedCallback() {
|
|
4931
|
+
super.disconnectedCallback();
|
|
4932
|
+
window.removeEventListener('mouseup', this.windowMouseUp);
|
|
4933
|
+
window.removeEventListener('keyup', this.windowKeyUp);
|
|
4934
|
+
}
|
|
4935
|
+
firstUpdated() {
|
|
4936
|
+
this.slotHasContent = this.hasChildNodes();
|
|
4937
|
+
}
|
|
4938
|
+
handleInitialAttributes() {
|
|
4939
|
+
if (this.hasAttribute('tabindex')) {
|
|
4940
|
+
this.tabindex = this.getAttribute('tabindex') || undefined;
|
|
4941
|
+
this.removeAttribute('tabindex');
|
|
4942
|
+
}
|
|
4943
|
+
Array.from(this.attributes).forEach(attr => {
|
|
4944
|
+
if (attr.name.startsWith('aria-')) {
|
|
4945
|
+
this.configAria[attr.name] = attr.value;
|
|
4946
|
+
this.removeAttribute(attr.name);
|
|
4947
|
+
}
|
|
4948
|
+
});
|
|
4949
|
+
}
|
|
4950
|
+
/**
|
|
4951
|
+
* Sets focus on the checkbox.
|
|
4952
|
+
*/
|
|
4953
|
+
focus() {
|
|
4954
|
+
this.containerElement?.focus();
|
|
4955
|
+
}
|
|
4956
|
+
/**
|
|
4957
|
+
* Removes focus from the checkbox.
|
|
4958
|
+
*/
|
|
4959
|
+
blur() {
|
|
4960
|
+
this.containerElement?.blur();
|
|
4961
|
+
}
|
|
4962
|
+
render() {
|
|
4963
|
+
const cssClasses = {
|
|
4964
|
+
checkbox: true,
|
|
4965
|
+
'state-checked': this.value,
|
|
4966
|
+
'state-indeterminate': !this.value && this.indeterminate,
|
|
4967
|
+
[`size-${this.size}`]: true,
|
|
4968
|
+
'has-focus': this.hasFocus,
|
|
4969
|
+
active: this.isActive,
|
|
4970
|
+
disabled: this.disabled,
|
|
4971
|
+
readonly: this.readonly,
|
|
4972
|
+
required: this.required,
|
|
4973
|
+
rounded: this.rounded,
|
|
4974
|
+
'has-content': this.slotHasContent,
|
|
4975
|
+
};
|
|
4976
|
+
return b `
|
|
4977
|
+
<label class=${e$3(cssClasses)}>
|
|
4978
|
+
<div
|
|
4979
|
+
class="container"
|
|
4980
|
+
tabindex=${this.tabindex || 0}
|
|
4981
|
+
@keyup=${this.handleKeyUp}
|
|
4982
|
+
@mousedown=${this.mouseDownHandler}
|
|
4983
|
+
@keydown=${this.keyDownHandler}
|
|
4984
|
+
@blur=${this.blurHandler}
|
|
4985
|
+
@focus=${this.focusHandler}
|
|
4986
|
+
role="checkbox"
|
|
4987
|
+
aria-disabled=${this.disabled}
|
|
4988
|
+
aria-required=${this.required}
|
|
4989
|
+
aria-checked=${this.value
|
|
4990
|
+
? 'true'
|
|
4991
|
+
: this.indeterminate
|
|
4992
|
+
? 'mixed'
|
|
4993
|
+
: 'false'}
|
|
4994
|
+
${spread(this.configAria)}
|
|
4995
|
+
>
|
|
4996
|
+
<div class="state-layer"></div>
|
|
4997
|
+
<div class="outline"></div>
|
|
4998
|
+
<div class="background"></div>
|
|
4999
|
+
<svg class="icon" viewBox="0 0 12 12">
|
|
5000
|
+
${this.value
|
|
5001
|
+
? w `
|
|
5002
|
+
<path
|
|
5003
|
+
class="checkmark"
|
|
5004
|
+
d="M2 6L5 9L10 2"
|
|
5005
|
+
/>
|
|
5006
|
+
`
|
|
5007
|
+
: this.indeterminate
|
|
5008
|
+
? w `<rect
|
|
5009
|
+
class="indeterminate"
|
|
5010
|
+
x="2"
|
|
5011
|
+
y="5"
|
|
5012
|
+
width="8"
|
|
5013
|
+
height="2"
|
|
5014
|
+
/>`
|
|
5015
|
+
: ''}
|
|
5016
|
+
</svg>
|
|
5017
|
+
</div>
|
|
5018
|
+
|
|
5019
|
+
<input
|
|
5020
|
+
type="checkbox"
|
|
5021
|
+
class="input-native"
|
|
5022
|
+
name=${this.name}
|
|
5023
|
+
.checked=${this.value}
|
|
5024
|
+
.indeterminate=${this.indeterminate}
|
|
5025
|
+
aria-hidden="true"
|
|
5026
|
+
?required=${this.required}
|
|
5027
|
+
tabindex="-1"
|
|
5028
|
+
@click=${this.clickHandler}
|
|
5029
|
+
/>
|
|
5030
|
+
|
|
5031
|
+
${this.label
|
|
5032
|
+
? b `<div class="label">${this.label}</div>`
|
|
5033
|
+
: b `<div class="label slot-container"><slot></slot></div>`}
|
|
5034
|
+
</label>
|
|
5035
|
+
`;
|
|
5036
|
+
}
|
|
5037
|
+
}
|
|
5038
|
+
Checkbox.styles = [css_248z$l];
|
|
5039
|
+
__decorate([
|
|
5040
|
+
n({ type: String })
|
|
5041
|
+
], Checkbox.prototype, "name", void 0);
|
|
5042
|
+
__decorate([
|
|
5043
|
+
n({ type: String })
|
|
5044
|
+
], Checkbox.prototype, "label", void 0);
|
|
5045
|
+
__decorate([
|
|
5046
|
+
n({ type: Boolean, reflect: true })
|
|
5047
|
+
], Checkbox.prototype, "value", void 0);
|
|
5048
|
+
__decorate([
|
|
5049
|
+
n({ type: Boolean, reflect: true })
|
|
5050
|
+
], Checkbox.prototype, "indeterminate", void 0);
|
|
5051
|
+
__decorate([
|
|
5052
|
+
n({ type: Boolean })
|
|
5053
|
+
], Checkbox.prototype, "rounded", void 0);
|
|
5054
|
+
__decorate([
|
|
5055
|
+
n({ type: String })
|
|
5056
|
+
], Checkbox.prototype, "size", void 0);
|
|
5057
|
+
__decorate([
|
|
5058
|
+
n({ type: Boolean, reflect: true })
|
|
5059
|
+
], Checkbox.prototype, "required", void 0);
|
|
4540
5060
|
__decorate([
|
|
4541
5061
|
n({ type: Boolean, reflect: true })
|
|
4542
|
-
],
|
|
5062
|
+
], Checkbox.prototype, "readonly", void 0);
|
|
4543
5063
|
__decorate([
|
|
4544
5064
|
n({ type: Boolean, reflect: true })
|
|
4545
|
-
],
|
|
4546
|
-
__decorate([
|
|
4547
|
-
n({ type: Boolean, reflect: true, attribute: 'with-icon' })
|
|
4548
|
-
], Switch.prototype, "withIcon", void 0);
|
|
5065
|
+
], Checkbox.prototype, "disabled", void 0);
|
|
4549
5066
|
__decorate([
|
|
4550
5067
|
n({ type: Object })
|
|
4551
|
-
],
|
|
5068
|
+
], Checkbox.prototype, "configAria", void 0);
|
|
4552
5069
|
__decorate([
|
|
4553
5070
|
r()
|
|
4554
|
-
],
|
|
5071
|
+
], Checkbox.prototype, "hasFocus", void 0);
|
|
4555
5072
|
__decorate([
|
|
4556
5073
|
r()
|
|
4557
|
-
],
|
|
5074
|
+
], Checkbox.prototype, "isActive", void 0);
|
|
4558
5075
|
__decorate([
|
|
4559
5076
|
r()
|
|
4560
|
-
],
|
|
5077
|
+
], Checkbox.prototype, "slotHasContent", void 0);
|
|
4561
5078
|
__decorate([
|
|
4562
|
-
e$4('.
|
|
4563
|
-
],
|
|
5079
|
+
e$4('.container')
|
|
5080
|
+
], Checkbox.prototype, "containerElement", void 0);
|
|
4564
5081
|
__decorate([
|
|
4565
5082
|
e$4('.input-native')
|
|
4566
|
-
],
|
|
5083
|
+
], Checkbox.prototype, "nativeElement", void 0);
|
|
4567
5084
|
|
|
4568
|
-
var css_248z$
|
|
5085
|
+
var css_248z$k = i`* {
|
|
4569
5086
|
box-sizing: border-box;
|
|
4570
5087
|
}
|
|
4571
5088
|
|
|
@@ -4652,9 +5169,9 @@ class Spinner extends i$1 {
|
|
|
4652
5169
|
`;
|
|
4653
5170
|
}
|
|
4654
5171
|
}
|
|
4655
|
-
Spinner.styles = [css_248z$
|
|
5172
|
+
Spinner.styles = [css_248z$k];
|
|
4656
5173
|
|
|
4657
|
-
var css_248z$
|
|
5174
|
+
var css_248z$j = i`* {
|
|
4658
5175
|
box-sizing: border-box;
|
|
4659
5176
|
}
|
|
4660
5177
|
|
|
@@ -4772,12 +5289,12 @@ class Container extends i$1 {
|
|
|
4772
5289
|
`;
|
|
4773
5290
|
}
|
|
4774
5291
|
}
|
|
4775
|
-
Container.styles = [css_248z$
|
|
5292
|
+
Container.styles = [css_248z$j];
|
|
4776
5293
|
__decorate([
|
|
4777
5294
|
n({ type: String, reflect: true })
|
|
4778
5295
|
], Container.prototype, "size", void 0);
|
|
4779
5296
|
|
|
4780
|
-
var css_248z$
|
|
5297
|
+
var css_248z$i = i`* {
|
|
4781
5298
|
box-sizing: border-box;
|
|
4782
5299
|
}
|
|
4783
5300
|
|
|
@@ -4933,7 +5450,7 @@ class EmptyState extends i$1 {
|
|
|
4933
5450
|
}
|
|
4934
5451
|
}
|
|
4935
5452
|
// Lit handles styles in a static property for better performance
|
|
4936
|
-
EmptyState.styles = [css_248z$
|
|
5453
|
+
EmptyState.styles = [css_248z$i];
|
|
4937
5454
|
__decorate([
|
|
4938
5455
|
n({ type: String, reflect: true })
|
|
4939
5456
|
], EmptyState.prototype, "illustration", void 0);
|
|
@@ -4947,7 +5464,7 @@ __decorate([
|
|
|
4947
5464
|
r()
|
|
4948
5465
|
], EmptyState.prototype, "vertical", void 0);
|
|
4949
5466
|
|
|
4950
|
-
var css_248z$
|
|
5467
|
+
var css_248z$h = i`* {
|
|
4951
5468
|
box-sizing: border-box;
|
|
4952
5469
|
}
|
|
4953
5470
|
|
|
@@ -6773,7 +7290,7 @@ class Tooltip extends i$1 {
|
|
|
6773
7290
|
`;
|
|
6774
7291
|
}
|
|
6775
7292
|
}
|
|
6776
|
-
Tooltip.styles = [css_248z$
|
|
7293
|
+
Tooltip.styles = [css_248z$h];
|
|
6777
7294
|
Tooltip.CLOSE_OTHERS_EVENT = 'tooltip--open';
|
|
6778
7295
|
__decorate([
|
|
6779
7296
|
n()
|
|
@@ -6797,7 +7314,7 @@ __decorate([
|
|
|
6797
7314
|
e$4('#tooltip')
|
|
6798
7315
|
], Tooltip.prototype, "floatingEl", void 0);
|
|
6799
7316
|
|
|
6800
|
-
var css_248z$
|
|
7317
|
+
var css_248z$g = i`* {
|
|
6801
7318
|
box-sizing: border-box;
|
|
6802
7319
|
}
|
|
6803
7320
|
|
|
@@ -6839,7 +7356,7 @@ ol {
|
|
|
6839
7356
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
6840
7357
|
*/const o=o=>o??A;
|
|
6841
7358
|
|
|
6842
|
-
var css_248z$
|
|
7359
|
+
var css_248z$f = i`* {
|
|
6843
7360
|
box-sizing: border-box;
|
|
6844
7361
|
}
|
|
6845
7362
|
|
|
@@ -6969,7 +7486,7 @@ class BreadcrumbItem extends i$1 {
|
|
|
6969
7486
|
`;
|
|
6970
7487
|
}
|
|
6971
7488
|
}
|
|
6972
|
-
BreadcrumbItem.styles = [css_248z$
|
|
7489
|
+
BreadcrumbItem.styles = [css_248z$f];
|
|
6973
7490
|
__decorate([
|
|
6974
7491
|
n({ reflect: true })
|
|
6975
7492
|
], BreadcrumbItem.prototype, "href", void 0);
|
|
@@ -7023,13 +7540,13 @@ class Breadcrumb extends i$1 {
|
|
|
7023
7540
|
</nav>`;
|
|
7024
7541
|
}
|
|
7025
7542
|
}
|
|
7026
|
-
Breadcrumb.styles = [css_248z$
|
|
7543
|
+
Breadcrumb.styles = [css_248z$g];
|
|
7027
7544
|
Breadcrumb.Item = BreadcrumbItem;
|
|
7028
7545
|
__decorate([
|
|
7029
7546
|
n({ type: String })
|
|
7030
7547
|
], Breadcrumb.prototype, "label", void 0);
|
|
7031
7548
|
|
|
7032
|
-
var css_248z$
|
|
7549
|
+
var css_248z$e = i`* {
|
|
7033
7550
|
box-sizing: border-box;
|
|
7034
7551
|
}
|
|
7035
7552
|
|
|
@@ -7113,7 +7630,7 @@ var css_248z$d = i`* {
|
|
|
7113
7630
|
--_container-color: var(--color-tertiary-container);
|
|
7114
7631
|
}`;
|
|
7115
7632
|
|
|
7116
|
-
var css_248z$
|
|
7633
|
+
var css_248z$d = i`* {
|
|
7117
7634
|
box-sizing: border-box;
|
|
7118
7635
|
}
|
|
7119
7636
|
|
|
@@ -7224,7 +7741,7 @@ var css_248z$c = i`* {
|
|
|
7224
7741
|
display: none;
|
|
7225
7742
|
}`;
|
|
7226
7743
|
|
|
7227
|
-
var css_248z$
|
|
7744
|
+
var css_248z$c = i`:host-context([variant=standard]) {
|
|
7228
7745
|
--menu-item-label-color: var(--color-on-surface-variant);
|
|
7229
7746
|
--menu-item-label-selected-color: var(--color-on-tertiary-container);
|
|
7230
7747
|
--menu-item-container-selected-color: var(--color-tertiary-container);
|
|
@@ -7240,7 +7757,7 @@ var css_248z$b = i`:host-context([variant=standard]) {
|
|
|
7240
7757
|
* @label Menu Item
|
|
7241
7758
|
* @tag wc-menu-item
|
|
7242
7759
|
* @rawTag menu-item
|
|
7243
|
-
* @parentRawTag menu
|
|
7760
|
+
* @parentRawTag menu
|
|
7244
7761
|
* @summary An item in a menu list.
|
|
7245
7762
|
* @tags navigation
|
|
7246
7763
|
*
|
|
@@ -7392,7 +7909,7 @@ class MenuItem extends i$1 {
|
|
|
7392
7909
|
`;
|
|
7393
7910
|
}
|
|
7394
7911
|
}
|
|
7395
|
-
MenuItem.styles = [css_248z$
|
|
7912
|
+
MenuItem.styles = [css_248z$d, css_248z$c];
|
|
7396
7913
|
__decorate([
|
|
7397
7914
|
n({ type: Boolean, reflect: true })
|
|
7398
7915
|
], MenuItem.prototype, "disabled", void 0);
|
|
@@ -7792,7 +8309,7 @@ class Menu extends i$1 {
|
|
|
7792
8309
|
</div>`;
|
|
7793
8310
|
}
|
|
7794
8311
|
}
|
|
7795
|
-
Menu.styles = [css_248z$
|
|
8312
|
+
Menu.styles = [css_248z$e];
|
|
7796
8313
|
Menu.Item = MenuItem;
|
|
7797
8314
|
__decorate([
|
|
7798
8315
|
n({ type: Boolean, reflect: true })
|
|
@@ -7825,7 +8342,7 @@ __decorate([
|
|
|
7825
8342
|
e$4('.menu')
|
|
7826
8343
|
], Menu.prototype, "menuListElement", void 0);
|
|
7827
8344
|
|
|
7828
|
-
var css_248z$
|
|
8345
|
+
var css_248z$b = i`* {
|
|
7829
8346
|
box-sizing: border-box;
|
|
7830
8347
|
}
|
|
7831
8348
|
|
|
@@ -8019,7 +8536,7 @@ class SubMenu extends i$1 {
|
|
|
8019
8536
|
`;
|
|
8020
8537
|
}
|
|
8021
8538
|
}
|
|
8022
|
-
SubMenu.styles = [css_248z$
|
|
8539
|
+
SubMenu.styles = [css_248z$b];
|
|
8023
8540
|
__decorate([
|
|
8024
8541
|
n({ type: Number, attribute: 'hover-open-delay' })
|
|
8025
8542
|
], SubMenu.prototype, "hoverOpenDelay", void 0);
|
|
@@ -8039,7 +8556,7 @@ __decorate([
|
|
|
8039
8556
|
o$2({ slot: 'menu' })
|
|
8040
8557
|
], SubMenu.prototype, "_menus", void 0);
|
|
8041
8558
|
|
|
8042
|
-
var css_248z$
|
|
8559
|
+
var css_248z$a = i`@charset "UTF-8";
|
|
8043
8560
|
:host {
|
|
8044
8561
|
display: block;
|
|
8045
8562
|
height: 100%;
|
|
@@ -8196,7 +8713,7 @@ class Image extends i$1 {
|
|
|
8196
8713
|
`;
|
|
8197
8714
|
}
|
|
8198
8715
|
}
|
|
8199
|
-
Image.styles = [css_248z$
|
|
8716
|
+
Image.styles = [css_248z$a];
|
|
8200
8717
|
__decorate([
|
|
8201
8718
|
n({ reflect: true })
|
|
8202
8719
|
], Image.prototype, "src", void 0);
|
|
@@ -8219,7 +8736,7 @@ __decorate([
|
|
|
8219
8736
|
r()
|
|
8220
8737
|
], Image.prototype, "_previewOpen", void 0);
|
|
8221
8738
|
|
|
8222
|
-
var css_248z$
|
|
8739
|
+
var css_248z$9 = i`* {
|
|
8223
8740
|
box-sizing: border-box;
|
|
8224
8741
|
}
|
|
8225
8742
|
|
|
@@ -8263,7 +8780,7 @@ var css_248z$8 = i`* {
|
|
|
8263
8780
|
display: flex;
|
|
8264
8781
|
align-items: center;
|
|
8265
8782
|
justify-content: center;
|
|
8266
|
-
gap:
|
|
8783
|
+
gap: 0;
|
|
8267
8784
|
width: 100%;
|
|
8268
8785
|
height: 100%;
|
|
8269
8786
|
z-index: 0;
|
|
@@ -8275,6 +8792,20 @@ var css_248z$8 = i`* {
|
|
|
8275
8792
|
.tab .tab-content .slot-container {
|
|
8276
8793
|
display: none;
|
|
8277
8794
|
}
|
|
8795
|
+
.tab .tab-content ::slotted([slot=icon]) {
|
|
8796
|
+
flex: none;
|
|
8797
|
+
color: var(--_label-text-color);
|
|
8798
|
+
--icon-size: var(--tab-icon-size, var(--_tab-icon-size));
|
|
8799
|
+
--icon-color: var(--_label-text-color);
|
|
8800
|
+
}
|
|
8801
|
+
.tab .tab-content ::slotted([slot=badge]) {
|
|
8802
|
+
flex: none;
|
|
8803
|
+
margin-inline-start: var(--_tab-badge-label-spacing, 0);
|
|
8804
|
+
--badge-color: var(--_tab-badge-color, var(--color-error));
|
|
8805
|
+
}
|
|
8806
|
+
.tab.has-icon .tab-content {
|
|
8807
|
+
gap: var(--_tab-icon-label-spacing);
|
|
8808
|
+
}
|
|
8278
8809
|
.tab .indicator {
|
|
8279
8810
|
position: absolute;
|
|
8280
8811
|
pointer-events: none;
|
|
@@ -8330,6 +8861,10 @@ var css_248z$8 = i`* {
|
|
|
8330
8861
|
:host-context([variant=line]) .tab {
|
|
8331
8862
|
--_tab-height: 100%;
|
|
8332
8863
|
--_container-padding: 1rem;
|
|
8864
|
+
--_tab-icon-size: 1.5rem;
|
|
8865
|
+
--_tab-icon-label-spacing: 0.5rem;
|
|
8866
|
+
--_tab-badge-label-spacing: 0.25rem;
|
|
8867
|
+
--_tab-badge-color: var(--color-error);
|
|
8333
8868
|
--_label-text-color: var(--color-on-surface);
|
|
8334
8869
|
--_container-state-color: var(--_label-text-color);
|
|
8335
8870
|
--_container-shape-start-start: var(--shape-corner-small);
|
|
@@ -8338,7 +8873,7 @@ var css_248z$8 = i`* {
|
|
|
8338
8873
|
--_container-shape-end-end: var(--shape-corner-small);
|
|
8339
8874
|
--_active-indicator-color: var(--color-primary);
|
|
8340
8875
|
--_active-indicator-shape: 3px 3px 0 0;
|
|
8341
|
-
--_active-indicator-height:
|
|
8876
|
+
--_active-indicator-height: 3px;
|
|
8342
8877
|
}
|
|
8343
8878
|
:host-context([variant=line]) .tab .focus-ring {
|
|
8344
8879
|
inset: 3px 3px 4px 3px;
|
|
@@ -8361,6 +8896,46 @@ var css_248z$8 = i`* {
|
|
|
8361
8896
|
}
|
|
8362
8897
|
:host-context([variant=line]) .tab.disabled .ripple {
|
|
8363
8898
|
display: none;
|
|
8899
|
+
}
|
|
8900
|
+
|
|
8901
|
+
:host-context([variant=line-secondary]) .tab {
|
|
8902
|
+
--_tab-height: 100%;
|
|
8903
|
+
--_container-padding: 1rem;
|
|
8904
|
+
--_tab-icon-size: 1.25rem;
|
|
8905
|
+
--_tab-icon-label-spacing: 0.5rem;
|
|
8906
|
+
--_tab-badge-label-spacing: 0.25rem;
|
|
8907
|
+
--_tab-badge-color: var(--color-error);
|
|
8908
|
+
--_label-text-color: var(--color-on-surface);
|
|
8909
|
+
--_container-state-color: var(--_label-text-color);
|
|
8910
|
+
--_container-shape-start-start: var(--shape-corner-small);
|
|
8911
|
+
--_container-shape-start-end: var(--shape-corner-small);
|
|
8912
|
+
--_container-shape-end-start: var(--shape-corner-small);
|
|
8913
|
+
--_container-shape-end-end: var(--shape-corner-small);
|
|
8914
|
+
--_active-indicator-color: var(--color-primary);
|
|
8915
|
+
--_active-indicator-shape: 0;
|
|
8916
|
+
--_active-indicator-height: 2px;
|
|
8917
|
+
}
|
|
8918
|
+
:host-context([variant=line-secondary]) .tab .focus-ring {
|
|
8919
|
+
inset: 3px 3px 4px 3px;
|
|
8920
|
+
}
|
|
8921
|
+
:host-context([variant=line-secondary]) .tab.active .indicator.secondary {
|
|
8922
|
+
opacity: 1;
|
|
8923
|
+
}
|
|
8924
|
+
:host-context([variant=line-secondary]) .tab.active .focus-ring {
|
|
8925
|
+
inset: 3px 3px calc(4px + var(--_active-indicator-height)) 3px;
|
|
8926
|
+
}
|
|
8927
|
+
:host-context([variant=line-secondary]) .tab:hover:not(:where(.disabled)) {
|
|
8928
|
+
--_container-state-opacity: 0.08;
|
|
8929
|
+
}
|
|
8930
|
+
:host-context([variant=line-secondary]) .tab.pressed:not(:where(.disabled)) {
|
|
8931
|
+
--_container-state-opacity: 0.12;
|
|
8932
|
+
}
|
|
8933
|
+
:host-context([variant=line-secondary]) .tab.disabled {
|
|
8934
|
+
--_label-text-color: var(--color-on-surface);
|
|
8935
|
+
--_label-text-opacity: 0.38;
|
|
8936
|
+
}
|
|
8937
|
+
:host-context([variant=line-secondary]) .tab.disabled .ripple {
|
|
8938
|
+
display: none;
|
|
8364
8939
|
}`;
|
|
8365
8940
|
|
|
8366
8941
|
var _Tab_id;
|
|
@@ -8403,6 +8978,8 @@ class Tab extends i$1 {
|
|
|
8403
8978
|
this.throttleDelay = 200;
|
|
8404
8979
|
this.hasFocus = false;
|
|
8405
8980
|
this.slotHasContent = false;
|
|
8981
|
+
this.slotHasIcon = false;
|
|
8982
|
+
this.slotHasBadge = false;
|
|
8406
8983
|
/**
|
|
8407
8984
|
* States
|
|
8408
8985
|
*/
|
|
@@ -8449,6 +9026,14 @@ class Tab extends i$1 {
|
|
|
8449
9026
|
this.slotHasContent = hasContent;
|
|
8450
9027
|
this.requestUpdate();
|
|
8451
9028
|
});
|
|
9029
|
+
observerSlotChangesWithCallback(this.renderRoot.querySelector('slot[name="icon"]'), hasContent => {
|
|
9030
|
+
this.slotHasIcon = hasContent;
|
|
9031
|
+
this.requestUpdate();
|
|
9032
|
+
});
|
|
9033
|
+
observerSlotChangesWithCallback(this.renderRoot.querySelector('slot[name="badge"]'), hasContent => {
|
|
9034
|
+
this.slotHasBadge = hasContent;
|
|
9035
|
+
this.requestUpdate();
|
|
9036
|
+
});
|
|
8452
9037
|
}
|
|
8453
9038
|
__isLink() {
|
|
8454
9039
|
return !!this.href;
|
|
@@ -8469,7 +9054,9 @@ class Tab extends i$1 {
|
|
|
8469
9054
|
disabled: this.disabled,
|
|
8470
9055
|
pressed: this.isPressed,
|
|
8471
9056
|
active: this.active,
|
|
8472
|
-
'has-content': this.slotHasContent
|
|
9057
|
+
'has-content': this.slotHasContent || !!this.label,
|
|
9058
|
+
'has-icon': this.slotHasIcon,
|
|
9059
|
+
'has-badge': this.slotHasBadge,
|
|
8473
9060
|
};
|
|
8474
9061
|
if (!isLink) {
|
|
8475
9062
|
return b `<button
|
|
@@ -8512,16 +9099,18 @@ class Tab extends i$1 {
|
|
|
8512
9099
|
<wc-ripple class="ripple"></wc-ripple>
|
|
8513
9100
|
|
|
8514
9101
|
<div class="tab-content">
|
|
9102
|
+
<slot name="icon"></slot>
|
|
9103
|
+
|
|
8515
9104
|
<div class="slot-container">
|
|
8516
|
-
<slot
|
|
9105
|
+
<slot>${this.label || A}</slot>
|
|
8517
9106
|
</div>
|
|
8518
9107
|
|
|
8519
|
-
<slot name="
|
|
9108
|
+
<slot name="badge"></slot>
|
|
8520
9109
|
|
|
8521
9110
|
<div class="indicator"></div>
|
|
8522
9111
|
</div>
|
|
8523
9112
|
|
|
8524
|
-
<div class="indicator"></div>
|
|
9113
|
+
<div class="secondary indicator"></div>
|
|
8525
9114
|
|
|
8526
9115
|
${this.__renderDisabledReason()}
|
|
8527
9116
|
`;
|
|
@@ -8546,7 +9135,7 @@ class Tab extends i$1 {
|
|
|
8546
9135
|
}
|
|
8547
9136
|
}
|
|
8548
9137
|
_Tab_id = new WeakMap();
|
|
8549
|
-
Tab.styles = [css_248z$
|
|
9138
|
+
Tab.styles = [css_248z$9];
|
|
8550
9139
|
__decorate([
|
|
8551
9140
|
n({ type: Boolean, reflect: true })
|
|
8552
9141
|
], Tab.prototype, "active", void 0);
|
|
@@ -8556,9 +9145,6 @@ __decorate([
|
|
|
8556
9145
|
__decorate([
|
|
8557
9146
|
n({ type: String })
|
|
8558
9147
|
], Tab.prototype, "disabledReason", void 0);
|
|
8559
|
-
__decorate([
|
|
8560
|
-
n({ type: String })
|
|
8561
|
-
], Tab.prototype, "icon", void 0);
|
|
8562
9148
|
__decorate([
|
|
8563
9149
|
n({ type: String })
|
|
8564
9150
|
], Tab.prototype, "label", void 0);
|
|
@@ -8583,6 +9169,12 @@ __decorate([
|
|
|
8583
9169
|
__decorate([
|
|
8584
9170
|
r()
|
|
8585
9171
|
], Tab.prototype, "slotHasContent", void 0);
|
|
9172
|
+
__decorate([
|
|
9173
|
+
r()
|
|
9174
|
+
], Tab.prototype, "slotHasIcon", void 0);
|
|
9175
|
+
__decorate([
|
|
9176
|
+
r()
|
|
9177
|
+
], Tab.prototype, "slotHasBadge", void 0);
|
|
8586
9178
|
__decorate([
|
|
8587
9179
|
r()
|
|
8588
9180
|
], Tab.prototype, "isPressed", void 0);
|
|
@@ -8590,7 +9182,7 @@ __decorate([
|
|
|
8590
9182
|
e$4('.tab-element')
|
|
8591
9183
|
], Tab.prototype, "tabElement", void 0);
|
|
8592
9184
|
|
|
8593
|
-
var css_248z$
|
|
9185
|
+
var css_248z$8 = i`* {
|
|
8594
9186
|
box-sizing: border-box;
|
|
8595
9187
|
}
|
|
8596
9188
|
|
|
@@ -8604,7 +9196,7 @@ var css_248z$7 = i`* {
|
|
|
8604
9196
|
height: 100%;
|
|
8605
9197
|
}`;
|
|
8606
9198
|
|
|
8607
|
-
var css_248z$
|
|
9199
|
+
var css_248z$7 = i`* {
|
|
8608
9200
|
box-sizing: border-box;
|
|
8609
9201
|
}
|
|
8610
9202
|
|
|
@@ -8656,11 +9248,23 @@ class Tabs extends i$1 {
|
|
|
8656
9248
|
const clickedTab = path.find(node => node instanceof Element && node.tagName.toLowerCase() === 'wc-tab');
|
|
8657
9249
|
if (!clickedTab)
|
|
8658
9250
|
return;
|
|
8659
|
-
const tabs = this.querySelectorAll('wc-tab');
|
|
8660
|
-
|
|
9251
|
+
const tabs = Array.from(this.querySelectorAll('wc-tab'));
|
|
9252
|
+
let clickedIndex = -1;
|
|
9253
|
+
for (let index = 0; index < tabs.length; index += 1) {
|
|
9254
|
+
const tab = tabs[index];
|
|
8661
9255
|
tab.active = false;
|
|
8662
|
-
|
|
9256
|
+
if (tab === clickedTab)
|
|
9257
|
+
clickedIndex = index;
|
|
9258
|
+
}
|
|
8663
9259
|
clickedTab.active = true;
|
|
9260
|
+
this.dispatchEvent(new CustomEvent('tab-click', {
|
|
9261
|
+
bubbles: true,
|
|
9262
|
+
composed: true,
|
|
9263
|
+
detail: {
|
|
9264
|
+
index: clickedIndex,
|
|
9265
|
+
value: clickedTab.value,
|
|
9266
|
+
},
|
|
9267
|
+
}));
|
|
8664
9268
|
};
|
|
8665
9269
|
}
|
|
8666
9270
|
connectedCallback() {
|
|
@@ -8679,13 +9283,13 @@ class Tabs extends i$1 {
|
|
|
8679
9283
|
`;
|
|
8680
9284
|
}
|
|
8681
9285
|
}
|
|
8682
|
-
Tabs.styles = [css_248z$
|
|
9286
|
+
Tabs.styles = [css_248z$7];
|
|
8683
9287
|
Tabs.Tab = Tab;
|
|
8684
9288
|
__decorate([
|
|
8685
9289
|
n({ type: Boolean })
|
|
8686
9290
|
], Tabs.prototype, "managed", void 0);
|
|
8687
9291
|
|
|
8688
|
-
var css_248z$
|
|
9292
|
+
var css_248z$6 = i`* {
|
|
8689
9293
|
box-sizing: border-box;
|
|
8690
9294
|
}
|
|
8691
9295
|
|
|
@@ -8694,12 +9298,12 @@ var css_248z$5 = i`* {
|
|
|
8694
9298
|
}
|
|
8695
9299
|
|
|
8696
9300
|
:host {
|
|
8697
|
-
display:
|
|
9301
|
+
display: none;
|
|
8698
9302
|
flex: 1;
|
|
8699
9303
|
}
|
|
8700
9304
|
|
|
8701
|
-
:host([
|
|
8702
|
-
display:
|
|
9305
|
+
:host([active]) {
|
|
9306
|
+
display: block;
|
|
8703
9307
|
}`;
|
|
8704
9308
|
|
|
8705
9309
|
/**
|
|
@@ -8719,14 +9323,21 @@ var css_248z$5 = i`* {
|
|
|
8719
9323
|
* @tags navigation
|
|
8720
9324
|
*/
|
|
8721
9325
|
class TabPanel extends i$1 {
|
|
9326
|
+
constructor() {
|
|
9327
|
+
super(...arguments);
|
|
9328
|
+
this.active = false;
|
|
9329
|
+
}
|
|
8722
9330
|
render() {
|
|
8723
9331
|
return b `<slot></slot>`;
|
|
8724
9332
|
}
|
|
8725
9333
|
}
|
|
8726
|
-
TabPanel.styles = [css_248z$
|
|
9334
|
+
TabPanel.styles = [css_248z$6];
|
|
8727
9335
|
__decorate([
|
|
8728
9336
|
n({ reflect: true })
|
|
8729
9337
|
], TabPanel.prototype, "value", void 0);
|
|
9338
|
+
__decorate([
|
|
9339
|
+
n({ type: Boolean, reflect: true })
|
|
9340
|
+
], TabPanel.prototype, "active", void 0);
|
|
8730
9341
|
|
|
8731
9342
|
/**
|
|
8732
9343
|
* @label Tab Group
|
|
@@ -8756,7 +9367,6 @@ class TabGroup extends i$1 {
|
|
|
8756
9367
|
constructor() {
|
|
8757
9368
|
super(...arguments);
|
|
8758
9369
|
this.variant = 'line';
|
|
8759
|
-
this.uid = crypto.randomUUID();
|
|
8760
9370
|
this.onTabClick = (event) => {
|
|
8761
9371
|
const custom = event;
|
|
8762
9372
|
event.stopPropagation();
|
|
@@ -8764,6 +9374,9 @@ class TabGroup extends i$1 {
|
|
|
8764
9374
|
if (targetValue) {
|
|
8765
9375
|
this.selectTab(targetValue);
|
|
8766
9376
|
}
|
|
9377
|
+
else if (typeof custom.detail?.index === 'number') {
|
|
9378
|
+
this.selectTabByIndex(custom.detail.index);
|
|
9379
|
+
}
|
|
8767
9380
|
};
|
|
8768
9381
|
}
|
|
8769
9382
|
connectedCallback() {
|
|
@@ -8779,10 +9392,11 @@ class TabGroup extends i$1 {
|
|
|
8779
9392
|
}
|
|
8780
9393
|
selectTab(target) {
|
|
8781
9394
|
const tabs = this.getTabs();
|
|
8782
|
-
|
|
9395
|
+
for (const tab of tabs) {
|
|
9396
|
+
tab.active = false;
|
|
8783
9397
|
tab.selected = false;
|
|
8784
9398
|
tab.classList.remove('previous-tab', 'next-tab');
|
|
8785
|
-
}
|
|
9399
|
+
}
|
|
8786
9400
|
let selectedIndex = -1;
|
|
8787
9401
|
tabs.forEach((tab, index) => {
|
|
8788
9402
|
const t = tab.getAttribute('target') || tab.getAttribute('value');
|
|
@@ -8792,6 +9406,7 @@ class TabGroup extends i$1 {
|
|
|
8792
9406
|
});
|
|
8793
9407
|
if (selectedIndex >= 0) {
|
|
8794
9408
|
const selectedTab = tabs[selectedIndex];
|
|
9409
|
+
selectedTab.active = true;
|
|
8795
9410
|
selectedTab.selected = true;
|
|
8796
9411
|
if (tabs[selectedIndex - 1]) {
|
|
8797
9412
|
tabs[selectedIndex - 1].classList.add('previous-tab');
|
|
@@ -8801,59 +9416,83 @@ class TabGroup extends i$1 {
|
|
|
8801
9416
|
}
|
|
8802
9417
|
}
|
|
8803
9418
|
const panels = this.getTabPanels();
|
|
8804
|
-
|
|
9419
|
+
for (const panel of panels) {
|
|
8805
9420
|
const panelValue = panel.getAttribute('value');
|
|
8806
9421
|
panel.active = panelValue === target;
|
|
8807
|
-
}
|
|
9422
|
+
}
|
|
9423
|
+
}
|
|
9424
|
+
selectTabByIndex(index) {
|
|
9425
|
+
const tabs = this.getTabs();
|
|
9426
|
+
for (const tab of tabs) {
|
|
9427
|
+
tab.active = false;
|
|
9428
|
+
tab.selected = false;
|
|
9429
|
+
tab.classList.remove('previous-tab', 'next-tab');
|
|
9430
|
+
}
|
|
9431
|
+
if (index >= 0 && index < tabs.length) {
|
|
9432
|
+
tabs[index].active = true;
|
|
9433
|
+
tabs[index].selected = true;
|
|
9434
|
+
if (tabs[index - 1])
|
|
9435
|
+
tabs[index - 1].classList.add('previous-tab');
|
|
9436
|
+
if (tabs[index + 1])
|
|
9437
|
+
tabs[index + 1].classList.add('next-tab');
|
|
9438
|
+
}
|
|
9439
|
+
const panels = this.getTabPanels();
|
|
9440
|
+
for (let i = 0; i < panels.length; i += 1) {
|
|
9441
|
+
const panel = panels[i];
|
|
9442
|
+
panel.active = i === index;
|
|
9443
|
+
}
|
|
8808
9444
|
}
|
|
8809
9445
|
getTabs() {
|
|
8810
|
-
return this.querySelectorAll(':scope > tabs
|
|
9446
|
+
return Array.from(this.querySelectorAll(':scope > wc-tabs wc-tab'));
|
|
8811
9447
|
}
|
|
8812
9448
|
getTabPanels() {
|
|
8813
|
-
return this.querySelectorAll(':scope > wc-tab-panel');
|
|
9449
|
+
return Array.from(this.querySelectorAll(':scope > wc-tab-panel'));
|
|
8814
9450
|
}
|
|
8815
9451
|
getTabList() {
|
|
8816
|
-
return this.querySelector(':scope > tabs
|
|
9452
|
+
return this.querySelector(':scope > wc-tabs');
|
|
8817
9453
|
}
|
|
8818
9454
|
tabsHaveTarget() {
|
|
8819
|
-
return !!this.querySelector(':scope > tabs
|
|
9455
|
+
return !!this.querySelector(':scope > wc-tabs wc-tab[target]');
|
|
8820
9456
|
}
|
|
8821
9457
|
initializeTabs() {
|
|
8822
9458
|
const tabs = Array.from(this.getTabs());
|
|
8823
9459
|
if (!this.tabsHaveTarget()) {
|
|
8824
|
-
|
|
8825
|
-
|
|
8826
|
-
|
|
8827
|
-
|
|
8828
|
-
|
|
8829
|
-
|
|
8830
|
-
const firstTarget = tabs[0].getAttribute('target');
|
|
8831
|
-
if (firstTarget) {
|
|
8832
|
-
this.selectTab(firstTarget);
|
|
8833
|
-
}
|
|
8834
|
-
}
|
|
9460
|
+
// No target/value attributes — use index-based activation
|
|
9461
|
+
const selectedIndex = tabs.findIndex(tab => tab.hasAttribute('active') ||
|
|
9462
|
+
tab.active ||
|
|
9463
|
+
tab.hasAttribute('selected') ||
|
|
9464
|
+
tab.selected);
|
|
9465
|
+
this.selectTabByIndex(selectedIndex >= 0 ? selectedIndex : 0);
|
|
8835
9466
|
}
|
|
8836
9467
|
else {
|
|
8837
|
-
const selectedTab =
|
|
9468
|
+
const selectedTab = tabs.find(tab => tab.hasAttribute('active') ||
|
|
9469
|
+
tab.active ||
|
|
9470
|
+
tab.hasAttribute('selected') ||
|
|
9471
|
+
tab.selected);
|
|
8838
9472
|
if (selectedTab) {
|
|
8839
9473
|
const selectedTarget = selectedTab.getAttribute('target');
|
|
8840
9474
|
if (selectedTarget)
|
|
8841
9475
|
this.selectTab(selectedTarget);
|
|
8842
9476
|
}
|
|
9477
|
+
else if (tabs.length > 0) {
|
|
9478
|
+
const firstTarget = tabs[0].getAttribute('target');
|
|
9479
|
+
if (firstTarget)
|
|
9480
|
+
this.selectTab(firstTarget);
|
|
9481
|
+
}
|
|
8843
9482
|
}
|
|
8844
9483
|
}
|
|
8845
9484
|
render() {
|
|
8846
9485
|
return b `<slot></slot>`;
|
|
8847
9486
|
}
|
|
8848
9487
|
}
|
|
8849
|
-
TabGroup.styles = [css_248z$
|
|
9488
|
+
TabGroup.styles = [css_248z$8];
|
|
8850
9489
|
TabGroup.Tabs = Tabs;
|
|
8851
9490
|
TabGroup.TabPanel = TabPanel;
|
|
8852
9491
|
__decorate([
|
|
8853
9492
|
n({ reflect: true })
|
|
8854
9493
|
], TabGroup.prototype, "variant", void 0);
|
|
8855
9494
|
|
|
8856
|
-
var css_248z$
|
|
9495
|
+
var css_248z$5 = i`:host {
|
|
8857
9496
|
--_track-height: 4px;
|
|
8858
9497
|
--_thumb-size: 20px;
|
|
8859
9498
|
--thumb-half: 10px;
|
|
@@ -9126,7 +9765,7 @@ class Slider extends i$1 {
|
|
|
9126
9765
|
`;
|
|
9127
9766
|
}
|
|
9128
9767
|
}
|
|
9129
|
-
Slider.styles = [css_248z$
|
|
9768
|
+
Slider.styles = [css_248z$5];
|
|
9130
9769
|
__decorate([
|
|
9131
9770
|
n({ type: Number })
|
|
9132
9771
|
], Slider.prototype, "min", void 0);
|
|
@@ -9155,7 +9794,7 @@ __decorate([
|
|
|
9155
9794
|
e$4('.thumb')
|
|
9156
9795
|
], Slider.prototype, "thumbElement", void 0);
|
|
9157
9796
|
|
|
9158
|
-
var css_248z$
|
|
9797
|
+
var css_248z$4 = i`* {
|
|
9159
9798
|
box-sizing: border-box;
|
|
9160
9799
|
}
|
|
9161
9800
|
|
|
@@ -9689,7 +10328,7 @@ class Table extends i$1 {
|
|
|
9689
10328
|
`;
|
|
9690
10329
|
}
|
|
9691
10330
|
}
|
|
9692
|
-
Table.styles = [css_248z$
|
|
10331
|
+
Table.styles = [css_248z$4];
|
|
9693
10332
|
__decorate([
|
|
9694
10333
|
n({ type: Array })
|
|
9695
10334
|
], Table.prototype, "columns", void 0);
|
|
@@ -9748,7 +10387,7 @@ __decorate([
|
|
|
9748
10387
|
r()
|
|
9749
10388
|
], Table.prototype, "isHorizontallyScrolled", void 0);
|
|
9750
10389
|
|
|
9751
|
-
var css_248z$
|
|
10390
|
+
var css_248z$3 = i`* {
|
|
9752
10391
|
box-sizing: border-box;
|
|
9753
10392
|
}
|
|
9754
10393
|
|
|
@@ -9930,7 +10569,7 @@ class Pagination extends i$1 {
|
|
|
9930
10569
|
`;
|
|
9931
10570
|
}
|
|
9932
10571
|
}
|
|
9933
|
-
Pagination.styles = [css_248z$
|
|
10572
|
+
Pagination.styles = [css_248z$3];
|
|
9934
10573
|
__decorate([
|
|
9935
10574
|
n({ type: Number })
|
|
9936
10575
|
], Pagination.prototype, "page", void 0);
|
|
@@ -9944,7 +10583,7 @@ __decorate([
|
|
|
9944
10583
|
n({ type: Array, attribute: 'page-sizes' })
|
|
9945
10584
|
], Pagination.prototype, "pageSizes", void 0);
|
|
9946
10585
|
|
|
9947
|
-
var css_248z$
|
|
10586
|
+
var css_248z$2 = i`* {
|
|
9948
10587
|
box-sizing: border-box;
|
|
9949
10588
|
}
|
|
9950
10589
|
|
|
@@ -10259,7 +10898,7 @@ class TreeNode extends i$1 {
|
|
|
10259
10898
|
</div>`;
|
|
10260
10899
|
}
|
|
10261
10900
|
}
|
|
10262
|
-
TreeNode.styles = [css_248z$
|
|
10901
|
+
TreeNode.styles = [css_248z$2];
|
|
10263
10902
|
__decorate([
|
|
10264
10903
|
n({ type: String, reflect: true })
|
|
10265
10904
|
], TreeNode.prototype, "value", void 0);
|
|
@@ -10291,7 +10930,7 @@ __decorate([
|
|
|
10291
10930
|
e$4('.tree-node-content')
|
|
10292
10931
|
], TreeNode.prototype, "_nativeElement", void 0);
|
|
10293
10932
|
|
|
10294
|
-
var css_248z = i`* {
|
|
10933
|
+
var css_248z$1 = i`* {
|
|
10295
10934
|
box-sizing: border-box;
|
|
10296
10935
|
}
|
|
10297
10936
|
|
|
@@ -10454,11 +11093,234 @@ class TreeView extends i$1 {
|
|
|
10454
11093
|
</div>`;
|
|
10455
11094
|
}
|
|
10456
11095
|
}
|
|
10457
|
-
TreeView.styles = [css_248z];
|
|
11096
|
+
TreeView.styles = [css_248z$1];
|
|
10458
11097
|
TreeView.Node = TreeNode;
|
|
10459
11098
|
__decorate([
|
|
10460
11099
|
n({ type: String, attribute: 'selected-node', reflect: true })
|
|
10461
11100
|
], TreeView.prototype, "selectedNode", void 0);
|
|
10462
11101
|
|
|
10463
|
-
|
|
10464
|
-
|
|
11102
|
+
var css_248z = i`* {
|
|
11103
|
+
box-sizing: border-box;
|
|
11104
|
+
}
|
|
11105
|
+
|
|
11106
|
+
.screen-reader-only {
|
|
11107
|
+
display: none !important;
|
|
11108
|
+
}
|
|
11109
|
+
|
|
11110
|
+
:host {
|
|
11111
|
+
display: inline-flex;
|
|
11112
|
+
max-width: 42rem;
|
|
11113
|
+
min-width: 21.5rem;
|
|
11114
|
+
--snackbar-container-color: var(--color-inverse-surface);
|
|
11115
|
+
--snackbar-label-text-color: var(--color-inverse-on-surface);
|
|
11116
|
+
--snackbar-action-text-color: var(--color-inverse-primary);
|
|
11117
|
+
--snackbar-close-icon-color: var(--color-inverse-on-surface);
|
|
11118
|
+
--snackbar-border-radius: var(--shape-corner-extra-small);
|
|
11119
|
+
}
|
|
11120
|
+
|
|
11121
|
+
.snackbar {
|
|
11122
|
+
font-family: var(--typography-body-medium-font-family) !important;
|
|
11123
|
+
font-size: var(--typography-body-medium-font-size) !important;
|
|
11124
|
+
font-weight: var(--typography-body-medium-font-weight) !important;
|
|
11125
|
+
line-height: var(--typography-body-medium-line-height) !important;
|
|
11126
|
+
letter-spacing: var(--typography-body-medium-letter-spacing) !important;
|
|
11127
|
+
align-items: center;
|
|
11128
|
+
background-color: var(--snackbar-container-color);
|
|
11129
|
+
border-radius: var(--snackbar-border-radius);
|
|
11130
|
+
color: var(--snackbar-label-text-color);
|
|
11131
|
+
display: inline-flex;
|
|
11132
|
+
gap: var(--spacing-100);
|
|
11133
|
+
min-height: 3rem;
|
|
11134
|
+
opacity: 0;
|
|
11135
|
+
padding: var(--spacing-100) var(--spacing-200);
|
|
11136
|
+
pointer-events: none;
|
|
11137
|
+
transform: translateY(0.5rem);
|
|
11138
|
+
transition: opacity var(--duration-short2) var(--easing-standard), transform var(--duration-short2) var(--easing-standard);
|
|
11139
|
+
}
|
|
11140
|
+
|
|
11141
|
+
.snackbar.open {
|
|
11142
|
+
opacity: 1;
|
|
11143
|
+
pointer-events: auto;
|
|
11144
|
+
transform: translateY(0);
|
|
11145
|
+
}
|
|
11146
|
+
|
|
11147
|
+
.label {
|
|
11148
|
+
flex: 1 1 auto;
|
|
11149
|
+
color: inherit;
|
|
11150
|
+
}
|
|
11151
|
+
|
|
11152
|
+
.action,
|
|
11153
|
+
.close {
|
|
11154
|
+
font-family: var(--typography-label-large-font-family) !important;
|
|
11155
|
+
font-size: var(--typography-label-large-font-size) !important;
|
|
11156
|
+
font-weight: var(--typography-label-large-font-weight) !important;
|
|
11157
|
+
line-height: var(--typography-label-large-line-height) !important;
|
|
11158
|
+
letter-spacing: var(--typography-label-large-letter-spacing) !important;
|
|
11159
|
+
align-items: center;
|
|
11160
|
+
background: transparent;
|
|
11161
|
+
border: none;
|
|
11162
|
+
color: var(--snackbar-action-text-color);
|
|
11163
|
+
cursor: pointer;
|
|
11164
|
+
display: inline-flex;
|
|
11165
|
+
justify-content: center;
|
|
11166
|
+
margin: 0;
|
|
11167
|
+
min-height: 2rem;
|
|
11168
|
+
min-width: 2rem;
|
|
11169
|
+
padding: 0 var(--spacing-100);
|
|
11170
|
+
}
|
|
11171
|
+
|
|
11172
|
+
.close {
|
|
11173
|
+
color: var(--snackbar-close-icon-color);
|
|
11174
|
+
padding: 0;
|
|
11175
|
+
}
|
|
11176
|
+
|
|
11177
|
+
.close wc-icon {
|
|
11178
|
+
--icon-size: 1.125rem;
|
|
11179
|
+
color: inherit;
|
|
11180
|
+
}
|
|
11181
|
+
|
|
11182
|
+
.snackbar.multiline {
|
|
11183
|
+
align-items: flex-start;
|
|
11184
|
+
}`;
|
|
11185
|
+
|
|
11186
|
+
/**
|
|
11187
|
+
* @label Snackbar
|
|
11188
|
+
* @tag wc-snackbar
|
|
11189
|
+
* @rawTag snackbar
|
|
11190
|
+
* @summary Snackbars provide brief messages about app processes at the bottom of the screen.
|
|
11191
|
+
*
|
|
11192
|
+
* @cssprop --snackbar-container-color - Container color for the snackbar.
|
|
11193
|
+
* @cssprop --snackbar-label-text-color - Label text color for the snackbar.
|
|
11194
|
+
* @cssprop --snackbar-action-text-color - Action text color.
|
|
11195
|
+
* @cssprop --snackbar-close-icon-color - Close icon color.
|
|
11196
|
+
* @cssprop --snackbar-border-radius - Border radius of the snackbar surface.
|
|
11197
|
+
*
|
|
11198
|
+
* @example
|
|
11199
|
+
* ```html
|
|
11200
|
+
* <wc-snackbar open message="Message archived" action-label="Undo"></wc-snackbar>
|
|
11201
|
+
* ```
|
|
11202
|
+
* @tags display, feedback
|
|
11203
|
+
*/
|
|
11204
|
+
class Snackbar extends i$1 {
|
|
11205
|
+
constructor() {
|
|
11206
|
+
super(...arguments);
|
|
11207
|
+
this.open = false;
|
|
11208
|
+
this.message = '';
|
|
11209
|
+
this.actionLabel = '';
|
|
11210
|
+
this.showCloseIcon = false;
|
|
11211
|
+
this.duration = 4000;
|
|
11212
|
+
this.multiline = false;
|
|
11213
|
+
this.hideTimer = null;
|
|
11214
|
+
}
|
|
11215
|
+
show() {
|
|
11216
|
+
this.open = true;
|
|
11217
|
+
}
|
|
11218
|
+
hide() {
|
|
11219
|
+
this.close('programmatic');
|
|
11220
|
+
}
|
|
11221
|
+
close(reason) {
|
|
11222
|
+
if (!this.open) {
|
|
11223
|
+
return;
|
|
11224
|
+
}
|
|
11225
|
+
this.open = false;
|
|
11226
|
+
this.dispatchEvent(new CustomEvent('snackbar-close', {
|
|
11227
|
+
detail: { reason },
|
|
11228
|
+
bubbles: true,
|
|
11229
|
+
composed: true,
|
|
11230
|
+
}));
|
|
11231
|
+
}
|
|
11232
|
+
dispatchActionEvent() {
|
|
11233
|
+
this.dispatchEvent(new CustomEvent('snackbar-action', {
|
|
11234
|
+
bubbles: true,
|
|
11235
|
+
composed: true,
|
|
11236
|
+
}));
|
|
11237
|
+
}
|
|
11238
|
+
handleActionClick() {
|
|
11239
|
+
this.dispatchActionEvent();
|
|
11240
|
+
this.close('action');
|
|
11241
|
+
}
|
|
11242
|
+
handleCloseClick() {
|
|
11243
|
+
this.close('dismiss');
|
|
11244
|
+
}
|
|
11245
|
+
clearTimer() {
|
|
11246
|
+
if (this.hideTimer !== null) {
|
|
11247
|
+
clearTimeout(this.hideTimer);
|
|
11248
|
+
this.hideTimer = null;
|
|
11249
|
+
}
|
|
11250
|
+
}
|
|
11251
|
+
scheduleAutoHide() {
|
|
11252
|
+
this.clearTimer();
|
|
11253
|
+
if (!this.open || this.duration <= 0) {
|
|
11254
|
+
return;
|
|
11255
|
+
}
|
|
11256
|
+
this.hideTimer = setTimeout(() => {
|
|
11257
|
+
this.close('timeout');
|
|
11258
|
+
}, this.duration);
|
|
11259
|
+
}
|
|
11260
|
+
updated(changedProperties) {
|
|
11261
|
+
if (changedProperties.has('open')) {
|
|
11262
|
+
this.scheduleAutoHide();
|
|
11263
|
+
}
|
|
11264
|
+
}
|
|
11265
|
+
disconnectedCallback() {
|
|
11266
|
+
this.clearTimer();
|
|
11267
|
+
super.disconnectedCallback();
|
|
11268
|
+
}
|
|
11269
|
+
render() {
|
|
11270
|
+
const liveRole = this.actionLabel || this.showCloseIcon ? 'alert' : 'status';
|
|
11271
|
+
return b `
|
|
11272
|
+
<div
|
|
11273
|
+
class=${e$3({
|
|
11274
|
+
snackbar: true,
|
|
11275
|
+
open: this.open,
|
|
11276
|
+
multiline: this.multiline,
|
|
11277
|
+
})}
|
|
11278
|
+
role=${liveRole}
|
|
11279
|
+
aria-live="polite"
|
|
11280
|
+
>
|
|
11281
|
+
<div class="label">
|
|
11282
|
+
<slot>${this.message}</slot>
|
|
11283
|
+
</div>
|
|
11284
|
+
|
|
11285
|
+
${this.actionLabel
|
|
11286
|
+
? b `<button class="action" type="button" @click=${this.handleActionClick}>
|
|
11287
|
+
${this.actionLabel}
|
|
11288
|
+
</button>`
|
|
11289
|
+
: A}
|
|
11290
|
+
|
|
11291
|
+
${this.showCloseIcon
|
|
11292
|
+
? b `<button
|
|
11293
|
+
class="close"
|
|
11294
|
+
type="button"
|
|
11295
|
+
aria-label="Dismiss notification"
|
|
11296
|
+
@click=${this.handleCloseClick}
|
|
11297
|
+
>
|
|
11298
|
+
<wc-icon name="close"></wc-icon>
|
|
11299
|
+
</button>`
|
|
11300
|
+
: A}
|
|
11301
|
+
</div>
|
|
11302
|
+
`;
|
|
11303
|
+
}
|
|
11304
|
+
}
|
|
11305
|
+
Snackbar.styles = [css_248z];
|
|
11306
|
+
__decorate([
|
|
11307
|
+
n({ type: Boolean, reflect: true })
|
|
11308
|
+
], Snackbar.prototype, "open", void 0);
|
|
11309
|
+
__decorate([
|
|
11310
|
+
n({ type: String })
|
|
11311
|
+
], Snackbar.prototype, "message", void 0);
|
|
11312
|
+
__decorate([
|
|
11313
|
+
n({ type: String, attribute: 'action-label' })
|
|
11314
|
+
], Snackbar.prototype, "actionLabel", void 0);
|
|
11315
|
+
__decorate([
|
|
11316
|
+
n({ type: Boolean, attribute: 'show-close-icon' })
|
|
11317
|
+
], Snackbar.prototype, "showCloseIcon", void 0);
|
|
11318
|
+
__decorate([
|
|
11319
|
+
n({ type: Number })
|
|
11320
|
+
], Snackbar.prototype, "duration", void 0);
|
|
11321
|
+
__decorate([
|
|
11322
|
+
n({ type: Boolean, reflect: true })
|
|
11323
|
+
], Snackbar.prototype, "multiline", void 0);
|
|
11324
|
+
|
|
11325
|
+
export { Accordion as A, Badge as B, Checkbox as C, DatePicker as D, Elevation as E, Field as F, TreeNode as G, TreeView as H, Icon as I, LinearProgress as L, Menu as M, NumberField as N, Pagination as P, Ripple as R, Skeleton as S, Tab as T, Avatar as a, Breadcrumb as b, BreadcrumbItem as c, Chip as d, CircularProgress as e, Container as f, Divider as g, EmptyState as h, FocusRing as i, Image as j, Input as k, Link as l, MenuItem as m, Slider as n, Snackbar as o, Spinner as p, SubMenu as q, Switch as r, TabGroup as s, TabPanel as t, Table as u, Tabs as v, Tag as w, Textarea as x, TimePicker as y, Tooltip as z };
|
|
11326
|
+
//# sourceMappingURL=snackbar-74YCdMPL.js.map
|