Class: TaoUi::Components::Tree::ListComponent
- Inherits:
-
TaoOnRails::Components::Base
- Object
- TaoOnRails::Components::Base
- TaoUi::Components::Tree::ListComponent
- Defined in:
- lib/tao_ui/components/tree/list_component.rb
Instance Attribute Summary collapse
-
#children_key ⇒ Object
readonly
Returns the value of attribute children_key.
-
#depth ⇒ Object
readonly
Returns the value of attribute depth.
-
#expanded ⇒ Object
readonly
Returns the value of attribute expanded.
-
#items ⇒ Object
readonly
Returns the value of attribute items.
-
#remote ⇒ Object
readonly
Returns the value of attribute remote.
-
#selectable ⇒ Object
readonly
Returns the value of attribute selectable.
-
#selected ⇒ Object
readonly
Returns the value of attribute selected.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(view, items, options = {}) ⇒ ListComponent
constructor
A new instance of ListComponent.
- #render(&block) ⇒ Object
Constructor Details
#initialize(view, items, options = {}) ⇒ ListComponent
Returns a new instance of ListComponent.
9 10 11 12 13 14 15 16 17 18 |
# File 'lib/tao_ui/components/tree/list_component.rb', line 9 def initialize view, items, = {} super view, @items = items @children_key = .delete(:children_key) @selectable = .delete(:selectable) @selected = .delete(:selected) @remote = .delete(:remote) = .delete(:expanded) @depth = .delete(:depth) end |
Instance Attribute Details
#children_key ⇒ Object (readonly)
Returns the value of attribute children_key.
6 7 8 |
# File 'lib/tao_ui/components/tree/list_component.rb', line 6 def children_key @children_key end |
#depth ⇒ Object (readonly)
Returns the value of attribute depth.
6 7 8 |
# File 'lib/tao_ui/components/tree/list_component.rb', line 6 def depth @depth end |
#expanded ⇒ Object (readonly)
Returns the value of attribute expanded.
6 7 8 |
# File 'lib/tao_ui/components/tree/list_component.rb', line 6 def end |
#items ⇒ Object (readonly)
Returns the value of attribute items.
6 7 8 |
# File 'lib/tao_ui/components/tree/list_component.rb', line 6 def items @items end |
#remote ⇒ Object (readonly)
Returns the value of attribute remote.
6 7 8 |
# File 'lib/tao_ui/components/tree/list_component.rb', line 6 def remote @remote end |
#selectable ⇒ Object (readonly)
Returns the value of attribute selectable.
6 7 8 |
# File 'lib/tao_ui/components/tree/list_component.rb', line 6 def selectable @selectable end |
#selected ⇒ Object (readonly)
Returns the value of attribute selected.
6 7 8 |
# File 'lib/tao_ui/components/tree/list_component.rb', line 6 def selected @selected end |
Class Method Details
.component_name ⇒ Object
37 38 39 |
# File 'lib/tao_ui/components/tree/list_component.rb', line 37 def self.component_name :tree_list end |
Instance Method Details
#render(&block) ⇒ Object
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/tao_ui/components/tree/list_component.rb', line 20 def render &block view.content_tag 'div', 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: }, &block end end end end |