@visactor/vtable 1.7.7 → 1.7.8-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.
@@ -533,9 +533,25 @@ class Dataset {
533
533
  colCompute(flatRowKey, flatColKey);
534
534
  }));
535
535
  })), rowTotalKeys.forEach((flatRowKey => {
536
- Object.keys(that.tree[flatRowKey]).forEach((flatColKey => {
537
- colCompute(flatRowKey, flatColKey);
538
- }));
536
+ var _a, _b;
537
+ if (Object.keys(that.tree[flatRowKey]).forEach((flatColKey => {
538
+ var _a, _b, _c, _d, _e, _f, _g, _h;
539
+ if (colCompute(flatRowKey, flatColKey), (null === (_b = null === (_a = that.totals) || void 0 === _a ? void 0 : _a.column) || void 0 === _b ? void 0 : _b.subTotalsDimensions) && (null === (_e = null === (_d = null === (_c = that.totals) || void 0 === _c ? void 0 : _c.column) || void 0 === _d ? void 0 : _d.subTotalsDimensions) || void 0 === _e ? void 0 : _e.length) > 0 && !1 !== that.totals.column.showSubTotals) {
540
+ const colKey = flatColKey.split(this.stringJoinChar);
541
+ for (let i = 0, len = null === (_h = null === (_g = null === (_f = that.totals) || void 0 === _f ? void 0 : _f.column) || void 0 === _g ? void 0 : _g.subTotalsDimensions) || void 0 === _h ? void 0 : _h.length; i < len; i++) {
542
+ const dimension = that.totals.column.subTotalsDimensions[i], dimensionIndex = that.columns.indexOf(dimension);
543
+ if (dimensionIndex >= 0) {
544
+ const colTotalKey = colKey.slice(0, dimensionIndex + 1);
545
+ colTotalKey.push(that.colSubTotalLabel);
546
+ const flatColTotalKey = colTotalKey.join(this.stringJoinChar);
547
+ this.tree[flatRowKey][flatColTotalKey] || colCompute(flatRowKey, flatColTotalKey);
548
+ }
549
+ }
550
+ }
551
+ })), (null === (_b = null === (_a = that.totals) || void 0 === _a ? void 0 : _a.column) || void 0 === _b ? void 0 : _b.showGrandTotals) || 0 === this.rows.length) {
552
+ const flatColTotalKey = that.colGrandTotalLabel;
553
+ this.tree[flatRowKey][flatColTotalKey] || colCompute(flatRowKey, flatColTotalKey);
554
+ }
539
555
  }));
540
556
  }
541
557
  }