Class: PhlexKit::CalendarTitle

Inherits:
BaseComponent show all
Defined in:
app/components/phlex_kit/calendar/calendar_title.rb

Overview

"Month Year" heading — rewritten by the controller as you navigate. See calendar.rb.

Instance Method Summary collapse

Methods inherited from BaseComponent

#on

Constructor Details

#initialize(default: "Month Year", **attrs) ⇒ CalendarTitle

Returns a new instance of CalendarTitle.



5
6
7
8
# File 'app/components/phlex_kit/calendar/calendar_title.rb', line 5

def initialize(default: "Month Year", **attrs)
  @default = default
  @attrs = attrs
end

Instance Method Details

#view_templateObject



10
11
12
13
14
15
16
17
# File 'app/components/phlex_kit/calendar/calendar_title.rb', line 10

def view_template
  div(**mix({
    class: "pk-calendar-title",
    role: "presentation",
    aria: { live: "polite" },
    data: { phlex_kit__calendar_target: "title" }
  }, @attrs)) { @default }
end