@commercetools-uikit/select-input 15.9.0 → 15.11.0
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.
|
@@ -22,6 +22,7 @@ var Select = require('react-select');
|
|
|
22
22
|
var Constraints = require('@commercetools-uikit/constraints');
|
|
23
23
|
var selectUtils = require('@commercetools-uikit/select-utils');
|
|
24
24
|
var utils = require('@commercetools-uikit/utils');
|
|
25
|
+
var designSystem = require('@commercetools-uikit/design-system');
|
|
25
26
|
var jsxRuntime = require('@emotion/react/jsx-runtime');
|
|
26
27
|
|
|
27
28
|
function _interopDefault (e) { return e && e.__esModule ? e : { 'default': e }; }
|
|
@@ -60,6 +61,10 @@ var SelectInput = function SelectInput(props) {
|
|
|
60
61
|
var _context, _context2;
|
|
61
62
|
|
|
62
63
|
var intl = reactIntl.useIntl();
|
|
64
|
+
|
|
65
|
+
var _useTheme = designSystem.useTheme(),
|
|
66
|
+
isNewTheme = _useTheme.isNewTheme;
|
|
67
|
+
|
|
63
68
|
var placeholder = props.placeholder || intl.formatMessage(selectUtils.messages.placeholder); // Options can be grouped as
|
|
64
69
|
// const colourOptions = [{ value: 'green', label: 'Green' }];
|
|
65
70
|
// const flavourOptions = [{ value: 'vanilla', label: 'Vanilla' }];
|
|
@@ -108,7 +113,8 @@ var SelectInput = function SelectInput(props) {
|
|
|
108
113
|
isReadOnly: props.isReadOnly,
|
|
109
114
|
iconLeft: props.iconLeft,
|
|
110
115
|
isMulti: props.isMulti,
|
|
111
|
-
hasValue: !isEmpty__default["default"](selectedOptions)
|
|
116
|
+
hasValue: !isEmpty__default["default"](selectedOptions),
|
|
117
|
+
isNewTheme: isNewTheme
|
|
112
118
|
}),
|
|
113
119
|
filterOption: props.filterOption // react-select uses "id" (for the container) and "inputId" (for the input),
|
|
114
120
|
// but we use "id" (for the input) and "containerId" (for the container)
|
|
@@ -258,7 +264,7 @@ SelectInput.ValueContainer = Select.components.ValueContainer;
|
|
|
258
264
|
var SelectInput$1 = SelectInput;
|
|
259
265
|
|
|
260
266
|
// NOTE: This string will be replaced on build time with the package version.
|
|
261
|
-
var version = "15.
|
|
267
|
+
var version = "15.11.0";
|
|
262
268
|
|
|
263
269
|
exports["default"] = SelectInput$1;
|
|
264
270
|
exports.version = version;
|
|
@@ -22,6 +22,7 @@ var Select = require('react-select');
|
|
|
22
22
|
var Constraints = require('@commercetools-uikit/constraints');
|
|
23
23
|
var selectUtils = require('@commercetools-uikit/select-utils');
|
|
24
24
|
var utils = require('@commercetools-uikit/utils');
|
|
25
|
+
var designSystem = require('@commercetools-uikit/design-system');
|
|
25
26
|
var jsxRuntime = require('@emotion/react/jsx-runtime');
|
|
26
27
|
|
|
27
28
|
function _interopDefault (e) { return e && e.__esModule ? e : { 'default': e }; }
|
|
@@ -59,6 +60,10 @@ var SelectInput = function SelectInput(props) {
|
|
|
59
60
|
var _context, _context2;
|
|
60
61
|
|
|
61
62
|
var intl = reactIntl.useIntl();
|
|
63
|
+
|
|
64
|
+
var _useTheme = designSystem.useTheme(),
|
|
65
|
+
isNewTheme = _useTheme.isNewTheme;
|
|
66
|
+
|
|
62
67
|
var placeholder = props.placeholder || intl.formatMessage(selectUtils.messages.placeholder); // Options can be grouped as
|
|
63
68
|
// const colourOptions = [{ value: 'green', label: 'Green' }];
|
|
64
69
|
// const flavourOptions = [{ value: 'vanilla', label: 'Vanilla' }];
|
|
@@ -107,7 +112,8 @@ var SelectInput = function SelectInput(props) {
|
|
|
107
112
|
isReadOnly: props.isReadOnly,
|
|
108
113
|
iconLeft: props.iconLeft,
|
|
109
114
|
isMulti: props.isMulti,
|
|
110
|
-
hasValue: !isEmpty__default["default"](selectedOptions)
|
|
115
|
+
hasValue: !isEmpty__default["default"](selectedOptions),
|
|
116
|
+
isNewTheme: isNewTheme
|
|
111
117
|
}),
|
|
112
118
|
filterOption: props.filterOption // react-select uses "id" (for the container) and "inputId" (for the input),
|
|
113
119
|
// but we use "id" (for the input) and "containerId" (for the container)
|
|
@@ -237,7 +243,7 @@ SelectInput.ValueContainer = Select.components.ValueContainer;
|
|
|
237
243
|
var SelectInput$1 = SelectInput;
|
|
238
244
|
|
|
239
245
|
// NOTE: This string will be replaced on build time with the package version.
|
|
240
|
-
var version = "15.
|
|
246
|
+
var version = "15.11.0";
|
|
241
247
|
|
|
242
248
|
exports["default"] = SelectInput$1;
|
|
243
249
|
exports.version = version;
|
|
@@ -18,6 +18,7 @@ import Select, { components } from 'react-select';
|
|
|
18
18
|
import Constraints from '@commercetools-uikit/constraints';
|
|
19
19
|
import { messages, customComponentsWithIcons, createSelectStyles, DropdownIndicator, ClearIndicator, TagRemove } from '@commercetools-uikit/select-utils';
|
|
20
20
|
import { filterDataAttributes } from '@commercetools-uikit/utils';
|
|
21
|
+
import { useTheme } from '@commercetools-uikit/design-system';
|
|
21
22
|
import { jsx } from '@emotion/react/jsx-runtime';
|
|
22
23
|
|
|
23
24
|
function ownKeys(object, enumerableOnly) { var keys = _Object$keys(object); if (_Object$getOwnPropertySymbols) { var symbols = _Object$getOwnPropertySymbols(object); enumerableOnly && (symbols = _filterInstanceProperty(symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
@@ -37,6 +38,10 @@ var SelectInput = function SelectInput(props) {
|
|
|
37
38
|
var _context, _context2;
|
|
38
39
|
|
|
39
40
|
var intl = useIntl();
|
|
41
|
+
|
|
42
|
+
var _useTheme = useTheme(),
|
|
43
|
+
isNewTheme = _useTheme.isNewTheme;
|
|
44
|
+
|
|
40
45
|
var placeholder = props.placeholder || intl.formatMessage(messages.placeholder); // Options can be grouped as
|
|
41
46
|
// const colourOptions = [{ value: 'green', label: 'Green' }];
|
|
42
47
|
// const flavourOptions = [{ value: 'vanilla', label: 'Vanilla' }];
|
|
@@ -85,7 +90,8 @@ var SelectInput = function SelectInput(props) {
|
|
|
85
90
|
isReadOnly: props.isReadOnly,
|
|
86
91
|
iconLeft: props.iconLeft,
|
|
87
92
|
isMulti: props.isMulti,
|
|
88
|
-
hasValue: !isEmpty(selectedOptions)
|
|
93
|
+
hasValue: !isEmpty(selectedOptions),
|
|
94
|
+
isNewTheme: isNewTheme
|
|
89
95
|
}),
|
|
90
96
|
filterOption: props.filterOption // react-select uses "id" (for the container) and "inputId" (for the input),
|
|
91
97
|
// but we use "id" (for the input) and "containerId" (for the container)
|
|
@@ -235,6 +241,6 @@ SelectInput.ValueContainer = components.ValueContainer;
|
|
|
235
241
|
var SelectInput$1 = SelectInput;
|
|
236
242
|
|
|
237
243
|
// NOTE: This string will be replaced on build time with the package version.
|
|
238
|
-
var version = "15.
|
|
244
|
+
var version = "15.11.0";
|
|
239
245
|
|
|
240
246
|
export { SelectInput$1 as default, version };
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import type { ReactNode } from 'react';
|
|
2
2
|
import { type Props as ReactSelectProps } from 'react-select';
|
|
3
|
-
|
|
3
|
+
type TOption = {
|
|
4
4
|
value: string;
|
|
5
5
|
label?: ReactNode;
|
|
6
6
|
};
|
|
7
|
-
|
|
7
|
+
type TOptionObject = {
|
|
8
8
|
options: TOption[];
|
|
9
9
|
};
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
type TOptions = TOption[] | TOptionObject[];
|
|
11
|
+
type TCustomEvent = {
|
|
12
12
|
target: {
|
|
13
13
|
id?: ReactSelectProps['inputId'];
|
|
14
14
|
name?: ReactSelectProps['name'];
|
|
@@ -16,7 +16,7 @@ declare type TCustomEvent = {
|
|
|
16
16
|
};
|
|
17
17
|
persist: () => void;
|
|
18
18
|
};
|
|
19
|
-
|
|
19
|
+
type TSelectInputProps = {
|
|
20
20
|
horizontalConstraint?: 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 'scale' | 'auto';
|
|
21
21
|
hasError?: boolean;
|
|
22
22
|
isReadOnly?: boolean;
|
|
@@ -95,7 +95,7 @@ declare const SelectInput: {
|
|
|
95
95
|
};
|
|
96
96
|
Menu: <Option_9, IsMulti_9 extends boolean, Group_9 extends import("react-select").GroupBase<Option_9>>(props: import("react-select").MenuProps<Option_9, IsMulti_9, Group_9>) => import("@emotion/react").jsx.JSX.Element;
|
|
97
97
|
MenuList: <Option_10, IsMulti_10 extends boolean, Group_10 extends import("react-select").GroupBase<Option_10>>(props: import("react-select").MenuListProps<Option_10, IsMulti_10, Group_10>) => import("@emotion/react").jsx.JSX.Element;
|
|
98
|
-
MenuPortal: <Option_11, IsMulti_11 extends boolean, Group_11 extends import("react-select").GroupBase<Option_11>>(
|
|
98
|
+
MenuPortal: <Option_11, IsMulti_11 extends boolean, Group_11 extends import("react-select").GroupBase<Option_11>>(props: import("react-select/dist/declarations/src/components/Menu").MenuPortalProps<Option_11, IsMulti_11, Group_11>) => import("@emotion/react").jsx.JSX.Element | null;
|
|
99
99
|
MultiValue: <Option_14, IsMulti_14 extends boolean, Group_14 extends import("react-select").GroupBase<Option_14>>(props: import("react-select").MultiValueProps<Option_14, IsMulti_14, Group_14>) => import("@emotion/react").jsx.JSX.Element;
|
|
100
100
|
MultiValueContainer: <Option_15, IsMulti_15 extends boolean, Group_15 extends import("react-select").GroupBase<Option_15>>({ children, innerProps, }: import("react-select").MultiValueGenericProps<Option_15, IsMulti_15, Group_15>) => import("@emotion/react").jsx.JSX.Element;
|
|
101
101
|
MultiValueLabel: <Option_15_1, IsMulti_15_1 extends boolean, Group_15_1 extends import("react-select").GroupBase<Option_15_1>>({ children, innerProps, }: import("react-select").MultiValueGenericProps<Option_15_1, IsMulti_15_1, Group_15_1>) => import("@emotion/react").jsx.JSX.Element;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@commercetools-uikit/select-input",
|
|
3
3
|
"description": "An input component getting a selection from the user.",
|
|
4
|
-
"version": "15.
|
|
4
|
+
"version": "15.11.0",
|
|
5
5
|
"bugs": "https://github.com/commercetools/ui-kit/issues",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -21,17 +21,17 @@
|
|
|
21
21
|
"dependencies": {
|
|
22
22
|
"@babel/runtime": "^7.19.0",
|
|
23
23
|
"@babel/runtime-corejs3": "^7.19.1",
|
|
24
|
-
"@commercetools-uikit/constraints": "15.
|
|
25
|
-
"@commercetools-uikit/design-system": "15.
|
|
26
|
-
"@commercetools-uikit/icons": "15.
|
|
27
|
-
"@commercetools-uikit/select-utils": "15.
|
|
28
|
-
"@commercetools-uikit/utils": "15.
|
|
24
|
+
"@commercetools-uikit/constraints": "15.11.0",
|
|
25
|
+
"@commercetools-uikit/design-system": "15.11.0",
|
|
26
|
+
"@commercetools-uikit/icons": "15.11.0",
|
|
27
|
+
"@commercetools-uikit/select-utils": "15.11.0",
|
|
28
|
+
"@commercetools-uikit/utils": "15.11.0",
|
|
29
29
|
"@emotion/is-prop-valid": "1.2.0",
|
|
30
30
|
"@emotion/react": "^11.4.0",
|
|
31
31
|
"@emotion/styled": "^11.3.0",
|
|
32
32
|
"lodash": "4.17.21",
|
|
33
33
|
"prop-types": "15.8.1",
|
|
34
|
-
"react-select": "5.
|
|
34
|
+
"react-select": "5.7.0"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
37
|
"react": "17.0.2",
|