@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/layout/update-width.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,iCAAi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AS,EACxB;YACA,SAAS,GAAG,IAAI,CAAC,GAAG,CAAC,SAAS,EAAE,KAAK,CAAC,UAAU,CAAC,MAAM,EAAE,CAAC,CAAC;SAC5D;IACH,CAAC,CAAC,CAAC;IAEH,MAAM,OAAO,GAAG,UAAU,CAAC,KAAK,CAAC,KAAK,CAAC,aAAa,CAAC,IAAI,CAAC,GAAG,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,OAAiB,CAAC,CAAC;IAC5F,OAAO,SAAS,GAAG,OAAO,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;AAC7C,CAAC","file":"update-width.js","sourcesContent":["import type { ProgressBarStyle } from '../../body-helper/style/ProgressBarStyle';\nimport type { IProgressbarColumnBodyDefine } from '../../ts-types/list-table/define/progressbar-define';\nimport type { Group } from '../graphic/group';\nimport type { Icon } from '../graphic/icon';\nimport { updateImageCellContentWhileResize } from '../group-creater/cell-type/image-cell';\nimport { createProgressBarCell } from '../group-creater/cell-type/progress-bar-cell';\nimport { createSparkLineCellGroup } from '../group-creater/cell-type/spark-line-cell';\nimport type { Scenegraph } from '../scenegraph';\nimport { getCellMergeInfo } from '../utils/get-cell-merge';\nimport { getProp } from '../utils/get-prop';\nimport { getPadding } from '../utils/padding';\nimport { updateCellContentWidth } from '../utils/text-icon-layout';\nimport { updateCellHeightForRow } from './update-height';\n// import { updateAutoRowHeight } from './auto-height';\n\n/**\n * @description: 更新指定列列宽,在拖拽调整列宽中使用\n * @param {Scenegraph} scene\n * @param {number} col\n * @param {number} detaX\n * @return {*}\n */\nexport function updateColWidth(scene: Scenegraph, col: number, detaX: number) {\n // getColWidth会进行Math.round,所以先从colWidthsMap获取:\n // 如果是数值,直接使用;如果不是,则通过getColWidth获取像素值\n // const widthCache = (scene.table as any).colWidthsMap.get(col);\n // let width = 0;\n // if (typeof widthCache === 'number') {\n // width = widthCache;\n // } else {\n // width = scene.table.getColWidth(col);\n // }\n\n const { autoRowHeight } = scene.table.internalProps;\n let needRerangeRow = false;\n const colOrCornerHeaderColumn = scene.getColGroup(col, true) as Group;\n const oldColOrCornerHeaderColumnWidth = colOrCornerHeaderColumn.attribute.width;\n colOrCornerHeaderColumn?.setAttribute('width', oldColOrCornerHeaderColumnWidth + detaX);\n // 更新单元格宽度\n colOrCornerHeaderColumn?.forEachChildren((cell: Group, index: number) => {\n const isHeightChange = updateCellWidth(\n scene,\n cell,\n col,\n // index,\n cell.row,\n oldColOrCornerHeaderColumnWidth,\n detaX,\n // true\n index < scene.table.columnHeaderLevelCount,\n autoRowHeight\n );\n if (isHeightChange) {\n const mergeInfo = getCellMergeInfo(scene.table, cell.col, cell.row);\n if (mergeInfo && mergeInfo.end.row - mergeInfo.start.row) {\n for (let row = mergeInfo.start.row; row <= mergeInfo.end.row; row++) {\n resetRowHeight(scene, row);\n }\n } else {\n resetRowHeight(scene, cell.row);\n }\n needRerangeRow = true;\n }\n });\n\n if (needRerangeRow) {\n let newTotalHeight = 0;\n for (let col = 0; col < scene.table.colCount; col++) {\n const colGroup = scene.getColGroup(col, true);\n let y = 0;\n colGroup.forEachChildren((cellGroup: Group) => {\n if (cellGroup.role !== 'cell') {\n return;\n }\n cellGroup.setAttribute('y', y);\n y += cellGroup.attribute.height;\n });\n newTotalHeight = y;\n }\n scene.updateContainerHeight(0, newTotalHeight - scene.colHeaderGroup.attribute.height);\n }\n\n needRerangeRow = false;\n const rowHeaderOrBodyColumn = scene.getColGroup(col) as Group;\n const oldRowHeaderOrBodyColumn = rowHeaderOrBodyColumn.attribute.width;\n rowHeaderOrBodyColumn?.setAttribute('width', oldRowHeaderOrBodyColumn + detaX);\n rowHeaderOrBodyColumn?.forEachChildren((cell: Group, index: number) => {\n const isHeightChange = updateCellWidth(\n scene,\n cell,\n // col + (!isRowHeader ? scene.table.frozenColCount : 0),\n cell.col,\n // index + scene.table.frozenRowCount,\n cell.row,\n oldRowHeaderOrBodyColumn,\n detaX,\n // isRowHeader\n col < scene.table.rowHeaderLevelCount,\n autoRowHeight\n );\n if (isHeightChange) {\n const mergeInfo = getCellMergeInfo(scene.table, cell.col, cell.row);\n if (mergeInfo && mergeInfo.end.row - mergeInfo.start.row) {\n for (let row = mergeInfo.start.row; row <= mergeInfo.end.row; row++) {\n resetRowHeight(scene, row);\n }\n } else {\n resetRowHeight(scene, cell.row);\n }\n needRerangeRow = true;\n }\n });\n\n if (needRerangeRow) {\n let newTotalHeight = 0;\n for (let col = 0; col < scene.table.colCount; col++) {\n const colGroup = scene.getColGroup(col, false);\n let y = 0;\n colGroup.forEachChildren((cellGroup: Group) => {\n if (cellGroup.role !== 'cell') {\n return;\n }\n cellGroup.setAttribute('y', y);\n y += cellGroup.attribute.height;\n });\n newTotalHeight = y;\n }\n scene.updateContainerHeight(scene.table.frozenRowCount, newTotalHeight - scene.bodyGroup.attribute.height);\n }\n\n // 更新剩余列位置\n if (col < scene.frozenColCount) {\n scene.cornerHeaderGroup.forEachChildrenSkipChild((column: Group, index) => {\n if (column.col > col) {\n column.setAttribute('x', column.attribute.x + detaX);\n }\n });\n scene.rowHeaderGroup.forEachChildrenSkipChild((column: Group, index) => {\n if (column.col > col) {\n column.setAttribute('x', column.attribute.x + detaX);\n }\n });\n } else {\n scene.colHeaderGroup.forEachChildrenSkipChild((column: Group, index) => {\n if (column.col > col) {\n column.setAttribute('x', column.attribute.x + detaX);\n }\n });\n scene.bodyGroup.forEachChildrenSkipChild((column: Group, index) => {\n if (column.col > col) {\n column.setAttribute('x', column.attribute.x + detaX);\n }\n });\n }\n\n scene.table.setColWidth(col, rowHeaderOrBodyColumn.attribute.width, true);\n}\n\n/**\n * @description: 更新单个单元格宽度\n * @return {*}\n */\nfunction updateCellWidth(\n scene: Scenegraph,\n cell: Group,\n col: number,\n row: number,\n width: number, // old width, not dist\n detaX: number,\n isHeader: boolean,\n // autoColWidth: boolean,\n autoRowHeight: boolean\n): boolean {\n let cellGroup;\n let distWidth;\n const mergeInfo = getCellMergeInfo(scene.table, col, row);\n // TO BE FIXED 这里使用横向和纵向来判断单元格merge情况,目前没有横纵都merge的情况,\n // 如果有这里的逻辑要修改\n if (mergeInfo && mergeInfo.end.col - mergeInfo.start.col) {\n // 更新横向merge cell width\n const mergeCell = scene.getCell(mergeInfo.start.col, mergeInfo.start.row);\n const mergeCellWidth = mergeCell.attribute.width;\n mergeCell.setAttribute('width', mergeCellWidth + detaX);\n\n cellGroup = mergeCell;\n distWidth = mergeCell.attribute.width;\n col = cellGroup.col;\n row = cellGroup.row;\n } else if (mergeInfo && mergeInfo.start.row === row) {\n // 更新纵向merge cell width,只更新一次\n cell.setAttribute('width', width + detaX);\n\n cellGroup = cell;\n distWidth = width + detaX;\n col = cellGroup.col;\n row = cellGroup.row;\n } else if (!mergeInfo) {\n cell.setAttribute('width', width + detaX);\n cellGroup = cell;\n distWidth = width + detaX;\n }\n\n if (!cellGroup) {\n // 合并单元格非主单元格,不处理\n return false;\n }\n\n // 更新单元格布局\n const type = scene.table.isHeader(col, row)\n ? scene.table._getHeaderLayoutMap(col, row).headerType\n : scene.table.getBodyColumnType(col, row);\n let isHeightChange = false;\n if (type === 'progressbar') {\n // 目前先采用重新生成节点的方案\n const columnDefine = scene.table.getBodyColumnDefine(col, row) as IProgressbarColumnBodyDefine;\n const style = scene.table._getCellStyle(col, row) as ProgressBarStyle;\n const value = scene.table.getCellValue(col, row);\n const dataValue = scene.table.getCellOriginValue(col, row);\n const padding = getPadding(getProp('padding', style, col, row, scene.table));\n\n const newBarCell = createProgressBarCell(\n columnDefine,\n style,\n cellGroup.attribute.width,\n // cellGroup.attribute.height,\n value,\n dataValue,\n col,\n row,\n padding,\n scene.table\n );\n\n const oldBarCell = cellGroup.getChildByName('progress-bar') as Group;\n // cell.replaceChild(newBarCell, oldBarCell);\n cellGroup.insertBefore(newBarCell, oldBarCell);\n cellGroup.removeChild(oldBarCell);\n oldBarCell.removeAllChild();\n oldBarCell.release();\n } else if (type === 'sparkline') {\n // 目前先采用重新生成节点的方案\n cellGroup.removeAllChild();\n const headerStyle = scene.table._getCellStyle(col, row);\n const padding = getPadding(getProp('padding', headerStyle, col, row, scene.table));\n createSparkLineCellGroup(\n cellGroup,\n cellGroup.parent,\n cellGroup.attribute.x,\n cellGroup.attribute.y,\n col,\n row,\n cellGroup.attribute.width,\n cellGroup.attribute.height,\n padding,\n scene.table\n );\n } else if (type === 'image' || type === 'video') {\n // // 只更新背景边框\n // const rect = cell.firstChild as Rect;\n // rect.setAttribute('width', cell.attribute.width);\n updateImageCellContentWhileResize(cellGroup, col, row, scene.table);\n } else {\n // 处理文字\n const style = scene.table._getCellStyle(col, row);\n isHeightChange = updateCellContentWidth(\n cellGroup,\n distWidth,\n detaX,\n autoRowHeight,\n getPadding(style.padding as number),\n style.textAlign,\n style.textBaseline,\n scene\n );\n }\n\n return isHeightChange;\n}\n\n/**\n * @description: 重置指定行行高\n * @param {Scenegraph} scene\n * @param {number} row\n * @return {*}\n */\nfunction resetRowHeight(scene: Scenegraph, row: number) {\n let maxHeight = 0;\n // 获取高度\n for (let col = 0; col < scene.table.colCount; col++) {\n const cell = scene.highPerformanceGetCell(col, row);\n let cellHeight = getCleanCellHeight(cell, scene);\n const mergeInfo = getCellMergeInfo(scene.table, col, row);\n if (mergeInfo && mergeInfo.end.row - mergeInfo.start.row) {\n cellHeight = cellHeight / (mergeInfo.end.row - mergeInfo.start.row + 1);\n }\n maxHeight = Math.max(maxHeight, cellHeight);\n }\n\n // 更新高度\n for (let col = 0; col < scene.table.colCount; col++) {\n let distHeight = maxHeight;\n const cell = scene.highPerformanceGetCell(col, row);\n const mergeInfo = getCellMergeInfo(scene.table, col, row);\n if (mergeInfo && mergeInfo.end.row - mergeInfo.start.row) {\n for (let rowIndex = mergeInfo.start.row; rowIndex <= mergeInfo.end.row; rowIndex++) {\n if (rowIndex !== row) {\n distHeight += scene.table.getRowHeight(rowIndex);\n }\n }\n }\n updateCellHeightForRow(scene, cell, col, row, distHeight, 0, scene.table.isHeader(col, row));\n }\n\n // 更新table行高存储\n scene.table.setRowHeight(row, maxHeight, true);\n}\n\nfunction getCleanCellHeight(cell: Group, scene: Scenegraph) {\n let maxHeight = 0;\n cell.forEachChildren((child: Icon) => {\n if (\n child.role === 'icon-left' ||\n child.role === 'icon-right' ||\n child.name === 'text' ||\n child.name === 'content'\n ) {\n maxHeight = Math.max(maxHeight, child.AABBBounds.height());\n }\n });\n\n const padding = getPadding(scene.table._getCellStyle(cell.col, cell.row).padding as number);\n return maxHeight + padding[0] + padding[2];\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["scenegraph/layout/update-width.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,iCAAiC,EAAE,MAAM,uCAAuC,CAAC;AAC1F,OAAO,EAAE,qBAAqB,EAAE,MAAM,8CAA8C,CAAC;AACrF,OAAO,EAAE,wBAAwB,EAAE,MAAM,4CAA4C,CAAC;AAEtF,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,EAAE,sBAAsB,EAAE,MAAM,2BAA2B,CAAC;AACnE,OAAO,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAC;AAUzD,MAAM,UAAU,cAAc,CAAC,KAAiB,EAAE,GAAW,EAAE,KAAa;IAW1E,MAAM,EAAE,aAAa,EAAE,GAAG,KAAK,CAAC,KAAK,CAAC,aAAa,CAAC;IACpD,IAAI,cAAc,GAAG,KAAK,CAAC;IAC3B,MAAM,uBAAuB,GAAG,KAAK,CAAC,WAAW,CAAC,GAAG,EAAE,IAAI,CAAU,CAAC;IACtE,MAAM,+BAA+B,GAAG,uBAAuB,aAAvB,uBAAuB,uBAAvB,uBAAuB,CAAE,SAAS,CAAC,KAAK,CAAC;IACjF,uBAAuB,aAAvB,uBAAuB,uBAAvB,uBAAuB,CAAE,YAAY,CAAC,OAAO,EAAE,+BAA+B,GAAG,KAAK,CA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E,GAAG,CAAC,CAAC,CAAC;KAC9F;IAGD,KAAK,CAAC,KAAK,CAAC,YAAY,CAAC,GAAG,EAAE,SAAS,EAAE,IAAI,CAAC,CAAC;AACjD,CAAC;AAED,SAAS,kBAAkB,CAAC,IAAW,EAAE,KAAiB;IACxD,IAAI,SAAS,GAAG,CAAC,CAAC;IAClB,IAAI,CAAC,eAAe,CAAC,CAAC,KAAW,EAAE,EAAE;QACnC,IACE,KAAK,CAAC,IAAI,KAAK,WAAW;YAC1B,KAAK,CAAC,IAAI,KAAK,YAAY;YAC3B,KAAK,CAAC,IAAI,KAAK,MAAM;YACrB,KAAK,CAAC,IAAI,KAAK,SAAS,EACxB;YACA,SAAS,GAAG,IAAI,CAAC,GAAG,CAAC,SAAS,EAAE,KAAK,CAAC,UAAU,CAAC,MAAM,EAAE,CAAC,CAAC;SAC5D;IACH,CAAC,CAAC,CAAC;IAEH,MAAM,OAAO,GAAG,YAAY,CAAC,KAAK,CAAC,KAAK,CAAC,aAAa,CAAC,IAAI,CAAC,GAAG,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,OAAiB,CAAC,CAAC;IAC9F,OAAO,SAAS,GAAG,OAAO,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;AAC7C,CAAC","file":"update-width.js","sourcesContent":["import type { ProgressBarStyle } from '../../body-helper/style/ProgressBarStyle';\nimport type { IProgressbarColumnBodyDefine } from '../../ts-types/list-table/define/progressbar-define';\nimport type { Group } from '../graphic/group';\nimport type { Icon } from '../graphic/icon';\nimport { updateImageCellContentWhileResize } from '../group-creater/cell-type/image-cell';\nimport { createProgressBarCell } from '../group-creater/cell-type/progress-bar-cell';\nimport { createSparkLineCellGroup } from '../group-creater/cell-type/spark-line-cell';\nimport type { Scenegraph } from '../scenegraph';\nimport { getCellMergeInfo } from '../utils/get-cell-merge';\nimport { getProp } from '../utils/get-prop';\nimport { getQuadProps } from '../utils/padding';\nimport { updateCellContentWidth } from '../utils/text-icon-layout';\nimport { updateCellHeightForRow } from './update-height';\n// import { updateAutoRowHeight } from './auto-height';\n\n/**\n * @description: 更新指定列列宽,在拖拽调整列宽中使用\n * @param {Scenegraph} scene\n * @param {number} col\n * @param {number} detaX\n * @return {*}\n */\nexport function updateColWidth(scene: Scenegraph, col: number, detaX: number) {\n // getColWidth会进行Math.round,所以先从colWidthsMap获取:\n // 如果是数值,直接使用;如果不是,则通过getColWidth获取像素值\n // const widthCache = (scene.table as any).colWidthsMap.get(col);\n // let width = 0;\n // if (typeof widthCache === 'number') {\n // width = widthCache;\n // } else {\n // width = scene.table.getColWidth(col);\n // }\n\n const { autoRowHeight } = scene.table.internalProps;\n let needRerangeRow = false;\n const colOrCornerHeaderColumn = scene.getColGroup(col, true) as Group;\n const oldColOrCornerHeaderColumnWidth = colOrCornerHeaderColumn?.attribute.width;\n colOrCornerHeaderColumn?.setAttribute('width', oldColOrCornerHeaderColumnWidth + detaX);\n // 更新单元格宽度\n colOrCornerHeaderColumn?.forEachChildren((cell: Group, index: number) => {\n const isHeightChange = updateCellWidth(\n scene,\n cell,\n col,\n // index,\n cell.row,\n oldColOrCornerHeaderColumnWidth,\n detaX,\n // true\n index < scene.table.columnHeaderLevelCount,\n autoRowHeight\n );\n if (isHeightChange) {\n const mergeInfo = getCellMergeInfo(scene.table, cell.col, cell.row);\n if (mergeInfo && mergeInfo.end.row - mergeInfo.start.row) {\n for (let row = mergeInfo.start.row; row <= mergeInfo.end.row; row++) {\n resetRowHeight(scene, row);\n }\n } else {\n resetRowHeight(scene, cell.row);\n }\n needRerangeRow = true;\n }\n });\n\n if (needRerangeRow) {\n let newTotalHeight = 0;\n for (let col = 0; col < scene.table.colCount; col++) {\n const colGroup = scene.getColGroup(col, true);\n let y = 0;\n colGroup.forEachChildren((cellGroup: Group) => {\n if (cellGroup.role !== 'cell') {\n return;\n }\n cellGroup.setAttribute('y', y);\n y += cellGroup.attribute.height;\n });\n newTotalHeight = y;\n }\n scene.updateContainerHeight(0, newTotalHeight - scene.colHeaderGroup.attribute.height);\n }\n\n needRerangeRow = false;\n const rowHeaderOrBodyColumn = scene.getColGroup(col) as Group;\n const oldRowHeaderOrBodyColumn = rowHeaderOrBodyColumn.attribute.width;\n rowHeaderOrBodyColumn?.setAttribute('width', oldRowHeaderOrBodyColumn + detaX);\n rowHeaderOrBodyColumn?.forEachChildren((cell: Group, index: number) => {\n const isHeightChange = updateCellWidth(\n scene,\n cell,\n // col + (!isRowHeader ? scene.table.frozenColCount : 0),\n cell.col,\n // index + scene.table.frozenRowCount,\n cell.row,\n oldRowHeaderOrBodyColumn,\n detaX,\n // isRowHeader\n col < scene.table.rowHeaderLevelCount,\n autoRowHeight\n );\n if (isHeightChange) {\n const mergeInfo = getCellMergeInfo(scene.table, cell.col, cell.row);\n if (mergeInfo && mergeInfo.end.row - mergeInfo.start.row) {\n for (let row = mergeInfo.start.row; row <= mergeInfo.end.row; row++) {\n resetRowHeight(scene, row);\n }\n } else {\n resetRowHeight(scene, cell.row);\n }\n needRerangeRow = true;\n }\n });\n\n if (needRerangeRow) {\n let newTotalHeight = 0;\n for (let col = 0; col < scene.table.colCount; col++) {\n const colGroup = scene.getColGroup(col, false);\n let y = 0;\n colGroup.forEachChildren((cellGroup: Group) => {\n if (cellGroup.role !== 'cell') {\n return;\n }\n cellGroup.setAttribute('y', y);\n y += cellGroup.attribute.height;\n });\n newTotalHeight = y;\n }\n scene.updateContainerHeight(scene.table.frozenRowCount, newTotalHeight - scene.bodyGroup.attribute.height);\n }\n\n // 更新剩余列位置\n if (col < scene.frozenColCount) {\n scene.cornerHeaderGroup.forEachChildrenSkipChild((column: Group, index) => {\n if (column.col > col) {\n column.setAttribute('x', column.attribute.x + detaX);\n }\n });\n scene.rowHeaderGroup.forEachChildrenSkipChild((column: Group, index) => {\n if (column.col > col) {\n column.setAttribute('x', column.attribute.x + detaX);\n }\n });\n } else {\n scene.colHeaderGroup.forEachChildrenSkipChild((column: Group, index) => {\n if (column.col > col) {\n column.setAttribute('x', column.attribute.x + detaX);\n }\n });\n scene.bodyGroup.forEachChildrenSkipChild((column: Group, index) => {\n if (column.col > col) {\n column.setAttribute('x', column.attribute.x + detaX);\n }\n });\n }\n\n scene.table.setColWidth(col, rowHeaderOrBodyColumn.attribute.width, true);\n}\n\n/**\n * @description: 更新单个单元格宽度\n * @return {*}\n */\nfunction updateCellWidth(\n scene: Scenegraph,\n cell: Group,\n col: number,\n row: number,\n width: number, // old width, not dist\n detaX: number,\n isHeader: boolean,\n // autoColWidth: boolean,\n autoRowHeight: boolean\n): boolean {\n let cellGroup;\n let distWidth;\n const mergeInfo = getCellMergeInfo(scene.table, col, row);\n // TO BE FIXED 这里使用横向和纵向来判断单元格merge情况,目前没有横纵都merge的情况,\n // 如果有这里的逻辑要修改\n if (mergeInfo && mergeInfo.end.col - mergeInfo.start.col) {\n // 更新横向merge cell width\n const mergeCell = scene.getCell(mergeInfo.start.col, mergeInfo.start.row);\n const mergeCellWidth = mergeCell.attribute.width;\n mergeCell.setAttribute('width', mergeCellWidth + detaX);\n\n cellGroup = mergeCell;\n distWidth = mergeCell.attribute.width;\n col = cellGroup.col;\n row = cellGroup.row;\n } else if (mergeInfo && mergeInfo.start.row === row) {\n // 更新纵向merge cell width,只更新一次\n cell.setAttribute('width', width + detaX);\n\n cellGroup = cell;\n distWidth = width + detaX;\n col = cellGroup.col;\n row = cellGroup.row;\n } else if (!mergeInfo) {\n cell.setAttribute('width', width + detaX);\n cellGroup = cell;\n distWidth = width + detaX;\n }\n\n if (!cellGroup) {\n // 合并单元格非主单元格,不处理\n return false;\n }\n\n // 更新单元格布局\n const type = scene.table.isHeader(col, row)\n ? scene.table._getHeaderLayoutMap(col, row).headerType\n : scene.table.getBodyColumnType(col, row);\n let isHeightChange = false;\n if (type === 'progressbar') {\n // 目前先采用重新生成节点的方案\n const columnDefine = scene.table.getBodyColumnDefine(col, row) as IProgressbarColumnBodyDefine;\n const style = scene.table._getCellStyle(col, row) as ProgressBarStyle;\n const value = scene.table.getCellValue(col, row);\n const dataValue = scene.table.getCellOriginValue(col, row);\n const padding = getQuadProps(getProp('padding', style, col, row, scene.table));\n\n const newBarCell = createProgressBarCell(\n columnDefine,\n style,\n cellGroup.attribute.width,\n // cellGroup.attribute.height,\n value,\n dataValue,\n col,\n row,\n padding,\n scene.table\n );\n\n const oldBarCell = cellGroup.getChildByName('progress-bar') as Group;\n // cell.replaceChild(newBarCell, oldBarCell);\n cellGroup.insertBefore(newBarCell, oldBarCell);\n cellGroup.removeChild(oldBarCell);\n oldBarCell.removeAllChild();\n oldBarCell.release();\n } else if (type === 'sparkline') {\n // 目前先采用重新生成节点的方案\n cellGroup.removeAllChild();\n const headerStyle = scene.table._getCellStyle(col, row);\n const padding = getQuadProps(getProp('padding', headerStyle, col, row, scene.table));\n createSparkLineCellGroup(\n cellGroup,\n cellGroup.parent,\n cellGroup.attribute.x,\n cellGroup.attribute.y,\n col,\n row,\n cellGroup.attribute.width,\n cellGroup.attribute.height,\n padding,\n scene.table\n );\n } else if (type === 'image' || type === 'video') {\n // // 只更新背景边框\n // const rect = cell.firstChild as Rect;\n // rect.setAttribute('width', cell.attribute.width);\n updateImageCellContentWhileResize(cellGroup, col, row, scene.table);\n } else {\n // 处理文字\n const style = scene.table._getCellStyle(col, row);\n isHeightChange = updateCellContentWidth(\n cellGroup,\n distWidth,\n detaX,\n autoRowHeight,\n getQuadProps(style.padding as number),\n style.textAlign,\n style.textBaseline,\n scene\n );\n }\n\n return isHeightChange;\n}\n\n/**\n * @description: 重置指定行行高\n * @param {Scenegraph} scene\n * @param {number} row\n * @return {*}\n */\nfunction resetRowHeight(scene: Scenegraph, row: number) {\n let maxHeight = 0;\n // 获取高度\n for (let col = 0; col < scene.table.colCount; col++) {\n const cell = scene.highPerformanceGetCell(col, row);\n let cellHeight = getCleanCellHeight(cell, scene);\n const mergeInfo = getCellMergeInfo(scene.table, col, row);\n if (mergeInfo && mergeInfo.end.row - mergeInfo.start.row) {\n cellHeight = cellHeight / (mergeInfo.end.row - mergeInfo.start.row + 1);\n }\n maxHeight = Math.max(maxHeight, cellHeight);\n }\n\n // 更新高度\n for (let col = 0; col < scene.table.colCount; col++) {\n let distHeight = maxHeight;\n const cell = scene.highPerformanceGetCell(col, row);\n const mergeInfo = getCellMergeInfo(scene.table, col, row);\n if (mergeInfo && mergeInfo.end.row - mergeInfo.start.row) {\n for (let rowIndex = mergeInfo.start.row; rowIndex <= mergeInfo.end.row; rowIndex++) {\n if (rowIndex !== row) {\n distHeight += scene.table.getRowHeight(rowIndex);\n }\n }\n }\n updateCellHeightForRow(scene, cell, col, row, distHeight, 0, scene.table.isHeader(col, row));\n }\n\n // 更新table行高存储\n scene.table.setRowHeight(row, maxHeight, true);\n}\n\nfunction getCleanCellHeight(cell: Group, scene: Scenegraph) {\n let maxHeight = 0;\n cell.forEachChildren((child: Icon) => {\n if (\n child.role === 'icon-left' ||\n child.role === 'icon-right' ||\n child.name === 'text' ||\n child.name === 'content'\n ) {\n maxHeight = Math.max(maxHeight, child.AABBBounds.height());\n }\n });\n\n const padding = getQuadProps(scene.table._getCellStyle(cell.col, cell.row).padding as number);\n return maxHeight + padding[0] + padding[2];\n}\n"]}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export function updateChartSize(scenegraph, col) {
|
|
2
|
+
var _a;
|
|
3
|
+
for (let c = col; c < scenegraph.table.colCount; c++) {
|
|
4
|
+
const columnGroup = scenegraph.getColGroup(c);
|
|
5
|
+
(null === (_a = columnGroup.attribute) || void 0 === _a ? void 0 : _a.chartInstance) && columnGroup.getChildren().forEach((cellNode => {
|
|
6
|
+
const width = scenegraph.table.getColWidth(cellNode.col), height = scenegraph.table.getRowHeight(cellNode.row);
|
|
7
|
+
cellNode.children.forEach((node => {
|
|
8
|
+
"chart" === node.type && (node.cacheCanvas = null, node.setAttribute("width", Math.ceil(width - node.attribute.cellPadding[3] - node.attribute.cellPadding[1])),
|
|
9
|
+
node.setAttribute("height", Math.ceil(height - node.attribute.cellPadding[0] - node.attribute.cellPadding[2])),
|
|
10
|
+
node.setAttribute("viewBox", {
|
|
11
|
+
x1: Math.ceil(cellNode.globalAABBBounds.x1 + node.attribute.cellPadding[3] + scenegraph.table.scrollLeft),
|
|
12
|
+
x2: Math.ceil(cellNode.globalAABBBounds.x1 + width - node.attribute.cellPadding[1] + scenegraph.table.scrollLeft),
|
|
13
|
+
y1: Math.ceil(cellNode.globalAABBBounds.y1 + node.attribute.cellPadding[0] + scenegraph.table.scrollTop),
|
|
14
|
+
y2: Math.ceil(cellNode.globalAABBBounds.y1 + height - node.attribute.cellPadding[2] + scenegraph.table.scrollTop)
|
|
15
|
+
}));
|
|
16
|
+
}));
|
|
17
|
+
}));
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=update-chart.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["scenegraph/refresh-node/update-chart.ts"],"names":[],"mappings":"AAKA,MAAM,UAAU,eAAe,CAAC,UAAsB,EAAE,GAAW;;IAEjE,KAAK,IAAI,CAAC,GAAG,GAAG,EAAE,CAAC,GAAG,UAAU,CAAC,KAAK,CAAC,QAAQ,EAAE,CAAC,EAAE,EAAE;QACpD,MAAM,WAAW,GAAG,UAAU,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC;QAC9C,MAAM,aAAa,GAAG,MAAC,WAAW,CAAC,SAAiB,0CAAE,aAAa,CAAC;QACpE,IAAI,aAAa,EAAE;YAEjB,WAAW,CAAC,WAAW,EAAE,CAAC,OAAO,CAAC,CAAC,QAAe,EAAE,EAAE;gBACpD,MAAM,KAAK,GAAG,UAAU,CAAC,KAAK,CAAC,WAAW,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC;gBACzD,MAAM,MAAM,GAAG,UAAU,CAAC,KAAK,CAAC,YAAY,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC;gBAE3D,QAAQ,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,IAAW,EAAE,EAAE;oB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,SAAS,CACnG;yBACF,CAAC,CAAC;qBACJ;gBACH,CAAC,CAAC,CAAC;YACL,CAAC,CAAC,CAAC;SACJ;KACF;AACH,CAAC","file":"update-chart.js","sourcesContent":["import type { Chart } from '../graphic/chart';\nimport type { Group } from '../graphic/group';\nimport type { Scenegraph } from '../scenegraph';\n\n/** 供调整列宽后更新chart使用 */\nexport function updateChartSize(scenegraph: Scenegraph, col: number) {\n // 将调整列宽的后面的面也都一起需要调整viewbox。 TODO:columnResizeType支持后需要根据变化的列去调整,范围可能变多或者变少\n for (let c = col; c < scenegraph.table.colCount; c++) {\n const columnGroup = scenegraph.getColGroup(c);\n const chartInstance = (columnGroup.attribute as any)?.chartInstance;\n if (chartInstance) {\n // chartInstance.updateViewBox();\n columnGroup.getChildren().forEach((cellNode: Group) => {\n const width = scenegraph.table.getColWidth(cellNode.col);\n const height = scenegraph.table.getRowHeight(cellNode.row);\n\n cellNode.children.forEach((node: Chart) => {\n if ((node as any).type === 'chart') {\n // 调试问题使用\n // if (columnGroup.col === 2) {\n // columnGroup.AABBBounds.width();\n // node.AABBBounds.width();\n // console.log(\n // 'set viewbox y1',\n // Math.ceil(cellNode.globalAABBBounds.y1 + node.attribute.cellPadding[0] + scenegraph.table.scrollTop),\n // node.globalAABBBounds.height()\n // );\n\n // console.log(\n // 'updateChartSize',\n // columnGroup,\n // columnGroup.globalAABBBounds.y1,\n // cellNode.globalAABBBounds.y1,\n // node.globalAABBBounds.y1\n // );\n // }\n\n node.cacheCanvas = null;\n node.setAttribute(\n 'width',\n Math.ceil(width - node.attribute.cellPadding[3] - node.attribute.cellPadding[1])\n );\n node.setAttribute(\n 'height',\n Math.ceil(height - node.attribute.cellPadding[0] - node.attribute.cellPadding[2])\n );\n\n node.setAttribute('viewBox', {\n x1: Math.ceil(cellNode.globalAABBBounds.x1 + node.attribute.cellPadding[3] + scenegraph.table.scrollLeft),\n x2: Math.ceil(\n cellNode.globalAABBBounds.x1 + width - node.attribute.cellPadding[1] + scenegraph.table.scrollLeft\n ),\n y1: Math.ceil(cellNode.globalAABBBounds.y1 + node.attribute.cellPadding[0] + scenegraph.table.scrollTop),\n y2: Math.ceil(\n cellNode.globalAABBBounds.y1 + height - node.attribute.cellPadding[2] + scenegraph.table.scrollTop\n )\n });\n }\n });\n });\n }\n }\n}\n"]}
|
|
@@ -1,11 +1,16 @@
|
|
|
1
1
|
import type { IStage, IRect } from '@visactor/vrender';
|
|
2
|
-
import type
|
|
2
|
+
import { type CellAddress, type CellType, type ColumnIconOption, type SortOrder, IconFuncTypeEnum } from '../ts-types';
|
|
3
3
|
import { Group } from './graphic/group';
|
|
4
4
|
import type { Icon } from './graphic/icon';
|
|
5
5
|
import { TableComponent } from './component/table-component';
|
|
6
6
|
import { SceneProxy } from './group-creater/progress/proxy';
|
|
7
7
|
import type { BaseTableAPI } from '../ts-types/base-table';
|
|
8
|
-
export
|
|
8
|
+
export type MergeMap = Map<string, {
|
|
9
|
+
x: number;
|
|
10
|
+
y: number;
|
|
11
|
+
cellWidth: number;
|
|
12
|
+
cellHeight: number;
|
|
13
|
+
}>;
|
|
9
14
|
export declare class Scenegraph {
|
|
10
15
|
proxy: SceneProxy;
|
|
11
16
|
tableGroup: Group;
|
|
@@ -32,6 +37,7 @@ export declare class Scenegraph {
|
|
|
32
37
|
frozenColCount: number;
|
|
33
38
|
frozenRowCount: number;
|
|
34
39
|
clear: boolean;
|
|
40
|
+
mergeMap: MergeMap;
|
|
35
41
|
constructor(table: BaseTableAPI);
|
|
36
42
|
get width(): number;
|
|
37
43
|
get height(): number;
|
|
@@ -40,6 +46,7 @@ export declare class Scenegraph {
|
|
|
40
46
|
get bodyRowStart(): number;
|
|
41
47
|
get bodyRowEnd(): number;
|
|
42
48
|
initSceneGraph(): void;
|
|
49
|
+
clearCells(): void;
|
|
43
50
|
createComponent(): void;
|
|
44
51
|
createSceneGraph(): void;
|
|
45
52
|
createHeaderSceneGraph(): void;
|
|
@@ -73,7 +80,10 @@ export declare class Scenegraph {
|
|
|
73
80
|
setIconHoverStyle(icon: Icon, col: number, row: number, cellGroup: Group): void;
|
|
74
81
|
setIconNormalStyle(icon: Icon, col: number, row: number): void;
|
|
75
82
|
updateColWidth(col: number, detaX: number): void;
|
|
83
|
+
updateChartSize(col: number): void;
|
|
76
84
|
updateAutoColWidth(col: number): void;
|
|
85
|
+
recalculateColWidths(): void;
|
|
86
|
+
resize(): void;
|
|
77
87
|
updateTableSize(): void;
|
|
78
88
|
updateRowHeight(row: number, detaY: number): void;
|
|
79
89
|
updateContainerWidth(col: number, detaX: number): void;
|
|
@@ -90,7 +100,6 @@ export declare class Scenegraph {
|
|
|
90
100
|
updateCellLayoutWidthCertainWidth(columnGroup: Group, detaRow: number, col: number): boolean;
|
|
91
101
|
updateHeaderPosition(colSource: number, rowSource: number, colTarget: number, rowTarget: number): void;
|
|
92
102
|
updateContainer(): void;
|
|
93
|
-
clearCells(): void;
|
|
94
103
|
updateCellContentWhileResize(col: number, row: number): void;
|
|
95
104
|
createFrameBorder(): void;
|
|
96
105
|
getResizeColAt(abstractX: number, abstractY: number, cellGroup?: Group, offset?: number): {
|
|
@@ -108,4 +117,7 @@ export declare class Scenegraph {
|
|
|
108
117
|
updateDrill(visible: boolean, x: number, y: number, drillDown: boolean, drillUp: boolean): void;
|
|
109
118
|
updateCellContent(col: number, row: number): void;
|
|
110
119
|
setPixelRatio(pixelRatio: number): void;
|
|
120
|
+
updateHierarchyIcon(col: number, row: number): void;
|
|
121
|
+
updateRow(removeCells: CellAddress[], addCells: CellAddress[]): void;
|
|
122
|
+
findAndUpdateIcon(group: Group, funcTypeArr: IconFuncTypeEnum[], iconConfig: ColumnIconOption): void;
|
|
111
123
|
}
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import { createStage, createRect, IContainPointMode, container } from "@visactor/vrender";
|
|
2
2
|
|
|
3
|
+
import { IconFuncTypeEnum } from "../ts-types";
|
|
4
|
+
|
|
5
|
+
import { isArray, isString } from "@visactor/vutils";
|
|
6
|
+
|
|
3
7
|
import { Group } from "./graphic/group";
|
|
4
8
|
|
|
5
9
|
import { createBodyColGroup, createColHeaderColGroup, createCornerHeaderColGroup, createRowHeaderColGroup } from "./group-creater/column";
|
|
@@ -16,7 +20,7 @@ import { updateRowHeight } from "./layout/update-height";
|
|
|
16
20
|
|
|
17
21
|
import { updateImageCellContentWhileResize } from "./group-creater/cell-type/image-cell";
|
|
18
22
|
|
|
19
|
-
import {
|
|
23
|
+
import { getQuadProps } from "./utils/padding";
|
|
20
24
|
|
|
21
25
|
import { createFrameBorder, updateFrameBorder, updateFrameBorderSize } from "./style/frame-border";
|
|
22
26
|
|
|
@@ -44,17 +48,22 @@ import { moveSelectingRangeComponentsToSelectedRangeComponents } from "./select/
|
|
|
44
48
|
|
|
45
49
|
import { deleteAllSelectBorder, deleteLastSelectedRangeComponents } from "./select/delete-select-border";
|
|
46
50
|
|
|
51
|
+
import { updateRow } from "./layout/update-row";
|
|
52
|
+
|
|
47
53
|
import { handleTextStick } from "./stick-text";
|
|
48
54
|
|
|
49
|
-
|
|
55
|
+
import { emptyGroup } from "./utils/empty-group";
|
|
56
|
+
|
|
57
|
+
import { updateChartSize } from "./refresh-node/update-chart";
|
|
50
58
|
|
|
51
|
-
|
|
59
|
+
import { dealFrozen, resetFrozen } from "./layout/frozen";
|
|
52
60
|
|
|
53
|
-
|
|
61
|
+
container.load(splitModule);
|
|
54
62
|
|
|
55
63
|
export class Scenegraph {
|
|
56
64
|
constructor(table) {
|
|
57
|
-
this.table = table, this.hasFrozen = !1, this.clear = !0, this.
|
|
65
|
+
this.table = table, this.hasFrozen = !1, this.clear = !0, this.mergeMap = new Map,
|
|
66
|
+
this.stage = createStage({
|
|
58
67
|
canvas: table.canvas,
|
|
59
68
|
width: table.canvas.width,
|
|
60
69
|
height: table.canvas.height,
|
|
@@ -154,6 +163,37 @@ export class Scenegraph {
|
|
|
154
163
|
this.tableGroup.addChild(rowHeaderGroup), this.tableGroup.addChild(colHeaderGroup),
|
|
155
164
|
this.tableGroup.addChild(cornerHeaderGroup), this.tableGroup.addChild(componentGroup);
|
|
156
165
|
}
|
|
166
|
+
clearCells() {
|
|
167
|
+
this.clear = !0, this.hasFrozen = !1, this.mergeMap.clear(), this.colHeaderGroup.clear(),
|
|
168
|
+
this.rowHeaderGroup.clear(), this.cornerHeaderGroup.clear(), this.bodyGroup.clear(),
|
|
169
|
+
this.colHeaderGroup.setAttributes({
|
|
170
|
+
x: 0,
|
|
171
|
+
y: 0,
|
|
172
|
+
width: 0,
|
|
173
|
+
height: 0
|
|
174
|
+
}), this.rowHeaderGroup.setAttributes({
|
|
175
|
+
x: 0,
|
|
176
|
+
y: 0,
|
|
177
|
+
width: 0,
|
|
178
|
+
height: 0
|
|
179
|
+
}), this.cornerHeaderGroup.setAttributes({
|
|
180
|
+
x: 0,
|
|
181
|
+
y: 0,
|
|
182
|
+
width: 0,
|
|
183
|
+
height: 0
|
|
184
|
+
}), this.bodyGroup.setAttributes({
|
|
185
|
+
x: 0,
|
|
186
|
+
y: 0,
|
|
187
|
+
width: 0,
|
|
188
|
+
height: 0
|
|
189
|
+
}), this.tableGroup.setAttributes({
|
|
190
|
+
x: 0,
|
|
191
|
+
y: 0,
|
|
192
|
+
width: 0,
|
|
193
|
+
height: 0
|
|
194
|
+
}), this.tableGroup.border && (this.tableGroup.parent.removeChild(this.tableGroup.border),
|
|
195
|
+
delete this.tableGroup.border);
|
|
196
|
+
}
|
|
157
197
|
createComponent() {
|
|
158
198
|
this.component = new TableComponent(this.table), this.component.addToGroup(this.componentGroup),
|
|
159
199
|
this.selectedRangeComponents = new Map, this.selectingRangeComponents = new Map;
|
|
@@ -161,8 +201,8 @@ export class Scenegraph {
|
|
|
161
201
|
createSceneGraph() {
|
|
162
202
|
this.clear = !1, computeColsWidth(this.table), this.frozenColCount = this.table.rowHeaderLevelCount,
|
|
163
203
|
this.frozenRowCount = this.table.columnHeaderLevelCount, this.proxy = new SceneProxy(this.table),
|
|
164
|
-
this.
|
|
165
|
-
|
|
204
|
+
createFrameBorder(this.tableGroup, this.table.theme.frameStyle, this.tableGroup.role, void 0, !0),
|
|
205
|
+
this.createHeaderSceneGraph(), this.transpose || this.isPivot ? this.createBodySceneGraph() : this.createBodySceneGraphForFirstScreen();
|
|
166
206
|
}
|
|
167
207
|
createHeaderSceneGraph() {
|
|
168
208
|
createCornerHeaderColGroup(this.cornerHeaderGroup, 0, 0, this.table), this.colHeaderGroup.setAttribute("x", this.cornerHeaderGroup.attribute.width),
|
|
@@ -210,7 +250,7 @@ export class Scenegraph {
|
|
|
210
250
|
return cell || emptyGroup;
|
|
211
251
|
}
|
|
212
252
|
highPerformanceGetCell(col, row) {
|
|
213
|
-
return this.isPivot || this.transpose || this.table.isHeader(col, row) ? this.getCell(col, row) : this.proxy.highPerformanceGetCell(col, row);
|
|
253
|
+
return this.isPivot || this.transpose || this.table.isHeader(col, row) ? this.getCell(col, row) : this.proxy.highPerformanceGetCell(col, row, 0, this.table.rowCount - 1);
|
|
214
254
|
}
|
|
215
255
|
getColGroup(col, isCornerOrColHeader = !1) {
|
|
216
256
|
let element;
|
|
@@ -296,7 +336,7 @@ export class Scenegraph {
|
|
|
296
336
|
width: icon.backgroundWidth,
|
|
297
337
|
height: icon.backgroundHeight,
|
|
298
338
|
fill: icon.attribute.backgroundColor,
|
|
299
|
-
|
|
339
|
+
cornerRadius: 5,
|
|
300
340
|
visible: !0
|
|
301
341
|
}) : (iconBack = createRect({
|
|
302
342
|
x: (null !== (_d = icon.attribute.x) && void 0 !== _d ? _d : 0) + (null !== (_e = icon.attribute.dx) && void 0 !== _e ? _e : 0) + (icon.AABBBounds.width() - icon.backgroundWidth) / 2,
|
|
@@ -304,7 +344,7 @@ export class Scenegraph {
|
|
|
304
344
|
width: icon.backgroundWidth,
|
|
305
345
|
height: icon.backgroundHeight,
|
|
306
346
|
fill: icon.attribute.backgroundColor,
|
|
307
|
-
|
|
347
|
+
cornerRadius: 5,
|
|
308
348
|
pickable: !1,
|
|
309
349
|
visible: !0
|
|
310
350
|
}), iconBack.name = "icon-back"), icon.parent.insertBefore(iconBack, icon);
|
|
@@ -334,12 +374,23 @@ export class Scenegraph {
|
|
|
334
374
|
iconBack && iconBack.setAttribute("visible", !1), icon.attribute.hoverImage && icon.attribute.image !== icon.attribute.originImage && (icon.image = icon.attribute.originImage);
|
|
335
375
|
}
|
|
336
376
|
updateColWidth(col, detaX) {
|
|
337
|
-
updateColWidth(this, col, detaX), this.
|
|
377
|
+
updateColWidth(this, col, detaX), this.updateContainer();
|
|
378
|
+
}
|
|
379
|
+
updateChartSize(col) {
|
|
380
|
+
updateChartSize(this, col);
|
|
338
381
|
}
|
|
339
382
|
updateAutoColWidth(col) {
|
|
340
383
|
const oldWidth = this.table.getColWidth(col), newWidth = computeColWidth(col, 0, this.table.rowCount - 1, this.table, !0);
|
|
341
384
|
newWidth !== oldWidth && this.updateColWidth(col, newWidth - oldWidth);
|
|
342
385
|
}
|
|
386
|
+
recalculateColWidths() {
|
|
387
|
+
computeColsWidth(this.table, !0);
|
|
388
|
+
}
|
|
389
|
+
resize() {
|
|
390
|
+
this.recalculateColWidths(), this.table.internalProps.autoRowHeight && updateAutoRowHeight(this, !0),
|
|
391
|
+
this.dealWidthMode(), this.dealFrozen(), this.updateTableSize(), this.updateBorderSizeAndPosition(),
|
|
392
|
+
this.component.updateScrollBar(), this.updateNextFrame();
|
|
393
|
+
}
|
|
343
394
|
updateTableSize() {
|
|
344
395
|
var _a, _b;
|
|
345
396
|
this.tableGroup.setAttributes({
|
|
@@ -393,7 +444,8 @@ export class Scenegraph {
|
|
|
393
444
|
afterScenegraphCreated() {
|
|
394
445
|
const {autoRowHeight: autoRowHeight} = this.table.internalProps;
|
|
395
446
|
autoRowHeight && updateAutoRowHeight(this), this.dealWidthMode(), this.dealFrozen(),
|
|
396
|
-
this.createFrameBorder(), this.
|
|
447
|
+
this.createFrameBorder(), this.updateBorderSizeAndPosition(), this.component.updateScrollBar(),
|
|
448
|
+
handleTextStick(this.table), this.updateNextFrame();
|
|
397
449
|
}
|
|
398
450
|
dealWidthMode() {
|
|
399
451
|
const table = this.table;
|
|
@@ -441,51 +493,10 @@ export class Scenegraph {
|
|
|
441
493
|
});
|
|
442
494
|
}
|
|
443
495
|
dealFrozen() {
|
|
444
|
-
|
|
445
|
-
if (this.table.frozenColCount > this.table.rowHeaderLevelCount) {
|
|
446
|
-
this.rowHeaderGroup.setAttribute("height", this.bodyGroup.attribute.height), this.rowHeaderGroup.setAttribute("y", this.bodyGroup.attribute.y),
|
|
447
|
-
this.cornerHeaderGroup.setAttribute("height", this.colHeaderGroup.attribute.height);
|
|
448
|
-
for (let i = 0; i < this.table.frozenColCount - this.table.rowHeaderLevelCount; i++) {
|
|
449
|
-
const column = this.bodyGroup.firstChild;
|
|
450
|
-
column && (this.rowHeaderGroup.appendChild(column), this.rowHeaderGroup.setAttribute("width", this.rowHeaderGroup.attribute.width + column.attribute.width),
|
|
451
|
-
this.bodyGroup.setAttribute("width", this.bodyGroup.attribute.width - column.attribute.width));
|
|
452
|
-
const headerColumn = this.colHeaderGroup.firstChild;
|
|
453
|
-
headerColumn && (this.cornerHeaderGroup.appendChild(headerColumn), this.cornerHeaderGroup.setAttribute("width", this.cornerHeaderGroup.attribute.width + headerColumn.attribute.width),
|
|
454
|
-
this.colHeaderGroup.setAttribute("width", this.colHeaderGroup.attribute.width - headerColumn.attribute.width));
|
|
455
|
-
}
|
|
456
|
-
}
|
|
457
|
-
this.bodyGroup.setAttribute("x", this.rowHeaderGroup.attribute.width), this.colHeaderGroup.setAttribute("x", this.cornerHeaderGroup.attribute.width);
|
|
458
|
-
const bodyDeltaX = null !== (_b = null === (_a = this.bodyGroup.firstChild) || void 0 === _a ? void 0 : _a.attribute.x) && void 0 !== _b ? _b : 0;
|
|
459
|
-
this.bodyGroup.forEachChildrenSkipChild((column => {
|
|
460
|
-
column.setAttribute("x", column.attribute.x - bodyDeltaX);
|
|
461
|
-
}));
|
|
462
|
-
const colDeltaX = null !== (_d = null === (_c = this.colHeaderGroup.firstChild) || void 0 === _c ? void 0 : _c.attribute.x) && void 0 !== _d ? _d : 0;
|
|
463
|
-
this.colHeaderGroup.forEachChildrenSkipChild((column => {
|
|
464
|
-
column.setAttribute("x", column.attribute.x - colDeltaX);
|
|
465
|
-
})), this.updateBorderSizeAndPosition(), this.isPivot || this.transpose || this.component.setFrozenColumnShadow(this.table.frozenColCount - 1),
|
|
466
|
-
this.hasFrozen = !0, this.frozenColCount = this.table.frozenColCount, this.frozenRowCount = null !== (_f = null === (_e = this.colHeaderGroup.firstChild) || void 0 === _e ? void 0 : _e.childrenCount) && void 0 !== _f ? _f : 0;
|
|
496
|
+
dealFrozen(this);
|
|
467
497
|
}
|
|
468
498
|
resetFrozen() {
|
|
469
|
-
|
|
470
|
-
if (this.frozenColCount > this.table.rowHeaderLevelCount) for (let i = 0; i < this.frozenColCount - this.table.rowHeaderLevelCount; i++) {
|
|
471
|
-
const column = this.rowHeaderGroup.lastChild instanceof Group ? this.rowHeaderGroup.lastChild : this.rowHeaderGroup.lastChild._prev;
|
|
472
|
-
column && (this.bodyGroup.insertBefore(column, this.bodyGroup.firstChild), this.bodyGroup.setAttribute("width", this.bodyGroup.attribute.width + column.attribute.width),
|
|
473
|
-
this.rowHeaderGroup.setAttribute("width", this.rowHeaderGroup.attribute.width - column.attribute.width));
|
|
474
|
-
const headerColumn = this.cornerHeaderGroup.lastChild instanceof Group ? this.cornerHeaderGroup.lastChild : this.cornerHeaderGroup.lastChild._prev;
|
|
475
|
-
headerColumn && (this.colHeaderGroup.insertBefore(headerColumn, this.colHeaderGroup.firstChild),
|
|
476
|
-
this.colHeaderGroup.setAttribute("width", this.colHeaderGroup.attribute.width + headerColumn.attribute.width),
|
|
477
|
-
this.cornerHeaderGroup.setAttribute("width", this.cornerHeaderGroup.attribute.width - headerColumn.attribute.width));
|
|
478
|
-
}
|
|
479
|
-
this.bodyGroup.setAttribute("x", this.rowHeaderGroup.attribute.width), this.colHeaderGroup.setAttribute("x", this.cornerHeaderGroup.attribute.width);
|
|
480
|
-
let bodyX = 0;
|
|
481
|
-
this.bodyGroup.forEachChildrenSkipChild((column => {
|
|
482
|
-
column.setAttribute("x", bodyX), bodyX += column.attribute.width;
|
|
483
|
-
}));
|
|
484
|
-
let colX = 0;
|
|
485
|
-
this.colHeaderGroup.forEachChildrenSkipChild((column => {
|
|
486
|
-
column.setAttribute("x", colX), colX += column.attribute.width;
|
|
487
|
-
})), this.updateBorderSizeAndPosition(), this.isPivot || this.transpose || this.component.setFrozenColumnShadow(this.table.frozenColCount - 1),
|
|
488
|
-
this.hasFrozen = !0, this.frozenColCount = this.table.rowHeaderLevelCount, this.frozenRowCount = null !== (_b = null === (_a = this.colHeaderGroup.firstChild) || void 0 === _a ? void 0 : _a.childrenCount) && void 0 !== _b ? _b : 0;
|
|
499
|
+
resetFrozen(this);
|
|
489
500
|
}
|
|
490
501
|
updateCellLayoutWidthCertainWidth(columnGroup, detaRow, col) {
|
|
491
502
|
const width = columnGroup.attribute.width;
|
|
@@ -494,7 +505,7 @@ export class Scenegraph {
|
|
|
494
505
|
row += detaRow;
|
|
495
506
|
const mergeInfo = getCellMergeInfo(this.table, col, row);
|
|
496
507
|
mergeInfo ? cellGroup = this.getCell(mergeInfo.start.col, mergeInfo.start.row) : cellGroup.setAttribute("width", width);
|
|
497
|
-
const headerStyle = this.table._getCellStyle(col, row), padding =
|
|
508
|
+
const headerStyle = this.table._getCellStyle(col, row), padding = getQuadProps(getProp("padding", headerStyle, col, row, this.table)), text = cellGroup.getChildByName("text");
|
|
498
509
|
let oldCellHeight = 0, newCellHeight = 0;
|
|
499
510
|
if (text) oldCellHeight = text.AABBBounds.height() + (padding[0] + padding[2]),
|
|
500
511
|
text.setAttribute("maxLineWidth", width - (padding[1] + padding[3])), newCellHeight = text.AABBBounds.height() + (padding[0] + padding[2]); else {
|
|
@@ -530,41 +541,11 @@ export class Scenegraph {
|
|
|
530
541
|
this.colHeaderGroup.setDeltaWidth(colHeaderX - this.colHeaderGroup.attribute.width),
|
|
531
542
|
this.rowHeaderGroup.setDeltaWidth(rowHeaderX - this.rowHeaderGroup.attribute.width),
|
|
532
543
|
this.bodyGroup.setDeltaWidth(bodyX - this.bodyGroup.attribute.width), this.colHeaderGroup.setAttribute("x", this.cornerHeaderGroup.attribute.width),
|
|
533
|
-
this.bodyGroup.setAttribute("x", this.rowHeaderGroup.attribute.width);
|
|
544
|
+
this.bodyGroup.setAttribute("x", this.rowHeaderGroup.attribute.width), this.updateTableSize();
|
|
534
545
|
const oldHorizontalBarPos = this.table.stateManeger.scroll.horizontalBarPos, oldVerticalBarPos = this.table.stateManeger.scroll.verticalBarPos;
|
|
535
546
|
this.component.updateScrollBar(), this.table.stateManeger.setScrollLeft(oldHorizontalBarPos),
|
|
536
547
|
this.table.stateManeger.setScrollTop(oldVerticalBarPos), this.updateNextFrame();
|
|
537
548
|
}
|
|
538
|
-
clearCells() {
|
|
539
|
-
this.clear = !0, this.hasFrozen = !1, this.colHeaderGroup.clear(), this.rowHeaderGroup.clear(),
|
|
540
|
-
this.cornerHeaderGroup.clear(), this.bodyGroup.clear(), this.colHeaderGroup.setAttributes({
|
|
541
|
-
x: 0,
|
|
542
|
-
y: 0,
|
|
543
|
-
width: 0,
|
|
544
|
-
height: 0
|
|
545
|
-
}), this.rowHeaderGroup.setAttributes({
|
|
546
|
-
x: 0,
|
|
547
|
-
y: 0,
|
|
548
|
-
width: 0,
|
|
549
|
-
height: 0
|
|
550
|
-
}), this.cornerHeaderGroup.setAttributes({
|
|
551
|
-
x: 0,
|
|
552
|
-
y: 0,
|
|
553
|
-
width: 0,
|
|
554
|
-
height: 0
|
|
555
|
-
}), this.bodyGroup.setAttributes({
|
|
556
|
-
x: 0,
|
|
557
|
-
y: 0,
|
|
558
|
-
width: 0,
|
|
559
|
-
height: 0
|
|
560
|
-
}), this.tableGroup.setAttributes({
|
|
561
|
-
x: 0,
|
|
562
|
-
y: 0,
|
|
563
|
-
width: 0,
|
|
564
|
-
height: 0
|
|
565
|
-
}), this.tableGroup.border && (this.tableGroup.parent.removeChild(this.tableGroup.border),
|
|
566
|
-
delete this.tableGroup.border);
|
|
567
|
-
}
|
|
568
549
|
updateCellContentWhileResize(col, row) {
|
|
569
550
|
const type = this.table.getBodyColumnType(col, row), cellGroup = this.getCell(col, row);
|
|
570
551
|
"image" !== type && "video" !== type || updateImageCellContentWhileResize(cellGroup, col, row, this.table);
|
|
@@ -576,7 +557,7 @@ export class Scenegraph {
|
|
|
576
557
|
createFrameBorder(this.rowHeaderGroup, this.isPivot ? this.table.theme.rowHeaderStyle.frameStyle : this.table.theme.bodyStyle.frameStyle, this.rowHeaderGroup.role, isListTableWithFrozen ? [ !0, !1, !0, !0 ] : void 0),
|
|
577
558
|
createFrameBorder(this.colHeaderGroup, this.table.theme.headerStyle.frameStyle, this.colHeaderGroup.role, isListTableWithFrozen ? [ !0, !0, !0, !1 ] : void 0),
|
|
578
559
|
createFrameBorder(this.cornerHeaderGroup, this.isPivot ? this.table.theme.cornerHeaderStyle.frameStyle : this.table.theme.headerStyle.frameStyle, this.cornerHeaderGroup.role, isListTableWithFrozen ? [ !0, !1, !0, !0 ] : void 0),
|
|
579
|
-
createFrameBorder(this.tableGroup, this.table.theme.frameStyle, this.tableGroup.role);
|
|
560
|
+
createFrameBorder(this.tableGroup, this.table.theme.frameStyle, this.tableGroup.role, void 0);
|
|
580
561
|
}
|
|
581
562
|
getResizeColAt(abstractX, abstractY, cellGroup, offset = ResizeColumnHotSpotSize / 2) {
|
|
582
563
|
if (cellGroup) {
|
|
@@ -626,16 +607,16 @@ export class Scenegraph {
|
|
|
626
607
|
const updateCol = Math.max(col, oldFrozenCol);
|
|
627
608
|
this.colHeaderGroup.forEachChildrenSkipChild((colGroup => !(colGroup.col <= updateCol) || (colGroup.forEachChildren((cellGroup => {
|
|
628
609
|
cellGroup.forEachChildren((icon => {
|
|
629
|
-
if ("
|
|
630
|
-
const iconConfig = this.table.internalProps.headerHelper.
|
|
610
|
+
if ("frozen" === icon.attribute.funcType) {
|
|
611
|
+
const iconConfig = this.table.internalProps.headerHelper.getFrozenIcon(cellGroup.col, cellGroup.row);
|
|
631
612
|
return this.updateIcon(icon, iconConfig), !0;
|
|
632
613
|
}
|
|
633
614
|
return !1;
|
|
634
615
|
}));
|
|
635
616
|
})), !1))), this.cornerHeaderGroup.forEachChildrenSkipChild((colGroup => !(colGroup.col <= updateCol) || (colGroup.forEachChildren((cellGroup => {
|
|
636
617
|
cellGroup.forEachChildren((icon => {
|
|
637
|
-
if ("
|
|
638
|
-
const iconConfig = this.table.internalProps.headerHelper.
|
|
618
|
+
if ("frozen" === icon.attribute.funcType) {
|
|
619
|
+
const iconConfig = this.table.internalProps.headerHelper.getFrozenIcon(cellGroup.col, cellGroup.row);
|
|
639
620
|
return this.updateIcon(icon, iconConfig), !0;
|
|
640
621
|
}
|
|
641
622
|
return !1;
|
|
@@ -650,9 +631,9 @@ export class Scenegraph {
|
|
|
650
631
|
getCellOverflowText(col, row) {
|
|
651
632
|
const text = this.getCell(col, row).getChildByName("text", !0);
|
|
652
633
|
if (text) {
|
|
653
|
-
const textAttributeStr = text.attribute.text.join("");
|
|
634
|
+
const textAttributeStr = isArray(text.attribute.text) ? text.attribute.text.join("") : text.attribute.text;
|
|
654
635
|
let cacheStr = "";
|
|
655
|
-
if (text.cache.layoutData.lines.forEach((line => {
|
|
636
|
+
if (isString(text.cache.clipedText) ? cacheStr = text.cache.clipedText : text.cache.layoutData.lines.forEach((line => {
|
|
656
637
|
cacheStr += line.str;
|
|
657
638
|
})), cacheStr !== textAttributeStr) return textAttributeStr;
|
|
658
639
|
}
|
|
@@ -668,6 +649,23 @@ export class Scenegraph {
|
|
|
668
649
|
this.stage.disableDirtyBounds(), this.stage.window.setDpr(pixelRatio), this.stage.render(),
|
|
669
650
|
this.stage.enableDirtyBounds();
|
|
670
651
|
}
|
|
652
|
+
updateHierarchyIcon(col, row) {
|
|
653
|
+
const cellGroup = this.getCell(col, row);
|
|
654
|
+
let iconConfig;
|
|
655
|
+
iconConfig = this.table.isHeader(col, row) ? this.table.internalProps.headerHelper.getHierarchyIcon(cellGroup.col, cellGroup.row) : this.table.internalProps.bodyHelper.getHierarchyIcon(cellGroup.col, cellGroup.row),
|
|
656
|
+
this.findAndUpdateIcon(cellGroup, [ IconFuncTypeEnum.collapse, IconFuncTypeEnum.expand ], iconConfig);
|
|
657
|
+
}
|
|
658
|
+
updateRow(removeCells, addCells) {
|
|
659
|
+
updateRow(removeCells, addCells, this.table), this.recalculateColWidths(), this.table.internalProps.autoRowHeight && updateAutoRowHeight(this, !0),
|
|
660
|
+
this.table.stateManeger.checkFrozen(), this.updateNextFrame();
|
|
661
|
+
}
|
|
662
|
+
findAndUpdateIcon(group, funcTypeArr, iconConfig) {
|
|
663
|
+
group.forEachChildren((icon => {
|
|
664
|
+
if ("group" === icon.type) this.findAndUpdateIcon(icon, funcTypeArr, iconConfig); else if (-1 !== funcTypeArr.indexOf(icon.attribute.funcType)) return this.updateIcon(icon, iconConfig),
|
|
665
|
+
!0;
|
|
666
|
+
return !1;
|
|
667
|
+
}));
|
|
668
|
+
}
|
|
671
669
|
}
|
|
672
670
|
|
|
673
671
|
function showIcon(scene, cellGroup, visibleTime) {
|