Class: Bs5::DropdownComponent
- Inherits:
-
ViewComponent::Base
- Object
- ViewComponent::Base
- Bs5::DropdownComponent
- Includes:
- ComponentsHelper, ViewComponent::SlotableV2
- Defined in:
- app/components/bs5/dropdown_component.rb
Overview
rubocop:disable Metrics/ClassLength
Constant Summary collapse
- CLASS_PREFIX =
'dropdown'
- CLASS_NAMES =
{ visually_hidden: 'visually-hidden', toggle_split: "#{CLASS_PREFIX}-toggle-split", toggle: "#{CLASS_PREFIX}-toggle", menu: "#{CLASS_PREFIX}-menu", menu_dark: "#{CLASS_PREFIX}-menu-dark", menu_end: "#{CLASS_PREFIX}-menu-end" }.freeze
- DIRECTIONS =
{ up: :dropup, end: :dropend, start: :dropstart }.with_indifferent_access.freeze
- DROPDOWN_OPTIONS =
%i[offset flip boundary reference display].freeze
Constants included from ComponentsHelper
Instance Attribute Summary collapse
-
#title ⇒ Object
readonly
Returns the value of attribute title.
Instance Method Summary collapse
-
#initialize(content_or_options = nil, options = {}) ⇒ DropdownComponent
constructor
A new instance of DropdownComponent.
Methods included from ComponentsHelper
#bs5_collapse, #bs5_popover, #bs5_tooltip
Constructor Details
#initialize(content_or_options = nil, options = {}) ⇒ DropdownComponent
Returns a new instance of DropdownComponent.
28 29 30 31 32 33 34 35 36 37 |
# File 'app/components/bs5/dropdown_component.rb', line 28 def initialize( = nil, = {}) if .is_a? Hash @options = .symbolize_keys else @title = @options = .symbolize_keys end end |
Instance Attribute Details
#title ⇒ Object (readonly)
Returns the value of attribute title.
26 27 28 |
# File 'app/components/bs5/dropdown_component.rb', line 26 def title @title end |