Class: Voom::Presenters::DSL::Components::Grid::Column
- Includes:
- Mixins::Attaches, Mixins::Avatar, Mixins::Chipset, Mixins::Common, Mixins::DateTimeFields, Mixins::Dialogs, Mixins::FileInputs, Mixins::Icons, Mixins::Padding, Mixins::Progress, Mixins::Selects, Mixins::Sliders, Mixins::Snackbars, Mixins::Steppers, Mixins::TextFields, Mixins::Toggles
- Defined in:
- lib/voom/presenters/dsl/components/grid.rb
Instance Attribute Summary collapse
-
#align ⇒ Object
readonly
Returns the value of attribute align.
-
#color ⇒ Object
readonly
Returns the value of attribute color.
-
#components ⇒ Object
readonly
Returns the value of attribute components.
-
#desktop ⇒ Object
readonly
Returns the value of attribute desktop.
-
#height ⇒ Object
readonly
Returns the value of attribute height.
-
#overflow ⇒ Object
readonly
Returns the value of attribute overflow.
-
#padding ⇒ Object
readonly
Returns the value of attribute padding.
-
#phone ⇒ Object
readonly
Returns the value of attribute phone.
-
#size ⇒ Object
readonly
Returns the value of attribute size.
-
#tablet ⇒ Object
readonly
Returns the value of attribute tablet.
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
-
#initialize(**attribs_, &block) ⇒ Column
constructor
A new instance of Column.
- #validate_alignment(align) ⇒ Object
Methods included from Mixins::Padding
#coerce_padding, #validate_padding
Methods included from Mixins::Progress
Methods included from Mixins::Avatar
Methods included from Mixins::FileInputs
Methods included from Mixins::Sliders
Methods included from Mixins::Steppers
Methods included from Mixins::Snackbars
Methods included from Mixins::Toggles
#checkbox, #icon_toggle, #radio_button, #switch
Methods included from Mixins::Append
Methods included from Mixins::Selects
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::Chipset
Methods included from Mixins::Dialogs
Methods included from Mixins::Attaches
Methods included from Namespace
Methods included from Mixins::Icons
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, #text, #title
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) ⇒ Column
Returns a new instance of Column.
83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 |
# File 'lib/voom/presenters/dsl/components/grid.rb', line 83 def initialize(**attribs_, &block) super(type: :column, **attribs_, &block) @size = attribs.delete(:size) || 1 @desktop = attribs.delete(:desktop) @tablet = attribs.delete(:tablet) @phone = attribs.delete(:phone) @color = attribs.delete(:color) @align = validate_alignment(attribs.delete(:align) {:left}) @overflow = attribs.delete(:overflow){true} @components = [] padding = attribs.delete(:padding) {nil} @padding = validate_padding(coerce_padding(padding)).uniq if padding != nil @height = attribs.delete(:height) {nil} end |
Instance Attribute Details
#align ⇒ Object (readonly)
Returns the value of attribute align.
72 73 74 |
# File 'lib/voom/presenters/dsl/components/grid.rb', line 72 def align @align end |
#color ⇒ Object (readonly)
Returns the value of attribute color.
72 73 74 |
# File 'lib/voom/presenters/dsl/components/grid.rb', line 72 def color @color end |
#components ⇒ Object (readonly)
Returns the value of attribute components.
72 73 74 |
# File 'lib/voom/presenters/dsl/components/grid.rb', line 72 def components @components end |
#desktop ⇒ Object (readonly)
Returns the value of attribute desktop.
72 73 74 |
# File 'lib/voom/presenters/dsl/components/grid.rb', line 72 def desktop @desktop end |
#height ⇒ Object (readonly)
Returns the value of attribute height.
72 73 74 |
# File 'lib/voom/presenters/dsl/components/grid.rb', line 72 def height @height end |
#overflow ⇒ Object (readonly)
Returns the value of attribute overflow.
72 73 74 |
# File 'lib/voom/presenters/dsl/components/grid.rb', line 72 def overflow @overflow end |
#padding ⇒ Object (readonly)
Returns the value of attribute padding.
72 73 74 |
# File 'lib/voom/presenters/dsl/components/grid.rb', line 72 def padding @padding end |
#phone ⇒ Object (readonly)
Returns the value of attribute phone.
72 73 74 |
# File 'lib/voom/presenters/dsl/components/grid.rb', line 72 def phone @phone end |
#size ⇒ Object (readonly)
Returns the value of attribute size.
72 73 74 |
# File 'lib/voom/presenters/dsl/components/grid.rb', line 72 def size @size end |
#tablet ⇒ Object (readonly)
Returns the value of attribute tablet.
72 73 74 |
# File 'lib/voom/presenters/dsl/components/grid.rb', line 72 def tablet @tablet end |
Instance Method Details
#validate_alignment(align) ⇒ Object
99 100 101 102 103 104 |
# File 'lib/voom/presenters/dsl/components/grid.rb', line 99 def validate_alignment(align) valid_alignment = %i(right left) raise "Invalid value for column alignment: #{align}. "\ "Valid values are #{valid_alignment.join(' ,')}." unless valid_alignment.include?(align) align end |