@visactor/vtable 1.16.0 → 1.16.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 +2 -2
- package/cjs/ListTable.js.map +1 -1
- package/cjs/core/BaseTable.js +1 -1
- package/cjs/core/BaseTable.js.map +1 -1
- package/cjs/dataset/dataset.js +11 -11
- package/cjs/dataset/dataset.js.map +1 -1
- package/cjs/event/event.js +4 -3
- package/cjs/event/event.js.map +1 -1
- package/cjs/event/listener/table-group.js +1 -0
- package/cjs/event/listener/table-group.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/scenegraph/group-creater/cell-helper.js +20 -12
- package/cjs/scenegraph/group-creater/cell-helper.js.map +1 -1
- package/cjs/scenegraph/group-creater/progress/update-position/dynamic-set-x.js +6 -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.js +16 -2
- package/cjs/scenegraph/group-creater/progress/update-position/dynamic-set-y.js.map +1 -1
- package/cjs/scenegraph/scenegraph.js +17 -1
- package/cjs/scenegraph/scenegraph.js.map +1 -1
- package/cjs/scenegraph/style/frame-border.js +4 -0
- package/cjs/scenegraph/style/frame-border.js.map +1 -1
- package/cjs/state/state.d.ts +1 -1
- package/cjs/state/state.js +4 -4
- package/cjs/state/state.js.map +1 -1
- package/cjs/themes/theme.js +4 -0
- package/cjs/themes/theme.js.map +1 -1
- package/cjs/ts-types/base-table.d.ts +1 -0
- package/cjs/ts-types/base-table.js.map +1 -1
- package/cjs/ts-types/dataset/aggregation.js +3 -1
- package/cjs/ts-types/dataset/aggregation.js.map +1 -1
- package/cjs/ts-types/table-engine.d.ts +2 -0
- package/cjs/ts-types/table-engine.js.map +1 -1
- package/cjs/ts-types/theme.d.ts +3 -2
- package/cjs/ts-types/theme.js.map +1 -1
- package/cjs/vrender.js.map +1 -1
- package/dist/vtable.js +130 -42
- package/dist/vtable.min.js +2 -2
- package/es/ListTable.js +2 -2
- package/es/ListTable.js.map +1 -1
- package/es/core/BaseTable.js +1 -1
- package/es/core/BaseTable.js.map +1 -1
- package/es/dataset/dataset.js +11 -11
- package/es/dataset/dataset.js.map +1 -1
- package/es/event/event.js +4 -3
- package/es/event/event.js.map +1 -1
- package/es/event/listener/table-group.js +1 -0
- package/es/event/listener/table-group.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/scenegraph/group-creater/cell-helper.js +20 -12
- package/es/scenegraph/group-creater/cell-helper.js.map +1 -1
- package/es/scenegraph/group-creater/progress/update-position/dynamic-set-x.js +6 -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.js +17 -1
- package/es/scenegraph/group-creater/progress/update-position/dynamic-set-y.js.map +1 -1
- package/es/scenegraph/scenegraph.js +12 -1
- package/es/scenegraph/scenegraph.js.map +1 -1
- package/es/scenegraph/style/frame-border.js +4 -0
- package/es/scenegraph/style/frame-border.js.map +1 -1
- package/es/state/state.d.ts +1 -1
- package/es/state/state.js +4 -4
- package/es/state/state.js.map +1 -1
- package/es/themes/theme.js +4 -0
- package/es/themes/theme.js.map +1 -1
- package/es/ts-types/base-table.d.ts +1 -0
- package/es/ts-types/base-table.js.map +1 -1
- package/es/ts-types/dataset/aggregation.js +3 -1
- package/es/ts-types/dataset/aggregation.js.map +1 -1
- package/es/ts-types/table-engine.d.ts +2 -0
- package/es/ts-types/table-engine.js.map +1 -1
- package/es/ts-types/theme.d.ts +3 -2
- package/es/ts-types/theme.js.map +1 -1
- package/es/vrender.js.map +1 -1
- package/package.json +4 -4
package/cjs/dataset/dataset.js
CHANGED
|
@@ -51,7 +51,7 @@ class Dataset {
|
|
|
51
51
|
this.setRecords(records);
|
|
52
52
|
}
|
|
53
53
|
setRecords(records) {
|
|
54
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u;
|
|
54
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x;
|
|
55
55
|
if (this.records = records, this.collectedValues = {}, this.cacheCollectedValues = {},
|
|
56
56
|
this.totalRecordsTree = {}, this.tree = {}, this.colFlatKeys = {}, this.rowFlatKeys = {},
|
|
57
57
|
this.colKeys = [], this.rowKeys = [], this.rowsHasValue = [], this.columnsHasValue = [],
|
|
@@ -67,10 +67,10 @@ class Dataset {
|
|
|
67
67
|
"undefined" != typeof window && window.performance.now();
|
|
68
68
|
this.sortKeys();
|
|
69
69
|
"undefined" != typeof window && window.performance.now(), "undefined" != typeof window && window.performance.now();
|
|
70
|
-
this.customRowTree ? this.rowHeaderTree = this.customRowTree : "tree" === this.rowHierarchyType ? this.rowHeaderTree = this.ArrToTree1(this.rowKeys, this.rows.filter(((key, index) => this.rowsHasValue[index])), this.indicatorsAsCol ? void 0 : this.indicators, (null === (_b = null === (_a = this.totals) || void 0 === _a ? void 0 : _a.row) || void 0 === _b ? void 0 : _b.showGrandTotals) || !this.indicatorsAsCol && 0 === this.columns.length || this.indicatorsAsCol && 0 === this.rows.length, this.rowGrandTotalLabel) : this.rowHeaderTree = this.ArrToTree(this.rowKeys, this.rows.filter(((key, index) => this.rowsHasValue[index])), this.indicatorsAsCol ? void 0 : this.indicators, this.rowsIsTotal, (null === (
|
|
71
|
-
this.customColTree ? this.colHeaderTree = this.customColTree : this.colHeaderTree = this.ArrToTree(this.colKeys, this.columns.filter(((key, index) => this.columnsHasValue[index])), this.indicatorsAsCol ? this.indicators : void 0, this.colsIsTotal, (null === (
|
|
70
|
+
this.customRowTree ? this.rowHeaderTree = this.customRowTree : "tree" === this.rowHierarchyType ? this.rowHeaderTree = this.ArrToTree1(this.rowKeys, this.rows.filter(((key, index) => this.rowsHasValue[index])), this.indicatorsAsCol ? void 0 : this.indicators, (null === (_b = null === (_a = this.totals) || void 0 === _a ? void 0 : _a.row) || void 0 === _b ? void 0 : _b.showGrandTotals) || !this.indicatorsAsCol && 0 === this.columns.length || this.indicatorsAsCol && 0 === this.rows.length, this.rowGrandTotalLabel, null !== (_e = null === (_d = null === (_c = this.totals) || void 0 === _c ? void 0 : _c.row) || void 0 === _d ? void 0 : _d.showGrandTotalsOnTop) && void 0 !== _e && _e) : this.rowHeaderTree = this.ArrToTree(this.rowKeys, this.rows.filter(((key, index) => this.rowsHasValue[index])), this.indicatorsAsCol ? void 0 : this.indicators, this.rowsIsTotal, (null === (_g = null === (_f = this.totals) || void 0 === _f ? void 0 : _f.row) || void 0 === _g ? void 0 : _g.showGrandTotals) || this.indicatorsAsCol && 0 === this.rows.length, this.rowGrandTotalLabel, this.rowSubTotalLabel, null !== (_k = null === (_j = null === (_h = this.totals) || void 0 === _h ? void 0 : _h.row) || void 0 === _j ? void 0 : _j.showGrandTotalsOnTop) && void 0 !== _k && _k, null !== (_o = null === (_m = null === (_l = this.totals) || void 0 === _l ? void 0 : _l.row) || void 0 === _m ? void 0 : _m.showSubTotalsOnTop) && void 0 !== _o && _o),
|
|
71
|
+
this.customColTree ? this.colHeaderTree = this.customColTree : this.colHeaderTree = this.ArrToTree(this.colKeys, this.columns.filter(((key, index) => this.columnsHasValue[index])), this.indicatorsAsCol ? this.indicators : void 0, this.colsIsTotal, (null === (_q = null === (_p = this.totals) || void 0 === _p ? void 0 : _p.column) || void 0 === _q ? void 0 : _q.showGrandTotals) || !this.indicatorsAsCol && 0 === this.columns.length, this.colGrandTotalLabel, this.colSubTotalLabel, null !== (_t = null === (_s = null === (_r = this.totals) || void 0 === _r ? void 0 : _r.column) || void 0 === _s ? void 0 : _s.showGrandTotalsOnLeft) && void 0 !== _t && _t, null !== (_w = null === (_v = null === (_u = this.totals) || void 0 === _u ? void 0 : _u.column) || void 0 === _v ? void 0 : _v.showSubTotalsOnLeft) && void 0 !== _w && _w);
|
|
72
72
|
"undefined" != typeof window && window.performance.now();
|
|
73
|
-
(null === (
|
|
73
|
+
(null === (_x = this.dataConfig) || void 0 === _x ? void 0 : _x.isPivotChart) && this.cacheDeminsionCollectedValues();
|
|
74
74
|
}
|
|
75
75
|
}
|
|
76
76
|
registerAggregator(type, aggregator) {
|
|
@@ -339,9 +339,9 @@ class Dataset {
|
|
|
339
339
|
}
|
|
340
340
|
}
|
|
341
341
|
updateSortRules(sortRules) {
|
|
342
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t;
|
|
343
|
-
this.sorted = !1, this.sortRules = sortRules, this.sortKeys(), this.customRowTree || ("tree" === this.rowHierarchyType ? this.rowHeaderTree = this.ArrToTree1(this.rowKeys, this.rows.filter(((key, index) => this.rowsHasValue[index])), this.indicatorsAsCol ? void 0 : this.indicators, (null === (_b = null === (_a = this.totals) || void 0 === _a ? void 0 : _a.row) || void 0 === _b ? void 0 : _b.showGrandTotals) || !this.indicatorsAsCol && 0 === this.columns.length || this.indicatorsAsCol && 0 === this.rows.length, this.rowGrandTotalLabel) : this.rowHeaderTree = this.ArrToTree(this.rowKeys, this.rows.filter(((key, index) => this.rowsHasValue[index])), this.indicatorsAsCol ? void 0 : this.indicators, this.rowsIsTotal, (null === (
|
|
344
|
-
this.customColTree || (this.colHeaderTree = this.ArrToTree(this.colKeys, this.columns.filter(((key, index) => this.columnsHasValue[index])), this.indicatorsAsCol ? this.indicators : void 0, this.colsIsTotal, (null === (
|
|
342
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w;
|
|
343
|
+
this.sorted = !1, this.sortRules = sortRules, this.sortKeys(), this.customRowTree || ("tree" === this.rowHierarchyType ? this.rowHeaderTree = this.ArrToTree1(this.rowKeys, this.rows.filter(((key, index) => this.rowsHasValue[index])), this.indicatorsAsCol ? void 0 : this.indicators, (null === (_b = null === (_a = this.totals) || void 0 === _a ? void 0 : _a.row) || void 0 === _b ? void 0 : _b.showGrandTotals) || !this.indicatorsAsCol && 0 === this.columns.length || this.indicatorsAsCol && 0 === this.rows.length, this.rowGrandTotalLabel, null !== (_e = null === (_d = null === (_c = this.totals) || void 0 === _c ? void 0 : _c.row) || void 0 === _d ? void 0 : _d.showGrandTotalsOnTop) && void 0 !== _e && _e) : this.rowHeaderTree = this.ArrToTree(this.rowKeys, this.rows.filter(((key, index) => this.rowsHasValue[index])), this.indicatorsAsCol ? void 0 : this.indicators, this.rowsIsTotal, (null === (_g = null === (_f = this.totals) || void 0 === _f ? void 0 : _f.row) || void 0 === _g ? void 0 : _g.showGrandTotals) || this.indicatorsAsCol && 0 === this.rows.length, this.rowGrandTotalLabel, this.rowSubTotalLabel, null !== (_k = null === (_j = null === (_h = this.totals) || void 0 === _h ? void 0 : _h.row) || void 0 === _j ? void 0 : _j.showGrandTotalsOnTop) && void 0 !== _k && _k, null !== (_o = null === (_m = null === (_l = this.totals) || void 0 === _l ? void 0 : _l.row) || void 0 === _m ? void 0 : _m.showSubTotalsOnTop) && void 0 !== _o && _o)),
|
|
344
|
+
this.customColTree || (this.colHeaderTree = this.ArrToTree(this.colKeys, this.columns.filter(((key, index) => this.columnsHasValue[index])), this.indicatorsAsCol ? this.indicators : void 0, this.colsIsTotal, (null === (_q = null === (_p = this.totals) || void 0 === _p ? void 0 : _p.column) || void 0 === _q ? void 0 : _q.showGrandTotals) || !this.indicatorsAsCol && 0 === this.columns.length, this.colGrandTotalLabel, this.colSubTotalLabel, null !== (_t = null === (_s = null === (_r = this.totals) || void 0 === _r ? void 0 : _r.column) || void 0 === _s ? void 0 : _s.showGrandTotalsOnLeft) && void 0 !== _t && _t, null !== (_w = null === (_v = null === (_u = this.totals) || void 0 === _u ? void 0 : _u.column) || void 0 === _v ? void 0 : _v.showSubTotalsOnLeft) && void 0 !== _w && _w));
|
|
345
345
|
}
|
|
346
346
|
updateFilterRules(filterRules, isResetTree = !1) {
|
|
347
347
|
var _a, _b;
|
|
@@ -601,9 +601,9 @@ class Dataset {
|
|
|
601
601
|
}
|
|
602
602
|
for (const flatRowKey in that.totalRecordsTree) for (const flatColKey in that.totalRecordsTree[flatRowKey]) colCompute(flatRowKey, flatColKey);
|
|
603
603
|
}
|
|
604
|
-
ArrToTree1(arr, rows, indicators, isGrandTotal, grandTotalLabel) {
|
|
604
|
+
ArrToTree1(arr, rows, indicators, isGrandTotal, grandTotalLabel, showGrandTotalsOnTop) {
|
|
605
605
|
const result = [], concatStr = this.stringJoinChar, map = new Map;
|
|
606
|
-
function addList(list) {
|
|
606
|
+
function addList(list, isGrandTotal) {
|
|
607
607
|
const path = [];
|
|
608
608
|
let node;
|
|
609
609
|
list.forEach(((value, index) => {
|
|
@@ -621,11 +621,11 @@ class Dataset {
|
|
|
621
621
|
indicatorKey: indicator.indicatorKey,
|
|
622
622
|
value: indicator.title
|
|
623
623
|
})) : []
|
|
624
|
-
}, map.set(flatKey, item), node ? node.children.push(item) : result.push(item)),
|
|
624
|
+
}, map.set(flatKey, item), node ? node.children.push(item) : showGrandTotalsOnTop && isGrandTotal ? result.unshift(item) : result.push(item)),
|
|
625
625
|
node = item;
|
|
626
626
|
}));
|
|
627
627
|
}
|
|
628
|
-
return arr.forEach((item => addList(item))), isGrandTotal && addList([ grandTotalLabel ]),
|
|
628
|
+
return arr.forEach((item => addList(item, !1))), isGrandTotal && addList([ grandTotalLabel ], isGrandTotal),
|
|
629
629
|
result;
|
|
630
630
|
}
|
|
631
631
|
ArrToTree(arr, rows, indicators, subTotalFlags, isGrandTotal, grandTotalLabel, subTotalLabel, showGrandTotalsOnTop, showSubTotalsOnTop) {
|