e-virt-table 0.1.26 → 0.1.27

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
@@ -2747,6 +2747,8 @@ class hi {
2747
2747
  // 自动填充移动中
2748
2748
  l(this, "selectorMove", !1);
2749
2749
  // 选择器移动中
2750
+ l(this, "selectOnlyOne", !1);
2751
+ // 只选择一个单元格
2750
2752
  l(this, "adjustPositioning", !1);
2751
2753
  // 调整位置中
2752
2754
  l(this, "editing", !1);
@@ -3742,7 +3744,7 @@ class ui {
3742
3744
  let [y, b] = r, [m, E] = o;
3743
3745
  if (y < u || b > g || m < w || E > p)
3744
3746
  return;
3745
- this.ctx.stageElement.focus(), 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");
3747
+ this.ctx.stageElement.focus(), y === b && m === E ? this.ctx.selectOnlyOne = !0 : this.ctx.selectOnlyOne = !1, 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");
3746
3748
  }
3747
3749
  }
3748
3750
  selectCols(t) {
@@ -5205,9 +5207,11 @@ class qi {
5205
5207
  }
5206
5208
  }), this.ctx.on("adjustBoundaryPosition", (t) => {
5207
5209
  this.cellTarget = t;
5210
+ }), this.ctx.on("mouseup", () => {
5211
+ this.ctx.selectOnlyOne || (this.cellTarget = null);
5208
5212
  }), this.ctx.on("cellClick", (t) => {
5209
5213
  var e, i;
5210
- this.ctx.adjustPositioning || (t.rowKey === ((e = this.cellTarget) == null ? void 0 : e.rowKey) && t.key === ((i = this.cellTarget) == null ? void 0 : i.key) ? this.startEdit() : (this.doneEdit(), this.cellTarget = t, this.ctx.config.ENABLE_EDIT_SINGLE_CLICK && this.startEdit()));
5214
+ this.ctx.adjustPositioning || this.ctx.selectOnlyOne && (t.rowKey === ((e = this.cellTarget) == null ? void 0 : e.rowKey) && t.key === ((i = this.cellTarget) == null ? void 0 : i.key) ? this.startEdit() : (this.doneEdit(), this.cellTarget = t, this.ctx.config.ENABLE_EDIT_SINGLE_CLICK && this.startEdit()));
5211
5215
  });
5212
5216
  }
5213
5217
  initTextEditor() {