Class: PhlexKit::ComboboxItem

Inherits:
BaseComponent show all
Defined in:
app/components/phlex_kit/combobox/combobox_item.rb

Overview

One option row — a

Instance Method Summary collapse

Methods inherited from BaseComponent

#on

Constructor Details

#initialize(**attrs) ⇒ ComboboxItem

Returns a new instance of ComboboxItem.



7
8
9
# File 'app/components/phlex_kit/combobox/combobox_item.rb', line 7

def initialize(**attrs)
  @attrs = attrs
end

Instance Method Details

#view_templateObject



11
12
13
14
15
16
17
# File 'app/components/phlex_kit/combobox/combobox_item.rb', line 11

def view_template(&)
  label(**mix({
    class: "pk-combobox-item",
    role: "option",
    data: { phlex_kit__combobox_target: "item" }
  }, @attrs), &)
end