Class: Voom::Presenters::DSL::Components::Dialog
- Includes:
- Mixins::Common
- Defined in:
- lib/voom/presenters/dsl/components/dialog.rb
Instance Attribute Summary collapse
-
#buttons ⇒ Object
Returns the value of attribute buttons.
-
#components ⇒ Object
Returns the value of attribute components.
-
#height ⇒ Object
Returns the value of attribute height.
-
#shows_errors ⇒ Object
Returns the value of attribute shows_errors.
-
#width ⇒ Object
Returns the value of attribute width.
Attributes inherited from Base
#attributes, #context, #id, #type
Instance Method Summary collapse
- #body(*text, **options, &block) ⇒ Object
- #button(text = nil, **attribs, &block) ⇒ Object
- #heading(*text, **options, &block) ⇒ Object
-
#initialize(**attribs_, &block) ⇒ Dialog
constructor
A new instance of Dialog.
- #title(*title, **options, &block) ⇒ Object
Methods included from Mixins::Common
#badge, #card, #form, #list, #table
Methods included from Mixins::Menus
Methods included from Mixins::Content
Methods included from Mixins::ExpansionPanels
Methods included from Mixins::Grids
Methods included from Mixins::Typography
#display, #headline, #subheading
Methods included from Mixins::Append
Methods included from Mixins::Toggles
#checkbox, #icon_toggle, #radio_button, #switch
Methods inherited from Base
Methods included from Serializer
Methods included from Lockable
Constructor Details
#initialize(**attribs_, &block) ⇒ Dialog
Returns a new instance of Dialog.
11 12 13 14 15 16 17 18 19 20 |
# File 'lib/voom/presenters/dsl/components/dialog.rb', line 11 def initialize(**attribs_, &block) super(type: :dialog, **attribs_, &block) @width = attribs.delete(:width) @height = attribs.delete(:height) @shows_errors = attribs.delete(:shows_errors){true} = [] @components=[] end |
Instance Attribute Details
#buttons ⇒ Object
Returns the value of attribute buttons.
9 10 11 |
# File 'lib/voom/presenters/dsl/components/dialog.rb', line 9 def end |
#components ⇒ Object
Returns the value of attribute components.
9 10 11 |
# File 'lib/voom/presenters/dsl/components/dialog.rb', line 9 def components @components end |
#height ⇒ Object
Returns the value of attribute height.
9 10 11 |
# File 'lib/voom/presenters/dsl/components/dialog.rb', line 9 def height @height end |
#shows_errors ⇒ Object
Returns the value of attribute shows_errors.
9 10 11 |
# File 'lib/voom/presenters/dsl/components/dialog.rb', line 9 def shows_errors @shows_errors end |
#width ⇒ Object
Returns the value of attribute width.
9 10 11 |
# File 'lib/voom/presenters/dsl/components/dialog.rb', line 9 def width @width end |
Instance Method Details
#body(*text, **options, &block) ⇒ Object
35 36 37 38 39 |
# File 'lib/voom/presenters/dsl/components/dialog.rb', line 35 def body(*text, **, &block) components << Components::Typography.new(parent: self, type: :body, text: text, context: context, **, &block) end |
#button(text = nil, **attribs, &block) ⇒ Object
41 42 43 44 45 |
# File 'lib/voom/presenters/dsl/components/dialog.rb', line 41 def (text=nil, **attribs, &block) << Button.new(parent: self, text: text, context: context, **attribs, &block) end |
#heading(*text, **options, &block) ⇒ Object
29 30 31 32 33 |
# File 'lib/voom/presenters/dsl/components/dialog.rb', line 29 def heading(*text, **, &block) components << Components::Typography.new(parent: self, type: :heading, text: text, context: context, **, &block) end |
#title(*title, **options, &block) ⇒ Object
22 23 24 25 26 27 |
# File 'lib/voom/presenters/dsl/components/dialog.rb', line 22 def title(*title, **, &block) return @title if locked? @title = Components::Typography.new(parent: self, type: :title, text: title, context: context, **, &block) end |