@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.
- package/fesm2022/shival99-z-ui-components-z-table.mjs +7 -16
- package/fesm2022/shival99-z-ui-components-z-table.mjs.map +1 -1
- package/package.json +1 -1
- package/types/shival99-z-ui-components-z-autocomplete.d.ts +1 -1
- package/types/shival99-z-ui-components-z-calendar.d.ts +4 -4
- package/types/shival99-z-ui-components-z-editor.d.ts +1 -1
- package/types/shival99-z-ui-components-z-select.d.ts +1 -1
- package/types/shival99-z-ui-components-z-table.d.ts +2 -3
- package/types/shival99-z-ui-components-z-upload.d.ts +3 -3
|
@@ -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
|
-
|
|
63
|
-
|
|
64
|
-
|
|
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
|
-
|
|
3019
|
-
|
|
3020
|
-
|
|
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;
|