@toolbox-web/grid 1.1.2 → 1.3.0
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 +80 -22
- package/all.d.ts +1 -0
- package/all.d.ts.map +1 -1
- package/all.js +557 -365
- package/all.js.map +1 -1
- package/index.d.ts +1 -1
- package/index.d.ts.map +1 -1
- package/index.js +903 -769
- package/index.js.map +1 -1
- package/lib/core/grid.d.ts +102 -3
- package/lib/core/grid.d.ts.map +1 -1
- package/lib/core/internal/row-animation.d.ts +37 -0
- package/lib/core/internal/row-animation.d.ts.map +1 -0
- package/lib/core/internal/rows.d.ts.map +1 -1
- package/lib/core/internal/shell.d.ts.map +1 -1
- package/lib/core/plugin/base-plugin.d.ts +65 -3
- package/lib/core/plugin/base-plugin.d.ts.map +1 -1
- package/lib/core/plugin/index.d.ts +1 -1
- package/lib/core/plugin/index.d.ts.map +1 -1
- package/lib/core/plugin/plugin-manager.d.ts +25 -1
- package/lib/core/plugin/plugin-manager.d.ts.map +1 -1
- package/lib/core/plugin/types.d.ts +62 -0
- package/lib/core/plugin/types.d.ts.map +1 -1
- package/lib/core/types.d.ts +64 -1
- package/lib/core/types.d.ts.map +1 -1
- package/lib/plugins/clipboard/index.js +73 -69
- package/lib/plugins/clipboard/index.js.map +1 -1
- package/lib/plugins/clipboard/types.d.ts +1 -0
- package/lib/plugins/clipboard/types.d.ts.map +1 -1
- package/lib/plugins/column-virtualization/index.js.map +1 -1
- package/lib/plugins/context-menu/index.js.map +1 -1
- package/lib/plugins/editing/EditingPlugin.d.ts.map +1 -1
- package/lib/plugins/editing/index.js +69 -40
- package/lib/plugins/editing/index.js.map +1 -1
- package/lib/plugins/export/index.js.map +1 -1
- package/lib/plugins/filtering/index.js.map +1 -1
- package/lib/plugins/grouping-columns/index.js.map +1 -1
- package/lib/plugins/grouping-rows/index.js.map +1 -1
- package/lib/plugins/master-detail/MasterDetailPlugin.d.ts.map +1 -1
- package/lib/plugins/master-detail/index.js +14 -12
- package/lib/plugins/master-detail/index.js.map +1 -1
- package/lib/plugins/multi-sort/index.js.map +1 -1
- package/lib/plugins/pinned-columns/index.js.map +1 -1
- package/lib/plugins/pinned-rows/index.js.map +1 -1
- package/lib/plugins/pivot/index.js.map +1 -1
- package/lib/plugins/reorder/index.js.map +1 -1
- package/lib/plugins/responsive/index.js.map +1 -1
- package/lib/plugins/row-reorder/RowReorderPlugin.d.ts +155 -0
- package/lib/plugins/row-reorder/RowReorderPlugin.d.ts.map +1 -0
- package/lib/plugins/row-reorder/index.d.ts +9 -0
- package/lib/plugins/row-reorder/index.d.ts.map +1 -0
- package/lib/plugins/row-reorder/index.js +597 -0
- package/lib/plugins/row-reorder/index.js.map +1 -0
- package/lib/plugins/row-reorder/types.d.ts +80 -0
- package/lib/plugins/row-reorder/types.d.ts.map +1 -0
- package/lib/plugins/selection/SelectionPlugin.d.ts +13 -0
- package/lib/plugins/selection/SelectionPlugin.d.ts.map +1 -1
- package/lib/plugins/selection/index.d.ts +1 -1
- package/lib/plugins/selection/index.d.ts.map +1 -1
- package/lib/plugins/selection/index.js +95 -64
- package/lib/plugins/selection/index.js.map +1 -1
- package/lib/plugins/selection/types.d.ts +50 -6
- package/lib/plugins/selection/types.d.ts.map +1 -1
- package/lib/plugins/server-side/index.js.map +1 -1
- package/lib/plugins/tree/index.js.map +1 -1
- package/lib/plugins/undo-redo/index.js.map +1 -1
- package/lib/plugins/visibility/index.js.map +1 -1
- package/package.json +21 -4
- package/public.d.ts +15 -2
- package/public.d.ts.map +1 -1
- package/umd/grid.all.umd.js +23 -23
- package/umd/grid.all.umd.js.map +1 -1
- package/umd/grid.umd.js +15 -15
- package/umd/grid.umd.js.map +1 -1
- package/umd/plugins/clipboard.umd.js +5 -5
- package/umd/plugins/clipboard.umd.js.map +1 -1
- package/umd/plugins/editing.umd.js +1 -1
- package/umd/plugins/editing.umd.js.map +1 -1
- package/umd/plugins/master-detail.umd.js +1 -1
- package/umd/plugins/master-detail.umd.js.map +1 -1
- package/umd/plugins/row-reorder.umd.js +2 -0
- package/umd/plugins/row-reorder.umd.js.map +1 -0
- package/umd/plugins/selection.umd.js +2 -2
- package/umd/plugins/selection.umd.js.map +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EditingPlugin.d.ts","sourceRoot":"","sources":["../../../../../../libs/grid/src/lib/plugins/editing/EditingPlugin.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;
|
|
1
|
+
{"version":3,"file":"EditingPlugin.d.ts","sourceRoot":"","sources":["../../../../../../libs/grid/src/lib/plugins/editing/EditingPlugin.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAGH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AACpE,OAAO,EAAE,cAAc,EAAE,KAAK,cAAc,EAAE,KAAK,WAAW,EAAE,MAAM,+BAA+B,CAAC;AACtG,OAAO,KAAK,EACV,YAAY,EAIZ,kBAAkB,EACnB,MAAM,kBAAkB,CAAC;AAG1B,OAAO,KAAK,EAA4C,aAAa,EAAkC,MAAM,SAAS,CAAC;AAMvH;;GAEG;AACH,eAAO,MAAM,yBAAyB,8GACiE,CAAC;AAwDxG;;GAEG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,kBAAkB,GAAG,OAAO,CAElE;AAWD;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,kBAAkB,GAAG,IAAI,CAGjE;AA4DD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgFG;AACH,qBAAa,aAAa,CAAC,CAAC,GAAG,OAAO,CAAE,SAAQ,cAAc,CAAC,aAAa,CAAC;;IAC3E;;;OAGG;IACH,gBAAyB,QAAQ,EAAE,cAAc,CAmB/C;IAEF,gBAAgB;IAChB,QAAQ,CAAC,IAAI,aAAa;IAC1B,gBAAgB;IAChB,SAAkB,MAAM,SAAU;IAElC,gBAAgB;IAChB,cAAuB,aAAa,IAAI,OAAO,CAAC,aAAa,CAAC,CAI7D;IA0BD,gBAAgB;IACP,MAAM,CAAC,IAAI,EAAE,WAAW,GAAG,IAAI;IA2DxC,gBAAgB;IACP,MAAM,IAAI,IAAI;IAavB;;;;;OAKG;IACM,WAAW,CAAC,KAAK,EAAE,cAAc,GAAG,OAAO,GAAG,IAAI;IA2B3D;;;OAGG;IACM,SAAS,CAAC,KAAK,EAAE,aAAa,GAAG,OAAO,GAAG,IAAI;IA0GxD;;;;OAIG;IACM,cAAc,CAAC,OAAO,EAAE,YAAY,CAAC,CAAC,CAAC,EAAE,GAAG,YAAY,CAAC,CAAC,CAAC,EAAE;IAsCtE;;;;;OAKG;IACM,WAAW,IAAI,IAAI;IAgC5B;;;OAGG;IACM,cAAc,IAAI,IAAI;IAQ/B;;;OAGG;IACH,IAAI,WAAW,IAAI,CAAC,EAAE,CAOrB;IAED;;OAEG;IACH,IAAI,aAAa,IAAI,MAAM,EAAE,CAE5B;IAED;;OAEG;IACH,IAAI,aAAa,IAAI,MAAM,CAE1B;IAED;;OAEG;IACH,IAAI,aAAa,IAAI,MAAM,CAE1B;IAED;;OAEG;IACH,YAAY,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO;IAIvC;;OAEG;IACH,aAAa,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO;IAI1D;;;OAGG;IACH,YAAY,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO;IAYvC;;;OAGG;IACH,gBAAgB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO;IAIxC;;;;OAIG;IACH,gBAAgB,CAAC,MAAM,CAAC,EAAE,OAAO,GAAG,IAAI;IAexC;;;;;OAKG;IACH,aAAa,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI;IAepD;;;;;OAKG;IACH,aAAa,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI;IA2CrC;;;OAGG;IACH,mBAAmB,IAAI,IAAI;IAM3B;;OAEG;IACH,mBAAmB,IAAI,IAAI;CAqd5B"}
|
|
@@ -1,4 +1,33 @@
|
|
|
1
|
-
const
|
|
1
|
+
const R = "data-animating", k = {
|
|
2
|
+
change: "--tbw-row-change-duration",
|
|
3
|
+
insert: "--tbw-row-insert-duration",
|
|
4
|
+
remove: "--tbw-row-remove-duration"
|
|
5
|
+
}, A = {
|
|
6
|
+
change: 500,
|
|
7
|
+
insert: 300,
|
|
8
|
+
remove: 200
|
|
9
|
+
};
|
|
10
|
+
function P(s) {
|
|
11
|
+
const e = s.trim().toLowerCase();
|
|
12
|
+
return e.endsWith("ms") ? parseFloat(e) : e.endsWith("s") ? parseFloat(e) * 1e3 : parseFloat(e);
|
|
13
|
+
}
|
|
14
|
+
function T(s, e) {
|
|
15
|
+
const i = k[e], t = getComputedStyle(s).getPropertyValue(i);
|
|
16
|
+
if (t) {
|
|
17
|
+
const r = P(t);
|
|
18
|
+
if (!isNaN(r) && r > 0)
|
|
19
|
+
return r;
|
|
20
|
+
}
|
|
21
|
+
return A[e];
|
|
22
|
+
}
|
|
23
|
+
function I(s, e, i) {
|
|
24
|
+
s.removeAttribute(R), s.offsetWidth, s.setAttribute(R, e);
|
|
25
|
+
const t = T(s, e);
|
|
26
|
+
setTimeout(() => {
|
|
27
|
+
s.removeAttribute(R);
|
|
28
|
+
}, t);
|
|
29
|
+
}
|
|
30
|
+
const D = {
|
|
2
31
|
expand: "▶",
|
|
3
32
|
collapse: "▼",
|
|
4
33
|
sortAsc: "▲",
|
|
@@ -8,7 +37,7 @@ const L = {
|
|
|
8
37
|
dragHandle: "⋮⋮",
|
|
9
38
|
toolPanel: "☰"
|
|
10
39
|
};
|
|
11
|
-
class
|
|
40
|
+
class q {
|
|
12
41
|
/**
|
|
13
42
|
* Plugin dependencies - declare other plugins this one requires.
|
|
14
43
|
*
|
|
@@ -232,7 +261,7 @@ class k {
|
|
|
232
261
|
*/
|
|
233
262
|
get gridIcons() {
|
|
234
263
|
const e = this.grid?.gridConfig?.icons ?? {};
|
|
235
|
-
return { ...
|
|
264
|
+
return { ...D, ...e };
|
|
236
265
|
}
|
|
237
266
|
// #region Animation Helpers
|
|
238
267
|
/**
|
|
@@ -308,12 +337,12 @@ class k {
|
|
|
308
337
|
}
|
|
309
338
|
// #endregion
|
|
310
339
|
}
|
|
311
|
-
const
|
|
312
|
-
function
|
|
340
|
+
const O = "@layer tbw-plugins{tbw-grid{--tbw-editing-bg: var(--tbw-color-selection);--tbw-editing-row-bg: var(--tbw-editing-bg);--tbw-editing-border: var(--tbw-border-input, 1px solid var(--tbw-color-border-strong));--tbw-padding-editing-input: var(--tbw-cell-padding-input, 2px 6px);--tbw-font-size-editor: inherit;--tbw-editing-row-outline-color: var(--tbw-color-accent);--tbw-editing-row-outline-width: 1px}tbw-grid .data-grid-row:has(.editing){background:var(--tbw-editing-row-bg);outline:var(--tbw-editing-row-outline-width) solid var(--tbw-editing-row-outline-color);outline-offset:calc(-1 * var(--tbw-editing-row-outline-width))}tbw-grid .data-grid-row>.cell.editing{overflow:hidden;padding:0;display:flex;min-height:calc(var(--tbw-row-height) + 2px);align-items:center;justify-content:center}tbw-grid .data-grid-row>.cell.editing input:not([type=checkbox]),tbw-grid .data-grid-row>.cell.editing select,tbw-grid .data-grid-row>.cell.editing textarea{width:100%;height:100%;flex:1 1 auto;min-width:0;border:var(--tbw-editing-border);padding:var(--tbw-padding-editing-input);font-size:var(--tbw-font-size-editor)}tbw-grid .tbw-editor-host{display:contents}}";
|
|
341
|
+
function N(s) {
|
|
313
342
|
const e = s.options;
|
|
314
343
|
return e ? typeof e == "function" ? e() : e : [];
|
|
315
344
|
}
|
|
316
|
-
function
|
|
345
|
+
function H(s) {
|
|
317
346
|
return (e) => {
|
|
318
347
|
const i = s.editorParams, t = document.createElement("input");
|
|
319
348
|
t.type = "number", t.value = e.value != null ? String(e.value) : "", i?.min !== void 0 && (t.min = String(i.min)), i?.max !== void 0 && (t.max = String(i.max)), i?.step !== void 0 && (t.step = String(i.step)), i?.placeholder && (t.placeholder = i.placeholder);
|
|
@@ -323,13 +352,13 @@ function T(s) {
|
|
|
323
352
|
}), t;
|
|
324
353
|
};
|
|
325
354
|
}
|
|
326
|
-
function
|
|
355
|
+
function M() {
|
|
327
356
|
return (s) => {
|
|
328
357
|
const e = document.createElement("input");
|
|
329
358
|
return e.type = "checkbox", e.checked = !!s.value, e.addEventListener("change", () => s.commit(e.checked)), e;
|
|
330
359
|
};
|
|
331
360
|
}
|
|
332
|
-
function
|
|
361
|
+
function G(s) {
|
|
333
362
|
return (e) => {
|
|
334
363
|
const i = s.editorParams, t = document.createElement("input");
|
|
335
364
|
return t.type = "date", e.value instanceof Date && (t.valueAsDate = e.value), i?.min && (t.min = i.min), i?.max && (t.max = i.max), i?.placeholder && (t.placeholder = i.placeholder), t.addEventListener("change", () => e.commit(t.valueAsDate)), t.addEventListener("keydown", (r) => {
|
|
@@ -337,14 +366,14 @@ function q(s) {
|
|
|
337
366
|
}), t;
|
|
338
367
|
};
|
|
339
368
|
}
|
|
340
|
-
function
|
|
369
|
+
function x(s) {
|
|
341
370
|
return (e) => {
|
|
342
371
|
const i = s.editorParams, t = document.createElement("select");
|
|
343
372
|
if (s.multi && (t.multiple = !0), i?.includeEmpty) {
|
|
344
373
|
const o = document.createElement("option");
|
|
345
374
|
o.value = "", o.textContent = i.emptyLabel ?? "", t.appendChild(o);
|
|
346
375
|
}
|
|
347
|
-
|
|
376
|
+
N(s).forEach((o) => {
|
|
348
377
|
const a = document.createElement("option");
|
|
349
378
|
a.value = String(o.value), a.textContent = o.label, (s.multi && Array.isArray(e.value) && e.value.includes(o.value) || !s.multi && e.value === o.value) && (a.selected = !0), t.appendChild(a);
|
|
350
379
|
});
|
|
@@ -360,7 +389,7 @@ function D(s) {
|
|
|
360
389
|
}), t;
|
|
361
390
|
};
|
|
362
391
|
}
|
|
363
|
-
function
|
|
392
|
+
function $(s) {
|
|
364
393
|
return (e) => {
|
|
365
394
|
const i = s.editorParams, t = document.createElement("input");
|
|
366
395
|
return t.type = "text", t.value = e.value != null ? String(e.value) : "", i?.maxLength !== void 0 && (t.maxLength = i.maxLength), i?.pattern && (t.pattern = i.pattern), i?.placeholder && (t.placeholder = i.placeholder), t.addEventListener("blur", () => e.commit(t.value)), t.addEventListener("keydown", (r) => {
|
|
@@ -368,22 +397,22 @@ function O(s) {
|
|
|
368
397
|
}), t;
|
|
369
398
|
};
|
|
370
399
|
}
|
|
371
|
-
function
|
|
400
|
+
function F(s) {
|
|
372
401
|
switch (s.type) {
|
|
373
402
|
case "number":
|
|
374
|
-
return
|
|
403
|
+
return H(s);
|
|
375
404
|
case "boolean":
|
|
376
|
-
return
|
|
405
|
+
return M();
|
|
377
406
|
case "date":
|
|
378
|
-
return
|
|
407
|
+
return G(s);
|
|
379
408
|
case "select":
|
|
380
|
-
return
|
|
409
|
+
return x(s);
|
|
381
410
|
default:
|
|
382
|
-
return
|
|
411
|
+
return $(s);
|
|
383
412
|
}
|
|
384
413
|
}
|
|
385
|
-
const
|
|
386
|
-
function
|
|
414
|
+
const _ = 'input,select,textarea,[contenteditable="true"],[contenteditable=""],[tabindex]:not([tabindex="-1"])';
|
|
415
|
+
function B(s, e) {
|
|
387
416
|
if (e.editor) return e.editor;
|
|
388
417
|
if (e.__editorTemplate) return "template";
|
|
389
418
|
if (!e.type) return;
|
|
@@ -400,25 +429,25 @@ function H(s, e) {
|
|
|
400
429
|
function E(s) {
|
|
401
430
|
return !(typeof s != "string" || s === "__proto__" || s === "constructor" || s === "prototype");
|
|
402
431
|
}
|
|
403
|
-
function
|
|
432
|
+
function z(s) {
|
|
404
433
|
const e = (s.__editingCellCount ?? 0) + 1;
|
|
405
434
|
s.__editingCellCount = e, s.setAttribute("data-has-editing", "");
|
|
406
435
|
}
|
|
407
|
-
function
|
|
436
|
+
function U(s) {
|
|
408
437
|
s.__editingCellCount = 0, s.removeAttribute("data-has-editing");
|
|
409
438
|
}
|
|
410
439
|
function v(s, e) {
|
|
411
440
|
return s instanceof HTMLInputElement ? s.type === "checkbox" ? s.checked : s.type === "number" ? s.value === "" ? null : Number(s.value) : s.type === "date" ? s.valueAsDate : s.value : e?.type === "number" && s.value !== "" ? Number(s.value) : s.value;
|
|
412
441
|
}
|
|
413
|
-
function
|
|
442
|
+
function L(s) {
|
|
414
443
|
}
|
|
415
|
-
function
|
|
444
|
+
function j(s, e, i) {
|
|
416
445
|
const t = s.querySelector("input,textarea,select");
|
|
417
446
|
t && (t.addEventListener("blur", () => {
|
|
418
447
|
i(v(t, e));
|
|
419
448
|
}), t instanceof HTMLInputElement && t.type === "checkbox" ? t.addEventListener("change", () => i(t.checked)) : t instanceof HTMLSelectElement && t.addEventListener("change", () => i(v(t, e))));
|
|
420
449
|
}
|
|
421
|
-
class
|
|
450
|
+
class V extends q {
|
|
422
451
|
/**
|
|
423
452
|
* Plugin manifest - declares owned properties for configuration validation.
|
|
424
453
|
* @internal
|
|
@@ -446,7 +475,7 @@ class $ extends k {
|
|
|
446
475
|
/** @internal */
|
|
447
476
|
name = "editing";
|
|
448
477
|
/** @internal */
|
|
449
|
-
styles =
|
|
478
|
+
styles = O;
|
|
450
479
|
/** @internal */
|
|
451
480
|
get defaultConfig() {
|
|
452
481
|
return {
|
|
@@ -725,7 +754,7 @@ class $ extends k {
|
|
|
725
754
|
}), setTimeout(() => {
|
|
726
755
|
let a = n.querySelector(`.cell[data-col="${i._focusCol}"]`);
|
|
727
756
|
if (a?.classList.contains("editing") || (a = n.querySelector(".cell.editing")), a?.classList.contains("editing")) {
|
|
728
|
-
const l = a.querySelector(
|
|
757
|
+
const l = a.querySelector(_);
|
|
729
758
|
try {
|
|
730
759
|
l?.focus({ preventScroll: !0 });
|
|
731
760
|
} catch {
|
|
@@ -803,13 +832,13 @@ class $ extends k {
|
|
|
803
832
|
changed: l,
|
|
804
833
|
changedRows: this.changedRows,
|
|
805
834
|
changedRowIds: this.changedRowIds
|
|
806
|
-
});
|
|
835
|
+
}), l && this.isAnimationEnabled && t.animateRow?.(e, "change");
|
|
807
836
|
}
|
|
808
837
|
this.#r.delete(e), this.#e = -1, this.#s = -1, this.#a();
|
|
809
838
|
for (const l of this.#n)
|
|
810
839
|
l.startsWith(`${e}:`) && this.#n.delete(l);
|
|
811
840
|
o && (o.querySelectorAll(".cell.editing").forEach((l) => {
|
|
812
|
-
l.classList.remove("editing"),
|
|
841
|
+
l.classList.remove("editing"), U(l.parentElement);
|
|
813
842
|
}), this.requestRender()), this.#o = !0, o || (this.#u(t), this.#o = !1);
|
|
814
843
|
}
|
|
815
844
|
/**
|
|
@@ -827,7 +856,7 @@ class $ extends k {
|
|
|
827
856
|
l = this.grid.getRowId(r);
|
|
828
857
|
} catch {
|
|
829
858
|
}
|
|
830
|
-
const c = l ? !this.#t.has(l) : !0, f = l ? (h) => this.grid.updateRow(l, h, "cascade") :
|
|
859
|
+
const c = l ? !this.#t.has(l) : !0, f = l ? (h) => this.grid.updateRow(l, h, "cascade") : L;
|
|
831
860
|
if (this.emitCancelable("cell-commit", {
|
|
832
861
|
row: r,
|
|
833
862
|
rowId: l ?? "",
|
|
@@ -842,7 +871,7 @@ class $ extends k {
|
|
|
842
871
|
})) return;
|
|
843
872
|
r[n] = t, l && this.#t.add(l), this.#a();
|
|
844
873
|
const d = a.findRenderedRowElement?.(e);
|
|
845
|
-
d && d.classList.add("changed");
|
|
874
|
+
d && (d.classList.add("changed"), I(d, "change"));
|
|
846
875
|
}
|
|
847
876
|
/**
|
|
848
877
|
* Inject an editor into a cell.
|
|
@@ -854,10 +883,10 @@ class $ extends k {
|
|
|
854
883
|
a = this.grid.getRowId(e);
|
|
855
884
|
} catch {
|
|
856
885
|
}
|
|
857
|
-
const l = a ? (u) => this.grid.updateRow(a, u, "cascade") :
|
|
886
|
+
const l = a ? (u) => this.grid.updateRow(a, u, "cascade") : L, c = E(t.field) ? e[t.field] : void 0;
|
|
858
887
|
n.classList.add("editing"), this.#n.add(`${i}:${r}`);
|
|
859
888
|
const f = n.parentElement;
|
|
860
|
-
f &&
|
|
889
|
+
f && z(f);
|
|
861
890
|
let g = !1;
|
|
862
891
|
const d = (u) => {
|
|
863
892
|
g || this.#e === -1 || this.#l(i, t, u, e);
|
|
@@ -867,13 +896,13 @@ class $ extends k {
|
|
|
867
896
|
p.className = "tbw-editor-host", n.innerHTML = "", n.appendChild(p), p.addEventListener("keydown", (u) => {
|
|
868
897
|
u.key === "Enter" && (u.stopPropagation(), u.preventDefault(), g = !0, this.#i(i, !1)), u.key === "Escape" && (u.stopPropagation(), u.preventDefault(), h(), this.#i(i, !0));
|
|
869
898
|
});
|
|
870
|
-
const m = t, y = m.__editorTemplate, b =
|
|
899
|
+
const m = t, y = m.__editorTemplate, b = B(this.grid, m) ?? F(t), C = c;
|
|
871
900
|
if (b === "template" && y)
|
|
872
901
|
this.#h(p, m, e, c, d, h, o, i);
|
|
873
902
|
else if (typeof b == "string") {
|
|
874
903
|
const u = document.createElement(b);
|
|
875
904
|
u.value = C, u.addEventListener("change", () => d(u.value)), p.appendChild(u), o || queueMicrotask(() => {
|
|
876
|
-
p.querySelector(
|
|
905
|
+
p.querySelector(_)?.focus({ preventScroll: !0 });
|
|
877
906
|
});
|
|
878
907
|
} else if (typeof b == "function") {
|
|
879
908
|
const u = {
|
|
@@ -886,8 +915,8 @@ class $ extends k {
|
|
|
886
915
|
cancel: h,
|
|
887
916
|
updateRow: l
|
|
888
917
|
}, w = b(u);
|
|
889
|
-
typeof w == "string" ? (p.innerHTML = w,
|
|
890
|
-
p.querySelector(
|
|
918
|
+
typeof w == "string" ? (p.innerHTML = w, j(p, t, d)) : w instanceof Node && p.appendChild(w), o || queueMicrotask(() => {
|
|
919
|
+
p.querySelector(_)?.focus({ preventScroll: !0 });
|
|
891
920
|
});
|
|
892
921
|
} else if (b && typeof b == "object") {
|
|
893
922
|
const u = document.createElement("div");
|
|
@@ -905,8 +934,8 @@ class $ extends k {
|
|
|
905
934
|
if (b.mount)
|
|
906
935
|
try {
|
|
907
936
|
b.mount({ placeholder: u, context: w, spec: b });
|
|
908
|
-
} catch (
|
|
909
|
-
console.warn(`[tbw-grid] External editor mount error for column '${t.field}':`,
|
|
937
|
+
} catch (S) {
|
|
938
|
+
console.warn(`[tbw-grid] External editor mount error for column '${t.field}':`, S);
|
|
910
939
|
}
|
|
911
940
|
else
|
|
912
941
|
this.grid.dispatchEvent(
|
|
@@ -971,7 +1000,7 @@ class $ extends k {
|
|
|
971
1000
|
// #endregion
|
|
972
1001
|
}
|
|
973
1002
|
export {
|
|
974
|
-
|
|
975
|
-
|
|
1003
|
+
V as EditingPlugin,
|
|
1004
|
+
F as defaultEditorFor
|
|
976
1005
|
};
|
|
977
1006
|
//# sourceMappingURL=index.js.map
|