@commercetools-uikit/creatable-select-input 13.0.0 → 13.0.4
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/README.md +6 -4
- package/dist/commercetools-uikit-creatable-select-input.cjs.dev.js +4 -2
- package/dist/commercetools-uikit-creatable-select-input.cjs.prod.js +3 -1
- package/dist/commercetools-uikit-creatable-select-input.esm.js +4 -2
- package/dist/declarations/src/creatable-select-input.d.ts +6 -4
- package/package.json +8 -8
package/README.md
CHANGED
|
@@ -59,8 +59,10 @@ export default Example;
|
|
|
59
59
|
| `hasWarning` | `boolean` | | | Indicates the input field has a warning |
|
|
60
60
|
| `isReadOnly` | `boolean` | | | Disables the select input as it is read-only |
|
|
61
61
|
| `iconLeft` | `ReactNode` | | | Icon to display on the left of the placeholder text and selected value. Has no effect when `isMulti` is enabled. |
|
|
62
|
-
| `aria-label` | `CreatableProps['aria-label']` |
|
|
63
|
-
| `aria-labelledby` | `CreatableProps['aria-labelledby']` |
|
|
62
|
+
| `aria-label` | `CreatableProps['aria-label']` | | | Aria label (for assistive tech)
<br>
[Props from React select was used](https://react-select.com/props#creatable-props) |
|
|
63
|
+
| `aria-labelledby` | `CreatableProps['aria-labelledby']` | | | HTML ID of an element that should be used as the label (for assistive tech)
<br>
[Props from React select was used](https://react-select.com/props#creatable-props) |
|
|
64
|
+
| `aria-invalid` | `CreatableProps['aria-invalid']` | | | Indicate if the value entered in the input is invalid.
<br>
[Props from React select was used](https://react-select.com/props) |
|
|
65
|
+
| `aria-errormessage` | `CreatableProps['aria-errormessage']` | | | HTML ID of an element containing an error message related to the input.
<br>
[Props from React select was used](https://react-select.com/props) |
|
|
64
66
|
| `isAutofocussed` | `boolean` | | | Focus the control when it is mounted |
|
|
65
67
|
| `backspaceRemovesValue` | `CreatableProps['backspaceRemovesValue']` | | | Remove the currently focused option when the user presses backspace
<br>
[Props from React select was used](https://react-select.com/props#creatable-props) |
|
|
66
68
|
| `components` | `CreatableProps['components']` | | | Map of components to overwrite the default ones, see [what components you can override](https://react-select.com/components)
<br>
[Props from React select was used](https://react-select.com/props#creatable-props) |
|
|
@@ -81,10 +83,10 @@ export default Example;
|
|
|
81
83
|
| `name` | `CreatableProps['name']` | | | Name of the HTML Input (optional - without this, no input will be rendered)
<br>
[Props from React select was used](https://react-select.com/props#creatable-props) |
|
|
82
84
|
| `noOptionsMessage` | `CreatableProps['noOptionsMessage']` | | | Can be used to render a custom value when there are no options (either because of no search results, or all options have been used, or there were none in the first place). Gets called with `{ inputValue: String }`. `inputValue` will be an empty string when no search text is present.
<br>
[Props from React select was used](https://react-select.com/props#creatable-props) |
|
|
83
85
|
| `onBlur` | `Function`<br/>[See signature.](#signature-onBlur) | | | Handle blur events on the control |
|
|
84
|
-
| `onChange` | `Function`<br/>[See signature.](#signature-onChange) | ✅ | | Called with a fake event when value changes. The event's `target.name` will be the `name` supplied in props. The event's `target.value` will hold the value. The value will be the selected option, or an array of options in case `isMulti` is `true
|
|
86
|
+
| `onChange` | `Function`<br/>[See signature.](#signature-onChange) | ✅ | | Called with a fake event when value changes. The event's `target.name` will be the `name` supplied in props. The event's `target.value` will hold the value. The value will be the selected option, or an array of options in case `isMulti` is `true`. |
|
|
85
87
|
| `onFocus` | `CreatableProps['onFocus']` | | | Handle focus events on the control
<br>
[Props from React select was used](https://react-select.com/props#creatable-props) |
|
|
86
88
|
| `onInputChange` | `CreatableProps['onInputChange']` | | | Handle change events on the input
<br>
[Props from React select was used](https://react-select.com/props#creatable-props) |
|
|
87
|
-
| `options` | `union`<br/>Possible values:<br/>`TValue[] , { options: TValue[] }[]` |
|
|
89
|
+
| `options` | `union`<br/>Possible values:<br/>`TValue[] , { options: TValue[] }[]` | | | Array of options that populate the select menu |
|
|
88
90
|
| `showOptionGroupDivider` | `boolean` | | | Determines if option groups will be separated by a divider |
|
|
89
91
|
| `placeholder` | `CreatableProps['placeholder']` | | | Placeholder text for the select value
<br>
[Props from React select was used](https://react-select.com/props#creatable-props) |
|
|
90
92
|
| `tabIndex` | `CreatableProps['tabIndex']` | | | Sets the tabIndex attribute on the input
<br>
[Props from React select was used](https://react-select.com/props#creatable-props) |
|
|
@@ -69,6 +69,8 @@ var CreatableSelectInput = function CreatableSelectInput(props) {
|
|
|
69
69
|
children: jsxRuntime.jsx(CreatableSelect__default["default"], {
|
|
70
70
|
"aria-label": props['aria-label'],
|
|
71
71
|
"aria-labelledby": props['aria-labelledby'],
|
|
72
|
+
"aria-invalid": props['aria-invalid'],
|
|
73
|
+
"aria-errormessage": props['aria-errormessage'],
|
|
72
74
|
autoFocus: props.isAutofocussed,
|
|
73
75
|
backspaceRemovesValue: props.isReadOnly ? false : props.backspaceRemovesValue,
|
|
74
76
|
components: _objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread({}, customizedComponents), props.components), props.iconLeft && !props.isMulti ? selectUtils.customComponentsWithIcons : {}), props.isReadOnly ? {
|
|
@@ -188,7 +190,7 @@ CreatableSelectInput.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
188
190
|
options: _pt__default["default"].arrayOf(_pt__default["default"].shape({
|
|
189
191
|
value: _pt__default["default"].string.isRequired
|
|
190
192
|
})).isRequired
|
|
191
|
-
}))])
|
|
193
|
+
}))]),
|
|
192
194
|
showOptionGroupDivider: _pt__default["default"].bool
|
|
193
195
|
} : {};
|
|
194
196
|
CreatableSelectInput.displayName = 'CreatableSelectInput'; // Both "true" and an empty array [] represent a touched state. The Boolean
|
|
@@ -205,7 +207,7 @@ utils.addStaticFields(CreatableSelectInput, _objectSpread(_objectSpread(_objectS
|
|
|
205
207
|
var CreatableSelectInput$1 = CreatableSelectInput;
|
|
206
208
|
|
|
207
209
|
// NOTE: This string will be replaced on build time with the package version.
|
|
208
|
-
var version = "13.0.
|
|
210
|
+
var version = "13.0.4";
|
|
209
211
|
|
|
210
212
|
exports["default"] = CreatableSelectInput$1;
|
|
211
213
|
exports.version = version;
|
|
@@ -68,6 +68,8 @@ var CreatableSelectInput = function CreatableSelectInput(props) {
|
|
|
68
68
|
children: jsxRuntime.jsx(CreatableSelect__default["default"], {
|
|
69
69
|
"aria-label": props['aria-label'],
|
|
70
70
|
"aria-labelledby": props['aria-labelledby'],
|
|
71
|
+
"aria-invalid": props['aria-invalid'],
|
|
72
|
+
"aria-errormessage": props['aria-errormessage'],
|
|
71
73
|
autoFocus: props.isAutofocussed,
|
|
72
74
|
backspaceRemovesValue: props.isReadOnly ? false : props.backspaceRemovesValue,
|
|
73
75
|
components: _objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread({}, customizedComponents), props.components), props.iconLeft && !props.isMulti ? selectUtils.customComponentsWithIcons : {}), props.isReadOnly ? {
|
|
@@ -186,7 +188,7 @@ utils.addStaticFields(CreatableSelectInput, _objectSpread(_objectSpread(_objectS
|
|
|
186
188
|
var CreatableSelectInput$1 = CreatableSelectInput;
|
|
187
189
|
|
|
188
190
|
// NOTE: This string will be replaced on build time with the package version.
|
|
189
|
-
var version = "13.0.
|
|
191
|
+
var version = "13.0.4";
|
|
190
192
|
|
|
191
193
|
exports["default"] = CreatableSelectInput$1;
|
|
192
194
|
exports.version = version;
|
|
@@ -50,6 +50,8 @@ var CreatableSelectInput = function CreatableSelectInput(props) {
|
|
|
50
50
|
children: jsx(CreatableSelect, {
|
|
51
51
|
"aria-label": props['aria-label'],
|
|
52
52
|
"aria-labelledby": props['aria-labelledby'],
|
|
53
|
+
"aria-invalid": props['aria-invalid'],
|
|
54
|
+
"aria-errormessage": props['aria-errormessage'],
|
|
53
55
|
autoFocus: props.isAutofocussed,
|
|
54
56
|
backspaceRemovesValue: props.isReadOnly ? false : props.backspaceRemovesValue,
|
|
55
57
|
components: _objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread({}, customizedComponents), props.components), props.iconLeft && !props.isMulti ? customComponentsWithIcons : {}), props.isReadOnly ? {
|
|
@@ -169,7 +171,7 @@ CreatableSelectInput.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
169
171
|
options: _pt.arrayOf(_pt.shape({
|
|
170
172
|
value: _pt.string.isRequired
|
|
171
173
|
})).isRequired
|
|
172
|
-
}))])
|
|
174
|
+
}))]),
|
|
173
175
|
showOptionGroupDivider: _pt.bool
|
|
174
176
|
} : {};
|
|
175
177
|
CreatableSelectInput.displayName = 'CreatableSelectInput'; // Both "true" and an empty array [] represent a touched state. The Boolean
|
|
@@ -186,6 +188,6 @@ addStaticFields(CreatableSelectInput, _objectSpread(_objectSpread(_objectSpread(
|
|
|
186
188
|
var CreatableSelectInput$1 = CreatableSelectInput;
|
|
187
189
|
|
|
188
190
|
// NOTE: This string will be replaced on build time with the package version.
|
|
189
|
-
var version = "13.0.
|
|
191
|
+
var version = "13.0.4";
|
|
190
192
|
|
|
191
193
|
export { CreatableSelectInput$1 as default, version };
|
|
@@ -21,8 +21,10 @@ declare type TCreatableSelectInputProps = {
|
|
|
21
21
|
hasWarning?: boolean;
|
|
22
22
|
isReadOnly?: boolean;
|
|
23
23
|
iconLeft?: ReactNode;
|
|
24
|
-
'aria-label'
|
|
25
|
-
'aria-labelledby'
|
|
24
|
+
'aria-label'?: ReactSelectCreatableProps['aria-label'];
|
|
25
|
+
'aria-labelledby'?: ReactSelectCreatableProps['aria-labelledby'];
|
|
26
|
+
'aria-invalid'?: ReactSelectCreatableProps['aria-invalid'];
|
|
27
|
+
'aria-errormessage'?: ReactSelectCreatableProps['aria-errormessage'];
|
|
26
28
|
isAutofocussed?: boolean;
|
|
27
29
|
backspaceRemovesValue?: ReactSelectCreatableProps['backspaceRemovesValue'];
|
|
28
30
|
components?: ReactSelectCreatableProps['components'];
|
|
@@ -46,12 +48,12 @@ declare type TCreatableSelectInputProps = {
|
|
|
46
48
|
onChange: (event: TEvent, info: ActionMeta<unknown>) => void;
|
|
47
49
|
onFocus?: ReactSelectCreatableProps['onFocus'];
|
|
48
50
|
onInputChange?: ReactSelectCreatableProps['onInputChange'];
|
|
49
|
-
options
|
|
51
|
+
options?: TOptions;
|
|
50
52
|
showOptionGroupDivider?: boolean;
|
|
51
53
|
placeholder?: ReactSelectCreatableProps['placeholder'];
|
|
52
54
|
tabIndex?: ReactSelectCreatableProps['tabIndex'];
|
|
53
55
|
tabSelectsValue?: ReactSelectCreatableProps['tabSelectsValue'];
|
|
54
|
-
value
|
|
56
|
+
value?: ReactSelectCreatableProps['value'];
|
|
55
57
|
allowCreateWhileLoading?: ReactSelectCreatableProps['allowCreateWhileLoading'];
|
|
56
58
|
formatCreateLabel?: ReactSelectCreatableProps['formatCreateLabel'];
|
|
57
59
|
isValidNewOption?: ReactSelectCreatableProps['isValidNewOption'];
|
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": "13.0.
|
|
4
|
+
"version": "13.0.4",
|
|
5
5
|
"bugs": "https://github.com/commercetools/ui-kit/issues",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -21,13 +21,13 @@
|
|
|
21
21
|
"dependencies": {
|
|
22
22
|
"@babel/runtime": "7.17.2",
|
|
23
23
|
"@babel/runtime-corejs3": "7.17.2",
|
|
24
|
-
"@commercetools-uikit/constraints": "13.0.
|
|
24
|
+
"@commercetools-uikit/constraints": "13.0.2",
|
|
25
25
|
"@commercetools-uikit/design-system": "13.0.0",
|
|
26
|
-
"@commercetools-uikit/icons": "13.0.
|
|
27
|
-
"@commercetools-uikit/select-utils": "13.0.
|
|
28
|
-
"@commercetools-uikit/spacings": "13.0.
|
|
29
|
-
"@commercetools-uikit/text": "13.0.
|
|
30
|
-
"@commercetools-uikit/utils": "
|
|
26
|
+
"@commercetools-uikit/icons": "13.0.2",
|
|
27
|
+
"@commercetools-uikit/select-utils": "13.0.4",
|
|
28
|
+
"@commercetools-uikit/spacings": "13.0.2",
|
|
29
|
+
"@commercetools-uikit/text": "13.0.4",
|
|
30
|
+
"@commercetools-uikit/utils": "13.0.2",
|
|
31
31
|
"@emotion/react": "^11.4.0",
|
|
32
32
|
"@emotion/styled": "^11.3.0",
|
|
33
33
|
"lodash": "4.17.21",
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"devDependencies": {
|
|
38
38
|
"react": "17.0.2",
|
|
39
39
|
"react-dom": "17.0.2",
|
|
40
|
-
"react-intl": "5.24.6"
|
|
40
|
+
"react-intl": "^5.24.6"
|
|
41
41
|
},
|
|
42
42
|
"peerDependencies": {
|
|
43
43
|
"react": "17.x",
|