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
Attributes inherited from EventBase
Attributes included from Mixins::Event
Attributes inherited from Base
#attributes, #context, #id, #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
#badge, #card, #form, #list, #table
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
#body, #display, #headline, #subheading, #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 Serializer
Methods included from Lockable
Constructor Details
#initialize(**attribs_, &block) ⇒ ExpansionPanel
Returns a new instance of ExpansionPanel.
8 9 10 11 12 13 |
# File 'lib/voom/presenters/dsl/components/expansion_panel.rb', line 8 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) end |
Instance Method Details
#content(**attribs, &block) ⇒ Object
25 26 27 28 |
# File 'lib/voom/presenters/dsl/components/expansion_panel.rb', line 25 def content(**attribs, &block) return @content if locked? @content = Content.new(parent: self, context: context, **attribs, &block) end |
#secondary_text(*text, **attribs, &block) ⇒ Object
20 21 22 23 |
# File 'lib/voom/presenters/dsl/components/expansion_panel.rb', line 20 def secondary_text(*text, **attribs, &block) return @secondary_text if locked? @secondary_text = Components::Typography.new(parent: self, type: :text, text: text, context: context, **attribs, &block) end |
#text(*text, **attribs, &block) ⇒ Object
15 16 17 18 |
# File 'lib/voom/presenters/dsl/components/expansion_panel.rb', line 15 def text(*text, **attribs, &block) return @text if locked? @text = Components::Typography.new(parent: self, type: :text, text: text, context: context, **attribs, &block) end |