ソースを参照

make private methods truly private

Thomas Grainger 8 年 前
コミット
9a5fdab890
5 ファイル変更521 行追加391 行削除
  1. 1 1
      .babelrc
  2. 1 0
      .eslintrc.json
  3. 2 1
      package.json
  4. 295 293
      src/js/bootstrap-switch.js
  5. 222 96
      yarn.lock

+ 1 - 1
.babelrc

@@ -6,7 +6,7 @@
         "browsers": ["last 2 versions"]
       }
     }],
-    "stage-2",
+    "stage-0",
   ],
   "env": {
     "production": {

+ 1 - 0
.eslintrc.json

@@ -1,5 +1,6 @@
 {
   "extends": "airbnb-base",
+  "parser": "babel-eslint",
   "env": { "browser": true },
   "rules": {
     "no-underscore-dangle": 0

+ 2 - 1
package.json

@@ -28,10 +28,11 @@
   "readmeFilename": "README.md",
   "devDependencies": {
     "babel-cli": "^6.22.2",
+    "babel-eslint": "^7.2.3",
     "babel-polyfill": "^6.22.0",
     "babel-preset-babili": "^0.0.10",
     "babel-preset-env": "^1.1.8",
-    "babel-preset-stage-2": "^6.22.0",
+    "babel-preset-stage-0": "^6.24.1",
     "bootstrap": "^3.3.7",
     "eslint": "^3.19.0",
     "eslint-config-airbnb-base": "^11.2.0",

+ 295 - 293
src/js/bootstrap-switch.js

@@ -15,34 +15,291 @@ function getClasses(options, id) {
   ].filter(v => v == null);
 }
 
+
+function prvgetElementOptions() {
+  return {
+    state: this.$element.is(':checked'),
+    size: this.$element.data('size'),
+    animate: this.$element.data('animate'),
+    disabled: this.$element.is(':disabled'),
+    readonly: this.$element.is('[readonly]'),
+    indeterminate: this.$element.data('indeterminate'),
+    inverse: this.$element.data('inverse'),
+    radioAllOff: this.$element.data('radio-all-off'),
+    onColor: this.$element.data('on-color'),
+    offColor: this.$element.data('off-color'),
+    onText: this.$element.data('on-text'),
+    offText: this.$element.data('off-text'),
+    labelText: this.$element.data('label-text'),
+    handleWidth: this.$element.data('handle-width'),
+    labelWidth: this.$element.data('label-width'),
+    baseClass: this.$element.data('base-class'),
+    wrapperClass: this.$element.data('wrapper-class'),
+  };
+}
+
+function prvwidth() {
+  const $handles = this.$on
+    .add(this.$off)
+    .add(this.$label)
+    .css('width', '');
+  const handleWidth = this.options.handleWidth === 'auto'
+    ? Math.round(Math.max(this.$on.width(), this.$off.width()))
+    : this.options.handleWidth;
+  $handles.width(handleWidth);
+  this.$label.width((index, width) => {
+    if (this.options.labelWidth !== 'auto') { return this.options.labelWidth; }
+    if (width < handleWidth) { return handleWidth; }
+    return width;
+  });
+  this.privateHandleWidth = this.$on.outerWidth();
+  this.privateLabelWidth = this.$label.outerWidth();
+  this.$container.width((this.privateHandleWidth * 2) + this.privateLabelWidth);
+  return this.$wrapper.width(this.privateHandleWidth + this.privateLabelWidth);
+}
+
+function prvcontainerPosition(state = this.ope) {
+  this.$container.css('margin-left', () => {
+    const values = [0, `-${this.privateHandleWidth}px`];
+    if (this.options.indeterminate) {
+      return `-${this.privateHandleWidth / 2}px`;
+    }
+    if (state) {
+      if (this.options.inverse) {
+        return values[1];
+      }
+      return values[0];
+    }
+    if (this.options.inverse) {
+      return values[0];
+    }
+    return values[1];
+  });
+}
+
+function prvgetClass(name) {
+  return `${this.options.baseClass}-${name}`;
+}
+
+function prvinit() {
+  const init = () => {
+    this.setPrevOptions();
+    this::prvwidth();
+    this::prvcontainerPosition();
+    setTimeout(() => (
+      this.options.animate &&
+      this.$wrapper.addClass(this::prvgetClass('animate'),
+    )), 50);
+  };
+  if (this.$wrapper.is(':visible')) {
+    init();
+    return;
+  }
+  const initInterval = window.setInterval(
+    () => (
+      this.$wrapper.is(':visible') &&
+      (init() || true) &&
+      window.clearInterval(initInterval)
+    ), 50);
+}
+
+function prvelementHandlers() {
+  return this.$element.on({
+    'setPreviousOptions.bootstrapSwitch': () => this.setPrevOptions(),
+
+    'previousState.bootstrapSwitch': () => {
+      this.options = this.prevOptions;
+      if (this.options.indeterminate) {
+        this.$wrapper.addClass(this::prvgetClass('indeterminate'));
+      }
+      this.$element
+        .prop('checked', this.options.state)
+        .trigger('change.bootstrapSwitch', true);
+    },
+
+    'change.bootstrapSwitch': (event, skip) => {
+      event.preventDefault();
+      event.stopImmediatePropagation();
+      const state = this.$element.is(':checked');
+      this::prvcontainerPosition(state);
+      if (state === this.options.state) {
+        return;
+      }
+      this.options.state = state;
+      this.$wrapper
+        .toggleClass(this::prvgetClass('off'))
+        .toggleClass(this::prvgetClass('on'));
+      if (!skip) {
+        if (this.$element.is(':radio')) {
+          $(`[name="${this.$element.attr('name')}"]`)
+            .not(this.$element)
+            .prop('checked', false)
+            .trigger('change.bootstrapSwitch', true);
+        }
+        this.$element.trigger('switchChange.bootstrapSwitch', [state]);
+      }
+    },
+
+    'focus.bootstrapSwitch': (event) => {
+      event.preventDefault();
+      this.$wrapper.addClass(this::prvgetClass('focused'));
+    },
+
+    'blur.bootstrapSwitch': (event) => {
+      event.preventDefault();
+      this.$wrapper.removeClass(this::prvgetClass('focused'));
+    },
+
+    'keydown.bootstrapSwitch': (event) => {
+      if (!event.which || this.options.disabled || this.options.readonly) {
+        return;
+      }
+      if (event.which === 37 || event.which === 39) {
+        event.preventDefault();
+        event.stopImmediatePropagation();
+        this.state(event.which === 39);
+      }
+    },
+  });
+}
+
+function prvhandleHandlers() {
+  this.$on.on('click.bootstrapSwitch', (event) => {
+    event.preventDefault();
+    event.stopPropagation();
+    this.state(false);
+    return this.$element.trigger('focus.bootstrapSwitch');
+  });
+  return this.$off.on('click.bootstrapSwitch', (event) => {
+    event.preventDefault();
+    event.stopPropagation();
+    this.state(true);
+    return this.$element.trigger('focus.bootstrapSwitch');
+  });
+}
+
+function prvlabelHandlers() {
+  let dragStart;
+  let dragEnd;
+  const handlers = {
+    click(event) { event.stopPropagation(); },
+
+    'mousedown.bootstrapSwitch touchstart.bootstrapSwitch': (event) => {
+      if (dragStart || this.options.disabled || this.options.readonly) {
+        return;
+      }
+      event.preventDefault();
+      event.stopPropagation();
+      dragStart = (event.pageX || event.originalEvent.touches[0].pageX) - parseInt(this.$container.css('margin-left'), 10);
+      if (this.options.animate) {
+        this.$wrapper.removeClass(this::prvgetClass('animate'));
+      }
+      this.$element.trigger('focus.bootstrapSwitch');
+    },
+
+    'mousemove.bootstrapSwitch touchmove.bootstrapSwitch': (event) => {
+      if (dragStart == null) { return; }
+      const difference = (event.pageX || event.originalEvent.touches[0].pageX) - dragStart;
+      event.preventDefault();
+      if (difference < -this.privateHandleWidth || difference > 0) { return; }
+      dragEnd = difference;
+      this.$container.css('margin-left', `${dragEnd}px`);
+    },
+
+    'mouseup.bootstrapSwitch touchend.bootstrapSwitch': (event) => {
+      if (!dragStart) { return; }
+      event.preventDefault();
+      if (this.options.animate) {
+        this.$wrapper.addClass(this::prvgetClass('animate'));
+      }
+      if (dragEnd) {
+        const state = dragEnd > -(this.privateHandleWidth / 2);
+        dragEnd = false;
+        this.state(this.options.inverse ? !state : state);
+      } else {
+        this.state(!this.options.state);
+      }
+      dragStart = false;
+    },
+
+    'mouseleave.bootstrapSwitch': () => {
+      this.$label.trigger('mouseup.bootstrapSwitch');
+    },
+  };
+  this.$label.on(handlers);
+}
+
+function prvexternalLabelHandler() {
+  const $externalLabel = this.$element.closest('label');
+  $externalLabel.on('click', (event) => {
+    event.preventDefault();
+    event.stopImmediatePropagation();
+    if (event.target === $externalLabel[0]) {
+      this.toggleState();
+    }
+  });
+}
+
+function prvformHandler() {
+  function isBootstrapSwitch() {
+    return $(this).data('bootstrap-switch');
+  }
+
+  function performReset() {
+    return $(this).bootstrapSwitch('state', this.checked);
+  }
+
+  const $form = this.$element.closest('form');
+  if ($form.data('bootstrap-switch')) {
+    return;
+  }
+  $form
+    .on('reset.bootstrapSwitch', () => {
+      window.setTimeout(() => {
+        $form.find('input')
+          .filter(isBootstrapSwitch)
+          .each(performReset);
+      }, 1);
+    })
+    .data('bootstrap-switch', true);
+}
+
+function prvgetClasses(classes) {
+  if (!$.isArray(classes)) {
+    return [this::prvgetClass(classes)];
+  }
+  return classes.map(v => this::prvgetClass(v));
+}
+
+
 class BootstrapSwitch {
   constructor(element, options = {}) {
     this.$element = $(element);
     this.options = $.extend(
       {},
       $.fn.bootstrapSwitch.defaults,
-      this._getElementOptions(),
+      this::prvgetElementOptions(),
       options,
     );
     this.prevOptions = {};
     this.$wrapper = $('<div>', {
       class: () => getClasses(this.options, this.$element.attr('id'))
-        .map(v => this._getClass(v))
-        .concat([this.options.baseClass], this._getClasses(this.options.wrapperClass))
+        .map(v => this::prvgetClass(v))
+        .concat([this.options.baseClass], this::prvgetClasses(this.options.wrapperClass))
         .join(' '),
     });
-    this.$container = $('<div>', { class: this._getClass('container') });
+    this.$container = $('<div>', { class: this::prvgetClass('container') });
     this.$on = $('<span>', {
       html: this.options.onText,
-      class: `${this._getClass('handle-on')} ${this._getClass(this.options.onColor)}`,
+      class: `${this::prvgetClass('handle-on')} ${this::prvgetClass(this.options.onColor)}`,
     });
     this.$off = $('<span>', {
       html: this.options.offText,
-      class: `${this._getClass('handle-off')} ${this._getClass(this.options.offColor)}`,
+      class: `${this::prvgetClass('handle-off')} ${this::prvgetClass(this.options.offColor)}`,
     });
     this.$label = $('<span>', {
       html: this.options.labelText,
-      class: this._getClass('label'),
+      class: this::prvgetClass('label'),
     });
 
     this.$element.on('init.bootstrapSwitch', () => this.options.onInit(element));
@@ -67,12 +324,12 @@ class BootstrapSwitch {
       this.$element.prop('indeterminate', true);
     }
 
-    this._init();
-    this._elementHandlers();
-    this._handleHandlers();
-    this._labelHandlers();
-    this._formHandler();
-    this._externalLabelHandler();
+    this::prvinit();
+    this::prvelementHandlers();
+    this::prvhandleHandlers();
+    this::prvlabelHandlers();
+    this::prvformHandler();
+    this::prvexternalLabelHandler();
     this.$element.trigger('init.bootstrapSwitch', this.options.state);
   }
 
@@ -112,13 +369,13 @@ class BootstrapSwitch {
   size(value) {
     if (typeof value === 'undefined') { return this.options.size; }
     if (this.options.size != null) {
-      this.$wrapper.removeClass(this._getClass(this.options.size));
+      this.$wrapper.removeClass(this::prvgetClass(this.options.size));
     }
     if (value) {
-      this.$wrapper.addClass(this._getClass(value));
+      this.$wrapper.addClass(this::prvgetClass(value));
     }
-    this._width();
-    this._containerPosition();
+    this::prvwidth();
+    this::prvcontainerPosition();
     this.options.size = value;
     return this.$element;
   }
@@ -131,7 +388,7 @@ class BootstrapSwitch {
 
   toggleAnimate() {
     this.options.animate = !this.options.animate;
-    this.$wrapper.toggleClass(this._getClass('animate'));
+    this.$wrapper.toggleClass(this::prvgetClass('animate'));
     return this.$element;
   }
 
@@ -144,7 +401,7 @@ class BootstrapSwitch {
   toggleDisabled() {
     this.options.disabled = !this.options.disabled;
     this.$element.prop('disabled', this.options.disabled);
-    this.$wrapper.toggleClass(this._getClass('disabled'));
+    this.$wrapper.toggleClass(this::prvgetClass('disabled'));
     return this.$element;
   }
 
@@ -157,7 +414,7 @@ class BootstrapSwitch {
   toggleReadonly() {
     this.options.readonly = !this.options.readonly;
     this.$element.prop('readonly', this.options.readonly);
-    this.$wrapper.toggleClass(this._getClass('readonly'));
+    this.$wrapper.toggleClass(this::prvgetClass('readonly'));
     return this.$element;
   }
 
@@ -170,8 +427,8 @@ class BootstrapSwitch {
   toggleIndeterminate() {
     this.options.indeterminate = !this.options.indeterminate;
     this.$element.prop('indeterminate', this.options.indeterminate);
-    this.$wrapper.toggleClass(this._getClass('indeterminate'));
-    this._containerPosition();
+    this.$wrapper.toggleClass(this::prvgetClass('indeterminate'));
+    this::prvcontainerPosition();
     return this.$element;
   }
 
@@ -182,7 +439,7 @@ class BootstrapSwitch {
   }
 
   toggleInverse() {
-    this.$wrapper.toggleClass(this._getClass('inverse'));
+    this.$wrapper.toggleClass(this::prvgetClass('inverse'));
     const $on = this.$on.clone(true);
     const $off = this.$off.clone(true);
     this.$on.replaceWith($off);
@@ -196,9 +453,9 @@ class BootstrapSwitch {
   onColor(value) {
     if (typeof value === 'undefined') { return this.options.onColor; }
     if (this.options.onColor) {
-      this.$on.removeClass(this._getClass(this.options.onColor));
+      this.$on.removeClass(this::prvgetClass(this.options.onColor));
     }
-    this.$on.addClass(this._getClass(value));
+    this.$on.addClass(this::prvgetClass(value));
     this.options.onColor = value;
     return this.$element;
   }
@@ -206,9 +463,9 @@ class BootstrapSwitch {
   offColor(value) {
     if (typeof value === 'undefined') { return this.options.offColor; }
     if (this.options.offColor) {
-      this.$off.removeClass(this._getClass(this.options.offColor));
+      this.$off.removeClass(this::prvgetClass(this.options.offColor));
     }
-    this.$off.addClass(this._getClass(value));
+    this.$off.addClass(this::prvgetClass(value));
     this.options.offColor = value;
     return this.$element;
   }
@@ -216,8 +473,8 @@ class BootstrapSwitch {
   onText(value) {
     if (typeof value === 'undefined') { return this.options.onText; }
     this.$on.html(value);
-    this._width();
-    this._containerPosition();
+    this::prvwidth();
+    this::prvcontainerPosition();
     this.options.onText = value;
     return this.$element;
   }
@@ -225,8 +482,8 @@ class BootstrapSwitch {
   offText(value) {
     if (typeof value === 'undefined') { return this.options.offText; }
     this.$off.html(value);
-    this._width();
-    this._containerPosition();
+    this::prvwidth();
+    this::prvcontainerPosition();
     this.options.offText = value;
     return this.$element;
   }
@@ -234,7 +491,7 @@ class BootstrapSwitch {
   labelText(value) {
     if (typeof value === 'undefined') { return this.options.labelText; }
     this.$label.html(value);
-    this._width();
+    this::prvwidth();
     this.options.labelText = value;
     return this.$element;
   }
@@ -242,16 +499,16 @@ class BootstrapSwitch {
   handleWidth(value) {
     if (typeof value === 'undefined') { return this.options.handleWidth; }
     this.options.handleWidth = value;
-    this._width();
-    this._containerPosition();
+    this::prvwidth();
+    this::prvcontainerPosition();
     return this.$element;
   }
 
   labelWidth(value) {
     if (typeof value === 'undefined') { return this.options.labelWidth; }
     this.options.labelWidth = value;
-    this._width();
-    this._containerPosition();
+    this::prvwidth();
+    this::prvcontainerPosition();
     return this.$element;
   }
 
@@ -262,8 +519,8 @@ class BootstrapSwitch {
   wrapperClass(value) {
     if (typeof value === 'undefined') { return this.options.wrapperClass; }
     const wrapperClass = value || $.fn.bootstrapSwitch.defaults.wrapperClass;
-    this.$wrapper.removeClass(this._getClasses(this.options.wrapperClass).join(' '));
-    this.$wrapper.addClass(this._getClasses(wrapperClass).join(' '));
+    this.$wrapper.removeClass(this::prvgetClasses(this.options.wrapperClass).join(' '));
+    this.$wrapper.addClass(this::prvgetClasses(wrapperClass).join(' '));
     this.options.wrapperClass = wrapperClass;
     return this.$element;
   }
@@ -307,261 +564,6 @@ class BootstrapSwitch {
       .removeData('bootstrap-switch');
     return this.$element;
   }
-
-  _getElementOptions() {
-    return {
-      state: this.$element.is(':checked'),
-      size: this.$element.data('size'),
-      animate: this.$element.data('animate'),
-      disabled: this.$element.is(':disabled'),
-      readonly: this.$element.is('[readonly]'),
-      indeterminate: this.$element.data('indeterminate'),
-      inverse: this.$element.data('inverse'),
-      radioAllOff: this.$element.data('radio-all-off'),
-      onColor: this.$element.data('on-color'),
-      offColor: this.$element.data('off-color'),
-      onText: this.$element.data('on-text'),
-      offText: this.$element.data('off-text'),
-      labelText: this.$element.data('label-text'),
-      handleWidth: this.$element.data('handle-width'),
-      labelWidth: this.$element.data('label-width'),
-      baseClass: this.$element.data('base-class'),
-      wrapperClass: this.$element.data('wrapper-class'),
-    };
-  }
-
-  _width() {
-    const $handles = this.$on
-      .add(this.$off)
-      .add(this.$label)
-      .css('width', '');
-    const handleWidth = this.options.handleWidth === 'auto'
-      ? Math.round(Math.max(this.$on.width(), this.$off.width()))
-      : this.options.handleWidth;
-    $handles.width(handleWidth);
-    this.$label.width((index, width) => {
-      if (this.options.labelWidth !== 'auto') { return this.options.labelWidth; }
-      if (width < handleWidth) { return handleWidth; }
-      return width;
-    });
-    this.privateHandleWidth = this.$on.outerWidth();
-    this.privateLabelWidth = this.$label.outerWidth();
-    this.$container.width((this.privateHandleWidth * 2) + this.privateLabelWidth);
-    return this.$wrapper.width(this.privateHandleWidth + this.privateLabelWidth);
-  }
-
-  _containerPosition(state = this.ope) {
-    this.$container.css('margin-left', () => {
-      const values = [0, `-${this.privateHandleWidth}px`];
-      if (this.options.indeterminate) {
-        return `-${this.privateHandleWidth / 2}px`;
-      }
-      if (state) {
-        if (this.options.inverse) {
-          return values[1];
-        }
-        return values[0];
-      }
-      if (this.options.inverse) {
-        return values[0];
-      }
-      return values[1];
-    });
-  }
-
-  _init() {
-    const init = () => {
-      this.setPrevOptions();
-      this._width();
-      this._containerPosition();
-      setTimeout(() => (
-        this.options.animate &&
-        this.$wrapper.addClass(this._getClass('animate'),
-      )), 50);
-    };
-    if (this.$wrapper.is(':visible')) {
-      init();
-      return;
-    }
-    const initInterval = window.setInterval(
-      () => (
-        this.$wrapper.is(':visible') &&
-        (init() || true) &&
-        window.clearInterval(initInterval)
-      ), 50);
-  }
-
-  _elementHandlers() {
-    return this.$element.on({
-      'setPreviousOptions.bootstrapSwitch': () => this.setPrevOptions(),
-
-      'previousState.bootstrapSwitch': () => {
-        this.options = this.prevOptions;
-        if (this.options.indeterminate) {
-          this.$wrapper.addClass(this._getClass('indeterminate'));
-        }
-        this.$element
-          .prop('checked', this.options.state)
-          .trigger('change.bootstrapSwitch', true);
-      },
-
-      'change.bootstrapSwitch': (event, skip) => {
-        event.preventDefault();
-        event.stopImmediatePropagation();
-        const state = this.$element.is(':checked');
-        this._containerPosition(state);
-        if (state === this.options.state) {
-          return;
-        }
-        this.options.state = state;
-        this.$wrapper
-          .toggleClass(this._getClass('off'))
-          .toggleClass(this._getClass('on'));
-        if (!skip) {
-          if (this.$element.is(':radio')) {
-            $(`[name="${this.$element.attr('name')}"]`)
-              .not(this.$element)
-              .prop('checked', false)
-              .trigger('change.bootstrapSwitch', true);
-          }
-          this.$element.trigger('switchChange.bootstrapSwitch', [state]);
-        }
-      },
-
-      'focus.bootstrapSwitch': (event) => {
-        event.preventDefault();
-        this.$wrapper.addClass(this._getClass('focused'));
-      },
-
-      'blur.bootstrapSwitch': (event) => {
-        event.preventDefault();
-        this.$wrapper.removeClass(this._getClass('focused'));
-      },
-
-      'keydown.bootstrapSwitch': (event) => {
-        if (!event.which || this.options.disabled || this.options.readonly) {
-          return;
-        }
-        if (event.which === 37 || event.which === 39) {
-          event.preventDefault();
-          event.stopImmediatePropagation();
-          this.state(event.which === 39);
-        }
-      },
-    });
-  }
-
-  _handleHandlers() {
-    this.$on.on('click.bootstrapSwitch', (event) => {
-      event.preventDefault();
-      event.stopPropagation();
-      this.state(false);
-      return this.$element.trigger('focus.bootstrapSwitch');
-    });
-    return this.$off.on('click.bootstrapSwitch', (event) => {
-      event.preventDefault();
-      event.stopPropagation();
-      this.state(true);
-      return this.$element.trigger('focus.bootstrapSwitch');
-    });
-  }
-
-  _labelHandlers() {
-    let dragStart;
-    let dragEnd;
-    const handlers = {
-      click(event) { event.stopPropagation(); },
-
-      'mousedown.bootstrapSwitch touchstart.bootstrapSwitch': (event) => {
-        if (dragStart || this.options.disabled || this.options.readonly) {
-          return;
-        }
-        event.preventDefault();
-        event.stopPropagation();
-        dragStart = (event.pageX || event.originalEvent.touches[0].pageX) - parseInt(this.$container.css('margin-left'), 10);
-        if (this.options.animate) {
-          this.$wrapper.removeClass(this._getClass('animate'));
-        }
-        this.$element.trigger('focus.bootstrapSwitch');
-      },
-
-      'mousemove.bootstrapSwitch touchmove.bootstrapSwitch': (event) => {
-        if (dragStart == null) { return; }
-        const difference = (event.pageX || event.originalEvent.touches[0].pageX) - dragStart;
-        event.preventDefault();
-        if (difference < -this.privateHandleWidth || difference > 0) { return; }
-        dragEnd = difference;
-        this.$container.css('margin-left', `${dragEnd}px`);
-      },
-
-      'mouseup.bootstrapSwitch touchend.bootstrapSwitch': (event) => {
-        if (!dragStart) { return; }
-        event.preventDefault();
-        if (this.options.animate) {
-          this.$wrapper.addClass(this._getClass('animate'));
-        }
-        if (dragEnd) {
-          const state = dragEnd > -(this.privateHandleWidth / 2);
-          dragEnd = false;
-          this.state(this.options.inverse ? !state : state);
-        } else {
-          this.state(!this.options.state);
-        }
-        dragStart = false;
-      },
-
-      'mouseleave.bootstrapSwitch': () => {
-        this.$label.trigger('mouseup.bootstrapSwitch');
-      },
-    };
-    this.$label.on(handlers);
-  }
-
-  _externalLabelHandler() {
-    const $externalLabel = this.$element.closest('label');
-    $externalLabel.on('click', (event) => {
-      event.preventDefault();
-      event.stopImmediatePropagation();
-      if (event.target === $externalLabel[0]) {
-        this.toggleState();
-      }
-    });
-  }
-
-  _formHandler() {
-    function isBootstrapSwitch() {
-      return $(this).data('bootstrap-switch');
-    }
-
-    function performReset() {
-      return $(this).bootstrapSwitch('state', this.checked);
-    }
-
-    const $form = this.$element.closest('form');
-    if ($form.data('bootstrap-switch')) {
-      return;
-    }
-    $form
-      .on('reset.bootstrapSwitch', () => {
-        window.setTimeout(() => {
-          $form.find('input')
-            .filter(isBootstrapSwitch)
-            .each(performReset);
-        }, 1);
-      })
-      .data('bootstrap-switch', true);
-  }
-
-  _getClass(name) {
-    return `${this.options.baseClass}-${name}`;
-  }
-
-  _getClasses(classes) {
-    if (!$.isArray(classes)) {
-      return [this._getClass(classes)];
-    }
-    return classes.map(v => this._getClass(v));
-  }
 }
 
 function bootstrapSwitch(option, ...args) {

+ 222 - 96
yarn.lock

@@ -314,6 +314,15 @@ babel-core@^6.0.0, babel-core@^6.23.0:
     slash "^1.0.0"
     source-map "^0.5.0"
 
+babel-eslint@^7.2.3:
+  version "7.2.3"
+  resolved "https://registry.yarnpkg.com/babel-eslint/-/babel-eslint-7.2.3.tgz#b2fe2d80126470f5c19442dc757253a897710827"
+  dependencies:
+    babel-code-frame "^6.22.0"
+    babel-traverse "^6.23.1"
+    babel-types "^6.23.0"
+    babylon "^6.17.0"
+
 babel-generator@^6.23.0:
   version "6.23.0"
   resolved "https://registry.yarnpkg.com/babel-generator/-/babel-generator-6.23.0.tgz#6b8edab956ef3116f79d8c84c5a3c05f32a74bc5"
@@ -327,13 +336,13 @@ babel-generator@^6.23.0:
     source-map "^0.5.0"
     trim-right "^1.0.1"
 
-babel-helper-bindify-decorators@^6.22.0:
-  version "6.22.0"
-  resolved "https://registry.yarnpkg.com/babel-helper-bindify-decorators/-/babel-helper-bindify-decorators-6.22.0.tgz#d7f5bc261275941ac62acfc4e20dacfb8a3fe952"
+babel-helper-bindify-decorators@^6.24.1:
+  version "6.24.1"
+  resolved "https://registry.yarnpkg.com/babel-helper-bindify-decorators/-/babel-helper-bindify-decorators-6.24.1.tgz#14c19e5f142d7b47f19a52431e52b1ccbc40a330"
   dependencies:
     babel-runtime "^6.22.0"
-    babel-traverse "^6.22.0"
-    babel-types "^6.22.0"
+    babel-traverse "^6.24.1"
+    babel-types "^6.24.1"
 
 babel-helper-builder-binary-assignment-operator-visitor@^6.22.0:
   version "6.22.0"
@@ -343,6 +352,14 @@ babel-helper-builder-binary-assignment-operator-visitor@^6.22.0:
     babel-runtime "^6.22.0"
     babel-types "^6.22.0"
 
+babel-helper-builder-binary-assignment-operator-visitor@^6.24.1:
+  version "6.24.1"
+  resolved "https://registry.yarnpkg.com/babel-helper-builder-binary-assignment-operator-visitor/-/babel-helper-builder-binary-assignment-operator-visitor-6.24.1.tgz#cce4517ada356f4220bcae8a02c2b346f9a56664"
+  dependencies:
+    babel-helper-explode-assignable-expression "^6.24.1"
+    babel-runtime "^6.22.0"
+    babel-types "^6.24.1"
+
 babel-helper-call-delegate@^6.22.0:
   version "6.22.0"
   resolved "https://registry.yarnpkg.com/babel-helper-call-delegate/-/babel-helper-call-delegate-6.22.0.tgz#119921b56120f17e9dae3f74b4f5cc7bcc1b37ef"
@@ -373,14 +390,22 @@ babel-helper-explode-assignable-expression@^6.22.0:
     babel-traverse "^6.22.0"
     babel-types "^6.22.0"
 
-babel-helper-explode-class@^6.22.0:
-  version "6.22.0"
-  resolved "https://registry.yarnpkg.com/babel-helper-explode-class/-/babel-helper-explode-class-6.22.0.tgz#646304924aa6388a516843ba7f1855ef8dfeb69b"
+babel-helper-explode-assignable-expression@^6.24.1:
+  version "6.24.1"
+  resolved "https://registry.yarnpkg.com/babel-helper-explode-assignable-expression/-/babel-helper-explode-assignable-expression-6.24.1.tgz#f25b82cf7dc10433c55f70592d5746400ac22caa"
   dependencies:
-    babel-helper-bindify-decorators "^6.22.0"
     babel-runtime "^6.22.0"
-    babel-traverse "^6.22.0"
-    babel-types "^6.22.0"
+    babel-traverse "^6.24.1"
+    babel-types "^6.24.1"
+
+babel-helper-explode-class@^6.24.1:
+  version "6.24.1"
+  resolved "https://registry.yarnpkg.com/babel-helper-explode-class/-/babel-helper-explode-class-6.24.1.tgz#7dc2a3910dee007056e1e31d640ced3d54eaa9eb"
+  dependencies:
+    babel-helper-bindify-decorators "^6.24.1"
+    babel-runtime "^6.22.0"
+    babel-traverse "^6.24.1"
+    babel-types "^6.24.1"
 
 babel-helper-flip-expressions@^0.0.2:
   version "0.0.2"
@@ -396,6 +421,16 @@ babel-helper-function-name@^6.22.0, babel-helper-function-name@^6.23.0:
     babel-traverse "^6.23.0"
     babel-types "^6.23.0"
 
+babel-helper-function-name@^6.24.1:
+  version "6.24.1"
+  resolved "https://registry.yarnpkg.com/babel-helper-function-name/-/babel-helper-function-name-6.24.1.tgz#d3475b8c03ed98242a25b48351ab18399d3580a9"
+  dependencies:
+    babel-helper-get-function-arity "^6.24.1"
+    babel-runtime "^6.22.0"
+    babel-template "^6.24.1"
+    babel-traverse "^6.24.1"
+    babel-types "^6.24.1"
+
 babel-helper-get-function-arity@^6.22.0:
   version "6.22.0"
   resolved "https://registry.yarnpkg.com/babel-helper-get-function-arity/-/babel-helper-get-function-arity-6.22.0.tgz#0beb464ad69dc7347410ac6ade9f03a50634f5ce"
@@ -403,6 +438,13 @@ babel-helper-get-function-arity@^6.22.0:
     babel-runtime "^6.22.0"
     babel-types "^6.22.0"
 
+babel-helper-get-function-arity@^6.24.1:
+  version "6.24.1"
+  resolved "https://registry.yarnpkg.com/babel-helper-get-function-arity/-/babel-helper-get-function-arity-6.24.1.tgz#8f7782aa93407c41d3aa50908f89b031b1b6853d"
+  dependencies:
+    babel-runtime "^6.22.0"
+    babel-types "^6.24.1"
+
 babel-helper-hoist-variables@^6.22.0:
   version "6.22.0"
   resolved "https://registry.yarnpkg.com/babel-helper-hoist-variables/-/babel-helper-hoist-variables-6.22.0.tgz#3eacbf731d80705845dd2e9718f600cfb9b4ba72"
@@ -447,6 +489,16 @@ babel-helper-remap-async-to-generator@^6.22.0:
     babel-traverse "^6.22.0"
     babel-types "^6.22.0"
 
+babel-helper-remap-async-to-generator@^6.24.1:
+  version "6.24.1"
+  resolved "https://registry.yarnpkg.com/babel-helper-remap-async-to-generator/-/babel-helper-remap-async-to-generator-6.24.1.tgz#5ec581827ad723fecdd381f1c928390676e4551b"
+  dependencies:
+    babel-helper-function-name "^6.24.1"
+    babel-runtime "^6.22.0"
+    babel-template "^6.24.1"
+    babel-traverse "^6.24.1"
+    babel-types "^6.24.1"
+
 babel-helper-remove-or-void@^0.0.1:
   version "0.0.1"
   resolved "https://registry.yarnpkg.com/babel-helper-remove-or-void/-/babel-helper-remove-or-void-0.0.1.tgz#f602790e465acf2dfbe84fb3dd210c43a2dd7262"
@@ -549,6 +601,10 @@ babel-plugin-syntax-async-generators@^6.5.0:
   version "6.13.0"
   resolved "https://registry.yarnpkg.com/babel-plugin-syntax-async-generators/-/babel-plugin-syntax-async-generators-6.13.0.tgz#6bc963ebb16eccbae6b92b596eb7f35c342a8b9a"
 
+babel-plugin-syntax-class-constructor-call@^6.18.0:
+  version "6.18.0"
+  resolved "https://registry.yarnpkg.com/babel-plugin-syntax-class-constructor-call/-/babel-plugin-syntax-class-constructor-call-6.18.0.tgz#9cb9d39fe43c8600bec8146456ddcbd4e1a76416"
+
 babel-plugin-syntax-class-properties@^6.8.0:
   version "6.13.0"
   resolved "https://registry.yarnpkg.com/babel-plugin-syntax-class-properties/-/babel-plugin-syntax-class-properties-6.13.0.tgz#d7eb23b79a317f8543962c505b827c7d6cac27de"
@@ -557,6 +613,10 @@ babel-plugin-syntax-decorators@^6.13.0:
   version "6.13.0"
   resolved "https://registry.yarnpkg.com/babel-plugin-syntax-decorators/-/babel-plugin-syntax-decorators-6.13.0.tgz#312563b4dbde3cc806cee3e416cceeaddd11ac0b"
 
+babel-plugin-syntax-do-expressions@^6.8.0:
+  version "6.13.0"
+  resolved "https://registry.yarnpkg.com/babel-plugin-syntax-do-expressions/-/babel-plugin-syntax-do-expressions-6.13.0.tgz#5747756139aa26d390d09410b03744ba07e4796d"
+
 babel-plugin-syntax-dynamic-import@^6.18.0:
   version "6.18.0"
   resolved "https://registry.yarnpkg.com/babel-plugin-syntax-dynamic-import/-/babel-plugin-syntax-dynamic-import-6.18.0.tgz#8d6a26229c83745a9982a441051572caa179b1da"
@@ -565,6 +625,14 @@ babel-plugin-syntax-exponentiation-operator@^6.8.0:
   version "6.13.0"
   resolved "https://registry.yarnpkg.com/babel-plugin-syntax-exponentiation-operator/-/babel-plugin-syntax-exponentiation-operator-6.13.0.tgz#9ee7e8337290da95288201a6a57f4170317830de"
 
+babel-plugin-syntax-export-extensions@^6.8.0:
+  version "6.13.0"
+  resolved "https://registry.yarnpkg.com/babel-plugin-syntax-export-extensions/-/babel-plugin-syntax-export-extensions-6.13.0.tgz#70a1484f0f9089a4e84ad44bac353c95b9b12721"
+
+babel-plugin-syntax-function-bind@^6.8.0:
+  version "6.13.0"
+  resolved "https://registry.yarnpkg.com/babel-plugin-syntax-function-bind/-/babel-plugin-syntax-function-bind-6.13.0.tgz#48c495f177bdf31a981e732f55adc0bdd2601f46"
+
 babel-plugin-syntax-object-rest-spread@^6.8.0:
   version "6.13.0"
   resolved "https://registry.yarnpkg.com/babel-plugin-syntax-object-rest-spread/-/babel-plugin-syntax-object-rest-spread-6.13.0.tgz#fd6536f2bce13836ffa3a5458c4903a597bb3bf5"
@@ -573,15 +641,23 @@ babel-plugin-syntax-trailing-function-commas@^6.13.0, babel-plugin-syntax-traili
   version "6.22.0"
   resolved "https://registry.yarnpkg.com/babel-plugin-syntax-trailing-function-commas/-/babel-plugin-syntax-trailing-function-commas-6.22.0.tgz#ba0360937f8d06e40180a43fe0d5616fff532cf3"
 
-babel-plugin-transform-async-generator-functions@^6.22.0:
-  version "6.22.0"
-  resolved "https://registry.yarnpkg.com/babel-plugin-transform-async-generator-functions/-/babel-plugin-transform-async-generator-functions-6.22.0.tgz#a720a98153a7596f204099cd5409f4b3c05bab46"
+babel-plugin-transform-async-generator-functions@^6.24.1:
+  version "6.24.1"
+  resolved "https://registry.yarnpkg.com/babel-plugin-transform-async-generator-functions/-/babel-plugin-transform-async-generator-functions-6.24.1.tgz#f058900145fd3e9907a6ddf28da59f215258a5db"
   dependencies:
-    babel-helper-remap-async-to-generator "^6.22.0"
+    babel-helper-remap-async-to-generator "^6.24.1"
     babel-plugin-syntax-async-generators "^6.5.0"
     babel-runtime "^6.22.0"
 
-babel-plugin-transform-async-to-generator@^6.22.0, babel-plugin-transform-async-to-generator@^6.8.0:
+babel-plugin-transform-async-to-generator@^6.24.1:
+  version "6.24.1"
+  resolved "https://registry.yarnpkg.com/babel-plugin-transform-async-to-generator/-/babel-plugin-transform-async-to-generator-6.24.1.tgz#6536e378aff6cb1d5517ac0e40eb3e9fc8d08761"
+  dependencies:
+    babel-helper-remap-async-to-generator "^6.24.1"
+    babel-plugin-syntax-async-functions "^6.8.0"
+    babel-runtime "^6.22.0"
+
+babel-plugin-transform-async-to-generator@^6.8.0:
   version "6.22.0"
   resolved "https://registry.yarnpkg.com/babel-plugin-transform-async-to-generator/-/babel-plugin-transform-async-to-generator-6.22.0.tgz#194b6938ec195ad36efc4c33a971acf00d8cd35e"
   dependencies:
@@ -589,24 +665,39 @@ babel-plugin-transform-async-to-generator@^6.22.0, babel-plugin-transform-async-
     babel-plugin-syntax-async-functions "^6.8.0"
     babel-runtime "^6.22.0"
 
-babel-plugin-transform-class-properties@^6.22.0:
-  version "6.23.0"
-  resolved "https://registry.yarnpkg.com/babel-plugin-transform-class-properties/-/babel-plugin-transform-class-properties-6.23.0.tgz#187b747ee404399013563c993db038f34754ac3b"
+babel-plugin-transform-class-constructor-call@^6.24.1:
+  version "6.24.1"
+  resolved "https://registry.yarnpkg.com/babel-plugin-transform-class-constructor-call/-/babel-plugin-transform-class-constructor-call-6.24.1.tgz#80dc285505ac067dcb8d6c65e2f6f11ab7765ef9"
   dependencies:
-    babel-helper-function-name "^6.23.0"
+    babel-plugin-syntax-class-constructor-call "^6.18.0"
+    babel-runtime "^6.22.0"
+    babel-template "^6.24.1"
+
+babel-plugin-transform-class-properties@^6.24.1:
+  version "6.24.1"
+  resolved "https://registry.yarnpkg.com/babel-plugin-transform-class-properties/-/babel-plugin-transform-class-properties-6.24.1.tgz#6a79763ea61d33d36f37b611aa9def81a81b46ac"
+  dependencies:
+    babel-helper-function-name "^6.24.1"
     babel-plugin-syntax-class-properties "^6.8.0"
     babel-runtime "^6.22.0"
-    babel-template "^6.23.0"
+    babel-template "^6.24.1"
 
-babel-plugin-transform-decorators@^6.22.0:
-  version "6.22.0"
-  resolved "https://registry.yarnpkg.com/babel-plugin-transform-decorators/-/babel-plugin-transform-decorators-6.22.0.tgz#c03635b27a23b23b7224f49232c237a73988d27c"
+babel-plugin-transform-decorators@^6.24.1:
+  version "6.24.1"
+  resolved "https://registry.yarnpkg.com/babel-plugin-transform-decorators/-/babel-plugin-transform-decorators-6.24.1.tgz#788013d8f8c6b5222bdf7b344390dfd77569e24d"
   dependencies:
-    babel-helper-explode-class "^6.22.0"
+    babel-helper-explode-class "^6.24.1"
     babel-plugin-syntax-decorators "^6.13.0"
     babel-runtime "^6.22.0"
-    babel-template "^6.22.0"
-    babel-types "^6.22.0"
+    babel-template "^6.24.1"
+    babel-types "^6.24.1"
+
+babel-plugin-transform-do-expressions@^6.22.0:
+  version "6.22.0"
+  resolved "https://registry.yarnpkg.com/babel-plugin-transform-do-expressions/-/babel-plugin-transform-do-expressions-6.22.0.tgz#28ccaf92812d949c2cd1281f690c8fdc468ae9bb"
+  dependencies:
+    babel-plugin-syntax-do-expressions "^6.8.0"
+    babel-runtime "^6.22.0"
 
 babel-plugin-transform-es2015-arrow-functions@^6.3.13:
   version "6.22.0"
@@ -776,7 +867,15 @@ babel-plugin-transform-es2015-unicode-regex@^6.3.13:
     babel-runtime "^6.22.0"
     regexpu-core "^2.0.0"
 
-babel-plugin-transform-exponentiation-operator@^6.22.0, babel-plugin-transform-exponentiation-operator@^6.8.0:
+babel-plugin-transform-exponentiation-operator@^6.24.1:
+  version "6.24.1"
+  resolved "https://registry.yarnpkg.com/babel-plugin-transform-exponentiation-operator/-/babel-plugin-transform-exponentiation-operator-6.24.1.tgz#2ab0c9c7f3098fa48907772bb813fe41e8de3a0e"
+  dependencies:
+    babel-helper-builder-binary-assignment-operator-visitor "^6.24.1"
+    babel-plugin-syntax-exponentiation-operator "^6.8.0"
+    babel-runtime "^6.22.0"
+
+babel-plugin-transform-exponentiation-operator@^6.8.0:
   version "6.22.0"
   resolved "https://registry.yarnpkg.com/babel-plugin-transform-exponentiation-operator/-/babel-plugin-transform-exponentiation-operator-6.22.0.tgz#d57c8335281918e54ef053118ce6eb108468084d"
   dependencies:
@@ -784,6 +883,20 @@ babel-plugin-transform-exponentiation-operator@^6.22.0, babel-plugin-transform-e
     babel-plugin-syntax-exponentiation-operator "^6.8.0"
     babel-runtime "^6.22.0"
 
+babel-plugin-transform-export-extensions@^6.22.0:
+  version "6.22.0"
+  resolved "https://registry.yarnpkg.com/babel-plugin-transform-export-extensions/-/babel-plugin-transform-export-extensions-6.22.0.tgz#53738b47e75e8218589eea946cbbd39109bbe653"
+  dependencies:
+    babel-plugin-syntax-export-extensions "^6.8.0"
+    babel-runtime "^6.22.0"
+
+babel-plugin-transform-function-bind@^6.22.0:
+  version "6.22.0"
+  resolved "https://registry.yarnpkg.com/babel-plugin-transform-function-bind/-/babel-plugin-transform-function-bind-6.22.0.tgz#c6fb8e96ac296a310b8cf8ea401462407ddf6a97"
+  dependencies:
+    babel-plugin-syntax-function-bind "^6.8.0"
+    babel-runtime "^6.22.0"
+
 babel-plugin-transform-inline-consecutive-adds@^0.0.2:
   version "0.0.2"
   resolved "https://registry.yarnpkg.com/babel-plugin-transform-inline-consecutive-adds/-/babel-plugin-transform-inline-consecutive-adds-0.0.2.tgz#a58fcecfc09c08fbf9373a5a3e70746c03d01fc1"
@@ -926,23 +1039,39 @@ babel-preset-env@^1.1.8:
     electron-to-chromium "^1.1.0"
     invariant "^2.2.2"
 
-babel-preset-stage-2:
-  version "6.22.0"
-  resolved "https://registry.yarnpkg.com/babel-preset-stage-2/-/babel-preset-stage-2-6.22.0.tgz#ccd565f19c245cade394b21216df704a73b27c07"
+babel-preset-stage-0@^6.24.1:
+  version "6.24.1"
+  resolved "https://registry.yarnpkg.com/babel-preset-stage-0/-/babel-preset-stage-0-6.24.1.tgz#5642d15042f91384d7e5af8bc88b1db95b039e6a"
+  dependencies:
+    babel-plugin-transform-do-expressions "^6.22.0"
+    babel-plugin-transform-function-bind "^6.22.0"
+    babel-preset-stage-1 "^6.24.1"
+
+babel-preset-stage-1@^6.24.1:
+  version "6.24.1"
+  resolved "https://registry.yarnpkg.com/babel-preset-stage-1/-/babel-preset-stage-1-6.24.1.tgz#7692cd7dcd6849907e6ae4a0a85589cfb9e2bfb0"
+  dependencies:
+    babel-plugin-transform-class-constructor-call "^6.24.1"
+    babel-plugin-transform-export-extensions "^6.22.0"
+    babel-preset-stage-2 "^6.24.1"
+
+babel-preset-stage-2@^6.24.1:
+  version "6.24.1"
+  resolved "https://registry.yarnpkg.com/babel-preset-stage-2/-/babel-preset-stage-2-6.24.1.tgz#d9e2960fb3d71187f0e64eec62bc07767219bdc1"
   dependencies:
     babel-plugin-syntax-dynamic-import "^6.18.0"
-    babel-plugin-transform-class-properties "^6.22.0"
-    babel-plugin-transform-decorators "^6.22.0"
-    babel-preset-stage-3 "^6.22.0"
+    babel-plugin-transform-class-properties "^6.24.1"
+    babel-plugin-transform-decorators "^6.24.1"
+    babel-preset-stage-3 "^6.24.1"
 
-babel-preset-stage-3@^6.22.0:
-  version "6.22.0"
-  resolved "https://registry.yarnpkg.com/babel-preset-stage-3/-/babel-preset-stage-3-6.22.0.tgz#a4e92bbace7456fafdf651d7a7657ee0bbca9c2e"
+babel-preset-stage-3@^6.24.1:
+  version "6.24.1"
+  resolved "https://registry.yarnpkg.com/babel-preset-stage-3/-/babel-preset-stage-3-6.24.1.tgz#836ada0a9e7a7fa37cb138fb9326f87934a48395"
   dependencies:
     babel-plugin-syntax-trailing-function-commas "^6.22.0"
-    babel-plugin-transform-async-generator-functions "^6.22.0"
-    babel-plugin-transform-async-to-generator "^6.22.0"
-    babel-plugin-transform-exponentiation-operator "^6.22.0"
+    babel-plugin-transform-async-generator-functions "^6.24.1"
+    babel-plugin-transform-async-to-generator "^6.24.1"
+    babel-plugin-transform-exponentiation-operator "^6.24.1"
     babel-plugin-transform-object-rest-spread "^6.22.0"
 
 babel-register@^6.23.0:
@@ -974,6 +1103,16 @@ babel-template@^6.22.0, babel-template@^6.23.0:
     babylon "^6.11.0"
     lodash "^4.2.0"
 
+babel-template@^6.24.1:
+  version "6.24.1"
+  resolved "https://registry.yarnpkg.com/babel-template/-/babel-template-6.24.1.tgz#04ae514f1f93b3a2537f2a0f60a5a45fb8308333"
+  dependencies:
+    babel-runtime "^6.22.0"
+    babel-traverse "^6.24.1"
+    babel-types "^6.24.1"
+    babylon "^6.11.0"
+    lodash "^4.2.0"
+
 babel-traverse@^6.22.0, babel-traverse@^6.23.0, babel-traverse@^6.23.1:
   version "6.23.1"
   resolved "https://registry.yarnpkg.com/babel-traverse/-/babel-traverse-6.23.1.tgz#d3cb59010ecd06a97d81310065f966b699e14f48"
@@ -988,6 +1127,20 @@ babel-traverse@^6.22.0, babel-traverse@^6.23.0, babel-traverse@^6.23.1:
     invariant "^2.2.0"
     lodash "^4.2.0"
 
+babel-traverse@^6.24.1:
+  version "6.24.1"
+  resolved "https://registry.yarnpkg.com/babel-traverse/-/babel-traverse-6.24.1.tgz#ab36673fd356f9a0948659e7b338d5feadb31695"
+  dependencies:
+    babel-code-frame "^6.22.0"
+    babel-messages "^6.23.0"
+    babel-runtime "^6.22.0"
+    babel-types "^6.24.1"
+    babylon "^6.15.0"
+    debug "^2.2.0"
+    globals "^9.0.0"
+    invariant "^2.2.0"
+    lodash "^4.2.0"
+
 babel-types@^6.19.0, babel-types@^6.22.0, babel-types@^6.23.0:
   version "6.23.0"
   resolved "https://registry.yarnpkg.com/babel-types/-/babel-types-6.23.0.tgz#bb17179d7538bad38cd0c9e115d340f77e7e9acf"
@@ -997,9 +1150,18 @@ babel-types@^6.19.0, babel-types@^6.22.0, babel-types@^6.23.0:
     lodash "^4.2.0"
     to-fast-properties "^1.0.1"
 
-babylon@^6.11.0, babylon@^6.15.0:
-  version "6.16.1"
-  resolved "https://registry.yarnpkg.com/babylon/-/babylon-6.16.1.tgz#30c5a22f481978a9e7f8cdfdf496b11d94b404d3"
+babel-types@^6.24.1:
+  version "6.24.1"
+  resolved "https://registry.yarnpkg.com/babel-types/-/babel-types-6.24.1.tgz#a136879dc15b3606bda0d90c1fc74304c2ff0975"
+  dependencies:
+    babel-runtime "^6.22.0"
+    esutils "^2.0.2"
+    lodash "^4.2.0"
+    to-fast-properties "^1.0.1"
+
+babylon@^6.11.0, babylon@^6.15.0, babylon@^6.17.0:
+  version "6.17.1"
+  resolved "https://registry.yarnpkg.com/babylon/-/babylon-6.17.1.tgz#17f14fddf361b695981fe679385e4f1c01ebd86f"
 
 [email protected]:
   version "1.0.2"
@@ -1664,12 +1826,6 @@ d@1:
   dependencies:
     es5-ext "^0.10.9"
 
-d@^0.1.1, d@~0.1.1:
-  version "0.1.1"
-  resolved "https://registry.yarnpkg.com/d/-/d-0.1.1.tgz#da184c535d18d8ee7ba2aa229b914009fae11309"
-  dependencies:
-    es5-ext "~0.10.2"
-
 dashdash@^1.12.0:
   version "1.14.1"
   resolved "https://registry.yarnpkg.com/dashdash/-/dashdash-1.14.1.tgz#853cfa0f7cbe2fed5de20326b8dd581035f6e2f0"
@@ -1970,22 +2126,7 @@ es5-ext@^0.10.14, es5-ext@^0.10.9, es5-ext@~0.10.14:
     es6-iterator "2"
     es6-symbol "~3.1"
 
-es5-ext@^0.10.7, es5-ext@~0.10.11, es5-ext@~0.10.2:
-  version "0.10.12"
-  resolved "https://registry.yarnpkg.com/es5-ext/-/es5-ext-0.10.12.tgz#aa84641d4db76b62abba5e45fd805ecbab140047"
-  dependencies:
-    es6-iterator "2"
-    es6-symbol "~3.1"
-
-es6-iterator@2:
-  version "2.0.0"
-  resolved "https://registry.yarnpkg.com/es6-iterator/-/es6-iterator-2.0.0.tgz#bd968567d61635e33c0b80727613c9cb4b096bac"
-  dependencies:
-    d "^0.1.1"
-    es5-ext "^0.10.7"
-    es6-symbol "3"
-
-es6-iterator@^2.0.1, es6-iterator@~2.0.1:
+es6-iterator@2, es6-iterator@^2.0.1, es6-iterator@~2.0.1:
   version "2.0.1"
   resolved "https://registry.yarnpkg.com/es6-iterator/-/es6-iterator-2.0.1.tgz#8e319c9f0453bf575d374940a655920e59ca5512"
   dependencies:
@@ -2018,14 +2159,7 @@ es6-set@~0.1.5:
     es6-symbol "3.1.1"
     event-emitter "~0.3.5"
 
-es6-symbol@3, es6-symbol@^3.0.2, es6-symbol@~3.1:
-  version "3.1.0"
-  resolved "https://registry.yarnpkg.com/es6-symbol/-/es6-symbol-3.1.0.tgz#94481c655e7a7cad82eba832d97d5433496d7ffa"
-  dependencies:
-    d "~0.1.1"
-    es5-ext "~0.10.11"
-
[email protected], es6-symbol@^3.1, es6-symbol@^3.1.1, es6-symbol@~3.1.1:
[email protected], es6-symbol@^3.0.2, es6-symbol@^3.1, es6-symbol@^3.1.1, es6-symbol@~3.1, es6-symbol@~3.1.1:
   version "3.1.1"
   resolved "https://registry.yarnpkg.com/es6-symbol/-/es6-symbol-3.1.1.tgz#bf00ef4fdab6ba1b46ecb7b629b4c7ed5715cc77"
   dependencies:
@@ -3627,7 +3761,7 @@ [email protected], mime@^1.2.11, mime@^1.3.4, mime@~1.3.4:
   dependencies:
     brace-expansion "^1.0.0"
 
[email protected]:
[email protected], minimist@~0.0.1:
   version "0.0.8"
   resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.8.tgz#857fcabfc3397d2625b8228262e86aa7a011b05d"
 
@@ -3635,10 +3769,6 @@ minimist@^1.1.3, minimist@^1.2.0, minimist@~1.2.0:
   version "1.2.0"
   resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.0.tgz#a35008b20f41383eec1fb914f4cd5df79a264284"
 
-minimist@~0.0.1:
-  version "0.0.10"
-  resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.10.tgz#de3f98543dbf96082be48ad1a0c7cda836301dcf"
-
 [email protected], [email protected], "mkdirp@>=0.5 0", mkdirp@^0.5.0, mkdirp@^0.5.1, mkdirp@~0.5.0, mkdirp@~0.5.1:
   version "0.5.1"
   resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.1.tgz#30057438eac6cf7f8c4767f38648d6697d75c903"
@@ -3680,14 +3810,10 @@ [email protected]:
     readable-stream "~1.1.9"
     stream-counter "~0.2.0"
 
[email protected]:
[email protected], mute-stream@~0.0.4:
   version "0.0.5"
   resolved "https://registry.yarnpkg.com/mute-stream/-/mute-stream-0.0.5.tgz#8fbfabb0a98a253d3184331f9e8deb7372fac6c0"
 
-mute-stream@~0.0.4:
-  version "0.0.7"
-  resolved "https://registry.yarnpkg.com/mute-stream/-/mute-stream-0.0.7.tgz#3075ce93bc21b8fab43e1bc4da7e8115ed1e7bab"
-
 nan@^2.3.0, nan@^2.3.2:
   version "2.5.1"
   resolved "https://registry.yarnpkg.com/nan/-/nan-2.5.1.tgz#d5b01691253326a97a2bbee9e61c55d8d60351e2"
@@ -4462,19 +4588,7 @@ read@1, read@~1.0.1, read@~1.0.7:
   dependencies:
     mute-stream "~0.0.4"
 
-"readable-stream@1 || 2", readable-stream@^2.0.2, readable-stream@~2.1.4, readable-stream@~2.1.5:
-  version "2.1.5"
-  resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.1.5.tgz#66fa8b720e1438b364681f2ad1a63c618448c9d0"
-  dependencies:
-    buffer-shims "^1.0.0"
-    core-util-is "~1.0.0"
-    inherits "~2.0.1"
-    isarray "~1.0.0"
-    process-nextick-args "~1.0.6"
-    string_decoder "~0.10.x"
-    util-deprecate "~1.0.1"
-
-"readable-stream@^2.0.0 || ^1.1.13", readable-stream@^2.2.2:
+"readable-stream@1 || 2", "readable-stream@^2.0.0 || ^1.1.13", readable-stream@^2.0.2, readable-stream@^2.2.2:
   version "2.2.3"
   resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.2.3.tgz#9cf49463985df016c8ae8813097a9293a9b33729"
   dependencies:
@@ -4515,6 +4629,18 @@ readable-stream@~2.0.0, readable-stream@~2.0.5:
     string_decoder "~0.10.x"
     util-deprecate "~1.0.1"
 
+readable-stream@~2.1.4, readable-stream@~2.1.5:
+  version "2.1.5"
+  resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.1.5.tgz#66fa8b720e1438b364681f2ad1a63c618448c9d0"
+  dependencies:
+    buffer-shims "^1.0.0"
+    core-util-is "~1.0.0"
+    inherits "~2.0.1"
+    isarray "~1.0.0"
+    process-nextick-args "~1.0.6"
+    string_decoder "~0.10.x"
+    util-deprecate "~1.0.1"
+
 readdir-scoped-modules@^1.0.0:
   version "1.0.2"
   resolved "https://registry.yarnpkg.com/readdir-scoped-modules/-/readdir-scoped-modules-1.0.2.tgz#9fafa37d286be5d92cbaebdee030dc9b5f406747"