Sha256: b9ee51f23051ab6a4d5fa6e159b3840bcfb680924774c9042b839158d0abeff8

Contents?: true

Size: 1.32 KB

Versions: 28

Compression:

Stored size: 1.32 KB

Contents

module UiBibz::Ui::Core::Forms::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::Forms::DropdownHeader.new(content, options = nil, html_options = nil)
  #
  #   UiBibz::Ui::Core::Forms::DropdownHeader.new(options = nil, html_options = nil) do
  #     content
  #   end
  #
  # ==== Examples
  #
  #   UiBibz::Ui::Core::Forms::DropdownHeader.new('Home',{ class: 'test' }).render
  #
  #   UiBibz::Ui::Core::Forms::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 pre_render
      content_tag :h6, glyph_and_content_html, html_options
    end

  private

    def component_html_classes
      'dropdown-header'
    end

    def component_html_options
      { role: 'presentation' }
    end

  end
end

Version data entries

28 entries across 28 versions & 1 rubygems

Version Path
ui_bibz-2.4.0 lib/ui_bibz/ui/core/forms/dropdowns/components/dropdown_header.rb
ui_bibz-2.3.15 lib/ui_bibz/ui/core/forms/dropdowns/components/dropdown_header.rb
ui_bibz-2.3.14 lib/ui_bibz/ui/core/forms/dropdowns/components/dropdown_header.rb
ui_bibz-2.3.13 lib/ui_bibz/ui/core/forms/dropdowns/components/dropdown_header.rb
ui_bibz-2.3.12 lib/ui_bibz/ui/core/forms/dropdowns/components/dropdown_header.rb
ui_bibz-2.3.11 lib/ui_bibz/ui/core/forms/dropdowns/components/dropdown_header.rb
ui_bibz-2.3.10 lib/ui_bibz/ui/core/forms/dropdowns/components/dropdown_header.rb
ui_bibz-2.3.9 lib/ui_bibz/ui/core/forms/dropdowns/components/dropdown_header.rb
ui_bibz-2.3.8 lib/ui_bibz/ui/core/forms/dropdowns/components/dropdown_header.rb
ui_bibz-2.3.7 lib/ui_bibz/ui/core/forms/dropdowns/components/dropdown_header.rb
ui_bibz-2.3.6 lib/ui_bibz/ui/core/forms/dropdowns/components/dropdown_header.rb
ui_bibz-2.3.5 lib/ui_bibz/ui/core/forms/dropdowns/components/dropdown_header.rb
ui_bibz-2.3.4 lib/ui_bibz/ui/core/forms/dropdowns/components/dropdown_header.rb
ui_bibz-2.3.3 lib/ui_bibz/ui/core/forms/dropdowns/components/dropdown_header.rb
ui_bibz-2.3.2 lib/ui_bibz/ui/core/forms/dropdowns/components/dropdown_header.rb
ui_bibz-2.3.1 lib/ui_bibz/ui/core/forms/dropdowns/components/dropdown_header.rb
ui_bibz-2.3.0 lib/ui_bibz/ui/core/forms/dropdowns/components/dropdown_header.rb
ui_bibz-2.2.2 lib/ui_bibz/ui/core/forms/dropdowns/components/dropdown_header.rb
ui_bibz-2.2.1 lib/ui_bibz/ui/core/forms/dropdowns/components/dropdown_header.rb
ui_bibz-2.2.0 lib/ui_bibz/ui/core/forms/dropdowns/components/dropdown_header.rb