Class: Primer::Alpha::TreeView::SubTree
- Defined in:
- app/components/primer/alpha/tree_view/sub_tree.rb
Overview
A ‘TreeView` sub-tree.
This component is part of the <%= link_to_component(Primer::Alpha::TreeView) %> component and should not be used directly.
Constant Summary
Constants inherited from Component
Component::INVALID_ARIA_LABEL_TAGS
Constants included from Status::Dsl
Constants included from ViewHelper
Constants included from TestSelectorHelper
TestSelectorHelper::TEST_SELECTOR_TAG
Constants included from FetchOrFallbackHelper
FetchOrFallbackHelper::InvalidValueError
Constants included from Primer::AttributesHelper
Primer::AttributesHelper::PLURAL_ARIA_ATTRIBUTES, Primer::AttributesHelper::PLURAL_DATA_ATTRIBUTES
Instance Attribute Summary collapse
-
#node_variant ⇒ Object
readonly
Returns the value of attribute node_variant.
Instance Method Summary collapse
- #defer? ⇒ Boolean
-
#initialize(node_variant:, **system_arguments) ⇒ SubTree
constructor
A new instance of SubTree.
-
#with_leaf(**system_arguments, &block) ⇒ Object
Adds an leaf node to the tree.
-
#with_loading_spinner(**system_arguments, &block) ⇒ Object
Adds a loader to this sub-tree that displays a skeleton animation while nodes are fetched from the server.
-
#with_sub_tree(**system_arguments, &block) ⇒ Object
Adds a sub-tree node to the tree.
Methods inherited from Component
Methods included from JoinStyleArgumentsHelper
Methods included from TestSelectorHelper
Methods included from FetchOrFallbackHelper
#fetch_or_fallback, #fetch_or_fallback_boolean, #silence_deprecations?
Methods included from ClassNameHelper
Methods included from Primer::AttributesHelper
#aria, #data, #extract_data, #merge_aria, #merge_data, #merge_prefixed_attribute_hashes
Methods included from ExperimentalSlotHelpers
Methods included from ExperimentalRenderHelpers
Constructor Details
#initialize(node_variant:, **system_arguments) ⇒ SubTree
Returns a new instance of SubTree.
96 97 98 99 100 101 102 103 104 105 |
# File 'app/components/primer/alpha/tree_view/sub_tree.rb', line 96 def initialize(node_variant:, **system_arguments) @node_variant = node_variant system_arguments[:data] = merge_data( system_arguments, { data: { target: "tree-view-sub-tree-node.subTree" } } ) @container = SubTreeContainer.new(**system_arguments) end |
Instance Attribute Details
#node_variant ⇒ Object (readonly)
Returns the value of attribute node_variant.
92 93 94 |
# File 'app/components/primer/alpha/tree_view/sub_tree.rb', line 92 def node_variant @node_variant end |
Instance Method Details
#defer? ⇒ Boolean
107 108 109 |
# File 'app/components/primer/alpha/tree_view/sub_tree.rb', line 107 def defer? loader? end |
#with_leaf(**system_arguments, &block) ⇒ Object
Adds an leaf node to the tree. Leaf nodes are nodes that do not have children.
5 6 |
# File 'app/components/primer/alpha/tree_view/sub_tree.rb', line 5 def with_leaf(**system_arguments, &block) end |
#with_loading_spinner(**system_arguments, &block) ⇒ Object
Adds a loader to this sub-tree that displays a skeleton animation while nodes are fetched from the server.
4 5 |
# File 'app/components/primer/alpha/tree_view/sub_tree.rb', line 4 def with_loading_spinner(**system_arguments, &block) end |
#with_sub_tree(**system_arguments, &block) ⇒ Object
Adds a sub-tree node to the tree. Sub-trees are nodes that have children, which can be both leaf nodes and other sub-trees.
5 6 |
# File 'app/components/primer/alpha/tree_view/sub_tree.rb', line 5 def with_sub_tree(**system_arguments, &block) end |