Class: StimulusPlumbers::Components::Calendar::Renderer
- Inherits:
-
Plumber::Base
- Object
- Plumber::Base
- StimulusPlumbers::Components::Calendar::Renderer
- Defined in:
- lib/stimulus_plumbers/components/calendar/renderer.rb
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
Instance Attribute Summary
Attributes inherited from Plumber::Base
Instance Method Summary collapse
Methods inherited from Plumber::Base
Methods included from Plumber::HtmlOptions
#merge_html_options, #merge_string_option, #normalize_part
Constructor Details
This class inherits a constructor from StimulusPlumbers::Components::Plumber::Base
Instance Method Details
#month(**kwargs) ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/stimulus_plumbers/components/calendar/renderer.rb', line 14 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 |