@visactor/vtable 1.3.1-alpha.0 → 1.3.1-alpha.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/PivotTable.js +11 -17
- 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/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.js +1 -1
- 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/index.d.ts +1 -1
- package/cjs/index.js +1 -1
- package/cjs/index.js.map +1 -1
- package/cjs/layout/pivot-header-layout.js +13 -17
- package/cjs/layout/pivot-header-layout.js.map +1 -1
- package/cjs/themes/theme.js +6 -0
- package/cjs/themes/theme.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/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.js.map +1 -1
- package/dist/vtable.js +56 -107
- package/dist/vtable.min.js +2 -2
- package/es/PivotTable.js +11 -17
- 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/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.js +1 -1
- 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/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 +13 -17
- package/es/layout/pivot-header-layout.js.map +1 -1
- package/es/themes/theme.js +6 -0
- package/es/themes/theme.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/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.js.map +1 -1
- package/package.json +2 -2
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,15 +68,13 @@ 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
79
|
this.refreshHeader(), this.stateManager.initCheckedState(records), this.scenegraph.createSceneGraph(),
|
|
82
80
|
options.title && (this.internalProps.title = new title_1.Title(options.title, this),
|
|
@@ -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,15 +153,13 @@ 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 !== (
|
|
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 = [],
|
|
167
163
|
this.pivotSortState = options.pivotSortState), this.refreshHeader(), internalProps.releaseList && (internalProps.releaseList.forEach((releaseObj => {
|
|
168
164
|
var _a;
|
|
169
165
|
return null === (_a = null == releaseObj ? void 0 : releaseObj.release) || void 0 === _a ? void 0 : _a.call(releaseObj);
|
|
@@ -653,7 +649,7 @@ class PivotTable extends BaseTable_1.BaseTable {
|
|
|
653
649
|
};
|
|
654
650
|
}
|
|
655
651
|
setRecords(records) {
|
|
656
|
-
var _a, _b, _c, _d, _e
|
|
652
|
+
var _a, _b, _c, _d, _e;
|
|
657
653
|
const oldHoverState = {
|
|
658
654
|
col: this.stateManager.hover.cellPos.col,
|
|
659
655
|
row: this.stateManager.hover.cellPos.row
|
|
@@ -669,10 +665,8 @@ class PivotTable extends BaseTable_1.BaseTable {
|
|
|
669
665
|
indicatorDimensionKey: internalProps.layoutMap.indicatorDimensionKey
|
|
670
666
|
}, records)); else {
|
|
671
667
|
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)),
|
|
668
|
+
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),
|
|
669
|
+
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
670
|
internalProps.layoutMap = new pivot_header_layout_1.PivotHeaderLayoutMap(this, this.dataset, columnDimensionTree, rowDimensionTree),
|
|
677
671
|
this.pivotSortState = [], options.pivotSortState && (this.pivotSortState = options.pivotSortState);
|
|
678
672
|
}
|