@react-types/shared 3.11.2 → 3.12.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/dom.d.ts +53 -50
- package/src/inputs.d.ts +9 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@react-types/shared",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.12.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": "6a503b715e0dbbf92038cd7f08b1bcdde4c78e82"
|
|
18
18
|
}
|
package/src/dom.d.ts
CHANGED
|
@@ -66,9 +66,60 @@ export interface FocusableDOMProps extends DOMProps {
|
|
|
66
66
|
excludeFromTabOrder?: boolean
|
|
67
67
|
}
|
|
68
68
|
|
|
69
|
+
|
|
70
|
+
export interface TextInputDOMEvents {
|
|
71
|
+
// Clipboard events
|
|
72
|
+
/**
|
|
73
|
+
* Handler that is called when the user copies text. See [MDN](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/oncopy).
|
|
74
|
+
*/
|
|
75
|
+
onCopy?: ClipboardEventHandler<HTMLInputElement>,
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* Handler that is called when the user cuts text. See [MDN](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/oncut).
|
|
79
|
+
*/
|
|
80
|
+
onCut?: ClipboardEventHandler<HTMLInputElement>,
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* Handler that is called when the user pastes text. See [MDN](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/onpaste).
|
|
84
|
+
*/
|
|
85
|
+
onPaste?: ClipboardEventHandler<HTMLInputElement>,
|
|
86
|
+
|
|
87
|
+
// Composition events
|
|
88
|
+
/**
|
|
89
|
+
* 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).
|
|
90
|
+
*/
|
|
91
|
+
onCompositionStart?: CompositionEventHandler<HTMLInputElement>,
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* 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).
|
|
95
|
+
*/
|
|
96
|
+
onCompositionEnd?: CompositionEventHandler<HTMLInputElement>,
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* 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).
|
|
100
|
+
*/
|
|
101
|
+
onCompositionUpdate?: CompositionEventHandler<HTMLInputElement>,
|
|
102
|
+
|
|
103
|
+
// Selection events
|
|
104
|
+
/**
|
|
105
|
+
* 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).
|
|
106
|
+
*/
|
|
107
|
+
onSelect?: ReactEventHandler<HTMLInputElement>,
|
|
108
|
+
|
|
109
|
+
// Input events
|
|
110
|
+
/**
|
|
111
|
+
* 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).
|
|
112
|
+
*/
|
|
113
|
+
onBeforeInput?: FormEventHandler<HTMLInputElement>,
|
|
114
|
+
/**
|
|
115
|
+
* Handler that is called when the input value is modified. See [MDN](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event).
|
|
116
|
+
*/
|
|
117
|
+
onInput?: FormEventHandler<HTMLInputElement>
|
|
118
|
+
}
|
|
119
|
+
|
|
69
120
|
// DOM props that apply to all text inputs
|
|
70
121
|
// Ensure this is synced with useTextField
|
|
71
|
-
export interface TextInputDOMProps extends DOMProps {
|
|
122
|
+
export interface TextInputDOMProps extends DOMProps, TextInputDOMEvents {
|
|
72
123
|
/**
|
|
73
124
|
* 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).
|
|
74
125
|
*/
|
|
@@ -107,53 +158,5 @@ export interface TextInputDOMProps extends DOMProps {
|
|
|
107
158
|
/**
|
|
108
159
|
* Hints at the type of data that might be entered by the user while editing the element or its contents. See [MDN](https://html.spec.whatwg.org/multipage/interaction.html#input-modalities:-the-inputmode-attribute).
|
|
109
160
|
*/
|
|
110
|
-
inputMode?: 'none' | 'text' | 'tel' | 'url' | 'email' | 'numeric' | 'decimal' | 'search'
|
|
111
|
-
|
|
112
|
-
// Clipboard events
|
|
113
|
-
/**
|
|
114
|
-
* Handler that is called when the user copies text. See [MDN](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/oncopy).
|
|
115
|
-
*/
|
|
116
|
-
onCopy?: ClipboardEventHandler<HTMLInputElement>,
|
|
117
|
-
|
|
118
|
-
/**
|
|
119
|
-
* Handler that is called when the user cuts text. See [MDN](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/oncut).
|
|
120
|
-
*/
|
|
121
|
-
onCut?: ClipboardEventHandler<HTMLInputElement>,
|
|
122
|
-
|
|
123
|
-
/**
|
|
124
|
-
* Handler that is called when the user pastes text. See [MDN](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/onpaste).
|
|
125
|
-
*/
|
|
126
|
-
onPaste?: ClipboardEventHandler<HTMLInputElement>,
|
|
127
|
-
|
|
128
|
-
// Composition events
|
|
129
|
-
/**
|
|
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).
|
|
131
|
-
*/
|
|
132
|
-
onCompositionStart?: CompositionEventHandler<HTMLInputElement>,
|
|
133
|
-
|
|
134
|
-
/**
|
|
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).
|
|
136
|
-
*/
|
|
137
|
-
onCompositionEnd?: CompositionEventHandler<HTMLInputElement>,
|
|
138
|
-
|
|
139
|
-
/**
|
|
140
|
-
* 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).
|
|
141
|
-
*/
|
|
142
|
-
onCompositionUpdate?: CompositionEventHandler<HTMLInputElement>,
|
|
143
|
-
|
|
144
|
-
// Selection events
|
|
145
|
-
/**
|
|
146
|
-
* 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).
|
|
147
|
-
*/
|
|
148
|
-
onSelect?: ReactEventHandler<HTMLInputElement>,
|
|
149
|
-
|
|
150
|
-
// Input events
|
|
151
|
-
/**
|
|
152
|
-
* 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).
|
|
153
|
-
*/
|
|
154
|
-
onBeforeInput?: FormEventHandler<HTMLInputElement>,
|
|
155
|
-
/**
|
|
156
|
-
* Handler that is called when the input value is modified. See [MDN](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event).
|
|
157
|
-
*/
|
|
158
|
-
onInput?: FormEventHandler<HTMLInputElement>
|
|
161
|
+
inputMode?: 'none' | 'text' | 'tel' | 'url' | 'email' | 'numeric' | 'decimal' | 'search'
|
|
159
162
|
}
|
package/src/inputs.d.ts
CHANGED
|
@@ -45,6 +45,15 @@ export interface TextInputBase {
|
|
|
45
45
|
placeholder?: string
|
|
46
46
|
}
|
|
47
47
|
|
|
48
|
+
export interface SpectrumTextInputBase {
|
|
49
|
+
/**
|
|
50
|
+
* Temporary text that occupies the text input when it is empty.
|
|
51
|
+
* Please use help text instead.
|
|
52
|
+
* @deprecated
|
|
53
|
+
**/
|
|
54
|
+
placeholder?: string
|
|
55
|
+
}
|
|
56
|
+
|
|
48
57
|
export interface RangeValue<T> {
|
|
49
58
|
/** The start value of the range. */
|
|
50
59
|
start: T,
|