Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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 (
);
formData,
required,
disabled,
readonly,
autofocus,
registry,
onChange,
onBlur,
onFocus,
} = props;
const { title, format } = schema;
const { widgets, formContext } = registry;
const enumOptions = isSelect(schema) ? optionsList(schema) : undefined;
const defaultWidget = format || (enumOptions ? 'select' : 'text');
const { widget = defaultWidget, placeholder = '', ...options } = getUiOptions(uiSchema);
const Widget = getWidget(schema, widget, widgets);
const onChangeHandler = value => {
onChange(value, options);
};
return (
registry,
formContext,
onBlur,
onChange,
onFocus,
} = this.props;
const title = schema.title === undefined ? name : schema.title;
const { ArrayFieldTemplate, definitions, fields, widgets } = registry;
const { TitleField, DescriptionField } = fields;
const itemsSchema = retrieveSchema(schema.items, definitions);
const { widget, addable = true, type = 'element', ...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 (
);
}
onChange: onChangeHandler,
onBlur: onBlurHandler,
label: title === undefined ? name : title,
value: formData,
checked: formData,
required,
disabled,
readonly,
registry,
formContext,
autofocus,
'data-feature': uiSchema['data-feature'],
};
if (widget) {
const Widget = getWidget(schema, widget, widgets);
return ;
}
return ;
}
static getWidget(schema, widget, widgets) {
if (widget === 'password') {
throw Error(
'You should not use the widget "password" within a collaborative form'
);
} else {
return getWidget(schema, widget, widgets);
}
}
label: (title === undefined) ? name : title,
value: formData,
step: uiSchema['ui:step'],
onChange,
required,
disabled,
readonly,
formContext,
autofocus
};
if (schema.options !== undefined) {
const enumOptions = optionsListObject(schema);
if (widget) {
const Widget = getWidget(schema, widget, {...registry.widgets, ...widgets}, {enumOptions});
return ;
}
return (
);
} else if (Array.isArray(schema.enum)) {
const enumOptions = optionsList(schema);
if (widget) {
const Widget = getWidget(schema, widget, {...registry.widgets, ...widgets}, {enumOptions});
return ;
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 (
);
}
} = this.props;
const {items} = this.state;
const {widgets, definitions} = this.props.registry;
const itemsSchema = retrieveSchema(schema.items, definitions);
const enumOptions = (itemsSchema && itemsSchema.options) ?
optionsListObject(itemsSchema) :
optionsList(itemsSchema);
const {
widget = 'select',
...options
} = {
...getUiOptions(uiSchema),
enumOptions,
};
const Widget = getWidget(schema, widget, widgets);
return (
);
}
schema,
uiSchema,
idSchema,
name,
disabled,
readonly,
autofocus,
onBlur,
onFocus,
registry,
} = this.props;
const title = schema.title || name;
const items = this.props.formData;
const { widgets, formContext } = registry;
const { widget = 'files', ...options } = getUiOptions(uiSchema);
const Widget = getWidget(schema, widget, widgets);
return (