scb-wc 0.1.237 → 0.1.239

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.
Files changed (81) hide show
  1. package/README.md +19 -16
  2. package/all.d.ts +14 -0
  3. package/all.js +14 -0
  4. package/index.js +99 -85
  5. package/mvc/components/all.js +9 -0
  6. package/mvc/components/scb-accordion/scb-accordion-item.js +1 -1
  7. package/mvc/components/scb-accordion/scb-accordion.js +1 -1
  8. package/mvc/components/scb-app-bar/scb-app-bar.js +1 -1
  9. package/mvc/components/scb-button/scb-button.js +3 -3
  10. package/mvc/components/scb-calendar/scb-calendar.js +1 -1
  11. package/mvc/components/scb-calendar-card/scb-calendar-card.js +4 -4
  12. package/mvc/components/scb-card/scb-card.js +2 -2
  13. package/mvc/{vendor → components/scb-chevron}/scb-chevron.js +1 -1
  14. package/mvc/components/scb-cookies-consent/scb-cookies-consent.js +1 -1
  15. package/mvc/components/scb-datepicker/scb-datepicker.js +143 -0
  16. package/mvc/components/scb-dialog/scb-dialog.js +1 -1
  17. package/mvc/components/scb-drawer/scb-drawer.js +3 -3
  18. package/mvc/components/scb-drop-zone/scb-drop-zone.js +1 -1
  19. package/mvc/components/scb-dropdown/scb-dropdown.js +1 -1
  20. package/mvc/components/scb-fact-card/scb-fact-card.js +1 -1
  21. package/mvc/components/scb-header/scb-header.js +2 -2
  22. package/mvc/components/scb-horizontal-scroller/scb-horizontal-scroller.js +6 -6
  23. package/mvc/components/scb-icon-button/scb-icon-button.js +5 -5
  24. package/mvc/components/scb-keyfigure-card/scb-keyfigure-card.js +6 -6
  25. package/mvc/components/scb-link/scb-link.js +1 -1
  26. package/mvc/components/scb-link-button/scb-link-button.js +1 -1
  27. package/mvc/components/scb-list/scb-list-item.js +6 -6
  28. package/mvc/components/scb-menu/scb-menu-item.js +3 -3
  29. package/mvc/components/scb-menu/scb-menu.js +5 -5
  30. package/mvc/components/scb-nav/scb-nav.js +1 -1
  31. package/mvc/components/scb-notification-card/scb-notification-card.js +1 -1
  32. package/mvc/components/scb-options-menu/scb-options-menu-item.js +1 -1
  33. package/mvc/components/scb-options-menu/scb-options-menu.js +2 -2
  34. package/mvc/components/scb-options-menu/scb-options-sub-menu.js +1 -1
  35. package/mvc/components/scb-overlay/scb-overlay.js +3 -3
  36. package/mvc/components/scb-pagination/scb-pagination.js +1 -1
  37. package/mvc/components/scb-progress-stepper/scb-progress-step.js +1 -1
  38. package/mvc/components/scb-search/scb-search.js +3 -3
  39. package/mvc/components/scb-segmented-button/scb-segmented-item.js +1 -1
  40. package/mvc/components/scb-select/scb-select-option.js +1 -1
  41. package/mvc/components/scb-select/scb-select.js +1 -1
  42. package/mvc/components/scb-snackbar/scb-snackbar.js +1 -1
  43. package/mvc/components/scb-stepper/scb-step.js +1 -1
  44. package/mvc/components/scb-table/scb-table.js +1 -1
  45. package/mvc/components/scb-table-advanced/scb-table-advanced.js +1 -1
  46. package/mvc/components/scb-table-next/read-table.js +1 -0
  47. package/mvc/components/scb-table-next/scb-table-next.js +6 -0
  48. package/mvc/components/scb-textfield/scb-textfield.js +34 -176
  49. package/mvc/components/scb-toc/scb-toc-item.js +1 -1
  50. package/mvc/components/scb-tooltip/scb-tooltip.js +1 -1
  51. package/mvc/{vendor → components/shared}/component-size-token.js +1 -1
  52. package/mvc/components/shared/lazy-focus-ring.js +2 -0
  53. package/mvc/components/shared/lazy-ripple.js +2 -0
  54. package/mvc/{vendor → components/shared}/manual-popover.js +1 -1
  55. package/mvc/components/shared/scb-icon-svg.js +11 -0
  56. package/package.json +12 -2
  57. package/scb-components/index.d.ts +108 -0
  58. package/scb-components/scb-table-next/read-table.d.ts +29 -0
  59. package/scb-components/scb-table-next/scb-table-next.d.ts +22 -0
  60. package/scb-components/scb-viz/scb-viz-actions-runtime.d.ts +26 -0
  61. package/scb-components/scb-viz/scb-viz-print-runtime.d.ts +30 -0
  62. package/scb-components/scb-viz/scb-viz-series-differentiation-registry.d.ts +21 -0
  63. package/scb-components/scb-viz/scb-viz-series-differentiation-runtime.d.ts +42 -0
  64. package/scb-components/scb-viz/scb-viz-table-runtime.d.ts +28 -0
  65. package/scb-components/shared/component-size-token.d.ts +1 -0
  66. package/scb-components/shared/lazy-focus-ring.d.ts +4 -0
  67. package/scb-components/shared/lazy-ripple.d.ts +9 -0
  68. package/scb-components/shared/manual-popover.d.ts +7 -0
  69. package/scb-components/shared/scb-icon-svg.d.ts +3 -0
  70. package/scb-menu/scb-menu-item.js +7 -1
  71. package/scb-menu/scb-menu.js +3 -0
  72. package/scb-table-next/read-table.js +87 -0
  73. package/scb-table-next/scb-table-next.js +226 -0
  74. package/scb-viz/scb-viz-series-differentiation-registry.js +10 -7
  75. package/scb-viz/scb-viz.js +43 -43
  76. package/scb-wc.bundle.js +417 -287
  77. package/scb-wc.d.ts +28 -0
  78. package/shared/scb-icon-svg.js +5 -2
  79. package/mvc/vendor/lazy-focus-ring.js +0 -2
  80. package/mvc/vendor/lazy-ripple.js +0 -2
  81. package/mvc/vendor/scb-icon-svg.js +0 -11
@@ -0,0 +1,87 @@
1
+ //#region src/scb-components/scb-table-next/read-table.ts
2
+ function e(e) {
3
+ if (!e.querySelector("a, sup")) return e.textContent?.trim() ?? "";
4
+ let t = (e) => {
5
+ if (e.nodeType === Node.TEXT_NODE) return [e.textContent ?? ""];
6
+ if (!(e instanceof Element)) return [];
7
+ let n = Array.from(e.childNodes).flatMap(t);
8
+ return e.localName === "sup" ? [{
9
+ tag: "sup",
10
+ children: n
11
+ }] : e.localName === "a" ? [{
12
+ tag: "a",
13
+ children: n,
14
+ href: e.getAttribute("href"),
15
+ title: e.getAttribute("title") || void 0,
16
+ ariaLabel: e.getAttribute("aria-label") || void 0
17
+ }] : n;
18
+ };
19
+ return Array.from(e.childNodes).flatMap(t);
20
+ }
21
+ var t = (e) => e.scope === "row" || e.classList.contains("forspalt") || e.tagName === "TH" && !e.scope;
22
+ function n(n, r = Infinity) {
23
+ let i = n.tHead ? Array.from(n.tHead.rows) : [];
24
+ if (!n.tHead) for (let e of Array.from(n.rows)) {
25
+ if (!e.cells.length || !Array.from(e.cells).every((e) => e.tagName === "TH")) break;
26
+ i.push(e);
27
+ }
28
+ if (!i.length) return;
29
+ let a = new Set(i), o = Array.from(n.rows).filter((e) => !a.has(e));
30
+ if (!o.length || o.length > r) return;
31
+ let s = o.reduce((e, n) => {
32
+ let r = Array.from(n.cells).findIndex((e) => !t(e));
33
+ return Math.max(e, r < 0 ? n.cells.length : r);
34
+ }, 1), c = o[0].cells.length - s;
35
+ if ((o.length + i.length + 1) * c > r) return;
36
+ let l = new Set(Array.from(n.querySelectorAll("[id]"), (e) => e.id));
37
+ if (n.querySelector("table, button, input, select, textarea, [tabindex], [contenteditable], [role]") || Array.from(n.querySelectorAll("*")).some((e) => e.localName.includes("-")) || Array.from(n.querySelectorAll("a")).some((e) => {
38
+ let t = e.getAttribute("href") || "", n;
39
+ try {
40
+ n = decodeURIComponent(t.slice(1));
41
+ } catch {
42
+ return !0;
43
+ }
44
+ return !e.closest("th, td") || l.has(n) || !t.startsWith("#") || e.getAttribute("href") === "#" || e.hasAttribute("target") || e.hasAttribute("download") || e.getAttributeNames().some((e) => e.startsWith("on")) || e.hasAttribute("aria-labelledby") || e.hasAttribute("aria-describedby");
45
+ }) || n.getAttribute("role") && n.getAttribute("role") !== "table") return;
46
+ let u = i.map(() => []), d = i.map((t, n) => {
47
+ let r = 0;
48
+ return Array.from(t.cells).map((t) => {
49
+ for (; u[n][r];) r++;
50
+ let a = t.cloneNode(!0);
51
+ a.querySelectorAll("[hidden], .visually-hidden, .sr-only").forEach((e) => e.remove());
52
+ let o = t.textContent?.trim() ?? "", s = !!o && !a.textContent?.trim(), c = {
53
+ text: o,
54
+ content: e(t),
55
+ visuallyHidden: s,
56
+ ariaLabel: t.getAttribute("aria-label") || (s ? o : void 0),
57
+ column: r,
58
+ colSpan: t.colSpan,
59
+ rowSpan: t.rowSpan || i.length - n
60
+ }, l = r + c.colSpan, d = n + c.rowSpan;
61
+ if (l > 256 || d > u.length) throw RangeError("header-grid");
62
+ for (let e = n; e < d; e++) for (let t = r; t < l; t++) {
63
+ if (u[e][t]) throw RangeError("header-grid");
64
+ u[e][t] = c;
65
+ }
66
+ return r = l, c;
67
+ });
68
+ }), f = u[0].length;
69
+ if (f < 2 || u.some((e) => e.length !== f || Array.from({ length: f }, (t, n) => !e[n]).some(Boolean)) || s >= f || o.some((e) => e.cells.length !== f || Array.from(e.cells).some((e) => e.colSpan !== 1 || e.rowSpan !== 1) || !Array.from(e.cells).slice(0, s).some((e) => e.textContent?.trim()) || Array.from(e.cells).slice(s).some((e) => e.tagName === "TH" || t(e)))) return;
70
+ if (o.some((e) => Array.from(e.cells).slice(s).every((e) => !e.textContent?.trim()))) {
71
+ let e = o.map((e) => JSON.stringify(Array.from(e.cells).slice(0, s).map((e) => e.textContent?.trim())));
72
+ if (new Set(e).size !== e.length) return;
73
+ }
74
+ let p = Array.from({ length: f - s }, (e, t) => [...new Set(u.map((e) => e[t + s]))].filter((e) => e.text));
75
+ if (!p.some((e) => !e.length)) return {
76
+ label: n.getAttribute("aria-label") || n.caption?.textContent?.trim() || "",
77
+ headings: d,
78
+ columns: p,
79
+ stubCount: s,
80
+ rows: o.map((t) => ({
81
+ stubs: Array.from(t.cells).slice(0, s).map(e),
82
+ values: Array.from(t.cells).slice(s).map(e)
83
+ }))
84
+ };
85
+ }
86
+ //#endregion
87
+ export { n as readTable };
@@ -0,0 +1,226 @@
1
+ import e from "../_virtual/_@oxc-project_runtime@0.139.0/helpers/esm/decorate.js";
2
+ import { readTable as t } from "./read-table.js";
3
+ import { LitElement as n, css as r, html as i, nothing as a } from "lit";
4
+ import { customElement as o, state as s } from "lit/decorators.js";
5
+ import { ifDefined as c } from "lit/directives/if-defined.js";
6
+ //#region src/scb-components/scb-table-next/scb-table-next.ts
7
+ var l = 200, u = /* @__PURE__ */ new WeakSet(), d = r`
8
+ scb-table-next > table {
9
+ box-sizing: border-box;
10
+ inline-size: 100%;
11
+ border-collapse: separate;
12
+ border-spacing: 0;
13
+ border: 0;
14
+ /* Ramen överlappar cellkanterna så att ytterlinjerna förblir 1 px. */
15
+ outline: 1px solid var(--scb-tables-strong-outline-color);
16
+ outline-offset: -1px;
17
+ border-radius: var(--md-sys-shape-corner-small);
18
+ overflow: hidden;
19
+ background: var(--scb-tables-surface-color);
20
+ color: inherit;
21
+ font: inherit;
22
+ }
23
+ scb-table-next > table > :is(thead, tbody, tfoot) > tr > :is(th, td) {
24
+ box-sizing: border-box;
25
+ padding: var(--spacing-3) var(--spacing-4);
26
+ min-inline-size: 2.5rem;
27
+ border-block-end: 1px solid var(--scb-tables-strong-outline-color);
28
+ border-inline-end: 1px solid var(--scb-tables-strong-outline-color);
29
+ font-variant-numeric: tabular-nums;
30
+ font-weight: inherit;
31
+ }
32
+ scb-table-next > table > :is(thead, tbody, tfoot) > tr > th,
33
+ scb-table-next > table > tbody > tr > .forspalt { background: var(--scb-tables-alternate-surface-color); }
34
+ scb-table-next > table > thead > tr > * { background: var(--scb-tables-alternate-surface-color); }
35
+ scb-table-next > table > thead > tr > th { font-weight: var(--weight-bold); text-align: center; }
36
+ scb-table-next > table > thead > tr:last-child > th { text-align: end; }
37
+ scb-table-next > table > :is(tbody, tfoot) > tr > :is(th, td) { text-align: end; }
38
+ scb-table-next > table > :is(tbody, tfoot) > tr > :first-child,
39
+ scb-table-next > table > :is(tbody, tfoot) > tr > .forspalt,
40
+ scb-table-next > table > :is(tbody, tfoot) > tr > th:is([scope="row"], [scope="rowgroup"]) { text-align: start; }
41
+ scb-table-next > table > tbody > tr > .forspalt { min-inline-size: 0; }
42
+ scb-table-next > table > tbody > tr > :first-child:not(:has(~ th, ~ .forspalt)) { min-inline-size: 0; }
43
+ scb-table-next > table > tbody > tr:hover > * { background: var(--scb-tables-alternate-surface-color); }
44
+ scb-table-next > table a { color: inherit; text-decoration: underline; }
45
+ scb-table-next > table a:focus-visible { outline: 2px solid var(--md-sys-color-primary); outline-offset: 2px; }
46
+ `, f = class extends n {
47
+ constructor(...e) {
48
+ super(...e), this._mobile = !1, this._widthReady = !1;
49
+ }
50
+ static {
51
+ this.styles = r`
52
+ :host {
53
+ display: block;
54
+ min-inline-size: 0;
55
+ color: var(--scb-tables-content-color, var(--md-sys-color-on-surface));
56
+ font-family: var(--scb-tables-cell-font, var(--brand-font, Inter, Arial, sans-serif));
57
+ font-size: var(--scb-tables-cell-size);
58
+ line-height: var(--scb-tables-cell-line-height);
59
+ font-weight: var(--weight-regular);
60
+ }
61
+ * { box-sizing: border-box; }
62
+ :host([hidden]), [hidden] { display: none !important; }
63
+ .scroll { max-inline-size: 100%; overflow-x: auto; padding-bottom: var(--spacing-8, 24px); }
64
+ .scroll::-webkit-scrollbar {
65
+ border-radius: var(--md-sys-shape-corner-large);
66
+ height: 8px;
67
+ width: 10px;
68
+ }
69
+ .scroll::-webkit-scrollbar-thumb {
70
+ background: var(--scb-tables-scrollbar-thumb-color, var(--md-sys-color-on-surface));
71
+ border-radius: var(--md-sys-shape-corner-large);
72
+ cursor: pointer;
73
+ }
74
+ .scroll::-webkit-scrollbar-track {
75
+ background: var(--scb-tables-scrollbar-track-color, var(--md-sys-color-secondary-container));
76
+ border-radius: var(--md-sys-shape-corner-large);
77
+ }
78
+ a { color: inherit; text-decoration: underline; }
79
+ a:focus-visible, .scroll:focus-visible { outline: 2px solid var(--md-sys-color-primary); outline-offset: 2px; }
80
+ table {
81
+ inline-size: 100%;
82
+ border-collapse: separate;
83
+ border-spacing: 0;
84
+ border: 1px solid var(--scb-tables-strong-outline-color);
85
+ border-radius: var(--md-sys-shape-corner-small);
86
+ overflow: hidden;
87
+ background: var(--scb-tables-surface-color);
88
+ color: inherit;
89
+ font: inherit;
90
+ }
91
+ th, td {
92
+ min-inline-size: 2.5rem;
93
+ font-variant-numeric: tabular-nums;
94
+ font-weight: inherit;
95
+ }
96
+ .stub { text-align: start; }
97
+ td { text-align: end; }
98
+ tbody tr:hover > * { background: var(--scb-tables-alternate-surface-color); }
99
+ .mobile th, .mobile td {
100
+ padding-block: var(--spacing-2);
101
+ padding-inline: var(--spacing-5);
102
+ border: 0;
103
+ background: transparent;
104
+ vertical-align: top;
105
+ }
106
+ .mobile .stub {
107
+ min-inline-size: 0;
108
+ padding-inline-end: calc(var(--spacing-1) / 2);
109
+ }
110
+ .mobile td { inline-size: 1%; white-space: nowrap; }
111
+ .mobile .stub-headings > th { text-align: start; font-weight: var(--weight-bold); }
112
+ .mobile .stub-headings > th:empty { padding: 0; }
113
+ .mobile .outer > th {
114
+ padding-block: var(--spacing-5);
115
+ background: var(--scb-tables-alternate-surface-color);
116
+ font-weight: var(--weight-bold);
117
+ text-align: start;
118
+ border-block-start: 1px solid var(--scb-tables-strong-outline-color);
119
+ }
120
+ .mobile tbody:first-child > .outer:first-child > th { border-block-start: 0; }
121
+ .mobile .group > th {
122
+ padding-block-start: 0;
123
+ font-weight: var(--weight-bold);
124
+ text-align: start;
125
+ }
126
+ .mobile .group.first > th { padding-block-start: calc(var(--spacing-8) + var(--spacing-2)); }
127
+ .mobile .last > * { padding-block-end: calc(var(--spacing-8) + var(--spacing-2)); }
128
+ `;
129
+ }
130
+ connectedCallback() {
131
+ super.connectedCallback();
132
+ let e = this.getRootNode();
133
+ if (!u.has(e)) {
134
+ let t = this.ownerDocument.createElement("style");
135
+ t.textContent = d.cssText, (e instanceof Document ? e.head : e).appendChild(t), u.add(e);
136
+ }
137
+ this._observer = new MutationObserver(() => this._queueRead()), this._observer.observe(this, {
138
+ childList: !0,
139
+ characterData: !0,
140
+ subtree: !0,
141
+ attributes: !0,
142
+ attributeFilter: [
143
+ "colspan",
144
+ "rowspan",
145
+ "aria-label",
146
+ "role",
147
+ "tabindex",
148
+ "contenteditable",
149
+ "scope",
150
+ "class",
151
+ "hidden",
152
+ "href",
153
+ "title",
154
+ "id",
155
+ "target",
156
+ "download",
157
+ "aria-labelledby",
158
+ "aria-describedby"
159
+ ]
160
+ }), this._resize = new ResizeObserver(([e]) => {
161
+ let t = e.contentRect.width;
162
+ if (t <= 0) {
163
+ this._widthReady = !1;
164
+ return;
165
+ }
166
+ let n = t <= 575, r = n !== this._mobile;
167
+ this._mobile = n, (!this._widthReady || r) && (this._widthReady = !0, this._read());
168
+ }), this._resize.observe(this);
169
+ }
170
+ disconnectedCallback() {
171
+ this._observer?.disconnect(), this._resize?.disconnect(), this._frame !== void 0 && cancelAnimationFrame(this._frame), this._frame = void 0, this._widthReady = !1, super.disconnectedCallback();
172
+ }
173
+ _queueRead() {
174
+ !this._mobile || !this._widthReady || this._frame !== void 0 || (this._frame = requestAnimationFrame(() => {
175
+ this._frame = void 0, this._read();
176
+ }));
177
+ }
178
+ _read() {
179
+ if (!this._widthReady) return;
180
+ if (!this._mobile) {
181
+ this._model = void 0;
182
+ return;
183
+ }
184
+ let e = this.querySelectorAll("table");
185
+ try {
186
+ this._model = e.length === 1 ? t(e[0], l) : void 0;
187
+ } catch (e) {
188
+ if (!(e instanceof RangeError)) throw e;
189
+ this._model = void 0;
190
+ }
191
+ }
192
+ _content(e) {
193
+ return typeof e == "string" ? e : e.map((e) => typeof e == "string" ? e : e.tag === "sup" ? i`<sup>${this._content(e.children)}</sup>` : i`<a href=${e.href} title=${c(e.title)} aria-label=${c(e.ariaLabel)}>${this._content(e.children)}</a>`);
194
+ }
195
+ _mobileRows(e) {
196
+ let t = [], n = e.headings.flat().filter((t) => (t.text || t.ariaLabel) && t.column + t.colSpan <= e.stubCount), r = n.map((e) => e.ariaLabel || e.text).join(" "), o = n.filter((e) => !e.visuallyHidden && e.text), s = [], l = [];
197
+ return e.columns.forEach((u, d) => {
198
+ let f = 0;
199
+ for (; f < u.length && u[f] === s[f];) f++;
200
+ l.length = f, u.forEach((e, n) => {
201
+ if (n < f) return;
202
+ let r = `group-${d}-${n}`;
203
+ l.push(r);
204
+ let a = n === 0 ? "outer" : `group${f === 0 ? " first" : ""}`;
205
+ t.push(i`<tr class=${a}><th id=${r} aria-label=${c(e.ariaLabel)} scope="col" colspan="2">${this._content(e.content)}</th></tr>`);
206
+ });
207
+ let p = n.length ? `stub-heading-${d}` : void 0;
208
+ p && (l.push(p), t.push(i`<tr class="stub-headings"><th id=${p} scope="col" colspan="2" aria-label=${c(r)}>${o.map((e, t) => i`${t ? " " : a}<span>${this._content(e.content)}</span>`)}</th></tr>`)), e.rows.forEach((n, r) => {
209
+ let o = `mobile-row-${d}-${r}`;
210
+ t.push(i`<tr class=${r === e.rows.length - 1 ? "last" : ""}>
211
+ <th class="stub" scope="row" id=${o} headers=${c(p)}>${n.stubs.filter((e) => e !== "").map((e, t) => i`${t ? " " : a}${this._content(e)}`)}</th>
212
+ <td headers=${[...l, o].join(" ")}>${this._content(n.values[d])}</td></tr>`);
213
+ }), s = u;
214
+ }), t;
215
+ }
216
+ render() {
217
+ let e = this._model;
218
+ return i`<div class="scroll" tabindex="0" ?hidden=${!!e}><slot @slotchange=${this._queueRead}></slot></div>
219
+ ${e ? i`<table class="mobile" aria-label=${c(e.label || void 0)}>
220
+ <tbody>${this._mobileRows(e)}</tbody>
221
+ </table>` : a}`;
222
+ }
223
+ };
224
+ e([s()], f.prototype, "_model", void 0), e([s()], f.prototype, "_mobile", void 0), f = e([o("scb-table-next")], f);
225
+ //#endregion
226
+ export { f as ScbTableNext };
@@ -93,22 +93,25 @@ var e = (e, t, n = "1.25") => {
93
93
  ]
94
94
  };
95
95
  function i() {
96
+ return r;
97
+ }
98
+ function a() {
96
99
  return r.patterns.map(({ kind: e }) => e);
97
100
  }
98
- function a(e) {
101
+ function o(e) {
99
102
  return r.patterns.find(({ kind: t }) => t === e) || r.patterns.find(({ kind: e }) => e === r.defaultPatternKind) || r.patterns[0];
100
103
  }
101
- function o(e, t, n) {
102
- let r = a(n);
104
+ function s(e, t, n) {
105
+ let r = o(n);
103
106
  return r?.appendMarks(e, t), r?.kind || n;
104
107
  }
105
- function s(e) {
106
- let t = r.dashStyles, n = r.markerSymbols, a = i();
108
+ function c(e) {
109
+ let t = r.dashStyles, n = r.markerSymbols, i = a();
107
110
  return {
108
111
  dashStyle: t[e % t.length],
109
112
  markerSymbol: n[e % n.length],
110
- patternKind: a[e % a.length]
113
+ patternKind: i[e % i.length]
111
114
  };
112
115
  }
113
116
  //#endregion
114
- export { o as appendScbVizSeriesDifferentiationPatternMarks, a as getScbVizSeriesDifferentiationPatternDefinition, i as getScbVizSeriesDifferentiationPatternKinds, s as getScbVizSeriesDifferentiationVariant, r as scbVizSeriesDifferentiationRegistry };
117
+ export { s as appendScbVizSeriesDifferentiationPatternMarks, o as getScbVizSeriesDifferentiationPatternDefinition, a as getScbVizSeriesDifferentiationPatternKinds, i as getScbVizSeriesDifferentiationRegistry, c as getScbVizSeriesDifferentiationVariant, r as scbVizSeriesDifferentiationRegistry };
@@ -9,10 +9,10 @@ import "../scb-horizontal-scroller/scb-horizontal-scroller.js";
9
9
  import "../scb-segmented-button/scb-segmented-item.js";
10
10
  import "../scb-segmented-button/scb-segmented-button.js";
11
11
  import "../scb-table/scb-table.js";
12
- import { getScbVizSeriesDifferentiationPatternKinds as t } from "./scb-viz-series-differentiation-registry.js";
13
- import { clearScbVizSeriesDifferentiationColorClass as n, clearScbVizSeriesDifferentiationMetadata as r, ensureScbVizStyledModeSeriesPattern as i, getScbVizGroupedSeriesDifferentiationVariant as a, getScbVizHighchartsColorClassName as o, getScbVizHighchartsSvgRoot as s, getScbVizLegendSeriesDifferentiationTargets as c, getScbVizSeriesDifferentiationVariantByIndex as l, isScbVizGroupedSeriesDifferentiationChart as u, isScbVizHighchartsStyledMode as d, setScbVizSeriesDifferentiationColorClass as f, setScbVizSeriesDifferentiationMetadata as p, shouldShowScbVizSeriesDifferentiationAction as m, usesScbVizGroupedPointDifferentiation as h } from "./scb-viz-series-differentiation-runtime.js";
14
- import { buildScbVizExportFileName as g, createScbVizCsvBlob as _, createScbVizRasterBlobFromElement as v, createScbVizRasterDataUrlFromElement as y, downloadScbVizBlob as b, getScbVizCurrentFullscreenElement as x, isScbVizFullscreenSupported as S, openScbVizPrintFrame as C, runWithScbVizForcedPrintLightMode as w, toggleScbVizFullscreen as T } from "./scb-viz-actions-runtime.js";
15
- import { buildScbVizPrintDocumentHtml as E, buildScbVizPrintableFooterHtml as D, buildScbVizPrintableTableHtml as O } from "./scb-viz-print-runtime.js";
12
+ import { buildScbVizExportFileName as t, createScbVizCsvBlob as n, createScbVizRasterBlobFromElement as r, createScbVizRasterDataUrlFromElement as i, downloadScbVizBlob as a, getScbVizCurrentFullscreenElement as o, isScbVizFullscreenSupported as s, openScbVizPrintFrame as c, runWithScbVizForcedPrintLightMode as l, toggleScbVizFullscreen as u } from "./scb-viz-actions-runtime.js";
13
+ import { buildScbVizPrintDocumentHtml as d, buildScbVizPrintableFooterHtml as f, buildScbVizPrintableTableHtml as p } from "./scb-viz-print-runtime.js";
14
+ import { getScbVizSeriesDifferentiationPatternKinds as m } from "./scb-viz-series-differentiation-registry.js";
15
+ import { clearScbVizSeriesDifferentiationColorClass as h, clearScbVizSeriesDifferentiationMetadata as g, ensureScbVizStyledModeSeriesPattern as _, getScbVizGroupedSeriesDifferentiationVariant as v, getScbVizHighchartsColorClassName as y, getScbVizHighchartsSvgRoot as b, getScbVizLegendSeriesDifferentiationTargets as x, getScbVizSeriesDifferentiationVariantByIndex as S, isScbVizGroupedSeriesDifferentiationChart as C, isScbVizHighchartsStyledMode as w, setScbVizSeriesDifferentiationColorClass as T, setScbVizSeriesDifferentiationMetadata as E, shouldShowScbVizSeriesDifferentiationAction as D, usesScbVizGroupedPointDifferentiation as O } from "./scb-viz-series-differentiation-runtime.js";
16
16
  import { buildScbVizResolvedTableView as k, createScbVizCsvRows as A, inferScbVizTableAlignments as j, normalizeScbVizRenderableCell as M, readScbVizTableDataFromSlot as N } from "./scb-viz-table-runtime.js";
17
17
  import { LitElement as P, css as F, html as I } from "lit";
18
18
  import { customElement as L, property as R, state as z } from "lit/decorators.js";
@@ -1152,16 +1152,16 @@ var H = /* @__PURE__ */ new Set([
1152
1152
  ].includes(n) ? "line" : ["area", "areaspline"].includes(n) ? "area" : ["column", "bar"].includes(n) ? this._isGroupedSeriesDifferentiationChart(e, t) ? "grouped-fill" : "fill" : ["pie", "variablepie"].includes(n) ? "point-fill" : null;
1153
1153
  }
1154
1154
  _getSeriesDifferentiationVariantByIndex(e) {
1155
- return l(e);
1155
+ return S(e);
1156
1156
  }
1157
1157
  _isGroupedSeriesDifferentiationChart(e, t) {
1158
- return u(e, t);
1158
+ return C(e, t);
1159
1159
  }
1160
1160
  _usesGroupedPointDifferentiation(e) {
1161
- return h(e);
1161
+ return O(e);
1162
1162
  }
1163
1163
  _getGroupedSeriesDifferentiationVariant(e, t, n) {
1164
- let r = a(e, t, n);
1164
+ let r = v(e, t, n);
1165
1165
  return {
1166
1166
  ...r,
1167
1167
  variantIndex: typeof r.variantIndex == "number" ? r.variantIndex : n
@@ -1193,7 +1193,7 @@ var H = /* @__PURE__ */ new Set([
1193
1193
  });
1194
1194
  }
1195
1195
  _shouldShowSeriesDifferentiationAction() {
1196
- return m({
1196
+ return D({
1197
1197
  chart: this._getCurrentHighchartsChart(),
1198
1198
  getCurrentPrintableView: () => this._getCurrentPrintableView(),
1199
1199
  getSeriesDifferentiationGroup: (e, t) => this._getSeriesDifferentiationGroup(e, t),
@@ -1212,45 +1212,45 @@ var H = /* @__PURE__ */ new Set([
1212
1212
  return { marker: a && Object.keys(a).length > 0 ? a : t && Object.keys(t).length > 0 ? t : { enabled: !1 } };
1213
1213
  }
1214
1214
  _isHighchartsStyledMode(e) {
1215
- return d(e);
1215
+ return w(e);
1216
1216
  }
1217
1217
  _getHighchartsSvgRoot(e) {
1218
- return s(e);
1218
+ return b(e);
1219
1219
  }
1220
1220
  _getHighchartsColorClassName(e, t) {
1221
- return o(e, t);
1221
+ return y(e, t);
1222
1222
  }
1223
1223
  _setSeriesDifferentiationMetadata(e, t) {
1224
- p(e, t);
1224
+ E(e, t);
1225
1225
  }
1226
1226
  _clearSeriesDifferentiationMetadata(e) {
1227
- r(e);
1227
+ g(e);
1228
1228
  }
1229
1229
  _setSeriesDifferentiationColorClass(e, t) {
1230
- f(e, t);
1230
+ T(e, t);
1231
1231
  }
1232
1232
  _clearSeriesDifferentiationColorClass(e) {
1233
- n(e);
1233
+ h(e);
1234
1234
  }
1235
1235
  _getLegendSeriesDifferentiationTargets(e) {
1236
- return c(e);
1236
+ return x(e);
1237
1237
  }
1238
1238
  _ensureStyledModeSeriesPattern(e, t, n) {
1239
- i(e, t, n);
1239
+ _(e, t, n);
1240
1240
  }
1241
1241
  _applyStyledModeSeriesDifferentiation(e) {
1242
- let n = this._getHighchartsSvgRoot(e);
1243
- if (!n) return;
1244
- n.classList.add("scb-viz-series-differentiation-enabled");
1245
- let r = t(), i = this._getSeriesDifferentiationSnapshotStore(e);
1246
- e.series?.forEach((t, n) => {
1242
+ let t = this._getHighchartsSvgRoot(e);
1243
+ if (!t) return;
1244
+ t.classList.add("scb-viz-series-differentiation-enabled");
1245
+ let n = m(), r = this._getSeriesDifferentiationSnapshotStore(e);
1246
+ e.series?.forEach((t, i) => {
1247
1247
  let a = this._getSeriesDifferentiationGroup(t, e);
1248
1248
  if (!a) return;
1249
- let o = String(t?.index ?? n);
1250
- i.has(o) || i.set(o, this._captureSeriesDifferentiationSnapshot(t));
1251
- let s = a === "grouped-fill" && this._usesGroupedPointDifferentiation(t), c = a === "grouped-fill" ? this._getGroupedSeriesDifferentiationVariant(t, e, n) : {
1252
- variantIndex: n,
1253
- ...this._getSeriesDifferentiationVariantByIndex(n)
1249
+ let o = String(t?.index ?? i);
1250
+ r.has(o) || r.set(o, this._captureSeriesDifferentiationSnapshot(t));
1251
+ let s = a === "grouped-fill" && this._usesGroupedPointDifferentiation(t), c = a === "grouped-fill" ? this._getGroupedSeriesDifferentiationVariant(t, e, i) : {
1252
+ variantIndex: i,
1253
+ ...this._getSeriesDifferentiationVariantByIndex(i)
1254
1254
  }, { dashStyle: l, markerSymbol: u, patternKind: d } = c, f = this._getHighchartsColorClassName(t?.graph ?? t?.area ?? t?.group, c.variantIndex), p = this._getLegendSeriesDifferentiationTargets(t);
1255
1255
  this._setSeriesDifferentiationMetadata(t?.graph, {
1256
1256
  role: "graph",
@@ -1274,8 +1274,8 @@ var H = /* @__PURE__ */ new Set([
1274
1274
  role: "fill",
1275
1275
  patternKind: d
1276
1276
  }), this._setSeriesDifferentiationColorClass(e?.graphic, f);
1277
- }), this._ensureStyledModeSeriesPattern(e, f, d))), a === "point-fill" && t.points?.forEach((t, n) => {
1278
- let i = r[n % r.length], a = this._getHighchartsColorClassName(t?.graphic ?? t?.legendSymbol ?? t?.legendItem?.symbol ?? t?.legendItem?.group, n), o = this._getLegendSeriesDifferentiationTargets(t);
1277
+ }), this._ensureStyledModeSeriesPattern(e, f, d))), a === "point-fill" && t.points?.forEach((t, r) => {
1278
+ let i = n[r % n.length], a = this._getHighchartsColorClassName(t?.graphic ?? t?.legendSymbol ?? t?.legendItem?.symbol ?? t?.legendItem?.group, r), o = this._getLegendSeriesDifferentiationTargets(t);
1279
1279
  this._setSeriesDifferentiationMetadata(t?.graphic, {
1280
1280
  role: "fill",
1281
1281
  patternKind: i
@@ -1352,7 +1352,7 @@ var H = /* @__PURE__ */ new Set([
1352
1352
  return n.has(r) ? r : t;
1353
1353
  }
1354
1354
  _buildExportFileName(e) {
1355
- return g({
1355
+ return t({
1356
1356
  lang: this.lang,
1357
1357
  title: this.title
1358
1358
  }, e);
@@ -1361,17 +1361,17 @@ var H = /* @__PURE__ */ new Set([
1361
1361
  return this;
1362
1362
  }
1363
1363
  _getCurrentFullscreenElement() {
1364
- return x();
1364
+ return o();
1365
1365
  }
1366
1366
  _isFullscreenSupported() {
1367
- return S(this._getFullscreenTarget());
1367
+ return s(this._getFullscreenTarget());
1368
1368
  }
1369
1369
  _syncFullscreenState() {
1370
1370
  let e = this._getCurrentFullscreenElement() === this._getFullscreenTarget();
1371
1371
  this._isFullscreen = e, this.toggleAttribute("data-scb-viz-fullscreen", e), this.#c(), this.#r();
1372
1372
  }
1373
1373
  async _toggleFullscreen() {
1374
- await T(this._getFullscreenTarget());
1374
+ await u(this._getFullscreenTarget());
1375
1375
  }
1376
1376
  _renderActionsMenu() {
1377
1377
  let e = this._getCurrentPrintableView(), t = this._canExportRaster(), n = this._canExportCsv(), r = t && (e === "diagram" || e === "image"), i = n && e === "table", a = this._shouldShowSeriesDifferentiationAction(), o = `${this._instanceId}-actions-menu`;
@@ -1749,17 +1749,17 @@ var H = /* @__PURE__ */ new Set([
1749
1749
  async #m(e) {
1750
1750
  let t = this._getExportableVisualElement();
1751
1751
  if (!t) return;
1752
- let n = await v(t, this._getExportSurfaceTarget(), e);
1753
- n && b(n, this._buildExportFileName(e === "jpeg" ? "jpg" : "png"));
1752
+ let n = await r(t, this._getExportSurfaceTarget(), e);
1753
+ n && a(n, this._buildExportFileName(e === "jpeg" ? "jpg" : "png"));
1754
1754
  }
1755
1755
  _getCurrentPrintableView() {
1756
1756
  return this.variant === "Table" ? "table" : this.variant === "Image" ? "image" : this.selectedChip === "Table" ? "table" : "diagram";
1757
1757
  }
1758
1758
  #h(e) {
1759
- return O(this._getResolvedTableView(e), (e) => this._escapeHtml(e), { getEmptyHeaderLabel: (e) => this._getEmptyTableHeaderLabel(e) });
1759
+ return p(this._getResolvedTableView(e), (e) => this._escapeHtml(e), { getEmptyHeaderLabel: (e) => this._getEmptyTableHeaderLabel(e) });
1760
1760
  }
1761
1761
  #g() {
1762
- return D({
1762
+ return f({
1763
1763
  comment: this.comment,
1764
1764
  commentLabel: this.commentLabel,
1765
1765
  description: this.description,
@@ -1776,7 +1776,7 @@ var H = /* @__PURE__ */ new Set([
1776
1776
  });
1777
1777
  }
1778
1778
  #_(e) {
1779
- return E({
1779
+ return d({
1780
1780
  contentHtml: e,
1781
1781
  escapeHtml: (e) => this._escapeHtml(e),
1782
1782
  footerHtml: this.#g(),
@@ -1786,7 +1786,7 @@ var H = /* @__PURE__ */ new Set([
1786
1786
  });
1787
1787
  }
1788
1788
  async #v() {
1789
- await w(this, async () => {
1789
+ await l(this, async () => {
1790
1790
  let e = this._getCurrentPrintableView(), t = "";
1791
1791
  if (e === "table") {
1792
1792
  let e = this._getResolvedTableData();
@@ -1799,16 +1799,16 @@ var H = /* @__PURE__ */ new Set([
1799
1799
  } else {
1800
1800
  let e = this._getExportableVisualElement();
1801
1801
  if (!e) return;
1802
- let n = await y(e, this._getExportSurfaceTarget(), "png");
1802
+ let n = await i(e, this._getExportSurfaceTarget(), "png");
1803
1803
  if (!n) return;
1804
1804
  t = `<img class="viz-chart-image" src="${n}" alt="${this._escapeHtml(this._getImageAltText())}">`;
1805
1805
  }
1806
- await C(this.#_(t));
1806
+ await c(this.#_(t));
1807
1807
  });
1808
1808
  }
1809
1809
  #y() {
1810
1810
  let e = this._getResolvedTableData();
1811
- e?.rows?.length && b(_(A(e, (e) => this._normalizeRenderableCell(e)), this.lang), this._buildExportFileName("csv"));
1811
+ e?.rows?.length && a(n(A(e, (e) => this._normalizeRenderableCell(e)), this.lang), this._buildExportFileName("csv"));
1812
1812
  }
1813
1813
  #b() {
1814
1814
  let e = this.#x(this.spacing), t = this.#x(this.spacingTop) ?? e, n = this.#x(this.spacingBottom) ?? e, r = this.#x(this.spacingLeft), i = this.#x(this.spacingRight);