mozrest-sdk-react-dev 0.1.4 → 0.1.6
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/mozrest-sdk.es.js +14 -15
- package/package.json +1 -1
package/mozrest-sdk.es.js
CHANGED
|
@@ -42358,27 +42358,27 @@ const StaticMap = ({
|
|
|
42358
42358
|
size: "400x200",
|
|
42359
42359
|
apiKey: config$1.maps_key
|
|
42360
42360
|
}, /* @__PURE__ */ React__default.createElement(Marker$1, {
|
|
42361
|
-
location:
|
|
42361
|
+
location: { lat: latitude, lng: longitude },
|
|
42362
42362
|
color: "red"
|
|
42363
42363
|
}));
|
|
42364
42364
|
const formatAddres = (data2) => {
|
|
42365
|
-
let
|
|
42365
|
+
let address = "";
|
|
42366
42366
|
if (data2.address) {
|
|
42367
|
-
|
|
42367
|
+
address += data2.address;
|
|
42368
42368
|
}
|
|
42369
42369
|
if (data2.city) {
|
|
42370
|
-
|
|
42370
|
+
address += ", " + data2.city;
|
|
42371
42371
|
}
|
|
42372
42372
|
if (data2.postalCode) {
|
|
42373
|
-
|
|
42373
|
+
address += ", " + data2.postalCode;
|
|
42374
42374
|
}
|
|
42375
42375
|
if (data2.country) {
|
|
42376
|
-
|
|
42376
|
+
address += ", " + data2.country.label;
|
|
42377
42377
|
}
|
|
42378
42378
|
if (data2.addressComplement) {
|
|
42379
|
-
|
|
42379
|
+
address += ` (${data2.addressComplement})`;
|
|
42380
42380
|
}
|
|
42381
|
-
return
|
|
42381
|
+
return address;
|
|
42382
42382
|
};
|
|
42383
42383
|
const CardLocation = ({
|
|
42384
42384
|
onClickEdit,
|
|
@@ -47704,12 +47704,7 @@ const MapContainer = ({ google: google2, position: position2, onChangePosition }
|
|
|
47704
47704
|
const [center, setCenter] = useState(position2 || defaultPosition);
|
|
47705
47705
|
const [currentPosition, setCurrentPosition] = useState(position2 || defaultPosition);
|
|
47706
47706
|
const getInitialCenter = () => {
|
|
47707
|
-
|
|
47708
|
-
return;
|
|
47709
|
-
}
|
|
47710
|
-
navigator == null ? void 0 : navigator.geolocation.getCurrentPosition(({ coords: { latitude: lat, longitude: lng } }) => {
|
|
47711
|
-
setCenter({ lat, lng });
|
|
47712
|
-
});
|
|
47707
|
+
onChangePosition(position2);
|
|
47713
47708
|
};
|
|
47714
47709
|
const onSelectPosition = (value2) => {
|
|
47715
47710
|
setCurrentPosition(value2);
|
|
@@ -47815,11 +47810,15 @@ const AddressAutoComplete = () => {
|
|
|
47815
47810
|
const { t: t2 } = useTranslation();
|
|
47816
47811
|
const [suggestions, setSuggestions] = useState([]);
|
|
47817
47812
|
const { setFieldValue } = useFormikContext();
|
|
47813
|
+
useState();
|
|
47818
47814
|
const ref = useRef(null);
|
|
47819
47815
|
const clearSuggestions = () => setSuggestions([]);
|
|
47820
47816
|
useOutsideClick(ref, clearSuggestions);
|
|
47821
47817
|
const handelChandeAddress = async (e3) => {
|
|
47822
|
-
|
|
47818
|
+
var _a2;
|
|
47819
|
+
e3.persist();
|
|
47820
|
+
console.log("textAddr", e3.target);
|
|
47821
|
+
const textAddr = (_a2 = e3.target) == null ? void 0 : _a2.value;
|
|
47823
47822
|
setFieldValue("address", textAddr);
|
|
47824
47823
|
if (textAddr.length < 5) {
|
|
47825
47824
|
return;
|