@react-stately/collections
Advanced tools
Comparing version 3.0.0-nightly.3069 to 3.0.0-nightly.3074
@@ -31,7 +31,3 @@ var $ioO2y$react = require("react"); | ||
let { children: children, items: items } = props; | ||
if ((0, ($parcel$interopDefault($ioO2y$react))).isValidElement(children) && children.type === (0, ($parcel$interopDefault($ioO2y$react))).Fragment) yield* this.iterateCollection({ | ||
children: children.props.children, | ||
items: items | ||
}); | ||
else if (typeof children === 'function') { | ||
if (typeof children === 'function') { | ||
if (!items) throw new Error('props.children was a function but props.items is missing'); | ||
@@ -79,14 +75,2 @@ for (let item of props.items)yield* this.getFullNode({ | ||
*getFullNode(partialNode, state, parentKey, parentNode) { | ||
if ((0, ($parcel$interopDefault($ioO2y$react))).isValidElement(partialNode.element) && partialNode.element.type === (0, ($parcel$interopDefault($ioO2y$react))).Fragment) { | ||
let children = []; | ||
(0, ($parcel$interopDefault($ioO2y$react))).Children.forEach(partialNode.element.props.children, (child)=>{ | ||
children.push(child); | ||
}); | ||
let index = partialNode.index; | ||
for (const child of children)yield* this.getFullNode({ | ||
element: child, | ||
index: index++ | ||
}, state, parentKey, parentNode); | ||
return; | ||
} | ||
// If there's a value instead of an element on the node, and a parent renderer function is available, | ||
@@ -93,0 +77,0 @@ // use it to render an element for the value. |
@@ -21,7 +21,3 @@ import $fzaAv$react from "react"; | ||
let { children: children, items: items } = props; | ||
if ((0, $fzaAv$react).isValidElement(children) && children.type === (0, $fzaAv$react).Fragment) yield* this.iterateCollection({ | ||
children: children.props.children, | ||
items: items | ||
}); | ||
else if (typeof children === 'function') { | ||
if (typeof children === 'function') { | ||
if (!items) throw new Error('props.children was a function but props.items is missing'); | ||
@@ -69,14 +65,2 @@ for (let item of props.items)yield* this.getFullNode({ | ||
*getFullNode(partialNode, state, parentKey, parentNode) { | ||
if ((0, $fzaAv$react).isValidElement(partialNode.element) && partialNode.element.type === (0, $fzaAv$react).Fragment) { | ||
let children = []; | ||
(0, $fzaAv$react).Children.forEach(partialNode.element.props.children, (child)=>{ | ||
children.push(child); | ||
}); | ||
let index = partialNode.index; | ||
for (const child of children)yield* this.getFullNode({ | ||
element: child, | ||
index: index++ | ||
}, state, parentKey, parentNode); | ||
return; | ||
} | ||
// If there's a value instead of an element on the node, and a parent renderer function is available, | ||
@@ -83,0 +67,0 @@ // use it to render an element for the value. |
{ | ||
"name": "@react-stately/collections", | ||
"version": "3.0.0-nightly.3069+ec7509177", | ||
"version": "3.0.0-nightly.3074+cfd890edf", | ||
"description": "Spectrum UI components in React", | ||
@@ -25,3 +25,3 @@ "license": "Apache-2.0", | ||
"dependencies": { | ||
"@react-types/shared": "3.0.0-nightly.3069+ec7509177", | ||
"@react-types/shared": "3.0.0-nightly.3074+cfd890edf", | ||
"@swc/helpers": "^0.5.0" | ||
@@ -35,3 +35,3 @@ }, | ||
}, | ||
"gitHead": "ec75091771bcfccaed7e23a2adbc0911dc284896" | ||
"gitHead": "cfd890edf73783cbea0b94316d69f4bdced5ed8a" | ||
} |
@@ -30,11 +30,6 @@ /* | ||
private *iterateCollection(props: CollectionBase<T>): Generator<Node<T>> { | ||
private *iterateCollection(props: CollectionBase<T>) { | ||
let {children, items} = props; | ||
if (React.isValidElement<{children: CollectionElement<T>}>(children) && children.type === React.Fragment) { | ||
yield* this.iterateCollection({ | ||
children: children.props.children, | ||
items | ||
}); | ||
} else if (typeof children === 'function') { | ||
if (typeof children === 'function') { | ||
if (!items) { | ||
@@ -99,21 +94,2 @@ throw new Error('props.children was a function but props.items is missing'); | ||
private *getFullNode(partialNode: PartialNode<T>, state: CollectionBuilderState, parentKey?: Key, parentNode?: Node<T>): Generator<Node<T>> { | ||
if (React.isValidElement<{children: CollectionElement<T>}>(partialNode.element) && partialNode.element.type === React.Fragment) { | ||
let children: CollectionElement<T>[] = []; | ||
React.Children.forEach(partialNode.element.props.children, child => { | ||
children.push(child); | ||
}); | ||
let index = partialNode.index; | ||
for (const child of children) { | ||
yield* this.getFullNode({ | ||
element: child, | ||
index: index++ | ||
}, state, parentKey, parentNode); | ||
} | ||
return; | ||
} | ||
// If there's a value instead of an element on the node, and a parent renderer function is available, | ||
@@ -120,0 +96,0 @@ // use it to render an element for the value. |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
163590
1916