Sha256: 60e858c2a14f3581964c7c3d256bbac80293add2300d0ee8b9947491ca063a6a
Contents?: true
Size: 1.35 KB
Versions: 7
Compression:
Stored size: 1.35 KB
Contents
module TaoUi module Components module Tree class ListComponent < TaoOnRails::Components::Base attr_reader :items, :selectable, :depth, :remote, :expanded, :children_key, :selected def initialize view, items, options = {} super view, options @items = items @children_key = @options.delete(:children_key) @selectable = @options.delete(:selectable) @selected = @options.delete(:selected) @remote = @options.delete(:remote) @expanded = @options.delete(:expanded) @depth = @options.delete(:depth) end def render &block view.content_tag 'div', html_options do if items && items.size > 0 items.each do |item| view.concat view.tao_tree_item item, { children_key: children_key, selectable: selectable, selected: selected, depth: depth, remote: remote, expanded: expanded }, &block end end end end def self.component_name :tree_list end private def default_options {class: 'tao-tree-list', children_key: :children, depth: 0} end end end end end
Version data entries
7 entries across 7 versions & 1 rubygems