@economic/taco 2.61.0 → 2.61.2
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
|
}
|
@@ -37928,27 +37931,32 @@ function useTableRowActiveListener(table, tableRef) {
|
|
37928
37931
|
}, [tableMeta.rowActive.rowActiveIndex]);
|
37929
37932
|
}
|
37930
37933
|
function Actions(props) {
|
37934
|
+
var _a;
|
37931
37935
|
const { actions, actionsLength, data, isActiveRow, rowId, table } = props;
|
37932
37936
|
const { texts } = useLocalization();
|
37933
37937
|
const tableMeta = table.options.meta;
|
37934
37938
|
const visibleActions = actions.map(
|
37935
|
-
(action) =>
|
37936
|
-
|
37937
|
-
|
37938
|
-
|
37939
|
-
|
37940
|
-
|
37939
|
+
(action) => {
|
37940
|
+
var _a2;
|
37941
|
+
return action(data, {
|
37942
|
+
cleanup: tableMeta.rowActions.handlers["cleanup"] ?? (() => void 0),
|
37943
|
+
isEditing: ((_a2 = tableMeta.editing) == null ? void 0 : _a2.isEditing) ?? false,
|
37944
|
+
rowId,
|
37945
|
+
table
|
37946
|
+
});
|
37947
|
+
}
|
37941
37948
|
).filter((action) => !!action);
|
37942
37949
|
let length = actionsLength;
|
37943
|
-
if (tableMeta.editing.isEditing) {
|
37950
|
+
if ((_a = tableMeta.editing) == null ? void 0 : _a.isEditing) {
|
37944
37951
|
const lengthWithoutEditingItems = visibleActions.length - 1;
|
37945
37952
|
if (lengthWithoutEditingItems < actionsLength) {
|
37946
37953
|
length = lengthWithoutEditingItems;
|
37947
37954
|
}
|
37948
37955
|
}
|
37949
37956
|
const handleMenuButtonKeyDown = (event) => {
|
37957
|
+
var _a2, _b;
|
37950
37958
|
const isLastRowActive = tableMeta.rowActive.rowActiveIndex === tableMeta.length - 1;
|
37951
|
-
if (event.key === "Tab" && isLastRowActive && tableMeta.editing.isEditing && tableMeta.editing.hasChanges()) {
|
37959
|
+
if (event.key === "Tab" && isLastRowActive && ((_a2 = tableMeta.editing) == null ? void 0 : _a2.isEditing) && ((_b = tableMeta.editing) == null ? void 0 : _b.hasChanges())) {
|
37952
37960
|
tableMeta.editing.saveChanges(table);
|
37953
37961
|
}
|
37954
37962
|
};
|
@@ -37977,8 +37985,9 @@ function Actions(props) {
|
|
37977
37985
|
onKeyDown: handleMenuButtonKeyDown,
|
37978
37986
|
tabIndex: isActiveRow ? 0 : -1,
|
37979
37987
|
menu: (menuProps) => /* @__PURE__ */ React__default.createElement(Menu$1, { ...menuProps }, /* @__PURE__ */ React__default.createElement(Menu$1.Content, { onKeyDown: handleMenuContentKeyDown }, actionsInMenu.map((action, i2) => {
|
37988
|
+
var _a2;
|
37980
37989
|
const item = /* @__PURE__ */ React__default.createElement(Menu$1.Item, { key: i2, ...action.props, shortcut: action.props.shortcut }, action.props["aria-label"]);
|
37981
|
-
const isFirstEditingMenuItem = tableMeta.editing.isEditing && actionsInMenu.length > 2 && i2 === actionsInMenu.length - 2;
|
37990
|
+
const isFirstEditingMenuItem = ((_a2 = tableMeta.editing) == null ? void 0 : _a2.isEditing) && actionsInMenu.length > 2 && i2 === actionsInMenu.length - 2;
|
37982
37991
|
if (isFirstEditingMenuItem) {
|
37983
37992
|
return /* @__PURE__ */ React__default.createElement(React__default.Fragment, { key: i2 }, /* @__PURE__ */ React__default.createElement(Menu$1.Separator, null), item);
|
37984
37993
|
}
|