e-virt-table 1.1.6 → 1.1.8
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 +82 -76
- 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/Body.d.ts +1 -0
- package/dist/lib/Body.js +22 -11
- package/dist/lib/Body.js.map +1 -1
- package/dist/lib/Cell.js +7 -1
- package/dist/lib/Cell.js.map +1 -1
- package/dist/lib/Config.js +1 -1
- package/dist/lib/Config.js.map +1 -1
- package/dist/lib/EVirtTable.js +0 -1
- package/dist/lib/EVirtTable.js.map +1 -1
- package/dist/lib/Editor.js +10 -2
- package/dist/lib/Editor.js.map +1 -1
- package/dist/lib/EventBrowser.js +1 -0
- package/dist/lib/EventBrowser.js.map +1 -1
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -583,27 +583,27 @@ var Rt = vt(), nt = /* @__PURE__ */ function() {
|
|
|
583
583
|
v === void 0 && (v = []);
|
|
584
584
|
var O = Array.isArray(v) ? v : [v];
|
|
585
585
|
!h.suppressWarning && O.length && a.warning("async-validator:", O), O.length && y.message !== void 0 && (O = [].concat(y.message));
|
|
586
|
-
var
|
|
587
|
-
if (h.first &&
|
|
588
|
-
return p[y.field] = 1, w(
|
|
586
|
+
var S = O.map(Nt(y, n));
|
|
587
|
+
if (h.first && S.length)
|
|
588
|
+
return p[y.field] = 1, w(S);
|
|
589
589
|
if (!E)
|
|
590
|
-
w(
|
|
590
|
+
w(S);
|
|
591
591
|
else {
|
|
592
592
|
if (y.required && !u.value)
|
|
593
|
-
return y.message !== void 0 ?
|
|
593
|
+
return y.message !== void 0 ? S = [].concat(y.message).map(Nt(y, n)) : h.error && (S = [h.error(y, D(h.messages.required, y.field))]), w(S);
|
|
594
594
|
var I = {};
|
|
595
|
-
y.defaultField && Object.keys(u.value).map(function(
|
|
596
|
-
I[
|
|
595
|
+
y.defaultField && Object.keys(u.value).map(function(L) {
|
|
596
|
+
I[L] = y.defaultField;
|
|
597
597
|
}), I = G({}, I, u.rule.fields);
|
|
598
598
|
var R = {};
|
|
599
|
-
Object.keys(I).forEach(function(
|
|
600
|
-
var M = I[
|
|
601
|
-
R[
|
|
599
|
+
Object.keys(I).forEach(function(L) {
|
|
600
|
+
var M = I[L], T = Array.isArray(M) ? M : [M];
|
|
601
|
+
R[L] = T.map(m.bind(null, L));
|
|
602
602
|
});
|
|
603
603
|
var A = new a(R);
|
|
604
|
-
A.messages(h.messages), u.rule.options && (u.rule.options.messages = h.messages, u.rule.options.error = h.error), A.validate(u.value, u.rule.options || h, function(
|
|
604
|
+
A.messages(h.messages), u.rule.options && (u.rule.options.messages = h.messages, u.rule.options.error = h.error), A.validate(u.value, u.rule.options || h, function(L) {
|
|
605
605
|
var M = [];
|
|
606
|
-
|
|
606
|
+
S && S.length && M.push.apply(M, S), L && L.length && M.push.apply(M, L), w(M.length ? M : null);
|
|
607
607
|
});
|
|
608
608
|
}
|
|
609
609
|
}
|
|
@@ -1050,14 +1050,14 @@ class Tt extends se {
|
|
|
1050
1050
|
if (this.cellType === "footer") {
|
|
1051
1051
|
let b = n, v = o;
|
|
1052
1052
|
if (typeof r == "function") {
|
|
1053
|
-
const O = r, { backgroundColor:
|
|
1053
|
+
const O = r, { backgroundColor: S, color: I } = O({
|
|
1054
1054
|
row: this.row,
|
|
1055
1055
|
rowIndex: this.rowIndex,
|
|
1056
1056
|
colIndex: this.colIndex,
|
|
1057
1057
|
column: this.column,
|
|
1058
1058
|
value: this.getValue()
|
|
1059
1059
|
}) || {};
|
|
1060
|
-
|
|
1060
|
+
S && (b = S), I && (v = I);
|
|
1061
1061
|
}
|
|
1062
1062
|
this.drawCellSkyBgColor = "transparent", this.drawCellBgColor = b, this.drawTextColor = v;
|
|
1063
1063
|
return;
|
|
@@ -1247,7 +1247,7 @@ class Tt extends se {
|
|
|
1247
1247
|
this.ellipsis = r;
|
|
1248
1248
|
const { placeholder: o } = this.column;
|
|
1249
1249
|
let n = this.displayText, h = this.drawTextColor;
|
|
1250
|
-
return o && ["", null, void 0].includes(this.text) && this.cellType === "body" && (n = o, h = s), this.ctx.paint.drawText(n, this.drawTextX, this.drawTextY, this.visibleWidth, this.visibleHeight, {
|
|
1250
|
+
return !this.ctx.database.getReadonly(this.rowKey, this.key) && o && ["", null, void 0].includes(this.text) && this.cellType === "body" && !(this.rowspan === 0 || this.colspan === 0) && (n = o, h = s), this.ctx.paint.drawText(n, this.drawTextX, this.drawTextY, this.visibleWidth, this.visibleHeight, {
|
|
1251
1251
|
font: i,
|
|
1252
1252
|
padding: e,
|
|
1253
1253
|
align: this.align,
|
|
@@ -2153,29 +2153,29 @@ class ni {
|
|
|
2153
2153
|
}
|
|
2154
2154
|
]
|
|
2155
2155
|
};
|
|
2156
|
-
let w = e, y = e, E = n, m = n, C = [], b = 0, v = 0, O = 0,
|
|
2156
|
+
let w = e, y = e, E = n, m = n, C = [], b = 0, v = 0, O = 0, S = 0;
|
|
2157
2157
|
if (d !== 1 && p) {
|
|
2158
|
-
|
|
2158
|
+
S = x;
|
|
2159
2159
|
const I = h.reduce((R, A) => {
|
|
2160
|
-
const
|
|
2161
|
-
return `${R}${
|
|
2160
|
+
const L = this.getItemValue(s, A) ?? "";
|
|
2161
|
+
return `${R}${L}`;
|
|
2162
2162
|
}, "");
|
|
2163
2163
|
for (let R = e - 1; R >= 0; R--) {
|
|
2164
|
-
const A = this.rowIndexRowKeyMap.get(R) || "",
|
|
2164
|
+
const A = this.rowIndexRowKeyMap.get(R) || "", L = h.reduce((M, T) => {
|
|
2165
2165
|
const N = this.getItemValue(A, T) ?? "";
|
|
2166
2166
|
return `${M}${N}`;
|
|
2167
2167
|
}, "");
|
|
2168
|
-
if (I ===
|
|
2168
|
+
if (I === L)
|
|
2169
2169
|
w = R;
|
|
2170
2170
|
else
|
|
2171
2171
|
break;
|
|
2172
2172
|
}
|
|
2173
2173
|
for (let R = e; R <= this.ctx.maxRowIndex; R++) {
|
|
2174
|
-
const A = this.rowIndexRowKeyMap.get(R) || "",
|
|
2174
|
+
const A = this.rowIndexRowKeyMap.get(R) || "", L = h.reduce((M, T) => {
|
|
2175
2175
|
const N = this.getItemValue(A, T) ?? "";
|
|
2176
2176
|
return `${M}${N}`;
|
|
2177
2177
|
}, "");
|
|
2178
|
-
if (I ===
|
|
2178
|
+
if (I === L)
|
|
2179
2179
|
y = R;
|
|
2180
2180
|
else
|
|
2181
2181
|
break;
|
|
@@ -2187,9 +2187,9 @@ class ni {
|
|
|
2187
2187
|
for (let R = w; R <= y; R++) {
|
|
2188
2188
|
const { height: A } = this.positions[R];
|
|
2189
2189
|
O += A;
|
|
2190
|
-
const
|
|
2190
|
+
const L = this.rowIndexRowKeyMap.get(R) || "", { item: M } = this.rowKeyMap.get(L), T = this.getItemValue(L, i);
|
|
2191
2191
|
C.push({
|
|
2192
|
-
rowKey:
|
|
2192
|
+
rowKey: L,
|
|
2193
2193
|
key: i,
|
|
2194
2194
|
value: T,
|
|
2195
2195
|
row: M
|
|
@@ -2202,8 +2202,8 @@ class ni {
|
|
|
2202
2202
|
const R = this.getColumnByColIndex(I);
|
|
2203
2203
|
if (!R)
|
|
2204
2204
|
break;
|
|
2205
|
-
const A = this.getItemValue(s, i),
|
|
2206
|
-
if (A ===
|
|
2205
|
+
const A = this.getItemValue(s, i), L = this.getItemValue(s, R.key);
|
|
2206
|
+
if (A === L && c.includes(R.key))
|
|
2207
2207
|
E = I;
|
|
2208
2208
|
else
|
|
2209
2209
|
break;
|
|
@@ -2212,8 +2212,8 @@ class ni {
|
|
|
2212
2212
|
const R = this.getColumnByColIndex(I);
|
|
2213
2213
|
if (!R)
|
|
2214
2214
|
break;
|
|
2215
|
-
const A = this.getItemValue(s, i),
|
|
2216
|
-
if (A ===
|
|
2215
|
+
const A = this.getItemValue(s, i), L = this.getItemValue(s, R.key);
|
|
2216
|
+
if (A === L && c.includes(R.key))
|
|
2217
2217
|
m = I;
|
|
2218
2218
|
else
|
|
2219
2219
|
break;
|
|
@@ -2228,7 +2228,7 @@ class ni {
|
|
|
2228
2228
|
const R = this.getColumnByColIndex(I);
|
|
2229
2229
|
if (!R)
|
|
2230
2230
|
break;
|
|
2231
|
-
|
|
2231
|
+
S += R.width || 100, C.push({
|
|
2232
2232
|
rowKey: s,
|
|
2233
2233
|
key: R.key,
|
|
2234
2234
|
value: this.getItemValue(s, R.key),
|
|
@@ -2242,7 +2242,7 @@ class ni {
|
|
|
2242
2242
|
rowspan: d,
|
|
2243
2243
|
colspan: g,
|
|
2244
2244
|
height: O,
|
|
2245
|
-
width:
|
|
2245
|
+
width: S,
|
|
2246
2246
|
offsetTop: b,
|
|
2247
2247
|
offsetLeft: v,
|
|
2248
2248
|
dataList: C
|
|
@@ -2370,7 +2370,7 @@ class li {
|
|
|
2370
2370
|
this.ctx.emit("resetHeader", t), this.ctx.emit("resize", t);
|
|
2371
2371
|
}
|
|
2372
2372
|
handleMouseDown(t) {
|
|
2373
|
-
t.button === 0 && (this.ctx.mousedown = !0), this.ctx.emit("mousedown", t);
|
|
2373
|
+
t.button === 0 && (this.ctx.mousedown = !0), this.ctx.containerElement.focus(), this.ctx.emit("mousedown", t);
|
|
2374
2374
|
}
|
|
2375
2375
|
handleMousemove(t) {
|
|
2376
2376
|
this.ctx.emit("mousemove", t);
|
|
@@ -2659,7 +2659,7 @@ class Wt {
|
|
|
2659
2659
|
l(this, "FOOTER_FIXED", !0);
|
|
2660
2660
|
l(this, "FOOTER_POSITION", "bottom");
|
|
2661
2661
|
l(this, "CELL_FOOTER_HEIGHT", 36);
|
|
2662
|
-
l(this, "ENABLE_SELECTOR", !
|
|
2662
|
+
l(this, "ENABLE_SELECTOR", !0);
|
|
2663
2663
|
l(this, "ENABLE_EDIT_SINGLE_CLICK", !1);
|
|
2664
2664
|
// 启用单点击立马编辑
|
|
2665
2665
|
l(this, "ENABLE_EDIT_CLICK_SELECTOR", !0);
|
|
@@ -3870,6 +3870,7 @@ class wi {
|
|
|
3870
3870
|
l(this, "visibleRows", []);
|
|
3871
3871
|
l(this, "visibleHeight", 0);
|
|
3872
3872
|
l(this, "visibleWidth", 0);
|
|
3873
|
+
l(this, "containerRect");
|
|
3873
3874
|
l(this, "data", []);
|
|
3874
3875
|
this.ctx = t, this.init(), this.initResizeRow();
|
|
3875
3876
|
}
|
|
@@ -3894,41 +3895,46 @@ class wi {
|
|
|
3894
3895
|
return;
|
|
3895
3896
|
this.x = 0, x === "top" && r ? this.y = e.height + i.height : this.y = e.height;
|
|
3896
3897
|
const { data: g, sumHeight: p } = s.getData();
|
|
3897
|
-
this.height = p, this.data = g;
|
|
3898
|
-
const
|
|
3899
|
-
this.
|
|
3900
|
-
const w = this.
|
|
3901
|
-
!this.data.length && !n ? this.height = h : !this.data.length && n && (this.height = n - e.height - w - o);
|
|
3902
|
-
const y = this.data.length ? "not-empty" : "empty";
|
|
3898
|
+
this.height = p, this.data = g, this.width = e.width, this.visibleWidth = this.ctx.stageWidth - o;
|
|
3899
|
+
const u = this.ctx.footer.height;
|
|
3900
|
+
!this.data.length && !n ? this.height = h : !this.data.length && n && (this.height = n - e.height - u - o);
|
|
3901
|
+
const w = this.data.length ? "not-empty" : "empty";
|
|
3903
3902
|
this.ctx.emit("emptyChange", {
|
|
3904
|
-
isEmpty:
|
|
3905
|
-
type:
|
|
3903
|
+
isEmpty: w,
|
|
3904
|
+
type: w,
|
|
3906
3905
|
headerHeight: e.height,
|
|
3907
3906
|
bodyHeight: this.height,
|
|
3908
|
-
footerHeight:
|
|
3907
|
+
footerHeight: u,
|
|
3909
3908
|
width: this.width,
|
|
3910
|
-
height: this.data.length ? 0 : h +
|
|
3909
|
+
height: this.data.length ? 0 : h + u
|
|
3911
3910
|
});
|
|
3912
|
-
let
|
|
3913
|
-
|
|
3914
|
-
let
|
|
3915
|
-
|
|
3916
|
-
|
|
3917
|
-
|
|
3918
|
-
|
|
3919
|
-
|
|
3920
|
-
|
|
3921
|
-
|
|
3911
|
+
let y = this.height + e.height + o;
|
|
3912
|
+
y += u;
|
|
3913
|
+
let E = y;
|
|
3914
|
+
const m = window.innerHeight, { top: C } = this.containerRect || this.ctx.containerElement.getBoundingClientRect();
|
|
3915
|
+
if (this.data.length && m > C && d && !n) {
|
|
3916
|
+
const R = m - C - f;
|
|
3917
|
+
R > e.height + o ? E = R : y > c && (E = c);
|
|
3918
|
+
} else this.data.length && n ? E = n : this.data.length && c && y > c && (E = c);
|
|
3919
|
+
E > 0 && (this.ctx.stageHeight = Math.floor(E), this.ctx.stageElement.style.height = `${this.ctx.stageHeight - 0.5}px`);
|
|
3920
|
+
let b = this.ctx.stageHeight - e.height - o;
|
|
3921
|
+
r ? this.visibleHeight = b - u : this.visibleHeight = b, this.ctx.body.x = this.x, this.ctx.body.y = this.y, this.ctx.body.width = this.width, this.ctx.body.height = this.height, this.ctx.body.visibleWidth = this.visibleWidth, this.ctx.body.visibleHeight = this.visibleHeight, this.ctx.body.data = g;
|
|
3922
|
+
const v = window.devicePixelRatio || 1, O = this.ctx.stageWidth * v, S = this.ctx.stageHeight * v;
|
|
3923
|
+
t.width = Math.floor(O), t.height = Math.floor(S), this.ctx.canvasElement.setAttribute(
|
|
3922
3924
|
"style",
|
|
3923
3925
|
` height:${this.ctx.stageHeight}px;width:${this.ctx.stageWidth}px;`
|
|
3924
|
-
), this.ctx.paint.scale(
|
|
3926
|
+
), this.ctx.paint.scale(v);
|
|
3925
3927
|
}
|
|
3926
3928
|
// 调整行的高度
|
|
3927
3929
|
initResizeRow() {
|
|
3928
3930
|
const {
|
|
3929
3931
|
config: { ENABLE_RESIZE_ROW: t }
|
|
3930
3932
|
} = this.ctx;
|
|
3931
|
-
t && (this.ctx.on("
|
|
3933
|
+
t && (this.ctx.on("resize", () => {
|
|
3934
|
+
this.containerRect = this.ctx.containerElement.getBoundingClientRect();
|
|
3935
|
+
}), this.ctx.on("resizeObserver", () => {
|
|
3936
|
+
this.containerRect = this.ctx.containerElement.getBoundingClientRect();
|
|
3937
|
+
}), this.ctx.on("mouseup", () => {
|
|
3932
3938
|
this.isMouseDown = !1, this.resizeDiff !== 0 && this.resizeTarget && this.resizeRow(this.resizeTarget, this.resizeDiff), this.resizeTarget = null, this.resizeDiff = 0, this.isResizing = !1, setTimeout(() => {
|
|
3933
3939
|
this.ctx.rowResizing = !1;
|
|
3934
3940
|
}, 0), this.clientY = 0;
|
|
@@ -4650,9 +4656,9 @@ class yi {
|
|
|
4650
4656
|
const { drawX: u, drawY: w, width: y, height: E, fixed: m } = i, C = r - u + 1, b = i.drawX + y - (e - s) + 1;
|
|
4651
4657
|
let v = o.height - w, O = E;
|
|
4652
4658
|
O > h.visibleHeight && (O = h.visibleHeight);
|
|
4653
|
-
let
|
|
4654
|
-
x && (g === "top" ? v = o.height + n.height - w :
|
|
4655
|
-
const I = w + O - (t -
|
|
4659
|
+
let S = 0;
|
|
4660
|
+
x && (g === "top" ? v = o.height + n.height - w : S = n.visibleHeight);
|
|
4661
|
+
const I = w + O - (t - S - f);
|
|
4656
4662
|
let R = c, A = d;
|
|
4657
4663
|
b > 0 && !m ? R = Math.floor(c + b) : C > 0 && !m && (R = Math.floor(c - C)), v > 0 ? A = Math.floor(d - v) : I > 0 && (A = Math.floor(d + I)), (Math.abs(c - R) > 2 || Math.abs(d - A) > 2) && (this.ctx.adjustPositioning = !0, this.ctx.setScroll(R, A), this.ctx.emit("adjustBoundaryPosition", i));
|
|
4658
4664
|
}
|
|
@@ -4725,14 +4731,14 @@ class mi {
|
|
|
4725
4731
|
o = [Math.max(p, E), Math.min(u, m)], n = [Math.max(w, C), Math.min(y, b)];
|
|
4726
4732
|
const { BEFORE_SET_AUTOFILL_METHOD: v } = this.ctx.config;
|
|
4727
4733
|
if (typeof v == "function") {
|
|
4728
|
-
const
|
|
4734
|
+
const S = v({
|
|
4729
4735
|
focusCell: this.ctx.focusCell,
|
|
4730
4736
|
xArr: o,
|
|
4731
4737
|
yArr: n
|
|
4732
4738
|
});
|
|
4733
|
-
if (!
|
|
4739
|
+
if (!S)
|
|
4734
4740
|
return;
|
|
4735
|
-
o =
|
|
4741
|
+
o = S.xArr, n = S.yArr;
|
|
4736
4742
|
}
|
|
4737
4743
|
this.ctx.autofill.xArr = o, this.ctx.autofill.yArr = n, this.ctx.emit("setAutofill", this.ctx.autofill), this.ctx.emit("draw");
|
|
4738
4744
|
}
|
|
@@ -5086,7 +5092,7 @@ const Si = (a) => ({
|
|
|
5086
5092
|
}, g = Ht(s), p = Mt(g), u = await o.getDimensions(c), w = g === "y", y = w ? "top" : "left", E = w ? "bottom" : "right", m = w ? "clientHeight" : "clientWidth", C = r.reference[p] + r.reference[g] - x[g] - r.floating[p], b = x[g] - r.reference[g], v = await (o.getOffsetParent == null ? void 0 : o.getOffsetParent(c));
|
|
5087
5093
|
let O = v ? v[m] : 0;
|
|
5088
5094
|
(!O || !await (o.isElement == null ? void 0 : o.isElement(v))) && (O = n.floating[m] || r.floating[p]);
|
|
5089
|
-
const
|
|
5095
|
+
const S = C / 2 - b / 2, I = O / 2 - u[p] / 2 - 1, R = rt(f[y], I), A = rt(f[E], I), L = R, M = O - u[p] - A, T = O / 2 - u[p] / 2 + S, N = _t(L, T, M), Y = !h.arrow && lt(s) != null && T !== N && r.reference[p] / 2 - (T < L ? R : A) - u[p] / 2 < 0, B = Y ? T < L ? T - L : T - M : 0;
|
|
5090
5096
|
return {
|
|
5091
5097
|
[g]: x[g] + B,
|
|
5092
5098
|
data: {
|
|
@@ -5125,17 +5131,17 @@ const Si = (a) => ({
|
|
|
5125
5131
|
return {};
|
|
5126
5132
|
const y = q(s), E = J(n), m = q(n) === n, C = await (h.isRTL == null ? void 0 : h.isRTL(c.floating)), b = x || (m || !u ? [xt(n)] : vi(n)), v = p !== "none";
|
|
5127
5133
|
!x && v && b.push(...Ii(n, u, p, C));
|
|
5128
|
-
const O = [n, ...b],
|
|
5134
|
+
const O = [n, ...b], S = await le(t, w), I = [];
|
|
5129
5135
|
let R = ((i = r.flip) == null ? void 0 : i.overflows) || [];
|
|
5130
|
-
if (d && I.push(
|
|
5136
|
+
if (d && I.push(S[y]), f) {
|
|
5131
5137
|
const T = bi(s, o, C);
|
|
5132
|
-
I.push(
|
|
5138
|
+
I.push(S[T[0]], S[T[1]]);
|
|
5133
5139
|
}
|
|
5134
5140
|
if (R = [...R, {
|
|
5135
5141
|
placement: s,
|
|
5136
5142
|
overflows: I
|
|
5137
5143
|
}], !I.every((T) => T <= 0)) {
|
|
5138
|
-
var A,
|
|
5144
|
+
var A, L;
|
|
5139
5145
|
const T = (((A = r.flip) == null ? void 0 : A.index) || 0) + 1, N = O[T];
|
|
5140
5146
|
if (N)
|
|
5141
5147
|
return {
|
|
@@ -5147,7 +5153,7 @@ const Si = (a) => ({
|
|
|
5147
5153
|
placement: N
|
|
5148
5154
|
}
|
|
5149
5155
|
};
|
|
5150
|
-
let Y = (
|
|
5156
|
+
let Y = (L = R.filter((B) => B.overflows[0] <= 0).sort((B, W) => B.overflows[1] - W.overflows[1])[0]) == null ? void 0 : L.placement;
|
|
5151
5157
|
if (!Y)
|
|
5152
5158
|
switch (g) {
|
|
5153
5159
|
case "bestFit": {
|
|
@@ -5818,7 +5824,7 @@ class Zi {
|
|
|
5818
5824
|
}), this.ctx.on("hoverIconClick", (t) => {
|
|
5819
5825
|
t.editorType !== "none" && this.editCell(t.rowIndex, t.colIndex);
|
|
5820
5826
|
}), this.ctx.on("keydown", (t) => {
|
|
5821
|
-
if (!this.ctx.isTarget(t))
|
|
5827
|
+
if (!this.ctx.isTarget(t) || !this.ctx.focusCell)
|
|
5822
5828
|
return;
|
|
5823
5829
|
if (t.code === "Escape" && this.ctx.editing) {
|
|
5824
5830
|
this.cancel = !0;
|
|
@@ -5907,7 +5913,7 @@ class Zi {
|
|
|
5907
5913
|
}
|
|
5908
5914
|
initTextEditor() {
|
|
5909
5915
|
this.inputEl = document.createElement("textarea"), this.inputEl.setAttribute("rows", "1"), this.inputEl.addEventListener("input", this.autoSize.bind(this)), this.inputEl.addEventListener("blur", () => {
|
|
5910
|
-
this.doneEdit()
|
|
5916
|
+
this.doneEdit();
|
|
5911
5917
|
}), this.editorEl = this.ctx.editorElement, this.inputEl.className = "e-virt-table-editor-textarea", this.editorEl.appendChild(this.inputEl), this.ctx.containerElement.appendChild(this.editorEl);
|
|
5912
5918
|
}
|
|
5913
5919
|
autoSize() {
|
|
@@ -5952,13 +5958,13 @@ class Zi {
|
|
|
5952
5958
|
if (!e)
|
|
5953
5959
|
return;
|
|
5954
5960
|
const i = this.ctx.focusCell;
|
|
5955
|
-
if (!i || ["index", "index-selection", "selection"].includes(i.type) || this.enable)
|
|
5961
|
+
if (!i || ["index", "index-selection", "selection"].includes(i.type) || this.enable || !(i.isVerticalVisible() && i.isHorizontalVisible()))
|
|
5956
5962
|
return;
|
|
5957
|
-
const { rowKey:
|
|
5958
|
-
if (
|
|
5963
|
+
const { rowKey: r, key: o, editorType: n } = i;
|
|
5964
|
+
if (n === "none")
|
|
5959
5965
|
return;
|
|
5960
|
-
const
|
|
5961
|
-
i && !
|
|
5966
|
+
const h = this.ctx.database.getReadonly(r, o);
|
|
5967
|
+
i && !h && (this.enable = !0, this.ctx.editing = !0, this.cellTarget = i, this.startEditByInput(this.cellTarget, t), this.ctx.emit("startEdit", this.cellTarget));
|
|
5962
5968
|
}
|
|
5963
5969
|
editCell(t, e) {
|
|
5964
5970
|
const i = this.ctx.body.renderRows.find((c) => c.rowIndex === t);
|
|
@@ -5978,7 +5984,7 @@ class Zi {
|
|
|
5978
5984
|
this.enable && (this.doneEditByInput(), this.ctx.emit("doneEdit", this.cellTarget), this.enable = !1, this.ctx.editing = !1, this.ctx.containerElement.focus(), this.editorEl.style.display = "none", this.ctx.emit("drawView"));
|
|
5979
5985
|
}
|
|
5980
5986
|
clearEditor() {
|
|
5981
|
-
this.doneEdit(), this.cellTarget = null, this.selectorArrStr = "", this.ctx.clearSelector(), this.ctx.emit("drawView");
|
|
5987
|
+
this.doneEdit(), this.cellTarget = null, this.selectorArrStr = "", this.ctx.clearSelector(), this.ctx.focusCell = void 0, this.ctx.emit("drawView");
|
|
5982
5988
|
}
|
|
5983
5989
|
destroy() {
|
|
5984
5990
|
var t;
|
|
@@ -6414,7 +6420,7 @@ class ss {
|
|
|
6414
6420
|
});
|
|
6415
6421
|
}
|
|
6416
6422
|
async validate(t = !0) {
|
|
6417
|
-
return
|
|
6423
|
+
return new Promise(async (e, i) => {
|
|
6418
6424
|
try {
|
|
6419
6425
|
const s = await this.getValidations();
|
|
6420
6426
|
e(s);
|