@@ -126,49 +126,57 @@ export interface StrictDropdownProps {
126
126
* Called when a user adds a new item. Use this to update the options list.
127
127
*
128
128
* @param {SyntheticEvent } event - React's original SyntheticEvent.
129
- * @param {object } data - All props and the new item's value .
129
+ * @param {object } props - All props.
130
130
*/
131
- onAddItem ?: ( event : React . SyntheticEvent < HTMLElement > , data : DropdownProps ) => void
131
+ onAddItem ?: (
132
+ event : React . SyntheticEvent < HTMLElement > ,
133
+ props : DropdownProps ,
134
+ value : boolean | number | string | ( boolean | number | string ) [ ] ,
135
+ ) => void
132
136
133
137
/**
134
138
* Called on blur.
135
139
*
136
140
* @param {SyntheticEvent } event - React's original SyntheticEvent.
137
- * @param {object } data - All props.
141
+ * @param {object } props - All props.
138
142
*/
139
- onBlur ?: ( event : React . FocusEvent < HTMLElement > , data : DropdownProps ) => void
143
+ onBlur ?: ( event : React . FocusEvent < HTMLElement > , props : DropdownProps ) => void
140
144
141
145
/**
142
146
* Called when the user attempts to change the value.
143
147
*
144
148
* @param {SyntheticEvent } event - React's original SyntheticEvent.
145
- * @param {object } data - All props and proposed value .
149
+ * @param {object } props - All props.
146
150
*/
147
- onChange ?: ( event : React . SyntheticEvent < HTMLElement > , data : DropdownProps ) => void
151
+ onChange ?: (
152
+ event : React . SyntheticEvent < HTMLElement > ,
153
+ props : DropdownProps ,
154
+ value : boolean | number | string | ( boolean | number | string ) [ ] ,
155
+ ) => void
148
156
149
157
/**
150
158
* Called on click.
151
159
*
152
160
* @param {SyntheticEvent } event - React's original SyntheticEvent.
153
- * @param {object } data - All props.
161
+ * @param {object } props - All props.
154
162
*/
155
- onClick ?: ( event : React . MouseEvent < HTMLElement > , data : DropdownProps ) => void
163
+ onClick ?: ( event : React . MouseEvent < HTMLElement > , props : DropdownProps ) => void
156
164
157
165
/**
158
166
* Called when a close event happens.
159
167
*
160
168
* @param {SyntheticEvent } event - React's original SyntheticEvent.
161
- * @param {object } data - All props.
169
+ * @param {object } props - All props.
162
170
*/
163
- onClose ?: ( event : React . SyntheticEvent < HTMLElement > , data : DropdownProps ) => void
171
+ onClose ?: ( event : React . SyntheticEvent < HTMLElement > , props : DropdownProps ) => void
164
172
165
173
/**
166
174
* Called on focus.
167
175
*
168
176
* @param {SyntheticEvent } event - React's original SyntheticEvent.
169
- * @param {object } data - All props.
177
+ * @param {object } props - All props.
170
178
*/
171
- onFocus ?: ( event : React . FocusEvent < HTMLElement > , data : DropdownProps ) => void
179
+ onFocus ?: ( event : React . FocusEvent < HTMLElement > , props : DropdownProps ) => void
172
180
173
181
/**
174
182
* Called when a multi-select label is clicked.
@@ -182,27 +190,29 @@ export interface StrictDropdownProps {
182
190
* Called on mousedown.
183
191
*
184
192
* @param {SyntheticEvent } event - React's original SyntheticEvent.
185
- * @param {object } data - All props.
193
+ * @param {object } props - All props.
186
194
*/
187
- onMouseDown ?: ( event : React . MouseEvent < HTMLElement > , data : DropdownProps ) => void
195
+ onMouseDown ?: ( event : React . MouseEvent < HTMLElement > , props : DropdownProps ) => void
188
196
189
197
/**
190
198
* Called when an open event happens.
191
199
*
192
200
* @param {SyntheticEvent } event - React's original SyntheticEvent.
193
- * @param {object } data - All props.
201
+ * @param {object } props - All props.
194
202
*/
195
- onOpen ?: ( event : React . SyntheticEvent < HTMLElement > , data : DropdownProps ) => void
203
+ onOpen ?: ( event : React . SyntheticEvent < HTMLElement > , props : DropdownProps ) => void
196
204
197
205
/**
198
206
* Called on search input change.
199
207
*
200
208
* @param {SyntheticEvent } event - React's original SyntheticEvent.
201
- * @param {object } data - All props, includes current value of searchQuery.
209
+ * @param {object } props - All props.
210
+ * @param {string } searchQuery - Current value of searchQuery.
202
211
*/
203
212
onSearchChange ?: (
204
213
event : React . SyntheticEvent < HTMLElement > ,
205
- data : DropdownOnSearchChangeData ,
214
+ data : DropdownProps ,
215
+ searchQuery : string ,
206
216
) => void
207
217
208
218
/** Controls whether or not the dropdown menu is displayed. */
@@ -292,13 +302,6 @@ export interface StrictDropdownProps {
292
302
wrapSelection ?: boolean
293
303
}
294
304
295
- /* TODO: replace with DropdownProps when #1829 will be fixed:
296
- * https://github.com/Semantic-Org/Semantic-UI-React/issues/1829
297
- */
298
- export interface DropdownOnSearchChangeData extends DropdownProps {
299
- searchQuery : string
300
- }
301
-
302
305
declare const Dropdown : ForwardRefComponent < DropdownProps , HTMLDivElement > & {
303
306
Divider : typeof DropdownDivider
304
307
Header : typeof DropdownHeader
0 commit comments