Aurora.Uix.Templates.Basic.Actions.Index (Aurora UIX v0.1.0)
Renders default row and header action links (show, edit, delete, new) for entities in index layouts.
Key Features
- Provides LiveView-compatible components for "show", "edit", "delete", and "new" actions
- Generates links using assigns context for entity and module information
- Supplies helpers to add all default row and header actions to assigns
- Supports dynamic modification of actions via layout tree options
- Includes responsive pagination controls with multiple breakpoints
- Offers filter management actions (clear/submit)
Key Constraints
- Assumes assigns contain
:auixwith required subkeys::row_info- Entity row information:source- Data source identifier:module- Context module name
- Only intended for use in index page layouts
- Pagination requires specific assigns structure
Summary
Functions
Renders a button to clear all applied filters in the index layout.
Renders the "edit" action link for an entity in the index layout.
Renders the "new" action link for the header in the index layout.
Renders pagination controls for the index layout.
Renders the "delete" action link for an entity in the index layout.
Renders a button to select all items.
Renders a button to delete the selected items.
Renders a button to unselect all items.
Sets up actions for the index layout by adding defaults and applying modifications.
Renders the "show" action link for an entity in the index layout.
Renders a button to submit current filter selections in the index layout.
Renders a open filters or close filters buttons.
Renders checkbox to toggle selection of all rows in index layout.
Functions
@spec clear_filters_action(map()) :: Phoenix.LiveView.Rendered.t()
Renders a button to clear all applied filters in the index layout.
Parameters
assigns(map()) - Assigns map (no specific requirements)
Returns
Rendered.t() - Button that triggers "filters-clear" event
Notes
- Uses predefined button styling from module attribute @filters_button_class
@spec edit_row_action(map()) :: Phoenix.LiveView.Rendered.t()
Renders the "edit" action link for an entity in the index layout.
Parameters
assigns(map()) - Assigns map containing::auix(map()) - Required context with::row_info(tuple()) - Entity row information:module(atom()) - Context module name
Returns
Rendered.t() - The rendered "edit" action link
@spec new_header_action(map()) :: Phoenix.LiveView.Rendered.t()
Renders the "new" action link for the header in the index layout.
Parameters
assigns(map()) - Assigns map containing::auix(map()) - Required context with::index_new_link(binary()) - Path for new entity creation:module(atom()) - Context module name:name(binary()) - Display name for the entity type
Returns
Rendered.t() - Button link for creating new entities
@spec pagination_action(map()) :: Phoenix.LiveView.Rendered.t()
Renders pagination controls for the index layout.
Parameters
assigns(map()) - Assigns map containing::auix(map()) - Required context with::layout_options(map()) - Must contain::pagination_disabled?(boolean()) - False to enable:pages_bar_range_offset(function()) - Breakpoint sizing function
:pagination(map()) - Must contain::page(integer()) - Current page:pages_count(integer()) - Total pages (>1 to render)
:source(binary()) - Data source identifier
Returns
Rendered.t() - Responsive pagination controls or empty fragment
Breakpoints
- Renders different pagination ranges for:
- xl2 (2xl): widest range
- xl: medium range
- lg: smaller range
- md: minimal range
- sm: mobile-optimized
@spec remove_row_action(map()) :: Phoenix.LiveView.Rendered.t()
Renders the "delete" action link for an entity in the index layout.
Parameters
assigns(map()) - Assigns map containing::auix(map()) - Required context with::row_info(tuple()) - Entity row information:module(atom()) - Context module name
Returns
Rendered.t() - The rendered "delete" action link with confirmation
Edge Cases
- If
@auix.row_infois missing or malformed, returns malformed link
@spec selected_check_all_action(map()) :: Phoenix.LiveView.Rendered.t()
Renders a button to select all items.
Parameters
assigns(map()) - Assigns map.
Returns
Rendered.t() - Button that triggers the event
@spec selected_delete_all_action(map()) :: Phoenix.LiveView.Rendered.t()
Renders a button to delete the selected items.
Parameters
assigns(map()) - Assigns map.
Returns
Rendered.t() - Button that triggers the event
@spec selected_uncheck_all_action(map()) :: Phoenix.LiveView.Rendered.t()
Renders a button to unselect all items.
Parameters
assigns(map()) - Assigns map.
Returns
Rendered.t() - Button that triggers the event
@spec set_actions(Phoenix.LiveView.Socket.t()) :: Phoenix.LiveView.Socket.t()
Sets up actions for the index layout by adding defaults and applying modifications.
Parameters
socket(Socket.t()) - LiveView socket containing the layout state
Returns
Socket.t() - The updated socket with all default actions configured
@spec show_row_action(map()) :: Phoenix.LiveView.Rendered.t()
Renders the "show" action link for an entity in the index layout.
Parameters
assigns(map()) - Assigns map containing::auix(map()) - Required context with::row_info(tuple()) - Entity row information:module(atom()) - Context module name
Returns
Rendered.t() - The rendered "edit" action link
@spec submit_filters_action(map()) :: Phoenix.LiveView.Rendered.t()
Renders a button to submit current filter selections in the index layout.
Parameters
assigns(map()) - Assigns map (no specific requirements)
Returns
Rendered.t() - Button that triggers "filters-submit" event
Notes
- Uses predefined button styling from module attribute @filters_button_class
@spec toggle_filters_action(map()) :: Phoenix.LiveView.Rendered.t()
Renders a open filters or close filters buttons.
Parameters
assigns(map()) - Assigns map containing:
Returns
Rendered.t() - Button link for creating new entities
@spec toggle_selected_all_in_page_action(map()) :: Phoenix.LiveView.Rendered.t()
Renders checkbox to toggle selection of all rows in index layout.
Parameters
assigns(map()) - Assigns map containing::auix(map()) - Required context with::selection(map()) - Current selection states for the page
Returns
Rendered.t() - Checkbox input that triggers "selected-toggle-all" event