fix(striker-ui): expose required in OutlinedInputWithLabel

main
Tsu-ba-me 2 years ago
parent 0f573fe3e0
commit 4eca5398fe
  1. 9
      striker-ui/components/OutlinedInputWithLabel.tsx

@ -29,6 +29,7 @@ type OutlinedInputWithLabelOptionalProps = {
onChange?: OutlinedInputProps['onChange']; onChange?: OutlinedInputProps['onChange'];
onHelp?: MUIIconButtonProps['onClick']; onHelp?: MUIIconButtonProps['onClick'];
onHelpAppend?: MUIIconButtonProps['onClick']; onHelpAppend?: MUIIconButtonProps['onClick'];
required?: boolean;
value?: OutlinedInputProps['value']; value?: OutlinedInputProps['value'];
}; };
@ -56,6 +57,7 @@ const OUTLINED_INPUT_WITH_LABEL_DEFAULT_PROPS: Required<
onChange: undefined, onChange: undefined,
onHelp: undefined, onHelp: undefined,
onHelpAppend: undefined, onHelpAppend: undefined,
required: false,
value: '', value: '',
}; };
@ -74,6 +76,7 @@ const OutlinedInputWithLabel: FC<OutlinedInputWithLabelProps> = ({
onChange, onChange,
onHelp, onHelp,
onHelpAppend, onHelpAppend,
required = OUTLINED_INPUT_WITH_LABEL_DEFAULT_PROPS.required,
value = OUTLINED_INPUT_WITH_LABEL_DEFAULT_PROPS.value, value = OUTLINED_INPUT_WITH_LABEL_DEFAULT_PROPS.value,
}) => { }) => {
const { sx: formControlSx, ...restFormControlProps } = formControlProps; const { sx: formControlSx, ...restFormControlProps } = formControlProps;
@ -113,7 +116,11 @@ const OutlinedInputWithLabel: FC<OutlinedInputWithLabelProps> = ({
{...restFormControlProps} {...restFormControlProps}
sx={{ width: formControlWidth, ...formControlSx }} sx={{ width: formControlWidth, ...formControlSx }}
> >
<OutlinedInputLabel {...{ htmlFor: id, ...inputLabelProps }}> <OutlinedInputLabel
htmlFor={id}
isNotifyRequired={required}
{...inputLabelProps}
>
{label} {label}
</OutlinedInputLabel> </OutlinedInputLabel>
<OutlinedInput <OutlinedInput

Loading…
Cancel
Save