e-virt-table 1.2.12 → 1.2.14

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
@@ -116,13 +116,13 @@ function D(l) {
116
116
  }
117
117
  return l;
118
118
  }
119
- function Le(l) {
119
+ function Se(l) {
120
120
  return l === "string" || l === "url" || l === "hex" || l === "email" || l === "date" || l === "pattern";
121
121
  }
122
122
  function H(l, t) {
123
- return !!(l == null || t === "array" && Array.isArray(l) && !l.length || Le(t) && typeof l == "string" && !l);
123
+ return !!(l == null || t === "array" && Array.isArray(l) && !l.length || Se(t) && typeof l == "string" && !l);
124
124
  }
125
- function Se(l, t, e) {
125
+ function Le(l, t, e) {
126
126
  var i = [], s = 0, r = l.length;
127
127
  function o(n) {
128
128
  i.push.apply(i, n || []), s++, s === r && e(i);
@@ -176,7 +176,7 @@ function Ae(l, t, e, i, s) {
176
176
  };
177
177
  n.length || (i(d), x(s)), n.forEach(function(u) {
178
178
  var w = l[u];
179
- o.indexOf(u) !== -1 ? Bt(w, e, p) : Se(w, e, p);
179
+ o.indexOf(u) !== -1 ? Bt(w, e, p) : Le(w, e, p);
180
180
  });
181
181
  });
182
182
  return f.catch(function(x) {
@@ -315,7 +315,7 @@ var Zt = function(t, e, i, s, r, o) {
315
315
  o.test(e) || s.push(D(r.messages.pattern.mismatch, t.fullField, e, t.pattern));
316
316
  }
317
317
  }
318
- }, L = {
318
+ }, S = {
319
319
  required: Zt,
320
320
  whitespace: De,
321
321
  type: Be,
@@ -327,7 +327,7 @@ var Zt = function(t, e, i, s, r, o) {
327
327
  if (n) {
328
328
  if (H(e, "string") && !t.required)
329
329
  return i();
330
- L.required(t, e, s, o, r, "string"), H(e, "string") || (L.type(t, e, s, o, r), L.range(t, e, s, o, r), L.pattern(t, e, s, o, r), t.whitespace === !0 && L.whitespace(t, e, s, o, r));
330
+ S.required(t, e, s, o, r, "string"), H(e, "string") || (S.type(t, e, s, o, r), S.range(t, e, s, o, r), S.pattern(t, e, s, o, r), t.whitespace === !0 && S.whitespace(t, e, s, o, r));
331
331
  }
332
332
  i(o);
333
333
  }, Ye = function(t, e, i, s, r) {
@@ -335,7 +335,7 @@ var Zt = function(t, e, i, s, r, o) {
335
335
  if (n) {
336
336
  if (H(e) && !t.required)
337
337
  return i();
338
- L.required(t, e, s, o, r), e !== void 0 && L.type(t, e, s, o, r);
338
+ S.required(t, e, s, o, r), e !== void 0 && S.type(t, e, s, o, r);
339
339
  }
340
340
  i(o);
341
341
  }, Ve = function(t, e, i, s, r) {
@@ -343,7 +343,7 @@ var Zt = function(t, e, i, s, r, o) {
343
343
  if (n) {
344
344
  if (e === "" && (e = void 0), H(e) && !t.required)
345
345
  return i();
346
- L.required(t, e, s, o, r), e !== void 0 && (L.type(t, e, s, o, r), L.range(t, e, s, o, r));
346
+ S.required(t, e, s, o, r), e !== void 0 && (S.type(t, e, s, o, r), S.range(t, e, s, o, r));
347
347
  }
348
348
  i(o);
349
349
  }, We = function(t, e, i, s, r) {
@@ -351,7 +351,7 @@ var Zt = function(t, e, i, s, r, o) {
351
351
  if (n) {
352
352
  if (H(e) && !t.required)
353
353
  return i();
354
- L.required(t, e, s, o, r), e !== void 0 && L.type(t, e, s, o, r);
354
+ S.required(t, e, s, o, r), e !== void 0 && S.type(t, e, s, o, r);
355
355
  }
356
356
  i(o);
357
357
  }, Pe = function(t, e, i, s, r) {
@@ -359,7 +359,7 @@ var Zt = function(t, e, i, s, r, o) {
359
359
  if (n) {
360
360
  if (H(e) && !t.required)
361
361
  return i();
362
- L.required(t, e, s, o, r), H(e) || L.type(t, e, s, o, r);
362
+ S.required(t, e, s, o, r), H(e) || S.type(t, e, s, o, r);
363
363
  }
364
364
  i(o);
365
365
  }, ze = function(t, e, i, s, r) {
@@ -367,7 +367,7 @@ var Zt = function(t, e, i, s, r, o) {
367
367
  if (n) {
368
368
  if (H(e) && !t.required)
369
369
  return i();
370
- L.required(t, e, s, o, r), e !== void 0 && (L.type(t, e, s, o, r), L.range(t, e, s, o, r));
370
+ S.required(t, e, s, o, r), e !== void 0 && (S.type(t, e, s, o, r), S.range(t, e, s, o, r));
371
371
  }
372
372
  i(o);
373
373
  }, $e = function(t, e, i, s, r) {
@@ -375,7 +375,7 @@ var Zt = function(t, e, i, s, r, o) {
375
375
  if (n) {
376
376
  if (H(e) && !t.required)
377
377
  return i();
378
- L.required(t, e, s, o, r), e !== void 0 && (L.type(t, e, s, o, r), L.range(t, e, s, o, r));
378
+ S.required(t, e, s, o, r), e !== void 0 && (S.type(t, e, s, o, r), S.range(t, e, s, o, r));
379
379
  }
380
380
  i(o);
381
381
  }, qe = function(t, e, i, s, r) {
@@ -383,7 +383,7 @@ var Zt = function(t, e, i, s, r, o) {
383
383
  if (n) {
384
384
  if (e == null && !t.required)
385
385
  return i();
386
- L.required(t, e, s, o, r, "array"), e != null && (L.type(t, e, s, o, r), L.range(t, e, s, o, r));
386
+ S.required(t, e, s, o, r, "array"), e != null && (S.type(t, e, s, o, r), S.range(t, e, s, o, r));
387
387
  }
388
388
  i(o);
389
389
  }, Ge = function(t, e, i, s, r) {
@@ -391,7 +391,7 @@ var Zt = function(t, e, i, s, r, o) {
391
391
  if (n) {
392
392
  if (H(e) && !t.required)
393
393
  return i();
394
- L.required(t, e, s, o, r), e !== void 0 && L.type(t, e, s, o, r);
394
+ S.required(t, e, s, o, r), e !== void 0 && S.type(t, e, s, o, r);
395
395
  }
396
396
  i(o);
397
397
  }, je = "enum", Ue = function(t, e, i, s, r) {
@@ -399,7 +399,7 @@ var Zt = function(t, e, i, s, r, o) {
399
399
  if (n) {
400
400
  if (H(e) && !t.required)
401
401
  return i();
402
- L.required(t, e, s, o, r), e !== void 0 && L[je](t, e, s, o, r);
402
+ S.required(t, e, s, o, r), e !== void 0 && S[je](t, e, s, o, r);
403
403
  }
404
404
  i(o);
405
405
  }, Ze = function(t, e, i, s, r) {
@@ -407,7 +407,7 @@ var Zt = function(t, e, i, s, r, o) {
407
407
  if (n) {
408
408
  if (H(e, "string") && !t.required)
409
409
  return i();
410
- L.required(t, e, s, o, r), H(e, "string") || L.pattern(t, e, s, o, r);
410
+ S.required(t, e, s, o, r), H(e, "string") || S.pattern(t, e, s, o, r);
411
411
  }
412
412
  i(o);
413
413
  }, Je = function(t, e, i, s, r) {
@@ -415,21 +415,21 @@ var Zt = function(t, e, i, s, r, o) {
415
415
  if (n) {
416
416
  if (H(e, "date") && !t.required)
417
417
  return i();
418
- if (L.required(t, e, s, o, r), !H(e, "date")) {
418
+ if (S.required(t, e, s, o, r), !H(e, "date")) {
419
419
  var h;
420
- e instanceof Date ? h = e : h = new Date(e), L.type(t, h, s, o, r), h && L.range(t, h.getTime(), s, o, r);
420
+ e instanceof Date ? h = e : h = new Date(e), S.type(t, h, s, o, r), h && S.range(t, h.getTime(), s, o, r);
421
421
  }
422
422
  }
423
423
  i(o);
424
424
  }, Qe = function(t, e, i, s, r) {
425
425
  var o = [], n = Array.isArray(e) ? "array" : typeof e;
426
- L.required(t, e, s, o, r, n), i(o);
426
+ S.required(t, e, s, o, r, n), i(o);
427
427
  }, mt = function(t, e, i, s, r) {
428
428
  var o = t.type, n = [], h = t.required || !t.required && s.hasOwnProperty(t.field);
429
429
  if (h) {
430
430
  if (H(e, o) && !t.required)
431
431
  return i();
432
- L.required(t, e, s, n, r, o), H(e, o) || L.type(t, e, s, n, r);
432
+ S.required(t, e, s, n, r, o), H(e, o) || S.type(t, e, s, n, r);
433
433
  }
434
434
  i(n);
435
435
  }, ti = function(t, e, i, s, r) {
@@ -437,7 +437,7 @@ var Zt = function(t, e, i, s, r, o) {
437
437
  if (n) {
438
438
  if (H(e) && !t.required)
439
439
  return i();
440
- L.required(t, e, s, o, r);
440
+ S.required(t, e, s, o, r);
441
441
  }
442
442
  i(o);
443
443
  }, it = {
@@ -600,8 +600,8 @@ var Rt = vt(), nt = /* @__PURE__ */ function() {
600
600
  var M = _[T], A = Array.isArray(M) ? M : [M];
601
601
  v[T] = A.map(y.bind(null, T));
602
602
  });
603
- var S = new l(v);
604
- S.messages(h.messages), u.rule.options && (u.rule.options.messages = h.messages, u.rule.options.error = h.error), S.validate(u.value, u.rule.options || h, function(T) {
603
+ var L = new l(v);
604
+ L.messages(h.messages), u.rule.options && (u.rule.options.messages = h.messages, u.rule.options.error = h.error), L.validate(u.value, u.rule.options || h, function(T) {
605
605
  var M = [];
606
606
  I && I.length && M.push.apply(M, I), T && T.length && M.push.apply(M, T), w(M.length ? M : null);
607
607
  });
@@ -1056,14 +1056,14 @@ class At extends re {
1056
1056
  if (this.cellType === "footer") {
1057
1057
  let O = c, I = h;
1058
1058
  if (typeof r == "function") {
1059
- const _ = r, { backgroundColor: v, color: S } = _({
1059
+ const _ = r, { backgroundColor: v, color: L } = _({
1060
1060
  row: this.row,
1061
1061
  rowIndex: this.rowIndex,
1062
1062
  colIndex: this.colIndex,
1063
1063
  column: this.column,
1064
1064
  value: this.getValue()
1065
1065
  }) || {};
1066
- v && (O = v), S && (I = S);
1066
+ v && (O = v), L && (I = L);
1067
1067
  }
1068
1068
  this.drawCellSkyBgColor = "transparent", this.drawCellBgColor = O, this.drawTextColor = I;
1069
1069
  return;
@@ -2187,13 +2187,13 @@ class li {
2187
2187
  let w = e, m = e, C = n, y = n, b = [], E = 0, R = 0, O = 0, I = 0;
2188
2188
  if (d !== 1 && p) {
2189
2189
  I = x;
2190
- const _ = h.reduce((v, S) => {
2191
- const T = this.getItemValue(s, S) ?? "";
2190
+ const _ = h.reduce((v, L) => {
2191
+ const T = this.getItemValue(s, L) ?? "";
2192
2192
  return `${v}${T}`;
2193
2193
  }, "");
2194
2194
  for (let v = e - 1; v >= 0; v--) {
2195
- const S = this.rowIndexRowKeyMap.get(v) || "", T = h.reduce((M, A) => {
2196
- const N = this.getItemValue(S, A) ?? "";
2195
+ const L = this.rowIndexRowKeyMap.get(v) || "", T = h.reduce((M, A) => {
2196
+ const N = this.getItemValue(L, A) ?? "";
2197
2197
  return `${M}${N}`;
2198
2198
  }, "");
2199
2199
  if (_ === T)
@@ -2202,8 +2202,8 @@ class li {
2202
2202
  break;
2203
2203
  }
2204
2204
  for (let v = e; v <= this.ctx.maxRowIndex; v++) {
2205
- const S = this.rowIndexRowKeyMap.get(v) || "", T = h.reduce((M, A) => {
2206
- const N = this.getItemValue(S, A) ?? "";
2205
+ const L = this.rowIndexRowKeyMap.get(v) || "", T = h.reduce((M, A) => {
2206
+ const N = this.getItemValue(L, A) ?? "";
2207
2207
  return `${M}${N}`;
2208
2208
  }, "");
2209
2209
  if (_ === T)
@@ -2212,12 +2212,12 @@ class li {
2212
2212
  break;
2213
2213
  }
2214
2214
  for (let v = w; v < e; v++) {
2215
- const { height: S } = this.positions[v];
2216
- E += S;
2215
+ const { height: L } = this.positions[v];
2216
+ E += L;
2217
2217
  }
2218
2218
  for (let v = w; v <= m; v++) {
2219
- const { height: S } = this.positions[v];
2220
- O += S;
2219
+ const { height: L } = this.positions[v];
2220
+ O += L;
2221
2221
  const T = this.rowIndexRowKeyMap.get(v) || "", { item: M } = this.rowKeyMap.get(T), A = this.getItemValue(T, i);
2222
2222
  b.push({
2223
2223
  rowKey: T,
@@ -2233,8 +2233,8 @@ class li {
2233
2233
  const v = this.getColumnByColIndex(_);
2234
2234
  if (!v)
2235
2235
  break;
2236
- const S = this.getItemValue(s, i), T = this.getItemValue(s, v.key);
2237
- if (S === T && c.includes(v.key))
2236
+ const L = this.getItemValue(s, i), T = this.getItemValue(s, v.key);
2237
+ if (L === T && c.includes(v.key))
2238
2238
  C = _;
2239
2239
  else
2240
2240
  break;
@@ -2243,8 +2243,8 @@ class li {
2243
2243
  const v = this.getColumnByColIndex(_);
2244
2244
  if (!v)
2245
2245
  break;
2246
- const S = this.getItemValue(s, i), T = this.getItemValue(s, v.key);
2247
- if (S === T && c.includes(v.key))
2246
+ const L = this.getItemValue(s, i), T = this.getItemValue(s, v.key);
2247
+ if (L === T && c.includes(v.key))
2248
2248
  y = _;
2249
2249
  else
2250
2250
  break;
@@ -2390,18 +2390,27 @@ class ci {
2390
2390
  this.ctx = t, this.init();
2391
2391
  }
2392
2392
  init() {
2393
- 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), { passive: !1 }), this.bind(this.ctx.stageElement, "touchstart", this.handleTouchstart.bind(this), { passive: !1 }), this.bind(this.ctx.stageElement, "touchend", this.handleTouchend.bind(this)), this.bind(this.ctx.stageElement, "touchmove", this.handleTouchmove.bind(this), { passive: !1 }), 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));
2393
+ 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), { passive: !1 }), this.bind(this.ctx.stageElement, "touchstart", this.handleTouchstart.bind(this), { passive: !1 }), this.bind(this.ctx.stageElement, "touchend", this.handleTouchend.bind(this)), this.bind(this.ctx.stageElement, "touchmove", this.handleTouchmove.bind(this), { passive: !1 }), 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)), document.addEventListener("selectionchange", this.selectionchange.bind(this));
2394
+ }
2395
+ selectionchange() {
2396
+ this.ctx.domSelectionStr = "";
2397
+ const t = window.getSelection();
2398
+ t && t.toString() && (this.ctx.domSelectionStr = t.toString());
2399
+ }
2400
+ clearDomSelection() {
2401
+ const t = window.getSelection();
2402
+ t && !t.isCollapsed && t.removeAllRanges();
2394
2403
  }
2395
2404
  destroy() {
2396
2405
  this.eventTasks.forEach((t, e) => {
2397
2406
  this.unbind(window, e, t);
2398
- }), this.eventTasks.clear();
2407
+ }), document.removeEventListener("selectionchange", this.selectionchange.bind(this)), this.eventTasks.clear();
2399
2408
  }
2400
2409
  handleResize(t) {
2401
2410
  this.ctx.emit("resetHeader", t), this.ctx.emit("resize", t);
2402
2411
  }
2403
2412
  handleMouseDown(t) {
2404
- t.button === 0 && (this.ctx.mousedown = !0), this.ctx.containerElement.focus({ preventScroll: !0 }), this.ctx.emit("mousedown", t);
2413
+ this.clearDomSelection(), t.button === 0 && (this.ctx.mousedown = !0), this.ctx.containerElement.focus({ preventScroll: !0 }), this.ctx.emit("mousedown", t);
2405
2414
  }
2406
2415
  handleMousemove(t) {
2407
2416
  this.ctx.emit("mousemove", t);
@@ -3234,6 +3243,7 @@ class gi {
3234
3243
  a(this, "stageHeight", 0);
3235
3244
  a(this, "paint");
3236
3245
  a(this, "icons");
3246
+ a(this, "domSelectionStr", "");
3237
3247
  a(this, "isMouseoverTargetContainer", !1);
3238
3248
  a(this, "mousedown", !1);
3239
3249
  a(this, "isPointer", !1);
@@ -4271,13 +4281,13 @@ class Ei {
4271
4281
  this.isMultipleRow || this.mouseenter();
4272
4282
  }
4273
4283
  }), this.ctx.on("cellMousedown", (t, e) => {
4274
- if (this.ctx.isTarget(e) && this.ctx.stageElement.style.cursor !== "pointer" && !this.ctx.isPointer && this.ctx.stageElement.style.cursor !== "crosshair") {
4275
- if (t.operation) {
4276
- this.isMultipleRow = !0, this.selectRows(t);
4277
- return;
4278
- }
4279
- e.preventDefault(), this.isMultipleRow = !1, this.click(e.shiftKey), this.ctx.emit("selectorClick", t);
4284
+ if (!this.ctx.isTarget(e) || this.ctx.stageElement.style.cursor === "pointer" || this.ctx.isPointer || this.ctx.stageElement.style.cursor === "crosshair")
4285
+ return;
4286
+ if (t.operation) {
4287
+ this.isMultipleRow = !0, this.selectRows(t);
4288
+ return;
4280
4289
  }
4290
+ window.getComputedStyle(e.target).userSelect !== "text" && e.preventDefault(), this.isMultipleRow = !1, this.click(e.shiftKey), this.ctx.emit("selectorClick", t);
4281
4291
  }), this.ctx.on("mouseup", () => {
4282
4292
  this.mousedownHeader = !1;
4283
4293
  const t = setTimeout(() => {
@@ -4286,7 +4296,9 @@ class Ei {
4286
4296
  }), this.ctx.on("cellHeaderHoverChange", (t) => {
4287
4297
  this.ctx.mousedown && this.selectCols(t);
4288
4298
  }), this.ctx.on("cellHeaderMousedown", (t, e) => {
4289
- this.ctx.stageElement.style.cursor !== "pointer" && (this.ctx.isPointer || (e.preventDefault(), this.mousedownHeader = !0, this.selectCols(t)));
4299
+ if (this.ctx.stageElement.style.cursor === "pointer" || this.ctx.isPointer)
4300
+ return;
4301
+ window.getComputedStyle(e.target).userSelect !== "text" && e.preventDefault(), this.mousedownHeader = !0, this.selectCols(t);
4290
4302
  }), this.ctx.on("keydown", (t) => {
4291
4303
  if (!this.ctx.editing) {
4292
4304
  if (t.ctrlKey && t.code === "KeyV" || t.metaKey && t.code === "KeyV") {
@@ -4520,7 +4532,7 @@ class Ei {
4520
4532
  * @returns
4521
4533
  */
4522
4534
  copy() {
4523
- if (!this.ctx.config.ENABLE_COPY)
4535
+ if (!this.ctx.config.ENABLE_COPY || this.ctx.domSelectionStr)
4524
4536
  return;
4525
4537
  let { value: t, xArr: e, yArr: i } = this.ctx.getSelectedData();
4526
4538
  if (this.ctx.config.ENABLE_MERGE_CELL_LINK && this.ctx.database.hasMergeCell(e, i))
@@ -4621,10 +4633,10 @@ class Ei {
4621
4633
  O
4622
4634
  );
4623
4635
  if (_) {
4624
- const { rowKey: v, key: S } = _;
4625
- this.ctx.database.getReadonly(v, S) || (s.add(v), w.push({
4636
+ const { rowKey: v, key: L } = _;
4637
+ this.ctx.database.getReadonly(v, L) || (s.add(v), w.push({
4626
4638
  rowKey: v,
4627
- key: S,
4639
+ key: L,
4628
4640
  value: I,
4629
4641
  row: {}
4630
4642
  //内部有设置
@@ -4761,8 +4773,8 @@ class Ei {
4761
4773
  let I = 0;
4762
4774
  x && (g === "top" ? R = o.height + n.height - w : I = n.visibleHeight);
4763
4775
  const _ = w + O - (t - I - f);
4764
- let v = c, S = d;
4765
- E > 0 && !y ? v = Math.floor(c + E) : b > 0 && !y && (v = Math.floor(c - b)), R > 0 ? S = Math.floor(d - R) : _ > 0 && (S = Math.floor(d + _)), (Math.abs(c - v) > 2 || Math.abs(d - S) > 2) && (this.ctx.adjustPositioning = !0, this.ctx.setScroll(v, S), this.ctx.emit("adjustBoundaryPosition", i));
4776
+ let v = c, L = d;
4777
+ E > 0 && !y ? v = Math.floor(c + E) : b > 0 && !y && (v = Math.floor(c - b)), R > 0 ? L = Math.floor(d - R) : _ > 0 && (L = Math.floor(d + _)), (Math.abs(c - v) > 2 || Math.abs(d - L) > 2) && (this.ctx.adjustPositioning = !0, this.ctx.setScroll(v, L), this.ctx.emit("adjustBoundaryPosition", i));
4766
4778
  }
4767
4779
  destroy() {
4768
4780
  this.timerX && (clearTimeout(this.timerX), this.timerX = 0), this.timerY && (clearTimeout(this.timerY), this.timerY = 0);
@@ -4981,7 +4993,7 @@ function Oi(l, t, e, i) {
4981
4993
  function xt(l) {
4982
4994
  return l.replace(/left|right|bottom|top/g, (t) => bi[t]);
4983
4995
  }
4984
- function Li(l) {
4996
+ function Si(l) {
4985
4997
  return {
4986
4998
  top: 0,
4987
4999
  right: 0,
@@ -4991,7 +5003,7 @@ function Li(l) {
4991
5003
  };
4992
5004
  }
4993
5005
  function le(l) {
4994
- return typeof l != "number" ? Li(l) : {
5006
+ return typeof l != "number" ? Si(l) : {
4995
5007
  top: l,
4996
5008
  right: l,
4997
5009
  bottom: l,
@@ -5064,7 +5076,7 @@ function $t(l, t, e) {
5064
5076
  }
5065
5077
  return g;
5066
5078
  }
5067
- const Si = async (l, t, e) => {
5079
+ const Li = async (l, t, e) => {
5068
5080
  const {
5069
5081
  placement: i = "bottom",
5070
5082
  strategy: s = "absolute",
@@ -5194,7 +5206,7 @@ const Ti = (l) => ({
5194
5206
  }, g = Ht(s), p = Mt(g), u = await o.getDimensions(c), w = g === "y", m = w ? "top" : "left", C = w ? "bottom" : "right", y = w ? "clientHeight" : "clientWidth", b = r.reference[p] + r.reference[g] - x[g] - r.floating[p], E = x[g] - r.reference[g], R = await (o.getOffsetParent == null ? void 0 : o.getOffsetParent(c));
5195
5207
  let O = R ? R[y] : 0;
5196
5208
  (!O || !await (o.isElement == null ? void 0 : o.isElement(R))) && (O = n.floating[y] || r.floating[p]);
5197
- const I = b / 2 - E / 2, _ = O / 2 - u[p] / 2 - 1, v = rt(f[m], _), S = rt(f[C], _), T = v, M = O - u[p] - S, A = O / 2 - u[p] / 2 + I, N = It(T, A, M), Y = !h.arrow && lt(s) != null && A !== N && r.reference[p] / 2 - (A < T ? v : S) - u[p] / 2 < 0, k = Y ? A < T ? A - T : A - M : 0;
5209
+ const I = b / 2 - E / 2, _ = O / 2 - u[p] / 2 - 1, v = rt(f[m], _), L = rt(f[C], _), T = v, M = O - u[p] - L, A = O / 2 - u[p] / 2 + I, N = It(T, A, M), Y = !h.arrow && lt(s) != null && A !== N && r.reference[p] / 2 - (A < T ? v : L) - u[p] / 2 < 0, k = Y ? A < T ? A - T : A - M : 0;
5198
5210
  return {
5199
5211
  [g]: x[g] + k,
5200
5212
  data: {
@@ -5243,8 +5255,8 @@ const Ti = (l) => ({
5243
5255
  placement: s,
5244
5256
  overflows: _
5245
5257
  }], !_.every((A) => A <= 0)) {
5246
- var S, T;
5247
- const A = (((S = r.flip) == null ? void 0 : S.index) || 0) + 1, N = O[A];
5258
+ var L, T;
5259
+ const A = (((L = r.flip) == null ? void 0 : L.index) || 0) + 1, N = O[A];
5248
5260
  if (N)
5249
5261
  return {
5250
5262
  data: {
@@ -5489,17 +5501,17 @@ function de(l) {
5489
5501
  const t = $(l);
5490
5502
  return Q(t) ? l.ownerDocument ? l.ownerDocument.body : l.body : K(t) && ht(t) ? t : de(t);
5491
5503
  }
5492
- function Lt(l, t, e) {
5504
+ function St(l, t, e) {
5493
5505
  var i;
5494
5506
  t === void 0 && (t = []), e === void 0 && (e = !0);
5495
5507
  const s = de(l), r = s === ((i = l.ownerDocument) == null ? void 0 : i.body), o = X(s);
5496
5508
  if (r) {
5497
- const n = St(o);
5498
- return t.concat(o, o.visualViewport || [], ht(s) ? s : [], n && e ? Lt(n) : []);
5509
+ const n = Lt(o);
5510
+ return t.concat(o, o.visualViewport || [], ht(s) ? s : [], n && e ? St(n) : []);
5499
5511
  }
5500
- return t.concat(s, Lt(s, [], e));
5512
+ return t.concat(s, St(s, [], e));
5501
5513
  }
5502
- function St(l) {
5514
+ function Lt(l) {
5503
5515
  return l.parent && Object.getPrototypeOf(l.parent) ? l.frameElement : null;
5504
5516
  }
5505
5517
  function fe(l) {
@@ -5550,10 +5562,10 @@ function ot(l, t, e, i) {
5550
5562
  let h = (s.left + n.x) / o.x, c = (s.top + n.y) / o.y, d = s.width / o.x, f = s.height / o.y;
5551
5563
  if (r) {
5552
5564
  const x = X(r), g = i && B(i) ? X(i) : i;
5553
- let p = x, u = St(p);
5565
+ let p = x, u = Lt(p);
5554
5566
  for (; u && i && g !== p; ) {
5555
5567
  const w = Z(u), m = u.getBoundingClientRect(), C = F(u), y = m.left + (u.clientLeft + parseFloat(C.paddingLeft)) * w.x, b = m.top + (u.clientTop + parseFloat(C.paddingTop)) * w.y;
5556
- h *= w.x, c *= w.y, d *= w.x, f *= w.y, h += y, c += b, p = X(u), u = St(p);
5568
+ h *= w.x, c *= w.y, d *= w.x, f *= w.y, h += y, c += b, p = X(u), u = Lt(p);
5557
5569
  }
5558
5570
  }
5559
5571
  return ut({
@@ -5657,7 +5669,7 @@ function Pi(l, t) {
5657
5669
  const e = t.get(l);
5658
5670
  if (e)
5659
5671
  return e;
5660
- let i = Lt(l, [], !1).filter((n) => B(n) && tt(n) !== "body"), s = null;
5672
+ let i = St(l, [], !1).filter((n) => B(n) && tt(n) !== "body"), s = null;
5661
5673
  const r = F(l).position === "fixed";
5662
5674
  let o = r ? $(l) : l;
5663
5675
  for (; B(o) && !Q(o); ) {
@@ -5783,7 +5795,7 @@ const Ui = {
5783
5795
  ...s.platform,
5784
5796
  _c: i
5785
5797
  };
5786
- return Si(l, t, {
5798
+ return Li(l, t, {
5787
5799
  ...s,
5788
5800
  platform: r
5789
5801
  });
@@ -6063,12 +6075,12 @@ class Qi {
6063
6075
  }
6064
6076
  }
6065
6077
  startEdit(t = !1) {
6066
- this.ctx.emit("draw"), this.cancel = !1;
6078
+ this.cancel = !1;
6067
6079
  const { ENABLE_EDIT_CLICK_SELECTOR: e } = this.ctx.config;
6068
6080
  if (!e)
6069
6081
  return;
6070
6082
  const i = this.ctx.focusCell;
6071
- if (!i || ["index", "index-selection", "selection"].includes(i.type) || this.enable || !(i.isVerticalVisible() && i.isHorizontalVisible()))
6083
+ if (!i || ["index", "index-selection", "selection"].includes(i.type) || this.enable || (this.ctx.emit("drawView"), !(i.isVerticalVisible() && i.isHorizontalVisible())))
6072
6084
  return;
6073
6085
  const { rowKey: r, key: o, editorType: n } = i;
6074
6086
  if (n === "none")
@@ -6464,7 +6476,7 @@ class os {
6464
6476
  this.editor.doneEdit(), this.ctx.database.setColumns(t), this.header.init(), this.ctx.emit("draw");
6465
6477
  }
6466
6478
  loadData(t) {
6467
- this.editor.doneEdit(), this.ctx.database.setData(t), this.header.init(), this.ctx.emit("draw");
6479
+ this.editor.doneEdit(), this.ctx.database.setData(t), this.header.init(), this.tooltip.hide(), this.ctx.emit("draw");
6468
6480
  }
6469
6481
  loadFooterData(t) {
6470
6482
  this.ctx.database.setFooterData(t), this.ctx.emit("draw");