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
-
#slat_header ⇒ Object
Signal if this slat_action is being used In the slat_header area of the Slats.
-
#wide ⇒ Object
Signals if this is a wide SlatActions.
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
50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 |
# File 'lib/nfg_ui/components/patterns/slat_actions.rb', line 50 def render content_tag(:div, ) do if if slat_header content_tag(:h6, " ".html_safe, class: 'display-4') else NfgUi::Components::Patterns::Dropdown.new({ }, view_context).render do capture do concat(NfgUi::Components::Elements::DropdownToggle.new({ **, body: ('Actions' if wide)}, view_context).render) concat(NfgUi::Components::Patterns::DropdownMenu.new({ traits: [:right] }, view_context).render { (block_given? ? yield : body) }) end 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 |
#slat_header ⇒ Object
Signal if this slat_action is being used In the slat_header area of the Slats
If so, this then customizes the output of the SlatActions to ensure that the widths of the slat_header columns is accurate and matches the width of the slats below.
37 38 39 |
# File 'lib/nfg_ui/components/patterns/slat_actions.rb', line 37 def slat_header .fetch(:slat_header, false) end |
#wide ⇒ Object
Signals if this is a wide SlatActions. This is a stylistic update which is used in situations like shopping carts where you may only be providing a summary and have no actions or extra columns.
Note: Further documentation is needed on this
46 47 48 |
# File 'lib/nfg_ui/components/patterns/slat_actions.rb', line 46 def wide .fetch(:wide, true) end |