Class: StimulusPlumbers::Components::Calendar
- Inherits:
-
Plumber::Base
- Object
- Plumber::Base
- StimulusPlumbers::Components::Calendar
- Defined in:
- lib/stimulus_plumbers/components/calendar.rb,
lib/stimulus_plumbers/components/calendar/month/turbo.rb,
lib/stimulus_plumbers/components/calendar/month/turbo/days_of_week.rb,
lib/stimulus_plumbers/components/calendar/month/turbo/days_of_month.rb
Defined Under Namespace
Modules: Month
Constant Summary collapse
- STIMULUS_CONTROLLER =
"calendar-month"- OBSERVER_STIMULUS_CONTROLLER =
"calendar-month-observer"- STIMULUS_DATA =
{ controller: "#{STIMULUS_CONTROLLER} #{OBSERVER_STIMULUS_CONTROLLER}", action: "click->#{OBSERVER_STIMULUS_CONTROLLER}#select" }.freeze
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
#month(**kwargs) ⇒ Object
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/stimulus_plumbers/components/calendar.rb', line 13 def month(**kwargs) = ( { classes: theme.resolve(:calendar).fetch(:classes, ""), data: STIMULUS_DATA }, kwargs ) template.content_tag(:div, role: "grid", **) do template.safe_join( [ template.tag.div(data: { "#{STIMULUS_CONTROLLER}-target" => "daysOfWeek" }), template.tag.div( role: "rowgroup", data: { "#{STIMULUS_CONTROLLER}-target" => "daysOfMonth" } ) ] ) end end |