@react-aria/dnd 3.5.4-nightly.4518 → 3.5.4-nightly.4528
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 +3 -3
- package/dist/main.js +3 -3
- package/dist/main.js.map +1 -1
- package/dist/module.js +3 -3
- package/dist/module.js.map +1 -1
- package/package.json +11 -11
- package/src/useDraggableItem.ts +5 -5
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@react-aria/dnd",
|
|
3
|
-
"version": "3.5.4-nightly.
|
|
3
|
+
"version": "3.5.4-nightly.4528+3ebcc660d",
|
|
4
4
|
"description": "Spectrum UI components in React",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"main": "dist/main.js",
|
|
@@ -22,15 +22,15 @@
|
|
|
22
22
|
"url": "https://github.com/adobe/react-spectrum"
|
|
23
23
|
},
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@internationalized/string": "3.2.2-nightly.
|
|
26
|
-
"@react-aria/i18n": "3.0.0-nightly.
|
|
27
|
-
"@react-aria/interactions": "3.0.0-nightly.
|
|
28
|
-
"@react-aria/live-announcer": "3.0.0-nightly.
|
|
29
|
-
"@react-aria/overlays": "3.0.0-nightly.
|
|
30
|
-
"@react-aria/utils": "3.0.0-nightly.
|
|
31
|
-
"@react-stately/dnd": "3.2.9-nightly.
|
|
32
|
-
"@react-types/button": "3.9.3-nightly.
|
|
33
|
-
"@react-types/shared": "3.0.0-nightly.
|
|
25
|
+
"@internationalized/string": "3.2.2-nightly.4528+3ebcc660d",
|
|
26
|
+
"@react-aria/i18n": "3.0.0-nightly.2816+3ebcc660d",
|
|
27
|
+
"@react-aria/interactions": "3.0.0-nightly.2816+3ebcc660d",
|
|
28
|
+
"@react-aria/live-announcer": "3.0.0-nightly.2816+3ebcc660d",
|
|
29
|
+
"@react-aria/overlays": "3.0.0-nightly.2816+3ebcc660d",
|
|
30
|
+
"@react-aria/utils": "3.0.0-nightly.2816+3ebcc660d",
|
|
31
|
+
"@react-stately/dnd": "3.2.9-nightly.4528+3ebcc660d",
|
|
32
|
+
"@react-types/button": "3.9.3-nightly.4528+3ebcc660d",
|
|
33
|
+
"@react-types/shared": "3.0.0-nightly.2816+3ebcc660d",
|
|
34
34
|
"@swc/helpers": "^0.5.0"
|
|
35
35
|
},
|
|
36
36
|
"peerDependencies": {
|
|
@@ -40,5 +40,5 @@
|
|
|
40
40
|
"publishConfig": {
|
|
41
41
|
"access": "public"
|
|
42
42
|
},
|
|
43
|
-
"gitHead": "
|
|
43
|
+
"gitHead": "3ebcc660dd5abfae62ec9002a938916828ce05aa"
|
|
44
44
|
}
|
package/src/useDraggableItem.ts
CHANGED
|
@@ -65,7 +65,7 @@ const MESSAGES = {
|
|
|
65
65
|
*/
|
|
66
66
|
export function useDraggableItem(props: DraggableItemProps, state: DraggableCollectionState): DraggableItemResult {
|
|
67
67
|
let stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-aria/dnd');
|
|
68
|
-
let isDisabled = state.selectionManager.isDisabled(props.key);
|
|
68
|
+
let isDisabled = state.isDisabled || state.selectionManager.isDisabled(props.key);
|
|
69
69
|
let {dragProps, dragButtonProps} = useDrag({
|
|
70
70
|
getItems() {
|
|
71
71
|
return state.getItems(props.key);
|
|
@@ -92,8 +92,8 @@ export function useDraggableItem(props: DraggableItemProps, state: DraggableColl
|
|
|
92
92
|
let item = state.collection.getItem(props.key);
|
|
93
93
|
let numKeysForDrag = state.getKeysForDrag(props.key).size;
|
|
94
94
|
let isSelected = numKeysForDrag > 1 && state.selectionManager.isSelected(props.key);
|
|
95
|
-
let dragButtonLabel: string;
|
|
96
|
-
let description: string;
|
|
95
|
+
let dragButtonLabel: string | undefined;
|
|
96
|
+
let description: string | undefined;
|
|
97
97
|
|
|
98
98
|
// Override description to include selected item count.
|
|
99
99
|
let modality = useDragModality();
|
|
@@ -136,13 +136,13 @@ export function useDraggableItem(props: DraggableItemProps, state: DraggableColl
|
|
|
136
136
|
// Require Alt key if there is a conflicting action.
|
|
137
137
|
dragProps.onKeyDownCapture = e => {
|
|
138
138
|
if (e.altKey) {
|
|
139
|
-
onKeyDownCapture(e);
|
|
139
|
+
onKeyDownCapture?.(e);
|
|
140
140
|
}
|
|
141
141
|
};
|
|
142
142
|
|
|
143
143
|
dragProps.onKeyUpCapture = e => {
|
|
144
144
|
if (e.altKey) {
|
|
145
|
-
onKeyUpCapture(e);
|
|
145
|
+
onKeyUpCapture?.(e);
|
|
146
146
|
}
|
|
147
147
|
};
|
|
148
148
|
}
|