Class: StimulusPlumbers::Components::Combobox::Options::OptionGroup
- Inherits:
-
Plumber::Base
- Object
- Plumber::Base
- StimulusPlumbers::Components::Combobox::Options::OptionGroup
- Defined in:
- lib/stimulus_plumbers/components/combobox/options/option_group.rb
Constant Summary
Constants included from Plumber::HtmlOptions
Plumber::HtmlOptions::STIMULUS_SPACEJOIN_KEYS
Instance Attribute Summary
Attributes inherited from Plumber::Base
Instance Method Summary collapse
Methods inherited from Plumber::Base
Methods included from Plumber::HtmlOptions
#merge_data_options, #merge_html_options, #merge_string_option, #normalize_part
Constructor Details
This class inherits a constructor from StimulusPlumbers::Plumber::Base
Instance Method Details
#render(label:, options:, value: nil) ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/stimulus_plumbers/components/combobox/options/option_group.rb', line 8 def render(label:, options:, value: nil) attrs = ( { classes: theme.resolve(:combobox_option_group).fetch(:classes, "") }, { role: "group", aria: { label: label } } ) template.content_tag(:li, **attrs) do template.safe_join( [ template.content_tag(:span, label, aria: { hidden: "true" }), template.content_tag(:ul) do Options.new(template).render(, value: value) end ] ) end end |