scb-wc-test 0.1.105 → 0.1.106
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 +15 -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 +3 -2
- 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 +6 -1
- package/scb-icon-button/scb-icon-button.js +81 -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 +41 -4
- package/scb-segmented-button/scb-segmented-button.js +145 -61
- 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 +1171 -890
package/scb-viz/scb-viz.js
CHANGED
|
@@ -1,19 +1,21 @@
|
|
|
1
|
-
import { css as
|
|
2
|
-
import { property as
|
|
1
|
+
import { css as y, LitElement as u, html as i } from "lit";
|
|
2
|
+
import { property as l, customElement as f } from "lit/decorators.js";
|
|
3
3
|
import "../scb-chip/scb-chip.js";
|
|
4
4
|
import "../scb-segmented-button/scb-segmented-button.js";
|
|
5
5
|
import "../scb-segmented-button/scb-segmented-item.js";
|
|
6
6
|
import "../scb-accordion/scb-accordion.js";
|
|
7
7
|
import "../scb-divider/scb-divider.js";
|
|
8
8
|
import "../scb-horizontal-scroller/scb-horizontal-scroller.js";
|
|
9
|
-
var
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
9
|
+
var $ = Object.defineProperty, S = Object.getOwnPropertyDescriptor, g = (t) => {
|
|
10
|
+
throw TypeError(t);
|
|
11
|
+
}, r = (t, e, s, c) => {
|
|
12
|
+
for (var d = c > 1 ? void 0 : c ? S(e, s) : e, n = t.length - 1, o; n >= 0; n--)
|
|
13
|
+
(o = t[n]) && (d = (c ? o(e, s, d) : o(d)) || d);
|
|
14
|
+
return c && d && $(e, s, d), d;
|
|
15
|
+
}, x = (t, e, s) => e.has(t) || g("Cannot " + s), w = (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), p = (t, e, s) => (x(t, e, "access private method"), s), h, b, v;
|
|
16
|
+
let a = class extends u {
|
|
15
17
|
constructor() {
|
|
16
|
-
super(...arguments), this.variant = "Standard", this.selectedChip = "Diagram", this.title = "", this.subtitle = "", this.description = "", this.comment = "", this.source = "", this.footnote = "", this.lang = "sv", this.imageHref = "";
|
|
18
|
+
super(...arguments), w(this, h), this.variant = "Standard", this.selectedChip = "Diagram", this.title = "", this.subtitle = "", this.description = "", this.comment = "", this.source = "", this.footnote = "", this.lang = "sv", this.imageHref = "", this.spacing = "", this.spacingTop = "", this.spacingBottom = "";
|
|
17
19
|
}
|
|
18
20
|
// Labels as getters so they react to lang changes
|
|
19
21
|
get descriptionLabel() {
|
|
@@ -31,231 +33,251 @@ let a = class extends v {
|
|
|
31
33
|
get footnoteLabel() {
|
|
32
34
|
return this.lang === "en" ? "Footnotes" : "Fotnot";
|
|
33
35
|
}
|
|
34
|
-
firstUpdated() {
|
|
36
|
+
firstUpdated(t) {
|
|
35
37
|
var s;
|
|
36
|
-
const
|
|
37
|
-
|
|
38
|
+
const e = (s = this.shadowRoot) == null ? void 0 : s.querySelector(
|
|
39
|
+
'slot[name="table"]'
|
|
40
|
+
);
|
|
41
|
+
e && (e.addEventListener("slotchange", () => this._styleSlottedTable()), this._styleSlottedTable()), p(this, h, b).call(this);
|
|
38
42
|
}
|
|
39
|
-
updated() {
|
|
40
|
-
this._styleSlottedTable();
|
|
43
|
+
updated(t) {
|
|
44
|
+
super.updated(t), this._styleSlottedTable(), (t.has("spacing") || t.has("spacingTop") || t.has("spacingBottom")) && p(this, h, b).call(this);
|
|
41
45
|
}
|
|
42
46
|
_styleSlottedTable() {
|
|
43
|
-
var
|
|
44
|
-
const
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
)
|
|
57
|
-
|
|
58
|
-
|
|
47
|
+
var s;
|
|
48
|
+
const t = (s = this.shadowRoot) == null ? void 0 : s.querySelector(
|
|
49
|
+
'slot[name="table"]'
|
|
50
|
+
);
|
|
51
|
+
if (!t) return;
|
|
52
|
+
t.assignedElements({ flatten: !0 }).forEach((c) => {
|
|
53
|
+
if (c.tagName === "TABLE") {
|
|
54
|
+
const d = c;
|
|
55
|
+
d.style.borderCollapse = "collapse", d.style.width = "100%", c.querySelectorAll("tbody tr:nth-child(odd)").forEach((n) => {
|
|
56
|
+
n.style.background = "var(--md-sys-color-surface-container)";
|
|
57
|
+
}), c.querySelectorAll("th").forEach((n) => {
|
|
58
|
+
const o = n;
|
|
59
|
+
o.style.border = "1px solid var(--md-sys-color-on-surface)", o.style.padding = "8px";
|
|
60
|
+
}), c.querySelectorAll("td").forEach((n) => {
|
|
61
|
+
const o = n;
|
|
62
|
+
o.style.border = "1px solid var(--md-sys-color-on-surface)", o.style.padding = "8px";
|
|
63
|
+
}), c.querySelectorAll("tr").forEach((n) => {
|
|
64
|
+
const o = Array.from(n.children).filter(
|
|
65
|
+
(m) => m.tagName === "TD" || m.tagName === "TH"
|
|
66
|
+
);
|
|
67
|
+
o.length > 0 && (o[0].style.borderLeft = "none", o[o.length - 1].style.borderRight = "none");
|
|
68
|
+
});
|
|
69
|
+
}
|
|
59
70
|
});
|
|
60
71
|
}
|
|
61
72
|
render() {
|
|
62
73
|
switch (this.variant) {
|
|
63
74
|
case "Table":
|
|
64
|
-
return
|
|
75
|
+
return i`
|
|
65
76
|
<div part="container">
|
|
66
77
|
<div class="header">
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
${this.subtitle ? t`
|
|
70
|
-
<div class="subtitle">${this.subtitle}</div>` : ""}
|
|
78
|
+
${this.title ? i` <div class="label">${this.title}</div> ` : ""}
|
|
79
|
+
${this.subtitle ? i` <div class="subtitle">${this.subtitle}</div> ` : ""}
|
|
71
80
|
</div>
|
|
72
81
|
<div class="content">
|
|
73
|
-
<scb-horizontal-scroller
|
|
82
|
+
<scb-horizontal-scroller
|
|
83
|
+
width="600px"
|
|
84
|
+
class="table-scroller"
|
|
85
|
+
variant="inline"
|
|
86
|
+
show-scrollbar
|
|
87
|
+
>
|
|
74
88
|
<slot name="table"></slot>
|
|
75
89
|
</scb-horizontal-scroller>
|
|
76
90
|
</div>
|
|
77
91
|
<div class="footer">
|
|
78
|
-
${this.description ?
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
</div>
|
|
83
|
-
` : ""}
|
|
84
|
-
${this.comment || this.source || this.footnote ? t`
|
|
85
|
-
<scb-divider></scb-divider>
|
|
86
|
-
<scb-accordion>
|
|
87
|
-
<scb-accordion-item
|
|
88
|
-
title="${this.moreAboutStatsLabel}"
|
|
89
|
-
>
|
|
90
|
-
<div class="more-about-stats-content">
|
|
91
|
-
${this.comment ? t`
|
|
92
|
-
<div class="section">
|
|
93
|
-
<div class="secondary-label">${this.commentLabel}</div>
|
|
94
|
-
<div>${this.comment}</div>
|
|
95
|
-
</div>
|
|
96
|
-
` : ""}
|
|
97
|
-
${this.source ? t`
|
|
98
|
-
<div class="section">
|
|
99
|
-
|
|
100
|
-
<div class="secondary-label">${this.sourceLabel}</div>
|
|
101
|
-
<div>${this.source}</div>
|
|
102
|
-
</div>` : ""}
|
|
103
|
-
${this.footnote ? t`
|
|
104
|
-
<div class="section">
|
|
105
|
-
<div class="secondary-label">${this.footnoteLabel}</div>
|
|
106
|
-
<div>${this.footnote}</div>
|
|
92
|
+
${this.description ? i`
|
|
93
|
+
<div class="description section">
|
|
94
|
+
<div class="secondary-label">${this.descriptionLabel}</div>
|
|
95
|
+
<div>${this.description}</div>
|
|
107
96
|
</div>
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
97
|
+
` : ""}
|
|
98
|
+
${this.comment || this.source || this.footnote ? i`
|
|
99
|
+
<scb-divider></scb-divider>
|
|
100
|
+
<scb-accordion>
|
|
101
|
+
<scb-accordion-item title="${this.moreAboutStatsLabel}">
|
|
102
|
+
<div class="more-about-stats-content">
|
|
103
|
+
${this.comment ? i`
|
|
104
|
+
<div class="section">
|
|
105
|
+
<div class="secondary-label">${this.commentLabel}</div>
|
|
106
|
+
<div>${this.comment}</div>
|
|
107
|
+
</div>
|
|
108
|
+
` : ""}
|
|
109
|
+
${this.source ? i`
|
|
110
|
+
<div class="section">
|
|
111
|
+
<div class="secondary-label">${this.sourceLabel}</div>
|
|
112
|
+
<div>${this.source}</div>
|
|
113
|
+
</div>
|
|
114
|
+
` : ""}
|
|
115
|
+
${this.footnote ? i`
|
|
116
|
+
<div class="section">
|
|
117
|
+
<div class="secondary-label">${this.footnoteLabel}</div>
|
|
118
|
+
<div>${this.footnote}</div>
|
|
119
|
+
</div>
|
|
120
|
+
` : ""}
|
|
121
|
+
</div>
|
|
122
|
+
</scb-accordion-item>
|
|
123
|
+
</scb-accordion>
|
|
124
|
+
` : ""}
|
|
113
125
|
</div>
|
|
114
126
|
<slot></slot>
|
|
115
127
|
</div>
|
|
116
128
|
`;
|
|
117
129
|
case "Image":
|
|
118
|
-
return
|
|
130
|
+
return i`
|
|
119
131
|
<div part="container">
|
|
120
132
|
<div class="header">
|
|
121
|
-
${this.title ?
|
|
122
|
-
|
|
123
|
-
` : ""}
|
|
124
|
-
${this.subtitle ? t`
|
|
125
|
-
<div class="subtitle">${this.subtitle}</div>
|
|
126
|
-
` : ""}
|
|
133
|
+
${this.title ? i` <div class="label">${this.title}</div> ` : ""}
|
|
134
|
+
${this.subtitle ? i` <div class="subtitle">${this.subtitle}</div> ` : ""}
|
|
127
135
|
</div>
|
|
128
136
|
<div class="content image-content">
|
|
129
|
-
<img src="${this.imageHref}" alt="Image figure"/>
|
|
137
|
+
<img src="${this.imageHref}" alt="Image figure" />
|
|
130
138
|
</div>
|
|
131
139
|
<div class="footer">
|
|
132
|
-
${this.description ?
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
</div>
|
|
137
|
-
` : ""}
|
|
138
|
-
${this.comment || this.source || this.footnote ? t`
|
|
139
|
-
<scb-divider></scb-divider>
|
|
140
|
-
<scb-accordion>
|
|
141
|
-
<scb-accordion-item
|
|
142
|
-
title="${this.moreAboutStatsLabel}"
|
|
143
|
-
>
|
|
144
|
-
<div class="more-about-stats-content">
|
|
145
|
-
${this.comment ? t`
|
|
146
|
-
<div class="section">
|
|
147
|
-
<div class="secondary-label">${this.commentLabel}</div>
|
|
148
|
-
<div>${this.comment}</div>
|
|
149
|
-
</div>
|
|
150
|
-
` : ""}
|
|
151
|
-
${this.source ? t`
|
|
152
|
-
<div class="section">
|
|
153
|
-
<div class="secondary-label">${this.sourceLabel}</div>
|
|
154
|
-
<div>${this.source}</div>
|
|
155
|
-
</div>
|
|
156
|
-
` : ""}
|
|
157
|
-
${this.footnote ? t`
|
|
158
|
-
<div class="section">
|
|
159
|
-
<div class="secondary-label">${this.footnoteLabel}</div>
|
|
160
|
-
<div>${this.footnote}</div>
|
|
140
|
+
${this.description ? i`
|
|
141
|
+
<div class="description section">
|
|
142
|
+
<div class="secondary-label">${this.descriptionLabel}</div>
|
|
143
|
+
<div>${this.description}</div>
|
|
161
144
|
</div>
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
145
|
+
` : ""}
|
|
146
|
+
${this.comment || this.source || this.footnote ? i`
|
|
147
|
+
<scb-divider></scb-divider>
|
|
148
|
+
<scb-accordion>
|
|
149
|
+
<scb-accordion-item title="${this.moreAboutStatsLabel}">
|
|
150
|
+
<div class="more-about-stats-content">
|
|
151
|
+
${this.comment ? i`
|
|
152
|
+
<div class="section">
|
|
153
|
+
<div class="secondary-label">${this.commentLabel}</div>
|
|
154
|
+
<div>${this.comment}</div>
|
|
155
|
+
</div>
|
|
156
|
+
` : ""}
|
|
157
|
+
${this.source ? i`
|
|
158
|
+
<div class="section">
|
|
159
|
+
<div class="secondary-label">${this.sourceLabel}</div>
|
|
160
|
+
<div>${this.source}</div>
|
|
161
|
+
</div>
|
|
162
|
+
` : ""}
|
|
163
|
+
${this.footnote ? i`
|
|
164
|
+
<div class="section">
|
|
165
|
+
<div class="secondary-label">${this.footnoteLabel}</div>
|
|
166
|
+
<div>${this.footnote}</div>
|
|
167
|
+
</div>
|
|
168
|
+
` : ""}
|
|
169
|
+
</div>
|
|
170
|
+
</scb-accordion-item>
|
|
171
|
+
</scb-accordion>
|
|
172
|
+
` : ""}
|
|
167
173
|
</div>
|
|
168
174
|
<slot></slot>
|
|
169
175
|
</div>
|
|
170
176
|
`;
|
|
171
|
-
default:
|
|
172
|
-
const
|
|
173
|
-
return this.className !==
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
<div class="
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
<div class="flipp-wrapper">
|
|
185
|
-
<scb-segmented-button
|
|
186
|
-
.value=${this.selectedChip || ""}
|
|
187
|
-
@change=${(s) => this._onSegmentedChange(s)}
|
|
188
|
-
>
|
|
189
|
-
<scb-segmented-item
|
|
190
|
-
label=${this.lang === "en" ? "Figure" : "Diagram"}
|
|
191
|
-
value="Diagram"
|
|
192
|
-
icon="bar_chart"
|
|
193
|
-
></scb-segmented-item>
|
|
194
|
-
<scb-segmented-item
|
|
195
|
-
label="${this.lang === "en" ? "Table" : "Tabell"}"
|
|
196
|
-
value="Table"
|
|
197
|
-
icon="table"
|
|
198
|
-
></scb-segmented-item>
|
|
199
|
-
</scb-segmented-button>
|
|
200
|
-
</div>
|
|
201
|
-
` : ""}
|
|
202
|
-
<div class="content">
|
|
203
|
-
<scb-horizontal-scroller width="600px" class="diagram-scroller" variant="inline" show-scrollbar>
|
|
204
|
-
<slot name="diagram"></slot>
|
|
205
|
-
</scb-horizontal-scroller>
|
|
206
|
-
<scb-horizontal-scroller width="600px" class="table-scroller" variant="inline" show-scrollbar>
|
|
207
|
-
<slot name="table"></slot>
|
|
208
|
-
</scb-horizontal-scroller>
|
|
209
|
-
</div>
|
|
210
|
-
<div class="footer">
|
|
211
|
-
${this.description ? t`
|
|
212
|
-
<div class="description section">
|
|
213
|
-
<div class="secondary-label">${this.descriptionLabel}</div>
|
|
214
|
-
<div>${this.description}</div>
|
|
215
|
-
</div>
|
|
216
|
-
` : ""}
|
|
217
|
-
${this.comment || this.source || this.footnote ? t`
|
|
218
|
-
<scb-divider></scb-divider>
|
|
219
|
-
<scb-accordion>
|
|
220
|
-
<scb-accordion-item
|
|
221
|
-
title="${this.moreAboutStatsLabel}"
|
|
177
|
+
default: {
|
|
178
|
+
const t = this.selectedChip === "Diagram" ? "chip-diagram" : this.selectedChip === "Table" ? "chip-table" : "";
|
|
179
|
+
return this.className !== t && (this.className = t), i`
|
|
180
|
+
<div part="container">
|
|
181
|
+
<div class="header">
|
|
182
|
+
${this.title ? i` <div class="label">${this.title}</div> ` : ""}
|
|
183
|
+
${this.subtitle ? i` <div class="subtitle">${this.subtitle}</div> ` : ""}
|
|
184
|
+
</div>
|
|
185
|
+
${this.variant === "Standard" ? i`
|
|
186
|
+
<div class="flipp-wrapper">
|
|
187
|
+
<scb-segmented-button
|
|
188
|
+
.value=${this.selectedChip || ""}
|
|
189
|
+
@change=${(e) => this._onSegmentedChange(e)}
|
|
222
190
|
>
|
|
223
|
-
<
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
` : ""}
|
|
236
|
-
${this.footnote ? t`
|
|
237
|
-
<div class="section">
|
|
238
|
-
<div class="secondary-label">${this.footnoteLabel}</div>
|
|
239
|
-
<div>${this.footnote}</div>
|
|
240
|
-
</div>
|
|
241
|
-
` : ""}
|
|
242
|
-
</div>
|
|
243
|
-
</scb-accordion-item>
|
|
244
|
-
</scb-accordion>
|
|
191
|
+
<scb-segmented-item
|
|
192
|
+
label=${this.lang === "en" ? "Figure" : "Diagram"}
|
|
193
|
+
value="Diagram"
|
|
194
|
+
icon="bar_chart"
|
|
195
|
+
></scb-segmented-item>
|
|
196
|
+
<scb-segmented-item
|
|
197
|
+
label="${this.lang === "en" ? "Table" : "Tabell"}"
|
|
198
|
+
value="Table"
|
|
199
|
+
icon="table"
|
|
200
|
+
></scb-segmented-item>
|
|
201
|
+
</scb-segmented-button>
|
|
202
|
+
</div>
|
|
245
203
|
` : ""}
|
|
246
|
-
|
|
247
|
-
<
|
|
204
|
+
<div class="content">
|
|
205
|
+
<scb-horizontal-scroller
|
|
206
|
+
width="600px"
|
|
207
|
+
class="diagram-scroller"
|
|
208
|
+
variant="inline"
|
|
209
|
+
show-scrollbar
|
|
210
|
+
>
|
|
211
|
+
<slot name="diagram"></slot>
|
|
212
|
+
</scb-horizontal-scroller>
|
|
213
|
+
<scb-horizontal-scroller
|
|
214
|
+
width="600px"
|
|
215
|
+
class="table-scroller"
|
|
216
|
+
variant="inline"
|
|
217
|
+
show-scrollbar
|
|
218
|
+
>
|
|
219
|
+
<slot name="table"></slot>
|
|
220
|
+
</scb-horizontal-scroller>
|
|
248
221
|
</div>
|
|
249
|
-
|
|
222
|
+
<div class="footer">
|
|
223
|
+
${this.description ? i`
|
|
224
|
+
<div class="description section">
|
|
225
|
+
<div class="secondary-label">${this.descriptionLabel}</div>
|
|
226
|
+
<div>${this.description}</div>
|
|
227
|
+
</div>
|
|
228
|
+
` : ""}
|
|
229
|
+
${this.comment || this.source || this.footnote ? i`
|
|
230
|
+
<scb-divider></scb-divider>
|
|
231
|
+
<scb-accordion>
|
|
232
|
+
<scb-accordion-item title="${this.moreAboutStatsLabel}">
|
|
233
|
+
<div class="more-about-stats-content">
|
|
234
|
+
${this.comment ? i`
|
|
235
|
+
<div class="section">
|
|
236
|
+
<div class="secondary-label">${this.commentLabel}</div>
|
|
237
|
+
<div>${this.comment}</div>
|
|
238
|
+
</div>
|
|
239
|
+
` : ""}
|
|
240
|
+
${this.source ? i`
|
|
241
|
+
<div class="section">
|
|
242
|
+
<div class="secondary-label">${this.sourceLabel}</div>
|
|
243
|
+
<div>${this.source}</div>
|
|
244
|
+
</div>
|
|
245
|
+
` : ""}
|
|
246
|
+
${this.footnote ? i`
|
|
247
|
+
<div class="section">
|
|
248
|
+
<div class="secondary-label">${this.footnoteLabel}</div>
|
|
249
|
+
<div>${this.footnote}</div>
|
|
250
|
+
</div>
|
|
251
|
+
` : ""}
|
|
252
|
+
</div>
|
|
253
|
+
</scb-accordion-item>
|
|
254
|
+
</scb-accordion>
|
|
255
|
+
` : ""}
|
|
256
|
+
</div>
|
|
257
|
+
<slot></slot>
|
|
258
|
+
</div>
|
|
259
|
+
`;
|
|
260
|
+
}
|
|
250
261
|
}
|
|
251
262
|
}
|
|
252
|
-
_onSegmentedChange(
|
|
253
|
-
var
|
|
254
|
-
const
|
|
255
|
-
this.selectedChip ===
|
|
263
|
+
_onSegmentedChange(t) {
|
|
264
|
+
var s;
|
|
265
|
+
const e = (s = t.detail) == null ? void 0 : s.value;
|
|
266
|
+
this.selectedChip === e ? this.selectedChip = null : this.selectedChip = e;
|
|
256
267
|
}
|
|
257
268
|
};
|
|
258
|
-
|
|
269
|
+
h = /* @__PURE__ */ new WeakSet();
|
|
270
|
+
b = function() {
|
|
271
|
+
const t = p(this, h, v).call(this, this.spacing), e = p(this, h, v).call(this, this.spacingTop) ?? t, s = p(this, h, v).call(this, this.spacingBottom) ?? t;
|
|
272
|
+
e ? this.style.setProperty("--scb-viz-spacing-block-start", e) : this.style.removeProperty("--scb-viz-spacing-block-start"), s ? this.style.setProperty("--scb-viz-spacing-block-end", s) : this.style.removeProperty("--scb-viz-spacing-block-end");
|
|
273
|
+
};
|
|
274
|
+
v = function(t) {
|
|
275
|
+
if (!t) return;
|
|
276
|
+
const e = String(t).trim();
|
|
277
|
+
if (e)
|
|
278
|
+
return /^\d+$/.test(e) ? `var(--spacing-${Math.max(0, Math.min(14, parseInt(e, 10)))})` : e;
|
|
279
|
+
};
|
|
280
|
+
a.styles = y`
|
|
259
281
|
:host {
|
|
260
282
|
display: block;
|
|
261
283
|
font-family: var(--brand-font);
|
|
@@ -265,8 +287,11 @@ a.styles = h`
|
|
|
265
287
|
max-width: 100%;
|
|
266
288
|
border-radius: var(--spacing-04, 16px);
|
|
267
289
|
border: 1px solid var(--md-sys-color-outline-variant);
|
|
268
|
-
|
|
290
|
+
/* Vertikalt avstånd styrs av spacing-attributen via CSS-variabler */
|
|
291
|
+
margin-block-start: var(--scb-viz-spacing-block-start, 0);
|
|
292
|
+
margin-block-end: var(--scb-viz-spacing-block-end, 0);
|
|
269
293
|
}
|
|
294
|
+
|
|
270
295
|
scb-segmented-button {
|
|
271
296
|
--scb-segmented-button-height: var(--icon-size-small);
|
|
272
297
|
}
|
|
@@ -277,65 +302,76 @@ a.styles = h`
|
|
|
277
302
|
line-height: var(--md-sys-typescale-title-large-line-height);
|
|
278
303
|
letter-spacing: var(--md-sys-typescale-title-large-tracking);
|
|
279
304
|
}
|
|
280
|
-
|
|
305
|
+
|
|
306
|
+
.sub-label {
|
|
281
307
|
font-size: var(--md-sys-typescale-body-large-size);
|
|
282
308
|
line-height: var(--md-sys-typescale-body-large-line-height);
|
|
283
309
|
letter-spacing: var(--md-sys-typescale-body-large-tracking);
|
|
284
310
|
}
|
|
311
|
+
|
|
285
312
|
.secondary-label {
|
|
286
313
|
font-size: var(--md-sys-typescale-title-medium-size);
|
|
287
314
|
font-weight: var(--weight-semibold);
|
|
288
315
|
line-height: var(--md-sys-typescale-title-medium-line-height);
|
|
289
316
|
letter-spacing: var(--md-sys-typescale-title-medium-tracking);
|
|
290
317
|
}
|
|
318
|
+
|
|
291
319
|
.section {
|
|
292
320
|
display: flex;
|
|
293
321
|
flex-direction: column;
|
|
294
|
-
gap: var(--spacing-2);
|
|
322
|
+
gap: var(--spacing-2);
|
|
295
323
|
}
|
|
324
|
+
|
|
296
325
|
.more-about-stats-content {
|
|
297
326
|
display: flex;
|
|
298
327
|
flex-direction: column;
|
|
299
328
|
gap: var(--spacing-7);
|
|
300
|
-
max-width: 600px
|
|
329
|
+
max-width: 600px;
|
|
301
330
|
}
|
|
331
|
+
|
|
302
332
|
.header {
|
|
303
333
|
margin-bottom: var(--spacing-7);
|
|
304
|
-
max-width: 600px
|
|
334
|
+
max-width: 600px;
|
|
305
335
|
}
|
|
336
|
+
|
|
306
337
|
.flipp-wrapper {
|
|
307
338
|
margin-bottom: var(--spacing-9);
|
|
308
|
-
max-width: 234px
|
|
339
|
+
max-width: 234px;
|
|
309
340
|
}
|
|
310
|
-
|
|
341
|
+
|
|
342
|
+
.description {
|
|
311
343
|
margin-bottom: var(--spacing-8);
|
|
312
344
|
}
|
|
345
|
+
|
|
313
346
|
.footer {
|
|
314
347
|
margin-top: var(--spacing-7);
|
|
315
|
-
|
|
316
348
|
}
|
|
317
|
-
|
|
318
|
-
|
|
349
|
+
|
|
350
|
+
.description.section {
|
|
351
|
+
max-width: 600px;
|
|
319
352
|
}
|
|
353
|
+
|
|
320
354
|
.table-scroller,
|
|
321
355
|
.diagram-scroller {
|
|
322
356
|
display: none;
|
|
323
357
|
}
|
|
324
|
-
|
|
358
|
+
|
|
359
|
+
:host([variant='Table']) slot[name='table'] {
|
|
325
360
|
display: block;
|
|
326
361
|
}
|
|
327
362
|
:host([variant='Table']) .table-scroller {
|
|
328
363
|
display: flex;
|
|
329
364
|
}
|
|
365
|
+
|
|
330
366
|
:host([variant='Image']) {
|
|
331
367
|
img {
|
|
332
368
|
height: auto;
|
|
333
369
|
max-width: 100%;
|
|
334
370
|
}
|
|
335
|
-
slot[name=
|
|
371
|
+
slot[name='table'] {
|
|
336
372
|
display: none;
|
|
337
373
|
}
|
|
338
|
-
slot[name=
|
|
374
|
+
slot[name='diagram'] {
|
|
339
375
|
display: none;
|
|
340
376
|
}
|
|
341
377
|
.image-content {
|
|
@@ -352,57 +388,63 @@ a.styles = h`
|
|
|
352
388
|
:host([variant='Standard'].chip-diagram) .diagram-scroller {
|
|
353
389
|
display: flex;
|
|
354
390
|
}
|
|
355
|
-
|
|
391
|
+
:host([variant='Standard'].chip-table) .table-scroller {
|
|
356
392
|
display: flex;
|
|
357
393
|
}
|
|
358
|
-
:host([variant='Standard'].chip-table) slot[name=
|
|
394
|
+
:host([variant='Standard'].chip-table) slot[name='table'] {
|
|
359
395
|
display: block;
|
|
360
396
|
}
|
|
361
|
-
:host([variant='Standard'].chip-table) slot[name=
|
|
397
|
+
:host([variant='Standard'].chip-table) slot[name='diagram'] {
|
|
362
398
|
display: none;
|
|
363
399
|
}
|
|
364
|
-
:host([variant='Standard'].chip-diagram) slot[name=
|
|
400
|
+
:host([variant='Standard'].chip-diagram) slot[name='table'] {
|
|
365
401
|
display: none;
|
|
366
402
|
}
|
|
367
|
-
:host([variant='Standard'].chip-diagram) slot[name=
|
|
403
|
+
:host([variant='Standard'].chip-diagram) slot[name='diagram'] {
|
|
368
404
|
display: block;
|
|
369
405
|
}
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
406
|
`;
|
|
374
|
-
|
|
375
|
-
|
|
407
|
+
r([
|
|
408
|
+
l({ type: String, reflect: !0 })
|
|
376
409
|
], a.prototype, "variant", 2);
|
|
377
|
-
|
|
378
|
-
|
|
410
|
+
r([
|
|
411
|
+
l({ type: String })
|
|
379
412
|
], a.prototype, "selectedChip", 2);
|
|
380
|
-
|
|
381
|
-
|
|
413
|
+
r([
|
|
414
|
+
l({ type: String, reflect: !0 })
|
|
382
415
|
], a.prototype, "title", 2);
|
|
383
|
-
|
|
384
|
-
|
|
416
|
+
r([
|
|
417
|
+
l({ type: String, reflect: !0 })
|
|
385
418
|
], a.prototype, "subtitle", 2);
|
|
386
|
-
|
|
387
|
-
|
|
419
|
+
r([
|
|
420
|
+
l({ type: String, reflect: !0 })
|
|
388
421
|
], a.prototype, "description", 2);
|
|
389
|
-
|
|
390
|
-
|
|
422
|
+
r([
|
|
423
|
+
l({ type: String, reflect: !0 })
|
|
391
424
|
], a.prototype, "comment", 2);
|
|
392
|
-
|
|
393
|
-
|
|
425
|
+
r([
|
|
426
|
+
l({ type: String, reflect: !0 })
|
|
394
427
|
], a.prototype, "source", 2);
|
|
395
|
-
|
|
396
|
-
|
|
428
|
+
r([
|
|
429
|
+
l({ type: String, reflect: !0 })
|
|
397
430
|
], a.prototype, "footnote", 2);
|
|
398
|
-
|
|
399
|
-
|
|
431
|
+
r([
|
|
432
|
+
l({ type: String, reflect: !0, attribute: "lang" })
|
|
400
433
|
], a.prototype, "lang", 2);
|
|
401
|
-
|
|
402
|
-
|
|
434
|
+
r([
|
|
435
|
+
l({ type: String, reflect: !0, attribute: "image-href" })
|
|
403
436
|
], a.prototype, "imageHref", 2);
|
|
404
|
-
|
|
405
|
-
|
|
437
|
+
r([
|
|
438
|
+
l({ type: String, reflect: !0 })
|
|
439
|
+
], a.prototype, "spacing", 2);
|
|
440
|
+
r([
|
|
441
|
+
l({ type: String, attribute: "spacing-top", reflect: !0 })
|
|
442
|
+
], a.prototype, "spacingTop", 2);
|
|
443
|
+
r([
|
|
444
|
+
l({ type: String, attribute: "spacing-bottom", reflect: !0 })
|
|
445
|
+
], a.prototype, "spacingBottom", 2);
|
|
446
|
+
a = r([
|
|
447
|
+
f("scb-viz")
|
|
406
448
|
], a);
|
|
407
449
|
export {
|
|
408
450
|
a as ScbViz
|