@visactor/vtable-gantt 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/cjs/Gantt.d.ts +6 -6
- package/cjs/Gantt.js +14 -8
- package/cjs/Gantt.js.map +1 -1
- package/cjs/index.d.ts +1 -1
- package/cjs/index.js +1 -1
- package/cjs/index.js.map +1 -1
- package/cjs/scenegraph/gantt-node.d.ts +1 -1
- package/cjs/scenegraph/gantt-node.js.map +1 -1
- package/cjs/scenegraph/scenegraph.d.ts +1 -1
- package/cjs/scenegraph/scenegraph.js.map +1 -1
- package/cjs/scenegraph/task-bar.d.ts +2 -2
- package/cjs/scenegraph/task-bar.js +3 -2
- package/cjs/scenegraph/task-bar.js.map +1 -1
- package/cjs/scenegraph/timeline-header.js +2 -1
- package/cjs/state/gantt-table-sync.js +0 -1
- package/cjs/state/state-manager.js +4 -2
- package/cjs/state/state-manager.js.map +1 -1
- package/cjs/ts-types/events.d.ts +11 -9
- package/cjs/ts-types/events.js.map +1 -1
- package/dist/vtable-gantt.js +318 -68
- package/dist/vtable-gantt.min.js +1 -1
- package/es/Gantt.d.ts +6 -6
- package/es/Gantt.js +14 -8
- package/es/Gantt.js.map +1 -1
- package/es/index.d.ts +1 -1
- package/es/index.js +1 -1
- package/es/index.js.map +1 -1
- package/es/scenegraph/gantt-node.d.ts +1 -1
- package/es/scenegraph/gantt-node.js.map +1 -1
- package/es/scenegraph/scenegraph.d.ts +1 -1
- package/es/scenegraph/scenegraph.js.map +1 -1
- package/es/scenegraph/task-bar.d.ts +2 -2
- package/es/scenegraph/task-bar.js +2 -2
- package/es/scenegraph/task-bar.js.map +1 -1
- package/es/scenegraph/timeline-header.js +2 -1
- package/es/state/gantt-table-sync.js +1 -2
- package/es/state/state-manager.js +4 -2
- package/es/state/state-manager.js.map +1 -1
- package/es/ts-types/events.d.ts +11 -9
- package/es/ts-types/events.js.map +1 -1
- package/package.json +3 -3
package/dist/vtable-gantt.js
CHANGED
|
@@ -52000,7 +52000,7 @@
|
|
|
52000
52000
|
const recordIndex = recordIndexsMaxToMin[index];
|
|
52001
52001
|
if (isNumber$3(recordIndex) && (recordIndex >= this.sourceLength || recordIndex < 0)) continue;
|
|
52002
52002
|
const originRecordIndex = this.getOriginRecordIndexForGroup(recordIndex);
|
|
52003
|
-
this.beforeChangedRecordsMap.delete(originRecordIndex.toString()), this.dataSourceObj.records.splice(originRecordIndex, 1), this.sourceLength -= 1, this.adjustBeforeChangedRecordsMap(originRecordIndex, 1, "delete");
|
|
52003
|
+
isValid$1(originRecordIndex) && (this.beforeChangedRecordsMap.delete(originRecordIndex.toString()), this.dataSourceObj.records.splice(originRecordIndex, 1), this.sourceLength -= 1, this.adjustBeforeChangedRecordsMap(originRecordIndex, 1, "delete"));
|
|
52004
52004
|
}
|
|
52005
52005
|
this.updateGroup();
|
|
52006
52006
|
}
|
|
@@ -52009,7 +52009,7 @@
|
|
|
52009
52009
|
const recordIndex = recordIndexs[index];
|
|
52010
52010
|
if (isNumber$3(recordIndex) && (recordIndex >= this.sourceLength || recordIndex < 0)) continue;
|
|
52011
52011
|
const originRecordIndex = this.getOriginRecordIndexForGroup(recordIndex);
|
|
52012
|
-
this.beforeChangedRecordsMap.delete(originRecordIndex.toString()), this.dataSourceObj.records[originRecordIndex] = records[index];
|
|
52012
|
+
isValid$1(originRecordIndex) && (this.beforeChangedRecordsMap.delete(originRecordIndex.toString()), this.dataSourceObj.records[originRecordIndex] = records[index]);
|
|
52013
52013
|
}
|
|
52014
52014
|
this.updateGroup();
|
|
52015
52015
|
}
|
|
@@ -53749,7 +53749,7 @@
|
|
|
53749
53749
|
"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;
|
|
53750
53750
|
let iconMark,
|
|
53751
53751
|
hierarchyOffset = 0;
|
|
53752
|
-
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 ? (
|
|
53752
|
+
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$1(iconAttribute), iconMark.tooltip = icon.tooltip, iconMark.name = icon.name), iconMark);
|
|
53753
53753
|
}
|
|
53754
53754
|
function dealWithRichTextIcon(icon) {
|
|
53755
53755
|
var _a, _b, _c, _d, _e, _f;
|
|
@@ -54784,15 +54784,26 @@
|
|
|
54784
54784
|
table.isPivotTable() && (layoutMap.disableUseGetBodyCache(), layoutMap.disableUseHeaderPathCache());
|
|
54785
54785
|
}
|
|
54786
54786
|
function computeRowHeight(row, startCol, endCol, table) {
|
|
54787
|
+
return computeRowHeightInternal(row, startCol, endCol, table, !0);
|
|
54788
|
+
}
|
|
54789
|
+
function computeRowHeightInternal(row, startCol, endCol, table, enableCustomCompute) {
|
|
54787
54790
|
if (!(table.isAutoRowHeight(row) || "adaptive" === table.heightMode && !1 !== table.options.autoHeightInAdaptiveMode) && "auto" !== table.getDefaultRowHeight(row)) return table.getDefaultRowHeight(row);
|
|
54788
54791
|
let maxHeight;
|
|
54789
|
-
if (table.options.customComputeRowHeight) {
|
|
54790
|
-
|
|
54791
|
-
|
|
54792
|
-
|
|
54792
|
+
if (enableCustomCompute && table.options.customComputeRowHeight) {
|
|
54793
|
+
let realHeight,
|
|
54794
|
+
hasRealHeight = !1;
|
|
54795
|
+
const getRealHeight = () => (hasRealHeight || (realHeight = computeRowHeightInternal(row, startCol, endCol, table, !1), hasRealHeight = !0), realHeight),
|
|
54796
|
+
computeArgs = {
|
|
54797
|
+
row: row,
|
|
54798
|
+
table: table
|
|
54799
|
+
};
|
|
54800
|
+
Object.defineProperty(computeArgs, "realHeight", {
|
|
54801
|
+
get: getRealHeight,
|
|
54802
|
+
enumerable: !1,
|
|
54803
|
+
configurable: !0
|
|
54793
54804
|
});
|
|
54794
|
-
|
|
54795
|
-
|
|
54805
|
+
const customRowHeight = table.options.customComputeRowHeight(computeArgs);
|
|
54806
|
+
return "number" == typeof customRowHeight ? customRowHeight : "auto" === customRowHeight ? getRealHeight() : table.getDefaultRowHeight(row);
|
|
54796
54807
|
}
|
|
54797
54808
|
if (table.internalProps.rowHeightConfig) {
|
|
54798
54809
|
const rowHeightConfig = table.internalProps.rowHeightConfig.find(item => item.key === row);
|
|
@@ -57198,6 +57209,22 @@
|
|
|
57198
57209
|
containerGroup.setAttribute("width", x), containerGroup.setAttribute("height", heightMax);
|
|
57199
57210
|
}
|
|
57200
57211
|
|
|
57212
|
+
function fillVisibleBodyRows$1(proxy, distRow) {
|
|
57213
|
+
const {
|
|
57214
|
+
table: table
|
|
57215
|
+
} = proxy,
|
|
57216
|
+
bodyBottomRow = table.rowCount - 1 - table.bottomFrozenRowCount,
|
|
57217
|
+
visibleBodyHeight = table.tableNoFrameHeight - table.getFrozenRowsHeight() - table.getBottomFrozenRowsHeight();
|
|
57218
|
+
let targetRow = distRow;
|
|
57219
|
+
for (; targetRow < bodyBottomRow && table.getRowsHeight(table.frozenRowCount, targetRow) < visibleBodyHeight;) {
|
|
57220
|
+
const nextRow = targetRow + 1;
|
|
57221
|
+
computeRowsHeight(table, nextRow, nextRow, !1), targetRow = nextRow;
|
|
57222
|
+
}
|
|
57223
|
+
return targetRow;
|
|
57224
|
+
}
|
|
57225
|
+
function syncVisibleBodyRows(proxy, targetRow) {
|
|
57226
|
+
targetRow <= proxy.totalRow || (proxy.totalRow = targetRow, proxy.totalActualBodyRowCount = Math.max(proxy.totalActualBodyRowCount, targetRow - proxy.bodyTopRow + 1));
|
|
57227
|
+
}
|
|
57201
57228
|
function createGroupForFirstScreen(cornerHeaderGroup, colHeaderGroup, rowHeaderGroup, rightFrozenGroup, bottomFrozenGroup, bodyGroup, xOrigin, yOrigin, proxy) {
|
|
57202
57229
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
|
57203
57230
|
const {
|
|
@@ -57209,10 +57236,12 @@
|
|
|
57209
57236
|
rightBottomCornerGroup: rightBottomCornerGroup
|
|
57210
57237
|
} = table.scenegraph;
|
|
57211
57238
|
let distCol, distRow, distColForCompute, distRowForCompute;
|
|
57212
|
-
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)
|
|
57239
|
+
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);
|
|
57240
|
+
let bodyDistRow = Math.min(proxy.bodyBottomRow, distRow - table.bottomFrozenRowCount);
|
|
57241
|
+
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({
|
|
57213
57242
|
x: table.getFrozenColsWidth(),
|
|
57214
57243
|
y: table.getFrozenRowsHeight()
|
|
57215
|
-
}), 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,
|
|
57244
|
+
}), 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));
|
|
57216
57245
|
}
|
|
57217
57246
|
|
|
57218
57247
|
function getFirstChild(containerGroup) {
|
|
@@ -58631,10 +58660,12 @@
|
|
|
58631
58660
|
rowUpdatePos = isValid$1(rowUpdatePos) ? isValid$1(pos) ? Math.min(rowUpdatePos, pos) : rowUpdatePos : pos;
|
|
58632
58661
|
}
|
|
58633
58662
|
let updateAfter;
|
|
58634
|
-
|
|
58663
|
+
scene.table._clearRowRangeHeightsMap(), verifyProxyRowStatus(scene), addRows.forEach(row => {
|
|
58635
58664
|
const needUpdateAfter = addRow(row, scene, skipUpdateProxy);
|
|
58636
58665
|
updateAfter = null != updateAfter ? updateAfter : needUpdateAfter, rowHeightsMap.insert(row);
|
|
58637
|
-
})
|
|
58666
|
+
});
|
|
58667
|
+
const filledVisibleRowStart = fillVisibleBodyRows(scene);
|
|
58668
|
+
if (isNumber$3(filledVisibleRowStart) && (updateAfter = null != updateAfter ? updateAfter : filledVisibleRowStart, rowUpdatePos = isValid$1(rowUpdatePos) ? Math.min(rowUpdatePos, filledVisibleRowStart) : filledVisibleRowStart), resetRowNumberAndY(scene), addRows.length) {
|
|
58638
58669
|
const pos = _getUpdateRowIndex(addRows[0] - 1, addRows[addRows.length - 1] + 1, scene);
|
|
58639
58670
|
rowUpdatePos = isValid$1(rowUpdatePos) ? isValid$1(pos) ? Math.min(rowUpdatePos, pos) : rowUpdatePos : pos;
|
|
58640
58671
|
}
|
|
@@ -58702,6 +58733,24 @@
|
|
|
58702
58733
|
}
|
|
58703
58734
|
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;
|
|
58704
58735
|
}
|
|
58736
|
+
function fillVisibleBodyRows(scene) {
|
|
58737
|
+
const {
|
|
58738
|
+
table: table,
|
|
58739
|
+
proxy: proxy
|
|
58740
|
+
} = scene;
|
|
58741
|
+
if ("autoHeight" !== table.heightMode) return;
|
|
58742
|
+
const bodyBottomRow = table.rowCount - 1 - table.bottomFrozenRowCount,
|
|
58743
|
+
visibleBodyHeight = table.tableNoFrameHeight - table.getFrozenRowsHeight() - table.getBottomFrozenRowsHeight();
|
|
58744
|
+
let targetRow = Math.min(proxy.rowEnd, bodyBottomRow);
|
|
58745
|
+
for (computeRowsHeight(table, proxy.rowStart, targetRow, !1); targetRow < bodyBottomRow && table.getRowsHeight(table.frozenRowCount, targetRow) < visibleBodyHeight;) {
|
|
58746
|
+
const nextRow = targetRow + 1;
|
|
58747
|
+
computeRowsHeight(table, nextRow, nextRow, !1), targetRow = nextRow;
|
|
58748
|
+
}
|
|
58749
|
+
if (targetRow <= proxy.rowEnd) return;
|
|
58750
|
+
const startRow = proxy.rowEnd + 1;
|
|
58751
|
+
for (let row = startRow; row <= targetRow; row++) addRowCellGroup(row, scene);
|
|
58752
|
+
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;
|
|
58753
|
+
}
|
|
58705
58754
|
function resetRowNumber(scene) {
|
|
58706
58755
|
function processCell(cellGroup, rowIndex) {
|
|
58707
58756
|
cellGroup.row = rowIndex;
|
|
@@ -60418,25 +60467,57 @@
|
|
|
60418
60467
|
height: this.tableGroup.attribute.height
|
|
60419
60468
|
})));
|
|
60420
60469
|
}
|
|
60421
|
-
this.table.
|
|
60422
|
-
|
|
60423
|
-
|
|
60424
|
-
|
|
60425
|
-
|
|
60426
|
-
|
|
60427
|
-
|
|
60428
|
-
|
|
60429
|
-
|
|
60430
|
-
|
|
60431
|
-
|
|
60432
|
-
|
|
60433
|
-
|
|
60434
|
-
|
|
60470
|
+
const hasFrozenCols = this.table.frozenColCount > 0,
|
|
60471
|
+
hasRightFrozenCols = this.table.rightFrozenColCount > 0,
|
|
60472
|
+
hasFrozenRows = this.table.frozenRowCount > 0,
|
|
60473
|
+
hasBottomFrozenRows = this.table.bottomFrozenRowCount > 0;
|
|
60474
|
+
if (hasBottomFrozenRows) {
|
|
60475
|
+
const bottomFrozenRowsHeight = this.table.getBottomFrozenRowsHeight(),
|
|
60476
|
+
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),
|
|
60477
|
+
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),
|
|
60478
|
+
bottomFrozenY = Math.min(this.tableGroup.attribute.height - bottomFrozenRowsHeight, middleContentBottom);
|
|
60479
|
+
this.bottomFrozenGroup.setAttribute("y", bottomFrozenY), this.leftBottomCornerGroup.setAttributes({
|
|
60480
|
+
visible: hasFrozenCols,
|
|
60481
|
+
y: bottomFrozenY,
|
|
60482
|
+
height: bottomFrozenRowsHeight,
|
|
60483
|
+
width: hasFrozenCols ? this.table.getFrozenColsWidth() : 0
|
|
60484
|
+
}), this.rightBottomCornerGroup.setAttributes({
|
|
60485
|
+
visible: hasRightFrozenCols,
|
|
60486
|
+
x: 0,
|
|
60487
|
+
y: bottomFrozenY,
|
|
60488
|
+
width: 0,
|
|
60489
|
+
height: bottomFrozenRowsHeight
|
|
60490
|
+
});
|
|
60491
|
+
} else this.leftBottomCornerGroup.setAttributes({
|
|
60492
|
+
visible: !1,
|
|
60493
|
+
width: 0,
|
|
60494
|
+
height: 0
|
|
60435
60495
|
}), this.rightBottomCornerGroup.setAttributes({
|
|
60436
|
-
visible: !
|
|
60437
|
-
|
|
60438
|
-
|
|
60439
|
-
})
|
|
60496
|
+
visible: !1,
|
|
60497
|
+
width: 0,
|
|
60498
|
+
height: 0
|
|
60499
|
+
});
|
|
60500
|
+
if (hasRightFrozenCols) {
|
|
60501
|
+
const rightFrozenColsWidth = this.table.getRightFrozenColsWidth(),
|
|
60502
|
+
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),
|
|
60503
|
+
rightFrozenX = Math.min(this.tableGroup.attribute.width - rightFrozenColsWidth, middleContentRight);
|
|
60504
|
+
this.rightFrozenGroup.setAttribute("x", rightFrozenX), this.rightTopCornerGroup.setAttributes({
|
|
60505
|
+
visible: hasFrozenRows,
|
|
60506
|
+
x: rightFrozenX,
|
|
60507
|
+
width: hasFrozenRows ? rightFrozenColsWidth : 0,
|
|
60508
|
+
height: hasFrozenRows ? this.table.getFrozenRowsHeight() : 0
|
|
60509
|
+
}), this.rightBottomCornerGroup.setAttributes({
|
|
60510
|
+
visible: hasBottomFrozenRows,
|
|
60511
|
+
x: rightFrozenX,
|
|
60512
|
+
width: hasBottomFrozenRows ? rightFrozenColsWidth : 0,
|
|
60513
|
+
height: hasBottomFrozenRows ? this.table.getBottomFrozenRowsHeight() : 0
|
|
60514
|
+
});
|
|
60515
|
+
} else this.rightTopCornerGroup.setAttributes({
|
|
60516
|
+
visible: !1,
|
|
60517
|
+
width: 0,
|
|
60518
|
+
height: 0
|
|
60519
|
+
});
|
|
60520
|
+
this.updateDomContainer();
|
|
60440
60521
|
}
|
|
60441
60522
|
updateRowHeight(row, detaY, skipTableHeightMap) {
|
|
60442
60523
|
detaY = Math.round(detaY), updateRowHeight(this, row, detaY, skipTableHeightMap), this.updateContainerHeight(row, detaY);
|
|
@@ -62014,6 +62095,12 @@
|
|
|
62014
62095
|
} = checkbox.attribute;
|
|
62015
62096
|
indeterminate ? (checked || checkbox._handlePointerUp(), checkbox._handlePointerUp()) : oldChecked ? checked || checkbox._handlePointerUp() : checked && checkbox._handlePointerUp();
|
|
62016
62097
|
}
|
|
62098
|
+
function setCheckboxStateByRecordIndex(recordIndex, field, checked, table) {
|
|
62099
|
+
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);
|
|
62100
|
+
}
|
|
62101
|
+
function clearCheckboxState(field, table) {
|
|
62102
|
+
isValid$1(field) && (clearRecordCheckboxState(table.records, field, table), updateVisibleCheckboxCellsByField(field, !1, table), updateHeaderCheckboxStateByField(field, table), renderCheckboxStateUpdate(table));
|
|
62103
|
+
}
|
|
62017
62104
|
function setCellCheckboxStateByAttribute(col, row, checked, table) {
|
|
62018
62105
|
var _a, _b;
|
|
62019
62106
|
const cellGroup = table.scenegraph.getCell(col, row),
|
|
@@ -62067,6 +62154,115 @@
|
|
|
62067
62154
|
}
|
|
62068
62155
|
}), result;
|
|
62069
62156
|
}
|
|
62157
|
+
function normalizeRecordIndex(recordIndex) {
|
|
62158
|
+
return isArray$5(recordIndex) && 1 === recordIndex.length ? recordIndex[0] : recordIndex;
|
|
62159
|
+
}
|
|
62160
|
+
function setRecordCheckboxState(recordIndex, field, checked, checkedState) {
|
|
62161
|
+
const dataIndex = normalizeRecordIndex(recordIndex).toString();
|
|
62162
|
+
checkedState.get(dataIndex) ? checkedState.get(dataIndex)[field] = checked : checkedState.set(dataIndex, {
|
|
62163
|
+
[field]: checked
|
|
62164
|
+
});
|
|
62165
|
+
}
|
|
62166
|
+
function clearRecordCheckboxState(records, field, table, parentIndex = []) {
|
|
62167
|
+
isArray$5(records) && records.forEach((record, index) => {
|
|
62168
|
+
const recordIndex = parentIndex.length ? parentIndex.concat(index) : [index];
|
|
62169
|
+
!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);
|
|
62170
|
+
});
|
|
62171
|
+
}
|
|
62172
|
+
function updateVisibleCheckboxCellByRecordIndex(recordIndex, field, checked, table) {
|
|
62173
|
+
var _a, _b;
|
|
62174
|
+
const bodyRowIndex = null === (_b = (_a = table).getBodyRowIndexByRecordIndex) || void 0 === _b ? void 0 : _b.call(_a, recordIndex);
|
|
62175
|
+
if (!isNumber$3(bodyRowIndex) || bodyRowIndex < 0) return;
|
|
62176
|
+
const row = bodyRowIndex + table.columnHeaderLevelCount;
|
|
62177
|
+
getCheckboxColsByField(field, row, table).forEach(col => {
|
|
62178
|
+
setCellCheckboxStateByAttribute(col, row, checked, table);
|
|
62179
|
+
});
|
|
62180
|
+
}
|
|
62181
|
+
function updateVisibleCheckboxCellsByField(field, checked, table) {
|
|
62182
|
+
const cols = getCheckboxColsByField(field, table.columnHeaderLevelCount, table);
|
|
62183
|
+
for (let row = table.columnHeaderLevelCount; row < table.rowCount; row++) cols.forEach(col => {
|
|
62184
|
+
setCellCheckboxStateByAttribute(col, row, checked, table);
|
|
62185
|
+
});
|
|
62186
|
+
}
|
|
62187
|
+
function renderCheckboxStateUpdate(table) {
|
|
62188
|
+
const renderAsync = table.renderAsync;
|
|
62189
|
+
isFunction$3(renderAsync) ? renderAsync.call(table) : table.render();
|
|
62190
|
+
}
|
|
62191
|
+
function updateHeaderCheckboxStateByField(field, table) {
|
|
62192
|
+
const fieldKey = field;
|
|
62193
|
+
let hasChecked = !1,
|
|
62194
|
+
hasUnchecked = !1,
|
|
62195
|
+
hasRecord = !1;
|
|
62196
|
+
traverseRecords(table.records, (record, recordIndex) => {
|
|
62197
|
+
const state = getRecordCheckboxState(recordIndex, record, field, table);
|
|
62198
|
+
hasRecord = !0, !0 === state ? hasChecked = !0 : "indeterminate" === state ? (hasChecked = !0, hasUnchecked = !0) : hasUnchecked = !0;
|
|
62199
|
+
});
|
|
62200
|
+
const checked = !(!hasRecord || !hasChecked || hasUnchecked) || !!hasChecked && "indeterminate";
|
|
62201
|
+
table.stateManager.headerCheckedState[fieldKey] = checked, updateVisibleHeaderCheckboxCellByField(field, checked, table);
|
|
62202
|
+
}
|
|
62203
|
+
function updateVisibleHeaderCheckboxCellByField(field, checked, table) {
|
|
62204
|
+
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);
|
|
62205
|
+
}
|
|
62206
|
+
function getCheckboxColsByField(field, row, table) {
|
|
62207
|
+
const cols = [];
|
|
62208
|
+
for (let col = 0; col < table.colCount; col++) {
|
|
62209
|
+
if (table.isHeader(col, row)) continue;
|
|
62210
|
+
const define = table.getBodyColumnDefine(col, row);
|
|
62211
|
+
(null == define ? void 0 : define.field) === field && "checkbox" === table.getCellType(col, row) && cols.push(col);
|
|
62212
|
+
}
|
|
62213
|
+
return cols;
|
|
62214
|
+
}
|
|
62215
|
+
function updateChildrenCheckboxStateByRecordIndex(recordIndex, field, checked, table) {
|
|
62216
|
+
var _a;
|
|
62217
|
+
const record = getRecordByRecordIndex(table.records, recordIndex);
|
|
62218
|
+
(null === (_a = null == record ? void 0 : record.children) || void 0 === _a ? void 0 : _a.length) && record.children.forEach((child, childIndex) => {
|
|
62219
|
+
const childRecordIndex = normalizeRecordIndexToArray(recordIndex).concat(childIndex);
|
|
62220
|
+
setRecordCheckboxState(childRecordIndex, field, checked, table.stateManager.checkedState), updateVisibleCheckboxCellByRecordIndex(childRecordIndex, field, checked, table), updateChildrenCheckboxStateByRecordIndex(childRecordIndex, field, checked, table);
|
|
62221
|
+
});
|
|
62222
|
+
}
|
|
62223
|
+
function updateParentCheckboxStateByRecordIndex(recordIndex, field, table) {
|
|
62224
|
+
var _a;
|
|
62225
|
+
const recordIndexPath = normalizeRecordIndexToArray(recordIndex);
|
|
62226
|
+
for (let level = recordIndexPath.length - 1; level > 0; level--) {
|
|
62227
|
+
const parentIndex = recordIndexPath.slice(0, level),
|
|
62228
|
+
parentRecord = getRecordByRecordIndex(table.records, parentIndex);
|
|
62229
|
+
if (!(null === (_a = null == parentRecord ? void 0 : parentRecord.children) || void 0 === _a ? void 0 : _a.length)) continue;
|
|
62230
|
+
const childStates = parentRecord.children.map((child, childIndex) => {
|
|
62231
|
+
const childRecordIndex = parentIndex.concat(childIndex),
|
|
62232
|
+
childState = getRecordCheckboxState(childRecordIndex, child, field, table);
|
|
62233
|
+
return setRecordCheckboxState(childRecordIndex, field, childState, table.stateManager.checkedState), childState;
|
|
62234
|
+
}),
|
|
62235
|
+
allChecked = childStates.every(state => !0 === state),
|
|
62236
|
+
allUnchecked = childStates.every(state => !0 !== state && "indeterminate" !== state),
|
|
62237
|
+
parentState = !!allChecked || !allUnchecked && "indeterminate";
|
|
62238
|
+
setRecordCheckboxState(parentIndex, field, parentState, table.stateManager.checkedState), updateVisibleCheckboxCellByRecordIndex(parentIndex, field, parentState, table);
|
|
62239
|
+
}
|
|
62240
|
+
}
|
|
62241
|
+
function getRecordCheckboxState(recordIndex, record, field, table) {
|
|
62242
|
+
var _a;
|
|
62243
|
+
const fieldKey = field,
|
|
62244
|
+
dataIndex = normalizeRecordIndex(recordIndex).toString(),
|
|
62245
|
+
cachedState = null === (_a = table.stateManager.checkedState.get(dataIndex)) || void 0 === _a ? void 0 : _a[fieldKey];
|
|
62246
|
+
if (isValid$1(cachedState)) return cachedState;
|
|
62247
|
+
const value = null == record ? void 0 : record[fieldKey];
|
|
62248
|
+
return isObject$8(value) && isValid$1(value.checked) ? value.checked : "boolean" == typeof value && value;
|
|
62249
|
+
}
|
|
62250
|
+
function getRecordByRecordIndex(records, recordIndex) {
|
|
62251
|
+
const recordIndexPath = normalizeRecordIndexToArray(recordIndex);
|
|
62252
|
+
let record,
|
|
62253
|
+
currentRecords = records;
|
|
62254
|
+
for (let i = 0; i < recordIndexPath.length; i++) record = null == currentRecords ? void 0 : currentRecords[recordIndexPath[i]], currentRecords = null == record ? void 0 : record.children;
|
|
62255
|
+
return record;
|
|
62256
|
+
}
|
|
62257
|
+
function normalizeRecordIndexToArray(recordIndex) {
|
|
62258
|
+
return isArray$5(recordIndex) ? recordIndex : [recordIndex];
|
|
62259
|
+
}
|
|
62260
|
+
function traverseRecords(records, handler, parentIndex = []) {
|
|
62261
|
+
isArray$5(records) && records.forEach((record, index) => {
|
|
62262
|
+
const recordIndex = parentIndex.length ? parentIndex.concat(index) : index;
|
|
62263
|
+
handler(record, recordIndex), isArray$5(null == record ? void 0 : record.children) && traverseRecords(record.children, handler, isArray$5(recordIndex) ? recordIndex : [recordIndex]);
|
|
62264
|
+
});
|
|
62265
|
+
}
|
|
62070
62266
|
function initRecordCheckState(records, state) {
|
|
62071
62267
|
const table = state.table,
|
|
62072
62268
|
start = table.isPivotTable() ? 0 : table.internalProps.transpose ? table.rowHeaderLevelCount : table.columnHeaderLevelCount,
|
|
@@ -65429,7 +65625,9 @@
|
|
|
65429
65625
|
|
|
65430
65626
|
class BodyHelper {
|
|
65431
65627
|
constructor(_table) {
|
|
65432
|
-
this._table = _table;
|
|
65628
|
+
this._table = _table, this.updateIcons();
|
|
65629
|
+
}
|
|
65630
|
+
updateIcons() {
|
|
65433
65631
|
const regedIcons = get$4();
|
|
65434
65632
|
this.expandIcon = regedIcons[InternalIconName.expandIconName], this.collapseIcon = regedIcons[InternalIconName.collapseIconName];
|
|
65435
65633
|
}
|
|
@@ -66192,7 +66390,9 @@
|
|
|
66192
66390
|
|
|
66193
66391
|
class HeaderHelper {
|
|
66194
66392
|
constructor(_table) {
|
|
66195
|
-
this._table = _table;
|
|
66393
|
+
this._table = _table, this.updateIcons();
|
|
66394
|
+
}
|
|
66395
|
+
updateIcons() {
|
|
66196
66396
|
const regedIcons = get$4();
|
|
66197
66397
|
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];
|
|
66198
66398
|
}
|
|
@@ -66654,7 +66854,9 @@
|
|
|
66654
66854
|
|
|
66655
66855
|
class RowSeriesNumberHelper {
|
|
66656
66856
|
constructor(_table) {
|
|
66657
|
-
this._table = _table;
|
|
66857
|
+
this._table = _table, this.updateIcons();
|
|
66858
|
+
}
|
|
66859
|
+
updateIcons() {
|
|
66658
66860
|
const regedIcons = get$4();
|
|
66659
66861
|
this.dragReorderIconName = regedIcons[InternalIconName.dragReorderIconName];
|
|
66660
66862
|
}
|
|
@@ -67405,8 +67607,9 @@
|
|
|
67405
67607
|
let PluginManager$1 = class PluginManager {
|
|
67406
67608
|
constructor(table, options) {
|
|
67407
67609
|
var _a;
|
|
67408
|
-
this.plugins = new Map(), this.pluginEventMap = new Map(), this.table = table, null === (_a = options.plugins) || void 0 === _a || _a.
|
|
67409
|
-
|
|
67610
|
+
this.plugins = new Map(), this.pluginEventMap = new Map(), this.table = table, null === (_a = options.plugins) || void 0 === _a || _a.forEach(plugin => {
|
|
67611
|
+
var _a;
|
|
67612
|
+
this.register(plugin), null === (_a = plugin.init) || void 0 === _a || _a.call(plugin, this.table, options), this._bindTableEventForPlugin(plugin);
|
|
67410
67613
|
});
|
|
67411
67614
|
}
|
|
67412
67615
|
register(plugin) {
|
|
@@ -67431,16 +67634,17 @@
|
|
|
67431
67634
|
this.pluginEventMap.set(plugin.id, [...(this.pluginEventMap.get(plugin.id) || []), id]);
|
|
67432
67635
|
});
|
|
67433
67636
|
}
|
|
67434
|
-
removeOrAddPlugins(plugins) {
|
|
67637
|
+
removeOrAddPlugins(plugins, options = this.table.options) {
|
|
67435
67638
|
Array.from(this.plugins.values()).filter(plugin => !(null == plugins ? void 0 : plugins.some(p => p.id === plugin.id))).forEach(plugin => {
|
|
67436
|
-
var _a;
|
|
67639
|
+
var _a, _b;
|
|
67437
67640
|
null === (_a = this.pluginEventMap.get(plugin.id)) || void 0 === _a || _a.forEach(id => {
|
|
67438
67641
|
this.table.off(id);
|
|
67439
|
-
}), this.release(), this.plugins.delete(plugin.id);
|
|
67642
|
+
}), this.pluginEventMap.delete(plugin.id), null === (_b = plugin.release) || void 0 === _b || _b.call(plugin, this.table), this.plugins.delete(plugin.id);
|
|
67440
67643
|
});
|
|
67441
67644
|
const addedPlugins = null == plugins ? void 0 : plugins.filter(plugin => !this.plugins.has(plugin.id));
|
|
67442
67645
|
null == addedPlugins || addedPlugins.forEach(plugin => {
|
|
67443
|
-
|
|
67646
|
+
var _a;
|
|
67647
|
+
this.register(plugin), null === (_a = plugin.init) || void 0 === _a || _a.call(plugin, this.table, options), this._bindTableEventForPlugin(plugin);
|
|
67444
67648
|
});
|
|
67445
67649
|
}
|
|
67446
67650
|
updatePlugins(plugins) {
|
|
@@ -67463,6 +67667,9 @@
|
|
|
67463
67667
|
isTouchEvent: isTouchEvent$1
|
|
67464
67668
|
} = event,
|
|
67465
67669
|
rangeReg = /^\$(\d+)\$(\d+)$/;
|
|
67670
|
+
function normalizeCellType(cellType) {
|
|
67671
|
+
return isValid$1(cellType) ? cellType : "text";
|
|
67672
|
+
}
|
|
67466
67673
|
importStyle$2();
|
|
67467
67674
|
class BaseTable extends EventTarget$2 {
|
|
67468
67675
|
static get EVENT_TYPE() {
|
|
@@ -67470,7 +67677,7 @@
|
|
|
67470
67677
|
}
|
|
67471
67678
|
constructor(container, options = {}) {
|
|
67472
67679
|
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;
|
|
67473
|
-
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.
|
|
67680
|
+
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) {
|
|
67474
67681
|
const g = window;
|
|
67475
67682
|
g[this.id] = this;
|
|
67476
67683
|
const registry = g.__vtable__ || (g.__vtable__ = {
|
|
@@ -67565,7 +67772,7 @@
|
|
|
67565
67772
|
var _a, _b;
|
|
67566
67773
|
return "node" === Env$1.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);
|
|
67567
67774
|
}
|
|
67568
|
-
}, internalProps.cellTextOverflows = {}, internalProps.focusedTable = !1, internalProps.theme = themes.of(null !== (_r = options.theme) && void 0 !== _r ? _r : themes.DEFAULT), internalProps.theme.isPivot = this.isPivotTable(),
|
|
67775
|
+
}, 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$1(this), this.stateManager = new StateManager$1(this), this.eventManager = new EventManager$1(this), this.animationManager = new TableAnimationManager(this), options.legends) {
|
|
67569
67776
|
internalProps.legends = [];
|
|
67570
67777
|
const createLegend = Factory.getFunction("createLegend");
|
|
67571
67778
|
if (Array.isArray(options.legends)) {
|
|
@@ -68529,7 +68736,7 @@
|
|
|
68529
68736
|
height: !1
|
|
68530
68737
|
}), 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;
|
|
68531
68738
|
const internalProps = this.internalProps;
|
|
68532
|
-
if ("node" === Env$1.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(),
|
|
68739
|
+
if ("node" === Env$1.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 => {
|
|
68533
68740
|
null == legend || legend.release();
|
|
68534
68741
|
}), 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) {
|
|
68535
68742
|
internalProps.legends = [];
|
|
@@ -68844,18 +69051,22 @@
|
|
|
68844
69051
|
updateAutoWrapText(autoWrapText) {
|
|
68845
69052
|
this.internalProps.autoWrapText !== autoWrapText && (this.internalProps.autoWrapText = autoWrapText, this.options.autoWrapText = autoWrapText, this.scenegraph.clearCells(), this.clearCellStyleCache(), this.scenegraph.createSceneGraph(), this.render());
|
|
68846
69053
|
}
|
|
69054
|
+
_updateFunctionalIcons() {
|
|
69055
|
+
var _a, _b, _c;
|
|
69056
|
+
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();
|
|
69057
|
+
}
|
|
68847
69058
|
get theme() {
|
|
68848
69059
|
return this.internalProps.theme;
|
|
68849
69060
|
}
|
|
68850
69061
|
set theme(theme) {
|
|
68851
|
-
this.internalProps.theme = themes.of(null != theme ? theme : themes.DEFAULT), this.internalProps.theme.isPivot = this.isPivotTable(), this.options.theme = theme,
|
|
69062
|
+
this.internalProps.theme = themes.of(null != theme ? theme : themes.DEFAULT), this.internalProps.theme.isPivot = this.isPivotTable(), this.options.theme = theme, this._updateFunctionalIcons();
|
|
68852
69063
|
}
|
|
68853
69064
|
updateTheme(theme) {
|
|
68854
69065
|
const oldHoverState = {
|
|
68855
69066
|
col: this.stateManager.hover.cellPos.col,
|
|
68856
69067
|
row: this.stateManager.hover.cellPos.row
|
|
68857
69068
|
};
|
|
68858
|
-
this.internalProps.theme = themes.of(null != theme ? theme : themes.DEFAULT), this.internalProps.theme.isPivot = this.isPivotTable(),
|
|
69069
|
+
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();
|
|
68859
69070
|
}
|
|
68860
69071
|
getBodyField(col, row) {
|
|
68861
69072
|
return this.internalProps.layoutMap.getBody(col, row).field;
|
|
@@ -68867,19 +69078,19 @@
|
|
|
68867
69078
|
getBodyColumnType(col, row) {
|
|
68868
69079
|
var _a, _b;
|
|
68869
69080
|
const cellType = null !== (_b = null === (_a = this.internalProps.layoutMap.getBody(col, row)) || void 0 === _a ? void 0 : _a.cellType) && void 0 !== _b ? _b : "text";
|
|
68870
|
-
return getProp("cellType", {
|
|
69081
|
+
return normalizeCellType(getProp("cellType", {
|
|
68871
69082
|
cellType: cellType
|
|
68872
|
-
}, col, row, this);
|
|
69083
|
+
}, col, row, this));
|
|
68873
69084
|
}
|
|
68874
69085
|
getCellType(col, row) {
|
|
68875
69086
|
let cellType;
|
|
68876
69087
|
if (this.isSeriesNumberInHeader(col, row)) {
|
|
68877
69088
|
const seriesHeaderCellType = this.internalProps.layoutMap.getSeriesNumberHeader(col, row).cellType;
|
|
68878
|
-
return "radio" === seriesHeaderCellType ? "text" : seriesHeaderCellType;
|
|
69089
|
+
return normalizeCellType("radio" === seriesHeaderCellType ? "text" : seriesHeaderCellType);
|
|
68879
69090
|
}
|
|
68880
|
-
return cellType = this.isHeader(col, row) ? this.internalProps.layoutMap.getHeader(col, row).headerType : this.internalProps.layoutMap.getBody(col, row).cellType, getProp("cellType", {
|
|
69091
|
+
return cellType = this.isHeader(col, row) ? this.internalProps.layoutMap.getHeader(col, row).headerType : this.internalProps.layoutMap.getBody(col, row).cellType, normalizeCellType(getProp("cellType", {
|
|
68881
69092
|
cellType: cellType
|
|
68882
|
-
}, col, row, this);
|
|
69093
|
+
}, col, row, this));
|
|
68883
69094
|
}
|
|
68884
69095
|
getHeaderField(col, row) {
|
|
68885
69096
|
return this.internalProps.layoutMap.getHeaderField(col, row);
|
|
@@ -72459,6 +72670,7 @@
|
|
|
72459
72670
|
} = table.internalProps.layoutMap.getSeriesNumberHeader(col, row);
|
|
72460
72671
|
return title;
|
|
72461
72672
|
}
|
|
72673
|
+
if (table.internalProps.layoutMap.isAggregation(col, row)) return "";
|
|
72462
72674
|
let value;
|
|
72463
72675
|
if (this.internalProps.groupBy) {
|
|
72464
72676
|
const record = table.getCellRawRecord(col, row);
|
|
@@ -72506,6 +72718,7 @@
|
|
|
72506
72718
|
} = table.internalProps.layoutMap.getSeriesNumberHeader(col, row);
|
|
72507
72719
|
return title;
|
|
72508
72720
|
}
|
|
72721
|
+
if (table.internalProps.layoutMap.isAggregation(col, row)) return "";
|
|
72509
72722
|
const {
|
|
72510
72723
|
format: format
|
|
72511
72724
|
} = table.internalProps.layoutMap.getSeriesNumberBody(col, row);
|
|
@@ -72603,7 +72816,7 @@
|
|
|
72603
72816
|
}) {
|
|
72604
72817
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
72605
72818
|
const internalProps = this.internalProps;
|
|
72606
|
-
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) : {
|
|
72819
|
+
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) : {
|
|
72607
72820
|
addRecordRule: options.addRecordRule
|
|
72608
72821
|
}, 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--) {
|
|
72609
72822
|
const releaseObj = internalProps.releaseList[i];
|
|
@@ -72894,6 +73107,15 @@
|
|
|
72894
73107
|
setCellCheckboxState(col, row, checked) {
|
|
72895
73108
|
setCellCheckboxState(col, row, checked, this);
|
|
72896
73109
|
}
|
|
73110
|
+
setCellCheckboxStateByRecordIndex(recordIndex, field, checked) {
|
|
73111
|
+
setCheckboxStateByRecordIndex(recordIndex, field, checked, this);
|
|
73112
|
+
}
|
|
73113
|
+
clearCheckboxState(field) {
|
|
73114
|
+
clearCheckboxState(field, this);
|
|
73115
|
+
}
|
|
73116
|
+
clearAllCheckboxState(field) {
|
|
73117
|
+
this.clearCheckboxState(field);
|
|
73118
|
+
}
|
|
72897
73119
|
setCellRadioState(col, row, index) {
|
|
72898
73120
|
setCellRadioState(col, row, index, this);
|
|
72899
73121
|
}
|
|
@@ -73252,9 +73474,11 @@
|
|
|
73252
73474
|
}, 0));
|
|
73253
73475
|
}
|
|
73254
73476
|
updateRecords(records, recordIndexs, triggerEvent = !0) {
|
|
73255
|
-
|
|
73477
|
+
var _a;
|
|
73478
|
+
const updateRecordIndexs = null !== (_a = null != recordIndexs ? recordIndexs : null == records ? void 0 : records.map((_, index) => index)) && void 0 !== _a ? _a : [];
|
|
73479
|
+
listTableUpdateRecords(records, updateRecordIndexs, this), triggerEvent && this.fireListeners(TABLE_EVENT_TYPE.UPDATE_RECORD, {
|
|
73256
73480
|
records: records,
|
|
73257
|
-
recordIndexs:
|
|
73481
|
+
recordIndexs: updateRecordIndexs,
|
|
73258
73482
|
updateCount: records.length
|
|
73259
73483
|
});
|
|
73260
73484
|
}
|
|
@@ -80016,6 +80240,18 @@
|
|
|
80016
80240
|
const LOCATE_ICON_BG_HOVER = '#4080ff';
|
|
80017
80241
|
const LOCATE_ICON_ARROW = '#4e5969';
|
|
80018
80242
|
const LOCATE_ICON_ARROW_HOVER = '#ffffff';
|
|
80243
|
+
const isSameSubTaskIndex = (source, target) => {
|
|
80244
|
+
if (!isValid$1(target)) {
|
|
80245
|
+
return true;
|
|
80246
|
+
}
|
|
80247
|
+
if (Array.isArray(source) || Array.isArray(target)) {
|
|
80248
|
+
return (Array.isArray(source) &&
|
|
80249
|
+
Array.isArray(target) &&
|
|
80250
|
+
source.length === target.length &&
|
|
80251
|
+
source.every((value, index) => value === target[index]));
|
|
80252
|
+
}
|
|
80253
|
+
return source === target;
|
|
80254
|
+
};
|
|
80019
80255
|
class TaskBar {
|
|
80020
80256
|
formatMilestoneText(text, record) {
|
|
80021
80257
|
if (!text) {
|
|
@@ -80952,8 +81188,7 @@
|
|
|
80952
81188
|
return null;
|
|
80953
81189
|
}
|
|
80954
81190
|
for (let i = 0; i < this.barContainer.childrenCount; i++) {
|
|
80955
|
-
if (c.task_index === index &&
|
|
80956
|
-
(!isValid$1(sub_task_index) || (isValid$1(sub_task_index) && c.sub_task_index === sub_task_index))) {
|
|
81191
|
+
if (c.task_index === index && isSameSubTaskIndex(c.sub_task_index, sub_task_index)) {
|
|
80957
81192
|
return c;
|
|
80958
81193
|
}
|
|
80959
81194
|
c = c._next;
|
|
@@ -84456,14 +84691,16 @@
|
|
|
84456
84691
|
if (this._gantt.parsedOptions.tasksShowMode !== TasksShowMode.Tasks_Separate &&
|
|
84457
84692
|
Math.abs(Math.round(deltaY / this._gantt.parsedOptions.rowHeight)) >= 1) {
|
|
84458
84693
|
const indexs = getTaskIndexsByTaskY(targetEndY, this._gantt);
|
|
84459
|
-
|
|
84460
|
-
|
|
84461
|
-
this._gantt.
|
|
84462
|
-
|
|
84463
|
-
|
|
84464
|
-
|
|
84465
|
-
|
|
84466
|
-
|
|
84694
|
+
if (!Array.isArray(target.sub_task_index) && !Array.isArray(indexs.sub_task_index)) {
|
|
84695
|
+
this._gantt._dragOrderTaskRecord(target.task_index, target.sub_task_index, indexs.task_index, indexs.sub_task_index);
|
|
84696
|
+
if (this._gantt.parsedOptions.tasksShowMode === TasksShowMode.Sub_Tasks_Separate) {
|
|
84697
|
+
this._gantt.taskListTableInstance.renderWithRecreateCells();
|
|
84698
|
+
this._gantt.scenegraph.refreshTaskBarsAndGrid();
|
|
84699
|
+
}
|
|
84700
|
+
else {
|
|
84701
|
+
this._gantt.scenegraph.taskBar.refresh();
|
|
84702
|
+
this._gantt.scenegraph.dependencyLink.refresh();
|
|
84703
|
+
}
|
|
84467
84704
|
}
|
|
84468
84705
|
}
|
|
84469
84706
|
else {
|
|
@@ -85107,6 +85344,8 @@
|
|
|
85107
85344
|
};
|
|
85108
85345
|
parent[startDateField] = formatDateValue(earliestStart);
|
|
85109
85346
|
parent[endDateField] = formatDateValue(latestEnd);
|
|
85347
|
+
const parentRecordIndex = parentPath.length === 0 ? childIndex : [...parentPath, childIndex];
|
|
85348
|
+
this._gantt._updateRecordToListTable(parent, parentRecordIndex);
|
|
85110
85349
|
}
|
|
85111
85350
|
}
|
|
85112
85351
|
}
|
|
@@ -87083,7 +87322,7 @@
|
|
|
87083
87322
|
}
|
|
87084
87323
|
_refreshTaskBar(taskShowIndex, sub_task_index) {
|
|
87085
87324
|
this.scenegraph.taskBar.updateTaskBarNode(taskShowIndex, sub_task_index);
|
|
87086
|
-
this.scenegraph.refreshRecordLinkNodes(taskShowIndex,
|
|
87325
|
+
this.scenegraph.refreshRecordLinkNodes(taskShowIndex, sub_task_index, this.scenegraph.taskBar.getTaskBarNodeByIndex(taskShowIndex, sub_task_index));
|
|
87087
87326
|
this.scenegraph.updateNextFrame();
|
|
87088
87327
|
}
|
|
87089
87328
|
_updateRecordToListTable(record, index) {
|
|
@@ -87216,6 +87455,7 @@
|
|
|
87216
87455
|
this._refreshSortedTaskBarsAfterRecordUpdate(recordIndex, index);
|
|
87217
87456
|
}
|
|
87218
87457
|
else if (Array.isArray(sub_task_index)) {
|
|
87458
|
+
this._updateRecordToListTable(taskRecord, sub_task_index);
|
|
87219
87459
|
this.stateManager.updateProjectTaskTimes(sub_task_index);
|
|
87220
87460
|
}
|
|
87221
87461
|
}
|
|
@@ -87234,6 +87474,7 @@
|
|
|
87234
87474
|
this._refreshSortedTaskBarsAfterRecordUpdate(recordIndex, index);
|
|
87235
87475
|
}
|
|
87236
87476
|
else if (Array.isArray(sub_task_index)) {
|
|
87477
|
+
this._updateRecordToListTable(taskRecord, sub_task_index);
|
|
87237
87478
|
this.stateManager.updateProjectTaskTimes(sub_task_index);
|
|
87238
87479
|
}
|
|
87239
87480
|
}
|
|
@@ -87255,6 +87496,7 @@
|
|
|
87255
87496
|
this._refreshSortedTaskBarsAfterRecordUpdate(recordIndex, index);
|
|
87256
87497
|
}
|
|
87257
87498
|
else if (Array.isArray(sub_task_index)) {
|
|
87499
|
+
this._updateRecordToListTable(taskRecord, sub_task_index);
|
|
87258
87500
|
this.stateManager.updateProjectTaskTimes(sub_task_index);
|
|
87259
87501
|
}
|
|
87260
87502
|
}
|
|
@@ -87263,6 +87505,11 @@
|
|
|
87263
87505
|
const progressField = this.parsedOptions.progressField;
|
|
87264
87506
|
if (progressField) {
|
|
87265
87507
|
taskRecord[progressField] = progress;
|
|
87508
|
+
if (Array.isArray(sub_task_index)) {
|
|
87509
|
+
this._updateRecordToListTable(taskRecord, sub_task_index);
|
|
87510
|
+
this._refreshTaskBar(index, sub_task_index);
|
|
87511
|
+
return;
|
|
87512
|
+
}
|
|
87266
87513
|
const recordIndex = this.getRecordIndexByTaskShowIndex(index);
|
|
87267
87514
|
this._updateRecordToListTable(taskRecord, Array.isArray(recordIndex) ? recordIndex : index);
|
|
87268
87515
|
if (!this._refreshSortedTaskBarsAfterRecordUpdate(recordIndex, index)) {
|
|
@@ -87276,7 +87523,7 @@
|
|
|
87276
87523
|
updateTaskRecord(record, task_index, sub_task_index) {
|
|
87277
87524
|
if (isValid$1(sub_task_index)) {
|
|
87278
87525
|
const index = typeof task_index === 'number' ? task_index : task_index[0];
|
|
87279
|
-
this._updateRecordToListTable(record, [index, sub_task_index]);
|
|
87526
|
+
this._updateRecordToListTable(record, Array.isArray(sub_task_index) ? sub_task_index : [index, sub_task_index]);
|
|
87280
87527
|
this._refreshTaskBar(index, sub_task_index);
|
|
87281
87528
|
return;
|
|
87282
87529
|
}
|
|
@@ -87507,8 +87754,11 @@
|
|
|
87507
87754
|
set scrollLeft(value) {
|
|
87508
87755
|
this.stateManager.setScrollLeft(value);
|
|
87509
87756
|
}
|
|
87510
|
-
getTaskBarRelativeRect(index) {
|
|
87511
|
-
const taskBarNode = this.scenegraph.taskBar.getTaskBarNodeByIndex(index);
|
|
87757
|
+
getTaskBarRelativeRect(index, sub_task_index) {
|
|
87758
|
+
const taskBarNode = this.scenegraph.taskBar.getTaskBarNodeByIndex(index, sub_task_index);
|
|
87759
|
+
if (!taskBarNode) {
|
|
87760
|
+
return null;
|
|
87761
|
+
}
|
|
87512
87762
|
const left = taskBarNode.attribute.x +
|
|
87513
87763
|
this.taskListTableInstance.tableNoFrameWidth +
|
|
87514
87764
|
this.taskListTableInstance.tableX +
|
|
@@ -87662,7 +87912,7 @@
|
|
|
87662
87912
|
PluginManager: PluginManager
|
|
87663
87913
|
});
|
|
87664
87914
|
|
|
87665
|
-
const version = "1.26.
|
|
87915
|
+
const version = "1.26.6";
|
|
87666
87916
|
|
|
87667
87917
|
exports.Gantt = Gantt;
|
|
87668
87918
|
exports.TABLE_EVENT_TYPE = TABLE_EVENT_TYPE;
|