@react-types/shared 3.0.0-nightly.1802 → 3.0.0-nightly.1811
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/package.json +2 -2
- package/src/dnd.d.ts +14 -6
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@react-types/shared",
|
|
3
|
-
"version": "3.0.0-nightly.
|
|
3
|
+
"version": "3.0.0-nightly.1811+5096e5d1b",
|
|
4
4
|
"description": "Spectrum UI components in React",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"types": "src/index.d.ts",
|
|
@@ -14,5 +14,5 @@
|
|
|
14
14
|
"publishConfig": {
|
|
15
15
|
"access": "public"
|
|
16
16
|
},
|
|
17
|
-
"gitHead": "
|
|
17
|
+
"gitHead": "5096e5d1b74d0b97c6c3db803f1150be3285553c"
|
|
18
18
|
}
|
package/src/dnd.d.ts
CHANGED
|
@@ -199,7 +199,7 @@ export interface DropTargetDelegate {
|
|
|
199
199
|
getDropTargetFromPoint(x: number, y: number, isValidDropTarget: (target: DropTarget) => boolean): DropTarget | null
|
|
200
200
|
}
|
|
201
201
|
|
|
202
|
-
export interface
|
|
202
|
+
export interface DroppableCollectionUtilityOptions {
|
|
203
203
|
/**
|
|
204
204
|
* The drag types that the droppable collection accepts. If the collection accepts directories, include `DIRECTORY_DRAG_TYPE` in your array of allowed types.
|
|
205
205
|
* @default 'all'
|
|
@@ -221,9 +221,19 @@ export interface DroppableCollectionProps {
|
|
|
221
221
|
* Handler that is called when items are reordered via drag in the source collection.
|
|
222
222
|
*/
|
|
223
223
|
onReorder?: (e: DroppableCollectionReorderEvent) => void,
|
|
224
|
+
/**
|
|
225
|
+
* A function returning whether a given target in the droppable collection is a valid "on" drop target for the current drag types.
|
|
226
|
+
*/
|
|
227
|
+
shouldAcceptItemDrop?: (target: ItemDropTarget, types: DragTypes) => boolean
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
export interface DroppableCollectionBaseProps {
|
|
224
231
|
/** Handler that is called when a valid drag enters a drop target. */
|
|
225
232
|
onDropEnter?: (e: DroppableCollectionEnterEvent) => void,
|
|
226
|
-
/**
|
|
233
|
+
/**
|
|
234
|
+
* Handler that is called after a valid drag is held over a drop target for a period of time.
|
|
235
|
+
* @private
|
|
236
|
+
*/
|
|
227
237
|
onDropActivate?: (e: DroppableCollectionActivateEvent) => void,
|
|
228
238
|
/** Handler that is called when a valid drag exits a drop target. */
|
|
229
239
|
onDropExit?: (e: DroppableCollectionExitEvent) => void,
|
|
@@ -232,10 +242,6 @@ export interface DroppableCollectionProps {
|
|
|
232
242
|
* drop handlers such as `onInsert`, and `onItemDrop`.
|
|
233
243
|
*/
|
|
234
244
|
onDrop?: (e: DroppableCollectionDropEvent) => void,
|
|
235
|
-
/**
|
|
236
|
-
* A function returning whether a given target in the droppable collection is a valid "on" drop target for the current drag types.
|
|
237
|
-
*/
|
|
238
|
-
shouldAcceptItemDrop?: (target: ItemDropTarget, types: DragTypes) => boolean,
|
|
239
245
|
/**
|
|
240
246
|
* A function returning the drop operation to be performed when items matching the given types are dropped
|
|
241
247
|
* on the drop target.
|
|
@@ -243,6 +249,8 @@ export interface DroppableCollectionProps {
|
|
|
243
249
|
getDropOperation?: (target: DropTarget, types: DragTypes, allowedOperations: DropOperation[]) => DropOperation
|
|
244
250
|
}
|
|
245
251
|
|
|
252
|
+
export interface DroppableCollectionProps extends DroppableCollectionUtilityOptions, DroppableCollectionBaseProps {}
|
|
253
|
+
|
|
246
254
|
interface DraggableCollectionStartEvent extends DragStartEvent {
|
|
247
255
|
/** The keys of the items that were dragged. */
|
|
248
256
|
keys: Set<Key>
|