@economic/taco 2.58.2-EC-64961.6 → 2.58.2-EC-64961.8

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.
package/dist/taco.cjs CHANGED
@@ -33140,16 +33140,18 @@ function createNumberDataType(align, defaultOptions2) {
33140
33140
  numberFormatOptions.currency = dataTypeOptions.currency;
33141
33141
  numberFormatOptions.currencyDisplay = "code";
33142
33142
  }
33143
- const localisedValue = new Intl.NumberFormat((_a = options == null ? void 0 : options.localization) == null ? void 0 : _a.locale, numberFormatOptions).format(
33144
- Number(value)
33145
- );
33143
+ let localisedValue = new Intl.NumberFormat((_a = options == null ? void 0 : options.localization) == null ? void 0 : _a.locale, numberFormatOptions).format(Number(value));
33146
33144
  if (!numberFormatOptions.useGrouping) {
33147
33145
  return localisedValue;
33148
33146
  }
33149
- const localisedValueWithoutThousandsSeperator = new Intl.NumberFormat((_b = options == null ? void 0 : options.localization) == null ? void 0 : _b.locale, {
33147
+ let localisedValueWithoutThousandsSeperator = new Intl.NumberFormat((_b = options == null ? void 0 : options.localization) == null ? void 0 : _b.locale, {
33150
33148
  ...numberFormatOptions,
33151
33149
  useGrouping: false
33152
33150
  }).format(Number(value));
33151
+ if (numberFormatOptions.style === "percent" || numberFormatOptions.style === "currency") {
33152
+ localisedValue = localisedValue.replace(/\u00A0/g, " ");
33153
+ localisedValueWithoutThousandsSeperator = localisedValueWithoutThousandsSeperator.replace(/\u00A0/g, " ");
33154
+ }
33153
33155
  return [localisedValue, localisedValueWithoutThousandsSeperator];
33154
33156
  }
33155
33157
  };
@@ -33513,8 +33515,8 @@ function processChildren(child, columns, defaultSizing, defaultSorting, defaultV
33513
33515
  );
33514
33516
  } else if (React.isValidElement(child) && (child.props.accessor || child.props.id)) {
33515
33517
  const {
33516
- accessor,
33517
- id: id2 = accessor,
33518
+ id: untypedId,
33519
+ accessor: accessorKey,
33518
33520
  // renderers
33519
33521
  renderer: renderer2,
33520
33522
  aggregate,
@@ -33539,6 +33541,7 @@ function processChildren(child, columns, defaultSizing, defaultSorting, defaultV
33539
33541
  sortFn,
33540
33542
  ...meta
33541
33543
  } = child.props;
33544
+ const id2 = untypedId ?? accessorKey;
33542
33545
  const dataTypeProperties = getDataTypeProperties(child.props.dataType);
33543
33546
  if (defaultHidden && enableHiding) {
33544
33547
  defaultVisibility[id2] = false;
@@ -33555,10 +33558,9 @@ function processChildren(child, columns, defaultSizing, defaultSorting, defaultV
33555
33558
  }
33556
33559
  const column = {
33557
33560
  id: id2,
33558
- accessorKey: accessor,
33559
- // To avoid errors caused by undefined row data values, we pass accessorFn as a preventive measure
33560
- // accessor can be dot notated strings, so we use lodash.get to access deeply nested children
33561
- accessorFn: accessor ? (row) => get(row, accessor) : void 0,
33561
+ accessorKey,
33562
+ // dot notated accessors will throw if they return null or undefined, so we have to add an accessorFn to avoid that
33563
+ accessorFn: accessorKey && String(accessorKey).includes(".") ? (row) => get(row, accessorKey) : void 0,
33562
33564
  // The header can be either a string or a JSX.Element, but react-table expects it to be a string or a
33563
33565
  // renderer function, so `() => header` ensures compatibility when header is a JSX.Element.
33564
33566
  // If we just pass `() => header`, then we will loose truncation for string headers.