Class: StimulusPlumbers::Components::Combobox::Autocomplete

Inherits:
Plumber::Base
  • Object
show all
Defined in:
lib/stimulus_plumbers/components/combobox/autocomplete.rb

Constant Summary

Constants included from Plumber::HtmlOptions

Plumber::HtmlOptions::STIMULUS_SPACEJOIN_KEYS

Instance Attribute Summary

Attributes inherited from Plumber::Base

#template

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Plumber::Base

#initialize, #theme

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

Class Method Details

.default_optsObject



7
8
9
10
11
# File 'lib/stimulus_plumbers/components/combobox/autocomplete.rb', line 7

def self.default_opts
  Dropdown.default_opts.deep_merge(
    trigger: { aria_autocomplete: "list", readonly: false }
  )
end

Instance Method Details

#render(options: [], value: nil, label: nil, **_kwargs) ⇒ Object



13
14
15
# File 'lib/stimulus_plumbers/components/combobox/autocomplete.rb', line 13

def render(options: [], value: nil, label: nil, **_kwargs)
  template.safe_join([listbox(options, value, label), loading, empty])
end