class NfgUi::Components::Patterns::SlatActions
Slat
doc coming soon
Public Instance Methods
component_family()
click to toggle source
# File lib/nfg_ui/components/patterns/slat_actions.rb, line 20 def component_family :slats end
render() { |: body)| ... }
click to toggle source
# File lib/nfg_ui/components/patterns/slat_actions.rb, line 31 def render content_tag(:div, html_options) do if menu NfgUi::Components::Patterns::Dropdown.new({ }, view_context).render do capture do concat(NfgUi::Components::Elements::DropdownToggle.new({ **default_dropdown_toggle_options, body: dropdown_toggle_body }, view_context).render) concat(NfgUi::Components::Patterns::DropdownMenu.new({ traits: [:right] }, view_context).render { (block_given? ? yield : body) }) end end else # Render the integrated slat action and pass in all of the # related slat action options that are present in this SlatActions `:options` render_integrated_slat_action end end end
Private Instance Methods
default_dropdown_toggle_options()
click to toggle source
# File lib/nfg_ui/components/patterns/slat_actions.rb, line 52 def default_dropdown_toggle_options { outlined: true, theme: :secondary } end
dropdown_toggle_body()
click to toggle source
# File lib/nfg_ui/components/patterns/slat_actions.rb, line 56 def dropdown_toggle_body content_tag(:span, 'Actions', class: 'slat-actions-text') end
non_html_attribute_options()
click to toggle source
Calls superclass method
NfgUi::Components::Utilities::Patches::IntegratedSlatAction#non_html_attribute_options
# File lib/nfg_ui/components/patterns/slat_actions.rb, line 60 def non_html_attribute_options super.push(:menu) end