Add checkbox name and fieldname props to CustomThreshold

This commit is contained in:
Alex Holliday committed 2024-12-10 11:30:25 +08:00
1 parent de149503ae
commit f64e4d04ef
1 file changed
+6
@@ -43,10 +43,12 @@ import PropTypes from "prop-types";
*/ */
export const CustomThreshold = ({ export const CustomThreshold = ({
checkboxId, checkboxId,
checkboxName,
checkboxLabel, checkboxLabel,
onCheckboxChange, onCheckboxChange,
isChecked, isChecked,
fieldId, fieldId,
fieldName,
fieldValue, fieldValue,
onFieldChange, onFieldChange,
onFieldBlur, onFieldBlur,
@@ -66,6 +68,7 @@ export const CustomThreshold = ({
<Box> <Box>
<Checkbox <Checkbox
id={checkboxId} id={checkboxId}
name={checkboxName}
label={checkboxLabel} label={checkboxLabel}
isChecked={isChecked} isChecked={isChecked}
onChange={onCheckboxChange} onChange={onCheckboxChange}
@@ -81,6 +84,7 @@ export const CustomThreshold = ({
maxWidth="var(--env-var-width-4)" maxWidth="var(--env-var-width-4)"
type="number" type="number"
id={fieldId} id={fieldId}
name={fieldName}
value={fieldValue} value={fieldValue}
onBlur={onFieldBlur} onBlur={onFieldBlur}
onChange={onFieldChange} onChange={onFieldChange}
@@ -101,10 +105,12 @@ export const CustomThreshold = ({
CustomThreshold.propTypes = { CustomThreshold.propTypes = {
checkboxId: PropTypes.string, checkboxId: PropTypes.string,
checkboxName: PropTypes.string,
checkboxLabel: PropTypes.string.isRequired, checkboxLabel: PropTypes.string.isRequired,
isChecked: PropTypes.bool.isRequired, isChecked: PropTypes.bool.isRequired,
onCheckboxChange: PropTypes.func.isRequired, onCheckboxChange: PropTypes.func.isRequired,
fieldId: PropTypes.string.isRequired, fieldId: PropTypes.string.isRequired,
fieldName: PropTypes.string,
fieldValue: PropTypes.string.isRequired, fieldValue: PropTypes.string.isRequired,
onFieldChange: PropTypes.func.isRequired, onFieldChange: PropTypes.func.isRequired,
onFieldBlur: PropTypes.func.isRequired, onFieldBlur: PropTypes.func.isRequired,