@commercetools-uikit/search-select-input 12.2.2 → 12.2.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
|
@@ -10,10 +10,9 @@ var _forEachInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/in
|
|
|
10
10
|
var _Object$getOwnPropertyDescriptors = require('@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptors');
|
|
11
11
|
var _Object$defineProperties = require('@babel/runtime-corejs3/core-js-stable/object/define-properties');
|
|
12
12
|
var _Object$defineProperty = require('@babel/runtime-corejs3/core-js-stable/object/define-property');
|
|
13
|
-
var _extends = require('@babel/runtime-corejs3/helpers/extends');
|
|
14
13
|
var _defineProperty = require('@babel/runtime-corejs3/helpers/defineProperty');
|
|
15
14
|
var _concatInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/concat');
|
|
16
|
-
var
|
|
15
|
+
var react = require('react');
|
|
17
16
|
var PropTypes = require('prop-types');
|
|
18
17
|
var reactIntl = require('react-intl');
|
|
19
18
|
var utils = require('@commercetools-uikit/utils');
|
|
@@ -21,7 +20,7 @@ var AsyncSelectInput = require('@commercetools-uikit/async-select-input');
|
|
|
21
20
|
var selectUtils = require('@commercetools-uikit/select-utils');
|
|
22
21
|
var _styled = require('@emotion/styled/base');
|
|
23
22
|
var designSystem = require('@commercetools-uikit/design-system');
|
|
24
|
-
var
|
|
23
|
+
var jsxRuntime = require('@emotion/react/jsx-runtime');
|
|
25
24
|
|
|
26
25
|
function _interopDefault (e) { return e && e.__esModule ? e : { 'default': e }; }
|
|
27
26
|
|
|
@@ -34,7 +33,6 @@ var _Object$getOwnPropertyDescriptors__default = /*#__PURE__*/_interopDefault(_O
|
|
|
34
33
|
var _Object$defineProperties__default = /*#__PURE__*/_interopDefault(_Object$defineProperties);
|
|
35
34
|
var _Object$defineProperty__default = /*#__PURE__*/_interopDefault(_Object$defineProperty);
|
|
36
35
|
var _concatInstanceProperty__default = /*#__PURE__*/_interopDefault(_concatInstanceProperty);
|
|
37
|
-
var React__default = /*#__PURE__*/_interopDefault(React);
|
|
38
36
|
var PropTypes__default = /*#__PURE__*/_interopDefault(PropTypes);
|
|
39
37
|
var AsyncSelectInput__default = /*#__PURE__*/_interopDefault(AsyncSelectInput);
|
|
40
38
|
var _styled__default = /*#__PURE__*/_interopDefault(_styled);
|
|
@@ -57,18 +55,18 @@ var messages = reactIntl.defineMessages({
|
|
|
57
55
|
}
|
|
58
56
|
});
|
|
59
57
|
|
|
60
|
-
var SearchSelectInputWrapper = _styled__default[
|
|
58
|
+
var SearchSelectInputWrapper = _styled__default["default"]("div", process.env.NODE_ENV === "production" ? {
|
|
61
59
|
target: "ec7yve10"
|
|
62
60
|
} : {
|
|
63
61
|
target: "ec7yve10",
|
|
64
62
|
label: "SearchSelectInputWrapper"
|
|
65
63
|
})(function (props) {
|
|
66
64
|
return !props.isDisabled && !props.isReadOnly ? "div[class$='control'] {\n &:hover {\n cursor: text;\n }\n div[class$='indicatorContainer' i] {\n cursor: pointer;\n svg * {\n fill: ".concat(designSystem.customProperties.colorSolid, ";\n }\n }\n }") : '';
|
|
67
|
-
}, ";");
|
|
65
|
+
}, ";" + (process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInNlYXJjaC1zZWxlY3QtaW5wdXQuc3R5bGVzLmpzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUkyQyIsImZpbGUiOiJzZWFyY2gtc2VsZWN0LWlucHV0LnN0eWxlcy5qcyIsInNvdXJjZXNDb250ZW50IjpbIi8qIGVzbGludC1kaXNhYmxlIGltcG9ydC9wcmVmZXItZGVmYXVsdC1leHBvcnQgKi9cbmltcG9ydCBzdHlsZWQgZnJvbSAnQGVtb3Rpb24vc3R5bGVkJztcbmltcG9ydCB7IGN1c3RvbVByb3BlcnRpZXMgYXMgdmFycyB9IGZyb20gJ0Bjb21tZXJjZXRvb2xzLXVpa2l0L2Rlc2lnbi1zeXN0ZW0nO1xuXG5jb25zdCBTZWFyY2hTZWxlY3RJbnB1dFdyYXBwZXIgPSBzdHlsZWQuZGl2YFxuICAkeyhwcm9wcykgPT5cbiAgICAhcHJvcHMuaXNEaXNhYmxlZCAmJiAhcHJvcHMuaXNSZWFkT25seVxuICAgICAgPyBgZGl2W2NsYXNzJD0nY29udHJvbCddIHtcbiAgICAgICAgJjpob3ZlciB7XG4gICAgICAgICAgY3Vyc29yOiB0ZXh0O1xuICAgICAgICB9XG4gICAgICAgIGRpdltjbGFzcyQ9J2luZGljYXRvckNvbnRhaW5lcicgaV0ge1xuICAgICAgICAgIGN1cnNvcjogcG9pbnRlcjtcbiAgICAgICAgICBzdmcgKiB7XG4gICAgICAgICAgICBmaWxsOiAke3ZhcnMuY29sb3JTb2xpZH07XG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICB9YFxuICAgICAgOiAnJ31cbmA7XG5cbmV4cG9ydCB7IFNlYXJjaFNlbGVjdElucHV0V3JhcHBlciB9O1xuIl19 */"));
|
|
68
66
|
|
|
69
|
-
function ownKeys(object, enumerableOnly) { var keys = _Object$keys__default[
|
|
67
|
+
function ownKeys(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); if (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
68
|
|
|
71
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { var _context3; _forEachInstanceProperty__default[
|
|
69
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { var _context3; _forEachInstanceProperty__default["default"](_context3 = ownKeys(Object(source), true)).call(_context3, function (key) { _defineProperty(target, key, source[key]); }); } else if (_Object$getOwnPropertyDescriptors__default["default"]) { _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)); } else { var _context4; _forEachInstanceProperty__default["default"](_context4 = ownKeys(Object(source))).call(_context4, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } } return target; }
|
|
72
70
|
|
|
73
71
|
var SearchSelectInput = function SearchSelectInput(props) {
|
|
74
72
|
var intl = reactIntl.useIntl();
|
|
@@ -80,11 +78,11 @@ var SearchSelectInput = function SearchSelectInput(props) {
|
|
|
80
78
|
var loadingMessage = props.loadingMessage || intl.formatMessage(messages.loadingOptionsMessage);
|
|
81
79
|
var placeholder = props.placeholder || intl.formatMessage(messages.placeholderMessage);
|
|
82
80
|
var optionType = props.optionType;
|
|
83
|
-
var components =
|
|
81
|
+
var components = react.useMemo(function () {
|
|
84
82
|
return _objectSpread(_objectSpread({
|
|
85
83
|
// eslint-disable-next-line react/display-name
|
|
86
84
|
Option: function Option(optionInnerProps) {
|
|
87
|
-
return
|
|
85
|
+
return jsxRuntime.jsx(selectUtils.CustomSelectInputOption, {
|
|
88
86
|
optionType: optionType,
|
|
89
87
|
optionInnerProps: optionInnerProps
|
|
90
88
|
});
|
|
@@ -93,64 +91,65 @@ var SearchSelectInput = function SearchSelectInput(props) {
|
|
|
93
91
|
DropdownIndicator: selectUtils.SearchIconDropdownIndicator
|
|
94
92
|
});
|
|
95
93
|
}, [props.components, optionType]);
|
|
96
|
-
return
|
|
94
|
+
return jsxRuntime.jsx(SearchSelectInputWrapper, {
|
|
97
95
|
isDisabled: props.isDisabled,
|
|
98
|
-
isReadOnly: props.isReadOnly
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
96
|
+
isReadOnly: props.isReadOnly,
|
|
97
|
+
children: jsxRuntime.jsx(AsyncSelectInput__default["default"], _objectSpread(_objectSpread({}, props), {}, {
|
|
98
|
+
components: components,
|
|
99
|
+
placeholder: placeholder,
|
|
100
|
+
iconLeft: undefined,
|
|
101
|
+
loadingMessage: loadingMessage,
|
|
102
|
+
noOptionsMessage: noOptionsMessage,
|
|
103
|
+
isSearchable: true
|
|
104
|
+
}))
|
|
105
|
+
});
|
|
107
106
|
};
|
|
108
107
|
|
|
109
108
|
SearchSelectInput.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
110
109
|
/**
|
|
111
110
|
*Horizontal size limit of the input fields.
|
|
112
111
|
*/
|
|
113
|
-
horizontalConstraint: PropTypes__default[
|
|
112
|
+
horizontalConstraint: PropTypes__default["default"].oneOf([3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 'scale', 'auto']),
|
|
114
113
|
|
|
115
114
|
/**
|
|
116
115
|
* Aria label (for assistive tech)
|
|
117
116
|
*/
|
|
118
|
-
'aria-label': PropTypes__default[
|
|
117
|
+
'aria-label': PropTypes__default["default"].string,
|
|
119
118
|
|
|
120
119
|
/**
|
|
121
120
|
* HTML ID of an element that should be used as the label (for assistive tech)
|
|
122
121
|
*/
|
|
123
|
-
'aria-labelledby': PropTypes__default[
|
|
122
|
+
'aria-labelledby': PropTypes__default["default"].string,
|
|
124
123
|
|
|
125
124
|
/**
|
|
126
125
|
* The id of the search input. This forwarded as react-select's "inputId"
|
|
127
126
|
*/
|
|
128
|
-
id: PropTypes__default[
|
|
127
|
+
id: PropTypes__default["default"].string,
|
|
129
128
|
|
|
130
129
|
/**
|
|
131
130
|
* The id to set on the SelectContainer component. This is forwarded as react-select's "id"
|
|
132
131
|
*/
|
|
133
|
-
containerId: PropTypes__default[
|
|
132
|
+
containerId: PropTypes__default["default"].string,
|
|
134
133
|
|
|
135
134
|
/**
|
|
136
135
|
* Name of the HTML Input (optional - without this, no input will be rendered)
|
|
137
136
|
*/
|
|
138
|
-
name: PropTypes__default[
|
|
137
|
+
name: PropTypes__default["default"].string,
|
|
139
138
|
|
|
140
139
|
/**
|
|
141
140
|
* Placeholder text for the select value
|
|
142
141
|
*/
|
|
143
|
-
placeholder: PropTypes__default[
|
|
142
|
+
placeholder: PropTypes__default["default"].string,
|
|
144
143
|
|
|
145
144
|
/**
|
|
146
145
|
* Map of components to overwrite the default ones, see [what components you can override](https://react-select.com/components)
|
|
147
146
|
*/
|
|
148
|
-
components: PropTypes__default[
|
|
147
|
+
components: PropTypes__default["default"].objectOf(PropTypes__default["default"].func),
|
|
149
148
|
|
|
150
149
|
/**
|
|
151
150
|
* Sets the tabIndex attribute on the input
|
|
152
151
|
*/
|
|
153
|
-
tabIndex: PropTypes__default[
|
|
152
|
+
tabIndex: PropTypes__default["default"].string,
|
|
154
153
|
|
|
155
154
|
/**
|
|
156
155
|
* The value of the select; reflected by the selected option
|
|
@@ -162,100 +161,100 @@ SearchSelectInput.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
162
161
|
rest[_key - 1] = arguments[_key];
|
|
163
162
|
}
|
|
164
163
|
|
|
165
|
-
return props.isMulti ? PropTypes__default[
|
|
166
|
-
value: PropTypes__default[
|
|
167
|
-
})).apply(void 0, _concatInstanceProperty__default[
|
|
168
|
-
value: PropTypes__default[
|
|
169
|
-
}).apply(void 0, _concatInstanceProperty__default[
|
|
164
|
+
return props.isMulti ? PropTypes__default["default"].arrayOf(PropTypes__default["default"].shape({
|
|
165
|
+
value: PropTypes__default["default"].string.isRequired
|
|
166
|
+
})).apply(void 0, _concatInstanceProperty__default["default"](_context = [props]).call(_context, rest)) : PropTypes__default["default"].shape({
|
|
167
|
+
value: PropTypes__default["default"].string.isRequired
|
|
168
|
+
}).apply(void 0, _concatInstanceProperty__default["default"](_context2 = [props]).call(_context2, rest));
|
|
170
169
|
},
|
|
171
170
|
|
|
172
171
|
/**
|
|
173
172
|
* Remove the currently focused option when the user presses backspace
|
|
174
173
|
*/
|
|
175
|
-
backspaceRemovesValue: PropTypes__default[
|
|
174
|
+
backspaceRemovesValue: PropTypes__default["default"].bool,
|
|
176
175
|
|
|
177
176
|
/**
|
|
178
177
|
* Indicates the input field has an error
|
|
179
178
|
*/
|
|
180
|
-
hasError: PropTypes__default[
|
|
179
|
+
hasError: PropTypes__default["default"].bool,
|
|
181
180
|
|
|
182
181
|
/**
|
|
183
182
|
* Indicates the input field has a warning
|
|
184
183
|
*/
|
|
185
|
-
hasWarning: PropTypes__default[
|
|
184
|
+
hasWarning: PropTypes__default["default"].bool,
|
|
186
185
|
|
|
187
186
|
/**
|
|
188
187
|
* Is the select read-only
|
|
189
188
|
*/
|
|
190
|
-
isReadOnly: PropTypes__default[
|
|
189
|
+
isReadOnly: PropTypes__default["default"].bool,
|
|
191
190
|
|
|
192
191
|
/**
|
|
193
192
|
* Is the select disabled
|
|
194
193
|
*/
|
|
195
|
-
isDisabled: PropTypes__default[
|
|
194
|
+
isDisabled: PropTypes__default["default"].bool,
|
|
196
195
|
|
|
197
196
|
/**
|
|
198
197
|
* Is the select value clearable
|
|
199
198
|
*/
|
|
200
|
-
isClearable: PropTypes__default[
|
|
199
|
+
isClearable: PropTypes__default["default"].bool,
|
|
201
200
|
|
|
202
201
|
/**
|
|
203
202
|
* Override the built-in logic to detect whether an option is disabled
|
|
204
203
|
*/
|
|
205
|
-
isOptionDisabled: PropTypes__default[
|
|
204
|
+
isOptionDisabled: PropTypes__default["default"].func,
|
|
206
205
|
|
|
207
206
|
/**
|
|
208
207
|
* Support multiple selected options
|
|
209
208
|
*/
|
|
210
|
-
isMulti: PropTypes__default[
|
|
209
|
+
isMulti: PropTypes__default["default"].bool,
|
|
211
210
|
|
|
212
211
|
/**
|
|
213
212
|
* Focus the control when it is mounted. Renamed autoFocus of react-select
|
|
214
213
|
*/
|
|
215
|
-
isAutofocussed: PropTypes__default[
|
|
214
|
+
isAutofocussed: PropTypes__default["default"].bool,
|
|
216
215
|
|
|
217
216
|
/**
|
|
218
217
|
* 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.
|
|
219
218
|
*/
|
|
220
|
-
noOptionsMessage: PropTypes__default[
|
|
219
|
+
noOptionsMessage: PropTypes__default["default"].func,
|
|
221
220
|
|
|
222
221
|
/**
|
|
223
222
|
* Maximum height of the menu before scrolling
|
|
224
223
|
*/
|
|
225
|
-
maxMenuHeight: PropTypes__default[
|
|
224
|
+
maxMenuHeight: PropTypes__default["default"].number,
|
|
226
225
|
|
|
227
226
|
/**
|
|
228
227
|
* Dom element to portal the select menu to
|
|
229
228
|
*/
|
|
230
|
-
menuPortalTarget: PropTypes__default[
|
|
229
|
+
menuPortalTarget: PropTypes__default["default"].instanceOf(utils.SafeHTMLElement),
|
|
231
230
|
|
|
232
231
|
/**
|
|
233
232
|
* z-index value for the menu portal
|
|
234
233
|
*/
|
|
235
|
-
menuPortalZIndex: PropTypes__default[
|
|
234
|
+
menuPortalZIndex: PropTypes__default["default"].number.isRequired,
|
|
236
235
|
|
|
237
236
|
/**
|
|
238
237
|
* whether the menu should block scroll while open
|
|
239
238
|
*/
|
|
240
|
-
menuShouldBlockScroll: PropTypes__default[
|
|
239
|
+
menuShouldBlockScroll: PropTypes__default["default"].bool,
|
|
241
240
|
|
|
242
241
|
/**
|
|
243
242
|
* Determines if option groups will be separated by a divider
|
|
244
243
|
*/
|
|
245
|
-
showOptionGroupDivider: PropTypes__default[
|
|
244
|
+
showOptionGroupDivider: PropTypes__default["default"].bool,
|
|
246
245
|
|
|
247
246
|
/**
|
|
248
247
|
* The default set of options to show before the user starts searching. When set to `true`, the results for `loadOptions('')` will be autoloaded.
|
|
249
248
|
*/
|
|
250
|
-
defaultOptions: PropTypes__default[
|
|
251
|
-
value: PropTypes__default[
|
|
252
|
-
label: PropTypes__default[
|
|
249
|
+
defaultOptions: PropTypes__default["default"].oneOfType([PropTypes__default["default"].bool, PropTypes__default["default"].arrayOf(PropTypes__default["default"].shape({
|
|
250
|
+
value: PropTypes__default["default"].string.isRequired,
|
|
251
|
+
label: PropTypes__default["default"].string
|
|
253
252
|
}))]),
|
|
254
253
|
|
|
255
254
|
/**
|
|
256
255
|
* Handle blur events on the control
|
|
257
256
|
*/
|
|
258
|
-
onBlur: PropTypes__default[
|
|
257
|
+
onBlur: PropTypes__default["default"].func,
|
|
259
258
|
|
|
260
259
|
/**
|
|
261
260
|
* Called with a fake event when value changes.
|
|
@@ -264,49 +263,49 @@ SearchSelectInput.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
264
263
|
* <br />
|
|
265
264
|
* Signature: `(event, action) => void`
|
|
266
265
|
*/
|
|
267
|
-
onChange: PropTypes__default[
|
|
266
|
+
onChange: PropTypes__default["default"].func.isRequired,
|
|
268
267
|
|
|
269
268
|
/**
|
|
270
269
|
* Handle focus events on the control
|
|
271
270
|
*/
|
|
272
|
-
onFocus: PropTypes__default[
|
|
271
|
+
onFocus: PropTypes__default["default"].func,
|
|
273
272
|
|
|
274
273
|
/**
|
|
275
274
|
* Handle change events on the input
|
|
276
275
|
* <br />
|
|
277
276
|
* Signature: `(inputValue, action) => void`
|
|
278
277
|
*/
|
|
279
|
-
onInputChange: PropTypes__default[
|
|
278
|
+
onInputChange: PropTypes__default["default"].func,
|
|
280
279
|
|
|
281
280
|
/**
|
|
282
281
|
* Select the currently focused option when the user presses tab
|
|
283
282
|
*/
|
|
284
|
-
tabSelectsValue: PropTypes__default[
|
|
283
|
+
tabSelectsValue: PropTypes__default["default"].bool,
|
|
285
284
|
|
|
286
285
|
/**
|
|
287
286
|
* Function that returns a promise, which is the set of options to be used once the promise resolves.
|
|
288
287
|
*/
|
|
289
|
-
loadOptions: PropTypes__default[
|
|
288
|
+
loadOptions: PropTypes__default["default"].func.isRequired,
|
|
290
289
|
|
|
291
290
|
/**
|
|
292
291
|
* The text shown while the options are being loaded
|
|
293
292
|
*/
|
|
294
|
-
loadingMessage: PropTypes__default[
|
|
293
|
+
loadingMessage: PropTypes__default["default"].oneOfType([PropTypes__default["default"].string, PropTypes__default["default"].func]),
|
|
295
294
|
|
|
296
295
|
/**
|
|
297
296
|
* If cacheOptions is truthy, then the loaded data will be cached. The cache will remain until cacheOptions changes value.
|
|
298
297
|
*/
|
|
299
|
-
cacheOptions: PropTypes__default[
|
|
298
|
+
cacheOptions: PropTypes__default["default"].any,
|
|
300
299
|
|
|
301
300
|
/**
|
|
302
301
|
* Custom method to filter whether an option should be displayed in the menu
|
|
303
302
|
*/
|
|
304
|
-
filterOption: PropTypes__default[
|
|
303
|
+
filterOption: PropTypes__default["default"].func,
|
|
305
304
|
|
|
306
305
|
/**
|
|
307
306
|
* The style of the an option in the dropdown menu. It could be single lined option or an option with more and custom info
|
|
308
307
|
*/
|
|
309
|
-
optionType: PropTypes__default[
|
|
308
|
+
optionType: PropTypes__default["default"].oneOf(['single-property', 'double-property', 'multiple-properties'])
|
|
310
309
|
} : {};
|
|
311
310
|
SearchSelectInput.defaultProps = {
|
|
312
311
|
value: null,
|
|
@@ -316,8 +315,8 @@ SearchSelectInput.defaultProps = {
|
|
|
316
315
|
SearchSelectInput.displayName = 'SearchSelectInput';
|
|
317
316
|
var SearchSelectInput$1 = SearchSelectInput;
|
|
318
317
|
|
|
319
|
-
// NOTE: This string will be replaced
|
|
320
|
-
var version =
|
|
318
|
+
// NOTE: This string will be replaced on build time with the package version.
|
|
319
|
+
var version = "12.2.6";
|
|
321
320
|
|
|
322
|
-
exports[
|
|
321
|
+
exports["default"] = SearchSelectInput$1;
|
|
323
322
|
exports.version = version;
|
|
@@ -10,10 +10,9 @@ var _forEachInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/in
|
|
|
10
10
|
var _Object$getOwnPropertyDescriptors = require('@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptors');
|
|
11
11
|
var _Object$defineProperties = require('@babel/runtime-corejs3/core-js-stable/object/define-properties');
|
|
12
12
|
var _Object$defineProperty = require('@babel/runtime-corejs3/core-js-stable/object/define-property');
|
|
13
|
-
var _extends = require('@babel/runtime-corejs3/helpers/extends');
|
|
14
13
|
var _defineProperty = require('@babel/runtime-corejs3/helpers/defineProperty');
|
|
15
14
|
require('@babel/runtime-corejs3/core-js-stable/instance/concat');
|
|
16
|
-
var
|
|
15
|
+
var react = require('react');
|
|
17
16
|
require('prop-types');
|
|
18
17
|
var reactIntl = require('react-intl');
|
|
19
18
|
require('@commercetools-uikit/utils');
|
|
@@ -21,7 +20,7 @@ var AsyncSelectInput = require('@commercetools-uikit/async-select-input');
|
|
|
21
20
|
var selectUtils = require('@commercetools-uikit/select-utils');
|
|
22
21
|
var _styled = require('@emotion/styled/base');
|
|
23
22
|
var designSystem = require('@commercetools-uikit/design-system');
|
|
24
|
-
var
|
|
23
|
+
var jsxRuntime = require('@emotion/react/jsx-runtime');
|
|
25
24
|
|
|
26
25
|
function _interopDefault (e) { return e && e.__esModule ? e : { 'default': e }; }
|
|
27
26
|
|
|
@@ -33,7 +32,6 @@ var _forEachInstanceProperty__default = /*#__PURE__*/_interopDefault(_forEachIns
|
|
|
33
32
|
var _Object$getOwnPropertyDescriptors__default = /*#__PURE__*/_interopDefault(_Object$getOwnPropertyDescriptors);
|
|
34
33
|
var _Object$defineProperties__default = /*#__PURE__*/_interopDefault(_Object$defineProperties);
|
|
35
34
|
var _Object$defineProperty__default = /*#__PURE__*/_interopDefault(_Object$defineProperty);
|
|
36
|
-
var React__default = /*#__PURE__*/_interopDefault(React);
|
|
37
35
|
var AsyncSelectInput__default = /*#__PURE__*/_interopDefault(AsyncSelectInput);
|
|
38
36
|
var _styled__default = /*#__PURE__*/_interopDefault(_styled);
|
|
39
37
|
|
|
@@ -55,15 +53,15 @@ var messages = reactIntl.defineMessages({
|
|
|
55
53
|
}
|
|
56
54
|
});
|
|
57
55
|
|
|
58
|
-
var SearchSelectInputWrapper = _styled__default[
|
|
56
|
+
var SearchSelectInputWrapper = _styled__default["default"]("div", {
|
|
59
57
|
target: "ec7yve10"
|
|
60
58
|
} )(function (props) {
|
|
61
59
|
return !props.isDisabled && !props.isReadOnly ? "div[class$='control'] {\n &:hover {\n cursor: text;\n }\n div[class$='indicatorContainer' i] {\n cursor: pointer;\n svg * {\n fill: ".concat(designSystem.customProperties.colorSolid, ";\n }\n }\n }") : '';
|
|
62
|
-
}, ";");
|
|
60
|
+
}, ";" + ("" ));
|
|
63
61
|
|
|
64
|
-
function ownKeys(object, enumerableOnly) { var keys = _Object$keys__default[
|
|
62
|
+
function ownKeys(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); if (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; }
|
|
65
63
|
|
|
66
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { var _context3; _forEachInstanceProperty__default[
|
|
64
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { var _context3; _forEachInstanceProperty__default["default"](_context3 = ownKeys(Object(source), true)).call(_context3, function (key) { _defineProperty(target, key, source[key]); }); } else if (_Object$getOwnPropertyDescriptors__default["default"]) { _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)); } else { var _context4; _forEachInstanceProperty__default["default"](_context4 = ownKeys(Object(source))).call(_context4, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } } return target; }
|
|
67
65
|
|
|
68
66
|
var SearchSelectInput = function SearchSelectInput(props) {
|
|
69
67
|
var intl = reactIntl.useIntl();
|
|
@@ -75,11 +73,11 @@ var SearchSelectInput = function SearchSelectInput(props) {
|
|
|
75
73
|
var loadingMessage = props.loadingMessage || intl.formatMessage(messages.loadingOptionsMessage);
|
|
76
74
|
var placeholder = props.placeholder || intl.formatMessage(messages.placeholderMessage);
|
|
77
75
|
var optionType = props.optionType;
|
|
78
|
-
var components =
|
|
76
|
+
var components = react.useMemo(function () {
|
|
79
77
|
return _objectSpread(_objectSpread({
|
|
80
78
|
// eslint-disable-next-line react/display-name
|
|
81
79
|
Option: function Option(optionInnerProps) {
|
|
82
|
-
return
|
|
80
|
+
return jsxRuntime.jsx(selectUtils.CustomSelectInputOption, {
|
|
83
81
|
optionType: optionType,
|
|
84
82
|
optionInnerProps: optionInnerProps
|
|
85
83
|
});
|
|
@@ -88,17 +86,18 @@ var SearchSelectInput = function SearchSelectInput(props) {
|
|
|
88
86
|
DropdownIndicator: selectUtils.SearchIconDropdownIndicator
|
|
89
87
|
});
|
|
90
88
|
}, [props.components, optionType]);
|
|
91
|
-
return
|
|
89
|
+
return jsxRuntime.jsx(SearchSelectInputWrapper, {
|
|
92
90
|
isDisabled: props.isDisabled,
|
|
93
|
-
isReadOnly: props.isReadOnly
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
91
|
+
isReadOnly: props.isReadOnly,
|
|
92
|
+
children: jsxRuntime.jsx(AsyncSelectInput__default["default"], _objectSpread(_objectSpread({}, props), {}, {
|
|
93
|
+
components: components,
|
|
94
|
+
placeholder: placeholder,
|
|
95
|
+
iconLeft: undefined,
|
|
96
|
+
loadingMessage: loadingMessage,
|
|
97
|
+
noOptionsMessage: noOptionsMessage,
|
|
98
|
+
isSearchable: true
|
|
99
|
+
}))
|
|
100
|
+
});
|
|
102
101
|
};
|
|
103
102
|
|
|
104
103
|
SearchSelectInput.propTypes = {};
|
|
@@ -110,8 +109,8 @@ SearchSelectInput.defaultProps = {
|
|
|
110
109
|
SearchSelectInput.displayName = 'SearchSelectInput';
|
|
111
110
|
var SearchSelectInput$1 = SearchSelectInput;
|
|
112
111
|
|
|
113
|
-
// NOTE: This string will be replaced
|
|
114
|
-
var version =
|
|
112
|
+
// NOTE: This string will be replaced on build time with the package version.
|
|
113
|
+
var version = "12.2.6";
|
|
115
114
|
|
|
116
|
-
exports[
|
|
115
|
+
exports["default"] = SearchSelectInput$1;
|
|
117
116
|
exports.version = version;
|
|
@@ -6,10 +6,9 @@ import _forEachInstanceProperty from '@babel/runtime-corejs3/core-js-stable/inst
|
|
|
6
6
|
import _Object$getOwnPropertyDescriptors from '@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptors';
|
|
7
7
|
import _Object$defineProperties from '@babel/runtime-corejs3/core-js-stable/object/define-properties';
|
|
8
8
|
import _Object$defineProperty from '@babel/runtime-corejs3/core-js-stable/object/define-property';
|
|
9
|
-
import _extends from '@babel/runtime-corejs3/helpers/esm/extends';
|
|
10
9
|
import _defineProperty from '@babel/runtime-corejs3/helpers/esm/defineProperty';
|
|
11
10
|
import _concatInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/concat';
|
|
12
|
-
import
|
|
11
|
+
import { useMemo } from 'react';
|
|
13
12
|
import PropTypes from 'prop-types';
|
|
14
13
|
import { defineMessages, useIntl } from 'react-intl';
|
|
15
14
|
import { SafeHTMLElement } from '@commercetools-uikit/utils';
|
|
@@ -17,7 +16,7 @@ import AsyncSelectInput from '@commercetools-uikit/async-select-input';
|
|
|
17
16
|
import { CustomSelectInputOption, SearchIconDropdownIndicator } from '@commercetools-uikit/select-utils';
|
|
18
17
|
import _styled from '@emotion/styled/base';
|
|
19
18
|
import { customProperties } from '@commercetools-uikit/design-system';
|
|
20
|
-
import { jsx } from '@emotion/react';
|
|
19
|
+
import { jsx } from '@emotion/react/jsx-runtime';
|
|
21
20
|
|
|
22
21
|
var messages = defineMessages({
|
|
23
22
|
noOptionsMessage: {
|
|
@@ -44,7 +43,7 @@ var SearchSelectInputWrapper = _styled("div", process.env.NODE_ENV === "producti
|
|
|
44
43
|
label: "SearchSelectInputWrapper"
|
|
45
44
|
})(function (props) {
|
|
46
45
|
return !props.isDisabled && !props.isReadOnly ? "div[class$='control'] {\n &:hover {\n cursor: text;\n }\n div[class$='indicatorContainer' i] {\n cursor: pointer;\n svg * {\n fill: ".concat(customProperties.colorSolid, ";\n }\n }\n }") : '';
|
|
47
|
-
}, ";");
|
|
46
|
+
}, ";" + (process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInNlYXJjaC1zZWxlY3QtaW5wdXQuc3R5bGVzLmpzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUkyQyIsImZpbGUiOiJzZWFyY2gtc2VsZWN0LWlucHV0LnN0eWxlcy5qcyIsInNvdXJjZXNDb250ZW50IjpbIi8qIGVzbGludC1kaXNhYmxlIGltcG9ydC9wcmVmZXItZGVmYXVsdC1leHBvcnQgKi9cbmltcG9ydCBzdHlsZWQgZnJvbSAnQGVtb3Rpb24vc3R5bGVkJztcbmltcG9ydCB7IGN1c3RvbVByb3BlcnRpZXMgYXMgdmFycyB9IGZyb20gJ0Bjb21tZXJjZXRvb2xzLXVpa2l0L2Rlc2lnbi1zeXN0ZW0nO1xuXG5jb25zdCBTZWFyY2hTZWxlY3RJbnB1dFdyYXBwZXIgPSBzdHlsZWQuZGl2YFxuICAkeyhwcm9wcykgPT5cbiAgICAhcHJvcHMuaXNEaXNhYmxlZCAmJiAhcHJvcHMuaXNSZWFkT25seVxuICAgICAgPyBgZGl2W2NsYXNzJD0nY29udHJvbCddIHtcbiAgICAgICAgJjpob3ZlciB7XG4gICAgICAgICAgY3Vyc29yOiB0ZXh0O1xuICAgICAgICB9XG4gICAgICAgIGRpdltjbGFzcyQ9J2luZGljYXRvckNvbnRhaW5lcicgaV0ge1xuICAgICAgICAgIGN1cnNvcjogcG9pbnRlcjtcbiAgICAgICAgICBzdmcgKiB7XG4gICAgICAgICAgICBmaWxsOiAke3ZhcnMuY29sb3JTb2xpZH07XG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICB9YFxuICAgICAgOiAnJ31cbmA7XG5cbmV4cG9ydCB7IFNlYXJjaFNlbGVjdElucHV0V3JhcHBlciB9O1xuIl19 */"));
|
|
48
47
|
|
|
49
48
|
function ownKeys(object, enumerableOnly) { var keys = _Object$keys(object); if (_Object$getOwnPropertySymbols) { var symbols = _Object$getOwnPropertySymbols(object); if (enumerableOnly) { symbols = _filterInstanceProperty(symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
50
49
|
|
|
@@ -60,7 +59,7 @@ var SearchSelectInput = function SearchSelectInput(props) {
|
|
|
60
59
|
var loadingMessage = props.loadingMessage || intl.formatMessage(messages.loadingOptionsMessage);
|
|
61
60
|
var placeholder = props.placeholder || intl.formatMessage(messages.placeholderMessage);
|
|
62
61
|
var optionType = props.optionType;
|
|
63
|
-
var components =
|
|
62
|
+
var components = useMemo(function () {
|
|
64
63
|
return _objectSpread(_objectSpread({
|
|
65
64
|
// eslint-disable-next-line react/display-name
|
|
66
65
|
Option: function Option(optionInnerProps) {
|
|
@@ -75,15 +74,16 @@ var SearchSelectInput = function SearchSelectInput(props) {
|
|
|
75
74
|
}, [props.components, optionType]);
|
|
76
75
|
return jsx(SearchSelectInputWrapper, {
|
|
77
76
|
isDisabled: props.isDisabled,
|
|
78
|
-
isReadOnly: props.isReadOnly
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
77
|
+
isReadOnly: props.isReadOnly,
|
|
78
|
+
children: jsx(AsyncSelectInput, _objectSpread(_objectSpread({}, props), {}, {
|
|
79
|
+
components: components,
|
|
80
|
+
placeholder: placeholder,
|
|
81
|
+
iconLeft: undefined,
|
|
82
|
+
loadingMessage: loadingMessage,
|
|
83
|
+
noOptionsMessage: noOptionsMessage,
|
|
84
|
+
isSearchable: true
|
|
85
|
+
}))
|
|
86
|
+
});
|
|
87
87
|
};
|
|
88
88
|
|
|
89
89
|
SearchSelectInput.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
@@ -296,7 +296,7 @@ SearchSelectInput.defaultProps = {
|
|
|
296
296
|
SearchSelectInput.displayName = 'SearchSelectInput';
|
|
297
297
|
var SearchSelectInput$1 = SearchSelectInput;
|
|
298
298
|
|
|
299
|
-
// NOTE: This string will be replaced
|
|
300
|
-
var version =
|
|
299
|
+
// NOTE: This string will be replaced on build time with the package version.
|
|
300
|
+
var version = "12.2.6";
|
|
301
301
|
|
|
302
302
|
export { SearchSelectInput$1 as default, version };
|
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": "12.2.
|
|
4
|
+
"version": "12.2.6",
|
|
5
5
|
"bugs": "https://github.com/commercetools/ui-kit/issues",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -11,7 +11,6 @@
|
|
|
11
11
|
"homepage": "https://uikit.commercetools.com",
|
|
12
12
|
"keywords": ["javascript", "design system", "react", "uikit"],
|
|
13
13
|
"license": "MIT",
|
|
14
|
-
"private": false,
|
|
15
14
|
"publishConfig": {
|
|
16
15
|
"access": "public"
|
|
17
16
|
},
|
|
@@ -19,18 +18,15 @@
|
|
|
19
18
|
"main": "dist/commercetools-uikit-search-select-input.cjs.js",
|
|
20
19
|
"module": "dist/commercetools-uikit-search-select-input.esm.js",
|
|
21
20
|
"files": ["dist"],
|
|
22
|
-
"scripts": {
|
|
23
|
-
"prepare": "../../../../scripts/version.js replace"
|
|
24
|
-
},
|
|
25
21
|
"dependencies": {
|
|
26
|
-
"@babel/runtime": "7.
|
|
27
|
-
"@babel/runtime-corejs3": "7.
|
|
28
|
-
"@commercetools-uikit/async-select-input": "12.2.
|
|
29
|
-
"@commercetools-uikit/design-system": "12.2.
|
|
30
|
-
"@commercetools-uikit/select-utils": "12.2.
|
|
31
|
-
"@commercetools-uikit/spacings": "12.2.
|
|
32
|
-
"@commercetools-uikit/text": "12.2.
|
|
33
|
-
"@commercetools-uikit/utils": "12.2.
|
|
22
|
+
"@babel/runtime": "7.16.3",
|
|
23
|
+
"@babel/runtime-corejs3": "7.16.3",
|
|
24
|
+
"@commercetools-uikit/async-select-input": "12.2.6",
|
|
25
|
+
"@commercetools-uikit/design-system": "12.2.5",
|
|
26
|
+
"@commercetools-uikit/select-utils": "12.2.6",
|
|
27
|
+
"@commercetools-uikit/spacings": "12.2.5",
|
|
28
|
+
"@commercetools-uikit/text": "12.2.5",
|
|
29
|
+
"@commercetools-uikit/utils": "12.2.5",
|
|
34
30
|
"@emotion/react": "^11.4.0",
|
|
35
31
|
"@emotion/styled": "^11.3.0",
|
|
36
32
|
"prop-types": "15.7.2"
|
|
@@ -38,7 +34,7 @@
|
|
|
38
34
|
"devDependencies": {
|
|
39
35
|
"react": "17.0.2",
|
|
40
36
|
"react-dom": "17.0.2",
|
|
41
|
-
"react-intl": "5.
|
|
37
|
+
"react-intl": "5.21.2"
|
|
42
38
|
},
|
|
43
39
|
"peerDependencies": {
|
|
44
40
|
"react": "17.x",
|