Sha256: da0cf8ff2004dc5f74ae2da8f24e5f30b42f0e3153fe7bca27e1d8acb39c1510
Contents?: true
Size: 754 Bytes
Versions: 13
Compression:
Stored size: 754 Bytes
Contents
module Lookbook class Nav::Component < Lookbook::BaseComponent renders_one :filter, Lookbook::Filter::Component renders_one :toolbar, Lookbook::Toolbar::Component def initialize( collection:, id: nil, collapse_singles: false, **attrs ) @id = id.presence || "#{collection.id}-nav" @collection = collection.as_tree @item_args = { collapse_singles: collapse_singles } super(**attrs, id: id) end def items @collection.non_empty_items.map do |item| render Lookbook::Nav::Item::Component.new item, nav_id: @id, depth: 1, **@item_args end end protected def alpine_component "navComponent" end end end
Version data entries
13 entries across 13 versions & 1 rubygems