How to use the @jsonforms/core.isDescriptionHidden function in @jsonforms/core

To help you get started, we’ve selected a few @jsonforms/core 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 eclipsesource / jsonforms / packages / material / src / controls / MaterialInputControl.tsx View on Github external
visible,
      required,
      config,
      input
    } = this.props;
    const isValid = errors.length === 0;
    const appliedUiSchemaOptions = merge({}, config, uischema.options);
    const inputLabelStyle: { [x: string]: any } = {
      whiteSpace: 'nowrap',
      overflow: 'hidden',
      textOverflow: 'ellipsis',
      // magic width as the label is transformed to 75% of its size
      width: '125%'
    };

    const showDescription = !isDescriptionHidden(
      visible,
      description,
      this.state.isFocused,
      appliedUiSchemaOptions.showUnfocusedDescription
    );

    const firstFormHelperText = showDescription
      ? description
      : !isValid
      ? errors
      : null;
    const secondFormHelperText = showDescription && !isValid ? errors : null;

    const InnerComponent = input;
    return (
github eclipsesource / jsonforms / packages / vanilla / src / controls / InputControl.tsx View on Github external
uischema,
      schema,
      visible,
      required,
      path,
      cells,
      config
    } = this.props;

    const isValid = errors.length === 0;
    const divClassNames = `validation  ${
      isValid ? classNames.description : 'validation_error'
    }`;

    const appliedUiSchemaOptions = merge({}, config, uischema.options);
    const showDescription = !isDescriptionHidden(
      visible,
      description,
      this.state.isFocused,
      appliedUiSchemaOptions.showUnfocusedDescription
    );
    const labelText = isPlainLabel(label) ? label : label.default;
    const cell = maxBy(cells, r => r.tester(uischema, schema));
    if (
      cell === undefined ||
      cell.tester(uischema, schema) === NOT_APPLICABLE
    ) {
      console.warn('No applicable cell found.', uischema, schema);
      return null;
    } else {
      return (
github eclipsesource / jsonforms / packages / material / src / controls / MaterialDateControl.tsx View on Github external
uischema,
      visible,
      enabled,
      required,
      path,
      handleChange,
      data,
      momentLocale,
      config
    } = this.props;
    const defaultLabel = label as string;
    const cancelLabel = '%cancel';
    const clearLabel = '%clear';
    const isValid = errors.length === 0;
    const appliedUiSchemaOptions = merge({}, config, uischema.options);
    const showDescription = !isDescriptionHidden(
      visible,
      description,
      this.state.isFocused,
      appliedUiSchemaOptions.showUnfocusedDescription
    );
    const inputProps = {};
    const localeDateTimeFormat = momentLocale
      ? `${momentLocale.localeData().longDateFormat('L')}`
      : 'YYYY-MM-DD';

    let labelText;
    let labelCancel;
    let labelClear;

    if (isPlainLabel(label)) {
      labelText = label;
github eclipsesource / jsonforms / packages / material / src / controls / MaterialRadioGroupControl.tsx View on Github external
id,
      label,
      required,
      description,
      errors,
      data,
      schema,
      visible
    } = this.props;
    const isValid = errors.length === 0;
    const appliedUiSchemaOptions = merge(
      {},
      config,
      this.props.uischema.options
    );
    const showDescription = !isDescriptionHidden(
      visible,
      description,
      this.state.isFocused,
      appliedUiSchemaOptions.showUnfocusedDescription
    );

    const options = schema.enum;

    return (
github eclipsesource / jsonforms / packages / vanilla / src / controls / RadioGroupControl.tsx View on Github external
schema,
      uischema,
      visible,
      config
    } = this.props;
    const isValid = errors.length === 0;
    const divClassNames = `validation  ${
      isValid ? classNames.description : 'validation_error'
    }`;
    const groupStyle: { [x: string]: any } = {
      display: 'flex',
      flexDirection: 'row'
    };

    const appliedUiSchemaOptions = merge({}, config, uischema.options);
    const showDescription = !isDescriptionHidden(
      visible,
      description,
      this.state.isFocused,
      appliedUiSchemaOptions.showUnfocusedDescription
    );

    const options = schema.enum;

    return (
      <div hidden="{!visible}">
        <label></label></div>
github eclipsesource / jsonforms / packages / material / src / controls / MaterialSliderControl.tsx View on Github external
whiteSpace: 'nowrap',
      overflow: 'hidden',
      textOverflow: 'ellipsis',
      width: '100%'
    };
    const rangeContainerStyle: { [x: string]: any } = {
      display: 'flex'
    };
    const rangeItemStyle: { [x: string]: any } = {
      flexGrow: '1'
    };
    const sliderStyle: { [x: string]: any } = {
      marginTop: '7px'
    };

    const showDescription = !isDescriptionHidden(
      visible,
      description,
      this.state.isFocused,
      appliedUiSchemaOptions.showUnfocusedDescription
    );
    return (
      
        
          
            {computeLabel(
              isPlainLabel(label) ? label : label.default,
github eclipsesource / jsonforms / packages / material / src / controls / MaterialNativeControl.tsx View on Github external
visible,
      required,
      path,
      handleChange,
      data,
      config
    } = this.props;
    const isValid = errors.length === 0;
    const appliedUiSchemaOptions = merge(
      {},
      config,
      this.props.uischema.options
    );
    const onChange = (ev: any) =&gt; handleChange(path, ev.target.value);
    const fieldType = schema.format;
    const showDescription = !isDescriptionHidden(
      visible,
      description,
      this.state.isFocused,
      appliedUiSchemaOptions.showUnfocusedDescription
    );

    return (