@janiscommerce/ui-web 1.1.0 → 1.3.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.
package/dist/index.umd.js CHANGED
@@ -15952,11 +15952,21 @@
15952
15952
  };
15953
15953
 
15954
15954
  var InfoWindow = function InfoWindow(_ref) {
15955
- var infoWindowHandles = _ref.infoWindowHandles,
15956
- data = _ref.data,
15955
+ var data = _ref.data,
15956
+ _ref$infoWindowOption = _ref.infoWindowOptions,
15957
+ infoWindowOptions = _ref$infoWindowOption === void 0 ? {} : _ref$infoWindowOption,
15958
+ infoWindowHandles = _ref.infoWindowHandles,
15957
15959
  children = _ref.children;
15960
+ var _infoWindowOptions$in = infoWindowOptions.infoWindowPosition,
15961
+ infoWindowPosition = _infoWindowOptions$in === void 0 ? {} : _infoWindowOptions$in;
15962
+ var pixelOffset = React.useMemo(function () {
15963
+ return new window.google.maps.Size(isNumber(infoWindowPosition === null || infoWindowPosition === void 0 ? void 0 : infoWindowPosition.x) ? infoWindowPosition === null || infoWindowPosition === void 0 ? void 0 : infoWindowPosition.x : 0, isNumber(infoWindowPosition === null || infoWindowPosition === void 0 ? void 0 : infoWindowPosition.y) ? infoWindowPosition === null || infoWindowPosition === void 0 ? void 0 : infoWindowPosition.y : -35);
15964
+ }, [infoWindowPosition === null || infoWindowPosition === void 0 ? void 0 : infoWindowPosition.x, infoWindowPosition === null || infoWindowPosition === void 0 ? void 0 : infoWindowPosition.y]);
15958
15965
  return /*#__PURE__*/React__default["default"].createElement(InfoWindow$1, {
15959
- position: data
15966
+ position: data,
15967
+ options: {
15968
+ pixelOffset: pixelOffset
15969
+ }
15960
15970
  }, /*#__PURE__*/React__default["default"].createElement(styled$2.Content, _extends$1({
15961
15971
  className: "google-map-component__info-window--content"
15962
15972
  }, infoWindowHandles), children));
@@ -16015,6 +16025,8 @@
16015
16025
  infoWindowOpen = _ref2.infoWindowOpen;
16016
16026
 
16017
16027
  var infoWindowContent = markerOptions.infoWindowContent,
16028
+ _markerOptions$infoWi = markerOptions.infoWindowOptions,
16029
+ infoWindowOptions = _markerOptions$infoWi === void 0 ? {} : _markerOptions$infoWi,
16018
16030
  _markerOptions$onLoad = markerOptions.onLoad,
16019
16031
  _onLoad = _markerOptions$onLoad === void 0 ? function () {} : _markerOptions$onLoad,
16020
16032
  _markerOptions$onClic = markerOptions.onClick,
@@ -16143,6 +16155,7 @@
16143
16155
  }, overlay()), infoWindowOpen && infoWindowContent && /*#__PURE__*/React__default["default"].createElement(InfoWindow, {
16144
16156
  className: "google-map-component__info-window",
16145
16157
  data: position,
16158
+ infoWindowOptions: infoWindowOptions,
16146
16159
  infoWindowHandles: infoWindowHandles
16147
16160
  }, infoWindowContent(markerData)));
16148
16161
  };
@@ -35771,7 +35784,11 @@
35771
35784
  };
35772
35785
 
35773
35786
  var isValidValue = function isValidValue(value) {
35774
- return !!value && isNumber(value) && value > 0;
35787
+ return isNumber(value) && value >= 0;
35788
+ };
35789
+
35790
+ var isValidMaxValue = function isValidMaxValue(maxValue) {
35791
+ return isNumber(maxValue) && maxValue > 0;
35775
35792
  };
35776
35793
 
35777
35794
  var ProgressBar = function ProgressBar(_ref) {
@@ -35786,7 +35803,7 @@
35786
35803
  height = _ref$height === void 0 ? 16 : _ref$height,
35787
35804
  _ref$color = _ref.color,
35788
35805
  color = _ref$color === void 0 ? 'blue' : _ref$color;
35789
- if (!isValidValue(value) || !isValidValue(maxValue) || value > maxValue) return null;
35806
+ if (!isValidValue(value) || !isValidMaxValue(maxValue) || value > maxValue) return null;
35790
35807
  var progress = Math.max(0, Math.min(maxValue, value));
35791
35808
  return /*#__PURE__*/React__default["default"].createElement(styled.Bar, {
35792
35809
  height: height,