pace-table-lib 1.0.67 → 1.0.69
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.
|
@@ -17416,6 +17416,13 @@ function StaticTable({
|
|
|
17416
17416
|
const outsideBorder = isOutsideBorderVisible ? createBorder(Border.LineWidth, Border.LineStyle, Border.LineColor) : null;
|
|
17417
17417
|
const insideVBorder = isInsideVerticalBVisible ? createBorder(Border.VerticalBorderLineWidth, Border.VerticalBorderLineStyle, Border.VerticalBorderLineColor) : null;
|
|
17418
17418
|
const insideHBorder = isInsideHorizontalBVisible ? createBorder(Border.HorizontalBorderLineWidth, Border.HorizontalBorderLineStyle, Border.HorizontalBorderLineColor) : null;
|
|
17419
|
+
const {
|
|
17420
|
+
ShowHeatMap,
|
|
17421
|
+
HeatMapView,
|
|
17422
|
+
HeatMapMinColor,
|
|
17423
|
+
HeatMapMaxColor
|
|
17424
|
+
} = HeatMap || {};
|
|
17425
|
+
const gridRef = useRef(null);
|
|
17419
17426
|
const renderDataCell = (label, styles, className, childClassName, toolTip, dataBarBg) => /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
17420
17427
|
"div",
|
|
17421
17428
|
{
|
|
@@ -17428,11 +17435,13 @@ function StaticTable({
|
|
|
17428
17435
|
className: `${childClassName} cell_inner`,
|
|
17429
17436
|
style: {
|
|
17430
17437
|
fontFamily: styles.fontFamily,
|
|
17431
|
-
background: dataBarBg ?? "none"
|
|
17438
|
+
background: dataBarBg ?? "none",
|
|
17439
|
+
//Show icon only then align icon to center
|
|
17440
|
+
...styles?.iconPosition === ICON_POSITION.OIcon ? { justifyContent: "center" } : {}
|
|
17432
17441
|
},
|
|
17433
17442
|
children: [
|
|
17434
17443
|
styles && styles?.iconPosition === ICON_POSITION.Left && styles?.iconUrl && /* @__PURE__ */ jsxRuntimeExports.jsx("img", { src: styles?.iconUrl, className: "cell_icon left" }),
|
|
17435
|
-
styles && styles?.iconPosition === ICON_POSITION.OIcon && styles?.iconUrl ? /* @__PURE__ */ jsxRuntimeExports.jsx("img", { src: styles?.iconUrl, className: "cell_icon
|
|
17444
|
+
styles && styles?.iconPosition === ICON_POSITION.OIcon && styles?.iconUrl ? /* @__PURE__ */ jsxRuntimeExports.jsx("img", { src: styles?.iconUrl, className: "cell_icon" }) : /* @__PURE__ */ jsxRuntimeExports.jsx("span", { style: { textAlign: styles.justifyContent }, className: "cell_text", children: label }),
|
|
17436
17445
|
styles && styles?.iconPosition === ICON_POSITION.Right && styles?.iconUrl && /* @__PURE__ */ jsxRuntimeExports.jsx("img", { src: styles?.iconUrl, className: "cell_icon right" })
|
|
17437
17446
|
]
|
|
17438
17447
|
}
|
|
@@ -17479,12 +17488,6 @@ function StaticTable({
|
|
|
17479
17488
|
color: DataFieldColor,
|
|
17480
17489
|
...getFontStyleObj(DataFieldFontStyle)
|
|
17481
17490
|
}), [DataField]);
|
|
17482
|
-
const {
|
|
17483
|
-
ShowHeatMap,
|
|
17484
|
-
HeatMapView,
|
|
17485
|
-
HeatMapMinColor,
|
|
17486
|
-
HeatMapMaxColor
|
|
17487
|
-
} = HeatMap || {};
|
|
17488
17491
|
const fixedRowCount = useMemo(() => {
|
|
17489
17492
|
if (!isColHeaderVisible) {
|
|
17490
17493
|
return headerAtStart && isColTotalOn ? 1 : 0;
|
|
@@ -17592,7 +17595,6 @@ function StaticTable({
|
|
|
17592
17595
|
Table2.TableWidth,
|
|
17593
17596
|
Table2.FixHeaderWidth
|
|
17594
17597
|
]);
|
|
17595
|
-
const gridRef = useRef(null);
|
|
17596
17598
|
useEffect(() => {
|
|
17597
17599
|
const t = setTimeout(() => {
|
|
17598
17600
|
if (gridRef.current) {
|
|
@@ -18212,10 +18214,10 @@ function StaticTable({
|
|
|
18212
18214
|
});
|
|
18213
18215
|
if (isSparkLineVisible && isSlAtStart && !headerAtStart) {
|
|
18214
18216
|
const styleObj = {
|
|
18215
|
-
width:
|
|
18217
|
+
width: fixedColWidth,
|
|
18216
18218
|
height: rowCellHeight,
|
|
18217
18219
|
top: baseTop + measuresBySlice.length * rowCellHeight,
|
|
18218
|
-
left:
|
|
18220
|
+
left: widthForTheTotal,
|
|
18219
18221
|
background: getBgColorForCell(rowCount - 1, rowColors),
|
|
18220
18222
|
fontWeight: "bold"
|
|
18221
18223
|
};
|
|
@@ -18254,7 +18256,7 @@ function StaticTable({
|
|
|
18254
18256
|
top: fixedRowCount * rowCellHeight + rowIdx * rowCellHeight,
|
|
18255
18257
|
// directly under headers
|
|
18256
18258
|
left: sparkColIndex * fixedColWidth,
|
|
18257
|
-
background:
|
|
18259
|
+
background: rowHeaderBandColorMap[item.sliceMark[0]],
|
|
18258
18260
|
display: "flex",
|
|
18259
18261
|
justifyContent: "center",
|
|
18260
18262
|
alignItems: "center"
|
|
@@ -18401,40 +18403,44 @@ function StaticTable({
|
|
|
18401
18403
|
return obj;
|
|
18402
18404
|
}
|
|
18403
18405
|
function shouldApplyFormat(value, format, type, level) {
|
|
18404
|
-
|
|
18405
|
-
|
|
18406
|
-
|
|
18407
|
-
const formattedValue = formatValue(value, void 0, DataFieldDecimalPrecision);
|
|
18408
|
-
const operator = format.operator?.toLowerCase();
|
|
18409
|
-
if (operator === "contains" && format.containsStr) {
|
|
18410
|
-
return value?.toLowerCase().includes(format.containsStr.toLowerCase());
|
|
18411
|
-
}
|
|
18412
|
-
if (operator === "duplicate") {
|
|
18413
|
-
const currentVal = value?.toLowerCase();
|
|
18414
|
-
if (type === CONDITIONAL_FORMAT_FOR.ROW) {
|
|
18415
|
-
const allChildren = measuresBySlice.map((item) => item.sliceMark[level]?.toLowerCase()).filter((v) => v);
|
|
18416
|
-
return allChildren.filter((v) => v === currentVal).length > 1;
|
|
18417
|
-
} else if (type === CONDITIONAL_FORMAT_FOR.COLUMN) {
|
|
18418
|
-
return dimensionMarks.filter((row) => row.some((item) => item?.toLowerCase() === currentVal)).length > 1;
|
|
18406
|
+
try {
|
|
18407
|
+
if (!format.formattingScheme || format.formattingScheme.toLowerCase() !== "conditionally") {
|
|
18408
|
+
return true;
|
|
18419
18409
|
}
|
|
18420
|
-
|
|
18421
|
-
|
|
18422
|
-
|
|
18410
|
+
const operator = format.operator?.toLowerCase();
|
|
18411
|
+
if (operator === "contains" && format.containsStr) {
|
|
18412
|
+
return value?.toLowerCase().includes(format.containsStr.toLowerCase());
|
|
18413
|
+
}
|
|
18414
|
+
if (operator === "duplicate") {
|
|
18415
|
+
const currentVal = value?.toLowerCase();
|
|
18416
|
+
if (type === CONDITIONAL_FORMAT_FOR.ROW) {
|
|
18417
|
+
const marks = measuresBySlice.map((m) => m.sliceMark);
|
|
18418
|
+
const renderedValues = measuresBySlice.map((item, i) => isFirstOccurrence(marks, i, level) ? item.sliceMark[level]?.toLowerCase() : null).filter((v) => v !== null && v !== void 0);
|
|
18419
|
+
return renderedValues.filter((v) => v === currentVal).length > 1;
|
|
18420
|
+
} else if (type === CONDITIONAL_FORMAT_FOR.COLUMN) {
|
|
18421
|
+
const renderedValues = dimensionMarks.map((d, i) => isFirstOccurrence(dimensionMarks, i, level) ? d[level]?.toLowerCase() : null).filter((v) => v !== null && v !== void 0);
|
|
18422
|
+
return renderedValues.filter((v) => v === currentVal).length > 1;
|
|
18423
|
+
}
|
|
18424
|
+
}
|
|
18425
|
+
if (type === CONDITIONAL_FORMAT_FOR.VALUE) {
|
|
18426
|
+
const formattedValue = formatValue(value, void 0, DataFieldDecimalPrecision);
|
|
18427
|
+
const numericVal = Number(formattedValue);
|
|
18428
|
+
const checkVal1 = Number(format?.checkValue);
|
|
18429
|
+
const checkVal2 = Number(format?.secondCheckValue);
|
|
18423
18430
|
if (operator === "in between") {
|
|
18424
|
-
if (
|
|
18425
|
-
return
|
|
18431
|
+
if (checkVal1 && checkVal2) {
|
|
18432
|
+
return numericVal >= checkVal1 && numericVal <= checkVal2;
|
|
18426
18433
|
}
|
|
18427
18434
|
return false;
|
|
18428
18435
|
} else if (operator === "not between") {
|
|
18429
|
-
if (
|
|
18430
|
-
return
|
|
18436
|
+
if (checkVal1 && checkVal2) {
|
|
18437
|
+
return numericVal < checkVal1 || numericVal > checkVal2;
|
|
18431
18438
|
}
|
|
18432
18439
|
return false;
|
|
18433
18440
|
}
|
|
18434
|
-
return compareVal(
|
|
18435
|
-
} catch {
|
|
18436
|
-
return false;
|
|
18441
|
+
return compareVal(numericVal, format?.operator, Number(format?.checkValue));
|
|
18437
18442
|
}
|
|
18443
|
+
} catch (error) {
|
|
18438
18444
|
}
|
|
18439
18445
|
return false;
|
|
18440
18446
|
}
|
|
@@ -19959,6 +19965,7 @@ const PivotTable = ({
|
|
|
19959
19965
|
}
|
|
19960
19966
|
}
|
|
19961
19967
|
let percentage = 0;
|
|
19968
|
+
let kpiColor = "";
|
|
19962
19969
|
if (KPI.KPIVisibility) {
|
|
19963
19970
|
const baseType = tableStyleProps.KPI.KPIBaseFormat;
|
|
19964
19971
|
const values = baseType === "Column-wise" ? flatRows?.map(
|
|
@@ -19975,7 +19982,7 @@ const PivotTable = ({
|
|
|
19975
19982
|
0,
|
|
19976
19983
|
Math.min(100, (Number(rawValue) - min) / (max - min) * 100)
|
|
19977
19984
|
) : 0;
|
|
19978
|
-
interpolateColor(
|
|
19985
|
+
kpiColor = interpolateColor(
|
|
19979
19986
|
KPI.KPIMinColor,
|
|
19980
19987
|
KPI.KPIMaxColor,
|
|
19981
19988
|
percentage / 100
|
|
@@ -20018,7 +20025,7 @@ const PivotTable = ({
|
|
|
20018
20025
|
"div",
|
|
20019
20026
|
{
|
|
20020
20027
|
className: "kpi-wrapper cell_inner_pivot",
|
|
20021
|
-
style: { justifyContent: dataCellFont.justifyContent },
|
|
20028
|
+
style: { justifyContent: dataCellFont.justifyContent, background: kpiColor ?? "none" },
|
|
20022
20029
|
children: [
|
|
20023
20030
|
conditionalFormatObj && conditionalFormatObj?.iconPosition === ICON_POSITION.Left && conditionalFormatObj?.iconUrl && /* @__PURE__ */ jsxRuntimeExports.jsx("img", { src: conditionalFormatObj?.iconUrl, className: "cell_icon_pivot left" }),
|
|
20024
20031
|
conditionalFormatObj && conditionalFormatObj?.iconPosition === ICON_POSITION.OIcon && conditionalFormatObj?.iconUrl ? /* @__PURE__ */ jsxRuntimeExports.jsx("img", { src: conditionalFormatObj?.iconUrl, className: "cell_icon_pivot left" }) : /* @__PURE__ */ jsxRuntimeExports.jsx("span", { style: { textAlign: dataCellFont.justifyContent, ...shouldWrap ? { wordBreak: "break-word", whiteSpace: "normal" } : { whiteSpace: "nowrap", overflow: "hidden", textOverflow: "ellipsis" } }, className: "kpi-text cell_text_pivot_pivot", children: formattedValue }),
|