pebble-web 2.20.0-alpha.1 → 2.21.0-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -15302,52 +15302,50 @@
15302
15302
  inherits(Switch, _React$PureComponent);
15303
15303
  var _super = _createSuper$o(Switch);
15304
15304
  function Switch() {
15305
- var _this;
15306
15305
  classCallCheck(this, Switch);
15307
- _this = _super.apply(this, arguments);
15308
- _this.state = {
15309
- value: _this.props.initialValue || false
15310
- };
15311
- return _this;
15306
+ return _super.apply(this, arguments);
15312
15307
  }
15313
15308
  createClass(Switch, [{
15314
15309
  key: "render",
15315
15310
  value: function render() {
15316
15311
  var _cx3,
15317
- _this2 = this,
15312
+ _this = this,
15318
15313
  _cx4;
15319
15314
  var _this$props = this.props,
15315
+ checked = _this$props.checked,
15320
15316
  _onChange = _this$props.onChange,
15321
15317
  className = _this$props.className,
15322
15318
  label = _this$props.label,
15323
15319
  disabled = _this$props.disabled;
15324
- var value = this.state.value;
15325
15320
  return /*#__PURE__*/React.createElement("label", {
15326
15321
  className: cx(className, fixedLabelStyle, defineProperty({}, disabledStyle$1, !!disabled))
15327
15322
  }, /*#__PURE__*/React.createElement("span", {
15328
15323
  className: labelTextStyle
15329
15324
  }, label), /*#__PURE__*/React.createElement("div", {
15330
- className: cx(labelStyle$1, (_cx3 = {}, defineProperty(_cx3, selectedLabel, value), defineProperty(_cx3, disabledStyle$1, !!disabled), _cx3))
15325
+ className: cx(labelStyle$1, (_cx3 = {}, defineProperty(_cx3, selectedLabel, checked), defineProperty(_cx3, disabledStyle$1, !!disabled), _cx3))
15331
15326
  }, /*#__PURE__*/React.createElement("input", {
15332
15327
  type: "checkbox",
15333
- checked: value,
15328
+ checked: checked,
15334
15329
  className: inputStyle$3,
15335
- onChange: function onChange() {
15336
- _this2.setState({
15337
- value: !value
15330
+ onChange: function onChange(e) {
15331
+ _this.setState({
15332
+ value: !checked
15338
15333
  });
15339
15334
  if (_onChange) {
15340
- _onChange(!value);
15335
+ _onChange(!checked, e);
15341
15336
  }
15342
15337
  },
15343
15338
  disabled: disabled
15344
15339
  }), /*#__PURE__*/React.createElement("span", {
15345
- className: cx((_cx4 = {}, defineProperty(_cx4, switchStyle, true), defineProperty(_cx4, selectedSwitch, value), _cx4))
15340
+ className: cx((_cx4 = {}, defineProperty(_cx4, switchStyle, true), defineProperty(_cx4, selectedSwitch, checked), _cx4))
15346
15341
  })));
15347
15342
  }
15348
15343
  }]);
15349
15344
  return Switch;
15350
15345
  }(React.PureComponent);
15346
+ Switch.defaultProps = {
15347
+ checked: false
15348
+ };
15351
15349
 
15352
15350
  function ownKeys$r(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
15353
15351
  function _objectSpread$r(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys$r(Object(source), true).forEach(function (key) { defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys$r(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }