pace-table-lib 1.0.17 → 1.0.18

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.
@@ -8318,6 +8318,8 @@
8318
8318
  const rowColors = getBgColor(RowHeader, "row");
8319
8319
  const colColors = getBgColor(ColumnHeader, "column");
8320
8320
  const dataColors = getBgColor(DataField, "dataField");
8321
+ const isColHeaderVisible = !ColumnHeader?.HideColumnHeader;
8322
+ const isRowHeaderVisible = !RowHeader?.HideRowHeader;
8321
8323
  const rowHeaderFont = React.useMemo(() => ({
8322
8324
  color: RowHeader.RowHeaderColor,
8323
8325
  fontFamily: RowHeader.RowHeaderFontFamily,
@@ -8346,10 +8348,16 @@
8346
8348
  HeatMapMaxColor
8347
8349
  } = HeatMap || {};
8348
8350
  const fixedRowCount = React.useMemo(() => {
8351
+ if (!isColHeaderVisible) {
8352
+ return headerAtStart && isColTotalOn ? 1 : 0;
8353
+ }
8349
8354
  const base = Math.max(...dimensionMarks.map((d) => d.length));
8350
8355
  return base + (headerAtStart && isColTotalOn ? 1 : 0);
8351
8356
  }, [dimensionMarks, headerAtStart, isColTotalOn]);
8352
8357
  const fixedColCount = React.useMemo(() => {
8358
+ if (!isRowHeaderVisible) {
8359
+ return headerAtStart && isRowTotalOn ? 1 : 0;
8360
+ }
8353
8361
  const base = leftFixedCellNameList ? leftFixedCellNameList.length : 1;
8354
8362
  return base + (headerAtStart && isRowTotalOn ? 1 : 0);
8355
8363
  }, [leftFixedCellNameList, headerAtStart, isRowTotalOn]);
@@ -8469,35 +8477,43 @@
8469
8477
  borderTop: "none",
8470
8478
  fontWeight: "bold"
8471
8479
  };
8472
- if (leftFixedCellNameList && leftFixedCellNameList.length > 0) {
8473
- leftFixedCellNameList.forEach((label, col) => {
8474
- baseStyle.background = getBgColorForCell(col, colColors);
8475
- const finalStyleForColumn = getFinalStyleObj(STYLE_FOR.COLUMN, baseStyle, label, col);
8480
+ if (isColHeaderVisible && isRowHeaderVisible) {
8481
+ if (leftFixedCellNameList && leftFixedCellNameList.length > 0) {
8482
+ leftFixedCellNameList.forEach((label, col) => {
8483
+ baseStyle.background = getBgColorForCell(col, colColors);
8484
+ const finalStyleForColumn = getFinalStyleObj(STYLE_FOR.COLUMN, baseStyle, label, col);
8485
+ cells.push({
8486
+ label,
8487
+ style: {
8488
+ ...finalStyleForColumn,
8489
+ borderLeft: col === 0 ? BORDER_STYLE : "none",
8490
+ left: col * fixedColWidth
8491
+ },
8492
+ childClassName: "left_fixed_data_cell"
8493
+ });
8494
+ });
8495
+ } else {
8476
8496
  cells.push({
8477
- label,
8497
+ label: "",
8478
8498
  style: {
8479
- ...finalStyleForColumn,
8480
- borderLeft: col === 0 ? BORDER_STYLE : "none",
8481
- left: col * fixedColWidth
8499
+ ...baseStyle,
8500
+ borderLeft: BORDER_STYLE,
8501
+ left: 0,
8502
+ background: getBgColorForCell(1, colColors)
8503
+ // or keep a default color
8482
8504
  },
8483
8505
  childClassName: "left_fixed_data_cell"
8484
8506
  });
8485
- });
8486
- } else {
8487
- cells.push({
8488
- label: "",
8489
- style: {
8490
- ...baseStyle,
8491
- borderLeft: BORDER_STYLE,
8492
- left: 0,
8493
- background: getBgColorForCell(1, colColors)
8494
- // or keep a default color
8495
- },
8496
- childClassName: "left_fixed_data_cell"
8497
- });
8507
+ }
8498
8508
  }
8499
8509
  if (headerAtStart && isRowTotalOn) {
8500
- const colIndex = leftFixedCellNameList ? leftFixedCellNameList.length : 1;
8510
+ let colIndex = 1;
8511
+ if (leftFixedCellNameList) {
8512
+ colIndex = leftFixedCellNameList.length;
8513
+ }
8514
+ if (!isRowHeaderVisible) {
8515
+ colIndex = 0;
8516
+ }
8501
8517
  baseStyle.background = getBgColorForCell(colIndex, colColors);
8502
8518
  const finalStyleForColumn = getFinalStyleObj(STYLE_FOR.COLUMN, baseStyle, TOTAL, colIndex);
8503
8519
  cells.push({
@@ -8506,7 +8522,7 @@
8506
8522
  ...finalStyleForColumn,
8507
8523
  left: colIndex * fixedColWidth,
8508
8524
  fontWeight: "bold",
8509
- borderLeft: "none"
8525
+ borderLeft: !isRowHeaderVisible ? BORDER_STYLE : "none"
8510
8526
  },
8511
8527
  childClassName: "left_fixed_data_cell_total"
8512
8528
  });
@@ -8514,7 +8530,7 @@
8514
8530
  if (headerAtStart && isColTotalOn) {
8515
8531
  cells.push({
8516
8532
  label: TOTAL,
8517
- style: bottomRowStyle,
8533
+ style: { ...bottomRowStyle, borderTop: !isColHeaderVisible ? BORDER_STYLE : "none" },
8518
8534
  childClassName: "left_fixed_data_cell_total"
8519
8535
  });
8520
8536
  }
@@ -8547,8 +8563,8 @@
8547
8563
  left: (fixedColCount - 1) * fixedColWidth,
8548
8564
  background: outerBg,
8549
8565
  border: BORDER_STYLE,
8550
- borderTop: "none",
8551
- borderLeft: "none",
8566
+ borderTop: !isColHeaderVisible ? BORDER_STYLE : "none",
8567
+ borderLeft: !isRowHeaderVisible ? BORDER_STYLE : "none",
8552
8568
  fontWeight: "bold"
8553
8569
  },
8554
8570
  childClassName: "left_fixed_data_cell_grand_total",
@@ -8582,7 +8598,7 @@
8582
8598
  DisplayUnits
8583
8599
  ]);
8584
8600
  const renderLeftFixedHeaders = React.useMemo(
8585
- () => cornerCells.map((c) => renderDataCell(c.label, c.style, "left_fixed_div", c.childClassName, void 0, c.dataBarColor)),
8601
+ () => cornerCells?.map((c) => renderDataCell(c.label, c.style, "left_fixed_div", c.childClassName, void 0, c.dataBarColor)),
8586
8602
  [cornerCells]
8587
8603
  );
8588
8604
  const colHeadersBase = React.useMemo(() => {
@@ -8626,6 +8642,7 @@
8626
8642
  width: cellWidth * span,
8627
8643
  height: cellHeight,
8628
8644
  borderTop: level === 0 ? BORDER_STYLE : "none",
8645
+ borderLeft: i === 0 && !isRowHeaderVisible && !(headerAtStart && isRowTotalOn) ? BORDER_STYLE : "none",
8629
8646
  childClassName: "col_header_data_cell"
8630
8647
  });
8631
8648
  }
@@ -8643,6 +8660,7 @@
8643
8660
  label,
8644
8661
  left: offsetLeft,
8645
8662
  top: level * cellHeight,
8663
+ borderTop: !isColHeaderVisible && (headerAtStart && isColTotalOn) ? BORDER_STYLE : "none",
8646
8664
  width: cellWidth,
8647
8665
  height: cellHeight,
8648
8666
  background: ShowHeatMap ? getBgColorForHetMap(0, idx) : getBgColorForCell(rowCount, dataColors),
@@ -8654,7 +8672,7 @@
8654
8672
  });
8655
8673
  }
8656
8674
  }
8657
- if (isRowTotalOn && !headerAtStart) {
8675
+ if (isRowTotalOn && !headerAtStart && isColHeaderVisible) {
8658
8676
  headers.push({
8659
8677
  ...colHeaderFont,
8660
8678
  label: TOTAL,
@@ -8717,6 +8735,8 @@
8717
8735
  left: level * fixedColWidth,
8718
8736
  width: fixedColWidth,
8719
8737
  height: cellHeight * span,
8738
+ //Border condition for the col header visibility with total
8739
+ borderTop: i === 0 && !isColHeaderVisible && !(headerAtStart && isColTotalOn) ? BORDER_STYLE : "none",
8720
8740
  borderLeft: level === 0 ? BORDER_STYLE : "none"
8721
8741
  });
8722
8742
  }
@@ -8746,13 +8766,14 @@
8746
8766
  fontWeight: "bold",
8747
8767
  rowIdxHeat: i,
8748
8768
  colIdxHeat: level,
8769
+ borderLeft: !isRowHeaderVisible ? BORDER_STYLE : "none",
8749
8770
  dataBarColor: innerBg
8750
8771
  });
8751
8772
  offsetTop += cellHeight;
8752
8773
  }
8753
8774
  }
8754
8775
  }
8755
- if (isColTotalOn && !headerAtStart) {
8776
+ if (isColTotalOn && !headerAtStart && isRowHeaderVisible) {
8756
8777
  headers.push({
8757
8778
  ...rowHeaderFont,
8758
8779
  label: TOTAL,
@@ -8868,6 +8889,12 @@
8868
8889
  if (conditionalFormatObj.backgroundColor) finalStyle.background = conditionalFormatObj.backgroundColor;
8869
8890
  if (conditionalFormatObj.color) finalStyle.color = conditionalFormatObj.color;
8870
8891
  }
8892
+ if (rowIdxHeat === 0 && !isColHeaderVisible && !(headerAtStart && isColTotalOn)) {
8893
+ finalStyle.borderTop = BORDER_STYLE;
8894
+ }
8895
+ if (colIdxHeat === 0 && !isRowHeaderVisible && !(isRowTotalOn && headerAtStart)) {
8896
+ finalStyle.borderLeft = BORDER_STYLE;
8897
+ }
8871
8898
  return renderDataCell(
8872
8899
  formattedValue,
8873
8900
  finalStyle,