carbon-react 114.1.0 → 114.2.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/esm/components/inline-inputs/inline-inputs.component.d.ts +3 -1
- package/esm/components/inline-inputs/inline-inputs.component.js +6 -3
- package/lib/components/inline-inputs/inline-inputs.component.d.ts +3 -1
- package/lib/components/inline-inputs/inline-inputs.component.js +6 -3
- package/package.json +1 -1
|
@@ -14,10 +14,12 @@ export interface InlineInputsProps extends StyledContentContainerProps, StyledIn
|
|
|
14
14
|
htmlFor?: string;
|
|
15
15
|
/** Defines the label text for the heading. */
|
|
16
16
|
label?: string;
|
|
17
|
+
/** Flag to configure component as mandatory. */
|
|
18
|
+
required?: boolean;
|
|
17
19
|
}
|
|
18
20
|
export declare const InlineInputsContext: React.Context<InlineInputsContextProps>;
|
|
19
21
|
declare const InlineInputs: {
|
|
20
|
-
({ adaptiveLabelBreakpoint, label, htmlFor, children, className, gutter, inputWidth, labelInline, labelWidth, }: InlineInputsProps): JSX.Element;
|
|
22
|
+
({ adaptiveLabelBreakpoint, label, htmlFor, children, className, gutter, inputWidth, labelInline, labelWidth, required, }: InlineInputsProps): JSX.Element;
|
|
21
23
|
displayName: string;
|
|
22
24
|
};
|
|
23
25
|
export default InlineInputs;
|
|
@@ -28,7 +28,8 @@ const InlineInputs = ({
|
|
|
28
28
|
gutter = "none",
|
|
29
29
|
inputWidth,
|
|
30
30
|
labelInline = true,
|
|
31
|
-
labelWidth
|
|
31
|
+
labelWidth,
|
|
32
|
+
required
|
|
32
33
|
}) => {
|
|
33
34
|
const labelId = useRef(createGuid());
|
|
34
35
|
const largeScreen = useIsAboveBreakpoint(adaptiveLabelBreakpoint);
|
|
@@ -43,7 +44,8 @@ const InlineInputs = ({
|
|
|
43
44
|
return /*#__PURE__*/React.createElement(Label, {
|
|
44
45
|
labelId: labelId.current,
|
|
45
46
|
inline: inlineLabel,
|
|
46
|
-
htmlFor: htmlFor
|
|
47
|
+
htmlFor: htmlFor,
|
|
48
|
+
isRequired: required
|
|
47
49
|
}, label);
|
|
48
50
|
}
|
|
49
51
|
|
|
@@ -69,7 +71,8 @@ InlineInputs.propTypes = {
|
|
|
69
71
|
"inputWidth": PropTypes.number,
|
|
70
72
|
"label": PropTypes.string,
|
|
71
73
|
"labelInline": PropTypes.bool,
|
|
72
|
-
"labelWidth": PropTypes.number
|
|
74
|
+
"labelWidth": PropTypes.number,
|
|
75
|
+
"required": PropTypes.bool
|
|
73
76
|
};
|
|
74
77
|
InlineInputs.displayName = "InlineInputs";
|
|
75
78
|
export default InlineInputs;
|
|
@@ -14,10 +14,12 @@ export interface InlineInputsProps extends StyledContentContainerProps, StyledIn
|
|
|
14
14
|
htmlFor?: string;
|
|
15
15
|
/** Defines the label text for the heading. */
|
|
16
16
|
label?: string;
|
|
17
|
+
/** Flag to configure component as mandatory. */
|
|
18
|
+
required?: boolean;
|
|
17
19
|
}
|
|
18
20
|
export declare const InlineInputsContext: React.Context<InlineInputsContextProps>;
|
|
19
21
|
declare const InlineInputs: {
|
|
20
|
-
({ adaptiveLabelBreakpoint, label, htmlFor, children, className, gutter, inputWidth, labelInline, labelWidth, }: InlineInputsProps): JSX.Element;
|
|
22
|
+
({ adaptiveLabelBreakpoint, label, htmlFor, children, className, gutter, inputWidth, labelInline, labelWidth, required, }: InlineInputsProps): JSX.Element;
|
|
21
23
|
displayName: string;
|
|
22
24
|
};
|
|
23
25
|
export default InlineInputs;
|
|
@@ -49,7 +49,8 @@ const InlineInputs = ({
|
|
|
49
49
|
gutter = "none",
|
|
50
50
|
inputWidth,
|
|
51
51
|
labelInline = true,
|
|
52
|
-
labelWidth
|
|
52
|
+
labelWidth,
|
|
53
|
+
required
|
|
53
54
|
}) => {
|
|
54
55
|
const labelId = (0, _react.useRef)((0, _guid.default)());
|
|
55
56
|
const largeScreen = (0, _useIsAboveBreakpoint.default)(adaptiveLabelBreakpoint);
|
|
@@ -64,7 +65,8 @@ const InlineInputs = ({
|
|
|
64
65
|
return /*#__PURE__*/_react.default.createElement(_label.default, {
|
|
65
66
|
labelId: labelId.current,
|
|
66
67
|
inline: inlineLabel,
|
|
67
|
-
htmlFor: htmlFor
|
|
68
|
+
htmlFor: htmlFor,
|
|
69
|
+
isRequired: required
|
|
68
70
|
}, label);
|
|
69
71
|
}
|
|
70
72
|
|
|
@@ -90,7 +92,8 @@ InlineInputs.propTypes = {
|
|
|
90
92
|
"inputWidth": _propTypes.default.number,
|
|
91
93
|
"label": _propTypes.default.string,
|
|
92
94
|
"labelInline": _propTypes.default.bool,
|
|
93
|
-
"labelWidth": _propTypes.default.number
|
|
95
|
+
"labelWidth": _propTypes.default.number,
|
|
96
|
+
"required": _propTypes.default.bool
|
|
94
97
|
};
|
|
95
98
|
InlineInputs.displayName = "InlineInputs";
|
|
96
99
|
var _default = InlineInputs;
|