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.
@@ -16155,52 +16155,50 @@
16155
16155
  inherits(Switch, _React$PureComponent);
16156
16156
  var _super = _createSuper$o(Switch);
16157
16157
  function Switch() {
16158
- var _this;
16159
16158
  classCallCheck(this, Switch);
16160
- _this = _super.apply(this, arguments);
16161
- _this.state = {
16162
- value: _this.props.initialValue || false
16163
- };
16164
- return _this;
16159
+ return _super.apply(this, arguments);
16165
16160
  }
16166
16161
  createClass(Switch, [{
16167
16162
  key: "render",
16168
16163
  value: function render() {
16169
16164
  var _cx3,
16170
- _this2 = this,
16165
+ _this = this,
16171
16166
  _cx4;
16172
16167
  var _this$props = this.props,
16168
+ checked = _this$props.checked,
16173
16169
  _onChange = _this$props.onChange,
16174
16170
  className = _this$props.className,
16175
16171
  label = _this$props.label,
16176
16172
  disabled = _this$props.disabled;
16177
- var value = this.state.value;
16178
16173
  return /*#__PURE__*/React.createElement("label", {
16179
16174
  className: cx(className, fixedLabelStyle, defineProperty({}, disabledStyle$1, !!disabled))
16180
16175
  }, /*#__PURE__*/React.createElement("span", {
16181
16176
  className: labelTextStyle
16182
16177
  }, label), /*#__PURE__*/React.createElement("div", {
16183
- className: cx(labelStyle$1, (_cx3 = {}, defineProperty(_cx3, selectedLabel, value), defineProperty(_cx3, disabledStyle$1, !!disabled), _cx3))
16178
+ className: cx(labelStyle$1, (_cx3 = {}, defineProperty(_cx3, selectedLabel, checked), defineProperty(_cx3, disabledStyle$1, !!disabled), _cx3))
16184
16179
  }, /*#__PURE__*/React.createElement("input", {
16185
16180
  type: "checkbox",
16186
- checked: value,
16181
+ checked: checked,
16187
16182
  className: inputStyle$3,
16188
- onChange: function onChange() {
16189
- _this2.setState({
16190
- value: !value
16183
+ onChange: function onChange(e) {
16184
+ _this.setState({
16185
+ value: !checked
16191
16186
  });
16192
16187
  if (_onChange) {
16193
- _onChange(!value);
16188
+ _onChange(!checked, e);
16194
16189
  }
16195
16190
  },
16196
16191
  disabled: disabled
16197
16192
  }), /*#__PURE__*/React.createElement("span", {
16198
- className: cx((_cx4 = {}, defineProperty(_cx4, switchStyle, true), defineProperty(_cx4, selectedSwitch, value), _cx4))
16193
+ className: cx((_cx4 = {}, defineProperty(_cx4, switchStyle, true), defineProperty(_cx4, selectedSwitch, checked), _cx4))
16199
16194
  })));
16200
16195
  }
16201
16196
  }]);
16202
16197
  return Switch;
16203
16198
  }(React.PureComponent);
16199
+ Switch.defaultProps = {
16200
+ checked: false
16201
+ };
16204
16202
 
16205
16203
  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; }
16206
16204
  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; }