Class: TaoUi::Components::TreeComponent
- Inherits:
-
TaoOnRails::Components::Base
- Object
- TaoOnRails::Components::Base
- TaoUi::Components::TreeComponent
- Defined in:
- lib/tao_ui/components/tree_component.rb
Instance Attribute Summary collapse
-
#children_key ⇒ Object
readonly
Returns the value of attribute children_key.
-
#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.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(view, items, options = {}) ⇒ TreeComponent
constructor
A new instance of TreeComponent.
- #render(&block) ⇒ Object
Constructor Details
#initialize(view, items, options = {}) ⇒ TreeComponent
Returns a new instance of TreeComponent.
7 8 9 10 11 12 13 14 |
# File 'lib/tao_ui/components/tree_component.rb', line 7 def initialize view, items, = {} super view, @items = items @children_key = @options.delete(:children_key) @selectable = @options[:selectable] || false @remote = @options.delete(:remote) @expanded = @options.delete(:expanded) end |
Instance Attribute Details
#children_key ⇒ Object (readonly)
Returns the value of attribute children_key.
5 6 7 |
# File 'lib/tao_ui/components/tree_component.rb', line 5 def children_key @children_key end |
#expanded ⇒ Object (readonly)
Returns the value of attribute expanded.
5 6 7 |
# File 'lib/tao_ui/components/tree_component.rb', line 5 def @expanded end |
#items ⇒ Object (readonly)
Returns the value of attribute items.
5 6 7 |
# File 'lib/tao_ui/components/tree_component.rb', line 5 def items @items end |
#remote ⇒ Object (readonly)
Returns the value of attribute remote.
5 6 7 |
# File 'lib/tao_ui/components/tree_component.rb', line 5 def remote @remote end |
#selectable ⇒ Object (readonly)
Returns the value of attribute selectable.
5 6 7 |
# File 'lib/tao_ui/components/tree_component.rb', line 5 def selectable @selectable end |
Class Method Details
.component_name ⇒ Object
28 29 30 |
# File 'lib/tao_ui/components/tree_component.rb', line 28 def self.component_name :tree end |
Instance Method Details
#render(&block) ⇒ Object
16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/tao_ui/components/tree_component.rb', line 16 def render &block view.content_tag tag_name, do view.tao_tree_list items, { depth: 0, selectable: selectable, remote: remote, expanded: , children_key: children_key }, &block end end |