pace-table-lib 1.0.31 → 1.0.32

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.
@@ -18,6 +18,7 @@ type MeasureFormatObj = {
18
18
  numberFormat: string;
19
19
  decimalPrecision: number;
20
20
  displayUnits: DisplayUnitsType;
21
+ measureIndex: number;
21
22
  };
22
23
  export type CellRendererProps = {
23
24
  columnIndex: number;
@@ -18136,17 +18136,23 @@ function StaticTable({
18136
18136
  return `linear-gradient(to right, ${barColor} ${pct * 100}%, transparent ${pct * 100}%)`;
18137
18137
  }
18138
18138
  function getMeasureFormattingObj(givenMeasureName) {
18139
- const numberFormatConfig = {
18139
+ const defaultFormat = {
18140
18140
  numberFormat: NumberFormat,
18141
18141
  decimalPrecision: DataFieldDecimalPrecision,
18142
18142
  displayUnits: DisplayUnits
18143
18143
  };
18144
- if (isConditionalFormatOn) return numberFormatConfig;
18145
- if (!measureFormatConfigs) return numberFormatConfig;
18146
- if (!givenMeasureName) return numberFormatConfig;
18147
- const mIndex = getIndex(givenMeasureName);
18148
- const formattingObj = measureFormatConfigs?.[mIndex];
18149
- return formattingObj ?? numberFormatConfig;
18144
+ if (isConditionalFormatOn) return defaultFormat;
18145
+ if (!givenMeasureName || !measureFormatConfigs?.length) {
18146
+ return defaultFormat;
18147
+ }
18148
+ const measureIndex = getIndex(givenMeasureName);
18149
+ if (measureIndex == null || measureIndex < 0) {
18150
+ return defaultFormat;
18151
+ }
18152
+ const formattingObj = measureFormatConfigs.find(
18153
+ (item) => item.measureIndex === measureIndex
18154
+ );
18155
+ return formattingObj ?? defaultFormat;
18150
18156
  }
18151
18157
  function getConditionalFormat(value, formatFor, level) {
18152
18158
  if (!isConditionalFormatOn) return;