@svgrid/grid-wc 3.0.32 → 3.0.34

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