Class: PhlexKit::SelectContent
- Inherits:
-
BaseComponent
- Object
- Phlex::HTML
- BaseComponent
- PhlexKit::SelectContent
- Defined in:
- app/components/phlex_kit/select/select_content.rb
Overview
The dropdown panel for PhlexKit::Select — hidden until the trigger opens it (the
controller toggles the hidden class). Outer div is the positioned/targeted
layer; the inner .pk-select-viewport is the bordered, scrollable box.
Holds SelectGroup / SelectLabel / SelectItem children. See select.rb.
Instance Method Summary collapse
-
#initialize(**attrs) ⇒ SelectContent
constructor
A new instance of SelectContent.
- #view_template(&block) ⇒ Object
Methods inherited from BaseComponent
Constructor Details
#initialize(**attrs) ⇒ SelectContent
Returns a new instance of SelectContent.
7 8 9 10 |
# File 'app/components/phlex_kit/select/select_content.rb', line 7 def initialize(**attrs) @id = "pk-select-content-#{SecureRandom.hex(4)}" @attrs = attrs end |
Instance Method Details
#view_template(&block) ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 |
# File 'app/components/phlex_kit/select/select_content.rb', line 12 def view_template(&block) div(**mix({ id: @id, role: "listbox", tabindex: "-1", class: "pk-select-content hidden", data: { phlex_kit__select_target: "content" } }, @attrs)) do div(class: "pk-select-viewport", &block) end end |