Class: Shadcn::Calendar::Preview
- Inherits:
-
ApplicationViewComponentPreview
- Object
- ViewComponentContrib::Preview::Base
- ApplicationViewComponentPreview
- Shadcn::Calendar::Preview
- Defined in:
- app/components/shadcn/calendar/preview.rb
Instance Method Summary collapse
-
#booked ⇒ Object
Upstream's "Booked dates".
-
#custom_cell_size ⇒ Object
Upstream's "Custom Cell Size".
-
#date_and_time ⇒ Object
Upstream's "Date and Time Picker".
-
#default ⇒ Object
Upstream's own first example, minus the border it wraps it in: a single month with today selected.
-
#dropdown_caption ⇒ Object
Upstream's "Month and Year Selector".
-
#in_a_form ⇒ Object
The hidden inputs a Rails form posts.
-
#month(month: "2026-09-01") ⇒ Object
The month is an argument here so a month can be asked for by URL.
-
#presets ⇒ Object
Upstream's "Presets".
-
#range ⇒ Object
Upstream's "Range Calendar".
-
#week_numbers ⇒ Object
Upstream's "Week Numbers".
Instance Method Details
#booked ⇒ Object
Upstream's "Booked dates".
33 34 35 |
# File 'app/components/shadcn/calendar/preview.rb', line 33 def booked render_with_template end |
#custom_cell_size ⇒ Object
Upstream's "Custom Cell Size".
38 39 40 |
# File 'app/components/shadcn/calendar/preview.rb', line 38 def custom_cell_size render_with_template end |
#date_and_time ⇒ Object
Upstream's "Date and Time Picker".
28 29 30 |
# File 'app/components/shadcn/calendar/preview.rb', line 28 def date_and_time render_with_template end |
#default ⇒ Object
Upstream's own first example, minus the border it wraps it in: a single month with today selected.
8 9 10 |
# File 'app/components/shadcn/calendar/preview.rb', line 8 def default render_with_template end |
#dropdown_caption ⇒ Object
Upstream's "Month and Year Selector".
13 14 15 |
# File 'app/components/shadcn/calendar/preview.rb', line 13 def dropdown_caption render_with_template end |
#in_a_form ⇒ Object
The hidden inputs a Rails form posts.
48 49 50 |
# File 'app/components/shadcn/calendar/preview.rb', line 48 def in_a_form render_with_template end |
#month(month: "2026-09-01") ⇒ Object
The month is an argument here so a month can be asked for by URL. That
is what spec/system/calendar_spec.rb compares the browser's own render
against: the grid exists twice — in Calendar::Month and in the
controller — and the only thing that keeps the two honest is asking the
server what it would have drawn.
59 60 61 |
# File 'app/components/shadcn/calendar/preview.rb', line 59 def month(month: "2026-09-01") render_component(month: Date.parse(month), class: "rounded-md border shadow-sm") end |
#presets ⇒ Object
Upstream's "Presets".
23 24 25 |
# File 'app/components/shadcn/calendar/preview.rb', line 23 def presets render_with_template end |
#range ⇒ Object
Upstream's "Range Calendar".
18 19 20 |
# File 'app/components/shadcn/calendar/preview.rb', line 18 def range render_with_template end |
#week_numbers ⇒ Object
Upstream's "Week Numbers".
43 44 45 |
# File 'app/components/shadcn/calendar/preview.rb', line 43 def week_numbers render_with_template end |