Class: PhlexKit::CalendarWeekdays
- Inherits:
-
BaseComponent
- Object
- Phlex::HTML
- BaseComponent
- PhlexKit::CalendarWeekdays
- Defined in:
- app/components/phlex_kit/calendar/calendar_weekdays.rb
Overview
for the weekday header row, cloned into the CalendarBody on every render. See calendar.rb.
Constant Summary collapse
- DAYS =
%w[Monday Tuesday Wednesday Thursday Friday Saturday Sunday].freeze
Instance Method Summary collapse
-
#initialize(week_numbers: false, **attrs) ⇒ CalendarWeekdays
constructor
A new instance of CalendarWeekdays.
- #view_template ⇒ Object
Methods inherited from BaseComponent
Constructor Details
#initialize(week_numbers: false, **attrs) ⇒ CalendarWeekdays
Returns a new instance of CalendarWeekdays.
7 8 9 10 |
# File 'app/components/phlex_kit/calendar/calendar_weekdays.rb', line 7 def initialize(week_numbers: false, **attrs) @week_numbers = week_numbers @attrs = attrs end |
Instance Method Details
#view_template ⇒ Object
12 13 14 15 16 17 18 19 20 21 |
# File 'app/components/phlex_kit/calendar/calendar_weekdays.rb', line 12 def view_template template(data: { phlex_kit__calendar_target: "weekdaysTemplate" }) do thead(**@attrs) do tr(class: "pk-calendar-weekdays-row") do th(scope: "col", class: "pk-calendar-weekday pk-calendar-weeknumber-head", aria: { label: "Week number" }) { "#" } if @week_numbers DAYS.each { |day| render_day(day) } end end end end |