e-virt-table 0.1.0 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (51) hide show
  1. package/dist/index.cjs.js +5 -5
  2. package/dist/index.cjs.js.map +1 -1
  3. package/dist/index.es.js +988 -965
  4. package/dist/index.es.js.map +1 -1
  5. package/dist/index.umd.js +5 -5
  6. package/dist/index.umd.js.map +1 -1
  7. package/dist/lib/Autofill.js +4 -4
  8. package/dist/lib/Autofill.js.map +1 -1
  9. package/dist/lib/BaseCell.d.ts +2 -2
  10. package/dist/lib/BaseCell.js +11 -11
  11. package/dist/lib/BaseCell.js.map +1 -1
  12. package/dist/lib/Body.js +25 -18
  13. package/dist/lib/Body.js.map +1 -1
  14. package/dist/lib/Cell.js +8 -4
  15. package/dist/lib/Cell.js.map +1 -1
  16. package/dist/lib/CellHeader.js +3 -3
  17. package/dist/lib/CellHeader.js.map +1 -1
  18. package/dist/lib/Context.d.ts +13 -4
  19. package/dist/lib/Context.js +34 -11
  20. package/dist/lib/Context.js.map +1 -1
  21. package/dist/lib/ContextMenu.js +1 -1
  22. package/dist/lib/ContextMenu.js.map +1 -1
  23. package/dist/lib/EVirtTable.d.ts +1 -2
  24. package/dist/lib/EVirtTable.js +22 -18
  25. package/dist/lib/EVirtTable.js.map +1 -1
  26. package/dist/lib/Editor.js +4 -14
  27. package/dist/lib/Editor.js.map +1 -1
  28. package/dist/lib/Empty.js +1 -1
  29. package/dist/lib/Empty.js.map +1 -1
  30. package/dist/lib/EventBrowser.d.ts +1 -3
  31. package/dist/lib/EventBrowser.js +7 -7
  32. package/dist/lib/EventBrowser.js.map +1 -1
  33. package/dist/lib/EventTable.js +10 -12
  34. package/dist/lib/EventTable.js.map +1 -1
  35. package/dist/lib/Footer.js +4 -4
  36. package/dist/lib/Footer.js.map +1 -1
  37. package/dist/lib/Header.js +17 -14
  38. package/dist/lib/Header.js.map +1 -1
  39. package/dist/lib/Overlayer.js +5 -5
  40. package/dist/lib/Overlayer.js.map +1 -1
  41. package/dist/lib/Paint.d.ts +1 -0
  42. package/dist/lib/Paint.js +7 -4
  43. package/dist/lib/Paint.js.map +1 -1
  44. package/dist/lib/Scroller.js +8 -8
  45. package/dist/lib/Scroller.js.map +1 -1
  46. package/dist/lib/Selector.js +6 -6
  47. package/dist/lib/Selector.js.map +1 -1
  48. package/dist/lib/Tooltip.js +3 -3
  49. package/dist/lib/Tooltip.js.map +1 -1
  50. package/dist/lib/types.d.ts +1 -0
  51. package/package.json +2 -2
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-container{position:relative;outline:none}.e-virt-table-canvas{position:relative;outline:none;z-index:2}.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}.e-virt-table-context-menu-item:hover{color:var(--e-virt-table-color-primary);background-color:#f5f7fa}')),document.head.appendChild(e)}}catch(t){console.error("vite-plugin-css-injected-by-js",t)}})();
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)}})();
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 h = (n, t, e) => Ee(n, typeof t != "symbol" ? t + "" : t, e);
4
+ var c = (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++) {
@@ -12,7 +12,7 @@ function $() {
12
12
  return n;
13
13
  }, $.apply(this, arguments);
14
14
  }
15
- function Ce(n, t) {
15
+ function be(n, t) {
16
16
  n.prototype = Object.create(t.prototype), n.prototype.constructor = n, st(n, t);
17
17
  }
18
18
  function Et(n) {
@@ -25,7 +25,7 @@ function st(n, t) {
25
25
  return i.__proto__ = s, i;
26
26
  }, st(n, t);
27
27
  }
28
- function be() {
28
+ function Ce() {
29
29
  if (typeof Reflect > "u" || !Reflect.construct || Reflect.construct.sham) return !1;
30
30
  if (typeof Proxy == "function") return !0;
31
31
  try {
@@ -36,19 +36,19 @@ function be() {
36
36
  }
37
37
  }
38
38
  function dt(n, t, e) {
39
- return be() ? dt = Reflect.construct.bind() : dt = function(s, r, o) {
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 c = Function.bind.apply(s, a), l = new c();
42
+ var h = Function.bind.apply(s, a), l = new h();
43
43
  return o && st(l, o.prototype), l;
44
44
  }, dt.apply(null, arguments);
45
45
  }
46
46
  function ve(n) {
47
47
  return Function.toString.call(n).indexOf("[native code]") !== -1;
48
48
  }
49
- function Ct(n) {
49
+ function bt(n) {
50
50
  var t = typeof Map == "function" ? /* @__PURE__ */ new Map() : void 0;
51
- return Ct = function(i) {
51
+ return bt = function(i) {
52
52
  if (i === null || !ve(i)) return i;
53
53
  if (typeof i != "function")
54
54
  throw new TypeError("Super expression must either be null or a function");
@@ -67,7 +67,7 @@ function Ct(n) {
67
67
  configurable: !0
68
68
  }
69
69
  }), st(s, i);
70
- }, Ct(n);
70
+ }, bt(n);
71
71
  }
72
72
  var Re = /%[sdj%]/g, Gt = function() {
73
73
  };
@@ -76,7 +76,7 @@ typeof process < "u" && process.env && process.env.NODE_ENV !== "production" &&
76
76
  return typeof i == "string";
77
77
  }) && console.warn(t, e);
78
78
  });
79
- function bt(n) {
79
+ function Ct(n) {
80
80
  if (!n || !n.length) return null;
81
81
  var t = {};
82
82
  return n.forEach(function(e) {
@@ -150,33 +150,33 @@ function Oe(n) {
150
150
  }), t;
151
151
  }
152
152
  var Ft = /* @__PURE__ */ function(n) {
153
- Ce(t, n);
153
+ be(t, n);
154
154
  function t(e, i) {
155
155
  var s;
156
156
  return s = n.call(this, "Async Validation Error") || this, s.errors = e, s.fields = i, s;
157
157
  }
158
158
  return t;
159
- }(/* @__PURE__ */ Ct(Error));
159
+ }(/* @__PURE__ */ bt(Error));
160
160
  function Te(n, t, e, i, s) {
161
161
  if (t.first) {
162
162
  var r = new Promise(function(x, u) {
163
- var p = function(y) {
164
- return i(y), y.length ? u(new Ft(y, bt(y))) : x(s);
165
- }, g = Oe(n);
166
- Xt(g, e, p);
163
+ var g = function(y) {
164
+ return i(y), y.length ? u(new Ft(y, Ct(y))) : x(s);
165
+ }, w = Oe(n);
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), c = a.length, l = 0, f = [], d = new Promise(function(x, u) {
173
- var p = function(w) {
174
- if (f.push.apply(f, w), l++, l === c)
175
- return i(f), f.length ? u(new Ft(f, bt(f))) : x(s);
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) {
173
+ var g = function(p) {
174
+ if (f.push.apply(f, p), l++, l === h)
175
+ return i(f), f.length ? u(new Ft(f, Ct(f))) : x(s);
176
176
  };
177
- a.length || (i(f), x(s)), a.forEach(function(g) {
178
- var w = n[g];
179
- o.indexOf(g) !== -1 ? Xt(w, e, p) : Ie(w, e, p);
177
+ a.length || (i(f), x(s)), a.forEach(function(w) {
178
+ var p = n[w];
179
+ o.indexOf(w) !== -1 ? Xt(p, e, g) : Ie(p, e, g);
180
180
  });
181
181
  });
182
182
  return d.catch(function(x) {
@@ -234,16 +234,16 @@ var jt = function(t, e, i, s, r, o) {
234
234
  (?:` + i + ":){1}(?:(?::" + i + "){0,4}:" + e + "|(?::" + i + `){1,6}|:)| // 1:: 1::3:4:5:6:7:8 1::8 1::3:4:5:6:7:1.2.3.4
235
235
  (?::(?:(?::` + i + "){0,5}:" + e + "|(?::" + i + `){1,7}|:)) // ::2:3:4:5:6:7:8 ::2:3:4:5:6:7:8 ::8 ::1.2.3.4
236
236
  )(?:%[0-9a-zA-Z]{1,})? // %eth0 %1
237
- `).replace(/\s*\/\/.*$/gm, "").replace(/\n/g, "").trim(), r = new RegExp("(?:^" + e + "$)|(?:^" + s + "$)"), o = new RegExp("^" + e + "$"), a = new RegExp("^" + s + "$"), c = function(E) {
237
+ `).replace(/\s*\/\/.*$/gm, "").replace(/\n/g, "").trim(), r = new RegExp("(?:^" + e + "$)|(?:^" + s + "$)"), o = new RegExp("^" + e + "$"), a = new RegExp("^" + s + "$"), h = function(E) {
238
238
  return E && E.exact ? r : new RegExp("(?:" + t(E) + e + t(E) + ")|(?:" + t(E) + s + t(E) + ")", "g");
239
239
  };
240
- c.v4 = function(m) {
240
+ h.v4 = function(m) {
241
241
  return m && m.exact ? o : new RegExp("" + t(m) + e + t(m), "g");
242
- }, c.v6 = function(m) {
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 = c.v4().source, x = c.v6().source, u = "(?:(?:[a-z\\u00a1-\\uffff0-9][-_]*)*[a-z\\u00a1-\\uffff0-9]+)", p = "(?:\\.(?:[a-z\\u00a1-\\uffff0-9]-*)*[a-z\\u00a1-\\uffff0-9]+)*", g = "(?:\\.(?:[a-z\\u00a1-\\uffff]{2,}))", w = "(?::\\d{2,5})?", y = '(?:[/?#][^\\s"]*)?', C = "(?:" + l + "|www\\.)" + f + "(?:localhost|" + d + "|" + x + "|" + u + p + g + ")" + w + y;
246
- return lt = new RegExp("(?:^" + C + "$)", "i"), lt;
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
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,}))$/,
@@ -300,10 +300,10 @@ var jt = function(t, e, i, s, r, o) {
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", c = typeof t.max == "number", l = /[\uD800-\uDBFF][\uDC00-\uDFFF]/g, f = e, d = null, x = typeof e == "number", u = typeof e == "string", p = Array.isArray(e);
304
- if (x ? d = "number" : u ? d = "string" : p && (d = "array"), !d)
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);
304
+ if (x ? d = "number" : u ? d = "string" : g && (d = "array"), !d)
305
305
  return !1;
306
- p && (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 && !c && f < t.min ? s.push(M(r.messages[d].min, t.fullField, t.min)) : c && !a && f > t.max ? s.push(M(r.messages[d].max, t.fullField, t.max)) : a && c && (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(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));
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) {
@@ -416,8 +416,8 @@ var jt = function(t, e, i, s, r, o) {
416
416
  if (_(e, "date") && !t.required)
417
417
  return i();
418
418
  if (v.required(t, e, s, o, r), !_(e, "date")) {
419
- var c;
420
- e instanceof Date ? c = e : c = new Date(e), v.type(t, c, s, o, r), c && v.range(t, c.getTime(), s, o, r);
419
+ var h;
420
+ e instanceof Date ? h = e : h = new Date(e), v.type(t, h, s, o, r), h && v.range(t, h.getTime(), s, o, r);
421
421
  }
422
422
  }
423
423
  i(o);
@@ -425,8 +425,8 @@ var jt = function(t, e, i, s, r, o) {
425
425
  var o = [], a = Array.isArray(e) ? "array" : typeof e;
426
426
  v.required(t, e, s, o, r, a), i(o);
427
427
  }, yt = function(t, e, i, s, r) {
428
- var o = t.type, a = [], c = t.required || !t.required && s.hasOwnProperty(t.field);
429
- if (c) {
428
+ var o = t.type, a = [], h = t.required || !t.required && s.hasOwnProperty(t.field);
429
+ if (h) {
430
430
  if (_(e, o) && !t.required)
431
431
  return i();
432
432
  v.required(t, e, s, a, r, o), _(e, o) || v.type(t, e, s, a, r);
@@ -533,100 +533,100 @@ var Rt = vt(), nt = /* @__PURE__ */ function() {
533
533
  var o = this;
534
534
  s === void 0 && (s = {}), r === void 0 && (r = function() {
535
535
  });
536
- var a = i, c = s, l = r;
537
- if (typeof c == "function" && (l = c, c = {}), !this.rules || Object.keys(this.rules).length === 0)
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
538
  return l && l(null, a), Promise.resolve(a);
539
- function f(g) {
540
- var w = [], y = {};
541
- function C(E) {
539
+ function f(w) {
540
+ var p = [], y = {};
541
+ function b(E) {
542
542
  if (Array.isArray(E)) {
543
- var b;
544
- w = (b = w).concat.apply(b, E);
543
+ var C;
544
+ p = (C = p).concat.apply(C, E);
545
545
  } else
546
- w.push(E);
546
+ p.push(E);
547
547
  }
548
- for (var m = 0; m < g.length; m++)
549
- C(g[m]);
550
- w.length ? (y = bt(w), l(w, y)) : l(null, a);
548
+ for (var m = 0; m < w.length; m++)
549
+ b(w[m]);
550
+ p.length ? (y = Ct(p), l(p, y)) : l(null, a);
551
551
  }
552
- if (c.messages) {
552
+ if (h.messages) {
553
553
  var d = this.messages();
554
- d === Rt && (d = vt()), Nt(d, c.messages), c.messages = d;
554
+ d === Rt && (d = vt()), Nt(d, h.messages), h.messages = d;
555
555
  } else
556
- c.messages = this.messages();
557
- var x = {}, u = c.keys || Object.keys(this.rules);
558
- u.forEach(function(g) {
559
- var w = o.rules[g], y = a[g];
560
- w.forEach(function(C) {
561
- var m = C;
562
- typeof m.transform == "function" && (a === i && (a = $({}, a)), y = a[g] = m.transform(y)), typeof m == "function" ? m = {
556
+ h.messages = this.messages();
557
+ var x = {}, u = h.keys || Object.keys(this.rules);
558
+ u.forEach(function(w) {
559
+ var p = o.rules[w], y = a[w];
560
+ p.forEach(function(b) {
561
+ var m = b;
562
+ typeof m.transform == "function" && (a === i && (a = $({}, a)), y = a[w] = m.transform(y)), typeof m == "function" ? m = {
563
563
  validator: m
564
- } : m = $({}, m), m.validator = o.getValidationMethod(m), m.validator && (m.field = g, m.fullField = m.fullField || g, m.type = o.getType(m), x[g] = x[g] || [], x[g].push({
564
+ } : m = $({}, m), m.validator = o.getValidationMethod(m), m.validator && (m.field = w, m.fullField = m.fullField || w, m.type = o.getType(m), x[w] = x[w] || [], x[w].push({
565
565
  rule: m,
566
566
  value: y,
567
567
  source: a,
568
- field: g
568
+ field: w
569
569
  }));
570
570
  });
571
571
  });
572
- var p = {};
573
- return Te(x, c, function(g, w) {
574
- var y = g.rule, C = (y.type === "object" || y.type === "array") && (typeof y.fields == "object" || typeof y.defaultField == "object");
575
- C = C && (y.required || !y.required && g.value), y.field = g.field;
576
- function m(R, S) {
577
- return $({}, S, {
572
+ var g = {};
573
+ return Te(x, h, function(w, p) {
574
+ var y = w.rule, b = (y.type === "object" || y.type === "array") && (typeof y.fields == "object" || typeof y.defaultField == "object");
575
+ b = b && (y.required || !y.required && w.value), y.field = w.field;
576
+ function m(R, T) {
577
+ return $({}, T, {
578
578
  fullField: y.fullField + "." + R,
579
579
  fullFields: y.fullFields ? [].concat(y.fullFields, [R]) : [R]
580
580
  });
581
581
  }
582
582
  function E(R) {
583
583
  R === void 0 && (R = []);
584
- var S = Array.isArray(R) ? R : [R];
585
- !c.suppressWarning && S.length && n.warning("async-validator:", S), S.length && y.message !== void 0 && (S = [].concat(y.message));
586
- var A = S.map(kt(y, a));
587
- if (c.first && A.length)
588
- return p[y.field] = 1, w(A);
589
- if (!C)
590
- w(A);
584
+ var T = Array.isArray(R) ? R : [R];
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(kt(y, a));
587
+ if (h.first && A.length)
588
+ return g[y.field] = 1, p(A);
589
+ if (!b)
590
+ p(A);
591
591
  else {
592
- if (y.required && !g.value)
593
- return y.message !== void 0 ? A = [].concat(y.message).map(kt(y, a)) : c.error && (A = [c.error(y, M(c.messages.required, y.field))]), w(A);
592
+ if (y.required && !w.value)
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
- y.defaultField && Object.keys(g.value).map(function(I) {
595
+ y.defaultField && Object.keys(w.value).map(function(I) {
596
596
  L[I] = y.defaultField;
597
- }), L = $({}, L, g.rule.fields);
597
+ }), L = $({}, L, w.rule.fields);
598
598
  var D = {};
599
599
  Object.keys(L).forEach(function(I) {
600
- var T = L[I], O = Array.isArray(T) ? T : [T];
600
+ var S = L[I], O = Array.isArray(S) ? S : [S];
601
601
  D[I] = O.map(m.bind(null, I));
602
602
  });
603
603
  var B = new n(D);
604
- B.messages(c.messages), g.rule.options && (g.rule.options.messages = c.messages, g.rule.options.error = c.error), B.validate(g.value, g.rule.options || c, function(I) {
605
- var T = [];
606
- A && A.length && T.push.apply(T, A), I && I.length && T.push.apply(T, I), w(T.length ? T : null);
604
+ B.messages(h.messages), w.rule.options && (w.rule.options.messages = h.messages, w.rule.options.error = h.error), B.validate(w.value, w.rule.options || h, function(I) {
605
+ var S = [];
606
+ A && A.length && S.push.apply(S, A), I && I.length && S.push.apply(S, I), p(S.length ? S : null);
607
607
  });
608
608
  }
609
609
  }
610
- var b;
610
+ var C;
611
611
  if (y.asyncValidator)
612
- b = y.asyncValidator(y, g.value, E, g.source, c);
612
+ C = y.asyncValidator(y, w.value, E, w.source, h);
613
613
  else if (y.validator) {
614
614
  try {
615
- b = y.validator(y, g.value, E, g.source, c);
615
+ C = y.validator(y, w.value, E, w.source, h);
616
616
  } catch (R) {
617
- console.error == null || console.error(R), c.suppressValidatorError || setTimeout(function() {
617
+ console.error == null || console.error(R), h.suppressValidatorError || setTimeout(function() {
618
618
  throw R;
619
619
  }, 0), E(R.message);
620
620
  }
621
- b === !0 ? E() : b === !1 ? E(typeof y.message == "function" ? y.message(y.fullField || y.field) : y.message || (y.fullField || y.field) + " fails") : b instanceof Array ? E(b) : b instanceof Error && E(b.message);
621
+ C === !0 ? E() : C === !1 ? E(typeof y.message == "function" ? y.message(y.fullField || y.field) : y.message || (y.fullField || y.field) + " fails") : C instanceof Array ? E(C) : C instanceof Error && E(C.message);
622
622
  }
623
- b && b.then && b.then(function() {
623
+ C && C.then && C.then(function() {
624
624
  return E();
625
625
  }, function(R) {
626
626
  return E(R);
627
627
  });
628
- }, function(g) {
629
- f(g);
628
+ }, function(w) {
629
+ f(w);
630
630
  }, a);
631
631
  }, t.getType = function(i) {
632
632
  if (i.type === void 0 && i.pattern instanceof RegExp && (i.type = "pattern"), typeof i.validator != "function" && i.type && !it.hasOwnProperty(i.type))
@@ -724,10 +724,10 @@ function ti(n) {
724
724
  if (n.startsWith('"')) {
725
725
  let o = 0, a = !0;
726
726
  for (; a; ) {
727
- const c = n.slice(0, 1);
728
- c === '"' && (o += 1), r += c, n = n.slice(1), (n.length === 0 || n.match(/^[\t\r\n]/) && o % 2 === 0) && (a = !1);
727
+ const h = n.slice(0, 1);
728
+ h === '"' && (o += 1), r += h, n = n.slice(1), (n.length === 0 || n.match(/^[\t\r\n]/) && o % 2 === 0) && (a = !1);
729
729
  }
730
- r = r.replace(/^"/, "").replace(/"$/, "").replace(/["]*/g, (c) => new Array(Math.floor(c.length / 2)).fill('"').join(""));
730
+ r = r.replace(/^"/, "").replace(/"$/, "").replace(/["]*/g, (h) => new Array(Math.floor(h.length / 2)).fill('"').join(""));
731
731
  } else {
732
732
  const o = n.match(Qe);
733
733
  r = o ? o[0] : "", n = n.slice(r.length);
@@ -750,24 +750,24 @@ function ei(n) {
750
750
  class ii {
751
751
  //虚拟滚动位置
752
752
  constructor(t, e) {
753
- h(this, "loading", !1);
754
- h(this, "ctx");
755
- h(this, "data");
756
- h(this, "columns");
757
- h(this, "footerData", []);
758
- h(this, "rowKeyMap", /* @__PURE__ */ new Map());
759
- h(this, "colIndexKeyMap", /* @__PURE__ */ new Map());
760
- h(this, "headerMap", /* @__PURE__ */ new Map());
761
- h(this, "rowIndexRowKeyMap", /* @__PURE__ */ new Map());
762
- h(this, "checkboxKeyMap", /* @__PURE__ */ new Map());
763
- h(this, "originalDataMap", /* @__PURE__ */ new Map());
764
- h(this, "changedDataMap", /* @__PURE__ */ new Map());
765
- h(this, "validationErrorMap", /* @__PURE__ */ new Map());
766
- h(this, "itemRowKeyMap", /* @__PURE__ */ new WeakMap());
767
- h(this, "bufferData", []);
768
- h(this, "sumHeight", 0);
769
- h(this, "filterMethod");
770
- h(this, "positions", []);
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", []);
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,26 +790,26 @@ 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: c, SELECTABLE_METHOD: l, CHECKBOX_KEY: f } = this.ctx.config, d = i[o], x = d ?? Ut();
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 ?? Ut();
794
794
  this.itemRowKeyMap.set(i, x);
795
- const u = i._height || c, p = i._readonly;
796
- let g = !0;
797
- if (typeof l == "function" && (g = l), f) {
798
- const w = i[f];
799
- if (this.checkboxKeyMap.has(w)) {
800
- const y = this.checkboxKeyMap.get(w);
801
- y.push(x), this.checkboxKeyMap.set(w, y);
795
+ const u = i._height || h, g = i._readonly;
796
+ let w = !0;
797
+ if (typeof l == "function" && (w = l), f) {
798
+ const p = i[f];
799
+ if (this.checkboxKeyMap.has(p)) {
800
+ const y = this.checkboxKeyMap.get(p);
801
+ y.push(x), this.checkboxKeyMap.set(p, y);
802
802
  } else
803
- this.checkboxKeyMap.set(w, [x]);
803
+ this.checkboxKeyMap.set(p, [x]);
804
804
  }
805
805
  this.rowKeyMap.set(x, {
806
- readonly: p,
806
+ readonly: g,
807
807
  index: s,
808
808
  rowIndex: s,
809
809
  level: e,
810
810
  height: u,
811
811
  check: !1,
812
- selectable: g,
812
+ selectable: w,
813
813
  expand: a,
814
814
  expandLazy: !1,
815
815
  hasChildren: r,
@@ -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: c, hasChildren: l, height: f } = this.rowKeyMap.get(a), d = this.sumHeight;
877
+ const a = this.itemRowKeyMap.get(o), { expand: h, hasChildren: l, 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, c && l && i(o.children);
882
+ }), e += 1, h && l && i(o.children);
883
883
  });
884
884
  };
885
885
  this.rowIndexRowKeyMap.clear();
@@ -1002,7 +1002,7 @@ class ii {
1002
1002
  let i = [];
1003
1003
  const s = /* @__PURE__ */ new Set();
1004
1004
  t.forEach((a) => {
1005
- const { value: c, rowKey: l, key: f } = a, { oldValue: d, newValue: x } = this.setItemValue(l, f, c);
1005
+ const { value: h, rowKey: l, key: f } = a, { oldValue: d, newValue: x } = this.setItemValue(l, f, h);
1006
1006
  s.add(l), i.push({
1007
1007
  rowKey: l,
1008
1008
  key: f,
@@ -1012,12 +1012,12 @@ class ii {
1012
1012
  });
1013
1013
  let r = [];
1014
1014
  const o = i.map((a) => {
1015
- const c = this.ctx.database.getRowDataItemForRowKey(a.rowKey);
1015
+ const h = this.ctx.database.getRowDataItemForRowKey(a.rowKey);
1016
1016
  return {
1017
1017
  rowKey: a.rowKey,
1018
1018
  key: a.key,
1019
1019
  value: a.newValue,
1020
- row: c
1020
+ row: h
1021
1021
  };
1022
1022
  });
1023
1023
  return s.forEach((a) => {
@@ -1043,15 +1043,15 @@ class ii {
1043
1043
  if (!this.rowKeyMap.has(t))
1044
1044
  return {};
1045
1045
  const { item: a } = this.rowKeyMap.get(t);
1046
- let c = a[e];
1046
+ let h = a[e];
1047
1047
  if (this.ctx.database.getReadonly(t, e))
1048
1048
  return {
1049
- oldValue: c,
1050
- newValue: c
1049
+ oldValue: h,
1050
+ newValue: h
1051
1051
  };
1052
- a[e] !== null && typeof a[e] == "object" && (c = JSON.parse(JSON.stringify(a[e])));
1052
+ a[e] !== null && typeof a[e] == "object" && (h = JSON.parse(JSON.stringify(a[e])));
1053
1053
  const l = `${t}_${e}`;
1054
- if (this.originalDataMap.has(l) || this.originalDataMap.set(l, c), this.changedDataMap.set(l, i), a[e] = i, o) {
1054
+ if (this.originalDataMap.has(l) || this.originalDataMap.set(l, h), this.changedDataMap.set(l, i), a[e] = i, o) {
1055
1055
  const f = this.ctx.database.getRowDataItemForRowKey(t), d = {
1056
1056
  rowKey: t,
1057
1057
  key: e,
@@ -1061,7 +1061,7 @@ class ii {
1061
1061
  this.ctx.emit("change", [d], [f]), this.ctx.emit("editChange", {
1062
1062
  rowKey: t,
1063
1063
  key: e,
1064
- oldValue: c,
1064
+ oldValue: h,
1065
1065
  value: i,
1066
1066
  originalValue: this.originalDataMap.get(l),
1067
1067
  row: f
@@ -1070,7 +1070,7 @@ class ii {
1070
1070
  return this.ctx.hasEvent("iterationChange") && this.ctx.emit("iterationChange", {
1071
1071
  rowKey: t,
1072
1072
  key: e,
1073
- oldValue: c,
1073
+ oldValue: h,
1074
1074
  value: i,
1075
1075
  originalValue: this.originalDataMap.get(l),
1076
1076
  row: this.ctx.database.getRowDataItemForRowKey(t)
@@ -1082,12 +1082,12 @@ class ii {
1082
1082
  {
1083
1083
  rowKey: t,
1084
1084
  key: e,
1085
- oldValue: c,
1085
+ oldValue: h,
1086
1086
  newValue: i
1087
1087
  }
1088
1088
  ]
1089
1089
  }), r && this.ctx.emit("draw"), {
1090
- oldValue: c,
1090
+ oldValue: h,
1091
1091
  newValue: i
1092
1092
  };
1093
1093
  }
@@ -1114,8 +1114,8 @@ class ii {
1114
1114
  return !1;
1115
1115
  const { item: s } = this.rowKeyMap.get(t), r = s[i];
1116
1116
  this.checkboxKeyMap.has(r) && this.checkboxKeyMap.get(r).forEach((a) => {
1117
- const c = this.rowKeyMap.get(a);
1118
- c.check = e;
1117
+ const h = this.rowKeyMap.get(a);
1118
+ h.check = e;
1119
1119
  });
1120
1120
  }
1121
1121
  }
@@ -1295,7 +1295,7 @@ class ii {
1295
1295
  getValidator(t, e) {
1296
1296
  return new Promise((i) => {
1297
1297
  const s = this.rowKeyMap.get(t), r = this.headerMap.get(e), { CELL_RULES_METHOD: o } = this.ctx.config, a = r.column;
1298
- let c = a.rules;
1298
+ let h = a.rules;
1299
1299
  if (typeof o == "function") {
1300
1300
  const f = o({
1301
1301
  row: s.item,
@@ -1304,12 +1304,12 @@ class ii {
1304
1304
  column: a,
1305
1305
  value: this.getItemValue(t, e)
1306
1306
  });
1307
- f && (c = f);
1307
+ f && (h = f);
1308
1308
  }
1309
- if (c) {
1309
+ if (h) {
1310
1310
  let l = {}, f = {};
1311
- if (f[e] = this.getItemValue(t, e), Array.isArray(c) && c.length) {
1312
- const x = c.map((u) => ({
1311
+ if (f[e] = this.getItemValue(t, e), Array.isArray(h) && h.length) {
1312
+ const x = h.map((u) => ({
1313
1313
  ...u,
1314
1314
  row: s.item,
1315
1315
  column: a,
@@ -1319,7 +1319,7 @@ class ii {
1319
1319
  l[e] = x;
1320
1320
  } else
1321
1321
  l[e] = {
1322
- ...c,
1322
+ ...h,
1323
1323
  row: s.item,
1324
1324
  column: a,
1325
1325
  rowIndex: s.rowIndex,
@@ -1328,8 +1328,8 @@ class ii {
1328
1328
  new nt(l).validate(f).then(() => {
1329
1329
  this.setValidationError(t, e, []), i([]);
1330
1330
  }).catch(({ errors: x }) => {
1331
- const u = x.map((p) => ({
1332
- ...p,
1331
+ const u = x.map((g) => ({
1332
+ ...g,
1333
1333
  column: a,
1334
1334
  key: e,
1335
1335
  row: s.item,
@@ -1374,9 +1374,9 @@ class ii {
1374
1374
  }
1375
1375
  class si {
1376
1376
  constructor(t) {
1377
- h(this, "ctx");
1378
- h(this, "history", []);
1379
- h(this, "historyIndex", -1);
1377
+ c(this, "ctx");
1378
+ c(this, "history", []);
1379
+ c(this, "historyIndex", -1);
1380
1380
  this.ctx = t, this.init();
1381
1381
  }
1382
1382
  init() {
@@ -1431,12 +1431,12 @@ class si {
1431
1431
  }
1432
1432
  class ri {
1433
1433
  constructor(t) {
1434
- h(this, "eventTasks", /* @__PURE__ */ new Map());
1435
- h(this, "ctx");
1434
+ c(this, "eventTasks", /* @__PURE__ */ new Map());
1435
+ c(this, "ctx");
1436
1436
  this.ctx = t, this.init();
1437
1437
  }
1438
1438
  init() {
1439
- this.bind(window, "resize", this.handleResize.bind(this)), this.bind(window, "mouseup", this.handleMouseUp.bind(this)), this.bind(window, "mousemove", this.handleMousemove.bind(this)), this.bind(this.ctx.targetContainer, "click", this.handleClick.bind(this)), this.bind(window, "keydown", this.handleKeydown.bind(this)), this.bind(this.ctx.targetContainer, "wheel", this.handleWheel.bind(this)), this.bind(this.ctx.targetContainer, "contextmenu", this.handleContextMenu.bind(this)), this.bind(this.ctx.targetContainer, "mousedown", this.handleMouseDown.bind(this)), this.bind(this.ctx.targetContainer, "mouseenter", this.handleMouseEnter.bind(this)), this.bind(this.ctx.targetContainer, "mouseleave", this.handleMouseLeave.bind(this)), this.bind(this.ctx.targetContainer, "dblclick", this.handleDblclick.bind(this));
1439
+ this.bind(window, "resize", this.handleResize.bind(this)), this.bind(window, "mouseup", this.handleMouseUp.bind(this)), this.bind(window, "mousemove", this.handleMousemove.bind(this)), this.bind(this.ctx.stageElement, "click", this.handleClick.bind(this)), this.bind(window, "keydown", this.handleKeydown.bind(this)), this.bind(this.ctx.stageElement, "wheel", this.handleWheel.bind(this)), this.bind(this.ctx.stageElement, "contextmenu", this.handleContextMenu.bind(this)), this.bind(this.ctx.stageElement, "mousedown", this.handleMouseDown.bind(this)), this.bind(this.ctx.stageElement, "mouseenter", this.handleMouseEnter.bind(this)), this.bind(this.ctx.stageElement, "mouseleave", this.handleMouseLeave.bind(this)), this.bind(this.ctx.stageElement, "dblclick", this.handleDblclick.bind(this));
1440
1440
  }
1441
1441
  destroy() {
1442
1442
  this.eventTasks.forEach((t, e) => {
@@ -1486,7 +1486,7 @@ class ri {
1486
1486
  }
1487
1487
  class oi {
1488
1488
  constructor() {
1489
- h(this, "events", /* @__PURE__ */ new Map());
1489
+ c(this, "events", /* @__PURE__ */ new Map());
1490
1490
  }
1491
1491
  has(t) {
1492
1492
  return this.events.has(t);
@@ -1524,11 +1524,14 @@ class oi {
1524
1524
  }
1525
1525
  class ni {
1526
1526
  constructor(t) {
1527
- h(this, "ctx");
1527
+ c(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;
1531
1531
  }
1532
+ scale(t) {
1533
+ this.ctx.scale(t, t);
1534
+ }
1532
1535
  save() {
1533
1536
  this.ctx.save();
1534
1537
  }
@@ -1555,21 +1558,21 @@ class ni {
1555
1558
  * @param {string} color - 阴影的颜色
1556
1559
  */
1557
1560
  drawShadow(t, e, i, s, r) {
1558
- const { fillColor: o, side: a, shadowWidth: c, colorStart: l, colorEnd: f } = r;
1561
+ const { fillColor: o, side: a, shadowWidth: h, colorStart: l, colorEnd: f } = r;
1559
1562
  this.ctx.save(), o && (this.ctx.fillStyle = o, this.ctx.fillRect(t, e, i, s));
1560
1563
  let d;
1561
1564
  switch (a) {
1562
1565
  case "left":
1563
- d = this.ctx.createLinearGradient(t - c, e, t, e), d.addColorStop(0, l), d.addColorStop(1, f), this.ctx.fillStyle = d, this.ctx.fillRect(t - c, e, c, s);
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);
1564
1567
  break;
1565
1568
  case "right":
1566
- d = this.ctx.createLinearGradient(t + i, e, t + i + c, e), d.addColorStop(0, l), d.addColorStop(1, f), this.ctx.fillStyle = d, this.ctx.fillRect(t + i, e, c, s);
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);
1567
1570
  break;
1568
1571
  case "top":
1569
- d = this.ctx.createLinearGradient(t, e - c, t, e), d.addColorStop(0, l), d.addColorStop(1, f), this.ctx.fillStyle = d, this.ctx.fillRect(t, e - c, i, c);
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);
1570
1573
  break;
1571
1574
  case "bottom":
1572
- d = this.ctx.createLinearGradient(t, e + s, t, e + s + c), d.addColorStop(0, l), d.addColorStop(1, f), this.ctx.fillStyle = d, this.ctx.fillRect(t, e + s, i, c);
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);
1573
1576
  break;
1574
1577
  default:
1575
1578
  console.error("Invalid side specified for shadow");
@@ -1582,19 +1585,19 @@ class ni {
1582
1585
  throw new Error("A valid array of points is required to draw a line");
1583
1586
  this.ctx.save();
1584
1587
  const { borderColor: i = "black", borderWidth: s = 1 } = e;
1585
- this.ctx.beginPath(), this.ctx.moveTo(t[0] + 0.5, t[1] + 0.5);
1588
+ this.ctx.beginPath(), this.ctx.moveTo(t[0] - 0.5, t[1] - 0.5);
1586
1589
  for (let r = 2; r < t.length; r += 2)
1587
- this.ctx.lineTo(t[r] + 0.5, t[r + 1] + 0.5);
1590
+ this.ctx.lineTo(t[r] - 0.5, t[r + 1] - 0.5);
1588
1591
  this.ctx.strokeStyle = i, this.ctx.lineWidth = s, e.lineDash && (this.ctx.lineDashOffset = 4, this.ctx.setLineDash(e.lineDash)), e.fillColor && (this.ctx.fillStyle = e.fillColor, this.ctx.fill()), e.borderColor && (this.ctx.strokeStyle = e.borderColor), this.ctx.stroke(), this.ctx.closePath(), this.ctx.restore();
1589
1592
  }
1590
1593
  drawImage(t, e, i, s, r) {
1591
1594
  this.ctx.save(), this.ctx.drawImage(t, e, i, s, r), this.ctx.restore();
1592
1595
  }
1593
- drawRect(t, e, i, s, { borderWidth: r = 1, borderColor: o, fillColor: a, radius: c = 0 } = {}) {
1594
- 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), c === 0)
1595
- this.ctx.rect(t + 0.5, e + 0.5, i, s);
1596
+ drawRect(t, e, i, s, { borderWidth: r = 1, borderColor: o, fillColor: a, radius: h = 0 } = {}) {
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
+ this.ctx.rect(t - 0.5, e - 0.5, i, s);
1596
1599
  else {
1597
- const [l, f, d, x] = typeof c == "number" ? [c, c, c, c] : c;
1600
+ const [l, f, d, x] = typeof h == "number" ? [h, h, h, h] : h;
1598
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);
1599
1602
  }
1600
1603
  a !== void 0 && this.ctx.fill(), o !== void 0 && this.ctx.stroke(), this.ctx.restore();
@@ -1613,18 +1616,18 @@ class ni {
1613
1616
  this.ctx.save();
1614
1617
  const {
1615
1618
  font: a = "12px Arial",
1616
- align: c = "center",
1619
+ align: h = "center",
1617
1620
  color: l = "#495060",
1618
1621
  padding: f = 0,
1619
1622
  verticalAlign: d = "middle"
1620
1623
  } = o;
1621
- this.ctx.font = a, this.ctx.fillStyle = l, this.ctx.textBaseline = d, this.ctx.textAlign = c;
1624
+ this.ctx.font = a, this.ctx.fillStyle = l, this.ctx.textBaseline = d, this.ctx.textAlign = h;
1622
1625
  let x = 0;
1623
1626
  d === "top" ? x = i + f : d === "bottom" ? x = i + r - f : x = i + (r + 1) / 2;
1624
1627
  let u = 0;
1625
- c === "left" ? u = e + f : c === "right" ? u = e + s - f : u = e + s / 2;
1626
- const { _text: p, ellipsis: g } = this.handleEllipsis(t, s, f, a);
1627
- return this.ctx.fillText(p, u, x), this.ctx.restore(), g;
1628
+ h === "left" ? u = e + f : h === "right" ? u = e + s - f : u = e + s / 2;
1629
+ const { _text: g, ellipsis: w } = this.handleEllipsis(t, s, f, a);
1630
+ return this.ctx.fillText(g, u, x), this.ctx.restore(), w;
1628
1631
  }
1629
1632
  handleEllipsis(t, e, i = 0, s = "12px Arial") {
1630
1633
  let r = !1, o = t;
@@ -1633,8 +1636,8 @@ class ni {
1633
1636
  _text: "",
1634
1637
  ellipsis: r
1635
1638
  };
1636
- const a = this.ctx.measureText("...").width, c = this.ctx.measureText(t).width;
1637
- if (c && c + a >= e - i * 2) {
1639
+ const a = this.ctx.measureText("...").width, h = this.ctx.measureText(t).width;
1640
+ if (h && h + a >= e - i * 2) {
1638
1641
  r = !0;
1639
1642
  let l = 0;
1640
1643
  for (let f = 0; f < t.length; f++)
@@ -1651,129 +1654,129 @@ class ni {
1651
1654
  }
1652
1655
  class Wt {
1653
1656
  constructor(t) {
1654
- h(this, "PROCESSOR_NUM", 50);
1655
- h(this, "CSS_PREFIX", "e-virt-table");
1656
- h(this, "ICONS", []);
1657
- h(this, "ROW_KEY", "");
1658
- h(this, "HEADER_FONT", "12px normal Arial");
1659
- h(this, "BODY_FONT", "12px normal Arial");
1660
- h(this, "BORDER_COLOR", "#e1e6eb");
1661
- h(this, "WIDTH", 0);
1662
- h(this, "RESIZE_MIN_WIDTH", 40);
1663
- h(this, "HEIGHT", 0);
1664
- h(this, "EMPTY_BODY_HEIGHT", 120);
1665
- h(this, "EMPTY_CUSTOM", !1);
1666
- h(this, "EMPTY_CUSTOM_STYLE", {});
1667
- h(this, "EMPTY_TEXT", "暂无数据");
1668
- h(this, "MAX_HEIGHT", 1e3);
1669
- h(this, "BORDER_RADIUS", 8);
1670
- h(this, "ENABLE_OFFSET_HEIGHT", !1);
1671
- h(this, "OFFSET_HEIGHT", 0);
1672
- h(this, "HEADER_HEIGHT", 36);
1673
- h(this, "ENABLE_HEADER_STICKY", !1);
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);
1674
1677
  // 启用头部固定,需要外面实现覆盖层,或者所有表头都要是元素
1675
- h(this, "HEADER_BG_COLOR", "#F8FAFF");
1676
- h(this, "BODY_BG_COLOR", "#FFF");
1677
- h(this, "HEADER_TEXT_COLOR", "#1D2129");
1678
- h(this, "LOADING_ICON_SVG", "");
1679
- h(this, "LOADING_ICON_COLOR", "#4E5969");
1680
- h(this, "EXPAND_ICON_SVG", "");
1681
- h(this, "SHRINK_ICON_SVG", "");
1682
- h(this, "EXPAND_ICON_COLOR", "#4E5969");
1683
- h(this, "SHRINK_ICON_COLOR", "#4E5969");
1684
- h(this, "ERROR_TIP_ICON_COLOR", "red");
1685
- h(this, "ERROR_TIP_ICON_SIZE", 6);
1686
- h(this, "EXPAND_LAZY", !0);
1687
- h(this, "DEFAULT_EXPAND_ALL", !1);
1688
- h(this, "CELL_WIDTH", 100);
1689
- h(this, "CELL_HEIGHT", 36);
1690
- h(this, "CELL_PADDING", 8);
1691
- h(this, "CELL_HOVER_ICON_SIZE", 20);
1692
- h(this, "SCROLLER_TRACK_SIZE", 14);
1693
- h(this, "SCROLLER_SIZE", 8);
1694
- h(this, "SCROLLER_COLOR", "#dee0e3");
1695
- h(this, "SCROLLER_TRACK_COLOR", "#fff");
1696
- h(this, "SCROLLER_FOCUS_COLOR", "#bbbec4");
1697
- h(this, "SELECT_BORDER_COLOR", "rgb(82,146,247)");
1698
- h(this, "SELECT_AREA_COLOR", "rgba(82,146,247,0.1)");
1699
- h(this, "SELECT_BG_COLOR", "rgba(82,146,247,0.1)");
1700
- h(this, "EDIT_BG_COLOR", "#fcf6ed");
1701
- h(this, "CHECKBOX_KEY", "");
1702
- h(this, "CHECKBOX_COLOR", "rgb(82,146,247)");
1703
- h(this, "CHECKBOX_SIZE", 20);
1704
- h(this, "CHECKBOX_DISABLED_SVG", "");
1705
- h(this, "CHECKBOX_CHECK_SVG", "");
1706
- h(this, "CHECKBOX_UNCHECK_SVG", "");
1707
- h(this, "CHECKBOX_INDETERMINATE_SVG", "");
1708
- h(this, "READONLY_COLOR", "#fff");
1709
- h(this, "READONLY_TEXT_COLOR", "#4E5969");
1710
- h(this, "ERROR_TIP_COLOR", "#ED3F14");
1711
- h(this, "FOOTER_BG_COLOR", "#fafafa");
1712
- h(this, "FOOTER_FIXED", !0);
1713
- h(this, "CELL_FOOTER_HEIGHT", 36);
1714
- h(this, "ENABLE_SELECTOR", !1);
1715
- h(this, "ENABLE_EDIT_SINGLE_CLICK", !1);
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);
1716
1719
  // 启用单点击立马编辑
1717
- h(this, "ENABLE_EDIT_CLICK_SELECTOR", !0);
1720
+ c(this, "ENABLE_EDIT_CLICK_SELECTOR", !0);
1718
1721
  // 启用点击选择器编辑
1719
- h(this, "SELECTOR_AREA_MIN_X", 0);
1722
+ c(this, "SELECTOR_AREA_MIN_X", 0);
1720
1723
  // 选择器X最小范围
1721
- h(this, "SELECTOR_AREA_MAX_X_OFFSET", 0);
1724
+ c(this, "SELECTOR_AREA_MAX_X_OFFSET", 0);
1722
1725
  // 选择器X最大范围colMax - offset
1723
- h(this, "SELECTOR_AREA_MAX_X", 0);
1726
+ c(this, "SELECTOR_AREA_MAX_X", 0);
1724
1727
  // 选择器X最大范围,0默认最大colMax
1725
- h(this, "SELECTOR_AREA_MIN_Y", 0);
1728
+ c(this, "SELECTOR_AREA_MIN_Y", 0);
1726
1729
  // 选择器Y最小范围
1727
- h(this, "SELECTOR_AREA_MAX_Y", 0);
1730
+ c(this, "SELECTOR_AREA_MAX_Y", 0);
1728
1731
  // 选择器Y最大范围,0默认rowMax
1729
- h(this, "SELECTOR_AREA_MAX_Y_OFFSET", 0);
1732
+ c(this, "SELECTOR_AREA_MAX_Y_OFFSET", 0);
1730
1733
  // 选择器Y最大范围,0默认rowMax
1731
- h(this, "ENABLE_SELECTOR_SINGLE", !1);
1732
- h(this, "ENABLE_SELECTOR_SPAN_COL", !0);
1733
- h(this, "ENABLE_SELECTOR_SPAN_ROW", !0);
1734
- h(this, "ENABLE_SELECTOR_ALL_ROWS", !0);
1735
- h(this, "ENABLE_SELECTOR_ALL_COLS", !0);
1736
- h(this, "ENABLE_AUTOFILL", !1);
1737
- h(this, "ENABLE_CONTEXT_MENU", !1);
1738
- h(this, "ENABLE_COPY", !0);
1739
- h(this, "ENABLE_PASTER", !0);
1740
- h(this, "ENABLE_RESIZE_ROW", !0);
1741
- h(this, "ENABLE_RESIZE_COLUMN", !0);
1742
- h(this, "RESIZE_ROW_LINE_COLOR", "#e1e6eb");
1743
- h(this, "RESIZE_COLUMN_LINE_COLOR", "#e1e6eb");
1744
- h(this, "RESIZE_ROW_MIN_HEIGHT", 36);
1745
- h(this, "RESIZE_COLUMN_MIN_WIDTH", 40);
1746
- h(this, "ENABLE_KEYBOARD", !0);
1747
- h(this, "ENABLE_HISTORY", !1);
1748
- h(this, "ENABLE_VALIDATOR_IMMEDIATE", !0);
1749
- h(this, "HISTORY_NUM", 50);
1750
- h(this, "HIGHLIGHT_HOVER_ROW", !1);
1751
- h(this, "HIGHLIGHT_HOVER_ROW_COLOR", "rgba(186,203,231,0.1)");
1752
- h(this, "HIGHLIGHT_SELECTED_ROW", !1);
1753
- h(this, "HIGHLIGHT_SELECTED_ROW_COLOR", "rgba(82,146,247,0.1)");
1754
- h(this, "TOOLTIP_BG_COLOR", "#303133");
1755
- h(this, "TOOLTIP_TEXT_COLOR", "#fff");
1756
- h(this, "TOOLTIP_ZINDEX", 3e3);
1757
- h(this, "TOOLTIP_CUSTOM_STYLE", {});
1758
- h(this, "CONTEXT_MENU", [
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", [
1759
1762
  { label: "复制", value: "copy" },
1760
1763
  { label: "剪切", value: "cut" },
1761
1764
  { label: "粘贴", value: "paste" },
1762
1765
  { label: "清空选中内容", value: "clearSelected" }
1763
1766
  ]);
1764
- h(this, "HEADER_CELL_STYLE_METHOD");
1765
- h(this, "BODY_CELL_STYLE_METHOD");
1766
- h(this, "FOOTER_CELL_STYLE_METHOD");
1767
- h(this, "CELL_READONLY_METHOD");
1768
- h(this, "CELL_FORMATTER_METHOD");
1769
- h(this, "CELL_RULES_METHOD");
1770
- h(this, "CELL_TYPE_METHOD");
1771
- h(this, "CELL_EDITOR_TYPE_METHOD");
1772
- h(this, "CELL_RENDER_METHOD");
1773
- h(this, "CELL_HOVER_ICON_METHOD");
1774
- h(this, "SPAN_METHOD");
1775
- h(this, "SELECTABLE_METHOD");
1776
- h(this, "EXPAND_LAZY_METHOD");
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");
1777
1780
  Object.assign(this, t);
1778
1781
  }
1779
1782
  init(t) {
@@ -1782,8 +1785,8 @@ class Wt {
1782
1785
  }
1783
1786
  class ai {
1784
1787
  constructor(t) {
1785
- h(this, "ctx");
1786
- h(this, "list", [
1788
+ c(this, "ctx");
1789
+ c(this, "list", [
1787
1790
  {
1788
1791
  name: "loading",
1789
1792
  configName: "LOADING_ICON_SVG",
@@ -1845,7 +1848,7 @@ class ai {
1845
1848
  color: ""
1846
1849
  }
1847
1850
  ]);
1848
- h(this, "icons", /* @__PURE__ */ new Map());
1851
+ c(this, "icons", /* @__PURE__ */ new Map());
1849
1852
  this.ctx = t, this.init();
1850
1853
  }
1851
1854
  async init() {
@@ -1879,8 +1882,8 @@ class ai {
1879
1882
  });
1880
1883
  const o = new Image(), a = new Blob([new XMLSerializer().serializeToString(r)], {
1881
1884
  type: "image/svg+xml"
1882
- }), c = URL.createObjectURL(a);
1883
- return o.src = c, new Promise((l, f) => {
1885
+ }), h = URL.createObjectURL(a);
1886
+ return o.src = h, new Promise((l, f) => {
1884
1887
  o.onerror = () => f(new Error("Failed to load image")), o.onload = () => {
1885
1888
  l(o);
1886
1889
  };
@@ -1892,27 +1895,36 @@ class ai {
1892
1895
  }
1893
1896
  class te {
1894
1897
  constructor(t, e, i, s, r, o, a) {
1895
- h(this, "ctx");
1896
- h(this, "x", 0);
1897
- h(this, "y", 0);
1898
- h(this, "width", 0);
1899
- h(this, "height", 0);
1900
- h(this, "fixed");
1901
- h(this, "cellType");
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");
1902
1905
  this.ctx = t, this.x = e, this.y = i, this.width = s, this.height = r, this.fixed = o, this.cellType = a;
1903
1906
  }
1904
1907
  isHorizontalVisible() {
1905
1908
  if (this.fixed)
1906
1909
  return !0;
1907
- const { target: t, fixedLeftWidth: e, scrollX: i, fixedRightWidth: s } = this.ctx, r = t.width;
1910
+ const { stageWidth: t, fixedLeftWidth: e, scrollX: i, fixedRightWidth: s } = this.ctx, r = t;
1908
1911
  return !(this.x + this.width - e - i <= 0 || this.x - i >= r - s);
1909
1912
  }
1910
1913
  isVerticalVisible() {
1911
- const { target: t, scrollY: e } = this.ctx, i = t.height;
1914
+ const { stageHeight: t, scrollY: e } = this.ctx, i = t;
1912
1915
  return !(this.y + this.height - e <= 0 || this.y - e >= i);
1913
1916
  }
1914
1917
  getDrawX() {
1915
- return this.fixed === "left" ? this.x : this.fixed === "right" ? this.ctx.header.visibleWidth - (this.ctx.header.width - this.x) + 1 : this.x - this.ctx.scrollX;
1918
+ if (this.fixed === "left")
1919
+ return this.x;
1920
+ if (this.fixed === "right") {
1921
+ const {
1922
+ stageWidth: t,
1923
+ config: { SCROLLER_TRACK_SIZE: e }
1924
+ } = this.ctx;
1925
+ return t - (this.ctx.header.width - this.x) - e + 1;
1926
+ }
1927
+ return this.x - this.ctx.scrollX;
1916
1928
  }
1917
1929
  getDrawY() {
1918
1930
  return this.cellType === "header" ? this.y : this.cellType === "footer" && this.ctx.config.FOOTER_FIXED ? this.y : this.y - this.ctx.scrollY;
@@ -1928,55 +1940,55 @@ class te {
1928
1940
  }
1929
1941
  }
1930
1942
  class ee extends te {
1931
- constructor(e, i, s, r, o, a, c, l, f, d = "body") {
1932
- super(e, r, o, a, c, l.fixed, d);
1933
- h(this, "formatter");
1934
- h(this, "hoverIconName", "");
1935
- h(this, "operation", !1);
1936
- h(this, "align");
1937
- h(this, "verticalAlign");
1938
- h(this, "fixed");
1939
- h(this, "type");
1940
- h(this, "editorType");
1941
- h(this, "cellType");
1942
- h(this, "level");
1943
- h(this, "colspan", 1);
1944
- h(this, "rowspan", 1);
1945
- h(this, "key");
1946
- h(this, "column");
1947
- h(this, "rowIndex");
1948
- h(this, "colIndex");
1949
- h(this, "rowKey");
1950
- h(this, "row");
1951
- h(this, "value");
1952
- h(this, "render");
1953
- h(this, "renderFooter");
1954
- h(this, "style", {});
1955
- h(this, "rules", {});
1956
- h(this, "message", "");
1957
- h(this, "text", "");
1958
- h(this, "displayText", "");
1959
- h(this, "visibleWidth", 0);
1960
- h(this, "visibleHeight", 0);
1961
- h(this, "drawX", 0);
1962
- h(this, "drawY", 0);
1963
- h(this, "drawCellBgColor", "");
1964
- h(this, "drawCellSkyBgColor", "");
1965
- h(this, "drawTextColor", "");
1966
- h(this, "drawTextX", 0);
1967
- h(this, "drawTextY", 0);
1968
- h(this, "drawImageX", 0);
1969
- h(this, "drawImageY", 0);
1970
- h(this, "drawImageWidth", 0);
1971
- h(this, "drawImageHeight", 0);
1972
- h(this, "drawImageName", "");
1973
- h(this, "drawImageSource");
1974
- h(this, "ellipsis", !1);
1975
- h(this, "rowExpand", !1);
1976
- h(this, "rowHasChildren", !1);
1977
- h(this, "overflowTooltipShow", !0);
1978
- h(this, "overflowTooltipMaxWidth", 500);
1979
- h(this, "overflowTooltipPlacement", "top");
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");
1980
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();
1981
1993
  }
1982
1994
  getValidationMessage() {
@@ -2071,18 +2083,18 @@ class ee extends te {
2071
2083
  const { CELL_PADDING: e = 0 } = this.ctx.config, { rowKey: i, cellType: s } = this;
2072
2084
  let r, o = 0, a = "";
2073
2085
  if (this.type === "tree" && s === "body") {
2074
- const c = this.ctx.database.getRowForRowKey(i), { expand: l = !1, hasChildren: f = !1, expandLoading: d = !1, level: x = 0 } = c || {};
2086
+ const h = this.ctx.database.getRowForRowKey(i), { expand: l = !1, hasChildren: f = !1, expandLoading: d = !1, level: x = 0 } = h || {};
2075
2087
  if (this.rowExpand = l, this.rowHasChildren = f, d) {
2076
2088
  const u = this.ctx.icons.get("loading");
2077
2089
  a = "loading", r = u, o = x * 8;
2078
2090
  } else if (f) {
2079
- const u = this.ctx.icons.get("expand"), p = this.ctx.icons.get("shrink");
2080
- r = l ? p : u, a = l ? "shrink" : "expand", o = x * 8;
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;
2081
2093
  } else
2082
2094
  o = x * 8;
2083
2095
  if (r) {
2084
- let u = 20, p = 20, g = this.drawX + o + e, w = this.drawY + (this.visibleHeight - p) / 2;
2085
- this.ctx.paint.drawImage(r, g, w, u, p), this.drawImageX = g, this.drawImageY = w, this.drawImageWidth = u, this.drawImageHeight = p, this.drawImageName = a, this.drawImageSource = r, this.align = "left", this.drawTextX = o + this.drawX + u + 0.5;
2096
+ let u = 20, g = 20, w = this.drawX + o + e, p = this.drawY + (this.visibleHeight - g) / 2;
2097
+ this.ctx.paint.drawImage(r, w, p, u, g), this.drawImageX = w, this.drawImageY = p, this.drawImageWidth = u, this.drawImageHeight = g, this.drawImageName = a, this.drawImageSource = r, this.align = "left", this.drawTextX = o + this.drawX + u - 0.5;
2086
2098
  }
2087
2099
  }
2088
2100
  }
@@ -2094,65 +2106,65 @@ class ee extends te {
2094
2106
  FOOTER_CELL_STYLE_METHOD: r,
2095
2107
  READONLY_TEXT_COLOR: o,
2096
2108
  FOOTER_BG_COLOR: a,
2097
- HIGHLIGHT_SELECTED_ROW: c,
2109
+ HIGHLIGHT_SELECTED_ROW: h,
2098
2110
  HIGHLIGHT_SELECTED_ROW_COLOR: l,
2099
2111
  HIGHLIGHT_HOVER_ROW: f,
2100
2112
  HIGHLIGHT_HOVER_ROW_COLOR: d
2101
2113
  } = this.ctx.config;
2102
2114
  if (this.cellType === "footer") {
2103
- let y = a, C = o;
2115
+ let y = a, b = o;
2104
2116
  if (typeof r == "function") {
2105
- const m = r, { backgroundColor: E, color: b } = m({
2117
+ const m = r, { backgroundColor: E, color: C } = m({
2106
2118
  row: this.row,
2107
2119
  rowIndex: this.rowIndex,
2108
2120
  colIndex: this.colIndex,
2109
2121
  column: this.column,
2110
2122
  value: this.getValue()
2111
2123
  }) || {};
2112
- E && (y = E), b && (C = b);
2124
+ E && (y = E), C && (b = C);
2113
2125
  }
2114
- this.drawCellSkyBgColor = "transparent", this.drawCellBgColor = y, this.drawTextColor = C;
2126
+ this.drawCellSkyBgColor = "transparent", this.drawCellBgColor = y, this.drawTextColor = b;
2115
2127
  return;
2116
2128
  }
2117
2129
  let x = "transparent";
2118
- const u = this.ctx.focusCell, p = this.ctx.hoverCell;
2119
- f && (p == null ? void 0 : p.rowKey) === this.rowKey && (x = d), c && (u == null ? void 0 : u.rowKey) === this.rowKey && (x = l), this.drawCellSkyBgColor = x;
2120
- let g = e, w = o;
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;
2132
+ let w = e, p = o;
2121
2133
  if (["index", "index-selection", "selection"].includes(this.type)) {
2122
2134
  this.drawCellBgColor = e, this.drawTextColor = o;
2123
2135
  return;
2124
2136
  }
2125
- if (this.ctx.database.getReadonly(this.rowKey, this.key) || (g = i, w = o), typeof s == "function") {
2126
- const y = s, { backgroundColor: C, color: m } = y({
2137
+ if (this.ctx.database.getReadonly(this.rowKey, this.key) || (w = i, p = o), typeof s == "function") {
2138
+ const y = s, { backgroundColor: b, color: m } = y({
2127
2139
  row: this.row,
2128
2140
  rowIndex: this.rowIndex,
2129
2141
  colIndex: this.colIndex,
2130
2142
  column: this.column,
2131
2143
  value: this.getValue()
2132
2144
  }) || {};
2133
- C && (g = C), m && (w = m);
2145
+ b && (w = b), m && (p = m);
2134
2146
  }
2135
- this.drawCellBgColor = g, this.drawTextColor = w;
2147
+ this.drawCellBgColor = w, this.drawTextColor = p;
2136
2148
  }
2137
2149
  updateSelection() {
2138
- const { visibleWidth: e, visibleHeight: i, rowspan: s, colspan: r, cellType: o, type: a, rowIndex: c, rowKey: l } = this;
2150
+ const { visibleWidth: e, visibleHeight: i, rowspan: s, colspan: r, cellType: o, type: a, rowIndex: h, rowKey: l } = this;
2139
2151
  if (!(s === 0 || r === 0) && o !== "footer" && ["index-selection", "selection"].includes(a)) {
2140
- 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, p = this.drawY + (i - x) / 2;
2141
- let g = this.ctx.icons.get("checkbox-uncheck"), w = "checkbox-uncheck";
2142
- f && d ? (g = this.ctx.icons.get("checkbox-check"), w = "checkbox-check") : f && d ? (g = this.ctx.icons.get("checkbox-check-disabled"), w = "checkbox-check-disabled") : !f && d ? (g = this.ctx.icons.get("checkbox-uncheck"), w = "checkbox-uncheck") : (g = this.ctx.icons.get("checkbox-disabled"), w = "checkbox-disabled"), g && a == "index-selection" ? (this.ctx.hoverCell && this.ctx.hoverCell.rowIndex === c || ["checkbox-disabled", "checkbox-check"].includes(w)) && (this.drawImageX = u, this.drawImageY = p, this.drawImageWidth = x, this.drawImageHeight = x, this.drawImageName = w, this.drawImageSource = g) : g && a === "selection" && (this.drawImageX = u, this.drawImageY = p, this.drawImageWidth = x, this.drawImageHeight = x, this.drawImageName = w, this.drawImageSource = g);
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;
2153
+ let w = this.ctx.icons.get("checkbox-uncheck"), p = "checkbox-uncheck";
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);
2143
2155
  }
2144
2156
  }
2145
2157
  updateHoverIcon() {
2146
2158
  const { CELL_HOVER_ICON_METHOD: e, CELL_HOVER_ICON_SIZE: i, CELL_PADDING: s } = this.ctx.config;
2147
2159
  if (typeof e == "function") {
2148
- const c = e({
2160
+ const h = e({
2149
2161
  row: this.row,
2150
2162
  rowIndex: this.rowIndex,
2151
2163
  colIndex: this.colIndex,
2152
2164
  column: this.column,
2153
2165
  value: this.getValue()
2154
2166
  });
2155
- c !== void 0 && (this.hoverIconName = c);
2167
+ h !== void 0 && (this.hoverIconName = h);
2156
2168
  }
2157
2169
  const r = this.drawX + this.width - i - s, o = this.drawY + (this.height - i) / 2;
2158
2170
  if (this.hoverIconName && this.ctx.hoverCell && this.ctx.hoverCell.rowIndex === this.rowIndex) {
@@ -2199,7 +2211,7 @@ class ee extends te {
2199
2211
  */
2200
2212
  getOverlayerViewsStyle() {
2201
2213
  let e = `${this.drawX - this.ctx.fixedLeftWidth}px`, i = `${this.drawY - this.ctx.body.y}px`;
2202
- return this.fixed === "left" ? e = `${this.drawX}px` : this.fixed === "right" && (e = `${this.drawX - (this.ctx.target.width - this.ctx.fixedRightWidth)}px`), this.cellType === "footer" && this.ctx.config.FOOTER_FIXED && (i = `${this.drawY - this.ctx.footer.y}px`), {
2214
+ return this.fixed === "left" ? e = `${this.drawX}px` : this.fixed === "right" && (e = `${this.drawX - (this.ctx.stageWidth - this.ctx.fixedRightWidth)}px`), this.cellType === "footer" && this.ctx.config.FOOTER_FIXED && (i = `${this.drawY - this.ctx.footer.y}px`), {
2203
2215
  position: "absolute",
2204
2216
  overflow: "hidden",
2205
2217
  left: e,
@@ -2268,8 +2280,8 @@ class ee extends te {
2268
2280
  const { SELECT_BORDER_COLOR: e, ENABLE_AUTOFILL: i, ENABLE_SELECTOR: s } = this.ctx.config;
2269
2281
  if (!s || !i)
2270
2282
  return;
2271
- const { xArr: r, yArr: o } = this.ctx.selector, a = r[1], c = o[1], { colIndex: l, rowIndex: f, drawX: d, drawY: x } = this;
2272
- l === a && f === c && 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: 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, {
2273
2285
  borderColor: "#fff",
2274
2286
  fillColor: e
2275
2287
  });
@@ -2323,35 +2335,35 @@ class ee extends te {
2323
2335
  });
2324
2336
  }
2325
2337
  drawBorder(e) {
2326
- const { drawX: i, drawY: s, width: r, rowIndex: o, colIndex: a } = this, c = i + 0.5;
2327
- let l = s + 0.5, f = this.height;
2328
- o === 0 && (l = this.y + 1, f = f - 1);
2329
- const { xArr: d, yArr: x, lineDash: u = [], borderWidth: p = 1, borderColor: g, fillColor: w } = e, y = d[0], C = d[1], m = x[0], E = x[1];
2330
- a >= y && a <= C && o === m && this.ctx.paint.drawLine([c, l, c + r - 2, l], {
2331
- borderColor: g,
2332
- fillColor: w,
2333
- borderWidth: p,
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);
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], {
2343
+ borderColor: w,
2344
+ fillColor: p,
2345
+ borderWidth: g,
2334
2346
  lineCap: "round",
2335
2347
  lineJoin: "round",
2336
2348
  lineDash: u
2337
- }), a >= y && a <= C && o === E && this.ctx.paint.drawLine([c, l + f - 1.5, c + r, l + f - 1.5], {
2338
- borderColor: g,
2339
- fillColor: w,
2340
- borderWidth: p,
2349
+ }), a >= y && a <= b && o === E && this.ctx.paint.drawLine([h, l + f - 1.5, h + r, l + f - 1.5], {
2350
+ borderColor: w,
2351
+ fillColor: p,
2352
+ borderWidth: g,
2341
2353
  lineCap: "round",
2342
2354
  lineJoin: "round",
2343
2355
  lineDash: u
2344
- }), a === y && o >= m && o <= E && this.ctx.paint.drawLine([c, l, c, l + f - 1], {
2345
- borderColor: g,
2346
- fillColor: w,
2347
- borderWidth: p,
2356
+ }), a === y && o >= m && o <= E && this.ctx.paint.drawLine([h, l, h, l + f - 1], {
2357
+ borderColor: w,
2358
+ fillColor: p,
2359
+ borderWidth: g,
2348
2360
  lineCap: "round",
2349
2361
  lineJoin: "round",
2350
2362
  lineDash: u
2351
- }), a === C && o >= m && o <= E && this.ctx.paint.drawLine([c + r - 1, l, c + r - 1, l + f - 1], {
2352
- borderColor: g,
2353
- fillColor: w,
2354
- borderWidth: p,
2363
+ }), a === b && o >= m && o <= E && this.ctx.paint.drawLine([h + r - 1.5, l, h + r - 1.5, l + f - 1.5], {
2364
+ borderColor: w,
2365
+ fillColor: p,
2366
+ borderWidth: g,
2355
2367
  lineCap: "round",
2356
2368
  lineJoin: "round",
2357
2369
  lineDash: u
@@ -2359,49 +2371,49 @@ class ee extends te {
2359
2371
  }
2360
2372
  }
2361
2373
  class ie extends te {
2362
- constructor(e, i, s, r, o, a, c) {
2363
- super(e, s, r, o, a, c.fixed, "header");
2364
- h(this, "align");
2365
- h(this, "verticalAlign", "middle");
2366
- h(this, "fixed");
2367
- h(this, "widthFillDisable");
2368
- h(this, "type");
2369
- h(this, "operation", !1);
2370
- h(this, "editorType");
2371
- h(this, "level");
2372
- h(this, "text");
2373
- h(this, "displayText", "");
2374
- h(this, "colspan");
2375
- h(this, "rowspan");
2376
- h(this, "key");
2377
- h(this, "required", !1);
2378
- h(this, "readonly", !1);
2379
- h(this, "children", []);
2380
- h(this, "column");
2381
- h(this, "colIndex");
2382
- h(this, "rowKey");
2383
- h(this, "rules");
2384
- h(this, "hasChildren");
2385
- h(this, "render");
2386
- h(this, "style", {});
2387
- h(this, "drawX", 0);
2388
- h(this, "drawY", 0);
2389
- h(this, "drawCellBgColor", "");
2390
- h(this, "drawTextColor", "");
2391
- h(this, "drawImageX", 0);
2392
- h(this, "drawImageY", 0);
2393
- h(this, "drawImageWidth", 0);
2394
- h(this, "drawImageHeight", 0);
2395
- h(this, "drawImageName", "");
2396
- h(this, "drawImageSource");
2397
- this.ctx = e, this.x = s, this.y = r, this.width = o, this.height = a, this.colIndex = i, this.key = c.key, this.type = c.type, this.editorType = c.editorType || "text", this.align = c.align || "center", this.verticalAlign = c.verticalAlign || "middle", this.fixed = c.fixed, this.level = c.level, this.operation = c.operation || !1, this.text = c.title, this.column = c, this.colspan = c.colspan, this.widthFillDisable = c.widthFillDisable, this.rowspan = c.rowspan, this.rules = c.rules, this.readonly = c.readonly, this.required = c.required, this.rowKey = Ut(), this.hasChildren = c.children && c.children.length > 0 || !1, this.render = c.renderHeader;
2374
+ constructor(e, i, s, r, o, a, h) {
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 = Ut(), this.hasChildren = h.children && h.children.length > 0 || !1, this.render = h.renderHeader;
2398
2410
  }
2399
2411
  /**
2400
2412
  * 是否可见,覆盖基类方法,表头是跟y滚动条没有关系的所以不需要加滚动参数
2401
2413
  * @returns
2402
2414
  */
2403
2415
  isVerticalVisible() {
2404
- const { target: e } = this.ctx, i = e.height;
2416
+ const { stageHeight: e } = this.ctx, i = e;
2405
2417
  return !(this.y + this.height <= 0 || this.y >= i);
2406
2418
  }
2407
2419
  /**
@@ -2414,11 +2426,11 @@ class ie extends te {
2414
2426
  const { HEADER_CELL_STYLE_METHOD: e, HEADER_BG_COLOR: i, HEADER_TEXT_COLOR: s } = this.ctx.config;
2415
2427
  let r = i, o = s;
2416
2428
  if (typeof e == "function") {
2417
- const a = e, { backgroundColor: c, color: l } = a({
2429
+ const a = e, { backgroundColor: h, color: l } = a({
2418
2430
  colIndex: this.colIndex,
2419
2431
  column: this.column
2420
2432
  }) || {};
2421
- c && (r = c), l && (o = l);
2433
+ h && (r = h), l && (o = l);
2422
2434
  }
2423
2435
  this.drawCellBgColor = r, this.drawTextColor = o;
2424
2436
  }
@@ -2429,11 +2441,11 @@ class ie extends te {
2429
2441
  const {
2430
2442
  paint: e,
2431
2443
  config: { BORDER_COLOR: i, CELL_PADDING: s, HEADER_FONT: r }
2432
- } = this.ctx, { drawX: o, drawY: a, displayText: c } = this;
2444
+ } = this.ctx, { drawX: o, drawY: a, displayText: h } = this;
2433
2445
  e.drawRect(o, a, this.width, this.height, {
2434
2446
  borderColor: i,
2435
2447
  fillColor: this.drawCellBgColor
2436
- }), e.drawText(c, o, a, this.width, this.height, {
2448
+ }), e.drawText(h, o, a, this.width, this.height, {
2437
2449
  font: r,
2438
2450
  padding: s,
2439
2451
  color: this.drawTextColor,
@@ -2444,9 +2456,9 @@ class ie extends te {
2444
2456
  drawSelection() {
2445
2457
  const { width: e, height: i, type: s } = this;
2446
2458
  if (["index-selection", "selection"].includes(s)) {
2447
- const { indeterminate: r, check: o, selectable: a } = this.ctx.database.getCheckedState(), { CHECKBOX_SIZE: c = 0 } = this.ctx.config, l = this.drawX + (e - c) / 2, f = this.drawY + (i - c) / 2;
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;
2448
2460
  let d = this.ctx.icons.get("checkbox-uncheck"), x = "checkbox-uncheck";
2449
- 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 = c, this.drawImageHeight = c, 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 = l, this.drawImageY = f, this.drawImageWidth = h, this.drawImageHeight = h, this.drawImageName = x, this.drawImageSource = d, this.ctx.paint.drawImage(
2450
2462
  this.drawImageSource,
2451
2463
  this.drawImageX,
2452
2464
  this.drawImageY,
@@ -2463,7 +2475,7 @@ class ie extends te {
2463
2475
  */
2464
2476
  getOverlayerViewsStyle() {
2465
2477
  let e = "";
2466
- return this.fixed === "left" ? e = `${this.drawX}px` : this.fixed === "right" ? e = `${this.drawX - (this.ctx.target.width - this.ctx.fixedRightWidth)}px` : e = `${this.drawX - this.ctx.fixedLeftWidth}px`, {
2478
+ return this.fixed === "left" ? e = `${this.drawX}px` : this.fixed === "right" ? e = `${this.drawX - (this.ctx.stageWidth - this.ctx.fixedRightWidth)}px` : e = `${this.drawX - this.ctx.fixedLeftWidth}px`, {
2467
2479
  position: "absolute",
2468
2480
  overflow: "hidden",
2469
2481
  left: e,
@@ -2473,17 +2485,17 @@ class ie extends te {
2473
2485
  };
2474
2486
  }
2475
2487
  }
2476
- class hi {
2488
+ class ci {
2477
2489
  constructor(t) {
2478
- h(this, "ctx");
2479
- h(this, "visibleHoverCell");
2480
- h(this, "resizeObserver");
2490
+ c(this, "ctx");
2491
+ c(this, "visibleHoverCell");
2492
+ c(this, "resizeObserver");
2481
2493
  this.ctx = t, this.init();
2482
2494
  }
2483
2495
  init() {
2484
2496
  this.resizeObserver = new ResizeObserver(() => {
2485
2497
  this.ctx.emit("resetHeader"), this.ctx.emit("resizeObserver");
2486
- }), this.ctx.target.parentElement && this.resizeObserver.observe(this.ctx.target), this.ctx.on("mousedown", (t) => {
2498
+ }), this.resizeObserver.observe(this.ctx.stageElement), this.ctx.on("mousedown", (t) => {
2487
2499
  if (t.button !== 0 || this.isBusy(t))
2488
2500
  return;
2489
2501
  const { offsetY: e, offsetX: i } = this.ctx.getOffset(t), s = e, r = i;
@@ -2567,10 +2579,10 @@ class hi {
2567
2579
  colIndex: t.colIndex,
2568
2580
  column: t.column,
2569
2581
  value: t.getValue()
2570
- }).then((c) => {
2571
- this.ctx.database.setExpandChildren(t.rowKey, c), this.ctx.database.expandLoading(t.rowKey, !1);
2572
- }).catch((c) => {
2573
- this.ctx.database.expandLoading(t.rowKey, !1), console.error(c);
2582
+ }).then((h) => {
2583
+ this.ctx.database.setExpandChildren(t.rowKey, h), this.ctx.database.expandLoading(t.rowKey, !1);
2584
+ }).catch((h) => {
2585
+ this.ctx.database.expandLoading(t.rowKey, !1), console.error(h);
2574
2586
  }));
2575
2587
  else {
2576
2588
  const a = this.ctx.database.getIsExpand(t.rowKey);
@@ -2585,27 +2597,27 @@ class hi {
2585
2597
  */
2586
2598
  imageEnterAndLeave(t, e) {
2587
2599
  const { offsetY: i, offsetX: s } = this.ctx.getOffset(e), r = i, o = s;
2588
- o > t.drawImageX && o < t.drawImageX + t.drawImageWidth && r > t.drawImageY && r < t.drawImageY + t.drawImageHeight ? (this.ctx.targetContainer.style.cursor = "pointer", this.ctx.isPointer = !0, t instanceof ee && ["selection", "index-selection"].includes(t.type) && (this.ctx.database.getRowSelectable(t.rowKey) || (this.ctx.targetContainer.style.cursor = "not-allowed"))) : (this.ctx.isPointer = !1, this.ctx.targetContainer.style.cursor === "pointer" && (this.ctx.targetContainer.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"));
2589
2601
  }
2590
2602
  isBusy(t) {
2591
2603
  const { offsetY: e, offsetX: i } = this.ctx.getOffset(t), s = e, r = i;
2592
- if (!this.ctx.isTarget() || this.ctx.targetContainer.style.cursor === "row-resize" || this.ctx.targetContainer.style.cursor === "col-resize" || this.ctx.columnResizing || this.ctx.rowResizing)
2604
+ if (!this.ctx.isTarget() || this.ctx.stageElement.style.cursor === "row-resize" || this.ctx.stageElement.style.cursor === "col-resize" || this.ctx.columnResizing || this.ctx.rowResizing)
2593
2605
  return !0;
2594
2606
  const { SCROLLER_TRACK_SIZE: o } = this.ctx.config;
2595
- return !!(this.ctx.scrollerMove || this.ctx.scrollerFocus || s > this.ctx.target.height - o || r > this.ctx.target.width - o);
2607
+ return !!(this.ctx.scrollerMove || this.ctx.scrollerFocus || s > this.ctx.stageHeight - o || r > this.ctx.stageWidth - o);
2596
2608
  }
2597
2609
  handleBodyEvent(t, e, i, s, r = !1) {
2598
2610
  for (const o of i) {
2599
2611
  const a = o.fixedCells.concat(o.noFixedCells);
2600
- for (const c of a) {
2601
- const l = c.getDrawX(), f = c.getDrawY();
2612
+ for (const h of a) {
2613
+ const l = h.getDrawX(), f = h.getDrawY();
2602
2614
  if (r) {
2603
- if (t > l && t < l + c.visibleWidth && e > f && e < f + c.visibleHeight) {
2604
- s(c);
2615
+ if (t > l && t < l + h.visibleWidth && e > f && e < f + h.visibleHeight) {
2616
+ s(h);
2605
2617
  return;
2606
2618
  }
2607
- } else if (t > l && t < l + c.width && e > f && e < f + c.height) {
2608
- s(c);
2619
+ } else if (t > l && t < l + h.width && e > f && e < f + h.height) {
2620
+ s(h);
2609
2621
  return;
2610
2622
  }
2611
2623
  }
@@ -2621,49 +2633,53 @@ class hi {
2621
2633
  }
2622
2634
  }
2623
2635
  destroy() {
2624
- this.resizeObserver.unobserve(this.ctx.target);
2636
+ this.resizeObserver.unobserve(this.ctx.stageElement);
2625
2637
  }
2626
2638
  }
2627
- class ci {
2628
- constructor(t, e, i) {
2629
- h(this, "eventBus");
2630
- h(this, "eventBrowser");
2631
- h(this, "eventTable");
2632
- h(this, "targetContainer");
2633
- h(this, "target");
2634
- h(this, "paint");
2635
- h(this, "icons");
2636
- h(this, "isInsideTargetContainer", !1);
2637
- h(this, "mousedown", !1);
2638
- h(this, "isPointer", !1);
2639
- h(this, "rowResizing", !1);
2639
+ class hi {
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);
2640
2656
  // 行调整大小中
2641
- h(this, "columnResizing", !1);
2657
+ c(this, "columnResizing", !1);
2642
2658
  // 列调整大小中
2643
- h(this, "scrollerMove", !1);
2659
+ c(this, "scrollerMove", !1);
2644
2660
  // 滚动条移动中
2645
- h(this, "scrollerFocus", !1);
2661
+ c(this, "scrollerFocus", !1);
2646
2662
  // 滚动条focus中
2647
- h(this, "autofillMove", !1);
2663
+ c(this, "autofillMove", !1);
2648
2664
  // 自动填充移动中
2649
- h(this, "selectorMove", !1);
2665
+ c(this, "selectorMove", !1);
2650
2666
  // 选择器移动中
2651
- h(this, "editing", !1);
2667
+ c(this, "editing", !1);
2652
2668
  // 编辑中
2653
- h(this, "scrollY", 0);
2654
- h(this, "scrollX", 0);
2655
- h(this, "fixedLeftWidth", 0);
2656
- h(this, "fixedRightWidth", 0);
2657
- h(this, "maxColIndex", 0);
2658
- h(this, "maxRowIndex", 0);
2659
- h(this, "hoverRow");
2660
- h(this, "clickCell");
2661
- h(this, "focusCell");
2662
- h(this, "hoverCell");
2663
- h(this, "clickCellHeader");
2664
- h(this, "focusCellHeader");
2665
- h(this, "hoverCellHeader");
2666
- h(this, "body", {
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", {
2667
2683
  x: 0,
2668
2684
  y: 0,
2669
2685
  width: 0,
@@ -2676,7 +2692,7 @@ class ci {
2676
2692
  renderRows: [],
2677
2693
  data: []
2678
2694
  });
2679
- h(this, "footer", {
2695
+ c(this, "footer", {
2680
2696
  x: 0,
2681
2697
  y: 0,
2682
2698
  width: 0,
@@ -2685,7 +2701,7 @@ class ci {
2685
2701
  visibleWidth: 0,
2686
2702
  renderRows: []
2687
2703
  });
2688
- h(this, "header", {
2704
+ c(this, "header", {
2689
2705
  x: 0,
2690
2706
  y: 0,
2691
2707
  width: 0,
@@ -2700,22 +2716,23 @@ class ci {
2700
2716
  fixedRightCellHeaders: [],
2701
2717
  renderCenterCellHeaders: []
2702
2718
  });
2703
- h(this, "selector", {
2719
+ c(this, "selector", {
2704
2720
  enable: !1,
2705
2721
  xArr: [-1, -1],
2706
2722
  yArr: [-1, -1],
2707
2723
  xArrCopy: [-1, -1],
2708
2724
  yArrCopy: [-1, -1]
2709
2725
  });
2710
- h(this, "autofill", {
2726
+ c(this, "autofill", {
2711
2727
  enable: !1,
2712
2728
  xArr: [-1, -1],
2713
2729
  yArr: [-1, -1]
2714
2730
  });
2715
- h(this, "database");
2716
- h(this, "history");
2717
- h(this, "config");
2718
- this.target = e, this.targetContainer = t, this.config = new Wt(i.config || {}), this.eventBus = new oi(), this.eventBrowser = new ri(this), this.eventTable = new hi(this), this.paint = new ni(e), this.database = new ii(this, i), this.history = new si(this), this.icons = new ai(this);
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 Wt(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);
2719
2736
  }
2720
2737
  setConfig(t) {
2721
2738
  this.config = new Wt(t);
@@ -2750,7 +2767,7 @@ class ci {
2750
2767
  for (let r = 0; r <= e[1] - e[0]; r++) {
2751
2768
  const o = [];
2752
2769
  for (let a = 0; a <= i[1] - i[0]; a++) {
2753
- const c = r + e[0], l = a + i[0], f = this.database.getItemValueForRowIndexAndColIndex(c, l);
2770
+ const h = r + e[0], l = a + i[0], f = this.database.getItemValueForRowIndexAndColIndex(h, l);
2754
2771
  f && o.push(f.value);
2755
2772
  }
2756
2773
  s += `${o.join(" ")}\r`, t.push(o);
@@ -2784,16 +2801,12 @@ class ci {
2784
2801
  return this.isInsideTargetContainer;
2785
2802
  }
2786
2803
  getOffset(t) {
2787
- const { left: e, top: i } = this.target.getBoundingClientRect();
2804
+ const { left: e, top: i } = this.containerElement.getBoundingClientRect();
2788
2805
  return {
2789
2806
  offsetX: t.clientX - e,
2790
2807
  offsetY: t.clientY - i
2791
2808
  };
2792
2809
  }
2793
- getAllEventBrowserNames() {
2794
- const t = this.eventBrowser.eventTasks.keys();
2795
- return Array.from(t);
2796
- }
2797
2810
  hasEvent(t) {
2798
2811
  return this.eventBus.has(t);
2799
2812
  }
@@ -2815,29 +2828,29 @@ class ci {
2815
2828
  }
2816
2829
  class Pt {
2817
2830
  constructor(t, e) {
2818
- h(this, "ctx");
2819
- h(this, "type");
2820
- h(this, "isFocus", !1);
2821
- h(this, "trackX", 0);
2822
- h(this, "trackY", 0);
2823
- h(this, "trackWidth", 0);
2824
- h(this, "trackHeight", 0);
2825
- h(this, "splitPoints", []);
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", []);
2826
2839
  //分割线
2827
- h(this, "barX", 0);
2828
- h(this, "barY", 0);
2829
- h(this, "barWidth", 0);
2830
- h(this, "barHeight", 0);
2831
- h(this, "distance", 0);
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);
2832
2845
  // 滚动条的长度
2833
- h(this, "visibleDistance", 0);
2846
+ c(this, "visibleDistance", 0);
2834
2847
  //可见区域的长度
2835
- h(this, "clientX", 0);
2836
- h(this, "clientY", 0);
2837
- h(this, "dragStart", 0);
2848
+ c(this, "clientX", 0);
2849
+ c(this, "clientY", 0);
2850
+ c(this, "dragStart", 0);
2838
2851
  // 拖拽开始的位置
2839
- h(this, "isDragging", !1);
2840
- h(this, "scroll", 0);
2852
+ c(this, "isDragging", !1);
2853
+ c(this, "scroll", 0);
2841
2854
  this.ctx = t, this.type = e, this.type === "vertical" ? this.scroll = this.ctx.scrollY : this.scroll = this.ctx.scrollX;
2842
2855
  }
2843
2856
  onWheel(t) {
@@ -2846,7 +2859,7 @@ class Pt {
2846
2859
  onMouseDown(t) {
2847
2860
  if (!(t.target instanceof Element) || !this.ctx.isTarget())
2848
2861
  return;
2849
- if (this.ctx.targetContainer.style.cursor === "row-resize" || this.ctx.targetContainer.style.cursor === "col-resize")
2862
+ if (this.ctx.stageElement.style.cursor === "row-resize" || this.ctx.stageElement.style.cursor === "col-resize")
2850
2863
  return !0;
2851
2864
  const { offsetX: e, offsetY: i, clientX: s, clientY: r } = t;
2852
2865
  if (!(s == this.clientX && r == this.clientY)) {
@@ -2863,7 +2876,7 @@ class Pt {
2863
2876
  }
2864
2877
  onMouseMove(t) {
2865
2878
  const { offsetX: e, offsetY: i, clientX: s, clientY: r } = t;
2866
- if (this.isOnScrollbar(e, i) && t.target === this.ctx.target ? this.isFocus = !0 : this.isFocus = !1, s == this.clientX && r == this.clientY) return;
2879
+ if (this.isOnScrollbar(e, i) && t.target === this.ctx.canvasElement ? this.isFocus = !0 : this.isFocus = !1, s == this.clientX && r == this.clientY) return;
2867
2880
  let o = 0;
2868
2881
  if (this.type === "horizontal" ? o = s - this.clientX : o = r - this.clientY, this.isDragging && o !== 0) {
2869
2882
  let a = 0;
@@ -2887,23 +2900,25 @@ class Pt {
2887
2900
  const {
2888
2901
  body: t,
2889
2902
  header: e,
2890
- config: { SCROLLER_TRACK_SIZE: i = 0, SCROLLER_SIZE: s = 0 }
2891
- } = this.ctx, r = this.ctx.target.width + 1, o = this.ctx.target.height, a = e.height, c = e.width, l = t.height, f = this.ctx.footer.height;
2903
+ stageHeight: i,
2904
+ stageWidth: s,
2905
+ 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;
2892
2907
  if (this.type === "vertical") {
2893
- this.visibleDistance = o - i - a, this.distance = l - this.visibleDistance + f, this.trackX = r - i, this.trackY = 0, this.splitPoints = [this.trackX, a, this.trackX + i, a], this.trackWidth = i, this.trackHeight = o, this.barX = this.trackX + (i - s) / 2, this.barWidth = s;
2894
- const d = this.distance ? this.visibleDistance / l : 0;
2895
- let x = Math.floor(d * this.visibleDistance);
2896
- x < 30 ? x = 30 : x > this.visibleDistance && (x = 0), this.barHeight = x, this.barY = a + this.scroll / this.distance * (this.visibleDistance - this.barHeight), this.scroll = Math.max(0, Math.min(this.scroll, this.distance));
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
+ const u = this.distance ? this.visibleDistance / d : 0;
2910
+ 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));
2897
2912
  } else {
2898
- this.visibleDistance = r - i, this.distance = c - this.visibleDistance, this.splitPoints = [
2899
- r - i,
2900
- o - i,
2901
- r - i,
2902
- o
2903
- ], this.trackX = 0, this.trackY = o - i, this.trackWidth = r, this.trackHeight = i;
2904
- const d = this.distance ? this.visibleDistance / c : 0;
2905
- let x = Math.floor(d * this.visibleDistance);
2906
- this.barY = this.trackY + 0.5 + (i - s) / 2, x < 30 ? x = 30 : x >= this.visibleDistance && (x = 0), this.barWidth = x, this.barHeight = s, this.barX = this.scroll / this.distance * (this.visibleDistance - this.barWidth), this.scroll = Math.max(0, Math.min(this.scroll, this.distance));
2913
+ this.visibleDistance = a - r, this.distance = f - this.visibleDistance, this.splitPoints = [
2914
+ a - r,
2915
+ h - r,
2916
+ a - r,
2917
+ h
2918
+ ], this.trackX = 0, this.trackY = h - r, this.trackWidth = a, this.trackHeight = r;
2919
+ const u = this.distance ? this.visibleDistance / f : 0;
2920
+ let g = Math.floor(u * this.visibleDistance);
2921
+ this.barY = this.trackY - 0.5 + (r - o) / 2, g < 30 ? g = 30 : g >= this.visibleDistance && (g = 0), this.barWidth = g, this.barHeight = o, this.barX = this.scroll / this.distance * (this.visibleDistance - this.barWidth), this.scroll = Math.max(0, Math.min(this.scroll, this.distance));
2907
2922
  }
2908
2923
  }
2909
2924
  draw() {
@@ -2924,9 +2939,9 @@ class Pt {
2924
2939
  }
2925
2940
  class li {
2926
2941
  constructor(t) {
2927
- h(this, "ctx");
2928
- h(this, "verticalScrollbar");
2929
- h(this, "horizontalScrollbar");
2942
+ c(this, "ctx");
2943
+ c(this, "verticalScrollbar");
2944
+ c(this, "horizontalScrollbar");
2930
2945
  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) => {
2931
2946
  this.setScroll(e, i);
2932
2947
  }), this.ctx.on("setScrollX", (e) => {
@@ -2980,41 +2995,41 @@ class li {
2980
2995
  }
2981
2996
  class di {
2982
2997
  constructor(t) {
2983
- h(this, "ctx");
2998
+ c(this, "ctx");
2984
2999
  // 上下文
2985
- h(this, "x", 0);
3000
+ c(this, "x", 0);
2986
3001
  // x坐标
2987
- h(this, "y", 0);
3002
+ c(this, "y", 0);
2988
3003
  // y坐标
2989
- h(this, "width", 0);
3004
+ c(this, "width", 0);
2990
3005
  // 宽度
2991
- h(this, "height", 0);
3006
+ c(this, "height", 0);
2992
3007
  // 高度
2993
- h(this, "resizeTarget", null);
3008
+ c(this, "resizeTarget", null);
2994
3009
  //调整表头
2995
- h(this, "resizeNum", 0);
3010
+ c(this, "resizeNum", 0);
2996
3011
  // 调整列的数量
2997
- h(this, "isResizing", !1);
3012
+ c(this, "isResizing", !1);
2998
3013
  // 是否移动中
2999
- h(this, "clientX", 0);
3014
+ c(this, "clientX", 0);
3000
3015
  // 鼠标按下时的x轴位置
3001
- h(this, "resizeDiff", 0);
3016
+ c(this, "resizeDiff", 0);
3002
3017
  // 是否移动中
3003
- h(this, "columnIndex", 0);
3004
- h(this, "isMouseDown", !1);
3018
+ c(this, "columnIndex", 0);
3019
+ c(this, "isMouseDown", !1);
3005
3020
  // 是否按下
3006
- h(this, "columns");
3007
- h(this, "visibleLeafColumns", []);
3008
- h(this, "visibleHeight", 0);
3009
- h(this, "visibleWidth", 0);
3010
- h(this, "allCellHeaders", []);
3011
- h(this, "leafCellHeaders", []);
3012
- h(this, "renderLeafCellHeaders", []);
3013
- h(this, "fixedLeftCellHeaders", []);
3014
- h(this, "centerCellHeaders", []);
3015
- h(this, "fixedRightCellHeaders", []);
3016
- h(this, "renderCenterCellHeaders", []);
3017
- h(this, "renderFixedCellHeaders", []);
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", []);
3018
3033
  this.ctx = t, this.ctx.on(
3019
3034
  "resetHeader",
3020
3035
  Zt(() => {
@@ -3031,11 +3046,11 @@ class di {
3031
3046
  this.height = t * s, this.width = r.reduce((d, x) => d + ((x == null ? void 0 : x.width) || 100), 0), this.visibleHeight = this.height;
3032
3047
  const o = Je(Qt(i, s));
3033
3048
  this.columnIndex = 0, this.resizeNum = 0, this.render(o, 0), this.ctx.database.updateColIndexKeyMap(this.leafCellHeaders);
3034
- const a = this.ctx.targetContainer.getBoundingClientRect();
3035
- this.resizeNum > 0 ? this.ctx.target.width = a.width : this.ctx.target.width = this.width + e - 1, this.visibleWidth = this.ctx.target.width - e;
3036
- const c = this.visibleWidth - this.width;
3037
- if (this.resizeNum && c > 0) {
3038
- const d = Math.floor(c / this.resizeNum * 100) / 100;
3049
+ const a = this.ctx.containerElement.getBoundingClientRect();
3050
+ 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;
3051
+ const h = this.visibleWidth - this.width;
3052
+ if (this.resizeNum && h > 0) {
3053
+ const d = Math.floor(h / this.resizeNum * 100) / 100;
3039
3054
  this.resizeAllColumn(d);
3040
3055
  }
3041
3056
  const l = this.fixedLeftCellHeaders.filter((d) => !d.hasChildren);
@@ -3055,7 +3070,7 @@ class di {
3055
3070
  }), this.ctx.on("mousemove", (e) => {
3056
3071
  if (this.ctx.editing) return;
3057
3072
  const {
3058
- target: i,
3073
+ stageWidth: i,
3059
3074
  config: { RESIZE_COLUMN_MIN_WIDTH: s }
3060
3075
  } = this.ctx;
3061
3076
  if (this.isResizing && this.resizeTarget) {
@@ -3065,12 +3080,12 @@ class di {
3065
3080
  } else {
3066
3081
  if (this.resizeTarget = null, this.isMouseDown)
3067
3082
  return;
3068
- this.ctx.targetContainer.style.cursor === "col-resize" && (this.ctx.targetContainer.style.cursor = "default");
3083
+ this.ctx.stageElement.style.cursor === "col-resize" && (this.ctx.stageElement.style.cursor = "default");
3069
3084
  const r = [...this.renderFixedCellHeaders, ...this.renderCenterCellHeaders];
3070
3085
  for (const o of r) {
3071
- const { offsetX: a, offsetY: c } = this.ctx.getOffset(e), l = a, f = o.getDrawX();
3072
- l > f + o.width - 5 && l < f + o.width + 4 && l < i.width - 4 && // 视窗中最后一列不允许调整宽
3073
- o.colspan <= 1 && this.ctx.isTarget() && c <= this.height && (this.ctx.targetContainer.style.cursor = "col-resize", this.resizeTarget = o);
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 && // 视窗中最后一列不允许调整宽
3088
+ o.colspan <= 1 && this.ctx.isTarget() && h <= this.height && (this.ctx.stageElement.style.cursor = "col-resize", this.resizeTarget = o);
3074
3089
  }
3075
3090
  }
3076
3091
  }));
@@ -3124,19 +3139,19 @@ class di {
3124
3139
  let s = e;
3125
3140
  const { HEADER_HEIGHT: r = 0 } = this.ctx.config;
3126
3141
  for (let o = 0; o < i; o++) {
3127
- const a = t[o], c = r * (a.rowspan || 1), l = r * a.level;
3142
+ const a = t[o], h = r * (a.rowspan || 1), l = r * a.level;
3128
3143
  let f = a.width || 100;
3129
- a.children && (f = _t(a.children).reduce((u, p) => u + ((p == null ? void 0 : p.width) || 100), 0));
3130
- const d = new ie(this.ctx, this.columnIndex, s, l, f, c, a);
3144
+ a.children && (f = _t(a.children).reduce((u, g) => u + ((g == null ? void 0 : g.width) || 100), 0));
3145
+ const d = new ie(this.ctx, this.columnIndex, s, l, f, h, a);
3131
3146
  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;
3132
3147
  }
3133
3148
  }
3134
3149
  drawTipLine() {
3135
3150
  if (this.isResizing && this.resizeTarget) {
3136
3151
  const {
3137
- target: t,
3152
+ stageHeight: t,
3138
3153
  config: { RESIZE_COLUMN_LINE_COLOR: e }
3139
- } = this.ctx, i = this.resizeTarget.getDrawX(), s = this.resizeTarget.width, r = i + s + this.resizeDiff - 0.5, o = [r + 0.5, 0, r + 0.5, t.height];
3154
+ } = this.ctx, i = this.resizeTarget.getDrawX(), s = this.resizeTarget.width, r = i + s + this.resizeDiff - 0.5, o = [r - 0.5, 0, r - 0.5, t];
3140
3155
  this.ctx.paint.drawLine(o, {
3141
3156
  borderColor: e,
3142
3157
  borderWidth: 1
@@ -3149,7 +3164,7 @@ class di {
3149
3164
  fixedRightWidth: e,
3150
3165
  scrollX: i,
3151
3166
  header: s,
3152
- target: r,
3167
+ stageWidth: r,
3153
3168
  config: { HEADER_BG_COLOR: o, SCROLLER_TRACK_SIZE: a }
3154
3169
  } = this.ctx;
3155
3170
  if (i > 0 && t !== 0 && this.ctx.paint.drawShadow(this.x, this.y, t, this.height, {
@@ -3158,9 +3173,9 @@ class di {
3158
3173
  shadowWidth: 4,
3159
3174
  colorStart: "rgba(0,0,0,0.1)",
3160
3175
  colorEnd: "rgba(0,0,0,0)"
3161
- }), i < Math.floor(s.width - s.visibleWidth - 1) && e !== a) {
3162
- const c = s.width - (this.x + this.width) + r.width - e;
3163
- this.ctx.paint.drawShadow(c + 1, this.y, e, this.height, {
3176
+ }), i < Math.floor(s.width - r - 1) && e !== a) {
3177
+ const h = s.width - (this.x + this.width) + r - e;
3178
+ this.ctx.paint.drawShadow(h + 1, this.y, e, this.height, {
3164
3179
  fillColor: o,
3165
3180
  side: "left",
3166
3181
  shadowWidth: 4,
@@ -3188,20 +3203,20 @@ class di {
3188
3203
  }
3189
3204
  }
3190
3205
  class se {
3191
- constructor(t, e, i = 0, s = 0, r = 0, o = 0, a, c = "body") {
3192
- h(this, "ctx");
3193
- h(this, "x", 0);
3194
- h(this, "y", 0);
3195
- h(this, "width", 0);
3196
- h(this, "height");
3197
- h(this, "cells", []);
3198
- h(this, "fixedCells", []);
3199
- h(this, "noFixedCells", []);
3200
- h(this, "rowIndex", 0);
3201
- h(this, "rowKey", "");
3202
- h(this, "rowType", "body");
3203
- h(this, "data");
3204
- 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 = c, this.data = a, this.update();
3206
+ 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");
3219
+ 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();
3205
3220
  }
3206
3221
  update() {
3207
3222
  const { header: t } = this.ctx, e = [], i = [], s = [];
@@ -3241,77 +3256,77 @@ class se {
3241
3256
  }
3242
3257
  class fi {
3243
3258
  constructor(t) {
3244
- h(this, "resizeTarget", null);
3259
+ c(this, "resizeTarget", null);
3245
3260
  //调整行大小的目标
3246
- h(this, "isMouseDown", !1);
3261
+ c(this, "isMouseDown", !1);
3247
3262
  // 是否按下
3248
- h(this, "resizeDiff", 0);
3263
+ c(this, "resizeDiff", 0);
3249
3264
  // 是否移动中
3250
- h(this, "clientY", 0);
3265
+ c(this, "clientY", 0);
3251
3266
  // 鼠标按下时的y轴位置
3252
- h(this, "ctx");
3253
- h(this, "x", 0);
3254
- h(this, "y", 0);
3255
- h(this, "width", 0);
3256
- h(this, "height", 0);
3257
- h(this, "headIndex", 0);
3258
- h(this, "tailIndex", 0);
3259
- h(this, "isResizing", !1);
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);
3260
3275
  //是否正在调整大小
3261
- h(this, "renderRows", []);
3262
- h(this, "visibleRows", []);
3263
- h(this, "visibleHeight", 0);
3264
- h(this, "visibleWidth", 0);
3265
- h(this, "data", []);
3276
+ c(this, "renderRows", []);
3277
+ c(this, "visibleRows", []);
3278
+ c(this, "visibleHeight", 0);
3279
+ c(this, "visibleWidth", 0);
3280
+ c(this, "data", []);
3266
3281
  this.ctx = t, this.init(), this.initResizeRow();
3267
3282
  }
3268
3283
  init() {
3269
3284
  const {
3270
- target: t,
3285
+ canvasElement: t,
3271
3286
  header: e,
3272
3287
  database: i,
3273
3288
  config: {
3274
3289
  FOOTER_FIXED: s,
3275
3290
  SCROLLER_TRACK_SIZE: r = 0,
3276
- BORDER_COLOR: o,
3277
- BORDER_RADIUS: a,
3278
- HEIGHT: c,
3279
- EMPTY_BODY_HEIGHT: l = 0,
3280
- MAX_HEIGHT: f = 0,
3281
- ENABLE_OFFSET_HEIGHT: d = 0,
3282
- OFFSET_HEIGHT: x = 0
3291
+ HEIGHT: o,
3292
+ EMPTY_BODY_HEIGHT: a = 0,
3293
+ MAX_HEIGHT: h = 0,
3294
+ ENABLE_OFFSET_HEIGHT: l = 0,
3295
+ OFFSET_HEIGHT: f = 0
3283
3296
  }
3284
3297
  } = this.ctx;
3285
3298
  if (!e.width)
3286
3299
  return;
3287
3300
  this.x = 0, this.y = e.height;
3288
- const { data: u, sumHeight: p } = i.getData();
3289
- this.height = p, this.data = u;
3290
- const { top: g } = t.getBoundingClientRect();
3291
- this.width = e.width, this.visibleWidth = t.width - r;
3292
- const w = this.ctx.footer.height;
3293
- this.data.length || (this.height = l);
3294
- const y = this.data.length ? "not-empty" : "empty";
3301
+ const { data: d, sumHeight: x } = i.getData();
3302
+ this.height = x, this.data = d;
3303
+ const { top: u } = t.getBoundingClientRect();
3304
+ this.width = e.width, this.visibleWidth = this.ctx.stageWidth - r;
3305
+ const g = this.ctx.footer.height;
3306
+ this.data.length || (this.height = a);
3307
+ const w = this.data.length ? "not-empty" : "empty";
3295
3308
  this.ctx.emit("emptyChange", {
3296
- isEmpty: y,
3297
- type: y,
3309
+ isEmpty: w,
3310
+ type: w,
3298
3311
  headerHeight: e.height,
3299
3312
  bodyHeight: this.height,
3300
- footerHeight: w,
3313
+ footerHeight: g,
3301
3314
  width: this.width,
3302
- height: this.data.length ? 0 : l + w
3315
+ height: this.data.length ? 0 : a + g
3303
3316
  });
3304
- let C = this.height + e.height + r;
3305
- C += w;
3306
- let m = 0;
3307
- this.data.length && d ? (m = window.innerHeight - g - x, m < 0 && (m = 32, console.error(
3317
+ let p = this.height + e.height + r;
3318
+ p += g;
3319
+ let y = 0;
3320
+ this.data.length && l ? (y = window.innerHeight - u - f, y < 0 && (y = 32, console.error(
3308
3321
  "There is an error in the height calculation ENABLE_OFFSET_HEIGHT and OFFSET_HEIGHT are invalid"
3309
- ))) : this.data.length && c ? m = c : this.data.length && f && C > f ? m = f : m = C, m > 0 && (this.ctx.target.height = m);
3310
- let E = t.height - e.height - r;
3311
- s ? this.visibleHeight = E - w : this.visibleHeight = E, this.ctx.body.x = this.x, this.ctx.body.y = this.y, this.ctx.body.width = this.width, this.ctx.body.height = this.height, this.ctx.body.visibleWidth = this.visibleWidth, this.ctx.body.visibleHeight = this.visibleHeight, this.ctx.body.data = u, this.ctx.target.setAttribute("class", "e-virt-table-canvas"), this.ctx.target.setAttribute(
3322
+ ))) : 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
+ let b = this.ctx.stageHeight - e.height - r;
3324
+ s ? this.visibleHeight = b - g : this.visibleHeight = b, this.ctx.body.x = this.x, this.ctx.body.y = this.y, this.ctx.body.width = this.width, this.ctx.body.height = this.height, this.ctx.body.visibleWidth = this.visibleWidth, this.ctx.body.visibleHeight = this.visibleHeight, this.ctx.body.data = d;
3325
+ const m = window.devicePixelRatio || 1, E = this.ctx.stageWidth * m, C = this.ctx.stageHeight * m;
3326
+ t.width = Math.floor(E), t.height = Math.floor(C), this.ctx.canvasElement.setAttribute(
3312
3327
  "style",
3313
- `border-radius: ${a}px; border: 1px solid ${o}; height:${this.ctx.target.height}px;width:${this.ctx.target.width - 1}px;`
3314
- );
3328
+ ` height:${this.ctx.stageHeight}px;width:${this.ctx.stageWidth}px;`
3329
+ ), this.ctx.paint.scale(m);
3315
3330
  }
3316
3331
  // 调整行的高度
3317
3332
  initResizeRow() {
@@ -3327,7 +3342,7 @@ class fi {
3327
3342
  }), this.ctx.on("mousemove", (e) => {
3328
3343
  if (this.ctx.editing) return;
3329
3344
  const { offsetY: i, offsetX: s } = this.ctx.getOffset(e), r = i, o = s, a = e.clientY, {
3330
- target: c,
3345
+ stageHeight: h,
3331
3346
  scrollY: l,
3332
3347
  config: { RESIZE_ROW_MIN_HEIGHT: f = 0 }
3333
3348
  } = this.ctx;
@@ -3336,15 +3351,15 @@ class fi {
3336
3351
  let x = a - this.clientY;
3337
3352
  x + d < f && (x = -(d - f)), this.resizeDiff = x, this.ctx.emit("draw");
3338
3353
  } else {
3339
- if (this.resizeTarget = null, this.isMouseDown || this.ctx.targetContainer.style.cursor === "crosshair")
3354
+ if (this.resizeTarget = null, this.isMouseDown || this.ctx.stageElement.style.cursor === "crosshair")
3340
3355
  return;
3341
- this.ctx.targetContainer.style.cursor === "row-resize" && (this.ctx.targetContainer.style.cursor = "default");
3356
+ this.ctx.stageElement.style.cursor === "row-resize" && (this.ctx.stageElement.style.cursor = "default");
3342
3357
  for (let d = 0; d < this.renderRows.length; d++) {
3343
3358
  const x = this.renderRows[d];
3344
- if (r > x.y - l + x.height - 1.5 && r < x.y - l + x.height + 1.5 && r < c.height - 4)
3345
- for (let p = 0; p < x.cells.length; p++) {
3346
- const g = x.cells[p];
3347
- o > g.drawX + 10 && o < g.drawX + g.width - 10 && g.rowspan === 1 && (this.ctx.targetContainer.style.cursor = "row-resize", this.resizeTarget = x);
3359
+ if (r > x.y - l + x.height - 1.5 && r < x.y - l + x.height + 1.5 && r < h - 4)
3360
+ for (let g = 0; g < x.cells.length; g++) {
3361
+ const w = x.cells[g];
3362
+ o > w.drawX + 10 && o < w.drawX + w.width - 10 && w.rowspan === 1 && (this.ctx.stageElement.style.cursor = "row-resize", this.resizeTarget = x);
3348
3363
  }
3349
3364
  }
3350
3365
  }
@@ -3364,10 +3379,10 @@ class fi {
3364
3379
  drawTipLine() {
3365
3380
  if (this.isResizing && this.resizeTarget) {
3366
3381
  const {
3367
- target: t,
3382
+ stageWidth: t,
3368
3383
  scrollY: e,
3369
3384
  config: { RESIZE_ROW_LINE_COLOR: i }
3370
- } = this.ctx, s = this.resizeTarget.y - e, r = this.resizeTarget.height, o = s + r + this.resizeDiff - 0.5, a = [0, o + 0.5, t.width, o + 0.5];
3385
+ } = this.ctx, s = this.resizeTarget.y - e, r = this.resizeTarget.height, o = s + r + this.resizeDiff - 0.5, a = [0, o - 0.5, t, o - 0.5];
3371
3386
  this.ctx.paint.drawLine(a, {
3372
3387
  borderColor: i,
3373
3388
  borderWidth: 1
@@ -3380,7 +3395,7 @@ class fi {
3380
3395
  fixedRightWidth: e,
3381
3396
  scrollX: i,
3382
3397
  header: s,
3383
- target: r,
3398
+ stageWidth: r,
3384
3399
  config: { HEADER_BG_COLOR: o, SCROLLER_TRACK_SIZE: a }
3385
3400
  } = this.ctx;
3386
3401
  if (i > 0 && t !== 0 && this.ctx.paint.drawShadow(this.x, this.y, t, this.height, {
@@ -3389,9 +3404,9 @@ class fi {
3389
3404
  shadowWidth: 4,
3390
3405
  colorStart: "rgba(0,0,0,0.1)",
3391
3406
  colorEnd: "rgba(0,0,0,0)"
3392
- }), i < Math.floor(s.width - s.visibleWidth - 1) && e !== a) {
3393
- const c = s.width - (this.x + this.width) + r.width - e;
3394
- this.ctx.paint.drawShadow(c + 1, this.y, e, this.height, {
3407
+ }), i < Math.floor(s.width - r - 1) && e !== a) {
3408
+ const h = s.width - (this.x + this.width) + r - e;
3409
+ this.ctx.paint.drawShadow(h + 1, this.y, e, this.height, {
3395
3410
  fillColor: o,
3396
3411
  side: "left",
3397
3412
  shadowWidth: 4,
@@ -3415,12 +3430,12 @@ class fi {
3415
3430
  const { header: t, database: e, scrollY: i } = this.ctx, s = i, { data: r, positions: o } = e.getData();
3416
3431
  this.ctx.maxRowIndex = r.length - 1;
3417
3432
  const a = this.binarySearch(o, s);
3418
- let c = this.binarySearch(o, s + this.visibleHeight);
3419
- c === -1 && (c = r.length), this.headIndex = Math.max(0, a), this.tailIndex = Math.min(this.ctx.maxRowIndex, c + 1), this.visibleRows = r.slice(this.headIndex, this.tailIndex + 1), this.ctx.body.headIndex = this.headIndex, this.ctx.body.tailIndex = this.tailIndex, this.ctx.body.visibleRows = this.visibleRows;
3433
+ let h = this.binarySearch(o, s + this.visibleHeight);
3434
+ 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;
3420
3435
  const l = [];
3421
3436
  for (let f = 0; f < this.visibleRows.length; f++) {
3422
- const d = this.headIndex + f, x = this.visibleRows[f], { height: u, top: p } = this.ctx.database.getPositionForRowIndex(d), g = new se(this.ctx, d, 0, p + this.y, t.width, u, x);
3423
- l.push(g);
3437
+ 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);
3438
+ l.push(w);
3424
3439
  }
3425
3440
  this.renderRows = l, this.ctx.body.renderRows = l;
3426
3441
  }
@@ -3434,15 +3449,15 @@ class fi {
3434
3449
  }
3435
3450
  class xi {
3436
3451
  constructor(t) {
3437
- h(this, "ctx");
3438
- h(this, "renderRows", []);
3439
- h(this, "data", []);
3440
- h(this, "x", 0);
3441
- h(this, "y", 0);
3442
- h(this, "width", 0);
3443
- h(this, "height", 0);
3444
- h(this, "visibleWidth", 0);
3445
- h(this, "visibleHeight", 0);
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);
3446
3461
  this.ctx = t, this.init();
3447
3462
  }
3448
3463
  init() {
@@ -3452,7 +3467,7 @@ class xi {
3452
3467
  body: e,
3453
3468
  config: { CELL_FOOTER_HEIGHT: i, FOOTER_FIXED: s, SCROLLER_TRACK_SIZE: r }
3454
3469
  } = this.ctx;
3455
- this.width = t.width, this.visibleWidth = t.visibleWidth, this.height = this.data.reduce((o) => o + i, 0), this.visibleHeight = this.height, s ? this.y = this.ctx.target.height - this.height - r : this.y = e.y + e.height, this.ctx.footer.x = this.x, this.ctx.footer.y = this.y, this.ctx.footer.height = this.height, this.ctx.footer.width = this.width, this.ctx.footer.visibleWidth = this.visibleWidth, this.ctx.footer.visibleHeight = this.visibleHeight;
3470
+ this.width = t.width, this.visibleWidth = t.visibleWidth, this.height = this.data.reduce((o) => o + i, 0), this.visibleHeight = this.height, s ? this.y = this.ctx.stageHeight - this.height - r : this.y = e.y + e.height, this.ctx.footer.x = this.x, this.ctx.footer.y = this.y, this.ctx.footer.height = this.height, this.ctx.footer.width = this.width, this.ctx.footer.visibleWidth = this.visibleWidth, this.ctx.footer.visibleHeight = this.visibleHeight;
3456
3471
  }
3457
3472
  drawFiexShadow() {
3458
3473
  const {
@@ -3460,19 +3475,19 @@ class xi {
3460
3475
  fixedRightWidth: e,
3461
3476
  scrollX: i,
3462
3477
  header: s,
3463
- target: r,
3478
+ stageWidth: r,
3464
3479
  config: { HEADER_BG_COLOR: o, SCROLLER_TRACK_SIZE: a }
3465
3480
  } = this.ctx;
3466
- let c = this.y;
3467
- if (this.ctx.config.FOOTER_FIXED || (c = this.y - this.ctx.scrollY), i > 0 && t !== 0 && this.ctx.paint.drawShadow(this.x, c, t, this.height, {
3481
+ let h = this.y;
3482
+ if (this.ctx.config.FOOTER_FIXED || (h = this.y - this.ctx.scrollY), i > 0 && t !== 0 && this.ctx.paint.drawShadow(this.x, h, t, this.height, {
3468
3483
  fillColor: o,
3469
3484
  side: "right",
3470
3485
  shadowWidth: 4,
3471
3486
  colorStart: "rgba(0,0,0,0.1)",
3472
3487
  colorEnd: "rgba(0,0,0,0)"
3473
- }), i < Math.floor(s.width - s.visibleWidth - 1) && e !== a) {
3474
- const l = s.width - (this.x + this.width) + r.width - e;
3475
- this.ctx.paint.drawShadow(l + 1, c, e, this.height, {
3488
+ }), 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, {
3476
3491
  fillColor: o,
3477
3492
  side: "left",
3478
3493
  shadowWidth: 4,
@@ -3510,16 +3525,16 @@ class xi {
3510
3525
  }
3511
3526
  class ui {
3512
3527
  constructor(t) {
3513
- h(this, "isCut", !1);
3514
- h(this, "isMultipleRow", !1);
3515
- h(this, "ctx");
3516
- h(this, "adjustPositionX", "");
3517
- h(this, "adjustPositionY", "");
3518
- h(this, "timerX", 0);
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);
3519
3534
  // 水平滚动定时器
3520
- h(this, "timerY", 0);
3535
+ c(this, "timerY", 0);
3521
3536
  // 垂直滚动定时器
3522
- h(this, "adjustTimer", 0);
3537
+ c(this, "adjustTimer", 0);
3523
3538
  this.ctx = t, this.init();
3524
3539
  }
3525
3540
  init() {
@@ -3538,7 +3553,7 @@ class ui {
3538
3553
  this.isMultipleRow || this.mouseenter();
3539
3554
  }
3540
3555
  }), this.ctx.on("cellMousedown", (t, e) => {
3541
- if (this.ctx.isTarget() && this.ctx.targetContainer.style.cursor !== "pointer" && !this.ctx.isPointer && this.ctx.targetContainer.style.cursor !== "crosshair") {
3556
+ if (this.ctx.isTarget() && this.ctx.stageElement.style.cursor !== "pointer" && !this.ctx.isPointer && this.ctx.stageElement.style.cursor !== "crosshair") {
3542
3557
  if (t.operation) {
3543
3558
  this.isMultipleRow = !0, this.selectRows(t);
3544
3559
  return;
@@ -3548,7 +3563,7 @@ class ui {
3548
3563
  }), this.ctx.on("cellHeaderHoverChange", (t) => {
3549
3564
  this.ctx.mousedown && this.selectCols(t);
3550
3565
  }), this.ctx.on("cellHeaderMousedown", (t) => {
3551
- this.ctx.targetContainer.style.cursor !== "pointer" && (this.ctx.isPointer || this.selectCols(t));
3566
+ this.ctx.stageElement.style.cursor !== "pointer" && (this.ctx.isPointer || this.selectCols(t));
3552
3567
  }), this.ctx.on("keydown", (t) => {
3553
3568
  if (t.ctrlKey && t.code === "KeyV" || t.metaKey && t.code === "KeyV") {
3554
3569
  this.paste();
@@ -3614,16 +3629,16 @@ class ui {
3614
3629
  this.ctx.mousedown && (this.ctx.selectorMove = !0), this.ctx.selector.enable = !0;
3615
3630
  const {
3616
3631
  SELECTOR_AREA_MIN_X: a,
3617
- SELECTOR_AREA_MAX_X: c,
3632
+ SELECTOR_AREA_MAX_X: h,
3618
3633
  SELECTOR_AREA_MIN_Y: l,
3619
3634
  SELECTOR_AREA_MAX_Y: f,
3620
3635
  SELECTOR_AREA_MAX_X_OFFSET: d,
3621
3636
  SELECTOR_AREA_MAX_Y_OFFSET: x
3622
- } = this.ctx.config, u = a, p = c || this.ctx.maxColIndex - d, g = l, w = f || this.ctx.maxRowIndex - x;
3623
- let [y, C] = r, [m, E] = o;
3624
- if (y < u || C > p || m < g || E > w)
3637
+ } = this.ctx.config, u = a, g = h || this.ctx.maxColIndex - d, w = l, p = f || this.ctx.maxRowIndex - x;
3638
+ let [y, b] = r, [m, E] = o;
3639
+ if (y < u || b > g || m < w || E > p)
3625
3640
  return;
3626
- this.ctx.selector.xArr = [Math.max(u, y), Math.min(p, C)], this.ctx.selector.yArr = [Math.max(g, m), Math.min(w, E)], this.ctx.emit("setSelector", this.ctx.selector), this.ctx.emit("drawView");
3641
+ this.ctx.selector.xArr = [Math.max(u, y), Math.min(g, b)], this.ctx.selector.yArr = [Math.max(w, m), Math.min(p, E)], this.ctx.emit("setSelector", this.ctx.selector), this.ctx.emit("drawView");
3627
3642
  }
3628
3643
  }
3629
3644
  selectCols(t) {
@@ -3637,15 +3652,15 @@ class ui {
3637
3652
  if (this.ctx.mousedown && this.ctx.focusCellHeader) {
3638
3653
  const { colIndex: a } = this.ctx.focusCellHeader;
3639
3654
  if (this.ctx.clearSelector(), t.colIndex >= a) {
3640
- const c = [a, t.colIndex + t.colspan - 1], l = [r, o];
3641
- this.setSelector(c, l);
3655
+ const h = [a, t.colIndex + t.colspan - 1], l = [r, o];
3656
+ this.setSelector(h, l);
3642
3657
  } else {
3643
- const c = [t.colIndex, a], l = [r, o];
3644
- this.setSelector(c, l);
3658
+ const h = [t.colIndex, a], l = [r, o];
3659
+ this.setSelector(h, l);
3645
3660
  }
3646
3661
  } else {
3647
- const a = [t.colIndex, t.colIndex + t.colspan - 1], c = [r, o];
3648
- this.setSelector(a, c);
3662
+ const a = [t.colIndex, t.colIndex + t.colspan - 1], h = [r, o];
3663
+ this.setSelector(a, h);
3649
3664
  }
3650
3665
  }
3651
3666
  selectAll() {
@@ -3659,9 +3674,9 @@ class ui {
3659
3674
  SELECTOR_AREA_MIN_Y: r,
3660
3675
  SELECTOR_AREA_MAX_Y: o,
3661
3676
  SELECTOR_AREA_MAX_X_OFFSET: a,
3662
- SELECTOR_AREA_MAX_Y_OFFSET: c
3663
- } = this.ctx.config, l = i, f = s || this.ctx.maxColIndex - a, d = r, x = o || this.ctx.maxRowIndex - c, u = [l, f], p = [d, x];
3664
- this.setSelector(u, p);
3677
+ 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.setSelector(u, g);
3665
3680
  }
3666
3681
  }
3667
3682
  selectRows(t, e = !0) {
@@ -3670,16 +3685,16 @@ class ui {
3670
3685
  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;
3671
3686
  if (e) {
3672
3687
  this.ctx.setFocusCell(t);
3673
- const c = [a, o], l = [t.rowIndex, t.rowIndex];
3674
- this.setSelector(c, l);
3688
+ const h = [a, o], l = [t.rowIndex, t.rowIndex];
3689
+ this.setSelector(h, l);
3675
3690
  }
3676
3691
  if (this.ctx.focusCell && this.ctx.mousedown) {
3677
- const { rowIndex: c } = this.ctx.focusCell;
3678
- if (t.rowIndex >= c) {
3679
- const l = [a, o], f = [c, t.rowIndex];
3692
+ const { rowIndex: h } = this.ctx.focusCell;
3693
+ if (t.rowIndex >= h) {
3694
+ const l = [a, o], f = [h, t.rowIndex];
3680
3695
  this.setSelector(l, f);
3681
3696
  } else {
3682
- const l = [a, o], f = [t.rowIndex, c];
3697
+ const l = [a, o], f = [t.rowIndex, h];
3683
3698
  this.setSelector(l, f);
3684
3699
  }
3685
3700
  }
@@ -3689,7 +3704,7 @@ class ui {
3689
3704
  return;
3690
3705
  const { mousedown: t, focusCell: e, hoverCell: i } = this.ctx;
3691
3706
  if (t && e && i) {
3692
- const { rowIndex: s, colIndex: r } = e, o = Math.min(i.colIndex, r), a = Math.max(i.colIndex, r), c = Math.min(i.rowIndex, s), l = Math.max(i.rowIndex, s), f = [o, a], d = [c, l];
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];
3693
3708
  this.setSelector(f, d);
3694
3709
  }
3695
3710
  }
@@ -3697,7 +3712,7 @@ class ui {
3697
3712
  const { focusCell: e, clickCell: i } = this.ctx;
3698
3713
  if (e && this.isInSettingRange(e.rowIndex, e.colIndex))
3699
3714
  if (this.ctx.selector.enable = !0, i && t) {
3700
- const { colIndex: s, rowIndex: r } = i, { colIndex: o, rowIndex: a } = e, c = Math.min(o, s), l = Math.max(o, s), f = Math.min(a, r), d = Math.max(a, r), x = [c, l], u = [f, d];
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];
3701
3716
  this.setSelector(x, u);
3702
3717
  } else {
3703
3718
  this.ctx.emit("cellSelectedClick", e);
@@ -3734,8 +3749,8 @@ class ui {
3734
3749
  let s = [];
3735
3750
  const r = /* @__PURE__ */ new Set();
3736
3751
  for (let a = 0; a <= e[1] - e[0]; a++)
3737
- for (let c = 0; c <= t[1] - t[0]; c++) {
3738
- const l = a + e[0], f = c + t[0], d = this.ctx.database.getItemValueForRowIndexAndColIndex(l, f);
3752
+ 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);
3739
3754
  if (d) {
3740
3755
  const { rowKey: x, key: u } = d;
3741
3756
  this.ctx.database.getReadonly(x, u) || (r.add(x), s.push({
@@ -3770,16 +3785,16 @@ class ui {
3770
3785
  for (let l = 0; l <= o.length - 1; l++) {
3771
3786
  const f = o[l].length;
3772
3787
  for (let d = 0; d <= f - 1; d++) {
3773
- const x = l + e, u = d + i, p = o[l][d], g = this.ctx.database.getItemValueForRowIndexAndColIndex(
3788
+ const x = l + e, u = d + i, g = o[l][d], w = this.ctx.database.getItemValueForRowIndexAndColIndex(
3774
3789
  x,
3775
3790
  u
3776
3791
  );
3777
- if (g) {
3778
- const { rowKey: w, key: y } = g;
3779
- this.ctx.database.getReadonly(w, y) || (s.add(w), a.push({
3780
- rowKey: w,
3792
+ if (w) {
3793
+ const { rowKey: p, key: y } = w;
3794
+ this.ctx.database.getReadonly(p, y) || (s.add(p), a.push({
3795
+ rowKey: p,
3781
3796
  key: y,
3782
- value: p,
3797
+ value: g,
3783
3798
  row: {}
3784
3799
  //内部有设置
3785
3800
  }));
@@ -3800,10 +3815,10 @@ class ui {
3800
3815
  if (!a.length)
3801
3816
  return;
3802
3817
  this.ctx.database.batchSetItemValue(a, !0);
3803
- let c = [];
3818
+ let h = [];
3804
3819
  s.forEach((l) => {
3805
- c.push(this.ctx.database.getRowDataItemForRowKey(l));
3806
- }), this.ctx.emit("pasteChange", a, c), this.clearCopyLine(), this.ctx.emit("drawView");
3820
+ h.push(this.ctx.database.getRowDataItemForRowKey(l));
3821
+ }), this.ctx.emit("pasteChange", a, h), this.clearCopyLine(), this.ctx.emit("drawView");
3807
3822
  }).catch((r) => {
3808
3823
  console.error("获取剪贴板内容失败:", r);
3809
3824
  });
@@ -3819,7 +3834,7 @@ class ui {
3819
3834
  if (!e)
3820
3835
  return;
3821
3836
  let { colIndex: i = 0, rowIndex: s = 0 } = e;
3822
- const r = 0, o = 0, a = this.ctx.maxColIndex, c = this.ctx.maxRowIndex;
3837
+ const r = 0, o = 0, a = this.ctx.maxColIndex, h = this.ctx.maxRowIndex;
3823
3838
  switch (t) {
3824
3839
  case "LEFT":
3825
3840
  i > r && i--;
@@ -3831,7 +3846,7 @@ class ui {
3831
3846
  i < a && i++;
3832
3847
  break;
3833
3848
  case "BOTTOM":
3834
- s < c && s++;
3849
+ s < h && s++;
3835
3850
  break;
3836
3851
  }
3837
3852
  const l = [i, i], f = [s, s], d = this.getCell(s, i);
@@ -3848,8 +3863,8 @@ class ui {
3848
3863
  SELECTOR_AREA_MIN_Y: r,
3849
3864
  SELECTOR_AREA_MAX_Y: o,
3850
3865
  SELECTOR_AREA_MAX_X_OFFSET: a,
3851
- SELECTOR_AREA_MAX_Y_OFFSET: c
3852
- } = this.ctx.config, l = i, f = s || this.ctx.maxColIndex - a, d = r, x = o || this.ctx.maxRowIndex - c;
3866
+ 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;
3853
3868
  return !(e < l || e > f || t < d || t > x);
3854
3869
  }
3855
3870
  /**
@@ -3863,7 +3878,7 @@ class ui {
3863
3878
  let a = 10 * (s === "left" ? -1 : 1);
3864
3879
  this.timerX && (clearInterval(this.timerX), this.timerX = 0), this.timerX = setInterval(() => {
3865
3880
  a *= 1.5;
3866
- const { scrollX: c } = this.ctx, l = c + a;
3881
+ const { scrollX: h } = this.ctx, l = h + a;
3867
3882
  (l < 0 || l > this.ctx.body.width) && (clearInterval(this.timerX), this.timerX = 0), this.ctx.setScrollX(l);
3868
3883
  }, 100);
3869
3884
  }
@@ -3872,7 +3887,7 @@ class ui {
3872
3887
  let a = 10 * (r === "top" ? -1 : 1);
3873
3888
  this.timerY && (clearInterval(this.timerY), this.timerY = 0), this.timerY = setInterval(() => {
3874
3889
  a *= 1.5;
3875
- const { scrollY: c } = this.ctx, l = c + a;
3890
+ const { scrollY: h } = this.ctx, l = h + a;
3876
3891
  (l < 0 || l > this.ctx.body.height) && (clearInterval(this.timerY), this.timerY = 0), this.ctx.setScrollY(l);
3877
3892
  }, 100);
3878
3893
  }
@@ -3882,23 +3897,24 @@ class ui {
3882
3897
  */
3883
3898
  adjustBoundaryPosition() {
3884
3899
  const {
3885
- target: t,
3886
- focusCell: e,
3887
- fixedRightWidth: i,
3888
- fixedLeftWidth: s,
3889
- header: r,
3890
- footer: o,
3891
- scrollX: a,
3892
- scrollY: c
3900
+ stageHeight: t,
3901
+ stageWidth: e,
3902
+ focusCell: i,
3903
+ fixedRightWidth: s,
3904
+ fixedLeftWidth: r,
3905
+ header: o,
3906
+ footer: a,
3907
+ scrollX: h,
3908
+ scrollY: l
3893
3909
  } = this.ctx;
3894
- if (!e)
3910
+ if (!i)
3895
3911
  return;
3896
- const { SCROLLER_TRACK_SIZE: l = 0, FOOTER_FIXED: f } = this.ctx.config;
3897
- let d = 0;
3898
- f && (d = o.visibleHeight);
3899
- const x = s - e.drawX + 1, u = e.drawX + e.width - (t.width - i) + 1, p = r.height - e.drawY, g = e.drawY + e.height - (t.height - d - l);
3912
+ const { SCROLLER_TRACK_SIZE: f = 0, FOOTER_FIXED: d } = this.ctx.config;
3913
+ let x = 0;
3914
+ d && (x = a.visibleHeight);
3915
+ 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);
3900
3916
  this.adjustTimer && (clearTimeout(this.adjustTimer), this.adjustTimer = 0), this.adjustTimer = setTimeout(() => {
3901
- u > 0 && !e.fixed ? this.ctx.setScrollX(a + u) : x > 0 && !e.fixed && this.ctx.setScrollX(a - x), p > 0 ? this.ctx.setScrollY(c - p) : g > 0 && this.ctx.setScrollY(c + g);
3917
+ 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);
3902
3918
  }, 167);
3903
3919
  }
3904
3920
  destroy() {
@@ -3907,20 +3923,20 @@ class ui {
3907
3923
  }
3908
3924
  class gi {
3909
3925
  constructor(t) {
3910
- h(this, "ctx");
3926
+ c(this, "ctx");
3911
3927
  this.ctx = t, this.init();
3912
3928
  }
3913
3929
  init() {
3914
3930
  this.ctx.on("cellMouseenter", (t, e) => {
3915
- this.ctx.targetContainer.style.cursor === "crosshair" && (this.ctx.targetContainer.style.cursor = "default");
3916
- const { offsetX: i, offsetY: s } = this.ctx.getOffset(e), { xArr: r, yArr: o } = this.ctx.selector, a = r[1], c = o[1], { colIndex: l, rowIndex: f, drawX: d, drawY: x, width: u, height: p } = t;
3917
- if (this.ctx.config.ENABLE_AUTOFILL && l === a && f === c) {
3918
- const w = d + u - 6, y = x + p - 6;
3919
- i > w && s > y && (this.ctx.targetContainer.style.cursor = "crosshair");
3931
+ 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) {
3934
+ const p = d + u - 6, y = x + g - 6;
3935
+ i > p && s > y && (this.ctx.stageElement.style.cursor = "crosshair");
3920
3936
  }
3921
3937
  this.mouseenter(t);
3922
3938
  }), this.ctx.on("cellMousedown", () => {
3923
- this.ctx.targetContainer.style.cursor === "crosshair" && this.setMousedown();
3939
+ this.ctx.stageElement.style.cursor === "crosshair" && this.setMousedown();
3924
3940
  }), this.ctx.on("mouseup", () => {
3925
3941
  this.setMouseUp();
3926
3942
  });
@@ -3947,26 +3963,26 @@ class gi {
3947
3963
  return;
3948
3964
  let o = t, a = e;
3949
3965
  if (!r) {
3950
- const [c] = a;
3951
- a = [c, c];
3966
+ const [h] = a;
3967
+ a = [h, h];
3952
3968
  }
3953
3969
  if (!s) {
3954
- const [c] = o;
3955
- o = [c, c];
3970
+ const [h] = o;
3971
+ o = [h, h];
3956
3972
  }
3957
3973
  if (JSON.stringify(this.ctx.autofill.xArr) !== JSON.stringify(o) || JSON.stringify(this.ctx.autofill.yArr) !== JSON.stringify(a)) {
3958
3974
  const {
3959
- SELECTOR_AREA_MIN_X: c,
3975
+ SELECTOR_AREA_MIN_X: h,
3960
3976
  SELECTOR_AREA_MAX_X: l,
3961
3977
  SELECTOR_AREA_MIN_Y: f,
3962
3978
  SELECTOR_AREA_MAX_Y: d,
3963
3979
  SELECTOR_AREA_MAX_X_OFFSET: x,
3964
3980
  SELECTOR_AREA_MAX_Y_OFFSET: u
3965
- } = this.ctx.config, p = c, g = l || this.ctx.maxColIndex - x, w = f, y = d || this.ctx.maxRowIndex - u;
3966
- let [C, m] = o, [E, b] = a;
3967
- if (C < p || E < w)
3981
+ } = this.ctx.config, g = h, w = l || this.ctx.maxColIndex - x, p = f, y = d || this.ctx.maxRowIndex - u;
3982
+ let [b, m] = o, [E, C] = a;
3983
+ if (b < g || E < p)
3968
3984
  return;
3969
- this.ctx.autofill.xArr = [Math.max(p, C), Math.min(g, m)], this.ctx.autofill.yArr = [Math.max(w, E), Math.min(y, b)], this.ctx.emit("setAutofill", this.ctx.autofill), this.ctx.emit("draw");
3985
+ this.ctx.autofill.xArr = [Math.max(g, b), Math.min(w, m)], this.ctx.autofill.yArr = [Math.max(p, E), Math.min(y, C)], this.ctx.emit("setAutofill", this.ctx.autofill), this.ctx.emit("draw");
3970
3986
  }
3971
3987
  }
3972
3988
  /**
@@ -3976,20 +3992,20 @@ class gi {
3976
3992
  const t = /* @__PURE__ */ new Set(), e = this.ctx.getSelectedData(), i = /* @__PURE__ */ new Map();
3977
3993
  for (let d = 0; d <= e.yArr[1] - e.yArr[0]; d++)
3978
3994
  for (let x = 0; x <= e.xArr[1] - e.xArr[0]; x++) {
3979
- const u = d + e.yArr[0], p = x + e.xArr[0];
3980
- i.set(`${u}-${p}`, !0);
3995
+ const u = d + e.yArr[0], g = x + e.xArr[0];
3996
+ i.set(`${u}-${g}`, !0);
3981
3997
  }
3982
- const { value: s } = e, r = s[0].length, o = s.length, a = this.ctx.autofill.xArr, c = this.ctx.autofill.yArr;
3998
+ const { value: s } = e, r = s[0].length, o = s.length, a = this.ctx.autofill.xArr, h = this.ctx.autofill.yArr;
3983
3999
  let l = [];
3984
- for (let d = 0; d <= c[1] - c[0]; d++)
4000
+ for (let d = 0; d <= h[1] - h[0]; d++)
3985
4001
  for (let x = 0; x <= a[1] - a[0]; x++) {
3986
- const u = x + a[0], p = d + c[0], g = s[d % o][x % r], w = this.ctx.database.getItemValueForRowIndexAndColIndex(p, u), y = `${p}-${u}`;
3987
- if (w && !i.has(y)) {
3988
- const { rowKey: C, key: m } = w;
3989
- this.ctx.database.getReadonly(C, m) || (t.add(C), l.push({
3990
- rowKey: C,
4002
+ 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
+ if (p && !i.has(y)) {
4004
+ const { rowKey: b, key: m } = p;
4005
+ this.ctx.database.getReadonly(b, m) || (t.add(b), l.push({
4006
+ rowKey: b,
3991
4007
  key: m,
3992
- value: g,
4008
+ value: w,
3993
4009
  row: {}
3994
4010
  }));
3995
4011
  }
@@ -4035,7 +4051,7 @@ function at(n, t) {
4035
4051
  function q(n) {
4036
4052
  return n.split("-")[0];
4037
4053
  }
4038
- function ht(n) {
4054
+ function ct(n) {
4039
4055
  return n.split("-")[1];
4040
4056
  }
4041
4057
  function re(n) {
@@ -4052,7 +4068,7 @@ function Mt(n) {
4052
4068
  }
4053
4069
  function yi(n, t, e) {
4054
4070
  e === void 0 && (e = !1);
4055
- const i = ht(n), s = Mt(n), r = Lt(s);
4071
+ const i = ct(n), s = Mt(n), r = Lt(s);
4056
4072
  let o = s === "x" ? i === (e ? "end" : "start") ? "right" : "left" : i === "start" ? "bottom" : "top";
4057
4073
  return t.reference[r] > t.floating[r] && (o = xt(o)), [o, xt(o)];
4058
4074
  }
@@ -4076,15 +4092,15 @@ function Ei(n, t, e) {
4076
4092
  return [];
4077
4093
  }
4078
4094
  }
4079
- function Ci(n, t, e, i) {
4080
- const s = ht(n);
4095
+ function bi(n, t, e, i) {
4096
+ const s = ct(n);
4081
4097
  let r = Ei(q(n), e === "start", i);
4082
4098
  return s && (r = r.map((o) => o + "-" + s), t && (r = r.concat(r.map(Ot)))), r;
4083
4099
  }
4084
4100
  function xt(n) {
4085
4101
  return n.replace(/left|right|bottom|top/g, (t) => wi[t]);
4086
4102
  }
4087
- function bi(n) {
4103
+ function Ci(n) {
4088
4104
  return {
4089
4105
  top: 0,
4090
4106
  right: 0,
@@ -4094,7 +4110,7 @@ function bi(n) {
4094
4110
  };
4095
4111
  }
4096
4112
  function oe(n) {
4097
- return typeof n != "number" ? bi(n) : {
4113
+ return typeof n != "number" ? Ci(n) : {
4098
4114
  top: n,
4099
4115
  right: n,
4100
4116
  bottom: n,
@@ -4124,9 +4140,9 @@ function Vt(n, t, e) {
4124
4140
  reference: i,
4125
4141
  floating: s
4126
4142
  } = n;
4127
- const r = J(t), o = Mt(t), a = Lt(o), c = 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;
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;
4128
4144
  let u;
4129
- switch (c) {
4145
+ switch (h) {
4130
4146
  case "top":
4131
4147
  u = {
4132
4148
  x: f,
@@ -4157,7 +4173,7 @@ function Vt(n, t, e) {
4157
4173
  y: i.y
4158
4174
  };
4159
4175
  }
4160
- switch (ht(t)) {
4176
+ switch (ct(t)) {
4161
4177
  case "start":
4162
4178
  u[o] -= x * (e && l ? -1 : 1);
4163
4179
  break;
@@ -4173,7 +4189,7 @@ const vi = async (n, t, e) => {
4173
4189
  strategy: s = "absolute",
4174
4190
  middleware: r = [],
4175
4191
  platform: o
4176
- } = e, a = r.filter(Boolean), c = await (o.isRTL == null ? void 0 : o.isRTL(t));
4192
+ } = e, a = r.filter(Boolean), h = await (o.isRTL == null ? void 0 : o.isRTL(t));
4177
4193
  let l = await o.getElementRects({
4178
4194
  reference: n,
4179
4195
  floating: t,
@@ -4181,16 +4197,16 @@ const vi = async (n, t, e) => {
4181
4197
  }), {
4182
4198
  x: f,
4183
4199
  y: d
4184
- } = Vt(l, i, c), x = i, u = {}, p = 0;
4185
- for (let g = 0; g < a.length; g++) {
4200
+ } = Vt(l, i, h), x = i, u = {}, g = 0;
4201
+ for (let w = 0; w < a.length; w++) {
4186
4202
  const {
4187
- name: w,
4203
+ name: p,
4188
4204
  fn: y
4189
- } = a[g], {
4190
- x: C,
4205
+ } = a[w], {
4206
+ x: b,
4191
4207
  y: m,
4192
4208
  data: E,
4193
- reset: b
4209
+ reset: C
4194
4210
  } = await y({
4195
4211
  x: f,
4196
4212
  y: d,
@@ -4205,20 +4221,20 @@ const vi = async (n, t, e) => {
4205
4221
  floating: t
4206
4222
  }
4207
4223
  });
4208
- f = C ?? f, d = m ?? d, u = {
4224
+ f = b ?? f, d = m ?? d, u = {
4209
4225
  ...u,
4210
- [w]: {
4211
- ...u[w],
4226
+ [p]: {
4227
+ ...u[p],
4212
4228
  ...E
4213
4229
  }
4214
- }, b && p <= 50 && (p++, typeof b == "object" && (b.placement && (x = b.placement), b.rects && (l = b.rects === !0 ? await o.getElementRects({
4230
+ }, C && g <= 50 && (g++, typeof C == "object" && (C.placement && (x = C.placement), C.rects && (l = C.rects === !0 ? await o.getElementRects({
4215
4231
  reference: n,
4216
4232
  floating: t,
4217
4233
  strategy: s
4218
- }) : b.rects), {
4234
+ }) : C.rects), {
4219
4235
  x: f,
4220
4236
  y: d
4221
- } = Vt(l, x, c)), g = -1);
4237
+ } = Vt(l, x, h)), w = -1);
4222
4238
  }
4223
4239
  return {
4224
4240
  x: f,
@@ -4237,19 +4253,19 @@ async function ne(n, t) {
4237
4253
  platform: r,
4238
4254
  rects: o,
4239
4255
  elements: a,
4240
- strategy: c
4256
+ strategy: h
4241
4257
  } = n, {
4242
4258
  boundary: l = "clippingAncestors",
4243
4259
  rootBoundary: f = "viewport",
4244
4260
  elementContext: d = "floating",
4245
4261
  altBoundary: x = !1,
4246
4262
  padding: u = 0
4247
- } = at(t, n), p = oe(u), w = a[x ? d === "floating" ? "reference" : "floating" : d], y = ut(await r.getClippingRect({
4248
- element: (e = await (r.isElement == null ? void 0 : r.isElement(w))) == null || e ? w : w.contextElement || await (r.getDocumentElement == null ? void 0 : r.getDocumentElement(a.floating)),
4263
+ } = at(t, n), g = oe(u), p = a[x ? d === "floating" ? "reference" : "floating" : d], y = ut(await r.getClippingRect({
4264
+ 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)),
4249
4265
  boundary: l,
4250
4266
  rootBoundary: f,
4251
- strategy: c
4252
- })), C = d === "floating" ? {
4267
+ strategy: h
4268
+ })), b = d === "floating" ? {
4253
4269
  x: i,
4254
4270
  y: s,
4255
4271
  width: o.floating.width,
@@ -4260,17 +4276,17 @@ async function ne(n, t) {
4260
4276
  } : {
4261
4277
  x: 1,
4262
4278
  y: 1
4263
- }, b = ut(r.convertOffsetParentRelativeRectToViewportRelativeRect ? await r.convertOffsetParentRelativeRectToViewportRelativeRect({
4279
+ }, C = ut(r.convertOffsetParentRelativeRectToViewportRelativeRect ? await r.convertOffsetParentRelativeRectToViewportRelativeRect({
4264
4280
  elements: a,
4265
- rect: C,
4281
+ rect: b,
4266
4282
  offsetParent: m,
4267
- strategy: c
4268
- }) : C);
4283
+ strategy: h
4284
+ }) : b);
4269
4285
  return {
4270
- top: (y.top - b.top + p.top) / E.y,
4271
- bottom: (b.bottom - y.bottom + p.bottom) / E.y,
4272
- left: (y.left - b.left + p.left) / E.x,
4273
- right: (b.right - y.right + p.right) / E.x
4286
+ top: (y.top - C.top + g.top) / E.y,
4287
+ bottom: (C.bottom - y.bottom + g.bottom) / E.y,
4288
+ left: (y.left - C.left + g.left) / E.x,
4289
+ right: (C.right - y.right + g.right) / E.x
4274
4290
  };
4275
4291
  }
4276
4292
  const Ri = (n) => ({
@@ -4284,7 +4300,7 @@ const Ri = (n) => ({
4284
4300
  rects: r,
4285
4301
  platform: o,
4286
4302
  elements: a,
4287
- middlewareData: c
4303
+ middlewareData: h
4288
4304
  } = t, {
4289
4305
  element: l,
4290
4306
  padding: f = 0
@@ -4294,10 +4310,10 @@ const Ri = (n) => ({
4294
4310
  const d = oe(f), x = {
4295
4311
  x: e,
4296
4312
  y: i
4297
- }, u = Mt(s), p = Lt(u), g = await o.getDimensions(l), w = u === "y", y = w ? "top" : "left", C = w ? "bottom" : "right", m = w ? "clientHeight" : "clientWidth", E = r.reference[p] + r.reference[u] - x[u] - r.floating[p], b = x[u] - r.reference[u], R = await (o.getOffsetParent == null ? void 0 : o.getOffsetParent(l));
4298
- let S = R ? R[m] : 0;
4299
- (!S || !await (o.isElement == null ? void 0 : o.isElement(R))) && (S = a.floating[m] || r.floating[p]);
4300
- const A = E / 2 - b / 2, L = S / 2 - g[p] / 2 - 1, D = rt(d[y], L), B = rt(d[C], L), I = D, T = S - g[p] - B, O = S / 2 - g[p] / 2 + A, G = It(I, O, T), Y = !c.arrow && ht(s) != null && O !== G && r.reference[p] / 2 - (O < I ? D : B) - g[p] / 2 < 0, k = Y ? O < I ? O - I : O - T : 0;
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
+ let T = R ? R[m] : 0;
4315
+ (!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;
4301
4317
  return {
4302
4318
  [u]: x[u] + k,
4303
4319
  data: {
@@ -4321,22 +4337,22 @@ const Ri = (n) => ({
4321
4337
  middlewareData: r,
4322
4338
  rects: o,
4323
4339
  initialPlacement: a,
4324
- platform: c,
4340
+ platform: h,
4325
4341
  elements: l
4326
4342
  } = t, {
4327
4343
  mainAxis: f = !0,
4328
4344
  crossAxis: d = !0,
4329
4345
  fallbackPlacements: x,
4330
4346
  fallbackStrategy: u = "bestFit",
4331
- fallbackAxisSideDirection: p = "none",
4332
- flipAlignment: g = !0,
4333
- ...w
4347
+ fallbackAxisSideDirection: g = "none",
4348
+ flipAlignment: w = !0,
4349
+ ...p
4334
4350
  } = at(n, t);
4335
4351
  if ((e = r.arrow) != null && e.alignmentOffset)
4336
4352
  return {};
4337
- const y = q(s), C = J(a), m = q(a) === a, E = await (c.isRTL == null ? void 0 : c.isRTL(l.floating)), b = x || (m || !g ? [xt(a)] : mi(a)), R = p !== "none";
4338
- !x && R && b.push(...Ci(a, g, p, E));
4339
- const S = [a, ...b], A = await ne(t, w), L = [];
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
+ !x && R && C.push(...bi(a, w, g, E));
4355
+ const T = [a, ...C], A = await ne(t, p), L = [];
4340
4356
  let D = ((i = r.flip) == null ? void 0 : i.overflows) || [];
4341
4357
  if (f && L.push(A[y]), d) {
4342
4358
  const O = yi(s, o, E);
@@ -4347,7 +4363,7 @@ const Ri = (n) => ({
4347
4363
  overflows: L
4348
4364
  }], !L.every((O) => O <= 0)) {
4349
4365
  var B, I;
4350
- const O = (((B = r.flip) == null ? void 0 : B.index) || 0) + 1, G = S[O];
4366
+ const O = (((B = r.flip) == null ? void 0 : B.index) || 0) + 1, G = T[O];
4351
4367
  if (G)
4352
4368
  return {
4353
4369
  data: {
@@ -4362,16 +4378,16 @@ const Ri = (n) => ({
4362
4378
  if (!Y)
4363
4379
  switch (u) {
4364
4380
  case "bestFit": {
4365
- var T;
4366
- const k = (T = D.filter((W) => {
4381
+ var S;
4382
+ const k = (S = D.filter((W) => {
4367
4383
  if (R) {
4368
4384
  const P = J(W.placement);
4369
- return P === C || // Create a bias to the `y` side axis due to horizontal
4385
+ return P === b || // Create a bias to the `y` side axis due to horizontal
4370
4386
  // reading directions favoring greater width.
4371
4387
  P === "y";
4372
4388
  }
4373
4389
  return !0;
4374
- }).map((W) => [W.placement, W.overflows.filter((P) => P > 0).reduce((P, ye) => P + ye, 0)]).sort((W, P) => W[1] - P[1])[0]) == null ? void 0 : T[0];
4390
+ }).map((W) => [W.placement, W.overflows.filter((P) => P > 0).reduce((P, ye) => P + ye, 0)]).sort((W, P) => W[1] - P[1])[0]) == null ? void 0 : S[0];
4375
4391
  k && (Y = k);
4376
4392
  break;
4377
4393
  }
@@ -4395,11 +4411,11 @@ async function Ii(n, t) {
4395
4411
  placement: e,
4396
4412
  platform: i,
4397
4413
  elements: s
4398
- } = n, r = await (i.isRTL == null ? void 0 : i.isRTL(s.floating)), o = q(e), a = ht(e), c = J(e) === "y", l = ["left", "top"].includes(o) ? -1 : 1, f = r && c ? -1 : 1, d = at(t, n);
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);
4399
4415
  let {
4400
4416
  mainAxis: x,
4401
4417
  crossAxis: u,
4402
- alignmentAxis: p
4418
+ alignmentAxis: g
4403
4419
  } = typeof d == "number" ? {
4404
4420
  mainAxis: d,
4405
4421
  crossAxis: 0,
@@ -4409,7 +4425,7 @@ async function Ii(n, t) {
4409
4425
  crossAxis: d.crossAxis || 0,
4410
4426
  alignmentAxis: d.alignmentAxis
4411
4427
  };
4412
- return a && typeof p == "number" && (u = a === "end" ? p * -1 : p), c ? {
4428
+ return a && typeof g == "number" && (u = a === "end" ? g * -1 : g), h ? {
4413
4429
  x: u * f,
4414
4430
  y: x * l
4415
4431
  } : {
@@ -4428,12 +4444,12 @@ const Oi = function(n) {
4428
4444
  y: r,
4429
4445
  placement: o,
4430
4446
  middlewareData: a
4431
- } = t, c = await Ii(t, n);
4447
+ } = t, h = await Ii(t, n);
4432
4448
  return o === ((e = a.offset) == null ? void 0 : e.placement) && (i = a.arrow) != null && i.alignmentOffset ? {} : {
4433
- x: s + c.x,
4434
- y: r + c.y,
4449
+ x: s + h.x,
4450
+ y: r + h.y,
4435
4451
  data: {
4436
- ...c,
4452
+ ...h,
4437
4453
  placement: o
4438
4454
  }
4439
4455
  };
@@ -4452,41 +4468,41 @@ const Oi = function(n) {
4452
4468
  mainAxis: r = !0,
4453
4469
  crossAxis: o = !1,
4454
4470
  limiter: a = {
4455
- fn: (w) => {
4471
+ fn: (p) => {
4456
4472
  let {
4457
4473
  x: y,
4458
- y: C
4459
- } = w;
4474
+ y: b
4475
+ } = p;
4460
4476
  return {
4461
4477
  x: y,
4462
- y: C
4478
+ y: b
4463
4479
  };
4464
4480
  }
4465
4481
  },
4466
- ...c
4482
+ ...h
4467
4483
  } = at(n, t), l = {
4468
4484
  x: e,
4469
4485
  y: i
4470
- }, f = await ne(t, c), d = J(q(s)), x = re(d);
4471
- let u = l[x], p = l[d];
4486
+ }, f = await ne(t, h), d = J(q(s)), x = re(d);
4487
+ let u = l[x], g = l[d];
4472
4488
  if (r) {
4473
- const w = x === "y" ? "top" : "left", y = x === "y" ? "bottom" : "right", C = u + f[w], m = u - f[y];
4474
- u = It(C, u, m);
4489
+ const p = x === "y" ? "top" : "left", y = x === "y" ? "bottom" : "right", b = u + f[p], m = u - f[y];
4490
+ u = It(b, u, m);
4475
4491
  }
4476
4492
  if (o) {
4477
- const w = d === "y" ? "top" : "left", y = d === "y" ? "bottom" : "right", C = p + f[w], m = p - f[y];
4478
- p = It(C, p, m);
4493
+ const p = d === "y" ? "top" : "left", y = d === "y" ? "bottom" : "right", b = g + f[p], m = g - f[y];
4494
+ g = It(b, g, m);
4479
4495
  }
4480
- const g = a.fn({
4496
+ const w = a.fn({
4481
4497
  ...t,
4482
4498
  [x]: u,
4483
- [d]: p
4499
+ [d]: g
4484
4500
  });
4485
4501
  return {
4486
- ...g,
4502
+ ...w,
4487
4503
  data: {
4488
- x: g.x - e,
4489
- y: g.y - i,
4504
+ x: w.x - e,
4505
+ y: w.y - i,
4490
4506
  enabled: {
4491
4507
  [x]: r,
4492
4508
  [d]: o
@@ -4522,7 +4538,7 @@ function N(n) {
4522
4538
  function zt(n) {
4523
4539
  return !gt() || typeof ShadowRoot > "u" ? !1 : n instanceof ShadowRoot || n instanceof H(n).ShadowRoot;
4524
4540
  }
4525
- function ct(n) {
4541
+ function ht(n) {
4526
4542
  const {
4527
4543
  overflow: t,
4528
4544
  overflowX: e,
@@ -4588,24 +4604,24 @@ function z(n) {
4588
4604
  );
4589
4605
  return zt(t) ? t.host : t;
4590
4606
  }
4591
- function he(n) {
4607
+ function ce(n) {
4592
4608
  const t = z(n);
4593
- return Q(t) ? n.ownerDocument ? n.ownerDocument.body : n.body : N(t) && ct(t) ? t : he(t);
4609
+ return Q(t) ? n.ownerDocument ? n.ownerDocument.body : n.body : N(t) && ht(t) ? t : ce(t);
4594
4610
  }
4595
4611
  function Tt(n, t, e) {
4596
4612
  var i;
4597
4613
  t === void 0 && (t = []), e === void 0 && (e = !0);
4598
- const s = he(n), r = s === ((i = n.ownerDocument) == null ? void 0 : i.body), o = H(s);
4614
+ const s = ce(n), r = s === ((i = n.ownerDocument) == null ? void 0 : i.body), o = H(s);
4599
4615
  if (r) {
4600
4616
  const a = St(o);
4601
- return t.concat(o, o.visualViewport || [], ct(s) ? s : [], a && e ? Tt(a) : []);
4617
+ return t.concat(o, o.visualViewport || [], ht(s) ? s : [], a && e ? Tt(a) : []);
4602
4618
  }
4603
4619
  return t.concat(s, Tt(s, [], e));
4604
4620
  }
4605
4621
  function St(n) {
4606
4622
  return n.parent && Object.getPrototypeOf(n.parent) ? n.frameElement : null;
4607
4623
  }
4608
- function ce(n) {
4624
+ function he(n) {
4609
4625
  const t = F(n);
4610
4626
  let e = parseFloat(t.width) || 0, i = parseFloat(t.height) || 0;
4611
4627
  const s = N(n), r = s ? n.offsetWidth : e, o = s ? n.offsetHeight : i, a = ft(e) !== r || ft(i) !== o;
@@ -4626,7 +4642,7 @@ function Z(n) {
4626
4642
  width: i,
4627
4643
  height: s,
4628
4644
  $: r
4629
- } = ce(t);
4645
+ } = he(t);
4630
4646
  let o = (r ? ft(e.width) : e.width) / i, a = (r ? ft(e.height) : e.height) / s;
4631
4647
  return (!o || !Number.isFinite(o)) && (o = 1), (!a || !Number.isFinite(a)) && (a = 1), {
4632
4648
  x: o,
@@ -4650,19 +4666,19 @@ function ot(n, t, e, i) {
4650
4666
  let o = V(1);
4651
4667
  t && (i ? X(i) && (o = Z(i)) : o = Z(n));
4652
4668
  const a = Mi(r, e, i) ? de(r) : V(0);
4653
- let c = (s.left + a.x) / o.x, l = (s.top + a.y) / o.y, f = s.width / o.x, d = s.height / o.y;
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;
4654
4670
  if (r) {
4655
4671
  const x = H(r), u = i && X(i) ? H(i) : i;
4656
- let p = x, g = St(p);
4657
- for (; g && i && u !== p; ) {
4658
- const w = Z(g), y = g.getBoundingClientRect(), C = F(g), m = y.left + (g.clientLeft + parseFloat(C.paddingLeft)) * w.x, E = y.top + (g.clientTop + parseFloat(C.paddingTop)) * w.y;
4659
- c *= w.x, l *= w.y, f *= w.x, d *= w.y, c += m, l += E, p = H(g), g = St(p);
4672
+ let g = x, w = St(g);
4673
+ for (; w && i && u !== g; ) {
4674
+ 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);
4660
4676
  }
4661
4677
  }
4662
4678
  return ut({
4663
4679
  width: f,
4664
4680
  height: d,
4665
- x: c,
4681
+ x: h,
4666
4682
  y: l
4667
4683
  });
4668
4684
  }
@@ -4676,20 +4692,20 @@ function Hi(n) {
4676
4692
  const r = s === "fixed", o = K(i), a = t ? wt(t.floating) : !1;
4677
4693
  if (i === o || a && r)
4678
4694
  return e;
4679
- let c = {
4695
+ let h = {
4680
4696
  scrollLeft: 0,
4681
4697
  scrollTop: 0
4682
4698
  }, l = V(1);
4683
4699
  const f = V(0), d = N(i);
4684
- if ((d || !d && !r) && ((tt(i) !== "body" || ct(o)) && (c = pt(i)), N(i))) {
4700
+ if ((d || !d && !r) && ((tt(i) !== "body" || ht(o)) && (h = pt(i)), N(i))) {
4685
4701
  const x = ot(i);
4686
4702
  l = Z(i), f.x = x.x + i.clientLeft, f.y = x.y + i.clientTop;
4687
4703
  }
4688
4704
  return {
4689
4705
  width: e.width * l.x,
4690
4706
  height: e.height * l.y,
4691
- x: e.x * l.x - c.scrollLeft * l.x + f.x,
4692
- y: e.y * l.y - c.scrollTop * l.y + f.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
4693
4709
  };
4694
4710
  }
4695
4711
  function Di(n) {
@@ -4712,25 +4728,25 @@ function Xi(n) {
4712
4728
  }
4713
4729
  function Fi(n, t) {
4714
4730
  const e = H(n), i = K(n), s = e.visualViewport;
4715
- let r = i.clientWidth, o = i.clientHeight, a = 0, c = 0;
4731
+ let r = i.clientWidth, o = i.clientHeight, a = 0, h = 0;
4716
4732
  if (s) {
4717
4733
  r = s.width, o = s.height;
4718
4734
  const l = Dt();
4719
- (!l || l && t === "fixed") && (a = s.offsetLeft, c = s.offsetTop);
4735
+ (!l || l && t === "fixed") && (a = s.offsetLeft, h = s.offsetTop);
4720
4736
  }
4721
4737
  return {
4722
4738
  width: r,
4723
4739
  height: o,
4724
4740
  x: a,
4725
- y: c
4741
+ y: h
4726
4742
  };
4727
4743
  }
4728
4744
  function ki(n, t) {
4729
- 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, c = s * r.x, l = i * r.y;
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;
4730
4746
  return {
4731
4747
  width: o,
4732
4748
  height: a,
4733
- x: c,
4749
+ x: h,
4734
4750
  y: l
4735
4751
  };
4736
4752
  }
@@ -4764,8 +4780,8 @@ function Ni(n, t) {
4764
4780
  const r = F(n).position === "fixed";
4765
4781
  let o = r ? z(n) : n;
4766
4782
  for (; X(o) && !Q(o); ) {
4767
- const a = F(o), c = Ht(o);
4768
- !c && a.position === "fixed" && (s = null), (r ? !c && !s : !c && a.position === "static" && !!s && ["absolute", "fixed"].includes(s.position) || ct(o) && !c && fe(n, o)) ? i = i.filter((f) => f !== o) : s = a, o = z(o);
4783
+ 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 && fe(n, o)) ? i = i.filter((f) => f !== o) : s = a, o = z(o);
4769
4785
  }
4770
4786
  return t.set(n, i), i;
4771
4787
  }
@@ -4776,22 +4792,22 @@ function Yi(n) {
4776
4792
  rootBoundary: i,
4777
4793
  strategy: s
4778
4794
  } = n;
4779
- const o = [...e === "clippingAncestors" ? wt(t) ? [] : Ni(t, this._c) : [].concat(e), i], a = o[0], c = o.reduce((l, f) => {
4795
+ const o = [...e === "clippingAncestors" ? wt(t) ? [] : Ni(t, this._c) : [].concat(e), i], a = o[0], h = o.reduce((l, f) => {
4780
4796
  const d = $t(t, f, s);
4781
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;
4782
4798
  }, $t(t, a, s));
4783
4799
  return {
4784
- width: c.right - c.left,
4785
- height: c.bottom - c.top,
4786
- x: c.left,
4787
- y: c.top
4800
+ width: h.right - h.left,
4801
+ height: h.bottom - h.top,
4802
+ x: h.left,
4803
+ y: h.top
4788
4804
  };
4789
4805
  }
4790
4806
  function Ki(n) {
4791
4807
  const {
4792
4808
  width: t,
4793
4809
  height: e
4794
- } = ce(n);
4810
+ } = he(n);
4795
4811
  return {
4796
4812
  width: t,
4797
4813
  height: e
@@ -4803,19 +4819,19 @@ function Bi(n, t, e) {
4803
4819
  scrollLeft: 0,
4804
4820
  scrollTop: 0
4805
4821
  };
4806
- const c = V(0);
4822
+ const h = V(0);
4807
4823
  if (i || !i && !r)
4808
- if ((tt(t) !== "body" || ct(s)) && (a = pt(t)), i) {
4824
+ if ((tt(t) !== "body" || ht(s)) && (a = pt(t)), i) {
4809
4825
  const u = ot(t, !0, r, t);
4810
- c.x = u.x + t.clientLeft, c.y = u.y + t.clientTop;
4811
- } else s && (c.x = At(s));
4826
+ h.x = u.x + t.clientLeft, h.y = u.y + t.clientTop;
4827
+ } else s && (h.x = At(s));
4812
4828
  let l = 0, f = 0;
4813
4829
  if (s && !i && !r) {
4814
4830
  const u = s.getBoundingClientRect();
4815
4831
  f = u.top + a.scrollTop, l = u.left + a.scrollLeft - // RTL <body> scrollbar.
4816
4832
  At(s, u);
4817
4833
  }
4818
- const d = o.left + a.scrollLeft - c.x - l, x = o.top + a.scrollTop - c.y - f;
4834
+ const d = o.left + a.scrollLeft - h.x - l, x = o.top + a.scrollTop - h.y - f;
4819
4835
  return {
4820
4836
  x: d,
4821
4837
  y: x,
@@ -4893,11 +4909,11 @@ const Vi = {
4893
4909
  };
4894
4910
  let $i = class {
4895
4911
  constructor(t) {
4896
- h(this, "ctx");
4897
- h(this, "enable", !1);
4898
- h(this, "contentEl");
4899
- h(this, "floatingEl");
4900
- h(this, "arrowEl");
4912
+ c(this, "ctx");
4913
+ c(this, "enable", !1);
4914
+ c(this, "contentEl");
4915
+ c(this, "floatingEl");
4916
+ c(this, "arrowEl");
4901
4917
  this.ctx = t;
4902
4918
  const { TOOLTIP_BG_COLOR: e, TOOLTIP_TEXT_COLOR: i, TOOLTIP_ZINDEX: s, TOOLTIP_CUSTOM_STYLE: r, CSS_PREFIX: o } = this.ctx.config;
4903
4919
  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`;
@@ -4912,7 +4928,7 @@ let $i = class {
4912
4928
  borderRadius: "4px",
4913
4929
  fontSize: "12px",
4914
4930
  ...r
4915
- }, c = {
4931
+ }, h = {
4916
4932
  position: "absolute",
4917
4933
  width: "10px",
4918
4934
  height: "10px",
@@ -4921,13 +4937,13 @@ let $i = class {
4921
4937
  transform: "rotate(45deg)",
4922
4938
  zIndex: a.zIndex
4923
4939
  };
4924
- Object.assign(this.arrowEl.style, c), Object.assign(this.floatingEl.style, a), this.floatingEl.appendChild(this.contentEl), this.floatingEl.appendChild(this.arrowEl), this.ctx.targetContainer.appendChild(this.floatingEl), this.init();
4940
+ Object.assign(this.arrowEl.style, h), Object.assign(this.floatingEl.style, a), this.floatingEl.appendChild(this.contentEl), this.floatingEl.appendChild(this.arrowEl), this.ctx.containerElement.appendChild(this.floatingEl), this.init();
4925
4941
  }
4926
4942
  init() {
4927
4943
  this.ctx.on("mousemove", (t) => {
4928
4944
  if (!this.ctx.isTarget())
4929
4945
  return;
4930
- const e = this.ctx.target.getBoundingClientRect();
4946
+ const e = this.ctx.containerElement.getBoundingClientRect();
4931
4947
  e && (t.clientX < e.x || t.clientX > e.x + e.width || t.clientY < e.y || t.clientY > e.y + e.height) && this.hide();
4932
4948
  }), this.ctx.on("startEdit", () => {
4933
4949
  this.hide();
@@ -4943,7 +4959,7 @@ let $i = class {
4943
4959
  this.floatingEl.style.display = "block";
4944
4960
  let e = t.getText();
4945
4961
  t.message && (e = t.message);
4946
- const i = this.ctx.target.getBoundingClientRect();
4962
+ const i = this.ctx.containerElement.getBoundingClientRect();
4947
4963
  if (!i)
4948
4964
  return;
4949
4965
  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;
@@ -4965,10 +4981,10 @@ let $i = class {
4965
4981
  placement: t.overflowTooltipPlacement,
4966
4982
  middleware: [ge(), we(), ue(6), zi({ element: this.arrowEl })]
4967
4983
  }).then((a) => {
4968
- const { x: c, y: l, placement: f, middlewareData: d } = a;
4984
+ const { x: h, y: l, placement: f, middlewareData: d } = a;
4969
4985
  if (Object.assign(this.floatingEl.style, {
4970
4986
  top: `${l}px`,
4971
- left: `${c}px`
4987
+ left: `${h}px`
4972
4988
  }), d.arrow) {
4973
4989
  const x = d.arrow;
4974
4990
  ["left", "left-start", "left-end"].includes(f) ? Object.assign(this.arrowEl.style, {
@@ -5004,11 +5020,11 @@ let $i = class {
5004
5020
  };
5005
5021
  class qi {
5006
5022
  constructor(t) {
5007
- h(this, "editorEl");
5008
- h(this, "inputEl");
5009
- h(this, "enable", !1);
5010
- h(this, "cellTarget", null);
5011
- h(this, "ctx");
5023
+ c(this, "editorEl");
5024
+ c(this, "inputEl");
5025
+ c(this, "enable", !1);
5026
+ c(this, "cellTarget", null);
5027
+ c(this, "ctx");
5012
5028
  this.ctx = t, this.initTextEditor(), this.init();
5013
5029
  }
5014
5030
  init() {
@@ -5058,26 +5074,22 @@ class qi {
5058
5074
  });
5059
5075
  }
5060
5076
  initTextEditor() {
5061
- this.inputEl = document.createElement("textarea"), this.inputEl.setAttribute("rows", "1"), this.inputEl.addEventListener("keydown", (e) => {
5077
+ this.inputEl = document.createElement("textarea"), this.inputEl.setAttribute("rows", "1"), this.inputEl.addEventListener("keydown", (t) => {
5062
5078
  if (this.enable) {
5063
- if (e.stopPropagation(), (e.altKey || e.metaKey) && e.code === "Enter") {
5064
- e.preventDefault();
5065
- const i = this.inputEl.selectionStart, s = this.inputEl.value.substring(0, i), r = this.inputEl.value.substring(i);
5066
- this.inputEl.value = s + `
5067
- ` + r, this.inputEl.selectionStart = this.inputEl.selectionEnd = i + 1;
5079
+ if (t.stopPropagation(), (t.altKey || t.metaKey) && t.code === "Enter") {
5080
+ t.preventDefault();
5081
+ const e = this.inputEl.selectionStart, i = this.inputEl.value.substring(0, e), s = this.inputEl.value.substring(e);
5082
+ this.inputEl.value = i + `
5083
+ ` + s, this.inputEl.selectionStart = this.inputEl.selectionEnd = e + 1;
5068
5084
  return;
5069
5085
  }
5070
- (e.code === "Escape" || e.code === "Enter") && (e.preventDefault(), this.inputEl.blur());
5086
+ (t.code === "Escape" || t.code === "Enter") && (t.preventDefault(), this.inputEl.blur());
5071
5087
  }
5072
5088
  }), this.inputEl.addEventListener("input", function() {
5073
5089
  this.style.height = "auto", this.style.height = `${this.scrollHeight}px`;
5074
5090
  }), this.inputEl.addEventListener("blur", () => {
5075
5091
  this.doneEdit();
5076
- }), 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.getAllEventBrowserNames().forEach((e) => {
5077
- this.editorEl.addEventListener(e, (i) => {
5078
- this.ctx.editing && i.stopPropagation();
5079
- });
5080
- }), this.ctx.targetContainer.appendChild(this.editorEl);
5092
+ }), 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);
5081
5093
  }
5082
5094
  startEditByInput(t) {
5083
5095
  if (t.editorType !== "text")
@@ -5085,9 +5097,9 @@ class qi {
5085
5097
  const e = t.getValue(), { width: i } = t, s = t.getDrawX();
5086
5098
  let r = t.getDrawY(), { height: o } = t;
5087
5099
  const { CELL_PADDING: a } = this.ctx.config;
5088
- this.editorEl.style.left = `${s}px`, this.editorEl.style.top = `${r}px`, this.inputEl.style.minWidth = `${i - 1}px`, this.inputEl.style.minHeight = `${o - 1}px`, this.inputEl.style.maxHeight = `${this.ctx.body.visibleHeight - 1}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();
5089
- const c = this.inputEl.value.length;
5090
- this.inputEl.setSelectionRange(c, c), this.inputEl.scrollHeight > o && (this.inputEl.style.height = this.inputEl.scrollHeight + "px");
5100
+ this.editorEl.style.left = `${s - 1.5}px`, this.editorEl.style.top = `${r - 1.5}px`, this.inputEl.style.minWidth = `${i - 1}px`, this.inputEl.style.minHeight = `${o - 1}px`, this.inputEl.style.maxHeight = `${this.ctx.body.visibleHeight - 1}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();
5101
+ const h = this.inputEl.value.length;
5102
+ this.inputEl.setSelectionRange(h, h), this.inputEl.scrollHeight > o && (this.inputEl.style.height = this.inputEl.scrollHeight + "px");
5091
5103
  }
5092
5104
  doneEditByInput() {
5093
5105
  if (!this.cellTarget || this.cellTarget.editorType !== "text")
@@ -5116,11 +5128,11 @@ class qi {
5116
5128
  const r = this.ctx.focusCell;
5117
5129
  if (!r || ["index", "index-selection", "selection"].includes(r.type) || this.enable)
5118
5130
  return;
5119
- const { rowKey: o, key: a } = r, c = this.ctx.database.getReadonly(o, a);
5120
- r && !c && (this.enable = !0, this.ctx.editing = !0, this.cellTarget = r, this.startEditByInput(this.cellTarget), this.ctx.emit("startEdit", this.cellTarget));
5131
+ const { rowKey: o, key: a } = r, h = this.ctx.database.getReadonly(o, a);
5132
+ r && !h && (this.enable = !0, this.ctx.editing = !0, this.cellTarget = r, this.startEditByInput(this.cellTarget), this.ctx.emit("startEdit", this.cellTarget));
5121
5133
  }
5122
5134
  doneEdit() {
5123
- this.enable && this.cellTarget && (this.ctx.emit("doneEdit", this.cellTarget), this.doneEditByInput(), this.enable = !1, this.ctx.target.focus(), this.ctx.editing = !1, this.cellTarget = null, this.ctx.emit("draw"));
5135
+ 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"));
5124
5136
  }
5125
5137
  destroy() {
5126
5138
  var t;
@@ -5129,14 +5141,14 @@ class qi {
5129
5141
  }
5130
5142
  class Gi {
5131
5143
  constructor(t) {
5132
- h(this, "ctx");
5133
- h(this, "emptyEl");
5144
+ c(this, "ctx");
5145
+ c(this, "emptyEl");
5134
5146
  this.ctx = t;
5135
5147
  const { EMPTY_TEXT: e, EMPTY_CUSTOM: i, EMPTY_CUSTOM_STYLE: s, CSS_PREFIX: r } = this.ctx.config;
5136
- this.emptyEl = document.createElement("div"), this.emptyEl.className = `${r}-empty`, this.emptyEl.style.display = "none", this.emptyEl.innerText = e, this.ctx.targetContainer.appendChild(this.emptyEl), this.ctx.on("emptyChange", ({ type: o, headerHeight: a, bodyHeight: c, footerHeight: l }) => {
5148
+ 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 }) => {
5137
5149
  if (i)
5138
5150
  return;
5139
- const f = a + (c + l) / 2, d = {
5151
+ const f = a + (h + l) / 2, d = {
5140
5152
  display: o === "empty" ? "block" : "none",
5141
5153
  position: "absolute",
5142
5154
  fontSize: "14px",
@@ -5155,7 +5167,7 @@ class Gi {
5155
5167
  }
5156
5168
  class ji {
5157
5169
  constructor(t) {
5158
- h(this, "ctx");
5170
+ c(this, "ctx");
5159
5171
  this.ctx = t;
5160
5172
  }
5161
5173
  draw() {
@@ -5170,24 +5182,25 @@ class ji {
5170
5182
  }
5171
5183
  getContainer() {
5172
5184
  const {
5173
- target: t,
5174
- config: { SCROLLER_TRACK_SIZE: e }
5175
- } = this.ctx, i = t.width - e, s = t.height - e, r = this.getHeader(), o = this.getBody(), a = this.getFooter();
5176
- let c = [r, o, a];
5177
- const { FOOTER_FIXED: l } = this.ctx.config;
5178
- return l || (c = [r, o]), {
5185
+ stageWidth: t,
5186
+ stageHeight: e,
5187
+ config: { SCROLLER_TRACK_SIZE: i }
5188
+ } = this.ctx, s = t - i, r = e - i, o = this.getHeader(), a = this.getBody(), h = this.getFooter();
5189
+ let l = [o, a, h];
5190
+ const { FOOTER_FIXED: f } = this.ctx.config;
5191
+ return f || (l = [o, a]), {
5179
5192
  style: {
5180
5193
  position: "absolute",
5181
5194
  left: "0px",
5182
5195
  top: "0px",
5183
5196
  userSelect: "none",
5184
5197
  overflow: "hidden",
5185
- width: `${i}px`,
5186
- height: `${s}px`,
5198
+ width: `${s}px`,
5199
+ height: `${r}px`,
5187
5200
  zIndex: 10
5188
5201
  },
5189
5202
  class: "e-virt-table-overlayer",
5190
- views: c
5203
+ views: l
5191
5204
  };
5192
5205
  }
5193
5206
  getHeader() {
@@ -5196,9 +5209,9 @@ class ji {
5196
5209
  fixedRightWidth: e,
5197
5210
  config: { SCROLLER_TRACK_SIZE: i, CSS_PREFIX: s }
5198
5211
  } = this.ctx, { visibleWidth: r, visibleHeight: o, renderCellHeaders: a } = this.ctx.header;
5199
- let c = [], l = [], f = [];
5200
- a.forEach((w) => {
5201
- w.render && (w.fixed === "left" ? l.push(w) : w.fixed === "right" ? f.push(w) : c.push(w));
5212
+ let h = [], l = [], f = [];
5213
+ a.forEach((p) => {
5214
+ p.render && (p.fixed === "left" ? l.push(p) : p.fixed === "right" ? f.push(p) : h.push(p));
5202
5215
  });
5203
5216
  const d = e - i, x = {
5204
5217
  key: "left",
@@ -5221,8 +5234,8 @@ class ji {
5221
5234
  width: `${r - t - d + 1}px`,
5222
5235
  height: `${o}px`
5223
5236
  },
5224
- cells: c
5225
- }, p = {
5237
+ cells: h
5238
+ }, g = {
5226
5239
  key: "right",
5227
5240
  style: {
5228
5241
  position: "absolute",
@@ -5243,21 +5256,21 @@ class ji {
5243
5256
  width: `${r}px`,
5244
5257
  height: `${o}px`
5245
5258
  },
5246
- views: [x, u, p]
5259
+ views: [x, u, g]
5247
5260
  };
5248
5261
  }
5249
5262
  getBody() {
5250
5263
  const t = [], e = [], i = [];
5251
5264
  let s = this.ctx.body.renderRows;
5252
- this.ctx.config.FOOTER_FIXED || (s = s.concat(this.ctx.footer.renderRows)), s.forEach((w) => {
5253
- w.cells.forEach((y) => {
5265
+ this.ctx.config.FOOTER_FIXED || (s = s.concat(this.ctx.footer.renderRows)), s.forEach((p) => {
5266
+ p.cells.forEach((y) => {
5254
5267
  y.cellType === "footer" && (y.render = y.renderFooter), y.render && (y.fixed === "left" ? e.push(y) : y.fixed === "right" ? i.push(y) : t.push(y));
5255
5268
  });
5256
5269
  });
5257
5270
  const {
5258
5271
  fixedLeftWidth: r,
5259
5272
  fixedRightWidth: o,
5260
- config: { SCROLLER_TRACK_SIZE: a, CSS_PREFIX: c }
5273
+ config: { SCROLLER_TRACK_SIZE: a, CSS_PREFIX: h }
5261
5274
  } = this.ctx, { visibleWidth: l, visibleHeight: f } = this.ctx.body, d = o - a, x = {
5262
5275
  key: "left",
5263
5276
  style: {
@@ -5274,13 +5287,13 @@ class ji {
5274
5287
  style: {
5275
5288
  position: "absolute",
5276
5289
  top: `${0.5}px`,
5277
- left: `${r + 0.5}px`,
5290
+ left: `${r - 0.5}px`,
5278
5291
  overflow: "hidden",
5279
5292
  width: `${l - r - d}px`,
5280
5293
  height: `${f}px`
5281
5294
  },
5282
5295
  cells: t
5283
- }, p = {
5296
+ }, g = {
5284
5297
  key: "right",
5285
5298
  style: {
5286
5299
  position: "absolute",
@@ -5294,28 +5307,28 @@ class ji {
5294
5307
  };
5295
5308
  return {
5296
5309
  type: "body",
5297
- class: `${c}-overlayer-body`,
5310
+ class: `${h}-overlayer-body`,
5298
5311
  style: {
5299
5312
  position: "relative",
5300
5313
  overflow: "hidden",
5301
5314
  width: `${l}px`,
5302
5315
  height: `${f}px`
5303
5316
  },
5304
- views: [x, u, p]
5317
+ views: [x, u, g]
5305
5318
  };
5306
5319
  }
5307
5320
  getFooter() {
5308
5321
  const t = [], e = [], i = [];
5309
- this.ctx.footer.renderRows.forEach((g) => {
5310
- g.cells.forEach((w) => {
5311
- w.cellType === "footer" && w.renderFooter && (w.render = w.renderFooter, w.fixed === "left" ? e.push(w) : w.fixed === "right" ? i.push(w) : t.push(w));
5322
+ this.ctx.footer.renderRows.forEach((w) => {
5323
+ w.cells.forEach((p) => {
5324
+ p.cellType === "footer" && p.renderFooter && (p.render = p.renderFooter, p.fixed === "left" ? e.push(p) : p.fixed === "right" ? i.push(p) : t.push(p));
5312
5325
  });
5313
5326
  });
5314
5327
  const {
5315
5328
  fixedLeftWidth: s,
5316
5329
  fixedRightWidth: r,
5317
5330
  config: { SCROLLER_TRACK_SIZE: o, CSS_PREFIX: a }
5318
- } = this.ctx, { visibleWidth: c, visibleHeight: l } = this.ctx.footer, f = r - o, d = {
5331
+ } = this.ctx, { visibleWidth: h, visibleHeight: l } = this.ctx.footer, f = r - o, d = {
5319
5332
  key: "left",
5320
5333
  style: {
5321
5334
  position: "absolute",
@@ -5331,9 +5344,9 @@ class ji {
5331
5344
  style: {
5332
5345
  position: "absolute",
5333
5346
  top: `${0.5}px`,
5334
- left: `${s + 0.5}px`,
5347
+ left: `${s - 0.5}px`,
5335
5348
  overflow: "hidden",
5336
- width: `${c - s - f}px`,
5349
+ width: `${h - s - f}px`,
5337
5350
  height: `${l}px`
5338
5351
  },
5339
5352
  cells: t
@@ -5355,7 +5368,7 @@ class ji {
5355
5368
  style: {
5356
5369
  position: "relative",
5357
5370
  overflow: "hidden",
5358
- width: `${c}px`,
5371
+ width: `${h}px`,
5359
5372
  height: `${l}px`
5360
5373
  },
5361
5374
  views: [d, x, u]
@@ -5364,16 +5377,16 @@ class ji {
5364
5377
  }
5365
5378
  class Ui {
5366
5379
  constructor(t) {
5367
- h(this, "ctx");
5368
- h(this, "contextMenuEl");
5380
+ c(this, "ctx");
5381
+ c(this, "contextMenuEl");
5369
5382
  this.ctx = t, this.contextMenuEl = document.createElement("div"), this.createContextMenu(), this.init();
5370
5383
  }
5371
5384
  init() {
5372
5385
  this.ctx.on("cellContextMenuClick", (t, e) => {
5373
5386
  if (!this.ctx.config.ENABLE_CONTEXT_MENU) return;
5374
5387
  e.preventDefault();
5375
- const { xArr: i, yArr: s } = this.ctx.selector, [r, o] = i, [a, c] = s, { rowIndex: l, colIndex: f } = t;
5376
- l >= a && l <= c && f >= r && f <= o || this.ctx.emit("setSelectorCell", t, e);
5388
+ const { xArr: i, yArr: s } = this.ctx.selector, [r, o] = i, [a, h] = s, { rowIndex: l, colIndex: f } = t;
5389
+ l >= a && l <= h && f >= r && f <= o || this.ctx.emit("setSelectorCell", t, e);
5377
5390
  const x = {
5378
5391
  getBoundingClientRect: () => ({
5379
5392
  width: 0,
@@ -5390,14 +5403,14 @@ class Ui {
5390
5403
  pe(x, this.contextMenuEl, {
5391
5404
  placement: "right-start",
5392
5405
  middleware: [ue(), ge(), we()]
5393
- }).then(({ x: u, y: p }) => {
5394
- this.show(u, p);
5406
+ }).then(({ x: u, y: g }) => {
5407
+ this.show(u, g);
5395
5408
  });
5396
5409
  }), this.ctx.on("click", this.hide.bind(this)), this.ctx.on("onScroll", this.hide.bind(this)), this.ctx.on("resize", this.hide.bind(this));
5397
5410
  }
5398
5411
  //创建右键菜单,绑定子项点击事件
5399
5412
  createContextMenu() {
5400
- this.contextMenuEl.replaceChildren(), this.contextMenuEl.className = "e-virt-table-context-menu", this.ctx.targetContainer.appendChild(this.contextMenuEl);
5413
+ this.contextMenuEl.replaceChildren(), this.contextMenuEl.className = "e-virt-table-context-menu", this.ctx.containerElement.appendChild(this.contextMenuEl);
5401
5414
  const { CONTEXT_MENU: t } = this.ctx.config;
5402
5415
  this.createContextMenuItems(t, (e) => {
5403
5416
  switch (e.value) {
@@ -5447,27 +5460,37 @@ class Ui {
5447
5460
  }
5448
5461
  class Qi {
5449
5462
  constructor(t, e) {
5450
- h(this, "targetContainer");
5451
- h(this, "target");
5452
- h(this, "options");
5453
- h(this, "scroller");
5454
- h(this, "header");
5455
- h(this, "body");
5456
- h(this, "footer");
5457
- h(this, "selector");
5458
- h(this, "autofill");
5459
- h(this, "tooltip");
5460
- h(this, "editor");
5461
- h(this, "empty");
5462
- h(this, "overlayer");
5463
- h(this, "contextMenu");
5464
- h(this, "ctx");
5465
- this.target = document.createElement("canvas"), this.targetContainer = t, this.targetContainer.className = "e-virt-table-container", this.targetContainer.appendChild(this.target), this.options = e, this.ctx = new ci(this.targetContainer, this.target, 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", () => {
5463
+ c(this, "options");
5464
+ c(this, "scroller");
5465
+ c(this, "header");
5466
+ c(this, "body");
5467
+ c(this, "footer");
5468
+ c(this, "selector");
5469
+ c(this, "autofill");
5470
+ c(this, "tooltip");
5471
+ c(this, "editor");
5472
+ c(this, "empty");
5473
+ c(this, "overlayer");
5474
+ c(this, "contextMenu");
5475
+ c(this, "ctx");
5476
+ this.options = e;
5477
+ const { overlayerElement: i } = e, s = this.createContainer(t, i);
5478
+ 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", () => {
5466
5479
  this.draw();
5467
5480
  }), this.ctx.on("drawView", () => {
5468
5481
  this.draw(!0);
5469
5482
  }), this.draw();
5470
5483
  }
5484
+ createContainer(t, e) {
5485
+ t.className = "e-virt-table-container";
5486
+ const i = document.createElement("div"), s = document.createElement("canvas"), r = e || document.createElement("div");
5487
+ 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), {
5488
+ containerElement: t,
5489
+ stageElement: i,
5490
+ canvasElement: s,
5491
+ overlayerElement: r
5492
+ };
5493
+ }
5471
5494
  draw(t = !1) {
5472
5495
  requestAnimationFrame(() => {
5473
5496
  this.header.update(), this.footer.update(), this.body.update(), this.ctx.paint.clear(), this.body.draw(), this.footer.draw(), this.header.draw(), this.scroller.draw(), t || this.overlayer.draw();
@@ -5530,8 +5553,8 @@ class Qi {
5530
5553
  if (t && Array.isArray(s) && s.length) {
5531
5554
  const [r] = s;
5532
5555
  if (Array.isArray(r) && r.length) {
5533
- const [o] = r, { rowKey: a, key: c } = o;
5534
- this.scrollToRowkey(a), this.scrollToColkey(c);
5556
+ const [o] = r, { rowKey: a, key: h } = o;
5557
+ this.scrollToRowkey(a), this.scrollToColkey(h);
5535
5558
  }
5536
5559
  }
5537
5560
  i(s);
@@ -5556,7 +5579,7 @@ class Qi {
5556
5579
  let r = [];
5557
5580
  for (let o = 0; o < i.length; o++)
5558
5581
  for (let a = 0; a < s.length; a++) {
5559
- const c = this.ctx.database.getRowKeyByItem(i[o]), f = s[a].key, d = await this.ctx.database.getValidator(c, f);
5582
+ const h = this.ctx.database.getRowKeyByItem(i[o]), f = s[a].key, d = await this.ctx.database.getValidator(h, f);
5560
5583
  Array.isArray(d) && d.length && r.push(d);
5561
5584
  }
5562
5585
  r.length ? (e(r), this.ctx.emit("draw")) : (t([]), this.ctx.emit("draw"));
@@ -5626,7 +5649,7 @@ class Qi {
5626
5649
  * 销毁
5627
5650
  */
5628
5651
  destroy() {
5629
- this.overlayer.destroy(), this.empty.destroy(), this.editor.destroy(), this.tooltip.destroy(), this.selector.destroy(), this.autofill.destroy(), this.contextMenu.destroy(), this.ctx.destroy(), this.target.remove();
5652
+ this.overlayer.destroy(), this.empty.destroy(), this.editor.destroy(), this.tooltip.destroy(), this.selector.destroy(), this.autofill.destroy(), this.contextMenu.destroy(), this.ctx.destroy(), this.ctx.containerElement.remove();
5630
5653
  }
5631
5654
  }
5632
5655
  export {