pebble-web 2.9.3 → 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.
@@ -1351,8 +1351,10 @@
1351
1351
  PebbleIcon["Add"] = "add";
1352
1352
  PebbleIcon["AddedDetails"] = "added-details";
1353
1353
  PebbleIcon["Admin"] = "admin";
1354
+ PebbleIcon["AgreementLetter"] = "agreement-letter";
1354
1355
  PebbleIcon["AlertFilled"] = "alert-filled";
1355
1356
  PebbleIcon["Alert"] = "alert";
1357
+ PebbleIcon["AllotmentLetter"] = "allotment-letter";
1356
1358
  PebbleIcon["Apps"] = "apps";
1357
1359
  PebbleIcon["ArrowBack"] = "arrow-back";
1358
1360
  PebbleIcon["ArrowDown"] = "arrow-down";
@@ -1518,6 +1520,7 @@
1518
1520
  PebbleIcon["Phone"] = "phone";
1519
1521
  PebbleIcon["Play"] = "play";
1520
1522
  PebbleIcon["Plus"] = "plus";
1523
+ PebbleIcon["PossessionLetter"] = "possession-letter";
1521
1524
  PebbleIcon["Premium"] = "premium";
1522
1525
  PebbleIcon["Print"] = "print";
1523
1526
  PebbleIcon["PriorityChange"] = "priority-change";
@@ -1572,6 +1575,7 @@
1572
1575
  PebbleIcon["VpnKey"] = "vpn-key";
1573
1576
  PebbleIcon["WarningLine"] = "warning-line";
1574
1577
  PebbleIcon["Warning"] = "warning";
1578
+ PebbleIcon["WelcomeLetter"] = "welcome-letter";
1575
1579
  PebbleIcon["WhatsappFilled"] = "whatsapp-filled";
1576
1580
  PebbleIcon["Whatsapp"] = "whatsapp";
1577
1581
  })(PebbleIcon || (PebbleIcon = {}));
@@ -9809,17 +9813,18 @@
9809
9813
  isSelected = _this$props.isSelected,
9810
9814
  disabled = _this$props.disabled,
9811
9815
  labelClassName = _this$props.labelClassName,
9816
+ controlled = _this$props.controlled,
9812
9817
  _onOutsideClick = _this$props.onOutsideClick;
9813
- var isOpen = this.state.isOpen;
9818
+ var _isDropDownOpen = controlled ? !!this.props.isOpen : this.state.isOpen;
9814
9819
  return /*#__PURE__*/React.createElement(OutsideClick, {
9815
9820
  className: cx(wrapperStyle$1, className),
9816
9821
  onOutsideClick: function onOutsideClick() {
9817
9822
  _this2.setState({
9818
9823
  isOpen: false
9819
9824
  });
9820
- if (_onOutsideClick) _onOutsideClick(isOpen);
9825
+ if (_onOutsideClick) _onOutsideClick(_isDropDownOpen);
9821
9826
  },
9822
- disabled: !isOpen
9827
+ disabled: !_isDropDownOpen
9823
9828
  }, /*#__PURE__*/React.createElement(Manager, null, /*#__PURE__*/React.createElement(Reference, null, function (_ref) {
9824
9829
  var ref = _ref.ref;
9825
9830
  return /*#__PURE__*/React.createElement("div", {
@@ -9829,17 +9834,17 @@
9829
9834
  },
9830
9835
  ref: ref
9831
9836
  }, labelComponent ? labelComponent({
9832
- isOpen: isOpen,
9837
+ isOpen: _isDropDownOpen,
9833
9838
  toggleDropdown: _this2.toggleDropdown
9834
9839
  }) : /*#__PURE__*/React.createElement(DropDownButton, {
9835
9840
  isSelected: !!isSelected,
9836
- isOpen: isOpen,
9841
+ isOpen: _isDropDownOpen,
9837
9842
  onClick: _this2.toggleDropdown,
9838
9843
  disabled: disabled,
9839
9844
  className: labelClassName
9840
9845
  }, buttonLabel));
9841
9846
  }), /*#__PURE__*/React.createElement(MountTransition, {
9842
- visible: isOpen
9847
+ visible: _isDropDownOpen
9843
9848
  }, function (transitionStyles) {
9844
9849
  return /*#__PURE__*/React.createElement(renderprops_cjs_7.div, {
9845
9850
  className: cx(dropDownStyle, dropDownClassName),
@@ -9866,7 +9871,7 @@
9866
9871
  "data-placement": placement
9867
9872
  }, children({
9868
9873
  toggle: _this2.toggleDropdown,
9869
- isOpen: _this2.state.isOpen
9874
+ isOpen: _isDropDownOpen
9870
9875
  }));
9871
9876
  }));
9872
9877
  })));
@@ -12006,7 +12011,10 @@
12006
12011
  errorMessage = _this$props.errorMessage,
12007
12012
  placement = _this$props.placement,
12008
12013
  wrapperClassName = _this$props.wrapperClassName,
12009
- initiallyOpen = _this$props.initiallyOpen;
12014
+ initiallyOpen = _this$props.initiallyOpen,
12015
+ onOutsideClick = _this$props.onOutsideClick,
12016
+ controlled = _this$props.controlled,
12017
+ isOpen = _this$props.isOpen;
12010
12018
  var _wrapperClassName = cx(wrapperStyle$3, wrapperClassName);
12011
12019
  var _dropDownClassName = cx(dropDownClassName, this.props.dropDownClassName);
12012
12020
  return /*#__PURE__*/React.createElement(DropDown, {
@@ -12026,7 +12034,7 @@
12026
12034
  value: value,
12027
12035
  placeholder: placeholder,
12028
12036
  onClick: function onClick() {
12029
- if (disabled) return;
12037
+ if (disabled || controlled) return;
12030
12038
  toggleDropdown();
12031
12039
  },
12032
12040
  fixLabelAtTop: true
@@ -12044,7 +12052,10 @@
12044
12052
  className: _wrapperClassName,
12045
12053
  placement: placement,
12046
12054
  modifiers: modifiers$1,
12047
- initiallyOpen: initiallyOpen
12055
+ initiallyOpen: initiallyOpen,
12056
+ onOutsideClick: onOutsideClick,
12057
+ controlled: controlled,
12058
+ isOpen: isOpen
12048
12059
  }, function (_ref3) {
12049
12060
  var toggle = _ref3.toggle;
12050
12061
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Calendar, Object.assign({
@@ -12055,6 +12066,9 @@
12055
12066
  range: false,
12056
12067
  onChange: function onChange(date) {
12057
12068
  _this2.onCalendarDateChange(date);
12069
+ if (controlled) {
12070
+ return;
12071
+ }
12058
12072
  toggle();
12059
12073
  }
12060
12074
  })), errorMessage && /*#__PURE__*/React.createElement("div", {
@@ -12066,10 +12080,10 @@
12066
12080
  key: "getDerivedStateFromProps",
12067
12081
  value: function getDerivedStateFromProps(props, state) {
12068
12082
  var newState = null;
12069
- if (props.value && props.value !== state.propsValue) {
12083
+ if (props.value !== state.propsValue) {
12070
12084
  newState = {
12071
12085
  propsValue: props.value,
12072
- stringInput: props.value && format(props.value, "dd/MM/yyyy") || ""
12086
+ stringInput: props.value ? format(props.value, "dd/MM/yyyy") : ""
12073
12087
  };
12074
12088
  }
12075
12089
  return newState;
@@ -16492,7 +16506,8 @@
16492
16506
  placement = _this$props.placement,
16493
16507
  _label = _this$props.label,
16494
16508
  modifiers = _this$props.modifiers,
16495
- isError = _this$props.isError;
16509
+ isError = _this$props.isError,
16510
+ popperClassName = _this$props.popperClassName;
16496
16511
  return /*#__PURE__*/React.createElement(PebblePopper, {
16497
16512
  label: function label() {
16498
16513
  return _label({
@@ -16505,7 +16520,7 @@
16505
16520
  popperBackgroundColor: isError ? colors.red.base : colors.gray.darker,
16506
16521
  modifiers: modifiers,
16507
16522
  isOpen: this.props.isOpen || this.state.isOpen,
16508
- popperClassName: popperStyle$1,
16523
+ popperClassName: cx(popperStyle$1, popperClassName),
16509
16524
  closeOnOutsideClick: false
16510
16525
  }, this.props.renderElement || this.defaultTooltip);
16511
16526
  }