@visactor/vtable 0.17.9 → 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/components/axis/label-overlap.js.map +1 -1
- 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 +1 -1
- package/cjs/core/tableHelper.js +2 -1
- package/cjs/core/tableHelper.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 +1 -1
- 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/render/jsx/index.d.ts +1 -1
- 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 +1 -1
- 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.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.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.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 +1 -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 +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 +1 -1
- 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 +1 -1
- 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 +1 -1
- 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.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 +1 -1
- 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.js +1 -1
- 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 +1 -1
- package/cjs/ts-types/events.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 +111 -106
- package/dist/vtable.min.js +2 -2
- package/es/components/axis/label-overlap.js.map +1 -1
- 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 +1 -1
- package/es/core/tableHelper.js +2 -1
- package/es/core/tableHelper.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 +1 -1
- 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/render/jsx/index.d.ts +1 -1
- 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 +1 -1
- 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.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.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.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 +1 -1
- 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 +1 -1
- 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 +1 -1
- 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 +1 -1
- 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.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 +1 -1
- 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.js +1 -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 +1 -1
- package/es/ts-types/events.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 +7 -6
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/scenegraph/graphic/text.ts"],"names":[],"mappings":";;;AACA,6CAAqD;AAA5C,mGAAA,IAAI,OAAY","file":"text.js","sourcesContent":["export type { ITextGraphicAttribute, IWrapTextGraphicAttribute } from '@visactor/vrender';\nexport { Text as WrapText } from '@visactor/vrender';\n// import { getTheme, graphicUtil, Text, CanvasTextLayout, textDrawOffsetX, textLayoutOffsetY } from '@visactor/vrender';\n// import type { Bounds } from '@visactor/vutils';\n// import { textMeasure } from '../utils/measure-text';\n\n/* WrapText功能/dist/core/contributions/textMeasure/layout\n * 1. 按照宽度限制自动折行或显示省略号\n * 2. 高度限制控制显示内容及省略号\n */\n\n// const WRAP_TEXT_UPDATE_TAG_KEY = ['heightLimit', 'lineClamp', 'autoWrapText'];\n\n// export interface IWrapTextGraphicAttribute extends ITextGraphicAttribute {\n// // widthLimit: number;\n// heightLimit?: number;\n// lineClamp?: number;\n// autoWrapText?: boolean;\n// }\n// export class WrapText extends Text {\n// declare attribute: IWrapTextGraphicAttribute;\n\n// // eslint-disable-next-line no-useless-constructor\n// constructor(params: IWrapTextGraphicAttribute) {\n// super(params);\n// }\n\n// /**\n// * 计算单行文字的bounds,可以缓存长度以及截取的文字\n// * @param text\n// */\n// updateSingallineAABBBounds(text: number | string) {\n// const textTheme = getTheme(this).text;\n// // const textMeasure = graphicUtil.textMeasure;\n// let width: number;\n// let str: string;\n// const attribute = this.attribute;\n// const {\n// maxLineWidth = textTheme.maxLineWidth,\n// ellipsis = textTheme.ellipsis,\n// textAlign = textTheme.textAlign,\n// textBaseline = textTheme.textBaseline,\n// fontSize = textTheme.fontSize,\n// fontFamily = textTheme.fontFamily,\n// fontWeight = textTheme.fontWeight,\n// stroke = textTheme.stroke,\n// lineHeight = attribute.lineHeight ?? attribute.fontSize ?? textTheme.fontSize,\n// lineWidth = textTheme.lineWidth\n// } = attribute;\n\n// if (!this.shouldUpdateShape() && this.cache) {\n// width = this.cache.clipedWidth;\n// const dx = textDrawOffsetX(textAlign, width);\n// const dy = textLayoutOffsetY(textBaseline, lineHeight, fontSize);\n// this._AABBBounds.set(dx, dy, dx + width, dy + lineHeight);\n// if (stroke) {\n// this._AABBBounds.expand(lineWidth / 2);\n// }\n// return this._AABBBounds;\n// }\n\n// if (Number.isFinite(maxLineWidth)) {\n// if (ellipsis) {\n// const strEllipsis = (ellipsis === true ? textTheme.ellipsis : ellipsis) as string;\n// const data = textMeasure.clipTextWithSuffix(\n// text.toString(),\n// { fontSize, fontFamily },\n// maxLineWidth,\n// strEllipsis\n// );\n// str = data.str;\n// width = data.width;\n// } else {\n// const data = textMeasure.clipText(text.toString(), { fontSize, fontFamily }, maxLineWidth);\n// str = data.str;\n// width = data.width;\n// }\n// this.cache.clipedText = str;\n// this.cache.clipedWidth = width;\n// // todo 计算原本的宽度\n// } else {\n// width = textMeasure.measureTextWidth(text.toString(), { fontSize, fontFamily, fontWeight });\n// this.cache.clipedText = text.toString();\n// this.cache.clipedWidth = width;\n// }\n// this.clearUpdateShapeTag();\n\n// const dx = textDrawOffsetX(textAlign, width);\n// const dy = textLayoutOffsetY(textBaseline, lineHeight, fontSize);\n// this._AABBBounds.set(dx, dy, dx + width, dy + lineHeight);\n\n// if (stroke) {\n// this._AABBBounds.expand(lineWidth / 2);\n// }\n\n// return this._AABBBounds;\n// }\n\n// /**\n// * 计算多行文字的bounds,缓存每行文字的布局位置\n// * 自动折行params.text是数组,因此只重新updateMultilineAABBBounds\n// * @param text\n// */\n// updateMultilineAABBBounds(text: (number | string)[]) {\n// const textTheme = getTheme(this).text;\n// const {\n// fontFamily = textTheme.fontFamily,\n// textAlign = textTheme.textAlign,\n// fontWeight = textTheme.fontWeight,\n// textBaseline = textTheme.textBaseline,\n// fontSize = textTheme.fontSize,\n// lineHeight = this.attribute.lineHeight ?? this.attribute.fontSize ?? textTheme.fontSize,\n// ellipsis = textTheme.ellipsis,\n// maxLineWidth,\n// stroke = textTheme.stroke,\n// lineWidth = textTheme.lineWidth,\n// // widthLimit,\n// heightLimit = -1,\n// lineClamp = (textTheme as any).lineClamp,\n// autoWrapText = (textTheme as any).autoWrapText\n// } = this.attribute;\n\n// if (!this.shouldUpdateShape() && this.cache?.layoutData) {\n// const bbox = this.cache.layoutData.bbox;\n// this._AABBBounds.set(bbox.xOffset, bbox.yOffset, bbox.xOffset + bbox.width, bbox.yOffset + bbox.height);\n// if (stroke) {\n// this._AABBBounds.expand(lineWidth / 2);\n// }\n// return this._AABBBounds;\n// }\n\n// // const textMeasure = graphicUtil.textMeasure;\n// const layoutObj = new CanvasTextLayout(fontFamily, { fontSize, fontFamily }, textMeasure as any) as any;\n\n// // layoutObj内逻辑\n// const lines = text.map(l => l.toString()) as string[];\n// const linesLayout: LayoutItemType[] = [];\n// const bboxWH: [number, number] = [0, 0];\n\n// let lineCountLimit = Infinity;\n// if (heightLimit > 0) {\n// lineCountLimit = Math.max(Math.floor(heightLimit / lineHeight), 1);\n// }\n// if (lineClamp) {\n// // 处理行数限制\n// lineCountLimit = Math.min(lineCountLimit, lineClamp);\n// }\n\n// if (!autoWrapText) {\n// // 使用所有行中最长的作为lineWidth\n// let lineWidth = 0;\n// for (let i = 0, len = lines.length; i < len; i++) {\n// // 判断是否超过高度限制\n// if (i < lineCountLimit) {\n// // 当前行为最后一行\n// const clip = layoutObj.textMeasure.clipTextWithSuffix(\n// lines[i],\n// layoutObj.textOptions,\n// maxLineWidth,\n// ellipsis\n// );\n// linesLayout.push({\n// str: clip.str,\n// width: clip.width\n// });\n// lineWidth = Math.max(lineWidth, clip.width);\n// }\n// }\n// bboxWH[0] = lineWidth;\n// } else if (typeof maxLineWidth === 'number' && maxLineWidth !== Infinity) {\n// // widthLimit > 0\n// if (maxLineWidth > 0) {\n// for (let i = 0; i < lines.length; i++) {\n// const str = lines[i] as string;\n// // // 测量当前行宽度\n// // width = Math.min(\n// // layoutObj.textMeasure.measureTextWidth(str, layoutObj.textOptions),\n// // maxLineWidth\n// // );\n\n// // 判断是否超过高度限制\n// if (i === lineCountLimit - 1) {\n// // 当前行为最后一行\n// const clip = layoutObj.textMeasure.clipTextWithSuffix(str, layoutObj.textOptions, maxLineWidth, ellipsis);\n// linesLayout.push({\n// str: clip.str,\n// width: clip.width\n// });\n// break; // 不处理后续行\n// }\n\n// // 测量截断位置\n// const clip = layoutObj.textMeasure.clipText(str, layoutObj.textOptions, maxLineWidth);\n// if (str !== '' && clip.str === '') {\n// // 宽度限制不足一个字符,至少截取一个字符\n// clip.str = str.substring(0, 1);\n// clip.width = textMeasure.measureTextWidth(clip.str, { fontSize, fontFamily, fontWeight });\n// }\n\n// linesLayout.push({\n// str: clip.str,\n// width: clip.width\n// });\n// if (clip.str.length === str.length) {\n// // 不需要截断\n// } else {\n// const newStr = str.substring(clip.str.length);\n// lines.splice(i + 1, 0, newStr);\n// }\n// }\n// }\n// // bboxWH[0] = maxLineWidth;\n// let maxWidth = 0;\n// linesLayout.forEach(layout => {\n// maxWidth = Math.max(maxWidth, layout.width);\n// });\n// bboxWH[0] = maxWidth;\n// } else {\n// // 使用所有行中最长的作为lineWidth\n// let lineWidth = 0;\n// let width: number;\n// let text: string;\n// for (let i = 0, len = lines.length; i < len; i++) {\n// // 判断是否超过高度限制\n// if (i === lineCountLimit - 1) {\n// // 当前行为最后一行\n// const clip = layoutObj.textMeasure.clipTextWithSuffix(\n// lines[i],\n// layoutObj.textOptions,\n// maxLineWidth,\n// ellipsis\n// );\n// linesLayout.push({\n// str: clip.str,\n// width: clip.width\n// });\n// lineWidth = Math.max(lineWidth, clip.width);\n// break; // 不处理后续行\n// }\n\n// text = lines[i] as string;\n// width = layoutObj.textMeasure.measureTextWidth(text, layoutObj.textOptions);\n// lineWidth = Math.max(lineWidth, width);\n// linesLayout.push({ str: text, width });\n// }\n// bboxWH[0] = lineWidth;\n// }\n// bboxWH[1] = linesLayout.length * lineHeight;\n\n// const bbox = {\n// xOffset: 0,\n// yOffset: 0,\n// width: bboxWH[0],\n// height: bboxWH[1]\n// };\n\n// layoutObj.LayoutBBox(bbox, textAlign, textBaseline as any);\n\n// const layoutData = layoutObj.layoutWithBBox(bbox, linesLayout, textAlign, textBaseline as any, lineHeight);\n\n// // const layoutData = layoutObj.GetLayoutByLines(\n// // text,\n// // textAlign,\n// // textBaseline as any,\n// // lineHeight,\n// // ellipsis === true ? (DefaultTextAttribute.ellipsis as string) : ellipsis || undefined,\n// // maxLineWidth\n// // );\n// // const { bbox } = layoutData;\n// this.cache.layoutData = layoutData;\n// this.clearUpdateShapeTag();\n// this._AABBBounds.set(bbox.xOffset, bbox.yOffset, bbox.xOffset + bbox.width, bbox.yOffset + bbox.height);\n\n// if (stroke) {\n// this._AABBBounds.expand(lineWidth / 2);\n// }\n\n// return this._AABBBounds;\n// }\n\n// needUpdateTags(keys: string[]): boolean {\n// for (let i = 0; i < WRAP_TEXT_UPDATE_TAG_KEY.length; i++) {\n// const attrKey = WRAP_TEXT_UPDATE_TAG_KEY[i];\n// if (keys.indexOf(attrKey) !== -1) {\n// return true;\n// }\n// }\n// return super.needUpdateTags(keys);\n// }\n// needUpdateTag(key: string): boolean {\n// for (let i = 0; i < WRAP_TEXT_UPDATE_TAG_KEY.length; i++) {\n// const attrKey = WRAP_TEXT_UPDATE_TAG_KEY[i];\n// if (key === attrKey) {\n// return true;\n// }\n// }\n// return super.needUpdateTag(key);\n// }\n// }\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/scenegraph/graphic/text.ts"],"names":[],"mappings":";;;AACA,2CAAmD;AAA1C,mGAAA,IAAI,OAAY","file":"text.js","sourcesContent":["export type { ITextGraphicAttribute, IWrapTextGraphicAttribute } from './../../vrender';\nexport { Text as WrapText } from './../../vrender';\n// import { getTheme, graphicUtil, Text, CanvasTextLayout, textDrawOffsetX, textLayoutOffsetY } from '@src/vrender';\n// import type { Bounds } from '@visactor/vutils';\n// import { textMeasure } from '../utils/measure-text';\n\n/* WrapText功能/dist/core/contributions/textMeasure/layout\n * 1. 按照宽度限制自动折行或显示省略号\n * 2. 高度限制控制显示内容及省略号\n */\n\n// const WRAP_TEXT_UPDATE_TAG_KEY = ['heightLimit', 'lineClamp', 'autoWrapText'];\n\n// export interface IWrapTextGraphicAttribute extends ITextGraphicAttribute {\n// // widthLimit: number;\n// heightLimit?: number;\n// lineClamp?: number;\n// autoWrapText?: boolean;\n// }\n// export class WrapText extends Text {\n// declare attribute: IWrapTextGraphicAttribute;\n\n// // eslint-disable-next-line no-useless-constructor\n// constructor(params: IWrapTextGraphicAttribute) {\n// super(params);\n// }\n\n// /**\n// * 计算单行文字的bounds,可以缓存长度以及截取的文字\n// * @param text\n// */\n// updateSingallineAABBBounds(text: number | string) {\n// const textTheme = getTheme(this).text;\n// // const textMeasure = graphicUtil.textMeasure;\n// let width: number;\n// let str: string;\n// const attribute = this.attribute;\n// const {\n// maxLineWidth = textTheme.maxLineWidth,\n// ellipsis = textTheme.ellipsis,\n// textAlign = textTheme.textAlign,\n// textBaseline = textTheme.textBaseline,\n// fontSize = textTheme.fontSize,\n// fontFamily = textTheme.fontFamily,\n// fontWeight = textTheme.fontWeight,\n// stroke = textTheme.stroke,\n// lineHeight = attribute.lineHeight ?? attribute.fontSize ?? textTheme.fontSize,\n// lineWidth = textTheme.lineWidth\n// } = attribute;\n\n// if (!this.shouldUpdateShape() && this.cache) {\n// width = this.cache.clipedWidth;\n// const dx = textDrawOffsetX(textAlign, width);\n// const dy = textLayoutOffsetY(textBaseline, lineHeight, fontSize);\n// this._AABBBounds.set(dx, dy, dx + width, dy + lineHeight);\n// if (stroke) {\n// this._AABBBounds.expand(lineWidth / 2);\n// }\n// return this._AABBBounds;\n// }\n\n// if (Number.isFinite(maxLineWidth)) {\n// if (ellipsis) {\n// const strEllipsis = (ellipsis === true ? textTheme.ellipsis : ellipsis) as string;\n// const data = textMeasure.clipTextWithSuffix(\n// text.toString(),\n// { fontSize, fontFamily },\n// maxLineWidth,\n// strEllipsis\n// );\n// str = data.str;\n// width = data.width;\n// } else {\n// const data = textMeasure.clipText(text.toString(), { fontSize, fontFamily }, maxLineWidth);\n// str = data.str;\n// width = data.width;\n// }\n// this.cache.clipedText = str;\n// this.cache.clipedWidth = width;\n// // todo 计算原本的宽度\n// } else {\n// width = textMeasure.measureTextWidth(text.toString(), { fontSize, fontFamily, fontWeight });\n// this.cache.clipedText = text.toString();\n// this.cache.clipedWidth = width;\n// }\n// this.clearUpdateShapeTag();\n\n// const dx = textDrawOffsetX(textAlign, width);\n// const dy = textLayoutOffsetY(textBaseline, lineHeight, fontSize);\n// this._AABBBounds.set(dx, dy, dx + width, dy + lineHeight);\n\n// if (stroke) {\n// this._AABBBounds.expand(lineWidth / 2);\n// }\n\n// return this._AABBBounds;\n// }\n\n// /**\n// * 计算多行文字的bounds,缓存每行文字的布局位置\n// * 自动折行params.text是数组,因此只重新updateMultilineAABBBounds\n// * @param text\n// */\n// updateMultilineAABBBounds(text: (number | string)[]) {\n// const textTheme = getTheme(this).text;\n// const {\n// fontFamily = textTheme.fontFamily,\n// textAlign = textTheme.textAlign,\n// fontWeight = textTheme.fontWeight,\n// textBaseline = textTheme.textBaseline,\n// fontSize = textTheme.fontSize,\n// lineHeight = this.attribute.lineHeight ?? this.attribute.fontSize ?? textTheme.fontSize,\n// ellipsis = textTheme.ellipsis,\n// maxLineWidth,\n// stroke = textTheme.stroke,\n// lineWidth = textTheme.lineWidth,\n// // widthLimit,\n// heightLimit = -1,\n// lineClamp = (textTheme as any).lineClamp,\n// autoWrapText = (textTheme as any).autoWrapText\n// } = this.attribute;\n\n// if (!this.shouldUpdateShape() && this.cache?.layoutData) {\n// const bbox = this.cache.layoutData.bbox;\n// this._AABBBounds.set(bbox.xOffset, bbox.yOffset, bbox.xOffset + bbox.width, bbox.yOffset + bbox.height);\n// if (stroke) {\n// this._AABBBounds.expand(lineWidth / 2);\n// }\n// return this._AABBBounds;\n// }\n\n// // const textMeasure = graphicUtil.textMeasure;\n// const layoutObj = new CanvasTextLayout(fontFamily, { fontSize, fontFamily }, textMeasure as any) as any;\n\n// // layoutObj内逻辑\n// const lines = text.map(l => l.toString()) as string[];\n// const linesLayout: LayoutItemType[] = [];\n// const bboxWH: [number, number] = [0, 0];\n\n// let lineCountLimit = Infinity;\n// if (heightLimit > 0) {\n// lineCountLimit = Math.max(Math.floor(heightLimit / lineHeight), 1);\n// }\n// if (lineClamp) {\n// // 处理行数限制\n// lineCountLimit = Math.min(lineCountLimit, lineClamp);\n// }\n\n// if (!autoWrapText) {\n// // 使用所有行中最长的作为lineWidth\n// let lineWidth = 0;\n// for (let i = 0, len = lines.length; i < len; i++) {\n// // 判断是否超过高度限制\n// if (i < lineCountLimit) {\n// // 当前行为最后一行\n// const clip = layoutObj.textMeasure.clipTextWithSuffix(\n// lines[i],\n// layoutObj.textOptions,\n// maxLineWidth,\n// ellipsis\n// );\n// linesLayout.push({\n// str: clip.str,\n// width: clip.width\n// });\n// lineWidth = Math.max(lineWidth, clip.width);\n// }\n// }\n// bboxWH[0] = lineWidth;\n// } else if (typeof maxLineWidth === 'number' && maxLineWidth !== Infinity) {\n// // widthLimit > 0\n// if (maxLineWidth > 0) {\n// for (let i = 0; i < lines.length; i++) {\n// const str = lines[i] as string;\n// // // 测量当前行宽度\n// // width = Math.min(\n// // layoutObj.textMeasure.measureTextWidth(str, layoutObj.textOptions),\n// // maxLineWidth\n// // );\n\n// // 判断是否超过高度限制\n// if (i === lineCountLimit - 1) {\n// // 当前行为最后一行\n// const clip = layoutObj.textMeasure.clipTextWithSuffix(str, layoutObj.textOptions, maxLineWidth, ellipsis);\n// linesLayout.push({\n// str: clip.str,\n// width: clip.width\n// });\n// break; // 不处理后续行\n// }\n\n// // 测量截断位置\n// const clip = layoutObj.textMeasure.clipText(str, layoutObj.textOptions, maxLineWidth);\n// if (str !== '' && clip.str === '') {\n// // 宽度限制不足一个字符,至少截取一个字符\n// clip.str = str.substring(0, 1);\n// clip.width = textMeasure.measureTextWidth(clip.str, { fontSize, fontFamily, fontWeight });\n// }\n\n// linesLayout.push({\n// str: clip.str,\n// width: clip.width\n// });\n// if (clip.str.length === str.length) {\n// // 不需要截断\n// } else {\n// const newStr = str.substring(clip.str.length);\n// lines.splice(i + 1, 0, newStr);\n// }\n// }\n// }\n// // bboxWH[0] = maxLineWidth;\n// let maxWidth = 0;\n// linesLayout.forEach(layout => {\n// maxWidth = Math.max(maxWidth, layout.width);\n// });\n// bboxWH[0] = maxWidth;\n// } else {\n// // 使用所有行中最长的作为lineWidth\n// let lineWidth = 0;\n// let width: number;\n// let text: string;\n// for (let i = 0, len = lines.length; i < len; i++) {\n// // 判断是否超过高度限制\n// if (i === lineCountLimit - 1) {\n// // 当前行为最后一行\n// const clip = layoutObj.textMeasure.clipTextWithSuffix(\n// lines[i],\n// layoutObj.textOptions,\n// maxLineWidth,\n// ellipsis\n// );\n// linesLayout.push({\n// str: clip.str,\n// width: clip.width\n// });\n// lineWidth = Math.max(lineWidth, clip.width);\n// break; // 不处理后续行\n// }\n\n// text = lines[i] as string;\n// width = layoutObj.textMeasure.measureTextWidth(text, layoutObj.textOptions);\n// lineWidth = Math.max(lineWidth, width);\n// linesLayout.push({ str: text, width });\n// }\n// bboxWH[0] = lineWidth;\n// }\n// bboxWH[1] = linesLayout.length * lineHeight;\n\n// const bbox = {\n// xOffset: 0,\n// yOffset: 0,\n// width: bboxWH[0],\n// height: bboxWH[1]\n// };\n\n// layoutObj.LayoutBBox(bbox, textAlign, textBaseline as any);\n\n// const layoutData = layoutObj.layoutWithBBox(bbox, linesLayout, textAlign, textBaseline as any, lineHeight);\n\n// // const layoutData = layoutObj.GetLayoutByLines(\n// // text,\n// // textAlign,\n// // textBaseline as any,\n// // lineHeight,\n// // ellipsis === true ? (DefaultTextAttribute.ellipsis as string) : ellipsis || undefined,\n// // maxLineWidth\n// // );\n// // const { bbox } = layoutData;\n// this.cache.layoutData = layoutData;\n// this.clearUpdateShapeTag();\n// this._AABBBounds.set(bbox.xOffset, bbox.yOffset, bbox.xOffset + bbox.width, bbox.yOffset + bbox.height);\n\n// if (stroke) {\n// this._AABBBounds.expand(lineWidth / 2);\n// }\n\n// return this._AABBBounds;\n// }\n\n// needUpdateTags(keys: string[]): boolean {\n// for (let i = 0; i < WRAP_TEXT_UPDATE_TAG_KEY.length; i++) {\n// const attrKey = WRAP_TEXT_UPDATE_TAG_KEY[i];\n// if (keys.indexOf(attrKey) !== -1) {\n// return true;\n// }\n// }\n// return super.needUpdateTags(keys);\n// }\n// needUpdateTag(key: string): boolean {\n// for (let i = 0; i < WRAP_TEXT_UPDATE_TAG_KEY.length; i++) {\n// const attrKey = WRAP_TEXT_UPDATE_TAG_KEY[i];\n// if (key === attrKey) {\n// return true;\n// }\n// }\n// return super.needUpdateTag(key);\n// }\n// }\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { IThemeSpec } from '
|
|
1
|
+
import type { IThemeSpec } from './../../vrender';
|
|
2
2
|
import type { ColumnDefine, ColumnTypeOption } from '../../ts-types';
|
|
3
3
|
import type { Group } from '../graphic/group';
|
|
4
4
|
import type { BaseTableAPI } from '../../ts-types/base-table';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/scenegraph/group-creater/cell-helper.ts"],"names":[],"mappings":";;;AAEA,+CAA4C;AAa5C,gDAAqD;AAErD,gDAA4C;AAC5C,uDAA8D;AAC9D,uDAA8D;AAC9D,qEAAsE;AACtE,iEAAuE;AACvE,qDAAwD;AACxD,uDAA8D;AAG9D,wDAA4E;AAC5E,+CAA+C;AAC/C,kEAA6D;AAC7D,qDAA2D;AAC3D,6DAAoE;AAGpE,mDAAkD;AAClD,wEAAmE;AACnE,8CAAgD;AAChD,2CAAmD;AAEnD,SAAgB,UAAU,CACxB,IAAsB,EACtB,KA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emeSpec } from '@visactor/vrender';\nimport type { ProgressBarStyle } from '../../body-helper/style/ProgressBarStyle';\nimport { regUrl } from '../../tools/global';\nimport type {\n CellRange,\n ChartColumnDefine,\n CheckboxColumnDefine,\n ColumnDefine,\n ColumnTypeOption,\n ICustomRender,\n ImageColumnDefine,\n MappingRule,\n ProgressbarColumnDefine,\n TextColumnDefine\n} from '../../ts-types';\nimport { dealWithCustom } from '../component/custom';\nimport type { Group } from '../graphic/group';\nimport { getProp } from '../utils/get-prop';\nimport { createChartCellGroup } from './cell-type/chart-cell';\nimport { createImageCellGroup } from './cell-type/image-cell';\nimport { createProgressBarCell } from './cell-type/progress-bar-cell';\nimport { createSparkLineCellGroup } from './cell-type/spark-line-cell';\nimport { createCellGroup } from './cell-type/text-cell';\nimport { createVideoCellGroup } from './cell-type/video-cell';\nimport type { ICustomLayoutFuc } from '../../ts-types/customLayout';\nimport type { BaseTableAPI, PivotTableProtected } from '../../ts-types/base-table';\nimport { getCellCornerRadius, getStyleTheme } from '../../core/tableHelper';\nimport { isPromise } from '../../tools/helper';\nimport { dealPromiseData } from '../utils/deal-promise-data';\nimport { CartesianAxis } from '../../components/axis/axis';\nimport { createCheckboxCellGroup } from './cell-type/checkbox-cell';\n// import type { PivotLayoutMap } from '../../layout/pivot-layout';\nimport type { PivotHeaderLayoutMap } from '../../layout/pivot-header-layout';\nimport { resizeCellGroup } from './column-helper';\nimport { getHierarchyOffset } from '../utils/get-hierarchy-offset';\nimport { getQuadProps } from '../utils/padding';\nimport { convertInternal } from '../../tools/util';\n\nexport function createCell(\n type: ColumnTypeOption,\n value: string,\n define: ColumnDefine,\n table: BaseTableAPI,\n col: number,\n row: number,\n colWidth: number,\n cellWidth: number,\n cellHeight: number,\n columnGroup: Group,\n y: number,\n padding: [number, number, number, number],\n textAlign: CanvasTextAlign,\n textBaseline: CanvasTextBaseline,\n mayHaveIcon: boolean,\n cellTheme: IThemeSpec\n): Group {\n if (isPromise(value)) {\n value = table.getCellValue(col, row);\n }\n let bgColorFunc: Function;\n // 判断是否有mapping 遍历dataset中mappingRules\n if ((table.internalProps as PivotTableProtected)?.dataConfig?.mappingRules && !table.isHeader(col, row)) {\n (table.internalProps as PivotTableProtected)?.dataConfig?.mappingRules?.forEach(\n (mappingRule: MappingRule, i: number) => {\n if (\n mappingRule.bgColor &&\n (table.internalProps.layoutMap as PivotHeaderLayoutMap).getIndicatorKey(col, row) ===\n mappingRule.bgColor.indicatorKey\n ) {\n bgColorFunc = mappingRule.bgColor.mapping;\n }\n }\n );\n }\n let cellGroup: Group;\n if (type === 'text' || type === 'link') {\n if (type === 'link') {\n //如果是超链接 颜色按照linkColor绘制 TODO:放到方法_getCellStyle中\n // const columnDefine = table.getHeaderDefine(col, row);\n const cellValue = value;\n const headerStyle = table._getCellStyle(col, row);\n\n if (\n type === 'link' &&\n (('templateLink' in define && define.templateLink) ||\n !('linkDetect' in define && define.linkDetect) ||\n regUrl.test(cellValue))\n ) {\n if (cellTheme) {\n cellTheme.text.fill = getProp('linkColor', headerStyle, col, row, table);\n (cellTheme as any).group.cursor = 'pointer';\n } else {\n cellTheme = {\n text: {\n fill: getProp('linkColor', headerStyle, col, row, table)\n },\n group: {\n cursor: 'pointer' as Cursor\n }\n };\n }\n }\n }\n // 判断是否有mapping 遍历dataset中mappingRules 但这里还需要根据fieldName来判断\n if (bgColorFunc) {\n const cellValue = table.getCellOriginValue(col, row);\n const bgColor = bgColorFunc(table, cellValue);\n if (bgColor) {\n if (cellTheme) {\n cellTheme.group.fill = bgColor;\n } else {\n cellTheme = {\n group: {\n fill: bgColor\n }\n };\n }\n }\n }\n\n let customElementsGroup;\n let renderDefault = true;\n let customRender;\n let customLayout;\n const cellLocation = table.getCellLocation(col, row);\n if (cellLocation !== 'body') {\n customRender = define?.headerCustomRender;\n customLayout = define?.headerCustomLayout;\n } else {\n customRender = define?.customRender || table.customRender;\n customLayout = define?.customLayout;\n }\n\n if (customLayout || customRender) {\n // const { autoRowHeight } = table.internalProps;\n const customResult = dealWithCustom(\n customLayout,\n customRender,\n col,\n row,\n cellWidth,\n cellHeight,\n false,\n table.heightMode === 'autoHeight',\n padding,\n table\n );\n customElementsGroup = customResult.elementsGroup;\n renderDefault = customResult.renderDefault;\n }\n cellGroup = createCellGroup(\n table,\n value,\n columnGroup,\n 0,\n y,\n col,\n row,\n colWidth,\n cellWidth,\n cellHeight,\n padding,\n textAlign,\n textBaseline,\n mayHaveIcon,\n customElementsGroup,\n renderDefault,\n cellTheme\n );\n\n const axisConfig = table.internalProps.layoutMap.getAxisConfigInPivotChart(col, row);\n if (axisConfig) {\n const axis = new CartesianAxis(axisConfig, cellGroup.attribute.width, cellGroup.attribute.height, padding, table);\n cellGroup.clear();\n cellGroup.appendChild(axis.component);\n axis.overlap();\n } else if (table.internalProps.layoutMap.isEmpty(col, row)) {\n cellGroup.setAttributes({\n fill: false,\n stroke: false\n });\n cellGroup.clear();\n } else if (table.internalProps.layoutMap.isAxisCell(col, row)) {\n cellGroup.clear();\n }\n\n // if ((define as any)?.isAxis && cellLocation === 'columnHeader') {\n // cellGroup.setAttribute('clip', false);\n // const axis = new CartesianAxis(\n // {\n // orient: 'top',\n // type: 'band',\n // data: ['A', 'B', 'C'],\n // title: {\n // visible: true,\n // text: 'X Axis'\n // }\n // },\n // cellGroup.attribute.width,\n // cellGroup.attribute.height,\n // table\n // );\n // cellGroup.clear();\n // // axis.component.setAttribute('y', 40);\n // cellGroup.appendChild(axis.component);\n // } else if ((define as any)?.isAxis && cellLocation === 'rowHeader') {\n // cellGroup.setAttribute('clip', false);\n // const axis = new CartesianAxis(\n // {\n // orient: 'left',\n // type: 'linear',\n // range: { min: 0, max: 30 },\n // label: {\n // flush: true\n // },\n // grid: {\n // visible: true\n // },\n // title: {\n // visible: true,\n // text: 'Y Axis'\n // }\n // },\n // cellGroup.attribute.width,\n // cellGroup.attribute.height,\n // table\n // );\n // cellGroup.clear();\n // // axis.component.setAttribute('x', 80);\n // cellGroup.appendChild(axis.component);\n // axis.overlap();\n // }\n } else if (type === 'image') {\n // 创建图片单元格\n cellGroup = createImageCellGroup(\n columnGroup,\n 0,\n y,\n col,\n row,\n table.getColWidth(col),\n table.getRowHeight(row),\n (define as ImageColumnDefine).keepAspectRatio,\n (define as ImageColumnDefine).imageAutoSizing,\n padding,\n textAlign,\n textBaseline,\n table,\n cellTheme\n );\n } else if (type === 'video') {\n // 创建视频单元格\n cellGroup = createVideoCellGroup(\n columnGroup,\n 0,\n y,\n col,\n row,\n table.getColWidth(col),\n table.getRowHeight(row),\n (define as ImageColumnDefine).keepAspectRatio,\n (define as ImageColumnDefine).imageAutoSizing,\n padding,\n textAlign,\n textBaseline,\n table,\n cellTheme\n );\n } else if (type === 'chart') {\n const chartInstance = table.internalProps.layoutMap.getChartInstance(col, row);\n cellGroup = createChartCellGroup(\n null,\n columnGroup,\n 0,\n y,\n col,\n row,\n table.getColWidth(col),\n table.getRowHeight(row),\n padding,\n value,\n (define as ChartColumnDefine).chartModule,\n table.isPivotChart()\n ? (table.internalProps.layoutMap as PivotHeaderLayoutMap).getChartSpec(col, row)\n : (define as ChartColumnDefine).chartSpec,\n chartInstance,\n (table.internalProps.layoutMap as PivotHeaderLayoutMap)?.getChartDataId(col, row) ?? 'data',\n table,\n cellTheme\n );\n } else if (type === 'progressbar') {\n const style = table._getCellStyle(col, row) as ProgressBarStyle;\n const dataValue = table.getCellOriginValue(col, row);\n // 创建基础文字单元格\n cellGroup = createCellGroup(\n table,\n value,\n columnGroup,\n 0,\n y,\n col,\n row,\n colWidth,\n cellWidth,\n cellHeight,\n padding,\n textAlign,\n textBaseline,\n false,\n null,\n true,\n cellTheme\n );\n\n // 创建bar group\n const progressBarGroup = createProgressBarCell(\n define as ProgressbarColumnDefine,\n style,\n colWidth,\n value,\n dataValue,\n col,\n row,\n padding,\n table\n );\n // 进度图插入到文字前,绘制在文字下\n if (cellGroup.firstChild) {\n cellGroup.insertBefore(progressBarGroup, cellGroup.firstChild);\n } else {\n cellGroup.appendChild(progressBarGroup);\n }\n } else if (type === 'sparkline') {\n cellGroup = createSparkLineCellGroup(\n null,\n columnGroup,\n 0,\n y,\n col,\n row,\n cellWidth,\n cellHeight,\n padding,\n table,\n cellTheme\n );\n } else if (type === 'checkbox') {\n cellGroup = createCheckboxCellGroup(\n null,\n columnGroup,\n 0,\n y,\n col,\n row,\n colWidth,\n cellWidth,\n cellHeight,\n padding,\n textAlign,\n textBaseline,\n table,\n cellTheme,\n define as CheckboxColumnDefine\n );\n }\n\n return cellGroup;\n}\n\nexport function updateCell(col: number, row: number, table: BaseTableAPI, addNew?: boolean) {\n // const oldCellGroup = table.scenegraph.getCell(col, row, true);\n const oldCellGroup = table.scenegraph.highPerformanceGetCell(col, row, true);\n const cellStyle = table._getCellStyle(col, row);\n const autoWrapText = cellStyle.autoWrapText ?? table.internalProps.autoWrapText;\n const cellLocation = table.getCellLocation(col, row);\n const define = cellLocation !== 'body' ? table.getHeaderDefine(col, row) : table.getBodyColumnDefine(col, row);\n\n let isMerge;\n let range;\n if (cellLocation !== 'body' || (define as TextColumnDefine)?.mergeCell || table.internalProps.customMergeCell) {\n // 只有表头或者column配置合并单元格后再进行信息获取\n range = table.getCellRange(col, row);\n isMerge = range.start.col !== range.end.col || range.start.row !== range.end.row;\n }\n\n let cellTheme = getStyleTheme(\n cellStyle,\n table,\n isMerge ? range.start.col : col,\n isMerge ? range.start.row : row,\n getProp\n ).theme;\n\n cellTheme.group.cornerRadius = getCellCornerRadius(col, row, table);\n\n // fast method for text\n if (!addNew && !isMerge && canUseFastUpdate(col, row, oldCellGroup, autoWrapText, table)) {\n // update group\n const cellWidth = table.getColWidth(col);\n const cellHeight = table.getRowHeight(row);\n oldCellGroup.setAttributes({\n width: cellWidth,\n height: cellHeight,\n // 背景相关,cell背景由cellGroup绘制\n lineWidth: cellTheme?.group?.lineWidth ?? undefined,\n fill: cellTheme?.group?.fill ?? undefined,\n stroke: cellTheme?.group?.stroke ?? undefined,\n strokeArrayWidth: (cellTheme?.group as any)?.strokeArrayWidth ?? undefined,\n strokeArrayColor: (cellTheme?.group as any)?.strokeArrayColor ?? undefined,\n cursor: (cellTheme?.group as any)?.cursor ?? undefined,\n cornerRadius: cellTheme?.group?.cornerRadius ?? 0,\n\n y: table.scenegraph.getCellGroupY(row)\n } as any);\n\n // update text\n const textMark = oldCellGroup.getChildByName('text');\n if (textMark) {\n const text = table.getCellValue(col, row);\n const textArr = convertInternal(text).replace(/\\r?\\n/g, '\\n').replace(/\\r/g, '\\n').split('\\n');\n const hierarchyOffset = getHierarchyOffset(col, row, table);\n const lineClamp = cellStyle.lineClamp;\n const padding = getQuadProps(getProp('padding', cellStyle, col, row, table)) ?? [0, 0, 0, 0];\n\n const textAlign = cellTheme.text.textAlign;\n let x = 0;\n if (textAlign === 'center') {\n x = padding[3] + (cellWidth - (padding[1] + padding[3])) / 2;\n } else if (textAlign === 'right') {\n x = padding[3] + cellWidth - (padding[1] + padding[3]);\n } else {\n x = padding[3];\n }\n\n const attribute = {\n text: textArr.length === 1 && !autoWrapText ? textArr[0] : textArr, // 单行(no-autoWrapText)为字符串,多行(autoWrapText)为字符串数组\n maxLineWidth: cellWidth - (padding[1] + padding[3] + hierarchyOffset),\n // fill: true,\n // textAlign: 'left',\n textBaseline: 'top',\n autoWrapText,\n lineClamp,\n wordBreak: 'break-word',\n // widthLimit: autoColWidth ? -1 : colWidth - (padding[1] + padding[3]),\n heightLimit: cellHeight - (padding[0] + padding[2]),\n pickable: false,\n dx: hierarchyOffset,\n x\n };\n const oldText = textMark.attribute.text;\n textMark.setAttributes(cellTheme.text ? (Object.assign({}, cellTheme.text, attribute) as any) : attribute);\n if (!oldText && textMark.attribute.text) {\n const textBaseline = cellTheme.text.textBaseline;\n const height = cellHeight - (padding[0] + padding[2]);\n let y = 0;\n if (textBaseline === 'middle') {\n y = padding[0] + (height - textMark.AABBBounds.height()) / 2;\n } else if (textBaseline === 'bottom') {\n y = padding[0] + height - textMark.AABBBounds.height();\n } else {\n y = padding[0];\n }\n textMark.setAttributes({\n y\n });\n }\n }\n return oldCellGroup;\n }\n\n if (!addNew && oldCellGroup.role === 'empty') {\n return undefined;\n }\n\n const type = table.isHeader(col, row)\n ? table._getHeaderLayoutMap(col, row).headerType\n : table.getBodyColumnType(col, row);\n let value = table.getCellValue(col, row);\n\n let customStyle;\n if (table.internalProps.customMergeCell) {\n const customMerge = table.getCustomMerge(col, row);\n if (customMerge) {\n const { range: customMergeRange, text: customMergeText, style: customMergeStyle } = customMerge;\n range = customMergeRange;\n isMerge = range.start.col !== range.end.col || range.start.row !== range.end.row;\n value = customMergeText;\n customStyle = customMergeStyle;\n if (customStyle) {\n cellTheme = getStyleTheme(customStyle, table, range.start.col, range.start.row, getProp).theme;\n cellTheme.group.cornerRadius = getCellCornerRadius(col, row, table);\n }\n }\n }\n\n let newCellGroup;\n const mayHaveIcon = cellLocation !== 'body' ? true : !!define?.icon || !!define?.tree;\n const padding = cellTheme._vtable.padding;\n const textAlign = cellTheme._vtable.textAlign;\n const textBaseline = cellTheme._vtable.textBaseline;\n\n let bgColorFunc: Function;\n // 判断是否有mapping 遍历dataset中mappingRules\n if ((table.internalProps as PivotTableProtected)?.dataConfig?.mappingRules && !table.isHeader(col, row)) {\n (table.internalProps as PivotTableProtected)?.dataConfig?.mappingRules?.forEach(\n (mappingRule: MappingRule, i: number) => {\n if (\n mappingRule.bgColor &&\n (table.internalProps.layoutMap as PivotHeaderLayoutMap).getIndicatorKey(col, row) ===\n mappingRule.bgColor.indicatorKey\n ) {\n bgColorFunc = mappingRule.bgColor.mapping;\n }\n }\n );\n }\n\n let customRender;\n let customLayout;\n if (cellLocation !== 'body') {\n customRender = define?.headerCustomRender;\n customLayout = define?.headerCustomLayout;\n } else {\n customRender = define?.customRender || table.customRender;\n customLayout = define?.customLayout;\n }\n\n let cellWidth;\n let cellHeight;\n if (range) {\n cellWidth = table.getColsWidth(range.start.col, range.end.col);\n cellHeight = table.getRowsHeight(range.start.row, range.end.row);\n } else {\n cellWidth = table.getColWidth(col);\n cellHeight = table.getRowHeight(row);\n }\n\n // deal with promise data\n if (isPromise(value)) {\n // clear cell content sync\n oldCellGroup.removeAllChild();\n\n // update cell content async\n dealPromiseData(\n value,\n table,\n updateCellContent.bind(\n null,\n type,\n value,\n define,\n table,\n col,\n row,\n bgColorFunc,\n cellWidth,\n cellHeight,\n oldCellGroup,\n padding,\n textAlign,\n textBaseline,\n mayHaveIcon,\n addNew,\n cellTheme\n )\n );\n } else {\n newCellGroup = updateCellContent(\n type,\n value,\n define,\n table,\n col,\n row,\n bgColorFunc,\n cellWidth,\n cellHeight,\n oldCellGroup,\n padding,\n textAlign,\n textBaseline,\n mayHaveIcon,\n addNew,\n cellTheme\n );\n }\n\n if (isMerge) {\n const rangeHeight = table.getRowHeight(row);\n const rangeWidth = table.getColWidth(col);\n\n const { width: contentWidth } = newCellGroup.attribute;\n const { height: contentHeight } = newCellGroup.attribute;\n newCellGroup.contentWidth = contentWidth;\n newCellGroup.contentHeight = contentHeight;\n\n resizeCellGroup(newCellGroup, rangeWidth, rangeHeight, range, table);\n }\n\n return newCellGroup;\n}\n\nfunction updateCellContent(\n type: ColumnTypeOption,\n value: string,\n define: ColumnDefine,\n table: BaseTableAPI,\n col: number,\n row: number,\n bgColorFunc: Function,\n cellWidth: number,\n cellHeight: number,\n oldCellGroup: Group,\n padding: [number, number, number, number],\n textAlign: CanvasTextAlign,\n textBaseline: CanvasTextBaseline,\n mayHaveIcon: boolean,\n addNew: boolean,\n cellTheme?: IThemeSpec\n) {\n if (isPromise(value)) {\n value = table.getCellValue(col, row);\n }\n //解决报错 getCellByCache递归调用 死循环问题\n if (!addNew && (oldCellGroup.row !== row || oldCellGroup.col !== col)) {\n return null;\n }\n const newCellGroup = createCell(\n type,\n value,\n define,\n table,\n col,\n row,\n table.getColWidth(col),\n cellWidth,\n cellHeight,\n // oldCellGroup.parent,\n addNew ? table.scenegraph.getColGroup(col) : oldCellGroup.parent,\n // oldCellGroup.attribute.y,\n addNew ? 0 : table.scenegraph.getCellGroupY(row), // y\n padding,\n textAlign,\n textBaseline,\n mayHaveIcon,\n cellTheme\n );\n if (!addNew && oldCellGroup.parent) {\n oldCellGroup.parent.insertAfter(newCellGroup, oldCellGroup);\n oldCellGroup.parent.removeChild(oldCellGroup);\n\n // update cache\n if (table.scenegraph?.proxy.cellCache.get(col)) {\n table.scenegraph?.proxy.cellCache.set(col, newCellGroup);\n }\n }\n return newCellGroup;\n}\n\nfunction canUseFastUpdate(col: number, row: number, oldCellGroup: Group, autoWrapText: boolean, table: BaseTableAPI) {\n const define = table.getBodyColumnDefine(col, row);\n const mayHaveIcon = !!define?.icon || !!define?.tree;\n const cellType = table.getBodyColumnType(col, row);\n const autoRowHeight = table.heightMode === 'autoHeight';\n const value = table.getCellValue(col, row);\n\n if (\n !table.isHeader(col, row) &&\n oldCellGroup.role === 'cell' &&\n cellType === 'text' &&\n !autoWrapText &&\n !autoRowHeight &&\n !mayHaveIcon &&\n oldCellGroup.firstChild?.type === 'text' &&\n !isPromise(value)\n ) {\n return true;\n }\n return false;\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/scenegraph/group-creater/cell-helper.ts"],"names":[],"mappings":";;;AAEA,+CAA4C;AAa5C,gDAAqD;AAErD,gDAA4C;AAC5C,uDAA8D;AAC9D,uDAA8D;AAC9D,qEAAsE;AACtE,iEAAuE;AACvE,qDAAwD;AACxD,uDAA8D;AAG9D,wDAA4E;AAC5E,+CAA+C;AAC/C,kEAA6D;AAC7D,qDAA2D;AAC3D,6DAAoE;AAGpE,mDAAkD;AAClD,wEAAmE;AACnE,8CAAgD;AAChD,2CAAmD;AAEnD,SAAgB,UAAU,CACxB,IAAsB,EACtB,KAAa,EACb,MAAoB,EACpB,KAAmB,EACnB,GAAW,EACX,GAAW,EACX,QAAgB,EAChB,SAAiB,EACjB,UAAkB,EAClB,WAAkB,EAClB,CAAS,EACT,OAAyC,EACzC,SAA0B,EAC1B,YAAgC,EAChC,WAAoB,EACpB,SAAqB;;IAErB,IAAI,I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C,GAAG,CAAC,GAAG,EAAE,YAAY,CAAC,CAAC;SAC1D;KACF;IACD,OAAO,YAAY,CAAC;AACtB,CAAC;AAED,SAAS,gBAAgB,CAAC,GAAW,EAAE,GAAW,EAAE,YAAmB,EAAE,YAAqB,EAAE,KAAmB;;IACjH,MAAM,MAAM,GAAG,KAAK,CAAC,mBAAmB,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;IACnD,MAAM,WAAW,GAAG,CAAC,CAAC,CAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,IAAI,CAAA,IAAI,CAAC,CAAC,CAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,IAAI,CAAA,CAAC;IACrD,MAAM,QAAQ,GAAG,KAAK,CAAC,iBAAiB,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;IACnD,MAAM,aAAa,GAAG,KAAK,CAAC,UAAU,KAAK,YAAY,CAAC;IACxD,MAAM,KAAK,GAAG,KAAK,CAAC,YAAY,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;IAE3C,IACE,CAAC,KAAK,CAAC,QAAQ,CAAC,GAAG,EAAE,GAAG,CAAC;QACzB,YAAY,CAAC,IAAI,KAAK,MAAM;QAC5B,QAAQ,KAAK,MAAM;QACnB,CAAC,YAAY;QACb,CAAC,aAAa;QACd,CAAC,WAAW;QACZ,CAAA,MAAA,YAAY,CAAC,UAAU,0CAAE,IAAI,MAAK,MAAM;QACxC,CAAC,IAAA,kBAAS,EAAC,KAAK,CAAC,EACjB;QACA,OAAO,IAAI,CAAC;KACb;IACD,OAAO,KAAK,CAAC;AACf,CAAC","file":"cell-helper.js","sourcesContent":["import type { Cursor, IThemeSpec } from './../../vrender';\nimport type { ProgressBarStyle } from '../../body-helper/style/ProgressBarStyle';\nimport { regUrl } from '../../tools/global';\nimport type {\n CellRange,\n ChartColumnDefine,\n CheckboxColumnDefine,\n ColumnDefine,\n ColumnTypeOption,\n ICustomRender,\n ImageColumnDefine,\n MappingRule,\n ProgressbarColumnDefine,\n TextColumnDefine\n} from '../../ts-types';\nimport { dealWithCustom } from '../component/custom';\nimport type { Group } from '../graphic/group';\nimport { getProp } from '../utils/get-prop';\nimport { createChartCellGroup } from './cell-type/chart-cell';\nimport { createImageCellGroup } from './cell-type/image-cell';\nimport { createProgressBarCell } from './cell-type/progress-bar-cell';\nimport { createSparkLineCellGroup } from './cell-type/spark-line-cell';\nimport { createCellGroup } from './cell-type/text-cell';\nimport { createVideoCellGroup } from './cell-type/video-cell';\nimport type { ICustomLayoutFuc } from '../../ts-types/customLayout';\nimport type { BaseTableAPI, PivotTableProtected } from '../../ts-types/base-table';\nimport { getCellCornerRadius, getStyleTheme } from '../../core/tableHelper';\nimport { isPromise } from '../../tools/helper';\nimport { dealPromiseData } from '../utils/deal-promise-data';\nimport { CartesianAxis } from '../../components/axis/axis';\nimport { createCheckboxCellGroup } from './cell-type/checkbox-cell';\n// import type { PivotLayoutMap } from '../../layout/pivot-layout';\nimport type { PivotHeaderLayoutMap } from '../../layout/pivot-header-layout';\nimport { resizeCellGroup } from './column-helper';\nimport { getHierarchyOffset } from '../utils/get-hierarchy-offset';\nimport { getQuadProps } from '../utils/padding';\nimport { convertInternal } from '../../tools/util';\n\nexport function createCell(\n type: ColumnTypeOption,\n value: string,\n define: ColumnDefine,\n table: BaseTableAPI,\n col: number,\n row: number,\n colWidth: number,\n cellWidth: number,\n cellHeight: number,\n columnGroup: Group,\n y: number,\n padding: [number, number, number, number],\n textAlign: CanvasTextAlign,\n textBaseline: CanvasTextBaseline,\n mayHaveIcon: boolean,\n cellTheme: IThemeSpec\n): Group {\n if (isPromise(value)) {\n value = table.getCellValue(col, row);\n }\n let bgColorFunc: Function;\n // 判断是否有mapping 遍历dataset中mappingRules\n if ((table.internalProps as PivotTableProtected)?.dataConfig?.mappingRules && !table.isHeader(col, row)) {\n (table.internalProps as PivotTableProtected)?.dataConfig?.mappingRules?.forEach(\n (mappingRule: MappingRule, i: number) => {\n if (\n mappingRule.bgColor &&\n (table.internalProps.layoutMap as PivotHeaderLayoutMap).getIndicatorKey(col, row) ===\n mappingRule.bgColor.indicatorKey\n ) {\n bgColorFunc = mappingRule.bgColor.mapping;\n }\n }\n );\n }\n let cellGroup: Group;\n if (type === 'text' || type === 'link') {\n if (type === 'link') {\n //如果是超链接 颜色按照linkColor绘制 TODO:放到方法_getCellStyle中\n // const columnDefine = table.getHeaderDefine(col, row);\n const cellValue = value;\n const headerStyle = table._getCellStyle(col, row);\n\n if (\n type === 'link' &&\n (('templateLink' in define && define.templateLink) ||\n !('linkDetect' in define && define.linkDetect) ||\n regUrl.test(cellValue))\n ) {\n if (cellTheme) {\n cellTheme.text.fill = getProp('linkColor', headerStyle, col, row, table);\n (cellTheme as any).group.cursor = 'pointer';\n } else {\n cellTheme = {\n text: {\n fill: getProp('linkColor', headerStyle, col, row, table)\n },\n group: {\n cursor: 'pointer' as Cursor\n }\n };\n }\n }\n }\n // 判断是否有mapping 遍历dataset中mappingRules 但这里还需要根据fieldName来判断\n if (bgColorFunc) {\n const cellValue = table.getCellOriginValue(col, row);\n const bgColor = bgColorFunc(table, cellValue);\n if (bgColor) {\n if (cellTheme) {\n cellTheme.group.fill = bgColor;\n } else {\n cellTheme = {\n group: {\n fill: bgColor\n }\n };\n }\n }\n }\n\n let customElementsGroup;\n let renderDefault = true;\n let customRender;\n let customLayout;\n const cellLocation = table.getCellLocation(col, row);\n if (cellLocation !== 'body') {\n customRender = define?.headerCustomRender;\n customLayout = define?.headerCustomLayout;\n } else {\n customRender = define?.customRender || table.customRender;\n customLayout = define?.customLayout;\n }\n\n if (customLayout || customRender) {\n // const { autoRowHeight } = table.internalProps;\n const customResult = dealWithCustom(\n customLayout,\n customRender,\n col,\n row,\n cellWidth,\n cellHeight,\n false,\n table.heightMode === 'autoHeight',\n padding,\n table\n );\n customElementsGroup = customResult.elementsGroup;\n renderDefault = customResult.renderDefault;\n }\n cellGroup = createCellGroup(\n table,\n value,\n columnGroup,\n 0,\n y,\n col,\n row,\n colWidth,\n cellWidth,\n cellHeight,\n padding,\n textAlign,\n textBaseline,\n mayHaveIcon,\n customElementsGroup,\n renderDefault,\n cellTheme\n );\n\n const axisConfig = table.internalProps.layoutMap.getAxisConfigInPivotChart(col, row);\n if (axisConfig) {\n const axis = new CartesianAxis(axisConfig, cellGroup.attribute.width, cellGroup.attribute.height, padding, table);\n cellGroup.clear();\n cellGroup.appendChild(axis.component);\n axis.overlap();\n } else if (table.internalProps.layoutMap.isEmpty(col, row)) {\n cellGroup.setAttributes({\n fill: false,\n stroke: false\n });\n cellGroup.clear();\n } else if (table.internalProps.layoutMap.isAxisCell(col, row)) {\n cellGroup.clear();\n }\n\n // if ((define as any)?.isAxis && cellLocation === 'columnHeader') {\n // cellGroup.setAttribute('clip', false);\n // const axis = new CartesianAxis(\n // {\n // orient: 'top',\n // type: 'band',\n // data: ['A', 'B', 'C'],\n // title: {\n // visible: true,\n // text: 'X Axis'\n // }\n // },\n // cellGroup.attribute.width,\n // cellGroup.attribute.height,\n // table\n // );\n // cellGroup.clear();\n // // axis.component.setAttribute('y', 40);\n // cellGroup.appendChild(axis.component);\n // } else if ((define as any)?.isAxis && cellLocation === 'rowHeader') {\n // cellGroup.setAttribute('clip', false);\n // const axis = new CartesianAxis(\n // {\n // orient: 'left',\n // type: 'linear',\n // range: { min: 0, max: 30 },\n // label: {\n // flush: true\n // },\n // grid: {\n // visible: true\n // },\n // title: {\n // visible: true,\n // text: 'Y Axis'\n // }\n // },\n // cellGroup.attribute.width,\n // cellGroup.attribute.height,\n // table\n // );\n // cellGroup.clear();\n // // axis.component.setAttribute('x', 80);\n // cellGroup.appendChild(axis.component);\n // axis.overlap();\n // }\n } else if (type === 'image') {\n // 创建图片单元格\n cellGroup = createImageCellGroup(\n columnGroup,\n 0,\n y,\n col,\n row,\n table.getColWidth(col),\n table.getRowHeight(row),\n (define as ImageColumnDefine).keepAspectRatio,\n (define as ImageColumnDefine).imageAutoSizing,\n padding,\n textAlign,\n textBaseline,\n table,\n cellTheme\n );\n } else if (type === 'video') {\n // 创建视频单元格\n cellGroup = createVideoCellGroup(\n columnGroup,\n 0,\n y,\n col,\n row,\n table.getColWidth(col),\n table.getRowHeight(row),\n (define as ImageColumnDefine).keepAspectRatio,\n (define as ImageColumnDefine).imageAutoSizing,\n padding,\n textAlign,\n textBaseline,\n table,\n cellTheme\n );\n } else if (type === 'chart') {\n const chartInstance = table.internalProps.layoutMap.getChartInstance(col, row);\n cellGroup = createChartCellGroup(\n null,\n columnGroup,\n 0,\n y,\n col,\n row,\n table.getColWidth(col),\n table.getRowHeight(row),\n padding,\n value,\n (define as ChartColumnDefine).chartModule,\n table.isPivotChart()\n ? (table.internalProps.layoutMap as PivotHeaderLayoutMap).getChartSpec(col, row)\n : (define as ChartColumnDefine).chartSpec,\n chartInstance,\n (table.internalProps.layoutMap as PivotHeaderLayoutMap)?.getChartDataId(col, row) ?? 'data',\n table,\n cellTheme\n );\n } else if (type === 'progressbar') {\n const style = table._getCellStyle(col, row) as ProgressBarStyle;\n const dataValue = table.getCellOriginValue(col, row);\n // 创建基础文字单元格\n cellGroup = createCellGroup(\n table,\n value,\n columnGroup,\n 0,\n y,\n col,\n row,\n colWidth,\n cellWidth,\n cellHeight,\n padding,\n textAlign,\n textBaseline,\n false,\n null,\n true,\n cellTheme\n );\n\n // 创建bar group\n const progressBarGroup = createProgressBarCell(\n define as ProgressbarColumnDefine,\n style,\n colWidth,\n value,\n dataValue,\n col,\n row,\n padding,\n table\n );\n // 进度图插入到文字前,绘制在文字下\n if (cellGroup.firstChild) {\n cellGroup.insertBefore(progressBarGroup, cellGroup.firstChild);\n } else {\n cellGroup.appendChild(progressBarGroup);\n }\n } else if (type === 'sparkline') {\n cellGroup = createSparkLineCellGroup(\n null,\n columnGroup,\n 0,\n y,\n col,\n row,\n cellWidth,\n cellHeight,\n padding,\n table,\n cellTheme\n );\n } else if (type === 'checkbox') {\n cellGroup = createCheckboxCellGroup(\n null,\n columnGroup,\n 0,\n y,\n col,\n row,\n colWidth,\n cellWidth,\n cellHeight,\n padding,\n textAlign,\n textBaseline,\n table,\n cellTheme,\n define as CheckboxColumnDefine\n );\n }\n\n return cellGroup;\n}\n\nexport function updateCell(col: number, row: number, table: BaseTableAPI, addNew?: boolean) {\n // const oldCellGroup = table.scenegraph.getCell(col, row, true);\n const oldCellGroup = table.scenegraph.highPerformanceGetCell(col, row, true);\n const cellStyle = table._getCellStyle(col, row);\n const autoWrapText = cellStyle.autoWrapText ?? table.internalProps.autoWrapText;\n const cellLocation = table.getCellLocation(col, row);\n const define = cellLocation !== 'body' ? table.getHeaderDefine(col, row) : table.getBodyColumnDefine(col, row);\n\n let isMerge;\n let range;\n if (cellLocation !== 'body' || (define as TextColumnDefine)?.mergeCell || table.internalProps.customMergeCell) {\n // 只有表头或者column配置合并单元格后再进行信息获取\n range = table.getCellRange(col, row);\n isMerge = range.start.col !== range.end.col || range.start.row !== range.end.row;\n }\n\n let cellTheme = getStyleTheme(\n cellStyle,\n table,\n isMerge ? range.start.col : col,\n isMerge ? range.start.row : row,\n getProp\n ).theme;\n\n cellTheme.group.cornerRadius = getCellCornerRadius(col, row, table);\n\n // fast method for text\n if (!addNew && !isMerge && canUseFastUpdate(col, row, oldCellGroup, autoWrapText, table)) {\n // update group\n const cellWidth = table.getColWidth(col);\n const cellHeight = table.getRowHeight(row);\n oldCellGroup.setAttributes({\n width: cellWidth,\n height: cellHeight,\n // 背景相关,cell背景由cellGroup绘制\n lineWidth: cellTheme?.group?.lineWidth ?? undefined,\n fill: cellTheme?.group?.fill ?? undefined,\n stroke: cellTheme?.group?.stroke ?? undefined,\n strokeArrayWidth: (cellTheme?.group as any)?.strokeArrayWidth ?? undefined,\n strokeArrayColor: (cellTheme?.group as any)?.strokeArrayColor ?? undefined,\n cursor: (cellTheme?.group as any)?.cursor ?? undefined,\n cornerRadius: cellTheme?.group?.cornerRadius ?? 0,\n\n y: table.scenegraph.getCellGroupY(row)\n } as any);\n\n // update text\n const textMark = oldCellGroup.getChildByName('text');\n if (textMark) {\n const text = table.getCellValue(col, row);\n const textArr = convertInternal(text).replace(/\\r?\\n/g, '\\n').replace(/\\r/g, '\\n').split('\\n');\n const hierarchyOffset = getHierarchyOffset(col, row, table);\n const lineClamp = cellStyle.lineClamp;\n const padding = getQuadProps(getProp('padding', cellStyle, col, row, table)) ?? [0, 0, 0, 0];\n\n const textAlign = cellTheme.text.textAlign;\n let x = 0;\n if (textAlign === 'center') {\n x = padding[3] + (cellWidth - (padding[1] + padding[3])) / 2;\n } else if (textAlign === 'right') {\n x = padding[3] + cellWidth - (padding[1] + padding[3]);\n } else {\n x = padding[3];\n }\n\n const attribute = {\n text: textArr.length === 1 && !autoWrapText ? textArr[0] : textArr, // 单行(no-autoWrapText)为字符串,多行(autoWrapText)为字符串数组\n maxLineWidth: cellWidth - (padding[1] + padding[3] + hierarchyOffset),\n // fill: true,\n // textAlign: 'left',\n textBaseline: 'top',\n autoWrapText,\n lineClamp,\n wordBreak: 'break-word',\n // widthLimit: autoColWidth ? -1 : colWidth - (padding[1] + padding[3]),\n heightLimit: cellHeight - (padding[0] + padding[2]),\n pickable: false,\n dx: hierarchyOffset,\n x\n };\n const oldText = textMark.attribute.text;\n textMark.setAttributes(cellTheme.text ? (Object.assign({}, cellTheme.text, attribute) as any) : attribute);\n if (!oldText && textMark.attribute.text) {\n const textBaseline = cellTheme.text.textBaseline;\n const height = cellHeight - (padding[0] + padding[2]);\n let y = 0;\n if (textBaseline === 'middle') {\n y = padding[0] + (height - textMark.AABBBounds.height()) / 2;\n } else if (textBaseline === 'bottom') {\n y = padding[0] + height - textMark.AABBBounds.height();\n } else {\n y = padding[0];\n }\n textMark.setAttributes({\n y\n });\n }\n }\n return oldCellGroup;\n }\n\n if (!addNew && oldCellGroup.role === 'empty') {\n return undefined;\n }\n\n const type = table.isHeader(col, row)\n ? table._getHeaderLayoutMap(col, row).headerType\n : table.getBodyColumnType(col, row);\n let value = table.getCellValue(col, row);\n\n let customStyle;\n if (table.internalProps.customMergeCell) {\n const customMerge = table.getCustomMerge(col, row);\n if (customMerge) {\n const { range: customMergeRange, text: customMergeText, style: customMergeStyle } = customMerge;\n range = customMergeRange;\n isMerge = range.start.col !== range.end.col || range.start.row !== range.end.row;\n value = customMergeText;\n customStyle = customMergeStyle;\n if (customStyle) {\n cellTheme = getStyleTheme(customStyle, table, range.start.col, range.start.row, getProp).theme;\n cellTheme.group.cornerRadius = getCellCornerRadius(col, row, table);\n }\n }\n }\n\n let newCellGroup;\n const mayHaveIcon = cellLocation !== 'body' ? true : !!define?.icon || !!define?.tree;\n const padding = cellTheme._vtable.padding;\n const textAlign = cellTheme._vtable.textAlign;\n const textBaseline = cellTheme._vtable.textBaseline;\n\n let bgColorFunc: Function;\n // 判断是否有mapping 遍历dataset中mappingRules\n if ((table.internalProps as PivotTableProtected)?.dataConfig?.mappingRules && !table.isHeader(col, row)) {\n (table.internalProps as PivotTableProtected)?.dataConfig?.mappingRules?.forEach(\n (mappingRule: MappingRule, i: number) => {\n if (\n mappingRule.bgColor &&\n (table.internalProps.layoutMap as PivotHeaderLayoutMap).getIndicatorKey(col, row) ===\n mappingRule.bgColor.indicatorKey\n ) {\n bgColorFunc = mappingRule.bgColor.mapping;\n }\n }\n );\n }\n\n let customRender;\n let customLayout;\n if (cellLocation !== 'body') {\n customRender = define?.headerCustomRender;\n customLayout = define?.headerCustomLayout;\n } else {\n customRender = define?.customRender || table.customRender;\n customLayout = define?.customLayout;\n }\n\n let cellWidth;\n let cellHeight;\n if (range) {\n cellWidth = table.getColsWidth(range.start.col, range.end.col);\n cellHeight = table.getRowsHeight(range.start.row, range.end.row);\n } else {\n cellWidth = table.getColWidth(col);\n cellHeight = table.getRowHeight(row);\n }\n\n // deal with promise data\n if (isPromise(value)) {\n // clear cell content sync\n oldCellGroup.removeAllChild();\n\n // update cell content async\n dealPromiseData(\n value,\n table,\n updateCellContent.bind(\n null,\n type,\n value,\n define,\n table,\n col,\n row,\n bgColorFunc,\n cellWidth,\n cellHeight,\n oldCellGroup,\n padding,\n textAlign,\n textBaseline,\n mayHaveIcon,\n addNew,\n cellTheme\n )\n );\n } else {\n newCellGroup = updateCellContent(\n type,\n value,\n define,\n table,\n col,\n row,\n bgColorFunc,\n cellWidth,\n cellHeight,\n oldCellGroup,\n padding,\n textAlign,\n textBaseline,\n mayHaveIcon,\n addNew,\n cellTheme\n );\n }\n\n if (isMerge) {\n const rangeHeight = table.getRowHeight(row);\n const rangeWidth = table.getColWidth(col);\n\n const { width: contentWidth } = newCellGroup.attribute;\n const { height: contentHeight } = newCellGroup.attribute;\n newCellGroup.contentWidth = contentWidth;\n newCellGroup.contentHeight = contentHeight;\n\n resizeCellGroup(newCellGroup, rangeWidth, rangeHeight, range, table);\n }\n\n return newCellGroup;\n}\n\nfunction updateCellContent(\n type: ColumnTypeOption,\n value: string,\n define: ColumnDefine,\n table: BaseTableAPI,\n col: number,\n row: number,\n bgColorFunc: Function,\n cellWidth: number,\n cellHeight: number,\n oldCellGroup: Group,\n padding: [number, number, number, number],\n textAlign: CanvasTextAlign,\n textBaseline: CanvasTextBaseline,\n mayHaveIcon: boolean,\n addNew: boolean,\n cellTheme?: IThemeSpec\n) {\n if (isPromise(value)) {\n value = table.getCellValue(col, row);\n }\n //解决报错 getCellByCache递归调用 死循环问题\n if (!addNew && (oldCellGroup.row !== row || oldCellGroup.col !== col)) {\n return null;\n }\n const newCellGroup = createCell(\n type,\n value,\n define,\n table,\n col,\n row,\n table.getColWidth(col),\n cellWidth,\n cellHeight,\n // oldCellGroup.parent,\n addNew ? table.scenegraph.getColGroup(col) : oldCellGroup.parent,\n // oldCellGroup.attribute.y,\n addNew ? 0 : table.scenegraph.getCellGroupY(row), // y\n padding,\n textAlign,\n textBaseline,\n mayHaveIcon,\n cellTheme\n );\n if (!addNew && oldCellGroup.parent) {\n oldCellGroup.parent.insertAfter(newCellGroup, oldCellGroup);\n oldCellGroup.parent.removeChild(oldCellGroup);\n\n // update cache\n if (table.scenegraph?.proxy.cellCache.get(col)) {\n table.scenegraph?.proxy.cellCache.set(col, newCellGroup);\n }\n }\n return newCellGroup;\n}\n\nfunction canUseFastUpdate(col: number, row: number, oldCellGroup: Group, autoWrapText: boolean, table: BaseTableAPI) {\n const define = table.getBodyColumnDefine(col, row);\n const mayHaveIcon = !!define?.icon || !!define?.tree;\n const cellType = table.getBodyColumnType(col, row);\n const autoRowHeight = table.heightMode === 'autoHeight';\n const value = table.getCellValue(col, row);\n\n if (\n !table.isHeader(col, row) &&\n oldCellGroup.role === 'cell' &&\n cellType === 'text' &&\n !autoWrapText &&\n !autoRowHeight &&\n !mayHaveIcon &&\n oldCellGroup.firstChild?.type === 'text' &&\n !isPromise(value)\n ) {\n return true;\n }\n return false;\n}\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { Group } from '../../graphic/group';
|
|
2
2
|
import type { BaseTableAPI } from '../../../ts-types/base-table';
|
|
3
|
-
import type { IThemeSpec } from '
|
|
3
|
+
import type { IThemeSpec } from './../../../vrender';
|
|
4
4
|
export declare function createChartCellGroup(cellGroup: Group | null, columnGroup: Group, xOrigin: number, yOrigin: number, col: number, row: number, width: number, height: number, padding: number[], dataValue: string, chartModule: any, chartSpec: any, chartInstance: any, dataId: string | Record<string, string>, table: BaseTableAPI, cellTheme: IThemeSpec): Group;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/scenegraph/group-creater/cell-type/chart-cell.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAA4C;AAC5C,+CAA4C;AAC5C,yEAA2D;AAC3D,mDAAyD;AACzD,6CAA2C;AAG3C,SAAgB,oBAAoB,CAClC,SAAuB,EACvB,WAAkB,EAClB,OAAe,EACf,OAAe,EACf,GAAW,EACX,GAAW,EACX,KAAa,EACb,MAAc,EACd,OAAiB,EACjB,SAAiB,EACjB,WAAgB,EAChB,SAAc,EACd,aAAkB,EAClB,MAAuC,EACvC,KAAmB,EACnB,SAAqB;;IAGrB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AElC,KAAK,CAAC,aAAa,CAAC,SAAS,CAAC,gBAAgB,CAAC,GAAG,EAAE,GAAG,EAAE,UAAU,CAAC,aAAa,CAAC,CAAC;IAEnF,OAAO,SAAS,CAAC;AACnB,CAAC;AA3FD,oDA2FC","file":"chart-cell.js","sourcesContent":["import { Group } from '../../graphic/group';\nimport { Chart } from '../../graphic/chart';\nimport * as registerChartTypes from '../../../chartModule';\nimport { getFunctionalProp } from '../../utils/get-prop';\nimport { isValid } from '@visactor/vutils';\nimport type { BaseTableAPI } from '../../../ts-types/base-table';\nimport type { IThemeSpec } from '
|
|
1
|
+
{"version":3,"sources":["../src/scenegraph/group-creater/cell-type/chart-cell.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAA4C;AAC5C,+CAA4C;AAC5C,yEAA2D;AAC3D,mDAAyD;AACzD,6CAA2C;AAG3C,SAAgB,oBAAoB,CAClC,SAAuB,EACvB,WAAkB,EAClB,OAAe,EACf,OAAe,EACf,GAAW,EACX,GAAW,EACX,KAAa,EACb,MAAc,EACd,OAAiB,EACjB,SAAiB,EACjB,WAAgB,EAChB,SAAc,EACd,aAAkB,EAClB,MAAuC,EACvC,KAAmB,EACnB,SAAqB;;IAGrB,MAAM,cAAc,GAAG,kBAAkB,CAAC,GAAG,EAAE,CAAC;IAChD,MAAM,SAAS,GAAG,cAAc,CAAC,WAAW,CAAC,CAAC;IAC9C,MAAM,WAAW,GAAG,KAAK,CAAC,aAAa,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;IAClD,MAAM,iBAAiB,GAAG,IAAA,4BAAiB,EAAC,SAAS,EAAE,WAAW,EAAE,GAAG,EAAE,GAAG,EAAE,KAAK,CAAC,CAAC;IACrF,IAAI,IAAA,gBAAO,EAAC,iBAAiB,CAAC,EAAE;QAC9B,OAAO,GAAG,iBAAiB,CAAC;KAC7B;IAED,IAAI,CAAC,SAAS,EAAE;QACd,SAAS,GAAG,IAAI,aAAK,CAAC;YACpB,C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AAM,mCAAK,KAAK,CAAC,UAAU,CAAC,KAAK,CAAC,MAAM,CAAC,UAAU,EAAE,CAAC,MAAuC;QAC3G,IAAI,EAAE,KAAK,CAAC,OAAO,CAAC,IAAI;QACxB,UAAU,EAAE,KAAK,CAAC,OAAO,CAAC,UAAU;QACpC,IAAI,EAAE,SAAS;QACf,SAAS;QACT,KAAK,EAAE,KAAK,GAAG,OAAO,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC;QACtC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC;QACxC,aAAa;QACb,MAAM;QACN,IAAI,EAAE,KAAK,CAAC,YAAY,CAAC,GAAG,EAAE,GAAG,CAAC;QAClC,WAAW,EAAE,OAAO;QACpB,GAAG,EAAE,KAAK,CAAC,aAAa,CAAC,UAAU;QAOnC,IAAI,EAAE,KAAK,CAAC,YAAY,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,aAAa,CAAC,SAAS,CAAC,YAAY,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE;KAOvF,CAAC,CAAC;IACH,SAAS,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC;IAElC,KAAK,CAAC,aAAa,CAAC,SAAS,CAAC,gBAAgB,CAAC,GAAG,EAAE,GAAG,EAAE,UAAU,CAAC,aAAa,CAAC,CAAC;IAEnF,OAAO,SAAS,CAAC;AACnB,CAAC;AA3FD,oDA2FC","file":"chart-cell.js","sourcesContent":["import { Group } from '../../graphic/group';\nimport { Chart } from '../../graphic/chart';\nimport * as registerChartTypes from '../../../chartModule';\nimport { getFunctionalProp } from '../../utils/get-prop';\nimport { isValid } from '@visactor/vutils';\nimport type { BaseTableAPI } from '../../../ts-types/base-table';\nimport type { IThemeSpec } from './../../../vrender';\nexport function createChartCellGroup(\n cellGroup: Group | null,\n columnGroup: Group,\n xOrigin: number,\n yOrigin: number,\n col: number,\n row: number,\n width: number,\n height: number,\n padding: number[],\n dataValue: string,\n chartModule: any,\n chartSpec: any,\n chartInstance: any,\n dataId: string | Record<string, string>,\n table: BaseTableAPI,\n cellTheme: IThemeSpec\n) {\n // 获取注册的chart图表类型\n const registerCharts = registerChartTypes.get();\n const ClassType = registerCharts[chartModule];\n const headerStyle = table._getCellStyle(col, row); // to be fixed\n const functionalPadding = getFunctionalProp('padding', headerStyle, col, row, table);\n if (isValid(functionalPadding)) {\n padding = functionalPadding;\n }\n // cell\n if (!cellGroup) {\n cellGroup = new Group({\n x: xOrigin,\n y: yOrigin,\n width,\n height,\n\n // 背景相关,cell背景由cellGroup绘制\n lineWidth: cellTheme?.group?.lineWidth ?? undefined,\n fill: cellTheme?.group?.fill ?? undefined,\n stroke: cellTheme?.group?.stroke ?? undefined,\n strokeArrayWidth: (cellTheme?.group as any)?.strokeArrayWidth ?? undefined,\n strokeArrayColor: (cellTheme?.group as any)?.strokeArrayColor ?? undefined,\n cursor: (cellTheme?.group as any)?.cursor ?? undefined,\n\n lineCap: 'square',\n\n clip: true,\n\n cornerRadius: cellTheme.group.cornerRadius\n } as any);\n cellGroup.role = 'cell';\n cellGroup.col = col;\n cellGroup.row = row;\n columnGroup?.addChild(cellGroup);\n }\n cellGroup.AABBBounds.width(); // TODO 需要底层VRender修改\n // chart\n const chartGroup = new Chart({\n stroke: false,\n x: padding[3],\n y: padding[0],\n // canvas: table.canvas,\n canvas: table.canvas ?? (table.scenegraph.stage.window.getContext().canvas as unknown as HTMLCanvasElement),\n mode: table.options.mode,\n modeParams: table.options.modeParams,\n spec: chartSpec,\n ClassType,\n width: width - padding[3] - padding[1],\n height: height - padding[2] - padding[0],\n chartInstance,\n dataId,\n data: table.getCellValue(col, row),\n cellPadding: padding,\n dpr: table.internalProps.pixelRatio,\n // viewBox: {\n // x1: Math.ceil(cellGroup.globalAABBBounds.x1 + padding[3] + table.scrollLeft),\n // x2: Math.ceil(cellGroup.globalAABBBounds.x1 + width - padding[1] + table.scrollLeft),\n // y1: Math.ceil(cellGroup.globalAABBBounds.y1 + padding[0] + table.scrollTop),\n // y2: Math.ceil(cellGroup.globalAABBBounds.y1 + height - padding[2] + table.scrollTop)\n // },\n axes: table.isPivotChart() ? table.internalProps.layoutMap.getChartAxes(col, row) : []\n // clipRect: {\n // left: cellGroup.globalAABBBounds.x1 + (table as any).tableX + padding[3],\n // top: cellGroup.globalAABBBounds.y1 + (table as any).tableY + padding[0],\n // width: width - padding[1] - padding[3], //cellGroup.globalAABBBounds.width() - padding[1] - padding[3],\n // height: height - padding[0] - padding[2],\n // },\n });\n cellGroup.appendChild(chartGroup);\n // 将生成的实例存到layoutMap中 共享\n table.internalProps.layoutMap.setChartInstance(col, row, chartGroup.chartInstance);\n\n return cellGroup;\n}\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { IThemeSpec } from '
|
|
1
|
+
import type { IThemeSpec } from './../../../vrender';
|
|
2
2
|
import { Group } from '../../graphic/group';
|
|
3
3
|
import type { CheckboxColumnDefine } from '../../../ts-types';
|
|
4
4
|
import type { BaseTableAPI } from '../../../ts-types/base-table';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/scenegraph/group-creater/cell-type/checkbox-cell.ts"],"names":[],"mappings":";;;AAGA,+CAA4C;AAG5C,6CAA4C;AAC5C,qEAAwD;AACxD,2EAAsE;AACtE,kDAAmD;AAEnD,mDAA+C;AAE/C,SAAgB,uBAAuB,CACrC,SAAuB,EACvB,WAAkB,EAClB,OAAe,EACf,OAAe,EACf,GAAW,EACX,GAAW,EACX,QAAyB,EACzB,KAAa,EACb,MAAc,EACd,OAAiB,EACjB,SAA0B,EAC1B,YAAgC,EAChC,KAAmB,EACnB,SAAqB,EACrB,MAA4B;;IAG5B,IAAI,CAAC,SAAS,EAAE;QACd,SAAS,GAAG,IAAI,aAAK,CAAC;YACpB,CAAC,EAAE,OAAO;YACV,CAAC,EAAE,OAAO;YACV,KAAK;YACL,MAAM;YAGN,SAAS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CAAC,KAAK,CAAC,IAAI,GAAG,GAAG,CAAC;aAC/B;YACD,GAAG,EAAE;gBACH,KAAK,EAAE,IAAI;gBACX,MAAM,EAAE,IAAI;aACb;YACD,uBAAuB;YACvB,OAAO,EAAE,SAAS;YAClB,aAAa,EAAE,SAAS;YACxB,QAAQ,EAAE,MAAA,UAAU,aAAV,UAAU,cAAV,UAAU,GAAI,aAAa,mCAAI,KAAK;SAC/C,CAAC,CAAC;KACJ;IACD,QAAQ,CAAC,IAAI,GAAG,UAAU,CAAC;IAE3B,OAAO,QAAQ,CAAC;AAClB,CAAC","file":"checkbox-cell.js","sourcesContent":["import type { ILine, ISymbol, IThemeSpec } from '@visactor/vrender';\nimport { createLine, createSymbol } from '@visactor/vrender';\nimport { PointScale, LinearScale } from '@visactor/vscale';\nimport { Group } from '../../graphic/group';\nimport type { CellInfo, CheckboxColumnDefine, CheckboxStyleOption, SparklineSpec } from '../../../ts-types';\nimport type { BaseTableAPI } from '../../../ts-types/base-table';\nimport { isObject } from '@visactor/vutils';\nimport { CheckBox } from '@visactor/vrender-components';\nimport { getHierarchyOffset } from '../../utils/get-hierarchy-offset';\nimport { getOrApply } from '../../../tools/helper';\nimport type { CheckboxStyle } from '../../../body-helper/style/CheckboxStyle';\nimport { getProp } from '../../utils/get-prop';\n\nexport function createCheckboxCellGroup(\n cellGroup: Group | null,\n columnGroup: Group,\n xOrigin: number,\n yOrigin: number,\n col: number,\n row: number,\n colWidth: number | 'auto',\n width: number,\n height: number,\n padding: number[],\n textAlign: CanvasTextAlign,\n textBaseline: CanvasTextBaseline,\n table: BaseTableAPI,\n cellTheme: IThemeSpec,\n define: CheckboxColumnDefine\n) {\n // cell\n if (!cellGroup) {\n cellGroup = new Group({\n x: xOrigin,\n y: yOrigin,\n width,\n height,\n\n // 背景相关,cell背景由cellGroup绘制\n lineWidth: cellTheme?.group?.lineWidth ?? undefined,\n fill: cellTheme?.group?.fill ?? undefined,\n stroke: cellTheme?.group?.stroke ?? undefined,\n\n strokeArrayWidth: (cellTheme?.group as any)?.strokeArrayWidth ?? undefined,\n strokeArrayColor: (cellTheme?.group as any)?.strokeArrayColor ?? undefined,\n cursor: (cellTheme?.group as any)?.cursor ?? undefined,\n\n lineCap: 'square',\n\n clip: true,\n\n cornerRadius: cellTheme.group.cornerRadius\n } as any);\n cellGroup.role = 'cell';\n cellGroup.col = col;\n cellGroup.row = row;\n columnGroup?.addChild(cellGroup);\n }\n\n // checkbox\n const checkboxComponent = createCheckbox(col, row, colWidth, width, height, padding, cellTheme, define, table);\n if (checkboxComponent) {\n cellGroup.appendChild(checkboxComponent);\n }\n\n checkboxComponent.render();\n\n width -= padding[1] + padding[3];\n height -= padding[0] + padding[2];\n if (textAlign === 'center') {\n checkboxComponent.setAttribute('x', padding[3] + (width - checkboxComponent.AABBBounds.width()) / 2);\n } else if (textAlign === 'right') {\n checkboxComponent.setAttribute('x', padding[3] + width - checkboxComponent.AABBBounds.width());\n } else {\n checkboxComponent.setAttribute('x', padding[3]);\n }\n\n if (textBaseline === 'middle') {\n checkboxComponent.setAttribute('y', padding[0] + (height - checkboxComponent.AABBBounds.height()) / 2);\n } else if (textBaseline === 'bottom') {\n checkboxComponent.setAttribute('y', padding[0] + height - checkboxComponent.AABBBounds.height());\n } else {\n checkboxComponent.setAttribute('y', padding[0]);\n }\n\n return cellGroup;\n}\n\nfunction createCheckbox(\n col: number,\n row: number,\n colWidth: number | 'auto',\n cellWidth: number,\n cellHeight: number,\n padding: number[],\n cellTheme: IThemeSpec,\n define: CheckboxColumnDefine,\n table: BaseTableAPI\n) {\n const style = table._getCellStyle(col, row) as CheckboxStyle;\n const size = getProp('size', style, col, row, table);\n const spaceBetweenTextAndIcon = getProp('spaceBetweenTextAndIcon', style, col, row, table);\n\n const value = table.getCellValue(col, row) as string | { text: string; checked: boolean; disable: boolean } | boolean;\n const dataValue = table.getCellOriginValue(col, row);\n let isChecked;\n let isDisabled;\n let text = (value as string) ?? '';\n if (isObject(value)) {\n isChecked = value.checked;\n isDisabled = value.disable;\n text = value.text;\n } else if (typeof value === 'boolean') {\n isChecked = value;\n text = '';\n }\n isChecked = table.stateManager.syncCheckedState(col, row, define.field as string | number, isChecked);\n const hierarchyOffset = getHierarchyOffset(col, row, table);\n const cellStyle = table._getCellStyle(col, row) as CheckboxStyleOption; // to be fixed\n const autoWrapText = cellStyle.autoWrapText ?? table.internalProps.autoWrapText;\n const { lineClamp } = cellStyle;\n const { checked, disable } = define;\n if (isChecked === undefined || isChecked === null || typeof isChecked === 'function') {\n //isChecked无效值 取全局设置的值\n const globalChecked = getOrApply(checked as any, {\n col,\n row,\n table,\n context: null,\n value,\n dataValue\n });\n isChecked = table.stateManager.syncCheckedState(col, row, define.field as string | number, globalChecked);\n }\n const globalDisable = getOrApply(disable as any, {\n col,\n row,\n table,\n context: null,\n value,\n dataValue\n });\n\n const autoColWidth = colWidth === 'auto';\n const autoRowHeight = table.heightMode === 'autoHeight';\n\n const attribute = {\n text: text.length === 1 ? text[0] : text,\n maxLineWidth: autoColWidth\n ? Infinity\n : cellWidth - (padding[1] + padding[3] + hierarchyOffset) - size - spaceBetweenTextAndIcon,\n // fill: true,\n // textAlign: 'left',\n textBaseline: 'top',\n autoWrapText,\n lineClamp,\n wordBreak: 'break-word',\n // widthLimit: autoColWidth ? -1 : colWidth - (padding[1] + padding[3]),\n heightLimit: autoRowHeight ? -1 : cellHeight - (padding[0] + padding[2]),\n pickable: false,\n dx: hierarchyOffset,\n whiteSpace: text.length === 1 && !autoWrapText ? 'no-wrap' : 'normal'\n };\n const testAttribute = cellTheme.text ? (Object.assign({}, cellTheme.text, attribute) as any) : attribute;\n let checkbox;\n if (isChecked === 'indeterminate') {\n checkbox = new CheckBox({\n x: 0,\n y: 0,\n text: testAttribute,\n icon: {\n width: Math.floor(size / 1.4), // icon : box => 10 : 14\n height: Math.floor(size / 1.4)\n },\n box: {\n width: size,\n height: size\n },\n spaceBetweenTextAndIcon,\n checked: undefined,\n indeterminate: true,\n disabled: isDisabled ?? globalDisable ?? false\n });\n } else {\n checkbox = new CheckBox({\n x: 0,\n y: 0,\n text: testAttribute,\n icon: {\n width: Math.floor(size / 1.4), // icon : box => 10 : 14\n height: Math.floor(size / 1.4)\n },\n box: {\n width: size,\n height: size\n },\n spaceBetweenTextAndIcon,\n checked: isChecked,\n indeterminate: undefined,\n disabled: isDisabled ?? globalDisable ?? false\n });\n }\n checkbox.name = 'checkbox';\n\n return checkbox;\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/scenegraph/group-creater/cell-type/checkbox-cell.ts"],"names":[],"mappings":";;;AAGA,+CAA4C;AAG5C,6CAA4C;AAC5C,qEAAwD;AACxD,2EAAsE;AACtE,kDAAmD;AAEnD,mDAA+C;AAE/C,SAAgB,uBAAuB,CACrC,SAAuB,EACvB,WAAkB,EAClB,OAAe,EACf,OAAe,EACf,GAAW,EACX,GAAW,EACX,QAAyB,EACzB,KAAa,EACb,MAAc,EACd,OAAiB,EACjB,SAA0B,EAC1B,YAAgC,EAChC,KAAmB,EACnB,SAAqB,EACrB,MAA4B;;IAG5B,IAAI,CAAC,SAAS,EAAE;QACd,SAAS,GAAG,IAAI,aAAK,CAAC;YACpB,CAAC,EAAE,OAAO;YACV,CAAC,EAAE,OAAO;YACV,KAAK;YACL,MAAM;YAGN,SAAS,EAAE,MAAA,MAAA,SAAS,aAAT,SAAS,uBAAT,SAAS,CAAE,KAAK,0CAAE,SAAS,mCAAI,SAAS;YACnD,IAAI,EAAE,MAAA,MAAA,SAAS,aAAT,SAAS,uBAAT,SAAS,CAAE,KAAK,0CAAE,IAAI,mCAAI,SAAS;YACzC,MAAM,EAAE,MAAA,MAAA,SAAS,aAAT,SAAS,uBAAT,SAAS,CAAE,KAAK,0CAAE,MAAM,mCAAI,SAAS;YAE7C,gBAAgB,EAAE,MAAA,MAAC,SAAS,aAAT,SAAS,uBAAT,SAAS,CAAE,KAAa,0CAAE,gBAAgB,mCAAI,SAAS;YAC1E,gBAAgB,EAAE,MAAA,MAAC,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\nimport { createLine, createSymbol } from './../../../vrender';\nimport { PointScale, LinearScale } from '@visactor/vscale';\nimport { Group } from '../../graphic/group';\nimport type { CellInfo, CheckboxColumnDefine, CheckboxStyleOption, SparklineSpec } from '../../../ts-types';\nimport type { BaseTableAPI } from '../../../ts-types/base-table';\nimport { isObject } from '@visactor/vutils';\nimport { CheckBox } from '@visactor/vrender-components';\nimport { getHierarchyOffset } from '../../utils/get-hierarchy-offset';\nimport { getOrApply } from '../../../tools/helper';\nimport type { CheckboxStyle } from '../../../body-helper/style/CheckboxStyle';\nimport { getProp } from '../../utils/get-prop';\n\nexport function createCheckboxCellGroup(\n cellGroup: Group | null,\n columnGroup: Group,\n xOrigin: number,\n yOrigin: number,\n col: number,\n row: number,\n colWidth: number | 'auto',\n width: number,\n height: number,\n padding: number[],\n textAlign: CanvasTextAlign,\n textBaseline: CanvasTextBaseline,\n table: BaseTableAPI,\n cellTheme: IThemeSpec,\n define: CheckboxColumnDefine\n) {\n // cell\n if (!cellGroup) {\n cellGroup = new Group({\n x: xOrigin,\n y: yOrigin,\n width,\n height,\n\n // 背景相关,cell背景由cellGroup绘制\n lineWidth: cellTheme?.group?.lineWidth ?? undefined,\n fill: cellTheme?.group?.fill ?? undefined,\n stroke: cellTheme?.group?.stroke ?? undefined,\n\n strokeArrayWidth: (cellTheme?.group as any)?.strokeArrayWidth ?? undefined,\n strokeArrayColor: (cellTheme?.group as any)?.strokeArrayColor ?? undefined,\n cursor: (cellTheme?.group as any)?.cursor ?? undefined,\n\n lineCap: 'square',\n\n clip: true,\n\n cornerRadius: cellTheme.group.cornerRadius\n } as any);\n cellGroup.role = 'cell';\n cellGroup.col = col;\n cellGroup.row = row;\n columnGroup?.addChild(cellGroup);\n }\n\n // checkbox\n const checkboxComponent = createCheckbox(col, row, colWidth, width, height, padding, cellTheme, define, table);\n if (checkboxComponent) {\n cellGroup.appendChild(checkboxComponent);\n }\n\n checkboxComponent.render();\n\n width -= padding[1] + padding[3];\n height -= padding[0] + padding[2];\n if (textAlign === 'center') {\n checkboxComponent.setAttribute('x', padding[3] + (width - checkboxComponent.AABBBounds.width()) / 2);\n } else if (textAlign === 'right') {\n checkboxComponent.setAttribute('x', padding[3] + width - checkboxComponent.AABBBounds.width());\n } else {\n checkboxComponent.setAttribute('x', padding[3]);\n }\n\n if (textBaseline === 'middle') {\n checkboxComponent.setAttribute('y', padding[0] + (height - checkboxComponent.AABBBounds.height()) / 2);\n } else if (textBaseline === 'bottom') {\n checkboxComponent.setAttribute('y', padding[0] + height - checkboxComponent.AABBBounds.height());\n } else {\n checkboxComponent.setAttribute('y', padding[0]);\n }\n\n return cellGroup;\n}\n\nfunction createCheckbox(\n col: number,\n row: number,\n colWidth: number | 'auto',\n cellWidth: number,\n cellHeight: number,\n padding: number[],\n cellTheme: IThemeSpec,\n define: CheckboxColumnDefine,\n table: BaseTableAPI\n) {\n const style = table._getCellStyle(col, row) as CheckboxStyle;\n const size = getProp('size', style, col, row, table);\n const spaceBetweenTextAndIcon = getProp('spaceBetweenTextAndIcon', style, col, row, table);\n\n const value = table.getCellValue(col, row) as string | { text: string; checked: boolean; disable: boolean } | boolean;\n const dataValue = table.getCellOriginValue(col, row);\n let isChecked;\n let isDisabled;\n let text = (value as string) ?? '';\n if (isObject(value)) {\n isChecked = value.checked;\n isDisabled = value.disable;\n text = value.text;\n } else if (typeof value === 'boolean') {\n isChecked = value;\n text = '';\n }\n isChecked = table.stateManager.syncCheckedState(col, row, define.field as string | number, isChecked);\n const hierarchyOffset = getHierarchyOffset(col, row, table);\n const cellStyle = table._getCellStyle(col, row) as CheckboxStyleOption; // to be fixed\n const autoWrapText = cellStyle.autoWrapText ?? table.internalProps.autoWrapText;\n const { lineClamp } = cellStyle;\n const { checked, disable } = define;\n if (isChecked === undefined || isChecked === null || typeof isChecked === 'function') {\n //isChecked无效值 取全局设置的值\n const globalChecked = getOrApply(checked as any, {\n col,\n row,\n table,\n context: null,\n value,\n dataValue\n });\n isChecked = table.stateManager.syncCheckedState(col, row, define.field as string | number, globalChecked);\n }\n const globalDisable = getOrApply(disable as any, {\n col,\n row,\n table,\n context: null,\n value,\n dataValue\n });\n\n const autoColWidth = colWidth === 'auto';\n const autoRowHeight = table.heightMode === 'autoHeight';\n\n const attribute = {\n text: text.length === 1 ? text[0] : text,\n maxLineWidth: autoColWidth\n ? Infinity\n : cellWidth - (padding[1] + padding[3] + hierarchyOffset) - size - spaceBetweenTextAndIcon,\n // fill: true,\n // textAlign: 'left',\n textBaseline: 'top',\n autoWrapText,\n lineClamp,\n wordBreak: 'break-word',\n // widthLimit: autoColWidth ? -1 : colWidth - (padding[1] + padding[3]),\n heightLimit: autoRowHeight ? -1 : cellHeight - (padding[0] + padding[2]),\n pickable: false,\n dx: hierarchyOffset,\n whiteSpace: text.length === 1 && !autoWrapText ? 'no-wrap' : 'normal'\n };\n const testAttribute = cellTheme.text ? (Object.assign({}, cellTheme.text, attribute) as any) : attribute;\n let checkbox;\n if (isChecked === 'indeterminate') {\n checkbox = new CheckBox({\n x: 0,\n y: 0,\n text: testAttribute,\n icon: {\n width: Math.floor(size / 1.4), // icon : box => 10 : 14\n height: Math.floor(size / 1.4)\n },\n box: {\n width: size,\n height: size\n },\n spaceBetweenTextAndIcon,\n checked: undefined,\n indeterminate: true,\n disabled: isDisabled ?? globalDisable ?? false\n });\n } else {\n checkbox = new CheckBox({\n x: 0,\n y: 0,\n text: testAttribute,\n icon: {\n width: Math.floor(size / 1.4), // icon : box => 10 : 14\n height: Math.floor(size / 1.4)\n },\n box: {\n width: size,\n height: size\n },\n spaceBetweenTextAndIcon,\n checked: isChecked,\n indeterminate: undefined,\n disabled: isDisabled ?? globalDisable ?? false\n });\n }\n checkbox.name = 'checkbox';\n\n return checkbox;\n}\n"]}
|
|
@@ -29,7 +29,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
29
29
|
value: !0
|
|
30
30
|
}), exports.updateImageCellContentWhileResize = exports._adjustWidthHeight = exports.createImageCellGroup = void 0;
|
|
31
31
|
|
|
32
|
-
const vrender_1 = require("
|
|
32
|
+
const vrender_1 = require("./../../../vrender"), icons = __importStar(require("../../../icons")), group_1 = require("../../graphic/group"), keep_aspect_ratio_1 = require("../../utils/keep-aspect-ratio"), cell_pos_1 = require("../../utils/cell-pos"), get_prop_1 = require("../../utils/get-prop"), vutils_1 = require("@visactor/vutils"), padding_1 = require("../../utils/padding"), regedIcons = icons.get();
|
|
33
33
|
|
|
34
34
|
function createImageCellGroup(columnGroup, xOrigin, yOrigin, col, row, width, height, keepAspectRatio, imageAutoSizing, padding, textAlign, textBaseline, table, cellTheme) {
|
|
35
35
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/scenegraph/group-creater/cell-type/image-cell.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAGA,+CAAgD;AAEhD,sDAAwC;AACxC,+CAA4C;AAC5C,qEAAwE;AACxE,mDAAyD;AAEzD,mDAAkE;AAClE,6CAA2C;AAC3C,iDAAmD;AAEnD,MAAM,UAAU,GAAG,KAAK,CAAC,GAAG,EAAE,CAAC;AAE/B,SAAgB,oBAAoB,CAClC,WAAkB,EAClB,OAAe,EACf,OAAe,EACf,GAAW,EACX,GAAW,EACX,KAAa,EACb,MAAc,EACd,eAAwB,EACxB,eAAwB,EACxB,OAAyC,EACzC,SAA0B,EAC1B,YAAgC,EAChC,KAAmB,EACnB,SAAqB;;IAErB,MAAM,WAAW,GAAG,KAAK,CAAC,aAAa,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;IAClD,MAAM,iBAAiB,GAAG,IAAA,4BAAiB,EAAC,SAAS,EAAE,WAAW,EAAE,GAAG,EAAE,GAAG,EAAE,KAAK,CAAC,CAAC;IAErF,IAAI,IAAA,gBAAO,EAAC,iBAAiB,CAAC,EAAE;QAC9B,OAAO,GAAG,iBAAiB,CAAC;KAC7B;IACD,IAAI,MA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C,CAAC,GAAG,IAAI,GAAG,KAAK,CAAC,SAAS,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC;QAC5G,MAAM,OAAO,GACX,GAAG,GAAG,CAAC,MAAM,GAAG,KAAK,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,GAAG,GAAG,GAAG,KAAK,CAAC,SAAS,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;QAE9G,QAAQ,CAAC,aAAa,CAAC;YACrB,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,CAAC;YACzB,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,CAAC;YACzB,KAAK,EAAE,QAAQ;YACf,MAAM,EAAE,QAAQ;SACjB,CAAC,CAAC;KACJ;AACH,CAAC;AAtED,8EAsEC","file":"image-cell.js","sourcesContent":["// @ts-nocheck\n/* eslint-disable no-undef */\nimport type { IImage, Image, IThemeSpec } from '@visactor/vrender';\nimport { createImage } from '@visactor/vrender';\nimport type { BaseTableAPI } from '../../../ts-types';\nimport * as icons from '../../../icons';\nimport { Group } from '../../graphic/group';\nimport { calcKeepAspectRatioSize } from '../../utils/keep-aspect-ratio';\nimport { calcStartPosition } from '../../utils/cell-pos';\nimport type { Scenegraph } from '../../scenegraph';\nimport { getProp, getFunctionalProp } from '../../utils/get-prop';\nimport { isValid } from '@visactor/vutils';\nimport { getQuadProps } from '../../utils/padding';\n\nconst regedIcons = icons.get();\n\nexport function createImageCellGroup(\n columnGroup: Group,\n xOrigin: number,\n yOrigin: number,\n col: number,\n row: number,\n width: number,\n height: number,\n keepAspectRatio: boolean,\n imageAutoSizing: boolean,\n padding: [number, number, number, number],\n textAlign: CanvasTextAlign,\n textBaseline: CanvasTextBaseline,\n table: BaseTableAPI,\n cellTheme: IThemeSpec\n) {\n const headerStyle = table._getCellStyle(col, row); // to be fixed\n const functionalPadding = getFunctionalProp('padding', headerStyle, col, row, table);\n // const margin = getProp('padding', headerStyle, col, row, table);\n if (isValid(functionalPadding)) {\n padding = functionalPadding;\n }\n if (cellTheme?.text?.textAlign) {\n textAlign = cellTheme?.text?.textAlign;\n }\n if (cellTheme?.text?.textBaseline) {\n textBaseline = cellTheme?.text?.textBaseline;\n }\n\n // cell\n const cellGroup = new Group({\n x: xOrigin,\n y: yOrigin,\n width,\n height,\n // childrenPickable: false,\n\n // 背景相关,cell背景由cellGroup绘制\n lineWidth: cellTheme?.group?.lineWidth ?? undefined,\n fill: cellTheme?.group?.fill ?? undefined,\n stroke: cellTheme?.group?.stroke ?? undefined,\n strokeArrayWidth: (cellTheme?.group as any)?.strokeArrayWidth ?? undefined,\n strokeArrayColor: (cellTheme?.group as any)?.strokeArrayColor ?? undefined,\n cursor: (cellTheme?.group as any)?.cursor ?? undefined,\n\n lineCap: 'square',\n\n clip: true,\n\n cornerRadius: cellTheme.group.cornerRadius\n });\n cellGroup.role = 'cell';\n cellGroup.col = col;\n cellGroup.row = row;\n columnGroup?.addChild(cellGroup);\n\n // image\n const value = table.getCellValue(col, row);\n const image: IImage = createImage({\n x: padding[3],\n y: padding[0],\n width: width - padding[1] - padding[3],\n height: height - padding[0] - padding[2],\n image: value, //?? (regedIcons.damage_pic as any).svg,\n cursor: 'pointer' as Cursor\n });\n image.name = 'image';\n image.keepAspectRatio = keepAspectRatio;\n if (keepAspectRatio || imageAutoSizing) {\n image.successCallback = () => {\n const originImage = image.resources.get(image.attribute.image).data;\n\n if (imageAutoSizing) {\n _adjustWidthHeight(\n col,\n row,\n (originImage as HTMLImageElement).width,\n (originImage as HTMLImageElement).height,\n table.scenegraph,\n padding\n );\n }\n\n if (keepAspectRatio) {\n const { width: imageWidth, height: imageHeight } = calcKeepAspectRatioSize(\n originImage.width,\n originImage.height,\n cellGroup.attribute.width - padding[1] - padding[3],\n cellGroup.attribute.height - padding[0] - padding[2]\n );\n\n // const left = 0;\n // const top = 0;\n const pos = calcStartPosition(\n 0,\n 0,\n cellGroup.attribute.width,\n cellGroup.attribute.height,\n imageWidth,\n imageHeight,\n textAlign,\n textBaseline,\n padding\n );\n\n image.setAttributes({\n x: pos.x,\n y: pos.y,\n width: imageWidth,\n height: imageHeight\n });\n }\n\n table.scenegraph.updateNextFrame();\n };\n } else {\n image.successCallback = () => {\n updateImageCellContentWhileResize(cellGroup, col, row, table);\n };\n }\n (image as any).failCallback = () => {\n const regedIcons = icons.get();\n // image.setAttribute('image', (regedIcons.damage_pic as any).svg);\n (image as any).image = (regedIcons.damage_pic as any).svg;\n };\n cellGroup.appendChild(image);\n\n return cellGroup;\n}\n\n/**\n * 调整某个图片资源所在行列的行高列宽 之后重绘\n * @param col\n * @param row\n * @param img\n * @param table\n * @returns 行高或者列宽是否进行了调整\n */\nexport function _adjustWidthHeight(\n col: number,\n row: number,\n // img: HTMLImageElement,\n width: number,\n height: number,\n scene: Scenegraph,\n padding: [number, number, number, number]\n): boolean {\n // const { width, height } = img as any;\n // const currentContext = context.toCurrentContext();\n\n let needInvalidate = false;\n let targetWidth: number = null;\n let targetHeight: number = null;\n if (scene.table.getColWidth(col) < width + padding[1] + padding[3]) {\n targetWidth = width + padding[1] + padding[3];\n needInvalidate = true;\n }\n if (scene.table.getRowHeight(row) < height + padding[2] + padding[0]) {\n targetHeight = height + padding[2] + padding[0];\n needInvalidate = true;\n }\n if (needInvalidate) {\n if (typeof targetWidth === 'number') {\n // table.setColWidth(col, targetWidth, true);\n scene.setColWidth(col, targetWidth);\n }\n if (typeof targetHeight === 'number') {\n // table.setRowHeight(row, targetHeight, true);\n scene.setRowHeight(row, targetHeight);\n }\n // table.updateCanvasScroll();\n // // table.throttleInvalidate(); // 这里会造成每一张图加载后就重绘 造成多次绘制问题!节流绘制\n // table.invalidate(); //节流绘制改回及时绘制 节流绘制在图片加载过程中的效果不太好\n\n scene.component.updateScrollBar();\n // scene.updateNextFrame();\n return true;\n }\n return false;\n}\n\nexport function updateImageCellContentWhileResize(cellGroup: Group, col: number, row: number, table: BaseTableAPI) {\n const image = cellGroup.getChildByName('image') as Image;\n const originImage =\n (typeof image.attribute.image !== 'string' && image.attribute.image) ||\n image.resources?.get(image.attribute.image).data;\n\n if (!originImage) {\n return;\n }\n\n const headerStyle = table._getCellStyle(col, row); // to be fixed\n const textAlign = getProp('textAlign', headerStyle, col, row, table) ?? 'left';\n const textBaseline = getProp('textBaseline', headerStyle, col, row, table) ?? 'middle';\n const padding = getQuadProps(getProp('padding', headerStyle, col, row, table)) ?? [0, 0, 0, 0];\n\n if (image.keepAspectRatio) {\n const { width: imageWidth, height: imageHeight } = calcKeepAspectRatioSize(\n originImage.width || originImage.videoWidth,\n originImage.height || originImage.videoHeight,\n cellGroup.attribute.width - (padding[1] + padding[3]),\n cellGroup.attribute.height - (padding[0] + padding[2])\n );\n\n const pos = calcStartPosition(\n 0,\n 0,\n cellGroup.attribute.width,\n cellGroup.attribute.height,\n imageWidth,\n imageHeight,\n textAlign,\n textBaseline,\n padding\n );\n\n image.setAttributes({\n x: pos.x,\n y: pos.y,\n width: imageWidth,\n height: imageHeight\n });\n } else {\n image.setAttributes({\n x: padding[3],\n y: padding[0],\n width: cellGroup.attribute.width - padding[1] - padding[3],\n height: cellGroup.attribute.height - padding[0] - padding[2]\n });\n }\n\n // update video play icon\n const playIcon = cellGroup.getChildByName('play-icon');\n if (playIcon) {\n const left = 0;\n const top = 0;\n const width = cellGroup.attribute.width;\n const height = cellGroup.attribute.height;\n const iconSize = Math.floor(Math.min(width - padding[1] - padding[3], height - padding[2] - padding[0]) / 2);\n const anchorX =\n left + (width > image.attribute.width ? image.attribute.x - left + image.attribute.width / 2 : width / 2);\n const anchorY =\n top + (height > image.attribute.height ? image.attribute.y - top + image.attribute.height / 2 : height / 2);\n\n playIcon.setAttributes({\n x: anchorX - iconSize / 2,\n y: anchorY - iconSize / 2,\n width: iconSize,\n height: iconSize\n });\n }\n}\n"]}
|
|
1
|
+
{"version":3,"sources":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AC;YACzB,KAAK,EAAE,QAAQ;YACf,MAAM,EAAE,QAAQ;SACjB,CAAC,CAAC;KACJ;AACH,CAAC;AAtED,8EAsEC","file":"image-cell.js","sourcesContent":["// @ts-nocheck\n/* eslint-disable no-undef */\nimport type { IImage, Image, IThemeSpec } from './../../../vrender';\nimport { createImage } from './../../../vrender';\nimport type { BaseTableAPI } from '../../../ts-types';\nimport * as icons from '../../../icons';\nimport { Group } from '../../graphic/group';\nimport { calcKeepAspectRatioSize } from '../../utils/keep-aspect-ratio';\nimport { calcStartPosition } from '../../utils/cell-pos';\nimport type { Scenegraph } from '../../scenegraph';\nimport { getProp, getFunctionalProp } from '../../utils/get-prop';\nimport { isValid } from '@visactor/vutils';\nimport { getQuadProps } from '../../utils/padding';\n\nconst regedIcons = icons.get();\n\nexport function createImageCellGroup(\n columnGroup: Group,\n xOrigin: number,\n yOrigin: number,\n col: number,\n row: number,\n width: number,\n height: number,\n keepAspectRatio: boolean,\n imageAutoSizing: boolean,\n padding: [number, number, number, number],\n textAlign: CanvasTextAlign,\n textBaseline: CanvasTextBaseline,\n table: BaseTableAPI,\n cellTheme: IThemeSpec\n) {\n const headerStyle = table._getCellStyle(col, row); // to be fixed\n const functionalPadding = getFunctionalProp('padding', headerStyle, col, row, table);\n // const margin = getProp('padding', headerStyle, col, row, table);\n if (isValid(functionalPadding)) {\n padding = functionalPadding;\n }\n if (cellTheme?.text?.textAlign) {\n textAlign = cellTheme?.text?.textAlign;\n }\n if (cellTheme?.text?.textBaseline) {\n textBaseline = cellTheme?.text?.textBaseline;\n }\n\n // cell\n const cellGroup = new Group({\n x: xOrigin,\n y: yOrigin,\n width,\n height,\n // childrenPickable: false,\n\n // 背景相关,cell背景由cellGroup绘制\n lineWidth: cellTheme?.group?.lineWidth ?? undefined,\n fill: cellTheme?.group?.fill ?? undefined,\n stroke: cellTheme?.group?.stroke ?? undefined,\n strokeArrayWidth: (cellTheme?.group as any)?.strokeArrayWidth ?? undefined,\n strokeArrayColor: (cellTheme?.group as any)?.strokeArrayColor ?? undefined,\n cursor: (cellTheme?.group as any)?.cursor ?? undefined,\n\n lineCap: 'square',\n\n clip: true,\n\n cornerRadius: cellTheme.group.cornerRadius\n });\n cellGroup.role = 'cell';\n cellGroup.col = col;\n cellGroup.row = row;\n columnGroup?.addChild(cellGroup);\n\n // image\n const value = table.getCellValue(col, row);\n const image: IImage = createImage({\n x: padding[3],\n y: padding[0],\n width: width - padding[1] - padding[3],\n height: height - padding[0] - padding[2],\n image: value, //?? (regedIcons.damage_pic as any).svg,\n cursor: 'pointer' as Cursor\n });\n image.name = 'image';\n image.keepAspectRatio = keepAspectRatio;\n if (keepAspectRatio || imageAutoSizing) {\n image.successCallback = () => {\n const originImage = image.resources.get(image.attribute.image).data;\n\n if (imageAutoSizing) {\n _adjustWidthHeight(\n col,\n row,\n (originImage as HTMLImageElement).width,\n (originImage as HTMLImageElement).height,\n table.scenegraph,\n padding\n );\n }\n\n if (keepAspectRatio) {\n const { width: imageWidth, height: imageHeight } = calcKeepAspectRatioSize(\n originImage.width,\n originImage.height,\n cellGroup.attribute.width - padding[1] - padding[3],\n cellGroup.attribute.height - padding[0] - padding[2]\n );\n\n // const left = 0;\n // const top = 0;\n const pos = calcStartPosition(\n 0,\n 0,\n cellGroup.attribute.width,\n cellGroup.attribute.height,\n imageWidth,\n imageHeight,\n textAlign,\n textBaseline,\n padding\n );\n\n image.setAttributes({\n x: pos.x,\n y: pos.y,\n width: imageWidth,\n height: imageHeight\n });\n }\n\n table.scenegraph.updateNextFrame();\n };\n } else {\n image.successCallback = () => {\n updateImageCellContentWhileResize(cellGroup, col, row, table);\n };\n }\n (image as any).failCallback = () => {\n const regedIcons = icons.get();\n // image.setAttribute('image', (regedIcons.damage_pic as any).svg);\n (image as any).image = (regedIcons.damage_pic as any).svg;\n };\n cellGroup.appendChild(image);\n\n return cellGroup;\n}\n\n/**\n * 调整某个图片资源所在行列的行高列宽 之后重绘\n * @param col\n * @param row\n * @param img\n * @param table\n * @returns 行高或者列宽是否进行了调整\n */\nexport function _adjustWidthHeight(\n col: number,\n row: number,\n // img: HTMLImageElement,\n width: number,\n height: number,\n scene: Scenegraph,\n padding: [number, number, number, number]\n): boolean {\n // const { width, height } = img as any;\n // const currentContext = context.toCurrentContext();\n\n let needInvalidate = false;\n let targetWidth: number = null;\n let targetHeight: number = null;\n if (scene.table.getColWidth(col) < width + padding[1] + padding[3]) {\n targetWidth = width + padding[1] + padding[3];\n needInvalidate = true;\n }\n if (scene.table.getRowHeight(row) < height + padding[2] + padding[0]) {\n targetHeight = height + padding[2] + padding[0];\n needInvalidate = true;\n }\n if (needInvalidate) {\n if (typeof targetWidth === 'number') {\n // table.setColWidth(col, targetWidth, true);\n scene.setColWidth(col, targetWidth);\n }\n if (typeof targetHeight === 'number') {\n // table.setRowHeight(row, targetHeight, true);\n scene.setRowHeight(row, targetHeight);\n }\n // table.updateCanvasScroll();\n // // table.throttleInvalidate(); // 这里会造成每一张图加载后就重绘 造成多次绘制问题!节流绘制\n // table.invalidate(); //节流绘制改回及时绘制 节流绘制在图片加载过程中的效果不太好\n\n scene.component.updateScrollBar();\n // scene.updateNextFrame();\n return true;\n }\n return false;\n}\n\nexport function updateImageCellContentWhileResize(cellGroup: Group, col: number, row: number, table: BaseTableAPI) {\n const image = cellGroup.getChildByName('image') as Image;\n const originImage =\n (typeof image.attribute.image !== 'string' && image.attribute.image) ||\n image.resources?.get(image.attribute.image).data;\n\n if (!originImage) {\n return;\n }\n\n const headerStyle = table._getCellStyle(col, row); // to be fixed\n const textAlign = getProp('textAlign', headerStyle, col, row, table) ?? 'left';\n const textBaseline = getProp('textBaseline', headerStyle, col, row, table) ?? 'middle';\n const padding = getQuadProps(getProp('padding', headerStyle, col, row, table)) ?? [0, 0, 0, 0];\n\n if (image.keepAspectRatio) {\n const { width: imageWidth, height: imageHeight } = calcKeepAspectRatioSize(\n originImage.width || originImage.videoWidth,\n originImage.height || originImage.videoHeight,\n cellGroup.attribute.width - (padding[1] + padding[3]),\n cellGroup.attribute.height - (padding[0] + padding[2])\n );\n\n const pos = calcStartPosition(\n 0,\n 0,\n cellGroup.attribute.width,\n cellGroup.attribute.height,\n imageWidth,\n imageHeight,\n textAlign,\n textBaseline,\n padding\n );\n\n image.setAttributes({\n x: pos.x,\n y: pos.y,\n width: imageWidth,\n height: imageHeight\n });\n } else {\n image.setAttributes({\n x: padding[3],\n y: padding[0],\n width: cellGroup.attribute.width - padding[1] - padding[3],\n height: cellGroup.attribute.height - padding[0] - padding[2]\n });\n }\n\n // update video play icon\n const playIcon = cellGroup.getChildByName('play-icon');\n if (playIcon) {\n const left = 0;\n const top = 0;\n const width = cellGroup.attribute.width;\n const height = cellGroup.attribute.height;\n const iconSize = Math.floor(Math.min(width - padding[1] - padding[3], height - padding[2] - padding[0]) / 2);\n const anchorX =\n left + (width > image.attribute.width ? image.attribute.x - left + image.attribute.width / 2 : width / 2);\n const anchorY =\n top + (height > image.attribute.height ? image.attribute.y - top + image.attribute.height / 2 : height / 2);\n\n playIcon.setAttributes({\n x: anchorX - iconSize / 2,\n y: anchorY - iconSize / 2,\n width: iconSize,\n height: iconSize\n });\n }\n}\n"]}
|
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: !0
|
|
5
5
|
}), exports.createProgressBarCell = void 0;
|
|
6
6
|
|
|
7
|
-
const vrender_1 = require("
|
|
7
|
+
const vrender_1 = require("./../../../vrender"), helper_1 = require("../../../tools/helper"), group_1 = require("../../graphic/group"), get_prop_1 = require("../../utils/get-prop"), padding_1 = require("../../utils/padding");
|
|
8
8
|
|
|
9
9
|
function createProgressBarCell(progressBarDefine, style, width, value, dataValue, col, row, padding, table) {
|
|
10
10
|
var _a, _b, _c, _d, _e, _f;
|