@visactor/vtable 0.15.0 → 0.15.2
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/ListTable.d.ts +1 -0
- package/cjs/ListTable.js +32 -14
- package/cjs/ListTable.js.map +1 -1
- package/cjs/PivotChart.js +25 -14
- package/cjs/PivotChart.js.map +1 -1
- package/cjs/PivotTable.js +15 -7
- package/cjs/PivotTable.js.map +1 -1
- package/cjs/components/menu/dom/logic/MenuElement.js +5 -5
- package/cjs/components/menu/dom/logic/MenuElement.js.map +1 -1
- package/cjs/components/tooltip/TooltipHandler.js +3 -3
- package/cjs/components/tooltip/TooltipHandler.js.map +1 -1
- package/cjs/components/tooltip/logic/BubbleTooltipElement.js +2 -2
- package/cjs/components/tooltip/logic/BubbleTooltipElement.js.map +1 -1
- package/cjs/core/BaseTable.d.ts +7 -7
- package/cjs/core/BaseTable.js +52 -35
- package/cjs/core/BaseTable.js.map +1 -1
- package/cjs/event/drill.js +3 -3
- package/cjs/event/drill.js.map +1 -1
- package/cjs/event/event.d.ts +1 -1
- package/cjs/event/event.js +19 -19
- package/cjs/event/event.js.map +1 -1
- package/cjs/event/listener/container-dom.d.ts +2 -2
- package/cjs/event/listener/container-dom.js +6 -7
- package/cjs/event/listener/container-dom.js.map +1 -1
- package/cjs/event/listener/scroll-bar.d.ts +2 -2
- package/cjs/event/listener/scroll-bar.js +16 -16
- package/cjs/event/listener/scroll-bar.js.map +1 -1
- package/cjs/event/listener/table-group.d.ts +3 -3
- package/cjs/event/listener/table-group.js +77 -67
- package/cjs/event/listener/table-group.js.map +1 -1
- package/cjs/event/listener/touch.d.ts +2 -2
- package/cjs/event/listener/touch.js +23 -23
- package/cjs/event/listener/touch.js.map +1 -1
- package/cjs/event/pivot-chart/axis-click.js +1 -1
- package/cjs/event/pivot-chart/axis-click.js.map +1 -1
- package/cjs/event/scroll.d.ts +4 -4
- package/cjs/event/scroll.js.map +1 -1
- package/cjs/event/sparkline-event.js +3 -3
- package/cjs/event/sparkline-event.js.map +1 -1
- package/cjs/header-helper/header-helper.js +2 -2
- package/cjs/header-helper/header-helper.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/layout/chart-helper/get-chart-spec.js +2 -6
- package/cjs/layout/chart-helper/get-chart-spec.js.map +1 -1
- package/cjs/layout/pivot-header-layout.js +17 -7
- package/cjs/layout/pivot-header-layout.js.map +1 -1
- package/cjs/scenegraph/component/cell-mover.js +6 -6
- package/cjs/scenegraph/component/cell-mover.js.map +1 -1
- package/cjs/scenegraph/component/table-component.js +2 -2
- package/cjs/scenegraph/component/table-component.js.map +1 -1
- package/cjs/scenegraph/graphic/contributions/chart-render-helper.js +12 -9
- package/cjs/scenegraph/graphic/contributions/chart-render-helper.js.map +1 -1
- package/cjs/scenegraph/graphic/contributions/group-contribution-render.js +1 -1
- package/cjs/scenegraph/graphic/contributions/group-contribution-render.js.map +1 -1
- package/cjs/scenegraph/group-creater/cell-helper.js +8 -7
- package/cjs/scenegraph/group-creater/cell-helper.js.map +1 -1
- package/cjs/scenegraph/group-creater/cell-type/checkbox-cell.js +2 -2
- package/cjs/scenegraph/group-creater/cell-type/checkbox-cell.js.map +1 -1
- package/cjs/scenegraph/group-creater/cell-type/progress-bar-cell.js +7 -8
- package/cjs/scenegraph/group-creater/cell-type/progress-bar-cell.js.map +1 -1
- package/cjs/scenegraph/group-creater/column-helper.js +3 -3
- package/cjs/scenegraph/group-creater/column-helper.js.map +1 -1
- package/cjs/scenegraph/group-creater/progress/create-group-for-first-screen.js +3 -3
- package/cjs/scenegraph/group-creater/progress/create-group-for-first-screen.js.map +1 -1
- package/cjs/scenegraph/group-creater/progress/update-position/dynamic-set-y.js +11 -4
- package/cjs/scenegraph/group-creater/progress/update-position/dynamic-set-y.js.map +1 -1
- package/cjs/scenegraph/layout/auto-height.js +1 -1
- package/cjs/scenegraph/layout/auto-height.js.map +1 -1
- package/cjs/scenegraph/layout/compute-col-width.js +7 -3
- package/cjs/scenegraph/layout/compute-col-width.js.map +1 -1
- package/cjs/scenegraph/layout/compute-row-height.js +12 -8
- package/cjs/scenegraph/layout/compute-row-height.js.map +1 -1
- package/cjs/scenegraph/layout/move-cell.js +9 -3
- package/cjs/scenegraph/layout/move-cell.js.map +1 -1
- package/cjs/scenegraph/layout/update-height.js +1 -1
- package/cjs/scenegraph/layout/update-height.js.map +1 -1
- package/cjs/scenegraph/layout/update-width.js +11 -7
- package/cjs/scenegraph/layout/update-width.js.map +1 -1
- package/cjs/scenegraph/scenegraph.d.ts +1 -0
- package/cjs/scenegraph/scenegraph.js +20 -10
- package/cjs/scenegraph/scenegraph.js.map +1 -1
- package/cjs/scenegraph/utils/render-service.js +1 -1
- package/cjs/scenegraph/utils/render-service.js.map +1 -1
- package/cjs/state/cell-move/index.d.ts +4 -4
- package/cjs/state/cell-move/index.js +1 -1
- package/cjs/state/cell-move/index.js.map +1 -1
- package/cjs/state/frozen/index.js.map +1 -1
- package/cjs/state/hover/is-cell-hover.d.ts +2 -2
- package/cjs/state/hover/is-cell-hover.js +2 -2
- package/cjs/state/hover/is-cell-hover.js.map +1 -1
- package/cjs/state/hover/update-position.d.ts +2 -2
- package/cjs/state/hover/update-position.js.map +1 -1
- package/cjs/state/resize/update-resize-column.d.ts +2 -2
- package/cjs/state/resize/update-resize-column.js.map +1 -1
- package/cjs/state/select/update-position.d.ts +2 -2
- package/cjs/state/select/update-position.js +86 -88
- package/cjs/state/select/update-position.js.map +1 -1
- package/cjs/state/sort/index.js +2 -2
- package/cjs/state/sort/index.js.map +1 -1
- package/cjs/state/state.d.ts +1 -1
- package/cjs/state/state.js +8 -8
- package/cjs/state/state.js.map +1 -1
- package/cjs/themes/ARCO.js +1 -2
- package/cjs/themes/BRIGHT.js +2 -1
- package/cjs/tools/LimitPromiseQueue.js +1 -1
- package/cjs/tools/NumberMap.js +1 -1
- package/cjs/tools/util.js.map +1 -1
- package/cjs/ts-types/base-table.d.ts +6 -6
- package/cjs/ts-types/base-table.js +1 -1
- package/cjs/ts-types/base-table.js.map +1 -1
- package/cjs/ts-types/common.js +1 -1
- package/cjs/ts-types/events.d.ts +0 -1
- package/cjs/ts-types/events.js.map +1 -1
- package/cjs/ts-types/list-table/define/basic-define.js.map +1 -1
- package/dist/vtable.js +588 -420
- package/dist/vtable.min.js +2 -2
- package/es/ListTable.d.ts +1 -0
- package/es/ListTable.js +33 -14
- package/es/ListTable.js.map +1 -1
- package/es/PivotChart.js +26 -13
- package/es/PivotChart.js.map +1 -1
- package/es/PivotTable.js +17 -6
- package/es/PivotTable.js.map +1 -1
- package/es/components/menu/dom/logic/MenuElement.js +5 -5
- package/es/components/menu/dom/logic/MenuElement.js.map +1 -1
- package/es/components/tooltip/TooltipHandler.js +3 -3
- package/es/components/tooltip/TooltipHandler.js.map +1 -1
- package/es/components/tooltip/logic/BubbleTooltipElement.js +2 -2
- package/es/components/tooltip/logic/BubbleTooltipElement.js.map +1 -1
- package/es/core/BaseTable.d.ts +7 -7
- package/es/core/BaseTable.js +55 -38
- package/es/core/BaseTable.js.map +1 -1
- package/es/event/drill.js +3 -3
- package/es/event/drill.js.map +1 -1
- package/es/event/event.d.ts +1 -1
- package/es/event/event.js +16 -16
- package/es/event/event.js.map +1 -1
- package/es/event/listener/container-dom.d.ts +2 -2
- package/es/event/listener/container-dom.js +6 -7
- package/es/event/listener/container-dom.js.map +1 -1
- package/es/event/listener/scroll-bar.d.ts +2 -2
- package/es/event/listener/scroll-bar.js +15 -15
- package/es/event/listener/scroll-bar.js.map +1 -1
- package/es/event/listener/table-group.d.ts +3 -3
- package/es/event/listener/table-group.js +77 -66
- package/es/event/listener/table-group.js.map +1 -1
- package/es/event/listener/touch.d.ts +2 -2
- package/es/event/listener/touch.js +21 -21
- package/es/event/listener/touch.js.map +1 -1
- package/es/event/pivot-chart/axis-click.js +1 -1
- package/es/event/pivot-chart/axis-click.js.map +1 -1
- package/es/event/scroll.d.ts +4 -4
- package/es/event/scroll.js.map +1 -1
- package/es/event/sparkline-event.js +3 -3
- package/es/event/sparkline-event.js.map +1 -1
- package/es/header-helper/header-helper.js +1 -1
- package/es/header-helper/header-helper.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/layout/chart-helper/get-chart-spec.js +2 -6
- package/es/layout/chart-helper/get-chart-spec.js.map +1 -1
- package/es/layout/pivot-header-layout.js +17 -7
- package/es/layout/pivot-header-layout.js.map +1 -1
- package/es/scenegraph/component/cell-mover.js +6 -6
- package/es/scenegraph/component/cell-mover.js.map +1 -1
- package/es/scenegraph/component/table-component.js +2 -2
- package/es/scenegraph/component/table-component.js.map +1 -1
- package/es/scenegraph/graphic/contributions/chart-render-helper.js +12 -9
- package/es/scenegraph/graphic/contributions/chart-render-helper.js.map +1 -1
- package/es/scenegraph/graphic/contributions/group-contribution-render.js +1 -1
- package/es/scenegraph/graphic/contributions/group-contribution-render.js.map +1 -1
- package/es/scenegraph/group-creater/cell-helper.js +7 -7
- package/es/scenegraph/group-creater/cell-helper.js.map +1 -1
- package/es/scenegraph/group-creater/cell-type/checkbox-cell.js +2 -2
- package/es/scenegraph/group-creater/cell-type/checkbox-cell.js.map +1 -1
- package/es/scenegraph/group-creater/cell-type/progress-bar-cell.js +7 -6
- package/es/scenegraph/group-creater/cell-type/progress-bar-cell.js.map +1 -1
- package/es/scenegraph/group-creater/column-helper.js +3 -3
- package/es/scenegraph/group-creater/column-helper.js.map +1 -1
- package/es/scenegraph/group-creater/progress/create-group-for-first-screen.js +3 -3
- package/es/scenegraph/group-creater/progress/create-group-for-first-screen.js.map +1 -1
- package/es/scenegraph/group-creater/progress/update-position/dynamic-set-y.js +11 -4
- package/es/scenegraph/group-creater/progress/update-position/dynamic-set-y.js.map +1 -1
- package/es/scenegraph/layout/auto-height.js +1 -1
- package/es/scenegraph/layout/auto-height.js.map +1 -1
- package/es/scenegraph/layout/compute-col-width.js +7 -3
- package/es/scenegraph/layout/compute-col-width.js.map +1 -1
- package/es/scenegraph/layout/compute-row-height.js +12 -8
- package/es/scenegraph/layout/compute-row-height.js.map +1 -1
- package/es/scenegraph/layout/move-cell.js +9 -3
- package/es/scenegraph/layout/move-cell.js.map +1 -1
- package/es/scenegraph/layout/update-height.js +1 -1
- package/es/scenegraph/layout/update-height.js.map +1 -1
- package/es/scenegraph/layout/update-width.js +11 -7
- package/es/scenegraph/layout/update-width.js.map +1 -1
- package/es/scenegraph/scenegraph.d.ts +1 -0
- package/es/scenegraph/scenegraph.js +20 -10
- package/es/scenegraph/scenegraph.js.map +1 -1
- package/es/scenegraph/utils/render-service.js +1 -1
- package/es/scenegraph/utils/render-service.js.map +1 -1
- package/es/state/cell-move/index.d.ts +4 -4
- package/es/state/cell-move/index.js +1 -1
- package/es/state/cell-move/index.js.map +1 -1
- package/es/state/frozen/index.js.map +1 -1
- package/es/state/hover/is-cell-hover.d.ts +2 -2
- package/es/state/hover/is-cell-hover.js +2 -2
- package/es/state/hover/is-cell-hover.js.map +1 -1
- package/es/state/hover/update-position.d.ts +2 -2
- package/es/state/hover/update-position.js.map +1 -1
- package/es/state/resize/update-resize-column.d.ts +2 -2
- package/es/state/resize/update-resize-column.js.map +1 -1
- package/es/state/select/update-position.d.ts +2 -2
- package/es/state/select/update-position.js +86 -88
- package/es/state/select/update-position.js.map +1 -1
- package/es/state/sort/index.js +2 -2
- package/es/state/sort/index.js.map +1 -1
- package/es/state/state.d.ts +1 -1
- package/es/state/state.js +6 -6
- package/es/state/state.js.map +1 -1
- package/es/themes/ARCO.js +1 -2
- package/es/themes/BRIGHT.js +2 -1
- package/es/tools/LimitPromiseQueue.js +1 -1
- package/es/tools/NumberMap.js +1 -1
- package/es/tools/util.js.map +1 -1
- package/es/ts-types/base-table.d.ts +6 -6
- package/es/ts-types/base-table.js +1 -1
- package/es/ts-types/base-table.js.map +1 -1
- package/es/ts-types/common.js +1 -1
- package/es/ts-types/events.d.ts +0 -1
- package/es/ts-types/events.js.map +1 -1
- package/es/ts-types/list-table/define/basic-define.js.map +1 -1
- package/package.json +5 -5
|
@@ -49,7 +49,7 @@ class CellMover {
|
|
|
49
49
|
mergeInfo && (col = mergeInfo.start.col, row = mergeInfo.start.row);
|
|
50
50
|
let rectX = 0, rectY = 0, rectWidth = 0, rectHeight = 0, rectDx = 0, rectDy = 0, symbolX = 0, symbolY = 0, symbolRotate = Math.PI;
|
|
51
51
|
const linePoints = [];
|
|
52
|
-
"columnHeader" === cellLocation ? (rectX = this.table.getColsWidth(0, col - 1) - this.table.
|
|
52
|
+
"columnHeader" === cellLocation ? (rectX = this.table.getColsWidth(0, col - 1) - this.table.stateManager.scroll.horizontalBarPos,
|
|
53
53
|
rectY = this.table.getRowsHeight(0, this.table.frozenRowCount - 1), rectHeight = this.table.tableNoFrameHeight,
|
|
54
54
|
rectWidth = mergeInfo ? this.table.getColsWidth(mergeInfo.start.col, mergeInfo.end.col) : this.table.getColWidth(col),
|
|
55
55
|
rectDx = rectX - delta, symbolX = rectX + rectWidth, symbolY = 2, linePoints.push({
|
|
@@ -58,7 +58,7 @@ class CellMover {
|
|
|
58
58
|
}), linePoints.push({
|
|
59
59
|
x: 0,
|
|
60
60
|
y: this.table.tableNoFrameHeight
|
|
61
|
-
})) : "rowHeader" === cellLocation && (rectY = this.table.getRowsHeight(0, row - 1) - this.table.
|
|
61
|
+
})) : "rowHeader" === cellLocation && (rectY = this.table.getRowsHeight(0, row - 1) - this.table.stateManager.scroll.verticalBarPos,
|
|
62
62
|
rectX = this.table.getColsWidth(0, this.table.frozenColCount - 1), rectWidth = this.table.tableNoFrameWidth,
|
|
63
63
|
rectHeight = mergeInfo ? this.table.getRowsHeight(mergeInfo.start.row, mergeInfo.end.row) : this.table.getRowHeight(row),
|
|
64
64
|
rectDy = rectY - delta, symbolX = 2, symbolY = rectY + rectHeight, symbolRotate = Math.PI / 2,
|
|
@@ -93,10 +93,10 @@ class CellMover {
|
|
|
93
93
|
this.columnMoverBack.setAttribute("visible", !1);
|
|
94
94
|
}
|
|
95
95
|
update(backX, lineX, backY, lineY) {
|
|
96
|
-
"number" == typeof backX && "number" == typeof lineX ? (this.columnMoverLabel.setAttribute("x", lineX - this.table.
|
|
97
|
-
this.columnMoverLine.setAttribute("x", lineX - this.table.
|
|
98
|
-
this.columnMoverBack.setAttribute("x", backX)) : "number" == typeof backY && "number" == typeof lineY && (this.columnMoverLabel.setAttribute("y", lineY - this.table.
|
|
99
|
-
this.columnMoverLine.setAttribute("y", lineY - this.table.
|
|
96
|
+
"number" == typeof backX && "number" == typeof lineX ? (this.columnMoverLabel.setAttribute("x", lineX - this.table.stateManager.scroll.horizontalBarPos),
|
|
97
|
+
this.columnMoverLine.setAttribute("x", lineX - this.table.stateManager.scroll.horizontalBarPos),
|
|
98
|
+
this.columnMoverBack.setAttribute("x", backX)) : "number" == typeof backY && "number" == typeof lineY && (this.columnMoverLabel.setAttribute("y", lineY - this.table.stateManager.scroll.verticalBarPos),
|
|
99
|
+
this.columnMoverLine.setAttribute("y", lineY - this.table.stateManager.scroll.verticalBarPos),
|
|
100
100
|
this.columnMoverBack.setAttribute("y", backY));
|
|
101
101
|
}
|
|
102
102
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/scenegraph/component/cell-mover.ts"],"names":[],"mappings":";;;AACA,+CAAyE;AACzE,4DAA2D;AAI3D,MAAa,SAAS;IAOpB,YAAY,KAAmB;QAC7B,MAAM,oBAAoB,GAAG,KAAK,CAAC,KAAK,CAAC,mBAAmB,CAAC,SAAS,CAAC;QACvE,MAAM,oBAAoB,GAAG,KAAK,CAAC,KAAK,CAAC,mBAAmB,CAAC,SAAS,CAAC;QACvE,MAAM,2BAA2B,GAAG,KAAK,CAAC,KAAK,CAAC,mBAAmB,CAAC,gBAAgB,CAAC;QAErF,IAAI,CAAC,gBAAgB,GAAG,IAAA,sBAAY,EAAC;YACnC,OAAO,EAAE,KAAK;YACd,QAAQ,EAAE,KAAK;YACf,C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,IAAI,CAAC,eAAe,CAAC,YAAY,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;SAC/C;aAAM,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;YACjE,IAAI,CAAC,gBAAgB,CAAC,YAAY,CAAC,GAAG,EAAE,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,MAAM,CAAC,cAAc,CAAC,CAAC;YAC/F,IAAI,CAAC,eAAe,CAAC,YAAY,CAAC,GAAG,EAAE,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,MAAM,CAAC,cAAc,CAAC,CAAC;YAC9F,IAAI,CAAC,eAAe,CAAC,YAAY,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;SAC/C;IACH,CAAC;CACF;AAlJD,8BAkJC","file":"cell-mover.js","sourcesContent":["import type { ILine, IRect, ISymbol } from '@visactor/vrender';\nimport { createLine, createRect, createSymbol } from '@visactor/vrender';\nimport { getCellMergeInfo } from '../utils/get-cell-merge';\nimport type { Group } from '../graphic/group';\nimport type { BaseTableAPI } from '../../ts-types/base-table';\n\nexport class CellMover {\n columnMoverLabel: ISymbol;\n columnMoverLine: ILine;\n columnMoverBack: IRect;\n table: BaseTableAPI;\n x?: number;\n\n constructor(table: BaseTableAPI) {\n const columnMoverLineWidth = table.theme.dragHeaderSplitLine.lineWidth;\n const columnMoverLineColor = table.theme.dragHeaderSplitLine.lineColor;\n const columnMoverShadowBlockColor = table.theme.dragHeaderSplitLine.shadowBlockColor;\n\n this.columnMoverLabel = createSymbol({\n visible: false,\n pickable: false,\n x: 0,\n y: 0,\n symbolType: 'triangle',\n fill: columnMoverLineColor as string\n });\n this.columnMoverLine = createLine({\n visible: false,\n pickable: false,\n stroke: columnMoverLineColor as string,\n lineWidth: columnMoverLineWidth as number,\n x: 0,\n y: 0,\n points: [\n { x: 0, y: 0 },\n { x: 0, y: 0 }\n ]\n });\n\n // 列顺序调整阴影块\n this.columnMoverBack = createRect({\n visible: false,\n pickable: false,\n fill: columnMoverShadowBlockColor,\n x: 0,\n y: 0,\n width: 0,\n height: 0\n });\n\n this.table = table;\n }\n\n appand(parent: Group) {\n parent.appendChild(this.columnMoverLabel);\n parent.appendChild(this.columnMoverLine);\n parent.appendChild(this.columnMoverBack);\n }\n\n show(col: number, row: number, delta: number) {\n const cellLocation = this.table.getCellLocation(col, row);\n const mergeInfo = getCellMergeInfo(this.table, col, row);\n if (mergeInfo) {\n col = mergeInfo.start.col;\n row = mergeInfo.start.row;\n }\n\n let rectX = 0;\n let rectY = 0;\n let rectWidth = 0;\n let rectHeight = 0;\n let rectDx = 0;\n let rectDy = 0;\n let symbolX = 0;\n let symbolY = 0;\n let symbolRotate = Math.PI;\n const linePoints: { x: number; y: number }[] = [];\n if (cellLocation === 'columnHeader') {\n rectX = this.table.getColsWidth(0, col - 1) - this.table.stateManeger.scroll.horizontalBarPos;\n rectY = this.table.getRowsHeight(0, this.table.frozenRowCount - 1);\n rectHeight = this.table.tableNoFrameHeight;\n if (mergeInfo) {\n rectWidth = this.table.getColsWidth(mergeInfo.start.col, mergeInfo.end.col);\n } else {\n rectWidth = this.table.getColWidth(col);\n }\n rectDx = rectX - delta;\n\n symbolX = rectX + rectWidth;\n symbolY = 2;\n\n linePoints.push({ x: 0, y: 0 });\n linePoints.push({ x: 0, y: this.table.tableNoFrameHeight });\n } else if (cellLocation === 'rowHeader') {\n rectY = this.table.getRowsHeight(0, row - 1) - this.table.stateManeger.scroll.verticalBarPos;\n rectX = this.table.getColsWidth(0, this.table.frozenColCount - 1);\n rectWidth = this.table.tableNoFrameWidth;\n if (mergeInfo) {\n rectHeight = this.table.getRowsHeight(mergeInfo.start.row, mergeInfo.end.row);\n } else {\n rectHeight = this.table.getRowHeight(row);\n }\n rectDy = rectY - delta;\n\n symbolX = 2;\n symbolY = rectY + rectHeight;\n symbolRotate = Math.PI / 2;\n\n linePoints.push({ x: 0, y: 0 });\n linePoints.push({ x: this.table.tableNoFrameWidth, y: 0 });\n }\n\n this.columnMoverBack.setAttributes({\n visible: true,\n x: rectX - rectDx,\n y: rectY - rectDy,\n width: rectWidth,\n height: rectHeight,\n dx: rectDx,\n dy: rectDy\n });\n this.columnMoverLine.setAttributes({\n x: symbolX,\n y: symbolY,\n visible: true,\n points: linePoints\n });\n this.columnMoverLabel.setAttributes({\n visible: true,\n x: symbolX,\n y: symbolY,\n angle: symbolRotate\n });\n }\n\n hide() {\n this.columnMoverLabel.setAttribute('visible', false);\n this.columnMoverLine.setAttribute('visible', false);\n this.columnMoverBack.setAttribute('visible', false);\n }\n\n update(backX: number | undefined, lineX: number | undefined, backY: number | undefined, lineY: number | undefined) {\n if (typeof backX === 'number' && typeof lineX === 'number') {\n this.columnMoverLabel.setAttribute('x', lineX - this.table.stateManeger.scroll.horizontalBarPos);\n this.columnMoverLine.setAttribute('x', lineX - this.table.stateManeger.scroll.horizontalBarPos);\n this.columnMoverBack.setAttribute('x', backX);\n } else if (typeof backY === 'number' && typeof lineY === 'number') {\n this.columnMoverLabel.setAttribute('y', lineY - this.table.stateManeger.scroll.verticalBarPos);\n this.columnMoverLine.setAttribute('y', lineY - this.table.stateManeger.scroll.verticalBarPos);\n this.columnMoverBack.setAttribute('y', backY);\n }\n }\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/scenegraph/component/cell-mover.ts"],"names":[],"mappings":";;;AACA,+CAAyE;AACzE,4DAA2D;AAI3D,MAAa,SAAS;IAOpB,YAAY,KAAmB;QAC7B,MAAM,oBAAoB,GAAG,KAAK,CAAC,KAAK,CAAC,mBAAmB,CAAC,SAAS,CAAC;QACvE,MAAM,oBAAoB,GAAG,KAAK,CAAC,KAAK,CAAC,mBAAmB,CAAC,SAAS,CAAC;QACvE,MAAM,2BAA2B,GAAG,KAAK,CAAC,KAAK,CAAC,mBAAmB,CAAC,gBAAgB,CAAC;QAErF,IAAI,CAAC,gBAAgB,GAAG,IAAA,sBAAY,EAAC;YACnC,OAA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,CAAC,MAAM,CAAC,gBAAgB,CAAC,CAAC;YAChG,IAAI,CAAC,eAAe,CAAC,YAAY,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;SAC/C;aAAM,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;YACjE,IAAI,CAAC,gBAAgB,CAAC,YAAY,CAAC,GAAG,EAAE,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,MAAM,CAAC,cAAc,CAAC,CAAC;YAC/F,IAAI,CAAC,eAAe,CAAC,YAAY,CAAC,GAAG,EAAE,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,MAAM,CAAC,cAAc,CAAC,CAAC;YAC9F,IAAI,CAAC,eAAe,CAAC,YAAY,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;SAC/C;IACH,CAAC;CACF;AAlJD,8BAkJC","file":"cell-mover.js","sourcesContent":["import type { ILine, IRect, ISymbol } from '@visactor/vrender';\nimport { createLine, createRect, createSymbol } from '@visactor/vrender';\nimport { getCellMergeInfo } from '../utils/get-cell-merge';\nimport type { Group } from '../graphic/group';\nimport type { BaseTableAPI } from '../../ts-types/base-table';\n\nexport class CellMover {\n columnMoverLabel: ISymbol;\n columnMoverLine: ILine;\n columnMoverBack: IRect;\n table: BaseTableAPI;\n x?: number;\n\n constructor(table: BaseTableAPI) {\n const columnMoverLineWidth = table.theme.dragHeaderSplitLine.lineWidth;\n const columnMoverLineColor = table.theme.dragHeaderSplitLine.lineColor;\n const columnMoverShadowBlockColor = table.theme.dragHeaderSplitLine.shadowBlockColor;\n\n this.columnMoverLabel = createSymbol({\n visible: false,\n pickable: false,\n x: 0,\n y: 0,\n symbolType: 'triangle',\n fill: columnMoverLineColor as string\n });\n this.columnMoverLine = createLine({\n visible: false,\n pickable: false,\n stroke: columnMoverLineColor as string,\n lineWidth: columnMoverLineWidth as number,\n x: 0,\n y: 0,\n points: [\n { x: 0, y: 0 },\n { x: 0, y: 0 }\n ]\n });\n\n // 列顺序调整阴影块\n this.columnMoverBack = createRect({\n visible: false,\n pickable: false,\n fill: columnMoverShadowBlockColor,\n x: 0,\n y: 0,\n width: 0,\n height: 0\n });\n\n this.table = table;\n }\n\n appand(parent: Group) {\n parent.appendChild(this.columnMoverLabel);\n parent.appendChild(this.columnMoverLine);\n parent.appendChild(this.columnMoverBack);\n }\n\n show(col: number, row: number, delta: number) {\n const cellLocation = this.table.getCellLocation(col, row);\n const mergeInfo = getCellMergeInfo(this.table, col, row);\n if (mergeInfo) {\n col = mergeInfo.start.col;\n row = mergeInfo.start.row;\n }\n\n let rectX = 0;\n let rectY = 0;\n let rectWidth = 0;\n let rectHeight = 0;\n let rectDx = 0;\n let rectDy = 0;\n let symbolX = 0;\n let symbolY = 0;\n let symbolRotate = Math.PI;\n const linePoints: { x: number; y: number }[] = [];\n if (cellLocation === 'columnHeader') {\n rectX = this.table.getColsWidth(0, col - 1) - this.table.stateManager.scroll.horizontalBarPos;\n rectY = this.table.getRowsHeight(0, this.table.frozenRowCount - 1);\n rectHeight = this.table.tableNoFrameHeight;\n if (mergeInfo) {\n rectWidth = this.table.getColsWidth(mergeInfo.start.col, mergeInfo.end.col);\n } else {\n rectWidth = this.table.getColWidth(col);\n }\n rectDx = rectX - delta;\n\n symbolX = rectX + rectWidth;\n symbolY = 2;\n\n linePoints.push({ x: 0, y: 0 });\n linePoints.push({ x: 0, y: this.table.tableNoFrameHeight });\n } else if (cellLocation === 'rowHeader') {\n rectY = this.table.getRowsHeight(0, row - 1) - this.table.stateManager.scroll.verticalBarPos;\n rectX = this.table.getColsWidth(0, this.table.frozenColCount - 1);\n rectWidth = this.table.tableNoFrameWidth;\n if (mergeInfo) {\n rectHeight = this.table.getRowsHeight(mergeInfo.start.row, mergeInfo.end.row);\n } else {\n rectHeight = this.table.getRowHeight(row);\n }\n rectDy = rectY - delta;\n\n symbolX = 2;\n symbolY = rectY + rectHeight;\n symbolRotate = Math.PI / 2;\n\n linePoints.push({ x: 0, y: 0 });\n linePoints.push({ x: this.table.tableNoFrameWidth, y: 0 });\n }\n\n this.columnMoverBack.setAttributes({\n visible: true,\n x: rectX - rectDx,\n y: rectY - rectDy,\n width: rectWidth,\n height: rectHeight,\n dx: rectDx,\n dy: rectDy\n });\n this.columnMoverLine.setAttributes({\n x: symbolX,\n y: symbolY,\n visible: true,\n points: linePoints\n });\n this.columnMoverLabel.setAttributes({\n visible: true,\n x: symbolX,\n y: symbolY,\n angle: symbolRotate\n });\n }\n\n hide() {\n this.columnMoverLabel.setAttribute('visible', false);\n this.columnMoverLine.setAttribute('visible', false);\n this.columnMoverBack.setAttribute('visible', false);\n }\n\n update(backX: number | undefined, lineX: number | undefined, backY: number | undefined, lineY: number | undefined) {\n if (typeof backX === 'number' && typeof lineX === 'number') {\n this.columnMoverLabel.setAttribute('x', lineX - this.table.stateManager.scroll.horizontalBarPos);\n this.columnMoverLine.setAttribute('x', lineX - this.table.stateManager.scroll.horizontalBarPos);\n this.columnMoverBack.setAttribute('x', backX);\n } else if (typeof backY === 'number' && typeof lineY === 'number') {\n this.columnMoverLabel.setAttribute('y', lineY - this.table.stateManager.scroll.verticalBarPos);\n this.columnMoverLine.setAttribute('y', lineY - this.table.stateManager.scroll.verticalBarPos);\n this.columnMoverBack.setAttribute('y', backY);\n }\n }\n}\n"]}
|
|
@@ -141,7 +141,7 @@ class TableComponent {
|
|
|
141
141
|
}
|
|
142
142
|
updateScrollBar() {
|
|
143
143
|
var _a, _b;
|
|
144
|
-
const oldHorizontalBarPos = this.table.
|
|
144
|
+
const oldHorizontalBarPos = this.table.stateManager.scroll.horizontalBarPos, oldVerticalBarPos = this.table.stateManager.scroll.verticalBarPos, theme = this.table.theme, width = null === (_a = theme.scrollStyle) || void 0 === _a ? void 0 : _a.width, visible = null === (_b = theme.scrollStyle) || void 0 === _b ? void 0 : _b.visible, tableWidth = Math.ceil(this.table.scenegraph.tableGroup.attribute.width), tableHeight = Math.ceil(this.table.scenegraph.tableGroup.attribute.height), totalHeight = this.table.getAllRowsHeight(), totalWidth = this.table.getAllColsWidth(), frozenRowsHeight = this.table.getFrozenRowsHeight(), frozenColsWidth = this.table.getFrozenColsWidth(), bottomFrozenRowsHeight = this.table.getBottomFrozenRowsHeight(), rightFrozenColsWidth = this.table.getRightFrozenColsWidth();
|
|
145
145
|
if (totalWidth > tableWidth) {
|
|
146
146
|
const y = Math.min(tableHeight, totalHeight), rangeEnd = Math.max(.05, (tableWidth - frozenColsWidth) / (totalWidth - frozenColsWidth));
|
|
147
147
|
this.hScrollBar.setAttributes({
|
|
@@ -182,7 +182,7 @@ class TableComponent {
|
|
|
182
182
|
height: 0,
|
|
183
183
|
visible: !1
|
|
184
184
|
});
|
|
185
|
-
this.table.
|
|
185
|
+
this.table.stateManager.setScrollLeft(oldHorizontalBarPos), this.table.stateManager.setScrollTop(oldVerticalBarPos);
|
|
186
186
|
}
|
|
187
187
|
hideResizeCol() {
|
|
188
188
|
this.columnResizeLine.setAttribute("visible", !1), this.columnResizeBgLine.setAttribute("visible", !1),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/scenegraph/component/table-component.ts"],"names":[],"mappings":";;;AACA,+CAAkG;AAClG,qEAAyD;AAGzD,iCAAqC;AACrC,6CAAyC;AACzC,6CAAyC;AACzC,iCAAiC;AAOjC,MAAa,cAAc;IAezB,YAAY,KAAmB;;QAC7B,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC;QAG/B,IAAI,CAAC,eAAe,EAAE,CAAC;QAGvB,MAAM,iBAAiB,GAAG,MAAA,KAAK,CAAC,YAAY,0CAAE,SAAS,CAAC;QACxD,MAAM,iBAAiB,GAAG,MAAA,KAAK,CAAC,YAAY,0CAAE,SAAS,CAAC;QACxD,MAAM,mBAAmB,GAAG,MAAA,KAAK,CAAC,YAAY,0CAAE,OAAO,CAAC;QACxD,M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QAC5C,MAAM,KAAK,GAAG,IAAI,CAAC,UAAU,CAAC,SAAS,CAAC,KAAK,CAAC;QAC9C,MAAM,IAAI,GAAG,KAAK,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;QACjC,MAAM,MAAM,GAAG,SAAS,GAAG,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC;QACtC,IAAI,CAAC,UAAU,CAAC,YAAY,CAAC,OAAO,EAAE,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC,CAAC,CAAC;QAC/D,MAAM,MAAM,GAAG,IAAI,CAAC,UAAU,CAAC,UAAU,IAAI,IAAI,CAAC,UAAU,CAAC,gBAAgB,CAAC;QAC7E,IAAI,CAAC,UAAkB,CAAC,aAAa,GAAG;YACvC,CAAC,EAAE,MAAM,CAAC,EAAE;YACZ,CAAC,EAAE,MAAM,CAAC,EAAE;SACb,CAAC;IACJ,CAAC;CACF;AA3dD,wCA2dC","file":"table-component.js","sourcesContent":["import type { ILine, IRect, IGroup } from '@visactor/vrender';\nimport { createRect, createLine, createText, createGroup, createSymbol } from '@visactor/vrender';\nimport { ScrollBar } from '@visactor/vrender-components';\nimport type { Group } from '../graphic/group';\nimport type { WrapText } from '../graphic/text';\nimport { MenuHandler } from './menu';\nimport { DrillIcon } from './drill-icon';\nimport { CellMover } from './cell-mover';\nimport { getColX } from './util';\nimport type { BaseTableAPI } from '../../ts-types/base-table';\n\n/**\n * @description: 表格内容外组件\n * @return {*}\n */\nexport class TableComponent {\n table: BaseTableAPI;\n\n border: IRect; // 表格外边框\n // selectBorder: IRect; // 表格选择区域边框\n columnResizeLine: ILine; // 表格列宽调整基准线\n columnResizeBgLine: ILine; // 表格列宽调整基准线背景\n columnResizeLabel: IGroup; // 表格列宽调整标记\n menu: MenuHandler; // 表格菜单\n vScrollBar: ScrollBar; // 表格横向滚动条\n hScrollBar: ScrollBar; // 表格纵向滚动条\n frozenShadowLine: IRect; // 表格冻结列右侧阴影块\n drillIcon: DrillIcon; // drill icon\n cellMover: CellMover; // 表格列顺序调整标记\n\n constructor(table: BaseTableAPI) {\n this.table = table;\n const theme = this.table.theme;\n\n // 滚动条\n this.createScrollBar();\n\n // 列宽调整基准线\n const columnResizeColor = theme.columnResize?.lineColor;\n const columnResizeWidth = theme.columnResize?.lineWidth;\n const columnResizeBgColor = theme.columnResize?.bgColor;\n const columnResizeBgWidth = theme.columnResize?.width;\n this.columnResizeLine = createLine({\n visible: false,\n pickable: false,\n stroke: columnResizeColor as string,\n lineWidth: columnResizeWidth as number,\n x: 0,\n y: 0,\n points: [\n { x: 0, y: 0 },\n { x: 0, y: 0 }\n ]\n });\n this.columnResizeBgLine = createLine({\n visible: false,\n pickable: false,\n stroke: columnResizeBgColor as string,\n lineWidth: columnResizeBgWidth as number,\n x: 0,\n y: 0,\n // dx: -(columnResizeBgWidth - columnResizeWidth) / 2,\n points: [\n { x: 0, y: 0 },\n { x: 0, y: 0 }\n ]\n });\n\n // 列宽调整文字标签\n const columnResizeLabelText = createText({\n visible: false,\n pickable: false,\n x: 0,\n y: 0,\n fontSize: 10,\n fill: '#FFF',\n text: '',\n textBaseline: 'top',\n dx: 12 + 4,\n dy: -8 + 2\n });\n const columnResizeLabelBack = createRect({\n visible: false,\n pickable: false,\n fill: '#3073F2',\n x: 0,\n y: 0,\n width: 38,\n height: 16,\n cornerRadius: 5,\n dx: 12,\n dy: -8\n });\n this.columnResizeLabel = createGroup({\n visible: false,\n pickable: false,\n x: 0,\n y: 0\n });\n this.columnResizeLabel.appendChild(columnResizeLabelBack);\n this.columnResizeLabel.appendChild(columnResizeLabelText);\n\n // 列顺序调整基准线\n this.cellMover = new CellMover(this.table);\n\n // 冻结列阴影\n const shadowWidth = theme.frozenColumnLine?.shadow?.width;\n const shadowStartColor = theme.frozenColumnLine?.shadow?.startColor;\n const shadowEndColor = theme.frozenColumnLine?.shadow?.endColor;\n this.frozenShadowLine = createRect({\n visible: true,\n pickable: false,\n x: 0,\n y: 0,\n width: shadowWidth,\n height: 0,\n fill: {\n gradient: 'linear',\n x0: 0,\n y0: 0,\n x1: 1,\n y1: 0,\n stops: [\n { color: shadowStartColor, offset: 0 },\n { color: shadowEndColor, offset: 1 }\n ]\n }\n });\n\n // TO BE DONE 冻结列border(theme.frozenColumnLine?.border)\n\n // 弹出窗口\n // this.menu = createGroup({\n // visible: false,\n // pickable: false,\n // x: 0,\n // y: 0,\n // });\n this.menu = new MenuHandler(this.table);\n\n this.drillIcon = new DrillIcon();\n }\n\n /**\n * @description: 组件mark加入到容器Group中\n * @param {Group} componentGroup\n * @return {*}\n */\n addToGroup(componentGroup: Group) {\n componentGroup.addChild(this.frozenShadowLine);\n // componentGroup.addChild(this.selectBorder);\n componentGroup.addChild(this.columnResizeBgLine);\n componentGroup.addChild(this.columnResizeLine);\n componentGroup.addChild(this.columnResizeLabel);\n if (this.table.theme.scrollStyle.hoverOn) {\n componentGroup.addChild(this.hScrollBar);\n componentGroup.addChild(this.vScrollBar);\n } else {\n componentGroup.stage.defaultLayer.addChild(this.hScrollBar);\n componentGroup.stage.defaultLayer.addChild(this.vScrollBar);\n }\n this.menu.bindTableComponent(componentGroup);\n this.drillIcon.appand(componentGroup);\n this.cellMover.appand(componentGroup);\n }\n\n /**\n * @description: 创建滚动条组件\n * @return {*}\n */\n createScrollBar() {\n const theme = this.table.theme;\n const scrollRailColor = theme.scrollStyle?.scrollRailColor as string;\n const scrollSliderColor = theme.scrollStyle?.scrollSliderColor as string;\n const width = theme.scrollStyle?.width as number;\n // const visible = theme.scrollStyle?.visible as string;\n // const hoverOn = theme.scrollStyle?.hoverOn as boolean;\n\n this.hScrollBar = new ScrollBar({\n direction: 'horizontal',\n x: -this.table.tableNoFrameWidth * 2,\n y: -this.table.tableNoFrameHeight * 2,\n width: this.table.tableNoFrameWidth,\n height: width,\n padding: 0,\n railStyle: {\n fill: scrollRailColor\n },\n sliderStyle: {\n fill: scrollSliderColor\n },\n range: [0, 0.1],\n // scrollRange: [0.4, 0.8]\n visible: false\n });\n // hack方案实现初始化隐藏滚动条,也可以add到stage之后执行hideAll\n (this.hScrollBar as any).render();\n this.hScrollBar.hideAll();\n\n this.vScrollBar = new ScrollBar({\n direction: 'vertical',\n x: -this.table.tableNoFrameWidth * 2,\n y: -this.table.tableNoFrameHeight * 2,\n width,\n height: this.table.tableNoFrameHeight - this.table.getFrozenRowsHeight(),\n padding: 0,\n railStyle: {\n fill: scrollRailColor\n },\n sliderStyle: {\n fill: scrollSliderColor\n },\n range: [0, 0.1],\n visible: false\n });\n (this.vScrollBar as any).render();\n this.vScrollBar.hideAll();\n }\n\n /**\n * @description: 更新滚动条尺寸\n * @return {*}\n */\n updateScrollBar() {\n const oldHorizontalBarPos = this.table.stateManeger.scroll.horizontalBarPos;\n const oldVerticalBarPos = this.table.stateManeger.scroll.verticalBarPos;\n\n const theme = this.table.theme;\n const width = theme.scrollStyle?.width as number;\n const visible = theme.scrollStyle?.visible as string;\n // const hoverOn = theme.scrollStyle?.hoverOn as boolean;\n const tableWidth = Math.ceil(this.table.scenegraph.tableGroup.attribute.width);\n const tableHeight = Math.ceil(this.table.scenegraph.tableGroup.attribute.height);\n\n const totalHeight = this.table.getAllRowsHeight();\n const totalWidth = this.table.getAllColsWidth();\n const frozenRowsHeight = this.table.getFrozenRowsHeight();\n const frozenColsWidth = this.table.getFrozenColsWidth();\n const bottomFrozenRowsHeight = this.table.getBottomFrozenRowsHeight();\n const rightFrozenColsWidth = this.table.getRightFrozenColsWidth();\n if (totalWidth > tableWidth) {\n const y = Math.min(tableHeight, totalHeight);\n const rangeEnd = Math.max(0.05, (tableWidth - frozenColsWidth) / (totalWidth - frozenColsWidth));\n this.hScrollBar.setAttributes({\n x: frozenColsWidth + (!this.table.theme.scrollStyle.hoverOn ? this.table.scenegraph.tableGroup.attribute.x : 0),\n y: y - (this.table.theme.scrollStyle.hoverOn ? width : -this.table.scenegraph.tableGroup.attribute.y),\n width: tableWidth - frozenColsWidth - rightFrozenColsWidth,\n range: [0, rangeEnd],\n visible: visible === 'always'\n });\n const bounds = this.hScrollBar.AABBBounds && this.hScrollBar.globalAABBBounds;\n (this.hScrollBar as any)._viewPosition = {\n x: bounds.x1,\n y: bounds.y1\n };\n if (visible === 'always') {\n this.hScrollBar.showAll();\n }\n } else {\n this.hScrollBar.setAttributes({\n x: -this.table.tableNoFrameWidth * 2,\n y: -this.table.tableNoFrameHeight * 2,\n width: 0,\n visible: false\n });\n }\n\n if (totalHeight > tableHeight) {\n const x = Math.min(tableWidth, totalWidth);\n const rangeEnd = Math.max(0.05, (tableHeight - frozenRowsHeight) / (totalHeight - frozenRowsHeight));\n this.vScrollBar.setAttributes({\n x: x - (this.table.theme.scrollStyle.hoverOn ? width : -this.table.scenegraph.tableGroup.attribute.x),\n y:\n frozenRowsHeight + (!this.table.theme.scrollStyle.hoverOn ? this.table.scenegraph.tableGroup.attribute.y : 0),\n height: tableHeight - frozenRowsHeight - bottomFrozenRowsHeight,\n range: [0, rangeEnd],\n visible: visible === 'always'\n });\n const bounds = this.vScrollBar.AABBBounds && this.vScrollBar.globalAABBBounds;\n (this.vScrollBar as any)._viewPosition = {\n x: bounds.x1,\n y: bounds.y1\n };\n\n if (visible === 'always') {\n this.vScrollBar.showAll();\n }\n } else {\n this.vScrollBar.setAttributes({\n x: -this.table.tableNoFrameWidth * 2,\n y: -this.table.tableNoFrameHeight * 2,\n height: 0,\n visible: false\n });\n }\n\n this.table.stateManeger.setScrollLeft(oldHorizontalBarPos);\n this.table.stateManeger.setScrollTop(oldVerticalBarPos);\n }\n\n /**\n * @description: 隐藏列宽调整组件\n * @return {*}\n */\n hideResizeCol() {\n // this.columnResizeLine.attribute.visible = false;\n this.columnResizeLine.setAttribute('visible', false);\n this.columnResizeBgLine.setAttribute('visible', false);\n this.columnResizeLabel.setAttribute('visible', false);\n this.columnResizeLabel.hideAll();\n }\n\n /**\n * @description: 显示列宽调整组件\n * @param {number} col\n * @param {number} y\n * @return {*}\n */\n showResizeCol(col: number, y: number, isRightFrozen?: boolean) {\n // this.columnResizeLine.attribute.visible = false;\n // 基准线\n const colX = getColX(col, this.table, isRightFrozen);\n this.columnResizeLine.setAttributes({\n visible: true,\n x: colX,\n points: [\n { x: 0, y: 0 },\n { x: 0, y: this.table.getRowsHeight(0, this.table.rowCount - 1) }\n ]\n });\n this.columnResizeBgLine.setAttributes({\n visible: true,\n x: colX,\n points: [\n { x: 0, y: 0 },\n { x: 0, y: this.table.getRowsHeight(0, this.table.rowCount - 1) }\n ]\n });\n\n // 标签\n // this.columnResizeLabel.setAttribute('visible', true);\n this.columnResizeLabel.showAll();\n this.columnResizeLabel.setAttributes({\n visible: true,\n x: colX,\n y\n });\n (this.columnResizeLabel.lastChild as WrapText).setAttribute('text', `${this.table.getColWidth(col)}px`);\n }\n\n /**\n * @description: 更新列宽调整组件\n * @param {number} col\n * @param {number} y 标签显示的y坐标\n * @return {*}\n */\n updateResizeCol(col: number, y: number, isRightFrozen?: boolean) {\n // 基准线\n const colX = getColX(col, this.table, isRightFrozen);\n // this.columnResizeLine.setAttribute('x', x);\n this.columnResizeLine.setAttributes({\n x: colX,\n points: [\n { x: 0, y: 0 },\n { x: 0, y: this.table.getRowsHeight(0, this.table.rowCount - 1) } // todo: 优化points赋值\n ]\n });\n this.columnResizeBgLine.setAttributes({\n x: colX,\n points: [\n { x: 0, y: 0 },\n { x: 0, y: this.table.getRowsHeight(0, this.table.rowCount - 1) } // todo: 优化points赋值\n ]\n });\n\n // 标签\n this.columnResizeLabel.setAttributes({\n x: colX,\n y\n });\n (this.columnResizeLabel.lastChild as WrapText).setAttribute('text', `${Math.floor(this.table.getColWidth(col))}px`);\n }\n\n /**\n * @description: 隐藏列顺序调整组件\n * @return {*}\n */\n hideMoveCol() {\n this.cellMover.hide();\n }\n\n /**\n * @description: 显示列顺序调整组件\n * @param {number} col\n * @param {number} x\n * @return {*}\n */\n showMoveCol(col: number, row: number, delta: number) {\n this.cellMover.show(col, row, delta);\n }\n\n /**\n * @description: 更新列顺序调整组件\n * @param {number} backX\n * @param {number} lineX\n * @return {*}\n */\n updateMoveCol(backX: number, lineX: number, backY: number, lineY: number) {\n this.cellMover.update(backX, lineX, backY, lineY);\n }\n\n /**\n * @description: 显示冻结列shadow\n * @param {number} col\n * @return {*}\n */\n setFrozenColumnShadow(col: number, isRightFrozen?: boolean) {\n if (col < 0) {\n this.frozenShadowLine.setAttributes({\n visible: false\n });\n } else {\n // const colX = this.table.getColsWidth(0, col);\n const colX = getColX(col, this.table, isRightFrozen);\n this.frozenShadowLine.setAttributes({\n visible: true,\n x: colX,\n height: this.table.getRowsHeight(0, this.table.rowCount - 1)\n });\n }\n }\n\n hideVerticalScrollBar() {\n const visable = this.table.theme.scrollStyle.visible;\n if (visable !== 'focus' && visable !== 'scrolling') {\n return;\n }\n this.vScrollBar.setAttribute('visible', false);\n this.vScrollBar.hideAll();\n this.table.scenegraph.updateNextFrame();\n }\n showVerticalScrollBar() {\n const visable = this.table.theme.scrollStyle.visible;\n if (visable !== 'focus' && visable !== 'scrolling') {\n return;\n }\n this.vScrollBar.setAttribute('visible', true);\n this.vScrollBar.showAll();\n this.table.scenegraph.updateNextFrame();\n }\n hideHorizontalScrollBar() {\n const visable = this.table.theme.scrollStyle.visible;\n if (visable !== 'focus' && visable !== 'scrolling') {\n return;\n }\n this.hScrollBar.setAttribute('visible', false);\n this.hScrollBar.hideAll();\n this.table.scenegraph.updateNextFrame();\n }\n showHorizontalScrollBar() {\n const visable = this.table.theme.scrollStyle.visible;\n if (visable !== 'focus' && visable !== 'scrolling') {\n return;\n }\n this.hScrollBar.setAttribute('visible', true);\n this.hScrollBar.showAll();\n this.table.scenegraph.updateNextFrame();\n }\n updateVerticalScrollBarPos(topRatio: number) {\n const range = this.vScrollBar.attribute.range;\n const size = range[1] - range[0];\n const range0 = topRatio * (1 - size);\n this.vScrollBar.setAttribute('range', [range0, range0 + size]);\n const bounds = this.vScrollBar.AABBBounds && this.vScrollBar.globalAABBBounds;\n (this.vScrollBar as any)._viewPosition = {\n x: bounds.x1,\n y: bounds.y1\n };\n }\n updateHorizontalScrollBarPos(leftRatio: number) {\n const range = this.hScrollBar.attribute.range;\n const size = range[1] - range[0];\n const range0 = leftRatio * (1 - size);\n this.hScrollBar.setAttribute('range', [range0, range0 + size]);\n const bounds = this.hScrollBar.AABBBounds && this.hScrollBar.globalAABBBounds;\n (this.hScrollBar as any)._viewPosition = {\n x: bounds.x1,\n y: bounds.y1\n };\n }\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/scenegraph/component/table-component.ts"],"names":[],"mappings":";;;AACA,+CAAkG;AAClG,qEAAyD;AAGzD,iCAAqC;AACrC,6CAAyC;AACzC,6CAAyC;AACzC,iCAAiC;AAOjC,MAAa,cAAc;IAezB,YAAY,KAAmB;;QAC7B,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC;QAG/B,IAAI,CAAC,eAAe,EAAE,CAAC;QAGvB,MAAM,iBAAiB,GAAG,MAAA,KAAK,CAAC,YAAY,0CAAE,SAAS,CAAC;QACxD,MAAM,iBAAiB,GAAG,MAAA,KAAK,CAAC,YAAY,0CAAE,SAAS,CAAC;QACxD,MAAM,mBAAmB,GAAG,MAAA,KAAK,CAAC,YAAY,0CAAE,OAAO,CAAC;QACxD,MAAM,mBAAmB,GAAG,MAAA,KAAK,CAAC,YAAY,0CAAE,KAAK,CAAC;QACtD,IAAI,CAAC,gBAAgB,GAAG,IAAA,oBAAU,EAAC;YACjC,OAAO,EAAE,KAAK;YACd,QAAQ,EAAE,KAAK;YACf,MAAM,EAAE,iBAA2B;YACnC,SAAS,EAAE,iBAA2B;YACtC,CAAC,EAAE,CAAC;YACJ,CAAC,EAAE,CAAC;YACJ,MAAM,EAAE;gBACN,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE;gBACd,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE;aAC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AI,CAAC,UAAU,CAAC,gBAAgB,CAAC;QAC7E,IAAI,CAAC,UAAkB,CAAC,aAAa,GAAG;YACvC,CAAC,EAAE,MAAM,CAAC,EAAE;YACZ,CAAC,EAAE,MAAM,CAAC,EAAE;SACb,CAAC;IACJ,CAAC;CACF;AA3dD,wCA2dC","file":"table-component.js","sourcesContent":["import type { ILine, IRect, IGroup } from '@visactor/vrender';\nimport { createRect, createLine, createText, createGroup, createSymbol } from '@visactor/vrender';\nimport { ScrollBar } from '@visactor/vrender-components';\nimport type { Group } from '../graphic/group';\nimport type { WrapText } from '../graphic/text';\nimport { MenuHandler } from './menu';\nimport { DrillIcon } from './drill-icon';\nimport { CellMover } from './cell-mover';\nimport { getColX } from './util';\nimport type { BaseTableAPI } from '../../ts-types/base-table';\n\n/**\n * @description: 表格内容外组件\n * @return {*}\n */\nexport class TableComponent {\n table: BaseTableAPI;\n\n border: IRect; // 表格外边框\n // selectBorder: IRect; // 表格选择区域边框\n columnResizeLine: ILine; // 表格列宽调整基准线\n columnResizeBgLine: ILine; // 表格列宽调整基准线背景\n columnResizeLabel: IGroup; // 表格列宽调整标记\n menu: MenuHandler; // 表格菜单\n vScrollBar: ScrollBar; // 表格横向滚动条\n hScrollBar: ScrollBar; // 表格纵向滚动条\n frozenShadowLine: IRect; // 表格冻结列右侧阴影块\n drillIcon: DrillIcon; // drill icon\n cellMover: CellMover; // 表格列顺序调整标记\n\n constructor(table: BaseTableAPI) {\n this.table = table;\n const theme = this.table.theme;\n\n // 滚动条\n this.createScrollBar();\n\n // 列宽调整基准线\n const columnResizeColor = theme.columnResize?.lineColor;\n const columnResizeWidth = theme.columnResize?.lineWidth;\n const columnResizeBgColor = theme.columnResize?.bgColor;\n const columnResizeBgWidth = theme.columnResize?.width;\n this.columnResizeLine = createLine({\n visible: false,\n pickable: false,\n stroke: columnResizeColor as string,\n lineWidth: columnResizeWidth as number,\n x: 0,\n y: 0,\n points: [\n { x: 0, y: 0 },\n { x: 0, y: 0 }\n ]\n });\n this.columnResizeBgLine = createLine({\n visible: false,\n pickable: false,\n stroke: columnResizeBgColor as string,\n lineWidth: columnResizeBgWidth as number,\n x: 0,\n y: 0,\n // dx: -(columnResizeBgWidth - columnResizeWidth) / 2,\n points: [\n { x: 0, y: 0 },\n { x: 0, y: 0 }\n ]\n });\n\n // 列宽调整文字标签\n const columnResizeLabelText = createText({\n visible: false,\n pickable: false,\n x: 0,\n y: 0,\n fontSize: 10,\n fill: '#FFF',\n text: '',\n textBaseline: 'top',\n dx: 12 + 4,\n dy: -8 + 2\n });\n const columnResizeLabelBack = createRect({\n visible: false,\n pickable: false,\n fill: '#3073F2',\n x: 0,\n y: 0,\n width: 38,\n height: 16,\n cornerRadius: 5,\n dx: 12,\n dy: -8\n });\n this.columnResizeLabel = createGroup({\n visible: false,\n pickable: false,\n x: 0,\n y: 0\n });\n this.columnResizeLabel.appendChild(columnResizeLabelBack);\n this.columnResizeLabel.appendChild(columnResizeLabelText);\n\n // 列顺序调整基准线\n this.cellMover = new CellMover(this.table);\n\n // 冻结列阴影\n const shadowWidth = theme.frozenColumnLine?.shadow?.width;\n const shadowStartColor = theme.frozenColumnLine?.shadow?.startColor;\n const shadowEndColor = theme.frozenColumnLine?.shadow?.endColor;\n this.frozenShadowLine = createRect({\n visible: true,\n pickable: false,\n x: 0,\n y: 0,\n width: shadowWidth,\n height: 0,\n fill: {\n gradient: 'linear',\n x0: 0,\n y0: 0,\n x1: 1,\n y1: 0,\n stops: [\n { color: shadowStartColor, offset: 0 },\n { color: shadowEndColor, offset: 1 }\n ]\n }\n });\n\n // TO BE DONE 冻结列border(theme.frozenColumnLine?.border)\n\n // 弹出窗口\n // this.menu = createGroup({\n // visible: false,\n // pickable: false,\n // x: 0,\n // y: 0,\n // });\n this.menu = new MenuHandler(this.table);\n\n this.drillIcon = new DrillIcon();\n }\n\n /**\n * @description: 组件mark加入到容器Group中\n * @param {Group} componentGroup\n * @return {*}\n */\n addToGroup(componentGroup: Group) {\n componentGroup.addChild(this.frozenShadowLine);\n // componentGroup.addChild(this.selectBorder);\n componentGroup.addChild(this.columnResizeBgLine);\n componentGroup.addChild(this.columnResizeLine);\n componentGroup.addChild(this.columnResizeLabel);\n if (this.table.theme.scrollStyle.hoverOn) {\n componentGroup.addChild(this.hScrollBar);\n componentGroup.addChild(this.vScrollBar);\n } else {\n componentGroup.stage.defaultLayer.addChild(this.hScrollBar);\n componentGroup.stage.defaultLayer.addChild(this.vScrollBar);\n }\n this.menu.bindTableComponent(componentGroup);\n this.drillIcon.appand(componentGroup);\n this.cellMover.appand(componentGroup);\n }\n\n /**\n * @description: 创建滚动条组件\n * @return {*}\n */\n createScrollBar() {\n const theme = this.table.theme;\n const scrollRailColor = theme.scrollStyle?.scrollRailColor as string;\n const scrollSliderColor = theme.scrollStyle?.scrollSliderColor as string;\n const width = theme.scrollStyle?.width as number;\n // const visible = theme.scrollStyle?.visible as string;\n // const hoverOn = theme.scrollStyle?.hoverOn as boolean;\n\n this.hScrollBar = new ScrollBar({\n direction: 'horizontal',\n x: -this.table.tableNoFrameWidth * 2,\n y: -this.table.tableNoFrameHeight * 2,\n width: this.table.tableNoFrameWidth,\n height: width,\n padding: 0,\n railStyle: {\n fill: scrollRailColor\n },\n sliderStyle: {\n fill: scrollSliderColor\n },\n range: [0, 0.1],\n // scrollRange: [0.4, 0.8]\n visible: false\n });\n // hack方案实现初始化隐藏滚动条,也可以add到stage之后执行hideAll\n (this.hScrollBar as any).render();\n this.hScrollBar.hideAll();\n\n this.vScrollBar = new ScrollBar({\n direction: 'vertical',\n x: -this.table.tableNoFrameWidth * 2,\n y: -this.table.tableNoFrameHeight * 2,\n width,\n height: this.table.tableNoFrameHeight - this.table.getFrozenRowsHeight(),\n padding: 0,\n railStyle: {\n fill: scrollRailColor\n },\n sliderStyle: {\n fill: scrollSliderColor\n },\n range: [0, 0.1],\n visible: false\n });\n (this.vScrollBar as any).render();\n this.vScrollBar.hideAll();\n }\n\n /**\n * @description: 更新滚动条尺寸\n * @return {*}\n */\n updateScrollBar() {\n const oldHorizontalBarPos = this.table.stateManager.scroll.horizontalBarPos;\n const oldVerticalBarPos = this.table.stateManager.scroll.verticalBarPos;\n\n const theme = this.table.theme;\n const width = theme.scrollStyle?.width as number;\n const visible = theme.scrollStyle?.visible as string;\n // const hoverOn = theme.scrollStyle?.hoverOn as boolean;\n const tableWidth = Math.ceil(this.table.scenegraph.tableGroup.attribute.width);\n const tableHeight = Math.ceil(this.table.scenegraph.tableGroup.attribute.height);\n\n const totalHeight = this.table.getAllRowsHeight();\n const totalWidth = this.table.getAllColsWidth();\n const frozenRowsHeight = this.table.getFrozenRowsHeight();\n const frozenColsWidth = this.table.getFrozenColsWidth();\n const bottomFrozenRowsHeight = this.table.getBottomFrozenRowsHeight();\n const rightFrozenColsWidth = this.table.getRightFrozenColsWidth();\n if (totalWidth > tableWidth) {\n const y = Math.min(tableHeight, totalHeight);\n const rangeEnd = Math.max(0.05, (tableWidth - frozenColsWidth) / (totalWidth - frozenColsWidth));\n this.hScrollBar.setAttributes({\n x: frozenColsWidth + (!this.table.theme.scrollStyle.hoverOn ? this.table.scenegraph.tableGroup.attribute.x : 0),\n y: y - (this.table.theme.scrollStyle.hoverOn ? width : -this.table.scenegraph.tableGroup.attribute.y),\n width: tableWidth - frozenColsWidth - rightFrozenColsWidth,\n range: [0, rangeEnd],\n visible: visible === 'always'\n });\n const bounds = this.hScrollBar.AABBBounds && this.hScrollBar.globalAABBBounds;\n (this.hScrollBar as any)._viewPosition = {\n x: bounds.x1,\n y: bounds.y1\n };\n if (visible === 'always') {\n this.hScrollBar.showAll();\n }\n } else {\n this.hScrollBar.setAttributes({\n x: -this.table.tableNoFrameWidth * 2,\n y: -this.table.tableNoFrameHeight * 2,\n width: 0,\n visible: false\n });\n }\n\n if (totalHeight > tableHeight) {\n const x = Math.min(tableWidth, totalWidth);\n const rangeEnd = Math.max(0.05, (tableHeight - frozenRowsHeight) / (totalHeight - frozenRowsHeight));\n this.vScrollBar.setAttributes({\n x: x - (this.table.theme.scrollStyle.hoverOn ? width : -this.table.scenegraph.tableGroup.attribute.x),\n y:\n frozenRowsHeight + (!this.table.theme.scrollStyle.hoverOn ? this.table.scenegraph.tableGroup.attribute.y : 0),\n height: tableHeight - frozenRowsHeight - bottomFrozenRowsHeight,\n range: [0, rangeEnd],\n visible: visible === 'always'\n });\n const bounds = this.vScrollBar.AABBBounds && this.vScrollBar.globalAABBBounds;\n (this.vScrollBar as any)._viewPosition = {\n x: bounds.x1,\n y: bounds.y1\n };\n\n if (visible === 'always') {\n this.vScrollBar.showAll();\n }\n } else {\n this.vScrollBar.setAttributes({\n x: -this.table.tableNoFrameWidth * 2,\n y: -this.table.tableNoFrameHeight * 2,\n height: 0,\n visible: false\n });\n }\n\n this.table.stateManager.setScrollLeft(oldHorizontalBarPos);\n this.table.stateManager.setScrollTop(oldVerticalBarPos);\n }\n\n /**\n * @description: 隐藏列宽调整组件\n * @return {*}\n */\n hideResizeCol() {\n // this.columnResizeLine.attribute.visible = false;\n this.columnResizeLine.setAttribute('visible', false);\n this.columnResizeBgLine.setAttribute('visible', false);\n this.columnResizeLabel.setAttribute('visible', false);\n this.columnResizeLabel.hideAll();\n }\n\n /**\n * @description: 显示列宽调整组件\n * @param {number} col\n * @param {number} y\n * @return {*}\n */\n showResizeCol(col: number, y: number, isRightFrozen?: boolean) {\n // this.columnResizeLine.attribute.visible = false;\n // 基准线\n const colX = getColX(col, this.table, isRightFrozen);\n this.columnResizeLine.setAttributes({\n visible: true,\n x: colX,\n points: [\n { x: 0, y: 0 },\n { x: 0, y: this.table.getRowsHeight(0, this.table.rowCount - 1) }\n ]\n });\n this.columnResizeBgLine.setAttributes({\n visible: true,\n x: colX,\n points: [\n { x: 0, y: 0 },\n { x: 0, y: this.table.getRowsHeight(0, this.table.rowCount - 1) }\n ]\n });\n\n // 标签\n // this.columnResizeLabel.setAttribute('visible', true);\n this.columnResizeLabel.showAll();\n this.columnResizeLabel.setAttributes({\n visible: true,\n x: colX,\n y\n });\n (this.columnResizeLabel.lastChild as WrapText).setAttribute('text', `${this.table.getColWidth(col)}px`);\n }\n\n /**\n * @description: 更新列宽调整组件\n * @param {number} col\n * @param {number} y 标签显示的y坐标\n * @return {*}\n */\n updateResizeCol(col: number, y: number, isRightFrozen?: boolean) {\n // 基准线\n const colX = getColX(col, this.table, isRightFrozen);\n // this.columnResizeLine.setAttribute('x', x);\n this.columnResizeLine.setAttributes({\n x: colX,\n points: [\n { x: 0, y: 0 },\n { x: 0, y: this.table.getRowsHeight(0, this.table.rowCount - 1) } // todo: 优化points赋值\n ]\n });\n this.columnResizeBgLine.setAttributes({\n x: colX,\n points: [\n { x: 0, y: 0 },\n { x: 0, y: this.table.getRowsHeight(0, this.table.rowCount - 1) } // todo: 优化points赋值\n ]\n });\n\n // 标签\n this.columnResizeLabel.setAttributes({\n x: colX,\n y\n });\n (this.columnResizeLabel.lastChild as WrapText).setAttribute('text', `${Math.floor(this.table.getColWidth(col))}px`);\n }\n\n /**\n * @description: 隐藏列顺序调整组件\n * @return {*}\n */\n hideMoveCol() {\n this.cellMover.hide();\n }\n\n /**\n * @description: 显示列顺序调整组件\n * @param {number} col\n * @param {number} x\n * @return {*}\n */\n showMoveCol(col: number, row: number, delta: number) {\n this.cellMover.show(col, row, delta);\n }\n\n /**\n * @description: 更新列顺序调整组件\n * @param {number} backX\n * @param {number} lineX\n * @return {*}\n */\n updateMoveCol(backX: number, lineX: number, backY: number, lineY: number) {\n this.cellMover.update(backX, lineX, backY, lineY);\n }\n\n /**\n * @description: 显示冻结列shadow\n * @param {number} col\n * @return {*}\n */\n setFrozenColumnShadow(col: number, isRightFrozen?: boolean) {\n if (col < 0) {\n this.frozenShadowLine.setAttributes({\n visible: false\n });\n } else {\n // const colX = this.table.getColsWidth(0, col);\n const colX = getColX(col, this.table, isRightFrozen);\n this.frozenShadowLine.setAttributes({\n visible: true,\n x: colX,\n height: this.table.getRowsHeight(0, this.table.rowCount - 1)\n });\n }\n }\n\n hideVerticalScrollBar() {\n const visable = this.table.theme.scrollStyle.visible;\n if (visable !== 'focus' && visable !== 'scrolling') {\n return;\n }\n this.vScrollBar.setAttribute('visible', false);\n this.vScrollBar.hideAll();\n this.table.scenegraph.updateNextFrame();\n }\n showVerticalScrollBar() {\n const visable = this.table.theme.scrollStyle.visible;\n if (visable !== 'focus' && visable !== 'scrolling') {\n return;\n }\n this.vScrollBar.setAttribute('visible', true);\n this.vScrollBar.showAll();\n this.table.scenegraph.updateNextFrame();\n }\n hideHorizontalScrollBar() {\n const visable = this.table.theme.scrollStyle.visible;\n if (visable !== 'focus' && visable !== 'scrolling') {\n return;\n }\n this.hScrollBar.setAttribute('visible', false);\n this.hScrollBar.hideAll();\n this.table.scenegraph.updateNextFrame();\n }\n showHorizontalScrollBar() {\n const visable = this.table.theme.scrollStyle.visible;\n if (visable !== 'focus' && visable !== 'scrolling') {\n return;\n }\n this.hScrollBar.setAttribute('visible', true);\n this.hScrollBar.showAll();\n this.table.scenegraph.updateNextFrame();\n }\n updateVerticalScrollBarPos(topRatio: number) {\n const range = this.vScrollBar.attribute.range;\n const size = range[1] - range[0];\n const range0 = topRatio * (1 - size);\n this.vScrollBar.setAttribute('range', [range0, range0 + size]);\n const bounds = this.vScrollBar.AABBBounds && this.vScrollBar.globalAABBBounds;\n (this.vScrollBar as any)._viewPosition = {\n x: bounds.x1,\n y: bounds.y1\n };\n }\n updateHorizontalScrollBarPos(leftRatio: number) {\n const range = this.hScrollBar.attribute.range;\n const size = range[1] - range[0];\n const range0 = leftRatio * (1 - size);\n this.hScrollBar.setAttribute('range', [range0, range0 + size]);\n const bounds = this.hScrollBar.AABBBounds && this.hScrollBar.globalAABBBounds;\n (this.hScrollBar as any)._viewPosition = {\n x: bounds.x1,\n y: bounds.y1\n };\n }\n}\n"]}
|
|
@@ -24,15 +24,18 @@ function renderChart(chart) {
|
|
|
24
24
|
if (viewBox.x2 <= viewBox.x1 && (viewBox.x2 = viewBox.x1 + 1), viewBox.y2 <= viewBox.y1 && (viewBox.y2 = viewBox.y1 + 1),
|
|
25
25
|
axes.forEach(((axis, index) => {
|
|
26
26
|
var _a, _b, _c, _d;
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
27
|
+
"linear" === axis.type ? chartInstance.updateModelSpecSync({
|
|
28
|
+
type: "axes",
|
|
29
|
+
index: index
|
|
30
|
+
}, {
|
|
31
|
+
min: null !== (_b = null === (_a = axis.range) || void 0 === _a ? void 0 : _a.min) && void 0 !== _b ? _b : 0,
|
|
32
|
+
max: null !== (_d = null === (_c = axis.range) || void 0 === _c ? void 0 : _c.max) && void 0 !== _d ? _d : 0
|
|
33
|
+
}, !0) : "band" === axis.type && chartInstance.updateModelSpec({
|
|
34
|
+
type: "axes",
|
|
35
|
+
index: index
|
|
36
|
+
}, {
|
|
37
|
+
domain: axis.domain.slice(0)
|
|
38
|
+
}, !0);
|
|
36
39
|
})), chartInstance.updateViewBox({
|
|
37
40
|
x1: viewBox.x1 - chart.getRootNode().table.scrollLeft,
|
|
38
41
|
x2: viewBox.x2 - chart.getRootNode().table.scrollLeft,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/scenegraph/graphic/contributions/chart-render-helper.ts"],"names":[],"mappings":";;;AAEA,6CAAmD;AACtC,QAAA,sBAAsB,GAAG,KAAK,CAAC;AAC/B,QAAA,eAAe,GAAa,EAAE,CAAC;AAC/B,QAAA,oBAAoB,GAAY,EAAE,CAAC;AAKhD,IAAI,qBAAqB,GAAG,CAAC,CAAC;AAC9B,IAAI,oBAAoB,GAAG,KAAK,CAAC;AACjC,SAAgB,wBAAwB,CAAC,KAAa;IACpD,IAAI,IAAA,gBAAO,EAAC,KAAK,CAAC,EAAE;QAClB,qBAAqB,GAAG,KAAK,CAAC;KAC/B;AACH,CAAC;AAJD,4DAIC;AACD,SAAgB,oBAAoB;IAClC,OAAO,oBAAoB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5B,MAAM,CAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;YAE5C,MAAM,MAAM,GAAG,KAAK,CAAC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;YAC7C,WAAW,CAAC,IAAI,CAAC;gBACf,MAAM;gBACN,CAAC,EAAE,MAAM;gBACT,CAAC,EAAE,MAAM;gBACT,KAAK;gBACL,MAAM;aACP,CAAC,CAAC;SACJ;KACF;IAED,KAAK,CAAC,WAAW,GAAG,WAAW,CAAC;AAClC,CAAC","file":"chart-render-helper.js","sourcesContent":["import type { IStage } from '@visactor/vrender';\nimport type { Chart } from '../chart';\nimport { Bounds, isValid } from '@visactor/vutils';\nexport const cancelRenderChartQueue = false;\nexport const chartRenderKeys: string[] = [];\nexport const chartRenderQueueList: Chart[] = [];\ninterface chartRenderQueueItem {\n chart: Chart;\n}\n//每次消费的图表数量\nlet batchRenderChartCount = 5;\nlet isHandlingChartQueue = false;\nexport function setBatchRenderChartCount(count: number) {\n if (isValid(count)) {\n batchRenderChartCount = count;\n }\n}\nexport function IsHandlingChartQueue() {\n return isHandlingChartQueue;\n}\nexport function renderChart(chart: Chart) {\n const { axes, dataId, data, spec } = chart.attribute;\n const { chartInstance } = chart;\n const viewBox = chart.getViewBox();\n\n // avoid canvas size 0\n if (viewBox.x2 <= viewBox.x1) {\n viewBox.x2 = viewBox.x1 + 1;\n }\n if (viewBox.y2 <= viewBox.y1) {\n viewBox.y2 = viewBox.y1 + 1;\n }\n\n axes.forEach((axis: any, index: number) => {\n if (axis.type === 'linear') {\n const chartAxis = chartInstance._chart._components[index];\n chartAxis._domain = {\n min: axis.range?.min ?? 0,\n max: axis.range?.max ?? 0\n };\n } else if (axis.type === 'band') {\n const chartAxis = chartInstance._chart._components[index];\n chartAxis._spec.domain = axis.domain.slice(0);\n chartAxis.updateScaleDomain();\n }\n });\n\n chartInstance.updateViewBox(\n {\n x1: viewBox.x1 - (chart.getRootNode() as any).table.scrollLeft,\n x2: viewBox.x2 - (chart.getRootNode() as any).table.scrollLeft,\n y1: viewBox.y1 - (chart.getRootNode() as any).table.scrollTop,\n y2: viewBox.y2 - (chart.getRootNode() as any).table.scrollTop\n },\n false,\n false\n );\n if (typeof dataId === 'string') {\n chartInstance.updateDataSync(dataId, data ?? []);\n } else {\n const dataBatch = [];\n for (const dataIdStr in dataId) {\n const dataIdAndField = dataId[dataIdStr];\n const series = spec.series.find((item: any) => item?.data?.id === dataIdStr);\n dataBatch.push({\n id: dataIdStr,\n values: dataIdAndField\n ? data?.filter((item: any) => {\n return item.hasOwnProperty(dataIdAndField);\n }) ?? []\n : data ?? [],\n fields: series?.data?.fields\n });\n // 判断是否有updateFullDataSync 木有的话 还是循环调用updateDataSync\n if (!chartInstance.updateFullDataSync) {\n chartInstance.updateDataSync(\n dataIdStr,\n dataIdAndField\n ? data?.filter((item: any) => {\n return item.hasOwnProperty(dataIdAndField);\n }) ?? []\n : data ?? []\n );\n }\n }\n chartInstance.updateFullDataSync?.(dataBatch);\n }\n const sg = chartInstance.getStage();\n cacheStageCanvas(sg, chart);\n // chart.cacheCanvas = sg.toCanvas();\n\n // debugger;\n // chart.cacheCanvas[] = sg.toCanvas(fullImage, viewBox);\n // chart.cacheCanvas = sg.toCanvas(false, {\n // x1: 0,\n // y1: 0,\n // x2: 500,\n // y2: 300,\n // width: () => 500,\n // height: () => 300\n // });\n // 截图空白问题 因为开启了动画 首屏截图是无数据的TODO\n}\n\nexport function startRenderChartQueue(table: any) {\n isHandlingChartQueue = true;\n\n // 检查是否还有未渲染的图表\n if (chartRenderQueueList.length > 0) {\n // 使用 requestAnimationFrame 或 setTimeout 来调度下一批图表的渲染\n // requestAnimationFrame(() => renderChartQueue(table));\n requestAnimationFrame(() => {\n // 从集合中获取要渲染的图表上下文\n const chartsToRender = chartRenderQueueList.splice(0, batchRenderChartCount);\n chartRenderKeys.splice(0, batchRenderChartCount);\n // 渲染图表\n chartsToRender.forEach(chart => {\n // 在正确的位置渲染图表\n renderChart(chart);\n chart.addUpdateBoundTag();\n });\n table.render();\n startRenderChartQueue(table);\n });\n // setTimeout(() => {\n // // debugger;\n // renderChartQueue(table);\n // }, 0);\n } else {\n isHandlingChartQueue = false;\n }\n}\n\nconst cacheCanvasSizeLimit = 2000;\nfunction cacheStageCanvas(stage: IStage, chart: Chart) {\n const { viewWidth, viewHeight } = stage;\n if (viewWidth < cacheCanvasSizeLimit && viewHeight < cacheCanvasSizeLimit) {\n chart.cacheCanvas = stage.toCanvas();\n return;\n }\n\n const rows = Math.ceil(viewHeight / cacheCanvasSizeLimit);\n const columns = Math.ceil(viewWidth / cacheCanvasSizeLimit);\n\n const cacheCanvas = [];\n for (let row = 0; row < rows; row++) {\n for (let col = 0; col < columns; col++) {\n const startX = col * cacheCanvasSizeLimit;\n const startY = row * cacheCanvasSizeLimit;\n const endX = startX + cacheCanvasSizeLimit > viewWidth ? viewWidth : startX + cacheCanvasSizeLimit;\n const endY = startY + cacheCanvasSizeLimit > viewHeight ? viewHeight : startY + cacheCanvasSizeLimit;\n const width = endX - startX;\n const height = endY - startY;\n const bounds = new Bounds();\n bounds.setValue(startX, startY, endX, endY);\n\n const canvas = stage.toCanvas(false, bounds);\n cacheCanvas.push({\n canvas,\n x: startX,\n y: startY,\n width,\n height\n });\n }\n }\n\n chart.cacheCanvas = cacheCanvas;\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/scenegraph/graphic/contributions/chart-render-helper.ts"],"names":[],"mappings":";;;AAEA,6CAAmD;AACtC,QAAA,sBAAsB,GAAG,KAAK,CAAC;AAC/B,QAAA,eAAe,GAAa,EAAE,CAAC;AAC/B,QAAA,oBAAoB,GAAY,EAAE,CAAC;AAKhD,IAAI,qBAAqB,GAAG,CAAC,CAAC;AAC9B,IAAI,oBAAoB,GAAG,KAAK,CAAC;AACjC,SAAgB,wBAAwB,CAAC,KAAa;IACpD,IAAI,IAAA,gBAAO,EAAC,KAAK,CAAC,EAAE;QAClB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M,MAAM,GAAG,IAAI,eAAM,EAAE,CAAC;YAC5B,MAAM,CAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;YAE5C,MAAM,MAAM,GAAG,KAAK,CAAC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;YAC7C,WAAW,CAAC,IAAI,CAAC;gBACf,MAAM;gBACN,CAAC,EAAE,MAAM;gBACT,CAAC,EAAE,MAAM;gBACT,KAAK;gBACL,MAAM;aACP,CAAC,CAAC;SACJ;KACF;IAED,KAAK,CAAC,WAAW,GAAG,WAAW,CAAC;AAClC,CAAC","file":"chart-render-helper.js","sourcesContent":["import type { IStage } from '@visactor/vrender';\nimport type { Chart } from '../chart';\nimport { Bounds, isValid } from '@visactor/vutils';\nexport const cancelRenderChartQueue = false;\nexport const chartRenderKeys: string[] = [];\nexport const chartRenderQueueList: Chart[] = [];\ninterface chartRenderQueueItem {\n chart: Chart;\n}\n//每次消费的图表数量\nlet batchRenderChartCount = 5;\nlet isHandlingChartQueue = false;\nexport function setBatchRenderChartCount(count: number) {\n if (isValid(count)) {\n batchRenderChartCount = count;\n }\n}\nexport function IsHandlingChartQueue() {\n return isHandlingChartQueue;\n}\nexport function renderChart(chart: Chart) {\n const { axes, dataId, data, spec } = chart.attribute;\n const { chartInstance } = chart;\n const viewBox = chart.getViewBox();\n\n // avoid canvas size 0\n if (viewBox.x2 <= viewBox.x1) {\n viewBox.x2 = viewBox.x1 + 1;\n }\n if (viewBox.y2 <= viewBox.y1) {\n viewBox.y2 = viewBox.y1 + 1;\n }\n\n axes.forEach((axis: any, index: number) => {\n if (axis.type === 'linear') {\n // const chartAxis = chartInstance._chart._components[index];\n // chartAxis._domain = {\n // min: axis.range?.min ?? 0,\n // max: axis.range?.max ?? 0\n // };\n chartInstance.updateModelSpecSync(\n { type: 'axes', index },\n { min: axis.range?.min ?? 0, max: axis.range?.max ?? 0 },\n true\n );\n } else if (axis.type === 'band') {\n // const chartAxis = chartInstance._chart._components[index];\n // chartAxis._spec.domain = axis.domain.slice(0);\n // chartAxis.updateScaleDomain();\n chartInstance.updateModelSpec({ type: 'axes', index }, { domain: axis.domain.slice(0) }, true);\n }\n });\n\n chartInstance.updateViewBox(\n {\n x1: viewBox.x1 - (chart.getRootNode() as any).table.scrollLeft,\n x2: viewBox.x2 - (chart.getRootNode() as any).table.scrollLeft,\n y1: viewBox.y1 - (chart.getRootNode() as any).table.scrollTop,\n y2: viewBox.y2 - (chart.getRootNode() as any).table.scrollTop\n },\n false,\n false\n );\n if (typeof dataId === 'string') {\n chartInstance.updateDataSync(dataId, data ?? []);\n } else {\n const dataBatch = [];\n for (const dataIdStr in dataId) {\n const dataIdAndField = dataId[dataIdStr];\n const series = spec.series.find((item: any) => item?.data?.id === dataIdStr);\n dataBatch.push({\n id: dataIdStr,\n values: dataIdAndField\n ? data?.filter((item: any) => {\n return item.hasOwnProperty(dataIdAndField);\n }) ?? []\n : data ?? [],\n fields: series?.data?.fields\n });\n // 判断是否有updateFullDataSync 木有的话 还是循环调用updateDataSync\n if (!chartInstance.updateFullDataSync) {\n chartInstance.updateDataSync(\n dataIdStr,\n dataIdAndField\n ? data?.filter((item: any) => {\n return item.hasOwnProperty(dataIdAndField);\n }) ?? []\n : data ?? []\n );\n }\n }\n chartInstance.updateFullDataSync?.(dataBatch);\n }\n const sg = chartInstance.getStage();\n cacheStageCanvas(sg, chart);\n // chart.cacheCanvas = sg.toCanvas();\n\n // debugger;\n // chart.cacheCanvas[] = sg.toCanvas(fullImage, viewBox);\n // chart.cacheCanvas = sg.toCanvas(false, {\n // x1: 0,\n // y1: 0,\n // x2: 500,\n // y2: 300,\n // width: () => 500,\n // height: () => 300\n // });\n // 截图空白问题 因为开启了动画 首屏截图是无数据的TODO\n}\n\nexport function startRenderChartQueue(table: any) {\n isHandlingChartQueue = true;\n\n // 检查是否还有未渲染的图表\n if (chartRenderQueueList.length > 0) {\n // 使用 requestAnimationFrame 或 setTimeout 来调度下一批图表的渲染\n // requestAnimationFrame(() => renderChartQueue(table));\n requestAnimationFrame(() => {\n // 从集合中获取要渲染的图表上下文\n const chartsToRender = chartRenderQueueList.splice(0, batchRenderChartCount);\n chartRenderKeys.splice(0, batchRenderChartCount);\n // 渲染图表\n chartsToRender.forEach(chart => {\n // 在正确的位置渲染图表\n renderChart(chart);\n chart.addUpdateBoundTag();\n });\n table.render();\n startRenderChartQueue(table);\n });\n // setTimeout(() => {\n // // debugger;\n // renderChartQueue(table);\n // }, 0);\n } else {\n isHandlingChartQueue = false;\n }\n}\n\nconst cacheCanvasSizeLimit = 2000;\nfunction cacheStageCanvas(stage: IStage, chart: Chart) {\n const { viewWidth, viewHeight } = stage;\n if (viewWidth < cacheCanvasSizeLimit && viewHeight < cacheCanvasSizeLimit) {\n chart.cacheCanvas = stage.toCanvas();\n return;\n }\n\n const rows = Math.ceil(viewHeight / cacheCanvasSizeLimit);\n const columns = Math.ceil(viewWidth / cacheCanvasSizeLimit);\n\n const cacheCanvas = [];\n for (let row = 0; row < rows; row++) {\n for (let col = 0; col < columns; col++) {\n const startX = col * cacheCanvasSizeLimit;\n const startY = row * cacheCanvasSizeLimit;\n const endX = startX + cacheCanvasSizeLimit > viewWidth ? viewWidth : startX + cacheCanvasSizeLimit;\n const endY = startY + cacheCanvasSizeLimit > viewHeight ? viewHeight : startY + cacheCanvasSizeLimit;\n const width = endX - startX;\n const height = endY - startY;\n const bounds = new Bounds();\n bounds.setValue(startX, startY, endX, endY);\n\n const canvas = stage.toCanvas(false, bounds);\n cacheCanvas.push({\n canvas,\n x: startX,\n y: startY,\n width,\n height\n });\n }\n }\n\n chart.cacheCanvas = cacheCanvas;\n}\n"]}
|
|
@@ -181,7 +181,7 @@ let AdjustColorGroupBeforeRenderContribution = class {
|
|
|
181
181
|
drawShape(group, context, x, y, doFill, doStroke, fVisible, sVisible, groupAttribute, drawContext, fillCb, strokeCb, doFillOrStroke) {
|
|
182
182
|
if ("cell" === group.role) {
|
|
183
183
|
const table = group.stage.table;
|
|
184
|
-
if (table.
|
|
184
|
+
if (table.stateManager.interactionState !== ts_types_1.InteractionState.scrolling) {
|
|
185
185
|
const hoverColor = (0, is_cell_hover_1.getCellHoverColor)(group, table);
|
|
186
186
|
hoverColor && (group.oldColor = group.attribute.fill, group.attribute.fill = hoverColor);
|
|
187
187
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/scenegraph/graphic/contributions/group-contribution-render.ts"],"names":[],"mappings":";;;;;;;;;AAUA,+CAA2E;AAE3E,sEAAuE;AAGvE,+DAA8D;AAC9D,gDAAqD;AAO9C,IAAM,kCAAkC,GAAxC,MAAM,kCAAkC;IAAxC;QACL,SAAI,GAA+B,oCAA0B,CAAC,gBAAgB,CAAC;QAC/E,aAAQ,GAAG,IAAI,CAAC;QAChB,UAAK,GAAG,CAAC,CAAC;IAmEZ,CAAC;IAlEC,SAAS,CACP,KAAa,EACb,OAAmB,EACnB,CAAS,EACT,CAAS,EACT,MAAe,EACf,QAAiB,EACjB,QAAiB,EACjB,QAAiB,EACjB,cAAgD,EAChD,WAAyB,EACzB,MAIY,EACZ,QAIY,EACZ,cAAuD;QAEvD,MAAM,EACJ,MAAM,GAAG,cAAc,CAAC,MAAM,EAC9B,gBAAgB,GAAI,cAAsB,CAAC,gBAAgB,EAC3D,gBAAgB,GAAI,cAAsB,CAAC,gBAAgB,EAK5D,GAAG,KAAK,CAAC,SAAgB,CAAC;QAE3B,IAAI,MAAM,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,gBAAgB,CAAC,IAAI,KAAK,CAAC,OAAO,CAAC,gBAAgB,CAAC,CAAC,EAAE;YAClF,cAAc,CAAC,QAAQ,GAAG,KAAK,CAAC;SACjC;IA8BH,CAAC;CACF,CAAA;AAtEY,kCAAkC;IAD9C,IAAA,oBAAU,GAAE;GACA,kCAAkC,CAsE9C;AAtEY,gFAAkC;AAwExC,IAAM,iCAAiC,GAAvC,MAAM,iCAAiC;IAAv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IAAI,CAAC,CAAC;SACZ;QACD,IAAI,KAAK,CAAC,SAAS,EAAE;YACnB,MAAM,IAAI,CAAC,CAAC;SACb;KACF;IACD,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC;AAC3B,CAAC","file":"group-contribution-render.js","sourcesContent":["import type {\n IGroup,\n IContext2d,\n IGroupGraphicAttribute,\n IMarkAttribute,\n IGraphicAttribute,\n IThemeAttribute,\n IGroupRenderContribution,\n IDrawContext\n} from '@visactor/vrender';\nimport { BaseRenderContributionTime, injectable } from '@visactor/vrender';\nimport type { Group } from '../group';\nimport { getCellHoverColor } from '../../../state/hover/is-cell-hover';\nimport type { BaseTableAPI } from '../../../ts-types/base-table';\nimport { getQuadProps } from '../../utils/padding';\nimport { getCellMergeInfo } from '../../utils/get-cell-merge';\nimport { InteractionState } from '../../../ts-types';\n\n// const highlightDash: number[] = [];\n\n// SplitGroupContribution处理分段渲染stroke\n// stroke/strokeArrayWidth/strokeArrayColor 为数组时调用\n@injectable()\nexport class SplitGroupBeforeRenderContribution implements IGroupRenderContribution {\n time: BaseRenderContributionTime = BaseRenderContributionTime.beforeFillStroke;\n useStyle = true;\n order = 0;\n drawShape(\n group: IGroup,\n context: IContext2d,\n x: number,\n y: number,\n doFill: boolean,\n doStroke: boolean,\n fVisible: boolean,\n sVisible: boolean,\n groupAttribute: Required<IGroupGraphicAttribute>,\n drawContext: IDrawContext,\n fillCb?: (\n ctx: IContext2d,\n markAttribute: Partial<IMarkAttribute & IGraphicAttribute>,\n themeAttribute: IThemeAttribute\n ) => boolean,\n strokeCb?: (\n ctx: IContext2d,\n markAttribute: Partial<IMarkAttribute & IGraphicAttribute>,\n themeAttribute: IThemeAttribute\n ) => boolean,\n doFillOrStroke?: { doFill: boolean; doStroke: boolean }\n ) {\n const {\n stroke = groupAttribute.stroke,\n strokeArrayWidth = (groupAttribute as any).strokeArrayWidth,\n strokeArrayColor = (groupAttribute as any).strokeArrayColor\n // highlightStroke = (groupAttribute as any).highlightStroke,\n // highlightStrokeArrayWidth = (groupAttribute as any).highlightStrokeArrayWidth,\n // width = groupAttribute.width,\n // height = groupAttribute.height,\n } = group.attribute as any;\n\n if (stroke && (Array.isArray(strokeArrayWidth) || Array.isArray(strokeArrayColor))) {\n doFillOrStroke.doStroke = false;\n }\n\n // if (highlightStroke) {\n // // 依据highlightStroke信息调整clip范围,以实现在单个单元格显示highlight border\n // let xDist = x;\n // let yDist = y;\n // let widthDist = width;\n // let heightDist = height;\n // if (highlightStroke[0] && highlightStrokeArrayWidth[0]) {\n // // top\n // yDist -= highlightStrokeArrayWidth[0] / 2;\n // heightDist += highlightStrokeArrayWidth[0] / 2;\n // }\n // if (highlightStroke[1] && highlightStrokeArrayWidth[1]) {\n // // right\n // widthDist += highlightStrokeArrayWidth[1] / 2;\n // }\n // if (highlightStroke[2] && highlightStrokeArrayWidth[2]) {\n // // bottom\n // heightDist += highlightStrokeArrayWidth[2] / 2;\n // }\n // if (highlightStroke[3] && highlightStrokeArrayWidth[3]) {\n // // left\n // xDist -= highlightStrokeArrayWidth[3] / 2;\n // widthDist += highlightStrokeArrayWidth[3] / 2;\n // }\n\n // context.beginPath();\n // context.rect(xDist, yDist, widthDist, heightDist);\n // }\n }\n}\n@injectable()\nexport class SplitGroupAfterRenderContribution implements IGroupRenderContribution {\n time: BaseRenderContributionTime = BaseRenderContributionTime.afterFillStroke;\n useStyle = true;\n order = 0;\n drawShape(\n group: IGroup,\n context: IContext2d,\n x: number,\n y: number,\n doFill: boolean,\n doStroke: boolean,\n fVisible: boolean,\n sVisible: boolean,\n groupAttribute: Required<IGroupGraphicAttribute>,\n drawContext: IDrawContext,\n fillCb?: (\n ctx: IContext2d,\n markAttribute: Partial<IMarkAttribute & IGraphicAttribute>,\n themeAttribute: IThemeAttribute\n ) => boolean,\n strokeCb?: (\n ctx: IContext2d,\n markAttribute: Partial<IMarkAttribute & IGraphicAttribute>,\n themeAttribute: IThemeAttribute\n ) => boolean\n ) {\n const {\n width = groupAttribute.width,\n height = groupAttribute.height,\n // 基础border\n stroke = groupAttribute.stroke,\n strokeArrayColor = (groupAttribute as any).strokeArrayColor,\n strokeArrayWidth = (groupAttribute as any).strokeArrayWidth,\n\n lineWidth = groupAttribute.lineWidth,\n strokeColor = groupAttribute.stroke\n // // select & hover border\n // highlightStroke = (groupAttribute as any).highlightStroke,\n // highlightStrokeArrayColor = (groupAttribute as any).highlightStrokeArrayColor,\n // highlightStrokeArrayWidth = (groupAttribute as any).highlightStrokeArrayWidth,\n // highlightStrokeArrayPart = (groupAttribute as any).highlightStrokeArrayPart,\n } = group.attribute as any;\n\n // lineWidth === 0 不绘制\n if (!stroke || (!Array.isArray(strokeArrayWidth) && lineWidth === 0)) {\n return;\n }\n\n let widthForStroke;\n let heightForStroke;\n if (Array.isArray(strokeArrayColor) || Array.isArray(strokeArrayWidth)) {\n if (\n (typeof lineWidth === 'number' && lineWidth & 1) ||\n (Array.isArray(strokeArrayWidth) && strokeArrayWidth.some(width => width & 1))\n ) {\n x = Math.floor(x) + 0.5;\n y = Math.floor(y) + 0.5;\n\n const { width: widthFroDraw, height: heightFroDraw } = getCellSizeForDraw(\n group,\n Math.ceil(width),\n Math.ceil(height)\n );\n widthForStroke = widthFroDraw;\n heightForStroke = heightFroDraw;\n } else {\n widthForStroke = Math.ceil(width);\n heightForStroke = Math.ceil(height);\n }\n renderStroke(\n group,\n context,\n x,\n y,\n groupAttribute,\n stroke,\n strokeArrayWidth || lineWidth,\n strokeArrayColor || strokeColor,\n // Math.ceil(width),\n // Math.ceil(height)\n widthForStroke,\n heightForStroke\n );\n }\n }\n}\n\n/**\n * @description: 判断线宽是否需要分别渲染(线宽不同)\n * @param {number} widthArray\n * @return {*}\n */\nexport function getWidthInfo(widthArray: number[] | number) {\n if (!Array.isArray(widthArray)) {\n return {\n isSplitDraw: false,\n width: widthArray\n };\n }\n\n let temp;\n for (let i = 0; i < widthArray.length; i++) {\n const width = widthArray[i];\n if (width) {\n if (!temp) {\n temp = width;\n } else if (width !== temp) {\n return {\n isSplitDraw: true\n };\n }\n }\n }\n\n return {\n isSplitDraw: false,\n width: temp\n };\n}\n\nexport function renderStroke(\n group: IGroup,\n context: IContext2d,\n x: number,\n y: number,\n groupAttribute: Required<IGroupGraphicAttribute>,\n stroke: boolean | [boolean, boolean, boolean, boolean],\n strokeArrayWidth: [number, number, number, number] | undefined,\n strokeArrayColor: [string, string, string, string] | undefined,\n width: number,\n height: number,\n isHighlight?: boolean,\n part?: ([number, number] | undefined)[]\n) {\n const widthInfo = getWidthInfo(strokeArrayWidth);\n const isWidthNumber = !Array.isArray(strokeArrayWidth);\n const isStrokeTrue = !Array.isArray(stroke);\n // 渲染部分线段,part: [[0, 0.5], undifined, undifined, undifined]\n // 同样上右下左,范围0-1,[0, 0.5]即只渲染前一半\n const isPart = Array.isArray(part);\n const isSplitDraw = Array.isArray(strokeArrayColor) || widthInfo.isSplitDraw;\n\n context.setStrokeStyle(group, group.attribute, x, y, groupAttribute);\n // if (isHighlight) {\n // context.setLineDash(highlightDash);\n // context.lineCap = 'square';\n // }\n const lineDash = context.getLineDash();\n let isDash = false;\n if (lineDash.length) {\n isDash = true;\n }\n // 单独处理每条边界,目前不考虑圆角\n context.beginPath();\n context.moveTo(x, y);\n\n // top\n if ((isStrokeTrue || stroke[0]) && (isWidthNumber || strokeArrayWidth[0])) {\n // context.lineTo(x + width, y);\n if (isPart && Array.isArray(part[0])) {\n context.moveTo(x + width * part[0][0], y);\n context.lineTo(x + width * (part[0][1] - part[0][0]), y);\n context.moveTo(x + width, y);\n } else {\n context.moveTo(x, y);\n context.lineTo(x + width, y);\n }\n if ((isSplitDraw || isDash) && (!strokeArrayColor || strokeArrayColor[0])) {\n if (strokeArrayColor) {\n context.strokeStyle = strokeArrayColor[0];\n }\n if (!isWidthNumber) {\n context.lineWidth = strokeArrayWidth[0];\n }\n context.lineDashOffset = context.currentMatrix.e / context.currentMatrix.a;\n context.stroke();\n context.beginPath();\n context.moveTo(x + width, y);\n }\n } else {\n context.moveTo(x + width, y);\n }\n // right\n if ((isStrokeTrue || stroke[1]) && (isWidthNumber || strokeArrayWidth[1])) {\n // context.lineTo(x + width, y + height);\n if (isPart && Array.isArray(part[1])) {\n context.moveTo(x + width, y + height * part[1][0]);\n context.lineTo(x + width, y + height * (part[1][1] - part[1][0]));\n context.moveTo(x + width, y + height);\n } else {\n context.moveTo(x + width, y);\n context.lineTo(x + width, y + height);\n }\n if ((isSplitDraw || isDash) && (!strokeArrayColor || strokeArrayColor[1])) {\n if (strokeArrayColor) {\n context.strokeStyle = strokeArrayColor[1];\n }\n if (!isWidthNumber) {\n context.lineWidth = strokeArrayWidth[1];\n }\n context.lineDashOffset = context.currentMatrix.f / context.currentMatrix.d;\n context.stroke();\n context.beginPath();\n context.moveTo(x + width, y + height);\n }\n } else {\n context.moveTo(x + width, y + height);\n }\n // bottom\n if ((isStrokeTrue || stroke[2]) && (isWidthNumber || strokeArrayWidth[2])) {\n // context.lineTo(x, y + height);\n if (isPart && Array.isArray(part[2])) {\n context.moveTo(x + width * part[2][0], y + height);\n context.lineTo(x + width * (part[2][1] - part[2][0]), y + height);\n context.moveTo(x, y + height);\n } else {\n context.moveTo(x, y + height);\n context.lineTo(x + width, y + height);\n }\n if ((isSplitDraw || isDash) && (!strokeArrayColor || strokeArrayColor[2])) {\n if (strokeArrayColor) {\n context.strokeStyle = strokeArrayColor[2];\n }\n if (!isWidthNumber) {\n context.lineWidth = strokeArrayWidth[2];\n }\n context.lineDashOffset = context.currentMatrix.e / context.currentMatrix.a;\n context.stroke();\n context.beginPath();\n context.moveTo(x, y + height);\n }\n } else {\n context.moveTo(x, y + height);\n }\n // left\n if ((isStrokeTrue || stroke[3]) && (isWidthNumber || strokeArrayWidth[3])) {\n // context.lineTo(x, y);\n if (isPart && Array.isArray(part[3])) {\n context.moveTo(x, y + height * part[3][0]);\n context.lineTo(x, y + height * (part[3][1] - part[3][0]));\n context.moveTo(x, y);\n } else {\n context.moveTo(x, y);\n context.lineTo(x, y + height);\n }\n if ((isSplitDraw || isDash) && (!strokeArrayColor || strokeArrayColor[3])) {\n if (strokeArrayColor) {\n context.strokeStyle = strokeArrayColor[3];\n }\n if (!isWidthNumber) {\n context.lineWidth = strokeArrayWidth[3];\n }\n context.lineDashOffset = context.currentMatrix.f / context.currentMatrix.d;\n context.stroke();\n context.beginPath();\n context.moveTo(x, y);\n }\n } else {\n context.moveTo(x, y);\n }\n\n if (!isSplitDraw && !isDash) {\n // context.strokeStyle = strokeArrayColor;\n if (!isWidthNumber && widthInfo.width) {\n context.lineWidth = widthInfo.width;\n }\n context.stroke();\n }\n}\n\n// DashGroupContribution处理虚线边框对齐\n// lineDash 为非空数组时调用\n@injectable()\nexport class DashGroupBeforeRenderContribution implements IGroupRenderContribution {\n time: BaseRenderContributionTime = BaseRenderContributionTime.beforeFillStroke;\n useStyle = true;\n order = 0;\n drawShape(\n group: IGroup,\n context: IContext2d,\n x: number,\n y: number,\n doFill: boolean,\n doStroke: boolean,\n fVisible: boolean,\n sVisible: boolean,\n groupAttribute: Required<IGroupGraphicAttribute>,\n drawContext: IDrawContext,\n fillCb?: (\n ctx: IContext2d,\n markAttribute: Partial<IMarkAttribute & IGraphicAttribute>,\n themeAttribute: IThemeAttribute\n ) => boolean,\n strokeCb?: (\n ctx: IContext2d,\n markAttribute: Partial<IMarkAttribute & IGraphicAttribute>,\n themeAttribute: IThemeAttribute\n ) => boolean,\n doFillOrStroke?: { doFill: boolean; doStroke: boolean }\n ) {\n const {\n lineDash = groupAttribute.lineDash,\n stroke = groupAttribute.stroke,\n strokeArrayColor = (groupAttribute as any).strokeArrayColor,\n strokeArrayWidth = (groupAttribute as any).strokeArrayWidth\n } = group.attribute as any;\n\n if (\n stroke &&\n Array.isArray(lineDash) &&\n lineDash.length &&\n !Array.isArray(strokeArrayColor) &&\n !Array.isArray(strokeArrayWidth)\n ) {\n doFillOrStroke.doStroke = false;\n }\n }\n}\n@injectable()\nexport class DashGroupAfterRenderContribution implements IGroupRenderContribution {\n time: BaseRenderContributionTime = BaseRenderContributionTime.afterFillStroke;\n useStyle = true;\n order = 0;\n drawShape(\n group: IGroup,\n context: IContext2d,\n x: number,\n y: number,\n doFill: boolean,\n doStroke: boolean,\n fVisible: boolean,\n sVisible: boolean,\n groupAttribute: Required<IGroupGraphicAttribute>,\n drawContext: IDrawContext,\n fillCb?: (\n ctx: IContext2d,\n markAttribute: Partial<IMarkAttribute & IGraphicAttribute>,\n themeAttribute: IThemeAttribute\n ) => boolean,\n strokeCb?: (\n ctx: IContext2d,\n markAttribute: Partial<IMarkAttribute & IGraphicAttribute>,\n themeAttribute: IThemeAttribute\n ) => boolean\n ) {\n const {\n lineDash = groupAttribute.lineDash,\n stroke = groupAttribute.stroke,\n strokeArrayColor = (groupAttribute as any).strokeArrayColor,\n strokeArrayWidth = (groupAttribute as any).strokeArrayWidth,\n lineWidth = groupAttribute.lineWidth\n } = group.attribute as any;\n\n if (\n !stroke ||\n !(Array.isArray(lineDash) && lineDash.length) ||\n Array.isArray(strokeArrayColor) ||\n Array.isArray(strokeArrayWidth)\n ) {\n return;\n }\n\n // const { width = groupAttribute.width, height = groupAttribute.height } = group.attribute;\n let { width = groupAttribute.width, height = groupAttribute.height } = group.attribute;\n width = Math.ceil(width);\n height = Math.ceil(height);\n\n let widthForStroke;\n let heightForStroke;\n if (lineWidth & 1) {\n x = Math.floor(x) + 0.5;\n y = Math.floor(y) + 0.5;\n\n const { width: widthFroDraw, height: heightFroDraw } = getCellSizeForDraw(\n group,\n Math.ceil(width),\n Math.ceil(height)\n );\n widthForStroke = widthFroDraw;\n heightForStroke = heightFroDraw;\n } else {\n widthForStroke = Math.ceil(width);\n heightForStroke = Math.ceil(height);\n }\n context.setStrokeStyle(group, group.attribute, x, y, groupAttribute);\n // 分段设置lineDashOffset,实现虚线边框对齐\n // top\n context.beginPath();\n context.moveTo(x, y);\n context.lineTo(x + widthForStroke, y);\n context.lineDashOffset = context.currentMatrix.e / context.currentMatrix.a;\n context.stroke();\n\n // right\n context.beginPath();\n context.moveTo(x + widthForStroke, y);\n context.lineTo(x + widthForStroke, y + heightForStroke);\n context.lineDashOffset = context.currentMatrix.f / context.currentMatrix.d;\n context.stroke();\n\n // bottom\n context.beginPath();\n context.moveTo(x, y + heightForStroke);\n context.lineTo(x + widthForStroke, y + heightForStroke);\n context.lineDashOffset = context.currentMatrix.e / context.currentMatrix.a;\n context.stroke();\n\n // left\n context.beginPath();\n context.moveTo(x, y);\n context.lineTo(x, y + heightForStroke);\n context.lineDashOffset = context.currentMatrix.f / context.currentMatrix.d;\n context.stroke();\n }\n}\n\n// AdjustPosGroupContribution处理线宽为奇数时stroke位置偏移0.5px\n// lineWidth 为奇数时调用\n@injectable()\nexport class AdjustPosGroupBeforeRenderContribution implements IGroupRenderContribution {\n time: BaseRenderContributionTime = BaseRenderContributionTime.beforeFillStroke;\n useStyle = true;\n order = 0;\n drawShape(\n group: IGroup,\n context: IContext2d,\n x: number,\n y: number,\n doFill: boolean,\n doStroke: boolean,\n fVisible: boolean,\n sVisible: boolean,\n groupAttribute: Required<IGroupGraphicAttribute>,\n drawContext: IDrawContext,\n fillCb?: (\n ctx: IContext2d,\n markAttribute: Partial<IMarkAttribute & IGraphicAttribute>,\n themeAttribute: IThemeAttribute\n ) => boolean,\n strokeCb?: (\n ctx: IContext2d,\n markAttribute: Partial<IMarkAttribute & IGraphicAttribute>,\n themeAttribute: IThemeAttribute\n ) => boolean,\n doFillOrStroke?: { doFill: boolean; doStroke: boolean }\n ) {\n const {\n lineWidth = groupAttribute.lineWidth,\n stroke = groupAttribute.stroke,\n lineDash = groupAttribute.lineDash,\n // width = groupAttribute.width,\n // height = groupAttribute.height,\n strokeArrayWidth = (groupAttribute as any).strokeArrayWidth,\n strokeArrayColor = (groupAttribute as any).strokeArrayColor\n } = group.attribute as any;\n\n if (\n stroke &&\n Array.isArray(lineDash) &&\n !lineDash.length && // 非虚线\n !Array.isArray(strokeArrayColor) &&\n !Array.isArray(strokeArrayWidth) &&\n lineWidth & 1 // 奇数线宽\n ) {\n doFillOrStroke.doStroke = false;\n }\n }\n}\n\n@injectable()\nexport class AdjustPosGroupAfterRenderContribution implements IGroupRenderContribution {\n time: BaseRenderContributionTime = BaseRenderContributionTime.afterFillStroke;\n useStyle = true;\n order = 0;\n drawShape(\n group: IGroup,\n context: IContext2d,\n x: number,\n y: number,\n doFill: boolean,\n doStroke: boolean,\n fVisible: boolean,\n sVisible: boolean,\n groupAttribute: Required<IGroupGraphicAttribute>,\n drawContext: IDrawContext,\n fillCb?: (\n ctx: IContext2d,\n markAttribute: Partial<IMarkAttribute & IGraphicAttribute>,\n themeAttribute: IThemeAttribute\n ) => boolean,\n strokeCb?: (\n ctx: IContext2d,\n markAttribute: Partial<IMarkAttribute & IGraphicAttribute>,\n themeAttribute: IThemeAttribute\n ) => boolean\n ) {\n const {\n lineWidth = groupAttribute.lineWidth,\n stroke = groupAttribute.stroke,\n lineDash = groupAttribute.lineDash,\n strokeArrayWidth = (groupAttribute as any).strokeArrayWidth,\n strokeArrayColor = (groupAttribute as any).strokeArrayColor\n } = group.attribute as any;\n\n const { width = groupAttribute.width, height = groupAttribute.height } = group.attribute;\n // width = Math.ceil(width);\n // height = Math.ceil(height);\n\n if (\n stroke &&\n Array.isArray(lineDash) &&\n !lineDash.length && // 非虚线\n !Array.isArray(strokeArrayColor) &&\n !Array.isArray(strokeArrayWidth) &&\n lineWidth & 1 // 奇数线宽\n ) {\n // if (group.role === 'cell') {\n // const table = (group.stage as any).table as BaseTableAPI;\n // let col = (group as any).col as number;\n // let row = (group as any).row as number;\n // const mergeInfo = getCellMergeInfo(table, col, row);\n // if (mergeInfo) {\n // col = mergeInfo.end.col;\n // row = mergeInfo.end.row;\n // }\n\n // if (table && col === table.colCount - 1) {\n // width -= 1;\n // } else if (table && col === table.frozenColCount - 1 && table.scrollLeft) {\n // width -= 1;\n // }\n // if (table && row === table.rowCount - 1) {\n // height -= 1;\n // } else if (table && row === table.frozenRowCount - 1 && table.scrollTop) {\n // height -= 1;\n // }\n // }\n const { width: widthFroDraw, height: heightFroDraw } = getCellSizeForDraw(\n group,\n Math.ceil(width),\n Math.ceil(height)\n );\n context.beginPath();\n x = Math.floor(x) + 0.5;\n y = Math.floor(y) + 0.5;\n context.rect(x, y, widthFroDraw, heightFroDraw);\n context.setStrokeStyle(group, group.attribute, x, y, groupAttribute);\n context.stroke();\n }\n }\n}\n\n@injectable()\nexport class AdjustColorGroupBeforeRenderContribution implements IGroupRenderContribution {\n time: BaseRenderContributionTime = BaseRenderContributionTime.beforeFillStroke;\n useStyle = true;\n order = 0;\n drawShape(\n group: IGroup,\n context: IContext2d,\n x: number,\n y: number,\n doFill: boolean,\n doStroke: boolean,\n fVisible: boolean,\n sVisible: boolean,\n groupAttribute: Required<IGroupGraphicAttribute>,\n drawContext: IDrawContext,\n fillCb?: (\n ctx: IContext2d,\n markAttribute: Partial<IMarkAttribute & IGraphicAttribute>,\n themeAttribute: IThemeAttribute\n ) => boolean,\n strokeCb?: (\n ctx: IContext2d,\n markAttribute: Partial<IMarkAttribute & IGraphicAttribute>,\n themeAttribute: IThemeAttribute\n ) => boolean,\n doFillOrStroke?: { doFill: boolean; doStroke: boolean }\n ) {\n // 处理hover颜色\n if ((group as Group).role === 'cell') {\n const table = (group.stage as any).table as BaseTableAPI;\n if (table.stateManeger.interactionState !== InteractionState.scrolling) {\n const hoverColor = getCellHoverColor(group as Group, table);\n if (hoverColor) {\n (group as any).oldColor = group.attribute.fill;\n group.attribute.fill = hoverColor;\n }\n }\n }\n }\n}\n\n@injectable()\nexport class AdjustColorGroupAfterRenderContribution implements IGroupRenderContribution {\n time: BaseRenderContributionTime = BaseRenderContributionTime.afterFillStroke;\n useStyle = true;\n order = 0;\n drawShape(\n group: IGroup,\n context: IContext2d,\n x: number,\n y: number,\n doFill: boolean,\n doStroke: boolean,\n fVisible: boolean,\n sVisible: boolean,\n groupAttribute: Required<IGroupGraphicAttribute>,\n drawContext: IDrawContext,\n fillCb?: (\n ctx: IContext2d,\n markAttribute: Partial<IMarkAttribute & IGraphicAttribute>,\n themeAttribute: IThemeAttribute\n ) => boolean,\n strokeCb?: (\n ctx: IContext2d,\n markAttribute: Partial<IMarkAttribute & IGraphicAttribute>,\n themeAttribute: IThemeAttribute\n ) => boolean\n ) {\n // 处理hover颜色\n if ('oldColor' in group) {\n group.attribute.fill = group.oldColor as any;\n delete group.oldColor;\n }\n }\n}\n\nfunction getCellSizeForDraw(group: any, width: number, height: number) {\n const table = group.stage.table as BaseTableAPI;\n if (group.role === 'cell') {\n let col = group.col as number;\n let row = group.row as number;\n const mergeInfo = getCellMergeInfo(table, col, row);\n if (mergeInfo) {\n col = mergeInfo.end.col;\n row = mergeInfo.end.row;\n }\n\n if (table && col === table.colCount - 1) {\n width -= 1;\n } else if (table && col === table.frozenColCount - 1 && table.scrollLeft) {\n width -= 1;\n }\n if (table && row === table.rowCount - 1) {\n height -= 1;\n } else if (table && row === table.frozenRowCount - 1 && table.scrollTop) {\n height -= 1;\n }\n } else if (group.role === 'corner-frozen') {\n if (table.scrollLeft) {\n width -= 1;\n }\n if (table.scrollTop) {\n height -= 1;\n }\n }\n return { width, height };\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/scenegraph/graphic/contributions/group-contribution-render.ts"],"names":[],"mappings":";;;;;;;;;AAUA,+CAA2E;AAE3E,sEAAuE;AAGvE,+DAA8D;AAC9D,gDAAqD;AAO9C,IAAM,kCAAkC,GAAxC,MAAM,kCAAkC;IAAxC;QACL,SAAI,GAA+B,oCAA0B,CAAC,gBAAgB,CAAC;QAC/E,aAAQ,GAAG,IAAI,CAAC;QAChB,UAAK,GAAG,CAAC,CAAC;IAmEZ,CAAC;IAlEC,SAAS,CACP,KAAa,EACb,OAAmB,EACnB,CAAS,EACT,CAAS,EACT,MAAe,EACf,QAAiB,EACjB,QAAiB,EACjB,QAAiB,EACjB,cAAgD,EAChD,WAAyB,EACzB,MAIY,EACZ,QAIY,EACZ,cAAuD;QAEvD,MAAM,EACJ,MAAM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SACZ;aAAM,IAAI,KAAK,IAAI,GAAG,KAAK,KAAK,CAAC,cAAc,GAAG,CAAC,IAAI,KAAK,CAAC,UAAU,EAAE;YACxE,KAAK,IAAI,CAAC,CAAC;SACZ;QACD,IAAI,KAAK,IAAI,GAAG,KAAK,KAAK,CAAC,QAAQ,GAAG,CAAC,EAAE;YACvC,MAAM,IAAI,CAAC,CAAC;SACb;aAAM,IAAI,KAAK,IAAI,GAAG,KAAK,KAAK,CAAC,cAAc,GAAG,CAAC,IAAI,KAAK,CAAC,SAAS,EAAE;YACvE,MAAM,IAAI,CAAC,CAAC;SACb;KACF;SAAM,IAAI,KAAK,CAAC,IAAI,KAAK,eAAe,EAAE;QACzC,IAAI,KAAK,CAAC,UAAU,EAAE;YACpB,KAAK,IAAI,CAAC,CAAC;SACZ;QACD,IAAI,KAAK,CAAC,SAAS,EAAE;YACnB,MAAM,IAAI,CAAC,CAAC;SACb;KACF;IACD,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC;AAC3B,CAAC","file":"group-contribution-render.js","sourcesContent":["import type {\n IGroup,\n IContext2d,\n IGroupGraphicAttribute,\n IMarkAttribute,\n IGraphicAttribute,\n IThemeAttribute,\n IGroupRenderContribution,\n IDrawContext\n} from '@visactor/vrender';\nimport { BaseRenderContributionTime, injectable } from '@visactor/vrender';\nimport type { Group } from '../group';\nimport { getCellHoverColor } from '../../../state/hover/is-cell-hover';\nimport type { BaseTableAPI } from '../../../ts-types/base-table';\nimport { getQuadProps } from '../../utils/padding';\nimport { getCellMergeInfo } from '../../utils/get-cell-merge';\nimport { InteractionState } from '../../../ts-types';\n\n// const highlightDash: number[] = [];\n\n// SplitGroupContribution处理分段渲染stroke\n// stroke/strokeArrayWidth/strokeArrayColor 为数组时调用\n@injectable()\nexport class SplitGroupBeforeRenderContribution implements IGroupRenderContribution {\n time: BaseRenderContributionTime = BaseRenderContributionTime.beforeFillStroke;\n useStyle = true;\n order = 0;\n drawShape(\n group: IGroup,\n context: IContext2d,\n x: number,\n y: number,\n doFill: boolean,\n doStroke: boolean,\n fVisible: boolean,\n sVisible: boolean,\n groupAttribute: Required<IGroupGraphicAttribute>,\n drawContext: IDrawContext,\n fillCb?: (\n ctx: IContext2d,\n markAttribute: Partial<IMarkAttribute & IGraphicAttribute>,\n themeAttribute: IThemeAttribute\n ) => boolean,\n strokeCb?: (\n ctx: IContext2d,\n markAttribute: Partial<IMarkAttribute & IGraphicAttribute>,\n themeAttribute: IThemeAttribute\n ) => boolean,\n doFillOrStroke?: { doFill: boolean; doStroke: boolean }\n ) {\n const {\n stroke = groupAttribute.stroke,\n strokeArrayWidth = (groupAttribute as any).strokeArrayWidth,\n strokeArrayColor = (groupAttribute as any).strokeArrayColor\n // highlightStroke = (groupAttribute as any).highlightStroke,\n // highlightStrokeArrayWidth = (groupAttribute as any).highlightStrokeArrayWidth,\n // width = groupAttribute.width,\n // height = groupAttribute.height,\n } = group.attribute as any;\n\n if (stroke && (Array.isArray(strokeArrayWidth) || Array.isArray(strokeArrayColor))) {\n doFillOrStroke.doStroke = false;\n }\n\n // if (highlightStroke) {\n // // 依据highlightStroke信息调整clip范围,以实现在单个单元格显示highlight border\n // let xDist = x;\n // let yDist = y;\n // let widthDist = width;\n // let heightDist = height;\n // if (highlightStroke[0] && highlightStrokeArrayWidth[0]) {\n // // top\n // yDist -= highlightStrokeArrayWidth[0] / 2;\n // heightDist += highlightStrokeArrayWidth[0] / 2;\n // }\n // if (highlightStroke[1] && highlightStrokeArrayWidth[1]) {\n // // right\n // widthDist += highlightStrokeArrayWidth[1] / 2;\n // }\n // if (highlightStroke[2] && highlightStrokeArrayWidth[2]) {\n // // bottom\n // heightDist += highlightStrokeArrayWidth[2] / 2;\n // }\n // if (highlightStroke[3] && highlightStrokeArrayWidth[3]) {\n // // left\n // xDist -= highlightStrokeArrayWidth[3] / 2;\n // widthDist += highlightStrokeArrayWidth[3] / 2;\n // }\n\n // context.beginPath();\n // context.rect(xDist, yDist, widthDist, heightDist);\n // }\n }\n}\n@injectable()\nexport class SplitGroupAfterRenderContribution implements IGroupRenderContribution {\n time: BaseRenderContributionTime = BaseRenderContributionTime.afterFillStroke;\n useStyle = true;\n order = 0;\n drawShape(\n group: IGroup,\n context: IContext2d,\n x: number,\n y: number,\n doFill: boolean,\n doStroke: boolean,\n fVisible: boolean,\n sVisible: boolean,\n groupAttribute: Required<IGroupGraphicAttribute>,\n drawContext: IDrawContext,\n fillCb?: (\n ctx: IContext2d,\n markAttribute: Partial<IMarkAttribute & IGraphicAttribute>,\n themeAttribute: IThemeAttribute\n ) => boolean,\n strokeCb?: (\n ctx: IContext2d,\n markAttribute: Partial<IMarkAttribute & IGraphicAttribute>,\n themeAttribute: IThemeAttribute\n ) => boolean\n ) {\n const {\n width = groupAttribute.width,\n height = groupAttribute.height,\n // 基础border\n stroke = groupAttribute.stroke,\n strokeArrayColor = (groupAttribute as any).strokeArrayColor,\n strokeArrayWidth = (groupAttribute as any).strokeArrayWidth,\n\n lineWidth = groupAttribute.lineWidth,\n strokeColor = groupAttribute.stroke\n // // select & hover border\n // highlightStroke = (groupAttribute as any).highlightStroke,\n // highlightStrokeArrayColor = (groupAttribute as any).highlightStrokeArrayColor,\n // highlightStrokeArrayWidth = (groupAttribute as any).highlightStrokeArrayWidth,\n // highlightStrokeArrayPart = (groupAttribute as any).highlightStrokeArrayPart,\n } = group.attribute as any;\n\n // lineWidth === 0 不绘制\n if (!stroke || (!Array.isArray(strokeArrayWidth) && lineWidth === 0)) {\n return;\n }\n\n let widthForStroke;\n let heightForStroke;\n if (Array.isArray(strokeArrayColor) || Array.isArray(strokeArrayWidth)) {\n if (\n (typeof lineWidth === 'number' && lineWidth & 1) ||\n (Array.isArray(strokeArrayWidth) && strokeArrayWidth.some(width => width & 1))\n ) {\n x = Math.floor(x) + 0.5;\n y = Math.floor(y) + 0.5;\n\n const { width: widthFroDraw, height: heightFroDraw } = getCellSizeForDraw(\n group,\n Math.ceil(width),\n Math.ceil(height)\n );\n widthForStroke = widthFroDraw;\n heightForStroke = heightFroDraw;\n } else {\n widthForStroke = Math.ceil(width);\n heightForStroke = Math.ceil(height);\n }\n renderStroke(\n group,\n context,\n x,\n y,\n groupAttribute,\n stroke,\n strokeArrayWidth || lineWidth,\n strokeArrayColor || strokeColor,\n // Math.ceil(width),\n // Math.ceil(height)\n widthForStroke,\n heightForStroke\n );\n }\n }\n}\n\n/**\n * @description: 判断线宽是否需要分别渲染(线宽不同)\n * @param {number} widthArray\n * @return {*}\n */\nexport function getWidthInfo(widthArray: number[] | number) {\n if (!Array.isArray(widthArray)) {\n return {\n isSplitDraw: false,\n width: widthArray\n };\n }\n\n let temp;\n for (let i = 0; i < widthArray.length; i++) {\n const width = widthArray[i];\n if (width) {\n if (!temp) {\n temp = width;\n } else if (width !== temp) {\n return {\n isSplitDraw: true\n };\n }\n }\n }\n\n return {\n isSplitDraw: false,\n width: temp\n };\n}\n\nexport function renderStroke(\n group: IGroup,\n context: IContext2d,\n x: number,\n y: number,\n groupAttribute: Required<IGroupGraphicAttribute>,\n stroke: boolean | [boolean, boolean, boolean, boolean],\n strokeArrayWidth: [number, number, number, number] | undefined,\n strokeArrayColor: [string, string, string, string] | undefined,\n width: number,\n height: number,\n isHighlight?: boolean,\n part?: ([number, number] | undefined)[]\n) {\n const widthInfo = getWidthInfo(strokeArrayWidth);\n const isWidthNumber = !Array.isArray(strokeArrayWidth);\n const isStrokeTrue = !Array.isArray(stroke);\n // 渲染部分线段,part: [[0, 0.5], undifined, undifined, undifined]\n // 同样上右下左,范围0-1,[0, 0.5]即只渲染前一半\n const isPart = Array.isArray(part);\n const isSplitDraw = Array.isArray(strokeArrayColor) || widthInfo.isSplitDraw;\n\n context.setStrokeStyle(group, group.attribute, x, y, groupAttribute);\n // if (isHighlight) {\n // context.setLineDash(highlightDash);\n // context.lineCap = 'square';\n // }\n const lineDash = context.getLineDash();\n let isDash = false;\n if (lineDash.length) {\n isDash = true;\n }\n // 单独处理每条边界,目前不考虑圆角\n context.beginPath();\n context.moveTo(x, y);\n\n // top\n if ((isStrokeTrue || stroke[0]) && (isWidthNumber || strokeArrayWidth[0])) {\n // context.lineTo(x + width, y);\n if (isPart && Array.isArray(part[0])) {\n context.moveTo(x + width * part[0][0], y);\n context.lineTo(x + width * (part[0][1] - part[0][0]), y);\n context.moveTo(x + width, y);\n } else {\n context.moveTo(x, y);\n context.lineTo(x + width, y);\n }\n if ((isSplitDraw || isDash) && (!strokeArrayColor || strokeArrayColor[0])) {\n if (strokeArrayColor) {\n context.strokeStyle = strokeArrayColor[0];\n }\n if (!isWidthNumber) {\n context.lineWidth = strokeArrayWidth[0];\n }\n context.lineDashOffset = context.currentMatrix.e / context.currentMatrix.a;\n context.stroke();\n context.beginPath();\n context.moveTo(x + width, y);\n }\n } else {\n context.moveTo(x + width, y);\n }\n // right\n if ((isStrokeTrue || stroke[1]) && (isWidthNumber || strokeArrayWidth[1])) {\n // context.lineTo(x + width, y + height);\n if (isPart && Array.isArray(part[1])) {\n context.moveTo(x + width, y + height * part[1][0]);\n context.lineTo(x + width, y + height * (part[1][1] - part[1][0]));\n context.moveTo(x + width, y + height);\n } else {\n context.moveTo(x + width, y);\n context.lineTo(x + width, y + height);\n }\n if ((isSplitDraw || isDash) && (!strokeArrayColor || strokeArrayColor[1])) {\n if (strokeArrayColor) {\n context.strokeStyle = strokeArrayColor[1];\n }\n if (!isWidthNumber) {\n context.lineWidth = strokeArrayWidth[1];\n }\n context.lineDashOffset = context.currentMatrix.f / context.currentMatrix.d;\n context.stroke();\n context.beginPath();\n context.moveTo(x + width, y + height);\n }\n } else {\n context.moveTo(x + width, y + height);\n }\n // bottom\n if ((isStrokeTrue || stroke[2]) && (isWidthNumber || strokeArrayWidth[2])) {\n // context.lineTo(x, y + height);\n if (isPart && Array.isArray(part[2])) {\n context.moveTo(x + width * part[2][0], y + height);\n context.lineTo(x + width * (part[2][1] - part[2][0]), y + height);\n context.moveTo(x, y + height);\n } else {\n context.moveTo(x, y + height);\n context.lineTo(x + width, y + height);\n }\n if ((isSplitDraw || isDash) && (!strokeArrayColor || strokeArrayColor[2])) {\n if (strokeArrayColor) {\n context.strokeStyle = strokeArrayColor[2];\n }\n if (!isWidthNumber) {\n context.lineWidth = strokeArrayWidth[2];\n }\n context.lineDashOffset = context.currentMatrix.e / context.currentMatrix.a;\n context.stroke();\n context.beginPath();\n context.moveTo(x, y + height);\n }\n } else {\n context.moveTo(x, y + height);\n }\n // left\n if ((isStrokeTrue || stroke[3]) && (isWidthNumber || strokeArrayWidth[3])) {\n // context.lineTo(x, y);\n if (isPart && Array.isArray(part[3])) {\n context.moveTo(x, y + height * part[3][0]);\n context.lineTo(x, y + height * (part[3][1] - part[3][0]));\n context.moveTo(x, y);\n } else {\n context.moveTo(x, y);\n context.lineTo(x, y + height);\n }\n if ((isSplitDraw || isDash) && (!strokeArrayColor || strokeArrayColor[3])) {\n if (strokeArrayColor) {\n context.strokeStyle = strokeArrayColor[3];\n }\n if (!isWidthNumber) {\n context.lineWidth = strokeArrayWidth[3];\n }\n context.lineDashOffset = context.currentMatrix.f / context.currentMatrix.d;\n context.stroke();\n context.beginPath();\n context.moveTo(x, y);\n }\n } else {\n context.moveTo(x, y);\n }\n\n if (!isSplitDraw && !isDash) {\n // context.strokeStyle = strokeArrayColor;\n if (!isWidthNumber && widthInfo.width) {\n context.lineWidth = widthInfo.width;\n }\n context.stroke();\n }\n}\n\n// DashGroupContribution处理虚线边框对齐\n// lineDash 为非空数组时调用\n@injectable()\nexport class DashGroupBeforeRenderContribution implements IGroupRenderContribution {\n time: BaseRenderContributionTime = BaseRenderContributionTime.beforeFillStroke;\n useStyle = true;\n order = 0;\n drawShape(\n group: IGroup,\n context: IContext2d,\n x: number,\n y: number,\n doFill: boolean,\n doStroke: boolean,\n fVisible: boolean,\n sVisible: boolean,\n groupAttribute: Required<IGroupGraphicAttribute>,\n drawContext: IDrawContext,\n fillCb?: (\n ctx: IContext2d,\n markAttribute: Partial<IMarkAttribute & IGraphicAttribute>,\n themeAttribute: IThemeAttribute\n ) => boolean,\n strokeCb?: (\n ctx: IContext2d,\n markAttribute: Partial<IMarkAttribute & IGraphicAttribute>,\n themeAttribute: IThemeAttribute\n ) => boolean,\n doFillOrStroke?: { doFill: boolean; doStroke: boolean }\n ) {\n const {\n lineDash = groupAttribute.lineDash,\n stroke = groupAttribute.stroke,\n strokeArrayColor = (groupAttribute as any).strokeArrayColor,\n strokeArrayWidth = (groupAttribute as any).strokeArrayWidth\n } = group.attribute as any;\n\n if (\n stroke &&\n Array.isArray(lineDash) &&\n lineDash.length &&\n !Array.isArray(strokeArrayColor) &&\n !Array.isArray(strokeArrayWidth)\n ) {\n doFillOrStroke.doStroke = false;\n }\n }\n}\n@injectable()\nexport class DashGroupAfterRenderContribution implements IGroupRenderContribution {\n time: BaseRenderContributionTime = BaseRenderContributionTime.afterFillStroke;\n useStyle = true;\n order = 0;\n drawShape(\n group: IGroup,\n context: IContext2d,\n x: number,\n y: number,\n doFill: boolean,\n doStroke: boolean,\n fVisible: boolean,\n sVisible: boolean,\n groupAttribute: Required<IGroupGraphicAttribute>,\n drawContext: IDrawContext,\n fillCb?: (\n ctx: IContext2d,\n markAttribute: Partial<IMarkAttribute & IGraphicAttribute>,\n themeAttribute: IThemeAttribute\n ) => boolean,\n strokeCb?: (\n ctx: IContext2d,\n markAttribute: Partial<IMarkAttribute & IGraphicAttribute>,\n themeAttribute: IThemeAttribute\n ) => boolean\n ) {\n const {\n lineDash = groupAttribute.lineDash,\n stroke = groupAttribute.stroke,\n strokeArrayColor = (groupAttribute as any).strokeArrayColor,\n strokeArrayWidth = (groupAttribute as any).strokeArrayWidth,\n lineWidth = groupAttribute.lineWidth\n } = group.attribute as any;\n\n if (\n !stroke ||\n !(Array.isArray(lineDash) && lineDash.length) ||\n Array.isArray(strokeArrayColor) ||\n Array.isArray(strokeArrayWidth)\n ) {\n return;\n }\n\n // const { width = groupAttribute.width, height = groupAttribute.height } = group.attribute;\n let { width = groupAttribute.width, height = groupAttribute.height } = group.attribute;\n width = Math.ceil(width);\n height = Math.ceil(height);\n\n let widthForStroke;\n let heightForStroke;\n if (lineWidth & 1) {\n x = Math.floor(x) + 0.5;\n y = Math.floor(y) + 0.5;\n\n const { width: widthFroDraw, height: heightFroDraw } = getCellSizeForDraw(\n group,\n Math.ceil(width),\n Math.ceil(height)\n );\n widthForStroke = widthFroDraw;\n heightForStroke = heightFroDraw;\n } else {\n widthForStroke = Math.ceil(width);\n heightForStroke = Math.ceil(height);\n }\n context.setStrokeStyle(group, group.attribute, x, y, groupAttribute);\n // 分段设置lineDashOffset,实现虚线边框对齐\n // top\n context.beginPath();\n context.moveTo(x, y);\n context.lineTo(x + widthForStroke, y);\n context.lineDashOffset = context.currentMatrix.e / context.currentMatrix.a;\n context.stroke();\n\n // right\n context.beginPath();\n context.moveTo(x + widthForStroke, y);\n context.lineTo(x + widthForStroke, y + heightForStroke);\n context.lineDashOffset = context.currentMatrix.f / context.currentMatrix.d;\n context.stroke();\n\n // bottom\n context.beginPath();\n context.moveTo(x, y + heightForStroke);\n context.lineTo(x + widthForStroke, y + heightForStroke);\n context.lineDashOffset = context.currentMatrix.e / context.currentMatrix.a;\n context.stroke();\n\n // left\n context.beginPath();\n context.moveTo(x, y);\n context.lineTo(x, y + heightForStroke);\n context.lineDashOffset = context.currentMatrix.f / context.currentMatrix.d;\n context.stroke();\n }\n}\n\n// AdjustPosGroupContribution处理线宽为奇数时stroke位置偏移0.5px\n// lineWidth 为奇数时调用\n@injectable()\nexport class AdjustPosGroupBeforeRenderContribution implements IGroupRenderContribution {\n time: BaseRenderContributionTime = BaseRenderContributionTime.beforeFillStroke;\n useStyle = true;\n order = 0;\n drawShape(\n group: IGroup,\n context: IContext2d,\n x: number,\n y: number,\n doFill: boolean,\n doStroke: boolean,\n fVisible: boolean,\n sVisible: boolean,\n groupAttribute: Required<IGroupGraphicAttribute>,\n drawContext: IDrawContext,\n fillCb?: (\n ctx: IContext2d,\n markAttribute: Partial<IMarkAttribute & IGraphicAttribute>,\n themeAttribute: IThemeAttribute\n ) => boolean,\n strokeCb?: (\n ctx: IContext2d,\n markAttribute: Partial<IMarkAttribute & IGraphicAttribute>,\n themeAttribute: IThemeAttribute\n ) => boolean,\n doFillOrStroke?: { doFill: boolean; doStroke: boolean }\n ) {\n const {\n lineWidth = groupAttribute.lineWidth,\n stroke = groupAttribute.stroke,\n lineDash = groupAttribute.lineDash,\n // width = groupAttribute.width,\n // height = groupAttribute.height,\n strokeArrayWidth = (groupAttribute as any).strokeArrayWidth,\n strokeArrayColor = (groupAttribute as any).strokeArrayColor\n } = group.attribute as any;\n\n if (\n stroke &&\n Array.isArray(lineDash) &&\n !lineDash.length && // 非虚线\n !Array.isArray(strokeArrayColor) &&\n !Array.isArray(strokeArrayWidth) &&\n lineWidth & 1 // 奇数线宽\n ) {\n doFillOrStroke.doStroke = false;\n }\n }\n}\n\n@injectable()\nexport class AdjustPosGroupAfterRenderContribution implements IGroupRenderContribution {\n time: BaseRenderContributionTime = BaseRenderContributionTime.afterFillStroke;\n useStyle = true;\n order = 0;\n drawShape(\n group: IGroup,\n context: IContext2d,\n x: number,\n y: number,\n doFill: boolean,\n doStroke: boolean,\n fVisible: boolean,\n sVisible: boolean,\n groupAttribute: Required<IGroupGraphicAttribute>,\n drawContext: IDrawContext,\n fillCb?: (\n ctx: IContext2d,\n markAttribute: Partial<IMarkAttribute & IGraphicAttribute>,\n themeAttribute: IThemeAttribute\n ) => boolean,\n strokeCb?: (\n ctx: IContext2d,\n markAttribute: Partial<IMarkAttribute & IGraphicAttribute>,\n themeAttribute: IThemeAttribute\n ) => boolean\n ) {\n const {\n lineWidth = groupAttribute.lineWidth,\n stroke = groupAttribute.stroke,\n lineDash = groupAttribute.lineDash,\n strokeArrayWidth = (groupAttribute as any).strokeArrayWidth,\n strokeArrayColor = (groupAttribute as any).strokeArrayColor\n } = group.attribute as any;\n\n const { width = groupAttribute.width, height = groupAttribute.height } = group.attribute;\n // width = Math.ceil(width);\n // height = Math.ceil(height);\n\n if (\n stroke &&\n Array.isArray(lineDash) &&\n !lineDash.length && // 非虚线\n !Array.isArray(strokeArrayColor) &&\n !Array.isArray(strokeArrayWidth) &&\n lineWidth & 1 // 奇数线宽\n ) {\n // if (group.role === 'cell') {\n // const table = (group.stage as any).table as BaseTableAPI;\n // let col = (group as any).col as number;\n // let row = (group as any).row as number;\n // const mergeInfo = getCellMergeInfo(table, col, row);\n // if (mergeInfo) {\n // col = mergeInfo.end.col;\n // row = mergeInfo.end.row;\n // }\n\n // if (table && col === table.colCount - 1) {\n // width -= 1;\n // } else if (table && col === table.frozenColCount - 1 && table.scrollLeft) {\n // width -= 1;\n // }\n // if (table && row === table.rowCount - 1) {\n // height -= 1;\n // } else if (table && row === table.frozenRowCount - 1 && table.scrollTop) {\n // height -= 1;\n // }\n // }\n const { width: widthFroDraw, height: heightFroDraw } = getCellSizeForDraw(\n group,\n Math.ceil(width),\n Math.ceil(height)\n );\n context.beginPath();\n x = Math.floor(x) + 0.5;\n y = Math.floor(y) + 0.5;\n context.rect(x, y, widthFroDraw, heightFroDraw);\n context.setStrokeStyle(group, group.attribute, x, y, groupAttribute);\n context.stroke();\n }\n }\n}\n\n@injectable()\nexport class AdjustColorGroupBeforeRenderContribution implements IGroupRenderContribution {\n time: BaseRenderContributionTime = BaseRenderContributionTime.beforeFillStroke;\n useStyle = true;\n order = 0;\n drawShape(\n group: IGroup,\n context: IContext2d,\n x: number,\n y: number,\n doFill: boolean,\n doStroke: boolean,\n fVisible: boolean,\n sVisible: boolean,\n groupAttribute: Required<IGroupGraphicAttribute>,\n drawContext: IDrawContext,\n fillCb?: (\n ctx: IContext2d,\n markAttribute: Partial<IMarkAttribute & IGraphicAttribute>,\n themeAttribute: IThemeAttribute\n ) => boolean,\n strokeCb?: (\n ctx: IContext2d,\n markAttribute: Partial<IMarkAttribute & IGraphicAttribute>,\n themeAttribute: IThemeAttribute\n ) => boolean,\n doFillOrStroke?: { doFill: boolean; doStroke: boolean }\n ) {\n // 处理hover颜色\n if ((group as Group).role === 'cell') {\n const table = (group.stage as any).table as BaseTableAPI;\n if (table.stateManager.interactionState !== InteractionState.scrolling) {\n const hoverColor = getCellHoverColor(group as Group, table);\n if (hoverColor) {\n (group as any).oldColor = group.attribute.fill;\n group.attribute.fill = hoverColor;\n }\n }\n }\n }\n}\n\n@injectable()\nexport class AdjustColorGroupAfterRenderContribution implements IGroupRenderContribution {\n time: BaseRenderContributionTime = BaseRenderContributionTime.afterFillStroke;\n useStyle = true;\n order = 0;\n drawShape(\n group: IGroup,\n context: IContext2d,\n x: number,\n y: number,\n doFill: boolean,\n doStroke: boolean,\n fVisible: boolean,\n sVisible: boolean,\n groupAttribute: Required<IGroupGraphicAttribute>,\n drawContext: IDrawContext,\n fillCb?: (\n ctx: IContext2d,\n markAttribute: Partial<IMarkAttribute & IGraphicAttribute>,\n themeAttribute: IThemeAttribute\n ) => boolean,\n strokeCb?: (\n ctx: IContext2d,\n markAttribute: Partial<IMarkAttribute & IGraphicAttribute>,\n themeAttribute: IThemeAttribute\n ) => boolean\n ) {\n // 处理hover颜色\n if ('oldColor' in group) {\n group.attribute.fill = group.oldColor as any;\n delete group.oldColor;\n }\n }\n}\n\nfunction getCellSizeForDraw(group: any, width: number, height: number) {\n const table = group.stage.table as BaseTableAPI;\n if (group.role === 'cell') {\n let col = group.col as number;\n let row = group.row as number;\n const mergeInfo = getCellMergeInfo(table, col, row);\n if (mergeInfo) {\n col = mergeInfo.end.col;\n row = mergeInfo.end.row;\n }\n\n if (table && col === table.colCount - 1) {\n width -= 1;\n } else if (table && col === table.frozenColCount - 1 && table.scrollLeft) {\n width -= 1;\n }\n if (table && row === table.rowCount - 1) {\n height -= 1;\n } else if (table && row === table.frozenRowCount - 1 && table.scrollTop) {\n height -= 1;\n }\n } else if (group.role === 'corner-frozen') {\n if (table.scrollLeft) {\n width -= 1;\n }\n if (table.scrollTop) {\n height -= 1;\n }\n }\n return { width, height };\n}\n"]}
|