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.
@@ -1215,8 +1215,10 @@
1215
1215
  PebbleIcon["Add"] = "add";
1216
1216
  PebbleIcon["AddedDetails"] = "added-details";
1217
1217
  PebbleIcon["Admin"] = "admin";
1218
+ PebbleIcon["AgreementLetter"] = "agreement-letter";
1218
1219
  PebbleIcon["AlertFilled"] = "alert-filled";
1219
1220
  PebbleIcon["Alert"] = "alert";
1221
+ PebbleIcon["AllotmentLetter"] = "allotment-letter";
1220
1222
  PebbleIcon["Apps"] = "apps";
1221
1223
  PebbleIcon["ArrowBack"] = "arrow-back";
1222
1224
  PebbleIcon["ArrowDown"] = "arrow-down";
@@ -1382,6 +1384,7 @@
1382
1384
  PebbleIcon["Phone"] = "phone";
1383
1385
  PebbleIcon["Play"] = "play";
1384
1386
  PebbleIcon["Plus"] = "plus";
1387
+ PebbleIcon["PossessionLetter"] = "possession-letter";
1385
1388
  PebbleIcon["Premium"] = "premium";
1386
1389
  PebbleIcon["Print"] = "print";
1387
1390
  PebbleIcon["PriorityChange"] = "priority-change";
@@ -1436,6 +1439,7 @@
1436
1439
  PebbleIcon["VpnKey"] = "vpn-key";
1437
1440
  PebbleIcon["WarningLine"] = "warning-line";
1438
1441
  PebbleIcon["Warning"] = "warning";
1442
+ PebbleIcon["WelcomeLetter"] = "welcome-letter";
1439
1443
  PebbleIcon["WhatsappFilled"] = "whatsapp-filled";
1440
1444
  PebbleIcon["Whatsapp"] = "whatsapp";
1441
1445
  })(PebbleIcon || (PebbleIcon = {}));
@@ -9046,17 +9050,18 @@
9046
9050
  isSelected = _this$props.isSelected,
9047
9051
  disabled = _this$props.disabled,
9048
9052
  labelClassName = _this$props.labelClassName,
9053
+ controlled = _this$props.controlled,
9049
9054
  _onOutsideClick = _this$props.onOutsideClick;
9050
- var isOpen = this.state.isOpen;
9055
+ var _isDropDownOpen = controlled ? !!this.props.isOpen : this.state.isOpen;
9051
9056
  return /*#__PURE__*/React.createElement(OutsideClick, {
9052
9057
  className: cx(wrapperStyle$1, className),
9053
9058
  onOutsideClick: function onOutsideClick() {
9054
9059
  _this2.setState({
9055
9060
  isOpen: false
9056
9061
  });
9057
- if (_onOutsideClick) _onOutsideClick(isOpen);
9062
+ if (_onOutsideClick) _onOutsideClick(_isDropDownOpen);
9058
9063
  },
9059
- disabled: !isOpen
9064
+ disabled: !_isDropDownOpen
9060
9065
  }, /*#__PURE__*/React.createElement(Manager, null, /*#__PURE__*/React.createElement(Reference, null, function (_ref) {
9061
9066
  var ref = _ref.ref;
9062
9067
  return /*#__PURE__*/React.createElement("div", {
@@ -9066,17 +9071,17 @@
9066
9071
  },
9067
9072
  ref: ref
9068
9073
  }, labelComponent ? labelComponent({
9069
- isOpen: isOpen,
9074
+ isOpen: _isDropDownOpen,
9070
9075
  toggleDropdown: _this2.toggleDropdown
9071
9076
  }) : /*#__PURE__*/React.createElement(DropDownButton, {
9072
9077
  isSelected: !!isSelected,
9073
- isOpen: isOpen,
9078
+ isOpen: _isDropDownOpen,
9074
9079
  onClick: _this2.toggleDropdown,
9075
9080
  disabled: disabled,
9076
9081
  className: labelClassName
9077
9082
  }, buttonLabel));
9078
9083
  }), /*#__PURE__*/React.createElement(MountTransition, {
9079
- visible: isOpen
9084
+ visible: _isDropDownOpen
9080
9085
  }, function (transitionStyles) {
9081
9086
  return /*#__PURE__*/React.createElement(renderprops_cjs_7.div, {
9082
9087
  className: cx(dropDownStyle, dropDownClassName),
@@ -9103,7 +9108,7 @@
9103
9108
  "data-placement": placement
9104
9109
  }, children({
9105
9110
  toggle: _this2.toggleDropdown,
9106
- isOpen: _this2.state.isOpen
9111
+ isOpen: _isDropDownOpen
9107
9112
  }));
9108
9113
  }));
9109
9114
  })));
@@ -11217,7 +11222,10 @@
11217
11222
  errorMessage = _this$props.errorMessage,
11218
11223
  placement = _this$props.placement,
11219
11224
  wrapperClassName = _this$props.wrapperClassName,
11220
- initiallyOpen = _this$props.initiallyOpen;
11225
+ initiallyOpen = _this$props.initiallyOpen,
11226
+ onOutsideClick = _this$props.onOutsideClick,
11227
+ controlled = _this$props.controlled,
11228
+ isOpen = _this$props.isOpen;
11221
11229
  var _wrapperClassName = cx(wrapperStyle$3, wrapperClassName);
11222
11230
  var _dropDownClassName = cx(dropDownClassName, this.props.dropDownClassName);
11223
11231
  return /*#__PURE__*/React.createElement(DropDown, {
@@ -11237,7 +11245,7 @@
11237
11245
  value: value,
11238
11246
  placeholder: placeholder,
11239
11247
  onClick: function onClick() {
11240
- if (disabled) return;
11248
+ if (disabled || controlled) return;
11241
11249
  toggleDropdown();
11242
11250
  },
11243
11251
  fixLabelAtTop: true
@@ -11255,7 +11263,10 @@
11255
11263
  className: _wrapperClassName,
11256
11264
  placement: placement,
11257
11265
  modifiers: modifiers$1,
11258
- initiallyOpen: initiallyOpen
11266
+ initiallyOpen: initiallyOpen,
11267
+ onOutsideClick: onOutsideClick,
11268
+ controlled: controlled,
11269
+ isOpen: isOpen
11259
11270
  }, function (_ref3) {
11260
11271
  var toggle = _ref3.toggle;
11261
11272
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Calendar, Object.assign({
@@ -11266,6 +11277,9 @@
11266
11277
  range: false,
11267
11278
  onChange: function onChange(date) {
11268
11279
  _this2.onCalendarDateChange(date);
11280
+ if (controlled) {
11281
+ return;
11282
+ }
11269
11283
  toggle();
11270
11284
  }
11271
11285
  })), errorMessage && /*#__PURE__*/React.createElement("div", {
@@ -11277,10 +11291,10 @@
11277
11291
  key: "getDerivedStateFromProps",
11278
11292
  value: function getDerivedStateFromProps(props, state) {
11279
11293
  var newState = null;
11280
- if (props.value && props.value !== state.propsValue) {
11294
+ if (props.value !== state.propsValue) {
11281
11295
  newState = {
11282
11296
  propsValue: props.value,
11283
- stringInput: props.value && format(props.value, "dd/MM/yyyy") || ""
11297
+ stringInput: props.value ? format(props.value, "dd/MM/yyyy") : ""
11284
11298
  };
11285
11299
  }
11286
11300
  return newState;
@@ -15626,7 +15640,8 @@
15626
15640
  placement = _this$props.placement,
15627
15641
  _label = _this$props.label,
15628
15642
  modifiers = _this$props.modifiers,
15629
- isError = _this$props.isError;
15643
+ isError = _this$props.isError,
15644
+ popperClassName = _this$props.popperClassName;
15630
15645
  return /*#__PURE__*/React.createElement(PebblePopper, {
15631
15646
  label: function label() {
15632
15647
  return _label({
@@ -15639,7 +15654,7 @@
15639
15654
  popperBackgroundColor: isError ? colors.red.base : colors.gray.darker,
15640
15655
  modifiers: modifiers,
15641
15656
  isOpen: this.props.isOpen || this.state.isOpen,
15642
- popperClassName: popperStyle$1,
15657
+ popperClassName: cx(popperStyle$1, popperClassName),
15643
15658
  closeOnOutsideClick: false
15644
15659
  }, this.props.renderElement || this.defaultTooltip);
15645
15660
  }