authscape 1.0.142 → 1.0.143
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 +14 -9
- package/package.json +1 -1
- package/src/components/GoogleMapsAutoComplete.js +12 -8
package/index.js
CHANGED
|
@@ -988,7 +988,6 @@ var AutoCompleteDialog = function AutoCompleteDialog(_ref) {
|
|
|
988
988
|
sx: {
|
|
989
989
|
position: "absolute",
|
|
990
990
|
zIndex: 9999,
|
|
991
|
-
top: 125,
|
|
992
991
|
backgroundColor: "white",
|
|
993
992
|
border: "1px solid black"
|
|
994
993
|
}
|
|
@@ -997,20 +996,28 @@ var AutoCompleteDialog = function AutoCompleteDialog(_ref) {
|
|
|
997
996
|
var GooglePlacesModal = function GooglePlacesModal(_ref3) {
|
|
998
997
|
var onSave = _ref3.onSave,
|
|
999
998
|
_ref3$createButtonTex = _ref3.createButtonText,
|
|
1000
|
-
createButtonText = _ref3$createButtonTex === void 0 ? "Save" : _ref3$createButtonTex
|
|
1001
|
-
|
|
999
|
+
createButtonText = _ref3$createButtonTex === void 0 ? "Save" : _ref3$createButtonTex,
|
|
1000
|
+
_ref3$_address = _ref3._address,
|
|
1001
|
+
_address = _ref3$_address === void 0 ? "" : _ref3$_address,
|
|
1002
|
+
_ref3$_city = _ref3._city,
|
|
1003
|
+
_city = _ref3$_city === void 0 ? "" : _ref3$_city,
|
|
1004
|
+
_ref3$_state = _ref3._state,
|
|
1005
|
+
_state = _ref3$_state === void 0 ? "" : _ref3$_state,
|
|
1006
|
+
_ref3$_postalCode = _ref3._postalCode,
|
|
1007
|
+
_postalCode = _ref3$_postalCode === void 0 ? "" : _ref3$_postalCode;
|
|
1008
|
+
var _useState = (0, _react.useState)(_address),
|
|
1002
1009
|
_useState2 = _slicedToArray(_useState, 2),
|
|
1003
1010
|
address = _useState2[0],
|
|
1004
1011
|
setAddress = _useState2[1];
|
|
1005
|
-
var _useState3 = (0, _react.useState)(
|
|
1012
|
+
var _useState3 = (0, _react.useState)(_city),
|
|
1006
1013
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
1007
1014
|
city = _useState4[0],
|
|
1008
1015
|
setCity = _useState4[1];
|
|
1009
|
-
var _useState5 = (0, _react.useState)(
|
|
1016
|
+
var _useState5 = (0, _react.useState)(_state),
|
|
1010
1017
|
_useState6 = _slicedToArray(_useState5, 2),
|
|
1011
1018
|
state = _useState6[0],
|
|
1012
1019
|
setState = _useState6[1];
|
|
1013
|
-
var _useState7 = (0, _react.useState)(
|
|
1020
|
+
var _useState7 = (0, _react.useState)(_postalCode),
|
|
1014
1021
|
_useState8 = _slicedToArray(_useState7, 2),
|
|
1015
1022
|
zip = _useState8[0],
|
|
1016
1023
|
setPostalcode = _useState8[1];
|
|
@@ -1101,9 +1108,7 @@ var GooglePlacesModal = function GooglePlacesModal(_ref3) {
|
|
|
1101
1108
|
}
|
|
1102
1109
|
onSave(address, city, state, zip, lat, lng);
|
|
1103
1110
|
}
|
|
1104
|
-
}, createButtonText)))
|
|
1105
|
-
src: "https://maps.googleapis.com/maps/api/js?key=" + process.env.googleMapsKey + "&libraries=places"
|
|
1106
|
-
}));
|
|
1111
|
+
}, createButtonText))));
|
|
1107
1112
|
};
|
|
1108
1113
|
exports.GooglePlacesModal = GooglePlacesModal;
|
|
1109
1114
|
"use strict";
|
package/package.json
CHANGED
|
@@ -325,7 +325,7 @@ const AutoCompleteDialog = ({placeholder, onSelected, defaultValue, onChange}) =
|
|
|
325
325
|
<TextField ref={txtAddressField} autoFocus={true} autoComplete="new-password" label={placeholder} variant="outlined" fullWidth={true} value={value} onChange={handleInput} />
|
|
326
326
|
|
|
327
327
|
{status == "OK" &&
|
|
328
|
-
<MenuList ref={ref} sx={{position:"absolute", zIndex:9999,
|
|
328
|
+
<MenuList ref={ref} sx={{position:"absolute", zIndex:9999, backgroundColor:"white", border:"1px solid black"}}>
|
|
329
329
|
{renderSuggestions()}
|
|
330
330
|
</MenuList>
|
|
331
331
|
}
|
|
@@ -335,12 +335,18 @@ const AutoCompleteDialog = ({placeholder, onSelected, defaultValue, onChange}) =
|
|
|
335
335
|
|
|
336
336
|
export const GooglePlacesModal = ({
|
|
337
337
|
onSave,
|
|
338
|
-
createButtonText = "Save"
|
|
338
|
+
createButtonText = "Save",
|
|
339
|
+
|
|
340
|
+
_address = "",
|
|
341
|
+
_city = "",
|
|
342
|
+
_state = "",
|
|
343
|
+
_postalCode = ""
|
|
339
344
|
}) => {
|
|
340
|
-
const [address, setAddress] = useState(
|
|
341
|
-
const [city, setCity] = useState(
|
|
342
|
-
const [state, setState] = useState(
|
|
343
|
-
const [zip, setPostalcode] = useState(
|
|
345
|
+
const [address, setAddress] = useState(_address);
|
|
346
|
+
const [city, setCity] = useState(_city);
|
|
347
|
+
const [state, setState] = useState(_state);
|
|
348
|
+
const [zip, setPostalcode] = useState(_postalCode);
|
|
349
|
+
|
|
344
350
|
const [lat, setLat] = useState(null);
|
|
345
351
|
const [lng, setLng] = useState(null);
|
|
346
352
|
|
|
@@ -428,8 +434,6 @@ export const GooglePlacesModal = ({
|
|
|
428
434
|
</Button>
|
|
429
435
|
</Box>
|
|
430
436
|
</Box>
|
|
431
|
-
|
|
432
|
-
<Script src={"https://maps.googleapis.com/maps/api/js?key=" + process.env.googleMapsKey + "&libraries=places"}></Script>
|
|
433
437
|
</>
|
|
434
438
|
);
|
|
435
439
|
}
|