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/scb-tabs/scb-tabs.js
CHANGED
|
@@ -1,65 +1,95 @@
|
|
|
1
|
-
import { MdTabs as
|
|
2
|
-
import { property as
|
|
3
|
-
import { css as
|
|
1
|
+
import { MdTabs as m } from "@material/web/tabs/tabs.js";
|
|
2
|
+
import { property as l, customElement as y } from "lit/decorators.js";
|
|
3
|
+
import { css as g } from "lit";
|
|
4
4
|
import "./scb-primary-tab.js";
|
|
5
5
|
import "./scb-secondary-tab.js";
|
|
6
|
-
var
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
6
|
+
var u = Object.defineProperty, f = Object.getOwnPropertyDescriptor, v = (t) => {
|
|
7
|
+
throw TypeError(t);
|
|
8
|
+
}, c = (t, a, r, n) => {
|
|
9
|
+
for (var s = n > 1 ? void 0 : n ? f(a, r) : a, d = t.length - 1, b; d >= 0; d--)
|
|
10
|
+
(b = t[d]) && (s = (n ? b(a, r, s) : b(s)) || s);
|
|
11
|
+
return n && s && u(a, r, s), s;
|
|
12
|
+
}, _ = (t, a, r) => a.has(t) || v("Cannot " + r), S = (t, a, r) => a.has(t) ? v("Cannot add the same private member more than once") : a instanceof WeakSet ? a.add(t) : a.set(t, r), i = (t, a, r) => (_(t, a, "access private method"), r), e, h, p;
|
|
13
|
+
let o = class extends m {
|
|
12
14
|
constructor() {
|
|
13
|
-
super(...arguments), this.ariaLabel = "", this._isDispatching = !1, this._onChange = (
|
|
14
|
-
if (!
|
|
15
|
-
|
|
16
|
-
const
|
|
17
|
-
this.dispatchEvent(
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
15
|
+
super(...arguments), S(this, e), this.ariaLabel = "", this.spacing = "", this.spacingTop = "", this.spacingBottom = "", this._isDispatching = !1, this._onChange = (t) => {
|
|
16
|
+
if (!t.composed && !this._isDispatching) {
|
|
17
|
+
t.stopPropagation(), this._isDispatching = !0;
|
|
18
|
+
const a = t.target.activeTabIndex;
|
|
19
|
+
this.dispatchEvent(
|
|
20
|
+
new CustomEvent("change", {
|
|
21
|
+
detail: { activeTabIndex: a },
|
|
22
|
+
bubbles: !0,
|
|
23
|
+
composed: !0
|
|
24
|
+
})
|
|
25
|
+
), this._isDispatching = !1;
|
|
22
26
|
}
|
|
23
27
|
};
|
|
24
28
|
}
|
|
25
29
|
connectedCallback() {
|
|
26
30
|
super.connectedCallback(), this.setAttribute("role", "tablist");
|
|
27
31
|
}
|
|
28
|
-
firstUpdated(
|
|
29
|
-
super.firstUpdated(
|
|
32
|
+
firstUpdated(t) {
|
|
33
|
+
super.firstUpdated(t), this.addEventListener("change", this._onChange), i(this, e, h).call(this);
|
|
34
|
+
}
|
|
35
|
+
updated(t) {
|
|
36
|
+
super.updated(t), (t.has("spacing") || t.has("spacingTop") || t.has("spacingBottom")) && i(this, e, h).call(this);
|
|
30
37
|
}
|
|
31
38
|
};
|
|
39
|
+
e = /* @__PURE__ */ new WeakSet();
|
|
40
|
+
h = function() {
|
|
41
|
+
const t = i(this, e, p).call(this, this.spacing), a = i(this, e, p).call(this, this.spacingTop) ?? t, r = i(this, e, p).call(this, this.spacingBottom) ?? t;
|
|
42
|
+
a ? this.style.setProperty("--scb-tabs-spacing-block-start", a) : this.style.removeProperty("--scb-tabs-spacing-block-start"), r ? this.style.setProperty("--scb-tabs-spacing-block-end", r) : this.style.removeProperty("--scb-tabs-spacing-block-end");
|
|
43
|
+
};
|
|
44
|
+
p = function(t) {
|
|
45
|
+
if (!t) return;
|
|
46
|
+
const a = String(t).trim();
|
|
47
|
+
if (a)
|
|
48
|
+
return /^\d+$/.test(a) ? `var(--spacing-${Math.max(0, Math.min(14, parseInt(a, 10)))})` : a;
|
|
49
|
+
};
|
|
32
50
|
o.styles = [
|
|
33
|
-
...
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
51
|
+
...m.styles,
|
|
52
|
+
g`
|
|
53
|
+
:host {
|
|
54
|
+
/*Containerfärg */
|
|
55
|
+
--md-primary-tab-container-color: var(--md-sys-color-surface);
|
|
56
|
+
--md-secondary-tab-container-color: var(--md-sys-color-surface);
|
|
39
57
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
58
|
+
/* Text- och ikonfärger */
|
|
59
|
+
--md-primary-tab-label-text-color: var(--md-sys-color-on-surface-variant);
|
|
60
|
+
--md-secondary-tab-label-text-color: var(--md-sys-color-on-surface-variant);
|
|
61
|
+
--md-primary-tab-active-label-text-color: var(--md-sys-color-on-surface);
|
|
62
|
+
--md-secondary-tab-active-label-text-color: var(--md-sys-color-on-surface);
|
|
45
63
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
64
|
+
/* Indikator och divider */
|
|
65
|
+
--md-primary-tab-active-indicator-color: var(--md-sys-color-primary);
|
|
66
|
+
--md-primary-tab-divider-color: var(--md-sys-color-outline-variant);
|
|
67
|
+
--md-secondary-tab-divider-color: var(--md-sys-color-outline-variant);
|
|
50
68
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
}
|
|
69
|
+
/* State layers (hover/press) */
|
|
70
|
+
--md-primary-tab-hover-state-layer-color: var(--md-sys-color-on-surface);
|
|
71
|
+
--md-secondary-tab-hover-state-layer-color: var(--md-sys-color-on-surface);
|
|
55
72
|
|
|
56
|
-
|
|
73
|
+
/* Vertikalt avstånd styrs av spacing-attributen via CSS-variabler */
|
|
74
|
+
margin-block-start: var(--scb-tabs-spacing-block-start, 0);
|
|
75
|
+
margin-block-end: var(--scb-tabs-spacing-block-end, 0);
|
|
76
|
+
}
|
|
77
|
+
`
|
|
57
78
|
];
|
|
58
|
-
|
|
59
|
-
|
|
79
|
+
c([
|
|
80
|
+
l({ type: String, reflect: !0, attribute: "aria-label" })
|
|
60
81
|
], o.prototype, "ariaLabel", 2);
|
|
61
|
-
|
|
62
|
-
|
|
82
|
+
c([
|
|
83
|
+
l({ type: String, reflect: !0 })
|
|
84
|
+
], o.prototype, "spacing", 2);
|
|
85
|
+
c([
|
|
86
|
+
l({ type: String, attribute: "spacing-top", reflect: !0 })
|
|
87
|
+
], o.prototype, "spacingTop", 2);
|
|
88
|
+
c([
|
|
89
|
+
l({ type: String, attribute: "spacing-bottom", reflect: !0 })
|
|
90
|
+
], o.prototype, "spacingBottom", 2);
|
|
91
|
+
o = c([
|
|
92
|
+
y("scb-tabs")
|
|
63
93
|
], o);
|
|
64
94
|
export {
|
|
65
95
|
o as ScbTabs
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { LitElement, TemplateResult, PropertyValues } from 'lit';
|
|
2
2
|
export declare class ScbTextField extends LitElement {
|
|
3
|
+
#private;
|
|
3
4
|
static formAssociated: boolean;
|
|
4
5
|
private _internals;
|
|
5
6
|
constructor();
|
|
@@ -15,6 +16,12 @@ export declare class ScbTextField extends LitElement {
|
|
|
15
16
|
error: boolean;
|
|
16
17
|
disabled: boolean;
|
|
17
18
|
required: boolean;
|
|
19
|
+
/** Vertikalt avstånd ovanför/under textfältet. 0–14 mappar till spacing-tokens, annars CSS-värde. */
|
|
20
|
+
spacing: string;
|
|
21
|
+
/** Överkantens avstånd. Om satt går före spacing. 0–14 mappar till spacing-tokens, annars CSS-värde. */
|
|
22
|
+
spacingTop: string;
|
|
23
|
+
/** Nederkantens avstånd. Om satt går före spacing. 0–14 mappar till spacing-tokens, annars CSS-värde. */
|
|
24
|
+
spacingBottom: string;
|
|
18
25
|
private _form;
|
|
19
26
|
private _formSubmitHandler;
|
|
20
27
|
private _formResetHandler;
|
|
@@ -1,19 +1,21 @@
|
|
|
1
|
-
import { css as
|
|
2
|
-
import { property as a, customElement as
|
|
1
|
+
import { css as m, LitElement as x, html as d } from "lit";
|
|
2
|
+
import { property as a, customElement as v } from "lit/decorators.js";
|
|
3
3
|
import "@material/web/icon/icon.js";
|
|
4
|
-
var
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
4
|
+
var y = Object.defineProperty, g = Object.getOwnPropertyDescriptor, f = (t) => {
|
|
5
|
+
throw TypeError(t);
|
|
6
|
+
}, r = (t, e, i, l) => {
|
|
7
|
+
for (var o = l > 1 ? void 0 : l ? g(e, i) : e, p = t.length - 1, u; p >= 0; p--)
|
|
8
|
+
(u = t[p]) && (o = (l ? u(e, i, o) : u(o)) || o);
|
|
9
|
+
return l && o && y(e, i, o), o;
|
|
10
|
+
}, _ = (t, e, i) => e.has(t) || f("Cannot " + i), w = (t, e, i) => e.has(t) ? f("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, i), c = (t, e, i) => (_(t, e, "access private method"), i), n, b, h;
|
|
11
|
+
let s = class extends x {
|
|
10
12
|
constructor() {
|
|
11
|
-
super(), this._internals = null, this.type = "text", this.label = "", this.supportingText = "", this.errorText = "", this.leadingIcon = "", this.name = "", this.pattern = "", this.value = "", this.underLabel = "", this.error = !1, this.disabled = !1, this.required = !1, this._form = null, this._formSubmitHandler = null, this._formResetHandler = null, this._initialValue = "", this._inputId = "", "attachInternals" in this && (this._internals = this.attachInternals());
|
|
13
|
+
super(), w(this, n), this._internals = null, this.type = "text", this.label = "", this.supportingText = "", this.errorText = "", this.leadingIcon = "", this.name = "", this.pattern = "", this.value = "", this.underLabel = "", this.error = !1, this.disabled = !1, this.required = !1, this.spacing = "", this.spacingTop = "", this.spacingBottom = "", this._form = null, this._formSubmitHandler = null, this._formResetHandler = null, this._initialValue = "", this._inputId = "", "attachInternals" in this && (this._internals = this.attachInternals());
|
|
12
14
|
}
|
|
13
15
|
render() {
|
|
14
|
-
const t = this.leadingIcon ?
|
|
16
|
+
const t = this.leadingIcon ? d`<md-icon class="scb-textfield-icon">${this.leadingIcon}</md-icon>` : null, e = this.error ? d`<md-icon class="scb-textfield-error-icon" aria-hidden="true">error</md-icon>` : null;
|
|
15
17
|
this.underLabel = this.error ? this.errorText || "Ogiltig inmatning." : this.supportingText, this.value = this.value || "";
|
|
16
|
-
const i = this.underLabel ? `${this._inputId}-supporting-text` : void 0, l = this.type === "search" && this.value ?
|
|
18
|
+
const i = this.underLabel ? `${this._inputId}-supporting-text` : void 0, l = this.type === "search" && this.value ? d`
|
|
17
19
|
<button
|
|
18
20
|
type="button"
|
|
19
21
|
class="scb-textfield-clear"
|
|
@@ -48,7 +50,7 @@ let s = class extends p {
|
|
|
48
50
|
</svg>
|
|
49
51
|
</button>
|
|
50
52
|
` : null;
|
|
51
|
-
return this.type === "textarea" ?
|
|
53
|
+
return this.type === "textarea" ? d`
|
|
52
54
|
<label class="scb-textfield-label" for="${this._inputId}">${this.label}</label>
|
|
53
55
|
<span
|
|
54
56
|
class="scb-textfield-supporting-text"
|
|
@@ -68,7 +70,7 @@ let s = class extends p {
|
|
|
68
70
|
${this.value}</textarea
|
|
69
71
|
>
|
|
70
72
|
</div>
|
|
71
|
-
` :
|
|
73
|
+
` : d`
|
|
72
74
|
<label class="scb-textfield-label" for="${this._inputId}">${this.label}</label>
|
|
73
75
|
<span
|
|
74
76
|
class="scb-textfield-supporting-text"
|
|
@@ -122,13 +124,14 @@ ${this.value}</textarea
|
|
|
122
124
|
this.dispatchEvent(new Event("change", { bubbles: !0, composed: !0 }));
|
|
123
125
|
}), e.addEventListener("select", () => {
|
|
124
126
|
this.dispatchEvent(new Event("select", { bubbles: !0, composed: !0 }));
|
|
125
|
-
}));
|
|
127
|
+
})), c(this, n, b).call(this);
|
|
126
128
|
}
|
|
127
129
|
updated(t) {
|
|
128
130
|
if (super.updated(t), this.toggleAttribute("aria-disabled", this.disabled), this._internals && (t.has("value") || t.has("disabled"))) {
|
|
129
131
|
const e = this.disabled ? null : this.value;
|
|
130
132
|
this._internals.setFormValue(e);
|
|
131
133
|
}
|
|
134
|
+
(t.has("spacing") || t.has("spacingTop") || t.has("spacingBottom")) && c(this, n, b).call(this);
|
|
132
135
|
}
|
|
133
136
|
// Körs av webbläsaren när formuläret sätter disabled på kontrollen
|
|
134
137
|
formDisabledCallback(t) {
|
|
@@ -185,9 +188,20 @@ ${this.value}</textarea
|
|
|
185
188
|
}
|
|
186
189
|
}
|
|
187
190
|
};
|
|
191
|
+
n = /* @__PURE__ */ new WeakSet();
|
|
192
|
+
b = function() {
|
|
193
|
+
const t = c(this, n, h).call(this, this.spacing), e = c(this, n, h).call(this, this.spacingTop) ?? t, i = c(this, n, h).call(this, this.spacingBottom) ?? t;
|
|
194
|
+
e ? this.style.setProperty("--scb-textfield-spacing-block-start", e) : this.style.removeProperty("--scb-textfield-spacing-block-start"), i ? this.style.setProperty("--scb-textfield-spacing-block-end", i) : this.style.removeProperty("--scb-textfield-spacing-block-end");
|
|
195
|
+
};
|
|
196
|
+
h = function(t) {
|
|
197
|
+
if (!t) return;
|
|
198
|
+
const e = String(t).trim();
|
|
199
|
+
if (e)
|
|
200
|
+
return /^\d+$/.test(e) ? `var(--spacing-${Math.max(0, Math.min(14, parseInt(e, 10)))})` : e;
|
|
201
|
+
};
|
|
188
202
|
s.formAssociated = !0;
|
|
189
203
|
s.styles = [
|
|
190
|
-
|
|
204
|
+
m`
|
|
191
205
|
:host {
|
|
192
206
|
--scb-textfield-number-max-width: 280px;
|
|
193
207
|
--scb-textfield-text-max-width: 400px;
|
|
@@ -199,6 +213,10 @@ s.styles = [
|
|
|
199
213
|
--scb-textfield-textarea-max-width: 600px;
|
|
200
214
|
font-family: var(--brand-font);
|
|
201
215
|
color: var(--md-sys-color-on-surface);
|
|
216
|
+
|
|
217
|
+
/* Vertikalt avstånd styrs av spacing-attributen via CSS-variabler */
|
|
218
|
+
margin-block-start: var(--scb-textfield-spacing-block-start, 0);
|
|
219
|
+
margin-block-end: var(--scb-textfield-spacing-block-end, 0);
|
|
202
220
|
}
|
|
203
221
|
|
|
204
222
|
:host([type='number']) {
|
|
@@ -398,8 +416,17 @@ r([
|
|
|
398
416
|
r([
|
|
399
417
|
a({ type: Boolean, reflect: !0 })
|
|
400
418
|
], s.prototype, "required", 2);
|
|
419
|
+
r([
|
|
420
|
+
a({ type: String, reflect: !0 })
|
|
421
|
+
], s.prototype, "spacing", 2);
|
|
422
|
+
r([
|
|
423
|
+
a({ type: String, attribute: "spacing-top", reflect: !0 })
|
|
424
|
+
], s.prototype, "spacingTop", 2);
|
|
425
|
+
r([
|
|
426
|
+
a({ type: String, attribute: "spacing-bottom", reflect: !0 })
|
|
427
|
+
], s.prototype, "spacingBottom", 2);
|
|
401
428
|
s = r([
|
|
402
|
-
|
|
429
|
+
v("scb-textfield")
|
|
403
430
|
], s);
|
|
404
431
|
export {
|
|
405
432
|
s as ScbTextField
|
package/scb-toc/scb-toc.d.ts
CHANGED
|
@@ -1,6 +1,15 @@
|
|
|
1
|
-
import { LitElement } from 'lit';
|
|
1
|
+
import { LitElement, PropertyValues } from 'lit';
|
|
2
2
|
export declare class ScbToc extends LitElement {
|
|
3
|
+
#private;
|
|
3
4
|
detached: boolean;
|
|
5
|
+
/** Vertikalt avstånd ovanför/under innehållsförteckningen. 0–14 mappar till spacing-tokens, annars CSS-värde. */
|
|
6
|
+
spacing: string;
|
|
7
|
+
/** Överkantens avstånd. Om satt går före spacing. 0–14 mappar till spacing-tokens, annars CSS-värde. */
|
|
8
|
+
spacingTop: string;
|
|
9
|
+
/** Nederkantens avstånd. Om satt går före spacing. 0–14 mappar till spacing-tokens, annars CSS-värde. */
|
|
10
|
+
spacingBottom: string;
|
|
4
11
|
static styles: import('lit').CSSResult[];
|
|
12
|
+
protected firstUpdated(_changed: PropertyValues): void;
|
|
13
|
+
protected updated(changed: PropertyValues): void;
|
|
5
14
|
render(): import('lit-html').TemplateResult<1>;
|
|
6
15
|
}
|
package/scb-toc/scb-toc.js
CHANGED
|
@@ -1,27 +1,49 @@
|
|
|
1
|
-
import { css as
|
|
2
|
-
import { property as
|
|
1
|
+
import { css as b, LitElement as f, html as y } from "lit";
|
|
2
|
+
import { property as l, customElement as m } from "lit/decorators.js";
|
|
3
3
|
import "./scb-toc-item.js";
|
|
4
|
-
var
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
4
|
+
var u = Object.defineProperty, _ = Object.getOwnPropertyDescriptor, v = (t) => {
|
|
5
|
+
throw TypeError(t);
|
|
6
|
+
}, i = (t, s, e, n) => {
|
|
7
|
+
for (var r = n > 1 ? void 0 : n ? _(s, e) : s, h = t.length - 1, g; h >= 0; h--)
|
|
8
|
+
(g = t[h]) && (r = (n ? g(s, e, r) : g(r)) || r);
|
|
9
|
+
return n && r && u(s, e, r), r;
|
|
10
|
+
}, S = (t, s, e) => s.has(t) || v("Cannot " + e), k = (t, s, e) => s.has(t) ? v("Cannot add the same private member more than once") : s instanceof WeakSet ? s.add(t) : s.set(t, e), c = (t, s, e) => (S(t, s, "access private method"), e), a, d, p;
|
|
11
|
+
let o = class extends f {
|
|
10
12
|
constructor() {
|
|
11
|
-
super(...arguments), this.detached = !1;
|
|
13
|
+
super(...arguments), k(this, a), this.detached = !1, this.spacing = "", this.spacingTop = "", this.spacingBottom = "";
|
|
14
|
+
}
|
|
15
|
+
firstUpdated(t) {
|
|
16
|
+
c(this, a, d).call(this);
|
|
17
|
+
}
|
|
18
|
+
updated(t) {
|
|
19
|
+
super.updated(t), (t.has("spacing") || t.has("spacingTop") || t.has("spacingBottom")) && c(this, a, d).call(this);
|
|
12
20
|
}
|
|
13
21
|
render() {
|
|
14
|
-
return
|
|
22
|
+
return y`
|
|
15
23
|
<div class="scb-toc-list" role="list">
|
|
16
24
|
<slot></slot>
|
|
17
25
|
</div>
|
|
18
26
|
`;
|
|
19
27
|
}
|
|
20
28
|
};
|
|
21
|
-
|
|
22
|
-
|
|
29
|
+
a = /* @__PURE__ */ new WeakSet();
|
|
30
|
+
d = function() {
|
|
31
|
+
const t = c(this, a, p).call(this, this.spacing), s = c(this, a, p).call(this, this.spacingTop) ?? t, e = c(this, a, p).call(this, this.spacingBottom) ?? t;
|
|
32
|
+
s ? this.style.setProperty("--scb-toc-spacing-block-start", s) : this.style.removeProperty("--scb-toc-spacing-block-start"), e ? this.style.setProperty("--scb-toc-spacing-block-end", e) : this.style.removeProperty("--scb-toc-spacing-block-end");
|
|
33
|
+
};
|
|
34
|
+
p = function(t) {
|
|
35
|
+
if (!t) return;
|
|
36
|
+
const s = String(t).trim();
|
|
37
|
+
if (s)
|
|
38
|
+
return /^\d+$/.test(s) ? `var(--spacing-${Math.max(0, Math.min(14, parseInt(s, 10)))})` : s;
|
|
39
|
+
};
|
|
40
|
+
o.styles = [
|
|
41
|
+
b`
|
|
23
42
|
:host {
|
|
24
43
|
display: block;
|
|
44
|
+
/* Vertikalt avstånd styrs av spacing-attributen via CSS-variabler */
|
|
45
|
+
margin-block-start: var(--scb-toc-spacing-block-start, 0);
|
|
46
|
+
margin-block-end: var(--scb-toc-spacing-block-end, 0);
|
|
25
47
|
}
|
|
26
48
|
|
|
27
49
|
.scb-toc-list {
|
|
@@ -30,11 +52,20 @@ r.styles = [
|
|
|
30
52
|
`
|
|
31
53
|
];
|
|
32
54
|
i([
|
|
33
|
-
|
|
34
|
-
],
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
],
|
|
55
|
+
l({ type: Boolean, reflect: !0 })
|
|
56
|
+
], o.prototype, "detached", 2);
|
|
57
|
+
i([
|
|
58
|
+
l({ type: String, reflect: !0 })
|
|
59
|
+
], o.prototype, "spacing", 2);
|
|
60
|
+
i([
|
|
61
|
+
l({ type: String, attribute: "spacing-top", reflect: !0 })
|
|
62
|
+
], o.prototype, "spacingTop", 2);
|
|
63
|
+
i([
|
|
64
|
+
l({ type: String, attribute: "spacing-bottom", reflect: !0 })
|
|
65
|
+
], o.prototype, "spacingBottom", 2);
|
|
66
|
+
o = i([
|
|
67
|
+
m("scb-toc")
|
|
68
|
+
], o);
|
|
38
69
|
export {
|
|
39
|
-
|
|
70
|
+
o as ScbToc
|
|
40
71
|
};
|
package/scb-viz/scb-viz.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { LitElement } from 'lit';
|
|
1
|
+
import { LitElement, PropertyValues } from 'lit';
|
|
2
2
|
export declare class ScbViz extends LitElement {
|
|
3
|
+
#private;
|
|
3
4
|
variant: 'Standard' | 'Table' | 'Image';
|
|
4
5
|
selectedChip: 'Diagram' | 'Table' | null;
|
|
5
6
|
title: string;
|
|
@@ -10,14 +11,20 @@ export declare class ScbViz extends LitElement {
|
|
|
10
11
|
footnote: string;
|
|
11
12
|
lang: string;
|
|
12
13
|
imageHref: string;
|
|
14
|
+
/** Vertikalt avstånd ovanför/under komponenten. 0–14 mappar till spacing-tokens, annars CSS-värde. */
|
|
15
|
+
spacing: string;
|
|
16
|
+
/** Överkantens avstånd. Om satt går före spacing. 0–14 mappar till spacing-tokens, annars CSS-värde. */
|
|
17
|
+
spacingTop: string;
|
|
18
|
+
/** Nederkantens avstånd. Om satt går före spacing. 0–14 mappar till spacing-tokens, annars CSS-värde. */
|
|
19
|
+
spacingBottom: string;
|
|
13
20
|
get descriptionLabel(): "Description of the chart" | "Beskrivning av diagrammet";
|
|
14
21
|
get moreAboutStatsLabel(): "More about the statistics" | "Mer om statistiken";
|
|
15
22
|
get commentLabel(): "Comments" | "Kommentar";
|
|
16
23
|
get sourceLabel(): "Source" | "Källa";
|
|
17
24
|
get footnoteLabel(): "Footnotes" | "Fotnot";
|
|
18
25
|
static styles: import('lit').CSSResult;
|
|
19
|
-
firstUpdated(): void;
|
|
20
|
-
updated(): void;
|
|
26
|
+
protected firstUpdated(_changed: PropertyValues): void;
|
|
27
|
+
protected updated(changed: PropertyValues): void;
|
|
21
28
|
private _styleSlottedTable;
|
|
22
29
|
render(): import('lit-html').TemplateResult<1>;
|
|
23
30
|
private _onSegmentedChange;
|