fix(striker-ui): expose name prop in OutlinedInputWithLabel and SelectWithLabel

main
Tsu-ba-me 2 years ago
parent 61bc4c9c34
commit 99d1e8cad0
  1. 16
      striker-ui/components/OutlinedInputWithLabel.tsx
  2. 2
      striker-ui/components/SelectWithLabel.tsx
  3. 2
      striker-ui/types/SelectWithLabel.d.ts

@ -31,9 +31,6 @@ type OutlinedInputWithLabelOptionalPropsWithDefault = {
}; };
type OutlinedInputWithLabelOptionalPropsWithoutDefault = { type OutlinedInputWithLabelOptionalPropsWithoutDefault = {
onBlur?: OutlinedInputProps['onBlur'];
onChange?: OutlinedInputProps['onChange'];
onFocus?: OutlinedInputProps['onFocus'];
onHelp?: MUIIconButtonProps['onClick']; onHelp?: MUIIconButtonProps['onClick'];
onHelpAppend?: MUIIconButtonProps['onClick']; onHelpAppend?: MUIIconButtonProps['onClick'];
type?: string; type?: string;
@ -43,9 +40,13 @@ type OutlinedInputWithLabelOptionalProps =
OutlinedInputWithLabelOptionalPropsWithDefault & OutlinedInputWithLabelOptionalPropsWithDefault &
OutlinedInputWithLabelOptionalPropsWithoutDefault; OutlinedInputWithLabelOptionalPropsWithoutDefault;
type OutlinedInputWithLabelProps = OutlinedInputWithLabelOptionalProps & { type OutlinedInputWithLabelProps = Pick<
OutlinedInputProps,
'name' | 'onBlur' | 'onChange' | 'onFocus'
> &
OutlinedInputWithLabelOptionalProps & {
label: string; label: string;
}; };
const OUTLINED_INPUT_WITH_LABEL_DEFAULT_PROPS: Required<OutlinedInputWithLabelOptionalPropsWithDefault> & const OUTLINED_INPUT_WITH_LABEL_DEFAULT_PROPS: Required<OutlinedInputWithLabelOptionalPropsWithDefault> &
OutlinedInputWithLabelOptionalPropsWithoutDefault = { OutlinedInputWithLabelOptionalPropsWithoutDefault = {
@ -56,9 +57,6 @@ const OUTLINED_INPUT_WITH_LABEL_DEFAULT_PROPS: Required<OutlinedInputWithLabelOp
inputProps: {}, inputProps: {},
inputLabelProps: {}, inputLabelProps: {},
messageBoxProps: {}, messageBoxProps: {},
onBlur: undefined,
onChange: undefined,
onFocus: undefined,
onHelp: undefined, onHelp: undefined,
onHelpAppend: undefined, onHelpAppend: undefined,
required: false, required: false,
@ -78,6 +76,7 @@ const OutlinedInputWithLabel: FC<OutlinedInputWithLabelProps> = ({
inputLabelProps = OUTLINED_INPUT_WITH_LABEL_DEFAULT_PROPS.inputLabelProps, inputLabelProps = OUTLINED_INPUT_WITH_LABEL_DEFAULT_PROPS.inputLabelProps,
label, label,
messageBoxProps = OUTLINED_INPUT_WITH_LABEL_DEFAULT_PROPS.messageBoxProps, messageBoxProps = OUTLINED_INPUT_WITH_LABEL_DEFAULT_PROPS.messageBoxProps,
name,
onBlur, onBlur,
onChange, onChange,
onFocus, onFocus,
@ -172,6 +171,7 @@ const OutlinedInputWithLabel: FC<OutlinedInputWithLabelProps> = ({
fullWidth={formControlProps.fullWidth} fullWidth={formControlProps.fullWidth}
id={id} id={id}
label={label} label={label}
name={name}
onBlur={onBlur} onBlur={onBlur}
onChange={onChange} onChange={onChange}
onFocus={onFocus} onFocus={onFocus}

@ -21,6 +21,7 @@ const SelectWithLabel: FC<SelectWithLabelProps> = ({
inputLabelProps = {}, inputLabelProps = {},
isReadOnly = false, isReadOnly = false,
messageBoxProps = {}, messageBoxProps = {},
name,
onChange, onChange,
selectProps: { selectProps: {
multiple: selectMultiple, multiple: selectMultiple,
@ -97,6 +98,7 @@ const SelectWithLabel: FC<SelectWithLabelProps> = ({
id={id} id={id}
input={inputElement} input={inputElement}
multiple={selectMultiple} multiple={selectMultiple}
name={name}
onChange={onChange} onChange={onChange}
readOnly={isReadOnly} readOnly={isReadOnly}
value={selectValue} value={selectValue}

@ -23,7 +23,7 @@ type SelectWithLabelOptionalProps = {
}; };
type SelectWithLabelProps = SelectWithLabelOptionalProps & type SelectWithLabelProps = SelectWithLabelOptionalProps &
Pick<SelectProps, 'onChange' | 'value'> & { Pick<SelectProps, 'name' | 'onChange' | 'value'> & {
id: string; id: string;
selectItems: Array<SelectItem | string>; selectItems: Array<SelectItem | string>;
}; };

Loading…
Cancel
Save