authscape 1.0.141 → 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 +18 -12
- package/package.json +1 -1
- package/src/components/GoogleMapsAutoComplete.js +14 -10
package/index.js
CHANGED
|
@@ -717,7 +717,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
717
717
|
Object.defineProperty(exports, "__esModule", {
|
|
718
718
|
value: true
|
|
719
719
|
});
|
|
720
|
-
exports
|
|
720
|
+
exports.GooglePlacesModal = void 0;
|
|
721
721
|
var _react = _interopRequireWildcard(require("react"));
|
|
722
722
|
var _Button = _interopRequireDefault(require("@mui/material/Button"));
|
|
723
723
|
var _system = require("@mui/system");
|
|
@@ -988,29 +988,36 @@ 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
|
}
|
|
995
994
|
}, renderSuggestions()));
|
|
996
995
|
};
|
|
997
|
-
function GooglePlacesModal(_ref3) {
|
|
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,10 +1108,9 @@ function GooglePlacesModal(_ref3) {
|
|
|
1101
1108
|
}
|
|
1102
1109
|
onSave(address, city, state, zip, lat, lng);
|
|
1103
1110
|
}
|
|
1104
|
-
}, createButtonText)))
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
}
|
|
1111
|
+
}, createButtonText))));
|
|
1112
|
+
};
|
|
1113
|
+
exports.GooglePlacesModal = GooglePlacesModal;
|
|
1108
1114
|
"use strict";
|
|
1109
1115
|
|
|
1110
1116
|
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
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
|
}
|
|
@@ -333,14 +333,20 @@ const AutoCompleteDialog = ({placeholder, onSelected, defaultValue, onChange}) =
|
|
|
333
333
|
);
|
|
334
334
|
};
|
|
335
335
|
|
|
336
|
-
export
|
|
336
|
+
export const GooglePlacesModal = ({
|
|
337
337
|
onSave,
|
|
338
|
-
createButtonText = "Save"
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
338
|
+
createButtonText = "Save",
|
|
339
|
+
|
|
340
|
+
_address = "",
|
|
341
|
+
_city = "",
|
|
342
|
+
_state = "",
|
|
343
|
+
_postalCode = ""
|
|
344
|
+
}) => {
|
|
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 default function 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
|
}
|