e-virt-table 1.3.18 → 1.3.19
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.cjs.js +2 -2
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +10 -10
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +2 -2
- package/dist/index.umd.js.map +1 -1
- package/dist/lib/Editor.d.ts +1 -0
- package/dist/lib/Editor.js +16 -6
- package/dist/lib/Editor.js.map +1 -1
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -6741,7 +6741,7 @@ class Oi {
|
|
|
6741
6741
|
this.ctx.on("outsideMousedown", () => {
|
|
6742
6742
|
this.cellTarget && this.cellTarget.editorType === "text" && this.clearEditor();
|
|
6743
6743
|
}), this.ctx.on("moveFocus", (t) => {
|
|
6744
|
-
this.cellTarget = t;
|
|
6744
|
+
this.cellTarget = t, this.resetEditorStyle();
|
|
6745
6745
|
const { xArr: e, yArr: i } = this.ctx.selector;
|
|
6746
6746
|
this.selectorArrStr = JSON.stringify(e) + JSON.stringify(i);
|
|
6747
6747
|
}), this.ctx.on("onScroll", () => {
|
|
@@ -6829,7 +6829,7 @@ class Oi {
|
|
|
6829
6829
|
return;
|
|
6830
6830
|
}
|
|
6831
6831
|
}
|
|
6832
|
-
if (this.selectorArrStr = s, this.doneEdit(), this.cellTarget = t, this.ctx.config.ENABLE_EDIT_SINGLE_CLICK) {
|
|
6832
|
+
if (this.selectorArrStr = s, this.doneEdit(), this.cellTarget = t, this.resetEditorStyle(), this.ctx.config.ENABLE_EDIT_SINGLE_CLICK) {
|
|
6833
6833
|
if (this.ctx.config.ENABLE_MERGE_CELL_LINK && this.ctx.onlyMergeCell) {
|
|
6834
6834
|
this.startEdit();
|
|
6835
6835
|
return;
|
|
@@ -6848,6 +6848,8 @@ class Oi {
|
|
|
6848
6848
|
this.inputEl = document.createElement("textarea"), this.inputEl.id = "e-virt-table-editor-textarea", this.inputEl.setAttribute("rows", "1"), this.inputEl.setAttribute("tabindex", "-1"), this.inputEl.addEventListener("input", this.autoSize.bind(this)), this.editorEl = this.ctx.editorElement, this.inputEl.className = "e-virt-table-editor-textarea", this.editorEl.appendChild(this.inputEl), this.ctx.containerElement.appendChild(this.editorEl);
|
|
6849
6849
|
}
|
|
6850
6850
|
autoSize() {
|
|
6851
|
+
if (!this.ctx.editing)
|
|
6852
|
+
return;
|
|
6851
6853
|
const t = this.inputEl.value;
|
|
6852
6854
|
this.cellTarget && this.cellTarget.type === "number" && t !== "" && (this.ctx.emit("cellHideTooltip"), /^-?\d+(\.\d+)?$/.test(t) || this.ctx.emit("cellShowTooltip", this.cellTarget, this.ctx.config.NUMBER_ERROR_TIP)), this.inputEl.style.height = "auto";
|
|
6853
6855
|
let e = this.inputEl.scrollHeight, i = this.ctx.body.visibleHeight;
|
|
@@ -6906,15 +6908,13 @@ class Oi {
|
|
|
6906
6908
|
o && !l && (this.enable = !0, this.ctx.editing = !0, this.cellTarget = o, this.startEditByInput(this.cellTarget), this.ctx.emit("startEdit", this.cellTarget), this.ctx.emit("draw"));
|
|
6907
6909
|
}
|
|
6908
6910
|
doneEdit() {
|
|
6909
|
-
|
|
6910
|
-
return;
|
|
6911
|
-
const {
|
|
6912
|
-
header: t,
|
|
6913
|
-
config: { CELL_HEIGHT: e }
|
|
6914
|
-
} = this.ctx;
|
|
6915
|
-
this.doneEditByInput(), this.ctx.emit("cellHideTooltip"), this.ctx.emit("doneEdit", this.cellTarget), this.enable = !1, this.ctx.editing = !1, this.inputEl.style.display = "inline-block", this.editorEl.style.left = "0px", this.editorEl.style.top = `${t.height}px`, this.editorEl.style.maxHeight = `${e}px`, this.editorEl.style.zIndex = "-1", setTimeout(() => {
|
|
6911
|
+
this.enable && (this.doneEditByInput(), this.ctx.emit("cellHideTooltip"), this.ctx.emit("doneEdit", this.cellTarget), this.enable = !1, this.ctx.editing = !1, this.resetEditorStyle(), setTimeout(() => {
|
|
6916
6912
|
this.inputEl.focus({ preventScroll: !0 });
|
|
6917
|
-
}, 0), this.ctx.emit("draw");
|
|
6913
|
+
}, 0), this.ctx.emit("draw"));
|
|
6914
|
+
}
|
|
6915
|
+
resetEditorStyle() {
|
|
6916
|
+
const t = this.cellTarget;
|
|
6917
|
+
t && (this.editorEl.style.left = `${t.drawX}px`, this.editorEl.style.top = `${t.drawY}px`, this.editorEl.style.maxHeight = `${t.visibleHeight}px`, this.editorEl.style.zIndex = "-1");
|
|
6918
6918
|
}
|
|
6919
6919
|
clearEditor() {
|
|
6920
6920
|
this.doneEdit(), this.cellTarget = null, this.selectorArrStr = "", this.ctx.clearSelector(), this.ctx.focusCell = void 0, this.ctx.emit("draw");
|