@react-types/shared 3.14.0 → 3.14.1
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 -5
- package/src/dom.d.ts +2 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@react-types/shared",
|
|
3
|
-
"version": "3.14.
|
|
3
|
+
"version": "3.14.1",
|
|
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": "b03ef51e6317547dd0a840f151e59d039b1e1fd3"
|
|
18
18
|
}
|
package/src/dnd.d.ts
CHANGED
|
@@ -118,21 +118,30 @@ export interface DragTypes {
|
|
|
118
118
|
has(type: string): boolean
|
|
119
119
|
}
|
|
120
120
|
|
|
121
|
+
export interface DropTargetDelegate {
|
|
122
|
+
/**
|
|
123
|
+
* Returns a drop target within a collection for the given x and y coordinates.
|
|
124
|
+
* The point is provided relative to the top left corner of the collection container.
|
|
125
|
+
* A drop target can be checked to see if it is valid using the provided `isValidDropTarget` function.
|
|
126
|
+
*/
|
|
127
|
+
getDropTargetFromPoint(x: number, y: number, isValidDropTarget: (target: DropTarget) => boolean): DropTarget | null
|
|
128
|
+
}
|
|
129
|
+
|
|
121
130
|
export interface DroppableCollectionProps {
|
|
122
131
|
/**
|
|
123
132
|
* A function returning the drop operation to be performed when items matching the given types are dropped
|
|
124
133
|
* on the drop target.
|
|
125
134
|
*/
|
|
126
135
|
getDropOperation?: (target: DropTarget, types: DragTypes, allowedOperations: DropOperation[]) => DropOperation,
|
|
127
|
-
/** Handler that is called when a valid drag
|
|
136
|
+
/** Handler that is called when a valid drag enters the drop target. */
|
|
128
137
|
onDropEnter?: (e: DroppableCollectionEnterEvent) => void,
|
|
129
|
-
/** Handler that is called when a valid drag
|
|
138
|
+
/** Handler that is called when a valid drag is moved within the drop target. */
|
|
130
139
|
onDropMove?: (e: DroppableCollectionMoveEvent) => void,
|
|
131
|
-
/** Handler that is called after a valid drag
|
|
140
|
+
/** Handler that is called after a valid drag is held over the drop target for a period of time. */
|
|
132
141
|
onDropActivate?: (e: DroppableCollectionActivateEvent) => void,
|
|
133
|
-
/** Handler that is called when a valid drag
|
|
142
|
+
/** Handler that is called when a valid drag exits the drop target. */
|
|
134
143
|
onDropExit?: (e: DroppableCollectionExitEvent) => void,
|
|
135
|
-
/** Handler that is called when a valid drag
|
|
144
|
+
/** Handler that is called when a valid drag is dropped on the drop target. */
|
|
136
145
|
onDrop?: (e: DroppableCollectionDropEvent) => void
|
|
137
146
|
}
|
|
138
147
|
|
package/src/dom.d.ts
CHANGED
|
@@ -173,5 +173,6 @@ export interface DOMAttributes<T = FocusableElement> extends AriaAttributes, Rea
|
|
|
173
173
|
id?: string | undefined,
|
|
174
174
|
role?: AriaRole | undefined,
|
|
175
175
|
tabIndex?: number | undefined,
|
|
176
|
-
style?: CSSProperties | undefined
|
|
176
|
+
style?: CSSProperties | undefined,
|
|
177
|
+
className?: string | undefined
|
|
177
178
|
}
|