@shival99/z-ui 2.0.39 → 2.0.40

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.
@@ -4901,24 +4901,29 @@ class ZTableComponent {
4901
4901
  }
4902
4902
  const { config } = actionCol;
4903
4903
  const maxVisible = config.maxVisible ?? Z_TABLE_DEFAULT_MAX_VISIBLE_ACTIONS;
4904
- const data = this._actionColumnRows();
4905
4904
  let buttonCount = 0;
4906
- for (const row of data) {
4907
- const actions = typeof config.actions === 'function' ? config.actions(row) : config.actions;
4908
- const visibleActions = actions.filter(action => {
4909
- if (typeof action.hidden === 'function') {
4910
- return !action.hidden(row);
4905
+ if (Array.isArray(config.actions)) {
4906
+ const possibleVisibleCount = config.actions.filter(action => action.hidden !== true).length;
4907
+ buttonCount = possibleVisibleCount > maxVisible ? 1 : possibleVisibleCount;
4908
+ }
4909
+ if (typeof config.actions === 'function') {
4910
+ const data = this._actionColumnRows();
4911
+ for (const row of data) {
4912
+ const visibleActions = config.actions(row).filter(action => {
4913
+ if (typeof action.hidden === 'function') {
4914
+ return !action.hidden(row);
4915
+ }
4916
+ return !action.hidden;
4917
+ });
4918
+ const rowButtonCount = visibleActions.length > maxVisible ? 1 : visibleActions.length;
4919
+ buttonCount = Math.max(buttonCount, rowButtonCount);
4920
+ if (buttonCount === maxVisible) {
4921
+ break;
4911
4922
  }
4912
- return !action.hidden;
4913
- });
4914
- const rowButtonCount = visibleActions.length > maxVisible ? 1 : visibleActions.length;
4915
- buttonCount = Math.max(buttonCount, rowButtonCount);
4916
- if (buttonCount === maxVisible) {
4917
- break;
4918
4923
  }
4919
- }
4920
- if (data.length === 0) {
4921
- buttonCount = maxVisible;
4924
+ if (data.length === 0) {
4925
+ buttonCount = maxVisible;
4926
+ }
4922
4927
  }
4923
4928
  const buttonWidth = Z_TABLE_DEFAULT_ACTION_BUTTON_WIDTH;
4924
4929
  const gap = 4;