import type { IconStyle } from '@fortawesome/fontawesome-svg-core'; import { FoundationElement } from '@microsoft/fast-foundation'; import type { FaSize } from '../icon'; /** * The Action Menu Item component. * @remarks Used within the Action Menu component. * @public */ export type ActionMenuItem = { name: string | ((rowData: any) => string); callback: (rowData: any) => void | any; isDisabled?: (rowData: any) => boolean; color?: string; icon?: { variant?: IconStyle; name: string; size?: FaSize; }; }; /** * A function of the row data returning the actions for that row (for row-scoped * eligibility/permission filtering). * @public */ export type ActionMenuItemsResolver = (rowData: any) => ActionMenuItem[]; /** * The actions a grid column's Actions Menu shows: a fixed array, or a resolver per row. * @public */ export type ActionMenuItems = ActionMenuItem[] | ActionMenuItemsResolver; /** * @tagname %%prefix%%-actions-menu */ export declare class ActionsMenu extends FoundationElement { actions: ActionMenuItem[]; /** * Resolves the actions per row instead of `actions`, from the row data in `definition`. * @remarks Set from a function passed as the cell params' `actions`. */ actionsResolver?: ActionMenuItemsResolver; isVertical: boolean; addDefaultActions: boolean; autoCloseOnAction: boolean; classNames: string; definition: any; name: string; /** * When set, the opener renders this icon instead of the `name` text (e.g. `ellipsis` * for an icon-only "kebab" opener). */ iconName: string; open: boolean; buttonAppearance: string; hideDisabled: boolean; hideMenuSingleOption: boolean; singleOption: ActionMenuItem; actionsMenu: HTMLElement; actionsOpener: HTMLElement; private positionTracker?; /** Set when the keyboard opens the menu, so focus moves into it as screen readers announce. */ private focusMenuOnOpen; disconnectedCallback(): void; private updateMenuPosition; private startTrackingPosition; private stopTrackingPosition; protected definitionChanged(oldValue: any, newValue: any): void; protected openChanged(): void; toggleActionsMenuVisibility(): void; /** * Syncs `open` when the native `popover="auto"` light-dismiss (outside click / Escape) closes * the vertical menu without going through `toggleActionsMenuVisibility()`. */ onPopoverToggle(event: Event): void; /** Opens the icon-only opener from the keyboard, as a native button would. */ onIconOpenerKeydown(event: KeyboardEvent): boolean; onActionMenuItemClick(callback: (rowData: any) => void | any): void; /** Resolves an action's `isDisabled` for the current row. */ isActionDisabled(action: ActionMenuItem): boolean; /** The actions for the current row: from `actionsResolver` when set, else `actions`. */ get resolvedActions(): ActionMenuItem[]; /** Whether the row has an action to show: an enabled one, or any when disabled ones show. */ get hasVisibleActions(): boolean; get allActions(): ActionMenuItem[]; get rowData(): any; getLabel(name: string | ((rowData: any) => string)): string; getTemplate(prefix: string): import("@microsoft/fast-element").ViewTemplate; } /** * The Foundation Actions Menu * * @public * @remarks * HTML Element: \ */ export declare const foundationActionsMenu: (overrideDefinition?: import("@microsoft/fast-foundation").OverrideFoundationElementDefinition) => import("@microsoft/fast-foundation").FoundationElementRegistry; //# sourceMappingURL=actions-menu.d.ts.map