@react-types/shared 3.13.1 → 3.14.0
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 +15 -0
- package/src/dom.d.ts +15 -0
- package/src/events.d.ts +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@react-types/shared",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.14.0",
|
|
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": "cd7c0ec917122c7612f653c22f8ed558f8b66ecd"
|
|
18
18
|
}
|
package/src/dnd.d.ts
CHANGED
|
@@ -119,11 +119,20 @@ export interface DragTypes {
|
|
|
119
119
|
}
|
|
120
120
|
|
|
121
121
|
export interface DroppableCollectionProps {
|
|
122
|
+
/**
|
|
123
|
+
* A function returning the drop operation to be performed when items matching the given types are dropped
|
|
124
|
+
* on the drop target.
|
|
125
|
+
*/
|
|
122
126
|
getDropOperation?: (target: DropTarget, types: DragTypes, allowedOperations: DropOperation[]) => DropOperation,
|
|
127
|
+
/** Handler that is called when a valid drag element enters the drop target. */
|
|
123
128
|
onDropEnter?: (e: DroppableCollectionEnterEvent) => void,
|
|
129
|
+
/** Handler that is called when a valid drag element is moved within the drop target. */
|
|
124
130
|
onDropMove?: (e: DroppableCollectionMoveEvent) => void,
|
|
131
|
+
/** Handler that is called after a valid drag element is held over the drop target for a period of time. */
|
|
125
132
|
onDropActivate?: (e: DroppableCollectionActivateEvent) => void,
|
|
133
|
+
/** Handler that is called when a valid drag element exits the drop target. */
|
|
126
134
|
onDropExit?: (e: DroppableCollectionExitEvent) => void,
|
|
135
|
+
/** Handler that is called when a valid drag element is dropped on the drop target. */
|
|
127
136
|
onDrop?: (e: DroppableCollectionDropEvent) => void
|
|
128
137
|
}
|
|
129
138
|
|
|
@@ -142,10 +151,16 @@ interface DraggableCollectionEndEvent extends DragEndEvent {
|
|
|
142
151
|
export type DragPreviewRenderer = (items: DragItem[], callback: (node: HTMLElement) => void) => void;
|
|
143
152
|
|
|
144
153
|
export interface DraggableCollectionProps {
|
|
154
|
+
/** Handler that is called when a drag operation is started. */
|
|
145
155
|
onDragStart?: (e: DraggableCollectionStartEvent) => void,
|
|
156
|
+
/** Handler that is called when the dragged element is moved. */
|
|
146
157
|
onDragMove?: (e: DraggableCollectionMoveEvent) => void,
|
|
158
|
+
/** Handler that is called when the drag operation is ended, either as a result of a drop or a cancellation. */
|
|
147
159
|
onDragEnd?: (e: DraggableCollectionEndEvent) => void,
|
|
160
|
+
/** A function that returns the items being dragged. */
|
|
148
161
|
getItems: (keys: Set<Key>) => DragItem[],
|
|
162
|
+
/** The ref of the element that will be rendered as the drag preview while dragging. */
|
|
149
163
|
preview?: RefObject<DragPreviewRenderer>,
|
|
164
|
+
/** Function that returns the drop operations that are allowed for the dragged items. If not provided, all drop operations are allowed. */
|
|
150
165
|
getAllowedDropOperations?: () => DropOperation[]
|
|
151
166
|
}
|
package/src/dom.d.ts
CHANGED
|
@@ -11,9 +11,13 @@
|
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
13
|
import {
|
|
14
|
+
AriaAttributes,
|
|
15
|
+
AriaRole,
|
|
14
16
|
ClipboardEventHandler,
|
|
15
17
|
CompositionEventHandler,
|
|
18
|
+
CSSProperties,
|
|
16
19
|
FormEventHandler,
|
|
20
|
+
DOMAttributes as ReactDOMAttributes,
|
|
17
21
|
ReactEventHandler
|
|
18
22
|
} from 'react';
|
|
19
23
|
|
|
@@ -160,3 +164,14 @@ export interface TextInputDOMProps extends DOMProps, TextInputDOMEvents {
|
|
|
160
164
|
*/
|
|
161
165
|
inputMode?: 'none' | 'text' | 'tel' | 'url' | 'email' | 'numeric' | 'decimal' | 'search'
|
|
162
166
|
}
|
|
167
|
+
|
|
168
|
+
/** Any focusable element, including both HTML and SVG elements. */
|
|
169
|
+
export interface FocusableElement extends Element, HTMLOrSVGElement {}
|
|
170
|
+
|
|
171
|
+
/** All DOM attributes supported across both HTML and SVG elements. */
|
|
172
|
+
export interface DOMAttributes<T = FocusableElement> extends AriaAttributes, ReactDOMAttributes<T> {
|
|
173
|
+
id?: string | undefined,
|
|
174
|
+
role?: AriaRole | undefined,
|
|
175
|
+
tabIndex?: number | undefined,
|
|
176
|
+
style?: CSSProperties | undefined
|
|
177
|
+
}
|
package/src/events.d.ts
CHANGED
|
@@ -34,7 +34,7 @@ export interface PressEvent {
|
|
|
34
34
|
/** The pointer type that triggered the press event. */
|
|
35
35
|
pointerType: PointerType,
|
|
36
36
|
/** The target element of the press event. */
|
|
37
|
-
target:
|
|
37
|
+
target: Element,
|
|
38
38
|
/** Whether the shift keyboard modifier was held during the press event. */
|
|
39
39
|
shiftKey: boolean,
|
|
40
40
|
/** Whether the ctrl keyboard modifier was held during the press event. */
|