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

Method buildNode

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

Source from the content-addressed store, hash-verified

670 }
671
672 protected buildNode(node: Node<T>, x: number, y: number): LayoutNode {
673 switch (node.type) {
674 case 'section':
675 return this.buildSection(node, x, y);
676 case 'item':
677 return this.buildItem(node, x, y);
678 case 'header':
679 return this.buildSectionHeader(node, x, y);
680 case 'loader':
681 return this.buildLoader(node, x, y);
682 case 'separator':
683 return this.buildItem(node, x, y);
684 default:
685 throw new Error('Unsupported node type: ' + node.type);
686 }
687 }
688
689 protected buildLoader(node: Node<T>, x: number, y: number): LayoutNode {
690 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