@shival99/z-ui 1.7.34 → 1.7.36

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.
@@ -49,19 +49,12 @@ class ZTableActionsComponent {
49
49
  zRowId = input.required(...(ngDevMode ? [{ debugName: "zRowId" }] : []));
50
50
  zDropdownButtonSize = input(Z_TABLE_DEFAULT_DROPDOWN_BUTTON_SIZE, ...(ngDevMode ? [{ debugName: "zDropdownButtonSize" }] : []));
51
51
  zActionClick = output();
52
- _resolveAction(actionDef) {
53
- const row = this.zRow();
54
- if (typeof actionDef === 'function') {
55
- return actionDef(row);
56
- }
57
- return actionDef;
58
- }
59
52
  allActions = computed(() => {
60
53
  const config = this.zConfig();
61
54
  const row = this.zRow();
62
- return config.actions
63
- .map(actionDef => this._resolveAction(actionDef))
64
- .filter(action => {
55
+ const { actions } = config;
56
+ const resolvedActions = typeof actions === 'function' ? actions(row) : actions;
57
+ return resolvedActions.filter(action => {
65
58
  if (typeof action.hidden === 'function') {
66
59
  return !action.hidden(row);
67
60
  }
@@ -3015,12 +3008,10 @@ class ZTableComponent {
3015
3008
  }
3016
3009
  const { config } = actionCol;
3017
3010
  const maxVisible = config.maxVisible ?? 3;
3018
- const totalActions = config.actions.filter(a => {
3019
- if (typeof a === 'function') {
3020
- return true;
3021
- }
3022
- return !a.hidden;
3023
- }).length;
3011
+ let totalActions = maxVisible;
3012
+ if (typeof config.actions !== 'function') {
3013
+ totalActions = config.actions.filter(a => !a.hidden).length;
3014
+ }
3024
3015
  const visibleCount = Math.min(totalActions, maxVisible);
3025
3016
  const hasOverflow = totalActions > maxVisible;
3026
3017
  const buttonCount = hasOverflow ? visibleCount + 1 : visibleCount;