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

Method buildNode

packages/react-stately/src/layout/ListLayout.ts:479–494  ·  view source on GitHub ↗
(node: Node<T>, x: number, y: number)

Source from the content-addressed store, hash-verified

477 }
478
479 protected buildNode(node: Node<T>, x: number, y: number): LayoutNode {
480 switch (node.type) {
481 case 'section':
482 return this.buildSection(node, x, y);
483 case 'item':
484 return this.buildItem(node, x, y);
485 case 'header':
486 return this.buildSectionHeader(node, x, y);
487 case 'loader':
488 return this.buildLoader(node, x, y);
489 case 'separator':
490 return this.buildItem(node, x, y);
491 default:
492 throw new Error('Unsupported node type: ' + node.type);
493 }
494 }
495
496 protected buildLoader(node: Node<T>, x: number, y: number): LayoutNode {
497 let rect = new Rect(x, y, this.padding, 0);

Callers 1

buildChildMethod · 0.95

Calls 4

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

Tested by

no test coverage detected