@commercetools-uikit/select-utils 12.2.2 → 12.2.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -14,15 +14,15 @@ var _Object$defineProperty = require('@babel/runtime-corejs3/core-js-stable/obje
|
|
|
14
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
|
-
var _extends = require('@babel/runtime-corejs3/helpers/extends');
|
|
18
17
|
var _objectWithoutProperties = require('@babel/runtime-corejs3/helpers/objectWithoutProperties');
|
|
19
|
-
var React = require('react');
|
|
20
18
|
var PropTypes = require('prop-types');
|
|
21
19
|
var react = require('@emotion/react');
|
|
22
20
|
var icons = require('@commercetools-uikit/icons');
|
|
21
|
+
var jsxRuntime = require('@emotion/react/jsx-runtime');
|
|
23
22
|
var omit = require('lodash/omit');
|
|
24
23
|
var AccessibleButton = require('@commercetools-uikit/accessible-button');
|
|
25
24
|
var reactSelect = require('react-select');
|
|
25
|
+
var react$1 = require('react');
|
|
26
26
|
var _Object$values = require('@babel/runtime-corejs3/core-js-stable/object/values');
|
|
27
27
|
var Spacings = require('@commercetools-uikit/spacings');
|
|
28
28
|
var Text = require('@commercetools-uikit/text');
|
|
@@ -38,7 +38,6 @@ var _Object$getOwnPropertyDescriptors__default = /*#__PURE__*/_interopDefault(_O
|
|
|
38
38
|
var _Object$defineProperties__default = /*#__PURE__*/_interopDefault(_Object$defineProperties);
|
|
39
39
|
var _Object$defineProperty__default = /*#__PURE__*/_interopDefault(_Object$defineProperty);
|
|
40
40
|
var _concatInstanceProperty__default = /*#__PURE__*/_interopDefault(_concatInstanceProperty);
|
|
41
|
-
var React__default = /*#__PURE__*/_interopDefault(React);
|
|
42
41
|
var PropTypes__default = /*#__PURE__*/_interopDefault(PropTypes);
|
|
43
42
|
var omit__default = /*#__PURE__*/_interopDefault(omit);
|
|
44
43
|
var AccessibleButton__default = /*#__PURE__*/_interopDefault(AccessibleButton);
|
|
@@ -56,6 +55,10 @@ var messages$1 = reactIntl.defineMessages({
|
|
|
56
55
|
|
|
57
56
|
var _excluded$1 = ["ref"];
|
|
58
57
|
|
|
58
|
+
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
|
+
|
|
60
|
+
function _objectSpread$6(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$6(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$6(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } } return target; }
|
|
61
|
+
|
|
59
62
|
var ClearIndicator = function ClearIndicator(props) {
|
|
60
63
|
var intl = reactIntl.useIntl();
|
|
61
64
|
|
|
@@ -64,67 +67,85 @@ var ClearIndicator = function ClearIndicator(props) {
|
|
|
64
67
|
ref = _props$innerProps.ref,
|
|
65
68
|
restInnerProps = _objectWithoutProperties(_props$innerProps, _excluded$1);
|
|
66
69
|
|
|
67
|
-
return
|
|
70
|
+
return jsxRuntime.jsx("button", _objectSpread$6(_objectSpread$6({}, restInnerProps), {}, {
|
|
68
71
|
ref: ref,
|
|
69
|
-
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;")),
|
|
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,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImNsZWFyLWluZGljYXRvci5qcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFpQmMiLCJmaWxlIjoiY2xlYXItaW5kaWNhdG9yLmpzIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IFByb3BUeXBlcyBmcm9tICdwcm9wLXR5cGVzJztcbmltcG9ydCB7IGNzcyB9IGZyb20gJ0BlbW90aW9uL3JlYWN0JztcbmltcG9ydCB7IHVzZUludGwgfSBmcm9tICdyZWFjdC1pbnRsJztcbmltcG9ydCB7IGN1c3RvbVByb3BlcnRpZXMgYXMgdmFycyB9IGZyb20gJ0Bjb21tZXJjZXRvb2xzLXVpa2l0L2Rlc2lnbi1zeXN0ZW0nO1xuaW1wb3J0IHsgQ2xvc2VJY29uIH0gZnJvbSAnQGNvbW1lcmNldG9vbHMtdWlraXQvaWNvbnMnO1xuaW1wb3J0IG1lc3NhZ2VzIGZyb20gJy4vbWVzc2FnZXMnO1xuXG5jb25zdCBDbGVhckluZGljYXRvciA9IChwcm9wcykgPT4ge1xuICBjb25zdCBpbnRsID0gdXNlSW50bCgpO1xuICBjb25zdCB7XG4gICAgZ2V0U3R5bGVzLFxuICAgIGlubmVyUHJvcHM6IHsgcmVmLCAuLi5yZXN0SW5uZXJQcm9wcyB9LFxuICB9ID0gcHJvcHM7XG4gIHJldHVybiAoXG4gICAgPGJ1dHRvblxuICAgICAgey4uLnJlc3RJbm5lclByb3BzfVxuICAgICAgcmVmPXtyZWZ9XG4gICAgICBjc3M9e2Nzc2BcbiAgICAgICAgYm9yZGVyOiBub25lO1xuICAgICAgICBjdXJzb3I6IHBvaW50ZXI7XG4gICAgICAgIGJhY2tncm91bmQ6IG5vbmU7XG4gICAgICAgIGJveC1zaXppbmc6IGJvcmRlci1ib3g7XG4gICAgICAgIHRleHQtZGVjb3JhdGlvbjogbm9uZTtcbiAgICAgICAgOmhvdmVyIHN2ZyAqIHtcbiAgICAgICAgICBmaWxsOiAke3ZhcnMuY29sb3JXYXJuaW5nfTtcbiAgICAgICAgfVxuICAgICAgYH1cbiAgICAgIHN0eWxlPXtnZXRTdHlsZXMoJ2NsZWFySW5kaWNhdG9yJywgcHJvcHMpfVxuICAgICAgdGl0bGU9e2ludGwuZm9ybWF0TWVzc2FnZShtZXNzYWdlcy5jbGVhckJ1dHRvbkxhYmVsKX1cbiAgICAgIGFyaWEtbGFiZWw9e2ludGwuZm9ybWF0TWVzc2FnZShtZXNzYWdlcy5jbGVhckJ1dHRvbkxhYmVsKX1cbiAgICA+XG4gICAgICA8Q2xvc2VJY29uIGNvbG9yPVwic29saWRcIiBzaXplPVwibWVkaXVtXCIgLz5cbiAgICA8L2J1dHRvbj5cbiAgKTtcbn07XG5cbkNsZWFySW5kaWNhdG9yLmRpc3BsYXlOYW1lID0gJ0NsZWFySW5kaWNhdG9yJztcbkNsZWFySW5kaWNhdG9yLnByb3BUeXBlcyA9IHtcbiAgaW5uZXJQcm9wczogUHJvcFR5cGVzLm9iamVjdCxcbiAgZ2V0U3R5bGVzOiBQcm9wVHlwZXMuZnVuYy5pc1JlcXVpcmVkLFxufTtcblxuZXhwb3J0IGRlZmF1bHQgQ2xlYXJJbmRpY2F0b3I7XG4iXX0= */"),
|
|
70
73
|
style: getStyles('clearIndicator', props),
|
|
71
74
|
title: intl.formatMessage(messages$1.clearButtonLabel),
|
|
72
|
-
"aria-label": intl.formatMessage(messages$1.clearButtonLabel)
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
75
|
+
"aria-label": intl.formatMessage(messages$1.clearButtonLabel),
|
|
76
|
+
children: jsxRuntime.jsx(icons.CloseIcon, {
|
|
77
|
+
color: "solid",
|
|
78
|
+
size: "medium"
|
|
79
|
+
})
|
|
76
80
|
}));
|
|
77
81
|
};
|
|
78
82
|
|
|
79
83
|
ClearIndicator.displayName = 'ClearIndicator';
|
|
80
84
|
ClearIndicator.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
81
|
-
innerProps: PropTypes__default[
|
|
82
|
-
getStyles: PropTypes__default[
|
|
85
|
+
innerProps: PropTypes__default["default"].object,
|
|
86
|
+
getStyles: PropTypes__default["default"].func.isRequired
|
|
83
87
|
} : {};
|
|
84
88
|
var ClearIndicator$1 = ClearIndicator;
|
|
85
89
|
|
|
90
|
+
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
|
+
|
|
92
|
+
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
93
|
var removeProps = ['onClick', 'onTouchEnd', 'onMouseDown'];
|
|
87
94
|
|
|
88
95
|
var TagRemove = function TagRemove(props) {
|
|
89
96
|
var isDisabled = Boolean(props.selectProps.isDisabled || props.selectProps.isReadOnly); // when the select input is disabled,
|
|
90
97
|
// we don't want to spread the removeProp event handlers
|
|
91
98
|
|
|
92
|
-
var innerProps = isDisabled ? omit__default[
|
|
93
|
-
return
|
|
99
|
+
var innerProps = isDisabled ? omit__default["default"](props.innerProps, removeProps) : props.innerProps;
|
|
100
|
+
return jsxRuntime.jsx(AccessibleButton__default["default"], _objectSpread$5(_objectSpread$5({
|
|
94
101
|
label: "Remove"
|
|
95
|
-
}, innerProps),
|
|
96
|
-
|
|
97
|
-
|
|
102
|
+
}, innerProps), {}, {
|
|
103
|
+
children: jsxRuntime.jsx(icons.CloseBoldIcon, {
|
|
104
|
+
color: isDisabled ? 'neutral60' : 'solid',
|
|
105
|
+
size: "medium"
|
|
106
|
+
})
|
|
98
107
|
}));
|
|
99
108
|
};
|
|
100
109
|
|
|
101
110
|
TagRemove.displayName = 'TagRemove';
|
|
102
111
|
TagRemove.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
103
|
-
selectProps: PropTypes__default[
|
|
104
|
-
isDisabled: PropTypes__default[
|
|
105
|
-
isReadOnly: PropTypes__default[
|
|
112
|
+
selectProps: PropTypes__default["default"].shape({
|
|
113
|
+
isDisabled: PropTypes__default["default"].bool.isRequired,
|
|
114
|
+
isReadOnly: PropTypes__default["default"].bool
|
|
106
115
|
}).isRequired,
|
|
107
|
-
innerProps: PropTypes__default[
|
|
116
|
+
innerProps: PropTypes__default["default"].object
|
|
108
117
|
} : {};
|
|
109
118
|
var TagRemove$1 = TagRemove;
|
|
110
119
|
|
|
120
|
+
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; }
|
|
121
|
+
|
|
122
|
+
function _objectSpread$4(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$4(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$4(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } } return target; }
|
|
123
|
+
|
|
111
124
|
var DropdownIndicator = function DropdownIndicator(props) {
|
|
112
|
-
return
|
|
113
|
-
|
|
114
|
-
|
|
125
|
+
return jsxRuntime.jsx(reactSelect.components.DropdownIndicator, _objectSpread$4(_objectSpread$4({}, props), {}, {
|
|
126
|
+
children: jsxRuntime.jsx(icons.CaretDownIcon, {
|
|
127
|
+
color: props.isDisabled ? 'neutral60' : undefined,
|
|
128
|
+
size: "small"
|
|
129
|
+
})
|
|
115
130
|
}));
|
|
116
131
|
};
|
|
117
132
|
|
|
118
133
|
DropdownIndicator.displayName = 'DropdownIndicator';
|
|
119
134
|
DropdownIndicator.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
120
|
-
isDisabled: PropTypes__default[
|
|
135
|
+
isDisabled: PropTypes__default["default"].bool
|
|
121
136
|
} : {};
|
|
122
137
|
var DropdownIndicator$1 = DropdownIndicator;
|
|
123
138
|
|
|
139
|
+
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; }
|
|
140
|
+
|
|
141
|
+
function _objectSpread$3(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$3(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$3(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } } return target; }
|
|
142
|
+
|
|
124
143
|
var SearchIconDropdownIndicator = function SearchIconDropdownIndicator(props) {
|
|
125
|
-
return
|
|
126
|
-
|
|
127
|
-
|
|
144
|
+
return jsxRuntime.jsx(reactSelect.components.DropdownIndicator, _objectSpread$3(_objectSpread$3({}, props), {}, {
|
|
145
|
+
children: jsxRuntime.jsx(icons.SearchIcon, {
|
|
146
|
+
color: 'neutral60',
|
|
147
|
+
size: "big"
|
|
148
|
+
})
|
|
128
149
|
}));
|
|
129
150
|
};
|
|
130
151
|
|
|
@@ -133,10 +154,14 @@ var SearchIconDropdownIndicator$1 = SearchIconDropdownIndicator;
|
|
|
133
154
|
|
|
134
155
|
var _excluded = ["children"];
|
|
135
156
|
|
|
157
|
+
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
|
+
|
|
159
|
+
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; }
|
|
160
|
+
|
|
136
161
|
var getDefaultComponent = function getDefaultComponent(type) {
|
|
137
162
|
if (type === 'singleValue') return reactSelect.components.SingleValue;
|
|
138
163
|
if (type === 'placeholder') return reactSelect.components.Placeholder;
|
|
139
|
-
return
|
|
164
|
+
return react$1.Fragment;
|
|
140
165
|
};
|
|
141
166
|
|
|
142
167
|
var WrapperWithIcon = function WrapperWithIcon(_ref) {
|
|
@@ -144,21 +169,26 @@ var WrapperWithIcon = function WrapperWithIcon(_ref) {
|
|
|
144
169
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
145
170
|
|
|
146
171
|
var Component = getDefaultComponent(props.type);
|
|
147
|
-
return
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
172
|
+
return jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
173
|
+
children: [props.selectProps.iconLeft && /*#__PURE__*/react$1.cloneElement(props.selectProps.iconLeft, {
|
|
174
|
+
size: 'big'
|
|
175
|
+
}), jsxRuntime.jsx("span", {
|
|
176
|
+
// react-select uses absolute positioning for the SingleValue/Placeholder
|
|
177
|
+
// the icon has a fixed size of 24px (== SpacingsXl), therefore we can use a fixed margin
|
|
178
|
+
// 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,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndyYXBwZXItd2l0aC1pY29uLmpzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQXlCZ0IiLCJmaWxlIjoid3JhcHBlci13aXRoLWljb24uanMiLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgeyBGcmFnbWVudCwgY2xvbmVFbGVtZW50IH0gZnJvbSAncmVhY3QnO1xuaW1wb3J0IFByb3BUeXBlcyBmcm9tICdwcm9wLXR5cGVzJztcbmltcG9ydCB7IGNzcyB9IGZyb20gJ0BlbW90aW9uL3JlYWN0JztcbmltcG9ydCB7IGN1c3RvbVByb3BlcnRpZXMgfSBmcm9tICdAY29tbWVyY2V0b29scy11aWtpdC9kZXNpZ24tc3lzdGVtJztcbmltcG9ydCB7IGNvbXBvbmVudHMgYXMgZGVmYXVsdENvbXBvbmVudHMgfSBmcm9tICdyZWFjdC1zZWxlY3QnO1xuXG5jb25zdCBnZXREZWZhdWx0Q29tcG9uZW50ID0gKHR5cGUpID0+IHtcbiAgaWYgKHR5cGUgPT09ICdzaW5nbGVWYWx1ZScpIHJldHVybiBkZWZhdWx0Q29tcG9uZW50cy5TaW5nbGVWYWx1ZTtcbiAgaWYgKHR5cGUgPT09ICdwbGFjZWhvbGRlcicpIHJldHVybiBkZWZhdWx0Q29tcG9uZW50cy5QbGFjZWhvbGRlcjtcbiAgcmV0dXJuIEZyYWdtZW50O1xufTtcblxuY29uc3QgV3JhcHBlcldpdGhJY29uID0gKHsgY2hpbGRyZW4sIC4uLnByb3BzIH0pID0+IHtcbiAgY29uc3QgQ29tcG9uZW50ID0gZ2V0RGVmYXVsdENvbXBvbmVudChwcm9wcy50eXBlKTtcblxuICByZXR1cm4gKFxuICAgIDw+XG4gICAgICB7cHJvcHMuc2VsZWN0UHJvcHMuaWNvbkxlZnQgJiZcbiAgICAgICAgY2xvbmVFbGVtZW50KHByb3BzLnNlbGVjdFByb3BzLmljb25MZWZ0LCB7XG4gICAgICAgICAgc2l6ZTogJ2JpZycsXG4gICAgICAgIH0pfVxuICAgICAgPHNwYW5cbiAgICAgICAgLy8gcmVhY3Qtc2VsZWN0IHVzZXMgYWJzb2x1dGUgcG9zaXRpb25pbmcgZm9yIHRoZSBTaW5nbGVWYWx1ZS9QbGFjZWhvbGRlclxuICAgICAgICAvLyB0aGUgaWNvbiBoYXMgYSBmaXhlZCBzaXplIG9mIDI0cHggKD09IFNwYWNpbmdzWGwpLCB0aGVyZWZvcmUgd2UgY2FuIHVzZSBhIGZpeGVkIG1hcmdpblxuICAgICAgICAvLyBzcGFjaW5nc1hzIGlzIHRoZSBtYXJnaW4gYmV0d2VlbiB0aGUgaWNvbiBhbmQgdmFsdWVcbiAgICAgICAgY3NzPXtjc3NgXG4gICAgICAgICAgbWFyZ2luLWxlZnQ6ICR7Y3VzdG9tUHJvcGVydGllcy5zcGFjaW5nWGwgK1xuICAgICAgICAgIGN1c3RvbVByb3BlcnRpZXMuc3BhY2luZ1hzfTtcbiAgICAgICAgYH1cbiAgICAgID5cbiAgICAgICAgPENvbXBvbmVudCB7Li4ucHJvcHN9PntjaGlsZHJlbn08L0NvbXBvbmVudD5cbiAgICAgIDwvc3Bhbj5cbiAgICA8Lz5cbiAgKTtcbn07XG5XcmFwcGVyV2l0aEljb24ucHJvcFR5cGVzID0ge1xuICBjaGlsZHJlbjogUHJvcFR5cGVzLm5vZGUsXG4gIHR5cGU6IFByb3BUeXBlcy5vbmVPZihbJ3NpbmdsZVZhbHVlJywgJ3BsYWNlaG9sZGVyJ10pLFxuICBzZWxlY3RQcm9wczogUHJvcFR5cGVzLnNoYXBlKHtcbiAgICBpY29uTGVmdDogUHJvcFR5cGVzLm5vZGUsXG4gIH0pLFxufTtcbldyYXBwZXJXaXRoSWNvbi5kaXNwbGF5TmFtZSA9ICdXcmFwcGVyV2l0aEljb24nO1xuXG5leHBvcnQgZGVmYXVsdCBXcmFwcGVyV2l0aEljb247XG5cbi8qIGVzbGludC1kaXNhYmxlIHJlYWN0L2Rpc3BsYXktbmFtZSAqL1xuY29uc3QgY3VzdG9tQ29tcG9uZW50cyA9IHtcbiAgU2luZ2xlVmFsdWU6IChwcm9wcykgPT4gPFdyYXBwZXJXaXRoSWNvbiB7Li4ucHJvcHN9IHR5cGU9XCJzaW5nbGVWYWx1ZVwiIC8+LFxuICBQbGFjZWhvbGRlcjogKHByb3BzKSA9PiA8V3JhcHBlcldpdGhJY29uIHsuLi5wcm9wc30gdHlwZT1cInBsYWNlaG9sZGVyXCIgLz4sXG59O1xuLyogZXNsaW50LWVuYWJsZSByZWFjdC9kaXNwbGF5LW5hbWUgKi9cblxuZXhwb3J0IHsgY3VzdG9tQ29tcG9uZW50cyB9O1xuIl19 */"),
|
|
180
|
+
children: jsxRuntime.jsx(Component, _objectSpread$2(_objectSpread$2({}, props), {}, {
|
|
181
|
+
children: children
|
|
182
|
+
}))
|
|
183
|
+
})]
|
|
184
|
+
});
|
|
155
185
|
};
|
|
156
186
|
|
|
157
187
|
WrapperWithIcon.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
158
|
-
children: PropTypes__default[
|
|
159
|
-
type: PropTypes__default[
|
|
160
|
-
selectProps: PropTypes__default[
|
|
161
|
-
iconLeft: PropTypes__default[
|
|
188
|
+
children: PropTypes__default["default"].node,
|
|
189
|
+
type: PropTypes__default["default"].oneOf(['singleValue', 'placeholder']),
|
|
190
|
+
selectProps: PropTypes__default["default"].shape({
|
|
191
|
+
iconLeft: PropTypes__default["default"].node
|
|
162
192
|
})
|
|
163
193
|
} : {};
|
|
164
194
|
WrapperWithIcon.displayName = 'WrapperWithIcon';
|
|
@@ -167,12 +197,12 @@ var WrapperWithIcon$1 = WrapperWithIcon;
|
|
|
167
197
|
|
|
168
198
|
var customComponents = {
|
|
169
199
|
SingleValue: function SingleValue(props) {
|
|
170
|
-
return
|
|
200
|
+
return jsxRuntime.jsx(WrapperWithIcon, _objectSpread$2(_objectSpread$2({}, props), {}, {
|
|
171
201
|
type: "singleValue"
|
|
172
202
|
}));
|
|
173
203
|
},
|
|
174
204
|
Placeholder: function Placeholder(props) {
|
|
175
|
-
return
|
|
205
|
+
return jsxRuntime.jsx(WrapperWithIcon, _objectSpread$2(_objectSpread$2({}, props), {}, {
|
|
176
206
|
type: "placeholder"
|
|
177
207
|
}));
|
|
178
208
|
}
|
|
@@ -185,68 +215,89 @@ var SELECT_DROPDOWN_OPTION_TYPES = {
|
|
|
185
215
|
MULTIPLE_PROPERTIES: 'multiple-properties'
|
|
186
216
|
};
|
|
187
217
|
|
|
218
|
+
function ownKeys$1(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; }
|
|
219
|
+
|
|
220
|
+
function _objectSpread$1(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$1(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$1(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } } return target; }
|
|
188
221
|
var MultiplePropertiesSelectInputOption = function MultiplePropertiesSelectInputOption(props) {
|
|
189
222
|
var data = props.data;
|
|
190
223
|
var noValueFallback = props.noValueFallback || NO_VALUE_FALLBACK;
|
|
191
|
-
return
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
224
|
+
return jsxRuntime.jsx(reactSelect.components.Option, _objectSpread$1(_objectSpread$1({}, props), {}, {
|
|
225
|
+
children: jsxRuntime.jsxs(Spacings__default["default"].Stack, {
|
|
226
|
+
scale: "xs",
|
|
227
|
+
children: [jsxRuntime.jsx(Text__default["default"].Detail, {
|
|
228
|
+
isBold: true,
|
|
229
|
+
children: data.label || noValueFallback
|
|
230
|
+
}), jsxRuntime.jsxs(Text__default["default"].Detail, {
|
|
231
|
+
children: ["Key: ", data.key || noValueFallback]
|
|
232
|
+
}), jsxRuntime.jsxs(Text__default["default"].Detail, {
|
|
233
|
+
children: ["ID: ", data.id || noValueFallback]
|
|
234
|
+
})]
|
|
235
|
+
})
|
|
236
|
+
}));
|
|
196
237
|
};
|
|
197
238
|
MultiplePropertiesSelectInputOption.displayName = 'MultiplePropertiesSelectInputOption';
|
|
198
239
|
MultiplePropertiesSelectInputOption.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
199
|
-
data: PropTypes__default[
|
|
200
|
-
label: PropTypes__default[
|
|
201
|
-
key: PropTypes__default[
|
|
202
|
-
id: PropTypes__default[
|
|
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])
|
|
203
244
|
}),
|
|
204
|
-
noValueFallback: PropTypes__default[
|
|
245
|
+
noValueFallback: PropTypes__default["default"].string
|
|
205
246
|
} : {};
|
|
206
247
|
var DoublePropertySelectInputOption = function DoublePropertySelectInputOption(props) {
|
|
207
248
|
var data = props.data;
|
|
208
249
|
var noValueFallback = props.noValueFallback || NO_VALUE_FALLBACK;
|
|
209
|
-
return
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
250
|
+
return jsxRuntime.jsx(reactSelect.components.Option, _objectSpread$1(_objectSpread$1({}, props), {}, {
|
|
251
|
+
children: jsxRuntime.jsxs(Spacings__default["default"].Stack, {
|
|
252
|
+
scale: "xs",
|
|
253
|
+
children: [jsxRuntime.jsx(Text__default["default"].Detail, {
|
|
254
|
+
isBold: true,
|
|
255
|
+
children: data.label || noValueFallback
|
|
256
|
+
}), jsxRuntime.jsxs(Text__default["default"].Detail, {
|
|
257
|
+
children: ["Key: ", data.key || noValueFallback]
|
|
258
|
+
})]
|
|
259
|
+
})
|
|
260
|
+
}));
|
|
214
261
|
};
|
|
215
262
|
DoublePropertySelectInputOption.displayName = 'DoublePropertySelectInputOption';
|
|
216
263
|
DoublePropertySelectInputOption.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
217
|
-
data: PropTypes__default[
|
|
218
|
-
label: PropTypes__default[
|
|
219
|
-
key: PropTypes__default[
|
|
264
|
+
data: PropTypes__default["default"].shape({
|
|
265
|
+
label: PropTypes__default["default"].string,
|
|
266
|
+
key: PropTypes__default["default"].string
|
|
220
267
|
}),
|
|
221
|
-
noValueFallback: PropTypes__default[
|
|
268
|
+
noValueFallback: PropTypes__default["default"].string
|
|
222
269
|
} : {};
|
|
223
270
|
var CustomSelectInputOption = function CustomSelectInputOption(props) {
|
|
224
271
|
var noValueFallback = props.noValueFallback || NO_VALUE_FALLBACK;
|
|
225
272
|
|
|
226
273
|
switch (props.optionType) {
|
|
227
274
|
case SELECT_DROPDOWN_OPTION_TYPES.MULTIPLE_PROPERTIES:
|
|
228
|
-
return
|
|
275
|
+
return jsxRuntime.jsx(MultiplePropertiesSelectInputOption, _objectSpread$1(_objectSpread$1({}, props.optionInnerProps), {}, {
|
|
229
276
|
noValueFallback: noValueFallback
|
|
230
277
|
}));
|
|
231
278
|
|
|
232
279
|
case SELECT_DROPDOWN_OPTION_TYPES.DOUBLE_PROPERTY:
|
|
233
|
-
return
|
|
280
|
+
return jsxRuntime.jsx(DoublePropertySelectInputOption, _objectSpread$1(_objectSpread$1({}, props.optionInnerProps), {}, {
|
|
234
281
|
noValueFallback: noValueFallback
|
|
235
282
|
}));
|
|
236
283
|
|
|
237
284
|
default:
|
|
238
|
-
return
|
|
285
|
+
return jsxRuntime.jsx(reactSelect.components.Option, _objectSpread$1(_objectSpread$1({}, props.optionInnerProps), {}, {
|
|
286
|
+
children: jsxRuntime.jsx(Text__default["default"].Detail, {
|
|
287
|
+
children: props.optionInnerProps.data.label || noValueFallback
|
|
288
|
+
})
|
|
289
|
+
}));
|
|
239
290
|
}
|
|
240
291
|
};
|
|
241
292
|
CustomSelectInputOption.displayName = 'CustomSelectInputOption';
|
|
242
293
|
CustomSelectInputOption.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
243
|
-
optionType: PropTypes__default[
|
|
244
|
-
noValueFallback: PropTypes__default[
|
|
245
|
-
optionInnerProps: PropTypes__default[
|
|
246
|
-
data: PropTypes__default[
|
|
247
|
-
label: PropTypes__default[
|
|
248
|
-
key: PropTypes__default[
|
|
249
|
-
id: PropTypes__default[
|
|
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
|
|
250
301
|
})
|
|
251
302
|
}).isRequired
|
|
252
303
|
} : {};
|
|
@@ -279,9 +330,9 @@ var messages = reactIntl.defineMessages({
|
|
|
279
330
|
}
|
|
280
331
|
});
|
|
281
332
|
|
|
282
|
-
function ownKeys(object, enumerableOnly) { var keys = _Object$keys__default[
|
|
333
|
+
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; }
|
|
283
334
|
|
|
284
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { var _context8; _forEachInstanceProperty__default[
|
|
335
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { var _context8; _forEachInstanceProperty__default["default"](_context8 = ownKeys(Object(source), true)).call(_context8, 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 _context9; _forEachInstanceProperty__default["default"](_context9 = ownKeys(Object(source))).call(_context9, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } } return target; }
|
|
285
336
|
|
|
286
337
|
var controlStyles = function controlStyles(props, theme) {
|
|
287
338
|
return function (base, state) {
|
|
@@ -308,7 +359,7 @@ var controlStyles = function controlStyles(props, theme) {
|
|
|
308
359
|
return 'pointer';
|
|
309
360
|
}(),
|
|
310
361
|
padding: "0 ".concat(overwrittenVars.spacingS),
|
|
311
|
-
transition: _concatInstanceProperty__default[
|
|
362
|
+
transition: _concatInstanceProperty__default["default"](_context = "border-color ".concat(overwrittenVars.transitionStandard, ",\n box-shadow ")).call(_context, overwrittenVars.transitionStandard),
|
|
312
363
|
outline: 0,
|
|
313
364
|
boxShadow: 'none',
|
|
314
365
|
'&:focus-within': {
|
|
@@ -409,7 +460,7 @@ var optionStyles = function optionStyles(props, theme) {
|
|
|
409
460
|
var overwrittenVars = _objectSpread(_objectSpread({}, designSystem.customProperties), theme);
|
|
410
461
|
|
|
411
462
|
return _objectSpread(_objectSpread({}, base), {}, {
|
|
412
|
-
transition: _concatInstanceProperty__default[
|
|
463
|
+
transition: _concatInstanceProperty__default["default"](_context2 = _concatInstanceProperty__default["default"](_context3 = "border-color ".concat(overwrittenVars.transitionStandard, ",\n background-color ")).call(_context3, overwrittenVars.transitionStandard, ",\n color ")).call(_context2, overwrittenVars.transitionStandard),
|
|
413
464
|
paddingLeft: overwrittenVars.spacingS,
|
|
414
465
|
paddingRight: overwrittenVars.spacingS,
|
|
415
466
|
color: function () {
|
|
@@ -506,7 +557,7 @@ var groupHeadingStyles = function groupHeadingStyles(props, theme) {
|
|
|
506
557
|
textTransform: 'none',
|
|
507
558
|
fontWeight: 'bold',
|
|
508
559
|
margin: "0 ".concat(overwrittenVars.spacingXs),
|
|
509
|
-
padding: _concatInstanceProperty__default[
|
|
560
|
+
padding: _concatInstanceProperty__default["default"](_context4 = "".concat(overwrittenVars.spacingS, " ")).call(_context4, overwrittenVars.spacingXs),
|
|
510
561
|
'&:empty': {
|
|
511
562
|
padding: 0
|
|
512
563
|
}
|
|
@@ -571,8 +622,8 @@ var multiValueLabelStyles = function multiValueLabelStyles(props, theme) {
|
|
|
571
622
|
if (props.isReadOnly) return overwrittenVars[designSystem.designTokens.fontColorForInputWhenReadonly];
|
|
572
623
|
return base.color;
|
|
573
624
|
}(),
|
|
574
|
-
padding: _concatInstanceProperty__default[
|
|
575
|
-
borderRadius: _concatInstanceProperty__default[
|
|
625
|
+
padding: _concatInstanceProperty__default["default"](_context5 = "".concat(overwrittenVars.spacingXs, " ")).call(_context5, overwrittenVars.spacingS),
|
|
626
|
+
borderRadius: _concatInstanceProperty__default["default"](_context6 = "".concat(overwrittenVars.borderRadiusForTag, " 0 0 ")).call(_context6, overwrittenVars.borderRadiusForTag),
|
|
576
627
|
border: "1px ".concat(overwrittenVars[designSystem.designTokens.borderColorForTag], " solid"),
|
|
577
628
|
borderWidth: '1px 0 1px 1px',
|
|
578
629
|
'&:last-child': {
|
|
@@ -592,7 +643,7 @@ var multiValueRemoveStyles = function multiValueRemoveStyles(props, theme) {
|
|
|
592
643
|
return _objectSpread(_objectSpread({}, base), {}, {
|
|
593
644
|
borderColor: overwrittenVars[designSystem.designTokens.borderColorForTag],
|
|
594
645
|
padding: "0 ".concat(overwrittenVars.spacingXs),
|
|
595
|
-
borderRadius: _concatInstanceProperty__default[
|
|
646
|
+
borderRadius: _concatInstanceProperty__default["default"](_context7 = "0 ".concat(overwrittenVars[designSystem.designTokens.borderRadiusForTag], " ")).call(_context7, overwrittenVars[designSystem.designTokens.borderRadiusForTag], " 0"),
|
|
596
647
|
borderStyle: 'solid',
|
|
597
648
|
borderWidth: '1px',
|
|
598
649
|
pointerEvents: state.isDisabled || props.isReadOnly ? 'none' : base.pointerEvents,
|
|
@@ -634,8 +685,8 @@ function createSelectStyles(props, theme) {
|
|
|
634
685
|
};
|
|
635
686
|
}
|
|
636
687
|
|
|
637
|
-
// NOTE: This string will be replaced
|
|
638
|
-
var version =
|
|
688
|
+
// NOTE: This string will be replaced on build time with the package version.
|
|
689
|
+
var version = "12.2.6";
|
|
639
690
|
|
|
640
691
|
exports.ClearIndicator = ClearIndicator$1;
|
|
641
692
|
exports.CustomSelectInputOption = CustomSelectInputOption;
|
|
@@ -14,15 +14,15 @@ var _Object$defineProperty = require('@babel/runtime-corejs3/core-js-stable/obje
|
|
|
14
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
|
-
var _extends = require('@babel/runtime-corejs3/helpers/extends');
|
|
18
17
|
var _objectWithoutProperties = require('@babel/runtime-corejs3/helpers/objectWithoutProperties');
|
|
19
|
-
var React = require('react');
|
|
20
18
|
require('prop-types');
|
|
21
19
|
var react = require('@emotion/react');
|
|
22
20
|
var icons = require('@commercetools-uikit/icons');
|
|
21
|
+
var jsxRuntime = require('@emotion/react/jsx-runtime');
|
|
23
22
|
var omit = require('lodash/omit');
|
|
24
23
|
var AccessibleButton = require('@commercetools-uikit/accessible-button');
|
|
25
24
|
var reactSelect = require('react-select');
|
|
25
|
+
var react$1 = require('react');
|
|
26
26
|
require('@babel/runtime-corejs3/core-js-stable/object/values');
|
|
27
27
|
var Spacings = require('@commercetools-uikit/spacings');
|
|
28
28
|
var Text = require('@commercetools-uikit/text');
|
|
@@ -38,7 +38,6 @@ var _Object$getOwnPropertyDescriptors__default = /*#__PURE__*/_interopDefault(_O
|
|
|
38
38
|
var _Object$defineProperties__default = /*#__PURE__*/_interopDefault(_Object$defineProperties);
|
|
39
39
|
var _Object$defineProperty__default = /*#__PURE__*/_interopDefault(_Object$defineProperty);
|
|
40
40
|
var _concatInstanceProperty__default = /*#__PURE__*/_interopDefault(_concatInstanceProperty);
|
|
41
|
-
var React__default = /*#__PURE__*/_interopDefault(React);
|
|
42
41
|
var omit__default = /*#__PURE__*/_interopDefault(omit);
|
|
43
42
|
var AccessibleButton__default = /*#__PURE__*/_interopDefault(AccessibleButton);
|
|
44
43
|
var Spacings__default = /*#__PURE__*/_interopDefault(Spacings);
|
|
@@ -54,6 +53,10 @@ var messages$1 = reactIntl.defineMessages({
|
|
|
54
53
|
|
|
55
54
|
var _excluded$1 = ["ref"];
|
|
56
55
|
|
|
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; }
|
|
57
|
+
|
|
58
|
+
function _objectSpread$6(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$6(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$6(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } } return target; }
|
|
59
|
+
|
|
57
60
|
var ClearIndicator = function ClearIndicator(props) {
|
|
58
61
|
var intl = reactIntl.useIntl();
|
|
59
62
|
|
|
@@ -62,15 +65,16 @@ var ClearIndicator = function ClearIndicator(props) {
|
|
|
62
65
|
ref = _props$innerProps.ref,
|
|
63
66
|
restInnerProps = _objectWithoutProperties(_props$innerProps, _excluded$1);
|
|
64
67
|
|
|
65
|
-
return
|
|
68
|
+
return jsxRuntime.jsx("button", _objectSpread$6(_objectSpread$6({}, restInnerProps), {}, {
|
|
66
69
|
ref: ref,
|
|
67
|
-
css: /*#__PURE__*/react.css("border:none;cursor:pointer;background:none;box-sizing:border-box;text-decoration:none;:hover svg *{fill:", designSystem.customProperties.colorWarning, ";}" + ("" )),
|
|
70
|
+
css: /*#__PURE__*/react.css("border:none;cursor:pointer;background:none;box-sizing:border-box;text-decoration:none;:hover svg *{fill:", designSystem.customProperties.colorWarning, ";}" + ("" ), "" ),
|
|
68
71
|
style: getStyles('clearIndicator', props),
|
|
69
72
|
title: intl.formatMessage(messages$1.clearButtonLabel),
|
|
70
|
-
"aria-label": intl.formatMessage(messages$1.clearButtonLabel)
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
73
|
+
"aria-label": intl.formatMessage(messages$1.clearButtonLabel),
|
|
74
|
+
children: jsxRuntime.jsx(icons.CloseIcon, {
|
|
75
|
+
color: "solid",
|
|
76
|
+
size: "medium"
|
|
77
|
+
})
|
|
74
78
|
}));
|
|
75
79
|
};
|
|
76
80
|
|
|
@@ -78,18 +82,23 @@ ClearIndicator.displayName = 'ClearIndicator';
|
|
|
78
82
|
ClearIndicator.propTypes = {};
|
|
79
83
|
var ClearIndicator$1 = ClearIndicator;
|
|
80
84
|
|
|
85
|
+
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
|
+
|
|
87
|
+
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; }
|
|
81
88
|
var removeProps = ['onClick', 'onTouchEnd', 'onMouseDown'];
|
|
82
89
|
|
|
83
90
|
var TagRemove = function TagRemove(props) {
|
|
84
91
|
var isDisabled = Boolean(props.selectProps.isDisabled || props.selectProps.isReadOnly); // when the select input is disabled,
|
|
85
92
|
// we don't want to spread the removeProp event handlers
|
|
86
93
|
|
|
87
|
-
var innerProps = isDisabled ? omit__default[
|
|
88
|
-
return
|
|
94
|
+
var innerProps = isDisabled ? omit__default["default"](props.innerProps, removeProps) : props.innerProps;
|
|
95
|
+
return jsxRuntime.jsx(AccessibleButton__default["default"], _objectSpread$5(_objectSpread$5({
|
|
89
96
|
label: "Remove"
|
|
90
|
-
}, innerProps),
|
|
91
|
-
|
|
92
|
-
|
|
97
|
+
}, innerProps), {}, {
|
|
98
|
+
children: jsxRuntime.jsx(icons.CloseBoldIcon, {
|
|
99
|
+
color: isDisabled ? 'neutral60' : 'solid',
|
|
100
|
+
size: "medium"
|
|
101
|
+
})
|
|
93
102
|
}));
|
|
94
103
|
};
|
|
95
104
|
|
|
@@ -97,10 +106,16 @@ TagRemove.displayName = 'TagRemove';
|
|
|
97
106
|
TagRemove.propTypes = {};
|
|
98
107
|
var TagRemove$1 = TagRemove;
|
|
99
108
|
|
|
109
|
+
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; }
|
|
110
|
+
|
|
111
|
+
function _objectSpread$4(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$4(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$4(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } } return target; }
|
|
112
|
+
|
|
100
113
|
var DropdownIndicator = function DropdownIndicator(props) {
|
|
101
|
-
return
|
|
102
|
-
|
|
103
|
-
|
|
114
|
+
return jsxRuntime.jsx(reactSelect.components.DropdownIndicator, _objectSpread$4(_objectSpread$4({}, props), {}, {
|
|
115
|
+
children: jsxRuntime.jsx(icons.CaretDownIcon, {
|
|
116
|
+
color: props.isDisabled ? 'neutral60' : undefined,
|
|
117
|
+
size: "small"
|
|
118
|
+
})
|
|
104
119
|
}));
|
|
105
120
|
};
|
|
106
121
|
|
|
@@ -108,10 +123,16 @@ DropdownIndicator.displayName = 'DropdownIndicator';
|
|
|
108
123
|
DropdownIndicator.propTypes = {};
|
|
109
124
|
var DropdownIndicator$1 = DropdownIndicator;
|
|
110
125
|
|
|
126
|
+
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; }
|
|
127
|
+
|
|
128
|
+
function _objectSpread$3(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$3(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$3(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } } return target; }
|
|
129
|
+
|
|
111
130
|
var SearchIconDropdownIndicator = function SearchIconDropdownIndicator(props) {
|
|
112
|
-
return
|
|
113
|
-
|
|
114
|
-
|
|
131
|
+
return jsxRuntime.jsx(reactSelect.components.DropdownIndicator, _objectSpread$3(_objectSpread$3({}, props), {}, {
|
|
132
|
+
children: jsxRuntime.jsx(icons.SearchIcon, {
|
|
133
|
+
color: 'neutral60',
|
|
134
|
+
size: "big"
|
|
135
|
+
})
|
|
115
136
|
}));
|
|
116
137
|
};
|
|
117
138
|
|
|
@@ -120,10 +141,14 @@ var SearchIconDropdownIndicator$1 = SearchIconDropdownIndicator;
|
|
|
120
141
|
|
|
121
142
|
var _excluded = ["children"];
|
|
122
143
|
|
|
144
|
+
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
|
+
|
|
146
|
+
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; }
|
|
147
|
+
|
|
123
148
|
var getDefaultComponent = function getDefaultComponent(type) {
|
|
124
149
|
if (type === 'singleValue') return reactSelect.components.SingleValue;
|
|
125
150
|
if (type === 'placeholder') return reactSelect.components.Placeholder;
|
|
126
|
-
return
|
|
151
|
+
return react$1.Fragment;
|
|
127
152
|
};
|
|
128
153
|
|
|
129
154
|
var WrapperWithIcon = function WrapperWithIcon(_ref) {
|
|
@@ -131,14 +156,19 @@ var WrapperWithIcon = function WrapperWithIcon(_ref) {
|
|
|
131
156
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
132
157
|
|
|
133
158
|
var Component = getDefaultComponent(props.type);
|
|
134
|
-
return
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
159
|
+
return jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
160
|
+
children: [props.selectProps.iconLeft && /*#__PURE__*/react$1.cloneElement(props.selectProps.iconLeft, {
|
|
161
|
+
size: 'big'
|
|
162
|
+
}), jsxRuntime.jsx("span", {
|
|
163
|
+
// react-select uses absolute positioning for the SingleValue/Placeholder
|
|
164
|
+
// the icon has a fixed size of 24px (== SpacingsXl), therefore we can use a fixed margin
|
|
165
|
+
// spacingsXs is the margin between the icon and value
|
|
166
|
+
css: /*#__PURE__*/react.css("margin-left:", designSystem.customProperties.spacingXl + designSystem.customProperties.spacingXs, ";" + ("" ), "" ),
|
|
167
|
+
children: jsxRuntime.jsx(Component, _objectSpread$2(_objectSpread$2({}, props), {}, {
|
|
168
|
+
children: children
|
|
169
|
+
}))
|
|
170
|
+
})]
|
|
171
|
+
});
|
|
142
172
|
};
|
|
143
173
|
|
|
144
174
|
WrapperWithIcon.propTypes = {};
|
|
@@ -148,12 +178,12 @@ var WrapperWithIcon$1 = WrapperWithIcon;
|
|
|
148
178
|
|
|
149
179
|
var customComponents = {
|
|
150
180
|
SingleValue: function SingleValue(props) {
|
|
151
|
-
return
|
|
181
|
+
return jsxRuntime.jsx(WrapperWithIcon, _objectSpread$2(_objectSpread$2({}, props), {}, {
|
|
152
182
|
type: "singleValue"
|
|
153
183
|
}));
|
|
154
184
|
},
|
|
155
185
|
Placeholder: function Placeholder(props) {
|
|
156
|
-
return
|
|
186
|
+
return jsxRuntime.jsx(WrapperWithIcon, _objectSpread$2(_objectSpread$2({}, props), {}, {
|
|
157
187
|
type: "placeholder"
|
|
158
188
|
}));
|
|
159
189
|
}
|
|
@@ -166,25 +196,42 @@ var SELECT_DROPDOWN_OPTION_TYPES = {
|
|
|
166
196
|
MULTIPLE_PROPERTIES: 'multiple-properties'
|
|
167
197
|
};
|
|
168
198
|
|
|
199
|
+
function ownKeys$1(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; }
|
|
200
|
+
|
|
201
|
+
function _objectSpread$1(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$1(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$1(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } } return target; }
|
|
169
202
|
var MultiplePropertiesSelectInputOption = function MultiplePropertiesSelectInputOption(props) {
|
|
170
203
|
var data = props.data;
|
|
171
204
|
var noValueFallback = props.noValueFallback || NO_VALUE_FALLBACK;
|
|
172
|
-
return
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
205
|
+
return jsxRuntime.jsx(reactSelect.components.Option, _objectSpread$1(_objectSpread$1({}, props), {}, {
|
|
206
|
+
children: jsxRuntime.jsxs(Spacings__default["default"].Stack, {
|
|
207
|
+
scale: "xs",
|
|
208
|
+
children: [jsxRuntime.jsx(Text__default["default"].Detail, {
|
|
209
|
+
isBold: true,
|
|
210
|
+
children: data.label || noValueFallback
|
|
211
|
+
}), jsxRuntime.jsxs(Text__default["default"].Detail, {
|
|
212
|
+
children: ["Key: ", data.key || noValueFallback]
|
|
213
|
+
}), jsxRuntime.jsxs(Text__default["default"].Detail, {
|
|
214
|
+
children: ["ID: ", data.id || noValueFallback]
|
|
215
|
+
})]
|
|
216
|
+
})
|
|
217
|
+
}));
|
|
177
218
|
};
|
|
178
219
|
MultiplePropertiesSelectInputOption.displayName = 'MultiplePropertiesSelectInputOption';
|
|
179
220
|
MultiplePropertiesSelectInputOption.propTypes = {};
|
|
180
221
|
var DoublePropertySelectInputOption = function DoublePropertySelectInputOption(props) {
|
|
181
222
|
var data = props.data;
|
|
182
223
|
var noValueFallback = props.noValueFallback || NO_VALUE_FALLBACK;
|
|
183
|
-
return
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
224
|
+
return jsxRuntime.jsx(reactSelect.components.Option, _objectSpread$1(_objectSpread$1({}, props), {}, {
|
|
225
|
+
children: jsxRuntime.jsxs(Spacings__default["default"].Stack, {
|
|
226
|
+
scale: "xs",
|
|
227
|
+
children: [jsxRuntime.jsx(Text__default["default"].Detail, {
|
|
228
|
+
isBold: true,
|
|
229
|
+
children: data.label || noValueFallback
|
|
230
|
+
}), jsxRuntime.jsxs(Text__default["default"].Detail, {
|
|
231
|
+
children: ["Key: ", data.key || noValueFallback]
|
|
232
|
+
})]
|
|
233
|
+
})
|
|
234
|
+
}));
|
|
188
235
|
};
|
|
189
236
|
DoublePropertySelectInputOption.displayName = 'DoublePropertySelectInputOption';
|
|
190
237
|
DoublePropertySelectInputOption.propTypes = {};
|
|
@@ -193,17 +240,21 @@ var CustomSelectInputOption = function CustomSelectInputOption(props) {
|
|
|
193
240
|
|
|
194
241
|
switch (props.optionType) {
|
|
195
242
|
case SELECT_DROPDOWN_OPTION_TYPES.MULTIPLE_PROPERTIES:
|
|
196
|
-
return
|
|
243
|
+
return jsxRuntime.jsx(MultiplePropertiesSelectInputOption, _objectSpread$1(_objectSpread$1({}, props.optionInnerProps), {}, {
|
|
197
244
|
noValueFallback: noValueFallback
|
|
198
245
|
}));
|
|
199
246
|
|
|
200
247
|
case SELECT_DROPDOWN_OPTION_TYPES.DOUBLE_PROPERTY:
|
|
201
|
-
return
|
|
248
|
+
return jsxRuntime.jsx(DoublePropertySelectInputOption, _objectSpread$1(_objectSpread$1({}, props.optionInnerProps), {}, {
|
|
202
249
|
noValueFallback: noValueFallback
|
|
203
250
|
}));
|
|
204
251
|
|
|
205
252
|
default:
|
|
206
|
-
return
|
|
253
|
+
return jsxRuntime.jsx(reactSelect.components.Option, _objectSpread$1(_objectSpread$1({}, props.optionInnerProps), {}, {
|
|
254
|
+
children: jsxRuntime.jsx(Text__default["default"].Detail, {
|
|
255
|
+
children: props.optionInnerProps.data.label || noValueFallback
|
|
256
|
+
})
|
|
257
|
+
}));
|
|
207
258
|
}
|
|
208
259
|
};
|
|
209
260
|
CustomSelectInputOption.displayName = 'CustomSelectInputOption';
|
|
@@ -237,9 +288,9 @@ var messages = reactIntl.defineMessages({
|
|
|
237
288
|
}
|
|
238
289
|
});
|
|
239
290
|
|
|
240
|
-
function ownKeys(object, enumerableOnly) { var keys = _Object$keys__default[
|
|
291
|
+
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; }
|
|
241
292
|
|
|
242
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { var _context8; _forEachInstanceProperty__default[
|
|
293
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { var _context8; _forEachInstanceProperty__default["default"](_context8 = ownKeys(Object(source), true)).call(_context8, 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 _context9; _forEachInstanceProperty__default["default"](_context9 = ownKeys(Object(source))).call(_context9, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } } return target; }
|
|
243
294
|
|
|
244
295
|
var controlStyles = function controlStyles(props, theme) {
|
|
245
296
|
return function (base, state) {
|
|
@@ -266,7 +317,7 @@ var controlStyles = function controlStyles(props, theme) {
|
|
|
266
317
|
return 'pointer';
|
|
267
318
|
}(),
|
|
268
319
|
padding: "0 ".concat(overwrittenVars.spacingS),
|
|
269
|
-
transition: _concatInstanceProperty__default[
|
|
320
|
+
transition: _concatInstanceProperty__default["default"](_context = "border-color ".concat(overwrittenVars.transitionStandard, ",\n box-shadow ")).call(_context, overwrittenVars.transitionStandard),
|
|
270
321
|
outline: 0,
|
|
271
322
|
boxShadow: 'none',
|
|
272
323
|
'&:focus-within': {
|
|
@@ -367,7 +418,7 @@ var optionStyles = function optionStyles(props, theme) {
|
|
|
367
418
|
var overwrittenVars = _objectSpread(_objectSpread({}, designSystem.customProperties), theme);
|
|
368
419
|
|
|
369
420
|
return _objectSpread(_objectSpread({}, base), {}, {
|
|
370
|
-
transition: _concatInstanceProperty__default[
|
|
421
|
+
transition: _concatInstanceProperty__default["default"](_context2 = _concatInstanceProperty__default["default"](_context3 = "border-color ".concat(overwrittenVars.transitionStandard, ",\n background-color ")).call(_context3, overwrittenVars.transitionStandard, ",\n color ")).call(_context2, overwrittenVars.transitionStandard),
|
|
371
422
|
paddingLeft: overwrittenVars.spacingS,
|
|
372
423
|
paddingRight: overwrittenVars.spacingS,
|
|
373
424
|
color: function () {
|
|
@@ -464,7 +515,7 @@ var groupHeadingStyles = function groupHeadingStyles(props, theme) {
|
|
|
464
515
|
textTransform: 'none',
|
|
465
516
|
fontWeight: 'bold',
|
|
466
517
|
margin: "0 ".concat(overwrittenVars.spacingXs),
|
|
467
|
-
padding: _concatInstanceProperty__default[
|
|
518
|
+
padding: _concatInstanceProperty__default["default"](_context4 = "".concat(overwrittenVars.spacingS, " ")).call(_context4, overwrittenVars.spacingXs),
|
|
468
519
|
'&:empty': {
|
|
469
520
|
padding: 0
|
|
470
521
|
}
|
|
@@ -529,8 +580,8 @@ var multiValueLabelStyles = function multiValueLabelStyles(props, theme) {
|
|
|
529
580
|
if (props.isReadOnly) return overwrittenVars[designSystem.designTokens.fontColorForInputWhenReadonly];
|
|
530
581
|
return base.color;
|
|
531
582
|
}(),
|
|
532
|
-
padding: _concatInstanceProperty__default[
|
|
533
|
-
borderRadius: _concatInstanceProperty__default[
|
|
583
|
+
padding: _concatInstanceProperty__default["default"](_context5 = "".concat(overwrittenVars.spacingXs, " ")).call(_context5, overwrittenVars.spacingS),
|
|
584
|
+
borderRadius: _concatInstanceProperty__default["default"](_context6 = "".concat(overwrittenVars.borderRadiusForTag, " 0 0 ")).call(_context6, overwrittenVars.borderRadiusForTag),
|
|
534
585
|
border: "1px ".concat(overwrittenVars[designSystem.designTokens.borderColorForTag], " solid"),
|
|
535
586
|
borderWidth: '1px 0 1px 1px',
|
|
536
587
|
'&:last-child': {
|
|
@@ -550,7 +601,7 @@ var multiValueRemoveStyles = function multiValueRemoveStyles(props, theme) {
|
|
|
550
601
|
return _objectSpread(_objectSpread({}, base), {}, {
|
|
551
602
|
borderColor: overwrittenVars[designSystem.designTokens.borderColorForTag],
|
|
552
603
|
padding: "0 ".concat(overwrittenVars.spacingXs),
|
|
553
|
-
borderRadius: _concatInstanceProperty__default[
|
|
604
|
+
borderRadius: _concatInstanceProperty__default["default"](_context7 = "0 ".concat(overwrittenVars[designSystem.designTokens.borderRadiusForTag], " ")).call(_context7, overwrittenVars[designSystem.designTokens.borderRadiusForTag], " 0"),
|
|
554
605
|
borderStyle: 'solid',
|
|
555
606
|
borderWidth: '1px',
|
|
556
607
|
pointerEvents: state.isDisabled || props.isReadOnly ? 'none' : base.pointerEvents,
|
|
@@ -592,8 +643,8 @@ function createSelectStyles(props, theme) {
|
|
|
592
643
|
};
|
|
593
644
|
}
|
|
594
645
|
|
|
595
|
-
// NOTE: This string will be replaced
|
|
596
|
-
var version =
|
|
646
|
+
// NOTE: This string will be replaced on build time with the package version.
|
|
647
|
+
var version = "12.2.6";
|
|
597
648
|
|
|
598
649
|
exports.ClearIndicator = ClearIndicator$1;
|
|
599
650
|
exports.CustomSelectInputOption = CustomSelectInputOption;
|
|
@@ -10,15 +10,15 @@ import _Object$defineProperty from '@babel/runtime-corejs3/core-js-stable/object
|
|
|
10
10
|
import _defineProperty from '@babel/runtime-corejs3/helpers/esm/defineProperty';
|
|
11
11
|
import _concatInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/concat';
|
|
12
12
|
import { customProperties, designTokens } from '@commercetools-uikit/design-system';
|
|
13
|
-
import _extends from '@babel/runtime-corejs3/helpers/esm/extends';
|
|
14
13
|
import _objectWithoutProperties from '@babel/runtime-corejs3/helpers/esm/objectWithoutProperties';
|
|
15
|
-
import React from 'react';
|
|
16
14
|
import PropTypes from 'prop-types';
|
|
17
|
-
import {
|
|
15
|
+
import { css } from '@emotion/react';
|
|
18
16
|
import { CloseIcon, CloseBoldIcon, CaretDownIcon, SearchIcon } from '@commercetools-uikit/icons';
|
|
17
|
+
import { jsx, jsxs, Fragment } from '@emotion/react/jsx-runtime';
|
|
19
18
|
import omit from 'lodash/omit';
|
|
20
19
|
import AccessibleButton from '@commercetools-uikit/accessible-button';
|
|
21
20
|
import { components } from 'react-select';
|
|
21
|
+
import { cloneElement, Fragment as Fragment$1 } from 'react';
|
|
22
22
|
import _Object$values from '@babel/runtime-corejs3/core-js-stable/object/values';
|
|
23
23
|
import Spacings from '@commercetools-uikit/spacings';
|
|
24
24
|
import Text from '@commercetools-uikit/text';
|
|
@@ -33,6 +33,10 @@ var messages$1 = defineMessages({
|
|
|
33
33
|
|
|
34
34
|
var _excluded$1 = ["ref"];
|
|
35
35
|
|
|
36
|
+
function ownKeys$6(object, enumerableOnly) { var keys = _Object$keys(object); if (_Object$getOwnPropertySymbols) { var symbols = _Object$getOwnPropertySymbols(object); if (enumerableOnly) { symbols = _filterInstanceProperty(symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
37
|
+
|
|
38
|
+
function _objectSpread$6(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { var _context; _forEachInstanceProperty(_context = ownKeys$6(Object(source), true)).call(_context, function (key) { _defineProperty(target, key, source[key]); }); } else if (_Object$getOwnPropertyDescriptors) { _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)); } else { var _context2; _forEachInstanceProperty(_context2 = ownKeys$6(Object(source))).call(_context2, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
39
|
+
|
|
36
40
|
var ClearIndicator = function ClearIndicator(props) {
|
|
37
41
|
var intl = useIntl();
|
|
38
42
|
|
|
@@ -41,15 +45,16 @@ var ClearIndicator = function ClearIndicator(props) {
|
|
|
41
45
|
ref = _props$innerProps.ref,
|
|
42
46
|
restInnerProps = _objectWithoutProperties(_props$innerProps, _excluded$1);
|
|
43
47
|
|
|
44
|
-
return jsx("button",
|
|
48
|
+
return jsx("button", _objectSpread$6(_objectSpread$6({}, restInnerProps), {}, {
|
|
45
49
|
ref: ref,
|
|
46
|
-
css: /*#__PURE__*/css("border:none;cursor:pointer;background:none;box-sizing:border-box;text-decoration:none;:hover svg *{fill:", customProperties.colorWarning, ";}" + (process.env.NODE_ENV === "production" ? "" : ";label:ClearIndicator;")),
|
|
50
|
+
css: /*#__PURE__*/css("border:none;cursor:pointer;background:none;box-sizing:border-box;text-decoration:none;:hover svg *{fill:", customProperties.colorWarning, ";}" + (process.env.NODE_ENV === "production" ? "" : ";label:ClearIndicator;"), process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImNsZWFyLWluZGljYXRvci5qcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFpQmMiLCJmaWxlIjoiY2xlYXItaW5kaWNhdG9yLmpzIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IFByb3BUeXBlcyBmcm9tICdwcm9wLXR5cGVzJztcbmltcG9ydCB7IGNzcyB9IGZyb20gJ0BlbW90aW9uL3JlYWN0JztcbmltcG9ydCB7IHVzZUludGwgfSBmcm9tICdyZWFjdC1pbnRsJztcbmltcG9ydCB7IGN1c3RvbVByb3BlcnRpZXMgYXMgdmFycyB9IGZyb20gJ0Bjb21tZXJjZXRvb2xzLXVpa2l0L2Rlc2lnbi1zeXN0ZW0nO1xuaW1wb3J0IHsgQ2xvc2VJY29uIH0gZnJvbSAnQGNvbW1lcmNldG9vbHMtdWlraXQvaWNvbnMnO1xuaW1wb3J0IG1lc3NhZ2VzIGZyb20gJy4vbWVzc2FnZXMnO1xuXG5jb25zdCBDbGVhckluZGljYXRvciA9IChwcm9wcykgPT4ge1xuICBjb25zdCBpbnRsID0gdXNlSW50bCgpO1xuICBjb25zdCB7XG4gICAgZ2V0U3R5bGVzLFxuICAgIGlubmVyUHJvcHM6IHsgcmVmLCAuLi5yZXN0SW5uZXJQcm9wcyB9LFxuICB9ID0gcHJvcHM7XG4gIHJldHVybiAoXG4gICAgPGJ1dHRvblxuICAgICAgey4uLnJlc3RJbm5lclByb3BzfVxuICAgICAgcmVmPXtyZWZ9XG4gICAgICBjc3M9e2Nzc2BcbiAgICAgICAgYm9yZGVyOiBub25lO1xuICAgICAgICBjdXJzb3I6IHBvaW50ZXI7XG4gICAgICAgIGJhY2tncm91bmQ6IG5vbmU7XG4gICAgICAgIGJveC1zaXppbmc6IGJvcmRlci1ib3g7XG4gICAgICAgIHRleHQtZGVjb3JhdGlvbjogbm9uZTtcbiAgICAgICAgOmhvdmVyIHN2ZyAqIHtcbiAgICAgICAgICBmaWxsOiAke3ZhcnMuY29sb3JXYXJuaW5nfTtcbiAgICAgICAgfVxuICAgICAgYH1cbiAgICAgIHN0eWxlPXtnZXRTdHlsZXMoJ2NsZWFySW5kaWNhdG9yJywgcHJvcHMpfVxuICAgICAgdGl0bGU9e2ludGwuZm9ybWF0TWVzc2FnZShtZXNzYWdlcy5jbGVhckJ1dHRvbkxhYmVsKX1cbiAgICAgIGFyaWEtbGFiZWw9e2ludGwuZm9ybWF0TWVzc2FnZShtZXNzYWdlcy5jbGVhckJ1dHRvbkxhYmVsKX1cbiAgICA+XG4gICAgICA8Q2xvc2VJY29uIGNvbG9yPVwic29saWRcIiBzaXplPVwibWVkaXVtXCIgLz5cbiAgICA8L2J1dHRvbj5cbiAgKTtcbn07XG5cbkNsZWFySW5kaWNhdG9yLmRpc3BsYXlOYW1lID0gJ0NsZWFySW5kaWNhdG9yJztcbkNsZWFySW5kaWNhdG9yLnByb3BUeXBlcyA9IHtcbiAgaW5uZXJQcm9wczogUHJvcFR5cGVzLm9iamVjdCxcbiAgZ2V0U3R5bGVzOiBQcm9wVHlwZXMuZnVuYy5pc1JlcXVpcmVkLFxufTtcblxuZXhwb3J0IGRlZmF1bHQgQ2xlYXJJbmRpY2F0b3I7XG4iXX0= */"),
|
|
47
51
|
style: getStyles('clearIndicator', props),
|
|
48
52
|
title: intl.formatMessage(messages$1.clearButtonLabel),
|
|
49
|
-
"aria-label": intl.formatMessage(messages$1.clearButtonLabel)
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
+
"aria-label": intl.formatMessage(messages$1.clearButtonLabel),
|
|
54
|
+
children: jsx(CloseIcon, {
|
|
55
|
+
color: "solid",
|
|
56
|
+
size: "medium"
|
|
57
|
+
})
|
|
53
58
|
}));
|
|
54
59
|
};
|
|
55
60
|
|
|
@@ -60,6 +65,9 @@ ClearIndicator.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
60
65
|
} : {};
|
|
61
66
|
var ClearIndicator$1 = ClearIndicator;
|
|
62
67
|
|
|
68
|
+
function ownKeys$5(object, enumerableOnly) { var keys = _Object$keys(object); if (_Object$getOwnPropertySymbols) { var symbols = _Object$getOwnPropertySymbols(object); if (enumerableOnly) { symbols = _filterInstanceProperty(symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
69
|
+
|
|
70
|
+
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(_context = ownKeys$5(Object(source), true)).call(_context, function (key) { _defineProperty(target, key, source[key]); }); } else if (_Object$getOwnPropertyDescriptors) { _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)); } else { var _context2; _forEachInstanceProperty(_context2 = ownKeys$5(Object(source))).call(_context2, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
63
71
|
var removeProps = ['onClick', 'onTouchEnd', 'onMouseDown'];
|
|
64
72
|
|
|
65
73
|
var TagRemove = function TagRemove(props) {
|
|
@@ -67,11 +75,13 @@ var TagRemove = function TagRemove(props) {
|
|
|
67
75
|
// we don't want to spread the removeProp event handlers
|
|
68
76
|
|
|
69
77
|
var innerProps = isDisabled ? omit(props.innerProps, removeProps) : props.innerProps;
|
|
70
|
-
return jsx(AccessibleButton,
|
|
78
|
+
return jsx(AccessibleButton, _objectSpread$5(_objectSpread$5({
|
|
71
79
|
label: "Remove"
|
|
72
|
-
}, innerProps),
|
|
73
|
-
|
|
74
|
-
|
|
80
|
+
}, innerProps), {}, {
|
|
81
|
+
children: jsx(CloseBoldIcon, {
|
|
82
|
+
color: isDisabled ? 'neutral60' : 'solid',
|
|
83
|
+
size: "medium"
|
|
84
|
+
})
|
|
75
85
|
}));
|
|
76
86
|
};
|
|
77
87
|
|
|
@@ -85,10 +95,16 @@ TagRemove.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
85
95
|
} : {};
|
|
86
96
|
var TagRemove$1 = TagRemove;
|
|
87
97
|
|
|
98
|
+
function ownKeys$4(object, enumerableOnly) { var keys = _Object$keys(object); if (_Object$getOwnPropertySymbols) { var symbols = _Object$getOwnPropertySymbols(object); if (enumerableOnly) { symbols = _filterInstanceProperty(symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
99
|
+
|
|
100
|
+
function _objectSpread$4(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { var _context; _forEachInstanceProperty(_context = ownKeys$4(Object(source), true)).call(_context, function (key) { _defineProperty(target, key, source[key]); }); } else if (_Object$getOwnPropertyDescriptors) { _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)); } else { var _context2; _forEachInstanceProperty(_context2 = ownKeys$4(Object(source))).call(_context2, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
101
|
+
|
|
88
102
|
var DropdownIndicator = function DropdownIndicator(props) {
|
|
89
|
-
return jsx(components.DropdownIndicator, props,
|
|
90
|
-
|
|
91
|
-
|
|
103
|
+
return jsx(components.DropdownIndicator, _objectSpread$4(_objectSpread$4({}, props), {}, {
|
|
104
|
+
children: jsx(CaretDownIcon, {
|
|
105
|
+
color: props.isDisabled ? 'neutral60' : undefined,
|
|
106
|
+
size: "small"
|
|
107
|
+
})
|
|
92
108
|
}));
|
|
93
109
|
};
|
|
94
110
|
|
|
@@ -98,10 +114,16 @@ DropdownIndicator.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
98
114
|
} : {};
|
|
99
115
|
var DropdownIndicator$1 = DropdownIndicator;
|
|
100
116
|
|
|
117
|
+
function ownKeys$3(object, enumerableOnly) { var keys = _Object$keys(object); if (_Object$getOwnPropertySymbols) { var symbols = _Object$getOwnPropertySymbols(object); if (enumerableOnly) { symbols = _filterInstanceProperty(symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
118
|
+
|
|
119
|
+
function _objectSpread$3(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { var _context; _forEachInstanceProperty(_context = ownKeys$3(Object(source), true)).call(_context, function (key) { _defineProperty(target, key, source[key]); }); } else if (_Object$getOwnPropertyDescriptors) { _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)); } else { var _context2; _forEachInstanceProperty(_context2 = ownKeys$3(Object(source))).call(_context2, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
120
|
+
|
|
101
121
|
var SearchIconDropdownIndicator = function SearchIconDropdownIndicator(props) {
|
|
102
|
-
return jsx(components.DropdownIndicator, props,
|
|
103
|
-
|
|
104
|
-
|
|
122
|
+
return jsx(components.DropdownIndicator, _objectSpread$3(_objectSpread$3({}, props), {}, {
|
|
123
|
+
children: jsx(SearchIcon, {
|
|
124
|
+
color: 'neutral60',
|
|
125
|
+
size: "big"
|
|
126
|
+
})
|
|
105
127
|
}));
|
|
106
128
|
};
|
|
107
129
|
|
|
@@ -110,10 +132,14 @@ var SearchIconDropdownIndicator$1 = SearchIconDropdownIndicator;
|
|
|
110
132
|
|
|
111
133
|
var _excluded = ["children"];
|
|
112
134
|
|
|
135
|
+
function ownKeys$2(object, enumerableOnly) { var keys = _Object$keys(object); if (_Object$getOwnPropertySymbols) { var symbols = _Object$getOwnPropertySymbols(object); if (enumerableOnly) { symbols = _filterInstanceProperty(symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
136
|
+
|
|
137
|
+
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(_context = ownKeys$2(Object(source), true)).call(_context, function (key) { _defineProperty(target, key, source[key]); }); } else if (_Object$getOwnPropertyDescriptors) { _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)); } else { var _context2; _forEachInstanceProperty(_context2 = ownKeys$2(Object(source))).call(_context2, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
138
|
+
|
|
113
139
|
var getDefaultComponent = function getDefaultComponent(type) {
|
|
114
140
|
if (type === 'singleValue') return components.SingleValue;
|
|
115
141
|
if (type === 'placeholder') return components.Placeholder;
|
|
116
|
-
return
|
|
142
|
+
return Fragment$1;
|
|
117
143
|
};
|
|
118
144
|
|
|
119
145
|
var WrapperWithIcon = function WrapperWithIcon(_ref) {
|
|
@@ -121,14 +147,19 @@ var WrapperWithIcon = function WrapperWithIcon(_ref) {
|
|
|
121
147
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
122
148
|
|
|
123
149
|
var Component = getDefaultComponent(props.type);
|
|
124
|
-
return
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
150
|
+
return jsxs(Fragment, {
|
|
151
|
+
children: [props.selectProps.iconLeft && /*#__PURE__*/cloneElement(props.selectProps.iconLeft, {
|
|
152
|
+
size: 'big'
|
|
153
|
+
}), jsx("span", {
|
|
154
|
+
// react-select uses absolute positioning for the SingleValue/Placeholder
|
|
155
|
+
// the icon has a fixed size of 24px (== SpacingsXl), therefore we can use a fixed margin
|
|
156
|
+
// spacingsXs is the margin between the icon and value
|
|
157
|
+
css: /*#__PURE__*/css("margin-left:", customProperties.spacingXl + customProperties.spacingXs, ";" + (process.env.NODE_ENV === "production" ? "" : ";label:WrapperWithIcon;"), process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndyYXBwZXItd2l0aC1pY29uLmpzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQXlCZ0IiLCJmaWxlIjoid3JhcHBlci13aXRoLWljb24uanMiLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgeyBGcmFnbWVudCwgY2xvbmVFbGVtZW50IH0gZnJvbSAncmVhY3QnO1xuaW1wb3J0IFByb3BUeXBlcyBmcm9tICdwcm9wLXR5cGVzJztcbmltcG9ydCB7IGNzcyB9IGZyb20gJ0BlbW90aW9uL3JlYWN0JztcbmltcG9ydCB7IGN1c3RvbVByb3BlcnRpZXMgfSBmcm9tICdAY29tbWVyY2V0b29scy11aWtpdC9kZXNpZ24tc3lzdGVtJztcbmltcG9ydCB7IGNvbXBvbmVudHMgYXMgZGVmYXVsdENvbXBvbmVudHMgfSBmcm9tICdyZWFjdC1zZWxlY3QnO1xuXG5jb25zdCBnZXREZWZhdWx0Q29tcG9uZW50ID0gKHR5cGUpID0+IHtcbiAgaWYgKHR5cGUgPT09ICdzaW5nbGVWYWx1ZScpIHJldHVybiBkZWZhdWx0Q29tcG9uZW50cy5TaW5nbGVWYWx1ZTtcbiAgaWYgKHR5cGUgPT09ICdwbGFjZWhvbGRlcicpIHJldHVybiBkZWZhdWx0Q29tcG9uZW50cy5QbGFjZWhvbGRlcjtcbiAgcmV0dXJuIEZyYWdtZW50O1xufTtcblxuY29uc3QgV3JhcHBlcldpdGhJY29uID0gKHsgY2hpbGRyZW4sIC4uLnByb3BzIH0pID0+IHtcbiAgY29uc3QgQ29tcG9uZW50ID0gZ2V0RGVmYXVsdENvbXBvbmVudChwcm9wcy50eXBlKTtcblxuICByZXR1cm4gKFxuICAgIDw+XG4gICAgICB7cHJvcHMuc2VsZWN0UHJvcHMuaWNvbkxlZnQgJiZcbiAgICAgICAgY2xvbmVFbGVtZW50KHByb3BzLnNlbGVjdFByb3BzLmljb25MZWZ0LCB7XG4gICAgICAgICAgc2l6ZTogJ2JpZycsXG4gICAgICAgIH0pfVxuICAgICAgPHNwYW5cbiAgICAgICAgLy8gcmVhY3Qtc2VsZWN0IHVzZXMgYWJzb2x1dGUgcG9zaXRpb25pbmcgZm9yIHRoZSBTaW5nbGVWYWx1ZS9QbGFjZWhvbGRlclxuICAgICAgICAvLyB0aGUgaWNvbiBoYXMgYSBmaXhlZCBzaXplIG9mIDI0cHggKD09IFNwYWNpbmdzWGwpLCB0aGVyZWZvcmUgd2UgY2FuIHVzZSBhIGZpeGVkIG1hcmdpblxuICAgICAgICAvLyBzcGFjaW5nc1hzIGlzIHRoZSBtYXJnaW4gYmV0d2VlbiB0aGUgaWNvbiBhbmQgdmFsdWVcbiAgICAgICAgY3NzPXtjc3NgXG4gICAgICAgICAgbWFyZ2luLWxlZnQ6ICR7Y3VzdG9tUHJvcGVydGllcy5zcGFjaW5nWGwgK1xuICAgICAgICAgIGN1c3RvbVByb3BlcnRpZXMuc3BhY2luZ1hzfTtcbiAgICAgICAgYH1cbiAgICAgID5cbiAgICAgICAgPENvbXBvbmVudCB7Li4ucHJvcHN9PntjaGlsZHJlbn08L0NvbXBvbmVudD5cbiAgICAgIDwvc3Bhbj5cbiAgICA8Lz5cbiAgKTtcbn07XG5XcmFwcGVyV2l0aEljb24ucHJvcFR5cGVzID0ge1xuICBjaGlsZHJlbjogUHJvcFR5cGVzLm5vZGUsXG4gIHR5cGU6IFByb3BUeXBlcy5vbmVPZihbJ3NpbmdsZVZhbHVlJywgJ3BsYWNlaG9sZGVyJ10pLFxuICBzZWxlY3RQcm9wczogUHJvcFR5cGVzLnNoYXBlKHtcbiAgICBpY29uTGVmdDogUHJvcFR5cGVzLm5vZGUsXG4gIH0pLFxufTtcbldyYXBwZXJXaXRoSWNvbi5kaXNwbGF5TmFtZSA9ICdXcmFwcGVyV2l0aEljb24nO1xuXG5leHBvcnQgZGVmYXVsdCBXcmFwcGVyV2l0aEljb247XG5cbi8qIGVzbGludC1kaXNhYmxlIHJlYWN0L2Rpc3BsYXktbmFtZSAqL1xuY29uc3QgY3VzdG9tQ29tcG9uZW50cyA9IHtcbiAgU2luZ2xlVmFsdWU6IChwcm9wcykgPT4gPFdyYXBwZXJXaXRoSWNvbiB7Li4ucHJvcHN9IHR5cGU9XCJzaW5nbGVWYWx1ZVwiIC8+LFxuICBQbGFjZWhvbGRlcjogKHByb3BzKSA9PiA8V3JhcHBlcldpdGhJY29uIHsuLi5wcm9wc30gdHlwZT1cInBsYWNlaG9sZGVyXCIgLz4sXG59O1xuLyogZXNsaW50LWVuYWJsZSByZWFjdC9kaXNwbGF5LW5hbWUgKi9cblxuZXhwb3J0IHsgY3VzdG9tQ29tcG9uZW50cyB9O1xuIl19 */"),
|
|
158
|
+
children: jsx(Component, _objectSpread$2(_objectSpread$2({}, props), {}, {
|
|
159
|
+
children: children
|
|
160
|
+
}))
|
|
161
|
+
})]
|
|
162
|
+
});
|
|
132
163
|
};
|
|
133
164
|
|
|
134
165
|
WrapperWithIcon.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
@@ -144,12 +175,12 @@ var WrapperWithIcon$1 = WrapperWithIcon;
|
|
|
144
175
|
|
|
145
176
|
var customComponents = {
|
|
146
177
|
SingleValue: function SingleValue(props) {
|
|
147
|
-
return jsx(WrapperWithIcon,
|
|
178
|
+
return jsx(WrapperWithIcon, _objectSpread$2(_objectSpread$2({}, props), {}, {
|
|
148
179
|
type: "singleValue"
|
|
149
180
|
}));
|
|
150
181
|
},
|
|
151
182
|
Placeholder: function Placeholder(props) {
|
|
152
|
-
return jsx(WrapperWithIcon,
|
|
183
|
+
return jsx(WrapperWithIcon, _objectSpread$2(_objectSpread$2({}, props), {}, {
|
|
153
184
|
type: "placeholder"
|
|
154
185
|
}));
|
|
155
186
|
}
|
|
@@ -162,14 +193,25 @@ var SELECT_DROPDOWN_OPTION_TYPES = {
|
|
|
162
193
|
MULTIPLE_PROPERTIES: 'multiple-properties'
|
|
163
194
|
};
|
|
164
195
|
|
|
196
|
+
function ownKeys$1(object, enumerableOnly) { var keys = _Object$keys(object); if (_Object$getOwnPropertySymbols) { var symbols = _Object$getOwnPropertySymbols(object); if (enumerableOnly) { symbols = _filterInstanceProperty(symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
197
|
+
|
|
198
|
+
function _objectSpread$1(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { var _context; _forEachInstanceProperty(_context = ownKeys$1(Object(source), true)).call(_context, function (key) { _defineProperty(target, key, source[key]); }); } else if (_Object$getOwnPropertyDescriptors) { _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)); } else { var _context2; _forEachInstanceProperty(_context2 = ownKeys$1(Object(source))).call(_context2, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
165
199
|
var MultiplePropertiesSelectInputOption = function MultiplePropertiesSelectInputOption(props) {
|
|
166
200
|
var data = props.data;
|
|
167
201
|
var noValueFallback = props.noValueFallback || NO_VALUE_FALLBACK;
|
|
168
|
-
return jsx(components.Option, props,
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
202
|
+
return jsx(components.Option, _objectSpread$1(_objectSpread$1({}, props), {}, {
|
|
203
|
+
children: jsxs(Spacings.Stack, {
|
|
204
|
+
scale: "xs",
|
|
205
|
+
children: [jsx(Text.Detail, {
|
|
206
|
+
isBold: true,
|
|
207
|
+
children: data.label || noValueFallback
|
|
208
|
+
}), jsxs(Text.Detail, {
|
|
209
|
+
children: ["Key: ", data.key || noValueFallback]
|
|
210
|
+
}), jsxs(Text.Detail, {
|
|
211
|
+
children: ["ID: ", data.id || noValueFallback]
|
|
212
|
+
})]
|
|
213
|
+
})
|
|
214
|
+
}));
|
|
173
215
|
};
|
|
174
216
|
MultiplePropertiesSelectInputOption.displayName = 'MultiplePropertiesSelectInputOption';
|
|
175
217
|
MultiplePropertiesSelectInputOption.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
@@ -183,11 +225,17 @@ MultiplePropertiesSelectInputOption.propTypes = process.env.NODE_ENV !== "produc
|
|
|
183
225
|
var DoublePropertySelectInputOption = function DoublePropertySelectInputOption(props) {
|
|
184
226
|
var data = props.data;
|
|
185
227
|
var noValueFallback = props.noValueFallback || NO_VALUE_FALLBACK;
|
|
186
|
-
return jsx(components.Option, props,
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
228
|
+
return jsx(components.Option, _objectSpread$1(_objectSpread$1({}, props), {}, {
|
|
229
|
+
children: jsxs(Spacings.Stack, {
|
|
230
|
+
scale: "xs",
|
|
231
|
+
children: [jsx(Text.Detail, {
|
|
232
|
+
isBold: true,
|
|
233
|
+
children: data.label || noValueFallback
|
|
234
|
+
}), jsxs(Text.Detail, {
|
|
235
|
+
children: ["Key: ", data.key || noValueFallback]
|
|
236
|
+
})]
|
|
237
|
+
})
|
|
238
|
+
}));
|
|
191
239
|
};
|
|
192
240
|
DoublePropertySelectInputOption.displayName = 'DoublePropertySelectInputOption';
|
|
193
241
|
DoublePropertySelectInputOption.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
@@ -202,17 +250,21 @@ var CustomSelectInputOption = function CustomSelectInputOption(props) {
|
|
|
202
250
|
|
|
203
251
|
switch (props.optionType) {
|
|
204
252
|
case SELECT_DROPDOWN_OPTION_TYPES.MULTIPLE_PROPERTIES:
|
|
205
|
-
return jsx(MultiplePropertiesSelectInputOption,
|
|
253
|
+
return jsx(MultiplePropertiesSelectInputOption, _objectSpread$1(_objectSpread$1({}, props.optionInnerProps), {}, {
|
|
206
254
|
noValueFallback: noValueFallback
|
|
207
255
|
}));
|
|
208
256
|
|
|
209
257
|
case SELECT_DROPDOWN_OPTION_TYPES.DOUBLE_PROPERTY:
|
|
210
|
-
return jsx(DoublePropertySelectInputOption,
|
|
258
|
+
return jsx(DoublePropertySelectInputOption, _objectSpread$1(_objectSpread$1({}, props.optionInnerProps), {}, {
|
|
211
259
|
noValueFallback: noValueFallback
|
|
212
260
|
}));
|
|
213
261
|
|
|
214
262
|
default:
|
|
215
|
-
return jsx(components.Option,
|
|
263
|
+
return jsx(components.Option, _objectSpread$1(_objectSpread$1({}, props.optionInnerProps), {}, {
|
|
264
|
+
children: jsx(Text.Detail, {
|
|
265
|
+
children: props.optionInnerProps.data.label || noValueFallback
|
|
266
|
+
})
|
|
267
|
+
}));
|
|
216
268
|
}
|
|
217
269
|
};
|
|
218
270
|
CustomSelectInputOption.displayName = 'CustomSelectInputOption';
|
|
@@ -611,7 +663,7 @@ function createSelectStyles(props, theme) {
|
|
|
611
663
|
};
|
|
612
664
|
}
|
|
613
665
|
|
|
614
|
-
// NOTE: This string will be replaced
|
|
615
|
-
var version =
|
|
666
|
+
// NOTE: This string will be replaced on build time with the package version.
|
|
667
|
+
var version = "12.2.6";
|
|
616
668
|
|
|
617
669
|
export { ClearIndicator$1 as ClearIndicator, CustomSelectInputOption, DoublePropertySelectInputOption, DropdownIndicator$1 as DropdownIndicator, MultiplePropertiesSelectInputOption, SELECT_DROPDOWN_OPTION_TYPES, SearchIconDropdownIndicator$1 as SearchIconDropdownIndicator, TagRemove$1 as TagRemove, WrapperWithIcon$1 as ValueWrapperWithIcon, createSelectStyles, customComponents as customComponentsWithIcons, messages, version };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@commercetools-uikit/select-utils",
|
|
3
3
|
"description": "Utilities for working with select components.",
|
|
4
|
-
"version": "12.2.
|
|
4
|
+
"version": "12.2.6",
|
|
5
5
|
"bugs": "https://github.com/commercetools/ui-kit/issues",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -11,7 +11,6 @@
|
|
|
11
11
|
"homepage": "https://uikit.commercetools.com",
|
|
12
12
|
"keywords": ["javascript", "design system", "react", "uikit"],
|
|
13
13
|
"license": "MIT",
|
|
14
|
-
"private": false,
|
|
15
14
|
"publishConfig": {
|
|
16
15
|
"access": "public"
|
|
17
16
|
},
|
|
@@ -19,18 +18,15 @@
|
|
|
19
18
|
"main": "dist/commercetools-uikit-select-utils.cjs.js",
|
|
20
19
|
"module": "dist/commercetools-uikit-select-utils.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/accessible-button": "12.2.
|
|
29
|
-
"@commercetools-uikit/design-system": "12.2.
|
|
30
|
-
"@commercetools-uikit/icons": "12.2.
|
|
31
|
-
"@commercetools-uikit/spacings": "12.2.
|
|
32
|
-
"@commercetools-uikit/text": "12.2.
|
|
33
|
-
"@commercetools-uikit/utils": "12.2.
|
|
22
|
+
"@babel/runtime": "7.16.3",
|
|
23
|
+
"@babel/runtime-corejs3": "7.16.3",
|
|
24
|
+
"@commercetools-uikit/accessible-button": "12.2.5",
|
|
25
|
+
"@commercetools-uikit/design-system": "12.2.5",
|
|
26
|
+
"@commercetools-uikit/icons": "12.2.6",
|
|
27
|
+
"@commercetools-uikit/spacings": "12.2.5",
|
|
28
|
+
"@commercetools-uikit/text": "12.2.5",
|
|
29
|
+
"@commercetools-uikit/utils": "12.2.5",
|
|
34
30
|
"@emotion/react": "^11.4.0",
|
|
35
31
|
"@emotion/styled": "^11.3.0",
|
|
36
32
|
"lodash": "4.17.21",
|
|
@@ -39,7 +35,7 @@
|
|
|
39
35
|
},
|
|
40
36
|
"devDependencies": {
|
|
41
37
|
"react": "17.0.2",
|
|
42
|
-
"react-intl": "5.
|
|
38
|
+
"react-intl": "5.21.2"
|
|
43
39
|
},
|
|
44
40
|
"peerDependencies": {
|
|
45
41
|
"react": "17.x",
|