@toolbox-web/grid 1.13.0 → 1.14.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.
Files changed (81) hide show
  1. package/all.js +1483 -1403
  2. package/all.js.map +1 -1
  3. package/index.js +11 -4
  4. package/index.js.map +1 -1
  5. package/lib/core/internal/row-animation.d.ts.map +1 -1
  6. package/lib/core/plugin/types.d.ts +1 -1
  7. package/lib/core/plugin/types.d.ts.map +1 -1
  8. package/lib/core/types.d.ts +44 -1
  9. package/lib/core/types.d.ts.map +1 -1
  10. package/lib/plugins/clipboard/ClipboardPlugin.d.ts +69 -8
  11. package/lib/plugins/clipboard/ClipboardPlugin.d.ts.map +1 -1
  12. package/lib/plugins/clipboard/index.d.ts +1 -1
  13. package/lib/plugins/clipboard/index.d.ts.map +1 -1
  14. package/lib/plugins/clipboard/index.js +257 -192
  15. package/lib/plugins/clipboard/index.js.map +1 -1
  16. package/lib/plugins/clipboard/types.d.ts +31 -0
  17. package/lib/plugins/clipboard/types.d.ts.map +1 -1
  18. package/lib/plugins/column-virtualization/index.js.map +1 -1
  19. package/lib/plugins/context-menu/ContextMenuPlugin.d.ts +8 -0
  20. package/lib/plugins/context-menu/ContextMenuPlugin.d.ts.map +1 -1
  21. package/lib/plugins/context-menu/index.js +75 -60
  22. package/lib/plugins/context-menu/index.js.map +1 -1
  23. package/lib/plugins/context-menu/types.d.ts +7 -0
  24. package/lib/plugins/context-menu/types.d.ts.map +1 -1
  25. package/lib/plugins/editing/EditingPlugin.d.ts.map +1 -1
  26. package/lib/plugins/editing/editors.d.ts +2 -2
  27. package/lib/plugins/editing/editors.d.ts.map +1 -1
  28. package/lib/plugins/editing/index.js +420 -381
  29. package/lib/plugins/editing/index.js.map +1 -1
  30. package/lib/plugins/editing/types.d.ts +6 -23
  31. package/lib/plugins/editing/types.d.ts.map +1 -1
  32. package/lib/plugins/export/ExportPlugin.d.ts.map +1 -1
  33. package/lib/plugins/export/index.js +75 -66
  34. package/lib/plugins/export/index.js.map +1 -1
  35. package/lib/plugins/filtering/index.d.ts +1 -1
  36. package/lib/plugins/filtering/index.d.ts.map +1 -1
  37. package/lib/plugins/filtering/index.js.map +1 -1
  38. package/lib/plugins/grouping-columns/index.js.map +1 -1
  39. package/lib/plugins/grouping-rows/index.js.map +1 -1
  40. package/lib/plugins/master-detail/index.js.map +1 -1
  41. package/lib/plugins/multi-sort/index.js.map +1 -1
  42. package/lib/plugins/pinned-columns/index.js.map +1 -1
  43. package/lib/plugins/pinned-rows/PinnedRowsPlugin.d.ts +1 -0
  44. package/lib/plugins/pinned-rows/PinnedRowsPlugin.d.ts.map +1 -1
  45. package/lib/plugins/pinned-rows/index.js +118 -87
  46. package/lib/plugins/pinned-rows/index.js.map +1 -1
  47. package/lib/plugins/pinned-rows/pinned-rows.d.ts +2 -1
  48. package/lib/plugins/pinned-rows/pinned-rows.d.ts.map +1 -1
  49. package/lib/plugins/pinned-rows/types.d.ts +23 -2
  50. package/lib/plugins/pinned-rows/types.d.ts.map +1 -1
  51. package/lib/plugins/pivot/index.js.map +1 -1
  52. package/lib/plugins/print/index.js.map +1 -1
  53. package/lib/plugins/reorder/index.js.map +1 -1
  54. package/lib/plugins/responsive/index.js.map +1 -1
  55. package/lib/plugins/row-reorder/index.js.map +1 -1
  56. package/lib/plugins/selection/SelectionPlugin.d.ts.map +1 -1
  57. package/lib/plugins/selection/index.js +147 -139
  58. package/lib/plugins/selection/index.js.map +1 -1
  59. package/lib/plugins/server-side/index.js.map +1 -1
  60. package/lib/plugins/shared/data-collection.d.ts +33 -0
  61. package/lib/plugins/shared/data-collection.d.ts.map +1 -0
  62. package/lib/plugins/tree/index.js.map +1 -1
  63. package/lib/plugins/undo-redo/index.js.map +1 -1
  64. package/lib/plugins/visibility/index.js.map +1 -1
  65. package/package.json +1 -1
  66. package/umd/grid.all.umd.js +23 -23
  67. package/umd/grid.all.umd.js.map +1 -1
  68. package/umd/grid.umd.js +2 -2
  69. package/umd/grid.umd.js.map +1 -1
  70. package/umd/plugins/clipboard.umd.js +5 -5
  71. package/umd/plugins/clipboard.umd.js.map +1 -1
  72. package/umd/plugins/context-menu.umd.js +1 -1
  73. package/umd/plugins/context-menu.umd.js.map +1 -1
  74. package/umd/plugins/editing.umd.js +1 -1
  75. package/umd/plugins/editing.umd.js.map +1 -1
  76. package/umd/plugins/export.umd.js +7 -7
  77. package/umd/plugins/export.umd.js.map +1 -1
  78. package/umd/plugins/pinned-rows.umd.js +1 -1
  79. package/umd/plugins/pinned-rows.umd.js.map +1 -1
  80. package/umd/plugins/selection.umd.js +2 -2
  81. package/umd/plugins/selection.umd.js.map +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"SelectionPlugin.d.ts","sourceRoot":"","sources":["../../../../../../libs/grid/src/lib/plugins/selection/SelectionPlugin.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAGH,OAAO,KAAK,EAAE,WAAW,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AAC9F,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAE/F,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAUrD,OAAO,KAAK,EACV,SAAS,EAGT,eAAe,EAEf,eAAe,EAChB,MAAM,SAAS,CAAC;AAuDjB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8EG;AACH,qBAAa,eAAgB,SAAQ,cAAc,CAAC,eAAe,CAAC;;IAClE;;;OAGG;IACH,gBAAyB,QAAQ,EAAE,cAAc,CAAC,eAAe,CAAC,CAahE;IAEF,gBAAgB;IAChB,QAAQ,CAAC,IAAI,eAAe;IAC5B,gBAAgB;IAChB,SAAkB,MAAM,SAAU;IAElC,gBAAgB;IAChB,cAAuB,aAAa,IAAI,OAAO,CAAC,eAAe,CAAC,CAM/D;IAG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AAO;IAyIjD,gBAAgB;IACP,eAAe,CAAC,KAAK,EAAE,cAAc,GAAG,OAAO,GAAG,IAAI;IA2D/D,gBAAgB;IACP,eAAe,CAAC,KAAK,EAAE,cAAc,GAAG,OAAO,GAAG,IAAI;IAwC/D,gBAAgB;IACP,aAAa,CAAC,MAAM,EAAE,cAAc,GAAG,OAAO,GAAG,IAAI;IAa9D;;;OAGG;IACM,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,GAAG,YAAY,EAAE;IAiRhE,gBAAgB;IACP,WAAW,IAAI,IAAI;IAkD5B;;;;OAIG;IACM,cAAc,IAAI,IAAI;IAW/B;;;;;;;;;;;;;;OAcG;IACH,YAAY,IAAI,eAAe;IAQ/B;;OAEG;IACH,gBAAgB,IAAI,KAAK,CAAC;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAA;KAAE,CAAC;IAIvD;;OAEG;IACH,cAAc,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO;IAIjD;;;;;;;;;;;;OAYG;IACH,SAAS,IAAI,IAAI;IA+BjB;;;;;;;;;;;;OAYG;IACH,UAAU,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI;IAcnC;;;;;;;;;OASG;IACH,qBAAqB,IAAI,MAAM,EAAE;IAIjC;;OAEG;IACH,cAAc,IAAI,IAAI;IAWtB;;OAEG;IACH,SAAS,CAAC,MAAM,EAAE,SAAS,EAAE,GAAG,IAAI;CAgCrC"}
@@ -1,18 +1,18 @@
1
- function R(n) {
2
- if (!n) return -1;
3
- const e = n.getAttribute("data-row");
1
+ function R(o) {
2
+ if (!o) return -1;
3
+ const e = o.getAttribute("data-row");
4
4
  if (e) return parseInt(e, 10);
5
- const t = n.closest(".data-grid-row");
5
+ const t = o.closest(".data-grid-row");
6
6
  if (!t) return -1;
7
7
  const s = t.parentElement;
8
8
  if (!s) return -1;
9
- const i = s.querySelectorAll(":scope > .data-grid-row");
10
- for (let l = 0; l < i.length; l++)
11
- if (i[l] === t) return l;
9
+ const r = s.querySelectorAll(":scope > .data-grid-row");
10
+ for (let n = 0; n < r.length; n++)
11
+ if (r[n] === t) return n;
12
12
  return -1;
13
13
  }
14
- function C(n) {
15
- n && n.querySelectorAll(".cell-focus").forEach((e) => e.classList.remove("cell-focus"));
14
+ function C(o) {
15
+ o && o.querySelectorAll(".cell-focus").forEach((e) => e.classList.remove("cell-focus"));
16
16
  }
17
17
  const p = '<svg viewBox="0 0 16 16" width="12" height="12"><path fill="currentColor" d="M6 10.5a.5.5 0 0 1 .5-.5h3a.5.5 0 0 1 0 1h-3a.5.5 0 0 1-.5-.5zm-2-3a.5.5 0 0 1 .5-.5h7a.5.5 0 0 1 0 1h-7a.5.5 0 0 1-.5-.5zm-2-3a.5.5 0 0 1 .5-.5h11a.5.5 0 0 1 0 1h-11a.5.5 0 0 1-.5-.5z"/></svg>', A = {
18
18
  expand: "▶",
@@ -27,7 +27,7 @@ const p = '<svg viewBox="0 0 16 16" width="12" height="12"><path fill="currentCo
27
27
  filterActive: p,
28
28
  print: "🖨️"
29
29
  };
30
- class k {
30
+ class v {
31
31
  /**
32
32
  * Plugin dependencies - declare other plugins this one requires.
33
33
  *
@@ -394,68 +394,68 @@ class k {
394
394
  // #endregion
395
395
  }
396
396
  const E = "__tbw_expander";
397
- function I(n) {
398
- return n.field === E;
397
+ function k(o) {
398
+ return o.field === E;
399
399
  }
400
- function f(n) {
401
- return n.meta?.utility === !0;
400
+ function f(o) {
401
+ return o.meta?.utility === !0;
402
402
  }
403
- function g(n) {
403
+ function g(o) {
404
404
  return {
405
- startRow: Math.min(n.startRow, n.endRow),
406
- startCol: Math.min(n.startCol, n.endCol),
407
- endRow: Math.max(n.startRow, n.endRow),
408
- endCol: Math.max(n.startCol, n.endCol)
405
+ startRow: Math.min(o.startRow, o.endRow),
406
+ startCol: Math.min(o.startCol, o.endCol),
407
+ endRow: Math.max(o.startRow, o.endRow),
408
+ endCol: Math.max(o.startCol, o.endCol)
409
409
  };
410
410
  }
411
- function v(n) {
412
- const e = g(n);
411
+ function I(o) {
412
+ const e = g(o);
413
413
  return {
414
414
  from: { row: e.startRow, col: e.startCol },
415
415
  to: { row: e.endRow, col: e.endCol }
416
416
  };
417
417
  }
418
- function y(n) {
419
- return n.map(v);
418
+ function y(o) {
419
+ return o.map(I);
420
420
  }
421
- function _(n, e, t) {
421
+ function _(o, e, t) {
422
422
  const s = g(t);
423
- return n >= s.startRow && n <= s.endRow && e >= s.startCol && e <= s.endCol;
423
+ return o >= s.startRow && o <= s.endRow && e >= s.startCol && e <= s.endCol;
424
424
  }
425
- function q(n, e, t) {
426
- return t.some((s) => _(n, e, s));
425
+ function q(o, e, t) {
426
+ return t.some((s) => _(o, e, s));
427
427
  }
428
- function K(n) {
429
- const e = [], t = g(n);
428
+ function K(o) {
429
+ const e = [], t = g(o);
430
430
  for (let s = t.startRow; s <= t.endRow; s++)
431
- for (let i = t.startCol; i <= t.endCol; i++)
432
- e.push({ row: s, col: i });
431
+ for (let r = t.startCol; r <= t.endCol; r++)
432
+ e.push({ row: s, col: r });
433
433
  return e;
434
434
  }
435
- function M(n) {
435
+ function M(o) {
436
436
  const e = /* @__PURE__ */ new Map();
437
- for (const t of n)
437
+ for (const t of o)
438
438
  for (const s of K(t))
439
439
  e.set(`${s.row},${s.col}`, s);
440
440
  return [...e.values()];
441
441
  }
442
- function m(n, e) {
442
+ function m(o, e) {
443
443
  return {
444
- startRow: n.row,
445
- startCol: n.col,
444
+ startRow: o.row,
445
+ startCol: o.col,
446
446
  endRow: e.row,
447
447
  endCol: e.col
448
448
  };
449
449
  }
450
- function b(n, e) {
451
- const t = g(n), s = g(e);
450
+ function b(o, e) {
451
+ const t = g(o), s = g(e);
452
452
  return t.startRow === s.startRow && t.startCol === s.startCol && t.endRow === s.endRow && t.endCol === s.endCol;
453
453
  }
454
- const F = '@layer tbw-plugins{tbw-grid.selecting .data-grid-row>.cell{-webkit-user-select:none;user-select:none}tbw-grid:has(.selection){-webkit-user-select:none;user-select:none}tbw-grid[data-has-focus] .data-grid-row.row-focus{background-color:var(--tbw-focus-background, rgba(from var(--tbw-color-accent) r g b / 12%));outline:none;position:relative}tbw-grid[data-has-focus] .data-grid-row.row-focus:after{content:"";position:absolute;inset:0;pointer-events:none;border:0 solid var(--tbw-range-border-color, var(--tbw-color-accent));border-top-width:2px;border-bottom-width:2px;z-index:1}tbw-grid[data-has-focus] .data-grid-row.row-focus+.data-grid-row.row-focus:after{border-top-width:0}tbw-grid[data-has-focus] .data-grid-row.row-focus:has(+.data-grid-row.row-focus):after{border-bottom-width:0}tbw-grid[data-selection-mode=row] .cell-focus,tbw-grid[data-selection-mode=row] .row-focus,tbw-grid[data-selection-mode=range] .cell-focus{outline:none}tbw-grid .data-grid-row>.cell.selected{background-color:var(--tbw-range-selection-bg);position:relative}tbw-grid .data-grid-row>.cell.selected:after{content:"";position:absolute;inset:0;pointer-events:none;border:0 solid var(--tbw-range-border-color);z-index:1}tbw-grid .data-grid-row>.cell.selected.top:after{border-top-width:2px}tbw-grid .data-grid-row>.cell.selected.bottom:after{border-bottom-width:2px}tbw-grid .data-grid-row>.cell.selected.first:after{border-left-width:2px}tbw-grid .data-grid-row>.cell.selected.last:after{border-right-width:2px}tbw-grid .data-grid-row[data-selectable=false]{cursor:not-allowed;opacity:.6}tbw-grid .data-grid-row[data-selectable=false].row-focus{background-color:var(--tbw-color-row-alt)}tbw-grid .data-grid-row>.cell[data-selectable=false]{cursor:not-allowed;opacity:.6}tbw-grid .data-grid-row>.cell[data-selectable=false].selected{background-color:var(--tbw-selection-warning-bg, rgba(from var(--tbw-color-error) r g b / 50%))}tbw-grid .tbw-selection-summary{font-size:var(--tbw-font-size-sm, .8125rem);color:var(--tbw-color-fg-muted);white-space:nowrap}tbw-grid .data-grid-row>.cell[data-field=__tbw_checkbox],tbw-grid .header-row>.cell[data-field=__tbw_checkbox]{text-align:center;cursor:pointer;padding:0;display:flex;align-items:center;justify-content:center}tbw-grid .tbw-select-row-checkbox{pointer-events:none;margin:0;cursor:pointer}tbw-grid .tbw-checkbox-header{display:flex;justify-content:center;align-items:center;height:100%}tbw-grid .tbw-select-all-checkbox{margin:0;cursor:pointer}}', S = "__tbw_checkbox";
455
- function D(n, e, t) {
456
- if (n === "cell" && e.selectedCell)
454
+ const F = '@layer tbw-plugins{tbw-grid.selecting .data-grid-row>.cell{-webkit-user-select:none;user-select:none}tbw-grid:has(.selection){-webkit-user-select:none;user-select:none}tbw-grid .data-grid-row.row-focus{background-color:var(--tbw-focus-background, rgba(from var(--tbw-color-accent) r g b / 12%));outline:none;position:relative}tbw-grid .data-grid-row.row-focus:after{content:"";position:absolute;inset:0;pointer-events:none;border-width:0;border-style:var(--tbw-selection-border-style, var(--tbw-border-style));border-color:var(--tbw-range-border-color, var(--tbw-color-accent));border-top-width:var(--tbw-selection-border-width, var(--tbw-border-width));border-bottom-width:var(--tbw-selection-border-width, var(--tbw-border-width));z-index:1}tbw-grid .data-grid-row.row-focus+.data-grid-row.row-focus:after{border-top-width:0}tbw-grid .data-grid-row.row-focus:has(+.data-grid-row.row-focus):after{border-bottom-width:0}tbw-grid[data-selection-mode=row] .cell-focus,tbw-grid[data-selection-mode=row] .row-focus,tbw-grid[data-selection-mode=range] .cell-focus{outline:none}tbw-grid .data-grid-row>.cell.selected{background-color:var(--tbw-range-selection-bg);position:relative}tbw-grid .data-grid-row>.cell.selected:after{content:"";position:absolute;inset:0;pointer-events:none;border:0 var(--tbw-selection-border-style, var(--tbw-border-style)) var(--tbw-range-border-color);z-index:1}tbw-grid .data-grid-row>.cell.selected.top:after{border-top-width:var(--tbw-selection-border-width, var(--tbw-border-width))}tbw-grid .data-grid-row>.cell.selected.bottom:after{border-bottom-width:var(--tbw-selection-border-width, var(--tbw-border-width))}tbw-grid .data-grid-row>.cell.selected.first:after{border-left-width:var(--tbw-selection-border-width, var(--tbw-border-width))}tbw-grid .data-grid-row>.cell.selected.last:after{border-right-width:var(--tbw-selection-border-width, var(--tbw-border-width))}tbw-grid .data-grid-row[data-selectable=false]{cursor:not-allowed;opacity:.6}tbw-grid .data-grid-row[data-selectable=false].row-focus{background-color:var(--tbw-color-row-alt)}tbw-grid .data-grid-row>.cell[data-selectable=false]{cursor:not-allowed;opacity:.6}tbw-grid .data-grid-row>.cell[data-selectable=false].selected{background-color:var(--tbw-selection-warning-bg, rgba(from var(--tbw-color-error) r g b / 50%))}tbw-grid .tbw-selection-summary{font-size:var(--tbw-font-size-sm, .8125rem);color:var(--tbw-color-fg-muted);white-space:nowrap}tbw-grid .data-grid-row>.cell[data-field=__tbw_checkbox],tbw-grid .header-row>.cell[data-field=__tbw_checkbox]{text-align:center;cursor:pointer;padding:0;display:flex;align-items:center;justify-content:center}tbw-grid .tbw-select-row-checkbox{pointer-events:none;margin:0;cursor:pointer}tbw-grid .tbw-checkbox-header{display:flex;justify-content:center;align-items:center;height:100%}tbw-grid .tbw-select-all-checkbox{margin:0;cursor:pointer}}', S = "__tbw_checkbox";
455
+ function D(o, e, t) {
456
+ if (o === "cell" && e.selectedCell)
457
457
  return {
458
- mode: n,
458
+ mode: o,
459
459
  ranges: [
460
460
  {
461
461
  from: { row: e.selectedCell.row, col: e.selectedCell.col },
@@ -463,22 +463,26 @@ function D(n, e, t) {
463
463
  }
464
464
  ]
465
465
  };
466
- if (n === "row" && e.selected.size > 0) {
467
- const s = [...e.selected].sort((o, h) => o - h), i = [];
468
- let l = s[0], r = l;
469
- for (let o = 1; o < s.length; o++)
470
- s[o] === r + 1 ? r = s[o] : (i.push({ from: { row: l, col: 0 }, to: { row: r, col: t - 1 } }), l = s[o], r = l);
471
- return i.push({ from: { row: l, col: 0 }, to: { row: r, col: t - 1 } }), { mode: n, ranges: i };
472
- }
473
- return n === "range" && e.ranges.length > 0 ? { mode: n, ranges: y(e.ranges) } : { mode: n, ranges: [] };
466
+ if (o === "row" && e.selected.size > 0) {
467
+ const s = [...e.selected].sort((l, d) => l - d), r = [];
468
+ let n = s[0], i = n;
469
+ for (let l = 1; l < s.length; l++)
470
+ s[l] === i + 1 ? i = s[l] : (r.push({ from: { row: n, col: 0 }, to: { row: i, col: t - 1 } }), n = s[l], i = n);
471
+ return r.push({ from: { row: n, col: 0 }, to: { row: i, col: t - 1 } }), { mode: o, ranges: r };
472
+ }
473
+ return o === "range" && e.ranges.length > 0 ? { mode: o, ranges: y(e.ranges) } : { mode: o, ranges: [] };
474
474
  }
475
- class L extends k {
475
+ class L extends v {
476
476
  /**
477
477
  * Plugin manifest - declares queries and configuration validation rules.
478
478
  * @internal
479
479
  */
480
480
  static manifest = {
481
- queries: [{ type: "getSelection", description: "Get the current selection state" }],
481
+ queries: [
482
+ { type: "getSelection", description: "Get the current selection state" },
483
+ { type: "selectRows", description: "Select specific rows by index (row mode only)" },
484
+ { type: "getSelectedRowIndices", description: "Get sorted array of selected row indices" }
485
+ ],
482
486
  configRules: [
483
487
  {
484
488
  id: "selection/range-dblclick",
@@ -540,10 +544,10 @@ class L extends k {
540
544
  checkSelectable(e, t) {
541
545
  const { isSelectable: s } = this.config;
542
546
  if (!s) return !0;
543
- const i = this.rows[e];
544
- if (!i) return !1;
545
- const l = t !== void 0 ? this.columns[t] : void 0;
546
- return s(i, e, l, t);
547
+ const r = this.rows[e];
548
+ if (!r) return !1;
549
+ const n = t !== void 0 ? this.columns[t] : void 0;
550
+ return s(r, e, n, t);
547
551
  }
548
552
  /**
549
553
  * Check if an entire row is selectable (for row mode).
@@ -570,6 +574,10 @@ class L extends k {
570
574
  handleQuery(e) {
571
575
  if (e.type === "getSelection")
572
576
  return this.getSelection();
577
+ if (e.type === "getSelectedRowIndices")
578
+ return this.getSelectedRowIndices();
579
+ if (e.type === "selectRows")
580
+ return this.selectRows(e.context), !0;
573
581
  }
574
582
  /** @internal */
575
583
  detach() {
@@ -587,26 +595,26 @@ class L extends k {
587
595
  /** @internal */
588
596
  onCellClick(e) {
589
597
  if (!this.isSelectionEnabled()) return !1;
590
- const { rowIndex: t, colIndex: s, originalEvent: i } = e, { mode: l, triggerOn: r = "click" } = this.config;
591
- if (i.type !== r)
598
+ const { rowIndex: t, colIndex: s, originalEvent: r } = e, { mode: n, triggerOn: i = "click" } = this.config;
599
+ if (r.type !== i)
592
600
  return !1;
593
- const o = this.columns[s], h = o && f(o);
594
- if (l === "cell") {
595
- if (h || !this.isCellSelectable(t, s))
601
+ const l = this.columns[s], d = l && f(l);
602
+ if (n === "cell") {
603
+ if (d || !this.isCellSelectable(t, s))
596
604
  return !1;
597
605
  const a = this.selectedCell;
598
606
  return a && a.row === t && a.col === s || (this.selectedCell = { row: t, col: s }, this.emit("selection-change", this.#e()), this.requestAfterRender()), !1;
599
607
  }
600
- if (l === "row") {
608
+ if (n === "row") {
601
609
  if (!this.isRowSelectable(t))
602
610
  return !1;
603
- const a = i.shiftKey, d = i.ctrlKey || i.metaKey, c = o?.meta?.checkboxColumn === !0;
611
+ const a = r.shiftKey, h = r.ctrlKey || r.metaKey, c = l?.meta?.checkboxColumn === !0;
604
612
  if (a && this.anchor !== null) {
605
613
  const u = Math.min(this.anchor, t), x = Math.max(this.anchor, t);
606
- d || this.selected.clear();
614
+ h || this.selected.clear();
607
615
  for (let w = u; w <= x; w++)
608
616
  this.isRowSelectable(w) && this.selected.add(w);
609
- } else if (d || c)
617
+ } else if (h || c)
610
618
  this.selected.has(t) ? this.selected.delete(t) : this.selected.add(t), this.anchor = t;
611
619
  else {
612
620
  if (this.selected.size === 1 && this.selected.has(t))
@@ -615,16 +623,16 @@ class L extends k {
615
623
  }
616
624
  return this.lastSelected = t, this.explicitSelection = !0, this.emit("selection-change", this.#e()), this.requestAfterRender(), !1;
617
625
  }
618
- if (l === "range") {
619
- if (h || !this.isCellSelectable(t, s))
626
+ if (n === "range") {
627
+ if (d || !this.isCellSelectable(t, s))
620
628
  return !1;
621
- const a = i.shiftKey, d = i.ctrlKey || i.metaKey;
629
+ const a = r.shiftKey, h = r.ctrlKey || r.metaKey;
622
630
  if (a && this.cellAnchor) {
623
631
  const c = m(this.cellAnchor, { row: t, col: s }), u = this.ranges.length > 0 ? this.ranges[this.ranges.length - 1] : null;
624
632
  if (u && b(u, c))
625
633
  return !1;
626
- d ? this.ranges.length > 0 ? this.ranges[this.ranges.length - 1] = c : this.ranges.push(c) : this.ranges = [c], this.activeRange = c;
627
- } else if (d) {
634
+ h ? this.ranges.length > 0 ? this.ranges[this.ranges.length - 1] = c : this.ranges.push(c) : this.ranges = [c], this.activeRange = c;
635
+ } else if (h) {
628
636
  const c = {
629
637
  startRow: t,
630
638
  startCol: s,
@@ -650,35 +658,35 @@ class L extends k {
650
658
  /** @internal */
651
659
  onKeyDown(e) {
652
660
  if (!this.isSelectionEnabled()) return !1;
653
- const { mode: t } = this.config, i = ["ArrowUp", "ArrowDown", "ArrowLeft", "ArrowRight", "Tab", "Home", "End", "PageUp", "PageDown"].includes(e.key);
661
+ const { mode: t } = this.config, r = ["ArrowUp", "ArrowDown", "ArrowLeft", "ArrowRight", "Tab", "Home", "End", "PageUp", "PageDown"].includes(e.key);
654
662
  if (e.key === "Escape")
655
- return t === "cell" ? this.selectedCell = null : t === "row" ? (this.selected.clear(), this.anchor = null) : t === "range" && (this.ranges = [], this.activeRange = null, this.cellAnchor = null), this.emit("selection-change", this.#e()), this.requestAfterRender(), !0;
656
- if (t === "cell" && i)
663
+ return this.grid.query("isEditing").some(Boolean) ? !1 : (t === "cell" ? this.selectedCell = null : t === "row" ? (this.selected.clear(), this.anchor = null) : t === "range" && (this.ranges = [], this.activeRange = null, this.cellAnchor = null), this.emit("selection-change", this.#e()), this.requestAfterRender(), !0);
664
+ if (t === "cell" && r)
657
665
  return queueMicrotask(() => {
658
- const l = this.grid._focusRow, r = this.grid._focusCol;
659
- this.isCellSelectable(l, r) ? this.selectedCell = { row: l, col: r } : this.selectedCell = null, this.emit("selection-change", this.#e()), this.requestAfterRender();
666
+ const n = this.grid._focusRow, i = this.grid._focusCol;
667
+ this.isCellSelectable(n, i) ? this.selectedCell = { row: n, col: i } : this.selectedCell = null, this.emit("selection-change", this.#e()), this.requestAfterRender();
660
668
  }), !1;
661
669
  if (t === "row") {
662
670
  if (e.key === "ArrowUp" || e.key === "ArrowDown") {
663
- const l = e.shiftKey;
664
- return l && this.anchor === null && (this.anchor = this.grid._focusRow), queueMicrotask(() => {
665
- const r = this.grid._focusRow;
666
- if (l && this.anchor !== null) {
671
+ const n = e.shiftKey;
672
+ return n && this.anchor === null && (this.anchor = this.grid._focusRow), queueMicrotask(() => {
673
+ const i = this.grid._focusRow;
674
+ if (n && this.anchor !== null) {
667
675
  this.selected.clear();
668
- const o = Math.min(this.anchor, r), h = Math.max(this.anchor, r);
669
- for (let a = o; a <= h; a++)
676
+ const l = Math.min(this.anchor, i), d = Math.max(this.anchor, i);
677
+ for (let a = l; a <= d; a++)
670
678
  this.isRowSelectable(a) && this.selected.add(a);
671
679
  } else
672
- this.isRowSelectable(r) ? (this.selected.clear(), this.selected.add(r), this.anchor = r) : this.selected.clear();
673
- this.lastSelected = r, this.explicitSelection = !0, this.emit("selection-change", this.#e()), this.requestAfterRender();
680
+ this.isRowSelectable(i) ? (this.selected.clear(), this.selected.add(i), this.anchor = i) : this.selected.clear();
681
+ this.lastSelected = i, this.explicitSelection = !0, this.emit("selection-change", this.#e()), this.requestAfterRender();
674
682
  }), !1;
675
683
  }
676
684
  if (e.key === "a" && (e.ctrlKey || e.metaKey))
677
685
  return e.preventDefault(), e.stopPropagation(), this.selectAll(), !0;
678
686
  }
679
- if (t === "range" && i) {
680
- const l = e.key === "Tab", r = e.shiftKey && !l;
681
- return r && !this.cellAnchor && (this.cellAnchor = { row: this.grid._focusRow, col: this.grid._focusCol }), this.pendingKeyboardUpdate = { shiftKey: r }, queueMicrotask(() => this.requestAfterRender()), !1;
687
+ if (t === "range" && r) {
688
+ const n = e.key === "Tab", i = e.shiftKey && !n;
689
+ return i && !this.cellAnchor && (this.cellAnchor = { row: this.grid._focusRow, col: this.grid._focusCol }), this.pendingKeyboardUpdate = { shiftKey: i }, queueMicrotask(() => this.requestAfterRender()), !1;
682
690
  }
683
691
  return t === "range" && e.key === "a" && (e.ctrlKey || e.metaKey) ? (e.preventDefault(), e.stopPropagation(), this.selectAll(), !0) : !1;
684
692
  }
@@ -689,13 +697,13 @@ class L extends k {
689
697
  if (t && f(t) || !this.isCellSelectable(e.rowIndex, e.colIndex) || e.originalEvent.shiftKey && this.cellAnchor)
690
698
  return;
691
699
  this.isDragging = !0;
692
- const s = e.rowIndex, i = e.colIndex, l = e.originalEvent.ctrlKey || e.originalEvent.metaKey, r = {
700
+ const s = e.rowIndex, r = e.colIndex, n = e.originalEvent.ctrlKey || e.originalEvent.metaKey, i = {
693
701
  startRow: s,
694
- startCol: i,
702
+ startCol: r,
695
703
  endRow: s,
696
- endCol: i
704
+ endCol: r
697
705
  };
698
- return !l && this.ranges.length === 1 && b(this.ranges[0], r) ? (this.cellAnchor = { row: s, col: i }, !0) : (this.cellAnchor = { row: s, col: i }, l || (this.ranges = []), this.ranges.push(r), this.activeRange = r, this.emit("selection-change", this.#e()), this.requestAfterRender(), !0);
706
+ return !n && this.ranges.length === 1 && b(this.ranges[0], i) ? (this.cellAnchor = { row: s, col: r }, !0) : (this.cellAnchor = { row: s, col: r }, n || (this.ranges = []), this.ranges.push(i), this.activeRange = i, this.emit("selection-change", this.#e()), this.requestAfterRender(), !0);
699
707
  }
700
708
  /** @internal */
701
709
  onCellMouseMove(e) {
@@ -703,11 +711,11 @@ class L extends k {
703
711
  let t = e.colIndex;
704
712
  const s = this.columns[t];
705
713
  if (s && f(s)) {
706
- const r = this.columns.findIndex((o) => !f(o));
707
- r >= 0 && (t = r);
714
+ const i = this.columns.findIndex((l) => !f(l));
715
+ i >= 0 && (t = i);
708
716
  }
709
- const i = m(this.cellAnchor, { row: e.rowIndex, col: t }), l = this.ranges.length > 0 ? this.ranges[this.ranges.length - 1] : null;
710
- return l && b(l, i) || (this.ranges.length > 0 ? this.ranges[this.ranges.length - 1] = i : this.ranges.push(i), this.activeRange = i, this.emit("selection-change", this.#e()), this.requestAfterRender()), !0;
717
+ const r = m(this.cellAnchor, { row: e.rowIndex, col: t }), n = this.ranges.length > 0 ? this.ranges[this.ranges.length - 1] : null;
718
+ return n && b(n, r) || (this.ranges.length > 0 ? this.ranges[this.ranges.length - 1] = r : this.ranges.push(r), this.activeRange = r, this.emit("selection-change", this.#e()), this.requestAfterRender()), !0;
711
719
  }
712
720
  /** @internal */
713
721
  onCellMouseUp(e) {
@@ -721,10 +729,10 @@ class L extends k {
721
729
  */
722
730
  processColumns(e) {
723
731
  if (this.config.checkbox && this.config.mode === "row") {
724
- if (e.some((l) => l.field === S))
732
+ if (e.some((n) => n.field === S))
725
733
  return e;
726
- const t = this.#t(), s = e.findIndex(I), i = s >= 0 ? s + 1 : 0;
727
- return [...e.slice(0, i), t, ...e.slice(i)];
734
+ const t = this.#t(), s = e.findIndex(k), r = s >= 0 ? s + 1 : 0;
735
+ return [...e.slice(0, r), t, ...e.slice(r)];
728
736
  }
729
737
  return e;
730
738
  }
@@ -757,8 +765,8 @@ class L extends k {
757
765
  t.type = "checkbox", t.className = "tbw-select-row-checkbox";
758
766
  const s = e.cellEl;
759
767
  if (s) {
760
- const i = parseInt(s.getAttribute("data-row") ?? "-1", 10);
761
- i >= 0 && (t.checked = this.selected.has(i));
768
+ const r = parseInt(s.getAttribute("data-row") ?? "-1", 10);
769
+ r >= 0 && (t.checked = this.selected.has(r));
762
770
  }
763
771
  return t;
764
772
  }
@@ -768,22 +776,22 @@ class L extends k {
768
776
  * Update checkbox checked states to reflect current selection.
769
777
  * Called from #applySelectionClasses.
770
778
  */
771
- #i(e) {
772
- e.querySelectorAll(".tbw-select-row-checkbox").forEach((i) => {
773
- const l = i.closest(".cell"), r = l ? R(l) : -1;
774
- r >= 0 && (i.checked = this.selected.has(r));
779
+ #r(e) {
780
+ e.querySelectorAll(".tbw-select-row-checkbox").forEach((r) => {
781
+ const n = r.closest(".cell"), i = n ? R(n) : -1;
782
+ i >= 0 && (r.checked = this.selected.has(i));
775
783
  });
776
784
  const s = e.querySelector(".tbw-select-all-checkbox");
777
785
  if (s) {
778
- const i = this.rows.length;
779
- let l = 0;
786
+ const r = this.rows.length;
787
+ let n = 0;
780
788
  if (this.config.isSelectable)
781
- for (let h = 0; h < i; h++)
782
- this.isRowSelectable(h) && l++;
789
+ for (let d = 0; d < r; d++)
790
+ this.isRowSelectable(d) && n++;
783
791
  else
784
- l = i;
785
- const r = l > 0 && this.selected.size >= l, o = this.selected.size > 0;
786
- s.checked = r, s.indeterminate = o && !r;
792
+ n = r;
793
+ const i = n > 0 && this.selected.size >= n, l = this.selected.size > 0;
794
+ s.checked = i, s.indeterminate = l && !i;
787
795
  }
788
796
  }
789
797
  // #endregion
@@ -794,7 +802,7 @@ class L extends k {
794
802
  * Only updates when the focus has changed since the last sync.
795
803
  * Skips when `explicitSelection` is set (click/keyboard set selection directly).
796
804
  */
797
- #r(e) {
805
+ #i(e) {
798
806
  const t = this.grid._focusRow, s = this.grid._focusCol;
799
807
  if (e === "row") {
800
808
  if (this.explicitSelection) {
@@ -809,8 +817,8 @@ class L extends k {
809
817
  return;
810
818
  }
811
819
  if ((t !== this.lastSyncedFocusRow || s !== this.lastSyncedFocusCol) && (this.lastSyncedFocusRow = t, this.lastSyncedFocusCol = s, this.isCellSelectable(t, s))) {
812
- const i = this.selectedCell;
813
- (!i || i.row !== t || i.col !== s) && (this.selectedCell = { row: t, col: s }, this.emit("selection-change", this.#e()));
820
+ const r = this.selectedCell;
821
+ (!r || r.row !== t || r.col !== s) && (this.selectedCell = { row: t, col: s }, this.emit("selection-change", this.#e()));
814
822
  }
815
823
  }
816
824
  }
@@ -822,33 +830,33 @@ class L extends k {
822
830
  const e = this.gridElement;
823
831
  if (!e) return;
824
832
  const { mode: t } = this.config, s = !!this.config.isSelectable;
825
- e.querySelectorAll(".cell").forEach((r) => {
826
- r.classList.remove("selected", "top", "bottom", "first", "last"), s && r.removeAttribute("data-selectable");
833
+ e.querySelectorAll(".cell").forEach((i) => {
834
+ i.classList.remove("selected", "top", "bottom", "first", "last"), s && i.removeAttribute("data-selectable");
827
835
  });
828
- const l = e.querySelectorAll(".data-grid-row");
829
- if (l.forEach((r) => {
830
- r.classList.remove("selected", "row-focus"), s && r.removeAttribute("data-selectable");
831
- }), t === "row" && (C(e), l.forEach((r) => {
832
- const o = r.querySelector(".cell[data-row]"), h = R(o);
833
- h >= 0 && (s && !this.isRowSelectable(h) && r.setAttribute("data-selectable", "false"), this.selected.has(h) && r.classList.add("selected", "row-focus"));
834
- }), this.config.checkbox && this.#i(e)), (t === "cell" || t === "range") && s && e.querySelectorAll(".cell[data-row][data-col]").forEach((o) => {
835
- const h = parseInt(o.getAttribute("data-row") ?? "-1", 10), a = parseInt(o.getAttribute("data-col") ?? "-1", 10);
836
- h >= 0 && a >= 0 && (this.isCellSelectable(h, a) || o.setAttribute("data-selectable", "false"));
836
+ const n = e.querySelectorAll(".data-grid-row");
837
+ if (n.forEach((i) => {
838
+ i.classList.remove("selected", "row-focus"), s && i.removeAttribute("data-selectable");
839
+ }), t === "row" && (C(e), n.forEach((i) => {
840
+ const l = i.querySelector(".cell[data-row]"), d = R(l);
841
+ d >= 0 && (s && !this.isRowSelectable(d) && i.setAttribute("data-selectable", "false"), this.selected.has(d) && i.classList.add("selected", "row-focus"));
842
+ }), this.config.checkbox && this.#r(e)), (t === "cell" || t === "range") && s && e.querySelectorAll(".cell[data-row][data-col]").forEach((l) => {
843
+ const d = parseInt(l.getAttribute("data-row") ?? "-1", 10), a = parseInt(l.getAttribute("data-col") ?? "-1", 10);
844
+ d >= 0 && a >= 0 && (this.isCellSelectable(d, a) || l.setAttribute("data-selectable", "false"));
837
845
  }), t === "range" && this.ranges.length > 0) {
838
846
  C(e);
839
- const r = this.ranges.map(g), o = (a, d) => {
840
- for (const c of r)
841
- if (a >= c.startRow && a <= c.endRow && d >= c.startCol && d <= c.endCol)
847
+ const i = this.ranges.map(g), l = (a, h) => {
848
+ for (const c of i)
849
+ if (a >= c.startRow && a <= c.endRow && h >= c.startCol && h <= c.endCol)
842
850
  return !0;
843
851
  return !1;
844
852
  };
845
853
  e.querySelectorAll(".cell[data-row][data-col]").forEach((a) => {
846
- const d = parseInt(a.getAttribute("data-row") ?? "-1", 10), c = parseInt(a.getAttribute("data-col") ?? "-1", 10);
847
- if (d >= 0 && c >= 0) {
854
+ const h = parseInt(a.getAttribute("data-row") ?? "-1", 10), c = parseInt(a.getAttribute("data-col") ?? "-1", 10);
855
+ if (h >= 0 && c >= 0) {
848
856
  const u = this.columns[c];
849
857
  if (u && f(u))
850
858
  return;
851
- o(d, c) && (a.classList.add("selected"), o(d - 1, c) || a.classList.add("top"), o(d + 1, c) || a.classList.add("bottom"), o(d, c - 1) || a.classList.add("first"), o(d, c + 1) || a.classList.add("last"));
859
+ l(h, c) && (a.classList.add("selected"), l(h - 1, c) || a.classList.add("top"), l(h + 1, c) || a.classList.add("bottom"), l(h, c - 1) || a.classList.add("first"), l(h, c + 1) || a.classList.add("last"));
852
860
  }
853
861
  });
854
862
  }
@@ -860,16 +868,16 @@ class L extends k {
860
868
  if (!e) return;
861
869
  const t = e.children[0], { mode: s } = this.config;
862
870
  if (this.pendingKeyboardUpdate && s === "range") {
863
- const { shiftKey: i } = this.pendingKeyboardUpdate;
871
+ const { shiftKey: r } = this.pendingKeyboardUpdate;
864
872
  this.pendingKeyboardUpdate = null;
865
- const l = this.grid._focusRow, r = this.grid._focusCol;
866
- if (i && this.cellAnchor) {
867
- const o = m(this.cellAnchor, { row: l, col: r });
868
- this.ranges = [o], this.activeRange = o;
869
- } else i || (this.ranges = [], this.activeRange = null, this.cellAnchor = { row: l, col: r });
873
+ const n = this.grid._focusRow, i = this.grid._focusCol;
874
+ if (r && this.cellAnchor) {
875
+ const l = m(this.cellAnchor, { row: n, col: i });
876
+ this.ranges = [l], this.activeRange = l;
877
+ } else r || (this.ranges = [], this.activeRange = null, this.cellAnchor = { row: n, col: i });
870
878
  this.emit("selection-change", this.#e());
871
879
  }
872
- this.#r(s), this.grid.setAttribute("data-selection-mode", s), t && t.classList.toggle("selecting", this.isDragging), this.#s();
880
+ this.#i(s), this.grid.setAttribute("data-selection-mode", s), t && t.classList.toggle("selecting", this.isDragging), this.#s();
873
881
  }
874
882
  /**
875
883
  * Called after scroll-triggered row rendering.
@@ -938,13 +946,13 @@ class L extends k {
938
946
  } else if (e === "range") {
939
947
  const t = this.rows.length, s = this.columns.length;
940
948
  if (t > 0 && s > 0) {
941
- const i = {
949
+ const r = {
942
950
  startRow: 0,
943
951
  startCol: 0,
944
952
  endRow: t - 1,
945
953
  endCol: s - 1
946
954
  };
947
- this.ranges = [i], this.activeRange = i, this.emit("selection-change", this.#e()), this.requestAfterRender();
955
+ this.ranges = [r], this.activeRange = r, this.emit("selection-change", this.#e()), this.requestAfterRender();
948
956
  }
949
957
  }
950
958
  }