Sha256: 0a6cab38b1e68bdfda34a1c7c14db658217bd1a43f7f7521619c1c460a4c4b62

Contents?: true

Size: 414 Bytes

Versions: 48

Compression:

Stored size: 414 Bytes

Contents

module Lookbook
  class PageTabs::Component < Lookbook::BaseComponent
    renders_many :tabs, ->(**attrs, &block) do
      @tabs ||= []
      attrs[:tab_content] = capture(&block)
      attrs[:markdown] ||= @markdown
      @tabs << attrs
    end

    def initialize(markdown: true, **html_attrs)
      @markdown = markdown
      super(**html_attrs)
    end

    def before_render
      tabs.size
    end
  end
end

Version data entries

48 entries across 48 versions & 1 rubygems

Version Path
lookbook-2.3.4 app/components/lookbook/page_tabs/component.rb
lookbook-2.3.3 app/components/lookbook/page_tabs/component.rb
lookbook-2.3.2 app/components/lookbook/page_tabs/component.rb
lookbook-2.3.0 app/components/lookbook/page_tabs/component.rb
lookbook-2.2.2 app/components/lookbook/page_tabs/component.rb
lookbook-2.2.1 app/components/lookbook/page_tabs/component.rb
lookbook-2.2.0 app/components/lookbook/page_tabs/component.rb
lookbook-2.1.1 app/components/lookbook/page_tabs/component.rb
lookbook-2.1.0 app/components/lookbook/page_tabs/component.rb
lookbook-2.0.5 app/components/lookbook/page_tabs/component.rb
lookbook-2.0.4 app/components/lookbook/page_tabs/component.rb
lookbook-2.0.3 app/components/lookbook/page_tabs/component.rb
lookbook-2.0.2 app/components/lookbook/page_tabs/component.rb
lookbook-2.0.1 app/components/lookbook/page_tabs/component.rb
lookbook-2.0.0 app/components/lookbook/page_tabs/component.rb
lookbook-2.0.0.rc.3 app/components/lookbook/page_tabs/component.rb
lookbook-1.5.5 app/components/lookbook/page_tabs/component.rb
lookbook-1.5.4 app/components/lookbook/page_tabs/component.rb
lookbook-2.0.0.rc.2 app/components/lookbook/page_tabs/component.rb
lookbook-2.0.0.rc.1 app/components/lookbook/page_tabs/component.rb