@visactor/vtable 0.17.9-alpha.8 → 0.17.10-alpha.0
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/PivotChart.d.ts +1 -0
- package/cjs/PivotChart.js +24 -0
- package/cjs/PivotChart.js.map +1 -1
- package/cjs/components/axis/label-overlap.js.map +1 -1
- package/cjs/components/tooltip/TooltipHandler.js +1 -2
- package/cjs/components/tooltip/TooltipHandler.js.map +1 -1
- package/cjs/core/BaseTable.d.ts +2 -2
- package/cjs/core/BaseTable.js +1 -1
- package/cjs/core/BaseTable.js.map +1 -1
- package/cjs/core/style.js +1 -2
- package/cjs/core/tableHelper.d.ts +2 -1
- package/cjs/core/tableHelper.js +14 -2
- package/cjs/core/tableHelper.js.map +1 -1
- package/cjs/dataset/dataset.js +5 -5
- package/cjs/dataset/dataset.js.map +1 -1
- package/cjs/event/event.d.ts +1 -1
- package/cjs/event/event.js +1 -1
- package/cjs/event/event.js.map +1 -1
- package/cjs/event/listener/scroll-bar.js.map +1 -1
- package/cjs/event/listener/table-group.js +4 -4
- package/cjs/event/listener/table-group.js.map +1 -1
- package/cjs/event/listener/touch.js.map +1 -1
- package/cjs/event/media-click.js +1 -2
- package/cjs/event/pivot-chart/axis-click.js.map +1 -1
- package/cjs/event/scroll.js +1 -0
- package/cjs/event/util.d.ts +1 -1
- package/cjs/event/util.js.map +1 -1
- package/cjs/index.d.ts +2 -2
- package/cjs/index.js +2 -2
- package/cjs/index.js.map +1 -1
- package/cjs/layout/pivot-header-layout.js +2 -2
- package/cjs/layout/pivot-header-layout.js.map +1 -1
- package/cjs/render/jsx/index.d.ts +2 -3
- package/cjs/render/jsx/index.js +1 -1
- package/cjs/render/jsx/index.js.map +1 -1
- package/cjs/render/layout/arc.d.ts +2 -2
- package/cjs/render/layout/arc.js +1 -1
- package/cjs/render/layout/arc.js.map +1 -1
- package/cjs/render/layout/circle.d.ts +2 -2
- package/cjs/render/layout/circle.js +1 -1
- package/cjs/render/layout/circle.js.map +1 -1
- package/cjs/render/layout/container.d.ts +2 -2
- package/cjs/render/layout/container.js +1 -1
- package/cjs/render/layout/container.js.map +1 -1
- package/cjs/render/layout/group.d.ts +2 -2
- package/cjs/render/layout/group.js +1 -1
- package/cjs/render/layout/group.js.map +1 -1
- package/cjs/render/layout/icon.d.ts +2 -2
- package/cjs/render/layout/icon.js +1 -1
- package/cjs/render/layout/icon.js.map +1 -1
- package/cjs/render/layout/image.d.ts +2 -2
- package/cjs/render/layout/image.js +1 -1
- package/cjs/render/layout/image.js.map +1 -1
- package/cjs/render/layout/rect.d.ts +2 -2
- package/cjs/render/layout/rect.js +1 -1
- package/cjs/render/layout/rect.js.map +1 -1
- package/cjs/render/layout/text.d.ts +1 -1
- package/cjs/render/layout/text.js +1 -1
- package/cjs/render/layout/text.js.map +1 -1
- package/cjs/scenegraph/component/cell-content.d.ts +2 -2
- package/cjs/scenegraph/component/cell-content.js +1 -1
- package/cjs/scenegraph/component/cell-content.js.map +1 -1
- package/cjs/scenegraph/component/cell-mover.d.ts +1 -1
- package/cjs/scenegraph/component/cell-mover.js +1 -1
- package/cjs/scenegraph/component/cell-mover.js.map +1 -1
- package/cjs/scenegraph/component/custom.d.ts +1 -1
- package/cjs/scenegraph/component/custom.js +1 -1
- package/cjs/scenegraph/component/custom.js.map +1 -1
- package/cjs/scenegraph/component/drill-icon.js.map +1 -1
- package/cjs/scenegraph/component/menu.d.ts +1 -1
- package/cjs/scenegraph/component/menu.js +1 -1
- package/cjs/scenegraph/component/menu.js.map +1 -1
- package/cjs/scenegraph/component/table-component.d.ts +1 -1
- package/cjs/scenegraph/component/table-component.js +1 -1
- package/cjs/scenegraph/component/table-component.js.map +1 -1
- package/cjs/scenegraph/debug-tool/debug-tool.d.ts +1 -1
- package/cjs/scenegraph/debug-tool/debug-tool.js +1 -1
- package/cjs/scenegraph/debug-tool/debug-tool.js.map +1 -1
- package/cjs/scenegraph/debug-tool/index.d.ts +1 -1
- package/cjs/scenegraph/debug-tool/index.js.map +1 -1
- package/cjs/scenegraph/graphic/chart.d.ts +2 -2
- package/cjs/scenegraph/graphic/chart.js +1 -1
- package/cjs/scenegraph/graphic/chart.js.map +1 -1
- package/cjs/scenegraph/graphic/contributions/chart-render-helper.js.map +1 -1
- package/cjs/scenegraph/graphic/contributions/chart-render.d.ts +1 -1
- package/cjs/scenegraph/graphic/contributions/chart-render.js +1 -1
- package/cjs/scenegraph/graphic/contributions/chart-render.js.map +1 -1
- package/cjs/scenegraph/graphic/contributions/group-contribution-render.d.ts +2 -2
- package/cjs/scenegraph/graphic/contributions/group-contribution-render.js +4 -3
- package/cjs/scenegraph/graphic/contributions/group-contribution-render.js.map +1 -1
- package/cjs/scenegraph/graphic/contributions/image-contribution-render.d.ts +2 -2
- package/cjs/scenegraph/graphic/contributions/image-contribution-render.js +1 -1
- package/cjs/scenegraph/graphic/contributions/image-contribution-render.js.map +1 -1
- package/cjs/scenegraph/graphic/contributions/index.d.ts +1 -1
- package/cjs/scenegraph/graphic/contributions/index.js +1 -1
- package/cjs/scenegraph/graphic/contributions/index.js.map +1 -1
- package/cjs/scenegraph/graphic/contributions/rect-contribution-render.d.ts +2 -2
- package/cjs/scenegraph/graphic/contributions/rect-contribution-render.js +1 -1
- package/cjs/scenegraph/graphic/contributions/rect-contribution-render.js.map +1 -1
- package/cjs/scenegraph/graphic/group.d.ts +2 -2
- package/cjs/scenegraph/graphic/group.js +1 -1
- package/cjs/scenegraph/graphic/group.js.map +1 -1
- package/cjs/scenegraph/graphic/icon.d.ts +2 -2
- package/cjs/scenegraph/graphic/icon.js +1 -1
- package/cjs/scenegraph/graphic/icon.js.map +1 -1
- package/cjs/scenegraph/graphic/text.d.ts +2 -2
- package/cjs/scenegraph/graphic/text.js +1 -1
- package/cjs/scenegraph/graphic/text.js.map +1 -1
- package/cjs/scenegraph/group-creater/cell-helper.d.ts +1 -1
- package/cjs/scenegraph/group-creater/cell-helper.js +9 -6
- package/cjs/scenegraph/group-creater/cell-helper.js.map +1 -1
- package/cjs/scenegraph/group-creater/cell-type/chart-cell.d.ts +1 -1
- package/cjs/scenegraph/group-creater/cell-type/chart-cell.js +2 -1
- package/cjs/scenegraph/group-creater/cell-type/chart-cell.js.map +1 -1
- package/cjs/scenegraph/group-creater/cell-type/checkbox-cell.d.ts +1 -1
- package/cjs/scenegraph/group-creater/cell-type/checkbox-cell.js +2 -1
- package/cjs/scenegraph/group-creater/cell-type/checkbox-cell.js.map +1 -1
- package/cjs/scenegraph/group-creater/cell-type/image-cell.d.ts +1 -1
- package/cjs/scenegraph/group-creater/cell-type/image-cell.js +3 -2
- package/cjs/scenegraph/group-creater/cell-type/image-cell.js.map +1 -1
- package/cjs/scenegraph/group-creater/cell-type/progress-bar-cell.js +1 -1
- package/cjs/scenegraph/group-creater/cell-type/progress-bar-cell.js.map +1 -1
- package/cjs/scenegraph/group-creater/cell-type/spark-line-cell.d.ts +1 -1
- package/cjs/scenegraph/group-creater/cell-type/spark-line-cell.js +3 -2
- package/cjs/scenegraph/group-creater/cell-type/spark-line-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 +3 -2
- package/cjs/scenegraph/group-creater/cell-type/text-cell.js.map +1 -1
- package/cjs/scenegraph/group-creater/cell-type/video-cell.d.ts +1 -1
- package/cjs/scenegraph/group-creater/cell-type/video-cell.js +3 -2
- package/cjs/scenegraph/group-creater/cell-type/video-cell.js.map +1 -1
- package/cjs/scenegraph/group-creater/column-helper.d.ts +1 -1
- package/cjs/scenegraph/group-creater/column-helper.js +1 -0
- package/cjs/scenegraph/group-creater/column-helper.js.map +1 -1
- package/cjs/scenegraph/group-creater/progress/proxy.js +1 -1
- package/cjs/scenegraph/group-creater/progress/proxy.js.map +1 -1
- package/cjs/scenegraph/icon/icon-update.js +1 -1
- package/cjs/scenegraph/icon/icon-update.js.map +1 -1
- package/cjs/scenegraph/layout/compute-col-width.js +1 -1
- package/cjs/scenegraph/layout/compute-col-width.js.map +1 -1
- package/cjs/scenegraph/layout/compute-row-height.js +1 -1
- package/cjs/scenegraph/layout/compute-row-height.js.map +1 -1
- package/cjs/scenegraph/layout/move-cell.js.map +1 -1
- package/cjs/scenegraph/layout/update-col.js.map +1 -1
- package/cjs/scenegraph/layout/update-height.js.map +1 -1
- package/cjs/scenegraph/layout/update-width.js.map +1 -1
- package/cjs/scenegraph/scenegraph.d.ts +1 -1
- package/cjs/scenegraph/scenegraph.js +6 -8
- package/cjs/scenegraph/scenegraph.js.map +1 -1
- package/cjs/scenegraph/select/create-select-border.js +1 -1
- package/cjs/scenegraph/select/create-select-border.js.map +1 -1
- package/cjs/scenegraph/select/delete-select-border.js.map +1 -1
- package/cjs/scenegraph/select/update-select-border.js.map +1 -1
- package/cjs/scenegraph/stick-text/index.js.map +1 -1
- package/cjs/scenegraph/style/corner-cell.js.map +1 -1
- package/cjs/scenegraph/style/frame-border.d.ts +3 -1
- package/cjs/scenegraph/style/frame-border.js +21 -3
- package/cjs/scenegraph/style/frame-border.js.map +1 -1
- package/cjs/scenegraph/utils/padding.js +1 -1
- package/cjs/scenegraph/utils/padding.js.map +1 -1
- package/cjs/scenegraph/utils/render-service.d.ts +1 -1
- package/cjs/scenegraph/utils/render-service.js +1 -1
- package/cjs/scenegraph/utils/render-service.js.map +1 -1
- package/cjs/scenegraph/utils/text-icon-layout.d.ts +1 -1
- package/cjs/scenegraph/utils/text-icon-layout.js +1 -1
- package/cjs/scenegraph/utils/text-icon-layout.js.map +1 -1
- package/cjs/scenegraph/utils/text-measure.d.ts +2 -2
- package/cjs/scenegraph/utils/text-measure.js +1 -1
- package/cjs/scenegraph/utils/text-measure.js.map +1 -1
- package/cjs/scenegraph/utils/text-pos.d.ts +1 -1
- package/cjs/scenegraph/utils/text-pos.js.map +1 -1
- package/cjs/state/spark-line/index.js +1 -1
- package/cjs/state/spark-line/index.js.map +1 -1
- package/cjs/state/state.d.ts +1 -1
- package/cjs/state/state.js.map +1 -1
- package/cjs/themes/ARCO.js +1 -2
- package/cjs/themes/BRIGHT.js +2 -1
- package/cjs/tools/NumberMap.js +1 -1
- package/cjs/ts-types/component/title.d.ts +1 -1
- package/cjs/ts-types/component/title.js.map +1 -1
- package/cjs/ts-types/events.d.ts +3 -4
- package/cjs/ts-types/events.js.map +1 -1
- package/cjs/ts-types/table-engine.d.ts +4 -0
- package/cjs/ts-types/table-engine.js.map +1 -1
- package/cjs/vrender.d.ts +3 -0
- package/cjs/vrender.js +34 -0
- package/cjs/vrender.js.map +1 -0
- package/dist/vtable.js +320 -167
- package/dist/vtable.min.js +2 -2
- package/es/PivotChart.d.ts +1 -0
- package/es/PivotChart.js +24 -0
- package/es/PivotChart.js.map +1 -1
- package/es/components/axis/label-overlap.js.map +1 -1
- package/es/components/tooltip/TooltipHandler.js +1 -2
- package/es/components/tooltip/TooltipHandler.js.map +1 -1
- package/es/core/BaseTable.d.ts +2 -2
- package/es/core/BaseTable.js +1 -1
- package/es/core/BaseTable.js.map +1 -1
- package/es/core/style.js +1 -2
- package/es/core/tableHelper.d.ts +2 -1
- package/es/core/tableHelper.js +13 -1
- package/es/core/tableHelper.js.map +1 -1
- package/es/dataset/dataset.js +5 -5
- package/es/dataset/dataset.js.map +1 -1
- package/es/event/event.d.ts +1 -1
- package/es/event/event.js +1 -1
- package/es/event/event.js.map +1 -1
- package/es/event/listener/scroll-bar.js.map +1 -1
- package/es/event/listener/table-group.js +4 -4
- package/es/event/listener/table-group.js.map +1 -1
- package/es/event/listener/touch.js.map +1 -1
- package/es/event/media-click.js +1 -2
- package/es/event/pivot-chart/axis-click.js.map +1 -1
- package/es/event/scroll.js +2 -1
- package/es/event/util.d.ts +1 -1
- package/es/event/util.js.map +1 -1
- package/es/index.d.ts +2 -2
- package/es/index.js +2 -2
- package/es/index.js.map +1 -1
- package/es/layout/pivot-header-layout.js +1 -1
- package/es/layout/pivot-header-layout.js.map +1 -1
- package/es/render/jsx/index.d.ts +2 -3
- package/es/render/jsx/index.js +1 -1
- package/es/render/jsx/index.js.map +1 -1
- package/es/render/layout/arc.d.ts +2 -2
- package/es/render/layout/arc.js +1 -1
- package/es/render/layout/arc.js.map +1 -1
- package/es/render/layout/circle.d.ts +2 -2
- package/es/render/layout/circle.js +1 -1
- package/es/render/layout/circle.js.map +1 -1
- package/es/render/layout/container.d.ts +2 -2
- package/es/render/layout/container.js +1 -1
- package/es/render/layout/container.js.map +1 -1
- package/es/render/layout/group.d.ts +2 -2
- package/es/render/layout/group.js +1 -1
- package/es/render/layout/group.js.map +1 -1
- package/es/render/layout/icon.d.ts +2 -2
- package/es/render/layout/icon.js +1 -1
- package/es/render/layout/icon.js.map +1 -1
- package/es/render/layout/image.d.ts +2 -2
- package/es/render/layout/image.js +1 -1
- package/es/render/layout/image.js.map +1 -1
- package/es/render/layout/rect.d.ts +2 -2
- package/es/render/layout/rect.js +1 -1
- package/es/render/layout/rect.js.map +1 -1
- package/es/render/layout/text.d.ts +1 -1
- package/es/render/layout/text.js +1 -1
- package/es/render/layout/text.js.map +1 -1
- package/es/scenegraph/component/cell-content.d.ts +2 -2
- package/es/scenegraph/component/cell-content.js +1 -1
- package/es/scenegraph/component/cell-content.js.map +1 -1
- package/es/scenegraph/component/cell-mover.d.ts +1 -1
- package/es/scenegraph/component/cell-mover.js +1 -1
- package/es/scenegraph/component/cell-mover.js.map +1 -1
- package/es/scenegraph/component/custom.d.ts +1 -1
- package/es/scenegraph/component/custom.js +1 -1
- package/es/scenegraph/component/custom.js.map +1 -1
- package/es/scenegraph/component/drill-icon.js.map +1 -1
- package/es/scenegraph/component/menu.d.ts +1 -1
- package/es/scenegraph/component/menu.js +1 -1
- package/es/scenegraph/component/menu.js.map +1 -1
- package/es/scenegraph/component/table-component.d.ts +1 -1
- package/es/scenegraph/component/table-component.js +1 -1
- package/es/scenegraph/component/table-component.js.map +1 -1
- package/es/scenegraph/debug-tool/debug-tool.d.ts +1 -1
- package/es/scenegraph/debug-tool/debug-tool.js +1 -1
- package/es/scenegraph/debug-tool/debug-tool.js.map +1 -1
- package/es/scenegraph/debug-tool/index.d.ts +1 -1
- package/es/scenegraph/debug-tool/index.js.map +1 -1
- package/es/scenegraph/graphic/chart.d.ts +2 -2
- package/es/scenegraph/graphic/chart.js +1 -1
- package/es/scenegraph/graphic/chart.js.map +1 -1
- package/es/scenegraph/graphic/contributions/chart-render-helper.js.map +1 -1
- package/es/scenegraph/graphic/contributions/chart-render.d.ts +1 -1
- package/es/scenegraph/graphic/contributions/chart-render.js +1 -1
- package/es/scenegraph/graphic/contributions/chart-render.js.map +1 -1
- package/es/scenegraph/graphic/contributions/group-contribution-render.d.ts +2 -2
- package/es/scenegraph/graphic/contributions/group-contribution-render.js +3 -3
- package/es/scenegraph/graphic/contributions/group-contribution-render.js.map +1 -1
- package/es/scenegraph/graphic/contributions/image-contribution-render.d.ts +2 -2
- package/es/scenegraph/graphic/contributions/image-contribution-render.js +1 -1
- package/es/scenegraph/graphic/contributions/image-contribution-render.js.map +1 -1
- package/es/scenegraph/graphic/contributions/index.d.ts +1 -1
- package/es/scenegraph/graphic/contributions/index.js +1 -1
- package/es/scenegraph/graphic/contributions/index.js.map +1 -1
- package/es/scenegraph/graphic/contributions/rect-contribution-render.d.ts +2 -2
- package/es/scenegraph/graphic/contributions/rect-contribution-render.js +1 -1
- package/es/scenegraph/graphic/contributions/rect-contribution-render.js.map +1 -1
- package/es/scenegraph/graphic/group.d.ts +2 -2
- package/es/scenegraph/graphic/group.js +1 -1
- package/es/scenegraph/graphic/group.js.map +1 -1
- package/es/scenegraph/graphic/icon.d.ts +2 -2
- package/es/scenegraph/graphic/icon.js +1 -1
- package/es/scenegraph/graphic/icon.js.map +1 -1
- package/es/scenegraph/graphic/text.d.ts +2 -2
- package/es/scenegraph/graphic/text.js +1 -1
- package/es/scenegraph/graphic/text.js.map +1 -1
- package/es/scenegraph/group-creater/cell-helper.d.ts +1 -1
- package/es/scenegraph/group-creater/cell-helper.js +8 -6
- package/es/scenegraph/group-creater/cell-helper.js.map +1 -1
- package/es/scenegraph/group-creater/cell-type/chart-cell.d.ts +1 -1
- package/es/scenegraph/group-creater/cell-type/chart-cell.js +2 -1
- package/es/scenegraph/group-creater/cell-type/chart-cell.js.map +1 -1
- package/es/scenegraph/group-creater/cell-type/checkbox-cell.d.ts +1 -1
- package/es/scenegraph/group-creater/cell-type/checkbox-cell.js +2 -1
- package/es/scenegraph/group-creater/cell-type/checkbox-cell.js.map +1 -1
- package/es/scenegraph/group-creater/cell-type/image-cell.d.ts +1 -1
- package/es/scenegraph/group-creater/cell-type/image-cell.js +3 -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 +1 -1
- package/es/scenegraph/group-creater/cell-type/progress-bar-cell.js.map +1 -1
- package/es/scenegraph/group-creater/cell-type/spark-line-cell.d.ts +1 -1
- package/es/scenegraph/group-creater/cell-type/spark-line-cell.js +3 -2
- package/es/scenegraph/group-creater/cell-type/spark-line-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 +3 -2
- package/es/scenegraph/group-creater/cell-type/text-cell.js.map +1 -1
- package/es/scenegraph/group-creater/cell-type/video-cell.d.ts +1 -1
- package/es/scenegraph/group-creater/cell-type/video-cell.js +3 -2
- package/es/scenegraph/group-creater/cell-type/video-cell.js.map +1 -1
- package/es/scenegraph/group-creater/column-helper.d.ts +1 -1
- package/es/scenegraph/group-creater/column-helper.js +3 -2
- package/es/scenegraph/group-creater/column-helper.js.map +1 -1
- package/es/scenegraph/group-creater/progress/proxy.js +1 -1
- package/es/scenegraph/group-creater/progress/proxy.js.map +1 -1
- package/es/scenegraph/icon/icon-update.js +1 -1
- package/es/scenegraph/icon/icon-update.js.map +1 -1
- package/es/scenegraph/layout/compute-col-width.js +1 -1
- package/es/scenegraph/layout/compute-col-width.js.map +1 -1
- package/es/scenegraph/layout/compute-row-height.js +1 -1
- package/es/scenegraph/layout/compute-row-height.js.map +1 -1
- package/es/scenegraph/layout/move-cell.js.map +1 -1
- package/es/scenegraph/layout/update-col.js.map +1 -1
- package/es/scenegraph/layout/update-height.js.map +1 -1
- package/es/scenegraph/layout/update-width.js.map +1 -1
- package/es/scenegraph/scenegraph.d.ts +1 -1
- package/es/scenegraph/scenegraph.js +6 -5
- package/es/scenegraph/scenegraph.js.map +1 -1
- package/es/scenegraph/select/create-select-border.js +1 -1
- package/es/scenegraph/select/create-select-border.js.map +1 -1
- package/es/scenegraph/select/delete-select-border.js.map +1 -1
- package/es/scenegraph/select/update-select-border.js.map +1 -1
- package/es/scenegraph/stick-text/index.js.map +1 -1
- package/es/scenegraph/style/corner-cell.js.map +1 -1
- package/es/scenegraph/style/frame-border.d.ts +3 -1
- package/es/scenegraph/style/frame-border.js +18 -1
- package/es/scenegraph/style/frame-border.js.map +1 -1
- package/es/scenegraph/utils/padding.js +1 -1
- package/es/scenegraph/utils/padding.js.map +1 -1
- package/es/scenegraph/utils/render-service.d.ts +1 -1
- package/es/scenegraph/utils/render-service.js +1 -1
- package/es/scenegraph/utils/render-service.js.map +1 -1
- package/es/scenegraph/utils/text-icon-layout.d.ts +1 -1
- package/es/scenegraph/utils/text-icon-layout.js +1 -1
- package/es/scenegraph/utils/text-icon-layout.js.map +1 -1
- package/es/scenegraph/utils/text-measure.d.ts +2 -2
- package/es/scenegraph/utils/text-measure.js +1 -1
- package/es/scenegraph/utils/text-measure.js.map +1 -1
- package/es/scenegraph/utils/text-pos.d.ts +1 -1
- package/es/scenegraph/utils/text-pos.js.map +1 -1
- package/es/state/spark-line/index.js +1 -1
- package/es/state/spark-line/index.js.map +1 -1
- package/es/state/state.d.ts +1 -1
- package/es/state/state.js.map +1 -1
- package/es/themes/ARCO.js +1 -2
- package/es/themes/BRIGHT.js +2 -1
- package/es/tools/NumberMap.js +1 -1
- package/es/ts-types/component/title.d.ts +1 -1
- package/es/ts-types/component/title.js.map +1 -1
- package/es/ts-types/events.d.ts +3 -4
- package/es/ts-types/events.js.map +1 -1
- package/es/ts-types/table-engine.d.ts +4 -0
- package/es/ts-types/table-engine.js.map +1 -1
- package/es/vrender.d.ts +3 -0
- package/es/vrender.js +18 -0
- package/es/vrender.js.map +1 -0
- package/package.json +6 -5
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
export { VGroup, VSymbol, VRect, VArc, VArea, VCircle, VGlyph, VImage, VLine, VPath, VPolygon, VText, jsx } from '
|
|
1
|
+
export { VGroup, VSymbol, VRect, VArc, VArea, VCircle, VGlyph, VImage, VLine, VPath, VPolygon, VText, jsx } from './../../vrender';
|
|
2
2
|
import type { TagAttributes } from '@visactor/vrender-components';
|
|
3
|
-
import { Tag } from '@visactor/vrender-components';
|
|
4
3
|
type IDefaultGraphicParamsType<T> = {
|
|
5
4
|
attribute?: T;
|
|
6
5
|
};
|
|
7
|
-
export declare function VTag(params: IDefaultGraphicParamsType<TagAttributes>):
|
|
6
|
+
export declare function VTag(params: IDefaultGraphicParamsType<TagAttributes>): any;
|
package/cjs/render/jsx/index.js
CHANGED
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: !0
|
|
5
5
|
}), exports.VTag = exports.jsx = exports.VText = exports.VPolygon = exports.VPath = exports.VLine = exports.VImage = exports.VGlyph = exports.VCircle = exports.VArea = exports.VArc = exports.VRect = exports.VSymbol = exports.VGroup = void 0;
|
|
6
6
|
|
|
7
|
-
var vrender_1 = require("
|
|
7
|
+
var vrender_1 = require("./../../vrender");
|
|
8
8
|
|
|
9
9
|
Object.defineProperty(exports, "VGroup", {
|
|
10
10
|
enumerable: !0,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/render/jsx/index.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"sources":["../src/render/jsx/index.ts"],"names":[],"mappings":";;;AAAA,2CAcyB;AAbvB,iGAAA,MAAM,OAAA;AACN,kGAAA,OAAO,OAAA;AACP,gGAAA,KAAK,OAAA;AACL,+FAAA,IAAI,OAAA;AACJ,gGAAA,KAAK,OAAA;AACL,kGAAA,OAAO,OAAA;AACP,iGAAA,MAAM,OAAA;AACN,iGAAA,MAAM,OAAA;AACN,gGAAA,KAAK,OAAA;AACL,gGAAA,KAAK,OAAA;AACL,mGAAA,QAAQ,OAAA;AACR,gGAAA,KAAK,OAAA;AACL,8FAAA,GAAG,OAAA;AAGL,qEAAmD;AAMnD,SAAgB,IAAI,CAAC,MAAgD;IACnE,OAAO,IAAI,wBAAG,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,CAAQ,CAAC;AACxD,CAAC;AAFD,oBAEC","file":"index.js","sourcesContent":["export {\n VGroup,\n VSymbol,\n VRect,\n VArc,\n VArea,\n VCircle,\n VGlyph,\n VImage,\n VLine,\n VPath,\n VPolygon,\n VText,\n jsx\n} from './../../vrender';\nimport type { TagAttributes } from '@visactor/vrender-components';\nimport { Tag } from '@visactor/vrender-components';\n\ntype IDefaultGraphicParamsType<T> = {\n attribute?: T;\n};\n\nexport function VTag(params: IDefaultGraphicParamsType<TagAttributes>) {\n return new Tag(params ? params.attribute : {}) as any;\n}\n"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { IArcGraphicAttribute } from '
|
|
2
|
-
import { Arc as VArc } from '
|
|
1
|
+
import type { IArcGraphicAttribute } from './../../vrender';
|
|
2
|
+
import { Arc as VArc } from './../../vrender';
|
|
3
3
|
type IArcOption = {
|
|
4
4
|
marginTop?: number;
|
|
5
5
|
marginRight?: number;
|
package/cjs/render/layout/arc.js
CHANGED
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: !0
|
|
5
5
|
}), exports.Arc = void 0;
|
|
6
6
|
|
|
7
|
-
const vrender_1 = require("
|
|
7
|
+
const vrender_1 = require("./../../vrender"), vutils_1 = require("@visactor/vutils");
|
|
8
8
|
|
|
9
9
|
class Arc extends vrender_1.Arc {
|
|
10
10
|
constructor(options) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/render/layout/arc.ts"],"names":[],"mappings":";;;AACA
|
|
1
|
+
{"version":3,"sources":["../src/render/layout/arc.ts"],"names":[],"mappings":";;;AACA,6CAA8C;AAC9C,6CAA2C;AAS3C,MAAa,GAAI,SAAQ,aAAI;IAC3B,YAAY,OAAmB;;QAC7B,MAAM,eAAe,GAAG,IAAA,gBAAO,EAAC,OAAO,CAAC,aAAa,CAAC,CAAC;QACvD,MAAM,OAAO,GAAG;YACd,MAAA,MAAA,OAAO,CAAC,SAAS,mCAAI,CAAC,eAAe,CAAC,CAAC,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,aAAa,CAAC,mCAAI,CAAC;YAC9F,MAAA,MAAA,OAAO,CAAC,WAAW,mCAAI,CAAC,eAAe,CAAC,CAAC,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,aAAa,CAAC,mCAAI,CAAC;YAChG,MAAA,MAAA,OAAO,CAAC,YAAY,mCAClB,CAAC,eAAe,CAAC,CAAC,CAAC,MAAA,OAAO,CAAC,aAAa,CAAC,CAAC,CAAC,mCAAI,OAAO,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,aAAa,CAAC,mCAChG,CAAC;YACH,MAAA,MAAA,OAAO,CAAC,UAAU,mCAChB,CAAC,eAAe,CAAC,CAAC,CAAC,MAAA,OAAO,CAAC,aAAa,CAAC,CAAC,CAAC,mCAAI,OAAO,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,aAAa,CAAC,mCAChG,CAAC;SACJ,CAAC;QACF,OAAO,CAAC,aAAa,GAAG,OAAO,CAAC;QAEhC,KAAK,CAAC,OAAO,CAAC,CAAC;IACjB,CAAC;CACF;AAjBD,kBAiBC","file":"arc.js","sourcesContent":["import type { IArcGraphicAttribute } from './../../vrender';\nimport { Arc as VArc } from './../../vrender';\nimport { isArray } from '@visactor/vutils';\n\ntype IArcOption = {\n marginTop?: number;\n marginRight?: number;\n marginBottom?: number;\n marginLeft?: number;\n} & IArcGraphicAttribute;\n\nexport class Arc extends VArc {\n constructor(options: IArcOption) {\n const isPaddingNumber = isArray(options.boundsPadding);\n const padding = [\n options.marginTop ?? (isPaddingNumber ? options.boundsPadding[0] : options.boundsPadding) ?? 0,\n options.marginRight ?? (isPaddingNumber ? options.boundsPadding[1] : options.boundsPadding) ?? 0,\n options.marginBottom ??\n (isPaddingNumber ? options.boundsPadding[2] ?? options.boundsPadding[0] : options.boundsPadding) ??\n 0,\n options.marginLeft ??\n (isPaddingNumber ? options.boundsPadding[3] ?? options.boundsPadding[1] : options.boundsPadding) ??\n 0\n ];\n options.boundsPadding = padding;\n\n super(options);\n }\n}\n"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { ICircleGraphicAttribute } from '
|
|
2
|
-
import { Circle as VCircle } from '
|
|
1
|
+
import type { ICircleGraphicAttribute } from './../../vrender';
|
|
2
|
+
import { Circle as VCircle } from './../../vrender';
|
|
3
3
|
type ICircleOption = {
|
|
4
4
|
marginTop?: number;
|
|
5
5
|
marginRight?: number;
|
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: !0
|
|
5
5
|
}), exports.Circle = void 0;
|
|
6
6
|
|
|
7
|
-
const vrender_1 = require("
|
|
7
|
+
const vrender_1 = require("./../../vrender"), vutils_1 = require("@visactor/vutils");
|
|
8
8
|
|
|
9
9
|
class Circle extends vrender_1.Circle {
|
|
10
10
|
constructor(options) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/render/layout/circle.ts"],"names":[],"mappings":";;;AACA
|
|
1
|
+
{"version":3,"sources":["../src/render/layout/circle.ts"],"names":[],"mappings":";;;AACA,6CAAoD;AACpD,6CAA2C;AAS3C,MAAa,MAAO,SAAQ,gBAAO;IACjC,YAAY,OAAsB;;QAChC,MAAM,eAAe,GAAG,IAAA,gBAAO,EAAC,OAAO,CAAC,aAAa,CAAC,CAAC;QACvD,MAAM,OAAO,GAAG;YACd,MAAA,MAAA,OAAO,CAAC,SAAS,mCAAI,CAAC,eAAe,CAAC,CAAC,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,aAAa,CAAC,mCAAI,CAAC;YAC9F,MAAA,MAAA,OAAO,CAAC,WAAW,mCAAI,CAAC,eAAe,CAAC,CAAC,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,aAAa,CAAC,mCAAI,CAAC;YAChG,MAAA,MAAA,OAAO,CAAC,YAAY,mCAClB,CAAC,eAAe,CAAC,CAAC,CAAC,MAAA,OAAO,CAAC,aAAa,CAAC,CAAC,CAAC,mCAAI,OAAO,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,aAAa,CAAC,mCAChG,CAAC;YACH,MAAA,MAAA,OAAO,CAAC,UAAU,mCAChB,CAAC,eAAe,CAAC,CAAC,CAAC,MAAA,OAAO,CAAC,aAAa,CAAC,CAAC,CAAC,mCAAI,OAAO,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,aAAa,CAAC,mCAChG,CAAC;SACJ,CAAC;QACF,OAAO,CAAC,aAAa,GAAG,OAAO,CAAC;QAEhC,KAAK,CAAC,OAAO,CAAC,CAAC;IACjB,CAAC;CACF;AAjBD,wBAiBC","file":"circle.js","sourcesContent":["import type { ICircleGraphicAttribute } from './../../vrender';\nimport { Circle as VCircle } from './../../vrender';\nimport { isArray } from '@visactor/vutils';\n\ntype ICircleOption = {\n marginTop?: number;\n marginRight?: number;\n marginBottom?: number;\n marginLeft?: number;\n} & ICircleGraphicAttribute;\n\nexport class Circle extends VCircle {\n constructor(options: ICircleOption) {\n const isPaddingNumber = isArray(options.boundsPadding);\n const padding = [\n options.marginTop ?? (isPaddingNumber ? options.boundsPadding[0] : options.boundsPadding) ?? 0,\n options.marginRight ?? (isPaddingNumber ? options.boundsPadding[1] : options.boundsPadding) ?? 0,\n options.marginBottom ??\n (isPaddingNumber ? options.boundsPadding[2] ?? options.boundsPadding[0] : options.boundsPadding) ??\n 0,\n options.marginLeft ??\n (isPaddingNumber ? options.boundsPadding[3] ?? options.boundsPadding[1] : options.boundsPadding) ??\n 0\n ];\n options.boundsPadding = padding;\n\n super(options);\n }\n}\n"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { IGroupGraphicAttribute } from '
|
|
2
|
-
import { Group } from '
|
|
1
|
+
import type { IGroupGraphicAttribute } from './../../vrender';
|
|
2
|
+
import { Group } from './../../vrender';
|
|
3
3
|
import type { percentCalcObj } from './percent-calc';
|
|
4
4
|
export type IContainerOptions = {
|
|
5
5
|
width?: number | percentCalcObj;
|
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: !0
|
|
5
5
|
}), exports.Container = void 0;
|
|
6
6
|
|
|
7
|
-
const vutils_1 = require("@visactor/vutils"), vrender_1 = require("
|
|
7
|
+
const vutils_1 = require("@visactor/vutils"), vrender_1 = require("./../../vrender");
|
|
8
8
|
|
|
9
9
|
class Container extends vrender_1.Group {
|
|
10
10
|
constructor(containerOptions) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/render/layout/container.ts"],"names":[],"mappings":";;;AAAA,6CAA2C;AAE3C
|
|
1
|
+
{"version":3,"sources":["../src/render/layout/container.ts"],"names":[],"mappings":";;;AAAA,6CAA2C;AAE3C,6CAAwC;AAYxC,MAAa,SAAU,SAAQ,eAAK;IAClC,YAAY,gBAAmC;;QAC7C,IAAK,gB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vrender';\nimport { Group } from './../../vrender';\nimport type { percentCalcObj } from './percent-calc';\n\nexport type IContainerOptions = {\n width?: number | percentCalcObj;\n height?: number | percentCalcObj;\n marginTop?: number;\n marginRight?: number;\n marginBottom?: number;\n marginLeft?: number;\n} & IGroupGraphicAttribute;\n\nexport class Container extends Group {\n constructor(containerOptions: IContainerOptions) {\n if ((containerOptions as any).direction) {\n containerOptions.flexDirection = (containerOptions as any).direction;\n }\n if (\n containerOptions.justifyContent &&\n ((containerOptions.justifyContent as any) === 'start' || (containerOptions.justifyContent as any) === 'end')\n ) {\n containerOptions.justifyContent = ('flex-' + containerOptions.justifyContent) as any;\n }\n\n if (\n containerOptions.alignItems &&\n ((containerOptions.alignItems as any) === 'start' || (containerOptions.alignItems as any) === 'end')\n ) {\n containerOptions.alignItems = ('flex-' + containerOptions.alignItems) as any;\n }\n\n if (\n containerOptions.alignContent &&\n ((containerOptions.alignContent as any) === 'start' || (containerOptions.alignContent as any) === 'end')\n ) {\n containerOptions.alignContent = ('flex-' + containerOptions.alignContent) as any;\n }\n containerOptions.display = 'flex';\n if (!containerOptions.flexDirection) {\n containerOptions.flexDirection = 'row';\n }\n\n containerOptions.clip = true;\n containerOptions.fill = (containerOptions?.background as any)?.fill;\n containerOptions.stroke = (containerOptions?.background as any)?.stroke;\n containerOptions.lineWidth = (containerOptions?.background as any)?.lineWidth;\n containerOptions.cornerRadius = (containerOptions?.background as any)?.cornerRadius;\n // containerOptions.flexWrap = 'nowrap';\n\n const isPaddingNumber = isArray(containerOptions.boundsPadding);\n const padding = [\n containerOptions.marginTop ??\n (isPaddingNumber ? containerOptions.boundsPadding[0] : containerOptions.boundsPadding) ??\n 0,\n containerOptions.marginRight ??\n (isPaddingNumber ? containerOptions.boundsPadding[1] : containerOptions.boundsPadding) ??\n 0,\n containerOptions.marginBottom ??\n (isPaddingNumber\n ? containerOptions.boundsPadding[2] ?? containerOptions.boundsPadding[0]\n : containerOptions.boundsPadding) ??\n 0,\n containerOptions.marginLeft ??\n (isPaddingNumber\n ? containerOptions.boundsPadding[3] ?? containerOptions.boundsPadding[1]\n : containerOptions.boundsPadding) ??\n 0\n ];\n containerOptions.boundsPadding = padding;\n\n super(containerOptions);\n }\n}\n"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { IGroupGraphicAttribute } from '
|
|
2
|
-
import { Group as VGroup } from '
|
|
1
|
+
import type { IGroupGraphicAttribute } from './../../vrender';
|
|
2
|
+
import { Group as VGroup } from './../../vrender';
|
|
3
3
|
type IGroupOption = {
|
|
4
4
|
marginTop?: number;
|
|
5
5
|
marginRight?: number;
|
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: !0
|
|
5
5
|
}), exports.Group = void 0;
|
|
6
6
|
|
|
7
|
-
const vrender_1 = require("
|
|
7
|
+
const vrender_1 = require("./../../vrender"), vutils_1 = require("@visactor/vutils");
|
|
8
8
|
|
|
9
9
|
class Group extends vrender_1.Group {
|
|
10
10
|
constructor(options) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/render/layout/group.ts"],"names":[],"mappings":";;;AACA
|
|
1
|
+
{"version":3,"sources":["../src/render/layout/group.ts"],"names":[],"mappings":";;;AACA,6CAAkD;AAClD,6CAA2C;AAS3C,MAAa,KAAM,SAAQ,eAAM;IAC/B,YAAY,OAAqB;;QAC/B,MAAM,eAAe,GAAG,IAAA,gBAAO,EAAC,OAAO,CAAC,aAAa,CAAC,CAAC;QACvD,MAAM,OAAO,GAAG;YACd,MAAA,MAAA,OAAO,CAAC,SAAS,mCAAI,CAAC,eAAe,CAAC,CAAC,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,aAAa,CAAC,mCAAI,CAAC;YAC9F,MAAA,MAAA,OAAO,CAAC,WAAW,mCAAI,CAAC,eAAe,CAAC,CAAC,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,aAAa,CAAC,mCAAI,CAAC;YAChG,MAAA,MAAA,OAAO,CAAC,YAAY,mCAClB,CAAC,eAAe,CAAC,CAAC,CAAC,MAAA,OAAO,CAAC,aAAa,CAAC,CAAC,CAAC,mCAAI,OAAO,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,aAAa,CAAC,mCAChG,CAAC;YACH,MAAA,MAAA,OAAO,CAAC,UAAU,mCAChB,CAAC,eAAe,CAAC,CAAC,CAAC,MAAA,OAAO,CAAC,aAAa,CAAC,CAAC,CAAC,mCAAI,OAAO,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,aAAa,CAAC,mCAChG,CAAC;SACJ,CAAC;QACF,OAAO,CAAC,aAAa,GAAG,OAAO,CAAC;QAEhC,KAAK,CAAC,OAAO,CAAC,CAAC;IACjB,CAAC;CACF;AAjBD,sBAiBC","file":"group.js","sourcesContent":["import type { IGroupGraphicAttribute } from './../../vrender';\nimport { Group as VGroup } from './../../vrender';\nimport { isArray } from '@visactor/vutils';\n\ntype IGroupOption = {\n marginTop?: number;\n marginRight?: number;\n marginBottom?: number;\n marginLeft?: number;\n} & IGroupGraphicAttribute;\n\nexport class Group extends VGroup {\n constructor(options: IGroupOption) {\n const isPaddingNumber = isArray(options.boundsPadding);\n const padding = [\n options.marginTop ?? (isPaddingNumber ? options.boundsPadding[0] : options.boundsPadding) ?? 0,\n options.marginRight ?? (isPaddingNumber ? options.boundsPadding[1] : options.boundsPadding) ?? 0,\n options.marginBottom ??\n (isPaddingNumber ? options.boundsPadding[2] ?? options.boundsPadding[0] : options.boundsPadding) ??\n 0,\n options.marginLeft ??\n (isPaddingNumber ? options.boundsPadding[3] ?? options.boundsPadding[1] : options.boundsPadding) ??\n 0\n ];\n options.boundsPadding = padding;\n\n super(options);\n }\n}\n"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { IImageGraphicAttribute } from '
|
|
2
|
-
import { Image } from '
|
|
1
|
+
import type { IImageGraphicAttribute } from './../../vrender';
|
|
2
|
+
import { Image } from './../../vrender';
|
|
3
3
|
import type { ColumnIconOption } from '../../ts-types';
|
|
4
4
|
type IIconOptions = {
|
|
5
5
|
width: number;
|
|
@@ -29,7 +29,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
29
29
|
value: !0
|
|
30
30
|
}), exports.Icon = void 0;
|
|
31
31
|
|
|
32
|
-
const vrender_1 = require("
|
|
32
|
+
const vrender_1 = require("./../../vrender"), vutils_1 = require("@visactor/vutils"), registerIcons = __importStar(require("../../icons"));
|
|
33
33
|
|
|
34
34
|
class Icon extends vrender_1.Image {
|
|
35
35
|
constructor(options) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/render/layout/icon.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AACA
|
|
1
|
+
{"version":3,"sources":["../src/render/layout/icon.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AACA,6CAAwC;AACxC,6CAAqD;AACrD,2DAA6C;AAc7C,MAAa,IAAK,SAAQ,eAAK;IAM7B,YAAY,OAAqB;;QAC/B,IAAI,KAAK,CAAC;QACV,IAAI,IAAA,iBAAQ,EAAC,OAAO,CAAC,QAAQ,CAAC,EAAE;YAC9B,MAAM,UAAU,GAAG,aAAa,CAAC,GAAG,EAAE,CAAC;YACvC,KAAK,GAAG,UAAU,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;YACrC,IAAI,KAAK,EAAE;gBACT,OAAO,CAAC,KAAK,GAAG,MAAA,OAAO,CAAC,KAAK,mCAAI,KAAK,CAAC,KAAK,CAAC;gBAC7C,OAAO,CAAC,MAAM,GAAG,MAAA,OAAO,CAAC,MAAM,mCAAI,KAAK,CAAC,MAAM,CAAC;gBAChD,OAAO,CAAC,GAAG,GAAI,KAAa,CAAC,GAAG,CAAC;gBACjC,OAAO,CAAC,MAAM,GAAI,KAAa,CAAC,MAAM,CAAC;aACxC;SACF;QACD,IAAI,OAAO,CAAC,GAAG,EAAE;YACf,OAAO,CAAC,KAAK,GAAG,OAAO,CAAC,GAAG,CAAC;SAC7B;QAED,MAAM,eAAe,GAAG,IAAA,gBAAO,EAAC,OAAO,CAAC,aAAa,CAAC,CAAC;QACvD,MAAM,OAAO,GAAG;YACd,MAAA,MAAA,OAAO,CAAC,SAAS,mCAAI,CAAC,eAAe,CAAC,CAAC,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,aAAa,CAAC,mCAAI,CAAC;YAC9F,MAAA,MAAA,OAAO,CAAC,WAAW,mCAAI,CAAC,eAAe,CAAC,CAAC,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,aAAa,CAAC,mCAAI,CAAC;YAChG,MAAA,MAAA,OAAO,CAAC,YAAY,mCAClB,CAAC,eAAe,CAAC,CAAC,CAAC,MAAA,OAAO,CAAC,aAAa,CAAC,CAAC,CAAC,mCAAI,OAAO,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,aAAa,CAAC,mCAChG,CAAC;YACH,MAAA,MAAA,OAAO,CAAC,UAAU,mCAChB,CAAC,eAAe,CAAC,CAAC,CAAC,MAAA,OAAO,CAAC,aAAa,CAAC,CAAC,CAAC,mCAAI,OAAO,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,aAAa,CAAC,mCAChG,CAAC;SACJ,CAAC;QACF,OAAO,CAAC,aAAa,GAAG,OAAO,CAAC;QAEhC,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;IACrB,CAAC;CACF;AAtCD,oBAsCC","file":"icon.js","sourcesContent":["import type { IImageGraphicAttribute } from './../../vrender';\nimport { Image } from './../../vrender';\nimport { isArray, isString } from '@visactor/vutils';\nimport * as registerIcons from '../../icons';\nimport type { ColumnIconOption } from '../../ts-types';\n\ntype IIconOptions = {\n width: number;\n height: number;\n svg?: string;\n iconName?: string;\n marginTop?: number;\n marginRight?: number;\n marginBottom?: number;\n marginLeft?: number;\n} & IImageGraphicAttribute;\n\nexport class Icon extends Image {\n declare id: string;\n svg: string;\n iconName: string;\n cache?: ColumnIconOption;\n\n constructor(options: IIconOptions) {\n let cache;\n if (isString(options.iconName)) {\n const regedIcons = registerIcons.get();\n cache = regedIcons[options.iconName];\n if (cache) {\n options.width = options.width ?? cache.width;\n options.height = options.height ?? cache.height;\n options.svg = (cache as any).svg;\n options.cursor = (cache as any).cursor;\n }\n }\n if (options.svg) {\n options.image = options.svg;\n }\n\n const isPaddingNumber = isArray(options.boundsPadding);\n const padding = [\n options.marginTop ?? (isPaddingNumber ? options.boundsPadding[0] : options.boundsPadding) ?? 0,\n options.marginRight ?? (isPaddingNumber ? options.boundsPadding[1] : options.boundsPadding) ?? 0,\n options.marginBottom ??\n (isPaddingNumber ? options.boundsPadding[2] ?? options.boundsPadding[0] : options.boundsPadding) ??\n 0,\n options.marginLeft ??\n (isPaddingNumber ? options.boundsPadding[3] ?? options.boundsPadding[1] : options.boundsPadding) ??\n 0\n ];\n options.boundsPadding = padding;\n\n super(options);\n this.cache = cache;\n }\n}\n"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { IImageGraphicAttribute } from '
|
|
2
|
-
import { Image as VImage } from '
|
|
1
|
+
import type { IImageGraphicAttribute } from './../../vrender';
|
|
2
|
+
import { Image as VImage } from './../../vrender';
|
|
3
3
|
type IImageOptions = {
|
|
4
4
|
src?: string;
|
|
5
5
|
shape?: 'circle' | 'square';
|
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: !0
|
|
5
5
|
}), exports.Image = void 0;
|
|
6
6
|
|
|
7
|
-
const vrender_1 = require("
|
|
7
|
+
const vrender_1 = require("./../../vrender"), vutils_1 = require("@visactor/vutils");
|
|
8
8
|
|
|
9
9
|
class Image extends vrender_1.Image {
|
|
10
10
|
constructor(options) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/render/layout/image.ts"],"names":[],"mappings":";;;AACA
|
|
1
|
+
{"version":3,"sources":["../src/render/layout/image.ts"],"names":[],"mappings":";;;AACA,6CAAkD;AAClD,6CAA2C;AAU3C,MAAa,KAAM,SAAQ,eAAM;IAC/B,YAAY,OAAsB;;QAChC,IAAI,OAAO,CAAC,GAAG,EAAE;YACf,OAAO,CAAC,KAAK,GAAG,OAAO,CAAC,GAAG,CAAC;SAC7B;QACD,IAAI,OAAO,CAAC,KAAK,KAAK,QAAQ,EAAE;YAC9B,OAAO,CAAC,YAAY,GAAG,OAAO,CAAC,KAAK,GAAG,CAAC,CAAC;SAC1C;QAED,MAAM,eAAe,GAAG,IAAA,gBAAO,EAAC,OAAO,CAAC,aAAa,CAAC,CAAC;QACvD,MAAM,OAAO,GAAG;YACd,MAAA,MAAA,OAAO,CAAC,SAAS,mCAAI,CAAC,eAAe,CAAC,CAAC,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,aAAa,CAAC,mCAAI,CAAC;YAC9F,MAAA,MAAA,OAAO,CAAC,WAAW,mCAAI,CAAC,eAAe,CAAC,CAAC,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,aAAa,CAAC,mCAAI,CAAC;YAChG,MAAA,MAAA,OAAO,CAAC,YAAY,mCAClB,CAAC,eAAe,CAAC,CAAC,CAAC,MAAA,OAAO,CAAC,aAAa,CAAC,CAAC,CAAC,mCAAI,OAAO,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,aAAa,CAAC,mCAChG,CAAC;YACH,MAAA,MAAA,OAAO,CAAC,UAAU,mCAChB,CAAC,eAAe,CAAC,CAAC,CAAC,MAAA,OAAO,CAAC,aAAa,CAAC,CAAC,CAAC,mCAAI,OAAO,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,aAAa,CAAC,mCAChG,CAAC;SACJ,CAAC;QACF,OAAO,CAAC,aAAa,GAAG,OAAO,CAAC;QAEhC,KAAK,CAAC,OAAO,CAAC,CAAC;IACjB,CAAC;CACF;AAxBD,sBAwBC","file":"image.js","sourcesContent":["import type { IImageGraphicAttribute } from './../../vrender';\nimport { Image as VImage } from './../../vrender';\nimport { isArray } from '@visactor/vutils';\n\ntype IImageOptions = {\n src?: string;\n shape?: 'circle' | 'square';\n marginTop?: number;\n marginRight?: number;\n marginBottom?: number;\n marginLeft?: number;\n} & IImageGraphicAttribute;\nexport class Image extends VImage {\n constructor(options: IImageOptions) {\n if (options.src) {\n options.image = options.src;\n }\n if (options.shape === 'circle') {\n options.cornerRadius = options.width / 2;\n }\n\n const isPaddingNumber = isArray(options.boundsPadding);\n const padding = [\n options.marginTop ?? (isPaddingNumber ? options.boundsPadding[0] : options.boundsPadding) ?? 0,\n options.marginRight ?? (isPaddingNumber ? options.boundsPadding[1] : options.boundsPadding) ?? 0,\n options.marginBottom ??\n (isPaddingNumber ? options.boundsPadding[2] ?? options.boundsPadding[0] : options.boundsPadding) ??\n 0,\n options.marginLeft ??\n (isPaddingNumber ? options.boundsPadding[3] ?? options.boundsPadding[1] : options.boundsPadding) ??\n 0\n ];\n options.boundsPadding = padding;\n\n super(options);\n }\n}\n"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { IRectGraphicAttribute } from '
|
|
2
|
-
import { Rect as VRect } from '
|
|
1
|
+
import type { IRectGraphicAttribute } from './../../vrender';
|
|
2
|
+
import { Rect as VRect } from './../../vrender';
|
|
3
3
|
type IRectOption = {
|
|
4
4
|
marginTop?: number;
|
|
5
5
|
marginRight?: number;
|
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: !0
|
|
5
5
|
}), exports.Rect = void 0;
|
|
6
6
|
|
|
7
|
-
const vrender_1 = require("
|
|
7
|
+
const vrender_1 = require("./../../vrender"), vutils_1 = require("@visactor/vutils");
|
|
8
8
|
|
|
9
9
|
class Rect extends vrender_1.Rect {
|
|
10
10
|
constructor(options) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/render/layout/rect.ts"],"names":[],"mappings":";;;AACA
|
|
1
|
+
{"version":3,"sources":["../src/render/layout/rect.ts"],"names":[],"mappings":";;;AACA,6CAAgD;AAChD,6CAA2C;AAS3C,MAAa,IAAK,SAAQ,cAAK;IAC7B,YAAY,OAAoB;;QAC9B,MAAM,eAAe,GAAG,IAAA,gBAAO,EAAC,OAAO,CAAC,aAAa,CAAC,CAAC;QACvD,MAAM,OAAO,GAAG;YACd,MAAA,MAAA,OAAO,CAAC,SAAS,mCAAI,CAAC,eAAe,CAAC,CAAC,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,aAAa,CAAC,mCAAI,CAAC;YAC9F,MAAA,MAAA,OAAO,CAAC,WAAW,mCAAI,CAAC,eAAe,CAAC,CAAC,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,aAAa,CAAC,mCAAI,CAAC;YAChG,MAAA,MAAA,OAAO,CAAC,YAAY,mCAClB,CAAC,eAAe,CAAC,CAAC,CAAC,MAAA,OAAO,CAAC,aAAa,CAAC,CAAC,CAAC,mCAAI,OAAO,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,aAAa,CAAC,mCAChG,CAAC;YACH,MAAA,MAAA,OAAO,CAAC,UAAU,mCAChB,CAAC,eAAe,CAAC,CAAC,CAAC,MAAA,OAAO,CAAC,aAAa,CAAC,CAAC,CAAC,mCAAI,OAAO,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,aAAa,CAAC,mCAChG,CAAC;SACJ,CAAC;QACF,OAAO,CAAC,aAAa,GAAG,OAAO,CAAC;QAEhC,KAAK,CAAC,OAAO,CAAC,CAAC;IACjB,CAAC;CACF;AAjBD,oBAiBC","file":"rect.js","sourcesContent":["import type { IRectGraphicAttribute } from './../../vrender';\nimport { Rect as VRect } from './../../vrender';\nimport { isArray } from '@visactor/vutils';\n\ntype IRectOption = {\n marginTop?: number;\n marginRight?: number;\n marginBottom?: number;\n marginLeft?: number;\n} & IRectGraphicAttribute;\n\nexport class Rect extends VRect {\n constructor(options: IRectOption) {\n const isPaddingNumber = isArray(options.boundsPadding);\n const padding = [\n options.marginTop ?? (isPaddingNumber ? options.boundsPadding[0] : options.boundsPadding) ?? 0,\n options.marginRight ?? (isPaddingNumber ? options.boundsPadding[1] : options.boundsPadding) ?? 0,\n options.marginBottom ??\n (isPaddingNumber ? options.boundsPadding[2] ?? options.boundsPadding[0] : options.boundsPadding) ??\n 0,\n options.marginLeft ??\n (isPaddingNumber ? options.boundsPadding[3] ?? options.boundsPadding[1] : options.boundsPadding) ??\n 0\n ];\n options.boundsPadding = padding;\n\n super(options);\n }\n}\n"]}
|
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: !0
|
|
5
5
|
}), exports.Text = void 0;
|
|
6
6
|
|
|
7
|
-
const vrender_1 = require("
|
|
7
|
+
const vrender_1 = require("./../../vrender"), vutils_1 = require("@visactor/vutils");
|
|
8
8
|
|
|
9
9
|
class Text extends vrender_1.Text {
|
|
10
10
|
constructor(options) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/render/layout/text.ts"],"names":[],"mappings":";;;AAAA
|
|
1
|
+
{"version":3,"sources":["../src/render/layout/text.ts"],"names":[],"mappings":";;;AAAA,6CAA4E;AAG5E,6CAA2C;AAS3C,MAAa,IAAK,SAAQ,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C;CACF;AAxBD,oBAwBC","file":"text.js","sourcesContent":["import { Text as VText, type ITextGraphicAttribute } from './../../vrender';\nimport type { BaseTableAPI } from '../../ts-types/base-table';\nimport type { TagAttributes } from '@visactor/vrender-components';\nimport { isArray } from '@visactor/vutils';\n\ntype ITextOption = {\n marginTop?: number;\n marginRight?: number;\n marginBottom?: number;\n marginLeft?: number;\n} & ITextGraphicAttribute;\n\nexport class Text extends VText {\n constructor(options: ITextOption) {\n if (!options.textBaseline) {\n options.textBaseline = 'top';\n }\n const isPaddingNumber = isArray(options.boundsPadding);\n const padding = [\n options.marginTop ?? (isPaddingNumber ? options.boundsPadding[0] : options.boundsPadding) ?? 0,\n options.marginRight ?? (isPaddingNumber ? options.boundsPadding[1] : options.boundsPadding) ?? 0,\n options.marginBottom ??\n (isPaddingNumber ? options.boundsPadding[2] ?? options.boundsPadding[0] : options.boundsPadding) ??\n 0,\n options.marginLeft ??\n (isPaddingNumber ? options.boundsPadding[3] ?? options.boundsPadding[1] : options.boundsPadding) ??\n 0\n ];\n options.boundsPadding = padding;\n options.fill = options.fill ?? '#000';\n\n super(options);\n }\n getSize(table: BaseTableAPI) {\n this.AABBBounds.width();\n }\n}\n"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { IGroupGraphicAttribute } from '
|
|
2
|
-
import { RichText, Text } from '
|
|
1
|
+
import type { IGroupGraphicAttribute } from './../../vrender';
|
|
2
|
+
import { RichText, Text } from './../../vrender';
|
|
3
3
|
import { Group } from '../graphic/group';
|
|
4
4
|
import { Icon } from '../graphic/icon';
|
|
5
5
|
interface ICellContentOption {
|
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: !0
|
|
5
5
|
}), exports.CellContent = void 0;
|
|
6
6
|
|
|
7
|
-
const vrender_1 = require("
|
|
7
|
+
const vrender_1 = require("./../../vrender"), group_1 = require("../graphic/group"), icon_1 = require("../graphic/icon");
|
|
8
8
|
|
|
9
9
|
class CellContent extends group_1.Group {
|
|
10
10
|
constructor(params) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/scenegraph/component/cell-content.ts"],"names":[],"mappings":";;;AAEA,+CAAmD;AACnD,4CAAyC;AACzC,0CAAuC;AAgCvC,MAAa,WAAY,SAAQ,aAAK;IAapC,YAAY,MAA8B;QACxC,KAAK,CAAC,MAAM,CAAC,CAAC;QAThB,eAAU,GAAG,KAAK,CAAC;QACnB,gBAAW,GAAG,KAAK,CAAC;QAUlB,IAAI,CAAC,UAAU,GAAG,IAAI,aAAK,CAAC;YAC1B,QAAQ,EAAE,KAAK;YACf,IAAI,EAAE,KAAK;YACX,MAAM,EAAE,KAAK;SACd,CAAC,CAAC;QACH,IAAI,CAAC,UAAU,CAAC,IAAI,GAAG,cAAc,CAAC;QACtC,IAAI,CAAC,WAAW,GAAG,IAAI,aAAK,CAAC;YAC3B,QAAQ,EAAE,KAAK;YACf,IAAI,EAAE,KAAK;YACX,MAAM,EAAE,KAAK;SACd,CAAC,CAAC;QACH,IAAI,CAAC,WAAW,CAAC,IAAI,GAAG,eAAe,CAAC;QACxC,IAAI,CAAC,YAAY,GAAG,IAAI,aAAK,CAAC;YAC5B,QAAQ,EAAE,KAAK;YACf,IAAI,EAAE,KAAK;YACX,MAAM,EAAE,KAAK;SACd,CAAC,CAAC;QACH,IAAI,CAAC,YAAY,CAAC,IAAI,GAAG,gBAAgB,CAAC;QAE1C,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;QAClC,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;QACnC,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;IACtC,CAAC;IAED,oBAAoB,CAAC,MAA0B;QAC7C,IAAI,CAAC,UAAU,GAAG,MAAM,CAAC,SAAS,CAAC;QACnC,IAAI,CAAC,WAAW,GAAG,MAAM,CAAC,UAAU,CAAC;QACrC,IAAI,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AM,EAAE,CAAC,CAAC;YAC5E,CAAC,CAAC,CAAC;YACH,IAAI,CAAC,WAAW,CAAC,eAAe,CAAC,CAAC,IAAU,EAAE,EAAE;gBAC9C,IAAI,CAAC,YAAY,CAAC,GAAG,EAAE,IAAI,CAAC,WAAW,CAAC,MAAM,GAAG,IAAI,CAAC,UAAU,CAAC,MAAM,EAAE,CAAC,CAAC;YAC7E,CAAC,CAAC,CAAC;YAEH,IAAI,CAAC,UAAU,CAAC,YAAY,CAAC,GAAG,EAAE,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;YAC7E,IAAI,CAAC,WAAW,CAAC,YAAY,CAAC,GAAG,EAAE,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;YAC/E,IAAI,CAAC,YAAY,CAAC,YAAY,CAAC,GAAG,EAAE,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC;SAClF;IACH,CAAC;IAED,WAAW,CAAC,KAAa;QACvB,IAAI,CAAC,UAAU,GAAG,KAAK,CAAC;QACxB,IAAI,CAAC,gBAAgB,GAAG,KAAK,CAAC;QAC9B,IAAI,CAAC,MAAM,EAAE,CAAC;IAChB,CAAC;IAED,YAAY,CAAC,MAAc;QACzB,IAAI,CAAC,WAAW,GAAG,MAAM,CAAC;QAC1B,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,gBAAgB,CAAC;QACxC,IAAI,CAAC,MAAM,EAAE,CAAC;IAChB,CAAC;CACF;AAlND,kCAkNC","file":"cell-content.js","sourcesContent":["/* eslint-disable no-undef */\nimport type { IGroupGraphicAttribute } from '@visactor/vrender';\nimport { RichText, Text } from '@visactor/vrender';\nimport { Group } from '../graphic/group';\nimport { Icon } from '../graphic/icon';\n\n/*\n * cell区域规划\n * 左侧占位区 | 中央内容区 | 右侧占位区\n *\n * cell width设置\n * 1. 固定width\n * 2. 自动撑开\n * cell height设置\n * 1. 固定height\n * 2. 无折行,单行自动撑开\n * 2. 折行,多行自动撑开\n *\n * 中央内容区横向对齐方式\n * 纵向对齐方式\n * padding\n */\n\ninterface ICellContentOption {\n autoWidth: boolean;\n autoHeight: boolean;\n cellWidth: number;\n cellHeight: number;\n align: CanvasTextAlign;\n baseline: CanvasTextBaseline;\n}\n\n/**\n * @description: 单元格内容组件,包含content icon & wraptext/richtext\n * @return {*}\n */\nexport class CellContent extends Group {\n _leftGroup: Group;\n _rightGroup: Group;\n _centerGroup: Group;\n\n _autoWidth = false;\n _autoHeight = false;\n _cellWidth: number;\n _originCellWidth: number;\n _cellHeight: number;\n _align: CanvasTextAlign;\n _baseline: CanvasTextBaseline;\n\n constructor(params: IGroupGraphicAttribute) {\n super(params);\n\n this._leftGroup = new Group({\n pickable: false,\n fill: false,\n stroke: false\n });\n this._leftGroup.role = 'content-left';\n this._rightGroup = new Group({\n pickable: false,\n fill: false,\n stroke: false\n });\n this._rightGroup.role = 'content-right';\n this._centerGroup = new Group({\n pickable: false,\n fill: false,\n stroke: false\n });\n this._centerGroup.role = 'content-center';\n\n this.appendChild(this._leftGroup);\n this.appendChild(this._rightGroup);\n this.appendChild(this._centerGroup);\n }\n\n setCellContentOption(option: ICellContentOption) {\n this._autoWidth = option.autoWidth;\n this._autoHeight = option.autoHeight;\n this._cellWidth = option.cellWidth;\n this._originCellWidth = option.cellWidth;\n this._cellHeight = option.cellHeight;\n this._align = option.align;\n this._baseline = option.baseline;\n }\n\n addLeftOccupyingIcon(icon: Icon) {\n icon.setAttribute('x', this._leftGroup.width + (icon.attribute.marginLeft ?? 0));\n this._leftGroup.appendChild(icon);\n this._leftGroup.setDeltaWidth(\n (icon.attribute.marginLeft ?? 0) + (icon.attribute.marginRight ?? 0) + icon.attribute.width\n );\n }\n\n addRightOccupyingIcon(icon: Icon) {\n icon.setAttribute('x', this._rightGroup.width + (icon.attribute.marginLeft ?? 0));\n this._rightGroup.appendChild(icon);\n this._rightGroup.setDeltaWidth(\n (icon.attribute.marginLeft ?? 0) + (icon.attribute.marginRight ?? 0) + icon.attribute.width\n );\n }\n\n addContent(content: Icon | Text | RichText) {\n const lastChild = this._centerGroup.lastChild as Icon | Text | RichText;\n if (lastChild) {\n // 横排content,新加入content更新x坐标\n content.setAttributes({\n x: lastChild.attribute.x + lastChild.AABBBounds.width()\n });\n }\n this._centerGroup.appendChild(content);\n if (content instanceof Text) {\n this._centerGroup.setAttribute('pickable', false);\n content.setAttribute('textAlign', 'left');\n }\n }\n\n layout() {\n // 计算左侧占位区域尺寸\n let leftOccupyingWidth = this._leftGroup.width;\n if (leftOccupyingWidth === Infinity) {\n leftOccupyingWidth = 0;\n }\n // 计算右侧占位区域尺寸\n let rightOccupyingWidth = this._rightGroup.width;\n if (rightOccupyingWidth === -Infinity) {\n rightOccupyingWidth = 0;\n }\n\n // 计算中央内容区域尺寸\n if (this._autoWidth) {\n // 计算内容本身宽度\n const centerWidth = this._centerGroup.width;\n // 更新cell宽度\n this._cellWidth = leftOccupyingWidth + rightOccupyingWidth + centerWidth;\n // this.attribute.width = this._cellWidth;\n this.setAttribute('width', this._cellWidth);\n } else {\n // 计算留给内容的宽度\n const contentWidth = this._cellWidth - leftOccupyingWidth - rightOccupyingWidth;\n // 更新内容宽度\n this.updateCenterLayout(contentWidth);\n const centerWidth = this._centerGroup.width;\n this._cellWidth = leftOccupyingWidth + rightOccupyingWidth + centerWidth;\n // this.attribute.width = this._cellWidth;\n this.setAttribute('width', this._cellWidth);\n }\n // 更新水平位置\n this.updateHorizontalPos();\n\n // if (this._autoHeight) {\n const leftOccupyingHeight = this._leftGroup.height;\n const rightOccupyingHeight = this._rightGroup.height;\n const centerHeight = this._centerGroup.height;\n\n this._cellHeight = Math.max(leftOccupyingHeight, rightOccupyingHeight, centerHeight);\n // this.attribute.height = this._cellHeight;\n this.setAttribute('height', this._cellHeight);\n // }\n\n // 更新纵向位置\n this.updateVerticalPos();\n }\n\n updateCenterLayout(contentWidth: number) {\n // 计算留给文字的空间\n let textWidth = contentWidth;\n this._centerGroup.forEachChildren(child => {\n if (child instanceof Icon) {\n textWidth -= child.AABBBounds.width();\n }\n });\n\n // 更新文字宽度\n const text = this._centerGroup.getChildByName('text');\n if (text instanceof RichText) {\n text.setAttribute('width', textWidth);\n } else if (text instanceof Text) {\n text.setAttribute('maxLineWidth', textWidth);\n }\n\n // 按顺序更新x\n let x = 0;\n this._centerGroup.forEachChildren((child: Icon | Text | RichText) => {\n child.setAttribute('x', x);\n x += child.AABBBounds.width();\n });\n }\n\n updateHorizontalPos() {\n this._leftGroup.setAttribute('x', 0);\n this._rightGroup.setAttribute('x', this._cellWidth - this._rightGroup.width);\n this._centerGroup.setAttribute('x', this._leftGroup.width);\n // 对齐方式由外部处理\n if (this._align === 'left' || this._align === 'start') {\n this.setAttribute('dx', 0);\n } else if (this._align === 'center') {\n this.setAttribute('dx', -this.attribute.width / 2);\n } else if (this._align === 'right' || this._align === 'end') {\n this.setAttribute('dx', -this.attribute.width);\n }\n }\n\n updateVerticalPos() {\n if (this._baseline === 'top') {\n this._leftGroup.setAttribute('y', 0);\n this._rightGroup.setAttribute('y', 0);\n this._centerGroup.setAttribute('y', 0);\n } else if (this._baseline === 'middle') {\n // 处理Group内icon对齐\n this._leftGroup.forEachChildren((icon: Icon) => {\n icon.setAttribute('y', (this._leftGroup.height - icon.AABBBounds.height()) / 2);\n });\n this._rightGroup.forEachChildren((icon: Icon) => {\n icon.setAttribute('y', (this._rightGroup.height - icon.AABBBounds.height()) / 2);\n });\n\n this._leftGroup.setAttribute('y', this._cellHeight / 2 - this._leftGroup.height / 2);\n this._rightGroup.setAttribute('y', this._cellHeight / 2 - this._rightGroup.height / 2);\n this._centerGroup.setAttribute('y', this._cellHeight / 2 - this._centerGroup.height / 2);\n } else if (this._baseline === 'bottom') {\n // 处理Group内icon对齐\n this._leftGroup.forEachChildren((icon: Icon) => {\n icon.setAttribute('y', this._leftGroup.height - icon.AABBBounds.height());\n });\n this._rightGroup.forEachChildren((icon: Icon) => {\n icon.setAttribute('y', this._rightGroup.height - icon.AABBBounds.height());\n });\n\n this._leftGroup.setAttribute('y', this._cellHeight - this._leftGroup.height);\n this._rightGroup.setAttribute('y', this._cellHeight - this._rightGroup.height);\n this._centerGroup.setAttribute('y', this._cellHeight - this._centerGroup.height);\n }\n }\n\n updateWidth(width: number) {\n this._cellWidth = width;\n this._originCellWidth = width;\n this.layout();\n }\n\n updateHeight(height: number) {\n this._cellHeight = height;\n this._cellWidth = this._originCellWidth;\n this.layout();\n }\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/scenegraph/component/cell-content.ts"],"names":[],"mappings":";;;AAEA,6CAAiD;AACjD,4CAAyC;AACzC,0CAAuC;AAgCvC,MAAa,WAAY,SAAQ,aAAK;IAapC,YAAY,MAA8B;QACxC,KAAK,CAAC,MAAM,CAAC,CAAC;QAThB,eAAU,GAAG,KAAK,CAAC;QACnB,gBAAW,GAAG,KAAK,CAAC;QAUlB,IAAI,CAAC,UAAU,GAAG,IAAI,aAAK,CAAC;YAC1B,QAAQ,EAAE,KAAK;YACf,IAAI,EAAE,KAAK;YACX,MAAM,EAAE,KAAK;SACd,CAAC,CAAC;QACH,IAAI,CAAC,UAAU,CAAC,IAAI,GAAG,cAAc,CAAC;QACtC,IAAI,CAAC,WAAW,GAAG,IAAI,aAAK,CAAC;YAC3B,QAAQ,EAAE,KAAK;YACf,IAAI,EAAE,KAAK;YACX,MAAM,EAAE,KAAK;SACd,CAAC,CAAC;QACH,IAAI,CAAC,WAAW,CAAC,IAAI,GAAG,eAAe,CAAC;QACxC,IAAI,CAAC,YAAY,GAAG,IAAI,aAAK,CAAC;YAC5B,QAAQ,EAAE,KAAK;YACf,IAAI,EAAE,KAAK;YACX,MAAM,EAAE,KAAK;SACd,CAAC,CAAC;QACH,IAAI,CAAC,YAAY,CAAC,IAAI,GAAG,gBAAgB,CAAC;QAE1C,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,UAAU,CAAC,C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AAM,EAAE,CAAC;IAChB,CAAC;CACF;AAlND,kCAkNC","file":"cell-content.js","sourcesContent":["/* eslint-disable no-undef */\nimport type { IGroupGraphicAttribute } from './../../vrender';\nimport { RichText, Text } from './../../vrender';\nimport { Group } from '../graphic/group';\nimport { Icon } from '../graphic/icon';\n\n/*\n * cell区域规划\n * 左侧占位区 | 中央内容区 | 右侧占位区\n *\n * cell width设置\n * 1. 固定width\n * 2. 自动撑开\n * cell height设置\n * 1. 固定height\n * 2. 无折行,单行自动撑开\n * 2. 折行,多行自动撑开\n *\n * 中央内容区横向对齐方式\n * 纵向对齐方式\n * padding\n */\n\ninterface ICellContentOption {\n autoWidth: boolean;\n autoHeight: boolean;\n cellWidth: number;\n cellHeight: number;\n align: CanvasTextAlign;\n baseline: CanvasTextBaseline;\n}\n\n/**\n * @description: 单元格内容组件,包含content icon & wraptext/richtext\n * @return {*}\n */\nexport class CellContent extends Group {\n _leftGroup: Group;\n _rightGroup: Group;\n _centerGroup: Group;\n\n _autoWidth = false;\n _autoHeight = false;\n _cellWidth: number;\n _originCellWidth: number;\n _cellHeight: number;\n _align: CanvasTextAlign;\n _baseline: CanvasTextBaseline;\n\n constructor(params: IGroupGraphicAttribute) {\n super(params);\n\n this._leftGroup = new Group({\n pickable: false,\n fill: false,\n stroke: false\n });\n this._leftGroup.role = 'content-left';\n this._rightGroup = new Group({\n pickable: false,\n fill: false,\n stroke: false\n });\n this._rightGroup.role = 'content-right';\n this._centerGroup = new Group({\n pickable: false,\n fill: false,\n stroke: false\n });\n this._centerGroup.role = 'content-center';\n\n this.appendChild(this._leftGroup);\n this.appendChild(this._rightGroup);\n this.appendChild(this._centerGroup);\n }\n\n setCellContentOption(option: ICellContentOption) {\n this._autoWidth = option.autoWidth;\n this._autoHeight = option.autoHeight;\n this._cellWidth = option.cellWidth;\n this._originCellWidth = option.cellWidth;\n this._cellHeight = option.cellHeight;\n this._align = option.align;\n this._baseline = option.baseline;\n }\n\n addLeftOccupyingIcon(icon: Icon) {\n icon.setAttribute('x', this._leftGroup.width + (icon.attribute.marginLeft ?? 0));\n this._leftGroup.appendChild(icon);\n this._leftGroup.setDeltaWidth(\n (icon.attribute.marginLeft ?? 0) + (icon.attribute.marginRight ?? 0) + icon.attribute.width\n );\n }\n\n addRightOccupyingIcon(icon: Icon) {\n icon.setAttribute('x', this._rightGroup.width + (icon.attribute.marginLeft ?? 0));\n this._rightGroup.appendChild(icon);\n this._rightGroup.setDeltaWidth(\n (icon.attribute.marginLeft ?? 0) + (icon.attribute.marginRight ?? 0) + icon.attribute.width\n );\n }\n\n addContent(content: Icon | Text | RichText) {\n const lastChild = this._centerGroup.lastChild as Icon | Text | RichText;\n if (lastChild) {\n // 横排content,新加入content更新x坐标\n content.setAttributes({\n x: lastChild.attribute.x + lastChild.AABBBounds.width()\n });\n }\n this._centerGroup.appendChild(content);\n if (content instanceof Text) {\n this._centerGroup.setAttribute('pickable', false);\n content.setAttribute('textAlign', 'left');\n }\n }\n\n layout() {\n // 计算左侧占位区域尺寸\n let leftOccupyingWidth = this._leftGroup.width;\n if (leftOccupyingWidth === Infinity) {\n leftOccupyingWidth = 0;\n }\n // 计算右侧占位区域尺寸\n let rightOccupyingWidth = this._rightGroup.width;\n if (rightOccupyingWidth === -Infinity) {\n rightOccupyingWidth = 0;\n }\n\n // 计算中央内容区域尺寸\n if (this._autoWidth) {\n // 计算内容本身宽度\n const centerWidth = this._centerGroup.width;\n // 更新cell宽度\n this._cellWidth = leftOccupyingWidth + rightOccupyingWidth + centerWidth;\n // this.attribute.width = this._cellWidth;\n this.setAttribute('width', this._cellWidth);\n } else {\n // 计算留给内容的宽度\n const contentWidth = this._cellWidth - leftOccupyingWidth - rightOccupyingWidth;\n // 更新内容宽度\n this.updateCenterLayout(contentWidth);\n const centerWidth = this._centerGroup.width;\n this._cellWidth = leftOccupyingWidth + rightOccupyingWidth + centerWidth;\n // this.attribute.width = this._cellWidth;\n this.setAttribute('width', this._cellWidth);\n }\n // 更新水平位置\n this.updateHorizontalPos();\n\n // if (this._autoHeight) {\n const leftOccupyingHeight = this._leftGroup.height;\n const rightOccupyingHeight = this._rightGroup.height;\n const centerHeight = this._centerGroup.height;\n\n this._cellHeight = Math.max(leftOccupyingHeight, rightOccupyingHeight, centerHeight);\n // this.attribute.height = this._cellHeight;\n this.setAttribute('height', this._cellHeight);\n // }\n\n // 更新纵向位置\n this.updateVerticalPos();\n }\n\n updateCenterLayout(contentWidth: number) {\n // 计算留给文字的空间\n let textWidth = contentWidth;\n this._centerGroup.forEachChildren(child => {\n if (child instanceof Icon) {\n textWidth -= child.AABBBounds.width();\n }\n });\n\n // 更新文字宽度\n const text = this._centerGroup.getChildByName('text');\n if (text instanceof RichText) {\n text.setAttribute('width', textWidth);\n } else if (text instanceof Text) {\n text.setAttribute('maxLineWidth', textWidth);\n }\n\n // 按顺序更新x\n let x = 0;\n this._centerGroup.forEachChildren((child: Icon | Text | RichText) => {\n child.setAttribute('x', x);\n x += child.AABBBounds.width();\n });\n }\n\n updateHorizontalPos() {\n this._leftGroup.setAttribute('x', 0);\n this._rightGroup.setAttribute('x', this._cellWidth - this._rightGroup.width);\n this._centerGroup.setAttribute('x', this._leftGroup.width);\n // 对齐方式由外部处理\n if (this._align === 'left' || this._align === 'start') {\n this.setAttribute('dx', 0);\n } else if (this._align === 'center') {\n this.setAttribute('dx', -this.attribute.width / 2);\n } else if (this._align === 'right' || this._align === 'end') {\n this.setAttribute('dx', -this.attribute.width);\n }\n }\n\n updateVerticalPos() {\n if (this._baseline === 'top') {\n this._leftGroup.setAttribute('y', 0);\n this._rightGroup.setAttribute('y', 0);\n this._centerGroup.setAttribute('y', 0);\n } else if (this._baseline === 'middle') {\n // 处理Group内icon对齐\n this._leftGroup.forEachChildren((icon: Icon) => {\n icon.setAttribute('y', (this._leftGroup.height - icon.AABBBounds.height()) / 2);\n });\n this._rightGroup.forEachChildren((icon: Icon) => {\n icon.setAttribute('y', (this._rightGroup.height - icon.AABBBounds.height()) / 2);\n });\n\n this._leftGroup.setAttribute('y', this._cellHeight / 2 - this._leftGroup.height / 2);\n this._rightGroup.setAttribute('y', this._cellHeight / 2 - this._rightGroup.height / 2);\n this._centerGroup.setAttribute('y', this._cellHeight / 2 - this._centerGroup.height / 2);\n } else if (this._baseline === 'bottom') {\n // 处理Group内icon对齐\n this._leftGroup.forEachChildren((icon: Icon) => {\n icon.setAttribute('y', this._leftGroup.height - icon.AABBBounds.height());\n });\n this._rightGroup.forEachChildren((icon: Icon) => {\n icon.setAttribute('y', this._rightGroup.height - icon.AABBBounds.height());\n });\n\n this._leftGroup.setAttribute('y', this._cellHeight - this._leftGroup.height);\n this._rightGroup.setAttribute('y', this._cellHeight - this._rightGroup.height);\n this._centerGroup.setAttribute('y', this._cellHeight - this._centerGroup.height);\n }\n }\n\n updateWidth(width: number) {\n this._cellWidth = width;\n this._originCellWidth = width;\n this.layout();\n }\n\n updateHeight(height: number) {\n this._cellHeight = height;\n this._cellWidth = this._originCellWidth;\n this.layout();\n }\n}\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ILine, IRect, ISymbol } from '
|
|
1
|
+
import type { ILine, IRect, ISymbol } from './../../vrender';
|
|
2
2
|
import type { Group } from '../graphic/group';
|
|
3
3
|
import type { BaseTableAPI } from '../../ts-types/base-table';
|
|
4
4
|
export declare class CellMover {
|
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: !0
|
|
5
5
|
}), exports.CellMover = void 0;
|
|
6
6
|
|
|
7
|
-
const vrender_1 = require("
|
|
7
|
+
const vrender_1 = require("./../../vrender"), get_cell_merge_1 = require("../utils/get-cell-merge");
|
|
8
8
|
|
|
9
9
|
class CellMover {
|
|
10
10
|
constructor(table) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/scenegraph/component/cell-mover.ts"],"names":[],"mappings":";;;AACA,+CAAyE;AACzE,4DAA2D;AAI3D,MAAa,SAAS;IAOpB,YAAY,KAA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AI,OAAO,KAAK,KAAK,QAAQ,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;YAC1D,IAAI,CAAC,gBAAgB,CAAC,YAAY,CAAC,GAAG,EAAE,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,MAAM,CAAC,gBAAgB,CAAC,CAAC;YACjG,IAAI,CAAC,eAAe,CAAC,YAAY,CAAC,GAAG,EAAE,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,MAAM,CAAC,gBAAgB,CAAC,CAAC;YAChG,IAAI,CAAC,eAAe,CAAC,YAAY,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;SAC/C;aAAM,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;YACjE,IAAI,CAAC,gBAAgB,CAAC,YAAY,CAAC,GAAG,EAAE,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,MAAM,CAAC,cAAc,CAAC,CAAC;YAC/F,IAAI,CAAC,eAAe,CAAC,YAAY,CAAC,GAAG,EAAE,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,MAAM,CAAC,cAAc,CAAC,CAAC;YAC9F,IAAI,CAAC,eAAe,CAAC,YAAY,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;SAC/C;IACH,CAAC;CACF;AAlJD,8BAkJC","file":"cell-mover.js","sourcesContent":["import type { ILine, IRect, ISymbol } from '@visactor/vrender';\nimport { createLine, createRect, createSymbol } from '@visactor/vrender';\nimport { getCellMergeInfo } from '../utils/get-cell-merge';\nimport type { Group } from '../graphic/group';\nimport type { BaseTableAPI } from '../../ts-types/base-table';\n\nexport class CellMover {\n columnMoverLabel: ISymbol;\n columnMoverLine: ILine;\n columnMoverBack: IRect;\n table: BaseTableAPI;\n x?: number;\n\n constructor(table: BaseTableAPI) {\n const columnMoverLineWidth = table.theme.dragHeaderSplitLine.lineWidth;\n const columnMoverLineColor = table.theme.dragHeaderSplitLine.lineColor;\n const columnMoverShadowBlockColor = table.theme.dragHeaderSplitLine.shadowBlockColor;\n\n this.columnMoverLabel = createSymbol({\n visible: false,\n pickable: false,\n x: 0,\n y: 0,\n symbolType: 'triangle',\n fill: columnMoverLineColor as string\n });\n this.columnMoverLine = createLine({\n visible: false,\n pickable: false,\n stroke: columnMoverLineColor as string,\n lineWidth: columnMoverLineWidth as number,\n x: 0,\n y: 0,\n points: [\n { x: 0, y: 0 },\n { x: 0, y: 0 }\n ]\n });\n\n // 列顺序调整阴影块\n this.columnMoverBack = createRect({\n visible: false,\n pickable: false,\n fill: columnMoverShadowBlockColor,\n x: 0,\n y: 0,\n width: 0,\n height: 0\n });\n\n this.table = table;\n }\n\n appand(parent: Group) {\n parent.appendChild(this.columnMoverLabel);\n parent.appendChild(this.columnMoverLine);\n parent.appendChild(this.columnMoverBack);\n }\n\n show(col: number, row: number, delta: number) {\n const cellLocation = this.table.getCellLocation(col, row);\n const mergeInfo = getCellMergeInfo(this.table, col, row);\n if (mergeInfo) {\n col = mergeInfo.start.col;\n row = mergeInfo.start.row;\n }\n\n let rectX = 0;\n let rectY = 0;\n let rectWidth = 0;\n let rectHeight = 0;\n let rectDx = 0;\n let rectDy = 0;\n let symbolX = 0;\n let symbolY = 0;\n let symbolRotate = Math.PI;\n const linePoints: { x: number; y: number }[] = [];\n if (cellLocation === 'columnHeader') {\n rectX = this.table.getColsWidth(0, col - 1) - this.table.stateManager.scroll.horizontalBarPos;\n rectY = this.table.getRowsHeight(0, this.table.frozenRowCount - 1);\n rectHeight = this.table.tableNoFrameHeight;\n if (mergeInfo) {\n rectWidth = this.table.getColsWidth(mergeInfo.start.col, mergeInfo.end.col);\n } else {\n rectWidth = this.table.getColWidth(col);\n }\n rectDx = rectX - delta;\n\n symbolX = rectX + rectWidth;\n symbolY = 2;\n\n linePoints.push({ x: 0, y: 0 });\n linePoints.push({ x: 0, y: this.table.tableNoFrameHeight });\n } else if (cellLocation === 'rowHeader') {\n rectY = this.table.getRowsHeight(0, row - 1) - this.table.stateManager.scroll.verticalBarPos;\n rectX = this.table.getColsWidth(0, this.table.frozenColCount - 1);\n rectWidth = this.table.tableNoFrameWidth;\n if (mergeInfo) {\n rectHeight = this.table.getRowsHeight(mergeInfo.start.row, mergeInfo.end.row);\n } else {\n rectHeight = this.table.getRowHeight(row);\n }\n rectDy = rectY - delta;\n\n symbolX = 2;\n symbolY = rectY + rectHeight;\n symbolRotate = Math.PI / 2;\n\n linePoints.push({ x: 0, y: 0 });\n linePoints.push({ x: this.table.tableNoFrameWidth, y: 0 });\n }\n\n this.columnMoverBack.setAttributes({\n visible: true,\n x: rectX - rectDx,\n y: rectY - rectDy,\n width: rectWidth,\n height: rectHeight,\n dx: rectDx,\n dy: rectDy\n });\n this.columnMoverLine.setAttributes({\n x: symbolX,\n y: symbolY,\n visible: true,\n points: linePoints\n });\n this.columnMoverLabel.setAttributes({\n visible: true,\n x: symbolX,\n y: symbolY,\n angle: symbolRotate\n });\n }\n\n hide() {\n this.columnMoverLabel.setAttribute('visible', false);\n this.columnMoverLine.setAttribute('visible', false);\n this.columnMoverBack.setAttribute('visible', false);\n }\n\n update(backX: number | undefined, lineX: number | undefined, backY: number | undefined, lineY: number | undefined) {\n if (typeof backX === 'number' && typeof lineX === 'number') {\n this.columnMoverLabel.setAttribute('x', lineX - this.table.stateManager.scroll.horizontalBarPos);\n this.columnMoverLine.setAttribute('x', lineX - this.table.stateManager.scroll.horizontalBarPos);\n this.columnMoverBack.setAttribute('x', backX);\n } else if (typeof backY === 'number' && typeof lineY === 'number') {\n this.columnMoverLabel.setAttribute('y', lineY - this.table.stateManager.scroll.verticalBarPos);\n this.columnMoverLine.setAttribute('y', lineY - this.table.stateManager.scroll.verticalBarPos);\n this.columnMoverBack.setAttribute('y', backY);\n }\n }\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/scenegraph/component/cell-mover.ts"],"names":[],"mappings":";;;AACA,6CAAuE;AACvE,4DAA2D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,EAAE,KAAyB,EAAE,KAAyB;QAC/G,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;YAC1D,IAAI,CAAC,gBAAgB,CAAC,YAAY,CAAC,GAAG,EAAE,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,MAAM,CAAC,gBAAgB,CAAC,CAAC;YACjG,IAAI,CAAC,eAAe,CAAC,YAAY,CAAC,GAAG,EAAE,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,MAAM,CAAC,gBAAgB,CAAC,CAAC;YAChG,IAAI,CAAC,eAAe,CAAC,YAAY,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;SAC/C;aAAM,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;YACjE,IAAI,CAAC,gBAAgB,CAAC,YAAY,CAAC,GAAG,EAAE,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,MAAM,CAAC,cAAc,CAAC,CAAC;YAC/F,IAAI,CAAC,eAAe,CAAC,YAAY,CAAC,GAAG,EAAE,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,MAAM,CAAC,cAAc,CAAC,CAAC;YAC9F,IAAI,CAAC,eAAe,CAAC,YAAY,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;SAC/C;IACH,CAAC;CACF;AAlJD,8BAkJC","file":"cell-mover.js","sourcesContent":["import type { ILine, IRect, ISymbol } from './../../vrender';\nimport { createLine, createRect, createSymbol } from './../../vrender';\nimport { getCellMergeInfo } from '../utils/get-cell-merge';\nimport type { Group } from '../graphic/group';\nimport type { BaseTableAPI } from '../../ts-types/base-table';\n\nexport class CellMover {\n columnMoverLabel: ISymbol;\n columnMoverLine: ILine;\n columnMoverBack: IRect;\n table: BaseTableAPI;\n x?: number;\n\n constructor(table: BaseTableAPI) {\n const columnMoverLineWidth = table.theme.dragHeaderSplitLine.lineWidth;\n const columnMoverLineColor = table.theme.dragHeaderSplitLine.lineColor;\n const columnMoverShadowBlockColor = table.theme.dragHeaderSplitLine.shadowBlockColor;\n\n this.columnMoverLabel = createSymbol({\n visible: false,\n pickable: false,\n x: 0,\n y: 0,\n symbolType: 'triangle',\n fill: columnMoverLineColor as string\n });\n this.columnMoverLine = createLine({\n visible: false,\n pickable: false,\n stroke: columnMoverLineColor as string,\n lineWidth: columnMoverLineWidth as number,\n x: 0,\n y: 0,\n points: [\n { x: 0, y: 0 },\n { x: 0, y: 0 }\n ]\n });\n\n // 列顺序调整阴影块\n this.columnMoverBack = createRect({\n visible: false,\n pickable: false,\n fill: columnMoverShadowBlockColor,\n x: 0,\n y: 0,\n width: 0,\n height: 0\n });\n\n this.table = table;\n }\n\n appand(parent: Group) {\n parent.appendChild(this.columnMoverLabel);\n parent.appendChild(this.columnMoverLine);\n parent.appendChild(this.columnMoverBack);\n }\n\n show(col: number, row: number, delta: number) {\n const cellLocation = this.table.getCellLocation(col, row);\n const mergeInfo = getCellMergeInfo(this.table, col, row);\n if (mergeInfo) {\n col = mergeInfo.start.col;\n row = mergeInfo.start.row;\n }\n\n let rectX = 0;\n let rectY = 0;\n let rectWidth = 0;\n let rectHeight = 0;\n let rectDx = 0;\n let rectDy = 0;\n let symbolX = 0;\n let symbolY = 0;\n let symbolRotate = Math.PI;\n const linePoints: { x: number; y: number }[] = [];\n if (cellLocation === 'columnHeader') {\n rectX = this.table.getColsWidth(0, col - 1) - this.table.stateManager.scroll.horizontalBarPos;\n rectY = this.table.getRowsHeight(0, this.table.frozenRowCount - 1);\n rectHeight = this.table.tableNoFrameHeight;\n if (mergeInfo) {\n rectWidth = this.table.getColsWidth(mergeInfo.start.col, mergeInfo.end.col);\n } else {\n rectWidth = this.table.getColWidth(col);\n }\n rectDx = rectX - delta;\n\n symbolX = rectX + rectWidth;\n symbolY = 2;\n\n linePoints.push({ x: 0, y: 0 });\n linePoints.push({ x: 0, y: this.table.tableNoFrameHeight });\n } else if (cellLocation === 'rowHeader') {\n rectY = this.table.getRowsHeight(0, row - 1) - this.table.stateManager.scroll.verticalBarPos;\n rectX = this.table.getColsWidth(0, this.table.frozenColCount - 1);\n rectWidth = this.table.tableNoFrameWidth;\n if (mergeInfo) {\n rectHeight = this.table.getRowsHeight(mergeInfo.start.row, mergeInfo.end.row);\n } else {\n rectHeight = this.table.getRowHeight(row);\n }\n rectDy = rectY - delta;\n\n symbolX = 2;\n symbolY = rectY + rectHeight;\n symbolRotate = Math.PI / 2;\n\n linePoints.push({ x: 0, y: 0 });\n linePoints.push({ x: this.table.tableNoFrameWidth, y: 0 });\n }\n\n this.columnMoverBack.setAttributes({\n visible: true,\n x: rectX - rectDx,\n y: rectY - rectDy,\n width: rectWidth,\n height: rectHeight,\n dx: rectDx,\n dy: rectDy\n });\n this.columnMoverLine.setAttributes({\n x: symbolX,\n y: symbolY,\n visible: true,\n points: linePoints\n });\n this.columnMoverLabel.setAttributes({\n visible: true,\n x: symbolX,\n y: symbolY,\n angle: symbolRotate\n });\n }\n\n hide() {\n this.columnMoverLabel.setAttribute('visible', false);\n this.columnMoverLine.setAttribute('visible', false);\n this.columnMoverBack.setAttribute('visible', false);\n }\n\n update(backX: number | undefined, lineX: number | undefined, backY: number | undefined, lineY: number | undefined) {\n if (typeof backX === 'number' && typeof lineX === 'number') {\n this.columnMoverLabel.setAttribute('x', lineX - this.table.stateManager.scroll.horizontalBarPos);\n this.columnMoverLine.setAttribute('x', lineX - this.table.stateManager.scroll.horizontalBarPos);\n this.columnMoverBack.setAttribute('x', backX);\n } else if (typeof backY === 'number' && typeof lineY === 'number') {\n this.columnMoverLabel.setAttribute('y', lineY - this.table.stateManager.scroll.verticalBarPos);\n this.columnMoverLine.setAttribute('y', lineY - this.table.stateManager.scroll.verticalBarPos);\n this.columnMoverBack.setAttribute('y', backY);\n }\n }\n}\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Group as VGroup } from '
|
|
1
|
+
import { Group as VGroup } from './../../vrender';
|
|
2
2
|
import type { ICustomLayout, ICustomRender } from '../../ts-types';
|
|
3
3
|
import type { BaseTableAPI } from '../../ts-types/base-table';
|
|
4
4
|
export declare function dealWithCustom(customLayout: ICustomLayout, customRender: ICustomRender, col: number, row: number, width: number, height: number, autoWidth: boolean, autoHeight: boolean, padding: [number, number, number, number], table: BaseTableAPI): {
|
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: !0
|
|
5
5
|
}), exports.decodeReactDom = exports.dealPercentCalc = exports.dealWithCustom = void 0;
|
|
6
6
|
|
|
7
|
-
const vrender_1 = require("
|
|
7
|
+
const vrender_1 = require("./../../vrender"), vutils_1 = require("@visactor/vutils"), icon_1 = require("../graphic/icon");
|
|
8
8
|
|
|
9
9
|
function dealWithCustom(customLayout, customRender, col, row, width, height, autoWidth, autoHeight, padding, table) {
|
|
10
10
|
let expectedWidth, expectedHeight, customElements, elementsGroup, renderDefault = !0, enableCellPadding = !1;
|