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