@visactor/vtable 1.4.0-alpha.0 → 1.4.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.js +38 -26
- package/cjs/ListTable.js.map +1 -1
- package/cjs/PivotChart.d.ts +1 -3
- package/cjs/PivotChart.js +5 -15
- package/cjs/PivotChart.js.map +1 -1
- package/cjs/PivotTable.d.ts +1 -1
- package/cjs/PivotTable.js +40 -18
- package/cjs/PivotTable.js.map +1 -1
- package/cjs/components/axis/axis.js +2 -3
- package/cjs/components/axis/axis.js.map +1 -1
- package/cjs/components/empty-tip/empty-tip.js +2 -2
- package/cjs/components/empty-tip/empty-tip.js.map +1 -1
- package/cjs/components/legend/discrete-legend/discrete-legend.js +1 -2
- package/cjs/components/legend/discrete-legend/discrete-legend.js.map +1 -1
- package/cjs/components/react/react-custom-layout.d.ts +21 -0
- package/cjs/components/react/react-custom-layout.js +48 -0
- package/cjs/components/react/react-custom-layout.js.map +1 -0
- package/cjs/components/tooltip/TooltipHandler.js +1 -3
- package/cjs/components/tooltip/TooltipHandler.js.map +1 -1
- package/cjs/components/tooltip/logic/BubbleTooltipElement.js +7 -3
- package/cjs/components/tooltip/logic/BubbleTooltipElement.js.map +1 -1
- package/cjs/components/tooltip/logic/BubbleTooltipElementStyle.js +1 -1
- package/cjs/components/tooltip/logic/BubbleTooltipElementStyle.js.map +1 -1
- package/cjs/core/BaseTable.d.ts +10 -28
- package/cjs/core/BaseTable.js +88 -75
- package/cjs/core/BaseTable.js.map +1 -1
- package/cjs/core/FouseInput.d.ts +0 -1
- package/cjs/core/FouseInput.js +2 -5
- package/cjs/core/FouseInput.js.map +1 -1
- package/cjs/core/style.js +1 -1
- package/cjs/core/style.js.map +1 -1
- package/cjs/data/DataSource.d.ts +6 -1
- package/cjs/data/DataSource.js +12 -2
- package/cjs/data/DataSource.js.map +1 -1
- package/cjs/dataset/dataset.d.ts +17 -2
- package/cjs/dataset/dataset.js +195 -79
- package/cjs/dataset/dataset.js.map +1 -1
- package/cjs/dataset/statistics-helper.d.ts +43 -3
- package/cjs/dataset/statistics-helper.js +61 -26
- package/cjs/dataset/statistics-helper.js.map +1 -1
- package/cjs/event/event.js +1 -2
- package/cjs/event/event.js.map +1 -1
- package/cjs/event/listener/container-dom.js +4 -3
- package/cjs/event/listener/container-dom.js.map +1 -1
- package/cjs/event/listener/table-group.js +7 -5
- 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 +3 -1
- package/cjs/index.js +13 -4
- package/cjs/index.js.map +1 -1
- package/cjs/layout/layout-helper.js.map +1 -1
- package/cjs/layout/pivot-header-layout.d.ts +1 -0
- package/cjs/layout/pivot-header-layout.js +66 -39
- package/cjs/layout/pivot-header-layout.js.map +1 -1
- package/cjs/layout/row-height-map.js +1 -0
- package/cjs/layout/row-height-map.js.map +1 -1
- package/cjs/scenegraph/component/custom.js +6 -4
- package/cjs/scenegraph/component/custom.js.map +1 -1
- package/cjs/scenegraph/debug-tool/debug-tool.js +1 -4
- package/cjs/scenegraph/debug-tool/debug-tool.js.map +1 -1
- package/cjs/scenegraph/graphic/chart.d.ts +0 -1
- package/cjs/scenegraph/graphic/chart.js +20 -34
- package/cjs/scenegraph/graphic/chart.js.map +1 -1
- package/cjs/scenegraph/graphic/contributions/chart-render-helper.js +8 -20
- package/cjs/scenegraph/graphic/contributions/chart-render-helper.js.map +1 -1
- package/cjs/scenegraph/graphic/contributions/chart-render.d.ts +1 -2
- package/cjs/scenegraph/graphic/contributions/chart-render.js +24 -40
- package/cjs/scenegraph/graphic/contributions/chart-render.js.map +1 -1
- package/cjs/scenegraph/group-creater/cell-helper.js +6 -2
- package/cjs/scenegraph/group-creater/cell-helper.js.map +1 -1
- package/cjs/scenegraph/group-creater/cell-type/chart-cell.js +1 -2
- package/cjs/scenegraph/group-creater/cell-type/chart-cell.js.map +1 -1
- package/cjs/scenegraph/group-creater/progress/proxy.d.ts +3 -2
- package/cjs/scenegraph/group-creater/progress/proxy.js +10 -10
- package/cjs/scenegraph/group-creater/progress/proxy.js.map +1 -1
- package/cjs/scenegraph/group-creater/progress/update-position/dynamic-set-x.d.ts +2 -1
- package/cjs/scenegraph/group-creater/progress/update-position/dynamic-set-x.js +2 -3
- package/cjs/scenegraph/group-creater/progress/update-position/dynamic-set-x.js.map +1 -1
- package/cjs/scenegraph/group-creater/progress/update-position/dynamic-set-y.d.ts +3 -2
- package/cjs/scenegraph/group-creater/progress/update-position/dynamic-set-y.js +15 -14
- package/cjs/scenegraph/group-creater/progress/update-position/dynamic-set-y.js.map +1 -1
- package/cjs/scenegraph/group-creater/progress/update-position/update-auto-row.js +7 -5
- package/cjs/scenegraph/group-creater/progress/update-position/update-auto-row.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 +7 -4
- package/cjs/scenegraph/layout/compute-row-height.js.map +1 -1
- package/cjs/scenegraph/layout/frozen.js +12 -4
- package/cjs/scenegraph/layout/frozen.js.map +1 -1
- package/cjs/scenegraph/layout/update-width.js +3 -0
- package/cjs/scenegraph/layout/update-width.js.map +1 -1
- package/cjs/scenegraph/refresh-node/update-chart.d.ts +0 -1
- package/cjs/scenegraph/refresh-node/update-chart.js +2 -9
- package/cjs/scenegraph/refresh-node/update-chart.js.map +1 -1
- package/cjs/scenegraph/scenegraph.d.ts +2 -1
- package/cjs/scenegraph/scenegraph.js +18 -15
- package/cjs/scenegraph/scenegraph.js.map +1 -1
- package/cjs/state/cell-move/index.js +1 -1
- package/cjs/state/cell-move/index.js.map +1 -1
- package/cjs/state/sort/index.js +2 -2
- package/cjs/state/sort/index.js.map +1 -1
- package/cjs/themes/theme.js +6 -0
- package/cjs/themes/theme.js.map +1 -1
- package/cjs/ts-types/base-table.d.ts +20 -40
- package/cjs/ts-types/base-table.js.map +1 -1
- package/cjs/ts-types/customLayout.d.ts +1 -1
- package/cjs/ts-types/customLayout.js.map +1 -1
- package/cjs/ts-types/icon.d.ts +2 -0
- package/cjs/ts-types/icon.js.map +1 -1
- package/cjs/ts-types/new-data-set.d.ts +9 -1
- package/cjs/ts-types/new-data-set.js +1 -1
- package/cjs/ts-types/new-data-set.js.map +1 -1
- package/cjs/ts-types/pivot-table/corner.d.ts +12 -0
- package/cjs/ts-types/pivot-table/corner.js.map +1 -1
- package/cjs/ts-types/table-engine.d.ts +12 -0
- package/cjs/ts-types/table-engine.js.map +1 -1
- package/cjs/ts-types/theme.d.ts +2 -0
- package/cjs/ts-types/theme.js.map +1 -1
- package/cjs/ts-types/tooltip.d.ts +2 -0
- package/cjs/ts-types/tooltip.js.map +1 -1
- package/cjs/vrender.d.ts +4 -0
- package/cjs/vrender.js +39 -11
- package/cjs/vrender.js.map +1 -1
- package/dist/vtable.js +25679 -9801
- package/dist/vtable.min.js +2 -2
- package/es/ListTable.js +34 -23
- package/es/ListTable.js.map +1 -1
- package/es/PivotChart.d.ts +1 -3
- package/es/PivotChart.js +8 -17
- package/es/PivotChart.js.map +1 -1
- package/es/PivotTable.d.ts +1 -1
- package/es/PivotTable.js +41 -19
- package/es/PivotTable.js.map +1 -1
- package/es/components/axis/axis.js +1 -3
- package/es/components/axis/axis.js.map +1 -1
- package/es/components/empty-tip/empty-tip.js +2 -2
- package/es/components/empty-tip/empty-tip.js.map +1 -1
- package/es/components/legend/discrete-legend/discrete-legend.js +1 -2
- package/es/components/legend/discrete-legend/discrete-legend.js.map +1 -1
- package/es/components/react/react-custom-layout.d.ts +21 -0
- package/es/components/react/react-custom-layout.js +38 -0
- package/es/components/react/react-custom-layout.js.map +1 -0
- package/es/components/tooltip/TooltipHandler.js +1 -3
- package/es/components/tooltip/TooltipHandler.js.map +1 -1
- package/es/components/tooltip/logic/BubbleTooltipElement.js +7 -3
- package/es/components/tooltip/logic/BubbleTooltipElement.js.map +1 -1
- package/es/components/tooltip/logic/BubbleTooltipElementStyle.js +1 -1
- package/es/components/tooltip/logic/BubbleTooltipElementStyle.js.map +1 -1
- package/es/core/BaseTable.d.ts +10 -28
- package/es/core/BaseTable.js +90 -74
- package/es/core/BaseTable.js.map +1 -1
- package/es/core/FouseInput.d.ts +0 -1
- package/es/core/FouseInput.js +2 -5
- package/es/core/FouseInput.js.map +1 -1
- package/es/core/style.js +1 -1
- package/es/core/style.js.map +1 -1
- package/es/data/DataSource.d.ts +6 -1
- package/es/data/DataSource.js +12 -2
- package/es/data/DataSource.js.map +1 -1
- package/es/dataset/dataset.d.ts +17 -2
- package/es/dataset/dataset.js +195 -80
- package/es/dataset/dataset.js.map +1 -1
- package/es/dataset/statistics-helper.d.ts +43 -3
- package/es/dataset/statistics-helper.js +55 -23
- package/es/dataset/statistics-helper.js.map +1 -1
- package/es/event/event.js +1 -2
- package/es/event/event.js.map +1 -1
- package/es/event/listener/container-dom.js +4 -3
- package/es/event/listener/container-dom.js.map +1 -1
- package/es/event/listener/table-group.js +7 -5
- 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 +3 -1
- package/es/index.js +5 -1
- package/es/index.js.map +1 -1
- package/es/layout/layout-helper.js.map +1 -1
- package/es/layout/pivot-header-layout.d.ts +1 -0
- package/es/layout/pivot-header-layout.js +65 -37
- package/es/layout/pivot-header-layout.js.map +1 -1
- package/es/layout/row-height-map.js +1 -0
- package/es/layout/row-height-map.js.map +1 -1
- package/es/scenegraph/component/custom.js +7 -3
- package/es/scenegraph/component/custom.js.map +1 -1
- package/es/scenegraph/debug-tool/debug-tool.js +1 -4
- package/es/scenegraph/debug-tool/debug-tool.js.map +1 -1
- package/es/scenegraph/graphic/chart.d.ts +0 -1
- package/es/scenegraph/graphic/chart.js +21 -33
- package/es/scenegraph/graphic/chart.js.map +1 -1
- package/es/scenegraph/graphic/contributions/chart-render-helper.js +8 -20
- package/es/scenegraph/graphic/contributions/chart-render-helper.js.map +1 -1
- package/es/scenegraph/graphic/contributions/chart-render.d.ts +1 -2
- package/es/scenegraph/graphic/contributions/chart-render.js +25 -41
- package/es/scenegraph/graphic/contributions/chart-render.js.map +1 -1
- package/es/scenegraph/group-creater/cell-helper.js +6 -2
- package/es/scenegraph/group-creater/cell-helper.js.map +1 -1
- package/es/scenegraph/group-creater/cell-type/chart-cell.js +1 -2
- package/es/scenegraph/group-creater/cell-type/chart-cell.js.map +1 -1
- package/es/scenegraph/group-creater/progress/proxy.d.ts +3 -2
- package/es/scenegraph/group-creater/progress/proxy.js +10 -10
- package/es/scenegraph/group-creater/progress/proxy.js.map +1 -1
- package/es/scenegraph/group-creater/progress/update-position/dynamic-set-x.d.ts +2 -1
- package/es/scenegraph/group-creater/progress/update-position/dynamic-set-x.js +2 -3
- package/es/scenegraph/group-creater/progress/update-position/dynamic-set-x.js.map +1 -1
- package/es/scenegraph/group-creater/progress/update-position/dynamic-set-y.d.ts +3 -2
- package/es/scenegraph/group-creater/progress/update-position/dynamic-set-y.js +15 -13
- package/es/scenegraph/group-creater/progress/update-position/dynamic-set-y.js.map +1 -1
- package/es/scenegraph/group-creater/progress/update-position/update-auto-row.js +7 -5
- package/es/scenegraph/group-creater/progress/update-position/update-auto-row.js.map +1 -1
- package/es/scenegraph/layout/compute-col-width.js +3 -3
- package/es/scenegraph/layout/compute-col-width.js.map +1 -1
- package/es/scenegraph/layout/compute-row-height.js +8 -5
- package/es/scenegraph/layout/compute-row-height.js.map +1 -1
- package/es/scenegraph/layout/frozen.js +12 -4
- package/es/scenegraph/layout/frozen.js.map +1 -1
- package/es/scenegraph/layout/update-width.js +3 -0
- package/es/scenegraph/layout/update-width.js.map +1 -1
- package/es/scenegraph/refresh-node/update-chart.d.ts +0 -1
- package/es/scenegraph/refresh-node/update-chart.js +0 -6
- package/es/scenegraph/refresh-node/update-chart.js.map +1 -1
- package/es/scenegraph/scenegraph.d.ts +2 -1
- package/es/scenegraph/scenegraph.js +18 -15
- package/es/scenegraph/scenegraph.js.map +1 -1
- package/es/state/cell-move/index.js +1 -1
- package/es/state/cell-move/index.js.map +1 -1
- package/es/state/sort/index.js +2 -2
- package/es/state/sort/index.js.map +1 -1
- package/es/themes/theme.js +6 -0
- package/es/themes/theme.js.map +1 -1
- package/es/ts-types/base-table.d.ts +20 -40
- package/es/ts-types/base-table.js.map +1 -1
- package/es/ts-types/customLayout.d.ts +1 -1
- package/es/ts-types/customLayout.js.map +1 -1
- package/es/ts-types/icon.d.ts +2 -0
- package/es/ts-types/icon.js.map +1 -1
- package/es/ts-types/new-data-set.d.ts +9 -1
- package/es/ts-types/new-data-set.js +1 -1
- package/es/ts-types/new-data-set.js.map +1 -1
- package/es/ts-types/pivot-table/corner.d.ts +12 -0
- package/es/ts-types/pivot-table/corner.js.map +1 -1
- package/es/ts-types/table-engine.d.ts +12 -0
- package/es/ts-types/table-engine.js.map +1 -1
- package/es/ts-types/theme.d.ts +2 -0
- package/es/ts-types/theme.js.map +1 -1
- package/es/ts-types/tooltip.d.ts +2 -0
- package/es/ts-types/tooltip.js.map +1 -1
- package/es/vrender.d.ts +4 -0
- package/es/vrender.js +9 -3
- package/es/vrender.js.map +1 -1
- package/package.json +7 -7
|
@@ -11,7 +11,7 @@ const util_1 = require("../tools/util"), ts_types_1 = require("../ts-types"), gl
|
|
|
11
11
|
|
|
12
12
|
class PivotHeaderLayoutMap {
|
|
13
13
|
constructor(table, dataset, columnDimensionTree, rowDimensionTree) {
|
|
14
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
|
|
14
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t;
|
|
15
15
|
if (this.colIndex = 0, this._showHeader = !0, this.columnHeaderObjs = [], this.rowHeaderObjs = [],
|
|
16
16
|
this._cornerHeaderCellFullPathIds = [], this._columnHeaderCellFullPathIds = [],
|
|
17
17
|
this._rowHeaderCellFullPathIds = [], this._rowHeaderCellFullPathIds_FULL = [], this._cornerHeaderCellIds = [],
|
|
@@ -46,16 +46,16 @@ class PivotHeaderLayoutMap {
|
|
|
46
46
|
})), this.columnDimensionTree = columnDimensionTree, this.rowDimensionTree = rowDimensionTree,
|
|
47
47
|
this.colDimensionKeys = this.columnDimensionTree.dimensionKeys.valueArr(), this.rowDimensionKeys = this.rowDimensionTree.dimensionKeys.valueArr(),
|
|
48
48
|
this.fullRowDimensionKeys = this.fullRowDimensionKeys.concat(this.rowDimensionKeys),
|
|
49
|
-
this.resetRowHeaderLevelCount(), this.
|
|
50
|
-
this._generateRowHeaderIds(), this._table.isPivotChart() && (this.hasTwoIndicatorAxes = this._indicators.some((indicatorObject => {
|
|
49
|
+
this.resetRowHeaderLevelCount(), this._table.isPivotChart() && (this.hasTwoIndicatorAxes = this.indicatorsDefine.some((indicatorObject => {
|
|
51
50
|
var _a, _b;
|
|
52
51
|
if (indicatorObject.chartSpec && indicatorObject.chartSpec.series && indicatorObject.chartSpec.series.length > 1) {
|
|
53
52
|
const axes = null !== (_b = null !== (_a = indicatorObject.chartSpec.axes) && void 0 !== _a ? _a : this._table.pivotChartAxes) && void 0 !== _b ? _b : [];
|
|
54
53
|
if (!axes.length || axes.every((axis => axis.orient !== (this.indicatorsAsCol ? "top" : "right") || !1 !== axis.visible))) return !0;
|
|
55
54
|
}
|
|
56
55
|
return !1;
|
|
57
|
-
}))), this.resetColumnHeaderLevelCount(), this.
|
|
58
|
-
|
|
56
|
+
}))), this.resetColumnHeaderLevelCount(), this._generateColHeaderIds(), this.colIndex = 0,
|
|
57
|
+
this._generateRowHeaderIds(), this._rowHeaderCellFullPathIds_FULL = (0, util_1.transpose)(this._rowHeaderCellFullPathIds_FULL),
|
|
58
|
+
"tree" === table.options.rowHierarchyType && (null === (_o = this.extensionRows) || void 0 === _o ? void 0 : _o.length) >= 1 && (this.generateExtensionRowTree(),
|
|
59
59
|
this.extensionRows.forEach((extensionRow => {
|
|
60
60
|
const rowKeys = [];
|
|
61
61
|
extensionRow.rows.forEach((row => {
|
|
@@ -63,9 +63,10 @@ class PivotHeaderLayoutMap {
|
|
|
63
63
|
})), this._extensionRowDimensionKeys.push(rowKeys), this.fullRowDimensionKeys = this.fullRowDimensionKeys.concat(rowKeys);
|
|
64
64
|
}))), this.sharedVar.seqId = Math.max(this.sharedVar.seqId, this._headerObjects.length),
|
|
65
65
|
"column" === this.cornerSetting.titleOnDimension) {
|
|
66
|
-
|
|
67
|
-
this.
|
|
68
|
-
|
|
66
|
+
let colDimensionKeys = this.columnDimensionTree.dimensionKeysIncludeVirtual.valueArr();
|
|
67
|
+
!this.dataset || 0 !== (null !== (_q = null === (_p = this.dataset.records) || void 0 === _p ? void 0 : _p.length) && void 0 !== _q ? _q : 0) || this.dataset.customColTree || this.dataset.customRowTree || (colDimensionKeys = this.columnsDefine.map((define => "string" == typeof define ? define : define.dimensionKey)),
|
|
68
|
+
this.indicatorsAsCol && colDimensionKeys.push(this.indicatorDimensionKey)), this.cornerHeaderObjs = this._addCornerHeaders(this.columnHeaderTitle ? [ "" ].concat(colDimensionKeys) : colDimensionKeys, this.columnsDefine);
|
|
69
|
+
} else if ("row" === this.cornerSetting.titleOnDimension) if ("tree" === this.rowHierarchyType && (null === (_r = this.extensionRows) || void 0 === _r ? void 0 : _r.length) >= 1) {
|
|
69
70
|
const rowTreeFirstKey = [];
|
|
70
71
|
rowTreeFirstKey.push(this.rowDimensionKeys[0]), this._extensionRowDimensionKeys.forEach((extensionRowKeys => {
|
|
71
72
|
rowTreeFirstKey.push(extensionRowKeys[0]);
|
|
@@ -73,8 +74,9 @@ class PivotHeaderLayoutMap {
|
|
|
73
74
|
const extensionRowDimensions = this.extensionRows.reduce(((dimensions, cur) => dimensions.concat(cur.rows)), []);
|
|
74
75
|
this.cornerHeaderObjs = this._addCornerHeaders(this.rowHeaderTitle ? [ "" ].concat(rowTreeFirstKey) : rowTreeFirstKey, this.rowsDefine.concat(extensionRowDimensions));
|
|
75
76
|
} else {
|
|
76
|
-
|
|
77
|
-
this.
|
|
77
|
+
let rowDimensionKeys = this.rowDimensionTree.dimensionKeysIncludeVirtual.valueArr();
|
|
78
|
+
!this.dataset || 0 !== (null !== (_t = null === (_s = this.dataset.records) || void 0 === _s ? void 0 : _s.length) && void 0 !== _t ? _t : 0) || this.dataset.customColTree || this.dataset.customRowTree || (rowDimensionKeys = this.rowsDefine.map((define => "string" == typeof define ? define : define.dimensionKey)),
|
|
79
|
+
this.indicatorsAsCol || rowDimensionKeys.push(this.indicatorDimensionKey)), this.cornerHeaderObjs = this._addCornerHeaders(this.rowHeaderTitle ? [ "" ].concat(rowDimensionKeys) : rowDimensionKeys, this.rowsDefine);
|
|
78
80
|
} else this.cornerHeaderObjs = this._addCornerHeaders(null, void 0);
|
|
79
81
|
this.colIndex = 0, this._headerObjectMap = this._headerObjects.reduce(((o, e) => (o[e.id] = e,
|
|
80
82
|
o)), {}), this.indicatorsAsCol && !this.hideIndicatorName ? this._indicatorShowType = "column" : this.indicatorsAsCol || this.hideIndicatorName ? this._indicatorShowType = "none" : this._indicatorShowType = "row",
|
|
@@ -123,44 +125,58 @@ class PivotHeaderLayoutMap {
|
|
|
123
125
|
this.leftRowSeriesNumberColumnCount = this.leftRowSeriesNumberColumn.length, this.rightRowSeriesNumberColumnCount = this.rightRowSeriesNumberColumn.length);
|
|
124
126
|
}
|
|
125
127
|
_generateColHeaderIds() {
|
|
126
|
-
var _a, _b, _c, _d, _e, _f;
|
|
127
|
-
if ((null === (_a = this.columnDimensionTree.tree.children) || void 0 === _a ? void 0 : _a.length) >= 1
|
|
128
|
-
|
|
128
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
129
|
+
if ((null === (_a = this.columnDimensionTree.tree.children) || void 0 === _a ? void 0 : _a.length) >= 1) {
|
|
130
|
+
let startRow = 0;
|
|
131
|
+
if (this.dataset && 0 === (null !== (_c = null === (_b = this.dataset.records) || void 0 === _b ? void 0 : _b.length) && void 0 !== _c ? _c : 0) && !this.dataset.customColTree && !this.dataset.customRowTree && this.indicatorsAsCol && this.columnDimensionTree.totalLevel < this.columnHeaderLevelCount) {
|
|
132
|
+
startRow = this.columnHeaderLevelCount - this.columnDimensionTree.totalLevel;
|
|
133
|
+
for (let i = 0; i < startRow; i++) this._columnHeaderCellFullPathIds.unshift([]);
|
|
134
|
+
}
|
|
135
|
+
this._addHeaders(this._columnHeaderCellFullPathIds, startRow, this.columnDimensionTree.tree.children, [], this.columnHeaderObjs);
|
|
136
|
+
}
|
|
137
|
+
if (this.columnHeaderTitle) {
|
|
129
138
|
this.sharedVar.seqId = Math.max(this.sharedVar.seqId, this._headerObjects.length);
|
|
130
|
-
const id = ++this.sharedVar.seqId, firstRowIds = Array(this.colCount - this.rowHeaderLevelCount).fill(id);
|
|
139
|
+
const id = ++this.sharedVar.seqId, firstRowIds = Array(this.colCount - this.rowHeaderLevelCount - this.rightFrozenColCount).fill(id);
|
|
131
140
|
this._columnHeaderCellFullPathIds.unshift(firstRowIds);
|
|
132
141
|
const cell = {
|
|
133
142
|
id: id,
|
|
134
143
|
title: "string" == typeof this.columnHeaderTitle.title ? this.columnHeaderTitle.title : this.columnsDefine.reduce(((title, value) => "string" == typeof value ? title : title + (title ? `/${value.title}` : `${value.title}`)), ""),
|
|
135
144
|
field: void 0,
|
|
136
|
-
headerType: null !== (
|
|
137
|
-
style: null === (
|
|
145
|
+
headerType: null !== (_e = null === (_d = this.columnHeaderTitle) || void 0 === _d ? void 0 : _d.headerType) && void 0 !== _e ? _e : "text",
|
|
146
|
+
style: null === (_f = this.columnHeaderTitle) || void 0 === _f ? void 0 : _f.headerStyle,
|
|
138
147
|
define: {
|
|
139
148
|
id: id,
|
|
140
|
-
disableHeaderHover: !!(null === (
|
|
141
|
-
disableHeaderSelect: !!(null === (
|
|
149
|
+
disableHeaderHover: !!(null === (_g = this.columnHeaderTitle) || void 0 === _g ? void 0 : _g.disableHeaderHover),
|
|
150
|
+
disableHeaderSelect: !!(null === (_h = this.columnHeaderTitle) || void 0 === _h ? void 0 : _h.disableHeaderSelect)
|
|
142
151
|
}
|
|
143
152
|
};
|
|
144
153
|
this.columnHeaderObjs.push(cell), this._headerObjects[id] = cell;
|
|
145
154
|
}
|
|
146
155
|
}
|
|
147
156
|
_generateRowHeaderIds() {
|
|
148
|
-
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
149
|
-
if ((null === (_a = this.rowDimensionTree.tree.children) || void 0 === _a ? void 0 : _a.length) >= 1
|
|
150
|
-
|
|
157
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
158
|
+
if ((null === (_a = this.rowDimensionTree.tree.children) || void 0 === _a ? void 0 : _a.length) >= 1) if ("tree" === this.rowHierarchyType) this._addHeadersForTreeMode(this._rowHeaderCellFullPathIds_FULL, 0, this.rowDimensionTree.tree.children, [], this.rowDimensionTree.totalLevel, !0, this.rowsDefine, this.rowHeaderObjs); else {
|
|
159
|
+
let startRow = 0;
|
|
160
|
+
if (this.dataset && 0 === (null !== (_c = null === (_b = this.dataset.records) || void 0 === _b ? void 0 : _b.length) && void 0 !== _c ? _c : 0) && !this.dataset.customColTree && !this.dataset.customRowTree && !this.indicatorsAsCol && this.rowDimensionTree.totalLevel < this.rowHeaderLevelCount) {
|
|
161
|
+
startRow = this.rowHeaderLevelCount - this.rowDimensionTree.totalLevel;
|
|
162
|
+
for (let i = 0; i < startRow; i++) this._rowHeaderCellFullPathIds_FULL.unshift([]);
|
|
163
|
+
}
|
|
164
|
+
this._addHeaders(this._rowHeaderCellFullPathIds_FULL, startRow, this.rowDimensionTree.tree.children, [], this.rowHeaderObjs);
|
|
165
|
+
}
|
|
166
|
+
if (this.rowHeaderTitle) {
|
|
151
167
|
this.sharedVar.seqId = Math.max(this.sharedVar.seqId, this._headerObjects.length);
|
|
152
|
-
const id = ++this.sharedVar.seqId, firstColIds = Array(null !== (
|
|
168
|
+
const id = ++this.sharedVar.seqId, firstColIds = Array(null !== (_e = null === (_d = this._rowHeaderCellFullPathIds_FULL[0]) || void 0 === _d ? void 0 : _d.length) && void 0 !== _e ? _e : this.rowDimensionTree.tree.size).fill(id);
|
|
153
169
|
this._rowHeaderCellFullPathIds_FULL.unshift(firstColIds);
|
|
154
170
|
const cell = {
|
|
155
171
|
id: id,
|
|
156
172
|
title: "string" == typeof this.rowHeaderTitle.title ? this.rowHeaderTitle.title : this.rowsDefine.reduce(((title, value) => "string" == typeof value ? title : title + (title ? `/${value.title}` : `${value.title}`)), ""),
|
|
157
173
|
field: void 0,
|
|
158
|
-
headerType: null !== (
|
|
159
|
-
style: null === (
|
|
174
|
+
headerType: null !== (_g = null === (_f = this.rowHeaderTitle) || void 0 === _f ? void 0 : _f.headerType) && void 0 !== _g ? _g : "text",
|
|
175
|
+
style: null === (_h = this.rowHeaderTitle) || void 0 === _h ? void 0 : _h.headerStyle,
|
|
160
176
|
define: {
|
|
161
177
|
id: id,
|
|
162
|
-
disableHeaderHover: !!(null === (
|
|
163
|
-
disableHeaderSelect: !!(null === (
|
|
178
|
+
disableHeaderHover: !!(null === (_j = this.rowHeaderTitle) || void 0 === _j ? void 0 : _j.disableHeaderHover),
|
|
179
|
+
disableHeaderSelect: !!(null === (_k = this.rowHeaderTitle) || void 0 === _k ? void 0 : _k.disableHeaderSelect)
|
|
164
180
|
}
|
|
165
181
|
};
|
|
166
182
|
this.rowHeaderObjs.push(cell), this._headerObjects[id] = cell;
|
|
@@ -211,6 +227,7 @@ class PivotHeaderLayoutMap {
|
|
|
211
227
|
dimensionKey: dimensionKey,
|
|
212
228
|
id: id,
|
|
213
229
|
value: dimensionKey,
|
|
230
|
+
headerEditor: this.cornerSetting.headerEditor,
|
|
214
231
|
disableHeaderHover: !!this.cornerSetting.disableHeaderHover,
|
|
215
232
|
disableHeaderSelect: !!this.cornerSetting.disableHeaderSelect
|
|
216
233
|
},
|
|
@@ -475,18 +492,20 @@ class PivotHeaderLayoutMap {
|
|
|
475
492
|
return this.columnHeaderLevelCount;
|
|
476
493
|
}
|
|
477
494
|
resetColumnHeaderLevelCount() {
|
|
478
|
-
var _a, _b, _c, _d;
|
|
495
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
479
496
|
if (this.showHeader && this.showColumnHeader) {
|
|
480
497
|
if (this._table.isPivotChart() && this.indicatorsAsCol && !(null === (_b = null === (_a = this.dataset) || void 0 === _a ? void 0 : _a.colKeys) || void 0 === _b ? void 0 : _b.length) && 0 === (null === (_d = null === (_c = this.columnDimensionTree) || void 0 === _c ? void 0 : _c.tree) || void 0 === _d ? void 0 : _d.level) && !this.hasTwoIndicatorAxes) return void (this.columnHeaderLevelCount = 0);
|
|
481
498
|
let count = this.indicatorsAsCol && this.hideIndicatorName && this.colDimensionKeys[this.colDimensionKeys.length - 1] === this.indicatorDimensionKey ? this.columnDimensionTree.totalLevel - 1 : this.columnDimensionTree.totalLevel;
|
|
482
499
|
return this.columnHeaderTitle && (count += 1), this._table.isPivotChart() && this.indicatorsAsCol && !this.hasTwoIndicatorAxes && (0,
|
|
483
500
|
get_chart_spec_1.checkHasCartesianChart)(this.indicatorsDefine) && (count -= 1),
|
|
501
|
+
0 !== count || !this.dataset || this.dataset.customColTree || this.dataset.customRowTree ? !this.dataset || 0 !== (null !== (_j = null === (_h = this.dataset.records) || void 0 === _h ? void 0 : _h.length) && void 0 !== _j ? _j : 0) || this.dataset.customColTree || this.dataset.customRowTree || "column" === this.cornerSetting.titleOnDimension && (count = null !== (_k = this.columnsDefine.length) && void 0 !== _k ? _k : 0,
|
|
502
|
+
!this.hideIndicatorName && this.indicatorsAsCol && count++) : "row" === this.cornerSetting.titleOnDimension ? count = 1 : 0 === (null !== (_f = null === (_e = this.dataset.records) || void 0 === _e ? void 0 : _e.length) && void 0 !== _f ? _f : 0) && "column" === this.cornerSetting.titleOnDimension && (count = null !== (_g = this.columnsDefine.length) && void 0 !== _g ? _g : 0),
|
|
484
503
|
void (this.columnHeaderLevelCount = count);
|
|
485
504
|
}
|
|
486
505
|
this.columnHeaderLevelCount = this.indicatorsAsCol ? this.hideIndicatorName ? 0 : 1 : 0;
|
|
487
506
|
}
|
|
488
507
|
resetRowHeaderLevelCount() {
|
|
489
|
-
var _a, _b;
|
|
508
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
490
509
|
if (this.showHeader && this.showRowHeader) {
|
|
491
510
|
if ("tree" === this.rowHierarchyType) {
|
|
492
511
|
const extensionRowCount = null !== (_b = null === (_a = this.extensionRows) || void 0 === _a ? void 0 : _a.length) && void 0 !== _b ? _b : 0;
|
|
@@ -495,7 +514,9 @@ class PivotHeaderLayoutMap {
|
|
|
495
514
|
const rowLevelCount = this.rowDimensionTree.totalLevel;
|
|
496
515
|
let count = rowLevelCount;
|
|
497
516
|
return this.indicatorsAsCol || this.hideIndicatorName && this.rowDimensionKeys[this.rowDimensionKeys.length - 1] === this.indicatorDimensionKey && (count = rowLevelCount - 1),
|
|
498
|
-
this.rowHeaderTitle && (count += 1),
|
|
517
|
+
this.rowHeaderTitle && (count += 1), 0 !== count || !this.dataset || this.dataset.customColTree || this.dataset.customRowTree ? !this.dataset || 0 !== (null !== (_g = null === (_f = this.dataset.records) || void 0 === _f ? void 0 : _f.length) && void 0 !== _g ? _g : 0) || this.dataset.customColTree || this.dataset.customRowTree || "row" === this.cornerSetting.titleOnDimension && (count = this.rowsDefine.length,
|
|
518
|
+
this.hideIndicatorName || this.indicatorsAsCol || count++) : "column" === this.cornerSetting.titleOnDimension ? count = 1 : 0 === (null !== (_d = null === (_c = this.dataset.records) || void 0 === _c ? void 0 : _c.length) && void 0 !== _d ? _d : 0) && "row" === this.cornerSetting.titleOnDimension && (count = null !== (_e = this.rowsDefine.length) && void 0 !== _e ? _e : 0),
|
|
519
|
+
void (this.rowHeaderLevelCount = count);
|
|
499
520
|
}
|
|
500
521
|
this.rowHeaderLevelCount = this.indicatorsAsCol || this.hideIndicatorName ? 0 : 1;
|
|
501
522
|
}
|
|
@@ -549,14 +570,14 @@ class PivotHeaderLayoutMap {
|
|
|
549
570
|
return this._indicators;
|
|
550
571
|
}
|
|
551
572
|
getCellId(col, row) {
|
|
552
|
-
var _a, _b;
|
|
573
|
+
var _a, _b, _c, _d, _e;
|
|
553
574
|
if (row >= 0 && col >= 0) {
|
|
554
575
|
if (this.isSeriesNumber(col, row)) return "";
|
|
555
|
-
if (this.isCornerHeader(col, row)) return this._cornerHeaderCellIds[row][col - this.leftRowSeriesNumberColumnCount];
|
|
556
|
-
if (this.isColumnHeader(col, row)) return this._columnHeaderCellIds[row][col - this.rowHeaderLevelCount - this.leftRowSeriesNumberColumnCount];
|
|
557
|
-
if (this.isRowHeader(col, row)) return null === (
|
|
558
|
-
if (this.isRightFrozenColumn(col, row)) return this._rowHeaderCellIds[row - this.columnHeaderLevelCount][this.rowHeaderLevelCount - 1];
|
|
559
|
-
if (this.isBottomFrozenRow(col, row)) return null === (
|
|
576
|
+
if (this.isCornerHeader(col, row)) return null === (_a = this._cornerHeaderCellIds[row]) || void 0 === _a ? void 0 : _a[col - this.leftRowSeriesNumberColumnCount];
|
|
577
|
+
if (this.isColumnHeader(col, row)) return null === (_b = this._columnHeaderCellIds[row]) || void 0 === _b ? void 0 : _b[col - this.rowHeaderLevelCount - this.leftRowSeriesNumberColumnCount];
|
|
578
|
+
if (this.isRowHeader(col, row)) return null === (_c = this._rowHeaderCellIds[row - this.columnHeaderLevelCount]) || void 0 === _c ? void 0 : _c[col - this.leftRowSeriesNumberColumnCount];
|
|
579
|
+
if (this.isRightFrozenColumn(col, row)) return null === (_d = this._rowHeaderCellIds[row - this.columnHeaderLevelCount]) || void 0 === _d ? void 0 : _d[this.rowHeaderLevelCount - 1];
|
|
580
|
+
if (this.isBottomFrozenRow(col, row)) return null === (_e = this._columnHeaderCellIds[this.columnHeaderLevelCount - 1]) || void 0 === _e ? void 0 : _e[col - this.rowHeaderLevelCount - this.leftRowSeriesNumberColumnCount];
|
|
560
581
|
}
|
|
561
582
|
}
|
|
562
583
|
getHeader(col, row) {
|
|
@@ -1166,8 +1187,8 @@ class PivotHeaderLayoutMap {
|
|
|
1166
1187
|
}
|
|
1167
1188
|
setPagination(pagination) {
|
|
1168
1189
|
var _a, _b, _c, _d, _e, _f, _g;
|
|
1169
|
-
if (this.clearCellRangeMap(), this.
|
|
1170
|
-
vutils_1.isValid)(null === (_a = this.pagination) || void 0 === _a ? void 0 : _a.perPageCount) && (0,
|
|
1190
|
+
if (this.clearCellRangeMap(), this._table.internalProps.useOneRowHeightFillAll = !1,
|
|
1191
|
+
this.pagination = pagination, "grid" === this.rowHierarchyType && (0, vutils_1.isValid)(null === (_a = this.pagination) || void 0 === _a ? void 0 : _a.perPageCount) && (0,
|
|
1171
1192
|
vutils_1.isValid)(null === (_b = this.pagination) || void 0 === _b ? void 0 : _b.currentPage)) {
|
|
1172
1193
|
!1 === this.indicatorsAsCol && (this.pagination.perPageCount = Math.ceil(this.pagination.perPageCount / this.indicatorKeys.length) * this.indicatorKeys.length);
|
|
1173
1194
|
const {perPageCount: perPageCount, currentPage: currentPage} = this.pagination;
|
|
@@ -1397,8 +1418,8 @@ class PivotHeaderLayoutMap {
|
|
|
1397
1418
|
const dataset = this.dataset;
|
|
1398
1419
|
this.rowTree = dataset.rowHeaderTree, this.columnTree = dataset.colHeaderTree, this.columnDimensionTree = new tree_helper_1.DimensionTree(null !== (_a = this.columnTree) && void 0 !== _a ? _a : [], this.sharedVar),
|
|
1399
1420
|
this.rowDimensionTree = new tree_helper_1.DimensionTree(null !== (_b = this.rowTree) && void 0 !== _b ? _b : [], this.sharedVar, this.rowHierarchyType, "tree" === this.rowHierarchyType ? this.rowExpandLevel : void 0),
|
|
1400
|
-
this._generateColHeaderIds(), this.colIndex = 0,
|
|
1401
|
-
this._rowHeaderCellFullPathIds_FULL = (0, util_1.transpose)(this._rowHeaderCellFullPathIds_FULL),
|
|
1421
|
+
this.resetColumnHeaderLevelCount(), this._generateColHeaderIds(), this.colIndex = 0,
|
|
1422
|
+
this._generateRowHeaderIds(), this._rowHeaderCellFullPathIds_FULL = (0, util_1.transpose)(this._rowHeaderCellFullPathIds_FULL),
|
|
1402
1423
|
this._headerObjectMap = this._headerObjects.reduce(((o, e) => (o[e.id] = e, o)), {}),
|
|
1403
1424
|
this._CellHeaderPathMap = new Map, this._largeCellRangeCache.length = 0, this.generateCellIdsConsiderHideHeader(),
|
|
1404
1425
|
this.setPagination(this.pagination);
|
|
@@ -1425,6 +1446,12 @@ class PivotHeaderLayoutMap {
|
|
|
1425
1446
|
const id = this.getCellId(col, row);
|
|
1426
1447
|
this._headerObjectMap[id].title = value;
|
|
1427
1448
|
}
|
|
1449
|
+
changeCornerTitle(col, row, value) {
|
|
1450
|
+
if (this.isCornerHeader(col, row)) {
|
|
1451
|
+
const id = this.getCellId(col, row);
|
|
1452
|
+
this._headerObjectMap[id].title = value;
|
|
1453
|
+
}
|
|
1454
|
+
}
|
|
1428
1455
|
generateCellIdsConsiderHideHeader() {
|
|
1429
1456
|
if (this._columnHeaderCellIds = this._columnHeaderCellFullPathIds.slice(), !this.showColumnHeader) if (this.indicatorsAsCol && !this.hideIndicatorName) {
|
|
1430
1457
|
const indicatorIndex = this.colDimensionKeys.indexOf(global_1.IndicatorDimensionKeyPlaceholder), indicatorIds = this._columnHeaderCellIds.splice(indicatorIndex, 1);
|