@visactor/vtable-calendar 1.26.5 → 1.26.6
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 +277 -53
- package/dist/vtable-calendar.min.js +1 -1
- package/package.json +4 -4
package/dist/vtable-calendar.js
CHANGED
|
@@ -50674,7 +50674,7 @@
|
|
|
50674
50674
|
const recordIndex = recordIndexsMaxToMin[index];
|
|
50675
50675
|
if (isNumber$3(recordIndex) && (recordIndex >= this.sourceLength || recordIndex < 0)) continue;
|
|
50676
50676
|
const originRecordIndex = this.getOriginRecordIndexForGroup(recordIndex);
|
|
50677
|
-
this.beforeChangedRecordsMap.delete(originRecordIndex.toString()), this.dataSourceObj.records.splice(originRecordIndex, 1), this.sourceLength -= 1, this.adjustBeforeChangedRecordsMap(originRecordIndex, 1, "delete");
|
|
50677
|
+
isValid$1(originRecordIndex) && (this.beforeChangedRecordsMap.delete(originRecordIndex.toString()), this.dataSourceObj.records.splice(originRecordIndex, 1), this.sourceLength -= 1, this.adjustBeforeChangedRecordsMap(originRecordIndex, 1, "delete"));
|
|
50678
50678
|
}
|
|
50679
50679
|
this.updateGroup();
|
|
50680
50680
|
}
|
|
@@ -50683,7 +50683,7 @@
|
|
|
50683
50683
|
const recordIndex = recordIndexs[index];
|
|
50684
50684
|
if (isNumber$3(recordIndex) && (recordIndex >= this.sourceLength || recordIndex < 0)) continue;
|
|
50685
50685
|
const originRecordIndex = this.getOriginRecordIndexForGroup(recordIndex);
|
|
50686
|
-
this.beforeChangedRecordsMap.delete(originRecordIndex.toString()), this.dataSourceObj.records[originRecordIndex] = records[index];
|
|
50686
|
+
isValid$1(originRecordIndex) && (this.beforeChangedRecordsMap.delete(originRecordIndex.toString()), this.dataSourceObj.records[originRecordIndex] = records[index]);
|
|
50687
50687
|
}
|
|
50688
50688
|
this.updateGroup();
|
|
50689
50689
|
}
|
|
@@ -52423,7 +52423,7 @@
|
|
|
52423
52423
|
"image" === icon.type ? icon.isGif ? (iconAttribute.gif = icon.src, iconAttribute.image = icon.src) : iconAttribute.image = icon.src : ("svg" === icon.type || "svg" in icon) && (iconAttribute.image = icon.svg), iconAttribute.width = icon.width, iconAttribute.height = icon.height, iconAttribute.visibleTime = null !== (_a = icon.visibleTime) && void 0 !== _a ? _a : "always", iconAttribute.funcType = icon.funcType, iconAttribute.interactive = icon.interactive, iconAttribute.isGif = icon.isGif;
|
|
52424
52424
|
let iconMark,
|
|
52425
52425
|
hierarchyOffset = 0;
|
|
52426
|
-
return dealWithIconComputeVar && 0 !== (null == dealWithIconComputeVar ? void 0 : dealWithIconComputeVar.addedHierarchyOffset) || !isNumber$3(col) || !isNumber$3(row) || !table || icon.funcType !== IconFuncTypeEnum.collapse && icon.funcType !== IconFuncTypeEnum.expand && icon.positionType !== IconPosition.contentLeft && icon.positionType !== IconPosition.contentRight || (hierarchyOffset = range ? getHierarchyOffset(range.start.col, range.start.row, table) : getHierarchyOffset(col, row, table), dealWithIconComputeVar && (dealWithIconComputeVar.addedHierarchyOffset = 1)), iconAttribute.marginLeft = (null !== (_b = icon.marginLeft) && void 0 !== _b ? _b : 0) + hierarchyOffset, iconAttribute.marginRight = null !== (_c = icon.marginRight) && void 0 !== _c ? _c : 0, !1 === icon.interactive && (iconAttribute.pickable = !1), icon.hover && (iconAttribute.backgroundWidth = null !== (_d = icon.hover.width) && void 0 !== _d ? _d : icon.width, iconAttribute.backgroundHeight = null !== (_e = icon.hover.width) && void 0 !== _e ? _e : icon.width, iconAttribute.backgroundColor = null !== (_f = icon.hover.bgColor) && void 0 !== _f ? _f : "rgba(22,44,66,0.2)", iconAttribute.hoverImage = icon.hover.image), icon.cursor && (iconAttribute.cursor = icon.cursor), "shape" in icon && "circle" === icon.shape && (iconAttribute.shape = icon.shape), mark ? (mark.setAttributes(iconAttribute), mark.loadImage(iconAttribute.image), mark.tooltip = icon.tooltip, mark.name = icon.name, mark) : ("text" === icon.type ? (
|
|
52426
|
+
return dealWithIconComputeVar && 0 !== (null == dealWithIconComputeVar ? void 0 : dealWithIconComputeVar.addedHierarchyOffset) || !isNumber$3(col) || !isNumber$3(row) || !table || icon.funcType !== IconFuncTypeEnum.collapse && icon.funcType !== IconFuncTypeEnum.expand && icon.positionType !== IconPosition.contentLeft && icon.positionType !== IconPosition.contentRight || (hierarchyOffset = range ? getHierarchyOffset(range.start.col, range.start.row, table) : getHierarchyOffset(col, row, table), dealWithIconComputeVar && (dealWithIconComputeVar.addedHierarchyOffset = 1)), iconAttribute.marginLeft = (null !== (_b = icon.marginLeft) && void 0 !== _b ? _b : 0) + hierarchyOffset, iconAttribute.marginRight = null !== (_c = icon.marginRight) && void 0 !== _c ? _c : 0, !1 === icon.interactive && (iconAttribute.pickable = !1), icon.hover && (iconAttribute.backgroundWidth = null !== (_d = icon.hover.width) && void 0 !== _d ? _d : icon.width, iconAttribute.backgroundHeight = null !== (_e = icon.hover.width) && void 0 !== _e ? _e : icon.width, iconAttribute.backgroundColor = null !== (_f = icon.hover.bgColor) && void 0 !== _f ? _f : "rgba(22,44,66,0.2)", iconAttribute.hoverImage = icon.hover.image), icon.cursor && (iconAttribute.cursor = icon.cursor), "shape" in icon && "circle" === icon.shape && (iconAttribute.shape = icon.shape), "text" === icon.type && (iconAttribute.text = icon.content, merge(iconAttribute, icon.style)), isNil$1(iconAttribute.opacity) && (iconAttribute.opacity = "mouseenter_cell" === iconAttribute.visibleTime || "click_cell" === iconAttribute.visibleTime ? 0 : 1), mark ? (mark.setAttributes(iconAttribute), iconAttribute.image && mark.loadImage(iconAttribute.image), mark.tooltip = icon.tooltip, mark.name = icon.name, mark) : ("text" === icon.type ? (iconMark = new TextIcon(iconAttribute), iconMark.tooltip = icon.tooltip, iconMark.name = icon.name) : (iconMark = new Icon(iconAttribute), iconMark.tooltip = icon.tooltip, iconMark.name = icon.name), iconMark);
|
|
52427
52427
|
}
|
|
52428
52428
|
function dealWithRichTextIcon(icon) {
|
|
52429
52429
|
var _a, _b, _c, _d, _e, _f;
|
|
@@ -53458,15 +53458,26 @@
|
|
|
53458
53458
|
table.isPivotTable() && (layoutMap.disableUseGetBodyCache(), layoutMap.disableUseHeaderPathCache());
|
|
53459
53459
|
}
|
|
53460
53460
|
function computeRowHeight(row, startCol, endCol, table) {
|
|
53461
|
+
return computeRowHeightInternal(row, startCol, endCol, table, !0);
|
|
53462
|
+
}
|
|
53463
|
+
function computeRowHeightInternal(row, startCol, endCol, table, enableCustomCompute) {
|
|
53461
53464
|
if (!(table.isAutoRowHeight(row) || "adaptive" === table.heightMode && !1 !== table.options.autoHeightInAdaptiveMode) && "auto" !== table.getDefaultRowHeight(row)) return table.getDefaultRowHeight(row);
|
|
53462
53465
|
let maxHeight;
|
|
53463
|
-
if (table.options.customComputeRowHeight) {
|
|
53464
|
-
|
|
53465
|
-
|
|
53466
|
-
|
|
53466
|
+
if (enableCustomCompute && table.options.customComputeRowHeight) {
|
|
53467
|
+
let realHeight,
|
|
53468
|
+
hasRealHeight = !1;
|
|
53469
|
+
const getRealHeight = () => (hasRealHeight || (realHeight = computeRowHeightInternal(row, startCol, endCol, table, !1), hasRealHeight = !0), realHeight),
|
|
53470
|
+
computeArgs = {
|
|
53471
|
+
row: row,
|
|
53472
|
+
table: table
|
|
53473
|
+
};
|
|
53474
|
+
Object.defineProperty(computeArgs, "realHeight", {
|
|
53475
|
+
get: getRealHeight,
|
|
53476
|
+
enumerable: !1,
|
|
53477
|
+
configurable: !0
|
|
53467
53478
|
});
|
|
53468
|
-
|
|
53469
|
-
|
|
53479
|
+
const customRowHeight = table.options.customComputeRowHeight(computeArgs);
|
|
53480
|
+
return "number" == typeof customRowHeight ? customRowHeight : "auto" === customRowHeight ? getRealHeight() : table.getDefaultRowHeight(row);
|
|
53470
53481
|
}
|
|
53471
53482
|
if (table.internalProps.rowHeightConfig) {
|
|
53472
53483
|
const rowHeightConfig = table.internalProps.rowHeightConfig.find(item => item.key === row);
|
|
@@ -55872,6 +55883,22 @@
|
|
|
55872
55883
|
containerGroup.setAttribute("width", x), containerGroup.setAttribute("height", heightMax);
|
|
55873
55884
|
}
|
|
55874
55885
|
|
|
55886
|
+
function fillVisibleBodyRows$1(proxy, distRow) {
|
|
55887
|
+
const {
|
|
55888
|
+
table: table
|
|
55889
|
+
} = proxy,
|
|
55890
|
+
bodyBottomRow = table.rowCount - 1 - table.bottomFrozenRowCount,
|
|
55891
|
+
visibleBodyHeight = table.tableNoFrameHeight - table.getFrozenRowsHeight() - table.getBottomFrozenRowsHeight();
|
|
55892
|
+
let targetRow = distRow;
|
|
55893
|
+
for (; targetRow < bodyBottomRow && table.getRowsHeight(table.frozenRowCount, targetRow) < visibleBodyHeight;) {
|
|
55894
|
+
const nextRow = targetRow + 1;
|
|
55895
|
+
computeRowsHeight(table, nextRow, nextRow, !1), targetRow = nextRow;
|
|
55896
|
+
}
|
|
55897
|
+
return targetRow;
|
|
55898
|
+
}
|
|
55899
|
+
function syncVisibleBodyRows(proxy, targetRow) {
|
|
55900
|
+
targetRow <= proxy.totalRow || (proxy.totalRow = targetRow, proxy.totalActualBodyRowCount = Math.max(proxy.totalActualBodyRowCount, targetRow - proxy.bodyTopRow + 1));
|
|
55901
|
+
}
|
|
55875
55902
|
function createGroupForFirstScreen(cornerHeaderGroup, colHeaderGroup, rowHeaderGroup, rightFrozenGroup, bottomFrozenGroup, bodyGroup, xOrigin, yOrigin, proxy) {
|
|
55876
55903
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
|
55877
55904
|
const {
|
|
@@ -55883,10 +55910,12 @@
|
|
|
55883
55910
|
rightBottomCornerGroup: rightBottomCornerGroup
|
|
55884
55911
|
} = table.scenegraph;
|
|
55885
55912
|
let distCol, distRow, distColForCompute, distRowForCompute;
|
|
55886
|
-
proxy.setParamsForRow(), proxy.setParamsForColumn(), "adaptive" === table.widthMode || table.options.autoWrapText && ("adaptive" === table.heightMode || table.isAutoRowHeight(table.columnHeaderLevelCount)) ? (distColForCompute = table.colCount - 1, distCol = Math.min(proxy.firstScreenColLimit - 1, table.colCount - 1)) : distCol = Math.min(proxy.firstScreenColLimit - 1, table.colCount - 1), "adaptive" === table.heightMode ? (distRowForCompute = table.rowCount - 1, distRow = Math.min(proxy.firstScreenRowLimit - 1, table.rowCount - 1)) : distRow = Math.min(proxy.firstScreenRowLimit - 1, table.rowCount - 1)
|
|
55913
|
+
proxy.setParamsForRow(), proxy.setParamsForColumn(), "adaptive" === table.widthMode || table.options.autoWrapText && ("adaptive" === table.heightMode || table.isAutoRowHeight(table.columnHeaderLevelCount)) ? (distColForCompute = table.colCount - 1, distCol = Math.min(proxy.firstScreenColLimit - 1, table.colCount - 1)) : distCol = Math.min(proxy.firstScreenColLimit - 1, table.colCount - 1), "adaptive" === table.heightMode ? (distRowForCompute = table.rowCount - 1, distRow = Math.min(proxy.firstScreenRowLimit - 1, table.rowCount - 1)) : distRow = Math.min(proxy.firstScreenRowLimit - 1, table.rowCount - 1);
|
|
55914
|
+
let bodyDistRow = Math.min(proxy.bodyBottomRow, distRow - table.bottomFrozenRowCount);
|
|
55915
|
+
0 === table.internalProps._widthResizedColMap.size && computeColsWidth(table, 0, null != distColForCompute ? distColForCompute : distCol), 0 === table.internalProps._heightResizedRowMap.size && (computeRowsHeight(table, 0, "auto" === table.options.canvasHeight || (null === (_a = table.options.customConfig) || void 0 === _a ? void 0 : _a.forceComputeAllRowHeight) ? table.rowCount - 1 : null != distRowForCompute ? distRowForCompute : distRow), "autoHeight" === table.heightMode && (bodyDistRow = fillVisibleBodyRows$1(proxy, bodyDistRow), syncVisibleBodyRows(proxy, bodyDistRow))), distCol < table.colCount - table.rightFrozenColCount && table.colCount - table.rightFrozenColCount <= table.colCount - 1 && computeColsWidth(table, table.colCount - table.rightFrozenColCount, table.colCount - 1), distRow < table.rowCount - table.bottomFrozenRowCount && table.rowCount - table.bottomFrozenRowCount <= table.rowCount - 1 && computeRowsHeight(table, table.rowCount - table.bottomFrozenRowCount, table.rowCount - 1), table.scenegraph.colHeaderGroup.setAttribute("x", table.getFrozenColsWidth()), table.scenegraph.rowHeaderGroup.setAttribute("y", table.getFrozenRowsHeight()), table.scenegraph.bottomFrozenGroup.setAttribute("x", table.getFrozenColsWidth()), table.scenegraph.rightFrozenGroup.setAttribute("y", table.getFrozenRowsHeight()), table.scenegraph.bodyGroup.setAttributes({
|
|
55887
55916
|
x: table.getFrozenColsWidth(),
|
|
55888
55917
|
y: table.getFrozenRowsHeight()
|
|
55889
|
-
}), createColGroup(cornerHeaderGroup, xOrigin, yOrigin, 0, table.frozenColCount - 1, 0, table.frozenRowCount - 1, table.isListTable() ? "columnHeader" : "cornerHeader", table), distCol - table.rightFrozenColCount >= table.frozenColCount && createColGroup(colHeaderGroup, xOrigin, yOrigin, table.frozenColCount, distCol - table.rightFrozenColCount, 0, table.frozenRowCount - 1, "columnHeader", table), table.frozenColCount > 0 && (table.leftRowSeriesNumberCount > 0 && createColGroup(rowHeaderGroup, xOrigin, yOrigin, 0, table.leftRowSeriesNumberCount - 1, table.frozenRowCount,
|
|
55918
|
+
}), createColGroup(cornerHeaderGroup, xOrigin, yOrigin, 0, table.frozenColCount - 1, 0, table.frozenRowCount - 1, table.isListTable() ? "columnHeader" : "cornerHeader", table), distCol - table.rightFrozenColCount >= table.frozenColCount && createColGroup(colHeaderGroup, xOrigin, yOrigin, table.frozenColCount, distCol - table.rightFrozenColCount, 0, table.frozenRowCount - 1, "columnHeader", table), table.frozenColCount > 0 && (table.leftRowSeriesNumberCount > 0 && createColGroup(rowHeaderGroup, xOrigin, yOrigin, 0, table.leftRowSeriesNumberCount - 1, table.frozenRowCount, bodyDistRow, "rowHeader", table), table.frozenColCount > table.leftRowSeriesNumberCount && createColGroup(rowHeaderGroup, xOrigin, yOrigin, table.leftRowSeriesNumberCount, Math.min(table.frozenColCount - 1, table.rowHeaderLevelCount + table.leftRowSeriesNumberCount - 1), table.frozenRowCount, bodyDistRow, "rowHeader", table), table.frozenColCount > table.rowHeaderLevelCount + table.leftRowSeriesNumberCount && createColGroup(rowHeaderGroup, xOrigin, yOrigin, table.rowHeaderLevelCount + table.leftRowSeriesNumberCount, table.frozenColCount - 1, table.frozenRowCount, bodyDistRow, "body", table)), table.bottomFrozenRowCount > 0 && (table.frozenColCount > 0 && (table.leftRowSeriesNumberCount > 0 && createColGroup(leftBottomCornerGroup, xOrigin, yOrigin, 0, table.leftRowSeriesNumberCount - 1, table.rowCount - 1 - table.bottomFrozenRowCount + 1, table.rowCount - 1, "rowHeader", table), table.rowHeaderLevelCount > 0 && createColGroup(leftBottomCornerGroup, xOrigin, yOrigin, table.leftRowSeriesNumberCount, table.leftRowSeriesNumberCount + table.rowHeaderLevelCount - 1, table.rowCount - 1 - table.bottomFrozenRowCount + 1, table.rowCount - 1, "rowHeader", table), table.frozenColCount > table.rowHeaderLevelCount + table.leftRowSeriesNumberCount && createColGroup(leftBottomCornerGroup, xOrigin, yOrigin, table.rowHeaderLevelCount + table.leftRowSeriesNumberCount, table.frozenColCount - 1, table.rowCount - 1 - table.bottomFrozenRowCount + 1, table.rowCount - 1, "body", table)), distCol - table.rightFrozenColCount >= table.frozenColCount && createColGroup(bottomFrozenGroup, xOrigin, yOrigin, table.frozenColCount, distCol - table.rightFrozenColCount, table.rowCount - 1 - table.bottomFrozenRowCount + 1, table.rowCount - 1, table.isPivotChart() ? "rowHeader" : "body", table)), table.rightFrozenColCount > 0 && (createColGroup(rightTopCornerGroup, xOrigin, yOrigin, table.colCount - 1 - table.rightFrozenColCount + 1, table.colCount - 1, 0, table.frozenRowCount - 1, "columnHeader", table), createColGroup(rightFrozenGroup, xOrigin, yOrigin, table.colCount - 1 - table.rightFrozenColCount + 1, table.colCount - 1, table.frozenRowCount, bodyDistRow, table.isPivotChart() ? "rowHeader" : "body", table)), table.bottomFrozenRowCount > 0 && table.rightFrozenColCount > 0 && createColGroup(rightBottomCornerGroup, xOrigin, yOrigin, table.colCount - 1 - table.rightFrozenColCount + 1, table.colCount - 1, table.rowCount - 1 - table.bottomFrozenRowCount + 1, table.rowCount - 1, "body", table), distCol - table.rightFrozenColCount >= table.frozenColCount && createColGroup(bodyGroup, xOrigin, yOrigin, table.frozenColCount, distCol - table.rightFrozenColCount, table.frozenRowCount, bodyDistRow, "body", table), bodyGroup.firstChild || colHeaderGroup.firstChild || cornerHeaderGroup.firstChild || rowHeaderGroup.firstChild ? (proxy.currentRow = null !== (_e = null !== (_c = null === (_b = bodyGroup.firstChild) || void 0 === _b ? void 0 : _b.rowNumber) && void 0 !== _c ? _c : null === (_d = rowHeaderGroup.firstChild) || void 0 === _d ? void 0 : _d.rowNumber) && void 0 !== _e ? _e : proxy.totalRow, proxy.rowEnd = proxy.currentRow, proxy.rowUpdatePos = proxy.rowEnd + 1, proxy.referenceRow = proxy.rowStart + Math.floor((proxy.rowEnd - proxy.rowStart) / 2), proxy.currentCol = null !== (_o = null !== (_l = null !== (_j = null !== (_g = null === (_f = bodyGroup.lastChild) || void 0 === _f ? void 0 : _f.col) && void 0 !== _g ? _g : null === (_h = colHeaderGroup.lastChild) || void 0 === _h ? void 0 : _h.col) && void 0 !== _j ? _j : null === (_k = rowHeaderGroup.lastChild) || void 0 === _k ? void 0 : _k.col) && void 0 !== _l ? _l : null === (_m = cornerHeaderGroup.lastChild) || void 0 === _m ? void 0 : _m.col) && void 0 !== _o ? _o : proxy.totalCol, proxy.colEnd = proxy.currentCol, proxy.colUpdatePos = proxy.colEnd + 1, proxy.referenceCol = proxy.colStart + Math.floor((proxy.colEnd - proxy.colStart) / 2), proxy.progress()) : (proxy.currentRow = proxy.totalRow, proxy.rowEnd = proxy.currentRow, proxy.rowUpdatePos = proxy.rowEnd + 1, proxy.referenceRow = proxy.rowStart + Math.floor((proxy.rowEnd - proxy.rowStart) / 2), proxy.currentCol = proxy.totalCol, proxy.colEnd = proxy.currentCol, proxy.colUpdatePos = proxy.colEnd + 1, proxy.referenceCol = proxy.colStart + Math.floor((proxy.colEnd - proxy.colStart) / 2));
|
|
55890
55919
|
}
|
|
55891
55920
|
|
|
55892
55921
|
function getFirstChild(containerGroup) {
|
|
@@ -57305,10 +57334,12 @@
|
|
|
57305
57334
|
rowUpdatePos = isValid$1(rowUpdatePos) ? isValid$1(pos) ? Math.min(rowUpdatePos, pos) : rowUpdatePos : pos;
|
|
57306
57335
|
}
|
|
57307
57336
|
let updateAfter;
|
|
57308
|
-
|
|
57337
|
+
scene.table._clearRowRangeHeightsMap(), verifyProxyRowStatus(scene), addRows.forEach(row => {
|
|
57309
57338
|
const needUpdateAfter = addRow(row, scene, skipUpdateProxy);
|
|
57310
57339
|
updateAfter = null != updateAfter ? updateAfter : needUpdateAfter, rowHeightsMap.insert(row);
|
|
57311
|
-
})
|
|
57340
|
+
});
|
|
57341
|
+
const filledVisibleRowStart = fillVisibleBodyRows(scene);
|
|
57342
|
+
if (isNumber$3(filledVisibleRowStart) && (updateAfter = null != updateAfter ? updateAfter : filledVisibleRowStart, rowUpdatePos = isValid$1(rowUpdatePos) ? Math.min(rowUpdatePos, filledVisibleRowStart) : filledVisibleRowStart), resetRowNumberAndY(scene), addRows.length) {
|
|
57312
57343
|
const pos = _getUpdateRowIndex(addRows[0] - 1, addRows[addRows.length - 1] + 1, scene);
|
|
57313
57344
|
rowUpdatePos = isValid$1(rowUpdatePos) ? isValid$1(pos) ? Math.min(rowUpdatePos, pos) : rowUpdatePos : pos;
|
|
57314
57345
|
}
|
|
@@ -57376,6 +57407,24 @@
|
|
|
57376
57407
|
}
|
|
57377
57408
|
if (!(row < proxy.rowStart)) return row > proxy.rowEnd ? proxy.rowEnd - proxy.rowStart + 1 < proxy.rowLimit ? (proxy.rowEnd++, proxy.currentRow++, addRowCellGroup(row, scene), row) : void 0 : proxy.rowEnd - proxy.rowStart + 1 < proxy.rowLimit ? (proxy.rowEnd++, proxy.currentRow++, addRowCellGroup(row, scene), row) : row;
|
|
57378
57409
|
}
|
|
57410
|
+
function fillVisibleBodyRows(scene) {
|
|
57411
|
+
const {
|
|
57412
|
+
table: table,
|
|
57413
|
+
proxy: proxy
|
|
57414
|
+
} = scene;
|
|
57415
|
+
if ("autoHeight" !== table.heightMode) return;
|
|
57416
|
+
const bodyBottomRow = table.rowCount - 1 - table.bottomFrozenRowCount,
|
|
57417
|
+
visibleBodyHeight = table.tableNoFrameHeight - table.getFrozenRowsHeight() - table.getBottomFrozenRowsHeight();
|
|
57418
|
+
let targetRow = Math.min(proxy.rowEnd, bodyBottomRow);
|
|
57419
|
+
for (computeRowsHeight(table, proxy.rowStart, targetRow, !1); targetRow < bodyBottomRow && table.getRowsHeight(table.frozenRowCount, targetRow) < visibleBodyHeight;) {
|
|
57420
|
+
const nextRow = targetRow + 1;
|
|
57421
|
+
computeRowsHeight(table, nextRow, nextRow, !1), targetRow = nextRow;
|
|
57422
|
+
}
|
|
57423
|
+
if (targetRow <= proxy.rowEnd) return;
|
|
57424
|
+
const startRow = proxy.rowEnd + 1;
|
|
57425
|
+
for (let row = startRow; row <= targetRow; row++) addRowCellGroup(row, scene);
|
|
57426
|
+
return proxy.rowEnd = targetRow, proxy.currentRow = Math.max(proxy.currentRow, targetRow), proxy.totalRow = Math.max(proxy.totalRow, targetRow), proxy.totalActualBodyRowCount = Math.max(proxy.totalActualBodyRowCount, targetRow - proxy.rowStart + 1), proxy.rowUpdatePos = Math.min(proxy.rowUpdatePos, startRow), startRow;
|
|
57427
|
+
}
|
|
57379
57428
|
function resetRowNumber(scene) {
|
|
57380
57429
|
function processCell(cellGroup, rowIndex) {
|
|
57381
57430
|
cellGroup.row = rowIndex;
|
|
@@ -59092,25 +59141,57 @@
|
|
|
59092
59141
|
height: this.tableGroup.attribute.height
|
|
59093
59142
|
})));
|
|
59094
59143
|
}
|
|
59095
|
-
this.table.
|
|
59096
|
-
|
|
59097
|
-
|
|
59098
|
-
|
|
59099
|
-
|
|
59100
|
-
|
|
59101
|
-
|
|
59102
|
-
|
|
59103
|
-
|
|
59104
|
-
|
|
59105
|
-
|
|
59106
|
-
|
|
59107
|
-
|
|
59108
|
-
|
|
59144
|
+
const hasFrozenCols = this.table.frozenColCount > 0,
|
|
59145
|
+
hasRightFrozenCols = this.table.rightFrozenColCount > 0,
|
|
59146
|
+
hasFrozenRows = this.table.frozenRowCount > 0,
|
|
59147
|
+
hasBottomFrozenRows = this.table.bottomFrozenRowCount > 0;
|
|
59148
|
+
if (hasBottomFrozenRows) {
|
|
59149
|
+
const bottomFrozenRowsHeight = this.table.getBottomFrozenRowsHeight(),
|
|
59150
|
+
topFrozenBottom = Math.max(this.colHeaderGroup.attribute.y + this.colHeaderGroup.attribute.height, this.cornerHeaderGroup.attribute.y + this.cornerHeaderGroup.attribute.height, this.rightTopCornerGroup.attribute.y + this.rightTopCornerGroup.attribute.height),
|
|
59151
|
+
middleContentBottom = Math.max(this.rowHeaderGroup.attribute.y + this.rowHeaderGroup.attribute.height, this.bodyGroup.attribute.y + this.bodyGroup.attribute.height, this.rightFrozenGroup.attribute.y + this.rightFrozenGroup.attribute.height, topFrozenBottom),
|
|
59152
|
+
bottomFrozenY = Math.min(this.tableGroup.attribute.height - bottomFrozenRowsHeight, middleContentBottom);
|
|
59153
|
+
this.bottomFrozenGroup.setAttribute("y", bottomFrozenY), this.leftBottomCornerGroup.setAttributes({
|
|
59154
|
+
visible: hasFrozenCols,
|
|
59155
|
+
y: bottomFrozenY,
|
|
59156
|
+
height: bottomFrozenRowsHeight,
|
|
59157
|
+
width: hasFrozenCols ? this.table.getFrozenColsWidth() : 0
|
|
59158
|
+
}), this.rightBottomCornerGroup.setAttributes({
|
|
59159
|
+
visible: hasRightFrozenCols,
|
|
59160
|
+
x: 0,
|
|
59161
|
+
y: bottomFrozenY,
|
|
59162
|
+
width: 0,
|
|
59163
|
+
height: bottomFrozenRowsHeight
|
|
59164
|
+
});
|
|
59165
|
+
} else this.leftBottomCornerGroup.setAttributes({
|
|
59166
|
+
visible: !1,
|
|
59167
|
+
width: 0,
|
|
59168
|
+
height: 0
|
|
59109
59169
|
}), this.rightBottomCornerGroup.setAttributes({
|
|
59110
|
-
visible: !
|
|
59111
|
-
|
|
59112
|
-
|
|
59113
|
-
})
|
|
59170
|
+
visible: !1,
|
|
59171
|
+
width: 0,
|
|
59172
|
+
height: 0
|
|
59173
|
+
});
|
|
59174
|
+
if (hasRightFrozenCols) {
|
|
59175
|
+
const rightFrozenColsWidth = this.table.getRightFrozenColsWidth(),
|
|
59176
|
+
middleContentRight = Math.max(this.colHeaderGroup.attribute.x + this.colHeaderGroup.attribute.width, this.bodyGroup.attribute.x + this.bodyGroup.attribute.width, this.bottomFrozenGroup.attribute.x + this.bottomFrozenGroup.attribute.width),
|
|
59177
|
+
rightFrozenX = Math.min(this.tableGroup.attribute.width - rightFrozenColsWidth, middleContentRight);
|
|
59178
|
+
this.rightFrozenGroup.setAttribute("x", rightFrozenX), this.rightTopCornerGroup.setAttributes({
|
|
59179
|
+
visible: hasFrozenRows,
|
|
59180
|
+
x: rightFrozenX,
|
|
59181
|
+
width: hasFrozenRows ? rightFrozenColsWidth : 0,
|
|
59182
|
+
height: hasFrozenRows ? this.table.getFrozenRowsHeight() : 0
|
|
59183
|
+
}), this.rightBottomCornerGroup.setAttributes({
|
|
59184
|
+
visible: hasBottomFrozenRows,
|
|
59185
|
+
x: rightFrozenX,
|
|
59186
|
+
width: hasBottomFrozenRows ? rightFrozenColsWidth : 0,
|
|
59187
|
+
height: hasBottomFrozenRows ? this.table.getBottomFrozenRowsHeight() : 0
|
|
59188
|
+
});
|
|
59189
|
+
} else this.rightTopCornerGroup.setAttributes({
|
|
59190
|
+
visible: !1,
|
|
59191
|
+
width: 0,
|
|
59192
|
+
height: 0
|
|
59193
|
+
});
|
|
59194
|
+
this.updateDomContainer();
|
|
59114
59195
|
}
|
|
59115
59196
|
updateRowHeight(row, detaY, skipTableHeightMap) {
|
|
59116
59197
|
detaY = Math.round(detaY), updateRowHeight(this, row, detaY, skipTableHeightMap), this.updateContainerHeight(row, detaY);
|
|
@@ -60688,6 +60769,12 @@
|
|
|
60688
60769
|
} = checkbox.attribute;
|
|
60689
60770
|
indeterminate ? (checked || checkbox._handlePointerUp(), checkbox._handlePointerUp()) : oldChecked ? checked || checkbox._handlePointerUp() : checked && checkbox._handlePointerUp();
|
|
60690
60771
|
}
|
|
60772
|
+
function setCheckboxStateByRecordIndex(recordIndex, field, checked, table) {
|
|
60773
|
+
setRecordCheckboxState(recordIndex, field, checked, table.stateManager.checkedState), table.internalProps.enableCheckboxCascade && "indeterminate" !== checked && (updateChildrenCheckboxStateByRecordIndex(recordIndex, field, checked, table), updateParentCheckboxStateByRecordIndex(recordIndex, field, table)), updateVisibleCheckboxCellByRecordIndex(recordIndex, field, checked, table), updateHeaderCheckboxStateByField(field, table), renderCheckboxStateUpdate(table);
|
|
60774
|
+
}
|
|
60775
|
+
function clearCheckboxState(field, table) {
|
|
60776
|
+
isValid$1(field) && (clearRecordCheckboxState(table.records, field, table), updateVisibleCheckboxCellsByField(field, !1, table), updateHeaderCheckboxStateByField(field, table), renderCheckboxStateUpdate(table));
|
|
60777
|
+
}
|
|
60691
60778
|
function setCellCheckboxStateByAttribute(col, row, checked, table) {
|
|
60692
60779
|
var _a, _b;
|
|
60693
60780
|
const cellGroup = table.scenegraph.getCell(col, row),
|
|
@@ -60741,6 +60828,115 @@
|
|
|
60741
60828
|
}
|
|
60742
60829
|
}), result;
|
|
60743
60830
|
}
|
|
60831
|
+
function normalizeRecordIndex(recordIndex) {
|
|
60832
|
+
return isArray$5(recordIndex) && 1 === recordIndex.length ? recordIndex[0] : recordIndex;
|
|
60833
|
+
}
|
|
60834
|
+
function setRecordCheckboxState(recordIndex, field, checked, checkedState) {
|
|
60835
|
+
const dataIndex = normalizeRecordIndex(recordIndex).toString();
|
|
60836
|
+
checkedState.get(dataIndex) ? checkedState.get(dataIndex)[field] = checked : checkedState.set(dataIndex, {
|
|
60837
|
+
[field]: checked
|
|
60838
|
+
});
|
|
60839
|
+
}
|
|
60840
|
+
function clearRecordCheckboxState(records, field, table, parentIndex = []) {
|
|
60841
|
+
isArray$5(records) && records.forEach((record, index) => {
|
|
60842
|
+
const recordIndex = parentIndex.length ? parentIndex.concat(index) : [index];
|
|
60843
|
+
!1 !== getRecordCheckboxState(recordIndex, record, field, table) && setRecordCheckboxState(recordIndex, field, !1, table.stateManager.checkedState), isArray$5(null == record ? void 0 : record.children) && clearRecordCheckboxState(record.children, field, table, recordIndex);
|
|
60844
|
+
});
|
|
60845
|
+
}
|
|
60846
|
+
function updateVisibleCheckboxCellByRecordIndex(recordIndex, field, checked, table) {
|
|
60847
|
+
var _a, _b;
|
|
60848
|
+
const bodyRowIndex = null === (_b = (_a = table).getBodyRowIndexByRecordIndex) || void 0 === _b ? void 0 : _b.call(_a, recordIndex);
|
|
60849
|
+
if (!isNumber$3(bodyRowIndex) || bodyRowIndex < 0) return;
|
|
60850
|
+
const row = bodyRowIndex + table.columnHeaderLevelCount;
|
|
60851
|
+
getCheckboxColsByField(field, row, table).forEach(col => {
|
|
60852
|
+
setCellCheckboxStateByAttribute(col, row, checked, table);
|
|
60853
|
+
});
|
|
60854
|
+
}
|
|
60855
|
+
function updateVisibleCheckboxCellsByField(field, checked, table) {
|
|
60856
|
+
const cols = getCheckboxColsByField(field, table.columnHeaderLevelCount, table);
|
|
60857
|
+
for (let row = table.columnHeaderLevelCount; row < table.rowCount; row++) cols.forEach(col => {
|
|
60858
|
+
setCellCheckboxStateByAttribute(col, row, checked, table);
|
|
60859
|
+
});
|
|
60860
|
+
}
|
|
60861
|
+
function renderCheckboxStateUpdate(table) {
|
|
60862
|
+
const renderAsync = table.renderAsync;
|
|
60863
|
+
isFunction$3(renderAsync) ? renderAsync.call(table) : table.render();
|
|
60864
|
+
}
|
|
60865
|
+
function updateHeaderCheckboxStateByField(field, table) {
|
|
60866
|
+
const fieldKey = field;
|
|
60867
|
+
let hasChecked = !1,
|
|
60868
|
+
hasUnchecked = !1,
|
|
60869
|
+
hasRecord = !1;
|
|
60870
|
+
traverseRecords(table.records, (record, recordIndex) => {
|
|
60871
|
+
const state = getRecordCheckboxState(recordIndex, record, field, table);
|
|
60872
|
+
hasRecord = !0, !0 === state ? hasChecked = !0 : "indeterminate" === state ? (hasChecked = !0, hasUnchecked = !0) : hasUnchecked = !0;
|
|
60873
|
+
});
|
|
60874
|
+
const checked = !(!hasRecord || !hasChecked || hasUnchecked) || !!hasChecked && "indeterminate";
|
|
60875
|
+
table.stateManager.headerCheckedState[fieldKey] = checked, updateVisibleHeaderCheckboxCellByField(field, checked, table);
|
|
60876
|
+
}
|
|
60877
|
+
function updateVisibleHeaderCheckboxCellByField(field, checked, table) {
|
|
60878
|
+
for (let row = 0; row < table.columnHeaderLevelCount; row++) for (let col = 0; col < table.colCount; col++) table.getHeaderField(col, row) === field && "checkbox" === table.getCellType(col, row) && table.scenegraph.updateHeaderCheckboxCellState(col, row, checked);
|
|
60879
|
+
}
|
|
60880
|
+
function getCheckboxColsByField(field, row, table) {
|
|
60881
|
+
const cols = [];
|
|
60882
|
+
for (let col = 0; col < table.colCount; col++) {
|
|
60883
|
+
if (table.isHeader(col, row)) continue;
|
|
60884
|
+
const define = table.getBodyColumnDefine(col, row);
|
|
60885
|
+
(null == define ? void 0 : define.field) === field && "checkbox" === table.getCellType(col, row) && cols.push(col);
|
|
60886
|
+
}
|
|
60887
|
+
return cols;
|
|
60888
|
+
}
|
|
60889
|
+
function updateChildrenCheckboxStateByRecordIndex(recordIndex, field, checked, table) {
|
|
60890
|
+
var _a;
|
|
60891
|
+
const record = getRecordByRecordIndex(table.records, recordIndex);
|
|
60892
|
+
(null === (_a = null == record ? void 0 : record.children) || void 0 === _a ? void 0 : _a.length) && record.children.forEach((child, childIndex) => {
|
|
60893
|
+
const childRecordIndex = normalizeRecordIndexToArray(recordIndex).concat(childIndex);
|
|
60894
|
+
setRecordCheckboxState(childRecordIndex, field, checked, table.stateManager.checkedState), updateVisibleCheckboxCellByRecordIndex(childRecordIndex, field, checked, table), updateChildrenCheckboxStateByRecordIndex(childRecordIndex, field, checked, table);
|
|
60895
|
+
});
|
|
60896
|
+
}
|
|
60897
|
+
function updateParentCheckboxStateByRecordIndex(recordIndex, field, table) {
|
|
60898
|
+
var _a;
|
|
60899
|
+
const recordIndexPath = normalizeRecordIndexToArray(recordIndex);
|
|
60900
|
+
for (let level = recordIndexPath.length - 1; level > 0; level--) {
|
|
60901
|
+
const parentIndex = recordIndexPath.slice(0, level),
|
|
60902
|
+
parentRecord = getRecordByRecordIndex(table.records, parentIndex);
|
|
60903
|
+
if (!(null === (_a = null == parentRecord ? void 0 : parentRecord.children) || void 0 === _a ? void 0 : _a.length)) continue;
|
|
60904
|
+
const childStates = parentRecord.children.map((child, childIndex) => {
|
|
60905
|
+
const childRecordIndex = parentIndex.concat(childIndex),
|
|
60906
|
+
childState = getRecordCheckboxState(childRecordIndex, child, field, table);
|
|
60907
|
+
return setRecordCheckboxState(childRecordIndex, field, childState, table.stateManager.checkedState), childState;
|
|
60908
|
+
}),
|
|
60909
|
+
allChecked = childStates.every(state => !0 === state),
|
|
60910
|
+
allUnchecked = childStates.every(state => !0 !== state && "indeterminate" !== state),
|
|
60911
|
+
parentState = !!allChecked || !allUnchecked && "indeterminate";
|
|
60912
|
+
setRecordCheckboxState(parentIndex, field, parentState, table.stateManager.checkedState), updateVisibleCheckboxCellByRecordIndex(parentIndex, field, parentState, table);
|
|
60913
|
+
}
|
|
60914
|
+
}
|
|
60915
|
+
function getRecordCheckboxState(recordIndex, record, field, table) {
|
|
60916
|
+
var _a;
|
|
60917
|
+
const fieldKey = field,
|
|
60918
|
+
dataIndex = normalizeRecordIndex(recordIndex).toString(),
|
|
60919
|
+
cachedState = null === (_a = table.stateManager.checkedState.get(dataIndex)) || void 0 === _a ? void 0 : _a[fieldKey];
|
|
60920
|
+
if (isValid$1(cachedState)) return cachedState;
|
|
60921
|
+
const value = null == record ? void 0 : record[fieldKey];
|
|
60922
|
+
return isObject$7(value) && isValid$1(value.checked) ? value.checked : "boolean" == typeof value && value;
|
|
60923
|
+
}
|
|
60924
|
+
function getRecordByRecordIndex(records, recordIndex) {
|
|
60925
|
+
const recordIndexPath = normalizeRecordIndexToArray(recordIndex);
|
|
60926
|
+
let record,
|
|
60927
|
+
currentRecords = records;
|
|
60928
|
+
for (let i = 0; i < recordIndexPath.length; i++) record = null == currentRecords ? void 0 : currentRecords[recordIndexPath[i]], currentRecords = null == record ? void 0 : record.children;
|
|
60929
|
+
return record;
|
|
60930
|
+
}
|
|
60931
|
+
function normalizeRecordIndexToArray(recordIndex) {
|
|
60932
|
+
return isArray$5(recordIndex) ? recordIndex : [recordIndex];
|
|
60933
|
+
}
|
|
60934
|
+
function traverseRecords(records, handler, parentIndex = []) {
|
|
60935
|
+
isArray$5(records) && records.forEach((record, index) => {
|
|
60936
|
+
const recordIndex = parentIndex.length ? parentIndex.concat(index) : index;
|
|
60937
|
+
handler(record, recordIndex), isArray$5(null == record ? void 0 : record.children) && traverseRecords(record.children, handler, isArray$5(recordIndex) ? recordIndex : [recordIndex]);
|
|
60938
|
+
});
|
|
60939
|
+
}
|
|
60744
60940
|
function initRecordCheckState(records, state) {
|
|
60745
60941
|
const table = state.table,
|
|
60746
60942
|
start = table.isPivotTable() ? 0 : table.internalProps.transpose ? table.rowHeaderLevelCount : table.columnHeaderLevelCount,
|
|
@@ -64103,7 +64299,9 @@
|
|
|
64103
64299
|
|
|
64104
64300
|
class BodyHelper {
|
|
64105
64301
|
constructor(_table) {
|
|
64106
|
-
this._table = _table;
|
|
64302
|
+
this._table = _table, this.updateIcons();
|
|
64303
|
+
}
|
|
64304
|
+
updateIcons() {
|
|
64107
64305
|
const regedIcons = get$4();
|
|
64108
64306
|
this.expandIcon = regedIcons[InternalIconName.expandIconName], this.collapseIcon = regedIcons[InternalIconName.collapseIconName];
|
|
64109
64307
|
}
|
|
@@ -64866,7 +65064,9 @@
|
|
|
64866
65064
|
|
|
64867
65065
|
class HeaderHelper {
|
|
64868
65066
|
constructor(_table) {
|
|
64869
|
-
this._table = _table;
|
|
65067
|
+
this._table = _table, this.updateIcons();
|
|
65068
|
+
}
|
|
65069
|
+
updateIcons() {
|
|
64870
65070
|
const regedIcons = get$4();
|
|
64871
65071
|
this.freezeIcon = regedIcons[InternalIconName.freezeIconName], this.frozenIcon = regedIcons[InternalIconName.frozenIconName], this.frozenCurrentIcon = regedIcons[InternalIconName.frozenCurrentIconName], this.normalIcon = regedIcons[InternalIconName.normalIconName], this.upIcon = regedIcons[InternalIconName.upwardIconName], this.downIcon = regedIcons[InternalIconName.downwardIconName], this.dropDownAbsoluteIcon = regedIcons[InternalIconName.dropdownIconName], this.expandIcon = regedIcons[InternalIconName.expandIconName], this.collapseIcon = regedIcons[InternalIconName.collapseIconName];
|
|
64872
65072
|
}
|
|
@@ -65328,7 +65528,9 @@
|
|
|
65328
65528
|
|
|
65329
65529
|
class RowSeriesNumberHelper {
|
|
65330
65530
|
constructor(_table) {
|
|
65331
|
-
this._table = _table;
|
|
65531
|
+
this._table = _table, this.updateIcons();
|
|
65532
|
+
}
|
|
65533
|
+
updateIcons() {
|
|
65332
65534
|
const regedIcons = get$4();
|
|
65333
65535
|
this.dragReorderIconName = regedIcons[InternalIconName.dragReorderIconName];
|
|
65334
65536
|
}
|
|
@@ -66079,8 +66281,9 @@
|
|
|
66079
66281
|
class PluginManager {
|
|
66080
66282
|
constructor(table, options) {
|
|
66081
66283
|
var _a;
|
|
66082
|
-
this.plugins = new Map(), this.pluginEventMap = new Map(), this.table = table, null === (_a = options.plugins) || void 0 === _a || _a.
|
|
66083
|
-
|
|
66284
|
+
this.plugins = new Map(), this.pluginEventMap = new Map(), this.table = table, null === (_a = options.plugins) || void 0 === _a || _a.forEach(plugin => {
|
|
66285
|
+
var _a;
|
|
66286
|
+
this.register(plugin), null === (_a = plugin.init) || void 0 === _a || _a.call(plugin, this.table, options), this._bindTableEventForPlugin(plugin);
|
|
66084
66287
|
});
|
|
66085
66288
|
}
|
|
66086
66289
|
register(plugin) {
|
|
@@ -66105,16 +66308,17 @@
|
|
|
66105
66308
|
this.pluginEventMap.set(plugin.id, [...(this.pluginEventMap.get(plugin.id) || []), id]);
|
|
66106
66309
|
});
|
|
66107
66310
|
}
|
|
66108
|
-
removeOrAddPlugins(plugins) {
|
|
66311
|
+
removeOrAddPlugins(plugins, options = this.table.options) {
|
|
66109
66312
|
Array.from(this.plugins.values()).filter(plugin => !(null == plugins ? void 0 : plugins.some(p => p.id === plugin.id))).forEach(plugin => {
|
|
66110
|
-
var _a;
|
|
66313
|
+
var _a, _b;
|
|
66111
66314
|
null === (_a = this.pluginEventMap.get(plugin.id)) || void 0 === _a || _a.forEach(id => {
|
|
66112
66315
|
this.table.off(id);
|
|
66113
|
-
}), this.release(), this.plugins.delete(plugin.id);
|
|
66316
|
+
}), this.pluginEventMap.delete(plugin.id), null === (_b = plugin.release) || void 0 === _b || _b.call(plugin, this.table), this.plugins.delete(plugin.id);
|
|
66114
66317
|
});
|
|
66115
66318
|
const addedPlugins = null == plugins ? void 0 : plugins.filter(plugin => !this.plugins.has(plugin.id));
|
|
66116
66319
|
null == addedPlugins || addedPlugins.forEach(plugin => {
|
|
66117
|
-
|
|
66320
|
+
var _a;
|
|
66321
|
+
this.register(plugin), null === (_a = plugin.init) || void 0 === _a || _a.call(plugin, this.table, options), this._bindTableEventForPlugin(plugin);
|
|
66118
66322
|
});
|
|
66119
66323
|
}
|
|
66120
66324
|
updatePlugins(plugins) {
|
|
@@ -66137,6 +66341,9 @@
|
|
|
66137
66341
|
isTouchEvent: isTouchEvent
|
|
66138
66342
|
} = event,
|
|
66139
66343
|
rangeReg = /^\$(\d+)\$(\d+)$/;
|
|
66344
|
+
function normalizeCellType(cellType) {
|
|
66345
|
+
return isValid$1(cellType) ? cellType : "text";
|
|
66346
|
+
}
|
|
66140
66347
|
importStyle$2();
|
|
66141
66348
|
class BaseTable extends EventTarget$1 {
|
|
66142
66349
|
static get EVENT_TYPE() {
|
|
@@ -66144,7 +66351,7 @@
|
|
|
66144
66351
|
}
|
|
66145
66352
|
constructor(container, options = {}) {
|
|
66146
66353
|
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;
|
|
66147
|
-
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.26.
|
|
66354
|
+
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.26.6", this.id = `VTable${Date.now()}`, this.isReleased = !1, this._chartEventMap = {}, this.throttleInvalidate = throttle2(this.render.bind(this), 200), "undefined" != typeof window) {
|
|
66148
66355
|
const g = window;
|
|
66149
66356
|
g[this.id] = this;
|
|
66150
66357
|
const registry = g.__vtable__ || (g.__vtable__ = {
|
|
@@ -66239,7 +66446,7 @@
|
|
|
66239
66446
|
var _a, _b;
|
|
66240
66447
|
return "node" === Env.mode ? that.canvasWidth / (null != pixelRatio ? pixelRatio : 1) : this._.canvas.width / (null !== (_b = null !== (_a = this._.context.pixelRatio) && void 0 !== _a ? _a : that.internalProps.pixelRatio) && void 0 !== _b ? _b : window.devicePixelRatio);
|
|
66241
66448
|
}
|
|
66242
|
-
}, internalProps.cellTextOverflows = {}, internalProps.focusedTable = !1, internalProps.theme = themes.of(null !== (_r = options.theme) && void 0 !== _r ? _r : themes.DEFAULT), internalProps.theme.isPivot = this.isPivotTable(),
|
|
66449
|
+
}, internalProps.cellTextOverflows = {}, internalProps.focusedTable = !1, internalProps.theme = themes.of(null !== (_r = options.theme) && void 0 !== _r ? _r : themes.DEFAULT), internalProps.theme.isPivot = this.isPivotTable(), this._updateFunctionalIcons(), 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) {
|
|
66243
66450
|
internalProps.legends = [];
|
|
66244
66451
|
const createLegend = Factory.getFunction("createLegend");
|
|
66245
66452
|
if (Array.isArray(options.legends)) {
|
|
@@ -67203,7 +67410,7 @@
|
|
|
67203
67410
|
height: !1
|
|
67204
67411
|
}), this.customRender = customRender, this.contentOffsetX = null != translateX ? translateX : 0, this.contentOffsetY = null != translateY ? translateY : 0, this.canvasWidth = isNumber$3(canvasWidth) ? canvasWidth : void 0, this.canvasHeight = isNumber$3(canvasHeight) ? canvasHeight : void 0;
|
|
67205
67412
|
const internalProps = this.internalProps;
|
|
67206
|
-
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.canResizeColumn = null == resize ? void 0 : resize.canResizeColumn, 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, (null == updateConfig ? void 0 : updateConfig.clearColWidthCache) && (internalProps._widthResizedColMap.clear(), this.colWidthsMap = new NumberMap(), this.colContentWidthsMap = new NumberMap(), this.colWidthsLimit = {}), (null == updateConfig ? void 0 : updateConfig.clearRowHeightCache) && (internalProps._heightResizedRowMap.clear(), internalProps._rowHeightsMap = new NumberRangeMap(this), internalProps._rowRangeHeightsMap = new Map(), internalProps._colRangeWidthsMap = new Map()), internalProps.stick.changedCells.clear(), internalProps.theme = themes.of(null !== (_p = options.theme) && void 0 !== _p ? _p : themes.DEFAULT), internalProps.theme.isPivot = this.isPivotTable(),
|
|
67413
|
+
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.canResizeColumn = null == resize ? void 0 : resize.canResizeColumn, 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, (null == updateConfig ? void 0 : updateConfig.clearColWidthCache) && (internalProps._widthResizedColMap.clear(), this.colWidthsMap = new NumberMap(), this.colContentWidthsMap = new NumberMap(), this.colWidthsLimit = {}), (null == updateConfig ? void 0 : updateConfig.clearRowHeightCache) && (internalProps._heightResizedRowMap.clear(), internalProps._rowHeightsMap = new NumberRangeMap(this), internalProps._rowRangeHeightsMap = new Map(), internalProps._colRangeWidthsMap = new Map()), internalProps.stick.changedCells.clear(), internalProps.theme = themes.of(null !== (_p = options.theme) && void 0 !== _p ? _p : themes.DEFAULT), internalProps.theme.isPivot = this.isPivotTable(), this._updateFunctionalIcons(), 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 => {
|
|
67207
67414
|
null == legend || legend.release();
|
|
67208
67415
|
}), 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) {
|
|
67209
67416
|
internalProps.legends = [];
|
|
@@ -67518,18 +67725,22 @@
|
|
|
67518
67725
|
updateAutoWrapText(autoWrapText) {
|
|
67519
67726
|
this.internalProps.autoWrapText !== autoWrapText && (this.internalProps.autoWrapText = autoWrapText, this.options.autoWrapText = autoWrapText, this.scenegraph.clearCells(), this.clearCellStyleCache(), this.scenegraph.createSceneGraph(), this.render());
|
|
67520
67727
|
}
|
|
67728
|
+
_updateFunctionalIcons() {
|
|
67729
|
+
var _a, _b, _c;
|
|
67730
|
+
setIconColor(this.internalProps.theme.functionalIconsStyle), null === (_a = this.internalProps.headerHelper) || void 0 === _a || _a.updateIcons(), null === (_b = this.internalProps.bodyHelper) || void 0 === _b || _b.updateIcons(), null === (_c = this.internalProps.rowSeriesNumberHelper) || void 0 === _c || _c.updateIcons();
|
|
67731
|
+
}
|
|
67521
67732
|
get theme() {
|
|
67522
67733
|
return this.internalProps.theme;
|
|
67523
67734
|
}
|
|
67524
67735
|
set theme(theme) {
|
|
67525
|
-
this.internalProps.theme = themes.of(null != theme ? theme : themes.DEFAULT), this.internalProps.theme.isPivot = this.isPivotTable(), this.options.theme = theme,
|
|
67736
|
+
this.internalProps.theme = themes.of(null != theme ? theme : themes.DEFAULT), this.internalProps.theme.isPivot = this.isPivotTable(), this.options.theme = theme, this._updateFunctionalIcons();
|
|
67526
67737
|
}
|
|
67527
67738
|
updateTheme(theme) {
|
|
67528
67739
|
const oldHoverState = {
|
|
67529
67740
|
col: this.stateManager.hover.cellPos.col,
|
|
67530
67741
|
row: this.stateManager.hover.cellPos.row
|
|
67531
67742
|
};
|
|
67532
|
-
this.internalProps.theme = themes.of(null != theme ? theme : themes.DEFAULT), this.internalProps.theme.isPivot = this.isPivotTable(),
|
|
67743
|
+
this.internalProps.theme = themes.of(null != theme ? theme : themes.DEFAULT), this.internalProps.theme.isPivot = this.isPivotTable(), this._updateFunctionalIcons(), this.options.theme = theme, this.scenegraph.updateComponent(), this.scenegraph.updateStageBackground(), this.scenegraph.clearCells(), this.clearCellStyleCache(), this.scenegraph.createSceneGraph(), this.stateManager.updateHoverPos(oldHoverState.col, oldHoverState.row), this.render();
|
|
67533
67744
|
}
|
|
67534
67745
|
getBodyField(col, row) {
|
|
67535
67746
|
return this.internalProps.layoutMap.getBody(col, row).field;
|
|
@@ -67541,19 +67752,19 @@
|
|
|
67541
67752
|
getBodyColumnType(col, row) {
|
|
67542
67753
|
var _a, _b;
|
|
67543
67754
|
const cellType = null !== (_b = null === (_a = this.internalProps.layoutMap.getBody(col, row)) || void 0 === _a ? void 0 : _a.cellType) && void 0 !== _b ? _b : "text";
|
|
67544
|
-
return getProp("cellType", {
|
|
67755
|
+
return normalizeCellType(getProp("cellType", {
|
|
67545
67756
|
cellType: cellType
|
|
67546
|
-
}, col, row, this);
|
|
67757
|
+
}, col, row, this));
|
|
67547
67758
|
}
|
|
67548
67759
|
getCellType(col, row) {
|
|
67549
67760
|
let cellType;
|
|
67550
67761
|
if (this.isSeriesNumberInHeader(col, row)) {
|
|
67551
67762
|
const seriesHeaderCellType = this.internalProps.layoutMap.getSeriesNumberHeader(col, row).cellType;
|
|
67552
|
-
return "radio" === seriesHeaderCellType ? "text" : seriesHeaderCellType;
|
|
67763
|
+
return normalizeCellType("radio" === seriesHeaderCellType ? "text" : seriesHeaderCellType);
|
|
67553
67764
|
}
|
|
67554
|
-
return cellType = this.isHeader(col, row) ? this.internalProps.layoutMap.getHeader(col, row).headerType : this.internalProps.layoutMap.getBody(col, row).cellType, getProp("cellType", {
|
|
67765
|
+
return cellType = this.isHeader(col, row) ? this.internalProps.layoutMap.getHeader(col, row).headerType : this.internalProps.layoutMap.getBody(col, row).cellType, normalizeCellType(getProp("cellType", {
|
|
67555
67766
|
cellType: cellType
|
|
67556
|
-
}, col, row, this);
|
|
67767
|
+
}, col, row, this));
|
|
67557
67768
|
}
|
|
67558
67769
|
getHeaderField(col, row) {
|
|
67559
67770
|
return this.internalProps.layoutMap.getHeaderField(col, row);
|
|
@@ -71097,6 +71308,7 @@
|
|
|
71097
71308
|
} = table.internalProps.layoutMap.getSeriesNumberHeader(col, row);
|
|
71098
71309
|
return title;
|
|
71099
71310
|
}
|
|
71311
|
+
if (table.internalProps.layoutMap.isAggregation(col, row)) return "";
|
|
71100
71312
|
let value;
|
|
71101
71313
|
if (this.internalProps.groupBy) {
|
|
71102
71314
|
const record = table.getCellRawRecord(col, row);
|
|
@@ -71144,6 +71356,7 @@
|
|
|
71144
71356
|
} = table.internalProps.layoutMap.getSeriesNumberHeader(col, row);
|
|
71145
71357
|
return title;
|
|
71146
71358
|
}
|
|
71359
|
+
if (table.internalProps.layoutMap.isAggregation(col, row)) return "";
|
|
71147
71360
|
const {
|
|
71148
71361
|
format: format
|
|
71149
71362
|
} = table.internalProps.layoutMap.getSeriesNumberBody(col, row);
|
|
@@ -71241,7 +71454,7 @@
|
|
|
71241
71454
|
}) {
|
|
71242
71455
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
71243
71456
|
const internalProps = this.internalProps;
|
|
71244
|
-
if (this.pluginManager.removeOrAddPlugins(options.plugins), super.updateOption(options, updateConfig), internalProps.frozenColDragHeaderMode = null !== (_b = null === (_a = options.dragOrder) || void 0 === _a ? void 0 : _a.frozenColDragHeaderMode) && void 0 !== _b ? _b : options.frozenColDragHeaderMode, this.pagination = options.pagination, internalProps.sortState = options.sortState, internalProps.dataConfig = this.internalProps.groupBy ? getGroupByDataConfig(this.internalProps.groupBy, options.addRecordRule) : {
|
|
71457
|
+
if (this.pluginManager.removeOrAddPlugins(options.plugins, options), super.updateOption(options, updateConfig), internalProps.frozenColDragHeaderMode = null !== (_b = null === (_a = options.dragOrder) || void 0 === _a ? void 0 : _a.frozenColDragHeaderMode) && void 0 !== _b ? _b : options.frozenColDragHeaderMode, this.pagination = options.pagination, internalProps.sortState = options.sortState, internalProps.dataConfig = this.internalProps.groupBy ? getGroupByDataConfig(this.internalProps.groupBy, options.addRecordRule) : {
|
|
71245
71458
|
addRecordRule: options.addRecordRule
|
|
71246
71459
|
}, this.showHeader = null === (_c = options.showHeader) || void 0 === _c || _c, internalProps.columns = options.columns ? cloneDeepSpec(options.columns, ["children"]) : options.header ? cloneDeepSpec(options.header, ["children"]) : [], generateAggregationForColumn(this), internalProps.enableTreeNodeMerge = null !== (_e = null !== (_d = options.enableTreeNodeMerge) && void 0 !== _d ? _d : isValid$1(this.internalProps.groupBy)) && void 0 !== _e && _e, this.internalProps.headerHelper.setTableColumnsEditor(), this.transpose = null !== (_f = options.transpose) && void 0 !== _f && _f, this.refreshHeader(), this.internalProps.useOneRowHeightFillAll = !1, this.internalProps.columnWidthConfig = options.columnWidthConfig, this.internalProps.rowHeightConfig = options.rowHeightConfig, internalProps.releaseList) for (let i = internalProps.releaseList.length - 1; i >= 0; i--) {
|
|
71247
71460
|
const releaseObj = internalProps.releaseList[i];
|
|
@@ -71532,6 +71745,15 @@
|
|
|
71532
71745
|
setCellCheckboxState(col, row, checked) {
|
|
71533
71746
|
setCellCheckboxState(col, row, checked, this);
|
|
71534
71747
|
}
|
|
71748
|
+
setCellCheckboxStateByRecordIndex(recordIndex, field, checked) {
|
|
71749
|
+
setCheckboxStateByRecordIndex(recordIndex, field, checked, this);
|
|
71750
|
+
}
|
|
71751
|
+
clearCheckboxState(field) {
|
|
71752
|
+
clearCheckboxState(field, this);
|
|
71753
|
+
}
|
|
71754
|
+
clearAllCheckboxState(field) {
|
|
71755
|
+
this.clearCheckboxState(field);
|
|
71756
|
+
}
|
|
71535
71757
|
setCellRadioState(col, row, index) {
|
|
71536
71758
|
setCellRadioState(col, row, index, this);
|
|
71537
71759
|
}
|
|
@@ -71890,9 +72112,11 @@
|
|
|
71890
72112
|
}, 0));
|
|
71891
72113
|
}
|
|
71892
72114
|
updateRecords(records, recordIndexs, triggerEvent = !0) {
|
|
71893
|
-
|
|
72115
|
+
var _a;
|
|
72116
|
+
const updateRecordIndexs = null !== (_a = null != recordIndexs ? recordIndexs : null == records ? void 0 : records.map((_, index) => index)) && void 0 !== _a ? _a : [];
|
|
72117
|
+
listTableUpdateRecords(records, updateRecordIndexs, this), triggerEvent && this.fireListeners(TABLE_EVENT_TYPE.UPDATE_RECORD, {
|
|
71894
72118
|
records: records,
|
|
71895
|
-
recordIndexs:
|
|
72119
|
+
recordIndexs: updateRecordIndexs,
|
|
71896
72120
|
updateCount: records.length
|
|
71897
72121
|
});
|
|
71898
72122
|
}
|