Class: StimulusPlumbers::Components::Combobox::Date

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

Constant Summary collapse

STIMULUS_CONTROLLER =
"combobox-date"
CALENDAR_OUTLET =
"#{STIMULUS_CONTROLLER}-calendar-month-outlet".freeze

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

#extract_classes, #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

.calendar_id_for(popover_id) ⇒ Object



17
18
19
# File 'lib/stimulus_plumbers/components/combobox/date.rb', line 17

def self.calendar_id_for(popover_id)
  [popover_id, "calendar"].compact.join("_")
end

.default_optsObject



10
11
12
13
14
15
# File 'lib/stimulus_plumbers/components/combobox/date.rb', line 10

def self.default_opts
  {
    input:   { data: { combobox_date_date_value: nil } },
    popover: { label: "Picker", role: "dialog", tag: :div }
  }
end

Instance Method Details

#renderObject



21
22
23
# File 'lib/stimulus_plumbers/components/combobox/date.rb', line 21

def render(...)
  render_date(...)
end