downshift 9.4.0-alpha.2 → 9.4.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.
Files changed (44) hide show
  1. package/dist/downshift.cjs.cjs +132 -126
  2. package/dist/downshift.d.ts +60 -56
  3. package/dist/downshift.esm.mjs +132 -126
  4. package/dist/downshift.native.cjs.cjs +129 -126
  5. package/dist/downshift.nativeweb.cjs.cjs +132 -126
  6. package/dist/downshift.umd.js +132 -126
  7. package/dist/downshift.umd.js.map +1 -1
  8. package/dist/downshift.umd.min.js +1 -1
  9. package/dist/downshift.umd.min.js.map +1 -1
  10. package/dist/hooks/testUtils/interactions.d.ts +7 -7
  11. package/dist/hooks/useCombobox/__tests__/utils/renderCombobox.d.ts +3 -59
  12. package/dist/hooks/useCombobox/__tests__/utils/renderUseCombobox.d.ts +1 -1
  13. package/dist/hooks/useCombobox/index.types.d.ts +0 -1
  14. package/dist/hooks/useCombobox/utils/getInitialState.d.ts +1 -6
  15. package/dist/hooks/useCombobox/utils/propTypes.d.ts +1 -43
  16. package/dist/hooks/useSelect/__tests__/utils/getItemIndexByCharacter.d.ts +1 -1
  17. package/dist/hooks/useSelect/__tests__/utils/renderSelect.d.ts +2 -58
  18. package/dist/hooks/useSelect/__tests__/utils/renderUseSelect.d.ts +1 -1
  19. package/dist/hooks/useSelect/__tests__/utils/stateChangeTestCases.d.ts +29 -50
  20. package/dist/hooks/useSelect/utils/propTypes.d.ts +1 -38
  21. package/dist/hooks/useTagGroup/__tests__/utils/renderTagGroup.d.ts +1 -63
  22. package/dist/hooks/useTagGroup/__tests__/utils/renderUseTagGroup.d.ts +2 -2
  23. package/dist/hooks/utils/dropdownDefaultProps.d.ts +3 -4
  24. package/dist/hooks/utils/useMouseAndTouchTracker.d.ts +3 -3
  25. package/dist/hooks/utils/useScrollIntoView.d.ts +4 -3
  26. package/dist/utils/getHighlightedIndex.d.ts +1 -1
  27. package/dist/utils/getNonDisabledIndex.d.ts +1 -1
  28. package/dist/utils/index.d.ts +1 -0
  29. package/dist/utils/useIsomorphicLayoutEffect.d.ts +2 -0
  30. package/dist/utils/useLatestRef.d.ts +1 -1
  31. package/package.json +15 -2
  32. package/preact/dist/downshift.cjs.cjs +132 -126
  33. package/preact/dist/downshift.esm.mjs +132 -126
  34. package/preact/dist/downshift.umd.js +132 -126
  35. package/preact/dist/downshift.umd.js.map +1 -1
  36. package/preact/dist/downshift.umd.min.js +1 -1
  37. package/preact/dist/downshift.umd.min.js.map +1 -1
  38. package/dist/hooks/useMultipleSelection/index.d.ts +0 -50
  39. package/dist/hooks/useMultipleSelection/reducer.d.ts +0 -1
  40. package/dist/hooks/useMultipleSelection/stateChangeTypes.d.ts +0 -13
  41. package/dist/hooks/useMultipleSelection/utils.d.ts +0 -44
  42. package/dist/types.d.ts +0 -12
  43. package/preact/dist/downshift.cjs.js +0 -4265
  44. package/preact/dist/downshift.esm.js +0 -4238
@@ -47,17 +47,17 @@ declare class Downshift extends Component<any, any, any> {
47
47
  defaultIsOpen: boolean;
48
48
  getA11yStatusMessage: typeof getA11yStatusMessage;
49
49
  itemToString: (i: any) => string;
50
- onStateChange: typeof noop;
51
- onInputValueChange: typeof noop;
52
- onUserAction: typeof noop;
53
- onChange: typeof noop;
54
- onSelect: typeof noop;
55
- onOuterClick: typeof noop;
50
+ onStateChange: any;
51
+ onInputValueChange: any;
52
+ onUserAction: any;
53
+ onChange: any;
54
+ onSelect: any;
55
+ onOuterClick: any;
56
56
  selectedItemChanged: (prevItem: any, item: any) => boolean;
57
57
  environment: (Window & typeof globalThis) | undefined;
58
58
  stateReducer: (state: any, stateToSet: any) => any;
59
59
  suppressRefError: boolean;
60
- scrollIntoView: typeof scrollIntoView;
60
+ scrollIntoView: any;
61
61
  };
62
62
  static stateChangeTypes: typeof stateChangeTypes;
63
63
  constructor(props: any);
@@ -106,6 +106,7 @@ declare class Downshift extends Component<any, any, any> {
106
106
  getStateAndHelpers(): {
107
107
  getRootProps: ({ refKey, ref, ...rest }?: {
108
108
  refKey?: string | undefined;
109
+ ref: any;
109
110
  }, { suppressRefError }?: {
110
111
  suppressRefError?: boolean | undefined;
111
112
  }) => {
@@ -115,7 +116,13 @@ declare class Downshift extends Component<any, any, any> {
115
116
  'aria-owns': any;
116
117
  'aria-labelledby': any;
117
118
  };
118
- getToggleButtonProps: ({ onClick, onPress, onKeyDown, onKeyUp, onBlur, ...rest }?: {}) => {
119
+ getToggleButtonProps: ({ onClick, onPress, onKeyDown, onKeyUp, onBlur, ...rest }?: {
120
+ onClick: any;
121
+ onPress: any;
122
+ onKeyDown: any;
123
+ onKeyUp: any;
124
+ onBlur: any;
125
+ }) => {
119
126
  type: string;
120
127
  role: string;
121
128
  'aria-label': string;
@@ -125,6 +132,7 @@ declare class Downshift extends Component<any, any, any> {
125
132
  getLabelProps: (props: any) => any;
126
133
  getMenuProps: ({ refKey, ref, ...props }?: {
127
134
  refKey?: string | undefined;
135
+ ref: any;
128
136
  }, { suppressRefError }?: {
129
137
  suppressRefError?: boolean | undefined;
130
138
  }) => {
@@ -132,7 +140,13 @@ declare class Downshift extends Component<any, any, any> {
132
140
  'aria-labelledby': any;
133
141
  id: any;
134
142
  };
135
- getInputProps: ({ onKeyDown, onBlur, onChange, onInput, onChangeText, ...rest }?: {}) => {
143
+ getInputProps: ({ onKeyDown, onBlur, onChange, onInput, onChangeText, ...rest }?: {
144
+ onKeyDown: any;
145
+ onBlur: any;
146
+ onChange: any;
147
+ onInput: any;
148
+ onChangeText: any;
149
+ }) => {
136
150
  'aria-autocomplete': string;
137
151
  'aria-activedescendant': any;
138
152
  'aria-controls': any;
@@ -142,30 +156,20 @@ declare class Downshift extends Component<any, any, any> {
142
156
  id: any;
143
157
  };
144
158
  getItemProps: ({ onMouseMove, onMouseDown, onClick, onPress, index, item, ...rest }?: {
159
+ onMouseMove: any;
160
+ onMouseDown: any;
161
+ onClick: any;
162
+ onPress: any;
163
+ index: any;
145
164
  item?: void | undefined;
146
165
  }) => {
147
- onMouseMove: (event: React.SyntheticEvent & {
148
- preventDownshiftDefault?: boolean;
149
- nativeEvent: {
150
- preventDownshiftDefault?: boolean;
151
- };
152
- }, ...args: unknown[]) => boolean;
153
- onMouseDown: (event: React.SyntheticEvent & {
154
- preventDownshiftDefault?: boolean;
155
- nativeEvent: {
156
- preventDownshiftDefault?: boolean;
157
- };
158
- }, ...args: unknown[]) => boolean;
166
+ onMouseMove: any;
167
+ onMouseDown: any;
159
168
  id: any;
160
169
  role: string;
161
170
  'aria-selected': boolean;
162
171
  } | {
163
- onMouseDown: (event: React.SyntheticEvent & {
164
- preventDownshiftDefault?: boolean;
165
- nativeEvent: {
166
- preventDownshiftDefault?: boolean;
167
- };
168
- }, ...args: unknown[]) => boolean;
172
+ onMouseDown: any;
169
173
  id: any;
170
174
  role: string;
171
175
  'aria-selected': boolean;
@@ -194,6 +198,7 @@ declare class Downshift extends Component<any, any, any> {
194
198
  _rootNode: any;
195
199
  getRootProps: ({ refKey, ref, ...rest }?: {
196
200
  refKey?: string | undefined;
201
+ ref: any;
197
202
  }, { suppressRefError }?: {
198
203
  suppressRefError?: boolean | undefined;
199
204
  }) => {
@@ -224,7 +229,13 @@ declare class Downshift extends Component<any, any, any> {
224
229
  Enter(event: any): void;
225
230
  Escape(event: any): void;
226
231
  };
227
- getToggleButtonProps: ({ onClick, onPress, onKeyDown, onKeyUp, onBlur, ...rest }?: {}) => {
232
+ getToggleButtonProps: ({ onClick, onPress, onKeyDown, onKeyUp, onBlur, ...rest }?: {
233
+ onClick: any;
234
+ onPress: any;
235
+ onKeyDown: any;
236
+ onKeyUp: any;
237
+ onBlur: any;
238
+ }) => {
228
239
  type: string;
229
240
  role: string;
230
241
  'aria-label': string;
@@ -236,7 +247,13 @@ declare class Downshift extends Component<any, any, any> {
236
247
  buttonHandleClick: (event: any) => void;
237
248
  buttonHandleBlur: (event: any) => void;
238
249
  getLabelProps: (props: any) => any;
239
- getInputProps: ({ onKeyDown, onBlur, onChange, onInput, onChangeText, ...rest }?: {}) => {
250
+ getInputProps: ({ onKeyDown, onBlur, onChange, onInput, onChangeText, ...rest }?: {
251
+ onKeyDown: any;
252
+ onBlur: any;
253
+ onChange: any;
254
+ onInput: any;
255
+ onChangeText: any;
256
+ }) => {
240
257
  'aria-autocomplete': string;
241
258
  'aria-activedescendant': any;
242
259
  'aria-controls': any;
@@ -252,6 +269,7 @@ declare class Downshift extends Component<any, any, any> {
252
269
  _menuNode: any;
253
270
  getMenuProps: ({ refKey, ref, ...props }?: {
254
271
  refKey?: string | undefined;
272
+ ref: any;
255
273
  }, { suppressRefError }?: {
256
274
  suppressRefError?: boolean | undefined;
257
275
  }) => {
@@ -260,30 +278,20 @@ declare class Downshift extends Component<any, any, any> {
260
278
  id: any;
261
279
  };
262
280
  getItemProps: ({ onMouseMove, onMouseDown, onClick, onPress, index, item, ...rest }?: {
281
+ onMouseMove: any;
282
+ onMouseDown: any;
283
+ onClick: any;
284
+ onPress: any;
285
+ index: any;
263
286
  item?: void | undefined;
264
287
  }) => {
265
- onMouseMove: (event: React.SyntheticEvent & {
266
- preventDownshiftDefault?: boolean;
267
- nativeEvent: {
268
- preventDownshiftDefault?: boolean;
269
- };
270
- }, ...args: unknown[]) => boolean;
271
- onMouseDown: (event: React.SyntheticEvent & {
272
- preventDownshiftDefault?: boolean;
273
- nativeEvent: {
274
- preventDownshiftDefault?: boolean;
275
- };
276
- }, ...args: unknown[]) => boolean;
288
+ onMouseMove: any;
289
+ onMouseDown: any;
277
290
  id: any;
278
291
  role: string;
279
292
  'aria-selected': boolean;
280
293
  } | {
281
- onMouseDown: (event: React.SyntheticEvent & {
282
- preventDownshiftDefault?: boolean;
283
- nativeEvent: {
284
- preventDownshiftDefault?: boolean;
285
- };
286
- }, ...args: unknown[]) => boolean;
294
+ onMouseDown: any;
287
295
  id: any;
288
296
  role: string;
289
297
  'aria-selected': boolean;
@@ -294,9 +302,7 @@ declare class Downshift extends Component<any, any, any> {
294
302
  toggleMenu: (otherStateToSet: {} | undefined, cb: any) => void;
295
303
  openMenu: (cb: any) => void;
296
304
  closeMenu: (cb: any) => void;
297
- updateStatus: Function & {
298
- cancel: Function;
299
- };
305
+ updateStatus: any;
300
306
  componentDidMount(): void;
301
307
  cleanup: (() => void) | (() => void) | undefined;
302
308
  isMouseDown: boolean | undefined;
@@ -306,9 +312,7 @@ declare class Downshift extends Component<any, any, any> {
306
312
  componentWillUnmount(): void;
307
313
  render(): any;
308
314
  }
309
- import { Component } from 'react';
310
- import PropTypes from 'prop-types';
311
- import { getA11yStatusMessage } from './utils.legacy';
312
- import { noop } from './utils';
313
- import { scrollIntoView } from './utils';
314
- import * as stateChangeTypes from './stateChangeTypes';
315
+ import { Component } from "react";
316
+ import PropTypes from "prop-types";
317
+ import { getA11yStatusMessage } from "./utils.legacy";
318
+ import * as stateChangeTypes from "./stateChangeTypes";