class Primer::Alpha::AutoComplete
def initialize(label_text:, src:, list_id:, input_id:, input_name: nil, is_label_visible: true, is_label_inline: false, with_icon: false, is_clearable: false, **system_arguments)
-
system_arguments
(Hash
) -- <%= link_to_system_arguments_docs %> -
is_label_inline
(Boolean
) -- Controls if the label is inline. On smaller screens, label will always become stacked. -
is_clearable
(Boolean
) -- Adds optional clear button. -
is_label_visible
(Boolean
) -- Controls if the label is visible. If `false`, screen reader only text will be added. -
with_icon
(Boolean
) -- Controls if a search icon is visible, defaults to `false`. -
list_id
(String
) -- Id of the list element. -
input_name
(String
) -- Optional name of the input element, defaults to `input_id` when not set. -
input_id
(String
) -- Id of the input element. -
src
(String
) -- The route to query. -
label_text
(String
) -- The label of the input.
def initialize(label_text:, src:, list_id:, input_id:, input_name: nil, is_label_visible: true, is_label_inline: false, with_icon: false, is_clearable: false, **system_arguments) @label_text = label_text @list_id = list_id @input_id = input_id @input_name = input_name || input_id @is_label_visible = is_label_visible @with_icon = with_icon @is_clearable = is_clearable @label_classes = label_classes(is_label_visible: is_label_visible, is_label_inline: is_label_inline) @system_arguments = deny_tag_argument(**system_arguments) @system_arguments[:tag] = "auto-complete" @system_arguments[:src] = src @system_arguments[:for] = list_id end