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
|
@@ -1,79 +1,127 @@
|
|
|
1
|
-
import { css as
|
|
2
|
-
import { property as
|
|
3
|
-
var
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
import { css as g, LitElement as b, html as y } from "lit";
|
|
2
|
+
import { property as s, customElement as u } from "lit/decorators.js";
|
|
3
|
+
var f = Object.defineProperty, m = Object.getOwnPropertyDescriptor, h = (r) => {
|
|
4
|
+
throw TypeError(r);
|
|
5
|
+
}, a = (r, e, t, o) => {
|
|
6
|
+
for (var n = o > 1 ? void 0 : o ? m(e, t) : e, l = r.length - 1, d; l >= 0; l--)
|
|
7
|
+
(d = r[l]) && (n = (o ? d(e, t, n) : d(n)) || n);
|
|
8
|
+
return o && n && f(e, t, n), n;
|
|
9
|
+
}, k = (r, e, t) => e.has(r) || h("Cannot " + t), _ = (r, e, t) => e.has(r) ? h("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(r) : e.set(r, t), p = (r, e, t) => (k(r, e, "access private method"), t), c, v;
|
|
10
|
+
let i = class extends b {
|
|
9
11
|
constructor() {
|
|
10
|
-
super(...arguments), this.variant = "thin", this.direction = "horizontal", this.inset = "none", this.overlay = !1, this.anchor = "end";
|
|
12
|
+
super(...arguments), _(this, c), this.variant = "thin", this.direction = "horizontal", this.inset = "none", this.overlay = !1, this.anchor = "end", this.spacing = "";
|
|
13
|
+
}
|
|
14
|
+
firstUpdated() {
|
|
15
|
+
p(this, c, v).call(this);
|
|
16
|
+
}
|
|
17
|
+
updated(r) {
|
|
18
|
+
r.has("spacing") && p(this, c, v).call(this);
|
|
19
|
+
}
|
|
20
|
+
mapSpacingToken(r) {
|
|
21
|
+
if (!r) return;
|
|
22
|
+
const e = String(r).trim();
|
|
23
|
+
if (e)
|
|
24
|
+
return /^\d+$/.test(e) ? `var(--spacing-${Math.max(0, Math.min(14, parseInt(e, 10)))})` : e;
|
|
11
25
|
}
|
|
12
26
|
render() {
|
|
13
|
-
return
|
|
27
|
+
return y``;
|
|
14
28
|
}
|
|
15
29
|
};
|
|
16
|
-
|
|
30
|
+
c = /* @__PURE__ */ new WeakSet();
|
|
31
|
+
v = function() {
|
|
32
|
+
const r = this.mapSpacingToken(this.spacing);
|
|
33
|
+
r ? this.style.setProperty("--scb-divider-spacing-orth", r) : this.style.removeProperty("--scb-divider-spacing-orth");
|
|
34
|
+
};
|
|
35
|
+
i.styles = g`
|
|
17
36
|
:host {
|
|
18
37
|
--scb-divider-color: var(--md-sys-color-outline-variant);
|
|
19
38
|
--scb-divider-thickness: 1px;
|
|
20
39
|
--scb-divider-gap: var(--scb-grid-column-gap, var(--spacing-6, 24px));
|
|
40
|
+
--scb-divider-spacing-orth: 0;
|
|
41
|
+
|
|
21
42
|
display: block;
|
|
22
43
|
box-sizing: border-box;
|
|
23
|
-
pointer-events: none;
|
|
44
|
+
pointer-events: none;
|
|
24
45
|
}
|
|
25
|
-
|
|
46
|
+
|
|
47
|
+
:host([variant='bold']) {
|
|
26
48
|
--scb-divider-color: var(--md-sys-color-outline);
|
|
27
49
|
}
|
|
28
50
|
|
|
29
|
-
:
|
|
51
|
+
/* Horisontell avdelare: drar ut sig på inline-led, spacing på block-led (ovan/under). */
|
|
52
|
+
:host(:not([direction='vertical'])) {
|
|
30
53
|
inline-size: 100%;
|
|
31
54
|
block-size: var(--scb-divider-thickness);
|
|
32
55
|
background: var(--scb-divider-color);
|
|
56
|
+
margin-block: var(--scb-divider-spacing-orth, 0);
|
|
33
57
|
}
|
|
34
|
-
:host([inset="both"]:not([direction="vertical"])) { margin-inline: var(--spacing-8, 32px); }
|
|
35
|
-
:host([inset="start"]:not([direction="vertical"])) { margin-inline-start: var(--spacing-8, 32px); }
|
|
36
|
-
:host([inset="end"]:not([direction="vertical"])) { margin-inline-end: var(--spacing-8, 32px); }
|
|
37
58
|
|
|
38
|
-
:host([direction=
|
|
59
|
+
:host([inset='both']:not([direction='vertical'])) {
|
|
60
|
+
margin-inline: var(--spacing-8, 32px);
|
|
61
|
+
}
|
|
62
|
+
:host([inset='start']:not([direction='vertical'])) {
|
|
63
|
+
margin-inline-start: var(--spacing-8, 32px);
|
|
64
|
+
}
|
|
65
|
+
:host([inset='end']:not([direction='vertical'])) {
|
|
66
|
+
margin-inline-end: var(--spacing-8, 32px);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
/* Vertikal avdelare: drar ut sig på block-led, spacing på inline-led (vänster/höger). */
|
|
70
|
+
:host([direction='vertical']:not([overlay])) {
|
|
39
71
|
inline-size: var(--scb-divider-thickness);
|
|
40
72
|
block-size: 100%;
|
|
41
73
|
background: var(--scb-divider-color);
|
|
42
74
|
align-self: stretch;
|
|
43
75
|
justify-self: center;
|
|
76
|
+
margin-inline: var(--scb-divider-spacing-orth, 0);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
:host([direction='vertical'][inset='both']:not([overlay])) {
|
|
80
|
+
margin-block: var(--spacing-8, 32px);
|
|
81
|
+
}
|
|
82
|
+
:host([direction='vertical'][inset='start']:not([overlay])) {
|
|
83
|
+
margin-block-start: var(--spacing-8, 32px);
|
|
84
|
+
}
|
|
85
|
+
:host([direction='vertical'][inset='end']:not([overlay])) {
|
|
86
|
+
margin-block-end: var(--spacing-8, 32px);
|
|
44
87
|
}
|
|
45
|
-
:host([direction="vertical"][inset="both"]:not([overlay])) { margin-block: var(--spacing-8, 32px); }
|
|
46
|
-
:host([direction="vertical"][inset="start"]:not([overlay])) { margin-block-start: var(--spacing-8, 32px); }
|
|
47
|
-
:host([direction="vertical"][inset="end"]:not([overlay])) { margin-block-end: var(--spacing-8, 32px); }
|
|
48
88
|
|
|
49
|
-
|
|
89
|
+
/* Overlay-variant för vertikal avdelare, spacing ignoreras (absolut positionerad). */
|
|
90
|
+
:host([overlay][direction='vertical']) {
|
|
50
91
|
position: absolute;
|
|
51
92
|
top: 0;
|
|
52
93
|
bottom: 0;
|
|
53
94
|
inline-size: var(--scb-divider-thickness);
|
|
54
95
|
background: var(--scb-divider-color);
|
|
55
96
|
}
|
|
56
|
-
:host([overlay][direction=
|
|
57
|
-
|
|
97
|
+
:host([overlay][direction='vertical'][anchor='end']) {
|
|
98
|
+
right: calc(var(--scb-divider-gap) / -2);
|
|
99
|
+
}
|
|
100
|
+
:host([overlay][direction='vertical'][anchor='start']) {
|
|
101
|
+
left: calc(var(--scb-divider-gap) / -2);
|
|
102
|
+
}
|
|
58
103
|
`;
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
],
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
],
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
],
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
],
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
],
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
],
|
|
104
|
+
a([
|
|
105
|
+
s({ type: String, reflect: !0 })
|
|
106
|
+
], i.prototype, "variant", 2);
|
|
107
|
+
a([
|
|
108
|
+
s({ type: String, reflect: !0 })
|
|
109
|
+
], i.prototype, "direction", 2);
|
|
110
|
+
a([
|
|
111
|
+
s({ type: String, reflect: !0 })
|
|
112
|
+
], i.prototype, "inset", 2);
|
|
113
|
+
a([
|
|
114
|
+
s({ type: Boolean, reflect: !0 })
|
|
115
|
+
], i.prototype, "overlay", 2);
|
|
116
|
+
a([
|
|
117
|
+
s({ type: String, reflect: !0 })
|
|
118
|
+
], i.prototype, "anchor", 2);
|
|
119
|
+
a([
|
|
120
|
+
s({ type: String, reflect: !0 })
|
|
121
|
+
], i.prototype, "spacing", 2);
|
|
122
|
+
i = a([
|
|
123
|
+
u("scb-divider")
|
|
124
|
+
], i);
|
|
77
125
|
export {
|
|
78
|
-
|
|
126
|
+
i as ScbDivider
|
|
79
127
|
};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { LitElement } from 'lit';
|
|
2
2
|
export declare class ScbFactCard extends LitElement {
|
|
3
|
+
#private;
|
|
3
4
|
private static __iconLoaded;
|
|
4
5
|
private static __instances;
|
|
5
6
|
private static __docListenerAttached;
|
|
@@ -20,6 +21,14 @@ export declare class ScbFactCard extends LitElement {
|
|
|
20
21
|
maxWidth: string;
|
|
21
22
|
height: string;
|
|
22
23
|
maxHeight: string;
|
|
24
|
+
/**
|
|
25
|
+
* Vertikalt avstånd till omgivande innehåll.
|
|
26
|
+
* spacing sätter både top och bottom om spacing-top/spacing-bottom inte är satta.
|
|
27
|
+
* "N" (0–14) mappar till var(--spacing-N), annars valfritt CSS-värde (till exempel "16px" eller "var(--spacing-6)").
|
|
28
|
+
*/
|
|
29
|
+
spacing: string;
|
|
30
|
+
spacingTop: string;
|
|
31
|
+
spacingBottom: string;
|
|
23
32
|
connectedCallback(): void;
|
|
24
33
|
disconnectedCallback(): void;
|
|
25
34
|
protected updated(ch: Map<string, unknown>): void;
|
|
@@ -28,6 +37,7 @@ export declare class ScbFactCard extends LitElement {
|
|
|
28
37
|
static styles: import('lit').CSSResult;
|
|
29
38
|
render(): import('lit-html').TemplateResult<1>;
|
|
30
39
|
firstUpdated(): Promise<void>;
|
|
40
|
+
private mapSpacingToken;
|
|
31
41
|
}
|
|
32
42
|
declare global {
|
|
33
43
|
interface HTMLElementTagNameMap {
|
|
@@ -1,66 +1,74 @@
|
|
|
1
|
-
import { css as
|
|
2
|
-
import { property as
|
|
1
|
+
import { css as b, LitElement as f, html as c } from "lit";
|
|
2
|
+
import { property as a, customElement as m } from "lit/decorators.js";
|
|
3
3
|
import "../scb-icon-button/scb-icon-button.js";
|
|
4
4
|
import "./scb-fact-card-content.js";
|
|
5
5
|
import "../scb-link/scb-link.js";
|
|
6
|
-
var
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
6
|
+
var v = Object.defineProperty, _ = Object.getOwnPropertyDescriptor, g = (t) => {
|
|
7
|
+
throw TypeError(t);
|
|
8
|
+
}, o = (t, i, s, r) => {
|
|
9
|
+
for (var n = r > 1 ? void 0 : r ? _(i, s) : i, p = t.length - 1, d; p >= 0; p--)
|
|
10
|
+
(d = t[p]) && (n = (r ? d(i, s, n) : d(n)) || n);
|
|
11
|
+
return r && n && v(i, s, n), n;
|
|
12
|
+
}, y = (t, i, s) => i.has(t) || g("Cannot " + s), x = (t, i, s) => i.has(t) ? g("Cannot add the same private member more than once") : i instanceof WeakSet ? i.add(t) : i.set(t, s), u = (t, i, s) => (y(t, i, "access private method"), s), l, h;
|
|
13
|
+
let e = class extends f {
|
|
12
14
|
constructor() {
|
|
13
|
-
super(...arguments), this.__onCloseClick = (
|
|
14
|
-
|
|
15
|
-
}, this.variant = "filled", this.title = "", this.subtitle = "", this.supportingText = "", this.icon = "", this.showCloseButton = !1, this.open = !0, this.__lastTriggerEl = null, this.sizing = "stretch", this.width = "", this.maxWidth = "", this.height = "", this.maxHeight = "";
|
|
15
|
+
super(...arguments), x(this, l), this.__onCloseClick = (t) => {
|
|
16
|
+
t.stopPropagation(), this.__setOpen(!1);
|
|
17
|
+
}, this.variant = "filled", this.title = "", this.subtitle = "", this.supportingText = "", this.icon = "", this.showCloseButton = !1, this.open = !0, this.__lastTriggerEl = null, this.sizing = "stretch", this.width = "", this.maxWidth = "", this.height = "", this.maxHeight = "", this.spacing = "", this.spacingTop = "", this.spacingBottom = "";
|
|
16
18
|
}
|
|
17
|
-
static __handleDocClick(
|
|
18
|
-
const
|
|
19
|
-
for (const
|
|
20
|
-
if (!(
|
|
21
|
-
const
|
|
22
|
-
if (!
|
|
23
|
-
const
|
|
24
|
-
if (!
|
|
25
|
-
|
|
19
|
+
static __handleDocClick(t) {
|
|
20
|
+
const i = t.composedPath();
|
|
21
|
+
for (const s of i) {
|
|
22
|
+
if (!(s instanceof Element)) continue;
|
|
23
|
+
const r = s.getAttribute("data-fact-card-toggle") || s.getAttribute("aria-controls");
|
|
24
|
+
if (!r) continue;
|
|
25
|
+
const n = e.__instances.get(r);
|
|
26
|
+
if (!n) {
|
|
27
|
+
e.__instances.delete(r);
|
|
26
28
|
continue;
|
|
27
29
|
}
|
|
28
|
-
|
|
30
|
+
n.__lastTriggerEl = s, n.__setOpen(!n.open), t.stopPropagation();
|
|
29
31
|
break;
|
|
30
32
|
}
|
|
31
33
|
}
|
|
32
34
|
static __ensureDocListener() {
|
|
33
|
-
|
|
35
|
+
e.__docListenerAttached || (document.addEventListener("click", e.__handleDocClick, !0), e.__docListenerAttached = !0);
|
|
34
36
|
}
|
|
35
37
|
static __maybeRemoveDocListener() {
|
|
36
|
-
|
|
38
|
+
e.__docListenerAttached && e.__instances.size === 0 && (document.removeEventListener("click", e.__handleDocClick, !0), e.__docListenerAttached = !1);
|
|
37
39
|
}
|
|
38
40
|
connectedCallback() {
|
|
39
|
-
super.connectedCallback(), this.id &&
|
|
41
|
+
super.connectedCallback(), this.id && e.__instances.set(this.id, this), e.__ensureDocListener();
|
|
40
42
|
}
|
|
41
43
|
disconnectedCallback() {
|
|
42
|
-
this.id &&
|
|
44
|
+
this.id && e.__instances.delete(this.id), e.__maybeRemoveDocListener(), super.disconnectedCallback();
|
|
43
45
|
}
|
|
44
|
-
updated(
|
|
45
|
-
|
|
46
|
+
updated(t) {
|
|
47
|
+
t.has("open") && this.__updateTriggersExpanded(), t.has("width") && (this.width ? this.style.inlineSize = this.width : this.style.removeProperty("inline-size")), t.has("maxWidth") && (this.maxWidth ? this.style.maxInlineSize = this.maxWidth : this.style.removeProperty("max-inline-size")), t.has("height") && (this.height ? this.style.blockSize = this.height : this.style.removeProperty("block-size")), t.has("maxHeight") && (this.maxHeight ? this.style.maxBlockSize = this.maxHeight : this.style.removeProperty("max-block-size")), (t.has("spacing") || t.has("spacingTop") || t.has("spacingBottom")) && u(this, l, h).call(this);
|
|
46
48
|
}
|
|
47
49
|
__updateTriggersExpanded() {
|
|
48
|
-
this.id && document.querySelectorAll(`[aria-controls="${this.id}"], [data-fact-card-toggle="${this.id}"]`).forEach((
|
|
49
|
-
|
|
50
|
+
this.id && document.querySelectorAll(`[aria-controls="${this.id}"], [data-fact-card-toggle="${this.id}"]`).forEach((t) => {
|
|
51
|
+
t.hasAttribute("aria-controls") && t.setAttribute("aria-expanded", String(this.open));
|
|
50
52
|
});
|
|
51
53
|
}
|
|
52
|
-
__setOpen(
|
|
53
|
-
const
|
|
54
|
-
this.open =
|
|
54
|
+
__setOpen(t) {
|
|
55
|
+
const i = this.open;
|
|
56
|
+
this.open = t, t && !i ? this.dispatchEvent(new CustomEvent("open", { bubbles: !0, composed: !0 })) : !t && i && this.dispatchEvent(new CustomEvent("close", { bubbles: !0, composed: !0 }));
|
|
55
57
|
}
|
|
56
58
|
render() {
|
|
57
59
|
if (!this.open) return c``;
|
|
58
|
-
const
|
|
60
|
+
const t = this.variant === "outlined" ? "outlined" : "filled", i = !!this.icon;
|
|
59
61
|
return c`
|
|
60
|
-
<div class="outer ${
|
|
61
|
-
${
|
|
62
|
-
<div class="scb-fact-card ${
|
|
63
|
-
${this.showCloseButton ? c
|
|
62
|
+
<div class="outer ${i ? "has-icon" : ""}">
|
|
63
|
+
${i ? c`<div class="icon-wrapper ${t}"><md-icon>${this.icon}</md-icon></div>` : ""}
|
|
64
|
+
<div class="scb-fact-card ${t} ${this.showCloseButton ? "has-close" : ""}">
|
|
65
|
+
${this.showCloseButton ? c`
|
|
66
|
+
<scb-icon-button
|
|
67
|
+
variant="standard"
|
|
68
|
+
icon="close"
|
|
69
|
+
@click=${this.__onCloseClick}
|
|
70
|
+
></scb-icon-button>
|
|
71
|
+
` : ""}
|
|
64
72
|
<div class="content">
|
|
65
73
|
<slot></slot>
|
|
66
74
|
</div>
|
|
@@ -69,13 +77,24 @@ let t = class extends p {
|
|
|
69
77
|
`;
|
|
70
78
|
}
|
|
71
79
|
async firstUpdated() {
|
|
72
|
-
|
|
80
|
+
u(this, l, h).call(this), e.__iconLoaded || (await import("@material/web/icon/icon.js"), e.__iconLoaded = !0);
|
|
81
|
+
}
|
|
82
|
+
mapSpacingToken(t) {
|
|
83
|
+
if (!t) return;
|
|
84
|
+
const i = String(t).trim();
|
|
85
|
+
if (i)
|
|
86
|
+
return /^\d+$/.test(i) ? `var(--spacing-${Math.max(0, Math.min(14, parseInt(i, 10)))})` : i;
|
|
73
87
|
}
|
|
74
88
|
};
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
t.
|
|
78
|
-
|
|
89
|
+
l = /* @__PURE__ */ new WeakSet();
|
|
90
|
+
h = function() {
|
|
91
|
+
const t = this.mapSpacingToken(this.spacing), i = this.mapSpacingToken(this.spacingTop), s = this.mapSpacingToken(this.spacingBottom), r = i ?? t, n = s ?? t;
|
|
92
|
+
r ? this.style.setProperty("--scb-fact-card-spacing-block-start", r) : this.style.removeProperty("--scb-fact-card-spacing-block-start"), n ? this.style.setProperty("--scb-fact-card-spacing-block-end", n) : this.style.removeProperty("--scb-fact-card-spacing-block-end");
|
|
93
|
+
};
|
|
94
|
+
e.__iconLoaded = !1;
|
|
95
|
+
e.__instances = /* @__PURE__ */ new Map();
|
|
96
|
+
e.__docListenerAttached = !1;
|
|
97
|
+
e.styles = b`
|
|
79
98
|
:host {
|
|
80
99
|
--scb-fact-card-icon-overhang: 40px;
|
|
81
100
|
display: block;
|
|
@@ -86,20 +105,22 @@ t.styles = h`
|
|
|
86
105
|
max-inline-size: var(--scb-fact-card-max-w);
|
|
87
106
|
height: auto;
|
|
88
107
|
padding: 0;
|
|
108
|
+
margin-block-start: var(--scb-fact-card-spacing-block-start, 0);
|
|
109
|
+
margin-block-end: var(--scb-fact-card-spacing-block-end, 0);
|
|
89
110
|
}
|
|
90
111
|
|
|
91
|
-
:host([sizing=
|
|
112
|
+
:host([sizing='stretch']) {
|
|
92
113
|
inline-size: 100%;
|
|
93
114
|
block-size: 100%;
|
|
94
115
|
max-inline-size: none;
|
|
95
116
|
}
|
|
96
|
-
:host([sizing=
|
|
117
|
+
:host([sizing='content-width']) {
|
|
97
118
|
display: inline-block;
|
|
98
119
|
inline-size: auto;
|
|
99
120
|
block-size: auto;
|
|
100
121
|
max-inline-size: var(--scb-fact-card-max-w);
|
|
101
122
|
}
|
|
102
|
-
:host([sizing=
|
|
123
|
+
:host([sizing='content-height']) {
|
|
103
124
|
inline-size: 100%;
|
|
104
125
|
block-size: auto;
|
|
105
126
|
max-inline-size: none;
|
|
@@ -113,13 +134,13 @@ t.styles = h`
|
|
|
113
134
|
padding-top: var(--_icon-pad);
|
|
114
135
|
box-sizing: border-box;
|
|
115
136
|
}
|
|
116
|
-
:host([sizing=
|
|
137
|
+
:host([sizing='content-width']) .outer {
|
|
117
138
|
inline-size: max-content;
|
|
118
139
|
}
|
|
119
140
|
|
|
120
141
|
:host([height]) .outer,
|
|
121
142
|
:host([max-height]) .outer,
|
|
122
|
-
:host([sizing=
|
|
143
|
+
:host([sizing='stretch']) .outer {
|
|
123
144
|
block-size: 100%;
|
|
124
145
|
}
|
|
125
146
|
|
|
@@ -140,16 +161,25 @@ t.styles = h`
|
|
|
140
161
|
|
|
141
162
|
:host([height]) .scb-fact-card,
|
|
142
163
|
:host([max-height]) .scb-fact-card,
|
|
143
|
-
:host([sizing=
|
|
164
|
+
:host([sizing='stretch']) .scb-fact-card {
|
|
144
165
|
block-size: calc(100% - var(--_icon-pad));
|
|
145
166
|
}
|
|
146
167
|
|
|
147
|
-
.scb-fact-card.has-close {
|
|
168
|
+
.scb-fact-card.has-close {
|
|
169
|
+
padding-right: var(--spacing-12);
|
|
170
|
+
}
|
|
148
171
|
|
|
149
|
-
.scb-fact-card.outlined {
|
|
172
|
+
.scb-fact-card.outlined {
|
|
173
|
+
border: 1px solid var(--md-sys-color-outline);
|
|
174
|
+
background: var(--md-sys-color-surface);
|
|
175
|
+
}
|
|
150
176
|
|
|
151
|
-
.outer.has-icon {
|
|
152
|
-
|
|
177
|
+
.outer.has-icon {
|
|
178
|
+
--_icon-pad: var(--scb-fact-card-icon-overhang);
|
|
179
|
+
}
|
|
180
|
+
.outer.has-icon .scb-fact-card {
|
|
181
|
+
border-top-left-radius: 0;
|
|
182
|
+
}
|
|
153
183
|
|
|
154
184
|
.icon-wrapper {
|
|
155
185
|
position: absolute;
|
|
@@ -160,7 +190,7 @@ t.styles = h`
|
|
|
160
190
|
padding-bottom: 0;
|
|
161
191
|
width: fit-content;
|
|
162
192
|
border-radius: var(--md-sys-shape-corner-full) var(--md-sys-shape-corner-full) 0 0 /
|
|
163
|
-
|
|
193
|
+
var(--md-sys-shape-corner-full) var(--md-sys-shape-corner-full) 0 0;
|
|
164
194
|
background: var(--md-sys-color-surface-dim);
|
|
165
195
|
line-height: 0;
|
|
166
196
|
}
|
|
@@ -176,7 +206,9 @@ t.styles = h`
|
|
|
176
206
|
top: var(--scale-01);
|
|
177
207
|
}
|
|
178
208
|
|
|
179
|
-
.scb-fact-card.clickable {
|
|
209
|
+
.scb-fact-card.clickable {
|
|
210
|
+
cursor: pointer;
|
|
211
|
+
}
|
|
180
212
|
|
|
181
213
|
.content {
|
|
182
214
|
display: flex;
|
|
@@ -197,45 +229,54 @@ t.styles = h`
|
|
|
197
229
|
hyphens: auto;
|
|
198
230
|
}
|
|
199
231
|
`;
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
],
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
],
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
],
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
],
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
],
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
],
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
],
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
],
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
],
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
],
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
],
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
],
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
],
|
|
232
|
+
o([
|
|
233
|
+
a({ type: String })
|
|
234
|
+
], e.prototype, "variant", 2);
|
|
235
|
+
o([
|
|
236
|
+
a({ type: String, attribute: "title" })
|
|
237
|
+
], e.prototype, "title", 2);
|
|
238
|
+
o([
|
|
239
|
+
a({ type: String, attribute: "subtitle" })
|
|
240
|
+
], e.prototype, "subtitle", 2);
|
|
241
|
+
o([
|
|
242
|
+
a({ type: String, attribute: "supporting-text" })
|
|
243
|
+
], e.prototype, "supportingText", 2);
|
|
244
|
+
o([
|
|
245
|
+
a({ type: String })
|
|
246
|
+
], e.prototype, "icon", 2);
|
|
247
|
+
o([
|
|
248
|
+
a({ type: Boolean, attribute: "show-close-button" })
|
|
249
|
+
], e.prototype, "showCloseButton", 2);
|
|
250
|
+
o([
|
|
251
|
+
a({ type: Boolean, reflect: !0 })
|
|
252
|
+
], e.prototype, "open", 2);
|
|
253
|
+
o([
|
|
254
|
+
a({ type: String, reflect: !0 })
|
|
255
|
+
], e.prototype, "sizing", 2);
|
|
256
|
+
o([
|
|
257
|
+
a({ type: String, reflect: !0 })
|
|
258
|
+
], e.prototype, "width", 2);
|
|
259
|
+
o([
|
|
260
|
+
a({ type: String, reflect: !0, attribute: "max-width" })
|
|
261
|
+
], e.prototype, "maxWidth", 2);
|
|
262
|
+
o([
|
|
263
|
+
a({ type: String, reflect: !0 })
|
|
264
|
+
], e.prototype, "height", 2);
|
|
265
|
+
o([
|
|
266
|
+
a({ type: String, reflect: !0, attribute: "max-height" })
|
|
267
|
+
], e.prototype, "maxHeight", 2);
|
|
268
|
+
o([
|
|
269
|
+
a({ type: String, reflect: !0 })
|
|
270
|
+
], e.prototype, "spacing", 2);
|
|
271
|
+
o([
|
|
272
|
+
a({ type: String, reflect: !0, attribute: "spacing-top" })
|
|
273
|
+
], e.prototype, "spacingTop", 2);
|
|
274
|
+
o([
|
|
275
|
+
a({ type: String, reflect: !0, attribute: "spacing-bottom" })
|
|
276
|
+
], e.prototype, "spacingBottom", 2);
|
|
277
|
+
e = o([
|
|
278
|
+
m("scb-fact-card")
|
|
279
|
+
], e);
|
|
239
280
|
export {
|
|
240
|
-
|
|
281
|
+
e as ScbFactCard
|
|
241
282
|
};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { LitElement, PropertyValues } from 'lit';
|
|
2
2
|
export declare class ScbHorizontalScroller extends LitElement {
|
|
3
|
+
#private;
|
|
3
4
|
/** Variant för scroll-layout. */
|
|
4
5
|
variant: 'standard' | 'inline';
|
|
5
6
|
/** Fast bredd på scroller, t.ex. '400px' eller '100%'. */
|
|
@@ -7,6 +8,14 @@ export declare class ScbHorizontalScroller extends LitElement {
|
|
|
7
8
|
showScrollbar: boolean;
|
|
8
9
|
rightScrollButtonLabel: string;
|
|
9
10
|
leftScrollButtonLabel: string;
|
|
11
|
+
/**
|
|
12
|
+
* Vertikalt avstånd till omgivande innehåll.
|
|
13
|
+
* spacing sätter både top och bottom om spacing-top/spacing-bottom inte är satta.
|
|
14
|
+
* "N" (0–14) mappar till var(--spacing-N), annars valfritt CSS-värde (till exempel "16px" eller "var(--spacing-6)").
|
|
15
|
+
*/
|
|
16
|
+
spacing: string;
|
|
17
|
+
spacingTop: string;
|
|
18
|
+
spacingBottom: string;
|
|
10
19
|
contentFlex: boolean;
|
|
11
20
|
static styles: import('lit').CSSResult;
|
|
12
21
|
private doScrollBy;
|
|
@@ -22,5 +31,6 @@ export declare class ScbHorizontalScroller extends LitElement {
|
|
|
22
31
|
private handleScroll;
|
|
23
32
|
firstUpdated(): void;
|
|
24
33
|
updated(changed: PropertyValues): void;
|
|
34
|
+
private mapSpacingToken;
|
|
25
35
|
render(): import('lit-html').TemplateResult<1>;
|
|
26
36
|
}
|