Class: NfgUi::Components::Patterns::SlatActions
- Inherits:
-
Base
- Object
- Bootstrap::Components::Base
- Base
- NfgUi::Components::Patterns::SlatActions
- Includes:
- Utilities::Patches::IntegratedSlatAction
- Defined in:
- lib/nfg_ui/components/patterns/slat_actions.rb
Overview
Slat doc coming soon
Constant Summary
Constants included from Traits::Theme
Traits::Theme::COLOR_TRAITS, Traits::Theme::TRAITS
Constants included from Traits
Traits::REGISTERED_TRAITS, Traits::TRAIT_MODULES
Instance Attribute Summary
Attributes inherited from Bootstrap::Components::Base
#body, #options, #view_context
Instance Method Summary collapse
- #component_family ⇒ Object
-
#menu ⇒ Object
Signals whether or not this SlatActions will house a menu This is a critical condition.
- #render ⇒ Object
Methods included from Utilities::Patches::IntegratedSlatAction
#button, #confirm, #disable_with, #href, #method, #outlined, #remote, #render_integrated_slat_action, #theme
Methods included from Traits::Theme
#danger_trait, #dark_trait, #info_trait, #light_trait, #outlined_trait, #primary_trait, #secondary_trait, #success_trait, #warning_trait, #white_trait
Methods included from Utilities::Iconable
Methods included from Utilities::Traitable
Methods included from Utilities::Renderable
Methods included from Utilities::Describable
Methods inherited from Bootstrap::Components::Base
#data, #href, #html_options, #id, #initialize, #style
Constructor Details
This class inherits a constructor from NfgUi::Bootstrap::Components::Base
Instance Method Details
#component_family ⇒ Object
20 21 22 |
# File 'lib/nfg_ui/components/patterns/slat_actions.rb', line 20 def component_family :slats end |
#menu ⇒ Object
Signals whether or not this SlatActions will house a menu This is a critical condition. When false, a SlatAction is automatically integrated on your behalf.
27 28 29 |
# File 'lib/nfg_ui/components/patterns/slat_actions.rb', line 27 def .fetch(:menu, true) end |
#render ⇒ Object
31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 |
# File 'lib/nfg_ui/components/patterns/slat_actions.rb', line 31 def render content_tag(:div, ) do if NfgUi::Components::Patterns::Dropdown.new({ }, view_context).render do capture do concat(NfgUi::Components::Elements::DropdownToggle.new({ **, 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 |