@visactor/vtable 1.3.1-alpha.0 → 1.3.1
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 +13 -11
- package/cjs/ListTable.js.map +1 -1
- package/cjs/PivotChart.js +7 -6
- package/cjs/PivotChart.js.map +1 -1
- package/cjs/PivotTable.js +19 -23
- package/cjs/PivotTable.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/core/BaseTable.js +3 -3
- package/cjs/core/BaseTable.js.map +1 -1
- package/cjs/dataset/dataset.d.ts +0 -2
- package/cjs/dataset/dataset.js +7 -8
- package/cjs/dataset/dataset.js.map +1 -1
- package/cjs/event/listener/container-dom.js +3 -2
- package/cjs/event/listener/container-dom.js.map +1 -1
- package/cjs/index.d.ts +1 -1
- package/cjs/index.js +2 -2
- package/cjs/index.js.map +1 -1
- package/cjs/layout/pivot-header-layout.js +15 -19
- 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/layout/compute-row-height.js +4 -1
- package/cjs/scenegraph/layout/compute-row-height.js.map +1 -1
- package/cjs/scenegraph/scenegraph.js +2 -2
- 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/ts-types/base-table.d.ts +3 -2
- package/cjs/ts-types/base-table.js.map +1 -1
- package/cjs/vrender.js.map +1 -1
- package/dist/vtable.js +54 -104
- package/dist/vtable.min.js +2 -2
- package/es/ListTable.js +13 -12
- package/es/ListTable.js.map +1 -1
- package/es/PivotChart.js +8 -7
- package/es/PivotChart.js.map +1 -1
- package/es/PivotTable.js +20 -24
- package/es/PivotTable.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/core/BaseTable.js +3 -3
- package/es/core/BaseTable.js.map +1 -1
- package/es/dataset/dataset.d.ts +0 -2
- package/es/dataset/dataset.js +7 -8
- package/es/dataset/dataset.js.map +1 -1
- package/es/event/listener/container-dom.js +3 -2
- package/es/event/listener/container-dom.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/pivot-header-layout.js +15 -18
- 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/layout/compute-row-height.js +4 -1
- package/es/scenegraph/layout/compute-row-height.js.map +1 -1
- package/es/scenegraph/scenegraph.js +2 -2
- 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/ts-types/base-table.d.ts +3 -2
- package/es/ts-types/base-table.js.map +1 -1
- package/es/vrender.js.map +1 -1
- package/package.json +5 -5
package/cjs/PivotTable.js
CHANGED
|
@@ -33,7 +33,7 @@ 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
|
|
36
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
|
|
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 = {
|
|
@@ -68,18 +68,16 @@ class PivotTable extends BaseTable_1.BaseTable {
|
|
|
68
68
|
this.dataset = new dataset_1.Dataset(this.internalProps.dataConfig, rowKeys, columnKeys, indicatorKeys, this.internalProps.indicators, null === (_l = options.indicatorsAsCol) || void 0 === _l || _l, options.records, options.rowHierarchyType, this.internalProps.columnTree, this.internalProps.rowTree),
|
|
69
69
|
options.columnTree || (!1 !== options.indicatorsAsCol && (this.dataset.colHeaderTree = (0,
|
|
70
70
|
layout_helper_1.supplementIndicatorNodesForCustomTree)(this.dataset.colHeaderTree, options.indicators)),
|
|
71
|
-
|
|
72
|
-
columnDimensionTree = new tree_helper_1.DimensionTree(null !== (_p = this.dataset.colHeaderTree) && void 0 !== _p ? _p : [], this.layoutNodeId)),
|
|
71
|
+
columnDimensionTree = new tree_helper_1.DimensionTree(null !== (_m = this.dataset.colHeaderTree) && void 0 !== _m ? _m : [], this.layoutNodeId)),
|
|
73
72
|
options.rowTree || (!1 === options.indicatorsAsCol && (this.dataset.rowHeaderTree = (0,
|
|
74
73
|
layout_helper_1.supplementIndicatorNodesForCustomTree)(this.dataset.rowHeaderTree, options.indicators)),
|
|
75
|
-
|
|
76
|
-
rowDimensionTree = new tree_helper_1.DimensionTree(null !== (_s = this.dataset.rowHeaderTree) && void 0 !== _s ? _s : [], this.layoutNodeId, this.options.rowHierarchyType, "tree" === this.options.rowHierarchyType ? null !== (_t = this.options.rowExpandLevel) && void 0 !== _t ? _t : 1 : void 0)),
|
|
74
|
+
rowDimensionTree = new tree_helper_1.DimensionTree(null !== (_o = this.dataset.rowHeaderTree) && void 0 !== _o ? _o : [], this.layoutNodeId, this.options.rowHierarchyType, "tree" === this.options.rowHierarchyType ? null !== (_p = this.options.rowExpandLevel) && void 0 !== _p ? _p : 1 : void 0)),
|
|
77
75
|
this.internalProps.layoutMap = new pivot_header_layout_1.PivotHeaderLayoutMap(this, this.dataset, columnDimensionTree, rowDimensionTree);
|
|
78
76
|
}
|
|
79
|
-
this._changePivotSortStateBySortRules(), (null !== (
|
|
77
|
+
this._changePivotSortStateBySortRules(), (null !== (_r = null === (_q = options.pivotSortState) || void 0 === _q ? void 0 : _q.length) && void 0 !== _r ? _r : 0) > 0 && (this.pivotSortState = [],
|
|
80
78
|
this.pivotSortState = options.pivotSortState), "node" !== env_1.Env.mode && (this.editorManager = new edit_manager_1.EditManeger(this)),
|
|
81
|
-
this.refreshHeader(), this.
|
|
82
|
-
options.title && (this.internalProps.title = new title_1.Title(options.title, this),
|
|
79
|
+
this.refreshHeader(), this.internalProps.useOneRowHeightFillAll = !1, this.stateManager.initCheckedState(records),
|
|
80
|
+
this.scenegraph.createSceneGraph(), options.title && (this.internalProps.title = new title_1.Title(options.title, this),
|
|
83
81
|
this.scenegraph.resize()), this.options.emptyTip && (this.internalProps.emptyTip || (this.internalProps.emptyTip = new empty_tip_1.EmptyTip(this.options.emptyTip, this)),
|
|
84
82
|
this.internalProps.emptyTip.resetVisible()), setTimeout((() => {
|
|
85
83
|
this.fireListeners(TABLE_EVENT_TYPE_1.TABLE_EVENT_TYPE.INITIALIZED, null);
|
|
@@ -114,7 +112,7 @@ class PivotTable extends BaseTable_1.BaseTable {
|
|
|
114
112
|
return ifCan;
|
|
115
113
|
}
|
|
116
114
|
updateOption(options) {
|
|
117
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t
|
|
115
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t;
|
|
118
116
|
const internalProps = this.internalProps;
|
|
119
117
|
if (super.updateOption(options), this.layoutNodeId = {
|
|
120
118
|
seqId: 0
|
|
@@ -155,16 +153,15 @@ class PivotTable extends BaseTable_1.BaseTable {
|
|
|
155
153
|
this.dataset = new dataset_1.Dataset(internalProps.dataConfig, rowKeys, columnKeys, indicatorKeys, this.internalProps.indicators, null === (_o = options.indicatorsAsCol) || void 0 === _o || _o, records, options.rowHierarchyType, this.internalProps.columnTree, this.internalProps.rowTree),
|
|
156
154
|
options.columnTree || (!1 !== options.indicatorsAsCol && (this.dataset.colHeaderTree = (0,
|
|
157
155
|
layout_helper_1.supplementIndicatorNodesForCustomTree)(this.dataset.colHeaderTree, options.indicators)),
|
|
158
|
-
|
|
159
|
-
columnDimensionTree = new tree_helper_1.DimensionTree(null !== (_r = this.dataset.colHeaderTree) && void 0 !== _r ? _r : [], this.layoutNodeId)),
|
|
156
|
+
columnDimensionTree = new tree_helper_1.DimensionTree(null !== (_p = this.dataset.colHeaderTree) && void 0 !== _p ? _p : [], this.layoutNodeId)),
|
|
160
157
|
options.rowTree || (!1 === options.indicatorsAsCol && (this.dataset.rowHeaderTree = (0,
|
|
161
158
|
layout_helper_1.supplementIndicatorNodesForCustomTree)(this.dataset.rowHeaderTree, options.indicators)),
|
|
162
|
-
|
|
163
|
-
rowDimensionTree = new tree_helper_1.DimensionTree(null !== (_u = this.dataset.rowHeaderTree) && void 0 !== _u ? _u : [], this.layoutNodeId, this.options.rowHierarchyType, "tree" === this.options.rowHierarchyType ? null !== (_v = this.options.rowExpandLevel) && void 0 !== _v ? _v : 1 : void 0)),
|
|
159
|
+
rowDimensionTree = new tree_helper_1.DimensionTree(null !== (_q = this.dataset.rowHeaderTree) && void 0 !== _q ? _q : [], this.layoutNodeId, this.options.rowHierarchyType, "tree" === this.options.rowHierarchyType ? null !== (_r = this.options.rowExpandLevel) && void 0 !== _r ? _r : 1 : void 0)),
|
|
164
160
|
internalProps.layoutMap = new pivot_header_layout_1.PivotHeaderLayoutMap(this, this.dataset, columnDimensionTree, rowDimensionTree);
|
|
165
161
|
}
|
|
166
|
-
return this._changePivotSortStateBySortRules(), (null !== (
|
|
167
|
-
this.pivotSortState = options.pivotSortState), this.refreshHeader(), internalProps.
|
|
162
|
+
return this._changePivotSortStateBySortRules(), (null !== (_t = null === (_s = options.pivotSortState) || void 0 === _s ? void 0 : _s.length) && void 0 !== _t ? _t : 0) > 0 && (this.pivotSortState = [],
|
|
163
|
+
this.pivotSortState = options.pivotSortState), this.refreshHeader(), this.internalProps.useOneRowHeightFillAll = !1,
|
|
164
|
+
internalProps.releaseList && (internalProps.releaseList.forEach((releaseObj => {
|
|
168
165
|
var _a;
|
|
169
166
|
return null === (_a = null == releaseObj ? void 0 : releaseObj.release) || void 0 === _a ? void 0 : _a.call(releaseObj);
|
|
170
167
|
})), internalProps.releaseList = null), this.scenegraph.clearCells(), this.scenegraph.createSceneGraph(),
|
|
@@ -471,7 +468,8 @@ class PivotTable extends BaseTable_1.BaseTable {
|
|
|
471
468
|
sortRules: sortRules
|
|
472
469
|
}, this.dataset.updateSortRules(sortRules), this._changePivotSortStateBySortRules(),
|
|
473
470
|
this.internalProps.layoutMap.resetHeaderTree(), this.scenegraph.clearCells(), this.refreshHeader(),
|
|
474
|
-
this.scenegraph.createSceneGraph(),
|
|
471
|
+
this.internalProps.useOneRowHeightFillAll = !1, this.scenegraph.createSceneGraph(),
|
|
472
|
+
this.render();
|
|
475
473
|
}
|
|
476
474
|
_changePivotSortStateBySortRules() {
|
|
477
475
|
var _a, _b, _c, _d;
|
|
@@ -653,7 +651,7 @@ class PivotTable extends BaseTable_1.BaseTable {
|
|
|
653
651
|
};
|
|
654
652
|
}
|
|
655
653
|
setRecords(records) {
|
|
656
|
-
var _a, _b, _c, _d, _e
|
|
654
|
+
var _a, _b, _c, _d, _e;
|
|
657
655
|
const oldHoverState = {
|
|
658
656
|
col: this.stateManager.hover.cellPos.col,
|
|
659
657
|
row: this.stateManager.hover.cellPos.row
|
|
@@ -669,15 +667,13 @@ class PivotTable extends BaseTable_1.BaseTable {
|
|
|
669
667
|
indicatorDimensionKey: internalProps.layoutMap.indicatorDimensionKey
|
|
670
668
|
}, records)); else {
|
|
671
669
|
let columnDimensionTree, rowDimensionTree;
|
|
672
|
-
this.dataset.setRecords(records), options.columnTree ?
|
|
673
|
-
|
|
674
|
-
options.rowTree ? rowDimensionTree = internalProps.layoutMap.rowDimensionTree : (0 !== (null !== (_g = null === (_f = this.records) || void 0 === _f ? void 0 : _f.length) && void 0 !== _g ? _g : 0) || this.dataset.customColTree || this.dataset.customRowTree || (this.dataset.rowHeaderTree = []),
|
|
675
|
-
rowDimensionTree = new tree_helper_1.DimensionTree(null !== (_h = this.dataset.rowHeaderTree) && void 0 !== _h ? _h : [], this.layoutNodeId, this.options.rowHierarchyType, "tree" === this.options.rowHierarchyType ? null !== (_j = this.options.rowExpandLevel) && void 0 !== _j ? _j : 1 : void 0)),
|
|
670
|
+
this.dataset.setRecords(records), columnDimensionTree = options.columnTree ? internalProps.layoutMap.columnDimensionTree : new tree_helper_1.DimensionTree(null !== (_c = this.dataset.colHeaderTree) && void 0 !== _c ? _c : [], this.layoutNodeId),
|
|
671
|
+
rowDimensionTree = options.rowTree ? internalProps.layoutMap.rowDimensionTree : new tree_helper_1.DimensionTree(null !== (_d = this.dataset.rowHeaderTree) && void 0 !== _d ? _d : [], this.layoutNodeId, this.options.rowHierarchyType, "tree" === this.options.rowHierarchyType ? null !== (_e = this.options.rowExpandLevel) && void 0 !== _e ? _e : 1 : void 0),
|
|
676
672
|
internalProps.layoutMap = new pivot_header_layout_1.PivotHeaderLayoutMap(this, this.dataset, columnDimensionTree, rowDimensionTree),
|
|
677
673
|
this.pivotSortState = [], options.pivotSortState && (this.pivotSortState = options.pivotSortState);
|
|
678
674
|
}
|
|
679
|
-
this.refreshHeader(), this.
|
|
680
|
-
this.scenegraph.createSceneGraph(), this.stateManager.updateHoverPos(oldHoverState.col, oldHoverState.row),
|
|
675
|
+
this.refreshHeader(), this.internalProps.useOneRowHeightFillAll = !1, this.scenegraph.clearCells(),
|
|
676
|
+
this.clearCellStyleCache(), this.scenegraph.createSceneGraph(), this.stateManager.updateHoverPos(oldHoverState.col, oldHoverState.row),
|
|
681
677
|
this.internalProps.title && !this.internalProps.title.isReleased && (this._updateSize(),
|
|
682
678
|
this.internalProps.title.resize(), this.scenegraph.resize()), this.eventManager.updateEventBinder();
|
|
683
679
|
}
|