authscape 1.0.146 → 1.0.148
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 +59 -13
- package/package.json +1 -1
- package/src/components/GoogleMapsAutoComplete.js +143 -95
package/index.js
CHANGED
|
@@ -730,6 +730,7 @@ var _LocationOnRounded = _interopRequireDefault(require("@mui/icons-material/Loc
|
|
|
730
730
|
var _ListItemText = _interopRequireDefault(require("@mui/material/ListItemText"));
|
|
731
731
|
var _reactCoolOnclickoutside = _interopRequireDefault(require("react-cool-onclickoutside"));
|
|
732
732
|
var _reactHookForm = require("react-hook-form");
|
|
733
|
+
var _Stack = _interopRequireDefault(require("@mui/material/Stack"));
|
|
733
734
|
var _usePlacesAutocomplete = _interopRequireWildcard(require("use-places-autocomplete"));
|
|
734
735
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
735
736
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
@@ -977,7 +978,20 @@ var AutoCompleteDialog = function AutoCompleteDialog(_ref) {
|
|
|
977
978
|
})), /*#__PURE__*/_react["default"].createElement(_ListItemText["default"], null, /*#__PURE__*/_react["default"].createElement("strong", null, main_text), " ", /*#__PURE__*/_react["default"].createElement("small", null, secondary_text)));
|
|
978
979
|
});
|
|
979
980
|
};
|
|
980
|
-
return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement(
|
|
981
|
+
return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, react_hook_form_Control == null && /*#__PURE__*/_react["default"].createElement(_Stack["default"], null, /*#__PURE__*/_react["default"].createElement(_TextField["default"], {
|
|
982
|
+
ref: txtAddressField,
|
|
983
|
+
name: "address",
|
|
984
|
+
autoComplete: "new-password",
|
|
985
|
+
label: placeholder,
|
|
986
|
+
variant: "outlined",
|
|
987
|
+
fullWidth: true,
|
|
988
|
+
value: value,
|
|
989
|
+
onChange: handleInput
|
|
990
|
+
}), react_hook_form_errors != null && react_hook_form_errors.address && react_hook_form_errors.address.type === 'required' && /*#__PURE__*/_react["default"].createElement(Typography, {
|
|
991
|
+
sx: {
|
|
992
|
+
color: "red"
|
|
993
|
+
}
|
|
994
|
+
}, "Address is required.")), react_hook_form_Control != null && /*#__PURE__*/_react["default"].createElement(_reactHookForm.Controller, {
|
|
981
995
|
control: react_hook_form_Control,
|
|
982
996
|
rules: {
|
|
983
997
|
required: true
|
|
@@ -985,7 +999,7 @@ var AutoCompleteDialog = function AutoCompleteDialog(_ref) {
|
|
|
985
999
|
name: "address",
|
|
986
1000
|
render: function render(_ref3) {
|
|
987
1001
|
var field = _ref3.field;
|
|
988
|
-
return /*#__PURE__*/_react["default"].createElement(
|
|
1002
|
+
return /*#__PURE__*/_react["default"].createElement(_Stack["default"], null, /*#__PURE__*/_react["default"].createElement(_TextField["default"], _extends({
|
|
989
1003
|
ref: txtAddressField,
|
|
990
1004
|
name: "address"
|
|
991
1005
|
}, field, {
|
|
@@ -995,7 +1009,7 @@ var AutoCompleteDialog = function AutoCompleteDialog(_ref) {
|
|
|
995
1009
|
fullWidth: true,
|
|
996
1010
|
value: value,
|
|
997
1011
|
onChange: handleInput
|
|
998
|
-
})),
|
|
1012
|
+
})), react_hook_form_errors != null && react_hook_form_errors.address && react_hook_form_errors.address.type === 'required' && /*#__PURE__*/_react["default"].createElement(Typography, {
|
|
999
1013
|
sx: {
|
|
1000
1014
|
color: "red"
|
|
1001
1015
|
}
|
|
@@ -1022,7 +1036,9 @@ var GooglePlacesModal = function GooglePlacesModal(_ref4) {
|
|
|
1022
1036
|
_ref4$_postalCode = _ref4._postalCode,
|
|
1023
1037
|
_postalCode = _ref4$_postalCode === void 0 ? "" : _ref4$_postalCode,
|
|
1024
1038
|
_ref4$react_hook_form = _ref4.react_hook_form_Control,
|
|
1025
|
-
react_hook_form_Control = _ref4$react_hook_form === void 0 ? null : _ref4$react_hook_form
|
|
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;
|
|
1026
1042
|
var _useState = (0, _react.useState)(_address),
|
|
1027
1043
|
_useState2 = _slicedToArray(_useState, 2),
|
|
1028
1044
|
address = _useState2[0],
|
|
@@ -1072,7 +1088,17 @@ var GooglePlacesModal = function GooglePlacesModal(_ref4) {
|
|
|
1072
1088
|
}, /*#__PURE__*/_react["default"].createElement(_Grid["default"], {
|
|
1073
1089
|
item: true,
|
|
1074
1090
|
xs: 6
|
|
1075
|
-
}, /*#__PURE__*/_react["default"].createElement(_system.Box, null, /*#__PURE__*/_react["default"].createElement(
|
|
1091
|
+
}, /*#__PURE__*/_react["default"].createElement(_system.Box, null, react_hook_form_Control == null && /*#__PURE__*/_react["default"].createElement(_TextField["default"], {
|
|
1092
|
+
id: "outlined-basic",
|
|
1093
|
+
label: "City",
|
|
1094
|
+
name: "city",
|
|
1095
|
+
variant: "outlined",
|
|
1096
|
+
fullWidth: true,
|
|
1097
|
+
value: city,
|
|
1098
|
+
onChange: function onChange(val) {
|
|
1099
|
+
setCity(val.currentTarget.value);
|
|
1100
|
+
}
|
|
1101
|
+
}), react_hook_form_Control != null && /*#__PURE__*/_react["default"].createElement(_reactHookForm.Controller, {
|
|
1076
1102
|
control: react_hook_form_Control,
|
|
1077
1103
|
rules: {
|
|
1078
1104
|
required: true
|
|
@@ -1080,7 +1106,7 @@ var GooglePlacesModal = function GooglePlacesModal(_ref4) {
|
|
|
1080
1106
|
name: "city",
|
|
1081
1107
|
render: function render(_ref5) {
|
|
1082
1108
|
var field = _ref5.field;
|
|
1083
|
-
return /*#__PURE__*/_react["default"].createElement(
|
|
1109
|
+
return /*#__PURE__*/_react["default"].createElement(_Stack["default"], null, /*#__PURE__*/_react["default"].createElement(_TextField["default"], _extends({
|
|
1084
1110
|
id: "outlined-basic",
|
|
1085
1111
|
label: "City",
|
|
1086
1112
|
name: "city",
|
|
@@ -1091,7 +1117,7 @@ var GooglePlacesModal = function GooglePlacesModal(_ref4) {
|
|
|
1091
1117
|
onChange: function onChange(val) {
|
|
1092
1118
|
setCity(val.currentTarget.value);
|
|
1093
1119
|
}
|
|
1094
|
-
})),
|
|
1120
|
+
})), react_hook_form_errors != null && react_hook_form_errors.city && react_hook_form_errors.city.type === 'required' && /*#__PURE__*/_react["default"].createElement(Typography, {
|
|
1095
1121
|
sx: {
|
|
1096
1122
|
color: "red"
|
|
1097
1123
|
}
|
|
@@ -1100,7 +1126,17 @@ var GooglePlacesModal = function GooglePlacesModal(_ref4) {
|
|
|
1100
1126
|
}))), /*#__PURE__*/_react["default"].createElement(_Grid["default"], {
|
|
1101
1127
|
item: true,
|
|
1102
1128
|
xs: 6
|
|
1103
|
-
}, /*#__PURE__*/_react["default"].createElement(_system.Box, null, /*#__PURE__*/_react["default"].createElement(
|
|
1129
|
+
}, /*#__PURE__*/_react["default"].createElement(_system.Box, null, react_hook_form_Control == null && /*#__PURE__*/_react["default"].createElement(_TextField["default"], {
|
|
1130
|
+
id: "outlined-basic",
|
|
1131
|
+
label: "State",
|
|
1132
|
+
name: "state",
|
|
1133
|
+
variant: "outlined",
|
|
1134
|
+
fullWidth: true,
|
|
1135
|
+
value: state,
|
|
1136
|
+
onChange: function onChange(val) {
|
|
1137
|
+
setState(val.currentTarget.value);
|
|
1138
|
+
}
|
|
1139
|
+
}), react_hook_form_Control != null && /*#__PURE__*/_react["default"].createElement(_reactHookForm.Controller, {
|
|
1104
1140
|
control: react_hook_form_Control,
|
|
1105
1141
|
rules: {
|
|
1106
1142
|
required: true
|
|
@@ -1108,7 +1144,7 @@ var GooglePlacesModal = function GooglePlacesModal(_ref4) {
|
|
|
1108
1144
|
name: "state",
|
|
1109
1145
|
render: function render(_ref6) {
|
|
1110
1146
|
var field = _ref6.field;
|
|
1111
|
-
return /*#__PURE__*/_react["default"].createElement(
|
|
1147
|
+
return /*#__PURE__*/_react["default"].createElement(_Stack["default"], null, /*#__PURE__*/_react["default"].createElement(_TextField["default"], _extends({
|
|
1112
1148
|
id: "outlined-basic",
|
|
1113
1149
|
label: "State"
|
|
1114
1150
|
}, field, {
|
|
@@ -1119,7 +1155,7 @@ var GooglePlacesModal = function GooglePlacesModal(_ref4) {
|
|
|
1119
1155
|
onChange: function onChange(val) {
|
|
1120
1156
|
setState(val.currentTarget.value);
|
|
1121
1157
|
}
|
|
1122
|
-
})),
|
|
1158
|
+
})), react_hook_form_errors != null && react_hook_form_errors.state && react_hook_form_errors.state.type === 'required' && /*#__PURE__*/_react["default"].createElement(Typography, {
|
|
1123
1159
|
sx: {
|
|
1124
1160
|
color: "red"
|
|
1125
1161
|
}
|
|
@@ -1129,7 +1165,17 @@ var GooglePlacesModal = function GooglePlacesModal(_ref4) {
|
|
|
1129
1165
|
sx: {
|
|
1130
1166
|
marginTop: 2
|
|
1131
1167
|
}
|
|
1132
|
-
}, /*#__PURE__*/_react["default"].createElement(
|
|
1168
|
+
}, react_hook_form_Control == null && /*#__PURE__*/_react["default"].createElement(_TextField["default"], {
|
|
1169
|
+
id: "outlined-basic",
|
|
1170
|
+
label: "Postal code",
|
|
1171
|
+
name: "postalCode",
|
|
1172
|
+
variant: "outlined",
|
|
1173
|
+
fullWidth: true,
|
|
1174
|
+
value: zip,
|
|
1175
|
+
onChange: function onChange(val) {
|
|
1176
|
+
setPostalcode(val.currentTarget.value);
|
|
1177
|
+
}
|
|
1178
|
+
}), react_hook_form_Control != null && /*#__PURE__*/_react["default"].createElement(_reactHookForm.Controller, {
|
|
1133
1179
|
control: react_hook_form_Control,
|
|
1134
1180
|
rules: {
|
|
1135
1181
|
required: true
|
|
@@ -1137,7 +1183,7 @@ var GooglePlacesModal = function GooglePlacesModal(_ref4) {
|
|
|
1137
1183
|
name: "postalCode",
|
|
1138
1184
|
render: function render(_ref7) {
|
|
1139
1185
|
var field = _ref7.field;
|
|
1140
|
-
return /*#__PURE__*/_react["default"].createElement(
|
|
1186
|
+
return /*#__PURE__*/_react["default"].createElement(_Stack["default"], null, /*#__PURE__*/_react["default"].createElement(_TextField["default"], _extends({
|
|
1141
1187
|
id: "outlined-basic",
|
|
1142
1188
|
label: "Postal code"
|
|
1143
1189
|
}, field, {
|
|
@@ -1148,7 +1194,7 @@ var GooglePlacesModal = function GooglePlacesModal(_ref4) {
|
|
|
1148
1194
|
onChange: function onChange(val) {
|
|
1149
1195
|
setPostalcode(val.currentTarget.value);
|
|
1150
1196
|
}
|
|
1151
|
-
})),
|
|
1197
|
+
})), react_hook_form_errors != null && react_hook_form_errors.postalCode && react_hook_form_errors.postalCode.type === 'required' && /*#__PURE__*/_react["default"].createElement(Typography, {
|
|
1152
1198
|
sx: {
|
|
1153
1199
|
color: "red"
|
|
1154
1200
|
}
|
package/package.json
CHANGED
|
@@ -10,6 +10,7 @@ import LocationOnRoundedIcon from '@mui/icons-material/LocationOnRounded';
|
|
|
10
10
|
import ListItemText from '@mui/material/ListItemText';
|
|
11
11
|
import useOnclickOutside from "react-cool-onclickoutside";
|
|
12
12
|
import { useForm, Controller, useFieldArray } from "react-hook-form";
|
|
13
|
+
import Stack from "@mui/material/Stack";
|
|
13
14
|
|
|
14
15
|
import usePlacesAutocomplete, {
|
|
15
16
|
getGeocode,
|
|
@@ -324,19 +325,30 @@ const AutoCompleteDialog = ({placeholder, onSelected, defaultValue, react_hook_f
|
|
|
324
325
|
return (
|
|
325
326
|
<>
|
|
326
327
|
|
|
327
|
-
|
|
328
|
-
control={react_hook_form_Control}
|
|
329
|
-
rules={{ required: true }}
|
|
330
|
-
name="address"
|
|
331
|
-
render={({ field }) => (
|
|
328
|
+
{react_hook_form_Control == null &&
|
|
332
329
|
<Stack>
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
330
|
+
<TextField ref={txtAddressField} name="address" autoComplete="new-password" label={placeholder} variant="outlined" fullWidth={true} value={value} onChange={handleInput} />
|
|
331
|
+
{react_hook_form_errors != null && react_hook_form_errors.address &&
|
|
332
|
+
react_hook_form_errors.address.type === 'required'
|
|
333
|
+
&& <Typography sx={{color: "red"}}>Address is required.</Typography>}
|
|
337
334
|
</Stack>
|
|
338
|
-
|
|
339
|
-
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
{react_hook_form_Control != null &&
|
|
338
|
+
<Controller
|
|
339
|
+
control={react_hook_form_Control}
|
|
340
|
+
rules={{ required: true }}
|
|
341
|
+
name="address"
|
|
342
|
+
render={({ field }) => (
|
|
343
|
+
<Stack>
|
|
344
|
+
<TextField ref={txtAddressField} name="address" {...field} autoComplete="new-password" label={placeholder} variant="outlined" fullWidth={true} value={value} onChange={handleInput} />
|
|
345
|
+
{react_hook_form_errors != null && react_hook_form_errors.address &&
|
|
346
|
+
react_hook_form_errors.address.type === 'required'
|
|
347
|
+
&& <Typography sx={{color: "red"}}>Address is required.</Typography>}
|
|
348
|
+
</Stack>
|
|
349
|
+
)}
|
|
350
|
+
/>
|
|
351
|
+
}
|
|
340
352
|
|
|
341
353
|
|
|
342
354
|
|
|
@@ -359,7 +371,8 @@ export const GooglePlacesModal = ({
|
|
|
359
371
|
_city = "",
|
|
360
372
|
_state = "",
|
|
361
373
|
_postalCode = "",
|
|
362
|
-
react_hook_form_Control = null
|
|
374
|
+
react_hook_form_Control = null,
|
|
375
|
+
react_hook_form_errors = null
|
|
363
376
|
}) => {
|
|
364
377
|
const [address, setAddress] = useState(_address);
|
|
365
378
|
const [city, setCity] = useState(_city);
|
|
@@ -395,32 +408,47 @@ export const GooglePlacesModal = ({
|
|
|
395
408
|
<Grid item xs={6}>
|
|
396
409
|
<Box>
|
|
397
410
|
|
|
411
|
+
{react_hook_form_Control == null &&
|
|
412
|
+
<TextField
|
|
413
|
+
id="outlined-basic"
|
|
414
|
+
label="City"
|
|
415
|
+
name="city"
|
|
416
|
+
variant="outlined"
|
|
417
|
+
fullWidth={true}
|
|
418
|
+
value={city}
|
|
419
|
+
onChange={(val) => {
|
|
420
|
+
setCity(val.currentTarget.value);
|
|
421
|
+
}}
|
|
422
|
+
/>
|
|
423
|
+
}
|
|
398
424
|
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
<
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
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
|
+
}
|
|
424
452
|
|
|
425
453
|
|
|
426
454
|
</Box>
|
|
@@ -429,85 +457,105 @@ export const GooglePlacesModal = ({
|
|
|
429
457
|
<Grid item xs={6}>
|
|
430
458
|
<Box>
|
|
431
459
|
|
|
432
|
-
|
|
433
|
-
<Controller
|
|
434
|
-
control={react_hook_form_Control}
|
|
435
|
-
rules={{ required: true }}
|
|
436
|
-
name="state"
|
|
437
|
-
render={({ field }) => (
|
|
438
|
-
<Stack>
|
|
439
|
-
|
|
440
|
-
<TextField
|
|
441
|
-
id="outlined-basic"
|
|
442
|
-
label="State"
|
|
443
|
-
{...field}
|
|
444
|
-
name="state"
|
|
445
|
-
variant="outlined"
|
|
446
|
-
fullWidth={true}
|
|
447
|
-
value={state}
|
|
448
|
-
onChange={(val) => {
|
|
449
|
-
setState(val.currentTarget.value);
|
|
450
|
-
}}
|
|
451
|
-
/>
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
{errors.state &&
|
|
455
|
-
errors.state.type === 'required'
|
|
456
|
-
&& <Typography sx={{color: "red"}}>State is required.</Typography>}
|
|
457
|
-
</Stack>
|
|
458
|
-
)}
|
|
459
|
-
/>
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
</Box>
|
|
465
|
-
</Grid>
|
|
466
|
-
</Grid>
|
|
467
|
-
|
|
468
|
-
<Box sx={{ marginTop: 2 }}>
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
<Controller
|
|
473
|
-
control={react_hook_form_Control}
|
|
474
|
-
rules={{ required: true }}
|
|
475
|
-
name="postalCode"
|
|
476
|
-
render={({ field }) => (
|
|
477
|
-
<Stack>
|
|
460
|
+
{react_hook_form_Control == null &&
|
|
478
461
|
|
|
479
462
|
<TextField
|
|
480
463
|
id="outlined-basic"
|
|
481
|
-
label="
|
|
482
|
-
|
|
483
|
-
name="postalCode"
|
|
464
|
+
label="State"
|
|
465
|
+
name="state"
|
|
484
466
|
variant="outlined"
|
|
485
467
|
fullWidth={true}
|
|
486
|
-
value={
|
|
468
|
+
value={state}
|
|
487
469
|
onChange={(val) => {
|
|
488
|
-
|
|
470
|
+
setState(val.currentTarget.value);
|
|
489
471
|
}}
|
|
490
472
|
/>
|
|
473
|
+
}
|
|
491
474
|
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
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
|
+
}
|
|
498
503
|
|
|
499
504
|
|
|
500
505
|
|
|
506
|
+
|
|
507
|
+
</Box>
|
|
508
|
+
</Grid>
|
|
509
|
+
</Grid>
|
|
501
510
|
|
|
511
|
+
<Box sx={{ marginTop: 2 }}>
|
|
502
512
|
|
|
503
513
|
|
|
514
|
+
{react_hook_form_Control == null &&
|
|
504
515
|
|
|
516
|
+
<TextField
|
|
517
|
+
id="outlined-basic"
|
|
518
|
+
label="Postal code"
|
|
519
|
+
name="postalCode"
|
|
520
|
+
variant="outlined"
|
|
521
|
+
fullWidth={true}
|
|
522
|
+
value={zip}
|
|
523
|
+
onChange={(val) => {
|
|
524
|
+
setPostalcode(val.currentTarget.value);
|
|
525
|
+
}}
|
|
526
|
+
/>
|
|
527
|
+
}
|
|
505
528
|
|
|
529
|
+
{react_hook_form_Control != null &&
|
|
530
|
+
<Controller
|
|
531
|
+
control={react_hook_form_Control}
|
|
532
|
+
rules={{ required: true }}
|
|
533
|
+
name="postalCode"
|
|
534
|
+
render={({ field }) => (
|
|
535
|
+
<Stack>
|
|
506
536
|
|
|
537
|
+
<TextField
|
|
538
|
+
id="outlined-basic"
|
|
539
|
+
label="Postal code"
|
|
540
|
+
{...field}
|
|
541
|
+
name="postalCode"
|
|
542
|
+
variant="outlined"
|
|
543
|
+
fullWidth={true}
|
|
544
|
+
value={zip}
|
|
545
|
+
onChange={(val) => {
|
|
546
|
+
setPostalcode(val.currentTarget.value);
|
|
547
|
+
}}
|
|
548
|
+
/>
|
|
507
549
|
|
|
550
|
+
{react_hook_form_errors != null && react_hook_form_errors.postalCode &&
|
|
551
|
+
react_hook_form_errors.postalCode.type === 'required'
|
|
552
|
+
&& <Typography sx={{color: "red"}}>Postal Code is required.</Typography>}
|
|
553
|
+
</Stack>
|
|
554
|
+
)}
|
|
555
|
+
/>
|
|
556
|
+
}
|
|
508
557
|
|
|
509
558
|
|
|
510
|
-
|
|
511
559
|
</Box>
|
|
512
560
|
|
|
513
561
|
{/* <Box sx={{ marginTop: 1, textAlign: "right" }}>
|