@commercetools-uikit/search-select-field 12.2.3 → 12.2.7
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.
|
@@ -45,14 +45,14 @@ var FieldLabel__default = /*#__PURE__*/_interopDefault(FieldLabel);
|
|
|
45
45
|
var SearchSelectInput__default = /*#__PURE__*/_interopDefault(SearchSelectInput);
|
|
46
46
|
var FieldErrors__default = /*#__PURE__*/_interopDefault(FieldErrors);
|
|
47
47
|
|
|
48
|
-
function ownKeys(object, enumerableOnly) { var keys = _Object$keys__default[
|
|
48
|
+
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; }
|
|
49
49
|
|
|
50
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { var _context7; _forEachInstanceProperty__default[
|
|
50
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { var _context7; _forEachInstanceProperty__default["default"](_context7 = ownKeys(Object(source), true)).call(_context7, 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 _context8; _forEachInstanceProperty__default["default"](_context8 = ownKeys(Object(source))).call(_context8, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } } return target; }
|
|
51
51
|
|
|
52
52
|
var hasErrors = function hasErrors(errors) {
|
|
53
53
|
var _context;
|
|
54
54
|
|
|
55
|
-
return errors && _someInstanceProperty__default[
|
|
55
|
+
return errors && _someInstanceProperty__default["default"](_context = _Object$values__default["default"](errors)).call(_context, Boolean);
|
|
56
56
|
};
|
|
57
57
|
|
|
58
58
|
var sequentialId = utils.createSequentialId('async-select-field-');
|
|
@@ -60,11 +60,11 @@ var sequentialId = utils.createSequentialId('async-select-field-');
|
|
|
60
60
|
var SearchSelectField = function SearchSelectField(props) {
|
|
61
61
|
var hasError = Boolean(props.touched) && hasErrors(props.errors);
|
|
62
62
|
var id = props.id || sequentialId();
|
|
63
|
-
return jsxRuntime.jsx(Constraints__default[
|
|
63
|
+
return jsxRuntime.jsx(Constraints__default["default"].Horizontal, {
|
|
64
64
|
max: props.horizontalConstraint,
|
|
65
|
-
children: jsxRuntime.jsxs(Spacings__default[
|
|
65
|
+
children: jsxRuntime.jsxs(Spacings__default["default"].Stack, {
|
|
66
66
|
scale: "xs",
|
|
67
|
-
children: [jsxRuntime.jsx(FieldLabel__default[
|
|
67
|
+
children: [jsxRuntime.jsx(FieldLabel__default["default"], {
|
|
68
68
|
title: props.title,
|
|
69
69
|
hint: props.hint,
|
|
70
70
|
description: props.description,
|
|
@@ -73,7 +73,7 @@ var SearchSelectField = function SearchSelectField(props) {
|
|
|
73
73
|
badge: props.badge,
|
|
74
74
|
hasRequiredIndicator: props.isRequired,
|
|
75
75
|
htmlFor: id
|
|
76
|
-
}), jsxRuntime.jsx(SearchSelectInput__default[
|
|
76
|
+
}), jsxRuntime.jsx(SearchSelectInput__default["default"], _objectSpread(_objectSpread({}, utils.filterDataAttributes(props)), {}, {
|
|
77
77
|
horizontalConstraint: "scale",
|
|
78
78
|
hasError: hasError,
|
|
79
79
|
"aria-label": props['aria-label'],
|
|
@@ -110,7 +110,7 @@ var SearchSelectField = function SearchSelectField(props) {
|
|
|
110
110
|
cacheOptions: props.cacheOptions,
|
|
111
111
|
showOptionGroupDivider: props.showOptionGroupDivider,
|
|
112
112
|
optionType: props.optionType
|
|
113
|
-
})), jsxRuntime.jsx(FieldErrors__default[
|
|
113
|
+
})), jsxRuntime.jsx(FieldErrors__default["default"], {
|
|
114
114
|
errors: props.errors,
|
|
115
115
|
isVisible: hasError,
|
|
116
116
|
renderError: props.renderError
|
|
@@ -126,47 +126,47 @@ SearchSelectField.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
126
126
|
/**
|
|
127
127
|
*Horizontal size limit of the input fields.
|
|
128
128
|
*/
|
|
129
|
-
horizontalConstraint: PropTypes__default[
|
|
129
|
+
horizontalConstraint: PropTypes__default["default"].oneOf([3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 'scale', 'auto']),
|
|
130
130
|
|
|
131
131
|
/**
|
|
132
132
|
* Aria label (for assistive tech)
|
|
133
133
|
*/
|
|
134
|
-
'aria-label': PropTypes__default[
|
|
134
|
+
'aria-label': PropTypes__default["default"].string,
|
|
135
135
|
|
|
136
136
|
/**
|
|
137
137
|
* HTML ID of an element that should be used as the label (for assistive tech)
|
|
138
138
|
*/
|
|
139
|
-
'aria-labelledby': PropTypes__default[
|
|
139
|
+
'aria-labelledby': PropTypes__default["default"].string,
|
|
140
140
|
|
|
141
141
|
/**
|
|
142
142
|
* The id of the search input. This forwarded as react-select's "inputId"
|
|
143
143
|
*/
|
|
144
|
-
id: PropTypes__default[
|
|
144
|
+
id: PropTypes__default["default"].string,
|
|
145
145
|
|
|
146
146
|
/**
|
|
147
147
|
* The id to set on the SelectContainer component. This is forwarded as react-select's "id"
|
|
148
148
|
*/
|
|
149
|
-
containerId: PropTypes__default[
|
|
149
|
+
containerId: PropTypes__default["default"].string,
|
|
150
150
|
|
|
151
151
|
/**
|
|
152
152
|
* Name of the HTML Input (optional - without this, no input will be rendered)
|
|
153
153
|
*/
|
|
154
|
-
name: PropTypes__default[
|
|
154
|
+
name: PropTypes__default["default"].string,
|
|
155
155
|
|
|
156
156
|
/**
|
|
157
157
|
* Placeholder text for the select value
|
|
158
158
|
*/
|
|
159
|
-
placeholder: PropTypes__default[
|
|
159
|
+
placeholder: PropTypes__default["default"].string,
|
|
160
160
|
|
|
161
161
|
/**
|
|
162
162
|
* Map of components to overwrite the default ones, see [what components you can override](https://react-select.com/components)
|
|
163
163
|
*/
|
|
164
|
-
components: PropTypes__default[
|
|
164
|
+
components: PropTypes__default["default"].objectOf(PropTypes__default["default"].func),
|
|
165
165
|
|
|
166
166
|
/**
|
|
167
167
|
* Sets the tabIndex attribute on the input
|
|
168
168
|
*/
|
|
169
|
-
tabIndex: PropTypes__default[
|
|
169
|
+
tabIndex: PropTypes__default["default"].string,
|
|
170
170
|
|
|
171
171
|
/**
|
|
172
172
|
* The value of the select; reflected by the selected option
|
|
@@ -178,92 +178,92 @@ SearchSelectField.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
178
178
|
rest[_key - 1] = arguments[_key];
|
|
179
179
|
}
|
|
180
180
|
|
|
181
|
-
return props.isMulti ? PropTypes__default[
|
|
182
|
-
value: PropTypes__default[
|
|
183
|
-
})).apply(void 0, _concatInstanceProperty__default[
|
|
184
|
-
value: PropTypes__default[
|
|
185
|
-
}).apply(void 0, _concatInstanceProperty__default[
|
|
181
|
+
return props.isMulti ? PropTypes__default["default"].arrayOf(PropTypes__default["default"].shape({
|
|
182
|
+
value: PropTypes__default["default"].string.isRequired
|
|
183
|
+
})).apply(void 0, _concatInstanceProperty__default["default"](_context2 = [props]).call(_context2, rest)) : PropTypes__default["default"].shape({
|
|
184
|
+
value: PropTypes__default["default"].string.isRequired
|
|
185
|
+
}).apply(void 0, _concatInstanceProperty__default["default"](_context3 = [props]).call(_context3, rest));
|
|
186
186
|
},
|
|
187
187
|
|
|
188
188
|
/**
|
|
189
189
|
* Remove the currently focused option when the user presses backspace
|
|
190
190
|
*/
|
|
191
|
-
backspaceRemovesValue: PropTypes__default[
|
|
191
|
+
backspaceRemovesValue: PropTypes__default["default"].bool,
|
|
192
192
|
|
|
193
193
|
/**
|
|
194
194
|
* Indicates the input field has an error
|
|
195
195
|
*/
|
|
196
|
-
hasError: PropTypes__default[
|
|
196
|
+
hasError: PropTypes__default["default"].bool,
|
|
197
197
|
|
|
198
198
|
/**
|
|
199
199
|
* Indicates the input field has a warning
|
|
200
200
|
*/
|
|
201
|
-
hasWarning: PropTypes__default[
|
|
201
|
+
hasWarning: PropTypes__default["default"].bool,
|
|
202
202
|
|
|
203
203
|
/**
|
|
204
204
|
* Is the select read-only
|
|
205
205
|
*/
|
|
206
|
-
isReadOnly: PropTypes__default[
|
|
206
|
+
isReadOnly: PropTypes__default["default"].bool,
|
|
207
207
|
|
|
208
208
|
/**
|
|
209
209
|
* Is the select disabled
|
|
210
210
|
*/
|
|
211
|
-
isDisabled: PropTypes__default[
|
|
211
|
+
isDisabled: PropTypes__default["default"].bool,
|
|
212
212
|
|
|
213
213
|
/**
|
|
214
214
|
* Is the select value clearable
|
|
215
215
|
*/
|
|
216
|
-
isClearable: PropTypes__default[
|
|
216
|
+
isClearable: PropTypes__default["default"].bool,
|
|
217
217
|
|
|
218
218
|
/**
|
|
219
219
|
* Override the built-in logic to detect whether an option is disabled
|
|
220
220
|
*/
|
|
221
|
-
isOptionDisabled: PropTypes__default[
|
|
221
|
+
isOptionDisabled: PropTypes__default["default"].func,
|
|
222
222
|
|
|
223
223
|
/**
|
|
224
224
|
* Support multiple selected options
|
|
225
225
|
*/
|
|
226
|
-
isMulti: PropTypes__default[
|
|
226
|
+
isMulti: PropTypes__default["default"].bool,
|
|
227
227
|
|
|
228
228
|
/**
|
|
229
229
|
* Focus the control when it is mounted. Renamed autoFocus of react-select
|
|
230
230
|
*/
|
|
231
|
-
isAutofocussed: PropTypes__default[
|
|
231
|
+
isAutofocussed: PropTypes__default["default"].bool,
|
|
232
232
|
|
|
233
233
|
/**
|
|
234
234
|
* 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.
|
|
235
235
|
*/
|
|
236
|
-
noOptionsMessage: PropTypes__default[
|
|
236
|
+
noOptionsMessage: PropTypes__default["default"].func,
|
|
237
237
|
|
|
238
238
|
/**
|
|
239
239
|
* Maximum height of the menu before scrolling
|
|
240
240
|
*/
|
|
241
|
-
maxMenuHeight: PropTypes__default[
|
|
241
|
+
maxMenuHeight: PropTypes__default["default"].number,
|
|
242
242
|
|
|
243
243
|
/**
|
|
244
244
|
* Dom element to portal the select menu to
|
|
245
245
|
*/
|
|
246
|
-
menuPortalTarget: PropTypes__default[
|
|
246
|
+
menuPortalTarget: PropTypes__default["default"].instanceOf(utils.SafeHTMLElement),
|
|
247
247
|
|
|
248
248
|
/**
|
|
249
249
|
* z-index value for the menu portal
|
|
250
250
|
*/
|
|
251
|
-
menuPortalZIndex: PropTypes__default[
|
|
251
|
+
menuPortalZIndex: PropTypes__default["default"].number,
|
|
252
252
|
|
|
253
253
|
/**
|
|
254
254
|
* whether the menu should block scroll while open
|
|
255
255
|
*/
|
|
256
|
-
menuShouldBlockScroll: PropTypes__default[
|
|
256
|
+
menuShouldBlockScroll: PropTypes__default["default"].bool,
|
|
257
257
|
|
|
258
258
|
/**
|
|
259
259
|
* Determines if option groups will be separated by a divider
|
|
260
260
|
*/
|
|
261
|
-
showOptionGroupDivider: PropTypes__default[
|
|
261
|
+
showOptionGroupDivider: PropTypes__default["default"].bool,
|
|
262
262
|
|
|
263
263
|
/**
|
|
264
264
|
* Handle blur events on the control
|
|
265
265
|
*/
|
|
266
|
-
onBlur: PropTypes__default[
|
|
266
|
+
onBlur: PropTypes__default["default"].func,
|
|
267
267
|
|
|
268
268
|
/**
|
|
269
269
|
* Called with a fake event when value changes.
|
|
@@ -272,57 +272,57 @@ SearchSelectField.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
272
272
|
* <br />
|
|
273
273
|
* Signature: `(event, action) => void`
|
|
274
274
|
*/
|
|
275
|
-
onChange: PropTypes__default[
|
|
275
|
+
onChange: PropTypes__default["default"].func.isRequired,
|
|
276
276
|
|
|
277
277
|
/**
|
|
278
278
|
* Handle focus events on the control
|
|
279
279
|
*/
|
|
280
|
-
onFocus: PropTypes__default[
|
|
280
|
+
onFocus: PropTypes__default["default"].func,
|
|
281
281
|
|
|
282
282
|
/**
|
|
283
283
|
* Handle change events on the input
|
|
284
284
|
* <br />
|
|
285
285
|
* Signature: `(inputValue, action) => void`
|
|
286
286
|
*/
|
|
287
|
-
onInputChange: PropTypes__default[
|
|
287
|
+
onInputChange: PropTypes__default["default"].func,
|
|
288
288
|
|
|
289
289
|
/**
|
|
290
290
|
* Select the currently focused option when the user presses tab
|
|
291
291
|
*/
|
|
292
|
-
tabSelectsValue: PropTypes__default[
|
|
292
|
+
tabSelectsValue: PropTypes__default["default"].bool,
|
|
293
293
|
|
|
294
294
|
/**
|
|
295
295
|
* Function that returns a promise, which is the set of options to be used once the promise resolves.
|
|
296
296
|
*/
|
|
297
|
-
loadOptions: PropTypes__default[
|
|
297
|
+
loadOptions: PropTypes__default["default"].func.isRequired,
|
|
298
298
|
|
|
299
299
|
/**
|
|
300
300
|
* The text shown while the options are being loaded
|
|
301
301
|
*/
|
|
302
|
-
loadingMessage: PropTypes__default[
|
|
302
|
+
loadingMessage: PropTypes__default["default"].oneOfType([PropTypes__default["default"].string, PropTypes__default["default"].func]),
|
|
303
303
|
|
|
304
304
|
/**
|
|
305
305
|
* If cacheOptions is truthy, then the loaded data will be cached. The cache will remain until cacheOptions changes value.
|
|
306
306
|
*/
|
|
307
|
-
cacheOptions: PropTypes__default[
|
|
307
|
+
cacheOptions: PropTypes__default["default"].any,
|
|
308
308
|
|
|
309
309
|
/**
|
|
310
310
|
* Custom method to filter whether an option should be displayed in the menu
|
|
311
311
|
*/
|
|
312
|
-
filterOption: PropTypes__default[
|
|
312
|
+
filterOption: PropTypes__default["default"].func,
|
|
313
313
|
|
|
314
314
|
/**
|
|
315
315
|
* The style of the an option in the dropdown menu. It could be single lined option or an option with more and custom info
|
|
316
316
|
*/
|
|
317
|
-
optionType: PropTypes__default[
|
|
317
|
+
optionType: PropTypes__default["default"].oneOf(['single-property', 'double-property', 'multiple-properties']),
|
|
318
318
|
|
|
319
319
|
/**
|
|
320
320
|
* A map of errors. Error messages for known errors are rendered automatically.
|
|
321
321
|
* <br />
|
|
322
322
|
* Unknown errors will be forwarded to `renderError`
|
|
323
323
|
*/
|
|
324
|
-
errors: PropTypes__default[
|
|
325
|
-
missing: PropTypes__default[
|
|
324
|
+
errors: PropTypes__default["default"].shape({
|
|
325
|
+
missing: PropTypes__default["default"].bool
|
|
326
326
|
}),
|
|
327
327
|
|
|
328
328
|
/**
|
|
@@ -330,12 +330,12 @@ SearchSelectField.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
330
330
|
* <br />
|
|
331
331
|
* Signature: `(key, error) => React.node`
|
|
332
332
|
*/
|
|
333
|
-
renderError: PropTypes__default[
|
|
333
|
+
renderError: PropTypes__default["default"].func,
|
|
334
334
|
|
|
335
335
|
/**
|
|
336
336
|
* Indicates if the value is required. Shows an the "required asterisk" if so.
|
|
337
337
|
*/
|
|
338
|
-
isRequired: PropTypes__default[
|
|
338
|
+
isRequired: PropTypes__default["default"].bool,
|
|
339
339
|
|
|
340
340
|
/**
|
|
341
341
|
* Indicates whether the field was touched. Errors will only be shown when the field was touched.
|
|
@@ -347,26 +347,26 @@ SearchSelectField.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
347
347
|
rest[_key2 - 1] = arguments[_key2];
|
|
348
348
|
}
|
|
349
349
|
|
|
350
|
-
return props.isMulti ? PropTypes__default[
|
|
350
|
+
return props.isMulti ? PropTypes__default["default"].arrayOf.apply(PropTypes__default["default"], _concatInstanceProperty__default["default"](_context4 = [PropTypes__default["default"].bool]).call(_context4, rest)).apply(void 0, _concatInstanceProperty__default["default"](_context5 = [props]).call(_context5, rest)) : PropTypes__default["default"].bool.apply(PropTypes__default["default"], _concatInstanceProperty__default["default"](_context6 = [props]).call(_context6, rest));
|
|
351
351
|
},
|
|
352
352
|
// LabelField
|
|
353
353
|
|
|
354
354
|
/**
|
|
355
355
|
* Title of the label
|
|
356
356
|
*/
|
|
357
|
-
title: PropTypes__default[
|
|
357
|
+
title: PropTypes__default["default"].oneOfType([PropTypes__default["default"].string, PropTypes__default["default"].node]).isRequired,
|
|
358
358
|
|
|
359
359
|
/**
|
|
360
360
|
* Hint for the label. Provides a supplementary but important information regarding the behaviour of the input (e.g warn about uniqueness of a field, when it can only be set once), whereas `description` can describe it in more depth. Can also receive a `hintIcon`.
|
|
361
361
|
*/
|
|
362
|
-
hint: requiredIf__default[
|
|
362
|
+
hint: requiredIf__default["default"](PropTypes__default["default"].oneOfType([PropTypes__default["default"].string, PropTypes__default["default"].node]), function (props) {
|
|
363
363
|
return props.hintIcon;
|
|
364
364
|
}),
|
|
365
365
|
|
|
366
366
|
/**
|
|
367
367
|
* Provides a description for the title.
|
|
368
368
|
*/
|
|
369
|
-
description: PropTypes__default[
|
|
369
|
+
description: PropTypes__default["default"].oneOfType([PropTypes__default["default"].string, PropTypes__default["default"].node]),
|
|
370
370
|
|
|
371
371
|
/**
|
|
372
372
|
* Function called when info button is pressed.
|
|
@@ -375,26 +375,26 @@ SearchSelectField.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
375
375
|
* <br />
|
|
376
376
|
* Signature: `(event) => void`
|
|
377
377
|
*/
|
|
378
|
-
onInfoButtonClick: PropTypes__default[
|
|
378
|
+
onInfoButtonClick: PropTypes__default["default"].func,
|
|
379
379
|
|
|
380
380
|
/**
|
|
381
381
|
* Icon to be displayed beside the hint text.
|
|
382
382
|
* <br />
|
|
383
383
|
* Will only get rendered when `hint` is passed as well.
|
|
384
384
|
*/
|
|
385
|
-
hintIcon: PropTypes__default[
|
|
385
|
+
hintIcon: PropTypes__default["default"].node,
|
|
386
386
|
|
|
387
387
|
/**
|
|
388
388
|
* Badge to be displayed beside the label.
|
|
389
389
|
* <br />
|
|
390
390
|
* Might be used to display additional information about the content of the field (E.g verified email)
|
|
391
391
|
*/
|
|
392
|
-
badge: PropTypes__default[
|
|
392
|
+
badge: PropTypes__default["default"].node
|
|
393
393
|
} : {};
|
|
394
394
|
var SearchSelectField$1 = SearchSelectField;
|
|
395
395
|
|
|
396
|
-
// NOTE: This string will be replaced
|
|
397
|
-
var version =
|
|
396
|
+
// NOTE: This string will be replaced on build time with the package version.
|
|
397
|
+
var version = "12.2.7";
|
|
398
398
|
|
|
399
|
-
exports[
|
|
399
|
+
exports["default"] = SearchSelectField$1;
|
|
400
400
|
exports.version = version;
|
|
@@ -42,14 +42,14 @@ var FieldLabel__default = /*#__PURE__*/_interopDefault(FieldLabel);
|
|
|
42
42
|
var SearchSelectInput__default = /*#__PURE__*/_interopDefault(SearchSelectInput);
|
|
43
43
|
var FieldErrors__default = /*#__PURE__*/_interopDefault(FieldErrors);
|
|
44
44
|
|
|
45
|
-
function ownKeys(object, enumerableOnly) { var keys = _Object$keys__default[
|
|
45
|
+
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; }
|
|
46
46
|
|
|
47
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { var _context7; _forEachInstanceProperty__default[
|
|
47
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { var _context7; _forEachInstanceProperty__default["default"](_context7 = ownKeys(Object(source), true)).call(_context7, 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 _context8; _forEachInstanceProperty__default["default"](_context8 = ownKeys(Object(source))).call(_context8, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } } return target; }
|
|
48
48
|
|
|
49
49
|
var hasErrors = function hasErrors(errors) {
|
|
50
50
|
var _context;
|
|
51
51
|
|
|
52
|
-
return errors && _someInstanceProperty__default[
|
|
52
|
+
return errors && _someInstanceProperty__default["default"](_context = _Object$values__default["default"](errors)).call(_context, Boolean);
|
|
53
53
|
};
|
|
54
54
|
|
|
55
55
|
var sequentialId = utils.createSequentialId('async-select-field-');
|
|
@@ -57,11 +57,11 @@ var sequentialId = utils.createSequentialId('async-select-field-');
|
|
|
57
57
|
var SearchSelectField = function SearchSelectField(props) {
|
|
58
58
|
var hasError = Boolean(props.touched) && hasErrors(props.errors);
|
|
59
59
|
var id = props.id || sequentialId();
|
|
60
|
-
return jsxRuntime.jsx(Constraints__default[
|
|
60
|
+
return jsxRuntime.jsx(Constraints__default["default"].Horizontal, {
|
|
61
61
|
max: props.horizontalConstraint,
|
|
62
|
-
children: jsxRuntime.jsxs(Spacings__default[
|
|
62
|
+
children: jsxRuntime.jsxs(Spacings__default["default"].Stack, {
|
|
63
63
|
scale: "xs",
|
|
64
|
-
children: [jsxRuntime.jsx(FieldLabel__default[
|
|
64
|
+
children: [jsxRuntime.jsx(FieldLabel__default["default"], {
|
|
65
65
|
title: props.title,
|
|
66
66
|
hint: props.hint,
|
|
67
67
|
description: props.description,
|
|
@@ -70,7 +70,7 @@ var SearchSelectField = function SearchSelectField(props) {
|
|
|
70
70
|
badge: props.badge,
|
|
71
71
|
hasRequiredIndicator: props.isRequired,
|
|
72
72
|
htmlFor: id
|
|
73
|
-
}), jsxRuntime.jsx(SearchSelectInput__default[
|
|
73
|
+
}), jsxRuntime.jsx(SearchSelectInput__default["default"], _objectSpread(_objectSpread({}, utils.filterDataAttributes(props)), {}, {
|
|
74
74
|
horizontalConstraint: "scale",
|
|
75
75
|
hasError: hasError,
|
|
76
76
|
"aria-label": props['aria-label'],
|
|
@@ -107,7 +107,7 @@ var SearchSelectField = function SearchSelectField(props) {
|
|
|
107
107
|
cacheOptions: props.cacheOptions,
|
|
108
108
|
showOptionGroupDivider: props.showOptionGroupDivider,
|
|
109
109
|
optionType: props.optionType
|
|
110
|
-
})), jsxRuntime.jsx(FieldErrors__default[
|
|
110
|
+
})), jsxRuntime.jsx(FieldErrors__default["default"], {
|
|
111
111
|
errors: props.errors,
|
|
112
112
|
isVisible: hasError,
|
|
113
113
|
renderError: props.renderError
|
|
@@ -120,8 +120,8 @@ SearchSelectField.displayName = 'SearchSelectField';
|
|
|
120
120
|
SearchSelectField.propTypes = {};
|
|
121
121
|
var SearchSelectField$1 = SearchSelectField;
|
|
122
122
|
|
|
123
|
-
// NOTE: This string will be replaced
|
|
124
|
-
var version =
|
|
123
|
+
// NOTE: This string will be replaced on build time with the package version.
|
|
124
|
+
var version = "12.2.7";
|
|
125
125
|
|
|
126
|
-
exports[
|
|
126
|
+
exports["default"] = SearchSelectField$1;
|
|
127
127
|
exports.version = version;
|
|
@@ -368,7 +368,7 @@ SearchSelectField.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
368
368
|
} : {};
|
|
369
369
|
var SearchSelectField$1 = SearchSelectField;
|
|
370
370
|
|
|
371
|
-
// NOTE: This string will be replaced
|
|
372
|
-
var version =
|
|
371
|
+
// NOTE: This string will be replaced on build time with the package version.
|
|
372
|
+
var version = "12.2.7";
|
|
373
373
|
|
|
374
374
|
export { SearchSelectField$1 as default, version };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@commercetools-uikit/search-select-field",
|
|
3
3
|
"description": "A search select field built on top of search select input, allowing users to asynchronously search for options",
|
|
4
|
-
"version": "12.2.
|
|
4
|
+
"version": "12.2.7",
|
|
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,19 +18,16 @@
|
|
|
19
18
|
"main": "dist/commercetools-uikit-search-select-field.cjs.js",
|
|
20
19
|
"module": "dist/commercetools-uikit-search-select-field.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/constraints": "12.2.
|
|
29
|
-
"@commercetools-uikit/design-system": "12.2.
|
|
30
|
-
"@commercetools-uikit/field-errors": "12.2.
|
|
31
|
-
"@commercetools-uikit/field-label": "12.2.
|
|
32
|
-
"@commercetools-uikit/search-select-input": "12.2.
|
|
33
|
-
"@commercetools-uikit/spacings": "12.2.
|
|
34
|
-
"@commercetools-uikit/utils": "12.2.
|
|
22
|
+
"@babel/runtime": "7.16.3",
|
|
23
|
+
"@babel/runtime-corejs3": "7.16.3",
|
|
24
|
+
"@commercetools-uikit/constraints": "12.2.5",
|
|
25
|
+
"@commercetools-uikit/design-system": "12.2.5",
|
|
26
|
+
"@commercetools-uikit/field-errors": "12.2.5",
|
|
27
|
+
"@commercetools-uikit/field-label": "12.2.7",
|
|
28
|
+
"@commercetools-uikit/search-select-input": "12.2.7",
|
|
29
|
+
"@commercetools-uikit/spacings": "12.2.5",
|
|
30
|
+
"@commercetools-uikit/utils": "12.2.5",
|
|
35
31
|
"@emotion/react": "^11.4.0",
|
|
36
32
|
"@emotion/styled": "^11.3.0",
|
|
37
33
|
"prop-types": "15.7.2",
|