Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
orderAndFilterProperties(schema, uiSchema) {
const properties = Object.keys(schema.properties);
const orderedProperties = orderProperties(properties, _.get('ui:order', uiSchema));
const filteredProperties = orderedProperties.filter(prop => !schema.properties[prop]['ui:hidden']);
const groupedProperties = _.groupBy((item) => {
const expandUnderField = _.get([item, 'ui:options', 'expandUnder'], uiSchema);
return expandUnderField || item;
}, filteredProperties);
return _.values(groupedProperties);
}
readonly,
idPrefix,
onBlur,
onFocus,
registry = getDefaultRegistry(),
} = this.props;
const { definitions, fields, formContext } = registry;
const { SchemaField, TitleField, DescriptionField } = fields;
const schema = retrieveSchema(this.props.schema, definitions, formData);
const title = schema.title === undefined ? name : schema.title;
const description = uiSchema['ui:description'] || schema.description;
let orderedProperties: string[];
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 Template = registry.ObjectFieldTemplate || DefaultObjectFieldTemplate;
const templateProps = {
title: uiSchema['ui:title'] || title,
description,
schema={schema}
formData={formData}
uiSchema={uiSchema}
registry={this.props.registry}
definitions={definitions}
/>
);
}
const title = schema.title === undefined ? name : schema.title;
const description = uiSchema['ui:description'] || schema.description;
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 Template = registry.ObjectFieldTemplate || DefaultObjectFieldTemplate;
const templateProps = {
title: uiSchema['ui:title'] || title,
actions.hide.forEach(propertyKey => {
if (
this.state[key] === value ||
(value === '' && (this.state[key] === null || this.state[key] === undefined))
) {
delete schema.properties[propertyKey];
}
});
}
});
});
let orderedProperties;
try {
const properties = Object.keys(schema.properties);
orderedProperties = orderProperties(
properties, Object.keys(schema.properties).reduce((result, item) => {
if (!result.includes(item)) {
result.push(item);
}
return result;
}, schema.propertiesOrder)
.filter(item => properties.includes(item)) || uiSchema['ui:order']
);
} catch (err) {
return (
<div>
<p style="{{color:">
Invalid {name || 'root'} object field configuration:
<em>{err.message}</em>.
</p></div>
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' : '';
return (
<fieldset>
<div role="button" id="{`${idSchema.$id}__title_bar`}">
{title && (</div></fieldset>