@commercetools-uikit/select-utils 12.2.4 → 12.2.9
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/dist/commercetools-uikit-select-utils.cjs.d.ts +1 -0
- package/dist/commercetools-uikit-select-utils.cjs.dev.js +42 -83
- package/dist/commercetools-uikit-select-utils.cjs.prod.js +35 -40
- package/dist/commercetools-uikit-select-utils.esm.js +41 -81
- package/dist/declarations/src/clear-indicator/clear-indicator.d.ts +13 -0
- package/dist/declarations/src/clear-indicator/index.d.ts +1 -0
- package/dist/declarations/src/clear-indicator/messages.d.ts +8 -0
- package/dist/declarations/src/create-select-styles.d.ts +294 -0
- package/dist/declarations/src/custom-styled-select-options/constants.d.ts +6 -0
- package/dist/declarations/src/custom-styled-select-options/custom-styled-select-options.d.ts +29 -0
- package/dist/declarations/src/custom-styled-select-options/index.d.ts +2 -0
- package/dist/declarations/src/dropdown-indicator/dropdown-indicator.d.ts +6 -0
- package/dist/declarations/src/dropdown-indicator/index.d.ts +1 -0
- package/dist/declarations/src/index.d.ts +10 -0
- package/dist/declarations/src/messages.d.ts +28 -0
- package/dist/declarations/src/search-icon-dropdown-indicator/index.d.ts +1 -0
- package/dist/declarations/src/search-icon-dropdown-indicator/search-icon-dropdown-indicator.d.ts +6 -0
- package/dist/declarations/src/tag-remove/index.d.ts +1 -0
- package/dist/declarations/src/tag-remove/tag-remove.d.ts +12 -0
- package/dist/declarations/src/version.d.ts +2 -0
- package/dist/declarations/src/wrapper-with-icon/index.d.ts +1 -0
- package/dist/declarations/src/wrapper-with-icon/wrapper-with-icon.d.ts +19 -0
- package/package.json +11 -15
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./declarations/src/index";
|
|
@@ -15,15 +15,14 @@ var _defineProperty = require('@babel/runtime-corejs3/helpers/defineProperty');
|
|
|
15
15
|
var _concatInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/concat');
|
|
16
16
|
var designSystem = require('@commercetools-uikit/design-system');
|
|
17
17
|
var _objectWithoutProperties = require('@babel/runtime-corejs3/helpers/objectWithoutProperties');
|
|
18
|
-
var PropTypes = require('prop-types');
|
|
19
18
|
var react = require('@emotion/react');
|
|
20
19
|
var icons = require('@commercetools-uikit/icons');
|
|
21
20
|
var jsxRuntime = require('@emotion/react/jsx-runtime');
|
|
22
21
|
var omit = require('lodash/omit');
|
|
23
22
|
var AccessibleButton = require('@commercetools-uikit/accessible-button');
|
|
24
23
|
var reactSelect = require('react-select');
|
|
24
|
+
var _pt = require('prop-types');
|
|
25
25
|
var react$1 = require('react');
|
|
26
|
-
var _Object$values = require('@babel/runtime-corejs3/core-js-stable/object/values');
|
|
27
26
|
var Spacings = require('@commercetools-uikit/spacings');
|
|
28
27
|
var Text = require('@commercetools-uikit/text');
|
|
29
28
|
|
|
@@ -38,10 +37,9 @@ var _Object$getOwnPropertyDescriptors__default = /*#__PURE__*/_interopDefault(_O
|
|
|
38
37
|
var _Object$defineProperties__default = /*#__PURE__*/_interopDefault(_Object$defineProperties);
|
|
39
38
|
var _Object$defineProperty__default = /*#__PURE__*/_interopDefault(_Object$defineProperty);
|
|
40
39
|
var _concatInstanceProperty__default = /*#__PURE__*/_interopDefault(_concatInstanceProperty);
|
|
41
|
-
var PropTypes__default = /*#__PURE__*/_interopDefault(PropTypes);
|
|
42
40
|
var omit__default = /*#__PURE__*/_interopDefault(omit);
|
|
43
41
|
var AccessibleButton__default = /*#__PURE__*/_interopDefault(AccessibleButton);
|
|
44
|
-
var
|
|
42
|
+
var _pt__default = /*#__PURE__*/_interopDefault(_pt);
|
|
45
43
|
var Spacings__default = /*#__PURE__*/_interopDefault(Spacings);
|
|
46
44
|
var Text__default = /*#__PURE__*/_interopDefault(Text);
|
|
47
45
|
|
|
@@ -53,7 +51,7 @@ var messages$1 = reactIntl.defineMessages({
|
|
|
53
51
|
}
|
|
54
52
|
});
|
|
55
53
|
|
|
56
|
-
var _excluded
|
|
54
|
+
var _excluded = ["ref"];
|
|
57
55
|
|
|
58
56
|
function ownKeys$6(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; }
|
|
59
57
|
|
|
@@ -65,11 +63,11 @@ var ClearIndicator = function ClearIndicator(props) {
|
|
|
65
63
|
var getStyles = props.getStyles,
|
|
66
64
|
_props$innerProps = props.innerProps,
|
|
67
65
|
ref = _props$innerProps.ref,
|
|
68
|
-
restInnerProps = _objectWithoutProperties(_props$innerProps, _excluded
|
|
66
|
+
restInnerProps = _objectWithoutProperties(_props$innerProps, _excluded);
|
|
69
67
|
|
|
70
68
|
return jsxRuntime.jsx("button", _objectSpread$6(_objectSpread$6({}, restInnerProps), {}, {
|
|
71
69
|
ref: ref,
|
|
72
|
-
css: /*#__PURE__*/react.css("border:none;cursor:pointer;background:none;box-sizing:border-box;text-decoration:none;:hover svg *{fill:", designSystem.customProperties.colorWarning, ";}" + (process.env.NODE_ENV === "production" ? "" : ";label:ClearIndicator;"), process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,
|
|
70
|
+
css: /*#__PURE__*/react.css("border:none;cursor:pointer;background:none;box-sizing:border-box;text-decoration:none;:hover svg *{fill:", designSystem.customProperties.colorWarning, ";}" + (process.env.NODE_ENV === "production" ? "" : ";label:ClearIndicator;"), process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImNsZWFyLWluZGljYXRvci50c3giXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBMEJjIiwiZmlsZSI6ImNsZWFyLWluZGljYXRvci50c3giLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgdHlwZSB7IENTU1Byb3BlcnRpZXMsIExlZ2FjeVJlZiB9IGZyb20gJ3JlYWN0JztcbmltcG9ydCB0eXBlIHsgQ2xlYXJJbmRpY2F0b3JQcm9wcyB9IGZyb20gJ3JlYWN0LXNlbGVjdCc7XG5pbXBvcnQgeyBjc3MgfSBmcm9tICdAZW1vdGlvbi9yZWFjdCc7XG5pbXBvcnQgeyB1c2VJbnRsIH0gZnJvbSAncmVhY3QtaW50bCc7XG5pbXBvcnQgeyBjdXN0b21Qcm9wZXJ0aWVzIGFzIHZhcnMgfSBmcm9tICdAY29tbWVyY2V0b29scy11aWtpdC9kZXNpZ24tc3lzdGVtJztcbmltcG9ydCB7IENsb3NlSWNvbiB9IGZyb20gJ0Bjb21tZXJjZXRvb2xzLXVpa2l0L2ljb25zJztcbmltcG9ydCBtZXNzYWdlcyBmcm9tICcuL21lc3NhZ2VzJztcblxudHlwZSBUSW5uZXJQcm9wcyA9IHtcbiAgcmVmOiBMZWdhY3lSZWY8SFRNTEJ1dHRvbkVsZW1lbnQ+O1xufSAmIEpTWC5JbnRyaW5zaWNFbGVtZW50c1snYnV0dG9uJ107XG5cbnR5cGUgVENsZWFySW5kaWNhdG9yID0ge1xuICBpbm5lclByb3BzOiBUSW5uZXJQcm9wcztcbn0gJiBDbGVhckluZGljYXRvclByb3BzO1xuXG5jb25zdCBDbGVhckluZGljYXRvciA9IChwcm9wczogVENsZWFySW5kaWNhdG9yKSA9PiB7XG4gIGNvbnN0IGludGwgPSB1c2VJbnRsKCk7XG4gIGNvbnN0IHtcbiAgICBnZXRTdHlsZXMsXG4gICAgaW5uZXJQcm9wczogeyByZWYsIC4uLnJlc3RJbm5lclByb3BzIH0sXG4gIH0gPSBwcm9wcztcbiAgcmV0dXJuIChcbiAgICA8YnV0dG9uXG4gICAgICB7Li4ucmVzdElubmVyUHJvcHN9XG4gICAgICByZWY9e3JlZn1cbiAgICAgIGNzcz17Y3NzYFxuICAgICAgICBib3JkZXI6IG5vbmU7XG4gICAgICAgIGN1cnNvcjogcG9pbnRlcjtcbiAgICAgICAgYmFja2dyb3VuZDogbm9uZTtcbiAgICAgICAgYm94LXNpemluZzogYm9yZGVyLWJveDtcbiAgICAgICAgdGV4dC1kZWNvcmF0aW9uOiBub25lO1xuICAgICAgICA6aG92ZXIgc3ZnICoge1xuICAgICAgICAgIGZpbGw6ICR7dmFycy5jb2xvcldhcm5pbmd9O1xuICAgICAgICB9XG4gICAgICBgfVxuICAgICAgc3R5bGU9e2dldFN0eWxlcygnY2xlYXJJbmRpY2F0b3InLCBwcm9wcykgYXMgQ1NTUHJvcGVydGllc31cbiAgICAgIHRpdGxlPXtpbnRsLmZvcm1hdE1lc3NhZ2UobWVzc2FnZXMuY2xlYXJCdXR0b25MYWJlbCl9XG4gICAgICBhcmlhLWxhYmVsPXtpbnRsLmZvcm1hdE1lc3NhZ2UobWVzc2FnZXMuY2xlYXJCdXR0b25MYWJlbCl9XG4gICAgPlxuICAgICAgPENsb3NlSWNvbiBjb2xvcj1cInNvbGlkXCIgc2l6ZT1cIm1lZGl1bVwiIC8+XG4gICAgPC9idXR0b24+XG4gICk7XG59O1xuXG5DbGVhckluZGljYXRvci5kaXNwbGF5TmFtZSA9ICdDbGVhckluZGljYXRvcic7XG5cbmV4cG9ydCBkZWZhdWx0IENsZWFySW5kaWNhdG9yO1xuIl19 */"),
|
|
73
71
|
style: getStyles('clearIndicator', props),
|
|
74
72
|
title: intl.formatMessage(messages$1.clearButtonLabel),
|
|
75
73
|
"aria-label": intl.formatMessage(messages$1.clearButtonLabel),
|
|
@@ -81,15 +79,12 @@ var ClearIndicator = function ClearIndicator(props) {
|
|
|
81
79
|
};
|
|
82
80
|
|
|
83
81
|
ClearIndicator.displayName = 'ClearIndicator';
|
|
84
|
-
ClearIndicator.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
85
|
-
innerProps: PropTypes__default["default"].object,
|
|
86
|
-
getStyles: PropTypes__default["default"].func.isRequired
|
|
87
|
-
} : {};
|
|
88
82
|
var ClearIndicator$1 = ClearIndicator;
|
|
89
83
|
|
|
90
84
|
function ownKeys$5(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; }
|
|
91
85
|
|
|
92
86
|
function _objectSpread$5(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { var _context; _forEachInstanceProperty__default["default"](_context = ownKeys$5(Object(source), true)).call(_context, 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 _context2; _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; }
|
|
87
|
+
// see https://github.com/JedWatson/react-select/blob/44e9fb29b230e49a754a2f0d6f30c2250aa45009/src/components/MultiValue.js
|
|
93
88
|
var removeProps = ['onClick', 'onTouchEnd', 'onMouseDown'];
|
|
94
89
|
|
|
95
90
|
var TagRemove = function TagRemove(props) {
|
|
@@ -108,13 +103,6 @@ var TagRemove = function TagRemove(props) {
|
|
|
108
103
|
};
|
|
109
104
|
|
|
110
105
|
TagRemove.displayName = 'TagRemove';
|
|
111
|
-
TagRemove.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
112
|
-
selectProps: PropTypes__default["default"].shape({
|
|
113
|
-
isDisabled: PropTypes__default["default"].bool.isRequired,
|
|
114
|
-
isReadOnly: PropTypes__default["default"].bool
|
|
115
|
-
}).isRequired,
|
|
116
|
-
innerProps: PropTypes__default["default"].object
|
|
117
|
-
} : {};
|
|
118
106
|
var TagRemove$1 = TagRemove;
|
|
119
107
|
|
|
120
108
|
function ownKeys$4(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; }
|
|
@@ -131,9 +119,6 @@ var DropdownIndicator = function DropdownIndicator(props) {
|
|
|
131
119
|
};
|
|
132
120
|
|
|
133
121
|
DropdownIndicator.displayName = 'DropdownIndicator';
|
|
134
|
-
DropdownIndicator.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
135
|
-
isDisabled: PropTypes__default["default"].bool
|
|
136
|
-
} : {};
|
|
137
122
|
var DropdownIndicator$1 = DropdownIndicator;
|
|
138
123
|
|
|
139
124
|
function ownKeys$3(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; }
|
|
@@ -152,8 +137,6 @@ var SearchIconDropdownIndicator = function SearchIconDropdownIndicator(props) {
|
|
|
152
137
|
SearchIconDropdownIndicator.displayName = 'SearchIconDropdownIndicator';
|
|
153
138
|
var SearchIconDropdownIndicator$1 = SearchIconDropdownIndicator;
|
|
154
139
|
|
|
155
|
-
var _excluded = ["children"];
|
|
156
|
-
|
|
157
140
|
function ownKeys$2(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; }
|
|
158
141
|
|
|
159
142
|
function _objectSpread$2(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { var _context; _forEachInstanceProperty__default["default"](_context = ownKeys$2(Object(source), true)).call(_context, 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 _context2; _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; }
|
|
@@ -164,10 +147,7 @@ var getDefaultComponent = function getDefaultComponent(type) {
|
|
|
164
147
|
return react$1.Fragment;
|
|
165
148
|
};
|
|
166
149
|
|
|
167
|
-
var WrapperWithIcon = function WrapperWithIcon(
|
|
168
|
-
var children = _ref.children,
|
|
169
|
-
props = _objectWithoutProperties(_ref, _excluded);
|
|
170
|
-
|
|
150
|
+
var WrapperWithIcon = function WrapperWithIcon(props) {
|
|
171
151
|
var Component = getDefaultComponent(props.type);
|
|
172
152
|
return jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
173
153
|
children: [props.selectProps.iconLeft && /*#__PURE__*/react$1.cloneElement(props.selectProps.iconLeft, {
|
|
@@ -176,20 +156,19 @@ var WrapperWithIcon = function WrapperWithIcon(_ref) {
|
|
|
176
156
|
// react-select uses absolute positioning for the SingleValue/Placeholder
|
|
177
157
|
// the icon has a fixed size of 24px (== SpacingsXl), therefore we can use a fixed margin
|
|
178
158
|
// spacingsXs is the margin between the icon and value
|
|
179
|
-
css: /*#__PURE__*/react.css("margin-left:", designSystem.customProperties.spacingXl + designSystem.customProperties.spacingXs, ";" + (process.env.NODE_ENV === "production" ? "" : ";label:WrapperWithIcon;"), process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,
|
|
159
|
+
css: /*#__PURE__*/react.css("margin-left:", designSystem.customProperties.spacingXl + designSystem.customProperties.spacingXs, ";" + (process.env.NODE_ENV === "production" ? "" : ";label:WrapperWithIcon;"), process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndyYXBwZXItd2l0aC1pY29uLnRzeCJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFzQ2dCIiwiZmlsZSI6IndyYXBwZXItd2l0aC1pY29uLnRzeCIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IEZyYWdtZW50LCBjbG9uZUVsZW1lbnQsIFJlYWN0RWxlbWVudCB9IGZyb20gJ3JlYWN0JztcbmltcG9ydCB7IGNzcyB9IGZyb20gJ0BlbW90aW9uL3JlYWN0JztcbmltcG9ydCB7IGN1c3RvbVByb3BlcnRpZXMgfSBmcm9tICdAY29tbWVyY2V0b29scy11aWtpdC9kZXNpZ24tc3lzdGVtJztcbmltcG9ydCB7XG4gIGNvbXBvbmVudHMgYXMgZGVmYXVsdENvbXBvbmVudHMsXG4gIFNpbmdsZVZhbHVlUHJvcHMsXG4gIFBsYWNlaG9sZGVyUHJvcHMsXG59IGZyb20gJ3JlYWN0LXNlbGVjdCc7XG5cbmV4cG9ydCB0eXBlIFRXcmFwcGVyV2l0aEljb25Qcm9wcyA9IHtcbiAgdHlwZTogc3RyaW5nO1xuICBzZWxlY3RQcm9wczogVFNlbGVjdFByb3BzO1xufSAmIFNpbmdsZVZhbHVlUHJvcHMgJlxuICBQbGFjZWhvbGRlclByb3BzO1xuXG5jb25zdCBnZXREZWZhdWx0Q29tcG9uZW50ID0gKHR5cGU6IFRXcmFwcGVyV2l0aEljb25Qcm9wc1sndHlwZSddKSA9PiB7XG4gIGlmICh0eXBlID09PSAnc2luZ2xlVmFsdWUnKSByZXR1cm4gZGVmYXVsdENvbXBvbmVudHMuU2luZ2xlVmFsdWU7XG4gIGlmICh0eXBlID09PSAncGxhY2Vob2xkZXInKSByZXR1cm4gZGVmYXVsdENvbXBvbmVudHMuUGxhY2Vob2xkZXI7XG4gIHJldHVybiBGcmFnbWVudDtcbn07XG5cbnR5cGUgVFNlbGVjdFByb3BzID0ge1xuICBpY29uTGVmdDogUmVhY3RFbGVtZW50O1xufTtcblxuY29uc3QgV3JhcHBlcldpdGhJY29uID0gKHByb3BzOiBUV3JhcHBlcldpdGhJY29uUHJvcHMpID0+IHtcbiAgY29uc3QgQ29tcG9uZW50ID0gZ2V0RGVmYXVsdENvbXBvbmVudChwcm9wcy50eXBlKTtcblxuICByZXR1cm4gKFxuICAgIDw+XG4gICAgICB7cHJvcHMuc2VsZWN0UHJvcHMuaWNvbkxlZnQgJiZcbiAgICAgICAgY2xvbmVFbGVtZW50KHByb3BzLnNlbGVjdFByb3BzLmljb25MZWZ0LCB7XG4gICAgICAgICAgc2l6ZTogJ2JpZycsXG4gICAgICAgIH0pfVxuICAgICAgPHNwYW5cbiAgICAgICAgLy8gcmVhY3Qtc2VsZWN0IHVzZXMgYWJzb2x1dGUgcG9zaXRpb25pbmcgZm9yIHRoZSBTaW5nbGVWYWx1ZS9QbGFjZWhvbGRlclxuICAgICAgICAvLyB0aGUgaWNvbiBoYXMgYSBmaXhlZCBzaXplIG9mIDI0cHggKD09IFNwYWNpbmdzWGwpLCB0aGVyZWZvcmUgd2UgY2FuIHVzZSBhIGZpeGVkIG1hcmdpblxuICAgICAgICAvLyBzcGFjaW5nc1hzIGlzIHRoZSBtYXJnaW4gYmV0d2VlbiB0aGUgaWNvbiBhbmQgdmFsdWVcbiAgICAgICAgY3NzPXtjc3NgXG4gICAgICAgICAgbWFyZ2luLWxlZnQ6ICR7Y3VzdG9tUHJvcGVydGllcy5zcGFjaW5nWGwgK1xuICAgICAgICAgIGN1c3RvbVByb3BlcnRpZXMuc3BhY2luZ1hzfTtcbiAgICAgICAgYH1cbiAgICAgID5cbiAgICAgICAgPENvbXBvbmVudCB7Li4ucHJvcHN9Pntwcm9wcy5jaGlsZHJlbn08L0NvbXBvbmVudD5cbiAgICAgIDwvc3Bhbj5cbiAgICA8Lz5cbiAgKTtcbn07XG5cbldyYXBwZXJXaXRoSWNvbi5kaXNwbGF5TmFtZSA9ICdXcmFwcGVyV2l0aEljb24nO1xuXG5leHBvcnQgZGVmYXVsdCBXcmFwcGVyV2l0aEljb247XG5cbi8qIGVzbGludC1kaXNhYmxlIHJlYWN0L2Rpc3BsYXktbmFtZSAqL1xuY29uc3QgY3VzdG9tQ29tcG9uZW50cyA9IHtcbiAgU2luZ2xlVmFsdWU6IChwcm9wczogVFdyYXBwZXJXaXRoSWNvblByb3BzKSA9PiAoXG4gICAgPFdyYXBwZXJXaXRoSWNvbiB7Li4ucHJvcHN9IHR5cGU9XCJzaW5nbGVWYWx1ZVwiIC8+XG4gICksXG4gIFBsYWNlaG9sZGVyOiAocHJvcHM6IFRXcmFwcGVyV2l0aEljb25Qcm9wcykgPT4gKFxuICAgIDxXcmFwcGVyV2l0aEljb24gey4uLnByb3BzfSB0eXBlPVwicGxhY2Vob2xkZXJcIiAvPlxuICApLFxufTtcbi8qIGVzbGludC1lbmFibGUgcmVhY3QvZGlzcGxheS1uYW1lICovXG5cbmV4cG9ydCB7IGN1c3RvbUNvbXBvbmVudHMgfTtcbiJdfQ== */"),
|
|
180
160
|
children: jsxRuntime.jsx(Component, _objectSpread$2(_objectSpread$2({}, props), {}, {
|
|
181
|
-
children: children
|
|
161
|
+
children: props.children
|
|
182
162
|
}))
|
|
183
163
|
})]
|
|
184
164
|
});
|
|
185
165
|
};
|
|
186
166
|
|
|
187
167
|
WrapperWithIcon.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
})
|
|
168
|
+
type: _pt__default["default"].string.isRequired,
|
|
169
|
+
selectProps: _pt__default["default"].shape({
|
|
170
|
+
iconLeft: _pt__default["default"].element.isRequired
|
|
171
|
+
}).isRequired
|
|
193
172
|
} : {};
|
|
194
173
|
WrapperWithIcon.displayName = 'WrapperWithIcon';
|
|
195
174
|
var WrapperWithIcon$1 = WrapperWithIcon;
|
|
@@ -226,24 +205,16 @@ var MultiplePropertiesSelectInputOption = function MultiplePropertiesSelectInput
|
|
|
226
205
|
scale: "xs",
|
|
227
206
|
children: [jsxRuntime.jsx(Text__default["default"].Detail, {
|
|
228
207
|
isBold: true,
|
|
229
|
-
children: data.label || noValueFallback
|
|
208
|
+
children: (data === null || data === void 0 ? void 0 : data.label) || noValueFallback
|
|
230
209
|
}), jsxRuntime.jsxs(Text__default["default"].Detail, {
|
|
231
|
-
children: ["Key: ", data.key || noValueFallback]
|
|
210
|
+
children: ["Key: ", (data === null || data === void 0 ? void 0 : data.key) || noValueFallback]
|
|
232
211
|
}), jsxRuntime.jsxs(Text__default["default"].Detail, {
|
|
233
|
-
children: ["ID: ", data.id || noValueFallback]
|
|
212
|
+
children: ["ID: ", (data === null || data === void 0 ? void 0 : data.id) || noValueFallback]
|
|
234
213
|
})]
|
|
235
214
|
})
|
|
236
215
|
}));
|
|
237
216
|
};
|
|
238
217
|
MultiplePropertiesSelectInputOption.displayName = 'MultiplePropertiesSelectInputOption';
|
|
239
|
-
MultiplePropertiesSelectInputOption.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
240
|
-
data: PropTypes__default["default"].shape({
|
|
241
|
-
label: PropTypes__default["default"].string,
|
|
242
|
-
key: PropTypes__default["default"].oneOfType([PropTypes__default["default"].string, PropTypes__default["default"].number]),
|
|
243
|
-
id: PropTypes__default["default"].oneOfType([PropTypes__default["default"].string, PropTypes__default["default"].number])
|
|
244
|
-
}),
|
|
245
|
-
noValueFallback: PropTypes__default["default"].string
|
|
246
|
-
} : {};
|
|
247
218
|
var DoublePropertySelectInputOption = function DoublePropertySelectInputOption(props) {
|
|
248
219
|
var data = props.data;
|
|
249
220
|
var noValueFallback = props.noValueFallback || NO_VALUE_FALLBACK;
|
|
@@ -252,22 +223,17 @@ var DoublePropertySelectInputOption = function DoublePropertySelectInputOption(p
|
|
|
252
223
|
scale: "xs",
|
|
253
224
|
children: [jsxRuntime.jsx(Text__default["default"].Detail, {
|
|
254
225
|
isBold: true,
|
|
255
|
-
children: data.label || noValueFallback
|
|
226
|
+
children: (data === null || data === void 0 ? void 0 : data.label) || noValueFallback
|
|
256
227
|
}), jsxRuntime.jsxs(Text__default["default"].Detail, {
|
|
257
|
-
children: ["Key: ", data.key || noValueFallback]
|
|
228
|
+
children: ["Key: ", (data === null || data === void 0 ? void 0 : data.key) || noValueFallback]
|
|
258
229
|
})]
|
|
259
230
|
})
|
|
260
231
|
}));
|
|
261
232
|
};
|
|
262
233
|
DoublePropertySelectInputOption.displayName = 'DoublePropertySelectInputOption';
|
|
263
|
-
DoublePropertySelectInputOption.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
264
|
-
data: PropTypes__default["default"].shape({
|
|
265
|
-
label: PropTypes__default["default"].string,
|
|
266
|
-
key: PropTypes__default["default"].string
|
|
267
|
-
}),
|
|
268
|
-
noValueFallback: PropTypes__default["default"].string
|
|
269
|
-
} : {};
|
|
270
234
|
var CustomSelectInputOption = function CustomSelectInputOption(props) {
|
|
235
|
+
var _props$optionInnerPro;
|
|
236
|
+
|
|
271
237
|
var noValueFallback = props.noValueFallback || NO_VALUE_FALLBACK;
|
|
272
238
|
|
|
273
239
|
switch (props.optionType) {
|
|
@@ -284,23 +250,12 @@ var CustomSelectInputOption = function CustomSelectInputOption(props) {
|
|
|
284
250
|
default:
|
|
285
251
|
return jsxRuntime.jsx(reactSelect.components.Option, _objectSpread$1(_objectSpread$1({}, props.optionInnerProps), {}, {
|
|
286
252
|
children: jsxRuntime.jsx(Text__default["default"].Detail, {
|
|
287
|
-
children: props.optionInnerProps.data.label || noValueFallback
|
|
253
|
+
children: ((_props$optionInnerPro = props.optionInnerProps.data) === null || _props$optionInnerPro === void 0 ? void 0 : _props$optionInnerPro.label) || noValueFallback
|
|
288
254
|
})
|
|
289
255
|
}));
|
|
290
256
|
}
|
|
291
257
|
};
|
|
292
258
|
CustomSelectInputOption.displayName = 'CustomSelectInputOption';
|
|
293
|
-
CustomSelectInputOption.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
294
|
-
optionType: PropTypes__default["default"].oneOf(_Object$values__default["default"](SELECT_DROPDOWN_OPTION_TYPES)),
|
|
295
|
-
noValueFallback: PropTypes__default["default"].string,
|
|
296
|
-
optionInnerProps: PropTypes__default["default"].shape({
|
|
297
|
-
data: PropTypes__default["default"].shape({
|
|
298
|
-
label: PropTypes__default["default"].string,
|
|
299
|
-
key: PropTypes__default["default"].string,
|
|
300
|
-
id: PropTypes__default["default"].string
|
|
301
|
-
})
|
|
302
|
-
}).isRequired
|
|
303
|
-
} : {};
|
|
304
259
|
|
|
305
260
|
var messages = reactIntl.defineMessages({
|
|
306
261
|
createLabel: {
|
|
@@ -405,7 +360,7 @@ var menuStyles = function menuStyles(props, theme) {
|
|
|
405
360
|
};
|
|
406
361
|
};
|
|
407
362
|
|
|
408
|
-
var indicatorSeparatorStyles = function indicatorSeparatorStyles(
|
|
363
|
+
var indicatorSeparatorStyles = function indicatorSeparatorStyles(theme) {
|
|
409
364
|
return function (base) {
|
|
410
365
|
var overwrittenVars = _objectSpread(_objectSpread({}, designSystem.customProperties), theme);
|
|
411
366
|
|
|
@@ -441,7 +396,7 @@ var clearIndicatorStyles = function clearIndicatorStyles() {
|
|
|
441
396
|
};
|
|
442
397
|
};
|
|
443
398
|
|
|
444
|
-
var menuListStyles = function menuListStyles(
|
|
399
|
+
var menuListStyles = function menuListStyles(theme) {
|
|
445
400
|
return function (base) {
|
|
446
401
|
var overwrittenVars = _objectSpread(_objectSpread({}, designSystem.customProperties), theme);
|
|
447
402
|
|
|
@@ -453,7 +408,7 @@ var menuListStyles = function menuListStyles(props, theme) {
|
|
|
453
408
|
};
|
|
454
409
|
};
|
|
455
410
|
|
|
456
|
-
var optionStyles = function optionStyles(
|
|
411
|
+
var optionStyles = function optionStyles(theme) {
|
|
457
412
|
return function (base, state) {
|
|
458
413
|
var _context2, _context3;
|
|
459
414
|
|
|
@@ -507,6 +462,10 @@ var valueContainerStyles = function valueContainerStyles(props, theme) {
|
|
|
507
462
|
padding: '0',
|
|
508
463
|
backgroundColor: 'none',
|
|
509
464
|
overflow: 'hidden',
|
|
465
|
+
// Display property should be grid when isMulti and has no value so the Placeholder component is positioned correctly with the Input
|
|
466
|
+
// Display property should be Flex when there is an iconLeft, also when the input has some values when isMulti.
|
|
467
|
+
// See PR from react select for more insight https://github.com/JedWatson/react-select/pull/4833
|
|
468
|
+
display: props.iconLeft && !props.isMulti || props.isMulti && props.hasValue ? 'flex' : 'grid',
|
|
510
469
|
fill: props.isDisabled || props.isReadOnly ? overwrittenVars[designSystem.designTokens.fontColorForInputWhenDisabled] : base.fontColorForInput
|
|
511
470
|
});
|
|
512
471
|
};
|
|
@@ -545,7 +504,7 @@ var groupStyles = function groupStyles(props, theme) {
|
|
|
545
504
|
};
|
|
546
505
|
};
|
|
547
506
|
|
|
548
|
-
var groupHeadingStyles = function groupHeadingStyles(
|
|
507
|
+
var groupHeadingStyles = function groupHeadingStyles(theme) {
|
|
549
508
|
return function (base) {
|
|
550
509
|
var _context4;
|
|
551
510
|
|
|
@@ -565,7 +524,7 @@ var groupHeadingStyles = function groupHeadingStyles(props, theme) {
|
|
|
565
524
|
};
|
|
566
525
|
};
|
|
567
526
|
|
|
568
|
-
var containerStyles = function containerStyles(
|
|
527
|
+
var containerStyles = function containerStyles(theme) {
|
|
569
528
|
return function (base, state) {
|
|
570
529
|
var overwrittenVars = _objectSpread(_objectSpread({}, designSystem.customProperties), theme);
|
|
571
530
|
|
|
@@ -597,7 +556,7 @@ var menuPortalStyles = function menuPortalStyles(props) {
|
|
|
597
556
|
};
|
|
598
557
|
};
|
|
599
558
|
|
|
600
|
-
var multiValueStyles = function multiValueStyles(
|
|
559
|
+
var multiValueStyles = function multiValueStyles(theme) {
|
|
601
560
|
return function (base) {
|
|
602
561
|
var overwrittenVars = _objectSpread(_objectSpread({}, designSystem.customProperties), theme);
|
|
603
562
|
|
|
@@ -666,27 +625,27 @@ function createSelectStyles(props, theme) {
|
|
|
666
625
|
return {
|
|
667
626
|
control: controlStyles(props, theme),
|
|
668
627
|
menu: menuStyles(props, theme),
|
|
669
|
-
indicatorSeparator: indicatorSeparatorStyles(
|
|
628
|
+
indicatorSeparator: indicatorSeparatorStyles(theme),
|
|
670
629
|
dropdownIndicator: dropdownIndicatorStyles(props, theme),
|
|
671
|
-
clearIndicator: clearIndicatorStyles(
|
|
672
|
-
menuList: menuListStyles(
|
|
673
|
-
menuPortal: menuPortalStyles(props
|
|
674
|
-
multiValue: multiValueStyles(
|
|
630
|
+
clearIndicator: clearIndicatorStyles(),
|
|
631
|
+
menuList: menuListStyles(theme),
|
|
632
|
+
menuPortal: menuPortalStyles(props),
|
|
633
|
+
multiValue: multiValueStyles(theme),
|
|
675
634
|
multiValueLabel: multiValueLabelStyles(props, theme),
|
|
676
635
|
multiValueRemove: multiValueRemoveStyles(props, theme),
|
|
677
|
-
indicatorsContainer: indicatorsContainerStyles(
|
|
678
|
-
option: optionStyles(
|
|
636
|
+
indicatorsContainer: indicatorsContainerStyles(),
|
|
637
|
+
option: optionStyles(theme),
|
|
679
638
|
placeholder: placeholderStyles(props, theme),
|
|
680
639
|
valueContainer: valueContainerStyles(props, theme),
|
|
681
640
|
singleValue: singleValueStyles(props, theme),
|
|
682
641
|
group: groupStyles(props, theme),
|
|
683
|
-
groupHeading: groupHeadingStyles(
|
|
684
|
-
container: containerStyles(
|
|
642
|
+
groupHeading: groupHeadingStyles(theme),
|
|
643
|
+
container: containerStyles(theme)
|
|
685
644
|
};
|
|
686
645
|
}
|
|
687
646
|
|
|
688
|
-
// NOTE: This string will be replaced
|
|
689
|
-
var version =
|
|
647
|
+
// NOTE: This string will be replaced on build time with the package version.
|
|
648
|
+
var version = "12.2.9";
|
|
690
649
|
|
|
691
650
|
exports.ClearIndicator = ClearIndicator$1;
|
|
692
651
|
exports.CustomSelectInputOption = CustomSelectInputOption;
|
|
@@ -15,15 +15,14 @@ var _defineProperty = require('@babel/runtime-corejs3/helpers/defineProperty');
|
|
|
15
15
|
var _concatInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/concat');
|
|
16
16
|
var designSystem = require('@commercetools-uikit/design-system');
|
|
17
17
|
var _objectWithoutProperties = require('@babel/runtime-corejs3/helpers/objectWithoutProperties');
|
|
18
|
-
require('prop-types');
|
|
19
18
|
var react = require('@emotion/react');
|
|
20
19
|
var icons = require('@commercetools-uikit/icons');
|
|
21
20
|
var jsxRuntime = require('@emotion/react/jsx-runtime');
|
|
22
21
|
var omit = require('lodash/omit');
|
|
23
22
|
var AccessibleButton = require('@commercetools-uikit/accessible-button');
|
|
24
23
|
var reactSelect = require('react-select');
|
|
24
|
+
require('prop-types');
|
|
25
25
|
var react$1 = require('react');
|
|
26
|
-
require('@babel/runtime-corejs3/core-js-stable/object/values');
|
|
27
26
|
var Spacings = require('@commercetools-uikit/spacings');
|
|
28
27
|
var Text = require('@commercetools-uikit/text');
|
|
29
28
|
|
|
@@ -51,7 +50,7 @@ var messages$1 = reactIntl.defineMessages({
|
|
|
51
50
|
}
|
|
52
51
|
});
|
|
53
52
|
|
|
54
|
-
var _excluded
|
|
53
|
+
var _excluded = ["ref"];
|
|
55
54
|
|
|
56
55
|
function ownKeys$6(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; }
|
|
57
56
|
|
|
@@ -63,7 +62,7 @@ var ClearIndicator = function ClearIndicator(props) {
|
|
|
63
62
|
var getStyles = props.getStyles,
|
|
64
63
|
_props$innerProps = props.innerProps,
|
|
65
64
|
ref = _props$innerProps.ref,
|
|
66
|
-
restInnerProps = _objectWithoutProperties(_props$innerProps, _excluded
|
|
65
|
+
restInnerProps = _objectWithoutProperties(_props$innerProps, _excluded);
|
|
67
66
|
|
|
68
67
|
return jsxRuntime.jsx("button", _objectSpread$6(_objectSpread$6({}, restInnerProps), {}, {
|
|
69
68
|
ref: ref,
|
|
@@ -79,12 +78,12 @@ var ClearIndicator = function ClearIndicator(props) {
|
|
|
79
78
|
};
|
|
80
79
|
|
|
81
80
|
ClearIndicator.displayName = 'ClearIndicator';
|
|
82
|
-
ClearIndicator.propTypes = {};
|
|
83
81
|
var ClearIndicator$1 = ClearIndicator;
|
|
84
82
|
|
|
85
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); 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; }
|
|
86
84
|
|
|
87
85
|
function _objectSpread$5(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { var _context; _forEachInstanceProperty__default["default"](_context = ownKeys$5(Object(source), true)).call(_context, 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 _context2; _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; }
|
|
86
|
+
// see https://github.com/JedWatson/react-select/blob/44e9fb29b230e49a754a2f0d6f30c2250aa45009/src/components/MultiValue.js
|
|
88
87
|
var removeProps = ['onClick', 'onTouchEnd', 'onMouseDown'];
|
|
89
88
|
|
|
90
89
|
var TagRemove = function TagRemove(props) {
|
|
@@ -103,7 +102,6 @@ var TagRemove = function TagRemove(props) {
|
|
|
103
102
|
};
|
|
104
103
|
|
|
105
104
|
TagRemove.displayName = 'TagRemove';
|
|
106
|
-
TagRemove.propTypes = {};
|
|
107
105
|
var TagRemove$1 = TagRemove;
|
|
108
106
|
|
|
109
107
|
function ownKeys$4(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; }
|
|
@@ -120,7 +118,6 @@ var DropdownIndicator = function DropdownIndicator(props) {
|
|
|
120
118
|
};
|
|
121
119
|
|
|
122
120
|
DropdownIndicator.displayName = 'DropdownIndicator';
|
|
123
|
-
DropdownIndicator.propTypes = {};
|
|
124
121
|
var DropdownIndicator$1 = DropdownIndicator;
|
|
125
122
|
|
|
126
123
|
function ownKeys$3(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; }
|
|
@@ -139,8 +136,6 @@ var SearchIconDropdownIndicator = function SearchIconDropdownIndicator(props) {
|
|
|
139
136
|
SearchIconDropdownIndicator.displayName = 'SearchIconDropdownIndicator';
|
|
140
137
|
var SearchIconDropdownIndicator$1 = SearchIconDropdownIndicator;
|
|
141
138
|
|
|
142
|
-
var _excluded = ["children"];
|
|
143
|
-
|
|
144
139
|
function ownKeys$2(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; }
|
|
145
140
|
|
|
146
141
|
function _objectSpread$2(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { var _context; _forEachInstanceProperty__default["default"](_context = ownKeys$2(Object(source), true)).call(_context, 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 _context2; _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; }
|
|
@@ -151,10 +146,7 @@ var getDefaultComponent = function getDefaultComponent(type) {
|
|
|
151
146
|
return react$1.Fragment;
|
|
152
147
|
};
|
|
153
148
|
|
|
154
|
-
var WrapperWithIcon = function WrapperWithIcon(
|
|
155
|
-
var children = _ref.children,
|
|
156
|
-
props = _objectWithoutProperties(_ref, _excluded);
|
|
157
|
-
|
|
149
|
+
var WrapperWithIcon = function WrapperWithIcon(props) {
|
|
158
150
|
var Component = getDefaultComponent(props.type);
|
|
159
151
|
return jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
160
152
|
children: [props.selectProps.iconLeft && /*#__PURE__*/react$1.cloneElement(props.selectProps.iconLeft, {
|
|
@@ -165,7 +157,7 @@ var WrapperWithIcon = function WrapperWithIcon(_ref) {
|
|
|
165
157
|
// spacingsXs is the margin between the icon and value
|
|
166
158
|
css: /*#__PURE__*/react.css("margin-left:", designSystem.customProperties.spacingXl + designSystem.customProperties.spacingXs, ";" + ("" ), "" ),
|
|
167
159
|
children: jsxRuntime.jsx(Component, _objectSpread$2(_objectSpread$2({}, props), {}, {
|
|
168
|
-
children: children
|
|
160
|
+
children: props.children
|
|
169
161
|
}))
|
|
170
162
|
})]
|
|
171
163
|
});
|
|
@@ -207,17 +199,16 @@ var MultiplePropertiesSelectInputOption = function MultiplePropertiesSelectInput
|
|
|
207
199
|
scale: "xs",
|
|
208
200
|
children: [jsxRuntime.jsx(Text__default["default"].Detail, {
|
|
209
201
|
isBold: true,
|
|
210
|
-
children: data.label || noValueFallback
|
|
202
|
+
children: (data === null || data === void 0 ? void 0 : data.label) || noValueFallback
|
|
211
203
|
}), jsxRuntime.jsxs(Text__default["default"].Detail, {
|
|
212
|
-
children: ["Key: ", data.key || noValueFallback]
|
|
204
|
+
children: ["Key: ", (data === null || data === void 0 ? void 0 : data.key) || noValueFallback]
|
|
213
205
|
}), jsxRuntime.jsxs(Text__default["default"].Detail, {
|
|
214
|
-
children: ["ID: ", data.id || noValueFallback]
|
|
206
|
+
children: ["ID: ", (data === null || data === void 0 ? void 0 : data.id) || noValueFallback]
|
|
215
207
|
})]
|
|
216
208
|
})
|
|
217
209
|
}));
|
|
218
210
|
};
|
|
219
211
|
MultiplePropertiesSelectInputOption.displayName = 'MultiplePropertiesSelectInputOption';
|
|
220
|
-
MultiplePropertiesSelectInputOption.propTypes = {};
|
|
221
212
|
var DoublePropertySelectInputOption = function DoublePropertySelectInputOption(props) {
|
|
222
213
|
var data = props.data;
|
|
223
214
|
var noValueFallback = props.noValueFallback || NO_VALUE_FALLBACK;
|
|
@@ -226,16 +217,17 @@ var DoublePropertySelectInputOption = function DoublePropertySelectInputOption(p
|
|
|
226
217
|
scale: "xs",
|
|
227
218
|
children: [jsxRuntime.jsx(Text__default["default"].Detail, {
|
|
228
219
|
isBold: true,
|
|
229
|
-
children: data.label || noValueFallback
|
|
220
|
+
children: (data === null || data === void 0 ? void 0 : data.label) || noValueFallback
|
|
230
221
|
}), jsxRuntime.jsxs(Text__default["default"].Detail, {
|
|
231
|
-
children: ["Key: ", data.key || noValueFallback]
|
|
222
|
+
children: ["Key: ", (data === null || data === void 0 ? void 0 : data.key) || noValueFallback]
|
|
232
223
|
})]
|
|
233
224
|
})
|
|
234
225
|
}));
|
|
235
226
|
};
|
|
236
227
|
DoublePropertySelectInputOption.displayName = 'DoublePropertySelectInputOption';
|
|
237
|
-
DoublePropertySelectInputOption.propTypes = {};
|
|
238
228
|
var CustomSelectInputOption = function CustomSelectInputOption(props) {
|
|
229
|
+
var _props$optionInnerPro;
|
|
230
|
+
|
|
239
231
|
var noValueFallback = props.noValueFallback || NO_VALUE_FALLBACK;
|
|
240
232
|
|
|
241
233
|
switch (props.optionType) {
|
|
@@ -252,13 +244,12 @@ var CustomSelectInputOption = function CustomSelectInputOption(props) {
|
|
|
252
244
|
default:
|
|
253
245
|
return jsxRuntime.jsx(reactSelect.components.Option, _objectSpread$1(_objectSpread$1({}, props.optionInnerProps), {}, {
|
|
254
246
|
children: jsxRuntime.jsx(Text__default["default"].Detail, {
|
|
255
|
-
children: props.optionInnerProps.data.label || noValueFallback
|
|
247
|
+
children: ((_props$optionInnerPro = props.optionInnerProps.data) === null || _props$optionInnerPro === void 0 ? void 0 : _props$optionInnerPro.label) || noValueFallback
|
|
256
248
|
})
|
|
257
249
|
}));
|
|
258
250
|
}
|
|
259
251
|
};
|
|
260
252
|
CustomSelectInputOption.displayName = 'CustomSelectInputOption';
|
|
261
|
-
CustomSelectInputOption.propTypes = {};
|
|
262
253
|
|
|
263
254
|
var messages = reactIntl.defineMessages({
|
|
264
255
|
createLabel: {
|
|
@@ -363,7 +354,7 @@ var menuStyles = function menuStyles(props, theme) {
|
|
|
363
354
|
};
|
|
364
355
|
};
|
|
365
356
|
|
|
366
|
-
var indicatorSeparatorStyles = function indicatorSeparatorStyles(
|
|
357
|
+
var indicatorSeparatorStyles = function indicatorSeparatorStyles(theme) {
|
|
367
358
|
return function (base) {
|
|
368
359
|
var overwrittenVars = _objectSpread(_objectSpread({}, designSystem.customProperties), theme);
|
|
369
360
|
|
|
@@ -399,7 +390,7 @@ var clearIndicatorStyles = function clearIndicatorStyles() {
|
|
|
399
390
|
};
|
|
400
391
|
};
|
|
401
392
|
|
|
402
|
-
var menuListStyles = function menuListStyles(
|
|
393
|
+
var menuListStyles = function menuListStyles(theme) {
|
|
403
394
|
return function (base) {
|
|
404
395
|
var overwrittenVars = _objectSpread(_objectSpread({}, designSystem.customProperties), theme);
|
|
405
396
|
|
|
@@ -411,7 +402,7 @@ var menuListStyles = function menuListStyles(props, theme) {
|
|
|
411
402
|
};
|
|
412
403
|
};
|
|
413
404
|
|
|
414
|
-
var optionStyles = function optionStyles(
|
|
405
|
+
var optionStyles = function optionStyles(theme) {
|
|
415
406
|
return function (base, state) {
|
|
416
407
|
var _context2, _context3;
|
|
417
408
|
|
|
@@ -465,6 +456,10 @@ var valueContainerStyles = function valueContainerStyles(props, theme) {
|
|
|
465
456
|
padding: '0',
|
|
466
457
|
backgroundColor: 'none',
|
|
467
458
|
overflow: 'hidden',
|
|
459
|
+
// Display property should be grid when isMulti and has no value so the Placeholder component is positioned correctly with the Input
|
|
460
|
+
// Display property should be Flex when there is an iconLeft, also when the input has some values when isMulti.
|
|
461
|
+
// See PR from react select for more insight https://github.com/JedWatson/react-select/pull/4833
|
|
462
|
+
display: props.iconLeft && !props.isMulti || props.isMulti && props.hasValue ? 'flex' : 'grid',
|
|
468
463
|
fill: props.isDisabled || props.isReadOnly ? overwrittenVars[designSystem.designTokens.fontColorForInputWhenDisabled] : base.fontColorForInput
|
|
469
464
|
});
|
|
470
465
|
};
|
|
@@ -503,7 +498,7 @@ var groupStyles = function groupStyles(props, theme) {
|
|
|
503
498
|
};
|
|
504
499
|
};
|
|
505
500
|
|
|
506
|
-
var groupHeadingStyles = function groupHeadingStyles(
|
|
501
|
+
var groupHeadingStyles = function groupHeadingStyles(theme) {
|
|
507
502
|
return function (base) {
|
|
508
503
|
var _context4;
|
|
509
504
|
|
|
@@ -523,7 +518,7 @@ var groupHeadingStyles = function groupHeadingStyles(props, theme) {
|
|
|
523
518
|
};
|
|
524
519
|
};
|
|
525
520
|
|
|
526
|
-
var containerStyles = function containerStyles(
|
|
521
|
+
var containerStyles = function containerStyles(theme) {
|
|
527
522
|
return function (base, state) {
|
|
528
523
|
var overwrittenVars = _objectSpread(_objectSpread({}, designSystem.customProperties), theme);
|
|
529
524
|
|
|
@@ -555,7 +550,7 @@ var menuPortalStyles = function menuPortalStyles(props) {
|
|
|
555
550
|
};
|
|
556
551
|
};
|
|
557
552
|
|
|
558
|
-
var multiValueStyles = function multiValueStyles(
|
|
553
|
+
var multiValueStyles = function multiValueStyles(theme) {
|
|
559
554
|
return function (base) {
|
|
560
555
|
var overwrittenVars = _objectSpread(_objectSpread({}, designSystem.customProperties), theme);
|
|
561
556
|
|
|
@@ -624,27 +619,27 @@ function createSelectStyles(props, theme) {
|
|
|
624
619
|
return {
|
|
625
620
|
control: controlStyles(props, theme),
|
|
626
621
|
menu: menuStyles(props, theme),
|
|
627
|
-
indicatorSeparator: indicatorSeparatorStyles(
|
|
622
|
+
indicatorSeparator: indicatorSeparatorStyles(theme),
|
|
628
623
|
dropdownIndicator: dropdownIndicatorStyles(props, theme),
|
|
629
|
-
clearIndicator: clearIndicatorStyles(
|
|
630
|
-
menuList: menuListStyles(
|
|
631
|
-
menuPortal: menuPortalStyles(props
|
|
632
|
-
multiValue: multiValueStyles(
|
|
624
|
+
clearIndicator: clearIndicatorStyles(),
|
|
625
|
+
menuList: menuListStyles(theme),
|
|
626
|
+
menuPortal: menuPortalStyles(props),
|
|
627
|
+
multiValue: multiValueStyles(theme),
|
|
633
628
|
multiValueLabel: multiValueLabelStyles(props, theme),
|
|
634
629
|
multiValueRemove: multiValueRemoveStyles(props, theme),
|
|
635
|
-
indicatorsContainer: indicatorsContainerStyles(
|
|
636
|
-
option: optionStyles(
|
|
630
|
+
indicatorsContainer: indicatorsContainerStyles(),
|
|
631
|
+
option: optionStyles(theme),
|
|
637
632
|
placeholder: placeholderStyles(props, theme),
|
|
638
633
|
valueContainer: valueContainerStyles(props, theme),
|
|
639
634
|
singleValue: singleValueStyles(props, theme),
|
|
640
635
|
group: groupStyles(props, theme),
|
|
641
|
-
groupHeading: groupHeadingStyles(
|
|
642
|
-
container: containerStyles(
|
|
636
|
+
groupHeading: groupHeadingStyles(theme),
|
|
637
|
+
container: containerStyles(theme)
|
|
643
638
|
};
|
|
644
639
|
}
|
|
645
640
|
|
|
646
|
-
// NOTE: This string will be replaced
|
|
647
|
-
var version =
|
|
641
|
+
// NOTE: This string will be replaced on build time with the package version.
|
|
642
|
+
var version = "12.2.9";
|
|
648
643
|
|
|
649
644
|
exports.ClearIndicator = ClearIndicator$1;
|
|
650
645
|
exports.CustomSelectInputOption = CustomSelectInputOption;
|