pebble-web 2.20.0 → 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.
@@ -4021,52 +4021,50 @@ var Switch = /*#__PURE__*/function (_React$PureComponent) {
4021
4021
  _inherits(Switch, _React$PureComponent);
4022
4022
  var _super = _createSuper$o(Switch);
4023
4023
  function Switch() {
4024
- var _this;
4025
4024
  _classCallCheck(this, Switch);
4026
- _this = _super.apply(this, arguments);
4027
- _this.state = {
4028
- value: _this.props.initialValue || false
4029
- };
4030
- return _this;
4025
+ return _super.apply(this, arguments);
4031
4026
  }
4032
4027
  _createClass(Switch, [{
4033
4028
  key: "render",
4034
4029
  value: function render() {
4035
4030
  var _cx3,
4036
- _this2 = this,
4031
+ _this = this,
4037
4032
  _cx4;
4038
4033
  var _this$props = this.props,
4034
+ checked = _this$props.checked,
4039
4035
  _onChange = _this$props.onChange,
4040
4036
  className = _this$props.className,
4041
4037
  label = _this$props.label,
4042
4038
  disabled = _this$props.disabled;
4043
- var value = this.state.value;
4044
4039
  return /*#__PURE__*/React.createElement("label", {
4045
4040
  className: emotion.cx(className, fixedLabelStyle, _defineProperty({}, disabledStyle$1, !!disabled))
4046
4041
  }, /*#__PURE__*/React.createElement("span", {
4047
4042
  className: labelTextStyle
4048
4043
  }, label), /*#__PURE__*/React.createElement("div", {
4049
- className: emotion.cx(labelStyle$1, (_cx3 = {}, _defineProperty(_cx3, selectedLabel, value), _defineProperty(_cx3, disabledStyle$1, !!disabled), _cx3))
4044
+ className: emotion.cx(labelStyle$1, (_cx3 = {}, _defineProperty(_cx3, selectedLabel, checked), _defineProperty(_cx3, disabledStyle$1, !!disabled), _cx3))
4050
4045
  }, /*#__PURE__*/React.createElement("input", {
4051
4046
  type: "checkbox",
4052
- checked: value,
4047
+ checked: checked,
4053
4048
  className: inputStyle$3,
4054
- onChange: function onChange() {
4055
- _this2.setState({
4056
- value: !value
4049
+ onChange: function onChange(e) {
4050
+ _this.setState({
4051
+ value: !checked
4057
4052
  });
4058
4053
  if (_onChange) {
4059
- _onChange(!value);
4054
+ _onChange(!checked, e);
4060
4055
  }
4061
4056
  },
4062
4057
  disabled: disabled
4063
4058
  }), /*#__PURE__*/React.createElement("span", {
4064
- className: emotion.cx((_cx4 = {}, _defineProperty(_cx4, switchStyle, true), _defineProperty(_cx4, selectedSwitch, value), _cx4))
4059
+ className: emotion.cx((_cx4 = {}, _defineProperty(_cx4, switchStyle, true), _defineProperty(_cx4, selectedSwitch, checked), _cx4))
4065
4060
  })));
4066
4061
  }
4067
4062
  }]);
4068
4063
  return Switch;
4069
4064
  }(React.PureComponent);
4065
+ Switch.defaultProps = {
4066
+ checked: false
4067
+ };
4070
4068
 
4071
4069
  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; }
4072
4070
  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; }