Class: ShadcnPhlexcomponents::DatePickerInputContainer

Inherits:
Base
  • Object
show all
Defined in:
lib/shadcn_phlexcomponents/components/date_picker.rb

Constant Summary

Constants inherited from Base

Base::SANITIZER_ALLOWED_ATTRIBUTES, Base::SANITIZER_ALLOWED_TAGS, Base::TAILWIND_MERGER

Instance Method Summary collapse

Methods inherited from Base

#before_template, #convert_collection_hash_to_struct, #find_as_child, #icon, #item_disabled?, #merge_default_attributes, #merged_as_child_attributes, #nokogiri_attributes_to_hash, #overlay, #sanitize_as_child

Constructor Details

#initialize(disabled: false, stimulus_controller_name: nil, **attributes) ⇒ DatePickerInputContainer

Returns a new instance of DatePickerInputContainer.



238
239
240
241
242
# File 'lib/shadcn_phlexcomponents/components/date_picker.rb', line 238

def initialize(disabled: false, stimulus_controller_name: nil, **attributes)
  @disabled = disabled
  @stimulus_controller_name = stimulus_controller_name
  super(**attributes)
end

Instance Method Details

#default_attributesObject



244
245
246
247
248
249
250
251
# File 'lib/shadcn_phlexcomponents/components/date_picker.rb', line 244

def default_attributes
  {
    data: {
      "#{@stimulus_controller_name}-target" => "inputContainer",
      disabled: @disabled,
    },
  }
end

#view_templateObject



253
254
255
# File 'lib/shadcn_phlexcomponents/components/date_picker.rb', line 253

def view_template(&)
  div(**@attributes, &)
end