@visactor/vtable-gantt 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-gantt.js +163 -71
- package/dist/vtable-gantt.min.js +2 -2
- package/es/index.d.ts +1 -1
- package/es/index.js +1 -1
- package/es/index.js.map +1 -1
- package/package.json +3 -3
package/cjs/index.d.ts
CHANGED
|
@@ -6,5 +6,5 @@ import * as tools from './tools';
|
|
|
6
6
|
import * as VRender from './vrender';
|
|
7
7
|
import * as VTable from './vtable';
|
|
8
8
|
import * as plugins from './plugins';
|
|
9
|
-
export declare const version = "1.22.11-alpha.
|
|
9
|
+
export declare const version = "1.22.11-alpha.7";
|
|
10
10
|
export { TYPES, GanttConstructorOptions, Gantt, ColumnsDefine, ColumnDefine, LinkColumnDefine, ChartColumnDefine, ImageColumnDefine, SparklineColumnDefine, ProgressbarColumnDefine, TextColumnDefine, GroupColumnDefine, TextAlignType, TextBaselineType, tools, VRender, VTable, plugins };
|
package/cjs/index.js
CHANGED
package/cjs/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AACA,kDAAoC;AAwBlC,sBAAK;AAVP,mCAAgC;AAY9B,sFAZO,aAAK,OAYP;AAXP,+CAAiC;AAuB/B,sBAAK;AAtBP,mDAAqC;AAuBnC,0BAAO;AAtBT,iDAAmC;AAuBjC,wBAAM;AAtBR,mDAAqC;AAuBnC,0BAAO;AAtBI,QAAA,OAAO,GAAG,iBAAiB,CAAC","file":"index.js","sourcesContent":["import type { GanttConstructorOptions } from './ts-types';\nimport * as TYPES from './ts-types';\nimport type {\n ColumnDefine,\n ColumnsDefine,\n LinkColumnDefine,\n ChartColumnDefine,\n ImageColumnDefine,\n SparklineColumnDefine,\n ProgressbarColumnDefine,\n TextColumnDefine,\n GroupColumnDefine,\n TextAlignType,\n TextBaselineType\n} from '@visactor/vtable';\nimport { Gantt } from './Gantt';\nimport * as tools from './tools';\nimport * as VRender from './vrender';\nimport * as VTable from './vtable';\nimport * as plugins from './plugins';\nexport const version = \"1.22.11-alpha.
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AACA,kDAAoC;AAwBlC,sBAAK;AAVP,mCAAgC;AAY9B,sFAZO,aAAK,OAYP;AAXP,+CAAiC;AAuB/B,sBAAK;AAtBP,mDAAqC;AAuBnC,0BAAO;AAtBT,iDAAmC;AAuBjC,wBAAM;AAtBR,mDAAqC;AAuBnC,0BAAO;AAtBI,QAAA,OAAO,GAAG,iBAAiB,CAAC","file":"index.js","sourcesContent":["import type { GanttConstructorOptions } from './ts-types';\nimport * as TYPES from './ts-types';\nimport type {\n ColumnDefine,\n ColumnsDefine,\n LinkColumnDefine,\n ChartColumnDefine,\n ImageColumnDefine,\n SparklineColumnDefine,\n ProgressbarColumnDefine,\n TextColumnDefine,\n GroupColumnDefine,\n TextAlignType,\n TextBaselineType\n} from '@visactor/vtable';\nimport { Gantt } from './Gantt';\nimport * as tools from './tools';\nimport * as VRender from './vrender';\nimport * as VTable from './vtable';\nimport * as plugins from './plugins';\nexport const version = \"1.22.11-alpha.7\";\n/**\n * @namespace VTableGantt\n */\nexport {\n TYPES,\n GanttConstructorOptions,\n Gantt,\n ColumnsDefine,\n ColumnDefine,\n LinkColumnDefine,\n ChartColumnDefine,\n ImageColumnDefine,\n SparklineColumnDefine,\n ProgressbarColumnDefine,\n TextColumnDefine,\n GroupColumnDefine,\n TextAlignType,\n TextBaselineType,\n tools,\n VRender,\n VTable,\n plugins\n};\n"]}
|
package/dist/vtable-gantt.js
CHANGED
|
@@ -39739,6 +39739,9 @@
|
|
|
39739
39739
|
var _a;
|
|
39740
39740
|
return null !== (_a = defaultStyle.textAlign) && void 0 !== _a ? _a : "left";
|
|
39741
39741
|
},
|
|
39742
|
+
get textStickBaseOnAlign() {
|
|
39743
|
+
return defaultStyle.textStickBaseOnAlign;
|
|
39744
|
+
},
|
|
39742
39745
|
get textBaseline() {
|
|
39743
39746
|
var _a;
|
|
39744
39747
|
return null !== (_a = defaultStyle.textBaseline) && void 0 !== _a ? _a : "middle";
|
|
@@ -40422,6 +40425,9 @@
|
|
|
40422
40425
|
get textStick() {
|
|
40423
40426
|
return style.textStick;
|
|
40424
40427
|
},
|
|
40428
|
+
get textStickBaseOnAlign() {
|
|
40429
|
+
return style.textStickBaseOnAlign;
|
|
40430
|
+
},
|
|
40425
40431
|
get marked() {
|
|
40426
40432
|
return style.marked;
|
|
40427
40433
|
},
|
|
@@ -40878,41 +40884,82 @@
|
|
|
40878
40884
|
Array.isArray(indexed) || this.records.splice(indexed, 1, record);
|
|
40879
40885
|
}
|
|
40880
40886
|
}
|
|
40881
|
-
|
|
40887
|
+
_getRawRecordsArray() {
|
|
40882
40888
|
var _a;
|
|
40883
|
-
|
|
40884
|
-
|
|
40885
|
-
|
|
40886
|
-
|
|
40887
|
-
|
|
40888
|
-
|
|
40889
|
-
|
|
40890
|
-
|
|
40891
|
-
|
|
40892
|
-
|
|
40893
|
-
|
|
40894
|
-
|
|
40889
|
+
const rawRecords = null === (_a = this.dataSourceObj) || void 0 === _a ? void 0 : _a.records;
|
|
40890
|
+
return Array.isArray(rawRecords) ? rawRecords : null;
|
|
40891
|
+
}
|
|
40892
|
+
_hasFilterInEffect() {
|
|
40893
|
+
var _a, _b, _c, _d, _e;
|
|
40894
|
+
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;
|
|
40895
|
+
}
|
|
40896
|
+
_normalizeInsertIndex(index, length) {
|
|
40897
|
+
return null == index || index > length ? length : index < 0 ? 0 : index;
|
|
40898
|
+
}
|
|
40899
|
+
_mapViewInsertIndexToRawInsertIndex(rawRecords, viewIndex) {
|
|
40900
|
+
if (viewIndex >= this.records.length) return rawRecords.length;
|
|
40901
|
+
if (viewIndex <= 0) return 0;
|
|
40902
|
+
const prevRecord = this.records[viewIndex - 1],
|
|
40903
|
+
rawIndex = rawRecords.indexOf(prevRecord);
|
|
40904
|
+
return rawIndex >= 0 ? rawIndex + 1 : rawRecords.length;
|
|
40905
|
+
}
|
|
40906
|
+
_resetIndexingFromViewRecords() {
|
|
40907
|
+
if (this._sourceLength = this.records.length, this.currentIndexedData = Array.from({
|
|
40908
|
+
length: this._sourceLength
|
|
40909
|
+
}, (_, i) => i), "tree" === this.rowHierarchyType && this.initTreeHierarchyState(), this.userPagination) return this.pagination.totalCount = this._sourceLength, void this.updatePagerData();
|
|
40910
|
+
this.pagination.perPageCount = this._sourceLength, this.pagination.totalCount = this._sourceLength, this.updatePagerData();
|
|
40911
|
+
}
|
|
40912
|
+
addRecord(record, index, syncToOriginalRecords = !1) {
|
|
40913
|
+
var _a, _b, _c;
|
|
40914
|
+
if (!syncToOriginalRecords) {
|
|
40915
|
+
if (Array.isArray(this.records)) {
|
|
40916
|
+
this.records.splice(index, 0, record), this.adjustBeforeChangedRecordsMap(index, 1), this.currentIndexedData.push(this.currentIndexedData.length), this._sourceLength += 1;
|
|
40917
|
+
for (let i = 0; i < this.fieldAggregators.length; i++) this.fieldAggregators[i].push(record);
|
|
40918
|
+
if ("tree" === this.rowHierarchyType && this.initTreeHierarchyState(), this.userPagination) {
|
|
40919
|
+
this.pagination.totalCount = this._sourceLength;
|
|
40920
|
+
const {
|
|
40921
|
+
perPageCount: perPageCount,
|
|
40922
|
+
currentPage: currentPage
|
|
40923
|
+
} = this.pagination;
|
|
40924
|
+
index < perPageCount * (currentPage || 0) + perPageCount && this.updatePagerData();
|
|
40925
|
+
} else this.pagination.perPageCount = this._sourceLength, this.pagination.totalCount = this._sourceLength, this.updatePagerData();
|
|
40926
|
+
(null === (_a = this.dataSourceObj) || void 0 === _a ? void 0 : _a.added) && this.dataSourceObj.added(index, 1);
|
|
40927
|
+
}
|
|
40928
|
+
return;
|
|
40895
40929
|
}
|
|
40930
|
+
const rawRecords = this._getRawRecordsArray();
|
|
40931
|
+
if (!rawRecords) return;
|
|
40932
|
+
const viewInsertIndex = this._normalizeInsertIndex(index, this.records.length),
|
|
40933
|
+
rawInsertIndex = this._hasFilterInEffect() ? this._mapViewInsertIndexToRawInsertIndex(rawRecords, viewInsertIndex) : this._normalizeInsertIndex(viewInsertIndex, rawRecords.length);
|
|
40934
|
+
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);
|
|
40896
40935
|
}
|
|
40897
|
-
addRecords(recordArr, index) {
|
|
40898
|
-
var _a;
|
|
40899
|
-
if (
|
|
40900
|
-
if (Array.isArray(
|
|
40901
|
-
|
|
40902
|
-
|
|
40903
|
-
|
|
40904
|
-
|
|
40936
|
+
addRecords(recordArr, index, syncToOriginalRecords = !1) {
|
|
40937
|
+
var _a, _b, _c;
|
|
40938
|
+
if (!syncToOriginalRecords) {
|
|
40939
|
+
if (Array.isArray(this.records)) {
|
|
40940
|
+
if (Array.isArray(recordArr)) {
|
|
40941
|
+
this.records.splice(index, 0, ...recordArr), this.adjustBeforeChangedRecordsMap(index, recordArr.length);
|
|
40942
|
+
for (let i = 0; i < recordArr.length; i++) this.currentIndexedData.push(this.currentIndexedData.length);
|
|
40943
|
+
this._sourceLength += recordArr.length;
|
|
40944
|
+
for (let i = 0; i < this.fieldAggregators.length; i++) for (let j = 0; j < recordArr.length; j++) this.fieldAggregators[i].push(recordArr[j]);
|
|
40945
|
+
}
|
|
40946
|
+
if (this.userPagination) {
|
|
40947
|
+
this.pagination.totalCount = this._sourceLength;
|
|
40948
|
+
const {
|
|
40949
|
+
perPageCount: perPageCount,
|
|
40950
|
+
currentPage: currentPage
|
|
40951
|
+
} = this.pagination;
|
|
40952
|
+
index < perPageCount * (currentPage || 0) + perPageCount && this.updatePagerData();
|
|
40953
|
+
} else this.pagination.perPageCount = this._sourceLength, this.pagination.totalCount = this._sourceLength, this.updatePagerData();
|
|
40954
|
+
(null === (_a = this.dataSourceObj) || void 0 === _a ? void 0 : _a.added) && this.dataSourceObj.added(index, recordArr.length);
|
|
40905
40955
|
}
|
|
40906
|
-
|
|
40907
|
-
this.pagination.totalCount = this._sourceLength;
|
|
40908
|
-
const {
|
|
40909
|
-
perPageCount: perPageCount,
|
|
40910
|
-
currentPage: currentPage
|
|
40911
|
-
} = this.pagination;
|
|
40912
|
-
index < perPageCount * (currentPage || 0) + perPageCount && this.updatePagerData();
|
|
40913
|
-
} else this.pagination.perPageCount = this._sourceLength, this.pagination.totalCount = this._sourceLength, this.updatePagerData();
|
|
40914
|
-
(null === (_a = this.dataSourceObj) || void 0 === _a ? void 0 : _a.added) && this.dataSourceObj.added(index, recordArr.length);
|
|
40956
|
+
return;
|
|
40915
40957
|
}
|
|
40958
|
+
const rawRecords = this._getRawRecordsArray();
|
|
40959
|
+
if (!rawRecords || !Array.isArray(recordArr) || 0 === recordArr.length) return;
|
|
40960
|
+
const viewInsertIndex = this._normalizeInsertIndex(index, this.records.length),
|
|
40961
|
+
rawInsertIndex = this._hasFilterInEffect() ? this._mapViewInsertIndexToRawInsertIndex(rawRecords, viewInsertIndex) : this._normalizeInsertIndex(viewInsertIndex, rawRecords.length);
|
|
40962
|
+
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);
|
|
40916
40963
|
}
|
|
40917
40964
|
addRecordForSorted(record) {
|
|
40918
40965
|
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));
|
|
@@ -40940,22 +40987,37 @@
|
|
|
40940
40987
|
this.beforeChangedRecordsMap.delete(key.toString()), this.beforeChangedRecordsMap.set((key + delta).toString(), record);
|
|
40941
40988
|
}
|
|
40942
40989
|
}
|
|
40943
|
-
deleteRecords(recordIndexs) {
|
|
40944
|
-
var _a;
|
|
40945
|
-
if (
|
|
40946
|
-
|
|
40947
|
-
|
|
40948
|
-
|
|
40949
|
-
|
|
40950
|
-
|
|
40951
|
-
|
|
40952
|
-
|
|
40953
|
-
|
|
40954
|
-
|
|
40955
|
-
|
|
40956
|
-
|
|
40990
|
+
deleteRecords(recordIndexs, syncToOriginalRecords = !1) {
|
|
40991
|
+
var _a, _b, _c;
|
|
40992
|
+
if (!syncToOriginalRecords) {
|
|
40993
|
+
if (Array.isArray(this.records)) {
|
|
40994
|
+
const realDeletedRecordIndexs = [],
|
|
40995
|
+
recordIndexsMaxToMin = recordIndexs.sort((a, b) => b - a);
|
|
40996
|
+
for (let index = 0; index < recordIndexsMaxToMin.length; index++) {
|
|
40997
|
+
const recordIndex = recordIndexsMaxToMin[index];
|
|
40998
|
+
if (recordIndex >= this._sourceLength || recordIndex < 0) continue;
|
|
40999
|
+
this.adjustBeforeChangedRecordsMap(recordIndex, 1, "delete"), realDeletedRecordIndexs.push(recordIndex);
|
|
41000
|
+
const deletedRecord = this.records[recordIndex];
|
|
41001
|
+
for (let i = 0; i < this.fieldAggregators.length; i++) this.fieldAggregators[i].deleteRecord(deletedRecord);
|
|
41002
|
+
this.records.splice(recordIndex, 1), this.currentIndexedData.pop(), this._sourceLength -= 1;
|
|
41003
|
+
}
|
|
41004
|
+
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;
|
|
41005
|
+
}
|
|
41006
|
+
return [];
|
|
41007
|
+
}
|
|
41008
|
+
const rawRecords = this._getRawRecordsArray();
|
|
41009
|
+
if (!rawRecords || !Array.isArray(this.records)) return [];
|
|
41010
|
+
const realDeletedRecordIndexs = [],
|
|
41011
|
+
recordIndexsMaxToMin = recordIndexs.slice().sort((a, b) => b - a),
|
|
41012
|
+
rawDeletedIndexs = [];
|
|
41013
|
+
for (let index = 0; index < recordIndexsMaxToMin.length; index++) {
|
|
41014
|
+
const viewIndex = recordIndexsMaxToMin[index];
|
|
41015
|
+
if (viewIndex >= this.records.length || viewIndex < 0) continue;
|
|
41016
|
+
const deletedRecord = this.records[viewIndex],
|
|
41017
|
+
rawIndex = rawRecords.indexOf(deletedRecord);
|
|
41018
|
+
rawIndex >= 0 && (rawRecords.splice(rawIndex, 1), rawDeletedIndexs.push(rawIndex)), realDeletedRecordIndexs.push(viewIndex);
|
|
40957
41019
|
}
|
|
40958
|
-
return
|
|
41020
|
+
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;
|
|
40959
41021
|
}
|
|
40960
41022
|
deleteRecordsForSorted(recordIndexs) {
|
|
40961
41023
|
if (Array.isArray(this.records)) {
|
|
@@ -40969,18 +41031,34 @@
|
|
|
40969
41031
|
this.sortedIndexMap.clear(), this.userPagination || (this.pagination.perPageCount = this._sourceLength, this.pagination.totalCount = this._sourceLength), this.beforeChangedRecordsMap.clear();
|
|
40970
41032
|
}
|
|
40971
41033
|
}
|
|
40972
|
-
updateRecords(records, recordIndexs) {
|
|
40973
|
-
|
|
41034
|
+
updateRecords(records, recordIndexs, syncToOriginalRecords = !1) {
|
|
41035
|
+
var _a;
|
|
41036
|
+
if (!syncToOriginalRecords) {
|
|
41037
|
+
const realDeletedRecordIndexs = [];
|
|
41038
|
+
for (let index = 0; index < recordIndexs.length; index++) {
|
|
41039
|
+
const recordIndex = recordIndexs[index];
|
|
41040
|
+
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 {
|
|
41041
|
+
if (recordIndex >= this._sourceLength || recordIndex < 0) continue;
|
|
41042
|
+
this.beforeChangedRecordsMap.delete(recordIndex.toString()), realDeletedRecordIndexs.push(recordIndex);
|
|
41043
|
+
for (let i = 0; i < this.fieldAggregators.length; i++) this.fieldAggregators[i].updateRecord(this.records[recordIndex], records[index]);
|
|
41044
|
+
this.records[recordIndex] = records[index];
|
|
41045
|
+
}
|
|
41046
|
+
}
|
|
41047
|
+
return this.userPagination && this.updatePagerData(), realDeletedRecordIndexs;
|
|
41048
|
+
}
|
|
41049
|
+
const rawRecords = this._getRawRecordsArray();
|
|
41050
|
+
if (!rawRecords || !Array.isArray(this.records)) return [];
|
|
41051
|
+
const realUpdatedIndexs = [];
|
|
40974
41052
|
for (let index = 0; index < recordIndexs.length; index++) {
|
|
40975
41053
|
const recordIndex = recordIndexs[index];
|
|
40976
|
-
if (Array.isArray(recordIndex)) this.beforeChangedRecordsMap.delete(recordIndex.toString()),
|
|
40977
|
-
if (recordIndex >= this.
|
|
40978
|
-
this.
|
|
40979
|
-
|
|
40980
|
-
|
|
41054
|
+
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 {
|
|
41055
|
+
if (recordIndex >= this.records.length || recordIndex < 0) continue;
|
|
41056
|
+
const oldRecord = this.records[recordIndex],
|
|
41057
|
+
rawIndex = rawRecords.indexOf(oldRecord);
|
|
41058
|
+
rawIndex >= 0 && (rawRecords[rawIndex] = records[index]), realUpdatedIndexs.push(recordIndex);
|
|
40981
41059
|
}
|
|
40982
41060
|
}
|
|
40983
|
-
return this.
|
|
41061
|
+
return this.beforeChangedRecordsMap.clear(), this.sortedIndexMap.clear(), this.updateFilterRules(null === (_a = this.dataConfig) || void 0 === _a ? void 0 : _a.filterRules), realUpdatedIndexs;
|
|
40984
41062
|
}
|
|
40985
41063
|
updateRecordsForSorted(records, recordIndexs) {
|
|
40986
41064
|
for (let index = 0; index < recordIndexs.length; index++) {
|
|
@@ -59952,7 +60030,7 @@
|
|
|
59952
60030
|
}
|
|
59953
60031
|
constructor(container, options = {}) {
|
|
59954
60032
|
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;
|
|
59955
|
-
if (super(), this.showFrozenIcon = !0, this.version = "1.22.11-alpha.
|
|
60033
|
+
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.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");
|
|
59956
60034
|
this.pluginManager = new PluginManager$1(this, options), this.fireListeners(TABLE_EVENT_TYPE.BEFORE_INIT, {
|
|
59957
60035
|
options: options,
|
|
59958
60036
|
container: container
|
|
@@ -63988,13 +64066,16 @@
|
|
|
63988
64066
|
}), table.dataSource.sort(sortState));
|
|
63989
64067
|
}
|
|
63990
64068
|
function listTableAddRecord(record, recordIndex, table) {
|
|
63991
|
-
var _a, _b, _c, _d;
|
|
64069
|
+
var _a, _b, _c, _d, _e, _f;
|
|
63992
64070
|
try {
|
|
63993
64071
|
if (!record) return !1;
|
|
63994
|
-
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)
|
|
64072
|
+
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) {
|
|
64073
|
+
!!(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();
|
|
64074
|
+
} else {
|
|
63995
64075
|
(void 0 === recordIndex || recordIndex > table.dataSource.sourceLength) && (recordIndex = table.dataSource.sourceLength);
|
|
63996
|
-
const headerCount = table.transpose ? table.rowHeaderLevelCount : table.columnHeaderLevelCount
|
|
63997
|
-
|
|
64076
|
+
const headerCount = table.transpose ? table.rowHeaderLevelCount : table.columnHeaderLevelCount,
|
|
64077
|
+
syncToOriginalRecords = !!(null === (_f = table.options) || void 0 === _f ? void 0 : _f.syncRecordOperationsToSourceRecords);
|
|
64078
|
+
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;
|
|
63998
64079
|
const oldRowCount = table.rowCount;
|
|
63999
64080
|
if (table.refreshRowColCount(), 0 === table.scenegraph.proxy.totalActualBodyRowCount) return table.scenegraph.clearCells(), table.scenegraph.createSceneGraph(), !0;
|
|
64000
64081
|
const newRowCount = table.transpose ? table.colCount : table.rowCount;
|
|
@@ -64063,13 +64144,16 @@
|
|
|
64063
64144
|
}
|
|
64064
64145
|
}
|
|
64065
64146
|
function listTableAddRecords(records, recordIndex, table) {
|
|
64066
|
-
var _a, _b, _c, _d;
|
|
64147
|
+
var _a, _b, _c, _d, _e, _f;
|
|
64067
64148
|
try {
|
|
64068
64149
|
if (!records || 0 === records.length) return !1;
|
|
64069
|
-
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)
|
|
64150
|
+
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) {
|
|
64151
|
+
!!(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();
|
|
64152
|
+
} else {
|
|
64070
64153
|
void 0 === recordIndex || recordIndex > table.dataSource.sourceLength ? recordIndex = table.dataSource.sourceLength : recordIndex < 0 && (recordIndex = 0);
|
|
64071
|
-
const headerCount = table.transpose ? table.rowHeaderLevelCount : table.columnHeaderLevelCount
|
|
64072
|
-
|
|
64154
|
+
const headerCount = table.transpose ? table.rowHeaderLevelCount : table.columnHeaderLevelCount,
|
|
64155
|
+
syncToOriginalRecords = !!(null === (_f = table.options) || void 0 === _f ? void 0 : _f.syncRecordOperationsToSourceRecords);
|
|
64156
|
+
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;
|
|
64073
64157
|
const oldRowCount = table.transpose ? table.colCount : table.rowCount;
|
|
64074
64158
|
if (table.refreshRowColCount(), 0 === table.scenegraph.proxy.totalActualBodyRowCount) return table.scenegraph.clearCells(), table.scenegraph.createSceneGraph(), !0;
|
|
64075
64159
|
const newRowCount = table.transpose ? table.colCount : table.rowCount;
|
|
@@ -64138,16 +64222,20 @@
|
|
|
64138
64222
|
}
|
|
64139
64223
|
}
|
|
64140
64224
|
function listTableDeleteRecords(recordIndexs, table) {
|
|
64141
|
-
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
64225
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
64142
64226
|
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) {
|
|
64143
64227
|
const deletedRecordIndexs = null === (_d = (_c = table.dataSource).deleteRecordsForTree) || void 0 === _d ? void 0 : _d.call(_c, recordIndexs);
|
|
64144
64228
|
if (0 === deletedRecordIndexs.length) return;
|
|
64145
64229
|
for (let index = 0; index < deletedRecordIndexs.length; index++) adjustCheckBoxStateMapWithDeleteRecordIndex(table, deletedRecordIndexs[index], 1);
|
|
64146
64230
|
table.refreshRowColCount(), table.internalProps.layoutMap.clearCellRangeMap(), table.sortState && sortRecords(table), table.scenegraph.clearCells(), table.scenegraph.createSceneGraph();
|
|
64147
|
-
} else if (table.sortState)
|
|
64148
|
-
|
|
64231
|
+
} else if (table.sortState) {
|
|
64232
|
+
!!(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();
|
|
64233
|
+
} else {
|
|
64234
|
+
const syncToOriginalRecords = !!(null === (_f = table.options) || void 0 === _f ? void 0 : _f.syncRecordOperationsToSourceRecords),
|
|
64235
|
+
deletedRecordIndexs = table.dataSource.deleteRecords(recordIndexs, syncToOriginalRecords);
|
|
64149
64236
|
if (0 === deletedRecordIndexs.length) return;
|
|
64150
64237
|
for (let index = 0; index < deletedRecordIndexs.length; index++) adjustCheckBoxStateMapWithDeleteRecordIndex(table, deletedRecordIndexs[index], 1);
|
|
64238
|
+
if (syncToOriginalRecords) return table.refreshRowColCount(), table.internalProps.layoutMap.clearCellRangeMap(), table.scenegraph.clearCells(), void table.scenegraph.createSceneGraph();
|
|
64151
64239
|
const oldRowCount = table.transpose ? table.colCount : table.rowCount;
|
|
64152
64240
|
table.refreshRowColCount();
|
|
64153
64241
|
const newRowCount = table.transpose ? table.colCount : table.rowCount,
|
|
@@ -64185,7 +64273,7 @@
|
|
|
64185
64273
|
col: 0,
|
|
64186
64274
|
row: row
|
|
64187
64275
|
});
|
|
64188
|
-
null === (
|
|
64276
|
+
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();
|
|
64189
64277
|
}
|
|
64190
64278
|
} else {
|
|
64191
64279
|
const delRows = [],
|
|
@@ -64217,15 +64305,19 @@
|
|
|
64217
64305
|
col: 0,
|
|
64218
64306
|
row: row
|
|
64219
64307
|
});
|
|
64220
|
-
null === (
|
|
64308
|
+
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();
|
|
64221
64309
|
}
|
|
64222
64310
|
}
|
|
64223
64311
|
}
|
|
64224
64312
|
function listTableUpdateRecords(records, recordIndexs, table) {
|
|
64225
|
-
var _a, _b, _c, _d;
|
|
64226
|
-
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)
|
|
64227
|
-
|
|
64313
|
+
var _a, _b, _c, _d, _e, _f;
|
|
64314
|
+
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) {
|
|
64315
|
+
!!(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();
|
|
64316
|
+
} else {
|
|
64317
|
+
const syncToOriginalRecords = !!(null === (_f = table.options) || void 0 === _f ? void 0 : _f.syncRecordOperationsToSourceRecords),
|
|
64318
|
+
updateRecordIndexs = table.dataSource.updateRecords(records, recordIndexs, syncToOriginalRecords);
|
|
64228
64319
|
if (0 === updateRecordIndexs.length) return;
|
|
64320
|
+
if (syncToOriginalRecords) return table.refreshRowColCount(), table.internalProps.layoutMap.clearCellRangeMap(), table.scenegraph.clearCells(), void table.scenegraph.createSceneGraph();
|
|
64229
64321
|
const recordIndexsMinToMax = updateRecordIndexs.map(index => table.getBodyRowIndexByRecordIndex(index)).sort((a, b) => a - b);
|
|
64230
64322
|
if (table.pagination) {
|
|
64231
64323
|
const {
|
|
@@ -76450,7 +76542,7 @@
|
|
|
76450
76542
|
PluginManager: PluginManager
|
|
76451
76543
|
});
|
|
76452
76544
|
|
|
76453
|
-
const version = "1.22.11-alpha.
|
|
76545
|
+
const version = "1.22.11-alpha.7";
|
|
76454
76546
|
|
|
76455
76547
|
exports.Gantt = Gantt;
|
|
76456
76548
|
exports.TYPES = index$4;
|