Class: NfgUi::Components::Elements::StepIndicator

Inherits:
NavLink show all
Includes:
Bootstrap::Utilities::Wrappable
Defined in:
lib/nfg_ui/components/elements/step_indicator.rb

Overview

Step doc coming soon

Constant Summary

Constants included from Traits::Remote

Traits::Remote::TRAITS

Constants included from Traits::Disable

Traits::Disable::TRAITS

Constants included from Traits::Active

Traits::Active::TRAITS

Constants included from Traits

Traits::REGISTERED_TRAITS, Traits::TRAIT_MODULES

Instance Attribute Summary

Attributes included from Bootstrap::Utilities::Wrappable

#as

Attributes included from Bootstrap::Utilities::Disableable

#as

Attributes inherited from Bootstrap::Components::Base

#body, #options, #view_context

Instance Method Summary collapse

Methods included from Bootstrap::Utilities::Wrappable

#utility_initialize

Methods included from Traits::Remote

#remote_trait

Methods included from Traits::Disable

#disabled_trait

Methods included from Traits::Active

#active_trait

Methods included from Utilities::Renderable

#render_if, #render_unless

Methods included from Utilities::Methodable

#data, #method

Methods included from Utilities::Iconable

#icon

Methods included from Utilities::Describable

#data, #describe

Methods included from Utilities::Traitable

#traits, #utility_initialize

Methods included from Bootstrap::Utilities::Modalable

#data, #modal

Methods included from Bootstrap::Utilities::CollapseToggleable

#data

Methods included from Bootstrap::Utilities::Collapsible

#collapse, #collapsed, #collapsible

Methods inherited from Bootstrap::Components::NavLink

#data, #dropdown, #tab

Methods included from Bootstrap::Utilities::Remotable

#data, #remote

Methods included from Bootstrap::Utilities::Disableable

#disabled

Methods included from Bootstrap::Utilities::Activatable

#active

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_familyObject



10
11
12
# File 'lib/nfg_ui/components/elements/step_indicator.rb', line 10

def component_family
  :steps
end

#renderObject



18
19
20
21
22
23
24
25
26
27
28
29
# File 'lib/nfg_ui/components/elements/step_indicator.rb', line 18

def render
  (as, html_options) do
    concat((:div, class: 'step-indicator') {
      if icon
        NfgUi::Components::Foundations::Icon.new({ traits: [icon] }, view_context).render
      else
        step
      end
    })
    concat(NfgUi::Components::Foundations::Typeface.new({ traits: [:muted], caption: (block_given? ? yield : body), class: 'mt-1 mb-0 step-text' }, view_context).render) if (block_given? || body.present?)
  end
end

#stepObject



14
15
16
# File 'lib/nfg_ui/components/elements/step_indicator.rb', line 14

def step
  options.fetch(:step, nil)
end