Sha256: f449504672c44702a9f4b73405a128316dab43983ee6a76d53ad816ba6b92e65

Contents?: true

Size: 1.23 KB

Versions: 23

Compression:

Stored size: 1.23 KB

Contents

module UiBibz::Ui::Core

  # Create DropdownHeader
  #
  # This element is an extend of UiBibz::Ui::Core::Component.
  # Use '---' in content to add a separator
  #
  # ==== Attributes
  #
  # * +content+ - Content of element
  # * +options+ - Options of element
  # * +html_options+ - Html Options of element
  #
  # ==== Options
  #
  # You can add HTML attributes using the +html_options+.
  #
  # ==== Signatures
  #
  #   UiBibz::Ui::Core::DropdownHeader.new(content, options = nil, html_options = nil)
  #
  #   UiBibz::Ui::Core::DropdownHeader.new(options = nil, html_options = nil) do
  #     content
  #   end
  #
  # ==== Examples
  #
  #   UiBibz::Ui::Core::DropdownHeader.new('Home',{ class: 'test' }).render
  #
  #   UiBibz::Ui::Core::DropdownHeader.new({ class: 'test' }) do
  #     'Home'
  #   end.render
  #
  class DropdownHeader < Component

    # See UiBibz::Ui::Core::Component.initialize
    def initialize content = nil, options = nil, html_options = nil, &block
      super
    end

    # Render html tag
    def render
      content_tag :h6, content, html_options
    end

  private

    def component_html_classes
      'dropdown-header'
    end

    def component_html_options
      { role: 'presentation' }
    end

  end
end

Version data entries

23 entries across 23 versions & 1 rubygems

Version Path
ui_bibz-2.0.0.alpha24 lib/ui_bibz/ui/core/dropdown/components/dropdown_header.rb
ui_bibz-2.0.0.alpha23 lib/ui_bibz/ui/core/dropdown/components/dropdown_header.rb
ui_bibz-2.0.0.alpha22 lib/ui_bibz/ui/core/dropdown/components/dropdown_header.rb
ui_bibz-2.0.0.alpha21 lib/ui_bibz/ui/core/dropdown/components/dropdown_header.rb
ui_bibz-2.0.0.alpha20 lib/ui_bibz/ui/core/dropdown/components/dropdown_header.rb
ui_bibz-2.0.0.alpha19 lib/ui_bibz/ui/core/dropdown/components/dropdown_header.rb
ui_bibz-2.0.0.alpha18 lib/ui_bibz/ui/core/dropdown/components/dropdown_header.rb
ui_bibz-2.0.0.alpha16 lib/ui_bibz/ui/core/dropdown/components/dropdown_header.rb
ui_bibz-2.0.0.alpha15 lib/ui_bibz/ui/core/dropdown/components/dropdown_header.rb
ui_bibz-2.0.0.alpha14 lib/ui_bibz/ui/core/dropdown/components/dropdown_header.rb
ui_bibz-2.0.0.alpha13 lib/ui_bibz/ui/core/dropdown/components/dropdown_header.rb
ui_bibz-2.0.0.alpha12 lib/ui_bibz/ui/core/dropdown/components/dropdown_header.rb
ui_bibz-2.0.0.alpha11 lib/ui_bibz/ui/core/dropdown/components/dropdown_header.rb
ui_bibz-2.0.0.alpha10 lib/ui_bibz/ui/core/dropdown/components/dropdown_header.rb
ui_bibz-2.0.0.alpha9 lib/ui_bibz/ui/core/dropdown/components/dropdown_header.rb
ui_bibz-2.0.0.alpha8 lib/ui_bibz/ui/core/dropdown/components/dropdown_header.rb
ui_bibz-2.0.0.alpha7 lib/ui_bibz/ui/core/dropdown/components/dropdown_header.rb
ui_bibz-2.0.0.alpha6 lib/ui_bibz/ui/core/dropdown/components/dropdown_header.rb
ui_bibz-2.0.0.alpha5 lib/ui_bibz/ui/core/dropdown/components/dropdown_header.rb
ui_bibz-2.0.0.alpha4 lib/ui_bibz/ui/core/dropdown/components/dropdown_header.rb