@redvars/peacock 3.4.0 → 3.5.1
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/BaseButton-DuASuVth.js +219 -0
- package/dist/BaseButton-DuASuVth.js.map +1 -0
- package/dist/BaseHyperlinkMixin-BNuwbiEf.js +65 -0
- package/dist/BaseHyperlinkMixin-BNuwbiEf.js.map +1 -0
- package/dist/assets/components.css +1 -1
- package/dist/assets/components.css.map +1 -1
- package/dist/assets/styles.css +1 -1
- package/dist/assets/styles.css.map +1 -1
- package/dist/banner.js +187 -0
- package/dist/banner.js.map +1 -0
- package/dist/bottom-sheet.js +2 -2
- package/dist/{button-COYCtuA8.js → button-DouvOfEU.js} +92 -283
- package/dist/button-DouvOfEU.js.map +1 -0
- package/dist/{button-group-DsXquZQn.js → button-group-CEdMwvJJ.js} +72 -48
- package/dist/button-group-CEdMwvJJ.js.map +1 -0
- package/dist/button-group.js +8 -5
- package/dist/button-group.js.map +1 -1
- package/dist/button.js +7 -4
- package/dist/button.js.map +1 -1
- package/dist/card.js +29 -74
- package/dist/card.js.map +1 -1
- package/dist/chart-bar.js +2 -2
- package/dist/chart-bar.js.map +1 -1
- package/dist/chart-doughnut.js +2 -2
- package/dist/chart-doughnut.js.map +1 -1
- package/dist/chart-pie.js +2 -2
- package/dist/chart-pie.js.map +1 -1
- package/dist/chart-stacked-bar.js +2 -2
- package/dist/chart-stacked-bar.js.map +1 -1
- package/dist/{class-map-3TAnCMAX.js → class-map-YU7g0o3B.js} +2 -2
- package/dist/{class-map-3TAnCMAX.js.map → class-map-YU7g0o3B.js.map} +1 -1
- package/dist/clock.js.map +1 -1
- package/dist/code-editor.js +4 -4
- package/dist/code-editor.js.map +1 -1
- package/dist/code-highlighter.js +5 -4
- package/dist/code-highlighter.js.map +1 -1
- package/dist/custom-elements-jsdocs.json +6627 -3477
- package/dist/custom-elements.json +10954 -7810
- package/dist/directive-ZPhl09Yt.js +9 -0
- package/dist/directive-ZPhl09Yt.js.map +1 -0
- package/dist/dispatch-event-utils-CuEqjlPT.js +127 -0
- package/dist/dispatch-event-utils-CuEqjlPT.js.map +1 -0
- package/dist/fab.js +423 -0
- package/dist/fab.js.map +1 -0
- package/dist/index.js +17 -9
- package/dist/index.js.map +1 -1
- package/dist/{observe-theme-change-DKAIv5BB.js → is-dark-mode-DicqGkCJ.js} +6 -2
- package/dist/is-dark-mode-DicqGkCJ.js.map +1 -0
- package/dist/{select-C3XAzenC.js → navigation-rail-Lxetd5-Z.js} +2426 -898
- package/dist/navigation-rail-Lxetd5-Z.js.map +1 -0
- package/dist/notification.js +418 -0
- package/dist/notification.js.map +1 -0
- package/dist/number-counter.js +2 -2
- package/dist/number-counter.js.map +1 -1
- package/dist/observe-slot-change-BGJfgg2E.js +31 -0
- package/dist/observe-slot-change-BGJfgg2E.js.map +1 -0
- package/dist/peacock-loader.js +48 -13
- package/dist/peacock-loader.js.map +1 -1
- package/dist/search.js +456 -0
- package/dist/search.js.map +1 -0
- package/dist/side-sheet.js +2 -2
- package/dist/src/__mixins/BaseButtonMixin.d.ts +20 -0
- package/dist/src/__mixins/BaseHyperlinkMixin.d.ts +18 -0
- package/dist/src/__mixins/MixinConstructor.d.ts +1 -0
- package/dist/src/__utils/cache-fetch.d.ts +1 -0
- package/dist/src/__utils/is-dark-mode.d.ts +1 -0
- package/dist/src/__utils/is-in-viewport.d.ts +1 -0
- package/dist/src/__utils/observe-slot-change.d.ts +1 -0
- package/dist/src/__utils/sanitize-svg.d.ts +1 -0
- package/dist/src/__utils/throttle.d.ts +4 -0
- package/dist/src/accordion/accordion-item.d.ts +33 -9
- package/dist/src/accordion/accordion.d.ts +21 -5
- package/dist/src/banner/banner.d.ts +43 -0
- package/dist/src/banner/index.d.ts +1 -0
- package/dist/src/button/BaseButton.d.ts +7 -57
- package/dist/src/button/button/button.d.ts +32 -3
- package/dist/src/button/button-group/button-group.d.ts +4 -4
- package/dist/src/button/icon-button/icon-button.d.ts +33 -8
- package/dist/src/card/card.d.ts +4 -15
- package/dist/src/empty-state/empty-state.d.ts +1 -1
- package/dist/src/fab/fab.d.ts +80 -0
- package/dist/src/fab/index.d.ts +1 -0
- package/dist/src/focus-ring/focus-ring.d.ts +11 -5
- package/dist/src/index.d.ts +8 -1
- package/dist/src/link/link.d.ts +3 -10
- package/dist/src/menu/menu/menu.d.ts +3 -2
- package/dist/src/menu/sub-menu/sub-menu.d.ts +1 -0
- package/dist/src/navigation-rail/index.d.ts +2 -0
- package/dist/src/navigation-rail/navigation-rail-item.d.ts +55 -0
- package/dist/src/navigation-rail/navigation-rail.d.ts +71 -0
- package/dist/src/notification/index.d.ts +1 -0
- package/dist/src/notification/notification.d.ts +69 -0
- package/dist/src/pagination/pagination.d.ts +8 -1
- package/dist/src/search/index.d.ts +1 -0
- package/dist/src/search/search.d.ts +76 -0
- package/dist/src/select/select.d.ts +3 -5
- package/dist/src/sidebar-menu/index.d.ts +3 -0
- package/dist/src/sidebar-menu/sidebar-menu-item.d.ts +58 -0
- package/dist/src/sidebar-menu/sidebar-menu.d.ts +38 -0
- package/dist/src/sidebar-menu/sidebar-sub-menu.d.ts +35 -0
- package/dist/src/slider/slider.d.ts +4 -0
- package/dist/src/snackbar/snackbar.d.ts +14 -1
- package/dist/src/toolbar/index.d.ts +1 -0
- package/dist/src/toolbar/toolbar.d.ts +86 -0
- package/dist/src/tooltip/tooltip.d.ts +3 -0
- package/dist/src/url-field/index.d.ts +1 -0
- package/dist/src/url-field/url-field.d.ts +48 -0
- package/dist/{style-map-CRFEoCEg.js → style-map-DVmWOuYy.js} +2 -2
- package/dist/{style-map-CRFEoCEg.js.map → style-map-DVmWOuYy.js.map} +1 -1
- package/dist/test/banner.test.d.ts +1 -0
- package/dist/test/search.test.d.ts +1 -0
- package/dist/test/sidebar-menu.test.d.ts +1 -0
- package/dist/test/toolbar.test.d.ts +1 -0
- package/dist/toolbar.js +306 -0
- package/dist/toolbar.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/{unsafe-html-D3GHRaGQ.js → unsafe-html-BsGUjx94.js} +2 -2
- package/dist/{unsafe-html-D3GHRaGQ.js.map → unsafe-html-BsGUjx94.js.map} +1 -1
- package/package.json +1 -1
- package/readme.md +73 -65
- package/scss/mixin.scss +16 -0
- package/scss/styles.scss +4 -0
- package/src/__mixins/BaseButtonMixin.ts +83 -0
- package/src/__mixins/BaseHyperlinkMixin.ts +68 -0
- package/src/__mixins/MixinConstructor.ts +1 -0
- package/src/__mixins/README.md +19 -0
- package/src/__utils/cache-fetch.ts +65 -0
- package/src/__utils/is-dark-mode.ts +3 -0
- package/src/__utils/is-in-viewport.ts +6 -0
- package/src/__utils/observe-slot-change.ts +38 -0
- package/src/__utils/sanitize-svg.ts +27 -0
- package/src/__utils/throttle.ts +27 -0
- package/src/accordion/accordion-item.scss +136 -65
- package/src/accordion/accordion-item.ts +117 -44
- package/src/accordion/accordion.scss +24 -5
- package/src/accordion/accordion.ts +29 -23
- package/src/accordion/demo/index.html +74 -35
- package/src/banner/banner.scss +83 -0
- package/src/banner/banner.ts +101 -0
- package/src/banner/index.ts +1 -0
- package/src/button/BaseButton.ts +13 -115
- package/src/button/button/button-colors.scss +14 -14
- package/src/button/button/button-sizes.scss +4 -2
- package/src/button/button/button.ts +80 -26
- package/src/button/button-group/button-group.ts +5 -5
- package/src/button/icon-button/icon-button.ts +79 -44
- package/src/card/card.ts +50 -100
- package/src/chart-bar/chart-bar.ts +10 -15
- package/src/chart-bar/chart-stacked-bar.ts +15 -19
- package/src/chart-doughnut/chart-doughnut.ts +24 -28
- package/src/chart-pie/chart-pie.ts +20 -24
- package/src/checkbox/checkbox.scss +17 -34
- package/src/checkbox/checkbox.ts +4 -2
- package/src/clock/clock.ts +1 -1
- package/src/code-editor/code-editor.ts +4 -4
- package/src/code-highlighter/code-highlighter.scss +1 -0
- package/src/code-highlighter/code-highlighter.ts +3 -3
- package/src/date-picker/date-picker.ts +6 -3
- package/src/divider/divider.ts +3 -1
- package/src/elevation/elevation.scss +5 -5
- package/src/empty-state/empty-state.scss +7 -9
- package/src/empty-state/empty-state.ts +1 -1
- package/src/fab/fab-colors.scss +49 -0
- package/src/fab/fab-sizes.scss +47 -0
- package/src/fab/fab.scss +137 -0
- package/src/fab/fab.ts +214 -0
- package/src/fab/index.ts +1 -0
- package/src/field/field.ts +3 -1
- package/src/focus-ring/focus-ring.ts +47 -40
- package/src/icon/datasource.ts +1 -1
- package/src/icon/icon.ts +3 -1
- package/src/image/image.ts +3 -2
- package/src/index.ts +8 -1
- package/src/input/input.ts +8 -3
- package/src/link/link.ts +2 -15
- package/src/menu/menu/menu.scss +7 -0
- package/src/menu/menu/menu.ts +7 -4
- package/src/menu/menu-item/menu-item.ts +3 -1
- package/src/menu/sub-menu/sub-menu.ts +1 -0
- package/src/navigation-rail/index.ts +2 -0
- package/src/navigation-rail/navigation-rail-item.scss +216 -0
- package/src/navigation-rail/navigation-rail-item.ts +223 -0
- package/src/navigation-rail/navigation-rail.scss +72 -0
- package/src/navigation-rail/navigation-rail.ts +149 -0
- package/src/notification/index.ts +1 -0
- package/src/notification/notification.scss +201 -0
- package/src/notification/notification.ts +207 -0
- package/src/number-counter/number-counter.ts +3 -1
- package/src/number-field/number-field.ts +10 -6
- package/src/pagination/pagination.scss +33 -24
- package/src/pagination/pagination.ts +115 -60
- package/src/peacock-loader.ts +42 -5
- package/src/radio/radio.ts +3 -1
- package/src/search/index.ts +1 -0
- package/src/search/search-colors.scss +14 -0
- package/src/search/search.scss +204 -0
- package/src/search/search.ts +244 -0
- package/src/select/option.ts +1 -1
- package/src/select/select.scss +5 -0
- package/src/select/select.ts +71 -37
- package/src/sidebar-menu/demo/index.html +68 -0
- package/src/sidebar-menu/index.ts +3 -0
- package/src/sidebar-menu/sidebar-menu-item.scss +102 -0
- package/src/sidebar-menu/sidebar-menu-item.ts +151 -0
- package/src/{tree-view/tree-view.scss → sidebar-menu/sidebar-menu.scss} +1 -1
- package/src/sidebar-menu/sidebar-menu.ts +182 -0
- package/src/sidebar-menu/sidebar-sub-menu.scss +130 -0
- package/src/sidebar-menu/sidebar-sub-menu.ts +160 -0
- package/src/skeleton/skeleton.scss +18 -24
- package/src/slider/slider.scss +19 -0
- package/src/slider/slider.ts +30 -19
- package/src/snackbar/snackbar.scss +62 -31
- package/src/snackbar/snackbar.ts +91 -11
- package/src/switch/switch.ts +3 -1
- package/src/table/table.ts +3 -1
- package/src/tabs/tab.ts +10 -6
- package/src/text/text.css-component.scss +7 -1
- package/src/textarea/textarea.ts +4 -2
- package/src/time-picker/time-picker.ts +5 -3
- package/src/toolbar/index.ts +1 -0
- package/src/toolbar/toolbar-colors.scss +16 -0
- package/src/toolbar/toolbar.scss +165 -0
- package/src/toolbar/toolbar.ts +137 -0
- package/src/tooltip/tooltip.ts +24 -0
- package/src/url-field/index.ts +1 -0
- package/src/url-field/url-field.scss +50 -0
- package/src/url-field/url-field.ts +239 -0
- package/dist/button-COYCtuA8.js.map +0 -1
- package/dist/button-group-DsXquZQn.js.map +0 -1
- package/dist/directive-Cuw6h7YA.js +0 -9
- package/dist/directive-Cuw6h7YA.js.map +0 -1
- package/dist/dispatch-event-utils-B4odODQf.js +0 -277
- package/dist/dispatch-event-utils-B4odODQf.js.map +0 -1
- package/dist/observe-theme-change-DKAIv5BB.js.map +0 -1
- package/dist/select-C3XAzenC.js.map +0 -1
- package/dist/src/styleMixins.css.d.ts +0 -9
- package/dist/src/tree-view/index.d.ts +0 -2
- package/dist/src/tree-view/tree-node.d.ts +0 -69
- package/dist/src/tree-view/tree-view.d.ts +0 -40
- package/dist/src/tree-view/wc-tree-view.d.ts +0 -6
- package/dist/src/utils.d.ts +0 -9
- package/dist/test/tree-view.test.d.ts +0 -1
- package/src/styleMixins.css.ts +0 -55
- package/src/tree-view/demo/index.html +0 -57
- package/src/tree-view/index.ts +0 -2
- package/src/tree-view/tree-node.scss +0 -101
- package/src/tree-view/tree-node.ts +0 -268
- package/src/tree-view/tree-view.ts +0 -182
- package/src/tree-view/wc-tree-view.ts +0 -9
- package/src/utils.ts +0 -193
- /package/dist/src/{spread.d.ts → __directive/spread.d.ts} +0 -0
- /package/dist/src/{utils → __utils}/copy-to-clipboard.d.ts +0 -0
- /package/dist/src/{utils → __utils}/dispatch-event-utils.d.ts +0 -0
- /package/dist/src/{utils → __utils}/observe-theme-change.d.ts +0 -0
- /package/src/{spread.ts → __directive/spread.ts} +0 -0
- /package/src/{utils → __utils}/copy-to-clipboard.ts +0 -0
- /package/src/{utils → __utils}/dispatch-event-utils.ts +0 -0
- /package/src/{utils → __utils}/observe-theme-change.ts +0 -0
|
@@ -1,26 +1,106 @@
|
|
|
1
1
|
import { a as i, _ as __decorate, i as i$1, b, A, c as __classPrivateFieldGet, w } from './IndividualComponent-DUINtMGK.js';
|
|
2
2
|
import { n } from './property-1psGvXOq.js';
|
|
3
3
|
import { r } from './state-DwbEjqVk.js';
|
|
4
|
-
import { e as e$1 } from './directive-
|
|
5
|
-
import { e as e$2, o as o$4 } from './unsafe-html-
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
4
|
+
import { e as e$1 } from './directive-ZPhl09Yt.js';
|
|
5
|
+
import { e as e$2, o as o$4 } from './unsafe-html-BsGUjx94.js';
|
|
6
|
+
import { e as e$3 } from './class-map-YU7g0o3B.js';
|
|
7
|
+
import { o as observerSlotChangesWithCallback } from './observe-slot-change-BGJfgg2E.js';
|
|
8
8
|
import { a as e, e as e$4 } from './query-QBcUV-L_.js';
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
9
|
+
import { B as BaseHyperlinkMixin, t as throttle } from './BaseHyperlinkMixin-BNuwbiEf.js';
|
|
10
|
+
import { o as o$2 } from './style-map-DVmWOuYy.js';
|
|
11
|
+
import { r as redispatchEvent, i as isActivationClick, d as dispatchActivationClick } from './dispatch-event-utils-CuEqjlPT.js';
|
|
12
|
+
import { s as spread, o as o$3 } from './BaseButton-DuASuVth.js';
|
|
13
|
+
import { B as BaseInput, i as isDarkMode, o as observeThemeChange } from './is-dark-mode-DicqGkCJ.js';
|
|
12
14
|
|
|
13
15
|
/**
|
|
14
16
|
* @license
|
|
15
17
|
* Copyright 2021 Google LLC
|
|
16
18
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
17
|
-
*/function o$
|
|
19
|
+
*/function o$1(o){return (e$1,n)=>{const{slot:r,selector:s}=o??{},c="slot"+(r?`[name=${r}]`:":not([name])");return e(e$1,n,{get(){const t=this.renderRoot?.querySelector(c),e=t?.assignedElements(o)??[];return void 0===s?e:e.filter(t=>t.matches(s))}})}}
|
|
18
20
|
|
|
19
21
|
/**
|
|
20
22
|
* @license
|
|
21
23
|
* Copyright 2017 Google LLC
|
|
22
24
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
23
|
-
*/class t extends e$2{}t.directiveName="unsafeSVG",t.resultType=2;const o
|
|
25
|
+
*/class t extends e$2{}t.directiveName="unsafeSVG",t.resultType=2;const o=e$1(t);
|
|
26
|
+
|
|
27
|
+
// Basic sanitization: remove <script>, <foreignObject>, event handler attributes (on*), and iframes
|
|
28
|
+
function sanitizeSvg(rawSvg) {
|
|
29
|
+
try {
|
|
30
|
+
const parser = new DOMParser();
|
|
31
|
+
const doc = parser.parseFromString(rawSvg, 'image/svg+xml');
|
|
32
|
+
const scripts = Array.from(doc.querySelectorAll('script'));
|
|
33
|
+
scripts.forEach(n => n.remove());
|
|
34
|
+
const foreigns = Array.from(doc.querySelectorAll('foreignObject, iframe'));
|
|
35
|
+
foreigns.forEach(n => n.remove());
|
|
36
|
+
const all = Array.from(doc.querySelectorAll('*'));
|
|
37
|
+
all.forEach(el => {
|
|
38
|
+
const attrs = Array.from(el.attributes).filter(a => /^on/i.test(a.name));
|
|
39
|
+
attrs.forEach(a => el.removeAttribute(a.name));
|
|
40
|
+
});
|
|
41
|
+
const el = doc.documentElement;
|
|
42
|
+
if (!el)
|
|
43
|
+
return '';
|
|
44
|
+
const serializer = new XMLSerializer();
|
|
45
|
+
return serializer.serializeToString(el);
|
|
46
|
+
}
|
|
47
|
+
catch (e) {
|
|
48
|
+
return '';
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
async function createCacheFetch(name) {
|
|
53
|
+
let cache = null;
|
|
54
|
+
// This map tracks requests currently being processed
|
|
55
|
+
const inFlightRequests = new Map();
|
|
56
|
+
try {
|
|
57
|
+
cache = await window.caches.open(name);
|
|
58
|
+
}
|
|
59
|
+
catch (e) {
|
|
60
|
+
console.warn('window.caches access not allowed');
|
|
61
|
+
}
|
|
62
|
+
return async (url) => {
|
|
63
|
+
if (inFlightRequests.has(url)) {
|
|
64
|
+
return inFlightRequests.get(url);
|
|
65
|
+
}
|
|
66
|
+
const fetchPromise = (async () => {
|
|
67
|
+
const request = new Request(url);
|
|
68
|
+
if (cache) {
|
|
69
|
+
const cachedResponse = await cache.match(request);
|
|
70
|
+
if (cachedResponse) {
|
|
71
|
+
return cachedResponse.text();
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
const urlObj = new URL(request.url);
|
|
75
|
+
const isSameOrigin = urlObj.origin === window.location.origin;
|
|
76
|
+
const response = await fetch(request.url, {
|
|
77
|
+
method: 'GET',
|
|
78
|
+
mode: isSameOrigin ? 'no-cors' : 'cors',
|
|
79
|
+
credentials: isSameOrigin ? 'same-origin' : 'omit',
|
|
80
|
+
});
|
|
81
|
+
if (response.status === 404) {
|
|
82
|
+
console.error(`[Fetch Error] Resource not found (404): ${url}`);
|
|
83
|
+
return '';
|
|
84
|
+
}
|
|
85
|
+
const result = await response.text();
|
|
86
|
+
if (cache && response.status === 200) {
|
|
87
|
+
await cache.put(request, new Response(result, {
|
|
88
|
+
status: response.status,
|
|
89
|
+
statusText: response.statusText,
|
|
90
|
+
headers: response.headers,
|
|
91
|
+
}));
|
|
92
|
+
}
|
|
93
|
+
return result;
|
|
94
|
+
})();
|
|
95
|
+
inFlightRequests.set(url, fetchPromise);
|
|
96
|
+
try {
|
|
97
|
+
return await fetchPromise;
|
|
98
|
+
}
|
|
99
|
+
finally {
|
|
100
|
+
inFlightRequests.delete(url);
|
|
101
|
+
}
|
|
102
|
+
};
|
|
103
|
+
}
|
|
24
104
|
|
|
25
105
|
const PROVIDERS = {
|
|
26
106
|
'material-symbols': (name) => `https://cdn.jsdelivr.net/npm/@material-symbols/svg-500@0.40.1/outlined/${name}.svg`,
|
|
@@ -41,7 +121,7 @@ async function fetchIcon(name, provider = 'material-symbols') {
|
|
|
41
121
|
return fetchSVG(PROVIDERS[provider](name));
|
|
42
122
|
}
|
|
43
123
|
|
|
44
|
-
var css_248z$
|
|
124
|
+
var css_248z$S = i`* {
|
|
45
125
|
box-sizing: border-box;
|
|
46
126
|
}
|
|
47
127
|
|
|
@@ -110,7 +190,7 @@ class Icon extends i$1 {
|
|
|
110
190
|
// accessible wrapper; consumers can provide a fallback via <slot name="fallback">.
|
|
111
191
|
return b ` <div class="icon">
|
|
112
192
|
${this.svgContent
|
|
113
|
-
? o
|
|
193
|
+
? o(this.svgContent)
|
|
114
194
|
: b `<slot name="fallback"></slot>`}
|
|
115
195
|
</div>`;
|
|
116
196
|
}
|
|
@@ -170,7 +250,7 @@ class Icon extends i$1 {
|
|
|
170
250
|
}
|
|
171
251
|
}
|
|
172
252
|
}
|
|
173
|
-
Icon.styles = [css_248z$
|
|
253
|
+
Icon.styles = [css_248z$S];
|
|
174
254
|
__decorate([
|
|
175
255
|
n({ type: String, reflect: true })
|
|
176
256
|
], Icon.prototype, "name", void 0);
|
|
@@ -190,7 +270,7 @@ __decorate([
|
|
|
190
270
|
r()
|
|
191
271
|
], Icon.prototype, "error", void 0);
|
|
192
272
|
|
|
193
|
-
var css_248z$
|
|
273
|
+
var css_248z$R = i`* {
|
|
194
274
|
box-sizing: border-box;
|
|
195
275
|
}
|
|
196
276
|
|
|
@@ -281,7 +361,7 @@ class Avatar extends i$1 {
|
|
|
281
361
|
return `${first.charAt(0)}${last.charAt(0)}`.toUpperCase();
|
|
282
362
|
}
|
|
283
363
|
}
|
|
284
|
-
Avatar.styles = [css_248z$
|
|
364
|
+
Avatar.styles = [css_248z$R];
|
|
285
365
|
__decorate([
|
|
286
366
|
n({ type: String, reflect: true })
|
|
287
367
|
], Avatar.prototype, "name", void 0);
|
|
@@ -289,7 +369,7 @@ __decorate([
|
|
|
289
369
|
n({ type: String, reflect: true })
|
|
290
370
|
], Avatar.prototype, "src", void 0);
|
|
291
371
|
|
|
292
|
-
var css_248z$
|
|
372
|
+
var css_248z$Q = i`* {
|
|
293
373
|
box-sizing: border-box;
|
|
294
374
|
}
|
|
295
375
|
|
|
@@ -361,12 +441,12 @@ class Badge extends i$1 {
|
|
|
361
441
|
</div>`;
|
|
362
442
|
}
|
|
363
443
|
}
|
|
364
|
-
Badge.styles = [css_248z$
|
|
444
|
+
Badge.styles = [css_248z$Q];
|
|
365
445
|
__decorate([
|
|
366
446
|
n({ type: String })
|
|
367
447
|
], Badge.prototype, "value", void 0);
|
|
368
448
|
|
|
369
|
-
var css_248z$
|
|
449
|
+
var css_248z$P = i`* {
|
|
370
450
|
box-sizing: border-box;
|
|
371
451
|
}
|
|
372
452
|
|
|
@@ -475,7 +555,7 @@ class Divider extends i$1 {
|
|
|
475
555
|
</div>`;
|
|
476
556
|
}
|
|
477
557
|
}
|
|
478
|
-
Divider.styles = [css_248z$
|
|
558
|
+
Divider.styles = [css_248z$P];
|
|
479
559
|
__decorate([
|
|
480
560
|
n({ type: Boolean, reflect: true })
|
|
481
561
|
], Divider.prototype, "vertical", void 0);
|
|
@@ -483,7 +563,15 @@ __decorate([
|
|
|
483
563
|
r()
|
|
484
564
|
], Divider.prototype, "slotHasContent", void 0);
|
|
485
565
|
|
|
486
|
-
var css_248z$
|
|
566
|
+
var css_248z$O = i`* {
|
|
567
|
+
box-sizing: border-box;
|
|
568
|
+
}
|
|
569
|
+
|
|
570
|
+
.screen-reader-only {
|
|
571
|
+
display: none !important;
|
|
572
|
+
}
|
|
573
|
+
|
|
574
|
+
/**
|
|
487
575
|
* Derived from Material Design Elevation
|
|
488
576
|
* https://github.com/material-components/material-web/blob/main/elevation/internal/_elevation.scss
|
|
489
577
|
*/
|
|
@@ -556,9 +644,9 @@ class Elevation extends i$1 {
|
|
|
556
644
|
return b `<span class="shadow"></span>`;
|
|
557
645
|
}
|
|
558
646
|
}
|
|
559
|
-
Elevation.styles = [css_248z$
|
|
647
|
+
Elevation.styles = [css_248z$O];
|
|
560
648
|
|
|
561
|
-
var css_248z$
|
|
649
|
+
var css_248z$N = i`* {
|
|
562
650
|
box-sizing: border-box;
|
|
563
651
|
}
|
|
564
652
|
|
|
@@ -811,7 +899,7 @@ class SegmentedButton extends i$1 {
|
|
|
811
899
|
`;
|
|
812
900
|
}
|
|
813
901
|
}
|
|
814
|
-
SegmentedButton.styles = [css_248z$
|
|
902
|
+
SegmentedButton.styles = [css_248z$N];
|
|
815
903
|
__decorate([
|
|
816
904
|
n({ type: String, reflect: true })
|
|
817
905
|
], SegmentedButton.prototype, "value", void 0);
|
|
@@ -831,7 +919,7 @@ __decorate([
|
|
|
831
919
|
r()
|
|
832
920
|
], SegmentedButton.prototype, "isActive", void 0);
|
|
833
921
|
|
|
834
|
-
var css_248z$
|
|
922
|
+
var css_248z$M = i`* {
|
|
835
923
|
box-sizing: border-box;
|
|
836
924
|
}
|
|
837
925
|
|
|
@@ -943,7 +1031,7 @@ class SegmentedButtonGroup extends i$1 {
|
|
|
943
1031
|
`;
|
|
944
1032
|
}
|
|
945
1033
|
}
|
|
946
|
-
SegmentedButtonGroup.styles = [css_248z$
|
|
1034
|
+
SegmentedButtonGroup.styles = [css_248z$M];
|
|
947
1035
|
SegmentedButtonGroup.SegmentedButton = SegmentedButton;
|
|
948
1036
|
__decorate([
|
|
949
1037
|
n({ type: Boolean, reflect: true, attribute: 'multi-select' })
|
|
@@ -952,7 +1040,7 @@ __decorate([
|
|
|
952
1040
|
n({ type: Boolean, reflect: true })
|
|
953
1041
|
], SegmentedButtonGroup.prototype, "nullable", void 0);
|
|
954
1042
|
|
|
955
|
-
var css_248z$
|
|
1043
|
+
var css_248z$L = i`:host {
|
|
956
1044
|
display: none;
|
|
957
1045
|
pointer-events: none;
|
|
958
1046
|
position: absolute;
|
|
@@ -990,30 +1078,13 @@ class FocusRing extends i$1 {
|
|
|
990
1078
|
super(...arguments);
|
|
991
1079
|
this.visible = false;
|
|
992
1080
|
this.for = '';
|
|
1081
|
+
this.__boundFocusin = this.__focusin.bind(this);
|
|
1082
|
+
this.__boundFocusout = this.__focusout.bind(this);
|
|
1083
|
+
this.__boundPointerdown = this.__pointerdown.bind(this);
|
|
993
1084
|
}
|
|
994
1085
|
render() {
|
|
995
1086
|
return A;
|
|
996
1087
|
}
|
|
997
|
-
get control() {
|
|
998
|
-
return this._control || null;
|
|
999
|
-
}
|
|
1000
|
-
set control(control) {
|
|
1001
|
-
if (control) {
|
|
1002
|
-
this._control = control;
|
|
1003
|
-
}
|
|
1004
|
-
else {
|
|
1005
|
-
this.detach();
|
|
1006
|
-
}
|
|
1007
|
-
}
|
|
1008
|
-
set forElement(value) {
|
|
1009
|
-
if (value) {
|
|
1010
|
-
this._focusTarget = value;
|
|
1011
|
-
this.attach();
|
|
1012
|
-
}
|
|
1013
|
-
else {
|
|
1014
|
-
this.detach();
|
|
1015
|
-
}
|
|
1016
|
-
}
|
|
1017
1088
|
connectedCallback() {
|
|
1018
1089
|
super.connectedCallback();
|
|
1019
1090
|
this.attach();
|
|
@@ -1022,6 +1093,21 @@ class FocusRing extends i$1 {
|
|
|
1022
1093
|
this.detach();
|
|
1023
1094
|
super.disconnectedCallback();
|
|
1024
1095
|
}
|
|
1096
|
+
updated(changed) {
|
|
1097
|
+
if (changed.has('for')) {
|
|
1098
|
+
const prevId = changed.get('for');
|
|
1099
|
+
if (prevId) {
|
|
1100
|
+
const root = this.parentElement?.getRootNode();
|
|
1101
|
+
const prevEl = root?.getElementById(prevId) ?? document.getElementById(prevId);
|
|
1102
|
+
if (prevEl) {
|
|
1103
|
+
prevEl.removeEventListener('focusin', this.__boundFocusin);
|
|
1104
|
+
prevEl.removeEventListener('focusout', this.__boundFocusout);
|
|
1105
|
+
prevEl.removeEventListener('pointerdown', this.__boundPointerdown);
|
|
1106
|
+
}
|
|
1107
|
+
}
|
|
1108
|
+
this.attach();
|
|
1109
|
+
}
|
|
1110
|
+
}
|
|
1025
1111
|
__focusin() {
|
|
1026
1112
|
const focusTarget = this.__getFocusTarget();
|
|
1027
1113
|
this.visible = focusTarget?.matches(':focus-visible') ?? false;
|
|
@@ -1032,35 +1118,47 @@ class FocusRing extends i$1 {
|
|
|
1032
1118
|
__pointerdown() {
|
|
1033
1119
|
this.visible = false;
|
|
1034
1120
|
}
|
|
1121
|
+
/**
|
|
1122
|
+
* Resolves the element that should receive focus-ring event listeners by id.
|
|
1123
|
+
* Prefers lookup from the current control's root node, then falls back to a
|
|
1124
|
+
* document-level lookup.
|
|
1125
|
+
*
|
|
1126
|
+
* @returns The resolved focus target, if one can be found.
|
|
1127
|
+
*/
|
|
1035
1128
|
__getFocusTarget() {
|
|
1036
|
-
if (this.
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1129
|
+
if (this.for) {
|
|
1130
|
+
const root = this.parentElement?.getRootNode();
|
|
1131
|
+
if (root) {
|
|
1132
|
+
const focusTarget = root.getElementById(this.for);
|
|
1133
|
+
if (focusTarget) {
|
|
1134
|
+
return focusTarget;
|
|
1135
|
+
}
|
|
1136
|
+
}
|
|
1137
|
+
const focusTarget = document.getElementById(this.for);
|
|
1138
|
+
if (focusTarget) {
|
|
1139
|
+
return focusTarget;
|
|
1140
|
+
}
|
|
1042
1141
|
}
|
|
1043
1142
|
return undefined;
|
|
1044
1143
|
}
|
|
1045
1144
|
attach() {
|
|
1046
1145
|
const focusTarget = this.__getFocusTarget();
|
|
1047
1146
|
if (focusTarget) {
|
|
1048
|
-
focusTarget.addEventListener('focusin', this.
|
|
1049
|
-
focusTarget.addEventListener('focusout', this.
|
|
1050
|
-
focusTarget.addEventListener('pointerdown', this.
|
|
1147
|
+
focusTarget.addEventListener('focusin', this.__boundFocusin);
|
|
1148
|
+
focusTarget.addEventListener('focusout', this.__boundFocusout);
|
|
1149
|
+
focusTarget.addEventListener('pointerdown', this.__boundPointerdown);
|
|
1051
1150
|
}
|
|
1052
1151
|
}
|
|
1053
1152
|
detach() {
|
|
1054
1153
|
const focusTarget = this.__getFocusTarget();
|
|
1055
1154
|
if (focusTarget) {
|
|
1056
|
-
focusTarget.removeEventListener('focusin', this.
|
|
1057
|
-
focusTarget.removeEventListener('focusout', this.
|
|
1058
|
-
focusTarget.removeEventListener('pointerdown', this.
|
|
1155
|
+
focusTarget.removeEventListener('focusin', this.__boundFocusin);
|
|
1156
|
+
focusTarget.removeEventListener('focusout', this.__boundFocusout);
|
|
1157
|
+
focusTarget.removeEventListener('pointerdown', this.__boundPointerdown);
|
|
1059
1158
|
}
|
|
1060
|
-
this._control = undefined;
|
|
1061
1159
|
}
|
|
1062
1160
|
}
|
|
1063
|
-
FocusRing.styles = [css_248z$
|
|
1161
|
+
FocusRing.styles = [css_248z$L];
|
|
1064
1162
|
__decorate([
|
|
1065
1163
|
n({ type: Boolean, reflect: true })
|
|
1066
1164
|
], FocusRing.prototype, "visible", void 0);
|
|
@@ -1537,7 +1635,7 @@ __decorate([
|
|
|
1537
1635
|
e$4('.surface')
|
|
1538
1636
|
], Ripple.prototype, "mdRoot", void 0);
|
|
1539
1637
|
|
|
1540
|
-
var css_248z$
|
|
1638
|
+
var css_248z$K = i`* {
|
|
1541
1639
|
box-sizing: border-box;
|
|
1542
1640
|
}
|
|
1543
1641
|
|
|
@@ -1547,81 +1645,145 @@ var css_248z$G = i`* {
|
|
|
1547
1645
|
|
|
1548
1646
|
:host {
|
|
1549
1647
|
display: block;
|
|
1550
|
-
--accordion-item-title-align: start;
|
|
1551
1648
|
}
|
|
1552
1649
|
|
|
1553
|
-
.
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
|
|
1650
|
+
.expansion-panel {
|
|
1651
|
+
border: var(--_accordion-item-border, 1px solid var(--color-outline-variant));
|
|
1652
|
+
border-radius: var(--shape-corner-medium);
|
|
1653
|
+
background-color: var(--_accordion-item-background, var(--color-surface-container-low));
|
|
1654
|
+
overflow: hidden;
|
|
1655
|
+
transition: background-color var(--duration-medium1) var(--easing-standard), border-color var(--duration-medium1) var(--easing-standard);
|
|
1656
|
+
}
|
|
1657
|
+
.expansion-panel .header-button {
|
|
1658
|
+
position: relative;
|
|
1560
1659
|
display: flex;
|
|
1561
|
-
flex-direction: row-reverse;
|
|
1562
1660
|
align-items: center;
|
|
1661
|
+
width: 100%;
|
|
1662
|
+
min-height: 3rem;
|
|
1663
|
+
padding: 0 var(--spacing-300);
|
|
1664
|
+
gap: var(--spacing-200);
|
|
1665
|
+
border: none;
|
|
1666
|
+
border-radius: 0;
|
|
1667
|
+
background: transparent;
|
|
1668
|
+
cursor: pointer;
|
|
1669
|
+
text-align: start;
|
|
1563
1670
|
color: var(--color-on-surface);
|
|
1564
|
-
|
|
1565
|
-
gap: 0.5rem;
|
|
1566
|
-
font-family: var(--typography-title-medium-font-family) !important;
|
|
1567
|
-
font-size: var(--typography-title-medium-font-size) !important;
|
|
1568
|
-
font-weight: var(--typography-title-medium-font-weight) !important;
|
|
1569
|
-
line-height: var(--typography-title-medium-line-height) !important;
|
|
1570
|
-
letter-spacing: var(--typography-title-medium-letter-spacing) !important;
|
|
1671
|
+
overflow: hidden;
|
|
1571
1672
|
}
|
|
1572
|
-
.
|
|
1573
|
-
|
|
1574
|
-
|
|
1673
|
+
.expansion-panel .header-button::before {
|
|
1674
|
+
content: "";
|
|
1675
|
+
position: absolute;
|
|
1676
|
+
inset: 0;
|
|
1677
|
+
background-color: var(--color-on-surface);
|
|
1678
|
+
opacity: 0;
|
|
1679
|
+
pointer-events: none;
|
|
1680
|
+
transition: opacity var(--duration-short4) var(--easing-standard);
|
|
1681
|
+
}
|
|
1682
|
+
.expansion-panel .header-button:not(:disabled):hover::before {
|
|
1683
|
+
opacity: 0.08;
|
|
1575
1684
|
}
|
|
1576
|
-
.
|
|
1685
|
+
.expansion-panel .header-button:focus-visible {
|
|
1686
|
+
outline: none;
|
|
1577
1687
|
outline: 2px solid var(--color-black);
|
|
1578
1688
|
}
|
|
1579
|
-
.
|
|
1689
|
+
.expansion-panel .header-button:focus-visible::before {
|
|
1690
|
+
opacity: 0.12;
|
|
1691
|
+
}
|
|
1692
|
+
.expansion-panel .header-label {
|
|
1693
|
+
flex: 1;
|
|
1694
|
+
display: flex;
|
|
1695
|
+
flex-direction: column;
|
|
1696
|
+
justify-content: center;
|
|
1697
|
+
gap: 2px;
|
|
1698
|
+
padding: var(--spacing-150) 0;
|
|
1699
|
+
min-width: 0;
|
|
1700
|
+
}
|
|
1701
|
+
.expansion-panel .panel-title {
|
|
1702
|
+
font-family: var(--typography-body-large-font-family) !important;
|
|
1703
|
+
font-size: var(--typography-body-large-font-size) !important;
|
|
1704
|
+
font-weight: var(--typography-body-large-font-weight) !important;
|
|
1705
|
+
line-height: var(--typography-body-large-line-height) !important;
|
|
1706
|
+
letter-spacing: var(--typography-body-large-letter-spacing) !important;
|
|
1707
|
+
color: var(--color-on-surface);
|
|
1708
|
+
white-space: nowrap;
|
|
1709
|
+
overflow: hidden;
|
|
1710
|
+
text-overflow: ellipsis;
|
|
1711
|
+
}
|
|
1712
|
+
.expansion-panel .panel-description {
|
|
1713
|
+
font-family: var(--typography-body-small-font-family) !important;
|
|
1714
|
+
font-size: var(--typography-body-small-font-size) !important;
|
|
1715
|
+
font-weight: var(--typography-body-small-font-weight) !important;
|
|
1716
|
+
line-height: var(--typography-body-small-line-height) !important;
|
|
1717
|
+
letter-spacing: var(--typography-body-small-letter-spacing) !important;
|
|
1718
|
+
color: var(--color-on-surface-variant);
|
|
1719
|
+
white-space: nowrap;
|
|
1720
|
+
overflow: hidden;
|
|
1721
|
+
text-overflow: ellipsis;
|
|
1722
|
+
}
|
|
1723
|
+
.expansion-panel .panel-description[hidden] {
|
|
1724
|
+
display: none;
|
|
1725
|
+
}
|
|
1726
|
+
.expansion-panel ::slotted([slot=header-actions]) {
|
|
1727
|
+
display: flex;
|
|
1728
|
+
align-items: center;
|
|
1729
|
+
flex-shrink: 0;
|
|
1730
|
+
gap: var(--spacing-100);
|
|
1731
|
+
}
|
|
1732
|
+
.expansion-panel .toggle-icon {
|
|
1580
1733
|
--icon-size: 1.5rem;
|
|
1581
|
-
--icon-color:
|
|
1582
|
-
|
|
1734
|
+
--icon-color: var(--color-on-surface-variant);
|
|
1735
|
+
flex-shrink: 0;
|
|
1736
|
+
transition: transform var(--duration-medium1) var(--easing-standard);
|
|
1583
1737
|
}
|
|
1584
|
-
.
|
|
1585
|
-
|
|
1586
|
-
|
|
1587
|
-
|
|
1588
|
-
|
|
1589
|
-
|
|
1738
|
+
.expansion-panel .panel-content {
|
|
1739
|
+
display: grid;
|
|
1740
|
+
grid-template-rows: 0fr;
|
|
1741
|
+
transition: grid-template-rows var(--duration-medium1) var(--easing-standard);
|
|
1742
|
+
}
|
|
1743
|
+
.expansion-panel .content-inner {
|
|
1744
|
+
overflow: hidden;
|
|
1745
|
+
min-height: 0;
|
|
1746
|
+
font-family: var(--typography-body-medium-font-family) !important;
|
|
1747
|
+
font-size: var(--typography-body-medium-font-size) !important;
|
|
1748
|
+
font-weight: var(--typography-body-medium-font-weight) !important;
|
|
1749
|
+
line-height: var(--typography-body-medium-line-height) !important;
|
|
1750
|
+
letter-spacing: var(--typography-body-medium-letter-spacing) !important;
|
|
1751
|
+
color: var(--color-on-surface-variant);
|
|
1590
1752
|
}
|
|
1591
|
-
.
|
|
1592
|
-
|
|
1753
|
+
.expansion-panel.disabled {
|
|
1754
|
+
background-color: color-mix(in srgb, var(--color-surface-container-low) 38%, transparent);
|
|
1755
|
+
border-color: color-mix(in srgb, var(--color-outline-variant) 38%, transparent);
|
|
1593
1756
|
}
|
|
1594
|
-
.
|
|
1757
|
+
.expansion-panel.disabled .header-button {
|
|
1595
1758
|
cursor: not-allowed;
|
|
1759
|
+
pointer-events: none;
|
|
1596
1760
|
opacity: 0.38;
|
|
1597
1761
|
}
|
|
1598
|
-
.
|
|
1599
|
-
|
|
1600
|
-
|
|
1601
|
-
opacity: 1;
|
|
1602
|
-
padding: var(--spacing-100) var(--spacing-800) var(--spacing-300) var(--spacing-200);
|
|
1762
|
+
.expansion-panel.open {
|
|
1763
|
+
background-color: var(--color-surface-container);
|
|
1764
|
+
border-color: transparent;
|
|
1603
1765
|
}
|
|
1604
|
-
.
|
|
1605
|
-
|
|
1766
|
+
.expansion-panel.open .panel-content {
|
|
1767
|
+
grid-template-rows: 1fr;
|
|
1768
|
+
border-block-start: 1px solid var(--color-outline-variant);
|
|
1606
1769
|
}
|
|
1607
|
-
|
|
1608
|
-
|
|
1609
|
-
* Sizes
|
|
1610
|
-
*/
|
|
1611
|
-
.accordion-item .accordion-heading {
|
|
1612
|
-
height: 2.5rem;
|
|
1770
|
+
.expansion-panel.open .content-inner {
|
|
1771
|
+
padding: 0 var(--spacing-300) var(--spacing-200);
|
|
1613
1772
|
}
|
|
1614
|
-
|
|
1615
|
-
:
|
|
1616
|
-
height: 2rem;
|
|
1773
|
+
.expansion-panel.open .toggle-icon {
|
|
1774
|
+
transform: rotate(180deg);
|
|
1617
1775
|
}
|
|
1618
|
-
|
|
1619
|
-
:
|
|
1620
|
-
|
|
1776
|
+
.expansion-panel.disabled {
|
|
1777
|
+
background-color: color-mix(in srgb, var(--color-surface-container-low) 38%, transparent);
|
|
1778
|
+
border-color: color-mix(in srgb, var(--color-outline-variant) 38%, transparent);
|
|
1621
1779
|
}
|
|
1622
1780
|
|
|
1623
|
-
:host
|
|
1624
|
-
flex-direction: row;
|
|
1781
|
+
:host([toggle-position=before]) .header-button {
|
|
1782
|
+
flex-direction: row-reverse;
|
|
1783
|
+
justify-content: flex-end;
|
|
1784
|
+
}
|
|
1785
|
+
:host([toggle-position=before]) .header-label {
|
|
1786
|
+
flex: 1;
|
|
1625
1787
|
}`;
|
|
1626
1788
|
|
|
1627
1789
|
var _AccordionItem_id;
|
|
@@ -1629,13 +1791,27 @@ var _AccordionItem_id;
|
|
|
1629
1791
|
* @label Accordion Item
|
|
1630
1792
|
* @tag wc-accordion-item
|
|
1631
1793
|
* @rawTag accordion-item
|
|
1632
|
-
* @summary An
|
|
1794
|
+
* @summary An expansion panel with a header that reveals or hides associated content. Follows Material Design 3 expansion panel guidelines.
|
|
1633
1795
|
* @parentRawTag accordion
|
|
1634
1796
|
*
|
|
1797
|
+
* @slot - The body content revealed when the panel is expanded.
|
|
1798
|
+
* @slot heading - The panel title. Renders as `body-large` text.
|
|
1799
|
+
* @slot description - Optional subtitle rendered below the title. Renders as `body-small` text.
|
|
1800
|
+
* @slot header-actions - Actions (e.g. icon buttons) placed at the trailing end of the header, before the toggle icon.
|
|
1801
|
+
*
|
|
1802
|
+
* @part header - The header `<button>` element.
|
|
1803
|
+
* @part title - The title text container.
|
|
1804
|
+
* @part description - The description text container.
|
|
1805
|
+
* @part content - The expandable content region wrapper.
|
|
1806
|
+
*
|
|
1807
|
+
* @fires {CustomEvent<{ open: boolean }>} accordion-item:toggle - Fired when the panel is expanded or collapsed.
|
|
1808
|
+
*
|
|
1635
1809
|
* @example
|
|
1636
1810
|
* ```html
|
|
1637
1811
|
* <wc-accordion-item>
|
|
1638
|
-
*
|
|
1812
|
+
* <span slot="heading">Personal information</span>
|
|
1813
|
+
* <span slot="description">Fill in your details</span>
|
|
1814
|
+
* <p>Content goes here.</p>
|
|
1639
1815
|
* </wc-accordion-item>
|
|
1640
1816
|
* ```
|
|
1641
1817
|
* @tags display
|
|
@@ -1645,17 +1821,25 @@ class AccordionItem extends i$1 {
|
|
|
1645
1821
|
super(...arguments);
|
|
1646
1822
|
_AccordionItem_id.set(this, crypto.randomUUID());
|
|
1647
1823
|
/**
|
|
1648
|
-
*
|
|
1649
|
-
*/
|
|
1650
|
-
this.heading = '';
|
|
1651
|
-
/**
|
|
1652
|
-
* If true, the user cannot interact with the button. Defaults to `false`.
|
|
1824
|
+
* Whether the user cannot interact with the panel.
|
|
1653
1825
|
*/
|
|
1654
1826
|
this.disabled = false;
|
|
1655
1827
|
/**
|
|
1656
|
-
*
|
|
1828
|
+
* Whether the panel is expanded.
|
|
1657
1829
|
*/
|
|
1658
1830
|
this.open = false;
|
|
1831
|
+
/**
|
|
1832
|
+
* Whether to hide the expand/collapse toggle indicator icon.
|
|
1833
|
+
*/
|
|
1834
|
+
this.hideToggle = false;
|
|
1835
|
+
/**
|
|
1836
|
+
* Position of the toggle icon relative to the panel title.
|
|
1837
|
+
* `'after'` places it at the trailing end (default, matches M3).
|
|
1838
|
+
* `'before'` places it at the leading start.
|
|
1839
|
+
*/
|
|
1840
|
+
this.togglePosition = 'after';
|
|
1841
|
+
this._hasDescriptionSlot = false;
|
|
1842
|
+
this._hasHeadingSlot = false;
|
|
1659
1843
|
}
|
|
1660
1844
|
focus() {
|
|
1661
1845
|
this.buttonElement?.focus();
|
|
@@ -1663,54 +1847,91 @@ class AccordionItem extends i$1 {
|
|
|
1663
1847
|
blur() {
|
|
1664
1848
|
this.buttonElement?.blur();
|
|
1665
1849
|
}
|
|
1666
|
-
|
|
1850
|
+
_handleToggle() {
|
|
1667
1851
|
if (this.disabled)
|
|
1668
1852
|
return;
|
|
1669
1853
|
this.open = !this.open;
|
|
1670
|
-
this.dispatchEvent(new CustomEvent('accordion-item
|
|
1854
|
+
this.dispatchEvent(new CustomEvent('accordion-item:toggle', {
|
|
1671
1855
|
bubbles: true,
|
|
1672
1856
|
composed: true,
|
|
1673
|
-
detail: { open: this.open
|
|
1857
|
+
detail: { open: this.open },
|
|
1674
1858
|
}));
|
|
1675
1859
|
}
|
|
1860
|
+
static _onSlotChange(e, setter) {
|
|
1861
|
+
const slot = e.target;
|
|
1862
|
+
const nodes = slot.assignedNodes({ flatten: true });
|
|
1863
|
+
setter(nodes.some(n => n.nodeType === Node.TEXT_NODE
|
|
1864
|
+
? (n.textContent?.trim() ?? '') !== ''
|
|
1865
|
+
: true));
|
|
1866
|
+
}
|
|
1867
|
+
_renderToggleIcon() {
|
|
1868
|
+
if (this.hideToggle)
|
|
1869
|
+
return A;
|
|
1870
|
+
return b `<wc-icon
|
|
1871
|
+
class="toggle-icon"
|
|
1872
|
+
name="keyboard_arrow_down"
|
|
1873
|
+
aria-hidden="true"
|
|
1874
|
+
></wc-icon>`;
|
|
1875
|
+
}
|
|
1676
1876
|
render() {
|
|
1677
|
-
return b
|
|
1678
|
-
|
|
1679
|
-
|
|
1877
|
+
return b `
|
|
1878
|
+
<div
|
|
1879
|
+
class=${e$3({
|
|
1880
|
+
'expansion-panel': true,
|
|
1680
1881
|
open: this.open,
|
|
1681
1882
|
disabled: this.disabled,
|
|
1682
1883
|
})}
|
|
1683
|
-
>
|
|
1684
|
-
<button
|
|
1685
|
-
id=${`accordion-heading-${__classPrivateFieldGet(this, _AccordionItem_id, "f")}`}
|
|
1686
|
-
tabindex="0"
|
|
1687
|
-
aria-controls=${`accordion-control-${__classPrivateFieldGet(this, _AccordionItem_id, "f")}`}
|
|
1688
|
-
class="accordion-heading"
|
|
1689
|
-
aria-disabled=${this.disabled}
|
|
1690
|
-
@click=${this.__handleToggle}
|
|
1691
|
-
aria-expanded=${this.open}
|
|
1692
1884
|
>
|
|
1693
|
-
<
|
|
1694
|
-
|
|
1695
|
-
|
|
1885
|
+
<button
|
|
1886
|
+
id=${`panel-header-${__classPrivateFieldGet(this, _AccordionItem_id, "f")}`}
|
|
1887
|
+
part="header"
|
|
1888
|
+
class="header-button"
|
|
1889
|
+
tabindex=${this.disabled ? '-1' : '0'}
|
|
1890
|
+
aria-controls=${`panel-content-${__classPrivateFieldGet(this, _AccordionItem_id, "f")}`}
|
|
1891
|
+
aria-disabled=${this.disabled}
|
|
1892
|
+
aria-expanded=${this.open}
|
|
1893
|
+
?disabled=${this.disabled}
|
|
1894
|
+
@click=${this._handleToggle}
|
|
1895
|
+
>
|
|
1896
|
+
${this.togglePosition === 'before' ? this._renderToggleIcon() : A}
|
|
1897
|
+
<span class="header-label">
|
|
1898
|
+
<span part="title" class="panel-title">
|
|
1899
|
+
<slot
|
|
1900
|
+
name="heading"
|
|
1901
|
+
@slotchange=${(e) => AccordionItem._onSlotChange(e, v => { this._hasHeadingSlot = v; })}
|
|
1902
|
+
></slot>
|
|
1903
|
+
</span>
|
|
1904
|
+
<span
|
|
1905
|
+
part="description"
|
|
1906
|
+
class="panel-description"
|
|
1907
|
+
?hidden=${!this._hasDescriptionSlot}
|
|
1908
|
+
>
|
|
1909
|
+
<slot
|
|
1910
|
+
name="description"
|
|
1911
|
+
@slotchange=${(e) => AccordionItem._onSlotChange(e, v => { this._hasDescriptionSlot = v; })}
|
|
1912
|
+
></slot>
|
|
1913
|
+
</span>
|
|
1914
|
+
</span>
|
|
1915
|
+
<slot name="header-actions" class="header-actions"></slot>
|
|
1916
|
+
${this.togglePosition === 'after' ? this._renderToggleIcon() : A}
|
|
1917
|
+
</button>
|
|
1918
|
+
<div
|
|
1919
|
+
id=${`panel-content-${__classPrivateFieldGet(this, _AccordionItem_id, "f")}`}
|
|
1920
|
+
part="content"
|
|
1921
|
+
class="panel-content"
|
|
1922
|
+
role="region"
|
|
1923
|
+
aria-labelledby=${`panel-header-${__classPrivateFieldGet(this, _AccordionItem_id, "f")}`}
|
|
1924
|
+
>
|
|
1925
|
+
<div class="content-inner">
|
|
1926
|
+
<slot></slot>
|
|
1927
|
+
</div>
|
|
1696
1928
|
</div>
|
|
1697
|
-
</button>
|
|
1698
|
-
<div
|
|
1699
|
-
class="item-section slot-main"
|
|
1700
|
-
id=${`accordion-control-${__classPrivateFieldGet(this, _AccordionItem_id, "f")}`}
|
|
1701
|
-
aria-labelledby=${`accordion-heading-${__classPrivateFieldGet(this, _AccordionItem_id, "f")}`}
|
|
1702
|
-
role="region"
|
|
1703
|
-
>
|
|
1704
|
-
<slot></slot>
|
|
1705
1929
|
</div>
|
|
1706
|
-
|
|
1930
|
+
`;
|
|
1707
1931
|
}
|
|
1708
1932
|
}
|
|
1709
1933
|
_AccordionItem_id = new WeakMap();
|
|
1710
|
-
AccordionItem.styles = [css_248z$
|
|
1711
|
-
__decorate([
|
|
1712
|
-
n({ type: String, reflect: true })
|
|
1713
|
-
], AccordionItem.prototype, "heading", void 0);
|
|
1934
|
+
AccordionItem.styles = [css_248z$K];
|
|
1714
1935
|
__decorate([
|
|
1715
1936
|
n({ type: Boolean, reflect: true })
|
|
1716
1937
|
], AccordionItem.prototype, "disabled", void 0);
|
|
@@ -1718,10 +1939,22 @@ __decorate([
|
|
|
1718
1939
|
n({ type: Boolean, reflect: true })
|
|
1719
1940
|
], AccordionItem.prototype, "open", void 0);
|
|
1720
1941
|
__decorate([
|
|
1721
|
-
|
|
1942
|
+
n({ type: Boolean, reflect: true, attribute: 'hide-toggle' })
|
|
1943
|
+
], AccordionItem.prototype, "hideToggle", void 0);
|
|
1944
|
+
__decorate([
|
|
1945
|
+
n({ type: String, reflect: true, attribute: 'toggle-position' })
|
|
1946
|
+
], AccordionItem.prototype, "togglePosition", void 0);
|
|
1947
|
+
__decorate([
|
|
1948
|
+
r()
|
|
1949
|
+
], AccordionItem.prototype, "_hasDescriptionSlot", void 0);
|
|
1950
|
+
__decorate([
|
|
1951
|
+
r()
|
|
1952
|
+
], AccordionItem.prototype, "_hasHeadingSlot", void 0);
|
|
1953
|
+
__decorate([
|
|
1954
|
+
e$4('.header-button')
|
|
1722
1955
|
], AccordionItem.prototype, "buttonElement", void 0);
|
|
1723
1956
|
|
|
1724
|
-
var css_248z$
|
|
1957
|
+
var css_248z$J = i`* {
|
|
1725
1958
|
box-sizing: border-box;
|
|
1726
1959
|
}
|
|
1727
1960
|
|
|
@@ -1733,27 +1966,38 @@ var css_248z$F = i`* {
|
|
|
1733
1966
|
display: block;
|
|
1734
1967
|
}
|
|
1735
1968
|
|
|
1736
|
-
|
|
1737
|
-
|
|
1969
|
+
.accordion {
|
|
1970
|
+
display: flex;
|
|
1971
|
+
flex-direction: column;
|
|
1972
|
+
gap: var(--spacing-100);
|
|
1738
1973
|
}
|
|
1739
1974
|
|
|
1740
|
-
|
|
1741
|
-
|
|
1742
|
-
|
|
1975
|
+
:host([display-mode=flat]) .accordion {
|
|
1976
|
+
gap: 0;
|
|
1977
|
+
}
|
|
1978
|
+
:host([display-mode=flat]) slot::slotted(wc-accordion-item) {
|
|
1979
|
+
--_accordion-item-border: none;
|
|
1980
|
+
--_accordion-item-background: transparent;
|
|
1743
1981
|
}`;
|
|
1744
1982
|
|
|
1745
1983
|
/**
|
|
1746
1984
|
* @label Accordion
|
|
1747
1985
|
* @tag wc-accordion
|
|
1748
1986
|
* @rawTag accordion
|
|
1749
|
-
* @summary
|
|
1987
|
+
* @summary A vertically stacked set of expansion panels. Follows Material Design 3 expansion panel guidelines.
|
|
1750
1988
|
*
|
|
1751
1989
|
* @example
|
|
1752
1990
|
* ```html
|
|
1753
1991
|
* <wc-accordion>
|
|
1754
|
-
*
|
|
1755
|
-
*
|
|
1756
|
-
* </
|
|
1992
|
+
* <wc-accordion-item>
|
|
1993
|
+
* <span slot="heading">Panel 1</span>
|
|
1994
|
+
* <span slot="description">Summary text</span>
|
|
1995
|
+
* Content
|
|
1996
|
+
* </wc-accordion-item>
|
|
1997
|
+
* <wc-accordion-item>
|
|
1998
|
+
* <span slot="heading">Panel 2</span>
|
|
1999
|
+
* Content
|
|
2000
|
+
* </wc-accordion-item>
|
|
1757
2001
|
* </wc-accordion>
|
|
1758
2002
|
* ```
|
|
1759
2003
|
* @tags display
|
|
@@ -1761,7 +2005,17 @@ slot::slotted(:last-child) {
|
|
|
1761
2005
|
class Accordion extends i$1 {
|
|
1762
2006
|
constructor() {
|
|
1763
2007
|
super(...arguments);
|
|
1764
|
-
|
|
2008
|
+
/**
|
|
2009
|
+
* Whether multiple panels can be expanded simultaneously.
|
|
2010
|
+
* When `false` (default), expanding one panel collapses all others.
|
|
2011
|
+
*/
|
|
2012
|
+
this.multi = false;
|
|
2013
|
+
/**
|
|
2014
|
+
* Display mode for the accordion.
|
|
2015
|
+
* `'default'` renders panels with a subtle background on expand and dividers between items.
|
|
2016
|
+
* `'flat'` renders panels without borders or background changes — suitable for use inside cards.
|
|
2017
|
+
*/
|
|
2018
|
+
this.displayMode = 'default';
|
|
1765
2019
|
}
|
|
1766
2020
|
connectedCallback() {
|
|
1767
2021
|
super.connectedCallback();
|
|
@@ -1773,17 +2027,15 @@ class Accordion extends i$1 {
|
|
|
1773
2027
|
disconnectedCallback() {
|
|
1774
2028
|
super.disconnectedCallback();
|
|
1775
2029
|
// @ts-ignore
|
|
1776
|
-
// eslint-disable-next-line no-undef
|
|
1777
2030
|
this.removeEventListener('accordion-item:toggle', this._onItemToggle);
|
|
1778
2031
|
this.removeEventListener('keydown', this._onKeyDown);
|
|
1779
2032
|
}
|
|
1780
2033
|
_onItemToggle(e) {
|
|
1781
2034
|
const targetItem = e.target;
|
|
1782
|
-
//
|
|
1783
|
-
// We check if the target item is a direct child of *this* accordion
|
|
2035
|
+
// Ignore events from nested accordions — only handle direct children
|
|
1784
2036
|
if (targetItem.parentElement !== this)
|
|
1785
2037
|
return;
|
|
1786
|
-
if (!this.
|
|
2038
|
+
if (!this.multi && targetItem.open) {
|
|
1787
2039
|
this.items.forEach(item => {
|
|
1788
2040
|
if (item !== targetItem && item.open) {
|
|
1789
2041
|
// eslint-disable-next-line no-param-reassign
|
|
@@ -1793,16 +2045,10 @@ class Accordion extends i$1 {
|
|
|
1793
2045
|
}
|
|
1794
2046
|
}
|
|
1795
2047
|
_onKeyDown(e) {
|
|
1796
|
-
// 1. Find which item currently has its HEADER focused.
|
|
1797
|
-
// We check the shadowRoot of each item to see if the internal <button> is the active element.
|
|
1798
2048
|
const focusedItemIndex = this.items.findIndex(item => {
|
|
1799
|
-
// Access the Shadow DOM of the item
|
|
1800
2049
|
const root = item.shadowRoot;
|
|
1801
|
-
|
|
1802
|
-
return root?.activeElement?.classList.contains('accordion-heading');
|
|
2050
|
+
return root?.activeElement?.classList.contains('header-button');
|
|
1803
2051
|
});
|
|
1804
|
-
// 2. If no header is focused (e.g., focus is on body content or outside), do nothing.
|
|
1805
|
-
// This prevents stealing focus when the user is typing in a form inside the accordion.
|
|
1806
2052
|
if (focusedItemIndex === -1)
|
|
1807
2053
|
return;
|
|
1808
2054
|
let nextIndex = -1;
|
|
@@ -1810,12 +2056,10 @@ class Accordion extends i$1 {
|
|
|
1810
2056
|
switch (e.key) {
|
|
1811
2057
|
case 'ArrowDown':
|
|
1812
2058
|
e.preventDefault();
|
|
1813
|
-
// Cycle next
|
|
1814
2059
|
nextIndex = (focusedItemIndex + 1) % this.items.length;
|
|
1815
2060
|
break;
|
|
1816
2061
|
case 'ArrowUp':
|
|
1817
2062
|
e.preventDefault();
|
|
1818
|
-
// Cycle previous
|
|
1819
2063
|
nextIndex =
|
|
1820
2064
|
(focusedItemIndex - 1 + this.items.length) % this.items.length;
|
|
1821
2065
|
break;
|
|
@@ -1828,11 +2072,9 @@ class Accordion extends i$1 {
|
|
|
1828
2072
|
nextIndex = this.items.length - 1;
|
|
1829
2073
|
break;
|
|
1830
2074
|
}
|
|
1831
|
-
// 3. Apply Focus
|
|
1832
2075
|
if (nextIndex !== -1) {
|
|
1833
2076
|
const itemToFocus = this.items[nextIndex];
|
|
1834
|
-
|
|
1835
|
-
const button = itemToFocus.shadowRoot?.querySelector('.accordion-heading');
|
|
2077
|
+
const button = itemToFocus.shadowRoot?.querySelector('.header-button');
|
|
1836
2078
|
button?.focus();
|
|
1837
2079
|
}
|
|
1838
2080
|
}
|
|
@@ -1840,16 +2082,19 @@ class Accordion extends i$1 {
|
|
|
1840
2082
|
return b `<div class="accordion"><slot></slot></div>`;
|
|
1841
2083
|
}
|
|
1842
2084
|
}
|
|
1843
|
-
Accordion.styles = [css_248z$
|
|
2085
|
+
Accordion.styles = [css_248z$J];
|
|
1844
2086
|
Accordion.Item = AccordionItem;
|
|
1845
2087
|
__decorate([
|
|
1846
|
-
n({ type: Boolean,
|
|
1847
|
-
], Accordion.prototype, "
|
|
2088
|
+
n({ type: Boolean, reflect: true })
|
|
2089
|
+
], Accordion.prototype, "multi", void 0);
|
|
2090
|
+
__decorate([
|
|
2091
|
+
n({ type: String, reflect: true, attribute: 'display-mode' })
|
|
2092
|
+
], Accordion.prototype, "displayMode", void 0);
|
|
1848
2093
|
__decorate([
|
|
1849
|
-
o$
|
|
2094
|
+
o$1({ selector: 'wc-accordion-item' })
|
|
1850
2095
|
], Accordion.prototype, "items", void 0);
|
|
1851
2096
|
|
|
1852
|
-
var css_248z$
|
|
2097
|
+
var css_248z$I = i`* {
|
|
1853
2098
|
box-sizing: border-box;
|
|
1854
2099
|
}
|
|
1855
2100
|
|
|
@@ -1899,14 +2144,7 @@ var css_248z$E = i`* {
|
|
|
1899
2144
|
* <wc-link href="#">Link</wc-link>
|
|
1900
2145
|
* ```
|
|
1901
2146
|
*/
|
|
1902
|
-
class Link extends i$1 {
|
|
1903
|
-
constructor() {
|
|
1904
|
-
super(...arguments);
|
|
1905
|
-
/**
|
|
1906
|
-
* Sets or retrieves the window or frame at which to target content.
|
|
1907
|
-
*/
|
|
1908
|
-
this.target = '_self';
|
|
1909
|
-
}
|
|
2147
|
+
class Link extends BaseHyperlinkMixin(i$1) {
|
|
1910
2148
|
render() {
|
|
1911
2149
|
return b `<a
|
|
1912
2150
|
class=${e$3({
|
|
@@ -1920,18 +2158,9 @@ class Link extends i$1 {
|
|
|
1920
2158
|
</a>`;
|
|
1921
2159
|
}
|
|
1922
2160
|
}
|
|
1923
|
-
Link.styles = [css_248z$
|
|
1924
|
-
__decorate([
|
|
1925
|
-
n({ reflect: true })
|
|
1926
|
-
], Link.prototype, "href", void 0);
|
|
1927
|
-
__decorate([
|
|
1928
|
-
n()
|
|
1929
|
-
], Link.prototype, "target", void 0);
|
|
1930
|
-
__decorate([
|
|
1931
|
-
r()
|
|
1932
|
-
], Link.prototype, "tabIndexValue", void 0);
|
|
2161
|
+
Link.styles = [css_248z$I];
|
|
1933
2162
|
|
|
1934
|
-
var css_248z$
|
|
2163
|
+
var css_248z$H = i`* {
|
|
1935
2164
|
box-sizing: border-box;
|
|
1936
2165
|
}
|
|
1937
2166
|
|
|
@@ -2068,7 +2297,7 @@ slot::slotted(*) {
|
|
|
2068
2297
|
--_container-state-opacity: 0.08;
|
|
2069
2298
|
}`;
|
|
2070
2299
|
|
|
2071
|
-
var css_248z$
|
|
2300
|
+
var css_248z$G = i`:host([color=default]) {
|
|
2072
2301
|
--filled-tag-container-color: var(--color-surface);
|
|
2073
2302
|
--filled-tag-label-text-color: var(--color-on-surface);
|
|
2074
2303
|
--tonal-tag-container-color: var(--color-surface-container);
|
|
@@ -2134,7 +2363,7 @@ var css_248z$C = i`:host([color=default]) {
|
|
|
2134
2363
|
--outlined-tag-label-text-color: var(--color-purple);
|
|
2135
2364
|
}`;
|
|
2136
2365
|
|
|
2137
|
-
var css_248z$
|
|
2366
|
+
var css_248z$F = i`.tag {
|
|
2138
2367
|
font-family: var(--font-family-sans) !important;
|
|
2139
2368
|
}
|
|
2140
2369
|
|
|
@@ -2233,7 +2462,7 @@ class Tag extends i$1 {
|
|
|
2233
2462
|
}
|
|
2234
2463
|
// Define styles (Lit handles Scoping via Shadow DOM by default)
|
|
2235
2464
|
// You would typically import your tag.scss.js here or use the css tag
|
|
2236
|
-
Tag.styles = [css_248z$
|
|
2465
|
+
Tag.styles = [css_248z$H, css_248z$G, css_248z$F];
|
|
2237
2466
|
__decorate([
|
|
2238
2467
|
n({ type: Boolean })
|
|
2239
2468
|
], Tag.prototype, "dismissible", void 0);
|
|
@@ -2247,7 +2476,7 @@ __decorate([
|
|
|
2247
2476
|
n()
|
|
2248
2477
|
], Tag.prototype, "size", void 0);
|
|
2249
2478
|
|
|
2250
|
-
var css_248z$
|
|
2479
|
+
var css_248z$E = i`* {
|
|
2251
2480
|
box-sizing: border-box;
|
|
2252
2481
|
}
|
|
2253
2482
|
|
|
@@ -2359,7 +2588,7 @@ var css_248z$A = i`* {
|
|
|
2359
2588
|
color: var(--background);
|
|
2360
2589
|
}`;
|
|
2361
2590
|
|
|
2362
|
-
var css_248z$
|
|
2591
|
+
var css_248z$D = i`:host([color=red]) {
|
|
2363
2592
|
--chip-container-color: var(--color-red-container);
|
|
2364
2593
|
--chip-outline-color: var(--color-on-red-container);
|
|
2365
2594
|
}
|
|
@@ -2388,7 +2617,7 @@ var css_248z$z = i`:host([color=red]) {
|
|
|
2388
2617
|
--chip-outline-color: var(--color-on-purple-container);
|
|
2389
2618
|
}`;
|
|
2390
2619
|
|
|
2391
|
-
var css_248z$
|
|
2620
|
+
var css_248z$C = i`.tag {
|
|
2392
2621
|
font-family: var(--font-family-sans) !important;
|
|
2393
2622
|
}
|
|
2394
2623
|
|
|
@@ -2526,7 +2755,7 @@ class Chip extends i$1 {
|
|
|
2526
2755
|
}
|
|
2527
2756
|
// Define styles (Lit handles Scoping via Shadow DOM by default)
|
|
2528
2757
|
// You would typically import your tag.scss.js here or use the css tag
|
|
2529
|
-
Chip.styles = [css_248z$
|
|
2758
|
+
Chip.styles = [css_248z$E, css_248z$D, css_248z$C];
|
|
2530
2759
|
__decorate([
|
|
2531
2760
|
n({ type: Boolean })
|
|
2532
2761
|
], Chip.prototype, "dismissible", void 0);
|
|
@@ -2543,7 +2772,7 @@ __decorate([
|
|
|
2543
2772
|
n({ type: String })
|
|
2544
2773
|
], Chip.prototype, "imageSrc", void 0);
|
|
2545
2774
|
|
|
2546
|
-
var css_248z$
|
|
2775
|
+
var css_248z$B = i`:host {
|
|
2547
2776
|
display: block;
|
|
2548
2777
|
--progress-height: 0.25rem;
|
|
2549
2778
|
--progress-container-color: var(--color-primary);
|
|
@@ -2733,7 +2962,7 @@ class LinearProgress extends BaseProgress {
|
|
|
2733
2962
|
<div class="track track-start"></div>
|
|
2734
2963
|
<div
|
|
2735
2964
|
class="active-indicator"
|
|
2736
|
-
style="${o$
|
|
2965
|
+
style="${o$2({
|
|
2737
2966
|
width: `${this.__getPercentageValue()}%`,
|
|
2738
2967
|
})}"
|
|
2739
2968
|
></div>
|
|
@@ -2749,9 +2978,9 @@ class LinearProgress extends BaseProgress {
|
|
|
2749
2978
|
}
|
|
2750
2979
|
}
|
|
2751
2980
|
// Lit components use static styles for better performance
|
|
2752
|
-
LinearProgress.styles = [css_248z$
|
|
2981
|
+
LinearProgress.styles = [css_248z$B];
|
|
2753
2982
|
|
|
2754
|
-
var css_248z$
|
|
2983
|
+
var css_248z$A = i`:host {
|
|
2755
2984
|
display: inline-block;
|
|
2756
2985
|
--progress-height: 1.5rem;
|
|
2757
2986
|
--progress-line-thickness: 4px;
|
|
@@ -2893,7 +3122,7 @@ class CircularProgress extends BaseProgress {
|
|
|
2893
3122
|
cx="8"
|
|
2894
3123
|
cy="8"
|
|
2895
3124
|
r="6"
|
|
2896
|
-
style="${o$
|
|
3125
|
+
style="${o$2({
|
|
2897
3126
|
strokeDasharray: `${circumference}`,
|
|
2898
3127
|
strokeDashoffset: this.indeterminate ? undefined : `${offset}`,
|
|
2899
3128
|
})}"
|
|
@@ -2914,47 +3143,47 @@ class CircularProgress extends BaseProgress {
|
|
|
2914
3143
|
}
|
|
2915
3144
|
}
|
|
2916
3145
|
// Lit components use static styles for better performance
|
|
2917
|
-
CircularProgress.styles = [css_248z$
|
|
3146
|
+
CircularProgress.styles = [css_248z$A];
|
|
3147
|
+
|
|
3148
|
+
var css_248z$z = i`* {
|
|
3149
|
+
box-sizing: border-box;
|
|
3150
|
+
}
|
|
3151
|
+
|
|
3152
|
+
.screen-reader-only {
|
|
3153
|
+
display: none !important;
|
|
3154
|
+
}
|
|
2918
3155
|
|
|
2919
|
-
|
|
3156
|
+
:host {
|
|
3157
|
+
position: relative;
|
|
3158
|
+
inset: 0;
|
|
2920
3159
|
--skeleton-container-color: var(--color-surface-container);
|
|
2921
3160
|
--skeleton-element: var(--color-on-surface);
|
|
2922
|
-
display:
|
|
2923
|
-
|
|
2924
|
-
width: 10rem;
|
|
3161
|
+
display: flex;
|
|
3162
|
+
pointer-events: none;
|
|
2925
3163
|
}
|
|
2926
3164
|
|
|
2927
|
-
.skeleton
|
|
2928
|
-
|
|
2929
|
-
|
|
2930
|
-
|
|
3165
|
+
.skeleton,
|
|
3166
|
+
.skeleton::before {
|
|
3167
|
+
inset: 0;
|
|
3168
|
+
position: absolute;
|
|
3169
|
+
border-start-start-radius: var(--skeleton-container-shape-start-start, var(--skeleton-container-shape));
|
|
3170
|
+
border-start-end-radius: var(--skeleton-container-shape-start-end, var(--skeleton-container-shape));
|
|
3171
|
+
border-end-start-radius: var(--skeleton-container-shape-end-start, var(--skeleton-container-shape));
|
|
3172
|
+
border-end-end-radius: var(--skeleton-container-shape-end-end, var(--skeleton-container-shape));
|
|
3173
|
+
corner-shape: var(--skeleton-container-shape-variant);
|
|
3174
|
+
}
|
|
3175
|
+
|
|
3176
|
+
.skeleton {
|
|
2931
3177
|
background: var(--skeleton-container-color);
|
|
2932
|
-
box-shadow: none;
|
|
2933
3178
|
overflow: hidden;
|
|
2934
|
-
pointer-events: none;
|
|
2935
|
-
width: 100%;
|
|
2936
|
-
height: 100%;
|
|
2937
|
-
border-start-start-radius: var(--skeleton-container-shape-start-start);
|
|
2938
|
-
border-start-end-radius: var(--skeleton-container-shape-start-end);
|
|
2939
|
-
border-end-start-radius: var(--skeleton-container-shape-end-start);
|
|
2940
|
-
border-end-end-radius: var(--skeleton-container-shape-end-end);
|
|
2941
|
-
corner-shape: var(--skeleton-container-shape-variant);
|
|
2942
3179
|
}
|
|
2943
3180
|
.skeleton::before {
|
|
2944
|
-
position: absolute;
|
|
2945
|
-
left: 0;
|
|
2946
|
-
top: 0;
|
|
2947
3181
|
animation: 3s ease-in-out skeleton infinite;
|
|
2948
3182
|
background: var(--skeleton-element);
|
|
2949
3183
|
block-size: 100%;
|
|
2950
3184
|
content: "";
|
|
2951
3185
|
inline-size: 100%;
|
|
2952
3186
|
will-change: transform-origin, transform, opacity;
|
|
2953
|
-
border-start-start-radius: var(--skeleton-container-shape-start-start);
|
|
2954
|
-
border-start-end-radius: var(--skeleton-container-shape-start-end);
|
|
2955
|
-
border-end-start-radius: var(--skeleton-container-shape-end-start);
|
|
2956
|
-
border-end-end-radius: var(--skeleton-container-shape-end-end);
|
|
2957
|
-
corner-shape: var(--skeleton-container-shape-variant);
|
|
2958
3187
|
}
|
|
2959
3188
|
|
|
2960
3189
|
@keyframes skeleton {
|
|
@@ -3020,12 +3249,12 @@ class Skeleton extends i$1 {
|
|
|
3020
3249
|
return b ` <div class="skeleton"></div>`;
|
|
3021
3250
|
}
|
|
3022
3251
|
}
|
|
3023
|
-
Skeleton.styles = [css_248z$
|
|
3252
|
+
Skeleton.styles = [css_248z$z];
|
|
3024
3253
|
__decorate([
|
|
3025
3254
|
n({ type: Boolean, reflect: true })
|
|
3026
3255
|
], Skeleton.prototype, "visible", void 0);
|
|
3027
3256
|
|
|
3028
|
-
var css_248z$
|
|
3257
|
+
var css_248z$y = i`* {
|
|
3029
3258
|
box-sizing: border-box;
|
|
3030
3259
|
}
|
|
3031
3260
|
|
|
@@ -3183,11 +3412,13 @@ class Input extends BaseInput {
|
|
|
3183
3412
|
<wc-icon-button
|
|
3184
3413
|
class="password-toggle"
|
|
3185
3414
|
variant="text"
|
|
3186
|
-
name=${this.passwordVisible ? 'visibility_off' : 'visibility'}
|
|
3187
3415
|
@click=${() => {
|
|
3188
3416
|
this.passwordVisible = !this.passwordVisible;
|
|
3189
3417
|
}}
|
|
3190
3418
|
>
|
|
3419
|
+
<wc-icon
|
|
3420
|
+
name=${this.passwordVisible ? 'visibility_off' : 'visibility'}
|
|
3421
|
+
></wc-icon>
|
|
3191
3422
|
</wc-icon-button>
|
|
3192
3423
|
</pc-tooltip>
|
|
3193
3424
|
`
|
|
@@ -3198,7 +3429,7 @@ class Input extends BaseInput {
|
|
|
3198
3429
|
`;
|
|
3199
3430
|
}
|
|
3200
3431
|
}
|
|
3201
|
-
Input.styles = [css_248z$
|
|
3432
|
+
Input.styles = [css_248z$y];
|
|
3202
3433
|
__decorate([
|
|
3203
3434
|
n({ type: String })
|
|
3204
3435
|
], Input.prototype, "value", void 0);
|
|
@@ -3257,7 +3488,290 @@ __decorate([
|
|
|
3257
3488
|
e$4('.input-element')
|
|
3258
3489
|
], Input.prototype, "inputElement", void 0);
|
|
3259
3490
|
|
|
3260
|
-
var css_248z$
|
|
3491
|
+
var css_248z$x = i`* {
|
|
3492
|
+
box-sizing: border-box;
|
|
3493
|
+
}
|
|
3494
|
+
|
|
3495
|
+
.screen-reader-only {
|
|
3496
|
+
display: none !important;
|
|
3497
|
+
}
|
|
3498
|
+
|
|
3499
|
+
:host {
|
|
3500
|
+
display: block;
|
|
3501
|
+
width: 100%;
|
|
3502
|
+
}
|
|
3503
|
+
|
|
3504
|
+
.url-input {
|
|
3505
|
+
flex: 1;
|
|
3506
|
+
width: 100%;
|
|
3507
|
+
border: none;
|
|
3508
|
+
outline: none;
|
|
3509
|
+
margin: 0;
|
|
3510
|
+
padding: 0;
|
|
3511
|
+
background: none;
|
|
3512
|
+
cursor: inherit;
|
|
3513
|
+
font: inherit;
|
|
3514
|
+
color: inherit;
|
|
3515
|
+
}
|
|
3516
|
+
|
|
3517
|
+
.url-display {
|
|
3518
|
+
flex: 1;
|
|
3519
|
+
display: flex;
|
|
3520
|
+
align-items: center;
|
|
3521
|
+
overflow: hidden;
|
|
3522
|
+
}
|
|
3523
|
+
|
|
3524
|
+
.url-link {
|
|
3525
|
+
flex: 1;
|
|
3526
|
+
overflow: hidden;
|
|
3527
|
+
text-overflow: ellipsis;
|
|
3528
|
+
white-space: nowrap;
|
|
3529
|
+
color: var(--color-primary);
|
|
3530
|
+
text-decoration: none;
|
|
3531
|
+
}
|
|
3532
|
+
.url-link:hover {
|
|
3533
|
+
text-decoration: underline;
|
|
3534
|
+
}
|
|
3535
|
+
|
|
3536
|
+
.url-placeholder {
|
|
3537
|
+
color: var(--color-on-surface-variant);
|
|
3538
|
+
opacity: 0.6;
|
|
3539
|
+
}
|
|
3540
|
+
|
|
3541
|
+
.edit-button {
|
|
3542
|
+
--button-container-shape: var(--shape-corner-full);
|
|
3543
|
+
}`;
|
|
3544
|
+
|
|
3545
|
+
/**
|
|
3546
|
+
* @label URL Field
|
|
3547
|
+
* @tag wc-url-field
|
|
3548
|
+
* @rawTag url-field
|
|
3549
|
+
*
|
|
3550
|
+
* @summary A field for entering and displaying URLs with validation.
|
|
3551
|
+
* @overview
|
|
3552
|
+
* <p>URL Field wraps an input with URL validation, showing a clickable link preview when not in edit mode.</p>
|
|
3553
|
+
*
|
|
3554
|
+
* @example
|
|
3555
|
+
* ```html
|
|
3556
|
+
* <wc-url-field label="Website" value="https://example.com"></wc-url-field>
|
|
3557
|
+
* ```
|
|
3558
|
+
* @tags form
|
|
3559
|
+
*/
|
|
3560
|
+
class UrlField extends BaseInput {
|
|
3561
|
+
constructor() {
|
|
3562
|
+
super(...arguments);
|
|
3563
|
+
this.value = '';
|
|
3564
|
+
this.name = '';
|
|
3565
|
+
this.placeholder = '';
|
|
3566
|
+
this.label = '';
|
|
3567
|
+
this.editing = false;
|
|
3568
|
+
this.debounce = 300;
|
|
3569
|
+
this.size = 'md';
|
|
3570
|
+
this.variant = 'default';
|
|
3571
|
+
this.helperText = '';
|
|
3572
|
+
this.error = false;
|
|
3573
|
+
this.errorText = '';
|
|
3574
|
+
this.warning = false;
|
|
3575
|
+
this.warningText = '';
|
|
3576
|
+
this.focused = false;
|
|
3577
|
+
this.isValid = true;
|
|
3578
|
+
}
|
|
3579
|
+
disconnectedCallback() {
|
|
3580
|
+
super.disconnectedCallback();
|
|
3581
|
+
if (this.debounceTimer) {
|
|
3582
|
+
clearTimeout(this.debounceTimer);
|
|
3583
|
+
}
|
|
3584
|
+
}
|
|
3585
|
+
focus() {
|
|
3586
|
+
if (!this.editing && !this.disabled && !this.readonly) {
|
|
3587
|
+
this.startEditing();
|
|
3588
|
+
return;
|
|
3589
|
+
}
|
|
3590
|
+
this.inputElement?.focus();
|
|
3591
|
+
}
|
|
3592
|
+
blur() {
|
|
3593
|
+
this.inputElement?.blur();
|
|
3594
|
+
}
|
|
3595
|
+
startEditing() {
|
|
3596
|
+
if (this.disabled || this.readonly)
|
|
3597
|
+
return;
|
|
3598
|
+
this.editing = true;
|
|
3599
|
+
setTimeout(() => this.inputElement?.focus(), 80);
|
|
3600
|
+
}
|
|
3601
|
+
closeEditing() {
|
|
3602
|
+
this.isValid = this.validateUrl(this.value);
|
|
3603
|
+
this.dispatchEvent(new CustomEvent('input-invalid', {
|
|
3604
|
+
detail: !this.isValid,
|
|
3605
|
+
bubbles: true,
|
|
3606
|
+
composed: true,
|
|
3607
|
+
}));
|
|
3608
|
+
if (this.isValid) {
|
|
3609
|
+
this.editing = false;
|
|
3610
|
+
}
|
|
3611
|
+
}
|
|
3612
|
+
validateUrl(url) {
|
|
3613
|
+
if (!url)
|
|
3614
|
+
return true;
|
|
3615
|
+
try {
|
|
3616
|
+
new URL(url);
|
|
3617
|
+
return true;
|
|
3618
|
+
}
|
|
3619
|
+
catch {
|
|
3620
|
+
return false;
|
|
3621
|
+
}
|
|
3622
|
+
}
|
|
3623
|
+
handleInput(event) {
|
|
3624
|
+
this.value = event.target.value;
|
|
3625
|
+
this.isValid = true;
|
|
3626
|
+
if (this.debounceTimer) {
|
|
3627
|
+
clearTimeout(this.debounceTimer);
|
|
3628
|
+
}
|
|
3629
|
+
this.debounceTimer = setTimeout(() => {
|
|
3630
|
+
this.dispatchEvent(new CustomEvent('value-change', {
|
|
3631
|
+
detail: this.value,
|
|
3632
|
+
bubbles: true,
|
|
3633
|
+
composed: true,
|
|
3634
|
+
}));
|
|
3635
|
+
}, this.debounce);
|
|
3636
|
+
}
|
|
3637
|
+
handleFocusChange() {
|
|
3638
|
+
this.focused = this.inputElement?.matches(':focus') ?? false;
|
|
3639
|
+
}
|
|
3640
|
+
handleBlur() {
|
|
3641
|
+
this.focused = false;
|
|
3642
|
+
this.closeEditing();
|
|
3643
|
+
}
|
|
3644
|
+
handleChange(event) {
|
|
3645
|
+
redispatchEvent(this, event);
|
|
3646
|
+
}
|
|
3647
|
+
renderDisplayValue() {
|
|
3648
|
+
if (!this.value) {
|
|
3649
|
+
return b `<span class="url-placeholder">${this.placeholder}</span>`;
|
|
3650
|
+
}
|
|
3651
|
+
return b `
|
|
3652
|
+
<a
|
|
3653
|
+
class="url-link"
|
|
3654
|
+
href=${this.value}
|
|
3655
|
+
target="_blank"
|
|
3656
|
+
rel="noopener noreferrer"
|
|
3657
|
+
>
|
|
3658
|
+
${this.value}
|
|
3659
|
+
</a>
|
|
3660
|
+
`;
|
|
3661
|
+
}
|
|
3662
|
+
render() {
|
|
3663
|
+
const hasValue = !!this.value;
|
|
3664
|
+
const showInvalidState = this.error || !this.isValid;
|
|
3665
|
+
const resolvedErrorText = !this.isValid
|
|
3666
|
+
? 'Please enter a valid URL'
|
|
3667
|
+
: this.errorText;
|
|
3668
|
+
return b `
|
|
3669
|
+
<wc-field
|
|
3670
|
+
label=${this.label}
|
|
3671
|
+
?required=${this.required}
|
|
3672
|
+
?disabled=${this.disabled}
|
|
3673
|
+
?readonly=${this.readonly}
|
|
3674
|
+
?skeleton=${this.skeleton}
|
|
3675
|
+
helper-text=${this.helperText}
|
|
3676
|
+
?error=${showInvalidState}
|
|
3677
|
+
error-text=${resolvedErrorText}
|
|
3678
|
+
?warning=${this.warning}
|
|
3679
|
+
warning-text=${this.warningText}
|
|
3680
|
+
variant=${this.variant}
|
|
3681
|
+
?populated=${hasValue || this.editing}
|
|
3682
|
+
?focused=${this.focused}
|
|
3683
|
+
.host=${this}
|
|
3684
|
+
class="url-field-wrapper"
|
|
3685
|
+
>
|
|
3686
|
+
${this.editing
|
|
3687
|
+
? b `
|
|
3688
|
+
<input
|
|
3689
|
+
class="url-input"
|
|
3690
|
+
name=${this.name}
|
|
3691
|
+
type="url"
|
|
3692
|
+
placeholder=${this.placeholder}
|
|
3693
|
+
.value=${this.value}
|
|
3694
|
+
?readonly=${this.readonly}
|
|
3695
|
+
?required=${this.required}
|
|
3696
|
+
?disabled=${this.disabled}
|
|
3697
|
+
@input=${this.handleInput}
|
|
3698
|
+
@change=${this.handleChange}
|
|
3699
|
+
@focus=${this.handleFocusChange}
|
|
3700
|
+
@blur=${this.handleBlur}
|
|
3701
|
+
/>
|
|
3702
|
+
`
|
|
3703
|
+
: b `<div class="url-display">${this.renderDisplayValue()}</div>`}
|
|
3704
|
+
|
|
3705
|
+
${!this.editing && !this.disabled && !this.readonly
|
|
3706
|
+
? b `
|
|
3707
|
+
<wc-icon-button
|
|
3708
|
+
class="edit-button"
|
|
3709
|
+
slot="field-end"
|
|
3710
|
+
variant="text"
|
|
3711
|
+
@click=${(event) => {
|
|
3712
|
+
event.stopPropagation();
|
|
3713
|
+
this.startEditing();
|
|
3714
|
+
}}
|
|
3715
|
+
>
|
|
3716
|
+
<wc-icon name="edit"></wc-icon>
|
|
3717
|
+
</wc-icon-button>
|
|
3718
|
+
`
|
|
3719
|
+
: A}
|
|
3720
|
+
</wc-field>
|
|
3721
|
+
`;
|
|
3722
|
+
}
|
|
3723
|
+
}
|
|
3724
|
+
UrlField.styles = [css_248z$x];
|
|
3725
|
+
__decorate([
|
|
3726
|
+
n({ type: String })
|
|
3727
|
+
], UrlField.prototype, "value", void 0);
|
|
3728
|
+
__decorate([
|
|
3729
|
+
n({ type: String })
|
|
3730
|
+
], UrlField.prototype, "name", void 0);
|
|
3731
|
+
__decorate([
|
|
3732
|
+
n({ type: String })
|
|
3733
|
+
], UrlField.prototype, "placeholder", void 0);
|
|
3734
|
+
__decorate([
|
|
3735
|
+
n({ type: String })
|
|
3736
|
+
], UrlField.prototype, "label", void 0);
|
|
3737
|
+
__decorate([
|
|
3738
|
+
n({ type: Boolean, reflect: true })
|
|
3739
|
+
], UrlField.prototype, "editing", void 0);
|
|
3740
|
+
__decorate([
|
|
3741
|
+
n({ type: Number })
|
|
3742
|
+
], UrlField.prototype, "debounce", void 0);
|
|
3743
|
+
__decorate([
|
|
3744
|
+
n({ type: String, reflect: true })
|
|
3745
|
+
], UrlField.prototype, "size", void 0);
|
|
3746
|
+
__decorate([
|
|
3747
|
+
n({ type: String })
|
|
3748
|
+
], UrlField.prototype, "variant", void 0);
|
|
3749
|
+
__decorate([
|
|
3750
|
+
n({ type: String, attribute: 'helper-text' })
|
|
3751
|
+
], UrlField.prototype, "helperText", void 0);
|
|
3752
|
+
__decorate([
|
|
3753
|
+
n({ type: Boolean })
|
|
3754
|
+
], UrlField.prototype, "error", void 0);
|
|
3755
|
+
__decorate([
|
|
3756
|
+
n({ type: String, attribute: 'error-text' })
|
|
3757
|
+
], UrlField.prototype, "errorText", void 0);
|
|
3758
|
+
__decorate([
|
|
3759
|
+
n({ type: Boolean })
|
|
3760
|
+
], UrlField.prototype, "warning", void 0);
|
|
3761
|
+
__decorate([
|
|
3762
|
+
n({ type: String, attribute: 'warning-text' })
|
|
3763
|
+
], UrlField.prototype, "warningText", void 0);
|
|
3764
|
+
__decorate([
|
|
3765
|
+
r()
|
|
3766
|
+
], UrlField.prototype, "focused", void 0);
|
|
3767
|
+
__decorate([
|
|
3768
|
+
r()
|
|
3769
|
+
], UrlField.prototype, "isValid", void 0);
|
|
3770
|
+
__decorate([
|
|
3771
|
+
e$4('.url-input')
|
|
3772
|
+
], UrlField.prototype, "inputElement", void 0);
|
|
3773
|
+
|
|
3774
|
+
var css_248z$w = i`* {
|
|
3261
3775
|
box-sizing: border-box;
|
|
3262
3776
|
}
|
|
3263
3777
|
|
|
@@ -3625,7 +4139,7 @@ class Field extends i$1 {
|
|
|
3625
4139
|
return b `<div class="text-count">${this.textCount}</div>`;
|
|
3626
4140
|
}
|
|
3627
4141
|
}
|
|
3628
|
-
Field.styles = [css_248z$
|
|
4142
|
+
Field.styles = [css_248z$w];
|
|
3629
4143
|
__decorate([
|
|
3630
4144
|
n({ type: String })
|
|
3631
4145
|
], Field.prototype, "label", void 0);
|
|
@@ -3681,7 +4195,7 @@ __decorate([
|
|
|
3681
4195
|
r()
|
|
3682
4196
|
], Field.prototype, "slotEndHasContent", void 0);
|
|
3683
4197
|
|
|
3684
|
-
var css_248z$
|
|
4198
|
+
var css_248z$v = i`* {
|
|
3685
4199
|
box-sizing: border-box;
|
|
3686
4200
|
}
|
|
3687
4201
|
|
|
@@ -3832,11 +4346,12 @@ class NumberField extends BaseInput {
|
|
|
3832
4346
|
${this.stepper && !this.disabled
|
|
3833
4347
|
? b `<wc-icon-button
|
|
3834
4348
|
class="stepper"
|
|
3835
|
-
name="remove"
|
|
3836
4349
|
variant="text"
|
|
3837
4350
|
slot="field-start"
|
|
3838
4351
|
@click=${this.stepDown}
|
|
3839
|
-
|
|
4352
|
+
>
|
|
4353
|
+
<wc-icon name="remove"></wc-icon>
|
|
4354
|
+
</wc-icon-button>`
|
|
3840
4355
|
: A}
|
|
3841
4356
|
|
|
3842
4357
|
<slot name="start" slot="field-start"></slot>
|
|
@@ -3868,17 +4383,18 @@ class NumberField extends BaseInput {
|
|
|
3868
4383
|
? b `<wc-icon-button
|
|
3869
4384
|
class="stepper"
|
|
3870
4385
|
variant="text"
|
|
3871
|
-
name="add"
|
|
3872
4386
|
slot="field-end"
|
|
3873
4387
|
@click=${this.stepUp}
|
|
3874
|
-
|
|
4388
|
+
>
|
|
4389
|
+
<wc-icon name="add"></wc-icon>
|
|
4390
|
+
</wc-icon-button>`
|
|
3875
4391
|
: A}
|
|
3876
4392
|
</wc-field>
|
|
3877
4393
|
`;
|
|
3878
4394
|
}
|
|
3879
4395
|
}
|
|
3880
4396
|
_NumberField_id = new WeakMap();
|
|
3881
|
-
NumberField.styles = [css_248z$
|
|
4397
|
+
NumberField.styles = [css_248z$v];
|
|
3882
4398
|
__decorate([
|
|
3883
4399
|
n({ type: Number })
|
|
3884
4400
|
], NumberField.prototype, "value", void 0);
|
|
@@ -3940,7 +4456,7 @@ __decorate([
|
|
|
3940
4456
|
e$4('.input-element')
|
|
3941
4457
|
], NumberField.prototype, "inputElement", void 0);
|
|
3942
4458
|
|
|
3943
|
-
var css_248z$
|
|
4459
|
+
var css_248z$u = i`* {
|
|
3944
4460
|
box-sizing: border-box;
|
|
3945
4461
|
}
|
|
3946
4462
|
|
|
@@ -4093,7 +4609,6 @@ class DatePicker extends BaseInput {
|
|
|
4093
4609
|
slot="field-end"
|
|
4094
4610
|
color="secondary"
|
|
4095
4611
|
variant="text"
|
|
4096
|
-
name="calendar_today"
|
|
4097
4612
|
?disabled=${this.disabled}
|
|
4098
4613
|
@click=${() => {
|
|
4099
4614
|
setTimeout(() => {
|
|
@@ -4102,12 +4617,13 @@ class DatePicker extends BaseInput {
|
|
|
4102
4617
|
});
|
|
4103
4618
|
}}
|
|
4104
4619
|
>
|
|
4620
|
+
<wc-icon name="calendar_today"></wc-icon>
|
|
4105
4621
|
</wc-icon-button>
|
|
4106
4622
|
</wc-field>
|
|
4107
4623
|
`;
|
|
4108
4624
|
}
|
|
4109
4625
|
}
|
|
4110
|
-
DatePicker.styles = [css_248z$
|
|
4626
|
+
DatePicker.styles = [css_248z$u];
|
|
4111
4627
|
__decorate([
|
|
4112
4628
|
n({ type: String })
|
|
4113
4629
|
], DatePicker.prototype, "value", void 0);
|
|
@@ -4163,7 +4679,7 @@ __decorate([
|
|
|
4163
4679
|
e$4('.input-element')
|
|
4164
4680
|
], DatePicker.prototype, "inputElement", void 0);
|
|
4165
4681
|
|
|
4166
|
-
var css_248z$
|
|
4682
|
+
var css_248z$t = i`* {
|
|
4167
4683
|
box-sizing: border-box;
|
|
4168
4684
|
}
|
|
4169
4685
|
|
|
@@ -4316,7 +4832,6 @@ class TimePicker extends BaseInput {
|
|
|
4316
4832
|
slot="field-end"
|
|
4317
4833
|
color="secondary"
|
|
4318
4834
|
variant="text"
|
|
4319
|
-
name="calendar_today"
|
|
4320
4835
|
?disabled=${this.disabled}
|
|
4321
4836
|
@click=${() => {
|
|
4322
4837
|
setTimeout(() => {
|
|
@@ -4325,12 +4840,13 @@ class TimePicker extends BaseInput {
|
|
|
4325
4840
|
});
|
|
4326
4841
|
}}
|
|
4327
4842
|
>
|
|
4843
|
+
<wc-icon name="calendar_today"></wc-icon>
|
|
4328
4844
|
</wc-icon-button>
|
|
4329
4845
|
</wc-field>
|
|
4330
4846
|
`;
|
|
4331
4847
|
}
|
|
4332
4848
|
}
|
|
4333
|
-
TimePicker.styles = [css_248z$
|
|
4849
|
+
TimePicker.styles = [css_248z$t];
|
|
4334
4850
|
__decorate([
|
|
4335
4851
|
n({ type: String })
|
|
4336
4852
|
], TimePicker.prototype, "value", void 0);
|
|
@@ -4386,7 +4902,7 @@ __decorate([
|
|
|
4386
4902
|
e$4('.input-element')
|
|
4387
4903
|
], TimePicker.prototype, "inputElement", void 0);
|
|
4388
4904
|
|
|
4389
|
-
var css_248z$
|
|
4905
|
+
var css_248z$s = i`* {
|
|
4390
4906
|
box-sizing: border-box;
|
|
4391
4907
|
}
|
|
4392
4908
|
|
|
@@ -4546,7 +5062,7 @@ class Textarea extends BaseInput {
|
|
|
4546
5062
|
`;
|
|
4547
5063
|
}
|
|
4548
5064
|
}
|
|
4549
|
-
Textarea.styles = [css_248z$
|
|
5065
|
+
Textarea.styles = [css_248z$s];
|
|
4550
5066
|
__decorate([
|
|
4551
5067
|
n({ type: String })
|
|
4552
5068
|
], Textarea.prototype, "value", void 0);
|
|
@@ -4605,7 +5121,7 @@ __decorate([
|
|
|
4605
5121
|
e$4('.input-element')
|
|
4606
5122
|
], Textarea.prototype, "inputElement", void 0);
|
|
4607
5123
|
|
|
4608
|
-
var css_248z$
|
|
5124
|
+
var css_248z$r = i`* {
|
|
4609
5125
|
box-sizing: border-box;
|
|
4610
5126
|
}
|
|
4611
5127
|
|
|
@@ -4946,7 +5462,7 @@ class Switch extends BaseInput {
|
|
|
4946
5462
|
`;
|
|
4947
5463
|
}
|
|
4948
5464
|
}
|
|
4949
|
-
Switch.styles = [css_248z$
|
|
5465
|
+
Switch.styles = [css_248z$r];
|
|
4950
5466
|
__decorate([
|
|
4951
5467
|
n({ type: Boolean })
|
|
4952
5468
|
], Switch.prototype, "value", void 0);
|
|
@@ -4990,7 +5506,7 @@ __decorate([
|
|
|
4990
5506
|
e$4('.input-native')
|
|
4991
5507
|
], Switch.prototype, "nativeElement", void 0);
|
|
4992
5508
|
|
|
4993
|
-
var css_248z$
|
|
5509
|
+
var css_248z$q = i`* {
|
|
4994
5510
|
box-sizing: border-box;
|
|
4995
5511
|
}
|
|
4996
5512
|
|
|
@@ -5047,12 +5563,9 @@ var css_248z$n = i`* {
|
|
|
5047
5563
|
outline: none;
|
|
5048
5564
|
flex-shrink: 0;
|
|
5049
5565
|
}
|
|
5050
|
-
.checkbox .
|
|
5051
|
-
position: absolute;
|
|
5052
|
-
inset: 0;
|
|
5566
|
+
.checkbox .ripple {
|
|
5053
5567
|
border-radius: 50%;
|
|
5054
|
-
|
|
5055
|
-
transition: opacity var(--duration-short2) var(--easing-standard);
|
|
5568
|
+
--ripple-pressed-color: var(--color-on-surface);
|
|
5056
5569
|
}
|
|
5057
5570
|
.checkbox .outline {
|
|
5058
5571
|
position: absolute;
|
|
@@ -5099,31 +5612,20 @@ var css_248z$n = i`* {
|
|
|
5099
5612
|
color: var(--color-on-surface);
|
|
5100
5613
|
cursor: inherit;
|
|
5101
5614
|
}
|
|
5102
|
-
.checkbox:hover:not(.disabled):not(.readonly) .state-
|
|
5103
|
-
|
|
5104
|
-
background: var(--color-on-surface);
|
|
5105
|
-
}
|
|
5106
|
-
.checkbox:hover:not(.disabled):not(.readonly).state-checked .state-layer, .checkbox:hover:not(.disabled):not(.readonly).state-indeterminate .state-layer {
|
|
5107
|
-
background: var(--checkbox-selected-color);
|
|
5108
|
-
}
|
|
5109
|
-
.checkbox.has-focus:not(.active):not(.disabled):not(.readonly) .state-layer {
|
|
5110
|
-
opacity: 0.12;
|
|
5111
|
-
background: var(--color-on-surface);
|
|
5112
|
-
}
|
|
5113
|
-
.checkbox.has-focus:not(.active):not(.disabled):not(.readonly) .container {
|
|
5114
|
-
outline: 3px solid var(--color-primary);
|
|
5115
|
-
outline-offset: 2px;
|
|
5116
|
-
border-radius: 50%;
|
|
5615
|
+
.checkbox:hover:not(.disabled):not(.readonly).state-checked .ripple, .checkbox:hover:not(.disabled):not(.readonly).state-indeterminate .ripple {
|
|
5616
|
+
--ripple-pressed-color: var(--checkbox-selected-color);
|
|
5117
5617
|
}
|
|
5118
|
-
.checkbox
|
|
5119
|
-
|
|
5618
|
+
.checkbox .focus-ring {
|
|
5619
|
+
--focus-ring-container-shape-start-start: 50%;
|
|
5620
|
+
--focus-ring-container-shape-start-end: 50%;
|
|
5621
|
+
--focus-ring-container-shape-end-start: 50%;
|
|
5622
|
+
--focus-ring-container-shape-end-end: 50%;
|
|
5120
5623
|
}
|
|
5121
|
-
.checkbox.active:not(.disabled):not(.readonly) .state-
|
|
5122
|
-
|
|
5123
|
-
background: var(--color-on-surface);
|
|
5624
|
+
.checkbox.has-focus:not(.active):not(.disabled):not(.readonly).state-checked .ripple, .checkbox.has-focus:not(.active):not(.disabled):not(.readonly).state-indeterminate .ripple {
|
|
5625
|
+
--ripple-pressed-color: var(--checkbox-selected-color);
|
|
5124
5626
|
}
|
|
5125
|
-
.checkbox.active:not(.disabled):not(.readonly).state-checked .
|
|
5126
|
-
|
|
5627
|
+
.checkbox.active:not(.disabled):not(.readonly).state-checked .ripple, .checkbox.active:not(.disabled):not(.readonly).state-indeterminate .ripple {
|
|
5628
|
+
--ripple-pressed-color: var(--checkbox-selected-color);
|
|
5127
5629
|
}
|
|
5128
5630
|
.checkbox.rounded {
|
|
5129
5631
|
--checkbox-border-radius: 18px;
|
|
@@ -5401,6 +5903,7 @@ class Checkbox extends i$1 {
|
|
|
5401
5903
|
return b `
|
|
5402
5904
|
<label class=${e$3(cssClasses)}>
|
|
5403
5905
|
<div
|
|
5906
|
+
id="container"
|
|
5404
5907
|
class="container"
|
|
5405
5908
|
tabindex=${this.tabindex || 0}
|
|
5406
5909
|
@keyup=${this.handleKeyUp}
|
|
@@ -5418,7 +5921,8 @@ class Checkbox extends i$1 {
|
|
|
5418
5921
|
: 'false'}
|
|
5419
5922
|
${spread(this.configAria)}
|
|
5420
5923
|
>
|
|
5421
|
-
<
|
|
5924
|
+
<wc-ripple class="ripple"></wc-ripple>
|
|
5925
|
+
<wc-focus-ring class="focus-ring" for='container'></wc-focus-ring>
|
|
5422
5926
|
<div class="outline"></div>
|
|
5423
5927
|
<div class="background"></div>
|
|
5424
5928
|
<svg class="icon" viewBox="0 0 12 12">
|
|
@@ -5460,7 +5964,7 @@ class Checkbox extends i$1 {
|
|
|
5460
5964
|
`;
|
|
5461
5965
|
}
|
|
5462
5966
|
}
|
|
5463
|
-
Checkbox.styles = [css_248z$
|
|
5967
|
+
Checkbox.styles = [css_248z$q];
|
|
5464
5968
|
__decorate([
|
|
5465
5969
|
n({ type: String })
|
|
5466
5970
|
], Checkbox.prototype, "name", void 0);
|
|
@@ -5507,7 +6011,7 @@ __decorate([
|
|
|
5507
6011
|
e$4('.input-native')
|
|
5508
6012
|
], Checkbox.prototype, "nativeElement", void 0);
|
|
5509
6013
|
|
|
5510
|
-
var css_248z$
|
|
6014
|
+
var css_248z$p = i`* {
|
|
5511
6015
|
box-sizing: border-box;
|
|
5512
6016
|
}
|
|
5513
6017
|
|
|
@@ -5594,9 +6098,9 @@ class Spinner extends i$1 {
|
|
|
5594
6098
|
`;
|
|
5595
6099
|
}
|
|
5596
6100
|
}
|
|
5597
|
-
Spinner.styles = [css_248z$
|
|
6101
|
+
Spinner.styles = [css_248z$p];
|
|
5598
6102
|
|
|
5599
|
-
var css_248z$
|
|
6103
|
+
var css_248z$o = i`* {
|
|
5600
6104
|
box-sizing: border-box;
|
|
5601
6105
|
}
|
|
5602
6106
|
|
|
@@ -5714,12 +6218,12 @@ class Container extends i$1 {
|
|
|
5714
6218
|
`;
|
|
5715
6219
|
}
|
|
5716
6220
|
}
|
|
5717
|
-
Container.styles = [css_248z$
|
|
6221
|
+
Container.styles = [css_248z$o];
|
|
5718
6222
|
__decorate([
|
|
5719
6223
|
n({ type: String, reflect: true })
|
|
5720
6224
|
], Container.prototype, "size", void 0);
|
|
5721
6225
|
|
|
5722
|
-
var css_248z$
|
|
6226
|
+
var css_248z$n = i`* {
|
|
5723
6227
|
box-sizing: border-box;
|
|
5724
6228
|
}
|
|
5725
6229
|
|
|
@@ -5760,12 +6264,12 @@ var css_248z$k = i`* {
|
|
|
5760
6264
|
flex-direction: column;
|
|
5761
6265
|
justify-content: center;
|
|
5762
6266
|
}
|
|
5763
|
-
.content .
|
|
5764
|
-
font-family: var(--typography-headline-medium-
|
|
5765
|
-
font-size: var(--typography-headline-medium-
|
|
5766
|
-
font-weight: var(--typography-headline-medium-
|
|
5767
|
-
line-height: var(--typography-headline-medium-
|
|
5768
|
-
letter-spacing: var(--typography-headline-medium-
|
|
6267
|
+
.content .headline {
|
|
6268
|
+
font-family: var(--typography-headline-medium-font-family) !important;
|
|
6269
|
+
font-size: var(--typography-headline-medium-font-size) !important;
|
|
6270
|
+
font-weight: var(--typography-headline-medium-font-weight) !important;
|
|
6271
|
+
line-height: var(--typography-headline-medium-line-height) !important;
|
|
6272
|
+
letter-spacing: var(--typography-headline-medium-letter-spacing) !important;
|
|
5769
6273
|
margin-bottom: var(--spacing-200);
|
|
5770
6274
|
color: var(--color-on-surface);
|
|
5771
6275
|
}
|
|
@@ -5790,30 +6294,23 @@ var css_248z$k = i`* {
|
|
|
5790
6294
|
.empty-state .content {
|
|
5791
6295
|
width: 50%;
|
|
5792
6296
|
}
|
|
5793
|
-
.empty-state .headline {
|
|
5794
|
-
font-family: var(--typography-title-medium-font-family) !important;
|
|
5795
|
-
font-size: var(--typography-title-medium-font-size) !important;
|
|
5796
|
-
font-weight: var(--typography-title-medium-font-weight) !important;
|
|
5797
|
-
line-height: var(--typography-title-medium-line-height) !important;
|
|
5798
|
-
letter-spacing: var(--typography-title-medium-letter-spacing) !important;
|
|
5799
|
-
}
|
|
5800
6297
|
}
|
|
5801
6298
|
@container emptystate (max-width: 671px) {
|
|
5802
6299
|
.empty-state .empty-state-container {
|
|
5803
6300
|
flex-direction: column;
|
|
5804
|
-
gap: var(--spacing-
|
|
6301
|
+
gap: var(--spacing-150);
|
|
5805
6302
|
}
|
|
5806
6303
|
.empty-state .empty-state-container .illustration {
|
|
5807
6304
|
height: auto;
|
|
5808
6305
|
width: 100%;
|
|
5809
6306
|
justify-content: center;
|
|
5810
6307
|
}
|
|
5811
|
-
.empty-state .headline {
|
|
5812
|
-
font-family: var(--typography-
|
|
5813
|
-
font-size: var(--typography-
|
|
5814
|
-
font-weight: var(--typography-
|
|
5815
|
-
line-height: var(--typography-
|
|
5816
|
-
letter-spacing: var(--typography-
|
|
6308
|
+
.empty-state .content .headline {
|
|
6309
|
+
font-family: var(--typography-headline-small-font-family) !important;
|
|
6310
|
+
font-size: var(--typography-headline-small-font-size) !important;
|
|
6311
|
+
font-weight: var(--typography-headline-small-font-weight) !important;
|
|
6312
|
+
line-height: var(--typography-headline-small-line-height) !important;
|
|
6313
|
+
letter-spacing: var(--typography-headline-small-letter-spacing) !important;
|
|
5817
6314
|
}
|
|
5818
6315
|
}`;
|
|
5819
6316
|
|
|
@@ -5826,7 +6323,7 @@ var css_248z$k = i`* {
|
|
|
5826
6323
|
*
|
|
5827
6324
|
* @example
|
|
5828
6325
|
* ```html
|
|
5829
|
-
* <wc-empty-state
|
|
6326
|
+
* <wc-empty-state style="width:100%" headline="No items found"></wc-empty-state>
|
|
5830
6327
|
* ```
|
|
5831
6328
|
*/
|
|
5832
6329
|
class EmptyState extends i$1 {
|
|
@@ -5889,7 +6386,7 @@ class EmptyState extends i$1 {
|
|
|
5889
6386
|
}
|
|
5890
6387
|
}
|
|
5891
6388
|
// Lit handles styles in a static property for better performance
|
|
5892
|
-
EmptyState.styles = [css_248z$
|
|
6389
|
+
EmptyState.styles = [css_248z$n];
|
|
5893
6390
|
__decorate([
|
|
5894
6391
|
n({ type: String, reflect: true })
|
|
5895
6392
|
], EmptyState.prototype, "illustration", void 0);
|
|
@@ -5903,7 +6400,7 @@ __decorate([
|
|
|
5903
6400
|
r()
|
|
5904
6401
|
], EmptyState.prototype, "vertical", void 0);
|
|
5905
6402
|
|
|
5906
|
-
var css_248z$
|
|
6403
|
+
var css_248z$m = i`* {
|
|
5907
6404
|
box-sizing: border-box;
|
|
5908
6405
|
}
|
|
5909
6406
|
|
|
@@ -7649,6 +8146,24 @@ class Tooltip extends i$1 {
|
|
|
7649
8146
|
this._target.removeEventListener('click', this._onClick);
|
|
7650
8147
|
this._target = null;
|
|
7651
8148
|
}
|
|
8149
|
+
set forElement(value) {
|
|
8150
|
+
if (value) {
|
|
8151
|
+
this._focusTarget = value;
|
|
8152
|
+
}
|
|
8153
|
+
else {
|
|
8154
|
+
this._focusTarget = undefined;
|
|
8155
|
+
}
|
|
8156
|
+
}
|
|
8157
|
+
__getFocusTarget() {
|
|
8158
|
+
if (this._focusTarget) {
|
|
8159
|
+
return this._focusTarget;
|
|
8160
|
+
}
|
|
8161
|
+
const focusTarget = document.getElementById(this.for);
|
|
8162
|
+
if (focusTarget) {
|
|
8163
|
+
return focusTarget;
|
|
8164
|
+
}
|
|
8165
|
+
return this.parentElement;
|
|
8166
|
+
}
|
|
7652
8167
|
attachListeners() {
|
|
7653
8168
|
this.detachListeners(); // Cleanup old target if it exists
|
|
7654
8169
|
// Resolve target: ID-based lookup or fallback to parent
|
|
@@ -7729,7 +8244,7 @@ class Tooltip extends i$1 {
|
|
|
7729
8244
|
`;
|
|
7730
8245
|
}
|
|
7731
8246
|
}
|
|
7732
|
-
Tooltip.styles = [css_248z$
|
|
8247
|
+
Tooltip.styles = [css_248z$m];
|
|
7733
8248
|
Tooltip.CLOSE_OTHERS_EVENT = 'tooltip--open';
|
|
7734
8249
|
__decorate([
|
|
7735
8250
|
n()
|
|
@@ -7753,7 +8268,7 @@ __decorate([
|
|
|
7753
8268
|
e$4('#tooltip')
|
|
7754
8269
|
], Tooltip.prototype, "floatingEl", void 0);
|
|
7755
8270
|
|
|
7756
|
-
var css_248z$
|
|
8271
|
+
var css_248z$l = i`* {
|
|
7757
8272
|
box-sizing: border-box;
|
|
7758
8273
|
}
|
|
7759
8274
|
|
|
@@ -7789,13 +8304,7 @@ ol {
|
|
|
7789
8304
|
pointer-events: none;
|
|
7790
8305
|
}`;
|
|
7791
8306
|
|
|
7792
|
-
|
|
7793
|
-
* @license
|
|
7794
|
-
* Copyright 2018 Google LLC
|
|
7795
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
7796
|
-
*/const o=o=>o??A;
|
|
7797
|
-
|
|
7798
|
-
var css_248z$h = i`* {
|
|
8307
|
+
var css_248z$k = i`* {
|
|
7799
8308
|
box-sizing: border-box;
|
|
7800
8309
|
}
|
|
7801
8310
|
|
|
@@ -7904,8 +8413,8 @@ class BreadcrumbItem extends i$1 {
|
|
|
7904
8413
|
<a
|
|
7905
8414
|
class="breadcrumb-link"
|
|
7906
8415
|
itemprop="item"
|
|
7907
|
-
href=${o(this.href)}
|
|
7908
|
-
target=${o(this.target)}
|
|
8416
|
+
href=${o$3(this.href)}
|
|
8417
|
+
target=${o$3(this.target)}
|
|
7909
8418
|
${this.target === '_blank'
|
|
7910
8419
|
? b `rel="noopener noreferrer"`
|
|
7911
8420
|
: A}
|
|
@@ -7925,7 +8434,7 @@ class BreadcrumbItem extends i$1 {
|
|
|
7925
8434
|
`;
|
|
7926
8435
|
}
|
|
7927
8436
|
}
|
|
7928
|
-
BreadcrumbItem.styles = [css_248z$
|
|
8437
|
+
BreadcrumbItem.styles = [css_248z$k];
|
|
7929
8438
|
__decorate([
|
|
7930
8439
|
n({ reflect: true })
|
|
7931
8440
|
], BreadcrumbItem.prototype, "href", void 0);
|
|
@@ -7979,13 +8488,13 @@ class Breadcrumb extends i$1 {
|
|
|
7979
8488
|
</nav>`;
|
|
7980
8489
|
}
|
|
7981
8490
|
}
|
|
7982
|
-
Breadcrumb.styles = [css_248z$
|
|
8491
|
+
Breadcrumb.styles = [css_248z$l];
|
|
7983
8492
|
Breadcrumb.Item = BreadcrumbItem;
|
|
7984
8493
|
__decorate([
|
|
7985
8494
|
n({ type: String })
|
|
7986
8495
|
], Breadcrumb.prototype, "label", void 0);
|
|
7987
8496
|
|
|
7988
|
-
var css_248z$
|
|
8497
|
+
var css_248z$j = i`* {
|
|
7989
8498
|
box-sizing: border-box;
|
|
7990
8499
|
}
|
|
7991
8500
|
|
|
@@ -7997,6 +8506,8 @@ var css_248z$g = i`* {
|
|
|
7997
8506
|
display: flex;
|
|
7998
8507
|
position: fixed;
|
|
7999
8508
|
z-index: var(--menu-z-index, 1000);
|
|
8509
|
+
width: var(--menu-width, max-content);
|
|
8510
|
+
max-width: 100vw;
|
|
8000
8511
|
min-width: 112px;
|
|
8001
8512
|
padding-block: var(--spacing-050);
|
|
8002
8513
|
transform-origin: top center;
|
|
@@ -8024,6 +8535,10 @@ var css_248z$g = i`* {
|
|
|
8024
8535
|
transition-delay: 0ms, 0ms, 0ms;
|
|
8025
8536
|
transition-timing-function: var(--_menu-enter-easing), var(--_menu-enter-easing), linear;
|
|
8026
8537
|
}
|
|
8538
|
+
.menu.preview {
|
|
8539
|
+
position: relative;
|
|
8540
|
+
pointer-events: auto;
|
|
8541
|
+
}
|
|
8027
8542
|
.menu .menu-content {
|
|
8028
8543
|
display: flex;
|
|
8029
8544
|
flex-direction: column;
|
|
@@ -8087,7 +8602,7 @@ var css_248z$g = i`* {
|
|
|
8087
8602
|
--_container-color: var(--color-tertiary-container);
|
|
8088
8603
|
}`;
|
|
8089
8604
|
|
|
8090
|
-
var css_248z$
|
|
8605
|
+
var css_248z$i = i`* {
|
|
8091
8606
|
box-sizing: border-box;
|
|
8092
8607
|
}
|
|
8093
8608
|
|
|
@@ -8199,7 +8714,7 @@ var css_248z$f = i`* {
|
|
|
8199
8714
|
display: none;
|
|
8200
8715
|
}`;
|
|
8201
8716
|
|
|
8202
|
-
var css_248z$
|
|
8717
|
+
var css_248z$h = i`:host-context([variant=standard]) {
|
|
8203
8718
|
--menu-item-label-color: var(--color-on-surface-variant);
|
|
8204
8719
|
--menu-item-label-selected-color: var(--color-on-tertiary-container);
|
|
8205
8720
|
--menu-item-container-selected-color: var(--color-tertiary-container);
|
|
@@ -8323,6 +8838,7 @@ class MenuItem extends i$1 {
|
|
|
8323
8838
|
const controls = this.getAttribute('aria-controls');
|
|
8324
8839
|
if (isLink) {
|
|
8325
8840
|
return b `<a
|
|
8841
|
+
id="item"
|
|
8326
8842
|
class=${e$3(cssClasses)}
|
|
8327
8843
|
href=${this.href}
|
|
8328
8844
|
target=${this.target}
|
|
@@ -8335,6 +8851,7 @@ class MenuItem extends i$1 {
|
|
|
8335
8851
|
</a> `;
|
|
8336
8852
|
}
|
|
8337
8853
|
return b `<div
|
|
8854
|
+
id="item"
|
|
8338
8855
|
class=${e$3(cssClasses)}
|
|
8339
8856
|
aria-disabled=${String(this.disabled)}
|
|
8340
8857
|
aria-haspopup=${this.hasSubmenu ? 'menu' : A}
|
|
@@ -8346,7 +8863,7 @@ class MenuItem extends i$1 {
|
|
|
8346
8863
|
}
|
|
8347
8864
|
renderContent() {
|
|
8348
8865
|
return b `
|
|
8349
|
-
<wc-focus-ring class="focus-ring"
|
|
8866
|
+
<wc-focus-ring class="focus-ring" for='item'></wc-focus-ring>
|
|
8350
8867
|
<div class="background"></div>
|
|
8351
8868
|
<wc-ripple class="ripple"></wc-ripple>
|
|
8352
8869
|
|
|
@@ -8360,7 +8877,7 @@ class MenuItem extends i$1 {
|
|
|
8360
8877
|
`;
|
|
8361
8878
|
}
|
|
8362
8879
|
}
|
|
8363
|
-
MenuItem.styles = [css_248z$
|
|
8880
|
+
MenuItem.styles = [css_248z$i, css_248z$h];
|
|
8364
8881
|
__decorate([
|
|
8365
8882
|
n({ type: Boolean, reflect: true })
|
|
8366
8883
|
], MenuItem.prototype, "disabled", void 0);
|
|
@@ -8432,9 +8949,9 @@ class MenuSurfaceController {
|
|
|
8432
8949
|
*
|
|
8433
8950
|
* @example
|
|
8434
8951
|
* ```html
|
|
8435
|
-
* <wc-menu>
|
|
8952
|
+
* <wc-menu preview>
|
|
8436
8953
|
* <wc-menu-item>Item 1</wc-menu-item>
|
|
8437
|
-
* <wc-menu-item>Item 2</wc-menu-item>
|
|
8954
|
+
* <wc-menu-item selected>Item 2</wc-menu-item>
|
|
8438
8955
|
* </wc-menu>
|
|
8439
8956
|
* ```
|
|
8440
8957
|
*/
|
|
@@ -8444,6 +8961,7 @@ class Menu extends i$1 {
|
|
|
8444
8961
|
this.open = false;
|
|
8445
8962
|
this.variant = 'standard';
|
|
8446
8963
|
this.anchor = '';
|
|
8964
|
+
this.preview = false;
|
|
8447
8965
|
this.stayOpenOnOutsideClick = false;
|
|
8448
8966
|
this.stayOpenOnFocusout = false;
|
|
8449
8967
|
this.isSubmenu = false;
|
|
@@ -8760,8 +9278,9 @@ class Menu extends i$1 {
|
|
|
8760
9278
|
return b `<div
|
|
8761
9279
|
class=${e$3({
|
|
8762
9280
|
'menu': true,
|
|
8763
|
-
open: this.open,
|
|
8764
|
-
closed: !this.open,
|
|
9281
|
+
open: !this.preview && this.open,
|
|
9282
|
+
closed: !this.preview && !this.open,
|
|
9283
|
+
preview: this.preview,
|
|
8765
9284
|
[`variant-${this.variant}`]: true,
|
|
8766
9285
|
})}
|
|
8767
9286
|
aria-hidden=${String(!this.open)}
|
|
@@ -8775,7 +9294,7 @@ class Menu extends i$1 {
|
|
|
8775
9294
|
</div>`;
|
|
8776
9295
|
}
|
|
8777
9296
|
}
|
|
8778
|
-
Menu.styles = [css_248z$
|
|
9297
|
+
Menu.styles = [css_248z$j];
|
|
8779
9298
|
Menu.Item = MenuItem;
|
|
8780
9299
|
__decorate([
|
|
8781
9300
|
n({ type: Boolean, reflect: true })
|
|
@@ -8786,6 +9305,9 @@ __decorate([
|
|
|
8786
9305
|
__decorate([
|
|
8787
9306
|
n({ type: String })
|
|
8788
9307
|
], Menu.prototype, "anchor", void 0);
|
|
9308
|
+
__decorate([
|
|
9309
|
+
n({ type: Boolean, reflect: true })
|
|
9310
|
+
], Menu.prototype, "preview", void 0);
|
|
8789
9311
|
__decorate([
|
|
8790
9312
|
n({ type: Boolean, attribute: 'stay-open-on-outside-click' })
|
|
8791
9313
|
], Menu.prototype, "stayOpenOnOutsideClick", void 0);
|
|
@@ -8808,7 +9330,7 @@ __decorate([
|
|
|
8808
9330
|
e$4('.menu')
|
|
8809
9331
|
], Menu.prototype, "menuListElement", void 0);
|
|
8810
9332
|
|
|
8811
|
-
var css_248z$
|
|
9333
|
+
var css_248z$g = i`* {
|
|
8812
9334
|
box-sizing: border-box;
|
|
8813
9335
|
}
|
|
8814
9336
|
|
|
@@ -8825,6 +9347,7 @@ let subMenuIdCounter = 0;
|
|
|
8825
9347
|
* @label Sub Menu
|
|
8826
9348
|
* @tag wc-sub-menu
|
|
8827
9349
|
* @rawTag sub-menu
|
|
9350
|
+
* @parentRawTag menu
|
|
8828
9351
|
* @summary Connects a menu item to a nested menu.
|
|
8829
9352
|
*/
|
|
8830
9353
|
class SubMenu extends i$1 {
|
|
@@ -9002,7 +9525,7 @@ class SubMenu extends i$1 {
|
|
|
9002
9525
|
`;
|
|
9003
9526
|
}
|
|
9004
9527
|
}
|
|
9005
|
-
SubMenu.styles = [css_248z$
|
|
9528
|
+
SubMenu.styles = [css_248z$g];
|
|
9006
9529
|
__decorate([
|
|
9007
9530
|
n({ type: Number, attribute: 'hover-open-delay' })
|
|
9008
9531
|
], SubMenu.prototype, "hoverOpenDelay", void 0);
|
|
@@ -9016,13 +9539,13 @@ __decorate([
|
|
|
9016
9539
|
n({ type: String, attribute: 'menu-corner' })
|
|
9017
9540
|
], SubMenu.prototype, "menuCorner", void 0);
|
|
9018
9541
|
__decorate([
|
|
9019
|
-
o$
|
|
9542
|
+
o$1({ slot: 'item' })
|
|
9020
9543
|
], SubMenu.prototype, "_items", void 0);
|
|
9021
9544
|
__decorate([
|
|
9022
|
-
o$
|
|
9545
|
+
o$1({ slot: 'menu' })
|
|
9023
9546
|
], SubMenu.prototype, "_menus", void 0);
|
|
9024
9547
|
|
|
9025
|
-
var css_248z$
|
|
9548
|
+
var css_248z$f = i`@charset "UTF-8";
|
|
9026
9549
|
:host {
|
|
9027
9550
|
display: block;
|
|
9028
9551
|
height: 100%;
|
|
@@ -9179,7 +9702,7 @@ class Image extends i$1 {
|
|
|
9179
9702
|
`;
|
|
9180
9703
|
}
|
|
9181
9704
|
}
|
|
9182
|
-
Image.styles = [css_248z$
|
|
9705
|
+
Image.styles = [css_248z$f];
|
|
9183
9706
|
__decorate([
|
|
9184
9707
|
n({ reflect: true })
|
|
9185
9708
|
], Image.prototype, "src", void 0);
|
|
@@ -9202,7 +9725,7 @@ __decorate([
|
|
|
9202
9725
|
r()
|
|
9203
9726
|
], Image.prototype, "_previewOpen", void 0);
|
|
9204
9727
|
|
|
9205
|
-
var css_248z$
|
|
9728
|
+
var css_248z$e = i`* {
|
|
9206
9729
|
box-sizing: border-box;
|
|
9207
9730
|
}
|
|
9208
9731
|
|
|
@@ -9692,6 +10215,7 @@ class Tab extends i$1 {
|
|
|
9692
10215
|
};
|
|
9693
10216
|
if (!isLink) {
|
|
9694
10217
|
return b `<button
|
|
10218
|
+
id="button"
|
|
9695
10219
|
class=${e$3(cssClasses)}
|
|
9696
10220
|
tabindex="0"
|
|
9697
10221
|
@mousedown=${this.__handlePress}
|
|
@@ -9737,7 +10261,7 @@ class Tab extends i$1 {
|
|
|
9737
10261
|
}
|
|
9738
10262
|
renderPrimaryTabContent() {
|
|
9739
10263
|
return b `
|
|
9740
|
-
<wc-focus-ring class="focus-ring"
|
|
10264
|
+
<wc-focus-ring class="focus-ring" for='button'></wc-focus-ring>
|
|
9741
10265
|
<wc-elevation class="elevation"></wc-elevation>
|
|
9742
10266
|
<div class="background"></div>
|
|
9743
10267
|
<div class="outline"></div>
|
|
@@ -9762,7 +10286,7 @@ class Tab extends i$1 {
|
|
|
9762
10286
|
}
|
|
9763
10287
|
renderSecondaryTabContent() {
|
|
9764
10288
|
return b `
|
|
9765
|
-
<wc-focus-ring class="focus-ring"
|
|
10289
|
+
<wc-focus-ring class="focus-ring" for='button'></wc-focus-ring>
|
|
9766
10290
|
<wc-elevation class="elevation"></wc-elevation>
|
|
9767
10291
|
<div class="background"></div>
|
|
9768
10292
|
<div class="outline"></div>
|
|
@@ -9792,7 +10316,7 @@ class Tab extends i$1 {
|
|
|
9792
10316
|
}
|
|
9793
10317
|
renderSegmentedTabContent() {
|
|
9794
10318
|
return b `
|
|
9795
|
-
<wc-focus-ring class="focus-ring"
|
|
10319
|
+
<wc-focus-ring class="focus-ring" for='button'></wc-focus-ring>
|
|
9796
10320
|
<wc-elevation class="elevation"></wc-elevation>
|
|
9797
10321
|
<div class="background"></div>
|
|
9798
10322
|
<div class="outline"></div>
|
|
@@ -9831,7 +10355,7 @@ class Tab extends i$1 {
|
|
|
9831
10355
|
}
|
|
9832
10356
|
}
|
|
9833
10357
|
_Tab_id = new WeakMap();
|
|
9834
|
-
Tab.styles = [css_248z$
|
|
10358
|
+
Tab.styles = [css_248z$e];
|
|
9835
10359
|
__decorate([
|
|
9836
10360
|
n({ type: Boolean, reflect: true })
|
|
9837
10361
|
], Tab.prototype, "active", void 0);
|
|
@@ -9875,7 +10399,7 @@ __decorate([
|
|
|
9875
10399
|
e$4('.tab-element')
|
|
9876
10400
|
], Tab.prototype, "tabElement", void 0);
|
|
9877
10401
|
|
|
9878
|
-
var css_248z$
|
|
10402
|
+
var css_248z$d = i`* {
|
|
9879
10403
|
box-sizing: border-box;
|
|
9880
10404
|
}
|
|
9881
10405
|
|
|
@@ -9889,7 +10413,7 @@ var css_248z$a = i`* {
|
|
|
9889
10413
|
height: 100%;
|
|
9890
10414
|
}`;
|
|
9891
10415
|
|
|
9892
|
-
var css_248z$
|
|
10416
|
+
var css_248z$c = i`* {
|
|
9893
10417
|
box-sizing: border-box;
|
|
9894
10418
|
}
|
|
9895
10419
|
|
|
@@ -10096,7 +10620,7 @@ class Tabs extends i$1 {
|
|
|
10096
10620
|
`;
|
|
10097
10621
|
}
|
|
10098
10622
|
}
|
|
10099
|
-
Tabs.styles = [css_248z$
|
|
10623
|
+
Tabs.styles = [css_248z$c];
|
|
10100
10624
|
Tabs.Tab = Tab;
|
|
10101
10625
|
__decorate([
|
|
10102
10626
|
n({ reflect: true })
|
|
@@ -10105,7 +10629,7 @@ __decorate([
|
|
|
10105
10629
|
n({ type: Boolean })
|
|
10106
10630
|
], Tabs.prototype, "managed", void 0);
|
|
10107
10631
|
|
|
10108
|
-
var css_248z$
|
|
10632
|
+
var css_248z$b = i`* {
|
|
10109
10633
|
box-sizing: border-box;
|
|
10110
10634
|
}
|
|
10111
10635
|
|
|
@@ -10147,7 +10671,7 @@ class TabPanel extends i$1 {
|
|
|
10147
10671
|
return b `<slot></slot>`;
|
|
10148
10672
|
}
|
|
10149
10673
|
}
|
|
10150
|
-
TabPanel.styles = [css_248z$
|
|
10674
|
+
TabPanel.styles = [css_248z$b];
|
|
10151
10675
|
__decorate([
|
|
10152
10676
|
n({ reflect: true })
|
|
10153
10677
|
], TabPanel.prototype, "value", void 0);
|
|
@@ -10300,11 +10824,11 @@ class TabGroup extends i$1 {
|
|
|
10300
10824
|
return b `<slot></slot>`;
|
|
10301
10825
|
}
|
|
10302
10826
|
}
|
|
10303
|
-
TabGroup.styles = [css_248z$
|
|
10827
|
+
TabGroup.styles = [css_248z$d];
|
|
10304
10828
|
TabGroup.Tabs = Tabs;
|
|
10305
10829
|
TabGroup.TabPanel = TabPanel;
|
|
10306
10830
|
|
|
10307
|
-
var css_248z$
|
|
10831
|
+
var css_248z$a = i`:host {
|
|
10308
10832
|
--_track-height: 4px;
|
|
10309
10833
|
--_thumb-size: 20px;
|
|
10310
10834
|
--thumb-half: 10px;
|
|
@@ -10320,6 +10844,17 @@ var css_248z$7 = i`:host {
|
|
|
10320
10844
|
touch-action: none;
|
|
10321
10845
|
}
|
|
10322
10846
|
|
|
10847
|
+
.slider {
|
|
10848
|
+
display: flex;
|
|
10849
|
+
align-items: center;
|
|
10850
|
+
gap: var(--spacing-100, 0.5rem);
|
|
10851
|
+
width: 100%;
|
|
10852
|
+
}
|
|
10853
|
+
|
|
10854
|
+
.slider.with-value .slider-container {
|
|
10855
|
+
flex: 1;
|
|
10856
|
+
}
|
|
10857
|
+
|
|
10323
10858
|
.slider-container {
|
|
10324
10859
|
position: relative;
|
|
10325
10860
|
display: flex;
|
|
@@ -10333,6 +10868,14 @@ var css_248z$7 = i`:host {
|
|
|
10333
10868
|
opacity: 0.38;
|
|
10334
10869
|
}
|
|
10335
10870
|
|
|
10871
|
+
.value-display {
|
|
10872
|
+
min-width: 2.25rem;
|
|
10873
|
+
text-align: end;
|
|
10874
|
+
color: var(--color-on-surface-variant);
|
|
10875
|
+
font-size: 0.875rem;
|
|
10876
|
+
font-weight: 500;
|
|
10877
|
+
}
|
|
10878
|
+
|
|
10336
10879
|
.track {
|
|
10337
10880
|
position: absolute;
|
|
10338
10881
|
width: 100%;
|
|
@@ -10468,6 +11011,10 @@ class Slider extends i$1 {
|
|
|
10468
11011
|
* Whether to show labels on the slider.
|
|
10469
11012
|
*/
|
|
10470
11013
|
this.labeled = true;
|
|
11014
|
+
/**
|
|
11015
|
+
* Whether to show the current value beside the slider.
|
|
11016
|
+
*/
|
|
11017
|
+
this.showValue = false;
|
|
10471
11018
|
this.isDragging = false;
|
|
10472
11019
|
this.onMouseMove = (e) => {
|
|
10473
11020
|
if (this.isDragging) {
|
|
@@ -10550,33 +11097,38 @@ class Slider extends i$1 {
|
|
|
10550
11097
|
render() {
|
|
10551
11098
|
const percentage = ((this.value - this.min) / (this.max - this.min)) * 100;
|
|
10552
11099
|
return b `
|
|
10553
|
-
<div
|
|
10554
|
-
class="slider-container ${this.disabled ? 'disabled' : ''}"
|
|
10555
|
-
@mousedown=${this.onMouseDown}
|
|
10556
|
-
@touchstart=${this.onMouseDown}
|
|
10557
|
-
>
|
|
10558
|
-
<div class="track">
|
|
10559
|
-
<div class="track-active" style=${o$3({ width: `${percentage}%` })}></div>
|
|
10560
|
-
</div>
|
|
10561
|
-
|
|
11100
|
+
<div class="slider ${this.showValue ? 'with-value' : ''}">
|
|
10562
11101
|
<div
|
|
10563
|
-
class="
|
|
10564
|
-
|
|
10565
|
-
|
|
10566
|
-
aria-valuemin=${this.min}
|
|
10567
|
-
aria-valuemax=${this.max}
|
|
10568
|
-
aria-valuenow=${this.value}
|
|
10569
|
-
aria-disabled=${this.disabled}
|
|
10570
|
-
style=${o$3({ left: `calc(${percentage}% - var(--thumb-half))` })}
|
|
10571
|
-
@keydown=${this.handleKeyDown}
|
|
11102
|
+
class="slider-container ${this.disabled ? 'disabled' : ''}"
|
|
11103
|
+
@mousedown=${this.onMouseDown}
|
|
11104
|
+
@touchstart=${this.onMouseDown}
|
|
10572
11105
|
>
|
|
10573
|
-
|
|
11106
|
+
<div class="track">
|
|
11107
|
+
<div class="track-active" style=${o$2({ width: `${percentage}%` })}></div>
|
|
11108
|
+
</div>
|
|
11109
|
+
|
|
11110
|
+
<div
|
|
11111
|
+
class="thumb"
|
|
11112
|
+
role="slider"
|
|
11113
|
+
aria-label="Slider"
|
|
11114
|
+
tabindex="${this.disabled ? -1 : 0}"
|
|
11115
|
+
aria-valuemin=${this.min}
|
|
11116
|
+
aria-valuemax=${this.max}
|
|
11117
|
+
aria-valuenow=${this.value}
|
|
11118
|
+
aria-disabled=${this.disabled}
|
|
11119
|
+
style=${o$2({ left: `calc(${percentage}% - var(--thumb-half))` })}
|
|
11120
|
+
@keydown=${this.handleKeyDown}
|
|
11121
|
+
>
|
|
11122
|
+
${this.labeled ? b `<div class="value-label">${this.value}</div>` : ''}
|
|
11123
|
+
</div>
|
|
10574
11124
|
</div>
|
|
11125
|
+
|
|
11126
|
+
${this.showValue ? b `<output class="value-display" aria-live="polite">${this.value}</output>` : ''}
|
|
10575
11127
|
</div>
|
|
10576
11128
|
`;
|
|
10577
11129
|
}
|
|
10578
11130
|
}
|
|
10579
|
-
Slider.styles = [css_248z$
|
|
11131
|
+
Slider.styles = [css_248z$a];
|
|
10580
11132
|
__decorate([
|
|
10581
11133
|
n({ type: Number })
|
|
10582
11134
|
], Slider.prototype, "min", void 0);
|
|
@@ -10595,6 +11147,9 @@ __decorate([
|
|
|
10595
11147
|
__decorate([
|
|
10596
11148
|
n({ type: Boolean })
|
|
10597
11149
|
], Slider.prototype, "labeled", void 0);
|
|
11150
|
+
__decorate([
|
|
11151
|
+
n({ type: Boolean, attribute: 'show-value' })
|
|
11152
|
+
], Slider.prototype, "showValue", void 0);
|
|
10598
11153
|
__decorate([
|
|
10599
11154
|
r()
|
|
10600
11155
|
], Slider.prototype, "isDragging", void 0);
|
|
@@ -10605,7 +11160,7 @@ __decorate([
|
|
|
10605
11160
|
e$4('.thumb')
|
|
10606
11161
|
], Slider.prototype, "thumbElement", void 0);
|
|
10607
11162
|
|
|
10608
|
-
var css_248z$
|
|
11163
|
+
var css_248z$9 = i`* {
|
|
10609
11164
|
box-sizing: border-box;
|
|
10610
11165
|
}
|
|
10611
11166
|
|
|
@@ -11139,7 +11694,7 @@ class Table extends i$1 {
|
|
|
11139
11694
|
`;
|
|
11140
11695
|
}
|
|
11141
11696
|
}
|
|
11142
|
-
Table.styles = [css_248z$
|
|
11697
|
+
Table.styles = [css_248z$9];
|
|
11143
11698
|
__decorate([
|
|
11144
11699
|
n({ type: Array })
|
|
11145
11700
|
], Table.prototype, "columns", void 0);
|
|
@@ -11198,7 +11753,7 @@ __decorate([
|
|
|
11198
11753
|
r()
|
|
11199
11754
|
], Table.prototype, "isHorizontallyScrolled", void 0);
|
|
11200
11755
|
|
|
11201
|
-
var css_248z$
|
|
11756
|
+
var css_248z$8 = i`* {
|
|
11202
11757
|
box-sizing: border-box;
|
|
11203
11758
|
}
|
|
11204
11759
|
|
|
@@ -11211,48 +11766,52 @@ var css_248z$5 = i`* {
|
|
|
11211
11766
|
}
|
|
11212
11767
|
|
|
11213
11768
|
.pagination {
|
|
11214
|
-
background: var(--color-surface, #fff);
|
|
11215
11769
|
display: flex;
|
|
11216
11770
|
align-items: center;
|
|
11771
|
+
justify-content: flex-end;
|
|
11772
|
+
gap: var(--spacing-200, 1rem);
|
|
11773
|
+
background: var(--color-surface, #fff);
|
|
11774
|
+
padding: var(--spacing-150, 0.75rem) var(--spacing-200, 1rem);
|
|
11217
11775
|
}
|
|
11218
|
-
|
|
11219
|
-
|
|
11776
|
+
@media (max-width: 48rem) {
|
|
11777
|
+
.pagination {
|
|
11778
|
+
flex-wrap: wrap;
|
|
11779
|
+
justify-content: space-between;
|
|
11780
|
+
row-gap: var(--spacing-100, 0.5rem);
|
|
11781
|
+
}
|
|
11220
11782
|
}
|
|
11221
|
-
.pagination .page-size
|
|
11222
|
-
display: flex;
|
|
11783
|
+
.pagination .page-size {
|
|
11784
|
+
display: inline-flex;
|
|
11223
11785
|
align-items: center;
|
|
11224
11786
|
gap: var(--spacing-100, 0.5rem);
|
|
11225
|
-
|
|
11226
|
-
|
|
11227
|
-
|
|
11228
|
-
|
|
11229
|
-
|
|
11787
|
+
min-inline-size: max-content;
|
|
11788
|
+
}
|
|
11789
|
+
.pagination .page-size-label {
|
|
11790
|
+
font-family: var(--typography-body-small-font-family);
|
|
11791
|
+
font-size: var(--typography-body-small-font-size);
|
|
11792
|
+
font-weight: var(--typography-body-small-font-weight);
|
|
11793
|
+
line-height: var(--typography-body-small-line-height);
|
|
11794
|
+
letter-spacing: var(--typography-body-small-letter-spacing);
|
|
11230
11795
|
color: var(--color-on-surface-variant);
|
|
11231
11796
|
white-space: nowrap;
|
|
11232
11797
|
}
|
|
11233
11798
|
.pagination .page-size-select {
|
|
11234
|
-
|
|
11235
|
-
|
|
11236
|
-
|
|
11237
|
-
padding: var(--spacing-050, 0.25rem) var(--spacing-100, 0.5rem);
|
|
11238
|
-
cursor: pointer;
|
|
11239
|
-
outline: none;
|
|
11240
|
-
height: 2.5rem;
|
|
11241
|
-
font-family: var(--typography-body-medium-font-family);
|
|
11242
|
-
font-size: var(--typography-body-medium-font-size);
|
|
11243
|
-
font-weight: var(--typography-body-medium-font-weight);
|
|
11244
|
-
line-height: var(--typography-body-medium-line-height);
|
|
11245
|
-
letter-spacing: var(--typography-body-medium-letter-spacing);
|
|
11246
|
-
}
|
|
11247
|
-
.pagination .page-size-select:focus {
|
|
11248
|
-
outline: 2px solid var(--color-primary);
|
|
11799
|
+
inline-size: 5.5rem;
|
|
11800
|
+
min-inline-size: 5.5rem;
|
|
11801
|
+
--field-container-height: 2.5rem;
|
|
11249
11802
|
}
|
|
11250
11803
|
.pagination .pagination-item-count {
|
|
11251
|
-
margin-inline-start:
|
|
11252
|
-
flex: 1;
|
|
11804
|
+
margin-inline-start: auto;
|
|
11253
11805
|
display: flex;
|
|
11254
11806
|
align-items: center;
|
|
11255
11807
|
}
|
|
11808
|
+
@media (max-width: 48rem) {
|
|
11809
|
+
.pagination .pagination-item-count {
|
|
11810
|
+
order: 3;
|
|
11811
|
+
margin-inline-start: 0;
|
|
11812
|
+
inline-size: 100%;
|
|
11813
|
+
}
|
|
11814
|
+
}
|
|
11256
11815
|
.pagination .pagination-text {
|
|
11257
11816
|
font-family: var(--typography-body-medium-font-family);
|
|
11258
11817
|
font-size: var(--typography-body-medium-font-size);
|
|
@@ -11261,9 +11820,13 @@ var css_248z$5 = i`* {
|
|
|
11261
11820
|
letter-spacing: var(--typography-body-medium-letter-spacing);
|
|
11262
11821
|
color: var(--color-on-surface-variant);
|
|
11263
11822
|
}
|
|
11264
|
-
.pagination .
|
|
11265
|
-
|
|
11266
|
-
|
|
11823
|
+
.pagination .pagination-actions {
|
|
11824
|
+
display: inline-flex;
|
|
11825
|
+
align-items: center;
|
|
11826
|
+
gap: var(--spacing-025, 0.125rem);
|
|
11827
|
+
}
|
|
11828
|
+
.pagination .nav-button {
|
|
11829
|
+
--button-container-shape: 999px;
|
|
11267
11830
|
}`;
|
|
11268
11831
|
|
|
11269
11832
|
const DEFAULT_PAGE_SIZES = [10, 25, 50, 100];
|
|
@@ -11279,7 +11842,7 @@ const DEFAULT_PAGE_SIZES = [10, 25, 50, 100];
|
|
|
11279
11842
|
*
|
|
11280
11843
|
* @example
|
|
11281
11844
|
* ```html
|
|
11282
|
-
* <wc-pagination page="1" page-size="10" total-items="100"></wc-pagination>
|
|
11845
|
+
* <wc-pagination style="width: 100%;" page="1" page-size="10" total-items="100"></wc-pagination>
|
|
11283
11846
|
* ```
|
|
11284
11847
|
* @tags navigation, data
|
|
11285
11848
|
*/
|
|
@@ -11302,6 +11865,62 @@ class Pagination extends i$1 {
|
|
|
11302
11865
|
* Supported page size options.
|
|
11303
11866
|
*/
|
|
11304
11867
|
this.pageSizes = DEFAULT_PAGE_SIZES;
|
|
11868
|
+
this.handlePreviousPage = () => {
|
|
11869
|
+
this.setPage(this.page - 1);
|
|
11870
|
+
};
|
|
11871
|
+
this.handleNextPage = () => {
|
|
11872
|
+
this.setPage(this.page + 1);
|
|
11873
|
+
};
|
|
11874
|
+
}
|
|
11875
|
+
willUpdate(changedProperties) {
|
|
11876
|
+
// Normalize page-size options so the select always has valid numeric values.
|
|
11877
|
+
const normalizedPageSizes = [...new Set(this.pageSizes
|
|
11878
|
+
.map(size => Number(size))
|
|
11879
|
+
.filter(size => Number.isFinite(size) && size > 0)
|
|
11880
|
+
.map(size => Math.trunc(size)))];
|
|
11881
|
+
if (!normalizedPageSizes.length) {
|
|
11882
|
+
normalizedPageSizes.push(...DEFAULT_PAGE_SIZES);
|
|
11883
|
+
}
|
|
11884
|
+
if (changedProperties.has('pageSizes') &&
|
|
11885
|
+
(this.pageSizes.length !== normalizedPageSizes.length ||
|
|
11886
|
+
this.pageSizes.some((size, index) => size !== normalizedPageSizes[index]))) {
|
|
11887
|
+
this.pageSizes = normalizedPageSizes;
|
|
11888
|
+
}
|
|
11889
|
+
if (!this.pageSizes.includes(this.pageSize)) {
|
|
11890
|
+
this.pageSize = this.pageSizes[0] ?? DEFAULT_PAGE_SIZES[0];
|
|
11891
|
+
}
|
|
11892
|
+
if (!Number.isFinite(this.totalItems) || this.totalItems < 0) {
|
|
11893
|
+
this.totalItems = 0;
|
|
11894
|
+
}
|
|
11895
|
+
if (!Number.isFinite(this.page) || this.page < 1) {
|
|
11896
|
+
this.page = 1;
|
|
11897
|
+
}
|
|
11898
|
+
const maxPage = this.getTotalPages();
|
|
11899
|
+
if (this.page > maxPage) {
|
|
11900
|
+
this.page = maxPage;
|
|
11901
|
+
}
|
|
11902
|
+
}
|
|
11903
|
+
getTotalPages() {
|
|
11904
|
+
if (this.totalItems <= 0)
|
|
11905
|
+
return 1;
|
|
11906
|
+
return Math.max(1, Math.ceil(this.totalItems / this.pageSize));
|
|
11907
|
+
}
|
|
11908
|
+
setPage(nextPage) {
|
|
11909
|
+
const clampedPage = Math.min(Math.max(1, nextPage), this.getTotalPages());
|
|
11910
|
+
if (clampedPage === this.page)
|
|
11911
|
+
return;
|
|
11912
|
+
this.page = clampedPage;
|
|
11913
|
+
this.dispatchPageEvent();
|
|
11914
|
+
}
|
|
11915
|
+
handlePageSizeChange(event) {
|
|
11916
|
+
const rawValue = event.detail?.value;
|
|
11917
|
+
const parsedPageSize = Number.parseInt(rawValue ?? '', 10);
|
|
11918
|
+
if (!Number.isFinite(parsedPageSize) || parsedPageSize <= 0) {
|
|
11919
|
+
return;
|
|
11920
|
+
}
|
|
11921
|
+
this.pageSize = parsedPageSize;
|
|
11922
|
+
this.page = 1;
|
|
11923
|
+
this.dispatchPageEvent();
|
|
11305
11924
|
}
|
|
11306
11925
|
dispatchPageEvent() {
|
|
11307
11926
|
this.dispatchEvent(new CustomEvent('page', {
|
|
@@ -11311,76 +11930,59 @@ class Pagination extends i$1 {
|
|
|
11311
11930
|
}));
|
|
11312
11931
|
}
|
|
11313
11932
|
render() {
|
|
11314
|
-
const startItem = this.pageSize * (this.page - 1);
|
|
11933
|
+
const startItem = this.totalItems === 0 ? 0 : this.pageSize * (this.page - 1) + 1;
|
|
11315
11934
|
const endItem = Math.min(this.pageSize * this.page, this.totalItems);
|
|
11316
11935
|
const isFirstPage = this.page === 1;
|
|
11317
11936
|
const isLastPage = this.pageSize * this.page >= this.totalItems;
|
|
11318
11937
|
return b `
|
|
11319
11938
|
<div class="pagination">
|
|
11320
|
-
<div class="page-
|
|
11321
|
-
<
|
|
11322
|
-
|
|
11323
|
-
|
|
11324
|
-
|
|
11325
|
-
|
|
11326
|
-
|
|
11327
|
-
|
|
11328
|
-
this.
|
|
11329
|
-
|
|
11330
|
-
}}
|
|
11331
|
-
>
|
|
11332
|
-
${this.pageSizes.map(size => b `
|
|
11333
|
-
<option value=${size} ?selected=${this.pageSize === size}>
|
|
11334
|
-
${size}
|
|
11335
|
-
</option>
|
|
11336
|
-
`)}
|
|
11337
|
-
</select>
|
|
11338
|
-
</label>
|
|
11939
|
+
<div class="page-size">
|
|
11940
|
+
<span class="page-size-label">Items per page:</span>
|
|
11941
|
+
<wc-select
|
|
11942
|
+
class="page-size-select"
|
|
11943
|
+
.value=${String(this.pageSize)}
|
|
11944
|
+
aria-label="Items per page"
|
|
11945
|
+
@change=${this.handlePageSizeChange}
|
|
11946
|
+
>
|
|
11947
|
+
${this.pageSizes.map(size => b `<wc-option value=${String(size)}>${size}</wc-option>`)}
|
|
11948
|
+
</wc-select>
|
|
11339
11949
|
</div>
|
|
11950
|
+
|
|
11340
11951
|
<div class="pagination-item-count">
|
|
11341
11952
|
<span class="pagination-text">
|
|
11342
|
-
${startItem} - ${endItem} of ${this.totalItems}
|
|
11953
|
+
${startItem} - ${endItem} of ${this.totalItems}
|
|
11343
11954
|
</span>
|
|
11344
11955
|
</div>
|
|
11345
|
-
|
|
11346
|
-
|
|
11347
|
-
|
|
11348
|
-
|
|
11349
|
-
|
|
11350
|
-
|
|
11351
|
-
|
|
11352
|
-
|
|
11353
|
-
|
|
11354
|
-
|
|
11355
|
-
|
|
11356
|
-
|
|
11357
|
-
|
|
11358
|
-
|
|
11359
|
-
|
|
11360
|
-
|
|
11361
|
-
|
|
11362
|
-
|
|
11363
|
-
|
|
11364
|
-
|
|
11365
|
-
|
|
11366
|
-
|
|
11367
|
-
|
|
11368
|
-
|
|
11369
|
-
this.page += 1;
|
|
11370
|
-
this.dispatchPageEvent();
|
|
11371
|
-
}
|
|
11372
|
-
}}
|
|
11373
|
-
>
|
|
11374
|
-
<wc-icon slot="icon" name="arrow--right"></wc-icon>
|
|
11375
|
-
</wc-button>
|
|
11376
|
-
</div>
|
|
11377
|
-
</div>
|
|
11956
|
+
|
|
11957
|
+
<div class="pagination-actions">
|
|
11958
|
+
<wc-icon-button
|
|
11959
|
+
class="nav-button"
|
|
11960
|
+
color="secondary"
|
|
11961
|
+
variant="text"
|
|
11962
|
+
size="sm"
|
|
11963
|
+
title="Previous page"
|
|
11964
|
+
?disabled=${isFirstPage}
|
|
11965
|
+
@click=${this.handlePreviousPage}
|
|
11966
|
+
>
|
|
11967
|
+
<wc-icon name="keyboard_arrow_left"></wc-icon>
|
|
11968
|
+
</wc-icon-button>
|
|
11969
|
+
<wc-icon-button
|
|
11970
|
+
class="nav-button"
|
|
11971
|
+
color="secondary"
|
|
11972
|
+
variant="text"
|
|
11973
|
+
size="sm"
|
|
11974
|
+
title="Next page"
|
|
11975
|
+
?disabled=${isLastPage}
|
|
11976
|
+
@click=${this.handleNextPage}
|
|
11977
|
+
>
|
|
11978
|
+
<wc-icon name="keyboard_arrow_right"></wc-icon>
|
|
11979
|
+
</wc-icon-button>
|
|
11378
11980
|
</div>
|
|
11379
11981
|
</div>
|
|
11380
11982
|
`;
|
|
11381
11983
|
}
|
|
11382
11984
|
}
|
|
11383
|
-
Pagination.styles = [css_248z$
|
|
11985
|
+
Pagination.styles = [css_248z$8];
|
|
11384
11986
|
__decorate([
|
|
11385
11987
|
n({ type: Number })
|
|
11386
11988
|
], Pagination.prototype, "page", void 0);
|
|
@@ -11394,7 +11996,7 @@ __decorate([
|
|
|
11394
11996
|
n({ type: Array, attribute: 'page-sizes' })
|
|
11395
11997
|
], Pagination.prototype, "pageSizes", void 0);
|
|
11396
11998
|
|
|
11397
|
-
var css_248z$
|
|
11999
|
+
var css_248z$7 = i`* {
|
|
11398
12000
|
box-sizing: border-box;
|
|
11399
12001
|
}
|
|
11400
12002
|
|
|
@@ -11404,120 +12006,121 @@ var css_248z$4 = i`* {
|
|
|
11404
12006
|
|
|
11405
12007
|
:host {
|
|
11406
12008
|
display: block;
|
|
11407
|
-
--
|
|
11408
|
-
--
|
|
11409
|
-
--
|
|
11410
|
-
--
|
|
11411
|
-
--
|
|
11412
|
-
--
|
|
11413
|
-
--
|
|
11414
|
-
--
|
|
11415
|
-
--
|
|
11416
|
-
|
|
11417
|
-
|
|
11418
|
-
|
|
11419
|
-
|
|
11420
|
-
|
|
11421
|
-
|
|
11422
|
-
.tree-node-content {
|
|
12009
|
+
--sidebar-menu-item-height: 3rem;
|
|
12010
|
+
--sidebar-menu-item-icon-size: 1.25rem;
|
|
12011
|
+
--sidebar-menu-item-border-radius: var(--global-shape-corner-full, 9999px);
|
|
12012
|
+
--sidebar-menu-item-label-color: var(--color-on-surface);
|
|
12013
|
+
--sidebar-menu-item-icon-color: var(--color-on-surface-variant);
|
|
12014
|
+
--sidebar-menu-item-selected-background: var(--color-secondary-container);
|
|
12015
|
+
--sidebar-menu-item-selected-color: var(--color-on-secondary-container);
|
|
12016
|
+
--sidebar-menu-item-focus-ring-color: var(--color-primary);
|
|
12017
|
+
--sidebar-menu-item-transition-duration: 200ms;
|
|
12018
|
+
--sidebar-menu-item-transition-easing: cubic-bezier(0.4, 0, 0.2, 1);
|
|
12019
|
+
}
|
|
12020
|
+
|
|
12021
|
+
.sidebar-menu-item {
|
|
12022
|
+
position: relative;
|
|
11423
12023
|
display: flex;
|
|
11424
12024
|
align-items: center;
|
|
11425
|
-
|
|
11426
|
-
|
|
11427
|
-
|
|
11428
|
-
color: var(--tree-node-label-color);
|
|
12025
|
+
min-height: var(--sidebar-menu-item-height);
|
|
12026
|
+
border-radius: var(--sidebar-menu-item-border-radius);
|
|
12027
|
+
color: var(--_label-color);
|
|
11429
12028
|
cursor: pointer;
|
|
11430
12029
|
user-select: none;
|
|
11431
12030
|
text-decoration: none;
|
|
11432
12031
|
outline: none;
|
|
11433
|
-
|
|
11434
|
-
|
|
11435
|
-
|
|
11436
|
-
|
|
11437
|
-
|
|
12032
|
+
--_container-color: transparent;
|
|
12033
|
+
--_container-opacity: 1;
|
|
12034
|
+
--_label-color: var(--sidebar-menu-item-label-color);
|
|
12035
|
+
font-family: var(--typography-label-large-font-family) !important;
|
|
12036
|
+
font-size: var(--typography-label-large-font-size) !important;
|
|
12037
|
+
font-weight: var(--typography-label-large-font-weight) !important;
|
|
12038
|
+
line-height: var(--typography-label-large-line-height) !important;
|
|
12039
|
+
letter-spacing: var(--typography-label-large-letter-spacing) !important;
|
|
11438
12040
|
}
|
|
11439
|
-
.
|
|
11440
|
-
|
|
12041
|
+
.sidebar-menu-item.selected {
|
|
12042
|
+
--_container-color: var(--sidebar-menu-item-selected-background);
|
|
12043
|
+
--_label-color: var(--sidebar-menu-item-selected-color);
|
|
11441
12044
|
}
|
|
11442
|
-
.
|
|
11443
|
-
|
|
12045
|
+
.sidebar-menu-item.disabled {
|
|
12046
|
+
cursor: not-allowed;
|
|
12047
|
+
opacity: 0.6;
|
|
11444
12048
|
}
|
|
11445
|
-
.
|
|
11446
|
-
|
|
11447
|
-
color: var(--tree-node-selected-color);
|
|
12049
|
+
.sidebar-menu-item.disabled .ripple {
|
|
12050
|
+
display: none;
|
|
11448
12051
|
}
|
|
11449
|
-
|
|
11450
|
-
|
|
12052
|
+
|
|
12053
|
+
.sidebar-menu-item-content {
|
|
12054
|
+
display: flex;
|
|
12055
|
+
align-items: center;
|
|
12056
|
+
gap: 0.25rem;
|
|
12057
|
+
flex: 1;
|
|
12058
|
+
min-height: var(--sidebar-menu-item-height);
|
|
12059
|
+
padding-inline: 0.75rem;
|
|
12060
|
+
color: inherit;
|
|
12061
|
+
z-index: 1;
|
|
11451
12062
|
}
|
|
11452
|
-
|
|
11453
|
-
|
|
11454
|
-
|
|
12063
|
+
|
|
12064
|
+
.background {
|
|
12065
|
+
position: absolute;
|
|
12066
|
+
inset: 0;
|
|
12067
|
+
background-color: var(--_container-color);
|
|
12068
|
+
opacity: var(--_container-opacity);
|
|
12069
|
+
border-radius: inherit;
|
|
11455
12070
|
pointer-events: none;
|
|
11456
12071
|
}
|
|
11457
12072
|
|
|
11458
|
-
.
|
|
11459
|
-
|
|
11460
|
-
--
|
|
11461
|
-
|
|
11462
|
-
|
|
11463
|
-
|
|
11464
|
-
|
|
11465
|
-
transform: rotate(90deg);
|
|
12073
|
+
.focus-ring {
|
|
12074
|
+
z-index: 2;
|
|
12075
|
+
--focus-ring-color: var(--sidebar-menu-item-focus-ring-color);
|
|
12076
|
+
--focus-ring-container-shape-start-start: var(--sidebar-menu-item-border-radius);
|
|
12077
|
+
--focus-ring-container-shape-start-end: var(--sidebar-menu-item-border-radius);
|
|
12078
|
+
--focus-ring-container-shape-end-start: var(--sidebar-menu-item-border-radius);
|
|
12079
|
+
--focus-ring-container-shape-end-end: var(--sidebar-menu-item-border-radius);
|
|
11466
12080
|
}
|
|
11467
12081
|
|
|
11468
|
-
.
|
|
11469
|
-
|
|
11470
|
-
|
|
11471
|
-
height: var(--tree-node-icon-size);
|
|
11472
|
-
flex-shrink: 0;
|
|
12082
|
+
.ripple {
|
|
12083
|
+
--ripple-pressed-color: var(--color-on-surface);
|
|
12084
|
+
border-radius: inherit;
|
|
11473
12085
|
}
|
|
11474
12086
|
|
|
11475
|
-
.
|
|
11476
|
-
--
|
|
11477
|
-
--icon-color: var(--tree-node-icon-color);
|
|
11478
|
-
flex-shrink: 0;
|
|
12087
|
+
.sidebar-menu-item.selected .ripple {
|
|
12088
|
+
--ripple-pressed-color: var(--sidebar-menu-item-selected-color);
|
|
11479
12089
|
}
|
|
11480
12090
|
|
|
11481
|
-
.
|
|
12091
|
+
.sidebar-menu-item-label {
|
|
11482
12092
|
flex: 1;
|
|
11483
12093
|
overflow: hidden;
|
|
11484
12094
|
text-overflow: ellipsis;
|
|
11485
12095
|
white-space: nowrap;
|
|
11486
|
-
}
|
|
11487
|
-
|
|
11488
|
-
.node-children {
|
|
11489
|
-
display: none;
|
|
11490
|
-
}
|
|
11491
|
-
.node-children.expanded {
|
|
11492
|
-
display: block;
|
|
11493
12096
|
}`;
|
|
11494
12097
|
|
|
11495
12098
|
/**
|
|
11496
|
-
* @label
|
|
11497
|
-
* @tag wc-
|
|
11498
|
-
* @rawTag
|
|
11499
|
-
* @parentRawTag
|
|
11500
|
-
* @summary A
|
|
12099
|
+
* @label Sidebar Menu Item
|
|
12100
|
+
* @tag wc-sidebar-menu-item
|
|
12101
|
+
* @rawTag sidebar-menu-item
|
|
12102
|
+
* @parentRawTag sidebar-menu
|
|
12103
|
+
* @summary A sidebar menu item represents a selectable leaf item in the sidebar navigation tree.
|
|
11501
12104
|
*
|
|
11502
12105
|
* @example
|
|
11503
12106
|
* ```html
|
|
11504
|
-
* <wc-
|
|
11505
|
-
* <wc-
|
|
11506
|
-
* <wc-
|
|
11507
|
-
* </wc-
|
|
11508
|
-
* </wc-
|
|
12107
|
+
* <wc-sidebar-menu>
|
|
12108
|
+
* <wc-sidebar-sub-menu label="Parent" expanded>
|
|
12109
|
+
* <wc-sidebar-menu-item label="Child"></wc-sidebar-menu-item>
|
|
12110
|
+
* </wc-sidebar-sub-menu>
|
|
12111
|
+
* </wc-sidebar-menu>
|
|
11509
12112
|
* ```
|
|
11510
12113
|
* @tags navigation
|
|
11511
12114
|
*/
|
|
11512
|
-
class
|
|
12115
|
+
class SidebarMenuItem extends i$1 {
|
|
11513
12116
|
constructor() {
|
|
11514
12117
|
super(...arguments);
|
|
11515
12118
|
/**
|
|
11516
|
-
* The value used to identify this
|
|
12119
|
+
* The value used to identify this item when selected.
|
|
11517
12120
|
*/
|
|
11518
12121
|
this.value = '';
|
|
11519
12122
|
/**
|
|
11520
|
-
* The display label for this
|
|
12123
|
+
* The display label for this item.
|
|
11521
12124
|
*/
|
|
11522
12125
|
this.label = '';
|
|
11523
12126
|
/**
|
|
@@ -11533,21 +12136,26 @@ class TreeNode extends i$1 {
|
|
|
11533
12136
|
*/
|
|
11534
12137
|
this.target = '_self';
|
|
11535
12138
|
/**
|
|
11536
|
-
* If true, the user cannot interact with the
|
|
12139
|
+
* If true, the user cannot interact with the item.
|
|
11537
12140
|
*/
|
|
11538
12141
|
this.disabled = false;
|
|
11539
12142
|
/**
|
|
11540
|
-
* Whether the
|
|
12143
|
+
* Whether the item is currently selected.
|
|
11541
12144
|
*/
|
|
11542
12145
|
this.selected = false;
|
|
11543
12146
|
/**
|
|
11544
|
-
*
|
|
11545
|
-
*/
|
|
11546
|
-
this.expanded = false;
|
|
11547
|
-
/**
|
|
11548
|
-
* The nesting depth level (set automatically by the parent tree-view).
|
|
12147
|
+
* The nesting depth level (set automatically by the parent sidebar-menu).
|
|
11549
12148
|
*/
|
|
11550
12149
|
this.level = 0;
|
|
12150
|
+
this._onClick = () => {
|
|
12151
|
+
if (this.disabled)
|
|
12152
|
+
return;
|
|
12153
|
+
this.dispatchEvent(new CustomEvent('sidebar-menu-item:click', {
|
|
12154
|
+
bubbles: true,
|
|
12155
|
+
composed: true,
|
|
12156
|
+
detail: { value: this.value, label: this.label },
|
|
12157
|
+
}));
|
|
12158
|
+
};
|
|
11551
12159
|
}
|
|
11552
12160
|
focus() {
|
|
11553
12161
|
this._nativeElement?.focus();
|
|
@@ -11555,193 +12163,372 @@ class TreeNode extends i$1 {
|
|
|
11555
12163
|
blur() {
|
|
11556
12164
|
this._nativeElement?.blur();
|
|
11557
12165
|
}
|
|
11558
|
-
|
|
11559
|
-
|
|
11560
|
-
|
|
11561
|
-
connectedCallback() {
|
|
11562
|
-
super.connectedCallback();
|
|
11563
|
-
this._updateChildLevels();
|
|
11564
|
-
this.setAttribute('role', 'treeitem');
|
|
11565
|
-
this._syncHostAria();
|
|
11566
|
-
}
|
|
11567
|
-
_syncHostAria() {
|
|
11568
|
-
const hasChildren = this._getChildNodes().length > 0;
|
|
11569
|
-
if (hasChildren) {
|
|
11570
|
-
this.setAttribute('aria-expanded', String(this.expanded));
|
|
11571
|
-
}
|
|
11572
|
-
else {
|
|
11573
|
-
this.removeAttribute('aria-expanded');
|
|
11574
|
-
}
|
|
11575
|
-
this.setAttribute('aria-selected', String(this.selected));
|
|
11576
|
-
this.setAttribute('aria-disabled', String(this.disabled));
|
|
11577
|
-
this.setAttribute('aria-level', String(this.level + 1));
|
|
11578
|
-
}
|
|
11579
|
-
_updateChildLevels() {
|
|
11580
|
-
const children = this._getChildNodes();
|
|
11581
|
-
children.forEach(child => {
|
|
11582
|
-
// eslint-disable-next-line no-param-reassign
|
|
11583
|
-
child.level = this.level + 1;
|
|
11584
|
-
});
|
|
11585
|
-
}
|
|
11586
|
-
_handleClick(event) {
|
|
11587
|
-
if (this.disabled) {
|
|
11588
|
-
event.preventDefault();
|
|
11589
|
-
event.stopPropagation();
|
|
11590
|
-
return;
|
|
11591
|
-
}
|
|
11592
|
-
const hasChildren = this._getChildNodes().length > 0;
|
|
11593
|
-
if (hasChildren) {
|
|
11594
|
-
this.expanded = !this.expanded;
|
|
11595
|
-
}
|
|
11596
|
-
this.dispatchEvent(new CustomEvent('tree-node:click', {
|
|
11597
|
-
bubbles: true,
|
|
11598
|
-
composed: true,
|
|
11599
|
-
detail: {
|
|
11600
|
-
value: this.value || this.label,
|
|
11601
|
-
label: this.label,
|
|
11602
|
-
expanded: this.expanded,
|
|
11603
|
-
},
|
|
11604
|
-
}));
|
|
11605
|
-
}
|
|
11606
|
-
_handleKeyDown(event) {
|
|
11607
|
-
if (this.disabled)
|
|
11608
|
-
return;
|
|
11609
|
-
const hasChildren = this._getChildNodes().length > 0;
|
|
11610
|
-
switch (event.key) {
|
|
11611
|
-
case ' ':
|
|
11612
|
-
case 'Enter':
|
|
11613
|
-
event.preventDefault();
|
|
11614
|
-
if (hasChildren) {
|
|
11615
|
-
this.expanded = !this.expanded;
|
|
11616
|
-
}
|
|
11617
|
-
this.dispatchEvent(new CustomEvent('tree-node:click', {
|
|
11618
|
-
bubbles: true,
|
|
11619
|
-
composed: true,
|
|
11620
|
-
detail: {
|
|
11621
|
-
value: this.value || this.label,
|
|
11622
|
-
label: this.label,
|
|
11623
|
-
expanded: this.expanded,
|
|
11624
|
-
},
|
|
11625
|
-
}));
|
|
11626
|
-
if (this.href) {
|
|
11627
|
-
window.open(this.href, this.target);
|
|
11628
|
-
}
|
|
11629
|
-
break;
|
|
11630
|
-
case 'ArrowLeft':
|
|
11631
|
-
event.preventDefault();
|
|
11632
|
-
if (this.expanded && hasChildren) {
|
|
11633
|
-
this.expanded = false;
|
|
11634
|
-
}
|
|
11635
|
-
break;
|
|
11636
|
-
case 'ArrowRight':
|
|
11637
|
-
event.preventDefault();
|
|
11638
|
-
if (hasChildren) {
|
|
11639
|
-
if (!this.expanded) {
|
|
11640
|
-
this.expanded = true;
|
|
11641
|
-
}
|
|
11642
|
-
else {
|
|
11643
|
-
const firstChild = this._getChildNodes()[0];
|
|
11644
|
-
firstChild?.focus();
|
|
11645
|
-
}
|
|
11646
|
-
}
|
|
11647
|
-
break;
|
|
11648
|
-
}
|
|
11649
|
-
}
|
|
11650
|
-
updated(changedProps) {
|
|
11651
|
-
super.updated(changedProps);
|
|
11652
|
-
if (changedProps.has('level')) {
|
|
11653
|
-
this._updateChildLevels();
|
|
11654
|
-
}
|
|
11655
|
-
this._syncHostAria();
|
|
11656
|
-
}
|
|
11657
|
-
_renderContent(hasChildren) {
|
|
11658
|
-
// 0.125rem offset aligns text visually with the expand/icon space
|
|
11659
|
-
const indentStyle = o$3({
|
|
11660
|
-
paddingInlineStart: `calc(${this.level + 1}rem - 0.125rem)`,
|
|
11661
|
-
});
|
|
11662
|
-
const contentClasses = e$3({
|
|
11663
|
-
'tree-node-content': true,
|
|
11664
|
-
selected: this.selected,
|
|
12166
|
+
render() {
|
|
12167
|
+
const classes = e$3({
|
|
12168
|
+
'sidebar-menu-item': true,
|
|
11665
12169
|
disabled: this.disabled,
|
|
12170
|
+
selected: this.selected,
|
|
11666
12171
|
});
|
|
11667
|
-
const
|
|
11668
|
-
|
|
11669
|
-
|
|
11670
|
-
|
|
11671
|
-
|
|
11672
|
-
|
|
11673
|
-
|
|
11674
|
-
|
|
11675
|
-
? b `<wc-icon class="node-icon" name=${this.icon}></wc-icon>`
|
|
11676
|
-
: ''}
|
|
11677
|
-
<span class="tree-node-label">${this.label}<slot name="label"></slot></span>
|
|
12172
|
+
const content = b `
|
|
12173
|
+
<wc-focus-ring class="focus-ring" for="item"></wc-focus-ring>
|
|
12174
|
+
<div class="background"></div>
|
|
12175
|
+
<wc-ripple class="ripple"></wc-ripple>
|
|
12176
|
+
<div class="sidebar-menu-item-content">
|
|
12177
|
+
${this.icon ? b `<wc-icon name="${this.icon}"></wc-icon>` : ''}
|
|
12178
|
+
<span class="sidebar-menu-item-label">${this.label}</span>
|
|
12179
|
+
</div>
|
|
11678
12180
|
`;
|
|
11679
12181
|
if (this.href) {
|
|
11680
|
-
return b
|
|
11681
|
-
|
|
11682
|
-
|
|
11683
|
-
|
|
11684
|
-
|
|
11685
|
-
|
|
11686
|
-
|
|
11687
|
-
|
|
11688
|
-
|
|
12182
|
+
return b `
|
|
12183
|
+
<a
|
|
12184
|
+
id="item"
|
|
12185
|
+
href="${this.href}"
|
|
12186
|
+
target="${this.target}"
|
|
12187
|
+
class="${classes}"
|
|
12188
|
+
aria-disabled="${this.disabled}"
|
|
12189
|
+
tabindex="${this.disabled ? -1 : 0}"
|
|
12190
|
+
@click="${this._onClick}"
|
|
12191
|
+
>
|
|
12192
|
+
${content}
|
|
12193
|
+
</a>
|
|
12194
|
+
`;
|
|
11689
12195
|
}
|
|
11690
|
-
return b
|
|
11691
|
-
|
|
11692
|
-
|
|
11693
|
-
|
|
11694
|
-
|
|
11695
|
-
|
|
11696
|
-
|
|
11697
|
-
|
|
11698
|
-
|
|
11699
|
-
|
|
11700
|
-
|
|
11701
|
-
'
|
|
11702
|
-
|
|
11703
|
-
|
|
11704
|
-
|
|
11705
|
-
|
|
11706
|
-
|
|
11707
|
-
|
|
11708
|
-
</div>
|
|
11709
|
-
|
|
12196
|
+
return b `
|
|
12197
|
+
<div
|
|
12198
|
+
id="item"
|
|
12199
|
+
class="${classes}"
|
|
12200
|
+
role="treeitem"
|
|
12201
|
+
aria-label="${this.label}"
|
|
12202
|
+
aria-selected="${String(this.selected)}"
|
|
12203
|
+
aria-disabled="${this.disabled}"
|
|
12204
|
+
tabindex="${this.disabled ? -1 : 0}"
|
|
12205
|
+
@click="${this._onClick}"
|
|
12206
|
+
@keydown="${(e) => {
|
|
12207
|
+
if (e.key === 'Enter' || e.key === ' ') {
|
|
12208
|
+
e.preventDefault();
|
|
12209
|
+
this._onClick();
|
|
12210
|
+
}
|
|
12211
|
+
}}"
|
|
12212
|
+
>
|
|
12213
|
+
${content}
|
|
12214
|
+
</div>
|
|
12215
|
+
`;
|
|
11710
12216
|
}
|
|
11711
12217
|
}
|
|
11712
|
-
|
|
12218
|
+
SidebarMenuItem.styles = [css_248z$7];
|
|
12219
|
+
__decorate([
|
|
12220
|
+
n({ type: String, reflect: true })
|
|
12221
|
+
], SidebarMenuItem.prototype, "value", void 0);
|
|
11713
12222
|
__decorate([
|
|
11714
12223
|
n({ type: String, reflect: true })
|
|
11715
|
-
],
|
|
12224
|
+
], SidebarMenuItem.prototype, "label", void 0);
|
|
11716
12225
|
__decorate([
|
|
11717
12226
|
n({ type: String, reflect: true })
|
|
11718
|
-
],
|
|
12227
|
+
], SidebarMenuItem.prototype, "icon", void 0);
|
|
12228
|
+
__decorate([
|
|
12229
|
+
n({ type: String, reflect: true })
|
|
12230
|
+
], SidebarMenuItem.prototype, "href", void 0);
|
|
12231
|
+
__decorate([
|
|
12232
|
+
n({ type: String, reflect: true })
|
|
12233
|
+
], SidebarMenuItem.prototype, "target", void 0);
|
|
12234
|
+
__decorate([
|
|
12235
|
+
n({ type: Boolean, reflect: true })
|
|
12236
|
+
], SidebarMenuItem.prototype, "disabled", void 0);
|
|
12237
|
+
__decorate([
|
|
12238
|
+
n({ type: Boolean, reflect: true })
|
|
12239
|
+
], SidebarMenuItem.prototype, "selected", void 0);
|
|
12240
|
+
__decorate([
|
|
12241
|
+
n({ type: Number, reflect: true })
|
|
12242
|
+
], SidebarMenuItem.prototype, "level", void 0);
|
|
12243
|
+
__decorate([
|
|
12244
|
+
e$4('.sidebar-menu-item-content')
|
|
12245
|
+
], SidebarMenuItem.prototype, "_nativeElement", void 0);
|
|
12246
|
+
|
|
12247
|
+
var css_248z$6 = i`* {
|
|
12248
|
+
box-sizing: border-box;
|
|
12249
|
+
}
|
|
12250
|
+
|
|
12251
|
+
.screen-reader-only {
|
|
12252
|
+
display: none !important;
|
|
12253
|
+
}
|
|
12254
|
+
|
|
12255
|
+
:host {
|
|
12256
|
+
display: block;
|
|
12257
|
+
--sidebar-menu-item-height: 3rem;
|
|
12258
|
+
--sidebar-menu-item-border-radius: var(--global-shape-corner-full, 9999px);
|
|
12259
|
+
--sidebar-menu-item-label-color: var(--color-on-surface);
|
|
12260
|
+
--sidebar-menu-item-icon-color: var(--color-on-surface-variant);
|
|
12261
|
+
--sidebar-menu-item-selected-background: var(--color-secondary-container);
|
|
12262
|
+
--sidebar-menu-item-selected-color: var(--color-on-secondary-container);
|
|
12263
|
+
--sidebar-menu-item-focus-ring-color: var(--color-primary);
|
|
12264
|
+
}
|
|
12265
|
+
|
|
12266
|
+
.sidebar-sub-menu {
|
|
12267
|
+
display: block;
|
|
12268
|
+
}
|
|
12269
|
+
|
|
12270
|
+
.sidebar-sub-menu-inner {
|
|
12271
|
+
position: relative;
|
|
12272
|
+
display: flex;
|
|
12273
|
+
align-items: center;
|
|
12274
|
+
gap: 0.5rem;
|
|
12275
|
+
min-height: var(--sidebar-menu-item-height);
|
|
12276
|
+
cursor: pointer;
|
|
12277
|
+
border-radius: var(--sidebar-menu-item-border-radius);
|
|
12278
|
+
outline: none;
|
|
12279
|
+
padding-inline-end: 0.75rem;
|
|
12280
|
+
color: var(--_label-color);
|
|
12281
|
+
--_container-color: transparent;
|
|
12282
|
+
--_container-opacity: 1;
|
|
12283
|
+
--_label-color: var(--sidebar-menu-item-label-color);
|
|
12284
|
+
font-family: var(--typography-label-large-font-family) !important;
|
|
12285
|
+
font-size: var(--typography-label-large-font-size) !important;
|
|
12286
|
+
font-weight: var(--typography-label-large-font-weight) !important;
|
|
12287
|
+
line-height: var(--typography-label-large-line-height) !important;
|
|
12288
|
+
letter-spacing: var(--typography-label-large-letter-spacing) !important;
|
|
12289
|
+
}
|
|
12290
|
+
.sidebar-sub-menu-inner.selected {
|
|
12291
|
+
--_container-color: var(--sidebar-menu-item-selected-background);
|
|
12292
|
+
--_label-color: var(--sidebar-menu-item-selected-color);
|
|
12293
|
+
}
|
|
12294
|
+
.sidebar-sub-menu-inner.disabled {
|
|
12295
|
+
cursor: not-allowed;
|
|
12296
|
+
opacity: 0.6;
|
|
12297
|
+
}
|
|
12298
|
+
.sidebar-sub-menu-inner.disabled .ripple {
|
|
12299
|
+
display: none;
|
|
12300
|
+
}
|
|
12301
|
+
|
|
12302
|
+
.sidebar-sub-menu-content {
|
|
12303
|
+
display: flex;
|
|
12304
|
+
align-items: center;
|
|
12305
|
+
gap: 0.25rem;
|
|
12306
|
+
flex: 1;
|
|
12307
|
+
min-height: var(--sidebar-menu-item-height);
|
|
12308
|
+
color: inherit;
|
|
12309
|
+
user-select: none;
|
|
12310
|
+
text-decoration: none;
|
|
12311
|
+
outline: none;
|
|
12312
|
+
padding-inline: 0.75rem;
|
|
12313
|
+
z-index: 1;
|
|
12314
|
+
}
|
|
12315
|
+
|
|
12316
|
+
.background {
|
|
12317
|
+
position: absolute;
|
|
12318
|
+
inset: 0;
|
|
12319
|
+
background-color: var(--_container-color);
|
|
12320
|
+
opacity: var(--_container-opacity);
|
|
12321
|
+
border-radius: inherit;
|
|
12322
|
+
pointer-events: none;
|
|
12323
|
+
}
|
|
12324
|
+
|
|
12325
|
+
.focus-ring {
|
|
12326
|
+
z-index: 2;
|
|
12327
|
+
--focus-ring-color: var(--sidebar-menu-item-focus-ring-color);
|
|
12328
|
+
--focus-ring-container-shape-start-start: var(--sidebar-menu-item-border-radius);
|
|
12329
|
+
--focus-ring-container-shape-start-end: var(--sidebar-menu-item-border-radius);
|
|
12330
|
+
--focus-ring-container-shape-end-start: var(--sidebar-menu-item-border-radius);
|
|
12331
|
+
--focus-ring-container-shape-end-end: var(--sidebar-menu-item-border-radius);
|
|
12332
|
+
}
|
|
12333
|
+
|
|
12334
|
+
.ripple {
|
|
12335
|
+
--ripple-pressed-color: var(--color-on-surface);
|
|
12336
|
+
border-radius: inherit;
|
|
12337
|
+
}
|
|
12338
|
+
|
|
12339
|
+
.sidebar-sub-menu-inner.selected .ripple {
|
|
12340
|
+
--ripple-pressed-color: var(--sidebar-menu-item-selected-color);
|
|
12341
|
+
}
|
|
12342
|
+
|
|
12343
|
+
.sidebar-sub-menu-label {
|
|
12344
|
+
flex: 1;
|
|
12345
|
+
overflow: hidden;
|
|
12346
|
+
text-overflow: ellipsis;
|
|
12347
|
+
white-space: nowrap;
|
|
12348
|
+
}
|
|
12349
|
+
|
|
12350
|
+
.expand-icon {
|
|
12351
|
+
display: flex;
|
|
12352
|
+
align-items: center;
|
|
12353
|
+
justify-content: center;
|
|
12354
|
+
color: var(--sidebar-menu-item-icon-color);
|
|
12355
|
+
flex-shrink: 0;
|
|
12356
|
+
width: var(--sidebar-menu-item-height);
|
|
12357
|
+
height: var(--sidebar-menu-item-height);
|
|
12358
|
+
transition: transform var(--duration-medium1) var(--easing-standard);
|
|
12359
|
+
}
|
|
12360
|
+
|
|
12361
|
+
:host([expanded]) .expand-icon {
|
|
12362
|
+
transform: rotate(180deg);
|
|
12363
|
+
}
|
|
12364
|
+
|
|
12365
|
+
.sidebar-sub-menu-children {
|
|
12366
|
+
display: block;
|
|
12367
|
+
overflow: hidden;
|
|
12368
|
+
margin-left: var(--spacing-200);
|
|
12369
|
+
max-height: 9999px;
|
|
12370
|
+
opacity: 1;
|
|
12371
|
+
transition: max-height var(--duration-medium1) var(--easing-standard), opacity var(--duration-medium1) var(--easing-standard);
|
|
12372
|
+
}
|
|
12373
|
+
|
|
12374
|
+
.sidebar-sub-menu-children.hidden {
|
|
12375
|
+
max-height: 0;
|
|
12376
|
+
opacity: 0;
|
|
12377
|
+
}`;
|
|
12378
|
+
|
|
12379
|
+
/**
|
|
12380
|
+
* @label Sidebar Sub Menu
|
|
12381
|
+
* @tag wc-sidebar-sub-menu
|
|
12382
|
+
* @rawTag sidebar-sub-menu
|
|
12383
|
+
* @parentRawTag sidebar-menu
|
|
12384
|
+
* @summary A sidebar sub menu groups sidebar menu items and handles expand/collapse behavior.
|
|
12385
|
+
*
|
|
12386
|
+
* @example
|
|
12387
|
+
* ```html
|
|
12388
|
+
* <wc-sidebar-sub-menu label="Parent" expanded>
|
|
12389
|
+
* <wc-sidebar-menu-item label="Child"></wc-sidebar-menu-item>
|
|
12390
|
+
* </wc-sidebar-sub-menu>
|
|
12391
|
+
* ```
|
|
12392
|
+
* @tags navigation
|
|
12393
|
+
*/
|
|
12394
|
+
class SidebarSubMenu extends i$1 {
|
|
12395
|
+
constructor() {
|
|
12396
|
+
super(...arguments);
|
|
12397
|
+
this.value = '';
|
|
12398
|
+
this.label = '';
|
|
12399
|
+
this.icon = '';
|
|
12400
|
+
this.disabled = false;
|
|
12401
|
+
this.selected = false;
|
|
12402
|
+
this.expanded = false;
|
|
12403
|
+
this.level = 0;
|
|
12404
|
+
this._updateChildLevels = () => {
|
|
12405
|
+
this._getChildNodes().forEach(child => {
|
|
12406
|
+
if ('level' in child) {
|
|
12407
|
+
// eslint-disable-next-line no-param-reassign
|
|
12408
|
+
child.level = this.level + 1;
|
|
12409
|
+
}
|
|
12410
|
+
});
|
|
12411
|
+
};
|
|
12412
|
+
this._onClick = () => {
|
|
12413
|
+
if (this.disabled)
|
|
12414
|
+
return;
|
|
12415
|
+
if (this._getChildNodes().length > 0) {
|
|
12416
|
+
this.expanded = !this.expanded;
|
|
12417
|
+
}
|
|
12418
|
+
this.dispatchEvent(new CustomEvent('sidebar-menu-item:click', {
|
|
12419
|
+
bubbles: true,
|
|
12420
|
+
composed: true,
|
|
12421
|
+
detail: { value: this.value, label: this.label },
|
|
12422
|
+
}));
|
|
12423
|
+
};
|
|
12424
|
+
}
|
|
12425
|
+
focus() {
|
|
12426
|
+
this._nativeElement?.focus();
|
|
12427
|
+
}
|
|
12428
|
+
blur() {
|
|
12429
|
+
this._nativeElement?.blur();
|
|
12430
|
+
}
|
|
12431
|
+
connectedCallback() {
|
|
12432
|
+
super.connectedCallback();
|
|
12433
|
+
this._updateChildLevels();
|
|
12434
|
+
}
|
|
12435
|
+
updated(changedProps) {
|
|
12436
|
+
super.updated(changedProps);
|
|
12437
|
+
if (changedProps.has('expanded')) {
|
|
12438
|
+
this.setAttribute('aria-expanded', String(this.expanded));
|
|
12439
|
+
if (this.expanded) {
|
|
12440
|
+
this.setAttribute('data-expanded', '');
|
|
12441
|
+
}
|
|
12442
|
+
else {
|
|
12443
|
+
this.removeAttribute('data-expanded');
|
|
12444
|
+
}
|
|
12445
|
+
}
|
|
12446
|
+
}
|
|
12447
|
+
_getChildNodes() {
|
|
12448
|
+
return Array.from(this.children).filter(el => {
|
|
12449
|
+
const tag = el.tagName.toLowerCase();
|
|
12450
|
+
return tag === 'wc-sidebar-menu-item' || tag === 'wc-sidebar-sub-menu';
|
|
12451
|
+
});
|
|
12452
|
+
}
|
|
12453
|
+
render() {
|
|
12454
|
+
const hasChildren = this._getChildNodes().length > 0;
|
|
12455
|
+
const wrapperClasses = e$3({
|
|
12456
|
+
'sidebar-sub-menu': true,
|
|
12457
|
+
});
|
|
12458
|
+
const innerClasses = e$3({
|
|
12459
|
+
'sidebar-sub-menu-inner': true,
|
|
12460
|
+
disabled: this.disabled,
|
|
12461
|
+
selected: this.selected,
|
|
12462
|
+
});
|
|
12463
|
+
const inlineStyles = o$2({
|
|
12464
|
+
paddingLeft: `calc(var(--sidebar-menu-item-height, 2.5rem) * ${this.level})`,
|
|
12465
|
+
});
|
|
12466
|
+
return b `
|
|
12467
|
+
<div class="${wrapperClasses}" style="${inlineStyles}">
|
|
12468
|
+
<div
|
|
12469
|
+
id="item"
|
|
12470
|
+
class="${innerClasses}"
|
|
12471
|
+
role="treeitem"
|
|
12472
|
+
aria-label="${this.label}"
|
|
12473
|
+
aria-selected="${String(this.selected)}"
|
|
12474
|
+
aria-disabled="${this.disabled}"
|
|
12475
|
+
aria-expanded="${this.expanded}"
|
|
12476
|
+
@click="${this._onClick}"
|
|
12477
|
+
@keydown="${(e) => {
|
|
12478
|
+
if (e.key === 'Enter' || e.key === ' ') {
|
|
12479
|
+
e.preventDefault();
|
|
12480
|
+
this._onClick();
|
|
12481
|
+
}
|
|
12482
|
+
}}"
|
|
12483
|
+
tabindex="${this.disabled ? -1 : 0}"
|
|
12484
|
+
>
|
|
12485
|
+
<wc-focus-ring class="focus-ring" for="item"></wc-focus-ring>
|
|
12486
|
+
<div class="background"></div>
|
|
12487
|
+
<wc-ripple class="ripple"></wc-ripple>
|
|
12488
|
+
<div class="sidebar-sub-menu-content">
|
|
12489
|
+
${this.icon ? b `<wc-icon name="${this.icon}"></wc-icon>` : ''}
|
|
12490
|
+
<span class="sidebar-sub-menu-label">${this.label}</span>
|
|
12491
|
+
</div>
|
|
12492
|
+
${hasChildren
|
|
12493
|
+
? b `
|
|
12494
|
+
<wc-icon class="expand-icon" name="arrow_drop_down" aria-hidden="true"></wc-icon>
|
|
12495
|
+
`
|
|
12496
|
+
: ''}
|
|
12497
|
+
</div>
|
|
12498
|
+
<div class="sidebar-sub-menu-children ${(!hasChildren || !this.expanded) ? 'hidden' : ''}">
|
|
12499
|
+
<slot @slotchange="${this._updateChildLevels}"></slot>
|
|
12500
|
+
</div>
|
|
12501
|
+
</div>
|
|
12502
|
+
`;
|
|
12503
|
+
}
|
|
12504
|
+
}
|
|
12505
|
+
SidebarSubMenu.styles = [css_248z$6];
|
|
11719
12506
|
__decorate([
|
|
11720
12507
|
n({ type: String, reflect: true })
|
|
11721
|
-
],
|
|
12508
|
+
], SidebarSubMenu.prototype, "value", void 0);
|
|
11722
12509
|
__decorate([
|
|
11723
12510
|
n({ type: String, reflect: true })
|
|
11724
|
-
],
|
|
12511
|
+
], SidebarSubMenu.prototype, "label", void 0);
|
|
11725
12512
|
__decorate([
|
|
11726
12513
|
n({ type: String, reflect: true })
|
|
11727
|
-
],
|
|
12514
|
+
], SidebarSubMenu.prototype, "icon", void 0);
|
|
11728
12515
|
__decorate([
|
|
11729
12516
|
n({ type: Boolean, reflect: true })
|
|
11730
|
-
],
|
|
12517
|
+
], SidebarSubMenu.prototype, "disabled", void 0);
|
|
11731
12518
|
__decorate([
|
|
11732
12519
|
n({ type: Boolean, reflect: true })
|
|
11733
|
-
],
|
|
12520
|
+
], SidebarSubMenu.prototype, "selected", void 0);
|
|
11734
12521
|
__decorate([
|
|
11735
12522
|
n({ type: Boolean, reflect: true })
|
|
11736
|
-
],
|
|
12523
|
+
], SidebarSubMenu.prototype, "expanded", void 0);
|
|
11737
12524
|
__decorate([
|
|
11738
12525
|
n({ type: Number, reflect: true })
|
|
11739
|
-
],
|
|
12526
|
+
], SidebarSubMenu.prototype, "level", void 0);
|
|
11740
12527
|
__decorate([
|
|
11741
|
-
e$4('.
|
|
11742
|
-
],
|
|
12528
|
+
e$4('.sidebar-sub-menu-inner')
|
|
12529
|
+
], SidebarSubMenu.prototype, "_nativeElement", void 0);
|
|
11743
12530
|
|
|
11744
|
-
var css_248z$
|
|
12531
|
+
var css_248z$5 = i`* {
|
|
11745
12532
|
box-sizing: border-box;
|
|
11746
12533
|
}
|
|
11747
12534
|
|
|
@@ -11753,164 +12540,168 @@ var css_248z$3 = i`* {
|
|
|
11753
12540
|
display: block;
|
|
11754
12541
|
}
|
|
11755
12542
|
|
|
11756
|
-
.
|
|
12543
|
+
.sidebar-menu {
|
|
11757
12544
|
display: block;
|
|
11758
12545
|
padding: var(--spacing-100, 0.5rem) 0;
|
|
11759
12546
|
}`;
|
|
11760
12547
|
|
|
11761
12548
|
/**
|
|
11762
|
-
* @label
|
|
11763
|
-
* @tag wc-
|
|
11764
|
-
* @rawTag
|
|
11765
|
-
* @summary A
|
|
12549
|
+
* @label Sidebar Menu
|
|
12550
|
+
* @tag wc-sidebar-menu
|
|
12551
|
+
* @rawTag sidebar-menu
|
|
12552
|
+
* @summary A sidebar menu is a hierarchical structure that provides nested levels of navigation. It supports keyboard navigation, single/multi select, and expandable items.
|
|
11766
12553
|
*
|
|
11767
12554
|
* @example
|
|
11768
12555
|
* ```html
|
|
11769
|
-
* <wc-
|
|
11770
|
-
* <wc-
|
|
11771
|
-
* <wc-
|
|
11772
|
-
* <wc-
|
|
11773
|
-
* </wc-
|
|
11774
|
-
* </wc-
|
|
12556
|
+
* <wc-sidebar-menu>
|
|
12557
|
+
* <wc-sidebar-sub-menu label="Parent" expanded>
|
|
12558
|
+
* <wc-sidebar-menu-item label="Child 1"></wc-sidebar-menu-item>
|
|
12559
|
+
* <wc-sidebar-menu-item label="Child 2"></wc-sidebar-menu-item>
|
|
12560
|
+
* </wc-sidebar-sub-menu>
|
|
12561
|
+
* </wc-sidebar-menu>
|
|
11775
12562
|
* ```
|
|
11776
12563
|
* @tags navigation
|
|
11777
12564
|
*/
|
|
11778
|
-
class
|
|
12565
|
+
class SidebarMenu extends i$1 {
|
|
11779
12566
|
constructor() {
|
|
11780
12567
|
super(...arguments);
|
|
11781
12568
|
/**
|
|
11782
|
-
* The value of the currently selected
|
|
12569
|
+
* The value of the currently selected item.
|
|
11783
12570
|
*/
|
|
11784
|
-
this.
|
|
11785
|
-
this.
|
|
11786
|
-
const
|
|
11787
|
-
if (
|
|
12571
|
+
this.selectedItem = '';
|
|
12572
|
+
this._onItemClick = (event) => {
|
|
12573
|
+
const item = event.target;
|
|
12574
|
+
if (item.disabled)
|
|
11788
12575
|
return;
|
|
11789
|
-
const value = event.detail?.value ??
|
|
11790
|
-
this.
|
|
11791
|
-
// Update selected state on all
|
|
12576
|
+
const value = event.detail?.value ?? item.value ?? item.label;
|
|
12577
|
+
this.selectedItem = value;
|
|
12578
|
+
// Update selected state on all items
|
|
11792
12579
|
this._updateSelectedState(value);
|
|
11793
|
-
this.dispatchEvent(new CustomEvent('
|
|
12580
|
+
this.dispatchEvent(new CustomEvent('sidebar-menu:change', {
|
|
11794
12581
|
bubbles: true,
|
|
11795
12582
|
composed: true,
|
|
11796
|
-
detail: { value,
|
|
12583
|
+
detail: { value, item },
|
|
11797
12584
|
}));
|
|
11798
12585
|
};
|
|
11799
|
-
this._onSlotChange = () => {
|
|
11800
|
-
this._syncSelectedStateFromProperty();
|
|
11801
|
-
};
|
|
11802
12586
|
this._onKeyDown = (event) => {
|
|
11803
|
-
const
|
|
11804
|
-
|
|
12587
|
+
const allVisible = this._getAllVisibleItems();
|
|
12588
|
+
const currentElement = event.composedPath().find(target => target instanceof SidebarMenuItem || target instanceof SidebarSubMenu);
|
|
12589
|
+
if (!currentElement) {
|
|
11805
12590
|
return;
|
|
11806
|
-
|
|
11807
|
-
|
|
11808
|
-
return root?.activeElement !== null && root?.activeElement !== undefined;
|
|
11809
|
-
});
|
|
11810
|
-
if (focusedIndex === -1 && event.key !== 'Tab')
|
|
12591
|
+
}
|
|
12592
|
+
if (!allVisible.includes(currentElement)) {
|
|
11811
12593
|
return;
|
|
11812
|
-
|
|
11813
|
-
|
|
11814
|
-
|
|
11815
|
-
|
|
11816
|
-
|
|
11817
|
-
|
|
12594
|
+
}
|
|
12595
|
+
const currentIndex = allVisible.indexOf(currentElement);
|
|
12596
|
+
if (event.key === 'ArrowDown') {
|
|
12597
|
+
event.preventDefault();
|
|
12598
|
+
const nextIndex = (currentIndex + 1) % allVisible.length;
|
|
12599
|
+
allVisible[nextIndex].focus();
|
|
12600
|
+
}
|
|
12601
|
+
else if (event.key === 'ArrowUp') {
|
|
12602
|
+
event.preventDefault();
|
|
12603
|
+
const prevIndex = currentIndex === 0 ? allVisible.length - 1 : currentIndex - 1;
|
|
12604
|
+
allVisible[prevIndex].focus();
|
|
12605
|
+
}
|
|
12606
|
+
else if (event.key === 'Enter' || event.key === ' ') {
|
|
12607
|
+
event.preventDefault();
|
|
12608
|
+
currentElement.click();
|
|
12609
|
+
}
|
|
12610
|
+
else if (event.key === 'ArrowRight') {
|
|
12611
|
+
event.preventDefault();
|
|
12612
|
+
if (currentElement instanceof SidebarSubMenu && !currentElement.expanded) {
|
|
12613
|
+
currentElement.expanded = true;
|
|
11818
12614
|
}
|
|
11819
|
-
|
|
11820
|
-
|
|
11821
|
-
|
|
11822
|
-
|
|
11823
|
-
|
|
12615
|
+
else if (currentElement instanceof SidebarSubMenu) {
|
|
12616
|
+
const children = this._getChildNodes(currentElement);
|
|
12617
|
+
if (children.length > 0) {
|
|
12618
|
+
children[0].focus();
|
|
12619
|
+
}
|
|
12620
|
+
}
|
|
12621
|
+
}
|
|
12622
|
+
else if (event.key === 'ArrowLeft') {
|
|
12623
|
+
event.preventDefault();
|
|
12624
|
+
if (currentElement instanceof SidebarSubMenu && currentElement.expanded) {
|
|
12625
|
+
currentElement.expanded = false;
|
|
11824
12626
|
}
|
|
11825
|
-
case 'Home':
|
|
11826
|
-
event.preventDefault();
|
|
11827
|
-
visibleNodes[0]?.focus();
|
|
11828
|
-
break;
|
|
11829
|
-
case 'End':
|
|
11830
|
-
event.preventDefault();
|
|
11831
|
-
visibleNodes[visibleNodes.length - 1]?.focus();
|
|
11832
|
-
break;
|
|
11833
12627
|
}
|
|
11834
12628
|
};
|
|
11835
12629
|
}
|
|
11836
12630
|
connectedCallback() {
|
|
11837
12631
|
super.connectedCallback();
|
|
11838
|
-
this.addEventListener('
|
|
12632
|
+
this.addEventListener('sidebar-menu-item:click', this._onItemClick);
|
|
11839
12633
|
this.addEventListener('keydown', this._onKeyDown);
|
|
11840
12634
|
this.setAttribute('role', 'tree');
|
|
11841
12635
|
}
|
|
11842
12636
|
updated(changedProps) {
|
|
11843
12637
|
super.updated(changedProps);
|
|
11844
|
-
if (changedProps.has('
|
|
12638
|
+
if (changedProps.has('selectedItem')) {
|
|
11845
12639
|
this._syncSelectedStateFromProperty();
|
|
11846
12640
|
}
|
|
11847
12641
|
}
|
|
11848
12642
|
disconnectedCallback() {
|
|
11849
12643
|
super.disconnectedCallback();
|
|
11850
|
-
this.removeEventListener('
|
|
12644
|
+
this.removeEventListener('sidebar-menu-item:click', this._onItemClick);
|
|
11851
12645
|
this.removeEventListener('keydown', this._onKeyDown);
|
|
11852
12646
|
}
|
|
11853
|
-
|
|
11854
|
-
|
|
12647
|
+
_isSidebarNode(element) {
|
|
12648
|
+
const tag = element.tagName.toLowerCase();
|
|
12649
|
+
return tag === 'wc-sidebar-menu-item' || tag === 'wc-sidebar-sub-menu';
|
|
12650
|
+
}
|
|
12651
|
+
_getTopLevelItems() {
|
|
12652
|
+
return Array.from(this.children).filter(el => this._isSidebarNode(el));
|
|
12653
|
+
}
|
|
12654
|
+
_getChildNodes(item) {
|
|
12655
|
+
return Array.from(item.children).filter(child => this._isSidebarNode(child));
|
|
11855
12656
|
}
|
|
11856
|
-
|
|
12657
|
+
_getAllVisibleItems() {
|
|
11857
12658
|
const result = [];
|
|
11858
|
-
const collect = (
|
|
11859
|
-
|
|
11860
|
-
result.push(
|
|
11861
|
-
if (
|
|
11862
|
-
|
|
11863
|
-
collect(children);
|
|
12659
|
+
const collect = (items) => {
|
|
12660
|
+
items.forEach(item => {
|
|
12661
|
+
result.push(item);
|
|
12662
|
+
if (item instanceof SidebarSubMenu && item.expanded) {
|
|
12663
|
+
collect(this._getChildNodes(item));
|
|
11864
12664
|
}
|
|
11865
12665
|
});
|
|
11866
12666
|
};
|
|
11867
|
-
collect(this.
|
|
12667
|
+
collect(this._getTopLevelItems());
|
|
11868
12668
|
return result;
|
|
11869
12669
|
}
|
|
11870
12670
|
_updateSelectedState(selectedValue) {
|
|
11871
|
-
const
|
|
11872
|
-
|
|
11873
|
-
const
|
|
12671
|
+
const allItems = this._collectAllItems(this._getTopLevelItems());
|
|
12672
|
+
allItems.forEach(item => {
|
|
12673
|
+
const itemValue = item.value || item.label;
|
|
11874
12674
|
// eslint-disable-next-line no-param-reassign
|
|
11875
|
-
|
|
12675
|
+
item.selected = itemValue === selectedValue;
|
|
11876
12676
|
});
|
|
11877
12677
|
}
|
|
11878
|
-
|
|
11879
|
-
const
|
|
11880
|
-
|
|
11881
|
-
|
|
11882
|
-
|
|
12678
|
+
_collectAllItems(items) {
|
|
12679
|
+
const result = [];
|
|
12680
|
+
items.forEach(item => {
|
|
12681
|
+
result.push(item);
|
|
12682
|
+
if (item instanceof SidebarSubMenu) {
|
|
12683
|
+
result.push(...this._collectAllItems(this._getChildNodes(item)));
|
|
12684
|
+
}
|
|
11883
12685
|
});
|
|
12686
|
+
return result;
|
|
11884
12687
|
}
|
|
11885
12688
|
_syncSelectedStateFromProperty() {
|
|
11886
|
-
|
|
11887
|
-
|
|
11888
|
-
|
|
11889
|
-
|
|
11890
|
-
this._clearSelectedState();
|
|
11891
|
-
}
|
|
11892
|
-
_collectAllNodes(nodes) {
|
|
11893
|
-
const result = [];
|
|
11894
|
-
nodes.forEach(node => {
|
|
11895
|
-
result.push(node);
|
|
11896
|
-
const children = Array.from(node.children).filter(el => el.tagName.toLowerCase() === 'wc-tree-node');
|
|
11897
|
-
result.push(...this._collectAllNodes(children));
|
|
12689
|
+
const allItems = this._collectAllItems(this._getTopLevelItems());
|
|
12690
|
+
allItems.forEach(item => {
|
|
12691
|
+
const itemValue = item.value || item.label;
|
|
12692
|
+
item.selected = itemValue === this.selectedItem;
|
|
11898
12693
|
});
|
|
11899
|
-
return result;
|
|
11900
12694
|
}
|
|
11901
12695
|
render() {
|
|
11902
|
-
return b
|
|
11903
|
-
<slot @slotchange=${this._onSlotChange}></slot>
|
|
11904
|
-
</div>`;
|
|
12696
|
+
return b ` <div class="sidebar-menu"><slot></slot></div> `;
|
|
11905
12697
|
}
|
|
11906
12698
|
}
|
|
11907
|
-
|
|
11908
|
-
TreeView.Node = TreeNode;
|
|
12699
|
+
SidebarMenu.styles = [css_248z$5];
|
|
11909
12700
|
__decorate([
|
|
11910
|
-
n({ type: String, attribute: 'selected-
|
|
11911
|
-
],
|
|
12701
|
+
n({ type: String, attribute: 'selected-item', reflect: true })
|
|
12702
|
+
], SidebarMenu.prototype, "selectedItem", void 0);
|
|
11912
12703
|
|
|
11913
|
-
var css_248z$
|
|
12704
|
+
var css_248z$4 = i`* {
|
|
11914
12705
|
box-sizing: border-box;
|
|
11915
12706
|
}
|
|
11916
12707
|
|
|
@@ -11918,10 +12709,34 @@ var css_248z$2 = i`* {
|
|
|
11918
12709
|
display: none !important;
|
|
11919
12710
|
}
|
|
11920
12711
|
|
|
12712
|
+
@keyframes snackbar-enter {
|
|
12713
|
+
from {
|
|
12714
|
+
opacity: 0;
|
|
12715
|
+
transform: translateY(0.5rem);
|
|
12716
|
+
}
|
|
12717
|
+
to {
|
|
12718
|
+
opacity: 1;
|
|
12719
|
+
transform: translateY(0);
|
|
12720
|
+
}
|
|
12721
|
+
}
|
|
12722
|
+
@keyframes snackbar-exit {
|
|
12723
|
+
from {
|
|
12724
|
+
opacity: 1;
|
|
12725
|
+
transform: translateY(0);
|
|
12726
|
+
}
|
|
12727
|
+
to {
|
|
12728
|
+
opacity: 0;
|
|
12729
|
+
transform: translateY(0.5rem);
|
|
12730
|
+
}
|
|
12731
|
+
}
|
|
11921
12732
|
:host {
|
|
11922
|
-
display:
|
|
11923
|
-
|
|
11924
|
-
|
|
12733
|
+
display: flex;
|
|
12734
|
+
inset-block-end: calc(var(--snackbar-offset-bottom, 1rem) + env(safe-area-inset-bottom, 0px));
|
|
12735
|
+
inset-inline: var(--snackbar-offset-inline, 1rem);
|
|
12736
|
+
justify-content: center;
|
|
12737
|
+
pointer-events: none;
|
|
12738
|
+
position: fixed;
|
|
12739
|
+
z-index: var(--snackbar-z-index, 1000);
|
|
11925
12740
|
--snackbar-container-color: var(--color-inverse-surface);
|
|
11926
12741
|
--snackbar-label-text-color: var(--color-inverse-on-surface);
|
|
11927
12742
|
--snackbar-action-text-color: var(--color-inverse-primary);
|
|
@@ -11939,59 +12754,57 @@ var css_248z$2 = i`* {
|
|
|
11939
12754
|
background-color: var(--snackbar-container-color);
|
|
11940
12755
|
border-radius: var(--snackbar-border-radius);
|
|
11941
12756
|
color: var(--snackbar-label-text-color);
|
|
11942
|
-
display:
|
|
12757
|
+
display: none;
|
|
11943
12758
|
gap: var(--spacing-100);
|
|
12759
|
+
max-width: min(42rem, 100%);
|
|
12760
|
+
min-width: min(21.5rem, 100%);
|
|
11944
12761
|
min-height: 3rem;
|
|
11945
|
-
opacity: 0;
|
|
11946
12762
|
padding: var(--spacing-100) var(--spacing-200);
|
|
11947
12763
|
pointer-events: none;
|
|
11948
|
-
transform: translateY(0.5rem);
|
|
11949
|
-
transition: opacity var(--duration-short2) var(--easing-standard), transform var(--duration-short2) var(--easing-standard);
|
|
11950
12764
|
}
|
|
11951
12765
|
|
|
11952
12766
|
.snackbar.open {
|
|
11953
|
-
|
|
12767
|
+
animation: snackbar-enter var(--duration-medium1, 300ms) var(--easing-standard, cubic-bezier(0.2, 0, 0, 1)) both;
|
|
12768
|
+
display: inline-flex;
|
|
11954
12769
|
pointer-events: auto;
|
|
11955
|
-
|
|
12770
|
+
}
|
|
12771
|
+
|
|
12772
|
+
.snackbar.open.dismissing {
|
|
12773
|
+
animation: snackbar-exit var(--duration-short2, 150ms) var(--easing-standard, cubic-bezier(0.2, 0, 0, 1)) forwards;
|
|
12774
|
+
pointer-events: none;
|
|
11956
12775
|
}
|
|
11957
12776
|
|
|
11958
12777
|
.label {
|
|
11959
12778
|
flex: 1 1 auto;
|
|
11960
12779
|
color: inherit;
|
|
12780
|
+
min-height: 32px;
|
|
12781
|
+
align-items: center;
|
|
12782
|
+
display: flex;
|
|
11961
12783
|
}
|
|
11962
12784
|
|
|
11963
|
-
.action
|
|
11964
|
-
|
|
11965
|
-
font-family: var(--typography-label-large-font-family) !important;
|
|
11966
|
-
font-size: var(--typography-label-large-font-size) !important;
|
|
11967
|
-
font-weight: var(--typography-label-large-font-weight) !important;
|
|
11968
|
-
line-height: var(--typography-label-large-line-height) !important;
|
|
11969
|
-
letter-spacing: var(--typography-label-large-letter-spacing) !important;
|
|
11970
|
-
align-items: center;
|
|
11971
|
-
background: transparent;
|
|
11972
|
-
border: none;
|
|
11973
|
-
color: var(--snackbar-action-text-color);
|
|
11974
|
-
cursor: pointer;
|
|
11975
|
-
display: inline-flex;
|
|
11976
|
-
justify-content: center;
|
|
11977
|
-
margin: 0;
|
|
11978
|
-
min-height: 2rem;
|
|
11979
|
-
min-width: 2rem;
|
|
11980
|
-
padding: 0 var(--spacing-100);
|
|
12785
|
+
.action {
|
|
12786
|
+
--text-button-label-text-color: var(--snackbar-action-text-color);
|
|
11981
12787
|
}
|
|
11982
12788
|
|
|
11983
12789
|
.close {
|
|
11984
|
-
color: var(--snackbar-close-icon-color);
|
|
11985
|
-
padding: 0;
|
|
11986
|
-
}
|
|
11987
|
-
|
|
11988
|
-
.close wc-icon {
|
|
11989
|
-
--icon-size: 1.125rem;
|
|
11990
|
-
color: inherit;
|
|
12790
|
+
--text-button-label-text-color: var(--snackbar-close-icon-color);
|
|
11991
12791
|
}
|
|
11992
12792
|
|
|
11993
12793
|
.snackbar.multiline {
|
|
11994
12794
|
align-items: flex-start;
|
|
12795
|
+
}
|
|
12796
|
+
.snackbar.multiline .label {
|
|
12797
|
+
height: 100%;
|
|
12798
|
+
}
|
|
12799
|
+
|
|
12800
|
+
:host([preview]) {
|
|
12801
|
+
position: relative;
|
|
12802
|
+
inset-inline: unset;
|
|
12803
|
+
inset-block-end: unset;
|
|
12804
|
+
}
|
|
12805
|
+
:host([preview]) .snackbar {
|
|
12806
|
+
display: inline-flex;
|
|
12807
|
+
pointer-events: auto;
|
|
11995
12808
|
}`;
|
|
11996
12809
|
|
|
11997
12810
|
/**
|
|
@@ -12005,10 +12818,13 @@ var css_248z$2 = i`* {
|
|
|
12005
12818
|
* @cssprop --snackbar-action-text-color - Action text color.
|
|
12006
12819
|
* @cssprop --snackbar-close-icon-color - Close icon color.
|
|
12007
12820
|
* @cssprop --snackbar-border-radius - Border radius of the snackbar surface.
|
|
12821
|
+
* @cssprop --snackbar-offset-inline - Inline offset from viewport edges.
|
|
12822
|
+
* @cssprop --snackbar-offset-bottom - Bottom offset from viewport edge.
|
|
12823
|
+
* @cssprop --snackbar-z-index - Stacking order for the snackbar.
|
|
12008
12824
|
*
|
|
12009
12825
|
* @example
|
|
12010
12826
|
* ```html
|
|
12011
|
-
* <wc-snackbar
|
|
12827
|
+
* <wc-snackbar preview message="Message archived" action-label="Undo"></wc-snackbar>
|
|
12012
12828
|
* ```
|
|
12013
12829
|
* @tags display, feedback
|
|
12014
12830
|
*/
|
|
@@ -12021,25 +12837,54 @@ class Snackbar extends i$1 {
|
|
|
12021
12837
|
this.showCloseIcon = false;
|
|
12022
12838
|
this.duration = 4000;
|
|
12023
12839
|
this.multiline = false;
|
|
12840
|
+
this.preview = false;
|
|
12841
|
+
this.dismissing = false;
|
|
12024
12842
|
this.hideTimer = null;
|
|
12843
|
+
this.exitTimer = null;
|
|
12844
|
+
this.handleGlobalSnackbarOpen = (event) => {
|
|
12845
|
+
const { source } = event.detail;
|
|
12846
|
+
if (source && source !== this) {
|
|
12847
|
+
this.hide();
|
|
12848
|
+
}
|
|
12849
|
+
};
|
|
12850
|
+
}
|
|
12851
|
+
connectedCallback() {
|
|
12852
|
+
super.connectedCallback();
|
|
12853
|
+
document.addEventListener(Snackbar.GLOBAL_OPEN_EVENT, this.handleGlobalSnackbarOpen);
|
|
12025
12854
|
}
|
|
12026
12855
|
show() {
|
|
12027
|
-
this.
|
|
12856
|
+
this.dismissing = false;
|
|
12857
|
+
this.clearExitTimer();
|
|
12858
|
+
if (!this.open) {
|
|
12859
|
+
this.open = true;
|
|
12860
|
+
return;
|
|
12861
|
+
}
|
|
12862
|
+
this.scheduleAutoHide();
|
|
12028
12863
|
}
|
|
12029
12864
|
hide() {
|
|
12030
12865
|
this.close('programmatic');
|
|
12031
12866
|
}
|
|
12032
12867
|
close(reason) {
|
|
12033
|
-
if (!this.open) {
|
|
12868
|
+
if (!this.open || this.dismissing) {
|
|
12034
12869
|
return;
|
|
12035
12870
|
}
|
|
12036
|
-
this.
|
|
12871
|
+
this.clearTimer();
|
|
12872
|
+
this.dismissing = true;
|
|
12873
|
+
this.clearExitTimer();
|
|
12874
|
+
this.exitTimer = setTimeout(() => {
|
|
12875
|
+
this.completeDismiss();
|
|
12876
|
+
}, Snackbar.EXIT_ANIMATION_MS);
|
|
12037
12877
|
this.dispatchEvent(new CustomEvent('snackbar-close', {
|
|
12038
12878
|
detail: { reason },
|
|
12039
12879
|
bubbles: true,
|
|
12040
12880
|
composed: true,
|
|
12041
12881
|
}));
|
|
12042
12882
|
}
|
|
12883
|
+
completeDismiss() {
|
|
12884
|
+
this.clearExitTimer();
|
|
12885
|
+
this.dismissing = false;
|
|
12886
|
+
this.open = false;
|
|
12887
|
+
}
|
|
12043
12888
|
dispatchActionEvent() {
|
|
12044
12889
|
this.dispatchEvent(new CustomEvent('snackbar-action', {
|
|
12045
12890
|
bubbles: true,
|
|
@@ -12059,6 +12904,17 @@ class Snackbar extends i$1 {
|
|
|
12059
12904
|
this.hideTimer = null;
|
|
12060
12905
|
}
|
|
12061
12906
|
}
|
|
12907
|
+
clearExitTimer() {
|
|
12908
|
+
if (this.exitTimer !== null) {
|
|
12909
|
+
clearTimeout(this.exitTimer);
|
|
12910
|
+
this.exitTimer = null;
|
|
12911
|
+
}
|
|
12912
|
+
}
|
|
12913
|
+
handleAnimationEnd(event) {
|
|
12914
|
+
if (event.animationName === 'snackbar-exit' && this.dismissing) {
|
|
12915
|
+
this.completeDismiss();
|
|
12916
|
+
}
|
|
12917
|
+
}
|
|
12062
12918
|
scheduleAutoHide() {
|
|
12063
12919
|
this.clearTimer();
|
|
12064
12920
|
if (!this.open || this.duration <= 0) {
|
|
@@ -12070,10 +12926,17 @@ class Snackbar extends i$1 {
|
|
|
12070
12926
|
}
|
|
12071
12927
|
updated(changedProperties) {
|
|
12072
12928
|
if (changedProperties.has('open')) {
|
|
12929
|
+
if (this.open) {
|
|
12930
|
+
document.dispatchEvent(new CustomEvent(Snackbar.GLOBAL_OPEN_EVENT, {
|
|
12931
|
+
detail: { source: this },
|
|
12932
|
+
}));
|
|
12933
|
+
}
|
|
12073
12934
|
this.scheduleAutoHide();
|
|
12074
12935
|
}
|
|
12075
12936
|
}
|
|
12076
12937
|
disconnectedCallback() {
|
|
12938
|
+
document.removeEventListener(Snackbar.GLOBAL_OPEN_EVENT, this.handleGlobalSnackbarOpen);
|
|
12939
|
+
this.clearExitTimer();
|
|
12077
12940
|
this.clearTimer();
|
|
12078
12941
|
super.disconnectedCallback();
|
|
12079
12942
|
}
|
|
@@ -12083,37 +12946,43 @@ class Snackbar extends i$1 {
|
|
|
12083
12946
|
<div
|
|
12084
12947
|
class=${e$3({
|
|
12085
12948
|
snackbar: true,
|
|
12086
|
-
open: this.open,
|
|
12949
|
+
open: !this.preview && this.open,
|
|
12950
|
+
preview: this.preview,
|
|
12951
|
+
dismissing: this.dismissing,
|
|
12087
12952
|
multiline: this.multiline,
|
|
12088
12953
|
})}
|
|
12089
12954
|
role=${liveRole}
|
|
12090
12955
|
aria-live="polite"
|
|
12956
|
+
@animationend=${this.handleAnimationEnd}
|
|
12091
12957
|
>
|
|
12092
12958
|
<div class="label">
|
|
12093
12959
|
<slot>${this.message}</slot>
|
|
12094
12960
|
</div>
|
|
12095
12961
|
|
|
12096
12962
|
${this.actionLabel
|
|
12097
|
-
? b `<button class="action"
|
|
12963
|
+
? b `<wc-button class="action" variant='text' size='small' @click=${this.handleActionClick}>
|
|
12098
12964
|
${this.actionLabel}
|
|
12099
|
-
</button>`
|
|
12965
|
+
</wc-button>`
|
|
12100
12966
|
: A}
|
|
12101
12967
|
|
|
12102
12968
|
${this.showCloseIcon
|
|
12103
|
-
? b `<button
|
|
12969
|
+
? b `<wc-icon-button
|
|
12104
12970
|
class="close"
|
|
12105
|
-
|
|
12971
|
+
variant='text'
|
|
12972
|
+
size='small'
|
|
12106
12973
|
aria-label="Dismiss notification"
|
|
12107
12974
|
@click=${this.handleCloseClick}
|
|
12108
12975
|
>
|
|
12109
12976
|
<wc-icon name="close"></wc-icon>
|
|
12110
|
-
</button>`
|
|
12977
|
+
</wc-icon-button>`
|
|
12111
12978
|
: A}
|
|
12112
12979
|
</div>
|
|
12113
12980
|
`;
|
|
12114
12981
|
}
|
|
12115
12982
|
}
|
|
12116
|
-
Snackbar.styles = [css_248z$
|
|
12983
|
+
Snackbar.styles = [css_248z$4];
|
|
12984
|
+
Snackbar.GLOBAL_OPEN_EVENT = 'wc-snackbar-will-open';
|
|
12985
|
+
Snackbar.EXIT_ANIMATION_MS = 180;
|
|
12117
12986
|
__decorate([
|
|
12118
12987
|
n({ type: Boolean, reflect: true })
|
|
12119
12988
|
], Snackbar.prototype, "open", void 0);
|
|
@@ -12132,8 +13001,14 @@ __decorate([
|
|
|
12132
13001
|
__decorate([
|
|
12133
13002
|
n({ type: Boolean, reflect: true })
|
|
12134
13003
|
], Snackbar.prototype, "multiline", void 0);
|
|
13004
|
+
__decorate([
|
|
13005
|
+
n({ type: Boolean, reflect: true })
|
|
13006
|
+
], Snackbar.prototype, "preview", void 0);
|
|
13007
|
+
__decorate([
|
|
13008
|
+
r()
|
|
13009
|
+
], Snackbar.prototype, "dismissing", void 0);
|
|
12135
13010
|
|
|
12136
|
-
var css_248z$
|
|
13011
|
+
var css_248z$3 = i`* {
|
|
12137
13012
|
box-sizing: border-box;
|
|
12138
13013
|
}
|
|
12139
13014
|
|
|
@@ -12542,7 +13417,7 @@ class Radio extends i$1 {
|
|
|
12542
13417
|
}
|
|
12543
13418
|
Radio.DIRECTION_NEXT = 1;
|
|
12544
13419
|
Radio.DIRECTION_PREVIOUS = -1;
|
|
12545
|
-
Radio.styles = [css_248z$
|
|
13420
|
+
Radio.styles = [css_248z$3];
|
|
12546
13421
|
__decorate([
|
|
12547
13422
|
n({ type: String })
|
|
12548
13423
|
], Radio.prototype, "name", void 0);
|
|
@@ -12586,7 +13461,7 @@ __decorate([
|
|
|
12586
13461
|
e$4('.input-native')
|
|
12587
13462
|
], Radio.prototype, "nativeElement", void 0);
|
|
12588
13463
|
|
|
12589
|
-
var css_248z = i`@charset "UTF-8";
|
|
13464
|
+
var css_248z$2 = i`@charset "UTF-8";
|
|
12590
13465
|
* {
|
|
12591
13466
|
box-sizing: border-box;
|
|
12592
13467
|
}
|
|
@@ -12675,6 +13550,11 @@ var css_248z = i`@charset "UTF-8";
|
|
|
12675
13550
|
gap: var(--spacing-050);
|
|
12676
13551
|
}
|
|
12677
13552
|
|
|
13553
|
+
.select-empty-state {
|
|
13554
|
+
display: block;
|
|
13555
|
+
inline-size: min(22rem, 100%);
|
|
13556
|
+
}
|
|
13557
|
+
|
|
12678
13558
|
/* Dropdown chevron icon */
|
|
12679
13559
|
.dropdown-icon {
|
|
12680
13560
|
--icon-size: 1.5rem;
|
|
@@ -12788,7 +13668,7 @@ class SelectOptionElement extends i$1 {
|
|
|
12788
13668
|
${this.icon
|
|
12789
13669
|
? b `<wc-icon name=${this.icon} slot="leading-icon"></wc-icon>`
|
|
12790
13670
|
: A}
|
|
12791
|
-
<slot
|
|
13671
|
+
<slot>${this.value === '' ? 'None' : ''}</slot>
|
|
12792
13672
|
${this.selected && this.keepOpen
|
|
12793
13673
|
? b `<wc-icon
|
|
12794
13674
|
name="check"
|
|
@@ -12857,6 +13737,7 @@ __decorate([
|
|
|
12857
13737
|
class Select extends BaseInput {
|
|
12858
13738
|
constructor() {
|
|
12859
13739
|
super(...arguments);
|
|
13740
|
+
this._menuId = `wc-select-menu-${Math.random().toString(36).slice(2, 9)}`;
|
|
12860
13741
|
/**
|
|
12861
13742
|
* Array of options to display in the dropdown.
|
|
12862
13743
|
* Setting this property creates matching `<wc-option>` children automatically.
|
|
@@ -12884,10 +13765,6 @@ class Select extends BaseInput {
|
|
|
12884
13765
|
* Label displayed above the field.
|
|
12885
13766
|
*/
|
|
12886
13767
|
this.label = '';
|
|
12887
|
-
/**
|
|
12888
|
-
* Show a clear button in single-select mode when a value is selected.
|
|
12889
|
-
*/
|
|
12890
|
-
this.clearable = false;
|
|
12891
13768
|
/**
|
|
12892
13769
|
* Visual variant of the field.
|
|
12893
13770
|
*/
|
|
@@ -12935,7 +13812,7 @@ class Select extends BaseInput {
|
|
|
12935
13812
|
el.value = opt.value;
|
|
12936
13813
|
if (opt.icon)
|
|
12937
13814
|
el.icon = opt.icon;
|
|
12938
|
-
el.textContent = opt.label;
|
|
13815
|
+
el.textContent = opt.label || (opt.value === '' ? 'None' : '');
|
|
12939
13816
|
el.dataset.generated = '';
|
|
12940
13817
|
this.appendChild(el);
|
|
12941
13818
|
}
|
|
@@ -12956,14 +13833,14 @@ class Select extends BaseInput {
|
|
|
12956
13833
|
const label = opt.textContent?.trim() ?? '';
|
|
12957
13834
|
opt.filtered = !label.toLowerCase().includes(q);
|
|
12958
13835
|
if (!opt.filtered)
|
|
12959
|
-
visibleCount
|
|
13836
|
+
visibleCount += 1;
|
|
12960
13837
|
}
|
|
12961
13838
|
else {
|
|
12962
13839
|
opt.filtered = false;
|
|
12963
|
-
visibleCount
|
|
13840
|
+
visibleCount += 1;
|
|
12964
13841
|
}
|
|
12965
13842
|
}
|
|
12966
|
-
this._noOptionsVisible =
|
|
13843
|
+
this._noOptionsVisible = visibleCount === 0;
|
|
12967
13844
|
}
|
|
12968
13845
|
// ── Helpers ────────────────────────────────────────────────────────────────
|
|
12969
13846
|
get _selectedValues() {
|
|
@@ -12975,16 +13852,26 @@ class Select extends BaseInput {
|
|
|
12975
13852
|
.filter(Boolean);
|
|
12976
13853
|
}
|
|
12977
13854
|
_isSelected(value) {
|
|
13855
|
+
if (!this.multiple) {
|
|
13856
|
+
return this.value === value;
|
|
13857
|
+
}
|
|
12978
13858
|
return this._selectedValues.includes(value);
|
|
12979
13859
|
}
|
|
12980
13860
|
/** Returns the display label for a given option value. */
|
|
12981
13861
|
_getLabelForValue(val) {
|
|
12982
13862
|
for (const opt of this.querySelectorAll('wc-option')) {
|
|
12983
|
-
if (opt.value === val)
|
|
12984
|
-
|
|
13863
|
+
if (opt.value === val) {
|
|
13864
|
+
const label = opt.textContent?.trim();
|
|
13865
|
+
if (label)
|
|
13866
|
+
return label;
|
|
13867
|
+
return val === '' ? 'None' : val;
|
|
13868
|
+
}
|
|
12985
13869
|
}
|
|
12986
13870
|
// Fallback to options array (before wc-option children are created)
|
|
12987
|
-
|
|
13871
|
+
const programmaticLabel = this.options.find(o => o.value === val)?.label;
|
|
13872
|
+
if (programmaticLabel)
|
|
13873
|
+
return programmaticLabel;
|
|
13874
|
+
return val === '' ? 'None' : val;
|
|
12988
13875
|
}
|
|
12989
13876
|
get _displayLabel() {
|
|
12990
13877
|
if (!this.value)
|
|
@@ -13003,9 +13890,17 @@ class Select extends BaseInput {
|
|
|
13003
13890
|
return;
|
|
13004
13891
|
this._open = true;
|
|
13005
13892
|
this._focused = true;
|
|
13893
|
+
this._triggerEl?.focus();
|
|
13006
13894
|
const menu = this._menu;
|
|
13007
13895
|
if (menu && this._triggerEl) {
|
|
13008
13896
|
menu.anchorElement = this._triggerEl;
|
|
13897
|
+
const triggerWidth = this._triggerEl.getBoundingClientRect().width;
|
|
13898
|
+
if (triggerWidth < 240) {
|
|
13899
|
+
menu.style.setProperty('--menu-width', '240px');
|
|
13900
|
+
}
|
|
13901
|
+
else {
|
|
13902
|
+
menu.style.setProperty('--menu-width', `${Math.ceil(triggerWidth)}px`);
|
|
13903
|
+
}
|
|
13009
13904
|
menu.show();
|
|
13010
13905
|
}
|
|
13011
13906
|
if (this.search) {
|
|
@@ -13029,6 +13924,7 @@ class Select extends BaseInput {
|
|
|
13029
13924
|
}
|
|
13030
13925
|
// ── Event handlers ─────────────────────────────────────────────────────────
|
|
13031
13926
|
_handleTriggerClick(event) {
|
|
13927
|
+
event.stopPropagation();
|
|
13032
13928
|
// Ignore clicks that originated inside the search input — those should not
|
|
13033
13929
|
// toggle the menu (the input needs to stay open so the user can type).
|
|
13034
13930
|
if (event.target instanceof HTMLInputElement) {
|
|
@@ -13041,6 +13937,22 @@ class Select extends BaseInput {
|
|
|
13041
13937
|
this._openMenu();
|
|
13042
13938
|
}
|
|
13043
13939
|
}
|
|
13940
|
+
_handleFieldClick(event) {
|
|
13941
|
+
const eventPath = event.composedPath();
|
|
13942
|
+
if (eventPath.includes(this._triggerEl) ||
|
|
13943
|
+
eventPath.some(target => target instanceof HTMLInputElement ||
|
|
13944
|
+
(target instanceof HTMLElement &&
|
|
13945
|
+
(target.closest('.clear-btn') != null ||
|
|
13946
|
+
target.matches('wc-icon-button'))))) {
|
|
13947
|
+
return;
|
|
13948
|
+
}
|
|
13949
|
+
if (this._open) {
|
|
13950
|
+
this._closeMenu();
|
|
13951
|
+
}
|
|
13952
|
+
else {
|
|
13953
|
+
this._openMenu();
|
|
13954
|
+
}
|
|
13955
|
+
}
|
|
13044
13956
|
_handleTriggerKeyDown(event) {
|
|
13045
13957
|
// When the typeahead search input is active, let the input handle its own
|
|
13046
13958
|
// keys (Space, Enter, etc.). Only intercept Escape to close the menu.
|
|
@@ -13077,9 +13989,11 @@ class Select extends BaseInput {
|
|
|
13077
13989
|
if (!item)
|
|
13078
13990
|
return;
|
|
13079
13991
|
const val = item.value;
|
|
13080
|
-
if (
|
|
13992
|
+
if (val === undefined)
|
|
13081
13993
|
return;
|
|
13082
13994
|
if (this.multiple) {
|
|
13995
|
+
if (val === '')
|
|
13996
|
+
return;
|
|
13083
13997
|
const values = this._selectedValues;
|
|
13084
13998
|
const idx = values.indexOf(val);
|
|
13085
13999
|
if (idx >= 0) {
|
|
@@ -13113,17 +14027,25 @@ class Select extends BaseInput {
|
|
|
13113
14027
|
}));
|
|
13114
14028
|
}
|
|
13115
14029
|
}
|
|
13116
|
-
_handleClear(event) {
|
|
13117
|
-
event.stopPropagation();
|
|
13118
|
-
this.value = '';
|
|
13119
|
-
this._dispatchChange();
|
|
13120
|
-
}
|
|
13121
14030
|
_handleChipDismiss(event, chipValue) {
|
|
13122
14031
|
event.stopPropagation();
|
|
13123
14032
|
const values = this._selectedValues.filter(v => v !== chipValue);
|
|
13124
14033
|
this.value = values.join(',');
|
|
13125
14034
|
this._dispatchChange();
|
|
13126
14035
|
}
|
|
14036
|
+
_renderEmptyState() {
|
|
14037
|
+
const hasSearchQuery = this._searchQuery.trim().length > 0;
|
|
14038
|
+
return b `
|
|
14039
|
+
<wc-empty-state
|
|
14040
|
+
class="select-empty-state content-center"
|
|
14041
|
+
illustration="no-document"
|
|
14042
|
+
headline=${hasSearchQuery ? 'No results found' : 'No options available'}
|
|
14043
|
+
description=${hasSearchQuery
|
|
14044
|
+
? 'Try a different search term.'
|
|
14045
|
+
: 'There is nothing to select right now.'}
|
|
14046
|
+
></wc-empty-state>
|
|
14047
|
+
`;
|
|
14048
|
+
}
|
|
13127
14049
|
// ── Render helpers ─────────────────────────────────────────────────────────
|
|
13128
14050
|
_renderTriggerContent() {
|
|
13129
14051
|
// Typeahead: when open, show a text input for filtering
|
|
@@ -13156,21 +14078,7 @@ class Select extends BaseInput {
|
|
|
13156
14078
|
return b `<span class="display-value">${label}</span>`;
|
|
13157
14079
|
}
|
|
13158
14080
|
_renderFieldEnd() {
|
|
13159
|
-
const showClear = this.clearable &&
|
|
13160
|
-
!this.multiple &&
|
|
13161
|
-
!!this.value &&
|
|
13162
|
-
!this.disabled &&
|
|
13163
|
-
!this.readonly;
|
|
13164
14081
|
return b `
|
|
13165
|
-
${showClear
|
|
13166
|
-
? b `<wc-icon-button
|
|
13167
|
-
class="clear-btn"
|
|
13168
|
-
variant="text"
|
|
13169
|
-
size="sm"
|
|
13170
|
-
name="close"
|
|
13171
|
-
@click=${this._handleClear}
|
|
13172
|
-
></wc-icon-button>`
|
|
13173
|
-
: A}
|
|
13174
14082
|
<wc-icon
|
|
13175
14083
|
class=${e$3({
|
|
13176
14084
|
'dropdown-icon': true,
|
|
@@ -13198,11 +14106,14 @@ class Select extends BaseInput {
|
|
|
13198
14106
|
?focused=${this._focused}
|
|
13199
14107
|
.host=${this}
|
|
13200
14108
|
class="select-field"
|
|
14109
|
+
@click=${this._handleFieldClick}
|
|
13201
14110
|
>
|
|
13202
14111
|
<div
|
|
13203
14112
|
class="select-trigger"
|
|
13204
14113
|
tabindex=${this.disabled ? -1 : 0}
|
|
13205
14114
|
role="combobox"
|
|
14115
|
+
aria-label=${this.label || this.placeholder || 'Select option'}
|
|
14116
|
+
aria-controls=${this._menuId}
|
|
13206
14117
|
aria-expanded=${String(this._open)}
|
|
13207
14118
|
aria-haspopup="listbox"
|
|
13208
14119
|
@click=${this._handleTriggerClick}
|
|
@@ -13217,20 +14128,19 @@ class Select extends BaseInput {
|
|
|
13217
14128
|
</wc-field>
|
|
13218
14129
|
|
|
13219
14130
|
<wc-menu
|
|
14131
|
+
id=${this._menuId}
|
|
13220
14132
|
placement="bottom-start"
|
|
13221
14133
|
aria-label=${this.label || 'Options'}
|
|
13222
14134
|
@closed=${this._handleMenuClosed}
|
|
13223
14135
|
@menu-item-activate=${(e) => this._handleMenuItemActivate(e)}
|
|
13224
14136
|
>
|
|
13225
14137
|
<slot></slot>
|
|
13226
|
-
${this._noOptionsVisible
|
|
13227
|
-
? b `<wc-menu-item disabled>No options</wc-menu-item>`
|
|
13228
|
-
: A}
|
|
14138
|
+
${this._noOptionsVisible ? this._renderEmptyState() : A}
|
|
13229
14139
|
</wc-menu>
|
|
13230
14140
|
`;
|
|
13231
14141
|
}
|
|
13232
14142
|
}
|
|
13233
|
-
Select.styles = [css_248z];
|
|
14143
|
+
Select.styles = [css_248z$2];
|
|
13234
14144
|
__decorate([
|
|
13235
14145
|
n({ type: Array })
|
|
13236
14146
|
], Select.prototype, "options", void 0);
|
|
@@ -13249,9 +14159,6 @@ __decorate([
|
|
|
13249
14159
|
__decorate([
|
|
13250
14160
|
n({ type: String })
|
|
13251
14161
|
], Select.prototype, "label", void 0);
|
|
13252
|
-
__decorate([
|
|
13253
|
-
n({ type: Boolean })
|
|
13254
|
-
], Select.prototype, "clearable", void 0);
|
|
13255
14162
|
__decorate([
|
|
13256
14163
|
n({ type: String })
|
|
13257
14164
|
], Select.prototype, "variant", void 0);
|
|
@@ -13289,5 +14196,626 @@ __decorate([
|
|
|
13289
14196
|
e$4('.search-input')
|
|
13290
14197
|
], Select.prototype, "_searchInputEl", void 0);
|
|
13291
14198
|
|
|
13292
|
-
|
|
13293
|
-
|
|
14199
|
+
var css_248z$1 = i`* {
|
|
14200
|
+
box-sizing: border-box;
|
|
14201
|
+
}
|
|
14202
|
+
|
|
14203
|
+
.screen-reader-only {
|
|
14204
|
+
display: none !important;
|
|
14205
|
+
}
|
|
14206
|
+
|
|
14207
|
+
:host {
|
|
14208
|
+
display: block;
|
|
14209
|
+
height: 100%;
|
|
14210
|
+
width: var(--nav-rail-width, 5rem); /* 80dp */
|
|
14211
|
+
overflow: hidden;
|
|
14212
|
+
}
|
|
14213
|
+
|
|
14214
|
+
.rail {
|
|
14215
|
+
display: flex;
|
|
14216
|
+
flex-direction: column;
|
|
14217
|
+
align-items: center;
|
|
14218
|
+
height: 100%;
|
|
14219
|
+
width: 100%;
|
|
14220
|
+
border-radius: inherit;
|
|
14221
|
+
background-color: var(--nav-rail-container-color, var(--color-surface));
|
|
14222
|
+
padding-block: var(--nav-rail-padding-block, 0.75rem); /* 12dp */
|
|
14223
|
+
box-sizing: border-box;
|
|
14224
|
+
}
|
|
14225
|
+
.rail .header {
|
|
14226
|
+
display: flex;
|
|
14227
|
+
flex-direction: column;
|
|
14228
|
+
align-items: center;
|
|
14229
|
+
width: 100%;
|
|
14230
|
+
flex-shrink: 0;
|
|
14231
|
+
}
|
|
14232
|
+
.rail .header:empty {
|
|
14233
|
+
display: none;
|
|
14234
|
+
}
|
|
14235
|
+
.rail wc-divider {
|
|
14236
|
+
width: calc(100% - 1rem);
|
|
14237
|
+
margin-block: 0.5rem;
|
|
14238
|
+
flex-shrink: 0;
|
|
14239
|
+
}
|
|
14240
|
+
.rail .items {
|
|
14241
|
+
display: flex;
|
|
14242
|
+
flex-direction: column;
|
|
14243
|
+
align-items: center;
|
|
14244
|
+
width: 100%;
|
|
14245
|
+
gap: 0.75rem; /* 12dp between items */
|
|
14246
|
+
flex: 1;
|
|
14247
|
+
}
|
|
14248
|
+
.rail .items ::slotted(wc-navigation-rail-item) {
|
|
14249
|
+
width: 100%;
|
|
14250
|
+
}
|
|
14251
|
+
.rail {
|
|
14252
|
+
/* Alignment variants */
|
|
14253
|
+
}
|
|
14254
|
+
.rail.align-top .items {
|
|
14255
|
+
justify-content: flex-start;
|
|
14256
|
+
}
|
|
14257
|
+
.rail.align-center .items {
|
|
14258
|
+
justify-content: center;
|
|
14259
|
+
}
|
|
14260
|
+
.rail.align-bottom .items {
|
|
14261
|
+
justify-content: flex-end;
|
|
14262
|
+
}`;
|
|
14263
|
+
|
|
14264
|
+
var css_248z = i`* {
|
|
14265
|
+
box-sizing: border-box;
|
|
14266
|
+
}
|
|
14267
|
+
|
|
14268
|
+
.screen-reader-only {
|
|
14269
|
+
display: none !important;
|
|
14270
|
+
}
|
|
14271
|
+
|
|
14272
|
+
:host {
|
|
14273
|
+
display: block;
|
|
14274
|
+
}
|
|
14275
|
+
|
|
14276
|
+
/* Reset native button/link styles */
|
|
14277
|
+
.item-element {
|
|
14278
|
+
background: transparent;
|
|
14279
|
+
border: none;
|
|
14280
|
+
appearance: none;
|
|
14281
|
+
margin: 0;
|
|
14282
|
+
outline: none;
|
|
14283
|
+
text-decoration: none;
|
|
14284
|
+
text-align: unset;
|
|
14285
|
+
color: inherit;
|
|
14286
|
+
}
|
|
14287
|
+
|
|
14288
|
+
.item {
|
|
14289
|
+
position: relative;
|
|
14290
|
+
display: flex;
|
|
14291
|
+
flex-direction: column;
|
|
14292
|
+
align-items: center;
|
|
14293
|
+
justify-content: center;
|
|
14294
|
+
width: 100%;
|
|
14295
|
+
min-height: 3.5rem; /* 56dp */
|
|
14296
|
+
padding-block: 0.25rem; /* 4dp vertical padding */
|
|
14297
|
+
cursor: pointer;
|
|
14298
|
+
gap: 0.25rem; /* 4dp gap between indicator and label */
|
|
14299
|
+
box-sizing: border-box;
|
|
14300
|
+
/* Color tokens */
|
|
14301
|
+
--_inactive-icon-color: var(--nav-rail-inactive-icon-color, var(--color-on-surface-variant));
|
|
14302
|
+
--_active-icon-color: var(--nav-rail-active-icon-color, var(--color-on-secondary-container));
|
|
14303
|
+
--_inactive-label-color: var(--nav-rail-inactive-label-color, var(--color-on-surface-variant));
|
|
14304
|
+
--_active-label-color: var(--nav-rail-active-label-color, var(--color-on-surface));
|
|
14305
|
+
--_indicator-color: var(--nav-rail-indicator-color, var(--color-secondary-container));
|
|
14306
|
+
--_indicator-shape: var(--nav-rail-indicator-shape, var(--shape-corner-full));
|
|
14307
|
+
--_indicator-width: var(--nav-rail-indicator-width, 3.5rem); /* 56dp */
|
|
14308
|
+
--_indicator-height: var(--nav-rail-indicator-height, 2rem); /* 32dp */
|
|
14309
|
+
--_state-color: var(--_inactive-icon-color);
|
|
14310
|
+
/* Focus ring */
|
|
14311
|
+
}
|
|
14312
|
+
.item .focus-ring {
|
|
14313
|
+
z-index: 3;
|
|
14314
|
+
--focus-ring-container-shape-start-start: var(--shape-corner-small);
|
|
14315
|
+
--focus-ring-container-shape-start-end: var(--shape-corner-small);
|
|
14316
|
+
--focus-ring-container-shape-end-start: var(--shape-corner-small);
|
|
14317
|
+
--focus-ring-container-shape-end-end: var(--shape-corner-small);
|
|
14318
|
+
}
|
|
14319
|
+
.item {
|
|
14320
|
+
/* Active indicator (pill behind icon) */
|
|
14321
|
+
}
|
|
14322
|
+
.item .indicator {
|
|
14323
|
+
position: relative;
|
|
14324
|
+
display: flex;
|
|
14325
|
+
align-items: center;
|
|
14326
|
+
justify-content: center;
|
|
14327
|
+
width: var(--_indicator-width);
|
|
14328
|
+
height: var(--_indicator-height);
|
|
14329
|
+
border-radius: var(--_indicator-shape);
|
|
14330
|
+
overflow: hidden;
|
|
14331
|
+
flex-shrink: 0;
|
|
14332
|
+
transition: background-color var(--duration-short4, 200ms) var(--easing-standard, ease);
|
|
14333
|
+
}
|
|
14334
|
+
.item .indicator .icon-container {
|
|
14335
|
+
display: flex;
|
|
14336
|
+
align-items: center;
|
|
14337
|
+
justify-content: center;
|
|
14338
|
+
z-index: 1;
|
|
14339
|
+
position: relative;
|
|
14340
|
+
pointer-events: none;
|
|
14341
|
+
}
|
|
14342
|
+
.item .indicator .icon-container ::slotted(*) {
|
|
14343
|
+
--icon-size: 1.5rem; /* 24dp */
|
|
14344
|
+
--icon-color: var(--_inactive-icon-color);
|
|
14345
|
+
color: var(--_inactive-icon-color);
|
|
14346
|
+
display: flex;
|
|
14347
|
+
}
|
|
14348
|
+
.item {
|
|
14349
|
+
/* State layer for hover/press */
|
|
14350
|
+
}
|
|
14351
|
+
.item .state-layer {
|
|
14352
|
+
position: absolute;
|
|
14353
|
+
top: 0.25rem;
|
|
14354
|
+
left: 50%;
|
|
14355
|
+
transform: translateX(-50%);
|
|
14356
|
+
width: var(--_indicator-width);
|
|
14357
|
+
height: var(--_indicator-height);
|
|
14358
|
+
pointer-events: none;
|
|
14359
|
+
background-color: var(--_state-color);
|
|
14360
|
+
opacity: 0;
|
|
14361
|
+
z-index: 0;
|
|
14362
|
+
border-radius: var(--_indicator-shape);
|
|
14363
|
+
transition: opacity var(--duration-short4, 200ms) var(--easing-standard, ease);
|
|
14364
|
+
}
|
|
14365
|
+
.item .ripple {
|
|
14366
|
+
z-index: 1;
|
|
14367
|
+
--ripple-pressed-color: var(--_state-color);
|
|
14368
|
+
--ripple-state-opacity: 0;
|
|
14369
|
+
border-radius: var(--shape-corner-small, 4px);
|
|
14370
|
+
}
|
|
14371
|
+
.item {
|
|
14372
|
+
/* Label */
|
|
14373
|
+
}
|
|
14374
|
+
.item .label {
|
|
14375
|
+
font-family: var(--typography-label-medium-font-family) !important;
|
|
14376
|
+
font-size: var(--typography-label-medium-font-size) !important;
|
|
14377
|
+
font-weight: var(--typography-label-medium-font-weight) !important;
|
|
14378
|
+
line-height: var(--typography-label-medium-line-height) !important;
|
|
14379
|
+
letter-spacing: var(--typography-label-medium-letter-spacing) !important;
|
|
14380
|
+
color: var(--_inactive-label-color);
|
|
14381
|
+
text-align: center;
|
|
14382
|
+
pointer-events: none;
|
|
14383
|
+
z-index: 1;
|
|
14384
|
+
transition: color var(--duration-short4, 200ms) var(--easing-standard, ease), font-weight var(--duration-short4, 200ms) var(--easing-standard, ease);
|
|
14385
|
+
}
|
|
14386
|
+
.item {
|
|
14387
|
+
/* Active icon slot: hidden by default */
|
|
14388
|
+
}
|
|
14389
|
+
.item .active-icon-slot {
|
|
14390
|
+
display: none;
|
|
14391
|
+
}
|
|
14392
|
+
.item .hidden-slot {
|
|
14393
|
+
display: none;
|
|
14394
|
+
}
|
|
14395
|
+
.item {
|
|
14396
|
+
/* Item content layout */
|
|
14397
|
+
}
|
|
14398
|
+
.item .item-content {
|
|
14399
|
+
display: flex;
|
|
14400
|
+
flex-direction: column;
|
|
14401
|
+
align-items: center;
|
|
14402
|
+
gap: 0.25rem;
|
|
14403
|
+
width: 100%;
|
|
14404
|
+
z-index: 1;
|
|
14405
|
+
}
|
|
14406
|
+
.item {
|
|
14407
|
+
/* Active state */
|
|
14408
|
+
}
|
|
14409
|
+
.item.active {
|
|
14410
|
+
--_state-color: var(--_active-icon-color);
|
|
14411
|
+
}
|
|
14412
|
+
.item.active .indicator {
|
|
14413
|
+
background-color: var(--_indicator-color);
|
|
14414
|
+
}
|
|
14415
|
+
.item.active .indicator .icon-container ::slotted(*) {
|
|
14416
|
+
--icon-color: var(--_active-icon-color);
|
|
14417
|
+
color: var(--_active-icon-color);
|
|
14418
|
+
}
|
|
14419
|
+
.item.active .label {
|
|
14420
|
+
color: var(--_active-label-color);
|
|
14421
|
+
font-weight: var(--typography-label-medium-font-weight-bold, 700);
|
|
14422
|
+
}
|
|
14423
|
+
.item {
|
|
14424
|
+
/* Active icon slot: show when active and slot has content */
|
|
14425
|
+
}
|
|
14426
|
+
.item.active.has-active-icon .active-icon-slot {
|
|
14427
|
+
display: flex;
|
|
14428
|
+
}
|
|
14429
|
+
.item.active.has-active-icon .icon-slot {
|
|
14430
|
+
display: none;
|
|
14431
|
+
}
|
|
14432
|
+
.item {
|
|
14433
|
+
/* Hover state */
|
|
14434
|
+
}
|
|
14435
|
+
.item:hover:not(.disabled) .state-layer {
|
|
14436
|
+
opacity: 0.08;
|
|
14437
|
+
}
|
|
14438
|
+
.item {
|
|
14439
|
+
/* Pressed state */
|
|
14440
|
+
}
|
|
14441
|
+
.item.pressed:not(.disabled) .state-layer {
|
|
14442
|
+
opacity: 0.12;
|
|
14443
|
+
}
|
|
14444
|
+
.item {
|
|
14445
|
+
/* Disabled state */
|
|
14446
|
+
}
|
|
14447
|
+
.item.disabled {
|
|
14448
|
+
cursor: not-allowed;
|
|
14449
|
+
}
|
|
14450
|
+
.item.disabled .indicator .icon-container ::slotted(*) {
|
|
14451
|
+
--icon-color: var(--color-on-surface);
|
|
14452
|
+
color: var(--color-on-surface);
|
|
14453
|
+
opacity: 0.38;
|
|
14454
|
+
}
|
|
14455
|
+
.item.disabled .label {
|
|
14456
|
+
color: var(--color-on-surface);
|
|
14457
|
+
opacity: 0.38;
|
|
14458
|
+
}
|
|
14459
|
+
.item.disabled .ripple {
|
|
14460
|
+
display: none;
|
|
14461
|
+
}
|
|
14462
|
+
|
|
14463
|
+
@media (prefers-reduced-motion: reduce) {
|
|
14464
|
+
.item .indicator,
|
|
14465
|
+
.item .state-layer,
|
|
14466
|
+
.item .label {
|
|
14467
|
+
transition: none;
|
|
14468
|
+
}
|
|
14469
|
+
}`;
|
|
14470
|
+
|
|
14471
|
+
var _NavigationRailItem_id;
|
|
14472
|
+
/**
|
|
14473
|
+
* @label Navigation Rail Item
|
|
14474
|
+
* @tag wc-navigation-rail-item
|
|
14475
|
+
* @rawTag navigation-rail-item
|
|
14476
|
+
* @parentRawTag navigation-rail
|
|
14477
|
+
*
|
|
14478
|
+
* @summary An individual item within a navigation rail.
|
|
14479
|
+
* @overview
|
|
14480
|
+
* <p>Navigation rail items display a destination with an icon and optional label.</p>
|
|
14481
|
+
*
|
|
14482
|
+
* @example
|
|
14483
|
+
* ```html
|
|
14484
|
+
* <wc-navigation-rail-item>
|
|
14485
|
+
* <wc-icon slot="icon">home</wc-icon>
|
|
14486
|
+
* Home
|
|
14487
|
+
* </wc-navigation-rail-item>
|
|
14488
|
+
* ```
|
|
14489
|
+
* @tags navigation
|
|
14490
|
+
*/
|
|
14491
|
+
class NavigationRailItem extends i$1 {
|
|
14492
|
+
constructor() {
|
|
14493
|
+
super(...arguments);
|
|
14494
|
+
_NavigationRailItem_id.set(this, crypto.randomUUID());
|
|
14495
|
+
/** Whether this item is currently active/selected. */
|
|
14496
|
+
this.active = false;
|
|
14497
|
+
/** Whether this item is disabled. */
|
|
14498
|
+
this.disabled = false;
|
|
14499
|
+
/** Whether the parent rail is in collapsed mode (labels hidden). */
|
|
14500
|
+
this.collapsed = false;
|
|
14501
|
+
/** Link target. */
|
|
14502
|
+
this.target = '_self';
|
|
14503
|
+
/** Reason the item is disabled (shown to screen readers). */
|
|
14504
|
+
this.disabledReason = '';
|
|
14505
|
+
/** Sets the delay for throttle in milliseconds. Defaults to 200 milliseconds. */
|
|
14506
|
+
this.throttleDelay = 200;
|
|
14507
|
+
this._isPressed = false;
|
|
14508
|
+
this._hasLabel = false;
|
|
14509
|
+
this._hasActiveIcon = false;
|
|
14510
|
+
this.__dispatchClickWithThrottle = event => {
|
|
14511
|
+
this.__dispatchClick(event);
|
|
14512
|
+
};
|
|
14513
|
+
this.__dispatchClick = (event) => {
|
|
14514
|
+
if (this.disabled && this.href) {
|
|
14515
|
+
event.stopImmediatePropagation();
|
|
14516
|
+
event.preventDefault();
|
|
14517
|
+
return;
|
|
14518
|
+
}
|
|
14519
|
+
if (!isActivationClick(event) || !this.itemElement) {
|
|
14520
|
+
return;
|
|
14521
|
+
}
|
|
14522
|
+
this.focus();
|
|
14523
|
+
dispatchActivationClick(this.itemElement);
|
|
14524
|
+
};
|
|
14525
|
+
this.__handlePress = (event) => {
|
|
14526
|
+
if (this.disabled)
|
|
14527
|
+
return;
|
|
14528
|
+
if (event instanceof KeyboardEvent &&
|
|
14529
|
+
event.type === 'keydown' &&
|
|
14530
|
+
(event.key === 'Enter' || event.key === ' ')) {
|
|
14531
|
+
this._isPressed = true;
|
|
14532
|
+
}
|
|
14533
|
+
else if (event.type === 'mousedown') {
|
|
14534
|
+
this._isPressed = true;
|
|
14535
|
+
}
|
|
14536
|
+
else {
|
|
14537
|
+
this._isPressed = false;
|
|
14538
|
+
}
|
|
14539
|
+
};
|
|
14540
|
+
}
|
|
14541
|
+
focus() {
|
|
14542
|
+
this.itemElement?.focus();
|
|
14543
|
+
}
|
|
14544
|
+
blur() {
|
|
14545
|
+
this.itemElement?.blur();
|
|
14546
|
+
}
|
|
14547
|
+
firstUpdated() {
|
|
14548
|
+
this.__dispatchClickWithThrottle = throttle(this.__dispatchClick, this.throttleDelay);
|
|
14549
|
+
observerSlotChangesWithCallback(this.renderRoot.querySelector('slot:not([name])'), hasContent => {
|
|
14550
|
+
this._hasLabel = hasContent;
|
|
14551
|
+
this.requestUpdate();
|
|
14552
|
+
});
|
|
14553
|
+
observerSlotChangesWithCallback(this.renderRoot.querySelector('slot[name="active-icon"]'), hasContent => {
|
|
14554
|
+
this._hasActiveIcon = hasContent;
|
|
14555
|
+
this.requestUpdate();
|
|
14556
|
+
});
|
|
14557
|
+
}
|
|
14558
|
+
__isLink() {
|
|
14559
|
+
return !!this.href;
|
|
14560
|
+
}
|
|
14561
|
+
__getDisabledReasonID() {
|
|
14562
|
+
return this.disabled && this.disabledReason
|
|
14563
|
+
? `disabled-reason-${__classPrivateFieldGet(this, _NavigationRailItem_id, "f")}`
|
|
14564
|
+
: A;
|
|
14565
|
+
}
|
|
14566
|
+
__renderDisabledReason() {
|
|
14567
|
+
const disabledReasonID = this.__getDisabledReasonID();
|
|
14568
|
+
if (disabledReasonID)
|
|
14569
|
+
return b `<div
|
|
14570
|
+
id="disabled-reason-${__classPrivateFieldGet(this, _NavigationRailItem_id, "f")}"
|
|
14571
|
+
role="tooltip"
|
|
14572
|
+
aria-label=${this.disabledReason}
|
|
14573
|
+
class="screen-reader-only"
|
|
14574
|
+
>
|
|
14575
|
+
${this.disabledReason}
|
|
14576
|
+
</div>`;
|
|
14577
|
+
return A;
|
|
14578
|
+
}
|
|
14579
|
+
__renderItemContent() {
|
|
14580
|
+
return b `
|
|
14581
|
+
<wc-focus-ring class="focus-ring" for='item'></wc-focus-ring>
|
|
14582
|
+
<div class="state-layer"></div>
|
|
14583
|
+
<wc-ripple class="ripple"></wc-ripple>
|
|
14584
|
+
|
|
14585
|
+
<div class="item-content">
|
|
14586
|
+
<div class="indicator">
|
|
14587
|
+
<div class="icon-container">
|
|
14588
|
+
<slot name="active-icon" class="active-icon-slot"></slot>
|
|
14589
|
+
<slot name="icon" class="icon-slot"></slot>
|
|
14590
|
+
</div>
|
|
14591
|
+
</div>
|
|
14592
|
+
${this._hasLabel && !this.collapsed
|
|
14593
|
+
? b `<div class="label"><slot></slot></div>`
|
|
14594
|
+
: b `<slot class="hidden-slot"></slot>`}
|
|
14595
|
+
</div>
|
|
14596
|
+
|
|
14597
|
+
${this.__renderDisabledReason()}
|
|
14598
|
+
`;
|
|
14599
|
+
}
|
|
14600
|
+
render() {
|
|
14601
|
+
const isLink = this.__isLink();
|
|
14602
|
+
const cssClasses = {
|
|
14603
|
+
item: true,
|
|
14604
|
+
'item-element': true,
|
|
14605
|
+
active: this.active,
|
|
14606
|
+
disabled: this.disabled,
|
|
14607
|
+
pressed: this._isPressed,
|
|
14608
|
+
'has-label': this._hasLabel,
|
|
14609
|
+
'has-active-icon': this._hasActiveIcon,
|
|
14610
|
+
};
|
|
14611
|
+
if (!isLink) {
|
|
14612
|
+
return b `<button
|
|
14613
|
+
id="item"
|
|
14614
|
+
class=${e$3(cssClasses)}
|
|
14615
|
+
?disabled=${this.disabled}
|
|
14616
|
+
aria-disabled=${`${this.disabled}`}
|
|
14617
|
+
aria-current=${this.active ? 'page' : A}
|
|
14618
|
+
?aria-describedby=${this.__getDisabledReasonID()}
|
|
14619
|
+
@click=${this.__dispatchClickWithThrottle}
|
|
14620
|
+
@mousedown=${this.__handlePress}
|
|
14621
|
+
@keydown=${this.__handlePress}
|
|
14622
|
+
@keyup=${this.__handlePress}
|
|
14623
|
+
>
|
|
14624
|
+
${this.__renderItemContent()}
|
|
14625
|
+
</button>`;
|
|
14626
|
+
}
|
|
14627
|
+
return b `<a
|
|
14628
|
+
id="item"
|
|
14629
|
+
class=${e$3(cssClasses)}
|
|
14630
|
+
href=${this.href}
|
|
14631
|
+
target=${this.target}
|
|
14632
|
+
aria-current=${this.active ? 'page' : A}
|
|
14633
|
+
aria-disabled=${`${this.disabled}`}
|
|
14634
|
+
?aria-describedby=${this.__getDisabledReasonID()}
|
|
14635
|
+
@click=${this.__dispatchClickWithThrottle}
|
|
14636
|
+
@mousedown=${this.__handlePress}
|
|
14637
|
+
@keydown=${this.__handlePress}
|
|
14638
|
+
@keyup=${this.__handlePress}
|
|
14639
|
+
>
|
|
14640
|
+
${this.__renderItemContent()}
|
|
14641
|
+
</a>`;
|
|
14642
|
+
}
|
|
14643
|
+
}
|
|
14644
|
+
_NavigationRailItem_id = new WeakMap();
|
|
14645
|
+
NavigationRailItem.styles = [css_248z];
|
|
14646
|
+
__decorate([
|
|
14647
|
+
n({ type: Boolean, reflect: true })
|
|
14648
|
+
], NavigationRailItem.prototype, "active", void 0);
|
|
14649
|
+
__decorate([
|
|
14650
|
+
n({ type: Boolean, reflect: true })
|
|
14651
|
+
], NavigationRailItem.prototype, "disabled", void 0);
|
|
14652
|
+
__decorate([
|
|
14653
|
+
n({ type: Boolean, reflect: true })
|
|
14654
|
+
], NavigationRailItem.prototype, "collapsed", void 0);
|
|
14655
|
+
__decorate([
|
|
14656
|
+
n({ reflect: true })
|
|
14657
|
+
], NavigationRailItem.prototype, "href", void 0);
|
|
14658
|
+
__decorate([
|
|
14659
|
+
n()
|
|
14660
|
+
], NavigationRailItem.prototype, "target", void 0);
|
|
14661
|
+
__decorate([
|
|
14662
|
+
n({ reflect: true })
|
|
14663
|
+
], NavigationRailItem.prototype, "value", void 0);
|
|
14664
|
+
__decorate([
|
|
14665
|
+
n({ attribute: 'disabled-reason' })
|
|
14666
|
+
], NavigationRailItem.prototype, "disabledReason", void 0);
|
|
14667
|
+
__decorate([
|
|
14668
|
+
n({ type: Number })
|
|
14669
|
+
], NavigationRailItem.prototype, "throttleDelay", void 0);
|
|
14670
|
+
__decorate([
|
|
14671
|
+
r()
|
|
14672
|
+
], NavigationRailItem.prototype, "_isPressed", void 0);
|
|
14673
|
+
__decorate([
|
|
14674
|
+
r()
|
|
14675
|
+
], NavigationRailItem.prototype, "_hasLabel", void 0);
|
|
14676
|
+
__decorate([
|
|
14677
|
+
r()
|
|
14678
|
+
], NavigationRailItem.prototype, "_hasActiveIcon", void 0);
|
|
14679
|
+
__decorate([
|
|
14680
|
+
e$4('.item-element')
|
|
14681
|
+
], NavigationRailItem.prototype, "itemElement", void 0);
|
|
14682
|
+
|
|
14683
|
+
/**
|
|
14684
|
+
* @label Navigation Rail
|
|
14685
|
+
* @tag wc-navigation-rail
|
|
14686
|
+
* @rawTag navigation-rail
|
|
14687
|
+
*
|
|
14688
|
+
* @summary A vertical side navigation for medium-sized screens, following Material Design 3 specs.
|
|
14689
|
+
* @overview
|
|
14690
|
+
* <p>Navigation rail provides access to primary destinations in an app using icons—with or without labels—on a vertical rail.</p>
|
|
14691
|
+
* <p>Use navigation rail on medium-sized screens (tablets) with 3–7 destinations.</p>
|
|
14692
|
+
*
|
|
14693
|
+
* @cssprop --nav-rail-width - Width of the rail container. Defaults to 5rem (80dp).
|
|
14694
|
+
* @cssprop --nav-rail-container-color - Background color of the rail. Defaults to surface color.
|
|
14695
|
+
* @cssprop --nav-rail-indicator-color - Color of the active indicator. Defaults to secondary-container.
|
|
14696
|
+
* @cssprop --nav-rail-indicator-shape - Shape (border-radius) of the active indicator. Defaults to full (pill).
|
|
14697
|
+
* @cssprop --nav-rail-indicator-width - Width of the active indicator. Defaults to 3.5rem (56dp).
|
|
14698
|
+
* @cssprop --nav-rail-indicator-height - Height of the active indicator. Defaults to 2rem (32dp).
|
|
14699
|
+
* @cssprop --nav-rail-inactive-icon-color - Color of inactive icons. Defaults to on-surface-variant.
|
|
14700
|
+
* @cssprop --nav-rail-active-icon-color - Color of active icons. Defaults to on-secondary-container.
|
|
14701
|
+
* @cssprop --nav-rail-inactive-label-color - Color of inactive labels. Defaults to on-surface-variant.
|
|
14702
|
+
* @cssprop --nav-rail-active-label-color - Color of active labels. Defaults to on-surface.
|
|
14703
|
+
*
|
|
14704
|
+
* @example
|
|
14705
|
+
* ```html
|
|
14706
|
+
* <wc-navigation-rail>
|
|
14707
|
+
* <wc-navigation-rail-item active>
|
|
14708
|
+
* <wc-icon slot="icon">home</wc-icon>
|
|
14709
|
+
* Home
|
|
14710
|
+
* </wc-navigation-rail-item>
|
|
14711
|
+
* <wc-navigation-rail-item>
|
|
14712
|
+
* <wc-icon slot="icon">search</wc-icon>
|
|
14713
|
+
* Search
|
|
14714
|
+
* </wc-navigation-rail-item>
|
|
14715
|
+
* <wc-navigation-rail-item>
|
|
14716
|
+
* <wc-icon slot="icon">settings</wc-icon>
|
|
14717
|
+
* Settings
|
|
14718
|
+
* </wc-navigation-rail-item>
|
|
14719
|
+
* </wc-navigation-rail>
|
|
14720
|
+
* ```
|
|
14721
|
+
* @tags navigation
|
|
14722
|
+
*/
|
|
14723
|
+
class NavigationRail extends i$1 {
|
|
14724
|
+
constructor() {
|
|
14725
|
+
super(...arguments);
|
|
14726
|
+
/**
|
|
14727
|
+
* Vertical alignment of items within the rail.
|
|
14728
|
+
* - `"top"`: Items align to the top.
|
|
14729
|
+
* - `"center"`: Items are centered (default).
|
|
14730
|
+
* - `"bottom"`: Items align to the bottom.
|
|
14731
|
+
*/
|
|
14732
|
+
this.alignment = 'center';
|
|
14733
|
+
/**
|
|
14734
|
+
* Display mode of the navigation rail.
|
|
14735
|
+
* - `"expanded"`: shows labels.
|
|
14736
|
+
* - `"collapsed"`: hides labels.
|
|
14737
|
+
*/
|
|
14738
|
+
this.mode = 'expanded';
|
|
14739
|
+
/**
|
|
14740
|
+
* Whether to show a divider between the header and items sections.
|
|
14741
|
+
*/
|
|
14742
|
+
this.showDivider = false;
|
|
14743
|
+
this._handleItemClick = (event) => {
|
|
14744
|
+
const target = event.target;
|
|
14745
|
+
const item = target.closest('wc-navigation-rail-item');
|
|
14746
|
+
if (!item || item.disabled)
|
|
14747
|
+
return;
|
|
14748
|
+
// Deactivate all items and activate the clicked one
|
|
14749
|
+
for (const railItem of this._getItems()) {
|
|
14750
|
+
railItem.active = railItem === item;
|
|
14751
|
+
}
|
|
14752
|
+
this.dispatchEvent(new CustomEvent('nav-change', {
|
|
14753
|
+
detail: {
|
|
14754
|
+
value: item.value,
|
|
14755
|
+
item,
|
|
14756
|
+
},
|
|
14757
|
+
bubbles: true,
|
|
14758
|
+
composed: true,
|
|
14759
|
+
}));
|
|
14760
|
+
};
|
|
14761
|
+
this._syncItemMode = () => {
|
|
14762
|
+
const isCollapsed = this.mode === 'collapsed';
|
|
14763
|
+
for (const railItem of this._getItems()) {
|
|
14764
|
+
railItem.collapsed = isCollapsed;
|
|
14765
|
+
}
|
|
14766
|
+
};
|
|
14767
|
+
}
|
|
14768
|
+
connectedCallback() {
|
|
14769
|
+
super.connectedCallback();
|
|
14770
|
+
this.addEventListener('click', this._handleItemClick);
|
|
14771
|
+
this.setAttribute('role', 'navigation');
|
|
14772
|
+
this.setAttribute('aria-label', this.getAttribute('aria-label') ?? 'Main navigation');
|
|
14773
|
+
}
|
|
14774
|
+
disconnectedCallback() {
|
|
14775
|
+
this.removeEventListener('click', this._handleItemClick);
|
|
14776
|
+
super.disconnectedCallback();
|
|
14777
|
+
}
|
|
14778
|
+
firstUpdated() {
|
|
14779
|
+
this._syncItemMode();
|
|
14780
|
+
}
|
|
14781
|
+
updated(changedProperties) {
|
|
14782
|
+
if (changedProperties.has('mode')) {
|
|
14783
|
+
this._syncItemMode();
|
|
14784
|
+
}
|
|
14785
|
+
}
|
|
14786
|
+
_getItems() {
|
|
14787
|
+
return Array.from(this.querySelectorAll('wc-navigation-rail-item'));
|
|
14788
|
+
}
|
|
14789
|
+
render() {
|
|
14790
|
+
const cssClasses = {
|
|
14791
|
+
rail: true,
|
|
14792
|
+
[`align-${this.alignment}`]: true,
|
|
14793
|
+
[`mode-${this.mode}`]: true,
|
|
14794
|
+
};
|
|
14795
|
+
return b `
|
|
14796
|
+
<div class=${e$3(cssClasses)}>
|
|
14797
|
+
<div class="header">
|
|
14798
|
+
<slot name="header"></slot>
|
|
14799
|
+
</div>
|
|
14800
|
+
${this.showDivider ? b `<wc-divider></wc-divider>` : ''}
|
|
14801
|
+
<nav class="items" role="presentation">
|
|
14802
|
+
<slot @slotchange=${this._syncItemMode}></slot>
|
|
14803
|
+
</nav>
|
|
14804
|
+
</div>
|
|
14805
|
+
`;
|
|
14806
|
+
}
|
|
14807
|
+
}
|
|
14808
|
+
NavigationRail.styles = [css_248z$1];
|
|
14809
|
+
NavigationRail.Item = NavigationRailItem;
|
|
14810
|
+
__decorate([
|
|
14811
|
+
n({ reflect: true })
|
|
14812
|
+
], NavigationRail.prototype, "alignment", void 0);
|
|
14813
|
+
__decorate([
|
|
14814
|
+
n({ reflect: true })
|
|
14815
|
+
], NavigationRail.prototype, "mode", void 0);
|
|
14816
|
+
__decorate([
|
|
14817
|
+
n({ type: Boolean, attribute: 'show-divider' })
|
|
14818
|
+
], NavigationRail.prototype, "showDivider", void 0);
|
|
14819
|
+
|
|
14820
|
+
export { Accordion as A, Badge as B, Checkbox as C, DatePicker as D, Elevation as E, Field as F, SubMenu as G, Switch as H, Icon as I, TabGroup as J, TabPanel as K, LinearProgress as L, Menu as M, NavigationRail as N, Table as O, Pagination as P, Tabs as Q, Radio as R, SegmentedButton as S, Tab as T, Tag as U, Textarea as V, TimePicker as W, Tooltip as X, UrlField as Y, 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, NavigationRailItem as n, NumberField as o, Ripple as p, SegmentedButtonGroup as q, Select as r, SelectOptionElement as s, SidebarMenu as t, SidebarMenuItem as u, SidebarSubMenu as v, Skeleton as w, Slider as x, Snackbar as y, Spinner as z };
|
|
14821
|
+
//# sourceMappingURL=navigation-rail-Lxetd5-Z.js.map
|