@commercetools-uikit/async-select-input 14.0.0 → 14.0.6

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/README.md CHANGED
@@ -88,7 +88,7 @@ export default Example;
88
88
  | `name` | `AsyncProps['name']` | | | Name of the HTML Input (optional - without this, no input will be rendered)&#xA;<br>&#xA;[Props from React select was used](https://react-select.com/props) |
89
89
  | `noOptionsMessage` | `AsyncProps['noOptionsMessage']` | | | 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.&#xA;<br>&#xA;[Props from React select was used](https://react-select.com/props) |
90
90
  | `onBlur` | `Function`<br/>[See signature.](#signature-onBlur) | | | Handle blur events on the control |
91
- | `onChange` | `Function`<br/>[See signature.](#signature-onChange) || | 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`. |
91
+ | `onChange` | `Function`<br/>[See signature.](#signature-onChange) | | | 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`. |
92
92
  | `onFocus` | `AsyncProps['onFocus']` | | | Handle focus events on the control&#xA;<br>&#xA;[Props from React select was used](https://react-select.com/props) |
93
93
  | `onInputChange` | `AsyncProps['onInputChange']` | | | Handle change events on the input&#xA;<br>&#xA;[Props from React select was used](https://react-select.com/props) |
94
94
  | `placeholder` | `AsyncProps['placeholder']` | | | Placeholder text for the select value&#xA;<br>&#xA;[Props from React select was used](https://react-select.com/props) |
@@ -107,13 +107,13 @@ export default Example;
107
107
  ### Signature `onBlur`
108
108
 
109
109
  ```ts
110
- (event: TEvent) => void
110
+ (event: TCustomEvent) => void
111
111
  ```
112
112
 
113
113
  ### Signature `onChange`
114
114
 
115
115
  ```ts
116
- (event: TEvent, info: ActionMeta<unknown>) => void
116
+ (event: TCustomEvent, info: ActionMeta<unknown>) => void
117
117
  ```
118
118
 
119
119
  This input is built on top of [`react-select`](https://github.com/JedWatson/react-select) v2.
@@ -125,36 +125,35 @@ In case you need one of the currently excluded props, feel free to open a PR add
125
125
 
126
126
  #### `isTouched(touched)`
127
127
 
128
- Expects to be called with an array or boolean.
129
- Returns `true` when truthy.
128
+ Returns truthy value for the Formik `touched` value of this input field.
130
129
 
131
- #### Components
130
+ ## Components
132
131
 
133
- It is possible to customize `SelectInput` by passing the `components` property.
134
- `SelectInput` exports the default underlying components as static exports.
132
+ It is possible to customize `AsyncSelectInput` by passing the `components` property.
133
+ `AsyncSelectInput` exports the default underlying components as static exports.
135
134
 
136
135
  Components available as static exports are:
137
136
 
138
137
  - `ClearIndicator`
139
138
  - `Control`
140
- - `DropdownIndicator`
141
- - `DownChevron`
142
139
  - `CrossIcon`
140
+ - `DownChevron`
141
+ - `DropdownIndicator`
143
142
  - `Group`
144
143
  - `GroupHeading`
145
144
  - `IndicatorsContainer`
146
145
  - `IndicatorSeparator`
147
146
  - `Input`
148
147
  - `LoadingIndicator`
148
+ - `LoadingMessage`
149
149
  - `Menu`
150
150
  - `MenuList`
151
151
  - `MenuPortal`
152
- - `LoadingMessage`
153
- - `NoOptionsMessage`
154
152
  - `MultiValue`
155
153
  - `MultiValueContainer`
156
154
  - `MultiValueLabel`
157
155
  - `MultiValueRemove`
156
+ - `NoOptionsMessage`
158
157
  - `Option`
159
158
  - `Placeholder`
160
159
  - `SelectContainer`
@@ -67,6 +67,11 @@ var defaultProps = {
67
67
  var AsyncSelectInput = function AsyncSelectInput(props) {
68
68
  var theme = react.useTheme();
69
69
  var intl = reactIntl.useIntl();
70
+
71
+ if (!props.isReadOnly) {
72
+ process.env.NODE_ENV !== "production" ? utils.warning(typeof props.onChange === 'function', 'AsyncSelectInput: `onChange` is required when input is not read only.') : void 0;
73
+ }
74
+
70
75
  var placeholder = props.placeholder || intl.formatMessage(selectUtils.messages.placeholder);
71
76
 
72
77
  var loadingMessage = function loadingMessage() {
@@ -134,6 +139,7 @@ var AsyncSelectInput = function AsyncSelectInput(props) {
134
139
  onBlur: props.onBlur ? function () {
135
140
  var event = {
136
141
  target: {
142
+ id: props.id,
137
143
  name: function () {
138
144
  if (!props.name) return undefined;
139
145
  if (!props.isMulti) return props.name; // We append the ".0" to make Formik set the touched
@@ -149,14 +155,17 @@ var AsyncSelectInput = function AsyncSelectInput(props) {
149
155
  props.onBlur && props.onBlur(event);
150
156
  } : undefined,
151
157
  onChange: function onChange(value, info) {
158
+ var _props$onChange;
159
+
152
160
  var newValue = value;
153
161
 
154
162
  if (props.isMulti && !newValue) {
155
163
  newValue = [];
156
164
  }
157
165
 
158
- props.onChange({
166
+ (_props$onChange = props.onChange) === null || _props$onChange === void 0 ? void 0 : _props$onChange.call(props, {
159
167
  target: {
168
+ id: props.id,
160
169
  name: props.name,
161
170
  value: newValue
162
171
  },
@@ -172,17 +181,14 @@ var AsyncSelectInput = function AsyncSelectInput(props) {
172
181
  ,
173
182
  defaultOptions: props.defaultOptions,
174
183
  loadOptions: props.loadOptions,
175
- cacheOptions: props.cacheOptions // @ts-ignore
184
+ cacheOptions: props.cacheOptions // Extra props
185
+ // @ts-ignore: passed to the react-select components via `selectProps`.
176
186
  ,
177
187
  iconLeft: props.iconLeft
178
188
  })
179
189
  }))
180
190
  });
181
- }; // Formik will set the field to an array on submission, so we always have to
182
- // deal with an array. The touched state ends up being an empty array in case
183
- // values were removed only. So we have to treat any array we receive as
184
- // a signal of the field having been touched.
185
-
191
+ };
186
192
 
187
193
  AsyncSelectInput.propTypes = process.env.NODE_ENV !== "production" ? {
188
194
  horizontalConstraint: _pt__default["default"].oneOf([3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 'scale', 'auto']),
@@ -192,26 +198,63 @@ AsyncSelectInput.propTypes = process.env.NODE_ENV !== "production" ? {
192
198
  isAutofocussed: _pt__default["default"].bool,
193
199
  menuPortalZIndex: _pt__default["default"].number.isRequired,
194
200
  onBlur: _pt__default["default"].func,
195
- onChange: _pt__default["default"].func.isRequired,
201
+ onChange: _pt__default["default"].func,
196
202
  loadingMessage: _pt__default["default"].oneOfType([_pt__default["default"].string, _pt__default["default"].func]),
197
203
  defaultOptions: _pt__default["default"].oneOfType([_pt__default["default"].any, _pt__default["default"].bool]),
198
204
  showOptionGroupDivider: _pt__default["default"].bool,
199
205
  iconLeft: _pt__default["default"].node
200
206
  } : {};
207
+ AsyncSelectInput.displayName = 'AsyncSelectInput';
208
+ AsyncSelectInput.defaultProps = defaultProps;
209
+ /**
210
+ * Expose static helper methods.
211
+ */
212
+ // Formik will set the field to an array on submission, so we always have to
213
+ // deal with an array. The touched state ends up being an empty array in case
214
+ // values were removed only. So we have to treat any array we receive as
215
+ // a signal of the field having been touched.
201
216
 
202
217
  AsyncSelectInput.isTouched = function (touched) {
203
218
  return Boolean(touched);
204
219
  };
220
+ /**
221
+ * Expose react-select components for customization purposes.
222
+ */
223
+ // custom
205
224
 
206
- AsyncSelectInput.displayName = 'AsyncSelectInput';
207
- AsyncSelectInput.defaultProps = defaultProps;
208
- utils.addStaticFields(AsyncSelectInput, _objectSpread(_objectSpread(_objectSpread({}, reactSelect.components), customizedComponents), {}, {
209
- isTouched: AsyncSelectInput.isTouched
210
- }));
225
+
226
+ AsyncSelectInput.ClearIndicator = customizedComponents.ClearIndicator;
227
+ AsyncSelectInput.Control = reactSelect.components.Control;
228
+ AsyncSelectInput.CrossIcon = reactSelect.components.CrossIcon;
229
+ AsyncSelectInput.DownChevron = reactSelect.components.DownChevron; // custom
230
+
231
+ AsyncSelectInput.DropdownIndicator = customizedComponents.DropdownIndicator;
232
+ AsyncSelectInput.Group = reactSelect.components.Group;
233
+ AsyncSelectInput.GroupHeading = reactSelect.components.GroupHeading;
234
+ AsyncSelectInput.IndicatorSeparator = reactSelect.components.IndicatorSeparator;
235
+ AsyncSelectInput.IndicatorsContainer = reactSelect.components.IndicatorsContainer;
236
+ AsyncSelectInput.Input = reactSelect.components.Input; // custom
237
+
238
+ AsyncSelectInput.LoadingIndicator = customizedComponents.LoadingIndicator;
239
+ AsyncSelectInput.LoadingMessage = reactSelect.components.LoadingMessage;
240
+ AsyncSelectInput.Menu = reactSelect.components.Menu;
241
+ AsyncSelectInput.MenuList = reactSelect.components.MenuList;
242
+ AsyncSelectInput.MenuPortal = reactSelect.components.MenuPortal;
243
+ AsyncSelectInput.MultiValue = reactSelect.components.MultiValue;
244
+ AsyncSelectInput.MultiValueContainer = reactSelect.components.MultiValueContainer;
245
+ AsyncSelectInput.MultiValueLabel = reactSelect.components.MultiValueLabel; // custom
246
+
247
+ AsyncSelectInput.MultiValueRemove = customizedComponents.MultiValueRemove;
248
+ AsyncSelectInput.NoOptionsMessage = reactSelect.components.NoOptionsMessage;
249
+ AsyncSelectInput.Option = reactSelect.components.Option;
250
+ AsyncSelectInput.Placeholder = reactSelect.components.Placeholder;
251
+ AsyncSelectInput.SelectContainer = reactSelect.components.SelectContainer;
252
+ AsyncSelectInput.SingleValue = reactSelect.components.SingleValue;
253
+ AsyncSelectInput.ValueContainer = reactSelect.components.ValueContainer;
211
254
  var AsyncSelectInput$1 = AsyncSelectInput;
212
255
 
213
256
  // NOTE: This string will be replaced on build time with the package version.
214
- var version = "14.0.0";
257
+ var version = "14.0.6";
215
258
 
216
259
  exports["default"] = AsyncSelectInput$1;
217
260
  exports.version = version;
@@ -66,6 +66,9 @@ var defaultProps = {
66
66
  var AsyncSelectInput = function AsyncSelectInput(props) {
67
67
  var theme = react.useTheme();
68
68
  var intl = reactIntl.useIntl();
69
+
70
+ if (!props.isReadOnly) ;
71
+
69
72
  var placeholder = props.placeholder || intl.formatMessage(selectUtils.messages.placeholder);
70
73
 
71
74
  var loadingMessage = function loadingMessage() {
@@ -133,6 +136,7 @@ var AsyncSelectInput = function AsyncSelectInput(props) {
133
136
  onBlur: props.onBlur ? function () {
134
137
  var event = {
135
138
  target: {
139
+ id: props.id,
136
140
  name: function () {
137
141
  if (!props.name) return undefined;
138
142
  if (!props.isMulti) return props.name; // We append the ".0" to make Formik set the touched
@@ -148,14 +152,17 @@ var AsyncSelectInput = function AsyncSelectInput(props) {
148
152
  props.onBlur && props.onBlur(event);
149
153
  } : undefined,
150
154
  onChange: function onChange(value, info) {
155
+ var _props$onChange;
156
+
151
157
  var newValue = value;
152
158
 
153
159
  if (props.isMulti && !newValue) {
154
160
  newValue = [];
155
161
  }
156
162
 
157
- props.onChange({
163
+ (_props$onChange = props.onChange) === null || _props$onChange === void 0 ? void 0 : _props$onChange.call(props, {
158
164
  target: {
165
+ id: props.id,
159
166
  name: props.name,
160
167
  value: newValue
161
168
  },
@@ -171,33 +178,67 @@ var AsyncSelectInput = function AsyncSelectInput(props) {
171
178
  ,
172
179
  defaultOptions: props.defaultOptions,
173
180
  loadOptions: props.loadOptions,
174
- cacheOptions: props.cacheOptions // @ts-ignore
181
+ cacheOptions: props.cacheOptions // Extra props
182
+ // @ts-ignore: passed to the react-select components via `selectProps`.
175
183
  ,
176
184
  iconLeft: props.iconLeft
177
185
  })
178
186
  }))
179
187
  });
180
- }; // Formik will set the field to an array on submission, so we always have to
188
+ };
189
+
190
+ AsyncSelectInput.propTypes = {};
191
+ AsyncSelectInput.displayName = 'AsyncSelectInput';
192
+ AsyncSelectInput.defaultProps = defaultProps;
193
+ /**
194
+ * Expose static helper methods.
195
+ */
196
+ // Formik will set the field to an array on submission, so we always have to
181
197
  // deal with an array. The touched state ends up being an empty array in case
182
198
  // values were removed only. So we have to treat any array we receive as
183
199
  // a signal of the field having been touched.
184
200
 
185
-
186
- AsyncSelectInput.propTypes = {};
187
-
188
201
  AsyncSelectInput.isTouched = function (touched) {
189
202
  return Boolean(touched);
190
203
  };
191
-
192
- AsyncSelectInput.displayName = 'AsyncSelectInput';
193
- AsyncSelectInput.defaultProps = defaultProps;
194
- utils.addStaticFields(AsyncSelectInput, _objectSpread(_objectSpread(_objectSpread({}, reactSelect.components), customizedComponents), {}, {
195
- isTouched: AsyncSelectInput.isTouched
196
- }));
204
+ /**
205
+ * Expose react-select components for customization purposes.
206
+ */
207
+ // custom
208
+
209
+
210
+ AsyncSelectInput.ClearIndicator = customizedComponents.ClearIndicator;
211
+ AsyncSelectInput.Control = reactSelect.components.Control;
212
+ AsyncSelectInput.CrossIcon = reactSelect.components.CrossIcon;
213
+ AsyncSelectInput.DownChevron = reactSelect.components.DownChevron; // custom
214
+
215
+ AsyncSelectInput.DropdownIndicator = customizedComponents.DropdownIndicator;
216
+ AsyncSelectInput.Group = reactSelect.components.Group;
217
+ AsyncSelectInput.GroupHeading = reactSelect.components.GroupHeading;
218
+ AsyncSelectInput.IndicatorSeparator = reactSelect.components.IndicatorSeparator;
219
+ AsyncSelectInput.IndicatorsContainer = reactSelect.components.IndicatorsContainer;
220
+ AsyncSelectInput.Input = reactSelect.components.Input; // custom
221
+
222
+ AsyncSelectInput.LoadingIndicator = customizedComponents.LoadingIndicator;
223
+ AsyncSelectInput.LoadingMessage = reactSelect.components.LoadingMessage;
224
+ AsyncSelectInput.Menu = reactSelect.components.Menu;
225
+ AsyncSelectInput.MenuList = reactSelect.components.MenuList;
226
+ AsyncSelectInput.MenuPortal = reactSelect.components.MenuPortal;
227
+ AsyncSelectInput.MultiValue = reactSelect.components.MultiValue;
228
+ AsyncSelectInput.MultiValueContainer = reactSelect.components.MultiValueContainer;
229
+ AsyncSelectInput.MultiValueLabel = reactSelect.components.MultiValueLabel; // custom
230
+
231
+ AsyncSelectInput.MultiValueRemove = customizedComponents.MultiValueRemove;
232
+ AsyncSelectInput.NoOptionsMessage = reactSelect.components.NoOptionsMessage;
233
+ AsyncSelectInput.Option = reactSelect.components.Option;
234
+ AsyncSelectInput.Placeholder = reactSelect.components.Placeholder;
235
+ AsyncSelectInput.SelectContainer = reactSelect.components.SelectContainer;
236
+ AsyncSelectInput.SingleValue = reactSelect.components.SingleValue;
237
+ AsyncSelectInput.ValueContainer = reactSelect.components.ValueContainer;
197
238
  var AsyncSelectInput$1 = AsyncSelectInput;
198
239
 
199
240
  // NOTE: This string will be replaced on build time with the package version.
200
- var version = "14.0.0";
241
+ var version = "14.0.6";
201
242
 
202
243
  exports["default"] = AsyncSelectInput$1;
203
244
  exports.version = version;
@@ -13,7 +13,7 @@ import isEmpty from 'lodash/isEmpty';
13
13
  import { useTheme } from '@emotion/react';
14
14
  import { components } from 'react-select';
15
15
  import AsyncSelect from 'react-select/async';
16
- import { filterDataAttributes, addStaticFields } from '@commercetools-uikit/utils';
16
+ import { warning, filterDataAttributes } from '@commercetools-uikit/utils';
17
17
  import Constraints from '@commercetools-uikit/constraints';
18
18
  import LoadingSpinner from '@commercetools-uikit/loading-spinner';
19
19
  import { messages, customComponentsWithIcons, createSelectStyles, DropdownIndicator, ClearIndicator, TagRemove } from '@commercetools-uikit/select-utils';
@@ -47,6 +47,11 @@ var defaultProps = {
47
47
  var AsyncSelectInput = function AsyncSelectInput(props) {
48
48
  var theme = useTheme();
49
49
  var intl = useIntl();
50
+
51
+ if (!props.isReadOnly) {
52
+ process.env.NODE_ENV !== "production" ? warning(typeof props.onChange === 'function', 'AsyncSelectInput: `onChange` is required when input is not read only.') : void 0;
53
+ }
54
+
50
55
  var placeholder = props.placeholder || intl.formatMessage(messages.placeholder);
51
56
 
52
57
  var loadingMessage = function loadingMessage() {
@@ -114,6 +119,7 @@ var AsyncSelectInput = function AsyncSelectInput(props) {
114
119
  onBlur: props.onBlur ? function () {
115
120
  var event = {
116
121
  target: {
122
+ id: props.id,
117
123
  name: function () {
118
124
  if (!props.name) return undefined;
119
125
  if (!props.isMulti) return props.name; // We append the ".0" to make Formik set the touched
@@ -129,14 +135,17 @@ var AsyncSelectInput = function AsyncSelectInput(props) {
129
135
  props.onBlur && props.onBlur(event);
130
136
  } : undefined,
131
137
  onChange: function onChange(value, info) {
138
+ var _props$onChange;
139
+
132
140
  var newValue = value;
133
141
 
134
142
  if (props.isMulti && !newValue) {
135
143
  newValue = [];
136
144
  }
137
145
 
138
- props.onChange({
146
+ (_props$onChange = props.onChange) === null || _props$onChange === void 0 ? void 0 : _props$onChange.call(props, {
139
147
  target: {
148
+ id: props.id,
140
149
  name: props.name,
141
150
  value: newValue
142
151
  },
@@ -152,17 +161,14 @@ var AsyncSelectInput = function AsyncSelectInput(props) {
152
161
  ,
153
162
  defaultOptions: props.defaultOptions,
154
163
  loadOptions: props.loadOptions,
155
- cacheOptions: props.cacheOptions // @ts-ignore
164
+ cacheOptions: props.cacheOptions // Extra props
165
+ // @ts-ignore: passed to the react-select components via `selectProps`.
156
166
  ,
157
167
  iconLeft: props.iconLeft
158
168
  })
159
169
  }))
160
170
  });
161
- }; // Formik will set the field to an array on submission, so we always have to
162
- // deal with an array. The touched state ends up being an empty array in case
163
- // values were removed only. So we have to treat any array we receive as
164
- // a signal of the field having been touched.
165
-
171
+ };
166
172
 
167
173
  AsyncSelectInput.propTypes = process.env.NODE_ENV !== "production" ? {
168
174
  horizontalConstraint: _pt.oneOf([3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 'scale', 'auto']),
@@ -172,25 +178,62 @@ AsyncSelectInput.propTypes = process.env.NODE_ENV !== "production" ? {
172
178
  isAutofocussed: _pt.bool,
173
179
  menuPortalZIndex: _pt.number.isRequired,
174
180
  onBlur: _pt.func,
175
- onChange: _pt.func.isRequired,
181
+ onChange: _pt.func,
176
182
  loadingMessage: _pt.oneOfType([_pt.string, _pt.func]),
177
183
  defaultOptions: _pt.oneOfType([_pt.any, _pt.bool]),
178
184
  showOptionGroupDivider: _pt.bool,
179
185
  iconLeft: _pt.node
180
186
  } : {};
187
+ AsyncSelectInput.displayName = 'AsyncSelectInput';
188
+ AsyncSelectInput.defaultProps = defaultProps;
189
+ /**
190
+ * Expose static helper methods.
191
+ */
192
+ // Formik will set the field to an array on submission, so we always have to
193
+ // deal with an array. The touched state ends up being an empty array in case
194
+ // values were removed only. So we have to treat any array we receive as
195
+ // a signal of the field having been touched.
181
196
 
182
197
  AsyncSelectInput.isTouched = function (touched) {
183
198
  return Boolean(touched);
184
199
  };
185
-
186
- AsyncSelectInput.displayName = 'AsyncSelectInput';
187
- AsyncSelectInput.defaultProps = defaultProps;
188
- addStaticFields(AsyncSelectInput, _objectSpread(_objectSpread(_objectSpread({}, components), customizedComponents), {}, {
189
- isTouched: AsyncSelectInput.isTouched
190
- }));
200
+ /**
201
+ * Expose react-select components for customization purposes.
202
+ */
203
+ // custom
204
+
205
+
206
+ AsyncSelectInput.ClearIndicator = customizedComponents.ClearIndicator;
207
+ AsyncSelectInput.Control = components.Control;
208
+ AsyncSelectInput.CrossIcon = components.CrossIcon;
209
+ AsyncSelectInput.DownChevron = components.DownChevron; // custom
210
+
211
+ AsyncSelectInput.DropdownIndicator = customizedComponents.DropdownIndicator;
212
+ AsyncSelectInput.Group = components.Group;
213
+ AsyncSelectInput.GroupHeading = components.GroupHeading;
214
+ AsyncSelectInput.IndicatorSeparator = components.IndicatorSeparator;
215
+ AsyncSelectInput.IndicatorsContainer = components.IndicatorsContainer;
216
+ AsyncSelectInput.Input = components.Input; // custom
217
+
218
+ AsyncSelectInput.LoadingIndicator = customizedComponents.LoadingIndicator;
219
+ AsyncSelectInput.LoadingMessage = components.LoadingMessage;
220
+ AsyncSelectInput.Menu = components.Menu;
221
+ AsyncSelectInput.MenuList = components.MenuList;
222
+ AsyncSelectInput.MenuPortal = components.MenuPortal;
223
+ AsyncSelectInput.MultiValue = components.MultiValue;
224
+ AsyncSelectInput.MultiValueContainer = components.MultiValueContainer;
225
+ AsyncSelectInput.MultiValueLabel = components.MultiValueLabel; // custom
226
+
227
+ AsyncSelectInput.MultiValueRemove = customizedComponents.MultiValueRemove;
228
+ AsyncSelectInput.NoOptionsMessage = components.NoOptionsMessage;
229
+ AsyncSelectInput.Option = components.Option;
230
+ AsyncSelectInput.Placeholder = components.Placeholder;
231
+ AsyncSelectInput.SelectContainer = components.SelectContainer;
232
+ AsyncSelectInput.SingleValue = components.SingleValue;
233
+ AsyncSelectInput.ValueContainer = components.ValueContainer;
191
234
  var AsyncSelectInput$1 = AsyncSelectInput;
192
235
 
193
236
  // NOTE: This string will be replaced on build time with the package version.
194
- var version = "14.0.0";
237
+ var version = "14.0.6";
195
238
 
196
239
  export { AsyncSelectInput$1 as default, version };
@@ -1,9 +1,10 @@
1
1
  import type { ReactNode } from 'react';
2
2
  import { type ActionMeta, type GroupBase, type OptionsOrGroups } from 'react-select';
3
3
  import { type AsyncProps } from 'react-select/async';
4
- declare type TEvent = {
4
+ declare type TCustomEvent = {
5
5
  target: {
6
- name?: string;
6
+ id?: ReactSelectAsyncProps['inputId'];
7
+ name?: ReactSelectAsyncProps['name'];
7
8
  value?: unknown;
8
9
  };
9
10
  persist: () => void;
@@ -37,8 +38,8 @@ declare type TAsyncSelectInputProps = {
37
38
  closeMenuOnSelect?: ReactSelectAsyncProps['closeMenuOnSelect'];
38
39
  name?: ReactSelectAsyncProps['name'];
39
40
  noOptionsMessage?: ReactSelectAsyncProps['noOptionsMessage'];
40
- onBlur?: (event: TEvent) => void;
41
- onChange: (event: TEvent, info: ActionMeta<unknown>) => void;
41
+ onBlur?: (event: TCustomEvent) => void;
42
+ onChange?: (event: TCustomEvent, info: ActionMeta<unknown>) => void;
42
43
  onFocus?: ReactSelectAsyncProps['onFocus'];
43
44
  onInputChange?: ReactSelectAsyncProps['onInputChange'];
44
45
  placeholder?: ReactSelectAsyncProps['placeholder'];
@@ -54,8 +55,63 @@ declare type TAsyncSelectInputProps = {
54
55
  };
55
56
  declare const AsyncSelectInput: {
56
57
  (props: TAsyncSelectInputProps): import("@emotion/react/jsx-runtime").JSX.Element;
57
- isTouched(touched: unknown): boolean;
58
58
  displayName: string;
59
59
  defaultProps: Pick<TAsyncSelectInputProps, "value" | "isSearchable" | "menuPortalZIndex">;
60
+ isTouched(touched: unknown): boolean;
61
+ ClearIndicator: {
62
+ (props: {
63
+ innerProps: {
64
+ ref: import("react").LegacyRef<HTMLButtonElement>;
65
+ } & import("react").ClassAttributes<HTMLButtonElement> & import("react").ButtonHTMLAttributes<HTMLButtonElement>;
66
+ } & import("react-select").ClearIndicatorProps<unknown, boolean, GroupBase<unknown>>): import("@emotion/react/jsx-runtime").JSX.Element;
67
+ displayName: string;
68
+ };
69
+ Control: <Option_1, IsMulti_1 extends boolean, Group_1 extends GroupBase<Option_1>>(props: import("react-select").ControlProps<Option_1, IsMulti_1, Group_1>) => import("@emotion/react").jsx.JSX.Element;
70
+ CrossIcon: (props: import("react-select/dist/declarations/src/components/indicators").CrossIconProps) => import("@emotion/react").jsx.JSX.Element;
71
+ DownChevron: (props: import("react-select/dist/declarations/src/components/indicators").DownChevronProps) => import("@emotion/react").jsx.JSX.Element;
72
+ DropdownIndicator: {
73
+ (props: import("react-select").DropdownIndicatorProps<unknown, boolean, GroupBase<unknown>>): import("@emotion/react/jsx-runtime").JSX.Element;
74
+ displayName: string;
75
+ };
76
+ Group: <Option_3, IsMulti_3 extends boolean, Group_3 extends GroupBase<Option_3>>(props: import("react-select").GroupProps<Option_3, IsMulti_3, Group_3>) => import("@emotion/react").jsx.JSX.Element;
77
+ 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;
78
+ 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;
79
+ 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;
80
+ 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;
81
+ LoadingIndicator: {
82
+ (): import("@emotion/react/jsx-runtime").JSX.Element;
83
+ displayName: string;
84
+ };
85
+ LoadingMessage: {
86
+ <Option_11, IsMulti_11 extends boolean, Group_11 extends GroupBase<Option_11>>(props: import("react-select").NoticeProps<Option_11, IsMulti_11, Group_11>): import("@emotion/react").jsx.JSX.Element;
87
+ defaultProps: {
88
+ children: string;
89
+ };
90
+ };
91
+ Menu: <Option_9, IsMulti_9 extends boolean, Group_9 extends GroupBase<Option_9>>(props: import("react-select").MenuProps<Option_9, IsMulti_9, Group_9>) => import("@emotion/react").jsx.JSX.Element;
92
+ 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;
93
+ MenuPortal: typeof import("react-select/dist/declarations/src/components/Menu").MenuPortal;
94
+ MultiValue: <Option_13, IsMulti_13 extends boolean, Group_13 extends GroupBase<Option_13>>(props: import("react-select").MultiValueProps<Option_13, IsMulti_13, Group_13>) => import("@emotion/react").jsx.JSX.Element;
95
+ MultiValueContainer: <Option_14, IsMulti_14 extends boolean, Group_14 extends GroupBase<Option_14>>({ children, innerProps, }: import("react-select").MultiValueGenericProps<Option_14, IsMulti_14, Group_14>) => import("@emotion/react").jsx.JSX.Element;
96
+ MultiValueLabel: <Option_14_1, IsMulti_14_1 extends boolean, Group_14_1 extends GroupBase<Option_14_1>>({ children, innerProps, }: import("react-select").MultiValueGenericProps<Option_14_1, IsMulti_14_1, Group_14_1>) => import("@emotion/react").jsx.JSX.Element;
97
+ MultiValueRemove: {
98
+ (props: {
99
+ selectProps: {
100
+ isReadOnly: boolean;
101
+ } & import("react-select/dist/declarations/src/Select").Props<unknown, boolean, GroupBase<unknown>>;
102
+ } & import("react-select").MultiValueGenericProps<unknown, boolean, GroupBase<unknown>>): import("@emotion/react/jsx-runtime").JSX.Element;
103
+ displayName: string;
104
+ };
105
+ NoOptionsMessage: {
106
+ <Option_12, IsMulti_12 extends boolean, Group_12 extends GroupBase<Option_12>>(props: import("react-select").NoticeProps<Option_12, IsMulti_12, Group_12>): import("@emotion/react").jsx.JSX.Element;
107
+ defaultProps: {
108
+ children: string;
109
+ };
110
+ };
111
+ Option: <Option_15, IsMulti_15 extends boolean, Group_15 extends GroupBase<Option_15>>(props: import("react-select").OptionProps<Option_15, IsMulti_15, Group_15>) => import("@emotion/react").jsx.JSX.Element;
112
+ Placeholder: <Option_16, IsMulti_16 extends boolean, Group_16 extends GroupBase<Option_16>>(props: import("react-select").PlaceholderProps<Option_16, IsMulti_16, Group_16>) => import("@emotion/react").jsx.JSX.Element;
113
+ SelectContainer: <Option_17, IsMulti_17 extends boolean, Group_17 extends GroupBase<Option_17>>(props: import("react-select").ContainerProps<Option_17, IsMulti_17, Group_17>) => import("@emotion/react").jsx.JSX.Element;
114
+ SingleValue: <Option_18, IsMulti_18 extends boolean, Group_18 extends GroupBase<Option_18>>(props: import("react-select").SingleValueProps<Option_18, IsMulti_18, Group_18>) => import("@emotion/react").jsx.JSX.Element;
115
+ ValueContainer: <Option_19, IsMulti_19 extends boolean, Group_19 extends GroupBase<Option_19>>(props: import("react-select").ValueContainerProps<Option_19, IsMulti_19, Group_19>) => import("@emotion/react").jsx.JSX.Element;
60
116
  };
61
117
  export default AsyncSelectInput;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@commercetools-uikit/async-select-input",
3
3
  "description": "An input component getting a selection from an asynchronously loaded list from the user.",
4
- "version": "14.0.0",
4
+ "version": "14.0.6",
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.17.2",
23
23
  "@babel/runtime-corejs3": "^7.17.2",
24
- "@commercetools-uikit/constraints": "14.0.0",
24
+ "@commercetools-uikit/constraints": "14.0.1",
25
25
  "@commercetools-uikit/design-system": "14.0.0",
26
- "@commercetools-uikit/icons": "14.0.0",
27
- "@commercetools-uikit/loading-spinner": "14.0.0",
28
- "@commercetools-uikit/select-utils": "14.0.0",
29
- "@commercetools-uikit/spacings": "14.0.0",
30
- "@commercetools-uikit/text": "14.0.0",
31
- "@commercetools-uikit/utils": "14.0.0",
26
+ "@commercetools-uikit/icons": "14.0.1",
27
+ "@commercetools-uikit/loading-spinner": "14.0.6",
28
+ "@commercetools-uikit/select-utils": "14.0.6",
29
+ "@commercetools-uikit/spacings": "14.0.6",
30
+ "@commercetools-uikit/text": "14.0.1",
31
+ "@commercetools-uikit/utils": "14.0.1",
32
32
  "@emotion/react": "^11.4.0",
33
33
  "@emotion/styled": "^11.3.0",
34
34
  "lodash": "4.17.21",