@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/es/PivotTable.js
CHANGED
|
@@ -38,12 +38,13 @@ import { Factory } from "./core/factory";
|
|
|
38
38
|
|
|
39
39
|
export class PivotTable extends BaseTable {
|
|
40
40
|
constructor(container, options) {
|
|
41
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t;
|
|
41
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v;
|
|
42
42
|
if ("node" === Env.mode ? (options = container, container = null) : container instanceof HTMLElement || (options = container,
|
|
43
43
|
container = container.container ? container.container : null), super(container, options),
|
|
44
44
|
this.layoutNodeId = {
|
|
45
45
|
seqId: 0
|
|
46
46
|
}, options) {
|
|
47
|
+
options.rowHierarchyType || (options.rowHierarchyType = "grid"), options.columnHierarchyType || (options.columnHierarchyType = "grid"),
|
|
47
48
|
options.layout && Object.assign(options, options.layout), this.internalProps.columns = cloneDeep(options.columns),
|
|
48
49
|
this.internalProps.rows = cloneDeep(options.rows), this.internalProps.indicators = cloneDeepSpec(options.indicators),
|
|
49
50
|
null === (_a = options.indicators) || void 0 === _a || _a.forEach(((indicatorDefine, index) => {
|
|
@@ -58,7 +59,7 @@ export class PivotTable extends BaseTable {
|
|
|
58
59
|
const records = this.internalProps.records;
|
|
59
60
|
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),
|
|
60
61
|
!1 === (null === (_g = options.customConfig) || void 0 === _g ? void 0 : _g.enableDataAnalysis)) {
|
|
61
|
-
const columnDimensionTree = new DimensionTree(null !== (_h = this.internalProps.columnTree) && void 0 !== _h ? _h : [], this.layoutNodeId), rowDimensionTree = new DimensionTree(null !== (
|
|
62
|
+
const columnDimensionTree = new 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 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);
|
|
62
63
|
this.internalProps.layoutMap = new PivotHeaderLayoutMap(this, null, columnDimensionTree, rowDimensionTree),
|
|
63
64
|
!1 === this.internalProps.recordsIsTwoDimensionalArray && (this.flatDataToObjects = new FlatDataToObjects({
|
|
64
65
|
rows: this.internalProps.layoutMap.fullRowDimensionKeys,
|
|
@@ -70,27 +71,27 @@ export class PivotTable extends BaseTable {
|
|
|
70
71
|
} else {
|
|
71
72
|
const keysResults = parseColKeyRowKeyForPivotTable(this, options), {rowKeys: rowKeys, columnKeys: columnKeys, indicatorKeys: indicatorKeys} = keysResults;
|
|
72
73
|
let {columnDimensionTree: columnDimensionTree, rowDimensionTree: rowDimensionTree} = keysResults;
|
|
73
|
-
this.dataset = new Dataset(this.internalProps.dataConfig, rowKeys, columnKeys, indicatorKeys, this.internalProps.indicators, null === (
|
|
74
|
+
this.dataset = new 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),
|
|
74
75
|
options.columnTree ? columnDimensionTree.hasHideNode && (deleteHideIndicatorNode(columnDimensionTree.tree.children, options.indicators, !0, this),
|
|
75
76
|
columnDimensionTree.reset(columnDimensionTree.tree.children)) : (!1 !== options.indicatorsAsCol && (this.dataset.colHeaderTree = supplementIndicatorNodesForCustomTree(this.dataset.colHeaderTree, options.indicators)),
|
|
76
77
|
!1 !== options.indicatorsAsCol && options.indicators && this.dataset.colHeaderTree && deleteHideIndicatorNode(this.dataset.colHeaderTree, options.indicators, !1, this),
|
|
77
|
-
columnDimensionTree = new DimensionTree(null !== (
|
|
78
|
+
columnDimensionTree = new 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)),
|
|
78
79
|
options.rowTree ? rowDimensionTree.hasHideNode && (deleteHideIndicatorNode(rowDimensionTree.tree.children, options.indicators, !0, this),
|
|
79
80
|
rowDimensionTree.reset(rowDimensionTree.tree.children)) : (!1 === options.indicatorsAsCol && (this.dataset.rowHeaderTree = supplementIndicatorNodesForCustomTree(this.dataset.rowHeaderTree, options.indicators)),
|
|
80
81
|
!1 === options.indicatorsAsCol && this.dataset.rowHeaderTree && options.indicators && deleteHideIndicatorNode(this.dataset.rowHeaderTree, options.indicators, !1, this),
|
|
81
|
-
rowDimensionTree = new DimensionTree(null !== (
|
|
82
|
+
rowDimensionTree = new 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 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.mode && (this.editorManager = new 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.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.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.INITIALIZED, null);
|
|
@@ -125,9 +126,10 @@ export class PivotTable extends 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 = cloneDeep(options.columns), this.internalProps.rows = cloneDeep(options.rows),
|
|
133
135
|
this.internalProps.indicators = (null === (_a = options.indicators) || void 0 === _a ? void 0 : _a.length) ? cloneDeepSpec(options.indicators) : [],
|
|
@@ -141,7 +143,7 @@ export class PivotTable extends BaseTable {
|
|
|
141
143
|
internalProps.rowResizeType = null !== (_f = options.rowResizeType) && void 0 !== _f ? _f : "row",
|
|
142
144
|
internalProps.dataConfig = 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 @@ export class PivotTable extends 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 DimensionTree(null !== (_k = this.internalProps.columnTree) && void 0 !== _k ? _k : [], this.layoutNodeId)),
|
|
156
|
-
options.rowTree && (rowDimensionTree = new DimensionTree(null !== (
|
|
157
|
+
options.columnTree && (columnDimensionTree = new 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 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 PivotHeaderLayoutMap(this, null, columnDimensionTree, rowDimensionTree),
|
|
158
160
|
!1 === this.internalProps.recordsIsTwoDimensionalArray && (this.flatDataToObjects = new FlatDataToObjects({
|
|
159
161
|
rows: internalProps.layoutMap.fullRowDimensionKeys,
|
|
@@ -165,18 +167,18 @@ export class PivotTable extends BaseTable {
|
|
|
165
167
|
} else {
|
|
166
168
|
const keysResults = parseColKeyRowKeyForPivotTable(this, options), {rowKeys: rowKeys, columnKeys: columnKeys, indicatorKeys: indicatorKeys} = keysResults;
|
|
167
169
|
let {columnDimensionTree: columnDimensionTree, rowDimensionTree: rowDimensionTree} = keysResults;
|
|
168
|
-
this.dataset = new Dataset(internalProps.dataConfig, rowKeys, columnKeys, indicatorKeys, this.internalProps.indicators, null === (
|
|
170
|
+
this.dataset = new 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 && (deleteHideIndicatorNode(columnDimensionTree.tree.children, options.indicators, !0, this),
|
|
170
172
|
columnDimensionTree.reset(columnDimensionTree.tree.children)) : (!1 !== options.indicatorsAsCol && (this.dataset.colHeaderTree = supplementIndicatorNodesForCustomTree(this.dataset.colHeaderTree, options.indicators)),
|
|
171
173
|
!1 !== options.indicatorsAsCol && options.indicators && this.dataset.colHeaderTree && deleteHideIndicatorNode(this.dataset.colHeaderTree, options.indicators, !1, this),
|
|
172
|
-
columnDimensionTree = new DimensionTree(null !== (
|
|
174
|
+
columnDimensionTree = new 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)),
|
|
173
175
|
options.rowTree ? rowDimensionTree.hasHideNode && (deleteHideIndicatorNode(rowDimensionTree.tree.children, options.indicators, !0, this),
|
|
174
176
|
rowDimensionTree.reset(rowDimensionTree.tree.children)) : (!1 === options.indicatorsAsCol && (this.dataset.rowHeaderTree = supplementIndicatorNodesForCustomTree(this.dataset.rowHeaderTree, options.indicators)),
|
|
175
177
|
!1 === options.indicatorsAsCol && this.dataset.rowHeaderTree && options.indicators && deleteHideIndicatorNode(this.dataset.rowHeaderTree, options.indicators, !1, this),
|
|
176
|
-
rowDimensionTree = new DimensionTree(null !== (
|
|
178
|
+
rowDimensionTree = new 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)),
|
|
177
179
|
internalProps.layoutMap = new PivotHeaderLayoutMap(this, this.dataset, columnDimensionTree, rowDimensionTree);
|
|
178
180
|
}
|
|
179
|
-
if (this._changePivotSortStateBySortRules(), (null !== (
|
|
181
|
+
if (this._changePivotSortStateBySortRules(), (null !== (_v = null === (_u = options.pivotSortState) || void 0 === _u ? void 0 : _u.length) && void 0 !== _v ? _v : 0) > 0 && (this.pivotSortState = [],
|
|
180
182
|
this.pivotSortState = options.pivotSortState), this.refreshHeader(), this.internalProps.useOneRowHeightFillAll = !1,
|
|
181
183
|
internalProps.releaseList && (internalProps.releaseList.forEach((releaseObj => {
|
|
182
184
|
var _a;
|
|
@@ -186,9 +188,9 @@ export class PivotTable extends BaseTable {
|
|
|
186
188
|
const Title = Factory.getComponent("title");
|
|
187
189
|
this.internalProps.title = new Title(options.title, this), this.scenegraph.resize();
|
|
188
190
|
}
|
|
189
|
-
if (this.options.emptyTip) if (this.internalProps.emptyTip) null === (
|
|
191
|
+
if (this.options.emptyTip) if (this.internalProps.emptyTip) null === (_w = this.internalProps.emptyTip) || void 0 === _w || _w.resetVisible(); else {
|
|
190
192
|
const EmptyTip = Factory.getComponent("emptyTip");
|
|
191
|
-
this.internalProps.emptyTip = new EmptyTip(this.options.emptyTip, this), null === (
|
|
193
|
+
this.internalProps.emptyTip = new EmptyTip(this.options.emptyTip, this), null === (_x = this.internalProps.emptyTip) || void 0 === _x || _x.resetVisible();
|
|
192
194
|
}
|
|
193
195
|
return new Promise((resolve => {
|
|
194
196
|
setTimeout(resolve, 0);
|
|
@@ -216,12 +218,15 @@ export class PivotTable extends BaseTable {
|
|
|
216
218
|
table.frozenRowCount = Math.max(layoutMap.headerLevelCount, null !== (_d = this.options.frozenRowCount) && void 0 !== _d ? _d : 0),
|
|
217
219
|
table.bottomFrozenRowCount !== (null !== (_e = this.options.bottomFrozenRowCount) && void 0 !== _e ? _e : 0) && (table.bottomFrozenRowCount = null !== (_f = this.options.bottomFrozenRowCount) && void 0 !== _f ? _f : 0),
|
|
218
220
|
table.rightFrozenColCount !== (null !== (_g = this.options.rightFrozenColCount) && void 0 !== _g ? _g : 0) && (table.rightFrozenColCount = null !== (_h = this.options.rightFrozenColCount) && void 0 !== _h ? _h : 0),
|
|
219
|
-
this.stateManager.setFrozenCol(this.internalProps.frozenColCount));
|
|
221
|
+
this.stateManager.setFrozenCol(this.internalProps.frozenColCount), this.stateManager.setFrozenRow(this.frozenRowCount));
|
|
220
222
|
}
|
|
221
223
|
_getSortFuncFromHeaderOption(columns, field, fieldKey) {}
|
|
222
224
|
get rowHierarchyType() {
|
|
223
225
|
return this.internalProps.layoutMap.rowHierarchyType;
|
|
224
226
|
}
|
|
227
|
+
get columnHierarchyType() {
|
|
228
|
+
return this.internalProps.layoutMap.columnHierarchyType;
|
|
229
|
+
}
|
|
225
230
|
_syncHierarchyState(sourceNode, targetNode) {
|
|
226
231
|
var _a, _b;
|
|
227
232
|
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,
|
|
@@ -650,19 +655,25 @@ export class PivotTable extends BaseTable {
|
|
|
650
655
|
}
|
|
651
656
|
_refreshHierarchyState(col, row, recalculateColWidths = !0, beforeUpdateCell) {
|
|
652
657
|
var _a, _b;
|
|
658
|
+
this.frozenColCount, this.frozenRowCount;
|
|
659
|
+
const visibleStartRow = this.getBodyVisibleRowRange().rowStart;
|
|
660
|
+
this.internalProps._oldRowCount = this.rowCount, this.internalProps._oldColCount = this.colCount;
|
|
653
661
|
let notFillWidth = !1, notFillHeight = !1;
|
|
654
662
|
this.stateManager.updateHoverIcon(col, row, void 0, void 0);
|
|
655
663
|
const checkHasChart = this.internalProps.layoutMap.checkHasChart();
|
|
656
664
|
checkHasChart && (this.autoFillWidth && (notFillWidth = this.getAllColsWidth() <= this.tableNoFrameWidth),
|
|
657
665
|
this.autoFillHeight && (notFillHeight = this.getAllRowsHeight() <= this.tableNoFrameHeight));
|
|
658
|
-
const result = this.internalProps.layoutMap.toggleHierarchyState(col, row);
|
|
659
|
-
beforeUpdateCell && beforeUpdateCell(), this.refreshRowColCount()
|
|
660
|
-
this.
|
|
661
|
-
this.
|
|
666
|
+
const result = this.internalProps.layoutMap.isRowHeader(col, row) ? this.internalProps.layoutMap.toggleHierarchyState(col, row) : this.internalProps.layoutMap.toggleHierarchyStateForColumnTree(col, row);
|
|
667
|
+
beforeUpdateCell && beforeUpdateCell(), this.refreshRowColCount();
|
|
668
|
+
this.frozenColCount, this.frozenRowCount;
|
|
669
|
+
this.clearCellStyleCache(), "tree" === this.rowHierarchyType && this.scenegraph.updateHierarchyIcon(col, row),
|
|
670
|
+
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(),
|
|
671
|
+
this.clearCellStyleCache(), this.scenegraph.createSceneGraph(), this.scrollToRow(visibleStartRow)),
|
|
662
672
|
null === (_b = this.reactCustomLayout) || void 0 === _b || _b.updateAllCustomCell(),
|
|
663
673
|
checkHasChart && (this.autoFillWidth && !notFillWidth && (notFillWidth = this.getAllColsWidth() <= this.tableNoFrameWidth),
|
|
664
674
|
this.autoFillHeight && !notFillHeight && (notFillHeight = this.getAllRowsHeight() <= this.tableNoFrameHeight),
|
|
665
|
-
("adaptive" === this.widthMode || notFillWidth || "adaptive" === this.heightMode || notFillHeight) && this.scenegraph.updateChartSizeForResizeColWidth(-1))
|
|
675
|
+
("adaptive" === this.widthMode || notFillWidth || "adaptive" === this.heightMode || notFillHeight) && this.scenegraph.updateChartSizeForResizeColWidth(-1)),
|
|
676
|
+
this.internalProps._oldRowCount = void 0, this.internalProps._oldColCount = void 0;
|
|
666
677
|
}
|
|
667
678
|
getHeaderCellAddressByPath(dimensionPaths) {
|
|
668
679
|
return this.internalProps.layoutMap.getPivotCellAdress(dimensionPaths);
|
|
@@ -694,9 +705,6 @@ export class PivotTable extends BaseTable {
|
|
|
694
705
|
getCellHeaderTreeNodes(col, row) {
|
|
695
706
|
return this.internalProps.layoutMap.getCellHeaderPathsWithTreeNode(col, row);
|
|
696
707
|
}
|
|
697
|
-
_hasHierarchyTreeHeader() {
|
|
698
|
-
return "tree" === this.internalProps.layoutMap.rowHierarchyType;
|
|
699
|
-
}
|
|
700
708
|
getMenuInfo(col, row, type) {
|
|
701
709
|
const dimensionInfos = this.internalProps.layoutMap.getPivotDimensionInfo(col, row);
|
|
702
710
|
return {
|
|
@@ -708,7 +716,7 @@ export class PivotTable extends BaseTable {
|
|
|
708
716
|
};
|
|
709
717
|
}
|
|
710
718
|
setRecords(records) {
|
|
711
|
-
var _a, _b, _c, _d, _e, _f, _g;
|
|
719
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
712
720
|
const oldHoverState = {
|
|
713
721
|
col: this.stateManager.hover.cellPos.col,
|
|
714
722
|
row: this.stateManager.hover.cellPos.row
|
|
@@ -725,9 +733,9 @@ export class PivotTable extends BaseTable {
|
|
|
725
733
|
}, records)); else {
|
|
726
734
|
let columnDimensionTree, rowDimensionTree;
|
|
727
735
|
this.dataset.setRecords(records), options.columnTree ? columnDimensionTree = internalProps.layoutMap.columnDimensionTree : (!1 !== options.indicatorsAsCol && options.indicators && this.dataset.colHeaderTree && deleteHideIndicatorNode(this.dataset.colHeaderTree, options.indicators, !1, this),
|
|
728
|
-
columnDimensionTree = new DimensionTree(null !== (_c = this.dataset.colHeaderTree) && void 0 !== _c ? _c : [], this.layoutNodeId)),
|
|
736
|
+
columnDimensionTree = new 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)),
|
|
729
737
|
options.rowTree ? rowDimensionTree = internalProps.layoutMap.rowDimensionTree : (!1 === options.indicatorsAsCol && this.dataset.rowHeaderTree && options.indicators && deleteHideIndicatorNode(this.dataset.rowHeaderTree, options.indicators, !1, this),
|
|
730
|
-
rowDimensionTree = new DimensionTree(null !== (
|
|
738
|
+
rowDimensionTree = new 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)),
|
|
731
739
|
internalProps.layoutMap = new PivotHeaderLayoutMap(this, this.dataset, columnDimensionTree, rowDimensionTree),
|
|
732
740
|
this.pivotSortState = [], options.pivotSortState && (this.pivotSortState = options.pivotSortState);
|
|
733
741
|
}
|
|
@@ -735,9 +743,9 @@ export class PivotTable extends BaseTable {
|
|
|
735
743
|
this.clearCellStyleCache(), this.scenegraph.createSceneGraph(), this.stateManager.updateHoverPos(oldHoverState.col, oldHoverState.row),
|
|
736
744
|
this.internalProps.title && !this.internalProps.title.isReleased && (this._updateSize(),
|
|
737
745
|
this.internalProps.title.resize(), this.scenegraph.resize()), this.eventManager.updateEventBinder(),
|
|
738
|
-
this.options.emptyTip) if (this.internalProps.emptyTip) null === (
|
|
746
|
+
this.options.emptyTip) if (this.internalProps.emptyTip) null === (_g = this.internalProps.emptyTip) || void 0 === _g || _g.resetVisible(); else {
|
|
739
747
|
const EmptyTip = Factory.getComponent("emptyTip");
|
|
740
|
-
this.internalProps.emptyTip = new EmptyTip(this.options.emptyTip, this), null === (
|
|
748
|
+
this.internalProps.emptyTip = new EmptyTip(this.options.emptyTip, this), null === (_h = this.internalProps.emptyTip) || void 0 === _h || _h.resetVisible();
|
|
741
749
|
}
|
|
742
750
|
}
|
|
743
751
|
startEditCell(col, row, value) {
|