@popsure/dirty-swan 0.54.13 → 0.54.14

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/cjs/index.js CHANGED
@@ -5043,19 +5043,19 @@ var loadGoogleMapsApiDynamically = function (callback, apiKey) {
5043
5043
  };
5044
5044
  var AutocompleteAddress = function (_a) {
5045
5045
  var _b;
5046
- var apiKey = _a.apiKey, initialAddress = _a.address, onAddressChange = _a.onAddressChange, placeholders = _a.placeholders, manualAddressEntryTexts = _a.manualAddressEntryTexts, inputProps = _a.inputProps;
5047
- var _c = require$$0.useState(false), manualAddressEntry = _c[0], setManualAddressEntry = _c[1];
5048
- var _d = require$$0.useState(false), isLoading = _d[0], setIsLoading = _d[1];
5046
+ var apiKey = _a.apiKey, initialAddress = _a.address, onAddressChange = _a.onAddressChange, placeholders = _a.placeholders, manualAddressEntryTexts = _a.manualAddressEntryTexts, inputProps = _a.inputProps, _c = _a.countryCode, countryCode = _c === void 0 ? GERMANY_ALPHA_CODE : _c;
5047
+ var _d = require$$0.useState(false), manualAddressEntry = _d[0], setManualAddressEntry = _d[1];
5048
+ var _e = require$$0.useState(false), isLoading = _e[0], setIsLoading = _e[1];
5049
5049
  var autocomplete = require$$0.useRef(null);
5050
5050
  var autocompleteElement = require$$0.useRef(null);
5051
5051
  var map = require$$0.useRef(null);
5052
5052
  var marker = require$$0.useRef(null);
5053
- var _e = require$$0.useState(initialAddress), address = _e[0], setAddress = _e[1];
5054
- var _f = require$$0.useState(window.google !== undefined), hasLoadedGoogleAPI = _f[0], setHasLoadedGoogleAPI = _f[1];
5053
+ var _f = require$$0.useState(initialAddress), address = _f[0], setAddress = _f[1];
5054
+ var _g = require$$0.useState(window.google !== undefined), hasLoadedGoogleAPI = _g[0], setHasLoadedGoogleAPI = _g[1];
5055
5055
  loadGoogleMapsApiDynamically(function () {
5056
5056
  setHasLoadedGoogleAPI(true);
5057
5057
  }, apiKey);
5058
- var _g = require$$0.useState(null), place = _g[0], setPlace = _g[1];
5058
+ var _h = require$$0.useState(null), place = _h[0], setPlace = _h[1];
5059
5059
  require$$0.useEffect(function () {
5060
5060
  if (address) {
5061
5061
  if (autocompleteElement.current && address.street) {
@@ -5071,7 +5071,7 @@ var AutocompleteAddress = function (_a) {
5071
5071
  var reference = document.getElementById('autocomplete');
5072
5072
  autocomplete.current = new google.maps.places.Autocomplete(reference, {
5073
5073
  types: ['address'],
5074
- componentRestrictions: { country: GERMANY_ALPHA_CODE },
5074
+ componentRestrictions: { country: countryCode },
5075
5075
  });
5076
5076
  autocomplete.current.addListener('place_changed', onPlaceChanged);
5077
5077
  map.current = new google.maps.Map(document.getElementById('map'), MAP_CONFIG_OBJ);
@@ -5135,7 +5135,7 @@ var AutocompleteAddress = function (_a) {
5135
5135
  var _b = _a === void 0 ? { updatePlace: true } : _a, updatePlace = _b.updatePlace;
5136
5136
  return function (e) {
5137
5137
  var _a;
5138
- var newAddress = __assign(__assign({}, address), (_a = {}, _a[e.target.name] = e.target.value, _a.country = GERMANY_ALPHA_CODE, _a));
5138
+ var newAddress = __assign(__assign({}, address), (_a = {}, _a[e.target.name] = e.target.value, _a.country = countryCode, _a));
5139
5139
  setAddress(newAddress);
5140
5140
  onAddressChange(newAddress);
5141
5141
  if (updatePlace) {