@commercetools-uikit/async-select-input 19.11.0 → 19.12.1

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
@@ -64,6 +64,7 @@ export default Example;
64
64
  | `components` | `AsyncProps['components']` | | | Map of components to overwrite the default ones, see [what components you can override](https://react-select.com/components)&#xA;<br>&#xA;[Props from React select was used](https://react-select.com/props) |
65
65
  | `controlShouldRenderValue` | `AsyncProps['controlShouldRenderValue']` | | `true` | Control whether the selected values should be rendered in the control&#xA;<br>&#xA;[Props from React select was used](https://react-select.com/props) |
66
66
  | `filterOption` | `AsyncProps['filterOption']` | | | Custom method to filter whether an option should be displayed in the menu&#xA;<br>&#xA;[Props from React select was used](https://react-select.com/props) |
67
+ | `hideSelectedOptions` | `AsyncProps['hideSelectedOptions']` | | | Custom method to determine whether selected options should be displayed in the menu&#xA;<br>&#xA;[Props from React select was used](https://react-select.com/props) |
67
68
  | `id` | `AsyncProps['inputId']` | | | The id of the search input&#xA;<br>&#xA;[Props from React select was used](https://react-select.com/props) |
68
69
  | `inputValue` | `AsyncProps['inputValue']` | | | The value of the search input&#xA;<br>&#xA;[Props from React select was used](https://react-select.com/props) |
69
70
  | `containerId` | `AsyncProps['id']` | | | The id to set on the SelectContainer component&#xA;<br>&#xA;[Props from React select was used](https://react-select.com/props) |
@@ -105,7 +105,8 @@ const AsyncSelectInput = props => {
105
105
  controlShouldRenderValue: props.controlShouldRenderValue,
106
106
  horizontalConstraint: props.horizontalConstraint
107
107
  }),
108
- filterOption: props.filterOption
108
+ filterOption: props.filterOption,
109
+ hideSelectedOptions: props.hideSelectedOptions
109
110
  // react-select uses "id" (for the container) and "inputId" (for the input),
110
111
  // but we use "id" (for the input) and "containerId" (for the container)
111
112
  // instead.
@@ -142,7 +143,7 @@ const AsyncSelectInput = props => {
142
143
  // state as an array instead of a boolean only.
143
144
  // Otherwise the shapes would clash on submission, as
144
145
  // Formik will create an array on submission anyways.
145
- return "".concat(props.name, ".0");
146
+ return `${props.name}.0`;
146
147
  })()
147
148
  },
148
149
  persist: () => {}
@@ -150,12 +151,11 @@ const AsyncSelectInput = props => {
150
151
  props.onBlur && props.onBlur(event);
151
152
  } : undefined,
152
153
  onChange: (value, info) => {
153
- var _props$onChange;
154
154
  let newValue = value;
155
155
  if (props.isMulti && !newValue) {
156
156
  newValue = [];
157
157
  }
158
- (_props$onChange = props.onChange) === null || _props$onChange === void 0 || _props$onChange.call(props, {
158
+ props.onChange?.({
159
159
  target: {
160
160
  id: props.id,
161
161
  name: props.name,
@@ -249,7 +249,7 @@ AsyncSelectInput.ValueContainer = reactSelect.components.ValueContainer;
249
249
  var AsyncSelectInput$1 = AsyncSelectInput;
250
250
 
251
251
  // NOTE: This string will be replaced on build time with the package version.
252
- var version = "19.11.0";
252
+ var version = "19.12.1";
253
253
 
254
254
  exports["default"] = AsyncSelectInput$1;
255
255
  exports.version = version;
@@ -102,7 +102,8 @@ const AsyncSelectInput = props => {
102
102
  controlShouldRenderValue: props.controlShouldRenderValue,
103
103
  horizontalConstraint: props.horizontalConstraint
104
104
  }),
105
- filterOption: props.filterOption
105
+ filterOption: props.filterOption,
106
+ hideSelectedOptions: props.hideSelectedOptions
106
107
  // react-select uses "id" (for the container) and "inputId" (for the input),
107
108
  // but we use "id" (for the input) and "containerId" (for the container)
108
109
  // instead.
@@ -139,7 +140,7 @@ const AsyncSelectInput = props => {
139
140
  // state as an array instead of a boolean only.
140
141
  // Otherwise the shapes would clash on submission, as
141
142
  // Formik will create an array on submission anyways.
142
- return "".concat(props.name, ".0");
143
+ return `${props.name}.0`;
143
144
  })()
144
145
  },
145
146
  persist: () => {}
@@ -147,12 +148,11 @@ const AsyncSelectInput = props => {
147
148
  props.onBlur && props.onBlur(event);
148
149
  } : undefined,
149
150
  onChange: (value, info) => {
150
- var _props$onChange;
151
151
  let newValue = value;
152
152
  if (props.isMulti && !newValue) {
153
153
  newValue = [];
154
154
  }
155
- (_props$onChange = props.onChange) === null || _props$onChange === void 0 || _props$onChange.call(props, {
155
+ props.onChange?.({
156
156
  target: {
157
157
  id: props.id,
158
158
  name: props.name,
@@ -232,7 +232,7 @@ AsyncSelectInput.ValueContainer = reactSelect.components.ValueContainer;
232
232
  var AsyncSelectInput$1 = AsyncSelectInput;
233
233
 
234
234
  // NOTE: This string will be replaced on build time with the package version.
235
- var version = "19.11.0";
235
+ var version = "19.12.1";
236
236
 
237
237
  exports["default"] = AsyncSelectInput$1;
238
238
  exports.version = version;
@@ -85,7 +85,8 @@ const AsyncSelectInput = props => {
85
85
  controlShouldRenderValue: props.controlShouldRenderValue,
86
86
  horizontalConstraint: props.horizontalConstraint
87
87
  }),
88
- filterOption: props.filterOption
88
+ filterOption: props.filterOption,
89
+ hideSelectedOptions: props.hideSelectedOptions
89
90
  // react-select uses "id" (for the container) and "inputId" (for the input),
90
91
  // but we use "id" (for the input) and "containerId" (for the container)
91
92
  // instead.
@@ -122,7 +123,7 @@ const AsyncSelectInput = props => {
122
123
  // state as an array instead of a boolean only.
123
124
  // Otherwise the shapes would clash on submission, as
124
125
  // Formik will create an array on submission anyways.
125
- return "".concat(props.name, ".0");
126
+ return `${props.name}.0`;
126
127
  })()
127
128
  },
128
129
  persist: () => {}
@@ -130,12 +131,11 @@ const AsyncSelectInput = props => {
130
131
  props.onBlur && props.onBlur(event);
131
132
  } : undefined,
132
133
  onChange: (value, info) => {
133
- var _props$onChange;
134
134
  let newValue = value;
135
135
  if (props.isMulti && !newValue) {
136
136
  newValue = [];
137
137
  }
138
- (_props$onChange = props.onChange) === null || _props$onChange === void 0 || _props$onChange.call(props, {
138
+ props.onChange?.({
139
139
  target: {
140
140
  id: props.id,
141
141
  name: props.name,
@@ -229,6 +229,6 @@ AsyncSelectInput.ValueContainer = components.ValueContainer;
229
229
  var AsyncSelectInput$1 = AsyncSelectInput;
230
230
 
231
231
  // NOTE: This string will be replaced on build time with the package version.
232
- var version = "19.11.0";
232
+ var version = "19.12.1";
233
233
 
234
234
  export { AsyncSelectInput$1 as default, version };
@@ -79,6 +79,12 @@ export type TAsyncSelectInputProps = {
79
79
  * [Props from React select was used](https://react-select.com/props)
80
80
  */
81
81
  filterOption?: ReactSelectAsyncProps['filterOption'];
82
+ /**
83
+ * Custom method to determine whether selected options should be displayed in the menu
84
+ * <br>
85
+ * [Props from React select was used](https://react-select.com/props)
86
+ */
87
+ hideSelectedOptions?: ReactSelectAsyncProps['hideSelectedOptions'];
82
88
  /**
83
89
  * The id of the search input
84
90
  * <br>
@@ -298,11 +304,7 @@ declare const AsyncSelectInput: {
298
304
  };
299
305
  NoOptionsMessage: <Option_13, IsMulti_13 extends boolean, Group_13 extends GroupBase<Option_13>>({ children, innerProps, ...restProps }: import("react-select").NoticeProps<Option_13, IsMulti_13, Group_13>) => import("@emotion/react").jsx.JSX.Element;
300
306
  Option: <Option_16, IsMulti_16 extends boolean, Group_16 extends GroupBase<Option_16>>(props: import("react-select").OptionProps<Option_16, IsMulti_16, Group_16>) => import("@emotion/react").jsx.JSX.Element;
301
- Placeholder: <Option_17, IsMulti_17 extends boolean, Group_17 extends GroupBase<Option_17>>(props: import("react-select").PlaceholderProps<Option_17, IsMulti_17, Group_17>) => import("@emotion/react" /**
302
- * Name of the HTML Input (optional - without this, no input will be rendered)
303
- * <br>
304
- * [Props from React select was used](https://react-select.com/props)
305
- */).jsx.JSX.Element;
307
+ Placeholder: <Option_17, IsMulti_17 extends boolean, Group_17 extends GroupBase<Option_17>>(props: import("react-select").PlaceholderProps<Option_17, IsMulti_17, Group_17>) => import("@emotion/react").jsx.JSX.Element;
306
308
  SelectContainer: <Option_18, IsMulti_18 extends boolean, Group_18 extends GroupBase<Option_18>>(props: import("react-select").ContainerProps<Option_18, IsMulti_18, Group_18>) => import("@emotion/react").jsx.JSX.Element;
307
309
  SingleValue: <Option_19, IsMulti_19 extends boolean, Group_19 extends GroupBase<Option_19>>(props: import("react-select").SingleValueProps<Option_19, IsMulti_19, Group_19>) => import("@emotion/react").jsx.JSX.Element;
308
310
  ValueContainer: <Option_20, IsMulti_20 extends boolean, Group_20 extends GroupBase<Option_20>>(props: import("react-select").ValueContainerProps<Option_20, IsMulti_20, Group_20>) => import("@emotion/react").jsx.JSX.Element;
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": "19.11.0",
4
+ "version": "19.12.1",
5
5
  "bugs": "https://github.com/commercetools/ui-kit/issues",
6
6
  "repository": {
7
7
  "type": "git",
@@ -21,19 +21,19 @@
21
21
  "dependencies": {
22
22
  "@babel/runtime": "^7.20.13",
23
23
  "@babel/runtime-corejs3": "^7.20.13",
24
- "@commercetools-uikit/constraints": "19.11.0",
25
- "@commercetools-uikit/design-system": "19.11.0",
26
- "@commercetools-uikit/icons": "19.11.0",
27
- "@commercetools-uikit/loading-spinner": "19.11.0",
28
- "@commercetools-uikit/select-utils": "19.11.0",
29
- "@commercetools-uikit/spacings": "19.11.0",
30
- "@commercetools-uikit/text": "19.11.0",
31
- "@commercetools-uikit/utils": "19.11.0",
24
+ "@commercetools-uikit/constraints": "19.12.1",
25
+ "@commercetools-uikit/design-system": "19.12.1",
26
+ "@commercetools-uikit/icons": "19.12.1",
27
+ "@commercetools-uikit/loading-spinner": "19.12.1",
28
+ "@commercetools-uikit/select-utils": "19.12.1",
29
+ "@commercetools-uikit/spacings": "19.12.1",
30
+ "@commercetools-uikit/text": "19.12.1",
31
+ "@commercetools-uikit/utils": "19.12.1",
32
32
  "@emotion/react": "^11.10.5",
33
33
  "@emotion/styled": "^11.10.5",
34
34
  "lodash": "4.17.21",
35
35
  "prop-types": "15.8.1",
36
- "react-select": "5.8.0"
36
+ "react-select": "5.8.1"
37
37
  },
38
38
  "devDependencies": {
39
39
  "react": "17.0.2",