Class: UiBibz::Ui::Ux::Containers::Panel

Inherits:
Core::Component show all
Includes:
Concerns::HtmlConcern
Defined in:
lib/ui_bibz/ui/ux/containers/panel.rb

Overview

Create a Panel

This element is an extend of UiBibz::Ui::Core::Boxes::Card

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. You can pass arguments in options attribute:

  • store - Store generate by ‘table_search_pagination’ method

Signatures

UiBibz::Ui::Ux::Containers::Panel.new do |p|
  p.header 'header'
  p.toolbar do |t|
    t.btn_group do |bg|
      bg.button 'button'
    end
  end
  p.body 'body'
  p.footer 'footer'
end

Constant Summary

Constants inherited from Core::Component

Core::Component::BREAKPOINTS, Core::Component::SIZES, Core::Component::STATUSES

Instance Attribute Summary

Attributes inherited from Core::Component

#content, #html_options, #options

Attributes inherited from Base

#output_buffer

Instance Method Summary collapse

Methods inherited from Core::Component

#render, #tapped?

Methods included from PopoverExtension

#popover_data_html, #tooltip_data_html

Methods included from GlyphExtension

#generate_glyph, #glyph_and_content_html

Methods included from KlassExtension

#exclude_classes, #exclude_classes_in_html_options, #join_classes, #status

Methods inherited from Base

#generate_id, #i18n_set?, #inject_url

Constructor Details

#initialize(content = nil, options = nil, html_options = nil, &block) ⇒ Panel

Returns a new instance of Panel.



44
45
46
47
# File 'lib/ui_bibz/ui/ux/containers/panel.rb', line 44

def initialize(content = nil, options = nil, html_options = nil, &block)
  super
  @items = []
end

Instance Method Details

#body(content = nil, options = nil, html_options = nil, &block) ⇒ Object



73
74
75
# File 'lib/ui_bibz/ui/ux/containers/panel.rb', line 73

def body(content = nil, options = nil, html_options = nil, &block)
  @items << UiBibz::Ui::Ux::Containers::Components::PanelBody.new(content, options, html_options, &block).render
end

#column(content = nil, options = nil, html_options = nil, &block) ⇒ Object



61
62
63
# File 'lib/ui_bibz/ui/ux/containers/panel.rb', line 61

def column(content = nil, options = nil, html_options = nil, &block)
  @items << UiBibz::Ui::Ux::Containers::Components::PanelColumn.new(content, options, html_options).tap(&block).render
end

#deck(content = nil, options = nil, html_options = nil, &block) ⇒ Object



57
58
59
# File 'lib/ui_bibz/ui/ux/containers/panel.rb', line 57

def deck(content = nil, options = nil, html_options = nil, &block)
  @items << UiBibz::Ui::Ux::Containers::Components::PanelDeck.new(content, options, html_options).tap(&block).render
end

Add Header which is a component



87
88
89
90
91
92
93
# File 'lib/ui_bibz/ui/ux/containers/panel.rb', line 87

def footer(content = nil, options = nil, html_options = nil, &block)
  @footer = if tapped?(block)
              UiBibz::Ui::Ux::Containers::Components::PanelFooter.new(content, options, html_options).tap(&block).render
            else
              UiBibz::Ui::Ux::Containers::Components::PanelFooter.new(content, options, html_options, &block).render
            end
end

#group(content = nil, options = nil, html_options = nil, &block) ⇒ Object



65
66
67
# File 'lib/ui_bibz/ui/ux/containers/panel.rb', line 65

def group(content = nil, options = nil, html_options = nil, &block)
  @items << UiBibz::Ui::Ux::Containers::Components::PanelGroup.new(content, options, html_options).tap(&block).render
end

#header(content = nil, options = nil, html_options = nil, &block) ⇒ Object

Add Header which is a component



78
79
80
81
82
83
84
# File 'lib/ui_bibz/ui/ux/containers/panel.rb', line 78

def header(content = nil, options = nil, html_options = nil, &block)
  @header = if tapped?(block)
              UiBibz::Ui::Ux::Containers::Components::PanelHeader.new(content, options, html_options).tap(&block).render
            else
              UiBibz::Ui::Ux::Containers::Components::PanelHeader.new(content, options, html_options, &block).render
            end
end

#panel(content = nil, options = nil, html_options = nil, &block) ⇒ Object



69
70
71
# File 'lib/ui_bibz/ui/ux/containers/panel.rb', line 69

def panel(content = nil, options = nil, html_options = nil, &block)
  @items << UiBibz::Ui::Ux::Containers::Panel.new(content, options, html_options).tap(&block).render
end

#pre_renderObject



49
50
51
# File 'lib/ui_bibz/ui/ux/containers/panel.rb', line 49

def pre_render
   :div, html_structure, html_options
end

#toolbar(content = nil, options = nil, html_options = nil, &block) ⇒ Object



53
54
55
# File 'lib/ui_bibz/ui/ux/containers/panel.rb', line 53

def toolbar(content = nil, options = nil, html_options = nil, &block)
  @items << UiBibz::Ui::Ux::Containers::Components::PanelToolbar.new(content, options, html_options).tap(&block).render
end