@commercetools-uikit/creatable-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.
- package/dist/commercetools-uikit-creatable-select-input.cjs.dev.js +7 -2
- package/dist/commercetools-uikit-creatable-select-input.cjs.prod.js +7 -2
- package/dist/commercetools-uikit-creatable-select-input.esm.js +7 -2
- package/dist/declarations/src/creatable-select-input.d.ts +6 -6
- package/package.json +9 -9
|
@@ -19,6 +19,7 @@ var CreatableSelect = require('react-select/creatable');
|
|
|
19
19
|
var Constraints = require('@commercetools-uikit/constraints');
|
|
20
20
|
var utils = require('@commercetools-uikit/utils');
|
|
21
21
|
var selectUtils = require('@commercetools-uikit/select-utils');
|
|
22
|
+
var designSystem = require('@commercetools-uikit/design-system');
|
|
22
23
|
var jsxRuntime = require('@emotion/react/jsx-runtime');
|
|
23
24
|
|
|
24
25
|
function _interopDefault (e) { return e && e.__esModule ? e : { 'default': e }; }
|
|
@@ -61,6 +62,9 @@ var defaultProps = {
|
|
|
61
62
|
var CreatableSelectInput = function CreatableSelectInput(props) {
|
|
62
63
|
var intl = reactIntl.useIntl();
|
|
63
64
|
|
|
65
|
+
var _useTheme = designSystem.useTheme(),
|
|
66
|
+
isNewTheme = _useTheme.isNewTheme;
|
|
67
|
+
|
|
64
68
|
if (!props.isReadOnly) {
|
|
65
69
|
process.env.NODE_ENV !== "production" ? utils.warning(typeof props.onChange === 'function', 'CreatableSelectInput: `onChange` is required when input is not read only.') : void 0;
|
|
66
70
|
}
|
|
@@ -93,7 +97,8 @@ var CreatableSelectInput = function CreatableSelectInput(props) {
|
|
|
93
97
|
isReadOnly: props.isReadOnly,
|
|
94
98
|
iconLeft: props.iconLeft,
|
|
95
99
|
isMulti: props.isMulti,
|
|
96
|
-
hasValue: !isEmpty__default["default"](props.value)
|
|
100
|
+
hasValue: !isEmpty__default["default"](props.value),
|
|
101
|
+
isNewTheme: isNewTheme
|
|
97
102
|
}),
|
|
98
103
|
filterOption: props.filterOption // react-select uses "id" (for the container) and "inputId" (for the input),
|
|
99
104
|
// but we use "id" (for the input) and "containerId" (for the container)
|
|
@@ -249,7 +254,7 @@ CreatableSelectInput.ValueContainer = reactSelect.components.ValueContainer;
|
|
|
249
254
|
var CreatableSelectInput$1 = CreatableSelectInput;
|
|
250
255
|
|
|
251
256
|
// NOTE: This string will be replaced on build time with the package version.
|
|
252
|
-
var version = "15.
|
|
257
|
+
var version = "15.11.0";
|
|
253
258
|
|
|
254
259
|
exports["default"] = CreatableSelectInput$1;
|
|
255
260
|
exports.version = version;
|
|
@@ -19,6 +19,7 @@ var CreatableSelect = require('react-select/creatable');
|
|
|
19
19
|
var Constraints = require('@commercetools-uikit/constraints');
|
|
20
20
|
var utils = require('@commercetools-uikit/utils');
|
|
21
21
|
var selectUtils = require('@commercetools-uikit/select-utils');
|
|
22
|
+
var designSystem = require('@commercetools-uikit/design-system');
|
|
22
23
|
var jsxRuntime = require('@emotion/react/jsx-runtime');
|
|
23
24
|
|
|
24
25
|
function _interopDefault (e) { return e && e.__esModule ? e : { 'default': e }; }
|
|
@@ -60,6 +61,9 @@ var defaultProps = {
|
|
|
60
61
|
var CreatableSelectInput = function CreatableSelectInput(props) {
|
|
61
62
|
var intl = reactIntl.useIntl();
|
|
62
63
|
|
|
64
|
+
var _useTheme = designSystem.useTheme(),
|
|
65
|
+
isNewTheme = _useTheme.isNewTheme;
|
|
66
|
+
|
|
63
67
|
if (!props.isReadOnly) ;
|
|
64
68
|
|
|
65
69
|
var placeholder = props.placeholder || intl.formatMessage(selectUtils.messages.placeholder);
|
|
@@ -90,7 +94,8 @@ var CreatableSelectInput = function CreatableSelectInput(props) {
|
|
|
90
94
|
isReadOnly: props.isReadOnly,
|
|
91
95
|
iconLeft: props.iconLeft,
|
|
92
96
|
isMulti: props.isMulti,
|
|
93
|
-
hasValue: !isEmpty__default["default"](props.value)
|
|
97
|
+
hasValue: !isEmpty__default["default"](props.value),
|
|
98
|
+
isNewTheme: isNewTheme
|
|
94
99
|
}),
|
|
95
100
|
filterOption: props.filterOption // react-select uses "id" (for the container) and "inputId" (for the input),
|
|
96
101
|
// but we use "id" (for the input) and "containerId" (for the container)
|
|
@@ -226,7 +231,7 @@ CreatableSelectInput.ValueContainer = reactSelect.components.ValueContainer;
|
|
|
226
231
|
var CreatableSelectInput$1 = CreatableSelectInput;
|
|
227
232
|
|
|
228
233
|
// NOTE: This string will be replaced on build time with the package version.
|
|
229
|
-
var version = "15.
|
|
234
|
+
var version = "15.11.0";
|
|
230
235
|
|
|
231
236
|
exports["default"] = CreatableSelectInput$1;
|
|
232
237
|
exports.version = version;
|
|
@@ -15,6 +15,7 @@ import CreatableSelect from 'react-select/creatable';
|
|
|
15
15
|
import Constraints from '@commercetools-uikit/constraints';
|
|
16
16
|
import { warning, filterDataAttributes } from '@commercetools-uikit/utils';
|
|
17
17
|
import { messages, customComponentsWithIcons, createSelectStyles, DropdownIndicator, ClearIndicator, TagRemove } from '@commercetools-uikit/select-utils';
|
|
18
|
+
import { useTheme } from '@commercetools-uikit/design-system';
|
|
18
19
|
import { jsx } from '@emotion/react/jsx-runtime';
|
|
19
20
|
|
|
20
21
|
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; }
|
|
@@ -42,6 +43,9 @@ var defaultProps = {
|
|
|
42
43
|
var CreatableSelectInput = function CreatableSelectInput(props) {
|
|
43
44
|
var intl = useIntl();
|
|
44
45
|
|
|
46
|
+
var _useTheme = useTheme(),
|
|
47
|
+
isNewTheme = _useTheme.isNewTheme;
|
|
48
|
+
|
|
45
49
|
if (!props.isReadOnly) {
|
|
46
50
|
process.env.NODE_ENV !== "production" ? warning(typeof props.onChange === 'function', 'CreatableSelectInput: `onChange` is required when input is not read only.') : void 0;
|
|
47
51
|
}
|
|
@@ -74,7 +78,8 @@ var CreatableSelectInput = function CreatableSelectInput(props) {
|
|
|
74
78
|
isReadOnly: props.isReadOnly,
|
|
75
79
|
iconLeft: props.iconLeft,
|
|
76
80
|
isMulti: props.isMulti,
|
|
77
|
-
hasValue: !isEmpty(props.value)
|
|
81
|
+
hasValue: !isEmpty(props.value),
|
|
82
|
+
isNewTheme: isNewTheme
|
|
78
83
|
}),
|
|
79
84
|
filterOption: props.filterOption // react-select uses "id" (for the container) and "inputId" (for the input),
|
|
80
85
|
// but we use "id" (for the input) and "containerId" (for the container)
|
|
@@ -230,6 +235,6 @@ CreatableSelectInput.ValueContainer = components.ValueContainer;
|
|
|
230
235
|
var CreatableSelectInput$1 = CreatableSelectInput;
|
|
231
236
|
|
|
232
237
|
// NOTE: This string will be replaced on build time with the package version.
|
|
233
|
-
var version = "15.
|
|
238
|
+
var version = "15.11.0";
|
|
234
239
|
|
|
235
240
|
export { CreatableSelectInput$1 as default, version };
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import type { ReactNode } from 'react';
|
|
2
2
|
import { type GroupBase, type ActionMeta } from 'react-select';
|
|
3
3
|
import { type CreatableProps } from 'react-select/creatable';
|
|
4
|
-
|
|
4
|
+
type TValue = {
|
|
5
5
|
value: string;
|
|
6
6
|
label?: ReactNode;
|
|
7
7
|
};
|
|
8
|
-
|
|
8
|
+
type TOptions = TValue[] | {
|
|
9
9
|
options: TValue[];
|
|
10
10
|
}[];
|
|
11
|
-
|
|
11
|
+
type TCustomEvent = {
|
|
12
12
|
target: {
|
|
13
13
|
id?: string;
|
|
14
14
|
name?: string;
|
|
@@ -16,8 +16,8 @@ declare type TCustomEvent = {
|
|
|
16
16
|
};
|
|
17
17
|
persist?: () => void;
|
|
18
18
|
};
|
|
19
|
-
|
|
20
|
-
|
|
19
|
+
type ReactSelectCreatableProps = CreatableProps<unknown, boolean, GroupBase<unknown>>;
|
|
20
|
+
type TCreatableSelectInputProps = {
|
|
21
21
|
horizontalConstraint?: 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 'scale' | 'auto';
|
|
22
22
|
hasError?: boolean;
|
|
23
23
|
hasWarning?: boolean;
|
|
@@ -102,7 +102,7 @@ declare const CreatableSelectInput: {
|
|
|
102
102
|
};
|
|
103
103
|
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;
|
|
104
104
|
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;
|
|
105
|
-
MenuPortal: <Option_11, IsMulti_11 extends boolean, Group_11 extends GroupBase<Option_11>>(
|
|
105
|
+
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;
|
|
106
106
|
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;
|
|
107
107
|
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;
|
|
108
108
|
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/creatable-select-input",
|
|
3
3
|
"description": "An input component getting a selection from the user, and where options can also be created by 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,18 +21,18 @@
|
|
|
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/spacings": "15.
|
|
29
|
-
"@commercetools-uikit/text": "15.
|
|
30
|
-
"@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/spacings": "15.11.0",
|
|
29
|
+
"@commercetools-uikit/text": "15.11.0",
|
|
30
|
+
"@commercetools-uikit/utils": "15.11.0",
|
|
31
31
|
"@emotion/react": "^11.4.0",
|
|
32
32
|
"@emotion/styled": "^11.3.0",
|
|
33
33
|
"lodash": "4.17.21",
|
|
34
34
|
"prop-types": "15.8.1",
|
|
35
|
-
"react-select": "5.
|
|
35
|
+
"react-select": "5.7.0"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
38
|
"react": "17.0.2",
|