Module: StimulusPlumbers::Helpers::CalendarTurboHelper

Included in:
StimulusPlumbers::Helpers
Defined in:
lib/stimulus_plumbers/helpers/calendar_turbo_helper.rb

Instance Method Summary collapse

Instance Method Details

#sp_calendar_turbo(date: Date.today, today: Date.today, selectable: false, selected_date: nil, show_other_months: false, **kwargs) ⇒ Object



18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
# File 'lib/stimulus_plumbers/helpers/calendar_turbo_helper.rb', line 18

def sp_calendar_turbo(
  date: Date.today,
  today: Date.today,
  selectable: false,
  selected_date: nil,
  show_other_months: false,
  **kwargs
)
  safe_join(
    [
      (
        :turbo_frame,
        id:   "calendar-month-frame",
        data: { "combobox-date-target": "monthView" }
      ) do
        calendar_turbo_renderer.month(
          date:              date,
          today:             today,
          selectable:        selectable,
          selected_date:     selected_date,
          show_other_months: show_other_months,
          **kwargs
        )
      end,
      (
        :turbo_frame,
        id:     "calendar-year-frame",
        hidden: true,
        data:   { "combobox-date-target": "yearView" }
      ) do
        calendar_turbo_renderer.year(date: date, today: today, selected_date: selected_date)
      end,
      (
        :turbo_frame,
        id:     "calendar-decade-frame",
        hidden: true,
        data:   { "combobox-date-target": "decadeView" }
      ) do
        calendar_turbo_renderer.decade(date: date, today: today, selected_date: selected_date)
      end
    ]
  )
end

#sp_calendar_turbo_decade(**kwargs) ⇒ Object



14
15
16
# File 'lib/stimulus_plumbers/helpers/calendar_turbo_helper.rb', line 14

def sp_calendar_turbo_decade(**kwargs)
  calendar_turbo_renderer.decade(**kwargs)
end

#sp_calendar_turbo_month(**kwargs) ⇒ Object



6
7
8
# File 'lib/stimulus_plumbers/helpers/calendar_turbo_helper.rb', line 6

def sp_calendar_turbo_month(**kwargs)
  calendar_turbo_renderer.month(**kwargs)
end

#sp_calendar_turbo_year(**kwargs) ⇒ Object



10
11
12
# File 'lib/stimulus_plumbers/helpers/calendar_turbo_helper.rb', line 10

def sp_calendar_turbo_year(**kwargs)
  calendar_turbo_renderer.year(**kwargs)
end