e-virt-table 1.3.16 → 1.3.18
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 +3 -3
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +53 -34
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +3 -3
- package/dist/index.umd.js.map +1 -1
- package/dist/lib/Cell.js +8 -1
- package/dist/lib/Cell.js.map +1 -1
- package/dist/lib/Database.js +7 -0
- package/dist/lib/Database.js.map +1 -1
- package/dist/lib/EVirtTable.d.ts +1 -0
- package/dist/lib/EVirtTable.js +9 -0
- package/dist/lib/EVirtTable.js.map +1 -1
- package/dist/lib/Editor.js +0 -3
- package/dist/lib/Editor.js.map +1 -1
- package/dist/lib/EventTable.js +1 -1
- package/dist/lib/EventTable.js.map +1 -1
- package/dist/lib/Overlayer.js +6 -1
- package/dist/lib/Overlayer.js.map +1 -1
- package/dist/lib/Row.js +1 -1
- package/dist/lib/Row.js.map +1 -1
- package/dist/lib/Selector.js +3 -1
- package/dist/lib/Selector.js.map +1 -1
- package/package.json +1 -4
package/dist/index.es.js
CHANGED
|
@@ -775,13 +775,17 @@ class vt extends qt {
|
|
|
775
775
|
getOverlayerViewsStyle() {
|
|
776
776
|
let e = this.drawX - this.ctx.fixedLeftWidth, i = this.drawY - this.ctx.body.y;
|
|
777
777
|
if (this.fixed === "left" ? e = this.drawX : this.fixed === "right" && (e = this.drawX - (this.ctx.stageWidth - this.ctx.fixedRightWidth)), this.cellType === "footer" && this.ctx.config.FOOTER_FIXED && (i = this.drawY - this.ctx.footer.y), this.autoRowHeight && this.render && this.verticalAlign === "middle") {
|
|
778
|
-
const
|
|
779
|
-
if (
|
|
780
|
-
const
|
|
781
|
-
i = i +
|
|
778
|
+
const o = this.ctx.database.getOverlayerAutoHeight(this.rowIndex, this.colIndex);
|
|
779
|
+
if (o < this.visibleHeight && o > 0) {
|
|
780
|
+
const r = (this.visibleHeight - o) / 2;
|
|
781
|
+
i = i + r;
|
|
782
782
|
}
|
|
783
783
|
}
|
|
784
|
-
|
|
784
|
+
this.autoRowHeight && this.ctx.database.getOverlayerAutoHeight(this.rowIndex, this.colIndex) === 0 && (e = -99999, i = -99999);
|
|
785
|
+
let s = {};
|
|
786
|
+
return this.rowspan === 0 && (s = {
|
|
787
|
+
display: "none"
|
|
788
|
+
}), {
|
|
785
789
|
position: "absolute",
|
|
786
790
|
overflow: "hidden",
|
|
787
791
|
left: `${Math.round(e - 1)}px`,
|
|
@@ -791,7 +795,8 @@ class vt extends qt {
|
|
|
791
795
|
// height: `${this.visibleHeight}px`,
|
|
792
796
|
// minHeight: `${this.visibleHeight}px`,
|
|
793
797
|
pointerEvents: "initial",
|
|
794
|
-
userSelect: "none"
|
|
798
|
+
userSelect: "none",
|
|
799
|
+
...s
|
|
795
800
|
};
|
|
796
801
|
}
|
|
797
802
|
drawContainer() {
|
|
@@ -1929,37 +1934,39 @@ class be {
|
|
|
1929
1934
|
return this.validationErrorMap.size !== 0;
|
|
1930
1935
|
}
|
|
1931
1936
|
getValidator(t, e) {
|
|
1932
|
-
return new Promise((
|
|
1933
|
-
|
|
1934
|
-
|
|
1935
|
-
|
|
1936
|
-
|
|
1937
|
-
|
|
1938
|
-
|
|
1939
|
-
|
|
1940
|
-
|
|
1941
|
-
|
|
1942
|
-
|
|
1943
|
-
|
|
1937
|
+
return this.ctx.database.getReadonly(t, e) ? new Promise((s) => {
|
|
1938
|
+
s([]);
|
|
1939
|
+
}) : new Promise((s) => {
|
|
1940
|
+
const o = this.rowKeyMap.get(t), r = this.headerMap.get(e), { BODY_CELL_RULES_METHOD: a } = this.ctx.config;
|
|
1941
|
+
if (o === void 0 || r === void 0)
|
|
1942
|
+
return s([]);
|
|
1943
|
+
const l = r.column;
|
|
1944
|
+
let h = l.rules;
|
|
1945
|
+
if (typeof a == "function") {
|
|
1946
|
+
const f = a({
|
|
1947
|
+
row: o.item,
|
|
1948
|
+
rowIndex: o.rowIndex,
|
|
1949
|
+
colIndex: r.colIndex,
|
|
1950
|
+
column: l,
|
|
1944
1951
|
value: this.getItemValue(t, e)
|
|
1945
1952
|
});
|
|
1946
|
-
|
|
1953
|
+
f && (h = f);
|
|
1947
1954
|
}
|
|
1948
|
-
if (
|
|
1949
|
-
const
|
|
1950
|
-
row:
|
|
1951
|
-
rowIndex:
|
|
1952
|
-
colIndex:
|
|
1953
|
-
column:
|
|
1955
|
+
if (h) {
|
|
1956
|
+
const d = {
|
|
1957
|
+
row: o.item,
|
|
1958
|
+
rowIndex: o.rowIndex,
|
|
1959
|
+
colIndex: r.colIndex,
|
|
1960
|
+
column: l,
|
|
1954
1961
|
key: e,
|
|
1955
1962
|
rowKey: t,
|
|
1956
1963
|
value: this.getItemValue(t, e),
|
|
1957
1964
|
field: e,
|
|
1958
1965
|
fieldValue: this.getItemValue(t, e)
|
|
1959
|
-
},
|
|
1960
|
-
this.setValidationError(t, e,
|
|
1966
|
+
}, u = new ue(h).validate(d);
|
|
1967
|
+
this.setValidationError(t, e, u), s(u);
|
|
1961
1968
|
} else
|
|
1962
|
-
this.clearValidationError(t, e),
|
|
1969
|
+
this.clearValidationError(t, e), s([]);
|
|
1963
1970
|
});
|
|
1964
1971
|
}
|
|
1965
1972
|
getHeightByRowIndexRowSpan(t, e) {
|
|
@@ -3479,7 +3486,7 @@ class Le {
|
|
|
3479
3486
|
});
|
|
3480
3487
|
}
|
|
3481
3488
|
hoverIconClick(t) {
|
|
3482
|
-
t.hoverIconName && this.ctx.isPointer && this.ctx.emit("hoverIconClick", t);
|
|
3489
|
+
t.hoverIconName && this.ctx.isPointer && !this.ctx.disableHoverIconClick && this.ctx.emit("hoverIconClick", t);
|
|
3483
3490
|
}
|
|
3484
3491
|
/**
|
|
3485
3492
|
*选中点击
|
|
@@ -4640,7 +4647,7 @@ class Jt {
|
|
|
4640
4647
|
updateCalculatedHeight() {
|
|
4641
4648
|
const t = this.calculatedHeightCells.map((e) => {
|
|
4642
4649
|
const i = e.getAutoHeight(), { key: s, height: o = -1 } = this.ctx.database.getMaxRowHeightItem(this.rowKey) || {};
|
|
4643
|
-
return i > o ? this.ctx.database.setMaxRowHeightItem(this.rowKey, e.key, i) :
|
|
4650
|
+
return i > o ? this.ctx.database.setMaxRowHeightItem(this.rowKey, e.key, i) : e.key === s && i < o && this.ctx.database.setMaxRowHeightItem(this.rowKey, e.key, i), i;
|
|
4644
4651
|
});
|
|
4645
4652
|
return this.calculatedHeight = t.length ? Math.max(...t) : -1, this.calculatedHeight;
|
|
4646
4653
|
}
|
|
@@ -5008,7 +5015,9 @@ class Be {
|
|
|
5008
5015
|
}
|
|
5009
5016
|
window.getComputedStyle(e.target).userSelect !== "text" && e.preventDefault(), this.isMultipleRow = !1, this.click(e.shiftKey), this.ctx.emit("selectorClick", t);
|
|
5010
5017
|
}), this.ctx.on("mouseup", () => {
|
|
5011
|
-
this.ctx.selectorMove = !1, this.ctx.stopAdjustPosition(), this.ctx.adjustPositioning = !1,
|
|
5018
|
+
this.ctx.selectorMove = !1, this.ctx.stopAdjustPosition(), this.ctx.adjustPositioning = !1, setTimeout(() => {
|
|
5019
|
+
this.ctx.disableHoverIconClick = !1;
|
|
5020
|
+
}, 0);
|
|
5012
5021
|
}), this.ctx.on("cellHeaderHoverChange", (t) => {
|
|
5013
5022
|
this.ctx.mousedown && this.selectCols(t);
|
|
5014
5023
|
}), this.ctx.on("cellHoverChange", (t) => {
|
|
@@ -6738,7 +6747,7 @@ class Oi {
|
|
|
6738
6747
|
}), this.ctx.on("onScroll", () => {
|
|
6739
6748
|
this.enable && this.doneEdit();
|
|
6740
6749
|
}), this.ctx.on("hoverIconClick", (t) => {
|
|
6741
|
-
this.
|
|
6750
|
+
this.editCell(t.rowIndex, t.colIndex);
|
|
6742
6751
|
}), this.ctx.on("cellMousedown", () => {
|
|
6743
6752
|
this.inputEl.focus({ preventScroll: !0 });
|
|
6744
6753
|
}), this.ctx.on("keydown", (t) => {
|
|
@@ -6964,7 +6973,12 @@ class Mi {
|
|
|
6964
6973
|
this.ctx.emit("draw");
|
|
6965
6974
|
}
|
|
6966
6975
|
}, 16.67)
|
|
6967
|
-
), this.observer.observe(this.ctx.overlayerElement, {
|
|
6976
|
+
), this.observer.observe(this.ctx.overlayerElement, {
|
|
6977
|
+
childList: !0,
|
|
6978
|
+
subtree: !0,
|
|
6979
|
+
attributes: !0,
|
|
6980
|
+
characterData: !0
|
|
6981
|
+
}), this.ctx.overlayerElement.getAttribute("data-overlayer") === "default" && this.ctx.on("overlayerChange", (t) => {
|
|
6968
6982
|
const e = this.ctx.overlayerElement;
|
|
6969
6983
|
e.replaceChildren(), Object.assign(e.style, t.style), t.views.forEach((i) => {
|
|
6970
6984
|
const s = document.createElement("div");
|
|
@@ -7911,7 +7925,9 @@ class Xi {
|
|
|
7911
7925
|
}
|
|
7912
7926
|
}
|
|
7913
7927
|
getValidations() {
|
|
7914
|
-
return new Promise(
|
|
7928
|
+
return this.ctx.config.DISABLED ? new Promise((t) => {
|
|
7929
|
+
t([]);
|
|
7930
|
+
}) : new Promise(async (t, e) => {
|
|
7915
7931
|
const i = this.ctx.database.getAllRowsData(), s = this.ctx.header.leafCellHeaders;
|
|
7916
7932
|
let o = [];
|
|
7917
7933
|
for (let r = 0; r < i.length; r++)
|
|
@@ -8012,6 +8028,9 @@ class Xi {
|
|
|
8012
8028
|
clearChangeData() {
|
|
8013
8029
|
this.ctx.database.clearChangeData(), this.ctx.emit("draw");
|
|
8014
8030
|
}
|
|
8031
|
+
getReadonly(t, e) {
|
|
8032
|
+
return this.ctx.database.getReadonly(t, e);
|
|
8033
|
+
}
|
|
8015
8034
|
/**
|
|
8016
8035
|
* 销毁
|
|
8017
8036
|
*/
|