View Source AshPyro.Extensions.Resource (AshPyro v0.2.1)
An Ash resource extension providing declarative configuration of user interfaces via AshPyro components.
DSL Documentation
Index
- pyro
- data_table
- action
- column
- action_type
- column
- action
- form
- action
- field
- field_group
- field
- action_type
- field
- field_group
- field
- action
- live_view
- page
- list
- show
- create
- update
- page
- data_table
Docs
pyro
Configure the pyro dashboard for a given resource
- data_table
- action
- column
- action_type
- column
- action
- form
- action
- field
- field_group
- field
- action_type
- field
- field_group
- field
- action
- live_view
- page
- list
- show
- create
- update
- page
data_table
Configure the appearance of data tables in the AshPyro.Extensions.Resource extension.
- action
- column
- action_type
- column
:exclude(list ofatom/0) - The actions to exclude from data tables. The default value is[].
action
Configure the appearance of the data table for specific action(s).
* column:class- Customize data table classes.:default_display(list ofatom/0) - The columns to display by default. The default value is[].:default_sort- The columns to sort on by default. The default value isnil.:exclude(list ofatom/0) - The fields to exclude from columns. The default value is[].:description(String.t/0) - The description for this data table (defaults to action's description).:name- Required. The action name(s) for this data table.:label(String.t/0) - The label for this data table (defaults to capitalized name).
column
Declare non-default behavior for a specific data table column in the AshPyro.Extensions.Resource extension.
:cell_class- Customize cell class.:class- Customize header class.:description(String.t/0) - Override the default extracted description.:label(String.t/0) - The label of the column (defaults to capitalized name).:name(atom/0) - Required. The name of the column.:path(list ofatom/0) - Append to the root path (nested paths are appended).:render_cell(function of arity 1) - The default value is&AshPyro.Extensions.Resource.DataTable.Column.render_cell/1.:sortable?(boolean/0) - Set to false to disable sorting. Note: If it it is not technically sortable, it will automatically be set to false. The default value istrue.:type- The type of the the column. Valid values are :default The default value is:default.
action_type
Configure the default data table appearance for actions of type(s). Will be ignored by actions configured explicitly.
* column:class- Customize data table classes.:default_display(list ofatom/0) - The columns to display by default. The default value is[].:default_sort- The columns to sort on by default. The default value isnil.:exclude(list ofatom/0) - The fields to exclude from columns. The default value is[].:exclude(list ofatom/0) - The fields to exclude from columns. The default value is[].:name- Required. The action type(s) for this data table.
column
Declare non-default behavior for a specific data table column in the AshPyro.Extensions.Resource extension.
:cell_class- Customize cell class.:class- Customize header class.:description(String.t/0) - Override the default extracted description.:label(String.t/0) - The label of the column (defaults to capitalized name).:name(atom/0) - Required. The name of the column.:path(list ofatom/0) - Append to the root path (nested paths are appended).:render_cell(function of arity 1) - The default value is&AshPyro.Extensions.Resource.DataTable.Column.render_cell/1.:sortable?(boolean/0) - Set to false to disable sorting. Note: If it it is not technically sortable, it will automatically be set to false. The default value istrue.:type- The type of the the column. Valid values are :default The default value is:default.
form
Configure the appearance of forms in the AshPyro.Extensions.Resource extension.
- action
- field
- field_group
- field
- action_type
- field
- field_group
- field
:exclude(list ofatom/0) - The actions to exclude from forms. The default value is[].
action
Configure the appearance forms forms for specific action(s).
* field
* field_group
* field:name- Required. The action name(s) for this form.:label(String.t/0) - The label for this form (defaults to capitalized name).:description(String.t/0) - The description for this form (defaults to action's description).:class- Customize form classes.
field
Declare non-default behavior for a specific form field in the AshPyro.Extensions.Resource extension.
:name(atom/0) - Required. The name of the field to be modified:type- The type of the value in the form. Valid values are :default, :long_text, :short_text, :autocomplete, :select, :nested_form The default value is:default.:options(list ofterm/0) - The options for a select type input. The default value is[].:label(String.t/0) - The label of the field (defaults to capitalized name).:description(String.t/0) - Override the default extracted description.:class- Customize class.:input_class- Customize input class.:autofocus(boolean/0) - Autofocus the field. The default value isfalse.:prompt(String.t/0) - Override the default prompt.:path(list ofatom/0) - Append to the root path (nested paths are appended).:autocomplete_search_action(atom/0) - Set the autocomplete search action name. The default value is:autocomplete.:autocomplete_search_arg(atom/0) - Set the autocomplete search argument key. The default value is:search.:autocomplete_option_label_key(atom/0) - Override the default autocomplete key used as a label. The default value is:label.:autocomplete_option_value_key(atom/0) - Override the default autocomplete key used as a value. The default value is:id.
field_group
Configure the appearance of form field groups in the AshPyro.Extensions.Resource extension.
* field:name(atom/0) - Required. The name of the field group.:label(String.t/0) - The label of this group (defaults to capitalized name).:class- Customize class.:path(list ofatom/0) - Append to the root path (nested paths are appended).
####### field
Declare non-default behavior for a specific form field in the AshPyro.Extensions.Resource extension.
:name(atom/0) - Required. The name of the field to be modified:type- The type of the value in the form. Valid values are :default, :long_text, :short_text, :autocomplete, :select, :nested_form The default value is:default.:options(list ofterm/0) - The options for a select type input. The default value is[].:label(String.t/0) - The label of the field (defaults to capitalized name).:description(String.t/0) - Override the default extracted description.:class- Customize class.:input_class- Customize input class.:autofocus(boolean/0) - Autofocus the field. The default value isfalse.:prompt(String.t/0) - Override the default prompt.:path(list ofatom/0) - Append to the root path (nested paths are appended).:autocomplete_search_action(atom/0) - Set the autocomplete search action name. The default value is:autocomplete.:autocomplete_search_arg(atom/0) - Set the autocomplete search argument key. The default value is:search.:autocomplete_option_label_key(atom/0) - Override the default autocomplete key used as a label. The default value is:label.:autocomplete_option_value_key(atom/0) - Override the default autocomplete key used as a value. The default value is:id.
action_type
Configure default form appearance for actions of type(s). Will be ignored by actions configured explicitly.
* field
* field_group
* field:name- Required. The action type(s) for this form.:class- Customize form classes.
field
Declare non-default behavior for a specific form field in the AshPyro.Extensions.Resource extension.
:name(atom/0) - Required. The name of the field to be modified:type- The type of the value in the form. Valid values are :default, :long_text, :short_text, :autocomplete, :select, :nested_form The default value is:default.:options(list ofterm/0) - The options for a select type input. The default value is[].:label(String.t/0) - The label of the field (defaults to capitalized name).:description(String.t/0) - Override the default extracted description.:class- Customize class.:input_class- Customize input class.:autofocus(boolean/0) - Autofocus the field. The default value isfalse.:prompt(String.t/0) - Override the default prompt.:path(list ofatom/0) - Append to the root path (nested paths are appended).:autocomplete_search_action(atom/0) - Set the autocomplete search action name. The default value is:autocomplete.:autocomplete_search_arg(atom/0) - Set the autocomplete search argument key. The default value is:search.:autocomplete_option_label_key(atom/0) - Override the default autocomplete key used as a label. The default value is:label.:autocomplete_option_value_key(atom/0) - Override the default autocomplete key used as a value. The default value is:id.
field_group
Configure the appearance of form field groups in the AshPyro.Extensions.Resource extension.
* field:name(atom/0) - Required. The name of the field group.:label(String.t/0) - The label of this group (defaults to capitalized name).:class- Customize class.:path(list ofatom/0) - Append to the root path (nested paths are appended).
####### field
Declare non-default behavior for a specific form field in the AshPyro.Extensions.Resource extension.
:name(atom/0) - Required. The name of the field to be modified:type- The type of the value in the form. Valid values are :default, :long_text, :short_text, :autocomplete, :select, :nested_form The default value is:default.:options(list ofterm/0) - The options for a select type input. The default value is[].:label(String.t/0) - The label of the field (defaults to capitalized name).:description(String.t/0) - Override the default extracted description.:class- Customize class.:input_class- Customize input class.:autofocus(boolean/0) - Autofocus the field. The default value isfalse.:prompt(String.t/0) - Override the default prompt.:path(list ofatom/0) - Append to the root path (nested paths are appended).:autocomplete_search_action(atom/0) - Set the autocomplete search action name. The default value is:autocomplete.:autocomplete_search_arg(atom/0) - Set the autocomplete search argument key. The default value is:search.:autocomplete_option_label_key(atom/0) - Override the default autocomplete key used as a label. The default value is:label.:autocomplete_option_value_key(atom/0) - Override the default autocomplete key used as a value. The default value is:id.
live_view
Configure LiveViews in the AshPyro.Extensions.Resource extension.
- page
- list
- show
- create
- update
page
Configure a page for this resource.
* list
* show
* create
* update:api(atom/0) - Required. The API for routes on this page (can also specify per-route/per-action).:class- Customize page classes.:keep_live?(boolean/0) - Subscribe to resource updates and keep the view up to date. The default value isfalse.:name(atom/0) - Required. The live action for this page.:path(String.t/0) - Required. The route path for this page.:route_helper(atom/0) - The route helper name to be generated. Defaults to [name]_path.:view_as- The view style of the page::list_and_modal- Always list view, show/create/edit in a modal:show_and_modal- List view for list actions, show as a dedicated view, create/edit in a modal on show:individual- All actions are a dedicated view Valid values are :list_and_modal, :show_and_modal, :individual The default value is:list_and_modal.
list
Configure a list action for this resource.
:path(String.t/0) - Required. The route path for this action.:live_action(atom/0) - Required. The live action for this action.:action(atom/0) - Required. The action to use to load the records.:display_as- How to display the action. Valid values are :data_table, :card_grid The default value is:data_table.:label- The label for this action (defaults to humanized live_action).:description- The description for this action.:class- Customize action classes.:pagination- The pagination type (defaults to:offsetif available). Valid values are :keyset, :offset, :none:default_limit(integer/0) - The default pagination limit (defaults to the resource'sdefault_limit, falling back tomax_page_size).:count?(boolean/0) - Whether to count the query (defaults to true for:offsetpagination if available).
show
Configure a show action for this resource.
:path(String.t/0) - Required. The route path for this action.:live_action(atom/0) - Required. The live action for this action.:action(atom/0) - Required. The action to use to load the record.:display_as- How to display the action. Valid values are :card The default value is:card.:label- The label for this action (defaults to humanized live_action).:description- The description for this action.:class- Customize action classes.:identity- The identity used to load the record. The default value is:id.
create
Configure a create action for this resource.
:path(String.t/0) - Required. The route path for this action.:live_action(atom/0) - Required. The live action for this action.:action(atom/0) - Required. The action to use to create the record.:display_as- How to display the action. Valid values are :form The default value is:form.:label- The label for this action (defaults to humanized live_action).:description- The description for this action.:class- Customize action classes.:identity- The identity used to load the record. The default value is:id.
update
Configure a update action for this resource.
:path(String.t/0) - Required. The route path for this action.:live_action(atom/0) - Required. The live action for this action.:action(atom/0) - Required. The action to use to update the record.:load_action(atom/0) - The action to use to load the record.:display_as- How to display the action. Valid values are :form The default value is:form.:label- The label for this action (defaults to humanized live_action).:description- The description for this action.:class- Customize action classes.:identity- The identity used to load the record. The default value is:id.