e-virt-table 0.1.2 → 0.1.4

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
@@ -1,7 +1,7 @@
1
- (function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode(':root{--e-virt-table-color-white: #fff;--e-virt-table-color-black: #000000;--e-virt-table-color-primary: rgb(82, 146, 247);--e-virt-table-text-color-primary: #333;--e-virt-table-text-color-regular: #666;--e-virt-table-text-color-secondary: #999;--e-virt-table-box-shadow: 0 2px 12px 0 #0000001a;--e-virt-table-editor-bg-color: #fff;--e-virt-table-border-color: #e1e6eb}.e-virt-table-container{position:relative;outline:none}.e-virt-table-stage{position:relative;overflow:hidden;outline:none;z-index:10;border-radius:8px;border:1px solid var(--e-virt-table-border-color)}.e-virt-table-canvas{position:absolute;left:0;top:0;box-sizing:border-box;border:none;outline:none}.e-virt-table-editor{position:absolute;top:-10000px;left:-10000px;text-align:left;line-height:0;z-index:100;overflow:hidden;background-color:var(--e-virt-table-editor-bg-color);border:2px solid var(--e-virt-table-color-primary);box-sizing:border-box;box-shadow:var(--e-virt-table-box-shadow);display:flex;align-items:center}.e-virt-table-overlayer{position:"absolute";left:0;top:0;overflow:hidden;z-index:10}.e-virt-table-editor-textarea{width:100%;box-sizing:border-box;outline:none;font-weight:400;padding:8px;font-size:12px;color:inherit;white-space:pre-wrap;word-wrap:break-word;word-break:break-all;line-height:1.5;margin:0;border:none;vertical-align:middle;background:var(--e-virt-table-color-white);overflow-y:auto;resize:none}.e-virt-table-context-menu{position:absolute;font-size:14px;color:var(--e-virt-table-text-color-regular);background-color:var(--e-virt-table-color-white);border-radius:4px;border:1px solid #e4e7ed;box-shadow:var(--e-virt-table-box-shadow);width:fit-content;padding:6px 0;z-index:9999;left:-99999px;top:-99999px}.e-virt-table-context-menu-item{cursor:pointer;padding:8px 24px;color:var(--e-virt-table-text-color-regular)}.e-virt-table-context-menu-item:hover{color:var(--e-virt-table-color-primary);background-color:#f5f7fa}')),document.head.appendChild(e)}}catch(o){console.error("vite-plugin-css-injected-by-js",o)}})();
1
+ (function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode(':root{--e-virt-table-color-white: #fff;--e-virt-table-color-black: #000000;--e-virt-table-color-primary: rgb(82, 146, 247);--e-virt-table-text-color-primary: #333;--e-virt-table-text-color-regular: #666;--e-virt-table-text-color-secondary: #999;--e-virt-table-box-shadow: 0 2px 12px 0 #0000001a;--e-virt-table-editor-bg-color: #fff;--e-virt-table-border-color: #e1e6eb}.e-virt-table-container{position:relative;outline:none}.e-virt-table-stage{position:relative;overflow:hidden;outline:none;z-index:10;border-radius:8px;border:1px solid var(--e-virt-table-border-color)}.e-virt-table-canvas{position:absolute;left:0;top:0;box-sizing:border-box;border:none;outline:none;z-index:10px}.e-virt-table-editor{position:absolute;top:-10000px;left:-10000px;text-align:left;height:auto;line-height:0;z-index:100;overflow:hidden;background-color:var(--e-virt-table-editor-bg-color);border:2px solid var(--e-virt-table-color-primary);box-sizing:border-box;box-shadow:var(--e-virt-table-box-shadow);display:flex;align-items:center}.e-virt-table-overlayer{position:"absolute";left:0;top:0;overflow:hidden;z-index:10}.e-virt-table-editor-textarea{width:100%;box-sizing:border-box;outline:none;font-weight:400;padding:8px;font-size:12px;color:inherit;white-space:pre-wrap;word-wrap:break-word;word-break:break-all;line-height:1.5;margin:0;border:none;vertical-align:middle;background:var(--e-virt-table-color-white);overflow-y:auto;resize:none}.e-virt-table-context-menu{position:absolute;font-size:14px;color:var(--e-virt-table-text-color-regular);background-color:var(--e-virt-table-color-white);border-radius:4px;border:1px solid #e4e7ed;box-shadow:var(--e-virt-table-box-shadow);width:fit-content;padding:6px 0;z-index:9999;left:-99999px;top:-99999px}.e-virt-table-context-menu-item{cursor:pointer;padding:8px 24px;color:var(--e-virt-table-text-color-regular)}.e-virt-table-context-menu-item:hover{color:var(--e-virt-table-color-primary);background-color:#f5f7fa}')),document.head.appendChild(e)}}catch(o){console.error("vite-plugin-css-injected-by-js",o)}})();
2
2
  var me = Object.defineProperty;
3
3
  var Ee = (n, t, e) => t in n ? me(n, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : n[t] = e;
4
- var c = (n, t, e) => Ee(n, typeof t != "symbol" ? t + "" : t, e);
4
+ var l = (n, t, e) => Ee(n, typeof t != "symbol" ? t + "" : t, e);
5
5
  function $() {
6
6
  return $ = Object.assign ? Object.assign.bind() : function(n) {
7
7
  for (var t = 1; t < arguments.length; t++) {
@@ -39,8 +39,8 @@ function dt(n, t, e) {
39
39
  return Ce() ? dt = Reflect.construct.bind() : dt = function(s, r, o) {
40
40
  var a = [null];
41
41
  a.push.apply(a, r);
42
- var h = Function.bind.apply(s, a), l = new h();
43
- return o && st(l, o.prototype), l;
42
+ var h = Function.bind.apply(s, a), c = new h();
43
+ return o && st(c, o.prototype), c;
44
44
  }, dt.apply(null, arguments);
45
45
  }
46
46
  function ve(n) {
@@ -69,9 +69,9 @@ function bt(n) {
69
69
  }), st(s, i);
70
70
  }, bt(n);
71
71
  }
72
- var Re = /%[sdj%]/g, Jt = function() {
72
+ var Re = /%[sdj%]/g, Gt = function() {
73
73
  };
74
- typeof process < "u" && process.env && process.env.NODE_ENV !== "production" && typeof window < "u" && typeof document < "u" && (Jt = function(t, e) {
74
+ typeof process < "u" && process.env && process.env.NODE_ENV !== "production" && typeof window < "u" && typeof document < "u" && (Gt = function(t, e) {
75
75
  typeof console < "u" && console.warn && typeof ASYNC_VALIDATOR_NO_WARNING > "u" && e.every(function(i) {
76
76
  return typeof i == "string";
77
77
  }) && console.warn(t, e);
@@ -131,7 +131,7 @@ function Ie(n, t, e) {
131
131
  t(a, o);
132
132
  });
133
133
  }
134
- function Yt(n, t, e) {
134
+ function Xt(n, t, e) {
135
135
  var i = 0, s = n.length;
136
136
  function r(o) {
137
137
  if (o && o.length) {
@@ -149,7 +149,7 @@ function Oe(n) {
149
149
  t.push.apply(t, n[e] || []);
150
150
  }), t;
151
151
  }
152
- var Kt = /* @__PURE__ */ function(n) {
152
+ var Ft = /* @__PURE__ */ function(n) {
153
153
  be(t, n);
154
154
  function t(e, i) {
155
155
  var s;
@@ -161,22 +161,22 @@ function Te(n, t, e, i, s) {
161
161
  if (t.first) {
162
162
  var r = new Promise(function(x, u) {
163
163
  var g = function(y) {
164
- return i(y), y.length ? u(new Kt(y, Ct(y))) : x(s);
164
+ return i(y), y.length ? u(new Ft(y, Ct(y))) : x(s);
165
165
  }, w = Oe(n);
166
- Yt(w, e, g);
166
+ Xt(w, e, g);
167
167
  });
168
168
  return r.catch(function(x) {
169
169
  return x;
170
170
  }), r;
171
171
  }
172
- var o = t.firstFields === !0 ? Object.keys(n) : t.firstFields || [], a = Object.keys(n), h = a.length, l = 0, f = [], d = new Promise(function(x, u) {
172
+ var o = t.firstFields === !0 ? Object.keys(n) : t.firstFields || [], a = Object.keys(n), h = a.length, c = 0, f = [], d = new Promise(function(x, u) {
173
173
  var g = function(p) {
174
- if (f.push.apply(f, p), l++, l === h)
175
- return i(f), f.length ? u(new Kt(f, Ct(f))) : x(s);
174
+ if (f.push.apply(f, p), c++, c === h)
175
+ return i(f), f.length ? u(new Ft(f, Ct(f))) : x(s);
176
176
  };
177
177
  a.length || (i(f), x(s)), a.forEach(function(w) {
178
178
  var p = n[w];
179
- o.indexOf(w) !== -1 ? Yt(p, e, g) : Ie(p, e, g);
179
+ o.indexOf(w) !== -1 ? Xt(p, e, g) : Ie(p, e, g);
180
180
  });
181
181
  });
182
182
  return d.catch(function(x) {
@@ -194,7 +194,7 @@ function Ae(n, t) {
194
194
  }
195
195
  return e;
196
196
  }
197
- function Bt(n, t) {
197
+ function kt(n, t) {
198
198
  return function(e) {
199
199
  var i;
200
200
  return n.fullFields ? i = Ae(t, n.fullFields) : i = t[e.field || n.fullField], Se(e) ? (e.field = e.field || n.fullField, e.fieldValue = i, e) : {
@@ -204,7 +204,7 @@ function Bt(n, t) {
204
204
  };
205
205
  };
206
206
  }
207
- function Wt(n, t) {
207
+ function Nt(n, t) {
208
208
  if (t) {
209
209
  for (var e in t)
210
210
  if (t.hasOwnProperty(e)) {
@@ -214,13 +214,13 @@ function Wt(n, t) {
214
214
  }
215
215
  return n;
216
216
  }
217
- var Qt = function(t, e, i, s, r, o) {
217
+ var jt = function(t, e, i, s, r, o) {
218
218
  t.required && (!i.hasOwnProperty(t.field) || _(e, o || t.type)) && s.push(M(r.messages.required, t.fullField));
219
219
  }, Le = function(t, e, i, s, r) {
220
220
  (/^\s+$/.test(e) || e === "") && s.push(M(r.messages.whitespace, t.fullField));
221
- }, lt, Me = function() {
222
- if (lt)
223
- return lt;
221
+ }, ct, Me = function() {
222
+ if (ct)
223
+ return ct;
224
224
  var n = "[a-fA-F\\d:]", t = function(E) {
225
225
  return E && E.includeBoundaries ? "(?:(?<=\\s|^)(?=" + n + ")|(?<=" + n + ")(?=\\s|$))" : "";
226
226
  }, e = "(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)){3}", i = "[a-fA-F\\d]{1,4}", s = (`
@@ -242,9 +242,9 @@ var Qt = function(t, e, i, s, r, o) {
242
242
  }, h.v6 = function(m) {
243
243
  return m && m.exact ? a : new RegExp("" + t(m) + s + t(m), "g");
244
244
  };
245
- var l = "(?:(?:[a-z]+:)?//)", f = "(?:\\S+(?::\\S*)?@)?", d = h.v4().source, x = h.v6().source, u = "(?:(?:[a-z\\u00a1-\\uffff0-9][-_]*)*[a-z\\u00a1-\\uffff0-9]+)", g = "(?:\\.(?:[a-z\\u00a1-\\uffff0-9]-*)*[a-z\\u00a1-\\uffff0-9]+)*", w = "(?:\\.(?:[a-z\\u00a1-\\uffff]{2,}))", p = "(?::\\d{2,5})?", y = '(?:[/?#][^\\s"]*)?', b = "(?:" + l + "|www\\.)" + f + "(?:localhost|" + d + "|" + x + "|" + u + g + w + ")" + p + y;
246
- return lt = new RegExp("(?:^" + b + "$)", "i"), lt;
247
- }, Pt = {
245
+ var c = "(?:(?:[a-z]+:)?//)", f = "(?:\\S+(?::\\S*)?@)?", d = h.v4().source, x = h.v6().source, u = "(?:(?:[a-z\\u00a1-\\uffff0-9][-_]*)*[a-z\\u00a1-\\uffff0-9]+)", g = "(?:\\.(?:[a-z\\u00a1-\\uffff0-9]-*)*[a-z\\u00a1-\\uffff0-9]+)*", w = "(?:\\.(?:[a-z\\u00a1-\\uffff]{2,}))", p = "(?::\\d{2,5})?", y = '(?:[/?#][^\\s"]*)?', b = "(?:" + c + "|www\\.)" + f + "(?:localhost|" + d + "|" + x + "|" + u + g + w + ")" + p + y;
246
+ return ct = new RegExp("(?:^" + b + "$)", "i"), ct;
247
+ }, Yt = {
248
248
  // http://emailregex.com/
249
249
  email: /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+\.)+[a-zA-Z\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]{2,}))$/,
250
250
  // url: new RegExp(
@@ -284,26 +284,26 @@ var Qt = function(t, e, i, s, r, o) {
284
284
  return typeof t == "function";
285
285
  },
286
286
  email: function(t) {
287
- return typeof t == "string" && t.length <= 320 && !!t.match(Pt.email);
287
+ return typeof t == "string" && t.length <= 320 && !!t.match(Yt.email);
288
288
  },
289
289
  url: function(t) {
290
290
  return typeof t == "string" && t.length <= 2048 && !!t.match(Me());
291
291
  },
292
292
  hex: function(t) {
293
- return typeof t == "string" && !!t.match(Pt.hex);
293
+ return typeof t == "string" && !!t.match(Yt.hex);
294
294
  }
295
295
  }, He = function(t, e, i, s, r) {
296
296
  if (t.required && e === void 0) {
297
- Qt(t, e, i, s, r);
297
+ jt(t, e, i, s, r);
298
298
  return;
299
299
  }
300
300
  var o = ["integer", "float", "array", "regexp", "object", "method", "email", "number", "date", "url", "hex"], a = t.type;
301
301
  o.indexOf(a) > -1 ? et[a](e) || s.push(M(r.messages.types[a], t.fullField, t.type)) : a && typeof e !== t.type && s.push(M(r.messages.types[a], t.fullField, t.type));
302
302
  }, De = function(t, e, i, s, r) {
303
- var o = typeof t.len == "number", a = typeof t.min == "number", h = typeof t.max == "number", l = /[\uD800-\uDBFF][\uDC00-\uDFFF]/g, f = e, d = null, x = typeof e == "number", u = typeof e == "string", g = Array.isArray(e);
303
+ var o = typeof t.len == "number", a = typeof t.min == "number", h = typeof t.max == "number", c = /[\uD800-\uDBFF][\uDC00-\uDFFF]/g, f = e, d = null, x = typeof e == "number", u = typeof e == "string", g = Array.isArray(e);
304
304
  if (x ? d = "number" : u ? d = "string" : g && (d = "array"), !d)
305
305
  return !1;
306
- g && (f = e.length), u && (f = e.replace(l, "_").length), o ? f !== t.len && s.push(M(r.messages[d].len, t.fullField, t.len)) : a && !h && f < t.min ? s.push(M(r.messages[d].min, t.fullField, t.min)) : h && !a && f > t.max ? s.push(M(r.messages[d].max, t.fullField, t.max)) : a && h && (f < t.min || f > t.max) && s.push(M(r.messages[d].range, t.fullField, t.min, t.max));
306
+ g && (f = e.length), u && (f = e.replace(c, "_").length), o ? f !== t.len && s.push(M(r.messages[d].len, t.fullField, t.len)) : a && !h && f < t.min ? s.push(M(r.messages[d].min, t.fullField, t.min)) : h && !a && f > t.max ? s.push(M(r.messages[d].max, t.fullField, t.max)) : a && h && (f < t.min || f > t.max) && s.push(M(r.messages[d].range, t.fullField, t.min, t.max));
307
307
  }, j = "enum", Xe = function(t, e, i, s, r) {
308
308
  t[j] = Array.isArray(t[j]) ? t[j] : [], t[j].indexOf(e) === -1 && s.push(M(r.messages[j], t.fullField, t[j].join(", ")));
309
309
  }, Fe = function(t, e, i, s, r) {
@@ -316,7 +316,7 @@ var Qt = function(t, e, i, s, r, o) {
316
316
  }
317
317
  }
318
318
  }, v = {
319
- required: Qt,
319
+ required: jt,
320
320
  whitespace: Le,
321
321
  type: He,
322
322
  range: De,
@@ -528,14 +528,14 @@ var Rt = vt(), nt = /* @__PURE__ */ function() {
528
528
  s.rules[r] = Array.isArray(o) ? o : [o];
529
529
  });
530
530
  }, t.messages = function(i) {
531
- return i && (this._messages = Wt(vt(), i)), this._messages;
531
+ return i && (this._messages = Nt(vt(), i)), this._messages;
532
532
  }, t.validate = function(i, s, r) {
533
533
  var o = this;
534
534
  s === void 0 && (s = {}), r === void 0 && (r = function() {
535
535
  });
536
- var a = i, h = s, l = r;
537
- if (typeof h == "function" && (l = h, h = {}), !this.rules || Object.keys(this.rules).length === 0)
538
- return l && l(null, a), Promise.resolve(a);
536
+ var a = i, h = s, c = r;
537
+ if (typeof h == "function" && (c = h, h = {}), !this.rules || Object.keys(this.rules).length === 0)
538
+ return c && c(null, a), Promise.resolve(a);
539
539
  function f(w) {
540
540
  var p = [], y = {};
541
541
  function b(E) {
@@ -547,11 +547,11 @@ var Rt = vt(), nt = /* @__PURE__ */ function() {
547
547
  }
548
548
  for (var m = 0; m < w.length; m++)
549
549
  b(w[m]);
550
- p.length ? (y = Ct(p), l(p, y)) : l(null, a);
550
+ p.length ? (y = Ct(p), c(p, y)) : c(null, a);
551
551
  }
552
552
  if (h.messages) {
553
553
  var d = this.messages();
554
- d === Rt && (d = vt()), Wt(d, h.messages), h.messages = d;
554
+ d === Rt && (d = vt()), Nt(d, h.messages), h.messages = d;
555
555
  } else
556
556
  h.messages = this.messages();
557
557
  var x = {}, u = h.keys || Object.keys(this.rules);
@@ -583,14 +583,14 @@ var Rt = vt(), nt = /* @__PURE__ */ function() {
583
583
  R === void 0 && (R = []);
584
584
  var T = Array.isArray(R) ? R : [R];
585
585
  !h.suppressWarning && T.length && n.warning("async-validator:", T), T.length && y.message !== void 0 && (T = [].concat(y.message));
586
- var A = T.map(Bt(y, a));
586
+ var A = T.map(kt(y, a));
587
587
  if (h.first && A.length)
588
588
  return g[y.field] = 1, p(A);
589
589
  if (!b)
590
590
  p(A);
591
591
  else {
592
592
  if (y.required && !w.value)
593
- return y.message !== void 0 ? A = [].concat(y.message).map(Bt(y, a)) : h.error && (A = [h.error(y, M(h.messages.required, y.field))]), p(A);
593
+ return y.message !== void 0 ? A = [].concat(y.message).map(kt(y, a)) : h.error && (A = [h.error(y, M(h.messages.required, y.field))]), p(A);
594
594
  var L = {};
595
595
  y.defaultField && Object.keys(w.value).map(function(I) {
596
596
  L[I] = y.defaultField;
@@ -644,16 +644,16 @@ nt.register = function(t, e) {
644
644
  throw new Error("Cannot register a validator by type, validator is not a function");
645
645
  it[t] = e;
646
646
  };
647
- nt.warning = Jt;
647
+ nt.warning = Gt;
648
648
  nt.messages = Rt;
649
649
  nt.validators = it;
650
- function te() {
650
+ function Ut() {
651
651
  return "xxxxxxxxxxxxxxxxxx".replace(/[x]/g, function(n) {
652
652
  const t = Math.random() * 16 | 0;
653
653
  return (n === "x" ? t : t & 3 | 8).toString(16);
654
654
  });
655
655
  }
656
- function ee(n, t) {
656
+ function Zt(n, t) {
657
657
  let e = 0, i;
658
658
  return function(...s) {
659
659
  const r = (/* @__PURE__ */ new Date()).getTime(), o = r - e;
@@ -662,8 +662,8 @@ function ee(n, t) {
662
662
  }, t - o));
663
663
  };
664
664
  }
665
- function ie(n) {
666
- return n ? n.map((t) => ie(t.children) + 1).sort((t, e) => e - t)[0] : 0;
665
+ function Jt(n) {
666
+ return n ? n.map((t) => Jt(t.children) + 1).sort((t, e) => e - t)[0] : 0;
667
667
  }
668
668
  function Je(n = []) {
669
669
  let t = [], e = [], i = [];
@@ -675,14 +675,14 @@ function Je(n = []) {
675
675
  ...i.sort((s, r) => s.sort - r.sort)
676
676
  ];
677
677
  }
678
- function se(n = [], t = 1, e = 0) {
678
+ function Qt(n = [], t = 1, e = 0) {
679
679
  return n.map((i) => {
680
680
  if (i.children) {
681
681
  let s = 0, r = i.fixed;
682
682
  i.children.forEach((a) => {
683
683
  a.fixed = r;
684
684
  });
685
- const o = se(i.children, t - 1, e + 1);
685
+ const o = Qt(i.children, t - 1, e + 1);
686
686
  return o && o.forEach((a) => {
687
687
  s += a.colspan;
688
688
  }), {
@@ -708,17 +708,17 @@ function _t(n = []) {
708
708
  e.children ? t = t.concat(_t(e.children)) : t.push(e);
709
709
  }), t;
710
710
  }
711
- const Vt = /^(\r\n|\n\r|\r|\n)/, Qe = /^[^\t\r\n]+/, zt = /^\t/;
711
+ const Kt = /^(\r\n|\n\r|\r|\n)/, Qe = /^[^\t\r\n]+/, Bt = /^\t/;
712
712
  function ti(n) {
713
713
  let t = [[""]];
714
714
  if (n.length === 0)
715
715
  return t;
716
716
  let e = 0, i = 0, s;
717
717
  for (; n.length > 0 && s !== n.length; )
718
- if (s = n.length, n.match(zt))
719
- n = n.replace(zt, ""), e += 1, t[i][e] = "";
720
- else if (n.match(Vt))
721
- n = n.replace(Vt, ""), e = 0, i += 1, t[i] = [""];
718
+ if (s = n.length, n.match(Bt))
719
+ n = n.replace(Bt, ""), e += 1, t[i][e] = "";
720
+ else if (n.match(Kt))
721
+ n = n.replace(Kt, ""), e = 0, i += 1, t[i] = [""];
722
722
  else {
723
723
  let r = "";
724
724
  if (n.startsWith('"')) {
@@ -750,24 +750,24 @@ function ei(n) {
750
750
  class ii {
751
751
  //虚拟滚动位置
752
752
  constructor(t, e) {
753
- c(this, "loading", !1);
754
- c(this, "ctx");
755
- c(this, "data");
756
- c(this, "columns");
757
- c(this, "footerData", []);
758
- c(this, "rowKeyMap", /* @__PURE__ */ new Map());
759
- c(this, "colIndexKeyMap", /* @__PURE__ */ new Map());
760
- c(this, "headerMap", /* @__PURE__ */ new Map());
761
- c(this, "rowIndexRowKeyMap", /* @__PURE__ */ new Map());
762
- c(this, "checkboxKeyMap", /* @__PURE__ */ new Map());
763
- c(this, "originalDataMap", /* @__PURE__ */ new Map());
764
- c(this, "changedDataMap", /* @__PURE__ */ new Map());
765
- c(this, "validationErrorMap", /* @__PURE__ */ new Map());
766
- c(this, "itemRowKeyMap", /* @__PURE__ */ new WeakMap());
767
- c(this, "bufferData", []);
768
- c(this, "sumHeight", 0);
769
- c(this, "filterMethod");
770
- c(this, "positions", []);
753
+ l(this, "loading", !1);
754
+ l(this, "ctx");
755
+ l(this, "data");
756
+ l(this, "columns");
757
+ l(this, "footerData", []);
758
+ l(this, "rowKeyMap", /* @__PURE__ */ new Map());
759
+ l(this, "colIndexKeyMap", /* @__PURE__ */ new Map());
760
+ l(this, "headerMap", /* @__PURE__ */ new Map());
761
+ l(this, "rowIndexRowKeyMap", /* @__PURE__ */ new Map());
762
+ l(this, "checkboxKeyMap", /* @__PURE__ */ new Map());
763
+ l(this, "originalDataMap", /* @__PURE__ */ new Map());
764
+ l(this, "changedDataMap", /* @__PURE__ */ new Map());
765
+ l(this, "validationErrorMap", /* @__PURE__ */ new Map());
766
+ l(this, "itemRowKeyMap", /* @__PURE__ */ new WeakMap());
767
+ l(this, "bufferData", []);
768
+ l(this, "sumHeight", 0);
769
+ l(this, "filterMethod");
770
+ l(this, "positions", []);
771
771
  this.ctx = t;
772
772
  const { data: i = [], columns: s = [], footerData: r = [] } = e;
773
773
  this.data = i, this.footerData = r, this.columns = s, this.setLoading(!0), this.init();
@@ -790,11 +790,11 @@ class ii {
790
790
  t.forEach((i, s) => {
791
791
  let r = !1;
792
792
  Array.isArray(i.children) && (r = !0, this.initData(i.children, e + 1));
793
- const { ROW_KEY: o = "", DEFAULT_EXPAND_ALL: a, CELL_HEIGHT: h, SELECTABLE_METHOD: l, CHECKBOX_KEY: f } = this.ctx.config, d = i[o], x = d ?? te();
793
+ const { ROW_KEY: o = "", DEFAULT_EXPAND_ALL: a, CELL_HEIGHT: h, SELECTABLE_METHOD: c, CHECKBOX_KEY: f } = this.ctx.config, d = i[o], x = d ?? Ut();
794
794
  this.itemRowKeyMap.set(i, x);
795
795
  const u = i._height || h, g = i._readonly;
796
796
  let w = !0;
797
- if (typeof l == "function" && (w = l), f) {
797
+ if (typeof c == "function" && (w = c), f) {
798
798
  const p = i[f];
799
799
  if (this.checkboxKeyMap.has(p)) {
800
800
  const y = this.checkboxKeyMap.get(p);
@@ -874,12 +874,12 @@ class ii {
874
874
  const i = (r) => {
875
875
  r.forEach((o) => {
876
876
  t.push(o);
877
- const a = this.itemRowKeyMap.get(o), { expand: h, hasChildren: l, height: f } = this.rowKeyMap.get(a), d = this.sumHeight;
877
+ const a = this.itemRowKeyMap.get(o), { expand: h, hasChildren: c, height: f } = this.rowKeyMap.get(a), d = this.sumHeight;
878
878
  this.sumHeight += f, this.rowIndexRowKeyMap.set(e, a), this.positions.push({
879
879
  top: d,
880
880
  height: f,
881
881
  bottom: this.sumHeight
882
- }), e += 1, h && l && i(o.children);
882
+ }), e += 1, h && c && i(o.children);
883
883
  });
884
884
  };
885
885
  this.rowIndexRowKeyMap.clear();
@@ -1002,9 +1002,9 @@ class ii {
1002
1002
  let i = [];
1003
1003
  const s = /* @__PURE__ */ new Set();
1004
1004
  t.forEach((a) => {
1005
- const { value: h, rowKey: l, key: f } = a, { oldValue: d, newValue: x } = this.setItemValue(l, f, h);
1006
- s.add(l), i.push({
1007
- rowKey: l,
1005
+ const { value: h, rowKey: c, key: f } = a, { oldValue: d, newValue: x } = this.setItemValue(c, f, h);
1006
+ s.add(c), i.push({
1007
+ rowKey: c,
1008
1008
  key: f,
1009
1009
  oldValue: d,
1010
1010
  newValue: x
@@ -1050,8 +1050,8 @@ class ii {
1050
1050
  newValue: h
1051
1051
  };
1052
1052
  a[e] !== null && typeof a[e] == "object" && (h = JSON.parse(JSON.stringify(a[e])));
1053
- const l = `${t}_${e}`;
1054
- if (this.originalDataMap.has(l) || this.originalDataMap.set(l, h), this.changedDataMap.set(l, i), a[e] = i, o) {
1053
+ const c = `${t}_${e}`;
1054
+ if (this.originalDataMap.has(c) || this.originalDataMap.set(c, h), this.changedDataMap.set(c, i), a[e] = i, o) {
1055
1055
  const f = this.ctx.database.getRowDataItemForRowKey(t), d = {
1056
1056
  rowKey: t,
1057
1057
  key: e,
@@ -1063,7 +1063,7 @@ class ii {
1063
1063
  key: e,
1064
1064
  oldValue: h,
1065
1065
  value: i,
1066
- originalValue: this.originalDataMap.get(l),
1066
+ originalValue: this.originalDataMap.get(c),
1067
1067
  row: f
1068
1068
  });
1069
1069
  }
@@ -1072,7 +1072,7 @@ class ii {
1072
1072
  key: e,
1073
1073
  oldValue: h,
1074
1074
  value: i,
1075
- originalValue: this.originalDataMap.get(l),
1075
+ originalValue: this.originalDataMap.get(c),
1076
1076
  row: this.ctx.database.getRowDataItemForRowKey(t)
1077
1077
  }), s && this.ctx.history.pushState({
1078
1078
  type: "single",
@@ -1086,7 +1086,7 @@ class ii {
1086
1086
  newValue: i
1087
1087
  }
1088
1088
  ]
1089
- }), r && this.ctx.emit("draw"), {
1089
+ }), this.getValidator(t, e), r && this.ctx.emit("draw"), {
1090
1090
  oldValue: h,
1091
1091
  newValue: i
1092
1092
  };
@@ -1277,15 +1277,15 @@ class ii {
1277
1277
  getReadonly(t, e) {
1278
1278
  const i = this.rowKeyMap.get(t), s = this.headerMap.get(e), r = i == null ? void 0 : i.readonly, o = s == null ? void 0 : s.readonly, { CELL_READONLY_METHOD: a } = this.ctx.config;
1279
1279
  if (typeof a == "function") {
1280
- const l = a({
1280
+ const c = a({
1281
1281
  row: i.item,
1282
1282
  rowIndex: i.rowIndex,
1283
1283
  colIndex: s.colIndex,
1284
1284
  column: s.column,
1285
1285
  value: this.getItemValue(t, e)
1286
1286
  });
1287
- if (l !== void 0)
1288
- return l;
1287
+ if (c !== void 0)
1288
+ return c;
1289
1289
  }
1290
1290
  return o || r;
1291
1291
  }
@@ -1307,7 +1307,7 @@ class ii {
1307
1307
  f && (h = f);
1308
1308
  }
1309
1309
  if (h) {
1310
- let l = {}, f = {};
1310
+ let c = {}, f = {};
1311
1311
  if (f[e] = this.getItemValue(t, e), Array.isArray(h) && h.length) {
1312
1312
  const x = h.map((u) => ({
1313
1313
  ...u,
@@ -1316,16 +1316,16 @@ class ii {
1316
1316
  rowIndex: s.rowIndex,
1317
1317
  colIndex: r.colIndex
1318
1318
  }));
1319
- l[e] = x;
1319
+ c[e] = x;
1320
1320
  } else
1321
- l[e] = {
1321
+ c[e] = {
1322
1322
  ...h,
1323
1323
  row: s.item,
1324
1324
  column: a,
1325
1325
  rowIndex: s.rowIndex,
1326
1326
  colIndex: r.colIndex
1327
1327
  };
1328
- new nt(l).validate(f).then(() => {
1328
+ new nt(c).validate(f).then(() => {
1329
1329
  this.setValidationError(t, e, []), i([]);
1330
1330
  }).catch(({ errors: x }) => {
1331
1331
  const u = x.map((g) => ({
@@ -1374,9 +1374,9 @@ class ii {
1374
1374
  }
1375
1375
  class si {
1376
1376
  constructor(t) {
1377
- c(this, "ctx");
1378
- c(this, "history", []);
1379
- c(this, "historyIndex", -1);
1377
+ l(this, "ctx");
1378
+ l(this, "history", []);
1379
+ l(this, "historyIndex", -1);
1380
1380
  this.ctx = t, this.init();
1381
1381
  }
1382
1382
  init() {
@@ -1431,8 +1431,8 @@ class si {
1431
1431
  }
1432
1432
  class ri {
1433
1433
  constructor(t) {
1434
- c(this, "eventTasks", /* @__PURE__ */ new Map());
1435
- c(this, "ctx");
1434
+ l(this, "eventTasks", /* @__PURE__ */ new Map());
1435
+ l(this, "ctx");
1436
1436
  this.ctx = t, this.init();
1437
1437
  }
1438
1438
  init() {
@@ -1486,7 +1486,7 @@ class ri {
1486
1486
  }
1487
1487
  class oi {
1488
1488
  constructor() {
1489
- c(this, "events", /* @__PURE__ */ new Map());
1489
+ l(this, "events", /* @__PURE__ */ new Map());
1490
1490
  }
1491
1491
  has(t) {
1492
1492
  return this.events.has(t);
@@ -1524,7 +1524,7 @@ class oi {
1524
1524
  }
1525
1525
  class ni {
1526
1526
  constructor(t) {
1527
- c(this, "ctx");
1527
+ l(this, "ctx");
1528
1528
  const e = t.getContext("2d");
1529
1529
  if (!e) throw new Error("canvas context not found");
1530
1530
  this.ctx = e;
@@ -1558,21 +1558,21 @@ class ni {
1558
1558
  * @param {string} color - 阴影的颜色
1559
1559
  */
1560
1560
  drawShadow(t, e, i, s, r) {
1561
- const { fillColor: o, side: a, shadowWidth: h, colorStart: l, colorEnd: f } = r;
1561
+ const { fillColor: o, side: a, shadowWidth: h, colorStart: c, colorEnd: f } = r;
1562
1562
  this.ctx.save(), o && (this.ctx.fillStyle = o, this.ctx.fillRect(t, e, i, s));
1563
1563
  let d;
1564
1564
  switch (a) {
1565
1565
  case "left":
1566
- d = this.ctx.createLinearGradient(t - h, e, t, e), d.addColorStop(0, l), d.addColorStop(1, f), this.ctx.fillStyle = d, this.ctx.fillRect(t - h, e, h, s);
1566
+ d = this.ctx.createLinearGradient(t - h, e, t, e), d.addColorStop(0, c), d.addColorStop(1, f), this.ctx.fillStyle = d, this.ctx.fillRect(t - h, e, h, s);
1567
1567
  break;
1568
1568
  case "right":
1569
- d = this.ctx.createLinearGradient(t + i, e, t + i + h, e), d.addColorStop(0, l), d.addColorStop(1, f), this.ctx.fillStyle = d, this.ctx.fillRect(t + i, e, h, s);
1569
+ d = this.ctx.createLinearGradient(t + i, e, t + i + h, e), d.addColorStop(0, c), d.addColorStop(1, f), this.ctx.fillStyle = d, this.ctx.fillRect(t + i, e, h, s);
1570
1570
  break;
1571
1571
  case "top":
1572
- d = this.ctx.createLinearGradient(t, e - h, t, e), d.addColorStop(0, l), d.addColorStop(1, f), this.ctx.fillStyle = d, this.ctx.fillRect(t, e - h, i, h);
1572
+ d = this.ctx.createLinearGradient(t, e - h, t, e), d.addColorStop(0, c), d.addColorStop(1, f), this.ctx.fillStyle = d, this.ctx.fillRect(t, e - h, i, h);
1573
1573
  break;
1574
1574
  case "bottom":
1575
- d = this.ctx.createLinearGradient(t, e + s, t, e + s + h), d.addColorStop(0, l), d.addColorStop(1, f), this.ctx.fillStyle = d, this.ctx.fillRect(t, e + s, i, h);
1575
+ d = this.ctx.createLinearGradient(t, e + s, t, e + s + h), d.addColorStop(0, c), d.addColorStop(1, f), this.ctx.fillStyle = d, this.ctx.fillRect(t, e + s, i, h);
1576
1576
  break;
1577
1577
  default:
1578
1578
  console.error("Invalid side specified for shadow");
@@ -1597,8 +1597,8 @@ class ni {
1597
1597
  if (this.ctx.save(), this.ctx.beginPath(), a !== void 0 && (this.ctx.fillStyle = a), o !== void 0 && (this.ctx.lineWidth = r, this.ctx.strokeStyle = o), h === 0)
1598
1598
  this.ctx.rect(t - 0.5, e - 0.5, i, s);
1599
1599
  else {
1600
- const [l, f, d, x] = typeof h == "number" ? [h, h, h, h] : h;
1601
- this.ctx.moveTo(t + l, 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 - x, x), this.ctx.arcTo(t, e, t + l, e, l);
1600
+ const [c, f, d, x] = typeof h == "number" ? [h, h, h, h] : h;
1601
+ 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 - x, x), this.ctx.arcTo(t, e, t + c, e, c);
1602
1602
  }
1603
1603
  a !== void 0 && this.ctx.fill(), o !== void 0 && this.ctx.stroke(), this.ctx.restore();
1604
1604
  }
@@ -1617,11 +1617,11 @@ class ni {
1617
1617
  const {
1618
1618
  font: a = "12px Arial",
1619
1619
  align: h = "center",
1620
- color: l = "#495060",
1620
+ color: c = "#495060",
1621
1621
  padding: f = 0,
1622
1622
  verticalAlign: d = "middle"
1623
1623
  } = o;
1624
- this.ctx.font = a, this.ctx.fillStyle = l, this.ctx.textBaseline = d, this.ctx.textAlign = h;
1624
+ this.ctx.font = a, this.ctx.fillStyle = c, this.ctx.textBaseline = d, this.ctx.textAlign = h;
1625
1625
  let x = 0;
1626
1626
  d === "top" ? x = i + f : d === "bottom" ? x = i + r - f : x = i + (r + 1) / 2;
1627
1627
  let u = 0;
@@ -1639,9 +1639,9 @@ class ni {
1639
1639
  const a = this.ctx.measureText("...").width, h = this.ctx.measureText(t).width;
1640
1640
  if (h && h + a >= e - i * 2) {
1641
1641
  r = !0;
1642
- let l = 0;
1642
+ let c = 0;
1643
1643
  for (let f = 0; f < t.length; f++)
1644
- if (l += this.ctx.measureText(t[f]).width, l >= e - i * 2 - a) {
1644
+ if (c += this.ctx.measureText(t[f]).width, c >= e - i * 2 - a) {
1645
1645
  o = t.slice(0, f) + "...";
1646
1646
  break;
1647
1647
  }
@@ -1652,131 +1652,131 @@ class ni {
1652
1652
  };
1653
1653
  }
1654
1654
  }
1655
- class $t {
1655
+ class Wt {
1656
1656
  constructor(t) {
1657
- c(this, "PROCESSOR_NUM", 50);
1658
- c(this, "CSS_PREFIX", "e-virt-table");
1659
- c(this, "ICONS", []);
1660
- c(this, "ROW_KEY", "");
1661
- c(this, "HEADER_FONT", "12px normal Arial");
1662
- c(this, "BODY_FONT", "12px normal Arial");
1663
- c(this, "BORDER_COLOR", "#e1e6eb");
1664
- c(this, "WIDTH", 0);
1665
- c(this, "RESIZE_MIN_WIDTH", 40);
1666
- c(this, "HEIGHT", 0);
1667
- c(this, "EMPTY_BODY_HEIGHT", 120);
1668
- c(this, "EMPTY_CUSTOM", !1);
1669
- c(this, "EMPTY_CUSTOM_STYLE", {});
1670
- c(this, "EMPTY_TEXT", "暂无数据");
1671
- c(this, "MAX_HEIGHT", 1e3);
1672
- c(this, "BORDER_RADIUS", 8);
1673
- c(this, "ENABLE_OFFSET_HEIGHT", !1);
1674
- c(this, "OFFSET_HEIGHT", 0);
1675
- c(this, "HEADER_HEIGHT", 36);
1676
- c(this, "ENABLE_HEADER_STICKY", !1);
1657
+ l(this, "PROCESSOR_NUM", 50);
1658
+ l(this, "CSS_PREFIX", "e-virt-table");
1659
+ l(this, "ICONS", []);
1660
+ l(this, "ROW_KEY", "");
1661
+ l(this, "HEADER_FONT", "12px normal Arial");
1662
+ l(this, "BODY_FONT", "12px normal Arial");
1663
+ l(this, "BORDER_COLOR", "#e1e6eb");
1664
+ l(this, "WIDTH", 0);
1665
+ l(this, "RESIZE_MIN_WIDTH", 40);
1666
+ l(this, "HEIGHT", 0);
1667
+ l(this, "EMPTY_BODY_HEIGHT", 120);
1668
+ l(this, "EMPTY_CUSTOM", !1);
1669
+ l(this, "EMPTY_CUSTOM_STYLE", {});
1670
+ l(this, "EMPTY_TEXT", "暂无数据");
1671
+ l(this, "MAX_HEIGHT", 1e3);
1672
+ l(this, "BORDER_RADIUS", 8);
1673
+ l(this, "ENABLE_OFFSET_HEIGHT", !1);
1674
+ l(this, "OFFSET_HEIGHT", 0);
1675
+ l(this, "HEADER_HEIGHT", 36);
1676
+ l(this, "ENABLE_HEADER_STICKY", !1);
1677
1677
  // 启用头部固定,需要外面实现覆盖层,或者所有表头都要是元素
1678
- c(this, "HEADER_BG_COLOR", "#F8FAFF");
1679
- c(this, "BODY_BG_COLOR", "#FFF");
1680
- c(this, "HEADER_TEXT_COLOR", "#1D2129");
1681
- c(this, "LOADING_ICON_SVG", "");
1682
- c(this, "LOADING_ICON_COLOR", "#4E5969");
1683
- c(this, "EXPAND_ICON_SVG", "");
1684
- c(this, "SHRINK_ICON_SVG", "");
1685
- c(this, "EXPAND_ICON_COLOR", "#4E5969");
1686
- c(this, "SHRINK_ICON_COLOR", "#4E5969");
1687
- c(this, "ERROR_TIP_ICON_COLOR", "red");
1688
- c(this, "ERROR_TIP_ICON_SIZE", 6);
1689
- c(this, "EXPAND_LAZY", !0);
1690
- c(this, "DEFAULT_EXPAND_ALL", !1);
1691
- c(this, "CELL_WIDTH", 100);
1692
- c(this, "CELL_HEIGHT", 36);
1693
- c(this, "CELL_PADDING", 8);
1694
- c(this, "CELL_HOVER_ICON_SIZE", 20);
1695
- c(this, "SCROLLER_TRACK_SIZE", 14);
1696
- c(this, "SCROLLER_SIZE", 8);
1697
- c(this, "SCROLLER_COLOR", "#dee0e3");
1698
- c(this, "SCROLLER_TRACK_COLOR", "#fff");
1699
- c(this, "SCROLLER_FOCUS_COLOR", "#bbbec4");
1700
- c(this, "SELECT_BORDER_COLOR", "rgb(82,146,247)");
1701
- c(this, "SELECT_AREA_COLOR", "rgba(82,146,247,0.1)");
1702
- c(this, "SELECT_BG_COLOR", "rgba(82,146,247,0.1)");
1703
- c(this, "EDIT_BG_COLOR", "#fcf6ed");
1704
- c(this, "CHECKBOX_KEY", "");
1705
- c(this, "CHECKBOX_COLOR", "rgb(82,146,247)");
1706
- c(this, "CHECKBOX_SIZE", 20);
1707
- c(this, "CHECKBOX_DISABLED_SVG", "");
1708
- c(this, "CHECKBOX_CHECK_SVG", "");
1709
- c(this, "CHECKBOX_UNCHECK_SVG", "");
1710
- c(this, "CHECKBOX_INDETERMINATE_SVG", "");
1711
- c(this, "READONLY_COLOR", "#fff");
1712
- c(this, "READONLY_TEXT_COLOR", "#4E5969");
1713
- c(this, "ERROR_TIP_COLOR", "#ED3F14");
1714
- c(this, "FOOTER_BG_COLOR", "#fafafa");
1715
- c(this, "FOOTER_FIXED", !0);
1716
- c(this, "CELL_FOOTER_HEIGHT", 36);
1717
- c(this, "ENABLE_SELECTOR", !1);
1718
- c(this, "ENABLE_EDIT_SINGLE_CLICK", !1);
1678
+ l(this, "HEADER_BG_COLOR", "#F8FAFF");
1679
+ l(this, "BODY_BG_COLOR", "#FFF");
1680
+ l(this, "HEADER_TEXT_COLOR", "#1D2129");
1681
+ l(this, "LOADING_ICON_SVG", "");
1682
+ l(this, "LOADING_ICON_COLOR", "#4E5969");
1683
+ l(this, "EXPAND_ICON_SVG", "");
1684
+ l(this, "SHRINK_ICON_SVG", "");
1685
+ l(this, "EXPAND_ICON_COLOR", "#4E5969");
1686
+ l(this, "SHRINK_ICON_COLOR", "#4E5969");
1687
+ l(this, "ERROR_TIP_ICON_COLOR", "red");
1688
+ l(this, "ERROR_TIP_ICON_SIZE", 6);
1689
+ l(this, "EXPAND_LAZY", !0);
1690
+ l(this, "DEFAULT_EXPAND_ALL", !1);
1691
+ l(this, "CELL_WIDTH", 100);
1692
+ l(this, "CELL_HEIGHT", 36);
1693
+ l(this, "CELL_PADDING", 8);
1694
+ l(this, "CELL_HOVER_ICON_SIZE", 20);
1695
+ l(this, "SCROLLER_TRACK_SIZE", 14);
1696
+ l(this, "SCROLLER_SIZE", 8);
1697
+ l(this, "SCROLLER_COLOR", "#dee0e3");
1698
+ l(this, "SCROLLER_TRACK_COLOR", "#fff");
1699
+ l(this, "SCROLLER_FOCUS_COLOR", "#bbbec4");
1700
+ l(this, "SELECT_BORDER_COLOR", "rgb(82,146,247)");
1701
+ l(this, "SELECT_AREA_COLOR", "rgba(82,146,247,0.1)");
1702
+ l(this, "SELECT_BG_COLOR", "rgba(82,146,247,0.1)");
1703
+ l(this, "EDIT_BG_COLOR", "#fcf6ed");
1704
+ l(this, "CHECKBOX_KEY", "");
1705
+ l(this, "CHECKBOX_COLOR", "rgb(82,146,247)");
1706
+ l(this, "CHECKBOX_SIZE", 20);
1707
+ l(this, "CHECKBOX_DISABLED_SVG", "");
1708
+ l(this, "CHECKBOX_CHECK_SVG", "");
1709
+ l(this, "CHECKBOX_UNCHECK_SVG", "");
1710
+ l(this, "CHECKBOX_INDETERMINATE_SVG", "");
1711
+ l(this, "READONLY_COLOR", "#fff");
1712
+ l(this, "READONLY_TEXT_COLOR", "#4E5969");
1713
+ l(this, "ERROR_TIP_COLOR", "#ED3F14");
1714
+ l(this, "FOOTER_BG_COLOR", "#fafafa");
1715
+ l(this, "FOOTER_FIXED", !0);
1716
+ l(this, "CELL_FOOTER_HEIGHT", 36);
1717
+ l(this, "ENABLE_SELECTOR", !1);
1718
+ l(this, "ENABLE_EDIT_SINGLE_CLICK", !1);
1719
1719
  // 启用单点击立马编辑
1720
- c(this, "ENABLE_EDIT_CLICK_SELECTOR", !0);
1720
+ l(this, "ENABLE_EDIT_CLICK_SELECTOR", !0);
1721
1721
  // 启用点击选择器编辑
1722
- c(this, "SELECTOR_AREA_MIN_X", 0);
1722
+ l(this, "SELECTOR_AREA_MIN_X", 0);
1723
1723
  // 选择器X最小范围
1724
- c(this, "SELECTOR_AREA_MAX_X_OFFSET", 0);
1724
+ l(this, "SELECTOR_AREA_MAX_X_OFFSET", 0);
1725
1725
  // 选择器X最大范围colMax - offset
1726
- c(this, "SELECTOR_AREA_MAX_X", 0);
1726
+ l(this, "SELECTOR_AREA_MAX_X", 0);
1727
1727
  // 选择器X最大范围,0默认最大colMax
1728
- c(this, "SELECTOR_AREA_MIN_Y", 0);
1728
+ l(this, "SELECTOR_AREA_MIN_Y", 0);
1729
1729
  // 选择器Y最小范围
1730
- c(this, "SELECTOR_AREA_MAX_Y", 0);
1730
+ l(this, "SELECTOR_AREA_MAX_Y", 0);
1731
1731
  // 选择器Y最大范围,0默认rowMax
1732
- c(this, "SELECTOR_AREA_MAX_Y_OFFSET", 0);
1732
+ l(this, "SELECTOR_AREA_MAX_Y_OFFSET", 0);
1733
1733
  // 选择器Y最大范围,0默认rowMax
1734
- c(this, "ENABLE_SELECTOR_SINGLE", !1);
1735
- c(this, "ENABLE_SELECTOR_SPAN_COL", !0);
1736
- c(this, "ENABLE_SELECTOR_SPAN_ROW", !0);
1737
- c(this, "ENABLE_SELECTOR_ALL_ROWS", !0);
1738
- c(this, "ENABLE_SELECTOR_ALL_COLS", !0);
1739
- c(this, "ENABLE_AUTOFILL", !1);
1740
- c(this, "ENABLE_CONTEXT_MENU", !1);
1741
- c(this, "ENABLE_COPY", !0);
1742
- c(this, "ENABLE_PASTER", !0);
1743
- c(this, "ENABLE_RESIZE_ROW", !0);
1744
- c(this, "ENABLE_RESIZE_COLUMN", !0);
1745
- c(this, "RESIZE_ROW_LINE_COLOR", "#e1e6eb");
1746
- c(this, "RESIZE_COLUMN_LINE_COLOR", "#e1e6eb");
1747
- c(this, "RESIZE_ROW_MIN_HEIGHT", 36);
1748
- c(this, "RESIZE_COLUMN_MIN_WIDTH", 40);
1749
- c(this, "ENABLE_KEYBOARD", !0);
1750
- c(this, "ENABLE_HISTORY", !1);
1751
- c(this, "ENABLE_VALIDATOR_IMMEDIATE", !0);
1752
- c(this, "HISTORY_NUM", 50);
1753
- c(this, "HIGHLIGHT_HOVER_ROW", !1);
1754
- c(this, "HIGHLIGHT_HOVER_ROW_COLOR", "rgba(186,203,231,0.1)");
1755
- c(this, "HIGHLIGHT_SELECTED_ROW", !1);
1756
- c(this, "HIGHLIGHT_SELECTED_ROW_COLOR", "rgba(82,146,247,0.1)");
1757
- c(this, "TOOLTIP_BG_COLOR", "#303133");
1758
- c(this, "TOOLTIP_TEXT_COLOR", "#fff");
1759
- c(this, "TOOLTIP_ZINDEX", 3e3);
1760
- c(this, "TOOLTIP_CUSTOM_STYLE", {});
1761
- c(this, "CONTEXT_MENU", [
1734
+ l(this, "ENABLE_SELECTOR_SINGLE", !1);
1735
+ l(this, "ENABLE_SELECTOR_SPAN_COL", !0);
1736
+ l(this, "ENABLE_SELECTOR_SPAN_ROW", !0);
1737
+ l(this, "ENABLE_SELECTOR_ALL_ROWS", !0);
1738
+ l(this, "ENABLE_SELECTOR_ALL_COLS", !0);
1739
+ l(this, "ENABLE_AUTOFILL", !1);
1740
+ l(this, "ENABLE_CONTEXT_MENU", !1);
1741
+ l(this, "ENABLE_COPY", !0);
1742
+ l(this, "ENABLE_PASTER", !0);
1743
+ l(this, "ENABLE_RESIZE_ROW", !0);
1744
+ l(this, "ENABLE_RESIZE_COLUMN", !0);
1745
+ l(this, "RESIZE_ROW_LINE_COLOR", "#e1e6eb");
1746
+ l(this, "RESIZE_COLUMN_LINE_COLOR", "#e1e6eb");
1747
+ l(this, "RESIZE_ROW_MIN_HEIGHT", 36);
1748
+ l(this, "RESIZE_COLUMN_MIN_WIDTH", 40);
1749
+ l(this, "ENABLE_KEYBOARD", !0);
1750
+ l(this, "ENABLE_HISTORY", !1);
1751
+ l(this, "ENABLE_VALIDATOR_IMMEDIATE", !0);
1752
+ l(this, "HISTORY_NUM", 50);
1753
+ l(this, "HIGHLIGHT_HOVER_ROW", !1);
1754
+ l(this, "HIGHLIGHT_HOVER_ROW_COLOR", "rgba(186,203,231,0.1)");
1755
+ l(this, "HIGHLIGHT_SELECTED_ROW", !1);
1756
+ l(this, "HIGHLIGHT_SELECTED_ROW_COLOR", "rgba(82,146,247,0.1)");
1757
+ l(this, "TOOLTIP_BG_COLOR", "#303133");
1758
+ l(this, "TOOLTIP_TEXT_COLOR", "#fff");
1759
+ l(this, "TOOLTIP_ZINDEX", 3e3);
1760
+ l(this, "TOOLTIP_CUSTOM_STYLE", {});
1761
+ l(this, "CONTEXT_MENU", [
1762
1762
  { label: "复制", value: "copy" },
1763
1763
  { label: "剪切", value: "cut" },
1764
1764
  { label: "粘贴", value: "paste" },
1765
1765
  { label: "清空选中内容", value: "clearSelected" }
1766
1766
  ]);
1767
- c(this, "HEADER_CELL_STYLE_METHOD");
1768
- c(this, "BODY_CELL_STYLE_METHOD");
1769
- c(this, "FOOTER_CELL_STYLE_METHOD");
1770
- c(this, "CELL_READONLY_METHOD");
1771
- c(this, "CELL_FORMATTER_METHOD");
1772
- c(this, "CELL_RULES_METHOD");
1773
- c(this, "CELL_TYPE_METHOD");
1774
- c(this, "CELL_EDITOR_TYPE_METHOD");
1775
- c(this, "CELL_RENDER_METHOD");
1776
- c(this, "CELL_HOVER_ICON_METHOD");
1777
- c(this, "SPAN_METHOD");
1778
- c(this, "SELECTABLE_METHOD");
1779
- c(this, "EXPAND_LAZY_METHOD");
1767
+ l(this, "HEADER_CELL_STYLE_METHOD");
1768
+ l(this, "BODY_CELL_STYLE_METHOD");
1769
+ l(this, "FOOTER_CELL_STYLE_METHOD");
1770
+ l(this, "CELL_READONLY_METHOD");
1771
+ l(this, "CELL_FORMATTER_METHOD");
1772
+ l(this, "CELL_RULES_METHOD");
1773
+ l(this, "CELL_TYPE_METHOD");
1774
+ l(this, "CELL_EDITOR_TYPE_METHOD");
1775
+ l(this, "CELL_RENDER_METHOD");
1776
+ l(this, "CELL_HOVER_ICON_METHOD");
1777
+ l(this, "SPAN_METHOD");
1778
+ l(this, "SELECTABLE_METHOD");
1779
+ l(this, "EXPAND_LAZY_METHOD");
1780
1780
  Object.assign(this, t);
1781
1781
  }
1782
1782
  init(t) {
@@ -1785,8 +1785,8 @@ class $t {
1785
1785
  }
1786
1786
  class ai {
1787
1787
  constructor(t) {
1788
- c(this, "ctx");
1789
- c(this, "list", [
1788
+ l(this, "ctx");
1789
+ l(this, "list", [
1790
1790
  {
1791
1791
  name: "loading",
1792
1792
  configName: "LOADING_ICON_SVG",
@@ -1848,7 +1848,7 @@ class ai {
1848
1848
  color: ""
1849
1849
  }
1850
1850
  ]);
1851
- c(this, "icons", /* @__PURE__ */ new Map());
1851
+ l(this, "icons", /* @__PURE__ */ new Map());
1852
1852
  this.ctx = t, this.init();
1853
1853
  }
1854
1854
  async init() {
@@ -1877,15 +1877,15 @@ class ai {
1877
1877
  }
1878
1878
  async createImageFromSVG(t, e) {
1879
1879
  const r = new DOMParser().parseFromString(t, "image/svg+xml").documentElement;
1880
- e && r.querySelectorAll("*").forEach((l) => {
1881
- l.setAttribute("fill", e);
1880
+ e && r.querySelectorAll("*").forEach((c) => {
1881
+ c.setAttribute("fill", e);
1882
1882
  });
1883
1883
  const o = new Image(), a = new Blob([new XMLSerializer().serializeToString(r)], {
1884
1884
  type: "image/svg+xml"
1885
1885
  }), h = URL.createObjectURL(a);
1886
- return o.src = h, new Promise((l, f) => {
1886
+ return o.src = h, new Promise((c, f) => {
1887
1887
  o.onerror = () => f(new Error("Failed to load image")), o.onload = () => {
1888
- l(o);
1888
+ c(o);
1889
1889
  };
1890
1890
  });
1891
1891
  }
@@ -1893,15 +1893,15 @@ class ai {
1893
1893
  return this.icons.get(t);
1894
1894
  }
1895
1895
  }
1896
- class re {
1896
+ class te {
1897
1897
  constructor(t, e, i, s, r, o, a) {
1898
- c(this, "ctx");
1899
- c(this, "x", 0);
1900
- c(this, "y", 0);
1901
- c(this, "width", 0);
1902
- c(this, "height", 0);
1903
- c(this, "fixed");
1904
- c(this, "cellType");
1898
+ l(this, "ctx");
1899
+ l(this, "x", 0);
1900
+ l(this, "y", 0);
1901
+ l(this, "width", 0);
1902
+ l(this, "height", 0);
1903
+ l(this, "fixed");
1904
+ l(this, "cellType");
1905
1905
  this.ctx = t, this.x = e, this.y = i, this.width = s, this.height = r, this.fixed = o, this.cellType = a;
1906
1906
  }
1907
1907
  isHorizontalVisible() {
@@ -1939,57 +1939,57 @@ class re {
1939
1939
  getRightFixedX() {
1940
1940
  }
1941
1941
  }
1942
- class oe extends re {
1943
- constructor(e, i, s, r, o, a, h, l, f, d = "body") {
1944
- super(e, r, o, a, h, l.fixed, d);
1945
- c(this, "formatter");
1946
- c(this, "hoverIconName", "");
1947
- c(this, "operation", !1);
1948
- c(this, "align");
1949
- c(this, "verticalAlign");
1950
- c(this, "fixed");
1951
- c(this, "type");
1952
- c(this, "editorType");
1953
- c(this, "cellType");
1954
- c(this, "level");
1955
- c(this, "colspan", 1);
1956
- c(this, "rowspan", 1);
1957
- c(this, "key");
1958
- c(this, "column");
1959
- c(this, "rowIndex");
1960
- c(this, "colIndex");
1961
- c(this, "rowKey");
1962
- c(this, "row");
1963
- c(this, "value");
1964
- c(this, "render");
1965
- c(this, "renderFooter");
1966
- c(this, "style", {});
1967
- c(this, "rules", {});
1968
- c(this, "message", "");
1969
- c(this, "text", "");
1970
- c(this, "displayText", "");
1971
- c(this, "visibleWidth", 0);
1972
- c(this, "visibleHeight", 0);
1973
- c(this, "drawX", 0);
1974
- c(this, "drawY", 0);
1975
- c(this, "drawCellBgColor", "");
1976
- c(this, "drawCellSkyBgColor", "");
1977
- c(this, "drawTextColor", "");
1978
- c(this, "drawTextX", 0);
1979
- c(this, "drawTextY", 0);
1980
- c(this, "drawImageX", 0);
1981
- c(this, "drawImageY", 0);
1982
- c(this, "drawImageWidth", 0);
1983
- c(this, "drawImageHeight", 0);
1984
- c(this, "drawImageName", "");
1985
- c(this, "drawImageSource");
1986
- c(this, "ellipsis", !1);
1987
- c(this, "rowExpand", !1);
1988
- c(this, "rowHasChildren", !1);
1989
- c(this, "overflowTooltipShow", !0);
1990
- c(this, "overflowTooltipMaxWidth", 500);
1991
- c(this, "overflowTooltipPlacement", "top");
1992
- this.visibleWidth = this.width, this.visibleHeight = this.height, this.colIndex = s, this.rowIndex = i, this.key = l.key, this.type = l.type || "text", this.editorType = l.editorType || "text", this.cellType = d, this.align = l.align || "center", this.verticalAlign = l.verticalAlign || "middle", this.fixed = l.fixed, this.level = l.level, this.operation = l.operation || !1, this.column = l, this.rules = l.rules, this.row = f, this.rowKey = this.cellType === "body" ? this.ctx.database.getRowKeyForRowIndex(i) : `${this.cellType}_${this.rowIndex}`, this.value = this.getValue(), this.render = l.render, this.overflowTooltipShow = l.overflowTooltipShow !== !1, this.overflowTooltipMaxWidth = l.overflowTooltipMaxWidth || 500, this.overflowTooltipPlacement = l.overflowTooltipPlacement || "top", this.renderFooter = l.renderFooter, this.hoverIconName = l.hoverIconName, this.formatter = l.formatter, this.update();
1942
+ class ee extends te {
1943
+ constructor(e, i, s, r, o, a, h, c, f, d = "body") {
1944
+ super(e, r, o, a, h, c.fixed, d);
1945
+ l(this, "formatter");
1946
+ l(this, "hoverIconName", "");
1947
+ l(this, "operation", !1);
1948
+ l(this, "align");
1949
+ l(this, "verticalAlign");
1950
+ l(this, "fixed");
1951
+ l(this, "type");
1952
+ l(this, "editorType");
1953
+ l(this, "cellType");
1954
+ l(this, "level");
1955
+ l(this, "colspan", 1);
1956
+ l(this, "rowspan", 1);
1957
+ l(this, "key");
1958
+ l(this, "column");
1959
+ l(this, "rowIndex");
1960
+ l(this, "colIndex");
1961
+ l(this, "rowKey");
1962
+ l(this, "row");
1963
+ l(this, "value");
1964
+ l(this, "render");
1965
+ l(this, "renderFooter");
1966
+ l(this, "style", {});
1967
+ l(this, "rules", {});
1968
+ l(this, "message", "");
1969
+ l(this, "text", "");
1970
+ l(this, "displayText", "");
1971
+ l(this, "visibleWidth", 0);
1972
+ l(this, "visibleHeight", 0);
1973
+ l(this, "drawX", 0);
1974
+ l(this, "drawY", 0);
1975
+ l(this, "drawCellBgColor", "");
1976
+ l(this, "drawCellSkyBgColor", "");
1977
+ l(this, "drawTextColor", "");
1978
+ l(this, "drawTextX", 0);
1979
+ l(this, "drawTextY", 0);
1980
+ l(this, "drawImageX", 0);
1981
+ l(this, "drawImageY", 0);
1982
+ l(this, "drawImageWidth", 0);
1983
+ l(this, "drawImageHeight", 0);
1984
+ l(this, "drawImageName", "");
1985
+ l(this, "drawImageSource");
1986
+ l(this, "ellipsis", !1);
1987
+ l(this, "rowExpand", !1);
1988
+ l(this, "rowHasChildren", !1);
1989
+ l(this, "overflowTooltipShow", !0);
1990
+ l(this, "overflowTooltipMaxWidth", 500);
1991
+ l(this, "overflowTooltipPlacement", "top");
1992
+ this.visibleWidth = this.width, this.visibleHeight = this.height, this.colIndex = s, this.rowIndex = i, this.key = c.key, this.type = c.type || "text", this.editorType = c.editorType || "text", this.cellType = d, this.align = c.align || "center", this.verticalAlign = c.verticalAlign || "middle", this.fixed = c.fixed, this.level = c.level, 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.overflowTooltipMaxWidth = c.overflowTooltipMaxWidth || 500, this.overflowTooltipPlacement = c.overflowTooltipPlacement || "top", this.renderFooter = c.renderFooter, this.hoverIconName = c.hoverIconName, this.formatter = c.formatter, this.update();
1993
1993
  }
1994
1994
  getValidationMessage() {
1995
1995
  const e = this.ctx.database.getValidationError(this.rowKey, this.key);
@@ -2083,13 +2083,13 @@ class oe extends re {
2083
2083
  const { CELL_PADDING: e = 0 } = this.ctx.config, { rowKey: i, cellType: s } = this;
2084
2084
  let r, o = 0, a = "";
2085
2085
  if (this.type === "tree" && s === "body") {
2086
- const h = this.ctx.database.getRowForRowKey(i), { expand: l = !1, hasChildren: f = !1, expandLoading: d = !1, level: x = 0 } = h || {};
2087
- if (this.rowExpand = l, this.rowHasChildren = f, d) {
2086
+ const h = this.ctx.database.getRowForRowKey(i), { expand: c = !1, hasChildren: f = !1, expandLoading: d = !1, level: x = 0 } = h || {};
2087
+ if (this.rowExpand = c, this.rowHasChildren = f, d) {
2088
2088
  const u = this.ctx.icons.get("loading");
2089
2089
  a = "loading", r = u, o = x * 8;
2090
2090
  } else if (f) {
2091
2091
  const u = this.ctx.icons.get("expand"), g = this.ctx.icons.get("shrink");
2092
- r = l ? g : u, a = l ? "shrink" : "expand", o = x * 8;
2092
+ r = c ? g : u, a = c ? "shrink" : "expand", o = x * 8;
2093
2093
  } else
2094
2094
  o = x * 8;
2095
2095
  if (r) {
@@ -2107,7 +2107,7 @@ class oe extends re {
2107
2107
  READONLY_TEXT_COLOR: o,
2108
2108
  FOOTER_BG_COLOR: a,
2109
2109
  HIGHLIGHT_SELECTED_ROW: h,
2110
- HIGHLIGHT_SELECTED_ROW_COLOR: l,
2110
+ HIGHLIGHT_SELECTED_ROW_COLOR: c,
2111
2111
  HIGHLIGHT_HOVER_ROW: f,
2112
2112
  HIGHLIGHT_HOVER_ROW_COLOR: d
2113
2113
  } = this.ctx.config;
@@ -2128,7 +2128,7 @@ class oe extends re {
2128
2128
  }
2129
2129
  let x = "transparent";
2130
2130
  const u = this.ctx.focusCell, g = this.ctx.hoverCell;
2131
- f && (g == null ? void 0 : g.rowKey) === this.rowKey && (x = d), h && (u == null ? void 0 : u.rowKey) === this.rowKey && (x = l), this.drawCellSkyBgColor = x;
2131
+ f && (g == null ? void 0 : g.rowKey) === this.rowKey && (x = d), h && (u == null ? void 0 : u.rowKey) === this.rowKey && (x = c), this.drawCellSkyBgColor = x;
2132
2132
  let w = e, p = o;
2133
2133
  if (["index", "index-selection", "selection"].includes(this.type)) {
2134
2134
  this.drawCellBgColor = e, this.drawTextColor = o;
@@ -2147,9 +2147,9 @@ class oe extends re {
2147
2147
  this.drawCellBgColor = w, this.drawTextColor = p;
2148
2148
  }
2149
2149
  updateSelection() {
2150
- const { visibleWidth: e, visibleHeight: i, rowspan: s, colspan: r, cellType: o, type: a, rowIndex: h, rowKey: l } = this;
2150
+ const { visibleWidth: e, visibleHeight: i, rowspan: s, colspan: r, cellType: o, type: a, rowIndex: h, rowKey: c } = this;
2151
2151
  if (!(s === 0 || r === 0) && o !== "footer" && ["index-selection", "selection"].includes(a)) {
2152
- const f = this.ctx.database.getRowSelection(l), d = this.ctx.database.getRowSelectable(l), { CHECKBOX_SIZE: x = 0 } = this.ctx.config, u = this.drawX + (e - x) / 2, g = this.drawY + (i - x) / 2;
2152
+ const f = this.ctx.database.getRowSelection(c), d = this.ctx.database.getRowSelectable(c), { CHECKBOX_SIZE: x = 0 } = this.ctx.config, u = this.drawX + (e - x) / 2, g = this.drawY + (i - x) / 2;
2153
2153
  let w = this.ctx.icons.get("checkbox-uncheck"), p = "checkbox-uncheck";
2154
2154
  f && d ? (w = this.ctx.icons.get("checkbox-check"), p = "checkbox-check") : f && d ? (w = this.ctx.icons.get("checkbox-check-disabled"), p = "checkbox-check-disabled") : !f && d ? (w = this.ctx.icons.get("checkbox-uncheck"), p = "checkbox-uncheck") : (w = this.ctx.icons.get("checkbox-disabled"), p = "checkbox-disabled"), w && a == "index-selection" ? (this.ctx.hoverCell && this.ctx.hoverCell.rowIndex === h || ["checkbox-disabled", "checkbox-check"].includes(p)) && (this.drawImageX = u, this.drawImageY = g, this.drawImageWidth = x, this.drawImageHeight = x, this.drawImageName = p, this.drawImageSource = w) : w && a === "selection" && (this.drawImageX = u, this.drawImageY = g, this.drawImageWidth = x, this.drawImageHeight = x, this.drawImageName = p, this.drawImageSource = w);
2155
2155
  }
@@ -2280,8 +2280,8 @@ class oe extends re {
2280
2280
  const { SELECT_BORDER_COLOR: e, ENABLE_AUTOFILL: i, ENABLE_SELECTOR: s } = this.ctx.config;
2281
2281
  if (!s || !i)
2282
2282
  return;
2283
- const { xArr: r, yArr: o } = this.ctx.selector, a = r[1], h = o[1], { colIndex: l, rowIndex: f, drawX: d, drawY: x } = this;
2284
- l === a && f === h && this.ctx.paint.drawRect(d + this.width - 6, x + this.height - 6, 6, 6, {
2283
+ const { xArr: r, yArr: o } = this.ctx.selector, a = r[1], h = o[1], { colIndex: c, rowIndex: f, drawX: d, drawY: x } = this;
2284
+ c === a && f === h && this.ctx.paint.drawRect(d + this.width - 6, x + this.height - 6, 6, 6, {
2285
2285
  borderColor: "#fff",
2286
2286
  fillColor: e
2287
2287
  });
@@ -2336,31 +2336,31 @@ class oe extends re {
2336
2336
  }
2337
2337
  drawBorder(e) {
2338
2338
  const { drawX: i, drawY: s, width: r, rowIndex: o, colIndex: a } = this;
2339
- let h = i + 0.5, l = s + 0.5, f = this.height;
2340
- o === 0 && (l = this.y + 1, f = f - 1), a === this.ctx.maxColIndex && (h = h - 1);
2339
+ let h = i + 0.5, c = s + 0.5, f = this.height;
2340
+ o === 0 && (c = this.y + 1, f = f - 1), a === this.ctx.maxColIndex && (h = h - 1);
2341
2341
  const { xArr: d, yArr: x, lineDash: u = [], borderWidth: g = 1, borderColor: w, fillColor: p } = e, y = d[0], b = d[1], m = x[0], E = x[1];
2342
- a >= y && a <= b && o === m && this.ctx.paint.drawLine([h, l, h + r - 2, l], {
2342
+ a >= y && a <= b && o === m && this.ctx.paint.drawLine([h, c, h + r - 2, c], {
2343
2343
  borderColor: w,
2344
2344
  fillColor: p,
2345
2345
  borderWidth: g,
2346
2346
  lineCap: "round",
2347
2347
  lineJoin: "round",
2348
2348
  lineDash: u
2349
- }), a >= y && a <= b && o === E && this.ctx.paint.drawLine([h, l + f - 1.5, h + r, l + f - 1.5], {
2349
+ }), a >= y && a <= b && o === E && this.ctx.paint.drawLine([h, c + f - 1.5, h + r, c + f - 1.5], {
2350
2350
  borderColor: w,
2351
2351
  fillColor: p,
2352
2352
  borderWidth: g,
2353
2353
  lineCap: "round",
2354
2354
  lineJoin: "round",
2355
2355
  lineDash: u
2356
- }), a === y && o >= m && o <= E && this.ctx.paint.drawLine([h, l, h, l + f - 1], {
2356
+ }), a === y && o >= m && o <= E && this.ctx.paint.drawLine([h, c, h, c + f - 1], {
2357
2357
  borderColor: w,
2358
2358
  fillColor: p,
2359
2359
  borderWidth: g,
2360
2360
  lineCap: "round",
2361
2361
  lineJoin: "round",
2362
2362
  lineDash: u
2363
- }), a === b && o >= m && o <= E && this.ctx.paint.drawLine([h + r - 1.5, l, h + r - 1.5, l + f - 1.5], {
2363
+ }), a === b && o >= m && o <= E && this.ctx.paint.drawLine([h + r - 1.5, c, h + r - 1.5, c + f - 1.5], {
2364
2364
  borderColor: w,
2365
2365
  fillColor: p,
2366
2366
  borderWidth: g,
@@ -2370,43 +2370,43 @@ class oe extends re {
2370
2370
  });
2371
2371
  }
2372
2372
  }
2373
- class ne extends re {
2373
+ class ie extends te {
2374
2374
  constructor(e, i, s, r, o, a, h) {
2375
2375
  super(e, s, r, o, a, h.fixed, "header");
2376
- c(this, "align");
2377
- c(this, "verticalAlign", "middle");
2378
- c(this, "fixed");
2379
- c(this, "widthFillDisable");
2380
- c(this, "type");
2381
- c(this, "operation", !1);
2382
- c(this, "editorType");
2383
- c(this, "level");
2384
- c(this, "text");
2385
- c(this, "displayText", "");
2386
- c(this, "colspan");
2387
- c(this, "rowspan");
2388
- c(this, "key");
2389
- c(this, "required", !1);
2390
- c(this, "readonly", !1);
2391
- c(this, "children", []);
2392
- c(this, "column");
2393
- c(this, "colIndex");
2394
- c(this, "rowKey");
2395
- c(this, "rules");
2396
- c(this, "hasChildren");
2397
- c(this, "render");
2398
- c(this, "style", {});
2399
- c(this, "drawX", 0);
2400
- c(this, "drawY", 0);
2401
- c(this, "drawCellBgColor", "");
2402
- c(this, "drawTextColor", "");
2403
- c(this, "drawImageX", 0);
2404
- c(this, "drawImageY", 0);
2405
- c(this, "drawImageWidth", 0);
2406
- c(this, "drawImageHeight", 0);
2407
- c(this, "drawImageName", "");
2408
- c(this, "drawImageSource");
2409
- this.ctx = e, this.x = s, this.y = r, this.width = o, this.height = a, this.colIndex = i, this.key = h.key, this.type = h.type, this.editorType = h.editorType || "text", this.align = h.align || "center", this.verticalAlign = h.verticalAlign || "middle", this.fixed = h.fixed, this.level = h.level, this.operation = h.operation || !1, this.text = h.title, this.column = h, this.colspan = h.colspan, this.widthFillDisable = h.widthFillDisable, this.rowspan = h.rowspan, this.rules = h.rules, this.readonly = h.readonly, this.required = h.required, this.rowKey = te(), this.hasChildren = h.children && h.children.length > 0 || !1, this.render = h.renderHeader;
2376
+ l(this, "align");
2377
+ l(this, "verticalAlign", "middle");
2378
+ l(this, "fixed");
2379
+ l(this, "widthFillDisable");
2380
+ l(this, "type");
2381
+ l(this, "operation", !1);
2382
+ l(this, "editorType");
2383
+ l(this, "level");
2384
+ l(this, "text");
2385
+ l(this, "displayText", "");
2386
+ l(this, "colspan");
2387
+ l(this, "rowspan");
2388
+ l(this, "key");
2389
+ l(this, "required", !1);
2390
+ l(this, "readonly", !1);
2391
+ l(this, "children", []);
2392
+ l(this, "column");
2393
+ l(this, "colIndex");
2394
+ l(this, "rowKey");
2395
+ l(this, "rules");
2396
+ l(this, "hasChildren");
2397
+ l(this, "render");
2398
+ l(this, "style", {});
2399
+ l(this, "drawX", 0);
2400
+ l(this, "drawY", 0);
2401
+ l(this, "drawCellBgColor", "");
2402
+ l(this, "drawTextColor", "");
2403
+ l(this, "drawImageX", 0);
2404
+ l(this, "drawImageY", 0);
2405
+ l(this, "drawImageWidth", 0);
2406
+ l(this, "drawImageHeight", 0);
2407
+ l(this, "drawImageName", "");
2408
+ l(this, "drawImageSource");
2409
+ this.ctx = e, this.x = s, this.y = r, this.width = o, this.height = a, this.colIndex = i, this.key = h.key, this.type = h.type, this.editorType = h.editorType || "text", this.align = h.align || "center", this.verticalAlign = h.verticalAlign || "middle", this.fixed = h.fixed, this.level = h.level, this.operation = h.operation || !1, this.text = h.title, this.column = h, this.colspan = h.colspan, this.widthFillDisable = h.widthFillDisable, this.rowspan = h.rowspan, this.rules = h.rules, this.readonly = h.readonly, this.required = h.required, this.rowKey = Ut(), this.hasChildren = h.children && h.children.length > 0 || !1, this.render = h.renderHeader;
2410
2410
  }
2411
2411
  /**
2412
2412
  * 是否可见,覆盖基类方法,表头是跟y滚动条没有关系的所以不需要加滚动参数
@@ -2426,11 +2426,11 @@ class ne extends re {
2426
2426
  const { HEADER_CELL_STYLE_METHOD: e, HEADER_BG_COLOR: i, HEADER_TEXT_COLOR: s } = this.ctx.config;
2427
2427
  let r = i, o = s;
2428
2428
  if (typeof e == "function") {
2429
- const a = e, { backgroundColor: h, color: l } = a({
2429
+ const a = e, { backgroundColor: h, color: c } = a({
2430
2430
  colIndex: this.colIndex,
2431
2431
  column: this.column
2432
2432
  }) || {};
2433
- h && (r = h), l && (o = l);
2433
+ h && (r = h), c && (o = c);
2434
2434
  }
2435
2435
  this.drawCellBgColor = r, this.drawTextColor = o;
2436
2436
  }
@@ -2456,9 +2456,9 @@ class ne extends re {
2456
2456
  drawSelection() {
2457
2457
  const { width: e, height: i, type: s } = this;
2458
2458
  if (["index-selection", "selection"].includes(s)) {
2459
- const { indeterminate: r, check: o, selectable: a } = this.ctx.database.getCheckedState(), { CHECKBOX_SIZE: h = 0 } = this.ctx.config, l = this.drawX + (e - h) / 2, f = this.drawY + (i - h) / 2;
2459
+ const { indeterminate: r, check: o, selectable: a } = this.ctx.database.getCheckedState(), { CHECKBOX_SIZE: h = 0 } = this.ctx.config, c = this.drawX + (e - h) / 2, f = this.drawY + (i - h) / 2;
2460
2460
  let d = this.ctx.icons.get("checkbox-uncheck"), x = "checkbox-uncheck";
2461
- r ? (d = this.ctx.icons.get("checkbox-indeterminate"), x = "checkbox-indeterminate") : o && a ? (d = this.ctx.icons.get("checkbox-check"), x = "checkbox-check") : o && a ? (d = this.ctx.icons.get("checkbox-check-disabled"), x = "checkbox-check-disabled") : !o && a ? (d = this.ctx.icons.get("checkbox-uncheck"), x = "checkbox-uncheck") : (d = this.ctx.icons.get("checkbox-disabled"), x = "checkbox-disabled"), d && (this.drawImageX = l, this.drawImageY = f, this.drawImageWidth = h, this.drawImageHeight = h, this.drawImageName = x, this.drawImageSource = d, this.ctx.paint.drawImage(
2461
+ r ? (d = this.ctx.icons.get("checkbox-indeterminate"), x = "checkbox-indeterminate") : o && a ? (d = this.ctx.icons.get("checkbox-check"), x = "checkbox-check") : o && a ? (d = this.ctx.icons.get("checkbox-check-disabled"), x = "checkbox-check-disabled") : !o && a ? (d = this.ctx.icons.get("checkbox-uncheck"), x = "checkbox-uncheck") : (d = this.ctx.icons.get("checkbox-disabled"), x = "checkbox-disabled"), d && (this.drawImageX = c, this.drawImageY = f, this.drawImageWidth = h, this.drawImageHeight = h, this.drawImageName = x, this.drawImageSource = d, this.ctx.paint.drawImage(
2462
2462
  this.drawImageSource,
2463
2463
  this.drawImageX,
2464
2464
  this.drawImageY,
@@ -2485,11 +2485,11 @@ class ne extends re {
2485
2485
  };
2486
2486
  }
2487
2487
  }
2488
- class ci {
2488
+ class li {
2489
2489
  constructor(t) {
2490
- c(this, "ctx");
2491
- c(this, "visibleHoverCell");
2492
- c(this, "resizeObserver");
2490
+ l(this, "ctx");
2491
+ l(this, "visibleHoverCell");
2492
+ l(this, "resizeObserver");
2493
2493
  this.ctx = t, this.init();
2494
2494
  }
2495
2495
  init() {
@@ -2557,7 +2557,7 @@ class ci {
2557
2557
  */
2558
2558
  selectionClick(t) {
2559
2559
  if (["selection", "index-selection"].includes(t.type) && this.ctx.isPointer)
2560
- if (t instanceof ne)
2560
+ if (t instanceof ie)
2561
2561
  t.drawImageName === "checkbox-uncheck" || t.drawImageName === "checkbox-indeterminate" ? this.ctx.database.toggleAllSelection() : t.drawImageName === "checkbox-check" && this.ctx.database.clearSelection();
2562
2562
  else {
2563
2563
  if (!this.ctx.database.getRowSelectable(t.rowKey))
@@ -2597,7 +2597,7 @@ class ci {
2597
2597
  */
2598
2598
  imageEnterAndLeave(t, e) {
2599
2599
  const { offsetY: i, offsetX: s } = this.ctx.getOffset(e), r = i, o = s;
2600
- o > t.drawImageX && o < t.drawImageX + t.drawImageWidth && r > t.drawImageY && r < t.drawImageY + t.drawImageHeight ? (this.ctx.stageElement.style.cursor = "pointer", this.ctx.isPointer = !0, t instanceof oe && ["selection", "index-selection"].includes(t.type) && (this.ctx.database.getRowSelectable(t.rowKey) || (this.ctx.stageElement.style.cursor = "not-allowed"))) : (this.ctx.isPointer = !1, this.ctx.stageElement.style.cursor === "pointer" && (this.ctx.stageElement.style.cursor = "default"));
2600
+ o > t.drawImageX && o < t.drawImageX + t.drawImageWidth && r > t.drawImageY && r < t.drawImageY + t.drawImageHeight ? (this.ctx.stageElement.style.cursor = "pointer", this.ctx.isPointer = !0, t instanceof ee && ["selection", "index-selection"].includes(t.type) && (this.ctx.database.getRowSelectable(t.rowKey) || (this.ctx.stageElement.style.cursor = "not-allowed"))) : (this.ctx.isPointer = !1, this.ctx.stageElement.style.cursor === "pointer" && (this.ctx.stageElement.style.cursor = "default"));
2601
2601
  }
2602
2602
  isBusy(t) {
2603
2603
  const { offsetY: e, offsetX: i } = this.ctx.getOffset(t), s = e, r = i;
@@ -2610,13 +2610,13 @@ class ci {
2610
2610
  for (const o of i) {
2611
2611
  const a = o.fixedCells.concat(o.noFixedCells);
2612
2612
  for (const h of a) {
2613
- const l = h.getDrawX(), f = h.getDrawY();
2613
+ const c = h.getDrawX(), f = h.getDrawY();
2614
2614
  if (r) {
2615
- if (t > l && t < l + h.visibleWidth && e > f && e < f + h.visibleHeight) {
2615
+ if (t > c && t < c + h.visibleWidth && e > f && e < f + h.visibleHeight) {
2616
2616
  s(h);
2617
2617
  return;
2618
2618
  }
2619
- } else if (t > l && t < l + h.width && e > f && e < f + h.height) {
2619
+ } else if (t > c && t < c + h.width && e > f && e < f + h.height) {
2620
2620
  s(h);
2621
2621
  return;
2622
2622
  }
@@ -2638,48 +2638,49 @@ class ci {
2638
2638
  }
2639
2639
  class hi {
2640
2640
  constructor(t, e) {
2641
- c(this, "eventBus");
2642
- c(this, "eventBrowser");
2643
- c(this, "eventTable");
2644
- c(this, "containerElement");
2645
- c(this, "stageElement");
2646
- c(this, "canvasElement");
2647
- c(this, "overlayerElement");
2648
- c(this, "stageWidth", 0);
2649
- c(this, "stageHeight", 0);
2650
- c(this, "paint");
2651
- c(this, "icons");
2652
- c(this, "isInsideTargetContainer", !1);
2653
- c(this, "mousedown", !1);
2654
- c(this, "isPointer", !1);
2655
- c(this, "rowResizing", !1);
2641
+ l(this, "eventBus");
2642
+ l(this, "eventBrowser");
2643
+ l(this, "eventTable");
2644
+ l(this, "containerElement");
2645
+ l(this, "stageElement");
2646
+ l(this, "canvasElement");
2647
+ l(this, "overlayerElement");
2648
+ l(this, "editorElement");
2649
+ l(this, "stageWidth", 0);
2650
+ l(this, "stageHeight", 0);
2651
+ l(this, "paint");
2652
+ l(this, "icons");
2653
+ l(this, "isInsideTargetContainer", !1);
2654
+ l(this, "mousedown", !1);
2655
+ l(this, "isPointer", !1);
2656
+ l(this, "rowResizing", !1);
2656
2657
  // 行调整大小中
2657
- c(this, "columnResizing", !1);
2658
+ l(this, "columnResizing", !1);
2658
2659
  // 列调整大小中
2659
- c(this, "scrollerMove", !1);
2660
+ l(this, "scrollerMove", !1);
2660
2661
  // 滚动条移动中
2661
- c(this, "scrollerFocus", !1);
2662
+ l(this, "scrollerFocus", !1);
2662
2663
  // 滚动条focus中
2663
- c(this, "autofillMove", !1);
2664
+ l(this, "autofillMove", !1);
2664
2665
  // 自动填充移动中
2665
- c(this, "selectorMove", !1);
2666
+ l(this, "selectorMove", !1);
2666
2667
  // 选择器移动中
2667
- c(this, "editing", !1);
2668
+ l(this, "editing", !1);
2668
2669
  // 编辑中
2669
- c(this, "scrollY", 0);
2670
- c(this, "scrollX", 0);
2671
- c(this, "fixedLeftWidth", 0);
2672
- c(this, "fixedRightWidth", 0);
2673
- c(this, "maxColIndex", 0);
2674
- c(this, "maxRowIndex", 0);
2675
- c(this, "hoverRow");
2676
- c(this, "clickCell");
2677
- c(this, "focusCell");
2678
- c(this, "hoverCell");
2679
- c(this, "clickCellHeader");
2680
- c(this, "focusCellHeader");
2681
- c(this, "hoverCellHeader");
2682
- c(this, "body", {
2670
+ l(this, "scrollY", 0);
2671
+ l(this, "scrollX", 0);
2672
+ l(this, "fixedLeftWidth", 0);
2673
+ l(this, "fixedRightWidth", 0);
2674
+ l(this, "maxColIndex", 0);
2675
+ l(this, "maxRowIndex", 0);
2676
+ l(this, "hoverRow");
2677
+ l(this, "clickCell");
2678
+ l(this, "focusCell");
2679
+ l(this, "hoverCell");
2680
+ l(this, "clickCellHeader");
2681
+ l(this, "focusCellHeader");
2682
+ l(this, "hoverCellHeader");
2683
+ l(this, "body", {
2683
2684
  x: 0,
2684
2685
  y: 0,
2685
2686
  width: 0,
@@ -2692,7 +2693,7 @@ class hi {
2692
2693
  renderRows: [],
2693
2694
  data: []
2694
2695
  });
2695
- c(this, "footer", {
2696
+ l(this, "footer", {
2696
2697
  x: 0,
2697
2698
  y: 0,
2698
2699
  width: 0,
@@ -2701,7 +2702,7 @@ class hi {
2701
2702
  visibleWidth: 0,
2702
2703
  renderRows: []
2703
2704
  });
2704
- c(this, "header", {
2705
+ l(this, "header", {
2705
2706
  x: 0,
2706
2707
  y: 0,
2707
2708
  width: 0,
@@ -2716,26 +2717,26 @@ class hi {
2716
2717
  fixedRightCellHeaders: [],
2717
2718
  renderCenterCellHeaders: []
2718
2719
  });
2719
- c(this, "selector", {
2720
+ l(this, "selector", {
2720
2721
  enable: !1,
2721
2722
  xArr: [-1, -1],
2722
2723
  yArr: [-1, -1],
2723
2724
  xArrCopy: [-1, -1],
2724
2725
  yArrCopy: [-1, -1]
2725
2726
  });
2726
- c(this, "autofill", {
2727
+ l(this, "autofill", {
2727
2728
  enable: !1,
2728
2729
  xArr: [-1, -1],
2729
2730
  yArr: [-1, -1]
2730
2731
  });
2731
- c(this, "database");
2732
- c(this, "history");
2733
- c(this, "config");
2734
- const { containerElement: i, stageElement: s, canvasElement: r, overlayerElement: o } = t;
2735
- this.containerElement = i, this.stageElement = s, this.canvasElement = r, this.overlayerElement = o, this.config = new $t(e.config || {}), this.eventBus = new oi(), this.eventBrowser = new ri(this), this.eventTable = new ci(this), this.paint = new ni(this.canvasElement), this.database = new ii(this, e), this.history = new si(this), this.icons = new ai(this);
2732
+ l(this, "database");
2733
+ l(this, "history");
2734
+ l(this, "config");
2735
+ const { containerElement: i, stageElement: s, canvasElement: r, overlayerElement: o, editorElement: a } = t;
2736
+ this.containerElement = i, this.stageElement = s, this.canvasElement = r, this.overlayerElement = o, this.editorElement = a, this.config = new Wt(e.config || {}), this.eventBus = new oi(), this.eventBrowser = new ri(this), this.eventTable = new li(this), this.paint = new ni(this.canvasElement), this.database = new ii(this, e), this.history = new si(this), this.icons = new ai(this);
2736
2737
  }
2737
2738
  setConfig(t) {
2738
- this.config = new $t(t);
2739
+ this.config = new Wt(t);
2739
2740
  }
2740
2741
  setFocusCell(t) {
2741
2742
  var e;
@@ -2767,7 +2768,7 @@ class hi {
2767
2768
  for (let r = 0; r <= e[1] - e[0]; r++) {
2768
2769
  const o = [];
2769
2770
  for (let a = 0; a <= i[1] - i[0]; a++) {
2770
- const h = r + e[0], l = a + i[0], f = this.database.getItemValueForRowIndexAndColIndex(h, l);
2771
+ const h = r + e[0], c = a + i[0], f = this.database.getItemValueForRowIndexAndColIndex(h, c);
2771
2772
  f && o.push(f.value);
2772
2773
  }
2773
2774
  s += `${o.join(" ")}\r`, t.push(o);
@@ -2826,31 +2827,31 @@ class hi {
2826
2827
  this.eventTable.destroy(), this.eventBrowser.destroy(), this.eventBus.destroy();
2827
2828
  }
2828
2829
  }
2829
- class qt {
2830
+ class Pt {
2830
2831
  constructor(t, e) {
2831
- c(this, "ctx");
2832
- c(this, "type");
2833
- c(this, "isFocus", !1);
2834
- c(this, "trackX", 0);
2835
- c(this, "trackY", 0);
2836
- c(this, "trackWidth", 0);
2837
- c(this, "trackHeight", 0);
2838
- c(this, "splitPoints", []);
2832
+ l(this, "ctx");
2833
+ l(this, "type");
2834
+ l(this, "isFocus", !1);
2835
+ l(this, "trackX", 0);
2836
+ l(this, "trackY", 0);
2837
+ l(this, "trackWidth", 0);
2838
+ l(this, "trackHeight", 0);
2839
+ l(this, "splitPoints", []);
2839
2840
  //分割线
2840
- c(this, "barX", 0);
2841
- c(this, "barY", 0);
2842
- c(this, "barWidth", 0);
2843
- c(this, "barHeight", 0);
2844
- c(this, "distance", 0);
2841
+ l(this, "barX", 0);
2842
+ l(this, "barY", 0);
2843
+ l(this, "barWidth", 0);
2844
+ l(this, "barHeight", 0);
2845
+ l(this, "distance", 0);
2845
2846
  // 滚动条的长度
2846
- c(this, "visibleDistance", 0);
2847
+ l(this, "visibleDistance", 0);
2847
2848
  //可见区域的长度
2848
- c(this, "clientX", 0);
2849
- c(this, "clientY", 0);
2850
- c(this, "dragStart", 0);
2849
+ l(this, "clientX", 0);
2850
+ l(this, "clientY", 0);
2851
+ l(this, "dragStart", 0);
2851
2852
  // 拖拽开始的位置
2852
- c(this, "isDragging", !1);
2853
- c(this, "scroll", 0);
2853
+ l(this, "isDragging", !1);
2854
+ l(this, "scroll", 0);
2854
2855
  this.ctx = t, this.type = e, this.type === "vertical" ? this.scroll = this.ctx.scrollY : this.scroll = this.ctx.scrollX;
2855
2856
  }
2856
2857
  onWheel(t) {
@@ -2903,12 +2904,12 @@ class qt {
2903
2904
  stageHeight: i,
2904
2905
  stageWidth: s,
2905
2906
  config: { SCROLLER_TRACK_SIZE: r = 0, SCROLLER_SIZE: o = 0 }
2906
- } = this.ctx, a = s, h = i, l = e.height, f = e.width, d = t.height, x = this.ctx.footer.height;
2907
+ } = this.ctx, a = s, h = i, c = e.height, f = e.width, d = t.height, x = this.ctx.footer.height;
2907
2908
  if (this.type === "vertical") {
2908
- this.visibleDistance = h - r - l, this.distance = d - this.visibleDistance + x, this.trackX = a - r, this.trackY = 0, this.splitPoints = [this.trackX, l, this.trackX + r, l], this.trackWidth = r, this.trackHeight = h, this.barX = this.trackX - 0.5 + (r - o) / 2, this.barWidth = o;
2909
+ this.visibleDistance = h - r - c, this.distance = d - this.visibleDistance + x, this.trackX = a - r, this.trackY = 0, this.splitPoints = [this.trackX, c, this.trackX + r, c], this.trackWidth = r, this.trackHeight = h, this.barX = this.trackX - 0.5 + (r - o) / 2, this.barWidth = o;
2909
2910
  const u = this.distance ? this.visibleDistance / d : 0;
2910
2911
  let g = Math.floor(u * this.visibleDistance);
2911
- g < 30 ? g = 30 : g > this.visibleDistance && (g = 0), this.barHeight = g, this.barY = l + this.scroll / this.distance * (this.visibleDistance - this.barHeight), this.scroll = Math.max(0, Math.min(this.scroll, this.distance));
2912
+ g < 30 ? g = 30 : g > this.visibleDistance && (g = 0), this.barHeight = g, this.barY = c + this.scroll / this.distance * (this.visibleDistance - this.barHeight), this.scroll = Math.max(0, Math.min(this.scroll, this.distance));
2912
2913
  } else {
2913
2914
  this.visibleDistance = a - r, this.distance = f - this.visibleDistance, this.splitPoints = [
2914
2915
  a - r,
@@ -2937,12 +2938,12 @@ class qt {
2937
2938
  }), this.ctx.scrollerFocus = this.isFocus;
2938
2939
  }
2939
2940
  }
2940
- class li {
2941
+ class ci {
2941
2942
  constructor(t) {
2942
- c(this, "ctx");
2943
- c(this, "verticalScrollbar");
2944
- c(this, "horizontalScrollbar");
2945
- this.ctx = t, this.verticalScrollbar = new qt(t, "vertical"), this.horizontalScrollbar = new qt(t, "horizontal"), this.ctx.on("wheel", (e) => this.onWheel(e)), this.ctx.on("mousedown", (e) => this.onMouseDown(e)), this.ctx.on("mousemove", (e) => this.onMouseMove(e)), this.ctx.on("mouseup", () => this.onMouseUp()), this.ctx.on("setScroll", (e, i) => {
2943
+ l(this, "ctx");
2944
+ l(this, "verticalScrollbar");
2945
+ l(this, "horizontalScrollbar");
2946
+ this.ctx = t, this.verticalScrollbar = new Pt(t, "vertical"), this.horizontalScrollbar = new Pt(t, "horizontal"), this.ctx.on("wheel", (e) => this.onWheel(e)), this.ctx.on("mousedown", (e) => this.onMouseDown(e)), this.ctx.on("mousemove", (e) => this.onMouseMove(e)), this.ctx.on("mouseup", () => this.onMouseUp()), this.ctx.on("setScroll", (e, i) => {
2946
2947
  this.setScroll(e, i);
2947
2948
  }), this.ctx.on("setScrollX", (e) => {
2948
2949
  this.setScrollX(e);
@@ -2995,44 +2996,44 @@ class li {
2995
2996
  }
2996
2997
  class di {
2997
2998
  constructor(t) {
2998
- c(this, "ctx");
2999
+ l(this, "ctx");
2999
3000
  // 上下文
3000
- c(this, "x", 0);
3001
+ l(this, "x", 0);
3001
3002
  // x坐标
3002
- c(this, "y", 0);
3003
+ l(this, "y", 0);
3003
3004
  // y坐标
3004
- c(this, "width", 0);
3005
+ l(this, "width", 0);
3005
3006
  // 宽度
3006
- c(this, "height", 0);
3007
+ l(this, "height", 0);
3007
3008
  // 高度
3008
- c(this, "resizeTarget", null);
3009
+ l(this, "resizeTarget", null);
3009
3010
  //调整表头
3010
- c(this, "resizeNum", 0);
3011
+ l(this, "resizeNum", 0);
3011
3012
  // 调整列的数量
3012
- c(this, "isResizing", !1);
3013
+ l(this, "isResizing", !1);
3013
3014
  // 是否移动中
3014
- c(this, "clientX", 0);
3015
+ l(this, "clientX", 0);
3015
3016
  // 鼠标按下时的x轴位置
3016
- c(this, "resizeDiff", 0);
3017
+ l(this, "resizeDiff", 0);
3017
3018
  // 是否移动中
3018
- c(this, "columnIndex", 0);
3019
- c(this, "isMouseDown", !1);
3019
+ l(this, "columnIndex", 0);
3020
+ l(this, "isMouseDown", !1);
3020
3021
  // 是否按下
3021
- c(this, "columns");
3022
- c(this, "visibleLeafColumns", []);
3023
- c(this, "visibleHeight", 0);
3024
- c(this, "visibleWidth", 0);
3025
- c(this, "allCellHeaders", []);
3026
- c(this, "leafCellHeaders", []);
3027
- c(this, "renderLeafCellHeaders", []);
3028
- c(this, "fixedLeftCellHeaders", []);
3029
- c(this, "centerCellHeaders", []);
3030
- c(this, "fixedRightCellHeaders", []);
3031
- c(this, "renderCenterCellHeaders", []);
3032
- c(this, "renderFixedCellHeaders", []);
3022
+ l(this, "columns");
3023
+ l(this, "visibleLeafColumns", []);
3024
+ l(this, "visibleHeight", 0);
3025
+ l(this, "visibleWidth", 0);
3026
+ l(this, "allCellHeaders", []);
3027
+ l(this, "leafCellHeaders", []);
3028
+ l(this, "renderLeafCellHeaders", []);
3029
+ l(this, "fixedLeftCellHeaders", []);
3030
+ l(this, "centerCellHeaders", []);
3031
+ l(this, "fixedRightCellHeaders", []);
3032
+ l(this, "renderCenterCellHeaders", []);
3033
+ l(this, "renderFixedCellHeaders", []);
3033
3034
  this.ctx = t, this.ctx.on(
3034
3035
  "resetHeader",
3035
- ee(() => {
3036
+ Zt(() => {
3036
3037
  this.init(), this.ctx.emit("draw");
3037
3038
  }, 100)
3038
3039
  ), this.init(), this.initResizeColumn();
@@ -3042,9 +3043,9 @@ class di {
3042
3043
  config: { HEADER_HEIGHT: t, SCROLLER_TRACK_SIZE: e }
3043
3044
  } = this.ctx, i = this.ctx.database.getColumns();
3044
3045
  this.columns = i, this.allCellHeaders = [], this.leafCellHeaders = [], this.fixedLeftCellHeaders = [], this.fixedRightCellHeaders = [], this.centerCellHeaders = [];
3045
- const s = ie(i), r = _t(i);
3046
+ const s = Jt(i), r = _t(i);
3046
3047
  this.height = t * s, this.width = r.reduce((d, x) => d + ((x == null ? void 0 : x.width) || 100), 0), this.visibleHeight = this.height;
3047
- const o = Je(se(i, s));
3048
+ const o = Je(Qt(i, s));
3048
3049
  this.columnIndex = 0, this.resizeNum = 0, this.render(o, 0), this.ctx.database.updateColIndexKeyMap(this.leafCellHeaders);
3049
3050
  const a = this.ctx.containerElement.getBoundingClientRect();
3050
3051
  this.resizeNum > 0 ? this.ctx.stageWidth = Math.floor(a.width) : this.ctx.stageWidth = Math.floor(this.width + e), this.ctx.stageElement.style.width = this.ctx.stageWidth - 0.5 + "px", this.visibleWidth = this.ctx.stageWidth - e;
@@ -3053,8 +3054,8 @@ class di {
3053
3054
  const d = Math.floor(h / this.resizeNum * 100) / 100;
3054
3055
  this.resizeAllColumn(d);
3055
3056
  }
3056
- const l = this.fixedLeftCellHeaders.filter((d) => !d.hasChildren);
3057
- this.ctx.fixedLeftWidth = l.reduce((d, x) => d + x.width, 0);
3057
+ const c = this.fixedLeftCellHeaders.filter((d) => !d.hasChildren);
3058
+ this.ctx.fixedLeftWidth = c.reduce((d, x) => d + x.width, 0);
3058
3059
  const f = this.fixedRightCellHeaders.filter((d) => !d.hasChildren);
3059
3060
  this.ctx.fixedRightWidth = f.reduce((d, x) => d + 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;
3060
3061
  }
@@ -3083,8 +3084,8 @@ class di {
3083
3084
  this.ctx.stageElement.style.cursor === "col-resize" && (this.ctx.stageElement.style.cursor = "default");
3084
3085
  const r = [...this.renderFixedCellHeaders, ...this.renderCenterCellHeaders];
3085
3086
  for (const o of r) {
3086
- const { offsetX: a, offsetY: h } = this.ctx.getOffset(e), l = a, f = o.getDrawX();
3087
- l > f + o.width - 5 && l < f + o.width + 4 && l < i - 4 && // 视窗中最后一列不允许调整宽
3087
+ const { offsetX: a, offsetY: h } = this.ctx.getOffset(e), c = a, f = o.getDrawX();
3088
+ c > f + o.width - 5 && c < f + o.width + 4 && c < i - 4 && // 视窗中最后一列不允许调整宽
3088
3089
  o.colspan <= 1 && this.ctx.isTarget() && h <= this.height && (this.ctx.stageElement.style.cursor = "col-resize", this.resizeTarget = o);
3089
3090
  }
3090
3091
  }
@@ -3139,10 +3140,10 @@ class di {
3139
3140
  let s = e;
3140
3141
  const { HEADER_HEIGHT: r = 0 } = this.ctx.config;
3141
3142
  for (let o = 0; o < i; o++) {
3142
- const a = t[o], h = r * (a.rowspan || 1), l = r * a.level;
3143
+ const a = t[o], h = r * (a.rowspan || 1), c = r * a.level;
3143
3144
  let f = a.width || 100;
3144
3145
  a.children && (f = _t(a.children).reduce((u, g) => u + ((g == null ? void 0 : g.width) || 100), 0));
3145
- const d = new ne(this.ctx, this.columnIndex, s, l, f, h, a);
3146
+ const d = new ie(this.ctx, this.columnIndex, s, c, f, h, a);
3146
3147
  this.ctx.database.setHeader(a.key, d), this.allCellHeaders.push(d), a.children || (this.leafCellHeaders.push(d), d.column.widthFillDisable || this.resizeNum++), a.fixed === "left" ? this.fixedLeftCellHeaders.push(d) : a.fixed === "right" ? this.fixedRightCellHeaders.push(d) : this.centerCellHeaders.push(d), !a.children && this.columnIndex++, a.children && this.render(a.children, s), s += f;
3147
3148
  }
3148
3149
  }
@@ -3202,26 +3203,26 @@ class di {
3202
3203
  }), this.drawTipLine();
3203
3204
  }
3204
3205
  }
3205
- class ae {
3206
+ class se {
3206
3207
  constructor(t, e, i = 0, s = 0, r = 0, o = 0, a, h = "body") {
3207
- c(this, "ctx");
3208
- c(this, "x", 0);
3209
- c(this, "y", 0);
3210
- c(this, "width", 0);
3211
- c(this, "height");
3212
- c(this, "cells", []);
3213
- c(this, "fixedCells", []);
3214
- c(this, "noFixedCells", []);
3215
- c(this, "rowIndex", 0);
3216
- c(this, "rowKey", "");
3217
- c(this, "rowType", "body");
3218
- c(this, "data");
3208
+ l(this, "ctx");
3209
+ l(this, "x", 0);
3210
+ l(this, "y", 0);
3211
+ l(this, "width", 0);
3212
+ l(this, "height");
3213
+ l(this, "cells", []);
3214
+ l(this, "fixedCells", []);
3215
+ l(this, "noFixedCells", []);
3216
+ l(this, "rowIndex", 0);
3217
+ l(this, "rowKey", "");
3218
+ l(this, "rowType", "body");
3219
+ l(this, "data");
3219
3220
  this.ctx = t, this.x = i, this.y = s, this.width = r, this.height = o, this.rowIndex = e, this.rowKey = t.database.getRowKeyForRowIndex(e), this.rowType = h, this.data = a, this.update();
3220
3221
  }
3221
3222
  update() {
3222
3223
  const { header: t } = this.ctx, e = [], i = [], s = [];
3223
3224
  t.renderLeafCellHeaders.forEach((r) => {
3224
- const o = new oe(
3225
+ const o = new ee(
3225
3226
  this.ctx,
3226
3227
  this.rowIndex,
3227
3228
  r.colIndex,
@@ -3256,28 +3257,28 @@ class ae {
3256
3257
  }
3257
3258
  class fi {
3258
3259
  constructor(t) {
3259
- c(this, "resizeTarget", null);
3260
+ l(this, "resizeTarget", null);
3260
3261
  //调整行大小的目标
3261
- c(this, "isMouseDown", !1);
3262
+ l(this, "isMouseDown", !1);
3262
3263
  // 是否按下
3263
- c(this, "resizeDiff", 0);
3264
+ l(this, "resizeDiff", 0);
3264
3265
  // 是否移动中
3265
- c(this, "clientY", 0);
3266
+ l(this, "clientY", 0);
3266
3267
  // 鼠标按下时的y轴位置
3267
- c(this, "ctx");
3268
- c(this, "x", 0);
3269
- c(this, "y", 0);
3270
- c(this, "width", 0);
3271
- c(this, "height", 0);
3272
- c(this, "headIndex", 0);
3273
- c(this, "tailIndex", 0);
3274
- c(this, "isResizing", !1);
3268
+ l(this, "ctx");
3269
+ l(this, "x", 0);
3270
+ l(this, "y", 0);
3271
+ l(this, "width", 0);
3272
+ l(this, "height", 0);
3273
+ l(this, "headIndex", 0);
3274
+ l(this, "tailIndex", 0);
3275
+ l(this, "isResizing", !1);
3275
3276
  //是否正在调整大小
3276
- c(this, "renderRows", []);
3277
- c(this, "visibleRows", []);
3278
- c(this, "visibleHeight", 0);
3279
- c(this, "visibleWidth", 0);
3280
- c(this, "data", []);
3277
+ l(this, "renderRows", []);
3278
+ l(this, "visibleRows", []);
3279
+ l(this, "visibleHeight", 0);
3280
+ l(this, "visibleWidth", 0);
3281
+ l(this, "data", []);
3281
3282
  this.ctx = t, this.init(), this.initResizeRow();
3282
3283
  }
3283
3284
  init() {
@@ -3291,7 +3292,7 @@ class fi {
3291
3292
  HEIGHT: o,
3292
3293
  EMPTY_BODY_HEIGHT: a = 0,
3293
3294
  MAX_HEIGHT: h = 0,
3294
- ENABLE_OFFSET_HEIGHT: l = 0,
3295
+ ENABLE_OFFSET_HEIGHT: c = 0,
3295
3296
  OFFSET_HEIGHT: f = 0
3296
3297
  }
3297
3298
  } = this.ctx;
@@ -3317,7 +3318,7 @@ class fi {
3317
3318
  let p = this.height + e.height + r;
3318
3319
  p += g;
3319
3320
  let y = 0;
3320
- this.data.length && l ? (y = window.innerHeight - u - f, y < 0 && (y = 32, console.error(
3321
+ this.data.length && c ? (y = window.innerHeight - u - f, y < 0 && (y = 32, console.error(
3321
3322
  "There is an error in the height calculation ENABLE_OFFSET_HEIGHT and OFFSET_HEIGHT are invalid"
3322
3323
  ))) : this.data.length && o ? y = o : this.data.length && h && p > h ? y = h : y = p, y > 0 && (this.ctx.stageHeight = Math.floor(y), this.ctx.stageElement.style.height = `${this.ctx.stageHeight - 0.5}px`);
3323
3324
  let b = this.ctx.stageHeight - e.height - r;
@@ -3343,7 +3344,7 @@ class fi {
3343
3344
  if (this.ctx.editing) return;
3344
3345
  const { offsetY: i, offsetX: s } = this.ctx.getOffset(e), r = i, o = s, a = e.clientY, {
3345
3346
  stageHeight: h,
3346
- scrollY: l,
3347
+ scrollY: c,
3347
3348
  config: { RESIZE_ROW_MIN_HEIGHT: f = 0 }
3348
3349
  } = this.ctx;
3349
3350
  if (this.isResizing && this.resizeTarget) {
@@ -3356,7 +3357,7 @@ class fi {
3356
3357
  this.ctx.stageElement.style.cursor === "row-resize" && (this.ctx.stageElement.style.cursor = "default");
3357
3358
  for (let d = 0; d < this.renderRows.length; d++) {
3358
3359
  const x = this.renderRows[d];
3359
- if (r > x.y - l + x.height - 1.5 && r < x.y - l + x.height + 1.5 && r < h - 4)
3360
+ if (r > x.y - c + x.height - 1.5 && r < x.y - c + x.height + 1.5 && r < h - 4)
3360
3361
  for (let g = 0; g < x.cells.length; g++) {
3361
3362
  const w = x.cells[g];
3362
3363
  o > w.drawX + 10 && o < w.drawX + w.width - 10 && w.rowspan === 1 && (this.ctx.stageElement.style.cursor = "row-resize", this.resizeTarget = x);
@@ -3432,12 +3433,12 @@ class fi {
3432
3433
  const a = this.binarySearch(o, s);
3433
3434
  let h = this.binarySearch(o, s + this.visibleHeight);
3434
3435
  h === -1 && (h = r.length), this.headIndex = Math.max(0, a), this.tailIndex = Math.min(this.ctx.maxRowIndex, h + 1), this.visibleRows = r.slice(this.headIndex, this.tailIndex + 1), this.ctx.body.headIndex = this.headIndex, this.ctx.body.tailIndex = this.tailIndex, this.ctx.body.visibleRows = this.visibleRows;
3435
- const l = [];
3436
+ const c = [];
3436
3437
  for (let f = 0; f < this.visibleRows.length; f++) {
3437
- const d = this.headIndex + f, x = this.visibleRows[f], { height: u, top: g } = this.ctx.database.getPositionForRowIndex(d), w = new ae(this.ctx, d, 0, g + this.y, t.width, u, x);
3438
- l.push(w);
3438
+ const d = this.headIndex + f, x = this.visibleRows[f], { height: u, top: g } = this.ctx.database.getPositionForRowIndex(d), w = new se(this.ctx, d, 0, g + this.y, t.width, u, x);
3439
+ c.push(w);
3439
3440
  }
3440
- this.renderRows = l, this.ctx.body.renderRows = l;
3441
+ this.renderRows = c, this.ctx.body.renderRows = c;
3441
3442
  }
3442
3443
  draw() {
3443
3444
  this.renderRows.forEach((t) => {
@@ -3449,15 +3450,15 @@ class fi {
3449
3450
  }
3450
3451
  class xi {
3451
3452
  constructor(t) {
3452
- c(this, "ctx");
3453
- c(this, "renderRows", []);
3454
- c(this, "data", []);
3455
- c(this, "x", 0);
3456
- c(this, "y", 0);
3457
- c(this, "width", 0);
3458
- c(this, "height", 0);
3459
- c(this, "visibleWidth", 0);
3460
- c(this, "visibleHeight", 0);
3453
+ l(this, "ctx");
3454
+ l(this, "renderRows", []);
3455
+ l(this, "data", []);
3456
+ l(this, "x", 0);
3457
+ l(this, "y", 0);
3458
+ l(this, "width", 0);
3459
+ l(this, "height", 0);
3460
+ l(this, "visibleWidth", 0);
3461
+ l(this, "visibleHeight", 0);
3461
3462
  this.ctx = t, this.init();
3462
3463
  }
3463
3464
  init() {
@@ -3486,8 +3487,8 @@ class xi {
3486
3487
  colorStart: "rgba(0,0,0,0.1)",
3487
3488
  colorEnd: "rgba(0,0,0,0)"
3488
3489
  }), i < Math.floor(s.width - r - 1) && e !== a) {
3489
- const l = s.width - (this.x + this.width) + r - e;
3490
- this.ctx.paint.drawShadow(l + 1, h, e, this.height, {
3490
+ const c = s.width - (this.x + this.width) + r - e;
3491
+ this.ctx.paint.drawShadow(c + 1, h, e, this.height, {
3491
3492
  fillColor: o,
3492
3493
  side: "left",
3493
3494
  shadowWidth: 4,
@@ -3502,7 +3503,7 @@ class xi {
3502
3503
  let e = this.y;
3503
3504
  const i = [];
3504
3505
  this.data.forEach((s, r) => {
3505
- const o = new ae(
3506
+ const o = new se(
3506
3507
  this.ctx,
3507
3508
  r,
3508
3509
  0,
@@ -3525,22 +3526,22 @@ class xi {
3525
3526
  }
3526
3527
  class ui {
3527
3528
  constructor(t) {
3528
- c(this, "isCut", !1);
3529
- c(this, "isMultipleRow", !1);
3530
- c(this, "ctx");
3531
- c(this, "adjustPositionX", "");
3532
- c(this, "adjustPositionY", "");
3533
- c(this, "timerX", 0);
3529
+ l(this, "isCut", !1);
3530
+ l(this, "isMultipleRow", !1);
3531
+ l(this, "ctx");
3532
+ l(this, "adjustPositionX", "");
3533
+ l(this, "adjustPositionY", "");
3534
+ l(this, "timerX", 0);
3534
3535
  // 水平滚动定时器
3535
- c(this, "timerY", 0);
3536
+ l(this, "timerY", 0);
3536
3537
  // 垂直滚动定时器
3537
- c(this, "adjustTimer", 0);
3538
+ l(this, "adjustTimer", 0);
3538
3539
  this.ctx = t, this.init();
3539
3540
  }
3540
3541
  init() {
3541
3542
  this.ctx.on(
3542
3543
  "mousemove",
3543
- ee((t) => {
3544
+ Zt((t) => {
3544
3545
  const { offsetY: e, offsetX: i } = this.ctx.getOffset(t), s = this.ctx.isTarget() && i > 0 && i < this.ctx.body.visibleWidth && e > this.ctx.header.visibleHeight && e < this.ctx.header.visibleHeight + this.ctx.body.visibleHeight;
3545
3546
  (this.ctx.selectorMove || this.ctx.autofillMove) && (s ? this.stopAdjustPosition() : this.startAdjustPosition(t));
3546
3547
  }, 100)
@@ -3566,7 +3567,7 @@ class ui {
3566
3567
  this.ctx.stageElement.style.cursor !== "pointer" && (this.ctx.isPointer || this.selectCols(t));
3567
3568
  }), this.ctx.on("keydown", (t) => {
3568
3569
  if (t.ctrlKey && t.code === "KeyV" || t.metaKey && t.code === "KeyV") {
3569
- this.paste();
3570
+ t.preventDefault(), this.paste();
3570
3571
  return;
3571
3572
  }
3572
3573
  if (t.ctrlKey && t.code === "KeyC" || t.metaKey && t.code === "KeyC") {
@@ -3630,11 +3631,11 @@ class ui {
3630
3631
  const {
3631
3632
  SELECTOR_AREA_MIN_X: a,
3632
3633
  SELECTOR_AREA_MAX_X: h,
3633
- SELECTOR_AREA_MIN_Y: l,
3634
+ SELECTOR_AREA_MIN_Y: c,
3634
3635
  SELECTOR_AREA_MAX_Y: f,
3635
3636
  SELECTOR_AREA_MAX_X_OFFSET: d,
3636
3637
  SELECTOR_AREA_MAX_Y_OFFSET: x
3637
- } = this.ctx.config, u = a, g = h || this.ctx.maxColIndex - d, w = l, p = f || this.ctx.maxRowIndex - x;
3638
+ } = this.ctx.config, u = a, g = h || this.ctx.maxColIndex - d, w = c, p = f || this.ctx.maxRowIndex - x;
3638
3639
  let [y, b] = r, [m, E] = o;
3639
3640
  if (y < u || b > g || m < w || E > p)
3640
3641
  return;
@@ -3652,11 +3653,11 @@ class ui {
3652
3653
  if (this.ctx.mousedown && this.ctx.focusCellHeader) {
3653
3654
  const { colIndex: a } = this.ctx.focusCellHeader;
3654
3655
  if (this.ctx.clearSelector(), t.colIndex >= a) {
3655
- const h = [a, t.colIndex + t.colspan - 1], l = [r, o];
3656
- this.setSelector(h, l);
3656
+ const h = [a, t.colIndex + t.colspan - 1], c = [r, o];
3657
+ this.setSelector(h, c);
3657
3658
  } else {
3658
- const h = [t.colIndex, a], l = [r, o];
3659
- this.setSelector(h, l);
3659
+ const h = [t.colIndex, a], c = [r, o];
3660
+ this.setSelector(h, c);
3660
3661
  }
3661
3662
  } else {
3662
3663
  const a = [t.colIndex, t.colIndex + t.colspan - 1], h = [r, o];
@@ -3675,7 +3676,7 @@ class ui {
3675
3676
  SELECTOR_AREA_MAX_Y: o,
3676
3677
  SELECTOR_AREA_MAX_X_OFFSET: a,
3677
3678
  SELECTOR_AREA_MAX_Y_OFFSET: h
3678
- } = this.ctx.config, l = i, f = s || this.ctx.maxColIndex - a, d = r, x = o || this.ctx.maxRowIndex - h, u = [l, f], g = [d, x];
3679
+ } = this.ctx.config, c = i, f = s || this.ctx.maxColIndex - a, d = r, x = o || this.ctx.maxRowIndex - h, u = [c, f], g = [d, x];
3679
3680
  this.setSelector(u, g);
3680
3681
  }
3681
3682
  }
@@ -3685,17 +3686,17 @@ class ui {
3685
3686
  const { SELECTOR_AREA_MIN_X: i, SELECTOR_AREA_MAX_X: s, SELECTOR_AREA_MAX_X_OFFSET: r } = this.ctx.config, o = s || this.ctx.maxColIndex - r, a = i;
3686
3687
  if (e) {
3687
3688
  this.ctx.setFocusCell(t);
3688
- const h = [a, o], l = [t.rowIndex, t.rowIndex];
3689
- this.setSelector(h, l);
3689
+ const h = [a, o], c = [t.rowIndex, t.rowIndex];
3690
+ this.setSelector(h, c);
3690
3691
  }
3691
3692
  if (this.ctx.focusCell && this.ctx.mousedown) {
3692
3693
  const { rowIndex: h } = this.ctx.focusCell;
3693
3694
  if (t.rowIndex >= h) {
3694
- const l = [a, o], f = [h, t.rowIndex];
3695
- this.setSelector(l, f);
3695
+ const c = [a, o], f = [h, t.rowIndex];
3696
+ this.setSelector(c, f);
3696
3697
  } else {
3697
- const l = [a, o], f = [t.rowIndex, h];
3698
- this.setSelector(l, f);
3698
+ const c = [a, o], f = [t.rowIndex, h];
3699
+ this.setSelector(c, f);
3699
3700
  }
3700
3701
  }
3701
3702
  }
@@ -3704,7 +3705,7 @@ class ui {
3704
3705
  return;
3705
3706
  const { mousedown: t, focusCell: e, hoverCell: i } = this.ctx;
3706
3707
  if (t && e && i) {
3707
- const { rowIndex: s, colIndex: r } = e, o = Math.min(i.colIndex, r), a = Math.max(i.colIndex, r), h = Math.min(i.rowIndex, s), l = Math.max(i.rowIndex, s), f = [o, a], d = [h, l];
3708
+ const { rowIndex: s, colIndex: r } = e, o = Math.min(i.colIndex, r), a = Math.max(i.colIndex, r), h = Math.min(i.rowIndex, s), c = Math.max(i.rowIndex, s), f = [o, a], d = [h, c];
3708
3709
  this.setSelector(f, d);
3709
3710
  }
3710
3711
  }
@@ -3712,7 +3713,7 @@ class ui {
3712
3713
  const { focusCell: e, clickCell: i } = this.ctx;
3713
3714
  if (e && this.isInSettingRange(e.rowIndex, e.colIndex))
3714
3715
  if (this.ctx.selector.enable = !0, i && t) {
3715
- const { colIndex: s, rowIndex: r } = i, { colIndex: o, rowIndex: a } = e, h = Math.min(o, s), l = Math.max(o, s), f = Math.min(a, r), d = Math.max(a, r), x = [h, l], u = [f, d];
3716
+ const { colIndex: s, rowIndex: r } = i, { colIndex: o, rowIndex: a } = e, h = Math.min(o, s), c = Math.max(o, s), f = Math.min(a, r), d = Math.max(a, r), x = [h, c], u = [f, d];
3716
3717
  this.setSelector(x, u);
3717
3718
  } else {
3718
3719
  this.ctx.emit("cellSelectedClick", e);
@@ -3750,7 +3751,7 @@ class ui {
3750
3751
  const r = /* @__PURE__ */ new Set();
3751
3752
  for (let a = 0; a <= e[1] - e[0]; a++)
3752
3753
  for (let h = 0; h <= t[1] - t[0]; h++) {
3753
- const l = a + e[0], f = h + t[0], d = this.ctx.database.getItemValueForRowIndexAndColIndex(l, f);
3754
+ const c = a + e[0], f = h + t[0], d = this.ctx.database.getItemValueForRowIndexAndColIndex(c, f);
3754
3755
  if (d) {
3755
3756
  const { rowKey: x, key: u } = d;
3756
3757
  this.ctx.database.getReadonly(x, u) || (r.add(x), s.push({
@@ -3782,10 +3783,10 @@ class ui {
3782
3783
  const e = this.ctx.selector.yArr[0], i = this.ctx.selector.xArr[0], s = /* @__PURE__ */ new Set();
3783
3784
  navigator.clipboard.readText().then((r) => {
3784
3785
  let o = ti(r), a = [];
3785
- for (let l = 0; l <= o.length - 1; l++) {
3786
- const f = o[l].length;
3786
+ for (let c = 0; c <= o.length - 1; c++) {
3787
+ const f = o[c].length;
3787
3788
  for (let d = 0; d <= f - 1; d++) {
3788
- const x = l + e, u = d + i, g = o[l][d], w = this.ctx.database.getItemValueForRowIndexAndColIndex(
3789
+ const x = c + e, u = d + i, g = o[c][d], w = this.ctx.database.getItemValueForRowIndexAndColIndex(
3789
3790
  x,
3790
3791
  u
3791
3792
  );
@@ -3802,13 +3803,13 @@ class ui {
3802
3803
  }
3803
3804
  }
3804
3805
  if (this.isCut) {
3805
- const l = this.clearSelectedData(
3806
+ const c = this.clearSelectedData(
3806
3807
  this.ctx.selector.xArrCopy,
3807
3808
  this.ctx.selector.yArrCopy,
3808
3809
  !0
3809
3810
  // 忽略设置,只返回数据,用于cut,实现历史回退需要返回两次问题
3810
3811
  ), f = a.map((d) => `${d.rowKey}-${d.key}`);
3811
- l.forEach((d) => {
3812
+ c.forEach((d) => {
3812
3813
  f.includes(`${d.rowKey}-${d.key}`) || a.unshift(d);
3813
3814
  }), this.isCut = !1;
3814
3815
  }
@@ -3816,8 +3817,8 @@ class ui {
3816
3817
  return;
3817
3818
  this.ctx.database.batchSetItemValue(a, !0);
3818
3819
  let h = [];
3819
- s.forEach((l) => {
3820
- h.push(this.ctx.database.getRowDataItemForRowKey(l));
3820
+ s.forEach((c) => {
3821
+ h.push(this.ctx.database.getRowDataItemForRowKey(c));
3821
3822
  }), this.ctx.emit("pasteChange", a, h), this.clearCopyLine(), this.ctx.emit("drawView");
3822
3823
  }).catch((r) => {
3823
3824
  console.error("获取剪贴板内容失败:", r);
@@ -3849,8 +3850,8 @@ class ui {
3849
3850
  s < h && s++;
3850
3851
  break;
3851
3852
  }
3852
- const l = [i, i], f = [s, s], d = this.getCell(s, i);
3853
- d && (d.operation || this.isInSettingRange(d.rowIndex, d.colIndex) && (this.ctx.setFocusCell(d), this.setSelector(l, f), this.adjustBoundaryPosition(), this.ctx.emit("drawView")));
3853
+ const c = [i, i], f = [s, s], d = this.getCell(s, i);
3854
+ d && (d.operation || this.isInSettingRange(d.rowIndex, d.colIndex) && (this.ctx.setFocusCell(d), this.setSelector(c, f), this.adjustBoundaryPosition(), this.ctx.emit("drawView")));
3854
3855
  }
3855
3856
  stopAdjustPosition() {
3856
3857
  this.adjustPositionX = "", this.adjustPositionY = "", this.timerX && (clearInterval(this.timerX), this.timerX = 0), this.timerY && (clearInterval(this.timerY), this.timerY = 0);
@@ -3864,8 +3865,8 @@ class ui {
3864
3865
  SELECTOR_AREA_MAX_Y: o,
3865
3866
  SELECTOR_AREA_MAX_X_OFFSET: a,
3866
3867
  SELECTOR_AREA_MAX_Y_OFFSET: h
3867
- } = this.ctx.config, l = i, f = s || this.ctx.maxColIndex - a, d = r, x = o || this.ctx.maxRowIndex - h;
3868
- return !(e < l || e > f || t < d || t > x);
3868
+ } = this.ctx.config, c = i, f = s || this.ctx.maxColIndex - a, d = r, x = o || this.ctx.maxRowIndex - h;
3869
+ return !(e < c || e > f || t < d || t > x);
3869
3870
  }
3870
3871
  /**
3871
3872
  * 调整滚动条位置,让到达边界时自动滚动
@@ -3878,8 +3879,8 @@ class ui {
3878
3879
  let a = 10 * (s === "left" ? -1 : 1);
3879
3880
  this.timerX && (clearInterval(this.timerX), this.timerX = 0), this.timerX = setInterval(() => {
3880
3881
  a *= 1.5;
3881
- const { scrollX: h } = this.ctx, l = h + a;
3882
- (l < 0 || l > this.ctx.body.width) && (clearInterval(this.timerX), this.timerX = 0), this.ctx.setScrollX(l);
3882
+ const { scrollX: h } = this.ctx, c = h + a;
3883
+ (c < 0 || c > this.ctx.body.width) && (clearInterval(this.timerX), this.timerX = 0), this.ctx.setScrollX(c);
3883
3884
  }, 100);
3884
3885
  }
3885
3886
  if (r && this.adjustPositionY !== r) {
@@ -3887,8 +3888,8 @@ class ui {
3887
3888
  let a = 10 * (r === "top" ? -1 : 1);
3888
3889
  this.timerY && (clearInterval(this.timerY), this.timerY = 0), this.timerY = setInterval(() => {
3889
3890
  a *= 1.5;
3890
- const { scrollY: h } = this.ctx, l = h + a;
3891
- (l < 0 || l > this.ctx.body.height) && (clearInterval(this.timerY), this.timerY = 0), this.ctx.setScrollY(l);
3891
+ const { scrollY: h } = this.ctx, c = h + a;
3892
+ (c < 0 || c > this.ctx.body.height) && (clearInterval(this.timerY), this.timerY = 0), this.ctx.setScrollY(c);
3892
3893
  }, 100);
3893
3894
  }
3894
3895
  }
@@ -3905,16 +3906,16 @@ class ui {
3905
3906
  header: o,
3906
3907
  footer: a,
3907
3908
  scrollX: h,
3908
- scrollY: l
3909
+ scrollY: c
3909
3910
  } = this.ctx;
3910
- if (!i)
3911
+ if (!i || i.height > t)
3911
3912
  return;
3912
3913
  const { SCROLLER_TRACK_SIZE: f = 0, FOOTER_FIXED: d } = this.ctx.config;
3913
3914
  let x = 0;
3914
3915
  d && (x = a.visibleHeight);
3915
3916
  const u = r - i.drawX + 1, g = i.drawX + i.width - (e - s) + 1, w = o.height - i.drawY, p = i.drawY + i.height - (t - x - f);
3916
3917
  this.adjustTimer && (clearTimeout(this.adjustTimer), this.adjustTimer = 0), this.adjustTimer = setTimeout(() => {
3917
- this.ctx.editing || (g > 0 && !i.fixed ? this.ctx.setScrollX(h + g) : u > 0 && !i.fixed && this.ctx.setScrollX(h - u), w > 0 ? this.ctx.setScrollY(l - w) : p > 0 && this.ctx.setScrollY(l + p));
3918
+ this.ctx.editing || (g > 0 && !i.fixed ? this.ctx.setScrollX(h + g) : u > 0 && !i.fixed && this.ctx.setScrollX(h - u), w > 0 ? this.ctx.setScrollY(c - w) : p > 0 && this.ctx.setScrollY(c + p));
3918
3919
  }, 167);
3919
3920
  }
3920
3921
  destroy() {
@@ -3923,14 +3924,14 @@ class ui {
3923
3924
  }
3924
3925
  class gi {
3925
3926
  constructor(t) {
3926
- c(this, "ctx");
3927
+ l(this, "ctx");
3927
3928
  this.ctx = t, this.init();
3928
3929
  }
3929
3930
  init() {
3930
3931
  this.ctx.on("cellMouseenter", (t, e) => {
3931
3932
  this.ctx.stageElement.style.cursor === "crosshair" && (this.ctx.stageElement.style.cursor = "default");
3932
- const { offsetX: i, offsetY: s } = this.ctx.getOffset(e), { xArr: r, yArr: o } = this.ctx.selector, a = r[1], h = o[1], { colIndex: l, rowIndex: f, drawX: d, drawY: x, width: u, height: g } = t;
3933
- if (this.ctx.config.ENABLE_AUTOFILL && l === a && f === h) {
3933
+ const { offsetX: i, offsetY: s } = this.ctx.getOffset(e), { xArr: r, yArr: o } = this.ctx.selector, a = r[1], h = o[1], { colIndex: c, rowIndex: f, drawX: d, drawY: x, width: u, height: g } = t;
3934
+ if (this.ctx.config.ENABLE_AUTOFILL && c === a && f === h) {
3934
3935
  const p = d + u - 6, y = x + g - 6;
3935
3936
  i > p && s > y && (this.ctx.stageElement.style.cursor = "crosshair");
3936
3937
  }
@@ -3973,12 +3974,12 @@ class gi {
3973
3974
  if (JSON.stringify(this.ctx.autofill.xArr) !== JSON.stringify(o) || JSON.stringify(this.ctx.autofill.yArr) !== JSON.stringify(a)) {
3974
3975
  const {
3975
3976
  SELECTOR_AREA_MIN_X: h,
3976
- SELECTOR_AREA_MAX_X: l,
3977
+ SELECTOR_AREA_MAX_X: c,
3977
3978
  SELECTOR_AREA_MIN_Y: f,
3978
3979
  SELECTOR_AREA_MAX_Y: d,
3979
3980
  SELECTOR_AREA_MAX_X_OFFSET: x,
3980
3981
  SELECTOR_AREA_MAX_Y_OFFSET: u
3981
- } = this.ctx.config, g = h, w = l || this.ctx.maxColIndex - x, p = f, y = d || this.ctx.maxRowIndex - u;
3982
+ } = this.ctx.config, g = h, w = c || this.ctx.maxColIndex - x, p = f, y = d || this.ctx.maxRowIndex - u;
3982
3983
  let [b, m] = o, [E, C] = a;
3983
3984
  if (b < g || E < p)
3984
3985
  return;
@@ -3996,13 +3997,13 @@ class gi {
3996
3997
  i.set(`${u}-${g}`, !0);
3997
3998
  }
3998
3999
  const { value: s } = e, r = s[0].length, o = s.length, a = this.ctx.autofill.xArr, h = this.ctx.autofill.yArr;
3999
- let l = [];
4000
+ let c = [];
4000
4001
  for (let d = 0; d <= h[1] - h[0]; d++)
4001
4002
  for (let x = 0; x <= a[1] - a[0]; x++) {
4002
4003
  const u = x + a[0], g = d + h[0], w = s[d % o][x % r], p = this.ctx.database.getItemValueForRowIndexAndColIndex(g, u), y = `${g}-${u}`;
4003
4004
  if (p && !i.has(y)) {
4004
4005
  const { rowKey: b, key: m } = p;
4005
- this.ctx.database.getReadonly(b, m) || (t.add(b), l.push({
4006
+ this.ctx.database.getReadonly(b, m) || (t.add(b), c.push({
4006
4007
  rowKey: b,
4007
4008
  key: m,
4008
4009
  value: w,
@@ -4010,13 +4011,13 @@ class gi {
4010
4011
  }));
4011
4012
  }
4012
4013
  }
4013
- if (!l.length)
4014
+ if (!c.length)
4014
4015
  return;
4015
- this.ctx.database.batchSetItemValue(l, !0);
4016
+ this.ctx.database.batchSetItemValue(c, !0);
4016
4017
  let f = [];
4017
4018
  t.forEach((d) => {
4018
4019
  f.push(this.ctx.database.getRowDataItemForRowKey(d));
4019
- }), this.ctx.emit("autofillChange", l, f), this.ctx.selector.xArr = this.ctx.autofill.xArr, this.ctx.selector.yArr = this.ctx.autofill.yArr, this.ctx.emit("draw");
4020
+ }), this.ctx.emit("autofillChange", c, f), this.ctx.selector.xArr = this.ctx.autofill.xArr, this.ctx.selector.yArr = this.ctx.autofill.yArr, this.ctx.emit("draw");
4020
4021
  }
4021
4022
  mouseenter(t) {
4022
4023
  if (["index", "selection", "index-selection"].includes(t.type))
@@ -4051,10 +4052,10 @@ function at(n, t) {
4051
4052
  function q(n) {
4052
4053
  return n.split("-")[0];
4053
4054
  }
4054
- function ct(n) {
4055
+ function lt(n) {
4055
4056
  return n.split("-")[1];
4056
4057
  }
4057
- function ce(n) {
4058
+ function re(n) {
4058
4059
  return n === "x" ? "y" : "x";
4059
4060
  }
4060
4061
  function Lt(n) {
@@ -4064,11 +4065,11 @@ function J(n) {
4064
4065
  return ["top", "bottom"].includes(q(n)) ? "y" : "x";
4065
4066
  }
4066
4067
  function Mt(n) {
4067
- return ce(J(n));
4068
+ return re(J(n));
4068
4069
  }
4069
4070
  function yi(n, t, e) {
4070
4071
  e === void 0 && (e = !1);
4071
- const i = ct(n), s = Mt(n), r = Lt(s);
4072
+ const i = lt(n), s = Mt(n), r = Lt(s);
4072
4073
  let o = s === "x" ? i === (e ? "end" : "start") ? "right" : "left" : i === "start" ? "bottom" : "top";
4073
4074
  return t.reference[r] > t.floating[r] && (o = xt(o)), [o, xt(o)];
4074
4075
  }
@@ -4093,7 +4094,7 @@ function Ei(n, t, e) {
4093
4094
  }
4094
4095
  }
4095
4096
  function bi(n, t, e, i) {
4096
- const s = ct(n);
4097
+ const s = lt(n);
4097
4098
  let r = Ei(q(n), e === "start", i);
4098
4099
  return s && (r = r.map((o) => o + "-" + s), t && (r = r.concat(r.map(Ot)))), r;
4099
4100
  }
@@ -4109,7 +4110,7 @@ function Ci(n) {
4109
4110
  ...n
4110
4111
  };
4111
4112
  }
4112
- function he(n) {
4113
+ function oe(n) {
4113
4114
  return typeof n != "number" ? Ci(n) : {
4114
4115
  top: n,
4115
4116
  right: n,
@@ -4135,12 +4136,12 @@ function ut(n) {
4135
4136
  y: e
4136
4137
  };
4137
4138
  }
4138
- function Gt(n, t, e) {
4139
+ function Vt(n, t, e) {
4139
4140
  let {
4140
4141
  reference: i,
4141
4142
  floating: s
4142
4143
  } = n;
4143
- const r = J(t), o = Mt(t), a = Lt(o), h = q(t), l = r === "y", f = i.x + i.width / 2 - s.width / 2, d = i.y + i.height / 2 - s.height / 2, x = i[a] / 2 - s[a] / 2;
4144
+ const r = J(t), o = Mt(t), a = Lt(o), h = q(t), c = r === "y", f = i.x + i.width / 2 - s.width / 2, d = i.y + i.height / 2 - s.height / 2, x = i[a] / 2 - s[a] / 2;
4144
4145
  let u;
4145
4146
  switch (h) {
4146
4147
  case "top":
@@ -4173,12 +4174,12 @@ function Gt(n, t, e) {
4173
4174
  y: i.y
4174
4175
  };
4175
4176
  }
4176
- switch (ct(t)) {
4177
+ switch (lt(t)) {
4177
4178
  case "start":
4178
- u[o] -= x * (e && l ? -1 : 1);
4179
+ u[o] -= x * (e && c ? -1 : 1);
4179
4180
  break;
4180
4181
  case "end":
4181
- u[o] += x * (e && l ? -1 : 1);
4182
+ u[o] += x * (e && c ? -1 : 1);
4182
4183
  break;
4183
4184
  }
4184
4185
  return u;
@@ -4190,14 +4191,14 @@ const vi = async (n, t, e) => {
4190
4191
  middleware: r = [],
4191
4192
  platform: o
4192
4193
  } = e, a = r.filter(Boolean), h = await (o.isRTL == null ? void 0 : o.isRTL(t));
4193
- let l = await o.getElementRects({
4194
+ let c = await o.getElementRects({
4194
4195
  reference: n,
4195
4196
  floating: t,
4196
4197
  strategy: s
4197
4198
  }), {
4198
4199
  x: f,
4199
4200
  y: d
4200
- } = Gt(l, i, h), x = i, u = {}, g = 0;
4201
+ } = Vt(c, i, h), x = i, u = {}, g = 0;
4201
4202
  for (let w = 0; w < a.length; w++) {
4202
4203
  const {
4203
4204
  name: p,
@@ -4214,7 +4215,7 @@ const vi = async (n, t, e) => {
4214
4215
  placement: x,
4215
4216
  strategy: s,
4216
4217
  middlewareData: u,
4217
- rects: l,
4218
+ rects: c,
4218
4219
  platform: o,
4219
4220
  elements: {
4220
4221
  reference: n,
@@ -4227,14 +4228,14 @@ const vi = async (n, t, e) => {
4227
4228
  ...u[p],
4228
4229
  ...E
4229
4230
  }
4230
- }, C && g <= 50 && (g++, typeof C == "object" && (C.placement && (x = C.placement), C.rects && (l = C.rects === !0 ? await o.getElementRects({
4231
+ }, C && g <= 50 && (g++, typeof C == "object" && (C.placement && (x = C.placement), C.rects && (c = C.rects === !0 ? await o.getElementRects({
4231
4232
  reference: n,
4232
4233
  floating: t,
4233
4234
  strategy: s
4234
4235
  }) : C.rects), {
4235
4236
  x: f,
4236
4237
  y: d
4237
- } = Gt(l, x, h)), w = -1);
4238
+ } = Vt(c, x, h)), w = -1);
4238
4239
  }
4239
4240
  return {
4240
4241
  x: f,
@@ -4244,7 +4245,7 @@ const vi = async (n, t, e) => {
4244
4245
  middlewareData: u
4245
4246
  };
4246
4247
  };
4247
- async function le(n, t) {
4248
+ async function ne(n, t) {
4248
4249
  var e;
4249
4250
  t === void 0 && (t = {});
4250
4251
  const {
@@ -4255,14 +4256,14 @@ async function le(n, t) {
4255
4256
  elements: a,
4256
4257
  strategy: h
4257
4258
  } = n, {
4258
- boundary: l = "clippingAncestors",
4259
+ boundary: c = "clippingAncestors",
4259
4260
  rootBoundary: f = "viewport",
4260
4261
  elementContext: d = "floating",
4261
4262
  altBoundary: x = !1,
4262
4263
  padding: u = 0
4263
- } = at(t, n), g = he(u), p = a[x ? d === "floating" ? "reference" : "floating" : d], y = ut(await r.getClippingRect({
4264
+ } = at(t, n), g = oe(u), p = a[x ? d === "floating" ? "reference" : "floating" : d], y = ut(await r.getClippingRect({
4264
4265
  element: (e = await (r.isElement == null ? void 0 : r.isElement(p))) == null || e ? p : p.contextElement || await (r.getDocumentElement == null ? void 0 : r.getDocumentElement(a.floating)),
4265
- boundary: l,
4266
+ boundary: c,
4266
4267
  rootBoundary: f,
4267
4268
  strategy: h
4268
4269
  })), b = d === "floating" ? {
@@ -4302,18 +4303,18 @@ const Ri = (n) => ({
4302
4303
  elements: a,
4303
4304
  middlewareData: h
4304
4305
  } = t, {
4305
- element: l,
4306
+ element: c,
4306
4307
  padding: f = 0
4307
4308
  } = at(n, t) || {};
4308
- if (l == null)
4309
+ if (c == null)
4309
4310
  return {};
4310
- const d = he(f), x = {
4311
+ const d = oe(f), x = {
4311
4312
  x: e,
4312
4313
  y: i
4313
- }, u = Mt(s), g = Lt(u), w = await o.getDimensions(l), p = u === "y", y = p ? "top" : "left", b = p ? "bottom" : "right", m = p ? "clientHeight" : "clientWidth", E = r.reference[g] + r.reference[u] - x[u] - r.floating[g], C = x[u] - r.reference[u], R = await (o.getOffsetParent == null ? void 0 : o.getOffsetParent(l));
4314
+ }, u = Mt(s), g = Lt(u), w = await o.getDimensions(c), p = u === "y", y = p ? "top" : "left", b = p ? "bottom" : "right", m = p ? "clientHeight" : "clientWidth", E = r.reference[g] + r.reference[u] - x[u] - r.floating[g], C = x[u] - r.reference[u], R = await (o.getOffsetParent == null ? void 0 : o.getOffsetParent(c));
4314
4315
  let T = R ? R[m] : 0;
4315
4316
  (!T || !await (o.isElement == null ? void 0 : o.isElement(R))) && (T = a.floating[m] || r.floating[g]);
4316
- const A = E / 2 - C / 2, L = T / 2 - w[g] / 2 - 1, D = rt(d[y], L), B = rt(d[b], L), I = D, S = T - w[g] - B, O = T / 2 - w[g] / 2 + A, G = It(I, O, S), Y = !h.arrow && ct(s) != null && O !== G && r.reference[g] / 2 - (O < I ? D : B) - w[g] / 2 < 0, k = Y ? O < I ? O - I : O - S : 0;
4317
+ const A = E / 2 - C / 2, L = T / 2 - w[g] / 2 - 1, D = rt(d[y], L), B = rt(d[b], L), I = D, S = T - w[g] - B, O = T / 2 - w[g] / 2 + A, G = It(I, O, S), Y = !h.arrow && lt(s) != null && O !== G && r.reference[g] / 2 - (O < I ? D : B) - w[g] / 2 < 0, k = Y ? O < I ? O - I : O - S : 0;
4317
4318
  return {
4318
4319
  [u]: x[u] + k,
4319
4320
  data: {
@@ -4338,7 +4339,7 @@ const Ri = (n) => ({
4338
4339
  rects: o,
4339
4340
  initialPlacement: a,
4340
4341
  platform: h,
4341
- elements: l
4342
+ elements: c
4342
4343
  } = t, {
4343
4344
  mainAxis: f = !0,
4344
4345
  crossAxis: d = !0,
@@ -4350,9 +4351,9 @@ const Ri = (n) => ({
4350
4351
  } = at(n, t);
4351
4352
  if ((e = r.arrow) != null && e.alignmentOffset)
4352
4353
  return {};
4353
- const y = q(s), b = J(a), m = q(a) === a, E = await (h.isRTL == null ? void 0 : h.isRTL(l.floating)), C = x || (m || !w ? [xt(a)] : mi(a)), R = g !== "none";
4354
+ const y = q(s), b = J(a), m = q(a) === a, E = await (h.isRTL == null ? void 0 : h.isRTL(c.floating)), C = x || (m || !w ? [xt(a)] : mi(a)), R = g !== "none";
4354
4355
  !x && R && C.push(...bi(a, w, g, E));
4355
- const T = [a, ...C], A = await le(t, p), L = [];
4356
+ const T = [a, ...C], A = await ne(t, p), L = [];
4356
4357
  let D = ((i = r.flip) == null ? void 0 : i.overflows) || [];
4357
4358
  if (f && L.push(A[y]), d) {
4358
4359
  const O = yi(s, o, E);
@@ -4411,7 +4412,7 @@ async function Ii(n, t) {
4411
4412
  placement: e,
4412
4413
  platform: i,
4413
4414
  elements: s
4414
- } = n, r = await (i.isRTL == null ? void 0 : i.isRTL(s.floating)), o = q(e), a = ct(e), h = J(e) === "y", l = ["left", "top"].includes(o) ? -1 : 1, f = r && h ? -1 : 1, d = at(t, n);
4415
+ } = n, r = await (i.isRTL == null ? void 0 : i.isRTL(s.floating)), o = q(e), a = lt(e), h = J(e) === "y", c = ["left", "top"].includes(o) ? -1 : 1, f = r && h ? -1 : 1, d = at(t, n);
4415
4416
  let {
4416
4417
  mainAxis: x,
4417
4418
  crossAxis: u,
@@ -4427,9 +4428,9 @@ async function Ii(n, t) {
4427
4428
  };
4428
4429
  return a && typeof g == "number" && (u = a === "end" ? g * -1 : g), h ? {
4429
4430
  x: u * f,
4430
- y: x * l
4431
+ y: x * c
4431
4432
  } : {
4432
- x: x * l,
4433
+ x: x * c,
4433
4434
  y: u * f
4434
4435
  };
4435
4436
  }
@@ -4480,11 +4481,11 @@ const Oi = function(n) {
4480
4481
  }
4481
4482
  },
4482
4483
  ...h
4483
- } = at(n, t), l = {
4484
+ } = at(n, t), c = {
4484
4485
  x: e,
4485
4486
  y: i
4486
- }, f = await le(t, h), d = J(q(s)), x = ce(d);
4487
- let u = l[x], g = l[d];
4487
+ }, f = await ne(t, h), d = J(q(s)), x = re(d);
4488
+ let u = c[x], g = c[d];
4488
4489
  if (r) {
4489
4490
  const p = x === "y" ? "top" : "left", y = x === "y" ? "bottom" : "right", b = u + f[p], m = u - f[y];
4490
4491
  u = It(b, u, m);
@@ -4516,7 +4517,7 @@ function gt() {
4516
4517
  return typeof window < "u";
4517
4518
  }
4518
4519
  function tt(n) {
4519
- return de(n) ? (n.nodeName || "").toLowerCase() : "#document";
4520
+ return ae(n) ? (n.nodeName || "").toLowerCase() : "#document";
4520
4521
  }
4521
4522
  function H(n) {
4522
4523
  var t;
@@ -4524,9 +4525,9 @@ function H(n) {
4524
4525
  }
4525
4526
  function K(n) {
4526
4527
  var t;
4527
- return (t = (de(n) ? n.ownerDocument : n.document) || window.document) == null ? void 0 : t.documentElement;
4528
+ return (t = (ae(n) ? n.ownerDocument : n.document) || window.document) == null ? void 0 : t.documentElement;
4528
4529
  }
4529
- function de(n) {
4530
+ function ae(n) {
4530
4531
  return gt() ? n instanceof Node || n instanceof H(n).Node : !1;
4531
4532
  }
4532
4533
  function X(n) {
@@ -4535,7 +4536,7 @@ function X(n) {
4535
4536
  function N(n) {
4536
4537
  return gt() ? n instanceof HTMLElement || n instanceof H(n).HTMLElement : !1;
4537
4538
  }
4538
- function jt(n) {
4539
+ function zt(n) {
4539
4540
  return !gt() || typeof ShadowRoot > "u" ? !1 : n instanceof ShadowRoot || n instanceof H(n).ShadowRoot;
4540
4541
  }
4541
4542
  function ht(n) {
@@ -4599,19 +4600,19 @@ function z(n) {
4599
4600
  // Step into the shadow DOM of the parent of a slotted node.
4600
4601
  n.assignedSlot || // DOM Element detected.
4601
4602
  n.parentNode || // ShadowRoot detected.
4602
- jt(n) && n.host || // Fallback.
4603
+ zt(n) && n.host || // Fallback.
4603
4604
  K(n)
4604
4605
  );
4605
- return jt(t) ? t.host : t;
4606
+ return zt(t) ? t.host : t;
4606
4607
  }
4607
- function fe(n) {
4608
+ function le(n) {
4608
4609
  const t = z(n);
4609
- return Q(t) ? n.ownerDocument ? n.ownerDocument.body : n.body : N(t) && ht(t) ? t : fe(t);
4610
+ return Q(t) ? n.ownerDocument ? n.ownerDocument.body : n.body : N(t) && ht(t) ? t : le(t);
4610
4611
  }
4611
4612
  function Tt(n, t, e) {
4612
4613
  var i;
4613
4614
  t === void 0 && (t = []), e === void 0 && (e = !0);
4614
- const s = fe(n), r = s === ((i = n.ownerDocument) == null ? void 0 : i.body), o = H(s);
4615
+ const s = le(n), r = s === ((i = n.ownerDocument) == null ? void 0 : i.body), o = H(s);
4615
4616
  if (r) {
4616
4617
  const a = St(o);
4617
4618
  return t.concat(o, o.visualViewport || [], ht(s) ? s : [], a && e ? Tt(a) : []);
@@ -4621,7 +4622,7 @@ function Tt(n, t, e) {
4621
4622
  function St(n) {
4622
4623
  return n.parent && Object.getPrototypeOf(n.parent) ? n.frameElement : null;
4623
4624
  }
4624
- function xe(n) {
4625
+ function he(n) {
4625
4626
  const t = F(n);
4626
4627
  let e = parseFloat(t.width) || 0, i = parseFloat(t.height) || 0;
4627
4628
  const s = N(n), r = s ? n.offsetWidth : e, o = s ? n.offsetHeight : i, a = ft(e) !== r || ft(i) !== o;
@@ -4631,18 +4632,18 @@ function xe(n) {
4631
4632
  $: a
4632
4633
  };
4633
4634
  }
4634
- function ue(n) {
4635
+ function ce(n) {
4635
4636
  return X(n) ? n : n.contextElement;
4636
4637
  }
4637
4638
  function Z(n) {
4638
- const t = ue(n);
4639
+ const t = ce(n);
4639
4640
  if (!N(t))
4640
4641
  return V(1);
4641
4642
  const e = t.getBoundingClientRect(), {
4642
4643
  width: i,
4643
4644
  height: s,
4644
4645
  $: r
4645
- } = xe(t);
4646
+ } = he(t);
4646
4647
  let o = (r ? ft(e.width) : e.width) / i, a = (r ? ft(e.height) : e.height) / s;
4647
4648
  return (!o || !Number.isFinite(o)) && (o = 1), (!a || !Number.isFinite(a)) && (a = 1), {
4648
4649
  x: o,
@@ -4650,7 +4651,7 @@ function Z(n) {
4650
4651
  };
4651
4652
  }
4652
4653
  const Li = /* @__PURE__ */ V(0);
4653
- function ge(n) {
4654
+ function de(n) {
4654
4655
  const t = H(n);
4655
4656
  return !Dt() || !t.visualViewport ? Li : {
4656
4657
  x: t.visualViewport.offsetLeft,
@@ -4662,24 +4663,24 @@ function Mi(n, t, e) {
4662
4663
  }
4663
4664
  function ot(n, t, e, i) {
4664
4665
  t === void 0 && (t = !1), e === void 0 && (e = !1);
4665
- const s = n.getBoundingClientRect(), r = ue(n);
4666
+ const s = n.getBoundingClientRect(), r = ce(n);
4666
4667
  let o = V(1);
4667
4668
  t && (i ? X(i) && (o = Z(i)) : o = Z(n));
4668
- const a = Mi(r, e, i) ? ge(r) : V(0);
4669
- let h = (s.left + a.x) / o.x, l = (s.top + a.y) / o.y, f = s.width / o.x, d = s.height / o.y;
4669
+ const a = Mi(r, e, i) ? de(r) : V(0);
4670
+ let h = (s.left + a.x) / o.x, c = (s.top + a.y) / o.y, f = s.width / o.x, d = s.height / o.y;
4670
4671
  if (r) {
4671
4672
  const x = H(r), u = i && X(i) ? H(i) : i;
4672
4673
  let g = x, w = St(g);
4673
4674
  for (; w && i && u !== g; ) {
4674
4675
  const p = Z(w), y = w.getBoundingClientRect(), b = F(w), m = y.left + (w.clientLeft + parseFloat(b.paddingLeft)) * p.x, E = y.top + (w.clientTop + parseFloat(b.paddingTop)) * p.y;
4675
- h *= p.x, l *= p.y, f *= p.x, d *= p.y, h += m, l += E, g = H(w), w = St(g);
4676
+ h *= p.x, c *= p.y, f *= p.x, d *= p.y, h += m, c += E, g = H(w), w = St(g);
4676
4677
  }
4677
4678
  }
4678
4679
  return ut({
4679
4680
  width: f,
4680
4681
  height: d,
4681
4682
  x: h,
4682
- y: l
4683
+ y: c
4683
4684
  });
4684
4685
  }
4685
4686
  function Hi(n) {
@@ -4695,17 +4696,17 @@ function Hi(n) {
4695
4696
  let h = {
4696
4697
  scrollLeft: 0,
4697
4698
  scrollTop: 0
4698
- }, l = V(1);
4699
+ }, c = V(1);
4699
4700
  const f = V(0), d = N(i);
4700
4701
  if ((d || !d && !r) && ((tt(i) !== "body" || ht(o)) && (h = pt(i)), N(i))) {
4701
4702
  const x = ot(i);
4702
- l = Z(i), f.x = x.x + i.clientLeft, f.y = x.y + i.clientTop;
4703
+ c = Z(i), f.x = x.x + i.clientLeft, f.y = x.y + i.clientTop;
4703
4704
  }
4704
4705
  return {
4705
- width: e.width * l.x,
4706
- height: e.height * l.y,
4707
- x: e.x * l.x - h.scrollLeft * l.x + f.x,
4708
- y: e.y * l.y - h.scrollTop * l.y + f.y
4706
+ width: e.width * c.x,
4707
+ height: e.height * c.y,
4708
+ x: e.x * c.x - h.scrollLeft * c.x + f.x,
4709
+ y: e.y * c.y - h.scrollTop * c.y + f.y
4709
4710
  };
4710
4711
  }
4711
4712
  function Di(n) {
@@ -4731,8 +4732,8 @@ function Fi(n, t) {
4731
4732
  let r = i.clientWidth, o = i.clientHeight, a = 0, h = 0;
4732
4733
  if (s) {
4733
4734
  r = s.width, o = s.height;
4734
- const l = Dt();
4735
- (!l || l && t === "fixed") && (a = s.offsetLeft, h = s.offsetTop);
4735
+ const c = Dt();
4736
+ (!c || c && t === "fixed") && (a = s.offsetLeft, h = s.offsetTop);
4736
4737
  }
4737
4738
  return {
4738
4739
  width: r,
@@ -4742,15 +4743,15 @@ function Fi(n, t) {
4742
4743
  };
4743
4744
  }
4744
4745
  function ki(n, t) {
4745
- const e = ot(n, !0, t === "fixed"), i = e.top + n.clientTop, s = e.left + n.clientLeft, r = N(n) ? Z(n) : V(1), o = n.clientWidth * r.x, a = n.clientHeight * r.y, h = s * r.x, l = i * r.y;
4746
+ const e = ot(n, !0, t === "fixed"), i = e.top + n.clientTop, s = e.left + n.clientLeft, r = N(n) ? Z(n) : V(1), o = n.clientWidth * r.x, a = n.clientHeight * r.y, h = s * r.x, c = i * r.y;
4746
4747
  return {
4747
4748
  width: o,
4748
4749
  height: a,
4749
4750
  x: h,
4750
- y: l
4751
+ y: c
4751
4752
  };
4752
4753
  }
4753
- function Ut(n, t, e) {
4754
+ function $t(n, t, e) {
4754
4755
  let i;
4755
4756
  if (t === "viewport")
4756
4757
  i = Fi(n, e);
@@ -4759,7 +4760,7 @@ function Ut(n, t, e) {
4759
4760
  else if (X(t))
4760
4761
  i = ki(t, e);
4761
4762
  else {
4762
- const s = ge(n);
4763
+ const s = de(n);
4763
4764
  i = {
4764
4765
  ...t,
4765
4766
  x: t.x - s.x,
@@ -4768,9 +4769,9 @@ function Ut(n, t, e) {
4768
4769
  }
4769
4770
  return ut(i);
4770
4771
  }
4771
- function we(n, t) {
4772
+ function fe(n, t) {
4772
4773
  const e = z(n);
4773
- return e === t || !X(e) || Q(e) ? !1 : F(e).position === "fixed" || we(e, t);
4774
+ return e === t || !X(e) || Q(e) ? !1 : F(e).position === "fixed" || fe(e, t);
4774
4775
  }
4775
4776
  function Ni(n, t) {
4776
4777
  const e = t.get(n);
@@ -4781,7 +4782,7 @@ function Ni(n, t) {
4781
4782
  let o = r ? z(n) : n;
4782
4783
  for (; X(o) && !Q(o); ) {
4783
4784
  const a = F(o), h = Ht(o);
4784
- !h && a.position === "fixed" && (s = null), (r ? !h && !s : !h && a.position === "static" && !!s && ["absolute", "fixed"].includes(s.position) || ht(o) && !h && we(n, o)) ? i = i.filter((f) => f !== o) : s = a, o = z(o);
4785
+ !h && a.position === "fixed" && (s = null), (r ? !h && !s : !h && a.position === "static" && !!s && ["absolute", "fixed"].includes(s.position) || ht(o) && !h && fe(n, o)) ? i = i.filter((f) => f !== o) : s = a, o = z(o);
4785
4786
  }
4786
4787
  return t.set(n, i), i;
4787
4788
  }
@@ -4792,10 +4793,10 @@ function Yi(n) {
4792
4793
  rootBoundary: i,
4793
4794
  strategy: s
4794
4795
  } = n;
4795
- const o = [...e === "clippingAncestors" ? wt(t) ? [] : Ni(t, this._c) : [].concat(e), i], a = o[0], h = o.reduce((l, f) => {
4796
- const d = Ut(t, f, s);
4797
- return l.top = U(d.top, l.top), l.right = rt(d.right, l.right), l.bottom = rt(d.bottom, l.bottom), l.left = U(d.left, l.left), l;
4798
- }, Ut(t, a, s));
4796
+ const o = [...e === "clippingAncestors" ? wt(t) ? [] : Ni(t, this._c) : [].concat(e), i], a = o[0], h = o.reduce((c, f) => {
4797
+ const d = $t(t, f, s);
4798
+ return c.top = U(d.top, c.top), c.right = rt(d.right, c.right), c.bottom = rt(d.bottom, c.bottom), c.left = U(d.left, c.left), c;
4799
+ }, $t(t, a, s));
4799
4800
  return {
4800
4801
  width: h.right - h.left,
4801
4802
  height: h.bottom - h.top,
@@ -4807,7 +4808,7 @@ function Ki(n) {
4807
4808
  const {
4808
4809
  width: t,
4809
4810
  height: e
4810
- } = xe(n);
4811
+ } = he(n);
4811
4812
  return {
4812
4813
  width: t,
4813
4814
  height: e
@@ -4825,13 +4826,13 @@ function Bi(n, t, e) {
4825
4826
  const u = ot(t, !0, r, t);
4826
4827
  h.x = u.x + t.clientLeft, h.y = u.y + t.clientTop;
4827
4828
  } else s && (h.x = At(s));
4828
- let l = 0, f = 0;
4829
+ let c = 0, f = 0;
4829
4830
  if (s && !i && !r) {
4830
4831
  const u = s.getBoundingClientRect();
4831
- f = u.top + a.scrollTop, l = u.left + a.scrollLeft - // RTL <body> scrollbar.
4832
+ f = u.top + a.scrollTop, c = u.left + a.scrollLeft - // RTL <body> scrollbar.
4832
4833
  At(s, u);
4833
4834
  }
4834
- const d = o.left + a.scrollLeft - h.x - l, x = o.top + a.scrollTop - h.y - f;
4835
+ const d = o.left + a.scrollLeft - h.x - c, x = o.top + a.scrollTop - h.y - f;
4835
4836
  return {
4836
4837
  x: d,
4837
4838
  y: x,
@@ -4842,7 +4843,7 @@ function Bi(n, t, e) {
4842
4843
  function mt(n) {
4843
4844
  return F(n).position === "static";
4844
4845
  }
4845
- function Zt(n, t) {
4846
+ function qt(n, t) {
4846
4847
  if (!N(n) || F(n).position === "fixed")
4847
4848
  return null;
4848
4849
  if (t)
@@ -4850,7 +4851,7 @@ function Zt(n, t) {
4850
4851
  let e = n.offsetParent;
4851
4852
  return K(n) === e && (e = e.ownerDocument.body), e;
4852
4853
  }
4853
- function pe(n, t) {
4854
+ function xe(n, t) {
4854
4855
  const e = H(n);
4855
4856
  if (wt(n))
4856
4857
  return e;
@@ -4863,13 +4864,13 @@ function pe(n, t) {
4863
4864
  }
4864
4865
  return e;
4865
4866
  }
4866
- let i = Zt(n, t);
4867
+ let i = qt(n, t);
4867
4868
  for (; i && Si(i) && mt(i); )
4868
- i = Zt(i, t);
4869
+ i = qt(i, t);
4869
4870
  return i && Q(i) && mt(i) && !Ht(i) ? e : i || Ai(n) || e;
4870
4871
  }
4871
4872
  const Wi = async function(n) {
4872
- const t = this.getOffsetParent || pe, e = this.getDimensions, i = await e(n.floating);
4873
+ const t = this.getOffsetParent || xe, e = this.getDimensions, i = await e(n.floating);
4873
4874
  return {
4874
4875
  reference: Bi(n.reference, await t(n.floating), n.strategy),
4875
4876
  floating: {
@@ -4887,14 +4888,14 @@ const Vi = {
4887
4888
  convertOffsetParentRelativeRectToViewportRelativeRect: Hi,
4888
4889
  getDocumentElement: K,
4889
4890
  getClippingRect: Yi,
4890
- getOffsetParent: pe,
4891
+ getOffsetParent: xe,
4891
4892
  getElementRects: Wi,
4892
4893
  getClientRects: Di,
4893
4894
  getDimensions: Ki,
4894
4895
  getScale: Z,
4895
4896
  isElement: X,
4896
4897
  isRTL: Pi
4897
- }, Xt = Oi, Ft = Ti, kt = _i, zi = Ri, Nt = (n, t, e) => {
4898
+ }, ue = Oi, ge = Ti, we = _i, zi = Ri, pe = (n, t, e) => {
4898
4899
  const i = /* @__PURE__ */ new Map(), s = {
4899
4900
  platform: Vi,
4900
4901
  ...e
@@ -4909,11 +4910,11 @@ const Vi = {
4909
4910
  };
4910
4911
  let $i = class {
4911
4912
  constructor(t) {
4912
- c(this, "ctx");
4913
- c(this, "enable", !1);
4914
- c(this, "contentEl");
4915
- c(this, "floatingEl");
4916
- c(this, "arrowEl");
4913
+ l(this, "ctx");
4914
+ l(this, "enable", !1);
4915
+ l(this, "contentEl");
4916
+ l(this, "floatingEl");
4917
+ l(this, "arrowEl");
4917
4918
  this.ctx = t;
4918
4919
  const { TOOLTIP_BG_COLOR: e, TOOLTIP_TEXT_COLOR: i, TOOLTIP_ZINDEX: s, TOOLTIP_CUSTOM_STYLE: r, CSS_PREFIX: o } = this.ctx.config;
4919
4920
  this.contentEl = document.createElement("div"), this.arrowEl = document.createElement("div"), this.floatingEl = document.createElement("div"), this.floatingEl.className = `${o}-tooltip`, this.contentEl.className = `${o}-tooltip-content`, this.arrowEl.className = `${o}-tooltip-arrow`;
@@ -4964,7 +4965,7 @@ let $i = class {
4964
4965
  return;
4965
4966
  this.enable = !0, this.contentEl.style.maxWidth = `${t.overflowTooltipMaxWidth || 500}px`, 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 = e;
4966
4967
  const s = t.drawX + i.x, r = t.drawY + i.y;
4967
- Nt({
4968
+ pe({
4968
4969
  getBoundingClientRect() {
4969
4970
  return {
4970
4971
  width: t.visibleWidth,
@@ -4979,11 +4980,11 @@ let $i = class {
4979
4980
  }
4980
4981
  }, this.floatingEl, {
4981
4982
  placement: t.overflowTooltipPlacement,
4982
- middleware: [Ft(), kt(), Xt(6), zi({ element: this.arrowEl })]
4983
+ middleware: [ge(), we(), ue(6), zi({ element: this.arrowEl })]
4983
4984
  }).then((a) => {
4984
- const { x: h, y: l, placement: f, middlewareData: d } = a;
4985
+ const { x: h, y: c, placement: f, middlewareData: d } = a;
4985
4986
  if (Object.assign(this.floatingEl.style, {
4986
- top: `${l}px`,
4987
+ top: `${c}px`,
4987
4988
  left: `${h}px`
4988
4989
  }), d.arrow) {
4989
4990
  const x = d.arrow;
@@ -5020,11 +5021,13 @@ let $i = class {
5020
5021
  };
5021
5022
  class qi {
5022
5023
  constructor(t) {
5023
- c(this, "editorEl");
5024
- c(this, "inputEl");
5025
- c(this, "enable", !1);
5026
- c(this, "cellTarget", null);
5027
- c(this, "ctx");
5024
+ l(this, "editorEl");
5025
+ l(this, "inputEl");
5026
+ l(this, "enable", !1);
5027
+ l(this, "cellTarget", null);
5028
+ l(this, "ctx");
5029
+ l(this, "drawY", 0);
5030
+ l(this, "drawX", 0);
5028
5031
  this.ctx = t, this.initTextEditor(), this.init();
5029
5032
  }
5030
5033
  init() {
@@ -5087,49 +5090,44 @@ class qi {
5087
5090
  }
5088
5091
  }), this.inputEl.addEventListener("input", this.autoSize.bind(this)), this.inputEl.addEventListener("blur", () => {
5089
5092
  this.doneEdit();
5090
- }), this.editorEl = document.createElement("div"), this.editorEl.className = "e-virt-table-editor", this.inputEl.className = "e-virt-table-editor-textarea", this.editorEl.appendChild(this.inputEl), this.ctx.containerElement.appendChild(this.editorEl);
5093
+ }), this.editorEl = this.ctx.editorElement, this.inputEl.className = "e-virt-table-editor-textarea", this.editorEl.appendChild(this.inputEl), this.ctx.containerElement.appendChild(this.editorEl);
5091
5094
  }
5092
5095
  autoSize() {
5093
- const t = this.inputEl.scrollHeight;
5094
- this.inputEl.style.height = "auto", this.inputEl.style.height = `${t}px`;
5096
+ let t = this.inputEl.scrollHeight;
5097
+ this.inputEl.style.height = "auto";
5098
+ let e = this.ctx.body.visibleHeight;
5099
+ t > e && (t = e);
5100
+ const {
5101
+ stageHeight: i,
5102
+ footer: s,
5103
+ header: r,
5104
+ config: { SCROLLER_TRACK_SIZE: o }
5105
+ } = this.ctx, a = i - s.height - o;
5106
+ this.editorEl.style.bottom = "auto", (this.drawY + t > a || this.drawY < r.height) && (this.editorEl.style.left = `${this.drawX}px`, this.editorEl.style.top = "auto", this.editorEl.style.bottom = `${i - a}px`), this.inputEl.style.height = `${t}px`;
5095
5107
  }
5096
5108
  startEditByInput(t) {
5097
- if (t.editorType !== "text")
5098
- return;
5099
- const e = t.getValue(), { width: i } = t, s = t.getDrawX();
5100
- let r = t.getDrawY(), { height: o } = t;
5109
+ const e = t.getValue(), { width: i, editorType: s } = t, r = t.getDrawX();
5110
+ let o = t.getDrawY();
5111
+ this.drawX = r, this.drawY = o;
5112
+ let { height: a } = t;
5101
5113
  const {
5102
- config: { CELL_PADDING: a }
5114
+ config: { CELL_PADDING: h },
5115
+ header: c
5103
5116
  } = this.ctx;
5104
- let h = window.innerHeight / 2;
5105
- h > this.ctx.body.visibleHeight && (h = this.ctx.body.visibleHeight), this.inputEl.style.minWidth = `${i - 1}px`, this.inputEl.style.minHeight = `${o - 1}px`, this.inputEl.style.maxHeight = `${h}px`, this.inputEl.style.width = `${i - 1}px`, this.inputEl.style.height = `${o - 1}px`, this.inputEl.style.padding = `${a}px`, e !== null && (this.inputEl.value = e), this.inputEl.focus();
5106
- const l = this.inputEl.value.length;
5107
- this.inputEl.setSelectionRange(l, l);
5108
- const { left: f, top: d } = this.ctx.containerElement.getBoundingClientRect(), x = {
5109
- getBoundingClientRect: () => ({
5110
- width: 0,
5111
- height: 0,
5112
- top: d + r,
5113
- left: f + s,
5114
- right: f + s,
5115
- bottom: d + r,
5116
- x: s,
5117
- y: r
5118
- }),
5119
- contextElement: document.body
5120
- };
5121
- Nt(x, this.editorEl, {
5122
- placement: "right-start",
5123
- middleware: [Xt(), Ft(), kt()]
5124
- }).then(({ x: u, y: g }) => {
5125
- this.editorEl.style.left = `${u}px`, this.editorEl.style.top = `${g}px`;
5126
- }), this.inputEl.scrollHeight > o && this.autoSize();
5117
+ let f = this.ctx.body.visibleHeight;
5118
+ if (a > f && (a = f), this.editorEl.style.left = `${r}px`, this.editorEl.style.top = `${o}px`, this.editorEl.style.bottom = "auto", this.editorEl.style.maxHeight = `${f}px`, s === "text") {
5119
+ this.inputEl.style.display = "block", this.inputEl.style.minWidth = `${i - 1}px`, this.inputEl.style.minHeight = `${a - 1}px`, this.inputEl.style.maxHeight = `${f}px`, this.inputEl.style.width = `${i - 1}px`, this.inputEl.style.height = "auto", this.inputEl.style.padding = `${h}px`, e !== null && (this.inputEl.value = e), this.inputEl.focus();
5120
+ const d = this.inputEl.value.length;
5121
+ this.inputEl.setSelectionRange(d, d);
5122
+ } else
5123
+ this.inputEl.style.display = "none";
5124
+ (this.inputEl.scrollHeight > a || o < c.height) && this.autoSize();
5127
5125
  }
5128
5126
  doneEditByInput() {
5129
- if (!this.cellTarget || this.cellTarget.editorType !== "text")
5130
- return;
5131
- const { rowKey: t, key: e } = this.cellTarget, i = this.cellTarget.getValue(), s = this.inputEl.value;
5132
- s !== i && !(s === "" && i === null) && this.ctx.database.setItemValue(t, e, s, !0, !0, !0), this.inputEl.value = "", this.editorEl.style.left = "-10000px", this.editorEl.style.top = "-10000px";
5127
+ if (this.cellTarget && (this.editorEl.style.left = "-10000px", this.editorEl.style.top = "-10000px", this.editorEl.style.bottom = "atuo", this.cellTarget.editorType === "text")) {
5128
+ const { rowKey: t, key: e } = this.cellTarget, i = this.cellTarget.getValue(), s = this.inputEl.value;
5129
+ s !== i && !(s === "" && i === null) && this.ctx.database.setItemValue(t, e, s, !0, !0, !0), this.inputEl.value = "";
5130
+ }
5133
5131
  }
5134
5132
  startEdit() {
5135
5133
  const { ENABLE_EDIT_CLICK_SELECTOR: t } = this.ctx.config;
@@ -5142,10 +5140,10 @@ class qi {
5142
5140
  e && !r && (this.enable = !0, this.ctx.editing = !0, this.cellTarget = e, this.startEditByInput(this.cellTarget), this.ctx.emit("startEdit", this.cellTarget));
5143
5141
  }
5144
5142
  editCell(t, e) {
5145
- const i = this.ctx.body.renderRows.find((l) => l.rowIndex === t);
5143
+ const i = this.ctx.body.renderRows.find((c) => c.rowIndex === t);
5146
5144
  if (!i)
5147
5145
  return;
5148
- const s = i.cells.find((l) => l.colIndex === e);
5146
+ const s = i.cells.find((c) => c.colIndex === e);
5149
5147
  if (!s)
5150
5148
  return;
5151
5149
  this.ctx.emit("setSelectorCell", s);
@@ -5156,7 +5154,7 @@ class qi {
5156
5154
  r && !h && (this.enable = !0, this.ctx.editing = !0, this.cellTarget = r, this.startEditByInput(this.cellTarget), this.ctx.emit("startEdit", this.cellTarget));
5157
5155
  }
5158
5156
  doneEdit() {
5159
- this.enable && this.cellTarget && (this.ctx.emit("doneEdit", this.cellTarget), this.doneEditByInput(), this.enable = !1, this.ctx.stageElement.focus(), this.ctx.editing = !1, this.cellTarget = null, this.ctx.emit("draw"));
5157
+ this.enable && this.cellTarget && (this.doneEditByInput(), this.ctx.emit("doneEdit", this.cellTarget), this.enable = !1, this.ctx.stageElement.focus(), this.ctx.editing = !1, this.cellTarget = null, this.ctx.emit("draw"));
5160
5158
  }
5161
5159
  destroy() {
5162
5160
  var t;
@@ -5165,14 +5163,14 @@ class qi {
5165
5163
  }
5166
5164
  class Gi {
5167
5165
  constructor(t) {
5168
- c(this, "ctx");
5169
- c(this, "emptyEl");
5166
+ l(this, "ctx");
5167
+ l(this, "emptyEl");
5170
5168
  this.ctx = t;
5171
5169
  const { EMPTY_TEXT: e, EMPTY_CUSTOM: i, EMPTY_CUSTOM_STYLE: s, CSS_PREFIX: r } = this.ctx.config;
5172
- this.emptyEl = document.createElement("div"), this.emptyEl.className = `${r}-empty`, this.emptyEl.style.display = "none", this.emptyEl.innerText = e, this.ctx.containerElement.appendChild(this.emptyEl), this.ctx.on("emptyChange", ({ type: o, headerHeight: a, bodyHeight: h, footerHeight: l }) => {
5170
+ this.emptyEl = document.createElement("div"), this.emptyEl.className = `${r}-empty`, this.emptyEl.style.display = "none", this.emptyEl.innerText = e, this.ctx.containerElement.appendChild(this.emptyEl), this.ctx.on("emptyChange", ({ type: o, headerHeight: a, bodyHeight: h, footerHeight: c }) => {
5173
5171
  if (i)
5174
5172
  return;
5175
- const f = a + (h + l) / 2, d = {
5173
+ const f = a + (h + c) / 2, d = {
5176
5174
  display: o === "empty" ? "block" : "none",
5177
5175
  position: "absolute",
5178
5176
  fontSize: "14px",
@@ -5191,7 +5189,7 @@ class Gi {
5191
5189
  }
5192
5190
  class ji {
5193
5191
  constructor(t) {
5194
- c(this, "ctx");
5192
+ l(this, "ctx");
5195
5193
  this.ctx = t;
5196
5194
  }
5197
5195
  draw() {
@@ -5205,26 +5203,11 @@ class ji {
5205
5203
  });
5206
5204
  }
5207
5205
  getContainer() {
5208
- const {
5209
- stageWidth: t,
5210
- stageHeight: e,
5211
- config: { SCROLLER_TRACK_SIZE: i }
5212
- } = this.ctx, s = t - i, r = e - i, o = this.getHeader(), a = this.getBody(), h = this.getFooter();
5213
- let l = [o, a, h];
5214
- const { FOOTER_FIXED: f } = this.ctx.config;
5215
- return f || (l = [o, a]), {
5216
- style: {
5217
- position: "absolute",
5218
- left: "0px",
5219
- top: "0px",
5220
- userSelect: "none",
5221
- overflow: "hidden",
5222
- width: `${s}px`,
5223
- height: `${r}px`,
5224
- zIndex: 10
5225
- },
5226
- class: "e-virt-table-overlayer",
5227
- views: l
5206
+ const t = this.getHeader(), e = this.getBody(), i = this.getFooter();
5207
+ let s = [t, e, i];
5208
+ const { FOOTER_FIXED: r } = this.ctx.config;
5209
+ return r || (s = [t, e]), {
5210
+ views: s
5228
5211
  };
5229
5212
  }
5230
5213
  getHeader() {
@@ -5233,9 +5216,9 @@ class ji {
5233
5216
  fixedRightWidth: e,
5234
5217
  config: { SCROLLER_TRACK_SIZE: i, CSS_PREFIX: s }
5235
5218
  } = this.ctx, { visibleWidth: r, visibleHeight: o, renderCellHeaders: a } = this.ctx.header;
5236
- let h = [], l = [], f = [];
5219
+ let h = [], c = [], f = [];
5237
5220
  a.forEach((p) => {
5238
- p.render && (p.fixed === "left" ? l.push(p) : p.fixed === "right" ? f.push(p) : h.push(p));
5221
+ p.render && (p.fixed === "left" ? c.push(p) : p.fixed === "right" ? f.push(p) : h.push(p));
5239
5222
  });
5240
5223
  const d = e - i, x = {
5241
5224
  key: "left",
@@ -5247,7 +5230,7 @@ class ji {
5247
5230
  width: `${t}px`,
5248
5231
  height: `${o}px`
5249
5232
  },
5250
- cells: l
5233
+ cells: c
5251
5234
  }, u = {
5252
5235
  key: "center",
5253
5236
  style: {
@@ -5295,7 +5278,7 @@ class ji {
5295
5278
  fixedLeftWidth: r,
5296
5279
  fixedRightWidth: o,
5297
5280
  config: { SCROLLER_TRACK_SIZE: a, CSS_PREFIX: h }
5298
- } = this.ctx, { visibleWidth: l, visibleHeight: f } = this.ctx.body, d = o - a, x = {
5281
+ } = this.ctx, { visibleWidth: c, visibleHeight: f } = this.ctx.body, d = o - a, x = {
5299
5282
  key: "left",
5300
5283
  style: {
5301
5284
  position: "absolute",
@@ -5313,7 +5296,7 @@ class ji {
5313
5296
  top: `${0.5}px`,
5314
5297
  left: `${r - 0.5}px`,
5315
5298
  overflow: "hidden",
5316
- width: `${l - r - d}px`,
5299
+ width: `${c - r - d}px`,
5317
5300
  height: `${f}px`
5318
5301
  },
5319
5302
  cells: t
@@ -5335,7 +5318,7 @@ class ji {
5335
5318
  style: {
5336
5319
  position: "relative",
5337
5320
  overflow: "hidden",
5338
- width: `${l}px`,
5321
+ width: `${c}px`,
5339
5322
  height: `${f}px`
5340
5323
  },
5341
5324
  views: [x, u, g]
@@ -5352,7 +5335,7 @@ class ji {
5352
5335
  fixedLeftWidth: s,
5353
5336
  fixedRightWidth: r,
5354
5337
  config: { SCROLLER_TRACK_SIZE: o, CSS_PREFIX: a }
5355
- } = this.ctx, { visibleWidth: h, visibleHeight: l } = this.ctx.footer, f = r - o, d = {
5338
+ } = this.ctx, { visibleWidth: h, visibleHeight: c } = this.ctx.footer, f = r - o, d = {
5356
5339
  key: "left",
5357
5340
  style: {
5358
5341
  position: "absolute",
@@ -5360,7 +5343,7 @@ class ji {
5360
5343
  left: `${0.5}px`,
5361
5344
  overflow: "hidden",
5362
5345
  width: `${s}px`,
5363
- height: `${l}px`
5346
+ height: `${c}px`
5364
5347
  },
5365
5348
  cells: e
5366
5349
  }, x = {
@@ -5371,7 +5354,7 @@ class ji {
5371
5354
  left: `${s - 0.5}px`,
5372
5355
  overflow: "hidden",
5373
5356
  width: `${h - s - f}px`,
5374
- height: `${l}px`
5357
+ height: `${c}px`
5375
5358
  },
5376
5359
  cells: t
5377
5360
  }, u = {
@@ -5382,7 +5365,7 @@ class ji {
5382
5365
  right: `${0.5}px`,
5383
5366
  overflow: "hidden",
5384
5367
  width: `${f}px`,
5385
- height: `${l}px`
5368
+ height: `${c}px`
5386
5369
  },
5387
5370
  cells: i
5388
5371
  };
@@ -5393,7 +5376,7 @@ class ji {
5393
5376
  position: "relative",
5394
5377
  overflow: "hidden",
5395
5378
  width: `${h}px`,
5396
- height: `${l}px`
5379
+ height: `${c}px`
5397
5380
  },
5398
5381
  views: [d, x, u]
5399
5382
  };
@@ -5401,16 +5384,16 @@ class ji {
5401
5384
  }
5402
5385
  class Ui {
5403
5386
  constructor(t) {
5404
- c(this, "ctx");
5405
- c(this, "contextMenuEl");
5387
+ l(this, "ctx");
5388
+ l(this, "contextMenuEl");
5406
5389
  this.ctx = t, this.contextMenuEl = document.createElement("div"), this.createContextMenu(), this.init();
5407
5390
  }
5408
5391
  init() {
5409
5392
  this.ctx.on("cellContextMenuClick", (t, e) => {
5410
5393
  if (!this.ctx.config.ENABLE_CONTEXT_MENU) return;
5411
5394
  e.preventDefault();
5412
- const { xArr: i, yArr: s } = this.ctx.selector, [r, o] = i, [a, h] = s, { rowIndex: l, colIndex: f } = t;
5413
- l >= a && l <= h && f >= r && f <= o || this.ctx.emit("setSelectorCell", t, e);
5395
+ const { xArr: i, yArr: s } = this.ctx.selector, [r, o] = i, [a, h] = s, { rowIndex: c, colIndex: f } = t;
5396
+ c >= a && c <= h && f >= r && f <= o || this.ctx.emit("setSelectorCell", t, e);
5414
5397
  const x = {
5415
5398
  getBoundingClientRect: () => ({
5416
5399
  width: 0,
@@ -5424,9 +5407,9 @@ class Ui {
5424
5407
  }),
5425
5408
  contextElement: document.body
5426
5409
  };
5427
- Nt(x, this.contextMenuEl, {
5410
+ pe(x, this.contextMenuEl, {
5428
5411
  placement: "right-start",
5429
- middleware: [Xt(), Ft(), kt()]
5412
+ middleware: [ue(), ge(), we()]
5430
5413
  }).then(({ x: u, y: g }) => {
5431
5414
  this.show(u, g);
5432
5415
  });
@@ -5484,35 +5467,38 @@ class Ui {
5484
5467
  }
5485
5468
  class Qi {
5486
5469
  constructor(t, e) {
5487
- c(this, "options");
5488
- c(this, "scroller");
5489
- c(this, "header");
5490
- c(this, "body");
5491
- c(this, "footer");
5492
- c(this, "selector");
5493
- c(this, "autofill");
5494
- c(this, "tooltip");
5495
- c(this, "editor");
5496
- c(this, "empty");
5497
- c(this, "overlayer");
5498
- c(this, "contextMenu");
5499
- c(this, "ctx");
5470
+ l(this, "options");
5471
+ l(this, "scroller");
5472
+ l(this, "header");
5473
+ l(this, "body");
5474
+ l(this, "footer");
5475
+ l(this, "selector");
5476
+ l(this, "autofill");
5477
+ l(this, "tooltip");
5478
+ l(this, "editor");
5479
+ l(this, "empty");
5480
+ l(this, "overlayer");
5481
+ l(this, "contextMenu");
5482
+ l(this, "ctx");
5500
5483
  this.options = e;
5501
- const { overlayerElement: i } = e, s = this.createContainer(t, i);
5502
- this.ctx = new hi(s, this.options), this.header = new di(this.ctx), this.body = new fi(this.ctx), this.footer = new xi(this.ctx), this.scroller = new li(this.ctx), this.selector = new ui(this.ctx), this.autofill = new gi(this.ctx), this.tooltip = new $i(this.ctx), this.empty = new Gi(this.ctx), this.editor = new qi(this.ctx), this.overlayer = new ji(this.ctx), this.contextMenu = new Ui(this.ctx), this.ctx.on("draw", () => {
5484
+ const { overlayerElement: i, editorElement: s } = e, r = this.createContainer(t, i, s);
5485
+ this.ctx = new hi(r, this.options), this.header = new di(this.ctx), this.body = new fi(this.ctx), this.footer = new xi(this.ctx), this.scroller = new ci(this.ctx), this.selector = new ui(this.ctx), this.autofill = new gi(this.ctx), this.tooltip = new $i(this.ctx), this.empty = new Gi(this.ctx), this.editor = new qi(this.ctx), this.overlayer = new ji(this.ctx), this.contextMenu = new Ui(this.ctx), this.ctx.on("draw", () => {
5503
5486
  this.draw();
5504
5487
  }), this.ctx.on("drawView", () => {
5505
5488
  this.draw(!0);
5506
5489
  }), this.draw();
5507
5490
  }
5508
- createContainer(t, e) {
5491
+ createContainer(t, e, i) {
5509
5492
  t.className = "e-virt-table-container";
5510
- const i = document.createElement("div"), s = document.createElement("canvas"), r = e || document.createElement("div");
5511
- return i.className = "e-virt-table-stage", s.className = "e-virt-table-canvas", r.className = "e-virt-table-overlayer", i.appendChild(s), i.appendChild(r), t.appendChild(i), {
5493
+ const s = document.createElement("div"), r = document.createElement("canvas"), o = e || document.createElement("div");
5494
+ s.className = "e-virt-table-stage", r.className = "e-virt-table-canvas", o.className = "e-virt-table-overlayer";
5495
+ const a = i || document.createElement("div");
5496
+ return a.className = "e-virt-table-editor", s.appendChild(r), s.appendChild(o), t.appendChild(s), {
5512
5497
  containerElement: t,
5513
- stageElement: i,
5514
- canvasElement: s,
5515
- overlayerElement: r
5498
+ stageElement: s,
5499
+ canvasElement: r,
5500
+ overlayerElement: o,
5501
+ editorElement: a
5516
5502
  };
5517
5503
  }
5518
5504
  draw(t = !1) {