e-virt-table 1.2.32 → 1.2.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.
package/dist/index.es.js CHANGED
@@ -66,7 +66,7 @@ function Dt() {
66
66
  return (c === "x" ? t : t & 3 | 8).toString(16);
67
67
  });
68
68
  }
69
- function j(c, t) {
69
+ function Z(c, t) {
70
70
  let e = 0, i;
71
71
  return function(...s) {
72
72
  const o = (/* @__PURE__ */ new Date()).getTime(), r = o - e, a = typeof t == "function" ? t() : t;
@@ -364,6 +364,7 @@ class ut extends Bt {
364
364
  n(this, "drawCellBgColor", "");
365
365
  n(this, "drawCellSkyBgColor", "");
366
366
  n(this, "drawTextColor", "");
367
+ n(this, "drawTextFont", "");
367
368
  n(this, "drawTextX", 0);
368
369
  n(this, "drawTextY", 0);
369
370
  n(this, "drawTextWidth", 0);
@@ -521,7 +522,7 @@ class ut extends Bt {
521
522
  return;
522
523
  const l = this.ctx.database.getRowForRowKey(i), { expand: h = !1, hasChildren: d = !1, expandLoading: f = !1, level: u = 0 } = l || {};
523
524
  this.rowExpand = h, this.rowHasChildren = d;
524
- const { TREE_INDENT: x = 16, CHECKBOX_SIZE: w, TREE_ICON_SIZE: E } = this.ctx.config;
525
+ const { TREE_INDENT: x = 16, CHECKBOX_SIZE: w, TREE_ICON_SIZE: m } = this.ctx.config;
525
526
  if (r = u * x, f) {
526
527
  const I = this.ctx.icons.get("loading");
527
528
  a = "loading", o = I;
@@ -529,10 +530,10 @@ class ut extends Bt {
529
530
  const I = this.ctx.icons.get("expand"), _ = this.ctx.icons.get("shrink");
530
531
  o = h ? _ : I, a = h ? "shrink" : "expand";
531
532
  }
532
- let g = E, m = E, y = this.drawX;
533
+ let g = m, E = m, y = this.drawX;
533
534
  (this.align === "center" || this.align === "right") && (y = this.drawX + (this.visibleWidth - g - 2 * e) / 2, this.align = "left");
534
- let p = y + r + e, R = this.drawY + (this.visibleHeight - m) / 2, C = r + this.drawX + g - 0.5;
535
- this.type === "selection-tree" ? (p = r + this.drawSelectionImageX + this.drawSelectionImageWidth, C = p + g - e / 2) : this.type === "tree-selection" ? C = p + w + g - e / 2 : C = p + g - e / 2, this.drawTextX = C, this.drawTextWidth = this.drawX + this.visibleWidth - C, !(p + g + e > this.drawX + this.visibleWidth) && (R + m + e > this.drawY + this.visibleHeight || (this.drawTreeImageX = p, this.drawTreeImageY = R, this.drawTreeImageWidth = g, this.drawTreeImageHeight = m, o ? (this.drawTreeImageName = a, this.drawTreeImageSource = o) : (this.drawTreeImageName = "", this.drawTreeImageSource = void 0)));
535
+ let p = y + r + e, b = this.drawY + (this.visibleHeight - E) / 2, C = r + this.drawX + g - 0.5;
536
+ this.type === "selection-tree" ? (p = r + this.drawSelectionImageX + this.drawSelectionImageWidth, C = p + g - e / 2) : this.type === "tree-selection" ? C = p + w + g - e / 2 : C = p + g - e / 2, this.drawTextX = C, this.drawTextWidth = this.drawX + this.visibleWidth - C, !(p + g + e > this.drawX + this.visibleWidth) && (b + E + e > this.drawY + this.visibleHeight || (this.drawTreeImageX = p, this.drawTreeImageY = b, this.drawTreeImageWidth = g, this.drawTreeImageHeight = E, o ? (this.drawTreeImageName = a, this.drawTreeImageSource = o) : (this.drawTreeImageName = "", this.drawTreeImageSource = void 0)));
536
537
  }
537
538
  drawTreeLine() {
538
539
  const { TREE_LINE: e, TREE_INDENT: i = 16, TREE_ICON_SIZE: s = 16, TREE_LINE_COLOR: o = "#e1e6eb" } = this.ctx.config;
@@ -542,10 +543,10 @@ class ut extends Bt {
542
543
  const f = Array.isArray(r.parentRowKeys) ? r.parentRowKeys : [];
543
544
  if (a > 0) {
544
545
  for (let g = 0; g < a - 1; g += 1) {
545
- const m = f[g + 1];
546
- if (!!(m ? this.ctx.database.getRowForRowKey(m) || {} : {}).isLastChild) continue;
547
- const R = Math.round(this.drawTreeImageX - (a - g) * i + s / 2);
548
- this.ctx.paint.drawLine([R, this.drawY, R, this.drawY + this.visibleHeight], {
546
+ const E = f[g + 1];
547
+ if (!!(E ? this.ctx.database.getRowForRowKey(E) || {} : {}).isLastChild) continue;
548
+ const b = Math.round(this.drawTreeImageX - (a - g) * i + s / 2);
549
+ this.ctx.paint.drawLine([b, this.drawY, b, this.drawY + this.visibleHeight], {
549
550
  borderColor: o,
550
551
  borderWidth: 1,
551
552
  lineDash: [4, 4],
@@ -559,8 +560,8 @@ class ut extends Bt {
559
560
  lineDash: [4, 4],
560
561
  lineDashOffset: 0
561
562
  });
562
- const E = Math.round(d + (a - 1) * i + s / 2);
563
- this.ctx.paint.drawLine([E, h, l, h], {
563
+ const m = Math.round(d + (a - 1) * i + s / 2);
564
+ this.ctx.paint.drawLine([m, h, l, h], {
564
565
  borderColor: o,
565
566
  borderWidth: 1,
566
567
  lineDash: [4, 4],
@@ -592,34 +593,34 @@ class ut extends Bt {
592
593
  HIGHLIGHT_HOVER_ROW: u,
593
594
  HIGHLIGHT_HOVER_ROW_COLOR: x,
594
595
  STRIPE: w,
595
- STRIPE_COLOR: E
596
+ STRIPE_COLOR: m
596
597
  } = this.ctx.config;
597
598
  if (this.cellType === "footer") {
598
- let _ = h, v = l;
599
+ let _ = h, T = l;
599
600
  if (typeof o == "function") {
600
- const S = o, { backgroundColor: b, color: O } = S({
601
+ const S = o, { backgroundColor: R, color: v, font: O } = S({
601
602
  row: this.row,
602
603
  rowIndex: this.rowIndex,
603
604
  colIndex: this.colIndex,
604
605
  column: this.column,
605
606
  value: this.getValue()
606
607
  }) || {};
607
- b && (_ = b), O && (v = O);
608
+ R && (_ = R), v && (T = v), O && (this.drawTextFont = O);
608
609
  }
609
- this.drawCellSkyBgColor = "transparent", this.drawCellBgColor = _, this.drawTextColor = v;
610
+ this.drawCellSkyBgColor = "transparent", this.drawCellBgColor = _, this.drawTextColor = T;
610
611
  return;
611
612
  }
612
613
  let g = "transparent";
613
- const m = this.ctx.hoverCell, y = this.ctx.currentCell;
614
- let p = this.rowIndex, R = this.rowIndex;
614
+ const E = this.ctx.hoverCell, y = this.ctx.currentCell;
615
+ let p = this.rowIndex, b = this.rowIndex;
615
616
  if (this.rowspan !== 1 && (u || d)) {
616
- const _ = this.getSpanInfo(), { yArr: v } = _;
617
- p = v[0], R = v[1];
617
+ const _ = this.getSpanInfo(), { yArr: T } = _;
618
+ p = T[0], b = T[1];
618
619
  }
619
- u && m && (m.rowKey === this.rowKey && (g = x), m.rowIndex >= p && m.rowIndex <= R && (g = x)), d && y && (y.rowKey === this.rowKey && (g = f), y.rowIndex >= p && y.rowIndex <= R && (g = f)), this.drawCellSkyBgColor = g;
620
+ u && E && (E.rowKey === this.rowKey && (g = x), E.rowIndex >= p && E.rowIndex <= b && (g = x)), d && y && (y.rowKey === this.rowKey && (g = f), y.rowIndex >= p && y.rowIndex <= b && (g = f)), this.drawCellSkyBgColor = g;
620
621
  let C = e, I = a;
621
- if (this.ctx.database.getReadonly(this.rowKey, this.key) || (C = i, I = r), w && (this.rowIndex % 2 ? C = E : C = e), typeof s == "function") {
622
- const _ = s, { backgroundColor: v, color: S } = _({
622
+ if (this.ctx.database.getReadonly(this.rowKey, this.key) || (C = i, I = r), w && (this.rowIndex % 2 ? C = m : C = e), typeof s == "function") {
623
+ const _ = s, { backgroundColor: T, color: S, font: R } = _({
623
624
  row: this.row,
624
625
  rowIndex: this.rowIndex,
625
626
  colIndex: this.colIndex,
@@ -627,7 +628,7 @@ class ut extends Bt {
627
628
  isHasChanged: this.isHasChanged,
628
629
  value: this.getValue()
629
630
  }) || {};
630
- v && (C = v), S && (I = S);
631
+ T && (C = T), S && (I = S), R && (this.drawTextFont = R);
631
632
  }
632
633
  this.drawCellBgColor = C, this.drawTextColor = I;
633
634
  }
@@ -638,22 +639,22 @@ class ut extends Bt {
638
639
  const d = this.ctx.database.getRowSelectable(h), { CHECKBOX_SIZE: f = 0, CELL_PADDING: u } = this.ctx.config;
639
640
  let x = this.drawX + u;
640
641
  (this.align === "center" || this.align === "right") && (x = this.drawX + (e - f) / 2);
641
- let w = x, E = this.drawY + (i - f) / 2;
642
+ let w = x, m = this.drawY + (i - f) / 2;
642
643
  if (a !== "selection-tree") {
643
644
  if (a === "tree-selection") {
644
- const { TREE_INDENT: y = 16, TREE_ICON_SIZE: p } = this.ctx.config, R = this.ctx.database.getRowForRowKey(h), { level: C = 0 } = R || {}, I = C * y;
645
+ const { TREE_INDENT: y = 16, TREE_ICON_SIZE: p } = this.ctx.config, b = this.ctx.database.getRowForRowKey(h), { level: C = 0 } = b || {}, I = C * y;
645
646
  w = x + p + I;
646
647
  }
647
648
  }
648
- let g = this.ctx.icons.get("checkbox-uncheck"), m = "checkbox-uncheck";
649
+ let g = this.ctx.icons.get("checkbox-uncheck"), E = "checkbox-uncheck";
649
650
  if (a === "selection-tree" || a === "tree-selection") {
650
651
  const y = this.ctx.database.getTreeSelectionState(h);
651
- y.indeterminate && d ? (g = this.ctx.icons.get("checkbox-indeterminate"), m = "checkbox-indeterminate") : y.checked && d ? (g = this.ctx.icons.get("checkbox-check"), m = "checkbox-check") : !y.checked && d ? (g = this.ctx.icons.get("checkbox-uncheck"), m = "checkbox-uncheck") : (g = this.ctx.icons.get("checkbox-disabled"), m = "checkbox-disabled");
652
+ y.indeterminate && d ? (g = this.ctx.icons.get("checkbox-indeterminate"), E = "checkbox-indeterminate") : y.checked && d ? (g = this.ctx.icons.get("checkbox-check"), E = "checkbox-check") : !y.checked && d ? (g = this.ctx.icons.get("checkbox-uncheck"), E = "checkbox-uncheck") : (g = this.ctx.icons.get("checkbox-disabled"), E = "checkbox-disabled");
652
653
  } else {
653
654
  const y = this.ctx.database.getRowSelection(h);
654
- y && d ? (g = this.ctx.icons.get("checkbox-check"), m = "checkbox-check") : y && !d ? (g = this.ctx.icons.get("checkbox-check-disabled"), m = "checkbox-check-disabled") : !y && d ? (g = this.ctx.icons.get("checkbox-uncheck"), m = "checkbox-uncheck") : (g = this.ctx.icons.get("checkbox-disabled"), m = "checkbox-disabled");
655
+ y && d ? (g = this.ctx.icons.get("checkbox-check"), E = "checkbox-check") : y && !d ? (g = this.ctx.icons.get("checkbox-check-disabled"), E = "checkbox-check-disabled") : !y && d ? (g = this.ctx.icons.get("checkbox-uncheck"), E = "checkbox-uncheck") : (g = this.ctx.icons.get("checkbox-disabled"), E = "checkbox-disabled");
655
656
  }
656
- w + f + u > this.drawX + this.visibleWidth || E + f + u > this.drawY + this.visibleHeight || (a === "index-selection" ? (this.ctx.hoverCell && this.ctx.hoverCell.rowIndex === l || ["checkbox-disabled", "checkbox-check"].includes(m)) && (this.drawSelectionImageX = w, this.drawSelectionImageY = E, this.drawSelectionImageWidth = f, this.drawSelectionImageHeight = f, this.drawSelectionImageName = m, this.drawSelectionImageSource = g) : (this.drawSelectionImageX = w, this.drawSelectionImageY = E, this.drawSelectionImageWidth = f, this.drawSelectionImageHeight = f, this.drawSelectionImageName = m, this.drawSelectionImageSource = g));
657
+ w + f + u > this.drawX + this.visibleWidth || m + f + u > this.drawY + this.visibleHeight || (a === "index-selection" ? (this.ctx.hoverCell && this.ctx.hoverCell.rowIndex === l || ["checkbox-disabled", "checkbox-check"].includes(E)) && (this.drawSelectionImageX = w, this.drawSelectionImageY = m, this.drawSelectionImageWidth = f, this.drawSelectionImageHeight = f, this.drawSelectionImageName = E, this.drawSelectionImageSource = g) : (this.drawSelectionImageX = w, this.drawSelectionImageY = m, this.drawSelectionImageWidth = f, this.drawSelectionImageHeight = f, this.drawSelectionImageName = E, this.drawSelectionImageSource = g));
657
658
  }
658
659
  updateHoverIcon() {
659
660
  if (this.ctx.database.getReadonly(this.rowKey, this.key))
@@ -675,8 +676,8 @@ class ut extends Bt {
675
676
  if (a.rowKey === this.rowKey && (l = this.drawX + this.width - s - o, h = this.drawY + (this.height - s) / 2), this.rowspan !== 1 && r) {
676
677
  const f = this.getSpanInfo(), { yArr: u } = f, x = u[0], w = u[1];
677
678
  if (a.rowIndex >= x && a.rowIndex <= w) {
678
- const { width: E, height: g, offsetTop: m, offsetLeft: y } = f;
679
- l = this.drawX - y + E - s - o, h = this.drawY - m + (g - s) / 2;
679
+ const { width: m, height: g, offsetTop: E, offsetLeft: y } = f;
680
+ l = this.drawX - y + m - s - o, h = this.drawY - E + (g - s) / 2;
680
681
  }
681
682
  }
682
683
  const d = this.ctx.icons.get(this.hoverIconName);
@@ -696,8 +697,8 @@ class ut extends Bt {
696
697
  }
697
698
  if (!(this.displayText && typeof this.displayText == "string"))
698
699
  return 0;
699
- const { BODY_FONT: e, CELL_PADDING: i, CELL_LINE_HEIGHT: s } = this.ctx.config, o = `${this.displayText}_${this.drawTextWidth}`, r = this.ctx.paint.calculateTextHeight(this.displayText, this.drawTextWidth, {
700
- font: e,
700
+ const { BODY_FONT: e, CELL_PADDING: i, CELL_LINE_HEIGHT: s } = this.ctx.config, o = `${this.displayText}_${this.drawTextWidth}_${this.drawTextFont}`, r = this.ctx.paint.calculateTextHeight(this.displayText, this.drawTextWidth, {
701
+ font: this.drawTextFont || e,
701
702
  padding: i,
702
703
  align: this.align,
703
704
  verticalAlign: this.verticalAlign,
@@ -805,8 +806,8 @@ class ut extends Bt {
805
806
  return;
806
807
  const { xArr: r, yArr: a } = this.ctx.selector, l = r[1], h = a[1], { colIndex: d, rowIndex: f, drawX: u, drawY: x } = this;
807
808
  if (d === l && f === h) {
808
- const E = d === this.ctx.maxColIndex || f === this.ctx.maxRowIndex || d === this.ctx.lastCenterColIndex ? 6 : 4;
809
- this.ctx.paint.drawRect(u + this.width - E, x + this.height - E, 6, 6, {
809
+ const m = d === this.ctx.maxColIndex || f === this.ctx.maxRowIndex || d === this.ctx.lastCenterColIndex ? 6 : 4;
810
+ this.ctx.paint.drawRect(u + this.width - m, x + this.height - m, 6, 6, {
810
811
  borderColor: o,
811
812
  fillColor: e
812
813
  });
@@ -835,7 +836,7 @@ class ut extends Bt {
835
836
  if (!this.ctx.database.getReadonly(this.rowKey, this.key) && r && ["", null, void 0].includes(this.text) && this.cellType === "body" && !(this.rowspan === 0 || this.colspan === 0) && (a = r, l = s), ["", null, void 0].includes(a))
836
837
  return !1;
837
838
  typeof a != "string" && (a = `${a}`);
838
- const d = `${a}_${this.drawTextWidth}`;
839
+ const d = `${a}_${this.drawTextWidth}_${this.drawTextFont}`;
839
840
  return this.ellipsis = this.ctx.paint.drawText(
840
841
  a,
841
842
  this.drawTextX,
@@ -843,7 +844,7 @@ class ut extends Bt {
843
844
  this.drawTextWidth,
844
845
  this.drawTextHeight,
845
846
  {
846
- font: i,
847
+ font: this.drawTextFont || i,
847
848
  padding: e,
848
849
  align: this.align,
849
850
  verticalAlign: this.verticalAlign,
@@ -949,11 +950,11 @@ class ut extends Bt {
949
950
  drawBorder(e) {
950
951
  const { drawX: i, drawY: s, rowIndex: o, colIndex: r, height: a, width: l } = this;
951
952
  let h = i, d = s;
952
- const { xArr: f, yArr: u, lineDash: x = [], borderWidth: w = 1, borderColor: E, fillColor: g } = e, m = f[0], y = f[1], p = u[0], R = u[1];
953
- if (r >= m && r <= y && o === p) {
954
- const C = r === y ? 1 : 0, I = r === m ? 1 : 0;
953
+ const { xArr: f, yArr: u, lineDash: x = [], borderWidth: w = 1, borderColor: m, fillColor: g } = e, E = f[0], y = f[1], p = u[0], b = u[1];
954
+ if (r >= E && r <= y && o === p) {
955
+ const C = r === y ? 1 : 0, I = r === E ? 1 : 0;
955
956
  this.ctx.paint.drawLine([h + I, d + 1, h + l - C, d + 1], {
956
- borderColor: E,
957
+ borderColor: m,
957
958
  fillColor: g,
958
959
  borderWidth: w,
959
960
  lineCap: "round",
@@ -961,10 +962,10 @@ class ut extends Bt {
961
962
  lineDash: x
962
963
  });
963
964
  }
964
- if (r === y && o >= p && o <= R) {
965
- const C = o === p ? 1 : 0, I = o === R ? 1 : 0;
965
+ if (r === y && o >= p && o <= b) {
966
+ const C = o === p ? 1 : 0, I = o === b ? 1 : 0;
966
967
  this.ctx.paint.drawLine([h + l - 1, d + C, h + l - 1, d + a - I], {
967
- borderColor: E,
968
+ borderColor: m,
968
969
  fillColor: g,
969
970
  borderWidth: w,
970
971
  lineCap: "round",
@@ -972,10 +973,10 @@ class ut extends Bt {
972
973
  lineDash: x
973
974
  });
974
975
  }
975
- if (r >= m && r <= y && o === R) {
976
- const C = r === y ? 1 : 0, I = r === m ? 1 : 0;
976
+ if (r >= E && r <= y && o === b) {
977
+ const C = r === y ? 1 : 0, I = r === E ? 1 : 0;
977
978
  this.ctx.paint.drawLine([h + I, d + a - 1, h + l - C, d + a - 1], {
978
- borderColor: E,
979
+ borderColor: m,
979
980
  fillColor: g,
980
981
  borderWidth: w,
981
982
  lineCap: "round",
@@ -983,10 +984,10 @@ class ut extends Bt {
983
984
  lineDash: x
984
985
  });
985
986
  }
986
- if (r === m && o >= p && o <= R) {
987
- const C = o === R ? 1 : 0, I = o === p ? 1 : 0;
987
+ if (r === E && o >= p && o <= b) {
988
+ const C = o === b ? 1 : 0, I = o === p ? 1 : 0;
988
989
  this.ctx.paint.drawLine([h + 1, d + I, h + 1, d + a - C], {
989
- borderColor: E,
990
+ borderColor: m,
990
991
  fillColor: g,
991
992
  borderWidth: w,
992
993
  lineCap: "round",
@@ -1059,13 +1060,13 @@ class ge {
1059
1060
  var y;
1060
1061
  const { ROW_KEY: a = "", DEFAULT_EXPAND_ALL: l, CELL_HEIGHT: h, SELECTABLE_METHOD: d, CHECKBOX_KEY: f } = this.ctx.config, u = o[a], x = u != null ? `${u}` : Dt();
1061
1062
  this.itemRowKeyMap.set(o, x);
1062
- const w = o._height || h, E = o._readonly;
1063
+ const w = o._height || h, m = o._readonly;
1063
1064
  let g = !0;
1064
1065
  if (typeof d == "function" && (g = d), f) {
1065
1066
  const p = o[f];
1066
1067
  if (this.checkboxKeyMap.has(p)) {
1067
- const R = this.checkboxKeyMap.get(p) || [];
1068
- R.push(x), this.checkboxKeyMap.set(p, R);
1068
+ const b = this.checkboxKeyMap.get(p) || [];
1069
+ b.push(x), this.checkboxKeyMap.set(p, b);
1069
1070
  } else
1070
1071
  this.checkboxKeyMap.set(p, [x]);
1071
1072
  }
@@ -1074,9 +1075,9 @@ class ge {
1074
1075
  row: o,
1075
1076
  check: ((y = this.selectionMap.get(x)) == null ? void 0 : y.check) || !1
1076
1077
  });
1077
- const m = l || this.expandMap.get(x) || o._expand || !1;
1078
- this.expandMap.set(x, m), this.rowKeyMap.set(x, {
1079
- readonly: E,
1078
+ const E = l || this.expandMap.get(x) || o._expand || !1;
1079
+ this.expandMap.set(x, E), this.rowKeyMap.set(x, {
1080
+ readonly: m,
1080
1081
  index: r,
1081
1082
  rowIndex: r,
1082
1083
  level: e,
@@ -1084,7 +1085,7 @@ class ge {
1084
1085
  calculatedHeight: -1,
1085
1086
  check: !1,
1086
1087
  selectable: g,
1087
- expand: m,
1088
+ expand: E,
1088
1089
  expandLazy: !1,
1089
1090
  hasChildren: o._hasChildren || (Array.isArray(o.children) ? o.children.length > 0 : !1),
1090
1091
  expandLoading: !1,
@@ -1381,17 +1382,17 @@ class ge {
1381
1382
  let o = [], r = i;
1382
1383
  const a = /* @__PURE__ */ new Set();
1383
1384
  let l = [], h = t.map((x) => {
1384
- const { rowKey: w, key: E } = x;
1385
- let g = x.value, m = g;
1386
- const y = this.getRowDataItemForRowKey(w), p = this.getItemValue(w, E), R = this.getVirtualBodyCellByKey(w, E);
1387
- return (R == null ? void 0 : R.type) === "number" && (["", void 0, null].includes(g) ? m = null : /^-?\d+(\.\d+)?$/.test(`${g}`) ? m = Number(g) : (m = p, l.push({
1385
+ const { rowKey: w, key: m } = x;
1386
+ let g = x.value, E = g;
1387
+ const y = this.getRowDataItemForRowKey(w), p = this.getItemValue(w, m), b = this.getVirtualBodyCellByKey(w, m);
1388
+ return (b == null ? void 0 : b.type) === "number" && (["", void 0, null].includes(g) ? E = null : /^-?\d+(\.\d+)?$/.test(`${g}`) ? E = Number(g) : (E = p, l.push({
1388
1389
  ...x,
1389
- value: m,
1390
+ value: E,
1390
1391
  oldValue: p,
1391
1392
  row: y
1392
1393
  }))), {
1393
1394
  ...x,
1394
- value: m,
1395
+ value: E,
1395
1396
  oldValue: p,
1396
1397
  row: y
1397
1398
  };
@@ -1408,11 +1409,11 @@ class ge {
1408
1409
  return;
1409
1410
  const { BEFORE_VALUE_CHANGE_METHOD: d } = this.ctx.config;
1410
1411
  s === "none" && typeof d == "function" && (h = await d(h), r = !1), h.forEach((x) => {
1411
- const { value: w, rowKey: E, key: g } = x, m = this.getItemValue(E, g);
1412
- a.add(E), this.setItemValue(E, g, w, !1, !1, !1, r), o.push({
1413
- rowKey: E,
1412
+ const { value: w, rowKey: m, key: g } = x, E = this.getItemValue(m, g);
1413
+ a.add(m), this.setItemValue(m, g, w, !1, !1, !1, r), o.push({
1414
+ rowKey: m,
1414
1415
  key: g,
1415
- oldValue: m,
1416
+ oldValue: E,
1416
1417
  newValue: w
1417
1418
  });
1418
1419
  });
@@ -1484,7 +1485,7 @@ class ge {
1484
1485
  oldValue: h,
1485
1486
  newValue: h
1486
1487
  };
1487
- let E = [
1488
+ let m = [
1488
1489
  {
1489
1490
  rowKey: t,
1490
1491
  key: e,
@@ -1493,7 +1494,7 @@ class ge {
1493
1494
  row: x
1494
1495
  }
1495
1496
  ];
1496
- this.batchSetItemValue(E, s, !1), this.ctx.emit("editChange", {
1497
+ this.batchSetItemValue(m, s, !1), this.ctx.emit("editChange", {
1497
1498
  rowKey: t,
1498
1499
  key: e,
1499
1500
  oldValue: h,
@@ -1571,13 +1572,13 @@ class ge {
1571
1572
  // 递归选中树形选择
1572
1573
  selectTreeSelectionRecursive(t) {
1573
1574
  this.getTreeChildren(t).forEach((i) => {
1574
- this.setRowSelection(i, !0, !1), this.selectTreeSelectionRecursive(i);
1575
+ this.setRowSelectionByParent(i, !0), this.selectTreeSelectionRecursive(i);
1575
1576
  });
1576
1577
  }
1577
1578
  // 递归取消树形选择
1578
1579
  clearTreeSelectionRecursive(t) {
1579
1580
  this.getTreeChildren(t).forEach((i) => {
1580
- this.setRowSelection(i, !1, !1), this.clearTreeSelectionRecursive(i);
1581
+ this.setRowSelectionByParent(i, !1), this.clearTreeSelectionRecursive(i);
1581
1582
  });
1582
1583
  }
1583
1584
  // 向上递归更新父项状态
@@ -1599,6 +1600,10 @@ class ge {
1599
1600
  const s = this.selectionMap.get(t);
1600
1601
  s && (s.check = e, this.setRowSelectionByCheckboxKey(t, s.check), this.ctx.emit("setRowSelection", e, s.row), (this.ctx.config.TREE_SELECT_MODE === "auto" || this.ctx.config.TREE_SELECT_MODE === "cautious") && this.updateParentTreeSelection(t), i && (this.bufferCheckState.buffer = !1, this.ctx.emit("draw")));
1601
1602
  }
1603
+ setRowSelectionByParent(t, e) {
1604
+ const i = this.selectionMap.get(t);
1605
+ i && (i.check = e, this.setRowSelectionByCheckboxKey(t, i.check));
1606
+ }
1602
1607
  getSelectionRows() {
1603
1608
  let t = [];
1604
1609
  return this.selectionMap.forEach((e) => {
@@ -1623,22 +1628,22 @@ class ge {
1623
1628
  let r = !1, a = s;
1624
1629
  if (this.ctx.config.TREE_SELECT_MODE === "auto") {
1625
1630
  const h = (g) => {
1626
- const m = this.getTreeChildren(g);
1631
+ const E = this.getTreeChildren(g);
1627
1632
  let y = [];
1628
- for (const p of m)
1633
+ for (const p of E)
1629
1634
  y.push(p), y.push(...h(p));
1630
1635
  return y;
1631
1636
  }, f = h(t).map((g) => this.selectionMap.get(g)), u = f.filter((g) => g == null ? void 0 : g.check).length, x = f.length, w = u > 0;
1632
1637
  r = w && !(u === x), a = s || w, s && x > 0 && u === 0 && (a = !1, r = !1);
1633
1638
  } else if (this.ctx.config.TREE_SELECT_MODE === "cautious") {
1634
1639
  const h = (g) => {
1635
- const m = this.getTreeChildren(g);
1640
+ const E = this.getTreeChildren(g);
1636
1641
  let y = [];
1637
- for (const p of m)
1642
+ for (const p of E)
1638
1643
  y.push(p), y.push(...h(p));
1639
1644
  return y;
1640
- }, f = h(t).map((g) => this.selectionMap.get(g)), u = f.filter((g) => g == null ? void 0 : g.check).length, x = f.length, w = u > 0, E = u === x;
1641
- r = w && !E, a = s || E, s && x > 0 && u === 0 && (a = !1, r = !1);
1645
+ }, f = h(t).map((g) => this.selectionMap.get(g)), u = f.filter((g) => g == null ? void 0 : g.check).length, x = f.length, w = u > 0, m = u === x;
1646
+ r = w && !m, a = s || m, s && x > 0 && u === 0 && (a = !1, r = !1);
1642
1647
  } else this.ctx.config.TREE_SELECT_MODE === "strictly" && (r = !1, a = s);
1643
1648
  return { checked: a, indeterminate: r };
1644
1649
  }
@@ -1741,8 +1746,8 @@ class ge {
1741
1746
  let s = 0, o = 0;
1742
1747
  const r = this.selectionMap.size, a = Array.from(this.selectionMap.values()).some((u) => u.check);
1743
1748
  this.rowKeyMap.forEach((u, x) => {
1744
- var E;
1745
- (E = this.selectionMap.get(x)) != null && E.check && (s += 1);
1749
+ var m;
1750
+ (m = this.selectionMap.get(x)) != null && m.check && (s += 1);
1746
1751
  let w = u.selectable;
1747
1752
  typeof w == "function" && (w = w({
1748
1753
  row: u.item,
@@ -1926,7 +1931,7 @@ class ge {
1926
1931
  width: u,
1927
1932
  colspan: x,
1928
1933
  mergeRow: w,
1929
- mergeCol: E
1934
+ mergeCol: m
1930
1935
  } = t;
1931
1936
  if (d === 1 && x === 1)
1932
1937
  return {
@@ -1947,99 +1952,99 @@ class ge {
1947
1952
  }
1948
1953
  ]
1949
1954
  };
1950
- let g = e, m = e, y = a, p = a, R = [], C = 0, I = 0, _ = 0, v = 0;
1955
+ let g = e, E = e, y = a, p = a, b = [], C = 0, I = 0, _ = 0, T = 0;
1951
1956
  if (d !== 1 && w) {
1952
- v = u;
1953
- const S = l.reduce((b, O) => {
1954
- const T = this.getItemValue(s, O) ?? "";
1955
- return `${b}${T}`;
1957
+ T = u;
1958
+ const S = l.reduce((R, v) => {
1959
+ const O = this.getItemValue(s, v) ?? "";
1960
+ return `${R}${O}`;
1956
1961
  }, "");
1957
- for (let b = e - 1; b >= 0; b--) {
1958
- const O = this.rowIndexRowKeyMap.get(b) || "", T = l.reduce((M, L) => {
1959
- const A = this.getItemValue(O, L) ?? "";
1960
- return `${M}${A}`;
1962
+ for (let R = e - 1; R >= 0; R--) {
1963
+ const v = this.rowIndexRowKeyMap.get(R) || "", O = l.reduce((A, L) => {
1964
+ const M = this.getItemValue(v, L) ?? "";
1965
+ return `${A}${M}`;
1961
1966
  }, "");
1962
- if (S === T)
1963
- g = b;
1967
+ if (S === O)
1968
+ g = R;
1964
1969
  else
1965
1970
  break;
1966
1971
  }
1967
- for (let b = e; b <= this.ctx.maxRowIndex; b++) {
1968
- const O = this.rowIndexRowKeyMap.get(b) || "", T = l.reduce((M, L) => {
1969
- const A = this.getItemValue(O, L) ?? "";
1970
- return `${M}${A}`;
1972
+ for (let R = e; R <= this.ctx.maxRowIndex; R++) {
1973
+ const v = this.rowIndexRowKeyMap.get(R) || "", O = l.reduce((A, L) => {
1974
+ const M = this.getItemValue(v, L) ?? "";
1975
+ return `${A}${M}`;
1971
1976
  }, "");
1972
- if (S === T)
1973
- m = b;
1977
+ if (S === O)
1978
+ E = R;
1974
1979
  else
1975
1980
  break;
1976
1981
  }
1977
- for (let b = g; b < e; b++) {
1978
- const { height: O } = this.positions[b];
1979
- C += O;
1982
+ for (let R = g; R < e; R++) {
1983
+ const { height: v } = this.positions[R];
1984
+ C += v;
1980
1985
  }
1981
- for (let b = g; b <= m; b++) {
1982
- const { height: O } = this.positions[b];
1983
- _ += O;
1984
- const T = this.rowIndexRowKeyMap.get(b) || "", { item: M } = this.rowKeyMap.get(T), L = this.getItemValue(T, i);
1985
- R.push({
1986
- rowKey: T,
1986
+ for (let R = g; R <= E; R++) {
1987
+ const { height: v } = this.positions[R];
1988
+ _ += v;
1989
+ const O = this.rowIndexRowKeyMap.get(R) || "", { item: A } = this.rowKeyMap.get(O), L = this.getItemValue(O, i);
1990
+ b.push({
1991
+ rowKey: O,
1987
1992
  key: i,
1988
1993
  value: L,
1989
- row: M
1994
+ row: A
1990
1995
  });
1991
1996
  }
1992
1997
  }
1993
- if (x !== 1 && E) {
1998
+ if (x !== 1 && m) {
1994
1999
  _ = f;
1995
2000
  for (let S = a - 1; S >= 0; S--) {
1996
- const b = this.getColumnByColIndex(S);
1997
- if (!b)
2001
+ const R = this.getColumnByColIndex(S);
2002
+ if (!R)
1998
2003
  break;
1999
- const O = this.getItemValue(s, i), T = this.getItemValue(s, b.key);
2000
- if (O === T && h.includes(b.key))
2004
+ const v = this.getItemValue(s, i), O = this.getItemValue(s, R.key);
2005
+ if (v === O && h.includes(R.key))
2001
2006
  y = S;
2002
2007
  else
2003
2008
  break;
2004
2009
  }
2005
2010
  for (let S = a; S <= this.ctx.maxColIndex; S++) {
2006
- const b = this.getColumnByColIndex(S);
2007
- if (!b)
2011
+ const R = this.getColumnByColIndex(S);
2012
+ if (!R)
2008
2013
  break;
2009
- const O = this.getItemValue(s, i), T = this.getItemValue(s, b.key);
2010
- if (O === T && h.includes(b.key))
2014
+ const v = this.getItemValue(s, i), O = this.getItemValue(s, R.key);
2015
+ if (v === O && h.includes(R.key))
2011
2016
  p = S;
2012
2017
  else
2013
2018
  break;
2014
2019
  }
2015
2020
  for (let S = y; S < a; S++) {
2016
- const b = this.getColumnByColIndex(S);
2017
- if (!b)
2021
+ const R = this.getColumnByColIndex(S);
2022
+ if (!R)
2018
2023
  break;
2019
- I += b.width || 100;
2024
+ I += R.width || 100;
2020
2025
  }
2021
2026
  for (let S = y; S <= p; S++) {
2022
- const b = this.getColumnByColIndex(S);
2023
- if (!b)
2027
+ const R = this.getColumnByColIndex(S);
2028
+ if (!R)
2024
2029
  break;
2025
- v += b.width || 100, R.push({
2030
+ T += R.width || 100, b.push({
2026
2031
  rowKey: s,
2027
- key: b.key,
2028
- value: this.getItemValue(s, b.key),
2032
+ key: R.key,
2033
+ value: this.getItemValue(s, R.key),
2029
2034
  row: o
2030
2035
  });
2031
2036
  }
2032
2037
  }
2033
2038
  return {
2034
2039
  xArr: [y, p],
2035
- yArr: [g, m],
2040
+ yArr: [g, E],
2036
2041
  rowspan: d,
2037
2042
  colspan: x,
2038
2043
  height: _,
2039
- width: v,
2044
+ width: T,
2040
2045
  offsetTop: C,
2041
2046
  offsetLeft: I,
2042
- dataList: R
2047
+ dataList: b
2043
2048
  };
2044
2049
  }
2045
2050
  setValidationErrorByRowIndex(t, e, i) {
@@ -2177,14 +2182,14 @@ class we {
2177
2182
  this.history = [], this.historyIndex = -1;
2178
2183
  }
2179
2184
  }
2180
- class Ee {
2185
+ class me {
2181
2186
  constructor(t) {
2182
- n(this, "eventTasks", /* @__PURE__ */ new Map());
2187
+ n(this, "eventTasks", /* @__PURE__ */ new Set());
2183
2188
  n(this, "ctx");
2184
2189
  this.ctx = t, this.init();
2185
2190
  }
2186
2191
  init() {
2187
- this.bind(window, "resize", this.handleResize.bind(this)), this.bind(window, "mouseup", this.handleMouseUp.bind(this)), this.bind(window, "mousemove", this.handleMousemove.bind(this)), this.bind(window, "blur", this.handleOutsideMousedown.bind(this)), this.bind(window, "mousedown", this.handleOutsideMousedown.bind(this)), this.bind(this.ctx.stageElement, "click", this.handleClick.bind(this)), this.bind(window, "keydown", this.handleKeydown.bind(this)), this.bind(this.ctx.stageElement, "wheel", this.handleWheel.bind(this), { passive: !1 }), this.bind(this.ctx.stageElement, "touchstart", this.handleTouchstart.bind(this), { passive: !1 }), this.bind(this.ctx.stageElement, "touchend", this.handleTouchend.bind(this)), this.bind(this.ctx.stageElement, "touchmove", this.handleTouchmove.bind(this), { passive: !1 }), this.bind(this.ctx.stageElement, "contextmenu", this.handleContextMenu.bind(this)), this.bind(this.ctx.stageElement, "mousedown", this.handleMouseDown.bind(this)), this.bind(this.ctx.stageElement, "dblclick", this.handleDblclick.bind(this)), this.bind(this.ctx.stageElement, "mouseover", this.handleMouseover.bind(this)), this.bind(this.ctx.stageElement, "mouseout", this.handleMouseout.bind(this)), document.addEventListener("selectionchange", this.selectionchange.bind(this));
2192
+ this.bind(window, "resize", this.handleResize.bind(this)), this.bind(window, "mouseup", this.handleMouseUp.bind(this)), this.bind(window, "mousemove", this.handleMousemove.bind(this)), this.bind(window, "blur", this.handleOutsideMousedown.bind(this)), this.bind(window, "mousedown", this.handleOutsideMousedown.bind(this)), this.bind(this.ctx.stageElement, "click", this.handleClick.bind(this)), this.bind(window, "keydown", this.handleKeydown.bind(this)), this.bind(this.ctx.stageElement, "wheel", this.handleWheel.bind(this), { passive: !1 }), this.bind(this.ctx.stageElement, "touchstart", this.handleTouchstart.bind(this), { passive: !1 }), this.bind(this.ctx.stageElement, "touchend", this.handleTouchend.bind(this)), this.bind(this.ctx.stageElement, "touchmove", this.handleTouchmove.bind(this), { passive: !1 }), this.bind(this.ctx.stageElement, "contextmenu", this.handleContextMenu.bind(this)), this.bind(this.ctx.stageElement, "mousedown", this.handleMouseDown.bind(this)), this.bind(this.ctx.stageElement, "dblclick", this.handleDblclick.bind(this)), this.bind(this.ctx.stageElement, "mouseover", this.handleMouseover.bind(this)), this.bind(this.ctx.stageElement, "mouseout", this.handleMouseout.bind(this)), this.bind(document, "selectionchange", this.selectionchange.bind(this));
2188
2193
  }
2189
2194
  selectionchange() {
2190
2195
  this.ctx.domSelectionStr = "";
@@ -2196,9 +2201,9 @@ class Ee {
2196
2201
  t && !t.isCollapsed && t.removeAllRanges();
2197
2202
  }
2198
2203
  destroy() {
2199
- this.eventTasks.forEach((t, e) => {
2200
- this.unbind(window, e, t);
2201
- }), document.removeEventListener("selectionchange", this.selectionchange.bind(this)), this.eventTasks.clear();
2204
+ Array.from(this.eventTasks).forEach(({ target: e, name: i, fn: s, options: o }) => {
2205
+ this.unbind(e, i, s, o);
2206
+ }), this.eventTasks.clear();
2202
2207
  }
2203
2208
  handleResize(t) {
2204
2209
  this.ctx.emit("resetHeader", t), this.ctx.emit("resize", t);
@@ -2247,13 +2252,18 @@ class Ee {
2247
2252
  this.ctx.selector.enable && (t.target instanceof Window || t.target instanceof Node && !this.ctx.containerElement.contains(t.target)) && this.ctx.emit("outsideMousedown", t);
2248
2253
  }
2249
2254
  bind(t, e, i, s) {
2250
- t.addEventListener(e, i, s), this.eventTasks.set(e, i);
2255
+ t.addEventListener(e, i, s), this.eventTasks.add({ target: t, name: e, fn: i, options: s });
2251
2256
  }
2252
- unbind(t, e, i) {
2253
- t.removeEventListener(e, i), this.eventTasks.delete(e);
2257
+ unbind(t, e, i, s) {
2258
+ t.removeEventListener(e, i, s);
2259
+ for (const o of this.eventTasks)
2260
+ if (o.target === t && o.name === e && o.fn === i) {
2261
+ this.eventTasks.delete(o);
2262
+ break;
2263
+ }
2254
2264
  }
2255
2265
  }
2256
- class me {
2266
+ class Ee {
2257
2267
  constructor() {
2258
2268
  n(this, "events", /* @__PURE__ */ new Map());
2259
2269
  }
@@ -2387,7 +2397,7 @@ class pe {
2387
2397
  * @returns 是否溢出
2388
2398
  */
2389
2399
  drawText(t = "", e, i, s, o, r = {}) {
2390
- var O;
2400
+ var R;
2391
2401
  this.ctx.save();
2392
2402
  const {
2393
2403
  font: a = "12px Arial",
@@ -2398,48 +2408,46 @@ class pe {
2398
2408
  maxLineClamp: u = 1,
2399
2409
  autoRowHeight: x = !1,
2400
2410
  offsetLeft: w = 0,
2401
- offsetRight: E = 0
2411
+ offsetRight: m = 0
2402
2412
  } = r;
2403
2413
  if (this.ctx.font = a, this.ctx.fillStyle = h, this.ctx.textAlign = l, ["", null, void 0].includes(t))
2404
2414
  return this.ctx.restore(), !1;
2405
- const m = parseInt(((O = a.match(/\d+/)) == null ? void 0 : O[0]) || "12") * (r.lineHeight || 1.2), y = s - d * 2 - w - E, p = this.ctx.measureText("...").width;
2406
- let R = !1;
2407
- if (s <= p + d * 2 + w + E)
2408
- return this.ctx.restore(), R = !0, R;
2409
- const C = Math.round((o - 2 * d) / m);
2410
- let I = this.wrapText(t, y, r.cacheTextKey), _ = Math.min(I.length, Math.max(C, 1));
2411
- u === "auto" && x ? _ = I.length : typeof u == "number" && u < _ ? _ = u : (u === 1 && !x && (I = [t], _ = 1), u === "auto" && C === 1 && (I = [t], _ = 1));
2412
- let v = i + d;
2413
- const S = Math.round(_ * m);
2414
- f === "middle" ? v = i + (o - S) / 2 : f === "bottom" && (v = i + o - S - d);
2415
- let b = e + d + w;
2416
- l === "center" ? b = e + s / 2 : l === "right" && (b = e + s - d - E);
2417
- for (let T = 0; T < I.length; T++) {
2418
- const M = I[T], L = v + T * m;
2419
- if (this.ctx.textBaseline = "top", T === _ - 1) {
2420
- const { _text: A, ellipsis: D } = this.handleEllipsis(M, s, d, a);
2421
- this.ctx.fillText(A, b, L), R = D;
2415
+ const E = parseInt(((R = a.match(/\d+/)) == null ? void 0 : R[0]) || "12") * (r.lineHeight || 1.2), y = s - d * 2 - w - m;
2416
+ let p = !1;
2417
+ const b = Math.round((o - 2 * d) / E);
2418
+ let C = this.wrapText(t, y, r.cacheTextKey), I = Math.min(C.length, Math.max(b, 1));
2419
+ u === "auto" && x ? I = C.length : typeof u == "number" && u < I && u !== 1 ? I = u : (u === 1 && (C = [t], I = 1), u === "auto" && b === 1 && (C = [t], I = 1));
2420
+ let _ = i + d;
2421
+ const T = Math.round(I * E);
2422
+ f === "middle" ? _ = i + (o - T) / 2 : f === "bottom" && (_ = i + o - T - d);
2423
+ let S = e + d + w;
2424
+ l === "center" ? S = e + s / 2 : l === "right" && (S = e + s - d - m);
2425
+ for (let v = 0; v < C.length; v++) {
2426
+ const O = C[v], A = _ + v * E;
2427
+ if (this.ctx.textBaseline = "top", v === I - 1) {
2428
+ const M = C.slice(v).join(""), { _text: D, ellipsis: H } = this.handleEllipsis(M, s, d, a);
2429
+ this.ctx.fillText(D, S, A), p = H;
2422
2430
  break;
2423
2431
  }
2424
- this.ctx.fillText(M, b, L);
2432
+ this.ctx.fillText(O, S, A);
2425
2433
  }
2426
- if (r.textCallback && I.length) {
2427
- const T = Math.round(this.ctx.measureText(I[0]).width);
2428
- let M = b, L = b + T;
2429
- l === "center" ? (M = b - T / 2, L = b + T / 2) : l === "right" && (M = b - T, L = b);
2430
- const A = {
2431
- x: b,
2432
- y: v,
2433
- width: T,
2434
- height: S,
2435
- left: M,
2434
+ if (r.textCallback && C.length) {
2435
+ const v = C.reduce((D, H) => Math.max(D, this.ctx.measureText(H).width), 0), O = Math.round(v);
2436
+ let A = S, L = S + O;
2437
+ l === "center" ? (A = S - O / 2, L = S + O / 2) : l === "right" && (A = S - O, L = S);
2438
+ const M = {
2439
+ x: S,
2440
+ y: _,
2441
+ width: O,
2442
+ height: T,
2443
+ left: A,
2436
2444
  right: L,
2437
- top: v,
2438
- bottom: v + S
2445
+ top: _,
2446
+ bottom: _ + T
2439
2447
  };
2440
- r.textCallback(A);
2448
+ r.textCallback(M);
2441
2449
  }
2442
- return this.ctx.restore(), R;
2450
+ return this.ctx.restore(), p;
2443
2451
  }
2444
2452
  /**
2445
2453
  * 将文本按宽度换行
@@ -2466,13 +2474,6 @@ class pe {
2466
2474
  }
2467
2475
  h && s.push(h);
2468
2476
  }
2469
- if (s.length >= 1) {
2470
- const a = s[s.length - 1], { ellipsis: l } = this.handleEllipsis(a, e, 0, this.ctx.font);
2471
- if (l) {
2472
- const h = a.slice(0, -1);
2473
- s[s.length - 1] = h, s.push(a.slice(-1));
2474
- }
2475
- }
2476
2477
  const r = s.length > 0 ? s : [""];
2477
2478
  return i && this.textCacheMap.set(i, r), r;
2478
2479
  }
@@ -2484,7 +2485,7 @@ class pe {
2484
2485
  * @returns 计算出的高度
2485
2486
  */
2486
2487
  calculateTextHeight(t = "", e, i = {}) {
2487
- var E;
2488
+ var m;
2488
2489
  const {
2489
2490
  font: s = "12px Arial",
2490
2491
  padding: o = 0,
@@ -2494,7 +2495,7 @@ class pe {
2494
2495
  cacheTextKey: h = ""
2495
2496
  } = i;
2496
2497
  this.ctx.save(), this.ctx.font = s, this.ctx.fillStyle = a, this.ctx.textAlign = r;
2497
- const d = parseInt(((E = s.match(/\d+/)) == null ? void 0 : E[0]) || "12"), f = d * (i.lineHeight || 1.2), u = e - o * 2, x = this.wrapText(t, u, h);
2498
+ const d = parseInt(((m = s.match(/\d+/)) == null ? void 0 : m[0]) || "12"), f = d * (i.lineHeight || 1.2), u = e - o * 2, x = this.wrapText(t, u, h);
2498
2499
  let w = 1;
2499
2500
  return l === "auto" ? w = x.length : x.length > l ? w = l : w = x.length, this.ctx.restore(), Math.max(Math.floor(w * f + o * 2), Math.floor(d + o * 2));
2500
2501
  }
@@ -2513,7 +2514,7 @@ class pe {
2513
2514
  ellipsis: !0
2514
2515
  };
2515
2516
  const l = this.ctx.measureText(t).width, h = e - i * 2;
2516
- if (l && l + a >= h) {
2517
+ if (l && l >= h) {
2517
2518
  o = !0;
2518
2519
  let d = 0;
2519
2520
  for (let f = 0; f < t.length; f++)
@@ -2555,8 +2556,6 @@ class It {
2555
2556
  n(this, "BORDER_COLOR", "#e1e6eb");
2556
2557
  /** 宽度为 0 表示自适应100% */
2557
2558
  n(this, "WIDTH", 0);
2558
- /** 最小可调整宽度 */
2559
- n(this, "RESIZE_MIN_WIDTH", 40);
2560
2559
  /** 高度,为 0 表示自适应 */
2561
2560
  n(this, "HEIGHT", 0);
2562
2561
  /** 占位文本颜色 */
@@ -3050,7 +3049,7 @@ class ct extends Bt {
3050
3049
  n(this, "sortDescIconName", "sort-desc");
3051
3050
  n(this, "visibleWidth", 0);
3052
3051
  n(this, "visibleHeight", 0);
3053
- n(this, "maxLineClamp", "auto");
3052
+ n(this, "maxLineClampHeader", "auto");
3054
3053
  n(this, "domDataset", {});
3055
3054
  n(this, "drawTextX", 0);
3056
3055
  n(this, "drawTextY", 0);
@@ -3058,6 +3057,7 @@ class ct extends Bt {
3058
3057
  n(this, "drawTextHeight", 0);
3059
3058
  n(this, "drawCellBgColor", "");
3060
3059
  n(this, "drawTextColor", "");
3060
+ n(this, "drawTextFont", "");
3061
3061
  n(this, "drawSelectionImageX", 0);
3062
3062
  n(this, "drawSelectionImageY", 0);
3063
3063
  n(this, "drawSelectionImageWidth", 0);
@@ -3071,7 +3071,7 @@ class ct extends Bt {
3071
3071
  n(this, "drawSortImageHeight", 0);
3072
3072
  n(this, "drawSortImageName", "");
3073
3073
  n(this, "drawSortImageSource");
3074
- this.ctx = e, this.x = s, this.y = o, this.width = r, this.height = a, this.visibleWidth = r, this.visibleHeight = a, this.colIndex = i, this.key = l.key, this.minWidth = l.minWidth, this.maxWidth = l.maxWidth, this.type = l.type || "", this.editorType = l.editorType || "text", this.hideHeaderSelection = l.hideHeaderSelection || !1, this.align = l.headerAlign || l.align || this.ctx.config.COLUMNS_ALIGN, this.verticalAlign = l.headerVerticalAlign || l.verticalAlign || this.ctx.config.COLUMNS_VERTICAL_ALIGN, this.fixed = l.fixed, this.level = l.level || 0, this.operation = l.operation || !1, this.text = l.title, this.column = l, this.colspan = l.colspan || 1, this.widthFillDisable = l.widthFillDisable || !1, this.rowspan = l.rowspan || 1, this.rules = l.rules, this.readonly = l.readonly || !1, this.required = l.required || !1, this.sortIconName = l.sortIconName || "sort-default", this.sortAscIconName = l.sortAscIconName || "sort-asc", this.sortDescIconName = l.sortDescIconName || "sort-desc", this.rowKey = Dt(), this.overflowTooltipShow = l.overflowTooltipHeaderShow !== !1, this.hasChildren = l.children && l.children.length > 0 || !1, this.render = l.renderHeader;
3074
+ this.ctx = e, this.x = s, this.y = o, this.width = r, this.height = a, this.visibleWidth = r, this.visibleHeight = a, this.colIndex = i, this.key = l.key, this.minWidth = l.minWidth, this.maxWidth = l.maxWidth, this.type = l.type || "", this.editorType = l.editorType || "text", this.hideHeaderSelection = l.hideHeaderSelection || !1, this.align = l.headerAlign || l.align || this.ctx.config.COLUMNS_ALIGN, this.verticalAlign = l.headerVerticalAlign || l.verticalAlign || this.ctx.config.COLUMNS_VERTICAL_ALIGN, this.fixed = l.fixed, this.level = l.level || 0, this.operation = l.operation || !1, this.text = l.title, this.column = l, this.colspan = l.colspan || 1, this.widthFillDisable = l.widthFillDisable || !1, this.rowspan = l.rowspan || 1, this.rules = l.rules, this.readonly = l.readonly || !1, this.required = l.required || !1, this.sortIconName = l.sortIconName || "sort-default", this.sortAscIconName = l.sortAscIconName || "sort-asc", this.sortDescIconName = l.sortDescIconName || "sort-desc", this.rowKey = Dt(), this.overflowTooltipShow = l.overflowTooltipHeaderShow !== !1, this.hasChildren = l.children && l.children.length > 0 || !1, this.render = l.renderHeader, this.maxLineClampHeader = l.maxLineClampHeader || "auto";
3075
3075
  }
3076
3076
  /**
3077
3077
  * 是否可见,覆盖基类方法,表头是跟y滚动条没有关系的所以不需要加滚动参数
@@ -3091,11 +3091,11 @@ class ct extends Bt {
3091
3091
  const { HEADER_CELL_STYLE_METHOD: e, HEADER_BG_COLOR: i, HEADER_TEXT_COLOR: s } = this.ctx.config;
3092
3092
  let o = i, r = s;
3093
3093
  if (typeof e == "function") {
3094
- const a = e, { backgroundColor: l, color: h } = a({
3094
+ const a = e, { backgroundColor: l, color: h, font: d } = a({
3095
3095
  colIndex: this.colIndex,
3096
3096
  column: this.column
3097
3097
  }) || {};
3098
- l && (o = l), h && (r = h);
3098
+ l && (o = l), h && (r = h), d && (this.drawTextFont = d);
3099
3099
  }
3100
3100
  this.drawCellBgColor = o, this.drawTextColor = r;
3101
3101
  }
@@ -3119,7 +3119,7 @@ class ct extends Bt {
3119
3119
  const {
3120
3120
  paint: e,
3121
3121
  config: { HEADER_FONT: i, CELL_PADDING: s, REQUIRED_COLOR: o }
3122
- } = this.ctx, r = `${this.displayText}_${this.drawTextWidth}`;
3122
+ } = this.ctx, r = `${this.displayText}_${this.drawTextWidth}_${this.drawTextFont}`;
3123
3123
  this.ellipsis = e.drawText(
3124
3124
  this.displayText,
3125
3125
  this.drawTextX,
@@ -3127,12 +3127,12 @@ class ct extends Bt {
3127
3127
  this.drawTextWidth,
3128
3128
  this.drawTextHeight,
3129
3129
  {
3130
- font: i,
3130
+ font: this.drawTextFont || i,
3131
3131
  padding: s,
3132
3132
  color: this.drawTextColor,
3133
3133
  align: this.align,
3134
3134
  verticalAlign: this.verticalAlign,
3135
- maxLineClamp: this.maxLineClamp,
3135
+ maxLineClamp: this.maxLineClampHeader,
3136
3136
  offsetRight: this.column.sortBy ? 16 : 0,
3137
3137
  // 排序图标占位
3138
3138
  offsetLeft: this.required ? 12 : 0,
@@ -3532,6 +3532,10 @@ class Ie {
3532
3532
  // 自动填充移动中
3533
3533
  n(this, "selectorMove", !1);
3534
3534
  // 选择器移动中
3535
+ n(this, "selectColsIng", !1);
3536
+ // 选择列中
3537
+ n(this, "selectRowsIng", !1);
3538
+ // 选择行中
3535
3539
  n(this, "adjustPositioning", !1);
3536
3540
  // 调整位置中
3537
3541
  n(this, "editing", !1);
@@ -3624,7 +3628,7 @@ class Ie {
3624
3628
  loadingElement: h,
3625
3629
  contextMenuElement: d
3626
3630
  } = t;
3627
- this.containerElement = i, s.tabIndex = 0, this.stageElement = s, this.canvasElement = o, this.overlayerElement = r, this.editorElement = a, this.emptyElement = l, this.loadingElement = h, this.contextMenuElement = d, this.config = new It(e.config || {}), this.eventBus = new me(), this.eventBrowser = new Ee(this), this.eventTable = new Re(this), this.paint = new pe(this.canvasElement), this.database = new ge(this, e), this.history = new we(this), this.icons = new be(this);
3631
+ this.containerElement = i, s.tabIndex = 0, this.stageElement = s, this.canvasElement = o, this.overlayerElement = r, this.editorElement = a, this.emptyElement = l, this.loadingElement = h, this.contextMenuElement = d, this.config = new It(e.config || {}), this.eventBus = new Ee(), this.eventBrowser = new me(this), this.eventTable = new Re(this), this.paint = new pe(this.canvasElement), this.database = new ge(this, e), this.history = new we(this), this.icons = new be(this);
3628
3632
  }
3629
3633
  setConfig(t) {
3630
3634
  this.config = new It(t);
@@ -3723,6 +3727,12 @@ class Ie {
3723
3727
  const s = this.body.height - this.body.visibleHeight + i;
3724
3728
  e < 0 ? e = 0 : e > s && (e = s), this.emit("setScrollY", e);
3725
3729
  }
3730
+ startAdjustPosition(t) {
3731
+ this.emit("startAdjustPosition", t);
3732
+ }
3733
+ stopAdjustPosition() {
3734
+ this.emit("stopAdjustPosition");
3735
+ }
3726
3736
  isTarget(t) {
3727
3737
  return !!this.containerElement.contains(t.target);
3728
3738
  }
@@ -3845,8 +3855,8 @@ class vt {
3845
3855
  if (this.type === "vertical") {
3846
3856
  this.visibleDistance = h - o - d, this.distance = u - this.visibleDistance + x, this.trackX = l - o, this.trackY = 0, this.splitPoints = [this.trackX, d, this.trackX + o, d], this.trackWidth = o, this.trackHeight = h, this.barX = this.trackX - 1 + (o - r) / 2, this.barWidth = r;
3847
3857
  const w = this.distance ? this.visibleDistance / (u + x) : 0;
3848
- let E = Math.floor(w * this.visibleDistance);
3849
- E < 30 ? E = 30 : E > this.visibleDistance && (E = 0), this.barHeight = E, this.barY = d + this.scroll / this.distance * (this.visibleDistance - this.barHeight), this.scroll = Math.max(0, Math.min(this.scroll, this.distance));
3858
+ let m = Math.floor(w * this.visibleDistance);
3859
+ m < 30 ? m = 30 : m > this.visibleDistance && (m = 0), this.barHeight = m, this.barY = d + this.scroll / this.distance * (this.visibleDistance - this.barHeight), this.scroll = Math.max(0, Math.min(this.scroll, this.distance));
3850
3860
  } else {
3851
3861
  this.visibleDistance = l - o, this.distance = f - this.visibleDistance, this.splitPoints = [
3852
3862
  l - o,
@@ -3856,8 +3866,8 @@ class vt {
3856
3866
  ];
3857
3867
  const w = a ? 0 : 0.5;
3858
3868
  this.trackX = 0, this.trackY = h - o + w, this.trackWidth = l, this.trackHeight = o;
3859
- const E = this.distance ? this.visibleDistance / f : 0;
3860
- let g = Math.floor(E * this.visibleDistance);
3869
+ const m = this.distance ? this.visibleDistance / f : 0;
3870
+ let g = Math.floor(m * this.visibleDistance);
3861
3871
  this.barY = this.trackY - 1 + (o - r) / 2, g < 30 ? g = 30 : g >= this.visibleDistance && (g = 0), this.barWidth = g, this.barHeight = r, this.barX = this.scroll / this.distance * (this.visibleDistance - this.barWidth), this.scroll = Math.max(0, Math.min(this.scroll, this.distance));
3862
3872
  }
3863
3873
  }
@@ -3880,10 +3890,18 @@ class vt {
3880
3890
  }
3881
3891
  }
3882
3892
  class Se {
3893
+ // 垂直滚动定时器
3883
3894
  constructor(t) {
3884
3895
  n(this, "ctx");
3885
3896
  n(this, "verticalScrollbar");
3886
3897
  n(this, "horizontalScrollbar");
3898
+ n(this, "mousedownHeader", !1);
3899
+ // 是否点击了表头,点击头部处理滚动条调整位置
3900
+ n(this, "adjustPositionX", "");
3901
+ n(this, "adjustPositionY", "");
3902
+ n(this, "timerX", 0);
3903
+ // 水平滚动定时器
3904
+ n(this, "timerY", 0);
3887
3905
  this.ctx = t, this.verticalScrollbar = new vt(t, "vertical"), this.horizontalScrollbar = new vt(t, "horizontal"), this.ctx.on("wheel", (e) => this.onWheel(e)), this.ctx.on("mousedown", (e) => this.onMouseDown(e)), this.ctx.on("mousemove", (e) => this.onMouseMove(e)), this.ctx.on("mouseup", () => this.onMouseUp()), this.ctx.on("touchmove", (e) => this.onTouchmove(e)), this.ctx.on("touchstart", (e) => {
3888
3906
  this.onTouchstart(e);
3889
3907
  }), this.ctx.on("setScroll", (e, i) => {
@@ -3892,6 +3910,12 @@ class Se {
3892
3910
  this.setScrollX(e);
3893
3911
  }), this.ctx.on("setScrollY", (e) => {
3894
3912
  this.setScrollY(e);
3913
+ }), this.ctx.on("cellHeaderMousedown", () => {
3914
+ this.mousedownHeader = !0;
3915
+ }), this.ctx.on("startAdjustPosition", (e) => {
3916
+ this.startAdjustPosition(e);
3917
+ }), this.ctx.on("stopAdjustPosition", () => {
3918
+ this.stopAdjustPosition();
3895
3919
  });
3896
3920
  }
3897
3921
  onWheel(t) {
@@ -3910,7 +3934,7 @@ class Se {
3910
3934
  this.verticalScrollbar.onMouseMove(t), this.horizontalScrollbar.onMouseMove(t), this.draw();
3911
3935
  }
3912
3936
  onMouseUp() {
3913
- this.verticalScrollbar.onMouseUp(), this.horizontalScrollbar.onMouseUp(), this.ctx.scrollerMove = !1;
3937
+ this.mousedownHeader = !1, this.verticalScrollbar.onMouseUp(), this.horizontalScrollbar.onMouseUp(), this.ctx.scrollerMove = !1;
3914
3938
  }
3915
3939
  draw() {
3916
3940
  this.verticalScrollbar.draw(), this.horizontalScrollbar.draw();
@@ -3945,6 +3969,35 @@ class Se {
3945
3969
  const { top: o } = i.getPositionForRowIndex(s);
3946
3970
  this.setScrollY(o - e.visibleHeight / 2);
3947
3971
  }
3972
+ /**
3973
+ * 调整滚动条位置,让到达边界时自动滚动
3974
+ */
3975
+ startAdjustPosition(t) {
3976
+ var r, a;
3977
+ const { offsetX: e, offsetY: i } = this.ctx.getOffset(t);
3978
+ let s = "", o = "";
3979
+ if (((r = this.ctx.focusCell) == null ? void 0 : r.fixed) !== "left" && e < this.ctx.fixedLeftWidth ? s = "left" : ((a = this.ctx.focusCell) == null ? void 0 : a.fixed) !== "right" && e > this.ctx.body.visibleWidth - this.ctx.fixedRightWidth ? s = "right" : (s = "", this.stopAdjustPosition(!0, !1)), !this.mousedownHeader && i < this.ctx.header.visibleHeight ? o = "top" : i > this.ctx.header.visibleHeight + this.ctx.body.visibleHeight ? o = "bottom" : (o = "", this.stopAdjustPosition(!1, !0)), s && this.adjustPositionX !== s) {
3980
+ this.adjustPositionX = s;
3981
+ let h = 10 * (s === "left" ? -1 : 1);
3982
+ this.timerX && (clearInterval(this.timerX), this.timerX = 0), this.timerX = setInterval(() => {
3983
+ h *= 1.5;
3984
+ const { scrollX: d } = this.ctx, f = d + h;
3985
+ (f < 0 || f > this.ctx.body.width) && (clearInterval(this.timerX), this.timerX = 0), this.ctx.setScrollX(f);
3986
+ }, 100);
3987
+ }
3988
+ if (o && this.adjustPositionY !== o) {
3989
+ this.adjustPositionY = o;
3990
+ let h = 10 * (o === "top" ? -1 : 1);
3991
+ this.timerY && (clearInterval(this.timerY), this.timerY = 0), this.timerY = setInterval(() => {
3992
+ h *= 1.5;
3993
+ const { scrollY: d } = this.ctx, f = d + h;
3994
+ (f < 0 || f > this.ctx.body.height) && (clearInterval(this.timerY), this.timerY = 0), this.ctx.setScrollY(f);
3995
+ }, 100);
3996
+ }
3997
+ }
3998
+ stopAdjustPosition(t = !0, e = !0) {
3999
+ t && (this.adjustPositionX = "", this.timerX && (clearInterval(this.timerX), this.timerX = 0)), e && (this.adjustPositionY = "", this.timerY && (clearInterval(this.timerY), this.timerY = 0));
4000
+ }
3948
4001
  }
3949
4002
  class _e {
3950
4003
  constructor(t) {
@@ -3985,7 +4038,7 @@ class _e {
3985
4038
  n(this, "renderFixedCellHeaders", []);
3986
4039
  this.ctx = t, this.ctx.on(
3987
4040
  "resetHeader",
3988
- j(() => {
4041
+ Z(() => {
3989
4042
  this.init(), this.ctx.emit("draw");
3990
4043
  }, 100)
3991
4044
  ), this.init(), this.initResizeColumn();
@@ -3997,8 +4050,8 @@ class _e {
3997
4050
  this.columns = i, this.allCellHeaders = [], this.leafCellHeaders = [], this.fixedLeftCellHeaders = [], this.fixedRightCellHeaders = [], this.centerCellHeaders = [];
3998
4051
  const s = Nt(i), o = it(i);
3999
4052
  this.height = t * s, this.width = o.reduce((f, u) => {
4000
- const x = u.width || 100, { maxWidth: w, minWidth: E } = u;
4001
- return w && x > w ? f + w : E && x < E ? f + E : f + x;
4053
+ const x = u.width || 100, { maxWidth: w, minWidth: m } = u;
4054
+ return w && x > w ? f + w : m && x < m ? f + m : f + x;
4002
4055
  }, 0), this.visibleHeight = this.height;
4003
4056
  const r = ae(kt(i, s));
4004
4057
  this.columnIndex = 0, this.resizeNum = 0, this.render(r, 0), this.ctx.database.updateColIndexKeyMap(this.leafCellHeaders);
@@ -4098,7 +4151,7 @@ class _e {
4098
4151
  for (let r = 0; r < i; r++) {
4099
4152
  const a = t[r], l = o * (a.rowspan || 0), h = o * (a.level || 0);
4100
4153
  let { minWidth: d, maxWidth: f } = a, u = a.width || 100;
4101
- d && u < d && (u = d), f && u > f && (u = f), a.children && (u = it(a.children).reduce((E, g) => E + ((g == null ? void 0 : g.width) || 100), 0));
4154
+ d && u < d && (u = d), f && u > f && (u = f), a.children && (u = it(a.children).reduce((m, g) => m + ((g == null ? void 0 : g.width) || 100), 0));
4102
4155
  const x = new ct(this.ctx, this.columnIndex, s, h, u, l, a);
4103
4156
  this.ctx.database.setHeader(a.key, x), this.allCellHeaders.push(x), a.children || (this.leafCellHeaders.push(x), x.column.widthFillDisable || this.resizeNum++), a.fixed === "left" ? this.fixedLeftCellHeaders.push(x) : a.fixed === "right" ? this.fixedRightCellHeaders.push(x) : this.centerCellHeaders.push(x), !a.children && this.columnIndex++, a.children && this.render(a.children, s), s += u;
4104
4157
  }
@@ -4283,33 +4336,33 @@ class ve {
4283
4336
  this.x = 0, u === "top" && o ? this.y = e.height + i.height : this.y = e.height;
4284
4337
  const { data: x, sumHeight: w } = s.getData();
4285
4338
  this.height = w, this.data = x, this.width = e.width, this.visibleWidth = this.ctx.stageWidth - r;
4286
- const E = this.ctx.footer.height;
4287
- !this.data.length && !a ? this.height = l : !this.data.length && a && (this.height = a - e.height - E - r);
4339
+ const m = this.ctx.footer.height;
4340
+ !this.data.length && !a ? this.height = l : !this.data.length && a && (this.height = a - e.height - m - r);
4288
4341
  let g = this.height + e.height + r;
4289
- g += E;
4290
- let m = g;
4342
+ g += m;
4343
+ let E = g;
4291
4344
  const y = window.innerHeight, { top: p } = this.containerRect || this.ctx.containerElement.getBoundingClientRect();
4292
4345
  if (y > p && d && !a) {
4293
- const T = y - p - f;
4294
- T > e.height + r ? m = T : g > h && (m = h);
4295
- } else this.data.length && a ? m = a : this.data.length && h && g > h && (m = h);
4296
- m > 0 && (this.ctx.stageHeight = Math.floor(m), this.ctx.stageElement.style.height = `${this.ctx.stageHeight}px`);
4297
- let R = this.ctx.stageHeight - e.height - r;
4298
- o ? this.visibleHeight = R - E : this.visibleHeight = R, this.data.length || (this.height = this.visibleHeight), this.ctx.body.x = this.x, this.ctx.body.y = this.y, this.ctx.body.width = this.width, this.ctx.body.height = this.height, this.ctx.body.visibleWidth = this.visibleWidth, this.ctx.body.visibleHeight = this.visibleHeight, this.ctx.body.data = x;
4346
+ const O = y - p - f;
4347
+ O > e.height + r ? E = O : g > h && (E = h);
4348
+ } else this.data.length && a ? E = a : this.data.length && h && g > h && (E = h);
4349
+ E > 0 && (this.ctx.stageHeight = Math.floor(E), this.ctx.stageElement.style.height = `${this.ctx.stageHeight}px`);
4350
+ let b = this.ctx.stageHeight - e.height - r;
4351
+ o ? this.visibleHeight = b - m : this.visibleHeight = b, this.data.length || (this.height = this.visibleHeight), this.ctx.body.x = this.x, this.ctx.body.y = this.y, this.ctx.body.width = this.width, this.ctx.body.height = this.height, this.ctx.body.visibleWidth = this.visibleWidth, this.ctx.body.visibleHeight = this.visibleHeight, this.ctx.body.data = x;
4299
4352
  const C = window.devicePixelRatio || 1, I = this.ctx.stageWidth * C, _ = this.ctx.stageHeight * C;
4300
4353
  t.width = Math.round(I), t.height = Math.round(_);
4301
- const v = this.data.length ? "not-empty" : "empty";
4354
+ const T = this.data.length ? "not-empty" : "empty";
4302
4355
  this.ctx.emit("emptyChange", {
4303
- isEmpty: v,
4304
- type: v,
4356
+ isEmpty: T,
4357
+ type: T,
4305
4358
  headerHeight: e.height,
4306
4359
  bodyHeight: this.height,
4307
- footerHeight: E,
4360
+ footerHeight: m,
4308
4361
  width: this.width,
4309
- height: this.data.length ? 0 : l + E
4362
+ height: this.data.length ? 0 : l + m
4310
4363
  });
4311
- const S = Math.round(t.width / C * 1e4) / 1e4, b = Math.round(t.height / C * 1e4) / 1e4;
4312
- this.ctx.canvasElement.setAttribute("style", `height:${b}px;width:${S}px;`), this.ctx.paint.scale(C);
4364
+ const S = Math.round(t.width / C * 1e4) / 1e4, R = Math.round(t.height / C * 1e4) / 1e4;
4365
+ this.ctx.canvasElement.setAttribute("style", `height:${R}px;width:${S}px;`), this.ctx.paint.scale(C);
4313
4366
  }
4314
4367
  // 调整行的高度
4315
4368
  initResizeRow() {
@@ -4433,7 +4486,7 @@ class ve {
4433
4486
  this.headIndex = Math.max(0, l), this.tailIndex = Math.min(this.ctx.maxRowIndex, h + 1), this.visibleRows = r.slice(this.headIndex, this.tailIndex + 1), this.ctx.body.headIndex = this.headIndex, this.ctx.body.tailIndex = this.tailIndex, this.ctx.body.visibleRows = this.visibleRows;
4434
4487
  const d = [];
4435
4488
  for (let f = 0; f < this.visibleRows.length; f++) {
4436
- const u = this.headIndex + f, x = this.visibleRows[f], { height: w, top: E } = this.ctx.database.getPositionForRowIndex(u), g = new Kt(this.ctx, u, 0, E + this.y, t.width, w, x);
4489
+ const u = this.headIndex + f, x = this.visibleRows[f], { height: w, top: m } = this.ctx.database.getPositionForRowIndex(u), g = new Kt(this.ctx, u, 0, m + this.y, t.width, w, x);
4437
4490
  d.push(g);
4438
4491
  }
4439
4492
  this.renderRows = d, this.ctx.body.renderRows = d;
@@ -4545,17 +4598,10 @@ class Te {
4545
4598
  }
4546
4599
  }
4547
4600
  class Oe {
4548
- // 垂直滚动定时器
4549
4601
  constructor(t) {
4550
4602
  n(this, "isCut", !1);
4551
4603
  n(this, "isMultipleRow", !1);
4552
- n(this, "mousedownHeader", !1);
4553
4604
  n(this, "ctx");
4554
- n(this, "adjustPositionX", "");
4555
- n(this, "adjustPositionY", "");
4556
- n(this, "timerX", 0);
4557
- // 水平滚动定时器
4558
- n(this, "timerY", 0);
4559
4605
  this.ctx = t, this.init();
4560
4606
  }
4561
4607
  init() {
@@ -4563,9 +4609,8 @@ class Oe {
4563
4609
  this.moveFocus(t);
4564
4610
  }), this.ctx.on(
4565
4611
  "mousemove",
4566
- j((t) => {
4567
- const { offsetY: e, offsetX: i } = this.ctx.getOffset(t), s = this.ctx.isTarget(t) && i > 0 && i < this.ctx.body.visibleWidth && e > this.ctx.header.visibleHeight && e < this.ctx.header.visibleHeight + this.ctx.body.visibleHeight;
4568
- (this.ctx.selectorMove || this.ctx.autofillMove) && (!s && !this.mousedownHeader ? this.startAdjustPosition(t) : this.stopAdjustPosition());
4612
+ Z((t) => {
4613
+ this.ctx.selectorMove && this.ctx.startAdjustPosition(t);
4569
4614
  }, 100)
4570
4615
  ), this.ctx.on("cellHoverChange", (t) => {
4571
4616
  if (!this.ctx.autofillMove) {
@@ -4584,7 +4629,7 @@ class Oe {
4584
4629
  }
4585
4630
  window.getComputedStyle(e.target).userSelect !== "text" && e.preventDefault(), this.isMultipleRow = !1, this.click(e.shiftKey), this.ctx.emit("selectorClick", t);
4586
4631
  }), this.ctx.on("mouseup", () => {
4587
- this.mousedownHeader = !1;
4632
+ this.ctx.selectorMove = !1, this.ctx.stopAdjustPosition();
4588
4633
  const t = setTimeout(() => {
4589
4634
  this.ctx.adjustPositioning = !1, clearTimeout(t);
4590
4635
  }, 0);
@@ -4593,7 +4638,7 @@ class Oe {
4593
4638
  }), this.ctx.on("cellHeaderMousedown", (t, e) => {
4594
4639
  if (this.ctx.stageElement.style.cursor === "pointer" || this.ctx.isPointer)
4595
4640
  return;
4596
- window.getComputedStyle(e.target).userSelect !== "text" && e.preventDefault(), this.mousedownHeader = !0, this.selectCols(t);
4641
+ window.getComputedStyle(e.target).userSelect !== "text" && e.preventDefault(), this.selectCols(t);
4597
4642
  }), this.ctx.on("keydown", (t) => {
4598
4643
  if (!this.ctx.editing) {
4599
4644
  if (t.ctrlKey && t.code === "KeyV" || t.metaKey && t.code === "KeyV") {
@@ -4642,8 +4687,6 @@ class Oe {
4642
4687
  this.isCut = !0, this.copy();
4643
4688
  }), this.ctx.on("setSelectorCell", (t) => {
4644
4689
  this.ctx.setFocusCell(t), this.click();
4645
- }), this.ctx.on("mouseup", () => {
4646
- this.ctx.selectorMove = !1, this.stopAdjustPosition();
4647
4690
  });
4648
4691
  }
4649
4692
  setSelector(t, e) {
@@ -4666,15 +4709,15 @@ class Oe {
4666
4709
  SELECTOR_AREA_MAX_Y: d,
4667
4710
  SELECTOR_AREA_MAX_X_OFFSET: f,
4668
4711
  SELECTOR_AREA_MAX_Y_OFFSET: u
4669
- } = this.ctx.config, x = a, w = l || this.ctx.maxColIndex - f, E = h, g = d || this.ctx.maxRowIndex - u;
4670
- let [m, y] = o, [p, R] = r;
4671
- if (m < x || y > w || p < E || R > g)
4712
+ } = this.ctx.config, x = a, w = l || this.ctx.maxColIndex - f, m = h, g = d || this.ctx.maxRowIndex - u;
4713
+ let [E, y] = o, [p, b] = r;
4714
+ if (E < x || y > w || p < m || b > g)
4672
4715
  return;
4673
4716
  if (this.ctx.stageElement.focus({ preventScroll: !0 }), this.ctx.config.ENABLE_MERGE_CELL_LINK) {
4674
4717
  const I = this.adjustMergeCells(o, r);
4675
- p = I.yArr[0], R = I.yArr[1], m = I.xArr[0], y = I.xArr[1], this.ctx.onlyMergeCell = I.onlyMergeCell;
4718
+ p = I.yArr[0], b = I.yArr[1], E = I.xArr[0], y = I.xArr[1], this.ctx.onlyMergeCell = I.onlyMergeCell;
4676
4719
  }
4677
- m === y && p === R ? this.ctx.selectOnlyOne = !0 : this.ctx.selectOnlyOne = !1, o = [Math.max(x, m), Math.min(w, y)], r = [Math.max(E, p), Math.min(g, R)];
4720
+ E === y && p === b ? this.ctx.selectOnlyOne = !0 : this.ctx.selectOnlyOne = !1, o = [Math.max(x, E), Math.min(w, y)], r = [Math.max(m, p), Math.min(g, b)];
4678
4721
  const { BEFORE_SET_SELECTOR_METHOD: C } = this.ctx.config;
4679
4722
  if (typeof C == "function") {
4680
4723
  const _ = C({
@@ -4686,31 +4729,37 @@ class Oe {
4686
4729
  return;
4687
4730
  o = _.xArr, r = _.yArr;
4688
4731
  }
4689
- this.ctx.selector.xArr = o, this.ctx.selector.yArr = r, this.ctx.emit("setSelector", this.ctx.selector), this.ctx.emit("drawView");
4732
+ this.ctx.selector.xArr = o, this.ctx.selector.yArr = r, b === this.ctx.maxRowIndex && p === 0 ? this.ctx.selectColsIng = !0 : this.ctx.selectColsIng = !1, y === this.ctx.maxColIndex && E === 0 ? this.ctx.selectRowsIng = !0 : this.ctx.selectRowsIng = !1, this.ctx.emit("setSelector", this.ctx.selector), this.ctx.emit("drawView");
4690
4733
  }
4691
4734
  }
4692
4735
  adjustMergeCells(t, e) {
4693
4736
  var w;
4694
4737
  const [i, s] = e, [o, r] = t;
4738
+ if (s === this.ctx.maxRowIndex && i === 0 || r === this.ctx.maxColIndex && o === 0)
4739
+ return {
4740
+ xArr: t,
4741
+ yArr: e,
4742
+ onlyMergeCell: !1
4743
+ };
4695
4744
  let a = [], l = [];
4696
- for (let E = 0; E <= e[1] - e[0]; E++)
4745
+ for (let m = 0; m <= e[1] - e[0]; m++)
4697
4746
  for (let g = 0; g <= t[1] - t[0]; g++) {
4698
- const m = E + e[0], y = g + t[0], p = this.ctx.database.getVirtualBodyCell(m, y);
4699
- p && ((m === i || m === s) && a.push(p), (y === o || y === r) && l.push(p));
4747
+ const E = m + e[0], y = g + t[0], p = this.ctx.database.getVirtualBodyCell(E, y);
4748
+ p && ((E === i || E === s) && a.push(p), (y === o || y === r) && l.push(p));
4700
4749
  }
4701
4750
  const h = a.reduce(
4702
- (E, g) => {
4703
- const { yArr: m } = g.getSpanInfo(), [y, p] = m;
4704
- return E.minY = Math.min(E.minY, y), E.maxY = Math.max(E.maxY, p), E;
4751
+ (m, g) => {
4752
+ const { yArr: E } = g.getSpanInfo(), [y, p] = E;
4753
+ return m.minY = Math.min(m.minY, y), m.maxY = Math.max(m.maxY, p), m;
4705
4754
  },
4706
4755
  {
4707
4756
  minY: i,
4708
4757
  maxY: s
4709
4758
  }
4710
4759
  ), d = l.reduce(
4711
- (E, g) => {
4712
- const { xArr: m } = g.getSpanInfo(), [y, p] = m;
4713
- return E.minX = Math.min(E.minX, y), E.maxX = Math.max(E.maxX, p), E;
4760
+ (m, g) => {
4761
+ const { xArr: E } = g.getSpanInfo(), [y, p] = E;
4762
+ return m.minX = Math.min(m.minX, y), m.maxX = Math.max(m.maxX, p), m;
4714
4763
  },
4715
4764
  {
4716
4765
  minX: o,
@@ -4719,8 +4768,8 @@ class Oe {
4719
4768
  ), f = [d.minX, d.maxX], u = [h.minY, h.maxY];
4720
4769
  let x = !1;
4721
4770
  if (d.minX !== d.maxX || h.minY !== h.maxY) {
4722
- const E = JSON.stringify(f) + JSON.stringify(u), g = (w = this.ctx.focusCell) == null ? void 0 : w.getSpanInfo();
4723
- x = (g && JSON.stringify(g.xArr) + JSON.stringify(g.yArr)) === E;
4771
+ const m = JSON.stringify(f) + JSON.stringify(u), g = (w = this.ctx.focusCell) == null ? void 0 : w.getSpanInfo();
4772
+ x = (g && JSON.stringify(g.xArr) + JSON.stringify(g.yArr)) === m;
4724
4773
  }
4725
4774
  return {
4726
4775
  xArr: f,
@@ -4910,8 +4959,8 @@ class Oe {
4910
4959
  overflowColCount: w,
4911
4960
  textArr: r
4912
4961
  });
4913
- const E = r.length === 1 && r[0].length === 1;
4914
- if (this.ctx.config.ENABLE_MERGE_CELL_LINK && this.ctx.database.hasMergeCell(a, l) && !E) {
4962
+ const m = r.length === 1 && r[0].length === 1;
4963
+ if (this.ctx.config.ENABLE_MERGE_CELL_LINK && this.ctx.database.hasMergeCell(a, l) && !m) {
4915
4964
  const p = {
4916
4965
  code: "ERR_MERGED_CELLS_PASTE",
4917
4966
  message: "Merged cells cannot span paste data"
@@ -4921,18 +4970,18 @@ class Oe {
4921
4970
  }
4922
4971
  let g = [];
4923
4972
  for (let p = 0; p <= r.length - 1; p++) {
4924
- const R = r[p].length;
4925
- for (let C = 0; C <= R - 1; C++) {
4926
- const I = p + e, _ = C + i, v = r[p][C], S = this.ctx.database.getItemValueForRowIndexAndColIndex(
4973
+ const b = r[p].length;
4974
+ for (let C = 0; C <= b - 1; C++) {
4975
+ const I = p + e, _ = C + i, T = r[p][C], S = this.ctx.database.getItemValueForRowIndexAndColIndex(
4927
4976
  I,
4928
4977
  _
4929
4978
  );
4930
4979
  if (S) {
4931
- const { rowKey: b, key: O } = S;
4932
- this.ctx.database.getReadonly(b, O) || (s.add(b), g.push({
4933
- rowKey: b,
4934
- key: O,
4935
- value: v,
4980
+ const { rowKey: R, key: v } = S;
4981
+ this.ctx.database.getReadonly(R, v) || (s.add(R), g.push({
4982
+ rowKey: R,
4983
+ key: v,
4984
+ value: T,
4936
4985
  row: {}
4937
4986
  //内部有设置
4938
4987
  }));
@@ -4945,23 +4994,23 @@ class Oe {
4945
4994
  this.ctx.selector.yArrCopy,
4946
4995
  !0
4947
4996
  // 忽略设置,只返回数据,用于cut,实现历史回退需要返回两次问题
4948
- ), R = g.map((C) => `${C.rowKey}-${C.key}`);
4997
+ ), b = g.map((C) => `${C.rowKey}-${C.key}`);
4949
4998
  p.forEach((C) => {
4950
- R.includes(`${C.rowKey}-${C.key}`) || g.unshift(C);
4999
+ b.includes(`${C.rowKey}-${C.key}`) || g.unshift(C);
4951
5000
  }), this.isCut = !1;
4952
5001
  }
4953
5002
  if (!g.length)
4954
5003
  return;
4955
- const { BEFORE_PASTE_DATA_METHOD: m } = this.ctx.config;
4956
- if (typeof m == "function") {
4957
- const p = m, R = g.map((C) => ({
5004
+ const { BEFORE_PASTE_DATA_METHOD: E } = this.ctx.config;
5005
+ if (typeof E == "function") {
5006
+ const p = E, b = g.map((C) => ({
4958
5007
  rowKey: C.rowKey,
4959
5008
  key: C.key,
4960
5009
  value: C.value,
4961
5010
  oldValue: this.ctx.database.getItemValue(C.rowKey, C.key),
4962
5011
  row: this.ctx.database.getRowDataItemForRowKey(C.rowKey)
4963
5012
  }));
4964
- if (g = await p(R, a, l, r), g && !g.length)
5013
+ if (g = await p(b, a, l, r), g && !g.length)
4965
5014
  return;
4966
5015
  }
4967
5016
  this.clearCopyLine(), this.ctx.batchSetItemValueByEditor(g, !0);
@@ -5002,9 +5051,6 @@ class Oe {
5002
5051
  const h = [i, i], d = [s, s], f = this.getCell(s, i);
5003
5052
  f && (f.operation || this.isInSettingRange(f.rowIndex, f.colIndex) && (this.ctx.setFocusCell(f), this.setSelector(h, d), this.adjustBoundaryPosition(), this.ctx.emit("moveFocus", f), this.ctx.emit("draw")));
5004
5053
  }
5005
- stopAdjustPosition() {
5006
- this.adjustPositionX = "", this.adjustPositionY = "", this.timerX && (clearInterval(this.timerX), this.timerX = 0), this.timerY && (clearInterval(this.timerY), this.timerY = 0);
5007
- }
5008
5054
  // 判断是否在设置范围内
5009
5055
  isInSettingRange(t, e) {
5010
5056
  const {
@@ -5017,31 +5063,6 @@ class Oe {
5017
5063
  } = this.ctx.config, h = i, d = s || this.ctx.maxColIndex - a, f = o, u = r || this.ctx.maxRowIndex - l;
5018
5064
  return !(e < h || e > d || t < f || t > u);
5019
5065
  }
5020
- /**
5021
- * 调整滚动条位置,让到达边界时自动滚动
5022
- */
5023
- startAdjustPosition(t) {
5024
- const { offsetX: e, offsetY: i } = this.ctx.getOffset(t);
5025
- let s = "", o = "";
5026
- if (e < 0 ? s = "left" : e > this.ctx.body.visibleWidth && (s = "right"), i < this.ctx.header.visibleHeight ? o = "top" : i > this.ctx.header.visibleHeight + this.ctx.body.visibleHeight && (o = "bottom"), s && this.adjustPositionX !== s) {
5027
- this.adjustPositionX = s;
5028
- let a = 10 * (s === "left" ? -1 : 1);
5029
- this.timerX && (clearInterval(this.timerX), this.timerX = 0), this.timerX = setInterval(() => {
5030
- a *= 1.5;
5031
- const { scrollX: l } = this.ctx, h = l + a;
5032
- (h < 0 || h > this.ctx.body.width) && (clearInterval(this.timerX), this.timerX = 0), this.ctx.setScrollX(h);
5033
- }, 100);
5034
- }
5035
- if (o && this.adjustPositionY !== o) {
5036
- this.adjustPositionY = o;
5037
- let a = 10 * (o === "top" ? -1 : 1);
5038
- this.timerY && (clearInterval(this.timerY), this.timerY = 0), this.timerY = setInterval(() => {
5039
- a *= 1.5;
5040
- const { scrollY: l } = this.ctx, h = l + a;
5041
- (h < 0 || h > this.ctx.body.height) && (clearInterval(this.timerY), this.timerY = 0), this.ctx.setScrollY(h);
5042
- }, 100);
5043
- }
5044
- }
5045
5066
  /**
5046
5067
  * 调整滚动条位置,让焦点单元格始终出现在可视区域内
5047
5068
  */
@@ -5062,17 +5083,16 @@ class Oe {
5062
5083
  if (!i)
5063
5084
  return;
5064
5085
  w && this.ctx.onlyMergeCell && i.updateSpanInfo();
5065
- const { drawX: E, drawY: g, width: m, height: y, fixed: p } = i, R = o - E + 1, C = i.drawX + m - (e - s) + 1;
5086
+ const { drawX: m, drawY: g, width: E, height: y, fixed: p } = i, b = o - m + 1, C = i.drawX + E - (e - s) + 1;
5066
5087
  let I = r.height - g, _ = y;
5067
5088
  _ > l.visibleHeight && (_ = l.visibleHeight);
5068
- let v = 0;
5069
- u && (x === "top" ? I = r.height + a.height - g : v = a.visibleHeight);
5070
- const S = g + _ - (t - v - f);
5071
- let b = h, O = d;
5072
- C > 0 && !p ? b = Math.floor(h + C) : R > 0 && !p && (b = Math.floor(h - R)), I > 0 ? O = Math.floor(d - I) : S > 0 && (O = Math.floor(d + S)), (Math.abs(h - b) > 2 || Math.abs(d - O) > 2) && (this.ctx.adjustPositioning = !0, this.ctx.setScroll(b, O), this.ctx.emit("adjustBoundaryPosition", i));
5089
+ let T = 0;
5090
+ u && (x === "top" ? I = r.height + a.height - g : T = a.visibleHeight);
5091
+ const S = g + _ - (t - T - f);
5092
+ let R = h, v = d;
5093
+ C > 0 && !p ? R = Math.floor(h + C) : b > 0 && !p && (R = Math.floor(h - b)), I > 0 ? v = Math.floor(d - I) : S > 0 && (v = Math.floor(d + S)), (Math.abs(h - R) > 2 || Math.abs(d - v) > 2) && (this.ctx.adjustPositioning = !0, this.ctx.setScroll(R, v), this.ctx.emit("adjustBoundaryPosition", i));
5073
5094
  }
5074
5095
  destroy() {
5075
- this.timerX && (clearTimeout(this.timerX), this.timerX = 0), this.timerY && (clearTimeout(this.timerY), this.timerY = 0);
5076
5096
  }
5077
5097
  }
5078
5098
  class Le {
@@ -5086,14 +5106,14 @@ class Le {
5086
5106
  if (this.ctx.stageElement.style.cursor === "crosshair" && (this.ctx.stageElement.style.cursor = "default"), this.ctx.editing || !this.ctx.focusCell || !this.maxColRowCell)
5087
5107
  return;
5088
5108
  const { offsetX: e, offsetY: i } = this.ctx.getOffset(t), { colIndex: s, rowIndex: o, drawX: r, drawY: a, width: l, height: h } = this.maxColRowCell, d = 6, f = s === this.ctx.maxColIndex || o === this.ctx.maxRowIndex ? 0 : 2, u = r + l - d + f, x = a + h - d + f;
5089
- e > u && i > x && e < u + d && i < x + d && (this.ctx.stageElement.style.cursor = "crosshair");
5109
+ e > u && i > x && e < u + d && i < x + d && (this.ctx.stageElement.style.cursor = "crosshair"), this.ctx.autofillMove && this.ctx.startAdjustPosition(t);
5090
5110
  }), this.ctx.on("cellMouseenter", (t) => {
5091
5111
  const { xArr: e, yArr: i } = this.ctx.selector, s = e[1], o = i[1], { colIndex: r, rowIndex: a } = t;
5092
5112
  this.ctx.config.ENABLE_AUTOFILL && r === s && a === o && (this.maxColRowCell = t), this.mouseenter(t);
5093
5113
  }), this.ctx.on("mousedown", () => {
5094
5114
  this.ctx.stageElement.style.cursor === "crosshair" && this.setMousedown();
5095
5115
  }), this.ctx.on("mouseup", () => {
5096
- this.setMouseUp();
5116
+ this.setMouseUp(), this.ctx.stopAdjustPosition();
5097
5117
  });
5098
5118
  }
5099
5119
  /**
@@ -5133,21 +5153,21 @@ class Le {
5133
5153
  SELECTOR_AREA_MAX_Y: f,
5134
5154
  SELECTOR_AREA_MAX_X_OFFSET: u,
5135
5155
  SELECTOR_AREA_MAX_Y_OFFSET: x
5136
- } = this.ctx.config, w = l, E = h || this.ctx.maxColIndex - u, g = d, m = f || this.ctx.maxRowIndex - x;
5137
- let [y, p] = r, [R, C] = a;
5138
- if (y < w || R < g)
5156
+ } = this.ctx.config, w = l, m = h || this.ctx.maxColIndex - u, g = d, E = f || this.ctx.maxRowIndex - x;
5157
+ let [y, p] = r, [b, C] = a;
5158
+ if (y < w || b < g)
5139
5159
  return;
5140
- r = [Math.max(w, y), Math.min(E, p)], a = [Math.max(g, R), Math.min(m, C)];
5160
+ r = [Math.max(w, y), Math.min(m, p)], a = [Math.max(g, b), Math.min(E, C)];
5141
5161
  const { BEFORE_SET_AUTOFILL_METHOD: I } = this.ctx.config;
5142
5162
  if (typeof I == "function") {
5143
- const v = I({
5163
+ const T = I({
5144
5164
  focusCell: this.ctx.focusCell,
5145
5165
  xArr: r,
5146
5166
  yArr: a
5147
5167
  });
5148
- if (!v)
5168
+ if (!T)
5149
5169
  return;
5150
- r = v.xArr, a = v.yArr;
5170
+ r = T.xArr, a = T.yArr;
5151
5171
  }
5152
5172
  this.ctx.autofill.xArr = r, this.ctx.autofill.yArr = a, this.ctx.emit("setAutofill", this.ctx.autofill), this.ctx.emit("draw");
5153
5173
  }
@@ -5159,8 +5179,8 @@ class Le {
5159
5179
  const t = /* @__PURE__ */ new Set(), e = this.ctx.getSelectedData(), i = /* @__PURE__ */ new Map();
5160
5180
  for (let x = 0; x <= e.yArr[1] - e.yArr[0]; x++)
5161
5181
  for (let w = 0; w <= e.xArr[1] - e.xArr[0]; w++) {
5162
- const E = x + e.yArr[0], g = w + e.xArr[0];
5163
- i.set(`${E}-${g}`, !0);
5182
+ const m = x + e.yArr[0], g = w + e.xArr[0];
5183
+ i.set(`${m}-${g}`, !0);
5164
5184
  }
5165
5185
  const { value: s } = e, o = s[0].length, r = s.length, a = this.ctx.autofill.xArr, l = this.ctx.autofill.yArr, h = o === 1 && r === 1;
5166
5186
  if (this.ctx.config.ENABLE_MERGE_CELL_LINK && this.ctx.database.hasMergeCell(a, l) && !h) {
@@ -5174,13 +5194,13 @@ class Le {
5174
5194
  let d = [];
5175
5195
  for (let x = 0; x <= l[1] - l[0]; x++)
5176
5196
  for (let w = 0; w <= a[1] - a[0]; w++) {
5177
- const E = w + a[0], g = x + l[0], m = s[x % r][w % o], y = this.ctx.database.getItemValueForRowIndexAndColIndex(g, E), p = `${g}-${E}`;
5197
+ const m = w + a[0], g = x + l[0], E = s[x % r][w % o], y = this.ctx.database.getItemValueForRowIndexAndColIndex(g, m), p = `${g}-${m}`;
5178
5198
  if (y && !i.has(p)) {
5179
- const { rowKey: R, key: C } = y;
5180
- this.ctx.database.getReadonly(R, C) || (t.add(R), d.push({
5181
- rowKey: R,
5199
+ const { rowKey: b, key: C } = y;
5200
+ this.ctx.database.getReadonly(b, C) || (t.add(b), d.push({
5201
+ rowKey: b,
5182
5202
  key: C,
5183
- value: m,
5203
+ value: E,
5184
5204
  row: {}
5185
5205
  }));
5186
5206
  }
@@ -5190,12 +5210,12 @@ class Le {
5190
5210
  this.ctx.selector.xArr = this.ctx.autofill.xArr, this.ctx.selector.yArr = this.ctx.autofill.yArr;
5191
5211
  const { BEFORE_AUTOFILL_DATA_METHOD: f } = this.ctx.config;
5192
5212
  if (typeof f == "function") {
5193
- const x = f, w = d.map((E) => ({
5194
- rowKey: E.rowKey,
5195
- key: E.key,
5196
- value: E.value,
5197
- oldValue: this.ctx.database.getItemValue(E.rowKey, E.key),
5198
- row: this.ctx.database.getRowDataItemForRowKey(E.rowKey)
5213
+ const x = f, w = d.map((m) => ({
5214
+ rowKey: m.rowKey,
5215
+ key: m.key,
5216
+ value: m.value,
5217
+ oldValue: this.ctx.database.getItemValue(m.rowKey, m.key),
5218
+ row: this.ctx.database.getRowDataItemForRowKey(m.rowKey)
5199
5219
  }));
5200
5220
  if (d = await x(w, a, l), d && !d.length)
5201
5221
  return;
@@ -5221,12 +5241,12 @@ class Le {
5221
5241
  const q = Math.min, $ = Math.max, st = Math.round, B = (c) => ({
5222
5242
  x: c,
5223
5243
  y: c
5224
- }), Me = {
5244
+ }), Ae = {
5225
5245
  left: "right",
5226
5246
  right: "left",
5227
5247
  bottom: "top",
5228
5248
  top: "bottom"
5229
- }, Ae = {
5249
+ }, Me = {
5230
5250
  start: "end",
5231
5251
  end: "start"
5232
5252
  };
@@ -5242,7 +5262,7 @@ function z(c) {
5242
5262
  function tt(c) {
5243
5263
  return c.split("-")[1];
5244
5264
  }
5245
- function Wt(c) {
5265
+ function Ft(c) {
5246
5266
  return c === "x" ? "y" : "x";
5247
5267
  }
5248
5268
  function wt(c) {
@@ -5252,12 +5272,12 @@ const He = /* @__PURE__ */ new Set(["top", "bottom"]);
5252
5272
  function V(c) {
5253
5273
  return He.has(z(c)) ? "y" : "x";
5254
5274
  }
5255
- function Et(c) {
5256
- return Wt(V(c));
5275
+ function mt(c) {
5276
+ return Ft(V(c));
5257
5277
  }
5258
5278
  function De(c, t, e) {
5259
5279
  e === void 0 && (e = !1);
5260
- const i = tt(c), s = Et(c), o = wt(s);
5280
+ const i = tt(c), s = mt(c), o = wt(s);
5261
5281
  let r = s === "x" ? i === (e ? "end" : "start") ? "right" : "left" : i === "start" ? "bottom" : "top";
5262
5282
  return t.reference[o] > t.floating[o] && (r = ot(r)), [r, ot(r)];
5263
5283
  }
@@ -5266,7 +5286,7 @@ function Ne(c) {
5266
5286
  return [ft(c), t, ft(t)];
5267
5287
  }
5268
5288
  function ft(c) {
5269
- return c.replace(/start|end/g, (t) => Ae[t]);
5289
+ return c.replace(/start|end/g, (t) => Me[t]);
5270
5290
  }
5271
5291
  const Tt = ["left", "right"], Ot = ["right", "left"], ke = ["top", "bottom"], Xe = ["bottom", "top"];
5272
5292
  function Ye(c, t, e) {
@@ -5287,7 +5307,7 @@ function Be(c, t, e, i) {
5287
5307
  return s && (o = o.map((r) => r + "-" + s), t && (o = o.concat(o.map(ft)))), o;
5288
5308
  }
5289
5309
  function ot(c) {
5290
- return c.replace(/left|right|bottom|top/g, (t) => Me[t]);
5310
+ return c.replace(/left|right|bottom|top/g, (t) => Ae[t]);
5291
5311
  }
5292
5312
  function Ke(c) {
5293
5313
  return {
@@ -5298,7 +5318,7 @@ function Ke(c) {
5298
5318
  ...c
5299
5319
  };
5300
5320
  }
5301
- function Ft(c) {
5321
+ function Wt(c) {
5302
5322
  return typeof c != "number" ? Ke(c) : {
5303
5323
  top: c,
5304
5324
  right: c,
@@ -5329,7 +5349,7 @@ function Lt(c, t, e) {
5329
5349
  reference: i,
5330
5350
  floating: s
5331
5351
  } = c;
5332
- const o = V(t), r = Et(t), a = wt(r), l = z(t), h = o === "y", d = i.x + i.width / 2 - s.width / 2, f = i.y + i.height / 2 - s.height / 2, u = i[a] / 2 - s[a] / 2;
5352
+ const o = V(t), r = mt(t), a = wt(r), l = z(t), h = o === "y", d = i.x + i.width / 2 - s.width / 2, f = i.y + i.height / 2 - s.height / 2, u = i[a] / 2 - s[a] / 2;
5333
5353
  let x;
5334
5354
  switch (l) {
5335
5355
  case "top":
@@ -5372,7 +5392,7 @@ function Lt(c, t, e) {
5372
5392
  }
5373
5393
  return x;
5374
5394
  }
5375
- const We = async (c, t, e) => {
5395
+ const Fe = async (c, t, e) => {
5376
5396
  const {
5377
5397
  placement: i = "bottom",
5378
5398
  strategy: s = "absolute",
@@ -5387,16 +5407,16 @@ const We = async (c, t, e) => {
5387
5407
  x: d,
5388
5408
  y: f
5389
5409
  } = Lt(h, i, l), u = i, x = {}, w = 0;
5390
- for (let E = 0; E < a.length; E++) {
5410
+ for (let m = 0; m < a.length; m++) {
5391
5411
  const {
5392
5412
  name: g,
5393
- fn: m
5394
- } = a[E], {
5413
+ fn: E
5414
+ } = a[m], {
5395
5415
  x: y,
5396
5416
  y: p,
5397
- data: R,
5417
+ data: b,
5398
5418
  reset: C
5399
- } = await m({
5419
+ } = await E({
5400
5420
  x: d,
5401
5421
  y: f,
5402
5422
  initialPlacement: i,
@@ -5414,7 +5434,7 @@ const We = async (c, t, e) => {
5414
5434
  ...x,
5415
5435
  [g]: {
5416
5436
  ...x[g],
5417
- ...R
5437
+ ...b
5418
5438
  }
5419
5439
  }, C && w <= 50 && (w++, typeof C == "object" && (C.placement && (u = C.placement), C.rects && (h = C.rects === !0 ? await r.getElementRects({
5420
5440
  reference: c,
@@ -5423,7 +5443,7 @@ const We = async (c, t, e) => {
5423
5443
  }) : C.rects), {
5424
5444
  x: d,
5425
5445
  y: f
5426
- } = Lt(h, u, l)), E = -1);
5446
+ } = Lt(h, u, l)), m = -1);
5427
5447
  }
5428
5448
  return {
5429
5449
  x: d,
@@ -5449,7 +5469,7 @@ async function Vt(c, t) {
5449
5469
  elementContext: f = "floating",
5450
5470
  altBoundary: u = !1,
5451
5471
  padding: x = 0
5452
- } = Q(t, c), w = Ft(x), g = a[u ? f === "floating" ? "reference" : "floating" : f], m = rt(await o.getClippingRect({
5472
+ } = Q(t, c), w = Wt(x), g = a[u ? f === "floating" ? "reference" : "floating" : f], E = rt(await o.getClippingRect({
5453
5473
  element: (e = await (o.isElement == null ? void 0 : o.isElement(g))) == null || e ? g : g.contextElement || await (o.getDocumentElement == null ? void 0 : o.getDocumentElement(a.floating)),
5454
5474
  boundary: h,
5455
5475
  rootBoundary: d,
@@ -5459,7 +5479,7 @@ async function Vt(c, t) {
5459
5479
  y: s,
5460
5480
  width: r.floating.width,
5461
5481
  height: r.floating.height
5462
- } : r.reference, p = await (o.getOffsetParent == null ? void 0 : o.getOffsetParent(a.floating)), R = await (o.isElement == null ? void 0 : o.isElement(p)) ? await (o.getScale == null ? void 0 : o.getScale(p)) || {
5482
+ } : r.reference, p = await (o.getOffsetParent == null ? void 0 : o.getOffsetParent(a.floating)), b = await (o.isElement == null ? void 0 : o.isElement(p)) ? await (o.getScale == null ? void 0 : o.getScale(p)) || {
5463
5483
  x: 1,
5464
5484
  y: 1
5465
5485
  } : {
@@ -5472,13 +5492,13 @@ async function Vt(c, t) {
5472
5492
  strategy: l
5473
5493
  }) : y);
5474
5494
  return {
5475
- top: (m.top - C.top + w.top) / R.y,
5476
- bottom: (C.bottom - m.bottom + w.bottom) / R.y,
5477
- left: (m.left - C.left + w.left) / R.x,
5478
- right: (C.right - m.right + w.right) / R.x
5495
+ top: (E.top - C.top + w.top) / b.y,
5496
+ bottom: (C.bottom - E.bottom + w.bottom) / b.y,
5497
+ left: (E.left - C.left + w.left) / b.x,
5498
+ right: (C.right - E.right + w.right) / b.x
5479
5499
  };
5480
5500
  }
5481
- const Fe = (c) => ({
5501
+ const We = (c) => ({
5482
5502
  name: "arrow",
5483
5503
  options: c,
5484
5504
  async fn(t) {
@@ -5496,20 +5516,20 @@ const Fe = (c) => ({
5496
5516
  } = Q(c, t) || {};
5497
5517
  if (h == null)
5498
5518
  return {};
5499
- const f = Ft(d), u = {
5519
+ const f = Wt(d), u = {
5500
5520
  x: e,
5501
5521
  y: i
5502
- }, x = Et(s), w = wt(x), E = await r.getDimensions(h), g = x === "y", m = g ? "top" : "left", y = g ? "bottom" : "right", p = g ? "clientHeight" : "clientWidth", R = o.reference[w] + o.reference[x] - u[x] - o.floating[w], C = u[x] - o.reference[x], I = await (r.getOffsetParent == null ? void 0 : r.getOffsetParent(h));
5522
+ }, x = mt(s), w = wt(x), m = await r.getDimensions(h), g = x === "y", E = g ? "top" : "left", y = g ? "bottom" : "right", p = g ? "clientHeight" : "clientWidth", b = o.reference[w] + o.reference[x] - u[x] - o.floating[w], C = u[x] - o.reference[x], I = await (r.getOffsetParent == null ? void 0 : r.getOffsetParent(h));
5503
5523
  let _ = I ? I[p] : 0;
5504
5524
  (!_ || !await (r.isElement == null ? void 0 : r.isElement(I))) && (_ = a.floating[p] || o.floating[w]);
5505
- const v = R / 2 - C / 2, S = _ / 2 - E[w] / 2 - 1, b = q(f[m], S), O = q(f[y], S), T = b, M = _ - E[w] - O, L = _ / 2 - E[w] / 2 + v, A = dt(T, L, M), D = !l.arrow && tt(s) != null && L !== A && o.reference[w] / 2 - (L < T ? b : O) - E[w] / 2 < 0, N = D ? L < T ? L - T : L - M : 0;
5525
+ const T = b / 2 - C / 2, S = _ / 2 - m[w] / 2 - 1, R = q(f[E], S), v = q(f[y], S), O = R, A = _ - m[w] - v, L = _ / 2 - m[w] / 2 + T, M = dt(O, L, A), D = !l.arrow && tt(s) != null && L !== M && o.reference[w] / 2 - (L < O ? R : v) - m[w] / 2 < 0, H = D ? L < O ? L - O : L - A : 0;
5506
5526
  return {
5507
- [x]: u[x] + N,
5527
+ [x]: u[x] + H,
5508
5528
  data: {
5509
- [x]: A,
5510
- centerOffset: L - A - N,
5529
+ [x]: M,
5530
+ centerOffset: L - M - H,
5511
5531
  ...D && {
5512
- alignmentOffset: N
5532
+ alignmentOffset: H
5513
5533
  }
5514
5534
  },
5515
5535
  reset: D
@@ -5534,52 +5554,52 @@ const Fe = (c) => ({
5534
5554
  fallbackPlacements: u,
5535
5555
  fallbackStrategy: x = "bestFit",
5536
5556
  fallbackAxisSideDirection: w = "none",
5537
- flipAlignment: E = !0,
5557
+ flipAlignment: m = !0,
5538
5558
  ...g
5539
5559
  } = Q(c, t);
5540
5560
  if ((e = o.arrow) != null && e.alignmentOffset)
5541
5561
  return {};
5542
- const m = z(s), y = V(a), p = z(a) === a, R = await (l.isRTL == null ? void 0 : l.isRTL(h.floating)), C = u || (p || !E ? [ot(a)] : Ne(a)), I = w !== "none";
5543
- !u && I && C.push(...Be(a, E, w, R));
5544
- const _ = [a, ...C], v = await Vt(t, g), S = [];
5545
- let b = ((i = o.flip) == null ? void 0 : i.overflows) || [];
5546
- if (d && S.push(v[m]), f) {
5547
- const L = De(s, r, R);
5548
- S.push(v[L[0]], v[L[1]]);
5562
+ const E = z(s), y = V(a), p = z(a) === a, b = await (l.isRTL == null ? void 0 : l.isRTL(h.floating)), C = u || (p || !m ? [ot(a)] : Ne(a)), I = w !== "none";
5563
+ !u && I && C.push(...Be(a, m, w, b));
5564
+ const _ = [a, ...C], T = await Vt(t, g), S = [];
5565
+ let R = ((i = o.flip) == null ? void 0 : i.overflows) || [];
5566
+ if (d && S.push(T[E]), f) {
5567
+ const L = De(s, r, b);
5568
+ S.push(T[L[0]], T[L[1]]);
5549
5569
  }
5550
- if (b = [...b, {
5570
+ if (R = [...R, {
5551
5571
  placement: s,
5552
5572
  overflows: S
5553
5573
  }], !S.every((L) => L <= 0)) {
5554
- var O, T;
5555
- const L = (((O = o.flip) == null ? void 0 : O.index) || 0) + 1, A = _[L];
5556
- if (A && (!(f === "alignment" ? y !== V(A) : !1) || // We leave the current main axis only if every placement on that axis
5574
+ var v, O;
5575
+ const L = (((v = o.flip) == null ? void 0 : v.index) || 0) + 1, M = _[L];
5576
+ if (M && (!(f === "alignment" ? y !== V(M) : !1) || // We leave the current main axis only if every placement on that axis
5557
5577
  // overflows the main axis.
5558
- b.every((k) => V(k.placement) === y ? k.overflows[0] > 0 : !0)))
5578
+ R.every((k) => V(k.placement) === y ? k.overflows[0] > 0 : !0)))
5559
5579
  return {
5560
5580
  data: {
5561
5581
  index: L,
5562
- overflows: b
5582
+ overflows: R
5563
5583
  },
5564
5584
  reset: {
5565
- placement: A
5585
+ placement: M
5566
5586
  }
5567
5587
  };
5568
- let D = (T = b.filter((N) => N.overflows[0] <= 0).sort((N, k) => N.overflows[1] - k.overflows[1])[0]) == null ? void 0 : T.placement;
5588
+ let D = (O = R.filter((H) => H.overflows[0] <= 0).sort((H, k) => H.overflows[1] - k.overflows[1])[0]) == null ? void 0 : O.placement;
5569
5589
  if (!D)
5570
5590
  switch (x) {
5571
5591
  case "bestFit": {
5572
- var M;
5573
- const N = (M = b.filter((k) => {
5592
+ var A;
5593
+ const H = (A = R.filter((k) => {
5574
5594
  if (I) {
5575
- const F = V(k.placement);
5576
- return F === y || // Create a bias to the `y` side axis due to horizontal
5595
+ const W = V(k.placement);
5596
+ return W === y || // Create a bias to the `y` side axis due to horizontal
5577
5597
  // reading directions favoring greater width.
5578
- F === "y";
5598
+ W === "y";
5579
5599
  }
5580
5600
  return !0;
5581
- }).map((k) => [k.placement, k.overflows.filter((F) => F > 0).reduce((F, se) => F + se, 0)]).sort((k, F) => k[1] - F[1])[0]) == null ? void 0 : M[0];
5582
- N && (D = N);
5601
+ }).map((k) => [k.placement, k.overflows.filter((W) => W > 0).reduce((W, se) => W + se, 0)]).sort((k, W) => k[1] - W[1])[0]) == null ? void 0 : A[0];
5602
+ H && (D = H);
5583
5603
  break;
5584
5604
  }
5585
5605
  case "initialPlacement":
@@ -5661,11 +5681,11 @@ const $e = function(c) {
5661
5681
  limiter: a = {
5662
5682
  fn: (g) => {
5663
5683
  let {
5664
- x: m,
5684
+ x: E,
5665
5685
  y
5666
5686
  } = g;
5667
5687
  return {
5668
- x: m,
5688
+ x: E,
5669
5689
  y
5670
5690
  };
5671
5691
  }
@@ -5674,26 +5694,26 @@ const $e = function(c) {
5674
5694
  } = Q(c, t), h = {
5675
5695
  x: e,
5676
5696
  y: i
5677
- }, d = await Vt(t, l), f = V(z(s)), u = Wt(f);
5697
+ }, d = await Vt(t, l), f = V(z(s)), u = Ft(f);
5678
5698
  let x = h[u], w = h[f];
5679
5699
  if (o) {
5680
- const g = u === "y" ? "top" : "left", m = u === "y" ? "bottom" : "right", y = x + d[g], p = x - d[m];
5700
+ const g = u === "y" ? "top" : "left", E = u === "y" ? "bottom" : "right", y = x + d[g], p = x - d[E];
5681
5701
  x = dt(y, x, p);
5682
5702
  }
5683
5703
  if (r) {
5684
- const g = f === "y" ? "top" : "left", m = f === "y" ? "bottom" : "right", y = w + d[g], p = w - d[m];
5704
+ const g = f === "y" ? "top" : "left", E = f === "y" ? "bottom" : "right", y = w + d[g], p = w - d[E];
5685
5705
  w = dt(y, w, p);
5686
5706
  }
5687
- const E = a.fn({
5707
+ const m = a.fn({
5688
5708
  ...t,
5689
5709
  [u]: x,
5690
5710
  [f]: w
5691
5711
  });
5692
5712
  return {
5693
- ...E,
5713
+ ...m,
5694
5714
  data: {
5695
- x: E.x - e,
5696
- y: E.y - i,
5715
+ x: m.x - e,
5716
+ y: m.y - i,
5697
5717
  enabled: {
5698
5718
  [u]: o,
5699
5719
  [f]: r
@@ -5706,28 +5726,28 @@ const $e = function(c) {
5706
5726
  function nt() {
5707
5727
  return typeof window < "u";
5708
5728
  }
5709
- function Z(c) {
5729
+ function j(c) {
5710
5730
  return Pt(c) ? (c.nodeName || "").toLowerCase() : "#document";
5711
5731
  }
5712
- function H(c) {
5732
+ function N(c) {
5713
5733
  var t;
5714
5734
  return (c == null || (t = c.ownerDocument) == null ? void 0 : t.defaultView) || window;
5715
5735
  }
5716
- function W(c) {
5736
+ function F(c) {
5717
5737
  var t;
5718
5738
  return (t = (Pt(c) ? c.ownerDocument : c.document) || window.document) == null ? void 0 : t.documentElement;
5719
5739
  }
5720
5740
  function Pt(c) {
5721
- return nt() ? c instanceof Node || c instanceof H(c).Node : !1;
5741
+ return nt() ? c instanceof Node || c instanceof N(c).Node : !1;
5722
5742
  }
5723
5743
  function X(c) {
5724
- return nt() ? c instanceof Element || c instanceof H(c).Element : !1;
5744
+ return nt() ? c instanceof Element || c instanceof N(c).Element : !1;
5725
5745
  }
5726
5746
  function K(c) {
5727
- return nt() ? c instanceof HTMLElement || c instanceof H(c).HTMLElement : !1;
5747
+ return nt() ? c instanceof HTMLElement || c instanceof N(c).HTMLElement : !1;
5728
5748
  }
5729
- function Mt(c) {
5730
- return !nt() || typeof ShadowRoot > "u" ? !1 : c instanceof ShadowRoot || c instanceof H(c).ShadowRoot;
5749
+ function At(c) {
5750
+ return !nt() || typeof ShadowRoot > "u" ? !1 : c instanceof ShadowRoot || c instanceof N(c).ShadowRoot;
5731
5751
  }
5732
5752
  const Ue = /* @__PURE__ */ new Set(["inline", "contents"]);
5733
5753
  function et(c) {
@@ -5739,9 +5759,9 @@ function et(c) {
5739
5759
  } = Y(c);
5740
5760
  return /auto|scroll|overlay|hidden|clip/.test(t + i + e) && !Ue.has(s);
5741
5761
  }
5742
- const Ze = /* @__PURE__ */ new Set(["table", "td", "th"]);
5743
- function je(c) {
5744
- return Ze.has(Z(c));
5762
+ const je = /* @__PURE__ */ new Set(["table", "td", "th"]);
5763
+ function Ze(c) {
5764
+ return je.has(j(c));
5745
5765
  }
5746
5766
  const qe = [":popover-open", ":modal"];
5747
5767
  function at(c) {
@@ -5754,14 +5774,14 @@ function at(c) {
5754
5774
  });
5755
5775
  }
5756
5776
  const Je = ["transform", "translate", "scale", "rotate", "perspective"], Qe = ["transform", "translate", "scale", "rotate", "perspective", "filter"], ti = ["paint", "layout", "strict", "content"];
5757
- function mt(c) {
5777
+ function Et(c) {
5758
5778
  const t = pt(), e = X(c) ? Y(c) : c;
5759
5779
  return Je.some((i) => e[i] ? e[i] !== "none" : !1) || (e.containerType ? e.containerType !== "normal" : !1) || !t && (e.backdropFilter ? e.backdropFilter !== "none" : !1) || !t && (e.filter ? e.filter !== "none" : !1) || Qe.some((i) => (e.willChange || "").includes(i)) || ti.some((i) => (e.contain || "").includes(i));
5760
5780
  }
5761
5781
  function ei(c) {
5762
5782
  let t = P(c);
5763
5783
  for (; K(t) && !U(t); ) {
5764
- if (mt(t))
5784
+ if (Et(t))
5765
5785
  return t;
5766
5786
  if (at(t))
5767
5787
  return null;
@@ -5774,10 +5794,10 @@ function pt() {
5774
5794
  }
5775
5795
  const ii = /* @__PURE__ */ new Set(["html", "body", "#document"]);
5776
5796
  function U(c) {
5777
- return ii.has(Z(c));
5797
+ return ii.has(j(c));
5778
5798
  }
5779
5799
  function Y(c) {
5780
- return H(c).getComputedStyle(c);
5800
+ return N(c).getComputedStyle(c);
5781
5801
  }
5782
5802
  function lt(c) {
5783
5803
  return X(c) ? {
@@ -5789,16 +5809,16 @@ function lt(c) {
5789
5809
  };
5790
5810
  }
5791
5811
  function P(c) {
5792
- if (Z(c) === "html")
5812
+ if (j(c) === "html")
5793
5813
  return c;
5794
5814
  const t = (
5795
5815
  // Step into the shadow DOM of the parent of a slotted node.
5796
5816
  c.assignedSlot || // DOM Element detected.
5797
5817
  c.parentNode || // ShadowRoot detected.
5798
- Mt(c) && c.host || // Fallback.
5799
- W(c)
5818
+ At(c) && c.host || // Fallback.
5819
+ F(c)
5800
5820
  );
5801
- return Mt(t) ? t.host : t;
5821
+ return At(t) ? t.host : t;
5802
5822
  }
5803
5823
  function zt(c) {
5804
5824
  const t = P(c);
@@ -5807,7 +5827,7 @@ function zt(c) {
5807
5827
  function $t(c, t, e) {
5808
5828
  var i;
5809
5829
  t === void 0 && (t = []);
5810
- const s = zt(c), o = s === ((i = c.ownerDocument) == null ? void 0 : i.body), r = H(s);
5830
+ const s = zt(c), o = s === ((i = c.ownerDocument) == null ? void 0 : i.body), r = N(s);
5811
5831
  return o ? (xt(r), t.concat(r, r.visualViewport || [], et(s) ? s : [], [])) : t.concat(s, $t(s, []));
5812
5832
  }
5813
5833
  function xt(c) {
@@ -5842,29 +5862,29 @@ function G(c) {
5842
5862
  };
5843
5863
  }
5844
5864
  const si = /* @__PURE__ */ B(0);
5845
- function Zt(c) {
5846
- const t = H(c);
5865
+ function jt(c) {
5866
+ const t = N(c);
5847
5867
  return !pt() || !t.visualViewport ? si : {
5848
5868
  x: t.visualViewport.offsetLeft,
5849
5869
  y: t.visualViewport.offsetTop
5850
5870
  };
5851
5871
  }
5852
5872
  function oi(c, t, e) {
5853
- return t === void 0 && (t = !1), !e || t && e !== H(c) ? !1 : t;
5873
+ return t === void 0 && (t = !1), !e || t && e !== N(c) ? !1 : t;
5854
5874
  }
5855
5875
  function J(c, t, e, i) {
5856
5876
  t === void 0 && (t = !1), e === void 0 && (e = !1);
5857
5877
  const s = c.getBoundingClientRect(), o = Ut(c);
5858
5878
  let r = B(1);
5859
5879
  t && (i ? X(i) && (r = G(i)) : r = G(c));
5860
- const a = oi(o, e, i) ? Zt(o) : B(0);
5880
+ const a = oi(o, e, i) ? jt(o) : B(0);
5861
5881
  let l = (s.left + a.x) / r.x, h = (s.top + a.y) / r.y, d = s.width / r.x, f = s.height / r.y;
5862
5882
  if (o) {
5863
- const u = H(o), x = i && X(i) ? H(i) : i;
5864
- let w = u, E = xt(w);
5865
- for (; E && i && x !== w; ) {
5866
- const g = G(E), m = E.getBoundingClientRect(), y = Y(E), p = m.left + (E.clientLeft + parseFloat(y.paddingLeft)) * g.x, R = m.top + (E.clientTop + parseFloat(y.paddingTop)) * g.y;
5867
- l *= g.x, h *= g.y, d *= g.x, f *= g.y, l += p, h += R, w = H(E), E = xt(w);
5883
+ const u = N(o), x = i && X(i) ? N(i) : i;
5884
+ let w = u, m = xt(w);
5885
+ for (; m && i && x !== w; ) {
5886
+ const g = G(m), E = m.getBoundingClientRect(), y = Y(m), p = E.left + (m.clientLeft + parseFloat(y.paddingLeft)) * g.x, b = E.top + (m.clientTop + parseFloat(y.paddingTop)) * g.y;
5887
+ l *= g.x, h *= g.y, d *= g.x, f *= g.y, l += p, h += b, w = N(m), m = xt(w);
5868
5888
  }
5869
5889
  }
5870
5890
  return rt({
@@ -5876,9 +5896,9 @@ function J(c, t, e, i) {
5876
5896
  }
5877
5897
  function yt(c, t) {
5878
5898
  const e = lt(c).scrollLeft;
5879
- return t ? t.left + e : J(W(c)).left + e;
5899
+ return t ? t.left + e : J(F(c)).left + e;
5880
5900
  }
5881
- function jt(c, t, e) {
5901
+ function Zt(c, t, e) {
5882
5902
  e === void 0 && (e = !1);
5883
5903
  const i = c.getBoundingClientRect(), s = i.left + t.scrollLeft - (e ? 0 : (
5884
5904
  // RTL <body> scrollbar.
@@ -5896,7 +5916,7 @@ function ri(c) {
5896
5916
  offsetParent: i,
5897
5917
  strategy: s
5898
5918
  } = c;
5899
- const o = s === "fixed", r = W(i), a = t ? at(t.floating) : !1;
5919
+ const o = s === "fixed", r = F(i), a = t ? at(t.floating) : !1;
5900
5920
  if (i === r || a && o)
5901
5921
  return e;
5902
5922
  let l = {
@@ -5904,11 +5924,11 @@ function ri(c) {
5904
5924
  scrollTop: 0
5905
5925
  }, h = B(1);
5906
5926
  const d = B(0), f = K(i);
5907
- if ((f || !f && !o) && ((Z(i) !== "body" || et(r)) && (l = lt(i)), K(i))) {
5927
+ if ((f || !f && !o) && ((j(i) !== "body" || et(r)) && (l = lt(i)), K(i))) {
5908
5928
  const x = J(i);
5909
5929
  h = G(i), d.x = x.x + i.clientLeft, d.y = x.y + i.clientTop;
5910
5930
  }
5911
- const u = r && !f && !o ? jt(r, l, !0) : B(0);
5931
+ const u = r && !f && !o ? Zt(r, l, !0) : B(0);
5912
5932
  return {
5913
5933
  width: e.width * h.x,
5914
5934
  height: e.height * h.y,
@@ -5920,7 +5940,7 @@ function ni(c) {
5920
5940
  return Array.from(c.getClientRects());
5921
5941
  }
5922
5942
  function ai(c) {
5923
- const t = W(c), e = lt(c), i = c.ownerDocument.body, s = $(t.scrollWidth, t.clientWidth, i.scrollWidth, i.clientWidth), o = $(t.scrollHeight, t.clientHeight, i.scrollHeight, i.clientHeight);
5943
+ const t = F(c), e = lt(c), i = c.ownerDocument.body, s = $(t.scrollWidth, t.clientWidth, i.scrollWidth, i.clientWidth), o = $(t.scrollHeight, t.clientHeight, i.scrollHeight, i.clientHeight);
5924
5944
  let r = -e.scrollLeft + yt(c);
5925
5945
  const a = -e.scrollTop;
5926
5946
  return Y(i).direction === "rtl" && (r += $(t.clientWidth, i.clientWidth) - s), {
@@ -5931,7 +5951,7 @@ function ai(c) {
5931
5951
  };
5932
5952
  }
5933
5953
  function li(c, t) {
5934
- const e = H(c), i = W(c), s = e.visualViewport;
5954
+ const e = N(c), i = F(c), s = e.visualViewport;
5935
5955
  let o = i.clientWidth, r = i.clientHeight, a = 0, l = 0;
5936
5956
  if (s) {
5937
5957
  o = s.width, r = s.height;
@@ -5955,16 +5975,16 @@ function ci(c, t) {
5955
5975
  y: h
5956
5976
  };
5957
5977
  }
5958
- function At(c, t, e) {
5978
+ function Mt(c, t, e) {
5959
5979
  let i;
5960
5980
  if (t === "viewport")
5961
5981
  i = li(c, e);
5962
5982
  else if (t === "document")
5963
- i = ai(W(c));
5983
+ i = ai(F(c));
5964
5984
  else if (X(t))
5965
5985
  i = ci(t, e);
5966
5986
  else {
5967
- const s = Zt(c);
5987
+ const s = jt(c);
5968
5988
  i = {
5969
5989
  x: t.x - s.x,
5970
5990
  y: t.y - s.y,
@@ -5982,11 +6002,11 @@ function di(c, t) {
5982
6002
  const e = t.get(c);
5983
6003
  if (e)
5984
6004
  return e;
5985
- let i = $t(c, []).filter((a) => X(a) && Z(a) !== "body"), s = null;
6005
+ let i = $t(c, []).filter((a) => X(a) && j(a) !== "body"), s = null;
5986
6006
  const o = Y(c).position === "fixed";
5987
6007
  let r = o ? P(c) : c;
5988
6008
  for (; X(r) && !U(r); ) {
5989
- const a = Y(r), l = mt(r);
6009
+ const a = Y(r), l = Et(r);
5990
6010
  !l && a.position === "fixed" && (s = null), (o ? !l && !s : !l && a.position === "static" && !!s && hi.has(s.position) || et(r) && !l && qt(c, r)) ? i = i.filter((d) => d !== r) : s = a, r = P(r);
5991
6011
  }
5992
6012
  return t.set(c, i), i;
@@ -5999,9 +6019,9 @@ function fi(c) {
5999
6019
  strategy: s
6000
6020
  } = c;
6001
6021
  const r = [...e === "clippingAncestors" ? at(t) ? [] : di(t, this._c) : [].concat(e), i], a = r[0], l = r.reduce((h, d) => {
6002
- const f = At(t, d, s);
6022
+ const f = Mt(t, d, s);
6003
6023
  return h.top = $(f.top, h.top), h.right = q(f.right, h.right), h.bottom = q(f.bottom, h.bottom), h.left = $(f.left, h.left), h;
6004
- }, At(t, a, s));
6024
+ }, Mt(t, a, s));
6005
6025
  return {
6006
6026
  width: l.right - l.left,
6007
6027
  height: l.bottom - l.top,
@@ -6020,7 +6040,7 @@ function xi(c) {
6020
6040
  };
6021
6041
  }
6022
6042
  function ui(c, t, e) {
6023
- const i = K(t), s = W(t), o = e === "fixed", r = J(c, !0, o, t);
6043
+ const i = K(t), s = F(t), o = e === "fixed", r = J(c, !0, o, t);
6024
6044
  let a = {
6025
6045
  scrollLeft: 0,
6026
6046
  scrollTop: 0
@@ -6030,12 +6050,12 @@ function ui(c, t, e) {
6030
6050
  l.x = yt(s);
6031
6051
  }
6032
6052
  if (i || !i && !o)
6033
- if ((Z(t) !== "body" || et(s)) && (a = lt(t)), i) {
6053
+ if ((j(t) !== "body" || et(s)) && (a = lt(t)), i) {
6034
6054
  const x = J(t, !0, o, t);
6035
6055
  l.x = x.x + t.clientLeft, l.y = x.y + t.clientTop;
6036
6056
  } else s && h();
6037
6057
  o && !i && s && h();
6038
- const d = s && !i && !o ? jt(s, a) : B(0), f = r.left + a.scrollLeft - l.x - d.x, u = r.top + a.scrollTop - l.y - d.y;
6058
+ const d = s && !i && !o ? Zt(s, a) : B(0), f = r.left + a.scrollLeft - l.x - d.x, u = r.top + a.scrollTop - l.y - d.y;
6039
6059
  return {
6040
6060
  x: f,
6041
6061
  y: u,
@@ -6052,10 +6072,10 @@ function Ht(c, t) {
6052
6072
  if (t)
6053
6073
  return t(c);
6054
6074
  let e = c.offsetParent;
6055
- return W(c) === e && (e = e.ownerDocument.body), e;
6075
+ return F(c) === e && (e = e.ownerDocument.body), e;
6056
6076
  }
6057
6077
  function Jt(c, t) {
6058
- const e = H(c);
6078
+ const e = N(c);
6059
6079
  if (at(c))
6060
6080
  return e;
6061
6081
  if (!K(c)) {
@@ -6068,9 +6088,9 @@ function Jt(c, t) {
6068
6088
  return e;
6069
6089
  }
6070
6090
  let i = Ht(c, t);
6071
- for (; i && je(i) && ht(i); )
6091
+ for (; i && Ze(i) && ht(i); )
6072
6092
  i = Ht(i, t);
6073
- return i && U(i) && ht(i) && !mt(i) ? e : i || ei(c) || e;
6093
+ return i && U(i) && ht(i) && !Et(i) ? e : i || ei(c) || e;
6074
6094
  }
6075
6095
  const gi = async function(c) {
6076
6096
  const t = this.getOffsetParent || Jt, e = this.getDimensions, i = await e(c.floating);
@@ -6087,9 +6107,9 @@ const gi = async function(c) {
6087
6107
  function wi(c) {
6088
6108
  return Y(c).direction === "rtl";
6089
6109
  }
6090
- const Ei = {
6110
+ const mi = {
6091
6111
  convertOffsetParentRelativeRectToViewportRelativeRect: ri,
6092
- getDocumentElement: W,
6112
+ getDocumentElement: F,
6093
6113
  getClippingRect: fi,
6094
6114
  getOffsetParent: Jt,
6095
6115
  getElementRects: gi,
@@ -6098,15 +6118,15 @@ const Ei = {
6098
6118
  getScale: G,
6099
6119
  isElement: X,
6100
6120
  isRTL: wi
6101
- }, Qt = $e, te = Ge, ee = Ve, mi = Fe, ie = (c, t, e) => {
6121
+ }, Qt = $e, te = Ge, ee = Ve, Ei = We, ie = (c, t, e) => {
6102
6122
  const i = /* @__PURE__ */ new Map(), s = {
6103
- platform: Ei,
6123
+ platform: mi,
6104
6124
  ...e
6105
6125
  }, o = {
6106
6126
  ...s.platform,
6107
6127
  _c: i
6108
6128
  };
6109
- return We(c, t, {
6129
+ return Fe(c, t, {
6110
6130
  ...s,
6111
6131
  platform: o
6112
6132
  });
@@ -6188,7 +6208,7 @@ let pi = class {
6188
6208
  }
6189
6209
  }, this.floatingEl, {
6190
6210
  placement: t.overflowTooltipPlacement,
6191
- middleware: [te(), ee(), Qt(6), mi({ element: this.arrowEl })]
6211
+ middleware: [te(), ee(), Qt(6), Ei({ element: this.arrowEl })]
6192
6212
  }).then((a) => {
6193
6213
  const { x: l, y: h, placement: d, middlewareData: f } = a;
6194
6214
  if (Object.assign(this.floatingEl.style, {
@@ -6454,7 +6474,7 @@ class bi {
6454
6474
  n(this, "ctx");
6455
6475
  n(this, "observer");
6456
6476
  this.ctx = t, this.observer = new MutationObserver(
6457
- j(() => {
6477
+ Z(() => {
6458
6478
  const e = this.ctx.overlayerElement.querySelectorAll('[data-auto-height="true"]'), i = /* @__PURE__ */ new Map();
6459
6479
  e.forEach((r) => {
6460
6480
  const a = Number(r.getAttribute("data-row-index")), l = Number(r.getAttribute("data-col-index"));
@@ -6556,8 +6576,8 @@ class bi {
6556
6576
  const t = [], e = [], i = [];
6557
6577
  let s = this.ctx.body.renderRows;
6558
6578
  this.ctx.config.FOOTER_FIXED || (s = s.concat(this.ctx.footer.renderRows)), s.forEach((g) => {
6559
- g.cells.forEach((m) => {
6560
- m.cellType === "footer" && (m.render = m.renderFooter), m.render && (m.fixed === "left" ? e.push(m) : m.fixed === "right" ? i.push(m) : t.push(m));
6579
+ g.cells.forEach((E) => {
6580
+ E.cellType === "footer" && (E.render = E.renderFooter), E.render && (E.fixed === "left" ? e.push(E) : E.fixed === "right" ? i.push(E) : t.push(E));
6561
6581
  });
6562
6582
  });
6563
6583
  const {
@@ -6612,8 +6632,8 @@ class bi {
6612
6632
  }
6613
6633
  getFooter() {
6614
6634
  const t = [], e = [], i = [];
6615
- this.ctx.footer.renderRows.forEach((E) => {
6616
- E.cells.forEach((g) => {
6635
+ this.ctx.footer.renderRows.forEach((m) => {
6636
+ m.cells.forEach((g) => {
6617
6637
  g.cellType === "footer" && g.renderFooter && (g.render = g.renderFooter, g.fixed === "left" ? e.push(g) : g.fixed === "right" ? i.push(g) : t.push(g));
6618
6638
  });
6619
6639
  });
@@ -6728,12 +6748,14 @@ class Ri {
6728
6748
  }
6729
6749
  //创建右键菜单子项元素
6730
6750
  createContextMenuItems(t, e) {
6731
- this.contextMenuEl.replaceChildren(), t.forEach((i) => {
6732
- const s = document.createElement("div");
6733
- s.className = "e-virt-table-context-menu-item", s.innerText = i.label, i.event ? s.onclick = () => {
6734
- i.event && i.event(), e(i);
6735
- } : s.onclick = () => e(i), this.contextMenuEl.appendChild(s);
6736
- });
6751
+ this.contextMenuEl.replaceChildren();
6752
+ const i = document.createDocumentFragment();
6753
+ t.forEach((s) => {
6754
+ const o = document.createElement("div");
6755
+ o.className = "e-virt-table-context-menu-item", o.innerText = s.label, s.event ? o.onclick = () => {
6756
+ s.event && s.event(), e(s);
6757
+ } : o.onclick = () => e(s), i.appendChild(o);
6758
+ }), this.contextMenuEl.appendChild(i);
6737
6759
  }
6738
6760
  show(t, e) {
6739
6761
  Object.assign(this.contextMenuEl.style, {
@@ -6810,7 +6832,7 @@ class Ti {
6810
6832
  );
6811
6833
  this.ctx = new Ie(a, this.options), this.header = new _e(this.ctx), this.footer = new Te(this.ctx), this.body = new ve(this.ctx), this.scroller = new Se(this.ctx), this.selector = new Oe(this.ctx), this.autofill = new Le(this.ctx), this.tooltip = new pi(this.ctx), this.empty = new Ci(this.ctx), this.editor = new yi(this.ctx), this.overlayer = new bi(this.ctx), this.contextMenu = new Ri(this.ctx), this.loading = new Ii(this.ctx), this.ctx.on(
6812
6834
  "draw",
6813
- j(
6835
+ Z(
6814
6836
  () => {
6815
6837
  this.draw();
6816
6838
  },
@@ -6818,7 +6840,7 @@ class Ti {
6818
6840
  )
6819
6841
  ), this.ctx.on(
6820
6842
  "drawView",
6821
- j(
6843
+ Z(
6822
6844
  () => {
6823
6845
  this.draw(!0);
6824
6846
  },