@react-types/shared 3.31.0 → 3.32.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/collections.d.ts +1 -1
- package/src/dnd.d.ts +2 -2
- package/src/dom.d.ts +1 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@react-types/shared",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.32.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": "0bda51183baa23306342af32a82012ea0fe0f2dc"
|
|
18
18
|
}
|
package/src/collections.d.ts
CHANGED
|
@@ -183,7 +183,7 @@ export interface Collection<T> extends Iterable<T> {
|
|
|
183
183
|
getTextValue?(key: Key): string,
|
|
184
184
|
|
|
185
185
|
/** Filters the collection using the given function. */
|
|
186
|
-
|
|
186
|
+
filter?(filterFn: (nodeValue: string, node: T) => boolean): Collection<T>
|
|
187
187
|
}
|
|
188
188
|
|
|
189
189
|
export interface Node<T> {
|
package/src/dnd.d.ts
CHANGED
|
@@ -277,7 +277,7 @@ export interface DraggableCollectionEndEvent extends DragEndEvent {
|
|
|
277
277
|
|
|
278
278
|
export type DragPreviewRenderer = (items: DragItem[], callback: (node: HTMLElement | null, x?: number, y?: number) => void) => void;
|
|
279
279
|
|
|
280
|
-
export interface DraggableCollectionProps {
|
|
280
|
+
export interface DraggableCollectionProps<T = object> {
|
|
281
281
|
/** Handler that is called when a drag operation is started. */
|
|
282
282
|
onDragStart?: (e: DraggableCollectionStartEvent) => void,
|
|
283
283
|
/** Handler that is called when the drag is moved. */
|
|
@@ -285,7 +285,7 @@ export interface DraggableCollectionProps {
|
|
|
285
285
|
/** Handler that is called when the drag operation is ended, either as a result of a drop or a cancellation. */
|
|
286
286
|
onDragEnd?: (e: DraggableCollectionEndEvent) => void,
|
|
287
287
|
/** A function that returns the items being dragged. */
|
|
288
|
-
getItems: (keys: Set<Key
|
|
288
|
+
getItems: (keys: Set<Key>, items: T[]) => DragItem[],
|
|
289
289
|
/** The ref of the element that will be rendered as the drag preview while dragging. */
|
|
290
290
|
preview?: RefObject<DragPreviewRenderer | null>,
|
|
291
291
|
/** Function that returns the drop operations that are allowed for the dragged items. If not provided, all drop operations are allowed. */
|
package/src/dom.d.ts
CHANGED
|
@@ -173,6 +173,7 @@ export interface TextInputDOMProps extends DOMProps, InputDOMProps, TextInputDOM
|
|
|
173
173
|
|
|
174
174
|
/**
|
|
175
175
|
* The type of input to render. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdeftype).
|
|
176
|
+
* @default 'text'
|
|
176
177
|
*/
|
|
177
178
|
type?: 'text' | 'search' | 'url' | 'tel' | 'email' | 'password' | (string & {}),
|
|
178
179
|
|