Sha256: 6ca7f4a08e3092c8acab19640aab64706823754a6ccbb77af7a52b7f429e7128
Contents?: true
Size: 1.23 KB
Versions: 12
Compression:
Stored size: 1.23 KB
Contents
module Coprl module Presenters module DSL module Components class Drawer < Base include Mixins::Common include Mixins::Attaches attr_accessor :title, :subtitle, :components def initialize(**attribs_, &block) super(type: :drawer, **attribs_, &block) self.title(attribs.delete(:title)) if attribs.fetch(:title){nil} @components = [] expand! end def menu(**attribs, &block) return @menu if locked? @menu = Menu.new(parent: self, **attribs, &block) end def attach(presenter, **params, &block) pom = super @menu = pom.components.select {|i| i.type == :menu}.first end def title(*text, **attribs, &block) return @title if locked? @title = Components::Typography.new(parent: self, type: :text, text: text, **attribs, &block) end def subtitle(*text, **attribs, &block) return @subtitle if locked? @subtitle = Components::Typography.new(parent: self, type: :text, text: text, **attribs, &block) end end end end end end
Version data entries
12 entries across 12 versions & 1 rubygems