Class: Shadcn::Combobox::Chips::Component
- Inherits:
-
ApplicationViewComponent
- Object
- ViewComponent::Base
- ApplicationViewComponent
- Shadcn::Combobox::Chips::Component
- Defined in:
- app/components/shadcn/combobox/chips/component.rb
Overview
The box that holds the chosen values as removable tokens, with the field beside them — upstream's multiple-selection shape.
It is the field's own frame here rather than an InputGroup: upstream's classes draw the border, the ring and the invalid states themselves, because the box grows with its chips where an InputGroup does not.
Constant Summary
Constants inherited from ApplicationViewComponent
ApplicationViewComponent::CONTENTS_STYLE, ApplicationViewComponent::VOID_TAGS
Instance Attribute Summary
Attributes inherited from ApplicationViewComponent
Instance Method Summary collapse
Methods inherited from ApplicationViewComponent
#css_classes, default_tag, #initialize, #merged_style, #render_element, #shadcn_t, slot_name, #style_variants, #tag_name
Constructor Details
This class inherits a constructor from Shadcn::ApplicationViewComponent
Instance Method Details
#call ⇒ Object
32 33 34 |
# File 'app/components/shadcn/combobox/chips/component.rb', line 32 def call render_element(body: safe_join([ content, template ])) end |
#element_attributes(**defaults) ⇒ Object
28 29 30 |
# File 'app/components/shadcn/combobox/chips/component.rb', line 28 def element_attributes(**defaults) super(**{ "data-shadcn--combobox-target" => "chips" }.merge(defaults)) end |