@react-types/shared 3.0.0-nightly-36fdd8bca-260419 → 3.0.0-nightly-ec7736d18-260421
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 +1 -1
- package/src/dom.d.ts +13 -13
package/package.json
CHANGED
package/src/dom.d.ts
CHANGED
|
@@ -83,54 +83,54 @@ export interface FocusableDOMProps extends DOMProps {
|
|
|
83
83
|
}
|
|
84
84
|
|
|
85
85
|
|
|
86
|
-
export interface TextInputDOMEvents {
|
|
86
|
+
export interface TextInputDOMEvents<T = HTMLInputElement> {
|
|
87
87
|
// Clipboard events
|
|
88
88
|
/**
|
|
89
89
|
* Handler that is called when the user copies text. See [MDN](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/oncopy).
|
|
90
90
|
*/
|
|
91
|
-
onCopy?: ClipboardEventHandler<
|
|
91
|
+
onCopy?: ClipboardEventHandler<T>,
|
|
92
92
|
|
|
93
93
|
/**
|
|
94
94
|
* Handler that is called when the user cuts text. See [MDN](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/oncut).
|
|
95
95
|
*/
|
|
96
|
-
onCut?: ClipboardEventHandler<
|
|
96
|
+
onCut?: ClipboardEventHandler<T>,
|
|
97
97
|
|
|
98
98
|
/**
|
|
99
99
|
* Handler that is called when the user pastes text. See [MDN](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/onpaste).
|
|
100
100
|
*/
|
|
101
|
-
onPaste?: ClipboardEventHandler<
|
|
101
|
+
onPaste?: ClipboardEventHandler<T>,
|
|
102
102
|
|
|
103
103
|
// Composition events
|
|
104
104
|
/**
|
|
105
105
|
* 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).
|
|
106
106
|
*/
|
|
107
|
-
onCompositionStart?: CompositionEventHandler<
|
|
107
|
+
onCompositionStart?: CompositionEventHandler<T>,
|
|
108
108
|
|
|
109
109
|
/**
|
|
110
110
|
* 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).
|
|
111
111
|
*/
|
|
112
|
-
onCompositionEnd?: CompositionEventHandler<
|
|
112
|
+
onCompositionEnd?: CompositionEventHandler<T>,
|
|
113
113
|
|
|
114
114
|
/**
|
|
115
115
|
* Handler that is called when a new character is received in the current text composition session. See [MDN](https://developer.mozilla.org/en-US/docs/Web/API/Element/compositionupdate_event).
|
|
116
116
|
*/
|
|
117
|
-
onCompositionUpdate?: CompositionEventHandler<
|
|
117
|
+
onCompositionUpdate?: CompositionEventHandler<T>,
|
|
118
118
|
|
|
119
119
|
// Selection events
|
|
120
120
|
/**
|
|
121
121
|
* Handler that is called when text in the input is selected. See [MDN](https://developer.mozilla.org/en-US/docs/Web/API/Element/select_event).
|
|
122
122
|
*/
|
|
123
|
-
onSelect?: ReactEventHandler<
|
|
123
|
+
onSelect?: ReactEventHandler<T>,
|
|
124
124
|
|
|
125
125
|
// Input events
|
|
126
126
|
/**
|
|
127
127
|
* Handler that is called when the input value is about to be modified. See [MDN](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/beforeinput_event).
|
|
128
128
|
*/
|
|
129
|
-
onBeforeInput?: FormEventHandler<
|
|
129
|
+
onBeforeInput?: FormEventHandler<T>,
|
|
130
130
|
/**
|
|
131
131
|
* Handler that is called when the input value is modified. See [MDN](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event).
|
|
132
132
|
*/
|
|
133
|
-
onInput?: FormEventHandler<
|
|
133
|
+
onInput?: FormEventHandler<T>
|
|
134
134
|
}
|
|
135
135
|
|
|
136
136
|
export interface InputDOMProps {
|
|
@@ -148,7 +148,7 @@ export interface InputDOMProps {
|
|
|
148
148
|
|
|
149
149
|
// DOM props that apply to all text inputs
|
|
150
150
|
// Ensure this is synced with useTextField
|
|
151
|
-
export interface TextInputDOMProps extends DOMProps, InputDOMProps, TextInputDOMEvents {
|
|
151
|
+
export interface TextInputDOMProps<T = HTMLInputElement> extends DOMProps, InputDOMProps, TextInputDOMEvents<T> {
|
|
152
152
|
/**
|
|
153
153
|
* Describes the type of autocomplete functionality the input should provide if any. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefautocomplete).
|
|
154
154
|
*/
|
|
@@ -261,7 +261,7 @@ export interface GlobalDOMAttributes<T = Element> extends GlobalDOMEvents<T> {
|
|
|
261
261
|
// NOTES:
|
|
262
262
|
// - Drag and drop events are omitted for now.
|
|
263
263
|
// - Keyboard and focus events are supported directly on focusable elements (FocusableProps).
|
|
264
|
-
// - Text input events (e.g. onInput, onCompositionStart, onCopy) are
|
|
264
|
+
// - Text input events (e.g. onInput, onCompositionStart, onCopy) are
|
|
265
265
|
// supported only directly on input elements (TextInputDOMProps).
|
|
266
266
|
// We don't support contentEditable on our components.
|
|
267
267
|
// - Media events should be handled directly on the <video>/<audio><img> element.
|
|
@@ -389,7 +389,7 @@ export interface FormProps extends AriaLabelingProps {
|
|
|
389
389
|
*/
|
|
390
390
|
autoComplete?: 'off' | 'on',
|
|
391
391
|
/**
|
|
392
|
-
* Controls whether inputted text is automatically capitalized and, if so, in what manner.
|
|
392
|
+
* Controls whether inputted text is automatically capitalized and, if so, in what manner.
|
|
393
393
|
* See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/autocapitalize).
|
|
394
394
|
*/
|
|
395
395
|
autoCapitalize?: 'off' | 'none' | 'on' | 'sentences' | 'words' | 'characters',
|