@visactor/vtable-gantt 1.22.11-alpha.9 → 1.22.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/cjs/event/EventTarget.js +2 -1
- package/cjs/event/touch.js +0 -1
- package/cjs/index.d.ts +1 -1
- package/cjs/index.js +1 -1
- package/cjs/index.js.map +1 -1
- package/cjs/tools/util.js +2 -1
- package/cjs/tools/util.js.map +1 -1
- package/dist/vtable-gantt.js +232 -499
- package/dist/vtable-gantt.min.js +2 -2
- package/es/event/EventTarget.js +2 -1
- package/es/event/touch.js +1 -2
- package/es/index.d.ts +1 -1
- package/es/index.js +1 -1
- package/es/index.js.map +1 -1
- package/es/tools/util.js +2 -1
- package/es/tools/util.js.map +1 -1
- package/package.json +4 -4
package/dist/vtable-gantt.js
CHANGED
|
@@ -35301,12 +35301,12 @@
|
|
|
35301
35301
|
difference = (adjusted_date.getTime() - startDate.getTime()) / msInWeek;
|
|
35302
35302
|
break;
|
|
35303
35303
|
case 'month':
|
|
35304
|
+
const startDaysInMonth = new Date(startDate.getFullYear(), startDate.getMonth() + 1, 0).getDate();
|
|
35305
|
+
const adjustedDaysInMonth = new Date(adjusted_date.getFullYear(), adjusted_date.getMonth() + 1, 0).getDate();
|
|
35304
35306
|
difference =
|
|
35305
35307
|
(adjusted_date.getFullYear() - startDate.getFullYear()) * 12 +
|
|
35306
35308
|
(adjusted_date.getMonth() - startDate.getMonth());
|
|
35307
|
-
difference +=
|
|
35308
|
-
(adjusted_date.getDate() - startDate.getDate()) /
|
|
35309
|
-
new Date(adjusted_date.getFullYear(), adjusted_date.getMonth() + 1, 0).getDate();
|
|
35309
|
+
difference += adjusted_date.getDate() / adjustedDaysInMonth - startDate.getDate() / startDaysInMonth;
|
|
35310
35310
|
break;
|
|
35311
35311
|
case 'quarter':
|
|
35312
35312
|
difference =
|
|
@@ -38718,7 +38718,6 @@
|
|
|
38718
38718
|
AFTER_UPDATE_CELL_CONTENT_WIDTH: "after_update_cell_content_width",
|
|
38719
38719
|
AFTER_UPDATE_SELECT_BORDER_HEIGHT: "after_update_select_border_height",
|
|
38720
38720
|
CHANGE_CELL_VALUE: "change_cell_value",
|
|
38721
|
-
CHANGE_CELL_VALUES: "change_cell_values",
|
|
38722
38721
|
DRAG_FILL_HANDLE_END: "drag_fill_handle_end",
|
|
38723
38722
|
MOUSEDOWN_FILL_HANDLE: "mousedown_fill_handle",
|
|
38724
38723
|
DBLCLICK_FILL_HANDLE: "dblclick_fill_handle",
|
|
@@ -40851,24 +40850,6 @@
|
|
|
40851
40850
|
}
|
|
40852
40851
|
}
|
|
40853
40852
|
}
|
|
40854
|
-
changeFieldValueByRecordIndex(value, recordIndex, field, table) {
|
|
40855
|
-
var _a, _b, _c, _d;
|
|
40856
|
-
if (null === field) return;
|
|
40857
|
-
if (null == recordIndex) return;
|
|
40858
|
-
const rawKey = recordIndex.toString();
|
|
40859
|
-
if (!this.beforeChangedRecordsMap.has(rawKey)) {
|
|
40860
|
-
const rawRecords = Array.isArray(null === (_a = this.dataSourceObj) || void 0 === _a ? void 0 : _a.records) ? this.dataSourceObj.records : null,
|
|
40861
|
-
originRecord = rawRecords ? Array.isArray(recordIndex) ? getValueFromDeepArray(rawRecords, recordIndex) : rawRecords[recordIndex] : void 0;
|
|
40862
|
-
this.beforeChangedRecordsMap.set(rawKey, null !== (_b = cloneDeep(originRecord, void 0, ["vtable_gantt_linkedFrom", "vtable_gantt_linkedTo"])) && void 0 !== _b ? _b : {});
|
|
40863
|
-
}
|
|
40864
|
-
if ("string" == typeof field || "number" == typeof field) {
|
|
40865
|
-
const beforeChangedValue = null === (_c = this.beforeChangedRecordsMap.get(rawKey)) || void 0 === _c ? void 0 : _c[field],
|
|
40866
|
-
rawRecords = Array.isArray(null === (_d = this.dataSourceObj) || void 0 === _d ? void 0 : _d.records) ? this.dataSourceObj.records : null,
|
|
40867
|
-
record = rawRecords ? Array.isArray(recordIndex) ? getValueFromDeepArray(rawRecords, recordIndex) : rawRecords[recordIndex] : void 0;
|
|
40868
|
-
let formatValue = value;
|
|
40869
|
-
"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);
|
|
40870
|
-
}
|
|
40871
|
-
}
|
|
40872
40853
|
cacheBeforeChangedRecord(dataIndex, table) {
|
|
40873
40854
|
var _a;
|
|
40874
40855
|
if (!this.beforeChangedRecordsMap.has(dataIndex.toString())) {
|
|
@@ -40884,92 +40865,41 @@
|
|
|
40884
40865
|
Array.isArray(indexed) || this.records.splice(indexed, 1, record);
|
|
40885
40866
|
}
|
|
40886
40867
|
}
|
|
40887
|
-
|
|
40868
|
+
addRecord(record, index) {
|
|
40888
40869
|
var _a;
|
|
40889
|
-
|
|
40890
|
-
|
|
40891
|
-
|
|
40892
|
-
|
|
40893
|
-
|
|
40894
|
-
|
|
40895
|
-
|
|
40896
|
-
|
|
40897
|
-
|
|
40898
|
-
|
|
40899
|
-
|
|
40900
|
-
|
|
40901
|
-
if (viewIndex <= 0) {
|
|
40902
|
-
const firstVisibleRecord = this.records[0],
|
|
40903
|
-
rawIndex = rawRecords.indexOf(firstVisibleRecord);
|
|
40904
|
-
return rawIndex >= 0 ? rawIndex : 0;
|
|
40905
|
-
}
|
|
40906
|
-
if (viewIndex >= this.records.length) {
|
|
40907
|
-
const lastVisibleRecord = this.records[this.records.length - 1],
|
|
40908
|
-
rawIndex = rawRecords.indexOf(lastVisibleRecord);
|
|
40909
|
-
return rawIndex >= 0 ? rawIndex + 1 : rawRecords.length;
|
|
40910
|
-
}
|
|
40911
|
-
const prevRecord = this.records[viewIndex - 1],
|
|
40912
|
-
rawIndex = rawRecords.indexOf(prevRecord);
|
|
40913
|
-
return rawIndex >= 0 ? rawIndex + 1 : rawRecords.length;
|
|
40914
|
-
}
|
|
40915
|
-
_resetIndexingFromViewRecords() {
|
|
40916
|
-
if (this._sourceLength = this.records.length, this.currentIndexedData = Array.from({
|
|
40917
|
-
length: this._sourceLength
|
|
40918
|
-
}, (_, i) => i), "tree" === this.rowHierarchyType && this.initTreeHierarchyState(), this.userPagination) return this.pagination.totalCount = this._sourceLength, void this.updatePagerData();
|
|
40919
|
-
this.pagination.perPageCount = this._sourceLength, this.pagination.totalCount = this._sourceLength, this.updatePagerData();
|
|
40920
|
-
}
|
|
40921
|
-
addRecord(record, index, syncToOriginalRecords = !1) {
|
|
40922
|
-
var _a, _b, _c;
|
|
40923
|
-
if (!syncToOriginalRecords) {
|
|
40924
|
-
if (Array.isArray(this.records)) {
|
|
40925
|
-
this.records.splice(index, 0, record), this.adjustBeforeChangedRecordsMap(index, 1), this.currentIndexedData.push(this.currentIndexedData.length), this._sourceLength += 1;
|
|
40926
|
-
for (let i = 0; i < this.fieldAggregators.length; i++) this.fieldAggregators[i].push(record);
|
|
40927
|
-
if ("tree" === this.rowHierarchyType && this.initTreeHierarchyState(), this.userPagination) {
|
|
40928
|
-
this.pagination.totalCount = this._sourceLength;
|
|
40929
|
-
const {
|
|
40930
|
-
perPageCount: perPageCount,
|
|
40931
|
-
currentPage: currentPage
|
|
40932
|
-
} = this.pagination;
|
|
40933
|
-
index < perPageCount * (currentPage || 0) + perPageCount && this.updatePagerData();
|
|
40934
|
-
} else this.pagination.perPageCount = this._sourceLength, this.pagination.totalCount = this._sourceLength, this.updatePagerData();
|
|
40935
|
-
(null === (_a = this.dataSourceObj) || void 0 === _a ? void 0 : _a.added) && this.dataSourceObj.added(index, 1);
|
|
40936
|
-
}
|
|
40937
|
-
return;
|
|
40870
|
+
if (Array.isArray(this.records)) {
|
|
40871
|
+
this.records.splice(index, 0, record), this.adjustBeforeChangedRecordsMap(index, 1), this.currentIndexedData.push(this.currentIndexedData.length), this._sourceLength += 1;
|
|
40872
|
+
for (let i = 0; i < this.fieldAggregators.length; i++) this.fieldAggregators[i].push(record);
|
|
40873
|
+
if ("tree" === this.rowHierarchyType && this.initTreeHierarchyState(), this.userPagination) {
|
|
40874
|
+
this.pagination.totalCount = this._sourceLength;
|
|
40875
|
+
const {
|
|
40876
|
+
perPageCount: perPageCount,
|
|
40877
|
+
currentPage: currentPage
|
|
40878
|
+
} = this.pagination;
|
|
40879
|
+
index < perPageCount * (currentPage || 0) + perPageCount && this.updatePagerData();
|
|
40880
|
+
} else this.pagination.perPageCount = this._sourceLength, this.pagination.totalCount = this._sourceLength, this.updatePagerData();
|
|
40881
|
+
(null === (_a = this.dataSourceObj) || void 0 === _a ? void 0 : _a.added) && this.dataSourceObj.added(index, 1);
|
|
40938
40882
|
}
|
|
40939
|
-
const rawRecords = this._getRawRecordsArray();
|
|
40940
|
-
if (!rawRecords) return;
|
|
40941
|
-
const viewInsertIndex = this._normalizeInsertIndex(index, this.records.length),
|
|
40942
|
-
rawInsertIndex = this._hasFilterInEffect() ? this._mapViewInsertIndexToRawInsertIndex(rawRecords, viewInsertIndex) : this._normalizeInsertIndex(viewInsertIndex, rawRecords.length);
|
|
40943
|
-
rawRecords.splice(rawInsertIndex, 0, record), syncToOriginalRecords && this._hasFilterInEffect() && this.markForceVisibleRecord(record), this.beforeChangedRecordsMap.clear(), this.sortedIndexMap.clear(), this.updateFilterRules(null === (_b = this.dataConfig) || void 0 === _b ? void 0 : _b.filterRules), (null === (_c = this.dataSourceObj) || void 0 === _c ? void 0 : _c.added) && this.dataSourceObj.added(rawInsertIndex, 1);
|
|
40944
40883
|
}
|
|
40945
|
-
addRecords(recordArr, index
|
|
40946
|
-
var _a
|
|
40947
|
-
if (
|
|
40948
|
-
if (Array.isArray(
|
|
40949
|
-
|
|
40950
|
-
|
|
40951
|
-
|
|
40952
|
-
|
|
40953
|
-
for (let i = 0; i < this.fieldAggregators.length; i++) for (let j = 0; j < recordArr.length; j++) this.fieldAggregators[i].push(recordArr[j]);
|
|
40954
|
-
}
|
|
40955
|
-
if (this.userPagination) {
|
|
40956
|
-
this.pagination.totalCount = this._sourceLength;
|
|
40957
|
-
const {
|
|
40958
|
-
perPageCount: perPageCount,
|
|
40959
|
-
currentPage: currentPage
|
|
40960
|
-
} = this.pagination;
|
|
40961
|
-
index < perPageCount * (currentPage || 0) + perPageCount && this.updatePagerData();
|
|
40962
|
-
} else this.pagination.perPageCount = this._sourceLength, this.pagination.totalCount = this._sourceLength, this.updatePagerData();
|
|
40963
|
-
(null === (_a = this.dataSourceObj) || void 0 === _a ? void 0 : _a.added) && this.dataSourceObj.added(index, recordArr.length);
|
|
40884
|
+
addRecords(recordArr, index) {
|
|
40885
|
+
var _a;
|
|
40886
|
+
if (Array.isArray(this.records)) {
|
|
40887
|
+
if (Array.isArray(recordArr)) {
|
|
40888
|
+
this.records.splice(index, 0, ...recordArr), this.adjustBeforeChangedRecordsMap(index, recordArr.length);
|
|
40889
|
+
for (let i = 0; i < recordArr.length; i++) this.currentIndexedData.push(this.currentIndexedData.length);
|
|
40890
|
+
this._sourceLength += recordArr.length;
|
|
40891
|
+
for (let i = 0; i < this.fieldAggregators.length; i++) for (let j = 0; j < recordArr.length; j++) this.fieldAggregators[i].push(recordArr[j]);
|
|
40964
40892
|
}
|
|
40965
|
-
|
|
40893
|
+
if (this.userPagination) {
|
|
40894
|
+
this.pagination.totalCount = this._sourceLength;
|
|
40895
|
+
const {
|
|
40896
|
+
perPageCount: perPageCount,
|
|
40897
|
+
currentPage: currentPage
|
|
40898
|
+
} = this.pagination;
|
|
40899
|
+
index < perPageCount * (currentPage || 0) + perPageCount && this.updatePagerData();
|
|
40900
|
+
} else this.pagination.perPageCount = this._sourceLength, this.pagination.totalCount = this._sourceLength, this.updatePagerData();
|
|
40901
|
+
(null === (_a = this.dataSourceObj) || void 0 === _a ? void 0 : _a.added) && this.dataSourceObj.added(index, recordArr.length);
|
|
40966
40902
|
}
|
|
40967
|
-
const rawRecords = this._getRawRecordsArray();
|
|
40968
|
-
if (!rawRecords || !Array.isArray(recordArr) || 0 === recordArr.length) return;
|
|
40969
|
-
const viewInsertIndex = this._normalizeInsertIndex(index, this.records.length),
|
|
40970
|
-
rawInsertIndex = this._hasFilterInEffect() ? this._mapViewInsertIndexToRawInsertIndex(rawRecords, viewInsertIndex) : this._normalizeInsertIndex(viewInsertIndex, rawRecords.length);
|
|
40971
|
-
if (rawRecords.splice(rawInsertIndex, 0, ...recordArr), syncToOriginalRecords && this._hasFilterInEffect()) for (let i = 0; i < recordArr.length; i++) this.markForceVisibleRecord(recordArr[i]);
|
|
40972
|
-
this.beforeChangedRecordsMap.clear(), this.sortedIndexMap.clear(), this.updateFilterRules(null === (_b = this.dataConfig) || void 0 === _b ? void 0 : _b.filterRules), (null === (_c = this.dataSourceObj) || void 0 === _c ? void 0 : _c.added) && this.dataSourceObj.added(rawInsertIndex, recordArr.length);
|
|
40973
40903
|
}
|
|
40974
40904
|
addRecordForSorted(record) {
|
|
40975
40905
|
Array.isArray(this.records) && (this.beforeChangedRecordsMap.clear(), this.records.push(record), this.currentIndexedData.push(this.currentIndexedData.length), this._sourceLength += 1, this.sortedIndexMap.clear(), this.userPagination || (this.pagination.perPageCount = this._sourceLength, this.pagination.totalCount = this._sourceLength));
|
|
@@ -40985,49 +40915,27 @@
|
|
|
40985
40915
|
}
|
|
40986
40916
|
}
|
|
40987
40917
|
adjustBeforeChangedRecordsMap(insertIndex, insertCount, type = "add") {
|
|
40988
|
-
|
|
40989
|
-
|
|
40990
|
-
|
|
40991
|
-
|
|
40992
|
-
|
|
40993
|
-
|
|
40994
|
-
|
|
40995
|
-
|
|
40996
|
-
|
|
40997
|
-
|
|
40998
|
-
|
|
40999
|
-
|
|
41000
|
-
|
|
41001
|
-
|
|
41002
|
-
|
|
41003
|
-
|
|
41004
|
-
|
|
41005
|
-
|
|
41006
|
-
|
|
41007
|
-
const recordIndex = recordIndexsMaxToMin[index];
|
|
41008
|
-
if (recordIndex >= this._sourceLength || recordIndex < 0) continue;
|
|
41009
|
-
this.adjustBeforeChangedRecordsMap(recordIndex, 1, "delete"), realDeletedRecordIndexs.push(recordIndex);
|
|
41010
|
-
const deletedRecord = this.records[recordIndex];
|
|
41011
|
-
for (let i = 0; i < this.fieldAggregators.length; i++) this.fieldAggregators[i].deleteRecord(deletedRecord);
|
|
41012
|
-
this.records.splice(recordIndex, 1), this.currentIndexedData.pop(), this._sourceLength -= 1;
|
|
41013
|
-
}
|
|
41014
|
-
return this.userPagination || (this.pagination.perPageCount = this._sourceLength, this.pagination.totalCount = this._sourceLength), this.updatePagerData(), (null === (_a = this.dataSourceObj) || void 0 === _a ? void 0 : _a.deleted) && this.dataSourceObj.deleted(realDeletedRecordIndexs), realDeletedRecordIndexs;
|
|
41015
|
-
}
|
|
41016
|
-
return [];
|
|
41017
|
-
}
|
|
41018
|
-
const rawRecords = this._getRawRecordsArray();
|
|
41019
|
-
if (!rawRecords || !Array.isArray(this.records)) return [];
|
|
41020
|
-
const realDeletedRecordIndexs = [],
|
|
41021
|
-
recordIndexsMaxToMin = recordIndexs.slice().sort((a, b) => b - a),
|
|
41022
|
-
rawDeletedIndexs = [];
|
|
41023
|
-
for (let index = 0; index < recordIndexsMaxToMin.length; index++) {
|
|
41024
|
-
const viewIndex = recordIndexsMaxToMin[index];
|
|
41025
|
-
if (viewIndex >= this.records.length || viewIndex < 0) continue;
|
|
41026
|
-
const deletedRecord = this.records[viewIndex],
|
|
41027
|
-
rawIndex = rawRecords.indexOf(deletedRecord);
|
|
41028
|
-
rawIndex >= 0 && (rawRecords.splice(rawIndex, 1), rawDeletedIndexs.push(rawIndex)), realDeletedRecordIndexs.push(viewIndex);
|
|
40918
|
+
for (let key = this.beforeChangedRecordsMap.size - 1; key >= insertIndex; key--) {
|
|
40919
|
+
const record = this.beforeChangedRecordsMap.get(key.toString());
|
|
40920
|
+
this.beforeChangedRecordsMap.delete(key.toString()), this.beforeChangedRecordsMap.set((key + ("add" === type ? insertCount : -insertCount)).toString(), record);
|
|
40921
|
+
}
|
|
40922
|
+
}
|
|
40923
|
+
deleteRecords(recordIndexs) {
|
|
40924
|
+
var _a;
|
|
40925
|
+
if (Array.isArray(this.records)) {
|
|
40926
|
+
const realDeletedRecordIndexs = [],
|
|
40927
|
+
recordIndexsMaxToMin = recordIndexs.sort((a, b) => b - a);
|
|
40928
|
+
for (let index = 0; index < recordIndexsMaxToMin.length; index++) {
|
|
40929
|
+
const recordIndex = recordIndexsMaxToMin[index];
|
|
40930
|
+
if (recordIndex >= this._sourceLength || recordIndex < 0) continue;
|
|
40931
|
+
this.adjustBeforeChangedRecordsMap(recordIndex, 1, "delete"), realDeletedRecordIndexs.push(recordIndex);
|
|
40932
|
+
const deletedRecord = this.records[recordIndex];
|
|
40933
|
+
for (let i = 0; i < this.fieldAggregators.length; i++) this.fieldAggregators[i].deleteRecord(deletedRecord);
|
|
40934
|
+
this.records.splice(recordIndex, 1), this.currentIndexedData.pop(), this._sourceLength -= 1;
|
|
40935
|
+
}
|
|
40936
|
+
return this.userPagination || (this.pagination.perPageCount = this._sourceLength, this.pagination.totalCount = this._sourceLength), this.updatePagerData(), (null === (_a = this.dataSourceObj) || void 0 === _a ? void 0 : _a.deleted) && this.dataSourceObj.deleted(realDeletedRecordIndexs), realDeletedRecordIndexs;
|
|
41029
40937
|
}
|
|
41030
|
-
return
|
|
40938
|
+
return [];
|
|
41031
40939
|
}
|
|
41032
40940
|
deleteRecordsForSorted(recordIndexs) {
|
|
41033
40941
|
if (Array.isArray(this.records)) {
|
|
@@ -41041,34 +40949,18 @@
|
|
|
41041
40949
|
this.sortedIndexMap.clear(), this.userPagination || (this.pagination.perPageCount = this._sourceLength, this.pagination.totalCount = this._sourceLength), this.beforeChangedRecordsMap.clear();
|
|
41042
40950
|
}
|
|
41043
40951
|
}
|
|
41044
|
-
updateRecords(records, recordIndexs
|
|
41045
|
-
|
|
41046
|
-
if (!syncToOriginalRecords) {
|
|
41047
|
-
const realDeletedRecordIndexs = [];
|
|
41048
|
-
for (let index = 0; index < recordIndexs.length; index++) {
|
|
41049
|
-
const recordIndex = recordIndexs[index];
|
|
41050
|
-
if (Array.isArray(recordIndex)) this.beforeChangedRecordsMap.delete(recordIndex.toString()), realDeletedRecordIndexs.push(recordIndex), recordIndex.slice(0, -1).reduce((acc, key) => (void 0 === acc[key] && (acc[key] = {}), acc[key].children), this.records)[recordIndex[recordIndex.length - 1]] = records[index];else {
|
|
41051
|
-
if (recordIndex >= this._sourceLength || recordIndex < 0) continue;
|
|
41052
|
-
this.beforeChangedRecordsMap.delete(recordIndex.toString()), realDeletedRecordIndexs.push(recordIndex);
|
|
41053
|
-
for (let i = 0; i < this.fieldAggregators.length; i++) this.fieldAggregators[i].updateRecord(this.records[recordIndex], records[index]);
|
|
41054
|
-
this.records[recordIndex] = records[index];
|
|
41055
|
-
}
|
|
41056
|
-
}
|
|
41057
|
-
return this.userPagination && this.updatePagerData(), realDeletedRecordIndexs;
|
|
41058
|
-
}
|
|
41059
|
-
const rawRecords = this._getRawRecordsArray();
|
|
41060
|
-
if (!rawRecords || !Array.isArray(this.records)) return [];
|
|
41061
|
-
const realUpdatedIndexs = [];
|
|
40952
|
+
updateRecords(records, recordIndexs) {
|
|
40953
|
+
const realDeletedRecordIndexs = [];
|
|
41062
40954
|
for (let index = 0; index < recordIndexs.length; index++) {
|
|
41063
40955
|
const recordIndex = recordIndexs[index];
|
|
41064
|
-
if (Array.isArray(recordIndex)) this.beforeChangedRecordsMap.delete(recordIndex.toString()),
|
|
41065
|
-
if (recordIndex >= this.
|
|
41066
|
-
|
|
41067
|
-
|
|
41068
|
-
|
|
40956
|
+
if (Array.isArray(recordIndex)) this.beforeChangedRecordsMap.delete(recordIndex.toString()), realDeletedRecordIndexs.push(recordIndex), recordIndex.slice(0, -1).reduce((acc, key) => (void 0 === acc[key] && (acc[key] = {}), acc[key].children), this.records)[recordIndex[recordIndex.length - 1]] = records[index];else {
|
|
40957
|
+
if (recordIndex >= this._sourceLength || recordIndex < 0) continue;
|
|
40958
|
+
this.beforeChangedRecordsMap.delete(recordIndex.toString()), realDeletedRecordIndexs.push(recordIndex);
|
|
40959
|
+
for (let i = 0; i < this.fieldAggregators.length; i++) this.fieldAggregators[i].updateRecord(this.records[recordIndex], records[index]);
|
|
40960
|
+
this.records[recordIndex] = records[index];
|
|
41069
40961
|
}
|
|
41070
40962
|
}
|
|
41071
|
-
return this.
|
|
40963
|
+
return this.userPagination && this.updatePagerData(), realDeletedRecordIndexs;
|
|
41072
40964
|
}
|
|
41073
40965
|
updateRecordsForSorted(records, recordIndexs) {
|
|
41074
40966
|
for (let index = 0; index < recordIndexs.length; index++) {
|
|
@@ -41136,30 +41028,23 @@
|
|
|
41136
41028
|
setSortedIndexMap(field, filedMap) {
|
|
41137
41029
|
this.sortedIndexMap.set(field, filedMap);
|
|
41138
41030
|
}
|
|
41139
|
-
markForceVisibleRecord(record) {
|
|
41140
|
-
!record || "object" != typeof record && "function" != typeof record || (this._forceVisibleRecords || (this._forceVisibleRecords = new WeakSet()), this._forceVisibleRecords.add(record));
|
|
41141
|
-
}
|
|
41142
|
-
clearForceVisibleRecords() {
|
|
41143
|
-
this._forceVisibleRecords = void 0;
|
|
41144
|
-
}
|
|
41145
41031
|
clearFilteredChildren(record) {
|
|
41146
41032
|
var _a, _b;
|
|
41147
41033
|
record.filteredChildren = void 0;
|
|
41148
41034
|
for (let i = 0; i < (null !== (_b = null === (_a = record.children) || void 0 === _a ? void 0 : _a.length) && void 0 !== _b ? _b : 0); i++) this.clearFilteredChildren(record.children[i]);
|
|
41149
41035
|
}
|
|
41150
41036
|
filterRecord(record) {
|
|
41151
|
-
var _a, _b, _c
|
|
41152
|
-
if (null === (_a = this._forceVisibleRecords) || void 0 === _a ? void 0 : _a.has(record)) return !0;
|
|
41037
|
+
var _a, _b, _c;
|
|
41153
41038
|
let isReserved = !0;
|
|
41154
|
-
for (let i = 0; i < (null === (
|
|
41155
|
-
const filterRule = null === (
|
|
41039
|
+
for (let i = 0; i < (null === (_a = this.dataConfig.filterRules) || void 0 === _a ? void 0 : _a.length); i++) {
|
|
41040
|
+
const filterRule = null === (_b = this.dataConfig) || void 0 === _b ? void 0 : _b.filterRules[i];
|
|
41156
41041
|
if (filterRule.filterKey) {
|
|
41157
41042
|
const filterValue = record[filterRule.filterKey];
|
|
41158
41043
|
if (-1 === filterRule.filteredValues.indexOf(filterValue)) {
|
|
41159
41044
|
isReserved = !1;
|
|
41160
41045
|
break;
|
|
41161
41046
|
}
|
|
41162
|
-
} else if (!(null === (
|
|
41047
|
+
} else if (!(null === (_c = filterRule.filterFunc) || void 0 === _c ? void 0 : _c.call(filterRule, record))) {
|
|
41163
41048
|
isReserved = !1;
|
|
41164
41049
|
break;
|
|
41165
41050
|
}
|
|
@@ -51743,7 +51628,7 @@
|
|
|
51743
51628
|
rowUpdatePos = isValid$1(rowUpdatePos) ? isValid$1(pos) ? Math.min(rowUpdatePos, pos) : rowUpdatePos : pos;
|
|
51744
51629
|
}
|
|
51745
51630
|
let updateAfter;
|
|
51746
|
-
if (scene.table._clearRowRangeHeightsMap(), addRows.forEach(row => {
|
|
51631
|
+
if (scene.table._clearRowRangeHeightsMap(), verifyProxyRowStatus(scene), addRows.forEach(row => {
|
|
51747
51632
|
const needUpdateAfter = addRow(row, scene, skipUpdateProxy);
|
|
51748
51633
|
updateAfter = null != updateAfter ? updateAfter : needUpdateAfter, rowHeightsMap.insert(row);
|
|
51749
51634
|
}), resetRowNumberAndY(scene), addRows.length) {
|
|
@@ -51973,6 +51858,25 @@
|
|
|
51973
51858
|
function setRowSeriesNumberCellNeedUpdate(startUpdateRow, scene) {
|
|
51974
51859
|
if (scene.table.isHasSeriesNumber()) for (let row = startUpdateRow; row <= scene.table.rowCount - 1; row++) updateCell$1(0, row, scene.table, !1);
|
|
51975
51860
|
}
|
|
51861
|
+
function verifyProxyRowStatus(scene) {
|
|
51862
|
+
const proxy = scene.proxy,
|
|
51863
|
+
{
|
|
51864
|
+
rowStart: rowStart,
|
|
51865
|
+
rowEnd: rowEnd,
|
|
51866
|
+
rowLimit: rowLimit,
|
|
51867
|
+
totalRow: totalRow
|
|
51868
|
+
} = proxy;
|
|
51869
|
+
if (rowStart > rowEnd) return proxy.rowStart = scene.table.columnHeaderLevelCount, proxy.rowEnd = Math.min(totalRow, proxy.rowStart + rowLimit - 1), void (proxy.currentRow = 0);
|
|
51870
|
+
if (rowStart + rowLimit - 1 > totalRow) {
|
|
51871
|
+
const oldRowStart = proxy.rowStart,
|
|
51872
|
+
newRowStart = Math.max(scene.table.columnHeaderLevelCount, totalRow - rowLimit + 1);
|
|
51873
|
+
if (newRowStart === oldRowStart) return;
|
|
51874
|
+
proxy.rowStart = newRowStart, proxy.rowEnd = Math.min(totalRow, newRowStart + rowLimit - 1), proxy.currentRow = proxy.rowEnd + 1;
|
|
51875
|
+
const addRowCount = oldRowStart - proxy.rowStart;
|
|
51876
|
+
for (let i = 0; i < addRowCount; i++) addRowCellGroup(proxy.rowStart + i, scene);
|
|
51877
|
+
proxy.rowUpdatePos = proxy.rowStart;
|
|
51878
|
+
}
|
|
51879
|
+
}
|
|
51976
51880
|
|
|
51977
51881
|
function createReactContainer(table) {
|
|
51978
51882
|
const {
|
|
@@ -53928,7 +53832,7 @@
|
|
|
53928
53832
|
} else if (-1 === cellPos.col || -1 === cellPos.row || -1 !== col && -1 !== row) {
|
|
53929
53833
|
if (interactionState !== InteractionState.default || table.eventManager.isDraging || table.stateManager.isResizeCol()) {
|
|
53930
53834
|
if ((interactionState === InteractionState.grabing || table.eventManager.isDraging) && !table.stateManager.isResizeCol()) {
|
|
53931
|
-
let extendSelectRange = !
|
|
53835
|
+
let extendSelectRange = !isValid$1(skipBodyMerge) || !skipBodyMerge;
|
|
53932
53836
|
-1 === cellPos.col && (cellPos.col = col), -1 === cellPos.row && (cellPos.row = row), cellPos.col = col, cellPos.row = row;
|
|
53933
53837
|
const currentRange = state.select.ranges[state.select.ranges.length - 1];
|
|
53934
53838
|
if (currentRange) {
|
|
@@ -54050,7 +53954,7 @@
|
|
|
54050
53954
|
};
|
|
54051
53955
|
enableShiftSelectMode || (currentRange.end = currentRange.start), scenegraph.deleteLastSelectedRangeComponents(), scenegraph.updateCellSelectBorder(currentRange);
|
|
54052
53956
|
} else {
|
|
54053
|
-
let extendSelectRange = !
|
|
53957
|
+
let extendSelectRange = !isValid$1(skipBodyMerge) || !skipBodyMerge;
|
|
54054
53958
|
if (-1 === cellPos.col || -1 === cellPos.row || enableCtrlSelectMode || (state.select.ranges = [], scenegraph.deleteAllSelectBorder()), "cell" !== state.select.headerSelectMode && table.isColumnHeader(col, row)) {
|
|
54055
53959
|
const cellRange = table.getCellRange(col, row);
|
|
54056
53960
|
"body" === state.select.headerSelectMode ? state.select.ranges.push({
|
|
@@ -57396,7 +57300,7 @@
|
|
|
57396
57300
|
};
|
|
57397
57301
|
let EventManager$1 = class EventManager {
|
|
57398
57302
|
constructor(table) {
|
|
57399
|
-
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.
|
|
57303
|
+
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(() => {
|
|
57400
57304
|
this.bindSelfEvent();
|
|
57401
57305
|
}, 0));
|
|
57402
57306
|
}
|
|
@@ -57698,25 +57602,15 @@
|
|
|
57698
57602
|
} catch (error) {}
|
|
57699
57603
|
}
|
|
57700
57604
|
handleCut(e) {
|
|
57701
|
-
var _a;
|
|
57702
57605
|
return __awaiter$1(this, void 0, void 0, function* () {
|
|
57703
|
-
this.handleCopy(e, !0), this.cutWaitPaste = !0, this.cutCellRange = this.table.getSelectedCellInfos(), this.
|
|
57704
|
-
|
|
57705
|
-
col: r.start.col,
|
|
57706
|
-
row: r.start.row
|
|
57707
|
-
},
|
|
57708
|
-
end: {
|
|
57709
|
-
col: r.end.col,
|
|
57710
|
-
row: r.end.row
|
|
57711
|
-
}
|
|
57712
|
-
})), this.clipboardCheckTimer && clearTimeout(this.clipboardCheckTimer), this.clipboardCheckTimer = window.setTimeout(() => {
|
|
57713
|
-
this.cutWaitPaste && (this.cutWaitPaste = !1, this.cutCellRange = null, this.cutRanges = null, this.clipboardCheckTimer = null);
|
|
57606
|
+
this.handleCopy(e, !0), this.cutWaitPaste = !0, this.cutCellRange = this.table.getSelectedCellInfos(), this.clipboardCheckTimer && clearTimeout(this.clipboardCheckTimer), this.clipboardCheckTimer = window.setTimeout(() => {
|
|
57607
|
+
this.cutWaitPaste && (this.cutWaitPaste = !1, this.cutCellRange = null, this.clipboardCheckTimer = null);
|
|
57714
57608
|
}, 3e4), this.saveClipboardContent();
|
|
57715
57609
|
});
|
|
57716
57610
|
}
|
|
57717
57611
|
handlePaste(e) {
|
|
57718
57612
|
this.cutWaitPaste ? this.checkClipboardChanged().then(changed => {
|
|
57719
|
-
this.executePaste(e), changed || this.clearCutArea(this.table), this.cutWaitPaste && (this.cutWaitPaste = !1, this.cutCellRange = null, this.
|
|
57613
|
+
this.executePaste(e), changed || this.clearCutArea(this.table), this.cutWaitPaste && (this.cutWaitPaste = !1, this.cutCellRange = null, this.clipboardCheckTimer && (clearTimeout(this.clipboardCheckTimer), this.clipboardCheckTimer = null));
|
|
57720
57614
|
}).catch(() => {
|
|
57721
57615
|
this.executePaste(e), this.cutWaitPaste && (this.cutWaitPaste = !1, this.cutCellRange = null, this.clipboardCheckTimer && (clearTimeout(this.clipboardCheckTimer), this.clipboardCheckTimer = null));
|
|
57722
57616
|
}) : this.executePaste(e);
|
|
@@ -57793,9 +57687,9 @@
|
|
|
57793
57687
|
}
|
|
57794
57688
|
clearCutArea(table) {
|
|
57795
57689
|
try {
|
|
57796
|
-
const
|
|
57797
|
-
if (!
|
|
57798
|
-
table.
|
|
57690
|
+
const selectCells = this.cutCellRange;
|
|
57691
|
+
if (!selectCells || 0 === selectCells.length) return;
|
|
57692
|
+
for (let i = 0; i < selectCells.length; i++) for (let j = 0; j < selectCells[i].length; j++) selectCells[i][j] && table.changeCellValue(selectCells[i][j].col, selectCells[i][j].row, void 0);
|
|
57799
57693
|
} catch (error) {}
|
|
57800
57694
|
}
|
|
57801
57695
|
checkClipboardChanged() {
|
|
@@ -59731,22 +59625,41 @@
|
|
|
59731
59625
|
|
|
59732
59626
|
class CustomCellStylePlugin {
|
|
59733
59627
|
constructor(table, customCellStyle, customCellStyleArrangement) {
|
|
59734
|
-
this.table = table, this.customCellStyle = customCellStyle, this.customCellStyleArrangement = customCellStyleArrangement;
|
|
59628
|
+
this.table = table, this.customCellStyle = customCellStyle, this.customCellStyleArrangement = customCellStyleArrangement, this._customCellStyleArrangementIndex = new Map(), this._customCellStyleArrangementTombstoneCount = 0, this._rebuildCustomCellStyleArrangementIndex();
|
|
59735
59629
|
}
|
|
59736
|
-
|
|
59737
|
-
|
|
59630
|
+
_getCustomCellStyleArrangementKey(cellPos) {
|
|
59631
|
+
if (cellPos.range) {
|
|
59632
|
+
const {
|
|
59633
|
+
start: start,
|
|
59634
|
+
end: end
|
|
59635
|
+
} = cellPos.range;
|
|
59636
|
+
return `range:${start.col},${start.row},${end.col},${end.row}`;
|
|
59637
|
+
}
|
|
59638
|
+
if (void 0 !== cellPos.col && void 0 !== cellPos.row) return `cell:${cellPos.col},${cellPos.row}`;
|
|
59738
59639
|
}
|
|
59739
|
-
|
|
59740
|
-
this.
|
|
59741
|
-
|
|
59742
|
-
customStyleId
|
|
59743
|
-
|
|
59640
|
+
_rebuildCustomCellStyleArrangementIndex() {
|
|
59641
|
+
this._customCellStyleArrangementIndex.clear(), this._customCellStyleArrangementTombstoneCount = 0;
|
|
59642
|
+
for (let i = 0; i < this.customCellStyleArrangement.length; i++) {
|
|
59643
|
+
if (!isValid$1(this.customCellStyleArrangement[i].customStyleId)) {
|
|
59644
|
+
this._customCellStyleArrangementTombstoneCount++;
|
|
59645
|
+
continue;
|
|
59646
|
+
}
|
|
59647
|
+
const key = this._getCustomCellStyleArrangementKey(this.customCellStyleArrangement[i].cellPosition);
|
|
59648
|
+
key && this._customCellStyleArrangementIndex.set(key, i);
|
|
59649
|
+
}
|
|
59650
|
+
}
|
|
59651
|
+
_compactCustomCellStyleArrangementIfNeeded() {
|
|
59652
|
+
const length = this.customCellStyleArrangement.length;
|
|
59653
|
+
if (this._customCellStyleArrangementTombstoneCount < 2048) return;
|
|
59654
|
+
if (4 * this._customCellStyleArrangementTombstoneCount < length) return;
|
|
59655
|
+
const compacted = this.customCellStyleArrangement.filter(style => isValid$1(style.customStyleId));
|
|
59656
|
+
compacted.length !== this.customCellStyleArrangement.length ? (this.customCellStyleArrangement.length = 0, this.customCellStyleArrangement.push(...compacted), this._rebuildCustomCellStyleArrangementIndex()) : this._customCellStyleArrangementTombstoneCount = 0;
|
|
59744
59657
|
}
|
|
59745
59658
|
getCustomCellStyle(col, row) {
|
|
59746
59659
|
const customStyleIds = this.getCustomCellStyleIds(col, row);
|
|
59747
59660
|
if (customStyleIds.length) {
|
|
59748
59661
|
const styles = [];
|
|
59749
|
-
|
|
59662
|
+
if (customStyleIds.forEach(customStyleId => {
|
|
59750
59663
|
const styleOption = this.getCustomCellStyleOption(customStyleId);
|
|
59751
59664
|
if (isFunction$3(null == styleOption ? void 0 : styleOption.style)) {
|
|
59752
59665
|
const style = styleOption.style({
|
|
@@ -59759,14 +59672,15 @@
|
|
|
59759
59672
|
});
|
|
59760
59673
|
styles.push(style);
|
|
59761
59674
|
} else (null == styleOption ? void 0 : styleOption.style) && styles.push(styleOption.style);
|
|
59762
|
-
}),
|
|
59675
|
+
}), !styles.length) return;
|
|
59676
|
+
return merge({}, ...styles);
|
|
59763
59677
|
}
|
|
59764
59678
|
}
|
|
59765
59679
|
getCustomCellStyleIds(col, row) {
|
|
59766
59680
|
const customStyleIds = [],
|
|
59767
59681
|
range = this.table.getCellRange(col, row);
|
|
59768
59682
|
for (let c = range.start.col; c <= range.end.col; c++) for (let r = range.start.row; r <= range.end.row; r++) this.customCellStyleArrangement.forEach(style => {
|
|
59769
|
-
style.cellPosition.range ? style.cellPosition.range.start.col <= c && style.cellPosition.range.end.col >= c && style.cellPosition.range.start.row <= r && style.cellPosition.range.end.row >= r && customStyleIds.push(style.customStyleId) : style.cellPosition.col === c && style.cellPosition.row === r && customStyleIds.push(style.customStyleId);
|
|
59683
|
+
isValid$1(style.customStyleId) && (style.cellPosition.range ? style.cellPosition.range.start.col <= c && style.cellPosition.range.end.col >= c && style.cellPosition.range.start.row <= r && style.cellPosition.range.end.row >= r && customStyleIds.push(style.customStyleId) : style.cellPosition.col === c && style.cellPosition.row === r && customStyleIds.push(style.customStyleId));
|
|
59770
59684
|
});
|
|
59771
59685
|
return customStyleIds;
|
|
59772
59686
|
}
|
|
@@ -59787,21 +59701,35 @@
|
|
|
59787
59701
|
}), this.table.scenegraph.updateNextFrame();
|
|
59788
59702
|
}
|
|
59789
59703
|
arrangeCustomCellStyle(cellPos, customStyleId, forceFastUpdate) {
|
|
59790
|
-
var _a;
|
|
59791
|
-
const
|
|
59792
|
-
|
|
59793
|
-
if (-1
|
|
59794
|
-
|
|
59795
|
-
|
|
59796
|
-
|
|
59797
|
-
|
|
59798
|
-
|
|
59799
|
-
|
|
59800
|
-
|
|
59704
|
+
var _a, _b;
|
|
59705
|
+
const inputKey = this._getCustomCellStyleArrangementKey(cellPos);
|
|
59706
|
+
let index = inputKey && null !== (_a = this._customCellStyleArrangementIndex.get(inputKey)) && void 0 !== _a ? _a : -1;
|
|
59707
|
+
if (inputKey && -1 !== index) {
|
|
59708
|
+
const item = this.customCellStyleArrangement[index],
|
|
59709
|
+
itemKey = item ? this._getCustomCellStyleArrangementKey(item.cellPosition) : void 0;
|
|
59710
|
+
item && isValid$1(item.customStyleId) && itemKey === inputKey || (index = this.customCellStyleArrangement.findIndex(style => !!isValid$1(style.customStyleId) && this._getCustomCellStyleArrangementKey(style.cellPosition) === inputKey), -1 !== index ? this._customCellStyleArrangementIndex.set(inputKey, index) : this._customCellStyleArrangementIndex.delete(inputKey));
|
|
59711
|
+
}
|
|
59712
|
+
if (-1 !== index || inputKey || (index = this.customCellStyleArrangement.findIndex(style => !!isValid$1(style.customStyleId) && (style.cellPosition.range && cellPos.range ? style.cellPosition.range.start.col === cellPos.range.start.col && style.cellPosition.range.start.row === cellPos.range.start.row && style.cellPosition.range.end.col === cellPos.range.end.col && style.cellPosition.range.end.row === cellPos.range.end.row : style.cellPosition.col === cellPos.col && style.cellPosition.row === cellPos.row))), -1 === index && !customStyleId) return;
|
|
59713
|
+
if (-1 === index && customStyleId) {
|
|
59714
|
+
this.customCellStyleArrangement.push({
|
|
59715
|
+
cellPosition: {
|
|
59716
|
+
col: cellPos.col,
|
|
59717
|
+
row: cellPos.row,
|
|
59718
|
+
range: cellPos.range
|
|
59719
|
+
},
|
|
59720
|
+
customStyleId: customStyleId
|
|
59721
|
+
});
|
|
59722
|
+
const pushedIndex = this.customCellStyleArrangement.length - 1,
|
|
59723
|
+
pushedKey = this._getCustomCellStyleArrangementKey(this.customCellStyleArrangement[pushedIndex].cellPosition);
|
|
59724
|
+
pushedKey && this._customCellStyleArrangementIndex.set(pushedKey, pushedIndex);
|
|
59725
|
+
} else {
|
|
59801
59726
|
if (this.customCellStyleArrangement[index].customStyleId === customStyleId) return;
|
|
59802
|
-
customStyleId
|
|
59727
|
+
if (customStyleId) this.customCellStyleArrangement[index].customStyleId = customStyleId;else {
|
|
59728
|
+
const existedKey = this._getCustomCellStyleArrangementKey(this.customCellStyleArrangement[index].cellPosition);
|
|
59729
|
+
isValid$1(this.customCellStyleArrangement[index].customStyleId) && this._customCellStyleArrangementTombstoneCount++, this.customCellStyleArrangement[index].customStyleId = null, existedKey && this._customCellStyleArrangementIndex.delete(existedKey), this._compactCustomCellStyleArrangementIfNeeded();
|
|
59730
|
+
}
|
|
59803
59731
|
}
|
|
59804
|
-
const style = null === (
|
|
59732
|
+
const style = customStyleId ? null === (_b = this.getCustomCellStyleOption(customStyleId)) || void 0 === _b ? void 0 : _b.style : void 0;
|
|
59805
59733
|
if (style) {
|
|
59806
59734
|
forceFastUpdate = !0;
|
|
59807
59735
|
for (const key in style) if (-1 === cellStyleKeys.indexOf(key)) {
|
|
@@ -59816,7 +59744,7 @@
|
|
|
59816
59744
|
this.table.scenegraph.updateNextFrame();
|
|
59817
59745
|
}
|
|
59818
59746
|
updateCustomCell(customCellStyle, customCellStyleArrangement) {
|
|
59819
|
-
this.customCellStyle.length = 0, this.customCellStyleArrangement.length = 0, customCellStyle.forEach(cellStyle => {
|
|
59747
|
+
this.customCellStyle.length = 0, this.customCellStyleArrangement.length = 0, this._customCellStyleArrangementIndex.clear(), this._customCellStyleArrangementTombstoneCount = 0, customCellStyle.forEach(cellStyle => {
|
|
59820
59748
|
this.registerCustomCellStyle(cellStyle.id, cellStyle.style);
|
|
59821
59749
|
}), customCellStyleArrangement.forEach(cellStyle => {
|
|
59822
59750
|
this.arrangeCustomCellStyle(cellStyle.cellPosition, cellStyle.customStyleId);
|
|
@@ -60047,7 +59975,7 @@
|
|
|
60047
59975
|
}
|
|
60048
59976
|
constructor(container, options = {}) {
|
|
60049
59977
|
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;
|
|
60050
|
-
if (super(), this.showFrozenIcon = !0, this.version = "1.22.11
|
|
59978
|
+
if (super(), this.showFrozenIcon = !0, this.version = "1.22.11", 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");
|
|
60051
59979
|
this.pluginManager = new PluginManager$1(this, options), this.fireListeners(TABLE_EVENT_TYPE.BEFORE_INIT, {
|
|
60052
59980
|
options: options,
|
|
60053
59981
|
container: container
|
|
@@ -61261,16 +61189,16 @@
|
|
|
61261
61189
|
startCol = enableShiftSelectMode && (null === (_a = null == lastSelectRange ? void 0 : lastSelectRange.start) || void 0 === _a ? void 0 : _a.col) ? null === (_b = null == lastSelectRange ? void 0 : lastSelectRange.start) || void 0 === _b ? void 0 : _b.col : colIndex,
|
|
61262
61190
|
endCol = colIndex,
|
|
61263
61191
|
endRow = this.rowCount - 1;
|
|
61264
|
-
this.stateManager.updateSelectPos(startCol, 0, enableShiftSelectMode, enableCtrlSelectMode, !1, null === (_d = null === (_c = this.options.select) || void 0 === _c ? void 0 : _c.makeSelectCellVisible) || void 0 === _d || _d, !0), this.stateManager.updateInteractionState(InteractionState.grabing), this.stateManager.updateSelectPos(endCol, endRow, enableShiftSelectMode, enableCtrlSelectMode, !1, null === (_f = null === (_e = this.options.select) || void 0 === _e ? void 0 : _e.makeSelectCellVisible) || void 0 === _f || _f, !0);
|
|
61192
|
+
this.stateManager.updateSelectPos(startCol, 0, enableShiftSelectMode, enableCtrlSelectMode, !1, null === (_d = null === (_c = this.options.select) || void 0 === _c ? void 0 : _c.makeSelectCellVisible) || void 0 === _d || _d, !0), this.stateManager.updateInteractionState(InteractionState.grabing), this.stateManager.updateSelectPos(endCol, endRow, enableShiftSelectMode, enableCtrlSelectMode, !1, null === (_f = null === (_e = this.options.select) || void 0 === _e ? void 0 : _e.makeSelectCellVisible) || void 0 === _f || _f, !0), this.stateManager.select.selecting = !1;
|
|
61265
61193
|
}
|
|
61266
61194
|
dragSelectCol(colIndex, enableCtrlSelectMode) {
|
|
61267
61195
|
var _a, _b;
|
|
61268
61196
|
const currentSelectRanges = this.stateManager.select.ranges,
|
|
61269
61197
|
lastSelectRange = currentSelectRanges[currentSelectRanges.length - 1];
|
|
61270
|
-
lastSelectRange && (lastSelectRange.end.col = colIndex), this.stateManager.updateSelectPos(colIndex, this.rowCount - 1, !1, enableCtrlSelectMode, !1, null === (_b = null === (_a = this.options.select) || void 0 === _a ? void 0 : _a.makeSelectCellVisible) || void 0 === _b || _b, !0);
|
|
61198
|
+
lastSelectRange && (lastSelectRange.end.col = colIndex), this.stateManager.updateSelectPos(colIndex, this.rowCount - 1, !1, enableCtrlSelectMode, !1, null === (_b = null === (_a = this.options.select) || void 0 === _a ? void 0 : _a.makeSelectCellVisible) || void 0 === _b || _b, !0), this.stateManager.select.selecting = !1;
|
|
61271
61199
|
}
|
|
61272
61200
|
endDragSelect() {
|
|
61273
|
-
this.stateManager.updateInteractionState(InteractionState.default)
|
|
61201
|
+
this.stateManager.updateInteractionState(InteractionState.default);
|
|
61274
61202
|
}
|
|
61275
61203
|
startDragSelectRow(rowIndex, enableCtrlSelectMode, isShift) {
|
|
61276
61204
|
var _a, _b, _c, _d, _e, _f;
|
|
@@ -61278,13 +61206,13 @@
|
|
|
61278
61206
|
startRow = isShift && (null === (_a = null == lastSelectRange ? void 0 : lastSelectRange.start) || void 0 === _a ? void 0 : _a.row) ? null === (_b = null == lastSelectRange ? void 0 : lastSelectRange.start) || void 0 === _b ? void 0 : _b.row : rowIndex,
|
|
61279
61207
|
endCol = this.colCount - 1,
|
|
61280
61208
|
endRow = rowIndex;
|
|
61281
|
-
this.stateManager.updateSelectPos(0, startRow, isShift, enableCtrlSelectMode, !1, null === (_d = null === (_c = this.options.select) || void 0 === _c ? void 0 : _c.makeSelectCellVisible) || void 0 === _d || _d, !0), this.stateManager.updateInteractionState(InteractionState.grabing), this.stateManager.updateSelectPos(endCol, endRow, isShift, enableCtrlSelectMode, !1, null === (_f = null === (_e = this.options.select) || void 0 === _e ? void 0 : _e.makeSelectCellVisible) || void 0 === _f || _f, !0);
|
|
61209
|
+
this.stateManager.updateSelectPos(0, startRow, isShift, enableCtrlSelectMode, !1, null === (_d = null === (_c = this.options.select) || void 0 === _c ? void 0 : _c.makeSelectCellVisible) || void 0 === _d || _d, !0), this.stateManager.updateInteractionState(InteractionState.grabing), this.stateManager.updateSelectPos(endCol, endRow, isShift, enableCtrlSelectMode, !1, null === (_f = null === (_e = this.options.select) || void 0 === _e ? void 0 : _e.makeSelectCellVisible) || void 0 === _f || _f, !0), this.stateManager.select.selecting = !1;
|
|
61282
61210
|
}
|
|
61283
61211
|
dragSelectRow(rowIndex, isCtrl) {
|
|
61284
61212
|
var _a, _b;
|
|
61285
61213
|
const currentSelectRanges = this.stateManager.select.ranges,
|
|
61286
61214
|
lastSelectRange = currentSelectRanges[currentSelectRanges.length - 1];
|
|
61287
|
-
lastSelectRange && (lastSelectRange.end.row = rowIndex), this.stateManager.updateSelectPos(this.colCount - 1, rowIndex, !1, isCtrl, !1, null === (_b = null === (_a = this.options.select) || void 0 === _a ? void 0 : _a.makeSelectCellVisible) || void 0 === _b || _b, !0);
|
|
61215
|
+
lastSelectRange && (lastSelectRange.end.row = rowIndex), this.stateManager.updateSelectPos(this.colCount - 1, rowIndex, !1, isCtrl, !1, null === (_b = null === (_a = this.options.select) || void 0 === _a ? void 0 : _a.makeSelectCellVisible) || void 0 === _b || _b, !0), this.stateManager.select.selecting = !1;
|
|
61288
61216
|
}
|
|
61289
61217
|
get recordsCount() {
|
|
61290
61218
|
var _a;
|
|
@@ -62206,6 +62134,18 @@
|
|
|
62206
62134
|
}
|
|
62207
62135
|
return !1;
|
|
62208
62136
|
}
|
|
62137
|
+
updateCellContent(col, row) {
|
|
62138
|
+
this.scenegraph.updateCellContent(col, row);
|
|
62139
|
+
}
|
|
62140
|
+
updateCellContentRange(startCol, startRow, endCol, endRow) {
|
|
62141
|
+
for (let i = startCol; i <= endCol; i++) for (let j = startRow; j <= endRow; j++) this.scenegraph.updateCellContent(i, j);
|
|
62142
|
+
}
|
|
62143
|
+
updateCellContentRanges(ranges) {
|
|
62144
|
+
for (let i = 0; i < ranges.length; i++) {
|
|
62145
|
+
const range = ranges[i];
|
|
62146
|
+
this.updateCellContentRange(range.start.col, range.start.row, range.end.col, range.end.row);
|
|
62147
|
+
}
|
|
62148
|
+
}
|
|
62209
62149
|
}
|
|
62210
62150
|
|
|
62211
62151
|
const chartTypes = {};
|
|
@@ -63708,8 +63648,8 @@
|
|
|
63708
63648
|
col === this.table.colCount - 1 ? referencePosition.rect.width = rect.width - 1 : referencePosition.rect.width = rect.width + 1, row === this.table.rowCount - 1 ? referencePosition.rect.height = rect.height - 1 : referencePosition.rect.height = rect.height + 1;
|
|
63709
63649
|
const editor = this.table.getEditor(col, row);
|
|
63710
63650
|
editor && setTimeout(() => {
|
|
63711
|
-
var _a;
|
|
63712
|
-
editor && this.editingEditor !== editor && (null === (_a = editor.prepareEdit) || void 0 ===
|
|
63651
|
+
var _a, _b;
|
|
63652
|
+
editor && this.editingEditor !== editor && (null === (_b = (_a = editor).prepareEdit) || void 0 === _b || _b.call(_a, {
|
|
63713
63653
|
referencePosition: referencePosition,
|
|
63714
63654
|
container: this.table.getElement(),
|
|
63715
63655
|
table: this.table,
|
|
@@ -63722,14 +63662,14 @@
|
|
|
63722
63662
|
this.listenersId.push(doubleClickEventId, clickEventId, selectedChangedEventId);
|
|
63723
63663
|
}
|
|
63724
63664
|
startEditCell(col, row, value, editElement) {
|
|
63725
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
63665
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
|
63726
63666
|
if (this.editingEditor) return;
|
|
63727
63667
|
const editor = this.table.getEditor(col, row);
|
|
63728
63668
|
if (editor) {
|
|
63729
|
-
if (editElement && editor.setElement(editElement), this.table.internalProps.layoutMap.isSeriesNumber(col, row)) return;
|
|
63730
|
-
if (null === (
|
|
63731
|
-
const isPivotTable = null === (
|
|
63732
|
-
updateAggregationOnEditCell = !!isPivotTable && (null === (
|
|
63669
|
+
if (editElement && (null === (_b = (_a = editor).setElement) || void 0 === _b || _b.call(_a, editElement)), this.table.internalProps.layoutMap.isSeriesNumber(col, row)) return;
|
|
63670
|
+
if (null === (_d = null === (_c = this.table.internalProps.layoutMap) || void 0 === _c ? void 0 : _c.isAggregation) || void 0 === _d ? void 0 : _d.call(_c, col, row)) {
|
|
63671
|
+
const isPivotTable = null === (_f = (_e = this.table).isPivotTable) || void 0 === _f ? void 0 : _f.call(_e),
|
|
63672
|
+
updateAggregationOnEditCell = !!isPivotTable && (null === (_h = null === (_g = this.table.internalProps) || void 0 === _g ? void 0 : _g.dataConfig) || void 0 === _h ? void 0 : _h.updateAggregationOnEditCell);
|
|
63733
63673
|
if (!isPivotTable || isPivotTable && updateAggregationOnEditCell) return;
|
|
63734
63674
|
}
|
|
63735
63675
|
const record = this.table.getCellRawRecord(col, row);
|
|
@@ -63748,9 +63688,9 @@
|
|
|
63748
63688
|
height: rect.height
|
|
63749
63689
|
}
|
|
63750
63690
|
};
|
|
63751
|
-
col === this.table.colCount - 1 ? referencePosition.rect.width = rect.width - 1 : referencePosition.rect.width = rect.width + 1, row === this.table.rowCount - 1 ? referencePosition.rect.height = rect.height - 1 : referencePosition.rect.height = rect.height + 1, editor.beginEditing, null === (
|
|
63691
|
+
col === this.table.colCount - 1 ? referencePosition.rect.width = rect.width - 1 : referencePosition.rect.width = rect.width + 1, row === this.table.rowCount - 1 ? referencePosition.rect.height = rect.height - 1 : referencePosition.rect.height = rect.height + 1, editor.beginEditing, null === (_j = editor.beginEditing) || void 0 === _j || _j.call(editor, this.table.getElement(), referencePosition, dataValue), editor.bindSuccessCallback, null === (_k = editor.bindSuccessCallback) || void 0 === _k || _k.call(editor, () => {
|
|
63752
63692
|
this.completeEdit();
|
|
63753
|
-
}), null === (
|
|
63693
|
+
}), null === (_l = editor.onStart) || void 0 === _l || _l.call(editor, {
|
|
63754
63694
|
value: dataValue,
|
|
63755
63695
|
endEdit: () => {
|
|
63756
63696
|
this.completeEdit();
|
|
@@ -63858,16 +63798,15 @@
|
|
|
63858
63798
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
63859
63799
|
});
|
|
63860
63800
|
};
|
|
63861
|
-
function listTableChangeCellValue(col, row, value, workOnEditableCell, triggerEvent, table
|
|
63801
|
+
function listTableChangeCellValue(col, row, value, workOnEditableCell, triggerEvent, table) {
|
|
63862
63802
|
if (workOnEditableCell && table.isHasEditorDefine(col, row) || !1 === workOnEditableCell) {
|
|
63863
|
-
const
|
|
63864
|
-
recordIndex = recordShowIndex >= 0 ? table.dataSource.getIndexKey(recordShowIndex) : void 0,
|
|
63803
|
+
const recordIndex = table.getRecordShowIndexByCell(col, row),
|
|
63865
63804
|
{
|
|
63866
63805
|
field: field
|
|
63867
63806
|
} = table.internalProps.layoutMap.getBody(col, row),
|
|
63868
63807
|
beforeChangeValue = table.getCellRawValue(col, row),
|
|
63869
63808
|
oldValue = table.getCellOriginValue(col, row);
|
|
63870
|
-
table.isHeader(col, row) ? table.internalProps.layoutMap.updateColumnTitle(col, row, value) : table.dataSource.changeFieldValue(value,
|
|
63809
|
+
table.isHeader(col, row) ? table.internalProps.layoutMap.updateColumnTitle(col, row, value) : table.dataSource.changeFieldValue(value, recordIndex, field, col, row, table);
|
|
63871
63810
|
const range = table.getCellRange(col, row),
|
|
63872
63811
|
aggregators = table.internalProps.layoutMap.getAggregatorsByCell(col, row);
|
|
63873
63812
|
if (aggregators) {
|
|
@@ -63890,24 +63829,16 @@
|
|
|
63890
63829
|
table.scenegraph.updateRowHeight(row, newHeight - oldHeight);
|
|
63891
63830
|
}
|
|
63892
63831
|
const changedValue = table.getCellOriginValue(col, row);
|
|
63893
|
-
|
|
63894
|
-
|
|
63895
|
-
|
|
63896
|
-
|
|
63897
|
-
|
|
63898
|
-
|
|
63899
|
-
|
|
63900
|
-
currentValue: oldValue,
|
|
63901
|
-
changedValue: changedValue
|
|
63902
|
-
};
|
|
63903
|
-
table.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUE, changeValue), silentChangeCellValuesEvent || table.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUES, {
|
|
63904
|
-
values: [changeValue]
|
|
63905
|
-
});
|
|
63906
|
-
}
|
|
63907
|
-
table.scenegraph.updateNextFrame();
|
|
63832
|
+
oldValue !== changedValue && triggerEvent && table.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUE, {
|
|
63833
|
+
col: col,
|
|
63834
|
+
row: row,
|
|
63835
|
+
rawValue: beforeChangeValue,
|
|
63836
|
+
currentValue: oldValue,
|
|
63837
|
+
changedValue: changedValue
|
|
63838
|
+
}), table.scenegraph.updateNextFrame();
|
|
63908
63839
|
}
|
|
63909
63840
|
}
|
|
63910
|
-
function listTableChangeCellValues(startCol, startRow, values, workOnEditableCell, triggerEvent, table
|
|
63841
|
+
function listTableChangeCellValues(startCol, startRow, values, workOnEditableCell, triggerEvent, table) {
|
|
63911
63842
|
var _a, _b;
|
|
63912
63843
|
return __awaiter(this, void 0, void 0, function* () {
|
|
63913
63844
|
const changedCellResults = [];
|
|
@@ -63929,7 +63860,6 @@
|
|
|
63929
63860
|
oldRowValues.push(oldValue);
|
|
63930
63861
|
}
|
|
63931
63862
|
}
|
|
63932
|
-
const resultChangeValues = [];
|
|
63933
63863
|
for (let i = 0; i < values.length && !(startRow + i > table.rowCount - 1); i++) {
|
|
63934
63864
|
changedCellResults[i] = [], pasteRowEnd = startRow + i;
|
|
63935
63865
|
const rowValues = values[i];
|
|
@@ -63953,34 +63883,25 @@
|
|
|
63953
63883
|
if (isCanChange) {
|
|
63954
63884
|
changedCellResults[i][j] = !0;
|
|
63955
63885
|
const value = rowValues[j],
|
|
63956
|
-
|
|
63957
|
-
recordIndex = recordShowIndex >= 0 ? table.dataSource.getIndexKey(recordShowIndex) : void 0,
|
|
63886
|
+
recordIndex = table.getRecordShowIndexByCell(startCol + j, startRow + i),
|
|
63958
63887
|
{
|
|
63959
63888
|
field: field
|
|
63960
63889
|
} = table.internalProps.layoutMap.getBody(startCol + j, startRow + i),
|
|
63961
63890
|
beforeChangeValue = beforeChangeValues[i][j],
|
|
63962
63891
|
oldValue = oldValues[i][j];
|
|
63963
|
-
table.isHeader(startCol + j, startRow + i) ? table.internalProps.layoutMap.updateColumnTitle(startCol + j, startRow + i, value) : table.dataSource.changeFieldValue(value,
|
|
63892
|
+
table.isHeader(startCol + j, startRow + i) ? table.internalProps.layoutMap.updateColumnTitle(startCol + j, startRow + i, value) : table.dataSource.changeFieldValue(value, recordIndex, field, startCol + j, startRow + i, table);
|
|
63964
63893
|
const changedValue = table.getCellOriginValue(startCol + j, startRow + i);
|
|
63965
|
-
|
|
63966
|
-
|
|
63967
|
-
|
|
63968
|
-
|
|
63969
|
-
|
|
63970
|
-
|
|
63971
|
-
|
|
63972
|
-
currentValue: oldValue,
|
|
63973
|
-
changedValue: changedValue
|
|
63974
|
-
};
|
|
63975
|
-
table.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUE, changeValue), resultChangeValues.push(changeValue);
|
|
63976
|
-
}
|
|
63894
|
+
oldValue !== changedValue && triggerEvent && table.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUE, {
|
|
63895
|
+
col: startCol + j,
|
|
63896
|
+
row: startRow + i,
|
|
63897
|
+
rawValue: beforeChangeValue,
|
|
63898
|
+
currentValue: oldValue,
|
|
63899
|
+
changedValue: changedValue
|
|
63900
|
+
});
|
|
63977
63901
|
} else changedCellResults[i][j] = !1;
|
|
63978
63902
|
}
|
|
63979
63903
|
pasteColEnd = Math.max(pasteColEnd, thisRowPasteColEnd);
|
|
63980
63904
|
}
|
|
63981
|
-
silentChangeCellValuesEvent || table.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUES, {
|
|
63982
|
-
values: resultChangeValues
|
|
63983
|
-
});
|
|
63984
63905
|
const startRange = table.getCellRange(startCol, startRow),
|
|
63985
63906
|
range = table.getCellRange(pasteColEnd, pasteRowEnd),
|
|
63986
63907
|
aggregators = table.internalProps.layoutMap.getAggregatorsByCellRange(startRange.start.col, startRange.start.row, range.end.col, range.end.row);
|
|
@@ -64014,58 +63935,6 @@
|
|
|
64014
63935
|
return table.scenegraph.updateNextFrame(), changedCellResults;
|
|
64015
63936
|
});
|
|
64016
63937
|
}
|
|
64017
|
-
function listTableChangeCellValuesByIds(ranges, value, workOnEditableCell, triggerEvent, table, silentChangeCellValuesEvent) {
|
|
64018
|
-
var _a, _b;
|
|
64019
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
64020
|
-
const resultChangeValues = [],
|
|
64021
|
-
processed = new Set(),
|
|
64022
|
-
nextValue = null != value ? value : "";
|
|
64023
|
-
for (let i = 0; i < (null !== (_a = null == ranges ? void 0 : ranges.length) && void 0 !== _a ? _a : 0); i++) {
|
|
64024
|
-
const range = ranges[i],
|
|
64025
|
-
startCol = Math.min(range.start.col, range.end.col),
|
|
64026
|
-
endCol = Math.max(range.start.col, range.end.col),
|
|
64027
|
-
startRow = Math.min(range.start.row, range.end.row),
|
|
64028
|
-
endRow = Math.max(range.start.row, range.end.row);
|
|
64029
|
-
if (startCol > endCol || startRow > endRow) continue;
|
|
64030
|
-
const values = [],
|
|
64031
|
-
oldValues = [];
|
|
64032
|
-
for (let row = startRow; row <= endRow; row++) {
|
|
64033
|
-
const rowValues = [],
|
|
64034
|
-
rowOldValues = [];
|
|
64035
|
-
for (let col = startCol; col <= endCol; col++) rowValues.push(nextValue), rowOldValues.push(table.getCellOriginValue(col, row));
|
|
64036
|
-
values.push(rowValues), oldValues.push(rowOldValues);
|
|
64037
|
-
}
|
|
64038
|
-
const changedCellResults = yield listTableChangeCellValues(startCol, startRow, values, workOnEditableCell, triggerEvent, table, !0);
|
|
64039
|
-
for (let r = 0; r < values.length; r++) for (let c = 0; c < values[r].length; c++) {
|
|
64040
|
-
const col = startCol + c,
|
|
64041
|
-
row = startRow + r,
|
|
64042
|
-
key = `${col},${row}`;
|
|
64043
|
-
if (processed.has(key)) continue;
|
|
64044
|
-
if (processed.add(key), !triggerEvent || !(null === (_b = null == changedCellResults ? void 0 : changedCellResults[r]) || void 0 === _b ? void 0 : _b[c])) continue;
|
|
64045
|
-
const oldValue = oldValues[r][c],
|
|
64046
|
-
changedValue = table.getCellOriginValue(col, row);
|
|
64047
|
-
if (oldValue === changedValue) continue;
|
|
64048
|
-
const recordShowIndex = table.getRecordShowIndexByCell(col, row),
|
|
64049
|
-
recordIndex = recordShowIndex >= 0 ? table.dataSource.getIndexKey(recordShowIndex) : void 0,
|
|
64050
|
-
{
|
|
64051
|
-
field: field
|
|
64052
|
-
} = table.internalProps.layoutMap.getBody(col, row);
|
|
64053
|
-
resultChangeValues.push({
|
|
64054
|
-
col: col,
|
|
64055
|
-
row: row,
|
|
64056
|
-
recordIndex: recordIndex,
|
|
64057
|
-
field: field,
|
|
64058
|
-
rawValue: oldValue,
|
|
64059
|
-
currentValue: oldValue,
|
|
64060
|
-
changedValue: changedValue
|
|
64061
|
-
});
|
|
64062
|
-
}
|
|
64063
|
-
}
|
|
64064
|
-
!silentChangeCellValuesEvent && triggerEvent && table.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUES, {
|
|
64065
|
-
values: resultChangeValues
|
|
64066
|
-
});
|
|
64067
|
-
});
|
|
64068
|
-
}
|
|
64069
63938
|
function getCellUpdateType(col, row, table, oldCellUpdateType) {
|
|
64070
63939
|
if ("group" === oldCellUpdateType) return oldCellUpdateType;
|
|
64071
63940
|
if ("sort" === oldCellUpdateType && !table.internalProps.groupBy) return oldCellUpdateType;
|
|
@@ -64083,16 +63952,13 @@
|
|
|
64083
63952
|
}), table.dataSource.sort(sortState));
|
|
64084
63953
|
}
|
|
64085
63954
|
function listTableAddRecord(record, recordIndex, table) {
|
|
64086
|
-
var _a, _b, _c, _d
|
|
63955
|
+
var _a, _b, _c, _d;
|
|
64087
63956
|
try {
|
|
64088
63957
|
if (!record) return !1;
|
|
64089
|
-
if (table.internalProps.groupBy) null === (_b = (_a = table.dataSource).addRecordsForGroup) || void 0 === _b || _b.call(_a, [record], recordIndex), table.refreshRowColCount(), table.internalProps.layoutMap.clearCellRangeMap(), table.sortState && sortRecords(table), table.scenegraph.clearCells(), table.scenegraph.createSceneGraph();else if ("tree" === table.dataSource.rowHierarchyType) null === (_d = (_c = table.dataSource).addRecordsForTree) || void 0 === _d || _d.call(_c, [record], recordIndex), adjustCheckBoxStateMapWithAddRecordIndex(table, recordIndex, 1), table.refreshRowColCount(), table.internalProps.layoutMap.clearCellRangeMap(), table.sortState && sortRecords(table), table.scenegraph.clearCells(), table.scenegraph.createSceneGraph();else if (table.sortState) {
|
|
64090
|
-
!!(null === (_e = table.options) || void 0 === _e ? void 0 : _e.syncRecordOperationsToSourceRecords) ? table.dataSource.addRecord(record, table.dataSource.records.length, !0) : table.dataSource.addRecordForSorted(record), table.stateManager.checkedState.clear(), sortRecords(table), table.refreshRowColCount(), table.scenegraph.clearCells(), table.scenegraph.createSceneGraph();
|
|
64091
|
-
} else {
|
|
63958
|
+
if (table.internalProps.groupBy) null === (_b = (_a = table.dataSource).addRecordsForGroup) || void 0 === _b || _b.call(_a, [record], recordIndex), table.refreshRowColCount(), table.internalProps.layoutMap.clearCellRangeMap(), table.sortState && sortRecords(table), table.scenegraph.clearCells(), table.scenegraph.createSceneGraph();else if ("tree" === table.dataSource.rowHierarchyType) null === (_d = (_c = table.dataSource).addRecordsForTree) || void 0 === _d || _d.call(_c, [record], recordIndex), adjustCheckBoxStateMapWithAddRecordIndex(table, recordIndex, 1), table.refreshRowColCount(), table.internalProps.layoutMap.clearCellRangeMap(), table.sortState && sortRecords(table), table.scenegraph.clearCells(), table.scenegraph.createSceneGraph();else if (table.sortState) table.dataSource.addRecordForSorted(record), table.stateManager.checkedState.clear(), sortRecords(table), table.refreshRowColCount(), table.scenegraph.clearCells(), table.scenegraph.createSceneGraph();else {
|
|
64092
63959
|
(void 0 === recordIndex || recordIndex > table.dataSource.sourceLength) && (recordIndex = table.dataSource.sourceLength);
|
|
64093
|
-
const headerCount = table.transpose ? table.rowHeaderLevelCount : table.columnHeaderLevelCount
|
|
64094
|
-
|
|
64095
|
-
if (table.dataSource.addRecord(record, recordIndex, syncToOriginalRecords), adjustCheckBoxStateMapWithAddRecordIndex(table, recordIndex, 1), syncToOriginalRecords) return table.refreshRowColCount(), table.internalProps.layoutMap.clearCellRangeMap(), table.scenegraph.clearCells(), table.scenegraph.createSceneGraph(), !0;
|
|
63960
|
+
const headerCount = table.transpose ? table.rowHeaderLevelCount : table.columnHeaderLevelCount;
|
|
63961
|
+
table.dataSource.addRecord(record, recordIndex), adjustCheckBoxStateMapWithAddRecordIndex(table, recordIndex, 1);
|
|
64096
63962
|
const oldRowCount = table.rowCount;
|
|
64097
63963
|
if (table.refreshRowColCount(), 0 === table.scenegraph.proxy.totalActualBodyRowCount) return table.scenegraph.clearCells(), table.scenegraph.createSceneGraph(), !0;
|
|
64098
63964
|
const newRowCount = table.transpose ? table.colCount : table.rowCount;
|
|
@@ -64161,16 +64027,13 @@
|
|
|
64161
64027
|
}
|
|
64162
64028
|
}
|
|
64163
64029
|
function listTableAddRecords(records, recordIndex, table) {
|
|
64164
|
-
var _a, _b, _c, _d
|
|
64030
|
+
var _a, _b, _c, _d;
|
|
64165
64031
|
try {
|
|
64166
64032
|
if (!records || 0 === records.length) return !1;
|
|
64167
|
-
if (table.internalProps.groupBy) null === (_b = (_a = table.dataSource).addRecordsForGroup) || void 0 === _b || _b.call(_a, records, recordIndex), table.refreshRowColCount(), table.internalProps.layoutMap.clearCellRangeMap(), table.sortState && sortRecords(table), table.scenegraph.clearCells(), table.scenegraph.createSceneGraph();else if ("tree" === table.dataSource.rowHierarchyType) null === (_d = (_c = table.dataSource).addRecordsForTree) || void 0 === _d || _d.call(_c, records, recordIndex), adjustCheckBoxStateMapWithAddRecordIndex(table, recordIndex, records.length), table.refreshRowColCount(), table.internalProps.layoutMap.clearCellRangeMap(), table.sortState && sortRecords(table), table.scenegraph.clearCells(), table.scenegraph.createSceneGraph();else if (table.sortState) {
|
|
64168
|
-
!!(null === (_e = table.options) || void 0 === _e ? void 0 : _e.syncRecordOperationsToSourceRecords) ? table.dataSource.addRecords(records, table.dataSource.records.length, !0) : table.dataSource.addRecordsForSorted(records), sortRecords(table), table.refreshRowColCount(), table.scenegraph.clearCells(), table.scenegraph.createSceneGraph();
|
|
64169
|
-
} else {
|
|
64033
|
+
if (table.internalProps.groupBy) null === (_b = (_a = table.dataSource).addRecordsForGroup) || void 0 === _b || _b.call(_a, records, recordIndex), table.refreshRowColCount(), table.internalProps.layoutMap.clearCellRangeMap(), table.sortState && sortRecords(table), table.scenegraph.clearCells(), table.scenegraph.createSceneGraph();else if ("tree" === table.dataSource.rowHierarchyType) null === (_d = (_c = table.dataSource).addRecordsForTree) || void 0 === _d || _d.call(_c, records, recordIndex), adjustCheckBoxStateMapWithAddRecordIndex(table, recordIndex, records.length), table.refreshRowColCount(), table.internalProps.layoutMap.clearCellRangeMap(), table.sortState && sortRecords(table), table.scenegraph.clearCells(), table.scenegraph.createSceneGraph();else if (table.sortState) table.dataSource.addRecordsForSorted(records), sortRecords(table), table.refreshRowColCount(), table.scenegraph.clearCells(), table.scenegraph.createSceneGraph();else {
|
|
64170
64034
|
void 0 === recordIndex || recordIndex > table.dataSource.sourceLength ? recordIndex = table.dataSource.sourceLength : recordIndex < 0 && (recordIndex = 0);
|
|
64171
|
-
const headerCount = table.transpose ? table.rowHeaderLevelCount : table.columnHeaderLevelCount
|
|
64172
|
-
|
|
64173
|
-
if (table.dataSource.addRecords(records, recordIndex, syncToOriginalRecords), adjustCheckBoxStateMapWithAddRecordIndex(table, recordIndex, records.length), syncToOriginalRecords) return table.refreshRowColCount(), table.internalProps.layoutMap.clearCellRangeMap(), table.scenegraph.clearCells(), table.scenegraph.createSceneGraph(), !0;
|
|
64035
|
+
const headerCount = table.transpose ? table.rowHeaderLevelCount : table.columnHeaderLevelCount;
|
|
64036
|
+
table.dataSource.addRecords(records, recordIndex), adjustCheckBoxStateMapWithAddRecordIndex(table, recordIndex, records.length);
|
|
64174
64037
|
const oldRowCount = table.transpose ? table.colCount : table.rowCount;
|
|
64175
64038
|
if (table.refreshRowColCount(), 0 === table.scenegraph.proxy.totalActualBodyRowCount) return table.scenegraph.clearCells(), table.scenegraph.createSceneGraph(), !0;
|
|
64176
64039
|
const newRowCount = table.transpose ? table.colCount : table.rowCount;
|
|
@@ -64239,20 +64102,16 @@
|
|
|
64239
64102
|
}
|
|
64240
64103
|
}
|
|
64241
64104
|
function listTableDeleteRecords(recordIndexs, table) {
|
|
64242
|
-
var _a, _b, _c, _d, _e, _f, _g, _h
|
|
64105
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
64243
64106
|
if ((null == recordIndexs ? void 0 : recordIndexs.length) > 0) if (table.internalProps.groupBy) null === (_b = (_a = table.dataSource).deleteRecordsForGroup) || void 0 === _b || _b.call(_a, recordIndexs), table.refreshRowColCount(), table.internalProps.layoutMap.clearCellRangeMap(), table.sortState && sortRecords(table), table.scenegraph.clearCells(), table.scenegraph.createSceneGraph();else if ("tree" === table.dataSource.rowHierarchyType) {
|
|
64244
64107
|
const deletedRecordIndexs = null === (_d = (_c = table.dataSource).deleteRecordsForTree) || void 0 === _d ? void 0 : _d.call(_c, recordIndexs);
|
|
64245
64108
|
if (0 === deletedRecordIndexs.length) return;
|
|
64246
64109
|
for (let index = 0; index < deletedRecordIndexs.length; index++) adjustCheckBoxStateMapWithDeleteRecordIndex(table, deletedRecordIndexs[index], 1);
|
|
64247
64110
|
table.refreshRowColCount(), table.internalProps.layoutMap.clearCellRangeMap(), table.sortState && sortRecords(table), table.scenegraph.clearCells(), table.scenegraph.createSceneGraph();
|
|
64248
|
-
} else if (table.sortState) {
|
|
64249
|
-
|
|
64250
|
-
} else {
|
|
64251
|
-
const syncToOriginalRecords = !!(null === (_f = table.options) || void 0 === _f ? void 0 : _f.syncRecordOperationsToSourceRecords),
|
|
64252
|
-
deletedRecordIndexs = table.dataSource.deleteRecords(recordIndexs, syncToOriginalRecords);
|
|
64111
|
+
} else if (table.sortState) table.dataSource.deleteRecordsForSorted(recordIndexs), sortRecords(table), table.refreshRowColCount(), table.scenegraph.clearCells(), table.scenegraph.createSceneGraph();else {
|
|
64112
|
+
const deletedRecordIndexs = table.dataSource.deleteRecords(recordIndexs);
|
|
64253
64113
|
if (0 === deletedRecordIndexs.length) return;
|
|
64254
64114
|
for (let index = 0; index < deletedRecordIndexs.length; index++) adjustCheckBoxStateMapWithDeleteRecordIndex(table, deletedRecordIndexs[index], 1);
|
|
64255
|
-
if (syncToOriginalRecords) return table.refreshRowColCount(), table.internalProps.layoutMap.clearCellRangeMap(), table.scenegraph.clearCells(), void table.scenegraph.createSceneGraph();
|
|
64256
64115
|
const oldRowCount = table.transpose ? table.colCount : table.rowCount;
|
|
64257
64116
|
table.refreshRowColCount();
|
|
64258
64117
|
const newRowCount = table.transpose ? table.colCount : table.rowCount,
|
|
@@ -64290,7 +64149,7 @@
|
|
|
64290
64149
|
col: 0,
|
|
64291
64150
|
row: row
|
|
64292
64151
|
});
|
|
64293
|
-
null === (
|
|
64152
|
+
null === (_e = table.reactCustomLayout) || void 0 === _e || _e.clearCache(), table.transpose ? table.scenegraph.updateCol(delRows, [], updateRows) : table.scenegraph.updateRow(delRows, [], updateRows), null === (_f = table.reactCustomLayout) || void 0 === _f || _f.updateAllCustomCell();
|
|
64294
64153
|
}
|
|
64295
64154
|
} else {
|
|
64296
64155
|
const delRows = [],
|
|
@@ -64322,19 +64181,15 @@
|
|
|
64322
64181
|
col: 0,
|
|
64323
64182
|
row: row
|
|
64324
64183
|
});
|
|
64325
|
-
null === (
|
|
64184
|
+
null === (_g = table.reactCustomLayout) || void 0 === _g || _g.clearCache(), table.transpose ? table.scenegraph.updateCol(delRows, [], updateRows) : table.scenegraph.updateRow(delRows, [], updateRows), null === (_h = table.reactCustomLayout) || void 0 === _h || _h.updateAllCustomCell();
|
|
64326
64185
|
}
|
|
64327
64186
|
}
|
|
64328
64187
|
}
|
|
64329
64188
|
function listTableUpdateRecords(records, recordIndexs, table) {
|
|
64330
|
-
var _a, _b, _c, _d
|
|
64331
|
-
if ((null == recordIndexs ? void 0 : recordIndexs.length) > 0) if (table.internalProps.groupBy) null === (_b = (_a = table.dataSource).updateRecordsForGroup) || void 0 === _b || _b.call(_a, records, recordIndexs), table.refreshRowColCount(), table.internalProps.layoutMap.clearCellRangeMap(), table.sortState && sortRecords(table), table.scenegraph.clearCells(), table.scenegraph.createSceneGraph();else if ("tree" === table.dataSource.rowHierarchyType) null === (_d = (_c = table.dataSource).updateRecordsForTree) || void 0 === _d || _d.call(_c, records, recordIndexs), table.refreshRowColCount(), table.internalProps.layoutMap.clearCellRangeMap(), table.sortState && sortRecords(table), table.scenegraph.clearCells(), table.scenegraph.createSceneGraph();else if (table.sortState) {
|
|
64332
|
-
|
|
64333
|
-
} else {
|
|
64334
|
-
const syncToOriginalRecords = !!(null === (_f = table.options) || void 0 === _f ? void 0 : _f.syncRecordOperationsToSourceRecords),
|
|
64335
|
-
updateRecordIndexs = table.dataSource.updateRecords(records, recordIndexs, syncToOriginalRecords);
|
|
64189
|
+
var _a, _b, _c, _d;
|
|
64190
|
+
if ((null == recordIndexs ? void 0 : recordIndexs.length) > 0) if (table.internalProps.groupBy) null === (_b = (_a = table.dataSource).updateRecordsForGroup) || void 0 === _b || _b.call(_a, records, recordIndexs), table.refreshRowColCount(), table.internalProps.layoutMap.clearCellRangeMap(), table.sortState && sortRecords(table), table.scenegraph.clearCells(), table.scenegraph.createSceneGraph();else if ("tree" === table.dataSource.rowHierarchyType) null === (_d = (_c = table.dataSource).updateRecordsForTree) || void 0 === _d || _d.call(_c, records, recordIndexs), table.refreshRowColCount(), table.internalProps.layoutMap.clearCellRangeMap(), table.sortState && sortRecords(table), table.scenegraph.clearCells(), table.scenegraph.createSceneGraph();else if (table.sortState) table.dataSource.updateRecordsForSorted(records, recordIndexs), sortRecords(table), table.refreshRowColCount(), table.scenegraph.clearCells(), table.scenegraph.createSceneGraph();else {
|
|
64191
|
+
const updateRecordIndexs = table.dataSource.updateRecords(records, recordIndexs);
|
|
64336
64192
|
if (0 === updateRecordIndexs.length) return;
|
|
64337
|
-
if (syncToOriginalRecords) return table.refreshRowColCount(), table.internalProps.layoutMap.clearCellRangeMap(), table.scenegraph.clearCells(), void table.scenegraph.createSceneGraph();
|
|
64338
64193
|
const recordIndexsMinToMax = updateRecordIndexs.map(index => table.getBodyRowIndexByRecordIndex(index)).sort((a, b) => a - b);
|
|
64339
64194
|
if (table.pagination) {
|
|
64340
64195
|
const {
|
|
@@ -65100,8 +64955,8 @@
|
|
|
65100
64955
|
updateFilterRules(filterRules, options = {
|
|
65101
64956
|
clearRowHeightCache: !0
|
|
65102
64957
|
}) {
|
|
65103
|
-
var _a
|
|
65104
|
-
this.scenegraph.clearCells(),
|
|
64958
|
+
var _a;
|
|
64959
|
+
this.scenegraph.clearCells(), this.sortState ? (this.dataSource.updateFilterRulesForSorted(filterRules), sortRecords(this)) : this.dataSource.updateFilterRules(filterRules, null == options ? void 0 : options.onFilterRecordsEnd), this.refreshRowColCount(), this.stateManager.initCheckedState(this.records), this.scenegraph.createSceneGraph(!(null == options ? void 0 : options.clearRowHeightCache)), null === (_a = this.internalProps.emptyTip) || void 0 === _a || _a.resetVisible(), this.resize();
|
|
65105
64960
|
}
|
|
65106
64961
|
getFilteredRecords() {
|
|
65107
64962
|
return this.dataSource.records;
|
|
@@ -65243,165 +65098,43 @@
|
|
|
65243
65098
|
}
|
|
65244
65099
|
return isValid$1(editorDefine);
|
|
65245
65100
|
}
|
|
65246
|
-
changeCellValue(col, row, value, workOnEditableCell = !1, triggerEvent = !0
|
|
65247
|
-
return listTableChangeCellValue(col, row, value, workOnEditableCell, triggerEvent, this
|
|
65248
|
-
}
|
|
65249
|
-
changeCellValues(startCol, startRow, values, workOnEditableCell = !1, triggerEvent = !0, silentChangeCellValuesEvent) {
|
|
65250
|
-
return listTableChangeCellValues(startCol, startRow, values, workOnEditableCell, triggerEvent, this, silentChangeCellValuesEvent);
|
|
65251
|
-
}
|
|
65252
|
-
changeCellValuesByIds(ranges, value, workOnEditableCell = !1, triggerEvent = !0, silentChangeCellValuesEvent) {
|
|
65253
|
-
return listTableChangeCellValuesByIds(ranges, value, workOnEditableCell, triggerEvent, this, silentChangeCellValuesEvent);
|
|
65254
|
-
}
|
|
65255
|
-
changeSourceCellValue(recordIndex, field, value) {
|
|
65256
|
-
const tableIndex = this.getTableIndexByRecordIndex(recordIndex),
|
|
65257
|
-
cellAddr = this.getCellAddrByFieldRecord(field, recordIndex);
|
|
65258
|
-
if (tableIndex < 0 || cellAddr.col < 0 || cellAddr.row < 0) return;
|
|
65259
|
-
this.dataSource.changeFieldValue(value, tableIndex, field, cellAddr.col, cellAddr.row, this);
|
|
65260
|
-
const beforeChangeValue = this.getCellRawValue(cellAddr.col, cellAddr.row),
|
|
65261
|
-
oldValue = this.getCellOriginValue(cellAddr.col, cellAddr.row),
|
|
65262
|
-
changedValue = this.getCellOriginValue(cellAddr.col, cellAddr.row);
|
|
65263
|
-
if (oldValue !== changedValue) {
|
|
65264
|
-
const changeValue = {
|
|
65265
|
-
col: cellAddr.col,
|
|
65266
|
-
row: cellAddr.row,
|
|
65267
|
-
recordIndex: recordIndex,
|
|
65268
|
-
field: field,
|
|
65269
|
-
rawValue: beforeChangeValue,
|
|
65270
|
-
currentValue: oldValue,
|
|
65271
|
-
changedValue: changedValue
|
|
65272
|
-
};
|
|
65273
|
-
this.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUE, changeValue), this.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUES, {
|
|
65274
|
-
values: [changeValue]
|
|
65275
|
-
});
|
|
65276
|
-
}
|
|
65277
|
-
}
|
|
65278
|
-
changeCellValueByRecord(recordIndex, field, value, options) {
|
|
65279
|
-
var _a, _b, _c, _d, _e;
|
|
65280
|
-
const triggerEvent = null === (_a = null == options ? void 0 : options.triggerEvent) || void 0 === _a || _a,
|
|
65281
|
-
silentChangeCellValuesEvent = null == options ? void 0 : options.silentChangeCellValuesEvent,
|
|
65282
|
-
autoRefresh = null === (_b = null == options ? void 0 : options.autoRefresh) || void 0 === _b || _b,
|
|
65283
|
-
records = null === (_c = this.dataSource.dataSourceObj) || void 0 === _c ? void 0 : _c.records;
|
|
65284
|
-
let record, oldValue;
|
|
65285
|
-
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;
|
|
65286
|
-
const changedValue = !record || "string" != typeof field && "number" != typeof field ? value : null == record ? void 0 : record[field];
|
|
65287
|
-
if (oldValue !== changedValue) {
|
|
65288
|
-
const cellAddr = this.getCellAddrByFieldRecord(field, recordIndex),
|
|
65289
|
-
changeValue = {
|
|
65290
|
-
col: null !== (_d = null == cellAddr ? void 0 : cellAddr.col) && void 0 !== _d ? _d : -1,
|
|
65291
|
-
row: null !== (_e = null == cellAddr ? void 0 : cellAddr.row) && void 0 !== _e ? _e : -1,
|
|
65292
|
-
recordIndex: recordIndex,
|
|
65293
|
-
field: field,
|
|
65294
|
-
rawValue: oldValue,
|
|
65295
|
-
currentValue: oldValue,
|
|
65296
|
-
changedValue: changedValue
|
|
65297
|
-
};
|
|
65298
|
-
this.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUE, changeValue), silentChangeCellValuesEvent || this.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUES, {
|
|
65299
|
-
values: [changeValue]
|
|
65300
|
-
});
|
|
65301
|
-
}
|
|
65302
|
-
autoRefresh && this.refreshAfterSourceChange();
|
|
65101
|
+
changeCellValue(col, row, value, workOnEditableCell = !1, triggerEvent = !0) {
|
|
65102
|
+
return listTableChangeCellValue(col, row, value, workOnEditableCell, triggerEvent, this);
|
|
65303
65103
|
}
|
|
65304
|
-
|
|
65305
|
-
return
|
|
65306
|
-
triggerEvent: triggerEvent,
|
|
65307
|
-
silentChangeCellValuesEvent: silentChangeCellValuesEvent,
|
|
65308
|
-
autoRefresh: !0
|
|
65309
|
-
});
|
|
65310
|
-
}
|
|
65311
|
-
changeCellValuesByRecords(changeValues, options) {
|
|
65312
|
-
var _a, _b, _c, _d, _e, _f, _g;
|
|
65313
|
-
const triggerEvent = null === (_a = null == options ? void 0 : options.triggerEvent) || void 0 === _a || _a,
|
|
65314
|
-
silentChangeCellValuesEvent = null == options ? void 0 : options.silentChangeCellValuesEvent,
|
|
65315
|
-
autoRefresh = null === (_b = null == options ? void 0 : options.autoRefresh) || void 0 === _b || _b,
|
|
65316
|
-
resultChangeValues = [];
|
|
65317
|
-
for (let i = 0; i < changeValues.length; i++) {
|
|
65318
|
-
const {
|
|
65319
|
-
recordIndex: recordIndex,
|
|
65320
|
-
field: field,
|
|
65321
|
-
value: value
|
|
65322
|
-
} = changeValues[i],
|
|
65323
|
-
records = null === (_c = this.dataSource.dataSourceObj) || void 0 === _c ? void 0 : _c.records;
|
|
65324
|
-
let record, oldValue;
|
|
65325
|
-
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) {
|
|
65326
|
-
const changedValue = !record || "string" != typeof field && "number" != typeof field ? value : null == record ? void 0 : record[field];
|
|
65327
|
-
if (oldValue !== changedValue) {
|
|
65328
|
-
const changeValue = {
|
|
65329
|
-
col: null !== (_e = null === (_d = this.getCellAddrByFieldRecord(field, recordIndex)) || void 0 === _d ? void 0 : _d.col) && void 0 !== _e ? _e : -1,
|
|
65330
|
-
row: null !== (_g = null === (_f = this.getCellAddrByFieldRecord(field, recordIndex)) || void 0 === _f ? void 0 : _f.row) && void 0 !== _g ? _g : -1,
|
|
65331
|
-
recordIndex: recordIndex,
|
|
65332
|
-
field: field,
|
|
65333
|
-
rawValue: oldValue,
|
|
65334
|
-
currentValue: oldValue,
|
|
65335
|
-
changedValue: changedValue
|
|
65336
|
-
};
|
|
65337
|
-
this.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUE, changeValue), resultChangeValues.push(changeValue);
|
|
65338
|
-
}
|
|
65339
|
-
}
|
|
65340
|
-
}
|
|
65341
|
-
!silentChangeCellValuesEvent && resultChangeValues.length && triggerEvent && this.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUES, {
|
|
65342
|
-
values: resultChangeValues
|
|
65343
|
-
}), autoRefresh && this.refreshAfterSourceChange();
|
|
65344
|
-
}
|
|
65345
|
-
changeCellValuesBySource(changeValues, triggerEvent = !0, silentChangeCellValuesEvent) {
|
|
65346
|
-
return this.changeCellValuesByRecords(changeValues, {
|
|
65347
|
-
triggerEvent: triggerEvent,
|
|
65348
|
-
silentChangeCellValuesEvent: silentChangeCellValuesEvent,
|
|
65349
|
-
autoRefresh: !0
|
|
65350
|
-
});
|
|
65351
|
-
}
|
|
65352
|
-
refreshAfterSourceChange(options) {
|
|
65353
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
65354
|
-
const reapplyFilter = null === (_a = null == options ? void 0 : options.reapplyFilter) || void 0 === _a || _a,
|
|
65355
|
-
reapplySort = null === (_b = null == options ? void 0 : options.reapplySort) || void 0 === _b || _b,
|
|
65356
|
-
clearRowHeightCache = null === (_c = null == options ? void 0 : options.clearRowHeightCache) || void 0 === _c || _c;
|
|
65357
|
-
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);
|
|
65358
|
-
const traverseColumns = columns => {
|
|
65359
|
-
var _a, _b, _c, _d;
|
|
65360
|
-
for (let i = 0; i < (null !== (_a = null == columns ? void 0 : columns.length) && void 0 !== _a ? _a : 0); i++) {
|
|
65361
|
-
const column = columns[i],
|
|
65362
|
-
aggregators = null == column ? void 0 : column.vtable_aggregator;
|
|
65363
|
-
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);
|
|
65364
|
-
(null == column ? void 0 : column.columns) && traverseColumns(column.columns);
|
|
65365
|
-
}
|
|
65366
|
-
};
|
|
65367
|
-
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();
|
|
65104
|
+
changeCellValues(startCol, startRow, values, workOnEditableCell = !1, triggerEvent = !0) {
|
|
65105
|
+
return listTableChangeCellValues(startCol, startRow, values, workOnEditableCell, triggerEvent, this);
|
|
65368
65106
|
}
|
|
65369
|
-
addRecord(record, recordIndex
|
|
65107
|
+
addRecord(record, recordIndex) {
|
|
65370
65108
|
var _a;
|
|
65371
65109
|
const success = listTableAddRecord(record, recordIndex, this);
|
|
65372
|
-
adjustHeightResizedRowMapWithAddRecordIndex(this, recordIndex, [record]), null === (_a = this.internalProps.emptyTip) || void 0 === _a || _a.resetVisible(),
|
|
65110
|
+
adjustHeightResizedRowMapWithAddRecordIndex(this, recordIndex, [record]), null === (_a = this.internalProps.emptyTip) || void 0 === _a || _a.resetVisible(), success && this.fireListeners(TABLE_EVENT_TYPE.ADD_RECORD, {
|
|
65373
65111
|
records: [record],
|
|
65374
65112
|
recordIndex: recordIndex,
|
|
65375
65113
|
recordCount: 1
|
|
65376
65114
|
});
|
|
65377
65115
|
}
|
|
65378
|
-
addRecords(records, recordIndex
|
|
65116
|
+
addRecords(records, recordIndex) {
|
|
65379
65117
|
var _a;
|
|
65380
65118
|
const success = listTableAddRecords(records, recordIndex, this);
|
|
65381
|
-
"number" == typeof recordIndex && adjustHeightResizedRowMapWithAddRecordIndex(this, recordIndex, records), null === (_a = this.internalProps.emptyTip) || void 0 === _a || _a.resetVisible(),
|
|
65119
|
+
"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, {
|
|
65382
65120
|
records: records,
|
|
65383
65121
|
recordIndex: recordIndex,
|
|
65384
65122
|
recordCount: records.length
|
|
65385
65123
|
});
|
|
65386
65124
|
}
|
|
65387
|
-
deleteRecords(recordIndexs
|
|
65125
|
+
deleteRecords(recordIndexs) {
|
|
65388
65126
|
var _a;
|
|
65389
|
-
|
|
65390
|
-
(null == recordIndexs ? void 0 : recordIndexs.length) > 0 && recordIndexs.forEach(index => {
|
|
65391
|
-
let record = null;
|
|
65392
|
-
record = "number" == typeof index ? this.dataSource.get(index) : [], deletedRecords.push(record);
|
|
65393
|
-
}), listTableDeleteRecords(recordIndexs, this), adjustHeightResizedRowMapWithDeleteRecordIndex(this, recordIndexs), null === (_a = this.internalProps.emptyTip) || void 0 === _a || _a.resetVisible();
|
|
65127
|
+
listTableDeleteRecords(recordIndexs, this), adjustHeightResizedRowMapWithDeleteRecordIndex(this, recordIndexs), null === (_a = this.internalProps.emptyTip) || void 0 === _a || _a.resetVisible();
|
|
65394
65128
|
const rowIndexs = [];
|
|
65395
65129
|
for (let i = 0; i < recordIndexs.length; i++) rowIndexs.push(this.getBodyRowIndexByRecordIndex(recordIndexs[i]) + this.columnHeaderLevelCount);
|
|
65396
|
-
|
|
65130
|
+
this.fireListeners(TABLE_EVENT_TYPE.DELETE_RECORD, {
|
|
65397
65131
|
recordIndexs: recordIndexs,
|
|
65398
|
-
records: deletedRecords,
|
|
65399
65132
|
rowIndexs: rowIndexs,
|
|
65400
65133
|
deletedCount: (Array.isArray(recordIndexs[0]), recordIndexs.length)
|
|
65401
65134
|
});
|
|
65402
65135
|
}
|
|
65403
|
-
updateRecords(records, recordIndexs
|
|
65404
|
-
listTableUpdateRecords(records, recordIndexs, this),
|
|
65136
|
+
updateRecords(records, recordIndexs) {
|
|
65137
|
+
listTableUpdateRecords(records, recordIndexs, this), this.fireListeners(TABLE_EVENT_TYPE.UPDATE_RECORD, {
|
|
65405
65138
|
records: records,
|
|
65406
65139
|
recordIndexs: recordIndexs,
|
|
65407
65140
|
updateCount: records.length
|
|
@@ -76559,7 +76292,7 @@
|
|
|
76559
76292
|
PluginManager: PluginManager
|
|
76560
76293
|
});
|
|
76561
76294
|
|
|
76562
|
-
const version = "1.22.11
|
|
76295
|
+
const version = "1.22.11";
|
|
76563
76296
|
|
|
76564
76297
|
exports.Gantt = Gantt;
|
|
76565
76298
|
exports.TYPES = index$4;
|