Class: ShadcnPhlexcomponents::Input
- Defined in:
- lib/shadcn_phlexcomponents/components/input.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(type: :text, **attributes) ⇒ Input
constructor
A new instance of Input.
- #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(type: :text, **attributes) ⇒ Input
Returns a new instance of Input.
21 22 23 24 |
# File 'lib/shadcn_phlexcomponents/components/input.rb', line 21 def initialize(type: :text, **attributes) @type = type super(**attributes) end |
Instance Method Details
#default_attributes ⇒ Object
26 27 28 29 30 |
# File 'lib/shadcn_phlexcomponents/components/input.rb', line 26 def default_attributes { type: @type, } end |
#view_template ⇒ Object
32 33 34 |
# File 'lib/shadcn_phlexcomponents/components/input.rb', line 32 def view_template(&) input(**@attributes, &) end |