How to use the simple-react-form.registerType function in simple-react-form

To help you get started, we’ve selected a few simple-react-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 nicolaslopezj / simple-react-form / material-ui / lib / fields / select-with-method.js View on Github external
_react2.default.createElement(
          'div',
          null,
          this.renderItems()
        )
      );
    }
  }]);

  return SelectWithMethodComponent;
}(_simpleReactForm.FieldType);

SelectWithMethodComponent.propTypes = propTypes;
SelectWithMethodComponent.defaultProps = defaultProps;

(0, _simpleReactForm.registerType)({
  type: 'select-with-method',
  component: SelectWithMethodComponent,
  description: 'A select input that connects to a Meteor Method to fetch data.'
});
github nicolaslopezj / simple-react-form / material-ui / lib / fields / date-picker.js View on Github external
value: this.props.value,
        floatingLabelText: this.props.useHint ? null : this.props.label,
        hintText: this.props.useHint ? this.props.label : null,
        errorText: this.props.errorMessage,
        disabled: this.props.disabled,
        onChange: function onChange(_, date) {
          return _this2.props.onChange(date);
        }
      }, this.passProps));
    }
  }]);

  return DatePickerComponent;
}(_simpleReactForm.FieldType);

(0, _simpleReactForm.registerType)({
  type: 'date-picker',
  component: DatePickerComponent,
  allowedTypes: [Date],
  description: 'Material UI Date picker.'
});
github nicolaslopezj / simple-react-form / material-ui / lib / fields / multiple-checkbox.js View on Github external
'div',
          { style: { color: 'red' } },
          this.props.errorMessage
        ),
        this.renderOptions()
      );
    }
  }]);

  return MultipleCheckboxComponent;
}(_simpleReactForm.FieldType);

MultipleCheckboxComponent.propTypes = propTypes;
MultipleCheckboxComponent.defaultProps = defaultProps;

(0, _simpleReactForm.registerType)({
  type: 'multiple-checkbox',
  component: MultipleCheckboxComponent,
  allowedTypes: [[String], [Number]],
  description: 'Select multiple values with checkboxes.'
});
github nicolaslopezj / simple-react-form / material-ui / lib / fields / files / input.js View on Github external
_react2.default.createElement(
          'div',
          { style: _styles2.default.errorMessage },
          this.props.errorMessage
        )
      );
    }
  }]);

  return Component;
}(_simpleReactForm.FieldType);

exports.default = Component;


(0, _simpleReactForm.registerType)({
  type: 'file',
  component: Component,
  allowedTypes: [Object, [Object]],
  description: 'File field.'
});
github nicolaslopezj / simple-react-form / material-ui / lib / fields / textarea.js View on Github external
errorText: this.props.errorMessage,
        disabled: this.props.disabled,
        onChange: function onChange(event) {
          return _this2.props.onChange(event.target.value);
        }
      }, this.passProps));
    }
  }]);

  return TextareaComponent;
}(_simpleReactForm.FieldType);

TextareaComponent.propTypes = propTypes;
TextareaComponent.defaultProps = defaultProps;

(0, _simpleReactForm.registerType)({
  type: 'textarea',
  component: TextareaComponent,
  allowedTypes: [String],
  description: 'Textarea'
});
github nicolaslopezj / simple-react-form / material-ui / lib / fields / text-field.js View on Github external
var NumberFieldComponent = function (_TextFieldComponent2) {
  _inherits(NumberFieldComponent, _TextFieldComponent2);

  function NumberFieldComponent(props) {
    _classCallCheck(this, NumberFieldComponent);

    var _this4 = _possibleConstructorReturn(this, Object.getPrototypeOf(NumberFieldComponent).call(this, props));

    _this4.type = 'number';
    return _this4;
  }

  return NumberFieldComponent;
}(TextFieldComponent);

(0, _simpleReactForm.registerType)({
  type: 'number',
  component: NumberFieldComponent
});

var DateFieldComponent = function (_TextFieldComponent3) {
  _inherits(DateFieldComponent, _TextFieldComponent3);

  function DateFieldComponent(props) {
    _classCallCheck(this, DateFieldComponent);

    var _this5 = _possibleConstructorReturn(this, Object.getPrototypeOf(DateFieldComponent).call(this, props));

    _this5.type = 'date';
    return _this5;
  }
github nicolaslopezj / simple-react-form / material-ui / lib / fields / checkbox.js View on Github external
}]);

  return CheckboxComponent;
}(_simpleReactForm.FieldType);

CheckboxComponent.propTypes = propTypes;
CheckboxComponent.defaultProps = defaultProps;

(0, _simpleReactForm.registerType)({
  type: 'checkbox',
  component: CheckboxComponent,
  allowedTypes: [Boolean],
  description: 'Simple checkbox field.'
});

(0, _simpleReactForm.registerType)({
  type: 'boolean',
  component: CheckboxComponent
});
github nicolaslopezj / simple-react-form / material-ui / lib / fields / select.js View on Github external
_react2.default.createElement(
          'div',
          { style: _styles2.default.errorMessage },
          this.props.errorMessage
        )
      );
    }
  }]);

  return SelectComponent;
}(_simpleReactForm.FieldType);

SelectComponent.propTypes = propTypes;
SelectComponent.defaultProps = defaultProps;

(0, _simpleReactForm.registerType)({
  type: 'select',
  component: SelectComponent,
  allowedTypes: [String, Number],
  description: 'Simple select field.'
});
github nicolaslopezj / simple-react-form / material-ui / lib / fields / tags.js View on Github external
}
  }]);

  return StringArrayComponent;
}(_simpleReactForm.FieldType);

StringArrayComponent.propTypes = propTypes;
StringArrayComponent.defaultProps = defaultProps;

(0, _simpleReactForm.registerType)({
  type: 'string-array',
  component: StringArrayComponent,
  allowedTypes: [[String]]
});

(0, _simpleReactForm.registerType)({
  type: 'tags',
  component: StringArrayComponent,
  allowedTypes: [[String]],
  description: 'Tags input'
});
github nicolaslopezj / simple-react-form / material-ui / lib / fields / toggle.js View on Github external
_react2.default.createElement(
          'div',
          { style: styles.errorMessage },
          this.props.errorMessage
        )
      );
    }
  }]);

  return ToggleComponent;
}(_simpleReactForm.FieldType);

ToggleComponent.propTypes = propTypes;
ToggleComponent.defaultProps = defaultProps;

(0, _simpleReactForm.registerType)({
  type: 'toggle',
  component: ToggleComponent,
  allowedTypes: Boolean,
  description: 'Material UI toggle.'
});