@visactor/vtable 1.6.0-alpha.4 → 1.6.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 +5 -5
- package/cjs/ListTable-all.js.map +1 -1
- package/cjs/ListTable.d.ts +3 -0
- package/cjs/ListTable.js +42 -285
- package/cjs/ListTable.js.map +1 -1
- package/cjs/PivotChart.d.ts +1 -0
- package/cjs/PivotChart.js +4 -0
- package/cjs/PivotChart.js.map +1 -1
- package/cjs/PivotTable.js +1 -1
- package/cjs/PivotTable.js.map +1 -1
- package/cjs/components/axis/axis.js +3 -2
- package/cjs/components/axis/axis.js.map +1 -1
- package/cjs/components/legend/discrete-legend/discrete-legend.js +2 -1
- package/cjs/components/legend/discrete-legend/discrete-legend.js.map +1 -1
- package/cjs/components/title/title.js +3 -1
- package/cjs/components/title/title.js.map +1 -1
- package/cjs/core/BaseTable.d.ts +8 -5
- package/cjs/core/BaseTable.js +57 -111
- package/cjs/core/BaseTable.js.map +1 -1
- package/cjs/core/FouseInput.d.ts +1 -0
- package/cjs/core/FouseInput.js +5 -2
- package/cjs/core/FouseInput.js.map +1 -1
- package/cjs/core/group-helper.d.ts +6 -0
- package/cjs/core/group-helper.js +22 -0
- package/cjs/core/group-helper.js.map +1 -0
- package/cjs/core/record-helper.d.ts +8 -0
- package/cjs/core/record-helper.js +337 -0
- package/cjs/core/record-helper.js.map +1 -0
- package/cjs/core/style-helper.d.ts +3 -0
- package/cjs/core/style-helper.js +110 -0
- package/cjs/core/style-helper.js.map +1 -0
- package/cjs/core/style.js +1 -1
- package/cjs/core/style.js.map +1 -1
- package/cjs/core/tableHelper.d.ts +3 -5
- package/cjs/core/tableHelper.js +18 -23
- package/cjs/core/tableHelper.js.map +1 -1
- package/cjs/core/utils/get-cell-position.d.ts +5 -25
- package/cjs/core/utils/get-cell-position.js.map +1 -1
- package/cjs/data/CachedDataSource.d.ts +10 -1
- package/cjs/data/CachedDataSource.js +102 -3
- package/cjs/data/CachedDataSource.js.map +1 -1
- package/cjs/dataset/dataset-pivot-table.js +0 -1
- package/cjs/dataset/dataset-pivot-table.js.map +1 -1
- package/cjs/dataset/dataset.js +0 -1
- package/cjs/edit/edit-manager.js +2 -1
- package/cjs/event/event.js +5 -2
- package/cjs/event/event.js.map +1 -1
- package/cjs/event/listener/container-dom.js +2 -2
- package/cjs/event/listener/container-dom.js.map +1 -1
- package/cjs/event/listener/table-group.js +4 -6
- package/cjs/event/listener/table-group.js.map +1 -1
- package/cjs/event/util.js +2 -2
- package/cjs/event/util.js.map +1 -1
- package/cjs/index.d.ts +5 -3
- package/cjs/index.js +25 -2
- package/cjs/index.js.map +1 -1
- package/cjs/layout/cell-range/simple-cell-range.d.ts +4 -0
- package/cjs/layout/cell-range/simple-cell-range.js +106 -0
- package/cjs/layout/cell-range/simple-cell-range.js.map +1 -0
- package/cjs/layout/layout-helper.js +2 -2
- package/cjs/layout/layout-helper.js.map +1 -1
- package/cjs/layout/pivot-header-layout.js +20 -19
- package/cjs/layout/pivot-header-layout.js.map +1 -1
- package/cjs/layout/row-height-map.js +1 -0
- package/cjs/layout/simple-header-layout.d.ts +1 -2
- package/cjs/layout/simple-header-layout.js +6 -90
- package/cjs/layout/simple-header-layout.js.map +1 -1
- package/cjs/plugins/icons.js +1 -1
- package/cjs/plugins/list-tree-stick-cell.d.ts +16 -0
- package/cjs/plugins/list-tree-stick-cell.js +178 -0
- package/cjs/plugins/list-tree-stick-cell.js.map +1 -0
- package/cjs/plugins/themes.js +1 -1
- package/cjs/scenegraph/component/custom.js +1 -1
- package/cjs/scenegraph/component/custom.js.map +1 -1
- package/cjs/scenegraph/component/table-component.js +14 -18
- package/cjs/scenegraph/component/table-component.js.map +1 -1
- package/cjs/scenegraph/debug-tool/debug-tool.js +4 -1
- package/cjs/scenegraph/debug-tool/debug-tool.js.map +1 -1
- package/cjs/scenegraph/graphic/chart.d.ts +1 -0
- package/cjs/scenegraph/graphic/chart.js +34 -20
- package/cjs/scenegraph/graphic/chart.js.map +1 -1
- package/cjs/scenegraph/graphic/contributions/chart-render-helper.js +56 -16
- package/cjs/scenegraph/graphic/contributions/chart-render-helper.js.map +1 -1
- package/cjs/scenegraph/graphic/contributions/chart-render.d.ts +2 -1
- package/cjs/scenegraph/graphic/contributions/chart-render.js +40 -24
- package/cjs/scenegraph/graphic/contributions/chart-render.js.map +1 -1
- package/cjs/scenegraph/graphic/contributions/group-contribution-render.js +6 -3
- package/cjs/scenegraph/graphic/contributions/group-contribution-render.js.map +1 -1
- package/cjs/scenegraph/graphic/contributions/rect-contribution-render.d.ts +1 -0
- package/cjs/scenegraph/graphic/contributions/rect-contribution-render.js +48 -7
- package/cjs/scenegraph/graphic/contributions/rect-contribution-render.js.map +1 -1
- package/cjs/scenegraph/graphic/group.js +1 -1
- package/cjs/scenegraph/graphic/group.js.map +1 -1
- package/cjs/scenegraph/group-creater/cell-helper.d.ts +2 -1
- package/cjs/scenegraph/group-creater/cell-helper.js +29 -10
- package/cjs/scenegraph/group-creater/cell-helper.js.map +1 -1
- package/cjs/scenegraph/group-creater/cell-type/chart-cell.js +2 -1
- package/cjs/scenegraph/group-creater/cell-type/chart-cell.js.map +1 -1
- package/cjs/scenegraph/group-creater/cell-type/progress-bar-cell.js +9 -1
- package/cjs/scenegraph/group-creater/cell-type/progress-bar-cell.js.map +1 -1
- package/cjs/scenegraph/group-creater/column-helper.js +9 -2
- package/cjs/scenegraph/group-creater/column-helper.js.map +1 -1
- package/cjs/scenegraph/group-creater/init-scenegraph.js +2 -2
- package/cjs/scenegraph/group-creater/init-scenegraph.js.map +1 -1
- package/cjs/scenegraph/layout/compute-col-width.js +2 -2
- package/cjs/scenegraph/layout/compute-col-width.js.map +1 -1
- package/cjs/scenegraph/layout/compute-row-height.js +2 -2
- package/cjs/scenegraph/layout/compute-row-height.js.map +1 -1
- package/cjs/scenegraph/layout/update-height.js +3 -1
- package/cjs/scenegraph/layout/update-height.js.map +1 -1
- package/cjs/scenegraph/layout/update-width.js +5 -3
- package/cjs/scenegraph/layout/update-width.js.map +1 -1
- package/cjs/scenegraph/refresh-node/update-chart.d.ts +1 -0
- package/cjs/scenegraph/refresh-node/update-chart.js +84 -32
- package/cjs/scenegraph/refresh-node/update-chart.js.map +1 -1
- package/cjs/scenegraph/scenegraph.d.ts +1 -1
- package/cjs/scenegraph/scenegraph.js +67 -46
- package/cjs/scenegraph/scenegraph.js.map +1 -1
- package/cjs/scenegraph/stick-text/index.js +5 -6
- package/cjs/scenegraph/stick-text/index.js.map +1 -1
- package/cjs/scenegraph/style/frame-border.d.ts +1 -1
- package/cjs/scenegraph/style/frame-border.js +27 -12
- package/cjs/scenegraph/style/frame-border.js.map +1 -1
- package/cjs/scenegraph/utils/cell-border-stroke-width.js +14 -9
- package/cjs/scenegraph/utils/cell-border-stroke-width.js.map +1 -1
- package/cjs/scenegraph/utils/get-cell-merge.js +1 -1
- package/cjs/scenegraph/utils/get-cell-merge.js.map +1 -1
- package/cjs/scenegraph/utils/get-hierarchy-offset.js +6 -8
- package/cjs/scenegraph/utils/get-hierarchy-offset.js.map +1 -1
- package/cjs/scenegraph/utils/text-icon-layout.js +6 -4
- package/cjs/scenegraph/utils/text-icon-layout.js.map +1 -1
- package/cjs/state/resize/update-resize-row.js +1 -1
- package/cjs/state/resize/update-resize-row.js.map +1 -1
- package/cjs/state/state.d.ts +2 -2
- package/cjs/state/state.js +5 -5
- package/cjs/state/state.js.map +1 -1
- package/cjs/themes/theme.d.ts +2 -0
- package/cjs/themes/theme.js +13 -10
- package/cjs/themes/theme.js.map +1 -1
- package/cjs/tools/helper.d.ts +1 -1
- package/cjs/tools/helper.js +3 -3
- package/cjs/tools/helper.js.map +1 -1
- package/cjs/tools/style.d.ts +1 -2
- package/cjs/tools/style.js +3 -9
- package/cjs/tools/style.js.map +1 -1
- package/cjs/ts-types/base-table.d.ts +21 -3
- package/cjs/ts-types/base-table.js.map +1 -1
- package/cjs/ts-types/column/style.d.ts +2 -2
- package/cjs/ts-types/column/style.js.map +1 -1
- package/cjs/ts-types/component/index.d.ts +1 -0
- package/cjs/ts-types/component/index.js +21 -0
- package/cjs/ts-types/component/index.js.map +1 -0
- package/cjs/ts-types/index.d.ts +1 -0
- package/cjs/ts-types/index.js +1 -1
- package/cjs/ts-types/index.js.map +1 -1
- package/cjs/ts-types/list-table/layout-map/api.d.ts +1 -0
- package/cjs/ts-types/list-table/layout-map/api.js.map +1 -1
- package/cjs/ts-types/new-data-set.d.ts +1 -0
- package/cjs/ts-types/new-data-set.js.map +1 -1
- package/cjs/ts-types/pivot-table/corner.d.ts +1 -0
- package/cjs/ts-types/pivot-table/corner.js.map +1 -1
- package/cjs/ts-types/table-engine.d.ts +11 -46
- package/cjs/ts-types/table-engine.js.map +1 -1
- package/cjs/ts-types/theme.d.ts +2 -3
- package/cjs/ts-types/theme.js.map +1 -1
- package/cjs/vrender.js +2 -1
- package/cjs/vrender.js.map +1 -1
- package/dist/vtable.js +36370 -32652
- package/dist/vtable.min.js +2 -2
- package/es/ListTable-all.js +5 -3
- package/es/ListTable-all.js.map +1 -1
- package/es/ListTable.d.ts +3 -0
- package/es/ListTable.js +45 -287
- package/es/ListTable.js.map +1 -1
- package/es/PivotChart.d.ts +1 -0
- package/es/PivotChart.js +5 -2
- package/es/PivotChart.js.map +1 -1
- package/es/PivotTable.js +1 -1
- package/es/PivotTable.js.map +1 -1
- package/es/components/axis/axis.js +3 -1
- package/es/components/axis/axis.js.map +1 -1
- package/es/components/legend/discrete-legend/discrete-legend.js +2 -1
- package/es/components/legend/discrete-legend/discrete-legend.js.map +1 -1
- package/es/components/title/title.js +3 -1
- package/es/components/title/title.js.map +1 -1
- package/es/core/BaseTable.d.ts +8 -5
- package/es/core/BaseTable.js +61 -115
- package/es/core/BaseTable.js.map +1 -1
- package/es/core/FouseInput.d.ts +1 -0
- package/es/core/FouseInput.js +5 -2
- package/es/core/FouseInput.js.map +1 -1
- package/es/core/group-helper.d.ts +6 -0
- package/es/core/group-helper.js +14 -0
- package/es/core/group-helper.js.map +1 -0
- package/es/core/record-helper.d.ts +8 -0
- package/es/core/record-helper.js +332 -0
- package/es/core/record-helper.js.map +1 -0
- package/es/core/style-helper.d.ts +3 -0
- package/es/core/style-helper.js +86 -0
- package/es/core/style-helper.js.map +1 -0
- package/es/core/style.js +1 -1
- package/es/core/style.js.map +1 -1
- package/es/core/tableHelper.d.ts +3 -5
- package/es/core/tableHelper.js +15 -22
- package/es/core/tableHelper.js.map +1 -1
- package/es/core/utils/get-cell-position.d.ts +5 -25
- package/es/core/utils/get-cell-position.js.map +1 -1
- package/es/data/CachedDataSource.d.ts +10 -1
- package/es/data/CachedDataSource.js +103 -0
- package/es/data/CachedDataSource.js.map +1 -1
- package/es/dataset/dataset-pivot-table.js +0 -1
- package/es/dataset/dataset-pivot-table.js.map +1 -1
- package/es/dataset/dataset.js +1 -2
- package/es/edit/edit-manager.js +2 -1
- package/es/event/event.js +5 -2
- package/es/event/event.js.map +1 -1
- package/es/event/listener/container-dom.js +2 -2
- package/es/event/listener/container-dom.js.map +1 -1
- package/es/event/listener/table-group.js +4 -6
- package/es/event/listener/table-group.js.map +1 -1
- package/es/event/util.js +2 -2
- package/es/event/util.js.map +1 -1
- package/es/index.d.ts +5 -3
- package/es/index.js +5 -1
- package/es/index.js.map +1 -1
- package/es/layout/cell-range/simple-cell-range.d.ts +4 -0
- package/es/layout/cell-range/simple-cell-range.js +99 -0
- package/es/layout/cell-range/simple-cell-range.js.map +1 -0
- package/es/layout/layout-helper.js +2 -2
- package/es/layout/layout-helper.js.map +1 -1
- package/es/layout/pivot-header-layout.js +20 -19
- package/es/layout/pivot-header-layout.js.map +1 -1
- package/es/layout/row-height-map.js +2 -1
- package/es/layout/simple-header-layout.d.ts +1 -2
- package/es/layout/simple-header-layout.js +7 -89
- package/es/layout/simple-header-layout.js.map +1 -1
- package/es/plugins/icons.js +1 -1
- package/es/plugins/list-tree-stick-cell.d.ts +16 -0
- package/es/plugins/list-tree-stick-cell.js +176 -0
- package/es/plugins/list-tree-stick-cell.js.map +1 -0
- package/es/plugins/themes.js +1 -1
- package/es/scenegraph/component/custom.js +1 -1
- package/es/scenegraph/component/custom.js.map +1 -1
- package/es/scenegraph/component/table-component.js +14 -18
- package/es/scenegraph/component/table-component.js.map +1 -1
- package/es/scenegraph/debug-tool/debug-tool.js +4 -1
- package/es/scenegraph/debug-tool/debug-tool.js.map +1 -1
- package/es/scenegraph/graphic/chart.d.ts +1 -0
- package/es/scenegraph/graphic/chart.js +33 -21
- package/es/scenegraph/graphic/chart.js.map +1 -1
- package/es/scenegraph/graphic/contributions/chart-render-helper.js +57 -15
- package/es/scenegraph/graphic/contributions/chart-render-helper.js.map +1 -1
- package/es/scenegraph/graphic/contributions/chart-render.d.ts +2 -1
- package/es/scenegraph/graphic/contributions/chart-render.js +41 -25
- package/es/scenegraph/graphic/contributions/chart-render.js.map +1 -1
- package/es/scenegraph/graphic/contributions/group-contribution-render.js +8 -3
- package/es/scenegraph/graphic/contributions/group-contribution-render.js.map +1 -1
- package/es/scenegraph/graphic/contributions/rect-contribution-render.d.ts +1 -0
- package/es/scenegraph/graphic/contributions/rect-contribution-render.js +49 -5
- package/es/scenegraph/graphic/contributions/rect-contribution-render.js.map +1 -1
- package/es/scenegraph/graphic/group.js +1 -1
- package/es/scenegraph/graphic/group.js.map +1 -1
- package/es/scenegraph/group-creater/cell-helper.d.ts +2 -1
- package/es/scenegraph/group-creater/cell-helper.js +23 -8
- package/es/scenegraph/group-creater/cell-helper.js.map +1 -1
- package/es/scenegraph/group-creater/cell-type/chart-cell.js +2 -1
- package/es/scenegraph/group-creater/cell-type/chart-cell.js.map +1 -1
- package/es/scenegraph/group-creater/cell-type/progress-bar-cell.js +9 -1
- package/es/scenegraph/group-creater/cell-type/progress-bar-cell.js.map +1 -1
- package/es/scenegraph/group-creater/column-helper.js +8 -2
- package/es/scenegraph/group-creater/column-helper.js.map +1 -1
- package/es/scenegraph/group-creater/init-scenegraph.js +2 -2
- package/es/scenegraph/group-creater/init-scenegraph.js.map +1 -1
- package/es/scenegraph/layout/compute-col-width.js +1 -3
- 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/update-height.js +3 -1
- package/es/scenegraph/layout/update-height.js.map +1 -1
- package/es/scenegraph/layout/update-width.js +5 -3
- package/es/scenegraph/layout/update-width.js.map +1 -1
- package/es/scenegraph/refresh-node/update-chart.d.ts +1 -0
- package/es/scenegraph/refresh-node/update-chart.js +81 -29
- package/es/scenegraph/refresh-node/update-chart.js.map +1 -1
- package/es/scenegraph/scenegraph.d.ts +1 -1
- package/es/scenegraph/scenegraph.js +67 -46
- package/es/scenegraph/scenegraph.js.map +1 -1
- package/es/scenegraph/stick-text/index.js +5 -6
- package/es/scenegraph/stick-text/index.js.map +1 -1
- package/es/scenegraph/style/frame-border.d.ts +1 -1
- package/es/scenegraph/style/frame-border.js +27 -10
- package/es/scenegraph/style/frame-border.js.map +1 -1
- package/es/scenegraph/utils/cell-border-stroke-width.js +9 -6
- package/es/scenegraph/utils/cell-border-stroke-width.js.map +1 -1
- package/es/scenegraph/utils/get-cell-merge.js +1 -1
- package/es/scenegraph/utils/get-cell-merge.js.map +1 -1
- package/es/scenegraph/utils/get-hierarchy-offset.js +7 -9
- package/es/scenegraph/utils/get-hierarchy-offset.js.map +1 -1
- package/es/scenegraph/utils/text-icon-layout.js +6 -4
- package/es/scenegraph/utils/text-icon-layout.js.map +1 -1
- package/es/state/resize/update-resize-row.js +1 -1
- package/es/state/resize/update-resize-row.js.map +1 -1
- package/es/state/state.d.ts +2 -2
- package/es/state/state.js +5 -5
- package/es/state/state.js.map +1 -1
- package/es/themes/theme.d.ts +2 -0
- package/es/themes/theme.js +13 -10
- package/es/themes/theme.js.map +1 -1
- package/es/tools/helper.d.ts +1 -1
- package/es/tools/helper.js +1 -1
- package/es/tools/helper.js.map +1 -1
- package/es/tools/style.d.ts +1 -2
- package/es/tools/style.js +2 -7
- package/es/tools/style.js.map +1 -1
- package/es/ts-types/base-table.d.ts +21 -3
- package/es/ts-types/base-table.js.map +1 -1
- package/es/ts-types/column/style.d.ts +2 -2
- package/es/ts-types/column/style.js.map +1 -1
- package/es/ts-types/component/index.d.ts +1 -0
- package/es/ts-types/component/index.js +2 -0
- package/es/ts-types/component/index.js.map +1 -0
- package/es/ts-types/index.d.ts +1 -0
- package/es/ts-types/index.js +2 -0
- package/es/ts-types/index.js.map +1 -1
- package/es/ts-types/list-table/layout-map/api.d.ts +1 -0
- package/es/ts-types/list-table/layout-map/api.js.map +1 -1
- package/es/ts-types/new-data-set.d.ts +1 -0
- package/es/ts-types/new-data-set.js.map +1 -1
- package/es/ts-types/pivot-table/corner.d.ts +1 -0
- package/es/ts-types/pivot-table/corner.js.map +1 -1
- package/es/ts-types/table-engine.d.ts +11 -46
- package/es/ts-types/table-engine.js.map +1 -1
- package/es/ts-types/theme.d.ts +2 -3
- package/es/ts-types/theme.js.map +1 -1
- package/es/vrender.js +3 -2
- package/es/vrender.js.map +1 -1
- package/package.json +8 -8
- package/cjs/scenegraph/component/menu.d.ts +0 -41
- package/cjs/scenegraph/utils/text-measure.d.ts +0 -33
- package/es/scenegraph/component/menu.d.ts +0 -41
- package/es/scenegraph/utils/text-measure.d.ts +0 -33
package/es/core/BaseTable.js
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import * as columnStyleContents from "../body-helper/style";
|
|
2
2
|
|
|
3
|
-
import * as headerStyleContents from "../header-helper/style";
|
|
4
|
-
|
|
5
3
|
import { importStyle } from "./style";
|
|
6
4
|
|
|
7
5
|
import * as style from "../tools/style";
|
|
@@ -36,7 +34,7 @@ import { BodyHelper } from "../body-helper/body-helper";
|
|
|
36
34
|
|
|
37
35
|
import { HeaderHelper } from "../header-helper/header-helper";
|
|
38
36
|
|
|
39
|
-
import { AABBBounds, isNumber, isBoolean,
|
|
37
|
+
import { AABBBounds, isNumber, isBoolean, isValid, cloneDeep } from "@visactor/vutils";
|
|
40
38
|
|
|
41
39
|
import { measureTextBounds, textMeasure } from "../scenegraph/utils/text-measure";
|
|
42
40
|
|
|
@@ -52,13 +50,11 @@ import { defaultPixelRatio } from "../tools/pixel-ratio";
|
|
|
52
50
|
|
|
53
51
|
import { setBatchRenderChartCount } from "../scenegraph/graphic/contributions/chart-render-helper";
|
|
54
52
|
|
|
55
|
-
import { isLeftOrRightAxis, isTopOrBottomAxis } from "../layout/chart-helper/get-axis-config";
|
|
56
|
-
|
|
57
53
|
import { NumberRangeMap } from "../layout/row-height-map";
|
|
58
54
|
|
|
59
55
|
import { RowSeriesNumberHelper } from "./row-series-number-helper";
|
|
60
56
|
|
|
61
|
-
import { CustomCellStylePlugin
|
|
57
|
+
import { CustomCellStylePlugin } from "../plugins/custom-cell-style";
|
|
62
58
|
|
|
63
59
|
import { hideCellSelectBorder, restoreCellSelectBorder } from "../scenegraph/select/update-select-border";
|
|
64
60
|
|
|
@@ -70,21 +66,21 @@ import { Factory } from "./factory";
|
|
|
70
66
|
|
|
71
67
|
import { getCellAt, getCellAtRelativePosition, getColAt, getRowAt, getTargetColAt, getTargetColAtConsiderRightFrozen, getTargetRowAt, getTargetRowAtConsiderBottomFrozen } from "./utils/get-cell-position";
|
|
72
68
|
|
|
69
|
+
import { getCellStyle } from "./style-helper";
|
|
70
|
+
|
|
73
71
|
const {toBoxArray: toBoxArray} = utilStyle, {isTouchEvent: isTouchEvent} = event, rangeReg = /^\$(\d+)\$(\d+)$/;
|
|
74
72
|
|
|
75
73
|
importStyle();
|
|
76
74
|
|
|
77
|
-
const EMPTY_STYLE = {};
|
|
78
|
-
|
|
79
75
|
export class BaseTable extends EventTarget {
|
|
80
76
|
static get EVENT_TYPE() {
|
|
81
77
|
return TABLE_EVENT_TYPE;
|
|
82
78
|
}
|
|
83
79
|
constructor(container, options = {}) {
|
|
84
80
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
|
85
|
-
if (super(), this.showFrozenIcon = !0, this.version = "1.6.0
|
|
81
|
+
if (super(), this.showFrozenIcon = !0, this.version = "1.6.0", this.id = `VTable${Date.now()}`,
|
|
86
82
|
this.isReleased = !1, this._chartEventMap = {}, this.throttleInvalidate = throttle2(this.render.bind(this), 200),
|
|
87
|
-
!container && "node" !== options.mode) throw new Error("vtable's container is undefined");
|
|
83
|
+
!container && "node" !== options.mode && !options.canvas) throw new Error("vtable's container is undefined");
|
|
88
84
|
const {frozenColCount: frozenColCount = 0, frozenRowCount: frozenRowCount, defaultRowHeight: defaultRowHeight = 40, defaultHeaderRowHeight: defaultHeaderRowHeight, defaultColWidth: defaultColWidth = 80, defaultHeaderColWidth: defaultHeaderColWidth, widthMode: widthMode = "standard", heightMode: heightMode = "standard", autoFillWidth: autoFillWidth = !1, autoFillHeight: autoFillHeight = !1, widthAdaptiveMode: widthAdaptiveMode = "only-body", heightAdaptiveMode: heightAdaptiveMode = "only-body", keyboardOptions: keyboardOptions, eventOptions: eventOptions, rowSeriesNumber: rowSeriesNumber, columnResizeMode: columnResizeMode, rowResizeMode: rowResizeMode = "none", dragHeaderMode: dragHeaderMode, showFrozenIcon: showFrozenIcon, allowFrozenColCount: allowFrozenColCount, padding: padding, hover: hover, menu: menu, select: click, customRender: customRender, pixelRatio: pixelRatio = defaultPixelRatio, renderChartAsync: renderChartAsync, renderChartAsyncBatchCount: renderChartAsyncBatchCount, mode: mode, modeParams: modeParams, canvasWidth: canvasWidth, canvasHeight: canvasHeight, overscrollBehavior: overscrollBehavior, limitMinWidth: limitMinWidth, limitMinHeight: limitMinHeight, clearDOM: clearDOM = !0} = options;
|
|
89
85
|
this.container = container, this.options = options, this._widthMode = widthMode,
|
|
90
86
|
this._heightMode = heightMode, this._widthAdaptiveMode = widthAdaptiveMode, this._heightAdaptiveMode = heightAdaptiveMode,
|
|
@@ -97,12 +93,14 @@ export class BaseTable extends EventTarget {
|
|
|
97
93
|
}, padding && ("number" == typeof padding ? (this.padding.top = padding, this.padding.left = padding,
|
|
98
94
|
this.padding.bottom = padding, this.padding.right = padding) : (padding.top && (this.padding.top = padding.top),
|
|
99
95
|
padding.bottom && (this.padding.bottom = padding.bottom), padding.left && (this.padding.left = padding.left),
|
|
100
|
-
padding.right && (this.padding.right = padding.right))),
|
|
101
|
-
this.
|
|
102
|
-
this.
|
|
96
|
+
padding.right && (this.padding.right = padding.right))), this.tableNoFrameWidth = 0,
|
|
97
|
+
this.tableNoFrameHeight = 0, this.canvasWidth = canvasWidth, this.canvasHeight = canvasHeight,
|
|
98
|
+
this.columnWidthComputeMode = null !== (_a = options.columnWidthComputeMode) && void 0 !== _a ? _a : "normal";
|
|
103
99
|
const internalProps = this.internalProps = {};
|
|
104
100
|
if (void 0 !== showFrozenIcon && (this.showFrozenIcon = showFrozenIcon), "number" == typeof allowFrozenColCount && allowFrozenColCount <= 0 && (this.showFrozenIcon = !1),
|
|
105
|
-
|
|
101
|
+
this.options.canvas ? (internalProps.element = this.options.canvas.parentElement,
|
|
102
|
+
internalProps.element.style.position = "relative", internalProps.focusControl = new FocusInput(this, internalProps.element),
|
|
103
|
+
internalProps.canvas = this.options.canvas, internalProps.context = internalProps.canvas.getContext("2d")) : "node" !== Env.mode && (internalProps.element = createRootElement(this.padding),
|
|
106
104
|
internalProps.focusControl = new FocusInput(this, internalProps.element), internalProps.canvas = document.createElement("canvas"),
|
|
107
105
|
internalProps.element.appendChild(internalProps.canvas), internalProps.context = internalProps.canvas.getContext("2d"),
|
|
108
106
|
(null === (_b = options.customConfig) || void 0 === _b ? void 0 : _b.createReactContainer) && (internalProps.bodyDomContainer = document.createElement("div"),
|
|
@@ -160,7 +158,7 @@ export class BaseTable extends EventTarget {
|
|
|
160
158
|
confine: !0
|
|
161
159
|
}, options.tooltip), "html" === internalProps.tooltip.renderMode) {
|
|
162
160
|
const TooltipHandler = Factory.getComponent("tooltipHandler");
|
|
163
|
-
internalProps.tooltipHandler = new TooltipHandler(this, internalProps.tooltip.confine);
|
|
161
|
+
TooltipHandler && (internalProps.tooltipHandler = new TooltipHandler(this, internalProps.tooltip.confine));
|
|
164
162
|
}
|
|
165
163
|
if (internalProps.menu = Object.assign({
|
|
166
164
|
renderMode: "html"
|
|
@@ -170,8 +168,8 @@ export class BaseTable extends EventTarget {
|
|
|
170
168
|
const MenuHandler = Factory.getComponent("menuHandler");
|
|
171
169
|
internalProps.menuHandler = new MenuHandler(this);
|
|
172
170
|
}
|
|
173
|
-
this.headerStyleCache = new Map, this.bodyStyleCache = new Map, this.
|
|
174
|
-
internalProps.stick = {
|
|
171
|
+
this.headerStyleCache = new Map, this.bodyStyleCache = new Map, this.bodyMergeTitleCache = new Map,
|
|
172
|
+
this.bodyBottomStyleCache = new Map, internalProps.stick = {
|
|
175
173
|
changedCells: new Map
|
|
176
174
|
}, internalProps.customMergeCell = options.customMergeCell, this.customCellStylePlugin = new CustomCellStylePlugin(this, null !== (_k = options.customCellStyle) && void 0 !== _k ? _k : [], null !== (_l = options.customCellStyleArrangement) && void 0 !== _l ? _l : []);
|
|
177
175
|
}
|
|
@@ -184,9 +182,6 @@ export class BaseTable extends EventTarget {
|
|
|
184
182
|
get canvas() {
|
|
185
183
|
return this.internalProps.canvas;
|
|
186
184
|
}
|
|
187
|
-
setCanvasSize(canvasWidth, canvasHeight) {
|
|
188
|
-
this.canvasWidth = canvasWidth, this.canvasHeight = canvasHeight, this.resize();
|
|
189
|
-
}
|
|
190
185
|
resize() {
|
|
191
186
|
var _a;
|
|
192
187
|
this._updateSize(), null === (_a = this.internalProps.legends) || void 0 === _a || _a.forEach((legend => {
|
|
@@ -387,13 +382,14 @@ export class BaseTable extends EventTarget {
|
|
|
387
382
|
}
|
|
388
383
|
}
|
|
389
384
|
_updateSize() {
|
|
390
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0;
|
|
385
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1;
|
|
391
386
|
const {padding: padding} = this;
|
|
392
387
|
let widthP = 0, heightP = 0;
|
|
393
|
-
if (
|
|
388
|
+
if (this.tableX = 0, this.tableY = 0, this.options.canvas && this.options.viewBox) widthP = this.options.viewBox.x2 - this.options.viewBox.x1,
|
|
389
|
+
heightP = this.options.viewBox.y2 - this.options.viewBox.y1, (null === (_a = null == this ? void 0 : this.scenegraph) || void 0 === _a ? void 0 : _a.stage) && (this.options.viewBox ? this.scenegraph.stage.setViewBox(this.options.viewBox, !1) : this.scenegraph.stage.resize(widthP, heightP)); else if ("browser" === Env.mode) {
|
|
394
390
|
const element = this.getElement();
|
|
395
391
|
let widthWithoutPadding = 0, heightWithoutPadding = 0;
|
|
396
|
-
if (
|
|
392
|
+
if (element.parentElement) {
|
|
397
393
|
const computedStyle = element.parentElement.style || window.getComputedStyle(element.parentElement);
|
|
398
394
|
widthWithoutPadding = element.parentElement.offsetWidth - parseInt(computedStyle.paddingLeft || "0px", 10) - parseInt(computedStyle.paddingRight || "0px", 10),
|
|
399
395
|
heightWithoutPadding = element.parentElement.offsetHeight - parseInt(computedStyle.paddingTop || "0px", 10) - parseInt(computedStyle.paddingBottom || "0px", 20);
|
|
@@ -402,25 +398,33 @@ export class BaseTable extends EventTarget {
|
|
|
402
398
|
element.style.width = width1 && width1 - padding.left - padding.right + "px" || "0px",
|
|
403
399
|
element.style.height = height1 && height1 - padding.top - padding.bottom + "px" || "0px";
|
|
404
400
|
const {canvas: canvas} = this.internalProps;
|
|
405
|
-
widthP = null !== (
|
|
406
|
-
heightP = null !== (
|
|
407
|
-
(null === (
|
|
401
|
+
widthP = null !== (_c = null === (_b = canvas.parentElement) || void 0 === _b ? void 0 : _b.offsetWidth) && void 0 !== _c ? _c : 0,
|
|
402
|
+
heightP = null !== (_e = null === (_d = canvas.parentElement) || void 0 === _d ? void 0 : _d.offsetHeight) && void 0 !== _e ? _e : 0,
|
|
403
|
+
(null === (_f = null == this ? void 0 : this.scenegraph) || void 0 === _f ? void 0 : _f.stage) ? this.scenegraph.stage.resize(widthP, heightP) : (canvas.style.width = "",
|
|
408
404
|
canvas.style.height = "", canvas.width = widthP, canvas.height = heightP, canvas.style.width = `${widthP}px`,
|
|
409
405
|
canvas.style.height = `${heightP}px`), this.internalProps.bodyDomContainer && (this.internalProps.bodyDomContainer.style.width = `${widthP}px`,
|
|
410
406
|
this.internalProps.bodyDomContainer.style.height = `${heightP}px`), this.internalProps.headerDomContainer && (this.internalProps.headerDomContainer.style.width = `${widthP}px`,
|
|
411
407
|
this.internalProps.headerDomContainer.style.height = `${heightP}px`);
|
|
412
408
|
} else "node" === Env.mode && (widthP = this.canvasWidth - 1, heightP = this.canvasHeight - 1);
|
|
413
|
-
const width = Math.floor(widthP - style.
|
|
414
|
-
if (null === (
|
|
415
|
-
const lineWidths = toBoxArray(null !== (
|
|
416
|
-
(null === (
|
|
417
|
-
this.tableY = 0, this.tableNoFrameWidth = width - (null !== (
|
|
418
|
-
this.tableNoFrameHeight = height - (null !== (
|
|
419
|
-
this.tableY = (null !== (
|
|
420
|
-
this.tableNoFrameWidth = width - ((null !== (
|
|
421
|
-
this.tableNoFrameHeight = height - ((null !== (
|
|
409
|
+
const width = Math.floor(widthP - style.getScrollBarSize(this.getTheme().scrollStyle)), height = Math.floor(heightP - style.getScrollBarSize(this.getTheme().scrollStyle));
|
|
410
|
+
if (null === (_g = this.internalProps.theme) || void 0 === _g ? void 0 : _g.frameStyle) {
|
|
411
|
+
const lineWidths = toBoxArray(null !== (_j = null === (_h = this.internalProps.theme.frameStyle) || void 0 === _h ? void 0 : _h.borderLineWidth) && void 0 !== _j ? _j : [ null ]), shadowWidths = toBoxArray(null !== (_l = null === (_k = this.internalProps.theme.frameStyle) || void 0 === _k ? void 0 : _k.shadowBlur) && void 0 !== _l ? _l : [ 0 ]);
|
|
412
|
+
(null === (_m = this.theme.frameStyle) || void 0 === _m ? void 0 : _m.innerBorder) ? (this.tableX = 0,
|
|
413
|
+
this.tableY = 0, this.tableNoFrameWidth = width - (null !== (_o = shadowWidths[1]) && void 0 !== _o ? _o : 0),
|
|
414
|
+
this.tableNoFrameHeight = height - (null !== (_p = shadowWidths[2]) && void 0 !== _p ? _p : 0)) : (this.tableX = (null !== (_q = lineWidths[3]) && void 0 !== _q ? _q : 0) + (null !== (_r = shadowWidths[3]) && void 0 !== _r ? _r : 0),
|
|
415
|
+
this.tableY = (null !== (_s = lineWidths[0]) && void 0 !== _s ? _s : 0) + (null !== (_t = shadowWidths[0]) && void 0 !== _t ? _t : 0),
|
|
416
|
+
this.tableNoFrameWidth = width - ((null !== (_u = lineWidths[1]) && void 0 !== _u ? _u : 0) + (null !== (_v = shadowWidths[1]) && void 0 !== _v ? _v : 0)) - ((null !== (_w = lineWidths[3]) && void 0 !== _w ? _w : 0) + (null !== (_x = shadowWidths[3]) && void 0 !== _x ? _x : 0)),
|
|
417
|
+
this.tableNoFrameHeight = height - ((null !== (_y = lineWidths[0]) && void 0 !== _y ? _y : 0) + (null !== (_z = shadowWidths[0]) && void 0 !== _z ? _z : 0)) - ((null !== (_0 = lineWidths[2]) && void 0 !== _0 ? _0 : 0) + (null !== (_1 = shadowWidths[2]) && void 0 !== _1 ? _1 : 0)));
|
|
422
418
|
}
|
|
423
419
|
}
|
|
420
|
+
updateViewBox(newViewBox) {
|
|
421
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
422
|
+
const oldWidth = null !== (_d = null !== (_b = null === (_a = this.options) || void 0 === _a ? void 0 : _a.viewBox.x2) && void 0 !== _b ? _b : 0 - (null === (_c = this.options) || void 0 === _c ? void 0 : _c.viewBox.x1)) && void 0 !== _d ? _d : 0, oldHeight = null !== (_h = null !== (_f = null === (_e = this.options) || void 0 === _e ? void 0 : _e.viewBox.y2) && void 0 !== _f ? _f : 0 - (null === (_g = this.options) || void 0 === _g ? void 0 : _g.viewBox.y1)) && void 0 !== _h ? _h : 0, newWidth = newViewBox.x2 - newViewBox.x1, newHeight = newViewBox.y2 - newViewBox.y1;
|
|
423
|
+
this.options.viewBox = newViewBox, oldWidth !== newWidth || oldHeight !== newHeight ? this.resize() : this.scenegraph.stage.setViewBox(this.options.viewBox, !0);
|
|
424
|
+
}
|
|
425
|
+
setViewBoxTransform(a, b, c, d, e, f) {
|
|
426
|
+
this.internalProps.modifiedViewBoxTransform = !0, this.scenegraph.stage.window.setViewBoxTransform(a, b, c, d, e, f);
|
|
427
|
+
}
|
|
424
428
|
get rowHierarchyType() {
|
|
425
429
|
return "grid";
|
|
426
430
|
}
|
|
@@ -688,8 +692,11 @@ export class BaseTable extends EventTarget {
|
|
|
688
692
|
}));
|
|
689
693
|
}
|
|
690
694
|
_toRelativeRect(absoluteRect, relativeX = !0, relativeY = !0) {
|
|
695
|
+
var _a, _b, _c, _d;
|
|
691
696
|
const rect = absoluteRect.copy(), visibleRect = this.getVisibleRect();
|
|
692
697
|
return rect.offsetLeft(this.tableX - (relativeX ? visibleRect.left : 0)), rect.offsetTop(this.tableY - (relativeY ? visibleRect.top : 0)),
|
|
698
|
+
rect.offsetLeft(null !== (_b = null === (_a = this.options.viewBox) || void 0 === _a ? void 0 : _a.x1) && void 0 !== _b ? _b : 0),
|
|
699
|
+
rect.offsetTop(null !== (_d = null === (_c = this.options.viewBox) || void 0 === _c ? void 0 : _c.y1) && void 0 !== _d ? _d : 0),
|
|
693
700
|
rect;
|
|
694
701
|
}
|
|
695
702
|
getVisibleRect() {
|
|
@@ -794,9 +801,11 @@ export class BaseTable extends EventTarget {
|
|
|
794
801
|
internalProps.layoutMap.release(), internalProps.releaseList && (internalProps.releaseList.forEach((releaseObj => {
|
|
795
802
|
var _a;
|
|
796
803
|
return null === (_a = null == releaseObj ? void 0 : releaseObj.release) || void 0 === _a ? void 0 : _a.call(releaseObj);
|
|
797
|
-
})), internalProps.releaseList = null), this.scenegraph.stage.release(), this.scenegraph.proxy.release()
|
|
804
|
+
})), internalProps.releaseList = null), this.scenegraph.stage.release(), this.scenegraph.proxy.release(),
|
|
805
|
+
internalProps.focusControl.release();
|
|
798
806
|
const {parentElement: parentElement} = internalProps.element;
|
|
799
|
-
parentElement && parentElement.removeChild(internalProps.element),
|
|
807
|
+
parentElement && !this.options.canvas && parentElement.removeChild(internalProps.element),
|
|
808
|
+
null === (_q = null === (_p = null === (_o = this.editorManager) || void 0 === _o ? void 0 : _o.editingEditor) || void 0 === _p ? void 0 : _p.onEnd) || void 0 === _q || _q.call(_p),
|
|
800
809
|
this.isReleased = !0, this.scenegraph = null, this.internalProps = null;
|
|
801
810
|
}
|
|
802
811
|
fireListeners(type, event) {
|
|
@@ -818,7 +827,7 @@ export class BaseTable extends EventTarget {
|
|
|
818
827
|
this.autoFillWidth = null != autoFillWidth && autoFillWidth, this.autoFillHeight = null != autoFillHeight && autoFillHeight,
|
|
819
828
|
this.customRender = customRender;
|
|
820
829
|
const internalProps = this.internalProps;
|
|
821
|
-
if ("node"
|
|
830
|
+
if ("node" === Env.mode || options.canvas || updateRootElementPadding(internalProps.element, this.padding),
|
|
822
831
|
this.columnWidthComputeMode = null !== (_a = options.columnWidthComputeMode) && void 0 !== _a ? _a : "normal",
|
|
823
832
|
internalProps.frozenColCount = frozenColCount, internalProps.defaultRowHeight = defaultRowHeight,
|
|
824
833
|
internalProps.defaultHeaderRowHeight = null != defaultHeaderRowHeight ? defaultHeaderRowHeight : defaultRowHeight,
|
|
@@ -914,6 +923,7 @@ export class BaseTable extends EventTarget {
|
|
|
914
923
|
return new Rect(this.tableX, this.tableY, width, height);
|
|
915
924
|
}
|
|
916
925
|
_getMouseAbstractPoint(evt, isAddScroll = !0) {
|
|
926
|
+
var _a, _b, _c, _d;
|
|
917
927
|
let e;
|
|
918
928
|
if (!evt) return {
|
|
919
929
|
inTable: !1,
|
|
@@ -924,12 +934,15 @@ export class BaseTable extends EventTarget {
|
|
|
924
934
|
const clientX = e.clientX || e.pageX + window.scrollX, clientY = e.clientY || e.pageY + window.scrollY, rect = this.internalProps.canvas.getBoundingClientRect();
|
|
925
935
|
let inTable = !0;
|
|
926
936
|
rect.right <= clientX && (inTable = !1), rect.bottom <= clientY && (inTable = !1);
|
|
927
|
-
const currentWidth = rect.width, widthRatio = currentWidth / (this.canvas.offsetWidth || currentWidth), currentHeight = rect.height, heightRatio = currentHeight / (this.canvas.offsetHeight || currentHeight)
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
y: (clientY - rect.top) / heightRatio + (isAddScroll ? this.scrollTop : 0),
|
|
937
|
+
const currentWidth = rect.width, widthRatio = currentWidth / (this.canvas.offsetWidth || currentWidth), currentHeight = rect.height, heightRatio = currentHeight / (this.canvas.offsetHeight || currentHeight), point = {
|
|
938
|
+
x: (clientX - rect.left) / widthRatio + (isAddScroll ? this.scrollLeft : 0) - (null !== (_b = null === (_a = this.options.viewBox) || void 0 === _a ? void 0 : _a.x1) && void 0 !== _b ? _b : 0),
|
|
939
|
+
y: (clientY - rect.top) / heightRatio + (isAddScroll ? this.scrollTop : 0) - (null !== (_d = null === (_c = this.options.viewBox) || void 0 === _c ? void 0 : _c.y1) && void 0 !== _d ? _d : 0),
|
|
931
940
|
inTable: inTable
|
|
932
941
|
};
|
|
942
|
+
if (this.internalProps.modifiedViewBoxTransform && this.scenegraph.stage.window.getViewBoxTransform()) {
|
|
943
|
+
this.scenegraph.stage.window.getViewBoxTransform().transformPoint(point, point);
|
|
944
|
+
}
|
|
945
|
+
return point;
|
|
933
946
|
}
|
|
934
947
|
getTheme() {
|
|
935
948
|
return this.internalProps.theme;
|
|
@@ -1027,7 +1040,8 @@ export class BaseTable extends EventTarget {
|
|
|
1027
1040
|
return null == body ? void 0 : body.define;
|
|
1028
1041
|
}
|
|
1029
1042
|
getBodyColumnType(col, row) {
|
|
1030
|
-
|
|
1043
|
+
var _a, _b;
|
|
1044
|
+
const cellType = null !== (_b = null === (_a = this.internalProps.layoutMap.getBody(col, row)) || void 0 === _a ? void 0 : _a.cellType) && void 0 !== _b ? _b : "text";
|
|
1031
1045
|
return getProp("cellType", {
|
|
1032
1046
|
cellType: cellType
|
|
1033
1047
|
}, col, row, this);
|
|
@@ -1213,80 +1227,11 @@ export class BaseTable extends EventTarget {
|
|
|
1213
1227
|
return null === (_a = this.internalProps.dataSource) || void 0 === _a ? void 0 : _a.hasField(index, field);
|
|
1214
1228
|
}
|
|
1215
1229
|
_getCellStyle(col, row) {
|
|
1216
|
-
|
|
1217
|
-
const customCellStyle = this.customCellStylePlugin.getCustomCellStyle(col, row), {layoutMap: layoutMap} = this.internalProps;
|
|
1218
|
-
if (layoutMap.isHeader(col, row)) {
|
|
1219
|
-
let cacheKey;
|
|
1220
|
-
if (!this.isPivotTable() || this.isBottomFrozenRow(row) || this.isRightFrozenColumn(col)) cacheKey = `${col}-${row}`; else {
|
|
1221
|
-
const define = this.getHeaderDefine(col, row), isCorner = this.isCornerHeader(col, row);
|
|
1222
|
-
cacheKey = (null == define ? void 0 : define.dimensionKey) ? isCorner ? `dim-cor-${define.dimensionKey}` : `dim-${define.dimensionKey}` : (null == define ? void 0 : define.indicatorKey) ? `ind-${define.indicatorKey}` : `${col}-${row}`;
|
|
1223
|
-
}
|
|
1224
|
-
let cacheStyle = this.headerStyleCache.get(cacheKey);
|
|
1225
|
-
if (cacheStyle) return customCellStyle ? mergeStyle(cacheStyle, customCellStyle) : cacheStyle;
|
|
1226
|
-
const hd = layoutMap.getHeader(col, row);
|
|
1227
|
-
let paddingForAxis;
|
|
1228
|
-
if (this.isPivotChart() && isTopOrBottomAxis(col, row, layoutMap) && layoutMap.isAxisCell(col, row)) {
|
|
1229
|
-
paddingForAxis = null !== (_b = null === (_a = layoutMap.getBody(col, this.rowHeaderLevelCount).style) || void 0 === _a ? void 0 : _a.padding) && void 0 !== _b ? _b : this.theme.bodyStyle.padding;
|
|
1230
|
-
} else if (this.isPivotChart() && isLeftOrRightAxis(col, row, layoutMap) && layoutMap.isAxisCell(col, row)) {
|
|
1231
|
-
paddingForAxis = null !== (_d = null === (_c = layoutMap.getBody(this.columnHeaderLevelCount, row).style) || void 0 === _c ? void 0 : _c.padding) && void 0 !== _d ? _d : this.theme.bodyStyle.padding;
|
|
1232
|
-
}
|
|
1233
|
-
if ((!hd || hd.isEmpty) && (layoutMap.isLeftBottomCorner(col, row) || layoutMap.isRightBottomCorner(col, row) || layoutMap.isCornerHeader(col, row) || layoutMap.isRightTopCorner(col, row))) return EMPTY_STYLE;
|
|
1234
|
-
const styleClass = this.internalProps.headerHelper.getStyleClass((null == hd ? void 0 : hd.headerType) || "text");
|
|
1235
|
-
if (layoutMap.isBottomFrozenRow(col, row) && this.theme.bottomFrozenStyle) cacheStyle = headerStyleContents.of(paddingForAxis ? {
|
|
1236
|
-
padding: paddingForAxis
|
|
1237
|
-
} : {}, this.theme.bottomFrozenStyle, {
|
|
1238
|
-
col: col,
|
|
1239
|
-
row: row,
|
|
1240
|
-
table: this,
|
|
1241
|
-
value: this.getCellValue(col, row),
|
|
1242
|
-
dataValue: this.getCellOriginValue(col, row),
|
|
1243
|
-
cellHeaderPaths: this.getCellHeaderPaths(col, row)
|
|
1244
|
-
}, styleClass, this.options.autoWrapText, this.theme); else if (layoutMap.isRightFrozenColumn(col, row) && this.theme.rightFrozenStyle) cacheStyle = headerStyleContents.of(paddingForAxis ? {
|
|
1245
|
-
padding: paddingForAxis
|
|
1246
|
-
} : {}, this.theme.rightFrozenStyle, {
|
|
1247
|
-
col: col,
|
|
1248
|
-
row: row,
|
|
1249
|
-
table: this,
|
|
1250
|
-
value: this.getCellValue(col, row),
|
|
1251
|
-
dataValue: this.getCellOriginValue(col, row),
|
|
1252
|
-
cellHeaderPaths: this.getCellHeaderPaths(col, row)
|
|
1253
|
-
}, styleClass, this.options.autoWrapText, this.theme); else {
|
|
1254
|
-
const style = (null == hd ? void 0 : hd.style) || {};
|
|
1255
|
-
paddingForAxis && (style.padding = paddingForAxis), cacheStyle = headerStyleContents.of(style, layoutMap.isColumnHeader(col, row) || layoutMap.isBottomFrozenRow(col, row) ? this.theme.headerStyle : layoutMap.isRowHeader(col, row) || layoutMap.isRightFrozenColumn(col, row) ? this.theme.rowHeaderStyle : this.theme.cornerHeaderStyle, {
|
|
1256
|
-
col: col,
|
|
1257
|
-
row: row,
|
|
1258
|
-
table: this,
|
|
1259
|
-
value: this.getCellValue(col, row),
|
|
1260
|
-
dataValue: this.getCellOriginValue(col, row),
|
|
1261
|
-
cellHeaderPaths: this.getCellHeaderPaths(col, row)
|
|
1262
|
-
}, styleClass, this.options.autoWrapText, this.theme);
|
|
1263
|
-
}
|
|
1264
|
-
return this.headerStyleCache.set(cacheKey, cacheStyle), customCellStyle ? mergeStyle(cacheStyle, customCellStyle) : cacheStyle;
|
|
1265
|
-
}
|
|
1266
|
-
let bgColorFunc, cacheKey;
|
|
1267
|
-
(null === (_f = null === (_e = this.internalProps) || void 0 === _e ? void 0 : _e.dataConfig) || void 0 === _f ? void 0 : _f.mappingRules) && !this.isHeader(col, row) && (null === (_j = null === (_h = null === (_g = this.internalProps) || void 0 === _g ? void 0 : _g.dataConfig) || void 0 === _h ? void 0 : _h.mappingRules) || void 0 === _j || _j.forEach(((mappingRule, i) => {
|
|
1268
|
-
mappingRule.bgColor && this.internalProps.layoutMap.getIndicatorKey(col, row) === mappingRule.bgColor.indicatorKey && (bgColorFunc = mappingRule.bgColor.mapping);
|
|
1269
|
-
})));
|
|
1270
|
-
const cellType = this.getCellType(col, row);
|
|
1271
|
-
let cacheStyle;
|
|
1272
|
-
if (cacheKey = this.isSeriesNumberInBody(col, row) ? `${col}-series-` + cellType : this.isListTable() && !this.transpose || this.isPivotTable() && this.internalProps.layoutMap.indicatorsAsCol ? col + cellType : row + cellType,
|
|
1273
|
-
cacheStyle = layoutMap.isBottomFrozenRow(row) ? this.bodyBottomStyleCache.get(cacheKey) : this.bodyStyleCache.get(cacheKey),
|
|
1274
|
-
cacheStyle) return customCellStyle ? mergeStyle(cacheStyle, customCellStyle) : cacheStyle;
|
|
1275
|
-
const column = layoutMap.getBody(col, row), styleClass = this.internalProps.bodyHelper.getStyleClass(this.getCellType(col, row)), style = null == column ? void 0 : column.style;
|
|
1276
|
-
return cacheStyle = columnStyleContents.of(style, layoutMap.isBottomFrozenRow(row) && this.theme.bottomFrozenStyle ? this.theme.bottomFrozenStyle : layoutMap.isRightFrozenColumn(col) && this.theme.rightFrozenStyle ? this.theme.rightFrozenStyle : this.theme.bodyStyle, {
|
|
1277
|
-
col: col,
|
|
1278
|
-
row: row,
|
|
1279
|
-
table: this,
|
|
1280
|
-
value: this.getCellValue(col, row),
|
|
1281
|
-
dataValue: this.getCellOriginValue(col, row),
|
|
1282
|
-
cellHeaderPaths: this.getCellHeaderPaths(col, row)
|
|
1283
|
-
}, styleClass, this.options.autoWrapText, this.theme), bgColorFunc && (cacheStyle = mergeStyle(cacheStyle, {
|
|
1284
|
-
bgColor: bgColorFunc
|
|
1285
|
-
})), isFunction(style) || (layoutMap.isBottomFrozenRow(row) ? this.bodyBottomStyleCache.set(cacheKey, cacheStyle) : this.bodyStyleCache.set(cacheKey, cacheStyle)),
|
|
1286
|
-
customCellStyle ? mergeStyle(cacheStyle, customCellStyle) : cacheStyle;
|
|
1230
|
+
return getCellStyle(col, row, this);
|
|
1287
1231
|
}
|
|
1288
1232
|
clearCellStyleCache() {
|
|
1289
|
-
this.headerStyleCache.clear(), this.bodyStyleCache.clear(), this.
|
|
1233
|
+
this.headerStyleCache.clear(), this.bodyStyleCache.clear(), this.bodyMergeTitleCache.clear(),
|
|
1234
|
+
this.bodyBottomStyleCache.clear();
|
|
1290
1235
|
}
|
|
1291
1236
|
clearRowHeightCache() {
|
|
1292
1237
|
this.internalProps._rowHeightsMap.clear(), this._clearRowRangeHeightsMap();
|
|
@@ -1790,5 +1735,6 @@ export class BaseTable extends EventTarget {
|
|
|
1790
1735
|
enableScroll() {
|
|
1791
1736
|
this.eventManager.enableScroll();
|
|
1792
1737
|
}
|
|
1738
|
+
getGroupTitleLevel(col, row) {}
|
|
1793
1739
|
}
|
|
1794
1740
|
//# sourceMappingURL=BaseTable.js.map
|