Class: PhlexKit::CalendarNext

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

Overview

Next-month button, pinned to the header's right edge. See calendar.rb.

Instance Method Summary collapse

Methods inherited from BaseComponent

#on

Constructor Details

#initialize(**attrs) ⇒ CalendarNext

Returns a new instance of CalendarNext.



4
5
6
# File 'app/components/phlex_kit/calendar/calendar_next.rb', line 4

def initialize(**attrs)
  @attrs = attrs
end

Instance Method Details

#view_templateObject



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

def view_template
  button(**mix({
    type: :button,
    name: "next-month",
    class: "pk-calendar-next",
    aria: { label: "Go to next month" },
    data: { action: "click->phlex-kit--calendar#nextMonth" }
  }, @attrs)) do
    icon
  end
end