@commercetools-uikit/async-creatable-select-input 19.8.0 → 19.10.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.
@@ -252,7 +252,7 @@ AsyncCreatableSelectInput.ValueContainer = reactSelect.components.ValueContainer
252
252
  var AsyncCreatableSelectInput$1 = AsyncCreatableSelectInput;
253
253
 
254
254
  // NOTE: This string will be replaced on build time with the package version.
255
- var version = "19.8.0";
255
+ var version = "19.10.0";
256
256
 
257
257
  exports["default"] = AsyncCreatableSelectInput$1;
258
258
  exports.version = version;
@@ -234,7 +234,7 @@ AsyncCreatableSelectInput.ValueContainer = reactSelect.components.ValueContainer
234
234
  var AsyncCreatableSelectInput$1 = AsyncCreatableSelectInput;
235
235
 
236
236
  // NOTE: This string will be replaced on build time with the package version.
237
- var version = "19.8.0";
237
+ var version = "19.10.0";
238
238
 
239
239
  exports["default"] = AsyncCreatableSelectInput$1;
240
240
  exports.version = version;
@@ -231,6 +231,6 @@ AsyncCreatableSelectInput.ValueContainer = components.ValueContainer;
231
231
  var AsyncCreatableSelectInput$1 = AsyncCreatableSelectInput;
232
232
 
233
233
  // NOTE: This string will be replaced on build time with the package version.
234
- var version = "19.8.0";
234
+ var version = "19.10.0";
235
235
 
236
236
  export { AsyncCreatableSelectInput$1 as default, version };
@@ -11,59 +11,280 @@ type TCustomEvent = {
11
11
  };
12
12
  type ReactSelectAsyncCreatableProps = AsyncCreatableProps<unknown, boolean, GroupBase<unknown>>;
13
13
  export type TAsyncCreatableSelectInputProps = {
14
+ /**
15
+ * Horizontal size limit of the input fields.
16
+ */
14
17
  horizontalConstraint?: 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 'scale' | 'auto';
18
+ /**
19
+ * Indicates the input field has an error
20
+ */
15
21
  hasError?: boolean;
22
+ /**
23
+ * Indicates the input field has a warning
24
+ */
16
25
  hasWarning?: boolean;
26
+ /**
27
+ * Is the select read-only
28
+ */
17
29
  isReadOnly?: boolean;
30
+ /**
31
+ * Icon to display on the left of the placeholder text and selected value. Has no effect when isMulti is enabled.
32
+ */
18
33
  iconLeft?: ReactNode;
34
+ /**
35
+ * Aria label (for assistive tech)
36
+ * <br>
37
+ * [Props from React select was used](https://react-select.com/props)
38
+ */
19
39
  'aria-label'?: ReactSelectAsyncCreatableProps['aria-label'];
40
+ /**
41
+ * HTML ID of an element that should be used as the label (for assistive tech)
42
+ * <br>
43
+ * [Props from React select was used](https://react-select.com/props)
44
+ */
20
45
  'aria-labelledby'?: ReactSelectAsyncCreatableProps['aria-labelledby'];
46
+ /**
47
+ * Indicate if the value entered in the input is invalid.
48
+ * <br>
49
+ * [Props from React select was used](https://react-select.com/props)
50
+ */
21
51
  'aria-invalid'?: ReactSelectAsyncCreatableProps['aria-invalid'];
52
+ /**
53
+ * HTML ID of an element containing an error message related to the input.
54
+ * <br>
55
+ * [Props from React select was used](https://react-select.com/props)
56
+ */
22
57
  'aria-errormessage'?: ReactSelectAsyncCreatableProps['aria-errormessage'];
58
+ /**
59
+ * Focus the control when it is mounted
60
+ */
23
61
  isAutofocussed?: boolean;
62
+ /**
63
+ * Remove the currently focused option when the user presses backspace
64
+ * <br>
65
+ * [Props from React select was used](https://react-select.com/props)
66
+ */
24
67
  backspaceRemovesValue?: ReactSelectAsyncCreatableProps['backspaceRemovesValue'];
68
+ /**
69
+ * Map of components to overwrite the default ones, see [what components you can override](https://react-select.com/components)
70
+ * <br>
71
+ * [Props from React select was used](https://react-select.com/props)
72
+ */
25
73
  components?: ReactSelectAsyncCreatableProps['components'];
74
+ /**
75
+ * Custom method to filter whether an option should be displayed in the menu
76
+ * <br>
77
+ * [Props from React select was used](https://react-select.com/props)
78
+ */
26
79
  filterOption?: ReactSelectAsyncCreatableProps['filterOption'];
80
+ /**
81
+ * The id of the search input
82
+ * <br>
83
+ * [Props from React select was used](https://react-select.com/props)
84
+ */
27
85
  id?: ReactSelectAsyncCreatableProps['inputId'];
86
+ /**
87
+ * The value of the search input
88
+ * <br>
89
+ * [Props from React select was used](https://react-select.com/props)
90
+ */
28
91
  inputValue?: ReactSelectAsyncCreatableProps['inputValue'];
92
+ /**
93
+ * The id to set on the SelectContainer component
94
+ * <br>
95
+ * [Props from React select was used](https://react-select.com/props)
96
+ */
29
97
  containerId?: ReactSelectAsyncCreatableProps['id'];
98
+ /**
99
+ * Is the select value clearable
100
+ * <br>
101
+ * [Props from React select was used](https://react-select.com/props)
102
+ */
30
103
  isClearable?: ReactSelectAsyncCreatableProps['isClearable'];
104
+ /**
105
+ * Use this property to reduce the paddings of the component for a ui compact variant
106
+ */
31
107
  isCondensed?: boolean;
108
+ /**
109
+ * Is the select disabled
110
+ * <br>
111
+ * [Props from React select was used](https://react-select.com/props)
112
+ */
32
113
  isDisabled?: ReactSelectAsyncCreatableProps['isDisabled'];
114
+ /**
115
+ * Override the built-in logic to detect whether an option is disabled
116
+ * <br>
117
+ * [Props from React select was used](https://react-select.com/props)
118
+ */
33
119
  isOptionDisabled?: ReactSelectAsyncCreatableProps['isOptionDisabled'];
120
+ /**
121
+ * Support multiple selected options
122
+ * <br>
123
+ * [Props from React select was used](https://react-select.com/props)
124
+ */
34
125
  isMulti?: ReactSelectAsyncCreatableProps['isMulti'];
126
+ /**
127
+ * Whether to enable search functionality
128
+ * <br>
129
+ * [Props from React select was used](https://react-select.com/props)
130
+ */
35
131
  isSearchable?: ReactSelectAsyncCreatableProps['isSearchable'];
132
+ /**
133
+ * Maximum height of the menu before scrolling
134
+ * <br>
135
+ * [Props from React select was used](https://react-select.com/props)
136
+ */
36
137
  maxMenuHeight?: ReactSelectAsyncCreatableProps['maxMenuHeight'];
138
+ /**
139
+ * Dom element to portal the select menu to
140
+ * <br>
141
+ * [Props from React select was used](https://react-select.com/props)
142
+ */
37
143
  menuPortalTarget?: ReactSelectAsyncCreatableProps['menuPortalTarget'];
144
+ /**
145
+ * z-index value for the menu portal
146
+ * <br>
147
+ * Use in conjunction with `menuPortalTarget`
148
+ */
38
149
  menuPortalZIndex: number;
150
+ /**
151
+ * whether the menu should block scroll while open
152
+ * <br>
153
+ * [Props from React select was used](https://react-select.com/props)
154
+ */
39
155
  menuShouldBlockScroll?: ReactSelectAsyncCreatableProps['menuShouldBlockScroll'];
156
+ /**
157
+ * Whether the menu should close after a value is selected. Defaults to `true`.
158
+ * <br>
159
+ * [Props from React select was used](https://react-select.com/props)
160
+ */
40
161
  closeMenuOnSelect?: ReactSelectAsyncCreatableProps['closeMenuOnSelect'];
162
+ /**
163
+ * Name of the HTML Input (optional - without this, no input will be rendered)
164
+ * <br>
165
+ * [Props from React select was used](https://react-select.com/props)
166
+ */
41
167
  name?: ReactSelectAsyncCreatableProps['name'];
168
+ /**
169
+ * Can be used to render a custom value when there are no options (either because of no search results, or all options have been used, or there were none in the first place). Gets called with `{ inputValue: String }`. `inputValue` will be an empty string when no search text is present.
170
+ * <br>
171
+ * [Props from React select was used](https://react-select.com/props)
172
+ */
42
173
  noOptionsMessage?: ReactSelectAsyncCreatableProps['noOptionsMessage'];
174
+ /**
175
+ * Handle blur events on the control
176
+ */
43
177
  onBlur?: (event: TCustomEvent) => void;
178
+ /**
179
+ * Called with a fake event when value changes. The event's `target.name` will be the `name` supplied in props. The event's `target.value` will hold the value. The value will be the selected option, or an array of options in case `isMulti` is `true`.
180
+ */
44
181
  onChange?: (event: TCustomEvent, info: ActionMeta<unknown>) => void;
182
+ /**
183
+ * Handle focus events on the control
184
+ * <br>
185
+ * [Props from React select was used](https://react-select.com/props)
186
+ */
45
187
  onFocus?: ReactSelectAsyncCreatableProps['onFocus'];
188
+ /**
189
+ * Handle change events on the input
190
+ * <br>
191
+ * [Props from React select was used](https://react-select.com/props)
192
+ */
46
193
  onInputChange?: ReactSelectAsyncCreatableProps['onInputChange'];
194
+ /**
195
+ * Placeholder text for the select value
196
+ * <br>
197
+ * [Props from React select was used](https://react-select.com/props)
198
+ */
47
199
  placeholder?: ReactSelectAsyncCreatableProps['placeholder'];
200
+ /**
201
+ * Sets the tabIndex attribute on the input
202
+ * <br>
203
+ * [Props from React select was used](https://react-select.com/props)
204
+ */
48
205
  tabIndex?: ReactSelectAsyncCreatableProps['tabIndex'];
206
+ /**
207
+ * Select the currently focused option when the user presses tab
208
+ * <br>
209
+ * [Props from React select was used](https://react-select.com/props)
210
+ */
49
211
  tabSelectsValue?: ReactSelectAsyncCreatableProps['tabSelectsValue'];
212
+ /**
213
+ * The value of the select; reflected by the selected option
214
+ * <br>
215
+ * [Props from React select was used](https://react-select.com/props)
216
+ */
50
217
  value?: ReactSelectAsyncCreatableProps['value'];
218
+ /**
219
+ * The default set of options to show before the user starts searching. When set to true, the results for loadOptions('') will be autoloaded.
220
+ * <br>
221
+ * [Props from React select was used](https://react-select.com/props)
222
+ */
51
223
  defaultOptions?: ReactSelectAsyncCreatableProps['defaultOptions'];
224
+ /**
225
+ * Function that returns a promise, which is the set of options to be used once the promise resolves.
226
+ * <br>
227
+ * [Props from React select was used](https://react-select.com/props)
228
+ */
52
229
  loadOptions: ReactSelectAsyncCreatableProps['loadOptions'];
230
+ /**
231
+ * If cacheOptions is truthy, then the loaded data will be cached. The cache will remain until cacheOptions changes value.
232
+ * <br>
233
+ * [Props from React select was used](https://react-select.com/props)
234
+ */
53
235
  cacheOptions?: ReactSelectAsyncCreatableProps['cacheOptions'];
236
+ /**
237
+ * Allow options to be created while the isLoading prop is true. Useful to prevent the "create new ..." option being displayed while async results are still being loaded.
238
+ * <br>
239
+ * [Props from React select was used](https://react-select.com/props)
240
+ */
54
241
  allowCreateWhileLoading?: ReactSelectAsyncCreatableProps['allowCreateWhileLoading'];
242
+ /**
243
+ * Gets the label for the "create new ..." option in the menu. Is given the current input value.
244
+ * <br>
245
+ * [Props from React select was used](https://react-select.com/props)
246
+ */
55
247
  formatCreateLabel?: ReactSelectAsyncCreatableProps['formatCreateLabel'];
248
+ /**
249
+ * Determines whether the "create new ..." option should be displayed based on the current input value, select value and options array.
250
+ * <br>
251
+ * [Props from React select was used](https://react-select.com/props)
252
+ */
56
253
  isValidNewOption?: ReactSelectAsyncCreatableProps['isValidNewOption'];
254
+ /**
255
+ * Returns the data for the new option when it is created. Used to display the value, and is passed to onChange.
256
+ * <br>
257
+ * [Props from React select was used](https://react-select.com/props)
258
+ */
57
259
  getNewOptionData?: ReactSelectAsyncCreatableProps['getNewOptionData'];
260
+ /**
261
+ * If provided, this will be called with the input value when a new option is created, and onChange will not be called. Use this when you need more control over what happens when new options are created.
262
+ * <br>
263
+ * [Props from React select was used](https://react-select.com/props)
264
+ */
58
265
  onCreateOption?: ReactSelectAsyncCreatableProps['onCreateOption'];
266
+ /**
267
+ * Sets the position of the createOption element in your options list.
268
+ * <br>
269
+ * [Props from React select was used](https://react-select.com/props)
270
+ */
59
271
  createOptionPosition?: ReactSelectAsyncCreatableProps['createOptionPosition'];
272
+ /**
273
+ * Determines if option groups will be separated by a divider
274
+ */
60
275
  showOptionGroupDivider?: boolean;
61
276
  };
62
277
  declare const AsyncCreatableSelectInput: {
63
278
  (props: TAsyncCreatableSelectInputProps): import("@emotion/react/jsx-runtime").JSX.Element;
64
279
  displayName: string;
65
280
  defaultProps: Pick<TAsyncCreatableSelectInputProps, "value" | "isSearchable" | "menuPortalZIndex">;
281
+ /**
282
+ * Expose static helper methods.
283
+ */
66
284
  isTouched(touched: unknown): boolean;
285
+ /**
286
+ * Expose react-select components for customization purposes.
287
+ */
67
288
  ClearIndicator: {
68
289
  (props: import("@commercetools-uikit/select-utils").TClearIndicatorProps): import("@emotion/react/jsx-runtime").JSX.Element;
69
290
  displayName: string;
@@ -79,7 +300,11 @@ declare const AsyncCreatableSelectInput: {
79
300
  GroupHeading: <Option_4, IsMulti_4 extends boolean, Group_4 extends GroupBase<Option_4>>(props: import("react-select").GroupHeadingProps<Option_4, IsMulti_4, Group_4>) => import("@emotion/react").jsx.JSX.Element;
80
301
  IndicatorSeparator: <Option_6, IsMulti_6 extends boolean, Group_6 extends GroupBase<Option_6>>(props: import("react-select").IndicatorSeparatorProps<Option_6, IsMulti_6, Group_6>) => import("@emotion/react").jsx.JSX.Element;
81
302
  IndicatorsContainer: <Option_5, IsMulti_5 extends boolean, Group_5 extends GroupBase<Option_5>>(props: import("react-select").IndicatorsContainerProps<Option_5, IsMulti_5, Group_5>) => import("@emotion/react").jsx.JSX.Element;
82
- Input: <Option_7, IsMulti_7 extends boolean, Group_7 extends GroupBase<Option_7>>(props: import("react-select").InputProps<Option_7, IsMulti_7, Group_7>) => import("@emotion/react").jsx.JSX.Element;
303
+ Input: <Option_7, IsMulti_7 extends boolean, Group_7 extends GroupBase<Option_7>>(props: import("react-select").InputProps<Option_7, IsMulti_7, Group_7>) => import("@emotion/react" /**
304
+ * Is the select value clearable
305
+ * <br>
306
+ * [Props from React select was used](https://react-select.com/props)
307
+ */).jsx.JSX.Element;
83
308
  LoadingIndicator: {
84
309
  (): import("@emotion/react/jsx-runtime").JSX.Element;
85
310
  displayName: string;
@@ -89,7 +314,13 @@ declare const AsyncCreatableSelectInput: {
89
314
  MenuList: <Option_10, IsMulti_10 extends boolean, Group_10 extends GroupBase<Option_10>>(props: import("react-select").MenuListProps<Option_10, IsMulti_10, Group_10>) => import("@emotion/react").jsx.JSX.Element;
90
315
  MenuPortal: <Option_11, IsMulti_11 extends boolean, Group_11 extends GroupBase<Option_11>>(props: import("react-select/dist/declarations/src/components/Menu").MenuPortalProps<Option_11, IsMulti_11, Group_11>) => import("@emotion/react").jsx.JSX.Element | null;
91
316
  MultiValue: <Option_14, IsMulti_14 extends boolean, Group_14 extends GroupBase<Option_14>>(props: import("react-select").MultiValueProps<Option_14, IsMulti_14, Group_14>) => import("@emotion/react").jsx.JSX.Element;
92
- MultiValueContainer: <Option_15, IsMulti_15 extends boolean, Group_15 extends GroupBase<Option_15>>({ children, innerProps, }: import("react-select").MultiValueGenericProps<Option_15, IsMulti_15, Group_15>) => import("@emotion/react").jsx.JSX.Element;
317
+ MultiValueContainer: <Option_15, IsMulti_15 extends boolean, Group_15 extends GroupBase<Option_15>>({ children, innerProps, }: import("react-select").MultiValueGenericProps<Option_15, IsMulti_15, Group_15>) => import(
318
+ /**
319
+ * whether the menu should block scroll while open
320
+ * <br>
321
+ * [Props from React select was used](https://react-select.com/props)
322
+ */
323
+ "@emotion/react").jsx.JSX.Element;
93
324
  MultiValueLabel: <Option_15, IsMulti_15 extends boolean, Group_15 extends GroupBase<Option_15>>({ children, innerProps, }: import("react-select").MultiValueGenericProps<Option_15, IsMulti_15, Group_15>) => import("@emotion/react").jsx.JSX.Element;
94
325
  MultiValueRemove: {
95
326
  (props: import("@commercetools-uikit/select-utils").TTagRemoveProps): import("@emotion/react/jsx-runtime").JSX.Element;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@commercetools-uikit/async-creatable-select-input",
3
3
  "description": "An input component getting a selection from an asynchronously loaded list from the user, and where options can be created by the user.",
4
- "version": "19.8.0",
4
+ "version": "19.10.0",
5
5
  "bugs": "https://github.com/commercetools/ui-kit/issues",
6
6
  "repository": {
7
7
  "type": "git",
@@ -21,14 +21,14 @@
21
21
  "dependencies": {
22
22
  "@babel/runtime": "^7.20.13",
23
23
  "@babel/runtime-corejs3": "^7.20.13",
24
- "@commercetools-uikit/constraints": "19.8.0",
25
- "@commercetools-uikit/design-system": "19.8.0",
26
- "@commercetools-uikit/icons": "19.8.0",
27
- "@commercetools-uikit/loading-spinner": "19.8.0",
28
- "@commercetools-uikit/select-utils": "19.8.0",
29
- "@commercetools-uikit/spacings": "19.8.0",
30
- "@commercetools-uikit/text": "19.8.0",
31
- "@commercetools-uikit/utils": "19.8.0",
24
+ "@commercetools-uikit/constraints": "19.10.0",
25
+ "@commercetools-uikit/design-system": "19.10.0",
26
+ "@commercetools-uikit/icons": "19.10.0",
27
+ "@commercetools-uikit/loading-spinner": "19.10.0",
28
+ "@commercetools-uikit/select-utils": "19.10.0",
29
+ "@commercetools-uikit/spacings": "19.10.0",
30
+ "@commercetools-uikit/text": "19.10.0",
31
+ "@commercetools-uikit/utils": "19.10.0",
32
32
  "@emotion/is-prop-valid": "1.2.2",
33
33
  "@emotion/react": "^11.10.5",
34
34
  "@emotion/styled": "^11.10.5",