Configures a bulk action which can be performed on all selected items in a list view.
For a full example, see the registerBulkAction docs.
BulkActionLocationIdstring( context: BulkActionFunctionContext<ItemType, ComponentType>, ) => Record<string, string | number> | Promise<Record<string, string | number>>An optional function that should resolve to a map of translation variables which can be
used when translating the label string.
stringA valid Clarity Icons icon shape, e.g. "cog", "user", "info-standard".
stringA class to be added to the icon element. Examples:
(context: BulkActionClickContext<ItemType, ComponentType>) => voidDefines the logic that executes when the bulk action button is clicked.
(context: BulkActionFunctionContext<ItemType, ComponentType>) => boolean | Promise<boolean>A function that determines whether this bulk action item should be displayed in the menu. If not defined, the item will always be displayed.
This function will be invoked each time the selection is changed, so try to avoid expensive code running here.
Example
string | ((userPermissions: string[]) => boolean)Control the display of this item based on the user permissions.
Example
A valid location of a list view that supports the bulk actions API.
This is the argument which gets passed to the getTranslationVars and isVisible functions
of the BulkAction definition.
ItemType[]An array of the selected items from the list.
ComponentTypeThe component instance that is hosting the list view. For instance,
ProductListComponent. This can be used to call methods on the instance,
e.g. calling hostComponent.refresh() to force a list refresh after
deleting the selected items.
InjectorThe Angular Injector which can be used to get service instances which might be needed in the click handler.
ActivatedRouteThis is the argument which gets passed to the onClick function of a BulkAction.
BulkActionFunctionContext<ItemType, ComponentType>