Class: ShadcnPhlexcomponents::CollapsibleContent
- Defined in:
- lib/shadcn_phlexcomponents/components/collapsible.rb
Constant Summary
Constants inherited from Base
Base::SANITIZER_ALLOWED_ATTRIBUTES, Base::SANITIZER_ALLOWED_TAGS, Base::TAILWIND_MERGER
Instance Method Summary collapse
- #default_attributes ⇒ Object
-
#initialize(aria_id: :nil, **attributes) ⇒ CollapsibleContent
constructor
A new instance of CollapsibleContent.
- #view_template ⇒ Object
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(aria_id: :nil, **attributes) ⇒ CollapsibleContent
Returns a new instance of CollapsibleContent.
72 73 74 75 |
# File 'lib/shadcn_phlexcomponents/components/collapsible.rb', line 72 def initialize(aria_id: :nil, **attributes) @aria_id = aria_id super(**attributes) end |
Instance Method Details
#default_attributes ⇒ Object
77 78 79 80 81 82 83 84 |
# File 'lib/shadcn_phlexcomponents/components/collapsible.rb', line 77 def default_attributes { id: "#{@aria_id}-content", data: { collapsible_target: "content", }, } end |
#view_template ⇒ Object
86 87 88 |
# File 'lib/shadcn_phlexcomponents/components/collapsible.rb', line 86 def view_template(&) div(style: { display: "none" }, **@attributes, &) end |