scb-wc 0.1.78 → 0.1.80
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/README.md +41 -22
- package/all.js +0 -2
- package/index.js +88 -90
- package/mvc/components/all.js +0 -2
- package/mvc/components/scb-accordion/scb-accordion-item.js +3 -173
- package/mvc/components/scb-accordion/scb-accordion.js +4 -33
- package/mvc/components/scb-app-bar/scb-app-bar.js +2 -110
- package/mvc/components/scb-avatar/scb-avatar.js +2 -94
- package/mvc/components/scb-badge/scb-badge.js +2 -72
- package/mvc/components/scb-breadcrumb/scb-breadcrumb-item.js +2 -12
- package/mvc/components/scb-breadcrumb/scb-breadcrumb.js +4 -91
- package/mvc/components/scb-button/scb-button.js +47 -309
- package/mvc/components/scb-calendar/scb-calendar-event.js +2 -6
- package/mvc/components/scb-calendar/scb-calendar.js +6 -120
- package/mvc/components/scb-calendar-card/scb-calendar-card.js +21 -350
- package/mvc/components/scb-card/scb-card.js +54 -819
- package/mvc/components/scb-checkbox/scb-checkbox-group.js +3 -31
- package/mvc/components/scb-checkbox/scb-checkbox.js +5 -127
- package/mvc/components/scb-chip/scb-chip.js +2 -76
- package/mvc/components/scb-collapse/scb-collapse.js +2 -44
- package/mvc/components/scb-cookies-consent/scb-cookies-consent.js +7 -73
- package/mvc/components/scb-dialog/scb-dialog.js +2 -213
- package/mvc/components/scb-divider/scb-divider.js +1 -69
- package/mvc/components/scb-drawer/scb-drawer.js +6 -102
- package/mvc/components/scb-drop-zone/scb-drop-zone.js +2 -410
- package/mvc/components/scb-dropdown/scb-dropdown.js +17 -222
- package/mvc/components/scb-fab/scb-fab.js +7 -95
- package/mvc/components/scb-fact-card/scb-fact-card-content.js +2 -69
- package/mvc/components/scb-fact-card/scb-fact-card.js +2 -214
- package/mvc/components/scb-footer/scb-footer-section.js +1 -3
- package/mvc/components/scb-footer/scb-footer.js +3 -172
- package/mvc/components/scb-gallery-grid/scb-gallery-grid.js +2 -112
- package/mvc/components/scb-grid/scb-grid-item.js +1 -32
- package/mvc/components/scb-grid/scb-grid.js +1 -99
- package/mvc/components/scb-grid/scb-stack.js +1 -33
- package/mvc/components/scb-header/scb-header-menu-item.js +1 -5
- package/mvc/components/scb-header/scb-header-tab.js +1 -5
- package/mvc/components/scb-header/scb-header.js +75 -888
- package/mvc/components/scb-horizontal-scroller/scb-horizontal-scroller.js +43 -168
- package/mvc/components/scb-icon-button/scb-icon-button.js +59 -171
- package/mvc/components/scb-keyfigure-card/scb-keyfigure-card.js +17 -218
- package/mvc/components/scb-link/scb-link.js +4 -55
- package/mvc/components/scb-list/scb-list-item.js +23 -126
- package/mvc/components/scb-list/scb-list.js +5 -26
- package/mvc/components/scb-menu/scb-menu-item.js +16 -190
- package/mvc/components/scb-menu/scb-menu-section.js +4 -36
- package/mvc/components/scb-menu/scb-menu.js +5 -69
- package/mvc/components/scb-menu/scb-sub-menu.js +2 -7
- package/mvc/components/scb-nav/scb-nav-item.js +1 -28
- package/mvc/components/scb-nav/scb-nav.js +5 -98
- package/mvc/components/scb-notification-card/scb-notification-card.js +7 -364
- package/mvc/components/scb-options-menu/scb-options-menu-item.js +3 -50
- package/mvc/components/scb-options-menu/scb-options-menu.js +2 -82
- package/mvc/components/scb-options-menu/scb-options-sub-menu.js +2 -31
- package/mvc/components/scb-overlay/scb-overlay.js +3 -43
- package/mvc/components/scb-pagination/scb-pagination.js +19 -221
- package/mvc/components/scb-progress-indicator/scb-progress-indicator.js +2 -67
- package/mvc/components/scb-progress-stepper/scb-progress-step.js +4 -121
- package/mvc/components/scb-progress-stepper/scb-progress-stepper.js +2 -56
- package/mvc/components/scb-radio-button/scb-radio-button.js +5 -116
- package/mvc/components/scb-radio-button/scb-radio-group.js +2 -32
- package/mvc/components/scb-scrollspy/scb-scrollspy.js +2 -61
- package/mvc/components/scb-search/scb-search.js +5 -249
- package/mvc/components/scb-segmented-button/scb-segmented-button.js +1 -32
- package/mvc/components/scb-segmented-button/scb-segmented-item.js +2 -70
- package/mvc/components/scb-select/scb-select-option.js +2 -54
- package/mvc/components/scb-select/scb-select.js +4 -244
- package/mvc/components/scb-skeleton/scb-skeleton.js +2 -35
- package/mvc/components/scb-slider/scb-slider.js +5 -9
- package/mvc/components/scb-snackbar/scb-snackbar.js +9 -84
- package/mvc/components/scb-status-pill/scb-status-pill.js +2 -43
- package/mvc/components/scb-stepper/scb-step.js +8 -186
- package/mvc/components/scb-stepper/scb-stepper.js +2 -130
- package/mvc/components/scb-switch/scb-switch.js +4 -49
- package/mvc/components/scb-table/scb-table.js +2 -48
- package/mvc/components/scb-table-advanced/scb-table-advanced.js +2 -53
- package/mvc/components/scb-tabs/scb-primary-tab.js +2 -7
- package/mvc/components/scb-tabs/scb-secondary-tab.js +2 -7
- package/mvc/components/scb-tabs/scb-tabs.js +4 -31
- package/mvc/components/scb-textfield/scb-textfield.js +142 -388
- package/mvc/components/scb-toc/scb-toc-item.js +3 -251
- package/mvc/components/scb-toc/scb-toc.js +2 -16
- package/mvc/components/scb-tooltip/scb-tooltip.js +8 -155
- package/mvc/components/scb-viz/scb-viz.js +4 -619
- package/mvc/scb-wc-core.css +1 -1
- package/mvc/scb-wc-selfhost.css +1 -1
- package/mvc/scb-wc.css +1 -1
- package/mvc/vendor/assist-chip.js +3 -3
- package/mvc/vendor/chip-set.js +1 -1
- package/mvc/vendor/chip.js +2 -2
- package/mvc/vendor/elevation.js +2 -2
- package/mvc/vendor/filter-chip.js +1 -1
- package/mvc/vendor/focusable.js +1 -1
- package/mvc/vendor/form-associated.js +1 -1
- package/mvc/vendor/icon.js +2 -2
- package/mvc/vendor/lazy-focus-ring.js +2 -0
- package/mvc/vendor/lazy-ripple.js +2 -0
- package/mvc/vendor/md-focus-ring.js +2 -2
- package/mvc/vendor/ripple.js +2 -2
- package/mvc/vendor/scb-card-variants.internal.js +284 -0
- package/mvc/vendor/scb-chevron.js +10 -0
- package/mvc/vendor/scb-header-drawer.internal.js +71 -0
- package/mvc/vendor/shared-styles.js +1 -1
- package/mvc/vendor/tab-styles.js +3 -3
- package/mvc/vendor/validator.js +1 -1
- package/mvc/vendor/vendor.js +3 -4
- package/package.json +2 -2
- package/scb-accordion/scb-accordion-item.js +33 -32
- package/scb-app-bar/scb-app-bar.js +1 -1
- package/scb-button/scb-button.js +287 -259
- package/scb-calendar/scb-calendar.js +49 -49
- package/scb-calendar-card/scb-calendar-card.js +105 -59
- package/scb-card/scb-card-variants.internal.js +230 -0
- package/scb-card/scb-card.js +387 -528
- package/scb-checkbox/scb-checkbox.js +0 -1
- package/scb-chevron/scb-chevron.js +0 -1
- package/scb-components/scb-button/scb-button.d.ts +14 -2
- package/scb-components/scb-calendar/scb-calendar.d.ts +1 -0
- package/scb-components/scb-calendar-card/scb-calendar-card.d.ts +16 -4
- package/scb-components/scb-card/scb-card-variants.internal.d.ts +15 -0
- package/scb-components/scb-card/scb-card.d.ts +26 -9
- package/scb-components/scb-cookies-consent/scb-cookies-consent.d.ts +3 -0
- package/scb-components/scb-header/scb-header-drawer.internal.d.ts +31 -0
- package/scb-components/scb-header/scb-header.d.ts +1 -2
- package/scb-components/scb-horizontal-scroller/scb-horizontal-scroller.d.ts +6 -1
- package/scb-components/scb-icon-button/scb-icon-button.d.ts +28 -29
- package/scb-components/scb-keyfigure-card/scb-keyfigure-card.d.ts +13 -4
- package/scb-components/scb-list/scb-list-item.d.ts +20 -2
- package/scb-components/scb-list/scb-list.d.ts +1 -2
- package/scb-components/scb-nav/scb-nav.d.ts +2 -0
- package/scb-components/scb-segmented-button/scb-segmented-item.d.ts +1 -0
- package/scb-components/scb-select/scb-select-option.d.ts +2 -0
- package/scb-components/scb-toc/scb-toc-item.d.ts +1 -0
- package/scb-components/scb-tooltip/scb-tooltip.d.ts +2 -0
- package/scb-cookies-consent/scb-cookies-consent.js +43 -31
- package/scb-datepicker/scb-datepicker.js +27 -25
- package/scb-dialog/scb-dialog.js +1 -1
- package/scb-dropdown/scb-dropdown.js +29 -28
- package/scb-header/scb-header-drawer.internal.js +78 -0
- package/scb-header/scb-header.js +41 -89
- package/scb-horizontal-scroller/scb-horizontal-scroller.js +181 -88
- package/scb-icon-button/scb-icon-button.js +293 -205
- package/scb-keyfigure-card/scb-keyfigure-card.js +96 -43
- package/scb-list/scb-list-item.js +117 -52
- package/scb-list/scb-list.js +9 -9
- package/scb-nav/scb-nav.js +26 -23
- package/scb-notification-card/scb-notification-card.js +0 -2
- package/scb-options-menu/scb-options-menu-item.js +20 -20
- package/scb-pagination/scb-pagination.js +0 -1
- package/scb-progress-stepper/scb-progress-step.js +19 -17
- package/scb-radio-button/scb-radio-button.js +0 -1
- package/scb-search/scb-search.js +29 -28
- package/scb-segmented-button/scb-segmented-item.js +22 -19
- package/scb-select/scb-select-option.js +20 -14
- package/scb-select/scb-select.js +26 -26
- package/scb-stepper/scb-step.js +34 -31
- package/scb-textfield/scb-textfield.js +39 -39
- package/scb-toc/scb-toc-item.js +26 -26
- package/scb-tooltip/scb-tooltip.js +5 -4
- package/scb-viz/scb-viz.js +1 -1
- package/scb-wc-core.css +1 -1
- package/scb-wc-public-entry/index.d.ts +97 -0
- package/scb-wc-selfhost.css +1 -1
- package/scb-wc.bundle.js +1873 -1476
- package/scb-wc.css +1 -1
- package/scb-wc.d.ts +194 -198
- package/mvc/components/scb-chevron/scb-chevron.js +0 -41
- package/mvc/components/scb-datepicker/scb-datepicker.js +0 -296
- package/mvc/vendor/element-internals.js +0 -1
- package/mvc/vendor/filled-icon-button.js +0 -2
- package/mvc/vendor/filled-tonal-icon-button.js +0 -2
- package/mvc/vendor/form-label-activation.js +0 -1
- package/mvc/vendor/form-submitter.js +0 -1
- package/mvc/vendor/icon-button.js +0 -2
- package/mvc/vendor/list.js +0 -8
- package/mvc/vendor/outlined-icon-button.js +0 -2
- package/mvc/vendor/shared-styles2.js +0 -30
- package/scb-components/index.d.ts +0 -99
- package/scb-components/scb-chevron/scb-chevron.d.ts +0 -11
- package/scb-components/scb-datepicker/scb-datepicker.d.ts +0 -39
|
@@ -1,30 +1,36 @@
|
|
|
1
1
|
import { __decorate as e } from "../_virtual/_@oxc-project_runtime@0.126.0/helpers/decorate.js";
|
|
2
2
|
import { LitElement as t, css as n, html as r } from "lit";
|
|
3
3
|
import { customElement as i, property as a } from "lit/decorators.js";
|
|
4
|
-
import "@material/web/focus/md-focus-ring.js";
|
|
5
4
|
//#region src/scb-components/scb-keyfigure-card/scb-keyfigure-card.ts
|
|
6
|
-
var o
|
|
5
|
+
var o = {
|
|
7
6
|
fromAttribute: (e) => e ?? "",
|
|
8
7
|
toAttribute: (e) => typeof e == "string" ? e.trim() === "" ? null : e : null
|
|
9
|
-
}, c
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
8
|
+
}, s, c, l;
|
|
9
|
+
function u() {
|
|
10
|
+
return s ??= import("../shared/lazy-focus-ring.js"), s;
|
|
11
|
+
}
|
|
12
|
+
function d() {
|
|
13
|
+
return c ??= import("../shared/lazy-ripple.js"), c;
|
|
14
|
+
}
|
|
15
|
+
function f() {
|
|
16
|
+
return l ??= import("@material/web/icon/icon.js"), l;
|
|
17
|
+
}
|
|
18
|
+
var p = class extends t {
|
|
13
19
|
constructor(...e) {
|
|
14
|
-
super(...e), this.keyfigure = 0, this.subtitle = "", this.supportingText = "", this.cardHref = "", this.href = "", this.icon = "", this.size = "large", this.unit = "", this.width = "", this.maxWidth = "", this.height = "", this.maxHeight = "", this.sizing = "", this.spacing = void 0, this.spacingTop = void 0, this.spacingBottom = void 0, this.spacingLeft = void 0, this.spacingRight = void 0, this.
|
|
20
|
+
super(...e), this.__focusRingRequested = !1, this.__focusRingLoaded = !1, this.__rippleRequested = !1, this.__rippleLoaded = !1, this.__pendingRippleClick = !1, this.keyfigure = 0, this.subtitle = "", this.supportingText = "", this.cardHref = "", this.href = "", this.icon = "", this.size = "large", this.unit = "", this.width = "", this.maxWidth = "", this.height = "", this.maxHeight = "", this.sizing = "", this.spacing = void 0, this.spacingTop = void 0, this.spacingBottom = void 0, this.spacingLeft = void 0, this.spacingRight = void 0, this.__onPointerInteraction = (e) => {
|
|
21
|
+
this.__ensureRipple(e);
|
|
22
|
+
}, this.__ensureFocusRingOnFocusVisible = () => {
|
|
23
|
+
this.__focusRingLoaded || this.__focusRingRequested || (this.__focusRingRequested = !0, u().then(({ ensureFocusRingReady: e }) => e()).then(() => {
|
|
24
|
+
this.__focusRingLoaded = !0, this.requestUpdate();
|
|
25
|
+
}));
|
|
26
|
+
}, this.__onKeyDown = (e) => {
|
|
15
27
|
let t = this.__effectiveHref;
|
|
16
28
|
(e.key === "Enter" || e.key === " ") && t && (e.preventDefault(), this.__navigate(t, e));
|
|
17
29
|
}, this.__handleHrefNavigation = (e) => {
|
|
18
30
|
let t = this.__effectiveHref;
|
|
19
|
-
t && (e.target.closest("a")
|
|
31
|
+
t && ((!this.__rippleLoaded || this.__pendingRippleEvent) && (this.__pendingRippleClick = !0, this.__ensureRipple()), !e.target.closest("a") && this.__navigate(t, e));
|
|
20
32
|
};
|
|
21
33
|
}
|
|
22
|
-
static {
|
|
23
|
-
this.__iconLoaded = !1;
|
|
24
|
-
}
|
|
25
|
-
static {
|
|
26
|
-
this.__rippleLoaded = !1;
|
|
27
|
-
}
|
|
28
34
|
static {
|
|
29
35
|
this.styles = n`
|
|
30
36
|
:host {
|
|
@@ -174,6 +180,30 @@ var o, s = {
|
|
|
174
180
|
inline-size: fit-content;
|
|
175
181
|
}
|
|
176
182
|
|
|
183
|
+
.card-icon {
|
|
184
|
+
display: inline-flex;
|
|
185
|
+
align-items: center;
|
|
186
|
+
inline-size: 1em;
|
|
187
|
+
block-size: 1em;
|
|
188
|
+
overflow: hidden;
|
|
189
|
+
font-family: 'Material Symbols Outlined';
|
|
190
|
+
font-size: var(--icon-size-medium, 24px);
|
|
191
|
+
line-height: 1;
|
|
192
|
+
white-space: nowrap;
|
|
193
|
+
text-transform: none;
|
|
194
|
+
word-wrap: normal;
|
|
195
|
+
direction: ltr;
|
|
196
|
+
font-feature-settings: 'liga' 1;
|
|
197
|
+
font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
|
|
198
|
+
text-rendering: optimizeLegibility;
|
|
199
|
+
-webkit-font-smoothing: antialiased;
|
|
200
|
+
-moz-osx-font-smoothing: grayscale;
|
|
201
|
+
}
|
|
202
|
+
.card-icon.scb-svg-icon {
|
|
203
|
+
fill: currentColor;
|
|
204
|
+
font: inherit;
|
|
205
|
+
}
|
|
206
|
+
|
|
177
207
|
.sub-label {
|
|
178
208
|
font-size: var(--scb-keyfigure-card-subtitle-size);
|
|
179
209
|
font-weight: var(--weight-semibold, 600);
|
|
@@ -236,17 +266,38 @@ var o, s = {
|
|
|
236
266
|
let t = Number(e);
|
|
237
267
|
return Number.isNaN(t) ? String(e) : t.toLocaleString("sv-SE").replace(/\u00A0/g, " ");
|
|
238
268
|
}
|
|
239
|
-
|
|
240
|
-
|
|
269
|
+
firstUpdated() {
|
|
270
|
+
this.__applyInnerSizing(), this.__applySpacing(), this.__ensureSlottedIconDeps();
|
|
241
271
|
}
|
|
242
272
|
get __effectiveHref() {
|
|
243
273
|
return (this.cardHref || this.href || "").trim();
|
|
244
274
|
}
|
|
245
275
|
__hasSlottedContent(e) {
|
|
246
|
-
return
|
|
276
|
+
return !!this.querySelector(`[slot="${e}"]`);
|
|
247
277
|
}
|
|
248
278
|
__slottedText(e) {
|
|
249
|
-
return Array.from(this.
|
|
279
|
+
return Array.from(this.querySelectorAll(`[slot="${e}"]`)).map((e) => e.textContent?.trim() ?? "").filter(Boolean).join(" ");
|
|
280
|
+
}
|
|
281
|
+
async __ensureSlottedIconDeps() {
|
|
282
|
+
let e = this.querySelector("[slot=\"icon\"]");
|
|
283
|
+
e && (e.localName === "md-icon" || e.querySelector?.("md-icon")) && await f();
|
|
284
|
+
}
|
|
285
|
+
__ensureRipple(e) {
|
|
286
|
+
if (this.__effectiveHref) {
|
|
287
|
+
if (e && (this.__pendingRippleEvent = e), this.__rippleLoaded) {
|
|
288
|
+
this.__syncRipple();
|
|
289
|
+
return;
|
|
290
|
+
}
|
|
291
|
+
this.__rippleRequested || (this.__rippleRequested = !0, d().then(({ ensureRippleReady: e }) => e()).then(() => {
|
|
292
|
+
this.__rippleLoaded = !0, this.requestUpdate(), this.updateComplete.then(() => this.__syncRipple());
|
|
293
|
+
}));
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
async __syncRipple() {
|
|
297
|
+
let e = this.renderRoot.querySelector("md-ripple"), t = this.renderRoot.querySelector(".scb-keyfigure-card"), n = this.__pendingRippleEvent, r = this.__pendingRippleClick;
|
|
298
|
+
this.__pendingRippleEvent = void 0, this.__pendingRippleClick = !1;
|
|
299
|
+
let { syncRippleToControl: i } = await d();
|
|
300
|
+
await i(e, t, n, r);
|
|
250
301
|
}
|
|
251
302
|
render() {
|
|
252
303
|
let e = this.__effectiveHref, t = !!e, n = this.formatNumber(this.keyfigure), i = (this.unit || "").trim(), a = i ? `${n} ${i}` : n, o = this.__hasSlottedContent("icon"), s = this.__hasSlottedContent("subtitle"), c = this.__hasSlottedContent("supporting-text"), l = s ? this.__slottedText("subtitle") : this.subtitle, u = this.supportingText, d = s || !!l, f = c || !!u;
|
|
@@ -258,17 +309,19 @@ var o, s = {
|
|
|
258
309
|
aria-label=${l || a}
|
|
259
310
|
@click=${t ? this.__handleHrefNavigation : null}
|
|
260
311
|
@keydown=${t ? this.__onKeyDown : null}
|
|
261
|
-
|
|
312
|
+
@focusin=${t ? this.__ensureFocusRingOnFocusVisible : null}
|
|
313
|
+
@pointerenter=${t ? this.__onPointerInteraction : null}
|
|
314
|
+
@pointerdown=${t ? this.__onPointerInteraction : null}
|
|
262
315
|
>
|
|
263
|
-
${t ? r`<md-ripple></md-ripple>` : ""}
|
|
264
|
-
${o ? r`<div class="icon-slot"><slot name="icon"></slot></div>` : this.icon ? r`<
|
|
316
|
+
${t && this.__rippleLoaded ? r`<md-ripple></md-ripple>` : ""}
|
|
317
|
+
${o ? r`<div class="icon-slot"><slot name="icon" @slotchange=${this.__ensureSlottedIconDeps}></slot></div>` : this.icon ? r`<span class="card-icon" aria-hidden="true">${this.icon}</span>` : ""}
|
|
265
318
|
|
|
266
319
|
${this.keyfigure !== void 0 && this.keyfigure !== null && this.keyfigure !== "" ? r`
|
|
267
320
|
<div class="keyfigure">
|
|
268
321
|
<span class="value" aria-label="${a}">
|
|
269
322
|
${n}${i ? r`<span class="unit" aria-hidden="true">\u00A0${i}</span>` : ""}
|
|
270
323
|
</span>
|
|
271
|
-
${t ? r`<
|
|
324
|
+
${t ? r`<span class="card-icon" aria-hidden="true">arrow_forward</span>` : ""}
|
|
272
325
|
</div>
|
|
273
326
|
` : ""}
|
|
274
327
|
|
|
@@ -285,7 +338,7 @@ var o, s = {
|
|
|
285
338
|
` : ""}
|
|
286
339
|
</div>
|
|
287
340
|
|
|
288
|
-
${t ? r`<md-focus-ring></md-focus-ring>` : ""}
|
|
341
|
+
${t && this.__focusRingLoaded ? r`<md-focus-ring></md-focus-ring>` : ""}
|
|
289
342
|
`;
|
|
290
343
|
}
|
|
291
344
|
__applyInnerSizing() {
|
|
@@ -293,14 +346,14 @@ var o, s = {
|
|
|
293
346
|
e && (this.width && this.width.trim() !== "" ? (e.style.inlineSize = "100%", e.style.maxInlineSize = "100%") : (e.style.removeProperty("inline-size"), e.style.removeProperty("max-inline-size")), this.height && this.height.trim() !== "" || this.sizing === "stretch" ? e.style.blockSize = "100%" : e.style.removeProperty("block-size"), this.maxHeight && this.maxHeight.trim() !== "" ? e.style.maxBlockSize = "100%" : e.style.removeProperty("max-block-size"));
|
|
294
347
|
}
|
|
295
348
|
updated(e) {
|
|
296
|
-
super.updated(e), e.has("width") && (this.width ? this.style.inlineSize = this.width : this.style.removeProperty("inline-size")), e.has("maxWidth") && (this.maxWidth ? this.style.maxInlineSize = this.maxWidth : this.style.removeProperty("max-inline-size")), e.has("height") && (this.height ? this.style.blockSize = this.height : this.style.removeProperty("block-size")), e.has("maxHeight") && (this.maxHeight ? this.style.maxBlockSize = this.maxHeight : this.style.removeProperty("max-block-size")), (e.has("width") || e.has("height") || e.has("maxHeight") || e.has("sizing")) && this.__applyInnerSizing(), (e.has("spacing") || e.has("spacingTop") || e.has("spacingBottom") || e.has("spacingLeft") || e.has("spacingRight")) && this
|
|
349
|
+
super.updated(e), e.has("width") && (this.width ? this.style.inlineSize = this.width : this.style.removeProperty("inline-size")), e.has("maxWidth") && (this.maxWidth ? this.style.maxInlineSize = this.maxWidth : this.style.removeProperty("max-inline-size")), e.has("height") && (this.height ? this.style.blockSize = this.height : this.style.removeProperty("block-size")), e.has("maxHeight") && (this.maxHeight ? this.style.maxBlockSize = this.maxHeight : this.style.removeProperty("max-block-size")), (e.has("width") || e.has("height") || e.has("maxHeight") || e.has("sizing")) && this.__applyInnerSizing(), (e.has("spacing") || e.has("spacingTop") || e.has("spacingBottom") || e.has("spacingLeft") || e.has("spacingRight")) && this.__applySpacing();
|
|
297
350
|
}
|
|
298
351
|
mapSpacingToken(e) {
|
|
299
352
|
if (!e) return;
|
|
300
353
|
let t = String(e).trim();
|
|
301
354
|
if (t) return /^\d+$/.test(t) ? `var(--spacing-${Math.max(0, Math.min(14, parseInt(t, 10)))})` : t;
|
|
302
355
|
}
|
|
303
|
-
|
|
356
|
+
__applySpacing() {
|
|
304
357
|
let e = this.mapSpacingToken(this.spacing), t = this.mapSpacingToken(this.spacingTop) ?? e, n = this.mapSpacingToken(this.spacingBottom) ?? e, r = this.mapSpacingToken(this.spacingLeft), i = this.mapSpacingToken(this.spacingRight);
|
|
305
358
|
t ? this.style.setProperty("--scb-keyfigure-card-spacing-block-start", t) : this.style.removeProperty("--scb-keyfigure-card-spacing-block-start"), n ? this.style.setProperty("--scb-keyfigure-card-spacing-block-end", n) : this.style.removeProperty("--scb-keyfigure-card-spacing-block-end"), r ? this.style.setProperty("--scb-keyfigure-card-spacing-inline-start", r) : this.style.removeProperty("--scb-keyfigure-card-spacing-inline-start"), i ? this.style.setProperty("--scb-keyfigure-card-spacing-inline-end", i) : this.style.removeProperty("--scb-keyfigure-card-spacing-inline-end");
|
|
306
359
|
}
|
|
@@ -322,58 +375,58 @@ var o, s = {
|
|
|
322
375
|
this.__dispatchNavigateEvents(e, t) && (window.location.href = e);
|
|
323
376
|
}
|
|
324
377
|
};
|
|
325
|
-
e([a({ attribute: "keyfigure" })],
|
|
378
|
+
e([a({ attribute: "keyfigure" })], p.prototype, "keyfigure", void 0), e([a({
|
|
326
379
|
type: String,
|
|
327
380
|
attribute: "subtitle"
|
|
328
|
-
})],
|
|
381
|
+
})], p.prototype, "subtitle", void 0), e([a({
|
|
329
382
|
type: String,
|
|
330
383
|
attribute: "supporting-text"
|
|
331
|
-
})],
|
|
384
|
+
})], p.prototype, "supportingText", void 0), e([a({
|
|
332
385
|
type: String,
|
|
333
386
|
attribute: "card-href"
|
|
334
|
-
})],
|
|
387
|
+
})], p.prototype, "cardHref", void 0), e([a({
|
|
335
388
|
type: String,
|
|
336
389
|
attribute: "href"
|
|
337
|
-
})],
|
|
390
|
+
})], p.prototype, "href", void 0), e([a({ type: String })], p.prototype, "icon", void 0), e([a({
|
|
338
391
|
type: String,
|
|
339
392
|
reflect: !0
|
|
340
|
-
})],
|
|
393
|
+
})], p.prototype, "size", void 0), e([a({ type: String })], p.prototype, "unit", void 0), e([a({
|
|
341
394
|
type: String,
|
|
342
395
|
reflect: !0
|
|
343
|
-
})],
|
|
396
|
+
})], p.prototype, "width", void 0), e([a({
|
|
344
397
|
type: String,
|
|
345
398
|
reflect: !0,
|
|
346
399
|
attribute: "max-width"
|
|
347
|
-
})],
|
|
400
|
+
})], p.prototype, "maxWidth", void 0), e([a({
|
|
348
401
|
type: String,
|
|
349
402
|
reflect: !0
|
|
350
|
-
})],
|
|
403
|
+
})], p.prototype, "height", void 0), e([a({
|
|
351
404
|
type: String,
|
|
352
405
|
reflect: !0,
|
|
353
406
|
attribute: "max-height"
|
|
354
|
-
})],
|
|
407
|
+
})], p.prototype, "maxHeight", void 0), e([a({
|
|
355
408
|
type: String,
|
|
356
409
|
reflect: !0,
|
|
357
|
-
converter:
|
|
358
|
-
})],
|
|
410
|
+
converter: o
|
|
411
|
+
})], p.prototype, "sizing", void 0), e([a({
|
|
359
412
|
type: String,
|
|
360
413
|
reflect: !0
|
|
361
|
-
})],
|
|
414
|
+
})], p.prototype, "spacing", void 0), e([a({
|
|
362
415
|
type: String,
|
|
363
416
|
reflect: !0,
|
|
364
417
|
attribute: "spacing-top"
|
|
365
|
-
})],
|
|
418
|
+
})], p.prototype, "spacingTop", void 0), e([a({
|
|
366
419
|
type: String,
|
|
367
420
|
reflect: !0,
|
|
368
421
|
attribute: "spacing-bottom"
|
|
369
|
-
})],
|
|
422
|
+
})], p.prototype, "spacingBottom", void 0), e([a({
|
|
370
423
|
type: String,
|
|
371
424
|
reflect: !0,
|
|
372
425
|
attribute: "spacing-left"
|
|
373
|
-
})],
|
|
426
|
+
})], p.prototype, "spacingLeft", void 0), e([a({
|
|
374
427
|
type: String,
|
|
375
428
|
reflect: !0,
|
|
376
429
|
attribute: "spacing-right"
|
|
377
|
-
})],
|
|
430
|
+
})], p.prototype, "spacingRight", void 0), p = e([i("scb-keyfigure-card")], p);
|
|
378
431
|
//#endregion
|
|
379
|
-
export {
|
|
432
|
+
export { p as ScbKeyFigureCard };
|
|
@@ -1,22 +1,38 @@
|
|
|
1
1
|
import { __decorate as e } from "../_virtual/_@oxc-project_runtime@0.126.0/helpers/decorate.js";
|
|
2
2
|
import { LitElement as t, css as n, html as r, nothing as i } from "lit";
|
|
3
3
|
import { customElement as a, property as o } from "lit/decorators.js";
|
|
4
|
-
import "@material/web/focus/md-focus-ring.js";
|
|
5
|
-
import "@material/web/ripple/ripple.js";
|
|
6
4
|
//#region src/scb-components/scb-list/scb-list-item.ts
|
|
7
|
-
var s
|
|
5
|
+
var s, c;
|
|
6
|
+
function l() {
|
|
7
|
+
return s ??= import("../shared/lazy-focus-ring.js"), s;
|
|
8
|
+
}
|
|
9
|
+
function u() {
|
|
10
|
+
return c ??= import("../shared/lazy-ripple.js"), c;
|
|
11
|
+
}
|
|
12
|
+
var d = class extends t {
|
|
8
13
|
constructor(...e) {
|
|
9
|
-
super(...e), this.type = "text", this.href = "", this.itemHref = "", this.target = "", this.disabled = !1, this.label = "", this.supportingText = "", this.overline = "", this.leading = !1, this.leadingVariant = "", this.leadingIcon = "", this.avatarLabel = "", this.avatarAlt = "", this.avatarVariant = "icon", this.avatarSrc = "", this.imgHrefImage = "", this.trailing = !1, this.trailingVariant = "", this.trailingIcon = "", this.trailingSwitchLabel = "", this.trailingSwitchWidth = "", this.trailingSwitchSelected = !1, this.density = 0, this.noDivider = !1, this
|
|
10
|
-
|
|
14
|
+
super(...e), this.type = "text", this.href = "", this.itemHref = "", this.target = "", this.disabled = !1, this.label = "", this.supportingText = "", this.overline = "", this.leading = !1, this.leadingVariant = "", this.leadingIcon = "", this.avatarLabel = "", this.avatarAlt = "", this.avatarVariant = "icon", this.avatarSrc = "", this.imgHrefImage = "", this.trailing = !1, this.trailingVariant = "", this.trailingIcon = "", this.trailingSwitchLabel = "", this.trailingSwitchWidth = "", this.trailingSwitchSelected = !1, this.density = 0, this.noDivider = !1, this.__scbCheckboxLoaded = !1, this.__scbSwitchLoaded = !1, this.__focusRingRequested = !1, this.__focusRingLoaded = !1, this.__rippleRequested = !1, this.__rippleLoaded = !1, this.__pendingRippleClick = !1, this.__syncRipple = async () => {
|
|
15
|
+
let e = this.renderRoot.querySelector("md-ripple"), t = this.renderRoot.querySelector(".row"), n = this.__pendingRippleEvent, r = this.__pendingRippleClick;
|
|
16
|
+
this.__pendingRippleEvent = void 0, this.__pendingRippleClick = !1;
|
|
17
|
+
let { syncRippleToControl: i } = await u();
|
|
18
|
+
await i(e, t, n, r);
|
|
19
|
+
}, this.__onPointerInteraction = (e) => {
|
|
20
|
+
this.__ensureRipple(e);
|
|
21
|
+
}, this.__onFocusIn = () => {
|
|
22
|
+
this.__ensureFocusRing();
|
|
23
|
+
}, this.__onLazyFocusRingKeydown = (e) => {
|
|
24
|
+
e.key === "Tab" && l().then(({ ensureFocusRingOnTab: t }) => t(e));
|
|
25
|
+
}, this.onRowClick = () => {
|
|
26
|
+
if (this.type === "link" && !this.disabled && (!this.__rippleLoaded || this.__pendingRippleEvent) && (this.__pendingRippleClick = !0, this.__ensureRipple()), this.type === "link" && (this.href || this.itemHref)) return;
|
|
11
27
|
let e = this.shadowRoot?.querySelector("scb-checkbox"), t = this.shadowRoot?.querySelector("scb-switch");
|
|
12
28
|
if (e && (e.checked = !e.checked), t) {
|
|
13
29
|
let e = !this.trailingSwitchSelected;
|
|
14
|
-
t.selected = e, this
|
|
30
|
+
t.selected = e, this.__setTrailingSwitchSelected(e, !0);
|
|
15
31
|
}
|
|
16
|
-
}, this
|
|
32
|
+
}, this.__onTrailingSwitchChange = (e) => {
|
|
17
33
|
let t = e.detail?.selected, n = typeof t == "boolean" ? t : e.currentTarget?.selected ?? !1;
|
|
18
|
-
this
|
|
19
|
-
}, this
|
|
34
|
+
this.__setTrailingSwitchSelected(n, !0);
|
|
35
|
+
}, this.__onKeydown = (e) => {
|
|
20
36
|
if (!e.defaultPrevented && (e.key === "Enter" || e.key === " ")) {
|
|
21
37
|
if (this.type === "link") {
|
|
22
38
|
let t = this.shadowRoot?.querySelector("a[href]");
|
|
@@ -29,12 +45,10 @@ var s = class extends t {
|
|
|
29
45
|
}
|
|
30
46
|
};
|
|
31
47
|
}
|
|
32
|
-
#e;
|
|
33
|
-
#t;
|
|
34
|
-
#n;
|
|
35
48
|
static get styles() {
|
|
36
49
|
return n`
|
|
37
50
|
:host {
|
|
51
|
+
display: block;
|
|
38
52
|
border-bottom: var(--stroke-border, 1px) solid var(--md-sys-color-outline-variant);
|
|
39
53
|
margin-bottom: calc(var(--stroke-border, 1px) * -1);
|
|
40
54
|
outline: none;
|
|
@@ -43,6 +57,10 @@ var s = class extends t {
|
|
|
43
57
|
font-family: var(--brand-font);
|
|
44
58
|
}
|
|
45
59
|
|
|
60
|
+
:host([hidden]) {
|
|
61
|
+
display: none;
|
|
62
|
+
}
|
|
63
|
+
|
|
46
64
|
:host([no-divider]) { --stroke-border: 0px; }
|
|
47
65
|
|
|
48
66
|
md-focus-ring {
|
|
@@ -52,7 +70,8 @@ var s = class extends t {
|
|
|
52
70
|
display: none;
|
|
53
71
|
border-radius: var(--scb-list-item-focus-ring-radius, var(--md-sys-shape-corner-small, 8px));
|
|
54
72
|
}
|
|
55
|
-
:host(:focus-visible) md-focus-ring
|
|
73
|
+
:host(:focus-visible) md-focus-ring,
|
|
74
|
+
:host(:focus-within) md-focus-ring { display: block; }
|
|
56
75
|
|
|
57
76
|
.row {
|
|
58
77
|
display: flex;
|
|
@@ -84,6 +103,29 @@ var s = class extends t {
|
|
|
84
103
|
pointer-events: none;
|
|
85
104
|
}
|
|
86
105
|
|
|
106
|
+
.material-icon {
|
|
107
|
+
display: inline-block;
|
|
108
|
+
inline-size: var(--icon-size-medium, 24px);
|
|
109
|
+
block-size: var(--icon-size-medium, 24px);
|
|
110
|
+
overflow: hidden;
|
|
111
|
+
font-family: 'Material Symbols Outlined';
|
|
112
|
+
font-size: var(--icon-size-medium, 24px);
|
|
113
|
+
line-height: 1;
|
|
114
|
+
text-align: center;
|
|
115
|
+
white-space: nowrap;
|
|
116
|
+
text-transform: none;
|
|
117
|
+
word-wrap: normal;
|
|
118
|
+
direction: ltr;
|
|
119
|
+
font-feature-settings: 'liga' 1;
|
|
120
|
+
font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
|
|
121
|
+
-webkit-font-smoothing: antialiased;
|
|
122
|
+
-moz-osx-font-smoothing: grayscale;
|
|
123
|
+
}
|
|
124
|
+
.material-icon.scb-svg-icon {
|
|
125
|
+
fill: currentColor;
|
|
126
|
+
font: inherit;
|
|
127
|
+
}
|
|
128
|
+
|
|
87
129
|
.leading { align-self: center; display: grid; place-items: center; }
|
|
88
130
|
.img {
|
|
89
131
|
width: calc(var(--icon-size-extra-large, 36px) + var(--spacing-5, 16px));
|
|
@@ -146,28 +188,44 @@ var s = class extends t {
|
|
|
146
188
|
`;
|
|
147
189
|
}
|
|
148
190
|
async firstUpdated() {
|
|
149
|
-
await this
|
|
191
|
+
await this.__ensureDepsLoaded(), this.addEventListener("focusin", this.__onFocusIn), this.addEventListener("keydown", this.__onLazyFocusRingKeydown), this.addEventListener("keydown", this.__onKeydown);
|
|
192
|
+
}
|
|
193
|
+
disconnectedCallback() {
|
|
194
|
+
this.removeEventListener("focusin", this.__onFocusIn), this.removeEventListener("keydown", this.__onLazyFocusRingKeydown), this.removeEventListener("keydown", this.__onKeydown), super.disconnectedCallback();
|
|
150
195
|
}
|
|
151
196
|
updated(e) {
|
|
152
|
-
super.updated(e), (e.has("leading") || e.has("leadingVariant") || e.has("trailing") || e.has("trailingVariant") || e.has("type") || e.has("target")) && this
|
|
197
|
+
super.updated(e), (e.has("leading") || e.has("leadingVariant") || e.has("trailing") || e.has("trailingVariant") || e.has("type") || e.has("target")) && this.__ensureDepsLoaded();
|
|
198
|
+
}
|
|
199
|
+
async __ensureDepsLoaded() {
|
|
200
|
+
this.trailing && this.trailingVariant === "checkbox" && !this.__scbCheckboxLoaded && (await import("../scb-checkbox/scb-checkbox.js"), this.__scbCheckboxLoaded = !0), this.trailing && this.trailingVariant === "switch" && !this.__scbSwitchLoaded && (await import("../scb-switch/scb-switch.js"), this.__scbSwitchLoaded = !0);
|
|
153
201
|
}
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
202
|
+
__ensureRipple(e) {
|
|
203
|
+
if (!(this.type !== "link" || this.disabled)) {
|
|
204
|
+
if (e && (this.__pendingRippleEvent = e), this.__rippleLoaded) {
|
|
205
|
+
this.__syncRipple();
|
|
206
|
+
return;
|
|
207
|
+
}
|
|
208
|
+
this.__rippleRequested || (this.__rippleRequested = !0, u().then(({ ensureRippleReady: e }) => e()).then(() => {
|
|
209
|
+
this.disabled || (this.__rippleLoaded = !0, this.requestUpdate(), this.updateComplete.then(() => this.__syncRipple()));
|
|
210
|
+
}));
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
__ensureFocusRing() {
|
|
214
|
+
this.__focusRingLoaded || this.__focusRingRequested || (this.__focusRingRequested = !0, l().then(({ ensureFocusRingReady: e }) => e()).then(() => {
|
|
215
|
+
this.__focusRingLoaded = !0, this.requestUpdate();
|
|
216
|
+
}));
|
|
157
217
|
}
|
|
158
|
-
|
|
218
|
+
__setTrailingSwitchSelected(e, t) {
|
|
159
219
|
this.trailingSwitchSelected = e, t && this.dispatchEvent(new CustomEvent("trailing-switch-change", {
|
|
160
220
|
detail: { selected: e },
|
|
161
221
|
bubbles: !0,
|
|
162
222
|
composed: !0
|
|
163
223
|
}));
|
|
164
224
|
}
|
|
165
|
-
#a;
|
|
166
|
-
#o;
|
|
167
225
|
render() {
|
|
168
226
|
let e = this.leading ? (() => {
|
|
169
227
|
switch (this.leadingVariant) {
|
|
170
|
-
case "icon": return this.leadingIcon ? r`<div class="leading"><
|
|
228
|
+
case "icon": return this.leadingIcon ? r`<div class="leading"><span class="material-icon" aria-hidden="true">${this.leadingIcon}</span></div>` : i;
|
|
171
229
|
case "avatar": return r`
|
|
172
230
|
<div class="leading">
|
|
173
231
|
<scb-avatar
|
|
@@ -186,7 +244,7 @@ var s = class extends t {
|
|
|
186
244
|
})() : i, t = this.href || this.itemHref || "", n = this.target === "_blank" ? "open_in_new" : "chevron_right", a = this.label ? `Välj ${this.label}` : "Välj", o = this.label ? `Växla ${this.label}` : "Växla", s = i;
|
|
187
245
|
if (this.trailing) if (this.trailingVariant === "icon") {
|
|
188
246
|
let e = this.trailingIcon || (this.type === "link" ? n : "");
|
|
189
|
-
s = e ? r`<div class="trailing"><
|
|
247
|
+
s = e ? r`<div class="trailing"><span class="material-icon" aria-hidden="true">${e}</span></div>` : i;
|
|
190
248
|
} else this.trailingVariant === "checkbox" ? s = r`
|
|
191
249
|
<div class="trailing">
|
|
192
250
|
<scb-checkbox
|
|
@@ -200,26 +258,33 @@ var s = class extends t {
|
|
|
200
258
|
label=${this.trailingSwitchLabel || i}
|
|
201
259
|
aria-label=${o}
|
|
202
260
|
@click=${(e) => e.stopPropagation()}
|
|
203
|
-
@change=${this
|
|
261
|
+
@change=${this.__onTrailingSwitchChange}
|
|
204
262
|
></scb-switch>
|
|
205
263
|
</div>`);
|
|
206
|
-
else this.type === "link" && (s = r`<div class="trailing"><
|
|
264
|
+
else this.type === "link" && (s = r`<div class="trailing"><span class="material-icon" aria-hidden="true">${n}</span></div>`);
|
|
207
265
|
let c = this.type === "link" && this.target === "_blank" ? "noopener noreferrer" : i, l = r`
|
|
208
266
|
${e}
|
|
209
267
|
<div class="texts">
|
|
210
268
|
${this.overline ? r`<div class="overline">${this.overline}</div>` : i}
|
|
211
|
-
<div class="label">${this.label}</div>
|
|
212
|
-
${this.supportingText ? r`<div class="supporting-text">${this.supportingText}</div>` : i}
|
|
269
|
+
<div class="label"><slot name="label">${this.label}</slot></div>
|
|
270
|
+
${this.supportingText || this.querySelector("[slot=\"supporting-text\"]") ? r`<div class="supporting-text"><slot name="supporting-text">${this.supportingText}</slot></div>` : i}
|
|
213
271
|
</div>
|
|
214
272
|
${s}
|
|
215
273
|
`;
|
|
216
274
|
return r`
|
|
217
|
-
<div
|
|
275
|
+
<div
|
|
276
|
+
class="row"
|
|
277
|
+
@click=${this.onRowClick}
|
|
278
|
+
@pointerenter=${this.type === "link" ? this.__onPointerInteraction : null}
|
|
279
|
+
@pointerdown=${this.type === "link" ? this.__onPointerInteraction : null}
|
|
280
|
+
?inert=${this.disabled}
|
|
281
|
+
aria-disabled=${this.disabled ? "true" : "false"}
|
|
282
|
+
>
|
|
218
283
|
${this.type === "link" && t ? r`<a class="link" href=${t} target=${this.target || i} rel=${c}>${l}</a>` : l}
|
|
219
|
-
${this.type === "link" ? r`<md-ripple></md-ripple>` : i}
|
|
284
|
+
${this.type === "link" && this.__rippleLoaded ? r`<md-ripple></md-ripple>` : i}
|
|
220
285
|
</div>
|
|
221
286
|
|
|
222
|
-
|
|
287
|
+
${this.__focusRingLoaded ? r`<md-focus-ring></md-focus-ring>` : i}
|
|
223
288
|
`;
|
|
224
289
|
}
|
|
225
290
|
};
|
|
@@ -227,71 +292,71 @@ e([o({
|
|
|
227
292
|
type: String,
|
|
228
293
|
reflect: !0,
|
|
229
294
|
attribute: "type"
|
|
230
|
-
})],
|
|
295
|
+
})], d.prototype, "type", void 0), e([o({ type: String })], d.prototype, "href", void 0), e([o({
|
|
231
296
|
type: String,
|
|
232
297
|
attribute: "item-href"
|
|
233
|
-
})],
|
|
298
|
+
})], d.prototype, "itemHref", void 0), e([o({
|
|
234
299
|
type: String,
|
|
235
300
|
attribute: "target"
|
|
236
|
-
})],
|
|
301
|
+
})], d.prototype, "target", void 0), e([o({
|
|
237
302
|
type: Boolean,
|
|
238
303
|
attribute: "disabled"
|
|
239
|
-
})],
|
|
304
|
+
})], d.prototype, "disabled", void 0), e([o({
|
|
240
305
|
type: String,
|
|
241
306
|
reflect: !0
|
|
242
|
-
})],
|
|
307
|
+
})], d.prototype, "label", void 0), e([o({
|
|
243
308
|
type: String,
|
|
244
309
|
attribute: "supporting-text"
|
|
245
|
-
})],
|
|
310
|
+
})], d.prototype, "supportingText", void 0), e([o({
|
|
246
311
|
type: String,
|
|
247
312
|
attribute: "overline"
|
|
248
|
-
})],
|
|
313
|
+
})], d.prototype, "overline", void 0), e([o({ type: Boolean })], d.prototype, "leading", void 0), e([o({
|
|
249
314
|
type: String,
|
|
250
315
|
attribute: "leading-variant",
|
|
251
316
|
reflect: !0
|
|
252
|
-
})],
|
|
317
|
+
})], d.prototype, "leadingVariant", void 0), e([o({
|
|
253
318
|
type: String,
|
|
254
319
|
attribute: "leading-icon"
|
|
255
|
-
})],
|
|
320
|
+
})], d.prototype, "leadingIcon", void 0), e([o({
|
|
256
321
|
type: String,
|
|
257
322
|
attribute: "avatar-label"
|
|
258
|
-
})],
|
|
323
|
+
})], d.prototype, "avatarLabel", void 0), e([o({
|
|
259
324
|
type: String,
|
|
260
325
|
attribute: "avatar-alt"
|
|
261
|
-
})],
|
|
326
|
+
})], d.prototype, "avatarAlt", void 0), e([o({
|
|
262
327
|
type: String,
|
|
263
328
|
attribute: "avatar-variant"
|
|
264
|
-
})],
|
|
329
|
+
})], d.prototype, "avatarVariant", void 0), e([o({
|
|
265
330
|
type: String,
|
|
266
331
|
attribute: "avatar-src"
|
|
267
|
-
})],
|
|
332
|
+
})], d.prototype, "avatarSrc", void 0), e([o({
|
|
268
333
|
type: String,
|
|
269
334
|
reflect: !0,
|
|
270
335
|
attribute: "img-href-image"
|
|
271
|
-
})],
|
|
336
|
+
})], d.prototype, "imgHrefImage", void 0), e([o({ type: Boolean })], d.prototype, "trailing", void 0), e([o({
|
|
272
337
|
type: String,
|
|
273
338
|
attribute: "trailing-variant",
|
|
274
339
|
reflect: !0
|
|
275
|
-
})],
|
|
340
|
+
})], d.prototype, "trailingVariant", void 0), e([o({
|
|
276
341
|
type: String,
|
|
277
342
|
attribute: "trailing-icon"
|
|
278
|
-
})],
|
|
343
|
+
})], d.prototype, "trailingIcon", void 0), e([o({
|
|
279
344
|
type: String,
|
|
280
345
|
attribute: "trailing-switch-label"
|
|
281
|
-
})],
|
|
346
|
+
})], d.prototype, "trailingSwitchLabel", void 0), e([o({
|
|
282
347
|
type: String,
|
|
283
348
|
attribute: "trailing-switch-width"
|
|
284
|
-
})],
|
|
349
|
+
})], d.prototype, "trailingSwitchWidth", void 0), e([o({
|
|
285
350
|
type: Boolean,
|
|
286
351
|
attribute: "trailing-switch-selected",
|
|
287
352
|
reflect: !0
|
|
288
|
-
})],
|
|
353
|
+
})], d.prototype, "trailingSwitchSelected", void 0), e([o({
|
|
289
354
|
type: Number,
|
|
290
355
|
reflect: !0
|
|
291
|
-
})],
|
|
356
|
+
})], d.prototype, "density", void 0), e([o({
|
|
292
357
|
type: Boolean,
|
|
293
358
|
attribute: "no-divider",
|
|
294
359
|
reflect: !0
|
|
295
|
-
})],
|
|
360
|
+
})], d.prototype, "noDivider", void 0), d = e([a("scb-list-item")], d);
|
|
296
361
|
//#endregion
|
|
297
|
-
export {
|
|
362
|
+
export { d as ScbListItem };
|
package/scb-list/scb-list.js
CHANGED
|
@@ -5,11 +5,10 @@ import { customElement as i, property as a, query as o } from "lit/decorators.js
|
|
|
5
5
|
//#region src/scb-components/scb-list/scb-list.ts
|
|
6
6
|
var s = class extends t {
|
|
7
7
|
constructor(...e) {
|
|
8
|
-
super(...e), this
|
|
8
|
+
super(...e), this.noDivider = !1, this.spacing = void 0, this.spacingTop = void 0, this.spacingBottom = void 0, this.spacingLeft = void 0, this.spacingRight = void 0, this._onSlotChange = () => this._setupItems();
|
|
9
9
|
}
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
this.#e ||= (await import("@material/web/list/list.js"), !0), this._setupItems(), this._applySpacing();
|
|
10
|
+
firstUpdated() {
|
|
11
|
+
this._setupItems(), this._applySpacing();
|
|
13
12
|
}
|
|
14
13
|
updated(e) {
|
|
15
14
|
super.updated(e), (e.has("spacing") || e.has("spacingTop") || e.has("spacingBottom") || e.has("spacingLeft") || e.has("spacingRight")) && this._applySpacing();
|
|
@@ -21,7 +20,7 @@ var s = class extends t {
|
|
|
21
20
|
this._getItems().forEach((e, t) => {
|
|
22
21
|
e.hasAttribute("role") || e.setAttribute("role", "listitem"), e.setAttribute("tabindex", t === 0 ? "0" : "-1");
|
|
23
22
|
});
|
|
24
|
-
let e = this.renderRoot?.querySelector("
|
|
23
|
+
let e = this.renderRoot?.querySelector(".list");
|
|
25
24
|
e && !e.hasAttribute("data-kbd") && (e.setAttribute("data-kbd", "true"), e.addEventListener("keydown", (e) => this._onKeyDown(e)));
|
|
26
25
|
}
|
|
27
26
|
_onKeyDown(e) {
|
|
@@ -67,8 +66,9 @@ var s = class extends t {
|
|
|
67
66
|
--scb-list-bg: transparent;
|
|
68
67
|
}
|
|
69
68
|
|
|
70
|
-
|
|
69
|
+
.list {
|
|
71
70
|
background: var(--scb-list-bg);
|
|
71
|
+
padding-block: var(--scb-list-container-padding-block, 8px);
|
|
72
72
|
}
|
|
73
73
|
|
|
74
74
|
/* Visa top-border på första raden endast när listan saknar no-divider
|
|
@@ -85,9 +85,9 @@ var s = class extends t {
|
|
|
85
85
|
}
|
|
86
86
|
render() {
|
|
87
87
|
return r`
|
|
88
|
-
<
|
|
89
|
-
<slot></slot>
|
|
90
|
-
</
|
|
88
|
+
<div class="list" role="list">
|
|
89
|
+
<slot @slotchange=${this._onSlotChange}></slot>
|
|
90
|
+
</div>
|
|
91
91
|
`;
|
|
92
92
|
}
|
|
93
93
|
};
|