Sha256: c03acb8a71baaeb8b1d1a5be21dc988f4d52cc534db5cb43ff63316bdd95f206

Contents?: true

Size: 1.24 KB

Versions: 12

Compression:

Stored size: 1.24 KB

Contents

Rev.registerComponent('ButtonGroup', class ButtonGroup extends React.Component {

  static get propTypes() {
    return {
      round: React.PropTypes.bool,
      radius: React.PropTypes.bool,
      even: React.PropTypes.number,
      stack: React.PropTypes.bool,
      stackForSmall: React.PropTypes.bool,
    }
  }

  static get defaultProps() {
    return {
      round: false,
      radius: false,
      even: null,
      stack: false,
      stackForSmall: false,
    }
  }

  get className() {
    let classNamesObject = {
      'RevButtonGroup': true,
      'button-group': true,
      'RevButtonGroup--round': this.props.round,
      'round': this.props.round,
      'RevButtonGroup--radius': this.props.radius,
      'radius': this.props.radius,
      'RevButtonGroup--stack': this.props.stack,
      'stack': this.props.stack,
      'RevButtonGroup--stackForSmall': !this.stack && this.props.stackForSmall,
      'stack-for-small': !this.stack && this.props.stackForSmall,
    }
    if(this.props.even != null) {
      classNamesObject[`even-${this.props.even}`] = true
    }
    return this.classAdd(classNamesObject)
  }

  render() {
    return <ul className={this.className}>
      {this.mapChildren((child, i) => <li key={i}>{child}</li>)}
    </ul>
  }
})

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
revelry_core-0.1.24.0 app/assets/javascripts/revelry/ui/buttons/ButtonGroup.es6
revelry_core-0.1.23.0 app/assets/javascripts/revelry/ui/buttons/ButtonGroup.es6
revelry_core-0.1.22.0 app/assets/javascripts/revelry/ui/buttons/ButtonGroup.es6
revelry_core-0.1.21.0 app/assets/javascripts/revelry/ui/buttons/ButtonGroup.es6
revelry_core-0.1.20.0 app/assets/javascripts/revelry/ui/buttons/ButtonGroup.es6
revelry_core-0.1.19.0 app/assets/javascripts/revelry/ui/buttons/ButtonGroup.es6
revelry_core-0.1.18.0 app/assets/javascripts/revelry/ui/buttons/ButtonGroup.es6
revelry_core-0.1.17.0 app/assets/javascripts/revelry/ui/buttons/ButtonGroup.es6
revelry_core-0.1.16.0 app/assets/javascripts/revelry/ui/buttons/ButtonGroup.es6
revelry_core-0.1.15.0 app/assets/javascripts/revelry/ui/buttons/ButtonGroup.es6
revelry_core-0.1.14.0 app/assets/javascripts/revelry/ui/buttons/ButtonGroup.es6
revelry_core-0.1.13.0 app/assets/javascripts/revelry/ui/buttons/ButtonGroup.es6