@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.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
|
}
|
@@ -37946,27 +37949,32 @@ function useTableRowActiveListener(table, tableRef) {
|
|
37946
37949
|
}, [tableMeta.rowActive.rowActiveIndex]);
|
37947
37950
|
}
|
37948
37951
|
function Actions(props) {
|
37952
|
+
var _a;
|
37949
37953
|
const { actions, actionsLength, data, isActiveRow, rowId, table } = props;
|
37950
37954
|
const { texts } = useLocalization();
|
37951
37955
|
const tableMeta = table.options.meta;
|
37952
37956
|
const visibleActions = actions.map(
|
37953
|
-
(action) =>
|
37954
|
-
|
37955
|
-
|
37956
|
-
|
37957
|
-
|
37958
|
-
|
37957
|
+
(action) => {
|
37958
|
+
var _a2;
|
37959
|
+
return action(data, {
|
37960
|
+
cleanup: tableMeta.rowActions.handlers["cleanup"] ?? (() => void 0),
|
37961
|
+
isEditing: ((_a2 = tableMeta.editing) == null ? void 0 : _a2.isEditing) ?? false,
|
37962
|
+
rowId,
|
37963
|
+
table
|
37964
|
+
});
|
37965
|
+
}
|
37959
37966
|
).filter((action) => !!action);
|
37960
37967
|
let length = actionsLength;
|
37961
|
-
if (tableMeta.editing.isEditing) {
|
37968
|
+
if ((_a = tableMeta.editing) == null ? void 0 : _a.isEditing) {
|
37962
37969
|
const lengthWithoutEditingItems = visibleActions.length - 1;
|
37963
37970
|
if (lengthWithoutEditingItems < actionsLength) {
|
37964
37971
|
length = lengthWithoutEditingItems;
|
37965
37972
|
}
|
37966
37973
|
}
|
37967
37974
|
const handleMenuButtonKeyDown = (event) => {
|
37975
|
+
var _a2, _b;
|
37968
37976
|
const isLastRowActive = tableMeta.rowActive.rowActiveIndex === tableMeta.length - 1;
|
37969
|
-
if (event.key === "Tab" && isLastRowActive && tableMeta.editing.isEditing && tableMeta.editing.hasChanges()) {
|
37977
|
+
if (event.key === "Tab" && isLastRowActive && ((_a2 = tableMeta.editing) == null ? void 0 : _a2.isEditing) && ((_b = tableMeta.editing) == null ? void 0 : _b.hasChanges())) {
|
37970
37978
|
tableMeta.editing.saveChanges(table);
|
37971
37979
|
}
|
37972
37980
|
};
|
@@ -37995,8 +38003,9 @@ function Actions(props) {
|
|
37995
38003
|
onKeyDown: handleMenuButtonKeyDown,
|
37996
38004
|
tabIndex: isActiveRow ? 0 : -1,
|
37997
38005
|
menu: (menuProps) => /* @__PURE__ */ React.createElement(Menu$1, { ...menuProps }, /* @__PURE__ */ React.createElement(Menu$1.Content, { onKeyDown: handleMenuContentKeyDown }, actionsInMenu.map((action, i2) => {
|
38006
|
+
var _a2;
|
37998
38007
|
const item = /* @__PURE__ */ React.createElement(Menu$1.Item, { key: i2, ...action.props, shortcut: action.props.shortcut }, action.props["aria-label"]);
|
37999
|
-
const isFirstEditingMenuItem = tableMeta.editing.isEditing && actionsInMenu.length > 2 && i2 === actionsInMenu.length - 2;
|
38008
|
+
const isFirstEditingMenuItem = ((_a2 = tableMeta.editing) == null ? void 0 : _a2.isEditing) && actionsInMenu.length > 2 && i2 === actionsInMenu.length - 2;
|
38000
38009
|
if (isFirstEditingMenuItem) {
|
38001
38010
|
return /* @__PURE__ */ React.createElement(React.Fragment, { key: i2 }, /* @__PURE__ */ React.createElement(Menu$1.Separator, null), item);
|
38002
38011
|
}
|