@visactor/vtable-sheet 1.22.11-alpha.5 → 1.22.11-alpha.7
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/index.d.ts +1 -1
- package/cjs/index.js +1 -1
- package/cjs/index.js.map +1 -1
- package/dist/vtable-sheet.js +163 -71
- package/dist/vtable-sheet.min.js +1 -1
- package/es/index.d.ts +1 -1
- package/es/index.js +1 -1
- package/es/index.js.map +1 -1
- package/package.json +6 -6
package/cjs/index.d.ts
CHANGED
|
@@ -2,5 +2,5 @@ import VTableSheet from './components/vtable-sheet';
|
|
|
2
2
|
import type { ISheetDefine, IVTableSheetOptions } from './ts-types';
|
|
3
3
|
import * as TYPES from './ts-types';
|
|
4
4
|
import * as VTable from './vtable';
|
|
5
|
-
export declare const version = "1.22.11-alpha.
|
|
5
|
+
export declare const version = "1.22.11-alpha.7";
|
|
6
6
|
export { VTableSheet, TYPES, VTable, ISheetDefine, IVTableSheetOptions };
|
package/cjs/index.js
CHANGED
package/cjs/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6EAAoD;AAW3C,sBAXF,sBAAW,CAWE;AATpB,kDAAoC;AASd,sBAAK;AAR3B,iDAAmC;AAQN,wBAAM;AAPnC,0DAAsD;AACzC,QAAA,OAAO,GAAG,iBAAiB,CAAC;AAEzC,IAAA,4BAAY,GAAE,CAAC","file":"index.js","sourcesContent":["import VTableSheet from './components/vtable-sheet';\nimport type { ISheetDefine, IVTableSheetOptions } from './ts-types';\nimport * as TYPES from './ts-types';\nimport * as VTable from './vtable';\nimport { importStyles } from './styles/style-manager';\nexport const version = \"1.22.11-alpha.
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6EAAoD;AAW3C,sBAXF,sBAAW,CAWE;AATpB,kDAAoC;AASd,sBAAK;AAR3B,iDAAmC;AAQN,wBAAM;AAPnC,0DAAsD;AACzC,QAAA,OAAO,GAAG,iBAAiB,CAAC;AAEzC,IAAA,4BAAY,GAAE,CAAC","file":"index.js","sourcesContent":["import VTableSheet from './components/vtable-sheet';\nimport type { ISheetDefine, IVTableSheetOptions } from './ts-types';\nimport * as TYPES from './ts-types';\nimport * as VTable from './vtable';\nimport { importStyles } from './styles/style-manager';\nexport const version = \"1.22.11-alpha.7\";\n// 导入样式\nimportStyles();\n/**\n * @namespace VTableSheet\n */\nexport { VTableSheet, TYPES, VTable, ISheetDefine, IVTableSheetOptions };\n"]}
|
package/dist/vtable-sheet.js
CHANGED
|
@@ -39849,6 +39849,9 @@
|
|
|
39849
39849
|
var _a;
|
|
39850
39850
|
return null !== (_a = defaultStyle.textAlign) && void 0 !== _a ? _a : "left";
|
|
39851
39851
|
},
|
|
39852
|
+
get textStickBaseOnAlign() {
|
|
39853
|
+
return defaultStyle.textStickBaseOnAlign;
|
|
39854
|
+
},
|
|
39852
39855
|
get textBaseline() {
|
|
39853
39856
|
var _a;
|
|
39854
39857
|
return null !== (_a = defaultStyle.textBaseline) && void 0 !== _a ? _a : "middle";
|
|
@@ -40532,6 +40535,9 @@
|
|
|
40532
40535
|
get textStick() {
|
|
40533
40536
|
return style.textStick;
|
|
40534
40537
|
},
|
|
40538
|
+
get textStickBaseOnAlign() {
|
|
40539
|
+
return style.textStickBaseOnAlign;
|
|
40540
|
+
},
|
|
40535
40541
|
get marked() {
|
|
40536
40542
|
return style.marked;
|
|
40537
40543
|
},
|
|
@@ -40988,41 +40994,82 @@
|
|
|
40988
40994
|
Array.isArray(indexed) || this.records.splice(indexed, 1, record);
|
|
40989
40995
|
}
|
|
40990
40996
|
}
|
|
40991
|
-
|
|
40997
|
+
_getRawRecordsArray() {
|
|
40992
40998
|
var _a;
|
|
40993
|
-
|
|
40994
|
-
|
|
40995
|
-
|
|
40996
|
-
|
|
40997
|
-
|
|
40998
|
-
|
|
40999
|
-
|
|
41000
|
-
|
|
41001
|
-
|
|
41002
|
-
|
|
41003
|
-
|
|
41004
|
-
|
|
40999
|
+
const rawRecords = null === (_a = this.dataSourceObj) || void 0 === _a ? void 0 : _a.records;
|
|
41000
|
+
return Array.isArray(rawRecords) ? rawRecords : null;
|
|
41001
|
+
}
|
|
41002
|
+
_hasFilterInEffect() {
|
|
41003
|
+
var _a, _b, _c, _d, _e;
|
|
41004
|
+
return (null !== (_c = null === (_b = null === (_a = this.dataConfig) || void 0 === _a ? void 0 : _a.filterRules) || void 0 === _b ? void 0 : _b.length) && void 0 !== _c ? _c : 0) >= 1 || (null !== (_e = null === (_d = this.lastFilterRules) || void 0 === _d ? void 0 : _d.length) && void 0 !== _e ? _e : 0) >= 1;
|
|
41005
|
+
}
|
|
41006
|
+
_normalizeInsertIndex(index, length) {
|
|
41007
|
+
return null == index || index > length ? length : index < 0 ? 0 : index;
|
|
41008
|
+
}
|
|
41009
|
+
_mapViewInsertIndexToRawInsertIndex(rawRecords, viewIndex) {
|
|
41010
|
+
if (viewIndex >= this.records.length) return rawRecords.length;
|
|
41011
|
+
if (viewIndex <= 0) return 0;
|
|
41012
|
+
const prevRecord = this.records[viewIndex - 1],
|
|
41013
|
+
rawIndex = rawRecords.indexOf(prevRecord);
|
|
41014
|
+
return rawIndex >= 0 ? rawIndex + 1 : rawRecords.length;
|
|
41015
|
+
}
|
|
41016
|
+
_resetIndexingFromViewRecords() {
|
|
41017
|
+
if (this._sourceLength = this.records.length, this.currentIndexedData = Array.from({
|
|
41018
|
+
length: this._sourceLength
|
|
41019
|
+
}, (_, i) => i), "tree" === this.rowHierarchyType && this.initTreeHierarchyState(), this.userPagination) return this.pagination.totalCount = this._sourceLength, void this.updatePagerData();
|
|
41020
|
+
this.pagination.perPageCount = this._sourceLength, this.pagination.totalCount = this._sourceLength, this.updatePagerData();
|
|
41021
|
+
}
|
|
41022
|
+
addRecord(record, index, syncToOriginalRecords = !1) {
|
|
41023
|
+
var _a, _b, _c;
|
|
41024
|
+
if (!syncToOriginalRecords) {
|
|
41025
|
+
if (Array.isArray(this.records)) {
|
|
41026
|
+
this.records.splice(index, 0, record), this.adjustBeforeChangedRecordsMap(index, 1), this.currentIndexedData.push(this.currentIndexedData.length), this._sourceLength += 1;
|
|
41027
|
+
for (let i = 0; i < this.fieldAggregators.length; i++) this.fieldAggregators[i].push(record);
|
|
41028
|
+
if ("tree" === this.rowHierarchyType && this.initTreeHierarchyState(), this.userPagination) {
|
|
41029
|
+
this.pagination.totalCount = this._sourceLength;
|
|
41030
|
+
const {
|
|
41031
|
+
perPageCount: perPageCount,
|
|
41032
|
+
currentPage: currentPage
|
|
41033
|
+
} = this.pagination;
|
|
41034
|
+
index < perPageCount * (currentPage || 0) + perPageCount && this.updatePagerData();
|
|
41035
|
+
} else this.pagination.perPageCount = this._sourceLength, this.pagination.totalCount = this._sourceLength, this.updatePagerData();
|
|
41036
|
+
(null === (_a = this.dataSourceObj) || void 0 === _a ? void 0 : _a.added) && this.dataSourceObj.added(index, 1);
|
|
41037
|
+
}
|
|
41038
|
+
return;
|
|
41005
41039
|
}
|
|
41040
|
+
const rawRecords = this._getRawRecordsArray();
|
|
41041
|
+
if (!rawRecords) return;
|
|
41042
|
+
const viewInsertIndex = this._normalizeInsertIndex(index, this.records.length),
|
|
41043
|
+
rawInsertIndex = this._hasFilterInEffect() ? this._mapViewInsertIndexToRawInsertIndex(rawRecords, viewInsertIndex) : this._normalizeInsertIndex(viewInsertIndex, rawRecords.length);
|
|
41044
|
+
rawRecords.splice(rawInsertIndex, 0, 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);
|
|
41006
41045
|
}
|
|
41007
|
-
addRecords(recordArr, index) {
|
|
41008
|
-
var _a;
|
|
41009
|
-
if (
|
|
41010
|
-
if (Array.isArray(
|
|
41011
|
-
|
|
41012
|
-
|
|
41013
|
-
|
|
41014
|
-
|
|
41046
|
+
addRecords(recordArr, index, syncToOriginalRecords = !1) {
|
|
41047
|
+
var _a, _b, _c;
|
|
41048
|
+
if (!syncToOriginalRecords) {
|
|
41049
|
+
if (Array.isArray(this.records)) {
|
|
41050
|
+
if (Array.isArray(recordArr)) {
|
|
41051
|
+
this.records.splice(index, 0, ...recordArr), this.adjustBeforeChangedRecordsMap(index, recordArr.length);
|
|
41052
|
+
for (let i = 0; i < recordArr.length; i++) this.currentIndexedData.push(this.currentIndexedData.length);
|
|
41053
|
+
this._sourceLength += recordArr.length;
|
|
41054
|
+
for (let i = 0; i < this.fieldAggregators.length; i++) for (let j = 0; j < recordArr.length; j++) this.fieldAggregators[i].push(recordArr[j]);
|
|
41055
|
+
}
|
|
41056
|
+
if (this.userPagination) {
|
|
41057
|
+
this.pagination.totalCount = this._sourceLength;
|
|
41058
|
+
const {
|
|
41059
|
+
perPageCount: perPageCount,
|
|
41060
|
+
currentPage: currentPage
|
|
41061
|
+
} = this.pagination;
|
|
41062
|
+
index < perPageCount * (currentPage || 0) + perPageCount && this.updatePagerData();
|
|
41063
|
+
} else this.pagination.perPageCount = this._sourceLength, this.pagination.totalCount = this._sourceLength, this.updatePagerData();
|
|
41064
|
+
(null === (_a = this.dataSourceObj) || void 0 === _a ? void 0 : _a.added) && this.dataSourceObj.added(index, recordArr.length);
|
|
41015
41065
|
}
|
|
41016
|
-
|
|
41017
|
-
this.pagination.totalCount = this._sourceLength;
|
|
41018
|
-
const {
|
|
41019
|
-
perPageCount: perPageCount,
|
|
41020
|
-
currentPage: currentPage
|
|
41021
|
-
} = this.pagination;
|
|
41022
|
-
index < perPageCount * (currentPage || 0) + perPageCount && this.updatePagerData();
|
|
41023
|
-
} else this.pagination.perPageCount = this._sourceLength, this.pagination.totalCount = this._sourceLength, this.updatePagerData();
|
|
41024
|
-
(null === (_a = this.dataSourceObj) || void 0 === _a ? void 0 : _a.added) && this.dataSourceObj.added(index, recordArr.length);
|
|
41066
|
+
return;
|
|
41025
41067
|
}
|
|
41068
|
+
const rawRecords = this._getRawRecordsArray();
|
|
41069
|
+
if (!rawRecords || !Array.isArray(recordArr) || 0 === recordArr.length) return;
|
|
41070
|
+
const viewInsertIndex = this._normalizeInsertIndex(index, this.records.length),
|
|
41071
|
+
rawInsertIndex = this._hasFilterInEffect() ? this._mapViewInsertIndexToRawInsertIndex(rawRecords, viewInsertIndex) : this._normalizeInsertIndex(viewInsertIndex, rawRecords.length);
|
|
41072
|
+
rawRecords.splice(rawInsertIndex, 0, ...recordArr), 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);
|
|
41026
41073
|
}
|
|
41027
41074
|
addRecordForSorted(record) {
|
|
41028
41075
|
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));
|
|
@@ -41050,22 +41097,37 @@
|
|
|
41050
41097
|
this.beforeChangedRecordsMap.delete(key.toString()), this.beforeChangedRecordsMap.set((key + delta).toString(), record);
|
|
41051
41098
|
}
|
|
41052
41099
|
}
|
|
41053
|
-
deleteRecords(recordIndexs) {
|
|
41054
|
-
var _a;
|
|
41055
|
-
if (
|
|
41056
|
-
|
|
41057
|
-
|
|
41058
|
-
|
|
41059
|
-
|
|
41060
|
-
|
|
41061
|
-
|
|
41062
|
-
|
|
41063
|
-
|
|
41064
|
-
|
|
41065
|
-
|
|
41066
|
-
|
|
41100
|
+
deleteRecords(recordIndexs, syncToOriginalRecords = !1) {
|
|
41101
|
+
var _a, _b, _c;
|
|
41102
|
+
if (!syncToOriginalRecords) {
|
|
41103
|
+
if (Array.isArray(this.records)) {
|
|
41104
|
+
const realDeletedRecordIndexs = [],
|
|
41105
|
+
recordIndexsMaxToMin = recordIndexs.sort((a, b) => b - a);
|
|
41106
|
+
for (let index = 0; index < recordIndexsMaxToMin.length; index++) {
|
|
41107
|
+
const recordIndex = recordIndexsMaxToMin[index];
|
|
41108
|
+
if (recordIndex >= this._sourceLength || recordIndex < 0) continue;
|
|
41109
|
+
this.adjustBeforeChangedRecordsMap(recordIndex, 1, "delete"), realDeletedRecordIndexs.push(recordIndex);
|
|
41110
|
+
const deletedRecord = this.records[recordIndex];
|
|
41111
|
+
for (let i = 0; i < this.fieldAggregators.length; i++) this.fieldAggregators[i].deleteRecord(deletedRecord);
|
|
41112
|
+
this.records.splice(recordIndex, 1), this.currentIndexedData.pop(), this._sourceLength -= 1;
|
|
41113
|
+
}
|
|
41114
|
+
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;
|
|
41115
|
+
}
|
|
41116
|
+
return [];
|
|
41117
|
+
}
|
|
41118
|
+
const rawRecords = this._getRawRecordsArray();
|
|
41119
|
+
if (!rawRecords || !Array.isArray(this.records)) return [];
|
|
41120
|
+
const realDeletedRecordIndexs = [],
|
|
41121
|
+
recordIndexsMaxToMin = recordIndexs.slice().sort((a, b) => b - a),
|
|
41122
|
+
rawDeletedIndexs = [];
|
|
41123
|
+
for (let index = 0; index < recordIndexsMaxToMin.length; index++) {
|
|
41124
|
+
const viewIndex = recordIndexsMaxToMin[index];
|
|
41125
|
+
if (viewIndex >= this.records.length || viewIndex < 0) continue;
|
|
41126
|
+
const deletedRecord = this.records[viewIndex],
|
|
41127
|
+
rawIndex = rawRecords.indexOf(deletedRecord);
|
|
41128
|
+
rawIndex >= 0 && (rawRecords.splice(rawIndex, 1), rawDeletedIndexs.push(rawIndex)), realDeletedRecordIndexs.push(viewIndex);
|
|
41067
41129
|
}
|
|
41068
|
-
return
|
|
41130
|
+
return 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.deleted) && this.dataSourceObj.deleted(rawDeletedIndexs), realDeletedRecordIndexs;
|
|
41069
41131
|
}
|
|
41070
41132
|
deleteRecordsForSorted(recordIndexs) {
|
|
41071
41133
|
if (Array.isArray(this.records)) {
|
|
@@ -41079,18 +41141,34 @@
|
|
|
41079
41141
|
this.sortedIndexMap.clear(), this.userPagination || (this.pagination.perPageCount = this._sourceLength, this.pagination.totalCount = this._sourceLength), this.beforeChangedRecordsMap.clear();
|
|
41080
41142
|
}
|
|
41081
41143
|
}
|
|
41082
|
-
updateRecords(records, recordIndexs) {
|
|
41083
|
-
|
|
41144
|
+
updateRecords(records, recordIndexs, syncToOriginalRecords = !1) {
|
|
41145
|
+
var _a;
|
|
41146
|
+
if (!syncToOriginalRecords) {
|
|
41147
|
+
const realDeletedRecordIndexs = [];
|
|
41148
|
+
for (let index = 0; index < recordIndexs.length; index++) {
|
|
41149
|
+
const recordIndex = recordIndexs[index];
|
|
41150
|
+
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 {
|
|
41151
|
+
if (recordIndex >= this._sourceLength || recordIndex < 0) continue;
|
|
41152
|
+
this.beforeChangedRecordsMap.delete(recordIndex.toString()), realDeletedRecordIndexs.push(recordIndex);
|
|
41153
|
+
for (let i = 0; i < this.fieldAggregators.length; i++) this.fieldAggregators[i].updateRecord(this.records[recordIndex], records[index]);
|
|
41154
|
+
this.records[recordIndex] = records[index];
|
|
41155
|
+
}
|
|
41156
|
+
}
|
|
41157
|
+
return this.userPagination && this.updatePagerData(), realDeletedRecordIndexs;
|
|
41158
|
+
}
|
|
41159
|
+
const rawRecords = this._getRawRecordsArray();
|
|
41160
|
+
if (!rawRecords || !Array.isArray(this.records)) return [];
|
|
41161
|
+
const realUpdatedIndexs = [];
|
|
41084
41162
|
for (let index = 0; index < recordIndexs.length; index++) {
|
|
41085
41163
|
const recordIndex = recordIndexs[index];
|
|
41086
|
-
if (Array.isArray(recordIndex)) this.beforeChangedRecordsMap.delete(recordIndex.toString()),
|
|
41087
|
-
if (recordIndex >= this.
|
|
41088
|
-
this.
|
|
41089
|
-
|
|
41090
|
-
|
|
41164
|
+
if (Array.isArray(recordIndex)) this.beforeChangedRecordsMap.delete(recordIndex.toString()), realUpdatedIndexs.push(recordIndex), recordIndex.slice(0, -1).reduce((acc, key) => (void 0 === acc[key] && (acc[key] = {}), acc[key].children), rawRecords)[recordIndex[recordIndex.length - 1]] = records[index];else {
|
|
41165
|
+
if (recordIndex >= this.records.length || recordIndex < 0) continue;
|
|
41166
|
+
const oldRecord = this.records[recordIndex],
|
|
41167
|
+
rawIndex = rawRecords.indexOf(oldRecord);
|
|
41168
|
+
rawIndex >= 0 && (rawRecords[rawIndex] = records[index]), realUpdatedIndexs.push(recordIndex);
|
|
41091
41169
|
}
|
|
41092
41170
|
}
|
|
41093
|
-
return this.
|
|
41171
|
+
return this.beforeChangedRecordsMap.clear(), this.sortedIndexMap.clear(), this.updateFilterRules(null === (_a = this.dataConfig) || void 0 === _a ? void 0 : _a.filterRules), realUpdatedIndexs;
|
|
41094
41172
|
}
|
|
41095
41173
|
updateRecordsForSorted(records, recordIndexs) {
|
|
41096
41174
|
for (let index = 0; index < recordIndexs.length; index++) {
|
|
@@ -60062,7 +60140,7 @@
|
|
|
60062
60140
|
}
|
|
60063
60141
|
constructor(container, options = {}) {
|
|
60064
60142
|
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;
|
|
60065
|
-
if (super(), this.showFrozenIcon = !0, this.version = "1.22.11-alpha.
|
|
60143
|
+
if (super(), this.showFrozenIcon = !0, this.version = "1.22.11-alpha.7", this.id = `VTable${Date.now()}`, this.isReleased = !1, this._chartEventMap = {}, this.throttleInvalidate = throttle2(this.render.bind(this), 200), "node" === Env$1.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");
|
|
60066
60144
|
this.pluginManager = new PluginManager(this, options), this.fireListeners(TABLE_EVENT_TYPE.BEFORE_INIT, {
|
|
60067
60145
|
options: options,
|
|
60068
60146
|
container: container
|
|
@@ -64098,13 +64176,16 @@
|
|
|
64098
64176
|
}), table.dataSource.sort(sortState));
|
|
64099
64177
|
}
|
|
64100
64178
|
function listTableAddRecord(record, recordIndex, table) {
|
|
64101
|
-
var _a, _b, _c, _d;
|
|
64179
|
+
var _a, _b, _c, _d, _e, _f;
|
|
64102
64180
|
try {
|
|
64103
64181
|
if (!record) return !1;
|
|
64104
|
-
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)
|
|
64182
|
+
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) {
|
|
64183
|
+
!!(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();
|
|
64184
|
+
} else {
|
|
64105
64185
|
(void 0 === recordIndex || recordIndex > table.dataSource.sourceLength) && (recordIndex = table.dataSource.sourceLength);
|
|
64106
|
-
const headerCount = table.transpose ? table.rowHeaderLevelCount : table.columnHeaderLevelCount
|
|
64107
|
-
|
|
64186
|
+
const headerCount = table.transpose ? table.rowHeaderLevelCount : table.columnHeaderLevelCount,
|
|
64187
|
+
syncToOriginalRecords = !!(null === (_f = table.options) || void 0 === _f ? void 0 : _f.syncRecordOperationsToSourceRecords);
|
|
64188
|
+
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;
|
|
64108
64189
|
const oldRowCount = table.rowCount;
|
|
64109
64190
|
if (table.refreshRowColCount(), 0 === table.scenegraph.proxy.totalActualBodyRowCount) return table.scenegraph.clearCells(), table.scenegraph.createSceneGraph(), !0;
|
|
64110
64191
|
const newRowCount = table.transpose ? table.colCount : table.rowCount;
|
|
@@ -64173,13 +64254,16 @@
|
|
|
64173
64254
|
}
|
|
64174
64255
|
}
|
|
64175
64256
|
function listTableAddRecords(records, recordIndex, table) {
|
|
64176
|
-
var _a, _b, _c, _d;
|
|
64257
|
+
var _a, _b, _c, _d, _e, _f;
|
|
64177
64258
|
try {
|
|
64178
64259
|
if (!records || 0 === records.length) return !1;
|
|
64179
|
-
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)
|
|
64260
|
+
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) {
|
|
64261
|
+
!!(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();
|
|
64262
|
+
} else {
|
|
64180
64263
|
void 0 === recordIndex || recordIndex > table.dataSource.sourceLength ? recordIndex = table.dataSource.sourceLength : recordIndex < 0 && (recordIndex = 0);
|
|
64181
|
-
const headerCount = table.transpose ? table.rowHeaderLevelCount : table.columnHeaderLevelCount
|
|
64182
|
-
|
|
64264
|
+
const headerCount = table.transpose ? table.rowHeaderLevelCount : table.columnHeaderLevelCount,
|
|
64265
|
+
syncToOriginalRecords = !!(null === (_f = table.options) || void 0 === _f ? void 0 : _f.syncRecordOperationsToSourceRecords);
|
|
64266
|
+
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;
|
|
64183
64267
|
const oldRowCount = table.transpose ? table.colCount : table.rowCount;
|
|
64184
64268
|
if (table.refreshRowColCount(), 0 === table.scenegraph.proxy.totalActualBodyRowCount) return table.scenegraph.clearCells(), table.scenegraph.createSceneGraph(), !0;
|
|
64185
64269
|
const newRowCount = table.transpose ? table.colCount : table.rowCount;
|
|
@@ -64248,16 +64332,20 @@
|
|
|
64248
64332
|
}
|
|
64249
64333
|
}
|
|
64250
64334
|
function listTableDeleteRecords(recordIndexs, table) {
|
|
64251
|
-
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
64335
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
64252
64336
|
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) {
|
|
64253
64337
|
const deletedRecordIndexs = null === (_d = (_c = table.dataSource).deleteRecordsForTree) || void 0 === _d ? void 0 : _d.call(_c, recordIndexs);
|
|
64254
64338
|
if (0 === deletedRecordIndexs.length) return;
|
|
64255
64339
|
for (let index = 0; index < deletedRecordIndexs.length; index++) adjustCheckBoxStateMapWithDeleteRecordIndex(table, deletedRecordIndexs[index], 1);
|
|
64256
64340
|
table.refreshRowColCount(), table.internalProps.layoutMap.clearCellRangeMap(), table.sortState && sortRecords(table), table.scenegraph.clearCells(), table.scenegraph.createSceneGraph();
|
|
64257
|
-
} else if (table.sortState)
|
|
64258
|
-
|
|
64341
|
+
} else if (table.sortState) {
|
|
64342
|
+
!!(null === (_e = table.options) || void 0 === _e ? void 0 : _e.syncRecordOperationsToSourceRecords) ? table.dataSource.deleteRecords(recordIndexs, !0) : table.dataSource.deleteRecordsForSorted(recordIndexs), sortRecords(table), table.refreshRowColCount(), table.scenegraph.clearCells(), table.scenegraph.createSceneGraph();
|
|
64343
|
+
} else {
|
|
64344
|
+
const syncToOriginalRecords = !!(null === (_f = table.options) || void 0 === _f ? void 0 : _f.syncRecordOperationsToSourceRecords),
|
|
64345
|
+
deletedRecordIndexs = table.dataSource.deleteRecords(recordIndexs, syncToOriginalRecords);
|
|
64259
64346
|
if (0 === deletedRecordIndexs.length) return;
|
|
64260
64347
|
for (let index = 0; index < deletedRecordIndexs.length; index++) adjustCheckBoxStateMapWithDeleteRecordIndex(table, deletedRecordIndexs[index], 1);
|
|
64348
|
+
if (syncToOriginalRecords) return table.refreshRowColCount(), table.internalProps.layoutMap.clearCellRangeMap(), table.scenegraph.clearCells(), void table.scenegraph.createSceneGraph();
|
|
64261
64349
|
const oldRowCount = table.transpose ? table.colCount : table.rowCount;
|
|
64262
64350
|
table.refreshRowColCount();
|
|
64263
64351
|
const newRowCount = table.transpose ? table.colCount : table.rowCount,
|
|
@@ -64295,7 +64383,7 @@
|
|
|
64295
64383
|
col: 0,
|
|
64296
64384
|
row: row
|
|
64297
64385
|
});
|
|
64298
|
-
null === (
|
|
64386
|
+
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();
|
|
64299
64387
|
}
|
|
64300
64388
|
} else {
|
|
64301
64389
|
const delRows = [],
|
|
@@ -64327,15 +64415,19 @@
|
|
|
64327
64415
|
col: 0,
|
|
64328
64416
|
row: row
|
|
64329
64417
|
});
|
|
64330
|
-
null === (
|
|
64418
|
+
null === (_j = table.reactCustomLayout) || void 0 === _j || _j.clearCache(), table.transpose ? table.scenegraph.updateCol(delRows, [], updateRows) : table.scenegraph.updateRow(delRows, [], updateRows), null === (_k = table.reactCustomLayout) || void 0 === _k || _k.updateAllCustomCell();
|
|
64331
64419
|
}
|
|
64332
64420
|
}
|
|
64333
64421
|
}
|
|
64334
64422
|
function listTableUpdateRecords(records, recordIndexs, table) {
|
|
64335
|
-
var _a, _b, _c, _d;
|
|
64336
|
-
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)
|
|
64337
|
-
|
|
64423
|
+
var _a, _b, _c, _d, _e, _f;
|
|
64424
|
+
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) {
|
|
64425
|
+
!!(null === (_e = table.options) || void 0 === _e ? void 0 : _e.syncRecordOperationsToSourceRecords) ? table.dataSource.updateRecords(records, recordIndexs, !0) : table.dataSource.updateRecordsForSorted(records, recordIndexs), sortRecords(table), table.refreshRowColCount(), table.scenegraph.clearCells(), table.scenegraph.createSceneGraph();
|
|
64426
|
+
} else {
|
|
64427
|
+
const syncToOriginalRecords = !!(null === (_f = table.options) || void 0 === _f ? void 0 : _f.syncRecordOperationsToSourceRecords),
|
|
64428
|
+
updateRecordIndexs = table.dataSource.updateRecords(records, recordIndexs, syncToOriginalRecords);
|
|
64338
64429
|
if (0 === updateRecordIndexs.length) return;
|
|
64430
|
+
if (syncToOriginalRecords) return table.refreshRowColCount(), table.internalProps.layoutMap.clearCellRangeMap(), table.scenegraph.clearCells(), void table.scenegraph.createSceneGraph();
|
|
64339
64431
|
const recordIndexsMinToMax = updateRecordIndexs.map(index => table.getBodyRowIndexByRecordIndex(index)).sort((a, b) => a - b);
|
|
64340
64432
|
if (table.pagination) {
|
|
64341
64433
|
const {
|
|
@@ -91243,7 +91335,7 @@
|
|
|
91243
91335
|
importStyle();
|
|
91244
91336
|
}
|
|
91245
91337
|
|
|
91246
|
-
const version = "1.22.11-alpha.
|
|
91338
|
+
const version = "1.22.11-alpha.7";
|
|
91247
91339
|
importStyles();
|
|
91248
91340
|
|
|
91249
91341
|
exports.TYPES = index;
|