@visactor/vtable 1.17.0-alpha.4 → 1.17.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/ListTable-all.js +3 -2
- package/cjs/ListTable-all.js.map +1 -1
- package/cjs/ListTable.d.ts +4 -0
- package/cjs/ListTable.js +13 -1
- package/cjs/ListTable.js.map +1 -1
- package/cjs/PivotChart.d.ts +2 -0
- package/cjs/PivotChart.js +90 -31
- package/cjs/PivotChart.js.map +1 -1
- package/cjs/PivotTable.d.ts +1 -0
- package/cjs/PivotTable.js +29 -26
- package/cjs/PivotTable.js.map +1 -1
- package/cjs/body-helper/body-helper.d.ts +3 -1
- package/cjs/body-helper/body-helper.js +7 -1
- package/cjs/body-helper/body-helper.js.map +1 -1
- package/cjs/body-helper/style/ButtonStyle.d.ts +45 -0
- package/cjs/body-helper/style/ButtonStyle.js +110 -0
- package/cjs/body-helper/style/ButtonStyle.js.map +1 -0
- package/cjs/body-helper/style/SwitchStyle.d.ts +36 -0
- package/cjs/body-helper/style/SwitchStyle.js +90 -0
- package/cjs/body-helper/style/SwitchStyle.js.map +1 -0
- package/cjs/body-helper/style.js +5 -4
- package/cjs/body-helper/style.js.map +1 -1
- package/cjs/components/axis/axis.d.ts +1 -1
- package/cjs/components/axis/axis.js +3 -3
- package/cjs/components/axis/axis.js.map +1 -1
- package/cjs/components/axis/get-axis-component-size.js.map +1 -1
- package/cjs/components/axis/label-overlap.d.ts +1 -1
- package/cjs/components/axis/label-overlap.js.map +1 -1
- package/cjs/components/legend/continue-legend/continue-legend.d.ts +1 -1
- package/cjs/components/legend/continue-legend/continue-legend.js +3 -3
- package/cjs/components/legend/continue-legend/continue-legend.js.map +1 -1
- package/cjs/components/legend/discrete-legend/discrete-legend.d.ts +2 -2
- package/cjs/components/legend/discrete-legend/discrete-legend.js +5 -5
- package/cjs/components/legend/discrete-legend/discrete-legend.js.map +1 -1
- package/cjs/components/menu/dom/MenuHandler.js +10 -3
- package/cjs/components/menu/dom/MenuHandler.js.map +1 -1
- package/cjs/components/title/title.d.ts +2 -2
- package/cjs/components/title/title.js +2 -2
- package/cjs/components/title/title.js.map +1 -1
- package/cjs/core/BaseTable.d.ts +5 -1
- package/cjs/core/BaseTable.js +30 -27
- package/cjs/core/BaseTable.js.map +1 -1
- package/cjs/core/FouseInput.js +1 -2
- package/cjs/core/TABLE_EVENT_TYPE.d.ts +2 -0
- package/cjs/core/TABLE_EVENT_TYPE.js +3 -1
- package/cjs/core/TABLE_EVENT_TYPE.js.map +1 -1
- package/cjs/core/utils/get-cell-position.js +2 -2
- package/cjs/core/utils/get-cell-position.js.map +1 -1
- package/cjs/dataset/dataset-pivot-table.js +2 -1
- package/cjs/edit/edit-manager.d.ts +6 -4
- package/cjs/edit/edit-manager.js +16 -13
- package/cjs/edit/edit-manager.js.map +1 -1
- package/cjs/event/component/button.d.ts +2 -0
- package/cjs/event/component/button.js +21 -0
- package/cjs/event/component/button.js.map +1 -0
- package/cjs/event/event.js +6 -6
- package/cjs/event/event.js.map +1 -1
- package/cjs/event/listener/container-dom.js +1 -1
- package/cjs/event/listener/container-dom.js.map +1 -1
- package/cjs/event/listener/table-group.js +20 -0
- package/cjs/event/listener/table-group.js.map +1 -1
- package/cjs/header-helper/header-helper.js +30 -8
- package/cjs/header-helper/header-helper.js.map +1 -1
- package/cjs/index.d.ts +1 -1
- package/cjs/index.js +1 -1
- package/cjs/index.js.map +1 -1
- package/cjs/layout/chart-helper/get-chart-spec.js.map +1 -1
- package/cjs/render/jsx/index.d.ts +1 -1
- package/cjs/render/jsx/index.js +4 -4
- package/cjs/render/jsx/index.js.map +1 -1
- package/cjs/render/layout/index.d.ts +1 -1
- package/cjs/render/layout/index.js +3 -3
- package/cjs/render/layout/index.js.map +1 -1
- package/cjs/render/layout/tag.d.ts +2 -2
- package/cjs/render/layout/tag.js +2 -2
- package/cjs/render/layout/tag.js.map +1 -1
- package/cjs/render/layout/text.js.map +1 -1
- package/cjs/scenegraph/component/cell-content.d.ts +4 -4
- package/cjs/scenegraph/component/cell-content.js +1 -1
- package/cjs/scenegraph/component/cell-content.js.map +1 -1
- package/cjs/scenegraph/component/menu.js +6 -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 +3 -3
- package/cjs/scenegraph/component/table-component.js.map +1 -1
- package/cjs/scenegraph/graphic/chart.d.ts +2 -0
- package/cjs/scenegraph/graphic/chart.js +4 -4
- package/cjs/scenegraph/graphic/chart.js.map +1 -1
- package/cjs/scenegraph/graphic/contributions/chart-render-helper.d.ts +2 -0
- package/cjs/scenegraph/graphic/contributions/chart-render-helper.js +11 -9
- package/cjs/scenegraph/graphic/contributions/chart-render-helper.js.map +1 -1
- package/cjs/scenegraph/graphic/contributions/chart-render.js +2 -2
- package/cjs/scenegraph/graphic/contributions/chart-render.js.map +1 -1
- package/cjs/scenegraph/graphic/contributions/rect-contribution-render.js +2 -2
- package/cjs/scenegraph/graphic/contributions/rect-contribution-render.js.map +1 -1
- package/cjs/scenegraph/graphic/icon.d.ts +8 -2
- package/cjs/scenegraph/graphic/icon.js +13 -1
- package/cjs/scenegraph/graphic/icon.js.map +1 -1
- package/cjs/scenegraph/group-creater/cell-helper.js +4 -0
- package/cjs/scenegraph/group-creater/cell-helper.js.map +1 -1
- package/cjs/scenegraph/group-creater/cell-type/button-cell.d.ts +6 -0
- package/cjs/scenegraph/group-creater/cell-type/button-cell.js +144 -0
- package/cjs/scenegraph/group-creater/cell-type/button-cell.js.map +1 -0
- package/cjs/scenegraph/group-creater/cell-type/chart-cell.js +4 -2
- package/cjs/scenegraph/group-creater/cell-type/chart-cell.js.map +1 -1
- package/cjs/scenegraph/group-creater/cell-type/checkbox-cell.js +2 -2
- package/cjs/scenegraph/group-creater/cell-type/checkbox-cell.js.map +1 -1
- package/cjs/scenegraph/group-creater/cell-type/index.d.ts +2 -0
- package/cjs/scenegraph/group-creater/cell-type/index.js +14 -2
- package/cjs/scenegraph/group-creater/cell-type/index.js.map +1 -1
- package/cjs/scenegraph/group-creater/cell-type/radio-cell.js +2 -2
- package/cjs/scenegraph/group-creater/cell-type/radio-cell.js.map +1 -1
- package/cjs/scenegraph/group-creater/cell-type/switch-cell.d.ts +6 -0
- package/cjs/scenegraph/group-creater/cell-type/switch-cell.js +152 -0
- package/cjs/scenegraph/group-creater/cell-type/switch-cell.js.map +1 -0
- package/cjs/scenegraph/layout/compute-col-width.js +23 -7
- package/cjs/scenegraph/layout/compute-col-width.js.map +1 -1
- package/cjs/scenegraph/layout/compute-row-height.js +4 -2
- package/cjs/scenegraph/layout/compute-row-height.js.map +1 -1
- package/cjs/scenegraph/layout/height-util.d.ts +2 -0
- package/cjs/scenegraph/layout/height-util.js +40 -3
- package/cjs/scenegraph/layout/height-util.js.map +1 -1
- package/cjs/scenegraph/scenegraph.d.ts +1 -1
- package/cjs/scenegraph/scenegraph.js +8 -7
- package/cjs/scenegraph/scenegraph.js.map +1 -1
- package/cjs/scenegraph/utils/cell-border-stroke-width.d.ts +1 -1
- package/cjs/scenegraph/utils/cell-border-stroke-width.js.map +1 -1
- package/cjs/scenegraph/utils/text-icon-layout.d.ts +2 -2
- package/cjs/scenegraph/utils/text-icon-layout.js +7 -6
- package/cjs/scenegraph/utils/text-icon-layout.js.map +1 -1
- package/cjs/scenegraph/utils/text-measure.js.map +1 -1
- package/cjs/state/radio/radio.js +1 -1
- package/cjs/state/radio/radio.js.map +1 -1
- package/cjs/state/select/custom-select.js +2 -2
- package/cjs/state/select/custom-select.js.map +1 -1
- package/cjs/state/state.js +6 -2
- package/cjs/state/state.js.map +1 -1
- package/cjs/themes/theme.d.ts +4 -0
- package/cjs/themes/theme.js +19 -2
- package/cjs/themes/theme.js.map +1 -1
- package/cjs/tools/icons.d.ts +2 -2
- package/cjs/tools/icons.js +1 -1
- package/cjs/tools/icons.js.map +1 -1
- package/cjs/ts-types/base-table.d.ts +23 -4
- package/cjs/ts-types/base-table.js.map +1 -1
- package/cjs/ts-types/column/style.d.ts +32 -0
- package/cjs/ts-types/column/style.js.map +1 -1
- package/cjs/ts-types/column/type.d.ts +1 -1
- package/cjs/ts-types/column/type.js.map +1 -1
- package/cjs/ts-types/component/legend.d.ts +1 -1
- package/cjs/ts-types/component/legend.js.map +1 -1
- package/cjs/ts-types/events.d.ts +10 -0
- package/cjs/ts-types/events.js.map +1 -1
- package/cjs/ts-types/icon.d.ts +6 -6
- package/cjs/ts-types/icon.js.map +1 -1
- package/cjs/ts-types/list-table/define/button-define.d.ts +9 -0
- package/cjs/ts-types/list-table/define/{Composite-define.js → button-define.js} +1 -1
- package/cjs/ts-types/list-table/define/button-define.js.map +1 -0
- package/cjs/ts-types/list-table/define/composite-define.js +6 -0
- package/{es/ts-types/list-table/define/Composite-define.js.map → cjs/ts-types/list-table/define/composite-define.js.map} +1 -1
- package/cjs/ts-types/list-table/define/index.d.ts +7 -3
- package/cjs/ts-types/list-table/define/index.js.map +1 -1
- package/cjs/ts-types/list-table/define/switch-define.d.ts +11 -0
- package/cjs/ts-types/list-table/define/switch-define.js +6 -0
- package/cjs/ts-types/list-table/define/switch-define.js.map +1 -0
- package/cjs/ts-types/list-table/layout-map/api.d.ts +5 -1
- package/cjs/ts-types/list-table/layout-map/api.js.map +1 -1
- package/cjs/ts-types/pivot-table/dimension/basic-dimension.d.ts +5 -1
- package/cjs/ts-types/pivot-table/dimension/basic-dimension.js.map +1 -1
- package/cjs/ts-types/pivot-table/indicator/basic-indicator.d.ts +5 -1
- package/cjs/ts-types/pivot-table/indicator/basic-indicator.js.map +1 -1
- package/cjs/ts-types/table-engine.d.ts +8 -0
- package/cjs/ts-types/table-engine.js.map +1 -1
- package/cjs/ts-types/theme.d.ts +4 -2
- package/cjs/ts-types/theme.js.map +1 -1
- package/cjs/vrender.js.map +1 -1
- package/dist/vtable.js +1160 -88
- package/dist/vtable.min.js +2 -2
- package/es/ListTable-all.js +3 -2
- package/es/ListTable-all.js.map +1 -1
- package/es/ListTable.d.ts +4 -0
- package/es/ListTable.js +13 -1
- package/es/ListTable.js.map +1 -1
- package/es/PivotChart.d.ts +2 -0
- package/es/PivotChart.js +91 -30
- package/es/PivotChart.js.map +1 -1
- package/es/PivotTable.d.ts +1 -0
- package/es/PivotTable.js +29 -26
- package/es/PivotTable.js.map +1 -1
- package/es/body-helper/body-helper.d.ts +3 -1
- package/es/body-helper/body-helper.js +10 -0
- package/es/body-helper/body-helper.js.map +1 -1
- package/es/body-helper/style/ButtonStyle.d.ts +45 -0
- package/es/body-helper/style/ButtonStyle.js +102 -0
- package/es/body-helper/style/ButtonStyle.js.map +1 -0
- package/es/body-helper/style/SwitchStyle.d.ts +36 -0
- package/es/body-helper/style/SwitchStyle.js +82 -0
- package/es/body-helper/style/SwitchStyle.js.map +1 -0
- package/es/body-helper/style.js +8 -3
- package/es/body-helper/style.js.map +1 -1
- package/es/components/axis/axis.d.ts +1 -1
- package/es/components/axis/axis.js +1 -1
- package/es/components/axis/axis.js.map +1 -1
- package/es/components/axis/get-axis-component-size.js.map +1 -1
- package/es/components/axis/label-overlap.d.ts +1 -1
- package/es/components/axis/label-overlap.js.map +1 -1
- package/es/components/legend/continue-legend/continue-legend.d.ts +1 -1
- package/es/components/legend/continue-legend/continue-legend.js +1 -1
- package/es/components/legend/continue-legend/continue-legend.js.map +1 -1
- package/es/components/legend/discrete-legend/discrete-legend.d.ts +2 -2
- package/es/components/legend/discrete-legend/discrete-legend.js +1 -1
- package/es/components/legend/discrete-legend/discrete-legend.js.map +1 -1
- package/es/components/menu/dom/MenuHandler.js +10 -3
- package/es/components/menu/dom/MenuHandler.js.map +1 -1
- package/es/components/title/title.d.ts +2 -2
- package/es/components/title/title.js +1 -1
- package/es/components/title/title.js.map +1 -1
- package/es/core/BaseTable.d.ts +5 -1
- package/es/core/BaseTable.js +30 -27
- package/es/core/BaseTable.js.map +1 -1
- package/es/core/FouseInput.js +1 -2
- package/es/core/TABLE_EVENT_TYPE.d.ts +2 -0
- package/es/core/TABLE_EVENT_TYPE.js +3 -1
- package/es/core/TABLE_EVENT_TYPE.js.map +1 -1
- package/es/core/utils/get-cell-position.js +2 -2
- package/es/core/utils/get-cell-position.js.map +1 -1
- package/es/dataset/dataset-pivot-table.js +2 -1
- package/es/edit/edit-manager.d.ts +6 -4
- package/es/edit/edit-manager.js +17 -14
- package/es/edit/edit-manager.js.map +1 -1
- package/es/event/component/button.d.ts +2 -0
- package/es/event/component/button.js +13 -0
- package/es/event/component/button.js.map +1 -0
- package/es/event/event.js +7 -5
- package/es/event/event.js.map +1 -1
- package/es/event/listener/container-dom.js +1 -1
- package/es/event/listener/container-dom.js.map +1 -1
- package/es/event/listener/table-group.js +18 -0
- package/es/event/listener/table-group.js.map +1 -1
- package/es/header-helper/header-helper.js +30 -8
- package/es/header-helper/header-helper.js.map +1 -1
- package/es/index.d.ts +1 -1
- package/es/index.js +1 -1
- package/es/index.js.map +1 -1
- package/es/layout/chart-helper/get-chart-spec.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/index.d.ts +1 -1
- package/es/render/layout/index.js +1 -1
- package/es/render/layout/index.js.map +1 -1
- package/es/render/layout/tag.d.ts +2 -2
- package/es/render/layout/tag.js +1 -1
- package/es/render/layout/tag.js.map +1 -1
- package/es/render/layout/text.js.map +1 -1
- package/es/scenegraph/component/cell-content.d.ts +4 -4
- package/es/scenegraph/component/cell-content.js +2 -2
- package/es/scenegraph/component/cell-content.js.map +1 -1
- package/es/scenegraph/component/menu.js +6 -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/graphic/chart.d.ts +2 -0
- package/es/scenegraph/graphic/chart.js +4 -4
- package/es/scenegraph/graphic/chart.js.map +1 -1
- package/es/scenegraph/graphic/contributions/chart-render-helper.d.ts +2 -0
- package/es/scenegraph/graphic/contributions/chart-render-helper.js +9 -9
- package/es/scenegraph/graphic/contributions/chart-render-helper.js.map +1 -1
- package/es/scenegraph/graphic/contributions/chart-render.js +2 -2
- package/es/scenegraph/graphic/contributions/chart-render.js.map +1 -1
- 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/icon.d.ts +8 -2
- package/es/scenegraph/graphic/icon.js +11 -1
- package/es/scenegraph/graphic/icon.js.map +1 -1
- package/es/scenegraph/group-creater/cell-helper.js +4 -0
- package/es/scenegraph/group-creater/cell-helper.js.map +1 -1
- package/es/scenegraph/group-creater/cell-type/button-cell.d.ts +6 -0
- package/es/scenegraph/group-creater/cell-type/button-cell.js +135 -0
- package/es/scenegraph/group-creater/cell-type/button-cell.js.map +1 -0
- package/es/scenegraph/group-creater/cell-type/chart-cell.js +4 -2
- package/es/scenegraph/group-creater/cell-type/chart-cell.js.map +1 -1
- package/es/scenegraph/group-creater/cell-type/checkbox-cell.js +1 -1
- package/es/scenegraph/group-creater/cell-type/checkbox-cell.js.map +1 -1
- package/es/scenegraph/group-creater/cell-type/index.d.ts +2 -0
- package/es/scenegraph/group-creater/cell-type/index.js +12 -0
- package/es/scenegraph/group-creater/cell-type/index.js.map +1 -1
- package/es/scenegraph/group-creater/cell-type/radio-cell.js +1 -1
- package/es/scenegraph/group-creater/cell-type/radio-cell.js.map +1 -1
- package/es/scenegraph/group-creater/cell-type/switch-cell.d.ts +6 -0
- package/es/scenegraph/group-creater/cell-type/switch-cell.js +150 -0
- package/es/scenegraph/group-creater/cell-type/switch-cell.js.map +1 -0
- package/es/scenegraph/layout/compute-col-width.js +24 -6
- package/es/scenegraph/layout/compute-col-width.js.map +1 -1
- package/es/scenegraph/layout/compute-row-height.js +2 -2
- package/es/scenegraph/layout/compute-row-height.js.map +1 -1
- package/es/scenegraph/layout/height-util.d.ts +2 -0
- package/es/scenegraph/layout/height-util.js +35 -2
- package/es/scenegraph/layout/height-util.js.map +1 -1
- package/es/scenegraph/scenegraph.d.ts +1 -1
- package/es/scenegraph/scenegraph.js +7 -6
- package/es/scenegraph/scenegraph.js.map +1 -1
- package/es/scenegraph/utils/cell-border-stroke-width.d.ts +1 -1
- package/es/scenegraph/utils/cell-border-stroke-width.js.map +1 -1
- package/es/scenegraph/utils/text-icon-layout.d.ts +2 -2
- package/es/scenegraph/utils/text-icon-layout.js +9 -8
- package/es/scenegraph/utils/text-icon-layout.js.map +1 -1
- package/es/scenegraph/utils/text-measure.js.map +1 -1
- package/es/state/radio/radio.js +1 -1
- package/es/state/radio/radio.js.map +1 -1
- package/es/state/select/custom-select.js +1 -1
- package/es/state/select/custom-select.js.map +1 -1
- package/es/state/state.js +6 -2
- package/es/state/state.js.map +1 -1
- package/es/themes/theme.d.ts +4 -0
- package/es/themes/theme.js +17 -2
- package/es/themes/theme.js.map +1 -1
- package/es/tools/icons.d.ts +2 -2
- package/es/tools/icons.js +1 -1
- package/es/tools/icons.js.map +1 -1
- package/es/ts-types/base-table.d.ts +23 -4
- package/es/ts-types/base-table.js.map +1 -1
- package/es/ts-types/column/style.d.ts +32 -0
- package/es/ts-types/column/style.js.map +1 -1
- package/es/ts-types/column/type.d.ts +1 -1
- package/es/ts-types/column/type.js.map +1 -1
- package/es/ts-types/component/legend.d.ts +1 -1
- package/es/ts-types/component/legend.js.map +1 -1
- package/es/ts-types/events.d.ts +10 -0
- package/es/ts-types/events.js.map +1 -1
- package/es/ts-types/icon.d.ts +6 -6
- package/es/ts-types/icon.js.map +1 -1
- package/es/ts-types/list-table/define/button-define.d.ts +9 -0
- package/es/ts-types/list-table/define/button-define.js +2 -0
- package/es/ts-types/list-table/define/button-define.js.map +1 -0
- package/es/ts-types/list-table/define/composite-define.js +2 -0
- package/{cjs/ts-types/list-table/define/Composite-define.js.map → es/ts-types/list-table/define/composite-define.js.map} +1 -1
- package/es/ts-types/list-table/define/index.d.ts +7 -3
- package/es/ts-types/list-table/define/index.js.map +1 -1
- package/es/ts-types/list-table/define/switch-define.d.ts +11 -0
- package/es/ts-types/list-table/define/switch-define.js +2 -0
- package/es/ts-types/list-table/define/switch-define.js.map +1 -0
- package/es/ts-types/list-table/layout-map/api.d.ts +5 -1
- package/es/ts-types/list-table/layout-map/api.js.map +1 -1
- package/es/ts-types/pivot-table/dimension/basic-dimension.d.ts +5 -1
- package/es/ts-types/pivot-table/dimension/basic-dimension.js.map +1 -1
- package/es/ts-types/pivot-table/indicator/basic-indicator.d.ts +5 -1
- package/es/ts-types/pivot-table/indicator/basic-indicator.js.map +1 -1
- package/es/ts-types/table-engine.d.ts +8 -0
- package/es/ts-types/table-engine.js.map +1 -1
- package/es/ts-types/theme.d.ts +4 -2
- package/es/ts-types/theme.js.map +1 -1
- package/es/vrender.js.map +1 -1
- package/package.json +6 -6
- package/es/ts-types/list-table/define/Composite-define.js +0 -2
- /package/cjs/ts-types/list-table/define/{Composite-define.d.ts → composite-define.d.ts} +0 -0
- /package/es/ts-types/list-table/define/{Composite-define.d.ts → composite-define.d.ts} +0 -0
|
@@ -4,9 +4,9 @@ import { validToString } from "../../tools/util";
|
|
|
4
4
|
|
|
5
5
|
import { getProp } from "../utils/get-prop";
|
|
6
6
|
|
|
7
|
-
import { CheckBox, Radio } from "
|
|
7
|
+
import { CheckBox, Radio, Tag } from "./../../vrender";
|
|
8
8
|
|
|
9
|
-
const utilCheckBoxMark = new CheckBox({}), utilRadioMark = new Radio({});
|
|
9
|
+
const utilCheckBoxMark = new CheckBox({}), utilRadioMark = new Radio({}), utilButtonMark = new Tag({});
|
|
10
10
|
|
|
11
11
|
export function computeCheckboxCellHeight(cellValue, col, row, endCol, actStyle, autoWrapText, iconWidth, fontSize, fontStyle, fontWeight, fontFamily, lineHeight, lineClamp, padding, table) {
|
|
12
12
|
const text = isObject(cellValue) ? cellValue.text : cellValue, lines = validToString(text).split("\n") || [], cellWidth = table.getColsWidth(col, endCol), size = getProp("size", actStyle, col, row, table);
|
|
@@ -82,4 +82,37 @@ export function computeSingleRadioCellHeight(cellValue, col, row, endCol, actSty
|
|
|
82
82
|
} else maxHeight = Math.max(size, lines.length * lineHeight);
|
|
83
83
|
return maxHeight;
|
|
84
84
|
}
|
|
85
|
+
|
|
86
|
+
export function computeSwitchCellHeight(cellValue, col, row, endCol, actStyle, autoWrapText, iconWidth, fontSize, fontStyle, fontWeight, fontFamily, lineHeight, lineClamp, padding, table) {
|
|
87
|
+
return getProp("boxWidth", actStyle, col, row, table);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
export function computeButtonCellHeight(cellValue, col, row, endCol, actStyle, autoWrapText, iconWidth, fontSize, fontStyle, fontWeight, fontFamily, lineHeight, lineClamp, padding, table) {
|
|
91
|
+
const text = isObject(cellValue) ? cellValue.text : cellValue, lines = validToString(text).split("\n") || [], cellWidth = table.getColsWidth(col, endCol), buttonPadding = getProp("buttonPadding", actStyle, col, row, table), buttonLineWidth = getProp("buttonLineWidth", actStyle, col, row, table);
|
|
92
|
+
let maxHeight = 0;
|
|
93
|
+
if (autoWrapText) {
|
|
94
|
+
const maxLineWidth = cellWidth - (padding[1] + padding[3]);
|
|
95
|
+
utilButtonMark.setAttributes({
|
|
96
|
+
text: lines,
|
|
97
|
+
textStyle: {
|
|
98
|
+
maxLineWidth: maxLineWidth,
|
|
99
|
+
fontSize: fontSize,
|
|
100
|
+
fontStyle: fontStyle,
|
|
101
|
+
fontWeight: fontWeight,
|
|
102
|
+
fontFamily: fontFamily,
|
|
103
|
+
lineHeight: lineHeight,
|
|
104
|
+
wordBreak: "break-word",
|
|
105
|
+
lineClamp: lineClamp
|
|
106
|
+
},
|
|
107
|
+
padding: buttonPadding,
|
|
108
|
+
panel: {
|
|
109
|
+
visible: !0,
|
|
110
|
+
fill: "red",
|
|
111
|
+
stroke: "red",
|
|
112
|
+
lineWidth: buttonLineWidth
|
|
113
|
+
}
|
|
114
|
+
}), utilRadioMark.render(), maxHeight = utilRadioMark.AABBBounds.height();
|
|
115
|
+
} else maxHeight = lines.length * lineHeight + 2 * buttonPadding;
|
|
116
|
+
return maxHeight;
|
|
117
|
+
}
|
|
85
118
|
//# sourceMappingURL=height-util.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/scenegraph/layout/height-util.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC/D,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,8BAA8B,CAAC;AAI/D,MAAM,gBAAgB,GAAG,IAAI,QAAQ,CAAC,EAAE,CAAC,CAAC;AAC1C,MAAM,aAAa,GAAG,IAAI,KAAK,CAAC,EAAE,CAAC,CAAC;AAEpC,MAAM,UAAU,yBAAyB,CACvC,SAAc,EACd,GAAW,EACX,GAAW,EACX,MAAc,EACd,QAAyB,EACzB,YAAqB,EACrB,SAAiB,EACjB,QAAgB,EAChB,SAAiB,EACjB,UAAkB,EAClB,UAAkB,EAClB,UAAkB,EAClB,SAA6B,EAC7B,OAAyC,EACzC,KAAmB;IAEnB,MAAM,IAAI,GAAG,QAAQ,CAAC,SAAS,CAAC,CAAC,CAAC,CAAE,SAAiB,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC;IACvE,MAAM,KAAK,GAAG,aAAa,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC;IACpD,MAAM,SAAS,GAAG,KAAK,CAAC,YAAY,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC;IAClD,MAAM,IAAI,GAAG,OAAO,CAAC,MAAM,EAAE,QAAQ,EAAE,GAAG,EAAE,GAAG,EAAE,KAAK,CAAC,CAAC;IACxD,IAAI,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AE,KAAK,CAAC,CAAC;QAC9F,MAAM,YAAY,GAAG,SAAS,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC,GAAG,SAAS,GAAG,UAAU,GAAG,uBAAuB,CAAC;QAC9G,IAAI,CAAC,QAAQ,CAAC,WAAW,CAAC,EAAE;YAC1B,WAAW,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,GAAG,CAAC,CAAC,CAAC;SACpC;QACD,aAAa,CAAC,aAAa,CAAC;YAC1B,IAAI,EAAE;gBACJ,YAAY;gBACZ,IAAI,EAAE,KAAK;gBACX,QAAQ;gBACR,SAAS;gBACT,UAAU;gBACV,UAAU;gBACV,UAAU;gBACV,SAAS,EAAE,YAAY;gBACvB,SAAS;aACV;YACD,MAAM,EAAE;gBACN,WAAW;aACZ;YACD,uBAAuB;SACxB,CAAC,CAAC;QACH,aAAa,CAAC,MAAM,EAAE,CAAC;QACvB,SAAS,GAAG,aAAa,CAAC,UAAU,CAAC,MAAM,EAAE,CAAC;KAC/C;SAAM;QACL,SAAS,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,KAAK,CAAC,MAAM,GAAG,UAAU,CAAC,CAAC;KACvD;IAED,OAAO,SAAS,CAAC;AACnB,CAAC","file":"height-util.js","sourcesContent":["import { isArray, isNumber, isObject } from '@visactor/vutils';\nimport { validToString } from '../../tools/util';\nimport { getProp } from '../utils/get-prop';\nimport { CheckBox, Radio } from '@visactor/vrender-components';\nimport type { FullExtendStyle, RadioColumnDefine } from '../../ts-types';\nimport type { BaseTableAPI } from '../../ts-types/base-table';\n\nconst utilCheckBoxMark = new CheckBox({});\nconst utilRadioMark = new Radio({});\n\nexport function computeCheckboxCellHeight(\n cellValue: any,\n col: number,\n row: number,\n endCol: number,\n actStyle: FullExtendStyle,\n autoWrapText: boolean,\n iconWidth: number,\n fontSize: number,\n fontStyle: string,\n fontWeight: string,\n fontFamily: string,\n lineHeight: number,\n lineClamp: number | undefined,\n padding: [number, number, number, number],\n table: BaseTableAPI\n) {\n const text = isObject(cellValue) ? (cellValue as any).text : cellValue;\n const lines = validToString(text).split('\\n') || [];\n const cellWidth = table.getColsWidth(col, endCol);\n const size = getProp('size', actStyle, col, row, table);\n let maxHeight = 0;\n if (autoWrapText) {\n const spaceBetweenTextAndIcon = getProp('spaceBetweenTextAndIcon', actStyle, col, row, table);\n const maxLineWidth = cellWidth - (padding[1] + padding[3]) - iconWidth - size - spaceBetweenTextAndIcon;\n utilCheckBoxMark.setAttributes({\n text: {\n maxLineWidth,\n text: lines,\n fontSize,\n fontStyle,\n fontWeight,\n fontFamily,\n lineHeight,\n wordBreak: 'break-word',\n lineClamp\n },\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 });\n utilCheckBoxMark.render();\n maxHeight = utilCheckBoxMark.AABBBounds.height();\n } else {\n maxHeight = Math.max(size, lines.length * lineHeight);\n }\n\n return maxHeight;\n}\n\nexport function computeRadioCellHeight(\n cellValue: any,\n col: number,\n row: number,\n endCol: number,\n actStyle: FullExtendStyle,\n autoWrapText: boolean,\n iconWidth: number,\n fontSize: number,\n fontStyle: string,\n fontWeight: string,\n fontFamily: string,\n lineHeight: number,\n lineClamp: number | undefined,\n padding: [number, number, number, number],\n table: BaseTableAPI\n) {\n if (isArray(cellValue)) {\n // multi radio\n let maxHeight = 0;\n const define = table.getBodyColumnDefine(col, row);\n const spaceBetweenRadio = getProp('spaceBetweenRadio', actStyle, col, row, table);\n const radioDirectionInCell = (define as RadioColumnDefine)?.radioDirectionInCell ?? 'vertical';\n if (radioDirectionInCell === 'vertical') {\n // sum all radio height\n cellValue.forEach((singleValue, index) => {\n const height = computeSingleRadioCellHeight(\n singleValue,\n col,\n row,\n endCol,\n actStyle,\n autoWrapText,\n iconWidth,\n fontSize,\n fontStyle,\n fontWeight,\n fontFamily,\n lineHeight,\n lineClamp,\n padding,\n table\n );\n maxHeight += height;\n if (index !== cellValue.length - 1) {\n maxHeight += spaceBetweenRadio;\n }\n });\n } else if (radioDirectionInCell === 'horizontal') {\n // get max radio height\n cellValue.forEach(singleValue => {\n const height = computeSingleRadioCellHeight(\n singleValue,\n col,\n row,\n endCol,\n actStyle,\n autoWrapText,\n iconWidth,\n fontSize,\n fontStyle,\n fontWeight,\n fontFamily,\n lineHeight,\n lineClamp,\n padding,\n table\n );\n maxHeight = Math.max(height, maxHeight);\n });\n }\n return maxHeight;\n }\n // single radio\n return computeSingleRadioCellHeight(\n cellValue,\n col,\n row,\n endCol,\n actStyle,\n autoWrapText,\n iconWidth,\n fontSize,\n fontStyle,\n fontWeight,\n fontFamily,\n lineHeight,\n lineClamp,\n padding,\n table\n );\n}\n\nexport function computeSingleRadioCellHeight(\n cellValue: any,\n col: number,\n row: number,\n endCol: number,\n actStyle: FullExtendStyle,\n autoWrapText: boolean,\n iconWidth: number,\n fontSize: number,\n fontStyle: string,\n fontWeight: string,\n fontFamily: string,\n lineHeight: number,\n lineClamp: number | undefined,\n padding: [number, number, number, number],\n table: BaseTableAPI\n) {\n const text = isObject(cellValue) ? (cellValue as any).text : cellValue;\n const lines = validToString(text).split('\\n') || [];\n const cellWidth = table.getColsWidth(col, endCol);\n const size = getProp('size', actStyle, col, row, table);\n let outerRadius = getProp('outerRadius', actStyle, col, row, table);\n const circleSize = isNumber(outerRadius) ? outerRadius * 2 : size;\n let maxHeight = 0;\n if (autoWrapText) {\n const spaceBetweenTextAndIcon = getProp('spaceBetweenTextAndIcon', actStyle, col, row, table);\n const maxLineWidth = cellWidth - (padding[1] + padding[3]) - iconWidth - circleSize - spaceBetweenTextAndIcon;\n if (!isNumber(outerRadius)) {\n outerRadius = Math.round(size / 2);\n }\n utilRadioMark.setAttributes({\n text: {\n maxLineWidth,\n text: lines,\n fontSize,\n fontStyle,\n fontWeight,\n fontFamily,\n lineHeight,\n wordBreak: 'break-word',\n lineClamp\n },\n circle: {\n outerRadius\n },\n spaceBetweenTextAndIcon\n });\n utilRadioMark.render();\n maxHeight = utilRadioMark.AABBBounds.height();\n } else {\n maxHeight = Math.max(size, lines.length * lineHeight);\n }\n\n return maxHeight;\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/scenegraph/layout/height-util.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC/D,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAU,GAAG,EAAE,MAAM,iBAAiB,CAAC;AAI/D,MAAM,gBAAgB,GAAG,IAAI,QAAQ,CAAC,EAAE,CAAC,CAAC;AAC1C,MAAM,aAAa,GAAG,IAAI,KAAK,CAAC,EAAE,CAAC,CAAC;AACpC,MAAM,cAAc,GAAG,IAAI,GAAG,CAAC,EAAE,CAAC,CAAC;AAEnC,MAAM,UAAU,yBAAyB,CACvC,SAAc,EACd,GAAW,EACX,GAAW,EACX,MAAc,EACd,QAAyB,EACzB,YAAqB,EACrB,SAAiB,EACjB,QAAgB,EAChB,SAAiB,EACjB,UAAkB,EAClB,UAAkB,EAClB,UAAkB,EAClB,SAA6B,EAC7B,OAAyC,EACzC,KAAmB;IAEnB,MAAM,IAAI,GAAG,QAAQ,CAAC,SAAS,CAAC,CAAC,CAAC,CAAE,SAAiB,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC;IACvE,MAAM,KAAK,GAAG,aAAa,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC;IACpD,MAAM,SAAS,GAAG,KAAK,CAAC,YAAY,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC;IAClD,MAAM,IAAI,GAAG,OAAO,CAAC,MAAM,EAAE,QAAQ,EAAE,GAAG,E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AAM,EAAE,CAAC;QACvB,SAAS,GAAG,aAAa,CAAC,UAAU,CAAC,MAAM,EAAE,CAAC;KAC/C;SAAM;QACL,SAAS,GAAG,KAAK,CAAC,MAAM,GAAG,UAAU,GAAG,aAAa,GAAG,CAAC,CAAC;KAC3D;IAED,OAAO,SAAS,CAAC;AACnB,CAAC","file":"height-util.js","sourcesContent":["import { isArray, isNumber, isObject } from '@visactor/vutils';\nimport { validToString } from '../../tools/util';\nimport { getProp } from '../utils/get-prop';\nimport { CheckBox, Radio, Switch, Tag } from './../../vrender';\nimport type { FullExtendStyle, RadioColumnDefine } from '../../ts-types';\nimport type { BaseTableAPI } from '../../ts-types/base-table';\n\nconst utilCheckBoxMark = new CheckBox({});\nconst utilRadioMark = new Radio({});\nconst utilButtonMark = new Tag({});\n\nexport function computeCheckboxCellHeight(\n cellValue: any,\n col: number,\n row: number,\n endCol: number,\n actStyle: FullExtendStyle,\n autoWrapText: boolean,\n iconWidth: number,\n fontSize: number,\n fontStyle: string,\n fontWeight: string,\n fontFamily: string,\n lineHeight: number,\n lineClamp: number | undefined,\n padding: [number, number, number, number],\n table: BaseTableAPI\n) {\n const text = isObject(cellValue) ? (cellValue as any).text : cellValue;\n const lines = validToString(text).split('\\n') || [];\n const cellWidth = table.getColsWidth(col, endCol);\n const size = getProp('size', actStyle, col, row, table);\n let maxHeight = 0;\n if (autoWrapText) {\n const spaceBetweenTextAndIcon = getProp('spaceBetweenTextAndIcon', actStyle, col, row, table);\n const maxLineWidth = cellWidth - (padding[1] + padding[3]) - iconWidth - size - spaceBetweenTextAndIcon;\n utilCheckBoxMark.setAttributes({\n text: {\n maxLineWidth,\n text: lines,\n fontSize,\n fontStyle,\n fontWeight,\n fontFamily,\n lineHeight,\n wordBreak: 'break-word',\n lineClamp\n },\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 });\n utilCheckBoxMark.render();\n maxHeight = utilCheckBoxMark.AABBBounds.height();\n } else {\n maxHeight = Math.max(size, lines.length * lineHeight);\n }\n\n return maxHeight;\n}\n\nexport function computeRadioCellHeight(\n cellValue: any,\n col: number,\n row: number,\n endCol: number,\n actStyle: FullExtendStyle,\n autoWrapText: boolean,\n iconWidth: number,\n fontSize: number,\n fontStyle: string,\n fontWeight: string,\n fontFamily: string,\n lineHeight: number,\n lineClamp: number | undefined,\n padding: [number, number, number, number],\n table: BaseTableAPI\n) {\n if (isArray(cellValue)) {\n // multi radio\n let maxHeight = 0;\n const define = table.getBodyColumnDefine(col, row);\n const spaceBetweenRadio = getProp('spaceBetweenRadio', actStyle, col, row, table);\n const radioDirectionInCell = (define as RadioColumnDefine)?.radioDirectionInCell ?? 'vertical';\n if (radioDirectionInCell === 'vertical') {\n // sum all radio height\n cellValue.forEach((singleValue, index) => {\n const height = computeSingleRadioCellHeight(\n singleValue,\n col,\n row,\n endCol,\n actStyle,\n autoWrapText,\n iconWidth,\n fontSize,\n fontStyle,\n fontWeight,\n fontFamily,\n lineHeight,\n lineClamp,\n padding,\n table\n );\n maxHeight += height;\n if (index !== cellValue.length - 1) {\n maxHeight += spaceBetweenRadio;\n }\n });\n } else if (radioDirectionInCell === 'horizontal') {\n // get max radio height\n cellValue.forEach(singleValue => {\n const height = computeSingleRadioCellHeight(\n singleValue,\n col,\n row,\n endCol,\n actStyle,\n autoWrapText,\n iconWidth,\n fontSize,\n fontStyle,\n fontWeight,\n fontFamily,\n lineHeight,\n lineClamp,\n padding,\n table\n );\n maxHeight = Math.max(height, maxHeight);\n });\n }\n return maxHeight;\n }\n // single radio\n return computeSingleRadioCellHeight(\n cellValue,\n col,\n row,\n endCol,\n actStyle,\n autoWrapText,\n iconWidth,\n fontSize,\n fontStyle,\n fontWeight,\n fontFamily,\n lineHeight,\n lineClamp,\n padding,\n table\n );\n}\n\nexport function computeSingleRadioCellHeight(\n cellValue: any,\n col: number,\n row: number,\n endCol: number,\n actStyle: FullExtendStyle,\n autoWrapText: boolean,\n iconWidth: number,\n fontSize: number,\n fontStyle: string,\n fontWeight: string,\n fontFamily: string,\n lineHeight: number,\n lineClamp: number | undefined,\n padding: [number, number, number, number],\n table: BaseTableAPI\n) {\n const text = isObject(cellValue) ? (cellValue as any).text : cellValue;\n const lines = validToString(text).split('\\n') || [];\n const cellWidth = table.getColsWidth(col, endCol);\n const size = getProp('size', actStyle, col, row, table);\n let outerRadius = getProp('outerRadius', actStyle, col, row, table);\n const circleSize = isNumber(outerRadius) ? outerRadius * 2 : size;\n let maxHeight = 0;\n if (autoWrapText) {\n const spaceBetweenTextAndIcon = getProp('spaceBetweenTextAndIcon', actStyle, col, row, table);\n const maxLineWidth = cellWidth - (padding[1] + padding[3]) - iconWidth - circleSize - spaceBetweenTextAndIcon;\n if (!isNumber(outerRadius)) {\n outerRadius = Math.round(size / 2);\n }\n utilRadioMark.setAttributes({\n text: {\n maxLineWidth,\n text: lines,\n fontSize,\n fontStyle,\n fontWeight,\n fontFamily,\n lineHeight,\n wordBreak: 'break-word',\n lineClamp\n },\n circle: {\n outerRadius\n },\n spaceBetweenTextAndIcon\n });\n utilRadioMark.render();\n maxHeight = utilRadioMark.AABBBounds.height();\n } else {\n maxHeight = Math.max(size, lines.length * lineHeight);\n }\n\n return maxHeight;\n}\n\nexport function computeSwitchCellHeight(\n cellValue: any,\n col: number,\n row: number,\n endCol: number,\n actStyle: FullExtendStyle,\n autoWrapText: boolean,\n iconWidth: number,\n fontSize: number,\n fontStyle: string,\n fontWeight: string,\n fontFamily: string,\n lineHeight: number,\n lineClamp: number | undefined,\n padding: [number, number, number, number],\n table: BaseTableAPI\n) {\n const boxWidth = getProp('boxWidth', actStyle, col, row, table);\n\n return boxWidth;\n}\n\nexport function computeButtonCellHeight(\n cellValue: any,\n col: number,\n row: number,\n endCol: number,\n actStyle: FullExtendStyle,\n autoWrapText: boolean,\n iconWidth: number,\n fontSize: number,\n fontStyle: string,\n fontWeight: string,\n fontFamily: string,\n lineHeight: number,\n lineClamp: number | undefined,\n padding: [number, number, number, number],\n table: BaseTableAPI\n) {\n const text = isObject(cellValue) ? (cellValue as any).text : cellValue;\n const lines = validToString(text).split('\\n') || [];\n const cellWidth = table.getColsWidth(col, endCol);\n const buttonPadding = getProp('buttonPadding', actStyle, col, row, table);\n const buttonLineWidth = getProp('buttonLineWidth', actStyle, col, row, table);\n let maxHeight = 0;\n if (autoWrapText) {\n const maxLineWidth = cellWidth - (padding[1] + padding[3]);\n utilButtonMark.setAttributes({\n text: lines,\n textStyle: {\n maxLineWidth,\n fontSize,\n fontStyle,\n fontWeight,\n fontFamily,\n lineHeight,\n wordBreak: 'break-word',\n lineClamp\n },\n padding: buttonPadding,\n panel: {\n visible: true,\n fill: 'red',\n stroke: 'red',\n lineWidth: buttonLineWidth\n }\n });\n utilRadioMark.render();\n maxHeight = utilRadioMark.AABBBounds.height();\n } else {\n maxHeight = lines.length * lineHeight + buttonPadding * 2;\n }\n\n return maxHeight;\n}\n"]}
|
|
@@ -99,7 +99,7 @@ export declare class Scenegraph {
|
|
|
99
99
|
residentHoverIcon(col: number, row: number): void;
|
|
100
100
|
resetResidentHoverIcon(col: number, row: number): void;
|
|
101
101
|
deactivateChart(col: number, row: number): void;
|
|
102
|
-
activateChart(col: number, row: number):
|
|
102
|
+
activateChart(col: number, row: number): any;
|
|
103
103
|
removeInteractionBorder(col: number, row: number): void;
|
|
104
104
|
createCellSelectBorder(start_Col: number, start_Row: number, end_Col: number, end_Row: number, selectRangeType: CellSubLocation, selectId: string, strokes?: boolean[]): void;
|
|
105
105
|
moveSelectingRangeComponentsToSelectedRangeComponents(): void;
|
|
@@ -54,7 +54,7 @@ import { initSceneGraph } from "./group-creater/init-scenegraph";
|
|
|
54
54
|
|
|
55
55
|
import { updateContainerChildrenX } from "./utils/update-container";
|
|
56
56
|
|
|
57
|
-
import { setPoptipTheme } from "
|
|
57
|
+
import { setPoptipTheme } from "./../vrender";
|
|
58
58
|
|
|
59
59
|
import textMeasureModule from "./utils/text-measure";
|
|
60
60
|
|
|
@@ -82,9 +82,9 @@ export class Scenegraph {
|
|
|
82
82
|
constructor(table) {
|
|
83
83
|
let width, height;
|
|
84
84
|
this._needUpdateContainer = !1, this.table = table, this.hasFrozen = !1, this.clear = !0,
|
|
85
|
-
this.mergeMap = new Map, setPoptipTheme(this.table.theme.textPopTipStyle),
|
|
86
|
-
width = table.
|
|
87
|
-
width = table.
|
|
85
|
+
this.mergeMap = new Map, setPoptipTheme(this.table.theme.textPopTipStyle), "node" === Env.mode ? (vglobal.setEnv("node", table.options.modeParams),
|
|
86
|
+
width = table.canvasWidth, height = table.canvasHeight) : table.options.canvas && table.options.viewBox ? (vglobal.setEnv("browser"),
|
|
87
|
+
width = table.options.viewBox.x2 - table.options.viewBox.x1, height = table.options.viewBox.y2 - table.options.viewBox.y1) : (vglobal.setEnv("browser"),
|
|
88
88
|
width = table.canvas.width, height = table.canvas.height), this.stage = createStage(Object.assign({
|
|
89
89
|
canvas: table.canvas,
|
|
90
90
|
width: width,
|
|
@@ -345,10 +345,11 @@ export class Scenegraph {
|
|
|
345
345
|
null === (_b = null === (_a = null == cellGroup ? void 0 : cellGroup.firstChild) || void 0 === _a ? void 0 : _a.deactivate) || void 0 === _b || _b.call(_a);
|
|
346
346
|
}
|
|
347
347
|
activateChart(col, row) {
|
|
348
|
-
var _a, _b;
|
|
348
|
+
var _a, _b, _c;
|
|
349
349
|
if (-1 === col || -1 === row) return;
|
|
350
350
|
const cellGroup = this.getCell(col, row);
|
|
351
|
-
null === (_b = null === (_a = null == cellGroup ? void 0 : cellGroup.firstChild) || void 0 === _a ? void 0 : _a.activate) || void 0 === _b || _b.call(_a, this.table)
|
|
351
|
+
return null === (_b = null === (_a = null == cellGroup ? void 0 : cellGroup.firstChild) || void 0 === _a ? void 0 : _a.activate) || void 0 === _b || _b.call(_a, this.table),
|
|
352
|
+
null === (_c = null == cellGroup ? void 0 : cellGroup.firstChild) || void 0 === _c ? void 0 : _c.activeChartInstance;
|
|
352
353
|
}
|
|
353
354
|
removeInteractionBorder(col, row) {
|
|
354
355
|
const cellGroup = this.getCell(col, row);
|