Class: UI::DatePickerTriggerComponent
- Inherits:
-
ViewComponent::Base
- Object
- ViewComponent::Base
- UI::DatePickerTriggerComponent
- Includes:
- DatePickerTriggerBehavior
- Defined in:
- app/view_components/ui/date_picker_trigger_component.rb
Overview
DatePicker Trigger ViewComponent A button that triggers the date picker popover.
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(placeholder: "Select date", selected: nil, icon: :chevron, classes: "", **attributes) ⇒ DatePickerTriggerComponent
constructor
A new instance of DatePickerTriggerComponent.
Methods included from DatePickerTriggerBehavior
#calendar_icon, #chevron_down_icon, #date_picker_trigger_classes, #date_picker_trigger_data_attributes, #date_picker_trigger_html_attributes
Constructor Details
#initialize(placeholder: "Select date", selected: nil, icon: :chevron, classes: "", **attributes) ⇒ DatePickerTriggerComponent
Returns a new instance of DatePickerTriggerComponent.
17 18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'app/view_components/ui/date_picker_trigger_component.rb', line 17 def initialize( placeholder: "Select date", selected: nil, icon: :chevron, classes: "", **attributes ) @placeholder = placeholder @selected = selected @icon = icon @classes = classes @attributes = attributes end |
Instance Method Details
#call ⇒ Object
31 32 33 34 35 36 37 38 |
# File 'app/view_components/ui/date_picker_trigger_component.rb', line 31 def call content_tag :button, date_picker_trigger_html_attributes do safe_join([ render_label, render_icon ].compact) end end |