pebble-web 2.10.0 → 2.10.1

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.
@@ -9050,17 +9050,18 @@
9050
9050
  isSelected = _this$props.isSelected,
9051
9051
  disabled = _this$props.disabled,
9052
9052
  labelClassName = _this$props.labelClassName,
9053
+ controlled = _this$props.controlled,
9053
9054
  _onOutsideClick = _this$props.onOutsideClick;
9054
- var isOpen = this.state.isOpen;
9055
+ var _isDropDownOpen = controlled ? !!this.props.isOpen : this.state.isOpen;
9055
9056
  return /*#__PURE__*/React.createElement(OutsideClick, {
9056
9057
  className: cx(wrapperStyle$1, className),
9057
9058
  onOutsideClick: function onOutsideClick() {
9058
9059
  _this2.setState({
9059
9060
  isOpen: false
9060
9061
  });
9061
- if (_onOutsideClick) _onOutsideClick(isOpen);
9062
+ if (_onOutsideClick) _onOutsideClick(_isDropDownOpen);
9062
9063
  },
9063
- disabled: !isOpen
9064
+ disabled: !_isDropDownOpen
9064
9065
  }, /*#__PURE__*/React.createElement(Manager, null, /*#__PURE__*/React.createElement(Reference, null, function (_ref) {
9065
9066
  var ref = _ref.ref;
9066
9067
  return /*#__PURE__*/React.createElement("div", {
@@ -9070,17 +9071,17 @@
9070
9071
  },
9071
9072
  ref: ref
9072
9073
  }, labelComponent ? labelComponent({
9073
- isOpen: isOpen,
9074
+ isOpen: _isDropDownOpen,
9074
9075
  toggleDropdown: _this2.toggleDropdown
9075
9076
  }) : /*#__PURE__*/React.createElement(DropDownButton, {
9076
9077
  isSelected: !!isSelected,
9077
- isOpen: isOpen,
9078
+ isOpen: _isDropDownOpen,
9078
9079
  onClick: _this2.toggleDropdown,
9079
9080
  disabled: disabled,
9080
9081
  className: labelClassName
9081
9082
  }, buttonLabel));
9082
9083
  }), /*#__PURE__*/React.createElement(MountTransition, {
9083
- visible: isOpen
9084
+ visible: _isDropDownOpen
9084
9085
  }, function (transitionStyles) {
9085
9086
  return /*#__PURE__*/React.createElement(renderprops_cjs_7.div, {
9086
9087
  className: cx(dropDownStyle, dropDownClassName),
@@ -9107,7 +9108,7 @@
9107
9108
  "data-placement": placement
9108
9109
  }, children({
9109
9110
  toggle: _this2.toggleDropdown,
9110
- isOpen: _this2.state.isOpen
9111
+ isOpen: _isDropDownOpen
9111
9112
  }));
9112
9113
  }));
9113
9114
  })));
@@ -11221,7 +11222,10 @@
11221
11222
  errorMessage = _this$props.errorMessage,
11222
11223
  placement = _this$props.placement,
11223
11224
  wrapperClassName = _this$props.wrapperClassName,
11224
- initiallyOpen = _this$props.initiallyOpen;
11225
+ initiallyOpen = _this$props.initiallyOpen,
11226
+ onOutsideClick = _this$props.onOutsideClick,
11227
+ controlled = _this$props.controlled,
11228
+ isOpen = _this$props.isOpen;
11225
11229
  var _wrapperClassName = cx(wrapperStyle$3, wrapperClassName);
11226
11230
  var _dropDownClassName = cx(dropDownClassName, this.props.dropDownClassName);
11227
11231
  return /*#__PURE__*/React.createElement(DropDown, {
@@ -11241,7 +11245,7 @@
11241
11245
  value: value,
11242
11246
  placeholder: placeholder,
11243
11247
  onClick: function onClick() {
11244
- if (disabled) return;
11248
+ if (disabled || controlled) return;
11245
11249
  toggleDropdown();
11246
11250
  },
11247
11251
  fixLabelAtTop: true
@@ -11259,7 +11263,10 @@
11259
11263
  className: _wrapperClassName,
11260
11264
  placement: placement,
11261
11265
  modifiers: modifiers$1,
11262
- initiallyOpen: initiallyOpen
11266
+ initiallyOpen: initiallyOpen,
11267
+ onOutsideClick: onOutsideClick,
11268
+ controlled: controlled,
11269
+ isOpen: isOpen
11263
11270
  }, function (_ref3) {
11264
11271
  var toggle = _ref3.toggle;
11265
11272
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Calendar, Object.assign({
@@ -11270,6 +11277,9 @@
11270
11277
  range: false,
11271
11278
  onChange: function onChange(date) {
11272
11279
  _this2.onCalendarDateChange(date);
11280
+ if (controlled) {
11281
+ return;
11282
+ }
11273
11283
  toggle();
11274
11284
  }
11275
11285
  })), errorMessage && /*#__PURE__*/React.createElement("div", {