lincd-design-elems
Version:
42 lines • 1.29 kB
JavaScript
export {};
//TODO: make this a linked component of Shape
/**
* @description Shows a set of gives nodes as a list. Each node will be rendered with the provided component or render method.
*/
//TODO: remake with lincd 1.0
// @linkedComponentClass(Shape)
// export class List extends LinkedComponentClass<
// Shape,
// {sources: NodeSet; children?: any; renderItem?: (item: Node) => any}
// > {
// render() {
// let renderFunction;
// //if this list was rendered with 1 child which was a child-render-function
// if (
// this.props.children.length === 1 &&
// typeof this.props.children === 'function'
// ) {
// //then render the child node using the given child render function
// renderFunction = this.props.children;
// }
// //or if a render function was given as property, use that
// else if (this.props.renderItem) {
// renderFunction = this.props.renderItem;
// }
//
// let sources = this.props.sources;
//
// return (
// <ul>
// {sources.map((item) => {
// return (
// <li key={item.toString()}>
// {renderFunction && renderFunction(item)}
// </li>
// );
// })}
// </ul>
// );
// }
// }
//# sourceMappingURL=List.js.map