e-virt-table 0.1.9 → 0.1.11
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 +28 -22
- 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 +15 -13
- package/dist/lib/Database.js.map +1 -1
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -790,7 +790,7 @@ class ii {
|
|
|
790
790
|
t.forEach((i, s) => {
|
|
791
791
|
let r = !1;
|
|
792
792
|
Array.isArray(i.children) && (r = !0, this.initData(i.children, e + 1));
|
|
793
|
-
const { ROW_KEY: o = "", DEFAULT_EXPAND_ALL: a, CELL_HEIGHT: l, SELECTABLE_METHOD: c, CHECKBOX_KEY: f } = this.ctx.config, d = i[o], x = d
|
|
793
|
+
const { ROW_KEY: o = "", DEFAULT_EXPAND_ALL: a, CELL_HEIGHT: l, SELECTABLE_METHOD: c, CHECKBOX_KEY: f } = this.ctx.config, d = i[o], x = d != null ? `${d}` : Ut();
|
|
794
794
|
this.itemRowKeyMap.set(i, x);
|
|
795
795
|
const u = i._height || l, g = i._readonly;
|
|
796
796
|
let w = !0;
|
|
@@ -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
|
};
|
|
@@ -1118,7 +1124,7 @@ class ii {
|
|
|
1118
1124
|
* @returns
|
|
1119
1125
|
*/
|
|
1120
1126
|
getRowDataItemForRowKey(t) {
|
|
1121
|
-
if (!this.rowKeyMap.has(t))
|
|
1127
|
+
if (console.log(typeof t), !this.rowKeyMap.has(t))
|
|
1122
1128
|
return {};
|
|
1123
1129
|
const { item: e } = this.rowKeyMap.get(t);
|
|
1124
1130
|
return e;
|
|
@@ -1256,7 +1262,7 @@ class ii {
|
|
|
1256
1262
|
rowKey: r,
|
|
1257
1263
|
colKey: o,
|
|
1258
1264
|
originalValue: s,
|
|
1259
|
-
row: this.
|
|
1265
|
+
row: this.ctx.database.getRowDataItemForRowKey(r),
|
|
1260
1266
|
value: e
|
|
1261
1267
|
});
|
|
1262
1268
|
}), t;
|
|
@@ -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,
|