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.
|
@@ -8299,6 +8299,8 @@ function StaticTable({
|
|
|
8299
8299
|
const rowColors = getBgColor(RowHeader, "row");
|
|
8300
8300
|
const colColors = getBgColor(ColumnHeader, "column");
|
|
8301
8301
|
const dataColors = getBgColor(DataField, "dataField");
|
|
8302
|
+
const isColHeaderVisible = !ColumnHeader?.HideColumnHeader;
|
|
8303
|
+
const isRowHeaderVisible = !RowHeader?.HideRowHeader;
|
|
8302
8304
|
const rowHeaderFont = useMemo(() => ({
|
|
8303
8305
|
color: RowHeader.RowHeaderColor,
|
|
8304
8306
|
fontFamily: RowHeader.RowHeaderFontFamily,
|
|
@@ -8327,10 +8329,16 @@ function StaticTable({
|
|
|
8327
8329
|
HeatMapMaxColor
|
|
8328
8330
|
} = HeatMap || {};
|
|
8329
8331
|
const fixedRowCount = useMemo(() => {
|
|
8332
|
+
if (!isColHeaderVisible) {
|
|
8333
|
+
return headerAtStart && isColTotalOn ? 1 : 0;
|
|
8334
|
+
}
|
|
8330
8335
|
const base = Math.max(...dimensionMarks.map((d) => d.length));
|
|
8331
8336
|
return base + (headerAtStart && isColTotalOn ? 1 : 0);
|
|
8332
8337
|
}, [dimensionMarks, headerAtStart, isColTotalOn]);
|
|
8333
8338
|
const fixedColCount = useMemo(() => {
|
|
8339
|
+
if (!isRowHeaderVisible) {
|
|
8340
|
+
return headerAtStart && isRowTotalOn ? 1 : 0;
|
|
8341
|
+
}
|
|
8334
8342
|
const base = leftFixedCellNameList ? leftFixedCellNameList.length : 1;
|
|
8335
8343
|
return base + (headerAtStart && isRowTotalOn ? 1 : 0);
|
|
8336
8344
|
}, [leftFixedCellNameList, headerAtStart, isRowTotalOn]);
|
|
@@ -8450,35 +8458,43 @@ function StaticTable({
|
|
|
8450
8458
|
borderTop: "none",
|
|
8451
8459
|
fontWeight: "bold"
|
|
8452
8460
|
};
|
|
8453
|
-
if (
|
|
8454
|
-
leftFixedCellNameList.
|
|
8455
|
-
|
|
8456
|
-
|
|
8461
|
+
if (isColHeaderVisible && isRowHeaderVisible) {
|
|
8462
|
+
if (leftFixedCellNameList && leftFixedCellNameList.length > 0) {
|
|
8463
|
+
leftFixedCellNameList.forEach((label, col) => {
|
|
8464
|
+
baseStyle.background = getBgColorForCell(col, colColors);
|
|
8465
|
+
const finalStyleForColumn = getFinalStyleObj(STYLE_FOR.COLUMN, baseStyle, label, col);
|
|
8466
|
+
cells.push({
|
|
8467
|
+
label,
|
|
8468
|
+
style: {
|
|
8469
|
+
...finalStyleForColumn,
|
|
8470
|
+
borderLeft: col === 0 ? BORDER_STYLE : "none",
|
|
8471
|
+
left: col * fixedColWidth
|
|
8472
|
+
},
|
|
8473
|
+
childClassName: "left_fixed_data_cell"
|
|
8474
|
+
});
|
|
8475
|
+
});
|
|
8476
|
+
} else {
|
|
8457
8477
|
cells.push({
|
|
8458
|
-
label,
|
|
8478
|
+
label: "",
|
|
8459
8479
|
style: {
|
|
8460
|
-
...
|
|
8461
|
-
borderLeft:
|
|
8462
|
-
left:
|
|
8480
|
+
...baseStyle,
|
|
8481
|
+
borderLeft: BORDER_STYLE,
|
|
8482
|
+
left: 0,
|
|
8483
|
+
background: getBgColorForCell(1, colColors)
|
|
8484
|
+
// or keep a default color
|
|
8463
8485
|
},
|
|
8464
8486
|
childClassName: "left_fixed_data_cell"
|
|
8465
8487
|
});
|
|
8466
|
-
}
|
|
8467
|
-
} else {
|
|
8468
|
-
cells.push({
|
|
8469
|
-
label: "",
|
|
8470
|
-
style: {
|
|
8471
|
-
...baseStyle,
|
|
8472
|
-
borderLeft: BORDER_STYLE,
|
|
8473
|
-
left: 0,
|
|
8474
|
-
background: getBgColorForCell(1, colColors)
|
|
8475
|
-
// or keep a default color
|
|
8476
|
-
},
|
|
8477
|
-
childClassName: "left_fixed_data_cell"
|
|
8478
|
-
});
|
|
8488
|
+
}
|
|
8479
8489
|
}
|
|
8480
8490
|
if (headerAtStart && isRowTotalOn) {
|
|
8481
|
-
|
|
8491
|
+
let colIndex = 1;
|
|
8492
|
+
if (leftFixedCellNameList) {
|
|
8493
|
+
colIndex = leftFixedCellNameList.length;
|
|
8494
|
+
}
|
|
8495
|
+
if (!isRowHeaderVisible) {
|
|
8496
|
+
colIndex = 0;
|
|
8497
|
+
}
|
|
8482
8498
|
baseStyle.background = getBgColorForCell(colIndex, colColors);
|
|
8483
8499
|
const finalStyleForColumn = getFinalStyleObj(STYLE_FOR.COLUMN, baseStyle, TOTAL, colIndex);
|
|
8484
8500
|
cells.push({
|
|
@@ -8487,7 +8503,7 @@ function StaticTable({
|
|
|
8487
8503
|
...finalStyleForColumn,
|
|
8488
8504
|
left: colIndex * fixedColWidth,
|
|
8489
8505
|
fontWeight: "bold",
|
|
8490
|
-
borderLeft: "none"
|
|
8506
|
+
borderLeft: !isRowHeaderVisible ? BORDER_STYLE : "none"
|
|
8491
8507
|
},
|
|
8492
8508
|
childClassName: "left_fixed_data_cell_total"
|
|
8493
8509
|
});
|
|
@@ -8495,7 +8511,7 @@ function StaticTable({
|
|
|
8495
8511
|
if (headerAtStart && isColTotalOn) {
|
|
8496
8512
|
cells.push({
|
|
8497
8513
|
label: TOTAL,
|
|
8498
|
-
style: bottomRowStyle,
|
|
8514
|
+
style: { ...bottomRowStyle, borderTop: !isColHeaderVisible ? BORDER_STYLE : "none" },
|
|
8499
8515
|
childClassName: "left_fixed_data_cell_total"
|
|
8500
8516
|
});
|
|
8501
8517
|
}
|
|
@@ -8528,8 +8544,8 @@ function StaticTable({
|
|
|
8528
8544
|
left: (fixedColCount - 1) * fixedColWidth,
|
|
8529
8545
|
background: outerBg,
|
|
8530
8546
|
border: BORDER_STYLE,
|
|
8531
|
-
borderTop: "none",
|
|
8532
|
-
borderLeft: "none",
|
|
8547
|
+
borderTop: !isColHeaderVisible ? BORDER_STYLE : "none",
|
|
8548
|
+
borderLeft: !isRowHeaderVisible ? BORDER_STYLE : "none",
|
|
8533
8549
|
fontWeight: "bold"
|
|
8534
8550
|
},
|
|
8535
8551
|
childClassName: "left_fixed_data_cell_grand_total",
|
|
@@ -8563,7 +8579,7 @@ function StaticTable({
|
|
|
8563
8579
|
DisplayUnits
|
|
8564
8580
|
]);
|
|
8565
8581
|
const renderLeftFixedHeaders = useMemo(
|
|
8566
|
-
() => cornerCells
|
|
8582
|
+
() => cornerCells?.map((c) => renderDataCell(c.label, c.style, "left_fixed_div", c.childClassName, void 0, c.dataBarColor)),
|
|
8567
8583
|
[cornerCells]
|
|
8568
8584
|
);
|
|
8569
8585
|
const colHeadersBase = useMemo(() => {
|
|
@@ -8607,6 +8623,7 @@ function StaticTable({
|
|
|
8607
8623
|
width: cellWidth * span,
|
|
8608
8624
|
height: cellHeight,
|
|
8609
8625
|
borderTop: level === 0 ? BORDER_STYLE : "none",
|
|
8626
|
+
borderLeft: i === 0 && !isRowHeaderVisible && !(headerAtStart && isRowTotalOn) ? BORDER_STYLE : "none",
|
|
8610
8627
|
childClassName: "col_header_data_cell"
|
|
8611
8628
|
});
|
|
8612
8629
|
}
|
|
@@ -8624,6 +8641,7 @@ function StaticTable({
|
|
|
8624
8641
|
label,
|
|
8625
8642
|
left: offsetLeft,
|
|
8626
8643
|
top: level * cellHeight,
|
|
8644
|
+
borderTop: !isColHeaderVisible && (headerAtStart && isColTotalOn) ? BORDER_STYLE : "none",
|
|
8627
8645
|
width: cellWidth,
|
|
8628
8646
|
height: cellHeight,
|
|
8629
8647
|
background: ShowHeatMap ? getBgColorForHetMap(0, idx) : getBgColorForCell(rowCount, dataColors),
|
|
@@ -8635,7 +8653,7 @@ function StaticTable({
|
|
|
8635
8653
|
});
|
|
8636
8654
|
}
|
|
8637
8655
|
}
|
|
8638
|
-
if (isRowTotalOn && !headerAtStart) {
|
|
8656
|
+
if (isRowTotalOn && !headerAtStart && isColHeaderVisible) {
|
|
8639
8657
|
headers.push({
|
|
8640
8658
|
...colHeaderFont,
|
|
8641
8659
|
label: TOTAL,
|
|
@@ -8698,6 +8716,8 @@ function StaticTable({
|
|
|
8698
8716
|
left: level * fixedColWidth,
|
|
8699
8717
|
width: fixedColWidth,
|
|
8700
8718
|
height: cellHeight * span,
|
|
8719
|
+
//Border condition for the col header visibility with total
|
|
8720
|
+
borderTop: i === 0 && !isColHeaderVisible && !(headerAtStart && isColTotalOn) ? BORDER_STYLE : "none",
|
|
8701
8721
|
borderLeft: level === 0 ? BORDER_STYLE : "none"
|
|
8702
8722
|
});
|
|
8703
8723
|
}
|
|
@@ -8727,13 +8747,14 @@ function StaticTable({
|
|
|
8727
8747
|
fontWeight: "bold",
|
|
8728
8748
|
rowIdxHeat: i,
|
|
8729
8749
|
colIdxHeat: level,
|
|
8750
|
+
borderLeft: !isRowHeaderVisible ? BORDER_STYLE : "none",
|
|
8730
8751
|
dataBarColor: innerBg
|
|
8731
8752
|
});
|
|
8732
8753
|
offsetTop += cellHeight;
|
|
8733
8754
|
}
|
|
8734
8755
|
}
|
|
8735
8756
|
}
|
|
8736
|
-
if (isColTotalOn && !headerAtStart) {
|
|
8757
|
+
if (isColTotalOn && !headerAtStart && isRowHeaderVisible) {
|
|
8737
8758
|
headers.push({
|
|
8738
8759
|
...rowHeaderFont,
|
|
8739
8760
|
label: TOTAL,
|
|
@@ -8849,6 +8870,12 @@ function StaticTable({
|
|
|
8849
8870
|
if (conditionalFormatObj.backgroundColor) finalStyle.background = conditionalFormatObj.backgroundColor;
|
|
8850
8871
|
if (conditionalFormatObj.color) finalStyle.color = conditionalFormatObj.color;
|
|
8851
8872
|
}
|
|
8873
|
+
if (rowIdxHeat === 0 && !isColHeaderVisible && !(headerAtStart && isColTotalOn)) {
|
|
8874
|
+
finalStyle.borderTop = BORDER_STYLE;
|
|
8875
|
+
}
|
|
8876
|
+
if (colIdxHeat === 0 && !isRowHeaderVisible && !(isRowTotalOn && headerAtStart)) {
|
|
8877
|
+
finalStyle.borderLeft = BORDER_STYLE;
|
|
8878
|
+
}
|
|
8852
8879
|
return renderDataCell(
|
|
8853
8880
|
formattedValue,
|
|
8854
8881
|
finalStyle,
|