Class: Voom::Presenters::DSL::Components::Dialog
- Includes:
- Mixins::Attaches, Mixins::Common, Mixins::Event, Mixins::Progress, Mixins::Sliders, Mixins::Steppers
- Defined in:
- lib/voom/presenters/dsl/components/dialog.rb
Defined Under Namespace
Classes: Actions
Instance Attribute Summary collapse
-
#buttons ⇒ Object
Returns the value of attribute buttons.
-
#components ⇒ Object
Returns the value of attribute components.
-
#percent_height ⇒ Object
Returns the value of attribute percent_height.
-
#percent_width ⇒ Object
Returns the value of attribute percent_width.
-
#px_height ⇒ Object
Returns the value of attribute px_height.
-
#px_width ⇒ Object
Returns the value of attribute px_width.
-
#shows_errors ⇒ Object
Returns the value of attribute shows_errors.
Attributes included from Mixins::Event
Attributes inherited from EventBase
Attributes inherited from Base
#attributes, #css_class, #draggable, #drop_zone, #id, #tag, #type
Instance Method Summary collapse
- #actions(**attribs, &block) ⇒ Object
- #body(*text, **options, &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::Progress
Methods included from Mixins::Event
Methods included from Mixins::Sliders
Methods included from Mixins::Steppers
Methods included from Mixins::Attaches
Methods included from Namespace
Methods included from Mixins::Common
#avatar, #badge, #card, #form, #list, #table, #unordered_list
Methods included from Mixins::Tables
Methods included from Mixins::Dialogs
Methods included from Mixins::ImageLists
Methods included from Mixins::Icons
Methods included from Mixins::Images
Methods included from Mixins::TabBars
Methods included from Mixins::Menus
Methods included from Mixins::Content
Methods included from Mixins::ExpansionPanels
Methods included from Mixins::Buttons
Methods included from Mixins::Grids
Methods included from Mixins::Typography
#blank, #body2, #caption, #headline, #headline1, #headline2, #headline3, #headline4, #headline5, #headline6, #link, #overline, #page_title, #separator, #subtitle, #subtitle2, #text
Methods included from Mixins::Append
Methods included from Mixins::Toggles
#checkbox, #icon_toggle, #radio_button, #switch
Methods inherited from Base
Methods included from Pluggable
#include_plugins, #plugin, #plugin_module
Methods included from Mixins::YieldTo
Methods included from Serializer
Methods included from Lockable
Constructor Details
#initialize(**attribs_, &block) ⇒ Dialog
Returns a new instance of Dialog.
21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/voom/presenters/dsl/components/dialog.rb', line 21 def initialize(**attribs_, &block) super(type: :dialog, **attribs_, &block) width = attribs.delete(:width) height = attribs.delete(:height) @percent_width = width&.end_with?("%") ? width : nil @percent_height = height&.end_with?("%") ? height : nil @px_width = !width&.end_with?("%") ? width : nil @px_height = !height&.end_with?("%") ? height : nil @shows_errors = attribs.delete(:shows_errors){true} @buttons = [] @components=[] end |
Instance Attribute Details
#buttons ⇒ Object
Returns the value of attribute buttons.
13 14 15 |
# File 'lib/voom/presenters/dsl/components/dialog.rb', line 13 def @buttons end |
#components ⇒ Object
Returns the value of attribute components.
13 14 15 |
# File 'lib/voom/presenters/dsl/components/dialog.rb', line 13 def components @components end |
#percent_height ⇒ Object
Returns the value of attribute percent_height.
13 14 15 |
# File 'lib/voom/presenters/dsl/components/dialog.rb', line 13 def percent_height @percent_height end |
#percent_width ⇒ Object
Returns the value of attribute percent_width.
13 14 15 |
# File 'lib/voom/presenters/dsl/components/dialog.rb', line 13 def percent_width @percent_width end |
#px_height ⇒ Object
Returns the value of attribute px_height.
13 14 15 |
# File 'lib/voom/presenters/dsl/components/dialog.rb', line 13 def px_height @px_height end |
#px_width ⇒ Object
Returns the value of attribute px_width.
13 14 15 |
# File 'lib/voom/presenters/dsl/components/dialog.rb', line 13 def px_width @px_width end |
#shows_errors ⇒ Object
Returns the value of attribute shows_errors.
13 14 15 |
# File 'lib/voom/presenters/dsl/components/dialog.rb', line 13 def shows_errors @shows_errors end |
Instance Method Details
#actions(**attribs, &block) ⇒ Object
55 56 57 58 59 |
# File 'lib/voom/presenters/dsl/components/dialog.rb', line 55 def actions(**attribs, &block) return @actions if locked? @actions = Actions.new(parent: self, **attribs, &block) end |
#body(*text, **options, &block) ⇒ Object
49 50 51 52 53 |
# File 'lib/voom/presenters/dsl/components/dialog.rb', line 49 def body(*text, **, &block) components << Components::Typography.new(parent: self, type: :body, text: text, **, &block) end |
#heading(*text, **options, &block) ⇒ Object
43 44 45 46 47 |
# File 'lib/voom/presenters/dsl/components/dialog.rb', line 43 def heading(*text, **, &block) components << Components::Typography.new(parent: self, type: :heading, text: text, **, &block) end |
#title(*title, **options, &block) ⇒ Object
36 37 38 39 40 41 |
# File 'lib/voom/presenters/dsl/components/dialog.rb', line 36 def title(*title, **, &block) return @title if locked? @title = Components::Typography.new(parent: self, type: :title, text: title, **, &block) end |