@svgrid/grid-wc 3.0.46 → 3.0.48
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/dist/GridFind-C1YbloFh.js +39 -0
- package/dist/GridFooter-DOR8m9GQ.js +142 -0
- package/dist/GridMenus-Da8XGbc6.js +1461 -0
- package/dist/PinSplitter-Du4ZF8T3.js +178 -0
- package/dist/SvChartMenu-B6kpmwUv.js +401 -0
- package/dist/{SvDateRangeInput-Cpss2SsG.js → SvDateRangeInput-ByR-LFgf.js} +78 -77
- package/dist/SvDateTimePicker-BCxhFb5c.js +763 -0
- package/dist/{SvField-C--8r4go.js → SvField-CtzxdF7J.js} +100 -99
- package/dist/SvGridCellEditor-BUdVD7xM.js +594 -0
- package/dist/SvGridChart-DkKI8-bj.js +3684 -0
- package/dist/SvGridChartBuilder-BCQ3W8TY.js +1086 -0
- package/dist/SvGridChartPanel-uqul044E.js +1689 -0
- package/dist/{SvGridChartView-Bvacwk37.js → SvGridChartView-DWxEFzdM.js} +9 -8
- package/dist/SvGridDropdown-CnCQuXaI.js +258 -0
- package/dist/angular/fesm2022/svgrid-grid-wc-angular.mjs +12 -3
- package/dist/angular/fesm2022/svgrid-grid-wc-angular.mjs.map +1 -1
- package/dist/angular/types/svgrid-grid-wc-angular.d.ts +5 -1
- package/dist/chart/SvChartMenu-NxEyX5kU.js +635 -0
- package/dist/chart/{chart-export-C43UPY8D.js → chart-export-Dj_zVsjI.js} +5 -7
- package/dist/chart/chart-export-pdf-pmzjhHhB.js +156 -0
- package/dist/chart/{client-BuB0wIgc.js → client-Y303i9Lw.js} +1317 -1214
- package/dist/chart/sv-chart-element.js +2390 -2405
- package/dist/chart-export-pdf-DyuVs1gO.js +156 -0
- package/dist/client-OtsRxGjS.js +3075 -0
- package/dist/{column-resize-DUPgynvc.js → column-resize-SEn7el6C.js} +21 -9
- package/dist/{csv-injection-Ce26_TOb.js → csv-injection-Cxf6dMrr.js} +1 -1
- package/dist/{date-format-B0RznzxC.js → date-format-DngG1HJ5.js} +402 -407
- package/dist/{shadow/export-format-6jDuF2nb.js → export-format-7DhxeN27.js} +2 -2
- package/dist/{grid-extension.svelte-CBhmpjuc.js → grid-extension.svelte-DToFhcZv.js} +1 -1
- package/dist/grid-menu-messages-BEsB6Jhh.js +57 -0
- package/dist/history-Q12tf0k-.js +80 -0
- package/dist/list-option-DpIu99JN.js +203 -0
- package/dist/menu-focus-lmTebXyL.js +45 -0
- package/dist/range-commit-C6Rogxem.js +385 -0
- package/dist/react/index.d.ts +11 -0
- package/dist/react/index.js +2 -1
- package/dist/shadow/GridFind-CcoKoisE.js +39 -0
- package/dist/shadow/GridFooter-CDq71ytl.js +142 -0
- package/dist/shadow/GridMenus-RAp-E3hp.js +1461 -0
- package/dist/shadow/PinSplitter-BAYTAZtm.js +178 -0
- package/dist/shadow/SvChartMenu-C74rWwjU.js +401 -0
- package/dist/shadow/{SvDateRangeInput-Cpss2SsG.js → SvDateRangeInput-9Wq4E64y.js} +78 -77
- package/dist/shadow/SvDateTimePicker-y9jPLR19.js +763 -0
- package/dist/shadow/{SvField-C--8r4go.js → SvField-DGPj2clt.js} +100 -99
- package/dist/shadow/SvGridCellEditor-CzeBp9lp.js +594 -0
- package/dist/shadow/SvGridChart-zTsB6F3Y.js +3684 -0
- package/dist/shadow/SvGridChartBuilder-VUKgOcp7.js +1086 -0
- package/dist/shadow/SvGridChartPanel-DkjEUB7t.js +1689 -0
- package/dist/shadow/{SvGridChartView-Bvacwk37.js → SvGridChartView-DQmJahyT.js} +9 -8
- package/dist/shadow/SvGridDropdown-B_5kqHQE.js +258 -0
- package/dist/shadow/chart-export-pdf-BZy6f5QB.js +156 -0
- package/dist/shadow/client-OtsRxGjS.js +3075 -0
- package/dist/shadow/{column-resize-DUPgynvc.js → column-resize-SEn7el6C.js} +21 -9
- package/dist/shadow/{csv-injection-Ce26_TOb.js → csv-injection-Cxf6dMrr.js} +1 -1
- package/dist/shadow/{date-format-B0RznzxC.js → date-format-C9UkbCig.js} +402 -407
- package/dist/{export-format-6jDuF2nb.js → shadow/export-format-7DhxeN27.js} +2 -2
- package/dist/shadow/{grid-extension.svelte-CBhmpjuc.js → grid-extension.svelte-DToFhcZv.js} +1 -1
- package/dist/shadow/grid-menu-messages-BEsB6Jhh.js +57 -0
- package/dist/shadow/history-Q12tf0k-.js +80 -0
- package/dist/shadow/list-option-DpIu99JN.js +203 -0
- package/dist/shadow/menu-focus-lmTebXyL.js +45 -0
- package/dist/shadow/range-commit-C6Rogxem.js +385 -0
- package/dist/shadow/sv-grid-shadow-element.d.ts +7 -0
- package/dist/shadow/sv-grid-shadow-element.js +4236 -4469
- package/dist/shadow/{svelte-virtualizer.svelte-u-y0InK2.js → svelte-virtualizer.svelte-DWvD9wvL.js} +17 -12
- package/dist/sv-grid-element.d.ts +7 -0
- package/dist/sv-grid-element.js +4219 -4452
- package/dist/{svelte-virtualizer.svelte-u-y0InK2.js → svelte-virtualizer.svelte-DWvD9wvL.js} +17 -12
- package/dist/vue/index.d.ts +6 -2
- package/dist/vue/index.js +1 -1
- package/package.json +4 -4
- package/dist/GridFind-DianRZxS.js +0 -39
- package/dist/GridFooter-Bp3o5qJX.js +0 -162
- package/dist/GridMenus-BYkY3nhr.js +0 -1405
- package/dist/PinSplitter-CinhgIrH.js +0 -130
- package/dist/SvChartMenu-CgAcTloT.js +0 -413
- package/dist/SvDateTimePicker-DyRO_e91.js +0 -770
- package/dist/SvGridCellEditor-DHHGSjgp.js +0 -584
- package/dist/SvGridChart-BFQLtNmn.js +0 -3703
- package/dist/SvGridChartBuilder-CtGuoAOV.js +0 -1166
- package/dist/SvGridChartPanel-CeaXNzmV.js +0 -1743
- package/dist/SvGridDropdown-CrECQYeq.js +0 -257
- package/dist/chart/SvChartMenu-DslxOgPN.js +0 -590
- package/dist/chart/chart-export-pdf-C0_y8glC.js +0 -104
- package/dist/chart-export-pdf-DDVtypH7.js +0 -104
- package/dist/client-DtIdusS4.js +0 -2974
- package/dist/focus-trap-Dbb2tJxb.js +0 -65
- package/dist/list-option-DrRyivWp.js +0 -82
- package/dist/shadow/GridFind-DianRZxS.js +0 -39
- package/dist/shadow/GridFooter-DvMFqeNV.js +0 -162
- package/dist/shadow/GridMenus-DKLNTKDZ.js +0 -1405
- package/dist/shadow/PinSplitter-CinhgIrH.js +0 -130
- package/dist/shadow/SvChartMenu-CgAcTloT.js +0 -413
- package/dist/shadow/SvDateTimePicker-DyRO_e91.js +0 -770
- package/dist/shadow/SvGridCellEditor-DHHGSjgp.js +0 -584
- package/dist/shadow/SvGridChart-BFQLtNmn.js +0 -3703
- package/dist/shadow/SvGridChartBuilder-CtGuoAOV.js +0 -1166
- package/dist/shadow/SvGridChartPanel-CeaXNzmV.js +0 -1743
- package/dist/shadow/SvGridDropdown-CrECQYeq.js +0 -257
- package/dist/shadow/chart-export-pdf-DDVtypH7.js +0 -104
- package/dist/shadow/client-DtIdusS4.js +0 -2974
- package/dist/shadow/focus-trap-Dbb2tJxb.js +0 -65
- package/dist/shadow/list-option-DrRyivWp.js +0 -82
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
(function(){try{var c=".sv-grid-chart-view.svelte-733vyy{box-sizing:border-box;width:100%;height:100%;min-height:0;display:grid}\n",g=globalThis;if(typeof g!=='undefined'){var f=(g.__SVGRID_WC_ADD_CSS_BY_BUILD__||{})["shadow"];if(typeof f==='function')f(c);else{var q=g.__SVGRID_WC_CSS_CHUNKS_BY_BUILD__=g.__SVGRID_WC_CSS_CHUNKS_BY_BUILD__||{};(q["shadow"]=q["shadow"]||[]).push(c);}}if(typeof document==='undefined')return;var x=document.querySelectorAll('style[data-svgrid-grid-wc-chunk]');for(var i=0;i<x.length;i++)if(x[i].getAttribute('data-svgrid-grid-wc-chunk')==="shadow:SvGridChartView-
|
|
1
|
+
(function(){try{var c=".sv-grid-chart-view.svelte-733vyy{box-sizing:border-box;width:100%;height:100%;min-height:0;display:grid}\n",g=globalThis;if(typeof g!=='undefined'){var f=(g.__SVGRID_WC_ADD_CSS_BY_BUILD__||{})["shadow"];if(typeof f==='function')f(c);else{var q=g.__SVGRID_WC_CSS_CHUNKS_BY_BUILD__=g.__SVGRID_WC_CSS_CHUNKS_BY_BUILD__||{};(q["shadow"]=q["shadow"]||[]).push(c);}}if(typeof document==='undefined')return;var x=document.querySelectorAll('style[data-svgrid-grid-wc-chunk]');for(var i=0;i<x.length;i++)if(x[i].getAttribute('data-svgrid-grid-wc-chunk')==="shadow:SvGridChartView-DQmJahyT.js"||x[i].textContent===c)return;var s=document.createElement('style');s.setAttribute('data-svgrid-grid-wc-chunk',"shadow:SvGridChartView-DQmJahyT.js");s.textContent=c;document.head.appendChild(s);}catch(e){}})();
|
|
2
2
|
import { s as e } from "./chart-Cwv61lx6.js";
|
|
3
|
-
import { A as t, M as n,
|
|
4
|
-
import { t as l } from "./SvGridChart-
|
|
3
|
+
import { A as t, M as n, at as r, it as i, q as a, st as o, tt as s, z as c } from "./client-OtsRxGjS.js";
|
|
4
|
+
import { t as l } from "./SvGridChart-zTsB6F3Y.js";
|
|
5
|
+
import "./sv-grid-shadow-element.js";
|
|
5
6
|
//#region ../grid/dist/SvGridChartView.svelte
|
|
6
7
|
var u = n("<div class=\"sv-grid-chart-view svelte-733vyy\"><!></div>");
|
|
7
8
|
function d(n, d) {
|
|
8
|
-
|
|
9
|
-
let f =
|
|
9
|
+
r(d, !0);
|
|
10
|
+
let f = s(() => {
|
|
10
11
|
let t = e(d.data ?? [], {
|
|
11
12
|
type: d.chart.type ?? "bar",
|
|
12
13
|
category: d.chart.category,
|
|
@@ -23,9 +24,9 @@ function d(n, d) {
|
|
|
23
24
|
let n = d.chart.locale ?? d.localization?.locale;
|
|
24
25
|
return n && (t.locale = n), d.chart.currency && (t.currency = d.chart.currency), t;
|
|
25
26
|
});
|
|
26
|
-
var p = u(), m =
|
|
27
|
+
var p = u(), m = a(p);
|
|
27
28
|
{
|
|
28
|
-
let e =
|
|
29
|
+
let e = s(() => d.chart.legend ?? !0), t = s(() => d.chart.dataLabels ?? !1);
|
|
29
30
|
l(m, {
|
|
30
31
|
get spec() {
|
|
31
32
|
return c(f);
|
|
@@ -39,7 +40,7 @@ function d(n, d) {
|
|
|
39
40
|
}
|
|
40
41
|
});
|
|
41
42
|
}
|
|
42
|
-
o(p), t(n, p),
|
|
43
|
+
o(p), t(n, p), i();
|
|
43
44
|
}
|
|
44
45
|
//#endregion
|
|
45
46
|
export { d as default };
|
|
@@ -0,0 +1,258 @@
|
|
|
1
|
+
(function(){try{var c=".sv-grid-dropdown.svelte-r4kmto{background:var(--sg-bg,#fff);height:100%;color:var(--sg-fg,#0f172a);position:absolute;top:0;left:0;right:0}.sv-grid-dropdown-trigger.svelte-r4kmto{background:var(--sg-bg,#fff);width:100%;height:100%;min-height:28px;color:var(--sg-fg,#0f172a);font:inherit;text-align:start;cursor:pointer;box-sizing:border-box;border:0;outline:none;align-items:center;gap:6px;padding:0 8px;display:flex}.sv-grid-dropdown-trigger.svelte-r4kmto:focus{outline:2px solid var(--sg-accent,#2563eb);outline-offset:-2px}.sv-grid-dropdown-trigger-chips.svelte-r4kmto{flex-wrap:wrap;align-items:center;padding:4px 8px}.sv-grid-dropdown-chips.svelte-r4kmto{flex-wrap:wrap;flex:auto;align-items:center;gap:4px;min-width:0;display:inline-flex}.sv-grid-dropdown-label.svelte-r4kmto{text-overflow:ellipsis;white-space:nowrap;flex:auto;min-width:0;overflow:hidden}.sv-grid-dropdown-caret.svelte-r4kmto{opacity:.7;flex:none;font-size:10px;line-height:1}.sv-grid-dropdown-panel{background:var(--sg-header-bg,var(--sg-bg,#fff));color:var(--sg-fg,#0f172a);border:1px solid var(--sg-accent,#2563eb);border-radius:6px;padding:4px 0;font-family:inherit;overflow-y:auto;box-shadow:0 12px 28px #00000073}.sv-grid-dropdown-panel.sv-grid-dropdown-panel-fits{overflow:visible}.sv-grid-dropdown-option{cursor:pointer;-webkit-user-select:none;user-select:none;color:var(--sg-fg,#0f172a);align-items:center;gap:8px;padding:6px 10px;display:flex}.sv-grid-dropdown-option-highlighted{background:var(--sg-row-hover-bg,#2563eb1a)}.sv-grid-dropdown-option-selected{background:var(--sg-selection-bg,#2563eb26);font-weight:600}.sv-grid-dropdown-option-selected.sv-grid-dropdown-option-highlighted{background:var(--sg-row-hover-bg,#2563eb2e)}.sv-grid-dropdown-option-label{text-overflow:ellipsis;white-space:nowrap;flex:auto;min-width:0;overflow:hidden}.sv-grid-dropdown-check{color:var(--sg-accent,#2563eb);flex:0 0 16px;justify-content:center;align-items:center;font-weight:700;display:inline-flex}.sv-grid-dropdown-swatch{border:1px solid color-mix(in srgb, var(--sg-fg,#0f172a) 25%, transparent);border-radius:999px;flex:0 0 12px;width:12px;height:12px}.sv-grid-dropdown-option-chip{text-overflow:ellipsis;white-space:nowrap;border:1px solid #0000;border-radius:999px;align-items:center;max-width:100%;padding:2px 11px;font-size:.9em;font-weight:600;line-height:1.5;display:inline-flex;overflow:hidden}.sv-grid-dropdown-empty{color:var(--sg-muted,#0f172a8c);padding:8px 10px;font-size:.9em;font-style:italic}.sv-grid-dropdown-footer{border-top:1px solid var(--sg-border,#0f172a14);justify-content:flex-end;margin-top:2px;padding:4px 6px;display:flex}.sv-grid-dropdown-done{text-transform:uppercase;letter-spacing:.04em;color:#fff;background:var(--sg-accent,#2563eb);cursor:pointer;border:0;border-radius:4px;padding:4px 10px;font-size:11px}.sv-grid-dropdown-done:hover{filter:brightness(1.12)}.sv-grid-chip.svelte-r4kmto{background:color-mix(in srgb, var(--sg-accent,#2563eb) 18%, transparent);color:var(--sg-fg,#0f172a);border:1px solid color-mix(in srgb, var(--sg-accent,#2563eb) 35%, transparent);white-space:nowrap;border-radius:999px;align-items:center;gap:4px;padding:2px 8px;font-size:.85em;line-height:1.4;display:inline-flex}.sv-grid-chip-removable.svelte-r4kmto{padding-inline-end:2px}.sv-grid-chip-remove.svelte-r4kmto{background:color-mix(in srgb, var(--sg-fg,#0f172a) 18%, transparent);width:16px;height:16px;color:inherit;cursor:pointer;border:0;border-radius:999px;justify-content:center;align-items:center;padding:0;font-size:12px;line-height:1;display:inline-flex}.sv-grid-chip-remove.svelte-r4kmto:hover{color:#fff;background:#dc2626b3}\n",g=globalThis;if(typeof g!=='undefined'){var f=(g.__SVGRID_WC_ADD_CSS_BY_BUILD__||{})["shadow"];if(typeof f==='function')f(c);else{var q=g.__SVGRID_WC_CSS_CHUNKS_BY_BUILD__=g.__SVGRID_WC_CSS_CHUNKS_BY_BUILD__||{};(q["shadow"]=q["shadow"]||[]).push(c);}}if(typeof document==='undefined')return;var x=document.querySelectorAll('style[data-svgrid-grid-wc-chunk]');for(var i=0;i<x.length;i++)if(x[i].getAttribute('data-svgrid-grid-wc-chunk')==="shadow:SvGridDropdown-B_5kqHQE.js"||x[i].textContent===c)return;var s=document.createElement('style');s.setAttribute('data-svgrid-grid-wc-chunk',"shadow:SvGridDropdown-B_5kqHQE.js");s.textContent=c;document.head.appendChild(s);}catch(e){}})();
|
|
2
|
+
import { $ as e, A as t, D as n, I as r, J as i, L as a, M as o, P as s, Q as c, R as ee, U as l, W as u, X as d, Y as f, Z as p, a as m, at as h, d as g, f as _, it as v, j as te, k as y, n as b, ot as x, q as S, s as ne, st as C, tt as w, v as T, w as re, x as E, y as D, z as O } from "./client-OtsRxGjS.js";
|
|
3
|
+
import { n as ie, r as ae, t as oe } from "./popover-WsGlvtQv.js";
|
|
4
|
+
import "./sv-grid-shadow-element.js";
|
|
5
|
+
//#region ../grid/dist/SvGridDropdown.svelte
|
|
6
|
+
var k = o("<span class=\"sv-grid-chip sv-grid-chip-removable svelte-r4kmto\"> <span class=\"sv-grid-chip-remove svelte-r4kmto\" role=\"button\">×</span></span>"), A = o("<span class=\"sv-grid-dropdown-chips svelte-r4kmto\"></span>"), se = o("<span class=\"sv-grid-chip svelte-r4kmto\"> </span>"), ce = o("<span class=\"sv-grid-dropdown-label svelte-r4kmto\"> </span>"), le = o("<input type=\"search\" class=\"sv-grid-dropdown-search\" placeholder=\"Search…\"/>"), ue = o("<div class=\"sv-grid-dropdown-empty\" role=\"status\" aria-live=\"polite\">Loading…</div>"), de = o("<div class=\"sv-grid-dropdown-empty\"> </div>"), fe = o("<span class=\"sv-grid-dropdown-check\" aria-hidden=\"true\"> </span>"), pe = o("<span class=\"sv-grid-dropdown-option-chip\"> </span>"), me = o("<span class=\"sv-grid-dropdown-option-label\"> </span>"), he = o("<div role=\"option\"><!> <!></div>"), ge = o("<div class=\"sv-grid-dropdown-footer\"><button type=\"button\" class=\"sv-grid-dropdown-done\">Done</button></div>"), _e = o("<div role=\"listbox\"><!> <!> <!></div>"), ve = o("<div><button type=\"button\" aria-haspopup=\"listbox\"><!> <span class=\"sv-grid-dropdown-caret svelte-r4kmto\" aria-hidden=\"true\">▾</span></button> <!></div>");
|
|
7
|
+
function ye(r, o) {
|
|
8
|
+
let ye = s();
|
|
9
|
+
h(o, !0);
|
|
10
|
+
let j = b(o, "multiple", 3, !1), be = b(o, "placeholder", 3, "Select…"), M = b(o, "renderChipsInTrigger", 3, !1), N = b(o, "searchable", 3, !1), xe = b(o, "autoOpen", 3, !0), Se = b(o, "loading", 3, !1), Ce = b(o, "invalid", 3, !1);
|
|
11
|
+
function P(e) {
|
|
12
|
+
return e >= 0 && e < O(L).length ? `${ye}-opt-${e}` : void 0;
|
|
13
|
+
}
|
|
14
|
+
let F = w(() => o.options.some((e) => e.color) ? 40 : 32), I = e(""), L = w(() => !N() || !O(I).trim() ? o.options : (() => {
|
|
15
|
+
let e = O(I).trim().toLowerCase();
|
|
16
|
+
return o.options.filter((t) => t.label.toLowerCase().includes(e));
|
|
17
|
+
})()), R = e(!1), z = e(-1), B = e(null), V = e(null), H = e(null), U = e(p({
|
|
18
|
+
top: 0,
|
|
19
|
+
left: 0,
|
|
20
|
+
width: 0,
|
|
21
|
+
openUpward: !1,
|
|
22
|
+
maxHeight: 0,
|
|
23
|
+
availHeight: 0
|
|
24
|
+
})), W = w(() => Array.isArray(o.value) ? o.value : o.value == null || o.value === "" ? [] : [o.value]), we = w(() => {
|
|
25
|
+
if (O(W).length === 0) return be();
|
|
26
|
+
if (!j()) {
|
|
27
|
+
let e = O(W)[0], t = o.options.find((t) => String(t.value) === String(e));
|
|
28
|
+
return t ? t.label : String(e);
|
|
29
|
+
}
|
|
30
|
+
return `${O(W).length} selected`;
|
|
31
|
+
}), Te = w(() => {
|
|
32
|
+
if (j() || O(W).length !== 1) return;
|
|
33
|
+
let e = O(W)[0];
|
|
34
|
+
return o.options.find((t) => String(t.value) === String(e))?.color;
|
|
35
|
+
});
|
|
36
|
+
function G(e) {
|
|
37
|
+
return O(W).some((t) => String(t) === String(e.value));
|
|
38
|
+
}
|
|
39
|
+
function K(e) {
|
|
40
|
+
if (j()) {
|
|
41
|
+
let t = G(e) ? O(W).filter((t) => String(t) !== String(e.value)) : [...O(W), e.value];
|
|
42
|
+
o.onChange?.(t);
|
|
43
|
+
} else o.onChange?.(e.value), c(R, !1), o.onCommit?.();
|
|
44
|
+
}
|
|
45
|
+
function q() {
|
|
46
|
+
if (!O(R)) {
|
|
47
|
+
if (c(R, !0), O(z) < 0) {
|
|
48
|
+
let e = o.options.findIndex((e) => G(e));
|
|
49
|
+
c(z, e >= 0 ? e : 0, !0);
|
|
50
|
+
}
|
|
51
|
+
J();
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
function J() {
|
|
55
|
+
if (!O(V)) return;
|
|
56
|
+
let e = Math.min(O(L).length, 10), t = N() ? 38 : 0, n = e * O(F) + (j() ? 40 : 0) + t + 8;
|
|
57
|
+
c(U, oe(O(V).getBoundingClientRect(), {
|
|
58
|
+
estimatedHeight: n,
|
|
59
|
+
clampHorizontal: !1
|
|
60
|
+
}), !0);
|
|
61
|
+
}
|
|
62
|
+
u(() => {
|
|
63
|
+
if (!O(R)) return;
|
|
64
|
+
let e = () => J();
|
|
65
|
+
return window.addEventListener("scroll", e, !0), window.addEventListener("resize", e), () => {
|
|
66
|
+
window.removeEventListener("scroll", e, !0), window.removeEventListener("resize", e);
|
|
67
|
+
};
|
|
68
|
+
}), u(() => {
|
|
69
|
+
O(R) && (O(L).length, O(F), J());
|
|
70
|
+
});
|
|
71
|
+
function Y() {
|
|
72
|
+
c(R, !1), c(z, -1);
|
|
73
|
+
}
|
|
74
|
+
function Ee(e) {
|
|
75
|
+
if (e.stopPropagation(), e.key === "Escape") {
|
|
76
|
+
e.preventDefault(), Y(), o.onCancel?.();
|
|
77
|
+
return;
|
|
78
|
+
}
|
|
79
|
+
if (e.key === "ArrowDown") {
|
|
80
|
+
if (e.preventDefault(), !O(R)) {
|
|
81
|
+
q();
|
|
82
|
+
return;
|
|
83
|
+
}
|
|
84
|
+
c(z, Math.min(O(z) + 1, o.options.length - 1), !0), X();
|
|
85
|
+
} else if (e.key === "ArrowUp") {
|
|
86
|
+
if (e.preventDefault(), !O(R)) {
|
|
87
|
+
q();
|
|
88
|
+
return;
|
|
89
|
+
}
|
|
90
|
+
c(z, Math.max(O(z) - 1, 0), !0), X();
|
|
91
|
+
} else if (e.key === "Home") {
|
|
92
|
+
if (!O(R)) return;
|
|
93
|
+
e.preventDefault(), c(z, 0), X();
|
|
94
|
+
} else if (e.key === "End") {
|
|
95
|
+
if (!O(R)) return;
|
|
96
|
+
e.preventDefault(), c(z, o.options.length - 1), X();
|
|
97
|
+
} else if (e.key === "Enter") {
|
|
98
|
+
if (e.preventDefault(), !O(R)) {
|
|
99
|
+
q();
|
|
100
|
+
return;
|
|
101
|
+
}
|
|
102
|
+
let t = o.options[O(z)];
|
|
103
|
+
t ? K(t) : j() && (Y(), o.onCommit?.());
|
|
104
|
+
} else if (e.key === " " && O(R)) {
|
|
105
|
+
e.preventDefault();
|
|
106
|
+
let t = o.options[O(z)];
|
|
107
|
+
t && K(t);
|
|
108
|
+
} else e.key === "Tab" && (O(R) && Y(), o.onTab ? (e.preventDefault(), o.onTab(e.shiftKey)) : o.onCommit?.());
|
|
109
|
+
}
|
|
110
|
+
function X() {
|
|
111
|
+
queueMicrotask(() => {
|
|
112
|
+
O(H) && O(H).querySelector(`[data-opt-idx="${O(z)}"]`)?.scrollIntoView({ block: "nearest" });
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
function De(e) {
|
|
116
|
+
let t = e.relatedTarget;
|
|
117
|
+
t && O(B)?.contains(t) || (O(R) && Y(), o.onCommit?.());
|
|
118
|
+
}
|
|
119
|
+
function Oe(e, t) {
|
|
120
|
+
t.preventDefault(), t.stopPropagation();
|
|
121
|
+
let n = O(W).filter((t) => String(t) !== String(e));
|
|
122
|
+
o.onChange?.(j() ? n : n[0] ?? null);
|
|
123
|
+
}
|
|
124
|
+
function ke(e) {
|
|
125
|
+
xe() && (e.focus(), q());
|
|
126
|
+
}
|
|
127
|
+
u(() => {
|
|
128
|
+
if (!O(R)) return;
|
|
129
|
+
let e = (e) => {
|
|
130
|
+
let t = e.target;
|
|
131
|
+
t && (O(B)?.contains(t) || O(H)?.contains(t) || (Y(), o.onCommit?.()));
|
|
132
|
+
};
|
|
133
|
+
return document.addEventListener("pointerdown", e, !0), () => document.removeEventListener("pointerdown", e, !0);
|
|
134
|
+
});
|
|
135
|
+
function Z(e) {
|
|
136
|
+
return `background: color-mix(in srgb, ${e} 22%, transparent);border-color: color-mix(in srgb, ${e} 45%, transparent);color: color-mix(in srgb, ${e} 80%, var(--sg-fg, #0f172a));`;
|
|
137
|
+
}
|
|
138
|
+
var Q = ve();
|
|
139
|
+
let Ae;
|
|
140
|
+
var $ = S(Q);
|
|
141
|
+
let je;
|
|
142
|
+
var Me = S($), Ne = (e) => {
|
|
143
|
+
var n = A();
|
|
144
|
+
re(n, 21, () => O(W), (e) => String(e), (e, n) => {
|
|
145
|
+
let r = w(() => o.options.find((e) => String(e.value) === String(O(n))));
|
|
146
|
+
var i = k(), s = S(i), c = d(s);
|
|
147
|
+
_(c, "tabindex", -1), C(i), l((e, t, n) => {
|
|
148
|
+
T(i, e), y(s, `${t ?? ""} `), _(c, "aria-label", `Remove ${n ?? ""}`);
|
|
149
|
+
}, [
|
|
150
|
+
() => O(r)?.color ? Z(O(r).color) : "",
|
|
151
|
+
() => O(r) ? O(r).label : String(O(n)),
|
|
152
|
+
() => O(r) ? O(r).label : String(O(n))
|
|
153
|
+
]), a("mousedown", c, (e) => e.preventDefault()), a("click", c, (e) => Oe(O(n), e)), t(e, i);
|
|
154
|
+
}), C(n), t(e, n);
|
|
155
|
+
}, Pe = (e) => {
|
|
156
|
+
var n = se(), r = f(n, !0);
|
|
157
|
+
l((e) => {
|
|
158
|
+
T(n, e), y(r, O(we));
|
|
159
|
+
}, [() => Z(O(Te))]), t(e, n);
|
|
160
|
+
}, Fe = (e) => {
|
|
161
|
+
var n = ce(), r = f(n, !0);
|
|
162
|
+
l(() => y(r, O(we))), t(e, n);
|
|
163
|
+
};
|
|
164
|
+
n(Me, (e) => {
|
|
165
|
+
M() && O(W).length > 0 ? e(Ne) : !j() && O(W).length === 1 && O(Te) ? e(Pe, 1) : e(Fe, -1);
|
|
166
|
+
}), x(2), C($), m($, (e) => c(V, e), () => O(V)), E($, (e) => ke?.(e));
|
|
167
|
+
var Ie = d($, 2), Le = (e) => {
|
|
168
|
+
let r = w(() => o.options.length > 10), s = w(() => Math.min(O(r) ? 10 * O(F) + (j() ? 40 : 0) + 8 : Infinity, O(U).availHeight));
|
|
169
|
+
var u = _e();
|
|
170
|
+
let p, h;
|
|
171
|
+
var v = S(u), b = (e) => {
|
|
172
|
+
var n = le();
|
|
173
|
+
g(n), a("mousedown", n, (e) => e.stopPropagation()), a("click", n, (e) => e.stopPropagation()), a("keydown", n, (e) => {
|
|
174
|
+
e.key === "Escape" && (e.preventDefault(), c(R, !1), o.onCancel?.());
|
|
175
|
+
}), ne(n, () => O(I), (e) => c(I, e)), t(e, n);
|
|
176
|
+
};
|
|
177
|
+
n(v, (e) => {
|
|
178
|
+
N() && e(b);
|
|
179
|
+
});
|
|
180
|
+
var x = d(v, 2), oe = (e) => {
|
|
181
|
+
var n = ue();
|
|
182
|
+
t(e, n);
|
|
183
|
+
}, k = (e) => {
|
|
184
|
+
var n = de(), r = f(n, !0);
|
|
185
|
+
l(() => y(r, N() && O(I) ? `No matches for "${O(I)}"` : "No options")), t(e, n);
|
|
186
|
+
}, A = (e) => {
|
|
187
|
+
var r = te(), o = i(r);
|
|
188
|
+
re(o, 19, () => O(L), (e) => String(e.value), (e, r, i) => {
|
|
189
|
+
let o = w(() => G(O(r)));
|
|
190
|
+
var s = he();
|
|
191
|
+
let u;
|
|
192
|
+
var p = S(s), m = (e) => {
|
|
193
|
+
var n = fe(), r = f(n, !0);
|
|
194
|
+
l(() => y(r, O(o) ? "✓" : "")), t(e, n);
|
|
195
|
+
};
|
|
196
|
+
n(p, (e) => {
|
|
197
|
+
j() && e(m);
|
|
198
|
+
});
|
|
199
|
+
var h = d(p, 2), g = (e) => {
|
|
200
|
+
var n = pe(), i = f(n, !0);
|
|
201
|
+
l((e) => {
|
|
202
|
+
T(n, e), y(i, O(r).label);
|
|
203
|
+
}, [() => Z(O(r).color)]), t(e, n);
|
|
204
|
+
}, v = (e) => {
|
|
205
|
+
var n = me(), i = f(n, !0);
|
|
206
|
+
l(() => y(i, O(r).label)), t(e, n);
|
|
207
|
+
};
|
|
208
|
+
n(h, (e) => {
|
|
209
|
+
O(r).color ? e(g) : e(v, -1);
|
|
210
|
+
}), C(s), l((e) => {
|
|
211
|
+
u = D(s, 1, "sv-grid-dropdown-option", null, u, {
|
|
212
|
+
"sv-grid-dropdown-option-selected": O(o),
|
|
213
|
+
"sv-grid-dropdown-option-highlighted": O(i) === O(z)
|
|
214
|
+
}), _(s, "id", e), _(s, "aria-selected", O(o)), _(s, "data-opt-idx", O(i));
|
|
215
|
+
}, [() => P(O(i))]), a("mousedown", s, (e) => {
|
|
216
|
+
e.preventDefault(), K(O(r));
|
|
217
|
+
}), ee("mouseenter", s, () => c(z, O(i), !0)), t(e, s);
|
|
218
|
+
}), t(e, r);
|
|
219
|
+
};
|
|
220
|
+
n(x, (e) => {
|
|
221
|
+
Se() && O(L).length === 0 ? e(oe) : O(L).length === 0 ? e(k, 1) : e(A, -1);
|
|
222
|
+
});
|
|
223
|
+
var se = d(x, 2), ce = (e) => {
|
|
224
|
+
var n = ge(), r = f(n);
|
|
225
|
+
a("mousedown", r, (e) => e.preventDefault()), a("click", r, () => {
|
|
226
|
+
Y(), o.onCommit?.();
|
|
227
|
+
}), t(e, n);
|
|
228
|
+
};
|
|
229
|
+
n(se, (e) => {
|
|
230
|
+
j() && e(ce);
|
|
231
|
+
}), C(u), m(u, (e) => c(H, e), () => O(H)), E(u, (e) => ae?.(e)), E(u, (e, t) => ie?.(e, t), () => ({ up: O(U).openUpward })), l(() => {
|
|
232
|
+
p = D(u, 1, "sv-grid-dropdown-panel", null, p, { "sv-grid-dropdown-panel-fits": !O(r) }), _(u, "aria-multiselectable", j()), h = T(u, "", h, {
|
|
233
|
+
position: "fixed",
|
|
234
|
+
top: O(U).openUpward ? null : `${O(U).top}px`,
|
|
235
|
+
bottom: O(U).openUpward ? `${O(U).bottom}px` : null,
|
|
236
|
+
left: `${O(U).left}px`,
|
|
237
|
+
width: `${O(U).width}px`,
|
|
238
|
+
"max-height": O(s) === null ? null : `${O(s)}px`,
|
|
239
|
+
"z-index": "2147483647"
|
|
240
|
+
});
|
|
241
|
+
}), a("pointerdown", u, (e) => e.stopPropagation()), a("mousedown", u, (e) => e.stopPropagation()), a("click", u, (e) => e.stopPropagation()), t(e, u);
|
|
242
|
+
};
|
|
243
|
+
n(Ie, (e) => {
|
|
244
|
+
O(R) && e(Le);
|
|
245
|
+
}), C(Q), m(Q, (e) => c(B, e), () => O(B)), l((e) => {
|
|
246
|
+
Ae = D(Q, 1, "sv-grid-dropdown svelte-r4kmto", null, Ae, { "sv-grid-dropdown-open": O(R) }), _($, "id", o.id), je = D($, 1, "sv-grid-dropdown-trigger svelte-r4kmto", null, je, { "sv-grid-dropdown-trigger-chips": M() && O(W).length > 0 }), _($, "aria-expanded", O(R)), _($, "aria-label", o.ariaLabel), _($, "aria-invalid", Ce() || void 0), _($, "aria-describedby", o.describedBy), _($, "aria-activedescendant", e);
|
|
247
|
+
}, [() => O(R) ? P(O(z)) : void 0]), a("focusout", Q, De), a("click", Q, (e) => e.stopPropagation()), a("dblclick", Q, (e) => e.stopPropagation()), a("pointerdown", Q, (e) => e.stopPropagation()), a("mousedown", Q, (e) => e.stopPropagation()), a("click", $, () => O(R) ? Y() : q()), a("keydown", $, Ee), t(r, Q), v();
|
|
248
|
+
}
|
|
249
|
+
r([
|
|
250
|
+
"focusout",
|
|
251
|
+
"click",
|
|
252
|
+
"dblclick",
|
|
253
|
+
"pointerdown",
|
|
254
|
+
"mousedown",
|
|
255
|
+
"keydown"
|
|
256
|
+
]);
|
|
257
|
+
//#endregion
|
|
258
|
+
export { ye as default };
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
import { c as e, i as t, r as n } from "./SvGridChart-zTsB6F3Y.js";
|
|
2
|
+
//#region ../grid/dist/chart-export-pdf.js
|
|
3
|
+
var r = {
|
|
4
|
+
A4: [595.28, 841.89],
|
|
5
|
+
Letter: [612, 792]
|
|
6
|
+
};
|
|
7
|
+
function i(e) {
|
|
8
|
+
let t = new Uint8Array(e.length);
|
|
9
|
+
for (let n = 0; n < e.length; n += 1) {
|
|
10
|
+
let r = e.charCodeAt(n);
|
|
11
|
+
t[n] = r < 256 ? r : 63;
|
|
12
|
+
}
|
|
13
|
+
return t;
|
|
14
|
+
}
|
|
15
|
+
var a = {
|
|
16
|
+
8364: 128,
|
|
17
|
+
8218: 130,
|
|
18
|
+
402: 131,
|
|
19
|
+
8222: 132,
|
|
20
|
+
8230: 133,
|
|
21
|
+
8224: 134,
|
|
22
|
+
8225: 135,
|
|
23
|
+
710: 136,
|
|
24
|
+
8240: 137,
|
|
25
|
+
352: 138,
|
|
26
|
+
8249: 139,
|
|
27
|
+
338: 140,
|
|
28
|
+
381: 142,
|
|
29
|
+
8216: 145,
|
|
30
|
+
8217: 146,
|
|
31
|
+
8220: 147,
|
|
32
|
+
8221: 148,
|
|
33
|
+
8226: 149,
|
|
34
|
+
8211: 150,
|
|
35
|
+
8212: 151,
|
|
36
|
+
732: 152,
|
|
37
|
+
8482: 153,
|
|
38
|
+
353: 154,
|
|
39
|
+
8250: 155,
|
|
40
|
+
339: 156,
|
|
41
|
+
382: 158,
|
|
42
|
+
376: 159
|
|
43
|
+
};
|
|
44
|
+
function o(e) {
|
|
45
|
+
let t = "";
|
|
46
|
+
for (let n of e) {
|
|
47
|
+
let e = n.codePointAt(0), r = e < 128 || e >= 160 && e < 256 ? e : a[e];
|
|
48
|
+
if (r == null) return null;
|
|
49
|
+
t += String.fromCharCode(r);
|
|
50
|
+
}
|
|
51
|
+
return t;
|
|
52
|
+
}
|
|
53
|
+
var s = class extends Error {
|
|
54
|
+
constructor(e) {
|
|
55
|
+
super(`The chart PDF cannot draw "${e}": its font has Western European letters only. Download the chart as PNG or SVG instead.`), this.name = "ChartPdfTextError", this.text = e;
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
function c(...e) {
|
|
59
|
+
return e.find((e) => e && o(e.trim()) == null) ?? null;
|
|
60
|
+
}
|
|
61
|
+
function l(e) {
|
|
62
|
+
let t = o(e);
|
|
63
|
+
if (t == null) throw new s(e);
|
|
64
|
+
return "(" + t.replace(/[\\()]/g, (e) => "\\" + e).replace(/[\r\n]+/g, " ") + ")";
|
|
65
|
+
}
|
|
66
|
+
function u(e, t) {
|
|
67
|
+
return e.length * t * .5;
|
|
68
|
+
}
|
|
69
|
+
function d(e, t, n) {
|
|
70
|
+
return new Promise((r, i) => {
|
|
71
|
+
let a = URL.createObjectURL(e), o = new Image();
|
|
72
|
+
o.onload = () => {
|
|
73
|
+
let e = document.createElement("canvas");
|
|
74
|
+
e.width = o.naturalWidth || o.width, e.height = o.naturalHeight || o.height;
|
|
75
|
+
let s = e.getContext("2d");
|
|
76
|
+
if (!s) {
|
|
77
|
+
URL.revokeObjectURL(a), i(/* @__PURE__ */ Error("canvas 2d context unavailable"));
|
|
78
|
+
return;
|
|
79
|
+
}
|
|
80
|
+
s.fillStyle = t, s.fillRect(0, 0, e.width, e.height), s.drawImage(o, 0, 0), URL.revokeObjectURL(a), e.toBlob((t) => {
|
|
81
|
+
if (!t) {
|
|
82
|
+
i(/* @__PURE__ */ Error("toBlob failed"));
|
|
83
|
+
return;
|
|
84
|
+
}
|
|
85
|
+
t.arrayBuffer().then((t) => r({
|
|
86
|
+
bytes: new Uint8Array(t),
|
|
87
|
+
width: e.width,
|
|
88
|
+
height: e.height
|
|
89
|
+
}), i);
|
|
90
|
+
}, "image/jpeg", n);
|
|
91
|
+
}, o.onerror = () => {
|
|
92
|
+
URL.revokeObjectURL(a), i(/* @__PURE__ */ Error("failed to decode chart PNG"));
|
|
93
|
+
}, o.src = a;
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
function f(e, t = {}) {
|
|
97
|
+
let [n, a] = r[t.page ?? "A4"], o = t.orientation ? t.orientation === "landscape" : e.width / e.height > n / a, s = o ? a : n, c = o ? n : a, d = (t.title ?? "").trim(), f = (t.subtitle ?? "").trim(), p = (t.caption ?? "").trim(), m = c - 40, h = [], g = (e, t, n) => {
|
|
98
|
+
m -= t + 4, h.push(`BT /F1 ${t} Tf ${n} g 40 ${m.toFixed(2)} Td ${l(e)} Tj ET`);
|
|
99
|
+
};
|
|
100
|
+
d && g(d, 16, 0), f && g(f, 11, .4), (d || f) && (m -= 8);
|
|
101
|
+
let _ = p ? 20 : 0, v = s - 80, y = m - 40 - _, b = Math.min(v / e.width, y / e.height), x = e.width * b, S = e.height * b, C = 40 + (v - x) / 2, w = m - S;
|
|
102
|
+
if (h.push(`q ${x.toFixed(2)} 0 0 ${S.toFixed(2)} ${C.toFixed(2)} ${w.toFixed(2)} cm /Im1 Do Q`), p) {
|
|
103
|
+
let e = u(p, 9) > v ? p.slice(0, Math.floor(v / 4.5) - 3) + "..." : p;
|
|
104
|
+
h.push(`BT /F1 9 Tf 0.4 g 40 ${36 .toFixed(2)} Td ${l(e)} Tj ET`);
|
|
105
|
+
}
|
|
106
|
+
let T = h.join("\n"), E = [], D = [], O = 0, k = (e) => {
|
|
107
|
+
E.push(e), O += e.length;
|
|
108
|
+
};
|
|
109
|
+
k("%PDF-1.4\n%âãÏÓ\n");
|
|
110
|
+
let A = (e, t, n) => {
|
|
111
|
+
D[e] = O, k(`${e} 0 obj\n${t}\n`), n && (k("stream\n"), k(n), k("\nendstream\n")), k("endobj\n");
|
|
112
|
+
};
|
|
113
|
+
A(1, "<< /Type /Catalog /Pages 2 0 R >>"), A(2, "<< /Type /Pages /Kids [3 0 R] /Count 1 >>"), A(3, `<< /Type /Page /Parent 2 0 R /MediaBox [0 0 ${s.toFixed(2)} ${c.toFixed(2)}] /Resources << /XObject << /Im1 4 0 R >> /Font << /F1 5 0 R >> >> /Contents 6 0 R >>`), A(4, `<< /Type /XObject /Subtype /Image /Width ${e.width} /Height ${e.height} /ColorSpace /DeviceRGB /BitsPerComponent 8 /Filter /DCTDecode /Length ${e.bytes.length} >>`, e.bytes), A(5, "<< /Type /Font /Subtype /Type1 /BaseFont /Helvetica /Encoding /WinAnsiEncoding >>"), A(6, `<< /Length ${T.length} >>`, i(T));
|
|
114
|
+
let j = O;
|
|
115
|
+
k("xref\n0 7\n0000000000 65535 f \n");
|
|
116
|
+
for (let e = 1; e <= 6; e += 1) k(`${String(D[e]).padStart(10, "0")} 00000 n \n`);
|
|
117
|
+
k(`trailer\n<< /Size 7 /Root 1 0 R >>\nstartxref\n${j}\n%%EOF\n`);
|
|
118
|
+
let M = new Uint8Array(new ArrayBuffer(O)), N = 0;
|
|
119
|
+
for (let e of E) {
|
|
120
|
+
let t = typeof e == "string" ? i(e) : e;
|
|
121
|
+
M.set(t, N), N += t.length;
|
|
122
|
+
}
|
|
123
|
+
return M;
|
|
124
|
+
}
|
|
125
|
+
async function p(e, t = {}) {
|
|
126
|
+
let r = c(t.title, t.subtitle, t.caption);
|
|
127
|
+
if (r != null) throw new s(r);
|
|
128
|
+
let i = e instanceof SVGSVGElement ? e : e.querySelector("svg.sv-grid-chart-svg") ?? e.querySelector("svg"), a = t.background ?? (i && getComputedStyle(i).getPropertyValue("--sg-bg").trim() || "#ffffff"), o = f(await d(await n(e, {
|
|
129
|
+
...t,
|
|
130
|
+
background: a,
|
|
131
|
+
scale: t.scale ?? 2
|
|
132
|
+
}), a, t.quality ?? .92), t);
|
|
133
|
+
return new Blob([o.buffer], { type: "application/pdf" });
|
|
134
|
+
}
|
|
135
|
+
async function m(t, n = "chart.pdf", r = {}) {
|
|
136
|
+
e(await p(t, r), n);
|
|
137
|
+
}
|
|
138
|
+
function h(e, n = {}) {
|
|
139
|
+
let r = t(e, n), i = window.open("", "_blank", "width=900,height=700");
|
|
140
|
+
if (!i) return !1;
|
|
141
|
+
let a = i.document;
|
|
142
|
+
a.title = n.title ?? "Chart";
|
|
143
|
+
let o = a.createElement("style");
|
|
144
|
+
if (o.textContent = "body{margin:24px;font-family:system-ui,sans-serif}h1{font-size:16px;margin:0 0 12px}img{max-width:100%;height:auto}@page{margin:12mm}", a.head.append(o), n.title) {
|
|
145
|
+
let e = a.createElement("h1");
|
|
146
|
+
e.textContent = n.title, a.body.append(e);
|
|
147
|
+
}
|
|
148
|
+
let s = a.createElement("img");
|
|
149
|
+
s.alt = n.title ?? "Chart", s.src = "data:image/svg+xml;charset=utf-8," + encodeURIComponent(r), a.body.append(s);
|
|
150
|
+
let c = () => setTimeout(() => {
|
|
151
|
+
i.focus(), i.print();
|
|
152
|
+
}, 50);
|
|
153
|
+
return s.complete ? c() : (s.addEventListener("load", c, { once: !0 }), s.addEventListener("error", c, { once: !0 })), !0;
|
|
154
|
+
}
|
|
155
|
+
//#endregion
|
|
156
|
+
export { s as ChartPdfTextError, f as buildChartPdf, p as chartToPdfBlob, m as downloadChartPdf, c as pdfUndrawable, h as printChart };
|