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

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

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

Loading…
Cancel
Save