@economic/taco 2.61.0 → 2.61.1

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