Sha256: 0f3c779abcf9bba80de15397205583f8854b768e1cb45a6a6dfe188604e5da9b

Contents?: true

Size: 691 Bytes

Versions: 12

Compression:

Stored size: 691 Bytes

Contents

Rev.registerComponent('Switch', class Switch 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

12 entries across 12 versions & 1 rubygems

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