@visactor/vtable 1.15.3-alpha.1 → 1.16.0-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/PivotChart.d.ts +0 -1
- package/cjs/PivotChart.js +2 -5
- package/cjs/PivotChart.js.map +1 -1
- package/cjs/PivotTable.d.ts +2 -2
- package/cjs/PivotTable.js +41 -33
- package/cjs/PivotTable.js.map +1 -1
- package/cjs/components/index.js +1 -1
- package/cjs/core/BaseTable.d.ts +1 -2
- package/cjs/core/BaseTable.js +2 -2
- package/cjs/core/BaseTable.js.map +1 -1
- package/cjs/data/DataSource.d.ts +2 -2
- package/cjs/data/DataSource.js +4 -4
- package/cjs/data/DataSource.js.map +1 -1
- package/cjs/dataset/dataset-pivot-table.js +1 -2
- package/cjs/dataset/dataset.d.ts +3 -2
- package/cjs/dataset/dataset.js +13 -9
- package/cjs/dataset/dataset.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/index.js +1 -2
- package/cjs/layout/layout-helper.js +10 -9
- package/cjs/layout/layout-helper.js.map +1 -1
- package/cjs/layout/pivot-header-layout.d.ts +33 -5
- package/cjs/layout/pivot-header-layout.js +137 -31
- package/cjs/layout/pivot-header-layout.js.map +1 -1
- package/cjs/layout/tree-helper.d.ts +5 -4
- package/cjs/layout/tree-helper.js +105 -23
- package/cjs/layout/tree-helper.js.map +1 -1
- package/cjs/plugins/custom-cell-style.js +1 -1
- package/cjs/scenegraph/group-creater/progress/proxy.d.ts +1 -1
- package/cjs/scenegraph/group-creater/progress/proxy.js +5 -2
- package/cjs/scenegraph/group-creater/progress/proxy.js.map +1 -1
- package/cjs/scenegraph/group-creater/progress/update-position/update-auto-row.js +8 -4
- package/cjs/scenegraph/group-creater/progress/update-position/update-auto-row.js.map +1 -1
- package/cjs/scenegraph/layout/compute-col-width.js +1 -1
- package/cjs/scenegraph/layout/compute-col-width.js.map +1 -1
- package/cjs/scenegraph/layout/frozen.d.ts +1 -0
- package/cjs/scenegraph/layout/frozen.js +91 -2
- package/cjs/scenegraph/layout/frozen.js.map +1 -1
- package/cjs/scenegraph/layout/update-col.js +4 -1
- package/cjs/scenegraph/layout/update-col.js.map +1 -1
- package/cjs/scenegraph/layout/update-row.js +3 -2
- package/cjs/scenegraph/layout/update-row.js.map +1 -1
- package/cjs/scenegraph/scenegraph.d.ts +5 -0
- package/cjs/scenegraph/scenegraph.js +18 -0
- package/cjs/scenegraph/scenegraph.js.map +1 -1
- package/cjs/scenegraph/utils/get-hierarchy-offset.js +1 -1
- package/cjs/scenegraph/utils/get-hierarchy-offset.js.map +1 -1
- package/cjs/state/state.d.ts +2 -0
- package/cjs/state/state.js +7 -2
- package/cjs/state/state.js.map +1 -1
- package/cjs/tools/NumberMap.js +4 -2
- package/cjs/tools/NumberMap.js.map +1 -1
- package/cjs/tools/diff-cell.d.ts +58 -3
- package/cjs/tools/diff-cell.js +90 -11
- package/cjs/tools/diff-cell.js.map +1 -1
- package/cjs/tools/get-data-path/create-dataset.js +1 -1
- package/cjs/tools/get-data-path/create-dataset.js.map +1 -1
- package/cjs/ts-types/base-table.d.ts +2 -1
- package/cjs/ts-types/base-table.js.map +1 -1
- package/cjs/ts-types/list-table/define/basic-define.d.ts +1 -1
- package/cjs/ts-types/list-table/define/basic-define.js.map +1 -1
- package/cjs/ts-types/list-table/layout-map/api.d.ts +4 -4
- package/cjs/ts-types/list-table/layout-map/api.js.map +1 -1
- package/cjs/ts-types/pivot-table/dimension/basic-dimension.d.ts +2 -2
- package/cjs/ts-types/pivot-table/dimension/basic-dimension.js.map +1 -1
- package/cjs/ts-types/pivot-table/indicator/basic-indicator.d.ts +1 -1
- package/cjs/ts-types/pivot-table/indicator/basic-indicator.js.map +1 -1
- package/cjs/ts-types/table-engine.d.ts +6 -3
- package/cjs/ts-types/table-engine.js.map +1 -1
- package/cjs/vrender.js.map +1 -1
- package/dist/vtable.js +759 -116
- package/dist/vtable.min.js +2 -2
- package/es/PivotChart.d.ts +0 -1
- package/es/PivotChart.js +2 -5
- package/es/PivotChart.js.map +1 -1
- package/es/PivotTable.d.ts +2 -2
- package/es/PivotTable.js +41 -33
- package/es/PivotTable.js.map +1 -1
- package/es/components/index.js +1 -1
- package/es/core/BaseTable.d.ts +1 -2
- package/es/core/BaseTable.js +2 -2
- package/es/core/BaseTable.js.map +1 -1
- package/es/data/DataSource.d.ts +2 -2
- package/es/data/DataSource.js +4 -4
- package/es/data/DataSource.js.map +1 -1
- package/es/dataset/dataset-pivot-table.js +1 -2
- package/es/dataset/dataset.d.ts +3 -2
- package/es/dataset/dataset.js +14 -10
- package/es/dataset/dataset.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/index.js +1 -2
- package/es/layout/layout-helper.js +10 -9
- package/es/layout/layout-helper.js.map +1 -1
- package/es/layout/pivot-header-layout.d.ts +33 -5
- package/es/layout/pivot-header-layout.js +138 -33
- package/es/layout/pivot-header-layout.js.map +1 -1
- package/es/layout/tree-helper.d.ts +5 -4
- package/es/layout/tree-helper.js +102 -19
- package/es/layout/tree-helper.js.map +1 -1
- package/es/plugins/custom-cell-style.js +1 -1
- package/es/scenegraph/group-creater/progress/proxy.d.ts +1 -1
- package/es/scenegraph/group-creater/progress/proxy.js +5 -2
- package/es/scenegraph/group-creater/progress/proxy.js.map +1 -1
- package/es/scenegraph/group-creater/progress/update-position/update-auto-row.js +8 -4
- package/es/scenegraph/group-creater/progress/update-position/update-auto-row.js.map +1 -1
- package/es/scenegraph/layout/compute-col-width.js +1 -1
- package/es/scenegraph/layout/compute-col-width.js.map +1 -1
- package/es/scenegraph/layout/frozen.d.ts +1 -0
- package/es/scenegraph/layout/frozen.js +89 -0
- package/es/scenegraph/layout/frozen.js.map +1 -1
- package/es/scenegraph/layout/update-col.js +4 -1
- package/es/scenegraph/layout/update-col.js.map +1 -1
- package/es/scenegraph/layout/update-row.js +3 -2
- package/es/scenegraph/layout/update-row.js.map +1 -1
- package/es/scenegraph/scenegraph.d.ts +5 -0
- package/es/scenegraph/scenegraph.js +16 -1
- package/es/scenegraph/scenegraph.js.map +1 -1
- package/es/scenegraph/utils/get-hierarchy-offset.js +1 -1
- package/es/scenegraph/utils/get-hierarchy-offset.js.map +1 -1
- package/es/state/state.d.ts +2 -0
- package/es/state/state.js +7 -2
- package/es/state/state.js.map +1 -1
- package/es/tools/NumberMap.js +4 -2
- package/es/tools/NumberMap.js.map +1 -1
- package/es/tools/diff-cell.d.ts +58 -3
- package/es/tools/diff-cell.js +85 -9
- package/es/tools/diff-cell.js.map +1 -1
- package/es/tools/get-data-path/create-dataset.js +1 -1
- package/es/tools/get-data-path/create-dataset.js.map +1 -1
- package/es/ts-types/base-table.d.ts +2 -1
- package/es/ts-types/base-table.js.map +1 -1
- package/es/ts-types/list-table/define/basic-define.d.ts +1 -1
- package/es/ts-types/list-table/define/basic-define.js.map +1 -1
- package/es/ts-types/list-table/layout-map/api.d.ts +4 -4
- package/es/ts-types/list-table/layout-map/api.js.map +1 -1
- package/es/ts-types/pivot-table/dimension/basic-dimension.d.ts +2 -2
- package/es/ts-types/pivot-table/dimension/basic-dimension.js.map +1 -1
- package/es/ts-types/pivot-table/indicator/basic-indicator.d.ts +1 -1
- package/es/ts-types/pivot-table/indicator/basic-indicator.js.map +1 -1
- package/es/ts-types/table-engine.d.ts +6 -3
- package/es/ts-types/table-engine.js.map +1 -1
- package/es/vrender.js.map +1 -1
- package/package.json +4 -4
package/cjs/PivotTable.js
CHANGED
|
@@ -33,12 +33,13 @@ const ts_types_1 = require("./ts-types"), pivot_header_layout_1 = require("./lay
|
|
|
33
33
|
|
|
34
34
|
class PivotTable extends BaseTable_1.BaseTable {
|
|
35
35
|
constructor(container, options) {
|
|
36
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t;
|
|
36
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v;
|
|
37
37
|
if ("node" === env_1.Env.mode ? (options = container, container = null) : container instanceof HTMLElement || (options = container,
|
|
38
38
|
container = container.container ? container.container : null), super(container, options),
|
|
39
39
|
this.layoutNodeId = {
|
|
40
40
|
seqId: 0
|
|
41
41
|
}, options) {
|
|
42
|
+
options.rowHierarchyType || (options.rowHierarchyType = "grid"), options.columnHierarchyType || (options.columnHierarchyType = "grid"),
|
|
42
43
|
options.layout && Object.assign(options, options.layout), this.internalProps.columns = (0,
|
|
43
44
|
vutils_1.cloneDeep)(options.columns), this.internalProps.rows = (0, vutils_1.cloneDeep)(options.rows),
|
|
44
45
|
this.internalProps.indicators = (0, vutils_extension_1.cloneDeepSpec)(options.indicators),
|
|
@@ -54,7 +55,7 @@ class PivotTable extends BaseTable_1.BaseTable {
|
|
|
54
55
|
const records = this.internalProps.records;
|
|
55
56
|
if (this.internalProps.recordsIsTwoDimensionalArray = !1, (null === (_f = null == records ? void 0 : records[0]) || void 0 === _f ? void 0 : _f.constructor) === Array && (this.internalProps.recordsIsTwoDimensionalArray = !0),
|
|
56
57
|
!1 === (null === (_g = options.customConfig) || void 0 === _g ? void 0 : _g.enableDataAnalysis)) {
|
|
57
|
-
const columnDimensionTree = new tree_helper_1.DimensionTree(null !== (_h = this.internalProps.columnTree) && void 0 !== _h ? _h : [], this.layoutNodeId), rowDimensionTree = new tree_helper_1.DimensionTree(null !== (
|
|
58
|
+
const columnDimensionTree = new tree_helper_1.DimensionTree(null !== (_h = this.internalProps.columnTree) && void 0 !== _h ? _h : [], this.layoutNodeId, this.options.columnHierarchyType, "grid" !== this.options.columnHierarchyType ? null !== (_j = this.options.columnExpandLevel) && void 0 !== _j ? _j : 1 : void 0), rowDimensionTree = new tree_helper_1.DimensionTree(null !== (_k = this.internalProps.rowTree) && void 0 !== _k ? _k : [], this.layoutNodeId, this.options.rowHierarchyType, "grid" !== this.options.rowHierarchyType ? null !== (_l = this.options.rowExpandLevel) && void 0 !== _l ? _l : 1 : void 0);
|
|
58
59
|
this.internalProps.layoutMap = new pivot_header_layout_1.PivotHeaderLayoutMap(this, null, columnDimensionTree, rowDimensionTree),
|
|
59
60
|
!1 === this.internalProps.recordsIsTwoDimensionalArray && (this.flatDataToObjects = new flatDataToObject_1.FlatDataToObjects({
|
|
60
61
|
rows: this.internalProps.layoutMap.fullRowDimensionKeys,
|
|
@@ -66,31 +67,31 @@ class PivotTable extends BaseTable_1.BaseTable {
|
|
|
66
67
|
} else {
|
|
67
68
|
const keysResults = (0, layout_helper_1.parseColKeyRowKeyForPivotTable)(this, options), {rowKeys: rowKeys, columnKeys: columnKeys, indicatorKeys: indicatorKeys} = keysResults;
|
|
68
69
|
let {columnDimensionTree: columnDimensionTree, rowDimensionTree: rowDimensionTree} = keysResults;
|
|
69
|
-
this.dataset = new dataset_1.Dataset(this.internalProps.dataConfig, rowKeys, columnKeys, indicatorKeys, this.internalProps.indicators, null === (
|
|
70
|
+
this.dataset = new dataset_1.Dataset(this.internalProps.dataConfig, rowKeys, columnKeys, indicatorKeys, this.internalProps.indicators, null === (_m = options.indicatorsAsCol) || void 0 === _m || _m, options.records, options.rowHierarchyType, options.columnHierarchyType, this.internalProps.columnTree, this.internalProps.rowTree, !1, !!options.extensionRows, !!options.parseCustomTreeToMatchRecords),
|
|
70
71
|
options.columnTree ? columnDimensionTree.hasHideNode && ((0, layout_helper_1.deleteHideIndicatorNode)(columnDimensionTree.tree.children, options.indicators, !0, this),
|
|
71
72
|
columnDimensionTree.reset(columnDimensionTree.tree.children)) : (!1 !== options.indicatorsAsCol && (this.dataset.colHeaderTree = (0,
|
|
72
73
|
layout_helper_1.supplementIndicatorNodesForCustomTree)(this.dataset.colHeaderTree, options.indicators)),
|
|
73
74
|
!1 !== options.indicatorsAsCol && options.indicators && this.dataset.colHeaderTree && (0,
|
|
74
75
|
layout_helper_1.deleteHideIndicatorNode)(this.dataset.colHeaderTree, options.indicators, !1, this),
|
|
75
|
-
columnDimensionTree = new tree_helper_1.DimensionTree(null !== (
|
|
76
|
+
columnDimensionTree = new tree_helper_1.DimensionTree(null !== (_o = this.dataset.colHeaderTree) && void 0 !== _o ? _o : [], this.layoutNodeId, this.options.columnHierarchyType, "grid" !== this.options.columnHierarchyType ? null !== (_p = this.options.columnExpandLevel) && void 0 !== _p ? _p : 1 : void 0)),
|
|
76
77
|
options.rowTree ? rowDimensionTree.hasHideNode && ((0, layout_helper_1.deleteHideIndicatorNode)(rowDimensionTree.tree.children, options.indicators, !0, this),
|
|
77
78
|
rowDimensionTree.reset(rowDimensionTree.tree.children)) : (!1 === options.indicatorsAsCol && (this.dataset.rowHeaderTree = (0,
|
|
78
79
|
layout_helper_1.supplementIndicatorNodesForCustomTree)(this.dataset.rowHeaderTree, options.indicators)),
|
|
79
80
|
!1 === options.indicatorsAsCol && this.dataset.rowHeaderTree && options.indicators && (0,
|
|
80
81
|
layout_helper_1.deleteHideIndicatorNode)(this.dataset.rowHeaderTree, options.indicators, !1, this),
|
|
81
|
-
rowDimensionTree = new tree_helper_1.DimensionTree(null !== (
|
|
82
|
+
rowDimensionTree = new tree_helper_1.DimensionTree(null !== (_q = this.dataset.rowHeaderTree) && void 0 !== _q ? _q : [], this.layoutNodeId, this.options.rowHierarchyType, "grid" !== this.options.rowHierarchyType ? null !== (_r = this.options.rowExpandLevel) && void 0 !== _r ? _r : 1 : void 0)),
|
|
82
83
|
this.internalProps.layoutMap = new pivot_header_layout_1.PivotHeaderLayoutMap(this, this.dataset, columnDimensionTree, rowDimensionTree);
|
|
83
84
|
}
|
|
84
|
-
if (this._changePivotSortStateBySortRules(), (null !== (
|
|
85
|
+
if (this._changePivotSortStateBySortRules(), (null !== (_t = null === (_s = options.pivotSortState) || void 0 === _s ? void 0 : _s.length) && void 0 !== _t ? _t : 0) > 0 && (this.pivotSortState = [],
|
|
85
86
|
this.pivotSortState = options.pivotSortState), "node" !== env_1.Env.mode && (this.editorManager = new edit_manager_1.EditManager(this)),
|
|
86
87
|
this.refreshHeader(), this.internalProps.useOneRowHeightFillAll = !1, this.stateManager.initCheckedState(records),
|
|
87
88
|
this.scenegraph.createSceneGraph(), options.title) {
|
|
88
89
|
const Title = factory_1.Factory.getComponent("title");
|
|
89
90
|
this.internalProps.title = new Title(options.title, this), this.scenegraph.resize();
|
|
90
91
|
}
|
|
91
|
-
if (this.options.emptyTip) if (this.internalProps.emptyTip) null === (
|
|
92
|
+
if (this.options.emptyTip) if (this.internalProps.emptyTip) null === (_u = this.internalProps.emptyTip) || void 0 === _u || _u.resetVisible(); else {
|
|
92
93
|
const EmptyTip = factory_1.Factory.getComponent("emptyTip");
|
|
93
|
-
this.internalProps.emptyTip = new EmptyTip(this.options.emptyTip, this), null === (
|
|
94
|
+
this.internalProps.emptyTip = new EmptyTip(this.options.emptyTip, this), null === (_v = this.internalProps.emptyTip) || void 0 === _v || _v.resetVisible();
|
|
94
95
|
}
|
|
95
96
|
setTimeout((() => {
|
|
96
97
|
this.fireListeners(TABLE_EVENT_TYPE_1.TABLE_EVENT_TYPE.INITIALIZED, null);
|
|
@@ -125,9 +126,10 @@ class PivotTable extends BaseTable_1.BaseTable {
|
|
|
125
126
|
return ifCan;
|
|
126
127
|
}
|
|
127
128
|
updateOption(options) {
|
|
128
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v;
|
|
129
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x;
|
|
129
130
|
const internalProps = this.internalProps;
|
|
130
|
-
if (super.updateOption(options),
|
|
131
|
+
if (super.updateOption(options), options.rowHierarchyType || (options.rowHierarchyType = "grid"),
|
|
132
|
+
options.columnHierarchyType || (options.columnHierarchyType = "grid"), this.layoutNodeId = {
|
|
131
133
|
seqId: 0
|
|
132
134
|
}, this.internalProps.columns = (0, vutils_1.cloneDeep)(options.columns), this.internalProps.rows = (0,
|
|
133
135
|
vutils_1.cloneDeep)(options.rows), this.internalProps.indicators = (null === (_a = options.indicators) || void 0 === _a ? void 0 : _a.length) ? (0,
|
|
@@ -141,7 +143,7 @@ class PivotTable extends BaseTable_1.BaseTable {
|
|
|
141
143
|
internalProps.rowResizeType = null !== (_f = options.rowResizeType) && void 0 !== _f ? _f : "row",
|
|
142
144
|
internalProps.dataConfig = (0, vutils_1.cloneDeep)(options.dataConfig), this.internalProps.columnWidthConfig = options.columnWidthConfig,
|
|
143
145
|
this.internalProps.columnWidthConfigForRowHeader = options.columnWidthConfigForRowHeader,
|
|
144
|
-
"
|
|
146
|
+
"grid" !== (null == options ? void 0 : options.rowHierarchyType) && "grid" !== this.internalProps.layoutMap.rowHierarchyType && this.internalProps.layoutMap.rowExpandLevel === (null == options ? void 0 : options.rowExpandLevel)) {
|
|
145
147
|
const beforeRowDimensions = this.internalProps.layoutMap.rowDimensionTree.tree.children;
|
|
146
148
|
null === (_g = this.internalProps.rowTree) || void 0 === _g || _g.forEach(((node, index) => {
|
|
147
149
|
const beforeRowDimension = beforeRowDimensions.find((item => item.dimensionKey === node.dimensionKey && item.value === node.value));
|
|
@@ -152,8 +154,8 @@ class PivotTable extends BaseTable_1.BaseTable {
|
|
|
152
154
|
if (this.internalProps.recordsIsTwoDimensionalArray = !1, (null === (_h = null == records ? void 0 : records[0]) || void 0 === _h ? void 0 : _h.constructor) === Array && (this.internalProps.recordsIsTwoDimensionalArray = !0),
|
|
153
155
|
!1 === (null === (_j = options.customConfig) || void 0 === _j ? void 0 : _j.enableDataAnalysis)) {
|
|
154
156
|
let columnDimensionTree, rowDimensionTree;
|
|
155
|
-
options.columnTree && (columnDimensionTree = new tree_helper_1.DimensionTree(null !== (_k = this.internalProps.columnTree) && void 0 !== _k ? _k : [], this.layoutNodeId)),
|
|
156
|
-
options.rowTree && (rowDimensionTree = new tree_helper_1.DimensionTree(null !== (
|
|
157
|
+
options.columnTree && (columnDimensionTree = new tree_helper_1.DimensionTree(null !== (_k = this.internalProps.columnTree) && void 0 !== _k ? _k : [], this.layoutNodeId, this.options.columnHierarchyType, "grid" !== this.options.columnHierarchyType ? null !== (_l = this.options.columnExpandLevel) && void 0 !== _l ? _l : 1 : void 0)),
|
|
158
|
+
options.rowTree && (rowDimensionTree = new tree_helper_1.DimensionTree(null !== (_m = this.internalProps.rowTree) && void 0 !== _m ? _m : [], this.layoutNodeId, this.options.rowHierarchyType, "grid" !== this.options.rowHierarchyType ? null !== (_o = this.options.rowExpandLevel) && void 0 !== _o ? _o : 1 : void 0)),
|
|
157
159
|
internalProps.layoutMap = new pivot_header_layout_1.PivotHeaderLayoutMap(this, null, columnDimensionTree, rowDimensionTree),
|
|
158
160
|
!1 === this.internalProps.recordsIsTwoDimensionalArray && (this.flatDataToObjects = new flatDataToObject_1.FlatDataToObjects({
|
|
159
161
|
rows: internalProps.layoutMap.fullRowDimensionKeys,
|
|
@@ -165,22 +167,22 @@ class PivotTable extends BaseTable_1.BaseTable {
|
|
|
165
167
|
} else {
|
|
166
168
|
const keysResults = (0, layout_helper_1.parseColKeyRowKeyForPivotTable)(this, options), {rowKeys: rowKeys, columnKeys: columnKeys, indicatorKeys: indicatorKeys} = keysResults;
|
|
167
169
|
let {columnDimensionTree: columnDimensionTree, rowDimensionTree: rowDimensionTree} = keysResults;
|
|
168
|
-
this.dataset = new dataset_1.Dataset(internalProps.dataConfig, rowKeys, columnKeys, indicatorKeys, this.internalProps.indicators, null === (
|
|
170
|
+
this.dataset = new dataset_1.Dataset(internalProps.dataConfig, rowKeys, columnKeys, indicatorKeys, this.internalProps.indicators, null === (_p = options.indicatorsAsCol) || void 0 === _p || _p, records, options.rowHierarchyType, options.columnHierarchyType, this.internalProps.columnTree, this.internalProps.rowTree, !1, !!options.extensionRows, !!options.parseCustomTreeToMatchRecords),
|
|
169
171
|
options.columnTree ? columnDimensionTree.hasHideNode && ((0, layout_helper_1.deleteHideIndicatorNode)(columnDimensionTree.tree.children, options.indicators, !0, this),
|
|
170
172
|
columnDimensionTree.reset(columnDimensionTree.tree.children)) : (!1 !== options.indicatorsAsCol && (this.dataset.colHeaderTree = (0,
|
|
171
173
|
layout_helper_1.supplementIndicatorNodesForCustomTree)(this.dataset.colHeaderTree, options.indicators)),
|
|
172
174
|
!1 !== options.indicatorsAsCol && options.indicators && this.dataset.colHeaderTree && (0,
|
|
173
175
|
layout_helper_1.deleteHideIndicatorNode)(this.dataset.colHeaderTree, options.indicators, !1, this),
|
|
174
|
-
columnDimensionTree = new tree_helper_1.DimensionTree(null !== (
|
|
176
|
+
columnDimensionTree = new tree_helper_1.DimensionTree(null !== (_q = this.dataset.colHeaderTree) && void 0 !== _q ? _q : [], this.layoutNodeId, this.options.columnHierarchyType, "grid" !== this.options.columnHierarchyType ? null !== (_r = this.options.columnExpandLevel) && void 0 !== _r ? _r : 1 : void 0)),
|
|
175
177
|
options.rowTree ? rowDimensionTree.hasHideNode && ((0, layout_helper_1.deleteHideIndicatorNode)(rowDimensionTree.tree.children, options.indicators, !0, this),
|
|
176
178
|
rowDimensionTree.reset(rowDimensionTree.tree.children)) : (!1 === options.indicatorsAsCol && (this.dataset.rowHeaderTree = (0,
|
|
177
179
|
layout_helper_1.supplementIndicatorNodesForCustomTree)(this.dataset.rowHeaderTree, options.indicators)),
|
|
178
180
|
!1 === options.indicatorsAsCol && this.dataset.rowHeaderTree && options.indicators && (0,
|
|
179
181
|
layout_helper_1.deleteHideIndicatorNode)(this.dataset.rowHeaderTree, options.indicators, !1, this),
|
|
180
|
-
rowDimensionTree = new tree_helper_1.DimensionTree(null !== (
|
|
182
|
+
rowDimensionTree = new tree_helper_1.DimensionTree(null !== (_s = this.dataset.rowHeaderTree) && void 0 !== _s ? _s : [], this.layoutNodeId, this.options.rowHierarchyType, "grid" !== this.options.rowHierarchyType ? null !== (_t = this.options.rowExpandLevel) && void 0 !== _t ? _t : 1 : void 0)),
|
|
181
183
|
internalProps.layoutMap = new pivot_header_layout_1.PivotHeaderLayoutMap(this, this.dataset, columnDimensionTree, rowDimensionTree);
|
|
182
184
|
}
|
|
183
|
-
if (this._changePivotSortStateBySortRules(), (null !== (
|
|
185
|
+
if (this._changePivotSortStateBySortRules(), (null !== (_v = null === (_u = options.pivotSortState) || void 0 === _u ? void 0 : _u.length) && void 0 !== _v ? _v : 0) > 0 && (this.pivotSortState = [],
|
|
184
186
|
this.pivotSortState = options.pivotSortState), this.refreshHeader(), this.internalProps.useOneRowHeightFillAll = !1,
|
|
185
187
|
internalProps.releaseList && (internalProps.releaseList.forEach((releaseObj => {
|
|
186
188
|
var _a;
|
|
@@ -190,9 +192,9 @@ class PivotTable extends BaseTable_1.BaseTable {
|
|
|
190
192
|
const Title = factory_1.Factory.getComponent("title");
|
|
191
193
|
this.internalProps.title = new Title(options.title, this), this.scenegraph.resize();
|
|
192
194
|
}
|
|
193
|
-
if (this.options.emptyTip) if (this.internalProps.emptyTip) null === (
|
|
195
|
+
if (this.options.emptyTip) if (this.internalProps.emptyTip) null === (_w = this.internalProps.emptyTip) || void 0 === _w || _w.resetVisible(); else {
|
|
194
196
|
const EmptyTip = factory_1.Factory.getComponent("emptyTip");
|
|
195
|
-
this.internalProps.emptyTip = new EmptyTip(this.options.emptyTip, this), null === (
|
|
197
|
+
this.internalProps.emptyTip = new EmptyTip(this.options.emptyTip, this), null === (_x = this.internalProps.emptyTip) || void 0 === _x || _x.resetVisible();
|
|
196
198
|
}
|
|
197
199
|
return new Promise((resolve => {
|
|
198
200
|
setTimeout(resolve, 0);
|
|
@@ -220,12 +222,15 @@ class PivotTable extends BaseTable_1.BaseTable {
|
|
|
220
222
|
table.frozenRowCount = Math.max(layoutMap.headerLevelCount, null !== (_d = this.options.frozenRowCount) && void 0 !== _d ? _d : 0),
|
|
221
223
|
table.bottomFrozenRowCount !== (null !== (_e = this.options.bottomFrozenRowCount) && void 0 !== _e ? _e : 0) && (table.bottomFrozenRowCount = null !== (_f = this.options.bottomFrozenRowCount) && void 0 !== _f ? _f : 0),
|
|
222
224
|
table.rightFrozenColCount !== (null !== (_g = this.options.rightFrozenColCount) && void 0 !== _g ? _g : 0) && (table.rightFrozenColCount = null !== (_h = this.options.rightFrozenColCount) && void 0 !== _h ? _h : 0),
|
|
223
|
-
this.stateManager.setFrozenCol(this.internalProps.frozenColCount));
|
|
225
|
+
this.stateManager.setFrozenCol(this.internalProps.frozenColCount), this.stateManager.setFrozenRow(this.frozenRowCount));
|
|
224
226
|
}
|
|
225
227
|
_getSortFuncFromHeaderOption(columns, field, fieldKey) {}
|
|
226
228
|
get rowHierarchyType() {
|
|
227
229
|
return this.internalProps.layoutMap.rowHierarchyType;
|
|
228
230
|
}
|
|
231
|
+
get columnHierarchyType() {
|
|
232
|
+
return this.internalProps.layoutMap.columnHierarchyType;
|
|
233
|
+
}
|
|
229
234
|
_syncHierarchyState(sourceNode, targetNode) {
|
|
230
235
|
var _a, _b;
|
|
231
236
|
sourceNode.value === targetNode.value && sourceNode.dimensionKey === targetNode.dimensionKey && (targetNode.hierarchyState = null !== (_a = targetNode.hierarchyState) && void 0 !== _a ? _a : (null == targetNode ? void 0 : targetNode.children) ? sourceNode.hierarchyState : void 0,
|
|
@@ -655,19 +660,25 @@ class PivotTable extends BaseTable_1.BaseTable {
|
|
|
655
660
|
}
|
|
656
661
|
_refreshHierarchyState(col, row, recalculateColWidths = !0, beforeUpdateCell) {
|
|
657
662
|
var _a, _b;
|
|
663
|
+
this.frozenColCount, this.frozenRowCount;
|
|
664
|
+
const visibleStartRow = this.getBodyVisibleRowRange().rowStart;
|
|
665
|
+
this.internalProps._oldRowCount = this.rowCount, this.internalProps._oldColCount = this.colCount;
|
|
658
666
|
let notFillWidth = !1, notFillHeight = !1;
|
|
659
667
|
this.stateManager.updateHoverIcon(col, row, void 0, void 0);
|
|
660
668
|
const checkHasChart = this.internalProps.layoutMap.checkHasChart();
|
|
661
669
|
checkHasChart && (this.autoFillWidth && (notFillWidth = this.getAllColsWidth() <= this.tableNoFrameWidth),
|
|
662
670
|
this.autoFillHeight && (notFillHeight = this.getAllRowsHeight() <= this.tableNoFrameHeight));
|
|
663
|
-
const result = this.internalProps.layoutMap.toggleHierarchyState(col, row);
|
|
664
|
-
beforeUpdateCell && beforeUpdateCell(), this.refreshRowColCount()
|
|
665
|
-
this.
|
|
666
|
-
this.
|
|
671
|
+
const result = this.internalProps.layoutMap.isRowHeader(col, row) ? this.internalProps.layoutMap.toggleHierarchyState(col, row) : this.internalProps.layoutMap.toggleHierarchyStateForColumnTree(col, row);
|
|
672
|
+
beforeUpdateCell && beforeUpdateCell(), this.refreshRowColCount();
|
|
673
|
+
this.frozenColCount, this.frozenRowCount;
|
|
674
|
+
this.clearCellStyleCache(), "tree" === this.rowHierarchyType && this.scenegraph.updateHierarchyIcon(col, row),
|
|
675
|
+
null === (_a = this.reactCustomLayout) || void 0 === _a || _a.clearCache(), "grid-tree" !== this.rowHierarchyType && "grid-tree" !== this.columnHierarchyType ? this.scenegraph.updateRow(result.removeCellPositionsRowDirection, result.addCellPositionsRowDirection, result.updateCellPositionsRowDirection, recalculateColWidths) : (this.scenegraph.clearCells(),
|
|
676
|
+
this.clearCellStyleCache(), this.scenegraph.createSceneGraph(), this.scrollToRow(visibleStartRow)),
|
|
667
677
|
null === (_b = this.reactCustomLayout) || void 0 === _b || _b.updateAllCustomCell(),
|
|
668
678
|
checkHasChart && (this.autoFillWidth && !notFillWidth && (notFillWidth = this.getAllColsWidth() <= this.tableNoFrameWidth),
|
|
669
679
|
this.autoFillHeight && !notFillHeight && (notFillHeight = this.getAllRowsHeight() <= this.tableNoFrameHeight),
|
|
670
|
-
("adaptive" === this.widthMode || notFillWidth || "adaptive" === this.heightMode || notFillHeight) && this.scenegraph.updateChartSizeForResizeColWidth(-1))
|
|
680
|
+
("adaptive" === this.widthMode || notFillWidth || "adaptive" === this.heightMode || notFillHeight) && this.scenegraph.updateChartSizeForResizeColWidth(-1)),
|
|
681
|
+
this.internalProps._oldRowCount = void 0, this.internalProps._oldColCount = void 0;
|
|
671
682
|
}
|
|
672
683
|
getHeaderCellAddressByPath(dimensionPaths) {
|
|
673
684
|
return this.internalProps.layoutMap.getPivotCellAdress(dimensionPaths);
|
|
@@ -699,9 +710,6 @@ class PivotTable extends BaseTable_1.BaseTable {
|
|
|
699
710
|
getCellHeaderTreeNodes(col, row) {
|
|
700
711
|
return this.internalProps.layoutMap.getCellHeaderPathsWithTreeNode(col, row);
|
|
701
712
|
}
|
|
702
|
-
_hasHierarchyTreeHeader() {
|
|
703
|
-
return "tree" === this.internalProps.layoutMap.rowHierarchyType;
|
|
704
|
-
}
|
|
705
713
|
getMenuInfo(col, row, type) {
|
|
706
714
|
const dimensionInfos = this.internalProps.layoutMap.getPivotDimensionInfo(col, row);
|
|
707
715
|
return {
|
|
@@ -713,7 +721,7 @@ class PivotTable extends BaseTable_1.BaseTable {
|
|
|
713
721
|
};
|
|
714
722
|
}
|
|
715
723
|
setRecords(records) {
|
|
716
|
-
var _a, _b, _c, _d, _e, _f, _g;
|
|
724
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
717
725
|
const oldHoverState = {
|
|
718
726
|
col: this.stateManager.hover.cellPos.col,
|
|
719
727
|
row: this.stateManager.hover.cellPos.row
|
|
@@ -731,10 +739,10 @@ class PivotTable extends BaseTable_1.BaseTable {
|
|
|
731
739
|
let columnDimensionTree, rowDimensionTree;
|
|
732
740
|
this.dataset.setRecords(records), options.columnTree ? columnDimensionTree = internalProps.layoutMap.columnDimensionTree : (!1 !== options.indicatorsAsCol && options.indicators && this.dataset.colHeaderTree && (0,
|
|
733
741
|
layout_helper_1.deleteHideIndicatorNode)(this.dataset.colHeaderTree, options.indicators, !1, this),
|
|
734
|
-
columnDimensionTree = new tree_helper_1.DimensionTree(null !== (_c = this.dataset.colHeaderTree) && void 0 !== _c ? _c : [], this.layoutNodeId)),
|
|
742
|
+
columnDimensionTree = new tree_helper_1.DimensionTree(null !== (_c = this.dataset.colHeaderTree) && void 0 !== _c ? _c : [], this.layoutNodeId, this.options.columnHierarchyType, "grid" !== this.options.columnHierarchyType ? null !== (_d = this.options.columnExpandLevel) && void 0 !== _d ? _d : 1 : void 0)),
|
|
735
743
|
options.rowTree ? rowDimensionTree = internalProps.layoutMap.rowDimensionTree : (!1 === options.indicatorsAsCol && this.dataset.rowHeaderTree && options.indicators && (0,
|
|
736
744
|
layout_helper_1.deleteHideIndicatorNode)(this.dataset.rowHeaderTree, options.indicators, !1, this),
|
|
737
|
-
rowDimensionTree = new tree_helper_1.DimensionTree(null !== (
|
|
745
|
+
rowDimensionTree = new tree_helper_1.DimensionTree(null !== (_e = this.dataset.rowHeaderTree) && void 0 !== _e ? _e : [], this.layoutNodeId, this.options.rowHierarchyType, "grid" !== this.options.rowHierarchyType ? null !== (_f = this.options.rowExpandLevel) && void 0 !== _f ? _f : 1 : void 0)),
|
|
738
746
|
internalProps.layoutMap = new pivot_header_layout_1.PivotHeaderLayoutMap(this, this.dataset, columnDimensionTree, rowDimensionTree),
|
|
739
747
|
this.pivotSortState = [], options.pivotSortState && (this.pivotSortState = options.pivotSortState);
|
|
740
748
|
}
|
|
@@ -742,9 +750,9 @@ class PivotTable extends BaseTable_1.BaseTable {
|
|
|
742
750
|
this.clearCellStyleCache(), this.scenegraph.createSceneGraph(), this.stateManager.updateHoverPos(oldHoverState.col, oldHoverState.row),
|
|
743
751
|
this.internalProps.title && !this.internalProps.title.isReleased && (this._updateSize(),
|
|
744
752
|
this.internalProps.title.resize(), this.scenegraph.resize()), this.eventManager.updateEventBinder(),
|
|
745
|
-
this.options.emptyTip) if (this.internalProps.emptyTip) null === (
|
|
753
|
+
this.options.emptyTip) if (this.internalProps.emptyTip) null === (_g = this.internalProps.emptyTip) || void 0 === _g || _g.resetVisible(); else {
|
|
746
754
|
const EmptyTip = factory_1.Factory.getComponent("emptyTip");
|
|
747
|
-
this.internalProps.emptyTip = new EmptyTip(this.options.emptyTip, this), null === (
|
|
755
|
+
this.internalProps.emptyTip = new EmptyTip(this.options.emptyTip, this), null === (_h = this.internalProps.emptyTip) || void 0 === _h || _h.resetVisible();
|
|
748
756
|
}
|
|
749
757
|
}
|
|
750
758
|
startEditCell(col, row, value) {
|