@@ -11,9 +11,11 @@ defmodule ElixirBoilerplateWeb.Components.Core do
1111 """
1212 use Phoenix.Component
1313
14- alias Phoenix.LiveView.JS
1514 import ElixirBoilerplate.Gettext
1615
16+ alias Phoenix.HTML.Form
17+ alias Phoenix.LiveView.JS
18+
1719 @ doc """
1820 Renders a modal.
1921
@@ -207,7 +209,7 @@ defmodule ElixirBoilerplateWeb.Components.Core do
207209 @ doc """
208210 Renders an input with label and error messages.
209211
210- A `%Phoenix.HTML. Form{}` and field name may be passed to the input
212+ A `%Form{}` and field name may be passed to the input
211213 to build input names and error messages, or all the attributes and
212214 errors may be passed explicitly.
213215
@@ -226,11 +228,11 @@ defmodule ElixirBoilerplateWeb.Components.Core do
226228 range radio search select tel text textarea time url week)
227229
228230 attr :value , :any
229- attr :field , :any , doc: "a %Phoenix.HTML. Form{}/field name tuple, for example: {f, :email}"
231+ attr :field , :any , doc: "a %Form{}/field name tuple, for example: {f, :email}"
230232 attr :errors , :list
231233 attr :checked , :boolean , doc: "the checked flag for checkbox inputs"
232234 attr :prompt , :string , default: nil , doc: "the prompt for select inputs"
233- attr :options , :list , doc: "the options to pass to Phoenix.HTML. Form.options_for_select/2"
235+ attr :options , :list , doc: "the options to pass to Form.options_for_select/2"
234236 attr :multiple , :boolean , default: false , doc: "the multiple flag for select inputs"
235237 attr :rest , :global , include: ~w( autocomplete cols disabled form max maxlength min minlength
236238 pattern placeholder readonly required rows size step)
@@ -240,11 +242,11 @@ defmodule ElixirBoilerplateWeb.Components.Core do
240242 assigns
241243 |> assign ( field: nil )
242244 |> assign_new ( :name , fn ->
243- name = Phoenix.HTML. Form. input_name ( f , field )
245+ name = Form . input_name ( f , field )
244246 if assigns . multiple , do: name <> "[]" , else: name
245247 end )
246- |> assign_new ( :id , fn -> Phoenix.HTML. Form. input_id ( f , field ) end )
247- |> assign_new ( :value , fn -> Phoenix.HTML. Form. input_value ( f , field ) end )
248+ |> assign_new ( :id , fn -> Form . input_id ( f , field ) end )
249+ |> assign_new ( :value , fn -> Form . input_value ( f , field ) end )
248250 |> assign_new ( :errors , fn -> translate_errors ( f . errors || [ ] , field ) end )
249251 |> input ( )
250252 end
@@ -273,7 +275,7 @@ defmodule ElixirBoilerplateWeb.Components.Core do
273275 { @ rest }
274276 >
275277 < option :if = { @ prompt } value = "" > <%= @ prompt %> </ option >
276- <%= Phoenix.HTML. Form. options_for_select ( @ options , @ value ) %>
278+ <%= Form . options_for_select ( @ options , @ value ) %>
277279 </ select >
278280 < . error :for = { msg <- @ errors } > <%= msg %> </ . error >
279281 </ div >
0 commit comments