pace-table-lib 1.0.58 → 1.0.60

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.
@@ -19,3 +19,4 @@ export declare function applyTextRelatedCss(headerArr: any[], flag: boolean): an
19
19
  export declare function applyTextCssForCorners(headerArr: any[], flag: boolean): any[];
20
20
  export declare function getIndex(str: string): number;
21
21
  export declare function getFontSize(value?: number | string): number;
22
+ export declare function getGroupIndex(measuresBySlice: any[]): number;
@@ -8371,6 +8371,24 @@ function getFontSize(value) {
8371
8371
  }
8372
8372
  return 10;
8373
8373
  }
8374
+ function getGroupIndex(measuresBySlice) {
8375
+ let groupIndex = 1;
8376
+ try {
8377
+ let lastParent = null;
8378
+ for (let i = 0; i <= measuresBySlice.length; i++) {
8379
+ const parent = measuresBySlice[i]?.sliceMark?.[0] ?? "";
8380
+ if (parent !== lastParent) {
8381
+ if (lastParent !== null) {
8382
+ groupIndex++;
8383
+ }
8384
+ lastParent = parent;
8385
+ }
8386
+ }
8387
+ } catch (err) {
8388
+ console.warn(err);
8389
+ }
8390
+ return groupIndex;
8391
+ }
8374
8392
  var jquery$1 = { exports: {} };
8375
8393
  /*!
8376
8394
  * jQuery JavaScript Library v3.7.1
@@ -18129,7 +18147,7 @@ function StaticTable({
18129
18147
  width: widthForTheTotal,
18130
18148
  height: rowCellHeight,
18131
18149
  color: finalStyleForRow.color,
18132
- background: finalStyleForRow.background ?? getBgColorForCell(rowCount - 1, rowColors),
18150
+ background: finalStyleForRow.background ?? getBgColorForCell(getGroupIndex(measuresBySlice), rowColors),
18133
18151
  fontWeight: "bold"
18134
18152
  });
18135
18153
  if (isSparkLineVisible && isSlAtStart && !headerAtStart) {
@@ -18404,7 +18422,7 @@ function StaticTable({
18404
18422
  const isSparkLineCol = isSparkLineVisible && !isSlAtStart && columnIndex === columnCount - 1;
18405
18423
  const isPercentageMode = DataField.hasOwnProperty("percentageBy") && DataField.percentageBy && DataField.percentageBy?.toLowerCase() !== "absolute";
18406
18424
  let rawValue;
18407
- const bgColorForTotals = getBgColorForCell(rowCount - fixedRowCount, dataColors);
18425
+ const bgColorForTotals = getBgColorForCell(getGroupIndex(measuresBySlice), dataColors);
18408
18426
  if (isColTotalOn && isRowTotalOn && !headerAtStart && isLastRow && isLastCol) {
18409
18427
  baseStyle.background = bgColorForTotals;
18410
18428
  rawValue = grandTotal;
@@ -19670,7 +19688,6 @@ const PivotTable = ({
19670
19688
  maxWidth: isFitTableOn ? colCellWidth : Table2.TableWidth,
19671
19689
  height: shouldWrapColumnHeader ? "auto" : colCellHeight,
19672
19690
  alignItems: shouldWrapColumnHeader ? "flex-start" : "center",
19673
- textAlign: colHeaderFont.textAlign?.toLowerCase() ?? "left",
19674
19691
  fontSize: colHeaderFont.fontSize,
19675
19692
  fontFamily: colHeaderFont.fontFamily,
19676
19693
  fontWeight: col.isSubtotal ? "bold" : colHeaderFont.fontWeight,
@@ -19700,7 +19717,16 @@ const PivotTable = ({
19700
19717
  children: collapsedCols.has(getCollapseKey(col)) ? "+" : "−"
19701
19718
  }
19702
19719
  ),
19703
- /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "pivot-column-header__text", children: displayLabel })
19720
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
19721
+ "span",
19722
+ {
19723
+ className: "pivot-column-header__text",
19724
+ style: {
19725
+ textAlign: colHeaderFont.textAlign?.toLowerCase() ?? "left"
19726
+ },
19727
+ children: displayLabel
19728
+ }
19729
+ )
19704
19730
  ] })
19705
19731
  },
19706
19732
  `col-${idx}`