@visactor/vtable-calendar 1.19.4-alpha.2 → 1.19.5
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 +185 -43
- package/dist/vtable-calendar.min.js +1 -1
- package/package.json +5 -5
package/dist/vtable-calendar.js
CHANGED
|
@@ -16200,7 +16200,7 @@
|
|
|
16200
16200
|
return data || this.currentRenderMap.get(type) || this.defaultRenderMap.get(type);
|
|
16201
16201
|
}
|
|
16202
16202
|
clearScreen(renderService, context, drawContext) {
|
|
16203
|
-
var _a, _b;
|
|
16203
|
+
var _a, _b, _c;
|
|
16204
16204
|
const {
|
|
16205
16205
|
clear: clear,
|
|
16206
16206
|
viewBox: viewBox
|
|
@@ -16208,9 +16208,9 @@
|
|
|
16208
16208
|
width = viewBox.width(),
|
|
16209
16209
|
height = viewBox.height();
|
|
16210
16210
|
if (clear) {
|
|
16211
|
-
context.clearRect(0, 0, width, height);
|
|
16212
|
-
const stage = null === (
|
|
16213
|
-
if (stage && (context.globalAlpha = null !== (
|
|
16211
|
+
context.clearRect(0, 0, width, height), (null === (_a = renderService.drawParams) || void 0 === _a ? void 0 : _a.stage) && renderService.drawParams.stage.hooks.afterClearRect.call(renderService.drawParams);
|
|
16212
|
+
const stage = null === (_b = renderService.drawParams) || void 0 === _b ? void 0 : _b.stage;
|
|
16213
|
+
if (stage && (context.globalAlpha = null !== (_c = stage.attribute.opacity) && void 0 !== _c ? _c : 1), stage && stage.backgroundImg && stage.resources) {
|
|
16214
16214
|
const res = stage.resources.get(clear);
|
|
16215
16215
|
res && "success" === res.state && res.data && context.drawImage(res.data, 0, 0, width, height);
|
|
16216
16216
|
} else context.fillStyle = createColor(context, clear, {
|
|
@@ -16745,6 +16745,8 @@
|
|
|
16745
16745
|
this._beforeRender && this._beforeRender(stage);
|
|
16746
16746
|
}, this.afterClearScreen = drawParams => {
|
|
16747
16747
|
this._afterClearScreen && this._afterClearScreen(drawParams);
|
|
16748
|
+
}, this.afterClearRect = drawParams => {
|
|
16749
|
+
this._afterClearRect && this._afterClearRect(drawParams);
|
|
16748
16750
|
}, this.afterRender = stage => {
|
|
16749
16751
|
this.renderCount++, this._afterRender && this._afterRender(stage), this._afterNextRenderCbs && this._afterNextRenderCbs.forEach(cb => cb(stage)), this._afterNextRenderCbs = null, this.tickedBeforeRender = !1;
|
|
16750
16752
|
}, this.afterTickCb = () => {
|
|
@@ -16752,7 +16754,8 @@
|
|
|
16752
16754
|
}, this.params = params, this.theme = new Theme(), this.hooks = {
|
|
16753
16755
|
beforeRender: new SyncHook(["stage"]),
|
|
16754
16756
|
afterRender: new SyncHook(["stage"]),
|
|
16755
|
-
afterClearScreen: new SyncHook(["stage"])
|
|
16757
|
+
afterClearScreen: new SyncHook(["stage"]),
|
|
16758
|
+
afterClearRect: new SyncHook(["stage"])
|
|
16756
16759
|
}, this.global = application.global, !this.global.env && isBrowserEnv() && this.global.setEnv("browser"), this.window = container.get(VWindow), this.renderService = container.get(RenderService), this.pluginService = container.get(PluginService), this.layerService = container.get(LayerService), this.graphicService = container.get(GraphicService), this.pluginService.active(this, params), this.window.create({
|
|
16757
16760
|
width: params.width,
|
|
16758
16761
|
height: params.height,
|
|
@@ -16764,7 +16767,7 @@
|
|
|
16764
16767
|
canvas: params.canvas
|
|
16765
16768
|
}), this.state = "normal", this.renderCount = 0, this.tryInitEventSystem(), this._background = null !== (_a = params.background) && void 0 !== _a ? _a : DefaultConfig.BACKGROUND, this.appendChild(this.layerService.createLayer(this, {
|
|
16766
16769
|
main: !0
|
|
16767
|
-
})), this.nextFrameRenderLayerSet = new Set(), this.willNextFrameRender = !1, this.stage = this, this.renderStyle = params.renderStyle, params.autoRender && this.enableAutoRender(), params.autoRefresh && this.enableAutoRefresh(), !1 === params.disableDirtyBounds && this.enableDirtyBounds(), params.enableHtmlAttribute && this.enableHtmlAttribute(params.enableHtmlAttribute), params.ReactDOM && this.enableReactAttribute(params.ReactDOM), params.enableLayout && this.enableLayout(), this.hooks.beforeRender.tap("constructor", this.beforeRender), this.hooks.afterRender.tap("constructor", this.afterRender), this.hooks.afterClearScreen.tap("constructor", this.afterClearScreen), this._beforeRender = params.beforeRender, this._afterRender = params.afterRender, this._afterClearScreen = params.afterClearScreen, this.supportInteractiveLayer = !1 !== params.interactiveLayer, params.optimize || (params.optimize = {
|
|
16770
|
+
})), this.nextFrameRenderLayerSet = new Set(), this.willNextFrameRender = !1, this.stage = this, this.renderStyle = params.renderStyle, params.autoRender && this.enableAutoRender(), params.autoRefresh && this.enableAutoRefresh(), !1 === params.disableDirtyBounds && this.enableDirtyBounds(), params.enableHtmlAttribute && this.enableHtmlAttribute(params.enableHtmlAttribute), params.ReactDOM && this.enableReactAttribute(params.ReactDOM), params.enableLayout && this.enableLayout(), this.hooks.beforeRender.tap("constructor", this.beforeRender), this.hooks.afterRender.tap("constructor", this.afterRender), this.hooks.afterClearScreen.tap("constructor", this.afterClearScreen), this.hooks.afterClearRect.tap("constructor", this.afterClearRect), this._beforeRender = params.beforeRender, this._afterRender = params.afterRender, this._afterClearScreen = params.afterClearScreen, this._afterClearRect = params.afterClearRect, this.supportInteractiveLayer = !1 !== params.interactiveLayer, params.optimize || (params.optimize = {
|
|
16768
16771
|
tickRenderMode: "effect"
|
|
16769
16772
|
}), this.optmize(params.optimize), params.background && isString$6(this._background) && this._background.includes("/") && this.setAttributes({
|
|
16770
16773
|
background: this._background
|
|
@@ -37270,12 +37273,13 @@
|
|
|
37270
37273
|
parentRecord = this.getOriginalRecord(recordIndex_copy);
|
|
37271
37274
|
parentRecord.children ? parentRecord.children.splice(index, 0, ...recordArr) : parentRecord.children = recordArr;
|
|
37272
37275
|
}
|
|
37273
|
-
this.initTreeHierarchyState(), this.
|
|
37276
|
+
this.initTreeHierarchyState(), this.updatePagination();
|
|
37274
37277
|
}
|
|
37275
37278
|
}
|
|
37276
37279
|
deleteRecordsForTree(recordIndexs) {
|
|
37277
|
-
if (!isArray$7(recordIndexs) || 0 === recordIndexs.length) return;
|
|
37278
|
-
const recordIndexsMaxToMin = sortRecordIndexs(recordIndexs, -1)
|
|
37280
|
+
if (!isArray$7(recordIndexs) || 0 === recordIndexs.length) return [];
|
|
37281
|
+
const recordIndexsMaxToMin = sortRecordIndexs(recordIndexs, -1),
|
|
37282
|
+
deletedRecordIndexs = [];
|
|
37279
37283
|
for (let index = 0; index < recordIndexsMaxToMin.length; index++) {
|
|
37280
37284
|
const recordIndex = recordIndexsMaxToMin[index];
|
|
37281
37285
|
if (!isNumber$4(recordIndex) || !(recordIndex >= this.sourceLength || recordIndex < 0)) {
|
|
@@ -37284,10 +37288,10 @@
|
|
|
37284
37288
|
index = recordIndex_copy.pop();
|
|
37285
37289
|
this.getOriginalRecord(recordIndex_copy).children.splice(index, 1);
|
|
37286
37290
|
}
|
|
37287
|
-
this.adjustBeforeChangedRecordsMap(recordIndex, 1, "delete");
|
|
37291
|
+
this.adjustBeforeChangedRecordsMap(recordIndex, 1, "delete"), deletedRecordIndexs.push(recordIndex);
|
|
37288
37292
|
}
|
|
37289
37293
|
}
|
|
37290
|
-
this.initTreeHierarchyState(), this.
|
|
37294
|
+
return this.initTreeHierarchyState(), this.updatePagination(), deletedRecordIndexs;
|
|
37291
37295
|
}
|
|
37292
37296
|
updateRecordsForTree(records, recordIndexs) {
|
|
37293
37297
|
for (let index = 0; index < recordIndexs.length; index++) {
|
|
@@ -40645,7 +40649,7 @@
|
|
|
40645
40649
|
}
|
|
40646
40650
|
|
|
40647
40651
|
function updateRowHeight(scene, row, detaY, skipTableHeightMap) {
|
|
40648
|
-
skipTableHeightMap
|
|
40652
|
+
!skipTableHeightMap && detaY && scene.table._setRowHeight(row, scene.table.getRowHeight(row) + detaY, !0);
|
|
40649
40653
|
for (let col = 0; col < scene.table.colCount; col++) {
|
|
40650
40654
|
const cell = scene.getCell(col, row);
|
|
40651
40655
|
if ("empty" === cell.role) continue;
|
|
@@ -42248,13 +42252,15 @@
|
|
|
42248
42252
|
afterRender(stage) {
|
|
42249
42253
|
stage.window.getContext().inuse = !1, stage.needRender = !1, chartStage.resumeRender();
|
|
42250
42254
|
},
|
|
42251
|
-
|
|
42252
|
-
|
|
42253
|
-
|
|
42254
|
-
|
|
42255
|
-
|
|
42256
|
-
|
|
42257
|
-
|
|
42255
|
+
renderHooks: {
|
|
42256
|
+
afterClearRect(drawParams) {
|
|
42257
|
+
const {
|
|
42258
|
+
context: context,
|
|
42259
|
+
layer: layer,
|
|
42260
|
+
viewBox: viewBox
|
|
42261
|
+
} = drawParams;
|
|
42262
|
+
layer.main && drawParams.clear && hoverColor && (context.beginPath(), context.fillStyle = hoverColor, context.rect(viewBox.x1, viewBox.y1, viewBox.x2 - viewBox.x1, viewBox.y2 - viewBox.y1), context.fill());
|
|
42263
|
+
}
|
|
42258
42264
|
}
|
|
42259
42265
|
}));
|
|
42260
42266
|
const chartStage = this.activeChartInstance.getStage(),
|
|
@@ -47172,7 +47178,7 @@
|
|
|
47172
47178
|
isNotFillHeight = this.table.getAllRowsHeight() - [...addRows, ...updateRows].reduce((tolHeight, rowNumber) => tolHeight + this.table.getRowHeight(rowNumber), 0) <= this.table.tableNoFrameHeight;
|
|
47173
47179
|
if (updateRow(removeCells, addCells, updateCells, this.table, skipUpdateProxy), recalculateColWidths && this.recalculateColWidths(), "adaptive" === this.table.heightMode || this.table.autoFillHeight && (this.table.getAllRowsHeight() <= this.table.tableNoFrameHeight || isNotFillHeight)) this.table.scenegraph.recalculateRowHeights();else if (this.table.isAutoRowHeight(this.table.columnHeaderLevelCount)) for (let i = 0; i < updateRows.length; i++) {
|
|
47174
47180
|
const row = updateRows[i],
|
|
47175
|
-
oldHeight = this.table.
|
|
47181
|
+
oldHeight = this.table.rowHeightsMap.get(row),
|
|
47176
47182
|
newHeight = computeRowHeight(row, 0, this.table.colCount - 1, this.table);
|
|
47177
47183
|
(row >= this.proxy.rowStart && row <= this.proxy.rowEnd || row >= this.table.rowCount - this.table.bottomFrozenRowCount && row <= this.table.rowCount - 1) && this.table.scenegraph.updateRowHeight(row, newHeight - oldHeight);
|
|
47178
47184
|
}
|
|
@@ -48275,8 +48281,9 @@
|
|
|
48275
48281
|
}
|
|
48276
48282
|
}
|
|
48277
48283
|
function setCellCheckboxState(col, row, checked, table) {
|
|
48284
|
+
var _a, _b;
|
|
48278
48285
|
const cellGroup = table.scenegraph.getCell(col, row),
|
|
48279
|
-
checkbox = null == cellGroup ? void 0 : cellGroup.getChildByName("checkbox");
|
|
48286
|
+
checkbox = (null == cellGroup ? void 0 : cellGroup.getChildByName("checkbox")) || (null === (_b = null === (_a = null == cellGroup ? void 0 : cellGroup.getChildByName("checkbox-content")) || void 0 === _a ? void 0 : _a._checkboxGroup) || void 0 === _b ? void 0 : _b.getChildByName("checkbox"));
|
|
48280
48287
|
if (!checkbox) {
|
|
48281
48288
|
const field = table.getHeaderField(col, row);
|
|
48282
48289
|
if (table.isHeader(col, row)) {
|
|
@@ -49841,7 +49848,7 @@
|
|
|
49841
49848
|
checked: e.detail.checked
|
|
49842
49849
|
});
|
|
49843
49850
|
if (table.isHeader(col, row)) {
|
|
49844
|
-
if (table.stateManager.setHeaderCheckedState(cellInfo.field, e.detail.checked), table.internalProps.
|
|
49851
|
+
if (table.stateManager.setHeaderCheckedState(cellInfo.field, e.detail.checked), table.internalProps.enableHeaderCheckboxCascade) {
|
|
49845
49852
|
"checkbox" === table.getCellType(col, row) && table.scenegraph.updateCheckboxCellState(col, row, e.detail.checked);
|
|
49846
49853
|
}
|
|
49847
49854
|
} else if (table.stateManager.setCheckedState(col, row, cellInfo.field, e.detail.checked), table.internalProps.enableCheckboxCascade) {
|
|
@@ -50750,7 +50757,7 @@
|
|
|
50750
50757
|
});
|
|
50751
50758
|
}
|
|
50752
50759
|
function bindHeaderCheckboxChange(table) {
|
|
50753
|
-
!0 === table.internalProps.
|
|
50760
|
+
!0 === table.internalProps.enableHeaderCheckboxCascade && table.on("checkbox_state_change", args => {
|
|
50754
50761
|
const {
|
|
50755
50762
|
col: col,
|
|
50756
50763
|
row: row,
|
|
@@ -50812,9 +50819,11 @@
|
|
|
50812
50819
|
});
|
|
50813
50820
|
}
|
|
50814
50821
|
|
|
50815
|
-
function
|
|
50822
|
+
function bindDropdownMenuEvent(table) {
|
|
50816
50823
|
table.on(TABLE_EVENT_TYPE.DROPDOWN_MENU_CLICK, () => {
|
|
50817
50824
|
table.stateManager.hideMenu();
|
|
50825
|
+
}), table.on(TABLE_EVENT_TYPE.SCROLL, () => {
|
|
50826
|
+
table.stateManager.hideMenu();
|
|
50818
50827
|
});
|
|
50819
50828
|
}
|
|
50820
50829
|
|
|
@@ -50887,7 +50896,7 @@
|
|
|
50887
50896
|
}, 0);
|
|
50888
50897
|
}
|
|
50889
50898
|
bindSelfEvent() {
|
|
50890
|
-
this.table.isReleased || (bindIconClickEvent(this.table),
|
|
50899
|
+
this.table.isReleased || (bindIconClickEvent(this.table), bindDropdownMenuEvent(this.table), this.updateEventBinder(), bindMediaClick(this.table), bindDBClickAutoColumnWidthEvent(this.table), this.table.isPivotTable() && checkHaveDrill(this.table) && bindDrillEvent(this.table), bindSparklineHoverEvent(this.table), bindAxisClickEvent(this.table), bindAxisHoverEvent(this.table), bindGroupTitleCheckboxChange(this.table), bindGroupCheckboxTreeChange(this.table), bindHeaderCheckboxChange(this.table), bindButtonClickEvent(this.table), rightButtonClickEvent(this.table));
|
|
50891
50900
|
}
|
|
50892
50901
|
dealTableHover(eventArgsSet) {
|
|
50893
50902
|
if (!eventArgsSet) return void this.table.stateManager.updateHoverPos(-1, -1);
|
|
@@ -53709,8 +53718,8 @@
|
|
|
53709
53718
|
return TABLE_EVENT_TYPE;
|
|
53710
53719
|
}
|
|
53711
53720
|
constructor(container, options = {}) {
|
|
53712
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y;
|
|
53713
|
-
if (super(), this.showFrozenIcon = !0, this.version = "1.19.
|
|
53721
|
+
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;
|
|
53722
|
+
if (super(), this.showFrozenIcon = !0, this.version = "1.19.5", 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");
|
|
53714
53723
|
this.pluginManager = new PluginManager(this, options), this.fireListeners(TABLE_EVENT_TYPE.BEFORE_INIT, {
|
|
53715
53724
|
options: options,
|
|
53716
53725
|
container: container
|
|
@@ -53737,6 +53746,7 @@
|
|
|
53737
53746
|
eventOptions: eventOptions,
|
|
53738
53747
|
rowSeriesNumber: rowSeriesNumber,
|
|
53739
53748
|
enableCheckboxCascade: enableCheckboxCascade,
|
|
53749
|
+
enableHeaderCheckboxCascade: enableHeaderCheckboxCascade,
|
|
53740
53750
|
columnResizeMode: columnResizeMode,
|
|
53741
53751
|
rowResizeMode = "none",
|
|
53742
53752
|
resize: resize,
|
|
@@ -53784,7 +53794,7 @@
|
|
|
53784
53794
|
bottom: 0
|
|
53785
53795
|
}, padding && ("number" == typeof padding ? (this.padding.top = padding, this.padding.left = padding, this.padding.bottom = padding, this.padding.right = padding) : (padding.top && (this.padding.top = padding.top), padding.bottom && (this.padding.bottom = padding.bottom), padding.left && (this.padding.left = padding.left), padding.right && (this.padding.right = padding.right))), (isValid$3(canvasHeight) || isValid$3(canvasWidth)) && (this.canvasSizeSeted = !0), this.tableNoFrameWidth = 0, this.tableNoFrameHeight = 0, this.canvasWidth = isNumber$4(canvasWidth) ? canvasWidth : void 0, this.canvasHeight = isNumber$4(canvasHeight) ? canvasHeight : void 0, this.columnWidthComputeMode = null !== (_d = options.columnWidthComputeMode) && void 0 !== _d ? _d : "normal";
|
|
53786
53796
|
const internalProps = this.internalProps = {};
|
|
53787
|
-
void 0 !== showFrozenIcon && (this.showFrozenIcon = showFrozenIcon), "number" == typeof allowFrozenColCount && allowFrozenColCount <= 0 && (this.showFrozenIcon = !1), this.options.canvas ? ("node" !== Env.mode && (internalProps.element = this.options.canvas.parentElement, internalProps.element.style.position = "relative"), internalProps.focusControl = new FocusInput(this, internalProps.element), internalProps.canvas = this.options.canvas, internalProps.context = internalProps.canvas.getContext("2d")) : "node" !== Env.mode && (internalProps.element = createRootElement(this.padding), internalProps.focusControl = new FocusInput(this, internalProps.element), internalProps.canvas = document.createElement("canvas"), internalProps.element.appendChild(internalProps.canvas), internalProps.context = internalProps.canvas.getContext("2d"), (null === (_e = options.customConfig) || void 0 === _e ? void 0 : _e.createReactContainer) && createReactContainer(this)), internalProps.handler = new EventHandler(), isNumber$4(this.options.resizeTime) && (internalProps.handler.resizeTime = this.options.resizeTime), internalProps.pixelRatio = pixelRatio, internalProps.frozenColCount = frozenColCount, internalProps.frozenRowCount = frozenRowCount, internalProps.unfreezeAllOnExceedsMaxWidth = null == unfreezeAllOnExceedsMaxWidth || unfreezeAllOnExceedsMaxWidth, internalProps.defaultRowHeight = defaultRowHeight, internalProps.defaultHeaderRowHeight = null != defaultHeaderRowHeight ? defaultHeaderRowHeight : defaultRowHeight, internalProps.defaultColWidth = defaultColWidth, internalProps.defaultHeaderColWidth = null != defaultHeaderColWidth ? defaultHeaderColWidth : defaultColWidth, internalProps.keyboardOptions = keyboardOptions, internalProps.eventOptions = eventOptions, internalProps.rowSeriesNumber = rowSeriesNumber, internalProps.enableCheckboxCascade = null === (_f = null != enableCheckboxCascade ? enableCheckboxCascade : null == rowSeriesNumber ? void 0 : rowSeriesNumber.enableTreeCheckbox) || void 0 === _f || _f, internalProps.columnResizeMode = null !== (_g = null == resize ? void 0 : resize.columnResizeMode) && void 0 !== _g ? _g : columnResizeMode, internalProps.rowResizeMode = null !== (_h = null == resize ? void 0 : resize.rowResizeMode) && void 0 !== _h ? _h : rowResizeMode, internalProps.dragHeaderMode = null !== (_k = null !== (_j = null == dragOrder ? void 0 : dragOrder.dragHeaderMode) && void 0 !== _j ? _j : dragHeaderMode) && void 0 !== _k ? _k : "none", internalProps.renderChartAsync = renderChartAsync, setBatchRenderChartCount(renderChartAsyncBatchCount), internalProps.overscrollBehavior = null != overscrollBehavior ? overscrollBehavior : "auto", internalProps.groupBy = null !== (_l = null == groupConfig ? void 0 : groupConfig.groupBy) && void 0 !== _l ? _l : groupBy, internalProps.
|
|
53797
|
+
void 0 !== showFrozenIcon && (this.showFrozenIcon = showFrozenIcon), "number" == typeof allowFrozenColCount && allowFrozenColCount <= 0 && (this.showFrozenIcon = !1), this.options.canvas ? ("node" !== Env.mode && (internalProps.element = this.options.canvas.parentElement, internalProps.element.style.position = "relative"), internalProps.focusControl = new FocusInput(this, internalProps.element), internalProps.canvas = this.options.canvas, internalProps.context = internalProps.canvas.getContext("2d")) : "node" !== Env.mode && (internalProps.element = createRootElement(this.padding), internalProps.focusControl = new FocusInput(this, internalProps.element), internalProps.canvas = document.createElement("canvas"), internalProps.element.appendChild(internalProps.canvas), internalProps.context = internalProps.canvas.getContext("2d"), (null === (_e = options.customConfig) || void 0 === _e ? void 0 : _e.createReactContainer) && createReactContainer(this)), internalProps.handler = new EventHandler(), isNumber$4(this.options.resizeTime) && (internalProps.handler.resizeTime = this.options.resizeTime), internalProps.pixelRatio = pixelRatio, internalProps.frozenColCount = frozenColCount, internalProps.frozenRowCount = frozenRowCount, internalProps.unfreezeAllOnExceedsMaxWidth = null == unfreezeAllOnExceedsMaxWidth || unfreezeAllOnExceedsMaxWidth, internalProps.defaultRowHeight = defaultRowHeight, internalProps.defaultHeaderRowHeight = null != defaultHeaderRowHeight ? defaultHeaderRowHeight : defaultRowHeight, internalProps.defaultColWidth = defaultColWidth, internalProps.defaultHeaderColWidth = null != defaultHeaderColWidth ? defaultHeaderColWidth : defaultColWidth, internalProps.keyboardOptions = keyboardOptions, internalProps.eventOptions = eventOptions, internalProps.rowSeriesNumber = rowSeriesNumber, internalProps.enableCheckboxCascade = null === (_f = null != enableCheckboxCascade ? enableCheckboxCascade : null == rowSeriesNumber ? void 0 : rowSeriesNumber.enableTreeCheckbox) || void 0 === _f || _f, internalProps.enableHeaderCheckboxCascade = enableCheckboxCascade || null == enableHeaderCheckboxCascade || enableHeaderCheckboxCascade, internalProps.columnResizeMode = null !== (_g = null == resize ? void 0 : resize.columnResizeMode) && void 0 !== _g ? _g : columnResizeMode, internalProps.rowResizeMode = null !== (_h = null == resize ? void 0 : resize.rowResizeMode) && void 0 !== _h ? _h : rowResizeMode, internalProps.dragHeaderMode = null !== (_k = null !== (_j = null == dragOrder ? void 0 : dragOrder.dragHeaderMode) && void 0 !== _j ? _j : dragHeaderMode) && void 0 !== _k ? _k : "none", internalProps.renderChartAsync = renderChartAsync, setBatchRenderChartCount(renderChartAsyncBatchCount), internalProps.overscrollBehavior = null != overscrollBehavior ? overscrollBehavior : "auto", internalProps.groupBy = null !== (_l = null == groupConfig ? void 0 : groupConfig.groupBy) && void 0 !== _l ? _l : groupBy, internalProps.groupTitleCheckbox = null !== (_m = null == groupConfig ? void 0 : groupConfig.titleCheckbox) && void 0 !== _m ? _m : !!(null == rowSeriesNumber ? void 0 : rowSeriesNumber.enableTreeCheckbox), internalProps.groupTitleFieldFormat = null !== (_o = null == groupConfig ? void 0 : groupConfig.titleFieldFormat) && void 0 !== _o ? _o : groupTitleFieldFormat, internalProps.groupTitleCustomLayout = null !== (_p = null == groupConfig ? void 0 : groupConfig.titleCustomLayout) && void 0 !== _p ? _p : groupTitleCustomLayout, internalProps.enableTreeStickCell = null !== (_q = null == groupConfig ? void 0 : groupConfig.enableTreeStickCell) && void 0 !== _q ? _q : enableTreeStickCell, internalProps._rowHeightsMap = new NumberRangeMap(this), internalProps._rowRangeHeightsMap = new Map(), internalProps._colRangeWidthsMap = new Map(), internalProps._widthResizedColMap = new Set(), internalProps._heightResizedRowMap = new Set(), this.colWidthsMap = new NumberMap(), this.colContentWidthsMap = new NumberMap(), this.colWidthsLimit = {};
|
|
53788
53798
|
const that = this;
|
|
53789
53799
|
if (internalProps.calcWidthContext = {
|
|
53790
53800
|
_: internalProps,
|
|
@@ -53792,7 +53802,7 @@
|
|
|
53792
53802
|
var _a;
|
|
53793
53803
|
return "node" === Env.mode ? that.canvasWidth / (null != pixelRatio ? pixelRatio : 1) : this._.canvas.width / (null !== (_a = this._.context.pixelRatio) && void 0 !== _a ? _a : window.devicePixelRatio);
|
|
53794
53804
|
}
|
|
53795
|
-
}, internalProps.cellTextOverflows = {}, internalProps.focusedTable = !1, internalProps.theme = themes.of(null !== (
|
|
53805
|
+
}, internalProps.cellTextOverflows = {}, internalProps.focusedTable = !1, internalProps.theme = themes.of(null !== (_r = options.theme) && void 0 !== _r ? _r : themes.DEFAULT), internalProps.theme.isPivot = this.isPivotTable(), setIconColor(internalProps.theme.functionalIconsStyle), container ? (clearDOM && (container.innerHTML = ""), container.appendChild(internalProps.element), this._updateSize()) : this._updateSize(), internalProps.bodyHelper = new BodyHelper(this), internalProps.headerHelper = new HeaderHelper(this), internalProps.rowSeriesNumberHelper = new RowSeriesNumberHelper(this), internalProps.autoWrapText = options.autoWrapText, internalProps.enableLineBreak = options.enableLineBreak, internalProps.allowFrozenColCount = null !== (_s = options.allowFrozenColCount) && void 0 !== _s ? _s : 0, internalProps.limitMaxAutoWidth = null !== (_t = options.limitMaxAutoWidth) && void 0 !== _t ? _t : 450, internalProps.limitMinWidth = null != limitMinWidth ? "number" == typeof limitMinWidth ? limitMinWidth : limitMinWidth ? 10 : 0 : 10, internalProps.limitMinHeight = null != limitMinHeight ? "number" == typeof limitMinHeight ? limitMinHeight : limitMinHeight ? 10 : 0 : 10, this.scenegraph = new Scenegraph(this), this.stateManager = new StateManager(this), this.eventManager = new EventManager(this), this.animationManager = new TableAnimationManager(this), options.legends) {
|
|
53796
53806
|
internalProps.legends = [];
|
|
53797
53807
|
const createLegend = Factory.getFunction("createLegend");
|
|
53798
53808
|
if (Array.isArray(options.legends)) {
|
|
@@ -53818,7 +53828,7 @@
|
|
|
53818
53828
|
}
|
|
53819
53829
|
if (internalProps.menu = Object.assign({
|
|
53820
53830
|
renderMode: "html"
|
|
53821
|
-
}, options.menu), Array.isArray(null === (
|
|
53831
|
+
}, options.menu), Array.isArray(null === (_u = options.menu) || void 0 === _u ? void 0 : _u.dropDownMenuHighlight) && this.setDropDownMenuHighlight(null === (_v = options.menu) || void 0 === _v ? void 0 : _v.dropDownMenuHighlight), (Array.isArray(null === (_w = options.menu) || void 0 === _w ? void 0 : _w.defaultHeaderMenuItems) || "function" == typeof (null === (_x = options.menu) || void 0 === _x ? void 0 : _x.defaultHeaderMenuItems)) && (this.globalDropDownMenu = options.menu.defaultHeaderMenuItems), "html" === internalProps.menu.renderMode) {
|
|
53822
53832
|
const MenuHandler = Factory.getComponent("menuHandler");
|
|
53823
53833
|
internalProps.menuHandler = new MenuHandler(this);
|
|
53824
53834
|
}
|
|
@@ -53826,7 +53836,7 @@
|
|
|
53826
53836
|
changedCells: new Map()
|
|
53827
53837
|
}, internalProps.customMergeCell = getCustomMergeCellFunc(options.customMergeCell);
|
|
53828
53838
|
const CustomCellStylePlugin = Factory.getComponent("customCellStylePlugin");
|
|
53829
|
-
CustomCellStylePlugin && (this.customCellStylePlugin = new CustomCellStylePlugin(this, null !== (
|
|
53839
|
+
CustomCellStylePlugin && (this.customCellStylePlugin = new CustomCellStylePlugin(this, null !== (_y = options.customCellStyle) && void 0 !== _y ? _y : [], null !== (_z = options.customCellStyleArrangement) && void 0 !== _z ? _z : [])), this._adjustCanvasSizeByOption();
|
|
53830
53840
|
}
|
|
53831
53841
|
_adjustCanvasSizeByOption() {
|
|
53832
53842
|
"auto" !== this.options.canvasHeight && "auto" !== this.options.canvasWidth || setTimeout(() => {
|
|
@@ -54616,6 +54626,7 @@
|
|
|
54616
54626
|
eventOptions: eventOptions,
|
|
54617
54627
|
rowSeriesNumber: rowSeriesNumber,
|
|
54618
54628
|
enableCheckboxCascade: enableCheckboxCascade,
|
|
54629
|
+
enableHeaderCheckboxCascade: enableHeaderCheckboxCascade,
|
|
54619
54630
|
columnResizeMode: columnResizeMode,
|
|
54620
54631
|
rowResizeMode = "none",
|
|
54621
54632
|
resize: resize,
|
|
@@ -54662,7 +54673,7 @@
|
|
|
54662
54673
|
height: !1
|
|
54663
54674
|
}), this.customRender = customRender, this.canvasWidth = isNumber$4(canvasWidth) ? canvasWidth : void 0, this.canvasHeight = isNumber$4(canvasHeight) ? canvasHeight : void 0;
|
|
54664
54675
|
const internalProps = this.internalProps;
|
|
54665
|
-
if ("node" === Env.mode || options.canvas || updateRootElementPadding(internalProps.element, this.padding), this.columnWidthComputeMode = null !== (_d = options.columnWidthComputeMode) && void 0 !== _d ? _d : "normal", internalProps.frozenColCount = frozenColCount, internalProps.unfreezeAllOnExceedsMaxWidth = null == unfreezeAllOnExceedsMaxWidth || unfreezeAllOnExceedsMaxWidth, internalProps.defaultRowHeight = defaultRowHeight, internalProps.defaultHeaderRowHeight = null != defaultHeaderRowHeight ? defaultHeaderRowHeight : defaultRowHeight, internalProps.defaultColWidth = defaultColWidth, internalProps.defaultHeaderColWidth = null != defaultHeaderColWidth ? defaultHeaderColWidth : defaultColWidth, internalProps.keyboardOptions = keyboardOptions, internalProps.eventOptions = eventOptions, internalProps.rowSeriesNumber = rowSeriesNumber, internalProps.enableCheckboxCascade = null === (_e = null != enableCheckboxCascade ? enableCheckboxCascade : null == rowSeriesNumber ? void 0 : rowSeriesNumber.enableTreeCheckbox) || void 0 === _e || _e, internalProps.columnResizeMode = null !== (_f = null == resize ? void 0 : resize.columnResizeMode) && void 0 !== _f ? _f : columnResizeMode, internalProps.rowResizeMode = null !== (_g = null == resize ? void 0 : resize.rowResizeMode) && void 0 !== _g ? _g : rowResizeMode, internalProps.dragHeaderMode = null !== (_j = null !== (_h = null == dragOrder ? void 0 : dragOrder.dragHeaderMode) && void 0 !== _h ? _h : dragHeaderMode) && void 0 !== _j ? _j : "none", internalProps.renderChartAsync = renderChartAsync, setBatchRenderChartCount(renderChartAsyncBatchCount), internalProps.overscrollBehavior = null != overscrollBehavior ? overscrollBehavior : "auto", internalProps.cellTextOverflows = {}, internalProps.groupBy = null !== (_k = null == groupConfig ? void 0 : groupConfig.groupBy) && void 0 !== _k ? _k : groupBy, internalProps.
|
|
54676
|
+
if ("node" === Env.mode || options.canvas || updateRootElementPadding(internalProps.element, this.padding), this.columnWidthComputeMode = null !== (_d = options.columnWidthComputeMode) && void 0 !== _d ? _d : "normal", internalProps.frozenColCount = frozenColCount, internalProps.unfreezeAllOnExceedsMaxWidth = null == unfreezeAllOnExceedsMaxWidth || unfreezeAllOnExceedsMaxWidth, internalProps.defaultRowHeight = defaultRowHeight, internalProps.defaultHeaderRowHeight = null != defaultHeaderRowHeight ? defaultHeaderRowHeight : defaultRowHeight, internalProps.defaultColWidth = defaultColWidth, internalProps.defaultHeaderColWidth = null != defaultHeaderColWidth ? defaultHeaderColWidth : defaultColWidth, internalProps.keyboardOptions = keyboardOptions, internalProps.eventOptions = eventOptions, internalProps.rowSeriesNumber = rowSeriesNumber, internalProps.enableCheckboxCascade = null === (_e = null != enableCheckboxCascade ? enableCheckboxCascade : null == rowSeriesNumber ? void 0 : rowSeriesNumber.enableTreeCheckbox) || void 0 === _e || _e, internalProps.enableHeaderCheckboxCascade = enableCheckboxCascade || null == enableHeaderCheckboxCascade || enableHeaderCheckboxCascade, internalProps.columnResizeMode = null !== (_f = null == resize ? void 0 : resize.columnResizeMode) && void 0 !== _f ? _f : columnResizeMode, internalProps.rowResizeMode = null !== (_g = null == resize ? void 0 : resize.rowResizeMode) && void 0 !== _g ? _g : rowResizeMode, internalProps.dragHeaderMode = null !== (_j = null !== (_h = null == dragOrder ? void 0 : dragOrder.dragHeaderMode) && void 0 !== _h ? _h : dragHeaderMode) && void 0 !== _j ? _j : "none", internalProps.renderChartAsync = renderChartAsync, setBatchRenderChartCount(renderChartAsyncBatchCount), internalProps.overscrollBehavior = null != overscrollBehavior ? overscrollBehavior : "auto", internalProps.cellTextOverflows = {}, internalProps.groupBy = null !== (_k = null == groupConfig ? void 0 : groupConfig.groupBy) && void 0 !== _k ? _k : groupBy, internalProps.groupTitleCheckbox = null == groupConfig ? void 0 : groupConfig.titleCheckbox, internalProps.groupTitleFieldFormat = null !== (_l = null == groupConfig ? void 0 : groupConfig.titleFieldFormat) && void 0 !== _l ? _l : groupTitleFieldFormat, internalProps.groupTitleCustomLayout = null !== (_m = null == groupConfig ? void 0 : groupConfig.titleCustomLayout) && void 0 !== _m ? _m : groupTitleCustomLayout, internalProps.enableTreeStickCell = null !== (_o = null == groupConfig ? void 0 : groupConfig.enableTreeStickCell) && void 0 !== _o ? _o : enableTreeStickCell, internalProps._rowHeightsMap = new NumberRangeMap(this), internalProps._rowRangeHeightsMap = new Map(), internalProps._colRangeWidthsMap = new Map(), internalProps._widthResizedColMap = new Set(), internalProps._heightResizedRowMap = new Set(), this.colWidthsMap = new NumberMap(), this.colContentWidthsMap = new NumberMap(), this.colWidthsLimit = {}, internalProps.stick.changedCells.clear(), internalProps.theme = themes.of(null !== (_p = options.theme) && void 0 !== _p ? _p : themes.DEFAULT), internalProps.theme.isPivot = this.isPivotTable(), setIconColor(internalProps.theme.functionalIconsStyle), this.scenegraph.updateStageBackground(), internalProps.autoWrapText = options.autoWrapText, internalProps.enableLineBreak = options.enableLineBreak, internalProps.allowFrozenColCount = null !== (_q = options.allowFrozenColCount) && void 0 !== _q ? _q : 0, internalProps.limitMaxAutoWidth = null !== (_r = options.limitMaxAutoWidth) && void 0 !== _r ? _r : 450, internalProps.limitMinWidth = null != limitMinWidth ? "number" == typeof limitMinWidth ? limitMinWidth : limitMinWidth ? 10 : 0 : 10, internalProps.limitMinHeight = null != limitMinHeight ? "number" == typeof limitMinHeight ? limitMinHeight : limitMinHeight ? 10 : 0 : 10, null === (_s = internalProps.legends) || void 0 === _s || _s.forEach(legend => {
|
|
54666
54677
|
null == legend || legend.release();
|
|
54667
54678
|
}), null === (_t = internalProps.title) || void 0 === _t || _t.release(), internalProps.title = null, null === (_u = internalProps.emptyTip) || void 0 === _u || _u.release(), internalProps.emptyTip = null, internalProps.layoutMap.release(), clearChartRenderQueue(), this.scenegraph.clearCells(), this.scenegraph.updateComponent(), this.stateManager.updateOptionSetState(), this._updateSize(), this.eventManager.updateEventBinder(), options.legends) {
|
|
54668
54679
|
internalProps.legends = [];
|
|
@@ -57028,7 +57039,7 @@
|
|
|
57028
57039
|
function getTreeTitleMerge(col, row, cellRange, layout) {
|
|
57029
57040
|
if ("tree" !== layout.rowHierarchyType) return;
|
|
57030
57041
|
const cellRecord = layout._table.getCellRawRecord(col, row);
|
|
57031
|
-
layout._table.internalProps.
|
|
57042
|
+
layout._table.internalProps.groupTitleCheckbox && layout._table.internalProps.rowSeriesNumber ? (null == cellRecord ? void 0 : cellRecord.vtableMerge) && col >= layout.leftRowSeriesNumberColumnCount && (cellRange.start.col = layout.rowHeaderLevelCount + layout.leftRowSeriesNumberColumnCount, cellRange.end.col = layout.colCount - 1, cellRange.start.row = cellRange.end.row = row) : (null == cellRecord ? void 0 : cellRecord.vtableMerge) && (cellRange.start.col = layout.rowHeaderLevelCount, cellRange.end.col = layout.colCount - 1, cellRange.start.row = cellRange.end.row = row);
|
|
57032
57043
|
}
|
|
57033
57044
|
function getCellRangeTranspose(col, row, layout) {
|
|
57034
57045
|
var _a, _b, _c, _d;
|
|
@@ -58186,10 +58197,10 @@
|
|
|
58186
58197
|
}
|
|
58187
58198
|
function listTableAddRecord(record, recordIndex, table) {
|
|
58188
58199
|
var _a, _b, _c, _d;
|
|
58189
|
-
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), table.refreshRowColCount(), table.internalProps.layoutMap.clearCellRangeMap(), table.sortState && sortRecords(table), table.scenegraph.clearCells(), table.scenegraph.createSceneGraph();else if (table.sortState) table.dataSource.addRecordForSorted(record), sortRecords(table), table.refreshRowColCount(), table.scenegraph.clearCells(), table.scenegraph.createSceneGraph();else {
|
|
58200
|
+
if (table.internalProps.groupBy) null === (_b = (_a = table.dataSource).addRecordsForGroup) || void 0 === _b || _b.call(_a, [record], recordIndex), table.refreshRowColCount(), table.internalProps.layoutMap.clearCellRangeMap(), table.sortState && sortRecords(table), table.scenegraph.clearCells(), table.scenegraph.createSceneGraph();else if ("tree" === table.dataSource.rowHierarchyType) null === (_d = (_c = table.dataSource).addRecordsForTree) || void 0 === _d || _d.call(_c, [record], recordIndex), adjustCheckBoxStateMapWithAddRecordIndex(table, recordIndex, 1), table.refreshRowColCount(), table.internalProps.layoutMap.clearCellRangeMap(), table.sortState && sortRecords(table), table.scenegraph.clearCells(), table.scenegraph.createSceneGraph();else if (table.sortState) table.dataSource.addRecordForSorted(record), table.stateManager.checkedState.clear(), sortRecords(table), table.refreshRowColCount(), table.scenegraph.clearCells(), table.scenegraph.createSceneGraph();else {
|
|
58190
58201
|
(void 0 === recordIndex || recordIndex > table.dataSource.sourceLength) && (recordIndex = table.dataSource.sourceLength);
|
|
58191
58202
|
const headerCount = table.transpose ? table.rowHeaderLevelCount : table.columnHeaderLevelCount;
|
|
58192
|
-
table.dataSource.addRecord(record, recordIndex);
|
|
58203
|
+
table.dataSource.addRecord(record, recordIndex), adjustCheckBoxStateMapWithAddRecordIndex(table, recordIndex, 1);
|
|
58193
58204
|
const oldRowCount = table.rowCount;
|
|
58194
58205
|
if (table.refreshRowColCount(), 0 === table.scenegraph.proxy.totalActualBodyRowCount) return table.scenegraph.clearCells(), void table.scenegraph.createSceneGraph();
|
|
58195
58206
|
const newRowCount = table.transpose ? table.colCount : table.rowCount;
|
|
@@ -58255,10 +58266,10 @@
|
|
|
58255
58266
|
}
|
|
58256
58267
|
function listTableAddRecords(records, recordIndex, table) {
|
|
58257
58268
|
var _a, _b, _c, _d;
|
|
58258
|
-
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), table.refreshRowColCount(), table.internalProps.layoutMap.clearCellRangeMap(), table.sortState && sortRecords(table), table.scenegraph.clearCells(), table.scenegraph.createSceneGraph();else if (table.sortState) table.dataSource.addRecordsForSorted(records), sortRecords(table), table.refreshRowColCount(), table.scenegraph.clearCells(), table.scenegraph.createSceneGraph();else {
|
|
58269
|
+
if (table.internalProps.groupBy) null === (_b = (_a = table.dataSource).addRecordsForGroup) || void 0 === _b || _b.call(_a, records, recordIndex), table.refreshRowColCount(), table.internalProps.layoutMap.clearCellRangeMap(), table.sortState && sortRecords(table), table.scenegraph.clearCells(), table.scenegraph.createSceneGraph();else if ("tree" === table.dataSource.rowHierarchyType) null === (_d = (_c = table.dataSource).addRecordsForTree) || void 0 === _d || _d.call(_c, records, recordIndex), adjustCheckBoxStateMapWithAddRecordIndex(table, recordIndex, records.length), table.refreshRowColCount(), table.internalProps.layoutMap.clearCellRangeMap(), table.sortState && sortRecords(table), table.scenegraph.clearCells(), table.scenegraph.createSceneGraph();else if (table.sortState) table.dataSource.addRecordsForSorted(records), sortRecords(table), table.refreshRowColCount(), table.scenegraph.clearCells(), table.scenegraph.createSceneGraph();else {
|
|
58259
58270
|
void 0 === recordIndex || recordIndex > table.dataSource.sourceLength ? recordIndex = table.dataSource.sourceLength : recordIndex < 0 && (recordIndex = 0);
|
|
58260
58271
|
const headerCount = table.transpose ? table.rowHeaderLevelCount : table.columnHeaderLevelCount;
|
|
58261
|
-
table.dataSource.addRecords(records, recordIndex);
|
|
58272
|
+
table.dataSource.addRecords(records, recordIndex), adjustCheckBoxStateMapWithAddRecordIndex(table, recordIndex, records.length);
|
|
58262
58273
|
const oldRowCount = table.transpose ? table.colCount : table.rowCount;
|
|
58263
58274
|
if (table.refreshRowColCount(), 0 === table.scenegraph.proxy.totalActualBodyRowCount) return table.scenegraph.clearCells(), void table.scenegraph.createSceneGraph();
|
|
58264
58275
|
const newRowCount = table.transpose ? table.colCount : table.rowCount;
|
|
@@ -58324,7 +58335,12 @@
|
|
|
58324
58335
|
}
|
|
58325
58336
|
function listTableDeleteRecords(recordIndexs, table) {
|
|
58326
58337
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
58327
|
-
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)
|
|
58338
|
+
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) {
|
|
58339
|
+
const deletedRecordIndexs = null === (_d = (_c = table.dataSource).deleteRecordsForTree) || void 0 === _d ? void 0 : _d.call(_c, recordIndexs);
|
|
58340
|
+
if (0 === deletedRecordIndexs.length) return;
|
|
58341
|
+
for (let index = 0; index < deletedRecordIndexs.length; index++) adjustCheckBoxStateMapWithDeleteRecordIndex(table, deletedRecordIndexs[index], 1);
|
|
58342
|
+
table.refreshRowColCount(), table.internalProps.layoutMap.clearCellRangeMap(), table.sortState && sortRecords(table), table.scenegraph.clearCells(), table.scenegraph.createSceneGraph();
|
|
58343
|
+
} else if (table.sortState) table.dataSource.deleteRecordsForSorted(recordIndexs), sortRecords(table), table.refreshRowColCount(), table.scenegraph.clearCells(), table.scenegraph.createSceneGraph();else {
|
|
58328
58344
|
const deletedRecordIndexs = table.dataSource.deleteRecords(recordIndexs);
|
|
58329
58345
|
if (0 === deletedRecordIndexs.length) return;
|
|
58330
58346
|
const oldRowCount = table.transpose ? table.colCount : table.rowCount;
|
|
@@ -58476,6 +58492,127 @@
|
|
|
58476
58492
|
}
|
|
58477
58493
|
}
|
|
58478
58494
|
}
|
|
58495
|
+
function adjustCheckBoxStateMapWithDeleteRecordIndex(table, recordIndex, count) {
|
|
58496
|
+
const {
|
|
58497
|
+
checkedState: checkedState
|
|
58498
|
+
} = table.stateManager;
|
|
58499
|
+
if (checkedState) if ("tree" === table.dataSource.rowHierarchyType) {
|
|
58500
|
+
let toOperateIndexArr;
|
|
58501
|
+
toOperateIndexArr = isNumber$4(recordIndex) ? [recordIndex] : recordIndex;
|
|
58502
|
+
const toOperateIndexArrLength = toOperateIndexArr.length,
|
|
58503
|
+
targetResult = [];
|
|
58504
|
+
checkedState.forEach((value, key) => {
|
|
58505
|
+
var _a;
|
|
58506
|
+
const keyArray = key.split(",");
|
|
58507
|
+
if (keyArray.length >= toOperateIndexArr.length) for (let i = 0; i < keyArray.length; i++) {
|
|
58508
|
+
const toOperateIndex = null !== (_a = toOperateIndexArr[i]) && void 0 !== _a ? _a : -1,
|
|
58509
|
+
keyIndex = Number(keyArray[i]);
|
|
58510
|
+
if (!(toOperateIndex === keyIndex && i < keyArray.length - 1)) {
|
|
58511
|
+
if (toOperateIndex === keyIndex && i === keyArray.length - 1 || -1 === toOperateIndex) {
|
|
58512
|
+
targetResult.push({
|
|
58513
|
+
originKey: key,
|
|
58514
|
+
value: value
|
|
58515
|
+
});
|
|
58516
|
+
break;
|
|
58517
|
+
}
|
|
58518
|
+
if (toOperateIndex < keyIndex && i === toOperateIndexArrLength - 1) {
|
|
58519
|
+
keyArray[i] = (keyIndex - count).toString(), targetResult.push({
|
|
58520
|
+
originKey: key,
|
|
58521
|
+
targetKey: keyArray.toString(),
|
|
58522
|
+
value: value
|
|
58523
|
+
});
|
|
58524
|
+
break;
|
|
58525
|
+
}
|
|
58526
|
+
break;
|
|
58527
|
+
}
|
|
58528
|
+
}
|
|
58529
|
+
}), targetResult.sort((a, b) => {
|
|
58530
|
+
const aArray = a.originKey.split(","),
|
|
58531
|
+
bArray = b.originKey.split(","),
|
|
58532
|
+
aLength = aArray.length,
|
|
58533
|
+
bLength = bArray.length,
|
|
58534
|
+
minLength = Math.min(aLength, bLength);
|
|
58535
|
+
for (let i = 0; i < minLength; i++) {
|
|
58536
|
+
const aIndex = Number(aArray[i]),
|
|
58537
|
+
bIndex = Number(bArray[i]);
|
|
58538
|
+
if (aIndex !== bIndex) return aIndex - bIndex;
|
|
58539
|
+
}
|
|
58540
|
+
return aLength - bLength;
|
|
58541
|
+
}), targetResult.forEach(({
|
|
58542
|
+
originKey: originKey,
|
|
58543
|
+
targetKey: targetKey,
|
|
58544
|
+
value: value
|
|
58545
|
+
}) => {
|
|
58546
|
+
checkedState.delete(originKey), targetKey && checkedState.set(targetKey, value);
|
|
58547
|
+
});
|
|
58548
|
+
} else {
|
|
58549
|
+
for (let key = checkedState.size - 1; key >= recordIndex; key--) {
|
|
58550
|
+
const record = checkedState.get(key.toString());
|
|
58551
|
+
checkedState.delete(key.toString()), checkedState.set((key - count).toString(), record);
|
|
58552
|
+
}
|
|
58553
|
+
}
|
|
58554
|
+
}
|
|
58555
|
+
function adjustCheckBoxStateMapWithAddRecordIndex(table, recordIndex, count) {
|
|
58556
|
+
const {
|
|
58557
|
+
checkedState: checkedState
|
|
58558
|
+
} = table.stateManager;
|
|
58559
|
+
if (checkedState) if ("tree" === table.dataSource.rowHierarchyType) {
|
|
58560
|
+
let toOperateIndexArr;
|
|
58561
|
+
toOperateIndexArr = isNumber$4(recordIndex) ? [recordIndex] : recordIndex;
|
|
58562
|
+
const toOperateIndexArrLength = toOperateIndexArr.length,
|
|
58563
|
+
targetResult = [];
|
|
58564
|
+
checkedState.forEach((value, key) => {
|
|
58565
|
+
var _a;
|
|
58566
|
+
const keyArray = key.split(",");
|
|
58567
|
+
if (keyArray.length >= toOperateIndexArr.length) for (let i = 0; i < keyArray.length; i++) {
|
|
58568
|
+
const toOperateIndex = null !== (_a = toOperateIndexArr[i]) && void 0 !== _a ? _a : -1,
|
|
58569
|
+
keyIndex = Number(keyArray[i]);
|
|
58570
|
+
if (toOperateIndex === keyIndex && (i === keyArray.length - 1 || i === toOperateIndexArrLength - 1)) {
|
|
58571
|
+
keyArray[i] = (keyIndex + count).toString(), targetResult.push({
|
|
58572
|
+
originKey: key,
|
|
58573
|
+
targetKey: keyArray.toString(),
|
|
58574
|
+
value: value
|
|
58575
|
+
});
|
|
58576
|
+
break;
|
|
58577
|
+
}
|
|
58578
|
+
if (!(toOperateIndex === keyIndex && i < keyArray.length - 1)) {
|
|
58579
|
+
if (toOperateIndex < keyIndex && i === toOperateIndexArrLength - 1) {
|
|
58580
|
+
keyArray[i] = (keyIndex + count).toString(), targetResult.push({
|
|
58581
|
+
originKey: key,
|
|
58582
|
+
targetKey: keyArray.toString(),
|
|
58583
|
+
value: value
|
|
58584
|
+
});
|
|
58585
|
+
break;
|
|
58586
|
+
}
|
|
58587
|
+
break;
|
|
58588
|
+
}
|
|
58589
|
+
}
|
|
58590
|
+
}), targetResult.sort((a, b) => {
|
|
58591
|
+
const aArray = a.originKey.split(","),
|
|
58592
|
+
bArray = b.originKey.split(","),
|
|
58593
|
+
aLength = aArray.length,
|
|
58594
|
+
bLength = bArray.length,
|
|
58595
|
+
minLength = Math.min(aLength, bLength);
|
|
58596
|
+
for (let i = 0; i < minLength; i++) {
|
|
58597
|
+
const aIndex = Number(aArray[i]),
|
|
58598
|
+
bIndex = Number(bArray[i]);
|
|
58599
|
+
if (aIndex !== bIndex) return -aIndex + bIndex;
|
|
58600
|
+
}
|
|
58601
|
+
return -aLength + bLength;
|
|
58602
|
+
}), targetResult.forEach(({
|
|
58603
|
+
originKey: originKey,
|
|
58604
|
+
targetKey: targetKey,
|
|
58605
|
+
value: value
|
|
58606
|
+
}) => {
|
|
58607
|
+
checkedState.delete(originKey), targetKey && checkedState.set(targetKey, value);
|
|
58608
|
+
});
|
|
58609
|
+
} else {
|
|
58610
|
+
for (let key = checkedState.size - 1; key >= recordIndex; key--) {
|
|
58611
|
+
const record = checkedState.get(key.toString());
|
|
58612
|
+
checkedState.delete(key.toString()), checkedState.set((key + count).toString(), record);
|
|
58613
|
+
}
|
|
58614
|
+
}
|
|
58615
|
+
}
|
|
58479
58616
|
|
|
58480
58617
|
function fixUpdateRowRange(diffPositions, col, row, table) {
|
|
58481
58618
|
const updateCells = [{
|
|
@@ -58609,6 +58746,7 @@
|
|
|
58609
58746
|
this.internalProps.transpose !== transpose && (this.internalProps.transpose = transpose, this.internalProps.layoutMap && (this.internalProps.layoutMap.transpose = transpose, this.refreshRowColCount(), this._resetFrozenColCount(), this.renderAsync()));
|
|
58610
58747
|
}
|
|
58611
58748
|
getCellValue(col, row, skipCustomMerge) {
|
|
58749
|
+
var _a;
|
|
58612
58750
|
if (-1 === col || -1 === row) return null;
|
|
58613
58751
|
if (!skipCustomMerge) {
|
|
58614
58752
|
const customMergeText = this.getCustomMergeValue(col, row);
|
|
@@ -58627,7 +58765,11 @@
|
|
|
58627
58765
|
const record = table.getCellRawRecord(col, row);
|
|
58628
58766
|
if (null == record ? void 0 : record.vtableMerge) return "";
|
|
58629
58767
|
table.internalProps.layoutMap.isAggregation(col, row) || (value = this.dataSource.getGroupSeriesNumber(row - this.columnHeaderLevelCount));
|
|
58630
|
-
} else
|
|
58768
|
+
} else {
|
|
58769
|
+
const define = table.getBodyColumnDefine(col, row),
|
|
58770
|
+
checkboxSeriesNumberStyle = table.getFieldData(define.field, col, row);
|
|
58771
|
+
value = "string" == typeof checkboxSeriesNumberStyle ? checkboxSeriesNumberStyle : (null == checkboxSeriesNumberStyle ? void 0 : checkboxSeriesNumberStyle.text) ? null !== (_a = checkboxSeriesNumberStyle.text) && void 0 !== _a ? _a : "" : row - this.columnHeaderLevelCount + 1;
|
|
58772
|
+
}
|
|
58631
58773
|
const {
|
|
58632
58774
|
format: format
|
|
58633
58775
|
} = table.internalProps.layoutMap.getSeriesNumberBody(col, row);
|
|
@@ -62457,7 +62599,7 @@
|
|
|
62457
62599
|
return width -= padding[1] + padding[3] + iconWidth, height -= padding[0] + padding[2], "center" === textAlign ? checkboxComponent.setAttribute("x", padding[3] + cellLeftIconWidth + (width - checkboxComponent.AABBBounds.width()) / 2) : "right" === textAlign ? checkboxComponent.setAttribute("x", padding[3] + cellLeftIconWidth + width - checkboxComponent.AABBBounds.width()) : checkboxComponent.setAttribute("x", padding[3] + cellLeftIconWidth), "middle" === textBaseline ? checkboxComponent.setAttribute("y", padding[0] + (height - checkboxComponent.AABBBounds.height()) / 2) : "bottom" === textBaseline ? checkboxComponent.setAttribute("y", padding[0] + height - checkboxComponent.AABBBounds.height()) : checkboxComponent.setAttribute("y", padding[0]), cellGroup;
|
|
62458
62600
|
}
|
|
62459
62601
|
function createCheckbox(col, row, colWidth, cellWidth, cellHeight, padding, cellTheme, define, table, isCheckboxTree) {
|
|
62460
|
-
var _a, _b, _c, _d
|
|
62602
|
+
var _a, _b, _c, _d;
|
|
62461
62603
|
const style = table._getCellStyle(col, row),
|
|
62462
62604
|
size = getProp("size", style, col, row, table),
|
|
62463
62605
|
spaceBetweenTextAndIcon = getProp("spaceBetweenTextAndIcon", style, col, row, table),
|
|
@@ -62477,12 +62619,12 @@
|
|
|
62477
62619
|
text = null !== (_a = value) && void 0 !== _a ? _a : "";
|
|
62478
62620
|
if (isObject$7(value) ? (isChecked = value.checked, isDisabled = value.disable, text = null !== (_b = value.text) && void 0 !== _b ? _b : "") : "boolean" == typeof value && (isChecked = value, text = ""), table.internalProps.layoutMap.isSeriesNumber(col, row)) {
|
|
62479
62621
|
const checkboxSeriesNumberStyle = table.getFieldData(define.field, col, row);
|
|
62480
|
-
checkboxSeriesNumberStyle && (isChecked = checkboxSeriesNumberStyle.checked, isDisabled = checkboxSeriesNumberStyle.disable
|
|
62622
|
+
checkboxSeriesNumberStyle && ("string" == typeof checkboxSeriesNumberStyle || ("object" == typeof checkboxSeriesNumberStyle ? (isChecked = checkboxSeriesNumberStyle.checked, isDisabled = checkboxSeriesNumberStyle.disable) : "boolean" == typeof checkboxSeriesNumberStyle && (isChecked = checkboxSeriesNumberStyle)));
|
|
62481
62623
|
}
|
|
62482
62624
|
isChecked = table.stateManager.syncCheckedState(col, row, define.field, isChecked);
|
|
62483
62625
|
const hierarchyOffset = getHierarchyOffset(col, row, table),
|
|
62484
62626
|
cellStyle = table._getCellStyle(col, row),
|
|
62485
|
-
autoWrapText = null !== (
|
|
62627
|
+
autoWrapText = null !== (_c = cellStyle.autoWrapText) && void 0 !== _c ? _c : table.internalProps.autoWrapText,
|
|
62486
62628
|
{
|
|
62487
62629
|
lineClamp: lineClamp
|
|
62488
62630
|
} = cellStyle,
|
|
@@ -62538,7 +62680,7 @@
|
|
|
62538
62680
|
},
|
|
62539
62681
|
dx: isCheckboxTree ? hierarchyOffset : 0,
|
|
62540
62682
|
spaceBetweenTextAndIcon: spaceBetweenTextAndIcon,
|
|
62541
|
-
disabled: null !== (
|
|
62683
|
+
disabled: null !== (_d = null != isDisabled ? isDisabled : globalDisable) && void 0 !== _d && _d
|
|
62542
62684
|
};
|
|
62543
62685
|
"indeterminate" === isChecked ? (checkboxAttributes.checked = void 0, checkboxAttributes.indeterminate = !0) : (checkboxAttributes.checked = isChecked, checkboxAttributes.indeterminate = void 0), defaultFill && (checkboxAttributes.box.fill = defaultFill), defaultStroke && (checkboxAttributes.box.stroke = defaultStroke), disableFill && (checkboxAttributes.box.disableFill = disableFill), checkedFill && (checkboxAttributes.box.checkedFill = checkedFill), checkedStroke && (checkboxAttributes.box.checkedStroke = checkedStroke), disableCheckedFill && (checkboxAttributes.box.disableCheckedFill = disableCheckedFill), disableCheckedStroke && (checkboxAttributes.box.disableCheckedStroke = disableCheckedStroke), checkIconImage && (checkboxAttributes.icon.checkIconImage = checkIconImage), indeterminateIconImage && (checkboxAttributes.icon.indeterminateIconImage = indeterminateIconImage);
|
|
62544
62686
|
const checkbox = new CheckBox(checkboxAttributes);
|