Class: PhlexKit::SelectInput
- Inherits:
-
BaseComponent
- Object
- Phlex::HTML
- BaseComponent
- PhlexKit::SelectInput
- Defined in:
- app/components/phlex_kit/select/select_input.rb
Overview
The hidden input that actually carries PhlexKit::Select's value into the form — the
Stimulus controller writes the chosen item's value here and dispatches a
change (which also feeds phlex-kit--form-field validation when the select
sits inside a PhlexKit::FormField). Pass name:/id:/value: like any
input; it's display:none. See select.rb.
Instance Method Summary collapse
-
#initialize(**attrs) ⇒ SelectInput
constructor
A new instance of SelectInput.
- #view_template ⇒ Object
Methods inherited from BaseComponent
Constructor Details
#initialize(**attrs) ⇒ SelectInput
Returns a new instance of SelectInput.
8 9 10 |
# File 'app/components/phlex_kit/select/select_input.rb', line 8 def initialize(**attrs) @attrs = attrs end |
Instance Method Details
#view_template ⇒ Object
12 13 14 15 16 17 18 19 20 21 |
# File 'app/components/phlex_kit/select/select_input.rb', line 12 def view_template input(**mix({ class: "pk-select-input", data: { phlex_kit__select_target: "input", phlex_kit__form_field_target: "input", action: "change->phlex-kit--form-field#onChange invalid->phlex-kit--form-field#onInvalid" } }, @attrs)) end |