@svgrid/grid-wc 3.0.49 → 3.0.50
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-B5zpfGlk.js +39 -0
- package/dist/GridFooter-CSzuZWPH.js +142 -0
- package/dist/GridMenus-DGR1VkZL.js +1480 -0
- package/dist/PinSplitter-BbQwf4Eh.js +178 -0
- package/dist/{SvChartMenu-CztABicV.js → SvChartMenu-CFvrEIJf.js} +132 -132
- package/dist/{SvDateRangeInput-ByR-LFgf.js → SvDateRangeInput-B8uPcD0z.js} +107 -107
- package/dist/{SvDateTimePicker-8nq26l0z.js → SvDateTimePicker-D9MnooXn.js} +316 -316
- package/dist/{SvField-CtzxdF7J.js → SvField--1Px2j7E.js} +105 -105
- package/dist/SvGridCellEditor-BzLvoGRp.js +594 -0
- package/dist/SvGridChart-rvB4vvCB.js +3684 -0
- package/dist/{SvGridChartBuilder-BMPDRY0A.js → SvGridChartBuilder-C0HbpZhw.js} +385 -385
- package/dist/SvGridChartPanel-CftDsgLi.js +1689 -0
- package/dist/{SvGridChartView-D0Mk0N4Q.js → SvGridChartView-BMJf1fCo.js} +12 -12
- package/dist/SvGridDropdown-CZRv-0Cw.js +258 -0
- package/dist/angular/fesm2022/svgrid-grid-wc-angular.mjs +4 -2
- package/dist/angular/fesm2022/svgrid-grid-wc-angular.mjs.map +1 -1
- package/dist/angular/types/svgrid-grid-wc-angular.d.ts +2 -1
- package/dist/{chart-export-pdf-COD2Ugv7.js → chart-export-pdf-CFq7Y-pq.js} +1 -1
- package/dist/{shadow/client-OtsRxGjS.js → client-DeNKZvIV.js} +593 -581
- package/dist/{date-format-DngG1HJ5.js → date-format-B1XMOxlA.js} +309 -309
- package/dist/{grid-extension.svelte-DToFhcZv.js → grid-extension.svelte-B_gzYJQQ.js} +8 -8
- package/dist/{range-commit-C6Rogxem.js → range-commit-BriJZw_M.js} +1 -1
- package/dist/react/index.d.ts +3 -1
- package/dist/react/index.js +1 -1
- package/dist/{shadow/row-drag-DLQMyiV3.js → row-drag-DevACK09.js} +1 -1
- package/dist/shadow/GridFind-CVqPCjPK.js +39 -0
- package/dist/shadow/GridFooter-DY9numnH.js +142 -0
- package/dist/shadow/GridMenus-Bl11jIy6.js +1480 -0
- package/dist/shadow/PinSplitter-DNjnUtbi.js +178 -0
- package/dist/shadow/{SvChartMenu-CFlDiKdq.js → SvChartMenu-Ca2hVFUA.js} +132 -132
- package/dist/shadow/{SvDateRangeInput-9Wq4E64y.js → SvDateRangeInput-CNXId95j.js} +107 -107
- package/dist/shadow/{SvDateTimePicker-J65ZmtSw.js → SvDateTimePicker-B6lwKYFq.js} +316 -316
- package/dist/shadow/{SvField-DGPj2clt.js → SvField-1OiD5dJA.js} +105 -105
- package/dist/shadow/SvGridCellEditor-CRImfWTE.js +594 -0
- package/dist/shadow/SvGridChart-_GY1Mgr4.js +3684 -0
- package/dist/shadow/{SvGridChartBuilder-BY64S-Zw.js → SvGridChartBuilder-Ci_GlCg3.js} +385 -385
- package/dist/shadow/SvGridChartPanel-BHczMJAe.js +1689 -0
- package/dist/shadow/{SvGridChartView-DwchQygE.js → SvGridChartView-BJEpaO8h.js} +12 -12
- package/dist/shadow/SvGridDropdown-giyKVcC0.js +258 -0
- package/dist/shadow/{chart-export-pdf-D9OfzqwS.js → chart-export-pdf-Ne0ET-JM.js} +1 -1
- package/dist/{client-OtsRxGjS.js → shadow/client-DeNKZvIV.js} +593 -581
- package/dist/shadow/{date-format-C9UkbCig.js → date-format-VCW-gATr.js} +309 -309
- package/dist/shadow/{grid-extension.svelte-DToFhcZv.js → grid-extension.svelte-B_gzYJQQ.js} +8 -8
- package/dist/shadow/{range-commit-C6Rogxem.js → range-commit-BriJZw_M.js} +1 -1
- package/dist/{row-drag-DLQMyiV3.js → shadow/row-drag-DevACK09.js} +1 -1
- package/dist/shadow/sv-grid-scrollbar-yHMClECS.js +228 -0
- package/dist/shadow/sv-grid-shadow-element.d.ts +2 -0
- package/dist/shadow/sv-grid-shadow-element.js +5686 -5829
- package/dist/{svelte-virtualizer.svelte-DWvD9wvL.js → shadow/svelte-virtualizer.svelte-D8oCAQUc.js} +4 -4
- package/dist/sv-grid-element.d.ts +2 -0
- package/dist/sv-grid-element.js +5668 -5811
- package/dist/sv-grid-scrollbar-yHMClECS.js +228 -0
- package/dist/{shadow/svelte-virtualizer.svelte-DWvD9wvL.js → svelte-virtualizer.svelte-D8oCAQUc.js} +4 -4
- package/dist/vue/index.d.ts +2 -1
- package/dist/vue/index.js +1 -1
- package/package.json +3 -3
- package/dist/GridFind-C1YbloFh.js +0 -39
- package/dist/GridFooter-DOR8m9GQ.js +0 -142
- package/dist/GridMenus-ac4ROLfR.js +0 -1461
- package/dist/PinSplitter-Du4ZF8T3.js +0 -178
- package/dist/SvGridCellEditor-3jq3ec38.js +0 -594
- package/dist/SvGridChart-CHMHUQto.js +0 -3684
- package/dist/SvGridChartPanel-Bk_xFAwN.js +0 -1689
- package/dist/SvGridDropdown-CnCQuXaI.js +0 -258
- package/dist/shadow/GridFind-CcoKoisE.js +0 -39
- package/dist/shadow/GridFooter-CDq71ytl.js +0 -142
- package/dist/shadow/GridMenus-hIMzQt3E.js +0 -1461
- package/dist/shadow/PinSplitter-BAYTAZtm.js +0 -178
- package/dist/shadow/SvGridCellEditor-DA5l3ENL.js +0 -594
- package/dist/shadow/SvGridChart-DgCuTYRq.js +0 -3684
- package/dist/shadow/SvGridChartPanel-CuRtOxSk.js +0 -1689
- package/dist/shadow/SvGridDropdown-B_5kqHQE.js +0 -258
|
@@ -1,12 +1,12 @@
|
|
|
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-BJEpaO8h.js"||x[i].textContent===c)return;var s=document.createElement('style');s.setAttribute('data-svgrid-grid-wc-chunk',"shadow:SvGridChartView-BJEpaO8h.js");s.textContent=c;document.head.appendChild(s);}catch(e){}})();
|
|
2
2
|
import { s as e } from "./chart-CVOJXX1_.js";
|
|
3
|
-
import {
|
|
4
|
-
import { t as l } from "./SvGridChart-
|
|
3
|
+
import { B as t, J as n, N as r, at as i, ct as a, j as o, nt as s, ot as c } from "./client-DeNKZvIV.js";
|
|
4
|
+
import { t as l } from "./SvGridChart-_GY1Mgr4.js";
|
|
5
5
|
import "./sv-grid-shadow-element.js";
|
|
6
6
|
//#region ../grid/dist/SvGridChartView.svelte
|
|
7
|
-
var u =
|
|
8
|
-
function d(
|
|
9
|
-
|
|
7
|
+
var u = r("<div class=\"sv-grid-chart-view svelte-733vyy\"><!></div>");
|
|
8
|
+
function d(r, d) {
|
|
9
|
+
c(d, !0);
|
|
10
10
|
let f = s(() => {
|
|
11
11
|
let t = e(d.data ?? [], {
|
|
12
12
|
type: d.chart.type ?? "bar",
|
|
@@ -24,23 +24,23 @@ function d(n, d) {
|
|
|
24
24
|
let n = d.chart.locale ?? d.localization?.locale;
|
|
25
25
|
return n && (t.locale = n), d.chart.currency && (t.currency = d.chart.currency), t;
|
|
26
26
|
});
|
|
27
|
-
var p = u(), m =
|
|
27
|
+
var p = u(), m = n(p);
|
|
28
28
|
{
|
|
29
|
-
let e = s(() => d.chart.legend ?? !0),
|
|
29
|
+
let e = s(() => d.chart.legend ?? !0), n = s(() => d.chart.dataLabels ?? !1);
|
|
30
30
|
l(m, {
|
|
31
31
|
get spec() {
|
|
32
|
-
return
|
|
32
|
+
return t(f);
|
|
33
33
|
},
|
|
34
34
|
autosize: !0,
|
|
35
35
|
get legend() {
|
|
36
|
-
return
|
|
36
|
+
return t(e);
|
|
37
37
|
},
|
|
38
38
|
get dataLabels() {
|
|
39
|
-
return
|
|
39
|
+
return t(n);
|
|
40
40
|
}
|
|
41
41
|
});
|
|
42
42
|
}
|
|
43
|
-
|
|
43
|
+
a(p), o(r, p), i();
|
|
44
44
|
}
|
|
45
45
|
//#endregion
|
|
46
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-giyKVcC0.js"||x[i].textContent===c)return;var s=document.createElement('style');s.setAttribute('data-svgrid-grid-wc-chunk',"shadow:SvGridDropdown-giyKVcC0.js");s.textContent=c;document.head.appendChild(s);}catch(e){}})();
|
|
2
|
+
import { $ as e, A as t, B as n, F as r, G as i, J as a, L as o, M as s, N as c, O as l, Q as u, R as d, S as f, T as p, W as m, X as h, Y as ee, Z as g, at as _, b as v, c as te, ct as y, et as b, f as ne, j as x, n as S, nt as C, o as w, ot as re, p as T, st as E, y as D, z as ie } from "./client-DeNKZvIV.js";
|
|
3
|
+
import { n as ae, r as oe, t as O } from "./popover-WsGlvtQv.js";
|
|
4
|
+
import "./sv-grid-shadow-element.js";
|
|
5
|
+
//#region ../grid/dist/SvGridDropdown.svelte
|
|
6
|
+
var se = c("<span class=\"sv-grid-chip sv-grid-chip-removable svelte-r4kmto\"> <span class=\"sv-grid-chip-remove svelte-r4kmto\" role=\"button\">×</span></span>"), k = c("<span class=\"sv-grid-dropdown-chips svelte-r4kmto\"></span>"), A = c("<span class=\"sv-grid-chip svelte-r4kmto\"> </span>"), ce = c("<span class=\"sv-grid-dropdown-label svelte-r4kmto\"> </span>"), le = c("<input type=\"search\" class=\"sv-grid-dropdown-search\" placeholder=\"Search…\"/>"), ue = c("<div class=\"sv-grid-dropdown-empty\" role=\"status\" aria-live=\"polite\">Loading…</div>"), de = c("<div class=\"sv-grid-dropdown-empty\"> </div>"), fe = c("<span class=\"sv-grid-dropdown-check\" aria-hidden=\"true\"> </span>"), pe = c("<span class=\"sv-grid-dropdown-option-chip\"> </span>"), me = c("<span class=\"sv-grid-dropdown-option-label\"> </span>"), he = c("<div role=\"option\"><!> <!></div>"), ge = c("<div class=\"sv-grid-dropdown-footer\"><button type=\"button\" class=\"sv-grid-dropdown-done\">Done</button></div>"), _e = c("<div role=\"listbox\"><!> <!> <!></div>"), ve = c("<div><button type=\"button\" aria-haspopup=\"listbox\"><!> <span class=\"sv-grid-dropdown-caret svelte-r4kmto\" aria-hidden=\"true\">▾</span></button> <!></div>");
|
|
7
|
+
function ye(o, c) {
|
|
8
|
+
let ye = r();
|
|
9
|
+
re(c, !0);
|
|
10
|
+
let j = S(c, "multiple", 3, !1), be = S(c, "placeholder", 3, "Select…"), M = S(c, "renderChipsInTrigger", 3, !1), N = S(c, "searchable", 3, !1), xe = S(c, "autoOpen", 3, !0), Se = S(c, "loading", 3, !1), Ce = S(c, "invalid", 3, !1);
|
|
11
|
+
function P(e) {
|
|
12
|
+
return e >= 0 && e < n(L).length ? `${ye}-opt-${e}` : void 0;
|
|
13
|
+
}
|
|
14
|
+
let F = C(() => c.options.some((e) => e.color) ? 40 : 32), I = b(""), L = C(() => !N() || !n(I).trim() ? c.options : (() => {
|
|
15
|
+
let e = n(I).trim().toLowerCase();
|
|
16
|
+
return c.options.filter((t) => t.label.toLowerCase().includes(e));
|
|
17
|
+
})()), R = b(!1), z = b(-1), B = b(null), V = b(null), H = b(null), U = b(u({
|
|
18
|
+
top: 0,
|
|
19
|
+
left: 0,
|
|
20
|
+
width: 0,
|
|
21
|
+
openUpward: !1,
|
|
22
|
+
maxHeight: 0,
|
|
23
|
+
availHeight: 0
|
|
24
|
+
})), W = C(() => Array.isArray(c.value) ? c.value : c.value == null || c.value === "" ? [] : [c.value]), we = C(() => {
|
|
25
|
+
if (n(W).length === 0) return be();
|
|
26
|
+
if (!j()) {
|
|
27
|
+
let e = n(W)[0], t = c.options.find((t) => String(t.value) === String(e));
|
|
28
|
+
return t ? t.label : String(e);
|
|
29
|
+
}
|
|
30
|
+
return `${n(W).length} selected`;
|
|
31
|
+
}), Te = C(() => {
|
|
32
|
+
if (j() || n(W).length !== 1) return;
|
|
33
|
+
let e = n(W)[0];
|
|
34
|
+
return c.options.find((t) => String(t.value) === String(e))?.color;
|
|
35
|
+
});
|
|
36
|
+
function G(e) {
|
|
37
|
+
return n(W).some((t) => String(t) === String(e.value));
|
|
38
|
+
}
|
|
39
|
+
function K(t) {
|
|
40
|
+
if (j()) {
|
|
41
|
+
let e = G(t) ? n(W).filter((e) => String(e) !== String(t.value)) : [...n(W), t.value];
|
|
42
|
+
c.onChange?.(e);
|
|
43
|
+
} else c.onChange?.(t.value), e(R, !1), c.onCommit?.();
|
|
44
|
+
}
|
|
45
|
+
function q() {
|
|
46
|
+
if (!n(R)) {
|
|
47
|
+
if (e(R, !0), n(z) < 0) {
|
|
48
|
+
let t = c.options.findIndex((e) => G(e));
|
|
49
|
+
e(z, t >= 0 ? t : 0, !0);
|
|
50
|
+
}
|
|
51
|
+
J();
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
function J() {
|
|
55
|
+
if (!n(V)) return;
|
|
56
|
+
let t = Math.min(n(L).length, 10), r = N() ? 38 : 0, i = t * n(F) + (j() ? 40 : 0) + r + 8;
|
|
57
|
+
e(U, O(n(V).getBoundingClientRect(), {
|
|
58
|
+
estimatedHeight: i,
|
|
59
|
+
clampHorizontal: !1
|
|
60
|
+
}), !0);
|
|
61
|
+
}
|
|
62
|
+
i(() => {
|
|
63
|
+
if (!n(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
|
+
}), i(() => {
|
|
69
|
+
n(R) && (n(L).length, n(F), J());
|
|
70
|
+
});
|
|
71
|
+
function Y() {
|
|
72
|
+
e(R, !1), e(z, -1);
|
|
73
|
+
}
|
|
74
|
+
function Ee(t) {
|
|
75
|
+
if (t.stopPropagation(), t.key === "Escape") {
|
|
76
|
+
t.preventDefault(), Y(), c.onCancel?.();
|
|
77
|
+
return;
|
|
78
|
+
}
|
|
79
|
+
if (t.key === "ArrowDown") {
|
|
80
|
+
if (t.preventDefault(), !n(R)) {
|
|
81
|
+
q();
|
|
82
|
+
return;
|
|
83
|
+
}
|
|
84
|
+
e(z, Math.min(n(z) + 1, c.options.length - 1), !0), X();
|
|
85
|
+
} else if (t.key === "ArrowUp") {
|
|
86
|
+
if (t.preventDefault(), !n(R)) {
|
|
87
|
+
q();
|
|
88
|
+
return;
|
|
89
|
+
}
|
|
90
|
+
e(z, Math.max(n(z) - 1, 0), !0), X();
|
|
91
|
+
} else if (t.key === "Home") {
|
|
92
|
+
if (!n(R)) return;
|
|
93
|
+
t.preventDefault(), e(z, 0), X();
|
|
94
|
+
} else if (t.key === "End") {
|
|
95
|
+
if (!n(R)) return;
|
|
96
|
+
t.preventDefault(), e(z, c.options.length - 1), X();
|
|
97
|
+
} else if (t.key === "Enter") {
|
|
98
|
+
if (t.preventDefault(), !n(R)) {
|
|
99
|
+
q();
|
|
100
|
+
return;
|
|
101
|
+
}
|
|
102
|
+
let e = c.options[n(z)];
|
|
103
|
+
e ? K(e) : j() && (Y(), c.onCommit?.());
|
|
104
|
+
} else if (t.key === " " && n(R)) {
|
|
105
|
+
t.preventDefault();
|
|
106
|
+
let e = c.options[n(z)];
|
|
107
|
+
e && K(e);
|
|
108
|
+
} else t.key === "Tab" && (n(R) && Y(), c.onTab ? (t.preventDefault(), c.onTab(t.shiftKey)) : c.onCommit?.());
|
|
109
|
+
}
|
|
110
|
+
function X() {
|
|
111
|
+
queueMicrotask(() => {
|
|
112
|
+
n(H) && n(H).querySelector(`[data-opt-idx="${n(z)}"]`)?.scrollIntoView({ block: "nearest" });
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
function De(e) {
|
|
116
|
+
let t = e.relatedTarget;
|
|
117
|
+
t && n(B)?.contains(t) || (n(R) && Y(), c.onCommit?.());
|
|
118
|
+
}
|
|
119
|
+
function Oe(e, t) {
|
|
120
|
+
t.preventDefault(), t.stopPropagation();
|
|
121
|
+
let r = n(W).filter((t) => String(t) !== String(e));
|
|
122
|
+
c.onChange?.(j() ? r : r[0] ?? null);
|
|
123
|
+
}
|
|
124
|
+
function ke(e) {
|
|
125
|
+
xe() && (e.focus(), q());
|
|
126
|
+
}
|
|
127
|
+
i(() => {
|
|
128
|
+
if (!n(R)) return;
|
|
129
|
+
let e = (e) => {
|
|
130
|
+
let t = e.target;
|
|
131
|
+
t && (n(B)?.contains(t) || n(H)?.contains(t) || (Y(), c.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 $ = a(Q);
|
|
141
|
+
let je;
|
|
142
|
+
var Me = a($), Ne = (e) => {
|
|
143
|
+
var r = k();
|
|
144
|
+
p(r, 21, () => n(W), (e) => String(e), (e, r) => {
|
|
145
|
+
let i = C(() => c.options.find((e) => String(e.value) === String(n(r))));
|
|
146
|
+
var o = se(), s = a(o), l = g(s);
|
|
147
|
+
T(l, "tabindex", -1), y(o), m((e, n, r) => {
|
|
148
|
+
D(o, e), t(s, `${n ?? ""} `), T(l, "aria-label", `Remove ${r ?? ""}`);
|
|
149
|
+
}, [
|
|
150
|
+
() => n(i)?.color ? Z(n(i).color) : "",
|
|
151
|
+
() => n(i) ? n(i).label : String(n(r)),
|
|
152
|
+
() => n(i) ? n(i).label : String(n(r))
|
|
153
|
+
]), d("mousedown", l, (e) => e.preventDefault()), d("click", l, (e) => Oe(n(r), e)), x(e, o);
|
|
154
|
+
}), y(r), x(e, r);
|
|
155
|
+
}, Pe = (e) => {
|
|
156
|
+
var r = A(), i = h(r, !0);
|
|
157
|
+
m((e) => {
|
|
158
|
+
D(r, e), t(i, n(we));
|
|
159
|
+
}, [() => Z(n(Te))]), x(e, r);
|
|
160
|
+
}, Fe = (e) => {
|
|
161
|
+
var r = ce(), i = h(r, !0);
|
|
162
|
+
m(() => t(i, n(we))), x(e, r);
|
|
163
|
+
};
|
|
164
|
+
l(Me, (e) => {
|
|
165
|
+
M() && n(W).length > 0 ? e(Ne) : !j() && n(W).length === 1 && n(Te) ? e(Pe, 1) : e(Fe, -1);
|
|
166
|
+
}), E(2), y($), w($, (t) => e(V, t), () => n(V)), f($, (e) => ke?.(e));
|
|
167
|
+
var Ie = g($, 2), Le = (r) => {
|
|
168
|
+
let i = C(() => c.options.length > 10), o = C(() => Math.min(n(i) ? 10 * n(F) + (j() ? 40 : 0) + 8 : Infinity, n(U).availHeight));
|
|
169
|
+
var u = _e();
|
|
170
|
+
let _, b;
|
|
171
|
+
var S = a(u), re = (t) => {
|
|
172
|
+
var r = le();
|
|
173
|
+
ne(r), d("mousedown", r, (e) => e.stopPropagation()), d("click", r, (e) => e.stopPropagation()), d("keydown", r, (t) => {
|
|
174
|
+
t.key === "Escape" && (t.preventDefault(), e(R, !1), c.onCancel?.());
|
|
175
|
+
}), te(r, () => n(I), (t) => e(I, t)), x(t, r);
|
|
176
|
+
};
|
|
177
|
+
l(S, (e) => {
|
|
178
|
+
N() && e(re);
|
|
179
|
+
});
|
|
180
|
+
var E = g(S, 2), O = (e) => {
|
|
181
|
+
var t = ue();
|
|
182
|
+
x(e, t);
|
|
183
|
+
}, se = (e) => {
|
|
184
|
+
var r = de(), i = h(r, !0);
|
|
185
|
+
m(() => t(i, N() && n(I) ? `No matches for "${n(I)}"` : "No options")), x(e, r);
|
|
186
|
+
}, k = (r) => {
|
|
187
|
+
var i = s(), o = ee(i);
|
|
188
|
+
p(o, 19, () => n(L), (e) => String(e.value), (r, i, o) => {
|
|
189
|
+
let s = C(() => G(n(i)));
|
|
190
|
+
var c = he();
|
|
191
|
+
let u;
|
|
192
|
+
var f = a(c), p = (e) => {
|
|
193
|
+
var r = fe(), i = h(r, !0);
|
|
194
|
+
m(() => t(i, n(s) ? "✓" : "")), x(e, r);
|
|
195
|
+
};
|
|
196
|
+
l(f, (e) => {
|
|
197
|
+
j() && e(p);
|
|
198
|
+
});
|
|
199
|
+
var ee = g(f, 2), _ = (e) => {
|
|
200
|
+
var r = pe(), a = h(r, !0);
|
|
201
|
+
m((e) => {
|
|
202
|
+
D(r, e), t(a, n(i).label);
|
|
203
|
+
}, [() => Z(n(i).color)]), x(e, r);
|
|
204
|
+
}, te = (e) => {
|
|
205
|
+
var r = me(), a = h(r, !0);
|
|
206
|
+
m(() => t(a, n(i).label)), x(e, r);
|
|
207
|
+
};
|
|
208
|
+
l(ee, (e) => {
|
|
209
|
+
n(i).color ? e(_) : e(te, -1);
|
|
210
|
+
}), y(c), m((e) => {
|
|
211
|
+
u = v(c, 1, "sv-grid-dropdown-option", null, u, {
|
|
212
|
+
"sv-grid-dropdown-option-selected": n(s),
|
|
213
|
+
"sv-grid-dropdown-option-highlighted": n(o) === n(z)
|
|
214
|
+
}), T(c, "id", e), T(c, "aria-selected", n(s)), T(c, "data-opt-idx", n(o));
|
|
215
|
+
}, [() => P(n(o))]), d("mousedown", c, (e) => {
|
|
216
|
+
e.preventDefault(), K(n(i));
|
|
217
|
+
}), ie("mouseenter", c, () => e(z, n(o), !0)), x(r, c);
|
|
218
|
+
}), x(r, i);
|
|
219
|
+
};
|
|
220
|
+
l(E, (e) => {
|
|
221
|
+
Se() && n(L).length === 0 ? e(O) : n(L).length === 0 ? e(se, 1) : e(k, -1);
|
|
222
|
+
});
|
|
223
|
+
var A = g(E, 2), ce = (e) => {
|
|
224
|
+
var t = ge(), n = h(t);
|
|
225
|
+
d("mousedown", n, (e) => e.preventDefault()), d("click", n, () => {
|
|
226
|
+
Y(), c.onCommit?.();
|
|
227
|
+
}), x(e, t);
|
|
228
|
+
};
|
|
229
|
+
l(A, (e) => {
|
|
230
|
+
j() && e(ce);
|
|
231
|
+
}), y(u), w(u, (t) => e(H, t), () => n(H)), f(u, (e) => oe?.(e)), f(u, (e, t) => ae?.(e, t), () => ({ up: n(U).openUpward })), m(() => {
|
|
232
|
+
_ = v(u, 1, "sv-grid-dropdown-panel", null, _, { "sv-grid-dropdown-panel-fits": !n(i) }), T(u, "aria-multiselectable", j()), b = D(u, "", b, {
|
|
233
|
+
position: "fixed",
|
|
234
|
+
top: n(U).openUpward ? null : `${n(U).top}px`,
|
|
235
|
+
bottom: n(U).openUpward ? `${n(U).bottom}px` : null,
|
|
236
|
+
left: `${n(U).left}px`,
|
|
237
|
+
width: `${n(U).width}px`,
|
|
238
|
+
"max-height": n(o) === null ? null : `${n(o)}px`,
|
|
239
|
+
"z-index": "2147483647"
|
|
240
|
+
});
|
|
241
|
+
}), d("pointerdown", u, (e) => e.stopPropagation()), d("mousedown", u, (e) => e.stopPropagation()), d("click", u, (e) => e.stopPropagation()), x(r, u);
|
|
242
|
+
};
|
|
243
|
+
l(Ie, (e) => {
|
|
244
|
+
n(R) && e(Le);
|
|
245
|
+
}), y(Q), w(Q, (t) => e(B, t), () => n(B)), m((e) => {
|
|
246
|
+
Ae = v(Q, 1, "sv-grid-dropdown svelte-r4kmto", null, Ae, { "sv-grid-dropdown-open": n(R) }), T($, "id", c.id), je = v($, 1, "sv-grid-dropdown-trigger svelte-r4kmto", null, je, { "sv-grid-dropdown-trigger-chips": M() && n(W).length > 0 }), T($, "aria-expanded", n(R)), T($, "aria-label", c.ariaLabel), T($, "aria-invalid", Ce() || void 0), T($, "aria-describedby", c.describedBy), T($, "aria-activedescendant", e);
|
|
247
|
+
}, [() => n(R) ? P(n(z)) : void 0]), d("focusout", Q, De), d("click", Q, (e) => e.stopPropagation()), d("dblclick", Q, (e) => e.stopPropagation()), d("pointerdown", Q, (e) => e.stopPropagation()), d("mousedown", Q, (e) => e.stopPropagation()), d("click", $, () => n(R) ? Y() : q()), d("keydown", $, Ee), x(o, Q), _();
|
|
248
|
+
}
|
|
249
|
+
o([
|
|
250
|
+
"focusout",
|
|
251
|
+
"click",
|
|
252
|
+
"dblclick",
|
|
253
|
+
"pointerdown",
|
|
254
|
+
"mousedown",
|
|
255
|
+
"keydown"
|
|
256
|
+
]);
|
|
257
|
+
//#endregion
|
|
258
|
+
export { ye as default };
|