@visactor/vtable 1.22.8-alpha.12 → 1.22.8

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.
@@ -346,5 +346,4 @@ class DatasetForPivotTable {
346
346
  }
347
347
  }
348
348
 
349
- exports.DatasetForPivotTable = DatasetForPivotTable;
350
- //# sourceMappingURL=dataset-pivot-table.js.map
349
+ exports.DatasetForPivotTable = DatasetForPivotTable;
@@ -362,13 +362,15 @@ class Dataset {
362
362
  getAggregator(rowKey = [], colKey = [], indicator, considerChangedValue = !0, indicatorPosition) {
363
363
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
364
364
  const indicatorIndex = this.indicatorKeys.indexOf(indicator);
365
- let flatRowKey, flatColKey;
365
+ let rowDimensionKey, colDimensionKey, flatRowKey, flatColKey;
366
+ rowDimensionKey = "row" === (null == indicatorPosition ? void 0 : indicatorPosition.position) ? rowKey.length >= 2 ? this.rows[rowKey.length - 2] : void 0 : this.rows[rowKey.length - 1],
367
+ colDimensionKey = "col" === (null == indicatorPosition ? void 0 : indicatorPosition.position) ? colKey.length >= 2 ? this.columns[colKey.length - 2] : void 0 : this.columns[colKey.length - 1],
366
368
  "string" == typeof rowKey ? flatRowKey = rowKey : (indicatorPosition && "row" !== indicatorPosition.position || rowKey.map(((key, i) => {
367
369
  key !== indicator || (0, vutils_1.isValid)(null == indicatorPosition ? void 0 : indicatorPosition.index) && i !== indicatorPosition.index || rowKey.splice(i, 1);
368
- })), rowKey.length < this.rows.length && "grid-tree" === this.rowHierarchyType && (rowKey[0] === this.rowGrandTotalLabel || (null === (_b = null === (_a = this.totals) || void 0 === _a ? void 0 : _a.row) || void 0 === _b ? void 0 : _b.subTotalsDimensions) && (null === (_e = null === (_d = null === (_c = this.totals) || void 0 === _c ? void 0 : _c.row) || void 0 === _d ? void 0 : _d.subTotalsDimensions) || void 0 === _e ? void 0 : _e.length) >= 1 && rowKey[rowKey.length - 1] !== this.rowSubTotalLabel && rowKey.push(this.rowSubTotalLabel)),
370
+ })), rowKey.length < this.rows.length && "grid-tree" === this.rowHierarchyType && (rowKey[0] === this.rowGrandTotalLabel || (null === (_b = null === (_a = this.totals) || void 0 === _a ? void 0 : _a.row) || void 0 === _b ? void 0 : _b.subTotalsDimensions) && (null === (_e = null === (_d = null === (_c = this.totals) || void 0 === _c ? void 0 : _c.row) || void 0 === _d ? void 0 : _d.subTotalsDimensions) || void 0 === _e ? void 0 : _e.length) >= 1 && rowKey[rowKey.length - 1] !== this.rowSubTotalLabel && this.totals.row.subTotalsDimensions.find((dimension => dimension === rowDimensionKey)) && rowKey.push(this.rowSubTotalLabel)),
369
371
  flatRowKey = (0, join_1.join)(rowKey, this.stringJoinChar)), "string" == typeof colKey ? flatColKey = colKey : (indicatorPosition && "col" !== indicatorPosition.position || colKey.map(((key, i) => {
370
372
  key !== indicator || (0, vutils_1.isValid)(null == indicatorPosition ? void 0 : indicatorPosition.index) && i !== indicatorPosition.index || colKey.splice(i, 1);
371
- })), colKey.length < this.columns.length && "grid-tree" === this.columnHierarchyType && (colKey[0] === this.colGrandTotalLabel || (null === (_g = null === (_f = this.totals) || void 0 === _f ? void 0 : _f.column) || void 0 === _g ? void 0 : _g.subTotalsDimensions) && (null === (_k = null === (_j = null === (_h = this.totals) || void 0 === _h ? void 0 : _h.column) || void 0 === _j ? void 0 : _j.subTotalsDimensions) || void 0 === _k ? void 0 : _k.length) >= 1 && colKey[colKey.length - 1] !== this.colSubTotalLabel && colKey.push(this.colSubTotalLabel)),
373
+ })), colKey.length < this.columns.length && "grid-tree" === this.columnHierarchyType && (colKey[0] === this.colGrandTotalLabel || (null === (_g = null === (_f = this.totals) || void 0 === _f ? void 0 : _f.column) || void 0 === _g ? void 0 : _g.subTotalsDimensions) && (null === (_k = null === (_j = null === (_h = this.totals) || void 0 === _h ? void 0 : _h.column) || void 0 === _j ? void 0 : _j.subTotalsDimensions) || void 0 === _k ? void 0 : _k.length) >= 1 && colKey[colKey.length - 1] !== this.colSubTotalLabel && this.totals.column.subTotalsDimensions.find((dimension => dimension === colDimensionKey)) && colKey.push(this.colSubTotalLabel)),
372
374
  flatColKey = (0, join_1.join)(colKey, this.stringJoinChar));
373
375
  const agg = null === (_m = null === (_l = this.tree[flatRowKey]) || void 0 === _l ? void 0 : _l[flatColKey]) || void 0 === _m ? void 0 : _m[indicatorIndex];
374
376
  if (considerChangedValue && (0, vutils_1.isValid)(null === (_p = null === (_o = this.changedTree[flatRowKey]) || void 0 === _o ? void 0 : _o[flatColKey]) || void 0 === _p ? void 0 : _p[indicatorIndex])) {