authscape 1.0.143 → 1.0.144
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/index.js +7 -27
- package/package.json +1 -1
- package/src/components/GoogleMapsAutoComplete.js +9 -6
package/index.js
CHANGED
|
@@ -977,7 +977,7 @@ var AutoCompleteDialog = function AutoCompleteDialog(_ref) {
|
|
|
977
977
|
return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement(_TextField["default"], {
|
|
978
978
|
ref: txtAddressField,
|
|
979
979
|
autoFocus: true,
|
|
980
|
-
|
|
980
|
+
name: "address",
|
|
981
981
|
label: placeholder,
|
|
982
982
|
variant: "outlined",
|
|
983
983
|
fullWidth: true,
|
|
@@ -994,9 +994,7 @@ var AutoCompleteDialog = function AutoCompleteDialog(_ref) {
|
|
|
994
994
|
}, renderSuggestions()));
|
|
995
995
|
};
|
|
996
996
|
var GooglePlacesModal = function GooglePlacesModal(_ref3) {
|
|
997
|
-
var
|
|
998
|
-
_ref3$createButtonTex = _ref3.createButtonText,
|
|
999
|
-
createButtonText = _ref3$createButtonTex === void 0 ? "Save" : _ref3$createButtonTex,
|
|
997
|
+
var onAddressSelected = _ref3.onAddressSelected,
|
|
1000
998
|
_ref3$_address = _ref3._address,
|
|
1001
999
|
_address = _ref3$_address === void 0 ? "" : _ref3$_address,
|
|
1002
1000
|
_ref3$_city = _ref3._city,
|
|
@@ -1039,6 +1037,7 @@ var GooglePlacesModal = function GooglePlacesModal(_ref3) {
|
|
|
1039
1037
|
setPostalcode(data.postalCode);
|
|
1040
1038
|
setLat(data.lat);
|
|
1041
1039
|
setLng(data["long"]);
|
|
1040
|
+
onAddressSelected(data.address, data.city, data.state, data.postalCode, data.lat, data["long"]);
|
|
1042
1041
|
},
|
|
1043
1042
|
onChange: function onChange(address) {
|
|
1044
1043
|
setAddress(address);
|
|
@@ -1055,6 +1054,7 @@ var GooglePlacesModal = function GooglePlacesModal(_ref3) {
|
|
|
1055
1054
|
}, /*#__PURE__*/_react["default"].createElement(_system.Box, null, /*#__PURE__*/_react["default"].createElement(_TextField["default"], {
|
|
1056
1055
|
id: "outlined-basic",
|
|
1057
1056
|
label: "City",
|
|
1057
|
+
name: "city",
|
|
1058
1058
|
variant: "outlined",
|
|
1059
1059
|
fullWidth: true,
|
|
1060
1060
|
value: city,
|
|
@@ -1067,6 +1067,7 @@ var GooglePlacesModal = function GooglePlacesModal(_ref3) {
|
|
|
1067
1067
|
}, /*#__PURE__*/_react["default"].createElement(_system.Box, null, /*#__PURE__*/_react["default"].createElement(_TextField["default"], {
|
|
1068
1068
|
id: "outlined-basic",
|
|
1069
1069
|
label: "State",
|
|
1070
|
+
name: "state",
|
|
1070
1071
|
variant: "outlined",
|
|
1071
1072
|
fullWidth: true,
|
|
1072
1073
|
value: state,
|
|
@@ -1080,35 +1081,14 @@ var GooglePlacesModal = function GooglePlacesModal(_ref3) {
|
|
|
1080
1081
|
}, /*#__PURE__*/_react["default"].createElement(_TextField["default"], {
|
|
1081
1082
|
id: "outlined-basic",
|
|
1082
1083
|
label: "Postal code",
|
|
1084
|
+
name: "postalCode",
|
|
1083
1085
|
variant: "outlined",
|
|
1084
1086
|
fullWidth: true,
|
|
1085
1087
|
value: zip,
|
|
1086
1088
|
onChange: function onChange(val) {
|
|
1087
1089
|
setPostalcode(val.currentTarget.value);
|
|
1088
1090
|
}
|
|
1089
|
-
}))
|
|
1090
|
-
sx: {
|
|
1091
|
-
marginTop: 1,
|
|
1092
|
-
textAlign: "right"
|
|
1093
|
-
}
|
|
1094
|
-
}, /*#__PURE__*/_react["default"].createElement(_Button["default"], {
|
|
1095
|
-
variant: "contained",
|
|
1096
|
-
onClick: function onClick() {
|
|
1097
|
-
if (lat == null || lng == null) {
|
|
1098
|
-
var addressInfo = address + " " + city + " " + state + " " + zip;
|
|
1099
|
-
(0, _usePlacesAutocomplete.getGeocode)({
|
|
1100
|
-
address: addressInfo
|
|
1101
|
-
}).then(function (results) {
|
|
1102
|
-
var _getLatLng = (0, _usePlacesAutocomplete.getLatLng)(results[0]),
|
|
1103
|
-
lat = _getLatLng.lat,
|
|
1104
|
-
lng = _getLatLng.lng;
|
|
1105
|
-
setLat(lat);
|
|
1106
|
-
setLng(lng);
|
|
1107
|
-
});
|
|
1108
|
-
}
|
|
1109
|
-
onSave(address, city, state, zip, lat, lng);
|
|
1110
|
-
}
|
|
1111
|
-
}, createButtonText))));
|
|
1091
|
+
}))));
|
|
1112
1092
|
};
|
|
1113
1093
|
exports.GooglePlacesModal = GooglePlacesModal;
|
|
1114
1094
|
"use strict";
|
package/package.json
CHANGED
|
@@ -322,7 +322,7 @@ const AutoCompleteDialog = ({placeholder, onSelected, defaultValue, onChange}) =
|
|
|
322
322
|
|
|
323
323
|
return (
|
|
324
324
|
<>
|
|
325
|
-
<TextField ref={txtAddressField} autoFocus={true}
|
|
325
|
+
<TextField ref={txtAddressField} autoFocus={true} name="address" label={placeholder} variant="outlined" fullWidth={true} value={value} onChange={handleInput} />
|
|
326
326
|
|
|
327
327
|
{status == "OK" &&
|
|
328
328
|
<MenuList ref={ref} sx={{position:"absolute", zIndex:9999, backgroundColor:"white", border:"1px solid black"}}>
|
|
@@ -334,9 +334,7 @@ const AutoCompleteDialog = ({placeholder, onSelected, defaultValue, onChange}) =
|
|
|
334
334
|
};
|
|
335
335
|
|
|
336
336
|
export const GooglePlacesModal = ({
|
|
337
|
-
|
|
338
|
-
createButtonText = "Save",
|
|
339
|
-
|
|
337
|
+
onAddressSelected,
|
|
340
338
|
_address = "",
|
|
341
339
|
_city = "",
|
|
342
340
|
_state = "",
|
|
@@ -363,6 +361,8 @@ export const GooglePlacesModal = ({
|
|
|
363
361
|
setPostalcode(data.postalCode);
|
|
364
362
|
setLat(data.lat);
|
|
365
363
|
setLng(data.long);
|
|
364
|
+
|
|
365
|
+
onAddressSelected(data.address, data.city, data.state, data.postalCode, data.lat, data.long);
|
|
366
366
|
}}
|
|
367
367
|
onChange={(address) => {
|
|
368
368
|
setAddress(address);
|
|
@@ -375,6 +375,7 @@ export const GooglePlacesModal = ({
|
|
|
375
375
|
<TextField
|
|
376
376
|
id="outlined-basic"
|
|
377
377
|
label="City"
|
|
378
|
+
name="city"
|
|
378
379
|
variant="outlined"
|
|
379
380
|
fullWidth={true}
|
|
380
381
|
value={city}
|
|
@@ -390,6 +391,7 @@ export const GooglePlacesModal = ({
|
|
|
390
391
|
<TextField
|
|
391
392
|
id="outlined-basic"
|
|
392
393
|
label="State"
|
|
394
|
+
name="state"
|
|
393
395
|
variant="outlined"
|
|
394
396
|
fullWidth={true}
|
|
395
397
|
value={state}
|
|
@@ -405,6 +407,7 @@ export const GooglePlacesModal = ({
|
|
|
405
407
|
<TextField
|
|
406
408
|
id="outlined-basic"
|
|
407
409
|
label="Postal code"
|
|
410
|
+
name="postalCode"
|
|
408
411
|
variant="outlined"
|
|
409
412
|
fullWidth={true}
|
|
410
413
|
value={zip}
|
|
@@ -414,7 +417,7 @@ export const GooglePlacesModal = ({
|
|
|
414
417
|
/>
|
|
415
418
|
</Box>
|
|
416
419
|
|
|
417
|
-
<Box sx={{ marginTop: 1, textAlign: "right" }}>
|
|
420
|
+
{/* <Box sx={{ marginTop: 1, textAlign: "right" }}>
|
|
418
421
|
<Button
|
|
419
422
|
variant="contained"
|
|
420
423
|
onClick={() => {
|
|
@@ -432,7 +435,7 @@ export const GooglePlacesModal = ({
|
|
|
432
435
|
}}>
|
|
433
436
|
{createButtonText}
|
|
434
437
|
</Button>
|
|
435
|
-
</Box>
|
|
438
|
+
</Box> */}
|
|
436
439
|
</Box>
|
|
437
440
|
</>
|
|
438
441
|
);
|