@react-aria/table
Advanced tools
Comparing version 3.0.0-nightly-262cc758b-241115 to 3.0.0-nightly-2788d8afd-250205
@@ -28,12 +28,15 @@ var $heEpC$reactstatelycollections = require("@react-stately/collections"); | ||
let startItem = this.collection.getItem(key); | ||
if (!startItem) return; | ||
if (!startItem) return null; | ||
// If focus was on a column, then focus the first child column if any, | ||
// or find the corresponding cell in the first row. | ||
if (startItem.type === 'column') { | ||
var _getNthItem; | ||
let child = (0, $heEpC$reactstatelycollections.getFirstItem)((0, $heEpC$reactstatelycollections.getChildNodes)(startItem, this.collection)); | ||
if (child) return child.key; | ||
let firstKey = this.getFirstKey(); | ||
if (firstKey == null) return; | ||
if (firstKey == null) return null; | ||
let firstItem = this.collection.getItem(firstKey); | ||
return (0, $heEpC$reactstatelycollections.getNthItem)((0, $heEpC$reactstatelycollections.getChildNodes)(firstItem, this.collection), startItem.index).key; | ||
if (!firstItem) return null; | ||
var _getNthItem_key; | ||
return (_getNthItem_key = (_getNthItem = (0, $heEpC$reactstatelycollections.getNthItem)((0, $heEpC$reactstatelycollections.getChildNodes)(firstItem, this.collection), startItem.index)) === null || _getNthItem === void 0 ? void 0 : _getNthItem.key) !== null && _getNthItem_key !== void 0 ? _getNthItem_key : null; | ||
} | ||
@@ -44,12 +47,13 @@ return super.getKeyBelow(key); | ||
let startItem = this.collection.getItem(key); | ||
if (!startItem) return; | ||
if (!startItem) return null; | ||
// If focus was on a column, focus the parent column if any | ||
if (startItem.type === 'column') { | ||
let parent = this.collection.getItem(startItem.parentKey); | ||
let parent = startItem.parentKey != null ? this.collection.getItem(startItem.parentKey) : null; | ||
if (parent && parent.type === 'column') return parent.key; | ||
return; | ||
return null; | ||
} | ||
// only return above row key if not header row | ||
let superKey = super.getKeyAbove(key); | ||
if (superKey != null && this.collection.getItem(superKey).type !== 'headerrow') return superKey; | ||
let superItem = superKey != null ? this.collection.getItem(superKey) : null; | ||
if (superItem && superItem.type !== 'headerrow') return superKey; | ||
// If no item was found, and focus was on a cell, then focus the | ||
@@ -70,2 +74,3 @@ // corresponding column header. | ||
} | ||
return null; | ||
} | ||
@@ -85,6 +90,7 @@ findPreviousColumnKey(column) { | ||
} | ||
return null; | ||
} | ||
getKeyRightOf(key) { | ||
let item = this.collection.getItem(key); | ||
if (!item) return; | ||
if (!item) return null; | ||
// If focus was on a column, then focus the next column | ||
@@ -96,3 +102,3 @@ if (item.type === 'column') return this.direction === 'rtl' ? this.findPreviousColumnKey(item) : this.findNextColumnKey(item); | ||
let item = this.collection.getItem(key); | ||
if (!item) return; | ||
if (!item) return null; | ||
// If focus was on a column, then focus the previous column | ||
@@ -109,6 +115,8 @@ if (item.type === 'column') return this.direction === 'rtl' ? this.findNextColumnKey(item) : this.findPreviousColumnKey(item); | ||
let startItem = collection.getItem(key); | ||
if (startItem.type === 'cell') key = startItem.parentKey; | ||
var _startItem_parentKey; | ||
if ((startItem === null || startItem === void 0 ? void 0 : startItem.type) === 'cell') key = (_startItem_parentKey = startItem.parentKey) !== null && _startItem_parentKey !== void 0 ? _startItem_parentKey : null; | ||
let hasWrapped = false; | ||
while(key != null){ | ||
let item = collection.getItem(key); | ||
if (!item) return null; | ||
// Check each of the row header cells in this row for a match | ||
@@ -122,3 +130,3 @@ for (let cell of (0, $heEpC$reactstatelycollections.getChildNodes)(item, this.collection)){ | ||
let fromItem = fromKey != null ? collection.getItem(fromKey) : startItem; | ||
return fromItem.type === 'cell' ? cell.key : item.key; | ||
return (fromItem === null || fromItem === void 0 ? void 0 : fromItem.type) === 'cell' ? cell.key : item.key; | ||
} | ||
@@ -125,0 +133,0 @@ } |
@@ -22,12 +22,15 @@ import {getFirstItem as $eIXPM$getFirstItem, getChildNodes as $eIXPM$getChildNodes, getNthItem as $eIXPM$getNthItem} from "@react-stately/collections"; | ||
let startItem = this.collection.getItem(key); | ||
if (!startItem) return; | ||
if (!startItem) return null; | ||
// If focus was on a column, then focus the first child column if any, | ||
// or find the corresponding cell in the first row. | ||
if (startItem.type === 'column') { | ||
var _getNthItem; | ||
let child = (0, $eIXPM$getFirstItem)((0, $eIXPM$getChildNodes)(startItem, this.collection)); | ||
if (child) return child.key; | ||
let firstKey = this.getFirstKey(); | ||
if (firstKey == null) return; | ||
if (firstKey == null) return null; | ||
let firstItem = this.collection.getItem(firstKey); | ||
return (0, $eIXPM$getNthItem)((0, $eIXPM$getChildNodes)(firstItem, this.collection), startItem.index).key; | ||
if (!firstItem) return null; | ||
var _getNthItem_key; | ||
return (_getNthItem_key = (_getNthItem = (0, $eIXPM$getNthItem)((0, $eIXPM$getChildNodes)(firstItem, this.collection), startItem.index)) === null || _getNthItem === void 0 ? void 0 : _getNthItem.key) !== null && _getNthItem_key !== void 0 ? _getNthItem_key : null; | ||
} | ||
@@ -38,12 +41,13 @@ return super.getKeyBelow(key); | ||
let startItem = this.collection.getItem(key); | ||
if (!startItem) return; | ||
if (!startItem) return null; | ||
// If focus was on a column, focus the parent column if any | ||
if (startItem.type === 'column') { | ||
let parent = this.collection.getItem(startItem.parentKey); | ||
let parent = startItem.parentKey != null ? this.collection.getItem(startItem.parentKey) : null; | ||
if (parent && parent.type === 'column') return parent.key; | ||
return; | ||
return null; | ||
} | ||
// only return above row key if not header row | ||
let superKey = super.getKeyAbove(key); | ||
if (superKey != null && this.collection.getItem(superKey).type !== 'headerrow') return superKey; | ||
let superItem = superKey != null ? this.collection.getItem(superKey) : null; | ||
if (superItem && superItem.type !== 'headerrow') return superKey; | ||
// If no item was found, and focus was on a cell, then focus the | ||
@@ -64,2 +68,3 @@ // corresponding column header. | ||
} | ||
return null; | ||
} | ||
@@ -79,6 +84,7 @@ findPreviousColumnKey(column) { | ||
} | ||
return null; | ||
} | ||
getKeyRightOf(key) { | ||
let item = this.collection.getItem(key); | ||
if (!item) return; | ||
if (!item) return null; | ||
// If focus was on a column, then focus the next column | ||
@@ -90,3 +96,3 @@ if (item.type === 'column') return this.direction === 'rtl' ? this.findPreviousColumnKey(item) : this.findNextColumnKey(item); | ||
let item = this.collection.getItem(key); | ||
if (!item) return; | ||
if (!item) return null; | ||
// If focus was on a column, then focus the previous column | ||
@@ -103,6 +109,8 @@ if (item.type === 'column') return this.direction === 'rtl' ? this.findNextColumnKey(item) : this.findPreviousColumnKey(item); | ||
let startItem = collection.getItem(key); | ||
if (startItem.type === 'cell') key = startItem.parentKey; | ||
var _startItem_parentKey; | ||
if ((startItem === null || startItem === void 0 ? void 0 : startItem.type) === 'cell') key = (_startItem_parentKey = startItem.parentKey) !== null && _startItem_parentKey !== void 0 ? _startItem_parentKey : null; | ||
let hasWrapped = false; | ||
while(key != null){ | ||
let item = collection.getItem(key); | ||
if (!item) return null; | ||
// Check each of the row header cells in this row for a match | ||
@@ -116,3 +124,3 @@ for (let cell of (0, $eIXPM$getChildNodes)(item, this.collection)){ | ||
let fromItem = fromKey != null ? collection.getItem(fromKey) : startItem; | ||
return fromItem.type === 'cell' ? cell.key : item.key; | ||
return (fromItem === null || fromItem === void 0 ? void 0 : fromItem.type) === 'cell' ? cell.key : item.key; | ||
} | ||
@@ -119,0 +127,0 @@ } |
@@ -84,3 +84,4 @@ var $6acf696f746f932c$exports = require("./utils.main.js"); | ||
var _state_collection_columns_find; | ||
let columnName = (_state_collection_columns_find = state.collection.columns.find((c)=>c.key === column)) === null || _state_collection_columns_find === void 0 ? void 0 : _state_collection_columns_find.textValue; | ||
var _state_collection_columns_find_textValue; | ||
let columnName = (_state_collection_columns_find_textValue = (_state_collection_columns_find = state.collection.columns.find((c)=>c.key === column)) === null || _state_collection_columns_find === void 0 ? void 0 : _state_collection_columns_find.textValue) !== null && _state_collection_columns_find_textValue !== void 0 ? _state_collection_columns_find_textValue : ''; | ||
return sortDirection && column ? stringFormatter.format(`${sortDirection}Sort`, { | ||
@@ -98,3 +99,3 @@ columnName: columnName | ||
(0, $aZ1Oy$reactariautils.useUpdateEffect)(()=>{ | ||
(0, $aZ1Oy$reactarialiveannouncer.announce)(sortDescription, 'assertive', 500); | ||
if (sortDescription) (0, $aZ1Oy$reactarialiveannouncer.announce)(sortDescription, 'assertive', 500); | ||
}, [ | ||
@@ -101,0 +102,0 @@ sortDescription |
@@ -78,3 +78,4 @@ import {gridIds as $2140fb2337097f2d$export$552312adfd451dab} from "./utils.module.js"; | ||
var _state_collection_columns_find; | ||
let columnName = (_state_collection_columns_find = state.collection.columns.find((c)=>c.key === column)) === null || _state_collection_columns_find === void 0 ? void 0 : _state_collection_columns_find.textValue; | ||
var _state_collection_columns_find_textValue; | ||
let columnName = (_state_collection_columns_find_textValue = (_state_collection_columns_find = state.collection.columns.find((c)=>c.key === column)) === null || _state_collection_columns_find === void 0 ? void 0 : _state_collection_columns_find.textValue) !== null && _state_collection_columns_find_textValue !== void 0 ? _state_collection_columns_find_textValue : ''; | ||
return sortDirection && column ? stringFormatter.format(`${sortDirection}Sort`, { | ||
@@ -92,3 +93,3 @@ columnName: columnName | ||
(0, $dDeJM$useUpdateEffect)(()=>{ | ||
(0, $dDeJM$announce)(sortDescription, 'assertive', 500); | ||
if (sortDescription) (0, $dDeJM$announce)(sortDescription, 'assertive', 500); | ||
}, [ | ||
@@ -95,0 +96,0 @@ sortDescription |
@@ -23,5 +23,6 @@ var $6acf696f746f932c$exports = require("./utils.main.js"); | ||
function $32387a1f2c61cda2$export$49571c903d73624c(props, state, ref) { | ||
var _props_node_column; | ||
let { gridCellProps: gridCellProps, isPressed: isPressed } = (0, $8iEv8$reactariagrid.useGridCell)(props, state, ref); | ||
let columnKey = props.node.column.key; | ||
if (state.collection.rowHeaderColumnKeys.has(columnKey)) { | ||
let columnKey = (_props_node_column = props.node.column) === null || _props_node_column === void 0 ? void 0 : _props_node_column.key; | ||
if (columnKey != null && state.collection.rowHeaderColumnKeys.has(columnKey)) { | ||
gridCellProps.role = 'rowheader'; | ||
@@ -28,0 +29,0 @@ gridCellProps.id = (0, $6acf696f746f932c$exports.getCellId)(state, props.node.parentKey, columnKey); |
@@ -17,5 +17,6 @@ import {getCellId as $2140fb2337097f2d$export$19baff3266315d44} from "./utils.module.js"; | ||
function $7713593715703b24$export$49571c903d73624c(props, state, ref) { | ||
var _props_node_column; | ||
let { gridCellProps: gridCellProps, isPressed: isPressed } = (0, $1jd6q$useGridCell)(props, state, ref); | ||
let columnKey = props.node.column.key; | ||
if (state.collection.rowHeaderColumnKeys.has(columnKey)) { | ||
let columnKey = (_props_node_column = props.node.column) === null || _props_node_column === void 0 ? void 0 : _props_node_column.key; | ||
if (columnKey != null && state.collection.rowHeaderColumnKeys.has(columnKey)) { | ||
gridCellProps.role = 'rowheader'; | ||
@@ -22,0 +23,0 @@ gridCellProps.id = (0, $2140fb2337097f2d$export$19baff3266315d44)(state, props.node.parentKey, columnKey); |
@@ -57,3 +57,3 @@ var $6acf696f746f932c$exports = require("./utils.main.js"); | ||
let { focusableProps: focusableProps } = (0, $33PgG$reactariafocus.useFocusable)({}, ref); | ||
let ariaSort = null; | ||
let ariaSort = undefined; | ||
let isSortedColumn = ((_state_sortDescriptor = state.sortDescriptor) === null || _state_sortDescriptor === void 0 ? void 0 : _state_sortDescriptor.column) === node.key; | ||
@@ -81,9 +81,9 @@ let sortDirection = (_state_sortDescriptor1 = state.sortDescriptor) === null || _state_sortDescriptor1 === void 0 ? void 0 : _state_sortDescriptor1.direction; | ||
columnHeaderProps: { | ||
...(0, $33PgG$reactariautils.mergeProps)(gridCellProps, pressProps, focusableProps, descriptionProps, // If the table is empty, make all column headers untabbable | ||
shouldDisableFocus && { | ||
...(0, $33PgG$reactariautils.mergeProps)(focusableProps, gridCellProps, pressProps, descriptionProps, // If the table is empty, make all column headers untabbable | ||
shouldDisableFocus ? { | ||
tabIndex: -1 | ||
}), | ||
} : null), | ||
role: 'columnheader', | ||
id: (0, $6acf696f746f932c$exports.getColumnHeaderId)(state, node.key), | ||
'aria-colspan': node.colspan && node.colspan > 1 ? node.colspan : null, | ||
'aria-colspan': node.colspan && node.colspan > 1 ? node.colspan : undefined, | ||
'aria-sort': ariaSort | ||
@@ -90,0 +90,0 @@ } |
@@ -51,3 +51,3 @@ import {getColumnHeaderId as $2140fb2337097f2d$export$37cd4213f2ad742e} from "./utils.module.js"; | ||
let { focusableProps: focusableProps } = (0, $cjB6b$useFocusable)({}, ref); | ||
let ariaSort = null; | ||
let ariaSort = undefined; | ||
let isSortedColumn = ((_state_sortDescriptor = state.sortDescriptor) === null || _state_sortDescriptor === void 0 ? void 0 : _state_sortDescriptor.column) === node.key; | ||
@@ -75,9 +75,9 @@ let sortDirection = (_state_sortDescriptor1 = state.sortDescriptor) === null || _state_sortDescriptor1 === void 0 ? void 0 : _state_sortDescriptor1.direction; | ||
columnHeaderProps: { | ||
...(0, $cjB6b$mergeProps)(gridCellProps, pressProps, focusableProps, descriptionProps, // If the table is empty, make all column headers untabbable | ||
shouldDisableFocus && { | ||
...(0, $cjB6b$mergeProps)(focusableProps, gridCellProps, pressProps, descriptionProps, // If the table is empty, make all column headers untabbable | ||
shouldDisableFocus ? { | ||
tabIndex: -1 | ||
}), | ||
} : null), | ||
role: 'columnheader', | ||
id: (0, $2140fb2337097f2d$export$37cd4213f2ad742e)(state, node.key), | ||
'aria-colspan': node.colspan && node.colspan > 1 ? node.colspan : null, | ||
'aria-colspan': node.colspan && node.colspan > 1 ? node.colspan : undefined, | ||
'aria-sort': ariaSort | ||
@@ -84,0 +84,0 @@ } |
@@ -114,3 +114,4 @@ var $6acf696f746f932c$exports = require("./utils.main.js"); | ||
let onKeyDown = (0, $gDW2h$react.useCallback)((e)=>{ | ||
if (editModeEnabled) moveProps.onKeyDown(e); | ||
var _moveProps_onKeyDown; | ||
if (editModeEnabled) (_moveProps_onKeyDown = moveProps.onKeyDown) === null || _moveProps_onKeyDown === void 0 ? void 0 : _moveProps_onKeyDown.call(moveProps, e); | ||
}, [ | ||
@@ -177,2 +178,3 @@ editModeEnabled, | ||
let { pressProps: pressProps } = (0, $gDW2h$reactariainteractions.usePress)({ | ||
preventFocusOnPress: true, | ||
onPressStart: (e)=>{ | ||
@@ -179,0 +181,0 @@ if (e.ctrlKey || e.altKey || e.metaKey || e.shiftKey || e.pointerType === 'keyboard') return; |
@@ -108,3 +108,4 @@ import {getColumnHeaderId as $2140fb2337097f2d$export$37cd4213f2ad742e} from "./utils.module.js"; | ||
let onKeyDown = (0, $d9Rqy$useCallback)((e)=>{ | ||
if (editModeEnabled) moveProps.onKeyDown(e); | ||
var _moveProps_onKeyDown; | ||
if (editModeEnabled) (_moveProps_onKeyDown = moveProps.onKeyDown) === null || _moveProps_onKeyDown === void 0 ? void 0 : _moveProps_onKeyDown.call(moveProps, e); | ||
}, [ | ||
@@ -171,2 +172,3 @@ editModeEnabled, | ||
let { pressProps: pressProps } = (0, $d9Rqy$usePress)({ | ||
preventFocusOnPress: true, | ||
onPressStart: (e)=>{ | ||
@@ -173,0 +175,0 @@ if (e.ctrlKey || e.altKey || e.metaKey || e.shiftKey || e.pointerType === 'keyboard') return; |
@@ -50,4 +50,5 @@ var $6acf696f746f932c$exports = require("./utils.main.js"); | ||
if (treeNode != null) { | ||
var _treeNode_props, _treeNode_props_children, _treeNode_props1; | ||
var _treeNode_props, _treeNode_props_children, _treeNode_props1, _getLastItem, _state_keyMap_get, _getLastItem1; | ||
let hasChildRows = ((_treeNode_props = treeNode.props) === null || _treeNode_props === void 0 ? void 0 : _treeNode_props.UNSTABLE_childItems) || ((_treeNode_props1 = treeNode.props) === null || _treeNode_props1 === void 0 ? void 0 : (_treeNode_props_children = _treeNode_props1.children) === null || _treeNode_props_children === void 0 ? void 0 : _treeNode_props_children.length) > state.userColumnCount; | ||
var _treeNode_indexOfType, _state_keyMap_get_childNodes, _getLastItem_indexOfType, _getLastItem_indexOfType1; | ||
treeGridRowProps = { | ||
@@ -65,4 +66,4 @@ onKeyDown: (e)=>{ | ||
'aria-level': treeNode.level, | ||
'aria-posinset': treeNode.indexOfType + 1, | ||
'aria-setsize': treeNode.level > 1 ? (0, $6RVcf$reactstatelycollections.getLastItem)(state.keyMap.get(treeNode === null || treeNode === void 0 ? void 0 : treeNode.parentKey).childNodes).indexOfType + 1 : (0, $6RVcf$reactstatelycollections.getLastItem)(state.keyMap.get(state.collection.body.key).childNodes).indexOfType + 1 | ||
'aria-posinset': ((_treeNode_indexOfType = treeNode.indexOfType) !== null && _treeNode_indexOfType !== void 0 ? _treeNode_indexOfType : 0) + 1, | ||
'aria-setsize': treeNode.level > 1 ? ((_getLastItem_indexOfType = (_getLastItem = (0, $6RVcf$reactstatelycollections.getLastItem)((_state_keyMap_get_childNodes = (_state_keyMap_get = state.keyMap.get(treeNode.parentKey)) === null || _state_keyMap_get === void 0 ? void 0 : _state_keyMap_get.childNodes) !== null && _state_keyMap_get_childNodes !== void 0 ? _state_keyMap_get_childNodes : [])) === null || _getLastItem === void 0 ? void 0 : _getLastItem.indexOfType) !== null && _getLastItem_indexOfType !== void 0 ? _getLastItem_indexOfType : 0) + 1 : ((_getLastItem_indexOfType1 = (_getLastItem1 = (0, $6RVcf$reactstatelycollections.getLastItem)(state.collection.body.childNodes)) === null || _getLastItem1 === void 0 ? void 0 : _getLastItem1.indexOfType) !== null && _getLastItem_indexOfType1 !== void 0 ? _getLastItem_indexOfType1 : 0) + 1 | ||
}; | ||
@@ -69,0 +70,0 @@ } |
@@ -44,4 +44,5 @@ import {getRowLabelledBy as $2140fb2337097f2d$export$85069b70317f543} from "./utils.module.js"; | ||
if (treeNode != null) { | ||
var _treeNode_props, _treeNode_props_children, _treeNode_props1; | ||
var _treeNode_props, _treeNode_props_children, _treeNode_props1, _getLastItem, _state_keyMap_get, _getLastItem1; | ||
let hasChildRows = ((_treeNode_props = treeNode.props) === null || _treeNode_props === void 0 ? void 0 : _treeNode_props.UNSTABLE_childItems) || ((_treeNode_props1 = treeNode.props) === null || _treeNode_props1 === void 0 ? void 0 : (_treeNode_props_children = _treeNode_props1.children) === null || _treeNode_props_children === void 0 ? void 0 : _treeNode_props_children.length) > state.userColumnCount; | ||
var _treeNode_indexOfType, _state_keyMap_get_childNodes, _getLastItem_indexOfType, _getLastItem_indexOfType1; | ||
treeGridRowProps = { | ||
@@ -59,4 +60,4 @@ onKeyDown: (e)=>{ | ||
'aria-level': treeNode.level, | ||
'aria-posinset': treeNode.indexOfType + 1, | ||
'aria-setsize': treeNode.level > 1 ? (0, $2K6sg$getLastItem)(state.keyMap.get(treeNode === null || treeNode === void 0 ? void 0 : treeNode.parentKey).childNodes).indexOfType + 1 : (0, $2K6sg$getLastItem)(state.keyMap.get(state.collection.body.key).childNodes).indexOfType + 1 | ||
'aria-posinset': ((_treeNode_indexOfType = treeNode.indexOfType) !== null && _treeNode_indexOfType !== void 0 ? _treeNode_indexOfType : 0) + 1, | ||
'aria-setsize': treeNode.level > 1 ? ((_getLastItem_indexOfType = (_getLastItem = (0, $2K6sg$getLastItem)((_state_keyMap_get_childNodes = (_state_keyMap_get = state.keyMap.get(treeNode.parentKey)) === null || _state_keyMap_get === void 0 ? void 0 : _state_keyMap_get.childNodes) !== null && _state_keyMap_get_childNodes !== void 0 ? _state_keyMap_get_childNodes : [])) === null || _getLastItem === void 0 ? void 0 : _getLastItem.indexOfType) !== null && _getLastItem_indexOfType !== void 0 ? _getLastItem_indexOfType : 0) + 1 : ((_getLastItem_indexOfType1 = (_getLastItem1 = (0, $2K6sg$getLastItem)(state.collection.body.childNodes)) === null || _getLastItem1 === void 0 ? void 0 : _getLastItem1.indexOfType) !== null && _getLastItem_indexOfType1 !== void 0 ? _getLastItem_indexOfType1 : 0) + 1 | ||
}; | ||
@@ -63,0 +64,0 @@ } |
{ | ||
"name": "@react-aria/table", | ||
"version": "3.0.0-nightly-262cc758b-241115", | ||
"version": "3.0.0-nightly-2788d8afd-250205", | ||
"description": "Spectrum UI components in React", | ||
@@ -25,26 +25,25 @@ "license": "Apache-2.0", | ||
"dependencies": { | ||
"@react-aria/focus": "^3.0.0-nightly-262cc758b-241115", | ||
"@react-aria/grid": "^3.0.0-nightly-262cc758b-241115", | ||
"@react-aria/i18n": "^3.0.0-nightly-262cc758b-241115", | ||
"@react-aria/interactions": "^3.0.0-nightly-262cc758b-241115", | ||
"@react-aria/live-announcer": "^3.0.0-nightly-262cc758b-241115", | ||
"@react-aria/utils": "^3.0.0-nightly-262cc758b-241115", | ||
"@react-aria/visually-hidden": "^3.0.0-nightly-262cc758b-241115", | ||
"@react-stately/collections": "^3.0.0-nightly-262cc758b-241115", | ||
"@react-stately/flags": "^3.0.0-nightly-262cc758b-241115", | ||
"@react-stately/table": "^3.0.0-nightly-262cc758b-241115", | ||
"@react-types/checkbox": "^3.0.0-nightly-262cc758b-241115", | ||
"@react-types/grid": "^3.0.0-nightly-262cc758b-241115", | ||
"@react-types/shared": "^3.0.0-nightly-262cc758b-241115", | ||
"@react-types/table": "^3.0.0-nightly-262cc758b-241115", | ||
"@react-aria/focus": "3.0.0-nightly-2788d8afd-250205", | ||
"@react-aria/grid": "3.0.0-nightly-2788d8afd-250205", | ||
"@react-aria/i18n": "3.0.0-nightly-2788d8afd-250205", | ||
"@react-aria/interactions": "3.0.0-nightly-2788d8afd-250205", | ||
"@react-aria/live-announcer": "3.0.0-nightly-2788d8afd-250205", | ||
"@react-aria/utils": "3.0.0-nightly-2788d8afd-250205", | ||
"@react-aria/visually-hidden": "3.0.0-nightly-2788d8afd-250205", | ||
"@react-stately/collections": "3.0.0-nightly-2788d8afd-250205", | ||
"@react-stately/flags": "3.0.0-nightly-2788d8afd-250205", | ||
"@react-stately/table": "3.0.0-nightly-2788d8afd-250205", | ||
"@react-types/checkbox": "3.0.0-nightly-2788d8afd-250205", | ||
"@react-types/grid": "3.0.0-nightly-2788d8afd-250205", | ||
"@react-types/shared": "3.0.0-nightly-2788d8afd-250205", | ||
"@react-types/table": "3.0.0-nightly-2788d8afd-250205", | ||
"@swc/helpers": "^0.5.0" | ||
}, | ||
"peerDependencies": { | ||
"react": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0", | ||
"react-dom": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0" | ||
"react": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0-rc.1", | ||
"react-dom": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0-rc.1" | ||
}, | ||
"publishConfig": { | ||
"access": "public" | ||
}, | ||
"stableVersion": "3.15.5" | ||
} | ||
} |
@@ -27,3 +27,3 @@ /* | ||
if (!startItem) { | ||
return; | ||
return null; | ||
} | ||
@@ -41,7 +41,10 @@ | ||
if (firstKey == null) { | ||
return; | ||
return null; | ||
} | ||
let firstItem = this.collection.getItem(firstKey); | ||
return getNthItem(getChildNodes(firstItem, this.collection), startItem.index).key; | ||
if (!firstItem) { | ||
return null; | ||
} | ||
return getNthItem(getChildNodes(firstItem, this.collection), startItem.index)?.key ?? null; | ||
} | ||
@@ -55,3 +58,3 @@ | ||
if (!startItem) { | ||
return; | ||
return null; | ||
} | ||
@@ -61,3 +64,3 @@ | ||
if (startItem.type === 'column') { | ||
let parent = this.collection.getItem(startItem.parentKey); | ||
let parent = startItem.parentKey != null ? this.collection.getItem(startItem.parentKey) : null; | ||
if (parent && parent.type === 'column') { | ||
@@ -67,3 +70,3 @@ return parent.key; | ||
return; | ||
return null; | ||
} | ||
@@ -73,3 +76,4 @@ | ||
let superKey = super.getKeyAbove(key); | ||
if (superKey != null && this.collection.getItem(superKey).type !== 'headerrow') { | ||
let superItem = superKey != null ? this.collection.getItem(superKey) : null; | ||
if (superItem && superItem.type !== 'headerrow') { | ||
return superKey; | ||
@@ -102,2 +106,4 @@ } | ||
} | ||
return null; | ||
} | ||
@@ -121,2 +127,4 @@ | ||
} | ||
return null; | ||
} | ||
@@ -127,3 +135,3 @@ | ||
if (!item) { | ||
return; | ||
return null; | ||
} | ||
@@ -144,3 +152,3 @@ | ||
if (!item) { | ||
return; | ||
return null; | ||
} | ||
@@ -171,4 +179,4 @@ | ||
let startItem = collection.getItem(key); | ||
if (startItem.type === 'cell') { | ||
key = startItem.parentKey; | ||
if (startItem?.type === 'cell') { | ||
key = startItem.parentKey ?? null; | ||
} | ||
@@ -179,2 +187,5 @@ | ||
let item = collection.getItem(key); | ||
if (!item) { | ||
return null; | ||
} | ||
@@ -189,3 +200,3 @@ // Check each of the row header cells in this row for a match | ||
let fromItem = fromKey != null ? collection.getItem(fromKey) : startItem; | ||
return fromItem.type === 'cell' | ||
return fromItem?.type === 'cell' | ||
? cell.key | ||
@@ -192,0 +203,0 @@ : item.key; |
@@ -99,3 +99,3 @@ /* | ||
let sortDescription = useMemo(() => { | ||
let columnName = state.collection.columns.find(c => c.key === column)?.textValue; | ||
let columnName = state.collection.columns.find(c => c.key === column)?.textValue ?? ''; | ||
return sortDirection && column ? stringFormatter.format(`${sortDirection}Sort`, {columnName}) : undefined; | ||
@@ -109,3 +109,5 @@ // eslint-disable-next-line react-hooks/exhaustive-deps | ||
useUpdateEffect(() => { | ||
announce(sortDescription, 'assertive', 500); | ||
if (sortDescription) { | ||
announce(sortDescription, 'assertive', 500); | ||
} | ||
}, [sortDescription]); | ||
@@ -112,0 +114,0 @@ |
@@ -49,6 +49,6 @@ /* | ||
let {gridCellProps, isPressed} = useGridCell(props, state, ref); | ||
let columnKey = props.node.column.key; | ||
if (state.collection.rowHeaderColumnKeys.has(columnKey)) { | ||
let columnKey = props.node.column?.key; | ||
if (columnKey != null && state.collection.rowHeaderColumnKeys.has(columnKey)) { | ||
gridCellProps.role = 'rowheader'; | ||
gridCellProps.id = getCellId(state, props.node.parentKey, columnKey); | ||
gridCellProps.id = getCellId(state, props.node.parentKey!, columnKey); | ||
} | ||
@@ -55,0 +55,0 @@ |
@@ -63,3 +63,3 @@ /* | ||
let ariaSort: DOMAttributes['aria-sort'] = null; | ||
let ariaSort: DOMAttributes['aria-sort'] | undefined = undefined; | ||
let isSortedColumn = state.sortDescriptor?.column === node.key; | ||
@@ -94,12 +94,12 @@ let sortDirection = state.sortDescriptor?.direction; | ||
...mergeProps( | ||
focusableProps, | ||
gridCellProps, | ||
pressProps, | ||
focusableProps, | ||
descriptionProps, | ||
// If the table is empty, make all column headers untabbable | ||
shouldDisableFocus && {tabIndex: -1} | ||
shouldDisableFocus ? {tabIndex: -1} : null | ||
), | ||
role: 'columnheader', | ||
id: getColumnHeaderId(state, node.key), | ||
'aria-colspan': node.colspan && node.colspan > 1 ? node.colspan : null, | ||
'aria-colspan': node.colspan && node.colspan > 1 ? node.colspan : undefined, | ||
'aria-sort': ariaSort | ||
@@ -106,0 +106,0 @@ } |
@@ -69,3 +69,3 @@ /* | ||
let isResizingRef = useRef(isResizing); | ||
let lastSize = useRef(null); | ||
let lastSize = useRef<Map<Key, ColumnSize> | null>(null); | ||
let wasFocusedOnResizeStart = useRef(false); | ||
@@ -162,3 +162,3 @@ let editModeEnabled = state.tableState.isKeyboardNavigationDisabled; | ||
if (editModeEnabled) { | ||
moveProps.onKeyDown(e); | ||
moveProps.onKeyDown?.(e); | ||
} | ||
@@ -174,3 +174,3 @@ }, [editModeEnabled, moveProps]); | ||
let value = Math.floor(state.getColumnWidth(item.key)); | ||
let modality: string = useInteractionModality(); | ||
let modality: string | null = useInteractionModality(); | ||
if (modality === 'virtual' && (typeof window !== 'undefined' && 'ontouchstart' in window)) { | ||
@@ -200,3 +200,3 @@ modality = 'touch'; | ||
let resizingColumn = state.resizingColumn; | ||
let prevResizingColumn = useRef(null); | ||
let prevResizingColumn = useRef<Key | null>(null); | ||
useEffect(() => { | ||
@@ -231,2 +231,3 @@ if (prevResizingColumn.current !== resizingColumn && resizingColumn != null && resizingColumn === item.key) { | ||
let {pressProps} = usePress({ | ||
preventFocusOnPress: true, | ||
onPressStart: (e) => { | ||
@@ -233,0 +234,0 @@ if (e.ctrlKey || e.altKey || e.metaKey || e.shiftKey || e.pointerType === 'keyboard') { |
@@ -69,6 +69,6 @@ /* | ||
'aria-level': treeNode.level, | ||
'aria-posinset': treeNode.indexOfType + 1, | ||
'aria-posinset': (treeNode.indexOfType ?? 0) + 1, | ||
'aria-setsize': treeNode.level > 1 ? | ||
(getLastItem(state.keyMap.get(treeNode?.parentKey).childNodes) as GridNode<T>).indexOfType + 1 : | ||
(getLastItem(state.keyMap.get(state.collection.body.key).childNodes) as GridNode<T>).indexOfType + 1 | ||
((getLastItem(state.keyMap.get(treeNode.parentKey!)?.childNodes ?? []) as GridNode<T>)?.indexOfType ?? 0) + 1 : | ||
((getLastItem(state.collection.body.childNodes) as GridNode<T>)?.indexOfType ?? 0) + 1 | ||
}; | ||
@@ -75,0 +75,0 @@ } |
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
463723
4932
+ Added@internationalized/date@3.0.0-nightly-2788d8afd-250205(transitive)
+ Added@internationalized/message@3.0.0-nightly-2788d8afd-250205(transitive)
+ Added@internationalized/number@3.0.0-nightly-2788d8afd-250205(transitive)
+ Added@internationalized/string@3.0.0-nightly-2788d8afd-250205(transitive)
+ Added@react-aria/focus@3.0.0-nightly-2788d8afd-250205(transitive)
+ Added@react-aria/grid@3.0.0-nightly-2788d8afd-250205(transitive)
+ Added@react-aria/i18n@3.0.0-nightly-2788d8afd-250205(transitive)
+ Added@react-aria/interactions@3.0.0-nightly-2788d8afd-250205(transitive)
+ Added@react-aria/live-announcer@3.0.0-nightly-2788d8afd-250205(transitive)
+ Added@react-aria/selection@3.0.0-nightly-2788d8afd-250205(transitive)
+ Added@react-aria/ssr@3.0.0-nightly-2788d8afd-250205(transitive)
+ Added@react-aria/utils@3.0.0-nightly-2788d8afd-250205(transitive)
+ Added@react-aria/visually-hidden@3.0.0-nightly-2788d8afd-250205(transitive)
+ Added@react-stately/collections@3.0.0-nightly-2788d8afd-250205(transitive)
+ Added@react-stately/flags@3.0.0-nightly-2788d8afd-250205(transitive)
+ Added@react-stately/grid@3.0.0-nightly-2788d8afd-250205(transitive)
+ Added@react-stately/selection@3.0.0-nightly-2788d8afd-250205(transitive)
+ Added@react-stately/table@3.0.0-nightly-2788d8afd-250205(transitive)
+ Added@react-stately/utils@3.0.0-nightly-2788d8afd-250205(transitive)
+ Added@react-types/checkbox@3.0.0-nightly-2788d8afd-250205(transitive)
+ Added@react-types/grid@3.0.0-nightly-2788d8afd-250205(transitive)
+ Added@react-types/shared@3.0.0-nightly-2788d8afd-250205(transitive)
+ Added@react-types/table@3.0.0-nightly-2788d8afd-250205(transitive)
- Removed@internationalized/date@3.7.0(transitive)
- Removed@internationalized/message@3.1.6(transitive)
- Removed@internationalized/number@3.6.0(transitive)
- Removed@internationalized/string@3.2.5(transitive)
- Removed@react-aria/focus@3.19.1(transitive)
- Removed@react-aria/grid@3.11.1(transitive)
- Removed@react-aria/i18n@3.12.5(transitive)
- Removed@react-aria/interactions@3.23.0(transitive)
- Removed@react-aria/live-announcer@3.4.1(transitive)
- Removed@react-aria/selection@3.22.0(transitive)
- Removed@react-aria/ssr@3.9.7(transitive)
- Removed@react-aria/utils@3.27.0(transitive)
- Removed@react-aria/visually-hidden@3.8.19(transitive)
- Removed@react-stately/collections@3.12.1(transitive)
- Removed@react-stately/flags@3.0.5(transitive)
- Removed@react-stately/grid@3.10.1(transitive)
- Removed@react-stately/selection@3.19.0(transitive)
- Removed@react-stately/table@3.13.1(transitive)
- Removed@react-stately/utils@3.10.5(transitive)
- Removed@react-types/checkbox@3.9.1(transitive)
- Removed@react-types/grid@3.2.11(transitive)
- Removed@react-types/shared@3.27.0(transitive)
- Removed@react-types/table@3.10.4(transitive)
Updated@react-aria/interactions@3.0.0-nightly-2788d8afd-250205
Updated@react-aria/live-announcer@3.0.0-nightly-2788d8afd-250205
Updated@react-aria/visually-hidden@3.0.0-nightly-2788d8afd-250205
Updated@react-stately/collections@3.0.0-nightly-2788d8afd-250205