@cashub/ui 0.19.8 → 0.19.11

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.
@@ -150,7 +150,7 @@ var Month = function Month(_ref) {
150
150
  disabled: handleDisableArrow('next'),
151
151
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_md.MdArrowForwardIos, {})
152
152
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)(IconButton, {
153
- rotate: expand,
153
+ $rotate: expand,
154
154
  right: true,
155
155
  onClick: handleDisplayAccordionContent,
156
156
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_io.IoMdArrowDropup, {})
@@ -170,8 +170,8 @@ var IconButton = _styledComponents.default.button(_templateObject2 || (_template
170
170
  return disabled && (0, _styledComponents.css)(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n opacity: 0.5;\n\n &:hover {\n color: var(--font-on-background);\n }\n "])));
171
171
  }, function (_ref3) {
172
172
  var right = _ref3.right,
173
- rotate = _ref3.rotate;
174
- return right && "\n position: absolute;\n right: 0;\n ".concat(rotate && (0, _styledComponents.css)(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n transform: rotate(180deg);\n "]))), "\n ");
173
+ $rotate = _ref3.$rotate;
174
+ return right && "\n position: absolute;\n right: 0;\n ".concat($rotate && (0, _styledComponents.css)(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n transform: rotate(180deg);\n "]))), "\n ");
175
175
  });
176
176
 
177
177
  var Body = _styledComponents.default.div(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n flex-wrap: wrap;\n height: 0;\n width: 100%;\n display: ", ";\n\n ", "\n transition: .3s;\n\n transition: 0.3s;\n"])), function (_ref4) {
@@ -202,7 +202,7 @@ var Year = function Year(_ref) {
202
202
  disabled: handleDisableArrow('next'),
203
203
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_md.MdArrowForwardIos, {})
204
204
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)(IconButton, {
205
- rotate: expand,
205
+ $rotate: expand,
206
206
  right: true,
207
207
  onClick: handleDisplayAccordionContent,
208
208
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_io.IoMdArrowDropup, {})
@@ -223,8 +223,8 @@ var IconButton = _styledComponents.default.button(_templateObject2 || (_template
223
223
  return disabled && (0, _styledComponents.css)(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n opacity: 0.5;\n\n &:hover {\n color: var(--font-on-background);\n }\n "])));
224
224
  }, function (_ref3) {
225
225
  var right = _ref3.right,
226
- rotate = _ref3.rotate;
227
- return right && "\n position: absolute;\n right: 0;\n ".concat(rotate && (0, _styledComponents.css)(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n transform: rotate(180deg);\n "]))), "\n ");
226
+ $rotate = _ref3.$rotate;
227
+ return right && "\n position: absolute;\n right: 0;\n ".concat($rotate && (0, _styledComponents.css)(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n transform: rotate(180deg);\n "]))), "\n ");
228
228
  });
229
229
 
230
230
  var Body = _styledComponents.default.div(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n flex-wrap: wrap;\n height: 0;\n width: 100%;\n display: ", ";\n transition: 0.3s;\n overflow-y: scroll;\n gap: 12px 0;\n ", "\n\n ", "\n"])), function (_ref4) {
package/form/Checkbox.js CHANGED
@@ -19,7 +19,7 @@ var _md = require("react-icons/md");
19
19
 
20
20
  var _jsxRuntime = require("react/jsx-runtime");
21
21
 
22
- var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6;
22
+ var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7;
23
23
 
24
24
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
25
25
 
@@ -36,13 +36,15 @@ var Checkbox = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
36
36
  checked = _ref.checked,
37
37
  onChange = _ref.onChange,
38
38
  noMargin = _ref.noMargin,
39
- fontSizeBig = _ref.fontSizeBig;
39
+ fontSizeBig = _ref.fontSizeBig,
40
+ marginRight = _ref.marginRight;
40
41
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)(StyledLabel, {
41
42
  htmlFor: htmlFor,
42
43
  disabled: disabled,
43
44
  ref: ref,
44
45
  noMargin: noMargin,
45
46
  fontSizeBig: fontSizeBig,
47
+ marginRight: marginRight,
46
48
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(StyledCheckbox, {
47
49
  checked: checked,
48
50
  type: "checkbox",
@@ -60,22 +62,25 @@ var Checkbox = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
60
62
  });
61
63
  });
62
64
  var StyledCheckbox = (0, _styledComponents.default)(_Input.default)(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: none;\n\n &:checked + span {\n > div:last-of-type {\n display: block;\n color: var(--color-primary);\n }\n > div:first-of-type {\n display: none;\n }\n }\n"])));
63
- var StyledLabel = (0, _styledComponents.default)(_Label.default)(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n display: inline-block;\n cursor: pointer;\n vertical-align: middle;\n\n > span {\n ", "\n display: flex;\n align-items: center;\n\n > div {\n margin-right: var(--spacing-xs);\n width: 24px;\n height: 24px;\n border-radius: 4px;\n }\n\n > div:last-of-type {\n display: none;\n }\n }\n\n ", "\n\n ", "\n"])), function (_ref2) {
64
- var disabled = _ref2.disabled;
65
- return disabled && (0, _styledComponents.css)(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n opacity: 0.5;\n cursor: not-allowed;\n "])));
65
+ var StyledLabel = (0, _styledComponents.default)(_Label.default)(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n display: inline-block;\n cursor: pointer;\n vertical-align: middle;\n\n ", "\n\n > span {\n ", "\n display: flex;\n align-items: center;\n\n > div {\n margin-right: var(--spacing-xs);\n width: 24px;\n height: 24px;\n border-radius: 4px;\n }\n\n > div:last-of-type {\n display: none;\n }\n }\n\n ", "\n\n ", "\n"])), function (_ref2) {
66
+ var marginRight = _ref2.marginRight;
67
+ return marginRight && (0, _styledComponents.css)(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n margin-right: var(--spacing-l);\n "])));
66
68
  }, function (_ref3) {
67
- var fontSizeBig = _ref3.fontSizeBig;
68
- return fontSizeBig && 'font-size: var(--font-h3);';
69
+ var disabled = _ref3.disabled;
70
+ return disabled && (0, _styledComponents.css)(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n opacity: 0.5;\n cursor: not-allowed;\n "])));
69
71
  }, function (_ref4) {
70
- var noMargin = _ref4.noMargin;
72
+ var fontSizeBig = _ref4.fontSizeBig;
73
+ return fontSizeBig && 'font-size: var(--font-h3);';
74
+ }, function (_ref5) {
75
+ var noMargin = _ref5.noMargin;
71
76
  return noMargin && 'margin: 0;';
72
77
  });
73
78
 
74
- var Unchecked = _styledComponents.default.div(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n flex: 0 0 auto;\n border: var(--border-width) solid var(--border-color);\n"])));
79
+ var Unchecked = _styledComponents.default.div(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n flex: 0 0 auto;\n border: var(--border-width) solid var(--border-color);\n"])));
75
80
 
76
- var Checked = _styledComponents.default.div(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n flex: 0 0 auto;\n border: var(--border-width) solid var(--color-primary);\n background: var(--color-primary);\n position: relative;\n\n > svg {\n position: absolute;\n color: var(--font-on-primary);\n font-size: var(--font-h3);\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n }\n"])));
81
+ var Checked = _styledComponents.default.div(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n flex: 0 0 auto;\n border: var(--border-width) solid var(--color-primary);\n background: var(--color-primary);\n position: relative;\n\n > svg {\n position: absolute;\n color: var(--font-on-primary);\n font-size: var(--font-h3);\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n }\n"])));
77
82
 
78
- var Text = _styledComponents.default.p(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n word-break: break-all;\n"])));
83
+ var Text = _styledComponents.default.p(_templateObject7 || (_templateObject7 = _taggedTemplateLiteral(["\n word-break: break-all;\n"])));
79
84
 
80
85
  var _default = Checkbox;
81
86
  exports.default = _default;
package/helmet/Helmet.js CHANGED
@@ -5,14 +5,14 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.default = void 0;
7
7
 
8
- var _reactHelmet = require("react-helmet");
8
+ var _reactHelmetAsync = require("react-helmet-async");
9
9
 
10
10
  var _jsxRuntime = require("react/jsx-runtime");
11
11
 
12
12
  var Helmet = function Helmet(_ref) {
13
13
  var title = _ref.title,
14
14
  description = _ref.description;
15
- return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactHelmet.Helmet, {
15
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactHelmetAsync.Helmet, {
16
16
  children: [title && /*#__PURE__*/(0, _jsxRuntime.jsx)("title", {
17
17
  children: title
18
18
  }), description && /*#__PURE__*/(0, _jsxRuntime.jsx)("meta", {
package/helmet/index.js CHANGED
@@ -9,7 +9,15 @@ Object.defineProperty(exports, "Helmet", {
9
9
  return _Helmet.default;
10
10
  }
11
11
  });
12
+ Object.defineProperty(exports, "HelmetProvider", {
13
+ enumerable: true,
14
+ get: function get() {
15
+ return _reactHelmetAsync.HelmetProvider;
16
+ }
17
+ });
12
18
 
13
19
  var _Helmet = _interopRequireDefault(require("./Helmet"));
14
20
 
21
+ var _reactHelmetAsync = require("react-helmet-async");
22
+
15
23
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
package/map/GoogleMap.js CHANGED
@@ -9,10 +9,10 @@ var _react = require("react");
9
9
 
10
10
  var _server = require("react-dom/server");
11
11
 
12
- var _reactWrapper = require("@googlemaps/react-wrapper");
13
-
14
12
  var _markerclusterer = require("@googlemaps/markerclusterer");
15
13
 
14
+ var _GoogleMapWrapper = _interopRequireDefault(require("./subComponent/GoogleMapWrapper"));
15
+
16
16
  var _GoogleMapContainer = _interopRequireDefault(require("./subComponent/GoogleMapContainer"));
17
17
 
18
18
  var _GoogleMapPopup = _interopRequireDefault(require("./subComponent/GoogleMapPopup"));
@@ -25,14 +25,8 @@ var _map_icon2 = _interopRequireDefault(require("../assets/icons/map_icon4.png")
25
25
 
26
26
  var _jsxRuntime = require("react/jsx-runtime");
27
27
 
28
- var _excluded = ["apiKey", "onError"];
29
-
30
28
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
31
29
 
32
- function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
33
-
34
- function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
35
-
36
30
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
37
31
 
38
32
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
@@ -142,7 +136,7 @@ var GoogleMap = function GoogleMap(_ref) {
142
136
  }, [data, handleError]);
143
137
 
144
138
  if (!hasError) {
145
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(MapWrapper, {
139
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_GoogleMapWrapper.default, {
146
140
  apiKey: apiKey,
147
141
  height: height,
148
142
  zoom: zoom,
@@ -154,52 +148,25 @@ var GoogleMap = function GoogleMap(_ref) {
154
148
  geoFenceOptions: geoFenceOptions,
155
149
  onError: handleError,
156
150
  customPopup: customPopup,
157
- checkPrimaryLocation: checkPrimaryLocation
151
+ checkPrimaryLocation: checkPrimaryLocation,
152
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(Map, {})
158
153
  });
159
154
  }
160
155
 
161
156
  return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {});
162
157
  };
163
158
 
164
- var MapWrapper = function MapWrapper(_ref2) {
165
- var apiKey = _ref2.apiKey,
166
- onError = _ref2.onError,
167
- props = _objectWithoutProperties(_ref2, _excluded);
168
-
169
- var render = function render(status) {
170
- switch (status) {
171
- case _reactWrapper.Status.LOADING:
172
- return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {});
173
-
174
- case _reactWrapper.Status.FAILURE:
175
- onError(status);
176
- return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {});
177
-
178
- case _reactWrapper.Status.SUCCESS:
179
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(Map, _objectSpread({}, props));
180
-
181
- default:
182
- break;
183
- }
184
- };
185
-
186
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactWrapper.Wrapper, {
187
- apiKey: apiKey,
188
- render: render
189
- });
190
- };
191
-
192
- var Map = function Map(_ref3) {
193
- var height = _ref3.height,
194
- zoom = _ref3.zoom,
195
- defaultPosition = _ref3.defaultPosition,
196
- position = _ref3.position,
197
- locations = _ref3.locations,
198
- bounds = _ref3.bounds,
199
- geoFence = _ref3.geoFence,
200
- geoFenceOptions = _ref3.geoFenceOptions,
201
- customPopup = _ref3.customPopup,
202
- checkPrimaryLocation = _ref3.checkPrimaryLocation;
159
+ var Map = function Map(_ref2) {
160
+ var height = _ref2.height,
161
+ zoom = _ref2.zoom,
162
+ defaultPosition = _ref2.defaultPosition,
163
+ position = _ref2.position,
164
+ locations = _ref2.locations,
165
+ bounds = _ref2.bounds,
166
+ geoFence = _ref2.geoFence,
167
+ geoFenceOptions = _ref2.geoFenceOptions,
168
+ customPopup = _ref2.customPopup,
169
+ checkPrimaryLocation = _ref2.checkPrimaryLocation;
203
170
  var ref = (0, _react.useRef)(null);
204
171
 
205
172
  var _useState7 = (0, _react.useState)(),
@@ -421,7 +388,7 @@ var Map = function Map(_ref3) {
421
388
 
422
389
  if (drag) {
423
390
  circle.addListener('center_changed', function () {
424
- drag(circle.getCenter());
391
+ drag(circle.getCenter().toJSON());
425
392
  });
426
393
  }
427
394
  }
@@ -11,9 +11,9 @@ var _react = require("react");
11
11
 
12
12
  var _styledComponents = _interopRequireDefault(require("styled-components"));
13
13
 
14
- var _reactWrapper = require("@googlemaps/react-wrapper");
14
+ var _GoogleMapWrapper = _interopRequireDefault(require("./subComponent/GoogleMapWrapper"));
15
15
 
16
- var _GoogleMapContainer = _interopRequireDefault(require("../map/subComponent/GoogleMapContainer"));
16
+ var _GoogleMapContainer = _interopRequireDefault(require("./subComponent/GoogleMapContainer"));
17
17
 
18
18
  var _Searchbox = _interopRequireDefault(require("../form/Searchbox"));
19
19
 
@@ -23,22 +23,10 @@ var _jsxRuntime = require("react/jsx-runtime");
23
23
 
24
24
  var _templateObject;
25
25
 
26
- var _excluded = ["apiKey", "onError"];
27
-
28
26
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
29
27
 
30
28
  function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
31
29
 
32
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
33
-
34
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
35
-
36
- function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
37
-
38
- function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
39
-
40
- function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
41
-
42
30
  function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return generator._invoke = function (innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; }(innerFn, self, context), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; this._invoke = function (method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); }; } function maybeInvokeDelegate(delegate, context) { var method = delegate.iterator[context.method]; if (undefined === method) { if (context.delegate = null, "throw" === context.method) { if (delegate.iterator.return && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method)) return ContinueSentinel; context.method = "throw", context.arg = new TypeError("The iterator does not provide a 'throw' method"); } return ContinueSentinel; } var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) { if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; } return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, define(Gp, "constructor", GeneratorFunctionPrototype), define(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (object) { var keys = []; for (var key in object) { keys.push(key); } return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) { "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); } }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, catch: function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
43
31
 
44
32
  function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
@@ -135,60 +123,27 @@ var GoogleReverseGeolocation = function GoogleReverseGeolocation(_ref) {
135
123
  };
136
124
  }();
137
125
 
138
- var Map = /*#__PURE__*/(0, _jsxRuntime.jsx)(MapWrapper, {
139
- apiKey: apiKey,
140
- height: 512,
141
- zoom: 3,
142
- markerLatLng: markerLatLng,
143
- handleChangeLatlng: handleChangeLatlng,
144
- onSearch: onSearch,
145
- onError: onError
146
- });
147
126
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_jsxRuntime.Fragment, {
148
- children: children(Map, confirmChooseLocation)
149
- });
150
- };
151
-
152
- var MapWrapper = function MapWrapper(_ref3) {
153
- var apiKey = _ref3.apiKey,
154
- onError = _ref3.onError,
155
- props = _objectWithoutProperties(_ref3, _excluded);
156
-
157
- var render = function render(status) {
158
- switch (status) {
159
- case _reactWrapper.Status.LOADING:
160
- return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {});
161
-
162
- case _reactWrapper.Status.FAILURE:
163
- onError(status);
164
- return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {});
165
-
166
- case _reactWrapper.Status.SUCCESS:
167
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(Map, _objectSpread(_objectSpread({}, props), {}, {
168
- onError: onError
169
- }));
170
-
171
- default:
172
- break;
173
- }
174
- };
175
-
176
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactWrapper.Wrapper, {
177
- apiKey: apiKey,
178
- render: render,
179
- style: {
180
- position: 'relative'
181
- }
127
+ children: children( /*#__PURE__*/(0, _jsxRuntime.jsx)(_GoogleMapWrapper.default, {
128
+ apiKey: apiKey,
129
+ height: 512,
130
+ zoom: 3,
131
+ markerLatLng: markerLatLng,
132
+ handleChangeLatlng: handleChangeLatlng,
133
+ onSearch: onSearch,
134
+ onError: onError,
135
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(Map, {})
136
+ }), confirmChooseLocation)
182
137
  });
183
138
  };
184
139
 
185
- var Map = function Map(_ref4) {
186
- var height = _ref4.height,
187
- zoom = _ref4.zoom,
188
- markerLatLng = _ref4.markerLatLng,
189
- handleChangeLatlng = _ref4.handleChangeLatlng,
190
- onSearch = _ref4.onSearch,
191
- onError = _ref4.onError;
140
+ var Map = function Map(_ref3) {
141
+ var height = _ref3.height,
142
+ zoom = _ref3.zoom,
143
+ markerLatLng = _ref3.markerLatLng,
144
+ handleChangeLatlng = _ref3.handleChangeLatlng,
145
+ onSearch = _ref3.onSearch,
146
+ onError = _ref3.onError;
192
147
  var ref = (0, _react.useRef)(null);
193
148
 
194
149
  var _useState3 = (0, _react.useState)(),
@@ -233,7 +188,7 @@ var Map = function Map(_ref4) {
233
188
  };
234
189
 
235
190
  var handleSearch = /*#__PURE__*/function () {
236
- var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(address) {
191
+ var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(address) {
237
192
  var latlng;
238
193
  return _regeneratorRuntime().wrap(function _callee2$(_context2) {
239
194
  while (1) {
@@ -271,7 +226,7 @@ var Map = function Map(_ref4) {
271
226
  }));
272
227
 
273
228
  return function handleSearch(_x2) {
274
- return _ref5.apply(this, arguments);
229
+ return _ref4.apply(this, arguments);
275
230
  };
276
231
  }(); // setup map
277
232
 
package/map/LeafletMap.js CHANGED
@@ -17,7 +17,7 @@ require("leaflet/dist/leaflet.css");
17
17
 
18
18
  require("react-leaflet-markercluster/dist/styles.min.css");
19
19
 
20
- var _LeafletMapContainer = _interopRequireDefault(require("./subComponent/LeafletMapContainer"));
20
+ var _BasicLeafletMap = _interopRequireDefault(require("./subComponent/BasicLeafletMap"));
21
21
 
22
22
  var _LeafletDrawControl = _interopRequireDefault(require("./subComponent/LeafletDrawControl"));
23
23
 
@@ -58,8 +58,7 @@ var LeafletMap = function LeafletMap(_ref) {
58
58
  geoFenceOptions = _ref$geoFenceOptions === void 0 ? {} : _ref$geoFenceOptions,
59
59
  onError = _ref.onError,
60
60
  customPopup = _ref.customPopup,
61
- checkPrimaryLocation = _ref.checkPrimaryLocation,
62
- children = _ref.children;
61
+ checkPrimaryLocation = _ref.checkPrimaryLocation;
63
62
 
64
63
  var _useState = (0, _react.useState)(true),
65
64
  _useState2 = _slicedToArray(_useState, 2),
@@ -192,12 +191,9 @@ var LeafletMap = function LeafletMap(_ref) {
192
191
  }, [geoFenceOptions.editable]);
193
192
 
194
193
  if (!hasError) {
195
- return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_LeafletMapContainer.default, {
194
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_BasicLeafletMap.default, {
196
195
  height: height,
197
- center: [1, 1],
198
196
  zoom: zoom,
199
- scrollWheelZoom: false,
200
- maxBounds: [[-90, -180], [90, 180]],
201
197
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(MapInteractor, {
202
198
  zoom: zoom,
203
199
  locations: validLocations,
@@ -205,13 +201,6 @@ var LeafletMap = function LeafletMap(_ref) {
205
201
  markers: markers,
206
202
  defaultPosition: data.defaultPosition,
207
203
  position: data.position
208
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactLeaflet.TileLayer, {
209
- attribution: "Map data \xA9 <a href=\"https://www.openstreetmap.org/\">OpenStreetMap</a> contributors",
210
- url: "https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",
211
- minZoom: 3,
212
- maxZoom: 20,
213
- noWrap: true,
214
- bounds: [[-90, -180], [90, 180]]
215
204
  }), markers.length > 0 && /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactLeafletMarkercluster.default, {
216
205
  maxClusterRadius: 120,
217
206
  iconCreateFunction: function iconCreateFunction(cluster) {
@@ -241,7 +230,7 @@ var LeafletMap = function LeafletMap(_ref) {
241
230
  fillOpacity: 0.5
242
231
  }
243
232
  })]
244
- }), children]
233
+ })]
245
234
  });
246
235
  }
247
236
 
@@ -13,9 +13,7 @@ var _leaflet = _interopRequireDefault(require("leaflet"));
13
13
 
14
14
  var _reactLeaflet = require("react-leaflet");
15
15
 
16
- var _LeafletMapContainer = _interopRequireDefault(require("../map/subComponent/LeafletMapContainer"));
17
-
18
- var _MapInteractor = _interopRequireDefault(require("./MapInteractor"));
16
+ var _BasicLeafletMap = _interopRequireDefault(require("./subComponent/BasicLeafletMap"));
19
17
 
20
18
  var _MapSearchBoxControl = _interopRequireDefault(require("./subComponent/MapSearchBoxControl"));
21
19
 
@@ -127,23 +125,14 @@ var LeafletReverseGeolocation = function LeafletReverseGeolocation(_ref) {
127
125
  };
128
126
  }();
129
127
 
130
- var Map = /*#__PURE__*/(0, _jsxRuntime.jsxs)(_LeafletMapContainer.default, {
128
+ var Map = /*#__PURE__*/(0, _jsxRuntime.jsxs)(_BasicLeafletMap.default, {
131
129
  height: 500,
132
- center: [1, 1],
133
130
  zoom: 10,
134
131
  scrollWheelZoom: true,
135
- maxBounds: [[-90, -180], [90, 180]],
136
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactLeaflet.TileLayer, {
137
- attribution: "Map data \xA9 <a href=\"https://www.openstreetmap.org/\">OpenStreetMap</a> contributors",
138
- url: "https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",
139
- minZoom: 3,
140
- maxZoom: 20,
141
- noWrap: true,
142
- bounds: [[-90, -180], [90, 180]]
143
- }), markerLatLng.lat && markerLatLng.lng && /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactLeaflet.Marker, {
132
+ children: [markerLatLng.lat && markerLatLng.lng && /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactLeaflet.Marker, {
144
133
  position: [markerLatLng.lat, markerLatLng.lng],
145
134
  icon: Icon
146
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_MapInteractor.default, {
135
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(MapInteractor, {
147
136
  changeLatlng: handleChangeLatlng
148
137
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_MapSearchBoxControl.default, {
149
138
  changeLatlng: handleChangeLatlng,
@@ -156,5 +145,29 @@ var LeafletReverseGeolocation = function LeafletReverseGeolocation(_ref) {
156
145
  });
157
146
  };
158
147
 
148
+ var MapInteractor = function MapInteractor(_ref3) {
149
+ var changeLatlng = _ref3.changeLatlng;
150
+ var map = (0, _reactLeaflet.useMapEvents)({
151
+ click: function click(event) {
152
+ var _event$latlng = event.latlng,
153
+ lat = _event$latlng.lat,
154
+ lng = _event$latlng.lng;
155
+ changeLatlng({
156
+ lat: lat.toString(),
157
+ lng: lng.toString()
158
+ });
159
+ }
160
+ });
161
+ (0, _react.useEffect)(function () {
162
+ var bounds = _leaflet.default.latLngBounds([[90, 180], [-90, -180]]);
163
+
164
+ var wantedZoom = map.getBoundsZoom(bounds, true);
165
+ var center = bounds.getCenter();
166
+ map.setView(center);
167
+ map.setZoom(wantedZoom);
168
+ }, [map]);
169
+ return null;
170
+ };
171
+
159
172
  var _default = LeafletReverseGeolocation;
160
173
  exports.default = _default;
package/map/index.js CHANGED
@@ -9,15 +9,31 @@ Object.defineProperty(exports, "GoogleMap", {
9
9
  return _GoogleMap.default;
10
10
  }
11
11
  });
12
+ Object.defineProperty(exports, "GoogleReverseGeolocation", {
13
+ enumerable: true,
14
+ get: function get() {
15
+ return _GoogleReverseGeolocation.default;
16
+ }
17
+ });
12
18
  Object.defineProperty(exports, "LeafletMap", {
13
19
  enumerable: true,
14
20
  get: function get() {
15
21
  return _LeafletMap.default;
16
22
  }
17
23
  });
24
+ Object.defineProperty(exports, "LeafletReverseGeolocation", {
25
+ enumerable: true,
26
+ get: function get() {
27
+ return _LeafletReverseGeolocation.default;
28
+ }
29
+ });
18
30
 
19
31
  var _LeafletMap = _interopRequireDefault(require("./LeafletMap"));
20
32
 
33
+ var _LeafletReverseGeolocation = _interopRequireDefault(require("./LeafletReverseGeolocation"));
34
+
21
35
  var _GoogleMap = _interopRequireDefault(require("./GoogleMap"));
22
36
 
37
+ var _GoogleReverseGeolocation = _interopRequireDefault(require("./GoogleReverseGeolocation"));
38
+
23
39
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
@@ -0,0 +1,40 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+
8
+ var _LeafletMapContainer = _interopRequireDefault(require("./LeafletMapContainer"));
9
+
10
+ var _reactLeaflet = require("react-leaflet");
11
+
12
+ var _jsxRuntime = require("react/jsx-runtime");
13
+
14
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
15
+
16
+ var BasicLeafletMap = function BasicLeafletMap(_ref) {
17
+ var height = _ref.height,
18
+ zoom = _ref.zoom,
19
+ _ref$scrollWheelZoom = _ref.scrollWheelZoom,
20
+ scrollWheelZoom = _ref$scrollWheelZoom === void 0 ? false : _ref$scrollWheelZoom,
21
+ children = _ref.children;
22
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_LeafletMapContainer.default, {
23
+ height: height,
24
+ center: [1, 1],
25
+ zoom: zoom,
26
+ scrollWheelZoom: scrollWheelZoom,
27
+ maxBounds: [[-90, -180], [90, 180]],
28
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactLeaflet.TileLayer, {
29
+ attribution: "Map data \xA9 <a href=\"https://www.openstreetmap.org/\">OpenStreetMap</a> contributors",
30
+ url: "https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",
31
+ minZoom: 3,
32
+ maxZoom: 20,
33
+ noWrap: true,
34
+ bounds: [[-90, -180], [90, 180]]
35
+ }), children]
36
+ });
37
+ };
38
+
39
+ var _default = BasicLeafletMap;
40
+ exports.default = _default;
@@ -0,0 +1,59 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+
8
+ var _react = require("react");
9
+
10
+ var _reactWrapper = require("@googlemaps/react-wrapper");
11
+
12
+ var _jsxRuntime = require("react/jsx-runtime");
13
+
14
+ var _excluded = ["children", "apiKey", "onError"];
15
+
16
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
17
+
18
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
19
+
20
+ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
21
+
22
+ function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
23
+
24
+ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
25
+
26
+ var GoogleMapWrapper = function GoogleMapWrapper(_ref) {
27
+ var children = _ref.children,
28
+ apiKey = _ref.apiKey,
29
+ onError = _ref.onError,
30
+ props = _objectWithoutProperties(_ref, _excluded);
31
+
32
+ var render = function render(status) {
33
+ switch (status) {
34
+ case _reactWrapper.Status.LOADING:
35
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {});
36
+
37
+ case _reactWrapper.Status.FAILURE:
38
+ onError(status);
39
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {});
40
+
41
+ default:
42
+ break;
43
+ }
44
+ };
45
+
46
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactWrapper.Wrapper, {
47
+ apiKey: apiKey,
48
+ render: render,
49
+ style: {
50
+ position: 'relative'
51
+ },
52
+ children: /*#__PURE__*/(0, _react.cloneElement)(children, _objectSpread(_objectSpread({}, props), {}, {
53
+ onError: onError
54
+ }))
55
+ });
56
+ };
57
+
58
+ var _default = GoogleMapWrapper;
59
+ exports.default = _default;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cashub/ui",
3
- "version": "0.19.8",
3
+ "version": "0.19.11",
4
4
  "private": false,
5
5
  "author": "CASHUB Team",
6
6
  "description": "CASHUB UI components library",
@@ -30,7 +30,7 @@
30
30
  "rc-time-picker": "^3.7.3",
31
31
  "react-chartjs-2": "^3.3.0",
32
32
  "react-datepicker": "^4.8.0",
33
- "react-helmet": "^6.1.0",
33
+ "react-helmet-async": "^2.0.3",
34
34
  "react-leaflet": "^3.1.0",
35
35
  "react-leaflet-markercluster": "^3.0.0-rc1",
36
36
  "react-outside-click-handler": "^1.3.0",
@@ -1,41 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
-
8
- var _react = require("react");
9
-
10
- var _leaflet = _interopRequireDefault(require("leaflet"));
11
-
12
- var _reactLeaflet = require("react-leaflet");
13
-
14
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
15
-
16
- var MapInteractor = function MapInteractor(_ref) {
17
- var changeLatlng = _ref.changeLatlng;
18
- var map = (0, _reactLeaflet.useMapEvents)({
19
- click: function click(event) {
20
- var _event$latlng = event.latlng,
21
- lat = _event$latlng.lat,
22
- lng = _event$latlng.lng;
23
- changeLatlng({
24
- lat: lat.toString(),
25
- lng: lng.toString()
26
- });
27
- }
28
- });
29
- (0, _react.useEffect)(function () {
30
- var bounds = _leaflet.default.latLngBounds([[90, 180], [-90, -180]]);
31
-
32
- var wantedZoom = map.getBoundsZoom(bounds, true);
33
- var center = bounds.getCenter();
34
- map.setView(center);
35
- map.setZoom(wantedZoom);
36
- }, [map]);
37
- return null;
38
- };
39
-
40
- var _default = MapInteractor;
41
- exports.default = _default;
@@ -1,23 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- Object.defineProperty(exports, "GoogleReverseGeolocation", {
7
- enumerable: true,
8
- get: function get() {
9
- return _GoogleReverseGeolocation.default;
10
- }
11
- });
12
- Object.defineProperty(exports, "LeafletReverseGeolocation", {
13
- enumerable: true,
14
- get: function get() {
15
- return _LeafletReverseGeolocation.default;
16
- }
17
- });
18
-
19
- var _LeafletReverseGeolocation = _interopRequireDefault(require("./LeafletReverseGeolocation"));
20
-
21
- var _GoogleReverseGeolocation = _interopRequireDefault(require("./GoogleReverseGeolocation"));
22
-
23
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }