@svgrid/enterprise 3.1.17 → 3.1.18
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/SvGridEditPanel.svelte +14 -1
- package/dist/SvGridScheduler.svelte +15 -6
- package/dist/SvSheet.svelte +2 -0
- package/dist/cdn/svgrid-enterprise.svelte-external.js +6582 -6501
- package/dist/designer/assets/{index-C1Ujg62Z.js → index-DKudY-XD.js} +357 -346
- package/dist/designer/assets/index-WCxj6WfJ.css +1 -0
- package/dist/designer/index.html +2 -2
- package/dist/fields/SvBase.svelte +36 -33
- package/dist/fields/base-connect.js +50 -9
- package/dist/fields/base-sql.d.ts +8 -0
- package/dist/fields/base-sql.js +12 -3
- package/dist/install.js +3 -3
- package/dist/node/studio.js +205 -60
- package/dist/sheet-enable.d.ts +8 -2
- package/dist/sheet-enable.js +21 -9
- package/dist/sources/introspect-supabase.d.ts +6 -3
- package/dist/sources/introspect-supabase.js +29 -11
- package/dist/sources/supabase.d.ts +10 -0
- package/dist/sources/supabase.js +11 -2
- package/dist/studio/cli.d.ts +9 -0
- package/dist/studio/cli.js +41 -7
- package/dist/studio/emit-project.d.ts +3 -1
- package/dist/studio/emit-project.js +84 -33
- package/dist/studio/emit-schema.js +9 -2
- package/dist/studio/index.d.ts +1 -1
- package/dist/studio/init-flow.d.ts +7 -0
- package/dist/studio/init-flow.js +23 -2
- package/dist/studio/introspect-db.d.ts +15 -1
- package/dist/studio/introspect-db.js +29 -5
- package/dist/sveltekit/sql-source.d.ts +24 -0
- package/dist/sveltekit/sql-source.js +34 -1
- package/dist/sveltekit/sql.js +14 -2
- package/dist/version.d.ts +2 -2
- package/dist/version.js +2 -2
- package/dist/wc/GridFooter-BgoA77TJ.js +145 -0
- package/dist/wc/{GridMenus-q9qYpzKh.js → GridMenus-DVGuqp2l.js} +430 -430
- package/dist/wc/{PinSplitter-D-qtDhSM.js → PinSplitter-Btco0txr.js} +24 -24
- package/dist/wc/{SvChartMenu-CQNrQGT2.js → SvChartMenu-Ue-HFR5c.js} +58 -58
- package/dist/wc/{SvDateRangeInput-BYNOfYxD.js → SvDateRangeInput-CJZohgBe.js} +43 -43
- package/dist/wc/{SvDateTimePicker-Bq9N0Oiy.js → SvDateTimePicker-DmK_QkkU.js} +241 -241
- package/dist/wc/{SvField-B_kurx_P.js → SvField-C-OodMMv.js} +71 -71
- package/dist/wc/SvGridCellEditor-C7ios4i_.js +582 -0
- package/dist/wc/{SvGridChart-DrmqEen2.js → SvGridChart-DWRqlhCV.js} +549 -549
- package/dist/wc/{SvGridChartBuilder-XFvW1BdT.js → SvGridChartBuilder-BXW3yUR0.js} +337 -337
- package/dist/wc/{SvGridChartPanel-oJJtUKG6.js → SvGridChartPanel-28n4tomx.js} +354 -354
- package/dist/wc/{SvGridChartView-Cetuj70H.js → SvGridChartView-CbG_WrU-.js} +7 -7
- package/dist/wc/{SvGridDropdown-45WsObLL.js → SvGridDropdown-BVnpNU_I.js} +130 -130
- package/dist/wc/{SvModal-DrfOYYyX.js → SvModal-DLppAQED.js} +91 -91
- package/dist/wc/{client-DQIzjDBG.js → client-GWAV79ON.js} +479 -476
- package/dist/wc/{date-format-DS-z_h9v.js → date-format-4_QoS4zZ.js} +393 -393
- package/dist/wc/{grid-extension.svelte-Bufq4B4C.js → grid-extension.svelte-CucBS4FL.js} +1 -1
- package/dist/wc/sv-sheet-element.js +10474 -10460
- package/dist/wc/{svelte-virtualizer.svelte-CkZaFakp.js → svelte-virtualizer.svelte-BDcouWqw.js} +3 -3
- package/package.json +17 -4
- package/dist/designer/assets/index-DdmxO6Dd.css +0 -1
- package/dist/wc/GridFooter-4T29pfok.js +0 -145
- package/dist/wc/SvGridCellEditor-Nnl8C3Yj.js +0 -582
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { G as e, I as t, R as n, T as r,
|
|
1
|
+
import { G as e, I as t, R as n, T as r, ct as i, dt as a, ft as o, ht as s, tt as c } from "./client-GWAV79ON.js";
|
|
2
2
|
import { s as l } from "./chart-CznMeoM7.js";
|
|
3
|
-
import { t as u } from "./SvGridChart-
|
|
3
|
+
import { t as u } from "./SvGridChart-DWRqlhCV.js";
|
|
4
4
|
//#region ../grid/dist/SvGridChartView.svelte
|
|
5
5
|
var d = n("<div class=\"sv-grid-chart-view svelte-733vyy\"><!></div>"), f = {
|
|
6
6
|
hash: "svelte-733vyy",
|
|
7
7
|
code: "\n /* A grid, so the autosized chart is stretched to the full height rather\n than asking for a percentage of it (which cannot be measured reliably). */.sv-grid-chart-view.svelte-733vyy {display:grid;width:100%;height:100%;min-height:0;box-sizing:border-box;}"
|
|
8
8
|
};
|
|
9
9
|
function p(n, p) {
|
|
10
|
-
|
|
11
|
-
let m =
|
|
10
|
+
o(p, !0), r(n, f);
|
|
11
|
+
let m = i(() => {
|
|
12
12
|
let e = l(p.data ?? [], {
|
|
13
13
|
type: p.chart.type ?? "bar",
|
|
14
14
|
category: p.chart.category,
|
|
@@ -25,9 +25,9 @@ function p(n, p) {
|
|
|
25
25
|
let t = p.chart.locale ?? p.localization?.locale;
|
|
26
26
|
return t && (e.locale = t), p.chart.currency && (e.currency = p.chart.currency), e;
|
|
27
27
|
});
|
|
28
|
-
var h = d(), g =
|
|
28
|
+
var h = d(), g = c(h);
|
|
29
29
|
{
|
|
30
|
-
let t =
|
|
30
|
+
let t = i(() => p.chart.legend ?? !0), n = i(() => p.chart.dataLabels ?? !1);
|
|
31
31
|
u(g, {
|
|
32
32
|
get spec() {
|
|
33
33
|
return e(m);
|
|
@@ -41,7 +41,7 @@ function p(n, p) {
|
|
|
41
41
|
}
|
|
42
42
|
});
|
|
43
43
|
}
|
|
44
|
-
|
|
44
|
+
s(h), t(n, h), a();
|
|
45
45
|
}
|
|
46
46
|
//#endregion
|
|
47
47
|
export { p as default };
|
|
@@ -1,76 +1,76 @@
|
|
|
1
|
-
import { B as e, G as t, H as n, I as r, L as i, O as a, P as o, R as s, S as c, T as l, U as u, W as ee, X as d, Y as f, a as p, at as m,
|
|
2
|
-
import { n as
|
|
1
|
+
import { B as e, G as t, H as n, I as r, L as i, O as a, P as o, R as s, S as c, T as l, U as u, W as ee, X as d, Y as f, a as p, at as m, ct as h, dt as g, ft as _, ht as v, it as y, j as b, l as te, m as x, mt as S, n as C, nt as ne, ot as w, p as re, rt as T, tt as E, w as D, x as O } from "./client-GWAV79ON.js";
|
|
2
|
+
import { n as ie, r as ae, t as oe } from "./popover-WsGlvtQv.js";
|
|
3
3
|
//#region ../grid/dist/SvGridDropdown.svelte
|
|
4
|
-
var
|
|
4
|
+
var se = s("<span class=\"sv-grid-chip sv-grid-chip-removable svelte-r4kmto\"> <span class=\"sv-grid-chip-remove svelte-r4kmto\" role=\"button\">×</span></span>"), ce = s("<span class=\"sv-grid-dropdown-chips svelte-r4kmto\"></span>"), le = s("<span class=\"sv-grid-chip svelte-r4kmto\"> </span>"), ue = s("<span class=\"sv-grid-dropdown-label svelte-r4kmto\"> </span>"), de = s("<input type=\"search\" class=\"sv-grid-dropdown-search\" placeholder=\"Search…\"/>"), fe = s("<div class=\"sv-grid-dropdown-empty\" role=\"status\" aria-live=\"polite\">Loading…</div>"), pe = s("<div class=\"sv-grid-dropdown-empty\"> </div>"), me = s("<span class=\"sv-grid-dropdown-check\" aria-hidden=\"true\"> </span>"), he = s("<span class=\"sv-grid-dropdown-option-chip\"> </span>"), ge = s("<span class=\"sv-grid-dropdown-option-label\"> </span>"), _e = s("<div role=\"option\"><!> <!></div>"), ve = s("<div class=\"sv-grid-dropdown-footer\"><button type=\"button\" class=\"sv-grid-dropdown-done\">Done</button></div>"), ye = s("<div role=\"listbox\"><!> <!> <!></div>"), be = s("<div><button type=\"button\" aria-haspopup=\"listbox\"><!> <span class=\"sv-grid-dropdown-caret svelte-r4kmto\" aria-hidden=\"true\">▾</span></button> <!></div>"), xe = {
|
|
5
5
|
hash: "svelte-r4kmto",
|
|
6
6
|
code: "\n /* All colors derive from the grid's host CSS vars so light/dark themes\n \"just work\". Hard fallbacks are kept so the component is still\n usable in an unthemed page. */.sv-grid-dropdown.svelte-r4kmto {position:absolute;top:0;left:0;right:0;height:100%;background:var(--sg-bg, #ffffff);color:var(--sg-fg, #0f172a);}.sv-grid-dropdown-trigger.svelte-r4kmto {display:flex;align-items:center;gap:6px;width:100%;height:100%;min-height:28px;padding:0 8px;background:var(--sg-bg, #ffffff);color:var(--sg-fg, #0f172a);border:0;outline:none;font:inherit;text-align:start;cursor:pointer;box-sizing:border-box;}.sv-grid-dropdown-trigger.svelte-r4kmto:focus {outline:2px solid var(--sg-accent, #2563eb);outline-offset:-2px;}.sv-grid-dropdown-trigger-chips.svelte-r4kmto {align-items:center;padding:4px 8px;flex-wrap:wrap;}.sv-grid-dropdown-chips.svelte-r4kmto {display:inline-flex;flex-wrap:wrap;gap:4px;flex:1 1 auto;min-width:0;align-items:center;}.sv-grid-dropdown-label.svelte-r4kmto {flex:1 1 auto;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}.sv-grid-dropdown-caret.svelte-r4kmto {flex:0 0 auto;font-size:10px;opacity:0.7;line-height:1;}\n\n /* Popover sits absolutely below the trigger. The parent\n `.sv-grid-cell-editing` has `overflow: visible`, so this can hang\n past the row. Pulls its surface color from the grid's header bg\n so it reads as a slightly elevated layer on either theme. */\n /* Panel is `position: fixed` AND portal'd into document.body via\n `use:portalToBody`, so it escapes every ancestor overflow / clip /\n transform / stacking context. Coords come from updatePanelPosition(). */.sv-grid-dropdown-panel {overflow-y:auto;background:var(--sg-header-bg, var(--sg-bg, #ffffff));color:var(--sg-fg, #0f172a);border:1px solid var(--sg-accent, #2563eb);border-radius:6px;box-shadow:0 12px 28px rgba(0, 0, 0, 0.45);padding:4px 0;font-family:inherit;}\n /* When the option list fits in one panel we want NO scrollbar at all -\n * not even a sub-pixel ghost track. `overflow: visible` rules out the\n * scrollbar gutter that some browsers still reserve under\n * `overflow: auto` when content equals max-height. */.sv-grid-dropdown-panel.sv-grid-dropdown-panel-fits {overflow:visible;}.sv-grid-dropdown-option {display:flex;align-items:center;gap:8px;padding:6px 10px;cursor:pointer;user-select:none;color:var(--sg-fg, #0f172a);}.sv-grid-dropdown-option-highlighted {background:var(--sg-row-hover-bg, rgba(37, 99, 235, 0.1));}.sv-grid-dropdown-option-selected {font-weight:600;background:var(--sg-selection-bg, rgba(37, 99, 235, 0.15));}.sv-grid-dropdown-option-selected.sv-grid-dropdown-option-highlighted {background:var(--sg-row-hover-bg, rgba(37, 99, 235, 0.18));}.sv-grid-dropdown-option-label {flex:1 1 auto;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}.sv-grid-dropdown-check {flex:0 0 16px;display:inline-flex;align-items:center;justify-content:center;color:var(--sg-accent, #2563eb);font-weight:700;}.sv-grid-dropdown-swatch {flex:0 0 12px;width:12px;height:12px;border-radius:999px;border:1px solid color-mix(in srgb, var(--sg-fg, #0f172a) 25%, transparent);}\n /* Colored option chip. Declared `:global` because the option panel is\n portal'd to <body>, where Svelte's scoped classes don't reach. The\n per-chip background / border / text color come from an inline style\n (see colorfulChipStyleInline) so each option matches its cell chip. */.sv-grid-dropdown-option-chip {display:inline-flex;align-items:center;max-width:100%;padding:2px 11px;border:1px solid transparent;border-radius:999px;font-size:0.9em;font-weight:600;line-height:1.5;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}.sv-grid-dropdown-empty {padding:8px 10px;color:var(--sg-muted, rgba(15, 23, 42, 0.55));font-style:italic;font-size:0.9em;}.sv-grid-dropdown-footer {display:flex;justify-content:flex-end;padding:4px 6px;border-top:1px solid var(--sg-border, rgba(15, 23, 42, 0.08));margin-top:2px;}.sv-grid-dropdown-done {font-size:11px;text-transform:uppercase;letter-spacing:0.04em;color:#fff;background:var(--sg-accent, #2563eb);border:0;border-radius:4px;padding:4px 10px;cursor:pointer;}.sv-grid-dropdown-done:hover {filter:brightness(1.12);}\n\n /* Note: option / footer / swatch styles are declared `:global(...)`\n above because the panel is portal'd to <body> and Svelte's scoped\n class won't survive on children of an element living outside the\n component subtree. */\n\n /* Theme-aware chip badges. Inside the trigger they sit on the cell\n background, so we need a tone that contrasts on BOTH themes - a\n translucent accent works well in dark mode and reads as a soft\n blue pill in light mode. */.sv-grid-chip.svelte-r4kmto {display:inline-flex;align-items:center;gap:4px;padding:2px 8px;font-size:0.85em;line-height:1.4;background:color-mix(in srgb, var(--sg-accent, #2563eb) 18%, transparent);color:var(--sg-fg, #0f172a);border-radius:999px;border:1px solid color-mix(in srgb, var(--sg-accent, #2563eb) 35%, transparent);white-space:nowrap;}.sv-grid-chip-removable.svelte-r4kmto {padding-inline-end:2px;}.sv-grid-chip-remove.svelte-r4kmto {display:inline-flex;align-items:center;justify-content:center;width:16px;height:16px;border:0;border-radius:999px;background:color-mix(in srgb, var(--sg-fg, #0f172a) 18%, transparent);color:inherit;font-size:12px;line-height:1;cursor:pointer;padding:0;}.sv-grid-chip-remove.svelte-r4kmto:hover {background:rgba(220, 38, 38, 0.7);color:#fff;}"
|
|
7
7
|
};
|
|
8
|
-
function
|
|
9
|
-
let
|
|
10
|
-
|
|
11
|
-
let
|
|
12
|
-
function
|
|
13
|
-
return e >= 0 && e < t(
|
|
8
|
+
function Se(n, s) {
|
|
9
|
+
let Se = e();
|
|
10
|
+
_(s, !0), l(n, xe);
|
|
11
|
+
let k = C(s, "multiple", 3, !1), Ce = C(s, "placeholder", 3, "Select…"), A = C(s, "renderChipsInTrigger", 3, !1), j = C(s, "searchable", 3, !1), we = C(s, "autoOpen", 3, !0), Te = C(s, "loading", 3, !1), Ee = C(s, "invalid", 3, !1);
|
|
12
|
+
function M(e) {
|
|
13
|
+
return e >= 0 && e < t(F).length ? `${Se}-opt-${e}` : void 0;
|
|
14
14
|
}
|
|
15
|
-
let
|
|
16
|
-
let e = t(
|
|
15
|
+
let N = h(() => s.options.some((e) => e.color) ? 40 : 32), P = w(""), F = h(() => !j() || !t(P).trim() ? s.options : (() => {
|
|
16
|
+
let e = t(P).trim().toLowerCase();
|
|
17
17
|
return s.options.filter((t) => t.label.toLowerCase().includes(e));
|
|
18
|
-
})()),
|
|
18
|
+
})()), I = w(!1), L = w(-1), R = w(null), z = w(null), B = w(null), V = w(y({
|
|
19
19
|
top: 0,
|
|
20
20
|
left: 0,
|
|
21
21
|
width: 0,
|
|
22
22
|
openUpward: !1,
|
|
23
23
|
maxHeight: 0,
|
|
24
24
|
availHeight: 0
|
|
25
|
-
})),
|
|
26
|
-
if (t(
|
|
27
|
-
if (!
|
|
28
|
-
let e = t(
|
|
25
|
+
})), H = h(() => Array.isArray(s.value) ? s.value : s.value == null || s.value === "" ? [] : [s.value]), U = h(() => {
|
|
26
|
+
if (t(H).length === 0) return Ce();
|
|
27
|
+
if (!k()) {
|
|
28
|
+
let e = t(H)[0], n = s.options.find((t) => String(t.value) === String(e));
|
|
29
29
|
return n ? n.label : String(e);
|
|
30
30
|
}
|
|
31
|
-
return `${t(
|
|
32
|
-
}),
|
|
33
|
-
if (
|
|
34
|
-
let e = t(
|
|
31
|
+
return `${t(H).length} selected`;
|
|
32
|
+
}), W = h(() => {
|
|
33
|
+
if (k() || t(H).length !== 1) return;
|
|
34
|
+
let e = t(H)[0];
|
|
35
35
|
return s.options.find((t) => String(t.value) === String(e))?.color;
|
|
36
36
|
});
|
|
37
37
|
function G(e) {
|
|
38
|
-
return t(
|
|
38
|
+
return t(H).some((t) => String(t) === String(e.value));
|
|
39
39
|
}
|
|
40
40
|
function K(e) {
|
|
41
|
-
if (
|
|
42
|
-
let n = G(e) ? t(
|
|
41
|
+
if (k()) {
|
|
42
|
+
let n = G(e) ? t(H).filter((t) => String(t) !== String(e.value)) : [...t(H), e.value];
|
|
43
43
|
s.onChange?.(n);
|
|
44
|
-
} else s.onChange?.(e.value),
|
|
44
|
+
} else s.onChange?.(e.value), m(I, !1), s.onCommit?.();
|
|
45
45
|
}
|
|
46
46
|
function q() {
|
|
47
|
-
if (!t(
|
|
48
|
-
if (
|
|
47
|
+
if (!t(I)) {
|
|
48
|
+
if (m(I, !0), t(L) < 0) {
|
|
49
49
|
let e = s.options.findIndex((e) => G(e));
|
|
50
|
-
|
|
50
|
+
m(L, e >= 0 ? e : 0, !0);
|
|
51
51
|
}
|
|
52
52
|
J();
|
|
53
53
|
}
|
|
54
54
|
}
|
|
55
55
|
function J() {
|
|
56
|
-
if (!t(
|
|
57
|
-
let e = Math.min(t(
|
|
58
|
-
|
|
56
|
+
if (!t(z)) return;
|
|
57
|
+
let e = Math.min(t(F).length, 10), n = j() ? 38 : 0, r = e * t(N) + (k() ? 40 : 0) + n + 8;
|
|
58
|
+
m(V, oe(t(z).getBoundingClientRect(), {
|
|
59
59
|
estimatedHeight: r,
|
|
60
60
|
clampHorizontal: !1
|
|
61
61
|
}), !0);
|
|
62
62
|
}
|
|
63
63
|
d(() => {
|
|
64
|
-
if (!t(
|
|
64
|
+
if (!t(I)) return;
|
|
65
65
|
let e = () => J();
|
|
66
66
|
return window.addEventListener("scroll", e, !0), window.addEventListener("resize", e), () => {
|
|
67
67
|
window.removeEventListener("scroll", e, !0), window.removeEventListener("resize", e);
|
|
68
68
|
};
|
|
69
69
|
}), d(() => {
|
|
70
|
-
t(
|
|
70
|
+
t(I) && (t(F).length, t(N), J());
|
|
71
71
|
});
|
|
72
72
|
function Y() {
|
|
73
|
-
|
|
73
|
+
m(I, !1), m(L, -1);
|
|
74
74
|
}
|
|
75
75
|
function De(e) {
|
|
76
76
|
if (e.stopPropagation(), e.key === "Escape") {
|
|
@@ -78,174 +78,174 @@ function be(n, s) {
|
|
|
78
78
|
return;
|
|
79
79
|
}
|
|
80
80
|
if (e.key === "ArrowDown") {
|
|
81
|
-
if (e.preventDefault(), !t(
|
|
81
|
+
if (e.preventDefault(), !t(I)) {
|
|
82
82
|
q();
|
|
83
83
|
return;
|
|
84
84
|
}
|
|
85
|
-
|
|
85
|
+
m(L, Math.min(t(L) + 1, s.options.length - 1), !0), X();
|
|
86
86
|
} else if (e.key === "ArrowUp") {
|
|
87
|
-
if (e.preventDefault(), !t(
|
|
87
|
+
if (e.preventDefault(), !t(I)) {
|
|
88
88
|
q();
|
|
89
89
|
return;
|
|
90
90
|
}
|
|
91
|
-
|
|
91
|
+
m(L, Math.max(t(L) - 1, 0), !0), X();
|
|
92
92
|
} else if (e.key === "Home") {
|
|
93
|
-
if (!t(
|
|
94
|
-
e.preventDefault(),
|
|
93
|
+
if (!t(I)) return;
|
|
94
|
+
e.preventDefault(), m(L, 0), X();
|
|
95
95
|
} else if (e.key === "End") {
|
|
96
|
-
if (!t(
|
|
97
|
-
e.preventDefault(),
|
|
96
|
+
if (!t(I)) return;
|
|
97
|
+
e.preventDefault(), m(L, s.options.length - 1), X();
|
|
98
98
|
} else if (e.key === "Enter") {
|
|
99
|
-
if (e.preventDefault(), !t(
|
|
99
|
+
if (e.preventDefault(), !t(I)) {
|
|
100
100
|
q();
|
|
101
101
|
return;
|
|
102
102
|
}
|
|
103
|
-
let n = s.options[t(
|
|
104
|
-
n ? K(n) :
|
|
105
|
-
} else if (e.key === " " && t(
|
|
103
|
+
let n = s.options[t(L)];
|
|
104
|
+
n ? K(n) : k() && (Y(), s.onCommit?.());
|
|
105
|
+
} else if (e.key === " " && t(I)) {
|
|
106
106
|
e.preventDefault();
|
|
107
|
-
let n = s.options[t(
|
|
107
|
+
let n = s.options[t(L)];
|
|
108
108
|
n && K(n);
|
|
109
|
-
} else e.key === "Tab" && (t(
|
|
109
|
+
} else e.key === "Tab" && (t(I) && Y(), s.onCommit?.());
|
|
110
110
|
}
|
|
111
111
|
function X() {
|
|
112
112
|
queueMicrotask(() => {
|
|
113
|
-
t(
|
|
113
|
+
t(B) && t(B).querySelector(`[data-opt-idx="${t(L)}"]`)?.scrollIntoView({ block: "nearest" });
|
|
114
114
|
});
|
|
115
115
|
}
|
|
116
116
|
function Oe(e) {
|
|
117
117
|
let n = e.relatedTarget;
|
|
118
|
-
n && t(
|
|
118
|
+
n && t(R)?.contains(n) || (t(I) && Y(), s.onCommit?.());
|
|
119
119
|
}
|
|
120
120
|
function ke(e, n) {
|
|
121
121
|
n.preventDefault(), n.stopPropagation();
|
|
122
|
-
let r = t(
|
|
123
|
-
s.onChange?.(
|
|
122
|
+
let r = t(H).filter((t) => String(t) !== String(e));
|
|
123
|
+
s.onChange?.(k() ? r : r[0] ?? null);
|
|
124
124
|
}
|
|
125
125
|
function Ae(e) {
|
|
126
|
-
|
|
126
|
+
we() && (e.focus(), q());
|
|
127
127
|
}
|
|
128
128
|
d(() => {
|
|
129
|
-
if (!t(
|
|
129
|
+
if (!t(I)) return;
|
|
130
130
|
let e = (e) => {
|
|
131
131
|
let n = e.target;
|
|
132
|
-
n && (t(
|
|
132
|
+
n && (t(R)?.contains(n) || t(B)?.contains(n) || (Y(), s.onCommit?.()));
|
|
133
133
|
};
|
|
134
134
|
return document.addEventListener("pointerdown", e, !0), () => document.removeEventListener("pointerdown", e, !0);
|
|
135
135
|
});
|
|
136
136
|
function Z(e) {
|
|
137
137
|
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));`;
|
|
138
138
|
}
|
|
139
|
-
var Q =
|
|
139
|
+
var Q = be();
|
|
140
140
|
let je;
|
|
141
|
-
var $ =
|
|
141
|
+
var $ = E(Q);
|
|
142
142
|
let Me;
|
|
143
|
-
var Ne =
|
|
144
|
-
var n =
|
|
145
|
-
a(n, 21, () => t(
|
|
146
|
-
let i =
|
|
147
|
-
var a =
|
|
148
|
-
|
|
149
|
-
|
|
143
|
+
var Ne = E($), Pe = (e) => {
|
|
144
|
+
var n = ce();
|
|
145
|
+
a(n, 21, () => t(H), (e) => String(e), (e, n) => {
|
|
146
|
+
let i = h(() => s.options.find((e) => String(e.value) === String(t(n))));
|
|
147
|
+
var a = se(), c = E(a), l = T(c);
|
|
148
|
+
x(l, "tabindex", -1), v(a), f((e, t, n) => {
|
|
149
|
+
O(a, e), o(c, `${t ?? ""} `), x(l, "aria-label", `Remove ${n ?? ""}`);
|
|
150
150
|
}, [
|
|
151
151
|
() => t(i)?.color ? Z(t(i).color) : "",
|
|
152
152
|
() => t(i) ? t(i).label : String(t(n)),
|
|
153
153
|
() => t(i) ? t(i).label : String(t(n))
|
|
154
154
|
]), u("mousedown", l, (e) => e.preventDefault()), u("click", l, (e) => ke(t(n), e)), r(e, a);
|
|
155
|
-
}),
|
|
155
|
+
}), v(n), r(e, n);
|
|
156
156
|
}, Fe = (e) => {
|
|
157
|
-
var n =
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
}, [() => Z(t(
|
|
157
|
+
var n = le(), i = E(n, !0);
|
|
158
|
+
v(n), f((e) => {
|
|
159
|
+
O(n, e), o(i, t(U));
|
|
160
|
+
}, [() => Z(t(W))]), r(e, n);
|
|
161
161
|
}, Ie = (e) => {
|
|
162
|
-
var n =
|
|
163
|
-
|
|
162
|
+
var n = ue(), i = E(n, !0);
|
|
163
|
+
v(n), f(() => o(i, t(U))), r(e, n);
|
|
164
164
|
};
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
}),
|
|
168
|
-
var Le =
|
|
169
|
-
let n =
|
|
170
|
-
var d =
|
|
171
|
-
let
|
|
172
|
-
var
|
|
173
|
-
var n =
|
|
174
|
-
|
|
175
|
-
e.key === "Escape" && (e.preventDefault(),
|
|
176
|
-
}),
|
|
165
|
+
b(Ne, (e) => {
|
|
166
|
+
A() && t(H).length > 0 ? e(Pe) : !k() && t(H).length === 1 && t(W) ? e(Fe, 1) : e(Ie, -1);
|
|
167
|
+
}), S(2), v($), p($, (e) => m(z, e), () => t(z)), D($, (e) => Ae?.(e));
|
|
168
|
+
var Le = T($, 2), Re = (e) => {
|
|
169
|
+
let n = h(() => s.options.length > 10), l = h(() => Math.min(t(n) ? 10 * t(N) + (k() ? 40 : 0) + 8 : Infinity, t(V).availHeight));
|
|
170
|
+
var d = ye();
|
|
171
|
+
let g, _;
|
|
172
|
+
var y = E(d), S = (e) => {
|
|
173
|
+
var n = de();
|
|
174
|
+
re(n), u("mousedown", n, (e) => e.stopPropagation()), u("click", n, (e) => e.stopPropagation()), u("keydown", n, (e) => {
|
|
175
|
+
e.key === "Escape" && (e.preventDefault(), m(I, !1), s.onCancel?.());
|
|
176
|
+
}), te(n, () => t(P), (e) => m(P, e)), r(e, n);
|
|
177
177
|
};
|
|
178
|
-
|
|
179
|
-
|
|
178
|
+
b(y, (e) => {
|
|
179
|
+
j() && e(S);
|
|
180
180
|
});
|
|
181
|
-
var
|
|
182
|
-
var t =
|
|
181
|
+
var C = T(y, 2), w = (e) => {
|
|
182
|
+
var t = fe();
|
|
183
183
|
r(e, t);
|
|
184
|
-
},
|
|
185
|
-
var n =
|
|
186
|
-
|
|
187
|
-
},
|
|
184
|
+
}, oe = (e) => {
|
|
185
|
+
var n = pe(), i = E(n, !0);
|
|
186
|
+
v(n), f(() => o(i, j() && t(P) ? `No matches for "${t(P)}"` : "No options")), r(e, n);
|
|
187
|
+
}, se = (e) => {
|
|
188
188
|
var n = i(), s = ne(n);
|
|
189
|
-
a(s, 19, () => t(
|
|
190
|
-
let a =
|
|
191
|
-
var s =
|
|
189
|
+
a(s, 19, () => t(F), (e) => String(e.value), (e, n, i) => {
|
|
190
|
+
let a = h(() => G(t(n)));
|
|
191
|
+
var s = _e();
|
|
192
192
|
let l;
|
|
193
|
-
var d =
|
|
194
|
-
var n =
|
|
195
|
-
|
|
193
|
+
var d = E(s), p = (e) => {
|
|
194
|
+
var n = me(), i = E(n, !0);
|
|
195
|
+
v(n), f(() => o(i, t(a) ? "✓" : "")), r(e, n);
|
|
196
196
|
};
|
|
197
|
-
|
|
198
|
-
|
|
197
|
+
b(d, (e) => {
|
|
198
|
+
k() && e(p);
|
|
199
199
|
});
|
|
200
|
-
var
|
|
201
|
-
var i =
|
|
202
|
-
|
|
203
|
-
|
|
200
|
+
var g = T(d, 2), _ = (e) => {
|
|
201
|
+
var i = he(), a = E(i, !0);
|
|
202
|
+
v(i), f((e) => {
|
|
203
|
+
O(i, e), o(a, t(n).label);
|
|
204
204
|
}, [() => Z(t(n).color)]), r(e, i);
|
|
205
205
|
}, y = (e) => {
|
|
206
|
-
var i =
|
|
207
|
-
|
|
206
|
+
var i = ge(), a = E(i, !0);
|
|
207
|
+
v(i), f(() => o(a, t(n).label)), r(e, i);
|
|
208
208
|
};
|
|
209
|
-
|
|
210
|
-
t(n).color ? e(
|
|
211
|
-
}),
|
|
209
|
+
b(g, (e) => {
|
|
210
|
+
t(n).color ? e(_) : e(y, -1);
|
|
211
|
+
}), v(s), f((e) => {
|
|
212
212
|
l = c(s, 1, "sv-grid-dropdown-option", null, l, {
|
|
213
213
|
"sv-grid-dropdown-option-selected": t(a),
|
|
214
|
-
"sv-grid-dropdown-option-highlighted": t(i) === t(
|
|
215
|
-
}),
|
|
216
|
-
}, [() =>
|
|
214
|
+
"sv-grid-dropdown-option-highlighted": t(i) === t(L)
|
|
215
|
+
}), x(s, "id", e), x(s, "aria-selected", t(a)), x(s, "data-opt-idx", t(i));
|
|
216
|
+
}, [() => M(t(i))]), u("mousedown", s, (e) => {
|
|
217
217
|
e.preventDefault(), K(t(n));
|
|
218
|
-
}), ee("mouseenter", s, () =>
|
|
218
|
+
}), ee("mouseenter", s, () => m(L, t(i), !0)), r(e, s);
|
|
219
219
|
}), r(e, n);
|
|
220
220
|
};
|
|
221
|
-
|
|
222
|
-
|
|
221
|
+
b(C, (e) => {
|
|
222
|
+
Te() && t(F).length === 0 ? e(w) : t(F).length === 0 ? e(oe, 1) : e(se, -1);
|
|
223
223
|
});
|
|
224
|
-
var
|
|
225
|
-
var t =
|
|
226
|
-
|
|
224
|
+
var ce = T(C, 2), le = (e) => {
|
|
225
|
+
var t = ve(), n = E(t);
|
|
226
|
+
v(t), u("mousedown", n, (e) => e.preventDefault()), u("click", n, () => {
|
|
227
227
|
Y(), s.onCommit?.();
|
|
228
228
|
}), r(e, t);
|
|
229
229
|
};
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
}),
|
|
233
|
-
|
|
230
|
+
b(ce, (e) => {
|
|
231
|
+
k() && e(le);
|
|
232
|
+
}), v(d), p(d, (e) => m(B, e), () => t(B)), D(d, (e) => ae?.(e)), D(d, (e, t) => ie?.(e, t), () => ({ up: t(V).openUpward })), f(() => {
|
|
233
|
+
g = c(d, 1, "sv-grid-dropdown-panel", null, g, { "sv-grid-dropdown-panel-fits": !t(n) }), x(d, "aria-multiselectable", k()), _ = O(d, "", _, {
|
|
234
234
|
position: "fixed",
|
|
235
|
-
top: t(
|
|
236
|
-
bottom: t(
|
|
237
|
-
left: `${t(
|
|
238
|
-
width: `${t(
|
|
235
|
+
top: t(V).openUpward ? null : `${t(V).top}px`,
|
|
236
|
+
bottom: t(V).openUpward ? `${t(V).bottom}px` : null,
|
|
237
|
+
left: `${t(V).left}px`,
|
|
238
|
+
width: `${t(V).width}px`,
|
|
239
239
|
"max-height": t(l) === null ? null : `${t(l)}px`,
|
|
240
240
|
"z-index": "2147483647"
|
|
241
241
|
});
|
|
242
242
|
}), u("pointerdown", d, (e) => e.stopPropagation()), u("mousedown", d, (e) => e.stopPropagation()), u("click", d, (e) => e.stopPropagation()), r(e, d);
|
|
243
243
|
};
|
|
244
|
-
|
|
245
|
-
t(
|
|
246
|
-
}),
|
|
247
|
-
je = c(Q, 1, "sv-grid-dropdown svelte-r4kmto", null, je, { "sv-grid-dropdown-open": t(
|
|
248
|
-
}, [() => t(
|
|
244
|
+
b(Le, (e) => {
|
|
245
|
+
t(I) && e(Re);
|
|
246
|
+
}), v(Q), p(Q, (e) => m(R, e), () => t(R)), f((e) => {
|
|
247
|
+
je = c(Q, 1, "sv-grid-dropdown svelte-r4kmto", null, je, { "sv-grid-dropdown-open": t(I) }), x($, "id", s.id), Me = c($, 1, "sv-grid-dropdown-trigger svelte-r4kmto", null, Me, { "sv-grid-dropdown-trigger-chips": A() && t(H).length > 0 }), x($, "aria-expanded", t(I)), x($, "aria-label", s.ariaLabel), x($, "aria-invalid", Ee() || void 0), x($, "aria-describedby", s.describedBy), x($, "aria-activedescendant", e);
|
|
248
|
+
}, [() => t(I) ? M(t(L)) : void 0]), u("focusout", Q, Oe), u("click", Q, (e) => e.stopPropagation()), u("dblclick", Q, (e) => e.stopPropagation()), u("pointerdown", Q, (e) => e.stopPropagation()), u("mousedown", Q, (e) => e.stopPropagation()), u("click", $, () => t(I) ? Y() : q()), u("keydown", $, De), r(n, Q), g();
|
|
249
249
|
}
|
|
250
250
|
n([
|
|
251
251
|
"focusout",
|
|
@@ -256,4 +256,4 @@ n([
|
|
|
256
256
|
"keydown"
|
|
257
257
|
]);
|
|
258
258
|
//#endregion
|
|
259
|
-
export {
|
|
259
|
+
export { Se as default };
|