Class: NfgUi::Components::Patterns::Slats

Inherits:
Base show all
Includes:
Bootstrap::Utilities::Sizable, Traits::Size, Traits::Slats
Defined in:
lib/nfg_ui/components/patterns/slats.rb

Overview

Main slats

Constant Summary

Constants included from Traits::Slats

Traits::Slats::TRAITS

Constants included from Traits::Size

Traits::Size::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

Methods included from Traits::Slats

#nowrap_trait, #slat_actions_lg_trait, #slat_actions_none_trait, #slat_actions_sm_trait

Methods included from Traits::Size

#lg_trait, #md_trait, #sm_trait, #xl_trait

Methods included from Bootstrap::Utilities::Sizable

#size

Methods included from Utilities::Traitable

#traits, #utility_initialize

Methods included from Utilities::Renderable

#render_if, #render_unless

Methods included from Utilities::Describable

#data, #describe

Methods inherited from Bootstrap::Components::Base

#data, #href, #html_options, #id, #initialize, #render, #style

Constructor Details

This class inherits a constructor from NfgUi::Bootstrap::Components::Base

Instance Method Details

#component_familyObject



13
14
15
# File 'lib/nfg_ui/components/patterns/slats.rb', line 13

def component_family
  :slats
end

#nowrapObject

When :nowrap is true, the slat-item columns will not break into rows regardless of responsive page width

When false / not present slat item columns will break down into rows as expected in conventional responsivel webpage design.



24
25
26
# File 'lib/nfg_ui/components/patterns/slats.rb', line 24

def nowrap
  options.fetch(:nowrap, false)
end

#slat_actionsObject

Determine whether or not to accomodate a specific SlatActions size configuration by default, when slat_actions is not set it should have a nil presence

Note: ‘nil` is different from the :none keyword

Options: :sm - account for a small SlatAction (icon only) :lg - account for a large SlatAction (Text & Icon) :none - Do not account for a SlatAction

Leaving ‘nil` for slat_actions will kick off default behavior for the Slats’ SlatAction which is a combination of :lg (for large screen) and :sm for small screen (where the slat action flexes) across screen sizes hiding and showing its text



46
47
48
# File 'lib/nfg_ui/components/patterns/slats.rb', line 46

def slat_actions
  options[:slat_actions] || nil
end