e-virt-table 0.1.23 → 0.1.25
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/README.md +4 -0
- package/dist/index.cjs.js +4 -4
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +341 -334
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +4 -4
- package/dist/index.umd.js.map +1 -1
- package/dist/lib/Cell.js +7 -7
- package/dist/lib/Cell.js.map +1 -1
- package/dist/lib/Config.d.ts +2 -1
- package/dist/lib/Config.js +12 -6
- package/dist/lib/Config.js.map +1 -1
- package/dist/lib/Database.js +5 -0
- package/dist/lib/Database.js.map +1 -1
- package/dist/lib/Editor.js +0 -1
- package/dist/lib/Editor.js.map +1 -1
- package/dist/lib/EventBrowser.d.ts +2 -2
- package/dist/lib/EventBrowser.js +6 -10
- package/dist/lib/EventBrowser.js.map +1 -1
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -157,7 +157,7 @@ var Xt = /* @__PURE__ */ function(n) {
|
|
|
157
157
|
}
|
|
158
158
|
return t;
|
|
159
159
|
}(/* @__PURE__ */ bt(Error));
|
|
160
|
-
function
|
|
160
|
+
function Ae(n, t, e, i, s) {
|
|
161
161
|
if (t.first) {
|
|
162
162
|
var r = new Promise(function(x, u) {
|
|
163
163
|
var g = function(y) {
|
|
@@ -169,24 +169,24 @@ function Se(n, t, e, i, s) {
|
|
|
169
169
|
return x;
|
|
170
170
|
}), r;
|
|
171
171
|
}
|
|
172
|
-
var o = t.firstFields === !0 ? Object.keys(n) : t.firstFields || [], a = Object.keys(n), h = a.length, c = 0,
|
|
172
|
+
var o = t.firstFields === !0 ? Object.keys(n) : t.firstFields || [], a = Object.keys(n), h = a.length, c = 0, d = [], f = new Promise(function(x, u) {
|
|
173
173
|
var g = function(p) {
|
|
174
|
-
if (
|
|
175
|
-
return i(
|
|
174
|
+
if (d.push.apply(d, p), c++, c === h)
|
|
175
|
+
return i(d), d.length ? u(new Xt(d, Ct(d))) : x(s);
|
|
176
176
|
};
|
|
177
|
-
a.length || (i(
|
|
177
|
+
a.length || (i(d), x(s)), a.forEach(function(w) {
|
|
178
178
|
var p = n[w];
|
|
179
179
|
o.indexOf(w) !== -1 ? Ft(p, e, g) : Ie(p, e, g);
|
|
180
180
|
});
|
|
181
181
|
});
|
|
182
|
-
return
|
|
182
|
+
return f.catch(function(x) {
|
|
183
183
|
return x;
|
|
184
|
-
}),
|
|
184
|
+
}), f;
|
|
185
185
|
}
|
|
186
|
-
function
|
|
186
|
+
function Te(n) {
|
|
187
187
|
return !!(n && n.message !== void 0);
|
|
188
188
|
}
|
|
189
|
-
function
|
|
189
|
+
function Se(n, t) {
|
|
190
190
|
for (var e = n, i = 0; i < t.length; i++) {
|
|
191
191
|
if (e == null)
|
|
192
192
|
return e;
|
|
@@ -197,7 +197,7 @@ function Te(n, t) {
|
|
|
197
197
|
function kt(n, t) {
|
|
198
198
|
return function(e) {
|
|
199
199
|
var i;
|
|
200
|
-
return n.fullFields ? i =
|
|
200
|
+
return n.fullFields ? i = Se(t, n.fullFields) : i = t[e.field || n.fullField], Te(e) ? (e.field = e.field || n.fullField, e.fieldValue = i, e) : {
|
|
201
201
|
message: typeof e == "function" ? e() : e,
|
|
202
202
|
fieldValue: i,
|
|
203
203
|
field: e.field || n.fullField
|
|
@@ -242,7 +242,7 @@ var jt = function(t, e, i, s, r, o) {
|
|
|
242
242
|
}, h.v6 = function(m) {
|
|
243
243
|
return m && m.exact ? a : new RegExp("" + t(m) + s + t(m), "g");
|
|
244
244
|
};
|
|
245
|
-
var c = "(?:(?:[a-z]+:)?//)",
|
|
245
|
+
var c = "(?:(?:[a-z]+:)?//)", d = "(?:\\S+(?::\\S*)?@)?", f = h.v4().source, x = h.v6().source, u = "(?:(?:[a-z\\u00a1-\\uffff0-9][-_]*)*[a-z\\u00a1-\\uffff0-9]+)", g = "(?:\\.(?:[a-z\\u00a1-\\uffff0-9]-*)*[a-z\\u00a1-\\uffff0-9]+)*", w = "(?:\\.(?:[a-z\\u00a1-\\uffff]{2,}))", p = "(?::\\d{2,5})?", y = '(?:[/?#][^\\s"]*)?', b = "(?:" + c + "|www\\.)" + d + "(?:localhost|" + f + "|" + x + "|" + u + g + w + ")" + p + y;
|
|
246
246
|
return ct = new RegExp("(?:^" + b + "$)", "i"), ct;
|
|
247
247
|
}, Kt = {
|
|
248
248
|
// http://emailregex.com/
|
|
@@ -300,10 +300,10 @@ var jt = function(t, e, i, s, r, o) {
|
|
|
300
300
|
var o = ["integer", "float", "array", "regexp", "object", "method", "email", "number", "date", "url", "hex"], a = t.type;
|
|
301
301
|
o.indexOf(a) > -1 ? et[a](e) || s.push(M(r.messages.types[a], t.fullField, t.type)) : a && typeof e !== t.type && s.push(M(r.messages.types[a], t.fullField, t.type));
|
|
302
302
|
}, De = function(t, e, i, s, r) {
|
|
303
|
-
var o = typeof t.len == "number", a = typeof t.min == "number", h = typeof t.max == "number", c = /[\uD800-\uDBFF][\uDC00-\uDFFF]/g,
|
|
304
|
-
if (x ?
|
|
303
|
+
var o = typeof t.len == "number", a = typeof t.min == "number", h = typeof t.max == "number", c = /[\uD800-\uDBFF][\uDC00-\uDFFF]/g, d = e, f = null, x = typeof e == "number", u = typeof e == "string", g = Array.isArray(e);
|
|
304
|
+
if (x ? f = "number" : u ? f = "string" : g && (f = "array"), !f)
|
|
305
305
|
return !1;
|
|
306
|
-
g && (
|
|
306
|
+
g && (d = e.length), u && (d = e.replace(c, "_").length), o ? d !== t.len && s.push(M(r.messages[f].len, t.fullField, t.len)) : a && !h && d < t.min ? s.push(M(r.messages[f].min, t.fullField, t.min)) : h && !a && d > t.max ? s.push(M(r.messages[f].max, t.fullField, t.max)) : a && h && (d < t.min || d > t.max) && s.push(M(r.messages[f].range, t.fullField, t.min, t.max));
|
|
307
307
|
}, j = "enum", Fe = function(t, e, i, s, r) {
|
|
308
308
|
t[j] = Array.isArray(t[j]) ? t[j] : [], t[j].indexOf(e) === -1 && s.push(M(r.messages[j], t.fullField, t[j].join(", ")));
|
|
309
309
|
}, Xe = function(t, e, i, s, r) {
|
|
@@ -536,7 +536,7 @@ var Rt = vt(), nt = /* @__PURE__ */ function() {
|
|
|
536
536
|
var a = i, h = s, c = r;
|
|
537
537
|
if (typeof h == "function" && (c = h, h = {}), !this.rules || Object.keys(this.rules).length === 0)
|
|
538
538
|
return c && c(null, a), Promise.resolve(a);
|
|
539
|
-
function
|
|
539
|
+
function d(w) {
|
|
540
540
|
var p = [], y = {};
|
|
541
541
|
function b(E) {
|
|
542
542
|
if (Array.isArray(E)) {
|
|
@@ -550,8 +550,8 @@ var Rt = vt(), nt = /* @__PURE__ */ function() {
|
|
|
550
550
|
p.length ? (y = Ct(p), c(p, y)) : c(null, a);
|
|
551
551
|
}
|
|
552
552
|
if (h.messages) {
|
|
553
|
-
var
|
|
554
|
-
|
|
553
|
+
var f = this.messages();
|
|
554
|
+
f === Rt && (f = vt()), Nt(f, h.messages), h.messages = f;
|
|
555
555
|
} else
|
|
556
556
|
h.messages = this.messages();
|
|
557
557
|
var x = {}, u = h.keys || Object.keys(this.rules);
|
|
@@ -570,40 +570,40 @@ var Rt = vt(), nt = /* @__PURE__ */ function() {
|
|
|
570
570
|
});
|
|
571
571
|
});
|
|
572
572
|
var g = {};
|
|
573
|
-
return
|
|
573
|
+
return Ae(x, h, function(w, p) {
|
|
574
574
|
var y = w.rule, b = (y.type === "object" || y.type === "array") && (typeof y.fields == "object" || typeof y.defaultField == "object");
|
|
575
575
|
b = b && (y.required || !y.required && w.value), y.field = w.field;
|
|
576
|
-
function m(R,
|
|
577
|
-
return $({},
|
|
576
|
+
function m(R, A) {
|
|
577
|
+
return $({}, A, {
|
|
578
578
|
fullField: y.fullField + "." + R,
|
|
579
579
|
fullFields: y.fullFields ? [].concat(y.fullFields, [R]) : [R]
|
|
580
580
|
});
|
|
581
581
|
}
|
|
582
582
|
function E(R) {
|
|
583
583
|
R === void 0 && (R = []);
|
|
584
|
-
var
|
|
585
|
-
!h.suppressWarning &&
|
|
586
|
-
var
|
|
587
|
-
if (h.first &&
|
|
588
|
-
return g[y.field] = 1, p(
|
|
584
|
+
var A = Array.isArray(R) ? R : [R];
|
|
585
|
+
!h.suppressWarning && A.length && n.warning("async-validator:", A), A.length && y.message !== void 0 && (A = [].concat(y.message));
|
|
586
|
+
var S = A.map(kt(y, a));
|
|
587
|
+
if (h.first && S.length)
|
|
588
|
+
return g[y.field] = 1, p(S);
|
|
589
589
|
if (!b)
|
|
590
|
-
p(
|
|
590
|
+
p(S);
|
|
591
591
|
else {
|
|
592
592
|
if (y.required && !w.value)
|
|
593
|
-
return y.message !== void 0 ?
|
|
593
|
+
return y.message !== void 0 ? S = [].concat(y.message).map(kt(y, a)) : h.error && (S = [h.error(y, M(h.messages.required, y.field))]), p(S);
|
|
594
594
|
var L = {};
|
|
595
595
|
y.defaultField && Object.keys(w.value).map(function(I) {
|
|
596
596
|
L[I] = y.defaultField;
|
|
597
597
|
}), L = $({}, L, w.rule.fields);
|
|
598
598
|
var D = {};
|
|
599
599
|
Object.keys(L).forEach(function(I) {
|
|
600
|
-
var
|
|
600
|
+
var T = L[I], O = Array.isArray(T) ? T : [T];
|
|
601
601
|
D[I] = O.map(m.bind(null, I));
|
|
602
602
|
});
|
|
603
603
|
var B = new n(D);
|
|
604
604
|
B.messages(h.messages), w.rule.options && (w.rule.options.messages = h.messages, w.rule.options.error = h.error), B.validate(w.value, w.rule.options || h, function(I) {
|
|
605
|
-
var
|
|
606
|
-
|
|
605
|
+
var T = [];
|
|
606
|
+
S && S.length && T.push.apply(T, S), I && I.length && T.push.apply(T, I), p(T.length ? T : null);
|
|
607
607
|
});
|
|
608
608
|
}
|
|
609
609
|
}
|
|
@@ -626,7 +626,7 @@ var Rt = vt(), nt = /* @__PURE__ */ function() {
|
|
|
626
626
|
return E(R);
|
|
627
627
|
});
|
|
628
628
|
}, function(w) {
|
|
629
|
-
|
|
629
|
+
d(w);
|
|
630
630
|
}, a);
|
|
631
631
|
}, t.getType = function(i) {
|
|
632
632
|
if (i.type === void 0 && i.pattern instanceof RegExp && (i.type = "pattern"), typeof i.validator != "function" && i.type && !it.hasOwnProperty(i.type))
|
|
@@ -790,12 +790,12 @@ class ii {
|
|
|
790
790
|
t.forEach((i, s) => {
|
|
791
791
|
let r = i._hasChildren || !1;
|
|
792
792
|
Array.isArray(i.children) && i.children.length && (r = !0, this.initData(i.children, e + 1));
|
|
793
|
-
const { ROW_KEY: o = "", DEFAULT_EXPAND_ALL: a, CELL_HEIGHT: h, SELECTABLE_METHOD: c, CHECKBOX_KEY:
|
|
793
|
+
const { ROW_KEY: o = "", DEFAULT_EXPAND_ALL: a, CELL_HEIGHT: h, SELECTABLE_METHOD: c, CHECKBOX_KEY: d } = this.ctx.config, f = i[o], x = f != null ? `${f}` : Ut();
|
|
794
794
|
this.itemRowKeyMap.set(i, x);
|
|
795
795
|
const u = i._height || h, g = i._readonly;
|
|
796
796
|
let w = !0;
|
|
797
|
-
if (typeof c == "function" && (w = c),
|
|
798
|
-
const p = i[
|
|
797
|
+
if (typeof c == "function" && (w = c), d) {
|
|
798
|
+
const p = i[d];
|
|
799
799
|
if (this.checkboxKeyMap.has(p)) {
|
|
800
800
|
const y = this.checkboxKeyMap.get(p);
|
|
801
801
|
y.push(x), this.checkboxKeyMap.set(p, y);
|
|
@@ -874,10 +874,10 @@ class ii {
|
|
|
874
874
|
const i = (r) => {
|
|
875
875
|
r.forEach((o) => {
|
|
876
876
|
t.push(o);
|
|
877
|
-
const a = this.itemRowKeyMap.get(o), { expand: h, hasChildren: c, height:
|
|
878
|
-
this.sumHeight +=
|
|
879
|
-
top:
|
|
880
|
-
height:
|
|
877
|
+
const a = this.itemRowKeyMap.get(o), { expand: h, hasChildren: c, height: d } = this.rowKeyMap.get(a), f = this.sumHeight;
|
|
878
|
+
this.sumHeight += d, this.rowIndexRowKeyMap.set(e, a), this.positions.push({
|
|
879
|
+
top: f,
|
|
880
|
+
height: d,
|
|
881
881
|
bottom: this.sumHeight
|
|
882
882
|
}), e += 1, h && c && i(o.children);
|
|
883
883
|
});
|
|
@@ -1016,38 +1016,38 @@ class ii {
|
|
|
1016
1016
|
let r = t;
|
|
1017
1017
|
const { BEFORE_VALUE_CHANGE_METHOD: o } = this.ctx.config;
|
|
1018
1018
|
if (typeof o == "function") {
|
|
1019
|
-
const
|
|
1019
|
+
const d = o, f = t.map((u) => ({
|
|
1020
1020
|
rowKey: u.rowKey,
|
|
1021
1021
|
key: u.key,
|
|
1022
1022
|
value: u.value,
|
|
1023
1023
|
oldValue: this.getItemValue(u.rowKey, u.key),
|
|
1024
1024
|
row: this.ctx.database.getRowDataItemForRowKey(u.rowKey)
|
|
1025
1025
|
}));
|
|
1026
|
-
r = await f
|
|
1026
|
+
r = await d(f);
|
|
1027
1027
|
}
|
|
1028
|
-
r.forEach((
|
|
1029
|
-
const { value:
|
|
1030
|
-
this.setItemValue(x, u,
|
|
1028
|
+
r.forEach((d) => {
|
|
1029
|
+
const { value: f, rowKey: x, key: u } = d, g = this.getItemValue(x, u);
|
|
1030
|
+
this.setItemValue(x, u, f), s.add(x), i.push({
|
|
1031
1031
|
rowKey: x,
|
|
1032
1032
|
key: u,
|
|
1033
1033
|
oldValue: g,
|
|
1034
|
-
newValue:
|
|
1034
|
+
newValue: f
|
|
1035
1035
|
});
|
|
1036
1036
|
});
|
|
1037
1037
|
let a = [];
|
|
1038
|
-
const h = i.map((
|
|
1039
|
-
const
|
|
1038
|
+
const h = i.map((d) => {
|
|
1039
|
+
const f = this.ctx.database.getRowDataItemForRowKey(d.rowKey);
|
|
1040
1040
|
return {
|
|
1041
|
-
rowKey:
|
|
1042
|
-
key:
|
|
1043
|
-
value:
|
|
1044
|
-
row:
|
|
1041
|
+
rowKey: d.rowKey,
|
|
1042
|
+
key: d.key,
|
|
1043
|
+
value: d.newValue,
|
|
1044
|
+
row: f
|
|
1045
1045
|
};
|
|
1046
1046
|
});
|
|
1047
|
-
s.forEach((
|
|
1048
|
-
a.push(this.ctx.database.getRowDataItemForRowKey(
|
|
1047
|
+
s.forEach((d) => {
|
|
1048
|
+
a.push(this.ctx.database.getRowDataItemForRowKey(d));
|
|
1049
1049
|
});
|
|
1050
|
-
const c = h.map(({ rowKey:
|
|
1050
|
+
const c = h.map(({ rowKey: d, key: f }) => this.getValidator(d, f));
|
|
1051
1051
|
Promise.all(c).then(() => {
|
|
1052
1052
|
this.validationErrorMap.size === 0 && this.changedDataMap.size > 0 && this.ctx.emit("validateChangedData", this.getChangedData());
|
|
1053
1053
|
}), this.ctx.emit("change", h, a), e && this.ctx.history.pushState({
|
|
@@ -1080,8 +1080,8 @@ class ii {
|
|
|
1080
1080
|
a[e] !== null && typeof a[e] == "object" && (h = JSON.parse(JSON.stringify(a[e])));
|
|
1081
1081
|
const c = `${t}_${e}`;
|
|
1082
1082
|
this.originalDataMap.has(c) || this.originalDataMap.set(c, h);
|
|
1083
|
-
const
|
|
1084
|
-
let
|
|
1083
|
+
const d = this.originalDataMap.get(c);
|
|
1084
|
+
let f = i;
|
|
1085
1085
|
if (o) {
|
|
1086
1086
|
const { BEFORE_VALUE_CHANGE_METHOD: x } = this.ctx.config;
|
|
1087
1087
|
if (typeof x == "function") {
|
|
@@ -1094,13 +1094,13 @@ class ii {
|
|
|
1094
1094
|
row: this.ctx.database.getRowDataItemForRowKey(t)
|
|
1095
1095
|
}
|
|
1096
1096
|
]);
|
|
1097
|
-
p && p.length && (
|
|
1097
|
+
p && p.length && (f = p[0].value);
|
|
1098
1098
|
}
|
|
1099
|
-
this.changedDataMap.set(c,
|
|
1099
|
+
this.changedDataMap.set(c, f), a[e] = f;
|
|
1100
1100
|
const u = this.ctx.database.getRowDataItemForRowKey(t), g = {
|
|
1101
1101
|
rowKey: t,
|
|
1102
1102
|
key: e,
|
|
1103
|
-
value:
|
|
1103
|
+
value: f,
|
|
1104
1104
|
row: u
|
|
1105
1105
|
};
|
|
1106
1106
|
this.getValidator(t, e).then(() => {
|
|
@@ -1109,17 +1109,17 @@ class ii {
|
|
|
1109
1109
|
rowKey: t,
|
|
1110
1110
|
key: e,
|
|
1111
1111
|
oldValue: h,
|
|
1112
|
-
value:
|
|
1113
|
-
originalValue:
|
|
1112
|
+
value: f,
|
|
1113
|
+
originalValue: d,
|
|
1114
1114
|
row: u
|
|
1115
1115
|
});
|
|
1116
1116
|
} else
|
|
1117
|
-
this.changedDataMap.set(c,
|
|
1117
|
+
this.changedDataMap.set(c, f), a[e] = f;
|
|
1118
1118
|
return this.ctx.hasEvent("iterationChange") && this.ctx.emit("iterationChange", {
|
|
1119
1119
|
rowKey: t,
|
|
1120
1120
|
key: e,
|
|
1121
1121
|
oldValue: h,
|
|
1122
|
-
value:
|
|
1122
|
+
value: f,
|
|
1123
1123
|
originalValue: this.originalDataMap.get(c),
|
|
1124
1124
|
row: this.ctx.database.getRowDataItemForRowKey(t)
|
|
1125
1125
|
}), s && this.ctx.history.pushState({
|
|
@@ -1131,12 +1131,12 @@ class ii {
|
|
|
1131
1131
|
rowKey: t,
|
|
1132
1132
|
key: e,
|
|
1133
1133
|
oldValue: h,
|
|
1134
|
-
newValue:
|
|
1134
|
+
newValue: f
|
|
1135
1135
|
}
|
|
1136
1136
|
]
|
|
1137
1137
|
}), r && this.ctx.emit("draw"), {
|
|
1138
1138
|
oldValue: h,
|
|
1139
|
-
newValue:
|
|
1139
|
+
newValue: f
|
|
1140
1140
|
};
|
|
1141
1141
|
}
|
|
1142
1142
|
/**
|
|
@@ -1323,19 +1323,22 @@ class ii {
|
|
|
1323
1323
|
return t ? (this.headerMap.set(t, e), !0) : !1;
|
|
1324
1324
|
}
|
|
1325
1325
|
getReadonly(t, e) {
|
|
1326
|
-
const
|
|
1327
|
-
if (
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1326
|
+
const { DISABLED: i } = this.ctx.config;
|
|
1327
|
+
if (i)
|
|
1328
|
+
return !0;
|
|
1329
|
+
const s = this.rowKeyMap.get(t), r = this.headerMap.get(e), o = s == null ? void 0 : s.readonly, a = r == null ? void 0 : r.readonly, { BODY_CELL_READONLY_METHOD: h } = this.ctx.config;
|
|
1330
|
+
if (typeof h == "function") {
|
|
1331
|
+
const d = h({
|
|
1332
|
+
row: s.item,
|
|
1333
|
+
rowIndex: s.rowIndex,
|
|
1334
|
+
colIndex: r.colIndex,
|
|
1335
|
+
column: r.column,
|
|
1333
1336
|
value: this.getItemValue(t, e)
|
|
1334
1337
|
});
|
|
1335
|
-
if (
|
|
1336
|
-
return
|
|
1338
|
+
if (d !== void 0)
|
|
1339
|
+
return d;
|
|
1337
1340
|
}
|
|
1338
|
-
return
|
|
1341
|
+
return a || o;
|
|
1339
1342
|
}
|
|
1340
1343
|
clearValidate() {
|
|
1341
1344
|
this.validationErrorMap.clear();
|
|
@@ -1348,18 +1351,18 @@ class ii {
|
|
|
1348
1351
|
const s = this.rowKeyMap.get(t), r = this.headerMap.get(e), { BODY_CELL_RULES_METHOD: o } = this.ctx.config, a = r.column;
|
|
1349
1352
|
let h = a.rules;
|
|
1350
1353
|
if (typeof o == "function") {
|
|
1351
|
-
const
|
|
1354
|
+
const d = o({
|
|
1352
1355
|
row: s.item,
|
|
1353
1356
|
rowIndex: s.rowIndex,
|
|
1354
1357
|
colIndex: r.colIndex,
|
|
1355
1358
|
column: a,
|
|
1356
1359
|
value: this.getItemValue(t, e)
|
|
1357
1360
|
});
|
|
1358
|
-
|
|
1361
|
+
d && (h = d);
|
|
1359
1362
|
}
|
|
1360
1363
|
if (h) {
|
|
1361
|
-
let c = {},
|
|
1362
|
-
if (
|
|
1364
|
+
let c = {}, d = {};
|
|
1365
|
+
if (d[e] = this.getItemValue(t, e), Array.isArray(h) && h.length) {
|
|
1363
1366
|
const x = h.map((u) => ({
|
|
1364
1367
|
...u,
|
|
1365
1368
|
row: s.item,
|
|
@@ -1376,7 +1379,7 @@ class ii {
|
|
|
1376
1379
|
rowIndex: s.rowIndex,
|
|
1377
1380
|
colIndex: r.colIndex
|
|
1378
1381
|
};
|
|
1379
|
-
new nt(c).validate(
|
|
1382
|
+
new nt(c).validate(d).then(() => {
|
|
1380
1383
|
this.clearValidationError(t, e), i([]);
|
|
1381
1384
|
}).catch(({ errors: x }) => {
|
|
1382
1385
|
const u = x.map((g) => ({
|
|
@@ -1489,7 +1492,7 @@ class ri {
|
|
|
1489
1492
|
this.ctx = t, this.init();
|
|
1490
1493
|
}
|
|
1491
1494
|
init() {
|
|
1492
|
-
this.bind(window, "resize", this.handleResize.bind(this)), this.bind(window, "mouseup", this.handleMouseUp.bind(this)), this.bind(window, "mousemove", this.handleMousemove.bind(this)), this.bind(this.ctx.stageElement, "click", this.handleClick.bind(this)), this.bind(window, "keydown", this.handleKeydown.bind(this)), this.bind(this.ctx.stageElement, "wheel", this.handleWheel.bind(this)), this.bind(this.ctx.stageElement, "contextmenu", this.handleContextMenu.bind(this)), this.bind(this.ctx.stageElement, "mousedown", this.handleMouseDown.bind(this)), this.bind(this.ctx.stageElement, "
|
|
1495
|
+
this.bind(window, "resize", this.handleResize.bind(this)), this.bind(window, "mouseup", this.handleMouseUp.bind(this)), this.bind(window, "mousemove", this.handleMousemove.bind(this)), this.bind(this.ctx.stageElement, "click", this.handleClick.bind(this)), this.bind(window, "keydown", this.handleKeydown.bind(this)), this.bind(this.ctx.stageElement, "wheel", this.handleWheel.bind(this)), this.bind(this.ctx.stageElement, "contextmenu", this.handleContextMenu.bind(this)), this.bind(this.ctx.stageElement, "mousedown", this.handleMouseDown.bind(this)), this.bind(this.ctx.stageElement, "dblclick", this.handleDblclick.bind(this)), this.bind(this.ctx.stageElement, "mouseover", this.handleMouseover.bind(this)), this.bind(this.ctx.stageElement, "mouseout", this.handleMouseout.bind(this));
|
|
1493
1496
|
}
|
|
1494
1497
|
destroy() {
|
|
1495
1498
|
this.eventTasks.forEach((t, e) => {
|
|
@@ -1521,11 +1524,11 @@ class ri {
|
|
|
1521
1524
|
handleContextMenu(t) {
|
|
1522
1525
|
this.ctx.emit("contextMenu", t);
|
|
1523
1526
|
}
|
|
1524
|
-
|
|
1525
|
-
this.ctx.isInsideTargetContainer = !0, this.ctx.emit("
|
|
1527
|
+
handleMouseover(t) {
|
|
1528
|
+
this.ctx.isInsideTargetContainer = !0, this.ctx.emit("mouseover", t);
|
|
1526
1529
|
}
|
|
1527
|
-
|
|
1528
|
-
this.ctx.
|
|
1530
|
+
handleMouseout(t) {
|
|
1531
|
+
this.ctx.isInsideTargetContainer = !1, this.ctx.emit("mouseout", t);
|
|
1529
1532
|
}
|
|
1530
1533
|
handleDblclick(t) {
|
|
1531
1534
|
this.ctx.emit("dblclick", t);
|
|
@@ -1611,21 +1614,21 @@ class ni {
|
|
|
1611
1614
|
* @param {string} color - 阴影的颜色
|
|
1612
1615
|
*/
|
|
1613
1616
|
drawShadow(t, e, i, s, r) {
|
|
1614
|
-
const { fillColor: o, side: a, shadowWidth: h, colorStart: c, colorEnd:
|
|
1617
|
+
const { fillColor: o, side: a, shadowWidth: h, colorStart: c, colorEnd: d } = r;
|
|
1615
1618
|
this.ctx.save(), o && (this.ctx.fillStyle = o, this.ctx.fillRect(t, e, i, s));
|
|
1616
|
-
let
|
|
1619
|
+
let f;
|
|
1617
1620
|
switch (a) {
|
|
1618
1621
|
case "left":
|
|
1619
|
-
|
|
1622
|
+
f = this.ctx.createLinearGradient(t - h, e, t, e), f.addColorStop(0, c), f.addColorStop(1, d), this.ctx.fillStyle = f, this.ctx.fillRect(t - h, e, h, s);
|
|
1620
1623
|
break;
|
|
1621
1624
|
case "right":
|
|
1622
|
-
|
|
1625
|
+
f = this.ctx.createLinearGradient(t + i, e, t + i + h, e), f.addColorStop(0, c), f.addColorStop(1, d), this.ctx.fillStyle = f, this.ctx.fillRect(t + i, e, h, s);
|
|
1623
1626
|
break;
|
|
1624
1627
|
case "top":
|
|
1625
|
-
|
|
1628
|
+
f = this.ctx.createLinearGradient(t, e - h, t, e), f.addColorStop(0, c), f.addColorStop(1, d), this.ctx.fillStyle = f, this.ctx.fillRect(t, e - h, i, h);
|
|
1626
1629
|
break;
|
|
1627
1630
|
case "bottom":
|
|
1628
|
-
|
|
1631
|
+
f = this.ctx.createLinearGradient(t, e + s, t, e + s + h), f.addColorStop(0, c), f.addColorStop(1, d), this.ctx.fillStyle = f, this.ctx.fillRect(t, e + s, i, h);
|
|
1629
1632
|
break;
|
|
1630
1633
|
default:
|
|
1631
1634
|
console.error("Invalid side specified for shadow");
|
|
@@ -1650,8 +1653,8 @@ class ni {
|
|
|
1650
1653
|
if (this.ctx.save(), this.ctx.beginPath(), a !== void 0 && (this.ctx.fillStyle = a), o !== void 0 && (this.ctx.lineWidth = r, this.ctx.strokeStyle = o), h === 0)
|
|
1651
1654
|
this.ctx.rect(t - 0.5, e - 0.5, i, s);
|
|
1652
1655
|
else {
|
|
1653
|
-
const [c,
|
|
1654
|
-
this.ctx.moveTo(t + c, e), this.ctx.arcTo(t + i, e, t + i, e +
|
|
1656
|
+
const [c, d, f, x] = typeof h == "number" ? [h, h, h, h] : h;
|
|
1657
|
+
this.ctx.moveTo(t + c, e), this.ctx.arcTo(t + i, e, t + i, e + d, d), this.ctx.arcTo(t + i, e + s, t + i - f, e + s, f), this.ctx.arcTo(t, e + s, t, e + s - x, x), this.ctx.arcTo(t, e, t + c, e, c);
|
|
1655
1658
|
}
|
|
1656
1659
|
a !== void 0 && this.ctx.fill(), o !== void 0 && this.ctx.stroke(), this.ctx.restore();
|
|
1657
1660
|
}
|
|
@@ -1671,15 +1674,15 @@ class ni {
|
|
|
1671
1674
|
font: a = "12px Arial",
|
|
1672
1675
|
align: h = "center",
|
|
1673
1676
|
color: c = "#495060",
|
|
1674
|
-
padding:
|
|
1675
|
-
verticalAlign:
|
|
1677
|
+
padding: d = 0,
|
|
1678
|
+
verticalAlign: f = "middle"
|
|
1676
1679
|
} = o;
|
|
1677
|
-
this.ctx.font = a, this.ctx.fillStyle = c, this.ctx.textBaseline =
|
|
1680
|
+
this.ctx.font = a, this.ctx.fillStyle = c, this.ctx.textBaseline = f, this.ctx.textAlign = h;
|
|
1678
1681
|
let x = 0;
|
|
1679
|
-
|
|
1682
|
+
f === "top" ? x = i + d : f === "bottom" ? x = i + r - d : x = i + (r + 1) / 2;
|
|
1680
1683
|
let u = 0;
|
|
1681
|
-
h === "left" ? u = e +
|
|
1682
|
-
const { _text: g, ellipsis: w } = this.handleEllipsis(t, s,
|
|
1684
|
+
h === "left" ? u = e + d : h === "right" ? u = e + s - d : u = e + s / 2;
|
|
1685
|
+
const { _text: g, ellipsis: w } = this.handleEllipsis(t, s, d, a);
|
|
1683
1686
|
return this.ctx.fillText(g, u, x), this.ctx.restore(), w;
|
|
1684
1687
|
}
|
|
1685
1688
|
handleEllipsis(t, e, i = 0, s = "12px Arial") {
|
|
@@ -1693,9 +1696,9 @@ class ni {
|
|
|
1693
1696
|
if (h && h + a >= e - i * 2) {
|
|
1694
1697
|
r = !0;
|
|
1695
1698
|
let c = 0;
|
|
1696
|
-
for (let
|
|
1697
|
-
if (c += this.ctx.measureText(t[
|
|
1698
|
-
o = t.slice(0,
|
|
1699
|
+
for (let d = 0; d < t.length; d++)
|
|
1700
|
+
if (c += this.ctx.measureText(t[d]).width, c >= e - i * 2 - a) {
|
|
1701
|
+
o = t.slice(0, d) + "...";
|
|
1699
1702
|
break;
|
|
1700
1703
|
}
|
|
1701
1704
|
}
|
|
@@ -1707,10 +1710,11 @@ class ni {
|
|
|
1707
1710
|
}
|
|
1708
1711
|
class Wt {
|
|
1709
1712
|
constructor(t) {
|
|
1710
|
-
l(this, "PROCESSOR_NUM", 50);
|
|
1711
1713
|
l(this, "CSS_PREFIX", "e-virt-table");
|
|
1712
1714
|
l(this, "ICONS", []);
|
|
1713
1715
|
l(this, "ROW_KEY", "");
|
|
1716
|
+
l(this, "DISABLED", !1);
|
|
1717
|
+
//禁用编辑,优先等级最高
|
|
1714
1718
|
l(this, "HEADER_FONT", "12px normal Arial");
|
|
1715
1719
|
l(this, "BODY_FONT", "12px normal Arial");
|
|
1716
1720
|
l(this, "BORDER_COLOR", "#e1e6eb");
|
|
@@ -1752,6 +1756,7 @@ class Wt {
|
|
|
1752
1756
|
l(this, "SELECT_BORDER_COLOR", "rgb(82,146,247)");
|
|
1753
1757
|
l(this, "SELECT_AREA_COLOR", "rgba(82,146,247,0.1)");
|
|
1754
1758
|
l(this, "SELECT_BG_COLOR", "rgba(82,146,247,0.1)");
|
|
1759
|
+
l(this, "AUTOFILL_POINT_BORDER_COLOR", "#fff");
|
|
1755
1760
|
l(this, "EDIT_BG_COLOR", "#fcf6ed");
|
|
1756
1761
|
l(this, "CHECKBOX_KEY", "");
|
|
1757
1762
|
l(this, "CHECKBOX_COLOR", "rgb(82,146,247)");
|
|
@@ -1938,8 +1943,8 @@ class ai {
|
|
|
1938
1943
|
const o = new Image(), a = new Blob([new XMLSerializer().serializeToString(r)], {
|
|
1939
1944
|
type: "image/svg+xml"
|
|
1940
1945
|
}), h = URL.createObjectURL(a);
|
|
1941
|
-
return o.src = h, new Promise((c,
|
|
1942
|
-
o.onerror = () =>
|
|
1946
|
+
return o.src = h, new Promise((c, d) => {
|
|
1947
|
+
o.onerror = () => d(new Error("Failed to load image")), o.onload = () => {
|
|
1943
1948
|
c(o);
|
|
1944
1949
|
};
|
|
1945
1950
|
});
|
|
@@ -1995,8 +2000,8 @@ class te {
|
|
|
1995
2000
|
}
|
|
1996
2001
|
}
|
|
1997
2002
|
class ee extends te {
|
|
1998
|
-
constructor(e, i, s, r, o, a, h, c,
|
|
1999
|
-
super(e, r, o, a, h,
|
|
2003
|
+
constructor(e, i, s, r, o, a, h, c, d, f = "body") {
|
|
2004
|
+
super(e, r, o, a, h, f, c.fixed);
|
|
2000
2005
|
l(this, "formatter");
|
|
2001
2006
|
l(this, "formatterFooter");
|
|
2002
2007
|
l(this, "hoverIconName", "");
|
|
@@ -2047,7 +2052,7 @@ class ee extends te {
|
|
|
2047
2052
|
l(this, "overflowTooltipShow", !0);
|
|
2048
2053
|
l(this, "overflowTooltipMaxWidth", 500);
|
|
2049
2054
|
l(this, "overflowTooltipPlacement", "top");
|
|
2050
|
-
this.visibleWidth = this.width, this.visibleHeight = this.height, this.colIndex = s, this.rowIndex = i, this.key = c.key, this.type = c.type || "", this.editorType = c.editorType || "text", this.editorProps = c.editorProps || {}, this.cellType =
|
|
2055
|
+
this.visibleWidth = this.width, this.visibleHeight = this.height, this.colIndex = s, this.rowIndex = i, this.key = c.key, this.type = c.type || "", this.editorType = c.editorType || "text", this.editorProps = c.editorProps || {}, this.cellType = f, this.align = c.align || "center", this.verticalAlign = c.verticalAlign || "middle", this.fixed = c.fixed, this.level = c.level || 0, this.operation = c.operation || !1, this.column = c, this.rules = c.rules || {}, this.row = d, this.rowKey = this.cellType === "body" ? this.ctx.database.getRowKeyForRowIndex(i) : `${this.cellType}_${this.rowIndex}`, this.value = this.getValue(), this.render = c.render, this.overflowTooltipShow = c.overflowTooltipShow !== !1, this.overflowTooltipMaxWidth = c.overflowTooltipMaxWidth || 500, this.overflowTooltipPlacement = c.overflowTooltipPlacement || "top", this.renderFooter = c.renderFooter, this.hoverIconName = c.hoverIconName, this.formatter = c.formatter, this.formatterFooter = c.formatterFooter, this.update();
|
|
2051
2056
|
}
|
|
2052
2057
|
getValidationMessage() {
|
|
2053
2058
|
const e = this.ctx.database.getValidationError(this.rowKey, this.key);
|
|
@@ -2144,19 +2149,21 @@ class ee extends te {
|
|
|
2144
2149
|
const { CELL_PADDING: e = 0 } = this.ctx.config, { rowKey: i, cellType: s } = this;
|
|
2145
2150
|
let r, o = 0, a = "";
|
|
2146
2151
|
if (this.type === "tree" && s === "body") {
|
|
2147
|
-
const h = this.ctx.database.getRowForRowKey(i), { expand: c = !1, hasChildren:
|
|
2148
|
-
if (this.rowExpand = c, this.rowHasChildren =
|
|
2149
|
-
const
|
|
2150
|
-
a = "loading", r =
|
|
2151
|
-
} else if (
|
|
2152
|
-
const
|
|
2153
|
-
r = c ?
|
|
2152
|
+
const h = this.ctx.database.getRowForRowKey(i), { expand: c = !1, hasChildren: d = !1, expandLoading: f = !1, level: x = 0 } = h || {};
|
|
2153
|
+
if (this.rowExpand = c, this.rowHasChildren = d, f) {
|
|
2154
|
+
const w = this.ctx.icons.get("loading");
|
|
2155
|
+
a = "loading", r = w, o = x * 8;
|
|
2156
|
+
} else if (d) {
|
|
2157
|
+
const w = this.ctx.icons.get("expand"), p = this.ctx.icons.get("shrink");
|
|
2158
|
+
r = c ? p : w, a = c ? "shrink" : "expand", o = x * 8;
|
|
2154
2159
|
} else
|
|
2155
2160
|
o = x * 8;
|
|
2161
|
+
let u = 20, g = 20;
|
|
2156
2162
|
if (r) {
|
|
2157
|
-
let
|
|
2158
|
-
this.ctx.paint.drawImage(r, w, p, u, g), this.drawImageX = w, this.drawImageY = p, this.drawImageWidth = u, this.drawImageHeight = g, this.drawImageName = a, this.drawImageSource = r
|
|
2163
|
+
let w = this.drawX + o + e, p = this.drawY + (this.visibleHeight - g) / 2;
|
|
2164
|
+
this.ctx.paint.drawImage(r, w, p, u, g), this.drawImageX = w, this.drawImageY = p, this.drawImageWidth = u, this.drawImageHeight = g, this.drawImageName = a, this.drawImageSource = r;
|
|
2159
2165
|
}
|
|
2166
|
+
this.align = "left", this.drawTextX = o + this.drawX + u - 0.5;
|
|
2160
2167
|
}
|
|
2161
2168
|
}
|
|
2162
2169
|
updateContainer() {
|
|
@@ -2169,8 +2176,8 @@ class ee extends te {
|
|
|
2169
2176
|
FOOTER_BG_COLOR: a,
|
|
2170
2177
|
HIGHLIGHT_SELECTED_ROW: h,
|
|
2171
2178
|
HIGHLIGHT_SELECTED_ROW_COLOR: c,
|
|
2172
|
-
HIGHLIGHT_HOVER_ROW:
|
|
2173
|
-
HIGHLIGHT_HOVER_ROW_COLOR:
|
|
2179
|
+
HIGHLIGHT_HOVER_ROW: d,
|
|
2180
|
+
HIGHLIGHT_HOVER_ROW_COLOR: f
|
|
2174
2181
|
} = this.ctx.config;
|
|
2175
2182
|
if (this.cellType === "footer") {
|
|
2176
2183
|
let y = a, b = o;
|
|
@@ -2189,7 +2196,7 @@ class ee extends te {
|
|
|
2189
2196
|
}
|
|
2190
2197
|
let x = "transparent";
|
|
2191
2198
|
const u = this.ctx.focusCell, g = this.ctx.hoverCell;
|
|
2192
|
-
|
|
2199
|
+
d && (g == null ? void 0 : g.rowKey) === this.rowKey && (x = f), h && (u == null ? void 0 : u.rowKey) === this.rowKey && (x = c), this.drawCellSkyBgColor = x;
|
|
2193
2200
|
let w = e, p = o;
|
|
2194
2201
|
if (["index", "index-selection", "selection"].includes(this.type)) {
|
|
2195
2202
|
this.drawCellBgColor = e, this.drawTextColor = o;
|
|
@@ -2211,9 +2218,9 @@ class ee extends te {
|
|
|
2211
2218
|
updateSelection() {
|
|
2212
2219
|
const { visibleWidth: e, visibleHeight: i, rowspan: s, colspan: r, cellType: o, type: a, rowIndex: h, rowKey: c } = this;
|
|
2213
2220
|
if (!(s === 0 || r === 0) && o !== "footer" && ["index-selection", "selection"].includes(a)) {
|
|
2214
|
-
const
|
|
2221
|
+
const d = this.ctx.database.getRowSelection(c), f = this.ctx.database.getRowSelectable(c), { CHECKBOX_SIZE: x = 0 } = this.ctx.config, u = this.drawX + (e - x) / 2, g = this.drawY + (i - x) / 2;
|
|
2215
2222
|
let w = this.ctx.icons.get("checkbox-uncheck"), p = "checkbox-uncheck";
|
|
2216
|
-
|
|
2223
|
+
d && f ? (w = this.ctx.icons.get("checkbox-check"), p = "checkbox-check") : d && f ? (w = this.ctx.icons.get("checkbox-check-disabled"), p = "checkbox-check-disabled") : !d && f ? (w = this.ctx.icons.get("checkbox-uncheck"), p = "checkbox-uncheck") : (w = this.ctx.icons.get("checkbox-disabled"), p = "checkbox-disabled"), w && a == "index-selection" ? (this.ctx.hoverCell && this.ctx.hoverCell.rowIndex === h || ["checkbox-disabled", "checkbox-check"].includes(p)) && (this.drawImageX = u, this.drawImageY = g, this.drawImageWidth = x, this.drawImageHeight = x, this.drawImageName = p, this.drawImageSource = w) : w && a === "selection" && (this.drawImageX = u, this.drawImageY = g, this.drawImageWidth = x, this.drawImageHeight = x, this.drawImageName = p, this.drawImageSource = w);
|
|
2217
2224
|
}
|
|
2218
2225
|
}
|
|
2219
2226
|
updateHoverIcon() {
|
|
@@ -2347,12 +2354,12 @@ class ee extends te {
|
|
|
2347
2354
|
drawAutofillPiont() {
|
|
2348
2355
|
if (this.cellType === "footer")
|
|
2349
2356
|
return;
|
|
2350
|
-
const { SELECT_BORDER_COLOR: e, ENABLE_AUTOFILL: i, ENABLE_SELECTOR: s } = this.ctx.config;
|
|
2357
|
+
const { SELECT_BORDER_COLOR: e, ENABLE_AUTOFILL: i, ENABLE_SELECTOR: s, AUTOFILL_POINT_BORDER_COLOR: r } = this.ctx.config;
|
|
2351
2358
|
if (!s || !i)
|
|
2352
2359
|
return;
|
|
2353
|
-
const { xArr:
|
|
2354
|
-
|
|
2355
|
-
borderColor:
|
|
2360
|
+
const { xArr: o, yArr: a } = this.ctx.selector, h = o[1], c = a[1], { colIndex: d, rowIndex: f, drawX: x, drawY: u } = this;
|
|
2361
|
+
d === h && f === c && this.ctx.paint.drawRect(x + this.width - 6, u + this.height - 6, 6, 6, {
|
|
2362
|
+
borderColor: r,
|
|
2356
2363
|
fillColor: e
|
|
2357
2364
|
});
|
|
2358
2365
|
}
|
|
@@ -2406,9 +2413,9 @@ class ee extends te {
|
|
|
2406
2413
|
}
|
|
2407
2414
|
drawBorder(e) {
|
|
2408
2415
|
const { drawX: i, drawY: s, width: r, rowIndex: o, colIndex: a } = this;
|
|
2409
|
-
let h = i + 0.5, c = s + 0.5,
|
|
2410
|
-
o === 0 && (c = this.y + 1,
|
|
2411
|
-
const { xArr:
|
|
2416
|
+
let h = i + 0.5, c = s + 0.5, d = this.height;
|
|
2417
|
+
o === 0 && (c = this.y + 1, d = d - 1), a === this.ctx.maxColIndex && (h = h - 1);
|
|
2418
|
+
const { xArr: f, yArr: x, lineDash: u = [], borderWidth: g = 1, borderColor: w, fillColor: p } = e, y = f[0], b = f[1], m = x[0], E = x[1];
|
|
2412
2419
|
a >= y && a <= b && o === m && this.ctx.paint.drawLine([h, c, h + r - 2, c], {
|
|
2413
2420
|
borderColor: w,
|
|
2414
2421
|
fillColor: p,
|
|
@@ -2416,21 +2423,21 @@ class ee extends te {
|
|
|
2416
2423
|
lineCap: "round",
|
|
2417
2424
|
lineJoin: "round",
|
|
2418
2425
|
lineDash: u
|
|
2419
|
-
}), a >= y && a <= b && o === E && this.ctx.paint.drawLine([h, c +
|
|
2426
|
+
}), a >= y && a <= b && o === E && this.ctx.paint.drawLine([h, c + d - 1.5, h + r, c + d - 1.5], {
|
|
2420
2427
|
borderColor: w,
|
|
2421
2428
|
fillColor: p,
|
|
2422
2429
|
borderWidth: g,
|
|
2423
2430
|
lineCap: "round",
|
|
2424
2431
|
lineJoin: "round",
|
|
2425
2432
|
lineDash: u
|
|
2426
|
-
}), a === y && o >= m && o <= E && this.ctx.paint.drawLine([h, c, h, c +
|
|
2433
|
+
}), a === y && o >= m && o <= E && this.ctx.paint.drawLine([h, c, h, c + d - 1], {
|
|
2427
2434
|
borderColor: w,
|
|
2428
2435
|
fillColor: p,
|
|
2429
2436
|
borderWidth: g,
|
|
2430
2437
|
lineCap: "round",
|
|
2431
2438
|
lineJoin: "round",
|
|
2432
2439
|
lineDash: u
|
|
2433
|
-
}), a === b && o >= m && o <= E && this.ctx.paint.drawLine([h + r - 1.5, c, h + r - 1.5, c +
|
|
2440
|
+
}), a === b && o >= m && o <= E && this.ctx.paint.drawLine([h + r - 1.5, c, h + r - 1.5, c + d - 1.5], {
|
|
2434
2441
|
borderColor: w,
|
|
2435
2442
|
fillColor: p,
|
|
2436
2443
|
borderWidth: g,
|
|
@@ -2527,9 +2534,9 @@ class ie extends te {
|
|
|
2527
2534
|
drawSelection() {
|
|
2528
2535
|
const { width: e, height: i, type: s } = this;
|
|
2529
2536
|
if (["index-selection", "selection"].includes(s)) {
|
|
2530
|
-
const { indeterminate: r, check: o, selectable: a } = this.ctx.database.getCheckedState(), { CHECKBOX_SIZE: h = 0 } = this.ctx.config, c = this.drawX + (e - h) / 2,
|
|
2531
|
-
let
|
|
2532
|
-
r ? (
|
|
2537
|
+
const { indeterminate: r, check: o, selectable: a } = this.ctx.database.getCheckedState(), { CHECKBOX_SIZE: h = 0 } = this.ctx.config, c = this.drawX + (e - h) / 2, d = this.drawY + (i - h) / 2;
|
|
2538
|
+
let f = this.ctx.icons.get("checkbox-uncheck"), x = "checkbox-uncheck";
|
|
2539
|
+
r ? (f = this.ctx.icons.get("checkbox-indeterminate"), x = "checkbox-indeterminate") : o && a ? (f = this.ctx.icons.get("checkbox-check"), x = "checkbox-check") : o && a ? (f = this.ctx.icons.get("checkbox-check-disabled"), x = "checkbox-check-disabled") : !o && a ? (f = this.ctx.icons.get("checkbox-uncheck"), x = "checkbox-uncheck") : (f = this.ctx.icons.get("checkbox-disabled"), x = "checkbox-disabled"), f && (this.drawImageX = c, this.drawImageY = d, this.drawImageWidth = h, this.drawImageHeight = h, this.drawImageName = x, this.drawImageSource = f, this.ctx.paint.drawImage(
|
|
2533
2540
|
this.drawImageSource,
|
|
2534
2541
|
this.drawImageX,
|
|
2535
2542
|
this.drawImageY,
|
|
@@ -2683,13 +2690,13 @@ class li {
|
|
|
2683
2690
|
for (const o of i) {
|
|
2684
2691
|
const a = o.fixedCells.concat(o.noFixedCells);
|
|
2685
2692
|
for (const h of a) {
|
|
2686
|
-
const c = h.getDrawX(),
|
|
2693
|
+
const c = h.getDrawX(), d = h.getDrawY();
|
|
2687
2694
|
if (r) {
|
|
2688
|
-
if (t > c && t < c + h.visibleWidth && e >
|
|
2695
|
+
if (t > c && t < c + h.visibleWidth && e > d && e < d + h.visibleHeight) {
|
|
2689
2696
|
s(h);
|
|
2690
2697
|
return;
|
|
2691
2698
|
}
|
|
2692
|
-
} else if (t > c && t < c + h.width && e >
|
|
2699
|
+
} else if (t > c && t < c + h.width && e > d && e < d + h.height) {
|
|
2693
2700
|
s(h);
|
|
2694
2701
|
return;
|
|
2695
2702
|
}
|
|
@@ -2853,8 +2860,8 @@ class hi {
|
|
|
2853
2860
|
for (let r = 0; r <= e[1] - e[0]; r++) {
|
|
2854
2861
|
const o = [];
|
|
2855
2862
|
for (let a = 0; a <= i[1] - i[0]; a++) {
|
|
2856
|
-
const h = r + e[0], c = a + i[0],
|
|
2857
|
-
|
|
2863
|
+
const h = r + e[0], c = a + i[0], d = this.database.getItemValueForRowIndexAndColIndex(h, c);
|
|
2864
|
+
d && o.push(d.value);
|
|
2858
2865
|
}
|
|
2859
2866
|
s += `${o.join(" ")}\r`, t.push(o);
|
|
2860
2867
|
}
|
|
@@ -2993,20 +3000,20 @@ class Pt {
|
|
|
2993
3000
|
stageHeight: i,
|
|
2994
3001
|
stageWidth: s,
|
|
2995
3002
|
config: { SCROLLER_TRACK_SIZE: r = 0, SCROLLER_SIZE: o = 0 }
|
|
2996
|
-
} = this.ctx, a = s, h = i, c = e.height,
|
|
3003
|
+
} = this.ctx, a = s, h = i, c = e.height, d = e.width, f = t.height, x = this.ctx.footer.height;
|
|
2997
3004
|
if (this.type === "vertical") {
|
|
2998
|
-
this.visibleDistance = h - r - c, this.distance =
|
|
2999
|
-
const u = this.distance ? this.visibleDistance /
|
|
3005
|
+
this.visibleDistance = h - r - c, this.distance = f - this.visibleDistance + x, this.trackX = a - r, this.trackY = 0, this.splitPoints = [this.trackX, c, this.trackX + r, c], this.trackWidth = r, this.trackHeight = h, this.barX = this.trackX - 0.5 + (r - o) / 2, this.barWidth = o;
|
|
3006
|
+
const u = this.distance ? this.visibleDistance / f : 0;
|
|
3000
3007
|
let g = Math.floor(u * this.visibleDistance);
|
|
3001
3008
|
g < 30 ? g = 30 : g > this.visibleDistance && (g = 0), this.barHeight = g, this.barY = c + this.scroll / this.distance * (this.visibleDistance - this.barHeight), this.scroll = Math.max(0, Math.min(this.scroll, this.distance));
|
|
3002
3009
|
} else {
|
|
3003
|
-
this.visibleDistance = a - r, this.distance =
|
|
3010
|
+
this.visibleDistance = a - r, this.distance = d - this.visibleDistance, this.splitPoints = [
|
|
3004
3011
|
a - r,
|
|
3005
3012
|
h - r,
|
|
3006
3013
|
a - r,
|
|
3007
3014
|
h
|
|
3008
3015
|
], this.trackX = 0, this.trackY = h - r, this.trackWidth = a, this.trackHeight = r;
|
|
3009
|
-
const u = this.distance ? this.visibleDistance /
|
|
3016
|
+
const u = this.distance ? this.visibleDistance / d : 0;
|
|
3010
3017
|
let g = Math.floor(u * this.visibleDistance);
|
|
3011
3018
|
this.barY = this.trackY - 0.5 + (r - o) / 2, g < 30 ? g = 30 : g >= this.visibleDistance && (g = 0), this.barWidth = g, this.barHeight = o, this.barX = this.scroll / this.distance * (this.visibleDistance - this.barWidth), this.scroll = Math.max(0, Math.min(this.scroll, this.distance));
|
|
3012
3019
|
}
|
|
@@ -3133,20 +3140,20 @@ class di {
|
|
|
3133
3140
|
} = this.ctx, i = this.ctx.database.getColumns();
|
|
3134
3141
|
this.columns = i, this.allCellHeaders = [], this.leafCellHeaders = [], this.fixedLeftCellHeaders = [], this.fixedRightCellHeaders = [], this.centerCellHeaders = [];
|
|
3135
3142
|
const s = Jt(i), r = _t(i);
|
|
3136
|
-
this.height = t * s, this.width = r.reduce((
|
|
3143
|
+
this.height = t * s, this.width = r.reduce((f, x) => f + ((x == null ? void 0 : x.width) || 100), 0), this.visibleHeight = this.height;
|
|
3137
3144
|
const o = Je(Qt(i, s));
|
|
3138
3145
|
this.columnIndex = 0, this.resizeNum = 0, this.render(o, 0), this.ctx.database.updateColIndexKeyMap(this.leafCellHeaders);
|
|
3139
3146
|
const a = this.ctx.containerElement.getBoundingClientRect();
|
|
3140
3147
|
this.resizeNum > 0 ? this.ctx.stageWidth = Math.floor(a.width) : this.ctx.stageWidth = Math.floor(this.width + e), this.ctx.stageElement.style.width = this.ctx.stageWidth - 0.5 + "px", this.visibleWidth = this.ctx.stageWidth - e;
|
|
3141
3148
|
const h = this.visibleWidth - this.width;
|
|
3142
3149
|
if (this.resizeNum && h > 0) {
|
|
3143
|
-
const
|
|
3144
|
-
this.resizeAllColumn(
|
|
3150
|
+
const f = Math.floor(h / this.resizeNum * 100) / 100;
|
|
3151
|
+
this.resizeAllColumn(f);
|
|
3145
3152
|
}
|
|
3146
|
-
const c = this.fixedLeftCellHeaders.filter((
|
|
3147
|
-
this.ctx.fixedLeftWidth = c.reduce((
|
|
3148
|
-
const
|
|
3149
|
-
this.ctx.fixedRightWidth =
|
|
3153
|
+
const c = this.fixedLeftCellHeaders.filter((f) => !f.hasChildren);
|
|
3154
|
+
this.ctx.fixedLeftWidth = c.reduce((f, x) => f + x.width, 0);
|
|
3155
|
+
const d = this.fixedRightCellHeaders.filter((f) => !f.hasChildren);
|
|
3156
|
+
this.ctx.fixedRightWidth = d.reduce((f, x) => f + x.width, e), this.ctx.maxColIndex = this.leafCellHeaders.length - 1, this.ctx.header.x = this.x, this.ctx.header.y = this.y, this.ctx.header.width = this.width, this.ctx.header.height = this.height, this.ctx.header.visibleWidth = this.visibleWidth, this.ctx.header.visibleHeight = this.visibleHeight;
|
|
3150
3157
|
}
|
|
3151
3158
|
// 调整表头的宽度
|
|
3152
3159
|
initResizeColumn() {
|
|
@@ -3173,8 +3180,8 @@ class di {
|
|
|
3173
3180
|
this.ctx.stageElement.style.cursor === "col-resize" && (this.ctx.stageElement.style.cursor = "default");
|
|
3174
3181
|
const r = [...this.renderFixedCellHeaders, ...this.renderCenterCellHeaders];
|
|
3175
3182
|
for (const o of r) {
|
|
3176
|
-
const { offsetX: a, offsetY: h } = this.ctx.getOffset(e), c = a,
|
|
3177
|
-
c >
|
|
3183
|
+
const { offsetX: a, offsetY: h } = this.ctx.getOffset(e), c = a, d = o.getDrawX();
|
|
3184
|
+
c > d + o.width - 5 && c < d + o.width + 4 && c < i - 4 && // 视窗中最后一列不允许调整宽
|
|
3178
3185
|
o.colspan <= 1 && this.ctx.isTarget() && h <= this.height && (this.ctx.stageElement.style.cursor = "col-resize", this.resizeTarget = o);
|
|
3179
3186
|
}
|
|
3180
3187
|
}
|
|
@@ -3230,10 +3237,10 @@ class di {
|
|
|
3230
3237
|
const { HEADER_HEIGHT: r = 0 } = this.ctx.config;
|
|
3231
3238
|
for (let o = 0; o < i; o++) {
|
|
3232
3239
|
const a = t[o], h = r * (a.rowspan || 0), c = r * (a.level || 0);
|
|
3233
|
-
let
|
|
3234
|
-
a.children && (
|
|
3235
|
-
const
|
|
3236
|
-
this.ctx.database.setHeader(a.key,
|
|
3240
|
+
let d = a.width || 100;
|
|
3241
|
+
a.children && (d = _t(a.children).reduce((u, g) => u + ((g == null ? void 0 : g.width) || 100), 0));
|
|
3242
|
+
const f = new ie(this.ctx, this.columnIndex, s, c, d, h, a);
|
|
3243
|
+
this.ctx.database.setHeader(a.key, f), this.allCellHeaders.push(f), a.children || (this.leafCellHeaders.push(f), f.column.widthFillDisable || this.resizeNum++), a.fixed === "left" ? this.fixedLeftCellHeaders.push(f) : a.fixed === "right" ? this.fixedRightCellHeaders.push(f) : this.centerCellHeaders.push(f), !a.children && this.columnIndex++, a.children && this.render(a.children, s), s += d;
|
|
3237
3244
|
}
|
|
3238
3245
|
}
|
|
3239
3246
|
drawTipLine() {
|
|
@@ -3382,14 +3389,14 @@ class fi {
|
|
|
3382
3389
|
EMPTY_BODY_HEIGHT: a = 0,
|
|
3383
3390
|
MAX_HEIGHT: h = 0,
|
|
3384
3391
|
ENABLE_OFFSET_HEIGHT: c = 0,
|
|
3385
|
-
OFFSET_HEIGHT:
|
|
3392
|
+
OFFSET_HEIGHT: d = 0
|
|
3386
3393
|
}
|
|
3387
3394
|
} = this.ctx;
|
|
3388
3395
|
if (!e.width)
|
|
3389
3396
|
return;
|
|
3390
3397
|
this.x = 0, this.y = e.height;
|
|
3391
|
-
const { data:
|
|
3392
|
-
this.height = x, this.data =
|
|
3398
|
+
const { data: f, sumHeight: x } = i.getData();
|
|
3399
|
+
this.height = x, this.data = f;
|
|
3393
3400
|
const { top: u } = t.getBoundingClientRect();
|
|
3394
3401
|
this.width = e.width, this.visibleWidth = this.ctx.stageWidth - r;
|
|
3395
3402
|
const g = this.ctx.footer.height;
|
|
@@ -3407,11 +3414,11 @@ class fi {
|
|
|
3407
3414
|
let p = this.height + e.height + r;
|
|
3408
3415
|
p += g;
|
|
3409
3416
|
let y = 0;
|
|
3410
|
-
this.data.length && c ? (y = window.innerHeight - u -
|
|
3417
|
+
this.data.length && c ? (y = window.innerHeight - u - d, y < 0 && (y = 32, console.error(
|
|
3411
3418
|
"There is an error in the height calculation ENABLE_OFFSET_HEIGHT and OFFSET_HEIGHT are invalid"
|
|
3412
3419
|
))) : this.data.length && o ? y = o : this.data.length && h && p > h ? y = h : y = p, y > 0 && (this.ctx.stageHeight = Math.floor(y), this.ctx.stageElement.style.height = `${this.ctx.stageHeight - 0.5}px`);
|
|
3413
3420
|
let b = this.ctx.stageHeight - e.height - r;
|
|
3414
|
-
s ? this.visibleHeight = b - g : 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 =
|
|
3421
|
+
s ? this.visibleHeight = b - g : 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 = f;
|
|
3415
3422
|
const m = window.devicePixelRatio || 1, E = this.ctx.stageWidth * m, C = this.ctx.stageHeight * m;
|
|
3416
3423
|
t.width = Math.floor(E), t.height = Math.floor(C), this.ctx.canvasElement.setAttribute(
|
|
3417
3424
|
"style",
|
|
@@ -3434,18 +3441,18 @@ class fi {
|
|
|
3434
3441
|
const { offsetY: i, offsetX: s } = this.ctx.getOffset(e), r = i, o = s, a = e.clientY, {
|
|
3435
3442
|
stageHeight: h,
|
|
3436
3443
|
scrollY: c,
|
|
3437
|
-
config: { RESIZE_ROW_MIN_HEIGHT:
|
|
3444
|
+
config: { RESIZE_ROW_MIN_HEIGHT: d = 0 }
|
|
3438
3445
|
} = this.ctx;
|
|
3439
3446
|
if (this.isResizing && this.resizeTarget) {
|
|
3440
|
-
const
|
|
3447
|
+
const f = this.resizeTarget.height;
|
|
3441
3448
|
let x = a - this.clientY;
|
|
3442
|
-
x +
|
|
3449
|
+
x + f < d && (x = -(f - d)), this.resizeDiff = x, this.ctx.emit("draw");
|
|
3443
3450
|
} else {
|
|
3444
3451
|
if (this.resizeTarget = null, this.isMouseDown || this.ctx.stageElement.style.cursor === "crosshair")
|
|
3445
3452
|
return;
|
|
3446
3453
|
this.ctx.stageElement.style.cursor === "row-resize" && (this.ctx.stageElement.style.cursor = "default");
|
|
3447
|
-
for (let
|
|
3448
|
-
const x = this.renderRows[
|
|
3454
|
+
for (let f = 0; f < this.renderRows.length; f++) {
|
|
3455
|
+
const x = this.renderRows[f];
|
|
3449
3456
|
if (r > x.y - c + x.height - 1.5 && r < x.y - c + x.height + 1.5 && r < h - 4)
|
|
3450
3457
|
for (let g = 0; g < x.cells.length; g++) {
|
|
3451
3458
|
const w = x.cells[g];
|
|
@@ -3523,8 +3530,8 @@ class fi {
|
|
|
3523
3530
|
let h = this.binarySearch(o, s + this.visibleHeight);
|
|
3524
3531
|
h === -1 && (h = r.length), this.headIndex = Math.max(0, a), this.tailIndex = Math.min(this.ctx.maxRowIndex, h + 1), this.visibleRows = r.slice(this.headIndex, this.tailIndex + 1), this.ctx.body.headIndex = this.headIndex, this.ctx.body.tailIndex = this.tailIndex, this.ctx.body.visibleRows = this.visibleRows;
|
|
3525
3532
|
const c = [];
|
|
3526
|
-
for (let
|
|
3527
|
-
const
|
|
3533
|
+
for (let d = 0; d < this.visibleRows.length; d++) {
|
|
3534
|
+
const f = this.headIndex + d, x = this.visibleRows[d], { height: u, top: g } = this.ctx.database.getPositionForRowIndex(f), w = new se(this.ctx, f, 0, g + this.y, t.width, u, x);
|
|
3528
3535
|
c.push(w);
|
|
3529
3536
|
}
|
|
3530
3537
|
this.renderRows = c, this.ctx.body.renderRows = c;
|
|
@@ -3728,10 +3735,10 @@ class ui {
|
|
|
3728
3735
|
SELECTOR_AREA_MIN_X: a,
|
|
3729
3736
|
SELECTOR_AREA_MAX_X: h,
|
|
3730
3737
|
SELECTOR_AREA_MIN_Y: c,
|
|
3731
|
-
SELECTOR_AREA_MAX_Y:
|
|
3732
|
-
SELECTOR_AREA_MAX_X_OFFSET:
|
|
3738
|
+
SELECTOR_AREA_MAX_Y: d,
|
|
3739
|
+
SELECTOR_AREA_MAX_X_OFFSET: f,
|
|
3733
3740
|
SELECTOR_AREA_MAX_Y_OFFSET: x
|
|
3734
|
-
} = this.ctx.config, u = a, g = h || this.ctx.maxColIndex -
|
|
3741
|
+
} = this.ctx.config, u = a, g = h || this.ctx.maxColIndex - f, w = c, p = d || this.ctx.maxRowIndex - x;
|
|
3735
3742
|
let [y, b] = r, [m, E] = o;
|
|
3736
3743
|
if (y < u || b > g || m < w || E > p)
|
|
3737
3744
|
return;
|
|
@@ -3772,7 +3779,7 @@ class ui {
|
|
|
3772
3779
|
SELECTOR_AREA_MAX_Y: o,
|
|
3773
3780
|
SELECTOR_AREA_MAX_X_OFFSET: a,
|
|
3774
3781
|
SELECTOR_AREA_MAX_Y_OFFSET: h
|
|
3775
|
-
} = this.ctx.config, c = i,
|
|
3782
|
+
} = this.ctx.config, c = i, d = s || this.ctx.maxColIndex - a, f = r, x = o || this.ctx.maxRowIndex - h, u = [c, d], g = [f, x];
|
|
3776
3783
|
this.setSelector(u, g);
|
|
3777
3784
|
}
|
|
3778
3785
|
}
|
|
@@ -3788,11 +3795,11 @@ class ui {
|
|
|
3788
3795
|
if (this.ctx.focusCell && this.ctx.mousedown) {
|
|
3789
3796
|
const { rowIndex: h } = this.ctx.focusCell;
|
|
3790
3797
|
if (t.rowIndex >= h) {
|
|
3791
|
-
const c = [a, o],
|
|
3792
|
-
this.setSelector(c,
|
|
3798
|
+
const c = [a, o], d = [h, t.rowIndex];
|
|
3799
|
+
this.setSelector(c, d);
|
|
3793
3800
|
} else {
|
|
3794
|
-
const c = [a, o],
|
|
3795
|
-
this.setSelector(c,
|
|
3801
|
+
const c = [a, o], d = [t.rowIndex, h];
|
|
3802
|
+
this.setSelector(c, d);
|
|
3796
3803
|
}
|
|
3797
3804
|
}
|
|
3798
3805
|
}
|
|
@@ -3801,15 +3808,15 @@ class ui {
|
|
|
3801
3808
|
return;
|
|
3802
3809
|
const { mousedown: t, focusCell: e, hoverCell: i } = this.ctx;
|
|
3803
3810
|
if (t && e && i) {
|
|
3804
|
-
const { rowIndex: s, colIndex: r } = e, o = Math.min(i.colIndex, r), a = Math.max(i.colIndex, r), h = Math.min(i.rowIndex, s), c = Math.max(i.rowIndex, s),
|
|
3805
|
-
this.setSelector(
|
|
3811
|
+
const { rowIndex: s, colIndex: r } = e, o = Math.min(i.colIndex, r), a = Math.max(i.colIndex, r), h = Math.min(i.rowIndex, s), c = Math.max(i.rowIndex, s), d = [o, a], f = [h, c];
|
|
3812
|
+
this.setSelector(d, f);
|
|
3806
3813
|
}
|
|
3807
3814
|
}
|
|
3808
3815
|
click(t = !1) {
|
|
3809
3816
|
const { focusCell: e, clickCell: i } = this.ctx;
|
|
3810
3817
|
if (e && this.isInSettingRange(e.rowIndex, e.colIndex))
|
|
3811
3818
|
if (this.ctx.selector.enable = !0, i && t) {
|
|
3812
|
-
const { colIndex: s, rowIndex: r } = i, { colIndex: o, rowIndex: a } = e, h = Math.min(o, s), c = Math.max(o, s),
|
|
3819
|
+
const { colIndex: s, rowIndex: r } = i, { colIndex: o, rowIndex: a } = e, h = Math.min(o, s), c = Math.max(o, s), d = Math.min(a, r), f = Math.max(a, r), x = [h, c], u = [d, f];
|
|
3813
3820
|
this.setSelector(x, u);
|
|
3814
3821
|
} else {
|
|
3815
3822
|
this.ctx.emit("cellSelectedClick", e);
|
|
@@ -3851,9 +3858,9 @@ class ui {
|
|
|
3851
3858
|
const r = /* @__PURE__ */ new Set();
|
|
3852
3859
|
for (let a = 0; a <= e[1] - e[0]; a++)
|
|
3853
3860
|
for (let h = 0; h <= t[1] - t[0]; h++) {
|
|
3854
|
-
const c = a + e[0],
|
|
3855
|
-
if (
|
|
3856
|
-
const { rowKey: x, key: u } =
|
|
3861
|
+
const c = a + e[0], d = h + t[0], f = this.ctx.database.getItemValueForRowIndexAndColIndex(c, d);
|
|
3862
|
+
if (f) {
|
|
3863
|
+
const { rowKey: x, key: u } = f;
|
|
3857
3864
|
this.ctx.database.getReadonly(x, u) || (r.add(x), s.push({
|
|
3858
3865
|
rowKey: x,
|
|
3859
3866
|
key: u,
|
|
@@ -3883,10 +3890,10 @@ class ui {
|
|
|
3883
3890
|
const e = this.ctx.selector.yArr[0], i = this.ctx.selector.xArr[0], s = /* @__PURE__ */ new Set();
|
|
3884
3891
|
navigator.clipboard.readText().then(async (r) => {
|
|
3885
3892
|
let o = ti(r), a = [];
|
|
3886
|
-
for (let
|
|
3887
|
-
const
|
|
3888
|
-
for (let x = 0; x <=
|
|
3889
|
-
const u =
|
|
3893
|
+
for (let d = 0; d <= o.length - 1; d++) {
|
|
3894
|
+
const f = o[d].length;
|
|
3895
|
+
for (let x = 0; x <= f - 1; x++) {
|
|
3896
|
+
const u = d + e, g = x + i, w = o[d][x], p = this.ctx.database.getItemValueForRowIndexAndColIndex(
|
|
3890
3897
|
u,
|
|
3891
3898
|
g
|
|
3892
3899
|
);
|
|
@@ -3903,33 +3910,33 @@ class ui {
|
|
|
3903
3910
|
}
|
|
3904
3911
|
}
|
|
3905
3912
|
if (this.isCut) {
|
|
3906
|
-
const
|
|
3913
|
+
const d = this.clearSelectedData(
|
|
3907
3914
|
this.ctx.selector.xArrCopy,
|
|
3908
3915
|
this.ctx.selector.yArrCopy,
|
|
3909
3916
|
!0
|
|
3910
3917
|
// 忽略设置,只返回数据,用于cut,实现历史回退需要返回两次问题
|
|
3911
|
-
),
|
|
3912
|
-
|
|
3913
|
-
|
|
3918
|
+
), f = a.map((x) => `${x.rowKey}-${x.key}`);
|
|
3919
|
+
d.forEach((x) => {
|
|
3920
|
+
f.includes(`${x.rowKey}-${x.key}`) || a.unshift(x);
|
|
3914
3921
|
}), this.isCut = !1;
|
|
3915
3922
|
}
|
|
3916
3923
|
if (!a.length)
|
|
3917
3924
|
return;
|
|
3918
3925
|
const { BEFORE_PASTE_CHANGE_METHOD: h } = this.ctx.config;
|
|
3919
3926
|
if (typeof h == "function") {
|
|
3920
|
-
const
|
|
3927
|
+
const d = h, f = a.map((x) => ({
|
|
3921
3928
|
rowKey: x.rowKey,
|
|
3922
3929
|
key: x.key,
|
|
3923
3930
|
value: x.value,
|
|
3924
3931
|
oldValue: this.ctx.database.getItemValue(x.rowKey, x.key),
|
|
3925
3932
|
row: this.ctx.database.getRowDataItemForRowKey(x.rowKey)
|
|
3926
3933
|
}));
|
|
3927
|
-
a = await f
|
|
3934
|
+
a = await d(f);
|
|
3928
3935
|
}
|
|
3929
3936
|
this.clearCopyLine(), this.ctx.database.batchSetItemValue(a, !0);
|
|
3930
3937
|
let c = [];
|
|
3931
|
-
s.forEach((
|
|
3932
|
-
c.push(this.ctx.database.getRowDataItemForRowKey(
|
|
3938
|
+
s.forEach((d) => {
|
|
3939
|
+
c.push(this.ctx.database.getRowDataItemForRowKey(d));
|
|
3933
3940
|
}), this.ctx.emit("pasteChange", a, c);
|
|
3934
3941
|
}).catch((r) => {
|
|
3935
3942
|
console.error("获取剪贴板内容失败:", r);
|
|
@@ -3961,8 +3968,8 @@ class ui {
|
|
|
3961
3968
|
s < h && s++;
|
|
3962
3969
|
break;
|
|
3963
3970
|
}
|
|
3964
|
-
const c = [i, i],
|
|
3965
|
-
|
|
3971
|
+
const c = [i, i], d = [s, s], f = this.getCell(s, i);
|
|
3972
|
+
f && (f.operation || this.isInSettingRange(f.rowIndex, f.colIndex) && (this.ctx.setFocusCell(f), this.setSelector(c, d), this.adjustBoundaryPosition(), this.ctx.emit("draw")));
|
|
3966
3973
|
}
|
|
3967
3974
|
stopAdjustPosition() {
|
|
3968
3975
|
this.adjustPositionX = "", this.adjustPositionY = "", this.timerX && (clearInterval(this.timerX), this.timerX = 0), this.timerY && (clearInterval(this.timerY), this.timerY = 0);
|
|
@@ -3976,8 +3983,8 @@ class ui {
|
|
|
3976
3983
|
SELECTOR_AREA_MAX_Y: o,
|
|
3977
3984
|
SELECTOR_AREA_MAX_X_OFFSET: a,
|
|
3978
3985
|
SELECTOR_AREA_MAX_Y_OFFSET: h
|
|
3979
|
-
} = this.ctx.config, c = i,
|
|
3980
|
-
return !(e < c || e >
|
|
3986
|
+
} = this.ctx.config, c = i, d = s || this.ctx.maxColIndex - a, f = r, x = o || this.ctx.maxRowIndex - h;
|
|
3987
|
+
return !(e < c || e > d || t < f || t > x);
|
|
3981
3988
|
}
|
|
3982
3989
|
/**
|
|
3983
3990
|
* 调整滚动条位置,让到达边界时自动滚动
|
|
@@ -4018,8 +4025,8 @@ class ui {
|
|
|
4018
4025
|
footer: a,
|
|
4019
4026
|
body: h,
|
|
4020
4027
|
scrollX: c,
|
|
4021
|
-
scrollY:
|
|
4022
|
-
config: { SCROLLER_TRACK_SIZE:
|
|
4028
|
+
scrollY: d,
|
|
4029
|
+
config: { SCROLLER_TRACK_SIZE: f, FOOTER_FIXED: x }
|
|
4023
4030
|
} = this.ctx;
|
|
4024
4031
|
if (!i)
|
|
4025
4032
|
return;
|
|
@@ -4028,9 +4035,9 @@ class ui {
|
|
|
4028
4035
|
p > h.visibleHeight && (p = h.visibleHeight);
|
|
4029
4036
|
let y = 0;
|
|
4030
4037
|
x && (y = a.visibleHeight);
|
|
4031
|
-
const b = i.drawY + p - (t - y -
|
|
4032
|
-
let m = c, E =
|
|
4033
|
-
g > 0 && !i.fixed ? m = Math.floor(c + g) : u > 0 && !i.fixed && (m = Math.floor(c - u)), w > 0 ? E = Math.floor(
|
|
4038
|
+
const b = i.drawY + p - (t - y - f);
|
|
4039
|
+
let m = c, E = d;
|
|
4040
|
+
g > 0 && !i.fixed ? m = Math.floor(c + g) : u > 0 && !i.fixed && (m = Math.floor(c - u)), w > 0 ? E = Math.floor(d - w) : b > 0 && (E = Math.floor(d + b)), (Math.abs(c - m) > 2 || Math.abs(d - E) > 2) && (this.ctx.adjustPositioning = !0, this.ctx.setScroll(m, E), this.ctx.emit("adjustBoundaryPosition", i));
|
|
4034
4041
|
}
|
|
4035
4042
|
destroy() {
|
|
4036
4043
|
this.timerX && (clearTimeout(this.timerX), this.timerX = 0), this.timerY && (clearTimeout(this.timerY), this.timerY = 0);
|
|
@@ -4044,9 +4051,9 @@ class gi {
|
|
|
4044
4051
|
init() {
|
|
4045
4052
|
this.ctx.on("cellMouseenter", (t, e) => {
|
|
4046
4053
|
this.ctx.stageElement.style.cursor === "crosshair" && (this.ctx.stageElement.style.cursor = "default");
|
|
4047
|
-
const { offsetX: i, offsetY: s } = this.ctx.getOffset(e), { xArr: r, yArr: o } = this.ctx.selector, a = r[1], h = o[1], { colIndex: c, rowIndex:
|
|
4048
|
-
if (this.ctx.config.ENABLE_AUTOFILL && c === a &&
|
|
4049
|
-
const p =
|
|
4054
|
+
const { offsetX: i, offsetY: s } = this.ctx.getOffset(e), { xArr: r, yArr: o } = this.ctx.selector, a = r[1], h = o[1], { colIndex: c, rowIndex: d, drawX: f, drawY: x, width: u, height: g } = t;
|
|
4055
|
+
if (this.ctx.config.ENABLE_AUTOFILL && c === a && d === h) {
|
|
4056
|
+
const p = f + u - 6, y = x + g - 6;
|
|
4050
4057
|
i > p && s > y && (this.ctx.stageElement.style.cursor = "crosshair");
|
|
4051
4058
|
}
|
|
4052
4059
|
this.mouseenter(t);
|
|
@@ -4089,11 +4096,11 @@ class gi {
|
|
|
4089
4096
|
const {
|
|
4090
4097
|
SELECTOR_AREA_MIN_X: h,
|
|
4091
4098
|
SELECTOR_AREA_MAX_X: c,
|
|
4092
|
-
SELECTOR_AREA_MIN_Y:
|
|
4093
|
-
SELECTOR_AREA_MAX_Y:
|
|
4099
|
+
SELECTOR_AREA_MIN_Y: d,
|
|
4100
|
+
SELECTOR_AREA_MAX_Y: f,
|
|
4094
4101
|
SELECTOR_AREA_MAX_X_OFFSET: x,
|
|
4095
4102
|
SELECTOR_AREA_MAX_Y_OFFSET: u
|
|
4096
|
-
} = this.ctx.config, g = h, w = c || this.ctx.maxColIndex - x, p =
|
|
4103
|
+
} = this.ctx.config, g = h, w = c || this.ctx.maxColIndex - x, p = d, y = f || this.ctx.maxRowIndex - u;
|
|
4097
4104
|
let [b, m] = o, [E, C] = a;
|
|
4098
4105
|
if (b < g || E < p)
|
|
4099
4106
|
return;
|
|
@@ -4127,9 +4134,9 @@ class gi {
|
|
|
4127
4134
|
}
|
|
4128
4135
|
if (!c.length)
|
|
4129
4136
|
return;
|
|
4130
|
-
const { BEFORE_AUTOFILL_CHANGE_METHOD:
|
|
4131
|
-
if (typeof
|
|
4132
|
-
const x =
|
|
4137
|
+
const { BEFORE_AUTOFILL_CHANGE_METHOD: d } = this.ctx.config;
|
|
4138
|
+
if (typeof d == "function") {
|
|
4139
|
+
const x = d, u = c.map((g) => ({
|
|
4133
4140
|
rowKey: g.rowKey,
|
|
4134
4141
|
key: g.key,
|
|
4135
4142
|
value: g.value,
|
|
@@ -4139,10 +4146,10 @@ class gi {
|
|
|
4139
4146
|
c = await x(u);
|
|
4140
4147
|
}
|
|
4141
4148
|
this.ctx.selector.xArr = this.ctx.autofill.xArr, this.ctx.selector.yArr = this.ctx.autofill.yArr, this.ctx.database.batchSetItemValue(c, !0);
|
|
4142
|
-
let
|
|
4149
|
+
let f = [];
|
|
4143
4150
|
t.forEach((x) => {
|
|
4144
|
-
|
|
4145
|
-
}), this.ctx.emit("autofillChange", c,
|
|
4151
|
+
f.push(this.ctx.database.getRowDataItemForRowKey(x));
|
|
4152
|
+
}), this.ctx.emit("autofillChange", c, f);
|
|
4146
4153
|
}
|
|
4147
4154
|
mouseenter(t) {
|
|
4148
4155
|
if (["index", "selection", "index-selection"].includes(t.type))
|
|
@@ -4266,31 +4273,31 @@ function Vt(n, t, e) {
|
|
|
4266
4273
|
reference: i,
|
|
4267
4274
|
floating: s
|
|
4268
4275
|
} = n;
|
|
4269
|
-
const r = J(t), o = Mt(t), a = Lt(o), h = q(t), c = r === "y",
|
|
4276
|
+
const r = J(t), o = Mt(t), a = Lt(o), h = q(t), c = r === "y", d = i.x + i.width / 2 - s.width / 2, f = i.y + i.height / 2 - s.height / 2, x = i[a] / 2 - s[a] / 2;
|
|
4270
4277
|
let u;
|
|
4271
4278
|
switch (h) {
|
|
4272
4279
|
case "top":
|
|
4273
4280
|
u = {
|
|
4274
|
-
x:
|
|
4281
|
+
x: d,
|
|
4275
4282
|
y: i.y - s.height
|
|
4276
4283
|
};
|
|
4277
4284
|
break;
|
|
4278
4285
|
case "bottom":
|
|
4279
4286
|
u = {
|
|
4280
|
-
x:
|
|
4287
|
+
x: d,
|
|
4281
4288
|
y: i.y + i.height
|
|
4282
4289
|
};
|
|
4283
4290
|
break;
|
|
4284
4291
|
case "right":
|
|
4285
4292
|
u = {
|
|
4286
4293
|
x: i.x + i.width,
|
|
4287
|
-
y:
|
|
4294
|
+
y: f
|
|
4288
4295
|
};
|
|
4289
4296
|
break;
|
|
4290
4297
|
case "left":
|
|
4291
4298
|
u = {
|
|
4292
4299
|
x: i.x - s.width,
|
|
4293
|
-
y:
|
|
4300
|
+
y: f
|
|
4294
4301
|
};
|
|
4295
4302
|
break;
|
|
4296
4303
|
default:
|
|
@@ -4321,8 +4328,8 @@ const vi = async (n, t, e) => {
|
|
|
4321
4328
|
floating: t,
|
|
4322
4329
|
strategy: s
|
|
4323
4330
|
}), {
|
|
4324
|
-
x:
|
|
4325
|
-
y:
|
|
4331
|
+
x: d,
|
|
4332
|
+
y: f
|
|
4326
4333
|
} = Vt(c, i, h), x = i, u = {}, g = 0;
|
|
4327
4334
|
for (let w = 0; w < a.length; w++) {
|
|
4328
4335
|
const {
|
|
@@ -4334,8 +4341,8 @@ const vi = async (n, t, e) => {
|
|
|
4334
4341
|
data: E,
|
|
4335
4342
|
reset: C
|
|
4336
4343
|
} = await y({
|
|
4337
|
-
x:
|
|
4338
|
-
y:
|
|
4344
|
+
x: d,
|
|
4345
|
+
y: f,
|
|
4339
4346
|
initialPlacement: i,
|
|
4340
4347
|
placement: x,
|
|
4341
4348
|
strategy: s,
|
|
@@ -4347,7 +4354,7 @@ const vi = async (n, t, e) => {
|
|
|
4347
4354
|
floating: t
|
|
4348
4355
|
}
|
|
4349
4356
|
});
|
|
4350
|
-
|
|
4357
|
+
d = b ?? d, f = m ?? f, u = {
|
|
4351
4358
|
...u,
|
|
4352
4359
|
[p]: {
|
|
4353
4360
|
...u[p],
|
|
@@ -4358,13 +4365,13 @@ const vi = async (n, t, e) => {
|
|
|
4358
4365
|
floating: t,
|
|
4359
4366
|
strategy: s
|
|
4360
4367
|
}) : C.rects), {
|
|
4361
|
-
x:
|
|
4362
|
-
y:
|
|
4368
|
+
x: d,
|
|
4369
|
+
y: f
|
|
4363
4370
|
} = Vt(c, x, h)), w = -1);
|
|
4364
4371
|
}
|
|
4365
4372
|
return {
|
|
4366
|
-
x:
|
|
4367
|
-
y:
|
|
4373
|
+
x: d,
|
|
4374
|
+
y: f,
|
|
4368
4375
|
placement: x,
|
|
4369
4376
|
strategy: s,
|
|
4370
4377
|
middlewareData: u
|
|
@@ -4382,16 +4389,16 @@ async function ne(n, t) {
|
|
|
4382
4389
|
strategy: h
|
|
4383
4390
|
} = n, {
|
|
4384
4391
|
boundary: c = "clippingAncestors",
|
|
4385
|
-
rootBoundary:
|
|
4386
|
-
elementContext:
|
|
4392
|
+
rootBoundary: d = "viewport",
|
|
4393
|
+
elementContext: f = "floating",
|
|
4387
4394
|
altBoundary: x = !1,
|
|
4388
4395
|
padding: u = 0
|
|
4389
|
-
} = at(t, n), g = oe(u), p = a[x ?
|
|
4396
|
+
} = at(t, n), g = oe(u), p = a[x ? f === "floating" ? "reference" : "floating" : f], y = ut(await r.getClippingRect({
|
|
4390
4397
|
element: (e = await (r.isElement == null ? void 0 : r.isElement(p))) == null || e ? p : p.contextElement || await (r.getDocumentElement == null ? void 0 : r.getDocumentElement(a.floating)),
|
|
4391
4398
|
boundary: c,
|
|
4392
|
-
rootBoundary:
|
|
4399
|
+
rootBoundary: d,
|
|
4393
4400
|
strategy: h
|
|
4394
|
-
})), b =
|
|
4401
|
+
})), b = f === "floating" ? {
|
|
4395
4402
|
x: i,
|
|
4396
4403
|
y: s,
|
|
4397
4404
|
width: o.floating.width,
|
|
@@ -4429,17 +4436,17 @@ const Ri = (n) => ({
|
|
|
4429
4436
|
middlewareData: h
|
|
4430
4437
|
} = t, {
|
|
4431
4438
|
element: c,
|
|
4432
|
-
padding:
|
|
4439
|
+
padding: d = 0
|
|
4433
4440
|
} = at(n, t) || {};
|
|
4434
4441
|
if (c == null)
|
|
4435
4442
|
return {};
|
|
4436
|
-
const
|
|
4443
|
+
const f = oe(d), x = {
|
|
4437
4444
|
x: e,
|
|
4438
4445
|
y: i
|
|
4439
4446
|
}, u = Mt(s), g = Lt(u), w = await o.getDimensions(c), p = u === "y", y = p ? "top" : "left", b = p ? "bottom" : "right", m = p ? "clientHeight" : "clientWidth", E = r.reference[g] + r.reference[u] - x[u] - r.floating[g], C = x[u] - r.reference[u], R = await (o.getOffsetParent == null ? void 0 : o.getOffsetParent(c));
|
|
4440
|
-
let
|
|
4441
|
-
(!
|
|
4442
|
-
const
|
|
4447
|
+
let A = R ? R[m] : 0;
|
|
4448
|
+
(!A || !await (o.isElement == null ? void 0 : o.isElement(R))) && (A = a.floating[m] || r.floating[g]);
|
|
4449
|
+
const S = E / 2 - C / 2, L = A / 2 - w[g] / 2 - 1, D = rt(f[y], L), B = rt(f[b], L), I = D, T = A - w[g] - B, O = A / 2 - w[g] / 2 + S, G = It(I, O, T), K = !h.arrow && lt(s) != null && O !== G && r.reference[g] / 2 - (O < I ? D : B) - w[g] / 2 < 0, k = K ? O < I ? O - I : O - T : 0;
|
|
4443
4450
|
return {
|
|
4444
4451
|
[u]: x[u] + k,
|
|
4445
4452
|
data: {
|
|
@@ -4466,8 +4473,8 @@ const Ri = (n) => ({
|
|
|
4466
4473
|
platform: h,
|
|
4467
4474
|
elements: c
|
|
4468
4475
|
} = t, {
|
|
4469
|
-
mainAxis:
|
|
4470
|
-
crossAxis:
|
|
4476
|
+
mainAxis: d = !0,
|
|
4477
|
+
crossAxis: f = !0,
|
|
4471
4478
|
fallbackPlacements: x,
|
|
4472
4479
|
fallbackStrategy: u = "bestFit",
|
|
4473
4480
|
fallbackAxisSideDirection: g = "none",
|
|
@@ -4478,18 +4485,18 @@ const Ri = (n) => ({
|
|
|
4478
4485
|
return {};
|
|
4479
4486
|
const y = q(s), b = J(a), m = q(a) === a, E = await (h.isRTL == null ? void 0 : h.isRTL(c.floating)), C = x || (m || !w ? [xt(a)] : mi(a)), R = g !== "none";
|
|
4480
4487
|
!x && R && C.push(...bi(a, w, g, E));
|
|
4481
|
-
const
|
|
4488
|
+
const A = [a, ...C], S = await ne(t, p), L = [];
|
|
4482
4489
|
let D = ((i = r.flip) == null ? void 0 : i.overflows) || [];
|
|
4483
|
-
if (
|
|
4490
|
+
if (d && L.push(S[y]), f) {
|
|
4484
4491
|
const O = yi(s, o, E);
|
|
4485
|
-
L.push(
|
|
4492
|
+
L.push(S[O[0]], S[O[1]]);
|
|
4486
4493
|
}
|
|
4487
4494
|
if (D = [...D, {
|
|
4488
4495
|
placement: s,
|
|
4489
4496
|
overflows: L
|
|
4490
4497
|
}], !L.every((O) => O <= 0)) {
|
|
4491
4498
|
var B, I;
|
|
4492
|
-
const O = (((B = r.flip) == null ? void 0 : B.index) || 0) + 1, G =
|
|
4499
|
+
const O = (((B = r.flip) == null ? void 0 : B.index) || 0) + 1, G = A[O];
|
|
4493
4500
|
if (G)
|
|
4494
4501
|
return {
|
|
4495
4502
|
data: {
|
|
@@ -4504,8 +4511,8 @@ const Ri = (n) => ({
|
|
|
4504
4511
|
if (!K)
|
|
4505
4512
|
switch (u) {
|
|
4506
4513
|
case "bestFit": {
|
|
4507
|
-
var
|
|
4508
|
-
const k = (
|
|
4514
|
+
var T;
|
|
4515
|
+
const k = (T = D.filter((W) => {
|
|
4509
4516
|
if (R) {
|
|
4510
4517
|
const P = J(W.placement);
|
|
4511
4518
|
return P === b || // Create a bias to the `y` side axis due to horizontal
|
|
@@ -4513,7 +4520,7 @@ const Ri = (n) => ({
|
|
|
4513
4520
|
P === "y";
|
|
4514
4521
|
}
|
|
4515
4522
|
return !0;
|
|
4516
|
-
}).map((W) => [W.placement, W.overflows.filter((P) => P > 0).reduce((P, ye) => P + ye, 0)]).sort((W, P) => W[1] - P[1])[0]) == null ? void 0 :
|
|
4523
|
+
}).map((W) => [W.placement, W.overflows.filter((P) => P > 0).reduce((P, ye) => P + ye, 0)]).sort((W, P) => W[1] - P[1])[0]) == null ? void 0 : T[0];
|
|
4517
4524
|
k && (K = k);
|
|
4518
4525
|
break;
|
|
4519
4526
|
}
|
|
@@ -4537,26 +4544,26 @@ async function Ii(n, t) {
|
|
|
4537
4544
|
placement: e,
|
|
4538
4545
|
platform: i,
|
|
4539
4546
|
elements: s
|
|
4540
|
-
} = n, r = await (i.isRTL == null ? void 0 : i.isRTL(s.floating)), o = q(e), a = lt(e), h = J(e) === "y", c = ["left", "top"].includes(o) ? -1 : 1,
|
|
4547
|
+
} = n, r = await (i.isRTL == null ? void 0 : i.isRTL(s.floating)), o = q(e), a = lt(e), h = J(e) === "y", c = ["left", "top"].includes(o) ? -1 : 1, d = r && h ? -1 : 1, f = at(t, n);
|
|
4541
4548
|
let {
|
|
4542
4549
|
mainAxis: x,
|
|
4543
4550
|
crossAxis: u,
|
|
4544
4551
|
alignmentAxis: g
|
|
4545
|
-
} = typeof
|
|
4546
|
-
mainAxis:
|
|
4552
|
+
} = typeof f == "number" ? {
|
|
4553
|
+
mainAxis: f,
|
|
4547
4554
|
crossAxis: 0,
|
|
4548
4555
|
alignmentAxis: null
|
|
4549
4556
|
} : {
|
|
4550
|
-
mainAxis:
|
|
4551
|
-
crossAxis:
|
|
4552
|
-
alignmentAxis:
|
|
4557
|
+
mainAxis: f.mainAxis || 0,
|
|
4558
|
+
crossAxis: f.crossAxis || 0,
|
|
4559
|
+
alignmentAxis: f.alignmentAxis
|
|
4553
4560
|
};
|
|
4554
4561
|
return a && typeof g == "number" && (u = a === "end" ? g * -1 : g), h ? {
|
|
4555
|
-
x: u *
|
|
4562
|
+
x: u * d,
|
|
4556
4563
|
y: x * c
|
|
4557
4564
|
} : {
|
|
4558
4565
|
x: x * c,
|
|
4559
|
-
y: u *
|
|
4566
|
+
y: u * d
|
|
4560
4567
|
};
|
|
4561
4568
|
}
|
|
4562
4569
|
const Oi = function(n) {
|
|
@@ -4581,7 +4588,7 @@ const Oi = function(n) {
|
|
|
4581
4588
|
};
|
|
4582
4589
|
}
|
|
4583
4590
|
};
|
|
4584
|
-
},
|
|
4591
|
+
}, Ai = function(n) {
|
|
4585
4592
|
return n === void 0 && (n = {}), {
|
|
4586
4593
|
name: "shift",
|
|
4587
4594
|
options: n,
|
|
@@ -4609,20 +4616,20 @@ const Oi = function(n) {
|
|
|
4609
4616
|
} = at(n, t), c = {
|
|
4610
4617
|
x: e,
|
|
4611
4618
|
y: i
|
|
4612
|
-
},
|
|
4613
|
-
let u = c[x], g = c[
|
|
4619
|
+
}, d = await ne(t, h), f = J(q(s)), x = re(f);
|
|
4620
|
+
let u = c[x], g = c[f];
|
|
4614
4621
|
if (r) {
|
|
4615
|
-
const p = x === "y" ? "top" : "left", y = x === "y" ? "bottom" : "right", b = u +
|
|
4622
|
+
const p = x === "y" ? "top" : "left", y = x === "y" ? "bottom" : "right", b = u + d[p], m = u - d[y];
|
|
4616
4623
|
u = It(b, u, m);
|
|
4617
4624
|
}
|
|
4618
4625
|
if (o) {
|
|
4619
|
-
const p =
|
|
4626
|
+
const p = f === "y" ? "top" : "left", y = f === "y" ? "bottom" : "right", b = g + d[p], m = g - d[y];
|
|
4620
4627
|
g = It(b, g, m);
|
|
4621
4628
|
}
|
|
4622
4629
|
const w = a.fn({
|
|
4623
4630
|
...t,
|
|
4624
4631
|
[x]: u,
|
|
4625
|
-
[
|
|
4632
|
+
[f]: g
|
|
4626
4633
|
});
|
|
4627
4634
|
return {
|
|
4628
4635
|
...w,
|
|
@@ -4631,7 +4638,7 @@ const Oi = function(n) {
|
|
|
4631
4638
|
y: w.y - i,
|
|
4632
4639
|
enabled: {
|
|
4633
4640
|
[x]: r,
|
|
4634
|
-
[
|
|
4641
|
+
[f]: o
|
|
4635
4642
|
}
|
|
4636
4643
|
}
|
|
4637
4644
|
};
|
|
@@ -4673,7 +4680,7 @@ function ht(n) {
|
|
|
4673
4680
|
} = X(n);
|
|
4674
4681
|
return /auto|scroll|overlay|hidden|clip/.test(t + i + e) && !["inline", "contents"].includes(s);
|
|
4675
4682
|
}
|
|
4676
|
-
function
|
|
4683
|
+
function Ti(n) {
|
|
4677
4684
|
return ["table", "td", "th"].includes(tt(n));
|
|
4678
4685
|
}
|
|
4679
4686
|
function wt(n) {
|
|
@@ -4689,7 +4696,7 @@ function Ht(n) {
|
|
|
4689
4696
|
const t = Dt(), e = F(n) ? X(n) : n;
|
|
4690
4697
|
return e.transform !== "none" || e.perspective !== "none" || (e.containerType ? e.containerType !== "normal" : !1) || !t && (e.backdropFilter ? e.backdropFilter !== "none" : !1) || !t && (e.filter ? e.filter !== "none" : !1) || ["transform", "perspective", "filter"].some((i) => (e.willChange || "").includes(i)) || ["paint", "layout", "strict", "content"].some((i) => (e.contain || "").includes(i));
|
|
4691
4698
|
}
|
|
4692
|
-
function
|
|
4699
|
+
function Si(n) {
|
|
4693
4700
|
let t = z(n);
|
|
4694
4701
|
for (; N(t) && !Q(t); ) {
|
|
4695
4702
|
if (Ht(t))
|
|
@@ -4734,17 +4741,17 @@ function le(n) {
|
|
|
4734
4741
|
const t = z(n);
|
|
4735
4742
|
return Q(t) ? n.ownerDocument ? n.ownerDocument.body : n.body : N(t) && ht(t) ? t : le(t);
|
|
4736
4743
|
}
|
|
4737
|
-
function
|
|
4744
|
+
function At(n, t, e) {
|
|
4738
4745
|
var i;
|
|
4739
4746
|
t === void 0 && (t = []), e === void 0 && (e = !0);
|
|
4740
4747
|
const s = le(n), r = s === ((i = n.ownerDocument) == null ? void 0 : i.body), o = H(s);
|
|
4741
4748
|
if (r) {
|
|
4742
|
-
const a =
|
|
4743
|
-
return t.concat(o, o.visualViewport || [], ht(s) ? s : [], a && e ?
|
|
4749
|
+
const a = Tt(o);
|
|
4750
|
+
return t.concat(o, o.visualViewport || [], ht(s) ? s : [], a && e ? At(a) : []);
|
|
4744
4751
|
}
|
|
4745
|
-
return t.concat(s,
|
|
4752
|
+
return t.concat(s, At(s, [], e));
|
|
4746
4753
|
}
|
|
4747
|
-
function
|
|
4754
|
+
function Tt(n) {
|
|
4748
4755
|
return n.parent && Object.getPrototypeOf(n.parent) ? n.frameElement : null;
|
|
4749
4756
|
}
|
|
4750
4757
|
function he(n) {
|
|
@@ -4792,18 +4799,18 @@ function ot(n, t, e, i) {
|
|
|
4792
4799
|
let o = V(1);
|
|
4793
4800
|
t && (i ? F(i) && (o = Z(i)) : o = Z(n));
|
|
4794
4801
|
const a = Mi(r, e, i) ? de(r) : V(0);
|
|
4795
|
-
let h = (s.left + a.x) / o.x, c = (s.top + a.y) / o.y,
|
|
4802
|
+
let h = (s.left + a.x) / o.x, c = (s.top + a.y) / o.y, d = s.width / o.x, f = s.height / o.y;
|
|
4796
4803
|
if (r) {
|
|
4797
4804
|
const x = H(r), u = i && F(i) ? H(i) : i;
|
|
4798
|
-
let g = x, w =
|
|
4805
|
+
let g = x, w = Tt(g);
|
|
4799
4806
|
for (; w && i && u !== g; ) {
|
|
4800
4807
|
const p = Z(w), y = w.getBoundingClientRect(), b = X(w), m = y.left + (w.clientLeft + parseFloat(b.paddingLeft)) * p.x, E = y.top + (w.clientTop + parseFloat(b.paddingTop)) * p.y;
|
|
4801
|
-
h *= p.x, c *= p.y,
|
|
4808
|
+
h *= p.x, c *= p.y, d *= p.x, f *= p.y, h += m, c += E, g = H(w), w = Tt(g);
|
|
4802
4809
|
}
|
|
4803
4810
|
}
|
|
4804
4811
|
return ut({
|
|
4805
|
-
width:
|
|
4806
|
-
height:
|
|
4812
|
+
width: d,
|
|
4813
|
+
height: f,
|
|
4807
4814
|
x: h,
|
|
4808
4815
|
y: c
|
|
4809
4816
|
});
|
|
@@ -4822,28 +4829,28 @@ function Hi(n) {
|
|
|
4822
4829
|
scrollLeft: 0,
|
|
4823
4830
|
scrollTop: 0
|
|
4824
4831
|
}, c = V(1);
|
|
4825
|
-
const
|
|
4826
|
-
if ((
|
|
4832
|
+
const d = V(0), f = N(i);
|
|
4833
|
+
if ((f || !f && !r) && ((tt(i) !== "body" || ht(o)) && (h = pt(i)), N(i))) {
|
|
4827
4834
|
const x = ot(i);
|
|
4828
|
-
c = Z(i),
|
|
4835
|
+
c = Z(i), d.x = x.x + i.clientLeft, d.y = x.y + i.clientTop;
|
|
4829
4836
|
}
|
|
4830
4837
|
return {
|
|
4831
4838
|
width: e.width * c.x,
|
|
4832
4839
|
height: e.height * c.y,
|
|
4833
|
-
x: e.x * c.x - h.scrollLeft * c.x +
|
|
4834
|
-
y: e.y * c.y - h.scrollTop * c.y +
|
|
4840
|
+
x: e.x * c.x - h.scrollLeft * c.x + d.x,
|
|
4841
|
+
y: e.y * c.y - h.scrollTop * c.y + d.y
|
|
4835
4842
|
};
|
|
4836
4843
|
}
|
|
4837
4844
|
function Di(n) {
|
|
4838
4845
|
return Array.from(n.getClientRects());
|
|
4839
4846
|
}
|
|
4840
|
-
function
|
|
4847
|
+
function St(n, t) {
|
|
4841
4848
|
const e = pt(n).scrollLeft;
|
|
4842
4849
|
return t ? t.left + e : ot(Y(n)).left + e;
|
|
4843
4850
|
}
|
|
4844
4851
|
function Fi(n) {
|
|
4845
4852
|
const t = Y(n), e = pt(n), i = n.ownerDocument.body, s = U(t.scrollWidth, t.clientWidth, i.scrollWidth, i.clientWidth), r = U(t.scrollHeight, t.clientHeight, i.scrollHeight, i.clientHeight);
|
|
4846
|
-
let o = -e.scrollLeft +
|
|
4853
|
+
let o = -e.scrollLeft + St(n);
|
|
4847
4854
|
const a = -e.scrollTop;
|
|
4848
4855
|
return X(i).direction === "rtl" && (o += U(t.clientWidth, i.clientWidth) - s), {
|
|
4849
4856
|
width: s,
|
|
@@ -4902,12 +4909,12 @@ function Ni(n, t) {
|
|
|
4902
4909
|
const e = t.get(n);
|
|
4903
4910
|
if (e)
|
|
4904
4911
|
return e;
|
|
4905
|
-
let i =
|
|
4912
|
+
let i = At(n, [], !1).filter((a) => F(a) && tt(a) !== "body"), s = null;
|
|
4906
4913
|
const r = X(n).position === "fixed";
|
|
4907
4914
|
let o = r ? z(n) : n;
|
|
4908
4915
|
for (; F(o) && !Q(o); ) {
|
|
4909
4916
|
const a = X(o), h = Ht(o);
|
|
4910
|
-
!h && a.position === "fixed" && (s = null), (r ? !h && !s : !h && a.position === "static" && !!s && ["absolute", "fixed"].includes(s.position) || ht(o) && !h && fe(n, o)) ? i = i.filter((
|
|
4917
|
+
!h && a.position === "fixed" && (s = null), (r ? !h && !s : !h && a.position === "static" && !!s && ["absolute", "fixed"].includes(s.position) || ht(o) && !h && fe(n, o)) ? i = i.filter((d) => d !== o) : s = a, o = z(o);
|
|
4911
4918
|
}
|
|
4912
4919
|
return t.set(n, i), i;
|
|
4913
4920
|
}
|
|
@@ -4918,9 +4925,9 @@ function Ki(n) {
|
|
|
4918
4925
|
rootBoundary: i,
|
|
4919
4926
|
strategy: s
|
|
4920
4927
|
} = n;
|
|
4921
|
-
const o = [...e === "clippingAncestors" ? wt(t) ? [] : Ni(t, this._c) : [].concat(e), i], a = o[0], h = o.reduce((c,
|
|
4922
|
-
const
|
|
4923
|
-
return c.top = U(
|
|
4928
|
+
const o = [...e === "clippingAncestors" ? wt(t) ? [] : Ni(t, this._c) : [].concat(e), i], a = o[0], h = o.reduce((c, d) => {
|
|
4929
|
+
const f = $t(t, d, s);
|
|
4930
|
+
return c.top = U(f.top, c.top), c.right = rt(f.right, c.right), c.bottom = rt(f.bottom, c.bottom), c.left = U(f.left, c.left), c;
|
|
4924
4931
|
}, $t(t, a, s));
|
|
4925
4932
|
return {
|
|
4926
4933
|
width: h.right - h.left,
|
|
@@ -4950,16 +4957,16 @@ function Bi(n, t, e) {
|
|
|
4950
4957
|
if ((tt(t) !== "body" || ht(s)) && (a = pt(t)), i) {
|
|
4951
4958
|
const u = ot(t, !0, r, t);
|
|
4952
4959
|
h.x = u.x + t.clientLeft, h.y = u.y + t.clientTop;
|
|
4953
|
-
} else s && (h.x =
|
|
4954
|
-
let c = 0,
|
|
4960
|
+
} else s && (h.x = St(s));
|
|
4961
|
+
let c = 0, d = 0;
|
|
4955
4962
|
if (s && !i && !r) {
|
|
4956
4963
|
const u = s.getBoundingClientRect();
|
|
4957
|
-
|
|
4958
|
-
|
|
4964
|
+
d = u.top + a.scrollTop, c = u.left + a.scrollLeft - // RTL <body> scrollbar.
|
|
4965
|
+
St(s, u);
|
|
4959
4966
|
}
|
|
4960
|
-
const
|
|
4967
|
+
const f = o.left + a.scrollLeft - h.x - c, x = o.top + a.scrollTop - h.y - d;
|
|
4961
4968
|
return {
|
|
4962
|
-
x:
|
|
4969
|
+
x: f,
|
|
4963
4970
|
y: x,
|
|
4964
4971
|
width: o.width,
|
|
4965
4972
|
height: o.height
|
|
@@ -4990,9 +4997,9 @@ function xe(n, t) {
|
|
|
4990
4997
|
return e;
|
|
4991
4998
|
}
|
|
4992
4999
|
let i = qt(n, t);
|
|
4993
|
-
for (; i &&
|
|
5000
|
+
for (; i && Ti(i) && mt(i); )
|
|
4994
5001
|
i = qt(i, t);
|
|
4995
|
-
return i && Q(i) && mt(i) && !Ht(i) ? e : i ||
|
|
5002
|
+
return i && Q(i) && mt(i) && !Ht(i) ? e : i || Si(n) || e;
|
|
4996
5003
|
}
|
|
4997
5004
|
const Wi = async function(n) {
|
|
4998
5005
|
const t = this.getOffsetParent || xe, e = this.getDimensions, i = await e(n.floating);
|
|
@@ -5020,7 +5027,7 @@ const Vi = {
|
|
|
5020
5027
|
getScale: Z,
|
|
5021
5028
|
isElement: F,
|
|
5022
5029
|
isRTL: Pi
|
|
5023
|
-
}, ue = Oi, ge =
|
|
5030
|
+
}, ue = Oi, ge = Ai, we = _i, zi = Ri, pe = (n, t, e) => {
|
|
5024
5031
|
const i = /* @__PURE__ */ new Map(), s = {
|
|
5025
5032
|
platform: Vi,
|
|
5026
5033
|
...e
|
|
@@ -5107,28 +5114,28 @@ let $i = class {
|
|
|
5107
5114
|
placement: t.overflowTooltipPlacement,
|
|
5108
5115
|
middleware: [ge(), we(), ue(6), zi({ element: this.arrowEl })]
|
|
5109
5116
|
}).then((a) => {
|
|
5110
|
-
const { x: h, y: c, placement:
|
|
5117
|
+
const { x: h, y: c, placement: d, middlewareData: f } = a;
|
|
5111
5118
|
if (Object.assign(this.floatingEl.style, {
|
|
5112
5119
|
top: `${c}px`,
|
|
5113
5120
|
left: `${h}px`
|
|
5114
|
-
}),
|
|
5115
|
-
const x =
|
|
5116
|
-
["left", "left-start", "left-end"].includes(
|
|
5121
|
+
}), f.arrow) {
|
|
5122
|
+
const x = f.arrow;
|
|
5123
|
+
["left", "left-start", "left-end"].includes(d) ? Object.assign(this.arrowEl.style, {
|
|
5117
5124
|
top: `${x.y}px`,
|
|
5118
5125
|
bottom: "",
|
|
5119
5126
|
left: "",
|
|
5120
5127
|
right: "-5px"
|
|
5121
|
-
}) : ["right", "right-start", "right-end"].includes(
|
|
5128
|
+
}) : ["right", "right-start", "right-end"].includes(d) ? Object.assign(this.arrowEl.style, {
|
|
5122
5129
|
top: `${x.y}px`,
|
|
5123
5130
|
bottom: "",
|
|
5124
5131
|
left: "-5px",
|
|
5125
5132
|
right: ""
|
|
5126
|
-
}) : ["bottom", "bottom-start", "bottom-end"].includes(
|
|
5133
|
+
}) : ["bottom", "bottom-start", "bottom-end"].includes(d) ? Object.assign(this.arrowEl.style, {
|
|
5127
5134
|
top: "-5px",
|
|
5128
5135
|
bottom: "",
|
|
5129
5136
|
left: `${x.x}px`,
|
|
5130
5137
|
right: ""
|
|
5131
|
-
}) : ["top", "top-start", "top-end"].includes(
|
|
5138
|
+
}) : ["top", "top-start", "top-end"].includes(d) && Object.assign(this.arrowEl.style, {
|
|
5132
5139
|
top: "",
|
|
5133
5140
|
bottom: "-5px",
|
|
5134
5141
|
left: `${x.x}px`,
|
|
@@ -5240,11 +5247,11 @@ class qi {
|
|
|
5240
5247
|
config: { CELL_PADDING: h },
|
|
5241
5248
|
header: c
|
|
5242
5249
|
} = this.ctx;
|
|
5243
|
-
let
|
|
5244
|
-
if (a >
|
|
5245
|
-
this.inputEl.style.display = "block", this.inputEl.style.minWidth = `${i - 1}px`, this.inputEl.style.minHeight = `${a - 1}px`, this.inputEl.style.maxHeight = `${
|
|
5246
|
-
const
|
|
5247
|
-
this.inputEl.setSelectionRange(
|
|
5250
|
+
let d = this.ctx.body.visibleHeight;
|
|
5251
|
+
if (a > d && (a = d), this.editorEl.style.display = "inline-block", this.editorEl.style.left = `${r - 1}px`, this.editorEl.style.top = `${o - 1}px`, this.editorEl.style.bottom = "auto", this.editorEl.style.maxHeight = `${d}px`, s === "text") {
|
|
5252
|
+
this.inputEl.style.display = "block", this.inputEl.style.minWidth = `${i - 1}px`, this.inputEl.style.minHeight = `${a - 1}px`, this.inputEl.style.maxHeight = `${d}px`, this.inputEl.style.width = `${i - 1}px`, this.inputEl.style.height = "auto", this.inputEl.style.padding = `${h}px`, e !== null && (this.inputEl.value = e), this.inputEl.focus();
|
|
5253
|
+
const f = this.inputEl.value.length;
|
|
5254
|
+
this.inputEl.setSelectionRange(f, f);
|
|
5248
5255
|
} else
|
|
5249
5256
|
this.inputEl.style.display = "none";
|
|
5250
5257
|
(this.inputEl.scrollHeight > a || o < c.height) && this.autoSize();
|
|
@@ -5280,7 +5287,7 @@ class qi {
|
|
|
5280
5287
|
r && !h && (this.enable = !0, this.ctx.editing = !0, this.cellTarget = r, this.startEditByInput(this.cellTarget), this.ctx.emit("startEdit", this.cellTarget));
|
|
5281
5288
|
}
|
|
5282
5289
|
doneEdit() {
|
|
5283
|
-
this.enable && (this.doneEditByInput(), this.ctx.emit("doneEdit", this.cellTarget), this.enable = !1, this.ctx.
|
|
5290
|
+
this.enable && (this.doneEditByInput(), this.ctx.emit("doneEdit", this.cellTarget), this.enable = !1, this.ctx.editing = !1);
|
|
5284
5291
|
}
|
|
5285
5292
|
destroy() {
|
|
5286
5293
|
var t;
|
|
@@ -5340,11 +5347,11 @@ class ji {
|
|
|
5340
5347
|
fixedRightWidth: e,
|
|
5341
5348
|
config: { SCROLLER_TRACK_SIZE: i, CSS_PREFIX: s }
|
|
5342
5349
|
} = this.ctx, { visibleWidth: r, visibleHeight: o, renderCellHeaders: a } = this.ctx.header;
|
|
5343
|
-
let h = [], c = [],
|
|
5350
|
+
let h = [], c = [], d = [];
|
|
5344
5351
|
a.forEach((p) => {
|
|
5345
|
-
p.render && (p.fixed === "left" ? c.push(p) : p.fixed === "right" ?
|
|
5352
|
+
p.render && (p.fixed === "left" ? c.push(p) : p.fixed === "right" ? d.push(p) : h.push(p));
|
|
5346
5353
|
});
|
|
5347
|
-
const
|
|
5354
|
+
const f = e - i, x = {
|
|
5348
5355
|
key: "left",
|
|
5349
5356
|
style: {
|
|
5350
5357
|
position: "absolute",
|
|
@@ -5362,7 +5369,7 @@ class ji {
|
|
|
5362
5369
|
top: "0px",
|
|
5363
5370
|
left: `${t}px`,
|
|
5364
5371
|
overflow: "hidden",
|
|
5365
|
-
width: `${r - t -
|
|
5372
|
+
width: `${r - t - f + 1}px`,
|
|
5366
5373
|
height: `${o}px`
|
|
5367
5374
|
},
|
|
5368
5375
|
cells: h
|
|
@@ -5373,10 +5380,10 @@ class ji {
|
|
|
5373
5380
|
top: "0px",
|
|
5374
5381
|
right: "0px",
|
|
5375
5382
|
overflow: "hidden",
|
|
5376
|
-
width: `${
|
|
5383
|
+
width: `${f + 1}px`,
|
|
5377
5384
|
height: `${o}px`
|
|
5378
5385
|
},
|
|
5379
|
-
cells:
|
|
5386
|
+
cells: d
|
|
5380
5387
|
};
|
|
5381
5388
|
return {
|
|
5382
5389
|
type: "header",
|
|
@@ -5402,7 +5409,7 @@ class ji {
|
|
|
5402
5409
|
fixedLeftWidth: r,
|
|
5403
5410
|
fixedRightWidth: o,
|
|
5404
5411
|
config: { SCROLLER_TRACK_SIZE: a, CSS_PREFIX: h }
|
|
5405
|
-
} = this.ctx, { visibleWidth: c, visibleHeight:
|
|
5412
|
+
} = this.ctx, { visibleWidth: c, visibleHeight: d } = this.ctx.body, f = o - a, x = {
|
|
5406
5413
|
key: "left",
|
|
5407
5414
|
style: {
|
|
5408
5415
|
position: "absolute",
|
|
@@ -5410,7 +5417,7 @@ class ji {
|
|
|
5410
5417
|
left: `${0.5}px`,
|
|
5411
5418
|
overflow: "hidden",
|
|
5412
5419
|
width: `${r}px`,
|
|
5413
|
-
height: `${
|
|
5420
|
+
height: `${d}px`
|
|
5414
5421
|
},
|
|
5415
5422
|
cells: e
|
|
5416
5423
|
}, u = {
|
|
@@ -5420,8 +5427,8 @@ class ji {
|
|
|
5420
5427
|
top: `${0.5}px`,
|
|
5421
5428
|
left: `${r - 0.5}px`,
|
|
5422
5429
|
overflow: "hidden",
|
|
5423
|
-
width: `${c - r -
|
|
5424
|
-
height: `${
|
|
5430
|
+
width: `${c - r - f}px`,
|
|
5431
|
+
height: `${d}px`
|
|
5425
5432
|
},
|
|
5426
5433
|
cells: t
|
|
5427
5434
|
}, g = {
|
|
@@ -5431,8 +5438,8 @@ class ji {
|
|
|
5431
5438
|
top: "0px",
|
|
5432
5439
|
right: "0px",
|
|
5433
5440
|
overflow: "hidden",
|
|
5434
|
-
width: `${
|
|
5435
|
-
height: `${
|
|
5441
|
+
width: `${f}px`,
|
|
5442
|
+
height: `${d}px`
|
|
5436
5443
|
},
|
|
5437
5444
|
cells: i
|
|
5438
5445
|
};
|
|
@@ -5443,7 +5450,7 @@ class ji {
|
|
|
5443
5450
|
position: "relative",
|
|
5444
5451
|
overflow: "hidden",
|
|
5445
5452
|
width: `${c}px`,
|
|
5446
|
-
height: `${
|
|
5453
|
+
height: `${d}px`
|
|
5447
5454
|
},
|
|
5448
5455
|
views: [x, u, g]
|
|
5449
5456
|
};
|
|
@@ -5459,7 +5466,7 @@ class ji {
|
|
|
5459
5466
|
fixedLeftWidth: s,
|
|
5460
5467
|
fixedRightWidth: r,
|
|
5461
5468
|
config: { SCROLLER_TRACK_SIZE: o, CSS_PREFIX: a }
|
|
5462
|
-
} = this.ctx, { visibleWidth: h, visibleHeight: c } = this.ctx.footer,
|
|
5469
|
+
} = this.ctx, { visibleWidth: h, visibleHeight: c } = this.ctx.footer, d = r - o, f = {
|
|
5463
5470
|
key: "left",
|
|
5464
5471
|
style: {
|
|
5465
5472
|
position: "absolute",
|
|
@@ -5477,7 +5484,7 @@ class ji {
|
|
|
5477
5484
|
top: `${0.5}px`,
|
|
5478
5485
|
left: `${s - 0.5}px`,
|
|
5479
5486
|
overflow: "hidden",
|
|
5480
|
-
width: `${h - s -
|
|
5487
|
+
width: `${h - s - d}px`,
|
|
5481
5488
|
height: `${c}px`
|
|
5482
5489
|
},
|
|
5483
5490
|
cells: t
|
|
@@ -5488,7 +5495,7 @@ class ji {
|
|
|
5488
5495
|
top: `${0.5}px`,
|
|
5489
5496
|
right: `${0.5}px`,
|
|
5490
5497
|
overflow: "hidden",
|
|
5491
|
-
width: `${
|
|
5498
|
+
width: `${d}px`,
|
|
5492
5499
|
height: `${c}px`
|
|
5493
5500
|
},
|
|
5494
5501
|
cells: i
|
|
@@ -5502,7 +5509,7 @@ class ji {
|
|
|
5502
5509
|
width: `${h}px`,
|
|
5503
5510
|
height: `${c}px`
|
|
5504
5511
|
},
|
|
5505
|
-
views: [
|
|
5512
|
+
views: [f, x, u]
|
|
5506
5513
|
};
|
|
5507
5514
|
}
|
|
5508
5515
|
}
|
|
@@ -5517,8 +5524,8 @@ class Ui {
|
|
|
5517
5524
|
this.ctx.on("cellContextMenuClick", (t, e) => {
|
|
5518
5525
|
if (!this.ctx.config.ENABLE_CONTEXT_MENU) return;
|
|
5519
5526
|
e.preventDefault();
|
|
5520
|
-
const { xArr: i, yArr: s } = this.ctx.selector, [r, o] = i, [a, h] = s, { rowIndex: c, colIndex:
|
|
5521
|
-
c >= a && c <= h &&
|
|
5527
|
+
const { xArr: i, yArr: s } = this.ctx.selector, [r, o] = i, [a, h] = s, { rowIndex: c, colIndex: d } = t;
|
|
5528
|
+
c >= a && c <= h && d >= r && d <= o || this.ctx.emit("setSelectorCell", t, e);
|
|
5522
5529
|
const x = {
|
|
5523
5530
|
getBoundingClientRect: () => ({
|
|
5524
5531
|
width: 0,
|
|
@@ -5625,15 +5632,15 @@ class Qi {
|
|
|
5625
5632
|
o.className = "e-virt-table-stage", a.className = "e-virt-table-canvas", h.className = "e-virt-table-overlayer";
|
|
5626
5633
|
const c = i || document.createElement("div");
|
|
5627
5634
|
c.className = "e-virt-table-editor";
|
|
5628
|
-
const
|
|
5635
|
+
const d = s, f = r;
|
|
5629
5636
|
return o.appendChild(a), o.appendChild(h), t.appendChild(o), {
|
|
5630
5637
|
containerElement: t,
|
|
5631
5638
|
stageElement: o,
|
|
5632
5639
|
canvasElement: a,
|
|
5633
5640
|
overlayerElement: h,
|
|
5634
5641
|
editorElement: c,
|
|
5635
|
-
emptyElement:
|
|
5636
|
-
contextMenuElement:
|
|
5642
|
+
emptyElement: d,
|
|
5643
|
+
contextMenuElement: f
|
|
5637
5644
|
};
|
|
5638
5645
|
}
|
|
5639
5646
|
draw(t = !1) {
|
|
@@ -5727,8 +5734,8 @@ class Qi {
|
|
|
5727
5734
|
let r = [];
|
|
5728
5735
|
for (let o = 0; o < i.length; o++)
|
|
5729
5736
|
for (let a = 0; a < s.length; a++) {
|
|
5730
|
-
const h = this.ctx.database.getRowKeyByItem(i[o]),
|
|
5731
|
-
Array.isArray(
|
|
5737
|
+
const h = this.ctx.database.getRowKeyByItem(i[o]), d = s[a].key, f = await this.ctx.database.getValidator(h, d);
|
|
5738
|
+
Array.isArray(f) && f.length && r.push(f);
|
|
5732
5739
|
}
|
|
5733
5740
|
r.length ? (e(r), this.ctx.emit("draw")) : (t([]), this.ctx.emit("draw"));
|
|
5734
5741
|
});
|