Sha256: eb3014314b8ac0150de7ce4bed1b42c11dc4ebfb9d6c6e16a1730895fcb2fb28
Contents?: true
Size: 622 Bytes
Versions: 38
Compression:
Stored size: 622 Bytes
Contents
module Lookbook class Nav::Component < Lookbook::BaseComponent renders_one :filter, Lookbook::Filter::Component renders_one :toolbar, Lookbook::Toolbar::Component attr_reader :id, :tree def initialize(tree:, id: nil, **attrs) @id = id @tree = tree super(**attrs, id: id) end def items @items ||= tree.map do |node| item_class = (node.type == :directory) ? Nav::Directory::Component : Nav::Entity::Component lookbook_render item_class.new node, nav_id: id end end protected def alpine_component "navComponent" end end end
Version data entries
38 entries across 38 versions & 1 rubygems