@visactor/vtable-calendar 1.22.11-alpha.1 → 1.22.11-alpha.2
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/vtable-calendar.js +191 -49
- package/dist/vtable-calendar.min.js +1 -1
- package/package.json +4 -4
package/dist/vtable-calendar.js
CHANGED
|
@@ -36992,6 +36992,24 @@
|
|
|
36992
36992
|
}
|
|
36993
36993
|
}
|
|
36994
36994
|
}
|
|
36995
|
+
changeFieldValueByRecordIndex(value, recordIndex, field, table) {
|
|
36996
|
+
var _a, _b, _c, _d;
|
|
36997
|
+
if (null === field) return;
|
|
36998
|
+
if (null == recordIndex) return;
|
|
36999
|
+
const rawKey = recordIndex.toString();
|
|
37000
|
+
if (!this.beforeChangedRecordsMap.has(rawKey)) {
|
|
37001
|
+
const rawRecords = Array.isArray(null === (_a = this.dataSourceObj) || void 0 === _a ? void 0 : _a.records) ? this.dataSourceObj.records : null,
|
|
37002
|
+
originRecord = rawRecords ? Array.isArray(recordIndex) ? getValueFromDeepArray(rawRecords, recordIndex) : rawRecords[recordIndex] : void 0;
|
|
37003
|
+
this.beforeChangedRecordsMap.set(rawKey, null !== (_b = cloneDeep(originRecord, void 0, ["vtable_gantt_linkedFrom", "vtable_gantt_linkedTo"])) && void 0 !== _b ? _b : {});
|
|
37004
|
+
}
|
|
37005
|
+
if ("string" == typeof field || "number" == typeof field) {
|
|
37006
|
+
const beforeChangedValue = null === (_c = this.beforeChangedRecordsMap.get(rawKey)) || void 0 === _c ? void 0 : _c[field],
|
|
37007
|
+
rawRecords = Array.isArray(null === (_d = this.dataSourceObj) || void 0 === _d ? void 0 : _d.records) ? this.dataSourceObj.records : null,
|
|
37008
|
+
record = rawRecords ? Array.isArray(recordIndex) ? getValueFromDeepArray(rawRecords, recordIndex) : rawRecords[recordIndex] : void 0;
|
|
37009
|
+
let formatValue = value;
|
|
37010
|
+
"number" == typeof beforeChangedValue && isAllDigits(value) && (formatValue = parseFloat(value)), record ? record[field] = formatValue : rawRecords && "number" == typeof recordIndex && (rawRecords[recordIndex] = "Array" === this.addRecordRule ? [] : {}, rawRecords[recordIndex][field] = formatValue);
|
|
37011
|
+
}
|
|
37012
|
+
}
|
|
36995
37013
|
cacheBeforeChangedRecord(dataIndex, table) {
|
|
36996
37014
|
var _a;
|
|
36997
37015
|
if (!this.beforeChangedRecordsMap.has(dataIndex.toString())) {
|
|
@@ -37057,9 +37075,16 @@
|
|
|
37057
37075
|
}
|
|
37058
37076
|
}
|
|
37059
37077
|
adjustBeforeChangedRecordsMap(insertIndex, insertCount, type = "add") {
|
|
37060
|
-
|
|
37061
|
-
|
|
37062
|
-
|
|
37078
|
+
const delta = "add" === type ? insertCount : -insertCount,
|
|
37079
|
+
numericKeys = [];
|
|
37080
|
+
this.beforeChangedRecordsMap.forEach((_, key) => {
|
|
37081
|
+
const numKey = Number(key);
|
|
37082
|
+
Number.isInteger(numKey) && numKey.toString() === key && numKey >= insertIndex && numericKeys.push(numKey);
|
|
37083
|
+
}), numericKeys.sort((a, b) => "add" === type ? b - a : a - b);
|
|
37084
|
+
for (let i = 0; i < numericKeys.length; i++) {
|
|
37085
|
+
const key = numericKeys[i],
|
|
37086
|
+
record = this.beforeChangedRecordsMap.get(key.toString());
|
|
37087
|
+
this.beforeChangedRecordsMap.delete(key.toString()), this.beforeChangedRecordsMap.set((key + delta).toString(), record);
|
|
37063
37088
|
}
|
|
37064
37089
|
}
|
|
37065
37090
|
deleteRecords(recordIndexs) {
|
|
@@ -53423,7 +53448,7 @@
|
|
|
53423
53448
|
};
|
|
53424
53449
|
class EventManager {
|
|
53425
53450
|
constructor(table) {
|
|
53426
|
-
this.isDown = !1, this.isDraging = !1, this.globalEventListeners = [], this._enableTableScroll = !0, this.cutWaitPaste = !1, this.clipboardCheckTimer = null, this.cutOperationTime = 0, this.lastClipboardContent = "", this.cutCellRange = null, this.copySourceRange = null, this.table = table, this.handleTextStickBindId = [], this.inertiaScroll = new InertiaScroll(table.stateManager), "node" === Env.mode || table.options.disableInteraction || (this.bindOuterEvent(), setTimeout(() => {
|
|
53451
|
+
this.isDown = !1, this.isDraging = !1, this.globalEventListeners = [], this._enableTableScroll = !0, this.cutWaitPaste = !1, this.clipboardCheckTimer = null, this.cutOperationTime = 0, this.lastClipboardContent = "", this.cutCellRange = null, this.cutRanges = null, this.copySourceRange = null, this.table = table, this.handleTextStickBindId = [], this.inertiaScroll = new InertiaScroll(table.stateManager), "node" === Env.mode || table.options.disableInteraction || (this.bindOuterEvent(), setTimeout(() => {
|
|
53427
53452
|
this.bindSelfEvent();
|
|
53428
53453
|
}, 0));
|
|
53429
53454
|
}
|
|
@@ -53725,15 +53750,25 @@
|
|
|
53725
53750
|
} catch (error) {}
|
|
53726
53751
|
}
|
|
53727
53752
|
handleCut(e) {
|
|
53753
|
+
var _a;
|
|
53728
53754
|
return __awaiter$1(this, void 0, void 0, function* () {
|
|
53729
|
-
this.handleCopy(e, !0), this.cutWaitPaste = !0, this.cutCellRange = this.table.getSelectedCellInfos(), this.
|
|
53730
|
-
|
|
53755
|
+
this.handleCopy(e, !0), this.cutWaitPaste = !0, this.cutCellRange = this.table.getSelectedCellInfos(), this.cutRanges = null === (_a = this.table.stateManager.select.ranges) || void 0 === _a ? void 0 : _a.map(r => ({
|
|
53756
|
+
start: {
|
|
53757
|
+
col: r.start.col,
|
|
53758
|
+
row: r.start.row
|
|
53759
|
+
},
|
|
53760
|
+
end: {
|
|
53761
|
+
col: r.end.col,
|
|
53762
|
+
row: r.end.row
|
|
53763
|
+
}
|
|
53764
|
+
})), this.clipboardCheckTimer && clearTimeout(this.clipboardCheckTimer), this.clipboardCheckTimer = window.setTimeout(() => {
|
|
53765
|
+
this.cutWaitPaste && (this.cutWaitPaste = !1, this.cutCellRange = null, this.cutRanges = null, this.clipboardCheckTimer = null);
|
|
53731
53766
|
}, 3e4), this.saveClipboardContent();
|
|
53732
53767
|
});
|
|
53733
53768
|
}
|
|
53734
53769
|
handlePaste(e) {
|
|
53735
53770
|
this.cutWaitPaste ? this.checkClipboardChanged().then(changed => {
|
|
53736
|
-
this.executePaste(e), changed || this.clearCutArea(this.table), this.cutWaitPaste && (this.cutWaitPaste = !1, this.cutCellRange = null, this.clipboardCheckTimer && (clearTimeout(this.clipboardCheckTimer), this.clipboardCheckTimer = null));
|
|
53771
|
+
this.executePaste(e), changed || this.clearCutArea(this.table), this.cutWaitPaste && (this.cutWaitPaste = !1, this.cutCellRange = null, this.cutRanges = null, this.clipboardCheckTimer && (clearTimeout(this.clipboardCheckTimer), this.clipboardCheckTimer = null));
|
|
53737
53772
|
}).catch(() => {
|
|
53738
53773
|
this.executePaste(e), this.cutWaitPaste && (this.cutWaitPaste = !1, this.cutCellRange = null, this.clipboardCheckTimer && (clearTimeout(this.clipboardCheckTimer), this.clipboardCheckTimer = null));
|
|
53739
53774
|
}) : this.executePaste(e);
|
|
@@ -53810,15 +53845,9 @@
|
|
|
53810
53845
|
}
|
|
53811
53846
|
clearCutArea(table) {
|
|
53812
53847
|
try {
|
|
53813
|
-
const
|
|
53814
|
-
if (!
|
|
53815
|
-
|
|
53816
|
-
for (let i = 0; i < selectCells.length; i++) for (let j = 0; j < selectCells[i].length; j++) selectCells[i][j] && changeValues.push({
|
|
53817
|
-
col: selectCells[i][j].col,
|
|
53818
|
-
row: selectCells[i][j].row,
|
|
53819
|
-
value: void 0
|
|
53820
|
-
});
|
|
53821
|
-
table.changeCellValuesByIds(changeValues);
|
|
53848
|
+
const ranges = this.cutRanges;
|
|
53849
|
+
if (!ranges || 0 === ranges.length) return;
|
|
53850
|
+
table.changeCellValuesByIds(ranges, "");
|
|
53822
53851
|
} catch (error) {}
|
|
53823
53852
|
}
|
|
53824
53853
|
checkClipboardChanged() {
|
|
@@ -56061,7 +56090,7 @@
|
|
|
56061
56090
|
}
|
|
56062
56091
|
constructor(container, options = {}) {
|
|
56063
56092
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z;
|
|
56064
|
-
if (super(), this.showFrozenIcon = !0, this.version = "1.22.11-alpha.
|
|
56093
|
+
if (super(), this.showFrozenIcon = !0, this.version = "1.22.11-alpha.2", this.id = `VTable${Date.now()}`, this.isReleased = !1, this._chartEventMap = {}, this.throttleInvalidate = throttle2(this.render.bind(this), 200), "node" === Env.mode ? (options = container, container = null) : container instanceof HTMLElement || (options = container, container = container.container ? container.container : null), !container && "node" !== options.mode && !options.canvas) throw new Error("vtable's container is undefined");
|
|
56065
56094
|
this.pluginManager = new PluginManager(this, options), this.fireListeners(TABLE_EVENT_TYPE.BEFORE_INIT, {
|
|
56066
56095
|
options: options,
|
|
56067
56096
|
container: container
|
|
@@ -59992,32 +60021,54 @@
|
|
|
59992
60021
|
return table.scenegraph.updateNextFrame(), changedCellResults;
|
|
59993
60022
|
});
|
|
59994
60023
|
}
|
|
59995
|
-
function listTableChangeCellValuesByIds(
|
|
60024
|
+
function listTableChangeCellValuesByIds(ranges, value, workOnEditableCell, triggerEvent, table, silentChangeCellValuesEvent) {
|
|
60025
|
+
var _a, _b;
|
|
59996
60026
|
return __awaiter(this, void 0, void 0, function* () {
|
|
59997
|
-
const resultChangeValues = []
|
|
59998
|
-
|
|
59999
|
-
|
|
60027
|
+
const resultChangeValues = [],
|
|
60028
|
+
processed = new Set(),
|
|
60029
|
+
nextValue = null != value ? value : "";
|
|
60030
|
+
for (let i = 0; i < (null !== (_a = null == ranges ? void 0 : ranges.length) && void 0 !== _a ? _a : 0); i++) {
|
|
60031
|
+
const range = ranges[i],
|
|
60032
|
+
startCol = Math.min(range.start.col, range.end.col),
|
|
60033
|
+
endCol = Math.max(range.start.col, range.end.col),
|
|
60034
|
+
startRow = Math.min(range.start.row, range.end.row),
|
|
60035
|
+
endRow = Math.max(range.start.row, range.end.row);
|
|
60036
|
+
if (startCol > endCol || startRow > endRow) continue;
|
|
60037
|
+
const values = [],
|
|
60038
|
+
oldValues = [];
|
|
60039
|
+
for (let row = startRow; row <= endRow; row++) {
|
|
60040
|
+
const rowValues = [],
|
|
60041
|
+
rowOldValues = [];
|
|
60042
|
+
for (let col = startCol; col <= endCol; col++) rowValues.push(nextValue), rowOldValues.push(table.getCellOriginValue(col, row));
|
|
60043
|
+
values.push(rowValues), oldValues.push(rowOldValues);
|
|
60044
|
+
}
|
|
60045
|
+
const changedCellResults = yield listTableChangeCellValues(startCol, startRow, values, workOnEditableCell, triggerEvent, table, !0);
|
|
60046
|
+
for (let r = 0; r < values.length; r++) for (let c = 0; c < values[r].length; c++) {
|
|
60047
|
+
const col = startCol + c,
|
|
60048
|
+
row = startRow + r,
|
|
60049
|
+
key = `${col},${row}`;
|
|
60050
|
+
if (processed.has(key)) continue;
|
|
60051
|
+
if (processed.add(key), !triggerEvent || !(null === (_b = null == changedCellResults ? void 0 : changedCellResults[r]) || void 0 === _b ? void 0 : _b[c])) continue;
|
|
60052
|
+
const oldValue = oldValues[r][c],
|
|
60053
|
+
changedValue = table.getCellOriginValue(col, row);
|
|
60054
|
+
if (oldValue === changedValue) continue;
|
|
60055
|
+
const recordShowIndex = table.getRecordShowIndexByCell(col, row),
|
|
60056
|
+
recordIndex = recordShowIndex >= 0 ? table.dataSource.getIndexKey(recordShowIndex) : void 0,
|
|
60057
|
+
{
|
|
60058
|
+
field: field
|
|
60059
|
+
} = table.internalProps.layoutMap.getBody(col, row);
|
|
60060
|
+
resultChangeValues.push({
|
|
60000
60061
|
col: col,
|
|
60001
60062
|
row: row,
|
|
60002
|
-
|
|
60003
|
-
|
|
60004
|
-
|
|
60005
|
-
|
|
60006
|
-
|
|
60007
|
-
|
|
60008
|
-
|
|
60009
|
-
oldValue = table.getCellOriginValue(col, row);
|
|
60010
|
-
listTableChangeCellValue(col, row, value, !1, triggerEvent, table, !0), oldValue !== value && triggerEvent && resultChangeValues.push({
|
|
60011
|
-
col: col,
|
|
60012
|
-
row: row,
|
|
60013
|
-
recordIndex: recordIndex,
|
|
60014
|
-
field: field,
|
|
60015
|
-
rawValue: oldValue,
|
|
60016
|
-
currentValue: oldValue,
|
|
60017
|
-
changedValue: value
|
|
60018
|
-
});
|
|
60063
|
+
recordIndex: recordIndex,
|
|
60064
|
+
field: field,
|
|
60065
|
+
rawValue: oldValue,
|
|
60066
|
+
currentValue: oldValue,
|
|
60067
|
+
changedValue: changedValue
|
|
60068
|
+
});
|
|
60069
|
+
}
|
|
60019
60070
|
}
|
|
60020
|
-
silentChangeCellValuesEvent
|
|
60071
|
+
!silentChangeCellValuesEvent && triggerEvent && table.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUES, {
|
|
60021
60072
|
values: resultChangeValues
|
|
60022
60073
|
});
|
|
60023
60074
|
});
|
|
@@ -61191,8 +61242,8 @@
|
|
|
61191
61242
|
changeCellValues(startCol, startRow, values, workOnEditableCell = !1, triggerEvent = !0, silentChangeCellValuesEvent) {
|
|
61192
61243
|
return listTableChangeCellValues(startCol, startRow, values, workOnEditableCell, triggerEvent, this, silentChangeCellValuesEvent);
|
|
61193
61244
|
}
|
|
61194
|
-
changeCellValuesByIds(
|
|
61195
|
-
return listTableChangeCellValuesByIds(
|
|
61245
|
+
changeCellValuesByIds(ranges, value, workOnEditableCell = !1, triggerEvent = !0, silentChangeCellValuesEvent) {
|
|
61246
|
+
return listTableChangeCellValuesByIds(ranges, value, workOnEditableCell, triggerEvent, this, silentChangeCellValuesEvent);
|
|
61196
61247
|
}
|
|
61197
61248
|
changeSourceCellValue(recordIndex, field, value) {
|
|
61198
61249
|
const tableIndex = this.getTableIndexByRecordIndex(recordIndex),
|
|
@@ -61217,25 +61268,116 @@
|
|
|
61217
61268
|
});
|
|
61218
61269
|
}
|
|
61219
61270
|
}
|
|
61220
|
-
|
|
61271
|
+
changeCellValueByRecord(recordIndex, field, value, options) {
|
|
61272
|
+
var _a, _b, _c, _d, _e;
|
|
61273
|
+
const triggerEvent = null === (_a = null == options ? void 0 : options.triggerEvent) || void 0 === _a || _a,
|
|
61274
|
+
silentChangeCellValuesEvent = null == options ? void 0 : options.silentChangeCellValuesEvent,
|
|
61275
|
+
autoRefresh = null === (_b = null == options ? void 0 : options.autoRefresh) || void 0 === _b || _b,
|
|
61276
|
+
records = null === (_c = this.dataSource.dataSourceObj) || void 0 === _c ? void 0 : _c.records;
|
|
61277
|
+
let record, oldValue;
|
|
61278
|
+
if (!Array.isArray(records) || "string" != typeof field && "number" != typeof field || (record = Array.isArray(recordIndex) ? getValueFromDeepArray(records, recordIndex) : records[recordIndex], oldValue = null == record ? void 0 : record[field]), this.dataSource.changeFieldValueByRecordIndex(value, recordIndex, field, this), !triggerEvent) return;
|
|
61279
|
+
const changedValue = !record || "string" != typeof field && "number" != typeof field ? value : null == record ? void 0 : record[field];
|
|
61280
|
+
if (oldValue !== changedValue) {
|
|
61281
|
+
const cellAddr = this.getCellAddrByFieldRecord(field, recordIndex),
|
|
61282
|
+
changeValue = {
|
|
61283
|
+
col: null !== (_d = null == cellAddr ? void 0 : cellAddr.col) && void 0 !== _d ? _d : -1,
|
|
61284
|
+
row: null !== (_e = null == cellAddr ? void 0 : cellAddr.row) && void 0 !== _e ? _e : -1,
|
|
61285
|
+
recordIndex: recordIndex,
|
|
61286
|
+
field: field,
|
|
61287
|
+
rawValue: oldValue,
|
|
61288
|
+
currentValue: oldValue,
|
|
61289
|
+
changedValue: changedValue
|
|
61290
|
+
};
|
|
61291
|
+
this.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUE, changeValue), silentChangeCellValuesEvent || this.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUES, {
|
|
61292
|
+
values: [changeValue]
|
|
61293
|
+
});
|
|
61294
|
+
}
|
|
61295
|
+
autoRefresh && this.refreshAfterSourceChange();
|
|
61296
|
+
}
|
|
61297
|
+
changeCellValueBySource(recordIndex, field, value, triggerEvent = !0, silentChangeCellValuesEvent) {
|
|
61298
|
+
return this.changeCellValueByRecord(recordIndex, field, value, {
|
|
61299
|
+
triggerEvent: triggerEvent,
|
|
61300
|
+
silentChangeCellValuesEvent: silentChangeCellValuesEvent,
|
|
61301
|
+
autoRefresh: !0
|
|
61302
|
+
});
|
|
61303
|
+
}
|
|
61304
|
+
changeCellValuesByRecords(changeValues, options) {
|
|
61305
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
61306
|
+
const triggerEvent = null === (_a = null == options ? void 0 : options.triggerEvent) || void 0 === _a || _a,
|
|
61307
|
+
silentChangeCellValuesEvent = null == options ? void 0 : options.silentChangeCellValuesEvent,
|
|
61308
|
+
autoRefresh = null === (_b = null == options ? void 0 : options.autoRefresh) || void 0 === _b || _b,
|
|
61309
|
+
resultChangeValues = [];
|
|
61310
|
+
for (let i = 0; i < changeValues.length; i++) {
|
|
61311
|
+
const {
|
|
61312
|
+
recordIndex: recordIndex,
|
|
61313
|
+
field: field,
|
|
61314
|
+
value: value
|
|
61315
|
+
} = changeValues[i],
|
|
61316
|
+
records = null === (_c = this.dataSource.dataSourceObj) || void 0 === _c ? void 0 : _c.records;
|
|
61317
|
+
let record, oldValue;
|
|
61318
|
+
if (!Array.isArray(records) || "string" != typeof field && "number" != typeof field || (record = Array.isArray(recordIndex) ? getValueFromDeepArray(records, recordIndex) : records[recordIndex], oldValue = null == record ? void 0 : record[field]), this.dataSource.changeFieldValueByRecordIndex(value, recordIndex, field, this), triggerEvent) {
|
|
61319
|
+
const changedValue = !record || "string" != typeof field && "number" != typeof field ? value : null == record ? void 0 : record[field];
|
|
61320
|
+
if (oldValue !== changedValue) {
|
|
61321
|
+
const changeValue = {
|
|
61322
|
+
col: null !== (_e = null === (_d = this.getCellAddrByFieldRecord(field, recordIndex)) || void 0 === _d ? void 0 : _d.col) && void 0 !== _e ? _e : -1,
|
|
61323
|
+
row: null !== (_g = null === (_f = this.getCellAddrByFieldRecord(field, recordIndex)) || void 0 === _f ? void 0 : _f.row) && void 0 !== _g ? _g : -1,
|
|
61324
|
+
recordIndex: recordIndex,
|
|
61325
|
+
field: field,
|
|
61326
|
+
rawValue: oldValue,
|
|
61327
|
+
currentValue: oldValue,
|
|
61328
|
+
changedValue: changedValue
|
|
61329
|
+
};
|
|
61330
|
+
this.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUE, changeValue), resultChangeValues.push(changeValue);
|
|
61331
|
+
}
|
|
61332
|
+
}
|
|
61333
|
+
}
|
|
61334
|
+
!silentChangeCellValuesEvent && resultChangeValues.length && triggerEvent && this.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUES, {
|
|
61335
|
+
values: resultChangeValues
|
|
61336
|
+
}), autoRefresh && this.refreshAfterSourceChange();
|
|
61337
|
+
}
|
|
61338
|
+
changeCellValuesBySource(changeValues, triggerEvent = !0, silentChangeCellValuesEvent) {
|
|
61339
|
+
return this.changeCellValuesByRecords(changeValues, {
|
|
61340
|
+
triggerEvent: triggerEvent,
|
|
61341
|
+
silentChangeCellValuesEvent: silentChangeCellValuesEvent,
|
|
61342
|
+
autoRefresh: !0
|
|
61343
|
+
});
|
|
61344
|
+
}
|
|
61345
|
+
refreshAfterSourceChange(options) {
|
|
61346
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
61347
|
+
const reapplyFilter = null === (_a = null == options ? void 0 : options.reapplyFilter) || void 0 === _a || _a,
|
|
61348
|
+
reapplySort = null === (_b = null == options ? void 0 : options.reapplySort) || void 0 === _b || _b,
|
|
61349
|
+
clearRowHeightCache = null === (_c = null == options ? void 0 : options.clearRowHeightCache) || void 0 === _c || _c;
|
|
61350
|
+
this.scenegraph.clearCells(), this.sortState && reapplySort && (null === (_e = (_d = this.dataSource).clearSortedIndexMap) || void 0 === _e || _e.call(_d), null === (_g = null === (_f = this.dataSource.sortedIndexMap) || void 0 === _f ? void 0 : _f.clear) || void 0 === _g || _g.call(_f)), reapplyFilter ? this.sortState && reapplySort ? (this.dataSource.updateFilterRulesForSorted(null === (_h = this.dataSource.dataConfig) || void 0 === _h ? void 0 : _h.filterRules), sortRecords(this)) : this.dataSource.updateFilterRules(null === (_j = this.dataSource.dataConfig) || void 0 === _j ? void 0 : _j.filterRules) : this.sortState && reapplySort && sortRecords(this);
|
|
61351
|
+
const traverseColumns = columns => {
|
|
61352
|
+
var _a, _b, _c, _d;
|
|
61353
|
+
for (let i = 0; i < (null !== (_a = null == columns ? void 0 : columns.length) && void 0 !== _a ? _a : 0); i++) {
|
|
61354
|
+
const column = columns[i],
|
|
61355
|
+
aggregators = null == column ? void 0 : column.vtable_aggregator;
|
|
61356
|
+
if (aggregators) if (Array.isArray(aggregators)) for (let j = 0; j < aggregators.length; j++) null === (_c = null === (_b = aggregators[j]) || void 0 === _b ? void 0 : _b.recalculate) || void 0 === _c || _c.call(_b);else null === (_d = null == aggregators ? void 0 : aggregators.recalculate) || void 0 === _d || _d.call(aggregators);
|
|
61357
|
+
(null == column ? void 0 : column.columns) && traverseColumns(column.columns);
|
|
61358
|
+
}
|
|
61359
|
+
};
|
|
61360
|
+
traverseColumns(this.internalProps.columns), this.refreshRowColCount(), this.internalProps.layoutMap.clearCellRangeMap(), this.internalProps.useOneRowHeightFillAll = !1, this.stateManager.initCheckedState(this.records), this.scenegraph.createSceneGraph(!clearRowHeightCache), null === (_k = this.internalProps.emptyTip) || void 0 === _k || _k.resetVisible(), this.resize();
|
|
61361
|
+
}
|
|
61362
|
+
addRecord(record, recordIndex, triggerEvent = !0) {
|
|
61221
61363
|
var _a;
|
|
61222
61364
|
const success = listTableAddRecord(record, recordIndex, this);
|
|
61223
|
-
adjustHeightResizedRowMapWithAddRecordIndex(this, recordIndex, [record]), null === (_a = this.internalProps.emptyTip) || void 0 === _a || _a.resetVisible(), success && this.fireListeners(TABLE_EVENT_TYPE.ADD_RECORD, {
|
|
61365
|
+
adjustHeightResizedRowMapWithAddRecordIndex(this, recordIndex, [record]), null === (_a = this.internalProps.emptyTip) || void 0 === _a || _a.resetVisible(), triggerEvent && success && this.fireListeners(TABLE_EVENT_TYPE.ADD_RECORD, {
|
|
61224
61366
|
records: [record],
|
|
61225
61367
|
recordIndex: recordIndex,
|
|
61226
61368
|
recordCount: 1
|
|
61227
61369
|
});
|
|
61228
61370
|
}
|
|
61229
|
-
addRecords(records, recordIndex) {
|
|
61371
|
+
addRecords(records, recordIndex, triggerEvent = !0) {
|
|
61230
61372
|
var _a;
|
|
61231
61373
|
const success = listTableAddRecords(records, recordIndex, this);
|
|
61232
|
-
"number" == typeof recordIndex && adjustHeightResizedRowMapWithAddRecordIndex(this, recordIndex, records), null === (_a = this.internalProps.emptyTip) || void 0 === _a || _a.resetVisible(), success && this.fireListeners(TABLE_EVENT_TYPE.ADD_RECORD, {
|
|
61374
|
+
"number" == typeof recordIndex && adjustHeightResizedRowMapWithAddRecordIndex(this, recordIndex, records), null === (_a = this.internalProps.emptyTip) || void 0 === _a || _a.resetVisible(), triggerEvent && success && this.fireListeners(TABLE_EVENT_TYPE.ADD_RECORD, {
|
|
61233
61375
|
records: records,
|
|
61234
61376
|
recordIndex: recordIndex,
|
|
61235
61377
|
recordCount: records.length
|
|
61236
61378
|
});
|
|
61237
61379
|
}
|
|
61238
|
-
deleteRecords(recordIndexs) {
|
|
61380
|
+
deleteRecords(recordIndexs, triggerEvent = !0) {
|
|
61239
61381
|
var _a;
|
|
61240
61382
|
const deletedRecords = [];
|
|
61241
61383
|
(null == recordIndexs ? void 0 : recordIndexs.length) > 0 && recordIndexs.forEach(index => {
|
|
@@ -61244,15 +61386,15 @@
|
|
|
61244
61386
|
}), listTableDeleteRecords(recordIndexs, this), adjustHeightResizedRowMapWithDeleteRecordIndex(this, recordIndexs), null === (_a = this.internalProps.emptyTip) || void 0 === _a || _a.resetVisible();
|
|
61245
61387
|
const rowIndexs = [];
|
|
61246
61388
|
for (let i = 0; i < recordIndexs.length; i++) rowIndexs.push(this.getBodyRowIndexByRecordIndex(recordIndexs[i]) + this.columnHeaderLevelCount);
|
|
61247
|
-
this.fireListeners(TABLE_EVENT_TYPE.DELETE_RECORD, {
|
|
61389
|
+
triggerEvent && this.fireListeners(TABLE_EVENT_TYPE.DELETE_RECORD, {
|
|
61248
61390
|
recordIndexs: recordIndexs,
|
|
61249
61391
|
records: deletedRecords,
|
|
61250
61392
|
rowIndexs: rowIndexs,
|
|
61251
61393
|
deletedCount: (Array.isArray(recordIndexs[0]), recordIndexs.length)
|
|
61252
61394
|
});
|
|
61253
61395
|
}
|
|
61254
|
-
updateRecords(records, recordIndexs) {
|
|
61255
|
-
listTableUpdateRecords(records, recordIndexs, this), this.fireListeners(TABLE_EVENT_TYPE.UPDATE_RECORD, {
|
|
61396
|
+
updateRecords(records, recordIndexs, triggerEvent = !0) {
|
|
61397
|
+
listTableUpdateRecords(records, recordIndexs, this), triggerEvent && this.fireListeners(TABLE_EVENT_TYPE.UPDATE_RECORD, {
|
|
61256
61398
|
records: records,
|
|
61257
61399
|
recordIndexs: recordIndexs,
|
|
61258
61400
|
updateCount: records.length
|