Class: StimulusPlumbers::Components::DatePicker::Navigator

Inherits:
Plumber::Base
  • Object
show all
Defined in:
lib/stimulus_plumbers/components/date_picker/navigator.rb

Instance Attribute Summary

Attributes inherited from Plumber::Base

#template

Instance Method Summary collapse

Methods inherited from Plumber::Base

#initialize, #theme

Methods included from Plumber::HtmlOptions

#merge_html_options, #merge_string_option, #normalize_part

Constructor Details

This class inherits a constructor from StimulusPlumbers::Components::Plumber::Base

Instance Method Details

#render(icon_options: nil, **kwargs) ⇒ Object



7
8
9
10
11
12
13
14
15
16
17
18
# File 'lib/stimulus_plumbers/components/date_picker/navigator.rb', line 7

def render(icon_options: nil, **kwargs)
  html_options = merge_html_options(
    { classes: theme.resolve(:calendar_navigation_navigator).fetch(:classes, "") },
    kwargs
  )

  if icon_options.nil?
    template.(:button, nil, **html_options)
  else
    template.(:button, icon(icon_options), **html_options)
  end
end