@react-types/shared 3.33.1 → 3.35.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 +9 -6
- package/src/collections.d.ts +87 -73
- package/src/dna.d.ts +9 -40
- package/src/dnd.d.ts +105 -84
- package/src/dom.d.ts +279 -170
- package/src/events.d.ts +54 -58
- package/src/inputs.d.ts +32 -27
- package/src/labelable.d.ts +9 -6
- package/src/refs.d.ts +10 -5
- package/src/removable.d.ts +2 -2
- package/src/selection.d.ts +11 -11
- package/src/style.d.ts +504 -180
package/src/dom.d.ts
CHANGED
|
@@ -17,39 +17,44 @@ import {
|
|
|
17
17
|
ClipboardEventHandler,
|
|
18
18
|
CompositionEventHandler,
|
|
19
19
|
CSSProperties,
|
|
20
|
+
FormEvent,
|
|
20
21
|
FormEventHandler,
|
|
22
|
+
FormHTMLAttributes,
|
|
21
23
|
HTMLAttributeAnchorTarget,
|
|
22
24
|
HTMLAttributeReferrerPolicy,
|
|
23
25
|
MouseEventHandler,
|
|
24
26
|
PointerEventHandler,
|
|
25
27
|
DOMAttributes as ReactDOMAttributes,
|
|
26
28
|
ReactEventHandler,
|
|
29
|
+
RefAttributes,
|
|
27
30
|
TouchEventHandler,
|
|
28
31
|
TransitionEventHandler,
|
|
29
32
|
UIEventHandler,
|
|
30
33
|
WheelEventHandler
|
|
31
34
|
} from 'react';
|
|
35
|
+
import {ValidationErrors} from './inputs';
|
|
32
36
|
|
|
33
37
|
export interface AriaLabelingProps {
|
|
34
38
|
/**
|
|
35
39
|
* Defines a string value that labels the current element.
|
|
36
40
|
*/
|
|
37
|
-
'aria-label'?: string
|
|
41
|
+
'aria-label'?: string;
|
|
38
42
|
|
|
39
43
|
/**
|
|
40
44
|
* Identifies the element (or elements) that labels the current element.
|
|
41
45
|
*/
|
|
42
|
-
'aria-labelledby'?: string
|
|
46
|
+
'aria-labelledby'?: string;
|
|
43
47
|
|
|
44
48
|
/**
|
|
45
49
|
* Identifies the element (or elements) that describes the object.
|
|
46
50
|
*/
|
|
47
|
-
'aria-describedby'?: string
|
|
51
|
+
'aria-describedby'?: string;
|
|
48
52
|
|
|
49
53
|
/**
|
|
50
|
-
* Identifies the element (or elements) that provide a detailed, extended description for the
|
|
54
|
+
* Identifies the element (or elements) that provide a detailed, extended description for the
|
|
55
|
+
* object.
|
|
51
56
|
*/
|
|
52
|
-
'aria-details'?: string
|
|
57
|
+
'aria-details'?: string;
|
|
53
58
|
}
|
|
54
59
|
|
|
55
60
|
export interface AriaValidationProps {
|
|
@@ -57,16 +62,17 @@ export interface AriaValidationProps {
|
|
|
57
62
|
/**
|
|
58
63
|
* Identifies the element that provides an error message for the object.
|
|
59
64
|
*/
|
|
60
|
-
'aria-errormessage'?: string
|
|
65
|
+
'aria-errormessage'?: string;
|
|
61
66
|
}
|
|
62
67
|
|
|
63
68
|
// A set of common DOM props that are allowed on any component
|
|
64
69
|
// Ensure this is synced with DOMPropNames in filterDOMProps
|
|
65
70
|
export interface DOMProps {
|
|
66
71
|
/**
|
|
67
|
-
* The element's unique identifier. See
|
|
72
|
+
* The element's unique identifier. See
|
|
73
|
+
* [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/id).
|
|
68
74
|
*/
|
|
69
|
-
id?: string
|
|
75
|
+
id?: string;
|
|
70
76
|
}
|
|
71
77
|
|
|
72
78
|
export interface FocusableDOMProps extends DOMProps {
|
|
@@ -76,126 +82,151 @@ export interface FocusableDOMProps extends DOMProps {
|
|
|
76
82
|
* be avoided except in rare scenarios where an alternative means of accessing
|
|
77
83
|
* the element or its functionality via the keyboard is available.
|
|
78
84
|
*/
|
|
79
|
-
excludeFromTabOrder?: boolean
|
|
85
|
+
excludeFromTabOrder?: boolean;
|
|
80
86
|
}
|
|
81
87
|
|
|
82
|
-
|
|
83
|
-
export interface TextInputDOMEvents {
|
|
88
|
+
export interface TextInputDOMEvents<T = HTMLInputElement> {
|
|
84
89
|
// Clipboard events
|
|
85
90
|
/**
|
|
86
|
-
* Handler that is called when the user copies text. See
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
91
|
+
* Handler that is called when the user copies text. See
|
|
92
|
+
* [MDN](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/oncopy).
|
|
93
|
+
*/
|
|
94
|
+
onCopy?: ClipboardEventHandler<T>;
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* Handler that is called when the user cuts text. See
|
|
98
|
+
* [MDN](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/oncut).
|
|
99
|
+
*/
|
|
100
|
+
onCut?: ClipboardEventHandler<T>;
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
* Handler that is called when the user pastes text. See
|
|
104
|
+
* [MDN](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/onpaste).
|
|
105
|
+
*/
|
|
106
|
+
onPaste?: ClipboardEventHandler<T>;
|
|
107
|
+
|
|
108
|
+
// Composition events
|
|
109
|
+
/**
|
|
110
|
+
* Handler that is called when a text composition system starts a new text composition session.
|
|
111
|
+
* See [MDN](https://developer.mozilla.org/en-US/docs/Web/API/Element/compositionstart_event).
|
|
112
|
+
*/
|
|
113
|
+
onCompositionStart?: CompositionEventHandler<T>;
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* Handler that is called when a text composition system completes or cancels the current text
|
|
117
|
+
* composition session. See
|
|
118
|
+
* [MDN](https://developer.mozilla.org/en-US/docs/Web/API/Element/compositionend_event).
|
|
119
|
+
*/
|
|
120
|
+
onCompositionEnd?: CompositionEventHandler<T>;
|
|
121
|
+
|
|
122
|
+
/**
|
|
123
|
+
* Handler that is called when a new character is received in the current text composition
|
|
124
|
+
* session. See
|
|
125
|
+
* [MDN](https://developer.mozilla.org/en-US/docs/Web/API/Element/compositionupdate_event).
|
|
126
|
+
*/
|
|
127
|
+
onCompositionUpdate?: CompositionEventHandler<T>;
|
|
128
|
+
|
|
129
|
+
// Selection events
|
|
130
|
+
/**
|
|
131
|
+
* Handler that is called when text in the input is selected. See
|
|
132
|
+
* [MDN](https://developer.mozilla.org/en-US/docs/Web/API/Element/select_event).
|
|
133
|
+
*/
|
|
134
|
+
onSelect?: ReactEventHandler<T>;
|
|
135
|
+
|
|
136
|
+
// Input events
|
|
137
|
+
/**
|
|
138
|
+
* Handler that is called when the input value is about to be modified. See
|
|
139
|
+
* [MDN](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/beforeinput_event).
|
|
140
|
+
*/
|
|
141
|
+
onBeforeInput?: FormEventHandler<T>;
|
|
142
|
+
/**
|
|
143
|
+
* Handler that is called when the input value is modified. See
|
|
144
|
+
* [MDN](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event).
|
|
145
|
+
*/
|
|
146
|
+
onInput?: FormEventHandler<T>;
|
|
131
147
|
}
|
|
132
148
|
|
|
133
149
|
export interface InputDOMProps {
|
|
134
150
|
/**
|
|
135
|
-
* The name of the input element, used when submitting an HTML form. See
|
|
151
|
+
* The name of the input element, used when submitting an HTML form. See
|
|
152
|
+
* [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefname).
|
|
136
153
|
*/
|
|
137
|
-
name?: string
|
|
154
|
+
name?: string;
|
|
138
155
|
/**
|
|
139
156
|
* The `<form>` element to associate the input with.
|
|
140
157
|
* The value of this attribute must be the id of a `<form>` in the same document.
|
|
141
158
|
* See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/input#form).
|
|
142
159
|
*/
|
|
143
|
-
form?: string
|
|
160
|
+
form?: string;
|
|
144
161
|
}
|
|
145
162
|
|
|
146
163
|
// DOM props that apply to all text inputs
|
|
147
164
|
// Ensure this is synced with useTextField
|
|
148
|
-
export interface TextInputDOMProps
|
|
165
|
+
export interface TextInputDOMProps<T = HTMLInputElement>
|
|
166
|
+
extends DOMProps, InputDOMProps, TextInputDOMEvents<T> {
|
|
149
167
|
/**
|
|
150
|
-
* Describes the type of autocomplete functionality the input should provide if any. See
|
|
168
|
+
* Describes the type of autocomplete functionality the input should provide if any. See
|
|
169
|
+
* [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefautocomplete).
|
|
151
170
|
*/
|
|
152
|
-
autoComplete?: string
|
|
171
|
+
autoComplete?: string;
|
|
153
172
|
|
|
154
173
|
/**
|
|
155
|
-
* The maximum number of characters supported by the input. See
|
|
174
|
+
* The maximum number of characters supported by the input. See
|
|
175
|
+
* [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefmaxlength).
|
|
156
176
|
*/
|
|
157
|
-
maxLength?: number
|
|
177
|
+
maxLength?: number;
|
|
158
178
|
|
|
159
179
|
/**
|
|
160
|
-
* The minimum number of characters required by the input. See
|
|
180
|
+
* The minimum number of characters required by the input. See
|
|
181
|
+
* [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefminlength).
|
|
161
182
|
*/
|
|
162
|
-
minLength?: number
|
|
183
|
+
minLength?: number;
|
|
163
184
|
|
|
164
185
|
/**
|
|
165
|
-
* Regex pattern that the value of the input must match to be valid. See
|
|
186
|
+
* Regex pattern that the value of the input must match to be valid. See
|
|
187
|
+
* [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefpattern).
|
|
166
188
|
*/
|
|
167
|
-
pattern?: string
|
|
189
|
+
pattern?: string;
|
|
168
190
|
|
|
169
191
|
/**
|
|
170
|
-
* Content that appears in the input when it is empty. See
|
|
192
|
+
* Content that appears in the input when it is empty. See
|
|
193
|
+
* [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefplaceholder).
|
|
171
194
|
*/
|
|
172
|
-
placeholder?: string
|
|
195
|
+
placeholder?: string;
|
|
173
196
|
|
|
174
197
|
/**
|
|
175
|
-
* The type of input to render. See
|
|
198
|
+
* The type of input to render. See
|
|
199
|
+
* [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdeftype).
|
|
200
|
+
*
|
|
176
201
|
* @default 'text'
|
|
177
202
|
*/
|
|
178
|
-
type?: 'text' | 'search' | 'url' | 'tel' | 'email' | 'password' | (string & {})
|
|
203
|
+
type?: 'text' | 'search' | 'url' | 'tel' | 'email' | 'password' | (string & {});
|
|
179
204
|
|
|
180
205
|
/**
|
|
181
|
-
* Hints at the type of data that might be entered by the user while editing the element or its
|
|
206
|
+
* Hints at the type of data that might be entered by the user while editing the element or its
|
|
207
|
+
* contents. See
|
|
208
|
+
* [MDN](https://html.spec.whatwg.org/multipage/interaction.html#input-modalities:-the-inputmode-attribute).
|
|
182
209
|
*/
|
|
183
|
-
inputMode?: 'none' | 'text' | 'tel' | 'url' | 'email' | 'numeric' | 'decimal' | 'search'
|
|
210
|
+
inputMode?: 'none' | 'text' | 'tel' | 'url' | 'email' | 'numeric' | 'decimal' | 'search';
|
|
184
211
|
|
|
185
212
|
/**
|
|
186
|
-
* An attribute that takes as its value a space-separated string that describes what, if any, type
|
|
213
|
+
* An attribute that takes as its value a space-separated string that describes what, if any, type
|
|
214
|
+
* of autocomplete functionality the input should provide. See
|
|
215
|
+
* [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#autocomplete).
|
|
187
216
|
*/
|
|
188
|
-
autoCorrect?: string
|
|
217
|
+
autoCorrect?: string;
|
|
189
218
|
|
|
190
219
|
/**
|
|
191
|
-
* An enumerated attribute that defines whether the element may be checked for spelling errors.
|
|
220
|
+
* An enumerated attribute that defines whether the element may be checked for spelling errors.
|
|
221
|
+
* See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/spellcheck).
|
|
192
222
|
*/
|
|
193
|
-
spellCheck?: string
|
|
223
|
+
spellCheck?: string;
|
|
194
224
|
}
|
|
195
225
|
|
|
196
226
|
/**
|
|
197
|
-
* This type allows configuring link props with router options and type-safe URLs via TS module
|
|
198
|
-
* By default, this is an empty type. Extend with `href` and `routerOptions`
|
|
227
|
+
* This type allows configuring link props with router options and type-safe URLs via TS module
|
|
228
|
+
* augmentation. By default, this is an empty type. Extend with `href` and `routerOptions`
|
|
229
|
+
* properties to configure your router.
|
|
199
230
|
*/
|
|
200
231
|
export interface RouterConfig {}
|
|
201
232
|
|
|
@@ -205,21 +236,39 @@ export type RouterOptions = RouterConfig extends {routerOptions: infer O} ? O :
|
|
|
205
236
|
// Make sure to update filterDOMProps.ts when updating this.
|
|
206
237
|
export interface LinkDOMProps {
|
|
207
238
|
/** A URL to link to. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#href). */
|
|
208
|
-
href?: Href
|
|
209
|
-
/**
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
/**
|
|
220
|
-
|
|
239
|
+
href?: Href;
|
|
240
|
+
/**
|
|
241
|
+
* Hints at the human language of the linked URL.
|
|
242
|
+
* See[MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#hreflang).
|
|
243
|
+
*/
|
|
244
|
+
hrefLang?: string;
|
|
245
|
+
/**
|
|
246
|
+
* The target window for the link. See
|
|
247
|
+
* [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#target).
|
|
248
|
+
*/
|
|
249
|
+
target?: HTMLAttributeAnchorTarget;
|
|
250
|
+
/**
|
|
251
|
+
* The relationship between the linked resource and the current page. See
|
|
252
|
+
* [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/rel).
|
|
253
|
+
*/
|
|
254
|
+
rel?: string;
|
|
255
|
+
/**
|
|
256
|
+
* Causes the browser to download the linked URL. A string may be provided to suggest a file name.
|
|
257
|
+
* See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#download).
|
|
258
|
+
*/
|
|
259
|
+
download?: boolean | string;
|
|
260
|
+
/**
|
|
261
|
+
* A space-separated list of URLs to ping when the link is followed. See
|
|
262
|
+
* [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#ping).
|
|
263
|
+
*/
|
|
264
|
+
ping?: string;
|
|
265
|
+
/**
|
|
266
|
+
* How much of the referrer to send when following the link. See
|
|
267
|
+
* [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#referrerpolicy).
|
|
268
|
+
*/
|
|
269
|
+
referrerPolicy?: HTMLAttributeReferrerPolicy;
|
|
221
270
|
/** Options for the configured client side router. */
|
|
222
|
-
routerOptions?: RouterOptions
|
|
271
|
+
routerOptions?: RouterOptions;
|
|
223
272
|
}
|
|
224
273
|
|
|
225
274
|
/** Any focusable element, including both HTML and SVG elements. */
|
|
@@ -227,117 +276,177 @@ export interface FocusableElement extends Element, HTMLOrSVGElement {}
|
|
|
227
276
|
|
|
228
277
|
/** All DOM attributes supported across both HTML and SVG elements. */
|
|
229
278
|
export interface DOMAttributes<T = FocusableElement> extends AriaAttributes, ReactDOMAttributes<T> {
|
|
230
|
-
id?: string | undefined
|
|
231
|
-
role?: AriaRole | undefined
|
|
232
|
-
tabIndex?: number | undefined
|
|
233
|
-
style?: CSSProperties | undefined
|
|
234
|
-
className?: string | undefined
|
|
279
|
+
id?: string | undefined;
|
|
280
|
+
role?: AriaRole | undefined;
|
|
281
|
+
tabIndex?: number | undefined;
|
|
282
|
+
style?: CSSProperties | undefined;
|
|
283
|
+
className?: string | undefined;
|
|
235
284
|
}
|
|
236
285
|
|
|
286
|
+
export interface DOMAttributesWithRef<T = Element> extends DOMAttributes<T>, RefAttributes<T> {}
|
|
287
|
+
|
|
237
288
|
export interface GroupDOMAttributes extends Omit<DOMAttributes<HTMLElement>, 'role'> {
|
|
238
|
-
role?: 'group' | 'region' | 'presentation'
|
|
289
|
+
role?: 'group' | 'region' | 'presentation';
|
|
239
290
|
}
|
|
240
291
|
|
|
241
292
|
/**
|
|
242
293
|
* Global attributes that can be applied to any DOM element.
|
|
294
|
+
*
|
|
243
295
|
* @private
|
|
244
296
|
*/
|
|
245
297
|
// NOTE: id is handled elsewhere (DOMProps).
|
|
246
298
|
export interface GlobalDOMAttributes<T = Element> extends GlobalDOMEvents<T> {
|
|
247
|
-
dir?: string | undefined
|
|
248
|
-
lang?: string | undefined
|
|
249
|
-
hidden?: boolean | undefined
|
|
250
|
-
inert?: boolean | undefined
|
|
251
|
-
translate?: 'yes' | 'no' | undefined
|
|
299
|
+
dir?: string | undefined;
|
|
300
|
+
lang?: string | undefined;
|
|
301
|
+
hidden?: boolean | undefined;
|
|
302
|
+
inert?: boolean | undefined;
|
|
303
|
+
translate?: 'yes' | 'no' | undefined;
|
|
252
304
|
}
|
|
253
305
|
|
|
254
306
|
/**
|
|
255
307
|
* Global DOM events that are supported on all DOM elements.
|
|
308
|
+
*
|
|
256
309
|
* @private
|
|
257
310
|
*/
|
|
258
311
|
// NOTES:
|
|
259
312
|
// - Drag and drop events are omitted for now.
|
|
260
313
|
// - Keyboard and focus events are supported directly on focusable elements (FocusableProps).
|
|
261
|
-
// - Text input events (e.g. onInput, onCompositionStart, onCopy) are
|
|
314
|
+
// - Text input events (e.g. onInput, onCompositionStart, onCopy) are
|
|
262
315
|
// supported only directly on input elements (TextInputDOMProps).
|
|
263
316
|
// We don't support contentEditable on our components.
|
|
264
317
|
// - Media events should be handled directly on the <video>/<audio><img> element.
|
|
265
318
|
export interface GlobalDOMEvents<T = Element> {
|
|
266
319
|
// MouseEvents
|
|
267
|
-
onClick?: MouseEventHandler<T> | undefined
|
|
268
|
-
onClickCapture?: MouseEventHandler<T> | undefined
|
|
269
|
-
onAuxClick?: MouseEventHandler<T> | undefined
|
|
270
|
-
onAuxClickCapture?: MouseEventHandler<T> | undefined
|
|
271
|
-
onContextMenu?: MouseEventHandler<T> | undefined
|
|
272
|
-
onContextMenuCapture?: MouseEventHandler<T> | undefined
|
|
273
|
-
onDoubleClick?: MouseEventHandler<T> | undefined
|
|
274
|
-
onDoubleClickCapture?: MouseEventHandler<T> | undefined
|
|
275
|
-
onMouseDown?: MouseEventHandler<T> | undefined
|
|
276
|
-
onMouseDownCapture?: MouseEventHandler<T> | undefined
|
|
277
|
-
onMouseEnter?: MouseEventHandler<T> | undefined
|
|
278
|
-
onMouseLeave?: MouseEventHandler<T> | undefined
|
|
279
|
-
onMouseMove?: MouseEventHandler<T> | undefined
|
|
280
|
-
onMouseMoveCapture?: MouseEventHandler<T> | undefined
|
|
281
|
-
onMouseOut?: MouseEventHandler<T> | undefined
|
|
282
|
-
onMouseOutCapture?: MouseEventHandler<T> | undefined
|
|
283
|
-
onMouseOver?: MouseEventHandler<T> | undefined
|
|
284
|
-
onMouseOverCapture?: MouseEventHandler<T> | undefined
|
|
285
|
-
onMouseUp?: MouseEventHandler<T> | undefined
|
|
286
|
-
onMouseUpCapture?: MouseEventHandler<T> | undefined
|
|
320
|
+
onClick?: MouseEventHandler<T> | undefined;
|
|
321
|
+
onClickCapture?: MouseEventHandler<T> | undefined;
|
|
322
|
+
onAuxClick?: MouseEventHandler<T> | undefined;
|
|
323
|
+
onAuxClickCapture?: MouseEventHandler<T> | undefined;
|
|
324
|
+
onContextMenu?: MouseEventHandler<T> | undefined;
|
|
325
|
+
onContextMenuCapture?: MouseEventHandler<T> | undefined;
|
|
326
|
+
onDoubleClick?: MouseEventHandler<T> | undefined;
|
|
327
|
+
onDoubleClickCapture?: MouseEventHandler<T> | undefined;
|
|
328
|
+
onMouseDown?: MouseEventHandler<T> | undefined;
|
|
329
|
+
onMouseDownCapture?: MouseEventHandler<T> | undefined;
|
|
330
|
+
onMouseEnter?: MouseEventHandler<T> | undefined;
|
|
331
|
+
onMouseLeave?: MouseEventHandler<T> | undefined;
|
|
332
|
+
onMouseMove?: MouseEventHandler<T> | undefined;
|
|
333
|
+
onMouseMoveCapture?: MouseEventHandler<T> | undefined;
|
|
334
|
+
onMouseOut?: MouseEventHandler<T> | undefined;
|
|
335
|
+
onMouseOutCapture?: MouseEventHandler<T> | undefined;
|
|
336
|
+
onMouseOver?: MouseEventHandler<T> | undefined;
|
|
337
|
+
onMouseOverCapture?: MouseEventHandler<T> | undefined;
|
|
338
|
+
onMouseUp?: MouseEventHandler<T> | undefined;
|
|
339
|
+
onMouseUpCapture?: MouseEventHandler<T> | undefined;
|
|
287
340
|
|
|
288
341
|
// Touch Events
|
|
289
|
-
onTouchCancel?: TouchEventHandler<T> | undefined
|
|
290
|
-
onTouchCancelCapture?: TouchEventHandler<T> | undefined
|
|
291
|
-
onTouchEnd?: TouchEventHandler<T> | undefined
|
|
292
|
-
onTouchEndCapture?: TouchEventHandler<T> | undefined
|
|
293
|
-
onTouchMove?: TouchEventHandler<T> | undefined
|
|
294
|
-
onTouchMoveCapture?: TouchEventHandler<T> | undefined
|
|
295
|
-
onTouchStart?: TouchEventHandler<T> | undefined
|
|
296
|
-
onTouchStartCapture?: TouchEventHandler<T> | undefined
|
|
342
|
+
onTouchCancel?: TouchEventHandler<T> | undefined;
|
|
343
|
+
onTouchCancelCapture?: TouchEventHandler<T> | undefined;
|
|
344
|
+
onTouchEnd?: TouchEventHandler<T> | undefined;
|
|
345
|
+
onTouchEndCapture?: TouchEventHandler<T> | undefined;
|
|
346
|
+
onTouchMove?: TouchEventHandler<T> | undefined;
|
|
347
|
+
onTouchMoveCapture?: TouchEventHandler<T> | undefined;
|
|
348
|
+
onTouchStart?: TouchEventHandler<T> | undefined;
|
|
349
|
+
onTouchStartCapture?: TouchEventHandler<T> | undefined;
|
|
297
350
|
|
|
298
351
|
// Pointer Events
|
|
299
|
-
onPointerDown?: PointerEventHandler<T> | undefined
|
|
300
|
-
onPointerDownCapture?: PointerEventHandler<T> | undefined
|
|
301
|
-
onPointerMove?: PointerEventHandler<T> | undefined
|
|
302
|
-
onPointerMoveCapture?: PointerEventHandler<T> | undefined
|
|
303
|
-
onPointerUp?: PointerEventHandler<T> | undefined
|
|
304
|
-
onPointerUpCapture?: PointerEventHandler<T> | undefined
|
|
305
|
-
onPointerCancel?: PointerEventHandler<T> | undefined
|
|
306
|
-
onPointerCancelCapture?: PointerEventHandler<T> | undefined
|
|
307
|
-
onPointerEnter?: PointerEventHandler<T> | undefined
|
|
308
|
-
onPointerLeave?: PointerEventHandler<T> | undefined
|
|
309
|
-
onPointerOver?: PointerEventHandler<T> | undefined
|
|
310
|
-
onPointerOverCapture?: PointerEventHandler<T> | undefined
|
|
311
|
-
onPointerOut?: PointerEventHandler<T> | undefined
|
|
312
|
-
onPointerOutCapture?: PointerEventHandler<T> | undefined
|
|
313
|
-
onGotPointerCapture?: PointerEventHandler<T> | undefined
|
|
314
|
-
onGotPointerCaptureCapture?: PointerEventHandler<T> | undefined
|
|
315
|
-
onLostPointerCapture?: PointerEventHandler<T> | undefined
|
|
316
|
-
onLostPointerCaptureCapture?: PointerEventHandler<T> | undefined
|
|
352
|
+
onPointerDown?: PointerEventHandler<T> | undefined;
|
|
353
|
+
onPointerDownCapture?: PointerEventHandler<T> | undefined;
|
|
354
|
+
onPointerMove?: PointerEventHandler<T> | undefined;
|
|
355
|
+
onPointerMoveCapture?: PointerEventHandler<T> | undefined;
|
|
356
|
+
onPointerUp?: PointerEventHandler<T> | undefined;
|
|
357
|
+
onPointerUpCapture?: PointerEventHandler<T> | undefined;
|
|
358
|
+
onPointerCancel?: PointerEventHandler<T> | undefined;
|
|
359
|
+
onPointerCancelCapture?: PointerEventHandler<T> | undefined;
|
|
360
|
+
onPointerEnter?: PointerEventHandler<T> | undefined;
|
|
361
|
+
onPointerLeave?: PointerEventHandler<T> | undefined;
|
|
362
|
+
onPointerOver?: PointerEventHandler<T> | undefined;
|
|
363
|
+
onPointerOverCapture?: PointerEventHandler<T> | undefined;
|
|
364
|
+
onPointerOut?: PointerEventHandler<T> | undefined;
|
|
365
|
+
onPointerOutCapture?: PointerEventHandler<T> | undefined;
|
|
366
|
+
onGotPointerCapture?: PointerEventHandler<T> | undefined;
|
|
367
|
+
onGotPointerCaptureCapture?: PointerEventHandler<T> | undefined;
|
|
368
|
+
onLostPointerCapture?: PointerEventHandler<T> | undefined;
|
|
369
|
+
onLostPointerCaptureCapture?: PointerEventHandler<T> | undefined;
|
|
317
370
|
|
|
318
371
|
// UI Events
|
|
319
|
-
onScroll?: UIEventHandler<T> | undefined
|
|
320
|
-
onScrollCapture?: UIEventHandler<T> | undefined
|
|
372
|
+
onScroll?: UIEventHandler<T> | undefined;
|
|
373
|
+
onScrollCapture?: UIEventHandler<T> | undefined;
|
|
321
374
|
|
|
322
375
|
// Wheel Events
|
|
323
|
-
onWheel?: WheelEventHandler<T> | undefined
|
|
324
|
-
onWheelCapture?: WheelEventHandler<T> | undefined
|
|
376
|
+
onWheel?: WheelEventHandler<T> | undefined;
|
|
377
|
+
onWheelCapture?: WheelEventHandler<T> | undefined;
|
|
325
378
|
|
|
326
379
|
// Animation Events
|
|
327
|
-
onAnimationStart?: AnimationEventHandler<T> | undefined
|
|
328
|
-
onAnimationStartCapture?: AnimationEventHandler<T> | undefined
|
|
329
|
-
onAnimationEnd?: AnimationEventHandler<T> | undefined
|
|
330
|
-
onAnimationEndCapture?: AnimationEventHandler<T> | undefined
|
|
331
|
-
onAnimationIteration?: AnimationEventHandler<T> | undefined
|
|
332
|
-
onAnimationIterationCapture?: AnimationEventHandler<T> | undefined
|
|
380
|
+
onAnimationStart?: AnimationEventHandler<T> | undefined;
|
|
381
|
+
onAnimationStartCapture?: AnimationEventHandler<T> | undefined;
|
|
382
|
+
onAnimationEnd?: AnimationEventHandler<T> | undefined;
|
|
383
|
+
onAnimationEndCapture?: AnimationEventHandler<T> | undefined;
|
|
384
|
+
onAnimationIteration?: AnimationEventHandler<T> | undefined;
|
|
385
|
+
onAnimationIterationCapture?: AnimationEventHandler<T> | undefined;
|
|
333
386
|
|
|
334
387
|
// Transition Events
|
|
335
|
-
onTransitionCancel?: TransitionEventHandler<T> | undefined
|
|
336
|
-
onTransitionCancelCapture?: TransitionEventHandler<T> | undefined
|
|
337
|
-
onTransitionEnd?: TransitionEventHandler<T> | undefined
|
|
338
|
-
onTransitionEndCapture?: TransitionEventHandler<T> | undefined
|
|
339
|
-
onTransitionRun?: TransitionEventHandler<T> | undefined
|
|
340
|
-
onTransitionRunCapture?: TransitionEventHandler<T> | undefined
|
|
341
|
-
onTransitionStart?: TransitionEventHandler<T> | undefined
|
|
342
|
-
onTransitionStartCapture?: TransitionEventHandler<T> | undefined
|
|
388
|
+
onTransitionCancel?: TransitionEventHandler<T> | undefined;
|
|
389
|
+
onTransitionCancelCapture?: TransitionEventHandler<T> | undefined;
|
|
390
|
+
onTransitionEnd?: TransitionEventHandler<T> | undefined;
|
|
391
|
+
onTransitionEndCapture?: TransitionEventHandler<T> | undefined;
|
|
392
|
+
onTransitionRun?: TransitionEventHandler<T> | undefined;
|
|
393
|
+
onTransitionRunCapture?: TransitionEventHandler<T> | undefined;
|
|
394
|
+
onTransitionStart?: TransitionEventHandler<T> | undefined;
|
|
395
|
+
onTransitionStartCapture?: TransitionEventHandler<T> | undefined;
|
|
396
|
+
}
|
|
397
|
+
|
|
398
|
+
export interface FormProps extends AriaLabelingProps {
|
|
399
|
+
/**
|
|
400
|
+
* Validation errors for the form, typically returned by a server.
|
|
401
|
+
* This should be set to an object mapping from input names to errors.
|
|
402
|
+
*/
|
|
403
|
+
validationErrors?: ValidationErrors;
|
|
404
|
+
/**
|
|
405
|
+
* Where to send the form-data when the form is submitted.
|
|
406
|
+
* See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/form#action).
|
|
407
|
+
*/
|
|
408
|
+
action?: string | FormHTMLAttributes<HTMLFormElement>['action'];
|
|
409
|
+
/**
|
|
410
|
+
* The enctype attribute specifies how the form-data should be encoded when submitting it to the
|
|
411
|
+
* server. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/form#enctype).
|
|
412
|
+
*/
|
|
413
|
+
encType?: 'application/x-www-form-urlencoded' | 'multipart/form-data' | 'text/plain';
|
|
414
|
+
/**
|
|
415
|
+
* The HTTP method to submit the form with.
|
|
416
|
+
* See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/form#method).
|
|
417
|
+
*/
|
|
418
|
+
method?: 'get' | 'post' | 'dialog';
|
|
419
|
+
/**
|
|
420
|
+
* The target attribute specifies a name or a keyword that indicates where to display the response
|
|
421
|
+
* that is received after submitting the form. See
|
|
422
|
+
* [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/form#target).
|
|
423
|
+
*/
|
|
424
|
+
target?: '_blank' | '_self' | '_parent' | '_top';
|
|
425
|
+
/**
|
|
426
|
+
* Triggered when a user submits the form.
|
|
427
|
+
*/
|
|
428
|
+
onSubmit?: (event: FormEvent<HTMLFormElement>) => void;
|
|
429
|
+
/**
|
|
430
|
+
* Triggered when a user resets the form.
|
|
431
|
+
*/
|
|
432
|
+
onReset?: (event: FormEvent<HTMLFormElement>) => void;
|
|
433
|
+
/**
|
|
434
|
+
* Triggered for each invalid field when a user submits the form.
|
|
435
|
+
*/
|
|
436
|
+
onInvalid?: (event: FormEvent<HTMLFormElement>) => void;
|
|
437
|
+
/**
|
|
438
|
+
* Indicates whether input elements can by default have their values automatically completed by
|
|
439
|
+
* the browser. See
|
|
440
|
+
* [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/form#autocomplete).
|
|
441
|
+
*/
|
|
442
|
+
autoComplete?: 'off' | 'on';
|
|
443
|
+
/**
|
|
444
|
+
* Controls whether inputted text is automatically capitalized and, if so, in what manner.
|
|
445
|
+
* See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/autocapitalize).
|
|
446
|
+
*/
|
|
447
|
+
autoCapitalize?: 'off' | 'none' | 'on' | 'sentences' | 'words' | 'characters';
|
|
448
|
+
/**
|
|
449
|
+
* An ARIA role override to apply to the form element.
|
|
450
|
+
*/
|
|
451
|
+
role?: 'search' | 'presentation';
|
|
343
452
|
}
|