Class: Voom::Presenters::DSL::Components::ExpansionPanel
- Includes:
- Mixins::Common
- Defined in:
- lib/voom/presenters/dsl/components/expansion_panel.rb
Defined Under Namespace
Classes: Content
Instance Attribute Summary collapse
-
#open ⇒ Object
Returns the value of attribute open.
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
- #content(**attribs, &block) ⇒ Object
-
#initialize(**attribs_, &block) ⇒ ExpansionPanel
constructor
A new instance of ExpansionPanel.
- #secondary_text(*text, **attribs, &block) ⇒ Object
- #text(*text, **attribs, &block) ⇒ Object
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::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::Append
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) ⇒ ExpansionPanel
Returns a new instance of ExpansionPanel.
10 11 12 13 14 15 16 |
# File 'lib/voom/presenters/dsl/components/expansion_panel.rb', line 10 def initialize(**attribs_, &block) super(type: :expansion_panel, **attribs_, &block) self.text(attribs.delete(:text)) if attribs.key?(:text) self.secondary_text(attribs.delete(:secondary_text)) if attribs.key?(:secondary_text) @open = attribs.delete(:open) { false } end |
Instance Attribute Details
#open ⇒ Object
Returns the value of attribute open.
8 9 10 |
# File 'lib/voom/presenters/dsl/components/expansion_panel.rb', line 8 def open @open end |
Instance Method Details
#content(**attribs, &block) ⇒ Object
28 29 30 31 |
# File 'lib/voom/presenters/dsl/components/expansion_panel.rb', line 28 def content(**attribs, &block) return @content if locked? @content = Content.new(parent: self, **attribs, &block) end |
#secondary_text(*text, **attribs, &block) ⇒ Object
23 24 25 26 |
# File 'lib/voom/presenters/dsl/components/expansion_panel.rb', line 23 def secondary_text(*text, **attribs, &block) return @secondary_text if locked? @secondary_text = Components::Typography.new(parent: self, type: :text, text: text, **attribs, &block) end |
#text(*text, **attribs, &block) ⇒ Object
18 19 20 21 |
# File 'lib/voom/presenters/dsl/components/expansion_panel.rb', line 18 def text(*text, **attribs, &block) return @text if locked? @text = Components::Typography.new(parent: self, type: :text, text: text, **attribs, &block) end |