carbon-react 142.13.3 → 142.13.5
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/esm/components/select/__internal__/select-textbox/select-textbox.component.d.ts +0 -3
- package/esm/components/select/__internal__/select-textbox/select-textbox.component.js +4 -4
- package/esm/components/select/filterable-select/filterable-select.component.d.ts +3 -0
- package/esm/components/select/multi-select/multi-select.component.d.ts +3 -0
- package/esm/components/select/simple-select/simple-select.component.d.ts +2 -0
- package/esm/components/textarea/textarea.component.js +2 -0
- package/lib/components/select/__internal__/select-textbox/select-textbox.component.d.ts +0 -3
- package/lib/components/select/__internal__/select-textbox/select-textbox.component.js +4 -4
- package/lib/components/select/filterable-select/filterable-select.component.d.ts +3 -0
- package/lib/components/select/multi-select/multi-select.component.d.ts +3 -0
- package/lib/components/select/simple-select/simple-select.component.d.ts +2 -0
- package/lib/components/textarea/textarea.component.js +2 -0
- package/package.json +1 -1
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { CustomSelectChangeEvent } from "../../simple-select/simple-select.component";
|
|
3
2
|
import { CommonTextboxProps } from "../../../textbox";
|
|
4
3
|
import { ValidationProps } from "../../../../__internal__/validations";
|
|
5
4
|
export interface FormInputPropTypes extends ValidationProps, Omit<CommonTextboxProps, "onClick" | "onChange"> {
|
|
@@ -29,8 +28,6 @@ export interface FormInputPropTypes extends ValidationProps, Omit<CommonTextboxP
|
|
|
29
28
|
name?: string;
|
|
30
29
|
/** Specify a callback triggered on blur */
|
|
31
30
|
onBlur?: (ev: React.FocusEvent<HTMLInputElement>) => void;
|
|
32
|
-
/** Specify a callback triggered on change */
|
|
33
|
-
onChange?: (ev: CustomSelectChangeEvent | React.ChangeEvent<HTMLInputElement>) => void;
|
|
34
31
|
/** Specify a callback triggered on click */
|
|
35
32
|
onClick?: (ev: React.MouseEvent<HTMLInputElement>) => void;
|
|
36
33
|
/** Specify a callback triggered on focus */
|
|
@@ -20,7 +20,6 @@ const SelectTextbox = /*#__PURE__*/React.forwardRef(({
|
|
|
20
20
|
onClick,
|
|
21
21
|
onFocus,
|
|
22
22
|
onBlur,
|
|
23
|
-
onChange,
|
|
24
23
|
formattedValue = "",
|
|
25
24
|
selectedValue,
|
|
26
25
|
required,
|
|
@@ -75,8 +74,10 @@ const SelectTextbox = /*#__PURE__*/React.forwardRef(({
|
|
|
75
74
|
"data-role": "select-textbox",
|
|
76
75
|
inputIcon: "dropdown",
|
|
77
76
|
autoComplete: "off",
|
|
78
|
-
size: size
|
|
79
|
-
|
|
77
|
+
size: size
|
|
78
|
+
// prevent uncontrolled warning being fired
|
|
79
|
+
,
|
|
80
|
+
onChange: () => {},
|
|
80
81
|
formattedValue: formattedValue,
|
|
81
82
|
value: hasStringValue ? selectedValue : undefined,
|
|
82
83
|
placeholder: hasTextCursor ? placeholder : undefined
|
|
@@ -404,7 +405,6 @@ if (process.env.NODE_ENV !== "production") {
|
|
|
404
405
|
"onCanPlayCapture": PropTypes.func,
|
|
405
406
|
"onCanPlayThrough": PropTypes.func,
|
|
406
407
|
"onCanPlayThroughCapture": PropTypes.func,
|
|
407
|
-
"onChange": PropTypes.func,
|
|
408
408
|
"onChangeCapture": PropTypes.func,
|
|
409
409
|
"onChangeDeferred": PropTypes.func,
|
|
410
410
|
"onClick": PropTypes.func,
|
|
@@ -2,6 +2,7 @@ import React from "react";
|
|
|
2
2
|
import { Side } from "@floating-ui/dom";
|
|
3
3
|
import { ButtonProps } from "../../button";
|
|
4
4
|
import { FormInputPropTypes } from "../__internal__/select-textbox";
|
|
5
|
+
import { CustomSelectChangeEvent } from "../simple-select";
|
|
5
6
|
export interface FilterableSelectProps extends Omit<FormInputPropTypes, "defaultValue" | "value"> {
|
|
6
7
|
/** Prop to specify the aria-label attribute of the component input */
|
|
7
8
|
"aria-label"?: string;
|
|
@@ -65,6 +66,8 @@ export interface FilterableSelectProps extends Omit<FormInputPropTypes, "default
|
|
|
65
66
|
isOptional?: boolean;
|
|
66
67
|
/** Flag to configure component as mandatory */
|
|
67
68
|
required?: boolean;
|
|
69
|
+
/** Specify a callback triggered on change */
|
|
70
|
+
onChange?: (ev: CustomSelectChangeEvent | React.ChangeEvent<HTMLInputElement>) => void;
|
|
68
71
|
}
|
|
69
72
|
export declare const FilterableSelect: React.ForwardRefExoticComponent<FilterableSelectProps & React.RefAttributes<HTMLInputElement>>;
|
|
70
73
|
export default FilterableSelect;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { Side } from "@floating-ui/dom";
|
|
3
3
|
import { FormInputPropTypes } from "../__internal__/select-textbox";
|
|
4
|
+
import { CustomSelectChangeEvent } from "../simple-select";
|
|
4
5
|
export interface MultiSelectProps extends Omit<FormInputPropTypes, "defaultValue" | "value"> {
|
|
5
6
|
/** Prop to specify the aria-label attribute of the component input */
|
|
6
7
|
"aria-label"?: string;
|
|
@@ -57,6 +58,8 @@ export interface MultiSelectProps extends Omit<FormInputPropTypes, "defaultValue
|
|
|
57
58
|
virtualScrollOverscan?: number;
|
|
58
59
|
/** Flag to configure component as optional. */
|
|
59
60
|
isOptional?: boolean;
|
|
61
|
+
/** Specify a callback triggered on change */
|
|
62
|
+
onChange?: (ev: CustomSelectChangeEvent | React.ChangeEvent<HTMLInputElement>) => void;
|
|
60
63
|
}
|
|
61
64
|
export declare const MultiSelect: React.ForwardRefExoticComponent<MultiSelectProps & React.RefAttributes<HTMLInputElement>>;
|
|
62
65
|
export default MultiSelect;
|
|
@@ -65,6 +65,8 @@ export interface SimpleSelectProps extends Omit<FormInputPropTypes, "defaultValu
|
|
|
65
65
|
isOptional?: boolean;
|
|
66
66
|
/** Flag to configure component as mandatory */
|
|
67
67
|
isRequired?: boolean;
|
|
68
|
+
/** Specify a callback triggered on change */
|
|
69
|
+
onChange?: (ev: CustomSelectChangeEvent | React.ChangeEvent<HTMLInputElement>) => void;
|
|
68
70
|
}
|
|
69
71
|
export declare const SimpleSelect: React.ForwardRefExoticComponent<SimpleSelectProps & React.RefAttributes<HTMLInputElement>>;
|
|
70
72
|
export default SimpleSelect;
|
|
@@ -117,6 +117,8 @@ const Textarea = /*#__PURE__*/React.forwardRef(({
|
|
|
117
117
|
}
|
|
118
118
|
const scrollPosition = scrollElement?.scrollTop;
|
|
119
119
|
|
|
120
|
+
// Reset height to allow shrinking when lines are removed
|
|
121
|
+
textarea.style.height = "auto";
|
|
120
122
|
// Set the height so all content is shown
|
|
121
123
|
textarea.style.height = `${Math.max(textarea.scrollHeight, textareaMinHeight)}px`;
|
|
122
124
|
if (scrollElement && scrollPosition) {
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { CustomSelectChangeEvent } from "../../simple-select/simple-select.component";
|
|
3
2
|
import { CommonTextboxProps } from "../../../textbox";
|
|
4
3
|
import { ValidationProps } from "../../../../__internal__/validations";
|
|
5
4
|
export interface FormInputPropTypes extends ValidationProps, Omit<CommonTextboxProps, "onClick" | "onChange"> {
|
|
@@ -29,8 +28,6 @@ export interface FormInputPropTypes extends ValidationProps, Omit<CommonTextboxP
|
|
|
29
28
|
name?: string;
|
|
30
29
|
/** Specify a callback triggered on blur */
|
|
31
30
|
onBlur?: (ev: React.FocusEvent<HTMLInputElement>) => void;
|
|
32
|
-
/** Specify a callback triggered on change */
|
|
33
|
-
onChange?: (ev: CustomSelectChangeEvent | React.ChangeEvent<HTMLInputElement>) => void;
|
|
34
31
|
/** Specify a callback triggered on click */
|
|
35
32
|
onClick?: (ev: React.MouseEvent<HTMLInputElement>) => void;
|
|
36
33
|
/** Specify a callback triggered on focus */
|
|
@@ -27,7 +27,6 @@ const SelectTextbox = /*#__PURE__*/_react.default.forwardRef(({
|
|
|
27
27
|
onClick,
|
|
28
28
|
onFocus,
|
|
29
29
|
onBlur,
|
|
30
|
-
onChange,
|
|
31
30
|
formattedValue = "",
|
|
32
31
|
selectedValue,
|
|
33
32
|
required,
|
|
@@ -82,8 +81,10 @@ const SelectTextbox = /*#__PURE__*/_react.default.forwardRef(({
|
|
|
82
81
|
"data-role": "select-textbox",
|
|
83
82
|
inputIcon: "dropdown",
|
|
84
83
|
autoComplete: "off",
|
|
85
|
-
size: size
|
|
86
|
-
|
|
84
|
+
size: size
|
|
85
|
+
// prevent uncontrolled warning being fired
|
|
86
|
+
,
|
|
87
|
+
onChange: () => {},
|
|
87
88
|
formattedValue: formattedValue,
|
|
88
89
|
value: hasStringValue ? selectedValue : undefined,
|
|
89
90
|
placeholder: hasTextCursor ? placeholder : undefined
|
|
@@ -411,7 +412,6 @@ if (process.env.NODE_ENV !== "production") {
|
|
|
411
412
|
"onCanPlayCapture": _propTypes.default.func,
|
|
412
413
|
"onCanPlayThrough": _propTypes.default.func,
|
|
413
414
|
"onCanPlayThroughCapture": _propTypes.default.func,
|
|
414
|
-
"onChange": _propTypes.default.func,
|
|
415
415
|
"onChangeCapture": _propTypes.default.func,
|
|
416
416
|
"onChangeDeferred": _propTypes.default.func,
|
|
417
417
|
"onClick": _propTypes.default.func,
|
|
@@ -2,6 +2,7 @@ import React from "react";
|
|
|
2
2
|
import { Side } from "@floating-ui/dom";
|
|
3
3
|
import { ButtonProps } from "../../button";
|
|
4
4
|
import { FormInputPropTypes } from "../__internal__/select-textbox";
|
|
5
|
+
import { CustomSelectChangeEvent } from "../simple-select";
|
|
5
6
|
export interface FilterableSelectProps extends Omit<FormInputPropTypes, "defaultValue" | "value"> {
|
|
6
7
|
/** Prop to specify the aria-label attribute of the component input */
|
|
7
8
|
"aria-label"?: string;
|
|
@@ -65,6 +66,8 @@ export interface FilterableSelectProps extends Omit<FormInputPropTypes, "default
|
|
|
65
66
|
isOptional?: boolean;
|
|
66
67
|
/** Flag to configure component as mandatory */
|
|
67
68
|
required?: boolean;
|
|
69
|
+
/** Specify a callback triggered on change */
|
|
70
|
+
onChange?: (ev: CustomSelectChangeEvent | React.ChangeEvent<HTMLInputElement>) => void;
|
|
68
71
|
}
|
|
69
72
|
export declare const FilterableSelect: React.ForwardRefExoticComponent<FilterableSelectProps & React.RefAttributes<HTMLInputElement>>;
|
|
70
73
|
export default FilterableSelect;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { Side } from "@floating-ui/dom";
|
|
3
3
|
import { FormInputPropTypes } from "../__internal__/select-textbox";
|
|
4
|
+
import { CustomSelectChangeEvent } from "../simple-select";
|
|
4
5
|
export interface MultiSelectProps extends Omit<FormInputPropTypes, "defaultValue" | "value"> {
|
|
5
6
|
/** Prop to specify the aria-label attribute of the component input */
|
|
6
7
|
"aria-label"?: string;
|
|
@@ -57,6 +58,8 @@ export interface MultiSelectProps extends Omit<FormInputPropTypes, "defaultValue
|
|
|
57
58
|
virtualScrollOverscan?: number;
|
|
58
59
|
/** Flag to configure component as optional. */
|
|
59
60
|
isOptional?: boolean;
|
|
61
|
+
/** Specify a callback triggered on change */
|
|
62
|
+
onChange?: (ev: CustomSelectChangeEvent | React.ChangeEvent<HTMLInputElement>) => void;
|
|
60
63
|
}
|
|
61
64
|
export declare const MultiSelect: React.ForwardRefExoticComponent<MultiSelectProps & React.RefAttributes<HTMLInputElement>>;
|
|
62
65
|
export default MultiSelect;
|
|
@@ -65,6 +65,8 @@ export interface SimpleSelectProps extends Omit<FormInputPropTypes, "defaultValu
|
|
|
65
65
|
isOptional?: boolean;
|
|
66
66
|
/** Flag to configure component as mandatory */
|
|
67
67
|
isRequired?: boolean;
|
|
68
|
+
/** Specify a callback triggered on change */
|
|
69
|
+
onChange?: (ev: CustomSelectChangeEvent | React.ChangeEvent<HTMLInputElement>) => void;
|
|
68
70
|
}
|
|
69
71
|
export declare const SimpleSelect: React.ForwardRefExoticComponent<SimpleSelectProps & React.RefAttributes<HTMLInputElement>>;
|
|
70
72
|
export default SimpleSelect;
|
|
@@ -126,6 +126,8 @@ const Textarea = exports.OriginalTextarea = exports.Textarea = /*#__PURE__*/_rea
|
|
|
126
126
|
}
|
|
127
127
|
const scrollPosition = scrollElement?.scrollTop;
|
|
128
128
|
|
|
129
|
+
// Reset height to allow shrinking when lines are removed
|
|
130
|
+
textarea.style.height = "auto";
|
|
129
131
|
// Set the height so all content is shown
|
|
130
132
|
textarea.style.height = `${Math.max(textarea.scrollHeight, textareaMinHeight)}px`;
|
|
131
133
|
if (scrollElement && scrollPosition) {
|