Class: NfgUi::Components::Patterns::Carousel
- Inherits:
-
Bootstrap::Components::Carousel
- Object
- Bootstrap::Components::Base
- Bootstrap::Components::Carousel
- NfgUi::Components::Patterns::Carousel
- Defined in:
- lib/nfg_ui/components/patterns/carousel.rb
Overview
Carousel doesn’t have any customizations unique to the design system yet As such, the NFG UI carousel is simply a bootstrap carousel behind the scenes. Traits will eventually be connected here.
Constant Summary
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 Utilities::Renderable
Methods included from Utilities::Describable
Methods included from Utilities::Traitable
Methods inherited from Bootstrap::Components::Carousel
#auto, #component_family, #controls, #data, #indicators
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
#non_html_attribute_options ⇒ Object
31 32 33 |
# File 'lib/nfg_ui/components/patterns/carousel.rb', line 31 def super.push(:auto) end |
#render ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/nfg_ui/components/patterns/carousel.rb', line 14 def render content_tag(:div, ) do concat( content_tag(:div, class: 'carousel-inner') do concat((block_given? ? yield : body)) end ) if controls concat(NfgUi::Components::Elements::CarouselControl.new({ control: :next, carousel: "##{id}" }, view_context).render) concat(NfgUi::Components::Elements::CarouselControl.new({ control: :prev, carousel: "##{id}" }, view_context).render) end if indicators > 0 concat(NfgUi::Components::Elements::CarouselIndicators.new({ count: indicators, carousel: "##{id}" }, view_context).render) end end end |