@react-aria/dnd 3.1.1-nightly.3787 → 3.1.1-nightly.3804
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/import.mjs +14 -6
- package/dist/main.js +14 -6
- package/dist/main.js.map +1 -1
- package/dist/module.js +14 -6
- package/dist/module.js.map +1 -1
- package/dist/types.d.ts.map +1 -1
- package/package.json +12 -12
- package/src/useDraggableItem.ts +2 -1
- package/src/useDropIndicator.ts +1 -1
- package/src/useDroppableCollection.ts +7 -0
package/dist/module.js
CHANGED
|
@@ -3116,6 +3116,9 @@ function $4b52e4eff84e5217$export$f4e2f423c21f7b04(props, state, ref) {
|
|
|
3116
3116
|
// is some indication that items were added.
|
|
3117
3117
|
if (state.selectionManager.focusedKey === droppingState.current.focusedKey) {
|
|
3118
3118
|
let first = newKeys.keys().next().value;
|
|
3119
|
+
let item = state.collection.getItem(first);
|
|
3120
|
+
// If this is a cell, focus the parent row.
|
|
3121
|
+
if ((item === null || item === void 0 ? void 0 : item.type) === "cell") first = item.parentKey;
|
|
3119
3122
|
state.selectionManager.setFocusedKey(first);
|
|
3120
3123
|
if (state.selectionManager.selectionMode === "none") (0, $fP8tg$setInteractionModality)("keyboard");
|
|
3121
3124
|
}
|
|
@@ -3503,9 +3506,10 @@ function $ddf25448c71fc93a$export$8d0e41d2815afac5(props, state, ref) {
|
|
|
3503
3506
|
let dragSession = $67560de7c78cb232$export$418e185dd3f1b968();
|
|
3504
3507
|
let { dropProps: dropProps } = (0, $bfaab576ce1c580e$export$f7b0c5d28b66b6a5)(props, state, ref);
|
|
3505
3508
|
let id = (0, $fP8tg$useId)();
|
|
3509
|
+
var _collection_getTextValue;
|
|
3506
3510
|
let getText = (key)=>{
|
|
3507
|
-
var _collection_getItem;
|
|
3508
|
-
return (_collection_getItem = collection.getItem(key)) === null || _collection_getItem === void 0 ? void 0 : _collection_getItem.textValue;
|
|
3511
|
+
var _collection_getTextValue1, _collection_getItem;
|
|
3512
|
+
return (_collection_getTextValue = (_collection_getTextValue1 = collection.getTextValue) === null || _collection_getTextValue1 === void 0 ? void 0 : _collection_getTextValue1.call(collection, key)) !== null && _collection_getTextValue !== void 0 ? _collection_getTextValue : (_collection_getItem = collection.getItem(key)) === null || _collection_getItem === void 0 ? void 0 : _collection_getItem.textValue;
|
|
3509
3513
|
};
|
|
3510
3514
|
let label = "";
|
|
3511
3515
|
let labelledBy;
|
|
@@ -3620,7 +3624,6 @@ function $fd98cf7cbf233429$export$b35afafff42da2d9(props, state) {
|
|
|
3620
3624
|
let description;
|
|
3621
3625
|
// Override description to include selected item count.
|
|
3622
3626
|
let modality = (0, $7252cd45fc48c07c$export$49bac5d6d4b352ea)();
|
|
3623
|
-
var _item_textValue;
|
|
3624
3627
|
if (!props.hasDragButton && state.selectionManager.selectionMode !== "none") {
|
|
3625
3628
|
let msg = $fd98cf7cbf233429$var$MESSAGES[modality][isSelected ? "selected" : "notSelected"];
|
|
3626
3629
|
if (props.hasAction && modality === "keyboard") msg += "Alt";
|
|
@@ -3634,9 +3637,14 @@ function $fd98cf7cbf233429$export$b35afafff42da2d9(props, state) {
|
|
|
3634
3637
|
} else if (isSelected) dragButtonLabel = stringFormatter.format("dragSelectedItems", {
|
|
3635
3638
|
count: numKeysForDrag
|
|
3636
3639
|
});
|
|
3637
|
-
else
|
|
3638
|
-
|
|
3639
|
-
|
|
3640
|
+
else {
|
|
3641
|
+
var _state_collection, _state_collection_getTextValue;
|
|
3642
|
+
var _state_collection_getTextValue1, _ref;
|
|
3643
|
+
let itemText = (_ref = (_state_collection_getTextValue1 = (_state_collection_getTextValue = (_state_collection = state.collection).getTextValue) === null || _state_collection_getTextValue === void 0 ? void 0 : _state_collection_getTextValue.call(_state_collection, props.key)) !== null && _state_collection_getTextValue1 !== void 0 ? _state_collection_getTextValue1 : item === null || item === void 0 ? void 0 : item.textValue) !== null && _ref !== void 0 ? _ref : "";
|
|
3644
|
+
dragButtonLabel = stringFormatter.format("dragItem", {
|
|
3645
|
+
itemText: itemText
|
|
3646
|
+
});
|
|
3647
|
+
}
|
|
3640
3648
|
let descriptionProps = (0, $fP8tg$useDescription)(description);
|
|
3641
3649
|
if (description) Object.assign(dragProps, descriptionProps);
|
|
3642
3650
|
if (!props.hasDragButton && props.hasAction) {
|