@svgrid/grid 2.2.31 → 2.2.32
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 +1 -1
- package/dist/SvAvatar.svelte +1 -1
- package/dist/SvCheckBox.svelte +2 -1
- package/dist/SvCircularProgress.svelte +1 -1
- package/dist/SvGrid.controller.svelte.d.ts +20 -0
- package/dist/SvGrid.controller.svelte.js +358 -18
- package/dist/SvGrid.css +103 -3
- package/dist/SvGrid.svelte +162 -10
- package/dist/SvGrid.types.d.ts +81 -0
- package/dist/SvGridDropdown.svelte +38 -6
- package/dist/SvGridDropdown.svelte.d.ts +4 -0
- package/dist/SvGridSelect.svelte +12 -3
- package/dist/SvGridSelect.svelte.d.ts +6 -0
- package/dist/SvGroupCell.svelte +9 -2
- package/dist/SvMultiSelect.svelte +12 -3
- package/dist/SvMultiSelect.svelte.d.ts +6 -0
- package/dist/SvPasswordInput.svelte +1 -1
- package/dist/SvProgress.svelte +1 -1
- package/dist/SvRating.svelte +1 -1
- package/dist/SvResult.svelte +1 -1
- package/dist/SvRichText.svelte +31 -16
- package/dist/SvRichText.svelte.d.ts +9 -0
- package/dist/SvSwitchButton.svelte +2 -1
- package/dist/SvToaster.svelte +1 -1
- package/dist/SvTree.svelte +9 -2
- package/dist/SvTree.svelte.d.ts +5 -0
- package/dist/SvTreeSelect.svelte +6 -2
- package/dist/build-api.js +16 -0
- package/dist/cdn/{GridMenus-Ds3OpzZT.js → GridMenus-C6ixSGWW.js} +33 -33
- package/dist/cdn/{GridMenus-Da_p7SKS.js → GridMenus-Cyk3qpJ7.js} +33 -33
- package/dist/cdn/{SvDateTimePicker-B8GopjhC.js → SvDateTimePicker-CdqaP61H.js} +2 -1
- package/dist/cdn/{SvDateTimePicker-DB0aIEk8.js → SvDateTimePicker-ClqtVIj3.js} +2 -1
- package/dist/cdn/{SvGridDropdown-DjALc_4f.js → SvGridDropdown-D0VdjeR8.js} +129 -123
- package/dist/cdn/{SvGridDropdown-hpnHvOGt.js → SvGridDropdown-Dh-2ej8j.js} +92 -87
- package/dist/cdn/{src-BLJfdyL0.js → src-BgHjWF0Q.js} +4193 -3837
- package/dist/cdn/{src-DYDCiC0D.js → src-CgD-wiuS.js} +5956 -5602
- package/dist/cdn/svgrid.js +8 -8
- package/dist/cdn/svgrid.svelte-external.js +8 -8
- package/dist/cell-render.d.ts +1 -0
- package/dist/cell-render.js +115 -1
- package/dist/cell-values.js +5 -0
- package/dist/core.d.ts +80 -9
- package/dist/core.js +89 -0
- package/dist/editor-contract.d.ts +12 -5
- package/dist/editor-registry.d.ts +18 -7
- package/dist/editor-registry.js +10 -1
- package/dist/group-display.d.ts +39 -0
- package/dist/group-display.js +52 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.js +2 -2
- package/dist/keyboard-handlers.js +16 -0
- package/dist/recurrence.js +3 -2
- package/dist/svgrid-wrapper.types.d.ts +8 -2
- package/dist/themes/index.d.ts +10 -0
- package/dist/themes/index.js +26 -0
- package/package.json +1 -1
- package/src/SvAccordion.test.ts +5 -5
- package/src/SvAvatar.svelte +1 -1
- package/src/SvButtonGroup.test.ts +6 -6
- package/src/SvCheckBox.svelte +2 -1
- package/src/SvCircularProgress.svelte +1 -1
- package/src/SvFileUpload.test.ts +1 -1
- package/src/SvGrid.controller.svelte.ts +367 -17
- package/src/SvGrid.css +103 -3
- package/src/SvGrid.svelte +162 -10
- package/src/SvGrid.types.ts +81 -0
- package/src/SvGridDropdown.svelte +38 -6
- package/src/SvGridSelect.svelte +12 -3
- package/src/SvGroupCell.svelte +9 -2
- package/src/SvMultiSelect.svelte +12 -3
- package/src/SvPasswordInput.svelte +1 -1
- package/src/SvProgress.svelte +1 -1
- package/src/SvRating.svelte +1 -1
- package/src/SvResult.svelte +1 -1
- package/src/SvRichText.svelte +31 -16
- package/src/SvSwitchButton.svelte +2 -1
- package/src/SvToaster.svelte +1 -1
- package/src/SvTree.svelte +9 -2
- package/src/SvTreeSelect.svelte +6 -2
- package/src/build-api.ts +15 -0
- package/src/builtin-editors.test.ts +3 -1
- package/src/cell-render.test.ts +27 -3
- package/src/cell-render.ts +122 -1
- package/src/cell-values.ts +4 -0
- package/src/chart-export.test.ts +2 -2
- package/src/clipboard.test.ts +0 -2
- package/src/core.ts +157 -8
- package/src/editing.test.ts +1 -1
- package/src/editor-contract.ts +12 -5
- package/src/editor-registry.grid.test.ts +48 -0
- package/src/editor-registry.test.ts +3 -1
- package/src/editor-registry.ts +23 -7
- package/src/facet-buckets.test.ts +33 -33
- package/src/group-display.test.ts +91 -1
- package/src/group-display.ts +83 -0
- package/src/index.ts +9 -0
- package/src/keyboard-handlers.ts +17 -0
- package/src/list-power.test.ts +2 -2
- package/src/menus.test.ts +4 -4
- package/src/named-views.coverage.test.ts +3 -3
- package/src/recurrence.ts +3 -2
- package/src/row-resize.test.ts +40 -40
- package/src/scheduler-model.ts +1 -1
- package/src/server-data-source.coverage.test.ts +1 -1
- package/src/server-group-model.test.ts +6 -6
- package/src/spreadsheet.test.ts +0 -1
- package/src/svgrid-wrapper.types.ts +11 -9
- package/src/svgrid.async-editor-options.test.ts +271 -0
- package/src/svgrid.auto-row-height.test.ts +204 -0
- package/src/svgrid.charting.test.ts +4 -4
- package/src/svgrid.comments-autocomplete.test.ts +8 -2
- package/src/svgrid.context-menu.test.ts +25 -9
- package/src/svgrid.filter-depth.test.ts +163 -0
- package/src/svgrid.filter-menu-listbox.svelte.test.ts +16 -2
- package/src/svgrid.filter-menu-scroll.test.ts +10 -2
- package/src/svgrid.grand-total.test.ts +188 -0
- package/src/svgrid.group-display-mode.test.ts +171 -0
- package/src/svgrid.group-footers.test.ts +121 -0
- package/src/svgrid.group-pagination.test.ts +153 -0
- package/src/svgrid.tree-data.test.ts +186 -0
- package/src/svgriddropdown.async-panel.svelte.test.ts +195 -0
- package/src/themes/index.ts +42 -0
- package/src/tree-edit.test.ts +4 -4
- package/src/tree-row-model.test.ts +169 -0
- package/src/ui-localization.test.ts +113 -0
- package/themes/ag-alpine.css +22 -0
- package/themes/antd.css +22 -0
- package/themes/atlassian.css +22 -0
- package/themes/bootstrap.css +22 -0
- package/themes/carbon.css +22 -0
- package/themes/catppuccin.css +22 -0
- package/themes/dracula.css +22 -0
- package/themes/ember.css +22 -0
- package/themes/excel.css +22 -0
- package/themes/fluent.css +22 -0
- package/themes/github.css +22 -0
- package/themes/linear.css +22 -0
- package/themes/material.css +22 -0
- package/themes/nord.css +22 -0
- package/themes/notion.css +22 -0
- package/themes/salesforce.css +22 -0
- package/themes/sap.css +22 -0
- package/themes/shadcn.css +22 -0
- package/themes/tailwind.css +22 -0
- package/themes/vercel.css +22 -0
|
@@ -2,18 +2,18 @@ import { t as e } from "./rolldown-runtime-Dy4uBu1J.js";
|
|
|
2
2
|
import { E as t, F as n, G as r, H as i, I as a, L as o, N as s, U as c, V as l, X as u, Y as d, _ as f, at as p, b as m, d as h, et as g, ft as _, i as v, it as y, k as b, lt as x, nt as S, o as ee, pt as C, rt as w, st as T, t as E, tt as te, u as ne, ut as D, v as O, x as re, z as ie } from "./disclose-version-DoD9AFD_.js";
|
|
3
3
|
import { i as ae, n as k, r as oe } from "./popover-P-9P2YYn.js";
|
|
4
4
|
//#region src/SvGridDropdown.svelte
|
|
5
|
-
var A = /* @__PURE__ */ e({ default: () =>
|
|
5
|
+
var A = /* @__PURE__ */ e({ default: () => j }), se = o("<span class=\"sv-grid-chip sv-grid-chip-removable svelte-ei8hp3\"> <span class=\"sv-grid-chip-remove svelte-ei8hp3\" role=\"button\">×</span></span>"), ce = o("<span class=\"sv-grid-dropdown-chips svelte-ei8hp3\"></span>"), le = o("<span class=\"sv-grid-chip svelte-ei8hp3\"> </span>"), ue = o("<span class=\"sv-grid-dropdown-label svelte-ei8hp3\"> </span>"), de = o("<input type=\"search\" class=\"sv-grid-dropdown-search\" placeholder=\"Search…\"/>"), fe = o("<div class=\"sv-grid-dropdown-empty\" role=\"status\" aria-live=\"polite\">Loading…</div>"), pe = o("<div class=\"sv-grid-dropdown-empty\"> </div>"), me = o("<span class=\"sv-grid-dropdown-check\" aria-hidden=\"true\"> </span>"), he = o("<span class=\"sv-grid-dropdown-option-chip\"> </span>"), ge = o("<span class=\"sv-grid-dropdown-option-label\"> </span>"), _e = o("<div role=\"option\"><!> <!></div>"), ve = o("<div class=\"sv-grid-dropdown-footer\"><button type=\"button\" class=\"sv-grid-dropdown-done\">Done</button></div>"), ye = o("<div role=\"listbox\"><!> <!> <!></div>"), be = o("<div><button type=\"button\" aria-haspopup=\"listbox\"><!> <span class=\"sv-grid-dropdown-caret svelte-ei8hp3\" aria-hidden=\"true\">▾</span></button> <!></div>"), xe = {
|
|
6
6
|
hash: "svelte-ei8hp3",
|
|
7
7
|
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-ei8hp3 {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-ei8hp3 {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-ei8hp3:focus {outline:2px solid var(--sg-accent, #2563eb);outline-offset:-2px;}.sv-grid-dropdown-trigger-chips.svelte-ei8hp3 {align-items:center;padding:4px 8px;flex-wrap:wrap;}.sv-grid-dropdown-chips.svelte-ei8hp3 {display:inline-flex;flex-wrap:wrap;gap:4px;flex:1 1 auto;min-width:0;align-items:center;}.sv-grid-dropdown-label.svelte-ei8hp3 {flex:1 1 auto;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}.sv-grid-dropdown-caret.svelte-ei8hp3 {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-ei8hp3 {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-ei8hp3 {padding-inline-end:2px;}.sv-grid-chip-remove.svelte-ei8hp3 {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-ei8hp3:hover {background:rgba(220, 38, 38, 0.7);color:#fff;}"
|
|
8
8
|
};
|
|
9
|
-
function
|
|
9
|
+
function j(e, o) {
|
|
10
10
|
let l = ie();
|
|
11
|
-
D(o, !0), re(e,
|
|
12
|
-
let A = E(o, "multiple", 3, !1),
|
|
13
|
-
function
|
|
11
|
+
D(o, !0), re(e, xe);
|
|
12
|
+
let A = E(o, "multiple", 3, !1), j = E(o, "placeholder", 3, "Select…"), M = E(o, "renderChipsInTrigger", 3, !1), N = E(o, "searchable", 3, !1), Se = E(o, "autoOpen", 3, !0), Ce = E(o, "loading", 3, !1);
|
|
13
|
+
function we(e) {
|
|
14
14
|
return e >= 0 && e < r(I).length ? `${l}-opt-${e}` : void 0;
|
|
15
15
|
}
|
|
16
|
-
let
|
|
16
|
+
let P = T(() => o.options.some((e) => e.color) ? 40 : 32), F = p(""), I = T(() => !N() || !r(F).trim() ? o.options : (() => {
|
|
17
17
|
let e = r(F).trim().toLowerCase();
|
|
18
18
|
return o.options.filter((t) => t.label.toLowerCase().includes(e));
|
|
19
19
|
})()), L = p(!1), R = p(-1), z = p(null), B = p(null), V = p(null), H = p(w({
|
|
@@ -23,183 +23,187 @@ function M(e, o) {
|
|
|
23
23
|
openUpward: !1,
|
|
24
24
|
maxHeight: 0,
|
|
25
25
|
availHeight: 0
|
|
26
|
-
})), U = T(() => Array.isArray(o.value) ? o.value : o.value == null || o.value === "" ? [] : [o.value]),
|
|
27
|
-
if (r(U).length === 0) return
|
|
26
|
+
})), U = T(() => Array.isArray(o.value) ? o.value : o.value == null || o.value === "" ? [] : [o.value]), Te = T(() => {
|
|
27
|
+
if (r(U).length === 0) return j();
|
|
28
28
|
if (!A()) {
|
|
29
29
|
let e = r(U)[0], t = o.options.find((t) => String(t.value) === String(e));
|
|
30
30
|
return t ? t.label : String(e);
|
|
31
31
|
}
|
|
32
32
|
return `${r(U).length} selected`;
|
|
33
|
-
}),
|
|
33
|
+
}), Ee = T(() => {
|
|
34
34
|
if (A() || r(U).length !== 1) return;
|
|
35
35
|
let e = r(U)[0];
|
|
36
36
|
return o.options.find((t) => String(t.value) === String(e))?.color;
|
|
37
37
|
});
|
|
38
|
-
function
|
|
38
|
+
function W(e) {
|
|
39
39
|
return r(U).some((t) => String(t) === String(e.value));
|
|
40
40
|
}
|
|
41
|
-
function
|
|
41
|
+
function G(e) {
|
|
42
42
|
if (A()) {
|
|
43
|
-
let t =
|
|
43
|
+
let t = W(e) ? r(U).filter((t) => String(t) !== String(e.value)) : [...r(U), e.value];
|
|
44
44
|
o.onChange?.(t);
|
|
45
45
|
} else o.onChange?.(e.value), y(L, !1), o.onCommit?.();
|
|
46
46
|
}
|
|
47
|
-
function
|
|
47
|
+
function K() {
|
|
48
48
|
if (!r(L)) {
|
|
49
49
|
if (y(L, !0), r(R) < 0) {
|
|
50
|
-
let e = o.options.findIndex((e) =>
|
|
50
|
+
let e = o.options.findIndex((e) => W(e));
|
|
51
51
|
y(R, e >= 0 ? e : 0, !0);
|
|
52
52
|
}
|
|
53
|
-
|
|
53
|
+
q();
|
|
54
54
|
}
|
|
55
55
|
}
|
|
56
|
-
function
|
|
56
|
+
function q() {
|
|
57
57
|
if (!r(B)) return;
|
|
58
|
-
let e = Math.min(
|
|
58
|
+
let e = Math.min(r(I).length, 10), t = N() ? 38 : 0, n = e * r(P) + (A() ? 40 : 0) + t + 8;
|
|
59
59
|
y(H, k(r(B).getBoundingClientRect(), {
|
|
60
|
-
estimatedHeight:
|
|
60
|
+
estimatedHeight: n,
|
|
61
61
|
clampHorizontal: !1
|
|
62
62
|
}), !0);
|
|
63
63
|
}
|
|
64
64
|
u(() => {
|
|
65
65
|
if (!r(L)) return;
|
|
66
|
-
let e = () =>
|
|
66
|
+
let e = () => q();
|
|
67
67
|
return window.addEventListener("scroll", e, !0), window.addEventListener("resize", e), () => {
|
|
68
68
|
window.removeEventListener("scroll", e, !0), window.removeEventListener("resize", e);
|
|
69
69
|
};
|
|
70
|
+
}), u(() => {
|
|
71
|
+
r(L) && (r(I).length, r(P), q());
|
|
70
72
|
});
|
|
71
|
-
function
|
|
73
|
+
function J() {
|
|
72
74
|
y(L, !1), y(R, -1);
|
|
73
75
|
}
|
|
74
|
-
function
|
|
76
|
+
function De(e) {
|
|
75
77
|
if (e.stopPropagation(), e.key === "Escape") {
|
|
76
|
-
e.preventDefault(),
|
|
78
|
+
e.preventDefault(), J(), o.onCancel?.();
|
|
77
79
|
return;
|
|
78
80
|
}
|
|
79
81
|
if (e.key === "ArrowDown") {
|
|
80
82
|
if (e.preventDefault(), !r(L)) {
|
|
81
|
-
|
|
83
|
+
K();
|
|
82
84
|
return;
|
|
83
85
|
}
|
|
84
|
-
y(R, Math.min(r(R) + 1, o.options.length - 1), !0),
|
|
86
|
+
y(R, Math.min(r(R) + 1, o.options.length - 1), !0), Y();
|
|
85
87
|
} else if (e.key === "ArrowUp") {
|
|
86
88
|
if (e.preventDefault(), !r(L)) {
|
|
87
|
-
|
|
89
|
+
K();
|
|
88
90
|
return;
|
|
89
91
|
}
|
|
90
|
-
y(R, Math.max(r(R) - 1, 0), !0),
|
|
92
|
+
y(R, Math.max(r(R) - 1, 0), !0), Y();
|
|
91
93
|
} else if (e.key === "Home") {
|
|
92
94
|
if (!r(L)) return;
|
|
93
|
-
e.preventDefault(), y(R, 0),
|
|
95
|
+
e.preventDefault(), y(R, 0), Y();
|
|
94
96
|
} else if (e.key === "End") {
|
|
95
97
|
if (!r(L)) return;
|
|
96
|
-
e.preventDefault(), y(R, o.options.length - 1),
|
|
98
|
+
e.preventDefault(), y(R, o.options.length - 1), Y();
|
|
97
99
|
} else if (e.key === "Enter") {
|
|
98
100
|
if (e.preventDefault(), !r(L)) {
|
|
99
|
-
|
|
101
|
+
K();
|
|
100
102
|
return;
|
|
101
103
|
}
|
|
102
104
|
let t = o.options[r(R)];
|
|
103
|
-
t ?
|
|
105
|
+
t ? G(t) : A() && (J(), o.onCommit?.());
|
|
104
106
|
} else if (e.key === " " && r(L)) {
|
|
105
107
|
e.preventDefault();
|
|
106
108
|
let t = o.options[r(R)];
|
|
107
|
-
t &&
|
|
108
|
-
} else e.key === "Tab" && (r(L) &&
|
|
109
|
+
t && G(t);
|
|
110
|
+
} else e.key === "Tab" && (r(L) && J(), o.onCommit?.());
|
|
109
111
|
}
|
|
110
|
-
function
|
|
112
|
+
function Y() {
|
|
111
113
|
queueMicrotask(() => {
|
|
112
114
|
r(V) && r(V).querySelector(`[data-opt-idx="${r(R)}"]`)?.scrollIntoView({ block: "nearest" });
|
|
113
115
|
});
|
|
114
116
|
}
|
|
115
|
-
function
|
|
117
|
+
function Oe(e) {
|
|
116
118
|
let t = e.relatedTarget;
|
|
117
|
-
t && r(z)?.contains(t) || (r(L) &&
|
|
119
|
+
t && r(z)?.contains(t) || (r(L) && J(), o.onCommit?.());
|
|
118
120
|
}
|
|
119
|
-
function
|
|
121
|
+
function ke(e, t) {
|
|
120
122
|
t.preventDefault(), t.stopPropagation();
|
|
121
123
|
let n = r(U).filter((t) => String(t) !== String(e));
|
|
122
124
|
o.onChange?.(A() ? n : n[0] ?? null);
|
|
123
125
|
}
|
|
124
|
-
function
|
|
125
|
-
|
|
126
|
+
function Ae(e) {
|
|
127
|
+
Se() && (e.focus(), K());
|
|
126
128
|
}
|
|
127
129
|
u(() => {
|
|
128
130
|
if (!r(L)) return;
|
|
129
131
|
let e = (e) => {
|
|
130
132
|
let t = e.target;
|
|
131
|
-
t && (r(z)?.contains(t) || r(V)?.contains(t) || (
|
|
133
|
+
t && (r(z)?.contains(t) || r(V)?.contains(t) || (J(), o.onCommit?.()));
|
|
132
134
|
};
|
|
133
135
|
return document.addEventListener("pointerdown", e, !0), () => document.removeEventListener("pointerdown", e, !0);
|
|
134
136
|
});
|
|
135
|
-
function
|
|
137
|
+
function X(e) {
|
|
136
138
|
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
139
|
}
|
|
138
|
-
var
|
|
139
|
-
let
|
|
140
|
-
var $ = g(
|
|
141
|
-
let
|
|
142
|
-
var
|
|
143
|
-
var a =
|
|
140
|
+
var Z = be();
|
|
141
|
+
let Q;
|
|
142
|
+
var $ = g(Z);
|
|
143
|
+
let je;
|
|
144
|
+
var Me = g($), Ne = (e) => {
|
|
145
|
+
var a = ce();
|
|
144
146
|
t(a, 21, () => r(U), (e) => String(e), (e, t) => {
|
|
145
147
|
let a = T(() => o.options.find((e) => String(e.value) === String(r(t))));
|
|
146
|
-
var c =
|
|
148
|
+
var c = se(), l = g(c), u = S(l);
|
|
147
149
|
h(u, "tabindex", -1), C(c), d((e, t, n) => {
|
|
148
150
|
f(c, e), s(l, `${t ?? ""} `), h(u, "aria-label", `Remove ${n ?? ""}`);
|
|
149
151
|
}, [
|
|
150
|
-
() => r(a)?.color ?
|
|
152
|
+
() => r(a)?.color ? X(r(a).color) : "",
|
|
151
153
|
() => r(a) ? r(a).label : String(r(t)),
|
|
152
154
|
() => r(a) ? r(a).label : String(r(t))
|
|
153
|
-
]), i("mousedown", u, (e) => e.preventDefault()), i("click", u, (e) =>
|
|
155
|
+
]), i("mousedown", u, (e) => e.preventDefault()), i("click", u, (e) => ke(r(t), e)), n(e, c);
|
|
154
156
|
}), C(a), n(e, a);
|
|
155
|
-
},
|
|
156
|
-
var t = ce(), i = g(t, !0);
|
|
157
|
-
C(t), d((e) => {
|
|
158
|
-
f(t, e), s(i, r(W));
|
|
159
|
-
}, [() => Z(r(G))]), n(e, t);
|
|
160
|
-
}, Ne = (e) => {
|
|
157
|
+
}, Pe = (e) => {
|
|
161
158
|
var t = le(), i = g(t, !0);
|
|
162
|
-
C(t), d(() =>
|
|
159
|
+
C(t), d((e) => {
|
|
160
|
+
f(t, e), s(i, r(Te));
|
|
161
|
+
}, [() => X(r(Ee))]), n(e, t);
|
|
162
|
+
}, Fe = (e) => {
|
|
163
|
+
var t = ue(), i = g(t, !0);
|
|
164
|
+
C(t), d(() => s(i, r(Te))), n(e, t);
|
|
163
165
|
};
|
|
164
|
-
b(
|
|
165
|
-
|
|
166
|
-
}), _(2), C($), v($, (e) => y(B, e), () => r(B)), m($, (e) =>
|
|
167
|
-
var
|
|
168
|
-
let l = T(() => o.options.length > 10), u = T(() => Math.min(r(l) ? 10 * r(
|
|
169
|
-
var p =
|
|
166
|
+
b(Me, (e) => {
|
|
167
|
+
M() && r(U).length > 0 ? e(Ne) : !A() && r(U).length === 1 && r(Ee) ? e(Pe, 1) : e(Fe, -1);
|
|
168
|
+
}), _(2), C($), v($, (e) => y(B, e), () => r(B)), m($, (e) => Ae?.(e));
|
|
169
|
+
var Ie = S($, 2), Le = (e) => {
|
|
170
|
+
let l = T(() => o.options.length > 10), u = T(() => Math.min(r(l) ? 10 * r(P) + (A() ? 40 : 0) + 8 : Infinity, r(H).availHeight));
|
|
171
|
+
var p = ye();
|
|
170
172
|
let _, x;
|
|
171
173
|
var w = g(p), E = (e) => {
|
|
172
|
-
var t =
|
|
174
|
+
var t = de();
|
|
173
175
|
ne(t), i("mousedown", t, (e) => e.stopPropagation()), i("click", t, (e) => e.stopPropagation()), i("keydown", t, (e) => {
|
|
174
176
|
e.key === "Escape" && (e.preventDefault(), y(L, !1), o.onCancel?.());
|
|
175
177
|
}), ee(t, () => r(F), (e) => y(F, e)), n(e, t);
|
|
176
178
|
};
|
|
177
179
|
b(w, (e) => {
|
|
178
|
-
|
|
180
|
+
N() && e(E);
|
|
179
181
|
});
|
|
180
182
|
var D = S(w, 2), re = (e) => {
|
|
181
|
-
|
|
182
|
-
C(t), d(() => s(i, P() && r(F) ? `No matches for "${r(F)}"` : "No options")), n(e, t);
|
|
183
|
+
n(e, fe());
|
|
183
184
|
}, ie = (e) => {
|
|
185
|
+
var t = pe(), i = g(t, !0);
|
|
186
|
+
C(t), d(() => s(i, N() && r(F) ? `No matches for "${r(F)}"` : "No options")), n(e, t);
|
|
187
|
+
}, k = (e) => {
|
|
184
188
|
var o = a();
|
|
185
189
|
t(te(o), 19, () => r(I), (e) => String(e.value), (e, t, a) => {
|
|
186
|
-
let o = T(() =>
|
|
187
|
-
var l =
|
|
190
|
+
let o = T(() => W(r(t)));
|
|
191
|
+
var l = _e();
|
|
188
192
|
let u;
|
|
189
193
|
var p = g(l), m = (e) => {
|
|
190
|
-
var t =
|
|
194
|
+
var t = me(), i = g(t, !0);
|
|
191
195
|
C(t), d(() => s(i, r(o) ? "✓" : "")), n(e, t);
|
|
192
196
|
};
|
|
193
197
|
b(p, (e) => {
|
|
194
198
|
A() && e(m);
|
|
195
199
|
});
|
|
196
200
|
var _ = S(p, 2), v = (e) => {
|
|
197
|
-
var i =
|
|
201
|
+
var i = he(), a = g(i, !0);
|
|
198
202
|
C(i), d((e) => {
|
|
199
203
|
f(i, e), s(a, r(t).label);
|
|
200
|
-
}, [() =>
|
|
204
|
+
}, [() => X(r(t).color)]), n(e, i);
|
|
201
205
|
}, x = (e) => {
|
|
202
|
-
var i =
|
|
206
|
+
var i = ge(), a = g(i, !0);
|
|
203
207
|
C(i), d(() => s(a, r(t).label)), n(e, i);
|
|
204
208
|
};
|
|
205
209
|
b(_, (e) => {
|
|
@@ -209,26 +213,27 @@ function M(e, o) {
|
|
|
209
213
|
"sv-grid-dropdown-option-selected": r(o),
|
|
210
214
|
"sv-grid-dropdown-option-highlighted": r(a) === r(R)
|
|
211
215
|
}), h(l, "id", e), h(l, "aria-selected", r(o)), h(l, "data-opt-idx", r(a));
|
|
212
|
-
}, [() =>
|
|
213
|
-
e.preventDefault(),
|
|
216
|
+
}, [() => we(r(a))]), i("mousedown", l, (e) => {
|
|
217
|
+
e.preventDefault(), G(r(t));
|
|
214
218
|
}), c("mouseenter", l, () => y(R, r(a), !0)), n(e, l);
|
|
215
219
|
}), n(e, o);
|
|
216
220
|
};
|
|
217
221
|
b(D, (e) => {
|
|
218
|
-
r(I).length === 0 ? e(re) : e(ie, -1);
|
|
222
|
+
Ce() && r(I).length === 0 ? e(re) : r(I).length === 0 ? e(ie, 1) : e(k, -1);
|
|
219
223
|
});
|
|
220
|
-
var
|
|
221
|
-
var t =
|
|
224
|
+
var se = S(D, 2), ce = (e) => {
|
|
225
|
+
var t = ve(), r = g(t);
|
|
222
226
|
C(t), i("mousedown", r, (e) => e.preventDefault()), i("click", r, () => {
|
|
223
|
-
|
|
227
|
+
J(), o.onCommit?.();
|
|
224
228
|
}), n(e, t);
|
|
225
229
|
};
|
|
226
|
-
b(
|
|
227
|
-
A() && e(
|
|
230
|
+
b(se, (e) => {
|
|
231
|
+
A() && e(ce);
|
|
228
232
|
}), C(p), v(p, (e) => y(V, e), () => r(V)), m(p, (e) => ae?.(e)), m(p, (e, t) => oe?.(e, t), () => ({ up: r(H).openUpward })), d(() => {
|
|
229
233
|
_ = O(p, 1, "sv-grid-dropdown-panel", null, _, { "sv-grid-dropdown-panel-fits": !r(l) }), h(p, "aria-multiselectable", A()), x = f(p, "", x, {
|
|
230
234
|
position: "fixed",
|
|
231
|
-
top: `${r(H).top}px`,
|
|
235
|
+
top: r(H).openUpward ? null : `${r(H).top}px`,
|
|
236
|
+
bottom: r(H).openUpward ? `${r(H).bottom}px` : null,
|
|
232
237
|
left: `${r(H).left}px`,
|
|
233
238
|
width: `${r(H).width}px`,
|
|
234
239
|
"max-height": r(u) === null ? null : `${r(u)}px`,
|
|
@@ -236,11 +241,11 @@ function M(e, o) {
|
|
|
236
241
|
});
|
|
237
242
|
}), i("pointerdown", p, (e) => e.stopPropagation()), i("mousedown", p, (e) => e.stopPropagation()), i("click", p, (e) => e.stopPropagation()), n(e, p);
|
|
238
243
|
};
|
|
239
|
-
b(
|
|
240
|
-
r(L) && e(
|
|
241
|
-
}), C(
|
|
242
|
-
|
|
243
|
-
}, [() => r(L) ?
|
|
244
|
+
b(Ie, (e) => {
|
|
245
|
+
r(L) && e(Le);
|
|
246
|
+
}), C(Z), v(Z, (e) => y(z, e), () => r(z)), d((e) => {
|
|
247
|
+
Q = O(Z, 1, "sv-grid-dropdown svelte-ei8hp3", null, Q, { "sv-grid-dropdown-open": r(L) }), je = O($, 1, "sv-grid-dropdown-trigger svelte-ei8hp3", null, je, { "sv-grid-dropdown-trigger-chips": M() && r(U).length > 0 }), h($, "aria-expanded", r(L)), h($, "aria-activedescendant", e);
|
|
248
|
+
}, [() => r(L) ? we(r(R)) : void 0]), i("focusout", Z, Oe), i("click", Z, (e) => e.stopPropagation()), i("dblclick", Z, (e) => e.stopPropagation()), i("pointerdown", Z, (e) => e.stopPropagation()), i("mousedown", Z, (e) => e.stopPropagation()), i("click", $, () => r(L) ? J() : K()), i("keydown", $, De), n(e, Z), x();
|
|
244
249
|
}
|
|
245
250
|
l([
|
|
246
251
|
"focusout",
|
|
@@ -251,4 +256,4 @@ l([
|
|
|
251
256
|
"keydown"
|
|
252
257
|
]);
|
|
253
258
|
//#endregion
|
|
254
|
-
export { A as n,
|
|
259
|
+
export { A as n, j as t };
|