@visactor/vtable-calendar 1.17.3-alpha.10 → 1.17.3-alpha.12
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 +191 -114
- package/dist/vtable-calendar.min.js +1 -1
- package/package.json +2 -2
package/dist/vtable-calendar.js
CHANGED
|
@@ -32238,7 +32238,7 @@
|
|
|
32238
32238
|
}
|
|
32239
32239
|
function getCellCornerRadius(col, row, table) {
|
|
32240
32240
|
const tableCornerRadius = table.theme.frameStyle.cornerRadius;
|
|
32241
|
-
if (Array.isArray(tableCornerRadius)) {
|
|
32241
|
+
if (table.theme.cellInnerBorder) if (Array.isArray(tableCornerRadius)) {
|
|
32242
32242
|
if (0 === col && 0 === row) return [tableCornerRadius[0], 0, 0, 0];
|
|
32243
32243
|
if (col === table.colCount - 1 && 0 === row) return [0, tableCornerRadius[1], 0, 0];
|
|
32244
32244
|
if (0 === col && row === table.rowCount - 1) return [0, 0, 0, tableCornerRadius[3]];
|
|
@@ -37406,12 +37406,12 @@
|
|
|
37406
37406
|
isWidthNumber = !Array.isArray(strokeArrayWidth),
|
|
37407
37407
|
isStrokeTrue = !Array.isArray(stroke),
|
|
37408
37408
|
isSplitDraw = Array.isArray(strokeArrayColor) || widthInfo.isSplitDraw;
|
|
37409
|
-
context.setStrokeStyle(rect, rect.attribute, x, y, rectAttribute);
|
|
37409
|
+
context.stroke(), context.setStrokeStyle(rect, rect.attribute, x, y, rectAttribute);
|
|
37410
37410
|
const {
|
|
37411
37411
|
lineDash = groupAttribute.lineDash
|
|
37412
37412
|
} = group.attribute;
|
|
37413
37413
|
let isDash = !1;
|
|
37414
|
-
lineDash.length && lineDash.some(dash => Array.isArray(dash)) && (isDash = !0), context.moveTo(x, y);
|
|
37414
|
+
lineDash.length && lineDash.some(dash => Array.isArray(dash)) && (isDash = !0), context.beginPath(), context.moveTo(x, y);
|
|
37415
37415
|
const strokeTop = (isStrokeTrue || stroke[0]) && (isWidthNumber || strokeArrayWidth[0]),
|
|
37416
37416
|
strokeRight = (isStrokeTrue || stroke[1]) && (isWidthNumber || strokeArrayWidth[1]),
|
|
37417
37417
|
strokeBottom = (isStrokeTrue || stroke[2]) && (isWidthNumber || strokeArrayWidth[2]),
|
|
@@ -37432,7 +37432,7 @@
|
|
|
37432
37432
|
isWidthNumber ? widthInfo.width : strokeArrayWidth[3], isWidthNumber ? widthInfo.width : strokeArrayWidth[3];
|
|
37433
37433
|
context.moveTo(x1, y1), context.lineTo(x2, y2), (isSplitDraw || isDash) && (strokeArrayColor && strokeArrayColor[3] ? context.strokeStyle = strokeArrayColor[3] : strokeArrayColor && !strokeArrayColor[3] && (context.strokeStyle = "transparent"), isWidthNumber || (context.lineWidth = strokeArrayWidth[3]), context.lineDashOffset = context.currentMatrix.f / context.currentMatrix.d, isDash && context.setLineDash(null !== (_d = lineDash[3]) && void 0 !== _d ? _d : []), context.stroke(), context.beginPath(), context.moveTo(x, y));
|
|
37434
37434
|
} else 3 === i && context.moveTo(x, y);
|
|
37435
|
-
isSplitDraw || isDash || (!isWidthNumber && widthInfo.width && (context.lineWidth = widthInfo.width), context.stroke()), context.lineDashOffset = 0, context.setLineDash([]), context.
|
|
37435
|
+
context.closePath(), isSplitDraw || isDash || (!isWidthNumber && widthInfo.width && (context.lineWidth = widthInfo.width), context.stroke()), context.lineDashOffset = 0, context.setLineDash([]), context.beginPath();
|
|
37436
37436
|
}
|
|
37437
37437
|
|
|
37438
37438
|
var __decorate$1 = undefined && undefined.__decorate || function (decorators, target, key, desc) {
|
|
@@ -38816,7 +38816,7 @@
|
|
|
38816
38816
|
};
|
|
38817
38817
|
class SceneProxy {
|
|
38818
38818
|
constructor(table) {
|
|
38819
|
-
this.isRelease = !1, this.mode = "column", this.rowLimit = 200, this.currentRow = 0, this.rowStart = 0, this.rowEnd = 0, this.referenceRow = 0, this.screenTopRow = 0, this.deltaY = 0, this.deltaHeight = 0, this.colLimit = 100, this.screenLeftCol = 0, this.deltaX = 0, this.deltaWidth = 0, this.cellCache = new Map(), this.table = table, this.table.isPivotChart() ? (this.rowLimit = Math.max(100, Math.ceil(2 * table.tableNoFrameHeight / table.defaultRowHeight)), this.colLimit = Math.max(100, Math.ceil(2 * table.tableNoFrameWidth / table.defaultColWidth))) : this.table.isAutoRowHeight() ? this.rowLimit = Math.max(100, Math.ceil(2 * table.tableNoFrameHeight / table.defaultRowHeight)) : ("autoWidth" === this.table.widthMode || (this.rowLimit = Math.max(200, Math.ceil(2 * table.tableNoFrameHeight / table.defaultRowHeight))), this.colLimit = Math.max(100, Math.ceil(2 * table.tableNoFrameWidth / table.defaultColWidth))), this.table.internalProps.transpose ? this.mode = "row" : this.table.isPivotTable() && (this.mode = "pivot"), this.table.options.maintainedDataCount && (this.rowLimit = this.table.options.maintainedDataCount);
|
|
38819
|
+
this.isRelease = !1, this.mode = "column", this.rowLimit = 200, this.currentRow = 0, this.rowStart = 0, this.rowEnd = 0, this.referenceRow = 0, this.screenTopRow = 0, this.deltaY = 0, this.deltaHeight = 0, this.colLimit = 100, this.screenLeftCol = 0, this.deltaX = 0, this.deltaWidth = 0, this.cellCache = new Map(), this.table = table, this.table.isPivotChart() ? (this.rowLimit = Math.max(100, Math.ceil(2 * table.tableNoFrameHeight / table.defaultRowHeight)), this.colLimit = Math.max(100, Math.ceil(2 * table.tableNoFrameWidth / table.defaultColWidth))) : this.table.isAutoRowHeight() ? this.rowLimit = Math.max(100, Math.ceil(2 * table.tableNoFrameHeight / table.defaultRowHeight)) : ("autoWidth" === this.table.widthMode || (this.rowLimit = Math.max(200, Math.ceil(2 * table.tableNoFrameHeight / table.defaultRowHeight))), this.colLimit = Math.max(100, Math.ceil(2 * table.tableNoFrameWidth / table.defaultColWidth))), this.table.internalProps.transpose ? this.mode = "row" : this.table.isPivotTable() && (this.mode = "pivot"), this.table.options.maintainedDataCount && (this.rowLimit = this.table.options.maintainedDataCount), this.table.options.maintainedColumnCount && (this.colLimit = this.table.options.maintainedColumnCount);
|
|
38820
38820
|
}
|
|
38821
38821
|
get bodyLeftCol() {
|
|
38822
38822
|
return this.table.frozenColCount;
|
|
@@ -39323,7 +39323,7 @@
|
|
|
39323
39323
|
}
|
|
39324
39324
|
isExtend && extendSelectRange();
|
|
39325
39325
|
};
|
|
39326
|
-
ifExtendSelectRange && extendSelectRange(), scene.selectingRangeComponents.forEach((selectComp, key) => {
|
|
39326
|
+
ifExtendSelectRange && (extendSelectRange(), selectRange.start.col > selectRange.end.col ? (selectRange.start.col = Math.max(startCol, endCol), selectRange.end.col = Math.min(startCol, endCol)) : (selectRange.start.col = Math.min(startCol, endCol), selectRange.end.col = Math.max(startCol, endCol)), selectRange.start.row > selectRange.end.row ? (selectRange.start.row = Math.max(startRow, endRow), selectRange.end.row = Math.min(startRow, endRow)) : (selectRange.start.row = Math.min(startRow, endRow), selectRange.end.row = Math.max(startRow, endRow))), scene.selectingRangeComponents.forEach((selectComp, key) => {
|
|
39327
39327
|
var _a;
|
|
39328
39328
|
selectComp.rect.delete(), null === (_a = selectComp.fillhandle) || void 0 === _a || _a.delete();
|
|
39329
39329
|
}), scene.selectingRangeComponents = new Map();
|
|
@@ -39413,7 +39413,7 @@
|
|
|
39413
39413
|
}
|
|
39414
39414
|
|
|
39415
39415
|
function createCellSelectBorder(scene, start_Col, start_Row, end_Col, end_Row, selectRangeType, selectId, strokes) {
|
|
39416
|
-
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
39416
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
39417
39417
|
let isHasFillHandleRect = !!(null === (_a = scene.table.options.excelOptions) || void 0 === _a ? void 0 : _a.fillHandle);
|
|
39418
39418
|
if ((null === (_b = scene.table.stateManager.select.ranges) || void 0 === _b ? void 0 : _b.length) > 1) isHasFillHandleRect = !1, scene.removeFillHandleFromSelectComponents();else if (1 === (null === (_c = scene.table.stateManager.select.ranges) || void 0 === _c ? void 0 : _c.length)) {
|
|
39419
39419
|
const maxRow = Math.max(scene.table.stateManager.select.ranges[0].start.row, scene.table.stateManager.select.ranges[0].end.row),
|
|
@@ -39439,7 +39439,8 @@
|
|
|
39439
39439
|
y: firstCellBound.y1 - scene.tableGroup.attribute.y,
|
|
39440
39440
|
width: 0,
|
|
39441
39441
|
height: 0,
|
|
39442
|
-
visible: !0
|
|
39442
|
+
visible: !0,
|
|
39443
|
+
cornerRadius: getCornerRadius(selectRangeType, null === (_j = scene.table.theme.frameStyle) || void 0 === _j ? void 0 : _j.cornerRadius, start_Col, start_Row, end_Col, end_Row, scene.table)
|
|
39443
39444
|
});
|
|
39444
39445
|
let fillhandle;
|
|
39445
39446
|
isHasFillHandleRect && (fillhandle = createRect({
|
|
@@ -39457,6 +39458,15 @@
|
|
|
39457
39458
|
role: selectRangeType
|
|
39458
39459
|
}), scene.tableGroup.insertAfter(rect, "body" === selectRangeType ? scene.bodyGroup : "columnHeader" === selectRangeType ? scene.colHeaderGroup : "rowHeader" === selectRangeType ? scene.rowHeaderGroup : "cornerHeader" === selectRangeType ? scene.cornerHeaderGroup : "rightTopCorner" === selectRangeType ? scene.rightTopCornerGroup : "rightFrozen" === selectRangeType ? scene.rightFrozenGroup : "leftBottomCorner" === selectRangeType ? scene.leftBottomCornerGroup : "bottomFrozen" === selectRangeType ? scene.bottomFrozenGroup : scene.rightBottomCornerGroup), isHasFillHandleRect && scene.tableGroup.insertAfter(fillhandle, "body" === selectRangeType ? scene.bodyGroup : "columnHeader" === selectRangeType ? scene.colHeaderGroup : "rowHeader" === selectRangeType ? scene.rowHeaderGroup : "cornerHeader" === selectRangeType ? scene.cornerHeaderGroup : "rightTopCorner" === selectRangeType ? scene.rightTopCornerGroup : "rightFrozen" === selectRangeType ? scene.rightFrozenGroup : "leftBottomCorner" === selectRangeType ? scene.leftBottomCornerGroup : "bottomFrozen" === selectRangeType ? scene.bottomFrozenGroup : scene.rightBottomCornerGroup);
|
|
39459
39460
|
}
|
|
39461
|
+
function getCornerRadius(selectRangeType, cornerRadius, start_Col, start_Row, end_Col, end_Row, table) {
|
|
39462
|
+
if (!cornerRadius) return;
|
|
39463
|
+
const cornerRadiusArray = Array.isArray(cornerRadius) ? cornerRadius : [cornerRadius, cornerRadius, cornerRadius, cornerRadius],
|
|
39464
|
+
tableEndCol = table.colCount - 1,
|
|
39465
|
+
tableEndRow = table.rowCount - 1,
|
|
39466
|
+
result = [0, 0, 0, 0];
|
|
39467
|
+
let changed = !1;
|
|
39468
|
+
return 0 === start_Col && 0 === start_Row ? (result[0] = cornerRadiusArray[0], changed = !0) : end_Col === tableEndCol && end_Row === tableEndRow ? (result[2] = cornerRadiusArray[2], changed = !0) : 0 === start_Col && end_Row === tableEndRow ? (result[3] = cornerRadiusArray[3], changed = !0) : end_Col === tableEndCol && 0 === start_Row && (result[1] = cornerRadiusArray[1], changed = !0), changed ? result : void 0;
|
|
39469
|
+
}
|
|
39460
39470
|
|
|
39461
39471
|
function moveSelectingRangeComponentsToSelectedRangeComponents(scene) {
|
|
39462
39472
|
scene.selectingRangeComponents.forEach((rangeComponent, key) => {
|
|
@@ -39552,7 +39562,7 @@
|
|
|
39552
39562
|
const minRow = Math.min(...addRows);
|
|
39553
39563
|
scene.proxy.rowUpdatePos = Math.min(minRow, scene.proxy.rowUpdatePos);
|
|
39554
39564
|
}
|
|
39555
|
-
scene.proxy.rowUpdateDirection = "
|
|
39565
|
+
scene.proxy.rowUpdateDirection = "up", scene.proxy.updateCellGroups(2 * scene.proxy.screenRowCount), updateBottomFrozeCellGroups();
|
|
39556
39566
|
} else removeRows.length && (setRowSeriesNumberCellNeedUpdate(removeRows[removeRows.length - 1], scene), scene.proxy.updateCellGroups(2 * scene.proxy.screenRowCount), updateBottomFrozeCellGroups());
|
|
39557
39567
|
scene.proxy.progress();
|
|
39558
39568
|
const newTotalHeight = table.getRowsHeight(table.frozenRowCount, table.rowCount - 1 - table.bottomFrozenRowCount);
|
|
@@ -39819,7 +39829,7 @@
|
|
|
39819
39829
|
}
|
|
39820
39830
|
|
|
39821
39831
|
function dealFrozen(scene) {
|
|
39822
|
-
var _a, _b;
|
|
39832
|
+
var _a, _b, _c, _d;
|
|
39823
39833
|
if (scene.table.frozenColCount > scene.table.rowHeaderLevelCount) {
|
|
39824
39834
|
scene.rowHeaderGroup.setAttribute("height", scene.bodyGroup.attribute.height), scene.rowHeaderGroup.setAttribute("y", scene.bodyGroup.attribute.y), scene.cornerHeaderGroup.setAttribute("height", scene.colHeaderGroup.attribute.height);
|
|
39825
39835
|
for (let i = 0; i < scene.table.frozenColCount - scene.table.rowHeaderLevelCount; i++) moveColumnFromBodyToRowHeader(scene), moveColumnFromColHeaderToCornerHeader(scene), moveColumnFromBottomToLeftBottomCorner(scene);
|
|
@@ -39827,10 +39837,10 @@
|
|
|
39827
39837
|
scene.bodyGroup.setAttribute("height", scene.rowHeaderGroup.attribute.height), scene.bodyGroup.setAttribute("y", scene.rowHeaderGroup.attribute.y), scene.colHeaderGroup.setAttribute("height", scene.cornerHeaderGroup.attribute.height);
|
|
39828
39838
|
for (let i = 0; i < scene.table.rowHeaderLevelCount - scene.table.frozenColCount; i++) moveColumnFromRowHeaderToBody(scene), moveColumnFromCornerHeaderToColHeader(scene), moveColumnFromLeftBottomCornerToBottom(scene);
|
|
39829
39839
|
}
|
|
39830
|
-
scene.bodyGroup.setAttribute("x", scene.rowHeaderGroup.attribute.width), scene.colHeaderGroup.setAttribute("x", scene.cornerHeaderGroup.attribute.width), scene.updateContainer(), scene.updateBorderSizeAndPosition(), scene.isPivot || scene.table.transpose ? scene.table.options.frozenColCount ? scene.component.setFrozenColumnShadow(scene.table.frozenColCount - 1) : scene.table.options.frozenColCount && scene.component.setRightFrozenColumnShadow(scene.table.colCount - scene.table.rightFrozenColCount) : (scene.component.setFrozenColumnShadow(scene.table.frozenColCount - 1), scene.component.setRightFrozenColumnShadow(scene.table.colCount - scene.table.rightFrozenColCount)), scene.hasFrozen = !0, scene.frozenColCount = scene.table.frozenColCount, scene.frozenRowCount = null !== (_b = null === (_a = scene.colHeaderGroup.firstChild) || void 0 === _a ? void 0 : _a.childrenCount) && void 0 !== _b ? _b : 0;
|
|
39840
|
+
scene.bodyGroup.setAttribute("x", scene.rowHeaderGroup.attribute.width), scene.colHeaderGroup.setAttribute("x", scene.cornerHeaderGroup.attribute.width), scene.updateContainer(), scene.updateBorderSizeAndPosition(), scene.isPivot || scene.table.transpose ? scene.table.options.frozenColCount ? scene.component.setFrozenColumnShadow(scene.table.frozenColCount - 1) : scene.table.options.frozenColCount && scene.component.setRightFrozenColumnShadow(scene.table.colCount - scene.table.rightFrozenColCount) : (scene.component.setFrozenColumnShadow(scene.table.frozenColCount - 1), scene.component.setRightFrozenColumnShadow(scene.table.colCount - scene.table.rightFrozenColCount)), scene.hasFrozen = !0, scene.frozenColCount = scene.table.frozenColCount, scene.frozenRowCount = null !== (_d = null !== (_b = null === (_a = scene.colHeaderGroup.firstChild) || void 0 === _a ? void 0 : _a.childrenCount) && void 0 !== _b ? _b : null === (_c = scene.cornerHeaderGroup.firstChild) || void 0 === _c ? void 0 : _c.childrenCount) && void 0 !== _d ? _d : scene.table.frozenRowCount;
|
|
39831
39841
|
}
|
|
39832
39842
|
function resetFrozen(scene) {
|
|
39833
|
-
var _a, _b, _c, _d;
|
|
39843
|
+
var _a, _b, _c, _d, _e, _f;
|
|
39834
39844
|
if (scene.frozenColCount > scene.table.frozenColCount) {
|
|
39835
39845
|
scene.bodyGroup.setAttribute("height", scene.rowHeaderGroup.attribute.height), scene.bodyGroup.setAttribute("y", scene.rowHeaderGroup.attribute.y), scene.colHeaderGroup.setAttribute("height", scene.cornerHeaderGroup.attribute.height);
|
|
39836
39846
|
for (let i = 0; i < scene.frozenColCount - scene.table.frozenColCount; i++) moveColumnFromRowHeaderToBody(scene), moveColumnFromCornerHeaderToColHeader(scene), moveColumnFromLeftBottomCornerToBottom(scene);
|
|
@@ -39838,7 +39848,7 @@
|
|
|
39838
39848
|
scene.rowHeaderGroup.setAttribute("height", scene.bodyGroup.attribute.height), scene.rowHeaderGroup.setAttribute("y", scene.bodyGroup.attribute.y), scene.cornerHeaderGroup.setAttribute("height", scene.colHeaderGroup.attribute.height);
|
|
39839
39849
|
for (let i = 0; i < scene.table.frozenColCount - scene.frozenColCount; i++) moveColumnFromBodyToRowHeader(scene), moveColumnFromColHeaderToCornerHeader(scene), moveColumnFromBottomToLeftBottomCorner(scene);
|
|
39840
39850
|
}
|
|
39841
|
-
updateReactComponentContainer(scene), scene.recreateAllSelectRangeComponents(), scene.frozenColCount = scene.table.frozenColCount, scene.frozenRowCount = null !== (_b = null === (_a = scene.colHeaderGroup.firstChild) || void 0 === _a ? void 0 : _a.childrenCount) && void 0 !== _b ? _b : 0, scene.proxy.colStart = null !== (
|
|
39851
|
+
updateReactComponentContainer(scene), scene.recreateAllSelectRangeComponents(), scene.frozenColCount = scene.table.frozenColCount, scene.frozenRowCount = null !== (_d = null !== (_b = null === (_a = scene.colHeaderGroup.firstChild) || void 0 === _a ? void 0 : _a.childrenCount) && void 0 !== _b ? _b : null === (_c = scene.cornerHeaderGroup.firstChild) || void 0 === _c ? void 0 : _c.childrenCount) && void 0 !== _d ? _d : scene.table.frozenRowCount, scene.proxy.colStart = null !== (_f = null === (_e = scene.bodyGroup.firstChild) || void 0 === _e ? void 0 : _e.col) && void 0 !== _f ? _f : scene.table.frozenColCount, scene.bodyGroup.setAttribute("x", scene.rowHeaderGroup.attribute.width), scene.colHeaderGroup.setAttribute("x", scene.cornerHeaderGroup.attribute.width), scene.updateContainer(), scene.updateBorderSizeAndPosition(), scene.isPivot || scene.table.transpose ? scene.table.options.frozenColCount ? scene.component.setFrozenColumnShadow(scene.table.frozenColCount - 1) : scene.table.options.rightFrozenColCount && scene.component.setRightFrozenColumnShadow(scene.table.colCount - scene.table.rightFrozenColCount) : (scene.component.setFrozenColumnShadow(scene.table.frozenColCount - 1), scene.component.setRightFrozenColumnShadow(scene.table.colCount - scene.table.rightFrozenColCount)), scene.hasFrozen = !0;
|
|
39842
39852
|
}
|
|
39843
39853
|
function moveColumnFromBodyToRowHeader(scene) {
|
|
39844
39854
|
const column = scene.bodyGroup.firstChild instanceof Group ? scene.bodyGroup.firstChild : null;
|
|
@@ -41690,7 +41700,7 @@
|
|
|
41690
41700
|
} : table.getCellRange(col, row);
|
|
41691
41701
|
currentRange.start.col < cellRange.end.col ? currentRange.end.col = cellRange.end.col : currentRange.start.col > cellRange.start.col && (currentRange.end.col = cellRange.start.col), currentRange.start.row < cellRange.end.row ? currentRange.end.row = cellRange.end.row : currentRange.start.row > cellRange.start.row && (currentRange.end.row = cellRange.start.row), "body" === state.select.headerSelectMode && (table.isRowHeader(col, row) ? (currentRange.start.col = table.rowHeaderLevelCount + table.leftRowSeriesNumberCount, currentRange.end.col = table.colCount - 1) : table.isColumnHeader(col, row) ? (currentRange.start.row = table.columnHeaderLevelCount, currentRange.end.row = table.rowCount - 1) : table.internalProps.layoutMap.isSeriesNumberInBody(col, row) ? (currentRange.start.col = table.leftRowSeriesNumberCount, currentRange.end.col = table.colCount - 1) : table.isCornerHeader(col, row) ? (currentRange.start.col = table.rowHeaderLevelCount + table.leftRowSeriesNumberCount, currentRange.start.row = table.columnHeaderLevelCount, currentRange.end.col = table.colCount - 1, currentRange.end.row = table.rowCount - 1) : table.isSeriesNumber(col, row) && (currentRange.start.col = table.leftRowSeriesNumberCount, currentRange.start.row = table.columnHeaderLevelCount, currentRange.end.col = table.colCount - 1, currentRange.end.row = table.rowCount - 1)), skipBodyMerge && (currentRange.skipBodyMerge = !0);
|
|
41692
41702
|
}
|
|
41693
|
-
scenegraph.updateCellSelectBorder(currentRange, extendSelectRange);
|
|
41703
|
+
currentRange && currentRange.start.row <= table.rowCount - 1 && currentRange.end.row <= table.rowCount - 1 && currentRange.start.col <= table.colCount - 1 && currentRange.end.col <= table.colCount - 1 && scenegraph.updateCellSelectBorder(currentRange, extendSelectRange);
|
|
41694
41704
|
}
|
|
41695
41705
|
}
|
|
41696
41706
|
} else {
|
|
@@ -41888,7 +41898,7 @@
|
|
|
41888
41898
|
}
|
|
41889
41899
|
cellPos.col = col, cellPos.row = row;
|
|
41890
41900
|
const currentRange = null === (_b = state.select.ranges) || void 0 === _b ? void 0 : _b[state.select.ranges.length - 1];
|
|
41891
|
-
currentRange && scenegraph.updateCellSelectBorder(currentRange, extendSelectRange);
|
|
41901
|
+
currentRange && currentRange.start.row <= table.rowCount - 1 && currentRange.end.row <= table.rowCount - 1 && currentRange.start.col <= table.colCount - 1 && currentRange.end.col <= table.colCount - 1 && scenegraph.updateCellSelectBorder(currentRange, extendSelectRange);
|
|
41892
41902
|
}
|
|
41893
41903
|
}
|
|
41894
41904
|
} else cellPos.col = -1, cellPos.row = -1, state.select.ranges = [], scenegraph.deleteAllSelectBorder();
|
|
@@ -42951,76 +42961,108 @@
|
|
|
42951
42961
|
var _a, _b;
|
|
42952
42962
|
const totalHeight = this.table.getAllRowsHeight(),
|
|
42953
42963
|
oldVerticalBarPos = this.scroll.verticalBarPos;
|
|
42954
|
-
|
|
42964
|
+
let verticalBarPos = Math.ceil(yRatio * (totalHeight - this.table.scenegraph.height));
|
|
42965
|
+
isValid$3(verticalBarPos) && !isNaN(verticalBarPos) || (verticalBarPos = 0);
|
|
42966
|
+
const dy = verticalBarPos - this.table.scenegraph.proxy.deltaY - oldVerticalBarPos;
|
|
42967
|
+
if (this.table.fireListeners(TABLE_EVENT_TYPE.SCROLL, {
|
|
42955
42968
|
event: void 0,
|
|
42956
|
-
scrollTop: this.
|
|
42969
|
+
scrollTop: verticalBarPos - this.table.scenegraph.proxy.deltaY,
|
|
42957
42970
|
scrollLeft: this.scroll.horizontalBarPos,
|
|
42958
42971
|
scrollHeight: null === (_a = this.table.theme.scrollStyle) || void 0 === _a ? void 0 : _a.width,
|
|
42959
42972
|
scrollWidth: null === (_b = this.table.theme.scrollStyle) || void 0 === _b ? void 0 : _b.width,
|
|
42960
42973
|
viewHeight: this.table.tableNoFrameHeight,
|
|
42961
42974
|
viewWidth: this.table.tableNoFrameWidth,
|
|
42962
42975
|
scrollDirection: "vertical",
|
|
42963
|
-
scrollRatioY: yRatio
|
|
42964
|
-
|
|
42976
|
+
scrollRatioY: yRatio,
|
|
42977
|
+
dy: dy
|
|
42978
|
+
}).some(value => !1 === value)) {
|
|
42979
|
+
const yRatio = this.scroll.verticalBarPos / (totalHeight - this.table.scenegraph.height);
|
|
42980
|
+
this.table.scenegraph.component.updateVerticalScrollBarPos(yRatio);
|
|
42981
|
+
} else this.scroll.verticalBarPos = verticalBarPos, this.table.scenegraph.setY(-this.scroll.verticalBarPos, 1 === yRatio), this.scroll.verticalBarPos -= this.table.scenegraph.proxy.deltaY, this.table.scenegraph.proxy.deltaY = 0, this.updateHoverPos(-1, -1), oldVerticalBarPos !== this.scroll.verticalBarPos && this.checkVerticalScrollBarEnd();
|
|
42965
42982
|
}
|
|
42966
42983
|
updateHorizontalScrollBar(xRatio) {
|
|
42967
42984
|
var _a, _b;
|
|
42968
42985
|
const totalWidth = this.table.getAllColsWidth(),
|
|
42969
42986
|
oldHorizontalBarPos = this.scroll.horizontalBarPos;
|
|
42970
|
-
|
|
42987
|
+
let horizontalBarPos = Math.ceil(xRatio * (totalWidth - this.table.scenegraph.width));
|
|
42988
|
+
isValid$3(horizontalBarPos) && !isNaN(horizontalBarPos) || (horizontalBarPos = 0);
|
|
42989
|
+
const dx = horizontalBarPos - this.table.scenegraph.proxy.deltaX - oldHorizontalBarPos;
|
|
42990
|
+
if (this.table.fireListeners(TABLE_EVENT_TYPE.SCROLL, {
|
|
42971
42991
|
event: void 0,
|
|
42972
42992
|
scrollTop: this.scroll.verticalBarPos,
|
|
42973
|
-
scrollLeft: this.
|
|
42993
|
+
scrollLeft: horizontalBarPos - this.table.scenegraph.proxy.deltaX,
|
|
42974
42994
|
scrollHeight: null === (_a = this.table.theme.scrollStyle) || void 0 === _a ? void 0 : _a.width,
|
|
42975
42995
|
scrollWidth: null === (_b = this.table.theme.scrollStyle) || void 0 === _b ? void 0 : _b.width,
|
|
42976
42996
|
viewHeight: this.table.tableNoFrameHeight,
|
|
42977
42997
|
viewWidth: this.table.tableNoFrameWidth,
|
|
42978
42998
|
scrollDirection: "horizontal",
|
|
42979
|
-
scrollRatioX: xRatio
|
|
42980
|
-
|
|
42999
|
+
scrollRatioX: xRatio,
|
|
43000
|
+
dx: dx
|
|
43001
|
+
}).some(value => !1 === value)) {
|
|
43002
|
+
const xRatio = this.scroll.horizontalBarPos / (totalWidth - this.table.scenegraph.width);
|
|
43003
|
+
this.table.scenegraph.component.updateHorizontalScrollBarPos(xRatio);
|
|
43004
|
+
} else this.scroll.horizontalBarPos = horizontalBarPos, this.table.scenegraph.setX(-this.scroll.horizontalBarPos, 1 === xRatio), this.scroll.horizontalBarPos -= this.table.scenegraph.proxy.deltaX, this.table.scenegraph.proxy.deltaX = 0, this.updateHoverPos(-1, -1), oldHorizontalBarPos !== this.scroll.horizontalBarPos && this.checkHorizontalScrollBarEnd();
|
|
42981
43005
|
}
|
|
42982
43006
|
setScrollTop(top, event) {
|
|
42983
43007
|
let triggerEvent = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : !0;
|
|
42984
|
-
var _a, _b, _c;
|
|
43008
|
+
var _a, _b, _c, _d, _e;
|
|
42985
43009
|
const totalHeight = this.table.getAllRowsHeight(),
|
|
42986
43010
|
sizeTolerance = (null === (_a = this.table.options.customConfig) || void 0 === _a ? void 0 : _a._disableColumnAndRowSizeRound) ? 1 : 0;
|
|
42987
|
-
top = Math.max(0, Math.min(top, totalHeight - this.table.scenegraph.height - sizeTolerance)),
|
|
42988
|
-
const oldVerticalBarPos = this.scroll.verticalBarPos
|
|
42989
|
-
|
|
42990
|
-
|
|
42991
|
-
|
|
42992
|
-
|
|
42993
|
-
|
|
42994
|
-
|
|
42995
|
-
|
|
42996
|
-
|
|
42997
|
-
|
|
42998
|
-
|
|
42999
|
-
|
|
43000
|
-
|
|
43001
|
-
|
|
43011
|
+
top = Math.max(0, Math.min(top, totalHeight - this.table.scenegraph.height - sizeTolerance)), top = Math.ceil(top);
|
|
43012
|
+
const oldVerticalBarPos = this.scroll.verticalBarPos,
|
|
43013
|
+
yRatio = top / (totalHeight - this.table.scenegraph.height);
|
|
43014
|
+
if ((oldVerticalBarPos !== top || !0 === (null === (_c = null === (_b = this.table.options) || void 0 === _b ? void 0 : _b.customConfig) || void 0 === _c ? void 0 : _c.scrollEventAlwaysTrigger)) && triggerEvent) {
|
|
43015
|
+
let verticalBarPos = top;
|
|
43016
|
+
isValid$3(verticalBarPos) && !isNaN(verticalBarPos) || (verticalBarPos = 0);
|
|
43017
|
+
const dy = verticalBarPos - oldVerticalBarPos;
|
|
43018
|
+
if (this.table.fireListeners(TABLE_EVENT_TYPE.SCROLL, {
|
|
43019
|
+
event: null == event ? void 0 : event.nativeEvent,
|
|
43020
|
+
scrollTop: verticalBarPos,
|
|
43021
|
+
scrollLeft: this.scroll.horizontalBarPos,
|
|
43022
|
+
scrollHeight: null === (_d = this.table.theme.scrollStyle) || void 0 === _d ? void 0 : _d.width,
|
|
43023
|
+
scrollWidth: null === (_e = this.table.theme.scrollStyle) || void 0 === _e ? void 0 : _e.width,
|
|
43024
|
+
viewHeight: this.table.tableNoFrameHeight,
|
|
43025
|
+
viewWidth: this.table.tableNoFrameWidth,
|
|
43026
|
+
scrollDirection: "vertical",
|
|
43027
|
+
scrollRatioY: yRatio,
|
|
43028
|
+
dy: dy
|
|
43029
|
+
}).some(value => !1 === value)) {
|
|
43030
|
+
const yRatio = this.scroll.verticalBarPos / (totalHeight - this.table.scenegraph.height);
|
|
43031
|
+
return void this.table.scenegraph.component.updateVerticalScrollBarPos(yRatio);
|
|
43032
|
+
}
|
|
43033
|
+
}
|
|
43034
|
+
(top !== this.scroll.verticalBarPos || this.table.isPivotChart()) && this.updateHoverPos(-1, -1), this.scroll.verticalBarPos = top, isValid$3(this.scroll.verticalBarPos) && !isNaN(this.scroll.verticalBarPos) || (this.scroll.verticalBarPos = 0), this.table.scenegraph.setY(-top), this.table.scenegraph.component.updateVerticalScrollBarPos(yRatio), oldVerticalBarPos !== top && triggerEvent && this.checkVerticalScrollBarEnd();
|
|
43002
43035
|
}
|
|
43003
43036
|
setScrollLeft(left, event) {
|
|
43004
43037
|
let triggerEvent = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : !0;
|
|
43005
|
-
var _a, _b, _c;
|
|
43038
|
+
var _a, _b, _c, _d, _e;
|
|
43006
43039
|
this.table.scrollLeft;
|
|
43007
43040
|
const totalWidth = this.table.getAllColsWidth(),
|
|
43008
43041
|
sizeTolerance = (this.table.getFrozenColsWidth(), (null === (_a = this.table.options.customConfig) || void 0 === _a ? void 0 : _a._disableColumnAndRowSizeRound) ? 1 : 0);
|
|
43009
|
-
left = Math.max(0, Math.min(left, totalWidth - this.table.scenegraph.width - sizeTolerance)),
|
|
43010
|
-
const oldHorizontalBarPos = this.scroll.horizontalBarPos
|
|
43011
|
-
|
|
43012
|
-
|
|
43013
|
-
|
|
43014
|
-
|
|
43015
|
-
|
|
43016
|
-
|
|
43017
|
-
|
|
43018
|
-
|
|
43019
|
-
|
|
43020
|
-
|
|
43021
|
-
|
|
43022
|
-
|
|
43023
|
-
|
|
43042
|
+
left = Math.max(0, Math.min(left, totalWidth - this.table.scenegraph.width - sizeTolerance)), left = Math.ceil(left);
|
|
43043
|
+
const oldHorizontalBarPos = this.scroll.horizontalBarPos,
|
|
43044
|
+
xRatio = left / (totalWidth - this.table.scenegraph.width);
|
|
43045
|
+
if ((oldHorizontalBarPos !== left || !0 === (null === (_c = null === (_b = this.table.options) || void 0 === _b ? void 0 : _b.customConfig) || void 0 === _c ? void 0 : _c.scrollEventAlwaysTrigger)) && triggerEvent) {
|
|
43046
|
+
let horizontalBarPos = left;
|
|
43047
|
+
isValid$3(horizontalBarPos) && !isNaN(horizontalBarPos) || (horizontalBarPos = 0);
|
|
43048
|
+
const dx = horizontalBarPos - oldHorizontalBarPos;
|
|
43049
|
+
if (this.table.fireListeners(TABLE_EVENT_TYPE.SCROLL, {
|
|
43050
|
+
event: null == event ? void 0 : event.nativeEvent,
|
|
43051
|
+
scrollTop: this.scroll.verticalBarPos,
|
|
43052
|
+
scrollLeft: horizontalBarPos,
|
|
43053
|
+
scrollHeight: null === (_d = this.table.theme.scrollStyle) || void 0 === _d ? void 0 : _d.width,
|
|
43054
|
+
scrollWidth: null === (_e = this.table.theme.scrollStyle) || void 0 === _e ? void 0 : _e.width,
|
|
43055
|
+
viewHeight: this.table.tableNoFrameHeight,
|
|
43056
|
+
viewWidth: this.table.tableNoFrameWidth,
|
|
43057
|
+
scrollDirection: "horizontal",
|
|
43058
|
+
scrollRatioX: xRatio,
|
|
43059
|
+
dx: dx
|
|
43060
|
+
}).some(value => !1 === value)) {
|
|
43061
|
+
const xRatio = this.scroll.horizontalBarPos / (totalWidth - this.table.scenegraph.width);
|
|
43062
|
+
return void this.table.scenegraph.component.updateHorizontalScrollBarPos(xRatio);
|
|
43063
|
+
}
|
|
43064
|
+
}
|
|
43065
|
+
left !== this.scroll.horizontalBarPos && this.updateHoverPos(-1, -1), this.scroll.horizontalBarPos = left, isValid$3(this.scroll.horizontalBarPos) && !isNaN(this.scroll.horizontalBarPos) || (this.scroll.horizontalBarPos = 0), this.table.scenegraph.setX(-left), this.table.scenegraph.component.updateHorizontalScrollBarPos(xRatio), oldHorizontalBarPos !== left && triggerEvent && this.checkHorizontalScrollBarEnd();
|
|
43024
43066
|
}
|
|
43025
43067
|
hideVerticalScrollBar() {
|
|
43026
43068
|
this.table.scenegraph.component.hideVerticalScrollBar();
|
|
@@ -43653,7 +43695,7 @@
|
|
|
43653
43695
|
callback: globalPointerdownCallback
|
|
43654
43696
|
}), vglobal.addEventListener("pointerup", globalPointerupCallback), vglobal.addEventListener("pointerdown", globalPointerdownCallback), table.scenegraph.tableGroup.addEventListener("pointerdown", e => {
|
|
43655
43697
|
var _a, _b, _c, _d, _e;
|
|
43656
|
-
table.hasListeners(TABLE_EVENT_TYPE.MOUSEDOWN_TABLE) && table.fireListeners(TABLE_EVENT_TYPE.MOUSEDOWN_TABLE, {
|
|
43698
|
+
if (table.hasListeners(TABLE_EVENT_TYPE.MOUSEDOWN_TABLE) && table.fireListeners(TABLE_EVENT_TYPE.MOUSEDOWN_TABLE, {
|
|
43657
43699
|
event: e.nativeEvent
|
|
43658
43700
|
}), table.eventManager.isDown = !0, table.eventManager.LastBodyPointerXY = {
|
|
43659
43701
|
x: e.x,
|
|
@@ -43661,7 +43703,7 @@
|
|
|
43661
43703
|
}, table.eventManager.LastPointerXY = {
|
|
43662
43704
|
x: e.x,
|
|
43663
43705
|
y: e.y
|
|
43664
|
-
};
|
|
43706
|
+
}, 0 !== e.button) return;
|
|
43665
43707
|
const eventArgsSet = getCellEventArgsSet(e);
|
|
43666
43708
|
if (eventManager.downIcon = void 0, stateManager.interactionState !== InteractionState.default) return;
|
|
43667
43709
|
if (table.isPivotChart() && "chart" !== (null === (_a = null == eventArgsSet ? void 0 : eventArgsSet.eventArgs) || void 0 === _a ? void 0 : _a.target.type) && table.scenegraph.updateChartState(null), (null === (_b = eventArgsSet.eventArgs) || void 0 === _b ? void 0 : _b.target) !== (null === (_c = stateManager.residentHoverIcon) || void 0 === _c ? void 0 : _c.icon) && stateManager.hideMenu(), "chart" === (null === (_d = null == eventArgsSet ? void 0 : eventArgsSet.eventArgs) || void 0 === _d ? void 0 : _d.target.type)) return;
|
|
@@ -44237,7 +44279,7 @@
|
|
|
44237
44279
|
}
|
|
44238
44280
|
}), handler.on(table.getElement(), "contextmenu", e => {
|
|
44239
44281
|
var _a;
|
|
44240
|
-
!1 !== (null === (_a = table.eventOptions) || void 0 === _a ? void 0 : _a.preventDefaultContextMenu)
|
|
44282
|
+
!1 !== (null === (_a = table.eventOptions) || void 0 === _a ? void 0 : _a.preventDefaultContextMenu) ? e.preventDefault() : globalPointerupCallback(e);
|
|
44241
44283
|
}), table.options.canvas || handler.on(table.getContainer(), "resize", e => {
|
|
44242
44284
|
var _a;
|
|
44243
44285
|
table.isReleased || 0 === e.width && 0 === e.height || ((table.autoFillWidth || table.autoFillHeight) && (null === (_a = table.editorManager) || void 0 === _a || _a.completeEdit()), isValid$3(table.options.pixelRatio) || table.setPixelRatio(getPixelRatio()), e.windowSizeNotChange || table.resize());
|
|
@@ -44668,6 +44710,75 @@
|
|
|
44668
44710
|
});
|
|
44669
44711
|
}
|
|
44670
44712
|
|
|
44713
|
+
function bindIconClickEvent(table) {
|
|
44714
|
+
table.on(TABLE_EVENT_TYPE.ICON_CLICK, iconInfo => {
|
|
44715
|
+
var _a;
|
|
44716
|
+
const {
|
|
44717
|
+
col: col,
|
|
44718
|
+
row: row,
|
|
44719
|
+
x: x,
|
|
44720
|
+
y: y,
|
|
44721
|
+
funcType: funcType,
|
|
44722
|
+
icon: icon,
|
|
44723
|
+
event: event
|
|
44724
|
+
} = iconInfo,
|
|
44725
|
+
{
|
|
44726
|
+
stateManager: stateManager
|
|
44727
|
+
} = table;
|
|
44728
|
+
if (funcType === IconFuncTypeEnum.dropDown) stateManager.triggerDropDownMenu(col, row, x, y, event);else if (funcType === IconFuncTypeEnum.sort) stateManager.triggerSort(col, row, icon, event);else if (funcType === IconFuncTypeEnum.frozen) stateManager.triggerFreeze(col, row, icon);else if (funcType === IconFuncTypeEnum.drillDown) drillClick(table);else if (funcType === IconFuncTypeEnum.collapse || funcType === IconFuncTypeEnum.expand) {
|
|
44729
|
+
const isHasSelected = !!(null === (_a = stateManager.select.ranges) || void 0 === _a ? void 0 : _a.length);
|
|
44730
|
+
stateManager.updateSelectPos(-1, -1), stateManager.endSelectCells(!0, isHasSelected), table.toggleHierarchyState(col, row);
|
|
44731
|
+
}
|
|
44732
|
+
});
|
|
44733
|
+
}
|
|
44734
|
+
|
|
44735
|
+
function bindDropdownMenuClickEvent(table) {
|
|
44736
|
+
table.on(TABLE_EVENT_TYPE.DROPDOWN_MENU_CLICK, () => {
|
|
44737
|
+
table.stateManager.hideMenu();
|
|
44738
|
+
});
|
|
44739
|
+
}
|
|
44740
|
+
|
|
44741
|
+
function bindDBClickAutoColumnWidthEvent(table) {
|
|
44742
|
+
table.on(TABLE_EVENT_TYPE.DBLCLICK_CELL, e => {
|
|
44743
|
+
var _a, _b, _c;
|
|
44744
|
+
if (e.federatedEvent) {
|
|
44745
|
+
const eventArgsSet = getCellEventArgsSet(e.federatedEvent),
|
|
44746
|
+
resizeCol = table.scenegraph.getResizeColAt(eventArgsSet.abstractPos.x, eventArgsSet.abstractPos.y, null === (_a = eventArgsSet.eventArgs) || void 0 === _a ? void 0 : _a.targetCell),
|
|
44747
|
+
disableDblclickAutoResizeColWidth = null !== (_b = table.options.disableDblclickAutoResizeColWidth) && void 0 !== _b ? _b : null === (_c = table.options.resize) || void 0 === _c ? void 0 : _c.disableDblclickAutoResizeColWidth;
|
|
44748
|
+
if (table.eventManager.checkCellFillhandle(eventArgsSet)) table.fireListeners(TABLE_EVENT_TYPE.DBLCLICK_FILL_HANDLE, {});else if (table._canResizeColumn(resizeCol.col, resizeCol.row) && resizeCol.col >= 0 && !disableDblclickAutoResizeColWidth) {
|
|
44749
|
+
table.scenegraph.updateAutoColWidth(resizeCol.col), table.internalProps._widthResizedColMap.add(resizeCol.col), table.scenegraph.updateChartSizeForResizeColWidth(resizeCol.col);
|
|
44750
|
+
const state = table.stateManager;
|
|
44751
|
+
state.columnResize.col < state.table.frozenColCount && !state.table.isPivotTable() && !state.table.transpose && state.table.scenegraph.component.setFrozenColumnShadow(state.table.frozenColCount - 1, state.columnResize.isRightFrozen);
|
|
44752
|
+
const colWidths = [];
|
|
44753
|
+
for (let col = 0; col < table.colCount; col++) colWidths.push(table.getColWidth(col));
|
|
44754
|
+
table.fireListeners(TABLE_EVENT_TYPE.RESIZE_COLUMN_END, {
|
|
44755
|
+
col: resizeCol.col,
|
|
44756
|
+
colWidths: colWidths
|
|
44757
|
+
});
|
|
44758
|
+
}
|
|
44759
|
+
}
|
|
44760
|
+
});
|
|
44761
|
+
}
|
|
44762
|
+
|
|
44763
|
+
function rightButtonClickEvent(table) {
|
|
44764
|
+
table.on(TABLE_EVENT_TYPE.CONTEXTMENU_CELL, e => {
|
|
44765
|
+
const {
|
|
44766
|
+
col: col,
|
|
44767
|
+
row: row
|
|
44768
|
+
} = e,
|
|
44769
|
+
ranges = table.getSelectedCellRanges();
|
|
44770
|
+
let cellInRange = !1;
|
|
44771
|
+
if (ranges.length > 0) for (let i = 0; i < ranges.length; i++) {
|
|
44772
|
+
const range = ranges[i];
|
|
44773
|
+
if (col >= range.start.col && col <= range.end.col && row >= range.start.row && row <= range.end.row) {
|
|
44774
|
+
cellInRange = !0;
|
|
44775
|
+
break;
|
|
44776
|
+
}
|
|
44777
|
+
}
|
|
44778
|
+
cellInRange || table.selectCell(col, row);
|
|
44779
|
+
});
|
|
44780
|
+
}
|
|
44781
|
+
|
|
44671
44782
|
class EventManager {
|
|
44672
44783
|
constructor(table) {
|
|
44673
44784
|
this.isDown = !1, this.isDraging = !1, this.globalEventListeners = [], this._enableTableScroll = !0, this.table = table, this.handleTextStickBindId = [], this.inertiaScroll = new InertiaScroll(table.stateManager), "node" === Env.mode || table.options.disableInteraction || (this.bindOuterEvent(), setTimeout(() => {
|
|
@@ -44692,44 +44803,7 @@
|
|
|
44692
44803
|
}, 0);
|
|
44693
44804
|
}
|
|
44694
44805
|
bindSelfEvent() {
|
|
44695
|
-
|
|
44696
|
-
const stateManager = this.table.stateManager;
|
|
44697
|
-
this.table.on(TABLE_EVENT_TYPE.ICON_CLICK, iconInfo => {
|
|
44698
|
-
var _a;
|
|
44699
|
-
const {
|
|
44700
|
-
col: col,
|
|
44701
|
-
row: row,
|
|
44702
|
-
x: x,
|
|
44703
|
-
y: y,
|
|
44704
|
-
funcType: funcType,
|
|
44705
|
-
icon: icon,
|
|
44706
|
-
event: event
|
|
44707
|
-
} = iconInfo;
|
|
44708
|
-
if (funcType === IconFuncTypeEnum.dropDown) stateManager.triggerDropDownMenu(col, row, x, y, event);else if (funcType === IconFuncTypeEnum.sort) stateManager.triggerSort(col, row, icon, event);else if (funcType === IconFuncTypeEnum.frozen) stateManager.triggerFreeze(col, row, icon);else if (funcType === IconFuncTypeEnum.drillDown) drillClick(this.table);else if (funcType === IconFuncTypeEnum.collapse || funcType === IconFuncTypeEnum.expand) {
|
|
44709
|
-
const isHasSelected = !!(null === (_a = stateManager.select.ranges) || void 0 === _a ? void 0 : _a.length);
|
|
44710
|
-
stateManager.updateSelectPos(-1, -1), stateManager.endSelectCells(!0, isHasSelected), this.table.toggleHierarchyState(col, row);
|
|
44711
|
-
}
|
|
44712
|
-
}), this.table.on(TABLE_EVENT_TYPE.DROPDOWN_MENU_CLICK, () => {
|
|
44713
|
-
stateManager.hideMenu();
|
|
44714
|
-
}), this.updateEventBinder(), bindMediaClick(this.table), this.table.on(TABLE_EVENT_TYPE.DBLCLICK_CELL, e => {
|
|
44715
|
-
var _a, _b, _c;
|
|
44716
|
-
if (e.federatedEvent) {
|
|
44717
|
-
const eventArgsSet = getCellEventArgsSet(e.federatedEvent),
|
|
44718
|
-
resizeCol = this.table.scenegraph.getResizeColAt(eventArgsSet.abstractPos.x, eventArgsSet.abstractPos.y, null === (_a = eventArgsSet.eventArgs) || void 0 === _a ? void 0 : _a.targetCell),
|
|
44719
|
-
disableDblclickAutoResizeColWidth = null !== (_b = this.table.options.disableDblclickAutoResizeColWidth) && void 0 !== _b ? _b : null === (_c = this.table.options.resize) || void 0 === _c ? void 0 : _c.disableDblclickAutoResizeColWidth;
|
|
44720
|
-
if (this.table.eventManager.checkCellFillhandle(eventArgsSet)) this.table.fireListeners(TABLE_EVENT_TYPE.DBLCLICK_FILL_HANDLE, {});else if (this.table._canResizeColumn(resizeCol.col, resizeCol.row) && resizeCol.col >= 0 && !disableDblclickAutoResizeColWidth) {
|
|
44721
|
-
this.table.scenegraph.updateAutoColWidth(resizeCol.col), this.table.internalProps._widthResizedColMap.add(resizeCol.col), this.table.scenegraph.updateChartSizeForResizeColWidth(resizeCol.col);
|
|
44722
|
-
const state = this.table.stateManager;
|
|
44723
|
-
state.columnResize.col < state.table.frozenColCount && !state.table.isPivotTable() && !state.table.transpose && state.table.scenegraph.component.setFrozenColumnShadow(state.table.frozenColCount - 1, state.columnResize.isRightFrozen);
|
|
44724
|
-
const colWidths = [];
|
|
44725
|
-
for (let col = 0; col < this.table.colCount; col++) colWidths.push(this.table.getColWidth(col));
|
|
44726
|
-
this.table.fireListeners(TABLE_EVENT_TYPE.RESIZE_COLUMN_END, {
|
|
44727
|
-
col: resizeCol.col,
|
|
44728
|
-
colWidths: colWidths
|
|
44729
|
-
});
|
|
44730
|
-
}
|
|
44731
|
-
}
|
|
44732
|
-
}), this.table.isPivotTable() && checkHaveDrill(this.table) && bindDrillEvent(this.table), bindSparklineHoverEvent(this.table), bindAxisClickEvent(this.table), bindAxisHoverEvent(this.table), bindGroupTitleCheckboxChange(this.table), bindButtonClickEvent(this.table);
|
|
44806
|
+
this.table.isReleased || (bindIconClickEvent(this.table), bindDropdownMenuClickEvent(this.table), this.updateEventBinder(), bindMediaClick(this.table), bindDBClickAutoColumnWidthEvent(this.table), this.table.isPivotTable() && checkHaveDrill(this.table) && bindDrillEvent(this.table), bindSparklineHoverEvent(this.table), bindAxisClickEvent(this.table), bindAxisHoverEvent(this.table), bindGroupTitleCheckboxChange(this.table), bindButtonClickEvent(this.table), rightButtonClickEvent(this.table));
|
|
44733
44807
|
}
|
|
44734
44808
|
dealTableHover(eventArgsSet) {
|
|
44735
44809
|
if (!eventArgsSet) return void this.table.stateManager.updateHoverPos(-1, -1);
|
|
@@ -47480,7 +47554,7 @@
|
|
|
47480
47554
|
constructor(container) {
|
|
47481
47555
|
let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
47482
47556
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
|
|
47483
|
-
if (super(), this.showFrozenIcon = !0, this.version = "1.17.3-alpha.
|
|
47557
|
+
if (super(), this.showFrozenIcon = !0, this.version = "1.17.3-alpha.12", this.id = `VTable${Date.now()}`, this.isReleased = !1, this._chartEventMap = {}, this.throttleInvalidate = throttle2(this.render.bind(this), 200), !container && "node" !== options.mode && !options.canvas) throw new Error("vtable's container is undefined");
|
|
47484
47558
|
!1 === (null === (_a = options.customConfig) || void 0 === _a ? void 0 : _a.imageAnonymous) && (vglobal.isImageAnonymous = !1);
|
|
47485
47559
|
const {
|
|
47486
47560
|
frozenColCount = 0,
|
|
@@ -47528,7 +47602,7 @@
|
|
|
47528
47602
|
right: 0,
|
|
47529
47603
|
left: 0,
|
|
47530
47604
|
bottom: 0
|
|
47531
|
-
}, padding && ("number" == typeof padding ? (this.padding.top = padding, this.padding.left = padding, this.padding.bottom = padding, this.padding.right = padding) : (padding.top && (this.padding.top = padding.top), padding.bottom && (this.padding.bottom = padding.bottom), padding.left && (this.padding.left = padding.left), padding.right && (this.padding.right = padding.right))), isValid$3(canvasHeight)
|
|
47605
|
+
}, padding && ("number" == typeof padding ? (this.padding.top = padding, this.padding.left = padding, this.padding.bottom = padding, this.padding.right = padding) : (padding.top && (this.padding.top = padding.top), padding.bottom && (this.padding.bottom = padding.bottom), padding.left && (this.padding.left = padding.left), padding.right && (this.padding.right = padding.right))), (isValid$3(canvasHeight) || isValid$3(canvasWidth)) && (this.canvasSizeSeted = !0), this.tableNoFrameWidth = 0, this.tableNoFrameHeight = 0, this.canvasWidth = isNumber$4(canvasWidth) ? canvasWidth : void 0, this.canvasHeight = isNumber$4(canvasHeight) ? canvasHeight : void 0, this.columnWidthComputeMode = null !== (_b = options.columnWidthComputeMode) && void 0 !== _b ? _b : "normal";
|
|
47532
47606
|
const internalProps = this.internalProps = {};
|
|
47533
47607
|
void 0 !== showFrozenIcon && (this.showFrozenIcon = showFrozenIcon), "number" == typeof allowFrozenColCount && allowFrozenColCount <= 0 && (this.showFrozenIcon = !1), this.options.canvas ? ("node" !== Env.mode && (internalProps.element = this.options.canvas.parentElement, internalProps.element.style.position = "relative"), internalProps.focusControl = new FocusInput(this, internalProps.element), internalProps.canvas = this.options.canvas, internalProps.context = internalProps.canvas.getContext("2d")) : "node" !== Env.mode && (internalProps.element = createRootElement(this.padding), internalProps.focusControl = new FocusInput(this, internalProps.element), internalProps.canvas = document.createElement("canvas"), internalProps.element.appendChild(internalProps.canvas), internalProps.context = internalProps.canvas.getContext("2d"), (null === (_c = options.customConfig) || void 0 === _c ? void 0 : _c.createReactContainer) && createReactContainer(this)), internalProps.handler = new EventHandler(), isNumber$4(this.options.resizeTime) && (internalProps.handler.resizeTime = this.options.resizeTime), internalProps.pixelRatio = pixelRatio, internalProps.frozenColCount = frozenColCount, internalProps.frozenRowCount = frozenRowCount, internalProps.unfreezeAllOnExceedsMaxWidth = null == unfreezeAllOnExceedsMaxWidth || unfreezeAllOnExceedsMaxWidth, internalProps.defaultRowHeight = defaultRowHeight, internalProps.defaultHeaderRowHeight = null != defaultHeaderRowHeight ? defaultHeaderRowHeight : defaultRowHeight, internalProps.defaultColWidth = defaultColWidth, internalProps.defaultHeaderColWidth = null != defaultHeaderColWidth ? defaultHeaderColWidth : defaultColWidth, internalProps.keyboardOptions = keyboardOptions, internalProps.eventOptions = eventOptions, internalProps.rowSeriesNumber = rowSeriesNumber, internalProps.columnResizeMode = null !== (_d = null == resize ? void 0 : resize.columnResizeMode) && void 0 !== _d ? _d : columnResizeMode, internalProps.rowResizeMode = null !== (_e = null == resize ? void 0 : resize.rowResizeMode) && void 0 !== _e ? _e : rowResizeMode, internalProps.dragHeaderMode = null !== (_g = null !== (_f = null == dragOrder ? void 0 : dragOrder.dragHeaderMode) && void 0 !== _f ? _f : dragHeaderMode) && void 0 !== _g ? _g : "none", internalProps.renderChartAsync = renderChartAsync, setBatchRenderChartCount(renderChartAsyncBatchCount), internalProps.overscrollBehavior = null != overscrollBehavior ? overscrollBehavior : "auto", internalProps._rowHeightsMap = new NumberRangeMap(this), internalProps._rowRangeHeightsMap = new Map(), internalProps._colRangeWidthsMap = new Map(), internalProps._widthResizedColMap = new Set(), internalProps._heightResizedRowMap = new Set(), this.colWidthsMap = new NumberMap(), this.colContentWidthsMap = new NumberMap(), this.colWidthsLimit = {};
|
|
47534
47608
|
const that = this;
|
|
@@ -47835,7 +47909,7 @@
|
|
|
47835
47909
|
}
|
|
47836
47910
|
}
|
|
47837
47911
|
_updateSize() {
|
|
47838
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1;
|
|
47912
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5;
|
|
47839
47913
|
const {
|
|
47840
47914
|
padding: padding
|
|
47841
47915
|
} = this;
|
|
@@ -47845,28 +47919,31 @@
|
|
|
47845
47919
|
const element = this.getElement();
|
|
47846
47920
|
let widthWithoutPadding = 0,
|
|
47847
47921
|
heightWithoutPadding = 0;
|
|
47848
|
-
|
|
47922
|
+
const isDefWidth = isValid$3(this.canvasWidth),
|
|
47923
|
+
isDefHeight = isValid$3(this.canvasHeight);
|
|
47924
|
+
this.canvasSizeSeted && (isDefWidth && (widthWithoutPadding = this.canvasWidth), isDefHeight && (heightWithoutPadding = this.canvasHeight));
|
|
47925
|
+
if ((!isDefWidth || !isDefHeight) && element.parentElement) {
|
|
47849
47926
|
const computedStyle = element.parentElement.style || window.getComputedStyle(element.parentElement);
|
|
47850
|
-
widthWithoutPadding = element.parentElement.offsetWidth - parseInt(computedStyle.paddingLeft
|
|
47927
|
+
isDefWidth || (widthWithoutPadding = element.parentElement.offsetWidth - (parseInt(computedStyle.paddingLeft, 10) || 0) - (parseInt(computedStyle.paddingRight, 10) || 0)), isDefHeight || (heightWithoutPadding = element.parentElement.offsetHeight - parseInt(computedStyle.paddingTop || "0px", 10) - parseInt(computedStyle.paddingBottom || "0px", 20)), widthWithoutPadding = (null != widthWithoutPadding ? widthWithoutPadding : 1) - (this.options.tableSizeAntiJitter ? 1 : 0), heightWithoutPadding = (null != heightWithoutPadding ? heightWithoutPadding : 1) - (this.options.tableSizeAntiJitter ? 1 : 0);
|
|
47851
47928
|
}
|
|
47852
47929
|
element.style.width = widthWithoutPadding && widthWithoutPadding - padding.left - padding.right + "px" || "0px", element.style.height = heightWithoutPadding && heightWithoutPadding - padding.top - padding.bottom + "px" || "0px";
|
|
47853
47930
|
const {
|
|
47854
47931
|
canvas: canvas
|
|
47855
47932
|
} = this.internalProps;
|
|
47856
|
-
widthP = (null !== (_c = null === (_b = canvas.parentElement) || void 0 === _b ? void 0 : _b.offsetWidth) && void 0 !== _c ? _c : 1) - (this.options.tableSizeAntiJitter ? 1 : 0), heightP = (null !== (_e = null === (_d = canvas.parentElement) || void 0 === _d ? void 0 : _d.offsetHeight) && void 0 !== _e ? _e : 1) - (this.options.tableSizeAntiJitter ? 1 : 0), (null === (_f = null == this ? void 0 : this.scenegraph) || void 0 === _f ? void 0 : _f.stage) ? this.scenegraph.stage.resize(widthP, heightP) : (canvas.style.width = "", canvas.style.height = "", canvas.width = widthP, canvas.height = heightP, canvas.style.width = `${widthP}px`, canvas.style.height = `${heightP}px`);
|
|
47933
|
+
widthP = (null !== (_c = null === (_b = canvas.parentElement) || void 0 === _b ? void 0 : _b.offsetWidth) && void 0 !== _c ? _c : 1) - (this.options.tableSizeAntiJitter ? 1 : 0), heightP = (null !== (_e = null === (_d = canvas.parentElement) || void 0 === _d ? void 0 : _d.offsetHeight) && void 0 !== _e ? _e : 1) - (this.options.tableSizeAntiJitter ? 1 : 0), (null === (_f = null == this ? void 0 : this.scenegraph) || void 0 === _f ? void 0 : _f.stage) ? (null === (_g = this.options) || void 0 === _g ? void 0 : _g.viewBox) && !(null === (_h = this.options) || void 0 === _h ? void 0 : _h.canvas) && this.scenegraph.stage.resize(widthP, heightP) : (canvas.style.width = "", canvas.style.height = "", canvas.width = widthP, canvas.height = heightP, canvas.style.width = `${widthP}px`, canvas.style.height = `${heightP}px`), (null === (_j = this.options) || void 0 === _j ? void 0 : _j.viewBox) && (widthP = this.options.viewBox.x2 - this.options.viewBox.x1, heightP = this.options.viewBox.y2 - this.options.viewBox.y1), (null === (_k = null == this ? void 0 : this.scenegraph) || void 0 === _k ? void 0 : _k.stage) && (this.options.viewBox ? this.scenegraph.stage.setViewBox(this.options.viewBox, !1) : this.scenegraph.stage.resize(widthP, heightP));
|
|
47857
47934
|
} else "node" === Env.mode && (widthP = this.canvasWidth - 1, heightP = this.canvasHeight - 1);
|
|
47858
47935
|
const width = Math.floor(widthP - getVerticalScrollBarSize(this.getTheme().scrollStyle)),
|
|
47859
47936
|
height = Math.floor(heightP - getHorizontalScrollBarSize(this.getTheme().scrollStyle));
|
|
47860
|
-
if (null === (
|
|
47861
|
-
const lineWidths = toBoxArray(null !== (
|
|
47862
|
-
shadowWidths = toBoxArray(null !== (
|
|
47863
|
-
(null === (
|
|
47937
|
+
if (null === (_l = this.internalProps.theme) || void 0 === _l ? void 0 : _l.frameStyle) {
|
|
47938
|
+
const lineWidths = toBoxArray(null !== (_o = null === (_m = this.internalProps.theme.frameStyle) || void 0 === _m ? void 0 : _m.borderLineWidth) && void 0 !== _o ? _o : [null]),
|
|
47939
|
+
shadowWidths = toBoxArray(null !== (_q = null === (_p = this.internalProps.theme.frameStyle) || void 0 === _p ? void 0 : _p.shadowBlur) && void 0 !== _q ? _q : [0]);
|
|
47940
|
+
(null === (_r = this.theme.frameStyle) || void 0 === _r ? void 0 : _r.innerBorder) ? (this.tableX = 0, this.tableY = 0, this.tableNoFrameWidth = width - (null !== (_s = shadowWidths[1]) && void 0 !== _s ? _s : 0), this.tableNoFrameHeight = height - (null !== (_t = shadowWidths[2]) && void 0 !== _t ? _t : 0)) : (this.tableX = (null !== (_u = lineWidths[3]) && void 0 !== _u ? _u : 0) + (null !== (_v = shadowWidths[3]) && void 0 !== _v ? _v : 0), this.tableY = (null !== (_w = lineWidths[0]) && void 0 !== _w ? _w : 0) + (null !== (_x = shadowWidths[0]) && void 0 !== _x ? _x : 0), this.tableNoFrameWidth = width - ((null !== (_y = lineWidths[1]) && void 0 !== _y ? _y : 0) + (null !== (_z = shadowWidths[1]) && void 0 !== _z ? _z : 0)) - ((null !== (_0 = lineWidths[3]) && void 0 !== _0 ? _0 : 0) + (null !== (_1 = shadowWidths[3]) && void 0 !== _1 ? _1 : 0)), this.tableNoFrameHeight = height - ((null !== (_2 = lineWidths[0]) && void 0 !== _2 ? _2 : 0) + (null !== (_3 = shadowWidths[0]) && void 0 !== _3 ? _3 : 0)) - ((null !== (_4 = lineWidths[2]) && void 0 !== _4 ? _4 : 0) + (null !== (_5 = shadowWidths[2]) && void 0 !== _5 ? _5 : 0)));
|
|
47864
47941
|
}
|
|
47865
47942
|
}
|
|
47866
47943
|
updateViewBox(newViewBox) {
|
|
47867
|
-
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
47868
|
-
const oldWidth = null !== (
|
|
47869
|
-
oldHeight = null !== (
|
|
47944
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
|
47945
|
+
const oldWidth = (null !== (_c = null === (_b = null === (_a = this.options) || void 0 === _a ? void 0 : _a.viewBox) || void 0 === _b ? void 0 : _b.x2) && void 0 !== _c ? _c : 0) - (null !== (_f = null === (_e = null === (_d = this.options) || void 0 === _d ? void 0 : _d.viewBox) || void 0 === _e ? void 0 : _e.x1) && void 0 !== _f ? _f : 0),
|
|
47946
|
+
oldHeight = (null !== (_j = null === (_h = null === (_g = this.options) || void 0 === _g ? void 0 : _g.viewBox) || void 0 === _h ? void 0 : _h.y2) && void 0 !== _j ? _j : 0) - (null !== (_m = null === (_l = null === (_k = this.options) || void 0 === _k ? void 0 : _k.viewBox) || void 0 === _l ? void 0 : _l.y1) && void 0 !== _m ? _m : 0),
|
|
47870
47947
|
newWidth = newViewBox.x2 - newViewBox.x1,
|
|
47871
47948
|
newHeight = newViewBox.y2 - newViewBox.y1;
|
|
47872
47949
|
this.options.viewBox = newViewBox, oldWidth !== newWidth || oldHeight !== newHeight ? this.resize() : this.scenegraph.stage.setViewBox(this.options.viewBox, !0);
|
|
@@ -50789,9 +50866,9 @@
|
|
|
50789
50866
|
}, null), this._headerObjectsIncludeHided = this._addHeaders(0, columns, []), this._headerObjects = this._headerObjectsIncludeHided.filter(col => !0 !== col.define.hide), this._headerObjectMap = this._headerObjects.reduce((o, e) => (o[e.id] = e, o), {}), this.rowHierarchyType = checkHasTreeDefine(this) ? "tree" : "grid", this._hasAggregation = checkHasAggregation(this), this._hasAggregationOnBottomCount = checkHasAggregationOnBottom(this), this._hasAggregationOnTopCount = checkHasAggregationOnTop(this), this.handleRowSeriesNumber(table.internalProps.rowSeriesNumber);
|
|
50790
50867
|
}
|
|
50791
50868
|
handleRowSeriesNumber(rowSeriesNumber) {
|
|
50792
|
-
var _a
|
|
50869
|
+
var _a;
|
|
50793
50870
|
rowSeriesNumber && (Array.isArray(rowSeriesNumber) ? this.rowSeriesNumberColumn = rowSeriesNumber.map((seriesNumber, index) => {
|
|
50794
|
-
var _a, _b
|
|
50871
|
+
var _a, _b;
|
|
50795
50872
|
return {
|
|
50796
50873
|
id: this.seqId++,
|
|
50797
50874
|
title: seriesNumber.title,
|
|
@@ -50799,11 +50876,11 @@
|
|
|
50799
50876
|
field: "_vtable_rowSeries_number_" + index
|
|
50800
50877
|
}, seriesNumber),
|
|
50801
50878
|
cellType: null !== (_a = seriesNumber.cellType) && void 0 !== _a ? _a : "text",
|
|
50802
|
-
headerType:
|
|
50879
|
+
headerType: "checkbox" === seriesNumber.cellType ? "checkbox" : "text",
|
|
50803
50880
|
style: seriesNumber.style,
|
|
50804
50881
|
width: seriesNumber.width,
|
|
50805
50882
|
format: seriesNumber.format,
|
|
50806
|
-
field: null !== (
|
|
50883
|
+
field: null !== (_b = seriesNumber.field) && void 0 !== _b ? _b : "_vtable_rowSeries_number_" + index,
|
|
50807
50884
|
icon: seriesNumber.icon,
|
|
50808
50885
|
headerIcon: seriesNumber.headerIcon,
|
|
50809
50886
|
isChildNode: !1
|
|
@@ -50815,7 +50892,7 @@
|
|
|
50815
50892
|
field: "_vtable_rowSeries_number"
|
|
50816
50893
|
}, rowSeriesNumber),
|
|
50817
50894
|
cellType: null !== (_a = rowSeriesNumber.cellType) && void 0 !== _a ? _a : "text",
|
|
50818
|
-
headerType:
|
|
50895
|
+
headerType: "checkbox" === rowSeriesNumber.cellType ? "checkbox" : "text",
|
|
50819
50896
|
style: rowSeriesNumber.style,
|
|
50820
50897
|
width: rowSeriesNumber.width,
|
|
50821
50898
|
format: rowSeriesNumber.format,
|