Class: ShadcnPhlexcomponents::DatePickerContentContainer

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(stimulus_controller_name: nil, **attributes) ⇒ DatePickerContentContainer

Returns a new instance of DatePickerContentContainer.



205
206
207
208
# File 'lib/shadcn_phlexcomponents/components/date_picker.rb', line 205

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

Instance Method Details

#default_attributesObject



210
211
212
213
214
215
# File 'lib/shadcn_phlexcomponents/components/date_picker.rb', line 210

def default_attributes
  {
    style: { display: "none" },
    data: { "#{@stimulus_controller_name}-target" => "contentContainer" },
  }
end

#view_templateObject



217
218
219
# File 'lib/shadcn_phlexcomponents/components/date_picker.rb', line 217

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