pace-table-lib 1.0.31 → 1.0.33

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;
@@ -8344,9 +8344,14 @@ function getIndex(str) {
8344
8344
  return Number(str.split("~$~")[0]);
8345
8345
  }
8346
8346
  function getFontSize(value) {
8347
- if (typeof value === "number") return value;
8348
- if (typeof value === "string") return parseInt(value, 11);
8349
- return 0;
8347
+ if (typeof value === "number" && Number.isFinite(value)) {
8348
+ return value;
8349
+ }
8350
+ if (typeof value === "string") {
8351
+ const parsed = Number.parseFloat(value);
8352
+ return Number.isFinite(parsed) ? parsed : 10;
8353
+ }
8354
+ return 10;
8350
8355
  }
8351
8356
  var jquery$1 = { exports: {} };
8352
8357
  /*!
@@ -18136,17 +18141,23 @@ function StaticTable({
18136
18141
  return `linear-gradient(to right, ${barColor} ${pct * 100}%, transparent ${pct * 100}%)`;
18137
18142
  }
18138
18143
  function getMeasureFormattingObj(givenMeasureName) {
18139
- const numberFormatConfig = {
18144
+ const defaultFormat = {
18140
18145
  numberFormat: NumberFormat,
18141
18146
  decimalPrecision: DataFieldDecimalPrecision,
18142
18147
  displayUnits: DisplayUnits
18143
18148
  };
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;
18149
+ if (isConditionalFormatOn) return defaultFormat;
18150
+ if (!givenMeasureName || !measureFormatConfigs?.length) {
18151
+ return defaultFormat;
18152
+ }
18153
+ const measureIndex = getIndex(givenMeasureName);
18154
+ if (measureIndex == null || measureIndex < 0) {
18155
+ return defaultFormat;
18156
+ }
18157
+ const formattingObj = measureFormatConfigs.find(
18158
+ (item) => item.measureIndex === measureIndex
18159
+ );
18160
+ return formattingObj ?? defaultFormat;
18150
18161
  }
18151
18162
  function getConditionalFormat(value, formatFor, level) {
18152
18163
  if (!isConditionalFormatOn) return;
@@ -18279,7 +18290,7 @@ function StaticTable({
18279
18290
  return getSparkLine(dataArr, baseStyle);
18280
18291
  }
18281
18292
  if (rawValue === void 0) return null;
18282
- const mName = measuresBySlice[rowIdxHeat]?.measureNames[colIdxHeat] ?? void 0;
18293
+ const mName = measuresBySlice?.[rowIdxHeat]?.measureNames?.[colIdxHeat];
18283
18294
  const formattingObj = getMeasureFormattingObj(mName);
18284
18295
  const conditionalFormatObj = getConditionalFormat(rawValue, CONDITIONAL_FORMAT_FOR.VALUE);
18285
18296
  const numberFormat = conditionalFormatObj?.numberFormat ?? formattingObj.numberFormat;