OctantisWeb.Components.Polaris.IndexTable (octantis v0.1.12)

View Source

An index table displays a collection of objects of the same type, like orders or products. The main job of an index table is to help merchants get an at-a-glance of the objects to perform actions or navigate to a full-page representation of it.

Examples

<.index_table />

See

Summary

Functions

Attributes

  • id (:string) (required)
  • on_toggle_all (:any)
  • selected_count (:integer) (required)
  • selected (:map) - A map of row ids to 'true' or 'false'. Defaults to %{}.

Slots

  • promoted_bulk_action - BulkActions for the table. Accepts attributes:
    • content (:string) - Content the action displays.
    • disabled (:boolean) - Whether or not the action is disabled.
    • variant (:string) - Changes the visual appearance of the Button.Must be one of "plain", "primary", "secondary", "tertiary", or "monochromePlain".
    • tone (:string) - Sets the color treatment of the Button.Must be one of "critical", or "success".
    • full_width (:boolean) - Allows the button to grow to the width of its container.
    • size (:string) - Changes the size of the button, giving it more or less padding.Must be one of "micro", "slim", "medium", or "large".
    • navigate (:string) - Passes through to .link component.
    • patch (:string) - Passes through to .link component.
    • href (:string) - Passes through to .link component.
    • target (:string) - Passes through to .link component.
    • icon (:any) - Source of the icon.Examples include &OctantisWeb.Components.Polaris.Icons.arrow_right/1.
    • phx_click (:any) - Click function passed through to the button.

Attributes

  • id (:string) (required)
  • name (:string) - Defaults to "select_all".
  • accessibility_label (:string) - Defaults to nil.
  • label (:string) - Defaults to nil.
  • checked (:atom) - Must be one of true, false, or :indeterminate.
  • disabled (:boolean) - Defaults to false.
  • phx_click (:any) - onClick: Callback when row is clicked.
  • aria_live (:atom) - Defaults to nil.

An index table displays a collection of objects of the same type, like orders or products. The main job of an index table is to help merchants get an at-a-glance of the objects to perform actions or navigate to a full-page representation of it.

Attributes

  • phx_click (:any) - onClick: Callback when row is clicked.
  • class (:any) - Class to be passed on to the cell.

Slots

  • inner_block

Attributes

  • phx_click (:any) - onClick: Callback when row is clicked.
  • checked (:boolean) (required)
  • selectable (:boolean) (required)

Slots

  • inner_block

Attributes

  • id (:string)
  • parent_id (:string)
  • on_selection_change (:any) - Callback for when the checkbox is toggled.
  • checked (:boolean) - Defaults to false.

Attributes

  • heading (:any) (required)
  • index (:integer) (required)
  • last (:boolean) (required)
  • selectable (:boolean) (required)
  • class (:any) - Class to be passed on to the header and cel.

Attributes

  • id (:string)
  • on_selection_change (:any) - Callback for when the checkbox is toggled.
  • checked (:boolean) - Defaults to false.
  • selected_count (:integer) (required) - The number of selected rows.

Functions

assign_bulk_action_wrapper_class(assigns)

assign_table_class(assigns)

build_bulk_action_wrapper_class(arg)

build_table_class(arg)

build_tr_class(arg)

bulk_action_wrapper(assigns)

Attributes

  • id (:string) (required)
  • on_toggle_all (:any)
  • selected_count (:integer) (required)
  • selected (:map) - A map of row ids to 'true' or 'false'. Defaults to %{}.

Slots

  • promoted_bulk_action - BulkActions for the table. Accepts attributes:
    • content (:string) - Content the action displays.
    • disabled (:boolean) - Whether or not the action is disabled.
    • variant (:string) - Changes the visual appearance of the Button.Must be one of "plain", "primary", "secondary", "tertiary", or "monochromePlain".
    • tone (:string) - Sets the color treatment of the Button.Must be one of "critical", or "success".
    • full_width (:boolean) - Allows the button to grow to the width of its container.
    • size (:string) - Changes the size of the button, giving it more or less padding.Must be one of "micro", "slim", "medium", or "large".
    • navigate (:string) - Passes through to .link component.
    • patch (:string) - Passes through to .link component.
    • href (:string) - Passes through to .link component.
    • target (:string) - Passes through to .link component.
    • icon (:any) - Source of the icon.Examples include &OctantisWeb.Components.Polaris.Icons.arrow_right/1.
    • phx_click (:any) - Click function passed through to the button.

bulk_action_wrapper_class(attrs)

checkable_button(assigns)

Attributes

  • id (:string) (required)
  • name (:string) - Defaults to "select_all".
  • accessibility_label (:string) - Defaults to nil.
  • label (:string) - Defaults to nil.
  • checked (:atom) - Must be one of true, false, or :indeterminate.
  • disabled (:boolean) - Defaults to false.
  • phx_click (:any) - onClick: Callback when row is clicked.
  • aria_live (:atom) - Defaults to nil.

index_table(assigns)

An index table displays a collection of objects of the same type, like orders or products. The main job of an index table is to help merchants get an at-a-glance of the objects to perform actions or navigate to a full-page representation of it.

Examples

<.index_table />

See

Attributes

  • id (:string) - A unique identifier for the table. Defaults to "IndexTable".
  • selectable (:boolean) (required) - Include the selection checkboxes to the left.
  • selected (:map) - A map of row ids to 'true' or 'false'. Defaults to %{}.
  • rows (:list) (required) - A list of items, each item must have an id.
  • class (:any) - A class name to be added to the component class name. Defaults to "".
  • on_selection_change (:any) - Callback for when the checkbox is toggled. Defaults to nil.

Slots

  • col (required) - Accepts attributes:
    • header (:any) (required) - Examples include "Order", "Date", "Customer", and {"Total", [alignment: "end"]}.
    • class (:any) - Class to be passed on to the header and cell.
  • promoted_bulk_action - BulkActions for the table. Accepts attributes:
    • content (:string) - Content the action displays.
    • disabled (:boolean) - Whether or not the action is disabled.
    • variant (:string) - Changes the visual appearance of the Button.Must be one of "plain", "primary", "secondary", "tertiary", or "monochromePlain".
    • tone (:string) - Sets the color treatment of the Button.Must be one of "critical", or "success".
    • full_width (:boolean) - Allows the button to grow to the width of its container.
    • size (:string) - Changes the size of the button, giving it more or less padding.Must be one of "micro", "slim", "medium", or "large".
    • navigate (:string) - Passes through to .link component.
    • patch (:string) - Passes through to .link component.
    • href (:string) - Passes through to .link component.
    • target (:string) - Passes through to .link component.
    • icon (:any) - Source of the icon.Examples include &OctantisWeb.Components.Polaris.Icons.arrow_right/1.
    • phx_click (:any) - Click function passed through to the button.
  • inner_block

index_table_cell(assigns)

Attributes

  • phx_click (:any) - onClick: Callback when row is clicked.
  • class (:any) - Class to be passed on to the cell.

Slots

  • inner_block

index_table_row(assigns)

Attributes

  • phx_click (:any) - onClick: Callback when row is clicked.
  • checked (:boolean) (required)
  • selectable (:boolean) (required)

Slots

  • inner_block

index_table_row_checkbox(assigns)

Attributes

  • id (:string)
  • parent_id (:string)
  • on_selection_change (:any) - Callback for when the checkbox is toggled.
  • checked (:boolean) - Defaults to false.

index_table_th(assigns)

Attributes

  • heading (:any) (required)
  • index (:integer) (required)
  • last (:boolean) (required)
  • selectable (:boolean) (required)
  • class (:any) - Class to be passed on to the header and cel.

index_table_th_checkbox(assigns)

Attributes

  • id (:string)
  • on_selection_change (:any) - Callback for when the checkbox is toggled.
  • checked (:boolean) - Defaults to false.
  • selected_count (:integer) (required) - The number of selected rows.

table_class(attrs)

th_build_class(attrs)

th_class(arg)

tr_class(attrs)