@visactor/vtable-calendar 1.23.3 → 1.24.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/vtable-calendar.js +382 -71
- package/dist/vtable-calendar.min.js +1 -1
- package/package.json +4 -4
package/dist/vtable-calendar.js
CHANGED
|
@@ -34921,6 +34921,8 @@
|
|
|
34921
34921
|
RESIZE_COLUMN_END: "resize_column_end",
|
|
34922
34922
|
RESIZE_ROW: "resize_row",
|
|
34923
34923
|
RESIZE_ROW_END: "resize_row_end",
|
|
34924
|
+
MERGE_CELLS: "merge_cells",
|
|
34925
|
+
UNMERGE_CELLS: "unmerge_cells",
|
|
34924
34926
|
CHANGE_HEADER_POSITION_START: "change_header_position_start",
|
|
34925
34927
|
CHANGE_HEADER_POSITION: "change_header_position",
|
|
34926
34928
|
CHANGING_HEADER_POSITION: "changing_header_position",
|
|
@@ -37373,7 +37375,7 @@
|
|
|
37373
37375
|
}
|
|
37374
37376
|
clearFilteredChildren(record) {
|
|
37375
37377
|
var _a, _b;
|
|
37376
|
-
record.filteredChildren = void 0;
|
|
37378
|
+
record.filteredChildren = void 0, delete record.filteredChildren;
|
|
37377
37379
|
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]);
|
|
37378
37380
|
}
|
|
37379
37381
|
filterRecord(record) {
|
|
@@ -37476,8 +37478,9 @@
|
|
|
37476
37478
|
fieldPromiseCallBack(_index, _field, _value) {}
|
|
37477
37479
|
recordPromiseCallBack(_index, _record) {}
|
|
37478
37480
|
canChangeOrder(sourceIndex, targetIndex) {
|
|
37479
|
-
var _a;
|
|
37481
|
+
var _a, _b;
|
|
37480
37482
|
if (null === (_a = this.dataSourceObj) || void 0 === _a ? void 0 : _a.canChangeOrder) return this.dataSourceObj.canChangeOrder(sourceIndex, targetIndex);
|
|
37483
|
+
if (null === (_b = this.lastSortStates) || void 0 === _b ? void 0 : _b.some(state => "asc" === state.order || "desc" === state.order)) return !1;
|
|
37481
37484
|
if (this.hasHierarchyStateExpand) {
|
|
37482
37485
|
let sourceIndexs = this.currentPagerIndexedData[sourceIndex],
|
|
37483
37486
|
targetIndexs = this.currentPagerIndexedData[targetIndex];
|
|
@@ -41480,7 +41483,7 @@
|
|
|
41480
41483
|
function updateCell$1(col, row, table, addNew, isShadow, forceFastUpdate) {
|
|
41481
41484
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
|
|
41482
41485
|
const oldCellGroup = table.scenegraph.highPerformanceGetCell(col, row, !0);
|
|
41483
|
-
if ("cell" !== oldCellGroup.role && !addNew) return;
|
|
41486
|
+
if ("cell" !== oldCellGroup.role && "shadow-cell" !== oldCellGroup.role && !addNew) return;
|
|
41484
41487
|
const cellLocation = table.getCellLocation(col, row);
|
|
41485
41488
|
let isMerge,
|
|
41486
41489
|
range,
|
|
@@ -48930,7 +48933,7 @@
|
|
|
48930
48933
|
}), scene.tableGroup.role = "table";
|
|
48931
48934
|
const colHeaderGroup = createContainerGroup(0, 0, !scene.table.internalProps.enableTreeStickCell);
|
|
48932
48935
|
colHeaderGroup.role = "col-header", scene.colHeaderGroup = colHeaderGroup;
|
|
48933
|
-
const cornerHeaderGroup = createContainerGroup(0, 0, !scene.table.
|
|
48936
|
+
const cornerHeaderGroup = createContainerGroup(0, 0, !scene.table.internalProps.enableTreeStickCell);
|
|
48934
48937
|
cornerHeaderGroup.role = "corner-header", scene.cornerHeaderGroup = cornerHeaderGroup;
|
|
48935
48938
|
const rowHeaderGroup = createContainerGroup(0, 0, !0);
|
|
48936
48939
|
rowHeaderGroup.role = "row-header", scene.rowHeaderGroup = rowHeaderGroup;
|
|
@@ -51728,13 +51731,13 @@
|
|
|
51728
51731
|
setSortState(sortState) {
|
|
51729
51732
|
const state = this;
|
|
51730
51733
|
const sort = (sortState = !sortState || Array.isArray(sortState) ? sortState : [sortState]) && sortState.reduce((prev, item) => {
|
|
51731
|
-
var _a, _b, _c;
|
|
51734
|
+
var _a, _b, _c, _d, _e;
|
|
51732
51735
|
const column = null === (_a = function (columns) {
|
|
51733
51736
|
const result = [];
|
|
51734
51737
|
return function flatten(cols, parentStartIndex = 0) {
|
|
51735
51738
|
cols.forEach(col => {
|
|
51736
51739
|
var _a;
|
|
51737
|
-
const startIndex = col.startInTotal ? null !== (_a =
|
|
51740
|
+
const startIndex = col.startInTotal ? col.startInTotal + (null !== (_a = state.table.internalProps.layoutMap.leftRowSeriesNumberColumnCount) && void 0 !== _a ? _a : 0) : parentStartIndex;
|
|
51738
51741
|
col.columns ? flatten(col.columns, startIndex) : result.push(Object.assign(Object.assign({}, col), {
|
|
51739
51742
|
startIndex: startIndex
|
|
51740
51743
|
}));
|
|
@@ -51744,12 +51747,12 @@
|
|
|
51744
51747
|
return this.table.internalProps.transpose ? prev.push({
|
|
51745
51748
|
field: item.field,
|
|
51746
51749
|
order: item.order,
|
|
51747
|
-
row: null !== (_b =
|
|
51750
|
+
row: (null !== (_b = null == column ? void 0 : column.startInTotal) && void 0 !== _b ? _b : 0) + (null !== (_c = this.table.internalProps.layoutMap.leftRowSeriesNumberColumnCount) && void 0 !== _c ? _c : 0),
|
|
51748
51751
|
col: null == column ? void 0 : column.level
|
|
51749
51752
|
}) : prev.push({
|
|
51750
51753
|
field: item.field,
|
|
51751
51754
|
order: item.order,
|
|
51752
|
-
col: null !== (
|
|
51755
|
+
col: (null !== (_d = null == column ? void 0 : column.startInTotal) && void 0 !== _d ? _d : 0) + (null !== (_e = this.table.internalProps.layoutMap.leftRowSeriesNumberColumnCount) && void 0 !== _e ? _e : 0),
|
|
51753
51756
|
row: null == column ? void 0 : column.level
|
|
51754
51757
|
}), prev;
|
|
51755
51758
|
}, []);
|
|
@@ -52261,13 +52264,16 @@
|
|
|
52261
52264
|
this.select.selectInline = selectInline;
|
|
52262
52265
|
}
|
|
52263
52266
|
updateSortState(sortState) {
|
|
52264
|
-
var _a, _b, _c, _d, _e, _f, _g
|
|
52265
|
-
sortState = Array.isArray(sortState) ? sortState : [sortState]
|
|
52267
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
52268
|
+
const isSame = (sortState = Array.isArray(sortState) ? sortState : [sortState]).length === this.sort.length && sortState.every((item, index) => {
|
|
52269
|
+
var _a, _b;
|
|
52270
|
+
return (null == item ? void 0 : item.field) === (null === (_a = this.sort[index]) || void 0 === _a ? void 0 : _a.field) && (null == item ? void 0 : item.order) === (null === (_b = this.sort[index]) || void 0 === _b ? void 0 : _b.order);
|
|
52271
|
+
});
|
|
52272
|
+
if (isSame) return;
|
|
52266
52273
|
for (let index = 0; index < sortState.length; index++) {
|
|
52267
|
-
|
|
52268
|
-
|
|
52269
|
-
|
|
52270
|
-
"asc" === (null === (_e = this.sort[index]) || void 0 === _e ? void 0 : _e.order) || null === (_f = this.sort[index]) || void 0 === _f || _f.order;
|
|
52274
|
+
const oldSortCol = this.table.internalProps.multipleSort ? null : (null === (_a = this.sort[index]) || void 0 === _a ? void 0 : _a.col) || null,
|
|
52275
|
+
oldSortRow = this.table.internalProps.multipleSort ? null : (null === (_b = this.sort[index]) || void 0 === _b ? void 0 : _b.row) || null;
|
|
52276
|
+
"asc" === (null === (_c = this.sort[index]) || void 0 === _c ? void 0 : _c.order) || null === (_d = this.sort[index]) || void 0 === _d || _d.order;
|
|
52271
52277
|
this.setSortState(sortState.slice(0, index + 1));
|
|
52272
52278
|
const cellAddress = this.table.internalProps.layoutMap.getHeaderCellAddressByField(sortState[index].field);
|
|
52273
52279
|
this.sort[index].col = cellAddress.col, this.sort[index].row = cellAddress.row;
|
|
@@ -52280,7 +52286,7 @@
|
|
|
52280
52286
|
order: this.sort[index].order,
|
|
52281
52287
|
oldSortCol: oldSortCol,
|
|
52282
52288
|
oldSortRow: oldSortRow,
|
|
52283
|
-
oldIconMark: null === (
|
|
52289
|
+
oldIconMark: null === (_e = this.sort[index]) || void 0 === _e ? void 0 : _e.icon
|
|
52284
52290
|
});
|
|
52285
52291
|
}
|
|
52286
52292
|
const normalHeaders = [];
|
|
@@ -52294,7 +52300,7 @@
|
|
|
52294
52300
|
row: null,
|
|
52295
52301
|
iconMark: null,
|
|
52296
52302
|
order: null,
|
|
52297
|
-
oldSortCol: null !== (
|
|
52303
|
+
oldSortCol: (null !== (_f = column.startInTotal) && void 0 !== _f ? _f : 0) + (null !== (_g = this.table.internalProps.layoutMap.leftRowSeriesNumberColumnCount) && void 0 !== _g ? _g : 0),
|
|
52298
52304
|
oldSortRow: column.level,
|
|
52299
52305
|
oldIconMark: null
|
|
52300
52306
|
});
|
|
@@ -56547,7 +56553,7 @@
|
|
|
56547
56553
|
}
|
|
56548
56554
|
constructor(container, options = {}) {
|
|
56549
56555
|
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;
|
|
56550
|
-
if (super(), this.showFrozenIcon = !0, this._tableBorderWidth_left = 0, this._tableBorderWidth_right = 0, this._tableBorderWidth_top = 0, this._tableBorderWidth_bottom = 0, this.version = "1.
|
|
56556
|
+
if (super(), this.showFrozenIcon = !0, this._scrollToRowCorrectTimer = null, this._tableBorderWidth_left = 0, this._tableBorderWidth_right = 0, this._tableBorderWidth_top = 0, this._tableBorderWidth_bottom = 0, this.version = "1.24.0", 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");
|
|
56551
56557
|
this.pluginManager = new PluginManager(this, options), this.fireListeners(TABLE_EVENT_TYPE.BEFORE_INIT, {
|
|
56552
56558
|
options: options,
|
|
56553
56559
|
container: container
|
|
@@ -57485,12 +57491,15 @@
|
|
|
57485
57491
|
dispose() {
|
|
57486
57492
|
this.release();
|
|
57487
57493
|
}
|
|
57494
|
+
clearCorrectTimer() {
|
|
57495
|
+
this._scrollToRowCorrectTimer && (clearTimeout(this._scrollToRowCorrectTimer), this._scrollToRowCorrectTimer = null);
|
|
57496
|
+
}
|
|
57488
57497
|
release() {
|
|
57489
57498
|
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, _0, _1;
|
|
57490
57499
|
null === (_c = null === (_b = null === (_a = this.scenegraph) || void 0 === _a ? void 0 : _a.component) || void 0 === _b ? void 0 : _b.vScrollBar) || void 0 === _c || _c.release(), null === (_f = null === (_e = null === (_d = this.scenegraph) || void 0 === _d ? void 0 : _d.component) || void 0 === _e ? void 0 : _e.hScrollBar) || void 0 === _f || _f.release(), this.animationManager.clear(), this.animationManager.ticker.release(), null === (_j = null === (_h = null === (_g = this.scenegraph) || void 0 === _g ? void 0 : _g.stage) || void 0 === _h ? void 0 : _h.ticker) || void 0 === _j || _j.release();
|
|
57491
57500
|
const internalProps = this.internalProps;
|
|
57492
57501
|
if (this.isReleased) return;
|
|
57493
|
-
null === (_l = null === (_k = internalProps.tooltipHandler) || void 0 === _k ? void 0 : _k.release) || void 0 === _l || _l.call(_k), null === (_o = null === (_m = internalProps.menuHandler) || void 0 === _m ? void 0 : _m.release) || void 0 === _o || _o.call(_m), null === (_p = super.release) || void 0 === _p || _p.call(this), this.pluginManager.release(), null === (_r = null === (_q = internalProps.handler) || void 0 === _q ? void 0 : _q.release) || void 0 === _r || _r.call(_q), this.eventManager.release(), null === (_t = null === (_s = internalProps.focusControl) || void 0 === _s ? void 0 : _s.release) || void 0 === _t || _t.call(_s), null === (_u = internalProps.legends) || void 0 === _u || _u.forEach(legend => {
|
|
57502
|
+
this.clearCorrectTimer(), null === (_l = null === (_k = internalProps.tooltipHandler) || void 0 === _k ? void 0 : _k.release) || void 0 === _l || _l.call(_k), null === (_o = null === (_m = internalProps.menuHandler) || void 0 === _m ? void 0 : _m.release) || void 0 === _o || _o.call(_m), null === (_p = super.release) || void 0 === _p || _p.call(this), this.pluginManager.release(), null === (_r = null === (_q = internalProps.handler) || void 0 === _q ? void 0 : _q.release) || void 0 === _r || _r.call(_q), this.eventManager.release(), null === (_t = null === (_s = internalProps.focusControl) || void 0 === _s ? void 0 : _s.release) || void 0 === _t || _t.call(_s), null === (_u = internalProps.legends) || void 0 === _u || _u.forEach(legend => {
|
|
57494
57503
|
null == legend || legend.release();
|
|
57495
57504
|
}), null === (_v = internalProps.title) || void 0 === _v || _v.release(), internalProps.title = null, null === (_w = internalProps.emptyTip) || void 0 === _w || _w.release(), internalProps.emptyTip = null, internalProps.layoutMap.release(), internalProps.releaseList && (internalProps.releaseList.forEach(releaseObj => {
|
|
57496
57505
|
var _a;
|
|
@@ -57795,6 +57804,30 @@
|
|
|
57795
57804
|
lastSelectRange = currentSelectRanges[currentSelectRanges.length - 1];
|
|
57796
57805
|
lastSelectRange && (lastSelectRange.end.row = rowIndex), this.stateManager.updateSelectPos(this.colCount - 1, rowIndex, !1, isCtrl, !1, makeSelectCellVisible, !0), this.stateManager.select.selecting = !1;
|
|
57797
57806
|
}
|
|
57807
|
+
changeHeaderPosition(args) {
|
|
57808
|
+
var _a, _b, _c, _d, _e;
|
|
57809
|
+
if (!("canMoveHeaderPosition" in this.internalProps.layoutMap) || !0 === (null === (_a = this.options.customConfig) || void 0 === _a ? void 0 : _a.notUpdateInColumnRowMove)) return !1;
|
|
57810
|
+
const prevMoving = this.stateManager.columnMove.movingColumnOrRow;
|
|
57811
|
+
this.stateManager.columnMove.movingColumnOrRow = args.movingColumnOrRow;
|
|
57812
|
+
try {
|
|
57813
|
+
if (!1 === (null === (_c = (_b = this.internalProps.layoutMap).canMoveHeaderPosition) || void 0 === _c ? void 0 : _c.call(_b, args.source, args.target))) return !1;
|
|
57814
|
+
const oldSourceMergeInfo = this.getCellRange(args.source.col, args.source.row),
|
|
57815
|
+
oldTargetMergeInfo = this.getCellRange(args.target.col, args.target.row),
|
|
57816
|
+
moveContext = this._moveHeaderPosition(args.source, args.target);
|
|
57817
|
+
if (!moveContext || moveContext.targetIndex === moveContext.sourceIndex) return !1;
|
|
57818
|
+
this.internalProps.useOneRowHeightFillAll = !1, this.internalProps.layoutMap.clearCellRangeMap();
|
|
57819
|
+
const sourceMergeInfo = this.getCellRange(args.source.col, args.source.row),
|
|
57820
|
+
targetMergeInfo = this.getCellRange(args.target.col, args.target.row),
|
|
57821
|
+
colMin = Math.min(sourceMergeInfo.start.col, targetMergeInfo.start.col, oldSourceMergeInfo.start.col, oldTargetMergeInfo.start.col),
|
|
57822
|
+
colMax = Math.max(sourceMergeInfo.end.col, targetMergeInfo.end.col, oldSourceMergeInfo.end.col, oldTargetMergeInfo.end.col),
|
|
57823
|
+
rowMin = Math.min(sourceMergeInfo.start.row, targetMergeInfo.start.row, oldSourceMergeInfo.start.row, oldTargetMergeInfo.start.row);
|
|
57824
|
+
let rowMax = Math.max(sourceMergeInfo.end.row, targetMergeInfo.end.row, oldSourceMergeInfo.end.row, oldTargetMergeInfo.end.row);
|
|
57825
|
+
if ("row" === moveContext.moveType && "tree" === this.internalProps.layoutMap.rowHierarchyType && (rowMax = moveContext.targetIndex > moveContext.sourceIndex ? rowMax + moveContext.targetSize - 1 : rowMax + moveContext.sourceSize - 1), this.transpose || !this.isSeriesNumberInBody(args.source.col, args.source.row) && "row" !== args.movingColumnOrRow || (this.changeRecordOrder(moveContext.sourceIndex, moveContext.targetIndex), this.stateManager.changeCheckboxAndRadioOrder(moveContext.sourceIndex, moveContext.targetIndex)), "column" === moveContext.moveType) for (let col = colMin; col <= colMax; col++) this._clearColRangeWidthsMap(col);else for (let row = rowMin; row <= rowMax; row++) this._clearRowRangeHeightsMap(row);
|
|
57826
|
+
return this.clearCellStyleCache(), this.isSeriesNumberInBody(args.source.col, args.source.row) || "row" === args.movingColumnOrRow ? this.scenegraph.updateHeaderPosition(this.scenegraph.proxy.colStart, this.scenegraph.proxy.colEnd, this.scenegraph.proxy.rowStart, this.scenegraph.proxy.rowEnd, moveContext.moveType) : "column" === moveContext.moveType ? this.scenegraph.updateHeaderPosition(colMin, colMax, 0, -1, moveContext.moveType) : this.scenegraph.updateHeaderPosition(0, -1, rowMin, rowMax, moveContext.moveType), "adjustFrozenCount" === this.internalProps.frozenColDragHeaderMode && this.isListTable() && (this.isLeftFrozenColumn(args.target.col) && !this.isLeftFrozenColumn(args.source.col) ? this.frozenColCount += sourceMergeInfo.end.col - sourceMergeInfo.start.col + 1 : this.isLeftFrozenColumn(args.source.col) && !this.isLeftFrozenColumn(args.target.col) && (this.frozenColCount -= sourceMergeInfo.end.col - sourceMergeInfo.start.col + 1), this.isRightFrozenColumn(args.target.col) && !this.isRightFrozenColumn(args.source.col) ? this.rightFrozenColCount += sourceMergeInfo.end.col - sourceMergeInfo.start.col + 1 : this.isRightFrozenColumn(args.source.col) && !this.isRightFrozenColumn(args.target.col) && (this.rightFrozenColCount -= sourceMergeInfo.end.col - sourceMergeInfo.start.col + 1)), null === (_e = (_d = this.scenegraph).updateNextFrame) || void 0 === _e || _e.call(_d), !0;
|
|
57827
|
+
} finally {
|
|
57828
|
+
this.stateManager.columnMove.movingColumnOrRow = prevMoving;
|
|
57829
|
+
}
|
|
57830
|
+
}
|
|
57798
57831
|
get recordsCount() {
|
|
57799
57832
|
var _a;
|
|
57800
57833
|
return null === (_a = this.records) || void 0 === _a ? void 0 : _a.length;
|
|
@@ -57940,7 +57973,7 @@
|
|
|
57940
57973
|
getCustomMerge(col, row) {
|
|
57941
57974
|
if (this.internalProps.customMergeCell) {
|
|
57942
57975
|
const customMerge = this.internalProps.customMergeCell(col, row, this);
|
|
57943
|
-
if (customMerge && customMerge.range
|
|
57976
|
+
if (customMerge && customMerge.range) {
|
|
57944
57977
|
if (customMerge.style) {
|
|
57945
57978
|
const styleClass = this.internalProps.bodyHelper.getStyleClass("text"),
|
|
57946
57979
|
style = customMerge.style,
|
|
@@ -58651,12 +58684,34 @@
|
|
|
58651
58684
|
this.eventManager.enableScroll();
|
|
58652
58685
|
}
|
|
58653
58686
|
getGroupTitleLevel(col, row) {}
|
|
58687
|
+
getTargetScrollTop(row) {
|
|
58688
|
+
const drawRange = this.getDrawRange(),
|
|
58689
|
+
frozenHeight = this.getFrozenRowsHeight();
|
|
58690
|
+
return Math.max(0, Math.min(this.getRowsHeight(0, row - 1) - frozenHeight, this.getAllRowsHeight() - drawRange.height));
|
|
58691
|
+
}
|
|
58692
|
+
_scheduleScrollToRowCorrect(row, delay = 0) {
|
|
58693
|
+
this._scrollToRowCorrectTimer = setTimeout(() => {
|
|
58694
|
+
this.clearCorrectTimer();
|
|
58695
|
+
const targetScrollTop = this.getTargetScrollTop(row);
|
|
58696
|
+
if (targetScrollTop !== this.scrollTop) {
|
|
58697
|
+
this.scrollTop = targetScrollTop;
|
|
58698
|
+
const correctedTargetScrollTop = this.getTargetScrollTop(row);
|
|
58699
|
+
correctedTargetScrollTop !== this.scrollTop && (this.scrollTop = correctedTargetScrollTop);
|
|
58700
|
+
}
|
|
58701
|
+
}, delay);
|
|
58702
|
+
}
|
|
58654
58703
|
scrollToRow(row, animationOption) {
|
|
58655
|
-
|
|
58656
|
-
|
|
58657
|
-
|
|
58658
|
-
row:
|
|
58659
|
-
});
|
|
58704
|
+
var _a;
|
|
58705
|
+
const targetRow = Math.min(Math.max(Math.floor(row), 0), this.rowCount - 1);
|
|
58706
|
+
if (this.clearCorrectTimer(), !animationOption) return this.scrollToCell({
|
|
58707
|
+
row: targetRow
|
|
58708
|
+
}), void this._scheduleScrollToRowCorrect(targetRow);
|
|
58709
|
+
const duration = isBoolean$2(animationOption) ? 3e3 : null !== (_a = null == animationOption ? void 0 : animationOption.duration) && void 0 !== _a ? _a : 3e3;
|
|
58710
|
+
this.animationManager.scrollTo({
|
|
58711
|
+
row: targetRow
|
|
58712
|
+
}, animationOption), this._scrollToRowCorrectTimer = setTimeout(() => {
|
|
58713
|
+
this.scrollToRow(targetRow, !1);
|
|
58714
|
+
}, duration);
|
|
58660
58715
|
}
|
|
58661
58716
|
scrollToCol(col, animationOption) {
|
|
58662
58717
|
animationOption ? this.animationManager.scrollTo({
|
|
@@ -58675,8 +58730,8 @@
|
|
|
58675
58730
|
}
|
|
58676
58731
|
if (isValid$1(cellAddr.row) && cellAddr.row >= this.frozenRowCount) {
|
|
58677
58732
|
const frozenHeight = this.getFrozenRowsHeight(),
|
|
58678
|
-
top = this.
|
|
58679
|
-
this.scrollTop = Math.min(top - frozenHeight, this.
|
|
58733
|
+
top = this.rowHeightsMap.getSumInRange(0, cellAddr.row - 1);
|
|
58734
|
+
this.scrollTop = Math.min(top - frozenHeight, this.rowHeightsMap.getSumInRange(0, this.rowCount - 1) - drawRange.height);
|
|
58680
58735
|
}
|
|
58681
58736
|
this.render();
|
|
58682
58737
|
}
|
|
@@ -59288,9 +59343,24 @@
|
|
|
59288
59343
|
return layout._cellRangeMap.set(`$${col}$${row}`, cellRange), cellRange;
|
|
59289
59344
|
}
|
|
59290
59345
|
function getTreeTitleMerge(col, row, cellRange, layout) {
|
|
59346
|
+
var _a;
|
|
59291
59347
|
if ("tree" !== layout.rowHierarchyType) return;
|
|
59292
|
-
const
|
|
59293
|
-
|
|
59348
|
+
const table = layout._table,
|
|
59349
|
+
internalProps = table.internalProps || {},
|
|
59350
|
+
isGroupMode = !!internalProps.groupBy,
|
|
59351
|
+
cellRecord = table.getCellRawRecord(col, row);
|
|
59352
|
+
if (!(null == cellRecord ? void 0 : cellRecord.vtableMerge)) return;
|
|
59353
|
+
const treeTitleStartCol = internalProps.groupTitleCheckbox && internalProps.rowSeriesNumber ? layout.rowHeaderLevelCount + layout.leftRowSeriesNumberColumnCount : layout.rowHeaderLevelCount;
|
|
59354
|
+
if (!(col < treeTitleStartCol) && (cellRange.start.col = treeTitleStartCol, cellRange.end.col = layout.colCount - 1, cellRange.start.row = cellRange.end.row = row, isGroupMode && 1 === (null === (_a = layout.columnObjects) || void 0 === _a ? void 0 : _a.length))) {
|
|
59355
|
+
const onlyColumn = layout.columnObjects[0],
|
|
59356
|
+
field = null == onlyColumn ? void 0 : onlyColumn.field;
|
|
59357
|
+
if (null != field) {
|
|
59358
|
+
let text = cellRecord.vtableMergeName;
|
|
59359
|
+
const groupTitleFieldFormat = internalProps.groupTitleFieldFormat;
|
|
59360
|
+
"function" == typeof groupTitleFieldFormat && (text = groupTitleFieldFormat(cellRecord, col, row, table));
|
|
59361
|
+
null == cellRecord[field] && null != text && (cellRecord[field] = text);
|
|
59362
|
+
}
|
|
59363
|
+
}
|
|
59294
59364
|
}
|
|
59295
59365
|
function getCellRangeTranspose(col, row, layout) {
|
|
59296
59366
|
var _a, _b, _c, _d;
|
|
@@ -60207,7 +60277,7 @@
|
|
|
60207
60277
|
this.listenersId.push(doubleClickEventId, clickEventId, selectedChangedEventId);
|
|
60208
60278
|
}
|
|
60209
60279
|
startEditCell(col, row, value, editElement) {
|
|
60210
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
|
60280
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
|
60211
60281
|
if (this.editingEditor) return;
|
|
60212
60282
|
const editor = this.table.getEditor(col, row);
|
|
60213
60283
|
if (editor) {
|
|
@@ -60223,7 +60293,8 @@
|
|
|
60223
60293
|
col: col,
|
|
60224
60294
|
row: row
|
|
60225
60295
|
}), this.table._makeVisibleCell(col, row), this.editingEditor = editor;
|
|
60226
|
-
const
|
|
60296
|
+
const customMergeText = null === (_j = this.table.getCustomMerge(col, row)) || void 0 === _j ? void 0 : _j.text,
|
|
60297
|
+
dataValue = isValid$1(value) ? value : isValid$1(customMergeText) ? customMergeText : this.table.getCellOriginValue(col, row),
|
|
60227
60298
|
rect = this.table.getCellRangeRelativeRect(this.table.getCellRange(col, row)),
|
|
60228
60299
|
referencePosition = {
|
|
60229
60300
|
rect: {
|
|
@@ -60233,9 +60304,9 @@
|
|
|
60233
60304
|
height: rect.height
|
|
60234
60305
|
}
|
|
60235
60306
|
};
|
|
60236
|
-
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 === (
|
|
60307
|
+
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 === (_k = editor.beginEditing) || void 0 === _k || _k.call(editor, this.table.getElement(), referencePosition, dataValue), editor.bindSuccessCallback, null === (_l = editor.bindSuccessCallback) || void 0 === _l || _l.call(editor, () => {
|
|
60237
60308
|
this.completeEdit();
|
|
60238
|
-
}), null === (
|
|
60309
|
+
}), null === (_m = editor.onStart) || void 0 === _m || _m.call(editor, {
|
|
60239
60310
|
value: dataValue,
|
|
60240
60311
|
endEdit: () => {
|
|
60241
60312
|
this.completeEdit();
|
|
@@ -60249,7 +60320,7 @@
|
|
|
60249
60320
|
}
|
|
60250
60321
|
}
|
|
60251
60322
|
completeEdit(e) {
|
|
60252
|
-
var _a, _b;
|
|
60323
|
+
var _a, _b, _c;
|
|
60253
60324
|
if (!this.editingEditor) return !0;
|
|
60254
60325
|
if (this.isValidatingValue) return !1;
|
|
60255
60326
|
this.cacheLastSelectedCellEditor = {};
|
|
@@ -60263,9 +60334,10 @@
|
|
|
60263
60334
|
if (this.editingEditor.getValue, this.editingEditor.validateValue) {
|
|
60264
60335
|
this.isValidatingValue = !0;
|
|
60265
60336
|
const newValue = this.editingEditor.getValue(),
|
|
60266
|
-
|
|
60337
|
+
customMergeText = null === (_a = this.table.getCustomMerge(this.editCell.col, this.editCell.row)) || void 0 === _a ? void 0 : _a.text,
|
|
60338
|
+
oldValue = isValid$1(customMergeText) ? customMergeText : this.table.getCellOriginValue(this.editCell.col, this.editCell.row),
|
|
60267
60339
|
target = null == e ? void 0 : e.target,
|
|
60268
|
-
maybePromiseOrValue = null === (
|
|
60340
|
+
maybePromiseOrValue = null === (_c = (_b = this.editingEditor).validateValue) || void 0 === _c ? void 0 : _c.call(_b, newValue, oldValue, this.editCell, this.table, !!this.table.getElement().contains(target));
|
|
60269
60341
|
return isPromise(maybePromiseOrValue) ? (this.isValidatingValue = !0, new Promise((resolve, reject) => {
|
|
60270
60342
|
maybePromiseOrValue.then(result => {
|
|
60271
60343
|
dealWithValidateValue(result, this, oldValue, resolve);
|
|
@@ -60279,14 +60351,17 @@
|
|
|
60279
60351
|
doExit() {
|
|
60280
60352
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
60281
60353
|
const changedValue = null === (_b = (_a = this.editingEditor).getValue) || void 0 === _b ? void 0 : _b.call(_a),
|
|
60282
|
-
range = this.table.getCellRange(this.editCell.col, this.editCell.row)
|
|
60283
|
-
|
|
60284
|
-
|
|
60285
|
-
|
|
60286
|
-
|
|
60287
|
-
|
|
60354
|
+
range = this.table.getCellRange(this.editCell.col, this.editCell.row);
|
|
60355
|
+
if (null === (_d = (_c = this.editingEditor).beforeEnd) || void 0 === _d || _d.call(_c), range.isCustom) this.table.changeCellValue(range.start.col, range.start.row, changedValue);else {
|
|
60356
|
+
const changedValues = [];
|
|
60357
|
+
for (let row = range.start.row; row <= range.end.row; row++) {
|
|
60358
|
+
const rowChangedValues = [];
|
|
60359
|
+
for (let col = range.start.col; col <= range.end.col; col++) rowChangedValues.push(changedValue);
|
|
60360
|
+
changedValues.push(rowChangedValues);
|
|
60361
|
+
}
|
|
60362
|
+
this.table.changeCellValues(range.start.col, range.start.row, changedValues);
|
|
60288
60363
|
}
|
|
60289
|
-
|
|
60364
|
+
this.editingEditor.exit, null === (_f = (_e = this.editingEditor).exit) || void 0 === _f || _f.call(_e), null === (_h = (_g = this.editingEditor).onEnd) || void 0 === _h || _h.call(_g), this.editingEditor = null, this.isValidatingValue = !1, this.beginTriggerEditCellMode = null;
|
|
60290
60365
|
}
|
|
60291
60366
|
cancelEdit() {
|
|
60292
60367
|
var _a, _b, _c, _d;
|
|
@@ -60346,7 +60421,18 @@
|
|
|
60346
60421
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
60347
60422
|
});
|
|
60348
60423
|
};
|
|
60424
|
+
function refreshCustomMergeCellGroups(table) {
|
|
60425
|
+
var _a;
|
|
60426
|
+
if (!Array.isArray(table.options.customMergeCell)) return;
|
|
60427
|
+
table.internalProps.customMergeCell = getCustomMergeCellFunc(table.options.customMergeCell);
|
|
60428
|
+
const merges = table.options.customMergeCell;
|
|
60429
|
+
for (let i = 0; i < merges.length; i++) {
|
|
60430
|
+
const r = null === (_a = merges[i]) || void 0 === _a ? void 0 : _a.range;
|
|
60431
|
+
if (null == r ? void 0 : r.start) for (let col = r.start.col; col <= r.end.col; col++) for (let row = r.start.row; row <= r.end.row; row++) table.scenegraph.updateCellContent(col, row);
|
|
60432
|
+
}
|
|
60433
|
+
}
|
|
60349
60434
|
function listTableChangeCellValue(col, row, value, workOnEditableCell, triggerEvent, table, noTriggerChangeCellValuesEvent) {
|
|
60435
|
+
var _a, _b;
|
|
60350
60436
|
if (workOnEditableCell && table.isHasEditorDefine(col, row) || !1 === workOnEditableCell) {
|
|
60351
60437
|
const recordShowIndex = table.getRecordShowIndexByCell(col, row),
|
|
60352
60438
|
recordIndex = recordShowIndex >= 0 ? table.dataSource.getIndexKey(recordShowIndex) : void 0,
|
|
@@ -60356,8 +60442,12 @@
|
|
|
60356
60442
|
beforeChangeValue = table.getCellRawValue(col, row),
|
|
60357
60443
|
oldValue = table.getCellOriginValue(col, row);
|
|
60358
60444
|
table.isHeader(col, row) ? table.internalProps.layoutMap.updateColumnTitle(col, row, value) : table.dataSource.changeFieldValue(value, recordShowIndex, field, col, row, table);
|
|
60359
|
-
const range = table.getCellRange(col, row)
|
|
60360
|
-
|
|
60445
|
+
const range = table.getCellRange(col, row);
|
|
60446
|
+
if (range.isCustom && range.start.col === col && range.start.row === row && Array.isArray(table.options.customMergeCell) && "function" == typeof table.getCellValue) {
|
|
60447
|
+
const customMerge = null === (_b = null === (_a = table.internalProps) || void 0 === _a ? void 0 : _a.customMergeCell) || void 0 === _b ? void 0 : _b.call(_a, col, row, table);
|
|
60448
|
+
customMerge && (customMerge.text = value);
|
|
60449
|
+
}
|
|
60450
|
+
const aggregators = table.internalProps.layoutMap.getAggregatorsByCell(col, row);
|
|
60361
60451
|
if (aggregators) {
|
|
60362
60452
|
if (Array.isArray(aggregators)) for (let i = 0; i < (null == aggregators ? void 0 : aggregators.length); i++) aggregators[i].recalculate();else aggregators.recalculate();
|
|
60363
60453
|
const aggregatorCells = table.internalProps.layoutMap.getAggregatorCellAddress(range.start.col, range.start.row, range.end.col, range.end.row);
|
|
@@ -60580,7 +60670,13 @@
|
|
|
60580
60670
|
(void 0 === recordIndex || recordIndex > table.dataSource.sourceLength) && (recordIndex = table.dataSource.sourceLength);
|
|
60581
60671
|
const headerCount = table.transpose ? table.rowHeaderLevelCount : table.columnHeaderLevelCount,
|
|
60582
60672
|
syncToOriginalRecords = !!(null === (_f = table.options) || void 0 === _f ? void 0 : _f.syncRecordOperationsToSourceRecords);
|
|
60583
|
-
if (table.dataSource.addRecord(record, recordIndex, syncToOriginalRecords), adjustCheckBoxStateMapWithAddRecordIndex(table, recordIndex, 1), syncToOriginalRecords)
|
|
60673
|
+
if (table.dataSource.addRecord(record, recordIndex, syncToOriginalRecords), adjustCheckBoxStateMapWithAddRecordIndex(table, recordIndex, 1), syncToOriginalRecords) {
|
|
60674
|
+
if (!table.transpose) {
|
|
60675
|
+
const insertRowIndex = recordIndex + headerCount + table.internalProps.layoutMap.hasAggregationOnTopCount;
|
|
60676
|
+
table.rowHeightsMap.insert(insertRowIndex);
|
|
60677
|
+
}
|
|
60678
|
+
return table.refreshRowColCount(), table.internalProps.layoutMap.clearCellRangeMap(), table.scenegraph.clearCells(), table.scenegraph.createSceneGraph(!0), !0;
|
|
60679
|
+
}
|
|
60584
60680
|
const oldRowCount = table.rowCount;
|
|
60585
60681
|
if (table.refreshRowColCount(), 0 === table.scenegraph.proxy.totalActualBodyRowCount) return table.scenegraph.clearCells(), table.scenegraph.createSceneGraph(), !0;
|
|
60586
60682
|
const newRowCount = table.transpose ? table.colCount : table.rowCount;
|
|
@@ -60658,7 +60754,13 @@
|
|
|
60658
60754
|
void 0 === recordIndex || recordIndex > table.dataSource.sourceLength ? recordIndex = table.dataSource.sourceLength : recordIndex < 0 && (recordIndex = 0);
|
|
60659
60755
|
const headerCount = table.transpose ? table.rowHeaderLevelCount : table.columnHeaderLevelCount,
|
|
60660
60756
|
syncToOriginalRecords = !!(null === (_f = table.options) || void 0 === _f ? void 0 : _f.syncRecordOperationsToSourceRecords);
|
|
60661
|
-
if (table.dataSource.addRecords(records, recordIndex, syncToOriginalRecords), adjustCheckBoxStateMapWithAddRecordIndex(table, recordIndex, records.length), syncToOriginalRecords)
|
|
60757
|
+
if (table.dataSource.addRecords(records, recordIndex, syncToOriginalRecords), adjustCheckBoxStateMapWithAddRecordIndex(table, recordIndex, records.length), syncToOriginalRecords) {
|
|
60758
|
+
if (!table.transpose) {
|
|
60759
|
+
const insertRowIndex = recordIndex + headerCount + table.internalProps.layoutMap.hasAggregationOnTopCount;
|
|
60760
|
+
for (let i = 0; i < records.length; i++) table.rowHeightsMap.insert(insertRowIndex);
|
|
60761
|
+
}
|
|
60762
|
+
return table.refreshRowColCount(), table.internalProps.layoutMap.clearCellRangeMap(), table.scenegraph.clearCells(), table.scenegraph.createSceneGraph(!0), !0;
|
|
60763
|
+
}
|
|
60662
60764
|
const oldRowCount = table.transpose ? table.colCount : table.rowCount;
|
|
60663
60765
|
if (table.refreshRowColCount(), 0 === table.scenegraph.proxy.totalActualBodyRowCount) return table.scenegraph.clearCells(), table.scenegraph.createSceneGraph(), !0;
|
|
60664
60766
|
const newRowCount = table.transpose ? table.colCount : table.rowCount;
|
|
@@ -60727,7 +60829,7 @@
|
|
|
60727
60829
|
}
|
|
60728
60830
|
}
|
|
60729
60831
|
function listTableDeleteRecords(recordIndexs, table) {
|
|
60730
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
60832
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
|
|
60731
60833
|
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) {
|
|
60732
60834
|
const deletedRecordIndexs = null === (_d = (_c = table.dataSource).deleteRecordsForTree) || void 0 === _d ? void 0 : _d.call(_c, recordIndexs);
|
|
60733
60835
|
if (0 === deletedRecordIndexs.length) return;
|
|
@@ -60739,8 +60841,17 @@
|
|
|
60739
60841
|
const syncToOriginalRecords = !!(null === (_f = table.options) || void 0 === _f ? void 0 : _f.syncRecordOperationsToSourceRecords),
|
|
60740
60842
|
deletedRecordIndexs = table.dataSource.deleteRecords(recordIndexs, syncToOriginalRecords);
|
|
60741
60843
|
if (0 === deletedRecordIndexs.length) return;
|
|
60844
|
+
Array.isArray(table.options.customMergeCell) && (table.internalProps.customMergeCell = getCustomMergeCellFunc(table.options.customMergeCell));
|
|
60742
60845
|
for (let index = 0; index < deletedRecordIndexs.length; index++) adjustCheckBoxStateMapWithDeleteRecordIndex(table, deletedRecordIndexs[index], 1);
|
|
60743
|
-
if (syncToOriginalRecords)
|
|
60846
|
+
if (syncToOriginalRecords) {
|
|
60847
|
+
if (!table.transpose) {
|
|
60848
|
+
const headerCount = table.transpose ? table.rowHeaderLevelCount : table.columnHeaderLevelCount,
|
|
60849
|
+
topAggregationCount = table.internalProps.layoutMap.hasAggregationOnTopCount,
|
|
60850
|
+
sorted = [...deletedRecordIndexs].sort((a, b) => b - a);
|
|
60851
|
+
for (let i = 0; i < sorted.length; i++) table.rowHeightsMap.delete(sorted[i] + headerCount + topAggregationCount);
|
|
60852
|
+
}
|
|
60853
|
+
return table.refreshRowColCount(), table.internalProps.layoutMap.clearCellRangeMap(), table.scenegraph.clearCells(), void table.scenegraph.createSceneGraph(!0);
|
|
60854
|
+
}
|
|
60744
60855
|
const oldRowCount = table.transpose ? table.colCount : table.rowCount;
|
|
60745
60856
|
table.refreshRowColCount();
|
|
60746
60857
|
const newRowCount = table.transpose ? table.colCount : table.rowCount,
|
|
@@ -60778,7 +60889,7 @@
|
|
|
60778
60889
|
col: 0,
|
|
60779
60890
|
row: row
|
|
60780
60891
|
});
|
|
60781
|
-
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();
|
|
60892
|
+
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(), refreshCustomMergeCellGroups(table);
|
|
60782
60893
|
}
|
|
60783
60894
|
} else {
|
|
60784
60895
|
const delRows = [],
|
|
@@ -60796,6 +60907,42 @@
|
|
|
60796
60907
|
});
|
|
60797
60908
|
}
|
|
60798
60909
|
const updateRows = [];
|
|
60910
|
+
if (table.internalProps.customMergeCell) {
|
|
60911
|
+
const proxy = table.scenegraph.proxy,
|
|
60912
|
+
deletedIndexNums = (recordIndexsMinToMax[0], recordIndexsMinToMax.map(recordIndex => recordIndex + headerCount + topAggregationCount)),
|
|
60913
|
+
minIndexNum = deletedIndexNums[0];
|
|
60914
|
+
let updateMin = minIndexNum,
|
|
60915
|
+
updateMax = minIndexNum;
|
|
60916
|
+
if (Array.isArray(table.options.customMergeCell)) {
|
|
60917
|
+
const merges = table.options.customMergeCell,
|
|
60918
|
+
axis = table.transpose ? "col" : "row";
|
|
60919
|
+
merges.forEach(m => {
|
|
60920
|
+
const r = null == m ? void 0 : m.range;
|
|
60921
|
+
if ((null == r ? void 0 : r.start) && (null == r ? void 0 : r.end)) for (let i = 0; i < deletedIndexNums.length; i++) {
|
|
60922
|
+
const deleteIndex = deletedIndexNums[i];
|
|
60923
|
+
if (r.end[axis] >= deleteIndex - 1) {
|
|
60924
|
+
updateMin = Math.min(updateMin, r.start[axis]), updateMax = Math.max(updateMax, r.end[axis]);
|
|
60925
|
+
break;
|
|
60926
|
+
}
|
|
60927
|
+
}
|
|
60928
|
+
});
|
|
60929
|
+
}
|
|
60930
|
+
if (table.transpose) {
|
|
60931
|
+
const start = Math.max(updateMin, null !== (_j = null == proxy ? void 0 : proxy.colStart) && void 0 !== _j ? _j : updateMin),
|
|
60932
|
+
end = Math.min(updateMax, null !== (_k = null == proxy ? void 0 : proxy.colEnd) && void 0 !== _k ? _k : updateMax);
|
|
60933
|
+
for (let col = start; col <= end; col++) updateRows.push({
|
|
60934
|
+
col: col,
|
|
60935
|
+
row: 0
|
|
60936
|
+
});
|
|
60937
|
+
} else {
|
|
60938
|
+
const start = Math.max(updateMin, null !== (_l = null == proxy ? void 0 : proxy.rowStart) && void 0 !== _l ? _l : updateMin),
|
|
60939
|
+
end = Math.min(updateMax, null !== (_m = null == proxy ? void 0 : proxy.rowEnd) && void 0 !== _m ? _m : updateMax);
|
|
60940
|
+
for (let row = start; row <= end; row++) updateRows.push({
|
|
60941
|
+
col: 0,
|
|
60942
|
+
row: row
|
|
60943
|
+
});
|
|
60944
|
+
}
|
|
60945
|
+
}
|
|
60799
60946
|
for (let row = headerCount; row < headerCount + topAggregationCount; row++) table.transpose ? updateRows.push({
|
|
60800
60947
|
col: row,
|
|
60801
60948
|
row: 0
|
|
@@ -60810,7 +60957,7 @@
|
|
|
60810
60957
|
col: 0,
|
|
60811
60958
|
row: row
|
|
60812
60959
|
});
|
|
60813
|
-
null === (
|
|
60960
|
+
null === (_o = table.reactCustomLayout) || void 0 === _o || _o.clearCache(), table.transpose ? table.scenegraph.updateCol(delRows, [], updateRows) : table.scenegraph.updateRow(delRows, [], updateRows), null === (_p = table.reactCustomLayout) || void 0 === _p || _p.updateAllCustomCell(), refreshCustomMergeCellGroups(table);
|
|
60814
60961
|
}
|
|
60815
60962
|
}
|
|
60816
60963
|
}
|
|
@@ -60822,7 +60969,7 @@
|
|
|
60822
60969
|
const syncToOriginalRecords = !!(null === (_f = table.options) || void 0 === _f ? void 0 : _f.syncRecordOperationsToSourceRecords),
|
|
60823
60970
|
updateRecordIndexs = table.dataSource.updateRecords(records, recordIndexs, syncToOriginalRecords);
|
|
60824
60971
|
if (0 === updateRecordIndexs.length) return;
|
|
60825
|
-
if (syncToOriginalRecords) return table.refreshRowColCount(), table.internalProps.layoutMap.clearCellRangeMap(), table.scenegraph.clearCells(), void table.scenegraph.createSceneGraph();
|
|
60972
|
+
if (syncToOriginalRecords) return table.refreshRowColCount(), table.internalProps.layoutMap.clearCellRangeMap(), table.scenegraph.clearCells(), void table.scenegraph.createSceneGraph(!0);
|
|
60826
60973
|
const recordIndexsMinToMax = updateRecordIndexs.map(index => table.getBodyRowIndexByRecordIndex(index)).sort((a, b) => a - b);
|
|
60827
60974
|
if (table.pagination) {
|
|
60828
60975
|
const {
|
|
@@ -61145,10 +61292,33 @@
|
|
|
61145
61292
|
this._hasAutoImageColumn = void 0, this.refreshHeader(), this.records && checkHasAggregationOnColumnDefine(this.internalProps.columns) && this.dataSource.processRecords(null !== (_b = null === (_a = this.dataSource.dataSourceObj) || void 0 === _a ? void 0 : _a.records) && void 0 !== _b ? _b : this.dataSource.dataSourceObj), this.internalProps.useOneRowHeightFillAll = !1, this.headerStyleCache = new Map(), this.bodyStyleCache = new Map(), this.bodyBottomStyleCache = new Map(), this._updateSize(), this.scenegraph.createSceneGraph(), this.stateManager.updateHoverPos(oldHoverState.col, oldHoverState.row), this.renderAsync(), this.eventManager.updateEventBinder();
|
|
61146
61293
|
}
|
|
61147
61294
|
addColumns(toAddColumns, colIndex, isMaintainArrayData = !0) {
|
|
61148
|
-
var _a;
|
|
61295
|
+
var _a, _b;
|
|
61149
61296
|
const columns = this.options.columns;
|
|
61297
|
+
if (Array.isArray(this.options.customMergeCell) && (null == toAddColumns ? void 0 : toAddColumns.length)) {
|
|
61298
|
+
const axis = this.transpose ? "row" : "col";
|
|
61299
|
+
let insertIndex = colIndex;
|
|
61300
|
+
void 0 === insertIndex ? insertIndex = columns.length : insertIndex < 0 ? insertIndex = 0 : insertIndex > columns.length && (insertIndex = columns.length);
|
|
61301
|
+
const toAddCount = toAddColumns.length,
|
|
61302
|
+
merges = this.options.customMergeCell.map(m => Object.assign(Object.assign({}, m), {
|
|
61303
|
+
range: {
|
|
61304
|
+
start: Object.assign({}, m.range.start),
|
|
61305
|
+
end: Object.assign({}, m.range.end)
|
|
61306
|
+
}
|
|
61307
|
+
}));
|
|
61308
|
+
for (let i = 0; i < merges.length; i++) {
|
|
61309
|
+
const r = null === (_a = merges[i]) || void 0 === _a ? void 0 : _a.range;
|
|
61310
|
+
if (!(null == r ? void 0 : r.start) || !(null == r ? void 0 : r.end)) continue;
|
|
61311
|
+
const start = r.start[axis],
|
|
61312
|
+
end = r.end[axis];
|
|
61313
|
+
end < insertIndex || (start > insertIndex ? (r.start[axis] = start + toAddCount, r.end[axis] = end + toAddCount) : r.end[axis] = end + toAddCount);
|
|
61314
|
+
}
|
|
61315
|
+
this.options.customMergeCell = merges.filter(m => {
|
|
61316
|
+
const r = null == m ? void 0 : m.range;
|
|
61317
|
+
return !(!(null == r ? void 0 : r.start) || !(null == r ? void 0 : r.end)) && !(r.end.row < r.start.row || r.end.col < r.start.col) && !(r.start.row === r.end.row && r.start.col === r.end.col);
|
|
61318
|
+
}), this.internalProps.customMergeCell = getCustomMergeCellFunc(this.options.customMergeCell);
|
|
61319
|
+
}
|
|
61150
61320
|
void 0 === colIndex ? (colIndex = columns.length, columns.push(...toAddColumns)) : columns.splice(colIndex, 0, ...toAddColumns);
|
|
61151
|
-
for (let i = 0; i < toAddColumns.length; i++) this.colWidthsMap.addAndReorder(colIndex + i, null !== (
|
|
61321
|
+
for (let i = 0; i < toAddColumns.length; i++) this.colWidthsMap.addAndReorder(colIndex + i, null !== (_b = toAddColumns[i].width) && void 0 !== _b ? _b : this.internalProps.defaultColWidth);
|
|
61152
61322
|
this.internalProps._colRangeWidthsMap.clear();
|
|
61153
61323
|
const resizedColIndexs = Array.from(this.internalProps._widthResizedColMap.keys());
|
|
61154
61324
|
for (let i = 0; i < resizedColIndexs.length; i++) resizedColIndexs[i] >= colIndex && (this.internalProps._widthResizedColMap.delete(resizedColIndexs[i]), this.internalProps._widthResizedColMap.add(resizedColIndexs[i] + toAddColumns.length));
|
|
@@ -61161,15 +61331,46 @@
|
|
|
61161
61331
|
}
|
|
61162
61332
|
this.updateColumns(columns, {
|
|
61163
61333
|
clearRowHeightCache: !1
|
|
61164
|
-
}), this.
|
|
61334
|
+
}), Array.isArray(this.options.customMergeCell) && (this.internalProps.customMergeCell = getCustomMergeCellFunc(this.options.customMergeCell), this.options.customMergeCell.forEach(m => {
|
|
61335
|
+
const r = null == m ? void 0 : m.range;
|
|
61336
|
+
if (null == r ? void 0 : r.start) for (let col = r.start.col; col <= r.end.col; col++) for (let row = r.start.row; row <= r.end.row; row++) this.scenegraph.updateCellContent(col, row);
|
|
61337
|
+
}), this.scenegraph.updateNextFrame()), this.fireListeners(TABLE_EVENT_TYPE.ADD_COLUMN, {
|
|
61165
61338
|
columnIndex: colIndex,
|
|
61166
61339
|
columnCount: toAddColumns.length,
|
|
61167
61340
|
columns: columns
|
|
61168
61341
|
});
|
|
61169
61342
|
}
|
|
61170
61343
|
deleteColumns(deleteColIndexs, isMaintainArrayData = !0) {
|
|
61344
|
+
var _a;
|
|
61171
61345
|
const columns = this.options.columns;
|
|
61172
61346
|
deleteColIndexs.sort((a, b) => b - a);
|
|
61347
|
+
const deletedColumns = deleteColIndexs.map(idx => cloneDeepSpec(columns[idx], ["children"]));
|
|
61348
|
+
let deletedRecordValues;
|
|
61349
|
+
if (Array.isArray(this.options.customMergeCell) && (null == deleteColIndexs ? void 0 : deleteColIndexs.length)) {
|
|
61350
|
+
const axis = this.transpose ? "row" : "col",
|
|
61351
|
+
deleteIndexNums = deleteColIndexs.slice().sort((a, b) => a - b).map((idx, i) => idx - i),
|
|
61352
|
+
merges = this.options.customMergeCell.map(m => Object.assign(Object.assign({}, m), {
|
|
61353
|
+
range: {
|
|
61354
|
+
start: Object.assign({}, m.range.start),
|
|
61355
|
+
end: Object.assign({}, m.range.end)
|
|
61356
|
+
}
|
|
61357
|
+
}));
|
|
61358
|
+
for (let i = 0; i < deleteIndexNums.length; i++) {
|
|
61359
|
+
const deleteIndex = deleteIndexNums[i];
|
|
61360
|
+
for (let j = 0; j < merges.length; j++) {
|
|
61361
|
+
const r = null === (_a = merges[j]) || void 0 === _a ? void 0 : _a.range;
|
|
61362
|
+
if (!(null == r ? void 0 : r.start) || !(null == r ? void 0 : r.end)) continue;
|
|
61363
|
+
const start = r.start[axis],
|
|
61364
|
+
end = r.end[axis];
|
|
61365
|
+
end < deleteIndex || (start > deleteIndex ? (r.start[axis] = start - 1, r.end[axis] = end - 1) : r.end[axis] = end - 1);
|
|
61366
|
+
}
|
|
61367
|
+
}
|
|
61368
|
+
this.options.customMergeCell = merges.filter(m => {
|
|
61369
|
+
const r = null == m ? void 0 : m.range;
|
|
61370
|
+
return !(!(null == r ? void 0 : r.start) || !(null == r ? void 0 : r.end)) && !(r.end.row < r.start.row || r.end.col < r.start.col) && !(r.start.row === r.end.row && r.start.col === r.end.col);
|
|
61371
|
+
}), this.internalProps.customMergeCell = getCustomMergeCellFunc(this.options.customMergeCell);
|
|
61372
|
+
}
|
|
61373
|
+
isMaintainArrayData && Array.isArray(this.records) && this.records.length && (deletedRecordValues = this.records.map(record => Array.isArray(record) ? deleteColIndexs.map(idx => record[idx]) : []), deletedRecordValues.every(v => 0 === v.length) && (deletedRecordValues = void 0));
|
|
61173
61374
|
for (let i = 0; i < deleteColIndexs.length; i++) if (columns.splice(deleteColIndexs[i], 1), this.colWidthsMap.delAndReorder(deleteColIndexs[i]), this.internalProps._widthResizedColMap.delete(deleteColIndexs[i]), isMaintainArrayData) for (let j = 0; j < this.records.length; j++) {
|
|
61174
61375
|
const record = this.records[j];
|
|
61175
61376
|
Array.isArray(record) && record.splice(deleteColIndexs[i], 1);
|
|
@@ -61185,7 +61386,9 @@
|
|
|
61185
61386
|
clearRowHeightCache: !1
|
|
61186
61387
|
}), this.fireListeners(TABLE_EVENT_TYPE.DELETE_COLUMN, {
|
|
61187
61388
|
deleteColIndexs: deleteColIndexs,
|
|
61188
|
-
columns: columns
|
|
61389
|
+
columns: columns,
|
|
61390
|
+
deletedColumns: deletedColumns,
|
|
61391
|
+
deletedRecordValues: deletedRecordValues
|
|
61189
61392
|
});
|
|
61190
61393
|
}
|
|
61191
61394
|
get columns() {
|
|
@@ -61573,9 +61776,9 @@
|
|
|
61573
61776
|
}
|
|
61574
61777
|
}
|
|
61575
61778
|
updateSortState(sortState, executeSort = !0) {
|
|
61576
|
-
var _a;
|
|
61577
|
-
|
|
61578
|
-
(
|
|
61779
|
+
var _a, _b, _c, _d, _e;
|
|
61780
|
+
const normalizedSortState = (Array.isArray(sortState) ? sortState : sortState ? [sortState] : []).filter(Boolean);
|
|
61781
|
+
if (normalizedSortState.length ? this.internalProps.sortState = sortState : this.internalProps.sortState = null, executeSort) if (normalizedSortState.length) this.internalProps.layoutMap.headerObjects.some(item => !1 !== item.define.sort) && (this.dataSource.sort(normalizedSortState.map(item => {
|
|
61579
61782
|
const sortFunc = this._getSortFuncFromHeaderOption(this.internalProps.columns, item.field);
|
|
61580
61783
|
this.internalProps.layoutMap.headerObjects.find(col => col && col.field === item.field);
|
|
61581
61784
|
return {
|
|
@@ -61583,13 +61786,20 @@
|
|
|
61583
61786
|
order: item.order,
|
|
61584
61787
|
orderFn: null != sortFunc ? sortFunc : defaultOrderFn
|
|
61585
61788
|
};
|
|
61586
|
-
})), this.internalProps.layoutMap.clearCellRangeMap(), this.internalProps.useOneRowHeightFillAll = !1, this.scenegraph.sortCell())
|
|
61789
|
+
})), this.internalProps.layoutMap.clearCellRangeMap(), this.internalProps.useOneRowHeightFillAll = !1, this.scenegraph.sortCell());else {
|
|
61790
|
+
const ds = this.dataSource,
|
|
61791
|
+
sourceLength = null !== (_c = null !== (_b = null !== (_a = null == ds ? void 0 : ds.sourceLength) && void 0 !== _a ? _a : null == ds ? void 0 : ds._sourceLength) && void 0 !== _b ? _b : null == ds ? void 0 : ds.length) && void 0 !== _c ? _c : 0;
|
|
61792
|
+
(null === (_d = null == ds ? void 0 : ds.sortedIndexMap) || void 0 === _d ? void 0 : _d.clear) && ds.sortedIndexMap.clear(), void 0 !== ds.currentIndexedData && (ds.currentIndexedData = Array.from({
|
|
61793
|
+
length: sourceLength
|
|
61794
|
+
}, (_, i) => i)), ds.lastSortStates = [], null === (_e = ds.updatePagination) || void 0 === _e || _e.call(ds, ds.pagination), this.internalProps.layoutMap.clearCellRangeMap(), this.internalProps.useOneRowHeightFillAll = !1, this.scenegraph.sortCell();
|
|
61795
|
+
}
|
|
61796
|
+
this.stateManager.updateSortState(normalizedSortState);
|
|
61587
61797
|
}
|
|
61588
61798
|
updateFilterRules(filterRules, options = {
|
|
61589
61799
|
clearRowHeightCache: !0
|
|
61590
61800
|
}) {
|
|
61591
61801
|
var _a, _b, _c;
|
|
61592
|
-
this.scenegraph.clearCells(), null === (_b = (_a = this.dataSource).clearForceVisibleRecords) || void 0 === _b || _b.call(_a), 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 === (_c = this.internalProps.emptyTip) || void 0 === _c || _c.resetVisible(), this.resize();
|
|
61802
|
+
this.scenegraph.clearCells(), !1 !== (null == options ? void 0 : options.clearForceVisibleRecords) && (null === (_b = (_a = this.dataSource).clearForceVisibleRecords) || void 0 === _b || _b.call(_a)), 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 === (_c = this.internalProps.emptyTip) || void 0 === _c || _c.resetVisible(), this.resize();
|
|
61593
61803
|
}
|
|
61594
61804
|
getFilteredRecords() {
|
|
61595
61805
|
return this.dataSource.records;
|
|
@@ -61864,30 +62074,112 @@
|
|
|
61864
62074
|
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();
|
|
61865
62075
|
}
|
|
61866
62076
|
addRecord(record, recordIndex, triggerEvent = !0) {
|
|
61867
|
-
var _a;
|
|
62077
|
+
var _a, _b;
|
|
62078
|
+
if (Array.isArray(this.options.customMergeCell) && "number" == typeof recordIndex) {
|
|
62079
|
+
const axis = this.transpose ? "col" : "row",
|
|
62080
|
+
headerCount = this.transpose ? this.rowHeaderLevelCount : this.columnHeaderLevelCount,
|
|
62081
|
+
topAggregationCount = this.internalProps.layoutMap.hasAggregationOnTopCount;
|
|
62082
|
+
let insertIndex = recordIndex;
|
|
62083
|
+
void 0 === insertIndex || insertIndex > this.dataSource.sourceLength ? insertIndex = this.dataSource.sourceLength : insertIndex < 0 && (insertIndex = 0);
|
|
62084
|
+
const insertIndexNum = insertIndex + headerCount + topAggregationCount,
|
|
62085
|
+
merges = this.options.customMergeCell.map(m => Object.assign(Object.assign({}, m), {
|
|
62086
|
+
range: {
|
|
62087
|
+
start: Object.assign({}, m.range.start),
|
|
62088
|
+
end: Object.assign({}, m.range.end)
|
|
62089
|
+
}
|
|
62090
|
+
}));
|
|
62091
|
+
for (let i = 0; i < merges.length; i++) {
|
|
62092
|
+
const r = null === (_a = merges[i]) || void 0 === _a ? void 0 : _a.range;
|
|
62093
|
+
if (!(null == r ? void 0 : r.start) || !(null == r ? void 0 : r.end)) continue;
|
|
62094
|
+
const start = r.start[axis],
|
|
62095
|
+
end = r.end[axis];
|
|
62096
|
+
end < insertIndexNum || (start > insertIndexNum ? (r.start[axis] = start + 1, r.end[axis] = end + 1) : r.end[axis] = end + 1);
|
|
62097
|
+
}
|
|
62098
|
+
this.options.customMergeCell = merges.filter(m => {
|
|
62099
|
+
const r = null == m ? void 0 : m.range;
|
|
62100
|
+
return !(!(null == r ? void 0 : r.start) || !(null == r ? void 0 : r.end)) && !(r.end.row < r.start.row || r.end.col < r.start.col) && !(r.start.row === r.end.row && r.start.col === r.end.col);
|
|
62101
|
+
}), this.internalProps.customMergeCell = getCustomMergeCellFunc(this.options.customMergeCell);
|
|
62102
|
+
}
|
|
61868
62103
|
const success = listTableAddRecord(record, recordIndex, this);
|
|
61869
|
-
adjustHeightResizedRowMapWithAddRecordIndex(this, recordIndex, [record]), null === (
|
|
62104
|
+
adjustHeightResizedRowMapWithAddRecordIndex(this, recordIndex, [record]), null === (_b = this.internalProps.emptyTip) || void 0 === _b || _b.resetVisible(), success && Array.isArray(this.options.customMergeCell) && (this.internalProps.customMergeCell = getCustomMergeCellFunc(this.options.customMergeCell), this.options.customMergeCell.forEach(m => {
|
|
62105
|
+
const r = null == m ? void 0 : m.range;
|
|
62106
|
+
if (null == r ? void 0 : r.start) for (let col = r.start.col; col <= r.end.col; col++) for (let row = r.start.row; row <= r.end.row; row++) this.scenegraph.updateCellContent(col, row);
|
|
62107
|
+
}), this.scenegraph.updateNextFrame()), triggerEvent && success && this.fireListeners(TABLE_EVENT_TYPE.ADD_RECORD, {
|
|
61870
62108
|
records: [record],
|
|
61871
62109
|
recordIndex: recordIndex,
|
|
61872
62110
|
recordCount: 1
|
|
61873
62111
|
});
|
|
61874
62112
|
}
|
|
61875
62113
|
addRecords(records, recordIndex, triggerEvent = !0) {
|
|
61876
|
-
var _a;
|
|
62114
|
+
var _a, _b;
|
|
62115
|
+
if (Array.isArray(this.options.customMergeCell) && "number" == typeof recordIndex && (null == records ? void 0 : records.length)) {
|
|
62116
|
+
const axis = this.transpose ? "col" : "row",
|
|
62117
|
+
headerCount = this.transpose ? this.rowHeaderLevelCount : this.columnHeaderLevelCount,
|
|
62118
|
+
topAggregationCount = this.internalProps.layoutMap.hasAggregationOnTopCount;
|
|
62119
|
+
let insertIndex = recordIndex;
|
|
62120
|
+
void 0 === insertIndex || insertIndex > this.dataSource.sourceLength ? insertIndex = this.dataSource.sourceLength : insertIndex < 0 && (insertIndex = 0);
|
|
62121
|
+
const insertIndexNum = insertIndex + headerCount + topAggregationCount,
|
|
62122
|
+
toAddCount = records.length,
|
|
62123
|
+
merges = this.options.customMergeCell.map(m => Object.assign(Object.assign({}, m), {
|
|
62124
|
+
range: {
|
|
62125
|
+
start: Object.assign({}, m.range.start),
|
|
62126
|
+
end: Object.assign({}, m.range.end)
|
|
62127
|
+
}
|
|
62128
|
+
}));
|
|
62129
|
+
for (let i = 0; i < merges.length; i++) {
|
|
62130
|
+
const r = null === (_a = merges[i]) || void 0 === _a ? void 0 : _a.range;
|
|
62131
|
+
if (!(null == r ? void 0 : r.start) || !(null == r ? void 0 : r.end)) continue;
|
|
62132
|
+
const start = r.start[axis],
|
|
62133
|
+
end = r.end[axis];
|
|
62134
|
+
end < insertIndexNum || (start > insertIndexNum ? (r.start[axis] = start + toAddCount, r.end[axis] = end + toAddCount) : r.end[axis] = end + toAddCount);
|
|
62135
|
+
}
|
|
62136
|
+
this.options.customMergeCell = merges.filter(m => {
|
|
62137
|
+
const r = null == m ? void 0 : m.range;
|
|
62138
|
+
return !(!(null == r ? void 0 : r.start) || !(null == r ? void 0 : r.end)) && !(r.end.row < r.start.row || r.end.col < r.start.col) && !(r.start.row === r.end.row && r.start.col === r.end.col);
|
|
62139
|
+
}), this.internalProps.customMergeCell = getCustomMergeCellFunc(this.options.customMergeCell);
|
|
62140
|
+
}
|
|
61877
62141
|
const success = listTableAddRecords(records, recordIndex, this);
|
|
61878
|
-
"number" == typeof recordIndex && adjustHeightResizedRowMapWithAddRecordIndex(this, recordIndex, records), null === (
|
|
62142
|
+
"number" == typeof recordIndex && adjustHeightResizedRowMapWithAddRecordIndex(this, recordIndex, records), null === (_b = this.internalProps.emptyTip) || void 0 === _b || _b.resetVisible(), success && Array.isArray(this.options.customMergeCell) && (this.internalProps.customMergeCell = getCustomMergeCellFunc(this.options.customMergeCell), this.options.customMergeCell.forEach(m => {
|
|
62143
|
+
const r = null == m ? void 0 : m.range;
|
|
62144
|
+
if (null == r ? void 0 : r.start) for (let col = r.start.col; col <= r.end.col; col++) for (let row = r.start.row; row <= r.end.row; row++) this.scenegraph.updateCellContent(col, row);
|
|
62145
|
+
}), this.scenegraph.updateNextFrame()), triggerEvent && success && this.fireListeners(TABLE_EVENT_TYPE.ADD_RECORD, {
|
|
61879
62146
|
records: records,
|
|
61880
62147
|
recordIndex: recordIndex,
|
|
61881
62148
|
recordCount: records.length
|
|
61882
62149
|
});
|
|
61883
62150
|
}
|
|
61884
62151
|
deleteRecords(recordIndexs, triggerEvent = !0) {
|
|
61885
|
-
var _a;
|
|
61886
|
-
const
|
|
61887
|
-
|
|
62152
|
+
var _a, _b;
|
|
62153
|
+
const prevMergeRanges = Array.isArray(this.options.customMergeCell) ? this.options.customMergeCell.map(m => null == m ? void 0 : m.range).filter(Boolean).map(r => ({
|
|
62154
|
+
start: Object.assign({}, r.start),
|
|
62155
|
+
end: Object.assign({}, r.end)
|
|
62156
|
+
})) : [],
|
|
62157
|
+
deletedRecords = [];
|
|
62158
|
+
if ((null == recordIndexs ? void 0 : recordIndexs.length) > 0 && recordIndexs.forEach(index => {
|
|
61888
62159
|
let record = null;
|
|
61889
62160
|
record = "number" == typeof index ? this.dataSource.get(index) : [], deletedRecords.push(record);
|
|
61890
|
-
}),
|
|
62161
|
+
}), Array.isArray(this.options.customMergeCell) && (null == recordIndexs ? void 0 : recordIndexs.length) && "number" == typeof recordIndexs[0]) {
|
|
62162
|
+
const axis = this.transpose ? "col" : "row",
|
|
62163
|
+
headerCount = this.transpose ? this.rowHeaderLevelCount : this.columnHeaderLevelCount,
|
|
62164
|
+
topAggregationCount = this.internalProps.layoutMap.hasAggregationOnTopCount,
|
|
62165
|
+
deleteIndexNums = recordIndexs.slice().sort((a, b) => a - b).map((index, i) => index + headerCount + topAggregationCount - i),
|
|
62166
|
+
merges = this.options.customMergeCell;
|
|
62167
|
+
for (let i = 0; i < deleteIndexNums.length; i++) {
|
|
62168
|
+
const deleteIndex = deleteIndexNums[i];
|
|
62169
|
+
for (let j = 0; j < merges.length; j++) {
|
|
62170
|
+
const r = null === (_a = merges[j]) || void 0 === _a ? void 0 : _a.range;
|
|
62171
|
+
if (!(null == r ? void 0 : r.start) || !(null == r ? void 0 : r.end)) continue;
|
|
62172
|
+
const start = r.start[axis],
|
|
62173
|
+
end = r.end[axis];
|
|
62174
|
+
end < deleteIndex || (start > deleteIndex ? (r.start[axis] = start - 1, r.end[axis] = end - 1) : r.end[axis] = end - 1);
|
|
62175
|
+
}
|
|
62176
|
+
}
|
|
62177
|
+
this.options.customMergeCell = merges.filter(m => {
|
|
62178
|
+
const r = null == m ? void 0 : m.range;
|
|
62179
|
+
return !(!(null == r ? void 0 : r.start) || !(null == r ? void 0 : r.end)) && !(r.end.row < r.start.row || r.end.col < r.start.col) && !(r.start.row === r.end.row && r.start.col === r.end.col);
|
|
62180
|
+
});
|
|
62181
|
+
}
|
|
62182
|
+
listTableDeleteRecords(recordIndexs, this), adjustHeightResizedRowMapWithDeleteRecordIndex(this, recordIndexs), null === (_b = this.internalProps.emptyTip) || void 0 === _b || _b.resetVisible();
|
|
61891
62183
|
const rowIndexs = [];
|
|
61892
62184
|
for (let i = 0; i < recordIndexs.length; i++) rowIndexs.push(this.getBodyRowIndexByRecordIndex(recordIndexs[i]) + this.columnHeaderLevelCount);
|
|
61893
62185
|
triggerEvent && this.fireListeners(TABLE_EVENT_TYPE.DELETE_RECORD, {
|
|
@@ -61895,7 +62187,16 @@
|
|
|
61895
62187
|
records: deletedRecords,
|
|
61896
62188
|
rowIndexs: rowIndexs,
|
|
61897
62189
|
deletedCount: (Array.isArray(recordIndexs[0]), recordIndexs.length)
|
|
61898
|
-
})
|
|
62190
|
+
}), Array.isArray(this.options.customMergeCell) && (this.internalProps.customMergeCell = getCustomMergeCellFunc(this.options.customMergeCell), this.options.customMergeCell.forEach(m => {
|
|
62191
|
+
const r = null == m ? void 0 : m.range;
|
|
62192
|
+
if (null == r ? void 0 : r.start) for (let col = r.start.col; col <= r.end.col; col++) for (let row = r.start.row; row <= r.end.row; row++) this.scenegraph.updateCellContent(col, row);
|
|
62193
|
+
}), this.scenegraph.updateNextFrame(), setTimeout(() => {
|
|
62194
|
+
if (!this.internalProps || !this.options || !this.scenegraph) return;
|
|
62195
|
+
Array.isArray(this.options.customMergeCell) && (this.internalProps.customMergeCell = getCustomMergeCellFunc(this.options.customMergeCell));
|
|
62196
|
+
[...prevMergeRanges, ...(Array.isArray(this.options.customMergeCell) ? this.options.customMergeCell.map(m => null == m ? void 0 : m.range) : [])].filter(Boolean).forEach(r => {
|
|
62197
|
+
if (null == r ? void 0 : r.start) for (let col = r.start.col; col <= r.end.col; col++) for (let row = r.start.row; row <= r.end.row; row++) this.scenegraph.updateCellContent(col, row);
|
|
62198
|
+
}), this.scenegraph.updateNextFrame();
|
|
62199
|
+
}, 0));
|
|
61899
62200
|
}
|
|
61900
62201
|
updateRecords(records, recordIndexs, triggerEvent = !0) {
|
|
61901
62202
|
listTableUpdateRecords(records, recordIndexs, this), triggerEvent && this.fireListeners(TABLE_EVENT_TYPE.UPDATE_RECORD, {
|
|
@@ -61999,7 +62300,12 @@
|
|
|
61999
62300
|
}
|
|
62000
62301
|
}), this.internalProps.customMergeCell = getCustomMergeCellFunc(this.options.customMergeCell);
|
|
62001
62302
|
for (let i = startCol; i <= endCol; i++) for (let j = startRow; j <= endRow; j++) this.scenegraph.updateCellContent(i, j);
|
|
62002
|
-
this.scenegraph.updateNextFrame()
|
|
62303
|
+
this.scenegraph.updateNextFrame(), this.fireListeners(TABLE_EVENT_TYPE.MERGE_CELLS, {
|
|
62304
|
+
startCol: startCol,
|
|
62305
|
+
startRow: startRow,
|
|
62306
|
+
endCol: endCol,
|
|
62307
|
+
endRow: endRow
|
|
62308
|
+
});
|
|
62003
62309
|
}
|
|
62004
62310
|
unmergeCells(startCol, startRow, endCol, endRow) {
|
|
62005
62311
|
this.options.customMergeCell ? "function" == typeof this.options.customMergeCell && (this.options.customMergeCell = []) : this.options.customMergeCell = [], this.options.customMergeCell = this.options.customMergeCell.filter(item => {
|
|
@@ -62010,7 +62316,12 @@
|
|
|
62010
62316
|
return !(start.col === startCol && start.row === startRow && end.col === endCol && end.row === endRow);
|
|
62011
62317
|
}), this.internalProps.customMergeCell = getCustomMergeCellFunc(this.options.customMergeCell);
|
|
62012
62318
|
for (let i = startCol; i <= endCol; i++) for (let j = startRow; j <= endRow; j++) this.scenegraph.updateCellContent(i, j);
|
|
62013
|
-
this.scenegraph.updateNextFrame()
|
|
62319
|
+
this.scenegraph.updateNextFrame(), this.fireListeners(TABLE_EVENT_TYPE.UNMERGE_CELLS, {
|
|
62320
|
+
startCol: startCol,
|
|
62321
|
+
startRow: startRow,
|
|
62322
|
+
endCol: endCol,
|
|
62323
|
+
endRow: endRow
|
|
62324
|
+
});
|
|
62014
62325
|
}
|
|
62015
62326
|
}
|
|
62016
62327
|
|