@toolbox-web/grid 1.14.0 → 1.14.1

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.
@@ -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,CAiBhE;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;IAGD,qCAAqC;IACrC,OAAO,CAAC,QAAQ,CAAqB;IACrC,OAAO,CAAC,YAAY,CAAuB;IAC3C,OAAO,CAAC,MAAM,CAAuB;IAErC,yCAAyC;IACzC,OAAO,CAAC,MAAM,CAA2B;IACzC,OAAO,CAAC,WAAW,CAAkC;IACrD,OAAO,CAAC,UAAU,CAA6C;IAC/D,OAAO,CAAC,UAAU,CAAS;IAE3B,oEAAoE;IACpE,OAAO,CAAC,qBAAqB,CA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AG,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(o) {
2
- if (!o) return -1;
3
- const e = o.getAttribute("data-row");
1
+ function R(n) {
2
+ if (!n) return -1;
3
+ const e = n.getAttribute("data-row");
4
4
  if (e) return parseInt(e, 10);
5
- const t = o.closest(".data-grid-row");
5
+ const t = n.closest(".data-grid-row");
6
6
  if (!t) return -1;
7
7
  const s = t.parentElement;
8
8
  if (!s) return -1;
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;
9
+ const i = s.querySelectorAll(":scope > .data-grid-row");
10
+ for (let r = 0; r < i.length; r++)
11
+ if (i[r] === t) return r;
12
12
  return -1;
13
13
  }
14
- function C(o) {
15
- o && o.querySelectorAll(".cell-focus").forEach((e) => e.classList.remove("cell-focus"));
14
+ function C(n) {
15
+ n && n.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: "▶",
@@ -394,68 +394,68 @@ class v {
394
394
  // #endregion
395
395
  }
396
396
  const E = "__tbw_expander";
397
- function k(o) {
398
- return o.field === E;
397
+ function k(n) {
398
+ return n.field === E;
399
399
  }
400
- function f(o) {
401
- return o.meta?.utility === !0;
400
+ function f(n) {
401
+ return n.meta?.utility === !0;
402
402
  }
403
- function g(o) {
403
+ function g(n) {
404
404
  return {
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)
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)
409
409
  };
410
410
  }
411
- function I(o) {
412
- const e = g(o);
411
+ function I(n) {
412
+ const e = g(n);
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(o) {
419
- return o.map(I);
418
+ function S(n) {
419
+ return n.map(I);
420
420
  }
421
- function _(o, e, t) {
421
+ function _(n, e, t) {
422
422
  const s = g(t);
423
- return o >= s.startRow && o <= s.endRow && e >= s.startCol && e <= s.endCol;
423
+ return n >= s.startRow && n <= s.endRow && e >= s.startCol && e <= s.endCol;
424
424
  }
425
- function q(o, e, t) {
426
- return t.some((s) => _(o, e, s));
425
+ function q(n, e, t) {
426
+ return t.some((s) => _(n, e, s));
427
427
  }
428
- function K(o) {
429
- const e = [], t = g(o);
428
+ function K(n) {
429
+ const e = [], t = g(n);
430
430
  for (let s = t.startRow; s <= t.endRow; s++)
431
- for (let r = t.startCol; r <= t.endCol; r++)
432
- e.push({ row: s, col: r });
431
+ for (let i = t.startCol; i <= t.endCol; i++)
432
+ e.push({ row: s, col: i });
433
433
  return e;
434
434
  }
435
- function M(o) {
435
+ function M(n) {
436
436
  const e = /* @__PURE__ */ new Map();
437
- for (const t of o)
437
+ for (const t of n)
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(o, e) {
442
+ function m(n, e) {
443
443
  return {
444
- startRow: o.row,
445
- startCol: o.col,
444
+ startRow: n.row,
445
+ startCol: n.col,
446
446
  endRow: e.row,
447
447
  endCol: e.col
448
448
  };
449
449
  }
450
- function b(o, e) {
451
- const t = g(o), s = g(e);
450
+ function b(n, e) {
451
+ const t = g(n), 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-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)
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}}', y = "__tbw_checkbox";
455
+ function D(n, e, t) {
456
+ if (n === "cell" && e.selectedCell)
457
457
  return {
458
- mode: o,
458
+ mode: n,
459
459
  ranges: [
460
460
  {
461
461
  from: { row: e.selectedCell.row, col: e.selectedCell.col },
@@ -463,14 +463,14 @@ function D(o, e, t) {
463
463
  }
464
464
  ]
465
465
  };
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;
466
+ if (n === "row" && e.selected.size > 0) {
467
+ const s = [...e.selected].sort((l, d) => l - d), i = [];
468
+ let r = s[0], o = r;
469
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 };
470
+ s[l] === o + 1 ? o = s[l] : (i.push({ from: { row: r, col: 0 }, to: { row: o, col: t - 1 } }), r = s[l], o = r);
471
+ return i.push({ from: { row: r, col: 0 }, to: { row: o, col: t - 1 } }), { mode: n, ranges: i };
472
472
  }
473
- return o === "range" && e.ranges.length > 0 ? { mode: o, ranges: y(e.ranges) } : { mode: o, ranges: [] };
473
+ return n === "range" && e.ranges.length > 0 ? { mode: n, ranges: S(e.ranges) } : { mode: n, ranges: [] };
474
474
  }
475
475
  class L extends v {
476
476
  /**
@@ -544,10 +544,10 @@ class L extends v {
544
544
  checkSelectable(e, t) {
545
545
  const { isSelectable: s } = this.config;
546
546
  if (!s) return !0;
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
+ const i = this.rows[e];
548
+ if (!i) return !1;
549
+ const r = t !== void 0 ? this.columns[t] : void 0;
550
+ return s(i, e, r, t);
551
551
  }
552
552
  /**
553
553
  * Check if an entire row is selectable (for row mode).
@@ -595,20 +595,20 @@ class L extends v {
595
595
  /** @internal */
596
596
  onCellClick(e) {
597
597
  if (!this.isSelectionEnabled()) return !1;
598
- const { rowIndex: t, colIndex: s, originalEvent: r } = e, { mode: n, triggerOn: i = "click" } = this.config;
599
- if (r.type !== i)
598
+ const { rowIndex: t, colIndex: s, originalEvent: i } = e, { mode: r, triggerOn: o = "click" } = this.config;
599
+ if (i.type !== o)
600
600
  return !1;
601
601
  const l = this.columns[s], d = l && f(l);
602
- if (n === "cell") {
602
+ if (r === "cell") {
603
603
  if (d || !this.isCellSelectable(t, s))
604
604
  return !1;
605
605
  const a = this.selectedCell;
606
606
  return a && a.row === t && a.col === s || (this.selectedCell = { row: t, col: s }, this.emit("selection-change", this.#e()), this.requestAfterRender()), !1;
607
607
  }
608
- if (n === "row") {
608
+ if (r === "row") {
609
609
  if (!this.isRowSelectable(t))
610
610
  return !1;
611
- const a = r.shiftKey, h = r.ctrlKey || r.metaKey, c = l?.meta?.checkboxColumn === !0;
611
+ const a = i.shiftKey, h = i.ctrlKey || i.metaKey, c = l?.meta?.checkboxColumn === !0;
612
612
  if (a && this.anchor !== null) {
613
613
  const u = Math.min(this.anchor, t), x = Math.max(this.anchor, t);
614
614
  h || this.selected.clear();
@@ -623,10 +623,10 @@ class L extends v {
623
623
  }
624
624
  return this.lastSelected = t, this.explicitSelection = !0, this.emit("selection-change", this.#e()), this.requestAfterRender(), !1;
625
625
  }
626
- if (n === "range") {
626
+ if (r === "range") {
627
627
  if (d || !this.isCellSelectable(t, s))
628
628
  return !1;
629
- const a = r.shiftKey, h = r.ctrlKey || r.metaKey;
629
+ const a = i.shiftKey, h = i.ctrlKey || i.metaKey;
630
630
  if (a && this.cellAnchor) {
631
631
  const c = m(this.cellAnchor, { row: t, col: s }), u = this.ranges.length > 0 ? this.ranges[this.ranges.length - 1] : null;
632
632
  if (u && b(u, c))
@@ -658,37 +658,37 @@ class L extends v {
658
658
  /** @internal */
659
659
  onKeyDown(e) {
660
660
  if (!this.isSelectionEnabled()) return !1;
661
- const { mode: t } = this.config, r = ["ArrowUp", "ArrowDown", "ArrowLeft", "ArrowRight", "Tab", "Home", "End", "PageUp", "PageDown"].includes(e.key);
661
+ const { mode: t } = this.config, i = ["ArrowUp", "ArrowDown", "ArrowLeft", "ArrowRight", "Tab", "Home", "End", "PageUp", "PageDown"].includes(e.key);
662
662
  if (e.key === "Escape")
663
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)
664
+ if (t === "cell" && i)
665
665
  return queueMicrotask(() => {
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();
666
+ const r = this.grid._focusRow, o = this.grid._focusCol;
667
+ this.isCellSelectable(r, o) ? this.selectedCell = { row: r, col: o } : this.selectedCell = null, this.emit("selection-change", this.#e()), this.requestAfterRender();
668
668
  }), !1;
669
669
  if (t === "row") {
670
670
  if (e.key === "ArrowUp" || e.key === "ArrowDown") {
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) {
671
+ const r = e.shiftKey;
672
+ return r && this.anchor === null && (this.anchor = this.grid._focusRow), queueMicrotask(() => {
673
+ const o = this.grid._focusRow;
674
+ if (r && this.anchor !== null) {
675
675
  this.selected.clear();
676
- const l = Math.min(this.anchor, i), d = Math.max(this.anchor, i);
676
+ const l = Math.min(this.anchor, o), d = Math.max(this.anchor, o);
677
677
  for (let a = l; a <= d; a++)
678
678
  this.isRowSelectable(a) && this.selected.add(a);
679
679
  } else
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();
680
+ this.isRowSelectable(o) ? (this.selected.clear(), this.selected.add(o), this.anchor = o) : this.selected.clear();
681
+ this.lastSelected = o, this.explicitSelection = !0, this.emit("selection-change", this.#e()), this.requestAfterRender();
682
682
  }), !1;
683
683
  }
684
684
  if (e.key === "a" && (e.ctrlKey || e.metaKey))
685
- return e.preventDefault(), e.stopPropagation(), this.selectAll(), !0;
685
+ return this.grid.query("isEditing").some(Boolean) ? !1 : (e.preventDefault(), e.stopPropagation(), this.selectAll(), !0);
686
686
  }
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;
687
+ if (t === "range" && i) {
688
+ const r = e.key === "Tab", o = e.shiftKey && !r;
689
+ return o && !this.cellAnchor && (this.cellAnchor = { row: this.grid._focusRow, col: this.grid._focusCol }), this.pendingKeyboardUpdate = { shiftKey: o }, queueMicrotask(() => this.requestAfterRender()), !1;
690
690
  }
691
- return t === "range" && e.key === "a" && (e.ctrlKey || e.metaKey) ? (e.preventDefault(), e.stopPropagation(), this.selectAll(), !0) : !1;
691
+ return t === "range" && e.key === "a" && (e.ctrlKey || e.metaKey) ? this.grid.query("isEditing").some(Boolean) ? !1 : (e.preventDefault(), e.stopPropagation(), this.selectAll(), !0) : !1;
692
692
  }
693
693
  /** @internal */
694
694
  onCellMouseDown(e) {
@@ -697,13 +697,13 @@ class L extends v {
697
697
  if (t && f(t) || !this.isCellSelectable(e.rowIndex, e.colIndex) || e.originalEvent.shiftKey && this.cellAnchor)
698
698
  return;
699
699
  this.isDragging = !0;
700
- const s = e.rowIndex, r = e.colIndex, n = e.originalEvent.ctrlKey || e.originalEvent.metaKey, i = {
700
+ const s = e.rowIndex, i = e.colIndex, r = e.originalEvent.ctrlKey || e.originalEvent.metaKey, o = {
701
701
  startRow: s,
702
- startCol: r,
702
+ startCol: i,
703
703
  endRow: s,
704
- endCol: r
704
+ endCol: i
705
705
  };
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);
706
+ return !r && this.ranges.length === 1 && b(this.ranges[0], o) ? (this.cellAnchor = { row: s, col: i }, !0) : (this.cellAnchor = { row: s, col: i }, r || (this.ranges = []), this.ranges.push(o), this.activeRange = o, this.emit("selection-change", this.#e()), this.requestAfterRender(), !0);
707
707
  }
708
708
  /** @internal */
709
709
  onCellMouseMove(e) {
@@ -711,11 +711,11 @@ class L extends v {
711
711
  let t = e.colIndex;
712
712
  const s = this.columns[t];
713
713
  if (s && f(s)) {
714
- const i = this.columns.findIndex((l) => !f(l));
715
- i >= 0 && (t = i);
714
+ const o = this.columns.findIndex((l) => !f(l));
715
+ o >= 0 && (t = o);
716
716
  }
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;
717
+ const i = m(this.cellAnchor, { row: e.rowIndex, col: t }), r = this.ranges.length > 0 ? this.ranges[this.ranges.length - 1] : null;
718
+ return r && b(r, 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;
719
719
  }
720
720
  /** @internal */
721
721
  onCellMouseUp(e) {
@@ -729,10 +729,10 @@ class L extends v {
729
729
  */
730
730
  processColumns(e) {
731
731
  if (this.config.checkbox && this.config.mode === "row") {
732
- if (e.some((n) => n.field === S))
732
+ if (e.some((r) => r.field === y))
733
733
  return e;
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)];
734
+ const t = this.#t(), s = e.findIndex(k), i = s >= 0 ? s + 1 : 0;
735
+ return [...e.slice(0, i), t, ...e.slice(i)];
736
736
  }
737
737
  return e;
738
738
  }
@@ -741,7 +741,7 @@ class L extends v {
741
741
  */
742
742
  #t() {
743
743
  return {
744
- field: S,
744
+ field: y,
745
745
  header: "",
746
746
  width: 32,
747
747
  resizable: !1,
@@ -765,8 +765,8 @@ class L extends v {
765
765
  t.type = "checkbox", t.className = "tbw-select-row-checkbox";
766
766
  const s = e.cellEl;
767
767
  if (s) {
768
- const r = parseInt(s.getAttribute("data-row") ?? "-1", 10);
769
- r >= 0 && (t.checked = this.selected.has(r));
768
+ const i = parseInt(s.getAttribute("data-row") ?? "-1", 10);
769
+ i >= 0 && (t.checked = this.selected.has(i));
770
770
  }
771
771
  return t;
772
772
  }
@@ -776,22 +776,22 @@ class L extends v {
776
776
  * Update checkbox checked states to reflect current selection.
777
777
  * Called from #applySelectionClasses.
778
778
  */
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));
779
+ #i(e) {
780
+ e.querySelectorAll(".tbw-select-row-checkbox").forEach((i) => {
781
+ const r = i.closest(".cell"), o = r ? R(r) : -1;
782
+ o >= 0 && (i.checked = this.selected.has(o));
783
783
  });
784
784
  const s = e.querySelector(".tbw-select-all-checkbox");
785
785
  if (s) {
786
- const r = this.rows.length;
787
- let n = 0;
786
+ const i = this.rows.length;
787
+ let r = 0;
788
788
  if (this.config.isSelectable)
789
- for (let d = 0; d < r; d++)
790
- this.isRowSelectable(d) && n++;
789
+ for (let d = 0; d < i; d++)
790
+ this.isRowSelectable(d) && r++;
791
791
  else
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;
792
+ r = i;
793
+ const o = r > 0 && this.selected.size >= r, l = this.selected.size > 0;
794
+ s.checked = o, s.indeterminate = l && !o;
795
795
  }
796
796
  }
797
797
  // #endregion
@@ -802,7 +802,7 @@ class L extends v {
802
802
  * Only updates when the focus has changed since the last sync.
803
803
  * Skips when `explicitSelection` is set (click/keyboard set selection directly).
804
804
  */
805
- #i(e) {
805
+ #r(e) {
806
806
  const t = this.grid._focusRow, s = this.grid._focusCol;
807
807
  if (e === "row") {
808
808
  if (this.explicitSelection) {
@@ -817,8 +817,8 @@ class L extends v {
817
817
  return;
818
818
  }
819
819
  if ((t !== this.lastSyncedFocusRow || s !== this.lastSyncedFocusCol) && (this.lastSyncedFocusRow = t, this.lastSyncedFocusCol = s, this.isCellSelectable(t, s))) {
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()));
820
+ const i = this.selectedCell;
821
+ (!i || i.row !== t || i.col !== s) && (this.selectedCell = { row: t, col: s }, this.emit("selection-change", this.#e()));
822
822
  }
823
823
  }
824
824
  }
@@ -830,22 +830,22 @@ class L extends v {
830
830
  const e = this.gridElement;
831
831
  if (!e) return;
832
832
  const { mode: t } = this.config, s = !!this.config.isSelectable;
833
- e.querySelectorAll(".cell").forEach((i) => {
834
- i.classList.remove("selected", "top", "bottom", "first", "last"), s && i.removeAttribute("data-selectable");
833
+ e.querySelectorAll(".cell").forEach((o) => {
834
+ o.classList.remove("selected", "top", "bottom", "first", "last"), s && o.removeAttribute("data-selectable");
835
835
  });
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) => {
836
+ const r = e.querySelectorAll(".data-grid-row");
837
+ if (r.forEach((o) => {
838
+ o.classList.remove("selected", "row-focus"), s && o.removeAttribute("data-selectable");
839
+ }), t === "row" && (C(e), r.forEach((o) => {
840
+ const l = o.querySelector(".cell[data-row]"), d = R(l);
841
+ d >= 0 && (s && !this.isRowSelectable(d) && o.setAttribute("data-selectable", "false"), this.selected.has(d) && o.classList.add("selected", "row-focus"));
842
+ }), this.config.checkbox && this.#i(e)), (t === "cell" || t === "range") && s && e.querySelectorAll(".cell[data-row][data-col]").forEach((l) => {
843
843
  const d = parseInt(l.getAttribute("data-row") ?? "-1", 10), a = parseInt(l.getAttribute("data-col") ?? "-1", 10);
844
844
  d >= 0 && a >= 0 && (this.isCellSelectable(d, a) || l.setAttribute("data-selectable", "false"));
845
845
  }), t === "range" && this.ranges.length > 0) {
846
846
  C(e);
847
- const i = this.ranges.map(g), l = (a, h) => {
848
- for (const c of i)
847
+ const o = this.ranges.map(g), l = (a, h) => {
848
+ for (const c of o)
849
849
  if (a >= c.startRow && a <= c.endRow && h >= c.startCol && h <= c.endCol)
850
850
  return !0;
851
851
  return !1;
@@ -868,16 +868,16 @@ class L extends v {
868
868
  if (!e) return;
869
869
  const t = e.children[0], { mode: s } = this.config;
870
870
  if (this.pendingKeyboardUpdate && s === "range") {
871
- const { shiftKey: r } = this.pendingKeyboardUpdate;
871
+ const { shiftKey: i } = this.pendingKeyboardUpdate;
872
872
  this.pendingKeyboardUpdate = null;
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 });
873
+ const r = this.grid._focusRow, o = this.grid._focusCol;
874
+ if (i && this.cellAnchor) {
875
+ const l = m(this.cellAnchor, { row: r, col: o });
876
876
  this.ranges = [l], this.activeRange = l;
877
- } else r || (this.ranges = [], this.activeRange = null, this.cellAnchor = { row: n, col: i });
877
+ } else i || (this.ranges = [], this.activeRange = null, this.cellAnchor = { row: r, col: o });
878
878
  this.emit("selection-change", this.#e());
879
879
  }
880
- this.#i(s), this.grid.setAttribute("data-selection-mode", s), t && t.classList.toggle("selecting", this.isDragging), this.#s();
880
+ this.#r(s), this.grid.setAttribute("data-selection-mode", s), t && t.classList.toggle("selecting", this.isDragging), this.#s();
881
881
  }
882
882
  /**
883
883
  * Called after scroll-triggered row rendering.
@@ -946,13 +946,13 @@ class L extends v {
946
946
  } else if (e === "range") {
947
947
  const t = this.rows.length, s = this.columns.length;
948
948
  if (t > 0 && s > 0) {
949
- const r = {
949
+ const i = {
950
950
  startRow: 0,
951
951
  startCol: 0,
952
952
  endRow: t - 1,
953
953
  endCol: s - 1
954
954
  };
955
- this.ranges = [r], this.activeRange = r, this.emit("selection-change", this.#e()), this.requestAfterRender();
955
+ this.ranges = [i], this.activeRange = i, this.emit("selection-change", this.#e()), this.requestAfterRender();
956
956
  }
957
957
  }
958
958
  }
@@ -1007,7 +1007,7 @@ class L extends v {
1007
1007
  endCol: t.to.col
1008
1008
  })), this.activeRange = this.ranges.length > 0 ? this.ranges[this.ranges.length - 1] : null, this.emit("selection-change", {
1009
1009
  mode: this.config.mode,
1010
- ranges: y(this.ranges)
1010
+ ranges: S(this.ranges)
1011
1011
  }), this.requestAfterRender();
1012
1012
  }
1013
1013
  // #endregion