MCPcopy Create free account
hub / github.com/adobe/react-spectrum / buildNode

Method buildNode

packages/@react-spectrum/ai/src/ListLayout.ts:696–711  ·  view source on GitHub ↗
(node: Node<T>, x: number, y: number)

Source from the content-addressed store, hash-verified

694 }
695
696 protected buildNode(node: Node<T>, x: number, y: number): LayoutNode {
697 switch (node.type) {
698 case 'section':
699 return this.buildSection(node, x, y);
700 case 'item':
701 return this.buildItem(node, x, y);
702 case 'header':
703 return this.buildSectionHeader(node, x, y);
704 case 'loader':
705 return this.buildLoader(node, x, y);
706 case 'separator':
707 return this.buildItem(node, x, y);
708 default:
709 throw new Error('Unsupported node type: ' + node.type);
710 }
711 }
712
713 protected buildLoader(node: Node<T>, x: number, y: number): LayoutNode {
714 let rect = new Rect(x, y, this.padding, 0);

Callers 2

buildChildMethod · 0.95

Calls 4

buildSectionMethod · 0.95
buildItemMethod · 0.95
buildSectionHeaderMethod · 0.95
buildLoaderMethod · 0.95

Tested by

no test coverage detected