@commercetools-uikit/async-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.
|
@@ -20,6 +20,7 @@ var utils = require('@commercetools-uikit/utils');
|
|
|
20
20
|
var Constraints = require('@commercetools-uikit/constraints');
|
|
21
21
|
var LoadingSpinner = require('@commercetools-uikit/loading-spinner');
|
|
22
22
|
var selectUtils = require('@commercetools-uikit/select-utils');
|
|
23
|
+
var designSystem = require('@commercetools-uikit/design-system');
|
|
23
24
|
var jsxRuntime = require('@emotion/react/jsx-runtime');
|
|
24
25
|
|
|
25
26
|
function _interopDefault (e) { return e && e.__esModule ? e : { 'default': e }; }
|
|
@@ -66,6 +67,9 @@ var defaultProps = {
|
|
|
66
67
|
var AsyncSelectInput = function AsyncSelectInput(props) {
|
|
67
68
|
var intl = reactIntl.useIntl();
|
|
68
69
|
|
|
70
|
+
var _useTheme = designSystem.useTheme(),
|
|
71
|
+
isNewTheme = _useTheme.isNewTheme;
|
|
72
|
+
|
|
69
73
|
if (!props.isReadOnly) {
|
|
70
74
|
process.env.NODE_ENV !== "production" ? utils.warning(typeof props.onChange === 'function', 'AsyncSelectInput: `onChange` is required when input is not read only.') : void 0;
|
|
71
75
|
}
|
|
@@ -107,7 +111,8 @@ var AsyncSelectInput = function AsyncSelectInput(props) {
|
|
|
107
111
|
isReadOnly: props.isReadOnly,
|
|
108
112
|
iconLeft: props.iconLeft,
|
|
109
113
|
isMulti: props.isMulti,
|
|
110
|
-
hasValue: !isEmpty__default["default"](props.value)
|
|
114
|
+
hasValue: !isEmpty__default["default"](props.value),
|
|
115
|
+
isNewTheme: isNewTheme
|
|
111
116
|
}),
|
|
112
117
|
filterOption: props.filterOption // react-select uses "id" (for the container) and "inputId" (for the input),
|
|
113
118
|
// but we use "id" (for the input) and "containerId" (for the container)
|
|
@@ -252,7 +257,7 @@ AsyncSelectInput.ValueContainer = reactSelect.components.ValueContainer;
|
|
|
252
257
|
var AsyncSelectInput$1 = AsyncSelectInput;
|
|
253
258
|
|
|
254
259
|
// NOTE: This string will be replaced on build time with the package version.
|
|
255
|
-
var version = "15.
|
|
260
|
+
var version = "15.11.0";
|
|
256
261
|
|
|
257
262
|
exports["default"] = AsyncSelectInput$1;
|
|
258
263
|
exports.version = version;
|
|
@@ -20,6 +20,7 @@ var utils = require('@commercetools-uikit/utils');
|
|
|
20
20
|
var Constraints = require('@commercetools-uikit/constraints');
|
|
21
21
|
var LoadingSpinner = require('@commercetools-uikit/loading-spinner');
|
|
22
22
|
var selectUtils = require('@commercetools-uikit/select-utils');
|
|
23
|
+
var designSystem = require('@commercetools-uikit/design-system');
|
|
23
24
|
var jsxRuntime = require('@emotion/react/jsx-runtime');
|
|
24
25
|
|
|
25
26
|
function _interopDefault (e) { return e && e.__esModule ? e : { 'default': e }; }
|
|
@@ -65,6 +66,9 @@ var defaultProps = {
|
|
|
65
66
|
var AsyncSelectInput = function AsyncSelectInput(props) {
|
|
66
67
|
var intl = reactIntl.useIntl();
|
|
67
68
|
|
|
69
|
+
var _useTheme = designSystem.useTheme(),
|
|
70
|
+
isNewTheme = _useTheme.isNewTheme;
|
|
71
|
+
|
|
68
72
|
if (!props.isReadOnly) ;
|
|
69
73
|
|
|
70
74
|
var placeholder = props.placeholder || intl.formatMessage(selectUtils.messages.placeholder);
|
|
@@ -104,7 +108,8 @@ var AsyncSelectInput = function AsyncSelectInput(props) {
|
|
|
104
108
|
isReadOnly: props.isReadOnly,
|
|
105
109
|
iconLeft: props.iconLeft,
|
|
106
110
|
isMulti: props.isMulti,
|
|
107
|
-
hasValue: !isEmpty__default["default"](props.value)
|
|
111
|
+
hasValue: !isEmpty__default["default"](props.value),
|
|
112
|
+
isNewTheme: isNewTheme
|
|
108
113
|
}),
|
|
109
114
|
filterOption: props.filterOption // react-select uses "id" (for the container) and "inputId" (for the input),
|
|
110
115
|
// but we use "id" (for the input) and "containerId" (for the container)
|
|
@@ -236,7 +241,7 @@ AsyncSelectInput.ValueContainer = reactSelect.components.ValueContainer;
|
|
|
236
241
|
var AsyncSelectInput$1 = AsyncSelectInput;
|
|
237
242
|
|
|
238
243
|
// NOTE: This string will be replaced on build time with the package version.
|
|
239
|
-
var version = "15.
|
|
244
|
+
var version = "15.11.0";
|
|
240
245
|
|
|
241
246
|
exports["default"] = AsyncSelectInput$1;
|
|
242
247
|
exports.version = version;
|
|
@@ -16,6 +16,7 @@ import { warning, filterDataAttributes } from '@commercetools-uikit/utils';
|
|
|
16
16
|
import Constraints from '@commercetools-uikit/constraints';
|
|
17
17
|
import LoadingSpinner from '@commercetools-uikit/loading-spinner';
|
|
18
18
|
import { messages, customComponentsWithIcons, createSelectStyles, DropdownIndicator, ClearIndicator, TagRemove } from '@commercetools-uikit/select-utils';
|
|
19
|
+
import { useTheme } from '@commercetools-uikit/design-system';
|
|
19
20
|
import { jsx } from '@emotion/react/jsx-runtime';
|
|
20
21
|
|
|
21
22
|
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; }
|
|
@@ -46,6 +47,9 @@ var defaultProps = {
|
|
|
46
47
|
var AsyncSelectInput = function AsyncSelectInput(props) {
|
|
47
48
|
var intl = useIntl();
|
|
48
49
|
|
|
50
|
+
var _useTheme = useTheme(),
|
|
51
|
+
isNewTheme = _useTheme.isNewTheme;
|
|
52
|
+
|
|
49
53
|
if (!props.isReadOnly) {
|
|
50
54
|
process.env.NODE_ENV !== "production" ? warning(typeof props.onChange === 'function', 'AsyncSelectInput: `onChange` is required when input is not read only.') : void 0;
|
|
51
55
|
}
|
|
@@ -87,7 +91,8 @@ var AsyncSelectInput = function AsyncSelectInput(props) {
|
|
|
87
91
|
isReadOnly: props.isReadOnly,
|
|
88
92
|
iconLeft: props.iconLeft,
|
|
89
93
|
isMulti: props.isMulti,
|
|
90
|
-
hasValue: !isEmpty(props.value)
|
|
94
|
+
hasValue: !isEmpty(props.value),
|
|
95
|
+
isNewTheme: isNewTheme
|
|
91
96
|
}),
|
|
92
97
|
filterOption: props.filterOption // react-select uses "id" (for the container) and "inputId" (for the input),
|
|
93
98
|
// but we use "id" (for the input) and "containerId" (for the container)
|
|
@@ -232,6 +237,6 @@ AsyncSelectInput.ValueContainer = components.ValueContainer;
|
|
|
232
237
|
var AsyncSelectInput$1 = AsyncSelectInput;
|
|
233
238
|
|
|
234
239
|
// NOTE: This string will be replaced on build time with the package version.
|
|
235
|
-
var version = "15.
|
|
240
|
+
var version = "15.11.0";
|
|
236
241
|
|
|
237
242
|
export { AsyncSelectInput$1 as default, version };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { ReactNode } from 'react';
|
|
2
2
|
import { type ActionMeta, type GroupBase, type OptionsOrGroups } from 'react-select';
|
|
3
3
|
import { type AsyncProps } from 'react-select/async';
|
|
4
|
-
|
|
4
|
+
type TCustomEvent = {
|
|
5
5
|
target: {
|
|
6
6
|
id?: ReactSelectAsyncProps['inputId'];
|
|
7
7
|
name?: ReactSelectAsyncProps['name'];
|
|
@@ -9,8 +9,8 @@ declare type TCustomEvent = {
|
|
|
9
9
|
};
|
|
10
10
|
persist: () => void;
|
|
11
11
|
};
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
type ReactSelectAsyncProps = AsyncProps<unknown, boolean, GroupBase<unknown>>;
|
|
13
|
+
type TAsyncSelectInputProps = {
|
|
14
14
|
horizontalConstraint?: 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 'scale' | 'auto';
|
|
15
15
|
hasError?: boolean;
|
|
16
16
|
hasWarning?: boolean;
|
|
@@ -90,7 +90,7 @@ declare const AsyncSelectInput: {
|
|
|
90
90
|
};
|
|
91
91
|
Menu: <Option_9, IsMulti_9 extends boolean, Group_9 extends GroupBase<Option_9>>(props: import("react-select").MenuProps<Option_9, IsMulti_9, Group_9>) => import("@emotion/react").jsx.JSX.Element;
|
|
92
92
|
MenuList: <Option_10, IsMulti_10 extends boolean, Group_10 extends GroupBase<Option_10>>(props: import("react-select").MenuListProps<Option_10, IsMulti_10, Group_10>) => import("@emotion/react").jsx.JSX.Element;
|
|
93
|
-
MenuPortal: <Option_11, IsMulti_11 extends boolean, Group_11 extends GroupBase<Option_11>>(
|
|
93
|
+
MenuPortal: <Option_11, IsMulti_11 extends boolean, Group_11 extends 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;
|
|
94
94
|
MultiValue: <Option_14, IsMulti_14 extends boolean, Group_14 extends GroupBase<Option_14>>(props: import("react-select").MultiValueProps<Option_14, IsMulti_14, Group_14>) => import("@emotion/react").jsx.JSX.Element;
|
|
95
95
|
MultiValueContainer: <Option_15, IsMulti_15 extends boolean, Group_15 extends GroupBase<Option_15>>({ children, innerProps, }: import("react-select").MultiValueGenericProps<Option_15, IsMulti_15, Group_15>) => import("@emotion/react").jsx.JSX.Element;
|
|
96
96
|
MultiValueLabel: <Option_15_1, IsMulti_15_1 extends boolean, Group_15_1 extends 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/async-select-input",
|
|
3
3
|
"description": "An input component getting a selection from an asynchronously loaded list 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,19 +21,19 @@
|
|
|
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/loading-spinner": "15.
|
|
28
|
-
"@commercetools-uikit/select-utils": "15.
|
|
29
|
-
"@commercetools-uikit/spacings": "15.
|
|
30
|
-
"@commercetools-uikit/text": "15.
|
|
31
|
-
"@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/loading-spinner": "15.11.0",
|
|
28
|
+
"@commercetools-uikit/select-utils": "15.11.0",
|
|
29
|
+
"@commercetools-uikit/spacings": "15.11.0",
|
|
30
|
+
"@commercetools-uikit/text": "15.11.0",
|
|
31
|
+
"@commercetools-uikit/utils": "15.11.0",
|
|
32
32
|
"@emotion/react": "^11.4.0",
|
|
33
33
|
"@emotion/styled": "^11.3.0",
|
|
34
34
|
"lodash": "4.17.21",
|
|
35
35
|
"prop-types": "15.8.1",
|
|
36
|
-
"react-select": "5.
|
|
36
|
+
"react-select": "5.7.0"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
39
|
"react": "17.0.2",
|