authscape 1.0.148 → 1.0.149
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 +16 -63
- package/package.json +2 -1
- package/src/components/GoogleMapsAutoComplete.js +12 -71
package/index.js
CHANGED
|
@@ -729,7 +729,6 @@ var _ListItemIcon = _interopRequireDefault(require("@mui/material/ListItemIcon")
|
|
|
729
729
|
var _LocationOnRounded = _interopRequireDefault(require("@mui/icons-material/LocationOnRounded"));
|
|
730
730
|
var _ListItemText = _interopRequireDefault(require("@mui/material/ListItemText"));
|
|
731
731
|
var _reactCoolOnclickoutside = _interopRequireDefault(require("react-cool-onclickoutside"));
|
|
732
|
-
var _reactHookForm = require("react-hook-form");
|
|
733
732
|
var _Stack = _interopRequireDefault(require("@mui/material/Stack"));
|
|
734
733
|
var _usePlacesAutocomplete = _interopRequireWildcard(require("use-places-autocomplete"));
|
|
735
734
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
@@ -991,7 +990,7 @@ var AutoCompleteDialog = function AutoCompleteDialog(_ref) {
|
|
|
991
990
|
sx: {
|
|
992
991
|
color: "red"
|
|
993
992
|
}
|
|
994
|
-
}, "Address is required.")), react_hook_form_Control != null && /*#__PURE__*/_react["default"].createElement(
|
|
993
|
+
}, "Address is required.")), react_hook_form_Control != null && /*#__PURE__*/_react["default"].createElement(Controller, {
|
|
995
994
|
control: react_hook_form_Control,
|
|
996
995
|
rules: {
|
|
997
996
|
required: true
|
|
@@ -1034,11 +1033,7 @@ var GooglePlacesModal = function GooglePlacesModal(_ref4) {
|
|
|
1034
1033
|
_ref4$_state = _ref4._state,
|
|
1035
1034
|
_state = _ref4$_state === void 0 ? "" : _ref4$_state,
|
|
1036
1035
|
_ref4$_postalCode = _ref4._postalCode,
|
|
1037
|
-
_postalCode = _ref4$_postalCode === void 0 ? "" : _ref4$_postalCode
|
|
1038
|
-
_ref4$react_hook_form = _ref4.react_hook_form_Control,
|
|
1039
|
-
react_hook_form_Control = _ref4$react_hook_form === void 0 ? null : _ref4$react_hook_form,
|
|
1040
|
-
_ref4$react_hook_form2 = _ref4.react_hook_form_errors,
|
|
1041
|
-
react_hook_form_errors = _ref4$react_hook_form2 === void 0 ? null : _ref4$react_hook_form2;
|
|
1036
|
+
_postalCode = _ref4$_postalCode === void 0 ? "" : _ref4$_postalCode;
|
|
1042
1037
|
var _useState = (0, _react.useState)(_address),
|
|
1043
1038
|
_useState2 = _slicedToArray(_useState, 2),
|
|
1044
1039
|
address = _useState2[0],
|
|
@@ -1065,7 +1060,6 @@ var GooglePlacesModal = function GooglePlacesModal(_ref4) {
|
|
|
1065
1060
|
setLng = _useState12[1];
|
|
1066
1061
|
return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement(_system.Box, null, /*#__PURE__*/_react["default"].createElement(AutoCompleteDialog, {
|
|
1067
1062
|
placeholder: "Address",
|
|
1068
|
-
react_hook_form_Control: react_hook_form_Control,
|
|
1069
1063
|
defaultValue: address,
|
|
1070
1064
|
onSelected: function onSelected(data) {
|
|
1071
1065
|
setAddress(data.address);
|
|
@@ -1088,79 +1082,35 @@ var GooglePlacesModal = function GooglePlacesModal(_ref4) {
|
|
|
1088
1082
|
}, /*#__PURE__*/_react["default"].createElement(_Grid["default"], {
|
|
1089
1083
|
item: true,
|
|
1090
1084
|
xs: 6
|
|
1091
|
-
}, /*#__PURE__*/_react["default"].createElement(_system.Box, null,
|
|
1085
|
+
}, /*#__PURE__*/_react["default"].createElement(_system.Box, null, /*#__PURE__*/_react["default"].createElement(_TextField["default"], {
|
|
1092
1086
|
id: "outlined-basic",
|
|
1093
1087
|
label: "City",
|
|
1094
1088
|
name: "city",
|
|
1095
1089
|
variant: "outlined",
|
|
1096
1090
|
fullWidth: true,
|
|
1097
1091
|
value: city,
|
|
1092
|
+
InputProps: {
|
|
1093
|
+
readOnly: true
|
|
1094
|
+
},
|
|
1098
1095
|
onChange: function onChange(val) {
|
|
1099
1096
|
setCity(val.currentTarget.value);
|
|
1100
1097
|
}
|
|
1101
|
-
}), react_hook_form_Control != null && /*#__PURE__*/_react["default"].createElement(_reactHookForm.Controller, {
|
|
1102
|
-
control: react_hook_form_Control,
|
|
1103
|
-
rules: {
|
|
1104
|
-
required: true
|
|
1105
|
-
},
|
|
1106
|
-
name: "city",
|
|
1107
|
-
render: function render(_ref5) {
|
|
1108
|
-
var field = _ref5.field;
|
|
1109
|
-
return /*#__PURE__*/_react["default"].createElement(_Stack["default"], null, /*#__PURE__*/_react["default"].createElement(_TextField["default"], _extends({
|
|
1110
|
-
id: "outlined-basic",
|
|
1111
|
-
label: "City",
|
|
1112
|
-
name: "city",
|
|
1113
|
-
variant: "outlined"
|
|
1114
|
-
}, field, {
|
|
1115
|
-
fullWidth: true,
|
|
1116
|
-
value: city,
|
|
1117
|
-
onChange: function onChange(val) {
|
|
1118
|
-
setCity(val.currentTarget.value);
|
|
1119
|
-
}
|
|
1120
|
-
})), react_hook_form_errors != null && react_hook_form_errors.city && react_hook_form_errors.city.type === 'required' && /*#__PURE__*/_react["default"].createElement(Typography, {
|
|
1121
|
-
sx: {
|
|
1122
|
-
color: "red"
|
|
1123
|
-
}
|
|
1124
|
-
}, "City is required."));
|
|
1125
|
-
}
|
|
1126
1098
|
}))), /*#__PURE__*/_react["default"].createElement(_Grid["default"], {
|
|
1127
1099
|
item: true,
|
|
1128
1100
|
xs: 6
|
|
1129
|
-
}, /*#__PURE__*/_react["default"].createElement(_system.Box, null,
|
|
1101
|
+
}, /*#__PURE__*/_react["default"].createElement(_system.Box, null, /*#__PURE__*/_react["default"].createElement(_TextField["default"], {
|
|
1130
1102
|
id: "outlined-basic",
|
|
1131
1103
|
label: "State",
|
|
1132
1104
|
name: "state",
|
|
1133
1105
|
variant: "outlined",
|
|
1134
1106
|
fullWidth: true,
|
|
1107
|
+
InputProps: {
|
|
1108
|
+
readOnly: true
|
|
1109
|
+
},
|
|
1135
1110
|
value: state,
|
|
1136
1111
|
onChange: function onChange(val) {
|
|
1137
1112
|
setState(val.currentTarget.value);
|
|
1138
1113
|
}
|
|
1139
|
-
}), react_hook_form_Control != null && /*#__PURE__*/_react["default"].createElement(_reactHookForm.Controller, {
|
|
1140
|
-
control: react_hook_form_Control,
|
|
1141
|
-
rules: {
|
|
1142
|
-
required: true
|
|
1143
|
-
},
|
|
1144
|
-
name: "state",
|
|
1145
|
-
render: function render(_ref6) {
|
|
1146
|
-
var field = _ref6.field;
|
|
1147
|
-
return /*#__PURE__*/_react["default"].createElement(_Stack["default"], null, /*#__PURE__*/_react["default"].createElement(_TextField["default"], _extends({
|
|
1148
|
-
id: "outlined-basic",
|
|
1149
|
-
label: "State"
|
|
1150
|
-
}, field, {
|
|
1151
|
-
name: "state",
|
|
1152
|
-
variant: "outlined",
|
|
1153
|
-
fullWidth: true,
|
|
1154
|
-
value: state,
|
|
1155
|
-
onChange: function onChange(val) {
|
|
1156
|
-
setState(val.currentTarget.value);
|
|
1157
|
-
}
|
|
1158
|
-
})), react_hook_form_errors != null && react_hook_form_errors.state && react_hook_form_errors.state.type === 'required' && /*#__PURE__*/_react["default"].createElement(Typography, {
|
|
1159
|
-
sx: {
|
|
1160
|
-
color: "red"
|
|
1161
|
-
}
|
|
1162
|
-
}, "State is required."));
|
|
1163
|
-
}
|
|
1164
1114
|
})))), /*#__PURE__*/_react["default"].createElement(_system.Box, {
|
|
1165
1115
|
sx: {
|
|
1166
1116
|
marginTop: 2
|
|
@@ -1172,17 +1122,20 @@ var GooglePlacesModal = function GooglePlacesModal(_ref4) {
|
|
|
1172
1122
|
variant: "outlined",
|
|
1173
1123
|
fullWidth: true,
|
|
1174
1124
|
value: zip,
|
|
1125
|
+
InputProps: {
|
|
1126
|
+
readOnly: true
|
|
1127
|
+
},
|
|
1175
1128
|
onChange: function onChange(val) {
|
|
1176
1129
|
setPostalcode(val.currentTarget.value);
|
|
1177
1130
|
}
|
|
1178
|
-
}), react_hook_form_Control != null && /*#__PURE__*/_react["default"].createElement(
|
|
1131
|
+
}), react_hook_form_Control != null && /*#__PURE__*/_react["default"].createElement(Controller, {
|
|
1179
1132
|
control: react_hook_form_Control,
|
|
1180
1133
|
rules: {
|
|
1181
1134
|
required: true
|
|
1182
1135
|
},
|
|
1183
1136
|
name: "postalCode",
|
|
1184
|
-
render: function render(
|
|
1185
|
-
var field =
|
|
1137
|
+
render: function render(_ref5) {
|
|
1138
|
+
var field = _ref5.field;
|
|
1186
1139
|
return /*#__PURE__*/_react["default"].createElement(_Stack["default"], null, /*#__PURE__*/_react["default"].createElement(_TextField["default"], _extends({
|
|
1187
1140
|
id: "outlined-basic",
|
|
1188
1141
|
label: "Postal code"
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "authscape",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.149",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -40,6 +40,7 @@
|
|
|
40
40
|
"query-string": "^7.1.1",
|
|
41
41
|
"react-cool-onclickoutside": "^1.7.0",
|
|
42
42
|
"react-data-table-component": "^7.5.2",
|
|
43
|
+
"react-hook-form": "^7.44.2",
|
|
43
44
|
"use-places-autocomplete": "^4.0.0"
|
|
44
45
|
}
|
|
45
46
|
}
|
|
@@ -9,7 +9,6 @@ import ListItemIcon from '@mui/material/ListItemIcon';
|
|
|
9
9
|
import LocationOnRoundedIcon from '@mui/icons-material/LocationOnRounded';
|
|
10
10
|
import ListItemText from '@mui/material/ListItemText';
|
|
11
11
|
import useOnclickOutside from "react-cool-onclickoutside";
|
|
12
|
-
import { useForm, Controller, useFieldArray } from "react-hook-form";
|
|
13
12
|
import Stack from "@mui/material/Stack";
|
|
14
13
|
|
|
15
14
|
import usePlacesAutocomplete, {
|
|
@@ -370,9 +369,7 @@ export const GooglePlacesModal = ({
|
|
|
370
369
|
_address = "",
|
|
371
370
|
_city = "",
|
|
372
371
|
_state = "",
|
|
373
|
-
_postalCode = ""
|
|
374
|
-
react_hook_form_Control = null,
|
|
375
|
-
react_hook_form_errors = null
|
|
372
|
+
_postalCode = ""
|
|
376
373
|
}) => {
|
|
377
374
|
const [address, setAddress] = useState(_address);
|
|
378
375
|
const [city, setCity] = useState(_city);
|
|
@@ -387,7 +384,6 @@ export const GooglePlacesModal = ({
|
|
|
387
384
|
<Box>
|
|
388
385
|
<AutoCompleteDialog
|
|
389
386
|
placeholder={"Address"}
|
|
390
|
-
react_hook_form_Control={react_hook_form_Control}
|
|
391
387
|
defaultValue={address}
|
|
392
388
|
onSelected={(data) => {
|
|
393
389
|
setAddress(data.address);
|
|
@@ -407,8 +403,7 @@ export const GooglePlacesModal = ({
|
|
|
407
403
|
<Grid container spacing={1} sx={{ marginTop: 1 }}>
|
|
408
404
|
<Grid item xs={6}>
|
|
409
405
|
<Box>
|
|
410
|
-
|
|
411
|
-
{react_hook_form_Control == null &&
|
|
406
|
+
|
|
412
407
|
<TextField
|
|
413
408
|
id="outlined-basic"
|
|
414
409
|
label="City"
|
|
@@ -416,40 +411,13 @@ export const GooglePlacesModal = ({
|
|
|
416
411
|
variant="outlined"
|
|
417
412
|
fullWidth={true}
|
|
418
413
|
value={city}
|
|
414
|
+
InputProps={{
|
|
415
|
+
readOnly: true,
|
|
416
|
+
}}
|
|
419
417
|
onChange={(val) => {
|
|
420
418
|
setCity(val.currentTarget.value);
|
|
421
419
|
}}
|
|
422
420
|
/>
|
|
423
|
-
}
|
|
424
|
-
|
|
425
|
-
{react_hook_form_Control != null &&
|
|
426
|
-
<Controller
|
|
427
|
-
control={react_hook_form_Control}
|
|
428
|
-
rules={{ required: true }}
|
|
429
|
-
name="city"
|
|
430
|
-
render={({ field }) => (
|
|
431
|
-
<Stack>
|
|
432
|
-
<TextField
|
|
433
|
-
id="outlined-basic"
|
|
434
|
-
label="City"
|
|
435
|
-
name="city"
|
|
436
|
-
variant="outlined"
|
|
437
|
-
{...field}
|
|
438
|
-
fullWidth={true}
|
|
439
|
-
value={city}
|
|
440
|
-
onChange={(val) => {
|
|
441
|
-
setCity(val.currentTarget.value);
|
|
442
|
-
}}
|
|
443
|
-
/>
|
|
444
|
-
|
|
445
|
-
{react_hook_form_errors != null && react_hook_form_errors.city &&
|
|
446
|
-
react_hook_form_errors.city.type === 'required'
|
|
447
|
-
&& <Typography sx={{color: "red"}}>City is required.</Typography>}
|
|
448
|
-
</Stack>
|
|
449
|
-
)}
|
|
450
|
-
/>
|
|
451
|
-
}
|
|
452
|
-
|
|
453
421
|
|
|
454
422
|
</Box>
|
|
455
423
|
</Grid>
|
|
@@ -457,51 +425,21 @@ export const GooglePlacesModal = ({
|
|
|
457
425
|
<Grid item xs={6}>
|
|
458
426
|
<Box>
|
|
459
427
|
|
|
460
|
-
{react_hook_form_Control == null &&
|
|
461
|
-
|
|
462
428
|
<TextField
|
|
463
429
|
id="outlined-basic"
|
|
464
430
|
label="State"
|
|
465
431
|
name="state"
|
|
466
432
|
variant="outlined"
|
|
467
433
|
fullWidth={true}
|
|
434
|
+
InputProps={{
|
|
435
|
+
readOnly: true,
|
|
436
|
+
}}
|
|
468
437
|
value={state}
|
|
469
438
|
onChange={(val) => {
|
|
470
439
|
setState(val.currentTarget.value);
|
|
471
440
|
}}
|
|
472
441
|
/>
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
{react_hook_form_Control != null &&
|
|
476
|
-
<Controller
|
|
477
|
-
control={react_hook_form_Control}
|
|
478
|
-
rules={{ required: true }}
|
|
479
|
-
name="state"
|
|
480
|
-
render={({ field }) => (
|
|
481
|
-
<Stack>
|
|
482
|
-
|
|
483
|
-
<TextField
|
|
484
|
-
id="outlined-basic"
|
|
485
|
-
label="State"
|
|
486
|
-
{...field}
|
|
487
|
-
name="state"
|
|
488
|
-
variant="outlined"
|
|
489
|
-
fullWidth={true}
|
|
490
|
-
value={state}
|
|
491
|
-
onChange={(val) => {
|
|
492
|
-
setState(val.currentTarget.value);
|
|
493
|
-
}}
|
|
494
|
-
/>
|
|
495
|
-
|
|
496
|
-
{react_hook_form_errors != null && react_hook_form_errors.state &&
|
|
497
|
-
react_hook_form_errors.state.type === 'required'
|
|
498
|
-
&& <Typography sx={{color: "red"}}>State is required.</Typography>}
|
|
499
|
-
</Stack>
|
|
500
|
-
)}
|
|
501
|
-
/>
|
|
502
|
-
}
|
|
503
|
-
|
|
504
|
-
|
|
442
|
+
|
|
505
443
|
|
|
506
444
|
|
|
507
445
|
</Box>
|
|
@@ -520,6 +458,9 @@ export const GooglePlacesModal = ({
|
|
|
520
458
|
variant="outlined"
|
|
521
459
|
fullWidth={true}
|
|
522
460
|
value={zip}
|
|
461
|
+
InputProps={{
|
|
462
|
+
readOnly: true,
|
|
463
|
+
}}
|
|
523
464
|
onChange={(val) => {
|
|
524
465
|
setPostalcode(val.currentTarget.value);
|
|
525
466
|
}}
|