@visactor/vtable 0.16.4-alpha.2 → 0.17.1
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 +13 -2
- package/cjs/ListTable.js.map +1 -1
- package/cjs/PivotChart.d.ts +1 -0
- package/cjs/PivotChart.js +20 -2
- package/cjs/PivotChart.js.map +1 -1
- package/cjs/PivotTable.d.ts +1 -0
- package/cjs/PivotTable.js +20 -2
- package/cjs/PivotTable.js.map +1 -1
- package/cjs/core/BaseTable.d.ts +1 -0
- package/cjs/core/BaseTable.js +39 -41
- package/cjs/core/BaseTable.js.map +1 -1
- package/cjs/core/tableHelper.d.ts +1 -1
- package/cjs/core/tableHelper.js +6 -5
- package/cjs/core/tableHelper.js.map +1 -1
- package/cjs/dataset/dataset.js +3 -8
- package/cjs/dataset/dataset.js.map +1 -1
- package/cjs/edit/edit-manager.js +0 -3
- package/cjs/edit/edit-manager.js.map +1 -1
- package/cjs/event/EventHandler.d.ts +1 -0
- package/cjs/event/EventHandler.js +1 -1
- package/cjs/event/EventHandler.js.map +1 -1
- package/cjs/event/event.d.ts +10 -0
- package/cjs/event/event.js +2 -1
- package/cjs/event/event.js.map +1 -1
- package/cjs/event/listener/container-dom.js +30 -4
- package/cjs/event/listener/container-dom.js.map +1 -1
- package/cjs/event/listener/scroll-bar.js +19 -5
- package/cjs/event/listener/scroll-bar.js.map +1 -1
- package/cjs/event/listener/table-group.js +45 -34
- package/cjs/event/listener/table-group.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/pivot-header-layout.d.ts +1 -0
- package/cjs/layout/pivot-header-layout.js +35 -18
- package/cjs/layout/pivot-header-layout.js.map +1 -1
- package/cjs/layout/pivot-layout-helper.d.ts +1 -1
- package/cjs/layout/pivot-layout-helper.js +12 -5
- package/cjs/layout/pivot-layout-helper.js.map +1 -1
- package/cjs/layout/simple-header-layout.js +9 -9
- package/cjs/layout/simple-header-layout.js.map +1 -1
- package/cjs/scenegraph/component/cell-content.d.ts +2 -3
- package/cjs/scenegraph/component/cell-content.js +3 -3
- package/cjs/scenegraph/component/cell-content.js.map +1 -1
- package/cjs/scenegraph/component/custom.js +10 -10
- package/cjs/scenegraph/component/custom.js.map +1 -1
- package/cjs/scenegraph/component/table-component.js.map +1 -1
- package/cjs/scenegraph/graphic/text.d.ts +1 -1
- package/cjs/scenegraph/graphic/text.js +1 -1
- package/cjs/scenegraph/graphic/text.js.map +1 -1
- package/cjs/scenegraph/group-creater/cell-helper.js +2 -1
- package/cjs/scenegraph/group-creater/cell-helper.js.map +1 -1
- package/cjs/scenegraph/group-creater/cell-type/checkbox-cell.js +3 -2
- package/cjs/scenegraph/group-creater/cell-type/checkbox-cell.js.map +1 -1
- package/cjs/scenegraph/group-creater/progress/update-position/dynamic-set-y.js +1 -1
- package/cjs/scenegraph/group-creater/progress/update-position/dynamic-set-y.js.map +1 -1
- package/cjs/scenegraph/icon/icon-update.d.ts +2 -0
- package/cjs/scenegraph/icon/icon-update.js +16 -2
- package/cjs/scenegraph/icon/icon-update.js.map +1 -1
- package/cjs/scenegraph/layout/compute-col-width.d.ts +1 -0
- package/cjs/scenegraph/layout/compute-col-width.js +12 -8
- package/cjs/scenegraph/layout/compute-col-width.js.map +1 -1
- package/cjs/scenegraph/layout/compute-row-height.js +16 -8
- package/cjs/scenegraph/layout/compute-row-height.js.map +1 -1
- package/cjs/scenegraph/layout/update-col.js +6 -5
- package/cjs/scenegraph/layout/update-col.js.map +1 -1
- package/cjs/scenegraph/layout/update-row.js +7 -6
- package/cjs/scenegraph/layout/update-row.js.map +1 -1
- package/cjs/scenegraph/scenegraph.d.ts +2 -0
- package/cjs/scenegraph/scenegraph.js +43 -59
- package/cjs/scenegraph/scenegraph.js.map +1 -1
- package/cjs/scenegraph/select/update-select-border.js +12 -6
- package/cjs/scenegraph/select/update-select-border.js.map +1 -1
- package/cjs/scenegraph/stick-text/index.js.map +1 -1
- package/cjs/scenegraph/utils/text-icon-layout.js +13 -10
- package/cjs/scenegraph/utils/text-icon-layout.js.map +1 -1
- package/cjs/scenegraph/utils/text-pos.js.map +1 -1
- package/cjs/state/hover/is-cell-hover.d.ts +1 -1
- package/cjs/state/hover/is-cell-hover.js +5 -4
- package/cjs/state/hover/is-cell-hover.js.map +1 -1
- package/cjs/state/select/update-position.js +65 -65
- package/cjs/state/select/update-position.js.map +1 -1
- package/cjs/state/spark-line/index.js +9 -5
- package/cjs/state/spark-line/index.js.map +1 -1
- package/cjs/state/state.js +2 -4
- package/cjs/state/state.js.map +1 -1
- package/cjs/themes/DARK.js +1 -1
- package/cjs/themes/DARK.js.map +1 -1
- package/cjs/themes/component.d.ts +27 -0
- package/cjs/themes/component.js +29 -2
- package/cjs/themes/component.js.map +1 -1
- package/cjs/themes/theme.d.ts +2 -0
- package/cjs/themes/theme.js +9 -1
- package/cjs/themes/theme.js.map +1 -1
- package/cjs/tools/NumberMap.d.ts +4 -0
- package/cjs/tools/NumberMap.js +16 -0
- package/cjs/tools/NumberMap.js.map +1 -1
- package/cjs/ts-types/base-table.d.ts +3 -0
- package/cjs/ts-types/base-table.js.map +1 -1
- package/cjs/ts-types/customElement.d.ts +1 -1
- package/cjs/ts-types/customElement.js.map +1 -1
- package/cjs/ts-types/table-engine.d.ts +3 -0
- package/cjs/ts-types/table-engine.js.map +1 -1
- package/cjs/ts-types/theme.d.ts +2 -0
- package/cjs/ts-types/theme.js.map +1 -1
- package/dist/vtable.js +21833 -23055
- package/dist/vtable.min.js +2 -2
- package/es/ListTable.d.ts +1 -0
- package/es/ListTable.js +12 -2
- package/es/ListTable.js.map +1 -1
- package/es/PivotChart.d.ts +1 -0
- package/es/PivotChart.js +20 -2
- package/es/PivotChart.js.map +1 -1
- package/es/PivotTable.d.ts +1 -0
- package/es/PivotTable.js +20 -2
- package/es/PivotTable.js.map +1 -1
- package/es/core/BaseTable.d.ts +1 -0
- package/es/core/BaseTable.js +41 -44
- package/es/core/BaseTable.js.map +1 -1
- package/es/core/tableHelper.d.ts +1 -1
- package/es/core/tableHelper.js +6 -5
- package/es/core/tableHelper.js.map +1 -1
- package/es/dataset/dataset.js +3 -8
- package/es/dataset/dataset.js.map +1 -1
- package/es/edit/edit-manager.js +0 -3
- package/es/edit/edit-manager.js.map +1 -1
- package/es/event/EventHandler.d.ts +1 -0
- package/es/event/EventHandler.js +1 -1
- package/es/event/EventHandler.js.map +1 -1
- package/es/event/event.d.ts +10 -0
- package/es/event/event.js +2 -1
- package/es/event/event.js.map +1 -1
- package/es/event/listener/container-dom.js +30 -4
- package/es/event/listener/container-dom.js.map +1 -1
- package/es/event/listener/scroll-bar.js +20 -4
- package/es/event/listener/scroll-bar.js.map +1 -1
- package/es/event/listener/table-group.js +45 -34
- package/es/event/listener/table-group.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/pivot-header-layout.d.ts +1 -0
- package/es/layout/pivot-header-layout.js +35 -18
- package/es/layout/pivot-header-layout.js.map +1 -1
- package/es/layout/pivot-layout-helper.d.ts +1 -1
- package/es/layout/pivot-layout-helper.js +12 -5
- package/es/layout/pivot-layout-helper.js.map +1 -1
- package/es/layout/simple-header-layout.js +9 -9
- package/es/layout/simple-header-layout.js.map +1 -1
- package/es/scenegraph/component/cell-content.d.ts +2 -3
- package/es/scenegraph/component/cell-content.js +3 -5
- package/es/scenegraph/component/cell-content.js.map +1 -1
- package/es/scenegraph/component/custom.js +10 -12
- package/es/scenegraph/component/custom.js.map +1 -1
- package/es/scenegraph/component/table-component.js.map +1 -1
- package/es/scenegraph/graphic/text.d.ts +1 -1
- package/es/scenegraph/graphic/text.js +1 -1
- package/es/scenegraph/graphic/text.js.map +1 -1
- package/es/scenegraph/group-creater/cell-helper.js +2 -1
- package/es/scenegraph/group-creater/cell-helper.js.map +1 -1
- package/es/scenegraph/group-creater/cell-type/checkbox-cell.js +3 -2
- package/es/scenegraph/group-creater/cell-type/checkbox-cell.js.map +1 -1
- package/es/scenegraph/group-creater/progress/update-position/dynamic-set-y.js +2 -2
- package/es/scenegraph/group-creater/progress/update-position/dynamic-set-y.js.map +1 -1
- package/es/scenegraph/icon/icon-update.d.ts +2 -0
- package/es/scenegraph/icon/icon-update.js +13 -0
- package/es/scenegraph/icon/icon-update.js.map +1 -1
- package/es/scenegraph/layout/compute-col-width.d.ts +1 -0
- package/es/scenegraph/layout/compute-col-width.js +9 -6
- package/es/scenegraph/layout/compute-col-width.js.map +1 -1
- package/es/scenegraph/layout/compute-row-height.js +17 -11
- package/es/scenegraph/layout/compute-row-height.js.map +1 -1
- package/es/scenegraph/layout/update-col.js +6 -5
- package/es/scenegraph/layout/update-col.js.map +1 -1
- package/es/scenegraph/layout/update-row.js +7 -6
- package/es/scenegraph/layout/update-row.js.map +1 -1
- package/es/scenegraph/scenegraph.d.ts +2 -0
- package/es/scenegraph/scenegraph.js +45 -61
- package/es/scenegraph/scenegraph.js.map +1 -1
- package/es/scenegraph/select/update-select-border.js +12 -6
- package/es/scenegraph/select/update-select-border.js.map +1 -1
- package/es/scenegraph/stick-text/index.js.map +1 -1
- package/es/scenegraph/utils/text-icon-layout.js +13 -12
- package/es/scenegraph/utils/text-icon-layout.js.map +1 -1
- package/es/scenegraph/utils/text-pos.js.map +1 -1
- package/es/state/hover/is-cell-hover.d.ts +1 -1
- package/es/state/hover/is-cell-hover.js +5 -4
- package/es/state/hover/is-cell-hover.js.map +1 -1
- package/es/state/select/update-position.js +65 -65
- package/es/state/select/update-position.js.map +1 -1
- package/es/state/spark-line/index.js +9 -5
- package/es/state/spark-line/index.js.map +1 -1
- package/es/state/state.js +2 -4
- package/es/state/state.js.map +1 -1
- package/es/themes/DARK.js +1 -1
- package/es/themes/DARK.js.map +1 -1
- package/es/themes/component.d.ts +27 -0
- package/es/themes/component.js +28 -0
- package/es/themes/component.js.map +1 -1
- package/es/themes/theme.d.ts +2 -0
- package/es/themes/theme.js +9 -2
- package/es/themes/theme.js.map +1 -1
- package/es/tools/NumberMap.d.ts +4 -0
- package/es/tools/NumberMap.js +16 -0
- package/es/tools/NumberMap.js.map +1 -1
- package/es/ts-types/base-table.d.ts +3 -0
- package/es/ts-types/base-table.js.map +1 -1
- package/es/ts-types/customElement.d.ts +1 -1
- package/es/ts-types/customElement.js.map +1 -1
- package/es/ts-types/table-engine.d.ts +3 -0
- package/es/ts-types/table-engine.js.map +1 -1
- package/es/ts-types/theme.d.ts +2 -0
- package/es/ts-types/theme.js.map +1 -1
- package/package.json +7 -7
- package/cjs/scenegraph/component/menu.d.ts +0 -41
- package/es/scenegraph/component/menu.d.ts +0 -41
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/scenegraph/layout/update-col.ts"],"names":[],"mappings":";;;AAAA,6CAA4C;AAG5C,4CAAyC;AACzC,8DAA0D;AAE1D,4DAA2D;AAM3D,SAAgB,SAAS,CACvB,WAA0B,EAC1B,QAAuB,EACvB,WAA0B,EAC1B,KAAmB;IAEnB,MAAM,KAAK,GAAG,KAAK,CAAC,UAAU,CAAC;IAE/B,MAAM,UAAU,GAAG,aAAa,CAAC,WAAW,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;IAC1F,MAAM,OAAO,GAAG,aAAa,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;IACpF,MAAM,UAAU,GAAG,aAAa,CAAC,WAAW,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,C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QAED,iBAAiB,CACf,WAAW,EACX,GAAG,EACH,KAAK,CAAC,KAAK,CAAC,QAAQ,GAAG,KAAK,CAAC,KAAK,CAAC,oBAAoB,EACvD,KAAK,CAAC,KAAK,CAAC,QAAQ,GAAG,CAAC,CACzB,CAAC;KACH;IAED,SAAS,iBAAiB,CAAC,KAAa,EAAE,GAAW,EAAE,QAAgB,EAAE,MAAc;QACrF,KAAK,IAAI,GAAG,GAAG,QAAQ,EAAE,GAAG,IAAI,MAAM,EAAE,GAAG,EAAE,EAAE;YAG7C,MAAM,SAAS,GAAG,IAAI,aAAK,CAAC;gBAC1B,CAAC,EAAE,CAAC;gBACJ,CAAC,EAAE,CAAC;gBACJ,KAAK,EAAE,KAAK,CAAC,KAAK,CAAC,WAAW,CAAC,GAAG,CAAC;gBACnC,MAAM,EAAE,KAAK,CAAC,KAAK,CAAC,YAAY,CAAC,GAAG,CAAC;aACtC,CAAC,CAAC;YACH,SAAS,CAAC,IAAI,GAAG,MAAM,CAAC;YACxB,SAAS,CAAC,GAAG,GAAG,GAAG,CAAC;YACpB,SAAS,CAAC,GAAG,GAAG,GAAG,CAAC;YACpB,SAAS,CAAC,UAAU,GAAG,IAAI,CAAC;YAC5B,KAAK,CAAC,WAAW,CAAC,SAAS,CAAC,CAAC;SAC9B;IACH,CAAC;AACH,CAAC","file":"update-col.js","sourcesContent":["import { isNumber } from '@visactor/vutils';\nimport type { CellAddress } from '../../ts-types';\nimport type { BaseTableAPI } from '../../ts-types/base-table';\nimport { Group } from '../graphic/group';\nimport { updateCell } from '../group-creater/cell-helper';\nimport type { Scenegraph } from '../scenegraph';\nimport { getCellMergeInfo } from '../utils/get-cell-merge';\nimport type { IGroup } from '@visactor/vrender';\n\n/**\n * add and remove rows in scenegraph\n */\nexport function updateCol(\n removeCells: CellAddress[],\n addCells: CellAddress[],\n updateCells: CellAddress[],\n table: BaseTableAPI\n) {\n const scene = table.scenegraph;\n // deduplication\n const removeCols = deduplication(removeCells.map(cell => cell.col)).sort((a, b) => b - a);\n const addCols = deduplication(addCells.map(cell => cell.col)).sort((a, b) => a - b);\n const updateCols = deduplication(updateCells.map(cell => cell.col)).sort((a, b) => a - b);\n\n // remove cells\n removeCols.forEach(col => {\n removeCol(col, scene);\n });\n\n removeCols.forEach(col => {\n scene.table.colWidthsMap.adjustOrder(col + 1, col, scene.table.colWidthsMap.count() - col - 1);\n scene.table.colWidthsMap.del(scene.table.colWidthsMap.count() - 1);\n });\n\n if (removeCols.length) {\n resetColNumber(scene);\n }\n\n scene.table._clearColRangeWidthsMap();\n\n // add cells\n let updateAfter: number;\n addCols.forEach(col => {\n const needUpdateAfter = addCol(col, scene);\n resetColNumber(scene);\n updateAfter = updateAfter ?? needUpdateAfter;\n scene.table.colWidthsMap.adjustOrder(col, col + 1, scene.table.colWidthsMap.count() - col);\n });\n\n // reset attribute y and col number in CellGroup\n // const newTotalHeight = resetColNumberAndY(scene);\n resetColNumberAndX(scene);\n // add cells\n updateCols.forEach(col => {\n for (let row = 0; row < table.rowCount; row++) {\n // updateColAttr(col, scene);\n const mergeInfo = getCellMergeInfo(scene.table, col, row);\n if (mergeInfo) {\n for (let col = mergeInfo.start.col; col <= mergeInfo.end.col; col++) {\n for (let col = mergeInfo.start.col; col <= mergeInfo.end.col; col++) {\n updateCell(col, row, scene.table, false);\n }\n }\n } else {\n updateCell(col, row, scene.table, false);\n }\n }\n });\n\n if (isNumber(updateAfter)) {\n for (let col = updateAfter; col < table.colCount; col++) {\n for (let row = 0; row < table.rowCount; row++) {\n const cellGroup = scene.highPerformanceGetCell(col, row, true);\n cellGroup && (cellGroup.needUpdate = true);\n }\n }\n scene.proxy.colUpdatePos = updateAfter;\n }\n if (addCols.length) {\n if (!isNumber(updateAfter)) {\n const minCol = Math.min(...addCols);\n scene.proxy.colUpdatePos = minCol;\n }\n scene.proxy.colUpdateDirection = 'left';\n scene.proxy.updateColGroups(scene.proxy.screenColCount * 2);\n updateRightFrozeCellGroups();\n scene.proxy.progress();\n } else if (removeCols.length) {\n scene.proxy.updateColGroups(scene.proxy.screenColCount * 2);\n updateRightFrozeCellGroups();\n scene.proxy.progress();\n }\n\n // update table size\n const newTotalWidth = table.getColsWidth(table.frozenColCount, table.colCount - 1);\n scene.updateContainerWidth(scene.table.frozenColCount, newTotalWidth - scene.bodyGroup.attribute.width);\n\n function updateRightFrozeCellGroups() {\n if (\n addCols?.[addCols?.length - 1] >= table.colCount - table.rightFrozenColCount ||\n updateCols?.[updateCols?.length - 1] >= table.colCount - table.rightFrozenColCount ||\n removeCols?.[0] >= table.colCount - table.rightFrozenColCount\n ) {\n for (let col = table.colCount - table.rightFrozenColCount; col < table.colCount; col++) {\n for (let row = 0; row < table.rowCount; row++) {\n const cellGroup = scene.highPerformanceGetCell(col, row, true);\n cellGroup && (cellGroup.needUpdate = true);\n }\n }\n scene.proxy.updateRightFrozenCellGroups();\n }\n }\n}\n\nfunction removeCol(col: number, scene: Scenegraph) {\n const proxy = scene.proxy;\n // removeCellGroup(col, scene);\n //先考虑非表头部分删除情况\n if (col >= scene.table.rowHeaderLevelCount) {\n if (col >= scene.table.colCount - scene.table.rightFrozenColCount) {\n // 如果是删除的右侧固定列 这里不做真正的删除,只需要后面将相应列做更新\n // scene.bodyGroup.removeChild(scene.bodyGroup.lastChild as any);\n // scene.bottomFrozenGroup.removeChild(scene.bottomFrozenGroup.lastChild as any);\n } else {\n const colGroup = scene.getColGroup(col, false);\n if (colGroup && colGroup.parent === scene.bodyGroup) {\n scene.bodyGroup.removeChild(colGroup);\n }\n const bottomColGroup = scene.getColGroupInBottom(col);\n if (bottomColGroup && bottomColGroup.parent === scene.bottomFrozenGroup) {\n scene.bottomFrozenGroup.removeChild(bottomColGroup);\n }\n }\n }\n\n // TODO 需要整体更新proxy的状态\n if (col >= proxy.colStart && col <= proxy.colEnd) {\n proxy.colEnd--;\n proxy.currentCol--;\n }\n proxy.bodyRightCol--;\n // proxy.totalCol--;\n const totalActualBodyColCount = Math.min(proxy.colLimit, proxy.bodyRightCol - proxy.bodyLeftCol + 1); // 渐进加载总col数量\n proxy.totalActualBodyColCount = totalActualBodyColCount;\n proxy.totalCol = proxy.colStart + totalActualBodyColCount - 1; // 目标渐进完成的col\n}\n\nfunction addCol(col: number, scene: Scenegraph) {\n const proxy = scene.proxy;\n proxy.bodyRightCol++;\n // proxy.totalCol++;\n const totalActualBodyColCount = Math.min(proxy.colLimit, proxy.bodyRightCol - proxy.bodyLeftCol + 1); // 渐进加载总col数量\n proxy.totalActualBodyColCount = totalActualBodyColCount;\n proxy.totalCol = proxy.colStart + totalActualBodyColCount - 1; // 目标渐进完成的col\n\n if (col < proxy.colStart) {\n return undefined;\n } else if (col > proxy.colEnd) {\n if (proxy.colEnd - proxy.colStart + 1 < proxy.colLimit) {\n // can add col\n proxy.colEnd++;\n proxy.currentCol++;\n\n addColGroup(col, scene);\n return col;\n }\n return undefined;\n }\n if (proxy.colEnd - proxy.colStart + 1 < proxy.colLimit) {\n // can add col\n proxy.colEnd++;\n proxy.currentCol++;\n\n addColGroup(col, scene);\n return col;\n }\n return col;\n}\n\n// array deduplication\nfunction deduplication(array: number[]) {\n const result = [];\n for (let i = 0; i < array.length; i++) {\n if (result.indexOf(array[i]) === -1) {\n result.push(array[i]);\n }\n }\n return result;\n}\n\nfunction resetColNumber(scene: Scenegraph) {\n let colIndex = scene.bodyColStart;\n scene.bodyGroup.forEachChildren((colGroup: Group) => {\n colGroup.col = colIndex;\n colGroup?.forEachChildren((cellGroup: Group) => {\n processCell(cellGroup);\n });\n colIndex++;\n });\n\n colIndex = scene.bodyColStart;\n scene.colHeaderGroup.forEachChildren((colGroup: Group) => {\n colGroup.col = colIndex;\n colGroup?.forEachChildren((cellGroup: Group) => {\n processCell(cellGroup);\n });\n colIndex++;\n });\n\n colIndex = scene.bodyColStart;\n scene.bottomFrozenGroup.forEachChildren((colGroup: Group) => {\n colGroup.col = colIndex;\n colGroup?.forEachChildren((cellGroup: Group) => {\n processCell(cellGroup);\n });\n colIndex++;\n });\n function processCell(cellGroup: Group) {\n cellGroup.col = colIndex;\n const merge = getCellMergeInfo(scene.table, cellGroup.col, cellGroup.row);\n if (merge) {\n cellGroup.mergeStartCol = merge.start.col;\n cellGroup.mergeStartCol = merge.start.col;\n cellGroup.mergeEndCol = merge.end.col;\n cellGroup.mergeEndCol = merge.end.col;\n }\n\n if (cellGroup.role !== 'cell') {\n return;\n }\n }\n}\n\nfunction resetColNumberAndX(scene: Scenegraph) {\n let colIndex = scene.bodyColStart;\n let x = scene.getCellGroupX(colIndex);\n scene.bodyGroup.forEachChildren((colGroup: Group) => {\n colGroup.col = colIndex;\n colGroup?.forEachChildren((cellGroup: Group) => {\n processCell(cellGroup);\n });\n colGroup.setAttribute('x', x);\n x += colGroup.attribute.width;\n colIndex++;\n });\n\n colIndex = scene.bodyColStart;\n x = scene.getCellGroupX(colIndex);\n scene.colHeaderGroup.forEachChildren((colGroup: Group) => {\n colGroup.col = colIndex;\n colGroup?.forEachChildren((cellGroup: Group) => {\n processCell(cellGroup);\n });\n colGroup.setAttribute('x', x);\n x += colGroup.attribute.width;\n colIndex++;\n });\n\n colIndex = scene.bodyColStart;\n x = scene.getCellGroupX(colIndex);\n scene.bottomFrozenGroup.forEachChildren((colGroup: Group) => {\n colGroup.col = colIndex;\n colGroup?.forEachChildren((cellGroup: Group) => {\n processCell(cellGroup);\n });\n colGroup.setAttribute('x', x);\n x += colGroup.attribute.width;\n colIndex++;\n });\n colIndex = scene.table.colCount - scene.table.rightFrozenColCount;\n x = 0;\n scene.rightFrozenGroup.forEachChildren((colGroup: Group) => {\n colGroup.col = colIndex;\n colGroup?.forEachChildren((cellGroup: Group) => {\n processCell(cellGroup);\n });\n colGroup.setAttribute('x', x);\n x += colGroup.attribute.width;\n colIndex++;\n });\n\n colIndex = scene.table.colCount - scene.table.rightFrozenColCount;\n x = 0;\n scene.rightTopCornerGroup.forEachChildren((colGroup: Group) => {\n colGroup.col = colIndex;\n colGroup?.forEachChildren((cellGroup: Group) => {\n processCell(cellGroup);\n });\n colGroup.setAttribute('x', x);\n x += colGroup.attribute.width;\n colIndex++;\n });\n\n colIndex = scene.table.colCount - scene.table.rightFrozenColCount;\n x = 0;\n scene.rightBottomCornerGroup.forEachChildren((colGroup: Group) => {\n colGroup.col = colIndex;\n colGroup?.forEachChildren((cellGroup: Group) => {\n processCell(cellGroup);\n });\n colGroup.setAttribute('x', x);\n x += colGroup.attribute.width;\n colIndex++;\n });\n function processCell(cellGroup: Group) {\n cellGroup.col = colIndex;\n const merge = getCellMergeInfo(scene.table, cellGroup.col, cellGroup.row);\n if (merge) {\n cellGroup.mergeStartCol = merge.start.col;\n cellGroup.mergeStartCol = merge.start.col;\n cellGroup.mergeEndCol = merge.end.col;\n cellGroup.mergeEndCol = merge.end.col;\n }\n\n if (cellGroup.role !== 'cell') {\n return;\n }\n }\n}\n\nfunction addColGroup(col: number, scene: Scenegraph) {\n if (scene.colHeaderGroup && scene.table.columnHeaderLevelCount > 0) {\n const columnGroup = new Group({\n x: 0,\n y: 0,\n width: scene.table.getColWidth(col),\n height: 0,\n clip: false,\n pickable: false\n });\n columnGroup.role = 'column';\n columnGroup.col = col;\n\n const colAfter = scene.getColGroup(col, true);\n if (colAfter) {\n scene.colHeaderGroup.insertBefore(columnGroup, colAfter);\n } else {\n scene.colHeaderGroup.appendChild(columnGroup);\n }\n generateCellGroup(columnGroup, col, 0, scene.table.columnHeaderLevelCount - 1);\n }\n\n if (scene.bodyGroup) {\n const columnGroup = new Group({\n x: 0,\n y: 0,\n width: scene.table.getColWidth(col),\n height: 0,\n clip: false,\n pickable: false\n });\n columnGroup.role = 'column';\n columnGroup.col = col;\n\n const colAfter = scene.getColGroup(col, false);\n if (colAfter) {\n scene.bodyGroup.insertBefore(columnGroup, colAfter);\n } else {\n scene.bodyGroup.appendChild(columnGroup);\n }\n generateCellGroup(columnGroup, col, scene.bodyRowStart, scene.bodyRowEnd);\n }\n if (scene.bottomFrozenGroup && scene.table.bottomFrozenRowCount > 0) {\n const columnGroup = new Group({\n x: 0,\n y: 0,\n width: scene.table.getColWidth(col),\n height: 0,\n clip: false,\n pickable: false\n });\n columnGroup.role = 'column';\n columnGroup.col = col;\n\n const colAfter = scene.getColGroupInBottom(col);\n if (colAfter) {\n scene.bottomFrozenGroup.insertBefore(columnGroup, colAfter);\n } else {\n scene.bottomFrozenGroup.appendChild(columnGroup);\n }\n\n generateCellGroup(\n columnGroup,\n col,\n scene.table.rowCount - scene.table.bottomFrozenRowCount,\n scene.table.rowCount - 1\n );\n }\n\n function generateCellGroup(group: IGroup, col: number, rowStart: number, rowEnd: number) {\n for (let row = rowStart; row <= rowEnd; row++) {\n // create cellGroup\n // const cellGroup = updateCell(col, row, scene.table, true);\n const cellGroup = new Group({\n x: 0,\n y: 0,\n width: scene.table.getColWidth(col),\n height: scene.table.getRowHeight(row)\n });\n cellGroup.role = 'cell';\n cellGroup.col = col;\n cellGroup.row = row;\n cellGroup.needUpdate = true;\n group.appendChild(cellGroup);\n }\n }\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/scenegraph/layout/update-col.ts"],"names":[],"mappings":";;;AAAA,6CAA4C;AAG5C,4CAAyC;AACzC,8DAA0D;AAE1D,4DAA2D;AAM3D,SAAgB,SAAS,CACvB,WAA0B,EAC1B,QAAuB,EACvB,WAA0B,EAC1B,KAAmB;IAEnB,MAAM,KAAK,GAAG,KAAK,CAAC,UAAU,CAAC;IAE/B,MAAM,UAAU,GAAG,aAAa,CAAC,WAAW,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;IAC1F,MAAM,OAAO,GAAG,aAAa,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,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;KACH;IAED,SAAS,iBAAiB,CAAC,KAAa,EAAE,GAAW,EAAE,QAAgB,EAAE,MAAc;QACrF,KAAK,IAAI,GAAG,GAAG,QAAQ,EAAE,GAAG,IAAI,MAAM,EAAE,GAAG,EAAE,EAAE;YAG7C,MAAM,SAAS,GAAG,IAAI,aAAK,CAAC;gBAC1B,CAAC,EAAE,CAAC;gBACJ,CAAC,EAAE,CAAC;gBACJ,KAAK,EAAE,KAAK,CAAC,KAAK,CAAC,WAAW,CAAC,GAAG,CAAC;gBACnC,MAAM,EAAE,KAAK,CAAC,KAAK,CAAC,YAAY,CAAC,GAAG,CAAC;aACtC,CAAC,CAAC;YACH,SAAS,CAAC,IAAI,GAAG,MAAM,CAAC;YACxB,SAAS,CAAC,GAAG,GAAG,GAAG,CAAC;YACpB,SAAS,CAAC,GAAG,GAAG,GAAG,CAAC;YACpB,SAAS,CAAC,UAAU,GAAG,IAAI,CAAC;YAC5B,KAAK,CAAC,WAAW,CAAC,SAAS,CAAC,CAAC;SAC9B;IACH,CAAC;AACH,CAAC","file":"update-col.js","sourcesContent":["import { isNumber } from '@visactor/vutils';\nimport type { CellAddress } from '../../ts-types';\nimport type { BaseTableAPI } from '../../ts-types/base-table';\nimport { Group } from '../graphic/group';\nimport { updateCell } from '../group-creater/cell-helper';\nimport type { Scenegraph } from '../scenegraph';\nimport { getCellMergeInfo } from '../utils/get-cell-merge';\nimport type { IGroup } from '@visactor/vrender';\n\n/**\n * add and remove rows in scenegraph\n */\nexport function updateCol(\n removeCells: CellAddress[],\n addCells: CellAddress[],\n updateCells: CellAddress[],\n table: BaseTableAPI\n) {\n const scene = table.scenegraph;\n // deduplication\n const removeCols = deduplication(removeCells.map(cell => cell.col)).sort((a, b) => b - a);\n const addCols = deduplication(addCells.map(cell => cell.col)).sort((a, b) => a - b);\n const updateCols = deduplication(updateCells.map(cell => cell.col)).sort((a, b) => a - b);\n\n // remove cells\n removeCols.forEach(col => {\n removeCol(col, scene);\n });\n\n const colWidthsMap = table.colWidthsMap;\n removeCols.forEach(col => {\n colWidthsMap.delAndReorder(col);\n });\n\n if (removeCols.length) {\n resetColNumber(scene);\n }\n\n scene.table._clearColRangeWidthsMap();\n\n // add cells\n let updateAfter: number;\n addCols.forEach(col => {\n const needUpdateAfter = addCol(col, scene);\n resetColNumber(scene);\n updateAfter = updateAfter ?? needUpdateAfter;\n colWidthsMap.addAndReorder(col);\n });\n\n // reset attribute y and col number in CellGroup\n // const newTotalHeight = resetColNumberAndY(scene);\n resetColNumberAndX(scene);\n // add cells\n updateCols.forEach(col => {\n for (let row = 0; row < table.rowCount; row++) {\n // updateColAttr(col, scene);\n const mergeInfo = getCellMergeInfo(scene.table, col, row);\n if (mergeInfo) {\n for (let col = mergeInfo.start.col; col <= mergeInfo.end.col; col++) {\n for (let col = mergeInfo.start.col; col <= mergeInfo.end.col; col++) {\n updateCell(col, row, scene.table, false);\n }\n }\n } else {\n updateCell(col, row, scene.table, false);\n }\n }\n });\n\n if (isNumber(updateAfter)) {\n for (let col = updateAfter; col < table.colCount; col++) {\n for (let row = 0; row < table.rowCount; row++) {\n const cellGroup = scene.highPerformanceGetCell(col, row, true);\n cellGroup && (cellGroup.needUpdate = true);\n }\n }\n scene.proxy.colUpdatePos = updateAfter;\n }\n if (addCols.length) {\n if (!isNumber(updateAfter)) {\n const minCol = Math.min(...addCols);\n scene.proxy.colUpdatePos = minCol;\n }\n scene.proxy.colUpdateDirection = 'left';\n scene.proxy.updateColGroups(scene.proxy.screenColCount * 2);\n updateRightFrozeCellGroups();\n scene.proxy.progress();\n } else if (removeCols.length) {\n scene.proxy.updateColGroups(scene.proxy.screenColCount * 2);\n updateRightFrozeCellGroups();\n scene.proxy.progress();\n }\n\n // update table size\n const newTotalWidth = table.getColsWidth(table.frozenColCount, table.colCount - 1);\n scene.updateContainerWidth(scene.table.frozenColCount, newTotalWidth - scene.bodyGroup.attribute.width);\n\n function updateRightFrozeCellGroups() {\n if (\n addCols?.[addCols?.length - 1] >= table.colCount - table.rightFrozenColCount ||\n updateCols?.[updateCols?.length - 1] >= table.colCount - table.rightFrozenColCount ||\n removeCols?.[0] >= table.colCount - table.rightFrozenColCount\n ) {\n for (let col = table.colCount - table.rightFrozenColCount; col < table.colCount; col++) {\n for (let row = 0; row < table.rowCount; row++) {\n const cellGroup = scene.highPerformanceGetCell(col, row, true);\n cellGroup && (cellGroup.needUpdate = true);\n }\n }\n scene.proxy.updateRightFrozenCellGroups();\n }\n }\n}\n\nfunction removeCol(col: number, scene: Scenegraph) {\n const proxy = scene.proxy;\n // removeCellGroup(col, scene);\n //先考虑非表头部分删除情况\n if (col >= scene.table.rowHeaderLevelCount) {\n if (col >= scene.table.colCount - scene.table.rightFrozenColCount) {\n // 如果是删除的右侧固定列 这里不做真正的删除,只需要后面将相应列做更新\n // scene.bodyGroup.removeChild(scene.bodyGroup.lastChild as any);\n // scene.bottomFrozenGroup.removeChild(scene.bottomFrozenGroup.lastChild as any);\n } else {\n const colGroup = scene.getColGroup(col, false);\n if (colGroup && colGroup.parent === scene.bodyGroup) {\n scene.bodyGroup.removeChild(colGroup);\n }\n const bottomColGroup = scene.getColGroupInBottom(col);\n if (bottomColGroup && bottomColGroup.parent === scene.bottomFrozenGroup) {\n scene.bottomFrozenGroup.removeChild(bottomColGroup);\n }\n }\n }\n\n // TODO 需要整体更新proxy的状态\n if (col >= proxy.colStart && col <= proxy.colEnd) {\n proxy.colEnd--;\n proxy.currentCol--;\n }\n proxy.bodyRightCol--;\n // proxy.totalCol--;\n const totalActualBodyColCount = Math.min(proxy.colLimit, proxy.bodyRightCol - proxy.bodyLeftCol + 1); // 渐进加载总col数量\n proxy.totalActualBodyColCount = totalActualBodyColCount;\n proxy.totalCol = proxy.colStart + totalActualBodyColCount - 1; // 目标渐进完成的col\n}\n\nfunction addCol(col: number, scene: Scenegraph) {\n const proxy = scene.proxy;\n proxy.bodyRightCol++;\n // proxy.totalCol++;\n const totalActualBodyColCount = Math.min(proxy.colLimit, proxy.bodyRightCol - proxy.bodyLeftCol + 1); // 渐进加载总col数量\n proxy.totalActualBodyColCount = totalActualBodyColCount;\n proxy.totalCol = proxy.colStart + totalActualBodyColCount - 1; // 目标渐进完成的col\n\n if (col < proxy.colStart) {\n return undefined;\n } else if (col > proxy.colEnd) {\n if (proxy.colEnd - proxy.colStart + 1 < proxy.colLimit) {\n // can add col\n proxy.colEnd++;\n proxy.currentCol++;\n\n addColGroup(col, scene);\n return col;\n }\n return undefined;\n }\n if (proxy.colEnd - proxy.colStart + 1 < proxy.colLimit) {\n // can add col\n proxy.colEnd++;\n proxy.currentCol++;\n\n addColGroup(col, scene);\n return col;\n }\n return col;\n}\n\n// array deduplication\nfunction deduplication(array: number[]) {\n const result = [];\n for (let i = 0; i < array.length; i++) {\n if (result.indexOf(array[i]) === -1) {\n result.push(array[i]);\n }\n }\n return result;\n}\n\nfunction resetColNumber(scene: Scenegraph) {\n let colIndex = scene.bodyColStart;\n scene.bodyGroup.forEachChildren((colGroup: Group) => {\n colGroup.col = colIndex;\n colGroup?.forEachChildren((cellGroup: Group) => {\n processCell(cellGroup);\n });\n colIndex++;\n });\n\n colIndex = scene.bodyColStart;\n scene.colHeaderGroup.forEachChildren((colGroup: Group) => {\n colGroup.col = colIndex;\n colGroup?.forEachChildren((cellGroup: Group) => {\n processCell(cellGroup);\n });\n colIndex++;\n });\n\n colIndex = scene.bodyColStart;\n scene.bottomFrozenGroup.forEachChildren((colGroup: Group) => {\n colGroup.col = colIndex;\n colGroup?.forEachChildren((cellGroup: Group) => {\n processCell(cellGroup);\n });\n colIndex++;\n });\n function processCell(cellGroup: Group) {\n cellGroup.col = colIndex;\n const merge = getCellMergeInfo(scene.table, cellGroup.col, cellGroup.row);\n if (merge) {\n cellGroup.mergeStartCol = merge.start.col;\n cellGroup.mergeStartCol = merge.start.col;\n cellGroup.mergeEndCol = merge.end.col;\n cellGroup.mergeEndCol = merge.end.col;\n }\n\n if (cellGroup.role !== 'cell') {\n return;\n }\n }\n}\n\nfunction resetColNumberAndX(scene: Scenegraph) {\n let colIndex = scene.bodyColStart;\n let x = scene.getCellGroupX(colIndex);\n scene.bodyGroup.forEachChildren((colGroup: Group) => {\n colGroup.col = colIndex;\n colGroup?.forEachChildren((cellGroup: Group) => {\n processCell(cellGroup);\n });\n colGroup.setAttribute('x', x);\n x += colGroup.attribute.width;\n colIndex++;\n });\n\n colIndex = scene.bodyColStart;\n x = scene.getCellGroupX(colIndex);\n scene.colHeaderGroup.forEachChildren((colGroup: Group) => {\n colGroup.col = colIndex;\n colGroup?.forEachChildren((cellGroup: Group) => {\n processCell(cellGroup);\n });\n colGroup.setAttribute('x', x);\n x += colGroup.attribute.width;\n colIndex++;\n });\n\n colIndex = scene.bodyColStart;\n x = scene.getCellGroupX(colIndex);\n scene.bottomFrozenGroup.forEachChildren((colGroup: Group) => {\n colGroup.col = colIndex;\n colGroup?.forEachChildren((cellGroup: Group) => {\n processCell(cellGroup);\n });\n colGroup.setAttribute('x', x);\n x += colGroup.attribute.width;\n colIndex++;\n });\n colIndex = scene.table.colCount - scene.table.rightFrozenColCount;\n x = 0;\n scene.rightFrozenGroup.forEachChildren((colGroup: Group) => {\n colGroup.col = colIndex;\n colGroup?.forEachChildren((cellGroup: Group) => {\n processCell(cellGroup);\n });\n colGroup.setAttribute('x', x);\n x += colGroup.attribute.width;\n colIndex++;\n });\n\n colIndex = scene.table.colCount - scene.table.rightFrozenColCount;\n x = 0;\n scene.rightTopCornerGroup.forEachChildren((colGroup: Group) => {\n colGroup.col = colIndex;\n colGroup?.forEachChildren((cellGroup: Group) => {\n processCell(cellGroup);\n });\n colGroup.setAttribute('x', x);\n x += colGroup.attribute.width;\n colIndex++;\n });\n\n colIndex = scene.table.colCount - scene.table.rightFrozenColCount;\n x = 0;\n scene.rightBottomCornerGroup.forEachChildren((colGroup: Group) => {\n colGroup.col = colIndex;\n colGroup?.forEachChildren((cellGroup: Group) => {\n processCell(cellGroup);\n });\n colGroup.setAttribute('x', x);\n x += colGroup.attribute.width;\n colIndex++;\n });\n function processCell(cellGroup: Group) {\n cellGroup.col = colIndex;\n const merge = getCellMergeInfo(scene.table, cellGroup.col, cellGroup.row);\n if (merge) {\n cellGroup.mergeStartCol = merge.start.col;\n cellGroup.mergeStartCol = merge.start.col;\n cellGroup.mergeEndCol = merge.end.col;\n cellGroup.mergeEndCol = merge.end.col;\n }\n\n if (cellGroup.role !== 'cell') {\n return;\n }\n }\n}\n\nfunction addColGroup(col: number, scene: Scenegraph) {\n if (scene.colHeaderGroup && scene.table.columnHeaderLevelCount > 0) {\n const columnGroup = new Group({\n x: 0,\n y: 0,\n width: scene.table.getColWidth(col),\n height: 0,\n clip: false,\n pickable: false\n });\n columnGroup.role = 'column';\n columnGroup.col = col;\n\n const colAfter = scene.getColGroup(col, true);\n if (colAfter) {\n scene.colHeaderGroup.insertBefore(columnGroup, colAfter);\n } else {\n scene.colHeaderGroup.appendChild(columnGroup);\n }\n generateCellGroup(columnGroup, col, 0, scene.table.columnHeaderLevelCount - 1);\n }\n\n if (scene.bodyGroup) {\n const columnGroup = new Group({\n x: 0,\n y: 0,\n width: scene.table.getColWidth(col),\n height: 0,\n clip: false,\n pickable: false\n });\n columnGroup.role = 'column';\n columnGroup.col = col;\n\n const colAfter = scene.getColGroup(col, false);\n if (colAfter) {\n scene.bodyGroup.insertBefore(columnGroup, colAfter);\n } else {\n scene.bodyGroup.appendChild(columnGroup);\n }\n generateCellGroup(columnGroup, col, scene.bodyRowStart, scene.bodyRowEnd);\n }\n if (scene.bottomFrozenGroup && scene.table.bottomFrozenRowCount > 0) {\n const columnGroup = new Group({\n x: 0,\n y: 0,\n width: scene.table.getColWidth(col),\n height: 0,\n clip: false,\n pickable: false\n });\n columnGroup.role = 'column';\n columnGroup.col = col;\n\n const colAfter = scene.getColGroupInBottom(col);\n if (colAfter) {\n scene.bottomFrozenGroup.insertBefore(columnGroup, colAfter);\n } else {\n scene.bottomFrozenGroup.appendChild(columnGroup);\n }\n\n generateCellGroup(\n columnGroup,\n col,\n scene.table.rowCount - scene.table.bottomFrozenRowCount,\n scene.table.rowCount - 1\n );\n }\n\n function generateCellGroup(group: IGroup, col: number, rowStart: number, rowEnd: number) {\n for (let row = rowStart; row <= rowEnd; row++) {\n // create cellGroup\n // const cellGroup = updateCell(col, row, scene.table, true);\n const cellGroup = new Group({\n x: 0,\n y: 0,\n width: scene.table.getColWidth(col),\n height: scene.table.getRowHeight(row)\n });\n cellGroup.role = 'cell';\n cellGroup.col = col;\n cellGroup.row = row;\n cellGroup.needUpdate = true;\n group.appendChild(cellGroup);\n }\n }\n}\n"]}
|
|
@@ -8,16 +8,17 @@ const vutils_1 = require("@visactor/vutils"), group_1 = require("../graphic/grou
|
|
|
8
8
|
|
|
9
9
|
function updateRow(removeCells, addCells, updateCells, table) {
|
|
10
10
|
const scene = table.scenegraph, removeRows = deduplication(removeCells.map((cell => cell.row))).sort(((a, b) => b - a)), addRows = deduplication(addCells.map((cell => cell.row))).sort(((a, b) => a - b)), updateRows = deduplication(updateCells.map((cell => cell.row))).sort(((a, b) => a - b));
|
|
11
|
-
let updateAfter;
|
|
12
11
|
removeRows.forEach((row => {
|
|
13
12
|
removeRow(row, scene);
|
|
14
|
-
}))
|
|
15
|
-
|
|
16
|
-
|
|
13
|
+
}));
|
|
14
|
+
const rowHeightsMap = table.rowHeightsMap;
|
|
15
|
+
let updateAfter;
|
|
16
|
+
removeRows.forEach((row => {
|
|
17
|
+
rowHeightsMap.delAndReorder(row);
|
|
17
18
|
})), removeRows.length && resetRowNumber(scene), scene.table._clearRowRangeHeightsMap(),
|
|
18
19
|
addRows.forEach((row => {
|
|
19
20
|
const needUpdateAfter = addRow(row, scene);
|
|
20
|
-
updateAfter = null != updateAfter ? updateAfter : needUpdateAfter,
|
|
21
|
+
updateAfter = null != updateAfter ? updateAfter : needUpdateAfter, rowHeightsMap.addAndReorder(row);
|
|
21
22
|
})), resetRowNumberAndY(scene);
|
|
22
23
|
for (let col = 0; col < table.colCount; col++) updateRows.forEach((r => {
|
|
23
24
|
const mergeInfo = (0, get_cell_merge_1.getCellMergeInfo)(scene.table, col, r);
|
|
@@ -34,7 +35,7 @@ function updateRow(removeCells, addCells, updateCells, table) {
|
|
|
34
35
|
if (addRows.length) {
|
|
35
36
|
if (!(0, vutils_1.isNumber)(updateAfter)) {
|
|
36
37
|
const minRow = Math.min(...addRows);
|
|
37
|
-
scene.proxy.rowUpdatePos = minRow;
|
|
38
|
+
scene.proxy.rowUpdatePos = Math.min(minRow, scene.proxy.rowUpdatePos);
|
|
38
39
|
}
|
|
39
40
|
scene.proxy.rowUpdateDirection = "up", scene.proxy.updateCellGroups(2 * scene.proxy.screenRowCount),
|
|
40
41
|
updateBottomFrozeCellGroups(), scene.proxy.progress();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/scenegraph/layout/update-row.ts"],"names":[],"mappings":";;;AAAA,6CAA4C;AAG5C,4CAAyC;AACzC,8DAA0D;AAE1D,4DAA2D;AAM3D,SAAgB,SAAS,CACvB,WAA0B,EAC1B,QAAuB,EACvB,WAA0B,EAC1B,KAAmB;IAEnB,MAAM,KAAK,GAAG,KAAK,CAAC,UAAU,CAAC;IAE/B,MAAM,UAAU,GAAG,aAAa,CAAC,WAAW,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;IAC1F,MAAM,OAAO,GAAG,aAAa,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;IACpF,MAAM,UAAU,GAAG,aAAa,CAAC,WAAW,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG,CA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M,CAAC,CAAC;YACpE,QAAQ,CAAC,WAAW,CAAC,SAAS,CAAC,CAAC;SACjC;KACF;AACH,CAAC","file":"update-row.js","sourcesContent":["import { isNumber } from '@visactor/vutils';\nimport type { CellAddress } from '../../ts-types';\nimport type { BaseTableAPI } from '../../ts-types/base-table';\nimport { Group } from '../graphic/group';\nimport { updateCell } from '../group-creater/cell-helper';\nimport type { Scenegraph } from '../scenegraph';\nimport { getCellMergeInfo } from '../utils/get-cell-merge';\nimport type { IGraphic } from '@visactor/vrender';\n\n/**\n * add and remove rows in scenegraph\n */\nexport function updateRow(\n removeCells: CellAddress[],\n addCells: CellAddress[],\n updateCells: CellAddress[],\n table: BaseTableAPI\n) {\n const scene = table.scenegraph;\n // deduplication\n const removeRows = deduplication(removeCells.map(cell => cell.row)).sort((a, b) => b - a);\n const addRows = deduplication(addCells.map(cell => cell.row)).sort((a, b) => a - b);\n const updateRows = deduplication(updateCells.map(cell => cell.row)).sort((a, b) => a - b);\n\n // remove cells\n removeRows.forEach(row => {\n removeRow(row, scene);\n });\n\n removeRows.forEach(row => {\n scene.table.rowHeightsMap.adjustOrder(row + 1, row, scene.table.rowHeightsMap.count() - row - 1);\n scene.table.rowHeightsMap.del(scene.table.rowHeightsMap.count() - 1);\n });\n\n if (removeRows.length) {\n resetRowNumber(scene);\n }\n\n scene.table._clearRowRangeHeightsMap();\n\n // add cells\n let updateAfter: number;\n addRows.forEach(row => {\n const needUpdateAfter = addRow(row, scene);\n updateAfter = updateAfter ?? needUpdateAfter;\n scene.table.rowHeightsMap.adjustOrder(row, row + 1, scene.table.rowHeightsMap.count() - row);\n });\n\n // reset attribute y and row number in CellGroup\n // const newTotalHeight = resetRowNumberAndY(scene);\n resetRowNumberAndY(scene);\n\n for (let col = 0; col < table.colCount; col++) {\n // add cells\n updateRows.forEach(r => {\n // updateRowAttr(row, scene);\n const mergeInfo = getCellMergeInfo(scene.table, col, r);\n if (mergeInfo) {\n for (let col = mergeInfo.start.col; col <= mergeInfo.end.col; col++) {\n for (let row = mergeInfo.start.row; row <= mergeInfo.end.row; row++) {\n updateCell(col, row, scene.table, false);\n }\n }\n } else {\n updateCell(col, r, scene.table, false);\n }\n });\n }\n if (isNumber(updateAfter)) {\n for (let col = 0; col < table.colCount; col++) {\n for (let row = updateAfter; row < table.rowCount; row++) {\n const cellGroup = scene.highPerformanceGetCell(col, row, true);\n cellGroup && (cellGroup.needUpdate = true);\n }\n }\n scene.proxy.rowUpdatePos = updateAfter;\n }\n\n if (addRows.length) {\n if (!isNumber(updateAfter)) {\n const minRow = Math.min(...addRows);\n scene.proxy.rowUpdatePos = minRow;\n }\n scene.proxy.rowUpdateDirection = 'up';\n scene.proxy.updateCellGroups(scene.proxy.screenRowCount * 2);\n updateBottomFrozeCellGroups();\n scene.proxy.progress();\n } else if (removeRows.length) {\n scene.proxy.updateCellGroups(scene.proxy.screenRowCount * 2);\n\n updateBottomFrozeCellGroups();\n scene.proxy.progress();\n }\n\n // update table size\n const newTotalHeight = table.getRowsHeight(table.frozenRowCount, table.rowCount - 1 - table.bottomFrozenRowCount);\n scene.updateContainerHeight(scene.table.frozenRowCount, newTotalHeight - scene.bodyGroup.attribute.height);\n\n function updateBottomFrozeCellGroups() {\n if (\n addRows?.[addRows?.length - 1] >= table.rowCount - table.bottomFrozenRowCount ||\n updateRows?.[updateRows?.length - 1] >= table.rowCount - table.bottomFrozenRowCount ||\n removeRows?.[0] >= table.rowCount - table.bottomFrozenRowCount\n ) {\n for (let col = 0; col < table.colCount; col++) {\n for (let row = table.rowCount - table.bottomFrozenRowCount; row < table.rowCount; row++) {\n const cellGroup = scene.highPerformanceGetCell(col, row, true);\n cellGroup && (cellGroup.needUpdate = true);\n }\n }\n scene.proxy.updateBottomFrozenCellGroups();\n }\n }\n}\nfunction removeRow(row: number, scene: Scenegraph) {\n removeCellGroup(row, scene);\n const proxy = scene.proxy;\n\n // TODO 需要整体更新proxy的状态\n if (row >= proxy.rowStart && row <= proxy.rowEnd) {\n proxy.rowEnd--;\n proxy.currentRow--;\n }\n proxy.bodyBottomRow--;\n // proxy.totalRow--;\n const totalActualBodyRowCount = Math.min(proxy.rowLimit, proxy.bodyBottomRow - proxy.bodyTopRow + 1); // 渐进加载总row数量\n proxy.totalActualBodyRowCount = totalActualBodyRowCount;\n proxy.totalRow = proxy.rowStart + totalActualBodyRowCount - 1; // 目标渐进完成的row\n}\n\nfunction addRow(row: number, scene: Scenegraph) {\n const proxy = scene.proxy;\n proxy.bodyBottomRow++;\n // proxy.totalRow++;\n const totalActualBodyRowCount = Math.min(proxy.rowLimit, proxy.bodyBottomRow - proxy.bodyTopRow + 1); // 渐进加载总row数量\n proxy.totalActualBodyRowCount = totalActualBodyRowCount;\n proxy.totalRow = proxy.rowStart + totalActualBodyRowCount - 1; // 目标渐进完成的row\n\n if (row < proxy.rowStart) {\n return undefined;\n } else if (row > proxy.rowEnd) {\n if (proxy.rowEnd - proxy.rowStart + 1 < proxy.rowLimit) {\n // can add row\n proxy.rowEnd++;\n proxy.currentRow++;\n\n addRowCellGroup(row, scene);\n return row;\n }\n return undefined;\n }\n if (proxy.rowEnd - proxy.rowStart + 1 < proxy.rowLimit) {\n // can add row\n proxy.rowEnd++;\n proxy.currentRow++;\n\n addRowCellGroup(row, scene);\n return row;\n }\n // update rows after\n return row;\n\n // return undefined;\n\n // // TODO 需要整体更新proxy的状态\n // scene.proxy.bodyBottomRow++;\n // scene.proxy.totalRow++;\n // scene.proxy.rowEnd++;\n // scene.proxy.currentRow++;\n}\n\n// array deduplication\nfunction deduplication(array: number[]) {\n const result = [];\n for (let i = 0; i < array.length; i++) {\n if (result.indexOf(array[i]) === -1) {\n result.push(array[i]);\n }\n }\n return result;\n}\n\n// function resetRowNumber(scene: Scenegraph) {\n// for (let col = 0; col < scene.table.colCount; col++) {\n// const headerColGroup = scene.getColGroup(col, true);\n// const colGroup = scene.getColGroup(col, false);\n// if (!headerColGroup && !colGroup) {\n// continue;\n// }\n// // reset row number\n// let rowIndex = 0; //(headerColGroup.firstChild as Group)?.row;\n// headerColGroup?.forEachChildren((cellGroup: Group) => {\n// // const oldRow = cellGroup.row;\n// // if (isNumber(cellGroup.mergeStartRow)) {\n// // cellGroup.mergeStartRow = cellGroup.mergeStartRow - oldRow + rowIndex;\n// // }\n// // if (isNumber(cellGroup.mergeEndRow)) {\n// // cellGroup.mergeEndRow = cellGroup.mergeEndRow - oldRow + rowIndex;\n// // }\n// cellGroup.row = rowIndex;\n// const merge = getCellMergeInfo(scene.table, cellGroup.col, cellGroup.row);\n// if (merge) {\n// cellGroup.mergeStartCol = merge.start.col;\n// cellGroup.mergeStartRow = merge.start.row;\n// cellGroup.mergeEndCol = merge.end.col;\n// cellGroup.mergeEndRow = merge.end.row;\n// }\n// rowIndex++;\n// });\n// // rowIndex = (colGroup.firstChild as Group)?.row;\n// // rowIndex = scene.table.columnHeaderLevelCount;\n// rowIndex = scene.bodyRowStart;\n// colGroup?.forEachChildren((cellGroup: Group) => {\n// // const oldRow = cellGroup.row;\n// // if (isNumber(cellGroup.mergeStartRow)) {\n// // cellGroup.mergeStartRow = cellGroup.mergeStartRow - oldRow + rowIndex;\n// // }\n// // if (isNumber(cellGroup.mergeEndRow)) {\n// // cellGroup.mergeEndRow = cellGroup.mergeEndRow - oldRow + rowIndex;\n// // }\n// cellGroup.row = rowIndex;\n// const merge = getCellMergeInfo(scene.table, cellGroup.col, cellGroup.row);\n// if (merge) {\n// cellGroup.mergeStartCol = merge.start.col;\n// cellGroup.mergeStartRow = merge.start.row;\n// cellGroup.mergeEndCol = merge.end.col;\n// cellGroup.mergeEndRow = merge.end.row;\n// }\n// rowIndex++;\n// });\n// }\n// }\n\n// function resetRowNumberAndY(scene: Scenegraph) {\n// const table = scene.table;\n// let newTotalHeight = 0;\n// for (let col = 0; col < scene.table.colCount; col++) {\n// const headerColGroup = scene.getColGroup(col, true);\n// const colGroup = scene.getColGroup(col, false); // body, row header, right frozen\n// const bottomGroup =\n// scene.getColGroupInBottom(col) ||\n// scene.getColGroupInLeftBottomCorner(col) ||\n// scene.getColGroupInRightTopCorner(col);\n// if (!headerColGroup && !colGroup && !bottomGroup) {\n// continue;\n// }\n// let y = 0;\n// // reset row number\n// // let rowIndex = (headerColGroup.firstChild as Group)?.row;\n// // headerColGroup.forEachChildren((cellGroup: Group) => {\n// // cellGroup.row = rowIndex;\n// // rowIndex++;\n// // if (cellGroup.role !== 'cell') {\n// // return;\n// // }\n// // cellGroup.setAttribute('y', y);\n// // y+= cellGroup.attribute.height;\n// // });\n// // let rowIndex = (colGroup.firstChild as Group)?.row;\n// let rowIndex = scene.bodyRowStart;\n// y = scene.getCellGroupY(rowIndex);\n// colGroup?.forEachChildren((cellGroup: Group) => {\n// // const oldRow = cellGroup.row;\n// // if (isNumber(cellGroup.mergeStartRow)) {\n// // cellGroup.mergeStartRow = cellGroup.mergeStartRow - oldRow + rowIndex;\n// // }\n// // if (isNumber(cellGroup.mergeEndRow)) {\n// // cellGroup.mergeEndRow = cellGroup.mergeEndRow - oldRow + rowIndex;\n// // }\n// cellGroup.row = rowIndex;\n// const merge = getCellMergeInfo(scene.table, cellGroup.col, cellGroup.row);\n// if (merge) {\n// cellGroup.mergeStartCol = merge.start.col;\n// cellGroup.mergeStartRow = merge.start.row;\n// cellGroup.mergeEndCol = merge.end.col;\n// cellGroup.mergeEndRow = merge.end.row;\n// }\n// rowIndex++;\n// if (cellGroup.role !== 'cell') {\n// return;\n// }\n// cellGroup.setAttribute('y', y);\n// y += cellGroup.attribute.height;\n// });\n// newTotalHeight = y;\n\n// rowIndex = scene.table.rowCount - scene.table.bottomFrozenRowCount;\n// // update bottom frozen cell row index\n// bottomGroup?.forEachChildren((cellGroup: Group) => {\n// cellGroup.row = rowIndex;\n// const merge = getCellMergeInfo(scene.table, cellGroup.col, cellGroup.row);\n// if (merge) {\n// cellGroup.mergeStartCol = merge.start.col;\n// cellGroup.mergeStartRow = merge.start.row;\n// cellGroup.mergeEndCol = merge.end.col;\n// cellGroup.mergeEndRow = merge.end.row;\n// }\n// rowIndex++;\n// });\n// }\n// return newTotalHeight;\n// }\nfunction resetRowNumber(scene: Scenegraph) {\n scene.bodyGroup.forEachChildren((colGroup: Group) => {\n let rowIndex = scene.bodyRowStart;\n colGroup?.forEachChildren((cellGroup: Group) => {\n processCell(cellGroup, rowIndex);\n rowIndex++;\n });\n });\n\n scene.rowHeaderGroup.forEachChildren((colGroup: Group) => {\n let rowIndex = scene.bodyRowStart;\n colGroup?.forEachChildren((cellGroup: Group) => {\n processCell(cellGroup, rowIndex);\n rowIndex++;\n });\n });\n\n scene.rightFrozenGroup.forEachChildren((colGroup: Group) => {\n let rowIndex = scene.bodyRowStart;\n colGroup?.forEachChildren((cellGroup: Group) => {\n processCell(cellGroup, rowIndex);\n rowIndex++;\n });\n });\n scene.bottomFrozenGroup.forEachChildren((colGroup: Group) => {\n let rowIndex = scene.table.rowCount - scene.table.bottomFrozenRowCount;\n colGroup?.forEachChildren((cellGroup: Group) => {\n processCell(cellGroup, rowIndex);\n rowIndex++;\n });\n });\n scene.leftBottomCornerGroup.forEachChildren((colGroup: Group) => {\n let rowIndex = scene.table.rowCount - scene.table.bottomFrozenRowCount;\n colGroup?.forEachChildren((cellGroup: Group) => {\n processCell(cellGroup, rowIndex);\n rowIndex++;\n });\n });\n scene.rightBottomCornerGroup.forEachChildren((colGroup: Group) => {\n let rowIndex = scene.table.rowCount - scene.table.bottomFrozenRowCount;\n colGroup?.forEachChildren((cellGroup: Group) => {\n processCell(cellGroup, rowIndex);\n rowIndex++;\n });\n });\n function processCell(cellGroup: Group, rowIndex: number) {\n cellGroup.row = rowIndex;\n const merge = getCellMergeInfo(scene.table, cellGroup.col, cellGroup.row);\n if (merge) {\n cellGroup.mergeStartCol = merge.start.col;\n cellGroup.mergeStartCol = merge.start.col;\n cellGroup.mergeEndCol = merge.end.col;\n cellGroup.mergeEndCol = merge.end.col;\n }\n }\n}\n\nfunction resetRowNumberAndY(scene: Scenegraph) {\n scene.bodyGroup.forEachChildren((colGroup: Group) => {\n let rowIndex = scene.bodyRowStart;\n // let y = (colGroup.firstChild as IGraphic).attribute.y;\n let y = scene.getCellGroupY(rowIndex);\n colGroup?.forEachChildren((cellGroup: Group) => {\n processCell(cellGroup, rowIndex, y);\n rowIndex++;\n y += cellGroup.attribute.height;\n });\n });\n\n scene.rowHeaderGroup.forEachChildren((colGroup: Group) => {\n let rowIndex = scene.bodyRowStart;\n // let y = (colGroup.firstChild as IGraphic).attribute.y;\n let y = scene.getCellGroupY(rowIndex);\n colGroup?.forEachChildren((cellGroup: Group) => {\n processCell(cellGroup, rowIndex, y);\n rowIndex++;\n y += cellGroup.attribute.height;\n });\n });\n\n scene.rightFrozenGroup.forEachChildren((colGroup: Group) => {\n let rowIndex = scene.bodyRowStart;\n // let y = (colGroup.firstChild as IGraphic).attribute.y;\n let y = scene.getCellGroupY(rowIndex);\n colGroup?.forEachChildren((cellGroup: Group) => {\n processCell(cellGroup, rowIndex, y);\n rowIndex++;\n y += cellGroup.attribute.height;\n });\n });\n scene.bottomFrozenGroup.forEachChildren((colGroup: Group) => {\n let rowIndex = scene.table.rowCount - scene.table.bottomFrozenRowCount;\n let y = 0;\n colGroup?.forEachChildren((cellGroup: Group) => {\n processCell(cellGroup, rowIndex, y);\n rowIndex++;\n y += cellGroup.attribute.height;\n });\n });\n scene.leftBottomCornerGroup.forEachChildren((colGroup: Group) => {\n let rowIndex = scene.table.rowCount - scene.table.bottomFrozenRowCount;\n let y = 0;\n colGroup?.forEachChildren((cellGroup: Group) => {\n processCell(cellGroup, rowIndex, y);\n rowIndex++;\n y += cellGroup.attribute.height;\n });\n });\n scene.rightBottomCornerGroup.forEachChildren((colGroup: Group) => {\n let rowIndex = scene.table.rowCount - scene.table.bottomFrozenRowCount;\n let y = 0;\n colGroup?.forEachChildren((cellGroup: Group) => {\n processCell(cellGroup, rowIndex, y);\n rowIndex++;\n y += cellGroup.attribute.height;\n });\n });\n function processCell(cellGroup: Group, rowIndex: number, y: number) {\n cellGroup.row = rowIndex;\n cellGroup.setAttribute('y', y);\n const merge = getCellMergeInfo(scene.table, cellGroup.col, cellGroup.row);\n if (merge) {\n cellGroup.mergeStartCol = merge.start.col;\n cellGroup.mergeStartCol = merge.start.col;\n cellGroup.mergeEndCol = merge.end.col;\n cellGroup.mergeEndCol = merge.end.col;\n }\n }\n}\nfunction addRowCellGroup(row: number, scene: Scenegraph) {\n for (let col = 0; col < scene.table.colCount; col++) {\n // create cellGroup\n // const cellGroup = updateCell(col, row, scene.table, true);\n const cellGroup = new Group({\n x: 0,\n y: 0,\n width: scene.table.getColWidth(col),\n height: scene.table.getRowHeight(row)\n });\n cellGroup.role = 'cell';\n cellGroup.col = col;\n cellGroup.row = row;\n cellGroup.needUpdate = true;\n\n if (!cellGroup) {\n // TODO: deal with data promise situation\n continue;\n }\n\n // insert cellGroup in colGroup\n const colGroup = scene.getColGroup(col);\n if (!colGroup) {\n continue;\n }\n\n if (colGroup.firstChild && row < (colGroup.firstChild as Group).row) {\n colGroup.insertBefore(cellGroup, colGroup.firstChild);\n (colGroup.firstChild as Group).row = (colGroup.firstChild as Group).row + 1;\n // if (\n // isNumber((colGroup.firstChild as Group).mergeStartRow) &&\n // isNumber((colGroup.firstChild as Group).mergeEndRow)\n // ) {\n // (colGroup.firstChild as Group).mergeStartRow = (colGroup.firstChild as Group).mergeStartRow + 1;\n // (colGroup.firstChild as Group).mergeEndRow = (colGroup.firstChild as Group).mergeEndRow + 1;\n // }\n } else if (colGroup.lastChild && row > (colGroup.lastChild as Group).row) {\n colGroup.appendChild(cellGroup);\n } else {\n // let cellBefore: Group;\n // colGroup.forEachChildren((cellGroup: Group) => {\n // if (cellGroup.row === row) {\n // cellBefore = cellGroup;\n // return true;\n // }\n // return false;\n // });\n\n const cellBefore = scene.highPerformanceGetCell(col, row, true);\n if (cellBefore !== cellGroup) {\n colGroup.insertBefore(cellGroup, cellBefore);\n cellBefore && (cellBefore.row = cellBefore.row + 1);\n // if (isNumber(cellBefore.mergeStartRow) && isNumber(cellBefore.mergeEndRow)) {\n // cellBefore.mergeStartRow = cellBefore.mergeStartRow + 1;\n // cellBefore.mergeEndRow = cellBefore.mergeEndRow + 1;\n // }\n if (cellBefore !== colGroup.lastChild) {\n colGroup.lastChild && ((colGroup.lastChild as Group).row = (colGroup.lastChild as Group).row + 1);\n // if (\n // isNumber((colGroup.lastChild as Group).mergeStartRow) &&\n // isNumber((colGroup.lastChild as Group).mergeEndRow)\n // ) {\n // (colGroup.lastChild as Group).mergeStartRow = (colGroup.lastChild as Group).mergeStartRow + 1;\n // (colGroup.lastChild as Group).mergeEndRow = (colGroup.lastChild as Group).mergeEndRow + 1;\n // }\n }\n }\n }\n\n // // reset row number\n // let rowIndex = (colGroup.firstChild as Group)?.row;\n // colGroup.forEachChildren((cellGroup: Group) => {\n // cellGroup.row = rowIndex;\n // rowIndex++;\n // });\n }\n}\n\nfunction removeCellGroup(row: number, scene: Scenegraph) {\n for (let col = 0; col < scene.table.colCount; col++) {\n // const headerColGroup = scene.getColGroup(col, true);\n const colGroup = scene.getColGroup(col, false);\n if (!colGroup) {\n continue;\n }\n // // remove cellGroup in headerColGroup\n // let headerCellGroup;\n // headerColGroup.forEachChildren((cellGroup: Group) => {\n // if (cellGroup.row === row) {\n // headerCellGroup = cellGroup;\n // return true;\n // }\n // return false;\n // });\n // if (headerCellGroup) {\n // headerColGroup.removeChild(headerCellGroup);\n // }\n\n // remove cellGroup in colGroup\n let cellGroup;\n colGroup.forEachChildren((cell: Group) => {\n if (cell.row === row) {\n cellGroup = cell;\n return true;\n }\n return false;\n });\n if (cellGroup) {\n colGroup.updateColumnHeight(-(cellGroup as Group).attribute.height);\n colGroup.removeChild(cellGroup);\n }\n }\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/scenegraph/layout/update-row.ts"],"names":[],"mappings":";;;AAAA,6CAA4C;AAG5C,4CAAyC;AACzC,8DAA0D;AAE1D,4DAA2D;AAK3D,SAAgB,SAAS,CACvB,WAA0B,EAC1B,QAAuB,EACvB,WAA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AS;SACV;QAeD,IAAI,SAAS,CAAC;QACd,QAAQ,CAAC,eAAe,CAAC,CAAC,IAAW,EAAE,EAAE;YACvC,IAAI,IAAI,CAAC,GAAG,KAAK,GAAG,EAAE;gBACpB,SAAS,GAAG,IAAI,CAAC;gBACjB,OAAO,IAAI,CAAC;aACb;YACD,OAAO,KAAK,CAAC;QACf,CAAC,CAAC,CAAC;QACH,IAAI,SAAS,EAAE;YACb,QAAQ,CAAC,kBAAkB,CAAC,CAAE,SAAmB,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;YACpE,QAAQ,CAAC,WAAW,CAAC,SAAS,CAAC,CAAC;SACjC;KACF;AACH,CAAC","file":"update-row.js","sourcesContent":["import { isNumber } from '@visactor/vutils';\nimport type { CellAddress } from '../../ts-types';\nimport type { BaseTableAPI } from '../../ts-types/base-table';\nimport { Group } from '../graphic/group';\nimport { updateCell } from '../group-creater/cell-helper';\nimport type { Scenegraph } from '../scenegraph';\nimport { getCellMergeInfo } from '../utils/get-cell-merge';\n\n/**\n * add and remove rows in scenegraph\n */\nexport function updateRow(\n removeCells: CellAddress[],\n addCells: CellAddress[],\n updateCells: CellAddress[],\n table: BaseTableAPI\n) {\n const scene = table.scenegraph;\n // deduplication\n const removeRows = deduplication(removeCells.map(cell => cell.row)).sort((a, b) => b - a);\n const addRows = deduplication(addCells.map(cell => cell.row)).sort((a, b) => a - b);\n const updateRows = deduplication(updateCells.map(cell => cell.row)).sort((a, b) => a - b);\n\n // remove cells\n removeRows.forEach(row => {\n removeRow(row, scene);\n });\n\n const rowHeightsMap = table.rowHeightsMap;\n removeRows.forEach(row => {\n rowHeightsMap.delAndReorder(row);\n });\n\n if (removeRows.length) {\n resetRowNumber(scene);\n }\n\n scene.table._clearRowRangeHeightsMap();\n\n // add cells\n let updateAfter: number;\n addRows.forEach(row => {\n const needUpdateAfter = addRow(row, scene);\n updateAfter = updateAfter ?? needUpdateAfter;\n rowHeightsMap.addAndReorder(row);\n });\n\n // reset attribute y and row number in CellGroup\n // const newTotalHeight = resetRowNumberAndY(scene);\n resetRowNumberAndY(scene);\n\n for (let col = 0; col < table.colCount; col++) {\n // add cells\n updateRows.forEach(r => {\n // updateRowAttr(row, scene);\n const mergeInfo = getCellMergeInfo(scene.table, col, r);\n if (mergeInfo) {\n for (let col = mergeInfo.start.col; col <= mergeInfo.end.col; col++) {\n for (let row = mergeInfo.start.row; row <= mergeInfo.end.row; row++) {\n updateCell(col, row, scene.table, false);\n }\n }\n } else {\n updateCell(col, r, scene.table, false);\n }\n });\n }\n if (isNumber(updateAfter)) {\n for (let col = 0; col < table.colCount; col++) {\n for (let row = updateAfter; row < table.rowCount; row++) {\n const cellGroup = scene.highPerformanceGetCell(col, row, true);\n cellGroup && (cellGroup.needUpdate = true);\n }\n }\n scene.proxy.rowUpdatePos = updateAfter;\n }\n\n if (addRows.length) {\n if (!isNumber(updateAfter)) {\n const minRow = Math.min(...addRows);\n scene.proxy.rowUpdatePos = Math.min(minRow, scene.proxy.rowUpdatePos);\n }\n scene.proxy.rowUpdateDirection = 'up';\n scene.proxy.updateCellGroups(scene.proxy.screenRowCount * 2);\n updateBottomFrozeCellGroups();\n scene.proxy.progress();\n } else if (removeRows.length) {\n scene.proxy.updateCellGroups(scene.proxy.screenRowCount * 2);\n\n updateBottomFrozeCellGroups();\n scene.proxy.progress();\n }\n\n // update table size\n const newTotalHeight = table.getRowsHeight(table.frozenRowCount, table.rowCount - 1 - table.bottomFrozenRowCount);\n scene.updateContainerHeight(scene.table.frozenRowCount, newTotalHeight - scene.bodyGroup.attribute.height);\n\n function updateBottomFrozeCellGroups() {\n if (\n addRows?.[addRows?.length - 1] >= table.rowCount - table.bottomFrozenRowCount ||\n updateRows?.[updateRows?.length - 1] >= table.rowCount - table.bottomFrozenRowCount ||\n removeRows?.[0] >= table.rowCount - table.bottomFrozenRowCount\n ) {\n for (let col = 0; col < table.colCount; col++) {\n for (let row = table.rowCount - table.bottomFrozenRowCount; row < table.rowCount; row++) {\n const cellGroup = scene.highPerformanceGetCell(col, row, true);\n cellGroup && (cellGroup.needUpdate = true);\n }\n }\n scene.proxy.updateBottomFrozenCellGroups();\n }\n }\n}\nfunction removeRow(row: number, scene: Scenegraph) {\n removeCellGroup(row, scene);\n const proxy = scene.proxy;\n\n // TODO 需要整体更新proxy的状态\n if (row >= proxy.rowStart && row <= proxy.rowEnd) {\n proxy.rowEnd--;\n proxy.currentRow--;\n }\n proxy.bodyBottomRow--;\n // proxy.totalRow--;\n const totalActualBodyRowCount = Math.min(proxy.rowLimit, proxy.bodyBottomRow - proxy.bodyTopRow + 1); // 渐进加载总row数量\n proxy.totalActualBodyRowCount = totalActualBodyRowCount;\n proxy.totalRow = proxy.rowStart + totalActualBodyRowCount - 1; // 目标渐进完成的row\n}\n\nfunction addRow(row: number, scene: Scenegraph) {\n const proxy = scene.proxy;\n proxy.bodyBottomRow++;\n // proxy.totalRow++;\n const totalActualBodyRowCount = Math.min(proxy.rowLimit, proxy.bodyBottomRow - proxy.bodyTopRow + 1); // 渐进加载总row数量\n proxy.totalActualBodyRowCount = totalActualBodyRowCount;\n proxy.totalRow = proxy.rowStart + totalActualBodyRowCount - 1; // 目标渐进完成的row\n\n if (row < proxy.rowStart) {\n return undefined;\n } else if (row > proxy.rowEnd) {\n if (proxy.rowEnd - proxy.rowStart + 1 < proxy.rowLimit) {\n // can add row\n proxy.rowEnd++;\n proxy.currentRow++;\n\n addRowCellGroup(row, scene);\n return row;\n }\n return undefined;\n }\n if (proxy.rowEnd - proxy.rowStart + 1 < proxy.rowLimit) {\n // can add row\n proxy.rowEnd++;\n proxy.currentRow++;\n\n addRowCellGroup(row, scene);\n return row;\n }\n // update rows after\n return row;\n\n // return undefined;\n\n // // TODO 需要整体更新proxy的状态\n // scene.proxy.bodyBottomRow++;\n // scene.proxy.totalRow++;\n // scene.proxy.rowEnd++;\n // scene.proxy.currentRow++;\n}\n\n// array deduplication\nfunction deduplication(array: number[]) {\n const result = [];\n for (let i = 0; i < array.length; i++) {\n if (result.indexOf(array[i]) === -1) {\n result.push(array[i]);\n }\n }\n return result;\n}\n\n// function resetRowNumber(scene: Scenegraph) {\n// for (let col = 0; col < scene.table.colCount; col++) {\n// const headerColGroup = scene.getColGroup(col, true);\n// const colGroup = scene.getColGroup(col, false);\n// if (!headerColGroup && !colGroup) {\n// continue;\n// }\n// // reset row number\n// let rowIndex = 0; //(headerColGroup.firstChild as Group)?.row;\n// headerColGroup?.forEachChildren((cellGroup: Group) => {\n// // const oldRow = cellGroup.row;\n// // if (isNumber(cellGroup.mergeStartRow)) {\n// // cellGroup.mergeStartRow = cellGroup.mergeStartRow - oldRow + rowIndex;\n// // }\n// // if (isNumber(cellGroup.mergeEndRow)) {\n// // cellGroup.mergeEndRow = cellGroup.mergeEndRow - oldRow + rowIndex;\n// // }\n// cellGroup.row = rowIndex;\n// const merge = getCellMergeInfo(scene.table, cellGroup.col, cellGroup.row);\n// if (merge) {\n// cellGroup.mergeStartCol = merge.start.col;\n// cellGroup.mergeStartRow = merge.start.row;\n// cellGroup.mergeEndCol = merge.end.col;\n// cellGroup.mergeEndRow = merge.end.row;\n// }\n// rowIndex++;\n// });\n// // rowIndex = (colGroup.firstChild as Group)?.row;\n// // rowIndex = scene.table.columnHeaderLevelCount;\n// rowIndex = scene.bodyRowStart;\n// colGroup?.forEachChildren((cellGroup: Group) => {\n// // const oldRow = cellGroup.row;\n// // if (isNumber(cellGroup.mergeStartRow)) {\n// // cellGroup.mergeStartRow = cellGroup.mergeStartRow - oldRow + rowIndex;\n// // }\n// // if (isNumber(cellGroup.mergeEndRow)) {\n// // cellGroup.mergeEndRow = cellGroup.mergeEndRow - oldRow + rowIndex;\n// // }\n// cellGroup.row = rowIndex;\n// const merge = getCellMergeInfo(scene.table, cellGroup.col, cellGroup.row);\n// if (merge) {\n// cellGroup.mergeStartCol = merge.start.col;\n// cellGroup.mergeStartRow = merge.start.row;\n// cellGroup.mergeEndCol = merge.end.col;\n// cellGroup.mergeEndRow = merge.end.row;\n// }\n// rowIndex++;\n// });\n// }\n// }\n\n// function resetRowNumberAndY(scene: Scenegraph) {\n// const table = scene.table;\n// let newTotalHeight = 0;\n// for (let col = 0; col < scene.table.colCount; col++) {\n// const headerColGroup = scene.getColGroup(col, true);\n// const colGroup = scene.getColGroup(col, false); // body, row header, right frozen\n// const bottomGroup =\n// scene.getColGroupInBottom(col) ||\n// scene.getColGroupInLeftBottomCorner(col) ||\n// scene.getColGroupInRightTopCorner(col);\n// if (!headerColGroup && !colGroup && !bottomGroup) {\n// continue;\n// }\n// let y = 0;\n// // reset row number\n// // let rowIndex = (headerColGroup.firstChild as Group)?.row;\n// // headerColGroup.forEachChildren((cellGroup: Group) => {\n// // cellGroup.row = rowIndex;\n// // rowIndex++;\n// // if (cellGroup.role !== 'cell') {\n// // return;\n// // }\n// // cellGroup.setAttribute('y', y);\n// // y+= cellGroup.attribute.height;\n// // });\n// // let rowIndex = (colGroup.firstChild as Group)?.row;\n// let rowIndex = scene.bodyRowStart;\n// y = scene.getCellGroupY(rowIndex);\n// colGroup?.forEachChildren((cellGroup: Group) => {\n// // const oldRow = cellGroup.row;\n// // if (isNumber(cellGroup.mergeStartRow)) {\n// // cellGroup.mergeStartRow = cellGroup.mergeStartRow - oldRow + rowIndex;\n// // }\n// // if (isNumber(cellGroup.mergeEndRow)) {\n// // cellGroup.mergeEndRow = cellGroup.mergeEndRow - oldRow + rowIndex;\n// // }\n// cellGroup.row = rowIndex;\n// const merge = getCellMergeInfo(scene.table, cellGroup.col, cellGroup.row);\n// if (merge) {\n// cellGroup.mergeStartCol = merge.start.col;\n// cellGroup.mergeStartRow = merge.start.row;\n// cellGroup.mergeEndCol = merge.end.col;\n// cellGroup.mergeEndRow = merge.end.row;\n// }\n// rowIndex++;\n// if (cellGroup.role !== 'cell') {\n// return;\n// }\n// cellGroup.setAttribute('y', y);\n// y += cellGroup.attribute.height;\n// });\n// newTotalHeight = y;\n\n// rowIndex = scene.table.rowCount - scene.table.bottomFrozenRowCount;\n// // update bottom frozen cell row index\n// bottomGroup?.forEachChildren((cellGroup: Group) => {\n// cellGroup.row = rowIndex;\n// const merge = getCellMergeInfo(scene.table, cellGroup.col, cellGroup.row);\n// if (merge) {\n// cellGroup.mergeStartCol = merge.start.col;\n// cellGroup.mergeStartRow = merge.start.row;\n// cellGroup.mergeEndCol = merge.end.col;\n// cellGroup.mergeEndRow = merge.end.row;\n// }\n// rowIndex++;\n// });\n// }\n// return newTotalHeight;\n// }\nfunction resetRowNumber(scene: Scenegraph) {\n scene.bodyGroup.forEachChildren((colGroup: Group) => {\n let rowIndex = scene.bodyRowStart;\n colGroup?.forEachChildren((cellGroup: Group) => {\n processCell(cellGroup, rowIndex);\n rowIndex++;\n });\n });\n\n scene.rowHeaderGroup.forEachChildren((colGroup: Group) => {\n let rowIndex = scene.bodyRowStart;\n colGroup?.forEachChildren((cellGroup: Group) => {\n processCell(cellGroup, rowIndex);\n rowIndex++;\n });\n });\n\n scene.rightFrozenGroup.forEachChildren((colGroup: Group) => {\n let rowIndex = scene.bodyRowStart;\n colGroup?.forEachChildren((cellGroup: Group) => {\n processCell(cellGroup, rowIndex);\n rowIndex++;\n });\n });\n scene.bottomFrozenGroup.forEachChildren((colGroup: Group) => {\n let rowIndex = scene.table.rowCount - scene.table.bottomFrozenRowCount;\n colGroup?.forEachChildren((cellGroup: Group) => {\n processCell(cellGroup, rowIndex);\n rowIndex++;\n });\n });\n scene.leftBottomCornerGroup.forEachChildren((colGroup: Group) => {\n let rowIndex = scene.table.rowCount - scene.table.bottomFrozenRowCount;\n colGroup?.forEachChildren((cellGroup: Group) => {\n processCell(cellGroup, rowIndex);\n rowIndex++;\n });\n });\n scene.rightBottomCornerGroup.forEachChildren((colGroup: Group) => {\n let rowIndex = scene.table.rowCount - scene.table.bottomFrozenRowCount;\n colGroup?.forEachChildren((cellGroup: Group) => {\n processCell(cellGroup, rowIndex);\n rowIndex++;\n });\n });\n function processCell(cellGroup: Group, rowIndex: number) {\n cellGroup.row = rowIndex;\n const merge = getCellMergeInfo(scene.table, cellGroup.col, cellGroup.row);\n if (merge) {\n cellGroup.mergeStartCol = merge.start.col;\n cellGroup.mergeStartCol = merge.start.col;\n cellGroup.mergeEndCol = merge.end.col;\n cellGroup.mergeEndCol = merge.end.col;\n }\n }\n}\n\nfunction resetRowNumberAndY(scene: Scenegraph) {\n scene.bodyGroup.forEachChildren((colGroup: Group) => {\n let rowIndex = scene.bodyRowStart;\n // let y = (colGroup.firstChild as IGraphic).attribute.y;\n let y = scene.getCellGroupY(rowIndex);\n colGroup?.forEachChildren((cellGroup: Group) => {\n processCell(cellGroup, rowIndex, y);\n rowIndex++;\n y += cellGroup.attribute.height;\n });\n });\n\n scene.rowHeaderGroup.forEachChildren((colGroup: Group) => {\n let rowIndex = scene.bodyRowStart;\n // let y = (colGroup.firstChild as IGraphic).attribute.y;\n let y = scene.getCellGroupY(rowIndex);\n colGroup?.forEachChildren((cellGroup: Group) => {\n processCell(cellGroup, rowIndex, y);\n rowIndex++;\n y += cellGroup.attribute.height;\n });\n });\n\n scene.rightFrozenGroup.forEachChildren((colGroup: Group) => {\n let rowIndex = scene.bodyRowStart;\n // let y = (colGroup.firstChild as IGraphic).attribute.y;\n let y = scene.getCellGroupY(rowIndex);\n colGroup?.forEachChildren((cellGroup: Group) => {\n processCell(cellGroup, rowIndex, y);\n rowIndex++;\n y += cellGroup.attribute.height;\n });\n });\n scene.bottomFrozenGroup.forEachChildren((colGroup: Group) => {\n let rowIndex = scene.table.rowCount - scene.table.bottomFrozenRowCount;\n let y = 0;\n colGroup?.forEachChildren((cellGroup: Group) => {\n processCell(cellGroup, rowIndex, y);\n rowIndex++;\n y += cellGroup.attribute.height;\n });\n });\n scene.leftBottomCornerGroup.forEachChildren((colGroup: Group) => {\n let rowIndex = scene.table.rowCount - scene.table.bottomFrozenRowCount;\n let y = 0;\n colGroup?.forEachChildren((cellGroup: Group) => {\n processCell(cellGroup, rowIndex, y);\n rowIndex++;\n y += cellGroup.attribute.height;\n });\n });\n scene.rightBottomCornerGroup.forEachChildren((colGroup: Group) => {\n let rowIndex = scene.table.rowCount - scene.table.bottomFrozenRowCount;\n let y = 0;\n colGroup?.forEachChildren((cellGroup: Group) => {\n processCell(cellGroup, rowIndex, y);\n rowIndex++;\n y += cellGroup.attribute.height;\n });\n });\n function processCell(cellGroup: Group, rowIndex: number, y: number) {\n cellGroup.row = rowIndex;\n cellGroup.setAttribute('y', y);\n const merge = getCellMergeInfo(scene.table, cellGroup.col, cellGroup.row);\n if (merge) {\n cellGroup.mergeStartCol = merge.start.col;\n cellGroup.mergeStartCol = merge.start.col;\n cellGroup.mergeEndCol = merge.end.col;\n cellGroup.mergeEndCol = merge.end.col;\n }\n }\n}\nfunction addRowCellGroup(row: number, scene: Scenegraph) {\n for (let col = 0; col < scene.table.colCount; col++) {\n // create cellGroup\n // const cellGroup = updateCell(col, row, scene.table, true);\n const cellGroup = new Group({\n x: 0,\n y: 0,\n width: scene.table.getColWidth(col),\n height: scene.table.getRowHeight(row)\n });\n cellGroup.role = 'cell';\n cellGroup.col = col;\n cellGroup.row = row;\n cellGroup.needUpdate = true;\n\n if (!cellGroup) {\n // TODO: deal with data promise situation\n continue;\n }\n\n // insert cellGroup in colGroup\n const colGroup = scene.getColGroup(col);\n if (!colGroup) {\n continue;\n }\n\n if (colGroup.firstChild && row < (colGroup.firstChild as Group).row) {\n colGroup.insertBefore(cellGroup, colGroup.firstChild);\n (colGroup.firstChild as Group).row = (colGroup.firstChild as Group).row + 1;\n // if (\n // isNumber((colGroup.firstChild as Group).mergeStartRow) &&\n // isNumber((colGroup.firstChild as Group).mergeEndRow)\n // ) {\n // (colGroup.firstChild as Group).mergeStartRow = (colGroup.firstChild as Group).mergeStartRow + 1;\n // (colGroup.firstChild as Group).mergeEndRow = (colGroup.firstChild as Group).mergeEndRow + 1;\n // }\n } else if (colGroup.lastChild && row > (colGroup.lastChild as Group).row) {\n colGroup.appendChild(cellGroup);\n } else {\n // let cellBefore: Group;\n // colGroup.forEachChildren((cellGroup: Group) => {\n // if (cellGroup.row === row) {\n // cellBefore = cellGroup;\n // return true;\n // }\n // return false;\n // });\n\n const cellBefore = scene.highPerformanceGetCell(col, row, true);\n if (cellBefore !== cellGroup) {\n colGroup.insertBefore(cellGroup, cellBefore);\n cellBefore && (cellBefore.row = cellBefore.row + 1);\n // if (isNumber(cellBefore.mergeStartRow) && isNumber(cellBefore.mergeEndRow)) {\n // cellBefore.mergeStartRow = cellBefore.mergeStartRow + 1;\n // cellBefore.mergeEndRow = cellBefore.mergeEndRow + 1;\n // }\n if (cellBefore !== colGroup.lastChild) {\n colGroup.lastChild && ((colGroup.lastChild as Group).row = (colGroup.lastChild as Group).row + 1);\n // if (\n // isNumber((colGroup.lastChild as Group).mergeStartRow) &&\n // isNumber((colGroup.lastChild as Group).mergeEndRow)\n // ) {\n // (colGroup.lastChild as Group).mergeStartRow = (colGroup.lastChild as Group).mergeStartRow + 1;\n // (colGroup.lastChild as Group).mergeEndRow = (colGroup.lastChild as Group).mergeEndRow + 1;\n // }\n }\n }\n }\n\n // // reset row number\n // let rowIndex = (colGroup.firstChild as Group)?.row;\n // colGroup.forEachChildren((cellGroup: Group) => {\n // cellGroup.row = rowIndex;\n // rowIndex++;\n // });\n }\n}\n\nfunction removeCellGroup(row: number, scene: Scenegraph) {\n for (let col = 0; col < scene.table.colCount; col++) {\n // const headerColGroup = scene.getColGroup(col, true);\n const colGroup = scene.getColGroup(col, false);\n if (!colGroup) {\n continue;\n }\n // // remove cellGroup in headerColGroup\n // let headerCellGroup;\n // headerColGroup.forEachChildren((cellGroup: Group) => {\n // if (cellGroup.row === row) {\n // headerCellGroup = cellGroup;\n // return true;\n // }\n // return false;\n // });\n // if (headerCellGroup) {\n // headerColGroup.removeChild(headerCellGroup);\n // }\n\n // remove cellGroup in colGroup\n let cellGroup;\n colGroup.forEachChildren((cell: Group) => {\n if (cell.row === row) {\n cellGroup = cell;\n return true;\n }\n return false;\n });\n if (cellGroup) {\n colGroup.updateColumnHeight(-(cellGroup as Group).attribute.height);\n colGroup.removeChild(cellGroup);\n }\n }\n}\n"]}
|
|
@@ -81,6 +81,8 @@ export declare class Scenegraph {
|
|
|
81
81
|
updateFrozenIcon(col: number, oldFrozenCol: number): void;
|
|
82
82
|
updateHierarchyIcon(col: number, row: number): void;
|
|
83
83
|
setIconNormalStyle(icon: Icon, col: number, row: number): void;
|
|
84
|
+
residentHoverIcon(col: number, row: number): void;
|
|
85
|
+
resetResidentHoverIcon(col: number, row: number): void;
|
|
84
86
|
deactivateChart(col: number, row: number): void;
|
|
85
87
|
activateChart(col: number, row: number): void;
|
|
86
88
|
removeInteractionBorder(col: number, row: number): void;
|
|
@@ -15,39 +15,11 @@ const vrender_1 = require("@visactor/vrender"), vutils_1 = require("@visactor/vu
|
|
|
15
15
|
(0, vrender_components_1.loadPoptip)(), vrender_1.container.load(contributions_1.default),
|
|
16
16
|
vrender_1.container.load(text_measure_1.default);
|
|
17
17
|
|
|
18
|
-
const poptipStyle = {
|
|
19
|
-
visible: !0,
|
|
20
|
-
position: "auto",
|
|
21
|
-
padding: 8,
|
|
22
|
-
titleStyle: {
|
|
23
|
-
fontSize: 12,
|
|
24
|
-
fontWeight: "bold",
|
|
25
|
-
fill: "#4E5969"
|
|
26
|
-
},
|
|
27
|
-
contentStyle: {
|
|
28
|
-
fontSize: 12,
|
|
29
|
-
fill: "#4E5969"
|
|
30
|
-
},
|
|
31
|
-
panel: {
|
|
32
|
-
visible: !0,
|
|
33
|
-
fill: "#fff",
|
|
34
|
-
stroke: "#ffffff",
|
|
35
|
-
lineWidth: 0,
|
|
36
|
-
cornerRadius: 3,
|
|
37
|
-
shadowBlur: 12,
|
|
38
|
-
shadowOffsetX: 0,
|
|
39
|
-
shadowOffsetY: 4,
|
|
40
|
-
shadowColor: "rgba(0, 0, 0, 0.1)",
|
|
41
|
-
size: 0,
|
|
42
|
-
space: 12
|
|
43
|
-
}
|
|
44
|
-
};
|
|
45
|
-
|
|
46
18
|
class Scenegraph {
|
|
47
19
|
constructor(table) {
|
|
48
20
|
let width, height;
|
|
49
21
|
this.table = table, this.hasFrozen = !1, this.clear = !0, this.mergeMap = new Map,
|
|
50
|
-
(0, vrender_components_1.setPoptipTheme)(
|
|
22
|
+
(0, vrender_components_1.setPoptipTheme)(this.table.theme.textPopTipStyle), "node" === env_1.Env.mode ? (vrender_1.vglobal.setEnv("node", table.options.modeParams),
|
|
51
23
|
width = table.canvasWidth, height = table.canvasHeight) : (vrender_1.vglobal.setEnv("browser"),
|
|
52
24
|
width = table.canvas.width, height = table.canvas.height), this.stage = (0, vrender_1.createStage)({
|
|
53
25
|
canvas: table.canvas,
|
|
@@ -57,7 +29,6 @@ class Scenegraph {
|
|
|
57
29
|
background: table.theme.underlayBackgroundColor,
|
|
58
30
|
dpr: table.internalProps.pixelRatio,
|
|
59
31
|
enableLayout: !0,
|
|
60
|
-
pluginList: table.isPivotChart() ? [ "poptipForText" ] : void 0,
|
|
61
32
|
afterRender: () => {
|
|
62
33
|
this.table.fireListeners("after_render", null);
|
|
63
34
|
}
|
|
@@ -111,7 +82,9 @@ class Scenegraph {
|
|
|
111
82
|
}
|
|
112
83
|
clearCells() {
|
|
113
84
|
var _a;
|
|
114
|
-
this.
|
|
85
|
+
(this.table.isPivotChart() || this.table.hasCustomRenderOrLayout()) && this.stage.pluginService.findPluginsByName("poptipForText").forEach((plugin => {
|
|
86
|
+
plugin.deactivate(this.stage.pluginService);
|
|
87
|
+
})), this.clear = !0, this.hasFrozen = !1, this.mergeMap.clear(), this.colHeaderGroup.clear(),
|
|
115
88
|
this.rowHeaderGroup.clear(), this.cornerHeaderGroup.clear(), this.bodyGroup.clear(),
|
|
116
89
|
this.bottomFrozenGroup.clear(), this.rightFrozenGroup.clear(), this.rightTopCornerGroup.clear(),
|
|
117
90
|
this.rightBottomCornerGroup.clear(), this.leftBottomCornerGroup.clear(), this.colHeaderGroup.setAttributes({
|
|
@@ -178,7 +151,9 @@ class Scenegraph {
|
|
|
178
151
|
this.selectedRangeComponents = new Map, this.selectingRangeComponents = new Map;
|
|
179
152
|
}
|
|
180
153
|
createSceneGraph() {
|
|
181
|
-
this.
|
|
154
|
+
(this.table.isPivotChart() || this.table.hasCustomRenderOrLayout()) && this.stage.pluginService.autoEnablePlugins.getContributions().forEach((p => {
|
|
155
|
+
"poptipForText" === p.name && this.stage.pluginService.register(p);
|
|
156
|
+
})), this.clear = !1, this.frozenColCount = this.table.frozenColCount, this.frozenRowCount = this.table.columnHeaderLevelCount,
|
|
182
157
|
this.proxy = new proxy_1.SceneProxy(this.table), (0, frame_border_1.createFrameBorder)(this.tableGroup, this.table.theme.frameStyle, this.tableGroup.role, void 0, !0),
|
|
183
158
|
this.table.isPivotChart() && ((0, corner_cell_1.createCornerCell)(this.rightTopCornerGroup, this.table.theme.cornerRightTopCellStyle || this.table.theme.cornerHeaderStyle || {}),
|
|
184
159
|
(0, corner_cell_1.createCornerCell)(this.leftBottomCornerGroup, this.table.theme.cornerLeftBottomCellStyle || this.table.theme.cornerHeaderStyle || {}),
|
|
@@ -204,7 +179,7 @@ class Scenegraph {
|
|
|
204
179
|
}
|
|
205
180
|
getColGroup(col, isCornerOrColHeader = !1) {
|
|
206
181
|
let element;
|
|
207
|
-
return element = col < this.frozenColCount && isCornerOrColHeader ? this.cornerHeaderGroup.getColGroup(col) : col < this.frozenColCount ? this.rowHeaderGroup.getColGroup(col) : isCornerOrColHeader ? this.
|
|
182
|
+
return element = col < this.frozenColCount && isCornerOrColHeader ? this.cornerHeaderGroup.getColGroup(col) : col < this.frozenColCount ? this.rowHeaderGroup.getColGroup(col) : isCornerOrColHeader && this.table.rightFrozenColCount > 0 && col > this.table.colCount - 1 - this.table.rightFrozenColCount ? this.rightTopCornerGroup.getColGroup(col) : !isCornerOrColHeader && this.table.rightFrozenColCount > 0 && col > this.table.colCount - 1 - this.table.rightFrozenColCount ? this.rightFrozenGroup.getColGroup(col) : isCornerOrColHeader ? this.colHeaderGroup.getColGroup(col) : this.bodyGroup.getColGroup(col),
|
|
208
183
|
element || void 0;
|
|
209
184
|
}
|
|
210
185
|
getColGroupInBottom(col) {
|
|
@@ -266,6 +241,12 @@ class Scenegraph {
|
|
|
266
241
|
setIconNormalStyle(icon, col, row) {
|
|
267
242
|
(0, icon_update_1.setIconNormalStyle)(icon, col, row, this);
|
|
268
243
|
}
|
|
244
|
+
residentHoverIcon(col, row) {
|
|
245
|
+
(0, icon_update_1.residentHoverIcon)(col, row, this);
|
|
246
|
+
}
|
|
247
|
+
resetResidentHoverIcon(col, row) {
|
|
248
|
+
(0, icon_update_1.resetResidentHoverIcon)(col, row, this);
|
|
249
|
+
}
|
|
269
250
|
deactivateChart(col, row) {
|
|
270
251
|
var _a, _b;
|
|
271
252
|
if (-1 === col || -1 === row) return;
|
|
@@ -418,10 +399,10 @@ class Scenegraph {
|
|
|
418
399
|
}
|
|
419
400
|
updateContainerHeight(row, detaY) {
|
|
420
401
|
row < this.table.frozenRowCount ? (this.colHeaderGroup.setDeltaHeight(detaY), this.cornerHeaderGroup.setDeltaHeight(detaY),
|
|
421
|
-
this.rowHeaderGroup.setDeltaY(detaY), this.bodyGroup.setDeltaY(detaY)) : row >= this.table.rowCount - this.table.bottomFrozenRowCount ? (this.leftBottomCornerGroup.setDeltaHeight(detaY),
|
|
402
|
+
this.rowHeaderGroup.setDeltaY(detaY), this.bodyGroup.setDeltaY(detaY), this.rightFrozenGroup.setDeltaY(detaY)) : row >= this.table.rowCount - this.table.bottomFrozenRowCount ? (this.leftBottomCornerGroup.setDeltaHeight(detaY),
|
|
422
403
|
this.bottomFrozenGroup.setDeltaHeight(detaY), this.rightBottomCornerGroup.setDeltaHeight(detaY)) : (this.rowHeaderGroup.setDeltaHeight(detaY),
|
|
423
|
-
this.bodyGroup.setDeltaHeight(detaY)
|
|
424
|
-
this.updateNextFrame();
|
|
404
|
+
this.bodyGroup.setDeltaHeight(detaY), this.rightFrozenGroup.setDeltaHeight(detaY)),
|
|
405
|
+
this.updateTableSize(), this.component.updateScrollBar(), this.updateNextFrame();
|
|
425
406
|
}
|
|
426
407
|
setColWidth(col, width) {
|
|
427
408
|
const oldWidth = this.table.getColWidth(col);
|
|
@@ -457,30 +438,27 @@ class Scenegraph {
|
|
|
457
438
|
dealWidthMode() {
|
|
458
439
|
const table = this.table;
|
|
459
440
|
if ("adaptive" === table.widthMode) {
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
colWidth = col === table.colCount - table.rightFrozenColCount - 1 ? totalDrawWidth - table.getColsWidth(table.frozenColCount, table.colCount - table.rightFrozenColCount - 2) : Math.round(table.getColWidth(col) * factor),
|
|
467
|
-
this.setColWidth(col, colWidth);
|
|
441
|
+
table._clearColRangeWidthsMap();
|
|
442
|
+
const canvasWidth = table.tableNoFrameWidth;
|
|
443
|
+
let actualHeaderWidth = 0;
|
|
444
|
+
for (let col = 0; col < table.colCount; col++) {
|
|
445
|
+
const colWidth = table.getColWidth(col);
|
|
446
|
+
(col < table.frozenColCount || col >= table.colCount - table.rightFrozenColCount) && (actualHeaderWidth += colWidth);
|
|
468
447
|
}
|
|
448
|
+
const startCol = table.frozenColCount, endCol = table.isPivotChart() ? table.colCount - table.rightFrozenColCount : table.colCount;
|
|
449
|
+
(0, compute_col_width_1.getAdaptiveWidth)(canvasWidth - actualHeaderWidth, startCol, endCol, !1, [], table, !0);
|
|
469
450
|
} else if (table.autoFillWidth) {
|
|
451
|
+
table._clearColRangeWidthsMap();
|
|
470
452
|
const canvasWidth = table.tableNoFrameWidth;
|
|
471
|
-
let
|
|
453
|
+
let actualHeaderWidth = 0, actualWidth = 0;
|
|
472
454
|
for (let col = 0; col < table.colCount; col++) {
|
|
473
455
|
const colWidth = table.getColWidth(col);
|
|
474
|
-
(col < table.frozenColCount || col >= table.colCount - table.rightFrozenColCount) && (actualHeaderWidth += colWidth),
|
|
456
|
+
(col < table.frozenColCount || table.isPivotChart() && col >= table.colCount - table.rightFrozenColCount) && (actualHeaderWidth += colWidth),
|
|
475
457
|
actualWidth += colWidth;
|
|
476
458
|
}
|
|
477
|
-
if (actualWidth < canvasWidth && actualWidth
|
|
478
|
-
const
|
|
479
|
-
|
|
480
|
-
let colWidth;
|
|
481
|
-
colWidth = col === table.colCount - table.rightFrozenColCount - 1 ? canvasWidth - actualHeaderWidth - table.getColsWidth(table.frozenColCount, table.colCount - table.rightFrozenColCount - 2) : Math.round(table.getColWidth(col) * factor),
|
|
482
|
-
this.setColWidth(col, colWidth);
|
|
483
|
-
}
|
|
459
|
+
if (actualWidth < canvasWidth && actualWidth > actualHeaderWidth) {
|
|
460
|
+
const startCol = table.frozenColCount, endCol = table.isPivotChart() ? table.colCount - table.rightFrozenColCount : table.colCount;
|
|
461
|
+
(0, compute_col_width_1.getAdaptiveWidth)(canvasWidth - actualHeaderWidth, startCol, endCol, !1, [], table, !0);
|
|
484
462
|
}
|
|
485
463
|
}
|
|
486
464
|
let bodyWidth = 0;
|
|
@@ -509,21 +487,22 @@ class Scenegraph {
|
|
|
509
487
|
const table = this.table;
|
|
510
488
|
if ("adaptive" === table.heightMode) {
|
|
511
489
|
table._clearRowRangeHeightsMap();
|
|
512
|
-
const totalDrawHeight = table.tableNoFrameHeight - table.
|
|
490
|
+
const columnHeaderHeight = table.getRowsHeight(0, table.columnHeaderLevelCount - 1), bottomHeaderHeight = table.isPivotChart() ? table.getBottomFrozenRowsHeight() : 0, totalDrawHeight = table.tableNoFrameHeight - columnHeaderHeight - bottomHeaderHeight, startRow = table.columnHeaderLevelCount, endRow = table.isPivotChart() ? table.rowCount - table.bottomFrozenRowCount : table.rowCount;
|
|
513
491
|
let actualHeight = 0;
|
|
514
|
-
for (let row =
|
|
492
|
+
for (let row = startRow; row < endRow; row++) actualHeight += table.getRowHeight(row);
|
|
515
493
|
const factor = totalDrawHeight / actualHeight;
|
|
516
|
-
for (let row =
|
|
494
|
+
for (let row = startRow; row < endRow; row++) {
|
|
517
495
|
let rowHeight;
|
|
518
|
-
rowHeight = row ===
|
|
496
|
+
rowHeight = row === endRow - 1 ? totalDrawHeight - table.getRowsHeight(startRow, endRow - 2) : Math.round(table.getRowHeight(row) * factor),
|
|
519
497
|
this.setRowHeight(row, rowHeight);
|
|
520
498
|
}
|
|
521
499
|
} else if (table.autoFillHeight) {
|
|
500
|
+
table._clearRowRangeHeightsMap();
|
|
522
501
|
const canvasHeight = table.tableNoFrameHeight;
|
|
523
502
|
let actualHeight = 0, actualHeaderHeight = 0;
|
|
524
503
|
for (let row = 0; row < table.rowCount; row++) {
|
|
525
504
|
const rowHeight = table.getRowHeight(row);
|
|
526
|
-
(row < table.frozenRowCount || row >= table.rowCount - table.bottomFrozenRowCount) && (actualHeaderHeight += rowHeight),
|
|
505
|
+
(row < table.frozenRowCount || table.isPivotChart() && row >= table.rowCount - table.bottomFrozenRowCount) && (actualHeaderHeight += rowHeight),
|
|
527
506
|
actualHeight += rowHeight;
|
|
528
507
|
}
|
|
529
508
|
if ((null !== (_a = this._dealAutoFillHeightOriginRowsHeight) && void 0 !== _a ? _a : actualHeight) < canvasHeight && actualHeight - actualHeaderHeight > 0) {
|
|
@@ -657,12 +636,17 @@ class Scenegraph {
|
|
|
657
636
|
getCellOverflowText(col, row) {
|
|
658
637
|
var _a, _b;
|
|
659
638
|
const text = this.getCell(col, row).getChildByName("text", !0);
|
|
660
|
-
if (text) {
|
|
639
|
+
if (text && "text" === text.type) {
|
|
661
640
|
const textAttributeStr = (0, vutils_1.isArray)(text.attribute.text) ? text.attribute.text.join("") : text.attribute.text;
|
|
662
641
|
let cacheStr = "";
|
|
663
642
|
if ((0, vutils_1.isString)(text.cache.clipedText) ? cacheStr = text.cache.clipedText : null === (_b = null === (_a = text.cache.layoutData) || void 0 === _a ? void 0 : _a.lines) || void 0 === _b || _b.forEach((line => {
|
|
664
643
|
cacheStr += line.str;
|
|
665
644
|
})), cacheStr !== textAttributeStr) return textAttributeStr;
|
|
645
|
+
} else if (text && "richtext" === text.type) {
|
|
646
|
+
const richtext = text;
|
|
647
|
+
if (richtext.attribute.ellipsis && richtext._frameCache && richtext.attribute.height < richtext._frameCache.actualHeight) {
|
|
648
|
+
return richtext.attribute.textConfig.find((item => item.text)).text;
|
|
649
|
+
}
|
|
666
650
|
}
|
|
667
651
|
return null;
|
|
668
652
|
}
|