e-virt-table 1.4.3 → 1.4.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (43) hide show
  1. package/README.md +1 -1
  2. package/dist/index.cjs.js +7 -7
  3. package/dist/index.cjs.js.map +1 -1
  4. package/dist/index.es.js +872 -998
  5. package/dist/index.es.js.map +1 -1
  6. package/dist/index.umd.js +8 -8
  7. package/dist/index.umd.js.map +1 -1
  8. package/dist/lib/BaseCell.d.ts +1 -0
  9. package/dist/lib/BaseCell.js +29 -0
  10. package/dist/lib/BaseCell.js.map +1 -1
  11. package/dist/lib/Body.js +14 -17
  12. package/dist/lib/Body.js.map +1 -1
  13. package/dist/lib/Config.d.ts +0 -6
  14. package/dist/lib/Config.js +0 -21
  15. package/dist/lib/Config.js.map +1 -1
  16. package/dist/lib/Context.d.ts +0 -11
  17. package/dist/lib/Context.js +15 -50
  18. package/dist/lib/Context.js.map +1 -1
  19. package/dist/lib/EVirtTable.d.ts +0 -6
  20. package/dist/lib/EVirtTable.js +0 -10
  21. package/dist/lib/EVirtTable.js.map +1 -1
  22. package/dist/lib/Editor.js +18 -21
  23. package/dist/lib/Editor.js.map +1 -1
  24. package/dist/lib/Empty.js +1 -1
  25. package/dist/lib/Empty.js.map +1 -1
  26. package/dist/lib/EventBrowser.js +2 -10
  27. package/dist/lib/EventBrowser.js.map +1 -1
  28. package/dist/lib/Header.js +46 -17
  29. package/dist/lib/Header.js.map +1 -1
  30. package/dist/lib/Overlayer.js +11 -4
  31. package/dist/lib/Overlayer.js.map +1 -1
  32. package/dist/lib/Paint.d.ts +1 -1
  33. package/dist/lib/Paint.js +2 -3
  34. package/dist/lib/Paint.js.map +1 -1
  35. package/dist/lib/Scroller.js +5 -10
  36. package/dist/lib/Scroller.js.map +1 -1
  37. package/dist/lib/Tooltip.js +12 -7
  38. package/dist/lib/Tooltip.js.map +1 -1
  39. package/dist/lib/types.d.ts +2 -0
  40. package/package.json +1 -1
  41. package/dist/lib/ZoomScale.d.ts +0 -55
  42. package/dist/lib/ZoomScale.js +0 -137
  43. package/dist/lib/ZoomScale.js.map +0 -1
package/dist/index.es.js CHANGED
@@ -8,13 +8,13 @@ class Oe {
8
8
  this.rules = t;
9
9
  }
10
10
  validate(t) {
11
- const e = [], { column: i, row: s, key: o, rowKey: r, colIndex: a, rowIndex: l, value: c, field: d, fieldValue: f } = t;
11
+ const e = [], { column: i, row: s, key: o, rowKey: r, colIndex: a, rowIndex: l, value: c, field: f, fieldValue: d } = t;
12
12
  Array.isArray(this.rules) || (this.rules = [this.rules]);
13
13
  for (const u of this.rules) {
14
14
  if (u.validator) {
15
15
  const x = {
16
- field: d,
17
- fieldValue: f,
16
+ field: f,
17
+ fieldValue: d,
18
18
  value: c,
19
19
  column: i,
20
20
  colIndex: a,
@@ -41,8 +41,8 @@ class Oe {
41
41
  rowKey: r,
42
42
  colIndex: a,
43
43
  rowIndex: l,
44
- field: d,
45
- fieldValue: f,
44
+ field: f,
45
+ fieldValue: d,
46
46
  message: u.message || `${o} is pattern validation error`
47
47
  }), u.required && (c == null || c === "") && e.push({
48
48
  value: c,
@@ -52,8 +52,8 @@ class Oe {
52
52
  rowKey: r,
53
53
  colIndex: a,
54
54
  rowIndex: l,
55
- field: d,
56
- fieldValue: f,
55
+ field: f,
56
+ fieldValue: d,
57
57
  message: u.message || `${o} is required`
58
58
  });
59
59
  }
@@ -130,17 +130,17 @@ function le(h) {
130
130
  // 递归处理
131
131
  } : { ...t });
132
132
  }
133
- const Pt = /^(\r\n|\n\r|\r|\n)/, Me = /^[^\t\r\n]+/, zt = /^\t/;
133
+ const zt = /^(\r\n|\n\r|\r|\n)/, Me = /^[^\t\r\n]+/, Pt = /^\t/;
134
134
  function Ae(h) {
135
135
  let t = [[""]];
136
136
  if (h.length === 0)
137
137
  return t;
138
138
  let e = 0, i = 0, s;
139
139
  for (; h.length > 0 && s !== h.length; )
140
- if (s = h.length, h.match(zt))
141
- h = h.replace(zt, ""), e += 1, t[i][e] = "";
142
- else if (h.match(Pt))
143
- h = h.replace(Pt, ""), e = 0, i += 1, t[i] = [""];
140
+ if (s = h.length, h.match(Pt))
141
+ h = h.replace(Pt, ""), e += 1, t[i][e] = "";
142
+ else if (h.match(zt))
143
+ h = h.replace(zt, ""), e = 0, i += 1, t[i] = [""];
144
144
  else {
145
145
  let o = "";
146
146
  if (h.startsWith('"')) {
@@ -176,7 +176,7 @@ function ce(h, t, e = []) {
176
176
  if (r === 0)
177
177
  s.push(1);
178
178
  else {
179
- const a = e.reduce((c, d) => `${c}${o[d] ?? ""}`, "") || o[t], l = e.reduce((c, d) => `${c}${h[r - 1][d] ?? ""}`, "") || h[r - 1][t];
179
+ const a = e.reduce((c, f) => `${c}${o[f] ?? ""}`, "") || o[t], l = e.reduce((c, f) => `${c}${h[r - 1][f] ?? ""}`, "") || h[r - 1][t];
180
180
  a === l ? (s[i] += 1, s.push(0)) : (s.push(1), i = r);
181
181
  }
182
182
  }), s;
@@ -223,7 +223,7 @@ function ke(h, t = document.documentElement) {
223
223
  const e = h.startsWith("--") ? h : `--${h}`;
224
224
  return getComputedStyle(t).getPropertyValue(e).trim();
225
225
  }
226
- function Gt(h) {
226
+ function $t(h) {
227
227
  if (!h) return /* @__PURE__ */ new Date(0);
228
228
  if (typeof h == "number")
229
229
  return new Date(h);
@@ -261,14 +261,14 @@ function Gt(h) {
261
261
  if (o) {
262
262
  const r = o.slice(1).map(Number);
263
263
  if (s.source.includes("YYYY-MM-DD") || s.source.includes("YYYY/MM/DD") || s.source.includes("YYYY.MM.DD")) {
264
- const [a, l, c, d = 0, f = 0, u = 0] = r;
265
- return new Date(a, l - 1, c, d, f, u);
264
+ const [a, l, c, f = 0, d = 0, u = 0] = r;
265
+ return new Date(a, l - 1, c, f, d, u);
266
266
  } else if (s.source.includes("DD-MM-YYYY") || s.source.includes("DD/MM/YYYY") || s.source.includes("DD.MM.YYYY")) {
267
- const [a, l, c, d = 0, f = 0, u = 0] = r;
268
- return new Date(c, l - 1, a, d, f, u);
267
+ const [a, l, c, f = 0, d = 0, u = 0] = r;
268
+ return new Date(c, l - 1, a, f, d, u);
269
269
  } else if (s.source.includes("MM-DD-YYYY") || s.source.includes("MM/DD/YYYY") || s.source.includes("MM.DD.YYYY")) {
270
- const [a, l, c, d = 0, f = 0, u = 0] = r;
271
- return new Date(c, a - 1, l, d, f, u);
270
+ const [a, l, c, f = 0, d = 0, u = 0] = r;
271
+ return new Date(c, a - 1, l, f, d, u);
272
272
  } else if (s.source.includes("YYYYMMDD")) {
273
273
  const [a, l, c] = r;
274
274
  return new Date(a, l - 1, c);
@@ -278,7 +278,7 @@ function Gt(h) {
278
278
  return /* @__PURE__ */ new Date(NaN);
279
279
  }
280
280
  function Be(h, t) {
281
- const e = Gt(h), i = Gt(t);
281
+ const e = $t(h), i = $t(t);
282
282
  return isNaN(e.getTime()) && isNaN(i.getTime()) ? 0 : isNaN(e.getTime()) ? -1 : isNaN(i.getTime()) ? 1 : e.getTime() - i.getTime();
283
283
  }
284
284
  function Xe(h) {
@@ -297,7 +297,7 @@ function B(h) {
297
297
  function de(h) {
298
298
  return h.SCROLLER_TRACK_SIZE || 0;
299
299
  }
300
- function $t(h, t) {
300
+ function Gt(h, t) {
301
301
  return !V(h) || !t ? 0 : de(h);
302
302
  }
303
303
  function Ke(h) {
@@ -312,7 +312,7 @@ function We(h) {
312
312
  function Ve(h, t) {
313
313
  return V(h) && t;
314
314
  }
315
- function Pe(h, t) {
315
+ function ze(h, t) {
316
316
  return V(h) ? t.innerVisible || t.isFocus || t.isDragging : !0;
317
317
  }
318
318
  class fe {
@@ -381,8 +381,15 @@ class fe {
381
381
  const { offsetX: i, offsetY: s } = this.ctx.getOffset(e), o = this.getImage(t);
382
382
  return o ? o.isInside(i, s) : !1;
383
383
  }
384
+ // 判断图片点击方向返回点击上下左右
385
+ getImageClickDirection(t, e) {
386
+ const { offsetX: i, offsetY: s } = this.ctx.getOffset(e), o = this.getImage(t);
387
+ if (!o) return null;
388
+ const r = i - o.x, a = s - o.y, l = o.width / 2, c = o.height / 2;
389
+ return a < c ? r < l ? "up-left" : "up-right" : r < l ? "down-left" : "down-right";
390
+ }
384
391
  }
385
- class q {
392
+ class Z {
386
393
  constructor(t, e, i, s, o, r) {
387
394
  n(this, "source");
388
395
  n(this, "name");
@@ -417,19 +424,19 @@ function kt(h) {
417
424
  const t = rt(h);
418
425
  return t === "default" || t === "inner";
419
426
  }
420
- function ze(h) {
427
+ function Pe(h) {
421
428
  const t = rt(h);
422
429
  return t === "default" || t === "outer";
423
430
  }
424
431
  function St(h) {
425
432
  return rt(h) === "default";
426
433
  }
427
- function Ge(h, t) {
434
+ function $e(h, t) {
428
435
  return St(h) || t;
429
436
  }
430
437
  class ue extends fe {
431
- constructor(e, i, s, o, r, a, l, c, d, f = "body", u = !0) {
432
- super(e, o, r, a, l, f, c.fixed);
438
+ constructor(e, i, s, o, r, a, l, c, f, d = "body", u = !0) {
439
+ super(e, o, r, a, l, d, c.fixed);
433
440
  n(this, "parentRowKey", "");
434
441
  n(this, "parentRowKeys", []);
435
442
  n(this, "formatter");
@@ -499,7 +506,7 @@ class ue extends fe {
499
506
  n(this, "mixedRender", !1);
500
507
  n(this, "renderType", "default");
501
508
  n(this, "renderFooterType", "default");
502
- this.visibleWidth = this.width, this.visibleHeight = this.height, this.colIndex = s, this.rowIndex = i, this.key = c.key, this.type = c.type || "", this.editorType = c.editorType || "text", this.selectorCellValueType = c.selectorCellValueType || this.ctx.config.SELECTOR_CELL_VALUE_TYPE || "value", this.editorProps = c.editorProps || {}, this.cellType = f, this.align = c.align || this.ctx.config.COLUMNS_ALIGN, this.verticalAlign = c.verticalAlign || this.ctx.config.COLUMNS_VERTICAL_ALIGN, this.fixed = c.fixed || "", this.level = c.level || 0, this.operation = c.operation || !1, this.column = c, this.rules = c.rules || [], this.row = d, this.rowKey = this.cellType === "body" ? this.ctx.database.getRowKeyForRowIndex(i) : `${this.cellType}_${this.rowIndex}`, this.value = this.getValue(), this.render = c.render, this.overflowTooltipShow = c.overflowTooltipShow !== !1, this.autoRowHeight = c.autoRowHeight !== void 0 ? c.autoRowHeight : this.ctx.config.AUTO_ROW_HEIGHT, this.overflowTooltipMaxWidth = c.overflowTooltipMaxWidth || 500, this.overflowTooltipPlacement = c.overflowTooltipPlacement || "top", this.renderFooter = c.renderFooter, this.hoverIconName = c.hoverIconName, this.formatter = c.formatter, this.formatterFooter = c.formatterFooter, this.maxLineClamp = c.maxLineClamp || "auto", this.precision = c.precision, this.min = c.min, this.max = c.max, this.maxlength = c.maxlength, this.mixedRender = c.mixedRender || !1, this.renderType = c.renderType || "default", this.renderFooterType = c.renderFooterType || "default";
509
+ this.visibleWidth = this.width, this.visibleHeight = this.height, this.colIndex = s, this.rowIndex = i, this.key = c.key, this.type = c.type || "", this.editorType = c.editorType || "text", this.selectorCellValueType = c.selectorCellValueType || this.ctx.config.SELECTOR_CELL_VALUE_TYPE || "value", this.editorProps = c.editorProps || {}, this.cellType = d, this.align = c.align || this.ctx.config.COLUMNS_ALIGN, this.verticalAlign = c.verticalAlign || this.ctx.config.COLUMNS_VERTICAL_ALIGN, this.fixed = c.fixed || "", this.level = c.level || 0, this.operation = c.operation || !1, this.column = c, this.rules = c.rules || [], this.row = f, this.rowKey = this.cellType === "body" ? this.ctx.database.getRowKeyForRowIndex(i) : `${this.cellType}_${this.rowIndex}`, this.value = this.getValue(), this.render = c.render, this.overflowTooltipShow = c.overflowTooltipShow !== !1, this.autoRowHeight = c.autoRowHeight !== void 0 ? c.autoRowHeight : this.ctx.config.AUTO_ROW_HEIGHT, this.overflowTooltipMaxWidth = c.overflowTooltipMaxWidth || 500, this.overflowTooltipPlacement = c.overflowTooltipPlacement || "top", this.renderFooter = c.renderFooter, this.hoverIconName = c.hoverIconName, this.formatter = c.formatter, this.formatterFooter = c.formatterFooter, this.maxLineClamp = c.maxLineClamp || "auto", this.precision = c.precision, this.min = c.min, this.max = c.max, this.maxlength = c.maxlength, this.mixedRender = c.mixedRender || !1, this.renderType = c.renderType || "default", this.renderFooterType = c.renderFooterType || "default";
503
510
  const x = this.ctx.database.getRowForRowKey(this.rowKey);
504
511
  this.cellType === "body" && x && (this.parentRowKey = x.parentRowKey, this.parentRowKeys = x.parentRowKeys), u && this.update();
505
512
  }
@@ -624,29 +631,29 @@ class ue extends fe {
624
631
  let o, r = 0, a = "";
625
632
  if (!(["tree", "selection-tree", "tree-selection"].includes(this.type) && s === "body"))
626
633
  return;
627
- const l = this.ctx.database.getRowForRowKey(i), { expand: c = !1, hasChildren: d = !1, expandLoading: f = !1, level: u = 0 } = l || {};
628
- this.rowExpand = c, this.rowHasChildren = d;
634
+ const l = this.ctx.database.getRowForRowKey(i), { expand: c = !1, hasChildren: f = !1, expandLoading: d = !1, level: u = 0 } = l || {};
635
+ this.rowExpand = c, this.rowHasChildren = f;
629
636
  const { TREE_INDENT: x = 16, CHECKBOX_SIZE: g, TREE_ICON_SIZE: E } = this.ctx.config;
630
- if (r = u * x, f) {
637
+ if (r = u * x, d) {
631
638
  const _ = this.ctx.icons.get("loading");
632
639
  a = "loading", o = _;
633
- } else if (d) {
640
+ } else if (f) {
634
641
  const _ = this.ctx.icons.get("expand"), R = this.ctx.icons.get("shrink");
635
642
  o = c ? R : _, a = c ? "shrink" : "expand";
636
643
  }
637
- let m = E, w = E, y = this.drawX;
638
- (this.align === "center" || this.align === "right") && (y = this.drawX + (this.visibleWidth - m - 2 * e) / 2, this.align = "left");
639
- let b = y + r + e, p = this.drawY + (this.visibleHeight - w) / 2, C = r + this.drawX + m - 0.5;
640
- const v = this.getImage("selection"), I = this.getImage("drag"), T = I ? I.width : 0;
641
- if (this.type === "selection-tree" && v) {
642
- const _ = v.x, R = v.width;
643
- b = r + _ + R, C = b + m - e / 2;
644
- } else this.type === "tree-selection" ? (b += T, C = b + g + m - e / 2) : (b += T, C = b + m - e / 2);
645
- this.drawTextX = C, this.drawTextWidth = this.drawX + this.visibleWidth - C, !(b + m + e > this.drawX + this.visibleWidth) && (p + w + e > this.drawY + this.visibleHeight || this.setImage("tree", new q(a, b, p, m, w, o)));
644
+ let w = E, m = E, y = this.drawX;
645
+ (this.align === "center" || this.align === "right") && (y = this.drawX + (this.visibleWidth - w - 2 * e) / 2, this.align = "left");
646
+ let b = y + r + e, p = this.drawY + (this.visibleHeight - m) / 2, C = r + this.drawX + w - 0.5;
647
+ const I = this.getImage("selection"), v = this.getImage("drag"), T = v ? v.width : 0;
648
+ if (this.type === "selection-tree" && I) {
649
+ const _ = I.x, R = I.width;
650
+ b = r + _ + R, C = b + w - e / 2;
651
+ } else this.type === "tree-selection" ? (b += T, C = b + g + w - e / 2) : (b += T, C = b + w - e / 2);
652
+ this.drawTextX = C, this.drawTextWidth = this.drawX + this.visibleWidth - C, !(b + w + e > this.drawX + this.visibleWidth) && (p + m + e > this.drawY + this.visibleHeight || this.setImage("tree", new Z(a, b, p, w, m, o)));
646
653
  }
647
654
  updateDragImage() {
648
655
  if (this.cellType === "body" && this.column.dragRow) {
649
- const { DRAG_ROW_ICON_SIZE: e, CELL_PADDING: i } = this.ctx.config, s = this.drawX + i / 2, o = this.drawY + (this.visibleHeight - e) / 2, r = new q("drag", s, o, e, e, this.ctx.icons.get("drag"));
656
+ const { DRAG_ROW_ICON_SIZE: e, CELL_PADDING: i } = this.ctx.config, s = this.drawX + i / 2, o = this.drawY + (this.visibleHeight - e) / 2, r = new Z("drag", s, o, e, e, this.ctx.icons.get("drag"));
650
657
  this.rowspan === 0 && r.setVisible(!1), this.setImage("drag", r);
651
658
  }
652
659
  }
@@ -655,13 +662,13 @@ class ue extends fe {
655
662
  if (!e || this.cellType !== "body" || !["tree", "selection-tree", "tree-selection"].includes(this.type) || this.rowspan === 0 || this.colspan === 0) return;
656
663
  const r = this.ctx.database.getRowForRowKey(this.rowKey) || {}, a = r.level ?? 0, l = this.getImage("tree");
657
664
  if (!l) return;
658
- const c = l.x, d = l.y, f = l.width, u = l.height, x = c + f / 2, g = d + u / 2;
665
+ const c = l.x, f = l.y, d = l.width, u = l.height, x = c + d / 2, g = f + u / 2;
659
666
  let E = c - a * i;
660
- const m = Array.isArray(r.parentRowKeys) ? r.parentRowKeys : [];
667
+ const w = Array.isArray(r.parentRowKeys) ? r.parentRowKeys : [];
661
668
  if (a > 0) {
662
669
  for (let C = 0; C < a - 1; C += 1) {
663
- const v = m[C + 1];
664
- if (!!(v ? this.ctx.database.getRowForRowKey(v) || {} : {}).isLastChild) continue;
670
+ const I = w[C + 1];
671
+ if (!!(I ? this.ctx.database.getRowForRowKey(I) || {} : {}).isLastChild) continue;
665
672
  const _ = Math.round(c - (a - C) * i + s / 2);
666
673
  this.ctx.paint.drawLine([_, this.drawY, _, this.drawY + this.visibleHeight], {
667
674
  borderColor: o,
@@ -670,8 +677,8 @@ class ue extends fe {
670
677
  lineDashOffset: 0
671
678
  });
672
679
  }
673
- const w = Math.round(c - i + s / 2), b = !!r.isLastChild ? g : this.drawY + this.visibleHeight;
674
- this.ctx.paint.drawLine([w, this.drawY, w, b], {
680
+ const m = Math.round(c - i + s / 2), b = !!r.isLastChild ? g : this.drawY + this.visibleHeight;
681
+ this.ctx.paint.drawLine([m, this.drawY, m, b], {
675
682
  borderColor: o,
676
683
  borderWidth: 1,
677
684
  lineDash: [4, 4],
@@ -686,8 +693,8 @@ class ue extends fe {
686
693
  });
687
694
  }
688
695
  if (r.hasChildren && r.expand) {
689
- const w = d + u, y = this.drawY + this.visibleHeight;
690
- this.ctx.paint.drawLine([x, w, x, y], {
696
+ const m = f + u, y = this.drawY + this.visibleHeight;
697
+ this.ctx.paint.drawLine([x, m, x, y], {
691
698
  borderColor: o,
692
699
  borderWidth: 1,
693
700
  lineDash: [4, 4],
@@ -705,13 +712,13 @@ class ue extends fe {
705
712
  BODY_TEXT_COLOR: a,
706
713
  FOOTER_TEXT_COLOR: l,
707
714
  FOOTER_BG_COLOR: c,
708
- HIGHLIGHT_SELECTED_ROW: d,
709
- HIGHLIGHT_SELECTED_ROW_COLOR: f,
715
+ HIGHLIGHT_SELECTED_ROW: f,
716
+ HIGHLIGHT_SELECTED_ROW_COLOR: d,
710
717
  HIGHLIGHT_HOVER_ROW: u,
711
718
  HIGHLIGHT_HOVER_ROW_COLOR: x,
712
719
  STRIPE: g,
713
720
  STRIPE_COLOR: E,
714
- FINDER_CELL_BG_COLOR: m
721
+ FINDER_CELL_BG_COLOR: w
715
722
  } = this.ctx.config;
716
723
  if (this.cellType === "footer") {
717
724
  let S = c, O = l;
@@ -728,16 +735,16 @@ class ue extends fe {
728
735
  this.drawCellSkyBgColor = "transparent", this.drawCellBgColor = S, this.drawTextColor = O;
729
736
  return;
730
737
  }
731
- let w = "transparent";
738
+ let m = "transparent";
732
739
  const y = this.ctx.hoverCell, b = this.ctx.currentCell;
733
740
  let p = this.rowIndex, C = this.rowIndex;
734
- if (this.rowspan !== 1 && (u || d)) {
741
+ if (this.rowspan !== 1 && (u || f)) {
735
742
  const S = this.getSpanInfo(), { yArr: O } = S;
736
743
  p = O[0], C = O[1];
737
744
  }
738
- u && y && !this.ctx.dragRowIng && (y.rowKey === this.rowKey && (w = x), y.rowIndex >= p && y.rowIndex <= C && (w = x)), d && b && !this.ctx.dragRowIng && (b.rowKey === this.rowKey && (w = f), b.rowIndex >= p && b.rowIndex <= C && (w = f)), this.drawCellSkyBgColor = w;
739
- let v = e, I = a;
740
- if (this.ctx.database.getReadonly(this.rowKey, this.key) || (v = i, I = r), g && (this.rowIndex % 2 ? v = E : v = e), typeof s == "function") {
745
+ u && y && !this.ctx.dragRowIng && (y.rowKey === this.rowKey && (m = x), y.rowIndex >= p && y.rowIndex <= C && (m = x)), f && b && !this.ctx.dragRowIng && (b.rowKey === this.rowKey && (m = d), b.rowIndex >= p && b.rowIndex <= C && (m = d)), this.drawCellSkyBgColor = m;
746
+ let I = e, v = a;
747
+ if (this.ctx.database.getReadonly(this.rowKey, this.key) || (I = i, v = r), g && (this.rowIndex % 2 ? I = E : I = e), typeof s == "function") {
741
748
  const S = s, { backgroundColor: O, color: M, font: L } = S({
742
749
  row: this.row,
743
750
  rowIndex: this.rowIndex,
@@ -746,42 +753,42 @@ class ue extends fe {
746
753
  isHasChanged: this.isHasChanged,
747
754
  value: this.getValue()
748
755
  }) || {};
749
- O && (v = O), M && (I = M), L && (this.drawTextFont = L);
756
+ O && (I = O), M && (v = M), L && (this.drawTextFont = L);
750
757
  }
751
758
  const { rowIndex: T, colIndex: _, type: R } = this.ctx.finderBar;
752
- T === this.rowIndex && _ === this.colIndex && R === "body" && (v = m), this.drawCellBgColor = v, this.drawTextColor = I;
759
+ T === this.rowIndex && _ === this.colIndex && R === "body" && (I = w), this.drawCellBgColor = I, this.drawTextColor = v;
753
760
  }
754
761
  updateSelection() {
755
762
  const { visibleWidth: e, visibleHeight: i, rowspan: s, colspan: o, cellType: r, type: a, rowIndex: l, rowKey: c } = this;
756
763
  if (s === 0 || o === 0 || r === "footer" || !["index-selection", "selection", "selection-tree", "tree-selection"].includes(a))
757
764
  return;
758
- const d = this.ctx.database.getRowSelectable(c), { CHECKBOX_SIZE: f = 0, CELL_PADDING: u } = this.ctx.config;
765
+ const f = this.ctx.database.getRowSelectable(c), { CHECKBOX_SIZE: d = 0, CELL_PADDING: u } = this.ctx.config;
759
766
  let x = this.drawX + u;
760
- (this.align === "center" || this.align === "right") && (x = this.drawX + (e - f) / 2);
761
- let g = x, E = this.drawY + (i - f) / 2;
767
+ (this.align === "center" || this.align === "right") && (x = this.drawX + (e - d) / 2);
768
+ let g = x, E = this.drawY + (i - d) / 2;
762
769
  if (a !== "selection-tree") {
763
770
  if (a === "tree-selection") {
764
- const { TREE_INDENT: C = 16, TREE_ICON_SIZE: v } = this.ctx.config, I = this.ctx.database.getRowForRowKey(c), { level: T = 0 } = I || {}, _ = T * C;
765
- g = x + v + _;
771
+ const { TREE_INDENT: C = 16, TREE_ICON_SIZE: I } = this.ctx.config, v = this.ctx.database.getRowForRowKey(c), { level: T = 0 } = v || {}, _ = T * C;
772
+ g = x + I + _;
766
773
  }
767
774
  }
768
- let m = this.ctx.icons.get("checkbox-uncheck"), w = "checkbox-uncheck";
775
+ let w = this.ctx.icons.get("checkbox-uncheck"), m = "checkbox-uncheck";
769
776
  if (a === "selection-tree" || a === "tree-selection") {
770
777
  const C = this.ctx.database.getTreeSelectionState(c);
771
- C.indeterminate && d ? (m = this.ctx.icons.get("checkbox-indeterminate"), w = "checkbox-indeterminate") : C.checked && d ? (m = this.ctx.icons.get("checkbox-check"), w = "checkbox-check") : !C.checked && d ? (m = this.ctx.icons.get("checkbox-uncheck"), w = "checkbox-uncheck") : (m = this.ctx.icons.get("checkbox-disabled"), w = "checkbox-disabled");
778
+ C.indeterminate && f ? (w = this.ctx.icons.get("checkbox-indeterminate"), m = "checkbox-indeterminate") : C.checked && f ? (w = this.ctx.icons.get("checkbox-check"), m = "checkbox-check") : !C.checked && f ? (w = this.ctx.icons.get("checkbox-uncheck"), m = "checkbox-uncheck") : (w = this.ctx.icons.get("checkbox-disabled"), m = "checkbox-disabled");
772
779
  } else {
773
780
  const C = this.ctx.database.getRowSelection(c);
774
- C && d ? (m = this.ctx.icons.get("checkbox-check"), w = "checkbox-check") : C && !d ? (m = this.ctx.icons.get("checkbox-check-disabled"), w = "checkbox-check-disabled") : !C && d ? (m = this.ctx.icons.get("checkbox-uncheck"), w = "checkbox-uncheck") : (m = this.ctx.icons.get("checkbox-disabled"), w = "checkbox-disabled");
781
+ C && f ? (w = this.ctx.icons.get("checkbox-check"), m = "checkbox-check") : C && !f ? (w = this.ctx.icons.get("checkbox-check-disabled"), m = "checkbox-check-disabled") : !C && f ? (w = this.ctx.icons.get("checkbox-uncheck"), m = "checkbox-uncheck") : (w = this.ctx.icons.get("checkbox-disabled"), m = "checkbox-disabled");
775
782
  }
776
783
  const y = this.getImage("drag"), b = y ? y.width : 0;
777
- if (g += b, g + f + u > this.drawX + this.visibleWidth || E + f + u > this.drawY + this.visibleHeight)
784
+ if (g += b, g + d + u > this.drawX + this.visibleWidth || E + d + u > this.drawY + this.visibleHeight)
778
785
  return;
779
- const p = new q(w, g, E, f, f, m);
786
+ const p = new Z(m, g, E, d, d, w);
780
787
  if (a === "index-selection") {
781
- p.setVisible(!1), (this.ctx.hoverCell && this.ctx.hoverCell.rowIndex === l || ["checkbox-disabled", "checkbox-check"].includes(w)) && p.setVisible(!0);
782
- let C = this.rowIndex, v = this.rowIndex;
783
- const I = this.ctx.hoverCell, T = this.getSpanInfo(), { yArr: _ } = T;
784
- C = _[0], v = _[1], I && I.rowIndex >= C && I.rowIndex <= v && p.setVisible(!0);
788
+ p.setVisible(!1), (this.ctx.hoverCell && this.ctx.hoverCell.rowIndex === l || ["checkbox-disabled", "checkbox-check"].includes(m)) && p.setVisible(!0);
789
+ let C = this.rowIndex, I = this.rowIndex;
790
+ const v = this.ctx.hoverCell, T = this.getSpanInfo(), { yArr: _ } = T;
791
+ C = _[0], I = _[1], v && v.rowIndex >= C && v.rowIndex <= I && p.setVisible(!0);
785
792
  }
786
793
  this.setImage("selection", p);
787
794
  }
@@ -805,12 +812,12 @@ class ue extends fe {
805
812
  if (a.rowKey === this.rowKey && (l = this.drawX + this.width - s - o, c = this.drawY + (this.height - s) / 2), this.rowspan !== 1 && r) {
806
813
  const u = this.getSpanInfo(), { yArr: x } = u, g = x[0], E = x[1];
807
814
  if (a.rowIndex >= g && a.rowIndex <= E) {
808
- const { width: m, height: w, offsetTop: y, offsetLeft: b } = u;
809
- l = this.drawX - b + m - s - o, c = this.drawY - y + (w - s) / 2;
815
+ const { width: w, height: m, offsetTop: y, offsetLeft: b } = u;
816
+ l = this.drawX - b + w - s - o, c = this.drawY - y + (m - s) / 2;
810
817
  }
811
818
  }
812
- const d = this.ctx.icons.get(this.hoverIconName), f = new q(this.hoverIconName, l, c, s, s, d);
813
- (this.rowspan === 0 || this.colspan === 0) && f.setVisible(!1), this.setImage("hover", f);
819
+ const f = this.ctx.icons.get(this.hoverIconName), d = new Z(this.hoverIconName, l, c, s, s, f);
820
+ (this.rowspan === 0 || this.colspan === 0) && d.setVisible(!1), this.setImage("hover", d);
814
821
  }
815
822
  }
816
823
  /**
@@ -961,9 +968,9 @@ class ue extends fe {
961
968
  const { SELECT_BORDER_COLOR: e, ENABLE_AUTOFILL: i, ENABLE_SELECTOR: s, AUTOFILL_POINT_BORDER_COLOR: o } = this.ctx.config;
962
969
  if (!s || !i || this.ctx.editing)
963
970
  return;
964
- const { xArr: r, yArr: a } = this.ctx.selector, l = r[1], c = a[1], { colIndex: d, rowIndex: f, drawX: u, drawY: x } = this;
965
- if (d === l && f === c) {
966
- const E = d === this.ctx.maxColIndex || f === this.ctx.maxRowIndex || d === this.ctx.lastCenterColIndex ? 6 : 4;
971
+ const { xArr: r, yArr: a } = this.ctx.selector, l = r[1], c = a[1], { colIndex: f, rowIndex: d, drawX: u, drawY: x } = this;
972
+ if (f === l && d === c) {
973
+ const E = f === this.ctx.maxColIndex || d === this.ctx.maxRowIndex || f === this.ctx.lastCenterColIndex ? 6 : 4;
967
974
  this.ctx.paint.drawRect(u + this.width - E, x + this.height - E, 6, 6, {
968
975
  borderColor: o,
969
976
  fillColor: e
@@ -993,7 +1000,7 @@ class ue extends fe {
993
1000
  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))
994
1001
  return !1;
995
1002
  typeof a != "string" && (a = `${a}`);
996
- const d = `${a}_${this.drawTextWidth}_${this.drawTextFont}`;
1003
+ const f = `${a}_${this.drawTextWidth}_${this.drawTextFont}`;
997
1004
  return this.ellipsis = this.ctx.paint.drawText(
998
1005
  a,
999
1006
  this.drawTextX,
@@ -1009,12 +1016,12 @@ class ue extends fe {
1009
1016
  autoRowHeight: this.autoRowHeight,
1010
1017
  lineHeight: o,
1011
1018
  maxLineClamp: this.maxLineClamp,
1012
- cacheTextKey: d,
1013
- layoutCallback: (f) => {
1019
+ cacheTextKey: f,
1020
+ layoutCallback: (d) => {
1014
1021
  this.ctx.emit(
1015
1022
  "registerTextLayout",
1016
1023
  `${this.cellType}-${this.rowIndex}-${this.colIndex}`,
1017
- f
1024
+ d
1018
1025
  );
1019
1026
  }
1020
1027
  }
@@ -1068,11 +1075,11 @@ class ue extends fe {
1068
1075
  fillColor: "transparent",
1069
1076
  borderWidth: 1
1070
1077
  });
1071
- const [a, l] = i, [c, d] = s;
1072
- !(a === l && c === d) && this.colIndex >= a && this.colIndex <= l && this.rowIndex >= c && this.rowIndex <= d && this.ctx.paint.drawRect(this.drawX, this.drawY, this.width, this.height, {
1078
+ const [a, l] = i, [c, f] = s;
1079
+ !(a === l && c === f) && this.colIndex >= a && this.colIndex <= l && this.rowIndex >= c && this.rowIndex <= f && this.ctx.paint.drawRect(this.drawX, this.drawY, this.width, this.height, {
1073
1080
  borderColor: "transparent",
1074
1081
  fillColor: this.ctx.config.SELECT_AREA_COLOR || "rgba(82,146,247,0.1)"
1075
- }), this.operation && this.rowIndex >= c && this.rowIndex <= d && this.ctx.paint.drawRect(this.drawX, this.drawY, this.visibleWidth, this.visibleHeight, {
1082
+ }), this.operation && this.rowIndex >= c && this.rowIndex <= f && this.ctx.paint.drawRect(this.drawX, this.drawY, this.visibleWidth, this.visibleHeight, {
1076
1083
  borderColor: "transparent",
1077
1084
  fillColor: this.ctx.config.SELECT_ROW_COL_BG_COLOR || "transparent"
1078
1085
  });
@@ -1098,13 +1105,13 @@ class ue extends fe {
1098
1105
  }
1099
1106
  drawBorder(e) {
1100
1107
  const { drawX: i, drawY: s, rowIndex: o, colIndex: r, height: a, width: l } = this;
1101
- let c = i, d = s;
1102
- const { xArr: f, yArr: u, lineDash: x = [], borderWidth: g = 1, borderColor: E, fillColor: m } = e, w = f[0], y = f[1], b = u[0], p = u[1];
1103
- if (r >= w && r <= y && o === b) {
1104
- const C = r === y ? 1 : 0, v = r === w ? 1 : 0;
1105
- this.ctx.paint.drawLine([c + v, d + 1, c + l - C, d + 1], {
1108
+ let c = i, f = s;
1109
+ const { xArr: d, yArr: u, lineDash: x = [], borderWidth: g = 1, borderColor: E, fillColor: w } = e, m = d[0], y = d[1], b = u[0], p = u[1];
1110
+ if (r >= m && r <= y && o === b) {
1111
+ const C = r === y ? 1 : 0, I = r === m ? 1 : 0;
1112
+ this.ctx.paint.drawLine([c + I, f + 1, c + l - C, f + 1], {
1106
1113
  borderColor: E,
1107
- fillColor: m,
1114
+ fillColor: w,
1108
1115
  borderWidth: g,
1109
1116
  lineCap: "round",
1110
1117
  lineJoin: "round",
@@ -1112,32 +1119,32 @@ class ue extends fe {
1112
1119
  });
1113
1120
  }
1114
1121
  if (r === y && o >= b && o <= p) {
1115
- const C = o === b ? 1 : 0, v = o === p ? 1 : 0;
1116
- this.ctx.paint.drawLine([c + l - 1, d + C, c + l - 1, d + a - v], {
1122
+ const C = o === b ? 1 : 0, I = o === p ? 1 : 0;
1123
+ this.ctx.paint.drawLine([c + l - 1, f + C, c + l - 1, f + a - I], {
1117
1124
  borderColor: E,
1118
- fillColor: m,
1125
+ fillColor: w,
1119
1126
  borderWidth: g,
1120
1127
  lineCap: "round",
1121
1128
  lineJoin: "round",
1122
1129
  lineDash: x
1123
1130
  });
1124
1131
  }
1125
- if (r >= w && r <= y && o === p) {
1126
- const C = r === y ? 1 : 0, v = r === w ? 1 : 0;
1127
- this.ctx.paint.drawLine([c + v, d + a - 1, c + l - C, d + a - 1], {
1132
+ if (r >= m && r <= y && o === p) {
1133
+ const C = r === y ? 1 : 0, I = r === m ? 1 : 0;
1134
+ this.ctx.paint.drawLine([c + I, f + a - 1, c + l - C, f + a - 1], {
1128
1135
  borderColor: E,
1129
- fillColor: m,
1136
+ fillColor: w,
1130
1137
  borderWidth: g,
1131
1138
  lineCap: "round",
1132
1139
  lineJoin: "round",
1133
1140
  lineDash: x
1134
1141
  });
1135
1142
  }
1136
- if (r === w && o >= b && o <= p) {
1137
- const C = o === p ? 1 : 0, v = o === b ? 1 : 0;
1138
- this.ctx.paint.drawLine([c + 1, d + v, c + 1, d + a - C], {
1143
+ if (r === m && o >= b && o <= p) {
1144
+ const C = o === p ? 1 : 0, I = o === b ? 1 : 0;
1145
+ this.ctx.paint.drawLine([c + 1, f + I, c + 1, f + a - C], {
1139
1146
  borderColor: E,
1140
- fillColor: m,
1147
+ fillColor: w,
1141
1148
  borderWidth: g,
1142
1149
  lineCap: "round",
1143
1150
  lineJoin: "round",
@@ -1146,7 +1153,7 @@ class ue extends fe {
1146
1153
  }
1147
1154
  }
1148
1155
  }
1149
- class $e {
1156
+ class Ge {
1150
1157
  constructor(t, e) {
1151
1158
  n(this, "ctx");
1152
1159
  n(this, "data");
@@ -1221,17 +1228,17 @@ class $e {
1221
1228
  CELL_HEIGHT: a,
1222
1229
  SELECTABLE_METHOD: l,
1223
1230
  CHECKBOX_KEY: c,
1224
- TREE_CHILDREN_KEY: d
1231
+ TREE_CHILDREN_KEY: f
1225
1232
  } = this.ctx.config;
1226
- t.forEach((f, u) => {
1233
+ t.forEach((d, u) => {
1227
1234
  var b;
1228
- d !== "children" && (f.children = f[d]);
1229
- const x = f[o], g = x ?? ae();
1230
- this.itemRowKeyMap.set(f, g);
1231
- const E = f._height || a, m = f._readonly;
1232
- let w = !0;
1233
- if (typeof l == "function" && (w = l), c) {
1234
- const p = f[c];
1235
+ f !== "children" && (d.children = d[f]);
1236
+ const x = d[o], g = x ?? ae();
1237
+ this.itemRowKeyMap.set(d, g);
1238
+ const E = d._height || a, w = d._readonly;
1239
+ let m = !0;
1240
+ if (typeof l == "function" && (m = l), c) {
1241
+ const p = d[c];
1235
1242
  if (this.checkboxKeyMap.has(p)) {
1236
1243
  const C = this.checkboxKeyMap.get(p) || [];
1237
1244
  C.push(g), this.checkboxKeyMap.set(p, C);
@@ -1239,29 +1246,29 @@ class $e {
1239
1246
  this.checkboxKeyMap.set(p, [g]);
1240
1247
  }
1241
1248
  this.selectionMap.set(g, {
1242
- key: c ? f[c] : g,
1243
- row: f,
1249
+ key: c ? d[c] : g,
1250
+ row: d,
1244
1251
  check: ((b = this.selectionMap.get(g)) == null ? void 0 : b.check) || !1
1245
1252
  });
1246
- const y = r || this.expandMap.get(g) || f._expand || !1;
1253
+ const y = r || this.expandMap.get(g) || d._expand || !1;
1247
1254
  this.expandMap.set(g, y), this.rowKeyMap.set(g, {
1248
- readonly: m,
1255
+ readonly: w,
1249
1256
  index: u,
1250
1257
  rowIndex: u,
1251
1258
  level: e,
1252
1259
  height: E,
1253
1260
  calculatedHeight: -1,
1254
1261
  check: !1,
1255
- selectable: w,
1262
+ selectable: m,
1256
1263
  expand: y,
1257
1264
  expandLazy: !1,
1258
- hasChildren: f._hasChildren || (Array.isArray(f.children) ? f.children.length > 0 : !1),
1265
+ hasChildren: d._hasChildren || (Array.isArray(d.children) ? d.children.length > 0 : !1),
1259
1266
  expandLoading: !1,
1260
- item: f,
1267
+ item: d,
1261
1268
  parentRowKeys: i,
1262
1269
  parentRowKey: i[i.length - 1] || "",
1263
1270
  isLastChild: u === s - 1
1264
- }), Array.isArray(f.children) && f.children.length && this.initData(f.children, e + 1, [...i, g]);
1271
+ }), Array.isArray(d.children) && d.children.length && this.initData(d.children, e + 1, [...i, g]);
1265
1272
  });
1266
1273
  }
1267
1274
  /**
@@ -1311,16 +1318,16 @@ class $e {
1311
1318
  }
1312
1319
  generateColumns(t) {
1313
1320
  const e = (i) => i.map((s) => {
1314
- var c, d, f, u, x, g, E, m;
1321
+ var c, f, d, u, x, g, E, w;
1315
1322
  const o = s.children && Array.isArray(s.children) ? e(s.children) : void 0, r = {
1316
- hide: (d = (c = this.customHeader) == null ? void 0 : c.hideData) == null ? void 0 : d[s.key],
1317
- fixed: (u = (f = this.customHeader) == null ? void 0 : f.fixedData) == null ? void 0 : u[s.key],
1323
+ hide: (f = (c = this.customHeader) == null ? void 0 : c.hideData) == null ? void 0 : f[s.key],
1324
+ fixed: (u = (d = this.customHeader) == null ? void 0 : d.fixedData) == null ? void 0 : u[s.key],
1318
1325
  sort: (g = (x = this.customHeader) == null ? void 0 : x.sortData) == null ? void 0 : g[s.key],
1319
- width: (m = (E = this.customHeader) == null ? void 0 : E.resizableData) == null ? void 0 : m[s.key]
1326
+ width: (w = (E = this.customHeader) == null ? void 0 : E.resizableData) == null ? void 0 : w[s.key]
1320
1327
  }, a = {};
1321
- for (const [w, y] of Object.entries(r))
1322
- y !== void 0 && (a[w] = y);
1323
- const l = o && o.every((w) => w.hide);
1328
+ for (const [m, y] of Object.entries(r))
1329
+ y !== void 0 && (a[m] = y);
1330
+ const l = o && o.every((m) => m.hide);
1324
1331
  return {
1325
1332
  ...s,
1326
1333
  children: o,
@@ -1358,12 +1365,12 @@ class $e {
1358
1365
  const i = (o) => {
1359
1366
  o == null || o.forEach((r) => {
1360
1367
  t.push(r);
1361
- const a = this.itemRowKeyMap.get(r), { expand: l, hasChildren: c, height: d, calculatedHeight: f } = this.rowKeyMap.get(a), u = this.sumHeight, x = Math.max(f, d);
1368
+ const a = this.itemRowKeyMap.get(r), { expand: l, hasChildren: c, height: f, calculatedHeight: d } = this.rowKeyMap.get(a), u = this.sumHeight, x = Math.max(d, f);
1362
1369
  this.sumHeight += x, this.rowIndexRowKeyMap.set(e, a), this.rowKeyRowIndexMap.set(a, e), this.positions.push({
1363
1370
  top: u,
1364
1371
  height: x,
1365
1372
  bottom: this.sumHeight,
1366
- calculatedHeight: f
1373
+ calculatedHeight: d
1367
1374
  }), e += 1, l && c && i(r.children);
1368
1375
  });
1369
1376
  };
@@ -1446,11 +1453,11 @@ class $e {
1446
1453
  if (typeof s == "function")
1447
1454
  c = s(o, r);
1448
1455
  else if (s === "number") {
1449
- const d = Number(a) || 0, f = Number(l) || 0;
1450
- c = d - f;
1456
+ const f = Number(a) || 0, d = Number(l) || 0;
1457
+ c = f - d;
1451
1458
  } else if (s === "string") {
1452
- const d = String(a || ""), f = String(l || "");
1453
- c = d.localeCompare(f);
1459
+ const f = String(a || ""), d = String(l || "");
1460
+ c = f.localeCompare(d);
1454
1461
  } else s === "date" && (c = Be(a, l));
1455
1462
  return i === "asc" ? c : -c;
1456
1463
  });
@@ -1566,21 +1573,21 @@ class $e {
1566
1573
  const a = /* @__PURE__ */ new Map(), l = [];
1567
1574
  let c = [];
1568
1575
  for (const g of t) {
1569
- const { rowKey: E, key: m } = g;
1570
- let w = g.value;
1571
- const y = this.getRowDataItemForRowKey(E), b = this.getItemValue(E, m), p = this.getVirtualBodyCellByKey(E, m), C = {
1576
+ const { rowKey: E, key: w } = g;
1577
+ let m = g.value;
1578
+ const y = this.getRowDataItemForRowKey(E), b = this.getItemValue(E, w), p = this.getVirtualBodyCellByKey(E, w), C = {
1572
1579
  ...g,
1573
1580
  oldValue: b,
1574
1581
  row: y
1575
1582
  };
1576
1583
  if ((p == null ? void 0 : p.type) === "number")
1577
- if (["", void 0, null].includes(w))
1578
- w = null;
1579
- else if (/^-?\d+(\.\d+)?$/.test(String(w))) {
1580
- const v = Xe(w);
1581
- if (typeof p.precision == "number" && p.precision >= 0 && v > p.precision) {
1582
- const I = 10 ** p.precision;
1583
- w = Math.round(Number(w) * I) / I;
1584
+ if (["", void 0, null].includes(m))
1585
+ m = null;
1586
+ else if (/^-?\d+(\.\d+)?$/.test(String(m))) {
1587
+ const I = Xe(m);
1588
+ if (typeof p.precision == "number" && p.precision >= 0 && I > p.precision) {
1589
+ const v = 10 ** p.precision;
1590
+ m = Math.round(Number(m) * v) / v;
1584
1591
  const T = this.ctx.locale.getText("numberTruncated", { precision: p.precision });
1585
1592
  l.push({
1586
1593
  ...C,
@@ -1588,44 +1595,44 @@ class $e {
1588
1595
  code: "ERR_NUMBER_PRECISION",
1589
1596
  message: T
1590
1597
  });
1591
- } else if (typeof p.min == "number" && Number(w) < p.min) {
1592
- const I = this.ctx.locale.getText("numberMin", { min: p.min });
1593
- w = p.min, l.push({
1598
+ } else if (typeof p.min == "number" && Number(m) < p.min) {
1599
+ const v = this.ctx.locale.getText("numberMin", { min: p.min });
1600
+ m = p.min, l.push({
1594
1601
  ...C,
1595
1602
  column: p == null ? void 0 : p.column,
1596
1603
  code: "ERR_NUMBER_MIN",
1597
- message: I
1604
+ message: v
1598
1605
  });
1599
- } else if (typeof p.max == "number" && Number(w) > p.max) {
1600
- const I = this.ctx.locale.getText("numberMax", { max: p.max });
1601
- w = p.max, l.push({
1606
+ } else if (typeof p.max == "number" && Number(m) > p.max) {
1607
+ const v = this.ctx.locale.getText("numberMax", { max: p.max });
1608
+ m = p.max, l.push({
1602
1609
  ...C,
1603
1610
  column: p == null ? void 0 : p.column,
1604
1611
  code: "ERR_NUMBER_MAX",
1605
- message: I
1612
+ message: v
1606
1613
  });
1607
1614
  } else
1608
- w = Number(w);
1615
+ m = Number(m);
1609
1616
  } else
1610
- w = b, l.push({
1617
+ m = b, l.push({
1611
1618
  ...C,
1612
1619
  column: p == null ? void 0 : p.column,
1613
1620
  code: "ERR_INVALID_NUMBER",
1614
1621
  message: this.ctx.locale.getText("invalidNumber")
1615
1622
  });
1616
- else if ((p == null ? void 0 : p.editorType) === "text" && typeof p.maxlength == "number" && String(w).length > p.maxlength) {
1617
- w = String(w).slice(0, p.maxlength);
1618
- const v = this.ctx.locale.getText("stringMaxlength", { maxlength: p.maxlength });
1623
+ else if ((p == null ? void 0 : p.editorType) === "text" && typeof p.maxlength == "number" && String(m).length > p.maxlength) {
1624
+ m = String(m).slice(0, p.maxlength);
1625
+ const I = this.ctx.locale.getText("stringMaxlength", { maxlength: p.maxlength });
1619
1626
  l.push({
1620
1627
  ...C,
1621
1628
  column: p == null ? void 0 : p.column,
1622
1629
  code: "ERR_STRING_MAXLENGTH",
1623
- message: v
1630
+ message: I
1624
1631
  });
1625
1632
  }
1626
- w !== b && c.push({
1633
+ m !== b && c.push({
1627
1634
  ...g,
1628
- value: w,
1635
+ value: m,
1629
1636
  oldValue: b,
1630
1637
  row: y
1631
1638
  });
@@ -1640,21 +1647,21 @@ class $e {
1640
1647
  }
1641
1648
  if (!c.length)
1642
1649
  return;
1643
- const { BEFORE_VALUE_CHANGE_METHOD: d } = this.ctx.config;
1644
- s === "none" && typeof d == "function" && (c = await d(c), r = !1);
1645
- const f = [];
1650
+ const { BEFORE_VALUE_CHANGE_METHOD: f } = this.ctx.config;
1651
+ s === "none" && typeof f == "function" && (c = await f(c), r = !1);
1652
+ const d = [];
1646
1653
  c.forEach((g) => {
1647
- f.push(this.getValidator(g.rowKey, g.key));
1648
- const { value: E, rowKey: m, key: w, row: y } = g, b = this.getItemValue(m, w);
1649
- a.set(m, y), this.setItemValue(m, w, E, !1, !1, !1, r), o.push({
1650
- rowKey: m,
1651
- key: w,
1654
+ d.push(this.getValidator(g.rowKey, g.key));
1655
+ const { value: E, rowKey: w, key: m, row: y } = g, b = this.getItemValue(w, m);
1656
+ a.set(w, y), this.setItemValue(w, m, E, !1, !1, !1, r), o.push({
1657
+ rowKey: w,
1658
+ key: m,
1652
1659
  oldValue: b,
1653
1660
  newValue: E
1654
1661
  });
1655
1662
  });
1656
1663
  const u = Array.from(a.values());
1657
- await Promise.all(f), this.validationErrorMap.size === 0 && this.changedDataMap.size > 0 && this.ctx.emit("validateChangedData", this.getChangedData());
1664
+ await Promise.all(d), this.validationErrorMap.size === 0 && this.changedDataMap.size > 0 && this.ctx.emit("validateChangedData", this.getChangedData());
1658
1665
  const x = c.map((g) => {
1659
1666
  const E = !!this.getValidationError(g.rowKey, g.key).length;
1660
1667
  return {
@@ -1684,24 +1691,24 @@ class $e {
1684
1691
  if (!this.rowKeyMap.has(t))
1685
1692
  return {};
1686
1693
  const { item: l } = this.rowKeyMap.get(t);
1687
- let c = l[e], d = i;
1694
+ let c = l[e], f = i;
1688
1695
  if (a && this.ctx.database.getReadonly(t, e))
1689
1696
  return {
1690
1697
  oldValue: c,
1691
1698
  newValue: c
1692
1699
  };
1693
1700
  l[e] !== null && typeof l[e] == "object" && (c = JSON.parse(JSON.stringify(l[e])));
1694
- const f = `${t}​_${e}`;
1695
- this.originalDataMap.has(f) || this.originalDataMap.set(f, c);
1696
- const u = this.originalDataMap.get(f), x = this.getRowDataItemForRowKey(t), g = {
1701
+ const d = `${t}​_${e}`;
1702
+ this.originalDataMap.has(d) || this.originalDataMap.set(d, c);
1703
+ const u = this.originalDataMap.get(d), x = this.getRowDataItemForRowKey(t), g = {
1697
1704
  rowKey: t,
1698
1705
  key: e,
1699
- value: d,
1706
+ value: f,
1700
1707
  oldValue: c,
1701
1708
  row: x
1702
1709
  };
1703
1710
  if (r) {
1704
- if (d === c)
1711
+ if (f === c)
1705
1712
  return {
1706
1713
  oldValue: c,
1707
1714
  newValue: c
@@ -1711,13 +1718,13 @@ class $e {
1711
1718
  originalValue: u
1712
1719
  });
1713
1720
  } else
1714
- this.changedDataMap.set(f, d), l[e] = d;
1721
+ this.changedDataMap.set(d, f), l[e] = f;
1715
1722
  return this.ctx.hasEvent("iterationChange") && this.ctx.emit("iterationChange", {
1716
1723
  ...g,
1717
1724
  originalValue: u
1718
1725
  }), o && this.ctx.emit("draw"), {
1719
1726
  oldValue: c,
1720
- newValue: d
1727
+ newValue: f
1721
1728
  };
1722
1729
  }
1723
1730
  /**
@@ -1831,22 +1838,22 @@ class $e {
1831
1838
  return { checked: s, indeterminate: !1 };
1832
1839
  let r = !1, a = s;
1833
1840
  if (this.ctx.config.TREE_SELECT_MODE === "auto") {
1834
- const c = (m) => {
1835
- const w = this.getTreeChildren(m);
1841
+ const c = (w) => {
1842
+ const m = this.getTreeChildren(w);
1836
1843
  let y = [];
1837
- for (const b of w)
1844
+ for (const b of m)
1838
1845
  y.push(b), y.push(...c(b));
1839
1846
  return y;
1840
- }, f = c(t).map((m) => this.selectionMap.get(m)), u = f.filter((m) => m == null ? void 0 : m.check).length, x = f.length, g = u > 0;
1847
+ }, d = c(t).map((w) => this.selectionMap.get(w)), u = d.filter((w) => w == null ? void 0 : w.check).length, x = d.length, g = u > 0;
1841
1848
  r = g && !(u === x), a = s || g, s && x > 0 && u === 0 && (a = !1, r = !1);
1842
1849
  } else if (this.ctx.config.TREE_SELECT_MODE === "cautious") {
1843
- const c = (m) => {
1844
- const w = this.getTreeChildren(m);
1850
+ const c = (w) => {
1851
+ const m = this.getTreeChildren(w);
1845
1852
  let y = [];
1846
- for (const b of w)
1853
+ for (const b of m)
1847
1854
  y.push(b), y.push(...c(b));
1848
1855
  return y;
1849
- }, f = c(t).map((m) => this.selectionMap.get(m)), u = f.filter((m) => m == null ? void 0 : m.check).length, x = f.length, g = u > 0, E = u === x;
1856
+ }, d = c(t).map((w) => this.selectionMap.get(w)), u = d.filter((w) => w == null ? void 0 : w.check).length, x = d.length, g = u > 0, E = u === x;
1850
1857
  r = g && !E, a = s || E, s && x > 0 && u === 0 && (a = !1, r = !1);
1851
1858
  } else this.ctx.config.TREE_SELECT_MODE === "strictly" && (r = !1, a = s);
1852
1859
  return { checked: a, indeterminate: r };
@@ -1958,16 +1965,16 @@ class $e {
1958
1965
  rowIndex: u.rowIndex
1959
1966
  })), g && (o += 1);
1960
1967
  });
1961
- const l = r > i && s === 0 && a, c = o && o > s && s > 0 || l, d = o !== 0, f = !!o && o === s;
1968
+ const l = r > i && s === 0 && a, c = o && o > s && s > 0 || l, f = o !== 0, d = !!o && o === s;
1962
1969
  return this.bufferCheckState = {
1963
1970
  buffer: !0,
1964
- check: f,
1971
+ check: d,
1965
1972
  indeterminate: c,
1966
- selectable: d
1973
+ selectable: f
1967
1974
  }, {
1968
- check: f,
1975
+ check: d,
1969
1976
  indeterminate: c,
1970
- selectable: d
1977
+ selectable: f
1971
1978
  };
1972
1979
  }
1973
1980
  /**
@@ -2060,15 +2067,15 @@ class $e {
2060
2067
  return !0;
2061
2068
  const r = s.readonly, a = o.readonly, { BODY_CELL_READONLY_METHOD: l } = this.ctx.config;
2062
2069
  if (typeof l == "function" && o) {
2063
- const d = l({
2070
+ const f = l({
2064
2071
  row: s.item,
2065
2072
  rowIndex: s.rowIndex,
2066
2073
  colIndex: o.colIndex,
2067
2074
  column: o.column,
2068
2075
  value: this.getItemValue(t, e)
2069
2076
  });
2070
- if (d !== void 0)
2071
- return d;
2077
+ if (f !== void 0)
2078
+ return f;
2072
2079
  }
2073
2080
  return a || r;
2074
2081
  }
@@ -2088,17 +2095,17 @@ class $e {
2088
2095
  const l = r.column;
2089
2096
  let c = l.rules;
2090
2097
  if (typeof a == "function") {
2091
- const f = a({
2098
+ const d = a({
2092
2099
  row: o.item,
2093
2100
  rowIndex: o.rowIndex,
2094
2101
  colIndex: r.colIndex,
2095
2102
  column: l,
2096
2103
  value: this.getItemValue(t, e)
2097
2104
  });
2098
- f && (c = f);
2105
+ d && (c = d);
2099
2106
  }
2100
2107
  if (c) {
2101
- const d = {
2108
+ const f = {
2102
2109
  row: o.item,
2103
2110
  rowIndex: o.rowIndex,
2104
2111
  colIndex: r.colIndex,
@@ -2108,7 +2115,7 @@ class $e {
2108
2115
  value: this.getItemValue(t, e),
2109
2116
  field: e,
2110
2117
  fieldValue: this.getItemValue(t, e)
2111
- }, u = new Oe(c).validate(d);
2118
+ }, u = new Oe(c).validate(f);
2112
2119
  this.setValidationError(t, e, u), s(u);
2113
2120
  } else
2114
2121
  this.clearValidationError(t, e), s([]);
@@ -2132,20 +2139,20 @@ class $e {
2132
2139
  colIndex: a,
2133
2140
  relationRowKeys: l,
2134
2141
  relationColKeys: c,
2135
- rowspan: d,
2136
- height: f,
2142
+ rowspan: f,
2143
+ height: d,
2137
2144
  width: u,
2138
2145
  colspan: x,
2139
2146
  mergeRow: g,
2140
2147
  mergeCol: E
2141
2148
  } = t;
2142
- if (d === 1 && x === 1)
2149
+ if (f === 1 && x === 1)
2143
2150
  return {
2144
2151
  xArr: [a, a],
2145
2152
  yArr: [e, e],
2146
- rowspan: d,
2153
+ rowspan: f,
2147
2154
  colspan: x,
2148
- height: f,
2155
+ height: d,
2149
2156
  width: u,
2150
2157
  offsetTop: 0,
2151
2158
  offsetLeft: 0,
@@ -2158,8 +2165,8 @@ class $e {
2158
2165
  }
2159
2166
  ]
2160
2167
  };
2161
- let m = e, w = e, y = a, b = a, p = [], C = 0, v = 0, I = 0, T = 0;
2162
- if (d !== 1 && g) {
2168
+ let w = e, m = e, y = a, b = a, p = [], C = 0, I = 0, v = 0, T = 0;
2169
+ if (f !== 1 && g) {
2163
2170
  T = u;
2164
2171
  const _ = l.reduce((R, S) => {
2165
2172
  const O = this.getItemValue(s, S) ?? "";
@@ -2171,7 +2178,7 @@ class $e {
2171
2178
  return `${M}${H}`;
2172
2179
  }, "");
2173
2180
  if (_ === O)
2174
- m = R;
2181
+ w = R;
2175
2182
  else
2176
2183
  break;
2177
2184
  }
@@ -2181,17 +2188,17 @@ class $e {
2181
2188
  return `${M}${H}`;
2182
2189
  }, "");
2183
2190
  if (_ === O)
2184
- w = R;
2191
+ m = R;
2185
2192
  else
2186
2193
  break;
2187
2194
  }
2188
- for (let R = m; R < e; R++) {
2195
+ for (let R = w; R < e; R++) {
2189
2196
  const { height: S } = this.positions[R];
2190
2197
  C += S;
2191
2198
  }
2192
- for (let R = m; R <= w; R++) {
2199
+ for (let R = w; R <= m; R++) {
2193
2200
  const { height: S } = this.positions[R];
2194
- I += S;
2201
+ v += S;
2195
2202
  const O = this.rowIndexRowKeyMap.get(R) || "", { item: M } = this.rowKeyMap.get(O), L = this.getItemValue(O, i);
2196
2203
  p.push({
2197
2204
  rowKey: O,
@@ -2202,7 +2209,7 @@ class $e {
2202
2209
  }
2203
2210
  }
2204
2211
  if (x !== 1 && E) {
2205
- I = f;
2212
+ v = d;
2206
2213
  for (let _ = a - 1; _ >= 0; _--) {
2207
2214
  const R = this.getColumnByColIndex(_);
2208
2215
  if (!R)
@@ -2227,7 +2234,7 @@ class $e {
2227
2234
  const R = this.getColumnByColIndex(_);
2228
2235
  if (!R)
2229
2236
  break;
2230
- v += R.width || 100;
2237
+ I += R.width || 100;
2231
2238
  }
2232
2239
  for (let _ = y; _ <= b; _++) {
2233
2240
  const R = this.getColumnByColIndex(_);
@@ -2243,13 +2250,13 @@ class $e {
2243
2250
  }
2244
2251
  return {
2245
2252
  xArr: [y, b],
2246
- yArr: [m, w],
2247
- rowspan: d,
2253
+ yArr: [w, m],
2254
+ rowspan: f,
2248
2255
  colspan: x,
2249
- height: I,
2256
+ height: v,
2250
2257
  width: T,
2251
2258
  offsetTop: C,
2252
- offsetLeft: v,
2259
+ offsetLeft: I,
2253
2260
  dataList: p
2254
2261
  };
2255
2262
  }
@@ -2375,9 +2382,9 @@ class $e {
2375
2382
  s.forEach((r) => {
2376
2383
  r.children && r.children.length > 0 && e(r.children, o);
2377
2384
  const a = (l, c) => {
2378
- var f, u;
2379
- const d = (f = this.customHeader[l]) == null ? void 0 : f[r.key];
2380
- d !== void 0 && d !== c && (o[l] || (o[l] = {}), o[l][r.key] = d, l === "fixedData" && !d && !c && ((u = o[l]) == null || delete u[r.key]));
2385
+ var d, u;
2386
+ const f = (d = this.customHeader[l]) == null ? void 0 : d[r.key];
2387
+ f !== void 0 && f !== c && (o[l] || (o[l] = {}), o[l][r.key] = f, l === "fixedData" && !f && !c && ((u = o[l]) == null || delete u[r.key]));
2381
2388
  };
2382
2389
  a("fixedData", r.fixed), a("sortData", r.sort), a("hideData", r.hide), a("resizableData", r.width);
2383
2390
  });
@@ -2483,7 +2490,7 @@ class je {
2483
2490
  this.clearDomSelection(), t.button === 0 && (this.ctx.mousedown = !0), this.ctx.emit("mousedown", t);
2484
2491
  }
2485
2492
  handleMousemove(t) {
2486
- const e = t, i = this.ctx.containerElement.getBoundingClientRect(), s = this.ctx.zoomScale.toLogical(e.clientX - i.left), o = this.ctx.zoomScale.toLogical(e.clientY - i.top);
2493
+ const e = t, i = this.ctx.containerElement.getBoundingClientRect(), s = e.clientX - i.left, o = e.clientY - i.top;
2487
2494
  this.ctx.mouseX = s, this.ctx.mouseY = o, this.ctx.emit("mousemove", t);
2488
2495
  }
2489
2496
  handleMouseUp(t) {
@@ -2497,13 +2504,6 @@ class je {
2497
2504
  e && this.ctx.isTarget(t) && (this.ctx.dragHeaderIng || this.ctx.emit("keydown", t));
2498
2505
  }
2499
2506
  handleWheel(t) {
2500
- const e = t, { ENABLE_ZOOM_WHEEL: i } = this.ctx.config;
2501
- if (i && (e.ctrlKey || e.metaKey)) {
2502
- t.preventDefault();
2503
- const s = e.deltaY > 0 ? -0.1 : 0.1;
2504
- this.ctx.setZoom(this.ctx.getZoom() + s);
2505
- return;
2506
- }
2507
2507
  this.ctx.emit("wheel", t);
2508
2508
  }
2509
2509
  handleTouchstart(t) {
@@ -2542,7 +2542,7 @@ class je {
2542
2542
  }
2543
2543
  }
2544
2544
  }
2545
- class Ze {
2545
+ class qe {
2546
2546
  constructor() {
2547
2547
  n(this, "events", /* @__PURE__ */ new Map());
2548
2548
  }
@@ -2580,7 +2580,7 @@ class Ze {
2580
2580
  this.events.clear();
2581
2581
  }
2582
2582
  }
2583
- class qe {
2583
+ class Ze {
2584
2584
  constructor(t) {
2585
2585
  n(this, "ctx");
2586
2586
  n(this, "textCacheMap", /* @__PURE__ */ new Map());
@@ -2594,8 +2594,8 @@ class qe {
2594
2594
  clearTextCache() {
2595
2595
  this.textCacheMap.clear();
2596
2596
  }
2597
- scale(t, e = 1) {
2598
- this.ctx.setTransform(1, 0, 0, 1, 0, 0), this.ctx.scale(t * e, t * e);
2597
+ scale(t) {
2598
+ this.ctx.setTransform(1, 0, 0, 1, 0, 0), this.ctx.scale(t, t);
2599
2599
  }
2600
2600
  save() {
2601
2601
  this.ctx.save();
@@ -2623,21 +2623,21 @@ class qe {
2623
2623
  * @param {string} color - 阴影的颜色
2624
2624
  */
2625
2625
  drawShadow(t, e, i, s, o) {
2626
- const { fillColor: r, side: a, shadowWidth: l, colorStart: c, colorEnd: d } = o;
2626
+ const { fillColor: r, side: a, shadowWidth: l, colorStart: c, colorEnd: f } = o;
2627
2627
  this.ctx.save(), r && (this.ctx.fillStyle = r, this.ctx.fillRect(t, e, i, s));
2628
- let f;
2628
+ let d;
2629
2629
  switch (a) {
2630
2630
  case "left":
2631
- f = this.ctx.createLinearGradient(t - l, e, t, e), f.addColorStop(0, c), f.addColorStop(1, d), this.ctx.fillStyle = f, this.ctx.fillRect(t - l, e, l, s);
2631
+ d = this.ctx.createLinearGradient(t - l, e, t, e), d.addColorStop(0, c), d.addColorStop(1, f), this.ctx.fillStyle = d, this.ctx.fillRect(t - l, e, l, s);
2632
2632
  break;
2633
2633
  case "right":
2634
- f = this.ctx.createLinearGradient(t + i, e, t + i + l, e), f.addColorStop(0, c), f.addColorStop(1, d), this.ctx.fillStyle = f, this.ctx.fillRect(t + i, e, l, s);
2634
+ d = this.ctx.createLinearGradient(t + i, e, t + i + l, e), d.addColorStop(0, c), d.addColorStop(1, f), this.ctx.fillStyle = d, this.ctx.fillRect(t + i, e, l, s);
2635
2635
  break;
2636
2636
  case "top":
2637
- f = this.ctx.createLinearGradient(t, e - l, t, e), f.addColorStop(0, c), f.addColorStop(1, d), this.ctx.fillStyle = f, this.ctx.fillRect(t, e - l, i, l);
2637
+ d = this.ctx.createLinearGradient(t, e - l, t, e), d.addColorStop(0, c), d.addColorStop(1, f), this.ctx.fillStyle = d, this.ctx.fillRect(t, e - l, i, l);
2638
2638
  break;
2639
2639
  case "bottom":
2640
- f = this.ctx.createLinearGradient(t, e + s, t, e + s + l), f.addColorStop(0, c), f.addColorStop(1, d), this.ctx.fillStyle = f, this.ctx.fillRect(t, e + s, i, l);
2640
+ d = this.ctx.createLinearGradient(t, e + s, t, e + s + l), d.addColorStop(0, c), d.addColorStop(1, f), this.ctx.fillStyle = d, this.ctx.fillRect(t, e + s, i, l);
2641
2641
  break;
2642
2642
  default:
2643
2643
  console.error("Invalid side specified for shadow");
@@ -2663,8 +2663,8 @@ class qe {
2663
2663
  if (this.ctx.save(), this.ctx.beginPath(), a !== void 0 && (this.ctx.fillStyle = a), r !== void 0 && (this.ctx.lineWidth = o, this.ctx.strokeStyle = r), l === 0)
2664
2664
  this.ctx.rect(t - 0.5, e - 0.5, i, s);
2665
2665
  else {
2666
- const [c, d, f, u] = typeof l == "number" ? [l, l, l, l] : l;
2667
- this.ctx.moveTo(t + c, e), this.ctx.arcTo(t + i, e, t + i, e + d, d), this.ctx.arcTo(t + i, e + s, t + i - f, e + s, f), this.ctx.arcTo(t, e + s, t, e + s - u, u), this.ctx.arcTo(t, e, t + c, e, c);
2666
+ const [c, f, d, u] = typeof l == "number" ? [l, l, l, l] : l;
2667
+ this.ctx.moveTo(t + c, e), this.ctx.arcTo(t + i, e, t + i, e + f, f), this.ctx.arcTo(t + i, e + s, t + i - d, e + s, d), this.ctx.arcTo(t, e + s, t, e + s - u, u), this.ctx.arcTo(t, e, t + c, e, c);
2668
2668
  }
2669
2669
  a !== void 0 && this.ctx.fill(), r !== void 0 && this.ctx.stroke(), this.ctx.restore();
2670
2670
  }
@@ -2685,8 +2685,8 @@ class qe {
2685
2685
  font: a = "12px Arial",
2686
2686
  align: l = "center",
2687
2687
  color: c = "#495060",
2688
- padding: d = 0,
2689
- verticalAlign: f = "middle",
2688
+ padding: f = 0,
2689
+ verticalAlign: d = "middle",
2690
2690
  maxLineClamp: u = 1,
2691
2691
  autoRowHeight: x = !1,
2692
2692
  offsetLeft: g = 0,
@@ -2694,33 +2694,33 @@ class qe {
2694
2694
  } = r;
2695
2695
  if (this.ctx.font = a, this.ctx.fillStyle = c, ["", null, void 0].includes(t))
2696
2696
  return this.ctx.restore(), !1;
2697
- const w = parseInt(((b = a.match(/\d+/)) == null ? void 0 : b[0]) || "12") * (r.lineHeight || 1.2), y = this.buildTextLayout(t, e, i, s, o, {
2697
+ const m = parseInt(((b = a.match(/\d+/)) == null ? void 0 : b[0]) || "12") * (r.lineHeight || 1.2), y = this.buildTextLayout(t, e, i, s, o, {
2698
2698
  font: a,
2699
2699
  color: c,
2700
2700
  align: l,
2701
- padding: d,
2702
- verticalAlign: f,
2701
+ padding: f,
2702
+ verticalAlign: d,
2703
2703
  maxLineClamp: u,
2704
2704
  autoRowHeight: x,
2705
- lineHeight: w,
2705
+ lineHeight: m,
2706
2706
  offsetLeft: g,
2707
2707
  offsetRight: E
2708
2708
  });
2709
- if (this.ctx.textBaseline = "top", this.ctx.textAlign = "left", y.lines.forEach((v) => {
2710
- this.ctx.fillText(v.text, v.drawX, v.drawY);
2709
+ if (this.ctx.textBaseline = "top", this.ctx.textAlign = "left", y.lines.forEach((I) => {
2710
+ this.ctx.fillText(I.text, I.drawX, I.drawY);
2711
2711
  }), r.textCallback && y.lines.length) {
2712
- const v = y.lines.reduce((S, O) => Math.max(S, O.width), 0), I = Math.round(v);
2713
- let T = ((p = y.lines[0]) == null ? void 0 : p.drawX) ?? e + d + g, _ = T + I;
2714
- l === "center" ? (T = e + s / 2 - I / 2, _ = e + s / 2 + I / 2) : l === "right" && (T = e + s - d - E - I, _ = e + s - d - E);
2712
+ const I = y.lines.reduce((S, O) => Math.max(S, O.width), 0), v = Math.round(I);
2713
+ let T = ((p = y.lines[0]) == null ? void 0 : p.drawX) ?? e + f + g, _ = T + v;
2714
+ l === "center" ? (T = e + s / 2 - v / 2, _ = e + s / 2 + v / 2) : l === "right" && (T = e + s - f - E - v, _ = e + s - f - E);
2715
2715
  const R = {
2716
2716
  x: ((C = y.lines[0]) == null ? void 0 : C.drawX) ?? T,
2717
2717
  y: y.contentY,
2718
- width: I,
2719
- height: y.lines.length * w,
2718
+ width: v,
2719
+ height: y.lines.length * m,
2720
2720
  left: T,
2721
2721
  right: _,
2722
2722
  top: y.contentY,
2723
- bottom: y.contentY + y.lines.length * w
2723
+ bottom: y.contentY + y.lines.length * m
2724
2724
  };
2725
2725
  r.textCallback(R);
2726
2726
  }
@@ -2731,43 +2731,43 @@ class qe {
2731
2731
  font: a,
2732
2732
  color: l,
2733
2733
  align: c,
2734
- padding: d,
2735
- verticalAlign: f,
2734
+ padding: f,
2735
+ verticalAlign: d,
2736
2736
  maxLineClamp: u,
2737
2737
  autoRowHeight: x,
2738
2738
  lineHeight: g,
2739
2739
  offsetLeft: E,
2740
- offsetRight: m
2740
+ offsetRight: w
2741
2741
  } = r;
2742
2742
  this.ctx.save(), this.ctx.font = a;
2743
- const w = s - d * 2 - E - m, y = w, b = o - d * 2, p = Array.from(t);
2744
- let C = this.wrapTextToLines(t, w);
2745
- const v = Math.round(b / g);
2746
- let I = Math.min(C.length, Math.max(v, 1));
2747
- u === "auto" && x ? I = C.length : typeof u == "number" && u < I && u !== 1 ? I = u : (u === 1 && (C = [{ items: p.map((M, L) => ({ char: M, sourceIndex: L })), text: t, caretIndex: 0, lineIndex: 0, drawX: 0, drawY: 0, width: 0, segments: [] }], I = 1), u === "auto" && v === 1 && (C = [{ items: p.map((M, L) => ({ char: M, sourceIndex: L })), text: t, caretIndex: 0, lineIndex: 0, drawX: 0, drawY: 0, width: 0, segments: [] }], I = 1));
2743
+ const m = s - f * 2 - E - w, y = m, b = o - f * 2, p = Array.from(t);
2744
+ let C = this.wrapTextToLines(t, m);
2745
+ const I = Math.round(b / g);
2746
+ let v = Math.min(C.length, Math.max(I, 1));
2747
+ u === "auto" && x ? v = C.length : typeof u == "number" && u < v && u !== 1 ? v = u : (u === 1 && (C = [{ items: p.map((M, L) => ({ char: M, sourceIndex: L })), text: t, caretIndex: 0, lineIndex: 0, drawX: 0, drawY: 0, width: 0, segments: [] }], v = 1), u === "auto" && I === 1 && (C = [{ items: p.map((M, L) => ({ char: M, sourceIndex: L })), text: t, caretIndex: 0, lineIndex: 0, drawX: 0, drawY: 0, width: 0, segments: [] }], v = 1));
2748
2748
  let T = !1;
2749
- const _ = C.slice(0, I);
2750
- if (C.length > I) {
2749
+ const _ = C.slice(0, v);
2750
+ if (C.length > v) {
2751
2751
  T = !0;
2752
- const M = C.slice(I - 1), L = this.buildEllipsisLine(M, s, d);
2753
- L.lineIndex = I - 1, _[I - 1] = L;
2754
- } else if (I > 0) {
2755
- const M = I - 1, L = C.slice(M), H = L.map((A) => A.text).join(""), { ellipsis: D } = this.handleEllipsis(H, s, d, a);
2752
+ const M = C.slice(v - 1), L = this.buildEllipsisLine(M, s, f);
2753
+ L.lineIndex = v - 1, _[v - 1] = L;
2754
+ } else if (v > 0) {
2755
+ const M = v - 1, L = C.slice(M), H = L.map((A) => A.text).join(""), { ellipsis: D } = this.handleEllipsis(H, s, f, a);
2756
2756
  if (D) {
2757
2757
  T = !0;
2758
- const A = this.buildEllipsisLine(L, s, d);
2758
+ const A = this.buildEllipsisLine(L, s, f);
2759
2759
  A.lineIndex = M, _[M] = A;
2760
2760
  }
2761
2761
  }
2762
2762
  const R = _.length * g;
2763
- let S = i + d;
2764
- f === "middle" ? S = i + (o - R) / 2 : f === "bottom" && (S = i + o - R - d);
2763
+ let S = i + f;
2764
+ d === "middle" ? S = i + (o - R) / 2 : d === "bottom" && (S = i + o - R - f);
2765
2765
  const O = [];
2766
2766
  return _.forEach((M, L) => {
2767
2767
  M.lineIndex = L;
2768
- const H = this.buildLineSegments(M), D = H.reduce((N, vt) => N + vt.width, 0);
2769
- let A = e + d + E;
2770
- c === "center" ? A = e + (s - D) / 2 : c === "right" && (A = e + s - d - m - D);
2768
+ const H = this.buildLineSegments(M), D = H.reduce((N, It) => N + It.width, 0);
2769
+ let A = e + f + E;
2770
+ c === "center" ? A = e + (s - D) / 2 : c === "right" && (A = e + s - f - w - D);
2771
2771
  const k = S + L * g;
2772
2772
  M.drawX = A, M.drawY = k, M.width = D, M.segments = H, H.forEach((N) => {
2773
2773
  N.sourceIndex < 0 || O.push({
@@ -2786,7 +2786,7 @@ class qe {
2786
2786
  glyphs: O,
2787
2787
  lines: _,
2788
2788
  box: { x: e, y: i, width: s, height: o },
2789
- contentBox: { x: e + d + E, y: i + d, width: y, height: b },
2789
+ contentBox: { x: e + f + E, y: i + f, width: y, height: b },
2790
2790
  contentY: S,
2791
2791
  lineHeight: g,
2792
2792
  font: a,
@@ -2801,10 +2801,10 @@ class qe {
2801
2801
  const i = Array.from(t), s = [];
2802
2802
  let o = [], r = 0, a = 0;
2803
2803
  const l = (c) => {
2804
- const d = o.map((f) => f.char).join("");
2804
+ const f = o.map((d) => d.char).join("");
2805
2805
  s.push({
2806
2806
  items: o,
2807
- text: d,
2807
+ text: f,
2808
2808
  caretIndex: a,
2809
2809
  lineIndex: s.length,
2810
2810
  drawX: 0,
@@ -2814,26 +2814,26 @@ class qe {
2814
2814
  }), o = [], r = 0, a = c;
2815
2815
  };
2816
2816
  for (let c = 0; c < i.length; c++) {
2817
- const d = i[c];
2818
- if (d === `
2817
+ const f = i[c];
2818
+ if (f === `
2819
2819
  `) {
2820
2820
  l(c + 1);
2821
2821
  continue;
2822
2822
  }
2823
- const f = this.ctx.measureText(d).width;
2824
- if (r + f > e && o.length > 0) {
2825
- l(o[o.length - 1].sourceIndex + 1), o.push({ char: d, sourceIndex: c }), r = f;
2823
+ const d = this.ctx.measureText(f).width;
2824
+ if (r + d > e && o.length > 0) {
2825
+ l(o[o.length - 1].sourceIndex + 1), o.push({ char: f, sourceIndex: c }), r = d;
2826
2826
  continue;
2827
2827
  }
2828
- o.push({ char: d, sourceIndex: c }), r += f;
2828
+ o.push({ char: f, sourceIndex: c }), r += d;
2829
2829
  }
2830
2830
  return (o.length > 0 || s.length === 0) && l(i.length), s;
2831
2831
  }
2832
2832
  buildEllipsisLine(t, e, i) {
2833
- var d;
2834
- const s = t.flatMap((f) => f.items), o = s.map((f) => f.char).join(""), { _text: r, ellipsis: a } = this.handleEllipsis(o, e, i, this.ctx.font), l = a ? r.slice(0, -3) : r, c = [];
2835
- for (let f = 0; f < l.length; f++) {
2836
- const u = s[f];
2833
+ var f;
2834
+ const s = t.flatMap((d) => d.items), o = s.map((d) => d.char).join(""), { _text: r, ellipsis: a } = this.handleEllipsis(o, e, i, this.ctx.font), l = a ? r.slice(0, -3) : r, c = [];
2835
+ for (let d = 0; d < l.length; d++) {
2836
+ const u = s[d];
2837
2837
  if (!u)
2838
2838
  break;
2839
2839
  c.push({ char: u.char, sourceIndex: u.sourceIndex });
@@ -2845,7 +2845,7 @@ class qe {
2845
2845
  ), {
2846
2846
  items: c,
2847
2847
  text: r,
2848
- caretIndex: ((d = t[0]) == null ? void 0 : d.caretIndex) ?? 0,
2848
+ caretIndex: ((f = t[0]) == null ? void 0 : f.caretIndex) ?? 0,
2849
2849
  lineIndex: 0,
2850
2850
  drawX: 0,
2851
2851
  drawY: 0,
@@ -2886,9 +2886,9 @@ class qe {
2886
2886
  }
2887
2887
  const l = a.split("");
2888
2888
  let c = "";
2889
- for (const d of l) {
2890
- const f = c + d;
2891
- this.ctx.measureText(f).width <= e ? c = f : c ? (s.push(c), c = d) : (s.push(d), c = "");
2889
+ for (const f of l) {
2890
+ const d = c + f;
2891
+ this.ctx.measureText(d).width <= e ? c = d : c ? (s.push(c), c = f) : (s.push(f), c = "");
2892
2892
  }
2893
2893
  c && s.push(c);
2894
2894
  }
@@ -2913,9 +2913,9 @@ class qe {
2913
2913
  cacheTextKey: c = ""
2914
2914
  } = i;
2915
2915
  this.ctx.save(), this.ctx.font = s, this.ctx.fillStyle = a, this.ctx.textAlign = r;
2916
- 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, c);
2916
+ const f = parseInt(((E = s.match(/\d+/)) == null ? void 0 : E[0]) || "12"), d = f * (i.lineHeight || 1.2), u = e - o * 2, x = this.wrapText(t, u, c);
2917
2917
  let g = 1;
2918
- return l === "auto" ? g = x.length : x.length > l ? g = l : g = x.length, this.ctx.restore(), Math.max(Math.floor(g * f + o * 2), Math.floor(d + o * 2));
2918
+ return l === "auto" ? g = x.length : x.length > l ? g = l : g = x.length, this.ctx.restore(), Math.max(Math.floor(g * d + o * 2), Math.floor(f + o * 2));
2919
2919
  }
2920
2920
  handleEllipsis(t, e, i = 0, s = "12px Arial") {
2921
2921
  this.ctx.save();
@@ -2934,10 +2934,10 @@ class qe {
2934
2934
  const l = this.ctx.measureText(t).width, c = e - i * 2;
2935
2935
  if (l && l >= c) {
2936
2936
  o = !0;
2937
- let d = 0;
2938
- for (let f = 0; f < t.length; f++)
2939
- if (d += this.ctx.measureText(t[f]).width, d >= c - a) {
2940
- r = t.slice(0, f) + "...", o = !0;
2937
+ let f = 0;
2938
+ for (let d = 0; d < t.length; d++)
2939
+ if (f += this.ctx.measureText(t[d]).width, f >= c - a) {
2940
+ r = t.slice(0, d) + "...", o = !0;
2941
2941
  break;
2942
2942
  }
2943
2943
  }
@@ -3042,12 +3042,6 @@ class Ut {
3042
3042
  n(this, "CELL_HOVER_ICON_BG_COLOR", "#fff");
3043
3043
  /** hover编辑图标边框颜色 */
3044
3044
  n(this, "CELL_HOVER_ICON_BORDER_COLOR", "#DDE0EA");
3045
- /** 内容缩放最小比例 */
3046
- n(this, "MIN_ZOOM", 0.5);
3047
- /** 内容缩放最大比例 */
3048
- n(this, "MAX_ZOOM", 2);
3049
- /** 启用 Ctrl + 滚轮内容缩放 */
3050
- n(this, "ENABLE_ZOOM_WHEEL", !0);
3051
3045
  /** 滚动条轨道尺寸 */
3052
3046
  n(this, "SCROLLER_TRACK_SIZE", 14);
3053
3047
  /** 滚动条模式,outer 为外部预留区域,inner 为覆盖在内容上 */
@@ -3333,7 +3327,7 @@ class Ut {
3333
3327
  }
3334
3328
  const ft = `<svg t="1724122015492" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4237" width="32" height="32"><path d="M401.472 316.992l159.04 217.664L591.488 512l-30.976-22.656-159.04 217.728q-2.24 3.008-3.84 6.464-1.6 3.456-2.496 7.104-0.896 3.648-1.024 7.424-0.192 3.84 0.384 7.552 0.64 3.712 1.92 7.296 1.28 3.52 3.2 6.784 1.984 3.2 4.544 6.016 2.56 2.752 5.632 4.992 3.072 2.24 6.464 3.84 3.456 1.6 7.168 2.496 3.648 0.896 7.424 1.024 3.776 0.192 7.488-0.448 3.776-0.576 7.296-1.856 3.584-1.28 6.784-3.264 3.2-1.92 6.016-4.48 2.816-2.56 5.056-5.632l159.04-217.728q3.584-4.928 5.504-10.752 1.92-5.76 1.92-11.904 0-6.08-1.92-11.904-1.92-5.76-5.504-10.752L463.488 271.68q-2.24-3.072-5.056-5.632-2.752-2.56-6.016-4.48-3.2-1.984-6.784-3.328-3.52-1.28-7.296-1.856-3.712-0.576-7.488-0.448-3.84 0.192-7.424 1.088-3.712 0.896-7.168 2.496-3.392 1.6-6.4 3.84-3.136 2.176-5.696 4.992-2.56 2.752-4.48 6.016-1.984 3.2-3.264 6.784-1.28 3.52-1.92 7.296-0.576 3.712-0.384 7.488 0.128 3.84 1.024 7.488 0.896 3.648 2.496 7.04 1.6 3.456 3.84 6.528z m30.976-61.056q-3.776 0-7.488 0.704-3.712 0.768-7.168 2.24-3.52 1.408-6.656 3.52-3.2 2.112-5.824 4.8-2.688 2.624-4.8 5.76-2.112 3.2-3.52 6.656-1.472 3.52-2.176 7.232-0.768 3.712-0.768 7.488 0 3.776 0.768 7.488 0.704 3.712 2.176 7.232 1.408 3.456 3.52 6.592 2.112 3.2 4.8 5.824 2.688 2.688 5.76 4.8 3.2 2.112 6.72 3.52 3.456 1.472 7.168 2.176 3.712 0.768 7.488 0.768 3.84 0 7.488-0.768 3.712-0.704 7.232-2.176 3.456-1.408 6.592-3.52 3.2-2.112 5.824-4.8 2.688-2.688 4.8-5.76 2.112-3.2 3.52-6.656 1.472-3.52 2.24-7.232 0.704-3.712 0.704-7.488 0-3.84-0.704-7.488-0.768-3.712-2.24-7.232-1.408-3.456-3.52-6.592-2.112-3.2-4.8-5.824-2.624-2.688-5.76-4.8-3.2-2.112-6.656-3.52-3.52-1.472-7.232-2.24Q436.224 256 432.448 256z m0 435.392q-3.776 0-7.488 0.704-3.712 0.768-7.168 2.176-3.52 1.472-6.656 3.584-3.2 2.112-5.824 4.736-2.688 2.688-4.8 5.824-2.112 3.2-3.52 6.656-1.472 3.52-2.176 7.232-0.768 3.712-0.768 7.488 0 3.776 0.768 7.488 0.704 3.712 2.176 7.168 1.408 3.52 3.52 6.656 2.112 3.2 4.8 5.76 2.688 2.752 5.76 4.8 3.2 2.112 6.72 3.584 3.456 1.472 7.168 2.176 3.712 0.768 7.488 0.768 3.84 0 7.488-0.768 3.712-0.704 7.232-2.176 3.456-1.472 6.592-3.584 3.2-2.048 5.824-4.736 2.688-2.688 4.8-5.824 2.112-3.2 3.52-6.656 1.472-3.456 2.24-7.168 0.704-3.712 0.704-7.488 0-3.84-0.704-7.488-0.768-3.712-2.24-7.232-1.408-3.52-3.52-6.656-2.112-3.136-4.8-5.76-2.624-2.688-5.76-4.8-3.2-2.112-6.656-3.584-3.52-1.408-7.232-2.176-3.712-0.704-7.488-0.704z" p-id="4238"></path></svg>\r
3335
3329
  `, jt = `<svg t="1722595535853" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4551" width="32" height="32"><path d="M640 128H384c-170.496 0-256 85.504-256 256v256c0 170.496 85.504 256 256 256h256c170.496 0 256-85.504 256-256V384c0-170.496-85.504-256-256-256z m67.584 302.592c-2.048 4.608-4.608 8.704-8.192 12.288L506.88 634.88c-3.584 3.584-7.68 6.144-12.288 8.192-4.608 2.048-9.728 3.072-14.848 3.072s-10.24-1.024-14.848-3.072c-4.608-2.048-8.704-4.608-12.288-8.192l-96.256-96.256c-3.584-3.584-6.144-7.68-8.192-12.288-2.048-4.608-3.072-9.728-3.072-14.848 0-2.56 0-5.12 1.024-7.68 0.512-2.56 1.024-5.12 2.048-7.168 1.024-2.56 2.048-4.608 3.584-6.656 1.536-2.048 3.072-4.096 4.608-5.632 1.536-2.048 3.584-3.584 5.632-4.608 2.048-1.536 4.096-2.56 6.656-3.584 2.56-1.024 4.608-1.536 7.168-2.048 2.56-0.512 5.12-0.512 7.68-0.512 5.12 0 10.24 1.024 14.848 3.072 4.608 2.048 8.704 4.608 12.288 8.192l69.12 68.608L645.12 389.12c3.584-3.584 7.68-6.144 12.288-8.192 4.608-2.048 9.728-3.072 14.848-3.072 2.56 0 5.12 0 7.68 0.512s5.12 1.024 7.168 2.048c2.56 1.024 4.608 2.048 6.656 3.584 2.048 1.536 4.096 3.072 5.632 4.608 1.536 1.536 3.584 3.584 4.608 5.632 1.536 2.048 2.56 4.096 3.584 6.656 1.024 2.56 1.536 4.608 2.048 7.168 0.512 2.56 1.024 5.12 1.024 7.68 0 5.12-1.024 10.24-3.072 14.848z" p-id="4552"></path></svg>
3336
- `, Zt = `<svg t="1724122044148" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4551" width="32" height="32"><path d="M707.648 401.28L489.28 560.704l22.656 30.976 22.656-30.976L316.16 401.216q-3.072-2.24-6.464-3.84-3.456-1.536-7.104-2.432-3.712-0.896-7.488-1.088-3.776-0.128-7.488 0.448-3.776 0.64-7.296 1.92-3.584 1.28-6.784 3.2-3.2 1.984-6.016 4.544-2.816 2.56-5.056 5.632-2.176 3.072-3.84 6.464-1.536 3.456-2.432 7.104-0.896 3.712-1.088 7.488-0.128 3.776 0.448 7.488 0.64 3.776 1.92 7.296 1.28 3.584 3.2 6.784 1.984 3.2 4.544 6.016 2.56 2.752 5.632 4.992l218.368 159.552q4.928 3.584 10.752 5.504 5.76 1.92 11.904 1.92 6.08 0 11.904-1.92 5.76-1.92 10.752-5.504l218.368-159.552q3.008-2.24 5.568-4.992 2.56-2.816 4.544-6.016 1.92-3.2 3.264-6.784 1.28-3.52 1.92-7.296 0.576-3.712 0.384-7.488-0.128-3.84-1.024-7.488-0.896-3.648-2.496-7.04-1.6-3.456-3.84-6.528-2.24-3.072-4.992-5.632-2.816-2.56-6.016-4.48-3.2-1.984-6.784-3.328-3.584-1.28-7.296-1.856-3.712-0.64-7.488-0.448-3.84 0.192-7.488 1.088-3.648 0.896-7.04 2.496-3.456 1.536-6.528 3.84z m61.056 30.976q0-3.84-0.768-7.488-0.704-3.712-2.176-7.232-1.472-3.456-3.52-6.656-2.112-3.136-4.8-5.76-2.688-2.688-5.76-4.8-3.2-2.112-6.72-3.584-3.456-1.408-7.168-2.176-3.712-0.704-7.488-0.704-3.84 0-7.488 0.704-3.712 0.768-7.232 2.176-3.456 1.472-6.656 3.584-3.136 2.112-5.76 4.8-2.688 2.624-4.8 5.76-2.112 3.2-3.584 6.656-1.408 3.52-2.176 7.232-0.704 3.712-0.704 7.488 0 3.776 0.704 7.488 0.768 3.712 2.176 7.168 1.472 3.52 3.584 6.656 2.112 3.2 4.8 5.824 2.624 2.688 5.76 4.8 3.2 2.112 6.656 3.52 3.52 1.472 7.232 2.176 3.712 0.768 7.488 0.768 3.776 0 7.488-0.768 3.712-0.704 7.168-2.176 3.52-1.408 6.656-3.52 3.2-2.112 5.824-4.8 2.688-2.688 4.8-5.76 2.048-3.2 3.52-6.72 1.472-3.456 2.176-7.168 0.768-3.712 0.768-7.488z m-436.736 0q0-3.84-0.768-7.488-0.704-3.712-2.176-7.232-1.408-3.456-3.52-6.656-2.112-3.136-4.8-5.76-2.688-2.688-5.76-4.8-3.2-2.112-6.656-3.584-3.52-1.408-7.232-2.176-3.712-0.704-7.488-0.704-3.84 0-7.488 0.704-3.712 0.768-7.232 2.176-3.456 1.472-6.592 3.584-3.2 2.112-5.824 4.8-2.688 2.624-4.8 5.76-2.112 3.2-3.52 6.656-1.472 3.52-2.24 7.232-0.704 3.712-0.704 7.488 0 3.776 0.704 7.488 0.768 3.712 2.24 7.168 1.408 3.52 3.52 6.656 2.112 3.2 4.8 5.824 2.624 2.688 5.76 4.8 3.2 2.112 6.656 3.52 3.52 1.472 7.232 2.176 3.712 0.768 7.488 0.768 3.776 0 7.488-0.768 3.712-0.704 7.232-2.176 3.456-1.408 6.592-3.52 3.2-2.112 5.824-4.8 2.688-2.688 4.8-5.76 2.112-3.2 3.52-6.72 1.472-3.456 2.176-7.168 0.768-3.712 0.768-7.488z" p-id="4552"></path></svg>
3330
+ `, qt = `<svg t="1724122044148" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4551" width="32" height="32"><path d="M707.648 401.28L489.28 560.704l22.656 30.976 22.656-30.976L316.16 401.216q-3.072-2.24-6.464-3.84-3.456-1.536-7.104-2.432-3.712-0.896-7.488-1.088-3.776-0.128-7.488 0.448-3.776 0.64-7.296 1.92-3.584 1.28-6.784 3.2-3.2 1.984-6.016 4.544-2.816 2.56-5.056 5.632-2.176 3.072-3.84 6.464-1.536 3.456-2.432 7.104-0.896 3.712-1.088 7.488-0.128 3.776 0.448 7.488 0.64 3.776 1.92 7.296 1.28 3.584 3.2 6.784 1.984 3.2 4.544 6.016 2.56 2.752 5.632 4.992l218.368 159.552q4.928 3.584 10.752 5.504 5.76 1.92 11.904 1.92 6.08 0 11.904-1.92 5.76-1.92 10.752-5.504l218.368-159.552q3.008-2.24 5.568-4.992 2.56-2.816 4.544-6.016 1.92-3.2 3.264-6.784 1.28-3.52 1.92-7.296 0.576-3.712 0.384-7.488-0.128-3.84-1.024-7.488-0.896-3.648-2.496-7.04-1.6-3.456-3.84-6.528-2.24-3.072-4.992-5.632-2.816-2.56-6.016-4.48-3.2-1.984-6.784-3.328-3.584-1.28-7.296-1.856-3.712-0.64-7.488-0.448-3.84 0.192-7.488 1.088-3.648 0.896-7.04 2.496-3.456 1.536-6.528 3.84z m61.056 30.976q0-3.84-0.768-7.488-0.704-3.712-2.176-7.232-1.472-3.456-3.52-6.656-2.112-3.136-4.8-5.76-2.688-2.688-5.76-4.8-3.2-2.112-6.72-3.584-3.456-1.408-7.168-2.176-3.712-0.704-7.488-0.704-3.84 0-7.488 0.704-3.712 0.768-7.232 2.176-3.456 1.472-6.656 3.584-3.136 2.112-5.76 4.8-2.688 2.624-4.8 5.76-2.112 3.2-3.584 6.656-1.408 3.52-2.176 7.232-0.704 3.712-0.704 7.488 0 3.776 0.704 7.488 0.768 3.712 2.176 7.168 1.472 3.52 3.584 6.656 2.112 3.2 4.8 5.824 2.624 2.688 5.76 4.8 3.2 2.112 6.656 3.52 3.52 1.472 7.232 2.176 3.712 0.768 7.488 0.768 3.776 0 7.488-0.768 3.712-0.704 7.168-2.176 3.52-1.408 6.656-3.52 3.2-2.112 5.824-4.8 2.688-2.688 4.8-5.76 2.048-3.2 3.52-6.72 1.472-3.456 2.176-7.168 0.768-3.712 0.768-7.488z m-436.736 0q0-3.84-0.768-7.488-0.704-3.712-2.176-7.232-1.408-3.456-3.52-6.656-2.112-3.136-4.8-5.76-2.688-2.688-5.76-4.8-3.2-2.112-6.656-3.584-3.52-1.408-7.232-2.176-3.712-0.704-7.488-0.704-3.84 0-7.488 0.704-3.712 0.768-7.232 2.176-3.456 1.472-6.592 3.584-3.2 2.112-5.824 4.8-2.688 2.624-4.8 5.76-2.112 3.2-3.52 6.656-1.472 3.52-2.24 7.232-0.704 3.712-0.704 7.488 0 3.776 0.704 7.488 0.768 3.712 2.24 7.168 1.408 3.52 3.52 6.656 2.112 3.2 4.8 5.824 2.624 2.688 5.76 4.8 3.2 2.112 6.656 3.52 3.52 1.472 7.232 2.176 3.712 0.768 7.488 0.768 3.776 0 7.488-0.768 3.712-0.704 7.232-2.176 3.456-1.408 6.592-3.52 3.2-2.112 5.824-4.8 2.688-2.688 4.8-5.76 2.112-3.2 3.52-6.72 1.472-3.456 2.176-7.168 0.768-3.712 0.768-7.488z" p-id="4552"></path></svg>
3337
3331
  `, Bt = `<svg t="1755138507987" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5079" width="200" height="200"><path d="M512 938.688a42.688 42.688 0 0 1-35.072-18.432l-192-277.312A42.56 42.56 0 0 1 320 576h384a42.752 42.752 0 0 1 35.072 66.944l-192 277.312a42.688 42.688 0 0 1-35.072 18.432" fill="currentColor" p-id="2016"></path><path d="M704 448H320a42.752 42.752 0 0 1-35.072-66.944l192-277.312c16-23.04 54.208-23.04 70.144 0l192 277.312A42.56 42.56 0 0 1 704 448" fill="currentColor" p-id="2015"></path></svg>
3338
3332
  `, xe = `<svg t="1724133395728" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2893" width="32" height="32"><path d="M512 226.8476541a19.82487759 19.82487759 0 0 1 14.66497778 5.70304692c3.80203107 3.82918865 5.70304692 8.71751457 5.70304693 14.66497779v122.20814825a19.82487759 19.82487759 0 0 1-5.70304693 14.66497778 19.82487759 19.82487759 0 0 1-14.66497778 5.70304691 19.82487759 19.82487759 0 0 1-14.66497778-5.70304691 19.82487759 19.82487759 0 0 1-5.70304693-14.66497778v-122.20814825a19.82487759 19.82487759 0 0 1 5.70304693-14.66497779 19.82487759 19.82487759 0 0 1 14.66497778-5.70304692z m0 407.36049415a19.82487759 19.82487759 0 0 1 14.66497778 5.70304691c3.80203107 3.82918865 5.70304692 8.71751457 5.70304693 14.66497778v122.20814827a19.82487759 19.82487759 0 0 1-5.70304693 14.66497776 19.82487759 19.82487759 0 0 1-14.66497778 5.70304693 19.82487759 19.82487759 0 0 1-14.66497778-5.70304693 19.82487759 19.82487759 0 0 1-5.70304693-14.66497776v-122.20814827a19.82487759 19.82487759 0 0 1 5.70304693-14.66497778 19.82487759 19.82487759 0 0 1 14.66497778-5.70304691zM797.1523459 512a19.82487759 19.82487759 0 0 1-5.70304692 14.66497778 19.82487759 19.82487759 0 0 1-14.66497779 5.70304693h-122.20814825a19.82487759 19.82487759 0 0 1-14.66497778-5.70304693 19.82487759 19.82487759 0 0 1-5.70304691-14.66497778 19.82487759 19.82487759 0 0 1 5.70304691-14.66497778 19.82487759 19.82487759 0 0 1 14.66497778-5.70304693h122.20814825a19.82487759 19.82487759 0 0 1 14.66497779 5.70304693c3.80203107 3.82918865 5.70304692 8.71751457 5.70304692 14.66497778z m-407.36049415 0a19.82487759 19.82487759 0 0 1-5.70304691 14.66497778 19.82487759 19.82487759 0 0 1-14.66497778 5.70304693h-122.20814827a19.82487759 19.82487759 0 0 1-14.66497776-5.70304693 19.82487759 19.82487759 0 0 1-5.70304693-14.66497778 19.82487759 19.82487759 0 0 1 5.70304693-14.66497778 19.82487759 19.82487759 0 0 1 14.66497776-5.70304693h122.20814827a19.82487759 19.82487759 0 0 1 14.66497778 5.70304693c3.80203107 3.82918865 5.70304692 8.71751457 5.70304691 14.66497778zM310.22076878 310.22076878a21.29137537 21.29137537 0 0 1 14.66497779-5.70304693c5.51294514 0 10.18401235 1.90101585 14.01320099 5.70304693l86.55052591 86.57768347a20.91117183 20.91117183 0 0 1 5.73020449 14.31193182 19.28172983 19.28172983 0 0 1-6.05609289 14.013201 19.11878565 19.11878565 0 0 1-14.013201 6.05609289 20.96548698 20.96548698 0 0 1-14.31193182-5.70304692L310.22076878 338.87178998a19.06447114 19.06447114 0 0 1-5.70304693-14.01320099c0-5.54010272 1.90101585-10.42842865 5.70304693-14.66497778z m288.32975775 288.32975775a19.79772001 19.79772001 0 0 1 14.3390894-6.35482371c5.29568642 0 10.04822572 2.11827457 14.31193182 6.38198066l86.57768347 86.55052651c3.80203107 3.80203107 5.70304692 8.47309828 5.70304691 14.01320102a19.55330372 19.55330372 0 0 1-6.05609225 14.31193182 19.66193339 19.66193339 0 0 1-14.31193245 6.05609288 19.01015661 19.01015661 0 0 1-14.01320099-5.70304692l-86.55052591-86.57768347a19.79772001 19.79772001 0 0 1-6.38198129-14.31193245c0-5.29568642 2.11827457-10.07538268 6.38198129-14.33908939zM713.77923122 310.22076878c3.80203107 4.26370672 5.70304692 9.15203265 5.70304693 14.66497779s-1.90101585 10.18401235-5.70304693 14.01320099l-86.57768347 86.55052591a20.91117183 20.91117183 0 0 1-14.31193182 5.73020449 19.28172983 19.28172983 0 0 1-14.013201-6.05609289 19.11878565 19.11878565 0 0 1-6.05609289-14.013201c0-5.29568642 1.90101585-10.07538268 5.70304692-14.31193182l86.57768348-86.57768347c3.80203107-3.80203107 8.50025585-5.70304692 14.01320099-5.70304693 5.54010272 0 10.40127108 1.90101585 14.66497779 5.70304693zM425.44947347 598.57768347a19.79772001 19.79772001 0 0 1 6.35482371 14.33908939c0 5.29568642-2.11827457 10.04822572-6.38198066 14.31193245L338.89894756 713.77923122a19.06447114 19.06447114 0 0 1-14.01320099 5.70304693 19.55330372 19.55330372 0 0 1-14.31193245-6.05609227 19.68909035 19.68909035 0 0 1-6.05609227-14.31193245 19.01015661 19.01015661 0 0 1 5.70304693-14.01320099l86.57768347-86.55052591a19.79772001 19.79772001 0 0 1 14.31193182-6.38198129c5.29568642 0 10.07538268 2.11827457 14.3390894 6.38198129z" fill="#000000" fill-opacity=".65" p-id="2894"></path></svg>
3339
3333
  `, Je = `<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 24 24"><path d="M11 18c0 1.1-.9 2-2 2s-2-.9-2-2s.9-2 2-2s2 .9 2 2zm-2-8c-1.1 0-2 .9-2 2s.9 2 2 2s2-.9 2-2s-.9-2-2-2zm0-6c-1.1 0-2 .9-2 2s.9 2 2 2s2-.9 2-2s-.9-2-2-2zm6 4c1.1 0 2-.9 2-2s-.9-2-2-2s-2 .9-2 2s.9 2 2 2zm0 2c-1.1 0-2 .9-2 2s.9 2 2 2s2-.9 2-2s-.9-2-2-2zm0 6c-1.1 0-2 .9-2 2s.9 2 2 2s2-.9 2-2s-.9-2-2-2z" fill="currentColor"></path></svg>
@@ -3364,7 +3358,7 @@ class ri {
3364
3358
  name: "shrink",
3365
3359
  configName: "SHRINK_ICON_SVG",
3366
3360
  configColorName: "SHRINK_ICON_COLOR",
3367
- svg: Zt,
3361
+ svg: qt,
3368
3362
  color: "#4E5969"
3369
3363
  },
3370
3364
  {
@@ -3412,7 +3406,7 @@ class ri {
3412
3406
  name: "icon-select",
3413
3407
  configName: "ICON_SELECT_SVG",
3414
3408
  configColorName: "ICON_SELECT_COLOR",
3415
- svg: Zt,
3409
+ svg: qt,
3416
3410
  color: "#4E5969"
3417
3411
  },
3418
3412
  {
@@ -3476,8 +3470,8 @@ class ri {
3476
3470
  async createImageFromSVG(t, e, i = !1) {
3477
3471
  const r = new DOMParser().parseFromString(t, "image/svg+xml").documentElement;
3478
3472
  e && r.querySelectorAll("*").forEach((c) => {
3479
- const d = c.getAttribute("fill");
3480
- (d === "currentColor" || d === null) && c.setAttribute("fill", e);
3473
+ const f = c.getAttribute("fill");
3474
+ (f === "currentColor" || f === null) && c.setAttribute("fill", e);
3481
3475
  });
3482
3476
  const a = new Image();
3483
3477
  let l = "";
@@ -3488,8 +3482,8 @@ class ri {
3488
3482
  l = URL.createObjectURL(c);
3489
3483
  } else
3490
3484
  l = "data:image/svg+xml;charset=utf-8," + encodeURIComponent(new XMLSerializer().serializeToString(r));
3491
- return a.src = l, new Promise((c, d) => {
3492
- a.onerror = () => d(new Error("Failed to load image:" + t)), a.onload = () => {
3485
+ return a.src = l, new Promise((c, f) => {
3486
+ a.onerror = () => f(new Error("Failed to load image:" + t)), a.onload = () => {
3493
3487
  c(a);
3494
3488
  };
3495
3489
  });
@@ -3696,97 +3690,7 @@ class li {
3696
3690
  return s ? s.replace(/{(\w+)}/g, (o, r) => (e == null ? void 0 : e[r]) || o) : "";
3697
3691
  }
3698
3692
  }
3699
- const ci = /^-?\d*\.?\d+px$/;
3700
- class hi {
3701
- constructor() {
3702
- n(this, "value", 1);
3703
- }
3704
- get isDefault() {
3705
- return this.value === 1;
3706
- }
3707
- clamp(t, e, i) {
3708
- return Math.min(i, Math.max(e, t));
3709
- }
3710
- /** @returns 是否发生变化 */
3711
- set(t, e, i) {
3712
- const s = this.clamp(t, e, i);
3713
- return Math.abs(s - this.value) < 1e-4 ? !1 : (this.value = s, !0);
3714
- }
3715
- /** 逻辑 -> 物理 */
3716
- toVisual(t) {
3717
- return t * this.value;
3718
- }
3719
- /** 物理 -> 逻辑 */
3720
- toLogical(t) {
3721
- return t / this.value;
3722
- }
3723
- toPx(t) {
3724
- return `${this.toVisual(t)}px`;
3725
- }
3726
- /** DOM 测量高度 -> 逻辑高度 */
3727
- domHeightToLogical(t) {
3728
- return Math.round(t / this.value);
3729
- }
3730
- /** 逻辑内容尺寸 -> 物理尺寸 */
3731
- contentToPhysical(t) {
3732
- return t * this.value;
3733
- }
3734
- scaleStyle(t) {
3735
- if (this.isDefault)
3736
- return t;
3737
- const e = { ...t };
3738
- for (const i of Object.keys(e)) {
3739
- const s = e[i];
3740
- typeof s == "string" && ci.test(s) && (e[i] = `${parseFloat(s) * this.value}px`);
3741
- }
3742
- return e;
3743
- }
3744
- assignScaledStyle(t, e) {
3745
- Object.assign(t.style, this.scaleStyle(e));
3746
- }
3747
- /** 容器物理宽度 -> 逻辑可视宽度 */
3748
- containerWidth(t) {
3749
- return Math.floor(t / this.value);
3750
- }
3751
- resolveStageWidth(t) {
3752
- const e = this.containerWidth(t.containerPhysicalWidth), i = t.fillContainer ? e : Math.min(Math.floor(t.contentWidth + t.scrollerTrackSize), e), s = Math.min(
3753
- Math.round(this.toVisual(i)),
3754
- Math.floor(t.containerPhysicalWidth)
3755
- );
3756
- return { stageWidth: i, stagePhysicalWidth: s };
3757
- }
3758
- applyStageHeight(t, e) {
3759
- const i = Math.floor(e), s = Math.floor(i / this.value);
3760
- return t.style.height = `${i}px`, { stageHeight: s, stagePhysicalHeight: i };
3761
- }
3762
- /** floating-ui 锚点:逻辑单元格 -> 视口物理矩形 */
3763
- getViewportRect(t, e) {
3764
- const i = this.toVisual(t.x) + e.x, s = this.toVisual(t.y) + e.y, o = this.toVisual(t.width), r = this.toVisual(t.height);
3765
- return {
3766
- x: i,
3767
- y: s,
3768
- left: i,
3769
- top: s,
3770
- right: i + o,
3771
- bottom: s + r,
3772
- width: o,
3773
- height: r
3774
- };
3775
- }
3776
- /** overlayer 单元格:外层物理定位 + 内层 zoom 缩放自定义 render */
3777
- createOverlayerCellElement(t, e) {
3778
- const i = document.createElement("div");
3779
- if (this.assignScaledStyle(i, t.style), Object.keys(t.domDataset || {}).forEach((l) => {
3780
- i.setAttribute(l, t.domDataset[l]);
3781
- }), typeof t.render != "function")
3782
- return i;
3783
- if (this.isDefault)
3784
- return t.render(i, t), i;
3785
- const s = "visibleWidth" in t ? t.visibleWidth : t.width, o = "visibleHeight" in t ? t.visibleHeight : t.height, r = "autoRowHeight" in t && t.autoRowHeight && "renderType" in t && t.renderType === "default", a = document.createElement("div");
3786
- return a.className = `${e}-overlayer-cell-content`, a.style.width = `${s}px`, a.style.boxSizing = "border-box", r ? (a.style.height = "auto", a.style.minHeight = `${o}px`, i.style.height = "auto") : (a.style.height = `${o}px`, i.style.height = this.toPx(o)), a.style.zoom = String(this.value), i.style.width = this.toPx(s), i.appendChild(a), t.render(a, t), i;
3787
- }
3788
- }
3789
- class di {
3693
+ class ci {
3790
3694
  constructor(t, e) {
3791
3695
  n(this, "eventBus");
3792
3696
  n(this, "eventBrowser");
@@ -3801,12 +3705,7 @@ class di {
3801
3705
  n(this, "contextMenuElement");
3802
3706
  n(this, "loadingElement");
3803
3707
  n(this, "stageWidth", 0);
3804
- // 逻辑可视宽度(物理宽度/zoom)
3805
3708
  n(this, "stageHeight", 0);
3806
- // 逻辑可视高度(物理高度/zoom)
3807
- n(this, "stagePhysicalWidth", 0);
3808
- n(this, "stagePhysicalHeight", 0);
3809
- n(this, "zoomScale");
3810
3709
  n(this, "paint");
3811
3710
  n(this, "icons");
3812
3711
  n(this, "domSelectionStr", "");
@@ -3938,12 +3837,9 @@ class di {
3938
3837
  editorElement: a,
3939
3838
  emptyElement: l,
3940
3839
  loadingElement: c,
3941
- contextMenuElement: d
3840
+ contextMenuElement: f
3942
3841
  } = t;
3943
- this.containerElement = i, s.tabIndex = 0, this.stageElement = s, this.canvasElement = o, this.overlayerElement = r, this.editorElement = a, this.emptyElement = l, this.loadingElement = c, this.contextMenuElement = d, this.config = new Ut(e.config || {}), this.eventBus = new Ze(), this.eventBrowser = new je(this), this.eventTable = new ni(this), this.paint = new qe(this.canvasElement), this.database = new $e(this, e), this.history = new Ue(this), this.icons = new ri(this), this.zoomScale = new hi();
3944
- }
3945
- get zoom() {
3946
- return this.zoomScale.value;
3842
+ this.containerElement = i, s.tabIndex = 0, this.stageElement = s, this.canvasElement = o, this.overlayerElement = r, this.editorElement = a, this.emptyElement = l, this.loadingElement = c, this.contextMenuElement = f, this.config = new Ut(e.config || {}), this.eventBus = new qe(), this.eventBrowser = new je(this), this.eventTable = new ni(this), this.paint = new Ze(this.canvasElement), this.database = new Ge(this, e), this.history = new Ue(this), this.icons = new ri(this);
3947
3843
  }
3948
3844
  setConfig(t) {
3949
3845
  this.config = new Ut(t);
@@ -3952,7 +3848,7 @@ class di {
3952
3848
  if (this.config.ENABLE_MERGE_CELL_LINK) {
3953
3849
  const a = this.database.getVirtualBodyCellByKey(t, e);
3954
3850
  if (a && (a.mergeRow || a.mergeCol)) {
3955
- const { dataList: l } = a.getSpanInfo(), c = l.map((d) => ({ ...d, value: i }));
3851
+ const { dataList: l } = a.getSpanInfo(), c = l.map((f) => ({ ...f, value: i }));
3956
3852
  this.database.batchSetItemValue(c, s, r);
3957
3853
  return;
3958
3854
  }
@@ -3967,8 +3863,8 @@ class di {
3967
3863
  if (r === void 0 || a === void 0) return;
3968
3864
  const l = this.database.getVirtualBodyCell(r, a);
3969
3865
  if (l) {
3970
- const { dataList: c } = l.getSpanInfo(), d = c.map((f) => ({ ...f, value: o.value }));
3971
- s.push(...d);
3866
+ const { dataList: c } = l.getSpanInfo(), f = c.map((d) => ({ ...d, value: o.value }));
3867
+ s.push(...f);
3972
3868
  }
3973
3869
  }), this.database.batchSetItemValue(s, e, i);
3974
3870
  } else
@@ -4007,15 +3903,31 @@ class di {
4007
3903
  * @returns
4008
3904
  */
4009
3905
  getSelectedData() {
3906
+ var o;
4010
3907
  const t = [], e = this.selector.yArr, i = this.selector.xArr;
4011
3908
  let s = "";
4012
- for (let o = 0; o <= e[1] - e[0]; o++) {
4013
- const r = [];
4014
- for (let a = 0; a <= i[1] - i[0]; a++) {
4015
- const l = o + e[0], c = a + i[0], d = this.database.getVirtualBodyCell(l, c);
4016
- d && (d.selectorCellValueType === "displayText" ? r.push(d.displayText) : r.push(d.getValue()));
3909
+ for (let r = 0; r <= e[1] - e[0]; r++) {
3910
+ const a = [];
3911
+ for (let l = 0; l <= i[1] - i[0]; l++) {
3912
+ const c = r + e[0], f = l + i[0], d = this.database.getVirtualBodyCell(c, f);
3913
+ if (d)
3914
+ if ((o = d == null ? void 0 : d.column) != null && o.formatterSelectorValue) {
3915
+ const {
3916
+ row: u,
3917
+ rowIndex: x,
3918
+ colIndex: g,
3919
+ column: E
3920
+ } = d, w = d.column.formatterSelectorValue({
3921
+ row: u,
3922
+ rowIndex: x,
3923
+ colIndex: g,
3924
+ column: E,
3925
+ value: d.getValue()
3926
+ });
3927
+ a.push(w);
3928
+ } else d.selectorCellValueType === "displayText" ? a.push(d.displayText) : a.push(d.getValue());
4017
3929
  }
4018
- s += `${r.join(" ")}\r`, t.push(r);
3930
+ s += `${a.join(" ")}\r`, t.push(a);
4019
3931
  }
4020
3932
  return s = s ? s.replace(/\r$/, "") : " ", {
4021
3933
  xArr: i,
@@ -4054,29 +3966,10 @@ class di {
4054
3966
  getOffset(t) {
4055
3967
  const { left: e, top: i } = this.containerElement.getBoundingClientRect();
4056
3968
  return {
4057
- offsetX: this.zoomScale.toLogical(t.clientX - e),
4058
- offsetY: this.zoomScale.toLogical(t.clientY - i)
3969
+ offsetX: t.clientX - e,
3970
+ offsetY: t.clientY - i
4059
3971
  };
4060
3972
  }
4061
- toVisual(t) {
4062
- return this.zoomScale.toVisual(t);
4063
- }
4064
- toLogical(t) {
4065
- return this.zoomScale.toLogical(t);
4066
- }
4067
- toVisualPx(t) {
4068
- return this.zoomScale.toPx(t);
4069
- }
4070
- scaleStyle(t) {
4071
- return this.zoomScale.scaleStyle(t);
4072
- }
4073
- setZoom(t) {
4074
- const { MIN_ZOOM: e, MAX_ZOOM: i } = this.config;
4075
- this.zoomScale.set(t, e, i) && (this.emit("zoomChange", this.zoomScale.value), this.emit("resetHeader"));
4076
- }
4077
- getZoom() {
4078
- return this.zoomScale.value;
4079
- }
4080
3973
  hasEvent(t) {
4081
3974
  return this.eventBus.has(t);
4082
3975
  }
@@ -4096,7 +3989,7 @@ class di {
4096
3989
  this.eventTable.destroy(), this.eventBrowser.destroy(), this.eventBus.destroy();
4097
3990
  }
4098
3991
  }
4099
- function qt(h, t, e, i = t, s = 30) {
3992
+ function Zt(h, t, e, i = t, s = 30) {
4100
3993
  if (h <= 0 || t <= 0 || e <= 0 || i <= 0)
4101
3994
  return 0;
4102
3995
  const o = Math.floor(t / e * i);
@@ -4137,7 +4030,7 @@ class Jt {
4137
4030
  this.updateScroll(t);
4138
4031
  }
4139
4032
  onTouchmove(t) {
4140
- const { clientY: e, clientX: i } = t.touches[0], s = this.ctx.zoomScale.toLogical(e - this.clientY), o = this.ctx.zoomScale.toLogical(i - this.clientX);
4033
+ const { clientY: e, clientX: i } = t.touches[0], s = e - this.clientY, o = i - this.clientX;
4141
4034
  let r = 0;
4142
4035
  this.type === "vertical" ? (r = Math.max(0, Math.min(this.dragStart - s, this.distance)), this.hasScrollbar() && !(r === 0 && s > 0 || r === this.distance && s < 0) && t.preventDefault()) : this.type === "horizontal" && (r = Math.max(0, Math.min(this.dragStart - o, this.distance))), this.scroll = r;
4143
4036
  }
@@ -4150,7 +4043,7 @@ class Jt {
4150
4043
  return;
4151
4044
  if (this.ctx.stageElement.style.cursor === "row-resize" || this.ctx.stageElement.style.cursor === "col-resize")
4152
4045
  return !0;
4153
- const { clientX: e, clientY: i } = t, s = this.ctx.zoomScale.toLogical(t.offsetX), o = this.ctx.zoomScale.toLogical(t.offsetY);
4046
+ const { clientX: e, clientY: i } = t, { offsetX: s, offsetY: o } = this.ctx.getOffset(t);
4154
4047
  if (!(e == this.clientX && i == this.clientY) && !(this.isInnerMode() && !this.canInteractWithScrollbar())) {
4155
4048
  if (this.isOnScrollbar(s, o))
4156
4049
  this.clientX = e, this.clientY = i, this.isDragging = !0, this.ctx.scrollerMove = !0, this.isFocus = !0, this.dragStart = this.scroll, t.preventDefault();
@@ -4164,13 +4057,13 @@ class Jt {
4164
4057
  this.isDragging = !1, this.isFocus = !1, this.clientX = 0, this.clientY = 0;
4165
4058
  }
4166
4059
  onMouseMove(t, e) {
4167
- const { clientX: i, clientY: s, buttons: o } = t, r = this.ctx.zoomScale.toLogical(t.offsetX), a = this.ctx.zoomScale.toLogical(t.offsetY);
4060
+ const { clientX: i, clientY: s, buttons: o } = t, { offsetX: r, offsetY: a } = this.ctx.getOffset(t);
4168
4061
  let l = !1;
4169
- if (Ve(this.ctx.config, e) ? this.startInnerShowTimer() : l = this.hideInnerScrollbar(), this.canInteractWithScrollbar() && (this.isOnScrollbar(r, a) || this.isOnTrack(r, a)) && t.target === this.ctx.canvasElement ? (this.isFocus = !0, this.ctx.stageElement.style.cursor = "pointer") : this.isFocus = !1, o === 0 || i == this.clientX && s == this.clientY) return l;
4170
- let d = 0;
4171
- if (this.type === "horizontal" ? d = i - this.clientX : d = s - this.clientY, d = this.ctx.zoomScale.toLogical(d), this.isDragging && d !== 0) {
4172
- let f = 0;
4173
- this.type === "vertical" ? f = this.dragStart + d / this.thumbTravelDistance * this.distance : f = this.dragStart + d / this.thumbTravelDistance * this.distance, this.scroll = Math.max(0, Math.min(f, this.distance));
4062
+ if (Ve(this.ctx.config, e) ? this.startInnerShowTimer() : l = this.hideInnerScrollbar(), this.canInteractWithScrollbar() && (this.isOnScrollbar(r, a) || this.isOnTrack(r, a)) && e ? (this.isFocus = !0, this.ctx.stageElement.style.cursor = "pointer") : this.isFocus = !1, o === 0 || i == this.clientX && s == this.clientY) return l;
4063
+ let f = 0;
4064
+ if (this.type === "horizontal" ? f = i - this.clientX : f = s - this.clientY, this.isDragging && f !== 0) {
4065
+ let d = 0;
4066
+ this.type === "vertical" ? d = this.dragStart + f / this.thumbTravelDistance * this.distance : d = this.dragStart + f / this.thumbTravelDistance * this.distance, this.scroll = Math.max(0, Math.min(d, this.distance));
4174
4067
  }
4175
4068
  return l;
4176
4069
  }
@@ -4190,7 +4083,7 @@ class Jt {
4190
4083
  return V(this.ctx.config);
4191
4084
  }
4192
4085
  shouldDrawInnerScrollbar() {
4193
- return Pe(this.ctx.config, {
4086
+ return ze(this.ctx.config, {
4194
4087
  innerVisible: this.innerVisible,
4195
4088
  isFocus: this.isFocus,
4196
4089
  isDragging: this.isDragging
@@ -4227,36 +4120,36 @@ class Jt {
4227
4120
  stageHeight: i,
4228
4121
  stageWidth: s,
4229
4122
  config: { SCROLLER_SIZE: o = 0, BORDER: r }
4230
- } = this.ctx, a = B(this.ctx.config), l = de(this.ctx.config), c = s, d = i, f = e.height, u = e.width, x = t.height, g = this.ctx.footer.height, E = d - a - f, m = c - a, w = Math.max(0, x - E + g), y = Math.max(0, u - m), b = Ke(this.ctx.config);
4123
+ } = this.ctx, a = B(this.ctx.config), l = de(this.ctx.config), c = s, f = i, d = e.height, u = e.width, x = t.height, g = this.ctx.footer.height, E = f - a - d, w = c - a, m = Math.max(0, x - E + g), y = Math.max(0, u - w), b = Ke(this.ctx.config);
4231
4124
  if (this.type === "vertical") {
4232
- this.visibleDistance = E, this.distance = w;
4233
- const p = $t(this.ctx.config, y > 0);
4234
- this.thumbTrackDistance = Math.max(0, this.visibleDistance - p), this.trackX = c - l, this.trackY = 0, this.splitPoints = [this.trackX, f, this.trackX + l, f], this.trackWidth = l, this.trackHeight = Math.max(0, d - p), this.barX = this.trackX - 1 + (l - o) / 2, this.barWidth = o, this.barHeight = qt(
4125
+ this.visibleDistance = E, this.distance = m;
4126
+ const p = Gt(this.ctx.config, y > 0);
4127
+ this.thumbTrackDistance = Math.max(0, this.visibleDistance - p), this.trackX = c - l, this.trackY = 0, this.splitPoints = [this.trackX, d, this.trackX + l, d], this.trackWidth = l, this.trackHeight = Math.max(0, f - p), this.barX = this.trackX - 1 + (l - o) / 2, this.barWidth = o, this.barHeight = Zt(
4235
4128
  this.distance,
4236
4129
  this.visibleDistance,
4237
4130
  x + g,
4238
4131
  this.thumbTrackDistance
4239
4132
  ), this.thumbTravelDistance = Math.max(0, this.thumbTrackDistance - this.barHeight - b);
4240
4133
  const C = this.distance ? this.scroll / this.distance : 0;
4241
- this.barY = f + C * this.thumbTravelDistance, this.scroll = Math.max(0, Math.min(this.scroll, this.distance));
4134
+ this.barY = d + C * this.thumbTravelDistance, this.scroll = Math.max(0, Math.min(this.scroll, this.distance));
4242
4135
  } else {
4243
- this.visibleDistance = m, this.distance = y;
4244
- const p = $t(this.ctx.config, w > 0);
4136
+ this.visibleDistance = w, this.distance = y;
4137
+ const p = Gt(this.ctx.config, m > 0);
4245
4138
  this.thumbTrackDistance = Math.max(0, this.visibleDistance - p), this.splitPoints = [
4246
4139
  c - l,
4247
- d - l,
4140
+ f - l,
4248
4141
  c - l,
4249
- d
4142
+ f
4250
4143
  ];
4251
4144
  const C = St(r) ? 0 : 0.5;
4252
- this.trackX = 0, this.trackY = d - l + C, this.trackWidth = Math.max(0, c - p), this.trackHeight = l, this.barWidth = qt(
4145
+ this.trackX = 0, this.trackY = f - l + C, this.trackWidth = Math.max(0, c - p), this.trackHeight = l, this.barWidth = Zt(
4253
4146
  this.distance,
4254
4147
  this.visibleDistance,
4255
4148
  u,
4256
4149
  this.thumbTrackDistance
4257
4150
  ), this.thumbTravelDistance = Math.max(0, this.thumbTrackDistance - this.barWidth - b), this.barY = this.trackY - 1 + (l - o) / 2, this.barHeight = o;
4258
- const v = this.distance ? this.scroll / this.distance : 0;
4259
- this.barX = v * this.thumbTravelDistance, this.scroll = Math.max(0, Math.min(this.scroll, this.distance));
4151
+ const I = this.distance ? this.scroll / this.distance : 0;
4152
+ this.barX = I * this.thumbTravelDistance, this.scroll = Math.max(0, Math.min(this.scroll, this.distance));
4260
4153
  }
4261
4154
  }
4262
4155
  draw() {
@@ -4265,15 +4158,15 @@ class Jt {
4265
4158
  } = this.ctx;
4266
4159
  if (this.updatedSize(), this.isInnerMode() && !this.shouldDrawInnerScrollbar())
4267
4160
  return this.isFocus || this.isDragging;
4268
- const r = Fe(this.ctx.config), a = We(this.ctx.config), l = r && St(s) ? i : "transparent", c = this.hasScrollbar(), d = Ge(s, c);
4269
- return a && d ? (this.ctx.paint.drawRect(this.trackX, this.trackY, this.trackWidth, this.trackHeight, {
4161
+ const r = Fe(this.ctx.config), a = We(this.ctx.config), l = r && St(s) ? i : "transparent", c = this.hasScrollbar(), f = $e(s, c);
4162
+ return a && f ? (this.ctx.paint.drawRect(this.trackX, this.trackY, this.trackWidth, this.trackHeight, {
4270
4163
  fillColor: o
4271
4164
  }), this.drawTrackHeaderBackground(), r && (this.ctx.paint.drawRect(this.trackX, this.trackY, this.trackWidth, this.trackHeight, {
4272
4165
  borderColor: l
4273
4166
  }), this.drawRightBoundaryBorder())) : a && this.drawInactiveTrackBackground(), c && this.ctx.paint.drawRect(this.barX, this.barY, this.barWidth, this.barHeight, {
4274
4167
  fillColor: this.isFocus || this.isDragging ? t : e,
4275
4168
  radius: 4
4276
- }), r && d && this.splitPoints.length > 0 && this.ctx.paint.drawLine(this.splitPoints, {
4169
+ }), r && f && this.splitPoints.length > 0 && this.ctx.paint.drawLine(this.splitPoints, {
4277
4170
  borderColor: l,
4278
4171
  borderWidth: 1
4279
4172
  }), this.isFocus || this.isDragging;
@@ -4303,16 +4196,16 @@ class Jt {
4303
4196
  FOOTER_FIXED: a,
4304
4197
  FOOTER_POSITION: l,
4305
4198
  HEADER_BG_COLOR: c,
4306
- SCROLLER_TRACK_SIZE: d = 0
4199
+ SCROLLER_TRACK_SIZE: f = 0
4307
4200
  }
4308
- } = this.ctx, f = Math.max(0, s - d);
4309
- if (f <= 0 || this.trackWidth <= 0 || (this.ctx.paint.drawRect(this.trackX, 0, this.trackWidth, f, {
4201
+ } = this.ctx, d = Math.max(0, s - f);
4202
+ if (d <= 0 || this.trackWidth <= 0 || (this.ctx.paint.drawRect(this.trackX, 0, this.trackWidth, d, {
4310
4203
  fillColor: o
4311
4204
  }), this.ctx.paint.drawRect(this.trackX, 0, this.trackWidth, e.height, {
4312
4205
  fillColor: c
4313
4206
  }), !t.height))
4314
4207
  return;
4315
- const u = a ? l === "top" ? e.height : f - t.height : t.y - i, x = Math.max(e.height, Math.min(u, f)), g = Math.max(0, Math.min(t.height, f - x));
4208
+ const u = a ? l === "top" ? e.height : d - t.height : t.y - i, x = Math.max(e.height, Math.min(u, d)), g = Math.max(0, Math.min(t.height, d - x));
4316
4209
  g > 0 && this.ctx.paint.drawRect(this.trackX, x, this.trackWidth, g, {
4317
4210
  fillColor: r
4318
4211
  });
@@ -4325,7 +4218,7 @@ class Jt {
4325
4218
  this.type;
4326
4219
  }
4327
4220
  }
4328
- class fi {
4221
+ class hi {
4329
4222
  // 垂直滚动定时器
4330
4223
  constructor(t) {
4331
4224
  n(this, "ctx");
@@ -4427,8 +4320,8 @@ class fi {
4427
4320
  let c = 10 * (s === "left" ? -1 : 1);
4428
4321
  this.timerX && (clearInterval(this.timerX), this.timerX = 0), this.timerX = setInterval(() => {
4429
4322
  c *= 1.5;
4430
- const { scrollX: d } = this.ctx, f = d + c;
4431
- (f < 0 || f > this.ctx.body.width) && (clearInterval(this.timerX), this.timerX = 0), this.ctx.setScrollX(f);
4323
+ const { scrollX: f } = this.ctx, d = f + c;
4324
+ (d < 0 || d > this.ctx.body.width) && (clearInterval(this.timerX), this.timerX = 0), this.ctx.setScrollX(d);
4432
4325
  }, 100);
4433
4326
  }
4434
4327
  if (o && this.adjustPositionY !== o) {
@@ -4436,8 +4329,8 @@ class fi {
4436
4329
  let c = 10 * (o === "top" ? -1 : 1);
4437
4330
  this.timerY && (clearInterval(this.timerY), this.timerY = 0), this.timerY = setInterval(() => {
4438
4331
  c *= 1.5;
4439
- const { scrollY: d } = this.ctx, f = d + c;
4440
- (f < 0 || f > this.ctx.body.height) && (clearInterval(this.timerY), this.timerY = 0), this.ctx.setScrollY(f);
4332
+ const { scrollY: f } = this.ctx, d = f + c;
4333
+ (d < 0 || d > this.ctx.body.height) && (clearInterval(this.timerY), this.timerY = 0), this.ctx.setScrollY(d);
4441
4334
  }, 100);
4442
4335
  }
4443
4336
  }
@@ -4445,7 +4338,7 @@ class fi {
4445
4338
  t && (this.adjustPositionX = "", this.timerX && (clearInterval(this.timerX), this.timerX = 0)), e && (this.adjustPositionY = "", this.timerY && (clearInterval(this.timerY), this.timerY = 0));
4446
4339
  }
4447
4340
  }
4448
- class ui extends fe {
4341
+ class di extends fe {
4449
4342
  constructor(e, i, s, o, r, a, l) {
4450
4343
  super(e, s, o, r, a, "header", l.fixed);
4451
4344
  n(this, "align");
@@ -4534,11 +4427,11 @@ class ui extends fe {
4534
4427
  const { HEADER_CELL_STYLE_METHOD: e, HEADER_BG_COLOR: i, HEADER_TEXT_COLOR: s } = this.ctx.config;
4535
4428
  let o = i, r = s;
4536
4429
  if (typeof e == "function") {
4537
- const c = e, { backgroundColor: d, color: f, font: u } = c({
4430
+ const c = e, { backgroundColor: f, color: d, font: u } = c({
4538
4431
  colIndex: this.colIndex,
4539
4432
  column: this.column
4540
4433
  }) || {};
4541
- d && (o = d), f && (r = f), u && (this.drawTextFont = u);
4434
+ f && (o = f), d && (r = d), u && (this.drawTextFont = u);
4542
4435
  }
4543
4436
  const { colKey: a, type: l } = this.ctx.finderBar;
4544
4437
  l === "header" && a === this.key && (o = this.ctx.config.FINDER_CELL_BG_COLOR), this.drawCellBgColor = o, this.drawTextColor = r;
@@ -4631,10 +4524,10 @@ class ui extends fe {
4631
4524
  const { indeterminate: e, check: i, selectable: s } = this.ctx.database.getCheckedState(), { CHECKBOX_SIZE: o = 0, CELL_PADDING: r } = this.ctx.config;
4632
4525
  let a = this.drawX + (this.width - o) / 2, l = this.drawY + (this.height - o) / 2;
4633
4526
  this.drawTextX = a + o - r / 2, this.drawTextWidth = this.drawX + this.visibleWidth - this.drawTextX, (this.align === "left" || this.align === "right") && (a = this.drawX + r, this.drawTextX = a + o - r / 2, this.drawTextWidth = this.drawX + this.visibleWidth - this.drawTextX), this.verticalAlign === "top" ? l = this.drawY + r / 2 : this.verticalAlign === "bottom" && (l = this.drawY + this.height - o - r / 2), this.column.dragRow && (a += this.ctx.config.DRAG_ROW_ICON_SIZE, this.drawTextX += this.ctx.config.DRAG_ROW_ICON_SIZE, this.drawTextWidth -= this.ctx.config.DRAG_ROW_ICON_SIZE);
4634
- let c = this.ctx.icons.get("checkbox-uncheck"), d = "checkbox-uncheck";
4635
- e ? (c = this.ctx.icons.get("checkbox-indeterminate"), d = "checkbox-indeterminate") : i && s ? (c = this.ctx.icons.get("checkbox-check"), d = "checkbox-check") : i && !s ? (c = this.ctx.icons.get("checkbox-check-disabled"), d = "checkbox-check-disabled") : !i && s ? (c = this.ctx.icons.get("checkbox-uncheck"), d = "checkbox-uncheck") : (c = this.ctx.icons.get("checkbox-disabled"), d = "checkbox-disabled");
4636
- const f = new q(d, a, l, o, o, c);
4637
- f.setVisible(!this.hideHeaderSelection), this.setImage("selection", f);
4527
+ let c = this.ctx.icons.get("checkbox-uncheck"), f = "checkbox-uncheck";
4528
+ e ? (c = this.ctx.icons.get("checkbox-indeterminate"), f = "checkbox-indeterminate") : i && s ? (c = this.ctx.icons.get("checkbox-check"), f = "checkbox-check") : i && !s ? (c = this.ctx.icons.get("checkbox-check-disabled"), f = "checkbox-check-disabled") : !i && s ? (c = this.ctx.icons.get("checkbox-uncheck"), f = "checkbox-uncheck") : (c = this.ctx.icons.get("checkbox-disabled"), f = "checkbox-disabled");
4529
+ const d = new Z(f, a, l, o, o, c);
4530
+ d.setVisible(!this.hideHeaderSelection), this.setImage("selection", d);
4638
4531
  }
4639
4532
  }
4640
4533
  updateSortIcon() {
@@ -4644,8 +4537,8 @@ class ui extends fe {
4644
4537
  let l = this.sortIconName;
4645
4538
  const c = this.ctx.database.getSortState(this.key);
4646
4539
  c.direction === "asc" ? l = this.sortAscIconName : c.direction === "desc" && (l = this.sortDescIconName);
4647
- const d = this.ctx.icons.get(l), f = new q(l, o, r, a, a, d);
4648
- this.setImage("sort", f);
4540
+ const f = this.ctx.icons.get(l), d = new Z(l, o, r, a, a, f);
4541
+ this.setImage("sort", d);
4649
4542
  }
4650
4543
  getText() {
4651
4544
  return this.render && this.renderHeaderType === "default" || ["", null, void 0].includes(this.text) ? "" : `${this.text}`;
@@ -4684,17 +4577,17 @@ class ge {
4684
4577
  if (!s) return;
4685
4578
  const o = this.findNodeWithParent(this.root, e);
4686
4579
  if (!o) return;
4687
- const { parent: r, index: a, node: l } = s, { parent: c, index: d, node: f } = o;
4580
+ const { parent: r, index: a, node: l } = s, { parent: c, index: f, node: d } = o;
4688
4581
  if (this.isDescendant(l, e))
4689
4582
  return;
4690
4583
  const u = r ? r[this.childrenKey] : this.root;
4691
4584
  if (u.splice(a, 1), r && u.length === 0 && delete r[this.childrenKey], i === "inside") {
4692
- Array.isArray(f[this.childrenKey]) || (f[this.childrenKey] = []), f[this.childrenKey].push(l);
4585
+ Array.isArray(d[this.childrenKey]) || (d[this.childrenKey] = []), d[this.childrenKey].push(l);
4693
4586
  return;
4694
4587
  }
4695
4588
  const x = c ? c[this.childrenKey] : this.root;
4696
- let g = d;
4697
- r === c && a < d && g--, i === "after" && g++, x.splice(g, 0, l);
4589
+ let g = f;
4590
+ r === c && a < f && g--, i === "after" && g++, x.splice(g, 0, l);
4698
4591
  }
4699
4592
  findNodeWithParent(t, e, i = null) {
4700
4593
  for (let s = 0; s < t.length; s++) {
@@ -4716,7 +4609,7 @@ class ge {
4716
4609
  return !1;
4717
4610
  }
4718
4611
  }
4719
- class xi {
4612
+ class fi {
4720
4613
  constructor(t) {
4721
4614
  n(this, "ctx");
4722
4615
  // 上下文
@@ -4772,41 +4665,43 @@ class xi {
4772
4665
  config: { HEADER_HEIGHT: e }
4773
4666
  } = this.ctx, i = B(this.ctx.config);
4774
4667
  if (!t) {
4775
- const x = this.ctx.database.getColumns();
4776
- this.columns = x;
4668
+ const d = this.ctx.database.getColumns();
4669
+ this.columns = d;
4777
4670
  }
4778
4671
  this.allCellHeaders = [], this.leafCellHeaders = [], this.fixedLeftCellHeaders = [], this.fixedRightCellHeaders = [], this.centerCellHeaders = [], this.visibleColumns = le(this.columns);
4779
4672
  const s = ht(this.visibleColumns), o = st(this.visibleColumns);
4780
- this.height = e * s, this.visibleHeight = this.height, this.width = o.reduce((x, g) => {
4781
- const E = g.width || 100, { maxWidth: m, minWidth: w } = g;
4782
- return m && E > m ? x + m : w && E < w ? x + w : x + E;
4673
+ this.height = e * s, this.visibleHeight = this.height, this.width = o.reduce((d, u) => {
4674
+ const x = u.width || 100, { maxWidth: g, minWidth: E } = u;
4675
+ return g && x > g ? d + g : E && x < E ? d + E : d + x;
4783
4676
  }, 0), this.columnIndex = 0, this.resizeNum = 0;
4784
4677
  const r = Le(dt(this.visibleColumns, s));
4785
4678
  this.render(r, 0), this.ctx.database.updateColIndexKeyMap(this.leafCellHeaders);
4786
- const a = this.ctx.containerElement.getBoundingClientRect(), { stageWidth: l, stagePhysicalWidth: c } = this.ctx.zoomScale.resolveStageWidth({
4787
- containerPhysicalWidth: a.width,
4788
- contentWidth: this.width,
4789
- scrollerTrackSize: i,
4790
- fillContainer: this.resizeNum > 0
4791
- });
4792
- this.ctx.stageWidth = l, this.ctx.stagePhysicalWidth = c, this.ctx.stageElement.style.width = `${c}px`, this.visibleWidth = this.ctx.stageWidth - i;
4793
- const d = this.visibleWidth - this.width;
4794
- if (this.resizeNum && d > 0) {
4795
- const x = Math.floor(d / this.resizeNum * 100) / 100;
4796
- this.resizeAllColumn(x);
4797
- }
4798
- const f = this.fixedLeftCellHeaders.filter((x) => !x.hasChildren);
4799
- this.ctx.fixedLeftWidth = f.reduce((x, g) => x + g.width, 0);
4800
- const u = this.fixedRightCellHeaders.filter((x) => !x.hasChildren);
4801
- this.ctx.fixedRightWidth = u.reduce((x, g) => x + g.width, i), this.ctx.maxColIndex = this.leafCellHeaders.length - 1, this.ctx.header.x = this.x, this.ctx.header.y = this.y, this.ctx.header.width = this.width, this.ctx.header.height = this.height, this.ctx.header.allCellHeaders = this.allCellHeaders, this.ctx.header.visibleWidth = this.visibleWidth, this.ctx.header.visibleHeight = this.visibleHeight;
4679
+ const a = this.ctx.containerElement.getBoundingClientRect();
4680
+ this.resizeNum > 0 ? this.ctx.stageWidth = Math.floor(a.width) : this.ctx.stageWidth = Math.min(
4681
+ Math.floor(this.width + i),
4682
+ Math.floor(a.width)
4683
+ ), this.ctx.stageElement.style.width = `${this.ctx.stageWidth}px`, this.visibleWidth = this.ctx.stageWidth - i;
4684
+ const l = this.visibleWidth - this.width;
4685
+ if (this.resizeNum && l > 0) {
4686
+ const d = Math.floor(l / this.resizeNum * 100) / 100;
4687
+ this.resizeAllColumn(d);
4688
+ }
4689
+ const c = this.fixedLeftCellHeaders.filter((d) => !d.hasChildren);
4690
+ this.ctx.fixedLeftWidth = c.reduce((d, u) => d + u.width, 0);
4691
+ const f = this.fixedRightCellHeaders.filter((d) => !d.hasChildren);
4692
+ this.ctx.fixedRightWidth = f.reduce((d, u) => d + u.width, i), this.ctx.maxColIndex = this.leafCellHeaders.length - 1, this.ctx.header.x = this.x, this.ctx.header.y = this.y, this.ctx.header.width = this.width, this.ctx.header.height = this.height, this.ctx.header.allCellHeaders = this.allCellHeaders, this.ctx.header.visibleWidth = this.visibleWidth, this.ctx.header.visibleHeight = this.visibleHeight;
4802
4693
  }
4803
4694
  initSort() {
4804
4695
  this.ctx.on("cellHeaderClick", (t, e) => {
4805
4696
  if (!t.isImageInside("sort", e))
4806
4697
  return;
4807
- const i = this.ctx.database.getSortState(t.key);
4808
- let s;
4809
- i.direction === "none" ? s = "asc" : i.direction === "asc" ? s = "desc" : s = "none", this.ctx.database.setSortState(t.key, s);
4698
+ const { sortIconType: i = "up-down" } = t.column, s = t.getImageClickDirection("sort", e);
4699
+ let o = "none";
4700
+ const r = this.ctx.database.getSortState(t.key);
4701
+ function a(l, c) {
4702
+ return l === "none" ? c : l === c ? "none" : c;
4703
+ }
4704
+ i === "loop" ? r.direction === "none" ? o = "asc" : r.direction === "asc" ? o = "desc" : o = "none" : s && i === "up-down" ? s.includes("up") ? o = a(r.direction, "asc") : s.includes("down") && (o = a(r.direction, "desc")) : s && i === "left-right" && (s.includes("left") ? o = a(r.direction, "asc") : s.includes("right") && (o = a(r.direction, "desc"))), this.ctx.database.setSortState(t.key, o);
4810
4705
  });
4811
4706
  }
4812
4707
  initSelection() {
@@ -4844,11 +4739,11 @@ class xi {
4844
4739
  this.ctx.stageElement.style.cursor === "col-resize" && (this.ctx.stageElement.style.cursor = "default");
4845
4740
  const o = [...this.renderFixedCellHeaders, ...this.renderCenterCellHeaders];
4846
4741
  for (const r of o) {
4847
- const { offsetX: a, offsetY: l } = this.ctx.getOffset(t), c = a, d = l, f = r.getDrawX(), u = r.getDrawY();
4848
- if (c > f + r.width - 5 && c < f + r.width + 4 && c < e - 4 && // 视窗中最后一列不允许调整宽
4849
- d > u) {
4742
+ const { offsetX: a, offsetY: l } = this.ctx.getOffset(t), c = a, f = l, d = r.getDrawX(), u = r.getDrawY();
4743
+ if (c > d + r.width - 5 && c < d + r.width + 4 && c < e - 4 && // 视窗中最后一列不允许调整宽
4744
+ f > u) {
4850
4745
  const x = r.colIndex + r.colspan - 1, g = this.leafCellHeaders.find((E) => E.colIndex === x);
4851
- if (!g || !g.fixed && this.ctx.stageWidth - this.ctx.fixedRightWidth < f + r.width)
4746
+ if (!g || !g.fixed && this.ctx.stageWidth - this.ctx.fixedRightWidth < d + r.width)
4852
4747
  return;
4853
4748
  this.ctx.isTarget(t) && l <= this.height && (this.ctx.stageElement.style.cursor = "col-resize", this.resizeTarget = g);
4854
4749
  }
@@ -4864,9 +4759,9 @@ class xi {
4864
4759
  }), this.ctx.on("mouseup", () => {
4865
4760
  if (this.ctx.config.ENABLE_DRAG_COLUMN) {
4866
4761
  if (this.dragingCell && this.dragTarget) {
4867
- const t = (c, d = {}) => (c.forEach((f, u) => {
4868
- f.children && t(f.children, d), d[f.key] = u;
4869
- }), d), e = this.ctx.database.getColumns(), i = dt(e, ht(e)), s = new ge(i, {
4762
+ const t = (c, f = {}) => (c.forEach((d, u) => {
4763
+ d.children && t(d.children, f), f[d.key] = u;
4764
+ }), f), e = this.ctx.database.getColumns(), i = dt(e, ht(e)), s = new ge(i, {
4870
4765
  key: "key",
4871
4766
  // 节点唯一标识字段(对应我们之前的field)
4872
4767
  childrenKey: "children"
@@ -4970,9 +4865,9 @@ class xi {
4970
4865
  const { HEADER_HEIGHT: o = 0 } = this.ctx.config;
4971
4866
  for (let r = 0; r < i; r++) {
4972
4867
  const a = t[r], l = o * (a.rowspan || 0), c = o * (a.level || 0);
4973
- let { minWidth: d, maxWidth: f } = a, u = a.width || 100;
4974
- d && u < d && (u = d), f && u > f && (u = f), a.children && (u = st(a.children).reduce((E, m) => E + ((m == null ? void 0 : m.width) || 100), 0));
4975
- const x = new ui(this.ctx, this.columnIndex, s, c, u, l, a);
4868
+ let { minWidth: f, maxWidth: d } = a, u = a.width || 100;
4869
+ f && u < f && (u = f), d && u > d && (u = d), a.children && (u = st(a.children).reduce((E, w) => E + ((w == null ? void 0 : w.width) || 100), 0));
4870
+ const x = new di(this.ctx, this.columnIndex, s, c, u, l, a);
4976
4871
  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;
4977
4872
  }
4978
4873
  }
@@ -4990,12 +4885,12 @@ class xi {
4990
4885
  if (this.ctx.paint.drawLine(c, {
4991
4886
  borderColor: e
4992
4887
  }), o) {
4993
- const f = `${Math.floor(a + this.resizeDiff)}px`, u = 45, x = 24;
4888
+ const d = `${Math.floor(a + this.resizeDiff)}px`, u = 45, x = 24;
4994
4889
  this.ctx.paint.drawRect(l + u / 2, this.ctx.mouseY - x / 2, u, x, {
4995
4890
  fillColor: s,
4996
4891
  borderWidth: 0,
4997
4892
  borderColor: "transparent"
4998
- }), this.ctx.paint.drawText(f, l + u / 2, this.ctx.mouseY - x / 2, u, x + 2, {
4893
+ }), this.ctx.paint.drawText(d, l + u / 2, this.ctx.mouseY - x / 2, u, x + 2, {
4999
4894
  padding: 0,
5000
4895
  color: i,
5001
4896
  align: "center",
@@ -5021,12 +4916,12 @@ class xi {
5021
4916
  const { drawX: s, drawY: o, visibleWidth: r, colIndex: a } = this.dragingCell;
5022
4917
  let l = s, c = o;
5023
4918
  a > this.dragTarget.colIndex && (l = s + r), a === 0 && (l = l + 1), a === this.ctx.maxColIndex && (l = l - 1);
5024
- const d = [l, c, l, this.ctx.stageHeight], f = [l - 4, c, l + 4, c, l, c + 6, l - 4, c];
5025
- this.ctx.paint.drawLine(f, {
4919
+ const f = [l, c, l, this.ctx.stageHeight], d = [l - 4, c, l + 4, c, l, c + 6, l - 4, c];
4920
+ this.ctx.paint.drawLine(d, {
5026
4921
  borderColor: e,
5027
4922
  borderWidth: 1.2,
5028
4923
  fillColor: e
5029
- }), this.ctx.paint.drawLine(d, {
4924
+ }), this.ctx.paint.drawLine(f, {
5030
4925
  borderColor: e,
5031
4926
  borderWidth: 1.2
5032
4927
  });
@@ -5094,7 +4989,7 @@ class xi {
5094
4989
  }), this.drawBottomLine(), this.drawTipLine(), this.drawDragTip();
5095
4990
  }
5096
4991
  }
5097
- class me {
4992
+ class we {
5098
4993
  constructor(t, e, i = 0, s = 0, o = 0, r = 0, a, l = "body") {
5099
4994
  n(this, "ctx");
5100
4995
  n(this, "x", 0);
@@ -5168,7 +5063,7 @@ class me {
5168
5063
  });
5169
5064
  }
5170
5065
  }
5171
- class gi {
5066
+ class ui {
5172
5067
  constructor(t) {
5173
5068
  n(this, "resizeTarget", null);
5174
5069
  //调整行大小的目标
@@ -5215,49 +5110,42 @@ class gi {
5215
5110
  EMPTY_BODY_HEIGHT: a = 0,
5216
5111
  MAX_HEIGHT: l = 0,
5217
5112
  ENABLE_OFFSET_HEIGHT: c = 0,
5218
- OFFSET_HEIGHT: d = 0,
5219
- FOOTER_POSITION: f
5113
+ OFFSET_HEIGHT: f = 0,
5114
+ FOOTER_POSITION: d
5220
5115
  }
5221
5116
  } = this.ctx, u = B(this.ctx.config);
5222
5117
  if (!e.width)
5223
5118
  return;
5224
- this.x = 0, f === "top" && o ? this.y = e.height + i.height : this.y = e.height;
5119
+ this.x = 0, d === "top" && o ? this.y = e.height + i.height : this.y = e.height;
5225
5120
  const { data: x, sumHeight: g } = s.getData();
5226
5121
  this.height = g, this.data = x, this.width = e.width, this.visibleWidth = this.ctx.stageWidth - u;
5227
5122
  const E = this.ctx.footer.height;
5228
5123
  this.ctx.isEmpty = !this.data.length, !this.data.length && !r ? this.height = a : !this.data.length && r && (this.height = r - e.height - E - u);
5229
- const { zoomScale: m } = this.ctx;
5230
5124
  let w = this.height + e.height + u;
5231
5125
  w += E;
5232
- let y = m.contentToPhysical(w);
5233
- const b = window.innerHeight, { top: p } = this.containerRect || this.ctx.containerElement.getBoundingClientRect();
5234
- if (b > p && c && !r) {
5235
- const M = b - p - d;
5236
- M > m.contentToPhysical(e.height + u) ? y = M : m.contentToPhysical(w) > l && (y = l);
5237
- } else this.data.length && r ? y = r : this.data.length && l && m.contentToPhysical(w) > l && (y = l);
5238
- if (y > 0) {
5239
- const { stageHeight: O, stagePhysicalHeight: M } = m.applyStageHeight(
5240
- this.ctx.stageElement,
5241
- y
5242
- );
5243
- this.ctx.stageHeight = O, this.ctx.stagePhysicalHeight = M;
5244
- }
5245
- let C = this.ctx.stageHeight - e.height - u;
5246
- o ? this.visibleHeight = C - E : this.visibleHeight = C, 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;
5247
- const v = window.devicePixelRatio || 1, I = this.ctx.stagePhysicalWidth * v, T = this.ctx.stagePhysicalHeight * v;
5248
- t.width = Math.round(I), t.height = Math.round(T);
5249
- const _ = this.data.length ? "not-empty" : "empty";
5126
+ let m = w;
5127
+ const y = window.innerHeight, { top: b } = this.containerRect || this.ctx.containerElement.getBoundingClientRect();
5128
+ if (y > b && c && !r) {
5129
+ const O = y - b - f;
5130
+ O > e.height + u ? m = O : w > l && (m = l);
5131
+ } else this.data.length && r ? m = r : this.data.length && l && w > l && (m = l);
5132
+ m > 0 && (this.ctx.stageHeight = Math.floor(m), this.ctx.stageElement.style.height = `${this.ctx.stageHeight}px`);
5133
+ let p = this.ctx.stageHeight - e.height - u;
5134
+ o ? this.visibleHeight = p - E : this.visibleHeight = p, 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;
5135
+ const C = window.devicePixelRatio || 1, I = this.ctx.stageWidth * C, v = this.ctx.stageHeight * C;
5136
+ t.width = Math.round(I), t.height = Math.round(v);
5137
+ const T = this.data.length ? "not-empty" : "empty";
5250
5138
  this.ctx.emit("emptyChange", {
5251
- isEmpty: _,
5252
- type: _,
5139
+ isEmpty: T,
5140
+ type: T,
5253
5141
  headerHeight: e.height,
5254
5142
  bodyHeight: this.height,
5255
5143
  footerHeight: E,
5256
5144
  width: this.width,
5257
5145
  height: this.data.length ? 0 : a + E
5258
5146
  });
5259
- const R = Math.round(t.width / v * 1e4) / 1e4, S = Math.round(t.height / v * 1e4) / 1e4;
5260
- this.ctx.canvasElement.setAttribute("style", `height:${S}px;width:${R}px;`), this.ctx.paint.scale(v, this.ctx.zoomScale.value);
5147
+ const _ = Math.round(t.width / C * 1e4) / 1e4, R = Math.round(t.height / C * 1e4) / 1e4;
5148
+ this.ctx.canvasElement.setAttribute("style", `height:${R}px;width:${_}px;`), this.ctx.paint.scale(C);
5261
5149
  }
5262
5150
  initTree() {
5263
5151
  this.ctx.on("cellClick", (t, e) => {
@@ -5307,10 +5195,10 @@ class gi {
5307
5195
  config: { RESIZE_ROW_MIN_HEIGHT: c = 0 }
5308
5196
  } = this.ctx;
5309
5197
  if (this.isResizing && this.resizeTarget) {
5310
- const d = this.resizeTarget.height;
5311
- let f = r - this.clientY;
5198
+ const f = this.resizeTarget.height;
5199
+ let d = r - this.clientY;
5312
5200
  const { calculatedHeight: u } = this.resizeTarget, x = u === -1 ? c : u;
5313
- f + d < x && (f = -(d - x)), this.resizeDiff = f, this.ctx.emit("draw");
5201
+ d + f < x && (d = -(f - x)), this.resizeDiff = d, this.ctx.emit("draw");
5314
5202
  } else {
5315
5203
  if (this.resizeTarget = null, this.isMouseDown)
5316
5204
  return;
@@ -5321,12 +5209,12 @@ class gi {
5321
5209
  if (this.ctx.stageElement.style.cursor === "crosshair")
5322
5210
  return;
5323
5211
  this.ctx.stageElement.style.cursor === "row-resize" && (this.ctx.stageElement.style.cursor = "default");
5324
- for (let d = 0; d < this.renderRows.length; d++) {
5325
- const f = this.renderRows[d];
5326
- if (s > f.y - l + f.height - 1.5 && s < f.y - l + f.height + 1.5 && s < a - 4)
5327
- for (let x = 0; x < f.cells.length; x++) {
5328
- const g = f.cells[x];
5329
- o > g.drawX + 10 && o < g.drawX + g.width - 10 && g.rowspan === 1 && (this.ctx.stageElement.style.cursor = "row-resize", this.resizeTarget = f);
5212
+ for (let f = 0; f < this.renderRows.length; f++) {
5213
+ const d = this.renderRows[f];
5214
+ if (s > d.y - l + d.height - 1.5 && s < d.y - l + d.height + 1.5 && s < a - 4)
5215
+ for (let x = 0; x < d.cells.length; x++) {
5216
+ const g = d.cells[x];
5217
+ o > g.drawX + 10 && o < g.drawX + g.width - 10 && g.rowspan === 1 && (this.ctx.stageElement.style.cursor = "row-resize", this.resizeTarget = d);
5330
5218
  }
5331
5219
  }
5332
5220
  }
@@ -5483,16 +5371,16 @@ class gi {
5483
5371
  this.ctx.maxRowIndex = r.length - 1;
5484
5372
  let l = this.binarySearch(a, o), c = this.binarySearch(a, o + this.visibleHeight);
5485
5373
  if (c === -1 && (c = this.ctx.maxRowIndex), l === -1 && c === this.ctx.maxRowIndex) {
5486
- const f = Math.floor(this.visibleHeight / s);
5487
- l = this.ctx.maxRowIndex - f;
5374
+ const d = Math.floor(this.visibleHeight / s);
5375
+ l = this.ctx.maxRowIndex - d;
5488
5376
  }
5489
5377
  this.headIndex = Math.max(0, l), this.tailIndex = Math.min(this.ctx.maxRowIndex, c + 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;
5490
- const d = [];
5491
- for (let f = 0; f < this.visibleRows.length; f++) {
5492
- const u = this.headIndex + f, x = this.visibleRows[f], { height: g, top: E } = this.ctx.database.getPositionForRowIndex(u), m = new me(this.ctx, u, 0, E + this.y, t.width, g, x);
5493
- d.push(m);
5378
+ const f = [];
5379
+ for (let d = 0; d < this.visibleRows.length; d++) {
5380
+ const u = this.headIndex + d, x = this.visibleRows[d], { height: g, top: E } = this.ctx.database.getPositionForRowIndex(u), w = new we(this.ctx, u, 0, E + this.y, t.width, g, x);
5381
+ f.push(w);
5494
5382
  }
5495
- this.renderRows = d, this.ctx.body.renderRows = d;
5383
+ this.renderRows = f, this.ctx.body.renderRows = f;
5496
5384
  }
5497
5385
  updateAutoHeight() {
5498
5386
  const t = this.ctx.body.renderRows;
@@ -5523,7 +5411,7 @@ class gi {
5523
5411
  }), this.drawTipLine();
5524
5412
  }
5525
5413
  }
5526
- class mi {
5414
+ class xi {
5527
5415
  constructor(t) {
5528
5416
  n(this, "ctx");
5529
5417
  n(this, "renderRows", []);
@@ -5578,7 +5466,7 @@ class mi {
5578
5466
  let e = this.y;
5579
5467
  const i = [];
5580
5468
  this.data.forEach((s, o) => {
5581
- const r = new me(this.ctx, o, 0, e, this.width, t, s, "footer");
5469
+ const r = new we(this.ctx, o, 0, e, this.width, t, s, "footer");
5582
5470
  e += t, i.push(r);
5583
5471
  }), this.renderRows = i, this.ctx.footer.renderRows = this.renderRows;
5584
5472
  }
@@ -5611,7 +5499,7 @@ class mi {
5611
5499
  }), this.drawTopLine();
5612
5500
  }
5613
5501
  }
5614
- class wi {
5502
+ class gi {
5615
5503
  constructor(t) {
5616
5504
  n(this, "isCut", !1);
5617
5505
  n(this, "isMultipleRow", !1);
@@ -5728,30 +5616,30 @@ class wi {
5728
5616
  SELECTOR_AREA_MIN_X: a,
5729
5617
  SELECTOR_AREA_MAX_X: l,
5730
5618
  SELECTOR_AREA_MIN_Y: c,
5731
- SELECTOR_AREA_MAX_Y: d,
5732
- SELECTOR_AREA_MAX_X_OFFSET: f,
5619
+ SELECTOR_AREA_MAX_Y: f,
5620
+ SELECTOR_AREA_MAX_X_OFFSET: d,
5733
5621
  SELECTOR_AREA_MAX_Y_OFFSET: u
5734
- } = this.ctx.config, x = a, g = l || this.ctx.maxColIndex - f, E = c, m = d || this.ctx.maxRowIndex - u;
5735
- let [w, y] = o, [b, p] = r;
5736
- if (w < x || y > g || b < E || p > m)
5622
+ } = this.ctx.config, x = a, g = l || this.ctx.maxColIndex - d, E = c, w = f || this.ctx.maxRowIndex - u;
5623
+ let [m, y] = o, [b, p] = r;
5624
+ if (m < x || y > g || b < E || p > w)
5737
5625
  return;
5738
5626
  if (this.ctx.config.ENABLE_MERGE_CELL_LINK) {
5739
- const v = this.adjustMergeCells(o, r);
5740
- b = v.yArr[0], p = v.yArr[1], w = v.xArr[0], y = v.xArr[1], this.ctx.onlyMergeCell = v.onlyMergeCell;
5627
+ const I = this.adjustMergeCells(o, r);
5628
+ b = I.yArr[0], p = I.yArr[1], m = I.xArr[0], y = I.xArr[1], this.ctx.onlyMergeCell = I.onlyMergeCell;
5741
5629
  }
5742
- w === y && b === p ? this.ctx.selectOnlyOne = !0 : this.ctx.selectOnlyOne = !1, o = [Math.max(x, w), Math.min(g, y)], r = [Math.max(E, b), Math.min(m, p)];
5630
+ m === y && b === p ? this.ctx.selectOnlyOne = !0 : this.ctx.selectOnlyOne = !1, o = [Math.max(x, m), Math.min(g, y)], r = [Math.max(E, b), Math.min(w, p)];
5743
5631
  const { BEFORE_SET_SELECTOR_METHOD: C } = this.ctx.config;
5744
5632
  if (typeof C == "function") {
5745
- const I = C({
5633
+ const v = C({
5746
5634
  focusCell: this.ctx.focusCell,
5747
5635
  xArr: o,
5748
5636
  yArr: r
5749
5637
  });
5750
- if (!I)
5638
+ if (!v)
5751
5639
  return;
5752
- o = I.xArr, r = I.yArr;
5640
+ o = v.xArr, r = v.yArr;
5753
5641
  }
5754
- this.ctx.selector.xArr = o, this.ctx.selector.yArr = r, p === this.ctx.maxRowIndex && b === 0 ? this.ctx.selectColsIng = !0 : this.ctx.selectColsIng = !1, y === this.ctx.maxColIndex && w === 0 ? this.ctx.selectRowsIng = !0 : this.ctx.selectRowsIng = !1, this.ctx.emit("setSelector", this.ctx.selector), this.ctx.emit("drawView");
5642
+ this.ctx.selector.xArr = o, this.ctx.selector.yArr = r, p === this.ctx.maxRowIndex && b === 0 ? this.ctx.selectColsIng = !0 : this.ctx.selectColsIng = !1, y === this.ctx.maxColIndex && m === 0 ? this.ctx.selectRowsIng = !0 : this.ctx.selectRowsIng = !1, this.ctx.emit("setSelector", this.ctx.selector), this.ctx.emit("drawView");
5755
5643
  }
5756
5644
  }
5757
5645
  adjustMergeCells(t, e) {
@@ -5765,36 +5653,36 @@ class wi {
5765
5653
  };
5766
5654
  let a = [], l = [];
5767
5655
  for (let E = 0; E <= e[1] - e[0]; E++)
5768
- for (let m = 0; m <= t[1] - t[0]; m++) {
5769
- const w = E + e[0], y = m + t[0], b = this.ctx.database.getVirtualBodyCell(w, y);
5770
- b && ((w === i || w === s) && a.push(b), (y === o || y === r) && l.push(b));
5656
+ for (let w = 0; w <= t[1] - t[0]; w++) {
5657
+ const m = E + e[0], y = w + t[0], b = this.ctx.database.getVirtualBodyCell(m, y);
5658
+ b && ((m === i || m === s) && a.push(b), (y === o || y === r) && l.push(b));
5771
5659
  }
5772
5660
  const c = a.reduce(
5773
- (E, m) => {
5774
- const { yArr: w } = m.getSpanInfo(), [y, b] = w;
5661
+ (E, w) => {
5662
+ const { yArr: m } = w.getSpanInfo(), [y, b] = m;
5775
5663
  return E.minY = Math.min(E.minY, y), E.maxY = Math.max(E.maxY, b), E;
5776
5664
  },
5777
5665
  {
5778
5666
  minY: i,
5779
5667
  maxY: s
5780
5668
  }
5781
- ), d = l.reduce(
5782
- (E, m) => {
5783
- const { xArr: w } = m.getSpanInfo(), [y, b] = w;
5669
+ ), f = l.reduce(
5670
+ (E, w) => {
5671
+ const { xArr: m } = w.getSpanInfo(), [y, b] = m;
5784
5672
  return E.minX = Math.min(E.minX, y), E.maxX = Math.max(E.maxX, b), E;
5785
5673
  },
5786
5674
  {
5787
5675
  minX: o,
5788
5676
  maxX: r
5789
5677
  }
5790
- ), f = [d.minX, d.maxX], u = [c.minY, c.maxY];
5678
+ ), d = [f.minX, f.maxX], u = [c.minY, c.maxY];
5791
5679
  let x = !1;
5792
- if (d.minX !== d.maxX || c.minY !== c.maxY) {
5793
- const E = JSON.stringify(f) + JSON.stringify(u), m = (g = this.ctx.focusCell) == null ? void 0 : g.getSpanInfo();
5794
- x = (m && JSON.stringify(m.xArr) + JSON.stringify(m.yArr)) === E;
5680
+ if (f.minX !== f.maxX || c.minY !== c.maxY) {
5681
+ const E = JSON.stringify(d) + JSON.stringify(u), w = (g = this.ctx.focusCell) == null ? void 0 : g.getSpanInfo();
5682
+ x = (w && JSON.stringify(w.xArr) + JSON.stringify(w.yArr)) === E;
5795
5683
  }
5796
5684
  return {
5797
- xArr: f,
5685
+ xArr: d,
5798
5686
  yArr: u,
5799
5687
  onlyMergeCell: x
5800
5688
  };
@@ -5826,7 +5714,7 @@ class wi {
5826
5714
  SELECTOR_AREA_MAX_Y: r,
5827
5715
  SELECTOR_AREA_MAX_X_OFFSET: a,
5828
5716
  SELECTOR_AREA_MAX_Y_OFFSET: l
5829
- } = this.ctx.config, c = i, d = s || this.ctx.maxColIndex - a, f = o, u = r || this.ctx.maxRowIndex - l, x = [c, d], g = [f, u];
5717
+ } = this.ctx.config, c = i, f = s || this.ctx.maxColIndex - a, d = o, u = r || this.ctx.maxRowIndex - l, x = [c, f], g = [d, u];
5830
5718
  this.setSelector(x, g);
5831
5719
  }
5832
5720
  }
@@ -5842,11 +5730,11 @@ class wi {
5842
5730
  if (this.ctx.focusCell && this.ctx.mousedown) {
5843
5731
  const { rowIndex: l } = this.ctx.focusCell;
5844
5732
  if (t.rowIndex >= l) {
5845
- const c = [a, r], d = [l, t.rowIndex];
5846
- this.setSelector(c, d);
5733
+ const c = [a, r], f = [l, t.rowIndex];
5734
+ this.setSelector(c, f);
5847
5735
  } else {
5848
- const c = [a, r], d = [t.rowIndex, l];
5849
- this.setSelector(c, d);
5736
+ const c = [a, r], f = [t.rowIndex, l];
5737
+ this.setSelector(c, f);
5850
5738
  }
5851
5739
  }
5852
5740
  }
@@ -5855,8 +5743,8 @@ class wi {
5855
5743
  return;
5856
5744
  const { mousedown: t, focusCell: e, hoverCell: i } = this.ctx;
5857
5745
  if (t && e && i) {
5858
- const { rowIndex: s, colIndex: o } = e, r = Math.min(i.colIndex, o), a = Math.max(i.colIndex, o), l = Math.min(i.rowIndex, s), c = Math.max(i.rowIndex, s), d = [r, a], f = [l, c];
5859
- this.setSelector(d, f);
5746
+ const { rowIndex: s, colIndex: o } = e, r = Math.min(i.colIndex, o), a = Math.max(i.colIndex, o), l = Math.min(i.rowIndex, s), c = Math.max(i.rowIndex, s), f = [r, a], d = [l, c];
5747
+ this.setSelector(f, d);
5860
5748
  }
5861
5749
  }
5862
5750
  click(t = !1) {
@@ -5865,7 +5753,7 @@ class wi {
5865
5753
  if (this.ctx.selector.enable = !0, i && t) {
5866
5754
  if (this.ctx.config.ENABLE_SELECTOR_SINGLE)
5867
5755
  return;
5868
- const { colIndex: s, rowIndex: o } = i, { colIndex: r, rowIndex: a } = e, l = Math.min(r, s), c = Math.max(r, s), d = Math.min(a, o), f = Math.max(a, o), u = [l, c], x = [d, f];
5756
+ const { colIndex: s, rowIndex: o } = i, { colIndex: r, rowIndex: a } = e, l = Math.min(r, s), c = Math.max(r, s), f = Math.min(a, o), d = Math.max(a, o), u = [l, c], x = [f, d];
5869
5757
  this.setSelector(u, x);
5870
5758
  } else {
5871
5759
  this.ctx.emit("cellSelectedClick", e);
@@ -5932,7 +5820,7 @@ class wi {
5932
5820
  const r = /* @__PURE__ */ new Set();
5933
5821
  for (let l = 0; l <= e[1] - e[0]; l++)
5934
5822
  for (let c = 0; c <= t[1] - t[0]; c++) {
5935
- const d = l + e[0], f = c + t[0], u = this.ctx.database.getItemValueForRowIndexAndColIndex(d, f);
5823
+ const f = l + e[0], d = c + t[0], u = this.ctx.database.getItemValueForRowIndexAndColIndex(f, d);
5936
5824
  if (u) {
5937
5825
  const { rowKey: x, key: g } = u;
5938
5826
  this.ctx.database.getReadonly(x, g) || (r.add(x), o.push({
@@ -5964,12 +5852,12 @@ class wi {
5964
5852
  const e = this.ctx.selector.yArr[0], i = this.ctx.selector.xArr[0], s = /* @__PURE__ */ new Set();
5965
5853
  navigator.clipboard.readText().then(async (o) => {
5966
5854
  let r = Ae(o);
5967
- const a = [i, i + r[0].length - 1], l = [e, e + r.length - 1], [c, d] = l, [f, u] = a, x = d - this.ctx.maxRowIndex, g = u - this.ctx.maxColIndex;
5855
+ const a = [i, i + r[0].length - 1], l = [e, e + r.length - 1], [c, f] = l, [d, u] = a, x = f - this.ctx.maxRowIndex, g = u - this.ctx.maxColIndex;
5968
5856
  (x > 0 || g > 0) && this.ctx.emit("onPastedDataOverflow", {
5969
- maxY: d,
5857
+ maxY: f,
5970
5858
  maxX: u,
5971
5859
  minY: c,
5972
- minX: f,
5860
+ minX: d,
5973
5861
  overflowRowCount: x,
5974
5862
  overflowColCount: g,
5975
5863
  textArr: r
@@ -5984,17 +5872,17 @@ class wi {
5984
5872
  this.ctx.hasEvent("error") ? this.ctx.emit("error", b) : console.error(b.message);
5985
5873
  return;
5986
5874
  }
5987
- let m = [];
5875
+ let w = [];
5988
5876
  for (let b = 0; b <= r.length - 1; b++) {
5989
5877
  const p = r[b].length;
5990
5878
  for (let C = 0; C <= p - 1; C++) {
5991
- const v = b + e, I = C + i, T = r[b][C], _ = this.ctx.database.getItemValueForRowIndexAndColIndex(
5992
- v,
5993
- I
5879
+ const I = b + e, v = C + i, T = r[b][C], _ = this.ctx.database.getItemValueForRowIndexAndColIndex(
5880
+ I,
5881
+ v
5994
5882
  );
5995
5883
  if (_) {
5996
5884
  const { rowKey: R, key: S } = _;
5997
- this.ctx.database.getReadonly(R, S) || (s.add(R), m.push({
5885
+ this.ctx.database.getReadonly(R, S) || (s.add(R), w.push({
5998
5886
  rowKey: R,
5999
5887
  key: S,
6000
5888
  value: T,
@@ -6010,30 +5898,30 @@ class wi {
6010
5898
  this.ctx.selector.yArrCopy,
6011
5899
  !0
6012
5900
  // 忽略设置,只返回数据,用于cut,实现历史回退需要返回两次问题
6013
- ), p = m.map((C) => `${C.rowKey}-${C.key}`);
5901
+ ), p = w.map((C) => `${C.rowKey}-${C.key}`);
6014
5902
  b.forEach((C) => {
6015
- p.includes(`${C.rowKey}-${C.key}`) || m.unshift(C);
5903
+ p.includes(`${C.rowKey}-${C.key}`) || w.unshift(C);
6016
5904
  }), this.isCut = !1;
6017
5905
  }
6018
- if (!m.length)
5906
+ if (!w.length)
6019
5907
  return;
6020
- const { BEFORE_PASTE_DATA_METHOD: w } = this.ctx.config;
6021
- if (typeof w == "function") {
6022
- const b = w, p = m.map((C) => ({
5908
+ const { BEFORE_PASTE_DATA_METHOD: m } = this.ctx.config;
5909
+ if (typeof m == "function") {
5910
+ const b = m, p = w.map((C) => ({
6023
5911
  rowKey: C.rowKey,
6024
5912
  key: C.key,
6025
5913
  value: C.value,
6026
5914
  oldValue: this.ctx.database.getItemValue(C.rowKey, C.key),
6027
5915
  row: this.ctx.database.getRowDataItemForRowKey(C.rowKey)
6028
5916
  }));
6029
- if (m = await b(p, a, l, r), m && !m.length)
5917
+ if (w = await b(p, a, l, r), w && !w.length)
6030
5918
  return;
6031
5919
  }
6032
- this.clearCopyLine(), this.ctx.batchSetItemValueByEditor(m, !0);
5920
+ this.clearCopyLine(), this.ctx.batchSetItemValueByEditor(w, !0);
6033
5921
  let y = [];
6034
5922
  s.forEach((b) => {
6035
5923
  y.push(this.ctx.database.getRowDataItemForRowKey(b));
6036
- }), this.ctx.emit("pasteChange", m, y), this.ctx.emit("draw");
5924
+ }), this.ctx.emit("pasteChange", w, y), this.ctx.emit("draw");
6037
5925
  }).catch((o) => {
6038
5926
  console.error("Failed to get the clipboard content:", o);
6039
5927
  });
@@ -6064,8 +5952,8 @@ class wi {
6064
5952
  s < l && s++;
6065
5953
  break;
6066
5954
  }
6067
- const c = [i, i], d = [s, s], f = this.getCell(s, i);
6068
- f && (f.operation || this.isInSettingRange(f.rowIndex, f.colIndex) && (this.ctx.setFocusCell(f), this.setSelector(c, d), this.adjustBoundaryPosition(), this.ctx.emit("moveFocus", f), this.ctx.emit("draw")));
5955
+ const c = [i, i], f = [s, s], d = this.getCell(s, i);
5956
+ d && (d.operation || this.isInSettingRange(d.rowIndex, d.colIndex) && (this.ctx.setFocusCell(d), this.setSelector(c, f), this.adjustBoundaryPosition(), this.ctx.emit("moveFocus", d), this.ctx.emit("draw")));
6069
5957
  }
6070
5958
  // 判断是否在设置范围内
6071
5959
  isInSettingRange(t, e) {
@@ -6076,8 +5964,8 @@ class wi {
6076
5964
  SELECTOR_AREA_MAX_Y: r,
6077
5965
  SELECTOR_AREA_MAX_X_OFFSET: a,
6078
5966
  SELECTOR_AREA_MAX_Y_OFFSET: l
6079
- } = this.ctx.config, c = i, d = s || this.ctx.maxColIndex - a, f = o, u = r || this.ctx.maxRowIndex - l;
6080
- return !(e < c || e > d || t < f || t > u);
5967
+ } = this.ctx.config, c = i, f = s || this.ctx.maxColIndex - a, d = o, u = r || this.ctx.maxRowIndex - l;
5968
+ return !(e < c || e > f || t < d || t > u);
6081
5969
  }
6082
5970
  /**
6083
5971
  * 调整滚动条位置,让焦点单元格始终出现在可视区域内
@@ -6093,25 +5981,25 @@ class wi {
6093
5981
  footer: a,
6094
5982
  body: l,
6095
5983
  scrollX: c,
6096
- scrollY: d,
6097
- config: { FOOTER_FIXED: f, FOOTER_POSITION: u, ENABLE_MERGE_CELL_LINK: x }
5984
+ scrollY: f,
5985
+ config: { FOOTER_FIXED: d, FOOTER_POSITION: u, ENABLE_MERGE_CELL_LINK: x }
6098
5986
  } = this.ctx, g = B(this.ctx.config);
6099
5987
  if (!i)
6100
5988
  return;
6101
5989
  x && this.ctx.onlyMergeCell && i.updateSpanInfo();
6102
- const { drawX: E, drawY: m, width: w, height: y, fixed: b } = i, p = o - E + 1, C = i.drawX + w - (e - s) + 1;
6103
- let v = r.height - m, I = y;
6104
- I > l.visibleHeight && (I = l.visibleHeight);
5990
+ const { drawX: E, drawY: w, width: m, height: y, fixed: b } = i, p = o - E + 1, C = i.drawX + m - (e - s) + 1;
5991
+ let I = r.height - w, v = y;
5992
+ v > l.visibleHeight && (v = l.visibleHeight);
6105
5993
  let T = 0;
6106
- f && (u === "top" ? v = r.height + a.height - m : T = a.visibleHeight);
6107
- const _ = m + I - (t - T - g);
6108
- let R = c, S = d;
6109
- C > 0 && !b ? R = Math.floor(c + C) : p > 0 && !b && (R = Math.floor(c - p)), v > 0 ? S = Math.floor(d - v) : _ > 0 && (S = Math.floor(d + _)), (Math.abs(c - R) > 2.5 || Math.abs(d - S) > 2.5) && this.ctx.setScroll(R, S);
5994
+ d && (u === "top" ? I = r.height + a.height - w : T = a.visibleHeight);
5995
+ const _ = w + v - (t - T - g);
5996
+ let R = c, S = f;
5997
+ C > 0 && !b ? R = Math.floor(c + C) : p > 0 && !b && (R = Math.floor(c - p)), I > 0 ? S = Math.floor(f - I) : _ > 0 && (S = Math.floor(f + _)), (Math.abs(c - R) > 2.5 || Math.abs(f - S) > 2.5) && this.ctx.setScroll(R, S);
6110
5998
  }
6111
5999
  destroy() {
6112
6000
  }
6113
6001
  }
6114
- class Ei {
6002
+ class wi {
6115
6003
  constructor(t) {
6116
6004
  n(this, "ctx");
6117
6005
  n(this, "maxColRowCell");
@@ -6121,8 +6009,8 @@ class Ei {
6121
6009
  this.ctx.on("mousemove", (t) => {
6122
6010
  if (this.ctx.stageElement.style.cursor === "crosshair" && (this.ctx.stageElement.style.cursor = "default"), this.ctx.editing || !this.ctx.focusCell || !this.maxColRowCell)
6123
6011
  return;
6124
- const { offsetX: e, offsetY: i } = this.ctx.getOffset(t), { colIndex: s, rowIndex: o, drawX: r, drawY: a, width: l, height: c } = this.maxColRowCell, d = 6, f = s === this.ctx.maxColIndex || o === this.ctx.maxRowIndex ? 0 : 2, u = r + l - d + f, x = a + c - d + f;
6125
- e > u && i > x && e < u + d && i < x + d && (this.ctx.stageElement.style.cursor = "crosshair"), this.ctx.autofillMove && this.ctx.startAdjustPosition(t);
6012
+ const { offsetX: e, offsetY: i } = this.ctx.getOffset(t), { colIndex: s, rowIndex: o, drawX: r, drawY: a, width: l, height: c } = this.maxColRowCell, f = 6, d = s === this.ctx.maxColIndex || o === this.ctx.maxRowIndex ? 0 : 2, u = r + l - f + d, x = a + c - f + d;
6013
+ e > u && i > x && e < u + f && i < x + f && (this.ctx.stageElement.style.cursor = "crosshair"), this.ctx.autofillMove && this.ctx.startAdjustPosition(t);
6126
6014
  }), this.ctx.on("cellMouseenter", (t) => {
6127
6015
  const { xArr: e, yArr: i } = this.ctx.selector, s = e[1], o = i[1], { colIndex: r, rowIndex: a } = t;
6128
6016
  this.ctx.config.ENABLE_AUTOFILL && r === s && a === o && (this.maxColRowCell = t), this.mouseenter(t);
@@ -6158,17 +6046,17 @@ class Ei {
6158
6046
  const l = this.ctx.selector.xArr, c = this.ctx.selector.yArr;
6159
6047
  if (!(!o && JSON.stringify(c) !== JSON.stringify(a)) && !(!s && JSON.stringify(l) !== JSON.stringify(r)) && (JSON.stringify(this.ctx.autofill.xArr) !== JSON.stringify(r) || JSON.stringify(this.ctx.autofill.yArr) !== JSON.stringify(a))) {
6160
6048
  const {
6161
- SELECTOR_AREA_MIN_X: d,
6162
- SELECTOR_AREA_MAX_X: f,
6049
+ SELECTOR_AREA_MIN_X: f,
6050
+ SELECTOR_AREA_MAX_X: d,
6163
6051
  SELECTOR_AREA_MIN_Y: u,
6164
6052
  SELECTOR_AREA_MAX_Y: x,
6165
6053
  SELECTOR_AREA_MAX_X_OFFSET: g,
6166
6054
  SELECTOR_AREA_MAX_Y_OFFSET: E
6167
- } = this.ctx.config, m = d, w = f || this.ctx.maxColIndex - g, y = u, b = x || this.ctx.maxRowIndex - E;
6168
- let [p, C] = r, [v, I] = a;
6169
- if (p < m || v < y)
6055
+ } = this.ctx.config, w = f, m = d || this.ctx.maxColIndex - g, y = u, b = x || this.ctx.maxRowIndex - E;
6056
+ let [p, C] = r, [I, v] = a;
6057
+ if (p < w || I < y)
6170
6058
  return;
6171
- r = [Math.max(m, p), Math.min(w, C)], a = [Math.max(y, v), Math.min(b, I)];
6059
+ r = [Math.max(w, p), Math.min(m, C)], a = [Math.max(y, I), Math.min(b, v)];
6172
6060
  const { BEFORE_SET_AUTOFILL_METHOD: T } = this.ctx.config;
6173
6061
  if (typeof T == "function") {
6174
6062
  const R = T({
@@ -6190,8 +6078,8 @@ class Ei {
6190
6078
  const t = /* @__PURE__ */ new Set(), e = this.ctx.getSelectedData(), i = /* @__PURE__ */ new Map();
6191
6079
  for (let x = 0; x <= e.yArr[1] - e.yArr[0]; x++)
6192
6080
  for (let g = 0; g <= e.xArr[1] - e.xArr[0]; g++) {
6193
- const E = x + e.yArr[0], m = g + e.xArr[0];
6194
- i.set(`${E}-${m}`, !0);
6081
+ const E = x + e.yArr[0], w = g + e.xArr[0];
6082
+ i.set(`${E}-${w}`, !0);
6195
6083
  }
6196
6084
  const { value: s } = e, o = s[0].length, r = s.length, a = this.ctx.autofill.xArr, l = this.ctx.autofill.yArr, c = o === 1 && r === 1;
6197
6085
  if (this.ctx.config.ENABLE_MERGE_CELL_LINK && this.ctx.database.hasMergeCell(a, l) && !c) {
@@ -6203,40 +6091,40 @@ class Ei {
6203
6091
  this.ctx.hasEvent("error") ? this.ctx.emit("error", x) : console.error(x.message);
6204
6092
  return;
6205
6093
  }
6206
- let d = [];
6094
+ let f = [];
6207
6095
  for (let x = 0; x <= l[1] - l[0]; x++)
6208
6096
  for (let g = 0; g <= a[1] - a[0]; g++) {
6209
- const E = g + a[0], m = x + l[0], w = s[x % r][g % o], y = this.ctx.database.getItemValueForRowIndexAndColIndex(m, E), b = `${m}-${E}`;
6097
+ const E = g + a[0], w = x + l[0], m = s[x % r][g % o], y = this.ctx.database.getItemValueForRowIndexAndColIndex(w, E), b = `${w}-${E}`;
6210
6098
  if (y && !i.has(b)) {
6211
6099
  const { rowKey: p, key: C } = y;
6212
- this.ctx.database.getReadonly(p, C) || (t.add(p), d.push({
6100
+ this.ctx.database.getReadonly(p, C) || (t.add(p), f.push({
6213
6101
  rowKey: p,
6214
6102
  key: C,
6215
- value: w,
6103
+ value: m,
6216
6104
  row: {}
6217
6105
  }));
6218
6106
  }
6219
6107
  }
6220
- if (!d.length)
6108
+ if (!f.length)
6221
6109
  return;
6222
6110
  this.ctx.selector.xArr = this.ctx.autofill.xArr, this.ctx.selector.yArr = this.ctx.autofill.yArr;
6223
- const { BEFORE_AUTOFILL_DATA_METHOD: f } = this.ctx.config;
6224
- if (typeof f == "function") {
6225
- const x = f, g = d.map((E) => ({
6111
+ const { BEFORE_AUTOFILL_DATA_METHOD: d } = this.ctx.config;
6112
+ if (typeof d == "function") {
6113
+ const x = d, g = f.map((E) => ({
6226
6114
  rowKey: E.rowKey,
6227
6115
  key: E.key,
6228
6116
  value: E.value,
6229
6117
  oldValue: this.ctx.database.getItemValue(E.rowKey, E.key),
6230
6118
  row: this.ctx.database.getRowDataItemForRowKey(E.rowKey)
6231
6119
  }));
6232
- if (d = await x(g, a, l), d && !d.length)
6120
+ if (f = await x(g, a, l), f && !f.length)
6233
6121
  return;
6234
6122
  }
6235
- this.ctx.batchSetItemValueByEditor(d, !0);
6123
+ this.ctx.batchSetItemValueByEditor(f, !0);
6236
6124
  let u = [];
6237
6125
  t.forEach((x) => {
6238
6126
  u.push(this.ctx.database.getRowDataItemForRowKey(x));
6239
- }), this.ctx.emit("autofillChange", d, u), this.ctx.emit("draw");
6127
+ }), this.ctx.emit("autofillChange", f, u), this.ctx.emit("draw");
6240
6128
  }
6241
6129
  mouseenter(t) {
6242
6130
  if (["index", "selection", "index-selection"].includes(t.type))
@@ -6253,7 +6141,7 @@ class Ei {
6253
6141
  const Q = Math.min, U = Math.max, ut = Math.round, ct = Math.floor, F = (h) => ({
6254
6142
  x: h,
6255
6143
  y: h
6256
- }), pi = {
6144
+ }), mi = {
6257
6145
  left: "right",
6258
6146
  right: "left",
6259
6147
  bottom: "top",
@@ -6271,55 +6159,55 @@ function j(h) {
6271
6159
  function at(h) {
6272
6160
  return h.split("-")[1];
6273
6161
  }
6274
- function we(h) {
6162
+ function me(h) {
6275
6163
  return h === "x" ? "y" : "x";
6276
6164
  }
6277
6165
  function Xt(h) {
6278
6166
  return h === "y" ? "height" : "width";
6279
6167
  }
6280
- function z(h) {
6168
+ function P(h) {
6281
6169
  const t = h[0];
6282
6170
  return t === "t" || t === "b" ? "y" : "x";
6283
6171
  }
6284
6172
  function Yt(h) {
6285
- return we(z(h));
6173
+ return me(P(h));
6286
6174
  }
6287
- function yi(h, t, e) {
6175
+ function Ei(h, t, e) {
6288
6176
  e === void 0 && (e = !1);
6289
6177
  const i = at(h), s = Yt(h), o = Xt(s);
6290
6178
  let r = s === "x" ? i === (e ? "end" : "start") ? "right" : "left" : i === "start" ? "bottom" : "top";
6291
6179
  return t.reference[o] > t.floating[o] && (r = xt(r)), [r, xt(r)];
6292
6180
  }
6293
- function Ci(h) {
6181
+ function pi(h) {
6294
6182
  const t = xt(h);
6295
6183
  return [Lt(h), t, Lt(t)];
6296
6184
  }
6297
6185
  function Lt(h) {
6298
6186
  return h.includes("start") ? h.replace("start", "end") : h.replace("end", "start");
6299
6187
  }
6300
- const Qt = ["left", "right"], te = ["right", "left"], bi = ["top", "bottom"], Ri = ["bottom", "top"];
6301
- function vi(h, t, e) {
6188
+ const Qt = ["left", "right"], te = ["right", "left"], yi = ["top", "bottom"], Ci = ["bottom", "top"];
6189
+ function bi(h, t, e) {
6302
6190
  switch (h) {
6303
6191
  case "top":
6304
6192
  case "bottom":
6305
6193
  return e ? t ? te : Qt : t ? Qt : te;
6306
6194
  case "left":
6307
6195
  case "right":
6308
- return t ? bi : Ri;
6196
+ return t ? yi : Ci;
6309
6197
  default:
6310
6198
  return [];
6311
6199
  }
6312
6200
  }
6313
- function Ii(h, t, e, i) {
6201
+ function Ri(h, t, e, i) {
6314
6202
  const s = at(h);
6315
- let o = vi(j(h), e === "start", i);
6203
+ let o = bi(j(h), e === "start", i);
6316
6204
  return s && (o = o.map((r) => r + "-" + s), t && (o = o.concat(o.map(Lt)))), o;
6317
6205
  }
6318
6206
  function xt(h) {
6319
6207
  const t = j(h);
6320
- return pi[t] + h.slice(t.length);
6208
+ return mi[t] + h.slice(t.length);
6321
6209
  }
6322
- function _i(h) {
6210
+ function Ii(h) {
6323
6211
  return {
6324
6212
  top: 0,
6325
6213
  right: 0,
@@ -6329,7 +6217,7 @@ function _i(h) {
6329
6217
  };
6330
6218
  }
6331
6219
  function Ee(h) {
6332
- return typeof h != "number" ? _i(h) : {
6220
+ return typeof h != "number" ? Ii(h) : {
6333
6221
  top: h,
6334
6222
  right: h,
6335
6223
  bottom: h,
@@ -6359,31 +6247,31 @@ function ee(h, t, e) {
6359
6247
  reference: i,
6360
6248
  floating: s
6361
6249
  } = h;
6362
- const o = z(t), r = Yt(t), a = Xt(r), l = j(t), c = 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;
6250
+ const o = P(t), r = Yt(t), a = Xt(r), l = j(t), c = o === "y", f = i.x + i.width / 2 - s.width / 2, d = i.y + i.height / 2 - s.height / 2, u = i[a] / 2 - s[a] / 2;
6363
6251
  let x;
6364
6252
  switch (l) {
6365
6253
  case "top":
6366
6254
  x = {
6367
- x: d,
6255
+ x: f,
6368
6256
  y: i.y - s.height
6369
6257
  };
6370
6258
  break;
6371
6259
  case "bottom":
6372
6260
  x = {
6373
- x: d,
6261
+ x: f,
6374
6262
  y: i.y + i.height
6375
6263
  };
6376
6264
  break;
6377
6265
  case "right":
6378
6266
  x = {
6379
6267
  x: i.x + i.width,
6380
- y: f
6268
+ y: d
6381
6269
  };
6382
6270
  break;
6383
6271
  case "left":
6384
6272
  x = {
6385
6273
  x: i.x - s.width,
6386
- y: f
6274
+ y: d
6387
6275
  };
6388
6276
  break;
6389
6277
  default:
@@ -6402,7 +6290,7 @@ function ee(h, t, e) {
6402
6290
  }
6403
6291
  return x;
6404
6292
  }
6405
- async function Ti(h, t) {
6293
+ async function vi(h, t) {
6406
6294
  var e;
6407
6295
  t === void 0 && (t = {});
6408
6296
  const {
@@ -6414,16 +6302,16 @@ async function Ti(h, t) {
6414
6302
  strategy: l
6415
6303
  } = h, {
6416
6304
  boundary: c = "clippingAncestors",
6417
- rootBoundary: d = "viewport",
6418
- elementContext: f = "floating",
6305
+ rootBoundary: f = "viewport",
6306
+ elementContext: d = "floating",
6419
6307
  altBoundary: u = !1,
6420
6308
  padding: x = 0
6421
- } = nt(t, h), g = Ee(x), m = a[u ? f === "floating" ? "reference" : "floating" : f], w = gt(await o.getClippingRect({
6422
- element: (e = await (o.isElement == null ? void 0 : o.isElement(m))) == null || e ? m : m.contextElement || await (o.getDocumentElement == null ? void 0 : o.getDocumentElement(a.floating)),
6309
+ } = nt(t, h), g = Ee(x), w = a[u ? d === "floating" ? "reference" : "floating" : d], m = gt(await o.getClippingRect({
6310
+ element: (e = await (o.isElement == null ? void 0 : o.isElement(w))) == null || e ? w : w.contextElement || await (o.getDocumentElement == null ? void 0 : o.getDocumentElement(a.floating)),
6423
6311
  boundary: c,
6424
- rootBoundary: d,
6312
+ rootBoundary: f,
6425
6313
  strategy: l
6426
- })), y = f === "floating" ? {
6314
+ })), y = d === "floating" ? {
6427
6315
  x: i,
6428
6316
  y: s,
6429
6317
  width: r.floating.width,
@@ -6441,13 +6329,13 @@ async function Ti(h, t) {
6441
6329
  strategy: l
6442
6330
  }) : y);
6443
6331
  return {
6444
- top: (w.top - C.top + g.top) / p.y,
6445
- bottom: (C.bottom - w.bottom + g.bottom) / p.y,
6446
- left: (w.left - C.left + g.left) / p.x,
6447
- right: (C.right - w.right + g.right) / p.x
6332
+ top: (m.top - C.top + g.top) / p.y,
6333
+ bottom: (C.bottom - m.bottom + g.bottom) / p.y,
6334
+ left: (m.left - C.left + g.left) / p.x,
6335
+ right: (C.right - m.right + g.right) / p.x
6448
6336
  };
6449
6337
  }
6450
- const Si = 50, Oi = async (h, t, e) => {
6338
+ const _i = 50, Ti = async (h, t, e) => {
6451
6339
  const {
6452
6340
  placement: i = "bottom",
6453
6341
  strategy: s = "absolute",
@@ -6455,32 +6343,32 @@ const Si = 50, Oi = async (h, t, e) => {
6455
6343
  platform: r
6456
6344
  } = e, a = r.detectOverflow ? r : {
6457
6345
  ...r,
6458
- detectOverflow: Ti
6346
+ detectOverflow: vi
6459
6347
  }, l = await (r.isRTL == null ? void 0 : r.isRTL(t));
6460
6348
  let c = await r.getElementRects({
6461
6349
  reference: h,
6462
6350
  floating: t,
6463
6351
  strategy: s
6464
6352
  }), {
6465
- x: d,
6466
- y: f
6353
+ x: f,
6354
+ y: d
6467
6355
  } = ee(c, i, l), u = i, x = 0;
6468
6356
  const g = {};
6469
6357
  for (let E = 0; E < o.length; E++) {
6470
- const m = o[E];
6471
- if (!m)
6358
+ const w = o[E];
6359
+ if (!w)
6472
6360
  continue;
6473
6361
  const {
6474
- name: w,
6362
+ name: m,
6475
6363
  fn: y
6476
- } = m, {
6364
+ } = w, {
6477
6365
  x: b,
6478
6366
  y: p,
6479
6367
  data: C,
6480
- reset: v
6368
+ reset: I
6481
6369
  } = await y({
6482
- x: d,
6483
- y: f,
6370
+ x: f,
6371
+ y: d,
6484
6372
  initialPlacement: i,
6485
6373
  placement: u,
6486
6374
  strategy: s,
@@ -6492,26 +6380,26 @@ const Si = 50, Oi = async (h, t, e) => {
6492
6380
  floating: t
6493
6381
  }
6494
6382
  });
6495
- d = b ?? d, f = p ?? f, g[w] = {
6496
- ...g[w],
6383
+ f = b ?? f, d = p ?? d, g[m] = {
6384
+ ...g[m],
6497
6385
  ...C
6498
- }, v && x < Si && (x++, typeof v == "object" && (v.placement && (u = v.placement), v.rects && (c = v.rects === !0 ? await r.getElementRects({
6386
+ }, I && x < _i && (x++, typeof I == "object" && (I.placement && (u = I.placement), I.rects && (c = I.rects === !0 ? await r.getElementRects({
6499
6387
  reference: h,
6500
6388
  floating: t,
6501
6389
  strategy: s
6502
- }) : v.rects), {
6503
- x: d,
6504
- y: f
6390
+ }) : I.rects), {
6391
+ x: f,
6392
+ y: d
6505
6393
  } = ee(c, u, l)), E = -1);
6506
6394
  }
6507
6395
  return {
6508
- x: d,
6509
- y: f,
6396
+ x: f,
6397
+ y: d,
6510
6398
  placement: u,
6511
6399
  strategy: s,
6512
6400
  middlewareData: g
6513
6401
  };
6514
- }, Li = (h) => ({
6402
+ }, Si = (h) => ({
6515
6403
  name: "arrow",
6516
6404
  options: h,
6517
6405
  async fn(t) {
@@ -6525,17 +6413,17 @@ const Si = 50, Oi = async (h, t, e) => {
6525
6413
  middlewareData: l
6526
6414
  } = t, {
6527
6415
  element: c,
6528
- padding: d = 0
6416
+ padding: f = 0
6529
6417
  } = nt(h, t) || {};
6530
6418
  if (c == null)
6531
6419
  return {};
6532
- const f = Ee(d), u = {
6420
+ const d = Ee(f), u = {
6533
6421
  x: e,
6534
6422
  y: i
6535
- }, x = Yt(s), g = Xt(x), E = await r.getDimensions(c), m = x === "y", w = m ? "top" : "left", y = m ? "bottom" : "right", b = m ? "clientHeight" : "clientWidth", p = o.reference[g] + o.reference[x] - u[x] - o.floating[g], C = u[x] - o.reference[x], v = await (r.getOffsetParent == null ? void 0 : r.getOffsetParent(c));
6536
- let I = v ? v[b] : 0;
6537
- (!I || !await (r.isElement == null ? void 0 : r.isElement(v))) && (I = a.floating[b] || o.floating[g]);
6538
- const T = p / 2 - C / 2, _ = I / 2 - E[g] / 2 - 1, R = Q(f[w], _), S = Q(f[y], _), O = R, M = I - E[g] - S, L = I / 2 - E[g] / 2 + T, H = Ot(O, L, M), D = !l.arrow && at(s) != null && L !== H && o.reference[g] / 2 - (L < O ? R : S) - E[g] / 2 < 0, A = D ? L < O ? L - O : L - M : 0;
6423
+ }, x = Yt(s), g = Xt(x), E = await r.getDimensions(c), w = x === "y", m = w ? "top" : "left", y = w ? "bottom" : "right", b = w ? "clientHeight" : "clientWidth", p = o.reference[g] + o.reference[x] - u[x] - o.floating[g], C = u[x] - o.reference[x], I = await (r.getOffsetParent == null ? void 0 : r.getOffsetParent(c));
6424
+ let v = I ? I[b] : 0;
6425
+ (!v || !await (r.isElement == null ? void 0 : r.isElement(I))) && (v = a.floating[b] || o.floating[g]);
6426
+ const T = p / 2 - C / 2, _ = v / 2 - E[g] / 2 - 1, R = Q(d[m], _), S = Q(d[y], _), O = R, M = v - E[g] - S, L = v / 2 - E[g] / 2 + T, H = Ot(O, L, M), D = !l.arrow && at(s) != null && L !== H && o.reference[g] / 2 - (L < O ? R : S) - E[g] / 2 < 0, A = D ? L < O ? L - O : L - M : 0;
6539
6427
  return {
6540
6428
  [x]: u[x] + A,
6541
6429
  data: {
@@ -6548,7 +6436,7 @@ const Si = 50, Oi = async (h, t, e) => {
6548
6436
  reset: D
6549
6437
  };
6550
6438
  }
6551
- }), Mi = function(h) {
6439
+ }), Oi = function(h) {
6552
6440
  return h === void 0 && (h = {}), {
6553
6441
  name: "flip",
6554
6442
  options: h,
@@ -6562,22 +6450,22 @@ const Si = 50, Oi = async (h, t, e) => {
6562
6450
  platform: l,
6563
6451
  elements: c
6564
6452
  } = t, {
6565
- mainAxis: d = !0,
6566
- crossAxis: f = !0,
6453
+ mainAxis: f = !0,
6454
+ crossAxis: d = !0,
6567
6455
  fallbackPlacements: u,
6568
6456
  fallbackStrategy: x = "bestFit",
6569
6457
  fallbackAxisSideDirection: g = "none",
6570
6458
  flipAlignment: E = !0,
6571
- ...m
6459
+ ...w
6572
6460
  } = nt(h, t);
6573
6461
  if ((e = o.arrow) != null && e.alignmentOffset)
6574
6462
  return {};
6575
- const w = j(s), y = z(a), b = j(a) === a, p = await (l.isRTL == null ? void 0 : l.isRTL(c.floating)), C = u || (b || !E ? [xt(a)] : Ci(a)), v = g !== "none";
6576
- !u && v && C.push(...Ii(a, E, g, p));
6577
- const I = [a, ...C], T = await l.detectOverflow(t, m), _ = [];
6463
+ const m = j(s), y = P(a), b = j(a) === a, p = await (l.isRTL == null ? void 0 : l.isRTL(c.floating)), C = u || (b || !E ? [xt(a)] : pi(a)), I = g !== "none";
6464
+ !u && I && C.push(...Ri(a, E, g, p));
6465
+ const v = [a, ...C], T = await l.detectOverflow(t, w), _ = [];
6578
6466
  let R = ((i = o.flip) == null ? void 0 : i.overflows) || [];
6579
- if (d && _.push(T[w]), f) {
6580
- const L = yi(s, r, p);
6467
+ if (f && _.push(T[m]), d) {
6468
+ const L = Ei(s, r, p);
6581
6469
  _.push(T[L[0]], T[L[1]]);
6582
6470
  }
6583
6471
  if (R = [...R, {
@@ -6585,10 +6473,10 @@ const Si = 50, Oi = async (h, t, e) => {
6585
6473
  overflows: _
6586
6474
  }], !_.every((L) => L <= 0)) {
6587
6475
  var S, O;
6588
- const L = (((S = o.flip) == null ? void 0 : S.index) || 0) + 1, H = I[L];
6589
- if (H && (!(f === "alignment" ? y !== z(H) : !1) || // We leave the current main axis only if every placement on that axis
6476
+ const L = (((S = o.flip) == null ? void 0 : S.index) || 0) + 1, H = v[L];
6477
+ if (H && (!(d === "alignment" ? y !== P(H) : !1) || // We leave the current main axis only if every placement on that axis
6590
6478
  // overflows the main axis.
6591
- R.every((k) => z(k.placement) === y ? k.overflows[0] > 0 : !0)))
6479
+ R.every((k) => P(k.placement) === y ? k.overflows[0] > 0 : !0)))
6592
6480
  return {
6593
6481
  data: {
6594
6482
  index: L,
@@ -6604,14 +6492,14 @@ const Si = 50, Oi = async (h, t, e) => {
6604
6492
  case "bestFit": {
6605
6493
  var M;
6606
6494
  const A = (M = R.filter((k) => {
6607
- if (v) {
6608
- const N = z(k.placement);
6495
+ if (I) {
6496
+ const N = P(k.placement);
6609
6497
  return N === y || // Create a bias to the `y` side axis due to horizontal
6610
6498
  // reading directions favoring greater width.
6611
6499
  N === "y";
6612
6500
  }
6613
6501
  return !0;
6614
- }).map((k) => [k.placement, k.overflows.filter((N) => N > 0).reduce((N, vt) => N + vt, 0)]).sort((k, N) => k[1] - N[1])[0]) == null ? void 0 : M[0];
6502
+ }).map((k) => [k.placement, k.overflows.filter((N) => N > 0).reduce((N, It) => N + It, 0)]).sort((k, N) => k[1] - N[1])[0]) == null ? void 0 : M[0];
6615
6503
  A && (D = A);
6616
6504
  break;
6617
6505
  }
@@ -6629,35 +6517,35 @@ const Si = 50, Oi = async (h, t, e) => {
6629
6517
  return {};
6630
6518
  }
6631
6519
  };
6632
- }, Ai = /* @__PURE__ */ new Set(["left", "top"]);
6633
- async function Hi(h, t) {
6520
+ }, Li = /* @__PURE__ */ new Set(["left", "top"]);
6521
+ async function Mi(h, t) {
6634
6522
  const {
6635
6523
  placement: e,
6636
6524
  platform: i,
6637
6525
  elements: s
6638
- } = h, o = await (i.isRTL == null ? void 0 : i.isRTL(s.floating)), r = j(e), a = at(e), l = z(e) === "y", c = Ai.has(r) ? -1 : 1, d = o && l ? -1 : 1, f = nt(t, h);
6526
+ } = h, o = await (i.isRTL == null ? void 0 : i.isRTL(s.floating)), r = j(e), a = at(e), l = P(e) === "y", c = Li.has(r) ? -1 : 1, f = o && l ? -1 : 1, d = nt(t, h);
6639
6527
  let {
6640
6528
  mainAxis: u,
6641
6529
  crossAxis: x,
6642
6530
  alignmentAxis: g
6643
- } = typeof f == "number" ? {
6644
- mainAxis: f,
6531
+ } = typeof d == "number" ? {
6532
+ mainAxis: d,
6645
6533
  crossAxis: 0,
6646
6534
  alignmentAxis: null
6647
6535
  } : {
6648
- mainAxis: f.mainAxis || 0,
6649
- crossAxis: f.crossAxis || 0,
6650
- alignmentAxis: f.alignmentAxis
6536
+ mainAxis: d.mainAxis || 0,
6537
+ crossAxis: d.crossAxis || 0,
6538
+ alignmentAxis: d.alignmentAxis
6651
6539
  };
6652
6540
  return a && typeof g == "number" && (x = a === "end" ? g * -1 : g), l ? {
6653
- x: x * d,
6541
+ x: x * f,
6654
6542
  y: u * c
6655
6543
  } : {
6656
6544
  x: u * c,
6657
- y: x * d
6545
+ y: x * f
6658
6546
  };
6659
6547
  }
6660
- const Di = function(h) {
6548
+ const Ai = function(h) {
6661
6549
  return h === void 0 && (h = 0), {
6662
6550
  name: "offset",
6663
6551
  options: h,
@@ -6668,7 +6556,7 @@ const Di = function(h) {
6668
6556
  y: o,
6669
6557
  placement: r,
6670
6558
  middlewareData: a
6671
- } = t, l = await Hi(t, h);
6559
+ } = t, l = await Mi(t, h);
6672
6560
  return r === ((e = a.offset) == null ? void 0 : e.placement) && (i = a.arrow) != null && i.alignmentOffset ? {} : {
6673
6561
  x: s + l.x,
6674
6562
  y: o + l.y,
@@ -6679,7 +6567,7 @@ const Di = function(h) {
6679
6567
  };
6680
6568
  }
6681
6569
  };
6682
- }, Ni = function(h) {
6570
+ }, Hi = function(h) {
6683
6571
  return h === void 0 && (h = {}), {
6684
6572
  name: "shift",
6685
6573
  options: h,
@@ -6693,11 +6581,11 @@ const Di = function(h) {
6693
6581
  mainAxis: r = !0,
6694
6582
  crossAxis: a = !1,
6695
6583
  limiter: l = {
6696
- fn: (w) => {
6584
+ fn: (m) => {
6697
6585
  let {
6698
6586
  x: y,
6699
6587
  y: b
6700
- } = w;
6588
+ } = m;
6701
6589
  return {
6702
6590
  x: y,
6703
6591
  y: b
@@ -6705,29 +6593,29 @@ const Di = function(h) {
6705
6593
  }
6706
6594
  },
6707
6595
  ...c
6708
- } = nt(h, t), d = {
6596
+ } = nt(h, t), f = {
6709
6597
  x: e,
6710
6598
  y: i
6711
- }, f = await o.detectOverflow(t, c), u = z(j(s)), x = we(u);
6712
- let g = d[x], E = d[u];
6599
+ }, d = await o.detectOverflow(t, c), u = P(j(s)), x = me(u);
6600
+ let g = f[x], E = f[u];
6713
6601
  if (r) {
6714
- const w = x === "y" ? "top" : "left", y = x === "y" ? "bottom" : "right", b = g + f[w], p = g - f[y];
6602
+ const m = x === "y" ? "top" : "left", y = x === "y" ? "bottom" : "right", b = g + d[m], p = g - d[y];
6715
6603
  g = Ot(b, g, p);
6716
6604
  }
6717
6605
  if (a) {
6718
- const w = u === "y" ? "top" : "left", y = u === "y" ? "bottom" : "right", b = E + f[w], p = E - f[y];
6606
+ const m = u === "y" ? "top" : "left", y = u === "y" ? "bottom" : "right", b = E + d[m], p = E - d[y];
6719
6607
  E = Ot(b, E, p);
6720
6608
  }
6721
- const m = l.fn({
6609
+ const w = l.fn({
6722
6610
  ...t,
6723
6611
  [x]: g,
6724
6612
  [u]: E
6725
6613
  });
6726
6614
  return {
6727
- ...m,
6615
+ ...w,
6728
6616
  data: {
6729
- x: m.x - e,
6730
- y: m.y - i,
6617
+ x: w.x - e,
6618
+ y: w.y - i,
6731
6619
  enabled: {
6732
6620
  [x]: r,
6733
6621
  [u]: a
@@ -6757,7 +6645,7 @@ function pe(h) {
6757
6645
  function Y(h) {
6758
6646
  return yt() ? h instanceof Element || h instanceof X(h).Element : !1;
6759
6647
  }
6760
- function P(h) {
6648
+ function z(h) {
6761
6649
  return yt() ? h instanceof HTMLElement || h instanceof X(h).HTMLElement : !1;
6762
6650
  }
6763
6651
  function ie(h) {
@@ -6772,7 +6660,7 @@ function lt(h) {
6772
6660
  } = K(h);
6773
6661
  return /auto|scroll|overlay|hidden|clip/.test(t + i + e) && s !== "inline" && s !== "contents";
6774
6662
  }
6775
- function ki(h) {
6663
+ function Di(h) {
6776
6664
  return /^(table|td|th)$/.test(et(h));
6777
6665
  }
6778
6666
  function Ct(h) {
@@ -6787,25 +6675,25 @@ function Ct(h) {
6787
6675
  return !1;
6788
6676
  }
6789
6677
  }
6790
- const Bi = /transform|translate|scale|rotate|perspective|filter/, Xi = /paint|layout|strict|content/, $ = (h) => !!h && h !== "none";
6791
- let It;
6678
+ const Ni = /transform|translate|scale|rotate|perspective|filter/, ki = /paint|layout|strict|content/, G = (h) => !!h && h !== "none";
6679
+ let vt;
6792
6680
  function Kt(h) {
6793
6681
  const t = Y(h) ? K(h) : h;
6794
- return $(t.transform) || $(t.translate) || $(t.scale) || $(t.rotate) || $(t.perspective) || !Ft() && ($(t.backdropFilter) || $(t.filter)) || Bi.test(t.willChange || "") || Xi.test(t.contain || "");
6682
+ return G(t.transform) || G(t.translate) || G(t.scale) || G(t.rotate) || G(t.perspective) || !Ft() && (G(t.backdropFilter) || G(t.filter)) || Ni.test(t.willChange || "") || ki.test(t.contain || "");
6795
6683
  }
6796
- function Yi(h) {
6797
- let t = G(h);
6798
- for (; P(t) && !tt(t); ) {
6684
+ function Bi(h) {
6685
+ let t = $(h);
6686
+ for (; z(t) && !tt(t); ) {
6799
6687
  if (Kt(t))
6800
6688
  return t;
6801
6689
  if (Ct(t))
6802
6690
  return null;
6803
- t = G(t);
6691
+ t = $(t);
6804
6692
  }
6805
6693
  return null;
6806
6694
  }
6807
6695
  function Ft() {
6808
- return It == null && (It = typeof CSS < "u" && CSS.supports && CSS.supports("-webkit-backdrop-filter", "none")), It;
6696
+ return vt == null && (vt = typeof CSS < "u" && CSS.supports && CSS.supports("-webkit-backdrop-filter", "none")), vt;
6809
6697
  }
6810
6698
  function tt(h) {
6811
6699
  return /^(html|body|#document)$/.test(et(h));
@@ -6822,7 +6710,7 @@ function bt(h) {
6822
6710
  scrollTop: h.scrollY
6823
6711
  };
6824
6712
  }
6825
- function G(h) {
6713
+ function $(h) {
6826
6714
  if (et(h) === "html")
6827
6715
  return h;
6828
6716
  const t = (
@@ -6835,8 +6723,8 @@ function G(h) {
6835
6723
  return ie(t) ? t.host : t;
6836
6724
  }
6837
6725
  function ye(h) {
6838
- const t = G(h);
6839
- return tt(t) ? h.ownerDocument ? h.ownerDocument.body : h.body : P(t) && lt(t) ? t : ye(t);
6726
+ const t = $(h);
6727
+ return tt(t) ? h.ownerDocument ? h.ownerDocument.body : h.body : z(t) && lt(t) ? t : ye(t);
6840
6728
  }
6841
6729
  function ot(h, t, e) {
6842
6730
  var i;
@@ -6854,7 +6742,7 @@ function Mt(h) {
6854
6742
  function Ce(h) {
6855
6743
  const t = K(h);
6856
6744
  let e = parseFloat(t.width) || 0, i = parseFloat(t.height) || 0;
6857
- const s = P(h), o = s ? h.offsetWidth : e, r = s ? h.offsetHeight : i, a = ut(e) !== o || ut(i) !== r;
6745
+ const s = z(h), o = s ? h.offsetWidth : e, r = s ? h.offsetHeight : i, a = ut(e) !== o || ut(i) !== r;
6858
6746
  return a && (e = o, i = r), {
6859
6747
  width: e,
6860
6748
  height: i,
@@ -6866,7 +6754,7 @@ function Wt(h) {
6866
6754
  }
6867
6755
  function J(h) {
6868
6756
  const t = Wt(h);
6869
- if (!P(t))
6757
+ if (!z(t))
6870
6758
  return F(1);
6871
6759
  const e = t.getBoundingClientRect(), {
6872
6760
  width: i,
@@ -6879,42 +6767,42 @@ function J(h) {
6879
6767
  y: a
6880
6768
  };
6881
6769
  }
6882
- const Ki = /* @__PURE__ */ F(0);
6770
+ const Xi = /* @__PURE__ */ F(0);
6883
6771
  function be(h) {
6884
6772
  const t = X(h);
6885
- return !Ft() || !t.visualViewport ? Ki : {
6773
+ return !Ft() || !t.visualViewport ? Xi : {
6886
6774
  x: t.visualViewport.offsetLeft,
6887
6775
  y: t.visualViewport.offsetTop
6888
6776
  };
6889
6777
  }
6890
- function Fi(h, t, e) {
6778
+ function Yi(h, t, e) {
6891
6779
  return t === void 0 && (t = !1), !e || t && e !== X(h) ? !1 : t;
6892
6780
  }
6893
- function Z(h, t, e, i) {
6781
+ function q(h, t, e, i) {
6894
6782
  t === void 0 && (t = !1), e === void 0 && (e = !1);
6895
6783
  const s = h.getBoundingClientRect(), o = Wt(h);
6896
6784
  let r = F(1);
6897
6785
  t && (i ? Y(i) && (r = J(i)) : r = J(h));
6898
- const a = Fi(o, e, i) ? be(o) : F(0);
6899
- let l = (s.left + a.x) / r.x, c = (s.top + a.y) / r.y, d = s.width / r.x, f = s.height / r.y;
6786
+ const a = Yi(o, e, i) ? be(o) : F(0);
6787
+ let l = (s.left + a.x) / r.x, c = (s.top + a.y) / r.y, f = s.width / r.x, d = s.height / r.y;
6900
6788
  if (o) {
6901
6789
  const u = X(o), x = i && Y(i) ? X(i) : i;
6902
6790
  let g = u, E = Mt(g);
6903
6791
  for (; E && i && x !== g; ) {
6904
- const m = J(E), w = E.getBoundingClientRect(), y = K(E), b = w.left + (E.clientLeft + parseFloat(y.paddingLeft)) * m.x, p = w.top + (E.clientTop + parseFloat(y.paddingTop)) * m.y;
6905
- l *= m.x, c *= m.y, d *= m.x, f *= m.y, l += b, c += p, g = X(E), E = Mt(g);
6792
+ const w = J(E), m = E.getBoundingClientRect(), y = K(E), b = m.left + (E.clientLeft + parseFloat(y.paddingLeft)) * w.x, p = m.top + (E.clientTop + parseFloat(y.paddingTop)) * w.y;
6793
+ l *= w.x, c *= w.y, f *= w.x, d *= w.y, l += b, c += p, g = X(E), E = Mt(g);
6906
6794
  }
6907
6795
  }
6908
6796
  return gt({
6909
- width: d,
6910
- height: f,
6797
+ width: f,
6798
+ height: d,
6911
6799
  x: l,
6912
6800
  y: c
6913
6801
  });
6914
6802
  }
6915
6803
  function Rt(h, t) {
6916
6804
  const e = bt(h).scrollLeft;
6917
- return t ? t.left + e : Z(W(h)).left + e;
6805
+ return t ? t.left + e : q(W(h)).left + e;
6918
6806
  }
6919
6807
  function Re(h, t) {
6920
6808
  const e = h.getBoundingClientRect(), i = e.left + t.scrollLeft - Rt(h, e), s = e.top + t.scrollTop;
@@ -6923,7 +6811,7 @@ function Re(h, t) {
6923
6811
  y: s
6924
6812
  };
6925
6813
  }
6926
- function Wi(h) {
6814
+ function Ki(h) {
6927
6815
  let {
6928
6816
  elements: t,
6929
6817
  rect: e,
@@ -6937,23 +6825,23 @@ function Wi(h) {
6937
6825
  scrollLeft: 0,
6938
6826
  scrollTop: 0
6939
6827
  }, c = F(1);
6940
- const d = F(0), f = P(i);
6941
- if ((f || !f && !o) && ((et(i) !== "body" || lt(r)) && (l = bt(i)), f)) {
6942
- const x = Z(i);
6943
- c = J(i), d.x = x.x + i.clientLeft, d.y = x.y + i.clientTop;
6828
+ const f = F(0), d = z(i);
6829
+ if ((d || !d && !o) && ((et(i) !== "body" || lt(r)) && (l = bt(i)), d)) {
6830
+ const x = q(i);
6831
+ c = J(i), f.x = x.x + i.clientLeft, f.y = x.y + i.clientTop;
6944
6832
  }
6945
- const u = r && !f && !o ? Re(r, l) : F(0);
6833
+ const u = r && !d && !o ? Re(r, l) : F(0);
6946
6834
  return {
6947
6835
  width: e.width * c.x,
6948
6836
  height: e.height * c.y,
6949
- x: e.x * c.x - l.scrollLeft * c.x + d.x + u.x,
6950
- y: e.y * c.y - l.scrollTop * c.y + d.y + u.y
6837
+ x: e.x * c.x - l.scrollLeft * c.x + f.x + u.x,
6838
+ y: e.y * c.y - l.scrollTop * c.y + f.y + u.y
6951
6839
  };
6952
6840
  }
6953
- function Vi(h) {
6841
+ function Fi(h) {
6954
6842
  return Array.from(h.getClientRects());
6955
6843
  }
6956
- function Pi(h) {
6844
+ function Wi(h) {
6957
6845
  const t = W(h), e = bt(h), i = h.ownerDocument.body, s = U(t.scrollWidth, t.clientWidth, i.scrollWidth, i.clientWidth), o = U(t.scrollHeight, t.clientHeight, i.scrollHeight, i.clientHeight);
6958
6846
  let r = -e.scrollLeft + Rt(h);
6959
6847
  const a = -e.scrollTop;
@@ -6965,17 +6853,17 @@ function Pi(h) {
6965
6853
  };
6966
6854
  }
6967
6855
  const se = 25;
6968
- function zi(h, t) {
6856
+ function Vi(h, t) {
6969
6857
  const e = X(h), i = W(h), s = e.visualViewport;
6970
6858
  let o = i.clientWidth, r = i.clientHeight, a = 0, l = 0;
6971
6859
  if (s) {
6972
6860
  o = s.width, r = s.height;
6973
- const d = Ft();
6974
- (!d || d && t === "fixed") && (a = s.offsetLeft, l = s.offsetTop);
6861
+ const f = Ft();
6862
+ (!f || f && t === "fixed") && (a = s.offsetLeft, l = s.offsetTop);
6975
6863
  }
6976
6864
  const c = Rt(i);
6977
6865
  if (c <= 0) {
6978
- const d = i.ownerDocument, f = d.body, u = getComputedStyle(f), x = d.compatMode === "CSS1Compat" && parseFloat(u.marginLeft) + parseFloat(u.marginRight) || 0, g = Math.abs(i.clientWidth - f.clientWidth - x);
6866
+ const f = i.ownerDocument, d = f.body, u = getComputedStyle(d), x = f.compatMode === "CSS1Compat" && parseFloat(u.marginLeft) + parseFloat(u.marginRight) || 0, g = Math.abs(i.clientWidth - d.clientWidth - x);
6979
6867
  g <= se && (o -= g);
6980
6868
  } else c <= se && (o += c);
6981
6869
  return {
@@ -6985,8 +6873,8 @@ function zi(h, t) {
6985
6873
  y: l
6986
6874
  };
6987
6875
  }
6988
- function Gi(h, t) {
6989
- const e = Z(h, !0, t === "fixed"), i = e.top + h.clientTop, s = e.left + h.clientLeft, o = P(h) ? J(h) : F(1), r = h.clientWidth * o.x, a = h.clientHeight * o.y, l = s * o.x, c = i * o.y;
6876
+ function zi(h, t) {
6877
+ const e = q(h, !0, t === "fixed"), i = e.top + h.clientTop, s = e.left + h.clientLeft, o = z(h) ? J(h) : F(1), r = h.clientWidth * o.x, a = h.clientHeight * o.y, l = s * o.x, c = i * o.y;
6990
6878
  return {
6991
6879
  width: r,
6992
6880
  height: a,
@@ -6997,11 +6885,11 @@ function Gi(h, t) {
6997
6885
  function oe(h, t, e) {
6998
6886
  let i;
6999
6887
  if (t === "viewport")
7000
- i = zi(h, e);
6888
+ i = Vi(h, e);
7001
6889
  else if (t === "document")
7002
- i = Pi(W(h));
6890
+ i = Wi(W(h));
7003
6891
  else if (Y(t))
7004
- i = Gi(t, e);
6892
+ i = zi(t, e);
7005
6893
  else {
7006
6894
  const s = be(h);
7007
6895
  i = {
@@ -7013,44 +6901,44 @@ function oe(h, t, e) {
7013
6901
  }
7014
6902
  return gt(i);
7015
6903
  }
7016
- function ve(h, t) {
7017
- const e = G(h);
7018
- return e === t || !Y(e) || tt(e) ? !1 : K(e).position === "fixed" || ve(e, t);
6904
+ function Ie(h, t) {
6905
+ const e = $(h);
6906
+ return e === t || !Y(e) || tt(e) ? !1 : K(e).position === "fixed" || Ie(e, t);
7019
6907
  }
7020
- function $i(h, t) {
6908
+ function Pi(h, t) {
7021
6909
  const e = t.get(h);
7022
6910
  if (e)
7023
6911
  return e;
7024
6912
  let i = ot(h, [], !1).filter((a) => Y(a) && et(a) !== "body"), s = null;
7025
6913
  const o = K(h).position === "fixed";
7026
- let r = o ? G(h) : h;
6914
+ let r = o ? $(h) : h;
7027
6915
  for (; Y(r) && !tt(r); ) {
7028
6916
  const a = K(r), l = Kt(r);
7029
- !l && a.position === "fixed" && (s = null), (o ? !l && !s : !l && a.position === "static" && !!s && (s.position === "absolute" || s.position === "fixed") || lt(r) && !l && ve(h, r)) ? i = i.filter((d) => d !== r) : s = a, r = G(r);
6917
+ !l && a.position === "fixed" && (s = null), (o ? !l && !s : !l && a.position === "static" && !!s && (s.position === "absolute" || s.position === "fixed") || lt(r) && !l && Ie(h, r)) ? i = i.filter((f) => f !== r) : s = a, r = $(r);
7030
6918
  }
7031
6919
  return t.set(h, i), i;
7032
6920
  }
7033
- function Ui(h) {
6921
+ function $i(h) {
7034
6922
  let {
7035
6923
  element: t,
7036
6924
  boundary: e,
7037
6925
  rootBoundary: i,
7038
6926
  strategy: s
7039
6927
  } = h;
7040
- const r = [...e === "clippingAncestors" ? Ct(t) ? [] : $i(t, this._c) : [].concat(e), i], a = oe(t, r[0], s);
7041
- let l = a.top, c = a.right, d = a.bottom, f = a.left;
6928
+ const r = [...e === "clippingAncestors" ? Ct(t) ? [] : Pi(t, this._c) : [].concat(e), i], a = oe(t, r[0], s);
6929
+ let l = a.top, c = a.right, f = a.bottom, d = a.left;
7042
6930
  for (let u = 1; u < r.length; u++) {
7043
6931
  const x = oe(t, r[u], s);
7044
- l = U(x.top, l), c = Q(x.right, c), d = Q(x.bottom, d), f = U(x.left, f);
6932
+ l = U(x.top, l), c = Q(x.right, c), f = Q(x.bottom, f), d = U(x.left, d);
7045
6933
  }
7046
6934
  return {
7047
- width: c - f,
7048
- height: d - l,
7049
- x: f,
6935
+ width: c - d,
6936
+ height: f - l,
6937
+ x: d,
7050
6938
  y: l
7051
6939
  };
7052
6940
  }
7053
- function ji(h) {
6941
+ function Gi(h) {
7054
6942
  const {
7055
6943
  width: t,
7056
6944
  height: e
@@ -7060,8 +6948,8 @@ function ji(h) {
7060
6948
  height: e
7061
6949
  };
7062
6950
  }
7063
- function Zi(h, t, e) {
7064
- const i = P(t), s = W(t), o = e === "fixed", r = Z(h, !0, o, t);
6951
+ function Ui(h, t, e) {
6952
+ const i = z(t), s = W(t), o = e === "fixed", r = q(h, !0, o, t);
7065
6953
  let a = {
7066
6954
  scrollLeft: 0,
7067
6955
  scrollTop: 0
@@ -7072,13 +6960,13 @@ function Zi(h, t, e) {
7072
6960
  }
7073
6961
  if (i || !i && !o)
7074
6962
  if ((et(t) !== "body" || lt(s)) && (a = bt(t)), i) {
7075
- const x = Z(t, !0, o, t);
6963
+ const x = q(t, !0, o, t);
7076
6964
  l.x = x.x + t.clientLeft, l.y = x.y + t.clientTop;
7077
6965
  } else s && c();
7078
6966
  o && !i && s && c();
7079
- const d = s && !i && !o ? Re(s, a) : F(0), f = r.left + a.scrollLeft - l.x - d.x, u = r.top + a.scrollTop - l.y - d.y;
6967
+ const f = s && !i && !o ? Re(s, a) : F(0), d = r.left + a.scrollLeft - l.x - f.x, u = r.top + a.scrollTop - l.y - f.y;
7080
6968
  return {
7081
- x: f,
6969
+ x: d,
7082
6970
  y: u,
7083
6971
  width: r.width,
7084
6972
  height: r.height
@@ -7088,35 +6976,35 @@ function _t(h) {
7088
6976
  return K(h).position === "static";
7089
6977
  }
7090
6978
  function re(h, t) {
7091
- if (!P(h) || K(h).position === "fixed")
6979
+ if (!z(h) || K(h).position === "fixed")
7092
6980
  return null;
7093
6981
  if (t)
7094
6982
  return t(h);
7095
6983
  let e = h.offsetParent;
7096
6984
  return W(h) === e && (e = e.ownerDocument.body), e;
7097
6985
  }
7098
- function Ie(h, t) {
6986
+ function ve(h, t) {
7099
6987
  const e = X(h);
7100
6988
  if (Ct(h))
7101
6989
  return e;
7102
- if (!P(h)) {
7103
- let s = G(h);
6990
+ if (!z(h)) {
6991
+ let s = $(h);
7104
6992
  for (; s && !tt(s); ) {
7105
6993
  if (Y(s) && !_t(s))
7106
6994
  return s;
7107
- s = G(s);
6995
+ s = $(s);
7108
6996
  }
7109
6997
  return e;
7110
6998
  }
7111
6999
  let i = re(h, t);
7112
- for (; i && ki(i) && _t(i); )
7000
+ for (; i && Di(i) && _t(i); )
7113
7001
  i = re(i, t);
7114
- return i && tt(i) && _t(i) && !Kt(i) ? e : i || Yi(h) || e;
7002
+ return i && tt(i) && _t(i) && !Kt(i) ? e : i || Bi(h) || e;
7115
7003
  }
7116
- const qi = async function(h) {
7117
- const t = this.getOffsetParent || Ie, e = this.getDimensions, i = await e(h.floating);
7004
+ const ji = async function(h) {
7005
+ const t = this.getOffsetParent || ve, e = this.getDimensions, i = await e(h.floating);
7118
7006
  return {
7119
- reference: Zi(h.reference, await t(h.floating), h.strategy),
7007
+ reference: Ui(h.reference, await t(h.floating), h.strategy),
7120
7008
  floating: {
7121
7009
  x: 0,
7122
7010
  y: 0,
@@ -7125,25 +7013,25 @@ const qi = async function(h) {
7125
7013
  }
7126
7014
  };
7127
7015
  };
7128
- function Ji(h) {
7016
+ function qi(h) {
7129
7017
  return K(h).direction === "rtl";
7130
7018
  }
7131
- const Qi = {
7132
- convertOffsetParentRelativeRectToViewportRelativeRect: Wi,
7019
+ const Zi = {
7020
+ convertOffsetParentRelativeRectToViewportRelativeRect: Ki,
7133
7021
  getDocumentElement: W,
7134
- getClippingRect: Ui,
7135
- getOffsetParent: Ie,
7136
- getElementRects: qi,
7137
- getClientRects: Vi,
7138
- getDimensions: ji,
7022
+ getClippingRect: $i,
7023
+ getOffsetParent: ve,
7024
+ getElementRects: ji,
7025
+ getClientRects: Fi,
7026
+ getDimensions: Gi,
7139
7027
  getScale: J,
7140
7028
  isElement: Y,
7141
- isRTL: Ji
7029
+ isRTL: qi
7142
7030
  };
7143
7031
  function _e(h, t) {
7144
7032
  return h.x === t.x && h.y === t.y && h.width === t.width && h.height === t.height;
7145
7033
  }
7146
- function ts(h, t) {
7034
+ function Ji(h, t) {
7147
7035
  let e = null, i;
7148
7036
  const s = W(h);
7149
7037
  function o() {
@@ -7153,28 +7041,28 @@ function ts(h, t) {
7153
7041
  function r(a, l) {
7154
7042
  a === void 0 && (a = !1), l === void 0 && (l = 1), o();
7155
7043
  const c = h.getBoundingClientRect(), {
7156
- left: d,
7157
- top: f,
7044
+ left: f,
7045
+ top: d,
7158
7046
  width: u,
7159
7047
  height: x
7160
7048
  } = c;
7161
7049
  if (a || t(), !u || !x)
7162
7050
  return;
7163
- const g = ct(f), E = ct(s.clientWidth - (d + u)), m = ct(s.clientHeight - (f + x)), w = ct(d), b = {
7164
- rootMargin: -g + "px " + -E + "px " + -m + "px " + -w + "px",
7051
+ const g = ct(d), E = ct(s.clientWidth - (f + u)), w = ct(s.clientHeight - (d + x)), m = ct(f), b = {
7052
+ rootMargin: -g + "px " + -E + "px " + -w + "px " + -m + "px",
7165
7053
  threshold: U(0, Q(1, l)) || 1
7166
7054
  };
7167
7055
  let p = !0;
7168
- function C(v) {
7169
- const I = v[0].intersectionRatio;
7170
- if (I !== l) {
7056
+ function C(I) {
7057
+ const v = I[0].intersectionRatio;
7058
+ if (v !== l) {
7171
7059
  if (!p)
7172
7060
  return r();
7173
- I ? r(!1, I) : i = setTimeout(() => {
7061
+ v ? r(!1, v) : i = setTimeout(() => {
7174
7062
  r(!1, 1e-7);
7175
7063
  }, 1e3);
7176
7064
  }
7177
- I === 1 && !_e(c, h.getBoundingClientRect()) && r(), p = !1;
7065
+ v === 1 && !_e(c, h.getBoundingClientRect()) && r(), p = !1;
7178
7066
  }
7179
7067
  try {
7180
7068
  e = new IntersectionObserver(C, {
@@ -7197,48 +7085,48 @@ function At(h, t, e, i) {
7197
7085
  elementResize: r = typeof ResizeObserver == "function",
7198
7086
  layoutShift: a = typeof IntersectionObserver == "function",
7199
7087
  animationFrame: l = !1
7200
- } = i, c = Wt(h), d = s || o ? [...c ? ot(c) : [], ...t ? ot(t) : []] : [];
7201
- d.forEach((w) => {
7202
- s && w.addEventListener("scroll", e, {
7088
+ } = i, c = Wt(h), f = s || o ? [...c ? ot(c) : [], ...t ? ot(t) : []] : [];
7089
+ f.forEach((m) => {
7090
+ s && m.addEventListener("scroll", e, {
7203
7091
  passive: !0
7204
- }), o && w.addEventListener("resize", e);
7092
+ }), o && m.addEventListener("resize", e);
7205
7093
  });
7206
- const f = c && a ? ts(c, e) : null;
7094
+ const d = c && a ? Ji(c, e) : null;
7207
7095
  let u = -1, x = null;
7208
- r && (x = new ResizeObserver((w) => {
7209
- let [y] = w;
7096
+ r && (x = new ResizeObserver((m) => {
7097
+ let [y] = m;
7210
7098
  y && y.target === c && x && t && (x.unobserve(t), cancelAnimationFrame(u), u = requestAnimationFrame(() => {
7211
7099
  var b;
7212
7100
  (b = x) == null || b.observe(t);
7213
7101
  })), e();
7214
7102
  }), c && !l && x.observe(c), t && x.observe(t));
7215
- let g, E = l ? Z(h) : null;
7216
- l && m();
7217
- function m() {
7218
- const w = Z(h);
7219
- E && !_e(E, w) && e(), E = w, g = requestAnimationFrame(m);
7103
+ let g, E = l ? q(h) : null;
7104
+ l && w();
7105
+ function w() {
7106
+ const m = q(h);
7107
+ E && !_e(E, m) && e(), E = m, g = requestAnimationFrame(w);
7220
7108
  }
7221
7109
  return e(), () => {
7222
- var w;
7223
- d.forEach((y) => {
7110
+ var m;
7111
+ f.forEach((y) => {
7224
7112
  s && y.removeEventListener("scroll", e), o && y.removeEventListener("resize", e);
7225
- }), f == null || f(), (w = x) == null || w.disconnect(), x = null, l && cancelAnimationFrame(g);
7113
+ }), d == null || d(), (m = x) == null || m.disconnect(), x = null, l && cancelAnimationFrame(g);
7226
7114
  };
7227
7115
  }
7228
- const mt = Di, wt = Ni, Vt = Mi, es = Li, Et = (h, t, e) => {
7116
+ const wt = Ai, mt = Hi, Vt = Oi, Qi = Si, Et = (h, t, e) => {
7229
7117
  const i = /* @__PURE__ */ new Map(), s = {
7230
- platform: Qi,
7118
+ platform: Zi,
7231
7119
  ...e
7232
7120
  }, o = {
7233
7121
  ...s.platform,
7234
7122
  _c: i
7235
7123
  };
7236
- return Oi(h, t, {
7124
+ return Ti(h, t, {
7237
7125
  ...s,
7238
7126
  platform: o
7239
7127
  });
7240
7128
  };
7241
- let is = class {
7129
+ let ts = class {
7242
7130
  constructor(t) {
7243
7131
  n(this, "ctx");
7244
7132
  n(this, "enable", !1);
@@ -7307,48 +7195,49 @@ let is = class {
7307
7195
  if (!s)
7308
7196
  return;
7309
7197
  this.enable = !0, this.contentEl.style.maxWidth = `${t.overflowTooltipMaxWidth || 500}px`, this.contentEl.style.minWidth = "100px", this.contentEl.style.width = "100%", this.contentEl.style.display = "inline-block", this.contentEl.style.wordBreak = "break-all", this.contentEl.style.lineHeight = "1.5", this.contentEl.innerText = i;
7310
- const o = this.ctx.zoomScale.getViewportRect(
7311
- {
7312
- x: t.drawX,
7313
- y: t.drawY,
7314
- width: t.visibleWidth,
7315
- height: t.visibleHeight
7316
- },
7317
- s
7318
- );
7198
+ const o = t.drawX + s.x, r = t.drawY + s.y;
7319
7199
  Et({
7320
7200
  getBoundingClientRect() {
7321
- return o;
7201
+ return {
7202
+ width: t.visibleWidth,
7203
+ height: t.visibleHeight,
7204
+ x: o,
7205
+ y: r,
7206
+ left: o,
7207
+ right: o + t.visibleWidth,
7208
+ top: r,
7209
+ bottom: r + t.visibleHeight
7210
+ };
7322
7211
  }
7323
7212
  }, this.floatingEl, {
7324
7213
  placement: t.overflowTooltipPlacement,
7325
- middleware: [wt(), Vt(), mt(6), es({ element: this.arrowEl })]
7326
- }).then((a) => {
7327
- const { x: l, y: c, placement: d, middlewareData: f } = a;
7214
+ middleware: [mt(), Vt(), wt(6), Qi({ element: this.arrowEl })]
7215
+ }).then((l) => {
7216
+ const { x: c, y: f, placement: d, middlewareData: u } = l;
7328
7217
  if (Object.assign(this.floatingEl.style, {
7329
- top: `${c}px`,
7330
- left: `${l}px`
7331
- }), f.arrow) {
7332
- const u = f.arrow;
7218
+ top: `${f}px`,
7219
+ left: `${c}px`
7220
+ }), u.arrow) {
7221
+ const x = u.arrow;
7333
7222
  ["left", "left-start", "left-end"].includes(d) ? Object.assign(this.arrowEl.style, {
7334
- top: `${u.y}px`,
7223
+ top: `${x.y}px`,
7335
7224
  bottom: "",
7336
7225
  left: "",
7337
7226
  right: "-5px"
7338
7227
  }) : ["right", "right-start", "right-end"].includes(d) ? Object.assign(this.arrowEl.style, {
7339
- top: `${u.y}px`,
7228
+ top: `${x.y}px`,
7340
7229
  bottom: "",
7341
7230
  left: "-5px",
7342
7231
  right: ""
7343
7232
  }) : ["bottom", "bottom-start", "bottom-end"].includes(d) ? Object.assign(this.arrowEl.style, {
7344
7233
  top: "-5px",
7345
7234
  bottom: "",
7346
- left: `${u.x}px`,
7235
+ left: `${x.x}px`,
7347
7236
  right: ""
7348
7237
  }) : ["top", "top-start", "top-end"].includes(d) && Object.assign(this.arrowEl.style, {
7349
7238
  top: "",
7350
7239
  bottom: "-5px",
7351
- left: `${u.x}px`,
7240
+ left: `${x.x}px`,
7352
7241
  right: ""
7353
7242
  });
7354
7243
  }
@@ -7361,7 +7250,7 @@ let is = class {
7361
7250
  this.contentEl.remove(), this.arrowEl.remove(), this.floatingEl.remove();
7362
7251
  }
7363
7252
  };
7364
- class ss {
7253
+ class es {
7365
7254
  constructor(t) {
7366
7255
  n(this, "editorEl");
7367
7256
  n(this, "inputEl");
@@ -7391,15 +7280,15 @@ class ss {
7391
7280
  const { focusCell: e } = this.ctx;
7392
7281
  if (t.code === "Escape" && this.ctx.editing) {
7393
7282
  this.cancel = !0;
7394
- const { focusCell: d } = this.ctx;
7395
- d && (this.ctx.emit("setSelectorCell", d), this.cellTarget = d), this.doneEdit();
7283
+ const { focusCell: f } = this.ctx;
7284
+ f && (this.ctx.emit("setSelectorCell", f), this.cellTarget = f), this.doneEdit();
7396
7285
  return;
7397
7286
  }
7398
7287
  if ((t.altKey || t.metaKey) && t.key === "Enter" && this.ctx.editing && this.inputEl) {
7399
7288
  t.preventDefault();
7400
- const d = this.inputEl.selectionStart, f = this.inputEl.value.substring(0, d), u = this.inputEl.value.substring(d);
7401
- this.inputEl.value = f + `
7402
- ` + u, this.inputEl.selectionStart = this.inputEl.selectionEnd = d + 1, this.autoSize();
7289
+ const f = this.inputEl.selectionStart, d = this.inputEl.value.substring(0, f), u = this.inputEl.value.substring(f);
7290
+ this.inputEl.value = d + `
7291
+ ` + u, this.inputEl.selectionStart = this.inputEl.selectionEnd = f + 1, this.autoSize();
7403
7292
  return;
7404
7293
  }
7405
7294
  if (t.code === "Tab" && this.ctx.editing) {
@@ -7496,20 +7385,18 @@ class ss {
7496
7385
  return;
7497
7386
  const t = this.inputEl.value;
7498
7387
  if (this.cellTarget && this.cellTarget.type === "number" && t !== "" && (this.ctx.emit("cellHideTooltip"), !/^-?\d+(\.\d+)?$/.test(t))) {
7499
- const c = this.ctx.locale.getText("numberErrorTip");
7500
- this.ctx.emit("cellShowTooltip", this.cellTarget, c);
7388
+ const l = this.ctx.locale.getText("numberErrorTip");
7389
+ this.ctx.emit("cellShowTooltip", this.cellTarget, l);
7501
7390
  }
7502
7391
  this.inputEl.style.height = "auto";
7503
- let e = this.inputEl.scrollHeight;
7504
- const i = this.ctx.toLogical(e);
7505
- let s = this.ctx.body.visibleHeight;
7506
- i > s && (e = this.ctx.toVisual(s));
7392
+ let e = this.inputEl.scrollHeight, i = this.ctx.body.visibleHeight;
7393
+ e > i && (e = i);
7507
7394
  const {
7508
- stageHeight: o,
7509
- footer: r,
7510
- header: a
7511
- } = this.ctx, l = o - r.height - B(this.ctx.config);
7512
- this.editorEl.style.bottom = "auto", this.drawY < a.height && (this.editorEl.style.top = this.ctx.toVisualPx(a.height - 1)), this.drawY + this.ctx.toLogical(e) > l && (this.editorEl.style.left = this.ctx.toVisualPx(this.drawX - 1), this.editorEl.style.top = "auto", this.editorEl.style.bottom = this.ctx.toVisualPx(o - l)), this.inputEl.style.height = `${e}px`;
7395
+ stageHeight: s,
7396
+ footer: o,
7397
+ header: r
7398
+ } = this.ctx, a = s - o.height - B(this.ctx.config);
7399
+ this.editorEl.style.bottom = "auto", this.drawY < r.height && (this.editorEl.style.top = `${r.height - 1}px`), this.drawY + e > a && (this.editorEl.style.left = `${this.drawX - 1}px`, this.editorEl.style.top = "auto", this.editorEl.style.bottom = `${s - a}px`), this.inputEl.style.height = `${e}px`;
7513
7400
  }
7514
7401
  startEditByInput(t, e = !1) {
7515
7402
  const i = e ? null : t.getValue(), { editorType: s } = t;
@@ -7520,12 +7407,10 @@ class ss {
7520
7407
  this.drawX = l, this.drawY = a;
7521
7408
  const {
7522
7409
  config: { CELL_PADDING: c },
7523
- header: d
7410
+ header: f
7524
7411
  } = this.ctx;
7525
- let f = this.ctx.body.visibleHeight;
7526
- o > f && (o = f);
7527
- const u = this.ctx.toVisual(f);
7528
- this.editorEl.style.zIndex = "100", this.editorEl.style.left = this.ctx.toVisualPx(this.drawX - 1), this.editorEl.style.top = this.ctx.toVisualPx(this.drawY), this.editorEl.style.bottom = "auto", this.editorEl.style.maxWidth = "none", this.editorEl.style.border = "", this.editorEl.style.maxHeight = `${u}px`, ["text"].includes(s) ? (this.inputEl.style.opacity = "1", this.inputEl.style.position = "relative", this.inputEl.style.minWidth = this.ctx.toVisualPx(r - 1), this.inputEl.style.minHeight = this.ctx.toVisualPx(o - 1), this.inputEl.style.maxHeight = `${u}px`, this.inputEl.style.width = this.ctx.toVisualPx(r), this.inputEl.style.height = "auto", this.inputEl.style.padding = this.ctx.toVisualPx(c), this.inputEl.value = "", i !== null && (this.inputEl.value = i), (this.ctx.toLogical(this.inputEl.scrollHeight) > o || this.drawY < d.height) && this.autoSize()) : (this.inputEl.style.opacity = "0", this.inputEl.style.width = "1px", this.inputEl.style.height = "1px", this.inputEl.style.position = "absolute", this.inputEl.style.left = "0px", this.inputEl.style.top = "0px");
7412
+ let d = this.ctx.body.visibleHeight;
7413
+ o > d && (o = d), this.editorEl.style.zIndex = "100", this.editorEl.style.left = `${this.drawX - 1}px`, this.editorEl.style.top = `${this.drawY}px`, this.editorEl.style.bottom = "auto", this.editorEl.style.maxWidth = "none", this.editorEl.style.border = "", this.editorEl.style.maxHeight = `${d}px`, ["text"].includes(s) ? (this.inputEl.style.opacity = "1", this.inputEl.style.position = "relative", this.inputEl.style.minWidth = `${r - 1}px`, this.inputEl.style.minHeight = `${o - 1}px`, this.inputEl.style.maxHeight = `${d}px`, this.inputEl.style.width = `${r}px`, this.inputEl.style.height = "auto", this.inputEl.style.padding = `${c}px`, this.inputEl.value = "", i !== null && (this.inputEl.value = i), (this.inputEl.scrollHeight > o || this.drawY < f.height) && this.autoSize()) : (this.inputEl.style.opacity = "0", this.inputEl.style.width = "1px", this.inputEl.style.height = "1px", this.inputEl.style.position = "absolute", this.inputEl.style.left = "0px", this.inputEl.style.top = "0px");
7529
7414
  }
7530
7415
  doneEditByInput() {
7531
7416
  if (this.cellTarget && this.cellTarget.editorType === "text") {
@@ -7549,18 +7434,18 @@ class ss {
7549
7434
  i.isVerticalVisible() && i.isHorizontalVisible() || this.ctx.emit("scrollToIndex", i.rowIndex, i.colIndex), this.editCell(i.rowIndex, i.colIndex, t);
7550
7435
  }
7551
7436
  editCell(t, e, i = !1) {
7552
- const s = this.ctx.body.renderRows.find((f) => f.rowIndex === t);
7437
+ const s = this.ctx.body.renderRows.find((d) => d.rowIndex === t);
7553
7438
  if (!s)
7554
7439
  return;
7555
- const o = s.cells.find((f) => f.colIndex === e);
7440
+ const o = s.cells.find((d) => d.colIndex === e);
7556
7441
  if (!o || !(o.isVerticalVisible() && o.isHorizontalVisible()))
7557
7442
  return;
7558
7443
  this.ctx.emit("setSelectorCell", o);
7559
7444
  const a = this.ctx.focusCell;
7560
7445
  if (!a || ["index", "index-selection", "selection"].includes(a.type) || this.enable)
7561
7446
  return;
7562
- const { rowKey: l, key: c } = a, d = this.ctx.database.getReadonly(l, c);
7563
- a && !d && (this.enable = !0, this.ctx.editing = !0, this.cellTarget = a, this.startEditByInput(this.cellTarget, i), this.ctx.emit("startEdit", this.cellTarget), this.ctx.emit("draw"));
7447
+ const { rowKey: l, key: c } = a, f = this.ctx.database.getReadonly(l, c);
7448
+ a && !f && (this.enable = !0, this.ctx.editing = !0, this.cellTarget = a, this.startEditByInput(this.cellTarget, i), this.ctx.emit("startEdit", this.cellTarget), this.ctx.emit("draw"));
7564
7449
  }
7565
7450
  doneEdit() {
7566
7451
  this.enable && (this.doneEditByInput(), this.ctx.emit("cellHideTooltip"), this.ctx.emit("doneEdit", this.cellTarget), this.enable = !1, this.ctx.editing = !1, this.resetEditorStyle(), setTimeout(() => {
@@ -7569,7 +7454,7 @@ class ss {
7569
7454
  }
7570
7455
  resetEditorStyle() {
7571
7456
  const t = this.cellTarget;
7572
- t && (this.editorEl.style.left = this.ctx.toVisualPx(t.drawX), this.editorEl.style.top = this.ctx.toVisualPx(t.drawY), this.editorEl.style.maxWidth = "1px", this.editorEl.style.maxHeight = "1px", this.editorEl.style.zIndex = "-1", this.editorEl.style.border = "none");
7457
+ t && (this.editorEl.style.left = `${t.drawX}px`, this.editorEl.style.top = `${t.drawY}px`, this.editorEl.style.maxWidth = "1px", this.editorEl.style.maxHeight = "1px", this.editorEl.style.zIndex = "-1", this.editorEl.style.border = "none");
7573
7458
  }
7574
7459
  clearEditor() {
7575
7460
  this.doneEdit(), this.cellTarget = null, this.selectorArrStr = "", this.ctx.clearSelector(), this.ctx.focusCell = void 0, this.inputEl.blur(), this.ctx.emit("draw");
@@ -7579,7 +7464,7 @@ class ss {
7579
7464
  (t = this.editorEl) == null || t.remove();
7580
7465
  }
7581
7466
  }
7582
- let os = class {
7467
+ let is = class {
7583
7468
  constructor(t) {
7584
7469
  n(this, "ctx");
7585
7470
  n(this, "emptyEl");
@@ -7588,7 +7473,7 @@ let os = class {
7588
7473
  this.ctx.emptyElement ? this.emptyEl = this.ctx.emptyElement : (this.emptyEl = document.createElement("div"), this.emptyEl.innerText = this.getText()), this.emptyEl.className = "e-virt-table-empty", this.emptyEl.style.display = "none", this.ctx.containerElement.appendChild(this.emptyEl), this.ctx.on("emptyChange", ({ type: i, headerHeight: s, bodyHeight: o, footerHeight: r }) => {
7589
7474
  const a = s + (o + r) / 2, l = {
7590
7475
  display: i === "empty" ? "block" : "none",
7591
- top: this.ctx.toVisualPx(a),
7476
+ top: `${a}px`,
7592
7477
  ...e
7593
7478
  };
7594
7479
  Object.assign(this.emptyEl.style, l);
@@ -7604,7 +7489,7 @@ let os = class {
7604
7489
  this.emptyEl.remove();
7605
7490
  }
7606
7491
  };
7607
- class rs {
7492
+ class ss {
7608
7493
  constructor(t) {
7609
7494
  n(this, "ctx");
7610
7495
  n(this, "observer");
@@ -7625,7 +7510,7 @@ class rs {
7625
7510
  if (isNaN(r) || isNaN(a))
7626
7511
  return;
7627
7512
  const l = o.getBoundingClientRect(), c = `${r}​_${a}`;
7628
- e.set(c, this.ctx.zoomScale.domHeightToLogical(l.height));
7513
+ e.set(c, Math.round(l.height));
7629
7514
  });
7630
7515
  const i = this.ctx.database.getOverlayerAutoHeightMap();
7631
7516
  if (!this.arerMapsEqual(i, e)) {
@@ -7643,14 +7528,13 @@ class rs {
7643
7528
  const e = this.ctx.overlayerElement;
7644
7529
  e.replaceChildren(), Object.assign(e.style, t.style), t.views.forEach((i) => {
7645
7530
  const s = document.createElement("div");
7646
- s.className = i.class, this.ctx.zoomScale.assignScaledStyle(s, i.style), i.views.forEach((o) => {
7531
+ s.className = i.class, Object.assign(s.style, i.style), i.views.forEach((o) => {
7647
7532
  const r = document.createElement("div");
7648
- this.ctx.zoomScale.assignScaledStyle(r, o.style), o.cells.forEach((a) => {
7649
- const l = this.ctx.zoomScale.createOverlayerCellElement(
7650
- a,
7651
- this.ctx.config.CSS_PREFIX
7652
- );
7653
- r.appendChild(l);
7533
+ Object.assign(r.style, o.style), o.cells.forEach((a) => {
7534
+ const l = document.createElement("div");
7535
+ Object.assign(l.style, a.style), Object.keys(a.domDataset || {}).forEach((c) => {
7536
+ l.setAttribute(c, a.domDataset[c]);
7537
+ }), typeof a.render == "function" && a.render(l, a), r.appendChild(l);
7654
7538
  }), s.appendChild(r);
7655
7539
  }), e.appendChild(s);
7656
7540
  });
@@ -7680,11 +7564,11 @@ class rs {
7680
7564
  fixedRightWidth: e,
7681
7565
  config: { CSS_PREFIX: i }
7682
7566
  } = this.ctx, s = B(this.ctx.config), { visibleWidth: o, visibleHeight: r, renderCellHeaders: a } = this.ctx.header;
7683
- let l = [], c = [], d = [];
7684
- a.forEach((m) => {
7685
- m.render && (m.fixed === "left" ? c.push(m) : m.fixed === "right" ? d.push(m) : l.push(m));
7567
+ let l = [], c = [], f = [];
7568
+ a.forEach((w) => {
7569
+ w.render && (w.fixed === "left" ? c.push(w) : w.fixed === "right" ? f.push(w) : l.push(w));
7686
7570
  });
7687
- const f = e - s, u = {
7571
+ const d = e - s, u = {
7688
7572
  key: "left",
7689
7573
  style: {
7690
7574
  position: "absolute",
@@ -7702,7 +7586,7 @@ class rs {
7702
7586
  top: "0px",
7703
7587
  left: `${t}px`,
7704
7588
  overflow: "hidden",
7705
- width: `${o - t - f + 1}px`,
7589
+ width: `${o - t - d + 1}px`,
7706
7590
  height: `${r}px`
7707
7591
  },
7708
7592
  cells: l
@@ -7713,10 +7597,10 @@ class rs {
7713
7597
  top: "0px",
7714
7598
  right: "0px",
7715
7599
  overflow: "hidden",
7716
- width: `${f + 1}px`,
7600
+ width: `${d + 1}px`,
7717
7601
  height: `${r}px`
7718
7602
  },
7719
- cells: d
7603
+ cells: f
7720
7604
  };
7721
7605
  return {
7722
7606
  type: "header",
@@ -7733,16 +7617,16 @@ class rs {
7733
7617
  getBody() {
7734
7618
  const t = [], e = [], i = [];
7735
7619
  let s = this.ctx.body.renderRows;
7736
- this.ctx.config.FOOTER_FIXED || (s = s.concat(this.ctx.footer.renderRows)), s.forEach((m) => {
7737
- m.cells.forEach((w) => {
7738
- w.cellType === "footer" && (w.render = w.renderFooter), w.render && (w.fixed === "left" ? e.push(w) : w.fixed === "right" ? i.push(w) : t.push(w));
7620
+ this.ctx.config.FOOTER_FIXED || (s = s.concat(this.ctx.footer.renderRows)), s.forEach((w) => {
7621
+ w.cells.forEach((m) => {
7622
+ m.cellType === "footer" && (m.render = m.renderFooter), m.render && (m.fixed === "left" ? e.push(m) : m.fixed === "right" ? i.push(m) : t.push(m));
7739
7623
  });
7740
7624
  });
7741
7625
  const {
7742
7626
  fixedLeftWidth: o,
7743
7627
  fixedRightWidth: r,
7744
7628
  config: { CSS_PREFIX: a }
7745
- } = this.ctx, l = B(this.ctx.config), { visibleWidth: c, visibleHeight: d } = this.ctx.body, f = r - l, u = {
7629
+ } = this.ctx, l = B(this.ctx.config), { visibleWidth: c, visibleHeight: f } = this.ctx.body, d = r - l, u = {
7746
7630
  key: "left",
7747
7631
  style: {
7748
7632
  position: "absolute",
@@ -7750,7 +7634,7 @@ class rs {
7750
7634
  left: `${0.5}px`,
7751
7635
  overflow: "hidden",
7752
7636
  width: `${o}px`,
7753
- height: `${d}px`
7637
+ height: `${f}px`
7754
7638
  },
7755
7639
  cells: e
7756
7640
  }, x = {
@@ -7760,8 +7644,8 @@ class rs {
7760
7644
  top: `${0.5}px`,
7761
7645
  left: `${o - 0.5}px`,
7762
7646
  overflow: "hidden",
7763
- width: `${c - o - f}px`,
7764
- height: `${d}px`
7647
+ width: `${c - o - d}px`,
7648
+ height: `${f}px`
7765
7649
  },
7766
7650
  cells: t
7767
7651
  }, g = {
@@ -7771,8 +7655,8 @@ class rs {
7771
7655
  top: "0px",
7772
7656
  right: "0px",
7773
7657
  overflow: "hidden",
7774
- width: `${f}px`,
7775
- height: `${d}px`
7658
+ width: `${d}px`,
7659
+ height: `${f}px`
7776
7660
  },
7777
7661
  cells: i
7778
7662
  };
@@ -7783,7 +7667,7 @@ class rs {
7783
7667
  position: "relative",
7784
7668
  overflow: "hidden",
7785
7669
  width: `${c}px`,
7786
- height: `${d}px`
7670
+ height: `${f}px`
7787
7671
  },
7788
7672
  views: [u, x, g]
7789
7673
  };
@@ -7791,15 +7675,15 @@ class rs {
7791
7675
  getFooter() {
7792
7676
  const t = [], e = [], i = [];
7793
7677
  this.ctx.footer.renderRows.forEach((E) => {
7794
- E.cells.forEach((m) => {
7795
- m.cellType === "footer" && m.renderFooter && (m.render = m.renderFooter, m.fixed === "left" ? e.push(m) : m.fixed === "right" ? i.push(m) : t.push(m));
7678
+ E.cells.forEach((w) => {
7679
+ w.cellType === "footer" && w.renderFooter && (w.render = w.renderFooter, w.fixed === "left" ? e.push(w) : w.fixed === "right" ? i.push(w) : t.push(w));
7796
7680
  });
7797
7681
  });
7798
7682
  const {
7799
7683
  fixedLeftWidth: s,
7800
7684
  fixedRightWidth: o,
7801
7685
  config: { CSS_PREFIX: r }
7802
- } = this.ctx, a = B(this.ctx.config), { visibleWidth: l, visibleHeight: c } = this.ctx.footer, d = o - a, f = {
7686
+ } = this.ctx, a = B(this.ctx.config), { visibleWidth: l, visibleHeight: c } = this.ctx.footer, f = o - a, d = {
7803
7687
  key: "left",
7804
7688
  style: {
7805
7689
  position: "absolute",
@@ -7817,7 +7701,7 @@ class rs {
7817
7701
  top: `${0.5}px`,
7818
7702
  left: `${s - 0.5}px`,
7819
7703
  overflow: "hidden",
7820
- width: `${l - s - d}px`,
7704
+ width: `${l - s - f}px`,
7821
7705
  height: `${c}px`
7822
7706
  },
7823
7707
  cells: t
@@ -7828,7 +7712,7 @@ class rs {
7828
7712
  top: `${0.5}px`,
7829
7713
  right: `${0.5}px`,
7830
7714
  overflow: "hidden",
7831
- width: `${d}px`,
7715
+ width: `${f}px`,
7832
7716
  height: `${c}px`
7833
7717
  },
7834
7718
  cells: i
@@ -7842,7 +7726,7 @@ class rs {
7842
7726
  width: `${l}px`,
7843
7727
  height: `${c}px`
7844
7728
  },
7845
- views: [f, u, x]
7729
+ views: [d, u, x]
7846
7730
  };
7847
7731
  }
7848
7732
  }
@@ -7935,13 +7819,13 @@ class ne {
7935
7819
  if (this.activeSubmenus.has(e)) return;
7936
7820
  this.activeSubmenus.add(e), e.classList.add("show");
7937
7821
  const i = At(t, e, async () => {
7938
- const s = this.container.getBoundingClientRect(), o = window.innerWidth, r = e.offsetWidth || 200, a = o - s.right, l = s.left, c = a >= r || a >= l ? "right-start" : "left-start", { x: d, y: f } = await Et(t, e, {
7822
+ const s = this.container.getBoundingClientRect(), o = window.innerWidth, r = e.offsetWidth || 200, a = o - s.right, l = s.left, c = a >= r || a >= l ? "right-start" : "left-start", { x: f, y: d } = await Et(t, e, {
7939
7823
  placement: c,
7940
- middleware: [mt(8), wt({ padding: 8 })]
7824
+ middleware: [wt(8), mt({ padding: 8 })]
7941
7825
  });
7942
7826
  Object.assign(e.style, {
7943
- left: `${d}px`,
7944
- top: `${f}px`
7827
+ left: `${f}px`,
7828
+ top: `${d}px`
7945
7829
  });
7946
7830
  });
7947
7831
  e._cleanup = i;
@@ -8007,7 +7891,7 @@ class ne {
8007
7891
  At(e, this.container, () => {
8008
7892
  Et(e, this.container, {
8009
7893
  placement: "right-start",
8010
- middleware: [mt(), wt(), Vt()]
7894
+ middleware: [wt(), mt(), Vt()]
8011
7895
  }).then(({ x: i, y: s }) => {
8012
7896
  this.container && Object.assign(this.container.style, {
8013
7897
  left: `${i}px`,
@@ -8069,7 +7953,7 @@ class ne {
8069
7953
  }), t.remove();
8070
7954
  }
8071
7955
  }
8072
- class ns {
7956
+ class os {
8073
7957
  constructor(t) {
8074
7958
  n(this, "ctx");
8075
7959
  n(this, "contextMenuEl");
@@ -8086,16 +7970,16 @@ class ns {
8086
7970
  return;
8087
7971
  }
8088
7972
  const { ENABLE_CONTEXT_MENU: i, CUSTOM_BODY_CONTEXT_MENU: s, CONTEXT_MENU: o, BEFORE_BODY_CONTEXT_MENU_METHOD: r } = this.ctx.config;
8089
- let a = o.map((w) => ({
8090
- ...w,
8091
- label: w.label || this.ctx.locale.getText(w.value)
7973
+ let a = o.map((m) => ({
7974
+ ...m,
7975
+ label: m.label || this.ctx.locale.getText(m.value)
8092
7976
  }));
8093
7977
  if (a = [...a, ...s], r && (a = await r({ list: a, cell: t, hide: this.hide.bind(this) })), !i || a.length === 0) return;
8094
7978
  e.preventDefault();
8095
- const { xArr: l, yArr: c } = this.ctx.selector, [d, f] = l, [u, x] = c, { rowIndex: g, colIndex: E } = t;
8096
- g >= u && g <= x && E >= d && E <= f || this.ctx.emit("setSelectorCell", t, e), this.currentDOMTreeMenu && this.currentDOMTreeMenu.destroy(), this.ctx.contextMenuIng = !0, this.currentDOMTreeMenu = new ne(this.contextMenuEl, a, {
8097
- onClick: (w, y) => {
8098
- y === "copy" ? (this.ctx.emit("contextMenuCopy"), this.hide()) : y === "paste" ? (this.ctx.emit("contextMenuPaste"), this.hide()) : y === "cut" ? (this.ctx.emit("contextMenuCut"), this.hide()) : y === "clearSelected" ? (this.ctx.emit("contextMenuClearSelected"), this.hide()) : w.event && w.event(e, {
7979
+ const { xArr: l, yArr: c } = this.ctx.selector, [f, d] = l, [u, x] = c, { rowIndex: g, colIndex: E } = t;
7980
+ g >= u && g <= x && E >= f && E <= d || this.ctx.emit("setSelectorCell", t, e), this.currentDOMTreeMenu && this.currentDOMTreeMenu.destroy(), this.ctx.contextMenuIng = !0, this.currentDOMTreeMenu = new ne(this.contextMenuEl, a, {
7981
+ onClick: (m, y) => {
7982
+ y === "copy" ? (this.ctx.emit("contextMenuCopy"), this.hide()) : y === "paste" ? (this.ctx.emit("contextMenuPaste"), this.hide()) : y === "cut" ? (this.ctx.emit("contextMenuCut"), this.hide()) : y === "clearSelected" ? (this.ctx.emit("contextMenuClearSelected"), this.hide()) : m.event && m.event(e, {
8099
7983
  hide: this.hide.bind(this),
8100
7984
  cell: t
8101
7985
  });
@@ -8109,30 +7993,30 @@ class ns {
8109
7993
  const { SELECTOR_AREA_MIN_X: i, SELECTOR_AREA_MAX_X: s, SELECTOR_AREA_MAX_X_OFFSET: o, BEFORE_HEADER_CONTEXT_MENU_METHOD: r } = this.ctx.config, a = i, l = s || this.ctx.maxColIndex - o;
8110
7994
  if (t.colIndex < a || t.colIndex > l)
8111
7995
  return;
8112
- const { HEADER_CONTEXT_MENU: c, CUSTOM_HEADER_CONTEXT_MENU: d, ENABLE_HEADER_CONTEXT_MENU: f } = this.ctx.config;
7996
+ const { HEADER_CONTEXT_MENU: c, CUSTOM_HEADER_CONTEXT_MENU: f, ENABLE_HEADER_CONTEXT_MENU: d } = this.ctx.config;
8113
7997
  let u = c.map((p) => ({
8114
7998
  ...p,
8115
7999
  label: p.label || this.ctx.locale.getText(p.value)
8116
8000
  }));
8117
- if (u = [...u, ...d], r && (u = await r({ list: u, cell: t, hide: this.hide.bind(this) })), !f || u.length === 0) return;
8001
+ if (u = [...u, ...f], r && (u = await r({ list: u, cell: t, hide: this.hide.bind(this) })), !d || u.length === 0) return;
8118
8002
  e.preventDefault();
8119
- const { xArr: x } = this.ctx.selector, [g, E] = x, { colIndex: m } = t;
8120
- m >= g && m <= E || (this.ctx.focusCellHeader = t, this.ctx.emit("selectCols", t)), this.currentDOMTreeMenu && this.currentDOMTreeMenu.destroy();
8003
+ const { xArr: x } = this.ctx.selector, [g, E] = x, { colIndex: w } = t;
8004
+ w >= g && w <= E || (this.ctx.focusCellHeader = t, this.ctx.emit("selectCols", t)), this.currentDOMTreeMenu && this.currentDOMTreeMenu.destroy();
8121
8005
  const y = this.ctx.database.getColumns(), b = u.map((p) => p.value === "visible" ? {
8122
8006
  ...p,
8123
8007
  children: this.filterColumns(y)
8124
8008
  } : p);
8125
8009
  this.ctx.contextMenuIng = !0, this.currentDOMTreeMenu = new ne(this.contextMenuEl, b, {
8126
8010
  onClick: (p, C) => {
8127
- const { xArr: v } = this.ctx.selector, [I, T] = v;
8011
+ const { xArr: I } = this.ctx.selector, [v, T] = I;
8128
8012
  if (C === "fixedLeft" || C === "fixedRight" || C === "fixedNone") {
8129
- const _ = this.ctx.header.allCellHeaders.filter((R) => R.colIndex >= I && R.colIndex <= T).filter((R) => R.level === 0).filter((R) => !R.column.fixedDisabled).map((R) => R.key);
8013
+ const _ = this.ctx.header.allCellHeaders.filter((R) => R.colIndex >= v && R.colIndex <= T).filter((R) => R.level === 0).filter((R) => !R.column.fixedDisabled).map((R) => R.key);
8130
8014
  this.ctx.database.setCustomHeaderFixedData(
8131
8015
  _,
8132
8016
  C === "fixedLeft" ? "left" : C === "fixedRight" ? "right" : ""
8133
8017
  ), this.hide();
8134
8018
  } else if (C === "hide") {
8135
- const _ = this.ctx.header.leafCellHeaders.filter((R) => R.colIndex >= I && R.colIndex <= T).filter((R) => !R.children.length).filter((R) => !R.column.hideDisabled).map((R) => R.key);
8019
+ const _ = this.ctx.header.leafCellHeaders.filter((R) => R.colIndex >= v && R.colIndex <= T).filter((R) => !R.children.length).filter((R) => !R.column.hideDisabled).map((R) => R.key);
8136
8020
  _.length > 0 && this.ctx.database.setCustomHeaderHideData(_, !0), this.hide();
8137
8021
  } else if (C !== "visible") if (C.startsWith("visible_")) {
8138
8022
  if (!p.key) return;
@@ -8171,7 +8055,7 @@ class ns {
8171
8055
  At(e, this.contextMenuEl, () => {
8172
8056
  Et(e, this.contextMenuEl, {
8173
8057
  placement: "right-start",
8174
- middleware: [mt(), wt(), Vt()]
8058
+ middleware: [wt(), mt(), Vt()]
8175
8059
  }).then(({ x: i, y: s }) => {
8176
8060
  this.contextMenuEl && Object.assign(this.contextMenuEl.style, {
8177
8061
  left: `${i}px`,
@@ -8207,7 +8091,7 @@ class ns {
8207
8091
  this.hide(), (t = this.contextMenuEl) == null || t.remove();
8208
8092
  }
8209
8093
  }
8210
- class as {
8094
+ class rs {
8211
8095
  constructor(t) {
8212
8096
  n(this, "ctx");
8213
8097
  n(this, "loadingEl");
@@ -8243,7 +8127,7 @@ class as {
8243
8127
  this.loadingEl.remove();
8244
8128
  }
8245
8129
  }
8246
- class ls {
8130
+ class ns {
8247
8131
  constructor(t) {
8248
8132
  n(this, "ctx");
8249
8133
  n(this, "container");
@@ -8496,11 +8380,11 @@ const it = class it {
8496
8380
  const c = s.filter((g) => g.line === l);
8497
8381
  if (!c.length)
8498
8382
  return null;
8499
- const d = 2, f = o + l * r;
8500
- if (i < f - d || i >= f + r + d)
8383
+ const f = 2, d = o + l * r;
8384
+ if (i < d - f || i >= d + r + f)
8501
8385
  return null;
8502
8386
  const u = c[0], x = c[c.length - 1];
8503
- if (e < u.x - d || e > x.x + x.width + d)
8387
+ if (e < u.x - f || e > x.x + x.width + f)
8504
8388
  return null;
8505
8389
  if (e <= u.x)
8506
8390
  return u.index;
@@ -8534,8 +8418,8 @@ const it = class it {
8534
8418
  r.save(), r.font = t.font, r.textBaseline = "top", r.textAlign = "left", o.forEach((a) => {
8535
8419
  const l = a[0], c = a[a.length - 1];
8536
8420
  r.fillStyle = s, r.fillRect(l.x, l.y - 1, c.x + c.width - l.x, l.height), r.fillStyle = i;
8537
- for (const d of a)
8538
- r.fillText(d.char, d.x, d.y);
8421
+ for (const f of a)
8422
+ r.fillText(f.char, f.x, f.y);
8539
8423
  }), r.restore();
8540
8424
  }
8541
8425
  getSelectionRange() {
@@ -8584,7 +8468,7 @@ const pt = class pt {
8584
8468
  o,
8585
8469
  r
8586
8470
  );
8587
- this.ctx = new di(a, this.options), this.textSelector = new Ht(this.ctx), this.header = new xi(this.ctx), this.footer = new mi(this.ctx), this.body = new gi(this.ctx), this.scroller = new fi(this.ctx), this.selector = new wi(this.ctx), this.autofill = new Ei(this.ctx), this.tooltip = new is(this.ctx), this.empty = new os(this.ctx), this.editor = new ss(this.ctx), this.overlayer = new rs(this.ctx), this.contextMenu = new ns(this.ctx), this.loading = new as(this.ctx), this.finderBar = new ls(this.ctx), this.ctx.on("loadData", (l) => {
8471
+ this.ctx = new ci(a, this.options), this.textSelector = new Ht(this.ctx), this.header = new fi(this.ctx), this.footer = new xi(this.ctx), this.body = new ui(this.ctx), this.scroller = new hi(this.ctx), this.selector = new gi(this.ctx), this.autofill = new wi(this.ctx), this.tooltip = new ts(this.ctx), this.empty = new is(this.ctx), this.editor = new es(this.ctx), this.overlayer = new ss(this.ctx), this.contextMenu = new os(this.ctx), this.loading = new rs(this.ctx), this.finderBar = new ns(this.ctx), this.ctx.on("loadData", (l) => {
8588
8472
  this.loadData(l);
8589
8473
  }), this.ctx.on("draw", () => {
8590
8474
  this.draw();
@@ -8601,15 +8485,15 @@ const pt = class pt {
8601
8485
  r.className = "e-virt-table-stage", t.tabIndex = 0, a.className = "e-virt-table-canvas", l.className = "e-virt-table-overlayer", l.setAttribute("data-overlayer", e ? "custom" : "default");
8602
8486
  const c = i || document.createElement("div");
8603
8487
  c.className = "e-virt-table-editor";
8604
- const d = s, f = o;
8488
+ const f = s, d = o;
8605
8489
  return r.appendChild(a), r.appendChild(l), t.appendChild(r), {
8606
8490
  containerElement: t,
8607
8491
  stageElement: r,
8608
8492
  canvasElement: a,
8609
8493
  overlayerElement: l,
8610
8494
  editorElement: c,
8611
- emptyElement: d,
8612
- contextMenuElement: f
8495
+ emptyElement: f,
8496
+ contextMenuElement: d
8613
8497
  };
8614
8498
  }
8615
8499
  doDraw(t = !1) {
@@ -8617,7 +8501,7 @@ const pt = class pt {
8617
8501
  }
8618
8502
  updateStageBorder() {
8619
8503
  const { BORDER: t, BORDER_COLOR: e, BORDER_RADIUS: i } = this.ctx.config;
8620
- this.ctx.stageElement.dataset.borderStyle = rt(t), this.ctx.stageElement.style.borderColor = ze(t) ? e : "transparent", this.ctx.stageElement.style.borderRadius = `${i}px`;
8504
+ this.ctx.stageElement.dataset.borderStyle = rt(t), this.ctx.stageElement.style.borderColor = Pe(t) ? e : "transparent", this.ctx.stageElement.style.borderRadius = `${i}px`;
8621
8505
  }
8622
8506
  draw(t = !1) {
8623
8507
  this.animationFrameId && cancelAnimationFrame(this.animationFrameId), this.animationFrameId = requestAnimationFrame(() => {
@@ -8685,16 +8569,6 @@ const pt = class pt {
8685
8569
  doLayout() {
8686
8570
  this.ctx.emit("draw");
8687
8571
  }
8688
- /**
8689
- * 设置内容缩放比例(容器大小不变,内容变大/变小,基于原生分辨率重绘不失清晰度)
8690
- * @param zoom 缩放比例,范围 MIN_ZOOM ~ MAX_ZOOM
8691
- */
8692
- setZoom(t) {
8693
- this.ctx.setZoom(t);
8694
- }
8695
- getZoom() {
8696
- return this.ctx.getZoom();
8697
- }
8698
8572
  getChangedData() {
8699
8573
  return this.ctx.database.getChangedData();
8700
8574
  }
@@ -8750,8 +8624,8 @@ const pt = class pt {
8750
8624
  if (Array.isArray(o) && o.length) {
8751
8625
  const [r] = o, { rowKey: a, key: l } = r, c = this.ctx.database.getRowForRowKey(a);
8752
8626
  if (c) {
8753
- const { parentRowKeys: d = [] } = c;
8754
- d && d.length && this.setExpandRowKeys(d, !0);
8627
+ const { parentRowKeys: f = [] } = c;
8628
+ f && f.length && this.setExpandRowKeys(f, !0);
8755
8629
  }
8756
8630
  this.scrollToRowkey(a), this.scrollToColkey(l);
8757
8631
  }
@@ -8786,8 +8660,8 @@ const pt = class pt {
8786
8660
  let o = [];
8787
8661
  for (let r = 0; r < i.length; r++)
8788
8662
  for (let a = 0; a < s.length; a++) {
8789
- const l = this.ctx.database.getRowKeyByItem(i[r]), d = s[a].key, f = await this.ctx.database.getValidator(l, d);
8790
- Array.isArray(f) && f.length && o.push(f);
8663
+ const l = this.ctx.database.getRowKeyByItem(i[r]), f = s[a].key, d = await this.ctx.database.getValidator(l, f);
8664
+ Array.isArray(d) && d.length && o.push(d);
8791
8665
  }
8792
8666
  o.length ? (e(o), this.ctx.emit("draw")) : (t([]), this.ctx.emit("draw"));
8793
8667
  });