e-virt-table 1.2.6 → 1.2.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.es.js CHANGED
@@ -25,7 +25,7 @@ function st(a, t) {
25
25
  return i.__proto__ = s, i;
26
26
  }, st(a, t);
27
27
  }
28
- function _e() {
28
+ function Ie() {
29
29
  if (typeof Reflect > "u" || !Reflect.construct || Reflect.construct.sham) return !1;
30
30
  if (typeof Proxy == "function") return !0;
31
31
  try {
@@ -36,20 +36,20 @@ function _e() {
36
36
  }
37
37
  }
38
38
  function dt(a, t, e) {
39
- return _e() ? dt = Reflect.construct.bind() : dt = function(s, r, o) {
39
+ return Ie() ? dt = Reflect.construct.bind() : dt = function(s, r, o) {
40
40
  var n = [null];
41
41
  n.push.apply(n, r);
42
42
  var h = Function.bind.apply(s, n), c = new h();
43
43
  return o && st(c, o.prototype), c;
44
44
  }, dt.apply(null, arguments);
45
45
  }
46
- function Ie(a) {
46
+ function _e(a) {
47
47
  return Function.toString.call(a).indexOf("[native code]") !== -1;
48
48
  }
49
49
  function Ct(a) {
50
50
  var t = typeof Map == "function" ? /* @__PURE__ */ new Map() : void 0;
51
51
  return Ct = function(i) {
52
- if (i === null || !Ie(i)) return i;
52
+ if (i === null || !_e(i)) return i;
53
53
  if (typeof i != "function")
54
54
  throw new TypeError("Super expression must either be null or a function");
55
55
  if (typeof t < "u") {
@@ -159,28 +159,28 @@ var Xt = /* @__PURE__ */ function(a) {
159
159
  }(/* @__PURE__ */ Ct(Error));
160
160
  function Te(a, t, e, i, s) {
161
161
  if (t.first) {
162
- var r = new Promise(function(u, g) {
162
+ var r = new Promise(function(x, g) {
163
163
  var p = function(m) {
164
- return i(m), m.length ? g(new Xt(m, bt(m))) : u(s);
165
- }, x = Ae(a);
166
- Ft(x, e, p);
164
+ return i(m), m.length ? g(new Xt(m, bt(m))) : x(s);
165
+ }, u = Ae(a);
166
+ Ft(u, e, p);
167
167
  });
168
- return r.catch(function(u) {
169
- return u;
168
+ return r.catch(function(x) {
169
+ return x;
170
170
  }), r;
171
171
  }
172
- var o = t.firstFields === !0 ? Object.keys(a) : t.firstFields || [], n = Object.keys(a), h = n.length, c = 0, d = [], f = new Promise(function(u, g) {
172
+ var o = t.firstFields === !0 ? Object.keys(a) : t.firstFields || [], n = Object.keys(a), h = n.length, c = 0, d = [], f = new Promise(function(x, g) {
173
173
  var p = function(w) {
174
174
  if (d.push.apply(d, w), c++, c === h)
175
- return i(d), d.length ? g(new Xt(d, bt(d))) : u(s);
175
+ return i(d), d.length ? g(new Xt(d, bt(d))) : x(s);
176
176
  };
177
- n.length || (i(d), u(s)), n.forEach(function(x) {
178
- var w = a[x];
179
- o.indexOf(x) !== -1 ? Ft(w, e, p) : Se(w, e, p);
177
+ n.length || (i(d), x(s)), n.forEach(function(u) {
178
+ var w = a[u];
179
+ o.indexOf(u) !== -1 ? Ft(w, e, p) : Se(w, e, p);
180
180
  });
181
181
  });
182
- return f.catch(function(u) {
183
- return u;
182
+ return f.catch(function(x) {
183
+ return x;
184
184
  }), f;
185
185
  }
186
186
  function Me(a) {
@@ -242,7 +242,7 @@ var Zt = function(t, e, i, s, r, o) {
242
242
  }, h.v6 = function(y) {
243
243
  return y && y.exact ? n : new RegExp("" + t(y) + s + t(y), "g");
244
244
  };
245
- var c = "(?:(?:[a-z]+:)?//)", d = "(?:\\S+(?::\\S*)?@)?", f = h.v4().source, u = h.v6().source, g = "(?:(?:[a-z\\u00a1-\\uffff0-9][-_]*)*[a-z\\u00a1-\\uffff0-9]+)", p = "(?:\\.(?:[a-z\\u00a1-\\uffff0-9]-*)*[a-z\\u00a1-\\uffff0-9]+)*", x = "(?:\\.(?:[a-z\\u00a1-\\uffff]{2,}))", w = "(?::\\d{2,5})?", m = '(?:[/?#][^\\s"]*)?', C = "(?:" + c + "|www\\.)" + d + "(?:localhost|" + f + "|" + u + "|" + g + p + x + ")" + w + m;
245
+ var c = "(?:(?:[a-z]+:)?//)", d = "(?:\\S+(?::\\S*)?@)?", f = h.v4().source, x = h.v6().source, g = "(?:(?:[a-z\\u00a1-\\uffff0-9][-_]*)*[a-z\\u00a1-\\uffff0-9]+)", p = "(?:\\.(?:[a-z\\u00a1-\\uffff0-9]-*)*[a-z\\u00a1-\\uffff0-9]+)*", u = "(?:\\.(?:[a-z\\u00a1-\\uffff]{2,}))", w = "(?::\\d{2,5})?", m = '(?:[/?#][^\\s"]*)?', C = "(?:" + c + "|www\\.)" + d + "(?:localhost|" + f + "|" + x + "|" + g + p + u + ")" + w + m;
246
246
  return ct = new RegExp("(?:^" + C + "$)", "i"), ct;
247
247
  }, Kt = {
248
248
  // http://emailregex.com/
@@ -300,8 +300,8 @@ var Zt = function(t, e, i, s, r, o) {
300
300
  var o = ["integer", "float", "array", "regexp", "object", "method", "email", "number", "date", "url", "hex"], n = t.type;
301
301
  o.indexOf(n) > -1 ? et[n](e) || s.push(D(r.messages.types[n], t.fullField, t.type)) : n && typeof e !== t.type && s.push(D(r.messages.types[n], t.fullField, t.type));
302
302
  }, Xe = function(t, e, i, s, r) {
303
- var o = typeof t.len == "number", n = typeof t.min == "number", h = typeof t.max == "number", c = /[\uD800-\uDBFF][\uDC00-\uDFFF]/g, d = e, f = null, u = typeof e == "number", g = typeof e == "string", p = Array.isArray(e);
304
- if (u ? f = "number" : g ? f = "string" : p && (f = "array"), !f)
303
+ var o = typeof t.len == "number", n = typeof t.min == "number", h = typeof t.max == "number", c = /[\uD800-\uDBFF][\uDC00-\uDFFF]/g, d = e, f = null, x = typeof e == "number", g = typeof e == "string", p = Array.isArray(e);
304
+ if (x ? f = "number" : g ? f = "string" : p && (f = "array"), !f)
305
305
  return !1;
306
306
  p && (d = e.length), g && (d = e.replace(c, "_").length), o ? d !== t.len && s.push(D(r.messages[f].len, t.fullField, t.len)) : n && !h && d < t.min ? s.push(D(r.messages[f].min, t.fullField, t.min)) : h && !n && d > t.max ? s.push(D(r.messages[f].max, t.fullField, t.max)) : n && h && (d < t.min || d > t.max) && s.push(D(r.messages[f].range, t.fullField, t.min, t.max));
307
307
  }, j = "enum", Be = function(t, e, i, s, r) {
@@ -536,7 +536,7 @@ var Rt = vt(), nt = /* @__PURE__ */ function() {
536
536
  var n = i, h = s, c = r;
537
537
  if (typeof h == "function" && (c = h, h = {}), !this.rules || Object.keys(this.rules).length === 0)
538
538
  return c && c(null, n), Promise.resolve(n);
539
- function d(x) {
539
+ function d(u) {
540
540
  var w = [], m = {};
541
541
  function C(b) {
542
542
  if (Array.isArray(b)) {
@@ -545,8 +545,8 @@ var Rt = vt(), nt = /* @__PURE__ */ function() {
545
545
  } else
546
546
  w.push(b);
547
547
  }
548
- for (var y = 0; y < x.length; y++)
549
- C(x[y]);
548
+ for (var y = 0; y < u.length; y++)
549
+ C(u[y]);
550
550
  w.length ? (m = bt(w), c(w, m)) : c(null, n);
551
551
  }
552
552
  if (h.messages) {
@@ -554,54 +554,54 @@ var Rt = vt(), nt = /* @__PURE__ */ function() {
554
554
  f === Rt && (f = vt()), kt(f, h.messages), h.messages = f;
555
555
  } else
556
556
  h.messages = this.messages();
557
- var u = {}, g = h.keys || Object.keys(this.rules);
558
- g.forEach(function(x) {
559
- var w = o.rules[x], m = n[x];
557
+ var x = {}, g = h.keys || Object.keys(this.rules);
558
+ g.forEach(function(u) {
559
+ var w = o.rules[u], m = n[u];
560
560
  w.forEach(function(C) {
561
561
  var y = C;
562
- typeof y.transform == "function" && (n === i && (n = q({}, n)), m = n[x] = y.transform(m)), typeof y == "function" ? y = {
562
+ typeof y.transform == "function" && (n === i && (n = q({}, n)), m = n[u] = y.transform(m)), typeof y == "function" ? y = {
563
563
  validator: y
564
- } : y = q({}, y), y.validator = o.getValidationMethod(y), y.validator && (y.field = x, y.fullField = y.fullField || x, y.type = o.getType(y), u[x] = u[x] || [], u[x].push({
564
+ } : y = q({}, y), y.validator = o.getValidationMethod(y), y.validator && (y.field = u, y.fullField = y.fullField || u, y.type = o.getType(y), x[u] = x[u] || [], x[u].push({
565
565
  rule: y,
566
566
  value: m,
567
567
  source: n,
568
- field: x
568
+ field: u
569
569
  }));
570
570
  });
571
571
  });
572
572
  var p = {};
573
- return Te(u, h, function(x, w) {
574
- var m = x.rule, C = (m.type === "object" || m.type === "array") && (typeof m.fields == "object" || typeof m.defaultField == "object");
575
- C = C && (m.required || !m.required && x.value), m.field = x.field;
576
- function y(v, I) {
577
- return q({}, I, {
573
+ return Te(x, h, function(u, w) {
574
+ var m = u.rule, C = (m.type === "object" || m.type === "array") && (typeof m.fields == "object" || typeof m.defaultField == "object");
575
+ C = C && (m.required || !m.required && u.value), m.field = u.field;
576
+ function y(v, _) {
577
+ return q({}, _, {
578
578
  fullField: m.fullField + "." + v,
579
579
  fullFields: m.fullFields ? [].concat(m.fullFields, [v]) : [v]
580
580
  });
581
581
  }
582
582
  function b(v) {
583
583
  v === void 0 && (v = []);
584
- var I = Array.isArray(v) ? v : [v];
585
- !h.suppressWarning && I.length && a.warning("async-validator:", I), I.length && m.message !== void 0 && (I = [].concat(m.message));
586
- var L = I.map(Bt(m, n));
584
+ var _ = Array.isArray(v) ? v : [v];
585
+ !h.suppressWarning && _.length && a.warning("async-validator:", _), _.length && m.message !== void 0 && (_ = [].concat(m.message));
586
+ var L = _.map(Bt(m, n));
587
587
  if (h.first && L.length)
588
588
  return p[m.field] = 1, w(L);
589
589
  if (!C)
590
590
  w(L);
591
591
  else {
592
- if (m.required && !x.value)
592
+ if (m.required && !u.value)
593
593
  return m.message !== void 0 ? L = [].concat(m.message).map(Bt(m, n)) : h.error && (L = [h.error(m, D(h.messages.required, m.field))]), w(L);
594
- var _ = {};
595
- m.defaultField && Object.keys(x.value).map(function(S) {
596
- _[S] = m.defaultField;
597
- }), _ = q({}, _, x.rule.fields);
594
+ var I = {};
595
+ m.defaultField && Object.keys(u.value).map(function(S) {
596
+ I[S] = m.defaultField;
597
+ }), I = q({}, I, u.rule.fields);
598
598
  var R = {};
599
- Object.keys(_).forEach(function(S) {
600
- var M = _[S], T = Array.isArray(M) ? M : [M];
599
+ Object.keys(I).forEach(function(S) {
600
+ var M = I[S], T = Array.isArray(M) ? M : [M];
601
601
  R[S] = T.map(y.bind(null, S));
602
602
  });
603
603
  var A = new a(R);
604
- A.messages(h.messages), x.rule.options && (x.rule.options.messages = h.messages, x.rule.options.error = h.error), A.validate(x.value, x.rule.options || h, function(S) {
604
+ A.messages(h.messages), u.rule.options && (u.rule.options.messages = h.messages, u.rule.options.error = h.error), A.validate(u.value, u.rule.options || h, function(S) {
605
605
  var M = [];
606
606
  L && L.length && M.push.apply(M, L), S && S.length && M.push.apply(M, S), w(M.length ? M : null);
607
607
  });
@@ -609,10 +609,10 @@ var Rt = vt(), nt = /* @__PURE__ */ function() {
609
609
  }
610
610
  var E;
611
611
  if (m.asyncValidator)
612
- E = m.asyncValidator(m, x.value, b, x.source, h);
612
+ E = m.asyncValidator(m, u.value, b, u.source, h);
613
613
  else if (m.validator) {
614
614
  try {
615
- E = m.validator(m, x.value, b, x.source, h);
615
+ E = m.validator(m, u.value, b, u.source, h);
616
616
  } catch (v) {
617
617
  console.error == null || console.error(v), h.suppressValidatorError || setTimeout(function() {
618
618
  throw v;
@@ -625,8 +625,8 @@ var Rt = vt(), nt = /* @__PURE__ */ function() {
625
625
  }, function(v) {
626
626
  return b(v);
627
627
  });
628
- }, function(x) {
629
- d(x);
628
+ }, function(u) {
629
+ d(u);
630
630
  }, n);
631
631
  }, t.getType = function(i) {
632
632
  if (i.type === void 0 && i.pattern instanceof RegExp && (i.type = "pattern"), typeof i.validator != "function" && i.type && !it.hasOwnProperty(i.type))
@@ -702,10 +702,10 @@ function ee(a = [], t = 1, e = 0) {
702
702
  };
703
703
  });
704
704
  }
705
- function _t(a = []) {
705
+ function It(a = []) {
706
706
  let t = [];
707
707
  return a.forEach((e) => {
708
- e.children ? t = t.concat(_t(e.children)) : t.push(e);
708
+ e.children ? t = t.concat(It(e.children)) : t.push(e);
709
709
  }), t;
710
710
  }
711
711
  const Yt = /^(\r\n|\n\r|\r|\n)/, ii = /^[^\t\r\n]+/, Vt = /^\t/;
@@ -1019,19 +1019,19 @@ class Tt extends re {
1019
1019
  const { CELL_PADDING: e = 0 } = this.ctx.config, { rowKey: i, cellType: s } = this;
1020
1020
  let r, o = 0, n = "";
1021
1021
  if (this.type === "tree" && s === "body") {
1022
- const h = this.ctx.database.getRowForRowKey(i), { expand: c = !1, hasChildren: d = !1, expandLoading: f = !1, level: u = 0 } = h || {};
1022
+ const h = this.ctx.database.getRowForRowKey(i), { expand: c = !1, hasChildren: d = !1, expandLoading: f = !1, level: x = 0 } = h || {};
1023
1023
  if (this.rowExpand = c, this.rowHasChildren = d, f) {
1024
- const x = this.ctx.icons.get("loading");
1025
- n = "loading", r = x, o = u * 8;
1024
+ const u = this.ctx.icons.get("loading");
1025
+ n = "loading", r = u, o = x * 8;
1026
1026
  } else if (d) {
1027
- const x = this.ctx.icons.get("expand"), w = this.ctx.icons.get("shrink");
1028
- r = c ? w : x, n = c ? "shrink" : "expand", o = u * 8;
1027
+ const u = this.ctx.icons.get("expand"), w = this.ctx.icons.get("shrink");
1028
+ r = c ? w : u, n = c ? "shrink" : "expand", o = x * 8;
1029
1029
  } else
1030
- o = u * 8;
1030
+ o = x * 8;
1031
1031
  let g = 20, p = 20;
1032
1032
  if (r) {
1033
- let x = this.drawX + o + e, w = this.drawY + (this.visibleHeight - p) / 2;
1034
- this.ctx.paint.drawImage(r, x, w, g, p), this.drawImageX = x, this.drawImageY = w, this.drawImageWidth = g, this.drawImageHeight = p, this.drawImageName = n, this.drawImageSource = r;
1033
+ let u = this.drawX + o + e, w = this.drawY + (this.visibleHeight - p) / 2;
1034
+ this.ctx.paint.drawImage(r, u, w, g, p), this.drawImageX = u, this.drawImageY = w, this.drawImageWidth = g, this.drawImageHeight = p, this.drawImageName = n, this.drawImageSource = r;
1035
1035
  }
1036
1036
  this.align = "left", this.drawTextX = o + this.drawX + g - 0.5;
1037
1037
  }
@@ -1048,35 +1048,35 @@ class Tt extends re {
1048
1048
  HIGHLIGHT_SELECTED_ROW_COLOR: c,
1049
1049
  HIGHLIGHT_HOVER_ROW: d,
1050
1050
  HIGHLIGHT_HOVER_ROW_COLOR: f,
1051
- STRIPE: u,
1051
+ STRIPE: x,
1052
1052
  STRIPE_COLOR: g
1053
1053
  } = this.ctx.config;
1054
1054
  if (this.cellType === "footer") {
1055
1055
  let E = n, v = o;
1056
1056
  if (typeof r == "function") {
1057
- const I = r, { backgroundColor: L, color: _ } = I({
1057
+ const _ = r, { backgroundColor: L, color: I } = _({
1058
1058
  row: this.row,
1059
1059
  rowIndex: this.rowIndex,
1060
1060
  colIndex: this.colIndex,
1061
1061
  column: this.column,
1062
1062
  value: this.getValue()
1063
1063
  }) || {};
1064
- L && (E = L), _ && (v = _);
1064
+ L && (E = L), I && (v = I);
1065
1065
  }
1066
1066
  this.drawCellSkyBgColor = "transparent", this.drawCellBgColor = E, this.drawTextColor = v;
1067
1067
  return;
1068
1068
  }
1069
1069
  let p = "transparent";
1070
- const x = this.ctx.focusCell, w = this.ctx.hoverCell;
1070
+ const u = this.ctx.focusCell, w = this.ctx.hoverCell;
1071
1071
  let m = this.rowIndex, C = this.rowIndex;
1072
1072
  if (this.rowspan !== 1 && (d || h)) {
1073
1073
  const E = this.getSpanInfo(), { yArr: v } = E;
1074
1074
  m = v[0], C = v[1];
1075
1075
  }
1076
- d && w && (w.rowKey === this.rowKey && (p = f), w.rowIndex >= m && w.rowIndex <= C && (p = f)), h && x && (x.rowKey === this.rowKey && (p = c), x.rowIndex >= m && x.rowIndex <= C && (p = c)), this.drawCellSkyBgColor = p;
1076
+ d && w && (w.rowKey === this.rowKey && (p = f), w.rowIndex >= m && w.rowIndex <= C && (p = f)), h && u && (u.rowKey === this.rowKey && (p = c), u.rowIndex >= m && u.rowIndex <= C && (p = c)), this.drawCellSkyBgColor = p;
1077
1077
  let y = e, b = o;
1078
- if (this.ctx.database.getReadonly(this.rowKey, this.key) || (y = i, b = o), u && (this.rowIndex % 2 ? y = g : y = e), typeof s == "function") {
1079
- const E = s, { backgroundColor: v, color: I } = E({
1078
+ if (this.ctx.database.getReadonly(this.rowKey, this.key) || (y = i, b = o), x && (this.rowIndex % 2 ? y = g : y = e), typeof s == "function") {
1079
+ const E = s, { backgroundColor: v, color: _ } = E({
1080
1080
  row: this.row,
1081
1081
  rowIndex: this.rowIndex,
1082
1082
  colIndex: this.colIndex,
@@ -1084,16 +1084,16 @@ class Tt extends re {
1084
1084
  isHasChanged: this.isHasChanged,
1085
1085
  value: this.getValue()
1086
1086
  }) || {};
1087
- v && (y = v), I && (b = I);
1087
+ v && (y = v), _ && (b = _);
1088
1088
  }
1089
1089
  this.drawCellBgColor = y, this.drawTextColor = b;
1090
1090
  }
1091
1091
  updateSelection() {
1092
1092
  const { visibleWidth: e, visibleHeight: i, rowspan: s, colspan: r, cellType: o, type: n, rowIndex: h, rowKey: c } = this;
1093
1093
  if (!(s === 0 || r === 0) && o !== "footer" && ["index-selection", "selection"].includes(n)) {
1094
- const d = this.ctx.database.getRowSelection(c), f = this.ctx.database.getRowSelectable(c), { CHECKBOX_SIZE: u = 0 } = this.ctx.config, g = this.drawX + (e - u) / 2, p = this.drawY + (i - u) / 2;
1095
- let x = this.ctx.icons.get("checkbox-uncheck"), w = "checkbox-uncheck";
1096
- d && f ? (x = this.ctx.icons.get("checkbox-check"), w = "checkbox-check") : d && f ? (x = this.ctx.icons.get("checkbox-check-disabled"), w = "checkbox-check-disabled") : !d && f ? (x = this.ctx.icons.get("checkbox-uncheck"), w = "checkbox-uncheck") : (x = this.ctx.icons.get("checkbox-disabled"), w = "checkbox-disabled"), x && n == "index-selection" ? (this.ctx.hoverCell && this.ctx.hoverCell.rowIndex === h || ["checkbox-disabled", "checkbox-check"].includes(w)) && (this.drawImageX = g, this.drawImageY = p, this.drawImageWidth = u, this.drawImageHeight = u, this.drawImageName = w, this.drawImageSource = x) : x && n === "selection" && (this.drawImageX = g, this.drawImageY = p, this.drawImageWidth = u, this.drawImageHeight = u, this.drawImageName = w, this.drawImageSource = x);
1094
+ const d = this.ctx.database.getRowSelection(c), f = this.ctx.database.getRowSelectable(c), { CHECKBOX_SIZE: x = 0 } = this.ctx.config, g = this.drawX + (e - x) / 2, p = this.drawY + (i - x) / 2;
1095
+ let u = this.ctx.icons.get("checkbox-uncheck"), w = "checkbox-uncheck";
1096
+ d && f ? (u = this.ctx.icons.get("checkbox-check"), w = "checkbox-check") : d && f ? (u = this.ctx.icons.get("checkbox-check-disabled"), w = "checkbox-check-disabled") : !d && f ? (u = this.ctx.icons.get("checkbox-uncheck"), w = "checkbox-uncheck") : (u = this.ctx.icons.get("checkbox-disabled"), w = "checkbox-disabled"), u && n == "index-selection" ? (this.ctx.hoverCell && this.ctx.hoverCell.rowIndex === h || ["checkbox-disabled", "checkbox-check"].includes(w)) && (this.drawImageX = g, this.drawImageY = p, this.drawImageWidth = x, this.drawImageHeight = x, this.drawImageName = w, this.drawImageSource = u) : u && n === "selection" && (this.drawImageX = g, this.drawImageY = p, this.drawImageWidth = x, this.drawImageHeight = x, this.drawImageName = w, this.drawImageSource = u);
1097
1097
  }
1098
1098
  }
1099
1099
  updateHoverIcon() {
@@ -1114,10 +1114,10 @@ class Tt extends re {
1114
1114
  if (this.hoverIconName && !this.ctx.editing && n) {
1115
1115
  let h = 0, c = 0;
1116
1116
  if (n.rowKey === this.rowKey && (h = this.drawX + this.width - s - r, c = this.drawY + (this.height - s) / 2), this.rowspan !== 1 && o) {
1117
- const f = this.getSpanInfo(), { yArr: u } = f, g = u[0], p = u[1];
1117
+ const f = this.getSpanInfo(), { yArr: x } = f, g = x[0], p = x[1];
1118
1118
  if (n.rowIndex >= g && n.rowIndex <= p) {
1119
- const { width: x, height: w, offsetTop: m, offsetLeft: C } = f;
1120
- h = this.drawX - C + x - s - r, c = this.drawY - m + (w - s) / 2;
1119
+ const { width: u, height: w, offsetTop: m, offsetLeft: C } = f;
1120
+ h = this.drawX - C + u - s - r, c = this.drawY - m + (w - s) / 2;
1121
1121
  }
1122
1122
  }
1123
1123
  const d = this.ctx.icons.get(this.hoverIconName);
@@ -1216,10 +1216,10 @@ class Tt extends re {
1216
1216
  const { SELECT_BORDER_COLOR: e, ENABLE_AUTOFILL: i, ENABLE_SELECTOR: s, AUTOFILL_POINT_BORDER_COLOR: r } = this.ctx.config;
1217
1217
  if (!s || !i || this.ctx.editing)
1218
1218
  return;
1219
- const { xArr: o, yArr: n } = this.ctx.selector, h = o[1], c = n[1], { colIndex: d, rowIndex: f, drawX: u, drawY: g } = this;
1219
+ const { xArr: o, yArr: n } = this.ctx.selector, h = o[1], c = n[1], { colIndex: d, rowIndex: f, drawX: x, drawY: g } = this;
1220
1220
  if (d === h && f === c) {
1221
- const x = d === this.ctx.maxColIndex || f === this.ctx.maxRowIndex || d === this.ctx.lastCenterColIndex ? 6 : 4;
1222
- this.ctx.paint.drawRect(u + this.width - x, g + this.height - x, 6, 6, {
1221
+ const u = d === this.ctx.maxColIndex || f === this.ctx.maxRowIndex || d === this.ctx.lastCenterColIndex ? 6 : 4;
1222
+ this.ctx.paint.drawRect(x + this.width - u, g + this.height - u, 6, 6, {
1223
1223
  borderColor: r,
1224
1224
  fillColor: e
1225
1225
  });
@@ -1340,11 +1340,11 @@ class Tt extends re {
1340
1340
  drawBorder(e) {
1341
1341
  const { drawX: i, drawY: s, rowIndex: r, colIndex: o, height: n, width: h } = this;
1342
1342
  let c = i, d = s;
1343
- const { xArr: f, yArr: u, lineDash: g = [], borderWidth: p = 1, borderColor: x, fillColor: w } = e, m = f[0], C = f[1], y = u[0], b = u[1];
1343
+ const { xArr: f, yArr: x, lineDash: g = [], borderWidth: p = 1, borderColor: u, fillColor: w } = e, m = f[0], C = f[1], y = x[0], b = x[1];
1344
1344
  if (o >= m && o <= C && r === y) {
1345
1345
  const E = o === C ? 1 : 0, v = o === m ? 1 : 0;
1346
1346
  this.ctx.paint.drawLine([c + v, d + 1, c + h - E, d + 1], {
1347
- borderColor: x,
1347
+ borderColor: u,
1348
1348
  fillColor: w,
1349
1349
  borderWidth: p,
1350
1350
  lineCap: "round",
@@ -1355,7 +1355,7 @@ class Tt extends re {
1355
1355
  if (o === C && r >= y && r <= b) {
1356
1356
  const E = r === y ? 1 : 0, v = r === b ? 1 : 0;
1357
1357
  this.ctx.paint.drawLine([c + h - 1, d + E, c + h - 1, d + n - v], {
1358
- borderColor: x,
1358
+ borderColor: u,
1359
1359
  fillColor: w,
1360
1360
  borderWidth: p,
1361
1361
  lineCap: "round",
@@ -1366,7 +1366,7 @@ class Tt extends re {
1366
1366
  if (o >= m && o <= C && r === b) {
1367
1367
  const E = o === C ? 1 : 0, v = o === m ? 1 : 0;
1368
1368
  this.ctx.paint.drawLine([c + v, d + n - 1, c + h - E, d + n - 1], {
1369
- borderColor: x,
1369
+ borderColor: u,
1370
1370
  fillColor: w,
1371
1371
  borderWidth: p,
1372
1372
  lineCap: "round",
@@ -1377,7 +1377,7 @@ class Tt extends re {
1377
1377
  if (o === m && r >= y && r <= b) {
1378
1378
  const E = r === b ? 1 : 0, v = r === y ? 1 : 0;
1379
1379
  this.ctx.paint.drawLine([c + 1, d + v, c + 1, d + n - E], {
1380
- borderColor: x,
1380
+ borderColor: u,
1381
1381
  fillColor: w,
1382
1382
  borderWidth: p,
1383
1383
  lineCap: "round",
@@ -1399,6 +1399,7 @@ class li {
1399
1399
  l(this, "colIndexKeyMap", /* @__PURE__ */ new Map());
1400
1400
  l(this, "headerMap", /* @__PURE__ */ new Map());
1401
1401
  l(this, "rowIndexRowKeyMap", /* @__PURE__ */ new Map());
1402
+ l(this, "rowKeyRowIndexMap", /* @__PURE__ */ new Map());
1402
1403
  l(this, "checkboxKeyMap", /* @__PURE__ */ new Map());
1403
1404
  l(this, "selectionMap", /* @__PURE__ */ new Map());
1404
1405
  l(this, "originalDataMap", /* @__PURE__ */ new Map());
@@ -1420,7 +1421,7 @@ class li {
1420
1421
  this.data = i, this.footerData = r, this.columns = s, this.setLoading(!0), this.init();
1421
1422
  }
1422
1423
  init() {
1423
- this.clearBufferData(), this.rowKeyMap.clear(), this.checkboxKeyMap.clear(), this.colIndexKeyMap.clear(), this.rowIndexRowKeyMap.clear(), this.originalDataMap.clear(), this.changedDataMap.clear(), this.validationErrorMap.clear(), this.itemRowKeyMap = /* @__PURE__ */ new WeakMap();
1424
+ this.clearBufferData(), this.rowKeyMap.clear(), this.checkboxKeyMap.clear(), this.colIndexKeyMap.clear(), this.rowIndexRowKeyMap.clear(), this.rowKeyRowIndexMap.clear(), this.originalDataMap.clear(), this.changedDataMap.clear(), this.validationErrorMap.clear(), this.itemRowKeyMap = /* @__PURE__ */ new WeakMap();
1424
1425
  const { ROW_KEY: t, ENABLE_RESERVE_SELECTION: e } = this.ctx.config;
1425
1426
  e && t || this.selectionMap.clear(), this.initData(this.data), this.getData(), this.bufferCheckState.buffer = !1;
1426
1427
  }
@@ -1440,30 +1441,30 @@ class li {
1440
1441
  var w;
1441
1442
  let r = i._hasChildren || !1;
1442
1443
  Array.isArray(i.children) && i.children.length && (r = !0, this.initData(i.children, e + 1));
1443
- const { ROW_KEY: o = "", DEFAULT_EXPAND_ALL: n, CELL_HEIGHT: h, SELECTABLE_METHOD: c, CHECKBOX_KEY: d } = this.ctx.config, f = i[o], u = f != null ? `${f}` : Jt();
1444
- this.itemRowKeyMap.set(i, u);
1444
+ const { ROW_KEY: o = "", DEFAULT_EXPAND_ALL: n, CELL_HEIGHT: h, SELECTABLE_METHOD: c, CHECKBOX_KEY: d } = this.ctx.config, f = i[o], x = f != null ? `${f}` : Jt();
1445
+ this.itemRowKeyMap.set(i, x);
1445
1446
  const g = i._height || h, p = i._readonly;
1446
- let x = !0;
1447
- if (typeof c == "function" && (x = c), d) {
1447
+ let u = !0;
1448
+ if (typeof c == "function" && (u = c), d) {
1448
1449
  const m = i[d];
1449
1450
  if (this.checkboxKeyMap.has(m)) {
1450
1451
  const C = this.checkboxKeyMap.get(m) || [];
1451
- C.push(u), this.checkboxKeyMap.set(m, C);
1452
+ C.push(x), this.checkboxKeyMap.set(m, C);
1452
1453
  } else
1453
- this.checkboxKeyMap.set(m, [u]);
1454
+ this.checkboxKeyMap.set(m, [x]);
1454
1455
  }
1455
- this.selectionMap.set(u, {
1456
- key: d ? i[d] : u,
1456
+ this.selectionMap.set(x, {
1457
+ key: d ? i[d] : x,
1457
1458
  row: i,
1458
- check: ((w = this.selectionMap.get(u)) == null ? void 0 : w.check) || !1
1459
- }), this.rowKeyMap.set(u, {
1459
+ check: ((w = this.selectionMap.get(x)) == null ? void 0 : w.check) || !1
1460
+ }), this.rowKeyMap.set(x, {
1460
1461
  readonly: p,
1461
1462
  index: s,
1462
1463
  rowIndex: s,
1463
1464
  level: e,
1464
1465
  height: g,
1465
1466
  check: !1,
1466
- selectable: x,
1467
+ selectable: u,
1467
1468
  expand: n,
1468
1469
  expandLazy: !1,
1469
1470
  hasChildren: r,
@@ -1532,14 +1533,14 @@ class li {
1532
1533
  r.forEach((o) => {
1533
1534
  t.push(o);
1534
1535
  const n = this.itemRowKeyMap.get(o), { expand: h, hasChildren: c, height: d } = this.rowKeyMap.get(n), f = this.sumHeight;
1535
- this.sumHeight += d, this.rowIndexRowKeyMap.set(e, n), this.positions.push({
1536
+ this.sumHeight += d, this.rowIndexRowKeyMap.set(e, n), this.rowKeyRowIndexMap.set(n, e), this.positions.push({
1536
1537
  top: f,
1537
1538
  height: d,
1538
1539
  bottom: this.sumHeight
1539
1540
  }), e += 1, h && c && i(o.children);
1540
1541
  });
1541
1542
  };
1542
- this.rowIndexRowKeyMap.clear();
1543
+ this.rowIndexRowKeyMap.clear(), this.rowKeyRowIndexMap.clear();
1543
1544
  let s = this.data;
1544
1545
  return typeof this.filterMethod == "function" && (s = this.filterMethod(s)), i(s), this.bufferData = t, {
1545
1546
  data: t,
@@ -1637,7 +1638,7 @@ class li {
1637
1638
  return this.itemRowKeyMap.get(t);
1638
1639
  }
1639
1640
  getRowIndexForRowKey(t) {
1640
- return this.rowKeyMap.get(t).index;
1641
+ return this.rowKeyRowIndexMap.get(t);
1641
1642
  }
1642
1643
  /**
1643
1644
  * 根据rowIndex和colIndex获取单元格数据
@@ -1675,19 +1676,19 @@ class li {
1675
1676
  let i = [];
1676
1677
  const s = /* @__PURE__ */ new Set();
1677
1678
  let r = [], o = t.map((d) => {
1678
- const { rowKey: f, key: u } = d;
1679
+ const { rowKey: f, key: x } = d;
1679
1680
  let g = d.value, p = g;
1680
- const x = this.getRowDataItemForRowKey(f), w = this.getItemValue(f, u), m = this.getVirtualBodyCellByKey(f, u);
1681
+ const u = this.getRowDataItemForRowKey(f), w = this.getItemValue(f, x), m = this.getVirtualBodyCellByKey(f, x);
1681
1682
  return (m == null ? void 0 : m.type) === "number" && (["", void 0, null].includes(g) ? p = null : /^-?\d+(\.\d+)?$/.test(`${g}`) ? p = Number(g) : (p = w, r.push({
1682
1683
  ...d,
1683
1684
  value: p,
1684
1685
  oldValue: w,
1685
- row: x
1686
+ row: u
1686
1687
  }))), {
1687
1688
  ...d,
1688
1689
  value: p,
1689
1690
  oldValue: w,
1690
- row: x
1691
+ row: u
1691
1692
  };
1692
1693
  });
1693
1694
  if (o = o.filter((d) => !r.some((f) => d.rowKey === f.rowKey && d.key === f.key)), r.length) {
@@ -1702,9 +1703,9 @@ class li {
1702
1703
  return;
1703
1704
  const { BEFORE_VALUE_CHANGE_METHOD: n } = this.ctx.config;
1704
1705
  typeof n == "function" && (o = await n(o)), o.forEach((d) => {
1705
- const { value: f, rowKey: u, key: g, oldValue: p } = d;
1706
- s.add(u), this.setItemValue(u, g, f), i.push({
1707
- rowKey: u,
1706
+ const { value: f, rowKey: x, key: g, oldValue: p } = d;
1707
+ s.add(x), this.setItemValue(x, g, f), i.push({
1708
+ rowKey: x,
1708
1709
  key: g,
1709
1710
  oldValue: p,
1710
1711
  newValue: f
@@ -1747,7 +1748,7 @@ class li {
1747
1748
  n[e] !== null && typeof n[e] == "object" && (h = JSON.parse(JSON.stringify(n[e])));
1748
1749
  const d = `${t}​_${e}`;
1749
1750
  this.originalDataMap.has(d) || this.originalDataMap.set(d, h);
1750
- const f = this.originalDataMap.get(d), u = this.getRowDataItemForRowKey(t);
1751
+ const f = this.originalDataMap.get(d), x = this.getRowDataItemForRowKey(t);
1751
1752
  if (o) {
1752
1753
  const g = this.getVirtualBodyCellByKey(t, e);
1753
1754
  if ((g == null ? void 0 : g.type) === "number")
@@ -1766,7 +1767,7 @@ class li {
1766
1767
  key: e,
1767
1768
  value: c,
1768
1769
  oldValue: h,
1769
- row: u
1770
+ row: x
1770
1771
  }
1771
1772
  ]
1772
1773
  };
@@ -1785,28 +1786,28 @@ class li {
1785
1786
  key: e,
1786
1787
  value: c,
1787
1788
  oldValue: n[e],
1788
- row: u
1789
+ row: x
1789
1790
  }
1790
1791
  ]);
1791
1792
  m && m.length && (c = m[0].value);
1792
1793
  }
1793
1794
  this.changedDataMap.set(d, c), n[e] = c;
1794
- const x = {
1795
+ const u = {
1795
1796
  rowKey: t,
1796
1797
  key: e,
1797
1798
  oldValue: h,
1798
1799
  value: c,
1799
- row: u
1800
+ row: x
1800
1801
  };
1801
1802
  this.getValidator(t, e).then(() => {
1802
1803
  this.validationErrorMap.size === 0 && this.changedDataMap.size > 0 && this.ctx.emit("validateChangedData", this.getChangedData());
1803
- }), this.ctx.emit("change", [x], [u]), this.ctx.emit("editChange", {
1804
+ }), this.ctx.emit("change", [u], [x]), this.ctx.emit("editChange", {
1804
1805
  rowKey: t,
1805
1806
  key: e,
1806
1807
  oldValue: h,
1807
1808
  value: c,
1808
1809
  originalValue: f,
1809
- row: u
1810
+ row: x
1810
1811
  });
1811
1812
  } else
1812
1813
  this.changedDataMap.set(d, c), n[e] = c;
@@ -1816,7 +1817,7 @@ class li {
1816
1817
  oldValue: h,
1817
1818
  value: c,
1818
1819
  originalValue: this.originalDataMap.get(d),
1819
- row: u
1820
+ row: x
1820
1821
  }), s && this.ctx.history.pushState({
1821
1822
  type: "single",
1822
1823
  scrollX: this.ctx.scrollX,
@@ -1945,14 +1946,14 @@ class li {
1945
1946
  return e;
1946
1947
  const i = this.rowKeyMap.size;
1947
1948
  let s = 0, r = 0;
1948
- const o = this.selectionMap.size, n = Array.from(this.selectionMap.values()).some((u) => u.check);
1949
- this.rowKeyMap.forEach((u, g) => {
1950
- var x;
1951
- (x = this.selectionMap.get(g)) != null && x.check && (s += 1);
1952
- let p = u.selectable;
1949
+ const o = this.selectionMap.size, n = Array.from(this.selectionMap.values()).some((x) => x.check);
1950
+ this.rowKeyMap.forEach((x, g) => {
1951
+ var u;
1952
+ (u = this.selectionMap.get(g)) != null && u.check && (s += 1);
1953
+ let p = x.selectable;
1953
1954
  typeof p == "function" && (p = p({
1954
- row: u.item,
1955
- rowIndex: u.rowIndex
1955
+ row: x.item,
1956
+ rowIndex: x.rowIndex
1956
1957
  })), p && (r += 1);
1957
1958
  });
1958
1959
  const h = o > i && s === 0 && n, c = r && r > s && s > 0 || h, d = r !== 0, f = !!r && r === s;
@@ -2094,14 +2095,14 @@ class li {
2094
2095
  if (h) {
2095
2096
  let c = {}, d = {};
2096
2097
  if (d[e] = this.getItemValue(t, e), Array.isArray(h)) {
2097
- const u = h.map((g) => ({
2098
+ const x = h.map((g) => ({
2098
2099
  ...g,
2099
2100
  row: s.item,
2100
2101
  column: n,
2101
2102
  rowIndex: s.rowIndex,
2102
2103
  colIndex: r.colIndex
2103
2104
  }));
2104
- c[e] = u;
2105
+ c[e] = x;
2105
2106
  } else
2106
2107
  c[e] = {
2107
2108
  ...h,
@@ -2112,8 +2113,8 @@ class li {
2112
2113
  };
2113
2114
  new nt(c).validate(d).then(() => {
2114
2115
  this.clearValidationError(t, e), i([]);
2115
- }).catch(({ errors: u }) => {
2116
- const g = u.map((p) => ({
2116
+ }).catch(({ errors: x }) => {
2117
+ const g = x.map((p) => ({
2117
2118
  ...p,
2118
2119
  column: n,
2119
2120
  key: e,
@@ -2146,10 +2147,10 @@ class li {
2146
2147
  relationColKeys: c,
2147
2148
  rowspan: d,
2148
2149
  height: f,
2149
- width: u,
2150
+ width: x,
2150
2151
  colspan: g,
2151
2152
  mergeRow: p,
2152
- mergeCol: x
2153
+ mergeCol: u
2153
2154
  } = t;
2154
2155
  if (d === 1 && g === 1)
2155
2156
  return {
@@ -2158,7 +2159,7 @@ class li {
2158
2159
  rowspan: d,
2159
2160
  colspan: g,
2160
2161
  height: f,
2161
- width: u,
2162
+ width: x,
2162
2163
  offsetTop: 0,
2163
2164
  offsetLeft: 0,
2164
2165
  dataList: [
@@ -2170,10 +2171,10 @@ class li {
2170
2171
  }
2171
2172
  ]
2172
2173
  };
2173
- let w = e, m = e, C = n, y = n, b = [], E = 0, v = 0, I = 0, L = 0;
2174
+ let w = e, m = e, C = n, y = n, b = [], E = 0, v = 0, _ = 0, L = 0;
2174
2175
  if (d !== 1 && p) {
2175
- L = u;
2176
- const _ = h.reduce((R, A) => {
2176
+ L = x;
2177
+ const I = h.reduce((R, A) => {
2177
2178
  const S = this.getItemValue(s, A) ?? "";
2178
2179
  return `${R}${S}`;
2179
2180
  }, "");
@@ -2182,7 +2183,7 @@ class li {
2182
2183
  const B = this.getItemValue(A, T) ?? "";
2183
2184
  return `${M}${B}`;
2184
2185
  }, "");
2185
- if (_ === S)
2186
+ if (I === S)
2186
2187
  w = R;
2187
2188
  else
2188
2189
  break;
@@ -2192,7 +2193,7 @@ class li {
2192
2193
  const B = this.getItemValue(A, T) ?? "";
2193
2194
  return `${M}${B}`;
2194
2195
  }, "");
2195
- if (_ === S)
2196
+ if (I === S)
2196
2197
  m = R;
2197
2198
  else
2198
2199
  break;
@@ -2203,7 +2204,7 @@ class li {
2203
2204
  }
2204
2205
  for (let R = w; R <= m; R++) {
2205
2206
  const { height: A } = this.positions[R];
2206
- I += A;
2207
+ _ += A;
2207
2208
  const S = this.rowIndexRowKeyMap.get(R) || "", { item: M } = this.rowKeyMap.get(S), T = this.getItemValue(S, i);
2208
2209
  b.push({
2209
2210
  rowKey: S,
@@ -2213,36 +2214,36 @@ class li {
2213
2214
  });
2214
2215
  }
2215
2216
  }
2216
- if (g !== 1 && x) {
2217
- I = f;
2218
- for (let _ = n - 1; _ >= 0; _--) {
2219
- const R = this.getColumnByColIndex(_);
2217
+ if (g !== 1 && u) {
2218
+ _ = f;
2219
+ for (let I = n - 1; I >= 0; I--) {
2220
+ const R = this.getColumnByColIndex(I);
2220
2221
  if (!R)
2221
2222
  break;
2222
2223
  const A = this.getItemValue(s, i), S = this.getItemValue(s, R.key);
2223
2224
  if (A === S && c.includes(R.key))
2224
- C = _;
2225
+ C = I;
2225
2226
  else
2226
2227
  break;
2227
2228
  }
2228
- for (let _ = n; _ <= this.ctx.maxColIndex; _++) {
2229
- const R = this.getColumnByColIndex(_);
2229
+ for (let I = n; I <= this.ctx.maxColIndex; I++) {
2230
+ const R = this.getColumnByColIndex(I);
2230
2231
  if (!R)
2231
2232
  break;
2232
2233
  const A = this.getItemValue(s, i), S = this.getItemValue(s, R.key);
2233
2234
  if (A === S && c.includes(R.key))
2234
- y = _;
2235
+ y = I;
2235
2236
  else
2236
2237
  break;
2237
2238
  }
2238
- for (let _ = C; _ < n; _++) {
2239
- const R = this.getColumnByColIndex(_);
2239
+ for (let I = C; I < n; I++) {
2240
+ const R = this.getColumnByColIndex(I);
2240
2241
  if (!R)
2241
2242
  break;
2242
2243
  v += R.width || 100;
2243
2244
  }
2244
- for (let _ = C; _ <= y; _++) {
2245
- const R = this.getColumnByColIndex(_);
2245
+ for (let I = C; I <= y; I++) {
2246
+ const R = this.getColumnByColIndex(I);
2246
2247
  if (!R)
2247
2248
  break;
2248
2249
  L += R.width || 100, b.push({
@@ -2258,7 +2259,7 @@ class li {
2258
2259
  yArr: [w, m],
2259
2260
  rowspan: d,
2260
2261
  colspan: g,
2261
- height: I,
2262
+ height: _,
2262
2263
  width: L,
2263
2264
  offsetTop: E,
2264
2265
  offsetLeft: v,
@@ -2549,8 +2550,8 @@ class fi {
2549
2550
  if (this.ctx.save(), this.ctx.beginPath(), n !== void 0 && (this.ctx.fillStyle = n), o !== void 0 && (this.ctx.lineWidth = r, this.ctx.strokeStyle = o), h === 0)
2550
2551
  this.ctx.rect(t - 0.5, e - 0.5, i, s);
2551
2552
  else {
2552
- const [c, d, f, u] = typeof h == "number" ? [h, h, h, h] : h;
2553
- 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);
2553
+ const [c, d, f, x] = typeof h == "number" ? [h, h, h, h] : h;
2554
+ 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 - x, x), this.ctx.arcTo(t, e, t + c, e, c);
2554
2555
  }
2555
2556
  n !== void 0 && this.ctx.fill(), o !== void 0 && this.ctx.stroke(), this.ctx.restore();
2556
2557
  }
@@ -2574,12 +2575,12 @@ class fi {
2574
2575
  verticalAlign: f = "middle"
2575
2576
  } = o;
2576
2577
  this.ctx.font = n, this.ctx.fillStyle = c, this.ctx.textBaseline = f, this.ctx.textAlign = h;
2577
- let u = 0;
2578
- f === "top" ? u = i + d : f === "bottom" ? u = i + r - d : u = i + (r + 1) / 2;
2578
+ let x = 0;
2579
+ f === "top" ? x = i + d : f === "bottom" ? x = i + r - d : x = i + (r + 1) / 2;
2579
2580
  let g = 0;
2580
2581
  h === "left" ? g = e + d : h === "right" ? g = e + s - d : g = e + s / 2;
2581
- const { _text: p, ellipsis: x } = this.handleEllipsis(t, s, d, n);
2582
- return this.ctx.fillText(p, g, u), this.ctx.restore(), x;
2582
+ const { _text: p, ellipsis: u } = this.handleEllipsis(t, s, d, n);
2583
+ return this.ctx.fillText(p, g, x), this.ctx.restore(), u;
2583
2584
  }
2584
2585
  handleEllipsis(t, e, i = 0, s = "12px Arial") {
2585
2586
  let r = !1, o = t;
@@ -2767,7 +2768,7 @@ class Wt {
2767
2768
  }
2768
2769
  }
2769
2770
  const Pt = '<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>';
2770
- class ui {
2771
+ class xi {
2771
2772
  constructor(t) {
2772
2773
  l(this, "ctx");
2773
2774
  l(this, "list", [
@@ -2998,8 +2999,8 @@ class oe extends re {
2998
2999
  const { width: e, height: i, type: s } = this;
2999
3000
  if (["index-selection", "selection"].includes(s)) {
3000
3001
  const { indeterminate: r, check: o, selectable: n } = this.ctx.database.getCheckedState(), { CHECKBOX_SIZE: h = 0 } = this.ctx.config, c = this.drawX + (e - h) / 2, d = this.drawY + (i - h) / 2;
3001
- let f = this.ctx.icons.get("checkbox-uncheck"), u = "checkbox-uncheck";
3002
- r ? (f = this.ctx.icons.get("checkbox-indeterminate"), u = "checkbox-indeterminate") : o && n ? (f = this.ctx.icons.get("checkbox-check"), u = "checkbox-check") : o && n ? (f = this.ctx.icons.get("checkbox-check-disabled"), u = "checkbox-check-disabled") : !o && n ? (f = this.ctx.icons.get("checkbox-uncheck"), u = "checkbox-uncheck") : (f = this.ctx.icons.get("checkbox-disabled"), u = "checkbox-disabled"), f && (this.drawImageX = c, this.drawImageY = d, this.drawImageWidth = h, this.drawImageHeight = h, this.drawImageName = u, this.drawImageSource = f, this.ctx.paint.drawImage(
3002
+ let f = this.ctx.icons.get("checkbox-uncheck"), x = "checkbox-uncheck";
3003
+ r ? (f = this.ctx.icons.get("checkbox-indeterminate"), x = "checkbox-indeterminate") : o && n ? (f = this.ctx.icons.get("checkbox-check"), x = "checkbox-check") : o && n ? (f = this.ctx.icons.get("checkbox-check-disabled"), x = "checkbox-check-disabled") : !o && n ? (f = this.ctx.icons.get("checkbox-uncheck"), x = "checkbox-uncheck") : (f = this.ctx.icons.get("checkbox-disabled"), x = "checkbox-disabled"), f && (this.drawImageX = c, this.drawImageY = d, this.drawImageWidth = h, this.drawImageHeight = h, this.drawImageName = x, this.drawImageSource = f, this.ctx.paint.drawImage(
3003
3004
  this.drawImageSource,
3004
3005
  this.drawImageX,
3005
3006
  this.drawImageY,
@@ -3028,7 +3029,7 @@ class oe extends re {
3028
3029
  };
3029
3030
  }
3030
3031
  }
3031
- class xi {
3032
+ class ui {
3032
3033
  constructor(t) {
3033
3034
  l(this, "ctx");
3034
3035
  l(this, "visibleHoverCell");
@@ -3315,7 +3316,7 @@ class gi {
3315
3316
  emptyElement: h,
3316
3317
  contextMenuElement: c
3317
3318
  } = t;
3318
- this.containerElement = i, s.tabIndex = 0, this.stageElement = s, this.canvasElement = r, this.overlayerElement = o, this.editorElement = n, this.emptyElement = h, this.contextMenuElement = c, this.config = new Wt(e.config || {}), this.eventBus = new di(), this.eventBrowser = new ci(this), this.eventTable = new xi(this), this.paint = new fi(this.canvasElement), this.database = new li(this, e), this.history = new hi(this), this.icons = new ui(this);
3319
+ this.containerElement = i, s.tabIndex = 0, this.stageElement = s, this.canvasElement = r, this.overlayerElement = o, this.editorElement = n, this.emptyElement = h, this.contextMenuElement = c, this.config = new Wt(e.config || {}), this.eventBus = new di(), this.eventBrowser = new ci(this), this.eventTable = new ui(this), this.paint = new fi(this.canvasElement), this.database = new li(this, e), this.history = new hi(this), this.icons = new xi(this);
3319
3320
  }
3320
3321
  setConfig(t) {
3321
3322
  this.config = new Wt(t);
@@ -3521,12 +3522,12 @@ class zt {
3521
3522
  stageHeight: i,
3522
3523
  stageWidth: s,
3523
3524
  config: { SCROLLER_TRACK_SIZE: r = 0, SCROLLER_SIZE: o = 0, BORDER: n }
3524
- } = this.ctx, h = s, c = i, d = e.height, f = e.width, u = t.height, g = this.ctx.footer.height;
3525
+ } = this.ctx, h = s, c = i, d = e.height, f = e.width, x = t.height, g = this.ctx.footer.height;
3525
3526
  if (this.type === "vertical") {
3526
- this.visibleDistance = c - r - d, this.distance = u - this.visibleDistance + g, this.trackX = h - r, this.trackY = 0, this.splitPoints = [this.trackX, d, this.trackX + r, d], this.trackWidth = r, this.trackHeight = c, this.barX = this.trackX - 1 + (r - o) / 2, this.barWidth = o;
3527
- const p = this.distance ? this.visibleDistance / (u + g) : 0;
3528
- let x = Math.floor(p * this.visibleDistance);
3529
- x < 30 ? x = 30 : x > this.visibleDistance && (x = 0), this.barHeight = x, this.barY = d + this.scroll / this.distance * (this.visibleDistance - this.barHeight), this.scroll = Math.max(0, Math.min(this.scroll, this.distance));
3527
+ this.visibleDistance = c - r - d, this.distance = x - this.visibleDistance + g, this.trackX = h - r, this.trackY = 0, this.splitPoints = [this.trackX, d, this.trackX + r, d], this.trackWidth = r, this.trackHeight = c, this.barX = this.trackX - 1 + (r - o) / 2, this.barWidth = o;
3528
+ const p = this.distance ? this.visibleDistance / (x + g) : 0;
3529
+ let u = Math.floor(p * this.visibleDistance);
3530
+ u < 30 ? u = 30 : u > this.visibleDistance && (u = 0), this.barHeight = u, this.barY = d + this.scroll / this.distance * (this.visibleDistance - this.barHeight), this.scroll = Math.max(0, Math.min(this.scroll, this.distance));
3530
3531
  } else {
3531
3532
  this.visibleDistance = h - r, this.distance = f - this.visibleDistance, this.splitPoints = [
3532
3533
  h - r,
@@ -3536,8 +3537,8 @@ class zt {
3536
3537
  ];
3537
3538
  const p = n ? 0 : 0.5;
3538
3539
  this.trackX = 0, this.trackY = c - r + p, this.trackWidth = h, this.trackHeight = r;
3539
- const x = this.distance ? this.visibleDistance / f : 0;
3540
- let w = Math.floor(x * this.visibleDistance);
3540
+ const u = this.distance ? this.visibleDistance / f : 0;
3541
+ let w = Math.floor(u * this.visibleDistance);
3541
3542
  this.barY = this.trackY - 1 + (r - o) / 2, w < 30 ? w = 30 : w >= this.visibleDistance && (w = 0), this.barWidth = w, this.barHeight = o, this.barX = this.scroll / this.distance * (this.visibleDistance - this.barWidth), this.scroll = Math.max(0, Math.min(this.scroll, this.distance));
3542
3543
  }
3543
3544
  }
@@ -3619,7 +3620,10 @@ class wi {
3619
3620
  s > e.visibleHeight && this.setScrollY(s - e.visibleHeight / 2);
3620
3621
  }
3621
3622
  scrollToRowKey(t) {
3622
- const { body: e, database: i } = this.ctx, s = i.getRowIndexForRowKey(t), { top: r } = i.getPositionForRowIndex(s);
3623
+ const { body: e, database: i } = this.ctx, s = i.getRowIndexForRowKey(t);
3624
+ if (s === void 0)
3625
+ return;
3626
+ const { top: r } = i.getPositionForRowIndex(s);
3623
3627
  this.setScrollY(r - e.visibleHeight / 2);
3624
3628
  }
3625
3629
  }
@@ -3672,8 +3676,8 @@ class pi {
3672
3676
  config: { HEADER_HEIGHT: t, SCROLLER_TRACK_SIZE: e }
3673
3677
  } = this.ctx, i = this.ctx.database.getColumns();
3674
3678
  this.columns = i, this.allCellHeaders = [], this.leafCellHeaders = [], this.fixedLeftCellHeaders = [], this.fixedRightCellHeaders = [], this.centerCellHeaders = [];
3675
- const s = te(i), r = _t(i);
3676
- this.height = t * s, this.width = r.reduce((f, u) => f + ((u == null ? void 0 : u.width) || 100), 0), this.visibleHeight = this.height;
3679
+ const s = te(i), r = It(i);
3680
+ this.height = t * s, this.width = r.reduce((f, x) => f + ((x == null ? void 0 : x.width) || 100), 0), this.visibleHeight = this.height;
3677
3681
  const o = ei(ee(i, s));
3678
3682
  this.columnIndex = 0, this.resizeNum = 0, this.render(o, 0), this.ctx.database.updateColIndexKeyMap(this.leafCellHeaders);
3679
3683
  const n = this.ctx.containerElement.getBoundingClientRect();
@@ -3684,9 +3688,9 @@ class pi {
3684
3688
  this.resizeAllColumn(f);
3685
3689
  }
3686
3690
  const c = this.fixedLeftCellHeaders.filter((f) => !f.hasChildren);
3687
- this.ctx.fixedLeftWidth = c.reduce((f, u) => f + u.width, 0);
3691
+ this.ctx.fixedLeftWidth = c.reduce((f, x) => f + x.width, 0);
3688
3692
  const d = this.fixedRightCellHeaders.filter((f) => !f.hasChildren);
3689
- this.ctx.fixedRightWidth = d.reduce((f, u) => f + u.width, e), 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.visibleWidth = this.visibleWidth, this.ctx.header.visibleHeight = this.visibleHeight;
3693
+ this.ctx.fixedRightWidth = d.reduce((f, x) => f + x.width, e), 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.visibleWidth = this.visibleWidth, this.ctx.header.visibleHeight = this.visibleHeight;
3690
3694
  }
3691
3695
  // 调整表头的宽度
3692
3696
  initResizeColumn() {
@@ -3775,7 +3779,7 @@ class pi {
3775
3779
  for (let o = 0; o < i; o++) {
3776
3780
  const n = t[o], h = r * (n.rowspan || 0), c = r * (n.level || 0);
3777
3781
  let d = n.width || 100;
3778
- n.children && (d = _t(n.children).reduce((g, p) => g + ((p == null ? void 0 : p.width) || 100), 0));
3782
+ n.children && (d = It(n.children).reduce((g, p) => g + ((p == null ? void 0 : p.width) || 100), 0));
3779
3783
  const f = new oe(this.ctx, this.columnIndex, s, c, d, h, n);
3780
3784
  this.ctx.database.setHeader(n.key, f), this.allCellHeaders.push(f), n.children || (this.leafCellHeaders.push(f), f.column.widthFillDisable || this.resizeNum++), n.fixed === "left" ? this.fixedLeftCellHeaders.push(f) : n.fixed === "right" ? this.fixedRightCellHeaders.push(f) : this.centerCellHeaders.push(f), !n.children && this.columnIndex++, n.children && this.render(n.children, s), s += d;
3781
3785
  }
@@ -3946,18 +3950,18 @@ class mi {
3946
3950
  MAX_HEIGHT: c = 0,
3947
3951
  ENABLE_OFFSET_HEIGHT: d = 0,
3948
3952
  OFFSET_HEIGHT: f = 0,
3949
- FOOTER_POSITION: u
3953
+ FOOTER_POSITION: x
3950
3954
  }
3951
3955
  } = this.ctx;
3952
3956
  if (!e.width)
3953
3957
  return;
3954
- this.x = 0, u === "top" && r ? this.y = e.height + i.height : this.y = e.height;
3958
+ this.x = 0, x === "top" && r ? this.y = e.height + i.height : this.y = e.height;
3955
3959
  const { data: g, sumHeight: p } = s.getData();
3956
3960
  this.height = p, this.data = g, this.width = e.width, this.visibleWidth = this.ctx.stageWidth - o;
3957
- const x = this.ctx.footer.height;
3958
- !this.data.length && !n ? this.height = h : !this.data.length && n && (this.height = n - e.height - x - o);
3961
+ const u = this.ctx.footer.height;
3962
+ !this.data.length && !n ? this.height = h : !this.data.length && n && (this.height = n - e.height - u - o);
3959
3963
  let w = this.height + e.height + o;
3960
- w += x;
3964
+ w += u;
3961
3965
  let m = w;
3962
3966
  const C = window.innerHeight, { top: y } = this.containerRect || this.ctx.containerElement.getBoundingClientRect();
3963
3967
  if (C > y && d && !n) {
@@ -3966,18 +3970,18 @@ class mi {
3966
3970
  } else this.data.length && n ? m = n : this.data.length && c && w > c && (m = c);
3967
3971
  m > 0 && (this.ctx.stageHeight = Math.floor(m), this.ctx.stageElement.style.height = `${this.ctx.stageHeight - 0.5}px`);
3968
3972
  let b = this.ctx.stageHeight - e.height - o;
3969
- r ? this.visibleHeight = b - x : this.visibleHeight = b, this.data.length || (this.height = this.visibleHeight), this.ctx.body.x = this.x, this.ctx.body.y = this.y, this.ctx.body.width = this.width, this.ctx.body.height = this.height, this.ctx.body.visibleWidth = this.visibleWidth, this.ctx.body.visibleHeight = this.visibleHeight, this.ctx.body.data = g;
3970
- const E = window.devicePixelRatio || 1, v = this.ctx.stageWidth * E, I = this.ctx.stageHeight * E;
3971
- t.width = Math.floor(v), t.height = Math.floor(I);
3973
+ r ? this.visibleHeight = b - u : this.visibleHeight = b, this.data.length || (this.height = this.visibleHeight), this.ctx.body.x = this.x, this.ctx.body.y = this.y, this.ctx.body.width = this.width, this.ctx.body.height = this.height, this.ctx.body.visibleWidth = this.visibleWidth, this.ctx.body.visibleHeight = this.visibleHeight, this.ctx.body.data = g;
3974
+ const E = window.devicePixelRatio || 1, v = this.ctx.stageWidth * E, _ = this.ctx.stageHeight * E;
3975
+ t.width = Math.floor(v), t.height = Math.floor(_);
3972
3976
  const L = this.data.length ? "not-empty" : "empty";
3973
3977
  this.ctx.emit("emptyChange", {
3974
3978
  isEmpty: L,
3975
3979
  type: L,
3976
3980
  headerHeight: e.height,
3977
3981
  bodyHeight: this.height,
3978
- footerHeight: x,
3982
+ footerHeight: u,
3979
3983
  width: this.width,
3980
- height: this.data.length ? 0 : h + x
3984
+ height: this.data.length ? 0 : h + u
3981
3985
  }), this.ctx.canvasElement.setAttribute(
3982
3986
  "style",
3983
3987
  ` height:${this.ctx.stageHeight}px;width:${this.ctx.stageWidth}px;`
@@ -4007,8 +4011,8 @@ class mi {
4007
4011
  } = this.ctx;
4008
4012
  if (this.isResizing && this.resizeTarget) {
4009
4013
  const f = this.resizeTarget.height;
4010
- let u = n - this.clientY;
4011
- u + f < d && (u = -(f - d)), this.resizeDiff = u, this.ctx.emit("draw");
4014
+ let x = n - this.clientY;
4015
+ x + f < d && (x = -(f - d)), this.resizeDiff = x, this.ctx.emit("draw");
4012
4016
  } else {
4013
4017
  if (this.resizeTarget = null, this.isMouseDown)
4014
4018
  return;
@@ -4020,11 +4024,11 @@ class mi {
4020
4024
  return;
4021
4025
  this.ctx.stageElement.style.cursor === "row-resize" && (this.ctx.stageElement.style.cursor = "default");
4022
4026
  for (let f = 0; f < this.renderRows.length; f++) {
4023
- const u = this.renderRows[f];
4024
- if (r > u.y - c + u.height - 1.5 && r < u.y - c + u.height + 1.5 && r < h - 4)
4025
- for (let p = 0; p < u.cells.length; p++) {
4026
- const x = u.cells[p];
4027
- o > x.drawX + 10 && o < x.drawX + x.width - 10 && x.rowspan === 1 && (this.ctx.stageElement.style.cursor = "row-resize", this.resizeTarget = u);
4027
+ const x = this.renderRows[f];
4028
+ if (r > x.y - c + x.height - 1.5 && r < x.y - c + x.height + 1.5 && r < h - 4)
4029
+ for (let p = 0; p < x.cells.length; p++) {
4030
+ const u = x.cells[p];
4031
+ o > u.drawX + 10 && o < u.drawX + u.width - 10 && u.rowspan === 1 && (this.ctx.stageElement.style.cursor = "row-resize", this.resizeTarget = x);
4028
4032
  }
4029
4033
  }
4030
4034
  }
@@ -4107,7 +4111,7 @@ class mi {
4107
4111
  this.headIndex = Math.max(0, h), this.tailIndex = Math.min(this.ctx.maxRowIndex, c + 1), this.visibleRows = o.slice(this.headIndex, this.tailIndex + 1), this.ctx.body.headIndex = this.headIndex, this.ctx.body.tailIndex = this.tailIndex, this.ctx.body.visibleRows = this.visibleRows;
4108
4112
  const d = [];
4109
4113
  for (let f = 0; f < this.visibleRows.length; f++) {
4110
- const u = this.headIndex + f, g = this.visibleRows[f], { height: p, top: x } = this.ctx.database.getPositionForRowIndex(u), w = new ne(this.ctx, u, 0, x + this.y, t.width, p, g);
4114
+ const x = this.headIndex + f, g = this.visibleRows[f], { height: p, top: u } = this.ctx.database.getPositionForRowIndex(x), w = new ne(this.ctx, x, 0, u + this.y, t.width, p, g);
4111
4115
  d.push(w);
4112
4116
  }
4113
4117
  this.renderRows = d, this.ctx.body.renderRows = d;
@@ -4324,26 +4328,26 @@ class Ei {
4324
4328
  SELECTOR_AREA_MIN_Y: c,
4325
4329
  SELECTOR_AREA_MAX_Y: d,
4326
4330
  SELECTOR_AREA_MAX_X_OFFSET: f,
4327
- SELECTOR_AREA_MAX_Y_OFFSET: u
4328
- } = this.ctx.config, g = n, p = h || this.ctx.maxColIndex - f, x = c, w = d || this.ctx.maxRowIndex - u;
4331
+ SELECTOR_AREA_MAX_Y_OFFSET: x
4332
+ } = this.ctx.config, g = n, p = h || this.ctx.maxColIndex - f, u = c, w = d || this.ctx.maxRowIndex - x;
4329
4333
  let [m, C] = r, [y, b] = o;
4330
- if (m < g || C > p || y < x || b > w)
4334
+ if (m < g || C > p || y < u || b > w)
4331
4335
  return;
4332
4336
  if (this.ctx.stageElement.focus({ preventScroll: !0 }), this.ctx.config.ENABLE_MERGE_CELL_LINK) {
4333
4337
  const v = this.adjustMergeCells(r, o);
4334
4338
  y = v.yArr[0], b = v.yArr[1], m = v.xArr[0], C = v.xArr[1], this.ctx.onlyMergeCell = v.onlyMergeCell;
4335
4339
  }
4336
- m === C && y === b ? this.ctx.selectOnlyOne = !0 : this.ctx.selectOnlyOne = !1, r = [Math.max(g, m), Math.min(p, C)], o = [Math.max(x, y), Math.min(w, b)];
4340
+ m === C && y === b ? this.ctx.selectOnlyOne = !0 : this.ctx.selectOnlyOne = !1, r = [Math.max(g, m), Math.min(p, C)], o = [Math.max(u, y), Math.min(w, b)];
4337
4341
  const { BEFORE_SET_SELECTOR_METHOD: E } = this.ctx.config;
4338
4342
  if (typeof E == "function") {
4339
- const I = E({
4343
+ const _ = E({
4340
4344
  focusCell: this.ctx.focusCell,
4341
4345
  xArr: r,
4342
4346
  yArr: o
4343
4347
  });
4344
- if (!I)
4348
+ if (!_)
4345
4349
  return;
4346
- r = I.xArr, o = I.yArr;
4350
+ r = _.xArr, o = _.yArr;
4347
4351
  }
4348
4352
  this.ctx.selector.xArr = r, this.ctx.selector.yArr = o, this.ctx.emit("setSelector", this.ctx.selector), this.ctx.emit("drawView");
4349
4353
  }
@@ -4352,38 +4356,38 @@ class Ei {
4352
4356
  var p;
4353
4357
  const [i, s] = e, [r, o] = t;
4354
4358
  let n = [], h = [];
4355
- for (let x = 0; x <= e[1] - e[0]; x++)
4359
+ for (let u = 0; u <= e[1] - e[0]; u++)
4356
4360
  for (let w = 0; w <= t[1] - t[0]; w++) {
4357
- const m = x + e[0], C = w + t[0], y = this.ctx.database.getVirtualBodyCell(m, C);
4361
+ const m = u + e[0], C = w + t[0], y = this.ctx.database.getVirtualBodyCell(m, C);
4358
4362
  y && ((m === i || m === s) && n.push(y), (C === r || C === o) && h.push(y));
4359
4363
  }
4360
4364
  const c = n.reduce(
4361
- (x, w) => {
4365
+ (u, w) => {
4362
4366
  const { yArr: m } = w.getSpanInfo(), [C, y] = m;
4363
- return x.minY = Math.min(x.minY, C), x.maxY = Math.max(x.maxY, y), x;
4367
+ return u.minY = Math.min(u.minY, C), u.maxY = Math.max(u.maxY, y), u;
4364
4368
  },
4365
4369
  {
4366
4370
  minY: i,
4367
4371
  maxY: s
4368
4372
  }
4369
4373
  ), d = h.reduce(
4370
- (x, w) => {
4374
+ (u, w) => {
4371
4375
  const { xArr: m } = w.getSpanInfo(), [C, y] = m;
4372
- return x.minX = Math.min(x.minX, C), x.maxX = Math.max(x.maxX, y), x;
4376
+ return u.minX = Math.min(u.minX, C), u.maxX = Math.max(u.maxX, y), u;
4373
4377
  },
4374
4378
  {
4375
4379
  minX: r,
4376
4380
  maxX: o
4377
4381
  }
4378
- ), f = [d.minX, d.maxX], u = [c.minY, c.maxY];
4382
+ ), f = [d.minX, d.maxX], x = [c.minY, c.maxY];
4379
4383
  let g = !1;
4380
4384
  if (d.minX !== d.maxX || c.minY !== c.maxY) {
4381
- const x = JSON.stringify(f) + JSON.stringify(u), w = (p = this.ctx.focusCell) == null ? void 0 : p.getSpanInfo();
4382
- g = (w && JSON.stringify(w.xArr) + JSON.stringify(w.yArr)) === x;
4385
+ const u = JSON.stringify(f) + JSON.stringify(x), w = (p = this.ctx.focusCell) == null ? void 0 : p.getSpanInfo();
4386
+ g = (w && JSON.stringify(w.xArr) + JSON.stringify(w.yArr)) === u;
4383
4387
  }
4384
4388
  return {
4385
4389
  xArr: f,
4386
- yArr: u,
4390
+ yArr: x,
4387
4391
  onlyMergeCell: g
4388
4392
  };
4389
4393
  }
@@ -4421,7 +4425,7 @@ class Ei {
4421
4425
  SELECTOR_AREA_MAX_Y: o,
4422
4426
  SELECTOR_AREA_MAX_X_OFFSET: n,
4423
4427
  SELECTOR_AREA_MAX_Y_OFFSET: h
4424
- } = this.ctx.config, c = i, d = s || this.ctx.maxColIndex - n, f = r, u = o || this.ctx.maxRowIndex - h, g = [c, d], p = [f, u];
4428
+ } = this.ctx.config, c = i, d = s || this.ctx.maxColIndex - n, f = r, x = o || this.ctx.maxRowIndex - h, g = [c, d], p = [f, x];
4425
4429
  this.setSelector(g, p);
4426
4430
  }
4427
4431
  }
@@ -4460,8 +4464,8 @@ class Ei {
4460
4464
  if (this.ctx.selector.enable = !0, i && t) {
4461
4465
  if (this.ctx.config.ENABLE_SELECTOR_SINGLE)
4462
4466
  return;
4463
- const { colIndex: s, rowIndex: r } = i, { colIndex: o, rowIndex: n } = e, h = Math.min(o, s), c = Math.max(o, s), d = Math.min(n, r), f = Math.max(n, r), u = [h, c], g = [d, f];
4464
- this.setSelector(u, g);
4467
+ const { colIndex: s, rowIndex: r } = i, { colIndex: o, rowIndex: n } = e, h = Math.min(o, s), c = Math.max(o, s), d = Math.min(n, r), f = Math.max(n, r), x = [h, c], g = [d, f];
4468
+ this.setSelector(x, g);
4465
4469
  } else {
4466
4470
  this.ctx.emit("cellSelectedClick", e);
4467
4471
  const s = [e.colIndex, e.colIndex], r = [e.rowIndex, e.rowIndex];
@@ -4529,9 +4533,9 @@ class Ei {
4529
4533
  for (let h = 0; h <= t[1] - t[0]; h++) {
4530
4534
  const c = n + e[0], d = h + t[0], f = this.ctx.database.getItemValueForRowIndexAndColIndex(c, d);
4531
4535
  if (f) {
4532
- const { rowKey: u, key: g } = f;
4533
- this.ctx.database.getReadonly(u, g) || (r.add(u), s.push({
4534
- rowKey: u,
4536
+ const { rowKey: x, key: g } = f;
4537
+ this.ctx.database.getReadonly(x, g) || (r.add(x), s.push({
4538
+ rowKey: x,
4535
4539
  key: g,
4536
4540
  value: null,
4537
4541
  row: {}
@@ -4559,18 +4563,18 @@ class Ei {
4559
4563
  const e = this.ctx.selector.yArr[0], i = this.ctx.selector.xArr[0], s = /* @__PURE__ */ new Set();
4560
4564
  navigator.clipboard.readText().then(async (r) => {
4561
4565
  let o = si(r);
4562
- const n = [i, i + o[0].length - 1], h = [e, e + o.length - 1], [c, d] = h, [f, u] = n, g = d - this.ctx.maxRowIndex, p = u - this.ctx.maxColIndex;
4566
+ const n = [i, i + o[0].length - 1], h = [e, e + o.length - 1], [c, d] = h, [f, x] = n, g = d - this.ctx.maxRowIndex, p = x - this.ctx.maxColIndex;
4563
4567
  (g > 0 || p > 0) && this.ctx.emit("onPastedDataOverflow", {
4564
4568
  maxY: d,
4565
- maxX: u,
4569
+ maxX: x,
4566
4570
  minY: c,
4567
4571
  minX: f,
4568
4572
  overflowRowCount: g,
4569
4573
  overflowColCount: p,
4570
4574
  textArr: o
4571
4575
  });
4572
- const x = o.length === 1 && o[0].length === 1;
4573
- if (this.ctx.config.ENABLE_MERGE_CELL_LINK && this.ctx.database.hasMergeCell(n, h) && !x) {
4576
+ const u = o.length === 1 && o[0].length === 1;
4577
+ if (this.ctx.config.ENABLE_MERGE_CELL_LINK && this.ctx.database.hasMergeCell(n, h) && !u) {
4574
4578
  const y = {
4575
4579
  code: "ERR_MERGED_CELLS_PASTE",
4576
4580
  message: "Merged cells cannot span paste data"
@@ -4582,12 +4586,12 @@ class Ei {
4582
4586
  for (let y = 0; y <= o.length - 1; y++) {
4583
4587
  const b = o[y].length;
4584
4588
  for (let E = 0; E <= b - 1; E++) {
4585
- const v = y + e, I = E + i, L = o[y][E], _ = this.ctx.database.getItemValueForRowIndexAndColIndex(
4589
+ const v = y + e, _ = E + i, L = o[y][E], I = this.ctx.database.getItemValueForRowIndexAndColIndex(
4586
4590
  v,
4587
- I
4591
+ _
4588
4592
  );
4589
- if (_) {
4590
- const { rowKey: R, key: A } = _;
4593
+ if (I) {
4594
+ const { rowKey: R, key: A } = I;
4591
4595
  this.ctx.database.getReadonly(R, A) || (s.add(R), w.push({
4592
4596
  rowKey: R,
4593
4597
  key: A,
@@ -4673,8 +4677,8 @@ class Ei {
4673
4677
  SELECTOR_AREA_MAX_Y: o,
4674
4678
  SELECTOR_AREA_MAX_X_OFFSET: n,
4675
4679
  SELECTOR_AREA_MAX_Y_OFFSET: h
4676
- } = this.ctx.config, c = i, d = s || this.ctx.maxColIndex - n, f = r, u = o || this.ctx.maxRowIndex - h;
4677
- return !(e < c || e > d || t < f || t > u);
4680
+ } = this.ctx.config, c = i, d = s || this.ctx.maxColIndex - n, f = r, x = o || this.ctx.maxRowIndex - h;
4681
+ return !(e < c || e > d || t < f || t > x);
4678
4682
  }
4679
4683
  /**
4680
4684
  * 调整滚动条位置,让到达边界时自动滚动
@@ -4716,19 +4720,19 @@ class Ei {
4716
4720
  body: h,
4717
4721
  scrollX: c,
4718
4722
  scrollY: d,
4719
- config: { SCROLLER_TRACK_SIZE: f, FOOTER_FIXED: u, FOOTER_POSITION: g, ENABLE_MERGE_CELL_LINK: p }
4723
+ config: { SCROLLER_TRACK_SIZE: f, FOOTER_FIXED: x, FOOTER_POSITION: g, ENABLE_MERGE_CELL_LINK: p }
4720
4724
  } = this.ctx;
4721
4725
  if (!i)
4722
4726
  return;
4723
4727
  p && this.ctx.onlyMergeCell && i.updateSpanInfo();
4724
- const { drawX: x, drawY: w, width: m, height: C, fixed: y } = i, b = r - x + 1, E = i.drawX + m - (e - s) + 1;
4725
- let v = o.height - w, I = C;
4726
- I > h.visibleHeight && (I = h.visibleHeight);
4728
+ const { drawX: u, drawY: w, width: m, height: C, fixed: y } = i, b = r - u + 1, E = i.drawX + m - (e - s) + 1;
4729
+ let v = o.height - w, _ = C;
4730
+ _ > h.visibleHeight && (_ = h.visibleHeight);
4727
4731
  let L = 0;
4728
- u && (g === "top" ? v = o.height + n.height - w : L = n.visibleHeight);
4729
- const _ = w + I - (t - L - f);
4732
+ x && (g === "top" ? v = o.height + n.height - w : L = n.visibleHeight);
4733
+ const I = w + _ - (t - L - f);
4730
4734
  let R = c, A = d;
4731
- E > 0 && !y ? R = Math.floor(c + E) : b > 0 && !y && (R = Math.floor(c - b)), v > 0 ? A = Math.floor(d - v) : _ > 0 && (A = Math.floor(d + _)), (Math.abs(c - R) > 2 || Math.abs(d - A) > 2) && (this.ctx.adjustPositioning = !0, this.ctx.setScroll(R, A), this.ctx.emit("adjustBoundaryPosition", i));
4735
+ E > 0 && !y ? R = Math.floor(c + E) : b > 0 && !y && (R = Math.floor(c - b)), v > 0 ? A = Math.floor(d - v) : I > 0 && (A = Math.floor(d + I)), (Math.abs(c - R) > 2 || Math.abs(d - A) > 2) && (this.ctx.adjustPositioning = !0, this.ctx.setScroll(R, A), this.ctx.emit("adjustBoundaryPosition", i));
4732
4736
  }
4733
4737
  destroy() {
4734
4738
  this.timerX && (clearTimeout(this.timerX), this.timerX = 0), this.timerY && (clearTimeout(this.timerY), this.timerY = 0);
@@ -4744,8 +4748,8 @@ class Ci {
4744
4748
  this.ctx.on("mousemove", (t) => {
4745
4749
  if (this.ctx.stageElement.style.cursor === "crosshair" && (this.ctx.stageElement.style.cursor = "default"), this.ctx.editing || !this.ctx.focusCell || !this.maxColRowCell)
4746
4750
  return;
4747
- const { offsetX: e, offsetY: i } = this.ctx.getOffset(t), { colIndex: s, rowIndex: r, drawX: o, drawY: n, width: h, height: c } = this.maxColRowCell, d = 6, f = s === this.ctx.maxColIndex || r === this.ctx.maxRowIndex ? 0 : 2, u = o + h - d + f, g = n + c - d + f;
4748
- e > u && i > g && e < u + d && i < g + d && (this.ctx.stageElement.style.cursor = "crosshair");
4751
+ const { offsetX: e, offsetY: i } = this.ctx.getOffset(t), { colIndex: s, rowIndex: r, drawX: o, drawY: n, width: h, height: c } = this.maxColRowCell, d = 6, f = s === this.ctx.maxColIndex || r === this.ctx.maxRowIndex ? 0 : 2, x = o + h - d + f, g = n + c - d + f;
4752
+ e > x && i > g && e < x + d && i < g + d && (this.ctx.stageElement.style.cursor = "crosshair");
4749
4753
  }), this.ctx.on("cellMouseenter", (t) => {
4750
4754
  const { xArr: e, yArr: i } = this.ctx.selector, s = e[1], r = i[1], { colIndex: o, rowIndex: n } = t;
4751
4755
  this.ctx.config.ENABLE_AUTOFILL && o === s && n === r && (this.maxColRowCell = t), this.mouseenter(t);
@@ -4790,13 +4794,13 @@ class Ci {
4790
4794
  SELECTOR_AREA_MAX_X: c,
4791
4795
  SELECTOR_AREA_MIN_Y: d,
4792
4796
  SELECTOR_AREA_MAX_Y: f,
4793
- SELECTOR_AREA_MAX_X_OFFSET: u,
4797
+ SELECTOR_AREA_MAX_X_OFFSET: x,
4794
4798
  SELECTOR_AREA_MAX_Y_OFFSET: g
4795
- } = this.ctx.config, p = h, x = c || this.ctx.maxColIndex - u, w = d, m = f || this.ctx.maxRowIndex - g;
4799
+ } = this.ctx.config, p = h, u = c || this.ctx.maxColIndex - x, w = d, m = f || this.ctx.maxRowIndex - g;
4796
4800
  let [C, y] = o, [b, E] = n;
4797
4801
  if (C < p || b < w)
4798
4802
  return;
4799
- o = [Math.max(p, C), Math.min(x, y)], n = [Math.max(w, b), Math.min(m, E)];
4803
+ o = [Math.max(p, C), Math.min(u, y)], n = [Math.max(w, b), Math.min(m, E)];
4800
4804
  const { BEFORE_SET_AUTOFILL_METHOD: v } = this.ctx.config;
4801
4805
  if (typeof v == "function") {
4802
4806
  const L = v({
@@ -4818,8 +4822,8 @@ class Ci {
4818
4822
  const t = /* @__PURE__ */ new Set(), e = this.ctx.getSelectedData(), i = /* @__PURE__ */ new Map();
4819
4823
  for (let g = 0; g <= e.yArr[1] - e.yArr[0]; g++)
4820
4824
  for (let p = 0; p <= e.xArr[1] - e.xArr[0]; p++) {
4821
- const x = g + e.yArr[0], w = p + e.xArr[0];
4822
- i.set(`${x}-${w}`, !0);
4825
+ const u = g + e.yArr[0], w = p + e.xArr[0];
4826
+ i.set(`${u}-${w}`, !0);
4823
4827
  }
4824
4828
  const { value: s } = e, r = s[0].length, o = s.length, n = this.ctx.autofill.xArr, h = this.ctx.autofill.yArr, c = r === 1 && o === 1;
4825
4829
  if (this.ctx.config.ENABLE_MERGE_CELL_LINK && this.ctx.database.hasMergeCell(n, h) && !c) {
@@ -4833,7 +4837,7 @@ class Ci {
4833
4837
  let d = [];
4834
4838
  for (let g = 0; g <= h[1] - h[0]; g++)
4835
4839
  for (let p = 0; p <= n[1] - n[0]; p++) {
4836
- const x = p + n[0], w = g + h[0], m = s[g % o][p % r], C = this.ctx.database.getItemValueForRowIndexAndColIndex(w, x), y = `${w}-${x}`;
4840
+ const u = p + n[0], w = g + h[0], m = s[g % o][p % r], C = this.ctx.database.getItemValueForRowIndexAndColIndex(w, u), y = `${w}-${u}`;
4837
4841
  if (C && !i.has(y)) {
4838
4842
  const { rowKey: b, key: E } = C;
4839
4843
  this.ctx.database.getReadonly(b, E) || (t.add(b), d.push({
@@ -4849,21 +4853,21 @@ class Ci {
4849
4853
  this.ctx.selector.xArr = this.ctx.autofill.xArr, this.ctx.selector.yArr = this.ctx.autofill.yArr;
4850
4854
  const { BEFORE_AUTOFILL_DATA_METHOD: f } = this.ctx.config;
4851
4855
  if (typeof f == "function") {
4852
- const g = f, p = d.map((x) => ({
4853
- rowKey: x.rowKey,
4854
- key: x.key,
4855
- value: x.value,
4856
- oldValue: this.ctx.database.getItemValue(x.rowKey, x.key),
4857
- row: this.ctx.database.getRowDataItemForRowKey(x.rowKey)
4856
+ const g = f, p = d.map((u) => ({
4857
+ rowKey: u.rowKey,
4858
+ key: u.key,
4859
+ value: u.value,
4860
+ oldValue: this.ctx.database.getItemValue(u.rowKey, u.key),
4861
+ row: this.ctx.database.getRowDataItemForRowKey(u.rowKey)
4858
4862
  }));
4859
4863
  if (d = await g(p, n, h), d && !d.length)
4860
4864
  return;
4861
4865
  }
4862
4866
  this.ctx.batchSetItemValueByEditor(d, !0);
4863
- let u = [];
4867
+ let x = [];
4864
4868
  t.forEach((g) => {
4865
- u.push(this.ctx.database.getRowDataItemForRowKey(g));
4866
- }), this.ctx.emit("autofillChange", d, u);
4869
+ x.push(this.ctx.database.getRowDataItemForRowKey(g));
4870
+ }), this.ctx.emit("autofillChange", d, x);
4867
4871
  }
4868
4872
  mouseenter(t) {
4869
4873
  if (["index", "selection", "index-selection"].includes(t.type))
@@ -4889,7 +4893,7 @@ const rt = Math.min, U = Math.max, ft = Math.round, z = (a) => ({
4889
4893
  start: "end",
4890
4894
  end: "start"
4891
4895
  };
4892
- function It(a, t, e) {
4896
+ function _t(a, t, e) {
4893
4897
  return U(a, rt(t, e));
4894
4898
  }
4895
4899
  function at(a, t) {
@@ -4917,16 +4921,16 @@ function Ri(a, t, e) {
4917
4921
  e === void 0 && (e = !1);
4918
4922
  const i = lt(a), s = Ht(a), r = Mt(s);
4919
4923
  let o = s === "x" ? i === (e ? "end" : "start") ? "right" : "left" : i === "start" ? "bottom" : "top";
4920
- return t.reference[r] > t.floating[r] && (o = ut(o)), [o, ut(o)];
4924
+ return t.reference[r] > t.floating[r] && (o = xt(o)), [o, xt(o)];
4921
4925
  }
4922
- function _i(a) {
4923
- const t = ut(a);
4926
+ function Ii(a) {
4927
+ const t = xt(a);
4924
4928
  return [Ot(a), t, Ot(t)];
4925
4929
  }
4926
4930
  function Ot(a) {
4927
4931
  return a.replace(/start|end/g, (t) => vi[t]);
4928
4932
  }
4929
- function Ii(a, t, e) {
4933
+ function _i(a, t, e) {
4930
4934
  const i = ["left", "right"], s = ["right", "left"], r = ["top", "bottom"], o = ["bottom", "top"];
4931
4935
  switch (a) {
4932
4936
  case "top":
@@ -4941,10 +4945,10 @@ function Ii(a, t, e) {
4941
4945
  }
4942
4946
  function Oi(a, t, e, i) {
4943
4947
  const s = lt(a);
4944
- let r = Ii(G(a), e === "start", i);
4948
+ let r = _i(G(a), e === "start", i);
4945
4949
  return s && (r = r.map((o) => o + "-" + s), t && (r = r.concat(r.map(Ot)))), r;
4946
4950
  }
4947
- function ut(a) {
4951
+ function xt(a) {
4948
4952
  return a.replace(/left|right|bottom|top/g, (t) => bi[t]);
4949
4953
  }
4950
4954
  function Li(a) {
@@ -4964,7 +4968,7 @@ function le(a) {
4964
4968
  left: a
4965
4969
  };
4966
4970
  }
4967
- function xt(a) {
4971
+ function ut(a) {
4968
4972
  const {
4969
4973
  x: t,
4970
4974
  y: e,
@@ -4987,7 +4991,7 @@ function $t(a, t, e) {
4987
4991
  reference: i,
4988
4992
  floating: s
4989
4993
  } = a;
4990
- const r = J(t), o = Ht(t), n = Mt(o), h = G(t), c = r === "y", d = i.x + i.width / 2 - s.width / 2, f = i.y + i.height / 2 - s.height / 2, u = i[n] / 2 - s[n] / 2;
4994
+ const r = J(t), o = Ht(t), n = Mt(o), h = G(t), c = r === "y", d = i.x + i.width / 2 - s.width / 2, f = i.y + i.height / 2 - s.height / 2, x = i[n] / 2 - s[n] / 2;
4991
4995
  let g;
4992
4996
  switch (h) {
4993
4997
  case "top":
@@ -5022,10 +5026,10 @@ function $t(a, t, e) {
5022
5026
  }
5023
5027
  switch (lt(t)) {
5024
5028
  case "start":
5025
- g[o] -= u * (e && c ? -1 : 1);
5029
+ g[o] -= x * (e && c ? -1 : 1);
5026
5030
  break;
5027
5031
  case "end":
5028
- g[o] += u * (e && c ? -1 : 1);
5032
+ g[o] += x * (e && c ? -1 : 1);
5029
5033
  break;
5030
5034
  }
5031
5035
  return g;
@@ -5044,12 +5048,12 @@ const Si = async (a, t, e) => {
5044
5048
  }), {
5045
5049
  x: d,
5046
5050
  y: f
5047
- } = $t(c, i, h), u = i, g = {}, p = 0;
5048
- for (let x = 0; x < n.length; x++) {
5051
+ } = $t(c, i, h), x = i, g = {}, p = 0;
5052
+ for (let u = 0; u < n.length; u++) {
5049
5053
  const {
5050
5054
  name: w,
5051
5055
  fn: m
5052
- } = n[x], {
5056
+ } = n[u], {
5053
5057
  x: C,
5054
5058
  y,
5055
5059
  data: b,
@@ -5058,7 +5062,7 @@ const Si = async (a, t, e) => {
5058
5062
  x: d,
5059
5063
  y: f,
5060
5064
  initialPlacement: i,
5061
- placement: u,
5065
+ placement: x,
5062
5066
  strategy: s,
5063
5067
  middlewareData: g,
5064
5068
  rects: c,
@@ -5074,19 +5078,19 @@ const Si = async (a, t, e) => {
5074
5078
  ...g[w],
5075
5079
  ...b
5076
5080
  }
5077
- }, E && p <= 50 && (p++, typeof E == "object" && (E.placement && (u = E.placement), E.rects && (c = E.rects === !0 ? await o.getElementRects({
5081
+ }, E && p <= 50 && (p++, typeof E == "object" && (E.placement && (x = E.placement), E.rects && (c = E.rects === !0 ? await o.getElementRects({
5078
5082
  reference: a,
5079
5083
  floating: t,
5080
5084
  strategy: s
5081
5085
  }) : E.rects), {
5082
5086
  x: d,
5083
5087
  y: f
5084
- } = $t(c, u, h)), x = -1);
5088
+ } = $t(c, x, h)), u = -1);
5085
5089
  }
5086
5090
  return {
5087
5091
  x: d,
5088
5092
  y: f,
5089
- placement: u,
5093
+ placement: x,
5090
5094
  strategy: s,
5091
5095
  middlewareData: g
5092
5096
  };
@@ -5105,9 +5109,9 @@ async function he(a, t) {
5105
5109
  boundary: c = "clippingAncestors",
5106
5110
  rootBoundary: d = "viewport",
5107
5111
  elementContext: f = "floating",
5108
- altBoundary: u = !1,
5112
+ altBoundary: x = !1,
5109
5113
  padding: g = 0
5110
- } = at(t, a), p = le(g), w = n[u ? f === "floating" ? "reference" : "floating" : f], m = xt(await r.getClippingRect({
5114
+ } = at(t, a), p = le(g), w = n[x ? f === "floating" ? "reference" : "floating" : f], m = ut(await r.getClippingRect({
5111
5115
  element: (e = await (r.isElement == null ? void 0 : r.isElement(w))) == null || e ? w : w.contextElement || await (r.getDocumentElement == null ? void 0 : r.getDocumentElement(n.floating)),
5112
5116
  boundary: c,
5113
5117
  rootBoundary: d,
@@ -5123,7 +5127,7 @@ async function he(a, t) {
5123
5127
  } : {
5124
5128
  x: 1,
5125
5129
  y: 1
5126
- }, E = xt(r.convertOffsetParentRelativeRectToViewportRelativeRect ? await r.convertOffsetParentRelativeRectToViewportRelativeRect({
5130
+ }, E = ut(r.convertOffsetParentRelativeRectToViewportRelativeRect ? await r.convertOffsetParentRelativeRectToViewportRelativeRect({
5127
5131
  elements: n,
5128
5132
  rect: C,
5129
5133
  offsetParent: y,
@@ -5154,15 +5158,15 @@ const Ai = (a) => ({
5154
5158
  } = at(a, t) || {};
5155
5159
  if (c == null)
5156
5160
  return {};
5157
- const f = le(d), u = {
5161
+ const f = le(d), x = {
5158
5162
  x: e,
5159
5163
  y: i
5160
- }, g = Ht(s), p = Mt(g), x = await o.getDimensions(c), w = g === "y", m = w ? "top" : "left", C = w ? "bottom" : "right", y = w ? "clientHeight" : "clientWidth", b = r.reference[p] + r.reference[g] - u[g] - r.floating[p], E = u[g] - r.reference[g], v = await (o.getOffsetParent == null ? void 0 : o.getOffsetParent(c));
5161
- let I = v ? v[y] : 0;
5162
- (!I || !await (o.isElement == null ? void 0 : o.isElement(v))) && (I = n.floating[y] || r.floating[p]);
5163
- const L = b / 2 - E / 2, _ = I / 2 - x[p] / 2 - 1, R = rt(f[m], _), A = rt(f[C], _), S = R, M = I - x[p] - A, T = I / 2 - x[p] / 2 + L, B = It(S, T, M), Y = !h.arrow && lt(s) != null && T !== B && r.reference[p] / 2 - (T < S ? R : A) - x[p] / 2 < 0, k = Y ? T < S ? T - S : T - M : 0;
5164
+ }, g = Ht(s), p = Mt(g), u = await o.getDimensions(c), w = g === "y", m = w ? "top" : "left", C = w ? "bottom" : "right", y = w ? "clientHeight" : "clientWidth", b = r.reference[p] + r.reference[g] - x[g] - r.floating[p], E = x[g] - r.reference[g], v = await (o.getOffsetParent == null ? void 0 : o.getOffsetParent(c));
5165
+ let _ = v ? v[y] : 0;
5166
+ (!_ || !await (o.isElement == null ? void 0 : o.isElement(v))) && (_ = n.floating[y] || r.floating[p]);
5167
+ const L = b / 2 - E / 2, I = _ / 2 - u[p] / 2 - 1, R = rt(f[m], I), A = rt(f[C], I), S = R, M = _ - u[p] - A, T = _ / 2 - u[p] / 2 + L, B = _t(S, T, M), Y = !h.arrow && lt(s) != null && T !== B && r.reference[p] / 2 - (T < S ? R : A) - u[p] / 2 < 0, k = Y ? T < S ? T - S : T - M : 0;
5164
5168
  return {
5165
- [g]: u[g] + k,
5169
+ [g]: x[g] + k,
5166
5170
  data: {
5167
5171
  [g]: B,
5168
5172
  centerOffset: T - B - k,
@@ -5189,28 +5193,28 @@ const Ai = (a) => ({
5189
5193
  } = t, {
5190
5194
  mainAxis: d = !0,
5191
5195
  crossAxis: f = !0,
5192
- fallbackPlacements: u,
5196
+ fallbackPlacements: x,
5193
5197
  fallbackStrategy: g = "bestFit",
5194
5198
  fallbackAxisSideDirection: p = "none",
5195
- flipAlignment: x = !0,
5199
+ flipAlignment: u = !0,
5196
5200
  ...w
5197
5201
  } = at(a, t);
5198
5202
  if ((e = r.arrow) != null && e.alignmentOffset)
5199
5203
  return {};
5200
- const m = G(s), C = J(n), y = G(n) === n, b = await (h.isRTL == null ? void 0 : h.isRTL(c.floating)), E = u || (y || !x ? [ut(n)] : _i(n)), v = p !== "none";
5201
- !u && v && E.push(...Oi(n, x, p, b));
5202
- const I = [n, ...E], L = await he(t, w), _ = [];
5204
+ const m = G(s), C = J(n), y = G(n) === n, b = await (h.isRTL == null ? void 0 : h.isRTL(c.floating)), E = x || (y || !u ? [xt(n)] : Ii(n)), v = p !== "none";
5205
+ !x && v && E.push(...Oi(n, u, p, b));
5206
+ const _ = [n, ...E], L = await he(t, w), I = [];
5203
5207
  let R = ((i = r.flip) == null ? void 0 : i.overflows) || [];
5204
- if (d && _.push(L[m]), f) {
5208
+ if (d && I.push(L[m]), f) {
5205
5209
  const T = Ri(s, o, b);
5206
- _.push(L[T[0]], L[T[1]]);
5210
+ I.push(L[T[0]], L[T[1]]);
5207
5211
  }
5208
5212
  if (R = [...R, {
5209
5213
  placement: s,
5210
- overflows: _
5211
- }], !_.every((T) => T <= 0)) {
5214
+ overflows: I
5215
+ }], !I.every((T) => T <= 0)) {
5212
5216
  var A, S;
5213
- const T = (((A = r.flip) == null ? void 0 : A.index) || 0) + 1, B = I[T];
5217
+ const T = (((A = r.flip) == null ? void 0 : A.index) || 0) + 1, B = _[T];
5214
5218
  if (B)
5215
5219
  return {
5216
5220
  data: {
@@ -5260,7 +5264,7 @@ async function Mi(a, t) {
5260
5264
  elements: s
5261
5265
  } = a, r = await (i.isRTL == null ? void 0 : i.isRTL(s.floating)), o = G(e), n = lt(e), h = J(e) === "y", c = ["left", "top"].includes(o) ? -1 : 1, d = r && h ? -1 : 1, f = at(t, a);
5262
5266
  let {
5263
- mainAxis: u,
5267
+ mainAxis: x,
5264
5268
  crossAxis: g,
5265
5269
  alignmentAxis: p
5266
5270
  } = typeof f == "number" ? {
@@ -5274,9 +5278,9 @@ async function Mi(a, t) {
5274
5278
  };
5275
5279
  return n && typeof p == "number" && (g = n === "end" ? p * -1 : p), h ? {
5276
5280
  x: g * d,
5277
- y: u * c
5281
+ y: x * c
5278
5282
  } : {
5279
- x: u * c,
5283
+ x: x * c,
5280
5284
  y: g * d
5281
5285
  };
5282
5286
  }
@@ -5330,28 +5334,28 @@ const Hi = function(a) {
5330
5334
  } = at(a, t), c = {
5331
5335
  x: e,
5332
5336
  y: i
5333
- }, d = await he(t, h), f = J(G(s)), u = ae(f);
5334
- let g = c[u], p = c[f];
5337
+ }, d = await he(t, h), f = J(G(s)), x = ae(f);
5338
+ let g = c[x], p = c[f];
5335
5339
  if (r) {
5336
- const w = u === "y" ? "top" : "left", m = u === "y" ? "bottom" : "right", C = g + d[w], y = g - d[m];
5337
- g = It(C, g, y);
5340
+ const w = x === "y" ? "top" : "left", m = x === "y" ? "bottom" : "right", C = g + d[w], y = g - d[m];
5341
+ g = _t(C, g, y);
5338
5342
  }
5339
5343
  if (o) {
5340
5344
  const w = f === "y" ? "top" : "left", m = f === "y" ? "bottom" : "right", C = p + d[w], y = p - d[m];
5341
- p = It(C, p, y);
5345
+ p = _t(C, p, y);
5342
5346
  }
5343
- const x = n.fn({
5347
+ const u = n.fn({
5344
5348
  ...t,
5345
- [u]: g,
5349
+ [x]: g,
5346
5350
  [f]: p
5347
5351
  });
5348
5352
  return {
5349
- ...x,
5353
+ ...u,
5350
5354
  data: {
5351
- x: x.x - e,
5352
- y: x.y - i,
5355
+ x: u.x - e,
5356
+ y: u.y - i,
5353
5357
  enabled: {
5354
- [u]: r,
5358
+ [x]: r,
5355
5359
  [f]: o
5356
5360
  }
5357
5361
  }
@@ -5478,11 +5482,11 @@ function fe(a) {
5478
5482
  $: n
5479
5483
  };
5480
5484
  }
5481
- function ue(a) {
5485
+ function xe(a) {
5482
5486
  return F(a) ? a : a.contextElement;
5483
5487
  }
5484
5488
  function Z(a) {
5485
- const t = ue(a);
5489
+ const t = xe(a);
5486
5490
  if (!K(t))
5487
5491
  return z(1);
5488
5492
  const e = t.getBoundingClientRect(), {
@@ -5497,7 +5501,7 @@ function Z(a) {
5497
5501
  };
5498
5502
  }
5499
5503
  const Xi = /* @__PURE__ */ z(0);
5500
- function xe(a) {
5504
+ function ue(a) {
5501
5505
  const t = N(a);
5502
5506
  return !Nt() || !t.visualViewport ? Xi : {
5503
5507
  x: t.visualViewport.offsetLeft,
@@ -5509,20 +5513,20 @@ function Bi(a, t, e) {
5509
5513
  }
5510
5514
  function ot(a, t, e, i) {
5511
5515
  t === void 0 && (t = !1), e === void 0 && (e = !1);
5512
- const s = a.getBoundingClientRect(), r = ue(a);
5516
+ const s = a.getBoundingClientRect(), r = xe(a);
5513
5517
  let o = z(1);
5514
5518
  t && (i ? F(i) && (o = Z(i)) : o = Z(a));
5515
- const n = Bi(r, e, i) ? xe(r) : z(0);
5519
+ const n = Bi(r, e, i) ? ue(r) : z(0);
5516
5520
  let h = (s.left + n.x) / o.x, c = (s.top + n.y) / o.y, d = s.width / o.x, f = s.height / o.y;
5517
5521
  if (r) {
5518
- const u = N(r), g = i && F(i) ? N(i) : i;
5519
- let p = u, x = St(p);
5520
- for (; x && i && g !== p; ) {
5521
- const w = Z(x), m = x.getBoundingClientRect(), C = X(x), y = m.left + (x.clientLeft + parseFloat(C.paddingLeft)) * w.x, b = m.top + (x.clientTop + parseFloat(C.paddingTop)) * w.y;
5522
- h *= w.x, c *= w.y, d *= w.x, f *= w.y, h += y, c += b, p = N(x), x = St(p);
5522
+ const x = N(r), g = i && F(i) ? N(i) : i;
5523
+ let p = x, u = St(p);
5524
+ for (; u && i && g !== p; ) {
5525
+ const w = Z(u), m = u.getBoundingClientRect(), C = X(u), y = m.left + (u.clientLeft + parseFloat(C.paddingLeft)) * w.x, b = m.top + (u.clientTop + parseFloat(C.paddingTop)) * w.y;
5526
+ h *= w.x, c *= w.y, d *= w.x, f *= w.y, h += y, c += b, p = N(u), u = St(p);
5523
5527
  }
5524
5528
  }
5525
- return xt({
5529
+ return ut({
5526
5530
  width: d,
5527
5531
  height: f,
5528
5532
  x: h,
@@ -5545,8 +5549,8 @@ function ki(a) {
5545
5549
  }, c = z(1);
5546
5550
  const d = z(0), f = K(i);
5547
5551
  if ((f || !f && !r) && ((tt(i) !== "body" || ht(o)) && (h = pt(i)), K(i))) {
5548
- const u = ot(i);
5549
- c = Z(i), d.x = u.x + i.clientLeft, d.y = u.y + i.clientTop;
5552
+ const x = ot(i);
5553
+ c = Z(i), d.x = x.x + i.clientLeft, d.y = x.y + i.clientTop;
5550
5554
  }
5551
5555
  return {
5552
5556
  width: e.width * c.x,
@@ -5606,14 +5610,14 @@ function Gt(a, t, e) {
5606
5610
  else if (F(t))
5607
5611
  i = Wi(t, e);
5608
5612
  else {
5609
- const s = xe(a);
5613
+ const s = ue(a);
5610
5614
  i = {
5611
5615
  ...t,
5612
5616
  x: t.x - s.x,
5613
5617
  y: t.y - s.y
5614
5618
  };
5615
5619
  }
5616
- return xt(i);
5620
+ return ut(i);
5617
5621
  }
5618
5622
  function ge(a, t) {
5619
5623
  const e = $(a);
@@ -5678,10 +5682,10 @@ function qi(a, t, e) {
5678
5682
  d = g.top + n.scrollTop, c = g.left + n.scrollLeft - // RTL <body> scrollbar.
5679
5683
  At(s, g);
5680
5684
  }
5681
- const f = o.left + n.scrollLeft - h.x - c, u = o.top + n.scrollTop - h.y - d;
5685
+ const f = o.left + n.scrollLeft - h.x - c, x = o.top + n.scrollTop - h.y - d;
5682
5686
  return {
5683
5687
  x: f,
5684
- y: u,
5688
+ y: x,
5685
5689
  width: o.width,
5686
5690
  height: o.height
5687
5691
  };
@@ -5833,26 +5837,26 @@ let Ji = class {
5833
5837
  top: `${c}px`,
5834
5838
  left: `${h}px`
5835
5839
  }), f.arrow) {
5836
- const u = f.arrow;
5840
+ const x = f.arrow;
5837
5841
  ["left", "left-start", "left-end"].includes(d) ? Object.assign(this.arrowEl.style, {
5838
- top: `${u.y}px`,
5842
+ top: `${x.y}px`,
5839
5843
  bottom: "",
5840
5844
  left: "",
5841
5845
  right: "-5px"
5842
5846
  }) : ["right", "right-start", "right-end"].includes(d) ? Object.assign(this.arrowEl.style, {
5843
- top: `${u.y}px`,
5847
+ top: `${x.y}px`,
5844
5848
  bottom: "",
5845
5849
  left: "-5px",
5846
5850
  right: ""
5847
5851
  }) : ["bottom", "bottom-start", "bottom-end"].includes(d) ? Object.assign(this.arrowEl.style, {
5848
5852
  top: "-5px",
5849
5853
  bottom: "",
5850
- left: `${u.x}px`,
5854
+ left: `${x.x}px`,
5851
5855
  right: ""
5852
5856
  }) : ["top", "top-start", "top-end"].includes(d) && Object.assign(this.arrowEl.style, {
5853
5857
  top: "",
5854
5858
  bottom: "-5px",
5855
- left: `${u.x}px`,
5859
+ left: `${x.x}px`,
5856
5860
  right: ""
5857
5861
  });
5858
5862
  }
@@ -6016,8 +6020,8 @@ class Qi {
6016
6020
  let f = this.ctx.body.visibleHeight;
6017
6021
  if (r > f && (r = f), this.editorEl.style.display = "inline-block", this.editorEl.style.left = `${this.drawX - 1}px`, this.editorEl.style.top = `${this.drawY - 1}px`, this.editorEl.style.bottom = "auto", this.editorEl.style.maxHeight = `${f}px`, s === "text") {
6018
6022
  this.inputEl.style.display = "block", this.inputEl.style.minWidth = `${o - 1}px`, this.inputEl.style.minHeight = `${r - 1}px`, this.inputEl.style.maxHeight = `${f}px`, this.inputEl.style.width = `${o - 1}px`, this.inputEl.style.height = "auto", this.inputEl.style.padding = `${c}px`, i !== null && (this.inputEl.value = i), this.inputEl.focus({ preventScroll: !0 });
6019
- const u = this.inputEl.value.length;
6020
- this.inputEl.setSelectionRange(u, u);
6023
+ const x = this.inputEl.value.length;
6024
+ this.inputEl.setSelectionRange(x, x);
6021
6025
  } else
6022
6026
  this.inputEl.style.display = "none";
6023
6027
  (this.inputEl.scrollHeight > r || this.drawY < d.height) && this.autoSize();
@@ -6124,7 +6128,7 @@ class es {
6124
6128
  n.forEach((w) => {
6125
6129
  w.render && (w.fixed === "left" ? c.push(w) : w.fixed === "right" ? d.push(w) : h.push(w));
6126
6130
  });
6127
- const f = e - i, u = {
6131
+ const f = e - i, x = {
6128
6132
  key: "left",
6129
6133
  style: {
6130
6134
  position: "absolute",
@@ -6167,7 +6171,7 @@ class es {
6167
6171
  width: `${r}px`,
6168
6172
  height: `${o}px`
6169
6173
  },
6170
- views: [u, g, p]
6174
+ views: [x, g, p]
6171
6175
  };
6172
6176
  }
6173
6177
  getBody() {
@@ -6182,7 +6186,7 @@ class es {
6182
6186
  fixedLeftWidth: r,
6183
6187
  fixedRightWidth: o,
6184
6188
  config: { SCROLLER_TRACK_SIZE: n, CSS_PREFIX: h }
6185
- } = this.ctx, { visibleWidth: c, visibleHeight: d } = this.ctx.body, f = o - n, u = {
6189
+ } = this.ctx, { visibleWidth: c, visibleHeight: d } = this.ctx.body, f = o - n, x = {
6186
6190
  key: "left",
6187
6191
  style: {
6188
6192
  position: "absolute",
@@ -6225,13 +6229,13 @@ class es {
6225
6229
  width: `${c}px`,
6226
6230
  height: `${d}px`
6227
6231
  },
6228
- views: [u, g, p]
6232
+ views: [x, g, p]
6229
6233
  };
6230
6234
  }
6231
6235
  getFooter() {
6232
6236
  const t = [], e = [], i = [];
6233
- this.ctx.footer.renderRows.forEach((x) => {
6234
- x.cells.forEach((w) => {
6237
+ this.ctx.footer.renderRows.forEach((u) => {
6238
+ u.cells.forEach((w) => {
6235
6239
  w.cellType === "footer" && w.renderFooter && (w.render = w.renderFooter, w.fixed === "left" ? e.push(w) : w.fixed === "right" ? i.push(w) : t.push(w));
6236
6240
  });
6237
6241
  });
@@ -6250,7 +6254,7 @@ class es {
6250
6254
  height: `${c}px`
6251
6255
  },
6252
6256
  cells: e
6253
- }, u = {
6257
+ }, x = {
6254
6258
  key: "center",
6255
6259
  style: {
6256
6260
  position: "absolute",
@@ -6282,7 +6286,7 @@ class es {
6282
6286
  width: `${h}px`,
6283
6287
  height: `${c}px`
6284
6288
  },
6285
- views: [f, u, g]
6289
+ views: [f, x, g]
6286
6290
  };
6287
6291
  }
6288
6292
  }
@@ -6299,7 +6303,7 @@ class is {
6299
6303
  e.preventDefault();
6300
6304
  const { xArr: i, yArr: s } = this.ctx.selector, [r, o] = i, [n, h] = s, { rowIndex: c, colIndex: d } = t;
6301
6305
  c >= n && c <= h && d >= r && d <= o || this.ctx.emit("setSelectorCell", t, e);
6302
- const u = {
6306
+ const x = {
6303
6307
  getBoundingClientRect: () => ({
6304
6308
  width: 0,
6305
6309
  height: 0,
@@ -6312,7 +6316,7 @@ class is {
6312
6316
  }),
6313
6317
  contextElement: document.body
6314
6318
  };
6315
- Ee(u, this.contextMenuEl, {
6319
+ Ee(x, this.contextMenuEl, {
6316
6320
  placement: "right-start",
6317
6321
  middleware: [pe(), me(), ye()]
6318
6322
  }).then(({ x: g, y: p }) => {
@@ -6446,7 +6450,7 @@ class os {
6446
6450
  this.ctx.off(t, e);
6447
6451
  }
6448
6452
  filterMethod(t) {
6449
- this.scrollTo(0, 0), this.ctx.database.setFilterMethod(t), this.ctx.database.init(), this.ctx.emit("draw");
6453
+ this.scrollTo(0, 0), this.ctx.database.setFilterMethod(t), this.ctx.database.init(), this.header.init(), this.ctx.emit("draw");
6450
6454
  }
6451
6455
  editCell(t, e) {
6452
6456
  this.editor.editCell(t, e);