Module: UI::CommandGroupBehavior
- Included in:
- CommandGroup, CommandGroupComponent
- Defined in:
- app/behaviors/ui/command_group_behavior.rb
Overview
GroupBehavior
Shared behavior for CommandGroup component.
Instance Method Summary collapse
- #command_group_classes ⇒ Object
- #command_group_data_attributes ⇒ Object
- #command_group_heading_classes ⇒ Object
- #command_group_html_attributes ⇒ Object
Instance Method Details
#command_group_classes ⇒ Object
19 20 21 22 23 24 25 |
# File 'app/behaviors/ui/command_group_behavior.rb', line 19 def command_group_classes classes_value = respond_to?(:classes, true) ? classes : @classes TailwindMerge::Merger.new.merge([ command_group_base_classes, classes_value ].compact.join(" ")) end |
#command_group_data_attributes ⇒ Object
27 28 29 30 31 32 |
# File 'app/behaviors/ui/command_group_behavior.rb', line 27 def command_group_data_attributes { slot: "command-group", ui__command_target: "group" } end |
#command_group_heading_classes ⇒ Object
34 35 36 |
# File 'app/behaviors/ui/command_group_behavior.rb', line 34 def command_group_heading_classes "px-2 py-1.5 text-xs font-medium text-muted-foreground" end |
#command_group_html_attributes ⇒ Object
9 10 11 12 13 14 15 16 17 |
# File 'app/behaviors/ui/command_group_behavior.rb', line 9 def command_group_html_attributes attrs = { class: command_group_classes, data: command_group_data_attributes, role: "group" } attrs["aria-labelledby"] = @heading_id if @heading.present? attrs end |