Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
render() {
const { schema, uiSchema, idSchema, registry } = this.props;
const { definitions } = registry;
// eslint-disable-next-line no-prototype-builtins
if (!schema.hasOwnProperty('items')) {
return (
);
}
if (isFixedItems(schema)) {
return this.renderFixedArray();
}
if (isFilesArray(schema, uiSchema, definitions)) {
return this.renderFiles();
}
if (isMultiSelect(schema, definitions)) {
return this.renderMultiSelect();
}
return this.renderNormalArray();
}
}
const ArrayFieldTemplate = (props: ArrayFieldTemplateProps) => {
const { schema, registry = getDefaultRegistry() } = props;
if (isMultiSelect(schema, registry.definitions)) {
return ;
} else {
return ;
}
};
const ArrayFieldTemplate = (props: ArrayFieldTemplateProps) => {
const { schema, registry = getDefaultRegistry() } = props;
if (isMultiSelect(schema, registry.definitions)) {
return ;
} else {
return ;
}
};
render() {
const {schema, uiSchema} = this.props;
const widget = uiSchema['ui:widget'];
if (widget === 'hidden') {
return null;
}
if (isFilesArray(schema, uiSchema)) {
return this.renderFiles();
}
if (isFixedItems(schema)) {
return this.renderFixedArray();
}
if (isMultiSelect(schema)) {
return this.renderMultiSelect();
}
if (schema.items.type === 'object') {
return this.renderObjectArray();
}
return this.renderNormalArray();
}
export function DefaultLabel({
schema,
uiSchema,
definitions,
required,
id,
name,
fields = {},
formContext,
}) {
const uiOptions = getUiOptions(uiSchema);
let { label: displayLabel = true, forceLabelDisplay } = uiOptions;
if (schema.type === "array") {
displayLabel =
isMultiSelect(schema, definitions) ||
isFilesArray(schema, uiSchema, definitions);
}
if (schema.type === "object") {
displayLabel = false;
}
if (schema.type === "boolean" && !uiSchema["ui:widget"]) {
displayLabel = false;
}
const label = uiSchema["ui:title"] || schema.title || name;
const description = uiSchema["ui:description"] || schema.description;
const { DescriptionField = DefaultDescriptionField } = fields;
if (displayLabel || forceLabelDisplay) {
return [