Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
uiSchema,
errorSchema,
idSchema,
name,
required,
disabled,
readonly,
autofocus,
} = this.props;
const title = schema.title || name;
let {items} = this.state;
const {definitions, fields} = this.props.registry;
const {TitleField} = fields;
const itemSchemas = schema.items.map(item =>
retrieveSchema(item, definitions));
const additionalSchema = allowAdditionalItems(schema) ?
retrieveSchema(schema.additionalItems, definitions) : null;
if (!items || items.length < itemSchemas.length) {
// to make sure at least all fixed items are generated
items = items || [];
items = items.concat(new Array(itemSchemas.length - items.length));
}
return (
<fieldset>
{schema.description ?</fieldset>
idSchema,
name,
required,
disabled,
readonly,
autofocus,
registry,
onBlur,
onFocus,
} = this.props;
const title = schema.title || name;
let items = this.props.formData;
const { ArrayFieldTemplate, definitions, fields } = registry;
const { TitleField } = fields;
const itemSchemas = schema.items.map(item => retrieveSchema(item, definitions));
const additionalSchema = allowAdditionalItems(schema)
? retrieveSchema(schema.additionalItems, definitions)
: null;
const { addable = true } = getUiOptions(uiSchema);
const canAdd = addable && additionalSchema;
if (!items || items.length < itemSchemas.length) {
// to make sure at least all fixed items are generated
items = items || [];
items = items.concat(new Array(itemSchemas.length - items.length));
}
// These are the props passed into the render function
const arrayProps = {
canAdd,
className: 'field field-array field-array-fixed-items',
disabled,
idSchema,