Class: ShadcnPhlexcomponents::DropdownMenuItemTo
- Inherits:
-
DropdownMenuItem
- Object
- Phlex::HTML
- Base
- DropdownMenuItem
- ShadcnPhlexcomponents::DropdownMenuItemTo
- Defined in:
- lib/shadcn_phlexcomponents/components/dropdown_menu.rb
Constant Summary
Constants inherited from Base
Base::SANITIZER_ALLOWED_ATTRIBUTES, Base::SANITIZER_ALLOWED_TAGS, Base::TAILWIND_MERGER
Instance Method Summary collapse
- #class_variants(**args) ⇒ Object
-
#initialize(name = nil, options = nil, html_options = nil) ⇒ DropdownMenuItemTo
constructor
A new instance of DropdownMenuItemTo.
- #view_template ⇒ Object
Methods inherited from DropdownMenuItem
Methods inherited from Base
#before_template, #convert_collection_hash_to_struct, #default_attributes, #find_as_child, #icon, #item_disabled?, #merge_default_attributes, #merged_as_child_attributes, #nokogiri_attributes_to_hash, #overlay, #sanitize_as_child
Constructor Details
#initialize(name = nil, options = nil, html_options = nil) ⇒ DropdownMenuItemTo
Returns a new instance of DropdownMenuItemTo.
247 248 249 250 251 |
# File 'lib/shadcn_phlexcomponents/components/dropdown_menu.rb', line 247 def initialize(name = nil, = nil, = nil) @name = name = = end |
Instance Method Details
#class_variants(**args) ⇒ Object
253 254 255 |
# File 'lib/shadcn_phlexcomponents/components/dropdown_menu.rb', line 253 def class_variants(**args) DropdownMenuItem.new.class_variants(class: "w-full #{args[:class]}") end |
#view_template ⇒ Object
257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 |
# File 'lib/shadcn_phlexcomponents/components/dropdown_menu.rb', line 257 def view_template(&) if block_given? = = @name end ||= {} @variant = .delete(:variant) || :default @disabled = [:disabled] merge_default_attributes({}) = mix(@attributes, ) if block_given? (, , &) else (@name, , ) end end |