This module only contains miscellaneous functions.
The components are defined in Doggo.Components.
Summary
JS
Hides the modal with the given ID.
Shows the modal with the given ID.
Shows the tab with the given index of the tabs/1 component with the given
ID.
Functions
Returns all component classes and data attributes used in the given components module.
JS
@spec hide_modal(Phoenix.LiveView.JS.t(), String.t()) :: Phoenix.LiveView.JS.t()
Hides the modal with the given ID.
The component needs its JavaScript hook registered, since this function uses
the hook to call close() on the dialog.
Example
<.link phx-click={hide_modal("pet-modal")}>hide</.link>
@spec show_modal(Phoenix.LiveView.JS.t(), String.t()) :: Phoenix.LiveView.JS.t()
Shows the modal with the given ID.
The component needs its JavaScript hook registered, since this function uses
the hook to call showModal() on the dialog.
Example
<.link phx-click={show_modal("pet-modal")}>show</.link>
@spec show_tab(Phoenix.LiveView.JS.t(), String.t(), integer()) :: Phoenix.LiveView.JS.t()
Shows the tab with the given index of the tabs/1 component with the given
ID.
The index is one-based. The component needs its JavaScript hook registered, since this function uses the hook to select the tab.
Example
Doggo.show_tab("my-tabs", 2)