scb-wc-test 0.1.105 → 0.1.107
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/mvc/components/scb-accordion/scb-accordion.js +8 -2
- package/mvc/components/scb-avatar/scb-avatar.js +19 -10
- package/mvc/components/scb-breadcrumb/scb-breadcrumb-item.js +2 -3
- package/mvc/components/scb-breadcrumb/scb-breadcrumb.js +13 -7
- package/mvc/components/scb-button/scb-button.js +34 -32
- package/mvc/components/scb-calendar-card/scb-calendar-card.js +13 -11
- package/mvc/components/scb-card/scb-card.js +44 -41
- package/mvc/components/scb-checkbox/scb-checkbox-group.js +15 -13
- package/mvc/components/scb-checkbox/scb-checkbox.js +6 -6
- package/mvc/components/scb-chip/scb-chip.js +27 -7
- package/mvc/components/scb-divider/scb-divider.js +41 -15
- package/mvc/components/scb-fact-card/scb-fact-card.js +37 -18
- package/mvc/components/scb-horizontal-scroller/scb-horizontal-scroller.js +71 -43
- package/mvc/components/scb-icon-button/scb-icon-button.js +16 -10
- package/mvc/components/scb-keyfigure-card/scb-keyfigure-card.js +6 -4
- package/mvc/components/scb-list/scb-list.js +3 -3
- package/mvc/components/scb-notification-card/scb-notification-card.js +5 -5
- package/mvc/components/scb-pagination/scb-pagination.js +165 -107
- package/mvc/components/scb-radio-button/scb-radio-group.js +22 -11
- package/mvc/components/scb-search/scb-search.js +84 -32
- package/mvc/components/scb-segmented-button/scb-segmented-button.js +15 -13
- package/mvc/components/scb-status-pill/scb-status-pill.js +17 -13
- package/mvc/components/scb-stepper/scb-stepper.js +32 -29
- package/mvc/components/scb-switch/scb-switch.js +11 -8
- package/mvc/components/scb-tabs/scb-tabs.js +22 -19
- package/mvc/components/scb-textfield/scb-textfield.js +14 -10
- package/mvc/components/scb-toc/scb-toc.js +6 -3
- package/mvc/components/scb-viz/scb-viz.js +188 -178
- package/package.json +2 -2
- package/scb-accordion/scb-accordion.d.ts +13 -0
- package/scb-accordion/scb-accordion.js +53 -21
- package/scb-avatar/scb-avatar.d.ts +6 -0
- package/scb-avatar/scb-avatar.js +96 -61
- package/scb-breadcrumb/scb-breadcrumb-item.js +8 -9
- package/scb-breadcrumb/scb-breadcrumb.d.ts +6 -0
- package/scb-breadcrumb/scb-breadcrumb.js +61 -30
- package/scb-button/scb-button.d.ts +10 -0
- package/scb-button/scb-button.js +89 -65
- package/scb-calendar-card/scb-calendar-card.d.ts +5 -0
- package/scb-calendar-card/scb-calendar-card.js +79 -55
- package/scb-card/scb-card.d.ts +5 -0
- package/scb-card/scb-card.js +165 -140
- package/scb-checkbox/scb-checkbox-group.d.ts +3 -1
- package/scb-checkbox/scb-checkbox-group.js +59 -40
- package/scb-checkbox/scb-checkbox.d.ts +11 -0
- package/scb-checkbox/scb-checkbox.js +78 -56
- package/scb-chip/scb-chip.d.ts +24 -0
- package/scb-chip/scb-chip.js +137 -65
- package/scb-divider/scb-divider.d.ts +14 -0
- package/scb-divider/scb-divider.js +91 -43
- package/scb-fact-card/scb-fact-card.d.ts +10 -0
- package/scb-fact-card/scb-fact-card.js +135 -94
- package/scb-horizontal-scroller/scb-horizontal-scroller.d.ts +10 -0
- package/scb-horizontal-scroller/scb-horizontal-scroller.js +179 -120
- package/scb-icon-button/scb-icon-button.d.ts +10 -1
- package/scb-icon-button/scb-icon-button.js +88 -59
- package/scb-keyfigure-card/scb-keyfigure-card.d.ts +10 -0
- package/scb-keyfigure-card/scb-keyfigure-card.js +76 -52
- package/scb-list/scb-list.d.ts +7 -1
- package/scb-list/scb-list.js +62 -40
- package/scb-notification-card/scb-notification-card.d.ts +5 -0
- package/scb-notification-card/scb-notification-card.js +56 -39
- package/scb-pagination/scb-pagination.d.ts +12 -1
- package/scb-pagination/scb-pagination.js +235 -147
- package/scb-radio-button/scb-radio-group.d.ts +14 -3
- package/scb-radio-button/scb-radio-group.js +120 -67
- package/scb-search/scb-search.d.ts +15 -2
- package/scb-search/scb-search.js +152 -69
- package/scb-segmented-button/scb-segmented-button.d.ts +45 -4
- package/scb-segmented-button/scb-segmented-button.js +163 -72
- package/scb-status-pill/scb-status-pill.d.ts +12 -1
- package/scb-status-pill/scb-status-pill.js +51 -27
- package/scb-stepper/scb-stepper.d.ts +11 -3
- package/scb-stepper/scb-stepper.js +134 -101
- package/scb-switch/scb-switch.d.ts +21 -2
- package/scb-switch/scb-switch.js +97 -45
- package/scb-tabs/scb-tabs.d.ts +8 -0
- package/scb-tabs/scb-tabs.js +74 -44
- package/scb-textfield/scb-textfield.d.ts +7 -0
- package/scb-textfield/scb-textfield.js +43 -16
- package/scb-toc/scb-toc.d.ts +10 -1
- package/scb-toc/scb-toc.js +49 -18
- package/scb-viz/scb-viz.d.ts +10 -3
- package/scb-viz/scb-viz.js +278 -236
- package/scb-wc-test.bundle.js +1184 -901
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "scb-wc-test",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.107",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"module": "index.js",
|
|
@@ -337,5 +337,5 @@
|
|
|
337
337
|
},
|
|
338
338
|
"./mvc/*": "./mvc/*"
|
|
339
339
|
},
|
|
340
|
-
"buildHash": "
|
|
340
|
+
"buildHash": "9C8FDE229A6A7627895483B4195C5836D7D6E708679AC92B7306C433AB2EB029"
|
|
341
341
|
}
|
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
import { LitElement, TemplateResult } from 'lit';
|
|
2
2
|
export declare class ScbAccordion extends LitElement {
|
|
3
|
+
#private;
|
|
3
4
|
detached: boolean;
|
|
5
|
+
spacing: string;
|
|
6
|
+
spacingTop: string;
|
|
7
|
+
spacingBottom: string;
|
|
8
|
+
static styles: import('lit').CSSResult;
|
|
4
9
|
render(): TemplateResult;
|
|
10
|
+
protected firstUpdated(): void;
|
|
11
|
+
protected updated(changed: Map<string, unknown>): void;
|
|
12
|
+
private mapSpacingToken;
|
|
13
|
+
}
|
|
14
|
+
declare global {
|
|
15
|
+
interface HTMLElementTagNameMap {
|
|
16
|
+
'scb-accordion': ScbAccordion;
|
|
17
|
+
}
|
|
5
18
|
}
|
|
@@ -1,33 +1,65 @@
|
|
|
1
|
-
import { LitElement as
|
|
2
|
-
import { property as
|
|
1
|
+
import { css as m, LitElement as v, html as b } from "lit";
|
|
2
|
+
import { property as n, customElement as f } from "lit/decorators.js";
|
|
3
3
|
import "./scb-accordion-item.js";
|
|
4
|
-
var
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
4
|
+
var y = Object.defineProperty, u = Object.getOwnPropertyDescriptor, g = (t) => {
|
|
5
|
+
throw TypeError(t);
|
|
6
|
+
}, c = (t, e, s, a) => {
|
|
7
|
+
for (var o = a > 1 ? void 0 : a ? u(e, s) : e, p = t.length - 1, l; p >= 0; p--)
|
|
8
|
+
(l = t[p]) && (o = (a ? l(e, s, o) : l(o)) || o);
|
|
9
|
+
return a && o && y(e, s, o), o;
|
|
10
|
+
}, _ = (t, e, s) => e.has(t) || g("Cannot " + s), S = (t, e, s) => e.has(t) ? g("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, s), h = (t, e, s) => (_(t, e, "access private method"), s), i, d;
|
|
11
|
+
let r = class extends v {
|
|
10
12
|
constructor() {
|
|
11
|
-
super(...arguments), this.detached = !1;
|
|
13
|
+
super(...arguments), S(this, i), this.detached = !1, this.spacing = "", this.spacingTop = "", this.spacingBottom = "";
|
|
12
14
|
}
|
|
13
|
-
/*
|
|
14
|
-
Renderar containern och slottar in alla scb-accordion-item.
|
|
15
|
-
Sätter attributet `detached` på wrappern om relevant.
|
|
16
|
-
*/
|
|
17
15
|
render() {
|
|
18
|
-
return
|
|
16
|
+
return b`
|
|
19
17
|
<div class="scb-accordion" ?detached=${this.detached}>
|
|
20
18
|
<slot></slot>
|
|
21
19
|
</div>
|
|
22
20
|
`;
|
|
23
21
|
}
|
|
22
|
+
firstUpdated() {
|
|
23
|
+
h(this, i, d).call(this);
|
|
24
|
+
}
|
|
25
|
+
updated(t) {
|
|
26
|
+
(t.has("spacing") || t.has("spacingTop") || t.has("spacingBottom")) && h(this, i, d).call(this);
|
|
27
|
+
}
|
|
28
|
+
// Mappar spacing-värden till tokens eller fria CSS-värden.
|
|
29
|
+
mapSpacingToken(t) {
|
|
30
|
+
if (!t) return;
|
|
31
|
+
const e = String(t).trim();
|
|
32
|
+
if (e)
|
|
33
|
+
return /^\d+$/.test(e) ? `var(--spacing-${Math.max(0, Math.min(14, parseInt(e, 10)))})` : e;
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
i = /* @__PURE__ */ new WeakSet();
|
|
37
|
+
d = function() {
|
|
38
|
+
const t = this.mapSpacingToken(this.spacing), e = this.mapSpacingToken(this.spacingTop) ?? t, s = this.mapSpacingToken(this.spacingBottom) ?? t;
|
|
39
|
+
e ? this.style.setProperty("--scb-accordion-spacing-block-start", e) : this.style.removeProperty("--scb-accordion-spacing-block-start"), s ? this.style.setProperty("--scb-accordion-spacing-block-end", s) : this.style.removeProperty("--scb-accordion-spacing-block-end");
|
|
24
40
|
};
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
41
|
+
r.styles = m`
|
|
42
|
+
:host {
|
|
43
|
+
display: block;
|
|
44
|
+
margin-block-start: var(--scb-accordion-spacing-block-start, 0);
|
|
45
|
+
margin-block-end: var(--scb-accordion-spacing-block-end, 0);
|
|
46
|
+
}
|
|
47
|
+
`;
|
|
48
|
+
c([
|
|
49
|
+
n({ type: Boolean, reflect: !0 })
|
|
50
|
+
], r.prototype, "detached", 2);
|
|
51
|
+
c([
|
|
52
|
+
n({ type: String, reflect: !0 })
|
|
53
|
+
], r.prototype, "spacing", 2);
|
|
54
|
+
c([
|
|
55
|
+
n({ type: String, attribute: "spacing-top", reflect: !0 })
|
|
56
|
+
], r.prototype, "spacingTop", 2);
|
|
57
|
+
c([
|
|
58
|
+
n({ type: String, attribute: "spacing-bottom", reflect: !0 })
|
|
59
|
+
], r.prototype, "spacingBottom", 2);
|
|
60
|
+
r = c([
|
|
61
|
+
f("scb-accordion")
|
|
62
|
+
], r);
|
|
31
63
|
export {
|
|
32
|
-
|
|
64
|
+
r as ScbAccordion
|
|
33
65
|
};
|
|
@@ -3,6 +3,7 @@ type AvatarSize = 'small' | 'medium' | 'large';
|
|
|
3
3
|
type AvatarShape = 'circular' | 'rounded' | 'square';
|
|
4
4
|
type AvatarVariant = 'image' | 'icon';
|
|
5
5
|
export declare class ScbAvatar extends LitElement {
|
|
6
|
+
#private;
|
|
6
7
|
src: string;
|
|
7
8
|
alt: string;
|
|
8
9
|
label: string;
|
|
@@ -10,6 +11,9 @@ export declare class ScbAvatar extends LitElement {
|
|
|
10
11
|
shape: AvatarShape;
|
|
11
12
|
iconName: string;
|
|
12
13
|
variant: AvatarVariant;
|
|
14
|
+
spacing: string;
|
|
15
|
+
spacingTop: string;
|
|
16
|
+
spacingBottom: string;
|
|
13
17
|
private _imgError;
|
|
14
18
|
private _hasIconSlot;
|
|
15
19
|
static styles: import('lit').CSSResult;
|
|
@@ -17,8 +21,10 @@ export declare class ScbAvatar extends LitElement {
|
|
|
17
21
|
private _onImgError;
|
|
18
22
|
private _onIconSlotChange;
|
|
19
23
|
protected firstUpdated(): Promise<void>;
|
|
24
|
+
protected updated(changed: Map<string, unknown>): void;
|
|
20
25
|
private _initials;
|
|
21
26
|
private _ariaLabel;
|
|
27
|
+
private mapSpacingToken;
|
|
22
28
|
render(): TemplateResult;
|
|
23
29
|
}
|
|
24
30
|
declare global {
|
package/scb-avatar/scb-avatar.js
CHANGED
|
@@ -1,56 +1,82 @@
|
|
|
1
|
-
import { css as
|
|
2
|
-
import { property as
|
|
3
|
-
var
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
import { css as _, LitElement as f, nothing as l, html as n } from "lit";
|
|
2
|
+
import { property as r, state as v, customElement as b } from "lit/decorators.js";
|
|
3
|
+
var y = Object.defineProperty, z = Object.getOwnPropertyDescriptor, u = (t) => {
|
|
4
|
+
throw TypeError(t);
|
|
5
|
+
}, s = (t, i, e, o) => {
|
|
6
|
+
for (var c = o > 1 ? void 0 : o ? z(i, e) : i, h = t.length - 1, m; h >= 0; h--)
|
|
7
|
+
(m = t[h]) && (c = (o ? m(i, e, c) : m(c)) || c);
|
|
8
|
+
return o && c && y(i, e, c), c;
|
|
9
|
+
}, S = (t, i, e) => i.has(t) || u("Cannot " + e), k = (t, i, e) => i.has(t) ? u("Cannot add the same private member more than once") : i instanceof WeakSet ? i.add(t) : i.set(t, e), g = (t, i, e) => (S(t, i, "access private method"), e), p, d;
|
|
10
|
+
let a = class extends f {
|
|
9
11
|
constructor() {
|
|
10
|
-
super(...arguments), this.src = "", this.alt = "", this.label = "", this.size = "medium", this.shape = "circular", this.iconName = "", this.variant = "image", this._imgError = !1, this._hasIconSlot = !1, this._onImgLoad = () => {
|
|
12
|
+
super(...arguments), k(this, p), this.src = "", this.alt = "", this.label = "", this.size = "medium", this.shape = "circular", this.iconName = "", this.variant = "image", this.spacing = "", this.spacingTop = "", this.spacingBottom = "", this._imgError = !1, this._hasIconSlot = !1, this._onImgLoad = () => {
|
|
11
13
|
this._imgError = !1, this.dispatchEvent(new CustomEvent("image-load", { bubbles: !0, composed: !0 }));
|
|
12
14
|
}, this._onImgError = () => {
|
|
13
15
|
this._imgError = !0, this.dispatchEvent(new CustomEvent("image-error", { bubbles: !0, composed: !0 }));
|
|
14
|
-
}, this._onIconSlotChange = (
|
|
15
|
-
const
|
|
16
|
-
this._hasIconSlot = (
|
|
16
|
+
}, this._onIconSlotChange = (t) => {
|
|
17
|
+
const i = t.currentTarget;
|
|
18
|
+
this._hasIconSlot = (i.assignedNodes({ flatten: !0 }) || []).length > 0;
|
|
17
19
|
};
|
|
18
20
|
}
|
|
19
21
|
async firstUpdated() {
|
|
20
|
-
this.variant === "icon" && await import("@material/web/icon/icon.js");
|
|
22
|
+
this.variant === "icon" && await import("@material/web/icon/icon.js"), g(this, p, d).call(this);
|
|
23
|
+
}
|
|
24
|
+
updated(t) {
|
|
25
|
+
super.updated(t), t.has("variant") && this.variant === "icon" && import("@material/web/icon/icon.js"), (t.has("spacing") || t.has("spacingTop") || t.has("spacingBottom")) && g(this, p, d).call(this);
|
|
21
26
|
}
|
|
22
27
|
_initials() {
|
|
23
|
-
const
|
|
24
|
-
if (!
|
|
25
|
-
const
|
|
26
|
-
if (
|
|
27
|
-
const
|
|
28
|
-
return (
|
|
28
|
+
const t = (this.label || this.alt || "").trim();
|
|
29
|
+
if (!t) return "?";
|
|
30
|
+
const i = t.split(/\s+/).filter(Boolean);
|
|
31
|
+
if (i.length === 1) return i[0].slice(0, 1).toUpperCase();
|
|
32
|
+
const e = i[0].slice(0, 1), o = i[i.length - 1].slice(0, 1);
|
|
33
|
+
return (e + o).toUpperCase();
|
|
29
34
|
}
|
|
30
35
|
_ariaLabel() {
|
|
31
|
-
const
|
|
32
|
-
return
|
|
36
|
+
const t = (this.label || this.alt || "").trim();
|
|
37
|
+
return t || null;
|
|
38
|
+
}
|
|
39
|
+
// Mappar spacing-värden till spacing-token eller fritt css-värde.
|
|
40
|
+
mapSpacingToken(t) {
|
|
41
|
+
if (!t) return;
|
|
42
|
+
const i = String(t).trim();
|
|
43
|
+
if (i)
|
|
44
|
+
return /^\d+$/.test(i) ? `var(--spacing-${Math.max(0, Math.min(14, parseInt(i, 10)))})` : i;
|
|
33
45
|
}
|
|
34
46
|
render() {
|
|
35
|
-
const
|
|
47
|
+
const t = this._ariaLabel(), i = this.variant === "image" && !!this.src && !this._imgError, e = n`${l}
|
|
36
48
|
<slot name="icon" @slotchange=${this._onIconSlotChange}></slot>
|
|
37
|
-
${this._hasIconSlot ?
|
|
38
|
-
`,
|
|
39
|
-
|
|
49
|
+
${this._hasIconSlot ? l : this.iconName ? n`<md-icon aria-hidden="true">${this.iconName}</md-icon>` : n`<div class="fallback" part="fallback">${this._initials()}</div>`}
|
|
50
|
+
`, o = i ? n`<img
|
|
51
|
+
class="photo"
|
|
52
|
+
part="image"
|
|
53
|
+
src=${this.src}
|
|
54
|
+
alt=${this.alt}
|
|
55
|
+
@load=${this._onImgLoad}
|
|
56
|
+
@error=${this._onImgError}
|
|
57
|
+
/>` : n`
|
|
40
58
|
<slot name="icon" @slotchange=${this._onIconSlotChange}></slot>
|
|
41
|
-
${this._hasIconSlot ?
|
|
59
|
+
${this._hasIconSlot ? l : this.iconName ? n`<md-icon aria-hidden="true">${this.iconName}</md-icon>` : n`<div class="fallback" part="fallback">${this._initials()}</div>`}
|
|
42
60
|
`;
|
|
43
|
-
return
|
|
44
|
-
<div class="container" part="container" role="img" aria-label=${
|
|
45
|
-
${this.variant === "icon" ?
|
|
61
|
+
return n`
|
|
62
|
+
<div class="container" part="container" role="img" aria-label=${t ?? l}>
|
|
63
|
+
${this.variant === "icon" ? e : o}
|
|
46
64
|
</div>
|
|
47
65
|
`;
|
|
48
66
|
}
|
|
49
67
|
};
|
|
50
|
-
|
|
68
|
+
p = /* @__PURE__ */ new WeakSet();
|
|
69
|
+
d = function() {
|
|
70
|
+
const t = this.mapSpacingToken(this.spacing), i = this.mapSpacingToken(this.spacingTop) ?? t, e = this.mapSpacingToken(this.spacingBottom) ?? t;
|
|
71
|
+
i ? this.style.setProperty("--scb-avatar-spacing-block-start", i) : this.style.removeProperty("--scb-avatar-spacing-block-start"), e ? this.style.setProperty("--scb-avatar-spacing-block-end", e) : this.style.removeProperty("--scb-avatar-spacing-block-end");
|
|
72
|
+
};
|
|
73
|
+
a.styles = _`
|
|
51
74
|
:host {
|
|
52
75
|
display: inline-block;
|
|
53
76
|
vertical-align: middle;
|
|
77
|
+
margin-block-start: var(--scb-avatar-spacing-block-start, 0);
|
|
78
|
+
margin-block-end: var(--scb-avatar-spacing-block-end, 0);
|
|
79
|
+
|
|
54
80
|
--_size: 40px;
|
|
55
81
|
--_font-size: 16px;
|
|
56
82
|
--_bg: var(--md-sys-color-primary-fixed-dim, var(--md-sys-color-primary-container));
|
|
@@ -134,36 +160,45 @@ e.styles = d`
|
|
|
134
160
|
border-radius: var(--_radius);
|
|
135
161
|
}
|
|
136
162
|
`;
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
],
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
],
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
],
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
],
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
],
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
],
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
],
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
],
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
],
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
],
|
|
163
|
+
s([
|
|
164
|
+
r({ type: String })
|
|
165
|
+
], a.prototype, "src", 2);
|
|
166
|
+
s([
|
|
167
|
+
r({ type: String })
|
|
168
|
+
], a.prototype, "alt", 2);
|
|
169
|
+
s([
|
|
170
|
+
r({ type: String })
|
|
171
|
+
], a.prototype, "label", 2);
|
|
172
|
+
s([
|
|
173
|
+
r({ type: String, reflect: !0 })
|
|
174
|
+
], a.prototype, "size", 2);
|
|
175
|
+
s([
|
|
176
|
+
r({ type: String, reflect: !0 })
|
|
177
|
+
], a.prototype, "shape", 2);
|
|
178
|
+
s([
|
|
179
|
+
r({ type: String, attribute: "icon-name", reflect: !0 })
|
|
180
|
+
], a.prototype, "iconName", 2);
|
|
181
|
+
s([
|
|
182
|
+
r({ type: String, reflect: !0 })
|
|
183
|
+
], a.prototype, "variant", 2);
|
|
184
|
+
s([
|
|
185
|
+
r({ type: String, reflect: !0 })
|
|
186
|
+
], a.prototype, "spacing", 2);
|
|
187
|
+
s([
|
|
188
|
+
r({ type: String, attribute: "spacing-top", reflect: !0 })
|
|
189
|
+
], a.prototype, "spacingTop", 2);
|
|
190
|
+
s([
|
|
191
|
+
r({ type: String, attribute: "spacing-bottom", reflect: !0 })
|
|
192
|
+
], a.prototype, "spacingBottom", 2);
|
|
193
|
+
s([
|
|
194
|
+
v()
|
|
195
|
+
], a.prototype, "_imgError", 2);
|
|
196
|
+
s([
|
|
197
|
+
v()
|
|
198
|
+
], a.prototype, "_hasIconSlot", 2);
|
|
199
|
+
a = s([
|
|
200
|
+
b("scb-avatar")
|
|
201
|
+
], a);
|
|
167
202
|
export {
|
|
168
|
-
|
|
203
|
+
a as ScbAvatar
|
|
169
204
|
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { LitElement as p, css as b, html as l } from "lit";
|
|
2
|
-
import { property as
|
|
2
|
+
import { property as o, customElement as m } from "lit/decorators.js";
|
|
3
3
|
import "../scb-link/scb-link.js";
|
|
4
|
-
var
|
|
5
|
-
for (var r = a > 1 ? void 0 : a ?
|
|
6
|
-
(
|
|
7
|
-
return a && r &&
|
|
4
|
+
var f = Object.defineProperty, h = Object.getOwnPropertyDescriptor, n = (t, s, c, a) => {
|
|
5
|
+
for (var r = a > 1 ? void 0 : a ? h(s, c) : s, i = t.length - 1, u; i >= 0; i--)
|
|
6
|
+
(u = t[i]) && (r = (a ? u(s, c, r) : u(r)) || r);
|
|
7
|
+
return a && r && f(s, c, r), r;
|
|
8
8
|
};
|
|
9
9
|
let e = class extends p {
|
|
10
10
|
constructor() {
|
|
@@ -19,7 +19,6 @@ let e = class extends p {
|
|
|
19
19
|
|
|
20
20
|
.breadcrumb-current {
|
|
21
21
|
color: var(--md-sys-color-on-surface);
|
|
22
|
-
font-weight: var(--weight-semibold);
|
|
23
22
|
font-family: var(--brand, Inter);
|
|
24
23
|
}
|
|
25
24
|
`;
|
|
@@ -47,13 +46,13 @@ let e = class extends p {
|
|
|
47
46
|
}
|
|
48
47
|
};
|
|
49
48
|
n([
|
|
50
|
-
|
|
49
|
+
o({ type: String })
|
|
51
50
|
], e.prototype, "label", 2);
|
|
52
51
|
n([
|
|
53
|
-
|
|
52
|
+
o({ type: Boolean, attribute: "is-current", reflect: !0 })
|
|
54
53
|
], e.prototype, "isCurrent", 2);
|
|
55
54
|
n([
|
|
56
|
-
|
|
55
|
+
o({ type: String, attribute: "item-href" })
|
|
57
56
|
], e.prototype, "href", 2);
|
|
58
57
|
e = n([
|
|
59
58
|
m("scb-breadcrumb-item")
|
|
@@ -1,11 +1,17 @@
|
|
|
1
1
|
import { LitElement, TemplateResult } from 'lit';
|
|
2
2
|
export declare class SCBBreadcrumb extends LitElement {
|
|
3
|
+
#private;
|
|
3
4
|
showAll: boolean;
|
|
5
|
+
spacing: string;
|
|
6
|
+
spacingTop: string;
|
|
7
|
+
spacingBottom: string;
|
|
4
8
|
private _observer?;
|
|
5
9
|
static get styles(): import('lit').CSSResult;
|
|
6
10
|
connectedCallback(): void;
|
|
7
11
|
disconnectedCallback(): void;
|
|
12
|
+
protected firstUpdated(): void;
|
|
8
13
|
protected updated(changed: Map<string, unknown>): void;
|
|
14
|
+
private mapSpacingToken;
|
|
9
15
|
private _onEllipsisClick;
|
|
10
16
|
render(): TemplateResult;
|
|
11
17
|
}
|
|
@@ -1,19 +1,27 @@
|
|
|
1
|
-
import { LitElement as
|
|
2
|
-
import { property as
|
|
1
|
+
import { LitElement as u, css as f, html as d } from "lit";
|
|
2
|
+
import { property as n, customElement as g } from "lit/decorators.js";
|
|
3
3
|
import "./scb-breadcrumb-item.js";
|
|
4
4
|
import "@material/web/icon/icon.js";
|
|
5
5
|
import "@material/web/focus/md-focus-ring.js";
|
|
6
|
-
var
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
6
|
+
var y = Object.defineProperty, v = Object.getOwnPropertyDescriptor, h = (e) => {
|
|
7
|
+
throw TypeError(e);
|
|
8
|
+
}, o = (e, t, s, a) => {
|
|
9
|
+
for (var r = a > 1 ? void 0 : a ? v(t, s) : t, l = e.length - 1, p; l >= 0; l--)
|
|
10
|
+
(p = e[l]) && (r = (a ? p(t, s, r) : p(r)) || r);
|
|
11
|
+
return a && r && y(t, s, r), r;
|
|
12
|
+
}, w = (e, t, s) => t.has(e) || h("Cannot " + s), k = (e, t, s) => t.has(e) ? h("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(e) : t.set(e, s), m = (e, t, s) => (w(e, t, "access private method"), s), c, b;
|
|
13
|
+
let i = class extends u {
|
|
12
14
|
constructor() {
|
|
13
|
-
super(...arguments), this.showAll = !1;
|
|
15
|
+
super(...arguments), k(this, c), this.showAll = !1, this.spacing = "", this.spacingTop = "", this.spacingBottom = "";
|
|
14
16
|
}
|
|
15
17
|
static get styles() {
|
|
16
|
-
return
|
|
18
|
+
return f`
|
|
19
|
+
:host {
|
|
20
|
+
display: block;
|
|
21
|
+
margin-block-start: var(--scb-breadcrumb-spacing-block-start, 0);
|
|
22
|
+
margin-block-end: var(--scb-breadcrumb-spacing-block-end, 0);
|
|
23
|
+
}
|
|
24
|
+
|
|
17
25
|
.scb-breadcrumb {
|
|
18
26
|
display: flex;
|
|
19
27
|
align-items: center;
|
|
@@ -92,6 +100,9 @@ let c = class extends d {
|
|
|
92
100
|
var e;
|
|
93
101
|
super.disconnectedCallback(), (e = this._observer) == null || e.disconnect();
|
|
94
102
|
}
|
|
103
|
+
firstUpdated() {
|
|
104
|
+
m(this, c, b).call(this);
|
|
105
|
+
}
|
|
95
106
|
// Sänd event när showAll förändras (för Blazor-bryggan: show-all-changed)
|
|
96
107
|
updated(e) {
|
|
97
108
|
e.has("showAll") && this.dispatchEvent(
|
|
@@ -100,16 +111,22 @@ let c = class extends d {
|
|
|
100
111
|
bubbles: !0,
|
|
101
112
|
composed: !0
|
|
102
113
|
})
|
|
103
|
-
);
|
|
114
|
+
), (e.has("spacing") || e.has("spacingTop") || e.has("spacingBottom")) && m(this, c, b).call(this);
|
|
115
|
+
}
|
|
116
|
+
mapSpacingToken(e) {
|
|
117
|
+
if (!e) return;
|
|
118
|
+
const t = String(e).trim();
|
|
119
|
+
if (t)
|
|
120
|
+
return /^\d+$/.test(t) ? `var(--spacing-${Math.max(0, Math.min(14, parseInt(t, 10)))})` : t;
|
|
104
121
|
}
|
|
105
122
|
_onEllipsisClick() {
|
|
106
123
|
this.showAll ? this.showAll = !1 : (this.showAll = !0, this.updateComplete.then(() => {
|
|
107
|
-
var
|
|
108
|
-
const e = (
|
|
124
|
+
var t;
|
|
125
|
+
const e = (t = this.shadowRoot) == null ? void 0 : t.querySelectorAll(
|
|
109
126
|
".scb-breadcrumb.expanded > scb-breadcrumb-item"
|
|
110
127
|
);
|
|
111
|
-
e && (e.forEach((s,
|
|
112
|
-
s.classList.add("breadcrumb-animate"), s.style.animationDelay = `${
|
|
128
|
+
e && (e.forEach((s, a) => {
|
|
129
|
+
s.classList.add("breadcrumb-animate"), s.style.animationDelay = `${a * 60}ms`;
|
|
113
130
|
}), setTimeout(() => {
|
|
114
131
|
e.forEach((s) => {
|
|
115
132
|
s.classList.remove("breadcrumb-animate"), s.style.animationDelay = "";
|
|
@@ -125,15 +142,15 @@ let c = class extends d {
|
|
|
125
142
|
(s) => s.tagName.toLowerCase() === "scb-breadcrumb-item"
|
|
126
143
|
)), e.length > 0) {
|
|
127
144
|
const s = e.length - 1;
|
|
128
|
-
e.forEach((
|
|
129
|
-
|
|
145
|
+
e.forEach((a, r) => {
|
|
146
|
+
a.toggleAttribute("is-current", r === s);
|
|
130
147
|
});
|
|
131
148
|
}
|
|
132
|
-
const
|
|
133
|
-
return
|
|
134
|
-
<div class="scb-breadcrumb ${
|
|
135
|
-
${
|
|
136
|
-
(s,
|
|
149
|
+
const t = e.length > 6 && !this.showAll;
|
|
150
|
+
return d`
|
|
151
|
+
<div class="scb-breadcrumb ${t ? "collapsed" : "expanded"}">
|
|
152
|
+
${t ? e.map(
|
|
153
|
+
(s, a) => a === 3 ? d`<span
|
|
137
154
|
class="ellipsis"
|
|
138
155
|
aria-label="Visa alla"
|
|
139
156
|
role="button"
|
|
@@ -149,18 +166,32 @@ let c = class extends d {
|
|
|
149
166
|
</md-icon>
|
|
150
167
|
</span>
|
|
151
168
|
<span class="breadcrumb-separator">/</span>
|
|
152
|
-
${s}` :
|
|
169
|
+
${s}` : d`${s}`
|
|
153
170
|
) : e.map((s) => s)}
|
|
154
171
|
</div>
|
|
155
172
|
`;
|
|
156
173
|
}
|
|
157
174
|
};
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
175
|
+
c = /* @__PURE__ */ new WeakSet();
|
|
176
|
+
b = function() {
|
|
177
|
+
const e = this.mapSpacingToken(this.spacing), t = this.mapSpacingToken(this.spacingTop) ?? e, s = this.mapSpacingToken(this.spacingBottom) ?? e;
|
|
178
|
+
t ? this.style.setProperty("--scb-breadcrumb-spacing-block-start", t) : this.style.removeProperty("--scb-breadcrumb-spacing-block-start"), s ? this.style.setProperty("--scb-breadcrumb-spacing-block-end", s) : this.style.removeProperty("--scb-breadcrumb-spacing-block-end");
|
|
179
|
+
};
|
|
180
|
+
o([
|
|
181
|
+
n({ type: Boolean, attribute: "show-all", reflect: !0 })
|
|
182
|
+
], i.prototype, "showAll", 2);
|
|
183
|
+
o([
|
|
184
|
+
n({ type: String, reflect: !0 })
|
|
185
|
+
], i.prototype, "spacing", 2);
|
|
186
|
+
o([
|
|
187
|
+
n({ type: String, attribute: "spacing-top", reflect: !0 })
|
|
188
|
+
], i.prototype, "spacingTop", 2);
|
|
189
|
+
o([
|
|
190
|
+
n({ type: String, attribute: "spacing-bottom", reflect: !0 })
|
|
191
|
+
], i.prototype, "spacingBottom", 2);
|
|
192
|
+
i = o([
|
|
193
|
+
g("scb-breadcrumb")
|
|
194
|
+
], i);
|
|
164
195
|
export {
|
|
165
|
-
|
|
196
|
+
i as SCBBreadcrumb
|
|
166
197
|
};
|
|
@@ -2,6 +2,7 @@ import { LitElement, TemplateResult } from 'lit';
|
|
|
2
2
|
/** "filled", "outlined", "filled-tonal" eller "text" */
|
|
3
3
|
export type ScbButtonVariant = 'filled' | 'outlined' | 'filled-tonal' | 'text';
|
|
4
4
|
export declare class ScbButton extends LitElement {
|
|
5
|
+
#private;
|
|
5
6
|
variant: ScbButtonVariant;
|
|
6
7
|
type: string;
|
|
7
8
|
label: string;
|
|
@@ -11,6 +12,9 @@ export declare class ScbButton extends LitElement {
|
|
|
11
12
|
href: string;
|
|
12
13
|
target: string;
|
|
13
14
|
rel: string;
|
|
15
|
+
spacing: string;
|
|
16
|
+
spacingTop: string;
|
|
17
|
+
spacingBottom: string;
|
|
14
18
|
private __ariaObserver?;
|
|
15
19
|
private __getMdHost;
|
|
16
20
|
private __getInnerNativeButton;
|
|
@@ -18,6 +22,12 @@ export declare class ScbButton extends LitElement {
|
|
|
18
22
|
protected firstUpdated(): void;
|
|
19
23
|
protected updated(changed: Map<string, unknown>): void;
|
|
20
24
|
disconnectedCallback(): void;
|
|
25
|
+
private mapSpacingToken;
|
|
21
26
|
static get styles(): import('lit').CSSResult;
|
|
22
27
|
render(): TemplateResult;
|
|
23
28
|
}
|
|
29
|
+
declare global {
|
|
30
|
+
interface HTMLElementTagNameMap {
|
|
31
|
+
'scb-button': ScbButton;
|
|
32
|
+
}
|
|
33
|
+
}
|