e-virt-table 0.1.9 → 0.1.10
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 +1 -1
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +25 -19
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +1 -1
- package/dist/index.umd.js.map +1 -1
- package/dist/lib/Database.js +12 -11
- package/dist/lib/Database.js.map +1 -1
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -1013,28 +1013,32 @@ class ii {
|
|
|
1013
1013
|
batchSetItemValue(t, e = !1) {
|
|
1014
1014
|
let i = [];
|
|
1015
1015
|
const s = /* @__PURE__ */ new Set();
|
|
1016
|
-
t.forEach((
|
|
1017
|
-
const { value:
|
|
1018
|
-
s.add(
|
|
1019
|
-
rowKey:
|
|
1020
|
-
key:
|
|
1021
|
-
oldValue:
|
|
1022
|
-
newValue:
|
|
1016
|
+
t.forEach((l) => {
|
|
1017
|
+
const { value: c, rowKey: f, key: d } = l, { oldValue: x, newValue: u } = this.setItemValue(f, d, c);
|
|
1018
|
+
s.add(f), i.push({
|
|
1019
|
+
rowKey: f,
|
|
1020
|
+
key: d,
|
|
1021
|
+
oldValue: x,
|
|
1022
|
+
newValue: u
|
|
1023
1023
|
});
|
|
1024
1024
|
});
|
|
1025
1025
|
let r = [];
|
|
1026
|
-
const o = i.map((
|
|
1027
|
-
const
|
|
1026
|
+
const o = i.map((l) => {
|
|
1027
|
+
const c = this.ctx.database.getRowDataItemForRowKey(l.rowKey);
|
|
1028
1028
|
return {
|
|
1029
|
-
rowKey:
|
|
1030
|
-
key:
|
|
1031
|
-
value:
|
|
1032
|
-
row:
|
|
1029
|
+
rowKey: l.rowKey,
|
|
1030
|
+
key: l.key,
|
|
1031
|
+
value: l.newValue,
|
|
1032
|
+
row: c
|
|
1033
1033
|
};
|
|
1034
1034
|
});
|
|
1035
|
-
|
|
1036
|
-
r.push(this.ctx.database.getRowDataItemForRowKey(
|
|
1037
|
-
})
|
|
1035
|
+
s.forEach((l) => {
|
|
1036
|
+
r.push(this.ctx.database.getRowDataItemForRowKey(l));
|
|
1037
|
+
});
|
|
1038
|
+
const a = o.map(({ rowKey: l, key: c }) => this.getValidator(l, c));
|
|
1039
|
+
return Promise.all(a).then(() => {
|
|
1040
|
+
this.validationErrorMap.size === 0 && this.changedDataMap.size > 0 && this.ctx.emit("validateChangedData", this.getChangedData());
|
|
1041
|
+
}), this.ctx.emit("change", o, r), e && this.ctx.history.pushState({
|
|
1038
1042
|
changeList: i,
|
|
1039
1043
|
scrollX: this.ctx.scrollX,
|
|
1040
1044
|
scrollY: this.ctx.scrollY,
|
|
@@ -1079,7 +1083,9 @@ class ii {
|
|
|
1079
1083
|
value: x,
|
|
1080
1084
|
row: u
|
|
1081
1085
|
};
|
|
1082
|
-
this.
|
|
1086
|
+
this.getValidator(t, e).then(() => {
|
|
1087
|
+
this.validationErrorMap.size === 0 && this.changedDataMap.size > 0 && this.ctx.emit("validateChangedData", this.getChangedData());
|
|
1088
|
+
}), this.ctx.emit("change", [g], [u]), this.ctx.emit("editChange", {
|
|
1083
1089
|
rowKey: t,
|
|
1084
1090
|
key: e,
|
|
1085
1091
|
oldValue: l,
|
|
@@ -1107,7 +1113,7 @@ class ii {
|
|
|
1107
1113
|
newValue: x
|
|
1108
1114
|
}
|
|
1109
1115
|
]
|
|
1110
|
-
}),
|
|
1116
|
+
}), r && this.ctx.emit("draw"), {
|
|
1111
1117
|
oldValue: l,
|
|
1112
1118
|
newValue: x
|
|
1113
1119
|
};
|
|
@@ -1350,7 +1356,7 @@ class ii {
|
|
|
1350
1356
|
colIndex: r.colIndex
|
|
1351
1357
|
};
|
|
1352
1358
|
new nt(c).validate(f).then(() => {
|
|
1353
|
-
this.clearValidationError(t, e), i([])
|
|
1359
|
+
this.clearValidationError(t, e), i([]);
|
|
1354
1360
|
}).catch(({ errors: x }) => {
|
|
1355
1361
|
const u = x.map((g) => ({
|
|
1356
1362
|
...g,
|