feat: add missing propTypes

This commit is contained in:
kasia.oczkowska
2024-06-05 13:26:56 +01:00
parent 725b38c697
commit 3f5df118a0
53 changed files with 597 additions and 81 deletions

View File

@@ -1,6 +1,7 @@
import * as React from 'react';
import MuiTextField from '@mui/material/TextField';
import CircularProgress from '@mui/material/CircularProgress';
import PropTypes from 'prop-types';
import useDynamicFields from 'hooks/useDynamicFields';
import useDynamicData from 'hooks/useDynamicData';
@@ -9,11 +10,11 @@ import TextField from 'components/TextField';
import ControlledAutocomplete from 'components/ControlledAutocomplete';
import ControlledCustomAutocomplete from 'components/ControlledCustomAutocomplete';
import DynamicField from 'components/DynamicField';
import { FieldPropType } from 'propTypes/propTypes';
const optionGenerator = (options) =>
options?.map(({ name, value }) => ({ label: name, value: value }));
export default function InputCreator(props) {
function InputCreator(props) {
const {
onChange,
onBlur,
@@ -131,7 +132,8 @@ export default function InputCreator(props) {
<React.Fragment>
<PowerInput
key={computedName}
label={label}
// label={label}
label="PowerInput"
description={description}
name={computedName}
required={required}
@@ -204,3 +206,16 @@ export default function InputCreator(props) {
}
return <React.Fragment />;
}
InputCreator.propTypes = {
onChange: PropTypes.func,
onBlur: PropTypes.func,
schema: FieldPropType.isRequired,
namePrefix: PropTypes.string,
stepId: PropTypes.string,
disabled: PropTypes.bool,
showOptionValue: PropTypes.bool,
shouldUnregister: PropTypes.bool,
};
export default InputCreator;