pace-table-lib 1.0.53 → 1.0.55
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.
|
@@ -7897,7 +7897,7 @@
|
|
|
7897
7897
|
const TOTAL = "Total";
|
|
7898
7898
|
const MONTHS_SHORT = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"];
|
|
7899
7899
|
const MONTHS_FULL = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"];
|
|
7900
|
-
const DATE_FORMATS = [
|
|
7900
|
+
const DATE_FORMATS$1 = [
|
|
7901
7901
|
"MMM-YY",
|
|
7902
7902
|
"DD-MM-YYYY",
|
|
7903
7903
|
"MM-DD-YYYY",
|
|
@@ -8151,7 +8151,7 @@
|
|
|
8151
8151
|
safeDecimalValues = Math.min(20, Math.max(0, Math.floor(safeDecimalValues)));
|
|
8152
8152
|
let floatValue = Number(value);
|
|
8153
8153
|
if (isNaN(floatValue)) return value;
|
|
8154
|
-
if (DATE_FORMATS.includes(format)) {
|
|
8154
|
+
if (DATE_FORMATS$1.includes(format)) {
|
|
8155
8155
|
if (floatValue > 2958465 || floatValue <= 0) return value;
|
|
8156
8156
|
return formatDate(floatValue, format);
|
|
8157
8157
|
}
|
|
@@ -17605,6 +17605,7 @@
|
|
|
17605
17605
|
);
|
|
17606
17606
|
}, [rawDataMatrix, isDataBarOn, KPI.KPIBaseFormat]);
|
|
17607
17607
|
const cornerCells = React.useMemo(() => {
|
|
17608
|
+
if (!fixedColWidth) return;
|
|
17608
17609
|
const cells = [];
|
|
17609
17610
|
const baseStyle = {
|
|
17610
17611
|
width: fixedColWidth,
|
|
@@ -17798,7 +17799,6 @@
|
|
|
17798
17799
|
headerAtStart,
|
|
17799
17800
|
isRowTotalOn,
|
|
17800
17801
|
isColTotalOn,
|
|
17801
|
-
fixedColWidth,
|
|
17802
17802
|
colCellHeight,
|
|
17803
17803
|
rowCellHeight,
|
|
17804
17804
|
newNonFixedColCellWidth,
|
|
@@ -18038,6 +18038,7 @@
|
|
|
18038
18038
|
return map;
|
|
18039
18039
|
}, [measuresBySlice, rowColors]);
|
|
18040
18040
|
const rowHeadersBase = React.useMemo(() => {
|
|
18041
|
+
if (!fixedColWidth) return;
|
|
18041
18042
|
const headers = [];
|
|
18042
18043
|
const marks = measuresBySlice.map((m) => m.sliceMark);
|
|
18043
18044
|
const totalLevels = fixedColCount;
|
|
@@ -18211,7 +18212,7 @@
|
|
|
18211
18212
|
if (measures) {
|
|
18212
18213
|
const slJsx = getSparkLine(measures, styleObj);
|
|
18213
18214
|
if (headerAtStart) {
|
|
18214
|
-
cornerCells
|
|
18215
|
+
cornerCells?.push({
|
|
18215
18216
|
isSparkLine: true,
|
|
18216
18217
|
slJsx,
|
|
18217
18218
|
label: "",
|
|
@@ -18573,6 +18574,9 @@
|
|
|
18573
18574
|
}
|
|
18574
18575
|
style["--borderB"] = isLastRow ? outsideBorder : insideHBorder;
|
|
18575
18576
|
style["--borderL"] = isFirstCol && !isRowHeaderVisible && !headerAtStart && outsideBorder;
|
|
18577
|
+
if (isFirstCol && fixedColWidth <= 0) {
|
|
18578
|
+
style["--borderL"] = outsideBorder;
|
|
18579
|
+
}
|
|
18576
18580
|
}
|
|
18577
18581
|
function applyBordersToCornerCells(cells, fixedColWidth2, fixedRowCount2) {
|
|
18578
18582
|
return cells.map((cell, index) => {
|
|
@@ -18658,8 +18662,12 @@
|
|
|
18658
18662
|
const leftPx = style.left ?? 0;
|
|
18659
18663
|
const topPx = style.top ?? 0;
|
|
18660
18664
|
const heightPx = style.height || cellHeight;
|
|
18661
|
-
const
|
|
18662
|
-
const
|
|
18665
|
+
const isFixedHidden = fixedColWidth <= 0;
|
|
18666
|
+
const firstVisibleColIndex = isFixedHidden && isRowHeaderVisible ? 1 : 0;
|
|
18667
|
+
const colIndexAbs = Math.round(
|
|
18668
|
+
(leftPx - fixedColCount2 * fixedColWidth) / cellWidth
|
|
18669
|
+
);
|
|
18670
|
+
const isFirstCol = colIndexAbs === firstVisibleColIndex;
|
|
18663
18671
|
const isLastCol = colIndexAbs === lastHeaderColAbs;
|
|
18664
18672
|
const rowIndex = Math.round(topPx / cellHeight);
|
|
18665
18673
|
const rowSpan = Math.max(1, Math.round(heightPx / cellHeight));
|
|
@@ -18683,6 +18691,9 @@
|
|
|
18683
18691
|
newStyle["--borderR"] = outsideBorder;
|
|
18684
18692
|
newStyle["--borderT"] = outsideBorder;
|
|
18685
18693
|
}
|
|
18694
|
+
if (isFirstRow && isRowHeaderVisible && fixedColWidth <= 0) {
|
|
18695
|
+
newStyle["--borderL"] = outsideBorder;
|
|
18696
|
+
}
|
|
18686
18697
|
return { ...cell, ...newStyle };
|
|
18687
18698
|
});
|
|
18688
18699
|
return processed;
|
|
@@ -18756,6 +18767,23 @@
|
|
|
18756
18767
|
return DisplayUnits2;
|
|
18757
18768
|
})(DisplayUnits || {});
|
|
18758
18769
|
const NO_ENTRY_TOKENS = ["nolegendentryrow", "nocolentry"];
|
|
18770
|
+
const DATE_FORMATS = [
|
|
18771
|
+
"DD-MM-YYYY",
|
|
18772
|
+
"MM-DD-YYYY",
|
|
18773
|
+
"YYYY-MM-DD",
|
|
18774
|
+
"YYYY",
|
|
18775
|
+
"DD-MM",
|
|
18776
|
+
"MMM-YY",
|
|
18777
|
+
"MMM-YYYY",
|
|
18778
|
+
"YY-MMM",
|
|
18779
|
+
"MM-YYYY",
|
|
18780
|
+
"YYYY-MM",
|
|
18781
|
+
"MMMM-YYYY",
|
|
18782
|
+
"MMMM-YY",
|
|
18783
|
+
"DD-MMM",
|
|
18784
|
+
"DD-MMM-YY",
|
|
18785
|
+
"DD-MMM-YYYY"
|
|
18786
|
+
];
|
|
18759
18787
|
function hexToRgb(hex) {
|
|
18760
18788
|
const result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex);
|
|
18761
18789
|
return result ? {
|
|
@@ -18803,24 +18831,10 @@
|
|
|
18803
18831
|
}
|
|
18804
18832
|
function formatCellValue(value, formatConfig) {
|
|
18805
18833
|
if (value === null || value === void 0 || value === "") return "-";
|
|
18806
|
-
|
|
18807
|
-
"
|
|
18808
|
-
|
|
18809
|
-
|
|
18810
|
-
"YYYY",
|
|
18811
|
-
"DD-MM",
|
|
18812
|
-
"MMM-YY",
|
|
18813
|
-
"MMM-YYYY",
|
|
18814
|
-
"YY-MMM",
|
|
18815
|
-
"MM-YYYY",
|
|
18816
|
-
"YYYY-MM",
|
|
18817
|
-
"MMMM-YYYY",
|
|
18818
|
-
"MMMM-YY",
|
|
18819
|
-
"DD-MMM",
|
|
18820
|
-
"DD-MMM-YY",
|
|
18821
|
-
"DD-MMM-YYYY"
|
|
18822
|
-
];
|
|
18823
|
-
if (formatConfig?.numberFormat && DATE_FORMATS2.includes(formatConfig.numberFormat)) {
|
|
18834
|
+
if (formatConfig?.numberFormat && DATE_FORMATS.includes(formatConfig.numberFormat) && (value === 0 || value === "0" || value === "" || Number(value) === 0)) {
|
|
18835
|
+
return "0";
|
|
18836
|
+
}
|
|
18837
|
+
if (formatConfig?.numberFormat && DATE_FORMATS.includes(formatConfig.numberFormat)) {
|
|
18824
18838
|
return applyDateFormat(String(value), formatConfig.numberFormat);
|
|
18825
18839
|
}
|
|
18826
18840
|
const num = typeof value === "string" ? parseFloat(value) : value;
|
|
@@ -19001,7 +19015,7 @@
|
|
|
19001
19015
|
return new Date(excelEpoch.getTime() + serial * 864e5);
|
|
19002
19016
|
}
|
|
19003
19017
|
function applyDateFormat(value, format) {
|
|
19004
|
-
if (!value || !format) return value;
|
|
19018
|
+
if (!value || !format || format === "None") return value;
|
|
19005
19019
|
const trimmed = value.trim();
|
|
19006
19020
|
let d;
|
|
19007
19021
|
const serialNum = Number(trimmed);
|
|
@@ -19879,6 +19893,8 @@
|
|
|
19879
19893
|
let bg;
|
|
19880
19894
|
if (DataField.DataFieldBackgroundcolor === "Row Band") {
|
|
19881
19895
|
bg = bi % 2 === 0 ? dataColors.even : dataColors.odd;
|
|
19896
|
+
} else if (DataField.DataFieldBackgroundcolor === "Alternate Rows") {
|
|
19897
|
+
bg = rowIdx % 2 === 0 ? dataColors.even : dataColors.odd;
|
|
19882
19898
|
} else if (DataField.DataFieldBackgroundcolor === "Column Band") {
|
|
19883
19899
|
bg = cbi % 2 === 0 ? dataColors.even : dataColors.odd;
|
|
19884
19900
|
} else if (DataField.DataFieldBackgroundcolor === "Single") {
|