Class: NfgUi::Components::Elements::Table

Overview

Table doc coming soon

Constant Summary

Constants included from Traits::Table

Traits::Table::TRAITS

Constants included from Traits::Size

Traits::Size::TRAITS

Constants included from Traits::Responsive

Traits::Responsive::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::Table

#bordered_trait, #striped_trait

Methods included from Traits::Size

#lg_trait, #md_trait, #sm_trait, #xl_trait

Methods included from Traits::Responsive

#responsive_trait

Methods included from Utilities::Renderable

#render_if, #render_unless

Methods included from Utilities::Describable

#data, #describe

Methods included from Utilities::Traitable

#traits, #utility_initialize

Methods inherited from Bootstrap::Components::Table

#bordered, #size, #striped

Methods included from Bootstrap::Utilities::Sizable

#size

Methods included from Bootstrap::Utilities::Responsiveable

#responsive

Methods inherited from Bootstrap::Components::Base

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

Constructor Details

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

Instance Method Details

#captionObject



16
17
18
# File 'lib/nfg_ui/components/elements/table.rb', line 16

def caption
  options.fetch(:caption, default_caption)
end

#renderObject



20
21
22
23
24
25
26
27
28
29
30
31
32
# File 'lib/nfg_ui/components/elements/table.rb', line 20

def render
  # We manually embed this caption as a typeface component
  # as part of the design pattern.
  if caption.present?
    capture do
      concat(NfgUi::Components::Foundations::Typeface.new({caption: caption.to_s, class: 'mb-1 text-right', traits: [:muted]}, view_context).render)

      concat(super)
    end
  else
    super
  end
end