@visactor/vtable 0.9.1-alpha.4 → 0.9.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.js +15 -4
- package/cjs/ListTable.js.map +1 -1
- package/cjs/PivotTable.d.ts +2 -1
- package/cjs/PivotTable.js +15 -3
- package/cjs/PivotTable.js.map +1 -1
- package/cjs/body-helper/body-helper.d.ts +1 -0
- package/cjs/body-helper/body-helper.js +6 -3
- package/cjs/body-helper/body-helper.js.map +1 -1
- package/cjs/body-helper/style/ProgressBarStyle.js +14 -8
- package/cjs/body-helper/style/ProgressBarStyle.js.map +1 -1
- package/cjs/body-helper/style/Style.d.ts +3 -0
- package/cjs/body-helper/style/Style.js +21 -14
- package/cjs/body-helper/style/Style.js.map +1 -1
- package/cjs/core/BaseTable.d.ts +4 -1
- package/cjs/core/BaseTable.js +31 -20
- package/cjs/core/BaseTable.js.map +1 -1
- package/cjs/core/tableHelper.js +11 -6
- package/cjs/core/tableHelper.js.map +1 -1
- package/cjs/data/DataSource.d.ts +4 -1
- package/cjs/data/DataSource.js +3 -3
- package/cjs/data/DataSource.js.map +1 -1
- package/cjs/event/event.d.ts +14 -19
- package/cjs/event/event.js +12 -329
- package/cjs/event/event.js.map +1 -1
- package/cjs/event/listener/container-dom.d.ts +2 -0
- package/cjs/event/listener/container-dom.js +42 -0
- package/cjs/event/listener/container-dom.js.map +1 -0
- package/cjs/event/listener/scroll-bar.d.ts +2 -0
- package/cjs/event/listener/scroll-bar.js +44 -0
- package/cjs/event/listener/scroll-bar.js.map +1 -0
- package/cjs/event/listener/table-group.d.ts +2 -0
- package/cjs/event/listener/table-group.js +262 -0
- package/cjs/event/listener/table-group.js.map +1 -0
- package/cjs/event/listener/touch.d.ts +2 -0
- package/cjs/event/listener/touch.js +76 -0
- package/cjs/event/listener/touch.js.map +1 -0
- package/cjs/event/scroll.d.ts +2 -0
- package/cjs/event/scroll.js +32 -4
- package/cjs/event/scroll.js.map +1 -1
- package/cjs/event/util.d.ts +16 -0
- package/cjs/event/util.js +30 -0
- package/cjs/event/util.js.map +1 -0
- package/cjs/header-helper/header-helper.d.ts +5 -6
- package/cjs/header-helper/header-helper.js +19 -22
- package/cjs/header-helper/header-helper.js.map +1 -1
- package/cjs/icons.js +11 -11
- package/cjs/icons.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/index.js +1 -2
- package/cjs/layout/pivot-header-layout.d.ts +4 -1
- package/cjs/layout/pivot-header-layout.js +15 -14
- package/cjs/layout/pivot-header-layout.js.map +1 -1
- package/cjs/layout/simple-header-layout.d.ts +13 -1
- package/cjs/layout/simple-header-layout.js +12 -1
- package/cjs/layout/simple-header-layout.js.map +1 -1
- package/cjs/render/layout/container.js +1 -1
- package/cjs/render/layout/container.js.map +1 -1
- package/cjs/render/layout/element.d.ts +1 -1
- package/cjs/render/layout/element.js.map +1 -1
- package/cjs/render/layout/rect.d.ts +2 -2
- package/cjs/render/layout/rect.js +2 -2
- package/cjs/render/layout/rect.js.map +1 -1
- package/cjs/scenegraph/component/custom.js +18 -7
- package/cjs/scenegraph/component/custom.js.map +1 -1
- package/cjs/scenegraph/component/menu.js +2 -2
- package/cjs/scenegraph/component/menu.js.map +1 -1
- package/cjs/scenegraph/component/table-component.d.ts +3 -3
- package/cjs/scenegraph/component/table-component.js +36 -26
- package/cjs/scenegraph/component/table-component.js.map +1 -1
- package/cjs/scenegraph/graphic/chart.d.ts +1 -0
- package/cjs/scenegraph/graphic/chart.js.map +1 -1
- package/cjs/scenegraph/graphic/contributions/chart-render.js +7 -2
- package/cjs/scenegraph/graphic/contributions/chart-render.js.map +1 -1
- package/cjs/scenegraph/graphic/contributions/group-contribution-render.js.map +1 -1
- package/cjs/scenegraph/graphic/group.d.ts +4 -0
- package/cjs/scenegraph/graphic/group.js +6 -0
- package/cjs/scenegraph/graphic/group.js.map +1 -1
- package/cjs/scenegraph/graphic/text.js +7 -7
- package/cjs/scenegraph/graphic/text.js.map +1 -1
- package/cjs/scenegraph/group-creater/cell-helper.d.ts +3 -4
- package/cjs/scenegraph/group-creater/cell-helper.js +25 -18
- package/cjs/scenegraph/group-creater/cell-helper.js.map +1 -1
- package/cjs/scenegraph/group-creater/cell-type/chart-cell.js +6 -4
- package/cjs/scenegraph/group-creater/cell-type/chart-cell.js.map +1 -1
- package/cjs/scenegraph/group-creater/cell-type/image-cell.js +11 -1
- package/cjs/scenegraph/group-creater/cell-type/image-cell.js.map +1 -1
- package/cjs/scenegraph/group-creater/cell-type/progress-bar-cell.js +12 -9
- package/cjs/scenegraph/group-creater/cell-type/progress-bar-cell.js.map +1 -1
- package/cjs/scenegraph/group-creater/cell-type/text-cell.d.ts +1 -1
- package/cjs/scenegraph/group-creater/cell-type/text-cell.js +7 -4
- package/cjs/scenegraph/group-creater/cell-type/text-cell.js.map +1 -1
- package/cjs/scenegraph/group-creater/cell-type/video-cell.js +1 -1
- package/cjs/scenegraph/group-creater/cell-type/video-cell.js.map +1 -1
- package/cjs/scenegraph/group-creater/column-helper.d.ts +3 -3
- package/cjs/scenegraph/group-creater/column-helper.js +22 -11
- package/cjs/scenegraph/group-creater/column-helper.js.map +1 -1
- package/cjs/scenegraph/group-creater/column.d.ts +0 -6
- package/cjs/scenegraph/group-creater/column.js +3 -12
- package/cjs/scenegraph/group-creater/column.js.map +1 -1
- package/cjs/scenegraph/group-creater/progress/proxy.d.ts +0 -2
- package/cjs/scenegraph/group-creater/progress/proxy.js +23 -19
- package/cjs/scenegraph/group-creater/progress/proxy.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/auto-width.js +1 -1
- package/cjs/scenegraph/layout/auto-width.js.map +1 -1
- package/cjs/scenegraph/layout/compute-col-width.d.ts +1 -1
- package/cjs/scenegraph/layout/compute-col-width.js +28 -8
- package/cjs/scenegraph/layout/compute-col-width.js.map +1 -1
- package/cjs/scenegraph/layout/frozen.d.ts +3 -0
- package/cjs/scenegraph/layout/frozen.js +66 -0
- package/cjs/scenegraph/layout/frozen.js.map +1 -0
- package/cjs/scenegraph/layout/move-cell.js +5 -1
- package/cjs/scenegraph/layout/move-cell.js.map +1 -1
- package/cjs/scenegraph/layout/update-cell.js +3 -3
- package/cjs/scenegraph/layout/update-cell.js.map +1 -1
- package/cjs/scenegraph/layout/update-height.js +4 -4
- package/cjs/scenegraph/layout/update-height.js.map +1 -1
- package/cjs/scenegraph/layout/update-row.d.ts +3 -0
- package/cjs/scenegraph/layout/update-row.js +81 -0
- package/cjs/scenegraph/layout/update-row.js.map +1 -0
- package/cjs/scenegraph/layout/update-width.js +5 -5
- package/cjs/scenegraph/layout/update-width.js.map +1 -1
- package/cjs/scenegraph/refresh-node/update-chart.d.ts +2 -0
- package/cjs/scenegraph/refresh-node/update-chart.js +26 -0
- package/cjs/scenegraph/refresh-node/update-chart.js.map +1 -0
- package/cjs/scenegraph/scenegraph.d.ts +15 -3
- package/cjs/scenegraph/scenegraph.js +86 -95
- package/cjs/scenegraph/scenegraph.js.map +1 -1
- package/cjs/scenegraph/select/create-select-border.js +1 -0
- package/cjs/scenegraph/select/create-select-border.js.map +1 -1
- package/cjs/scenegraph/stick-text/index.js +52 -40
- package/cjs/scenegraph/stick-text/index.js.map +1 -1
- package/cjs/scenegraph/style/frame-border.d.ts +1 -1
- package/cjs/scenegraph/style/frame-border.js +7 -7
- package/cjs/scenegraph/style/frame-border.js.map +1 -1
- package/cjs/scenegraph/utils/deal-promise-data.d.ts +2 -0
- package/cjs/scenegraph/utils/deal-promise-data.js +14 -0
- package/cjs/scenegraph/utils/deal-promise-data.js.map +1 -0
- package/cjs/scenegraph/utils/empty-group.d.ts +2 -0
- package/cjs/scenegraph/utils/empty-group.js +10 -0
- package/cjs/scenegraph/utils/empty-group.js.map +1 -0
- package/cjs/scenegraph/utils/get-hierarchy-offset.d.ts +2 -0
- package/cjs/scenegraph/utils/get-hierarchy-offset.js +27 -0
- package/cjs/scenegraph/utils/get-hierarchy-offset.js.map +1 -0
- package/cjs/scenegraph/utils/padding.d.ts +1 -1
- package/cjs/scenegraph/utils/padding.js +3 -3
- package/cjs/scenegraph/utils/padding.js.map +1 -1
- package/cjs/scenegraph/utils/text-icon-layout.d.ts +3 -2
- package/cjs/scenegraph/utils/text-icon-layout.js +24 -19
- package/cjs/scenegraph/utils/text-icon-layout.js.map +1 -1
- package/cjs/scenegraph/utils/text-pos.js +1 -1
- package/cjs/scenegraph/utils/text-pos.js.map +1 -1
- package/cjs/state/cell-move/adjust-header.js +9 -2
- package/cjs/state/cell-move/adjust-header.js.map +1 -1
- package/cjs/state/cell-move/index.js +9 -3
- package/cjs/state/cell-move/index.js.map +1 -1
- package/cjs/state/frozen/index.d.ts +2 -0
- package/cjs/state/{pin → frozen}/index.js +2 -2
- package/cjs/state/frozen/index.js.map +1 -0
- package/cjs/state/state.d.ts +1 -1
- package/cjs/state/state.js +16 -12
- package/cjs/state/state.js.map +1 -1
- package/cjs/themes/ARCO.js +1 -1
- package/cjs/themes/ARCO.js.map +1 -1
- package/cjs/themes/BRIGHT.js +1 -1
- package/cjs/themes/BRIGHT.js.map +1 -1
- package/cjs/themes/DARK.js +1 -1
- package/cjs/themes/DARK.js.map +1 -1
- package/cjs/themes/DEFAULT.js +1 -1
- package/cjs/themes/DEFAULT.js.map +1 -1
- package/cjs/themes/theme.d.ts +1 -1
- package/cjs/themes/theme.js +6 -6
- package/cjs/themes/theme.js.map +1 -1
- package/cjs/tools/LimitPromiseQueue.js +1 -2
- package/cjs/tools/NumberMap.js +1 -1
- package/cjs/tools/Rect.js +1 -1
- package/cjs/tools/calc.js +1 -1
- package/cjs/tools/debounce.js +1 -1
- package/cjs/tools/diff-cell.d.ts +10 -0
- package/cjs/tools/diff-cell.js +49 -0
- package/cjs/tools/diff-cell.js.map +1 -0
- package/cjs/tools/dom.js +1 -1
- package/cjs/tools/env.js +1 -1
- package/cjs/tools/helper.d.ts +11 -0
- package/cjs/tools/helper.js +7 -2
- package/cjs/tools/helper.js.map +1 -1
- package/cjs/tooltip/BaseTooltip.js +1 -1
- package/cjs/tooltip/Tooltip.js +2 -1
- package/cjs/tooltip/TooltipHandler.js +1 -1
- package/cjs/ts-types/base-table.d.ts +8 -2
- 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/customElement.d.ts +11 -2
- package/cjs/ts-types/customElement.js +1 -1
- package/cjs/ts-types/customElement.js.map +1 -1
- package/cjs/ts-types/customLayout.js +1 -1
- package/cjs/ts-types/events.js +1 -1
- package/cjs/ts-types/icon.d.ts +4 -5
- package/cjs/ts-types/icon.js +6 -6
- package/cjs/ts-types/icon.js.map +1 -1
- package/cjs/ts-types/list-table/define/basic-define.d.ts +4 -1
- package/cjs/ts-types/list-table/define/basic-define.js.map +1 -1
- package/cjs/ts-types/list-table/layout-map/api.js.map +1 -1
- package/cjs/ts-types/theme.d.ts +1 -1
- package/cjs/ts-types/theme.js.map +1 -1
- package/dist/vtable.es5.js +53155 -0
- package/dist/vtable.es5.min.js +3 -0
- package/dist/vtable.js +17155 -21633
- package/dist/vtable.min.js +15 -3
- package/es/ListTable.js +16 -3
- package/es/ListTable.js.map +1 -1
- package/es/PivotTable.d.ts +2 -1
- package/es/PivotTable.js +16 -2
- package/es/PivotTable.js.map +1 -1
- package/es/body-helper/body-helper.d.ts +1 -0
- package/es/body-helper/body-helper.js +6 -3
- package/es/body-helper/body-helper.js.map +1 -1
- package/es/body-helper/style/ProgressBarStyle.js +14 -8
- package/es/body-helper/style/ProgressBarStyle.js.map +1 -1
- package/es/body-helper/style/Style.d.ts +3 -0
- package/es/body-helper/style/Style.js +21 -14
- package/es/body-helper/style/Style.js.map +1 -1
- package/es/core/BaseTable.d.ts +4 -1
- package/es/core/BaseTable.js +31 -21
- package/es/core/BaseTable.js.map +1 -1
- package/es/core/tableHelper.js +11 -7
- package/es/core/tableHelper.js.map +1 -1
- package/es/data/DataSource.d.ts +4 -1
- package/es/data/DataSource.js +4 -2
- package/es/data/DataSource.js.map +1 -1
- package/es/event/event.d.ts +14 -19
- package/es/event/event.js +16 -333
- package/es/event/event.js.map +1 -1
- package/es/event/listener/container-dom.d.ts +2 -0
- package/es/event/listener/container-dom.js +40 -0
- package/es/event/listener/container-dom.js.map +1 -0
- package/es/event/listener/scroll-bar.d.ts +2 -0
- package/es/event/listener/scroll-bar.js +37 -0
- package/es/event/listener/scroll-bar.js.map +1 -0
- package/es/event/listener/table-group.d.ts +2 -0
- package/es/event/listener/table-group.js +265 -0
- package/es/event/listener/table-group.js.map +1 -0
- package/es/event/listener/touch.d.ts +2 -0
- package/es/event/listener/touch.js +67 -0
- package/es/event/listener/touch.js.map +1 -0
- package/es/event/scroll.d.ts +2 -0
- package/es/event/scroll.js +29 -3
- package/es/event/scroll.js.map +1 -1
- package/es/event/util.d.ts +16 -0
- package/es/event/util.js +24 -0
- package/es/event/util.js.map +1 -0
- package/es/header-helper/header-helper.d.ts +5 -6
- package/es/header-helper/header-helper.js +22 -24
- package/es/header-helper/header-helper.js.map +1 -1
- package/es/icons.js +11 -11
- package/es/icons.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/index.js +1 -2
- package/es/layout/pivot-header-layout.d.ts +4 -1
- package/es/layout/pivot-header-layout.js +17 -13
- package/es/layout/pivot-header-layout.js.map +1 -1
- package/es/layout/simple-header-layout.d.ts +13 -1
- package/es/layout/simple-header-layout.js +12 -1
- package/es/layout/simple-header-layout.js.map +1 -1
- package/es/render/layout/container.js +1 -1
- package/es/render/layout/container.js.map +1 -1
- package/es/render/layout/element.d.ts +1 -1
- package/es/render/layout/element.js.map +1 -1
- package/es/render/layout/rect.d.ts +2 -2
- package/es/render/layout/rect.js +2 -2
- package/es/render/layout/rect.js.map +1 -1
- package/es/scenegraph/component/custom.js +20 -9
- package/es/scenegraph/component/custom.js.map +1 -1
- package/es/scenegraph/component/menu.js +2 -2
- package/es/scenegraph/component/menu.js.map +1 -1
- package/es/scenegraph/component/table-component.d.ts +3 -3
- package/es/scenegraph/component/table-component.js +36 -26
- package/es/scenegraph/component/table-component.js.map +1 -1
- package/es/scenegraph/graphic/chart.d.ts +1 -0
- package/es/scenegraph/graphic/chart.js.map +1 -1
- package/es/scenegraph/graphic/contributions/chart-render.js +7 -2
- package/es/scenegraph/graphic/contributions/chart-render.js.map +1 -1
- package/es/scenegraph/graphic/contributions/group-contribution-render.js.map +1 -1
- package/es/scenegraph/graphic/group.d.ts +4 -0
- package/es/scenegraph/graphic/group.js +6 -0
- package/es/scenegraph/graphic/group.js.map +1 -1
- package/es/scenegraph/graphic/text.js +7 -7
- package/es/scenegraph/graphic/text.js.map +1 -1
- package/es/scenegraph/group-creater/cell-helper.d.ts +3 -4
- package/es/scenegraph/group-creater/cell-helper.js +28 -17
- package/es/scenegraph/group-creater/cell-helper.js.map +1 -1
- package/es/scenegraph/group-creater/cell-type/chart-cell.js +6 -4
- package/es/scenegraph/group-creater/cell-type/chart-cell.js.map +1 -1
- package/es/scenegraph/group-creater/cell-type/image-cell.js +12 -2
- package/es/scenegraph/group-creater/cell-type/image-cell.js.map +1 -1
- package/es/scenegraph/group-creater/cell-type/progress-bar-cell.js +13 -10
- package/es/scenegraph/group-creater/cell-type/progress-bar-cell.js.map +1 -1
- package/es/scenegraph/group-creater/cell-type/text-cell.d.ts +1 -1
- package/es/scenegraph/group-creater/cell-type/text-cell.js +7 -4
- package/es/scenegraph/group-creater/cell-type/text-cell.js.map +1 -1
- package/es/scenegraph/group-creater/cell-type/video-cell.js +1 -1
- package/es/scenegraph/group-creater/cell-type/video-cell.js.map +1 -1
- package/es/scenegraph/group-creater/column-helper.d.ts +3 -3
- package/es/scenegraph/group-creater/column-helper.js +25 -10
- package/es/scenegraph/group-creater/column-helper.js.map +1 -1
- package/es/scenegraph/group-creater/column.d.ts +0 -6
- package/es/scenegraph/group-creater/column.js +3 -12
- package/es/scenegraph/group-creater/column.js.map +1 -1
- package/es/scenegraph/group-creater/progress/proxy.d.ts +0 -2
- package/es/scenegraph/group-creater/progress/proxy.js +22 -21
- package/es/scenegraph/group-creater/progress/proxy.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/auto-width.js +2 -2
- package/es/scenegraph/layout/auto-width.js.map +1 -1
- package/es/scenegraph/layout/compute-col-width.d.ts +1 -1
- package/es/scenegraph/layout/compute-col-width.js +30 -10
- package/es/scenegraph/layout/compute-col-width.js.map +1 -1
- package/es/scenegraph/layout/frozen.d.ts +3 -0
- package/es/scenegraph/layout/frozen.js +58 -0
- package/es/scenegraph/layout/frozen.js.map +1 -0
- package/es/scenegraph/layout/move-cell.js +5 -1
- package/es/scenegraph/layout/move-cell.js.map +1 -1
- package/es/scenegraph/layout/update-cell.js +4 -4
- package/es/scenegraph/layout/update-cell.js.map +1 -1
- package/es/scenegraph/layout/update-height.js +5 -5
- package/es/scenegraph/layout/update-height.js.map +1 -1
- package/es/scenegraph/layout/update-row.d.ts +3 -0
- package/es/scenegraph/layout/update-row.js +73 -0
- package/es/scenegraph/layout/update-row.js.map +1 -0
- package/es/scenegraph/layout/update-width.js +6 -6
- package/es/scenegraph/layout/update-width.js.map +1 -1
- package/es/scenegraph/refresh-node/update-chart.d.ts +2 -0
- package/es/scenegraph/refresh-node/update-chart.js +20 -0
- package/es/scenegraph/refresh-node/update-chart.js.map +1 -0
- package/es/scenegraph/scenegraph.d.ts +15 -3
- package/es/scenegraph/scenegraph.js +92 -94
- package/es/scenegraph/scenegraph.js.map +1 -1
- package/es/scenegraph/select/create-select-border.js +1 -0
- package/es/scenegraph/select/create-select-border.js.map +1 -1
- package/es/scenegraph/stick-text/index.js +52 -40
- package/es/scenegraph/stick-text/index.js.map +1 -1
- package/es/scenegraph/style/frame-border.d.ts +1 -1
- package/es/scenegraph/style/frame-border.js +9 -9
- package/es/scenegraph/style/frame-border.js.map +1 -1
- package/es/scenegraph/utils/deal-promise-data.d.ts +2 -0
- package/es/scenegraph/utils/deal-promise-data.js +8 -0
- package/es/scenegraph/utils/deal-promise-data.js.map +1 -0
- package/es/scenegraph/utils/empty-group.d.ts +2 -0
- package/es/scenegraph/utils/empty-group.js +6 -0
- package/es/scenegraph/utils/empty-group.js.map +1 -0
- package/es/scenegraph/utils/get-hierarchy-offset.d.ts +2 -0
- package/es/scenegraph/utils/get-hierarchy-offset.js +19 -0
- package/es/scenegraph/utils/get-hierarchy-offset.js.map +1 -0
- package/es/scenegraph/utils/padding.d.ts +1 -1
- package/es/scenegraph/utils/padding.js +1 -1
- package/es/scenegraph/utils/padding.js.map +1 -1
- package/es/scenegraph/utils/text-icon-layout.d.ts +3 -2
- package/es/scenegraph/utils/text-icon-layout.js +27 -19
- package/es/scenegraph/utils/text-icon-layout.js.map +1 -1
- package/es/scenegraph/utils/text-pos.js +2 -2
- package/es/scenegraph/utils/text-pos.js.map +1 -1
- package/es/state/cell-move/adjust-header.js +9 -2
- package/es/state/cell-move/adjust-header.js.map +1 -1
- package/es/state/cell-move/index.js +9 -3
- package/es/state/cell-move/index.js.map +1 -1
- package/es/state/frozen/index.d.ts +2 -0
- package/es/state/{pin → frozen}/index.js +1 -1
- package/es/state/frozen/index.js.map +1 -0
- package/es/state/state.d.ts +1 -1
- package/es/state/state.js +16 -12
- package/es/state/state.js.map +1 -1
- package/es/themes/ARCO.js +1 -1
- package/es/themes/ARCO.js.map +1 -1
- package/es/themes/BRIGHT.js +1 -1
- package/es/themes/BRIGHT.js.map +1 -1
- package/es/themes/DARK.js +1 -1
- package/es/themes/DARK.js.map +1 -1
- package/es/themes/DEFAULT.js +1 -1
- package/es/themes/DEFAULT.js.map +1 -1
- package/es/themes/theme.d.ts +1 -1
- package/es/themes/theme.js +6 -6
- package/es/themes/theme.js.map +1 -1
- package/es/tools/LimitPromiseQueue.js +1 -2
- package/es/tools/NumberMap.js +1 -1
- package/es/tools/Rect.js +1 -1
- package/es/tools/calc.js +1 -1
- package/es/tools/debounce.js +1 -1
- package/es/tools/diff-cell.d.ts +10 -0
- package/es/tools/diff-cell.js +42 -0
- package/es/tools/diff-cell.js.map +1 -0
- package/es/tools/dom.js +1 -1
- package/es/tools/env.js +1 -1
- package/es/tools/helper.d.ts +11 -0
- package/es/tools/helper.js +4 -0
- package/es/tools/helper.js.map +1 -1
- package/es/tooltip/BaseTooltip.js +1 -1
- package/es/tooltip/Tooltip.js +2 -1
- package/es/tooltip/TooltipHandler.js +1 -1
- package/es/ts-types/base-table.d.ts +8 -2
- 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/customElement.d.ts +11 -2
- package/es/ts-types/customElement.js +1 -1
- package/es/ts-types/customElement.js.map +1 -1
- package/es/ts-types/customLayout.js +1 -1
- package/es/ts-types/events.js +1 -1
- package/es/ts-types/icon.d.ts +4 -5
- package/es/ts-types/icon.js +6 -6
- package/es/ts-types/icon.js.map +1 -1
- package/es/ts-types/list-table/define/basic-define.d.ts +4 -1
- package/es/ts-types/list-table/define/basic-define.js.map +1 -1
- package/es/ts-types/list-table/layout-map/api.js.map +1 -1
- package/es/ts-types/theme.d.ts +1 -1
- package/es/ts-types/theme.js.map +1 -1
- package/package.json +9 -9
- package/cjs/scenegraph/component/menu.d.ts +0 -41
- package/cjs/scenegraph/graphic/text.d.ts +0 -16
- package/cjs/state/pin/index.d.ts +0 -2
- package/cjs/state/pin/index.js.map +0 -1
- package/es/scenegraph/component/menu.d.ts +0 -41
- package/es/scenegraph/graphic/text.d.ts +0 -16
- package/es/state/pin/index.d.ts +0 -2
- package/es/state/pin/index.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["scenegraph/group-creater/progress/proxy.ts"],"names":[],"mappings":";;;;;;;;;AAGA,OA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AAE,KAAK,CAAC,aAAa,CAAC,KAAK,CAAC,sBAAsB,EAAE,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC;iBACvF;gBACD,SAAS,CAAC,YAAY,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC;aAChC;SACF;KACF;AACH,CAAC;AAED,SAAS,cAAc,CAAC,cAAqB,EAAE,GAAW;IACxD,IAAI,CAAC,cAAc,EAAE;QACnB,OAAO,IAAI,CAAC;KACb;IACD,IAAI,cAAc,CAAC,GAAG,KAAK,GAAG,EAAE;QAC9B,OAAO,cAAc,CAAC;KACvB;SAAM,IAAI,cAAc,CAAC,GAAG,GAAG,GAAG,EAAE;QACnC,OAAO,cAAc,CAAC,cAAc,CAAC,KAAc,EAAE,GAAG,CAAC,CAAC;KAC3D;IACD,OAAO,cAAc,CAAC,cAAc,CAAC,KAAc,EAAE,GAAG,CAAC,CAAC;AAC5D,CAAC","file":"proxy.js","sourcesContent":["import type { BaseTableAPI } from '../../../ts-types/base-table';\nimport type { Group } from '../../graphic/group';\nimport type { WrapText } from '../../graphic/text';\nimport { updateCellHeightForColumn } from '../../layout/update-height';\nimport type { Scenegraph } from '../../scenegraph';\nimport { emptyGroup } from '../../scenegraph';\nimport { getProp } from '../../utils/get-prop';\nimport { getPadding } from '../../utils/padding';\nimport { createColGroup } from '../column';\nimport { createComplexColumn } from '../column-helper';\n\nconst mergeMap = new Map();\n\nexport class SceneProxy {\n table: BaseTableAPI;\n scenegraph: Scenegraph;\n currentRow = 0;\n totalRow: number;\n rowLimit = 1000;\n yLimitTop: number; // y > yLimitTop动态更新,否则直接修改xy\n yLimitBottom: number; // y < yLimitBottom动态更新,否则直接修改xy\n // bottomOffset: number;\n // scroll\n accurateY = 0;\n rowStart = 0;\n rowEnd = 0;\n referenceRow = 0;\n\n bodyTopRow: number;\n bodyBottomRow: number;\n bodyLeftCol: number;\n bodyRightCol: number;\n screenRowCount: number;\n firstScreenRowLimit: number;\n taskRowCount: number;\n rowUpdatePos: number;\n rowUpdateDirection: 'up' | 'down';\n screenTopRow: number = 0;\n screenTopRowDeltaY: number;\n y: number;\n\n cellCache: Map<number, Group> = new Map(); // 单元格位置快速查找缓存\n\n constructor(table: BaseTableAPI) {\n this.table = table;\n this.scenegraph = table.scenegraph;\n }\n\n setParams() {\n this.bodyTopRow = this.table.columnHeaderLevelCount;\n this.bodyBottomRow = this.table.rowCount - 1;\n this.bodyLeftCol = 0;\n this.bodyRightCol = this.table.colCount - 1;\n\n // 计算渐进加载数量\n const totalActualBodyRowCount = Math.min(this.rowLimit, this.bodyBottomRow - this.bodyTopRow + 1);\n this.totalRow = this.bodyTopRow + totalActualBodyRowCount - 1; // 目标渐进完成的row\n this.rowStart = this.bodyTopRow;\n const defaultRowHeight = this.table.defaultRowHeight;\n this.taskRowCount = Math.ceil(this.table.tableNoFrameHeight / defaultRowHeight) * 5;\n\n // 确定动态更新限制\n const totalBodyHeight = defaultRowHeight * totalActualBodyRowCount;\n const totalHeight = defaultRowHeight * (this.bodyBottomRow - this.bodyTopRow + 1);\n this.yLimitTop = totalBodyHeight / 2;\n this.yLimitBottom = totalHeight - totalBodyHeight / 2;\n // this.bottomOffset = totalHeight - totalBodyHeight / 2;\n\n // 确定首屏高度范围\n const heightLimit = this.table.tableNoFrameHeight * 5;\n this.screenRowCount = Math.ceil(this.table.tableNoFrameHeight / defaultRowHeight);\n this.firstScreenRowLimit = this.bodyTopRow + Math.ceil(heightLimit / defaultRowHeight);\n // this.firstScreenRowLimit = this.bodyBottomRow;\n\n this.rowUpdatePos = this.bodyBottomRow;\n }\n\n async createColGroupForFirstScreen(\n rowHeaderGroup: Group,\n bodyGroup: Group,\n xOrigin: number,\n yOrigin: number,\n table: BaseTableAPI\n ) {\n this.setParams();\n\n // 生成首屏单元格\n // rowHeader\n createColGroup(\n rowHeaderGroup,\n xOrigin,\n yOrigin,\n 0, // colStart\n table.rowHeaderLevelCount - 1, // colEnd\n table.columnHeaderLevelCount, // rowStart\n table.rowCount - 1, // rowEnd\n 'rowHeader', // isHeader\n table,\n this.firstScreenRowLimit\n );\n // body\n createColGroup(\n bodyGroup,\n xOrigin,\n yOrigin,\n table.rowHeaderLevelCount, // colStart\n table.colCount - 1, // colEnd\n table.columnHeaderLevelCount, // rowStart\n table.rowCount - 1, // rowEnd\n 'body', // isHeader\n table,\n this.firstScreenRowLimit\n );\n\n // 更新row信息\n if (!bodyGroup.firstChild) {\n // 无数据\n this.currentRow = this.totalRow;\n this.rowEnd = this.currentRow;\n this.rowUpdatePos = this.rowEnd;\n this.referenceRow = Math.floor((this.rowEnd - this.rowStart) / 2);\n } else {\n this.currentRow = (bodyGroup.firstChild.lastChild as Group).row;\n this.rowEnd = this.currentRow;\n this.rowUpdatePos = this.rowEnd;\n this.referenceRow = Math.floor((this.rowEnd - this.rowStart) / 2);\n // 开始异步任务\n await this.progress();\n }\n }\n\n // async progress() {\n // if (this.rowUpdatePos < this.rowEnd) {\n // console.log('progress rowUpdatePos', this.rowUpdatePos);\n // // 先更新\n // await this.updateCellGroupsAsync();\n // await this.progress();\n // } else if (this.currentRow < this.totalRow) {\n // console.log('progress currentRow', this.currentRow);\n // // 先更新没有需要更新的节点,在生成新节点\n // await this.createRow();\n // await this.progress();\n // }\n // }\n async progress() {\n return new Promise<void>((resolve, reject) => {\n setTimeout(() => {\n if (this.rowUpdatePos < this.rowEnd) {\n // console.log('progress rowUpdatePos', this.rowUpdatePos);\n // 先更新\n this.updateCellGroupsAsync();\n this.progress();\n } else if (this.currentRow < this.totalRow) {\n // console.log('progress currentRow', this.currentRow);\n // 先更新没有需要更新的节点,在生成新节点\n this.createRow();\n this.progress();\n }\n\n resolve();\n }, 0);\n });\n }\n\n async createRow() {\n if (!this.taskRowCount) {\n return;\n }\n console.log('createRow', this.currentRow, this.currentRow + this.taskRowCount);\n this.createRowCellGroup(this.taskRowCount);\n }\n\n createRowCellGroup(onceCount: number) {\n const endRow = Math.min(this.totalRow, this.currentRow + onceCount);\n for (let col = this.bodyLeftCol; col <= this.bodyRightCol; col++) {\n const colGroup = this.scenegraph.getColGroup(col);\n const cellType = col < this.table.rowHeaderLevelCount ? 'rowHeader' : 'body';\n createComplexColumn(\n colGroup,\n col,\n colGroup.attribute.width,\n this.currentRow + 1,\n endRow,\n mergeMap,\n this.table.internalProps.defaultRowHeight,\n this.table,\n cellType\n );\n }\n\n if (this.table.internalProps.autoRowHeight) {\n updateAutoRow(\n this.bodyLeftCol, // colStart\n this.bodyRightCol, // colEnd\n this.currentRow + 1, // rowStart\n endRow, // rowEnd\n this.table\n );\n }\n this.currentRow = endRow;\n this.rowEnd = endRow;\n this.rowUpdatePos = this.rowEnd;\n this.referenceRow = Math.floor((endRow - this.rowStart) / 2);\n }\n\n async setY(y: number) {\n if (y < this.yLimitTop && this.rowStart === this.bodyTopRow) {\n // 执行真实body group坐标修改\n this.scenegraph.setBodyAndRowHeaderY(-y);\n } else if (y > this.yLimitBottom && this.rowEnd === this.bodyBottomRow) {\n // 执行真实body group坐标修改\n this.scenegraph.setBodyAndRowHeaderY(-y);\n } else {\n // 执行动态更新节点\n this.dynamicSetY(y);\n }\n }\n\n async dynamicSetY(y: number) {\n // 计算变动row range\n // const screenTopRow = this.table.getRowAt(y).row;\n const screenTop = (this.table as any).getTargetRowAt(y + this.table.scenegraph.colHeaderGroup.attribute.height);\n if (!screenTop) {\n return;\n }\n const screenTopRow = screenTop.row;\n this.y = y;\n this.screenTopRow = screenTopRow;\n // this.screenTopRowDeltaY = y - this.table.getRowsHeight(this.bodyTopRow, screenTopRow - 1);\n const deltaRow = screenTopRow - this.referenceRow;\n if (deltaRow > 0) {\n // 向下滚动,顶部cell group移到底部\n this.moveCell(deltaRow, 'up', screenTopRow);\n this.updateBody(y);\n // if (this.rowEnd === this.table.scenegraph.proxy.bodyBottomRow) {\n // const totalHeight = this.table.getAllRowsHeight();\n // const top = totalHeight - this.table.scenegraph.height;\n // this.updateBody(top);\n // } else {\n // this.updateBody(y);\n // }\n } else if (deltaRow < 0) {\n // 向上滚动,底部cell group移到顶部\n this.moveCell(-deltaRow, 'down', screenTopRow);\n this.updateBody(y);\n // if (this.rowStart === this.bodyTopRow) {\n // this.updateBody(0);\n // } else {\n // this.updateBody(y);\n // }\n } else {\n // 不改变row,更新body group范围\n this.updateBody(y);\n }\n\n this.scenegraph.updateNextFrame();\n }\n\n updateBody(y: number) {\n this.scenegraph.setBodyAndRowHeaderY(-y);\n }\n\n async moveCell(count: number, direction: 'up' | 'down', screenTopRow: number) {\n // 限制count范围\n if (direction === 'up' && this.rowEnd + count > this.bodyBottomRow) {\n count = this.bodyBottomRow - this.rowEnd;\n } else if (direction === 'down' && this.rowStart - count < this.bodyTopRow) {\n count = this.rowStart - this.bodyTopRow;\n }\n\n // 两种更新模式\n // 1. count < rowEnd - rowStart:从顶/底部移动count数量的单元格到底/顶部\n // 2. count >= rowEnd - rowStart:整体移动到目标位置\n if (count < this.rowEnd - this.rowStart) {\n // 计算更新区域\n const startRow = direction === 'up' ? this.rowStart : this.rowEnd - count + 1;\n const endRow = direction === 'up' ? this.rowStart + count - 1 : this.rowEnd;\n // console.log('move', startRow, endRow, direction);\n for (let col = this.bodyLeftCol; col <= this.bodyRightCol; col++) {\n const colGroup = this.scenegraph.getColGroup(col);\n for (let row = startRow; row <= endRow; row++) {\n if (direction === 'up') {\n const cellGroup = colGroup.firstChild as Group;\n this.updateCellGroupPosition(\n cellGroup,\n (colGroup.lastChild as Group).row + 1,\n (colGroup.lastChild as Group).attribute.y + (colGroup.lastChild as Group).attribute.height\n );\n colGroup.appendChild(cellGroup);\n } else {\n const cellGroup = colGroup.lastChild as Group;\n this.updateCellGroupPosition(\n cellGroup,\n (colGroup.firstChild as Group).row - 1,\n (colGroup.firstChild as Group).attribute.y - cellGroup.attribute.height\n );\n colGroup.insertBefore(cellGroup, colGroup.firstChild);\n }\n }\n }\n const distStartRow = direction === 'up' ? this.rowEnd + 1 : this.rowStart - count;\n const distEndRow = direction === 'up' ? this.rowEnd + count : this.rowStart - 1;\n\n // 更新同步范围\n const syncTopRow = Math.max(this.bodyTopRow, screenTopRow - this.screenRowCount * 2);\n const syncBottomRow = Math.min(this.bodyBottomRow, screenTopRow + this.screenRowCount * 3);\n for (let col = this.bodyLeftCol; col <= this.bodyRightCol; col++) {\n for (let row = syncTopRow; row <= syncBottomRow; row++) {\n // const cellGroup = this.table.scenegraph.getCell(col, row);\n const cellGroup = this.highPerformanceGetCell(col, row, distStartRow, distEndRow);\n this.updateCellGroupContent(cellGroup);\n }\n }\n if (this.table.internalProps.autoRowHeight) {\n updateAutoRow(\n this.bodyLeftCol, // colStart\n this.bodyRightCol, // colEnd\n syncTopRow, // rowStart\n syncBottomRow, // rowEnd\n this.table,\n direction\n );\n }\n\n this.rowStart = direction === 'up' ? this.rowStart + count : this.rowStart - count;\n this.rowEnd = direction === 'up' ? this.rowEnd + count : this.rowEnd - count;\n this.currentRow = direction === 'up' ? this.currentRow + count : this.currentRow - count;\n this.totalRow = direction === 'up' ? this.totalRow + count : this.totalRow - count;\n this.referenceRow = this.rowStart + Math.floor((this.rowEnd - this.rowStart) / 2);\n this.rowUpdatePos = distStartRow;\n this.rowUpdateDirection = direction;\n console.log('move end proxy', this.rowStart, this.rowEnd);\n console.log(\n 'move end cell',\n (this.table as any).scenegraph.bodyGroup.firstChild.firstChild.row,\n (this.table as any).scenegraph.bodyGroup.firstChild.lastChild.row\n );\n\n this.table.scenegraph.stage.render();\n await this.progress();\n } else {\n const distStartRow = direction === 'up' ? this.rowStart + count : this.rowStart - count;\n const distEndRow = direction === 'up' ? this.rowEnd + count : this.rowEnd - count;\n const distStartRowY = this.table.getRowsHeight(this.bodyTopRow, distStartRow - 1);\n for (let col = this.bodyLeftCol; col <= this.bodyRightCol; col++) {\n const colGroup = this.scenegraph.getColGroup(col);\n colGroup.forEachChildren((cellGroup: Group, index) => {\n // 这里使用colGroup变量而不是for this.rowStart to this.rowEndthis.rowEnd是因为在更新内可能出现row号码重复的情况\n this.updateCellGroupPosition(\n cellGroup,\n direction === 'up' ? cellGroup.row + count : cellGroup.row - count,\n index === 0 // row === this.rowStart\n ? distStartRowY\n : (cellGroup._prev as Group).attribute.y + (cellGroup._prev as Group).attribute.height\n );\n });\n }\n\n // 更新同步范围\n let syncTopRow;\n let syncBottomRow;\n if (this.table.internalProps.autoRowHeight) {\n syncTopRow = distStartRow;\n syncBottomRow = distEndRow;\n } else {\n syncTopRow = Math.max(this.bodyTopRow, screenTopRow - this.screenRowCount * 2);\n syncBottomRow = Math.min(this.bodyBottomRow, screenTopRow + this.screenRowCount * 3);\n }\n console.log('更新同步范围', syncTopRow, syncBottomRow);\n for (let col = this.bodyLeftCol; col <= this.bodyRightCol; col++) {\n for (let row = syncTopRow; row <= syncBottomRow; row++) {\n // const cellGroup = this.table.scenegraph.getCell(col, row);\n const cellGroup = this.highPerformanceGetCell(col, row, distStartRow, distEndRow);\n this.updateCellGroupContent(cellGroup);\n }\n }\n console.log('updateAutoRow', distEndRow > this.bodyBottomRow - (this.rowEnd - this.rowStart + 1) ? 'down' : 'up');\n\n if (this.table.internalProps.autoRowHeight) {\n updateAutoRow(\n this.bodyLeftCol, // colStart\n this.bodyRightCol, // colEnd\n syncTopRow, // rowStart\n syncBottomRow, // rowEnd\n this.table,\n distEndRow > this.bodyBottomRow - (this.rowEnd - this.rowStart + 1) ? 'down' : 'up' // 跳转到底部时,从下向上对齐\n );\n }\n\n this.rowStart = distStartRow;\n this.rowEnd = distEndRow;\n this.currentRow = direction === 'up' ? this.currentRow + count : this.currentRow - count;\n this.totalRow = direction === 'up' ? this.totalRow + count : this.totalRow - count;\n this.referenceRow = this.rowStart + Math.floor((this.rowEnd - this.rowStart) / 2);\n this.rowUpdatePos = this.rowStart;\n this.rowUpdateDirection = distEndRow > this.bodyBottomRow - (this.rowEnd - this.rowStart + 1) ? 'down' : 'up';\n console.log('move total end proxy', this.rowStart, this.rowEnd);\n console.log(\n 'move total end cell',\n (this.table as any).scenegraph.bodyGroup.firstChild.firstChild.row,\n (this.table as any).scenegraph.bodyGroup.firstChild.lastChild.row\n );\n\n if (!this.table.internalProps.autoRowHeight) {\n await this.progress();\n }\n }\n }\n\n async updateCellGroupsAsync() {\n this.updateCellGroups(this.taskRowCount);\n }\n\n updateCellGroups(count: number) {\n const distRow = Math.min(this.bodyBottomRow, this.rowUpdatePos + count);\n console.log('updateCellGroups', this.rowUpdatePos, distRow);\n for (let col = this.bodyLeftCol; col <= this.bodyRightCol; col++) {\n for (let row = this.rowUpdatePos; row <= distRow; row++) {\n // const cellGroup = this.table.scenegraph.getCell(col, row);\n const cellGroup = this.highPerformanceGetCell(col, row);\n this.updateCellGroupContent(cellGroup);\n }\n }\n\n if (this.table.internalProps.autoRowHeight) {\n updateAutoRow(\n this.bodyLeftCol, // colStart\n this.bodyRightCol, // colEnd\n this.rowUpdatePos, // rowStart\n distRow, // rowEnd\n this.table,\n this.rowUpdateDirection\n );\n }\n\n this.rowUpdatePos = distRow + 1;\n }\n\n updateCellGroupPosition(cellGroup: Group, newRow: number, y: number) {\n // 更新位置&row\n cellGroup.row = newRow;\n cellGroup.setAttribute('y', y);\n (cellGroup as any).needUpdate = true;\n (cellGroup as any).needUpdateForAutoRowHeight = true;\n }\n\n updateCellGroupContent(cellGroup: Group) {\n if (!cellGroup.needUpdate) {\n return;\n }\n\n this.scenegraph.updateCellContent(cellGroup.col, cellGroup.row);\n // 更新内容\n // const textMark = cellGroup.firstChild as WrapText;\n // const autoWrapText = Array.isArray(textMark.attribute.text);\n // const textStr: string = this.table.getCellValue(cellGroup.col, cellGroup.row);\n // let text;\n // if (autoWrapText) {\n // text = String(textStr).replace(/\\r?\\n/g, '\\n').replace(/\\r/g, '\\n').split('\\n');\n // } else {\n // text = textStr;\n // }\n\n // textMark.setAttribute('text', text);\n\n cellGroup.needUpdate = false;\n }\n\n async sortCell() {\n for (let col = this.bodyLeftCol; col <= this.bodyRightCol; col++) {\n for (let row = this.rowStart; row <= this.rowEnd; row++) {\n // const cellGroup = this.table.scenegraph.getCell(col, row);\n const cellGroup = this.highPerformanceGetCell(col, row);\n cellGroup.needUpdate = true;\n }\n }\n\n // 更新同步范围\n let syncTopRow;\n let syncBottomRow;\n if (this.table.internalProps.autoRowHeight) {\n syncTopRow = this.rowStart;\n syncBottomRow = this.rowEnd;\n } else {\n syncTopRow = Math.max(this.bodyTopRow, this.screenTopRow - this.screenRowCount * 2);\n syncBottomRow = Math.min(this.bodyBottomRow, this.screenTopRow + this.screenRowCount * 3);\n }\n console.log('sort更新同步范围', syncTopRow, syncBottomRow);\n for (let col = this.bodyLeftCol; col <= this.bodyRightCol; col++) {\n for (let row = syncTopRow; row <= syncBottomRow; row++) {\n // const cellGroup = this.table.scenegraph.getCell(col, row);\n const cellGroup = this.highPerformanceGetCell(col, row);\n this.updateCellGroupContent(cellGroup);\n }\n }\n console.log('updateAutoRow', this.rowEnd > this.bodyBottomRow - (this.rowEnd - this.rowStart + 1) ? 'down' : 'up');\n if (this.table.internalProps.autoRowHeight) {\n updateAutoRow(\n this.bodyLeftCol, // colStart\n this.bodyRightCol, // colEnd\n syncTopRow, // rowStart\n syncBottomRow, // rowEnd\n this.table,\n this.rowEnd > this.bodyBottomRow - (this.rowEnd - this.rowStart + 1) ? 'down' : 'up' // 跳转到底部时,从下向上对齐\n );\n }\n this.rowUpdatePos = this.rowStart;\n this.rowUpdateDirection = this.rowEnd > this.bodyBottomRow - (this.rowEnd - this.rowStart + 1) ? 'down' : 'up';\n\n if (\n this.rowEnd === this.table.scenegraph.proxy.bodyBottomRow &&\n this.rowStart === this.table.scenegraph.proxy.bodyTopRow\n ) {\n // 全量更新,do nothing\n } else if (this.rowEnd === this.table.scenegraph.proxy.bodyBottomRow) {\n const totalHeight = this.table.getAllRowsHeight();\n const top = totalHeight - this.table.scenegraph.height;\n this.updateBody(top);\n } else if (this.rowStart === this.table.scenegraph.proxy.bodyTopRow) {\n this.updateBody(0);\n }\n\n if (!this.table.internalProps.autoRowHeight) {\n await this.progress();\n }\n }\n\n highPerformanceGetCell(col: number, row: number, rowStart: number = this.rowStart, rowEnd: number = this.rowEnd) {\n if (row < rowStart || row > rowEnd) {\n return emptyGroup;\n }\n if (this.cellCache.get(col)) {\n const cacheCellGoup = this.cellCache.get(col);\n if ((cacheCellGoup._next || cacheCellGoup._prev) && Math.abs(cacheCellGoup.row - row) < row) {\n // 由缓存单元格向前后查找要快于从头查找\n let cellGroup = getCellByCache(cacheCellGoup, row);\n if (!cellGroup) {\n cellGroup = this.scenegraph.getCell(col, row);\n }\n cellGroup.row && this.cellCache.set(col, cellGroup);\n return cellGroup;\n }\n const cellGroup = this.scenegraph.getCell(col, row);\n cellGroup.row && this.cellCache.set(col, cellGroup);\n return cellGroup;\n }\n const cellGroup = this.scenegraph.getCell(col, row);\n cellGroup.row && this.cellCache.set(col, cellGroup);\n return cellGroup;\n }\n}\n\nfunction updateAutoRow(\n colStart: number,\n colEnd: number,\n rowStart: number,\n rowEnd: number,\n table: BaseTableAPI,\n direction: 'up' | 'down' = 'up'\n) {\n // 获取行高\n for (let row = rowStart; row <= rowEnd; row++) {\n let maxRowHeight = 0;\n for (let col = colStart; col <= colEnd; col++) {\n const cellGroup = table.scenegraph.getCell(col, row);\n if (!cellGroup.row) {\n continue;\n }\n // const contentHeight = cellGroup.getContentHeight();\n const text = (cellGroup.getChildByName('text') as WrapText) || cellGroup.getChildByName('content');\n const headerStyle = table._getCellStyle(col, row);\n const padding = getPadding(getProp('padding', headerStyle, col, row, table));\n const height = text.AABBBounds.height() + (padding[0] + padding[2]);\n maxRowHeight = Math.max(maxRowHeight, height);\n (cellGroup as any).needUpdateForAutoRowHeight = false;\n }\n // updateRowHeight(table.scenegraph, row, table.getRowHeight(row) - maxRowHeight);\n for (let col = colStart; col <= colEnd; col++) {\n const cellGroup = table.scenegraph.getCell(col, row);\n updateCellHeightForColumn(table.scenegraph, cellGroup, col, row, maxRowHeight, 0, false);\n }\n\n table.setRowHeight(row, maxRowHeight, true);\n }\n\n // 更新y位置\n if (direction === 'up') {\n for (let col = colStart; col <= colEnd; col++) {\n for (let row = rowStart; row <= rowEnd; row++) {\n const cellGroup = table.scenegraph.getCell(col, row);\n if (!cellGroup.row) {\n continue;\n }\n let y;\n if (cellGroup._prev) {\n y = ((cellGroup._prev as Group)?.attribute.y ?? 0) + ((cellGroup._prev as Group)?.attribute.height ?? 0);\n } else {\n // 估计位置\n y = table.getRowsHeight(table.columnHeaderLevelCount, cellGroup.row - 1);\n }\n cellGroup.setAttribute('y', y);\n }\n }\n } else {\n for (let col = colStart; col <= colEnd; col++) {\n for (let row = rowEnd; row >= rowStart; row--) {\n const cellGroup = table.scenegraph.getCell(col, row);\n if (!cellGroup.row) {\n continue;\n }\n let y;\n if (cellGroup._next) {\n y = ((cellGroup._next as Group)?.attribute.y ?? 0) - (cellGroup.attribute.height ?? 0);\n } else {\n // 估计位置\n y = table.getRowsHeight(table.columnHeaderLevelCount, cellGroup.row) - (cellGroup.attribute.height ?? 0);\n console.log('估计位置', table.getRowsHeight(table.columnHeaderLevelCount, cellGroup.row));\n }\n cellGroup.setAttribute('y', y);\n }\n }\n }\n}\n\nfunction getCellByCache(cacheCellGroup: Group, row: number): Group | null {\n if (!cacheCellGroup) {\n return null;\n }\n if (cacheCellGroup.row === row) {\n return cacheCellGroup;\n } else if (cacheCellGroup.row > row) {\n return getCellByCache(cacheCellGroup._prev as Group, row);\n }\n return getCellByCache(cacheCellGroup._next as Group, row);\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["scenegraph/group-creater/progress/proxy.ts"],"names":[],"mappings":";;;;;;;;;AAGA,OAAO,EAAE,yBAAyB,EAAE,MAAM,4BAA4B,CAAC;AACvE,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACrD,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAC/C,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAC3C,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB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AC,GAAG,CAAC,MAAA,SAAS,CAAC,SAAS,CAAC,MAAM,mCAAI,CAAC,CAAC,CAAC;iBACxF;qBAAM;oBAEL,CAAC,GAAG,KAAK,CAAC,aAAa,CAAC,KAAK,CAAC,sBAAsB,EAAE,SAAS,CAAC,GAAG,CAAC,GAAG,CAAC,MAAA,SAAS,CAAC,SAAS,CAAC,MAAM,mCAAI,CAAC,CAAC,CAAC;oBACzG,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,KAAK,CAAC,aAAa,CAAC,KAAK,CAAC,sBAAsB,EAAE,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC;iBACvF;gBACD,SAAS,CAAC,YAAY,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC;aAChC;SACF;KACF;AACH,CAAC;AAED,SAAS,cAAc,CAAC,cAAqB,EAAE,GAAW;IACxD,IAAI,CAAC,cAAc,EAAE;QACnB,OAAO,IAAI,CAAC;KACb;IACD,IAAI,cAAc,CAAC,GAAG,KAAK,GAAG,EAAE;QAC9B,OAAO,cAAc,CAAC;KACvB;SAAM,IAAI,cAAc,CAAC,GAAG,GAAG,GAAG,EAAE;QACnC,OAAO,cAAc,CAAC,cAAc,CAAC,KAAc,EAAE,GAAG,CAAC,CAAC;KAC3D;IACD,OAAO,cAAc,CAAC,cAAc,CAAC,KAAc,EAAE,GAAG,CAAC,CAAC;AAC5D,CAAC","file":"proxy.js","sourcesContent":["import type { BaseTableAPI } from '../../../ts-types/base-table';\nimport type { Group } from '../../graphic/group';\nimport type { WrapText } from '../../graphic/text';\nimport { updateCellHeightForColumn } from '../../layout/update-height';\nimport { emptyGroup } from '../../utils/empty-group';\nimport { getProp } from '../../utils/get-prop';\nimport { getQuadProps } from '../../utils/padding';\nimport { createColGroup } from '../column';\nimport { createComplexColumn } from '../column-helper';\n\nexport class SceneProxy {\n table: BaseTableAPI;\n currentRow = 0;\n totalRow: number;\n rowLimit = 1000;\n yLimitTop: number; // y > yLimitTop动态更新,否则直接修改xy\n yLimitBottom: number; // y < yLimitBottom动态更新,否则直接修改xy\n // bottomOffset: number;\n // scroll\n accurateY = 0;\n rowStart = 0;\n rowEnd = 0;\n referenceRow = 0;\n\n bodyTopRow: number;\n bodyBottomRow: number;\n bodyLeftCol: number;\n bodyRightCol: number;\n screenRowCount: number;\n firstScreenRowLimit: number;\n taskRowCount: number;\n rowUpdatePos: number;\n rowUpdateDirection: 'up' | 'down';\n screenTopRow: number = 0;\n screenTopRowDeltaY: number;\n y: number;\n\n cellCache: Map<number, Group> = new Map(); // 单元格位置快速查找缓存\n\n constructor(table: BaseTableAPI) {\n this.table = table;\n if (this.table.options.maintainedDataCount) {\n this.rowLimit = this.table.options.maintainedDataCount;\n }\n }\n\n setParams() {\n this.bodyTopRow = this.table.columnHeaderLevelCount;\n this.bodyBottomRow = this.table.rowCount - 1;\n this.bodyLeftCol = 0;\n this.bodyRightCol = this.table.colCount - 1;\n\n // 计算渐进加载数量\n const totalActualBodyRowCount = Math.min(this.rowLimit, this.bodyBottomRow - this.bodyTopRow + 1);\n this.totalRow = this.bodyTopRow + totalActualBodyRowCount - 1; // 目标渐进完成的row\n this.rowStart = this.bodyTopRow;\n const defaultRowHeight = this.table.defaultRowHeight;\n this.taskRowCount = Math.ceil(this.table.tableNoFrameHeight / defaultRowHeight) * 5;\n\n // 确定动态更新限制\n const totalBodyHeight = defaultRowHeight * totalActualBodyRowCount;\n const totalHeight = defaultRowHeight * (this.bodyBottomRow - this.bodyTopRow + 1);\n this.yLimitTop = totalBodyHeight / 2;\n this.yLimitBottom = totalHeight - totalBodyHeight / 2;\n // this.bottomOffset = totalHeight - totalBodyHeight / 2;\n\n // 确定首屏高度范围\n const heightLimit = this.table.tableNoFrameHeight * 5;\n this.screenRowCount = Math.ceil(this.table.tableNoFrameHeight / defaultRowHeight);\n this.firstScreenRowLimit = this.bodyTopRow + Math.ceil(heightLimit / defaultRowHeight);\n // this.firstScreenRowLimit = this.bodyBottomRow;\n\n this.rowUpdatePos = this.bodyBottomRow;\n }\n\n async createColGroupForFirstScreen(\n rowHeaderGroup: Group,\n bodyGroup: Group,\n xOrigin: number,\n yOrigin: number,\n table: BaseTableAPI\n ) {\n this.setParams();\n\n // 生成首屏单元格\n // rowHeader\n createColGroup(\n rowHeaderGroup,\n xOrigin,\n yOrigin,\n 0, // colStart\n table.rowHeaderLevelCount - 1, // colEnd\n table.columnHeaderLevelCount, // rowStart\n table.rowCount - 1, // rowEnd\n 'rowHeader', // isHeader\n table,\n this.firstScreenRowLimit\n );\n // body\n createColGroup(\n bodyGroup,\n xOrigin,\n yOrigin,\n table.rowHeaderLevelCount, // colStart\n table.colCount - 1, // colEnd\n table.columnHeaderLevelCount, // rowStart\n table.rowCount - 1, // rowEnd\n 'body', // isHeader\n table,\n this.firstScreenRowLimit\n );\n\n // 更新row信息\n if (!bodyGroup.firstChild) {\n // 无数据\n this.currentRow = this.totalRow;\n this.rowEnd = this.currentRow;\n this.rowUpdatePos = this.rowEnd;\n this.referenceRow = Math.floor((this.rowEnd - this.rowStart) / 2);\n } else {\n this.currentRow = (bodyGroup.firstChild as Group)?.rowNumber ?? this.totalRow;\n this.rowEnd = this.currentRow;\n this.rowUpdatePos = this.rowEnd;\n this.referenceRow = Math.floor((this.rowEnd - this.rowStart) / 2);\n // 开始异步任务\n await this.progress();\n }\n }\n\n // async progress() {\n // if (this.rowUpdatePos < this.rowEnd) {\n // console.log('progress rowUpdatePos', this.rowUpdatePos);\n // // 先更新\n // await this.updateCellGroupsAsync();\n // await this.progress();\n // } else if (this.currentRow < this.totalRow) {\n // console.log('progress currentRow', this.currentRow);\n // // 先更新没有需要更新的节点,在生成新节点\n // await this.createRow();\n // await this.progress();\n // }\n // }\n async progress() {\n return new Promise<void>((resolve, reject) => {\n setTimeout(() => {\n if (this.rowUpdatePos < this.rowEnd) {\n // console.log('progress rowUpdatePos', this.rowUpdatePos);\n // 先更新\n this.updateCellGroupsAsync();\n this.progress();\n } else if (this.currentRow < this.totalRow) {\n // console.log('progress currentRow', this.currentRow);\n // 先更新没有需要更新的节点,在生成新节点\n this.createRow();\n this.progress();\n }\n\n resolve();\n }, 0);\n });\n }\n\n async createRow() {\n if (!this.taskRowCount) {\n return;\n }\n console.log('createRow', this.currentRow, this.currentRow + this.taskRowCount);\n this.createRowCellGroup(this.taskRowCount);\n }\n\n createRowCellGroup(onceCount: number) {\n const endRow = Math.min(this.totalRow, this.currentRow + onceCount);\n let maxHeight = 0;\n for (let col = this.bodyLeftCol; col <= this.bodyRightCol; col++) {\n const colGroup = this.table.scenegraph.getColGroup(col);\n const cellType = col < this.table.rowHeaderLevelCount ? 'rowHeader' : 'body';\n const { height } = createComplexColumn(\n colGroup,\n col,\n colGroup.attribute.width,\n this.currentRow + 1,\n endRow,\n this.table.scenegraph.mergeMap,\n this.table.internalProps.defaultRowHeight,\n this.table,\n cellType\n );\n maxHeight = Math.max(maxHeight, height);\n }\n this.table.scenegraph.bodyGroup.setAttribute('height', maxHeight);\n\n if (this.table.internalProps.autoRowHeight) {\n updateAutoRow(\n this.bodyLeftCol, // colStart\n this.bodyRightCol, // colEnd\n this.currentRow + 1, // rowStart\n endRow, // rowEnd\n this.table\n );\n }\n this.currentRow = endRow;\n this.rowEnd = endRow;\n this.rowUpdatePos = this.rowEnd;\n this.referenceRow = Math.floor((endRow - this.rowStart) / 2);\n\n // update container group size and border\n this.table.scenegraph.updateContainer();\n this.table.scenegraph.updateBorderSizeAndPosition();\n }\n\n async setY(y: number) {\n if (y < this.yLimitTop && this.rowStart === this.bodyTopRow) {\n // 执行真实body group坐标修改\n this.table.scenegraph.setBodyAndRowHeaderY(-y);\n } else if (y > this.yLimitBottom && this.rowEnd === this.bodyBottomRow) {\n // 执行真实body group坐标修改\n this.table.scenegraph.setBodyAndRowHeaderY(-y);\n } else {\n // 执行动态更新节点\n this.dynamicSetY(y);\n }\n }\n\n async dynamicSetY(y: number) {\n // 计算变动row range\n // const screenTopRow = this.table.getRowAt(y).row;\n const screenTop = (this.table as any).getTargetRowAt(y + this.table.scenegraph.colHeaderGroup.attribute.height);\n if (!screenTop) {\n return;\n }\n const screenTopRow = screenTop.row;\n this.y = y;\n this.screenTopRow = screenTopRow;\n // this.screenTopRowDeltaY = y - this.table.getRowsHeight(this.bodyTopRow, screenTopRow - 1);\n const deltaRow = screenTopRow - this.referenceRow;\n if (deltaRow > 0) {\n // 向下滚动,顶部cell group移到底部\n this.moveCell(deltaRow, 'up', screenTopRow);\n this.updateBody(y);\n // if (this.rowEnd === this.table.scenegraph.proxy.bodyBottomRow) {\n // const totalHeight = this.table.getAllRowsHeight();\n // const top = totalHeight - this.table.scenegraph.height;\n // this.updateBody(top);\n // } else {\n // this.updateBody(y);\n // }\n } else if (deltaRow < 0) {\n // 向上滚动,底部cell group移到顶部\n this.moveCell(-deltaRow, 'down', screenTopRow);\n this.updateBody(y);\n // if (this.rowStart === this.bodyTopRow) {\n // this.updateBody(0);\n // } else {\n // this.updateBody(y);\n // }\n } else {\n // 不改变row,更新body group范围\n this.updateBody(y);\n }\n\n this.table.scenegraph.updateNextFrame();\n }\n\n updateBody(y: number) {\n this.table.scenegraph.setBodyAndRowHeaderY(-y);\n }\n\n async moveCell(count: number, direction: 'up' | 'down', screenTopRow: number) {\n // 限制count范围\n if (direction === 'up' && this.rowEnd + count > this.bodyBottomRow) {\n count = this.bodyBottomRow - this.rowEnd;\n } else if (direction === 'down' && this.rowStart - count < this.bodyTopRow) {\n count = this.rowStart - this.bodyTopRow;\n }\n\n // 两种更新模式\n // 1. count < rowEnd - rowStart:从顶/底部移动count数量的单元格到底/顶部\n // 2. count >= rowEnd - rowStart:整体移动到目标位置\n if (count < this.rowEnd - this.rowStart) {\n // 计算更新区域\n const startRow = direction === 'up' ? this.rowStart : this.rowEnd - count + 1;\n const endRow = direction === 'up' ? this.rowStart + count - 1 : this.rowEnd;\n // console.log('move', startRow, endRow, direction);\n for (let col = this.bodyLeftCol; col <= this.bodyRightCol; col++) {\n const colGroup = this.table.scenegraph.getColGroup(col);\n for (let row = startRow; row <= endRow; row++) {\n if (direction === 'up') {\n const cellGroup = colGroup.firstChild as Group;\n this.updateCellGroupPosition(\n cellGroup,\n (colGroup.lastChild as Group).row + 1,\n (colGroup.lastChild as Group).attribute.y + (colGroup.lastChild as Group).attribute.height\n );\n colGroup.appendChild(cellGroup);\n } else {\n const cellGroup = colGroup.lastChild as Group;\n this.updateCellGroupPosition(\n cellGroup,\n (colGroup.firstChild as Group).row - 1,\n (colGroup.firstChild as Group).attribute.y - cellGroup.attribute.height\n );\n colGroup.insertBefore(cellGroup, colGroup.firstChild);\n }\n }\n }\n const distStartRow = direction === 'up' ? this.rowEnd + 1 : this.rowStart - count;\n const distEndRow = direction === 'up' ? this.rowEnd + count : this.rowStart - 1;\n\n // 更新同步范围\n const syncTopRow = Math.max(this.bodyTopRow, screenTopRow - this.screenRowCount * 2);\n const syncBottomRow = Math.min(this.bodyBottomRow, screenTopRow + this.screenRowCount * 3);\n for (let col = this.bodyLeftCol; col <= this.bodyRightCol; col++) {\n for (let row = syncTopRow; row <= syncBottomRow; row++) {\n // const cellGroup = this.table.scenegraph.getCell(col, row);\n const cellGroup = this.highPerformanceGetCell(col, row, distStartRow, distEndRow);\n this.updateCellGroupContent(cellGroup);\n }\n }\n if (this.table.internalProps.autoRowHeight) {\n updateAutoRow(\n this.bodyLeftCol, // colStart\n this.bodyRightCol, // colEnd\n syncTopRow, // rowStart\n syncBottomRow, // rowEnd\n this.table,\n direction\n );\n }\n\n this.rowStart = direction === 'up' ? this.rowStart + count : this.rowStart - count;\n this.rowEnd = direction === 'up' ? this.rowEnd + count : this.rowEnd - count;\n this.currentRow = direction === 'up' ? this.currentRow + count : this.currentRow - count;\n this.totalRow = direction === 'up' ? this.totalRow + count : this.totalRow - count;\n this.referenceRow = this.rowStart + Math.floor((this.rowEnd - this.rowStart) / 2);\n this.rowUpdatePos = distStartRow;\n this.rowUpdateDirection = direction;\n console.log('move end proxy', this.rowStart, this.rowEnd);\n console.log(\n 'move end cell',\n (this.table as any).scenegraph.bodyGroup.firstChild.firstChild.row,\n (this.table as any).scenegraph.bodyGroup.firstChild.lastChild.row\n );\n\n this.table.scenegraph.stage.render();\n await this.progress();\n } else {\n const distStartRow = direction === 'up' ? this.rowStart + count : this.rowStart - count;\n const distEndRow = direction === 'up' ? this.rowEnd + count : this.rowEnd - count;\n const distStartRowY = this.table.getRowsHeight(this.bodyTopRow, distStartRow - 1);\n for (let col = this.bodyLeftCol; col <= this.bodyRightCol; col++) {\n const colGroup = this.table.scenegraph.getColGroup(col);\n colGroup.forEachChildren((cellGroup: Group, index) => {\n // 这里使用colGroup变量而不是for this.rowStart to this.rowEndthis.rowEnd是因为在更新内可能出现row号码重复的情况\n this.updateCellGroupPosition(\n cellGroup,\n direction === 'up' ? cellGroup.row + count : cellGroup.row - count,\n index === 0 // row === this.rowStart\n ? distStartRowY\n : (cellGroup._prev as Group).attribute.y + (cellGroup._prev as Group).attribute.height\n );\n });\n }\n\n // 更新同步范围\n let syncTopRow;\n let syncBottomRow;\n if (this.table.internalProps.autoRowHeight) {\n syncTopRow = distStartRow;\n syncBottomRow = distEndRow;\n } else {\n syncTopRow = Math.max(this.bodyTopRow, screenTopRow - this.screenRowCount * 2);\n syncBottomRow = Math.min(this.bodyBottomRow, screenTopRow + this.screenRowCount * 3);\n }\n console.log('更新同步范围', syncTopRow, syncBottomRow);\n for (let col = this.bodyLeftCol; col <= this.bodyRightCol; col++) {\n for (let row = syncTopRow; row <= syncBottomRow; row++) {\n // const cellGroup = this.table.scenegraph.getCell(col, row);\n const cellGroup = this.highPerformanceGetCell(col, row, distStartRow, distEndRow);\n this.updateCellGroupContent(cellGroup);\n }\n }\n console.log('updateAutoRow', distEndRow > this.bodyBottomRow - (this.rowEnd - this.rowStart + 1) ? 'down' : 'up');\n\n if (this.table.internalProps.autoRowHeight) {\n updateAutoRow(\n this.bodyLeftCol, // colStart\n this.bodyRightCol, // colEnd\n syncTopRow, // rowStart\n syncBottomRow, // rowEnd\n this.table,\n distEndRow > this.bodyBottomRow - (this.rowEnd - this.rowStart + 1) ? 'down' : 'up' // 跳转到底部时,从下向上对齐\n );\n }\n\n this.rowStart = distStartRow;\n this.rowEnd = distEndRow;\n this.currentRow = direction === 'up' ? this.currentRow + count : this.currentRow - count;\n this.totalRow = direction === 'up' ? this.totalRow + count : this.totalRow - count;\n this.referenceRow = this.rowStart + Math.floor((this.rowEnd - this.rowStart) / 2);\n this.rowUpdatePos = this.rowStart;\n this.rowUpdateDirection = distEndRow > this.bodyBottomRow - (this.rowEnd - this.rowStart + 1) ? 'down' : 'up';\n console.log('move total end proxy', this.rowStart, this.rowEnd);\n console.log(\n 'move total end cell',\n (this.table as any).scenegraph.bodyGroup.firstChild.firstChild.row,\n (this.table as any).scenegraph.bodyGroup.firstChild.lastChild.row\n );\n\n if (!this.table.internalProps.autoRowHeight) {\n await this.progress();\n }\n }\n }\n\n async updateCellGroupsAsync() {\n this.updateCellGroups(this.taskRowCount);\n }\n\n updateCellGroups(count: number) {\n const distRow = Math.min(this.bodyBottomRow, this.rowUpdatePos + count);\n console.log('updateCellGroups', this.rowUpdatePos, distRow);\n for (let col = this.bodyLeftCol; col <= this.bodyRightCol; col++) {\n for (let row = this.rowUpdatePos; row <= distRow; row++) {\n // const cellGroup = this.table.scenegraph.getCell(col, row);\n const cellGroup = this.highPerformanceGetCell(col, row);\n this.updateCellGroupContent(cellGroup);\n }\n }\n\n if (this.table.internalProps.autoRowHeight) {\n updateAutoRow(\n this.bodyLeftCol, // colStart\n this.bodyRightCol, // colEnd\n this.rowUpdatePos, // rowStart\n distRow, // rowEnd\n this.table,\n this.rowUpdateDirection\n );\n }\n\n this.rowUpdatePos = distRow + 1;\n }\n\n updateCellGroupPosition(cellGroup: Group, newRow: number, y: number) {\n // 更新位置&row\n cellGroup.row = newRow;\n cellGroup.setAttribute('y', y);\n (cellGroup as any).needUpdate = true;\n (cellGroup as any).needUpdateForAutoRowHeight = true;\n }\n\n updateCellGroupContent(cellGroup: Group) {\n if (!cellGroup.needUpdate) {\n return;\n }\n\n this.table.scenegraph.updateCellContent(cellGroup.col, cellGroup.row);\n // 更新内容\n // const textMark = cellGroup.firstChild as WrapText;\n // const autoWrapText = Array.isArray(textMark.attribute.text);\n // const textStr: string = this.table.getCellValue(cellGroup.col, cellGroup.row);\n // let text;\n // if (autoWrapText) {\n // text = String(textStr).replace(/\\r?\\n/g, '\\n').replace(/\\r/g, '\\n').split('\\n');\n // } else {\n // text = textStr;\n // }\n\n // textMark.setAttribute('text', text);\n\n cellGroup.needUpdate = false;\n }\n\n async sortCell() {\n for (let col = this.bodyLeftCol; col <= this.bodyRightCol; col++) {\n for (let row = this.rowStart; row <= this.rowEnd; row++) {\n // const cellGroup = this.table.scenegraph.getCell(col, row);\n const cellGroup = this.highPerformanceGetCell(col, row);\n cellGroup.needUpdate = true;\n }\n }\n\n // 更新同步范围\n let syncTopRow;\n let syncBottomRow;\n if (this.table.internalProps.autoRowHeight) {\n syncTopRow = this.rowStart;\n syncBottomRow = this.rowEnd;\n } else {\n syncTopRow = Math.max(this.bodyTopRow, this.screenTopRow - this.screenRowCount * 2);\n syncBottomRow = Math.min(this.bodyBottomRow, this.screenTopRow + this.screenRowCount * 3);\n }\n console.log('sort更新同步范围', syncTopRow, syncBottomRow);\n for (let col = this.bodyLeftCol; col <= this.bodyRightCol; col++) {\n for (let row = syncTopRow; row <= syncBottomRow; row++) {\n // const cellGroup = this.table.scenegraph.getCell(col, row);\n const cellGroup = this.highPerformanceGetCell(col, row);\n this.updateCellGroupContent(cellGroup);\n }\n }\n console.log('updateAutoRow', this.rowEnd > this.bodyBottomRow - (this.rowEnd - this.rowStart + 1) ? 'down' : 'up');\n if (this.table.internalProps.autoRowHeight) {\n updateAutoRow(\n this.bodyLeftCol, // colStart\n this.bodyRightCol, // colEnd\n syncTopRow, // rowStart\n syncBottomRow, // rowEnd\n this.table,\n this.rowEnd > this.bodyBottomRow - (this.rowEnd - this.rowStart + 1) ? 'down' : 'up' // 跳转到底部时,从下向上对齐\n );\n }\n this.rowUpdatePos = this.rowStart;\n this.rowUpdateDirection = this.rowEnd > this.bodyBottomRow - (this.rowEnd - this.rowStart + 1) ? 'down' : 'up';\n\n if (\n this.rowEnd === this.table.scenegraph.proxy.bodyBottomRow &&\n this.rowStart === this.table.scenegraph.proxy.bodyTopRow\n ) {\n // 全量更新,do nothing\n } else if (this.rowEnd === this.table.scenegraph.proxy.bodyBottomRow) {\n const totalHeight = this.table.getAllRowsHeight();\n const top = totalHeight - this.table.scenegraph.height;\n this.updateBody(top);\n } else if (this.rowStart === this.table.scenegraph.proxy.bodyTopRow) {\n this.updateBody(0);\n }\n\n if (!this.table.internalProps.autoRowHeight) {\n await this.progress();\n }\n }\n\n highPerformanceGetCell(col: number, row: number, rowStart: number = this.rowStart, rowEnd: number = this.rowEnd) {\n if (row < rowStart || row > rowEnd) {\n return emptyGroup;\n }\n if (this.cellCache.get(col)) {\n const cacheCellGoup = this.cellCache.get(col);\n if ((cacheCellGoup._next || cacheCellGoup._prev) && Math.abs(cacheCellGoup.row - row) < row) {\n // 由缓存单元格向前后查找要快于从头查找\n let cellGroup = getCellByCache(cacheCellGoup, row);\n if (!cellGroup) {\n cellGroup = this.table.scenegraph.getCell(col, row);\n }\n cellGroup.row && this.cellCache.set(col, cellGroup);\n return cellGroup;\n }\n const cellGroup = this.table.scenegraph.getCell(col, row);\n cellGroup.row && this.cellCache.set(col, cellGroup);\n return cellGroup;\n }\n const cellGroup = this.table.scenegraph.getCell(col, row);\n cellGroup.row && this.cellCache.set(col, cellGroup);\n return cellGroup;\n }\n}\n\nfunction updateAutoRow(\n colStart: number,\n colEnd: number,\n rowStart: number,\n rowEnd: number,\n table: BaseTableAPI,\n direction: 'up' | 'down' = 'up'\n) {\n // 获取行高\n for (let row = rowStart; row <= rowEnd; row++) {\n let maxRowHeight = 0;\n for (let col = colStart; col <= colEnd; col++) {\n const cellGroup = table.scenegraph.getCell(col, row);\n if (!cellGroup.row) {\n continue;\n }\n // const contentHeight = cellGroup.getContentHeight();\n const text = (cellGroup.getChildByName('text') as WrapText) || cellGroup.getChildByName('content');\n const headerStyle = table._getCellStyle(col, row);\n const padding = getQuadProps(getProp('padding', headerStyle, col, row, table));\n const height = text.AABBBounds.height() + (padding[0] + padding[2]);\n maxRowHeight = Math.max(maxRowHeight, height);\n (cellGroup as any).needUpdateForAutoRowHeight = false;\n }\n // updateRowHeight(table.scenegraph, row, table.getRowHeight(row) - maxRowHeight);\n for (let col = colStart; col <= colEnd; col++) {\n const cellGroup = table.scenegraph.getCell(col, row);\n updateCellHeightForColumn(table.scenegraph, cellGroup, col, row, maxRowHeight, 0, false);\n }\n\n table.setRowHeight(row, maxRowHeight, true);\n }\n\n // 更新y位置\n if (direction === 'up') {\n for (let col = colStart; col <= colEnd; col++) {\n for (let row = rowStart; row <= rowEnd; row++) {\n const cellGroup = table.scenegraph.getCell(col, row);\n if (!cellGroup.row) {\n continue;\n }\n let y;\n if (cellGroup._prev) {\n y = ((cellGroup._prev as Group)?.attribute.y ?? 0) + ((cellGroup._prev as Group)?.attribute.height ?? 0);\n } else {\n // 估计位置\n y = table.getRowsHeight(table.columnHeaderLevelCount, cellGroup.row - 1);\n }\n cellGroup.setAttribute('y', y);\n }\n }\n } else {\n for (let col = colStart; col <= colEnd; col++) {\n for (let row = rowEnd; row >= rowStart; row--) {\n const cellGroup = table.scenegraph.getCell(col, row);\n if (!cellGroup.row) {\n continue;\n }\n let y;\n if (cellGroup._next) {\n y = ((cellGroup._next as Group)?.attribute.y ?? 0) - (cellGroup.attribute.height ?? 0);\n } else {\n // 估计位置\n y = table.getRowsHeight(table.columnHeaderLevelCount, cellGroup.row) - (cellGroup.attribute.height ?? 0);\n console.log('估计位置', table.getRowsHeight(table.columnHeaderLevelCount, cellGroup.row));\n }\n cellGroup.setAttribute('y', y);\n }\n }\n }\n}\n\nfunction getCellByCache(cacheCellGroup: Group, row: number): Group | null {\n if (!cacheCellGroup) {\n return null;\n }\n if (cacheCellGroup.row === row) {\n return cacheCellGroup;\n } else if (cacheCellGroup.row > row) {\n return getCellByCache(cacheCellGroup._prev as Group, row);\n }\n return getCellByCache(cacheCellGroup._next as Group, row);\n}\n"]}
|
|
@@ -22,7 +22,7 @@ export function updateAutoRowHeight(scene, clearCellSize) {
|
|
|
22
22
|
if (row === scene.table.columnHeaderLevelCount) {
|
|
23
23
|
let colHeaderHeight = 0;
|
|
24
24
|
null === (_a = null == colHeader ? void 0 : colHeader.firstChild) || void 0 === _a || _a.forEachChildren((cell => {
|
|
25
|
-
colHeaderHeight += cell.attribute.height;
|
|
25
|
+
"shadow-cell" !== cell.role && (colHeaderHeight += cell.attribute.height);
|
|
26
26
|
})), colHeader.setAttribute("height", colHeaderHeight), cornerHeader.setAttribute("height", colHeaderHeight),
|
|
27
27
|
rowHeader.setAttribute("y", colHeaderHeight), body.setAttribute("y", colHeaderHeight),
|
|
28
28
|
yTemp = 0;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["scenegraph/layout/auto-height.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAE,yBAAyB,EAAE,MAAM,iBAAiB,CAAC;AAS5D,MAAM,UAAU,mBAAmB,CAAC,KAAiB,EAAE,aAAuB;;IAC5E,MAAM,SAAS,GAAG,KAAK,CAAC,cAAc,CAAC;IACvC,MAAM,SAAS,GAAG,KAAK,CAAC,cAAc,CAAC;IACvC,MAAM,YAAY,GAAG,KAAK,CAAC,iBAAiB,CAAC;IAC7C,MAAM,IAAI,GAAG,KAAK,CAAC,SAAS,CAAC;IAG7B,KAAK,IAAI,GAAG,GAAG,CAAC,EAAE,GAAG,IAAI,KAAK,CAAC,UAAU,EAAE,GAAG,EAAE,EAAE;QAChD,IAAI,YAAY,GAAG,CAAC,CAAC;QACrB,KAAK,IAAI,GAAG,GAAG,CAAC,EAAE,GAAG,GAAG,KAAK,CAAC,KAAK,CAAC,QAAQ,EAAE,GAAG,EAAE,EAA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auto-height.js","sourcesContent":["import type { Group } from '../graphic/group';\nimport type { Scenegraph } from '../scenegraph';\nimport { getCellMergeInfo } from '../utils/get-cell-merge';\nimport { updateCellHeightForColumn } from './update-height';\n\n/**\n * @description: 场景树节点生成后,处理自动列宽\n * @param {Scenegraph} scene\n * @param {boolean} clearCellSize 是否重新计算单元格高度,false的话使用目前cell记录的高度,true重新计算当前宽度的情况下单元格内容高度;\n * 在调整列宽时为true,在场景结点生成后为false\n * @return {*}\n */\nexport function updateAutoRowHeight(scene: Scenegraph, clearCellSize?: boolean) {\n const colHeader = scene.colHeaderGroup;\n const rowHeader = scene.rowHeaderGroup;\n const cornerHeader = scene.cornerHeaderGroup;\n const body = scene.bodyGroup;\n\n // 获取行高\n for (let row = 0; row <= scene.bodyRowEnd; row++) {\n let maxRowHeight = 0;\n for (let col = 0; col < scene.table.colCount; col++) {\n const cellGroup = scene.getCell(col, row);\n // maxRowHeight = Math.max(maxRowHeight, cellGroup.attribute.height);\n const mergeInfo = getCellMergeInfo(scene.table, cellGroup.col, cellGroup.row);\n if (mergeInfo) {\n const mergeCell = scene.getCell(mergeInfo.start.col, mergeInfo.start.row);\n maxRowHeight = Math.max(\n maxRowHeight,\n mergeCell.attribute.height / (mergeInfo.end.row - mergeInfo.start.row + 1)\n );\n } else {\n maxRowHeight = Math.max(maxRowHeight, cellGroup.attribute.height);\n }\n }\n scene.table.setRowHeight(row, maxRowHeight, true);\n }\n\n // 设置行高\n let yTemp = 0;\n for (let row = 0; row <= scene.bodyRowEnd; row++) {\n const maxRowHeight = scene.table.getRowHeight(row);\n if (row === scene.table.columnHeaderLevelCount) {\n // 更新行表头行高\n let colHeaderHeight = 0;\n colHeader?.firstChild?.forEachChildren((cell: Group) => {\n if (cell.role !== 'shadow-cell') {\n colHeaderHeight += cell.attribute.height;\n }\n });\n colHeader.setAttribute('height', colHeaderHeight);\n cornerHeader.setAttribute('height', colHeaderHeight);\n rowHeader.setAttribute('y', colHeaderHeight);\n body.setAttribute('y', colHeaderHeight);\n\n yTemp = 0;\n }\n\n for (let col = 0; col < scene.table.colCount; col++) {\n const cellGroup = scene.getCell(col, row);\n updateCellHeight(cellGroup, scene, col, row, maxRowHeight, yTemp);\n }\n yTemp += maxRowHeight;\n }\n\n // 更新容器尺寸\n rowHeader.setAttribute('height', yTemp);\n body.setAttribute('height', yTemp);\n}\n\n// 更新单元格高度信息\nfunction updateCellHeight(\n cell: Group,\n scene: Scenegraph,\n col: number,\n row: number,\n maxRowHeight: number,\n yTemp: number,\n column?: Group\n) {\n const mergeInfo = getCellMergeInfo(scene.table, col, row);\n if (mergeInfo && mergeInfo.end.row - mergeInfo.start.row) {\n cell = scene.getCell(mergeInfo.start.col, mergeInfo.start.row);\n if (row === mergeInfo.start.row) {\n cell.setAttribute('y', yTemp);\n }\n\n updateCellHeightForColumn(scene, cell, col, row, maxRowHeight, 0, scene.table.isHeader(col, row));\n } else if (cell.role !== 'shadow-cell') {\n cell.setAttribute('y', yTemp);\n\n updateCellHeightForColumn(scene, cell, col, row, maxRowHeight, 0, scene.table.isHeader(col, row));\n }\n}\n"]}
|
|
@@ -2,7 +2,7 @@ import { dealWithCustom } from "../component/custom";
|
|
|
2
2
|
|
|
3
3
|
import { getCellMergeInfo } from "../utils/get-cell-merge";
|
|
4
4
|
|
|
5
|
-
import {
|
|
5
|
+
import { getQuadProps } from "../utils/padding";
|
|
6
6
|
|
|
7
7
|
import { updateCellContentWidth } from "../utils/text-icon-layout";
|
|
8
8
|
|
|
@@ -62,7 +62,7 @@ function updateCell(cellGroup, width, scene) {
|
|
|
62
62
|
const oldWidth = cellGroup.attribute.width;
|
|
63
63
|
cellGroup.setAttribute("width", width);
|
|
64
64
|
const style = scene.table._getCellStyle(cellGroup.col, cellGroup.row);
|
|
65
|
-
updateCellContentWidth(cellGroup, width, width - oldWidth, scene.table.internalProps.autoRowHeight,
|
|
65
|
+
updateCellContentWidth(cellGroup, width, width - oldWidth, scene.table.internalProps.autoRowHeight, getQuadProps(style.padding), style.textAlign, style.textBaseline, scene);
|
|
66
66
|
const customContainer = cellGroup.getChildByName("custom-container");
|
|
67
67
|
if (customContainer) {
|
|
68
68
|
let customRender, customLayout;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["scenegraph/layout/auto-width.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAGrD,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,sBAAsB,EAAE,MAAM,2BAA2B,CAAC;AAOnE,MAAM,UAAU,kBAAkB,CAAC,KAAiB;;IAClD,MAAM,UAAU,GAAgB,EAAE,CAAC;IAEnC,MAAM,EAAE,SAAS,EAAE,GAAG,KAAK,CAAC,KAAK,CAAC,aAAa,CAAC;IAGhD,KAAK,IAAI,GAAG,GAAG,CAAC,EAAE,GAAG,GAAG,KAAK,CAAC,KAAK,CAAC,QAAQ,EAAE,GAAG,EAAE,EAAE;QACnD,IAAI,cAAc,GAAG,CAAC,CAAC;QACvB,MAAM,MAAM,GAAG,CAAA,MAAA,SAAS,CAAC,YAAY,0CAAG,GAAG,CAAC,KAAI,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC;QAClE,IAAI,MAAM,CAAC,KAAK,KAAK,MAAM,IAAI,KAAK,CAAC,SAAS,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,SAAS,KAAK,WAAW,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE;YAE1G,MAAM,eAAe,GAAG,KAAK,CAAC,WAAW,CAAC,GAAG,EAAE,IAAI,CAAU,CAAC;YAC9D,IAAI,eAAe,EAAE;gBACnB,eAAe,CAAC,eAAe,CAAC,CAAC,IAAW,EAAE,GAAW,EAAE,EAAE;oBAE3D,MAAM,SAAS,GAAG,gBAAgB,CAAC,KAAK,CAAC,KAAK,EAAE,GAAG,EAAE,GAA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AAC,KAAK,CAAC,eAAe,CAAC,SAAS,CAAC,GAAG,EAAE,SAAS,CAAC,GAAG,CAAC,CAAC;YACzE,YAAY,GAAG,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,kBAAkB,CAAC;YAC1C,YAAY,GAAG,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,kBAAkB,CAAC;SAC3C;aAAM;YACL,MAAM,MAAM,GAAG,KAAK,CAAC,KAAK,CAAC,mBAAmB,CAAC,SAAS,CAAC,GAAG,EAAE,SAAS,CAAC,GAAG,CAAC,CAAC;YAC7E,YAAY,GAAG,CAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,YAAY,KAAI,KAAK,CAAC,KAAK,CAAC,YAAY,CAAC;YAChE,YAAY,GAAG,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,YAAY,CAAC;SACrC;QACD,MAAM,YAAY,GAAG,cAAc,CACjC,YAAY,EACZ,YAAY,EACZ,SAAS,CAAC,GAAG,EACb,SAAS,CAAC,GAAG,EACb,SAAS,CAAC,SAAS,CAAC,KAAK,EACzB,SAAS,CAAC,SAAS,CAAC,MAAM,EAC1B,KAAK,EACL,KAAK,EACL,KAAK,CAAC,KAAK,CACZ,CAAC;QACF,SAAS,CAAC,WAAW,CAAC,YAAY,CAAC,aAAa,CAAC,CAAC;KACnD;AACH,CAAC","file":"auto-width.js","sourcesContent":["import type { CellRange } from '../../ts-types';\nimport { dealWithCustom } from '../component/custom';\nimport type { Group } from '../graphic/group';\nimport type { Scenegraph } from '../scenegraph';\nimport { getCellMergeInfo } from '../utils/get-cell-merge';\nimport { getPadding } from '../utils/padding';\nimport { updateCellContentWidth } from '../utils/text-icon-layout';\n\n/**\n * @description: 场景树节点生成后,处理自动行高\n * @param {Scenegraph} scene\n * @return {*}\n */\nexport function updateAutoColWidth(scene: Scenegraph) {\n const mergeCells: CellRange[] = [];\n\n const { layoutMap } = scene.table.internalProps;\n // const { width: defineWidth } = layoutMap.columnWidths?.[col] || {};\n // layoutMap.columnWidths.forEach((column: any, index: number) => {\n for (let col = 0; col < scene.table.colCount; col++) {\n let columnMaxWidth = 0;\n const column = layoutMap.columnWidths?.[col] || { width: 'auto' };\n if (column.width === 'auto' || scene.transpose || (scene.table.widthMode === 'autoWidth' && !column.width)) {\n // 找到colHeader index列最大宽度\n const colHeaderColumn = scene.getColGroup(col, true) as Group;\n if (colHeaderColumn) {\n colHeaderColumn.forEachChildren((cell: Group, row: number) => {\n // 处理Merge情况,宽度度均分\n const mergeInfo = getCellMergeInfo(scene.table, col, row);\n if (mergeInfo) {\n const mergeCell = scene.getCell(mergeInfo.start.col, mergeInfo.start.row);\n columnMaxWidth = Math.max(\n columnMaxWidth,\n mergeCell.attribute.width / (mergeInfo.end.col - mergeInfo.start.col + 1)\n );\n } else {\n columnMaxWidth = Math.max(columnMaxWidth, cell.attribute.width);\n }\n });\n }\n\n const rowHeaderOrBodyColumn: Group = scene.getColGroup(col);\n rowHeaderOrBodyColumn.forEachChildren((cell: Group) => {\n // columnMaxWidth = Math.max(columnMaxWidth, cell.attribute.width);\n // 处理Merge情况,宽度度均分\n const mergeInfo = getCellMergeInfo(scene.table, cell.col, cell.row);\n if (mergeInfo) {\n const mergeCell = scene.getCell(mergeInfo.start.col, mergeInfo.start.row);\n columnMaxWidth = Math.max(\n columnMaxWidth,\n mergeCell.attribute.width / (mergeInfo.end.col - mergeInfo.start.col + 1)\n );\n } else {\n columnMaxWidth = Math.max(columnMaxWidth, cell.attribute.width);\n }\n });\n\n // 更新列宽与后续列位置\n if (colHeaderColumn) {\n const colHeaderColumnDetaWidth = colHeaderColumn.attribute.width - columnMaxWidth;\n if (colHeaderColumnDetaWidth) {\n colHeaderColumn.setAttribute('width', columnMaxWidth);\n colHeaderColumn.parent.forEachChildren((column: Group) => {\n const columnCol = column.col;\n if (columnCol > col) {\n column.setAttribute('x', column.attribute.x - colHeaderColumnDetaWidth);\n }\n });\n }\n // 更新最大列宽到column theme\n colHeaderColumn.setAttribute('width', columnMaxWidth);\n\n // 更新最大列宽到column cell\n colHeaderColumn.forEachChildren((cell: Group, row: number) => {\n const mergeInfo = getCellMergeInfo(scene.table, cell.col, cell.row);\n if (mergeInfo && mergeInfo.start.col !== mergeInfo.end.col) {\n // 处理Merge情况,跨行Merge单元格宽度最后统一处理\n mergeCells.push(mergeInfo);\n } else if (cell.role !== 'shadow-cell') {\n // cell.setAttribute('width', columnMaxWidth);\n updateCell(cell, columnMaxWidth, scene);\n }\n });\n }\n\n // 更新列宽与后续列位置\n const rowHeaderOrBodyColumnDetaWidth = rowHeaderOrBodyColumn.attribute.width - columnMaxWidth;\n if (rowHeaderOrBodyColumnDetaWidth) {\n rowHeaderOrBodyColumn.setAttribute('width', columnMaxWidth);\n rowHeaderOrBodyColumn.parent.forEachChildren((column: Group) => {\n const columnCol = column.col;\n if (columnCol > col) {\n column.setAttribute('x', column.attribute.x - rowHeaderOrBodyColumnDetaWidth);\n }\n });\n }\n // 更新最大列宽到column theme\n rowHeaderOrBodyColumn.setAttribute('width', columnMaxWidth);\n\n // 更新最大列宽到column cell\n rowHeaderOrBodyColumn.forEachChildren((cell: Group, row: number) => {\n const mergeInfo = getCellMergeInfo(scene.table, cell.col, cell.row);\n if (mergeInfo && mergeInfo.start.col !== mergeInfo.end.col) {\n // 处理Merge情况,跨行Merge单元格宽度最后统一处理\n mergeCells.push(mergeInfo);\n } else if (cell.role !== 'shadow-cell') {\n // cell.setAttribute('width', columnMaxWidth);\n updateCell(cell, columnMaxWidth, scene);\n }\n });\n\n // 更新table map列宽存储\n scene.table.setColWidth(col, columnMaxWidth, true);\n }\n }\n\n // 处理跨行Merge单元格\n for (let i = 0; i < mergeCells.length; i++) {\n const mergeInfo = mergeCells[i];\n const mergeCell = scene.getCell(mergeInfo.start.col, mergeInfo.start.row);\n let width = 0;\n for (let j = mergeInfo.start.col; j <= mergeInfo.end.col; j++) {\n width += scene.getColGroup(j).attribute.width;\n }\n\n updateCell(mergeCell, width, scene);\n }\n}\n\nfunction updateCell(cellGroup: Group, width: number, scene: Scenegraph) {\n const oldWidth = cellGroup.attribute.width;\n cellGroup.setAttribute('width', width);\n\n const style = scene.table._getCellStyle(cellGroup.col, cellGroup.row);\n updateCellContentWidth(\n cellGroup,\n width,\n width - oldWidth,\n scene.table.internalProps.autoRowHeight,\n getPadding(style.padding as number),\n style.textAlign,\n style.textBaseline,\n scene\n );\n\n // 处理自定义渲染\n const customContainer = cellGroup.getChildByName('custom-container') as Group;\n if (customContainer) {\n customContainer.clear();\n cellGroup.removeChild(customContainer);\n\n let customRender;\n let customLayout;\n const cellType = scene.table.getCellType(cellGroup.col, cellGroup.row);\n if (cellType !== 'body') {\n const define = scene.table.getHeaderDefine(cellGroup.col, cellGroup.row);\n customRender = define?.headerCustomRender;\n customLayout = define?.headerCustomLayout;\n } else {\n const define = scene.table.getBodyColumnDefine(cellGroup.col, cellGroup.row);\n customRender = define?.customRender || scene.table.customRender;\n customLayout = define?.customLayout;\n }\n const customResult = dealWithCustom(\n customLayout,\n customRender,\n cellGroup.col,\n cellGroup.row,\n cellGroup.attribute.width,\n cellGroup.attribute.height,\n false,\n false,\n scene.table\n );\n cellGroup.appendChild(customResult.elementsGroup);\n }\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["scenegraph/layout/auto-width.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAGrD,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,EAAE,sBAAsB,EAAE,MAAM,2BAA2B,CAAC;AAOnE,MAAM,UAAU,kBAAkB,CAAC,KAAiB;;IAClD,MAAM,UAAU,GAAgB,EAAE,CAAC;IAEnC,MAAM,EAAE,SAAS,EAAE,GAAG,KAAK,CAAC,KAAK,CAAC,aAAa,CAAC;IAGhD,KAAK,IAAI,GAAG,GAAG,CAAC,EAAE,GAAG,GAAG,K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G,EACb,SAAS,CAAC,GAAG,EACb,SAAS,CAAC,SAAS,CAAC,KAAK,EACzB,SAAS,CAAC,SAAS,CAAC,MAAM,EAC1B,KAAK,EACL,KAAK,EACL,KAAK,CAAC,KAAK,CACZ,CAAC;QACF,SAAS,CAAC,WAAW,CAAC,YAAY,CAAC,aAAa,CAAC,CAAC;KACnD;AACH,CAAC","file":"auto-width.js","sourcesContent":["import type { CellRange } from '../../ts-types';\nimport { dealWithCustom } from '../component/custom';\nimport type { Group } from '../graphic/group';\nimport type { Scenegraph } from '../scenegraph';\nimport { getCellMergeInfo } from '../utils/get-cell-merge';\nimport { getQuadProps } from '../utils/padding';\nimport { updateCellContentWidth } from '../utils/text-icon-layout';\n\n/**\n * @description: 场景树节点生成后,处理自动行高\n * @param {Scenegraph} scene\n * @return {*}\n */\nexport function updateAutoColWidth(scene: Scenegraph) {\n const mergeCells: CellRange[] = [];\n\n const { layoutMap } = scene.table.internalProps;\n // const { width: defineWidth } = layoutMap.columnWidths?.[col] || {};\n // layoutMap.columnWidths.forEach((column: any, index: number) => {\n for (let col = 0; col < scene.table.colCount; col++) {\n let columnMaxWidth = 0;\n const column = layoutMap.columnWidths?.[col] || { width: 'auto' };\n if (column.width === 'auto' || scene.transpose || (scene.table.widthMode === 'autoWidth' && !column.width)) {\n // 找到colHeader index列最大宽度\n const colHeaderColumn = scene.getColGroup(col, true) as Group;\n if (colHeaderColumn) {\n colHeaderColumn.forEachChildren((cell: Group, row: number) => {\n // 处理Merge情况,宽度度均分\n const mergeInfo = getCellMergeInfo(scene.table, col, row);\n if (mergeInfo) {\n const mergeCell = scene.getCell(mergeInfo.start.col, mergeInfo.start.row);\n columnMaxWidth = Math.max(\n columnMaxWidth,\n mergeCell.attribute.width / (mergeInfo.end.col - mergeInfo.start.col + 1)\n );\n } else {\n columnMaxWidth = Math.max(columnMaxWidth, cell.attribute.width);\n }\n });\n }\n\n const rowHeaderOrBodyColumn: Group = scene.getColGroup(col);\n rowHeaderOrBodyColumn.forEachChildren((cell: Group) => {\n // columnMaxWidth = Math.max(columnMaxWidth, cell.attribute.width);\n // 处理Merge情况,宽度度均分\n const mergeInfo = getCellMergeInfo(scene.table, cell.col, cell.row);\n if (mergeInfo) {\n const mergeCell = scene.getCell(mergeInfo.start.col, mergeInfo.start.row);\n columnMaxWidth = Math.max(\n columnMaxWidth,\n mergeCell.attribute.width / (mergeInfo.end.col - mergeInfo.start.col + 1)\n );\n } else {\n columnMaxWidth = Math.max(columnMaxWidth, cell.attribute.width);\n }\n });\n\n // 更新列宽与后续列位置\n if (colHeaderColumn) {\n const colHeaderColumnDetaWidth = colHeaderColumn.attribute.width - columnMaxWidth;\n if (colHeaderColumnDetaWidth) {\n colHeaderColumn.setAttribute('width', columnMaxWidth);\n colHeaderColumn.parent.forEachChildren((column: Group) => {\n const columnCol = column.col;\n if (columnCol > col) {\n column.setAttribute('x', column.attribute.x - colHeaderColumnDetaWidth);\n }\n });\n }\n // 更新最大列宽到column theme\n colHeaderColumn.setAttribute('width', columnMaxWidth);\n\n // 更新最大列宽到column cell\n colHeaderColumn.forEachChildren((cell: Group, row: number) => {\n const mergeInfo = getCellMergeInfo(scene.table, cell.col, cell.row);\n if (mergeInfo && mergeInfo.start.col !== mergeInfo.end.col) {\n // 处理Merge情况,跨行Merge单元格宽度最后统一处理\n mergeCells.push(mergeInfo);\n } else if (cell.role !== 'shadow-cell') {\n // cell.setAttribute('width', columnMaxWidth);\n updateCell(cell, columnMaxWidth, scene);\n }\n });\n }\n\n // 更新列宽与后续列位置\n const rowHeaderOrBodyColumnDetaWidth = rowHeaderOrBodyColumn.attribute.width - columnMaxWidth;\n if (rowHeaderOrBodyColumnDetaWidth) {\n rowHeaderOrBodyColumn.setAttribute('width', columnMaxWidth);\n rowHeaderOrBodyColumn.parent.forEachChildren((column: Group) => {\n const columnCol = column.col;\n if (columnCol > col) {\n column.setAttribute('x', column.attribute.x - rowHeaderOrBodyColumnDetaWidth);\n }\n });\n }\n // 更新最大列宽到column theme\n rowHeaderOrBodyColumn.setAttribute('width', columnMaxWidth);\n\n // 更新最大列宽到column cell\n rowHeaderOrBodyColumn.forEachChildren((cell: Group, row: number) => {\n const mergeInfo = getCellMergeInfo(scene.table, cell.col, cell.row);\n if (mergeInfo && mergeInfo.start.col !== mergeInfo.end.col) {\n // 处理Merge情况,跨行Merge单元格宽度最后统一处理\n mergeCells.push(mergeInfo);\n } else if (cell.role !== 'shadow-cell') {\n // cell.setAttribute('width', columnMaxWidth);\n updateCell(cell, columnMaxWidth, scene);\n }\n });\n\n // 更新table map列宽存储\n scene.table.setColWidth(col, columnMaxWidth, true);\n }\n }\n\n // 处理跨行Merge单元格\n for (let i = 0; i < mergeCells.length; i++) {\n const mergeInfo = mergeCells[i];\n const mergeCell = scene.getCell(mergeInfo.start.col, mergeInfo.start.row);\n let width = 0;\n for (let j = mergeInfo.start.col; j <= mergeInfo.end.col; j++) {\n width += scene.getColGroup(j).attribute.width;\n }\n\n updateCell(mergeCell, width, scene);\n }\n}\n\nfunction updateCell(cellGroup: Group, width: number, scene: Scenegraph) {\n const oldWidth = cellGroup.attribute.width;\n cellGroup.setAttribute('width', width);\n\n const style = scene.table._getCellStyle(cellGroup.col, cellGroup.row);\n updateCellContentWidth(\n cellGroup,\n width,\n width - oldWidth,\n scene.table.internalProps.autoRowHeight,\n getQuadProps(style.padding as number),\n style.textAlign,\n style.textBaseline,\n scene\n );\n\n // 处理自定义渲染\n const customContainer = cellGroup.getChildByName('custom-container') as Group;\n if (customContainer) {\n customContainer.clear();\n cellGroup.removeChild(customContainer);\n\n let customRender;\n let customLayout;\n const cellType = scene.table.getCellType(cellGroup.col, cellGroup.row);\n if (cellType !== 'body') {\n const define = scene.table.getHeaderDefine(cellGroup.col, cellGroup.row);\n customRender = define?.headerCustomRender;\n customLayout = define?.headerCustomLayout;\n } else {\n const define = scene.table.getBodyColumnDefine(cellGroup.col, cellGroup.row);\n customRender = define?.customRender || scene.table.customRender;\n customLayout = define?.customLayout;\n }\n const customResult = dealWithCustom(\n customLayout,\n customRender,\n cellGroup.col,\n cellGroup.row,\n cellGroup.attribute.width,\n cellGroup.attribute.height,\n false,\n false,\n scene.table\n );\n cellGroup.appendChild(customResult.elementsGroup);\n }\n}\n"]}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { BaseTableAPI } from '../../ts-types/base-table';
|
|
2
|
-
export declare function computeColsWidth(table: BaseTableAPI): void;
|
|
2
|
+
export declare function computeColsWidth(table: BaseTableAPI, update?: boolean): void;
|
|
3
3
|
export declare function computeColWidth(col: number, startRow: number, endRow: number, table: BaseTableAPI, forceCompute: boolean): number;
|
|
@@ -1,17 +1,19 @@
|
|
|
1
|
-
import { IconPosition } from "../../ts-types";
|
|
1
|
+
import { HierarchyState, IconPosition } from "../../ts-types";
|
|
2
2
|
|
|
3
3
|
import * as calc from "../../tools/calc";
|
|
4
4
|
|
|
5
5
|
import { validToString } from "../../tools/util";
|
|
6
6
|
|
|
7
|
-
import {
|
|
7
|
+
import { getQuadProps } from "../utils/padding";
|
|
8
8
|
|
|
9
9
|
import { getProp } from "../utils/get-prop";
|
|
10
10
|
|
|
11
|
-
export function computeColsWidth(table) {
|
|
11
|
+
export function computeColsWidth(table, update) {
|
|
12
12
|
var _a, _b, _c, _d;
|
|
13
13
|
const time = "undefined" != typeof window ? window.performance.now() : 0;
|
|
14
14
|
table._clearColRangeWidthsMap();
|
|
15
|
+
const oldColWidths = [];
|
|
16
|
+
if (update) for (let col = 0; col < table.colCount; col++) oldColWidths.push(table.getColWidth(col));
|
|
15
17
|
for (let col = 0; col < table.colCount; col++) {
|
|
16
18
|
let maxWidth;
|
|
17
19
|
if (!table.internalProps.transpose && "only-header" === (null === (_b = null === (_a = table.internalProps.layoutMap.columnWidths) || void 0 === _a ? void 0 : _a[col]) || void 0 === _b ? void 0 : _b.columnWidthComputeMode) && "showHeader" in table.internalProps.layoutMap) {
|
|
@@ -30,7 +32,7 @@ export function computeColsWidth(table) {
|
|
|
30
32
|
for (let col = 0; col < table.colCount; col++) {
|
|
31
33
|
let colWidth;
|
|
32
34
|
colWidth = col === table.colCount - 1 ? totalDrawWidth - table.getColsWidth(0, table.colCount - 2) : Math.round(table.getColWidth(col) * factor),
|
|
33
|
-
table.setColWidth(col, colWidth);
|
|
35
|
+
table.setColWidth(col, colWidth, !1, !0);
|
|
34
36
|
}
|
|
35
37
|
} else if ("standard-aeolus" === table.widthMode && table.internalProps.transpose) {
|
|
36
38
|
table._clearColRangeWidthsMap();
|
|
@@ -42,10 +44,14 @@ export function computeColsWidth(table) {
|
|
|
42
44
|
}
|
|
43
45
|
if (actualWidth < canvasWidth && actualWidth - actualHeaderWidth > 0) {
|
|
44
46
|
const factor = (canvasWidth - actualHeaderWidth) / (actualWidth - actualHeaderWidth);
|
|
45
|
-
for (let col = table.frozenColCount; col < table.colCount; col++) table.setColWidth(col, table.getColWidth(col) * factor);
|
|
47
|
+
for (let col = table.frozenColCount; col < table.colCount; col++) table.setColWidth(col, table.getColWidth(col) * factor, !1, !0);
|
|
46
48
|
}
|
|
47
49
|
}
|
|
48
|
-
console.log("computeColsWidth time:", ("undefined" != typeof window ? window.performance.now() : 0) - time)
|
|
50
|
+
if (console.log("computeColsWidth time:", ("undefined" != typeof window ? window.performance.now() : 0) - time),
|
|
51
|
+
update) for (let col = 0; col < table.colCount; col++) {
|
|
52
|
+
const newColWidth = table.getColWidth(col);
|
|
53
|
+
newColWidth !== oldColWidths[col] && table.scenegraph.updateColWidth(col, newColWidth - oldColWidths[col]);
|
|
54
|
+
}
|
|
49
55
|
}
|
|
50
56
|
|
|
51
57
|
export function computeColWidth(col, startRow, endRow, table, forceCompute) {
|
|
@@ -62,6 +68,7 @@ export function computeColWidth(col, startRow, endRow, table, forceCompute) {
|
|
|
62
68
|
}
|
|
63
69
|
|
|
64
70
|
function computeAutoColWidth(col, startRow, endRow, forceCompute, table) {
|
|
71
|
+
var _a, _b, _c, _d;
|
|
65
72
|
let maxWidth = 0, deltaRow = 1;
|
|
66
73
|
endRow - startRow > 5e3 && (deltaRow = Math.ceil((endRow - startRow) / 5e3));
|
|
67
74
|
for (let row = startRow; row <= endRow; row += deltaRow) {
|
|
@@ -80,8 +87,21 @@ function computeAutoColWidth(col, startRow, endRow, forceCompute, table) {
|
|
|
80
87
|
maxWidth = Math.max(maxWidth, table.getColWidth(col) || 0);
|
|
81
88
|
continue;
|
|
82
89
|
}
|
|
90
|
+
let cellHierarchyIndent = 0;
|
|
91
|
+
const layoutMap = table.internalProps.layoutMap;
|
|
92
|
+
if (layoutMap.isHeader(col, row)) {
|
|
93
|
+
const hd = layoutMap.getHeader(col, row);
|
|
94
|
+
if ("only-body" === (null === (_a = null == hd ? void 0 : hd.define) || void 0 === _a ? void 0 : _a.columnWidthComputeMode)) continue;
|
|
95
|
+
(null == hd ? void 0 : hd.hierarchyLevel) && (cellHierarchyIndent = (null !== (_b = hd.hierarchyLevel) && void 0 !== _b ? _b : 0) * (null !== (_c = layoutMap.rowHierarchyIndent) && void 0 !== _c ? _c : 0));
|
|
96
|
+
} else {
|
|
97
|
+
const define = table.getBodyColumnDefine(col, row);
|
|
98
|
+
if (null == define ? void 0 : define.tree) {
|
|
99
|
+
const indexArr = table.dataSource.getIndexKey(table.getRecordIndexByRow(col, row));
|
|
100
|
+
cellHierarchyIndent = Array.isArray(indexArr) && table.getHierarchyState(col, row) !== HierarchyState.none ? (indexArr.length - 1) * (null !== (_d = layoutMap.hierarchyIndent) && void 0 !== _d ? _d : 0) : 0;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
83
103
|
const textWidth = computeTextWidth(col, row, table);
|
|
84
|
-
maxWidth = Math.max(textWidth, maxWidth);
|
|
104
|
+
maxWidth = Math.max(textWidth + cellHierarchyIndent, maxWidth);
|
|
85
105
|
}
|
|
86
106
|
const colMinWidth = table.getMinColWidth(col), colMaxWidth = table.getMaxColWidth(col);
|
|
87
107
|
return maxWidth < colMinWidth ? colMinWidth : maxWidth > colMaxWidth ? colMaxWidth : maxWidth;
|
|
@@ -127,11 +147,11 @@ function computeIndicatorWidth(col, row, forceCompute, table) {
|
|
|
127
147
|
}
|
|
128
148
|
|
|
129
149
|
function computeTextWidth(col, row, table) {
|
|
130
|
-
var _a;
|
|
131
150
|
let maxWidth = 0;
|
|
132
151
|
const cellValue = table.getCellValue(col, row), actStyle = table._getCellStyle(col, row);
|
|
133
152
|
let iconWidth = 0;
|
|
134
|
-
|
|
153
|
+
const define = table.getBodyColumnDefine(col, row);
|
|
154
|
+
if ("body" !== table.getCellType(col, row) || (!!(null == define ? void 0 : define.icon) || !!(null == define ? void 0 : define.tree))) {
|
|
135
155
|
const icons = table.getCellIcons(col, row);
|
|
136
156
|
null == icons || icons.forEach((icon => {
|
|
137
157
|
var _a, _b, _c;
|
|
@@ -143,7 +163,7 @@ function computeTextWidth(col, row, table) {
|
|
|
143
163
|
const cellRange = table.getCellRange(col, row);
|
|
144
164
|
spanCol = cellRange.end.col - cellRange.start.col + 1;
|
|
145
165
|
}
|
|
146
|
-
const padding =
|
|
166
|
+
const padding = getQuadProps(getProp("padding", actStyle, col, row, table)), paddingWidth = padding[1] + padding[3], fontSize = getProp("fontSize", actStyle, col, row, table), fontFamily = getProp("fontFamily", actStyle, col, row, table), lines = validToString(cellValue).split("\n") || [];
|
|
147
167
|
return lines.length >= 1 ? lines.forEach((line => {
|
|
148
168
|
const width = table.measureText(line.slice(0, table.options.maxCharactersNumber || 200), {
|
|
149
169
|
fontSize: fontSize,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["scenegraph/layout/compute-col-width.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,KAAK,IAAI,MAAM,kBAAkB,CAAC;AACzC,OAAO,EAAW,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAC1D,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AA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AC","file":"compute-col-width.js","sourcesContent":["import type { SimpleHeaderLayoutMap } from '../../layout';\nimport type { PivotHeaderLayoutMap } from '../../layout/pivot-header-layout';\nimport type { TextColumnDefine } from '../../ts-types';\nimport { IconPosition } from '../../ts-types';\nimport * as calc from '../../tools/calc';\nimport { toFixed, validToString } from '../../tools/util';\nimport { getPadding } from '../utils/padding';\nimport { getProp } from '../utils/get-prop';\nimport type { BaseTableAPI } from '../../ts-types/base-table';\n\nexport function computeColsWidth(table: BaseTableAPI): void {\n const time = typeof window !== 'undefined' ? window.performance.now() : 0;\n table._clearColRangeWidthsMap();\n for (let col = 0; col < table.colCount; col++) {\n let maxWidth;\n if (\n !table.internalProps.transpose &&\n table.internalProps.layoutMap.columnWidths?.[col]?.columnWidthComputeMode === 'only-header' &&\n 'showHeader' in table.internalProps.layoutMap\n ) {\n const temp = table.internalProps.layoutMap.showHeader;\n table.internalProps.layoutMap.showHeader = true;\n maxWidth = computeColWidth(col, 0, table.internalProps.layoutMap.headerLevelCount, table, false);\n table.internalProps.layoutMap.showHeader = temp;\n } else if (\n !table.internalProps.transpose &&\n table.internalProps.layoutMap.columnWidths?.[col]?.columnWidthComputeMode === 'only-body'\n ) {\n maxWidth = computeColWidth(\n col,\n table.internalProps.layoutMap.getBodyRange().start.row,\n table.internalProps.layoutMap.getBodyRange().end.row,\n table,\n false\n );\n } else {\n maxWidth = computeColWidth(col, 0, table.rowCount - 1, table, false);\n }\n\n table._setColContentWidth(col, maxWidth);\n table.setColWidth(col, maxWidth, false, true);\n }\n // 处理adaptive宽度\n if (table.widthMode === 'adaptive') {\n table._clearColRangeWidthsMap();\n // const canvasWidth = table.internalProps.canvas.width;\n const totalDrawWidth = table.tableNoFrameWidth;\n let actualWidth = 0;\n for (let col = 0; col < table.colCount; col++) {\n actualWidth += table.getColWidth(col);\n }\n const factor = totalDrawWidth / actualWidth;\n for (let col = 0; col < table.colCount; col++) {\n let colWidth;\n if (col === table.colCount - 1) {\n colWidth = totalDrawWidth - table.getColsWidth(0, table.colCount - 2);\n } else {\n colWidth = Math.round(table.getColWidth(col) * factor);\n }\n table.setColWidth(col, colWidth);\n }\n } else if (table.widthMode === 'standard-aeolus' && table.internalProps.transpose) {\n // 处理风神列宽特殊逻辑\n table._clearColRangeWidthsMap();\n const canvasWidth = table.tableNoFrameWidth;\n let actualWidth = 0;\n let actualHeaderWidth = 0;\n for (let col = 0; col < table.colCount; col++) {\n const colWidth = table.getColWidth(col);\n if (col < table.frozenColCount) {\n actualHeaderWidth += colWidth;\n }\n\n actualWidth += colWidth;\n }\n\n // 如果内容宽度小于canvas宽度,执行adaptive放大\n if (actualWidth < canvasWidth && actualWidth - actualHeaderWidth > 0) {\n const factor = (canvasWidth - actualHeaderWidth) / (actualWidth - actualHeaderWidth);\n for (let col = table.frozenColCount; col < table.colCount; col++) {\n table.setColWidth(col, table.getColWidth(col) * factor);\n }\n }\n }\n console.log('computeColsWidth time:', (typeof window !== 'undefined' ? window.performance.now() : 0) - time);\n}\n\n/**\n * @description: 计算列宽\n * @param {number} col\n * @param {number} startRow\n * @param {number} endRow\n * @param {BaseTableAPI} table\n * @param {boolean} forceCompute\n * @return {*}\n */\nexport function computeColWidth(\n col: number,\n startRow: number,\n endRow: number,\n table: BaseTableAPI,\n forceCompute: boolean\n): number {\n const { layoutMap, transpose } = table.internalProps;\n // const ctx = _getInitContext.call(table);\n const { width } = layoutMap.columnWidths?.[col] || {};\n\n if (transpose) {\n // 转置模式\n if (table.widthMode === 'standard') {\n // return table.getColWidth(col);\n // standard模式使用默认值\n if (table.isRowHeader(col, 0) || table.isCornerHeader(col, 0)) {\n return Array.isArray(table.defaultHeaderColWidth)\n ? table.defaultHeaderColWidth[col] ?? table.defaultColWidth\n : table.defaultHeaderColWidth;\n }\n return table.defaultColWidth;\n } else if (\n (table.widthMode === 'standard-aeolus' || table.widthMode === 'adaptive') &&\n col === 0 &&\n width !== 'auto' &&\n ((layoutMap as PivotHeaderLayoutMap)?.showColumnHeader || (layoutMap as SimpleHeaderLayoutMap)?.showHeader)\n ) {\n // ToBeFixed hack逻辑,转置第一列列宽为header[0]\n if (typeof width === 'string') {\n return calc.toPx(width, table.internalProps.calcWidthContext);\n } else if (width) {\n return width;\n }\n }\n // autoWidth adaptive standard-aeolus 需要计算内容宽度\n // do nothing\n } else if (width !== 'auto' && table.widthMode !== 'autoWidth' && !forceCompute) {\n // if (width && (typeof width === 'string' || width > 0)) return width;\n if (typeof width === 'string') {\n return calc.toPx(width, table.internalProps.calcWidthContext);\n } else if (width) {\n return width;\n }\n //是透视表的行表头部分 则宽度按defaultHeaderColWidth设置\n return table.getColWidth(col);\n }\n\n return computeAutoColWidth(col, startRow, endRow, forceCompute, table);\n}\n\n/**\n * @description: 计算width: auto情况下的列宽\n * @param {number} col\n * @param {number} startRow\n * @param {number} endRow\n * @param {boolean} forceCompute\n * @param {BaseTableAPI} table\n * @return {*}\n */\nfunction computeAutoColWidth(\n col: number,\n startRow: number,\n endRow: number,\n forceCompute: boolean,\n table: BaseTableAPI\n): number {\n // 处理 auto width\n let maxWidth = 0;\n let deltaRow = 1;\n if (endRow - startRow > 5000) {\n // 超过5000行启动列宽自动计算采样\n deltaRow = Math.ceil((endRow - startRow) / 5000);\n }\n for (let row = startRow; row <= endRow; row += deltaRow) {\n // 先判断CustomRender\n const customWidth = computeCustomRenderWidth(col, row, table);\n if (typeof customWidth === 'number') {\n maxWidth = Math.max(customWidth, maxWidth);\n continue;\n }\n\n // 判断透视表如果在指标\n const indicatorWidth = computeIndicatorWidth(col, row, forceCompute, table);\n if (typeof indicatorWidth === 'number') {\n maxWidth = Math.max(indicatorWidth, maxWidth);\n continue;\n }\n\n const cellType = table.isHeader(col, row)\n ? table._getHeaderLayoutMap(col, row).headerType\n : table.getBodyColumnType(col, row);\n if (cellType !== 'text' && cellType !== 'link' && cellType !== 'progressbar') {\n // text&link&progressbar测量文字宽度\n // image&video&sparkline使用默认宽度\n maxWidth = Math.max(maxWidth, table.getColWidth(col) || 0);\n continue;\n }\n\n // TO DO: 处理树形展开\n\n // 测量文字宽度\n const textWidth = computeTextWidth(col, row, table);\n maxWidth = Math.max(textWidth, maxWidth);\n }\n\n // 处理宽度限制\n const colMinWidth = table.getMinColWidth(col);\n const colMaxWidth = table.getMaxColWidth(col);\n if (maxWidth < colMinWidth) {\n return colMinWidth;\n } else if (maxWidth > colMaxWidth) {\n return colMaxWidth;\n }\n return maxWidth;\n}\n\n/**\n * @description: 计算customRender相关列宽\n * @param {number} col\n * @param {number} row\n * @param {BaseTableAPI} table\n * @return {*}\n */\nfunction computeCustomRenderWidth(col: number, row: number, table: BaseTableAPI): number | undefined {\n const customRender = table.getCustomRender(col, row);\n const customLayout = table.getCustomLayout(col, row);\n if (customRender || customLayout) {\n let spanCol = 1;\n let width = 0;\n if (table.isHeader(col, row) || (table.getBodyColumnDefine(col, row) as TextColumnDefine).mergeCell) {\n const cellRange = table.getCellRange(col, row);\n spanCol = cellRange.end.col - cellRange.start.col + 1;\n }\n const arg = {\n col,\n row,\n dataValue: table.getCellOriginValue(col, row),\n value: table.getCellValue(col, row) || '',\n rect: getCellRect(col, row, table),\n table\n };\n if (customLayout) {\n // 处理customLayout\n const customLayoutObj = customLayout(arg);\n customLayoutObj.rootContainer.isRoot = true;\n const size = customLayoutObj.rootContainer.getContentSize();\n width = size.width ?? 0;\n } else if (typeof customRender === 'function') {\n // 处理customRender\n const customRenderObj = customRender(arg);\n width = customRenderObj?.expectedWidth ?? 0;\n } else {\n width = customRender?.expectedWidth ?? 0;\n }\n return width / spanCol;\n }\n return undefined;\n}\n\n/**\n * @description: 计算指标相关列宽\n * @param {number} col\n * @param {number} row\n * @param {boolean} forceCompute\n * @param {BaseTableAPI} table\n * @return {*}\n */\nfunction computeIndicatorWidth(\n col: number,\n row: number,\n forceCompute: boolean,\n table: BaseTableAPI\n): number | undefined {\n const { layoutMap } = table.internalProps;\n if (table.isPivotTable() && (layoutMap as PivotHeaderLayoutMap).isColumnIndicatorHeader(col, row)) {\n // 透视表如果在指标中配置了宽度,使用该宽度作为指标单元格及下面内容单元格的列宽\n const body = layoutMap.getBody(col, row);\n if (body && body.width && body.width !== 'auto' && !forceCompute) {\n const width = Math.round(calc.toPx(body.width, table.internalProps.calcWidthContext));\n return width;\n }\n }\n return undefined;\n}\n\n/**\n * @description: 计算文字宽度\n * @param {number} col\n * @param {number} row\n * @param {BaseTableAPI} table\n * @return {*}\n */\nfunction computeTextWidth(col: number, row: number, table: BaseTableAPI): number {\n let maxWidth = 0;\n const cellValue = table.getCellValue(col, row);\n // const dataValue = table.getCellOriginValue(col, row);\n const actStyle = table._getCellStyle(col, row);\n let iconWidth = 0;\n const mayHaveIcon = table.getCellType(col, row) !== 'body' ? true : !!table.getBodyColumnDefine(col, row)?.icon;\n if (mayHaveIcon) {\n const icons = table.getCellIcons(col, row);\n icons?.forEach(icon => {\n if (icon.positionType !== IconPosition.absoluteRight) {\n iconWidth += (icon.width ?? 0) + (icon.marginLeft ?? 0) + (icon.marginRight ?? 0);\n }\n });\n }\n let spanCol = 1;\n if (table.isHeader(col, row) || (table.getBodyColumnDefine(col, row) as TextColumnDefine).mergeCell) {\n const cellRange = table.getCellRange(col, row);\n spanCol = cellRange.end.col - cellRange.start.col + 1;\n }\n\n const padding = getPadding(getProp('padding', actStyle, col, row, table));\n const paddingWidth = padding[1] + padding[3]; // + cellHierarchyIndent\n\n const fontSize = getProp('fontSize', actStyle, col, row, table);\n const fontFamily = getProp('fontFamily', actStyle, col, row, table);\n\n const lines = validToString(cellValue).split('\\n') || [];\n if (lines.length >= 1) {\n // eslint-disable-next-line no-loop-func\n lines.forEach((line: string) => {\n const width = table.measureText(line.slice(0, table.options.maxCharactersNumber || 200), {\n fontSize,\n fontFamily\n }).width;\n maxWidth = Math.max(\n // 最大字符上限控制测量的字符\n (width + paddingWidth + 4 + iconWidth) / spanCol, // 这里+4为列宽测量结果的buffer\n maxWidth\n );\n });\n } else {\n maxWidth = Math.max(\n // 最大字符上限控制测量的字符\n (paddingWidth + 4 + iconWidth) / spanCol,\n maxWidth\n );\n }\n // 判断是否需要限制最大宽度 之前写死的450 需要使用配置来判断\n if (table.internalProps.limitMaxAutoWidth !== false) {\n maxWidth = Math.min(\n typeof table.internalProps.limitMaxAutoWidth === 'number' ? table.internalProps.limitMaxAutoWidth : 450,\n maxWidth\n );\n }\n\n return maxWidth;\n}\n\nfunction getCellRect(col: number, row: number, table: BaseTableAPI) {\n return {\n left: 0,\n top: 0,\n right: table.getColWidth(col),\n bottom: table.getRowHeight(row),\n width: table.getColWidth(col),\n height: table.getRowHeight(row)\n };\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["scenegraph/layout/compute-col-width.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9D,OAAO,KAAK,IAAI,MAAM,kBAAkB,CAAC;AACzC,OAAO,EAAW,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAC1D,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAG5C,MAAM,UAAU,gBAAgB,CAAC,KAAmB,EAAE,MAAgB;;IACpE,MAAM,IAAI,GAAG,OAAO,MAAM,KAAK,WAAW,CAAC,CAAC,CAAC,MAAM,CAAC,WAAW,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;IAC1E,KAAK,CAAC,uBAAuB,EAAE,CAAC;IAChC,MAAM,YAAY,GAAG,EAAE,CAAC;IACxB,IAAI,MAAM,EAAE;QACV,KAAK,IAAI,GAAG,GAAG,CAAC,EAAE,GAAG,GAAG,KAAK,CAAC,QAAQ,EAAE,GAAG,EAAE,EAAE;YAC7C,YAAY,CAAC,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,CAAC;SAC3C;KACF;IACD,KAAK,IAAI,GAAG,GAAG,CAAC,EAAE,GAAG,GAAG,KAAK,CAAC,QAAQ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C7B,MAAM,EAAE,KAAK,CAAC,YAAY,CAAC,GAAG,CAAC;QAC/B,KAAK,EAAE,KAAK,CAAC,WAAW,CAAC,GAAG,CAAC;QAC7B,MAAM,EAAE,KAAK,CAAC,YAAY,CAAC,GAAG,CAAC;KAChC,CAAC;AACJ,CAAC","file":"compute-col-width.js","sourcesContent":["import type { SimpleHeaderLayoutMap } from '../../layout';\nimport type { PivotHeaderLayoutMap } from '../../layout/pivot-header-layout';\nimport type { TextColumnDefine } from '../../ts-types';\nimport { HierarchyState, IconPosition } from '../../ts-types';\nimport * as calc from '../../tools/calc';\nimport { toFixed, validToString } from '../../tools/util';\nimport { getQuadProps } from '../utils/padding';\nimport { getProp } from '../utils/get-prop';\nimport type { BaseTableAPI } from '../../ts-types/base-table';\n\nexport function computeColsWidth(table: BaseTableAPI, update?: boolean): void {\n const time = typeof window !== 'undefined' ? window.performance.now() : 0;\n table._clearColRangeWidthsMap();\n const oldColWidths = [];\n if (update) {\n for (let col = 0; col < table.colCount; col++) {\n oldColWidths.push(table.getColWidth(col));\n }\n }\n for (let col = 0; col < table.colCount; col++) {\n let maxWidth;\n if (\n !table.internalProps.transpose &&\n table.internalProps.layoutMap.columnWidths?.[col]?.columnWidthComputeMode === 'only-header' &&\n 'showHeader' in table.internalProps.layoutMap\n ) {\n const temp = table.internalProps.layoutMap.showHeader;\n table.internalProps.layoutMap.showHeader = true;\n maxWidth = computeColWidth(col, 0, table.internalProps.layoutMap.headerLevelCount, table, false);\n table.internalProps.layoutMap.showHeader = temp;\n } else if (\n !table.internalProps.transpose &&\n table.internalProps.layoutMap.columnWidths?.[col]?.columnWidthComputeMode === 'only-body'\n ) {\n maxWidth = computeColWidth(\n col,\n table.internalProps.layoutMap.getBodyRange().start.row,\n table.internalProps.layoutMap.getBodyRange().end.row,\n table,\n false\n );\n } else {\n maxWidth = computeColWidth(col, 0, table.rowCount - 1, table, false);\n }\n\n table._setColContentWidth(col, maxWidth);\n table.setColWidth(col, maxWidth, false, true);\n }\n // 处理adaptive宽度\n if (table.widthMode === 'adaptive') {\n table._clearColRangeWidthsMap();\n // const canvasWidth = table.internalProps.canvas.width;\n const totalDrawWidth = table.tableNoFrameWidth;\n let actualWidth = 0;\n for (let col = 0; col < table.colCount; col++) {\n actualWidth += table.getColWidth(col);\n }\n const factor = totalDrawWidth / actualWidth;\n for (let col = 0; col < table.colCount; col++) {\n let colWidth;\n if (col === table.colCount - 1) {\n colWidth = totalDrawWidth - table.getColsWidth(0, table.colCount - 2);\n } else {\n colWidth = Math.round(table.getColWidth(col) * factor);\n }\n table.setColWidth(col, colWidth, false, true);\n }\n } else if (table.widthMode === 'standard-aeolus' && table.internalProps.transpose) {\n // 处理风神列宽特殊逻辑\n table._clearColRangeWidthsMap();\n const canvasWidth = table.tableNoFrameWidth;\n let actualWidth = 0;\n let actualHeaderWidth = 0;\n for (let col = 0; col < table.colCount; col++) {\n const colWidth = table.getColWidth(col);\n if (col < table.frozenColCount) {\n actualHeaderWidth += colWidth;\n }\n\n actualWidth += colWidth;\n }\n\n // 如果内容宽度小于canvas宽度,执行adaptive放大\n if (actualWidth < canvasWidth && actualWidth - actualHeaderWidth > 0) {\n const factor = (canvasWidth - actualHeaderWidth) / (actualWidth - actualHeaderWidth);\n for (let col = table.frozenColCount; col < table.colCount; col++) {\n table.setColWidth(col, table.getColWidth(col) * factor, false, true);\n }\n }\n }\n console.log('computeColsWidth time:', (typeof window !== 'undefined' ? window.performance.now() : 0) - time);\n\n if (update) {\n for (let col = 0; col < table.colCount; col++) {\n const newColWidth = table.getColWidth(col);\n if (newColWidth !== oldColWidths[col]) {\n // update the column width in scenegraph\n table.scenegraph.updateColWidth(col, newColWidth - oldColWidths[col]);\n }\n }\n }\n}\n\n/**\n * @description: 计算列宽\n * @param {number} col\n * @param {number} startRow\n * @param {number} endRow\n * @param {BaseTableAPI} table\n * @param {boolean} forceCompute\n * @return {*}\n */\nexport function computeColWidth(\n col: number,\n startRow: number,\n endRow: number,\n table: BaseTableAPI,\n forceCompute: boolean\n): number {\n const { layoutMap, transpose } = table.internalProps;\n // const ctx = _getInitContext.call(table);\n const { width } = layoutMap.columnWidths?.[col] || {};\n\n if (transpose) {\n // 转置模式\n if (table.widthMode === 'standard') {\n // return table.getColWidth(col);\n // standard模式使用默认值\n if (table.isRowHeader(col, 0) || table.isCornerHeader(col, 0)) {\n return Array.isArray(table.defaultHeaderColWidth)\n ? table.defaultHeaderColWidth[col] ?? table.defaultColWidth\n : table.defaultHeaderColWidth;\n }\n return table.defaultColWidth;\n } else if (\n (table.widthMode === 'standard-aeolus' || table.widthMode === 'adaptive') &&\n col === 0 &&\n width !== 'auto' &&\n ((layoutMap as PivotHeaderLayoutMap)?.showColumnHeader || (layoutMap as SimpleHeaderLayoutMap)?.showHeader)\n ) {\n // ToBeFixed hack逻辑,转置第一列列宽为header[0]\n if (typeof width === 'string') {\n return calc.toPx(width, table.internalProps.calcWidthContext);\n } else if (width) {\n return width;\n }\n }\n // autoWidth adaptive standard-aeolus 需要计算内容宽度\n // do nothing\n } else if (width !== 'auto' && table.widthMode !== 'autoWidth' && !forceCompute) {\n // if (width && (typeof width === 'string' || width > 0)) return width;\n if (typeof width === 'string') {\n return calc.toPx(width, table.internalProps.calcWidthContext);\n } else if (width) {\n return width;\n }\n //是透视表的行表头部分 则宽度按defaultHeaderColWidth设置\n return table.getColWidth(col);\n }\n\n return computeAutoColWidth(col, startRow, endRow, forceCompute, table);\n}\n\n/**\n * @description: 计算width: auto情况下的列宽\n * @param {number} col\n * @param {number} startRow\n * @param {number} endRow\n * @param {boolean} forceCompute\n * @param {BaseTableAPI} table\n * @return {*}\n */\nfunction computeAutoColWidth(\n col: number,\n startRow: number,\n endRow: number,\n forceCompute: boolean,\n table: BaseTableAPI\n): number {\n // 处理 auto width\n let maxWidth = 0;\n let deltaRow = 1;\n if (endRow - startRow > 5000) {\n // 超过5000行启动列宽自动计算采样\n deltaRow = Math.ceil((endRow - startRow) / 5000);\n }\n for (let row = startRow; row <= endRow; row += deltaRow) {\n // 先判断CustomRender\n const customWidth = computeCustomRenderWidth(col, row, table);\n if (typeof customWidth === 'number') {\n maxWidth = Math.max(customWidth, maxWidth);\n continue;\n }\n\n // 判断透视表如果在指标\n const indicatorWidth = computeIndicatorWidth(col, row, forceCompute, table);\n if (typeof indicatorWidth === 'number') {\n maxWidth = Math.max(indicatorWidth, maxWidth);\n continue;\n }\n\n const cellType = table.isHeader(col, row)\n ? table._getHeaderLayoutMap(col, row).headerType\n : table.getBodyColumnType(col, row);\n if (cellType !== 'text' && cellType !== 'link' && cellType !== 'progressbar') {\n // text&link&progressbar测量文字宽度\n // image&video&sparkline使用默认宽度\n maxWidth = Math.max(maxWidth, table.getColWidth(col) || 0);\n continue;\n }\n\n // 处理树形展开\n let cellHierarchyIndent = 0;\n const layoutMap = table.internalProps.layoutMap;\n //判断是否为表头\n if (layoutMap.isHeader(col, row)) {\n const hd = layoutMap.getHeader(col, row);\n // 如果某级表头设置了only-body,在计算表头内容宽度时跳过改级表头\n if (hd?.define?.columnWidthComputeMode === 'only-body') {\n continue;\n }\n if (hd?.hierarchyLevel) {\n cellHierarchyIndent = (hd.hierarchyLevel ?? 0) * ((layoutMap as PivotHeaderLayoutMap).rowHierarchyIndent ?? 0);\n }\n } else {\n // 基本表格表身body单元格 如果是树形展开 需要考虑缩进值\n // const cellHierarchyState = table.getHierarchyState(col, row);\n // if (cellHierarchyState === HierarchyState.expand || cellHierarchyState === HierarchyState.collapse) {\n const define = table.getBodyColumnDefine(col, row);\n if (define?.tree) {\n const indexArr = table.dataSource.getIndexKey(table.getRecordIndexByRow(col, row));\n cellHierarchyIndent =\n Array.isArray(indexArr) && table.getHierarchyState(col, row) !== HierarchyState.none\n ? (indexArr.length - 1) * ((layoutMap as SimpleHeaderLayoutMap).hierarchyIndent ?? 0)\n : 0;\n }\n }\n\n // 测量文字宽度\n const textWidth = computeTextWidth(col, row, table);\n maxWidth = Math.max(textWidth + cellHierarchyIndent, maxWidth);\n }\n\n // 处理宽度限制\n const colMinWidth = table.getMinColWidth(col);\n const colMaxWidth = table.getMaxColWidth(col);\n if (maxWidth < colMinWidth) {\n return colMinWidth;\n } else if (maxWidth > colMaxWidth) {\n return colMaxWidth;\n }\n return maxWidth;\n}\n\n/**\n * @description: 计算customRender相关列宽\n * @param {number} col\n * @param {number} row\n * @param {BaseTableAPI} table\n * @return {*}\n */\nfunction computeCustomRenderWidth(col: number, row: number, table: BaseTableAPI): number | undefined {\n const customRender = table.getCustomRender(col, row);\n const customLayout = table.getCustomLayout(col, row);\n if (customRender || customLayout) {\n let spanCol = 1;\n let width = 0;\n if (table.isHeader(col, row) || (table.getBodyColumnDefine(col, row) as TextColumnDefine).mergeCell) {\n const cellRange = table.getCellRange(col, row);\n spanCol = cellRange.end.col - cellRange.start.col + 1;\n }\n const arg = {\n col,\n row,\n dataValue: table.getCellOriginValue(col, row),\n value: table.getCellValue(col, row) || '',\n rect: getCellRect(col, row, table),\n table\n };\n if (customLayout) {\n // 处理customLayout\n const customLayoutObj = customLayout(arg);\n customLayoutObj.rootContainer.isRoot = true;\n const size = customLayoutObj.rootContainer.getContentSize();\n width = size.width ?? 0;\n } else if (typeof customRender === 'function') {\n // 处理customRender\n const customRenderObj = customRender(arg);\n width = customRenderObj?.expectedWidth ?? 0;\n } else {\n width = customRender?.expectedWidth ?? 0;\n }\n return width / spanCol;\n }\n return undefined;\n}\n\n/**\n * @description: 计算指标相关列宽\n * @param {number} col\n * @param {number} row\n * @param {boolean} forceCompute\n * @param {BaseTableAPI} table\n * @return {*}\n */\nfunction computeIndicatorWidth(\n col: number,\n row: number,\n forceCompute: boolean,\n table: BaseTableAPI\n): number | undefined {\n const { layoutMap } = table.internalProps;\n if (table.isPivotTable() && (layoutMap as PivotHeaderLayoutMap).isColumnIndicatorHeader(col, row)) {\n // 透视表如果在指标中配置了宽度,使用该宽度作为指标单元格及下面内容单元格的列宽\n const body = layoutMap.getBody(col, row);\n if (body && body.width && body.width !== 'auto' && !forceCompute) {\n const width = Math.round(calc.toPx(body.width, table.internalProps.calcWidthContext));\n return width;\n }\n }\n return undefined;\n}\n\n/**\n * @description: 计算文字宽度\n * @param {number} col\n * @param {number} row\n * @param {BaseTableAPI} table\n * @return {*}\n */\nfunction computeTextWidth(col: number, row: number, table: BaseTableAPI): number {\n let maxWidth = 0;\n const cellValue = table.getCellValue(col, row);\n // const dataValue = table.getCellOriginValue(col, row);\n const actStyle = table._getCellStyle(col, row);\n let iconWidth = 0;\n const define = table.getBodyColumnDefine(col, row);\n const mayHaveIcon = table.getCellType(col, row) !== 'body' ? true : !!define?.icon || !!define?.tree;\n if (mayHaveIcon) {\n const icons = table.getCellIcons(col, row);\n icons?.forEach(icon => {\n if (icon.positionType !== IconPosition.absoluteRight) {\n iconWidth += (icon.width ?? 0) + (icon.marginLeft ?? 0) + (icon.marginRight ?? 0);\n }\n });\n }\n let spanCol = 1;\n if (table.isHeader(col, row) || (table.getBodyColumnDefine(col, row) as TextColumnDefine).mergeCell) {\n const cellRange = table.getCellRange(col, row);\n spanCol = cellRange.end.col - cellRange.start.col + 1;\n }\n\n const padding = getQuadProps(getProp('padding', actStyle, col, row, table));\n const paddingWidth = padding[1] + padding[3]; // + cellHierarchyIndent\n\n const fontSize = getProp('fontSize', actStyle, col, row, table);\n const fontFamily = getProp('fontFamily', actStyle, col, row, table);\n\n const lines = validToString(cellValue).split('\\n') || [];\n if (lines.length >= 1) {\n // eslint-disable-next-line no-loop-func\n lines.forEach((line: string) => {\n const width = table.measureText(line.slice(0, table.options.maxCharactersNumber || 200), {\n fontSize,\n fontFamily\n }).width;\n maxWidth = Math.max(\n // 最大字符上限控制测量的字符\n (width + paddingWidth + 4 + iconWidth) / spanCol, // 这里+4为列宽测量结果的buffer\n maxWidth\n );\n });\n } else {\n maxWidth = Math.max(\n // 最大字符上限控制测量的字符\n (paddingWidth + 4 + iconWidth) / spanCol,\n maxWidth\n );\n }\n // 判断是否需要限制最大宽度 之前写死的450 需要使用配置来判断\n if (table.internalProps.limitMaxAutoWidth !== false) {\n maxWidth = Math.min(\n typeof table.internalProps.limitMaxAutoWidth === 'number' ? table.internalProps.limitMaxAutoWidth : 450,\n maxWidth\n );\n }\n\n return maxWidth;\n}\n\nfunction getCellRect(col: number, row: number, table: BaseTableAPI) {\n return {\n left: 0,\n top: 0,\n right: table.getColWidth(col),\n bottom: table.getRowHeight(row),\n width: table.getColWidth(col),\n height: table.getRowHeight(row)\n };\n}\n"]}
|