MCPcopy Create free account
hub / github.com/AnukarOP/claude-code-leaked / TreeSelect

Function TreeSelect

source code/components/ui/TreeSelect.tsx:112–392  ·  view source on GitHub ↗
(t0)

Source from the content-addressed store, hash-verified

110 * using the Select component.
111 */
112export function TreeSelect(t0) {
113 const $ = _c(48);
114 const {
115 nodes,
116 onSelect,
117 onCancel,
118 onFocus,
119 focusNodeId,
120 visibleOptionCount,
121 layout: t1,
122 isDisabled: t2,
123 hideIndexes: t3,
124 isNodeExpanded,
125 onExpand,
126 onCollapse,
127 getParentPrefix,
128 getChildPrefix,
129 onUpFromFirstItem
130 } = t0;
131 const layout = t1 === undefined ? "expanded" : t1;
132 const isDisabled = t2 === undefined ? false : t2;
133 const hideIndexes = t3 === undefined ? false : t3;
134 let t4;
135 if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
136 t4 = new Set();
137 $[0] = t4;
138 } else {
139 t4 = $[0];
140 }
141 const [internalExpandedIds, setInternalExpandedIds] = React.useState(t4);
142 const isProgrammaticFocusRef = React.useRef(false);
143 const lastFocusedIdRef = React.useRef(null);
144 let t5;
145 if ($[1] !== internalExpandedIds || $[2] !== isNodeExpanded) {
146 t5 = nodeId => {
147 if (isNodeExpanded) {
148 return isNodeExpanded(nodeId);
149 }
150 return internalExpandedIds.has(nodeId);
151 };
152 $[1] = internalExpandedIds;
153 $[2] = isNodeExpanded;
154 $[3] = t5;
155 } else {
156 t5 = $[3];
157 }
158 const isExpanded = t5;
159 let result;
160 if ($[4] !== isExpanded || $[5] !== nodes) {
161 result = [];
162 function traverse(node, depth, parentId) {
163 const hasChildren = !!node.children && node.children.length > 0;
164 const nodeIsExpanded = isExpanded(node.id);
165 result.push({
166 node,
167 depth,
168 isExpanded: nodeIsExpanded,
169 hasChildren,

Callers

nothing calls this directly

Calls 8

traverseFunction · 0.85
setMethod · 0.80
deleteMethod · 0.80
preventDefaultMethod · 0.80
onSelectFunction · 0.50
hasMethod · 0.45
addMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected