@economic/taco 2.61.1 → 2.61.3

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
@@ -34711,6 +34711,9 @@ class DataType {
34711
34711
  const localeNumberSeparators = /* @__PURE__ */ new Map();
34712
34712
  class NumericDataType extends DataType {
34713
34713
  static format(value, locale2, options) {
34714
+ if (value === void 0 || typeof value !== "number" || isNaN(value)) {
34715
+ return "";
34716
+ }
34714
34717
  const localisedValue = new Intl.NumberFormat(locale2, options).format(value);
34715
34718
  return localisedValue.replace(/[\u00A0\u202F]/g, " ");
34716
34719
  }
@@ -35399,9 +35402,13 @@ function processChildren(child, columns, defaultSizing, defaultSorting, defaultV
35399
35402
  return displayValue ?? safeValue;
35400
35403
  };
35401
35404
  const rendererArgs = (info) => ({
35402
- formattedValue: formattedValueRenderer(info.getValue(), info.row.original),
35403
35405
  row: info.row.original,
35404
- value: info.getValue()
35406
+ get value() {
35407
+ return info.getValue();
35408
+ },
35409
+ get formattedValue() {
35410
+ return formattedValueRenderer(info.getValue(), info.row.original);
35411
+ }
35405
35412
  });
35406
35413
  if (typeof renderer2 === "function") {
35407
35414
  column.cell = (info) => renderer2(rendererArgs(info));
@@ -55728,6 +55735,7 @@ function EditingControlCell(props) {
55728
55735
  const { cell, cellRef, isHighlighted, index: index2 } = props;
55729
55736
  const { rowIndex } = React.useContext(RowContext);
55730
55737
  const { table } = cell.getContext();
55738
+ const locale2 = useLocalization();
55731
55739
  const tableMeta = table.options.meta;
55732
55740
  const columnMeta = cell.column.columnDef.meta;
55733
55741
  const isActiveRow = tableMeta.rowActive.rowActiveIndex === rowIndex;
@@ -55771,6 +55779,7 @@ function EditingControlCell(props) {
55771
55779
  invalid: !!error,
55772
55780
  isDetailedMode: tableMeta.editing.isDetailedMode,
55773
55781
  isTruncated: !!columnMeta.enableTruncate,
55782
+ locale: locale2.locale,
55774
55783
  onBlur: handleBlur,
55775
55784
  onChange: handleChange,
55776
55785
  row: cell.row.original,
@@ -55799,6 +55808,7 @@ const MemoedEditingCell = React.memo(function MemoedEditingCell2(props) {
55799
55808
  invalid,
55800
55809
  isDetailedMode,
55801
55810
  isTruncated,
55811
+ locale: locale2,
55802
55812
  onBlur,
55803
55813
  onChange,
55804
55814
  row,
@@ -55927,10 +55937,12 @@ const MemoedEditingCell = React.memo(function MemoedEditingCell2(props) {
55927
55937
  }
55928
55938
  );
55929
55939
  }
55940
+ const handleChange = (event) => {
55941
+ var _a;
55942
+ const dataTypeProps = getDataTypeProperties(dataType);
55943
+ onChange(((_a = dataTypeProps.parse) == null ? void 0 : _a.call(dataTypeProps, event.target.value, locale2)) ?? event.target.value);
55944
+ };
55930
55945
  if (type === "textarea") {
55931
- const handleChange2 = (event) => {
55932
- onChange(event.target.value);
55933
- };
55934
55946
  return /* @__PURE__ */ React.createElement(
55935
55947
  TextareaWithAutosizing,
55936
55948
  {
@@ -55938,7 +55950,7 @@ const MemoedEditingCell = React.memo(function MemoedEditingCell2(props) {
55938
55950
  fontSize,
55939
55951
  invalid,
55940
55952
  isTruncated,
55941
- onChange: handleChange2,
55953
+ onChange: handleChange,
55942
55954
  onFocus: handleFocus,
55943
55955
  onKeyDown: handleInputKeyDown,
55944
55956
  ref: controlRef,
@@ -55946,9 +55958,6 @@ const MemoedEditingCell = React.memo(function MemoedEditingCell2(props) {
55946
55958
  }
55947
55959
  );
55948
55960
  }
55949
- const handleChange = (event) => {
55950
- onChange(dataType === "number" && event.target.value ? Number.parseInt(event.target.value) : event.target.value);
55951
- };
55952
55961
  return /* @__PURE__ */ React.createElement(
55953
55962
  Input,
55954
55963
  {