@react-stately/grid
Advanced tools
Comparing version 3.0.0-nightly-50c7ada5d-241223 to 3.0.0-nightly-5334df7f1-250226
@@ -82,3 +82,18 @@ | ||
let last = null; | ||
let rowHasCellWithColSpan = false; | ||
if (node.type === 'item') { | ||
var _child_props; | ||
for (let child of node.childNodes)if (((_child_props = child.props) === null || _child_props === void 0 ? void 0 : _child_props.colSpan) !== undefined) { | ||
rowHasCellWithColSpan = true; | ||
break; | ||
} | ||
} | ||
for (let child of node.childNodes){ | ||
if (child.type === 'cell' && rowHasCellWithColSpan) { | ||
var _child_props1, _child_props2; | ||
child.colspan = (_child_props1 = child.props) === null || _child_props1 === void 0 ? void 0 : _child_props1.colSpan; | ||
child.colSpan = (_child_props2 = child.props) === null || _child_props2 === void 0 ? void 0 : _child_props2.colSpan; | ||
var _last_colIndex, _last_colSpan; | ||
child.colIndex = !last ? child.index : ((_last_colIndex = last.colIndex) !== null && _last_colIndex !== void 0 ? _last_colIndex : last.index) + ((_last_colSpan = last.colSpan) !== null && _last_colSpan !== void 0 ? _last_colSpan : 1); | ||
} | ||
if (child.type === 'cell' && child.parentKey == null) // if child is a cell parent key isn't already established by the collection, match child node to parent row | ||
@@ -85,0 +100,0 @@ child.parentKey = node.key; |
@@ -76,3 +76,18 @@ /* | ||
let last = null; | ||
let rowHasCellWithColSpan = false; | ||
if (node.type === 'item') { | ||
var _child_props; | ||
for (let child of node.childNodes)if (((_child_props = child.props) === null || _child_props === void 0 ? void 0 : _child_props.colSpan) !== undefined) { | ||
rowHasCellWithColSpan = true; | ||
break; | ||
} | ||
} | ||
for (let child of node.childNodes){ | ||
if (child.type === 'cell' && rowHasCellWithColSpan) { | ||
var _child_props1, _child_props2; | ||
child.colspan = (_child_props1 = child.props) === null || _child_props1 === void 0 ? void 0 : _child_props1.colSpan; | ||
child.colSpan = (_child_props2 = child.props) === null || _child_props2 === void 0 ? void 0 : _child_props2.colSpan; | ||
var _last_colIndex, _last_colSpan; | ||
child.colIndex = !last ? child.index : ((_last_colIndex = last.colIndex) !== null && _last_colIndex !== void 0 ? _last_colIndex : last.index) + ((_last_colSpan = last.colSpan) !== null && _last_colSpan !== void 0 ? _last_colSpan : 1); | ||
} | ||
if (child.type === 'cell' && child.parentKey == null) // if child is a cell parent key isn't already established by the collection, match child node to parent row | ||
@@ -79,0 +94,0 @@ child.parentKey = node.key; |
{ | ||
"name": "@react-stately/grid", | ||
"version": "3.0.0-nightly-50c7ada5d-241223", | ||
"version": "3.0.0-nightly-5334df7f1-250226", | ||
"description": "Spectrum UI components in React", | ||
@@ -25,6 +25,6 @@ "license": "Apache-2.0", | ||
"dependencies": { | ||
"@react-stately/collections": "3.0.0-nightly-50c7ada5d-241223", | ||
"@react-stately/selection": "3.0.0-nightly-50c7ada5d-241223", | ||
"@react-types/grid": "3.0.0-nightly-50c7ada5d-241223", | ||
"@react-types/shared": "3.0.0-nightly-50c7ada5d-241223", | ||
"@react-stately/collections": "3.0.0-nightly-5334df7f1-250226", | ||
"@react-stately/selection": "3.0.0-nightly-5334df7f1-250226", | ||
"@react-types/grid": "3.0.0-nightly-5334df7f1-250226", | ||
"@react-types/shared": "3.0.0-nightly-5334df7f1-250226", | ||
"@swc/helpers": "^0.5.0" | ||
@@ -31,0 +31,0 @@ }, |
@@ -45,3 +45,20 @@ /* | ||
let last: GridNode<T> | null = null; | ||
for (let child of node.childNodes) { | ||
let rowHasCellWithColSpan = false; | ||
if (node.type === 'item') { | ||
for (let child of node.childNodes) { | ||
if (child.props?.colSpan !== undefined) { | ||
rowHasCellWithColSpan = true; | ||
break; | ||
} | ||
} | ||
} | ||
for (let child of node.childNodes as Iterable<GridNode<T>>) { | ||
if (child.type === 'cell' && rowHasCellWithColSpan) { | ||
child.colspan = child.props?.colSpan; | ||
child.colSpan = child.props?.colSpan; | ||
child.colIndex = !last ? child.index : (last.colIndex ?? last.index) + (last.colSpan ?? 1); | ||
} | ||
if (child.type === 'cell' && child.parentKey == null) { | ||
@@ -48,0 +65,0 @@ // if child is a cell parent key isn't already established by the collection, match child node to parent row |
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
85566
1041
+ Added@react-stately/collections@3.0.0-nightly-5334df7f1-250226(transitive)
+ Added@react-stately/selection@3.0.0-nightly-5334df7f1-250226(transitive)
+ Added@react-stately/utils@3.0.0-nightly-5334df7f1-250226(transitive)
+ Added@react-types/grid@3.0.0-nightly-5334df7f1-250226(transitive)
+ Added@react-types/shared@3.0.0-nightly-5334df7f1-250226(transitive)
- Removed@react-stately/collections@3.0.0-nightly-50c7ada5d-241223(transitive)
- Removed@react-stately/selection@3.0.0-nightly-50c7ada5d-241223(transitive)
- Removed@react-stately/utils@3.0.0-nightly-50c7ada5d-241223(transitive)
- Removed@react-types/grid@3.0.0-nightly-50c7ada5d-241223(transitive)
- Removed@react-types/shared@3.0.0-nightly-50c7ada5d-241223(transitive)
Updated@react-stately/collections@3.0.0-nightly-5334df7f1-250226
Updated@react-stately/selection@3.0.0-nightly-5334df7f1-250226