Class: Voom::Presenters::DSL::Components::Card
- Includes:
- Mixins::Attaches, Mixins::Chipset, Mixins::Common, Mixins::DateTimeFields, Mixins::Dialogs, Mixins::FileInputs, Mixins::Icons, Mixins::Padding, Mixins::Progress, Mixins::Selects, Mixins::Snackbars, Mixins::TextFields
- Defined in:
- lib/voom/presenters/dsl/components/card.rb
Defined Under Namespace
Instance Attribute Summary collapse
-
#background_color ⇒ Object
readonly
Returns the value of attribute background_color.
-
#components ⇒ Object
readonly
Returns the value of attribute components.
-
#height ⇒ Object
readonly
Returns the value of attribute height.
-
#hidden ⇒ Object
readonly
Returns the value of attribute hidden.
-
#padding ⇒ Object
readonly
Returns the value of attribute padding.
-
#selected ⇒ Object
readonly
Returns the value of attribute selected.
-
#shows_errors ⇒ Object
readonly
Returns the value of attribute shows_errors.
-
#width ⇒ Object
readonly
Returns the value of attribute width.
Attributes inherited from EventBase
Attributes included from Mixins::Event
Attributes inherited from Base
#attributes, #css_class, #draggable, #drop_zone, #id, #tag, #type
Instance Method Summary collapse
- #actions(**attribs, &block) ⇒ Object
-
#initialize(**attribs_, &block) ⇒ Card
constructor
A new instance of Card.
- #media(**attribs, &block) ⇒ Object
- #text(*text, **attribs, &block) ⇒ Object
Methods included from Mixins::Padding
#coerce_padding, #validate_padding
Methods included from Mixins::Progress
Methods included from Mixins::Dialogs
Methods included from Mixins::FileInputs
Methods included from Mixins::Chipset
Methods included from Mixins::Append
Methods included from Mixins::Snackbars
Methods included from Mixins::Selects
Methods included from Mixins::Icons
Methods included from Mixins::DateTimeFields
#date_field, #datetime_field, #time_field
Methods included from Mixins::TextFields
#hidden_field, #number_field, #rich_text_area, #text_area, #text_field
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::ImageLists
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, #body, #body2, #caption, #headline, #headline1, #headline2, #headline3, #headline4, #headline5, #headline6, #link, #overline, #page_title, #separator, #subtitle, #subtitle2, #title
Methods included from Mixins::Toggles
#checkbox, #icon_toggle, #radio_button, #switch
Methods included from Mixins::Event
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) ⇒ Card
Returns a new instance of Card.
27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 |
# File 'lib/voom/presenters/dsl/components/card.rb', line 27 def initialize(**attribs_, &block) super(type: :card, **attribs_, &block) @height = attribs.delete(:height) @width = attribs.delete(:width) @selected = attribs.delete(:selected) {false} self.text(attribs.delete(:text)) if attribs.key?(:text) @shows_errors = attribs.delete(:shows_errors) {true} padding = attribs.delete(:padding) {:all} @padding = validate_padding(coerce_padding(padding)).uniq if padding != nil @hidden = attribs.delete(:hidden){false} @background_color = attribs.delete(:background_color) @components = [] end |
Instance Attribute Details
#background_color ⇒ Object (readonly)
Returns the value of attribute background_color.
18 19 20 |
# File 'lib/voom/presenters/dsl/components/card.rb', line 18 def background_color @background_color end |
#components ⇒ Object (readonly)
Returns the value of attribute components.
18 19 20 |
# File 'lib/voom/presenters/dsl/components/card.rb', line 18 def components @components end |
#height ⇒ Object (readonly)
Returns the value of attribute height.
18 19 20 |
# File 'lib/voom/presenters/dsl/components/card.rb', line 18 def height @height end |
#hidden ⇒ Object (readonly)
Returns the value of attribute hidden.
18 19 20 |
# File 'lib/voom/presenters/dsl/components/card.rb', line 18 def hidden @hidden end |
#padding ⇒ Object (readonly)
Returns the value of attribute padding.
18 19 20 |
# File 'lib/voom/presenters/dsl/components/card.rb', line 18 def padding @padding end |
#selected ⇒ Object (readonly)
Returns the value of attribute selected.
18 19 20 |
# File 'lib/voom/presenters/dsl/components/card.rb', line 18 def selected @selected end |
#shows_errors ⇒ Object (readonly)
Returns the value of attribute shows_errors.
18 19 20 |
# File 'lib/voom/presenters/dsl/components/card.rb', line 18 def shows_errors @shows_errors end |
#width ⇒ Object (readonly)
Returns the value of attribute width.
18 19 20 |
# File 'lib/voom/presenters/dsl/components/card.rb', line 18 def width @width end |
Instance Method Details
#actions(**attribs, &block) ⇒ Object
101 102 103 104 105 |
# File 'lib/voom/presenters/dsl/components/card.rb', line 101 def actions(**attribs, &block) return @actions if locked? @actions = Actions.new(parent: self, **attribs, &block) end |
#media(**attribs, &block) ⇒ Object
43 44 45 46 47 |
# File 'lib/voom/presenters/dsl/components/card.rb', line 43 def media(**attribs, &block) return @media if locked? @media = Media.new(parent: self, **attribs, &block) end |
#text(*text, **attribs, &block) ⇒ Object
96 97 98 99 |
# File 'lib/voom/presenters/dsl/components/card.rb', line 96 def text(*text, **attribs, &block) self << Typography.new(type: :body, parent: self, text: text, **attribs, &block) end |