Sha256: 0d0fb18fd225d0c08503ed73ccded96af5c43a274afb134c79fa936121194e2c

Contents?: true

Size: 1.27 KB

Versions: 13

Compression:

Stored size: 1.27 KB

Contents

module UiBibz::Ui::Core::Dropdowns::Components

  # 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 < UiBibz::Ui::Core::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

13 entries across 13 versions & 1 rubygems

Version Path
ui_bibz-2.0.0.beta2.5 lib/ui_bibz/ui/core/dropdowns/components/dropdown_header.rb
ui_bibz-2.0.0.beta2.4 lib/ui_bibz/ui/core/dropdowns/components/dropdown_header.rb
ui_bibz-2.0.0.beta2.3 lib/ui_bibz/ui/core/dropdowns/components/dropdown_header.rb
ui_bibz-2.0.0.beta2.2 lib/ui_bibz/ui/core/dropdowns/components/dropdown_header.rb
ui_bibz-2.0.0.beta2.1 lib/ui_bibz/ui/core/dropdowns/components/dropdown_header.rb
ui_bibz-2.0.0.beta2 lib/ui_bibz/ui/core/dropdowns/components/dropdown_header.rb
ui_bibz-2.0.0.alpha32 lib/ui_bibz/ui/core/dropdowns/components/dropdown_header.rb
ui_bibz-2.0.0.alpha31 lib/ui_bibz/ui/core/dropdowns/components/dropdown_header.rb
ui_bibz-2.0.0.alpha30 lib/ui_bibz/ui/core/dropdowns/components/dropdown_header.rb
ui_bibz-2.0.0.alpha29 lib/ui_bibz/ui/core/dropdowns/components/dropdown_header.rb
ui_bibz-2.0.0.alpha28 lib/ui_bibz/ui/core/dropdowns/components/dropdown_header.rb
ui_bibz-2.0.0.alpha27 lib/ui_bibz/ui/core/dropdowns/components/dropdown_header.rb
ui_bibz-2.0.0.alpha26 lib/ui_bibz/ui/core/dropdowns/components/dropdown_header.rb