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.
|
@@ -7878,7 +7878,7 @@ var STYLE_FOR = /* @__PURE__ */ ((STYLE_FOR2) => {
|
|
|
7878
7878
|
const TOTAL = "Total";
|
|
7879
7879
|
const MONTHS_SHORT = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"];
|
|
7880
7880
|
const MONTHS_FULL = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"];
|
|
7881
|
-
const DATE_FORMATS = [
|
|
7881
|
+
const DATE_FORMATS$1 = [
|
|
7882
7882
|
"MMM-YY",
|
|
7883
7883
|
"DD-MM-YYYY",
|
|
7884
7884
|
"MM-DD-YYYY",
|
|
@@ -8132,7 +8132,7 @@ function formatValue(value, format, decimalValues = 2, displayUnit = DISPLAY_UNI
|
|
|
8132
8132
|
safeDecimalValues = Math.min(20, Math.max(0, Math.floor(safeDecimalValues)));
|
|
8133
8133
|
let floatValue = Number(value);
|
|
8134
8134
|
if (isNaN(floatValue)) return value;
|
|
8135
|
-
if (DATE_FORMATS.includes(format)) {
|
|
8135
|
+
if (DATE_FORMATS$1.includes(format)) {
|
|
8136
8136
|
if (floatValue > 2958465 || floatValue <= 0) return value;
|
|
8137
8137
|
return formatDate(floatValue, format);
|
|
8138
8138
|
}
|
|
@@ -17586,6 +17586,7 @@ function StaticTable({
|
|
|
17586
17586
|
);
|
|
17587
17587
|
}, [rawDataMatrix, isDataBarOn, KPI.KPIBaseFormat]);
|
|
17588
17588
|
const cornerCells = useMemo(() => {
|
|
17589
|
+
if (!fixedColWidth) return;
|
|
17589
17590
|
const cells = [];
|
|
17590
17591
|
const baseStyle = {
|
|
17591
17592
|
width: fixedColWidth,
|
|
@@ -17779,7 +17780,6 @@ function StaticTable({
|
|
|
17779
17780
|
headerAtStart,
|
|
17780
17781
|
isRowTotalOn,
|
|
17781
17782
|
isColTotalOn,
|
|
17782
|
-
fixedColWidth,
|
|
17783
17783
|
colCellHeight,
|
|
17784
17784
|
rowCellHeight,
|
|
17785
17785
|
newNonFixedColCellWidth,
|
|
@@ -18019,6 +18019,7 @@ function StaticTable({
|
|
|
18019
18019
|
return map;
|
|
18020
18020
|
}, [measuresBySlice, rowColors]);
|
|
18021
18021
|
const rowHeadersBase = useMemo(() => {
|
|
18022
|
+
if (!fixedColWidth) return;
|
|
18022
18023
|
const headers = [];
|
|
18023
18024
|
const marks = measuresBySlice.map((m) => m.sliceMark);
|
|
18024
18025
|
const totalLevels = fixedColCount;
|
|
@@ -18192,7 +18193,7 @@ function StaticTable({
|
|
|
18192
18193
|
if (measures) {
|
|
18193
18194
|
const slJsx = getSparkLine(measures, styleObj);
|
|
18194
18195
|
if (headerAtStart) {
|
|
18195
|
-
cornerCells
|
|
18196
|
+
cornerCells?.push({
|
|
18196
18197
|
isSparkLine: true,
|
|
18197
18198
|
slJsx,
|
|
18198
18199
|
label: "",
|
|
@@ -18554,6 +18555,9 @@ function StaticTable({
|
|
|
18554
18555
|
}
|
|
18555
18556
|
style["--borderB"] = isLastRow ? outsideBorder : insideHBorder;
|
|
18556
18557
|
style["--borderL"] = isFirstCol && !isRowHeaderVisible && !headerAtStart && outsideBorder;
|
|
18558
|
+
if (isFirstCol && fixedColWidth <= 0) {
|
|
18559
|
+
style["--borderL"] = outsideBorder;
|
|
18560
|
+
}
|
|
18557
18561
|
}
|
|
18558
18562
|
function applyBordersToCornerCells(cells, fixedColWidth2, fixedRowCount2) {
|
|
18559
18563
|
return cells.map((cell, index) => {
|
|
@@ -18639,8 +18643,12 @@ function StaticTable({
|
|
|
18639
18643
|
const leftPx = style.left ?? 0;
|
|
18640
18644
|
const topPx = style.top ?? 0;
|
|
18641
18645
|
const heightPx = style.height || cellHeight;
|
|
18642
|
-
const
|
|
18643
|
-
const
|
|
18646
|
+
const isFixedHidden = fixedColWidth <= 0;
|
|
18647
|
+
const firstVisibleColIndex = isFixedHidden && isRowHeaderVisible ? 1 : 0;
|
|
18648
|
+
const colIndexAbs = Math.round(
|
|
18649
|
+
(leftPx - fixedColCount2 * fixedColWidth) / cellWidth
|
|
18650
|
+
);
|
|
18651
|
+
const isFirstCol = colIndexAbs === firstVisibleColIndex;
|
|
18644
18652
|
const isLastCol = colIndexAbs === lastHeaderColAbs;
|
|
18645
18653
|
const rowIndex = Math.round(topPx / cellHeight);
|
|
18646
18654
|
const rowSpan = Math.max(1, Math.round(heightPx / cellHeight));
|
|
@@ -18664,6 +18672,9 @@ function StaticTable({
|
|
|
18664
18672
|
newStyle["--borderR"] = outsideBorder;
|
|
18665
18673
|
newStyle["--borderT"] = outsideBorder;
|
|
18666
18674
|
}
|
|
18675
|
+
if (isFirstRow && isRowHeaderVisible && fixedColWidth <= 0) {
|
|
18676
|
+
newStyle["--borderL"] = outsideBorder;
|
|
18677
|
+
}
|
|
18667
18678
|
return { ...cell, ...newStyle };
|
|
18668
18679
|
});
|
|
18669
18680
|
return processed;
|
|
@@ -18737,6 +18748,23 @@ var DisplayUnits = /* @__PURE__ */ ((DisplayUnits2) => {
|
|
|
18737
18748
|
return DisplayUnits2;
|
|
18738
18749
|
})(DisplayUnits || {});
|
|
18739
18750
|
const NO_ENTRY_TOKENS = ["nolegendentryrow", "nocolentry"];
|
|
18751
|
+
const DATE_FORMATS = [
|
|
18752
|
+
"DD-MM-YYYY",
|
|
18753
|
+
"MM-DD-YYYY",
|
|
18754
|
+
"YYYY-MM-DD",
|
|
18755
|
+
"YYYY",
|
|
18756
|
+
"DD-MM",
|
|
18757
|
+
"MMM-YY",
|
|
18758
|
+
"MMM-YYYY",
|
|
18759
|
+
"YY-MMM",
|
|
18760
|
+
"MM-YYYY",
|
|
18761
|
+
"YYYY-MM",
|
|
18762
|
+
"MMMM-YYYY",
|
|
18763
|
+
"MMMM-YY",
|
|
18764
|
+
"DD-MMM",
|
|
18765
|
+
"DD-MMM-YY",
|
|
18766
|
+
"DD-MMM-YYYY"
|
|
18767
|
+
];
|
|
18740
18768
|
function hexToRgb(hex) {
|
|
18741
18769
|
const result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex);
|
|
18742
18770
|
return result ? {
|
|
@@ -18784,24 +18812,10 @@ function getRowDisplayName(segments, measureValue) {
|
|
|
18784
18812
|
}
|
|
18785
18813
|
function formatCellValue(value, formatConfig) {
|
|
18786
18814
|
if (value === null || value === void 0 || value === "") return "-";
|
|
18787
|
-
|
|
18788
|
-
"
|
|
18789
|
-
|
|
18790
|
-
|
|
18791
|
-
"YYYY",
|
|
18792
|
-
"DD-MM",
|
|
18793
|
-
"MMM-YY",
|
|
18794
|
-
"MMM-YYYY",
|
|
18795
|
-
"YY-MMM",
|
|
18796
|
-
"MM-YYYY",
|
|
18797
|
-
"YYYY-MM",
|
|
18798
|
-
"MMMM-YYYY",
|
|
18799
|
-
"MMMM-YY",
|
|
18800
|
-
"DD-MMM",
|
|
18801
|
-
"DD-MMM-YY",
|
|
18802
|
-
"DD-MMM-YYYY"
|
|
18803
|
-
];
|
|
18804
|
-
if (formatConfig?.numberFormat && DATE_FORMATS2.includes(formatConfig.numberFormat)) {
|
|
18815
|
+
if (formatConfig?.numberFormat && DATE_FORMATS.includes(formatConfig.numberFormat) && (value === 0 || value === "0" || value === "" || Number(value) === 0)) {
|
|
18816
|
+
return "0";
|
|
18817
|
+
}
|
|
18818
|
+
if (formatConfig?.numberFormat && DATE_FORMATS.includes(formatConfig.numberFormat)) {
|
|
18805
18819
|
return applyDateFormat(String(value), formatConfig.numberFormat);
|
|
18806
18820
|
}
|
|
18807
18821
|
const num = typeof value === "string" ? parseFloat(value) : value;
|
|
@@ -18982,7 +18996,7 @@ function excelSerialToDate(serial) {
|
|
|
18982
18996
|
return new Date(excelEpoch.getTime() + serial * 864e5);
|
|
18983
18997
|
}
|
|
18984
18998
|
function applyDateFormat(value, format) {
|
|
18985
|
-
if (!value || !format) return value;
|
|
18999
|
+
if (!value || !format || format === "None") return value;
|
|
18986
19000
|
const trimmed = value.trim();
|
|
18987
19001
|
let d;
|
|
18988
19002
|
const serialNum = Number(trimmed);
|
|
@@ -19860,6 +19874,8 @@ const PivotTable = ({
|
|
|
19860
19874
|
let bg;
|
|
19861
19875
|
if (DataField.DataFieldBackgroundcolor === "Row Band") {
|
|
19862
19876
|
bg = bi % 2 === 0 ? dataColors.even : dataColors.odd;
|
|
19877
|
+
} else if (DataField.DataFieldBackgroundcolor === "Alternate Rows") {
|
|
19878
|
+
bg = rowIdx % 2 === 0 ? dataColors.even : dataColors.odd;
|
|
19863
19879
|
} else if (DataField.DataFieldBackgroundcolor === "Column Band") {
|
|
19864
19880
|
bg = cbi % 2 === 0 ? dataColors.even : dataColors.odd;
|
|
19865
19881
|
} else if (DataField.DataFieldBackgroundcolor === "Single") {
|