Class: UiBibz::Ui::Core::Windows::Modal
- Defined in:
- lib/ui_bibz/ui/core/windows/modal.rb
Overview
Create an modal
This element is an extend of UiBibz::Ui::Core::Component.
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:
-
size(:xl:,:lg+,:md,:sm) -
fullscreen- Boolean -
backdrop- Symbol (:static) -
scrollable- Boolean -
position- Symbol (:centered)
Signatures
UiBibz::Ui::Core::Modal.new( = nil, = nil) do |m|
m.header content, , , &block
m.body content, , , &block
m. content, , , &block
end
Examples
UiBibz::Ui::Core::Modal.new({glyph: { name: 'eye', size: 3}, { class: 'test' }) do |m|
m.header 'Title'
m.body 'Content'
m.footer do
button_link 'Ok', '#', class: :success
end
end.render
Helper
modal( = {}, = {}) do |m|
m.header do
'Title'
end
m.body do
'Content'
end
m. do
'Footer'
end
end
Constant Summary
Constants inherited from Component
Component::BREAKPOINTS, Component::SIZES, Component::STATUSES
Instance Attribute Summary
Attributes inherited from Component
#content, #html_options, #options
Attributes inherited from Base
Instance Method Summary collapse
- #body(content = nil, options = nil, html_options = nil) ⇒ Object
- #footer(content = nil, options = nil, html_options = nil) ⇒ Object
- #header(content = nil, options = nil, html_options = nil) ⇒ Object
-
#pre_render ⇒ Object
Render html tag.
Methods inherited from Component
Methods included from GlyphExtension
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
This class inherits a constructor from UiBibz::Ui::Core::Component
Instance Method Details
#body(content = nil, options = nil, html_options = nil) ⇒ Object
84 85 86 |
# File 'lib/ui_bibz/ui/core/windows/modal.rb', line 84 def body(content = nil, = nil, = nil, &) @body = UiBibz::Ui::Core::Windows::Components::ModalBody.new(content, , , &) end |
#footer(content = nil, options = nil, html_options = nil) ⇒ Object
80 81 82 |
# File 'lib/ui_bibz/ui/core/windows/modal.rb', line 80 def (content = nil, = nil, = nil, &) @footer = UiBibz::Ui::Core::Windows::Components::ModalFooter.new(content, , , &) end |
#header(content = nil, options = nil, html_options = nil) ⇒ Object
76 77 78 |
# File 'lib/ui_bibz/ui/core/windows/modal.rb', line 76 def header(content = nil, = nil, = nil, &) @header = UiBibz::Ui::Core::Windows::Components::ModalHeader.new(content, , , &) end |
#pre_render ⇒ Object
Render html tag
64 65 66 67 68 69 70 71 72 73 74 |
# File 'lib/ui_bibz/ui/core/windows/modal.rb', line 64 def pre_render content_tag :div, do content_tag :div, class: modal_dialog_classes do content_tag :div, class: 'modal-content' do concat @header&.render concat @body&.render concat @footer&.render end end end end |