@commercetools-uikit/select-utils 16.0.0 → 16.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -51,28 +51,25 @@ var messages$1 = reactIntl.defineMessages({
|
|
|
51
51
|
});
|
|
52
52
|
|
|
53
53
|
const _excluded = ["ref", "onMouseDown"];
|
|
54
|
-
|
|
55
54
|
function ownKeys$6(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; }
|
|
56
|
-
|
|
57
55
|
function _objectSpread$6(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$6(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$6(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
58
|
-
|
|
59
56
|
const ClearIndicator = props => {
|
|
60
57
|
const intl = reactIntl.useIntl();
|
|
61
|
-
|
|
62
58
|
const getStyles = props.getStyles,
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
59
|
+
_props$innerProps = props.innerProps,
|
|
60
|
+
ref = _props$innerProps.ref,
|
|
61
|
+
onMouseDown = _props$innerProps.onMouseDown,
|
|
62
|
+
restInnerProps = _objectWithoutProperties(_props$innerProps, _excluded);
|
|
68
63
|
return jsxRuntime.jsx("button", _objectSpread$6(_objectSpread$6({}, restInnerProps), {}, {
|
|
69
64
|
ref: ref,
|
|
70
65
|
css: /*#__PURE__*/react.css("border:none;cursor:pointer;background:none;box-sizing:border-box;text-decoration:none;fill:", designSystem.designTokens.fontColorForClearInputIcon, ";:hover svg *{fill:", designSystem.designTokens.fontColorForClearInputIconWhenHovered, ";}" + (process.env.NODE_ENV === "production" ? "" : ";label:ClearIndicator;"), process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImNsZWFyLWluZGljYXRvci50c3giXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBMEJjIiwiZmlsZSI6ImNsZWFyLWluZGljYXRvci50c3giLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgdHlwZSB7IENTU1Byb3BlcnRpZXMsIExlZ2FjeVJlZiB9IGZyb20gJ3JlYWN0JztcbmltcG9ydCB0eXBlIHsgQ2xlYXJJbmRpY2F0b3JQcm9wcyB9IGZyb20gJ3JlYWN0LXNlbGVjdCc7XG5pbXBvcnQgeyBjc3MgfSBmcm9tICdAZW1vdGlvbi9yZWFjdCc7XG5pbXBvcnQgeyB1c2VJbnRsIH0gZnJvbSAncmVhY3QtaW50bCc7XG5pbXBvcnQgeyBkZXNpZ25Ub2tlbnMgfSBmcm9tICdAY29tbWVyY2V0b29scy11aWtpdC9kZXNpZ24tc3lzdGVtJztcbmltcG9ydCB7IENsb3NlSWNvbiB9IGZyb20gJ0Bjb21tZXJjZXRvb2xzLXVpa2l0L2ljb25zJztcbmltcG9ydCBtZXNzYWdlcyBmcm9tICcuL21lc3NhZ2VzJztcblxudHlwZSBUSW5uZXJQcm9wcyA9IHtcbiAgcmVmOiBMZWdhY3lSZWY8SFRNTEJ1dHRvbkVsZW1lbnQ+O1xufSAmIEpTWC5JbnRyaW5zaWNFbGVtZW50c1snYnV0dG9uJ107XG5cbmV4cG9ydCB0eXBlIFRDbGVhckluZGljYXRvclByb3BzID0ge1xuICBpbm5lclByb3BzOiBUSW5uZXJQcm9wcztcbn0gJiBDbGVhckluZGljYXRvclByb3BzO1xuXG5jb25zdCBDbGVhckluZGljYXRvciA9IChwcm9wczogVENsZWFySW5kaWNhdG9yUHJvcHMpID0+IHtcbiAgY29uc3QgaW50bCA9IHVzZUludGwoKTtcbiAgY29uc3Qge1xuICAgIGdldFN0eWxlcyxcbiAgICBpbm5lclByb3BzOiB7IHJlZiwgb25Nb3VzZURvd24sIC4uLnJlc3RJbm5lclByb3BzIH0sXG4gIH0gPSBwcm9wcztcbiAgcmV0dXJuIChcbiAgICA8YnV0dG9uXG4gICAgICB7Li4ucmVzdElubmVyUHJvcHN9XG4gICAgICByZWY9e3JlZn1cbiAgICAgIGNzcz17Y3NzYFxuICAgICAgICBib3JkZXI6IG5vbmU7XG4gICAgICAgIGN1cnNvcjogcG9pbnRlcjtcbiAgICAgICAgYmFja2dyb3VuZDogbm9uZTtcbiAgICAgICAgYm94LXNpemluZzogYm9yZGVyLWJveDtcbiAgICAgICAgdGV4dC1kZWNvcmF0aW9uOiBub25lO1xuICAgICAgICBmaWxsOiAke2Rlc2lnblRva2Vucy5mb250Q29sb3JGb3JDbGVhcklucHV0SWNvbn07XG4gICAgICAgIDpob3ZlciBzdmcgKiB7XG4gICAgICAgICAgZmlsbDogJHtkZXNpZ25Ub2tlbnMuZm9udENvbG9yRm9yQ2xlYXJJbnB1dEljb25XaGVuSG92ZXJlZH07XG4gICAgICAgIH1cbiAgICAgIGB9XG4gICAgICBzdHlsZT17Z2V0U3R5bGVzKCdjbGVhckluZGljYXRvcicsIHByb3BzKSBhcyBDU1NQcm9wZXJ0aWVzfVxuICAgICAgdGl0bGU9e2ludGwuZm9ybWF0TWVzc2FnZShtZXNzYWdlcy5jbGVhckJ1dHRvbkxhYmVsKX1cbiAgICAgIGFyaWEtbGFiZWw9e2ludGwuZm9ybWF0TWVzc2FnZShtZXNzYWdlcy5jbGVhckJ1dHRvbkxhYmVsKX1cbiAgICAgIC8vIG92ZXJyaWRpbmcgdGhlIGRlZmF1bHQgYGFyaWEtaGlkZGVuYCBwcm9wIHZhbHVlIHRvIG1ha2UgdGhlIGNvbXBvbmVudCBhY2Nlc3NpYmxlIGJ5IGtleWJvYXJkIC0gaHR0cHM6Ly9naXRodWIuY29tL0plZFdhdHNvbi9yZWFjdC1zZWxlY3QvaXNzdWVzLzQ3OTNcbiAgICAgIGFyaWEtaGlkZGVuPXtmYWxzZX1cbiAgICAgIC8vIG9ubHkgb25Nb3VzZURvd24gYW5kIG9uVG91Y2hFbmQgZXZlbnQgaGFuZGxlcnMgYXJlIHBhc3NlZCBieSBgcmVhY3Qtc2VsZWN0YCB0byB0aGUgY29tcG9uZW50IGJ5IGRlZmF1bHQsIHdoaWNoIG1ha2VzIGl0IG5vdCBhY2Nlc3NpYmxlIGJ5IGtleWJvYXJkXG4gICAgICBvbkNsaWNrPXtvbk1vdXNlRG93bn1cbiAgICA+XG4gICAgICA8Q2xvc2VJY29uIHNpemU9XCJtZWRpdW1cIiAvPlxuICAgIDwvYnV0dG9uPlxuICApO1xufTtcblxuQ2xlYXJJbmRpY2F0b3IuZGlzcGxheU5hbWUgPSAnQ2xlYXJJbmRpY2F0b3InO1xuXG5leHBvcnQgZGVmYXVsdCBDbGVhckluZGljYXRvcjtcbiJdfQ== */"),
|
|
71
66
|
style: getStyles('clearIndicator', props),
|
|
72
67
|
title: intl.formatMessage(messages$1.clearButtonLabel),
|
|
73
|
-
"aria-label": intl.formatMessage(messages$1.clearButtonLabel)
|
|
68
|
+
"aria-label": intl.formatMessage(messages$1.clearButtonLabel)
|
|
69
|
+
// overriding the default `aria-hidden` prop value to make the component accessible by keyboard - https://github.com/JedWatson/react-select/issues/4793
|
|
74
70
|
,
|
|
75
|
-
"aria-hidden": false
|
|
71
|
+
"aria-hidden": false
|
|
72
|
+
// only onMouseDown and onTouchEnd event handlers are passed by `react-select` to the component by default, which makes it not accessible by keyboard
|
|
76
73
|
,
|
|
77
74
|
onClick: onMouseDown,
|
|
78
75
|
children: jsxRuntime.jsx(icons.CloseIcon, {
|
|
@@ -80,20 +77,17 @@ const ClearIndicator = props => {
|
|
|
80
77
|
})
|
|
81
78
|
}));
|
|
82
79
|
};
|
|
83
|
-
|
|
84
80
|
ClearIndicator.displayName = 'ClearIndicator';
|
|
85
81
|
var ClearIndicator$1 = ClearIndicator;
|
|
86
82
|
|
|
87
83
|
function ownKeys$5(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; }
|
|
88
|
-
|
|
89
84
|
function _objectSpread$5(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$5(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$5(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
90
85
|
// see https://github.com/JedWatson/react-select/blob/44e9fb29b230e49a754a2f0d6f30c2250aa45009/src/components/MultiValue.js
|
|
91
86
|
const removeProps = ['onClick', 'onTouchEnd', 'onMouseDown'];
|
|
92
|
-
|
|
93
87
|
const TagRemove = props => {
|
|
94
|
-
const isDisabled = Boolean(props.selectProps.isDisabled || props.selectProps.isReadOnly);
|
|
88
|
+
const isDisabled = Boolean(props.selectProps.isDisabled || props.selectProps.isReadOnly);
|
|
89
|
+
// when the select input is disabled,
|
|
95
90
|
// we don't want to spread the removeProp event handlers
|
|
96
|
-
|
|
97
91
|
const innerProps = isDisabled ? omit__default["default"](props.innerProps, removeProps) : props.innerProps;
|
|
98
92
|
return jsxRuntime.jsx(AccessibleButton__default["default"], _objectSpread$5(_objectSpread$5({
|
|
99
93
|
label: "Remove"
|
|
@@ -104,28 +98,22 @@ const TagRemove = props => {
|
|
|
104
98
|
})
|
|
105
99
|
}));
|
|
106
100
|
};
|
|
107
|
-
|
|
108
101
|
TagRemove.displayName = 'TagRemove';
|
|
109
102
|
var TagRemove$1 = TagRemove;
|
|
110
103
|
|
|
111
104
|
function ownKeys$4(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; }
|
|
112
|
-
|
|
113
105
|
function _objectSpread$4(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$4(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$4(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
114
|
-
|
|
115
106
|
const DropdownIndicator = props => jsxRuntime.jsx(reactSelect.components.DropdownIndicator, _objectSpread$4(_objectSpread$4({}, props), {}, {
|
|
116
107
|
children: jsxRuntime.jsx(icons.CaretDownIcon, {
|
|
117
108
|
color: props.isDisabled ? 'neutral60' : undefined,
|
|
118
109
|
size: "small"
|
|
119
110
|
})
|
|
120
111
|
}));
|
|
121
|
-
|
|
122
112
|
DropdownIndicator.displayName = 'DropdownIndicator';
|
|
123
113
|
var DropdownIndicator$1 = DropdownIndicator;
|
|
124
114
|
|
|
125
115
|
function ownKeys$3(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; }
|
|
126
|
-
|
|
127
116
|
function _objectSpread$3(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$3(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$3(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
128
|
-
|
|
129
117
|
const SearchIconDropdownIndicator = props => {
|
|
130
118
|
return jsxRuntime.jsx(reactSelect.components.DropdownIndicator, _objectSpread$3(_objectSpread$3({}, props), {}, {
|
|
131
119
|
children: jsxRuntime.jsx(icons.SearchIcon, {
|
|
@@ -134,27 +122,21 @@ const SearchIconDropdownIndicator = props => {
|
|
|
134
122
|
})
|
|
135
123
|
}));
|
|
136
124
|
};
|
|
137
|
-
|
|
138
125
|
SearchIconDropdownIndicator.displayName = 'SearchIconDropdownIndicator';
|
|
139
126
|
var SearchIconDropdownIndicator$1 = SearchIconDropdownIndicator;
|
|
140
127
|
|
|
141
128
|
function ownKeys$2(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; }
|
|
142
|
-
|
|
143
129
|
function _objectSpread$2(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$2(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$2(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
144
|
-
|
|
145
130
|
const getDefaultComponent = type => {
|
|
146
131
|
if (type === 'singleValue') return reactSelect.components.SingleValue;
|
|
147
132
|
if (type === 'placeholder') return reactSelect.components.Placeholder;
|
|
148
133
|
return null;
|
|
149
134
|
};
|
|
150
|
-
|
|
151
135
|
const WrapperWithIcon = props => {
|
|
152
136
|
const DefaultComponent = getDefaultComponent(props.type);
|
|
153
|
-
|
|
154
137
|
if (!DefaultComponent) {
|
|
155
138
|
return null;
|
|
156
139
|
}
|
|
157
|
-
|
|
158
140
|
return jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
159
141
|
children: [props.selectProps.iconLeft && /*#__PURE__*/react$1.cloneElement(props.selectProps.iconLeft, {
|
|
160
142
|
size: 'big'
|
|
@@ -167,7 +149,6 @@ const WrapperWithIcon = props => {
|
|
|
167
149
|
})]
|
|
168
150
|
});
|
|
169
151
|
};
|
|
170
|
-
|
|
171
152
|
WrapperWithIcon.displayName = 'WrapperWithIcon';
|
|
172
153
|
var WrapperWithIcon$1 = WrapperWithIcon;
|
|
173
154
|
const customComponents = {
|
|
@@ -187,7 +168,6 @@ const SELECT_DROPDOWN_OPTION_TYPES = {
|
|
|
187
168
|
};
|
|
188
169
|
|
|
189
170
|
function ownKeys$1(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; }
|
|
190
|
-
|
|
191
171
|
function _objectSpread$1(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$1(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$1(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
192
172
|
const MultiplePropertiesSelectInputOption = props => {
|
|
193
173
|
const data = props.data;
|
|
@@ -225,20 +205,16 @@ const DoublePropertySelectInputOption = props => {
|
|
|
225
205
|
DoublePropertySelectInputOption.displayName = 'DoublePropertySelectInputOption';
|
|
226
206
|
const CustomSelectInputOption = props => {
|
|
227
207
|
var _props$optionInnerPro;
|
|
228
|
-
|
|
229
208
|
const noValueFallback = props.noValueFallback || NO_VALUE_FALLBACK;
|
|
230
|
-
|
|
231
209
|
switch (props.optionType) {
|
|
232
210
|
case SELECT_DROPDOWN_OPTION_TYPES.MULTIPLE_PROPERTIES:
|
|
233
211
|
return jsxRuntime.jsx(MultiplePropertiesSelectInputOption, _objectSpread$1(_objectSpread$1({}, props.optionInnerProps), {}, {
|
|
234
212
|
noValueFallback: noValueFallback
|
|
235
213
|
}));
|
|
236
|
-
|
|
237
214
|
case SELECT_DROPDOWN_OPTION_TYPES.DOUBLE_PROPERTY:
|
|
238
215
|
return jsxRuntime.jsx(DoublePropertySelectInputOption, _objectSpread$1(_objectSpread$1({}, props.optionInnerProps), {}, {
|
|
239
216
|
noValueFallback: noValueFallback
|
|
240
217
|
}));
|
|
241
|
-
|
|
242
218
|
default:
|
|
243
219
|
return jsxRuntime.jsx(reactSelect.components.Option, _objectSpread$1(_objectSpread$1({}, props.optionInnerProps), {}, {
|
|
244
220
|
children: jsxRuntime.jsx(Text__default["default"].Detail, {
|
|
@@ -278,32 +254,24 @@ var messages = reactIntl.defineMessages({
|
|
|
278
254
|
});
|
|
279
255
|
|
|
280
256
|
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; }
|
|
281
|
-
|
|
282
257
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var _context9, _context10; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context9 = ownKeys(Object(source), !0)).call(_context9, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context10 = ownKeys(Object(source))).call(_context10, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
283
|
-
|
|
284
258
|
const getControlBorderColor = (props, defaultColor) => {
|
|
285
259
|
if (props.isDisabled) {
|
|
286
260
|
return designSystem.designTokens.borderColorForInputWhenDisabled;
|
|
287
261
|
}
|
|
288
|
-
|
|
289
262
|
if (props.isReadOnly) {
|
|
290
263
|
return designSystem.designTokens.borderColorForSelectInputWhenReadonly;
|
|
291
264
|
}
|
|
292
|
-
|
|
293
265
|
if (props.hasError) {
|
|
294
266
|
return designSystem.designTokens.borderColorForInputWhenError;
|
|
295
267
|
}
|
|
296
|
-
|
|
297
268
|
if (props.hasWarning) {
|
|
298
269
|
return designSystem.designTokens.borderColorForInputWhenWarning;
|
|
299
270
|
}
|
|
300
|
-
|
|
301
271
|
return defaultColor;
|
|
302
272
|
};
|
|
303
|
-
|
|
304
273
|
const controlStyles = props => (base, state) => {
|
|
305
274
|
var _context;
|
|
306
|
-
|
|
307
275
|
return _objectSpread(_objectSpread({}, base), {}, {
|
|
308
276
|
fontSize: designSystem.designTokens.fontSizeForInput,
|
|
309
277
|
backgroundColor: (() => {
|
|
@@ -337,7 +305,6 @@ const controlStyles = props => (base, state) => {
|
|
|
337
305
|
'&:focus-within': {
|
|
338
306
|
boxShadow: (() => {
|
|
339
307
|
var _context2;
|
|
340
|
-
|
|
341
308
|
if (!props.isDisabled && !props.isReadOnly) return _concatInstanceProperty__default["default"](_context2 = "".concat(designSystem.designTokens.boxShadowForSelectInputWhenFocused, " ")).call(_context2, designSystem.designTokens.borderColorForInputWhenFocused);
|
|
342
309
|
return null;
|
|
343
310
|
})(),
|
|
@@ -357,7 +324,6 @@ const controlStyles = props => (base, state) => {
|
|
|
357
324
|
color: props.isDisabled || props.isReadOnly ? designSystem.designTokens.fontColorForInputWhenDisabled : base.fontColorForInput
|
|
358
325
|
});
|
|
359
326
|
};
|
|
360
|
-
|
|
361
327
|
const menuStyles = props => base => {
|
|
362
328
|
return _objectSpread(_objectSpread({}, base), {}, {
|
|
363
329
|
border: "1px solid ".concat(designSystem.designTokens.borderColorForSelectInputMenu),
|
|
@@ -374,7 +340,6 @@ const menuStyles = props => base => {
|
|
|
374
340
|
})()
|
|
375
341
|
});
|
|
376
342
|
};
|
|
377
|
-
|
|
378
343
|
const indicatorSeparatorStyles = () => base => {
|
|
379
344
|
return _objectSpread(_objectSpread({}, base), {}, {
|
|
380
345
|
display: 'none',
|
|
@@ -383,7 +348,6 @@ const indicatorSeparatorStyles = () => base => {
|
|
|
383
348
|
marginLeft: designSystem.designTokens.spacing10
|
|
384
349
|
});
|
|
385
350
|
};
|
|
386
|
-
|
|
387
351
|
const dropdownIndicatorStyles = props => base => {
|
|
388
352
|
return _objectSpread(_objectSpread({}, base), {}, {
|
|
389
353
|
color: designSystem.designTokens.fontColorForInput,
|
|
@@ -398,13 +362,11 @@ const dropdownIndicatorStyles = props => base => {
|
|
|
398
362
|
})()
|
|
399
363
|
});
|
|
400
364
|
};
|
|
401
|
-
|
|
402
365
|
const clearIndicatorStyles = () => base => _objectSpread(_objectSpread({}, base), {}, {
|
|
403
366
|
display: 'flex',
|
|
404
367
|
padding: 0,
|
|
405
368
|
marginLeft: designSystem.designTokens.marginForSelectInputIcon
|
|
406
369
|
});
|
|
407
|
-
|
|
408
370
|
const menuListStyles = () => base => {
|
|
409
371
|
return _objectSpread(_objectSpread({}, base), {}, {
|
|
410
372
|
padding: designSystem.designTokens.paddingForSelectInputMenu,
|
|
@@ -412,10 +374,8 @@ const menuListStyles = () => base => {
|
|
|
412
374
|
backgroundColor: designSystem.designTokens.backgroundColorForInput
|
|
413
375
|
});
|
|
414
376
|
};
|
|
415
|
-
|
|
416
377
|
const optionStyles = () => (base, state) => {
|
|
417
378
|
var _context3, _context4;
|
|
418
|
-
|
|
419
379
|
return _objectSpread(_objectSpread({}, base), {}, {
|
|
420
380
|
transition: _concatInstanceProperty__default["default"](_context3 = _concatInstanceProperty__default["default"](_context4 = "border-color ".concat(designSystem.designTokens.transitionStandard, ",\n background-color ")).call(_context4, designSystem.designTokens.transitionStandard, ",\n color ")).call(_context3, designSystem.designTokens.transitionStandard),
|
|
421
381
|
paddingLeft: designSystem.designTokens.paddingLeftForSelectInputOptions,
|
|
@@ -442,7 +402,6 @@ const optionStyles = () => (base, state) => {
|
|
|
442
402
|
}
|
|
443
403
|
});
|
|
444
404
|
};
|
|
445
|
-
|
|
446
405
|
const placeholderStyles = props => base => {
|
|
447
406
|
return _objectSpread(_objectSpread({}, base), {}, {
|
|
448
407
|
color: (() => {
|
|
@@ -455,8 +414,8 @@ const placeholderStyles = props => base => {
|
|
|
455
414
|
fill: props.isDisabled || props.isReadOnly ? designSystem.designTokens.fontColorForInputWhenDisabled : base.fontColorForInput
|
|
456
415
|
});
|
|
457
416
|
};
|
|
458
|
-
|
|
459
417
|
const valueContainerStyles = props => base => {
|
|
418
|
+
var _props$controlShouldR;
|
|
460
419
|
return _objectSpread(_objectSpread({}, base), {}, {
|
|
461
420
|
padding: '0',
|
|
462
421
|
backgroundColor: 'none',
|
|
@@ -464,29 +423,25 @@ const valueContainerStyles = props => base => {
|
|
|
464
423
|
// Display property should be grid when isMulti and has no value so the Placeholder component is positioned correctly with the Input
|
|
465
424
|
// Display property should be Flex when there is an iconLeft, also when the input has some values when isMulti.
|
|
466
425
|
// See PR from react select for more insight https://github.com/JedWatson/react-select/pull/4833
|
|
467
|
-
display: props.iconLeft && !props.isMulti || props.isMulti && props.hasValue && props.controlShouldRenderValue ? 'flex' : 'grid',
|
|
426
|
+
display: props.iconLeft && !props.isMulti || props.isMulti && props.hasValue && ((_props$controlShouldR = props.controlShouldRenderValue) !== null && _props$controlShouldR !== void 0 ? _props$controlShouldR : true) ? 'flex' : 'grid',
|
|
468
427
|
fill: props.isDisabled || props.isReadOnly ? designSystem.designTokens.fontColorForInputWhenDisabled : designSystem.designTokens.fontColorForSelectInputIcon
|
|
469
428
|
});
|
|
470
429
|
};
|
|
471
|
-
|
|
472
430
|
const singleValueStyles = props => base => {
|
|
473
431
|
return _objectSpread(_objectSpread({}, base), {}, {
|
|
474
432
|
color: (() => {
|
|
475
433
|
if (props.isDisabled) {
|
|
476
434
|
return designSystem.designTokens.fontColorForInputWhenDisabled;
|
|
477
435
|
}
|
|
478
|
-
|
|
479
436
|
if (props.isReadOnly) {
|
|
480
437
|
return designSystem.designTokens.fontColorForInputWhenReadonly;
|
|
481
438
|
}
|
|
482
|
-
|
|
483
439
|
if (props.hasError) return designSystem.designTokens.fontColorForSelectInputWhenError;
|
|
484
440
|
if (props.hasWarning) return designSystem.designTokens.fontColorForSelectInputWhenWarning;
|
|
485
441
|
return designSystem.designTokens.fontColorForInput;
|
|
486
442
|
})()
|
|
487
443
|
});
|
|
488
444
|
};
|
|
489
|
-
|
|
490
445
|
const groupStyles = props => base => {
|
|
491
446
|
return _objectSpread(_objectSpread({}, base), {}, {
|
|
492
447
|
padding: 0,
|
|
@@ -495,10 +450,8 @@ const groupStyles = props => base => {
|
|
|
495
450
|
}
|
|
496
451
|
});
|
|
497
452
|
};
|
|
498
|
-
|
|
499
453
|
const groupHeadingStyles = () => base => {
|
|
500
454
|
var _context5;
|
|
501
|
-
|
|
502
455
|
return _objectSpread(_objectSpread({}, base), {}, {
|
|
503
456
|
color: designSystem.designTokens.fontColorForInputWhenReadonly,
|
|
504
457
|
fontSize: designSystem.designTokens.fontSizeSmall,
|
|
@@ -510,7 +463,6 @@ const groupHeadingStyles = () => base => {
|
|
|
510
463
|
}
|
|
511
464
|
});
|
|
512
465
|
};
|
|
513
|
-
|
|
514
466
|
const containerStyles = () => (base, state) => {
|
|
515
467
|
return _objectSpread(_objectSpread({}, base), {}, {
|
|
516
468
|
fontFamily: 'inherit',
|
|
@@ -520,17 +472,14 @@ const containerStyles = () => (base, state) => {
|
|
|
520
472
|
boxShadow: state.isFocused ? 'none' : base.boxShadow
|
|
521
473
|
});
|
|
522
474
|
};
|
|
523
|
-
|
|
524
475
|
const indicatorsContainerStyles = () => () => ({
|
|
525
476
|
background: 'none',
|
|
526
477
|
display: 'flex',
|
|
527
478
|
alignItems: 'center'
|
|
528
479
|
});
|
|
529
|
-
|
|
530
480
|
const menuPortalStyles = props => base => _objectSpread(_objectSpread({}, base), {}, {
|
|
531
481
|
zIndex: props.menuPortalZIndex
|
|
532
482
|
});
|
|
533
|
-
|
|
534
483
|
const multiValueStyles = () => base => {
|
|
535
484
|
return _objectSpread(_objectSpread({}, base), {}, {
|
|
536
485
|
display: 'flex',
|
|
@@ -541,10 +490,8 @@ const multiValueStyles = () => base => {
|
|
|
541
490
|
border: designSystem.designTokens.borderForSelectInputTag
|
|
542
491
|
});
|
|
543
492
|
};
|
|
544
|
-
|
|
545
493
|
const multiValueLabelStyles = props => base => {
|
|
546
494
|
var _context6, _context7;
|
|
547
|
-
|
|
548
495
|
return _objectSpread(_objectSpread({}, base), {}, {
|
|
549
496
|
fontSize: designSystem.designTokens.fontSizeForSelectInputTag,
|
|
550
497
|
color: (() => {
|
|
@@ -554,7 +501,7 @@ const multiValueLabelStyles = props => base => {
|
|
|
554
501
|
})(),
|
|
555
502
|
padding: _concatInstanceProperty__default["default"](_context6 = "".concat(designSystem.designTokens.spacing10, " ")).call(_context6, designSystem.designTokens.spacing20),
|
|
556
503
|
borderRadius: _concatInstanceProperty__default["default"](_context7 = "".concat(designSystem.designTokens.borderRadiusForTag, " 0 0 ")).call(_context7, designSystem.designTokens.borderRadiusForTag),
|
|
557
|
-
border:
|
|
504
|
+
border: 'none',
|
|
558
505
|
borderWidth: '1px 0 1px 1px',
|
|
559
506
|
'&:last-child': {
|
|
560
507
|
borderRadius: designSystem.designTokens.borderRadiusForTag,
|
|
@@ -562,16 +509,14 @@ const multiValueLabelStyles = props => base => {
|
|
|
562
509
|
}
|
|
563
510
|
});
|
|
564
511
|
};
|
|
565
|
-
|
|
566
512
|
const multiValueRemoveStyles = props => (base, state) => {
|
|
567
513
|
var _context8;
|
|
568
|
-
|
|
569
514
|
return _objectSpread(_objectSpread({}, base), {}, {
|
|
570
515
|
borderColor: designSystem.designTokens.borderColorForTag,
|
|
571
516
|
padding: "0 ".concat(designSystem.designTokens.spacing10),
|
|
572
517
|
borderRadius: _concatInstanceProperty__default["default"](_context8 = "0 ".concat(designSystem.designTokens.borderRadiusForTag, " ")).call(_context8, designSystem.designTokens.borderRadiusForTag, " 0"),
|
|
573
|
-
borderStyle:
|
|
574
|
-
borderWidth:
|
|
518
|
+
borderStyle: 'none',
|
|
519
|
+
borderWidth: '0',
|
|
575
520
|
pointerEvents: state.isDisabled || props.isReadOnly ? 'none' : base.pointerEvents,
|
|
576
521
|
backgroundColor: designSystem.designTokens.backgroundColorForTag,
|
|
577
522
|
'svg *': {
|
|
@@ -586,7 +531,6 @@ const multiValueRemoveStyles = props => (base, state) => {
|
|
|
586
531
|
}
|
|
587
532
|
});
|
|
588
533
|
};
|
|
589
|
-
|
|
590
534
|
function createSelectStyles(props) {
|
|
591
535
|
return {
|
|
592
536
|
control: controlStyles(props),
|
|
@@ -611,7 +555,6 @@ function createSelectStyles(props) {
|
|
|
611
555
|
}
|
|
612
556
|
|
|
613
557
|
const getMessage = componentName => "".concat(componentName, ": use `menuPortalZIndex` in conjunction with `menuPortalTarget`");
|
|
614
|
-
|
|
615
558
|
const warnIfMenuPortalPropsAreMissing = props => {
|
|
616
559
|
if (typeof props.menuPortalZIndex !== 'undefined' && props.menuPortalZIndex !== 1 // 1 is the value passed in default props
|
|
617
560
|
) {
|
|
@@ -620,7 +563,7 @@ const warnIfMenuPortalPropsAreMissing = props => {
|
|
|
620
563
|
};
|
|
621
564
|
|
|
622
565
|
// NOTE: This string will be replaced on build time with the package version.
|
|
623
|
-
var version = "16.
|
|
566
|
+
var version = "16.1.1";
|
|
624
567
|
|
|
625
568
|
exports.ClearIndicator = ClearIndicator$1;
|
|
626
569
|
exports.CustomSelectInputOption = CustomSelectInputOption;
|