Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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,
items: items.map((item, index) => {
const {
schema,
uiSchema,
errorSchema,
idSchema,
name,
required,
disabled,
readonly,
autofocus,
} = this.props;
const title = (schema.title === undefined) ? name : schema.title;
const {items} = this.state;
const {definitions, fields} = this.props.registry;
const {TitleField, DescriptionField} = fields;
const itemsSchema = retrieveSchema(schema.items, definitions);
const {orderable} = {orderable: true, ...uiSchema['ui:options']};
return (
<div>
{
schema.description &&
}</div>
renderMultiSelect() {
const {
schema,
idSchema,
uiSchema,
disabled,
readonly,
autofocus,
onBlur,
onFocus,
registry,
} = this.props;
const items = this.props.formData;
const { widgets, definitions, formContext } = registry;
const itemsSchema = retrieveSchema(schema.items, definitions);
const enumOptions = optionsList(itemsSchema);
const { widget = 'select', ...options } = {
...getUiOptions(uiSchema),
enumOptions,
};
const Widget = getWidget(schema, widget, widgets);
return (
const itemSchemas = schema.items.map(item => retrieveSchema(item, definitions));
const additionalSchema = allowAdditionalItems(schema)
render() {
const {
uiSchema,
formData,
errorSchema,
idSchema,
name,
required,
disabled,
readonly,
onBlur,
registry,
} = this.props;
const { definitions, fields, formContext } = registry;
const { SchemaField, TitleField, DescriptionField } = fields;
const schema = retrieveSchema(this.props.schema, definitions);
let orderedProperties;
try {
const properties = Object.keys(schema.properties);
orderedProperties = orderProperties(properties, uiSchema['ui:order']);
} catch (err) {
return (
<div>
<p style="{{">
Invalid {name || 'root'} object field configuration:
<em>{err.message}</em>.
</p>
<pre>{JSON.stringify(schema)}</pre>
</div>
);
}
const iconTransform = !formData.isClosed ? 'flip-vertical' : '';
uiSchema,
formData,
errorSchema,
idSchema,
name,
required,
disabled,
readonly,
onBlur,
onChange,
onFocus,
registry,
} = this.props;
const { definitions, fields, formContext, widgets } = registry;
const { SchemaField, TitleField, DescriptionField } = fields;
const schema = retrieveSchema(this.props.schema, definitions);
const { widget, ...options } = getUiOptions(uiSchema);
if (typeof widget === 'string') {
if (widget === 'hidden') {
return null;
}
const Widget = getWidget(schema, widget, widgets);
const onChangeHandler = value => {
onChange(value, options);
};
return (
render() {
const {
uiSchema,
errorSchema,
idSchema,
required,
disabled,
readonly,
onBlur,
formData
} = this.props
const { definitions, fields, formContext } = this.props.registry
const { SchemaField, TitleField, DescriptionField } = fields
const schema = retrieveSchema(this.props.schema, definitions)
const title = (schema.title === undefined) ? '' : schema.title
const layout = uiSchema['ui:layout']
return (
<fieldset>
{title ? : null}
{schema.description ?
: null}</fieldset>
render() {
const {
uiSchema,
errorSchema,
idSchema,
name,
required,
disabled,
readonly
} = this.props;
const widget = uiSchema['ui:widget'];
const {definitions, fields, formContext} = this.props.registry;
const {SchemaField, TitleField, DescriptionField} = fields;
const baseSchema = retrieveSchema(this.props.schema, definitions);
const title = (baseSchema.title === undefined) ? name : baseSchema.title;
const schema = cloneDeep(baseSchema);
if (widget === 'hidden') {
return null;
}
if (schema.nullable && this.nullValue) {
return (
<fieldset>
{title && (
</fieldset>
const {
schema,
uiSchema,
errorSchema,
idSchema,
name,
required,
disabled,
readonly,
autofocus,
} = this.props;
const title = (schema.title === undefined) ? name : schema.title;
const {items} = this.state;
const {definitions, fields} = this.props.registry;
const {TitleField, DescriptionField} = fields;
const itemsSchema = retrieveSchema(schema.items, definitions);
const {orderable} = {orderable: true, ...uiSchema['ui:options']};
return (
<div>
{
schema.description &&
}</div>