@commercetools-uikit/search-select-input 16.0.0 → 16.1.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.
package/README.md CHANGED
@@ -60,47 +60,48 @@ export default Example;
60
60
 
61
61
  ## Properties
62
62
 
63
- | Props | Type | Required | Default | Description |
64
- | ------------------------ | ----------------------------------------------------------------------------------------------------- | :------: | ------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
65
- | `horizontalConstraint` | `union`<br/>Possible values:<br/>`, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 'scale', 'auto'` | | | Horizontal size limit of the input fields. |
66
- | `aria-label` | `AsyncProps['aria-label']` | | | Aria label (for assistive tech)&#xA;<br>&#xA;[Props from React select was used](https://react-select.com/props) |
67
- | `aria-labelledby` | `AsyncProps['aria-labelledby']` | | | HTML ID of an element that should be used as the label (for assistive tech)&#xA;<br>&#xA;[Props from React select was used](https://react-select.com/props) |
68
- | `aria-invalid` | `AsyncProps['aria-invalid']` | | | Indicate if the value entered in the input is invalid.&#xA;<br>&#xA;[Props from React select was used](https://react-select.com/props) |
69
- | `aria-errormessage` | `AsyncProps['aria-errormessage']` | | | HTML ID of an element containing an error message related to the input.&#xA;<br>&#xA;[Props from React select was used](https://react-select.com/props) |
70
- | `id` | `AsyncProps['inputId']` | | | The id of the search input. This forwarded as react-select's "inputId"&#xA;<br>&#xA;[Props from React select was used](https://react-select.com/props) |
71
- | `containerId` | `AsyncProps['id']` | | | The id to set on the SelectContainer component. This is forwarded as react-select's "id"&#xA;<br>&#xA;[Props from React select was used](https://react-select.com/props) |
72
- | `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) |
73
- | `placeholder` | `AsyncProps['placeholder']` | | | Placeholder text for the select value&#xA;<br>&#xA;[Props from React select was used](https://react-select.com/props) |
74
- | `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) |
75
- | `tabIndex` | `AsyncProps['tabIndex']` | | | Sets the tabIndex attribute on the input&#xA;<br>&#xA;[Props from React select was used](https://react-select.com/props) |
76
- | `value` | `AsyncProps['value']` | | `null` | The value of the select; reflected by the selected option&#xA;<br>&#xA;[Props from React select was used](https://react-select.com/props) |
77
- | `backspaceRemovesValue` | `AsyncProps['backspaceRemovesValue']` | | | Remove the currently focused option when the user presses backspace&#xA;<br>&#xA;[Props from React select was used](https://react-select.com/props) |
78
- | `hasError` | `boolean` | | | Indicates the input field has an error |
79
- | `hasWarning` | `boolean` | | | Indicates the input field has a warning |
80
- | `isReadOnly` | `boolean` | | | Is the select read-only |
81
- | `isDisabled` | `boolean` | | | Is the select disabled |
82
- | `isClearable` | `boolean` | | | Is the select value clearable |
83
- | `isOptionDisabled` | `AsyncProps['isOptionDisabled']` | | | Override the built-in logic to detect whether an option is disabled&#xA;<br>&#xA;[Props from React select was used](https://react-select.com/props) |
84
- | `isMulti` | `AsyncProps['isMulti']` | | | Support multiple selected options&#xA;<br>&#xA;[Props from React select was used](https://react-select.com/props) |
85
- | `isAutofocussed` | `boolean` | | | Focus the control when it is mounted. Renamed autoFocus of react-select |
86
- | `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) |
87
- | `maxMenuHeight` | `AsyncProps['maxMenuHeight']` | | `220` | Maximum height of the menu before scrolling&#xA;<br>&#xA;[Props from React select was used](https://react-select.com/props) |
88
- | `menuPortalTarget` | `AsyncProps['menuPortalTarget']` | | | Dom element to portal the select menu to&#xA;<br>&#xA;[Props from React select was used](https://react-select.com/props) |
89
- | `menuPortalZIndex` | `number` | | `1` | z-index value for the menu portal&#xA;<br>&#xA;Use in conjunction with `menuPortalTarget` |
90
- | `menuShouldBlockScroll` | `AsyncProps['menuShouldBlockScroll']` | | | whether the menu should block scroll while open&#xA;<br>&#xA;[Props from React select was used](https://react-select.com/props) |
91
- | `closeMenuOnSelect` | `AsyncProps['closeMenuOnSelect']` | | | Whether the menu should close after a value is selected. Defaults to `true`.&#xA;<br>&#xA;[Props from React select was used](https://react-select.com/props) |
92
- | `showOptionGroupDivider` | `boolean` | | | Determines if option groups will be separated by a divider |
93
- | `defaultOptions` | `AsyncProps['defaultOptions']` | | | The default set of options to show before the user starts searching. When set to `true`, the results for `loadOptions('')` will be autoloaded.&#xA;<br>&#xA;[Props from React select was used](https://react-select.com/props) |
94
- | `onBlur` | `Function`<br/>[See signature.](#signature-onBlur) | | | Handle blur events on the control |
95
- | `onChange` | `Function`<br/>[See signature.](#signature-onChange) | | | Called with a fake event when value changes.&#xA;<br />&#xA;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`. |
96
- | `onFocus` | `AsyncProps['onFocus']` | | | Handle focus events on the control&#xA;<br>&#xA;[Props from React select was used](https://react-select.com/props) |
97
- | `onInputChange` | `AsyncProps['onInputChange']` | | | Handle change events on the input&#xA;<br>&#xA;[Props from React select was used](https://react-select.com/props) |
98
- | `tabSelectsValue` | `AsyncProps['tabSelectsValue']` | | | Select the currently focused option when the user presses tab&#xA;<br>&#xA;[Props from React select was used](https://react-select.com/props) |
99
- | `loadOptions` | `AsyncProps['loadOptions']` || | Function that returns a promise, which is the set of options to be used once the promise resolves.&#xA;<br>&#xA;[Props from React select was used](https://react-select.com/props) |
100
- | `loadingMessage` | `union`<br/>Possible values:<br/>`string , (() => string)` | | | The text shown while the options are being loaded |
101
- | `cacheOptions` | `AsyncProps['cacheOptions']` | | | If cacheOptions is truthy, then the loaded data will be cached. The cache will remain until cacheOptions changes value.&#xA;<br>&#xA;[Props from React select was used](https://react-select.com/props) |
102
- | `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) |
103
- | `optionType` | `union`<br/>Possible values:<br/>`'single-property' , 'double-property' , 'multiple-properties'` | | | The style of the an option in the dropdown menu. It could be single lined option or an option with more and custom info |
63
+ | Props | Type | Required | Default | Description |
64
+ | -------------------------- | ----------------------------------------------------------------------------------------------------- | :------: | ------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
65
+ | `horizontalConstraint` | `union`<br/>Possible values:<br/>`, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 'scale', 'auto'` | | | Horizontal size limit of the input fields. |
66
+ | `aria-label` | `AsyncProps['aria-label']` | | | Aria label (for assistive tech)&#xA;<br>&#xA;[Props from React select was used](https://react-select.com/props) |
67
+ | `aria-labelledby` | `AsyncProps['aria-labelledby']` | | | HTML ID of an element that should be used as the label (for assistive tech)&#xA;<br>&#xA;[Props from React select was used](https://react-select.com/props) |
68
+ | `aria-invalid` | `AsyncProps['aria-invalid']` | | | Indicate if the value entered in the input is invalid.&#xA;<br>&#xA;[Props from React select was used](https://react-select.com/props) |
69
+ | `aria-errormessage` | `AsyncProps['aria-errormessage']` | | | HTML ID of an element containing an error message related to the input.&#xA;<br>&#xA;[Props from React select was used](https://react-select.com/props) |
70
+ | `id` | `AsyncProps['inputId']` | | | The id of the search input. This forwarded as react-select's "inputId"&#xA;<br>&#xA;[Props from React select was used](https://react-select.com/props) |
71
+ | `containerId` | `AsyncProps['id']` | | | The id to set on the SelectContainer component. This is forwarded as react-select's "id"&#xA;<br>&#xA;[Props from React select was used](https://react-select.com/props) |
72
+ | `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) |
73
+ | `placeholder` | `AsyncProps['placeholder']` | | | Placeholder text for the select value&#xA;<br>&#xA;[Props from React select was used](https://react-select.com/props) |
74
+ | `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) |
75
+ | `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) |
76
+ | `tabIndex` | `AsyncProps['tabIndex']` | | | Sets the tabIndex attribute on the input&#xA;<br>&#xA;[Props from React select was used](https://react-select.com/props) |
77
+ | `value` | `AsyncProps['value']` | | `null` | The value of the select; reflected by the selected option&#xA;<br>&#xA;[Props from React select was used](https://react-select.com/props) |
78
+ | `backspaceRemovesValue` | `AsyncProps['backspaceRemovesValue']` | | | Remove the currently focused option when the user presses backspace&#xA;<br>&#xA;[Props from React select was used](https://react-select.com/props) |
79
+ | `hasError` | `boolean` | | | Indicates the input field has an error |
80
+ | `hasWarning` | `boolean` | | | Indicates the input field has a warning |
81
+ | `isReadOnly` | `boolean` | | | Is the select read-only |
82
+ | `isDisabled` | `boolean` | | | Is the select disabled |
83
+ | `isClearable` | `boolean` | | | Is the select value clearable |
84
+ | `isOptionDisabled` | `AsyncProps['isOptionDisabled']` | | | Override the built-in logic to detect whether an option is disabled&#xA;<br>&#xA;[Props from React select was used](https://react-select.com/props) |
85
+ | `isMulti` | `AsyncProps['isMulti']` | | | Support multiple selected options&#xA;<br>&#xA;[Props from React select was used](https://react-select.com/props) |
86
+ | `isAutofocussed` | `boolean` | | | Focus the control when it is mounted. Renamed autoFocus of react-select |
87
+ | `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) |
88
+ | `maxMenuHeight` | `AsyncProps['maxMenuHeight']` | | `220` | Maximum height of the menu before scrolling&#xA;<br>&#xA;[Props from React select was used](https://react-select.com/props) |
89
+ | `menuPortalTarget` | `AsyncProps['menuPortalTarget']` | | | Dom element to portal the select menu to&#xA;<br>&#xA;[Props from React select was used](https://react-select.com/props) |
90
+ | `menuPortalZIndex` | `number` | | `1` | z-index value for the menu portal&#xA;<br>&#xA;Use in conjunction with `menuPortalTarget` |
91
+ | `menuShouldBlockScroll` | `AsyncProps['menuShouldBlockScroll']` | | | whether the menu should block scroll while open&#xA;<br>&#xA;[Props from React select was used](https://react-select.com/props) |
92
+ | `closeMenuOnSelect` | `AsyncProps['closeMenuOnSelect']` | | | Whether the menu should close after a value is selected. Defaults to `true`.&#xA;<br>&#xA;[Props from React select was used](https://react-select.com/props) |
93
+ | `showOptionGroupDivider` | `boolean` | | | Determines if option groups will be separated by a divider |
94
+ | `defaultOptions` | `AsyncProps['defaultOptions']` | | | The default set of options to show before the user starts searching. When set to `true`, the results for `loadOptions('')` will be autoloaded.&#xA;<br>&#xA;[Props from React select was used](https://react-select.com/props) |
95
+ | `onBlur` | `Function`<br/>[See signature.](#signature-onBlur) | | | Handle blur events on the control |
96
+ | `onChange` | `Function`<br/>[See signature.](#signature-onChange) | | | Called with a fake event when value changes.&#xA;<br />&#xA;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`. |
97
+ | `onFocus` | `AsyncProps['onFocus']` | | | Handle focus events on the control&#xA;<br>&#xA;[Props from React select was used](https://react-select.com/props) |
98
+ | `onInputChange` | `AsyncProps['onInputChange']` | | | Handle change events on the input&#xA;<br>&#xA;[Props from React select was used](https://react-select.com/props) |
99
+ | `tabSelectsValue` | `AsyncProps['tabSelectsValue']` | | | Select the currently focused option when the user presses tab&#xA;<br>&#xA;[Props from React select was used](https://react-select.com/props) |
100
+ | `loadOptions` | `AsyncProps['loadOptions']` || | Function that returns a promise, which is the set of options to be used once the promise resolves.&#xA;<br>&#xA;[Props from React select was used](https://react-select.com/props) |
101
+ | `loadingMessage` | `union`<br/>Possible values:<br/>`string , (() => string)` | | | The text shown while the options are being loaded |
102
+ | `cacheOptions` | `AsyncProps['cacheOptions']` | | | If cacheOptions is truthy, then the loaded data will be cached. The cache will remain until cacheOptions changes value.&#xA;<br>&#xA;[Props from React select was used](https://react-select.com/props) |
103
+ | `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) |
104
+ | `optionType` | `union`<br/>Possible values:<br/>`'single-property' , 'double-property' , 'multiple-properties'` | | | The style of the an option in the dropdown menu. It could be single lined option or an option with more and custom info |
104
105
 
105
106
  ## Signatures
106
107
 
@@ -62,34 +62,28 @@ const SearchSelectInputWrapper = /*#__PURE__*/_styled__default["default"]("div",
62
62
  label: "SearchSelectInputWrapper"
63
63
  })(props => {
64
64
  var _context;
65
-
66
65
  return !props.isDisabled && !props.isReadOnly ? _concatInstanceProperty__default["default"](_context = "div[class$='control'] {\n &:hover {\n cursor: text;\n }\n div[class$='indicatorContainer' i] {\n cursor: pointer;\n svg * {\n fill: ".concat(designSystem.designTokens.fontColorForSearchInputIcon, ";\n }\n :hover svg * {\n fill: ")).call(_context, designSystem.designTokens.fontColorForSearchInputIconWhenHovered, ";\n }\n }\n }") : '';
67
66
  }, ";" + (process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInNlYXJjaC1zZWxlY3QtaW5wdXQuc3R5bGVzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQU9DIiwiZmlsZSI6InNlYXJjaC1zZWxlY3QtaW5wdXQuc3R5bGVzLnRzIiwic291cmNlc0NvbnRlbnQiOlsiLyogZXNsaW50LWRpc2FibGUgaW1wb3J0L3ByZWZlci1kZWZhdWx0LWV4cG9ydCAqL1xuaW1wb3J0IHN0eWxlZCBmcm9tICdAZW1vdGlvbi9zdHlsZWQnO1xuaW1wb3J0IHsgZGVzaWduVG9rZW5zIH0gZnJvbSAnQGNvbW1lcmNldG9vbHMtdWlraXQvZGVzaWduLXN5c3RlbSc7XG5pbXBvcnQgdHlwZSB7IFRTZWFyY2hTZWxlY3RJbnB1dFByb3BzIH0gZnJvbSAnLi9zZWFyY2gtc2VsZWN0LWlucHV0JztcblxuY29uc3QgU2VhcmNoU2VsZWN0SW5wdXRXcmFwcGVyID0gc3R5bGVkLmRpdjxcbiAgUGljazxUU2VhcmNoU2VsZWN0SW5wdXRQcm9wcywgJ2lzRGlzYWJsZWQnIHwgJ2lzUmVhZE9ubHknPlxuPmBcbiAgJHsocHJvcHMpID0+XG4gICAgIXByb3BzLmlzRGlzYWJsZWQgJiYgIXByb3BzLmlzUmVhZE9ubHlcbiAgICAgID8gYGRpdltjbGFzcyQ9J2NvbnRyb2wnXSB7XG4gICAgICAgICY6aG92ZXIge1xuICAgICAgICAgIGN1cnNvcjogdGV4dDtcbiAgICAgICAgfVxuICAgICAgICBkaXZbY2xhc3MkPSdpbmRpY2F0b3JDb250YWluZXInIGldIHtcbiAgICAgICAgICBjdXJzb3I6IHBvaW50ZXI7XG4gICAgICAgICAgc3ZnICoge1xuICAgICAgICAgICAgZmlsbDogJHtkZXNpZ25Ub2tlbnMuZm9udENvbG9yRm9yU2VhcmNoSW5wdXRJY29ufTtcbiAgICAgICAgICB9XG4gICAgICAgICAgOmhvdmVyIHN2ZyAqIHtcbiAgICAgICAgICAgIGZpbGw6ICR7ZGVzaWduVG9rZW5zLmZvbnRDb2xvckZvclNlYXJjaElucHV0SWNvbldoZW5Ib3ZlcmVkfTtcbiAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgIH1gXG4gICAgICA6ICcnfVxuYDtcblxuZXhwb3J0IHsgU2VhcmNoU2VsZWN0SW5wdXRXcmFwcGVyIH07XG4iXX0= */"));
68
67
 
69
68
  function ownKeys(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
70
-
71
69
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
72
70
  const defaultProps = {
73
71
  value: null,
74
72
  menuPortalZIndex: 1,
75
- maxMenuHeight: 220
73
+ maxMenuHeight: 220,
74
+ controlShouldRenderValue: true
76
75
  };
77
-
78
76
  const SearchSelectInput = props => {
79
77
  const intl = reactIntl.useIntl();
80
-
81
78
  if (!props.isReadOnly) {
82
79
  process.env.NODE_ENV !== "production" ? utils.warning(typeof props.onChange === 'function', 'SearchSelectInput: `onChange` is required when input is not read only.') : void 0;
83
80
  }
84
-
85
81
  selectUtils.warnIfMenuPortalPropsAreMissing({
86
82
  menuPortalZIndex: props.menuPortalZIndex,
87
83
  menuPortalTarget: props.menuPortalTarget,
88
84
  componentName: 'SearchSelectInput'
89
85
  });
90
-
91
86
  const noOptionsMessage = props.noOptionsMessage || (() => intl.formatMessage(messages.noOptionsMessage));
92
-
93
87
  const loadingMessage = props.loadingMessage || intl.formatMessage(messages.loadingOptionsMessage);
94
88
  const placeholder = props.placeholder || intl.formatMessage(messages.placeholderMessage);
95
89
  const optionType = props.optionType;
@@ -115,7 +109,6 @@ const SearchSelectInput = props => {
115
109
  }))
116
110
  });
117
111
  };
118
-
119
112
  SearchSelectInput.propTypes = process.env.NODE_ENV !== "production" ? {
120
113
  horizontalConstraint: _pt__default["default"].oneOf([3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 'scale', 'auto']),
121
114
  hasError: _pt__default["default"].bool,
@@ -136,7 +129,7 @@ SearchSelectInput.displayName = 'SearchSelectInput';
136
129
  var SearchSelectInput$1 = SearchSelectInput;
137
130
 
138
131
  // NOTE: This string will be replaced on build time with the package version.
139
- var version = "16.0.0";
132
+ var version = "16.1.0";
140
133
 
141
134
  exports["default"] = SearchSelectInput$1;
142
135
  exports.version = version;
@@ -58,32 +58,26 @@ const SearchSelectInputWrapper = /*#__PURE__*/_styled__default["default"]("div",
58
58
  target: "e6cl9390"
59
59
  } )(props => {
60
60
  var _context;
61
-
62
61
  return !props.isDisabled && !props.isReadOnly ? _concatInstanceProperty__default["default"](_context = "div[class$='control'] {\n &:hover {\n cursor: text;\n }\n div[class$='indicatorContainer' i] {\n cursor: pointer;\n svg * {\n fill: ".concat(designSystem.designTokens.fontColorForSearchInputIcon, ";\n }\n :hover svg * {\n fill: ")).call(_context, designSystem.designTokens.fontColorForSearchInputIconWhenHovered, ";\n }\n }\n }") : '';
63
62
  }, ";" + ("" ));
64
63
 
65
64
  function ownKeys(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
66
-
67
65
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
68
66
  const defaultProps = {
69
67
  value: null,
70
68
  menuPortalZIndex: 1,
71
- maxMenuHeight: 220
69
+ maxMenuHeight: 220,
70
+ controlShouldRenderValue: true
72
71
  };
73
-
74
72
  const SearchSelectInput = props => {
75
73
  const intl = reactIntl.useIntl();
76
-
77
74
  if (!props.isReadOnly) ;
78
-
79
75
  selectUtils.warnIfMenuPortalPropsAreMissing({
80
76
  menuPortalZIndex: props.menuPortalZIndex,
81
77
  menuPortalTarget: props.menuPortalTarget,
82
78
  componentName: 'SearchSelectInput'
83
79
  });
84
-
85
80
  const noOptionsMessage = props.noOptionsMessage || (() => intl.formatMessage(messages.noOptionsMessage));
86
-
87
81
  const loadingMessage = props.loadingMessage || intl.formatMessage(messages.loadingOptionsMessage);
88
82
  const placeholder = props.placeholder || intl.formatMessage(messages.placeholderMessage);
89
83
  const optionType = props.optionType;
@@ -109,14 +103,13 @@ const SearchSelectInput = props => {
109
103
  }))
110
104
  });
111
105
  };
112
-
113
106
  SearchSelectInput.propTypes = {};
114
107
  SearchSelectInput.defaultProps = defaultProps;
115
108
  SearchSelectInput.displayName = 'SearchSelectInput';
116
109
  var SearchSelectInput$1 = SearchSelectInput;
117
110
 
118
111
  // NOTE: This string will be replaced on build time with the package version.
119
- var version = "16.0.0";
112
+ var version = "16.1.0";
120
113
 
121
114
  exports["default"] = SearchSelectInput$1;
122
115
  exports.version = version;
@@ -43,34 +43,28 @@ const SearchSelectInputWrapper = /*#__PURE__*/_styled("div", process.env.NODE_EN
43
43
  label: "SearchSelectInputWrapper"
44
44
  })(props => {
45
45
  var _context;
46
-
47
46
  return !props.isDisabled && !props.isReadOnly ? _concatInstanceProperty(_context = "div[class$='control'] {\n &:hover {\n cursor: text;\n }\n div[class$='indicatorContainer' i] {\n cursor: pointer;\n svg * {\n fill: ".concat(designTokens.fontColorForSearchInputIcon, ";\n }\n :hover svg * {\n fill: ")).call(_context, designTokens.fontColorForSearchInputIconWhenHovered, ";\n }\n }\n }") : '';
48
47
  }, ";" + (process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInNlYXJjaC1zZWxlY3QtaW5wdXQuc3R5bGVzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQU9DIiwiZmlsZSI6InNlYXJjaC1zZWxlY3QtaW5wdXQuc3R5bGVzLnRzIiwic291cmNlc0NvbnRlbnQiOlsiLyogZXNsaW50LWRpc2FibGUgaW1wb3J0L3ByZWZlci1kZWZhdWx0LWV4cG9ydCAqL1xuaW1wb3J0IHN0eWxlZCBmcm9tICdAZW1vdGlvbi9zdHlsZWQnO1xuaW1wb3J0IHsgZGVzaWduVG9rZW5zIH0gZnJvbSAnQGNvbW1lcmNldG9vbHMtdWlraXQvZGVzaWduLXN5c3RlbSc7XG5pbXBvcnQgdHlwZSB7IFRTZWFyY2hTZWxlY3RJbnB1dFByb3BzIH0gZnJvbSAnLi9zZWFyY2gtc2VsZWN0LWlucHV0JztcblxuY29uc3QgU2VhcmNoU2VsZWN0SW5wdXRXcmFwcGVyID0gc3R5bGVkLmRpdjxcbiAgUGljazxUU2VhcmNoU2VsZWN0SW5wdXRQcm9wcywgJ2lzRGlzYWJsZWQnIHwgJ2lzUmVhZE9ubHknPlxuPmBcbiAgJHsocHJvcHMpID0+XG4gICAgIXByb3BzLmlzRGlzYWJsZWQgJiYgIXByb3BzLmlzUmVhZE9ubHlcbiAgICAgID8gYGRpdltjbGFzcyQ9J2NvbnRyb2wnXSB7XG4gICAgICAgICY6aG92ZXIge1xuICAgICAgICAgIGN1cnNvcjogdGV4dDtcbiAgICAgICAgfVxuICAgICAgICBkaXZbY2xhc3MkPSdpbmRpY2F0b3JDb250YWluZXInIGldIHtcbiAgICAgICAgICBjdXJzb3I6IHBvaW50ZXI7XG4gICAgICAgICAgc3ZnICoge1xuICAgICAgICAgICAgZmlsbDogJHtkZXNpZ25Ub2tlbnMuZm9udENvbG9yRm9yU2VhcmNoSW5wdXRJY29ufTtcbiAgICAgICAgICB9XG4gICAgICAgICAgOmhvdmVyIHN2ZyAqIHtcbiAgICAgICAgICAgIGZpbGw6ICR7ZGVzaWduVG9rZW5zLmZvbnRDb2xvckZvclNlYXJjaElucHV0SWNvbldoZW5Ib3ZlcmVkfTtcbiAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgIH1gXG4gICAgICA6ICcnfVxuYDtcblxuZXhwb3J0IHsgU2VhcmNoU2VsZWN0SW5wdXRXcmFwcGVyIH07XG4iXX0= */"));
49
48
 
50
49
  function ownKeys(object, enumerableOnly) { var keys = _Object$keys(object); if (_Object$getOwnPropertySymbols) { var symbols = _Object$getOwnPropertySymbols(object); enumerableOnly && (symbols = _filterInstanceProperty(symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
51
-
52
50
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context = ownKeys(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context2 = ownKeys(Object(source))).call(_context2, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
53
51
  const defaultProps = {
54
52
  value: null,
55
53
  menuPortalZIndex: 1,
56
- maxMenuHeight: 220
54
+ maxMenuHeight: 220,
55
+ controlShouldRenderValue: true
57
56
  };
58
-
59
57
  const SearchSelectInput = props => {
60
58
  const intl = useIntl();
61
-
62
59
  if (!props.isReadOnly) {
63
60
  process.env.NODE_ENV !== "production" ? warning(typeof props.onChange === 'function', 'SearchSelectInput: `onChange` is required when input is not read only.') : void 0;
64
61
  }
65
-
66
62
  warnIfMenuPortalPropsAreMissing({
67
63
  menuPortalZIndex: props.menuPortalZIndex,
68
64
  menuPortalTarget: props.menuPortalTarget,
69
65
  componentName: 'SearchSelectInput'
70
66
  });
71
-
72
67
  const noOptionsMessage = props.noOptionsMessage || (() => intl.formatMessage(messages.noOptionsMessage));
73
-
74
68
  const loadingMessage = props.loadingMessage || intl.formatMessage(messages.loadingOptionsMessage);
75
69
  const placeholder = props.placeholder || intl.formatMessage(messages.placeholderMessage);
76
70
  const optionType = props.optionType;
@@ -96,7 +90,6 @@ const SearchSelectInput = props => {
96
90
  }))
97
91
  });
98
92
  };
99
-
100
93
  SearchSelectInput.propTypes = process.env.NODE_ENV !== "production" ? {
101
94
  horizontalConstraint: _pt.oneOf([3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 'scale', 'auto']),
102
95
  hasError: _pt.bool,
@@ -117,6 +110,6 @@ SearchSelectInput.displayName = 'SearchSelectInput';
117
110
  var SearchSelectInput$1 = SearchSelectInput;
118
111
 
119
112
  // NOTE: This string will be replaced on build time with the package version.
120
- var version = "16.0.0";
113
+ var version = "16.1.0";
121
114
 
122
115
  export { SearchSelectInput$1 as default, version };
@@ -20,6 +20,7 @@ export type TSearchSelectInputProps = {
20
20
  name?: ReactSelectAsyncProps['name'];
21
21
  placeholder?: ReactSelectAsyncProps['placeholder'];
22
22
  components?: ReactSelectAsyncProps['components'];
23
+ controlShouldRenderValue?: ReactSelectAsyncProps['controlShouldRenderValue'];
23
24
  tabIndex?: ReactSelectAsyncProps['tabIndex'];
24
25
  value?: ReactSelectAsyncProps['value'];
25
26
  backspaceRemovesValue?: ReactSelectAsyncProps['backspaceRemovesValue'];
@@ -52,7 +53,7 @@ export type TSearchSelectInputProps = {
52
53
  };
53
54
  declare const SearchSelectInput: {
54
55
  (props: TSearchSelectInputProps): import("@emotion/react/jsx-runtime").JSX.Element;
55
- defaultProps: Pick<TSearchSelectInputProps, "value" | "maxMenuHeight" | "menuPortalZIndex">;
56
+ defaultProps: Pick<TSearchSelectInputProps, "value" | "controlShouldRenderValue" | "maxMenuHeight" | "menuPortalZIndex">;
56
57
  displayName: string;
57
58
  };
58
59
  export default SearchSelectInput;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@commercetools-uikit/search-select-input",
3
3
  "description": "A search select input component built on top of `@commercetools-uikit/async-select-input` to asynchronously load results (options) using the keyword that the user has entered.",
4
- "version": "16.0.0",
4
+ "version": "16.1.0",
5
5
  "bugs": "https://github.com/commercetools/ui-kit/issues",
6
6
  "repository": {
7
7
  "type": "git",
@@ -21,12 +21,12 @@
21
21
  "dependencies": {
22
22
  "@babel/runtime": "^7.20.13",
23
23
  "@babel/runtime-corejs3": "^7.20.13",
24
- "@commercetools-uikit/async-select-input": "16.0.0",
25
- "@commercetools-uikit/design-system": "16.0.0",
26
- "@commercetools-uikit/select-utils": "16.0.0",
27
- "@commercetools-uikit/spacings": "16.0.0",
28
- "@commercetools-uikit/text": "16.0.0",
29
- "@commercetools-uikit/utils": "16.0.0",
24
+ "@commercetools-uikit/async-select-input": "16.1.0",
25
+ "@commercetools-uikit/design-system": "16.1.0",
26
+ "@commercetools-uikit/select-utils": "16.1.0",
27
+ "@commercetools-uikit/spacings": "16.1.0",
28
+ "@commercetools-uikit/text": "16.1.0",
29
+ "@commercetools-uikit/utils": "16.1.0",
30
30
  "@emotion/react": "^11.10.5",
31
31
  "@emotion/styled": "^11.10.5",
32
32
  "prop-types": "15.8.1"