@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 +18 -9
- package/dist/taco.cjs.map +1 -1
- package/dist/taco.js +18 -9
- package/dist/taco.js.map +1 -1
- package/package.json +2 -2
package/dist/taco.js
CHANGED
@@ -34693,6 +34693,9 @@ class DataType {
|
|
34693
34693
|
const localeNumberSeparators = /* @__PURE__ */ new Map();
|
34694
34694
|
class NumericDataType extends DataType {
|
34695
34695
|
static format(value, locale2, options) {
|
34696
|
+
if (value === void 0 || typeof value !== "number" || isNaN(value)) {
|
34697
|
+
return "";
|
34698
|
+
}
|
34696
34699
|
const localisedValue = new Intl.NumberFormat(locale2, options).format(value);
|
34697
34700
|
return localisedValue.replace(/[\u00A0\u202F]/g, " ");
|
34698
34701
|
}
|
@@ -35381,9 +35384,13 @@ function processChildren(child, columns, defaultSizing, defaultSorting, defaultV
|
|
35381
35384
|
return displayValue ?? safeValue;
|
35382
35385
|
};
|
35383
35386
|
const rendererArgs = (info) => ({
|
35384
|
-
formattedValue: formattedValueRenderer(info.getValue(), info.row.original),
|
35385
35387
|
row: info.row.original,
|
35386
|
-
value
|
35388
|
+
get value() {
|
35389
|
+
return info.getValue();
|
35390
|
+
},
|
35391
|
+
get formattedValue() {
|
35392
|
+
return formattedValueRenderer(info.getValue(), info.row.original);
|
35393
|
+
}
|
35387
35394
|
});
|
35388
35395
|
if (typeof renderer2 === "function") {
|
35389
35396
|
column.cell = (info) => renderer2(rendererArgs(info));
|
@@ -55710,6 +55717,7 @@ function EditingControlCell(props) {
|
|
55710
55717
|
const { cell, cellRef, isHighlighted, index: index2 } = props;
|
55711
55718
|
const { rowIndex } = React__default.useContext(RowContext);
|
55712
55719
|
const { table } = cell.getContext();
|
55720
|
+
const locale2 = useLocalization();
|
55713
55721
|
const tableMeta = table.options.meta;
|
55714
55722
|
const columnMeta = cell.column.columnDef.meta;
|
55715
55723
|
const isActiveRow = tableMeta.rowActive.rowActiveIndex === rowIndex;
|
@@ -55753,6 +55761,7 @@ function EditingControlCell(props) {
|
|
55753
55761
|
invalid: !!error,
|
55754
55762
|
isDetailedMode: tableMeta.editing.isDetailedMode,
|
55755
55763
|
isTruncated: !!columnMeta.enableTruncate,
|
55764
|
+
locale: locale2.locale,
|
55756
55765
|
onBlur: handleBlur,
|
55757
55766
|
onChange: handleChange,
|
55758
55767
|
row: cell.row.original,
|
@@ -55781,6 +55790,7 @@ const MemoedEditingCell = React__default.memo(function MemoedEditingCell2(props)
|
|
55781
55790
|
invalid,
|
55782
55791
|
isDetailedMode,
|
55783
55792
|
isTruncated,
|
55793
|
+
locale: locale2,
|
55784
55794
|
onBlur,
|
55785
55795
|
onChange,
|
55786
55796
|
row,
|
@@ -55909,10 +55919,12 @@ const MemoedEditingCell = React__default.memo(function MemoedEditingCell2(props)
|
|
55909
55919
|
}
|
55910
55920
|
);
|
55911
55921
|
}
|
55922
|
+
const handleChange = (event) => {
|
55923
|
+
var _a;
|
55924
|
+
const dataTypeProps = getDataTypeProperties(dataType);
|
55925
|
+
onChange(((_a = dataTypeProps.parse) == null ? void 0 : _a.call(dataTypeProps, event.target.value, locale2)) ?? event.target.value);
|
55926
|
+
};
|
55912
55927
|
if (type === "textarea") {
|
55913
|
-
const handleChange2 = (event) => {
|
55914
|
-
onChange(event.target.value);
|
55915
|
-
};
|
55916
55928
|
return /* @__PURE__ */ React__default.createElement(
|
55917
55929
|
TextareaWithAutosizing,
|
55918
55930
|
{
|
@@ -55920,7 +55932,7 @@ const MemoedEditingCell = React__default.memo(function MemoedEditingCell2(props)
|
|
55920
55932
|
fontSize,
|
55921
55933
|
invalid,
|
55922
55934
|
isTruncated,
|
55923
|
-
onChange:
|
55935
|
+
onChange: handleChange,
|
55924
55936
|
onFocus: handleFocus,
|
55925
55937
|
onKeyDown: handleInputKeyDown,
|
55926
55938
|
ref: controlRef,
|
@@ -55928,9 +55940,6 @@ const MemoedEditingCell = React__default.memo(function MemoedEditingCell2(props)
|
|
55928
55940
|
}
|
55929
55941
|
);
|
55930
55942
|
}
|
55931
|
-
const handleChange = (event) => {
|
55932
|
-
onChange(dataType === "number" && event.target.value ? Number.parseInt(event.target.value) : event.target.value);
|
55933
|
-
};
|
55934
55943
|
return /* @__PURE__ */ React__default.createElement(
|
55935
55944
|
Input,
|
55936
55945
|
{
|