@svgrid/grid-wc 3.0.1 → 3.0.2
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 +20 -0
- package/dist/GridMenus-B1mC1aPp.js +1077 -0
- package/dist/SvChartMenu-CBMKm7Xb.js +413 -0
- package/dist/SvDateRangeInput-BrYTQEMM.js +197 -0
- package/dist/SvDateTimePicker-CnLlqNDQ.js +766 -0
- package/dist/SvField-Bmzp3ObZ.js +147 -0
- package/dist/SvGridCellEditor-B005dmV1.js +560 -0
- package/dist/SvGridChart-4TcL9Rj2.js +3702 -0
- package/dist/SvGridChartBuilder-C4OL4XYx.js +1165 -0
- package/dist/SvGridChartPanel-CfHA8Ioq.js +1743 -0
- package/dist/SvGridChartView-Ci-9_EJ0.js +45 -0
- package/dist/SvGridDropdown-BlA6iw9m.js +257 -0
- package/dist/angular/fesm2022/svgrid-grid-wc-angular.mjs +178 -7
- package/dist/angular/fesm2022/svgrid-grid-wc-angular.mjs.map +1 -1
- package/dist/angular/types/svgrid-grid-wc-angular.d.ts +77 -2
- package/dist/chart/SvChartMenu-C-sbGNk8.js +586 -0
- package/dist/chart/chart-export-BHGuh_kZ.js +127 -0
- package/dist/chart/chart-export-pdf-BjkkIEkE.js +104 -0
- package/dist/chart/chart-summary-B86RFA3M.js +137 -0
- package/dist/chart/chart-trend-DP6DSsBa.js +56 -0
- package/dist/chart/chart-validate-CD6ptiwg.js +180 -0
- package/dist/chart/client-BuB0wIgc.js +2757 -0
- package/dist/chart/sv-chart-element.d.ts +98 -0
- package/dist/chart/sv-chart-element.js +7282 -0
- package/dist/chart-DoqdUoGg.js +4398 -0
- package/dist/chart-export-pdf-BirUdchl.js +104 -0
- package/dist/chart-summary-BP9i-v8M.js +137 -0
- package/dist/chart-validate-CD6ptiwg.js +180 -0
- package/dist/{shadow/client-DjwUji8D.js → client-DEF0GRjE.js} +1 -1
- package/dist/{column-resize-DvCRUrN3.js → column-resize-DUPgynvc.js} +3 -3
- package/dist/date-format-DMTwV8NC.js +1128 -0
- package/dist/focus-trap-DvlOlOGM.js +65 -0
- package/dist/list-option-DrRyivWp.js +82 -0
- package/dist/react/chart.d.ts +99 -0
- package/dist/react/chart.js +49 -0
- package/dist/react/index.d.ts +28 -0
- package/dist/react/index.js +4 -1
- package/dist/{row-resize-D-8s3cqT.js → row-resize-Cf8qPLbi.js} +44 -36
- package/dist/shadow/GridMenus-B1mC1aPp.js +1077 -0
- package/dist/shadow/SvChartMenu-CBMKm7Xb.js +413 -0
- package/dist/shadow/SvDateRangeInput-BrYTQEMM.js +197 -0
- package/dist/shadow/SvDateTimePicker-CnLlqNDQ.js +766 -0
- package/dist/shadow/SvField-Bmzp3ObZ.js +147 -0
- package/dist/shadow/SvGridCellEditor-B005dmV1.js +560 -0
- package/dist/shadow/SvGridChart-4TcL9Rj2.js +3702 -0
- package/dist/shadow/SvGridChartBuilder-C4OL4XYx.js +1165 -0
- package/dist/shadow/SvGridChartPanel-CfHA8Ioq.js +1743 -0
- package/dist/shadow/SvGridChartView-Ci-9_EJ0.js +45 -0
- package/dist/shadow/SvGridDropdown-BlA6iw9m.js +257 -0
- package/dist/shadow/chart-DoqdUoGg.js +4398 -0
- package/dist/shadow/chart-export-pdf-BirUdchl.js +104 -0
- package/dist/shadow/chart-summary-BP9i-v8M.js +137 -0
- package/dist/shadow/chart-validate-CD6ptiwg.js +180 -0
- package/dist/{client-DjwUji8D.js → shadow/client-DEF0GRjE.js} +1 -1
- package/dist/shadow/{column-resize-DvCRUrN3.js → column-resize-DUPgynvc.js} +3 -3
- package/dist/shadow/date-format-DMTwV8NC.js +1128 -0
- package/dist/shadow/focus-trap-DvlOlOGM.js +65 -0
- package/dist/shadow/list-option-DrRyivWp.js +82 -0
- package/dist/shadow/{row-resize-D-8s3cqT.js → row-resize-Cf8qPLbi.js} +44 -36
- package/dist/shadow/sv-grid-shadow-element.d.ts +15 -0
- package/dist/shadow/sv-grid-shadow-element.js +4688 -3621
- package/dist/shadow/{svelte-virtualizer.svelte-DZ9UcyfT.js → svelte-virtualizer.svelte-CnGhFGDc.js} +37 -34
- package/dist/sv-grid-element.d.ts +15 -0
- package/dist/sv-grid-element.js +4646 -3609
- package/dist/{svelte-virtualizer.svelte-DZ9UcyfT.js → svelte-virtualizer.svelte-CnGhFGDc.js} +37 -34
- package/dist/vue/chart.d.ts +64 -0
- package/dist/vue/chart.js +41 -0
- package/dist/vue/index.d.ts +11 -2
- package/dist/vue/index.js +4 -1
- package/package.json +18 -5
- package/dist/GridMenus-YwTw9Upd.js +0 -1123
- package/dist/SvDateRangeInput-CrxeppBV.js +0 -196
- package/dist/SvDateTimePicker-xAO-Pb4S.js +0 -765
- package/dist/SvField-CE345DyF.js +0 -146
- package/dist/SvGridCellEditor-D7SyHtff.js +0 -550
- package/dist/SvGridChart-CMaVmlso.js +0 -1477
- package/dist/SvGridChartPanel-Pc_IW0eA.js +0 -833
- package/dist/SvGridChartView-DLhhzmFy.js +0 -52
- package/dist/SvGridDropdown-DUncHqM-.js +0 -256
- package/dist/chart-GRBAgN1M.js +0 -1658
- package/dist/date-format-D_oQ5Yw0.js +0 -1127
- package/dist/shadow/GridMenus-YwTw9Upd.js +0 -1123
- package/dist/shadow/SvDateRangeInput-CrxeppBV.js +0 -196
- package/dist/shadow/SvDateTimePicker-xAO-Pb4S.js +0 -765
- package/dist/shadow/SvField-CE345DyF.js +0 -146
- package/dist/shadow/SvGridCellEditor-D7SyHtff.js +0 -550
- package/dist/shadow/SvGridChart-CMaVmlso.js +0 -1477
- package/dist/shadow/SvGridChartPanel-Pc_IW0eA.js +0 -833
- package/dist/shadow/SvGridChartView-DLhhzmFy.js +0 -52
- package/dist/shadow/SvGridDropdown-DUncHqM-.js +0 -256
- package/dist/shadow/chart-GRBAgN1M.js +0 -1658
- package/dist/shadow/date-format-D_oQ5Yw0.js +0 -1127
|
@@ -0,0 +1,560 @@
|
|
|
1
|
+
import { A as e, C as t, D as n, E as r, F as i, G as a, H as o, I as s, J as c, L as l, O as u, Q as d, R as f, U as p, Y as m, Z as h, _ as g, at as _, b as v, d as y, et as b, f as x, g as S, h as C, i as ee, it as w, j as T, k as E, n as D, nt as te, p as ne, q as O, tt as k, w as A, x as j, y as M } from "./client-DEF0GRjE.js";
|
|
2
|
+
import { C as re, d as ie, h as ae, m as oe, o as se, p as ce, v as le, x as ue } from "./SvGrid.helpers-BdVDtjUm.js";
|
|
3
|
+
import { n as de, r as fe, t as pe } from "./editor-registry-DxGKqcvx.js";
|
|
4
|
+
//#region ../grid/dist/SvGridCellEditor.svelte
|
|
5
|
+
var N = T("<span class=\"sv-grid-chip sv-grid-chip-removable\"> <button type=\"button\" class=\"sv-grid-chip-remove\">×</button></span>"), P = T("<button type=\"button\" class=\"sv-grid-chip-commit\" aria-label=\"Commit chip selection\">Done</button>"), F = T("<div class=\"sv-grid-cell-editor sv-grid-cell-editor-chips\" role=\"group\"><div class=\"sv-grid-chips-row\"><!> <input class=\"sv-grid-chip-input\" type=\"text\"/> <!></div></div>"), I = T("<input type=\"checkbox\" class=\"sv-grid-fr-editor sv-grid-fr-checkbox\"/>"), L = T("<option> </option>"), R = T("<select class=\"sv-grid-cell-editor sv-grid-fr-editor\"></select>"), z = T("<input class=\"sv-grid-cell-editor sv-grid-fr-editor\"/>"), me = T("<button type=\"button\" class=\"sv-grid-checkbox\" role=\"checkbox\" aria-label=\"Edit checkbox value\"></button>"), he = T("<button type=\"button\" role=\"radio\">★</button>"), ge = T("<span class=\"sv-grid-rating-editor\" role=\"radiogroup\" aria-label=\"Rating\"><!> <button type=\"button\" aria-label=\"Clear rating\" class=\"sv-grid-rating-clear\">×</button></span>"), _e = T("<textarea class=\"sv-grid-cell-editor sv-grid-cell-editor-textarea\" rows=\"4\"></textarea>"), ve = T("<button type=\"button\" class=\"sv-grid-autocomplete-option\" role=\"option\"> </button>"), ye = T("<div class=\"sv-grid-autocomplete-list\" role=\"listbox\"></div>"), be = T("<div class=\"sv-grid-autocomplete\"><input class=\"sv-grid-cell-editor sv-grid-cell-editor-autocomplete\" type=\"text\"/> <!></div>"), xe = T("<input type=\"color\"/>"), Se = T("<textarea class=\"sv-grid-cell-editor sv-grid-cell-editor-text sv-grid-cell-editor-multiline\"></textarea>"), Ce = T("<input/>");
|
|
6
|
+
function B(i, T) {
|
|
7
|
+
te(T, !0);
|
|
8
|
+
let B = (n, i = _, a = _, d = _, p = _) => {
|
|
9
|
+
var h = e(), g = c(h), v = (n) => {
|
|
10
|
+
var o = e(), s = c(o), l = (n) => {
|
|
11
|
+
var r = e(), o = c(r);
|
|
12
|
+
{
|
|
13
|
+
let e = b(() => V().editingCell?.value);
|
|
14
|
+
t(o, () => f(U), (t, n) => {
|
|
15
|
+
n(t, {
|
|
16
|
+
get options() {
|
|
17
|
+
return i();
|
|
18
|
+
},
|
|
19
|
+
get loading() {
|
|
20
|
+
return p();
|
|
21
|
+
},
|
|
22
|
+
get value() {
|
|
23
|
+
return f(e);
|
|
24
|
+
},
|
|
25
|
+
get multiple() {
|
|
26
|
+
return a();
|
|
27
|
+
},
|
|
28
|
+
placeholder: "Pick…",
|
|
29
|
+
renderChipsInTrigger: !0,
|
|
30
|
+
onChange: (e) => {
|
|
31
|
+
V().editingCell = V().editingCell ? {
|
|
32
|
+
...V().editingCell,
|
|
33
|
+
value: e
|
|
34
|
+
} : V().editingCell;
|
|
35
|
+
},
|
|
36
|
+
onCommit: () => f(J)(),
|
|
37
|
+
onCancel: () => {
|
|
38
|
+
V().editingCell = null, V().gridRootEl?.focus({ preventScroll: !0 });
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
E(n, r);
|
|
44
|
+
};
|
|
45
|
+
r(s, (e) => {
|
|
46
|
+
f(U) && e(l);
|
|
47
|
+
}), E(n, o);
|
|
48
|
+
}, y = (e) => {
|
|
49
|
+
var t = F();
|
|
50
|
+
x(t, "tabindex", -1);
|
|
51
|
+
var n = O(t), i = O(n);
|
|
52
|
+
A(i, 19, d, (e, t) => String(e) + "_" + t, (e, t, n) => {
|
|
53
|
+
var r = N(), i = O(r), c = m(i);
|
|
54
|
+
w(r), o((e, t) => {
|
|
55
|
+
u(i, `${e ?? ""} `), x(c, "aria-label", `Remove ${t ?? ""}`);
|
|
56
|
+
}, [() => String(f(t)), () => String(f(t))]), s("mousedown", c, (e) => e.preventDefault()), s("click", c, () => {
|
|
57
|
+
let e = d().filter((e, t) => t !== f(n));
|
|
58
|
+
V().editingCell = V().editingCell ? {
|
|
59
|
+
...V().editingCell,
|
|
60
|
+
value: a() ? e : e[0] ?? null
|
|
61
|
+
} : V().editingCell;
|
|
62
|
+
}), E(e, r);
|
|
63
|
+
});
|
|
64
|
+
var c = m(i, 2);
|
|
65
|
+
j(c, (e) => f(Z)?.(e));
|
|
66
|
+
var p = m(c, 2), h = (e) => {
|
|
67
|
+
var t = P();
|
|
68
|
+
s("mousedown", t, (e) => e.preventDefault()), s("click", t, () => f(J)()), E(e, t);
|
|
69
|
+
};
|
|
70
|
+
r(p, (e) => {
|
|
71
|
+
a() && e(h);
|
|
72
|
+
}), w(n), w(t), o(() => x(c, "placeholder", a() ? "Type, Enter to add" : "Type a value")), s("keydown", c, (e) => {
|
|
73
|
+
if (e.key === "Enter" || a() && e.key === ",") {
|
|
74
|
+
e.preventDefault(), e.stopPropagation();
|
|
75
|
+
let t = e.currentTarget, n = t.value.trim();
|
|
76
|
+
if (n) {
|
|
77
|
+
let e = a() ? [...d(), n] : [n];
|
|
78
|
+
V().editingCell = V().editingCell ? {
|
|
79
|
+
...V().editingCell,
|
|
80
|
+
value: a() ? e : n
|
|
81
|
+
} : V().editingCell, t.value = "", a() || f(J)();
|
|
82
|
+
}
|
|
83
|
+
} else if (e.key === "Escape") f(X)(e);
|
|
84
|
+
else if (e.key === "Backspace" && e.currentTarget.value === "" && d().length > 0) {
|
|
85
|
+
e.preventDefault();
|
|
86
|
+
let t = d().slice(0, -1);
|
|
87
|
+
V().editingCell = V().editingCell ? {
|
|
88
|
+
...V().editingCell,
|
|
89
|
+
value: a() ? t : t[0] ?? null
|
|
90
|
+
} : V().editingCell;
|
|
91
|
+
}
|
|
92
|
+
}), l("blur", c, () => f(J)()), E(e, t);
|
|
93
|
+
};
|
|
94
|
+
r(g, (e) => {
|
|
95
|
+
i().length > 0 ? e(v) : e(y, -1);
|
|
96
|
+
}), E(n, h);
|
|
97
|
+
}, V = D(T, "ctrl", 7), H = D(T, "fullRow", 3, !1), U = d(null), W = d(null);
|
|
98
|
+
p(() => {
|
|
99
|
+
let e = V().editingCell?.editorType;
|
|
100
|
+
(e === "list" || e === "chips" || e === "select" || e === "rich-select") && !f(U) && import("./SvGridDropdown-BlA6iw9m.js").then((e) => h(U, e.default, !0)), (e === "date" || e === "datetime" || e === "time") && !f(W) && import("./SvDateTimePicker-CnLlqNDQ.js").then((e) => h(W, e.default, !0));
|
|
101
|
+
});
|
|
102
|
+
let we = b(() => V().grid), G = b(() => V().fullRowEdit), K = b(() => V().getColumnEditorOptions), q = b(() => V().areEditorOptionsLoading), J = b(() => V().saveEditingCell), Y = b(() => V().updateEditingCellValue), X = b(() => V().onEditorKeyDown), Z = b(() => V().focusOnMount), Te = b(() => V().toggleCheckboxWithKeyboard);
|
|
103
|
+
function Ee(e, t = !0) {
|
|
104
|
+
t && e.focus({ preventScroll: !0 });
|
|
105
|
+
}
|
|
106
|
+
function Q(e) {
|
|
107
|
+
e.key === "Enter" ? (e.preventDefault(), V().commitFullRowEdit(), V().gridRootEl?.focus({ preventScroll: !0 })) : e.key === "Escape" && (e.preventDefault(), V().cancelFullRowEdit(), V().gridRootEl?.focus({ preventScroll: !0 }));
|
|
108
|
+
}
|
|
109
|
+
function De(e) {
|
|
110
|
+
return typeof e == "object" && e && "value" in e ? String(e.value) : String(e);
|
|
111
|
+
}
|
|
112
|
+
function Oe(e) {
|
|
113
|
+
return typeof e == "object" && e && "label" in e ? String(e.label) : String(e);
|
|
114
|
+
}
|
|
115
|
+
function ke() {
|
|
116
|
+
let e = V().editingCell;
|
|
117
|
+
return {
|
|
118
|
+
value: e?.value,
|
|
119
|
+
rowId: e?.rowId ?? "",
|
|
120
|
+
columnId: e?.columnId ?? "",
|
|
121
|
+
onChange: (e) => f(Y)(e),
|
|
122
|
+
onCommit: (e) => {
|
|
123
|
+
e !== void 0 && f(Y)(e), f(J)();
|
|
124
|
+
},
|
|
125
|
+
onCancel: () => {
|
|
126
|
+
V().editingCell = null, V().gridRootEl?.focus({ preventScroll: !0 });
|
|
127
|
+
},
|
|
128
|
+
onCommitAndMove: (e, t) => {
|
|
129
|
+
e !== void 0 && f(Y)(e), V().commitAndMoveByTab(t === -1);
|
|
130
|
+
},
|
|
131
|
+
onRequestClose: () => {
|
|
132
|
+
V().editingCell = null, V().gridRootEl?.focus({ preventScroll: !0 });
|
|
133
|
+
},
|
|
134
|
+
inCell: !0
|
|
135
|
+
};
|
|
136
|
+
}
|
|
137
|
+
var $ = e(), Ae = c($), je = (t) => {
|
|
138
|
+
let n = b(() => T.column.columnDef.editorType ?? "text"), i = b(() => f(G)?.draft[T.column.id]);
|
|
139
|
+
var a = e(), l = c(a), d = (e) => {
|
|
140
|
+
var t = I();
|
|
141
|
+
y(t), o((e) => ne(t, e), [() => !!f(i)]), s("change", t, (e) => V().setFullRowDraft(T.column.id, e.currentTarget.checked)), s("keydown", t, Q), s("pointerdown", t, (e) => e.stopPropagation()), s("click", t, (e) => e.stopPropagation()), E(e, t);
|
|
142
|
+
}, p = (e) => {
|
|
143
|
+
let t = b(() => f(K)(T.column, T.row));
|
|
144
|
+
var n = R();
|
|
145
|
+
A(n, 21, () => f(t), (e) => De(e), (e, t) => {
|
|
146
|
+
var n = L(), r = O(n, !0);
|
|
147
|
+
w(n);
|
|
148
|
+
var i = {};
|
|
149
|
+
o((e, t) => {
|
|
150
|
+
u(r, e), i !== (i = t) && (n.value = (n.__value = t) ?? "");
|
|
151
|
+
}, [() => Oe(f(t)), () => De(f(t))]), E(e, n);
|
|
152
|
+
}), w(n);
|
|
153
|
+
var r;
|
|
154
|
+
S(n), o((e) => {
|
|
155
|
+
r !== (r = e) && (n.value = (n.__value = e) ?? "", g(n, e));
|
|
156
|
+
}, [() => String(f(i) ?? "")]), s("change", n, (e) => V().setFullRowDraft(T.column.id, e.currentTarget.value)), s("keydown", n, Q), s("pointerdown", n, (e) => e.stopPropagation()), s("click", n, (e) => e.stopPropagation()), E(e, n);
|
|
157
|
+
}, m = (e) => {
|
|
158
|
+
let t = b(() => f(n) === "number" ? "number" : f(n) === "date" ? "date" : f(n) === "datetime" ? "datetime-local" : f(n) === "time" ? "time" : f(n) === "password" ? "password" : "text");
|
|
159
|
+
var r = z();
|
|
160
|
+
y(r), o((e) => {
|
|
161
|
+
x(r, "type", f(t)), C(r, e);
|
|
162
|
+
}, [() => String(f(i) ?? "")]), s("input", r, (e) => V().setFullRowDraft(T.column.id, e.currentTarget.value)), s("keydown", r, Q), s("pointerdown", r, (e) => e.stopPropagation()), s("click", r, (e) => e.stopPropagation()), E(e, r);
|
|
163
|
+
};
|
|
164
|
+
r(l, (e) => {
|
|
165
|
+
f(n) === "checkbox" ? e(d) : f(n) === "list" || f(n) === "select" || f(n) === "rich-select" ? e(p, 1) : e(m, -1);
|
|
166
|
+
}), E(t, a);
|
|
167
|
+
}, Me = (i) => {
|
|
168
|
+
var d = e(), p = c(d), h = (t) => {
|
|
169
|
+
let r = b(() => T.column.columnDef.cellEditor);
|
|
170
|
+
var i = e(), a = c(i);
|
|
171
|
+
{
|
|
172
|
+
let e = b(() => ({
|
|
173
|
+
cell: T.row.getAllCells().find((e) => e.column.id === T.column.id),
|
|
174
|
+
row: T.row,
|
|
175
|
+
column: T.column,
|
|
176
|
+
table: f(we),
|
|
177
|
+
getValue: () => V().editingCell?.value,
|
|
178
|
+
value: V().editingCell?.value,
|
|
179
|
+
update: (e) => {
|
|
180
|
+
V().editingCell = V().editingCell ? {
|
|
181
|
+
...V().editingCell,
|
|
182
|
+
value: e
|
|
183
|
+
} : V().editingCell;
|
|
184
|
+
},
|
|
185
|
+
commit: (e) => {
|
|
186
|
+
e !== void 0 && (V().editingCell = V().editingCell ? {
|
|
187
|
+
...V().editingCell,
|
|
188
|
+
value: e
|
|
189
|
+
} : V().editingCell), f(J)();
|
|
190
|
+
},
|
|
191
|
+
cancel: () => {
|
|
192
|
+
V().editingCell = null, V().gridRootEl?.focus({ preventScroll: !0 });
|
|
193
|
+
}
|
|
194
|
+
}));
|
|
195
|
+
n(a, () => f(r), () => f(e));
|
|
196
|
+
}
|
|
197
|
+
E(t, i);
|
|
198
|
+
}, g = (e) => {
|
|
199
|
+
var t = me();
|
|
200
|
+
j(t, (e) => Ee?.(e)), o((e) => x(t, "aria-checked", e), [() => !!V().editingCell.value]), s("click", t, (e) => {
|
|
201
|
+
e.stopPropagation();
|
|
202
|
+
let t = !V().editingCell?.value;
|
|
203
|
+
V().editingCell = V().editingCell ? {
|
|
204
|
+
...V().editingCell,
|
|
205
|
+
value: t
|
|
206
|
+
} : V().editingCell, f(J)();
|
|
207
|
+
}), s("keydown", t, (e) => {
|
|
208
|
+
if (e.key === "Enter" || e.key === " ") {
|
|
209
|
+
f(Te)(e, () => {
|
|
210
|
+
e.stopPropagation();
|
|
211
|
+
let t = !V().editingCell?.value;
|
|
212
|
+
V().editingCell = V().editingCell ? {
|
|
213
|
+
...V().editingCell,
|
|
214
|
+
value: t
|
|
215
|
+
} : V().editingCell, f(J)();
|
|
216
|
+
});
|
|
217
|
+
return;
|
|
218
|
+
}
|
|
219
|
+
f(X)(e);
|
|
220
|
+
}), l("blur", t, () => f(J)()), E(e, t);
|
|
221
|
+
}, _ = (n) => {
|
|
222
|
+
let i = b(() => f(K)(T.column, T.row)), a = b(() => f(q)(T.column, T.row)), o = b(() => T.column.columnDef.editorMultiple === !0);
|
|
223
|
+
var s = e(), l = c(s), u = (n) => {
|
|
224
|
+
var r = e(), s = c(r);
|
|
225
|
+
{
|
|
226
|
+
let e = b(() => V().editingCell?.value);
|
|
227
|
+
t(s, () => f(U), (t, n) => {
|
|
228
|
+
n(t, {
|
|
229
|
+
get options() {
|
|
230
|
+
return f(i);
|
|
231
|
+
},
|
|
232
|
+
get loading() {
|
|
233
|
+
return f(a);
|
|
234
|
+
},
|
|
235
|
+
get value() {
|
|
236
|
+
return f(e);
|
|
237
|
+
},
|
|
238
|
+
get multiple() {
|
|
239
|
+
return f(o);
|
|
240
|
+
},
|
|
241
|
+
placeholder: "Select…",
|
|
242
|
+
onChange: (e) => {
|
|
243
|
+
V().editingCell = V().editingCell ? {
|
|
244
|
+
...V().editingCell,
|
|
245
|
+
value: e
|
|
246
|
+
} : V().editingCell;
|
|
247
|
+
},
|
|
248
|
+
onCommit: () => f(J)(),
|
|
249
|
+
onCancel: () => {
|
|
250
|
+
V().editingCell = null, V().gridRootEl?.focus({ preventScroll: !0 });
|
|
251
|
+
}
|
|
252
|
+
});
|
|
253
|
+
});
|
|
254
|
+
}
|
|
255
|
+
E(n, r);
|
|
256
|
+
};
|
|
257
|
+
r(l, (e) => {
|
|
258
|
+
f(U) && e(u);
|
|
259
|
+
}), E(n, s);
|
|
260
|
+
}, S = (e) => {
|
|
261
|
+
let t = b(() => f(K)(T.column, T.row)), n = b(() => f(q)(T.column, T.row)), r = b(() => T.column.columnDef.editorMultiple === !0), i = b(() => re(V().editingCell?.value));
|
|
262
|
+
B(e, () => f(t), () => f(r), () => f(i), () => f(n));
|
|
263
|
+
}, D = (e) => {
|
|
264
|
+
let t = b(() => Math.max(0, Math.min(5, Math.round(Number(V().editingCell?.value) || 0)))), n = b(() => Math.min(5, Math.max(1, f(t))));
|
|
265
|
+
var r = ge(), i = O(r);
|
|
266
|
+
A(i, 16, () => [
|
|
267
|
+
1,
|
|
268
|
+
2,
|
|
269
|
+
3,
|
|
270
|
+
4,
|
|
271
|
+
5
|
|
272
|
+
], (e) => e, (e, r) => {
|
|
273
|
+
var i = he();
|
|
274
|
+
j(i, (e, t) => Ee?.(e, t), () => r === f(n)), o(() => {
|
|
275
|
+
x(i, "aria-checked", f(t) >= r), x(i, "aria-label", `${r} ${r === 1 ? "star" : "stars"}`), M(i, 1, `sv-grid-rating-star ${f(t) >= r ? "sv-grid-rating-star-on" : ""}`);
|
|
276
|
+
}), s("mousedown", i, (e) => e.preventDefault()), s("click", i, (e) => {
|
|
277
|
+
e.stopPropagation(), V().editingCell = V().editingCell ? {
|
|
278
|
+
...V().editingCell,
|
|
279
|
+
value: r
|
|
280
|
+
} : V().editingCell, f(J)();
|
|
281
|
+
}), s("keydown", i, (e) => {
|
|
282
|
+
let n = e.key;
|
|
283
|
+
if (n !== "ArrowLeft" && n !== "ArrowRight" && n !== "Home" && n !== "End") {
|
|
284
|
+
f(X)(e);
|
|
285
|
+
return;
|
|
286
|
+
}
|
|
287
|
+
e.preventDefault(), e.stopPropagation();
|
|
288
|
+
let r = Math.min(5, Math.max(1, f(t))), i = n === "Home" ? 1 : n === "End" ? 5 : n === "ArrowLeft" ? Math.max(1, r - 1) : Math.min(5, r + 1);
|
|
289
|
+
V().editingCell = V().editingCell ? {
|
|
290
|
+
...V().editingCell,
|
|
291
|
+
value: i
|
|
292
|
+
} : V().editingCell, (e.currentTarget.parentElement?.querySelectorAll(".sv-grid-rating-star"))?.[i - 1]?.focus({ preventScroll: !0 });
|
|
293
|
+
}), E(e, i);
|
|
294
|
+
});
|
|
295
|
+
var a = m(i, 2);
|
|
296
|
+
w(r), s("mousedown", a, (e) => e.preventDefault()), s("click", a, (e) => {
|
|
297
|
+
e.stopPropagation(), V().editingCell = V().editingCell ? {
|
|
298
|
+
...V().editingCell,
|
|
299
|
+
value: 0
|
|
300
|
+
} : V().editingCell, f(J)();
|
|
301
|
+
}), E(e, r);
|
|
302
|
+
}, te = (n) => {
|
|
303
|
+
let i = b(() => f(K)(T.column, T.row)), a = b(() => f(q)(T.column, T.row));
|
|
304
|
+
var o = e(), s = c(o), l = (n) => {
|
|
305
|
+
var r = e(), o = c(r);
|
|
306
|
+
{
|
|
307
|
+
let e = b(() => V().editingCell?.value);
|
|
308
|
+
t(o, () => f(U), (t, n) => {
|
|
309
|
+
n(t, {
|
|
310
|
+
get options() {
|
|
311
|
+
return f(i);
|
|
312
|
+
},
|
|
313
|
+
get loading() {
|
|
314
|
+
return f(a);
|
|
315
|
+
},
|
|
316
|
+
get value() {
|
|
317
|
+
return f(e);
|
|
318
|
+
},
|
|
319
|
+
multiple: !1,
|
|
320
|
+
placeholder: "Select…",
|
|
321
|
+
onChange: (e) => {
|
|
322
|
+
V().editingCell = V().editingCell ? {
|
|
323
|
+
...V().editingCell,
|
|
324
|
+
value: e
|
|
325
|
+
} : V().editingCell;
|
|
326
|
+
},
|
|
327
|
+
onCommit: () => f(J)(),
|
|
328
|
+
onCancel: () => {
|
|
329
|
+
V().editingCell = null, V().gridRootEl?.focus({ preventScroll: !0 });
|
|
330
|
+
}
|
|
331
|
+
});
|
|
332
|
+
});
|
|
333
|
+
}
|
|
334
|
+
E(n, r);
|
|
335
|
+
};
|
|
336
|
+
r(s, (e) => {
|
|
337
|
+
f(U) && e(l);
|
|
338
|
+
}), E(n, o);
|
|
339
|
+
}, ne = (n) => {
|
|
340
|
+
let i = b(() => f(K)(T.column, T.row)), a = b(() => f(q)(T.column, T.row));
|
|
341
|
+
var o = e(), s = c(o), l = (n) => {
|
|
342
|
+
var r = e(), o = c(r);
|
|
343
|
+
{
|
|
344
|
+
let e = b(() => V().editingCell?.value);
|
|
345
|
+
t(o, () => f(U), (t, n) => {
|
|
346
|
+
n(t, {
|
|
347
|
+
get options() {
|
|
348
|
+
return f(i);
|
|
349
|
+
},
|
|
350
|
+
get loading() {
|
|
351
|
+
return f(a);
|
|
352
|
+
},
|
|
353
|
+
get value() {
|
|
354
|
+
return f(e);
|
|
355
|
+
},
|
|
356
|
+
multiple: !1,
|
|
357
|
+
searchable: !0,
|
|
358
|
+
placeholder: "Search…",
|
|
359
|
+
onChange: (e) => {
|
|
360
|
+
V().editingCell = V().editingCell ? {
|
|
361
|
+
...V().editingCell,
|
|
362
|
+
value: e
|
|
363
|
+
} : V().editingCell;
|
|
364
|
+
},
|
|
365
|
+
onCommit: () => f(J)(),
|
|
366
|
+
onCancel: () => {
|
|
367
|
+
V().editingCell = null, V().gridRootEl?.focus({ preventScroll: !0 });
|
|
368
|
+
}
|
|
369
|
+
});
|
|
370
|
+
});
|
|
371
|
+
}
|
|
372
|
+
E(n, r);
|
|
373
|
+
};
|
|
374
|
+
r(s, (e) => {
|
|
375
|
+
f(U) && e(l);
|
|
376
|
+
}), E(n, o);
|
|
377
|
+
}, k = (e) => {
|
|
378
|
+
var t = _e();
|
|
379
|
+
a(t), j(t, (e) => f(Z)?.(e)), o((e) => C(t, e), [() => String(V().editingCell?.value ?? "")]), s("pointerdown", t, (e) => e.stopPropagation()), s("input", t, (e) => f(Y)(e.currentTarget.value)), s("keydown", t, (e) => {
|
|
380
|
+
if (e.stopPropagation(), e.key === "Escape") {
|
|
381
|
+
e.preventDefault(), V().editingCell = null, V().gridRootEl?.focus({ preventScroll: !0 });
|
|
382
|
+
return;
|
|
383
|
+
}
|
|
384
|
+
if (e.key === "Tab") {
|
|
385
|
+
e.preventDefault(), V().commitAndMoveByTab(e.shiftKey);
|
|
386
|
+
return;
|
|
387
|
+
}
|
|
388
|
+
e.key === "Enter" && (e.ctrlKey || e.metaKey) && (e.preventDefault(), f(J)(), V().gridRootEl?.focus({ preventScroll: !0 }));
|
|
389
|
+
}), l("blur", t, () => f(J)()), E(e, t);
|
|
390
|
+
}, N = (e) => {
|
|
391
|
+
let t = b(() => f(K)(T.column, T.row)), n = b(() => String(V().editingCell?.value ?? "")), i = b(() => f(n).trim() ? f(t).filter((e) => String(e.label).toLowerCase().includes(f(n).toLowerCase())) : f(t));
|
|
392
|
+
var a = be(), c = O(a);
|
|
393
|
+
y(c), j(c, (e) => f(Z)?.(e));
|
|
394
|
+
var d = m(c, 2), p = (e) => {
|
|
395
|
+
var t = ye();
|
|
396
|
+
A(t, 21, () => f(i).slice(0, 50), (e) => e.value, (e, t) => {
|
|
397
|
+
var r = ve(), i = O(r, !0);
|
|
398
|
+
w(r), o((e) => {
|
|
399
|
+
x(r, "aria-selected", e), u(i, f(t).label);
|
|
400
|
+
}, [() => String(f(t).value) === f(n)]), s("mousedown", r, (e) => {
|
|
401
|
+
e.preventDefault(), V().editingCell = V().editingCell ? {
|
|
402
|
+
...V().editingCell,
|
|
403
|
+
value: f(t).value
|
|
404
|
+
} : V().editingCell, f(J)();
|
|
405
|
+
}), E(e, r);
|
|
406
|
+
}), w(t), E(e, t);
|
|
407
|
+
};
|
|
408
|
+
r(d, (e) => {
|
|
409
|
+
f(i).length > 0 && e(p);
|
|
410
|
+
}), w(a), o(() => C(c, f(n))), s("pointerdown", c, (e) => e.stopPropagation()), s("input", c, (e) => f(Y)(e.currentTarget.value)), l("blur", c, () => f(J)()), s("keydown", c, function(...e) {
|
|
411
|
+
f(X)?.apply(this, e);
|
|
412
|
+
}), E(e, a);
|
|
413
|
+
}, P = (n) => {
|
|
414
|
+
var i = e(), a = c(i), o = (n) => {
|
|
415
|
+
var r = e(), i = c(r);
|
|
416
|
+
{
|
|
417
|
+
let e = b(() => V().editingCell?.value);
|
|
418
|
+
t(i, () => f(W), (t, n) => {
|
|
419
|
+
n(t, {
|
|
420
|
+
get value() {
|
|
421
|
+
return f(e);
|
|
422
|
+
},
|
|
423
|
+
formatString: "yyyy-MM-dd",
|
|
424
|
+
dropDownDisplayMode: "calendar",
|
|
425
|
+
autoOpen: !0,
|
|
426
|
+
block: !0,
|
|
427
|
+
onChange: (e) => f(Y)(e),
|
|
428
|
+
onCommit: () => f(J)(),
|
|
429
|
+
onCancel: () => {
|
|
430
|
+
V().editingCell = null, V().gridRootEl?.focus({ preventScroll: !0 });
|
|
431
|
+
}
|
|
432
|
+
});
|
|
433
|
+
});
|
|
434
|
+
}
|
|
435
|
+
E(n, r);
|
|
436
|
+
};
|
|
437
|
+
r(a, (e) => {
|
|
438
|
+
f(W) && e(o);
|
|
439
|
+
}), E(n, i);
|
|
440
|
+
}, F = (n) => {
|
|
441
|
+
var i = e(), a = c(i), o = (n) => {
|
|
442
|
+
var r = e(), i = c(r);
|
|
443
|
+
{
|
|
444
|
+
let e = b(() => V().editingCell?.value);
|
|
445
|
+
t(i, () => f(W), (t, n) => {
|
|
446
|
+
n(t, {
|
|
447
|
+
get value() {
|
|
448
|
+
return f(e);
|
|
449
|
+
},
|
|
450
|
+
formatString: "yyyy-MM-dd HH:mm",
|
|
451
|
+
dropDownDisplayMode: "both",
|
|
452
|
+
autoOpen: !0,
|
|
453
|
+
block: !0,
|
|
454
|
+
onChange: (e) => f(Y)(e),
|
|
455
|
+
onCommit: () => f(J)(),
|
|
456
|
+
onCancel: () => {
|
|
457
|
+
V().editingCell = null, V().gridRootEl?.focus({ preventScroll: !0 });
|
|
458
|
+
}
|
|
459
|
+
});
|
|
460
|
+
});
|
|
461
|
+
}
|
|
462
|
+
E(n, r);
|
|
463
|
+
};
|
|
464
|
+
r(a, (e) => {
|
|
465
|
+
f(W) && e(o);
|
|
466
|
+
}), E(n, i);
|
|
467
|
+
}, I = (n) => {
|
|
468
|
+
var i = e(), a = c(i), o = (n) => {
|
|
469
|
+
var r = e(), i = c(r);
|
|
470
|
+
{
|
|
471
|
+
let e = b(() => ue(V().editingCell?.value));
|
|
472
|
+
t(i, () => f(W), (t, n) => {
|
|
473
|
+
n(t, {
|
|
474
|
+
get value() {
|
|
475
|
+
return f(e);
|
|
476
|
+
},
|
|
477
|
+
formatString: "HH:mm",
|
|
478
|
+
dropDownDisplayMode: "time",
|
|
479
|
+
autoOpen: !0,
|
|
480
|
+
block: !0,
|
|
481
|
+
onChange: (e) => f(Y)(se(e)),
|
|
482
|
+
onCommit: () => f(J)(),
|
|
483
|
+
onCancel: () => {
|
|
484
|
+
V().editingCell = null, V().gridRootEl?.focus({ preventScroll: !0 });
|
|
485
|
+
}
|
|
486
|
+
});
|
|
487
|
+
});
|
|
488
|
+
}
|
|
489
|
+
E(n, r);
|
|
490
|
+
};
|
|
491
|
+
r(a, (e) => {
|
|
492
|
+
f(W) && e(o);
|
|
493
|
+
}), E(n, i);
|
|
494
|
+
}, L = (e) => {
|
|
495
|
+
var t = xe();
|
|
496
|
+
y(t), j(t, (e) => f(Z)?.(e)), o((e, n) => {
|
|
497
|
+
M(t, 1, e), C(t, n);
|
|
498
|
+
}, [() => v(oe("color")), () => ce("color", V().editingCell?.value)]), s("input", t, (e) => f(Y)(e.currentTarget.value)), s("change", t, (e) => {
|
|
499
|
+
f(Y)(e.currentTarget.value), f(J)();
|
|
500
|
+
}), l("blur", t, () => f(J)()), s("keydown", t, function(...e) {
|
|
501
|
+
f(X)?.apply(this, e);
|
|
502
|
+
}), E(e, t);
|
|
503
|
+
}, R = (n) => {
|
|
504
|
+
let r = b(() => pe(String(V().editingCell?.editorType))), i = b(() => f(r).component);
|
|
505
|
+
var a = e(), o = c(a);
|
|
506
|
+
{
|
|
507
|
+
let e = b(() => fe(f(r), ke()));
|
|
508
|
+
t(o, () => f(i), (t, n) => {
|
|
509
|
+
n(t, ee(() => f(e)));
|
|
510
|
+
});
|
|
511
|
+
}
|
|
512
|
+
E(n, a);
|
|
513
|
+
}, z = b(() => de(String(V().editingCell?.editorType ?? ""))), H = (e) => {
|
|
514
|
+
var t = Se();
|
|
515
|
+
a(t), j(t, (e) => f(Z)?.(e)), o((e, n) => {
|
|
516
|
+
x(t, "rows", e), C(t, n);
|
|
517
|
+
}, [() => Math.max(1, String(V().editingCell?.value ?? "").split("\n").length), () => String(V().editingCell?.value ?? "")]), s("input", t, (e) => {
|
|
518
|
+
let t = e.currentTarget;
|
|
519
|
+
t.rows = Math.max(1, t.value.split("\n").length), f(Y)(t.value);
|
|
520
|
+
}), l("blur", t, () => f(J)()), s("keydown", t, function(...e) {
|
|
521
|
+
f(X)?.apply(this, e);
|
|
522
|
+
}), E(e, t);
|
|
523
|
+
}, G = (e) => {
|
|
524
|
+
let t = b(() => V().editingCell?.editorType ?? "text"), n = b(() => ie(f(t)) === "text" && ae(f(t)) === "number");
|
|
525
|
+
var r = Ce();
|
|
526
|
+
y(r), j(r, (e) => f(Z)?.(e)), o((e, t, i) => {
|
|
527
|
+
M(r, 1, e), x(r, "type", t), x(r, "inputmode", f(n) ? "decimal" : void 0), C(r, i);
|
|
528
|
+
}, [
|
|
529
|
+
() => v(oe(f(t))),
|
|
530
|
+
() => ie(f(t)),
|
|
531
|
+
() => ce(f(t), V().editingCell?.value)
|
|
532
|
+
]), s("input", r, (e) => {
|
|
533
|
+
let t = e.currentTarget;
|
|
534
|
+
if (f(n) && !le(t.value)) {
|
|
535
|
+
t.value = String(V().editingCell?.value ?? "");
|
|
536
|
+
return;
|
|
537
|
+
}
|
|
538
|
+
f(Y)(t.value);
|
|
539
|
+
}), l("blur", r, () => f(J)()), s("keydown", r, function(...e) {
|
|
540
|
+
f(X)?.apply(this, e);
|
|
541
|
+
}), E(e, r);
|
|
542
|
+
};
|
|
543
|
+
r(p, (e) => {
|
|
544
|
+
T.column.columnDef.cellEditor ? e(h) : V().editingCell?.editorType === "checkbox" ? e(g, 1) : V().editingCell?.editorType === "list" ? e(_, 2) : V().editingCell?.editorType === "chips" ? e(S, 3) : V().editingCell?.editorType === "rating" ? e(D, 4) : V().editingCell?.editorType === "select" ? e(te, 5) : V().editingCell?.editorType === "rich-select" ? e(ne, 6) : V().editingCell?.editorType === "textarea" ? e(k, 7) : V().editingCell?.editorType === "autocomplete" ? e(N, 8) : V().editingCell?.editorType === "date" ? e(P, 9) : V().editingCell?.editorType === "datetime" ? e(F, 10) : V().editingCell?.editorType === "time" ? e(I, 11) : V().editingCell?.editorType === "color" ? e(L, 12) : f(z) ? e(R, 13) : (V().editingCell?.editorType ?? "text") === "text" && T.column?.columnDef.editorMultiline ? e(H, 14) : e(G, -1);
|
|
545
|
+
}), E(i, d);
|
|
546
|
+
};
|
|
547
|
+
r(Ae, (e) => {
|
|
548
|
+
H() ? e(je) : e(Me, -1);
|
|
549
|
+
}), E(i, $), k();
|
|
550
|
+
}
|
|
551
|
+
i([
|
|
552
|
+
"mousedown",
|
|
553
|
+
"click",
|
|
554
|
+
"keydown",
|
|
555
|
+
"change",
|
|
556
|
+
"pointerdown",
|
|
557
|
+
"input"
|
|
558
|
+
]);
|
|
559
|
+
//#endregion
|
|
560
|
+
export { B as default };
|