How to use the @jsonforms/core.isPlainLabel 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 / vanilla / src / controls / InputControl.tsx View on Github external
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 (
        <div id="{id}" hidden="{!visible}"></div>
github eclipsesource / jsonforms / packages / vanilla / src / controls / RadioGroupControl.tsx View on Github external
this.state.isFocused,
      appliedUiSchemaOptions.showUnfocusedDescription
    );

    const options = schema.enum;

    return (
      <div hidden="{!visible}">
        <label>
          {computeLabel(
            isPlainLabel(label) ? label : label.default,
            required,
            appliedUiSchemaOptions.hideRequiredAsterisk
          )}
        </label>

        <div style="{groupStyle}">
          {options.map(optionValue =&gt; (
            <div>
              <input checked="{data" name="{id}" id="{optionValue}" value="{optionValue}" type="radio"> this.handleChange(ev.currentTarget.value)}
              /&gt;</div></div></div>
github eclipsesource / jsonforms / packages / material / src / controls / MaterialNativeControl.tsx View on Github external
);
    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 (
      
        
      
    );
github eclipsesource / jsonforms / packages / i18n / src / index.ts View on Github external
(translations: Translations, label: string | Labels): (string | Labels) => {

    if (label === undefined || label === null) {
      return undefined;
    }

    if (isPlainLabel(label)) {
      return translate(translations, label);
    } else {
      return _.mapValues(label, l => translate(translations, l)) as Labels;
    }
  };
github eclipsesource / jsonforms / packages / material / src / controls / MaterialDateTimeControl.tsx View on Github external
path,
      handleChange,
      data,
      config
    } = this.props;
    const appliedUiSchemaOptions = merge({}, config, uischema.options);
    const isValid = errors.length === 0;
    const inputProps = {};

    return (
      
        
          
              handleChange(path, datetime ? moment(datetime).format() : '')
            }
            format='MM/DD/YYYY h:mm a'
            clearable={true}
            disabled={!enabled}
github eclipsesource / jsonforms / packages / vanilla / src / complex / TableArrayControl.tsx View on Github external
const tableClass = getStyleAsClassName('array.table.table');
    const labelClass = getStyleAsClassName('array.table.label');
    const buttonClass = getStyleAsClassName('array.table.button');
    const controlClass = [
      getStyleAsClassName('array.table'),
      convertToValidClassName(controlElement.scope)
    ].join(' ');
    const createControlElement = (key?: string): ControlElement =&gt; ({
      type: 'Control',
      label: false,
      scope: schema.type === 'object' ? `#/properties/${key}` : '#'
    });
    const labelObject = createLabelDescriptionFrom(controlElement, schema);
    const isValid = errors.length === 0;
    const divClassNames = 'validation' + (isValid ? '' : ' validation_error');
    const labelText = isPlainLabel(label) ? label : label.default;

    return (
      <div hidden="{!visible}">
        <header>
          <label>{labelText}</label>
          <button>
            Add to {labelObject.text}
          </button>
        </header>
        <div>
          {!isValid ? errors : ''}
        </div>
        <table></table></div>
github eclipsesource / jsonforms / packages / material / src / controls / MaterialDateControl.tsx View on Github external
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;
      labelCancel = 'Cancel';
      labelClear = 'Clear';
    } else {
      labelText = defaultLabel;
      labelCancel = startsWith(cancelLabel, '%') ? 'Cancel' : cancelLabel;
      labelClear = startsWith(clearLabel, '%') ? 'Clear' : clearLabel;
    }

    return (
github eclipsesource / jsonforms / packages / material / src / controls / MaterialRadioGroupControl.tsx View on Github external
const options = schema.enum;

    return (
      
        
          
            {computeLabel(
              isPlainLabel(label) ? label : label.default,
              required,
              appliedUiSchemaOptions.hideRequiredAsterisk
            )}
          

           this.handleChange(value)}
            row={true}
          &gt;
            {options.map(optionValue =&gt; (
              }
                label={optionValue}
github eclipsesource / jsonforms / packages / material / src / additional / MaterialListWithDetailRenderer.tsx View on Github external
);
  const foundUISchema = findUISchema(
    uischemas,
    schema,
    uischema.scope,
    path,
    undefined,
    uischema
  );
  const appliedUiSchemaOptions = merge({}, config, uischema.options);

  return (
    
      
      
        
          
            {data &gt; 0 ? (
              map(range(data), index =&gt; (
github eclipsesource / jsonforms / packages / material / src / controls / MaterialSliderControl.tsx View on Github external
visible,
      description,
      this.state.isFocused,
      appliedUiSchemaOptions.showUnfocusedDescription
    );
    return (
      
        
          
            {computeLabel(
              isPlainLabel(label) ? label : label.default,
              required,
              appliedUiSchemaOptions.hideRequiredAsterisk
            )}
          
          <div style="{rangeContainerStyle}">
            
              {schema.minimum}
            
            
              {schema.maximum}
            
          </div>