Class: UI::DatePickerInputComponent
- Inherits:
-
ViewComponent::Base
- Object
- ViewComponent::Base
- UI::DatePickerInputComponent
- Includes:
- DatePickerInputBehavior
- Defined in:
- app/view_components/ui/date_picker_input_component.rb
Overview
DatePicker Input ViewComponent An input field with calendar button for date picker.
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(placeholder: "Select date", value: "", id: nil, classes: "", icon_classes: "", **attributes) ⇒ DatePickerInputComponent
constructor
A new instance of DatePickerInputComponent.
Methods included from DatePickerInputBehavior
#date_picker_icon_button_classes, #date_picker_icon_button_data_attributes, #date_picker_input_classes, #date_picker_input_data_attributes, #date_picker_input_html_attributes
Constructor Details
#initialize(placeholder: "Select date", value: "", id: nil, classes: "", icon_classes: "", **attributes) ⇒ DatePickerInputComponent
Returns a new instance of DatePickerInputComponent.
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'app/view_components/ui/date_picker_input_component.rb', line 18 def initialize( placeholder: "Select date", value: "", id: nil, classes: "", icon_classes: "", **attributes ) @placeholder = placeholder @value = value @id = id @classes = classes @icon_classes = icon_classes @attributes = attributes end |
Instance Method Details
#call ⇒ Object
34 35 36 37 38 39 40 41 |
# File 'app/view_components/ui/date_picker_input_component.rb', line 34 def call content_tag :div, class: "relative flex gap-2" do safe_join([ render_input, ]) end end |