import { LfI18n } from '@lightweightform/core'; import { ButtonSize, ButtonStyle } from '../button/button.component'; import * as i0 from "@angular/core"; /** * Action of an actions-menu. */ export interface ActionsMenuAction { /** * Identifier of the action (used to identify the action in the i18n file). */ id?: string; /** * Text of the action (which may also be specified via the i18n file). */ text?: string; /** * Class name to add to the action. */ class?: string; /** * Style of the action (relevant when the actions aren't collapsable). */ style?: ButtonStyle; /** * (Font Awesome) icon of the action. */ icon?: string; /** * Whether the action should show as active. */ isActive?: () => boolean; /** * Whether the action should show as disabled. */ isDisabled?: () => boolean; /** * Action to execute when the action is pressed (can be asynchronous, in which * case the action will be disabled during the duration of the action and a * loading animation will appear). * @param value Value of the selected option, when the action has options. */ callback?: (value?: any) => void | Promise; /** * Use the option as an external link. */ href?: string; /** * Options of the action (when defined, the action's button will become the * toggle for a dropdown menu containing the options as items). */ options?: ActionsMenuActionOption[]; /** * Whether the dropdown menu should be aligned to the right of the dropdown * toggle. Relevant only when `options` is declared. */ alignRight?: boolean; } /** * Option of an action of an actions-menu. */ export interface ActionsMenuActionOption { /** * Identifier of the option (used to identify the option in the i18n file). */ id?: string; /** * Text of the option (which may also be specified via the i18n file). */ text?: string; /** * Class name to add to the option. */ class?: string; /** * (Font Awesome) icon of the action. */ icon?: string; /** * Value of the option (passed to the callback of the action when the option * is selected). */ value: any; /** * Whether to display the option as active. */ isActive?: () => boolean; /** * Whether to display the option as disabled. */ isDisabled?: () => boolean; /** * Action to execute when the option is pressed. Will be executed before the * action's callback, when defined (can be asynchronous, in which case the * action will be disabled during the duration of the action and a loading * animation will appear). */ callback?: () => void | Promise; /** * Use the option as an external link. */ href?: string; } /** * Available sizes on which to collapse the actions-menu. */ export declare type ActionsMenuCollapseSize = 'none' | 'sm' | 'md' | 'lg' | 'xl' | 'every'; /** * Component that responsively displays a menu of actions. */ export declare class ActionsMenuComponent { protected lfI18n: LfI18n; /** * Actions of the actions-menu. */ actions: ActionsMenuAction[]; /** * Size of the buttons of the actions-menu. */ buttonsSize: ButtonSize; /** * Screen size at which the actions-menu should collapse. */ collapseSize: ActionsMenuCollapseSize; /** * Screen size at which the actions-menu button should collapse. */ actionsLabelCollapseSize: ActionsMenuCollapseSize; /** * Whether the actions-menu (when collapsed) should align its menu to the * right. */ alignMenusRight: boolean; /** * Actions currently executing. */ private runningActions; constructor(lfI18n: LfI18n); get actionsLabel(): string; actionText(act: ActionsMenuAction): string; actionOptionText(act: ActionsMenuAction, option: ActionsMenuActionOption): string; _runAction(act: ActionsMenuAction, value?: any): Promise; _runActionOption(act: ActionsMenuAction, option: ActionsMenuActionOption): Promise; get _isAnyActionRunning(): boolean; _isActionRunning(act: ActionsMenuAction): boolean; _isChildOptionRunning(act: ActionsMenuAction): boolean; _isActionOptionRunning(act: ActionsMenuAction, option: ActionsMenuActionOption): boolean; private actionId; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; }