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.
@@ -9813,17 +9813,18 @@
9813
9813
  isSelected = _this$props.isSelected,
9814
9814
  disabled = _this$props.disabled,
9815
9815
  labelClassName = _this$props.labelClassName,
9816
+ controlled = _this$props.controlled,
9816
9817
  _onOutsideClick = _this$props.onOutsideClick;
9817
- var isOpen = this.state.isOpen;
9818
+ var _isDropDownOpen = controlled ? !!this.props.isOpen : this.state.isOpen;
9818
9819
  return /*#__PURE__*/React.createElement(OutsideClick, {
9819
9820
  className: cx(wrapperStyle$1, className),
9820
9821
  onOutsideClick: function onOutsideClick() {
9821
9822
  _this2.setState({
9822
9823
  isOpen: false
9823
9824
  });
9824
- if (_onOutsideClick) _onOutsideClick(isOpen);
9825
+ if (_onOutsideClick) _onOutsideClick(_isDropDownOpen);
9825
9826
  },
9826
- disabled: !isOpen
9827
+ disabled: !_isDropDownOpen
9827
9828
  }, /*#__PURE__*/React.createElement(Manager, null, /*#__PURE__*/React.createElement(Reference, null, function (_ref) {
9828
9829
  var ref = _ref.ref;
9829
9830
  return /*#__PURE__*/React.createElement("div", {
@@ -9833,17 +9834,17 @@
9833
9834
  },
9834
9835
  ref: ref
9835
9836
  }, labelComponent ? labelComponent({
9836
- isOpen: isOpen,
9837
+ isOpen: _isDropDownOpen,
9837
9838
  toggleDropdown: _this2.toggleDropdown
9838
9839
  }) : /*#__PURE__*/React.createElement(DropDownButton, {
9839
9840
  isSelected: !!isSelected,
9840
- isOpen: isOpen,
9841
+ isOpen: _isDropDownOpen,
9841
9842
  onClick: _this2.toggleDropdown,
9842
9843
  disabled: disabled,
9843
9844
  className: labelClassName
9844
9845
  }, buttonLabel));
9845
9846
  }), /*#__PURE__*/React.createElement(MountTransition, {
9846
- visible: isOpen
9847
+ visible: _isDropDownOpen
9847
9848
  }, function (transitionStyles) {
9848
9849
  return /*#__PURE__*/React.createElement(renderprops_cjs_7.div, {
9849
9850
  className: cx(dropDownStyle, dropDownClassName),
@@ -9870,7 +9871,7 @@
9870
9871
  "data-placement": placement
9871
9872
  }, children({
9872
9873
  toggle: _this2.toggleDropdown,
9873
- isOpen: _this2.state.isOpen
9874
+ isOpen: _isDropDownOpen
9874
9875
  }));
9875
9876
  }));
9876
9877
  })));
@@ -12010,7 +12011,10 @@
12010
12011
  errorMessage = _this$props.errorMessage,
12011
12012
  placement = _this$props.placement,
12012
12013
  wrapperClassName = _this$props.wrapperClassName,
12013
- initiallyOpen = _this$props.initiallyOpen;
12014
+ initiallyOpen = _this$props.initiallyOpen,
12015
+ onOutsideClick = _this$props.onOutsideClick,
12016
+ controlled = _this$props.controlled,
12017
+ isOpen = _this$props.isOpen;
12014
12018
  var _wrapperClassName = cx(wrapperStyle$3, wrapperClassName);
12015
12019
  var _dropDownClassName = cx(dropDownClassName, this.props.dropDownClassName);
12016
12020
  return /*#__PURE__*/React.createElement(DropDown, {
@@ -12030,7 +12034,7 @@
12030
12034
  value: value,
12031
12035
  placeholder: placeholder,
12032
12036
  onClick: function onClick() {
12033
- if (disabled) return;
12037
+ if (disabled || controlled) return;
12034
12038
  toggleDropdown();
12035
12039
  },
12036
12040
  fixLabelAtTop: true
@@ -12048,7 +12052,10 @@
12048
12052
  className: _wrapperClassName,
12049
12053
  placement: placement,
12050
12054
  modifiers: modifiers$1,
12051
- initiallyOpen: initiallyOpen
12055
+ initiallyOpen: initiallyOpen,
12056
+ onOutsideClick: onOutsideClick,
12057
+ controlled: controlled,
12058
+ isOpen: isOpen
12052
12059
  }, function (_ref3) {
12053
12060
  var toggle = _ref3.toggle;
12054
12061
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Calendar, Object.assign({
@@ -12059,6 +12066,9 @@
12059
12066
  range: false,
12060
12067
  onChange: function onChange(date) {
12061
12068
  _this2.onCalendarDateChange(date);
12069
+ if (controlled) {
12070
+ return;
12071
+ }
12062
12072
  toggle();
12063
12073
  }
12064
12074
  })), errorMessage && /*#__PURE__*/React.createElement("div", {