Class: NfgUi::Components::Elements::Step
- Inherits:
-
NavItem
- Object
- Bootstrap::Components::Base
- Bootstrap::Components::NavItem
- NavItem
- NfgUi::Components::Elements::Step
- Defined in:
- lib/nfg_ui/components/elements/step.rb
Overview
Step doc coming soon
Constant Summary
Constants included from Traits::Step
Constants included from Traits::Active
Constants included from Traits::Remote
Constants included from Traits::NavItem
Constants included from Traits::Disable
Constants included from Traits
Traits::REGISTERED_TRAITS, Traits::TRAIT_MODULES
Instance Attribute Summary
Attributes included from Bootstrap::Utilities::Disableable
Attributes included from Bootstrap::Utilities::Wrappable
Attributes inherited from Bootstrap::Components::Base
#body, #options, #view_context
Instance Method Summary collapse
-
#active ⇒ Object
Override #active from Activatable.
- #component_family ⇒ Object
-
#disabled ⇒ Object
NOTE: DISABLED TOOLTIPS DO NOT YET WORK ON STEPS NAVITEM DOES NOT INCLUDE DISABLEABLE MODULE JR: 06-21-2019.
- #render ⇒ Object
- #step ⇒ Object
- #visited ⇒ Object
Methods included from Traits::Step
Methods included from Traits::Active
Methods included from Utilities::Iconable
Methods included from Traits::Remote
Methods included from Traits::NavItem
Methods included from Traits::Disable
Methods included from Utilities::Traitable
Methods included from Utilities::Renderable
Methods included from Utilities::Describable
Methods included from Bootstrap::Utilities::Tooltipable
#data, #disabled_component_tooltip_wrapper_html_options, #html_options, #tooltip
Methods inherited from Bootstrap::Components::NavItem
#button, #dropdown, #html_options, #include_nav_link?, #remote, #tab
Methods included from Bootstrap::Utilities::Wrappable
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
#active ⇒ Object
Override #active from Activatable
16 17 18 19 20 21 22 23 |
# File 'lib/nfg_ui/components/elements/step.rb', line 16 def active # Active is a transitory state for steps # So when a step is active, it is automatically visited. # This sets visited to true. # This is also accounted for in the #active_trait for steps. [:visited] = true if [:active] super end |
#component_family ⇒ Object
25 26 27 |
# File 'lib/nfg_ui/components/elements/step.rb', line 25 def component_family :steps end |
#disabled ⇒ Object
NOTE: DISABLED TOOLTIPS DO NOT YET WORK ON STEPS NAVITEM DOES NOT INCLUDE DISABLEABLE MODULE JR: 06-21-2019
32 33 34 |
# File 'lib/nfg_ui/components/elements/step.rb', line 32 def disabled [:disabled] || (!visited && !active) end |
#render ⇒ Object
36 37 38 39 40 |
# File 'lib/nfg_ui/components/elements/step.rb', line 36 def render content_tag(as, ) do NfgUi::Components::Elements::StepIndicator.new({ step: step.to_s, body: (block_given? ? yield : body), icon: icon, href: href, disabled: disabled }, view_context).render end end |
#step ⇒ Object
42 43 44 |
# File 'lib/nfg_ui/components/elements/step.rb', line 42 def step .fetch(:step, nil) end |
#visited ⇒ Object
46 47 48 |
# File 'lib/nfg_ui/components/elements/step.rb', line 46 def visited .fetch(:visited, false) end |