@react-types/shared 3.9.0 → 3.11.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/dom.d.ts +7 -2
- package/src/events.d.ts +14 -1
- package/src/index.d.ts +0 -1
- package/src/selection.d.ts +7 -1
- package/src/splitview.d.ts +0 -83
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@react-types/shared",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.11.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": "404d41859b7d6f56201d7fc01bd9f22ae3512937"
|
|
18
18
|
}
|
package/src/dom.d.ts
CHANGED
|
@@ -10,7 +10,12 @@
|
|
|
10
10
|
* governing permissions and limitations under the License.
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
|
-
import {
|
|
13
|
+
import {
|
|
14
|
+
ClipboardEventHandler,
|
|
15
|
+
CompositionEventHandler,
|
|
16
|
+
FormEventHandler,
|
|
17
|
+
ReactEventHandler
|
|
18
|
+
} from 'react';
|
|
14
19
|
|
|
15
20
|
export interface AriaLabelingProps {
|
|
16
21
|
/**
|
|
@@ -125,7 +130,7 @@ export interface TextInputDOMProps extends DOMProps {
|
|
|
125
130
|
* Handler that is called when a text composition system starts a new text composition session. See [MDN](https://developer.mozilla.org/en-US/docs/Web/API/Element/compositionstart_event).
|
|
126
131
|
*/
|
|
127
132
|
onCompositionStart?: CompositionEventHandler<HTMLInputElement>,
|
|
128
|
-
|
|
133
|
+
|
|
129
134
|
/**
|
|
130
135
|
* Handler that is called when a text composition system completes or cancels the current text composition session. See [MDN](https://developer.mozilla.org/en-US/docs/Web/API/Element/compositionend_event).
|
|
131
136
|
*/
|
package/src/events.d.ts
CHANGED
|
@@ -45,6 +45,11 @@ export interface PressEvent {
|
|
|
45
45
|
altKey: boolean
|
|
46
46
|
}
|
|
47
47
|
|
|
48
|
+
export interface LongPressEvent extends Omit<PressEvent, 'type'> {
|
|
49
|
+
/** The type of long press event being fired. */
|
|
50
|
+
type: 'longpressstart' | 'longpressend' | 'longpress'
|
|
51
|
+
}
|
|
52
|
+
|
|
48
53
|
export interface HoverEvent {
|
|
49
54
|
/** The type of hover event being fired. */
|
|
50
55
|
type: 'hoverstart' | 'hoverend',
|
|
@@ -105,7 +110,15 @@ export interface FocusableProps extends FocusEvents, KeyboardEvents {
|
|
|
105
110
|
|
|
106
111
|
interface BaseMoveEvent {
|
|
107
112
|
/** The pointer type that triggered the move event. */
|
|
108
|
-
pointerType: PointerType
|
|
113
|
+
pointerType: PointerType,
|
|
114
|
+
/** Whether the shift keyboard modifier was held during the move event. */
|
|
115
|
+
shiftKey: boolean,
|
|
116
|
+
/** Whether the ctrl keyboard modifier was held during the move event. */
|
|
117
|
+
ctrlKey: boolean,
|
|
118
|
+
/** Whether the meta keyboard modifier was held during the move event. */
|
|
119
|
+
metaKey: boolean,
|
|
120
|
+
/** Whether the alt keyboard modifier was held during the move event. */
|
|
121
|
+
altKey: boolean
|
|
109
122
|
}
|
|
110
123
|
|
|
111
124
|
export interface MoveStartEvent extends BaseMoveEvent {
|
package/src/index.d.ts
CHANGED
package/src/selection.d.ts
CHANGED
|
@@ -16,7 +16,7 @@ export interface SingleSelection {
|
|
|
16
16
|
/** Whether the collection allows empty selection. */
|
|
17
17
|
disallowEmptySelection?: boolean,
|
|
18
18
|
/** The currently selected key in the collection (controlled). */
|
|
19
|
-
selectedKey?: Key,
|
|
19
|
+
selectedKey?: Key | null,
|
|
20
20
|
/** The initial selected key in the collection (uncontrolled). */
|
|
21
21
|
defaultSelectedKey?: Key,
|
|
22
22
|
/** Handler that is called when the selection changes. */
|
|
@@ -24,6 +24,7 @@ export interface SingleSelection {
|
|
|
24
24
|
}
|
|
25
25
|
|
|
26
26
|
export type SelectionMode = 'none' | 'single' | 'multiple';
|
|
27
|
+
export type SelectionBehavior = 'toggle' | 'replace';
|
|
27
28
|
export type Selection = 'all' | Set<Key>;
|
|
28
29
|
export interface MultipleSelection {
|
|
29
30
|
/** The type of selection that is allowed in the collection. */
|
|
@@ -40,4 +41,9 @@ export interface MultipleSelection {
|
|
|
40
41
|
disabledKeys?: Iterable<Key>
|
|
41
42
|
}
|
|
42
43
|
|
|
44
|
+
export interface SpectrumSelectionProps {
|
|
45
|
+
/** How selection should be displayed. */
|
|
46
|
+
selectionStyle?: 'checkbox' | 'highlight'
|
|
47
|
+
}
|
|
48
|
+
|
|
43
49
|
export type FocusStrategy = 'first' | 'last';
|
package/src/splitview.d.ts
DELETED
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright 2020 Adobe. All rights reserved.
|
|
3
|
-
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
4
|
-
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
5
|
-
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
6
|
-
*
|
|
7
|
-
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
8
|
-
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
9
|
-
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
10
|
-
* governing permissions and limitations under the License.
|
|
11
|
-
*/
|
|
12
|
-
|
|
13
|
-
import {
|
|
14
|
-
Dispatch,
|
|
15
|
-
MutableRefObject,
|
|
16
|
-
ReactElement,
|
|
17
|
-
SetStateAction
|
|
18
|
-
} from 'react';
|
|
19
|
-
import {Orientation} from './orientation';
|
|
20
|
-
|
|
21
|
-
export interface SplitViewStatelyProps {
|
|
22
|
-
allowsCollapsing?: boolean,
|
|
23
|
-
onResize?: (primarySize: number) => void,
|
|
24
|
-
onResizeEnd?: (primarySize: number) => void,
|
|
25
|
-
primarySize?: number,
|
|
26
|
-
defaultPrimarySize?: number
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
export interface SplitViewHandleState {
|
|
30
|
-
offset: number,
|
|
31
|
-
dragging: boolean,
|
|
32
|
-
hovered: boolean,
|
|
33
|
-
setOffset: (value: number) => void,
|
|
34
|
-
setDragging: (value: boolean) => void,
|
|
35
|
-
setHover: (value: boolean) => void,
|
|
36
|
-
increment: () => void,
|
|
37
|
-
decrement: () => void,
|
|
38
|
-
incrementToMax: () => void,
|
|
39
|
-
decrementToMin: () => void,
|
|
40
|
-
collapseToggle: () => void
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
export interface SplitViewContainerState {
|
|
44
|
-
minPos: number,
|
|
45
|
-
maxPos: number,
|
|
46
|
-
setMinPos: Dispatch<SetStateAction<number>>,
|
|
47
|
-
setMaxPos: Dispatch<SetStateAction<number>>
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
export interface SplitViewState {
|
|
51
|
-
handleState: SplitViewHandleState,
|
|
52
|
-
containerState: SplitViewContainerState
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
export interface SplitViewAriaProps {
|
|
56
|
-
id?: string,
|
|
57
|
-
allowsResizing?: boolean,
|
|
58
|
-
orientation?: Orientation,
|
|
59
|
-
primaryPane?: 0 | 1,
|
|
60
|
-
primaryMinSize?: number,
|
|
61
|
-
primaryMaxSize?: number,
|
|
62
|
-
secondaryMinSize?: number,
|
|
63
|
-
secondaryMaxSize?: number,
|
|
64
|
-
'aria-label'?: string,
|
|
65
|
-
'aria-labelledby'?: string,
|
|
66
|
-
containerRef?: MutableRefObject<HTMLDivElement>
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
export interface SplitViewProps {
|
|
70
|
-
children: [ReactElement, ReactElement],
|
|
71
|
-
orientation?: Orientation,
|
|
72
|
-
allowsResizing?: boolean,
|
|
73
|
-
allowsCollapsing?: boolean,
|
|
74
|
-
onResize?: (primarySize: number) => void,
|
|
75
|
-
onResizeEnd?: (primarySize: number) => void,
|
|
76
|
-
primaryPane?: 0 | 1,
|
|
77
|
-
primarySize?: number,
|
|
78
|
-
defaultPrimarySize?: number,
|
|
79
|
-
primaryMinSize?: number,
|
|
80
|
-
primaryMaxSize?: number,
|
|
81
|
-
secondaryMinSize?: number,
|
|
82
|
-
secondaryMaxSize?: number
|
|
83
|
-
}
|