e-virt-table 1.3.21 → 1.3.22

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
@@ -3735,8 +3735,6 @@ class Me {
3735
3735
  // 拖拽表头中
3736
3736
  n(this, "finding", !1);
3737
3737
  // 查找中
3738
- n(this, "adjustPositioning", !1);
3739
- // 调整位置中
3740
3738
  n(this, "contextMenuIng", !1);
3741
3739
  // 右键菜单中
3742
3740
  n(this, "editing", !1);
@@ -5006,6 +5004,8 @@ class Be {
5006
5004
  }
5007
5005
  this.isMultipleRow || this.mouseenter();
5008
5006
  }
5007
+ }), this.ctx.on("cellClick", () => {
5008
+ this.adjustBoundaryPosition();
5009
5009
  }), this.ctx.on("cellMousedown", (t, e) => {
5010
5010
  if (!this.ctx.isTarget(e) || this.ctx.stageElement.style.cursor === "pointer" || this.ctx.isPointer || this.ctx.stageElement.style.cursor === "crosshair")
5011
5011
  return;
@@ -5015,7 +5015,7 @@ class Be {
5015
5015
  }
5016
5016
  window.getComputedStyle(e.target).userSelect !== "text" && e.preventDefault(), this.isMultipleRow = !1, this.click(e.shiftKey), this.ctx.emit("selectorClick", t);
5017
5017
  }), this.ctx.on("mouseup", () => {
5018
- this.ctx.selectorMove = !1, this.ctx.stopAdjustPosition(), this.ctx.adjustPositioning = !1, setTimeout(() => {
5018
+ this.ctx.selectorMove = !1, this.ctx.stopAdjustPosition(), setTimeout(() => {
5019
5019
  this.ctx.disableHoverIconClick = !1;
5020
5020
  }, 0);
5021
5021
  }), this.ctx.on("cellHeaderHoverChange", (t) => {
@@ -5073,7 +5073,7 @@ class Be {
5073
5073
  }), this.ctx.on("contextMenuCut", () => {
5074
5074
  this.isCut = !0, this.copy();
5075
5075
  }), this.ctx.on("setSelectorCell", (t) => {
5076
- this.ctx.setFocusCell(t), this.click();
5076
+ this.ctx.setFocusCell(t), this.click(), this.adjustBoundaryPosition();
5077
5077
  }), this.ctx.on("selectCols", (t) => {
5078
5078
  this.selectCols(t);
5079
5079
  });
@@ -5239,7 +5239,7 @@ class Be {
5239
5239
  } else {
5240
5240
  this.ctx.emit("cellSelectedClick", e);
5241
5241
  const s = [e.colIndex, e.colIndex], o = [e.rowIndex, e.rowIndex];
5242
- this.setSelector(s, o), this.adjustBoundaryPosition();
5242
+ this.setSelector(s, o);
5243
5243
  }
5244
5244
  }
5245
5245
  clearCopyLine() {
@@ -5474,7 +5474,7 @@ class Be {
5474
5474
  u && (x === "top" ? R = r.height + a.height - w : O = a.visibleHeight);
5475
5475
  const v = w + S - (t - O - f);
5476
5476
  let I = h, _ = d;
5477
- C > 0 && !y ? I = Math.floor(h + C) : b > 0 && !y && (I = Math.floor(h - b)), R > 0 ? _ = Math.floor(d - R) : v > 0 && (_ = Math.floor(d + v)), (Math.abs(h - I) > 2 || Math.abs(d - _) > 2) && (this.ctx.adjustPositioning = !0, this.ctx.emit("adjustBoundaryPosition", i), this.ctx.setScroll(I, _));
5477
+ C > 0 && !y ? I = Math.floor(h + C) : b > 0 && !y && (I = Math.floor(h - b)), R > 0 ? _ = Math.floor(d - R) : v > 0 && (_ = Math.floor(d + v)), (Math.abs(h - I) > 2.5 || Math.abs(d - _) > 2.5) && this.ctx.setScroll(I, _);
5478
5478
  }
5479
5479
  destroy() {
5480
5480
  }
@@ -6743,7 +6743,7 @@ class Oi {
6743
6743
  }), this.ctx.on("moveFocus", (t) => {
6744
6744
  this.cellTarget = t, this.resetEditorStyle();
6745
6745
  const { xArr: e, yArr: i } = this.ctx.selector;
6746
- this.selectorArrStr = JSON.stringify(e) + JSON.stringify(i);
6746
+ this.selectorArrStr = JSON.stringify(e) + JSON.stringify(i), this.focusInput();
6747
6747
  }), this.ctx.on("onScroll", () => {
6748
6748
  this.enable && this.doneEdit();
6749
6749
  }), this.ctx.on("hoverIconClick", (t) => {
@@ -6821,11 +6821,11 @@ class Oi {
6821
6821
  return;
6822
6822
  }
6823
6823
  this.startEdit(!0);
6824
- }), this.ctx.on("cellMouseup", (t) => {
6824
+ }), this.ctx.on("cellClick", (t) => {
6825
6825
  if (this.ctx.isPointer || !this.isInSelectorRange(t.rowIndex, t.colIndex))
6826
6826
  return;
6827
6827
  const { xArr: e, yArr: i } = this.ctx.selector, s = JSON.stringify(e) + JSON.stringify(i);
6828
- if (this.selectorArrStr === s && this.cellTarget) {
6828
+ if (this.focusInput(), this.selectorArrStr === s && this.cellTarget) {
6829
6829
  if (this.ctx.config.ENABLE_MERGE_CELL_LINK && this.ctx.onlyMergeCell) {
6830
6830
  this.startEdit();
6831
6831
  return;
@@ -6835,15 +6835,13 @@ class Oi {
6835
6835
  return;
6836
6836
  }
6837
6837
  }
6838
- if (this.selectorArrStr = s, this.doneEdit(), this.cellTarget = t, this.ctx.selectOnlyOne && this.inputEl.focus({ preventScroll: !0 }), this.resetEditorStyle(), this.ctx.config.ENABLE_EDIT_SINGLE_CLICK) {
6838
+ if (this.selectorArrStr = s, this.doneEdit(), this.cellTarget = t, this.resetEditorStyle(), this.ctx.config.ENABLE_EDIT_SINGLE_CLICK) {
6839
6839
  if (this.ctx.config.ENABLE_MERGE_CELL_LINK && this.ctx.onlyMergeCell) {
6840
6840
  this.startEdit();
6841
6841
  return;
6842
6842
  }
6843
6843
  this.ctx.selectOnlyOne && this.startEdit();
6844
6844
  }
6845
- }), this.ctx.on("mousedownBodyOutside", () => {
6846
- this.clearEditor();
6847
6845
  });
6848
6846
  }
6849
6847
  isInSelectorRange(t, e) {
@@ -6888,6 +6886,9 @@ class Oi {
6888
6886
  s !== i && !(s === "" && i === null) && !this.cancel && this.ctx.setItemValueByEditor(t, e, s, !0);
6889
6887
  }
6890
6888
  }
6889
+ focusInput() {
6890
+ this.ctx.selectOnlyOne && document.activeElement !== this.inputEl && this.inputEl.focus({ preventScroll: !0 });
6891
+ }
6891
6892
  startEdit(t = !1) {
6892
6893
  this.cancel = !1;
6893
6894
  const { ENABLE_EDIT_CLICK_SELECTOR: e } = this.ctx.config;
@@ -6915,7 +6916,7 @@ class Oi {
6915
6916
  }
6916
6917
  doneEdit() {
6917
6918
  this.enable && (this.doneEditByInput(), this.ctx.emit("cellHideTooltip"), this.ctx.emit("doneEdit", this.cellTarget), this.enable = !1, this.ctx.editing = !1, this.resetEditorStyle(), setTimeout(() => {
6918
- this.inputEl.focus({ preventScroll: !0 });
6919
+ this.focusInput();
6919
6920
  }, 0), this.ctx.emit("draw"));
6920
6921
  }
6921
6922
  resetEditorStyle() {