How to use the simple-react-form.ArrayComponent.propTypes 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 / src / array.jsx View on Github external
import React from 'react'
import Paper from 'material-ui/Paper'
import IconButton from 'material-ui/IconButton'
import RaisedButton from 'material-ui/RaisedButton'
import {ArrayComponent} from 'simple-react-form'

const styles = {
  label: {
    color: 'rgba(0,0,0,0.5)',
    marginBottom: 5,
    fontSize: 12
  }
}

const propTypes = {
  ...ArrayComponent.propTypes,
  parentClassName: React.PropTypes.string,
  childrenClassName: React.PropTypes.string,
  useSmallSpace: React.PropTypes.bool,
  smallRemoveButtonTooltipPosition: React.PropTypes.string
}

const defaultProps = {
  ...ArrayComponent.defaultProps,
  childrenClassName: '',
  parentClassName: '',
  useSmallSpace: false,
  smallRemoveButtonTooltipPosition: 'bottom-center'
}

export default class MaterialArray extends ArrayComponent {
github nicolaslopezj / simple-react-form / material-ui / src / fields / array.jsx View on Github external
import React from 'react';
import Paper from 'material-ui/Paper';
import IconButton from 'material-ui/IconButton';
import RaisedButton from 'material-ui/RaisedButton';
import { Form, ArrayComponent } from 'simple-react-form';

const styles = {
  label: {
    color: 'rgba(0,0,0,0.5)',
    marginBottom: 5,
    fontSize: 12,
  },
};

const propTypes = {
  ...ArrayComponent.propTypes,
  parentClassName: React.PropTypes.string,
  childrenClassName: React.PropTypes.string,
  useSmallSpace: React.PropTypes.bool,
};

const defaultProps = {
  ...ArrayComponent.defaultProps,
  childrenClassName: '',
  parentClassName: '',
  useSmallSpace: false,
};

export default class MaterialArray extends ArrayComponent {
  renderChildrenItem({ index, component }) {
    if (this.props.useSmallSpace) return this.renderChildrenSmallItem({ index, component });
    return (