Sha256: 45415249ce11f88f3558ff60e77afc3b4ffbe418c8567b992983100810fa9d9c

Contents?: true

Size: 684 Bytes

Versions: 6

Compression:

Stored size: 684 Bytes

Contents

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

  get id() {
    // Use a props-provided ID if there is one.
    if(this.props.id != null) {
      return this.props.id
    }
    // Otherwise use a memoized generated unique ID.
    if(this._id == null) {
      this._id = _.uniqueId()
    }
    return this._id
  }

  get className() {
    return this.classAdd({
      'RevSwitch': true,
      'switch': true,
    })
  }

  get inputProps() {
    return this.getPropsWithout('className')
  }

  render() {
    return <div className={this.className}>
      <input {...this.inputProps} id={this.id} type="checkbox" />
      <label htmlFor={this.id} />
    </div>
  }
})

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
revelry_core-0.1.12.6 app/assets/javascripts/revelry/ui/forms/Switch.es6
revelry_core-0.1.12.5 app/assets/javascripts/revelry/ui/forms/Switch.es6
revelry_core-0.1.12.4 app/assets/javascripts/revelry/ui/forms/Switch.es6
revelry_core-0.1.12.3 app/assets/javascripts/revelry/ui/forms/Switch.es6
revelry_core-0.1.12.2 app/assets/javascripts/revelry/ui/forms/Switch.es6
revelry_core-0.1.12.0 app/assets/javascripts/revelry/ui/forms/Switch.es6