e-virt-table 1.1.1 → 1.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.es.js CHANGED
@@ -1,7 +1,7 @@
1
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;box-sizing:border-box;z-index:10;border-radius:8px;border:1px solid var(--e-virt-table-border-color)}.e-virt-table-canvas{position:absolute;left:0;top:0;box-sizing:border-box;border:none;outline:none;z-index:10}.e-virt-table-editor{position:absolute;top:-10000px;left:-10000px;text-align:left;height:auto;line-height:0;z-index:100;overflow:hidden;background-color:var(--e-virt-table-editor-bg-color);border:2px solid var(--e-virt-table-color-primary);box-sizing:border-box;box-shadow:var(--e-virt-table-box-shadow);display:flex;align-items:center}.e-virt-table-overlayer{position:absolute;left:0;top:0;overflow:hidden;z-index:100;pointer-events:none}.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
- var Ce = Object.defineProperty;
3
- var be = (a, t, e) => t in a ? Ce(a, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : a[t] = e;
4
- var l = (a, t, e) => be(a, typeof t != "symbol" ? t + "" : t, e);
2
+ var be = Object.defineProperty;
3
+ var Ce = (a, t, e) => t in a ? be(a, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : a[t] = e;
4
+ var l = (a, t, e) => Ce(a, typeof t != "symbol" ? t + "" : t, e);
5
5
  function G() {
6
6
  return G = Object.assign ? Object.assign.bind() : function(a) {
7
7
  for (var t = 1; t < arguments.length; t++) {
@@ -46,9 +46,9 @@ function dt(a, t, e) {
46
46
  function Ie(a) {
47
47
  return Function.toString.call(a).indexOf("[native code]") !== -1;
48
48
  }
49
- function Ct(a) {
49
+ function bt(a) {
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 || !Ie(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(a) {
67
67
  configurable: !0
68
68
  }
69
69
  }), st(s, i);
70
- }, Ct(a);
70
+ }, bt(a);
71
71
  }
72
72
  var _e = /%[sdj%]/g, jt = 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(a) {
79
+ function Ct(a) {
80
80
  if (!a || !a.length) return null;
81
81
  var t = {};
82
82
  return a.forEach(function(e) {
@@ -156,12 +156,12 @@ var kt = /* @__PURE__ */ function(a) {
156
156
  return s = a.call(this, "Async Validation Error") || this, s.errors = e, s.fields = i, s;
157
157
  }
158
158
  return t;
159
- }(/* @__PURE__ */ Ct(Error));
160
- function Te(a, t, e, i, s) {
159
+ }(/* @__PURE__ */ bt(Error));
160
+ function Le(a, t, e, i, s) {
161
161
  if (t.first) {
162
162
  var r = new Promise(function(x, u) {
163
163
  var p = function(y) {
164
- return i(y), y.length ? u(new kt(y, bt(y))) : x(s);
164
+ return i(y), y.length ? u(new kt(y, Ct(y))) : x(s);
165
165
  }, g = Ae(a);
166
166
  Xt(g, e, p);
167
167
  });
@@ -172,7 +172,7 @@ function Te(a, t, e, i, s) {
172
172
  var o = t.firstFields === !0 ? Object.keys(a) : t.firstFields || [], n = Object.keys(a), h = n.length, c = 0, d = [], f = new Promise(function(x, u) {
173
173
  var p = function(w) {
174
174
  if (d.push.apply(d, w), c++, c === h)
175
- return i(d), d.length ? u(new kt(d, bt(d))) : x(s);
175
+ return i(d), d.length ? u(new kt(d, Ct(d))) : x(s);
176
176
  };
177
177
  n.length || (i(d), x(s)), n.forEach(function(g) {
178
178
  var w = a[g];
@@ -183,7 +183,7 @@ function Te(a, t, e, i, s) {
183
183
  return x;
184
184
  }), f;
185
185
  }
186
- function Le(a) {
186
+ function Te(a) {
187
187
  return !!(a && a.message !== void 0);
188
188
  }
189
189
  function Me(a, t) {
@@ -197,7 +197,7 @@ function Me(a, t) {
197
197
  function Nt(a, t) {
198
198
  return function(e) {
199
199
  var i;
200
- return a.fullFields ? i = Me(t, a.fullFields) : i = t[e.field || a.fullField], Le(e) ? (e.field = e.field || a.fullField, e.fieldValue = i, e) : {
200
+ return a.fullFields ? i = Me(t, a.fullFields) : i = t[e.field || a.fullField], Te(e) ? (e.field = e.field || a.fullField, e.fieldValue = i, e) : {
201
201
  message: typeof e == "function" ? e() : e,
202
202
  fieldValue: i,
203
203
  field: e.field || a.fullField
@@ -221,8 +221,8 @@ var Ut = function(t, e, i, s, r, o) {
221
221
  }, ct, De = function() {
222
222
  if (ct)
223
223
  return ct;
224
- var a = "[a-fA-F\\d:]", t = function(C) {
225
- return C && C.includeBoundaries ? "(?:(?<=\\s|^)(?=" + a + ")|(?<=" + a + ")(?=\\s|$))" : "";
224
+ var a = "[a-fA-F\\d:]", t = function(b) {
225
+ return b && b.includeBoundaries ? "(?:(?<=\\s|^)(?=" + a + ")|(?<=" + a + ")(?=\\s|$))" : "";
226
226
  }, e = "(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)){3}", i = "[a-fA-F\\d]{1,4}", s = (`
227
227
  (?:
228
228
  (?:` + i + ":){7}(?:" + i + `|:)| // 1:2:3:4:5:6:7:: 1:2:3:4:5:6:7:8
@@ -234,8 +234,8 @@ var Ut = 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 + "$"), n = new RegExp("^" + s + "$"), h = function(C) {
238
- return C && C.exact ? r : new RegExp("(?:" + t(C) + e + t(C) + ")|(?:" + t(C) + s + t(C) + ")", "g");
237
+ `).replace(/\s*\/\/.*$/gm, "").replace(/\n/g, "").trim(), r = new RegExp("(?:^" + e + "$)|(?:^" + s + "$)"), o = new RegExp("^" + e + "$"), n = new RegExp("^" + s + "$"), h = function(b) {
238
+ return b && b.exact ? r : new RegExp("(?:" + t(b) + e + t(b) + ")|(?:" + t(b) + s + t(b) + ")", "g");
239
239
  };
240
240
  h.v4 = function(m) {
241
241
  return m && m.exact ? o : new RegExp("" + t(m) + e + t(m), "g");
@@ -538,16 +538,16 @@ var Rt = vt(), nt = /* @__PURE__ */ function() {
538
538
  return c && c(null, n), Promise.resolve(n);
539
539
  function d(g) {
540
540
  var w = [], y = {};
541
- function E(C) {
542
- if (Array.isArray(C)) {
543
- var b;
544
- w = (b = w).concat.apply(b, C);
541
+ function E(b) {
542
+ if (Array.isArray(b)) {
543
+ var C;
544
+ w = (C = w).concat.apply(C, b);
545
545
  } else
546
- w.push(C);
546
+ w.push(b);
547
547
  }
548
548
  for (var m = 0; m < g.length; m++)
549
549
  E(g[m]);
550
- w.length ? (y = bt(w), c(w, y)) : c(null, n);
550
+ w.length ? (y = Ct(w), c(w, y)) : c(null, n);
551
551
  }
552
552
  if (h.messages) {
553
553
  var f = this.messages();
@@ -570,7 +570,7 @@ var Rt = vt(), nt = /* @__PURE__ */ function() {
570
570
  });
571
571
  });
572
572
  var p = {};
573
- return Te(x, h, function(g, w) {
573
+ return Le(x, h, function(g, w) {
574
574
  var y = g.rule, E = (y.type === "object" || y.type === "array") && (typeof y.fields == "object" || typeof y.defaultField == "object");
575
575
  E = E && (y.required || !y.required && g.value), y.field = g.field;
576
576
  function m(R, S) {
@@ -579,7 +579,7 @@ var Rt = vt(), nt = /* @__PURE__ */ function() {
579
579
  fullFields: y.fullFields ? [].concat(y.fullFields, [R]) : [R]
580
580
  });
581
581
  }
582
- function C(R) {
582
+ function b(R) {
583
583
  R === void 0 && (R = []);
584
584
  var S = Array.isArray(R) ? R : [R];
585
585
  !h.suppressWarning && S.length && a.warning("async-validator:", S), S.length && y.message !== void 0 && (S = [].concat(y.message));
@@ -597,33 +597,33 @@ var Rt = vt(), nt = /* @__PURE__ */ function() {
597
597
  }), I = G({}, I, g.rule.fields);
598
598
  var v = {};
599
599
  Object.keys(I).forEach(function(O) {
600
- var M = I[O], L = Array.isArray(M) ? M : [M];
601
- v[O] = L.map(m.bind(null, O));
600
+ var M = I[O], T = Array.isArray(M) ? M : [M];
601
+ v[O] = T.map(m.bind(null, O));
602
602
  });
603
- var T = new a(v);
604
- T.messages(h.messages), g.rule.options && (g.rule.options.messages = h.messages, g.rule.options.error = h.error), T.validate(g.value, g.rule.options || h, function(O) {
603
+ var L = new a(v);
604
+ L.messages(h.messages), g.rule.options && (g.rule.options.messages = h.messages, g.rule.options.error = h.error), L.validate(g.value, g.rule.options || h, function(O) {
605
605
  var M = [];
606
606
  A && A.length && M.push.apply(M, A), O && O.length && M.push.apply(M, O), w(M.length ? M : 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, C, g.source, h);
612
+ C = y.asyncValidator(y, g.value, b, g.source, h);
613
613
  else if (y.validator) {
614
614
  try {
615
- b = y.validator(y, g.value, C, g.source, h);
615
+ C = y.validator(y, g.value, b, g.source, h);
616
616
  } catch (R) {
617
617
  console.error == null || console.error(R), h.suppressValidatorError || setTimeout(function() {
618
618
  throw R;
619
- }, 0), C(R.message);
619
+ }, 0), b(R.message);
620
620
  }
621
- b === !0 ? C() : b === !1 ? C(typeof y.message == "function" ? y.message(y.fullField || y.field) : y.message || (y.fullField || y.field) + " fails") : b instanceof Array ? C(b) : b instanceof Error && C(b.message);
621
+ C === !0 ? b() : C === !1 ? b(typeof y.message == "function" ? y.message(y.fullField || y.field) : y.message || (y.fullField || y.field) + " fails") : C instanceof Array ? b(C) : C instanceof Error && b(C.message);
622
622
  }
623
- b && b.then && b.then(function() {
624
- return C();
623
+ C && C.then && C.then(function() {
624
+ return b();
625
625
  }, function(R) {
626
- return C(R);
626
+ return b(R);
627
627
  });
628
628
  }, function(g) {
629
629
  d(g);
@@ -843,7 +843,7 @@ class se {
843
843
  getRightFixedX() {
844
844
  }
845
845
  }
846
- class Lt extends se {
846
+ class Tt extends se {
847
847
  constructor(e, i, s, r, o, n, h, c, d, f = "body") {
848
848
  super(e, r, o, n, h, f, c.fixed);
849
849
  l(this, "formatter");
@@ -1048,14 +1048,14 @@ class Lt extends se {
1048
1048
  if (this.cellType === "footer") {
1049
1049
  let y = n, E = o;
1050
1050
  if (typeof r == "function") {
1051
- const m = r, { backgroundColor: C, color: b } = m({
1051
+ const m = r, { backgroundColor: b, color: C } = m({
1052
1052
  row: this.row,
1053
1053
  rowIndex: this.rowIndex,
1054
1054
  colIndex: this.colIndex,
1055
1055
  column: this.column,
1056
1056
  value: this.getValue()
1057
1057
  }) || {};
1058
- C && (y = C), b && (E = b);
1058
+ b && (y = b), C && (E = C);
1059
1059
  }
1060
1060
  this.drawCellSkyBgColor = "transparent", this.drawCellBgColor = y, this.drawTextColor = E;
1061
1061
  return;
@@ -1297,7 +1297,7 @@ class Lt extends se {
1297
1297
  const { drawX: i, drawY: s, width: r, rowIndex: o, colIndex: n } = this;
1298
1298
  let h = i + 0.5, c = s + 0.5, d = this.height;
1299
1299
  o === 0 && (c = this.y + 1, d = d - 1), n === this.ctx.maxColIndex && (h = h - 1);
1300
- const { xArr: f, yArr: x, lineDash: u = [], borderWidth: p = 1, borderColor: g, fillColor: w } = e, y = f[0], E = f[1], m = x[0], C = x[1];
1300
+ const { xArr: f, yArr: x, lineDash: u = [], borderWidth: p = 1, borderColor: g, fillColor: w } = e, y = f[0], E = f[1], m = x[0], b = x[1];
1301
1301
  n >= y && n <= E && o === m && this.ctx.paint.drawLine([h, c, h + r - 2, c], {
1302
1302
  borderColor: g,
1303
1303
  fillColor: w,
@@ -1305,21 +1305,21 @@ class Lt extends se {
1305
1305
  lineCap: "round",
1306
1306
  lineJoin: "round",
1307
1307
  lineDash: u
1308
- }), n >= y && n <= E && o === C && this.ctx.paint.drawLine([h, c + d - 1.5, h + r, c + d - 1.5], {
1308
+ }), n >= y && n <= E && o === b && this.ctx.paint.drawLine([h, c + d - 1.5, h + r, c + d - 1.5], {
1309
1309
  borderColor: g,
1310
1310
  fillColor: w,
1311
1311
  borderWidth: p,
1312
1312
  lineCap: "round",
1313
1313
  lineJoin: "round",
1314
1314
  lineDash: u
1315
- }), n === y && o >= m && o <= C && this.ctx.paint.drawLine([h, c, h, c + d - 1], {
1315
+ }), n === y && o >= m && o <= b && this.ctx.paint.drawLine([h, c, h, c + d - 1], {
1316
1316
  borderColor: g,
1317
1317
  fillColor: w,
1318
1318
  borderWidth: p,
1319
1319
  lineCap: "round",
1320
1320
  lineJoin: "round",
1321
1321
  lineDash: u
1322
- }), n === E && o >= m && o <= C && this.ctx.paint.drawLine([h + r - 1.5, c, h + r - 1.5, c + d - 1.5], {
1322
+ }), n === E && o >= m && o <= b && this.ctx.paint.drawLine([h + r - 1.5, c, h + r - 1.5, c + d - 1.5], {
1323
1323
  borderColor: g,
1324
1324
  fillColor: w,
1325
1325
  borderWidth: p,
@@ -2049,16 +2049,16 @@ class ni {
2049
2049
  }
2050
2050
  ]
2051
2051
  };
2052
- let w = e, y = e, E = n, m = n, C = [], b = 0, R = 0, S = 0, A = 0;
2052
+ let w = e, y = e, E = n, m = n, b = [], C = 0, R = 0, S = 0, A = 0;
2053
2053
  if (d !== 1 && p) {
2054
2054
  A = x;
2055
- const I = h.reduce((v, T) => {
2056
- const O = this.getItemValue(s, T) ?? "";
2055
+ const I = h.reduce((v, L) => {
2056
+ const O = this.getItemValue(s, L) ?? "";
2057
2057
  return `${v}${O}`;
2058
2058
  }, "");
2059
2059
  for (let v = e - 1; v >= 0; v--) {
2060
- const T = this.rowIndexRowKeyMap.get(v) || "", O = h.reduce((M, L) => {
2061
- const N = this.getItemValue(T, L) ?? "";
2060
+ const L = this.rowIndexRowKeyMap.get(v) || "", O = h.reduce((M, T) => {
2061
+ const N = this.getItemValue(L, T) ?? "";
2062
2062
  return `${M}${N}`;
2063
2063
  }, "");
2064
2064
  if (I === O)
@@ -2067,8 +2067,8 @@ class ni {
2067
2067
  break;
2068
2068
  }
2069
2069
  for (let v = e; v <= this.ctx.maxRowIndex; v++) {
2070
- const T = this.rowIndexRowKeyMap.get(v) || "", O = h.reduce((M, L) => {
2071
- const N = this.getItemValue(T, L) ?? "";
2070
+ const L = this.rowIndexRowKeyMap.get(v) || "", O = h.reduce((M, T) => {
2071
+ const N = this.getItemValue(L, T) ?? "";
2072
2072
  return `${M}${N}`;
2073
2073
  }, "");
2074
2074
  if (I === O)
@@ -2077,17 +2077,17 @@ class ni {
2077
2077
  break;
2078
2078
  }
2079
2079
  for (let v = w; v < e; v++) {
2080
- const { height: T } = this.positions[v];
2081
- b += T;
2080
+ const { height: L } = this.positions[v];
2081
+ C += L;
2082
2082
  }
2083
2083
  for (let v = w; v <= y; v++) {
2084
- const { height: T } = this.positions[v];
2085
- S += T;
2086
- const O = this.rowIndexRowKeyMap.get(v) || "", { item: M } = this.rowKeyMap.get(O), L = this.getItemValue(O, i);
2087
- C.push({
2084
+ const { height: L } = this.positions[v];
2085
+ S += L;
2086
+ const O = this.rowIndexRowKeyMap.get(v) || "", { item: M } = this.rowKeyMap.get(O), T = this.getItemValue(O, i);
2087
+ b.push({
2088
2088
  rowKey: O,
2089
2089
  key: i,
2090
- value: L,
2090
+ value: T,
2091
2091
  row: M
2092
2092
  });
2093
2093
  }
@@ -2098,8 +2098,8 @@ class ni {
2098
2098
  const v = this.getColumnByColIndex(I);
2099
2099
  if (!v)
2100
2100
  break;
2101
- const T = this.getItemValue(s, i), O = this.getItemValue(s, v.key);
2102
- if (T === O && c.includes(v.key))
2101
+ const L = this.getItemValue(s, i), O = this.getItemValue(s, v.key);
2102
+ if (L === O && c.includes(v.key))
2103
2103
  E = I;
2104
2104
  else
2105
2105
  break;
@@ -2108,8 +2108,8 @@ class ni {
2108
2108
  const v = this.getColumnByColIndex(I);
2109
2109
  if (!v)
2110
2110
  break;
2111
- const T = this.getItemValue(s, i), O = this.getItemValue(s, v.key);
2112
- if (T === O && c.includes(v.key))
2111
+ const L = this.getItemValue(s, i), O = this.getItemValue(s, v.key);
2112
+ if (L === O && c.includes(v.key))
2113
2113
  m = I;
2114
2114
  else
2115
2115
  break;
@@ -2124,7 +2124,7 @@ class ni {
2124
2124
  const v = this.getColumnByColIndex(I);
2125
2125
  if (!v)
2126
2126
  break;
2127
- A += v.width || 100, C.push({
2127
+ A += v.width || 100, b.push({
2128
2128
  rowKey: s,
2129
2129
  key: v.key,
2130
2130
  value: this.getItemValue(s, v.key),
@@ -2139,9 +2139,9 @@ class ni {
2139
2139
  colspan: u,
2140
2140
  height: S,
2141
2141
  width: A,
2142
- offsetTop: b,
2142
+ offsetTop: C,
2143
2143
  offsetLeft: R,
2144
- dataList: C
2144
+ dataList: b
2145
2145
  };
2146
2146
  }
2147
2147
  setLoading(t) {
@@ -2173,7 +2173,7 @@ class ni {
2173
2173
  // 获取虚拟单元格
2174
2174
  getVirtualBodyCell(t, e) {
2175
2175
  const i = this.getColumnByColIndex(e), s = this.getRowForRowIndex(t);
2176
- return !i || !s ? void 0 : new Lt(this.ctx, t, e, 0, 0, 0, 0, i, s, "body");
2176
+ return !i || !s ? void 0 : new Tt(this.ctx, t, e, 0, 0, 0, 0, i, s, "body");
2177
2177
  }
2178
2178
  hasMergeCell(t, e) {
2179
2179
  let i = !1;
@@ -2250,9 +2250,7 @@ class li {
2250
2250
  this.ctx = t, this.init();
2251
2251
  }
2252
2252
  init() {
2253
- this.bind(window, "resize", this.handleResize.bind(this)), this.bind(window, "mouseup", this.handleMouseUp.bind(this)), this.bind(window, "mousemove", this.handleMousemove.bind(this)), this.bind(window, "mousedown", (t) => {
2254
- this.ctx.containerElement.contains(t.target) || this.ctx.emit("outsideMousedown", t);
2255
- }), 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, "touchstart", this.handleTouchstart.bind(this)), this.bind(this.ctx.stageElement, "touchend", this.handleTouchend.bind(this)), this.bind(this.ctx.stageElement, "touchmove", this.handleTouchmove.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, "dblclick", this.handleDblclick.bind(this)), this.bind(this.ctx.stageElement, "mouseover", this.handleMouseover.bind(this)), this.bind(this.ctx.stageElement, "mouseout", this.handleMouseout.bind(this));
2253
+ this.bind(window, "resize", this.handleResize.bind(this)), this.bind(window, "mouseup", this.handleMouseUp.bind(this)), this.bind(window, "mousemove", this.handleMousemove.bind(this)), this.bind(window, "blur", this.handleOutsideMousedown.bind(this)), this.bind(window, "mousedown", this.handleOutsideMousedown.bind(this)), this.bind(this.ctx.stageElement, "click", this.handleClick.bind(this)), this.bind(window, "keydown", this.handleKeydown.bind(this)), this.bind(this.ctx.stageElement, "wheel", this.handleWheel.bind(this)), this.bind(this.ctx.stageElement, "touchstart", this.handleTouchstart.bind(this)), this.bind(this.ctx.stageElement, "touchend", this.handleTouchend.bind(this)), this.bind(this.ctx.stageElement, "touchmove", this.handleTouchmove.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, "dblclick", this.handleDblclick.bind(this)), this.bind(this.ctx.stageElement, "mouseover", this.handleMouseover.bind(this)), this.bind(this.ctx.stageElement, "mouseout", this.handleMouseout.bind(this));
2256
2254
  }
2257
2255
  destroy() {
2258
2256
  this.eventTasks.forEach((t, e) => {
@@ -2302,6 +2300,9 @@ class li {
2302
2300
  handleDblclick(t) {
2303
2301
  this.ctx.emit("dblclick", t);
2304
2302
  }
2303
+ handleOutsideMousedown(t) {
2304
+ this.ctx.selector.enable && (t.target instanceof Window || t.target instanceof Node && !this.ctx.containerElement.contains(t.target)) && this.ctx.emit("outsideMousedown", t);
2305
+ }
2305
2306
  bind(t, e, i, s) {
2306
2307
  t.addEventListener(e, i, s), this.eventTasks.set(e, i);
2307
2308
  }
@@ -2972,7 +2973,7 @@ class fi {
2972
2973
  */
2973
2974
  imageEnterAndLeave(t, e) {
2974
2975
  const { offsetY: i, offsetX: s } = this.ctx.getOffset(e), r = i, o = s;
2975
- 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 Lt && ["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"));
2976
+ 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 Tt && ["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"));
2976
2977
  }
2977
2978
  isBusy(t) {
2978
2979
  const { offsetY: e, offsetX: i } = this.ctx.getOffset(t), s = e, r = i;
@@ -3305,11 +3306,7 @@ class Pt {
3305
3306
  }
3306
3307
  onMouseMove(t) {
3307
3308
  const { offsetX: e, offsetY: i, clientX: s, clientY: r, buttons: o } = t;
3308
- if (o === 0) {
3309
- this.onMouseUp();
3310
- return;
3311
- }
3312
- if (this.isOnScrollbar(e, i) && t.target === this.ctx.canvasElement ? this.isFocus = !0 : this.isFocus = !1, s == this.clientX && r == this.clientY) return;
3309
+ if (this.isOnScrollbar(e, i) && t.target === this.ctx.canvasElement ? this.isFocus = !0 : this.isFocus = !1, o === 0 || s == this.clientX && r == this.clientY) return;
3313
3310
  let n = 0;
3314
3311
  if (this.type === "horizontal" ? n = s - this.clientX : n = r - this.clientY, this.isDragging && n !== 0) {
3315
3312
  let h = 0;
@@ -3524,6 +3521,10 @@ class gi {
3524
3521
  } else {
3525
3522
  if (this.resizeTarget = null, this.isMouseDown)
3526
3523
  return;
3524
+ if (e.offsetX < 0 || e.offsetX > this.visibleWidth) {
3525
+ this.ctx.stageElement.style.cursor === "col-resize" && (this.ctx.stageElement.style.cursor = "default");
3526
+ return;
3527
+ }
3527
3528
  this.ctx.stageElement.style.cursor === "col-resize" && (this.ctx.stageElement.style.cursor = "default");
3528
3529
  const r = [...this.renderFixedCellHeaders, ...this.renderCenterCellHeaders];
3529
3530
  for (const o of r) {
@@ -3665,7 +3666,7 @@ class oe {
3665
3666
  update() {
3666
3667
  const { header: t } = this.ctx, e = [], i = [], s = [];
3667
3668
  t.renderLeafCellHeaders.forEach((r) => {
3668
- const o = new Lt(
3669
+ const o = new Tt(
3669
3670
  this.ctx,
3670
3671
  this.rowIndex,
3671
3672
  r.colIndex,
@@ -3766,13 +3767,13 @@ class wi {
3766
3767
  this.data.length && d ? (m = window.innerHeight - g - f, m < 0 && (m = 32, console.error(
3767
3768
  "There is an error in the height calculation ENABLE_OFFSET_HEIGHT and OFFSET_HEIGHT are invalid"
3768
3769
  ))) : this.data.length && n ? m = n : this.data.length && c && E > c ? m = c : m = E, m > 0 && (this.ctx.stageHeight = Math.floor(m), this.ctx.stageElement.style.height = `${this.ctx.stageHeight - 0.5}px`);
3769
- let C = this.ctx.stageHeight - e.height - o;
3770
- r ? this.visibleHeight = C - w : this.visibleHeight = C, 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;
3771
- const b = window.devicePixelRatio || 1, R = this.ctx.stageWidth * b, S = this.ctx.stageHeight * b;
3770
+ let b = this.ctx.stageHeight - e.height - o;
3771
+ r ? this.visibleHeight = b - w : 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 = u;
3772
+ const C = window.devicePixelRatio || 1, R = this.ctx.stageWidth * C, S = this.ctx.stageHeight * C;
3772
3773
  t.width = Math.floor(R), t.height = Math.floor(S), this.ctx.canvasElement.setAttribute(
3773
3774
  "style",
3774
3775
  ` height:${this.ctx.stageHeight}px;width:${this.ctx.stageWidth}px;`
3775
- ), this.ctx.paint.scale(b);
3776
+ ), this.ctx.paint.scale(C);
3776
3777
  }
3777
3778
  // 调整行的高度
3778
3779
  initResizeRow() {
@@ -3797,7 +3798,13 @@ class wi {
3797
3798
  let x = n - this.clientY;
3798
3799
  x + f < d && (x = -(f - d)), this.resizeDiff = x, this.ctx.emit("draw");
3799
3800
  } else {
3800
- if (this.resizeTarget = null, this.isMouseDown || this.ctx.stageElement.style.cursor === "crosshair")
3801
+ if (this.resizeTarget = null, this.isMouseDown)
3802
+ return;
3803
+ if (o < 0 || o > this.ctx.body.visibleWidth || r < 0 || r > this.ctx.header.visibleHeight + this.ctx.body.visibleHeight) {
3804
+ this.ctx.stageElement.style.cursor === "row-resize" && (this.ctx.stageElement.style.cursor = "default");
3805
+ return;
3806
+ }
3807
+ if (this.ctx.stageElement.style.cursor === "crosshair")
3801
3808
  return;
3802
3809
  this.ctx.stageElement.style.cursor === "row-resize" && (this.ctx.stageElement.style.cursor = "default");
3803
3810
  for (let f = 0; f < this.renderRows.length; f++) {
@@ -4089,17 +4096,17 @@ class yi {
4089
4096
  SELECTOR_AREA_MAX_X_OFFSET: f,
4090
4097
  SELECTOR_AREA_MAX_Y_OFFSET: x
4091
4098
  } = this.ctx.config, u = n, p = h || this.ctx.maxColIndex - f, g = c, w = d || this.ctx.maxRowIndex - x;
4092
- let [y, E] = r, [m, C] = o;
4093
- if (y < u || E > p || m < g || C > w)
4099
+ let [y, E] = r, [m, b] = o;
4100
+ if (y < u || E > p || m < g || b > w)
4094
4101
  return;
4095
4102
  if (this.ctx.stageElement.focus(), this.ctx.config.ENABLE_MERGE_CELL_LINK) {
4096
4103
  const R = this.adjustMergeCells(r, o);
4097
- m = R.yArr[0], C = R.yArr[1], y = R.xArr[0], E = R.xArr[1], this.ctx.onlyMergeCell = R.onlyMergeCell;
4104
+ m = R.yArr[0], b = R.yArr[1], y = R.xArr[0], E = R.xArr[1], this.ctx.onlyMergeCell = R.onlyMergeCell;
4098
4105
  }
4099
- y === E && m === C ? this.ctx.selectOnlyOne = !0 : this.ctx.selectOnlyOne = !1, r = [Math.max(u, y), Math.min(p, E)], o = [Math.max(g, m), Math.min(w, C)];
4100
- const { BEFORE_SET_SELECTOR_METHOD: b } = this.ctx.config;
4101
- if (typeof b == "function") {
4102
- const S = b({
4106
+ y === E && m === b ? this.ctx.selectOnlyOne = !0 : this.ctx.selectOnlyOne = !1, r = [Math.max(u, y), Math.min(p, E)], o = [Math.max(g, m), Math.min(w, b)];
4107
+ const { BEFORE_SET_SELECTOR_METHOD: C } = this.ctx.config;
4108
+ if (typeof C == "function") {
4109
+ const S = C({
4103
4110
  focusCell: this.ctx.focusCell,
4104
4111
  xArr: r,
4105
4112
  yArr: o
@@ -4221,6 +4228,8 @@ class yi {
4221
4228
  const { focusCell: e, clickCell: i } = this.ctx;
4222
4229
  if (e && this.isInSettingRange(e.rowIndex, e.colIndex))
4223
4230
  if (this.ctx.selector.enable = !0, i && t) {
4231
+ if (this.ctx.config.ENABLE_SELECTOR_SINGLE)
4232
+ return;
4224
4233
  const { colIndex: s, rowIndex: r } = i, { colIndex: o, rowIndex: n } = e, h = Math.min(o, s), c = Math.max(o, s), d = Math.min(n, r), f = Math.max(n, r), x = [h, c], u = [d, f];
4225
4234
  this.setSelector(x, u);
4226
4235
  } else {
@@ -4338,10 +4347,10 @@ class yi {
4338
4347
  y
4339
4348
  );
4340
4349
  if (m) {
4341
- const { rowKey: C, key: b } = m;
4342
- this.ctx.database.getReadonly(C, b) || (s.add(C), d.push({
4343
- rowKey: C,
4344
- key: b,
4350
+ const { rowKey: b, key: C } = m;
4351
+ this.ctx.database.getReadonly(b, C) || (s.add(b), d.push({
4352
+ rowKey: b,
4353
+ key: C,
4345
4354
  value: E,
4346
4355
  row: {}
4347
4356
  //内部有设置
@@ -4472,14 +4481,14 @@ class yi {
4472
4481
  if (!i)
4473
4482
  return;
4474
4483
  p && this.ctx.onlyMergeCell && i.updateSpanInfo();
4475
- const { drawX: g, drawY: w, width: y, height: E, fixed: m } = i, C = r - g + 1, b = i.drawX + y - (e - s) + 1;
4484
+ const { drawX: g, drawY: w, width: y, height: E, fixed: m } = i, b = r - g + 1, C = i.drawX + y - (e - s) + 1;
4476
4485
  let R = o.height - w, S = E;
4477
4486
  S > h.visibleHeight && (S = h.visibleHeight);
4478
4487
  let A = 0;
4479
4488
  x && (u === "top" ? R = o.height + n.height - w : A = n.visibleHeight);
4480
4489
  const I = w + S - (t - A - f);
4481
- let v = c, T = d;
4482
- b > 0 && !m ? v = Math.floor(c + b) : C > 0 && !m && (v = Math.floor(c - C)), R > 0 ? T = Math.floor(d - R) : I > 0 && (T = Math.floor(d + I)), (Math.abs(c - v) > 2 || Math.abs(d - T) > 2) && (this.ctx.adjustPositioning = !0, this.ctx.setScroll(v, T), this.ctx.emit("adjustBoundaryPosition", i));
4490
+ let v = c, L = d;
4491
+ C > 0 && !m ? v = Math.floor(c + C) : b > 0 && !m && (v = Math.floor(c - b)), R > 0 ? L = Math.floor(d - R) : I > 0 && (L = Math.floor(d + I)), (Math.abs(c - v) > 2 || Math.abs(d - L) > 2) && (this.ctx.adjustPositioning = !0, this.ctx.setScroll(v, L), this.ctx.emit("adjustBoundaryPosition", i));
4483
4492
  }
4484
4493
  destroy() {
4485
4494
  this.timerX && (clearTimeout(this.timerX), this.timerX = 0), this.timerY && (clearTimeout(this.timerY), this.timerY = 0);
@@ -4543,10 +4552,10 @@ class mi {
4543
4552
  SELECTOR_AREA_MAX_X_OFFSET: x,
4544
4553
  SELECTOR_AREA_MAX_Y_OFFSET: u
4545
4554
  } = this.ctx.config, p = h, g = c || this.ctx.maxColIndex - x, w = d, y = f || this.ctx.maxRowIndex - u;
4546
- let [E, m] = o, [C, b] = n;
4547
- if (E < p || C < w)
4555
+ let [E, m] = o, [b, C] = n;
4556
+ if (E < p || b < w)
4548
4557
  return;
4549
- o = [Math.max(p, E), Math.min(g, m)], n = [Math.max(w, C), Math.min(y, b)];
4558
+ o = [Math.max(p, E), Math.min(g, m)], n = [Math.max(w, b), Math.min(y, C)];
4550
4559
  const { BEFORE_SET_AUTOFILL_METHOD: R } = this.ctx.config;
4551
4560
  if (typeof R == "function") {
4552
4561
  const A = R({
@@ -4585,10 +4594,10 @@ class mi {
4585
4594
  for (let p = 0; p <= n[1] - n[0]; p++) {
4586
4595
  const g = p + n[0], w = u + h[0], y = s[u % o][p % r], E = this.ctx.database.getItemValueForRowIndexAndColIndex(w, g), m = `${w}-${g}`;
4587
4596
  if (E && !i.has(m)) {
4588
- const { rowKey: C, key: b } = E;
4589
- this.ctx.database.getReadonly(C, b) || (t.add(C), d.push({
4590
- rowKey: C,
4591
- key: b,
4597
+ const { rowKey: b, key: C } = E;
4598
+ this.ctx.database.getReadonly(b, C) || (t.add(b), d.push({
4599
+ rowKey: b,
4600
+ key: C,
4592
4601
  value: y,
4593
4602
  row: {}
4594
4603
  }));
@@ -4635,7 +4644,7 @@ const rt = Math.min, U = Math.max, ft = Math.round, z = (a) => ({
4635
4644
  right: "left",
4636
4645
  bottom: "top",
4637
4646
  top: "bottom"
4638
- }, Ci = {
4647
+ }, bi = {
4639
4648
  start: "end",
4640
4649
  end: "start"
4641
4650
  };
@@ -4663,7 +4672,7 @@ function J(a) {
4663
4672
  function Ht(a) {
4664
4673
  return ne(J(a));
4665
4674
  }
4666
- function bi(a, t, e) {
4675
+ function Ci(a, t, e) {
4667
4676
  e === void 0 && (e = !1);
4668
4677
  const i = lt(a), s = Ht(a), r = Mt(s);
4669
4678
  let o = s === "x" ? i === (e ? "end" : "start") ? "right" : "left" : i === "start" ? "bottom" : "top";
@@ -4674,7 +4683,7 @@ function vi(a) {
4674
4683
  return [Ot(a), t, Ot(t)];
4675
4684
  }
4676
4685
  function Ot(a) {
4677
- return a.replace(/start|end/g, (t) => Ci[t]);
4686
+ return a.replace(/start|end/g, (t) => bi[t]);
4678
4687
  }
4679
4688
  function Ri(a, t, e) {
4680
4689
  const i = ["left", "right"], s = ["right", "left"], r = ["top", "bottom"], o = ["bottom", "top"];
@@ -4802,8 +4811,8 @@ const Oi = async (a, t, e) => {
4802
4811
  } = n[g], {
4803
4812
  x: E,
4804
4813
  y: m,
4805
- data: C,
4806
- reset: b
4814
+ data: b,
4815
+ reset: C
4807
4816
  } = await y({
4808
4817
  x: d,
4809
4818
  y: f,
@@ -4822,13 +4831,13 @@ const Oi = async (a, t, e) => {
4822
4831
  ...u,
4823
4832
  [w]: {
4824
4833
  ...u[w],
4825
- ...C
4834
+ ...b
4826
4835
  }
4827
- }, b && p <= 50 && (p++, typeof b == "object" && (b.placement && (x = b.placement), b.rects && (c = b.rects === !0 ? await o.getElementRects({
4836
+ }, C && p <= 50 && (p++, typeof C == "object" && (C.placement && (x = C.placement), C.rects && (c = C.rects === !0 ? await o.getElementRects({
4828
4837
  reference: a,
4829
4838
  floating: t,
4830
4839
  strategy: s
4831
- }) : b.rects), {
4840
+ }) : C.rects), {
4832
4841
  x: d,
4833
4842
  y: f
4834
4843
  } = zt(c, x, h)), g = -1);
@@ -4867,23 +4876,23 @@ async function le(a, t) {
4867
4876
  y: s,
4868
4877
  width: o.floating.width,
4869
4878
  height: o.floating.height
4870
- } : o.reference, m = await (r.getOffsetParent == null ? void 0 : r.getOffsetParent(n.floating)), C = await (r.isElement == null ? void 0 : r.isElement(m)) ? await (r.getScale == null ? void 0 : r.getScale(m)) || {
4879
+ } : o.reference, m = await (r.getOffsetParent == null ? void 0 : r.getOffsetParent(n.floating)), b = await (r.isElement == null ? void 0 : r.isElement(m)) ? await (r.getScale == null ? void 0 : r.getScale(m)) || {
4871
4880
  x: 1,
4872
4881
  y: 1
4873
4882
  } : {
4874
4883
  x: 1,
4875
4884
  y: 1
4876
- }, b = ut(r.convertOffsetParentRelativeRectToViewportRelativeRect ? await r.convertOffsetParentRelativeRectToViewportRelativeRect({
4885
+ }, C = ut(r.convertOffsetParentRelativeRectToViewportRelativeRect ? await r.convertOffsetParentRelativeRectToViewportRelativeRect({
4877
4886
  elements: n,
4878
4887
  rect: E,
4879
4888
  offsetParent: m,
4880
4889
  strategy: h
4881
4890
  }) : E);
4882
4891
  return {
4883
- top: (y.top - b.top + p.top) / C.y,
4884
- bottom: (b.bottom - y.bottom + p.bottom) / C.y,
4885
- left: (y.left - b.left + p.left) / C.x,
4886
- right: (b.right - y.right + p.right) / C.x
4892
+ top: (y.top - C.top + p.top) / b.y,
4893
+ bottom: (C.bottom - y.bottom + p.bottom) / b.y,
4894
+ left: (y.left - C.left + p.left) / b.x,
4895
+ right: (C.right - y.right + p.right) / b.x
4887
4896
  };
4888
4897
  }
4889
4898
  const Si = (a) => ({
@@ -4907,15 +4916,15 @@ const Si = (a) => ({
4907
4916
  const f = ae(d), x = {
4908
4917
  x: e,
4909
4918
  y: i
4910
- }, u = Ht(s), p = Mt(u), g = await o.getDimensions(c), w = u === "y", y = w ? "top" : "left", E = w ? "bottom" : "right", m = w ? "clientHeight" : "clientWidth", C = 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(c));
4919
+ }, u = Ht(s), p = Mt(u), g = await o.getDimensions(c), w = u === "y", y = w ? "top" : "left", E = w ? "bottom" : "right", m = w ? "clientHeight" : "clientWidth", b = r.reference[p] + r.reference[u] - x[u] - r.floating[p], C = x[u] - r.reference[u], R = await (o.getOffsetParent == null ? void 0 : o.getOffsetParent(c));
4911
4920
  let S = R ? R[m] : 0;
4912
4921
  (!S || !await (o.isElement == null ? void 0 : o.isElement(R))) && (S = n.floating[m] || r.floating[p]);
4913
- const A = C / 2 - b / 2, I = S / 2 - g[p] / 2 - 1, v = rt(f[y], I), T = rt(f[E], I), O = v, M = S - g[p] - T, L = S / 2 - g[p] / 2 + A, N = _t(O, L, M), Y = !h.arrow && lt(s) != null && L !== N && r.reference[p] / 2 - (L < O ? v : T) - g[p] / 2 < 0, K = Y ? L < O ? L - O : L - M : 0;
4922
+ const A = b / 2 - C / 2, I = S / 2 - g[p] / 2 - 1, v = rt(f[y], I), L = rt(f[E], I), O = v, M = S - g[p] - L, T = S / 2 - g[p] / 2 + A, N = _t(O, T, M), Y = !h.arrow && lt(s) != null && T !== N && r.reference[p] / 2 - (T < O ? v : L) - g[p] / 2 < 0, K = Y ? T < O ? T - O : T - M : 0;
4914
4923
  return {
4915
4924
  [u]: x[u] + K,
4916
4925
  data: {
4917
4926
  [u]: N,
4918
- centerOffset: L - N - K,
4927
+ centerOffset: T - N - K,
4919
4928
  ...Y && {
4920
4929
  alignmentOffset: K
4921
4930
  }
@@ -4947,24 +4956,24 @@ const Si = (a) => ({
4947
4956
  } = at(a, t);
4948
4957
  if ((e = r.arrow) != null && e.alignmentOffset)
4949
4958
  return {};
4950
- const y = q(s), E = J(n), m = q(n) === n, C = await (h.isRTL == null ? void 0 : h.isRTL(c.floating)), b = x || (m || !g ? [xt(n)] : vi(n)), R = p !== "none";
4951
- !x && R && b.push(...Ii(n, g, p, C));
4952
- const S = [n, ...b], A = await le(t, w), I = [];
4959
+ const y = q(s), E = J(n), m = q(n) === n, b = await (h.isRTL == null ? void 0 : h.isRTL(c.floating)), C = x || (m || !g ? [xt(n)] : vi(n)), R = p !== "none";
4960
+ !x && R && C.push(...Ii(n, g, p, b));
4961
+ const S = [n, ...C], A = await le(t, w), I = [];
4953
4962
  let v = ((i = r.flip) == null ? void 0 : i.overflows) || [];
4954
4963
  if (d && I.push(A[y]), f) {
4955
- const L = bi(s, o, C);
4956
- I.push(A[L[0]], A[L[1]]);
4964
+ const T = Ci(s, o, b);
4965
+ I.push(A[T[0]], A[T[1]]);
4957
4966
  }
4958
4967
  if (v = [...v, {
4959
4968
  placement: s,
4960
4969
  overflows: I
4961
- }], !I.every((L) => L <= 0)) {
4962
- var T, O;
4963
- const L = (((T = r.flip) == null ? void 0 : T.index) || 0) + 1, N = S[L];
4970
+ }], !I.every((T) => T <= 0)) {
4971
+ var L, O;
4972
+ const T = (((L = r.flip) == null ? void 0 : L.index) || 0) + 1, N = S[T];
4964
4973
  if (N)
4965
4974
  return {
4966
4975
  data: {
4967
- index: L,
4976
+ index: T,
4968
4977
  overflows: v
4969
4978
  },
4970
4979
  reset: {
@@ -5003,7 +5012,7 @@ const Si = (a) => ({
5003
5012
  }
5004
5013
  };
5005
5014
  };
5006
- async function Ti(a, t) {
5015
+ async function Li(a, t) {
5007
5016
  const {
5008
5017
  placement: e,
5009
5018
  platform: i,
@@ -5030,7 +5039,7 @@ async function Ti(a, t) {
5030
5039
  y: u * d
5031
5040
  };
5032
5041
  }
5033
- const Li = function(a) {
5042
+ const Ti = function(a) {
5034
5043
  return a === void 0 && (a = 0), {
5035
5044
  name: "offset",
5036
5045
  options: a,
@@ -5041,7 +5050,7 @@ const Li = function(a) {
5041
5050
  y: r,
5042
5051
  placement: o,
5043
5052
  middlewareData: n
5044
- } = t, h = await Ti(t, a);
5053
+ } = t, h = await Li(t, a);
5045
5054
  return o === ((e = n.offset) == null ? void 0 : e.placement) && (i = n.arrow) != null && i.alignmentOffset ? {} : {
5046
5055
  x: s + h.x,
5047
5056
  y: r + h.y,
@@ -5268,8 +5277,8 @@ function ot(a, t, e, i) {
5268
5277
  const x = F(r), u = i && X(i) ? F(i) : i;
5269
5278
  let p = x, g = At(p);
5270
5279
  for (; g && i && u !== p; ) {
5271
- const w = Z(g), y = g.getBoundingClientRect(), E = k(g), m = y.left + (g.clientLeft + parseFloat(E.paddingLeft)) * w.x, C = y.top + (g.clientTop + parseFloat(E.paddingTop)) * w.y;
5272
- h *= w.x, c *= w.y, d *= w.x, f *= w.y, h += m, c += C, p = F(g), g = At(p);
5280
+ const w = Z(g), y = g.getBoundingClientRect(), E = k(g), m = y.left + (g.clientLeft + parseFloat(E.paddingLeft)) * w.x, b = y.top + (g.clientTop + parseFloat(E.paddingTop)) * w.y;
5281
+ h *= w.x, c *= w.y, d *= w.x, f *= w.y, h += m, c += b, p = F(g), g = At(p);
5273
5282
  }
5274
5283
  }
5275
5284
  return ut({
@@ -5308,13 +5317,13 @@ function ki(a) {
5308
5317
  function Ni(a) {
5309
5318
  return Array.from(a.getClientRects());
5310
5319
  }
5311
- function Tt(a, t) {
5320
+ function Lt(a, t) {
5312
5321
  const e = pt(a).scrollLeft;
5313
5322
  return t ? t.left + e : ot(V(a)).left + e;
5314
5323
  }
5315
5324
  function Ki(a) {
5316
5325
  const t = V(a), e = pt(a), i = a.ownerDocument.body, s = U(t.scrollWidth, t.clientWidth, i.scrollWidth, i.clientWidth), r = U(t.scrollHeight, t.clientHeight, i.scrollHeight, i.clientHeight);
5317
- let o = -e.scrollLeft + Tt(a);
5326
+ let o = -e.scrollLeft + Lt(a);
5318
5327
  const n = -e.scrollTop;
5319
5328
  return k(i).direction === "rtl" && (o += U(t.clientWidth, i.clientWidth) - s), {
5320
5329
  width: s,
@@ -5421,12 +5430,12 @@ function zi(a, t, e) {
5421
5430
  if ((tt(t) !== "body" || ht(s)) && (n = pt(t)), i) {
5422
5431
  const u = ot(t, !0, r, t);
5423
5432
  h.x = u.x + t.clientLeft, h.y = u.y + t.clientTop;
5424
- } else s && (h.x = Tt(s));
5433
+ } else s && (h.x = Lt(s));
5425
5434
  let c = 0, d = 0;
5426
5435
  if (s && !i && !r) {
5427
5436
  const u = s.getBoundingClientRect();
5428
5437
  d = u.top + n.scrollTop, c = u.left + n.scrollLeft - // RTL <body> scrollbar.
5429
- Tt(s, u);
5438
+ Lt(s, u);
5430
5439
  }
5431
5440
  const f = o.left + n.scrollLeft - h.x - c, x = o.top + n.scrollTop - h.y - d;
5432
5441
  return {
@@ -5491,7 +5500,7 @@ const qi = {
5491
5500
  getScale: Z,
5492
5501
  isElement: X,
5493
5502
  isRTL: Gi
5494
- }, we = Li, pe = Mi, ye = Ai, ji = Si, me = (a, t, e) => {
5503
+ }, we = Ti, pe = Mi, ye = Ai, ji = Si, me = (a, t, e) => {
5495
5504
  const i = /* @__PURE__ */ new Map(), s = {
5496
5505
  platform: qi,
5497
5506
  ...e
@@ -5544,10 +5553,10 @@ let Ui = class {
5544
5553
  e && (t.clientX < e.x || t.clientX > e.x + e.width || t.clientY < e.y || t.clientY > e.y + e.height) && this.hide();
5545
5554
  }), this.ctx.on("startEdit", () => {
5546
5555
  this.hide();
5547
- }), this.ctx.on("visibleCellHoverChange", (t) => {
5548
- (t.ellipsis || t.message) && this.show(t);
5549
- }), this.ctx.on("visibleCellMouseleave", () => {
5550
- this.hide();
5556
+ }), this.ctx.on("visibleCellHoverChange", (t, e) => {
5557
+ this.floatingEl.contains(e.target) || (t.ellipsis || t.message) && this.show(t);
5558
+ }), this.ctx.on("visibleCellMouseleave", (t, e) => {
5559
+ this.floatingEl.contains(e.target) || this.hide();
5551
5560
  });
5552
5561
  }
5553
5562
  show(t) {