You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: app/components/primer/alpha/tree_view/sub_tree_node.rb
+19-9Lines changed: 19 additions & 9 deletions
Original file line number
Diff line number
Diff line change
@@ -8,10 +8,11 @@ class TreeView
8
8
# This component is part of the <%= link_to_component(Primer::Alpha::TreeView) %> component and should
9
9
# not be used directly.
10
10
classSubTreeNode < Primer::Component
11
-
DEFAULT_SELECT_STRATEGY=:descendants
11
+
DEFAULT_SELECT_STRATEGY=:mixed_descendants
12
12
SELECT_STRATEGIES=[
13
13
:self,
14
-
DEFAULT_SELECT_STRATEGY
14
+
DEFAULT_SELECT_STRATEGY,
15
+
:descendants
15
16
]
16
17
17
18
# @!parse
@@ -59,7 +60,7 @@ class SubTreeNode < Primer::Component
59
60
visual: IconPair.new(
60
61
**system_arguments,
61
62
expanded: @sub_tree.expanded?,
62
-
)
63
+
)
63
64
)
64
65
}
65
66
}
@@ -108,10 +109,19 @@ class SubTreeNode < Primer::Component
108
109
# @param label [String] The node's label, i.e. it's textual content.
109
110
# @param path [Array<String>] The node's "path," i.e. this node's label and the labels of all its ancestors. This node should be reachable by traversing the tree following this path.
110
111
# @param node_variant [Symbol] The variant to use for this node. <%= one_of(Primer::Alpha::TreeView::NODE_VARIANT_OPTIONS) %>
112
+
# @param sub_tree_component_klass [Class] The class to use for the sub-tree instead of the default <%= link_to_component(Primer::Alpha::TreeView::SubTree) %>
111
113
# @param expanded [Boolean] Whether or not this sub-tree should be rendered expanded.
112
114
# @param select_strategy [Symbol] What should happen when this sub-tree node is checked. <%= one_of(Primer::Alpha::TreeView::SubTreeNode::SELECT_STRATEGIES) %>
113
115
# @param system_arguments [Hash] The arguments accepted by <%= link_to_component(Primer::Alpha::TreeView::Node) %>.
0 commit comments