scb-wc 0.1.261 → 0.1.262
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/README.md +19 -16
- package/all.d.ts +16 -0
- package/all.js +16 -0
- package/index.js +101 -85
- package/mvc/components/all.js +11 -0
- package/mvc/components/scb-accordion/scb-accordion-item.js +1 -1
- package/mvc/components/scb-accordion/scb-accordion.js +1 -1
- package/mvc/components/scb-app-bar/scb-app-bar.js +1 -1
- package/mvc/components/scb-avatar/scb-avatar.js +1 -1
- package/mvc/components/scb-button/scb-button.js +3 -3
- package/mvc/components/scb-calendar/scb-calendar.js +1 -1
- package/mvc/components/scb-calendar-card/scb-calendar-card.js +2 -2
- package/mvc/components/scb-card/scb-card.js +2 -2
- package/mvc/{vendor → components/scb-chevron}/scb-chevron.js +1 -1
- package/mvc/components/scb-cookies-consent/scb-cookies-consent.js +1 -1
- package/mvc/components/scb-datepicker/scb-datepicker.js +143 -0
- package/mvc/components/scb-dialog/scb-dialog.js +1 -1
- package/mvc/components/scb-drawer/scb-drawer.js +3 -3
- package/mvc/components/scb-drop-zone/scb-drop-zone.js +1 -1
- package/mvc/components/scb-dropdown/scb-dropdown.js +1 -1
- package/mvc/components/scb-fact-card/scb-fact-card.js +1 -1
- package/mvc/components/scb-header/scb-header.js +2 -2
- package/mvc/components/scb-horizontal-scroller/scb-horizontal-scroller.js +6 -6
- package/mvc/components/scb-icon-button/scb-icon-button.js +5 -5
- package/mvc/components/scb-keyfigure-card/scb-keyfigure-card.js +6 -6
- package/mvc/components/scb-link/scb-link.js +1 -1
- package/mvc/components/scb-link-button/scb-link-button.js +1 -1
- package/mvc/components/scb-list/scb-list-item.js +6 -6
- package/mvc/components/scb-menu/scb-menu-item.js +1 -1
- package/mvc/components/scb-nav/scb-nav.js +1 -1
- package/mvc/components/scb-notification-card/scb-notification-card.js +1 -1
- package/mvc/components/scb-options-menu/scb-options-menu-item.js +1 -1
- package/mvc/components/scb-options-menu/scb-options-menu.js +2 -2
- package/mvc/components/scb-options-menu/scb-options-sub-menu.js +1 -1
- package/mvc/components/scb-overlay/scb-overlay.js +3 -3
- package/mvc/components/scb-pagination/scb-pagination.js +1 -1
- package/mvc/components/scb-progress-stepper/scb-progress-step.js +1 -1
- package/mvc/components/scb-search/scb-search.js +3 -3
- package/mvc/components/scb-segmented-button/scb-segmented-item.js +1 -1
- package/mvc/components/scb-select/scb-select-option.js +1 -1
- package/mvc/components/scb-select/scb-select.js +1 -1
- package/mvc/components/scb-snackbar/scb-snackbar.js +1 -1
- package/mvc/components/scb-stepper/scb-step.js +1 -1
- package/mvc/components/scb-table/scb-table.js +1 -1
- package/mvc/components/scb-table-advanced/scb-table-advanced.js +1 -1
- package/mvc/components/scb-table-next/read-table.js +1 -0
- package/mvc/components/scb-table-next/scb-table-next.js +6 -0
- package/mvc/components/scb-textfield/scb-textfield.js +34 -176
- package/mvc/components/scb-toc/scb-toc-item.js +1 -1
- package/mvc/components/scb-tooltip/scb-tooltip.js +1 -1
- package/mvc/components/scb-tour/scb-tour-step.js +1 -0
- package/mvc/components/scb-tour/scb-tour.js +33 -0
- package/mvc/{vendor → components/shared}/component-size-token.js +1 -1
- package/mvc/components/shared/lazy-focus-ring.js +2 -0
- package/mvc/components/shared/lazy-ripple.js +2 -0
- package/mvc/{vendor → components/shared}/manual-popover.js +1 -1
- package/mvc/components/shared/scb-icon-svg.js +11 -0
- package/package.json +22 -2
- package/scb-components/index.d.ts +110 -0
- package/scb-components/scb-table-next/read-table.d.ts +29 -0
- package/scb-components/scb-table-next/scb-table-next.d.ts +22 -0
- package/scb-components/scb-tour/scb-tour-step.d.ts +13 -0
- package/scb-components/scb-tour/scb-tour.d.ts +57 -0
- package/scb-components/scb-viz/scb-viz-actions-runtime.d.ts +26 -0
- package/scb-components/scb-viz/scb-viz-print-runtime.d.ts +36 -0
- package/scb-components/scb-viz/scb-viz-series-differentiation-registry.d.ts +21 -0
- package/scb-components/scb-viz/scb-viz-series-differentiation-runtime.d.ts +42 -0
- package/scb-components/scb-viz/scb-viz-table-runtime.d.ts +31 -0
- package/scb-components/shared/component-size-token.d.ts +1 -0
- package/scb-components/shared/lazy-focus-ring.d.ts +4 -0
- package/scb-components/shared/lazy-ripple.d.ts +9 -0
- package/scb-components/shared/manual-popover.d.ts +7 -0
- package/scb-components/shared/scb-icon-svg.d.ts +3 -0
- package/scb-table-next/read-table.js +87 -0
- package/scb-table-next/scb-table-next.js +226 -0
- package/scb-tour/scb-tour-step.js +27 -0
- package/scb-tour/scb-tour.js +368 -0
- package/scb-viz/scb-viz-series-differentiation-registry.js +10 -7
- package/scb-viz/scb-viz.js +43 -43
- package/scb-wc.bundle.js +581 -290
- package/scb-wc.d.ts +32 -0
- package/shared/scb-icon-svg.js +5 -2
- package/mvc/vendor/lazy-focus-ring.js +0 -2
- package/mvc/vendor/lazy-ripple.js +0 -2
- package/mvc/vendor/scb-icon-svg.js +0 -11
|
@@ -0,0 +1,368 @@
|
|
|
1
|
+
import e from "../_virtual/_@oxc-project_runtime@0.139.0/helpers/esm/decorate.js";
|
|
2
|
+
import "../scb-button/scb-button.js";
|
|
3
|
+
import "../scb-icon-button/scb-icon-button.js";
|
|
4
|
+
import { closeManualPopover as t, openManualPopover as n } from "../shared/manual-popover.js";
|
|
5
|
+
import { ScbTourStepElement as r } from "./scb-tour-step.js";
|
|
6
|
+
import { LitElement as i, css as a, html as o } from "lit";
|
|
7
|
+
import { customElement as s, property as c, state as l } from "lit/decorators.js";
|
|
8
|
+
//#region src/scb-components/scb-tour/scb-tour.ts
|
|
9
|
+
var u, d = {
|
|
10
|
+
fromAttribute: (e) => e !== null && e !== "false",
|
|
11
|
+
toAttribute: (e) => e ? "" : null
|
|
12
|
+
}, f = class extends i {
|
|
13
|
+
static {
|
|
14
|
+
u = this;
|
|
15
|
+
}
|
|
16
|
+
constructor(...e) {
|
|
17
|
+
super(...e), this.variant = "standard", this.spotlight = !1, this.open = !1, this.autoStart = !1, this.storageKey = "", this.step = 0, this.closeLabel = "Stäng guiden", this.previousLabel = "Föregående", this.nextLabel = "Nästa", this.doneLabel = "Klart", this.stepLabel = "{current} av {total}", this._steps = [], this._stepObserver = new MutationObserver(() => this._readSteps()), this._autoStartAttempted = !1, this._startRequest = 0, this._shownStorageKey = "", this._spotlightId = `scb-tour-spotlight-${u._nextId++}`, this._operation = 0, this._frame = 0, this._scrollRoots = [], this._resizeObserver = new ResizeObserver(() => this._schedulePosition()), this._startOnLoad = async () => {
|
|
18
|
+
if (!this.isConnected || document.readyState !== "complete" || !this.autoStart || this.open || this._autoStartAttempted) return;
|
|
19
|
+
this._autoStartAttempted = !0;
|
|
20
|
+
let e = this._startRequest, t = this.storageKey;
|
|
21
|
+
try {
|
|
22
|
+
if (t && localStorage.getItem(t) === "seen") return;
|
|
23
|
+
} catch {}
|
|
24
|
+
await this.updateComplete;
|
|
25
|
+
let n = this._findTarget(this._steps[0]?.target);
|
|
26
|
+
n?.localName.includes("-") && (await customElements.whenDefined(n.localName), await n.updateComplete), this.isConnected && this.autoStart && !this.open && e === this._startRequest && t === this.storageKey && this.start();
|
|
27
|
+
}, this._schedulePosition = (e) => {
|
|
28
|
+
e && this.shadowRoot?.querySelector(".layer")?.removeAttribute("data-moving"), cancelAnimationFrame(this._frame), this._frame = requestAnimationFrame(() => this._position());
|
|
29
|
+
}, this._onResize = (e) => {
|
|
30
|
+
this._target?.scrollIntoView({
|
|
31
|
+
block: "center",
|
|
32
|
+
inline: "nearest",
|
|
33
|
+
behavior: "instant"
|
|
34
|
+
}), this._schedulePosition(e);
|
|
35
|
+
}, this._next = () => {
|
|
36
|
+
this.step >= this._steps.length - 1 ? this._close("complete") : this.step++;
|
|
37
|
+
}, this._onKeydown = (e) => {
|
|
38
|
+
e.key !== "Escape" || !this.open || e.defaultPrevented || (e.preventDefault(), e.stopPropagation(), this.close());
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
static {
|
|
42
|
+
this._nextId = 0;
|
|
43
|
+
}
|
|
44
|
+
static {
|
|
45
|
+
this.styles = a`
|
|
46
|
+
:host { display: block; }
|
|
47
|
+
.layer {
|
|
48
|
+
display: none;
|
|
49
|
+
position: fixed;
|
|
50
|
+
inset: 0;
|
|
51
|
+
margin: 0;
|
|
52
|
+
padding: 0;
|
|
53
|
+
border: 0;
|
|
54
|
+
inline-size: 100%;
|
|
55
|
+
block-size: 100%;
|
|
56
|
+
max-inline-size: none;
|
|
57
|
+
max-block-size: none;
|
|
58
|
+
overflow: visible;
|
|
59
|
+
background: transparent;
|
|
60
|
+
pointer-events: none;
|
|
61
|
+
}
|
|
62
|
+
.layer:popover-open { display: block; }
|
|
63
|
+
.layer::backdrop { background: transparent; pointer-events: none; }
|
|
64
|
+
:host([spotlight]) .layer:popover-open {
|
|
65
|
+
animation: scb-kf-fade-in var(--scb-motion-duration-short, 200ms) var(--scb-motion-easing-standard, ease);
|
|
66
|
+
}
|
|
67
|
+
@keyframes scb-kf-fade-in {
|
|
68
|
+
from { opacity: 0; }
|
|
69
|
+
to { opacity: 1; }
|
|
70
|
+
}
|
|
71
|
+
.spotlight { display: none; position: fixed; inset: 0; inline-size: 100%; block-size: 100%; }
|
|
72
|
+
:host([spotlight]) .spotlight { display: block; }
|
|
73
|
+
.spotlight-hole {
|
|
74
|
+
x: calc(var(--_spotlight-left) - var(--spacing-3, 8px));
|
|
75
|
+
y: calc(var(--_spotlight-top) - var(--spacing-3, 8px));
|
|
76
|
+
width: calc(var(--_spotlight-width) + 2 * var(--spacing-3, 8px));
|
|
77
|
+
height: calc(var(--_spotlight-height) + 2 * var(--spacing-3, 8px));
|
|
78
|
+
rx: var(--radius-medium, 12px);
|
|
79
|
+
}
|
|
80
|
+
.layer[data-moving] .spotlight-hole {
|
|
81
|
+
transition-property: x, y, width, height;
|
|
82
|
+
transition-duration: var(--scb-motion-duration-short, 200ms);
|
|
83
|
+
transition-timing-function: var(--scb-motion-easing-standard, ease);
|
|
84
|
+
}
|
|
85
|
+
.spotlight-scrim {
|
|
86
|
+
fill: var(--scb-tour-spotlight-color, color-mix(in srgb, var(--md-sys-color-scrim) 32%, transparent));
|
|
87
|
+
}
|
|
88
|
+
@media (prefers-reduced-motion: reduce) {
|
|
89
|
+
:host([spotlight]) .layer:popover-open { animation: none; }
|
|
90
|
+
.layer[data-moving] .spotlight-hole { transition: none; }
|
|
91
|
+
}
|
|
92
|
+
.surface {
|
|
93
|
+
position: fixed;
|
|
94
|
+
pointer-events: auto;
|
|
95
|
+
box-sizing: border-box;
|
|
96
|
+
margin: 0;
|
|
97
|
+
inset: auto;
|
|
98
|
+
border: 0;
|
|
99
|
+
inline-size: min(360px, calc(100vw - 2 * var(--spacing-4, 12px)));
|
|
100
|
+
max-block-size: min(var(--available-height, 100vh), calc(100vh - 2 * var(--spacing-4, 12px)));
|
|
101
|
+
padding: var(--scb-tour-design-padding-medium);
|
|
102
|
+
border-radius: var(--scb-tour-design-radius-medium);
|
|
103
|
+
background: var(--scb-tour-surface-color, var(--md-sys-color-surface-container));
|
|
104
|
+
color: var(--scb-tour-content-color, var(--md-sys-color-on-surface));
|
|
105
|
+
box-shadow: var(--scb-tour-design-shadow-medium);
|
|
106
|
+
overflow: visible;
|
|
107
|
+
outline: none;
|
|
108
|
+
font-family: var(--scb-tour-design-supporting-medium-font);
|
|
109
|
+
font-size: var(--scb-tour-design-supporting-medium-size);
|
|
110
|
+
line-height: var(--scb-tour-design-supporting-medium-line-height);
|
|
111
|
+
font-weight: var(--scb-tour-design-supporting-medium-weight);
|
|
112
|
+
letter-spacing: var(--scb-tour-design-supporting-medium-tracking);
|
|
113
|
+
}
|
|
114
|
+
:host([variant='inverse']) .surface {
|
|
115
|
+
background: var(--scb-tour-surface-color, var(--md-sys-color-on-info-container));
|
|
116
|
+
color: var(--scb-tour-content-color, var(--md-sys-color-info-container));
|
|
117
|
+
--scb-button-low-emphasis-content-color: var(--scb-tour-content-color, var(--md-sys-color-info-container));
|
|
118
|
+
--scb-button-filled-container-color: var(--scb-tour-content-color, var(--md-sys-color-info-container));
|
|
119
|
+
--scb-button-filled-content-color: var(--scb-tour-surface-color, var(--md-sys-color-on-info-container));
|
|
120
|
+
--scb-button-disabled-content-color: color-mix(in srgb, var(--scb-tour-content-color, var(--md-sys-color-info-container)) calc(100% * var(--md-sys-state-disabled-state-layer-opacity, 0.38)), transparent);
|
|
121
|
+
--md-icon-button-icon-color: var(--scb-tour-content-color, var(--md-sys-color-info-container));
|
|
122
|
+
--md-focus-ring-color: var(--scb-tour-content-color, var(--md-sys-color-info-container));
|
|
123
|
+
}
|
|
124
|
+
.body {
|
|
125
|
+
display: grid;
|
|
126
|
+
gap: var(--scb-tour-design-gap-medium);
|
|
127
|
+
max-block-size: calc(min(var(--available-height, 100vh), 100vh - 2 * var(--spacing-4, 12px)) - 2 * var(--scb-tour-design-padding-medium));
|
|
128
|
+
overflow: auto;
|
|
129
|
+
overflow-wrap: anywhere;
|
|
130
|
+
}
|
|
131
|
+
.header { display: flex; align-items: start; gap: var(--scb-tour-design-gap-medium); }
|
|
132
|
+
h2 {
|
|
133
|
+
flex: 1;
|
|
134
|
+
margin: 0;
|
|
135
|
+
font-family: var(--scb-tour-design-title-medium-font);
|
|
136
|
+
font-size: var(--scb-tour-design-title-medium-size);
|
|
137
|
+
line-height: var(--scb-tour-design-title-medium-line-height);
|
|
138
|
+
font-weight: var(--scb-tour-design-title-medium-weight);
|
|
139
|
+
letter-spacing: var(--scb-tour-design-title-medium-tracking);
|
|
140
|
+
}
|
|
141
|
+
p { margin: 0; }
|
|
142
|
+
.footer { display: flex; align-items: center; flex-wrap: wrap; gap: var(--scb-tour-design-gap-medium); }
|
|
143
|
+
.counter { margin-inline-end: auto; }
|
|
144
|
+
.actions { display: flex; flex-wrap: wrap; gap: var(--scb-tour-design-gap-medium); }
|
|
145
|
+
.arrow {
|
|
146
|
+
position: absolute;
|
|
147
|
+
left: clamp(var(--scb-tour-design-arrow-size-medium), calc(var(--anchor-x) - var(--scb-tour-design-arrow-size-medium)), calc(100% - 3 * var(--scb-tour-design-arrow-size-medium)));
|
|
148
|
+
top: calc(-1 * var(--scb-tour-design-arrow-size-medium));
|
|
149
|
+
inline-size: calc(2 * var(--scb-tour-design-arrow-size-medium));
|
|
150
|
+
block-size: var(--scb-tour-design-arrow-size-medium);
|
|
151
|
+
background: inherit;
|
|
152
|
+
clip-path: polygon(50% 0, 100% 100%, 0 100%);
|
|
153
|
+
pointer-events: none;
|
|
154
|
+
}
|
|
155
|
+
.surface[data-side='top'] { translate: 0 -100%; }
|
|
156
|
+
.surface[data-side='top'] .arrow { top: 100%; transform: rotate(180deg); }
|
|
157
|
+
|
|
158
|
+
/* design:bindings:scb-tour:start */
|
|
159
|
+
/* Genererat från src/scb-components/scb-tour/component.json. Kör component:finish efter ändring. */
|
|
160
|
+
:host {
|
|
161
|
+
--scb-tour-design-padding-medium: var(--spacing-5, 16px);
|
|
162
|
+
--scb-tour-design-gap-medium: var(--spacing-4, 12px);
|
|
163
|
+
--scb-tour-design-radius-medium: var(--radius-medium, 12px);
|
|
164
|
+
--scb-tour-design-anchor-gap-medium: var(--spacing-4, 12px);
|
|
165
|
+
--scb-tour-design-arrow-size-medium: var(--spacing-3, 8px);
|
|
166
|
+
--scb-tour-design-title-medium-font: var(--scb-typography-title-medium-font, var(--md-sys-typescale-title-medium-font, var(--brand)));
|
|
167
|
+
--scb-tour-design-title-medium-size: var(--scb-typography-title-medium-size, var(--md-sys-typescale-title-medium-size, 18px));
|
|
168
|
+
--scb-tour-design-title-medium-line-height: var(--scb-typography-title-medium-line-height, var(--md-sys-typescale-title-medium-line-height, 26px));
|
|
169
|
+
--scb-tour-design-title-medium-tracking: var(--scb-typography-title-medium-tracking, var(--md-sys-typescale-title-medium-tracking, var(--tracking-05, -0.3px)));
|
|
170
|
+
--scb-tour-design-title-medium-weight: var(--scb-typography-title-medium-weight, var(--md-sys-typescale-title-medium-weight, var(--weight-semibold, 600)));
|
|
171
|
+
--scb-tour-design-title-medium-letter-spacing: var(--scb-typography-title-medium-letter-spacing, var(--scb-typography-title-medium-tracking, var(--md-sys-typescale-title-medium-tracking, var(--tracking-05, -0.3px))));
|
|
172
|
+
--scb-tour-design-title-medium-font-weight: var(--scb-typography-title-medium-font-weight, var(--scb-typography-title-medium-weight, var(--md-sys-typescale-title-medium-weight, var(--weight-semibold, 600))));
|
|
173
|
+
--scb-tour-design-supporting-medium-font: var(--scb-typography-body-medium-font, var(--md-sys-typescale-body-medium-font, var(--brand)));
|
|
174
|
+
--scb-tour-design-supporting-medium-size: var(--scb-typography-body-medium-size, var(--md-sys-typescale-body-medium-size, 16px));
|
|
175
|
+
--scb-tour-design-supporting-medium-line-height: var(--scb-typography-body-medium-line-height, var(--md-sys-typescale-body-medium-line-height, 24px));
|
|
176
|
+
--scb-tour-design-supporting-medium-tracking: var(--scb-typography-body-medium-tracking, var(--md-sys-typescale-body-medium-tracking, var(--tracking-03, -0.15px)));
|
|
177
|
+
--scb-tour-design-supporting-medium-weight: var(--scb-typography-body-medium-weight, var(--md-sys-typescale-body-medium-weight, var(--weight-regular, 400)));
|
|
178
|
+
--scb-tour-design-supporting-medium-letter-spacing: var(--scb-typography-body-medium-letter-spacing, var(--scb-typography-body-medium-tracking, var(--md-sys-typescale-body-medium-tracking, var(--tracking-03, -0.15px))));
|
|
179
|
+
--scb-tour-design-supporting-medium-font-weight: var(--scb-typography-body-medium-font-weight, var(--scb-typography-body-medium-weight, var(--md-sys-typescale-body-medium-weight, var(--weight-regular, 400))));
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
/* design:bindings:scb-tour:end */
|
|
183
|
+
`;
|
|
184
|
+
}
|
|
185
|
+
connectedCallback() {
|
|
186
|
+
super.connectedCallback(), this._readSteps(), this._stepObserver.observe(this, {
|
|
187
|
+
childList: !0,
|
|
188
|
+
subtree: !0,
|
|
189
|
+
characterData: !0,
|
|
190
|
+
attributes: !0,
|
|
191
|
+
attributeFilter: ["target", "heading"]
|
|
192
|
+
}), document.readyState !== "complete" && window.addEventListener("load", this._startOnLoad, { once: !0 });
|
|
193
|
+
}
|
|
194
|
+
disconnectedCallback() {
|
|
195
|
+
this._startRequest++, this._stepObserver.disconnect(), window.removeEventListener("load", this._startOnLoad), this._hide(), super.disconnectedCallback();
|
|
196
|
+
}
|
|
197
|
+
updated(e) {
|
|
198
|
+
this.open && e.has("open") && (this._autoStartAttempted = !0, this._startRequest++), this.open ? e.has("open") || e.has("step") || e.has("_steps") ? this._showStep() : e.has("spotlight") && this._position() : this._hide(), this._startOnLoad();
|
|
199
|
+
}
|
|
200
|
+
_readSteps() {
|
|
201
|
+
this._steps = Array.from(this.children).filter((e) => e instanceof r).map((e) => ({
|
|
202
|
+
target: e.target,
|
|
203
|
+
heading: e.heading,
|
|
204
|
+
content: (e.textContent ?? "").replace(/\s+/g, " ").trim()
|
|
205
|
+
}));
|
|
206
|
+
}
|
|
207
|
+
_findTarget(e) {
|
|
208
|
+
if (!e) return null;
|
|
209
|
+
try {
|
|
210
|
+
let t = this.querySelector(e) ?? this.getRootNode().querySelector(e);
|
|
211
|
+
return t instanceof HTMLElement ? t : null;
|
|
212
|
+
} catch {
|
|
213
|
+
return null;
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
start() {
|
|
217
|
+
this._autoStartAttempted = !0, this._startRequest++, this.step = 0, this.open = !0;
|
|
218
|
+
}
|
|
219
|
+
close() {
|
|
220
|
+
this._autoStartAttempted = !0, this._startRequest++, this._close("dismiss");
|
|
221
|
+
}
|
|
222
|
+
_close(e) {
|
|
223
|
+
if (this.open) {
|
|
224
|
+
if (this._shownStorageKey && e !== "target-unavailable") try {
|
|
225
|
+
localStorage.setItem(this._shownStorageKey, "seen");
|
|
226
|
+
} catch {}
|
|
227
|
+
this.open = !1, this._hide(), this.dispatchEvent(new CustomEvent("close", {
|
|
228
|
+
detail: {
|
|
229
|
+
reason: e,
|
|
230
|
+
step: this.step
|
|
231
|
+
},
|
|
232
|
+
bubbles: !0,
|
|
233
|
+
composed: !0
|
|
234
|
+
}));
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
_hide() {
|
|
238
|
+
this._operation++, cancelAnimationFrame(this._frame), this._resizeObserver.disconnect(), window.removeEventListener("resize", this._onResize), window.removeEventListener("keydown", this._onKeydown), window.removeEventListener("scroll", this._schedulePosition, !0), this._scrollRoots.forEach((e) => e.removeEventListener("scroll", this._schedulePosition, !0)), this._scrollRoots = [];
|
|
239
|
+
let e = (this.shadowRoot?.querySelector(".surface"))?.contains(this.shadowRoot?.activeElement ?? null), n = this.shadowRoot?.querySelector(".layer");
|
|
240
|
+
t(n), n?.removeAttribute("data-moving"), e && this._returnFocus?.isConnected && this._returnFocus.focus({ preventScroll: !0 }), this._returnFocus = void 0, this._target = void 0, this._spotlightTarget = void 0, this._shownStorageKey = "";
|
|
241
|
+
}
|
|
242
|
+
async _showStep() {
|
|
243
|
+
let e = ++this._operation;
|
|
244
|
+
if (await this.updateComplete, !this.open || e !== this._operation) return;
|
|
245
|
+
let t = Math.max(0, Math.min(this._steps.length - 1, Math.trunc(this.step) || 0));
|
|
246
|
+
if (this.step !== t) {
|
|
247
|
+
this.step = t;
|
|
248
|
+
return;
|
|
249
|
+
}
|
|
250
|
+
let r = this._steps[t], i = this._findTarget(r?.target);
|
|
251
|
+
if (!i || !this._isVisible(i)) {
|
|
252
|
+
this._close("target-unavailable");
|
|
253
|
+
return;
|
|
254
|
+
}
|
|
255
|
+
let a = this.shadowRoot.querySelector(".surface"), o = this.shadowRoot.querySelector(".layer");
|
|
256
|
+
if (!o.matches(":popover-open")) {
|
|
257
|
+
this._shownStorageKey = this.storageKey;
|
|
258
|
+
let e = document.activeElement;
|
|
259
|
+
for (; e?.shadowRoot?.activeElement;) e = e.shadowRoot.activeElement;
|
|
260
|
+
e instanceof HTMLElement && (this._returnFocus = e);
|
|
261
|
+
}
|
|
262
|
+
this._target = i;
|
|
263
|
+
let s = i.getBoundingClientRect();
|
|
264
|
+
if ((s.top < 0 || s.bottom > innerHeight || s.left < 0 || s.right > innerWidth) && i.scrollIntoView({
|
|
265
|
+
block: "center",
|
|
266
|
+
inline: "nearest",
|
|
267
|
+
behavior: "instant"
|
|
268
|
+
}), !n(o, i)) {
|
|
269
|
+
this._close("target-unavailable");
|
|
270
|
+
return;
|
|
271
|
+
}
|
|
272
|
+
this._resizeObserver.disconnect(), this._resizeObserver.observe(i), this._resizeObserver.observe(a), window.addEventListener("resize", this._onResize), window.addEventListener("scroll", this._schedulePosition, !0), this._scrollRoots.forEach((e) => e.removeEventListener("scroll", this._schedulePosition, !0)), this._scrollRoots = [];
|
|
273
|
+
let c = i.getRootNode();
|
|
274
|
+
for (; c instanceof ShadowRoot;) c.addEventListener("scroll", this._schedulePosition, !0), this._scrollRoots.push(c), c = c.host.getRootNode();
|
|
275
|
+
this._position(), a.focus({ preventScroll: !0 }), this.dispatchEvent(new CustomEvent("stepchange", {
|
|
276
|
+
detail: {
|
|
277
|
+
step: t,
|
|
278
|
+
total: this._steps.length
|
|
279
|
+
},
|
|
280
|
+
bubbles: !0,
|
|
281
|
+
composed: !0
|
|
282
|
+
}));
|
|
283
|
+
}
|
|
284
|
+
_isVisible(e) {
|
|
285
|
+
let t = getComputedStyle(e), n = e.getBoundingClientRect();
|
|
286
|
+
return e.isConnected && t.visibility !== "hidden" && n.width > 0 && n.height > 0;
|
|
287
|
+
}
|
|
288
|
+
_position() {
|
|
289
|
+
let e = this._target, t = this.shadowRoot?.querySelector(".surface");
|
|
290
|
+
if (!this.open || !t || !e) return;
|
|
291
|
+
if (!this._isVisible(e)) {
|
|
292
|
+
this._close("target-unavailable");
|
|
293
|
+
return;
|
|
294
|
+
}
|
|
295
|
+
let n = getComputedStyle(this), r = Number.parseFloat(n.getPropertyValue("--spacing-4")) || 12, i = Number.parseFloat(n.getPropertyValue("--scb-tour-design-anchor-gap-medium")) || 12, a = e.getBoundingClientRect();
|
|
296
|
+
if (this.spotlight) {
|
|
297
|
+
window.addEventListener("keydown", this._onKeydown);
|
|
298
|
+
let t = this.shadowRoot.querySelector(".layer");
|
|
299
|
+
this._spotlightTarget !== e && (t.toggleAttribute("data-moving", !!this._spotlightTarget), this._spotlightTarget = e), t.style.setProperty("--_spotlight-left", `${a.left}px`), t.style.setProperty("--_spotlight-top", `${a.top}px`), t.style.setProperty("--_spotlight-width", `${a.width}px`), t.style.setProperty("--_spotlight-height", `${a.height}px`);
|
|
300
|
+
} else window.removeEventListener("keydown", this._onKeydown), this._spotlightTarget = void 0;
|
|
301
|
+
let o = t.getBoundingClientRect(), s = innerHeight - a.bottom - i, c = a.top - i, l = s >= o.height + r || s >= c ? "bottom" : "top";
|
|
302
|
+
t.style.setProperty("--available-height", `calc(${Math.max(0, (l === "bottom" ? innerHeight - a.bottom : a.top) - r)}px - var(--scb-tour-design-anchor-gap-medium))`);
|
|
303
|
+
let u = Math.max(r, Math.min(a.left + a.width / 2 - o.width / 2, innerWidth - o.width - r));
|
|
304
|
+
t.style.left = `${u}px`, t.style.top = l === "bottom" ? `calc(${a.bottom}px + var(--scb-tour-design-anchor-gap-medium))` : `calc(${a.top}px - var(--scb-tour-design-anchor-gap-medium))`, t.dataset.side = l, t.style.setProperty("--anchor-x", `${a.left + a.width / 2 - u}px`);
|
|
305
|
+
}
|
|
306
|
+
render() {
|
|
307
|
+
let e = this._steps[this.step], t = this.stepLabel.replace("{current}", String(this.step + 1)).replace("{total}", String(this._steps.length));
|
|
308
|
+
return o`
|
|
309
|
+
<slot name="trigger" @click=${(e) => {
|
|
310
|
+
e.defaultPrevented || this.start();
|
|
311
|
+
}}></slot>
|
|
312
|
+
<slot></slot>
|
|
313
|
+
<div class="layer" popover="manual">
|
|
314
|
+
<svg class="spotlight" aria-hidden="true" focusable="false">
|
|
315
|
+
<defs>
|
|
316
|
+
<mask id=${this._spotlightId} maskUnits="userSpaceOnUse" x="0" y="0" width="100%" height="100%">
|
|
317
|
+
<rect width="100%" height="100%" fill="white"></rect>
|
|
318
|
+
<rect class="spotlight-hole" fill="black"></rect>
|
|
319
|
+
</mask>
|
|
320
|
+
</defs>
|
|
321
|
+
<rect class="spotlight-scrim" width="100%" height="100%" mask=${`url(#${this._spotlightId})`}></rect>
|
|
322
|
+
</svg>
|
|
323
|
+
<section class="surface" part="surface" role="dialog" tabindex="-1"
|
|
324
|
+
aria-labelledby="heading" aria-describedby="content counter" @keydown=${this._onKeydown}>
|
|
325
|
+
<span class="arrow" part="arrow" aria-hidden="true"></span>
|
|
326
|
+
<div class="body">
|
|
327
|
+
<div class="header">
|
|
328
|
+
<h2 id="heading">${e?.heading}</h2>
|
|
329
|
+
<scb-icon-button size="small" icon="close" aria-label=${this.closeLabel} @click=${this.close}></scb-icon-button>
|
|
330
|
+
</div>
|
|
331
|
+
<p id="content">${e?.content}</p>
|
|
332
|
+
<div class="footer">
|
|
333
|
+
<span id="counter" class="counter">${t}</span>
|
|
334
|
+
<div class="actions">
|
|
335
|
+
<scb-button variant="text" size="small" .label=${this.previousLabel} ?disabled=${this.step <= 0} @click=${() => this.step--}></scb-button>
|
|
336
|
+
<scb-button size="small" .label=${this.step === this._steps.length - 1 ? this.doneLabel : this.nextLabel} @click=${this._next}></scb-button>
|
|
337
|
+
</div>
|
|
338
|
+
</div>
|
|
339
|
+
</div>
|
|
340
|
+
</section>
|
|
341
|
+
</div>
|
|
342
|
+
`;
|
|
343
|
+
}
|
|
344
|
+
};
|
|
345
|
+
e([c({
|
|
346
|
+
type: String,
|
|
347
|
+
reflect: !0
|
|
348
|
+
})], f.prototype, "variant", void 0), e([c({
|
|
349
|
+
type: Boolean,
|
|
350
|
+
reflect: !0,
|
|
351
|
+
converter: d
|
|
352
|
+
})], f.prototype, "spotlight", void 0), e([c({
|
|
353
|
+
type: Boolean,
|
|
354
|
+
reflect: !0,
|
|
355
|
+
converter: d
|
|
356
|
+
})], f.prototype, "open", void 0), e([c({
|
|
357
|
+
type: Boolean,
|
|
358
|
+
attribute: "auto-start",
|
|
359
|
+
converter: d
|
|
360
|
+
})], f.prototype, "autoStart", void 0), e([c({
|
|
361
|
+
type: String,
|
|
362
|
+
attribute: "storage-key"
|
|
363
|
+
})], f.prototype, "storageKey", void 0), e([c({
|
|
364
|
+
type: Number,
|
|
365
|
+
reflect: !0
|
|
366
|
+
})], f.prototype, "step", void 0), e([c({ attribute: "close-label" })], f.prototype, "closeLabel", void 0), e([c({ attribute: "previous-label" })], f.prototype, "previousLabel", void 0), e([c({ attribute: "next-label" })], f.prototype, "nextLabel", void 0), e([c({ attribute: "done-label" })], f.prototype, "doneLabel", void 0), e([c({ attribute: "step-label" })], f.prototype, "stepLabel", void 0), e([l()], f.prototype, "_steps", void 0), f = u = e([s("scb-tour")], f);
|
|
367
|
+
//#endregion
|
|
368
|
+
export { f as ScbTour };
|
|
@@ -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
|
|
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
|
|
102
|
-
let r =
|
|
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
|
|
106
|
-
let t = r.dashStyles, n = r.markerSymbols,
|
|
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:
|
|
113
|
+
patternKind: i[e % i.length]
|
|
111
114
|
};
|
|
112
115
|
}
|
|
113
116
|
//#endregion
|
|
114
|
-
export {
|
|
117
|
+
export { s as appendScbVizSeriesDifferentiationPatternMarks, o as getScbVizSeriesDifferentiationPatternDefinition, a as getScbVizSeriesDifferentiationPatternKinds, i as getScbVizSeriesDifferentiationRegistry, c as getScbVizSeriesDifferentiationVariant, r as scbVizSeriesDifferentiationRegistry };
|
package/scb-viz/scb-viz.js
CHANGED
|
@@ -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 {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
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";
|
|
@@ -1161,16 +1161,16 @@ var H = /* @__PURE__ */ new Set([
|
|
|
1161
1161
|
].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;
|
|
1162
1162
|
}
|
|
1163
1163
|
_getSeriesDifferentiationVariantByIndex(e) {
|
|
1164
|
-
return
|
|
1164
|
+
return S(e);
|
|
1165
1165
|
}
|
|
1166
1166
|
_isGroupedSeriesDifferentiationChart(e, t) {
|
|
1167
|
-
return
|
|
1167
|
+
return C(e, t);
|
|
1168
1168
|
}
|
|
1169
1169
|
_usesGroupedPointDifferentiation(e) {
|
|
1170
|
-
return
|
|
1170
|
+
return O(e);
|
|
1171
1171
|
}
|
|
1172
1172
|
_getGroupedSeriesDifferentiationVariant(e, t, n) {
|
|
1173
|
-
let r =
|
|
1173
|
+
let r = v(e, t, n);
|
|
1174
1174
|
return {
|
|
1175
1175
|
...r,
|
|
1176
1176
|
variantIndex: typeof r.variantIndex == "number" ? r.variantIndex : n
|
|
@@ -1202,7 +1202,7 @@ var H = /* @__PURE__ */ new Set([
|
|
|
1202
1202
|
});
|
|
1203
1203
|
}
|
|
1204
1204
|
_shouldShowSeriesDifferentiationAction() {
|
|
1205
|
-
return
|
|
1205
|
+
return D({
|
|
1206
1206
|
chart: this._getCurrentHighchartsChart(),
|
|
1207
1207
|
getCurrentPrintableView: () => this._getCurrentPrintableView(),
|
|
1208
1208
|
getSeriesDifferentiationGroup: (e, t) => this._getSeriesDifferentiationGroup(e, t),
|
|
@@ -1221,45 +1221,45 @@ var H = /* @__PURE__ */ new Set([
|
|
|
1221
1221
|
return { marker: a && Object.keys(a).length > 0 ? a : t && Object.keys(t).length > 0 ? t : { enabled: !1 } };
|
|
1222
1222
|
}
|
|
1223
1223
|
_isHighchartsStyledMode(e) {
|
|
1224
|
-
return
|
|
1224
|
+
return w(e);
|
|
1225
1225
|
}
|
|
1226
1226
|
_getHighchartsSvgRoot(e) {
|
|
1227
|
-
return
|
|
1227
|
+
return b(e);
|
|
1228
1228
|
}
|
|
1229
1229
|
_getHighchartsColorClassName(e, t) {
|
|
1230
|
-
return
|
|
1230
|
+
return y(e, t);
|
|
1231
1231
|
}
|
|
1232
1232
|
_setSeriesDifferentiationMetadata(e, t) {
|
|
1233
|
-
|
|
1233
|
+
E(e, t);
|
|
1234
1234
|
}
|
|
1235
1235
|
_clearSeriesDifferentiationMetadata(e) {
|
|
1236
|
-
|
|
1236
|
+
g(e);
|
|
1237
1237
|
}
|
|
1238
1238
|
_setSeriesDifferentiationColorClass(e, t) {
|
|
1239
|
-
|
|
1239
|
+
T(e, t);
|
|
1240
1240
|
}
|
|
1241
1241
|
_clearSeriesDifferentiationColorClass(e) {
|
|
1242
|
-
|
|
1242
|
+
h(e);
|
|
1243
1243
|
}
|
|
1244
1244
|
_getLegendSeriesDifferentiationTargets(e) {
|
|
1245
|
-
return
|
|
1245
|
+
return x(e);
|
|
1246
1246
|
}
|
|
1247
1247
|
_ensureStyledModeSeriesPattern(e, t, n) {
|
|
1248
|
-
|
|
1248
|
+
_(e, t, n);
|
|
1249
1249
|
}
|
|
1250
1250
|
_applyStyledModeSeriesDifferentiation(e) {
|
|
1251
|
-
let
|
|
1252
|
-
if (!
|
|
1253
|
-
|
|
1254
|
-
let
|
|
1255
|
-
e.series?.forEach((t,
|
|
1251
|
+
let t = this._getHighchartsSvgRoot(e);
|
|
1252
|
+
if (!t) return;
|
|
1253
|
+
t.classList.add("scb-viz-series-differentiation-enabled");
|
|
1254
|
+
let n = m(), r = this._getSeriesDifferentiationSnapshotStore(e);
|
|
1255
|
+
e.series?.forEach((t, i) => {
|
|
1256
1256
|
let a = this._getSeriesDifferentiationGroup(t, e);
|
|
1257
1257
|
if (!a) return;
|
|
1258
|
-
let o = String(t?.index ??
|
|
1259
|
-
|
|
1260
|
-
let s = a === "grouped-fill" && this._usesGroupedPointDifferentiation(t), c = a === "grouped-fill" ? this._getGroupedSeriesDifferentiationVariant(t, e,
|
|
1261
|
-
variantIndex:
|
|
1262
|
-
...this._getSeriesDifferentiationVariantByIndex(
|
|
1258
|
+
let o = String(t?.index ?? i);
|
|
1259
|
+
r.has(o) || r.set(o, this._captureSeriesDifferentiationSnapshot(t));
|
|
1260
|
+
let s = a === "grouped-fill" && this._usesGroupedPointDifferentiation(t), c = a === "grouped-fill" ? this._getGroupedSeriesDifferentiationVariant(t, e, i) : {
|
|
1261
|
+
variantIndex: i,
|
|
1262
|
+
...this._getSeriesDifferentiationVariantByIndex(i)
|
|
1263
1263
|
}, { dashStyle: l, markerSymbol: u, patternKind: d } = c, f = this._getHighchartsColorClassName(t?.graph ?? t?.area ?? t?.group, c.variantIndex), p = this._getLegendSeriesDifferentiationTargets(t);
|
|
1264
1264
|
this._setSeriesDifferentiationMetadata(t?.graph, {
|
|
1265
1265
|
role: "graph",
|
|
@@ -1283,8 +1283,8 @@ var H = /* @__PURE__ */ new Set([
|
|
|
1283
1283
|
role: "fill",
|
|
1284
1284
|
patternKind: d
|
|
1285
1285
|
}), this._setSeriesDifferentiationColorClass(e?.graphic, f);
|
|
1286
|
-
}), this._ensureStyledModeSeriesPattern(e, f, d))), a === "point-fill" && t.points?.forEach((t,
|
|
1287
|
-
let i = r
|
|
1286
|
+
}), this._ensureStyledModeSeriesPattern(e, f, d))), a === "point-fill" && t.points?.forEach((t, r) => {
|
|
1287
|
+
let i = n[r % n.length], a = this._getHighchartsColorClassName(t?.graphic ?? t?.legendSymbol ?? t?.legendItem?.symbol ?? t?.legendItem?.group, r), o = this._getLegendSeriesDifferentiationTargets(t);
|
|
1288
1288
|
this._setSeriesDifferentiationMetadata(t?.graphic, {
|
|
1289
1289
|
role: "fill",
|
|
1290
1290
|
patternKind: i
|
|
@@ -1361,7 +1361,7 @@ var H = /* @__PURE__ */ new Set([
|
|
|
1361
1361
|
return n.has(r) ? r : t;
|
|
1362
1362
|
}
|
|
1363
1363
|
_buildExportFileName(e) {
|
|
1364
|
-
return
|
|
1364
|
+
return t({
|
|
1365
1365
|
lang: this.lang,
|
|
1366
1366
|
title: this.title
|
|
1367
1367
|
}, e);
|
|
@@ -1370,17 +1370,17 @@ var H = /* @__PURE__ */ new Set([
|
|
|
1370
1370
|
return this;
|
|
1371
1371
|
}
|
|
1372
1372
|
_getCurrentFullscreenElement() {
|
|
1373
|
-
return
|
|
1373
|
+
return o();
|
|
1374
1374
|
}
|
|
1375
1375
|
_isFullscreenSupported() {
|
|
1376
|
-
return
|
|
1376
|
+
return s(this._getFullscreenTarget());
|
|
1377
1377
|
}
|
|
1378
1378
|
_syncFullscreenState() {
|
|
1379
1379
|
let e = this._getCurrentFullscreenElement() === this._getFullscreenTarget();
|
|
1380
1380
|
this._isFullscreen = e, this.toggleAttribute("data-scb-viz-fullscreen", e), this.#c(), this.#r();
|
|
1381
1381
|
}
|
|
1382
1382
|
async _toggleFullscreen() {
|
|
1383
|
-
await
|
|
1383
|
+
await u(this._getFullscreenTarget());
|
|
1384
1384
|
}
|
|
1385
1385
|
_renderActionsMenu() {
|
|
1386
1386
|
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`;
|
|
@@ -1802,17 +1802,17 @@ var H = /* @__PURE__ */ new Set([
|
|
|
1802
1802
|
async #m(e) {
|
|
1803
1803
|
let t = this._getExportableVisualElement();
|
|
1804
1804
|
if (!t) return;
|
|
1805
|
-
let n = await
|
|
1806
|
-
n &&
|
|
1805
|
+
let n = await r(t, this._getExportSurfaceTarget(), e);
|
|
1806
|
+
n && a(n, this._buildExportFileName(e === "jpeg" ? "jpg" : "png"));
|
|
1807
1807
|
}
|
|
1808
1808
|
_getCurrentPrintableView() {
|
|
1809
1809
|
return this.variant === "Table" ? "table" : this.variant === "Image" ? "image" : this.selectedChip === "Table" ? "table" : "diagram";
|
|
1810
1810
|
}
|
|
1811
1811
|
#h(e) {
|
|
1812
|
-
return
|
|
1812
|
+
return p(this._getResolvedTableView(e), (e) => this._escapeHtml(e), { getEmptyHeaderLabel: (e) => this._getEmptyTableHeaderLabel(e) });
|
|
1813
1813
|
}
|
|
1814
1814
|
#g() {
|
|
1815
|
-
return
|
|
1815
|
+
return f({
|
|
1816
1816
|
comment: this.comment,
|
|
1817
1817
|
commentLabel: this.commentLabel,
|
|
1818
1818
|
description: this.description,
|
|
@@ -1830,7 +1830,7 @@ var H = /* @__PURE__ */ new Set([
|
|
|
1830
1830
|
});
|
|
1831
1831
|
}
|
|
1832
1832
|
#_(e) {
|
|
1833
|
-
return
|
|
1833
|
+
return d({
|
|
1834
1834
|
contentHtml: e,
|
|
1835
1835
|
escapeHtml: (e) => this._escapeHtml(e),
|
|
1836
1836
|
footerHtml: this.#g(),
|
|
@@ -1840,7 +1840,7 @@ var H = /* @__PURE__ */ new Set([
|
|
|
1840
1840
|
});
|
|
1841
1841
|
}
|
|
1842
1842
|
async #v() {
|
|
1843
|
-
await
|
|
1843
|
+
await l(this, async () => {
|
|
1844
1844
|
let e = this._getCurrentPrintableView(), t = "";
|
|
1845
1845
|
if (e === "table") {
|
|
1846
1846
|
let e = this._getResolvedTableData();
|
|
@@ -1853,16 +1853,16 @@ var H = /* @__PURE__ */ new Set([
|
|
|
1853
1853
|
} else {
|
|
1854
1854
|
let e = this._getExportableVisualElement();
|
|
1855
1855
|
if (!e) return;
|
|
1856
|
-
let n = await
|
|
1856
|
+
let n = await i(e, this._getExportSurfaceTarget(), "png");
|
|
1857
1857
|
if (!n) return;
|
|
1858
1858
|
t = `<img class="viz-chart-image" src="${n}" alt="${this._escapeHtml(this._getImageAltText())}">`;
|
|
1859
1859
|
}
|
|
1860
|
-
await
|
|
1860
|
+
await c(this.#_(t));
|
|
1861
1861
|
});
|
|
1862
1862
|
}
|
|
1863
1863
|
#y() {
|
|
1864
1864
|
let e = this._getResolvedTableData();
|
|
1865
|
-
e?.rows?.length &&
|
|
1865
|
+
e?.rows?.length && a(n(A(e, (e) => this._normalizeRenderableCell(e)), this.lang), this._buildExportFileName("csv"));
|
|
1866
1866
|
}
|
|
1867
1867
|
#b() {
|
|
1868
1868
|
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);
|