pace-table-lib 1.0.71 → 1.0.72

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.
@@ -1,6 +1,5 @@
1
1
  import { MeasureFormatObj, TableStyleConfig } from "../StaticTable/StaticTableTypeDec.types";
2
2
  import { BgColorPair, ParsedMeasureInfo } from "./PivotTable.types";
3
- export declare const NO_ENTRY_TOKENS: string[];
4
3
  /** Linearly interpolates between two hex colors by factor [0,1] */
5
4
  export declare const interpolateColor: (minColor: string, maxColor: string, factor: number) => string;
6
5
  /** Maps a value in [minValue, maxValue] to an interpolated RGB color string */
@@ -8172,8 +8172,8 @@ function formatValue(value, format, decimalValues = 2, displayUnit = DISPLAY_UNI
8172
8172
  [VALUE_FORMAT_OBJ.CURRENCY_EUR_SHORT]: { currency: "EUR", locale: "en-US" },
8173
8173
  [VALUE_FORMAT_OBJ.CURRENCY_CAD]: { currency: "CAD", locale: "en-US" },
8174
8174
  [VALUE_FORMAT_OBJ.CURRENCY_CAD_SHORT]: { currency: "CAD", locale: "en-US" },
8175
- [VALUE_FORMAT_OBJ.CURRENCY_CHF]: { currency: "CHF", locale: "de-CH" },
8176
- [VALUE_FORMAT_OBJ.CURRENCY_CHF_SHORT]: { currency: "CHF", locale: "de-CH" }
8175
+ [VALUE_FORMAT_OBJ.CURRENCY_CHF]: { currency: "CHF", locale: "en-IN" },
8176
+ [VALUE_FORMAT_OBJ.CURRENCY_CHF_SHORT]: { currency: "CHF", locale: "en-IN" }
8177
8177
  };
8178
8178
  if (currencyMap[format]) {
8179
8179
  const { currency, locale } = currencyMap[format];
@@ -18819,7 +18819,6 @@ function StaticTable({
18819
18819
  )
18820
18820
  ] });
18821
18821
  }
18822
- const NO_ENTRY_TOKENS = ["nolegendentryrow", "nocolentry"];
18823
18822
  function hexToRgb(hex) {
18824
18823
  const result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex);
18825
18824
  return result ? {
@@ -18868,7 +18867,6 @@ function getRowDisplayName(segments, measureValue) {
18868
18867
  for (let i = segments.length - 1; i >= 0; i--) {
18869
18868
  const seg = segments[i];
18870
18869
  if (seg && seg !== "!subtotal") {
18871
- if (NO_ENTRY_TOKENS.includes(seg.toLowerCase())) return measureValue;
18872
18870
  if (seg.includes("~$~")) {
18873
18871
  return seg.split("~$~")[1]?.trim() ?? seg;
18874
18872
  }
@@ -19036,7 +19034,7 @@ const PivotTable = ({
19036
19034
  const isRowTotalOn = tableStyleProps?.DataField?.RowTotal;
19037
19035
  const isRowHeaderVisible = !RowHeader?.HideRowHeader;
19038
19036
  const isColHeaderVisible = !ColumnHeader?.HideColumnHeader;
19039
- const measureValue = Table2?.colOrRowHeaderName;
19037
+ Table2?.colOrRowHeaderName;
19040
19038
  const isConditionalFormatOn = Table2?.ConditionalformattingOnOff;
19041
19039
  const conditionalFormatArr = Table2?.Conditionalformatting;
19042
19040
  const conditionalFormatsByType = useMemo(() => {
@@ -19086,10 +19084,7 @@ const PivotTable = ({
19086
19084
  }
19087
19085
  }
19088
19086
  return rh?.map((rowPath, i) => {
19089
- const isNoEntry = NO_ENTRY_TOKENS.some(
19090
- (t) => rowPath.toLowerCase().includes(t)
19091
- );
19092
- const segments = isNoEntry ? [measureValue] : parseRowPath(rowPath);
19087
+ const segments = parseRowPath(rowPath);
19093
19088
  const isSubtotal = segments.includes("!subtotal");
19094
19089
  const nonSubSegs = segments?.filter((s) => s !== "!subtotal");
19095
19090
  const lastSeg = nonSubSegs[nonSubSegs.length - 1] ?? "";
@@ -19105,7 +19100,7 @@ const PivotTable = ({
19105
19100
  rowPath,
19106
19101
  segments,
19107
19102
  depth: 0,
19108
- name: isNoEntry ? measureValue : getRowDisplayName(segments, measureValue),
19103
+ name: getRowDisplayName(segments),
19109
19104
  measureIndex,
19110
19105
  measureName,
19111
19106
  isSubtotal,
@@ -19127,10 +19122,7 @@ const PivotTable = ({
19127
19122
  const isSubtotal = parts[parts.length - 1] === "!subtotal";
19128
19123
  const cleanedParts = parts?.filter((p) => p !== "!subtotal")?.map((p) => {
19129
19124
  if (p.includes("~$~")) return p.split("~$~")[1]?.trim() ?? p;
19130
- const isNoEntry = NO_ENTRY_TOKENS.some(
19131
- (t) => p.toLowerCase().includes(t)
19132
- );
19133
- return isNoEntry ? "" : p;
19125
+ return p;
19134
19126
  });
19135
19127
  const year = cleanedParts[0] ?? `__col_${i}__`;
19136
19128
  const measureDisplay = (cleanedParts && cleanedParts[cleanedParts.length - 1]) ?? year;
@@ -19601,11 +19593,7 @@ const PivotTable = ({
19601
19593
  "column header"
19602
19594
  );
19603
19595
  let displayLabel = col.isSubtotal ? col.levels[col.levels.length - 1] ?? "" : col.levels?.[col.levels.length - 1] ?? col.measureDisplay;
19604
- if (NO_ENTRY_TOKENS.some((t) => col.path.toLowerCase().includes(t)) && tableData?.rowHeaders?.length === 1 && NO_ENTRY_TOKENS.some(
19605
- (t) => tableData?.rowHeaders?.[0]?.toLowerCase().includes(t)
19606
- ) && measureFormatConfigs?.[0]?.measureName) {
19607
- displayLabel = measureFormatConfigs[0].measureName;
19608
- } else if (tableStyleProps?.ColumnDateFormat) {
19596
+ if (tableStyleProps?.ColumnDateFormat) {
19609
19597
  const parts = col.path.split("`");
19610
19598
  const lastPart = parts[parts.length - 1];
19611
19599
  if (tableStyleProps?.ColumnDateFormat?.[0] && (col.path == col.measureDisplay || col.isSubtotal)) {
@@ -19707,11 +19695,7 @@ const PivotTable = ({
19707
19695
  const shouldWrap = Table2?.RowWrapText;
19708
19696
  const rowConFormat = getConditionalFormat(row.name, "row header");
19709
19697
  let displayLabel = row.name;
19710
- if (NO_ENTRY_TOKENS.some((t) => row.rowPath.toLowerCase().includes(t)) && tableData?.columnHeaders?.length === 1 && NO_ENTRY_TOKENS.some(
19711
- (t) => tableData?.columnHeaders?.[0]?.toLowerCase().includes(t)
19712
- ) && measureFormatConfigs?.[0]?.measureName) {
19713
- displayLabel = measureFormatConfigs[0].measureName;
19714
- } else if (tableStyleProps?.RowDateFormat) {
19698
+ if (tableStyleProps?.RowDateFormat) {
19715
19699
  if (tableStyleProps?.RowDateFormat?.[0] && (row.name === row.segments[0] || row.isSubtotal)) {
19716
19700
  displayLabel = applyDateFormat(
19717
19701
  row.name,