@trackunit/react-form-components 0.0.455 → 0.0.459
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/index.cjs.js +2 -2
- package/index.esm.js +2 -2
- package/package.json +1 -1
package/index.cjs.js
CHANGED
|
@@ -904,7 +904,7 @@ EmailInput.displayName = "EmailInput";
|
|
|
904
904
|
*
|
|
905
905
|
*/
|
|
906
906
|
const EmailField = React.forwardRef((_a, ref) => {
|
|
907
|
-
var { label, id, tip, helpText, errorMessage, helpAddon, className, defaultValue, dataTestId, value, onChange, isInvalid = false } = _a, rest = __rest(_a, ["label", "id", "tip", "helpText", "errorMessage", "helpAddon", "className", "defaultValue", "dataTestId", "value", "onChange", "isInvalid"]);
|
|
907
|
+
var { label, id, tip, helpText, errorMessage, helpAddon, className, defaultValue, dataTestId, value, disabled, onChange, isInvalid = false } = _a, rest = __rest(_a, ["label", "id", "tip", "helpText", "errorMessage", "helpAddon", "className", "defaultValue", "dataTestId", "value", "disabled", "onChange", "isInvalid"]);
|
|
908
908
|
const htmlForId = id ? id : "emailField-" + uuid.v4();
|
|
909
909
|
// Type guard to check if value is a string
|
|
910
910
|
function isString(inputValue) {
|
|
@@ -916,7 +916,7 @@ const EmailField = React.forwardRef((_a, ref) => {
|
|
|
916
916
|
onChange(event);
|
|
917
917
|
}
|
|
918
918
|
}, [onChange]);
|
|
919
|
-
return (jsxRuntime.jsx(FormGroup, { dataTestId: dataTestId ? `${dataTestId}-FormGroup` : undefined, disabled:
|
|
919
|
+
return (jsxRuntime.jsx(FormGroup, { dataTestId: dataTestId ? `${dataTestId}-FormGroup` : undefined, disabled: disabled, helpAddon: helpAddon, helpText: (renderAsInvalid && errorMessage) || helpText, htmlFor: htmlForId, isInvalid: renderAsInvalid, label: label, required: rest.required, tip: tip, children: jsxRuntime.jsx(EmailInput, Object.assign({ "aria-labelledby": htmlForId + "-label", defaultValue: defaultValue, disabled: disabled, id: htmlForId, isInvalid: renderAsInvalid, onChange: handleChange, ref: ref, value: value }, rest, { className: className, dataTestId: dataTestId })) }));
|
|
920
920
|
});
|
|
921
921
|
EmailField.displayName = "EmailField";
|
|
922
922
|
|
package/index.esm.js
CHANGED
|
@@ -874,7 +874,7 @@ EmailInput.displayName = "EmailInput";
|
|
|
874
874
|
*
|
|
875
875
|
*/
|
|
876
876
|
const EmailField = forwardRef((_a, ref) => {
|
|
877
|
-
var { label, id, tip, helpText, errorMessage, helpAddon, className, defaultValue, dataTestId, value, onChange, isInvalid = false } = _a, rest = __rest(_a, ["label", "id", "tip", "helpText", "errorMessage", "helpAddon", "className", "defaultValue", "dataTestId", "value", "onChange", "isInvalid"]);
|
|
877
|
+
var { label, id, tip, helpText, errorMessage, helpAddon, className, defaultValue, dataTestId, value, disabled, onChange, isInvalid = false } = _a, rest = __rest(_a, ["label", "id", "tip", "helpText", "errorMessage", "helpAddon", "className", "defaultValue", "dataTestId", "value", "disabled", "onChange", "isInvalid"]);
|
|
878
878
|
const htmlForId = id ? id : "emailField-" + v4();
|
|
879
879
|
// Type guard to check if value is a string
|
|
880
880
|
function isString(inputValue) {
|
|
@@ -886,7 +886,7 @@ const EmailField = forwardRef((_a, ref) => {
|
|
|
886
886
|
onChange(event);
|
|
887
887
|
}
|
|
888
888
|
}, [onChange]);
|
|
889
|
-
return (jsx(FormGroup, { dataTestId: dataTestId ? `${dataTestId}-FormGroup` : undefined, disabled:
|
|
889
|
+
return (jsx(FormGroup, { dataTestId: dataTestId ? `${dataTestId}-FormGroup` : undefined, disabled: disabled, helpAddon: helpAddon, helpText: (renderAsInvalid && errorMessage) || helpText, htmlFor: htmlForId, isInvalid: renderAsInvalid, label: label, required: rest.required, tip: tip, children: jsx(EmailInput, Object.assign({ "aria-labelledby": htmlForId + "-label", defaultValue: defaultValue, disabled: disabled, id: htmlForId, isInvalid: renderAsInvalid, onChange: handleChange, ref: ref, value: value }, rest, { className: className, dataTestId: dataTestId })) }));
|
|
890
890
|
});
|
|
891
891
|
EmailField.displayName = "EmailField";
|
|
892
892
|
|