How to use the react-jsonschema-form/lib/utils.isFilesArray function in react-jsonschema-form

To help you get started, we’ve selected a few react-jsonschema-form examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github cloudwan / gohan_webui / src / Dialog / formComponents / CustomSchemaField / CustomSchemaField.js View on Github external
const {uiSchema, errorSchema, idSchema, name, required, registry} = props;
  const {definitions, fields, formContext, FieldTemplate = DefaultTemplate} = registry;
  const schema = retrieveSchema(props.schema, definitions);
  const FieldComponent = getFieldComponent(schema, uiSchema, fields);
  const disabled = Boolean(props.disabled || uiSchema['ui:disabled']);
  const readonly = Boolean(props.readonly || uiSchema['ui:readonly']);
  const autofocus = Boolean(props.autofocus || uiSchema['ui:autofocus']);

  if (Object.keys(schema).length === 0) {
    // See #312: Ensure compatibility with old versions of React.
    return <div>;
  }

  let displayLabel = true;
  if (schema.type === 'array') {
    displayLabel = isMultiSelect(schema) || isFilesArray(schema, uiSchema);
  }
  if (schema.type === 'object') {
    displayLabel = false;
  }
  if (schema.type === 'boolean' &amp;&amp; !uiSchema['ui:widget']) {
    displayLabel = false;
  }
  if (uiSchema['ui:field']) {
    displayLabel = false;
  }

  const field = (
    </div>
github Talend / ui / packages / forms / src / deprecated / fields / ArrayField.js View on Github external
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();
	}
}
github RxNT / react-jsonschema-form-extras / src / Label.js View on Github external
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" &amp;&amp; !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 [
      <label id="{id}" required="{required}" label="{label}">,</label>
github cloudwan / gohan_webui / src / Form / formComponents / fields / ArrayField / ArrayField.js View on Github external
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();
  }