@djb25/digit-ui-module-vendor 1.0.41 → 1.0.43

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.
@@ -1,6 +1,6 @@
1
1
  import React, { useState, useEffect, useMemo, useCallback } from 'react';
2
2
  import { useLocation, Switch, useHistory, useParams, Link, useRouteMatch, Redirect, Route } from 'react-router-dom';
3
- import { AppContainer, ModuleHeader, ArrowLeft, PrivateRoute, LayoutWrapper, HomeIcon, PropertyHouse, EmployeeModuleCard, VerticalTimeline, FormStep, LabelFieldPair, CardLabel, CustomTooltip, TextInput, MobileNumber, Dropdown as Dropdown$3, UploadFile, Toast, Loader, Card, ActionBar, SubmitBar, RadioOrSelect, Header, SearchForm, SearchField, CardLabelError, DatePicker as DatePicker$5, Table, ShippingTruck, CheckBox, RadioButtons, CloseSvg, Localities, RemoveableTag, ApplyFilterBar, AddIcon, Menu, LinkLabel, ViewsIcon, ToggleSwitch, Modal, MdClose, MultiSelectDropdown, CitizenHomeCard, CardSectionHeader, Row, EditIcon, DeleteIcon, CardText, FormComposer, CardHeader, CardSubHeader, StatusTable, LinkButton, Banner, InfoIcon } from '@djb25/digit-ui-react-components';
3
+ import { AppContainer, ModuleHeader, ArrowLeft, PrivateRoute, LayoutWrapper, HomeIcon, PropertyHouse, EmployeeModuleCard, VerticalTimeline, FormStep, LabelFieldPair, CardLabel, CustomTooltip, TextInput, MobileNumber, Dropdown as Dropdown$2, UploadFile, Toast, Loader, Card, ActionBar, SubmitBar, RadioOrSelect, Header, SearchForm, SearchField, CardLabelError, DatePicker as DatePicker$4, Table, ShippingTruck, CheckBox, RadioButtons, CloseSvg, Localities, RemoveableTag, ApplyFilterBar, AddIcon, Menu, LinkLabel, ViewsIcon, ToggleSwitch, Modal, MdClose, MultiSelectDropdown, CitizenHomeCard, CardSectionHeader, Row, EditIcon, DeleteIcon, CardText, FormComposer, CardHeader, CardSubHeader, StatusTable, LinkButton, Banner, InfoIcon } from '@djb25/digit-ui-react-components';
4
4
  import { useTranslation } from 'react-i18next';
5
5
  import { useForm, Controller } from 'react-hook-form';
6
6
  import { useQueryClient } from 'react-query';
@@ -697,7 +697,7 @@ const VendorDetails = ({
697
697
  rules: {
698
698
  required: t("CORE_COMMON_REQUIRED_ERRMSG")
699
699
  },
700
- render: props => /*#__PURE__*/React.createElement(Dropdown$3, {
700
+ render: props => /*#__PURE__*/React.createElement(Dropdown$2, {
701
701
  selected: VendorType,
702
702
  select: setVendorType,
703
703
  option: [{
@@ -737,7 +737,7 @@ const VendorDetails = ({
737
737
  rules: {
738
738
  required: t("CORE_COMMON_REQUIRED_ERRMSG")
739
739
  },
740
- render: props => /*#__PURE__*/React.createElement(Dropdown$3, {
740
+ render: props => /*#__PURE__*/React.createElement(Dropdown$2, {
741
741
  selected: VendorCategory,
742
742
  select: setVendorCategory,
743
743
  option: [{
@@ -777,7 +777,7 @@ const VendorDetails = ({
777
777
  rules: {
778
778
  required: t("CORE_COMMON_REQUIRED_ERRMSG")
779
779
  },
780
- render: props => /*#__PURE__*/React.createElement(Dropdown$3, {
780
+ render: props => /*#__PURE__*/React.createElement(Dropdown$2, {
781
781
  selected: Status,
782
782
  select: setStatus,
783
783
  option: [{
@@ -1061,11 +1061,21 @@ const VendorSelectAddress = ({
1061
1061
  } = Digit.Hooks.useBoundaryLocalities(selectedCity === null || selectedCity === void 0 ? void 0 : selectedCity.code, "revenue", {
1062
1062
  enabled: !!selectedCity
1063
1063
  }, t);
1064
+ const {
1065
+ data: fetchedWards
1066
+ } = Digit.Hooks.useBoundaryLocalities(selectedCity === null || selectedCity === void 0 ? void 0 : selectedCity.code, "admin", {
1067
+ enabled: !!selectedCity
1068
+ }, t);
1064
1069
  const [localities, setLocalities] = useState();
1065
1070
  const [selectedLocality, setSelectedLocality] = useState(() => {
1066
1071
  var _property2, _property2$propertyDe, _property2$propertyDe2, _formData$cpt, _formData$cpt$details, _formData$cpt$details2, _formData$address2;
1067
1072
  return ((_property2 = property) === null || _property2 === void 0 ? void 0 : (_property2$propertyDe = _property2.propertyDetails) === null || _property2$propertyDe === void 0 ? void 0 : (_property2$propertyDe2 = _property2$propertyDe.address) === null || _property2$propertyDe2 === void 0 ? void 0 : _property2$propertyDe2.locality) || (formData === null || formData === void 0 ? void 0 : (_formData$cpt = formData.cpt) === null || _formData$cpt === void 0 ? void 0 : (_formData$cpt$details = _formData$cpt.details) === null || _formData$cpt$details === void 0 ? void 0 : (_formData$cpt$details2 = _formData$cpt$details.address) === null || _formData$cpt$details2 === void 0 ? void 0 : _formData$cpt$details2.locality) || (formData === null || formData === void 0 ? void 0 : (_formData$address2 = formData.address) === null || _formData$address2 === void 0 ? void 0 : _formData$address2.locality);
1068
1073
  });
1074
+ const [wards, setWards] = useState();
1075
+ const [selectedWard, setSelectedWard] = useState(() => {
1076
+ var _formData$address3;
1077
+ return formData === null || formData === void 0 ? void 0 : (_formData$address3 = formData.address) === null || _formData$address3 === void 0 ? void 0 : _formData$address3.ward;
1078
+ });
1069
1079
  useEffect(() => {
1070
1080
  if (cities) {
1071
1081
  if (cities.length === 1) {
@@ -1075,10 +1085,10 @@ const VendorSelectAddress = ({
1075
1085
  }, [cities]);
1076
1086
  useEffect(() => {
1077
1087
  if (selectedCity && fetchedLocalities) {
1078
- var _formData$address3, _formData$cpt2, _formData$cpt2$detail, _formData$cpt2$detail2, _property3, _property3$propertyDe, _property3$propertyDe2, _formData$address4;
1088
+ var _formData$address4, _formData$cpt2, _formData$cpt2$detail, _formData$cpt2$detail2, _property3, _property3$propertyDe, _property3$propertyDe2, _formData$address5;
1079
1089
  let __localityList = fetchedLocalities;
1080
1090
  let filteredLocalityList = [];
1081
- if (formData !== null && formData !== void 0 && (_formData$address3 = formData.address) !== null && _formData$address3 !== void 0 && _formData$address3.locality) {
1091
+ if (formData !== null && formData !== void 0 && (_formData$address4 = formData.address) !== null && _formData$address4 !== void 0 && _formData$address4.locality) {
1082
1092
  setSelectedLocality(formData.address.locality);
1083
1093
  } else if (formData !== null && formData !== void 0 && (_formData$cpt2 = formData.cpt) !== null && _formData$cpt2 !== void 0 && (_formData$cpt2$detail = _formData$cpt2.details) !== null && _formData$cpt2$detail !== void 0 && (_formData$cpt2$detail2 = _formData$cpt2$detail.address) !== null && _formData$cpt2$detail2 !== void 0 && _formData$cpt2$detail2.locality) {
1084
1094
  setSelectedLocality(formData.cpt.details.address.locality);
@@ -1086,13 +1096,13 @@ const VendorSelectAddress = ({
1086
1096
  var _property4, _property4$propertyDe, _property4$propertyDe2;
1087
1097
  setSelectedLocality((_property4 = property) === null || _property4 === void 0 ? void 0 : (_property4$propertyDe = _property4.propertyDetails) === null || _property4$propertyDe === void 0 ? void 0 : (_property4$propertyDe2 = _property4$propertyDe.address) === null || _property4$propertyDe2 === void 0 ? void 0 : _property4$propertyDe2.locality);
1088
1098
  }
1089
- if (formData !== null && formData !== void 0 && (_formData$address4 = formData.address) !== null && _formData$address4 !== void 0 && _formData$address4.pincode) {
1090
- var _formData$address5;
1099
+ if (formData !== null && formData !== void 0 && (_formData$address5 = formData.address) !== null && _formData$address5 !== void 0 && _formData$address5.pincode) {
1100
+ var _formData$address6;
1091
1101
  filteredLocalityList = __localityList.filter(obj => {
1092
1102
  var _obj$pincode;
1093
1103
  return (_obj$pincode = obj.pincode) === null || _obj$pincode === void 0 ? void 0 : _obj$pincode.find(item => item == formData.address.pincode);
1094
1104
  });
1095
- if (!(formData !== null && formData !== void 0 && (_formData$address5 = formData.address) !== null && _formData$address5 !== void 0 && _formData$address5.locality)) setSelectedLocality();
1105
+ if (!(formData !== null && formData !== void 0 && (_formData$address6 = formData.address) !== null && _formData$address6 !== void 0 && _formData$address6.locality)) setSelectedLocality();
1096
1106
  }
1097
1107
  if (userType === "employee") {
1098
1108
  onSelect(config.key, {
@@ -1112,9 +1122,20 @@ const VendorSelectAddress = ({
1112
1122
  }
1113
1123
  }
1114
1124
  }, [selectedCity, formData === null || formData === void 0 ? void 0 : (_formData$cpt3 = formData.cpt) === null || _formData$cpt3 === void 0 ? void 0 : (_formData$cpt3$detail = _formData$cpt3.details) === null || _formData$cpt3$detail === void 0 ? void 0 : _formData$cpt3$detail.address, fetchedLocalities]);
1125
+ useEffect(() => {
1126
+ if (selectedCity && fetchedWards) {
1127
+ var _formData$address7;
1128
+ if (formData !== null && formData !== void 0 && (_formData$address7 = formData.address) !== null && _formData$address7 !== void 0 && _formData$address7.ward) {
1129
+ setSelectedWard(formData.address.ward);
1130
+ }
1131
+ setWards(fetchedWards);
1132
+ }
1133
+ }, [selectedCity, fetchedWards]);
1115
1134
  function selectCity(city) {
1116
1135
  setSelectedLocality(null);
1117
1136
  setLocalities(null);
1137
+ setSelectedWard(null);
1138
+ setWards(null);
1118
1139
  Digit.SessionStorage.set("fsm.file.address.city", city);
1119
1140
  setSelectedCity(city);
1120
1141
  }
@@ -1123,6 +1144,17 @@ const VendorSelectAddress = ({
1123
1144
  if (userType === "employee") {
1124
1145
  onSelect(config.key, {
1125
1146
  ...formData[config.key],
1147
+ locality: selectedLocality,
1148
+ ward: selectedWard
1149
+ });
1150
+ }
1151
+ }
1152
+ function selectWard(ward) {
1153
+ setSelectedWard(ward);
1154
+ if (userType === "employee") {
1155
+ onSelect(config.key, {
1156
+ ...formData[config.key],
1157
+ ward: ward,
1126
1158
  locality: selectedLocality
1127
1159
  });
1128
1160
  }
@@ -1130,11 +1162,12 @@ const VendorSelectAddress = ({
1130
1162
  function onSubmit() {
1131
1163
  onSelect(config.key, {
1132
1164
  city: selectedCity,
1133
- locality: selectedLocality
1165
+ locality: selectedLocality,
1166
+ ward: selectedWard
1134
1167
  });
1135
1168
  }
1136
1169
  if (userType === "employee") {
1137
- return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, t("MYCITY_CODE_LABEL"), config.isMandatory ? " * " : null), /*#__PURE__*/React.createElement(Dropdown$3, {
1170
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, t("MYCITY_CODE_LABEL"), config.isMandatory ? " * " : null), /*#__PURE__*/React.createElement(Dropdown$2, {
1138
1171
  className: "",
1139
1172
  isMandatory: true,
1140
1173
  selected: (cities === null || cities === void 0 ? void 0 : cities.length) === 1 ? cities[0] : selectedCity,
@@ -1143,7 +1176,15 @@ const VendorSelectAddress = ({
1143
1176
  select: selectCity,
1144
1177
  optionKey: "code",
1145
1178
  t: t
1146
- })), /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, t("ES_NEW_APPLICATION_LOCATION_MOHALLA"), config.isMandatory ? " * " : null), /*#__PURE__*/React.createElement(Dropdown$3, {
1179
+ })), /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, t("ES_NEW_APPLICATION_LOCATION_WARD"), config.isMandatory ? " * " : null), /*#__PURE__*/React.createElement(Dropdown$2, {
1180
+ className: "",
1181
+ isMandatory: true,
1182
+ selected: selectedWard,
1183
+ option: wards,
1184
+ select: selectWard,
1185
+ optionKey: "name",
1186
+ t: t
1187
+ })), /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, t("ES_NEW_APPLICATION_LOCATION_MOHALLA"), config.isMandatory ? " * " : null), /*#__PURE__*/React.createElement(Dropdown$2, {
1147
1188
  className: "",
1148
1189
  isMandatory: true,
1149
1190
  selected: selectedLocality,
@@ -1157,13 +1198,20 @@ const VendorSelectAddress = ({
1157
1198
  config: config,
1158
1199
  onSelect: onSubmit,
1159
1200
  t: t,
1160
- isDisabled: selectedLocality ? false : true
1201
+ isDisabled: selectedLocality && selectedWard ? false : true
1161
1202
  }, /*#__PURE__*/React.createElement(CardLabel, null, `${t("MYCITY_CODE_LABEL")} *`), /*#__PURE__*/React.createElement(RadioOrSelect, {
1162
1203
  options: cities,
1163
1204
  selectedOption: selectedCity,
1164
1205
  optionKey: "i18nKey",
1165
1206
  onSelect: selectCity,
1166
1207
  t: t
1208
+ }), selectedCity && wards && /*#__PURE__*/React.createElement(CardLabel, null, `${t("ES_NEW_APPLICATION_LOCATION_WARD")} *`), selectedCity && wards && /*#__PURE__*/React.createElement(RadioOrSelect, {
1209
+ isMandatory: config.isMandatory,
1210
+ options: wards,
1211
+ selectedOption: selectedWard,
1212
+ optionKey: "name",
1213
+ onSelect: selectWard,
1214
+ t: t
1167
1215
  }), selectedCity && localities && /*#__PURE__*/React.createElement(CardLabel, null, `${t("CS_CREATECOMPLAINT_MOHALLA")} *`), selectedCity && localities && /*#__PURE__*/React.createElement(RadioOrSelect, {
1168
1216
  isMandatory: config.isMandatory,
1169
1217
  options: localities,
@@ -1302,7 +1350,7 @@ const VendorSearchApplication = ({
1302
1350
  name: "vendorName",
1303
1351
  render: field => {
1304
1352
  var _vendorData$vendor2;
1305
- return /*#__PURE__*/React.createElement(Dropdown$3, {
1353
+ return /*#__PURE__*/React.createElement(Dropdown$2, {
1306
1354
  selected: field.value || "",
1307
1355
  select: field.onChange,
1308
1356
  onBlur: field.onBlur,
@@ -1336,7 +1384,7 @@ const VendorSearchApplication = ({
1336
1384
  className: "employee-card-input employee-card-input--front"
1337
1385
  }, "+91")
1338
1386
  }), /*#__PURE__*/React.createElement(CardLabelError, null, formState === null || formState === void 0 ? void 0 : (_formState$errors = formState.errors) === null || _formState$errors === void 0 ? void 0 : (_formState$errors$mob = _formState$errors["mobileNumber"]) === null || _formState$errors$mob === void 0 ? void 0 : _formState$errors$mob.message)), /*#__PURE__*/React.createElement(SearchField, null, /*#__PURE__*/React.createElement("label", null, t("VENDOR_FROM_DATE")), /*#__PURE__*/React.createElement(Controller, {
1339
- render: props => /*#__PURE__*/React.createElement(DatePicker$5, {
1387
+ render: props => /*#__PURE__*/React.createElement(DatePicker$4, {
1340
1388
  date: props.value,
1341
1389
  disabled: false,
1342
1390
  onChange: props.onChange
@@ -1344,7 +1392,7 @@ const VendorSearchApplication = ({
1344
1392
  name: "fromDate",
1345
1393
  control: control
1346
1394
  })), /*#__PURE__*/React.createElement(SearchField, null, /*#__PURE__*/React.createElement("label", null, t("VENDOR_TO_DATE")), /*#__PURE__*/React.createElement(Controller, {
1347
- render: props => /*#__PURE__*/React.createElement(DatePicker$5, {
1395
+ render: props => /*#__PURE__*/React.createElement(DatePicker$4, {
1348
1396
  date: props.value,
1349
1397
  disabled: false,
1350
1398
  onChange: props.onChange
@@ -1845,7 +1893,7 @@ const DropdownStatus = ({
1845
1893
  applicationStatuses,
1846
1894
  areApplicationStatus
1847
1895
  }) => {
1848
- return areApplicationStatus ? /*#__PURE__*/React.createElement(Dropdown$3, {
1896
+ return areApplicationStatus ? /*#__PURE__*/React.createElement(Dropdown$2, {
1849
1897
  option: applicationStatuses,
1850
1898
  optionKey: "name",
1851
1899
  selected: value,
@@ -1942,7 +1990,7 @@ const RegisteredVendorSearch = ({
1942
1990
  switch (input.type) {
1943
1991
  case "date":
1944
1992
  return /*#__PURE__*/React.createElement(Controller, {
1945
- render: props => /*#__PURE__*/React.createElement(DatePicker$5, {
1993
+ render: props => /*#__PURE__*/React.createElement(DatePicker$4, {
1946
1994
  date: props.value,
1947
1995
  onChange: props.onChange
1948
1996
  }),
@@ -1962,7 +2010,7 @@ const RegisteredVendorSearch = ({
1962
2010
  });
1963
2011
  case "dropdown":
1964
2012
  return /*#__PURE__*/React.createElement(Controller, {
1965
- render: props => /*#__PURE__*/React.createElement(Dropdown$3, {
2013
+ render: props => /*#__PURE__*/React.createElement(Dropdown$2, {
1966
2014
  option: input.options,
1967
2015
  optionKey: input.optionsKey,
1968
2016
  value: props.value,
@@ -2841,7 +2889,7 @@ const VendorInbox = props => {
2841
2889
  Cell: ({
2842
2890
  row
2843
2891
  }) => {
2844
- return /*#__PURE__*/React.createElement(Dropdown$3, {
2892
+ return /*#__PURE__*/React.createElement(Dropdown$2, {
2845
2893
  className: "fsm-registry-dropdown",
2846
2894
  selected: getSelectedVendorOption(row.original, vendors),
2847
2895
  option: vendors,
@@ -2896,7 +2944,7 @@ const VendorInbox = props => {
2896
2944
  }) => {
2897
2945
  const selectedVendor = getSelectedVendorOption(row.original, vendors);
2898
2946
  const vendorFillingPoints = getVendorFillingPoints(selectedVendor);
2899
- return /*#__PURE__*/React.createElement(Dropdown$3, {
2947
+ return /*#__PURE__*/React.createElement(Dropdown$2, {
2900
2948
  className: "fsm-registry-dropdown",
2901
2949
  selected: getSelectedFillingPointOption(row.original, vendorFillingPoints),
2902
2950
  option: vendorFillingPoints,
@@ -2925,7 +2973,7 @@ const VendorInbox = props => {
2925
2973
  const selectedVendor = getSelectedVendorOption(row.original, vendors);
2926
2974
  const selectedFillingPoint = getSelectedFillingPointOption(row.original, getVendorFillingPoints(selectedVendor));
2927
2975
  const availableDrivers = getVendorDriversForFillingPoint(selectedVendor, selectedFillingPoint);
2928
- return /*#__PURE__*/React.createElement(Dropdown$3, {
2976
+ return /*#__PURE__*/React.createElement(Dropdown$2, {
2929
2977
  className: "fsm-registry-dropdown",
2930
2978
  selected: getSelectedDriverOption(row.original, availableDrivers),
2931
2979
  option: availableDrivers,
@@ -3018,7 +3066,7 @@ const VendorInbox = props => {
3018
3066
  Cell: ({
3019
3067
  row
3020
3068
  }) => {
3021
- return /*#__PURE__*/React.createElement(Dropdown$3, {
3069
+ return /*#__PURE__*/React.createElement(Dropdown$2, {
3022
3070
  className: "fsm-registry-dropdown",
3023
3071
  selected: (vendors === null || vendors === void 0 ? void 0 : vendors.find(vendor => {
3024
3072
  var _row$original$vendorD, _row$original$vendor;
@@ -3128,7 +3176,7 @@ const VendorInbox = props => {
3128
3176
  Cell: ({
3129
3177
  row
3130
3178
  }) => {
3131
- return /*#__PURE__*/React.createElement(Dropdown$3, {
3179
+ return /*#__PURE__*/React.createElement(Dropdown$2, {
3132
3180
  className: "fsm-registry-dropdown",
3133
3181
  selected: (vendors === null || vendors === void 0 ? void 0 : vendors.find(vendor => {
3134
3182
  var _row$original$vendorD2, _row$original$vendor2;
@@ -3865,7 +3913,6 @@ const SelectServiceType = ({
3865
3913
  formData
3866
3914
  }) => {
3867
3915
  const tenantId = Digit.ULBService.getCurrentTenantId();
3868
- const stateId = Digit.ULBService.getStateId();
3869
3916
  const [serviceTypes, setserviceTypes] = useState(formData === null || formData === void 0 ? void 0 : formData.serviceType);
3870
3917
  const [formattedServiceTypes, setFormattedServiceTypes] = useState([]);
3871
3918
  const {
@@ -3908,7 +3955,7 @@ const SelectServiceType = ({
3908
3955
  return /*#__PURE__*/React.createElement(Loader, null);
3909
3956
  }
3910
3957
  if (userType === "employee") {
3911
- return /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, t(config.label)), /*#__PURE__*/React.createElement(Dropdown$3, {
3958
+ return /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, t(config.label)), /*#__PURE__*/React.createElement(Dropdown$2, {
3912
3959
  className: "payment-form-text-input-correction",
3913
3960
  isMandatory: config.isMandatory,
3914
3961
  selected: serviceTypes,
@@ -4012,14 +4059,14 @@ const SelectVehicleType = ({
4012
4059
  if (!vehicleData || !serviceTypeData) {
4013
4060
  return /*#__PURE__*/React.createElement("div", null, t("ERROR_FETCHING_DATA"));
4014
4061
  }
4015
- return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, t("ES_FSM_REGISTRY_VEHICLE_MODEL")), /*#__PURE__*/React.createElement(Dropdown$3, {
4062
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, t("ES_FSM_REGISTRY_VEHICLE_MODEL")), /*#__PURE__*/React.createElement(Dropdown$2, {
4016
4063
  className: "form-field",
4017
4064
  selected: selectedModal,
4018
4065
  option: modals,
4019
4066
  select: selectModal,
4020
4067
  optionKey: "name",
4021
4068
  t: t
4022
- })), /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, t("ES_FSM_REGISTRY_VEHICLE_TYPE")), /*#__PURE__*/React.createElement(Dropdown$3, {
4069
+ })), /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, t("ES_FSM_REGISTRY_VEHICLE_TYPE")), /*#__PURE__*/React.createElement(Dropdown$2, {
4023
4070
  className: "form-field",
4024
4071
  selected: selectedType,
4025
4072
  option: types,
@@ -4311,7 +4358,7 @@ const SupervisorAreaAssignment = ({
4311
4358
  onSelect(config.key, updatedData);
4312
4359
  };
4313
4360
  if (isLoading) return /*#__PURE__*/React.createElement(Loader, null);
4314
- return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, t("ES_VENDOR_SUPERVISOR_ZONE") + " *"), /*#__PURE__*/React.createElement(Dropdown$3, {
4361
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, t("ES_VENDOR_SUPERVISOR_ZONE") + " *"), /*#__PURE__*/React.createElement(Dropdown$2, {
4315
4362
  selected: selectedZone,
4316
4363
  option: zones,
4317
4364
  select: val => {
@@ -4320,7 +4367,7 @@ const SupervisorAreaAssignment = ({
4320
4367
  },
4321
4368
  optionKey: "name",
4322
4369
  t: t
4323
- })), /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, t("ES_VENDOR_SUPERVISOR_CLUSTER") + " *"), /*#__PURE__*/React.createElement(Dropdown$3, {
4370
+ })), /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, t("ES_VENDOR_SUPERVISOR_CLUSTER") + " *"), /*#__PURE__*/React.createElement(Dropdown$2, {
4324
4371
  selected: selectedCluster,
4325
4372
  option: clusters,
4326
4373
  select: val => {
@@ -4330,7 +4377,7 @@ const SupervisorAreaAssignment = ({
4330
4377
  optionKey: "name",
4331
4378
  t: t,
4332
4379
  disable: !selectedZone
4333
- })), /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, t("ES_VENDOR_SUPERVISOR_WARD") + " *"), /*#__PURE__*/React.createElement(Dropdown$3, {
4380
+ })), /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, t("ES_VENDOR_SUPERVISOR_WARD") + " *"), /*#__PURE__*/React.createElement(Dropdown$2, {
4334
4381
  selected: selectedWard,
4335
4382
  option: wards,
4336
4383
  select: val => {
@@ -4349,7 +4396,10 @@ const SupervisorAreaAssignment = ({
4349
4396
  },
4350
4397
  optionsKey: "name",
4351
4398
  t: t,
4352
- disable: !selectedWard
4399
+ disable: !selectedWard,
4400
+ ServerStyle: {
4401
+ backgroundColor: "#fff"
4402
+ }
4353
4403
  })));
4354
4404
  };
4355
4405
 
@@ -4367,8 +4417,8 @@ const CitizenVendorApp = () => {
4367
4417
  icon: HomeIcon,
4368
4418
  path: "/digit-ui/citizen"
4369
4419
  }, {
4370
- label: t("WT_MODULE_NAME"),
4371
- path: `${path}/wt-Vendor`
4420
+ label: t("CITIZEN_VENDOR"),
4421
+ path: `${path}/citizen-Vendor`
4372
4422
  }];
4373
4423
  if (pathname.includes("/inbox")) {
4374
4424
  let label = "ES_COMMON_INBOX";
@@ -4596,8 +4646,8 @@ const CitizenVendorApp = () => {
4596
4646
  to: {
4597
4647
  pathname: `/digit-ui/citizen/login`,
4598
4648
  state: {
4599
- from: `${path}/wt-Vendor`,
4600
- role: "WT_VENDOR"
4649
+ from: `${path}`,
4650
+ role: "CITIZEN_VENDOR"
4601
4651
  }
4602
4652
  }
4603
4653
  }),
@@ -4920,7 +4970,7 @@ const EditVendorDetails = props => {
4920
4970
  });
4921
4971
  }
4922
4972
  if (selectedAction === "ADD_VEHICLE") {
4923
- return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(CardText, null, t(`ES_FSM_REGISTRY_SELECT_VEHICLE`)), /*#__PURE__*/React.createElement(Dropdown$3, {
4973
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(CardText, null, t(`ES_FSM_REGISTRY_SELECT_VEHICLE`)), /*#__PURE__*/React.createElement(Dropdown$2, {
4924
4974
  t: t,
4925
4975
  option: vehicles,
4926
4976
  value: selectedOption,
@@ -4930,7 +4980,7 @@ const EditVendorDetails = props => {
4930
4980
  }));
4931
4981
  }
4932
4982
  if (selectedAction === "ADD_DRIVER") {
4933
- return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(CardText, null, t(`ES_FSM_REGISTRY_SELECT_DRIVER`)), /*#__PURE__*/React.createElement(Dropdown$3, {
4983
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(CardText, null, t(`ES_FSM_REGISTRY_SELECT_DRIVER`)), /*#__PURE__*/React.createElement(Dropdown$2, {
4934
4984
  t: t,
4935
4985
  option: drivers,
4936
4986
  value: selectedOption,
@@ -5187,15 +5237,13 @@ const EditVendorDetails = props => {
5187
5237
  }))) : /*#__PURE__*/React.createElement(Loader, null));
5188
5238
  };
5189
5239
 
5190
- const {
5191
- DatePicker,
5192
- Dropdown
5193
- } = require("@djb25/digit-ui-react-components");
5194
5240
  const VendorConfig = (t, disabled = false, formData = {}) => {
5195
5241
  var _formData$serviceType;
5196
5242
  const isEkyc = (formData === null || formData === void 0 ? void 0 : (_formData$serviceType = formData.serviceType) === null || _formData$serviceType === void 0 ? void 0 : _formData$serviceType.code) === "EKYC";
5197
5243
  return [{
5198
5244
  head: "ES_VRNDOR_NEW_VENDOR_DETAILS",
5245
+ isCollapsible: true,
5246
+ isDefaultOpen: true,
5199
5247
  body: [{
5200
5248
  label: "ES_FSM_REGISTRY_NEW_VENDOR_NAME",
5201
5249
  isMandatory: true,
@@ -5275,7 +5323,7 @@ const VendorConfig = (t, disabled = false, formData = {}) => {
5275
5323
  validation: {
5276
5324
  required: true
5277
5325
  },
5278
- component: (props, customProps) => /*#__PURE__*/React.createElement(DatePicker, Object.assign({
5326
+ component: (props, customProps) => /*#__PURE__*/React.createElement(DatePicker$4, Object.assign({
5279
5327
  onChange: props.onChange,
5280
5328
  date: props.value
5281
5329
  }, customProps))
@@ -5290,7 +5338,7 @@ const VendorConfig = (t, disabled = false, formData = {}) => {
5290
5338
  validation: {
5291
5339
  required: true
5292
5340
  },
5293
- component: (props, customProps) => /*#__PURE__*/React.createElement(DatePicker, Object.assign({
5341
+ component: (props, customProps) => /*#__PURE__*/React.createElement(DatePicker$4, Object.assign({
5294
5342
  onChange: props.onChange,
5295
5343
  date: props.value
5296
5344
  }, customProps))
@@ -5301,12 +5349,6 @@ const VendorConfig = (t, disabled = false, formData = {}) => {
5301
5349
  type: "component",
5302
5350
  key: "zoneIds",
5303
5351
  component: "SelectEkycZones"
5304
- }, {
5305
- label: "ES_VENDOR_CLUSTER",
5306
- isMandatory: true,
5307
- type: "component",
5308
- key: "clusterIds",
5309
- component: "SelectEkycClusters"
5310
5352
  }, {
5311
5353
  label: "ES_FSM_REGISTRY_NEW_OWNER_NAME",
5312
5354
  isMandatory: true,
@@ -5320,17 +5362,6 @@ const VendorConfig = (t, disabled = false, formData = {}) => {
5320
5362
  error: t("FSM_REGISTRY_INVALID_NAME"),
5321
5363
  className: "payment-form-text-input-correction"
5322
5364
  }
5323
- }, {
5324
- label: "ES_FSM_REGISTRY_NEW_FATHER_NAME",
5325
- isMandatory: true,
5326
- type: "text",
5327
- populators: {
5328
- name: "fatherOrHusbandName",
5329
- validation: {
5330
- required: true
5331
- },
5332
- className: "payment-form-text-input-correction"
5333
- }
5334
5365
  }, {
5335
5366
  label: "ES_FSM_REGISTRY_NEW_GENDER",
5336
5367
  isMandatory: true,
@@ -5361,113 +5392,25 @@ const VendorConfig = (t, disabled = false, formData = {}) => {
5361
5392
  validation: {
5362
5393
  required: true
5363
5394
  },
5364
- component: (props, customProps) => /*#__PURE__*/React.createElement(DatePicker, Object.assign({
5395
+ component: (props, customProps) => /*#__PURE__*/React.createElement(DatePicker$4, Object.assign({
5365
5396
  onChange: props.onChange,
5366
5397
  date: props.value
5367
5398
  }, customProps, {
5368
5399
  max: convertEpochToDate(new Date().setFullYear(new Date().getFullYear()))
5369
5400
  }))
5370
5401
  }
5371
- }, {
5372
- label: "ES_FSM_REGISTRY_NEW_RELATIONSHIP",
5373
- isMandatory: true,
5374
- type: "component",
5375
- key: "relationship",
5376
- component: "SelectEkycDropdown",
5377
- populators: {
5378
- name: "relationship",
5379
- options: [{
5380
- code: "FATHER",
5381
- name: "ES_COMMON_RELATION_FATHER"
5382
- }, {
5383
- code: "HUSBAND",
5384
- name: "ES_COMMON_RELATION_HUSBAND"
5385
- }, {
5386
- code: "OTHER",
5387
- name: "ES_COMMON_RELATION_OTHER"
5388
- }],
5389
- optionsKey: "name"
5390
- }
5391
5402
  }] : [])]
5392
5403
  }, {
5393
- head: "ES_FSM_REGISTRY_NEW_ADDRESS_DETAILS",
5404
+ isCreateConnection: true,
5405
+ className: "new-application-card",
5394
5406
  body: [{
5395
- label: "HOUSE_NO",
5396
- isMandatory: false,
5397
- type: "text",
5398
- key: "doorNo",
5399
- populators: {
5400
- name: "doorNo",
5401
- defaultValue: "",
5402
- className: "payment-form-text-input-correction"
5403
- }
5404
- }, {
5405
- label: "ES_FSM_REGISTRY_NEW_PLOT",
5406
- isMandatory: false,
5407
- type: "text",
5408
- key: "plotNo",
5409
- populators: {
5410
- name: "plotNo",
5411
- defaultValue: "",
5412
- className: "payment-form-text-input-correction"
5413
- }
5414
- }, {
5415
- label: "ES_FSM_REGISTRY_NEW_BUILDING_NAME",
5416
- isMandatory: false,
5417
- type: "text",
5418
- key: "buildingName",
5419
- populators: {
5420
- name: "buildingName",
5421
- defaultValue: "",
5422
- className: "payment-form-text-input-correction"
5423
- }
5424
- }, {
5425
- label: "ES_FSM_REGISTRY_NEW_STREET",
5426
- isMandatory: false,
5427
- type: "text",
5428
- key: "street",
5429
- populators: {
5430
- name: "street",
5431
- defaultValue: "",
5432
- className: "payment-form-text-input-correction"
5433
- }
5434
- }, {
5435
- label: "ES_FSM_REGISTRY_NEW_PINCODE",
5436
- isMandatory: false,
5437
- type: "text",
5438
- key: "pincode",
5439
- populators: {
5440
- name: "pincode",
5441
- validation: {
5442
- required: false,
5443
- pattern: /^[1-9][0-9]{5}$/
5444
- },
5445
- error: t("FSM_REGISTRY_INVALID_PINCODE"),
5446
- defaultValue: "",
5447
- className: "payment-form-text-input-correction"
5448
- }
5449
- }, {
5450
- route: "address",
5451
- component: "VendorSelectAddress",
5407
+ type: "component",
5408
+ key: "propertyAddress",
5409
+ component: "CPTPropertyLocationDetails",
5452
5410
  withoutLabel: true,
5453
- texts: {
5454
- headerCaption: "CS_FILE_APPLICATION_PROPERTY_LOCATION_LABEL",
5455
- header: "CS_FILE_APPLICATION_PROPERTY_LOCATION_ADDRESS_TEXT",
5456
- cardText: "CS_FILE_APPLICATION_PROPERTY_LOCATION_CITY_MOHALLA_TEXT",
5457
- submitBarLabel: "CS_COMMON_NEXT"
5458
- },
5459
- key: "address",
5460
- isMandatory: true,
5461
- type: "component"
5462
- }, {
5463
- label: "ES_FSM_REGISTRY_NEW_LANDMARK",
5464
- isMandatory: false,
5465
- type: "text",
5466
- key: "landmark",
5467
- populators: {
5468
- name: "landmark",
5469
- defaultValue: "",
5470
- className: "payment-form-text-input-correction"
5411
+ props: {
5412
+ hidePropertySearch: true,
5413
+ hideZRO: true
5471
5414
  }
5472
5415
  }]
5473
5416
  }];
@@ -5478,14 +5421,12 @@ const AddVendor = ({
5478
5421
  heading
5479
5422
  }) => {
5480
5423
  const tenantId = Digit.ULBService.getCurrentTenantId();
5481
- const stateId = Digit.ULBService.getStateId();
5482
5424
  const {
5483
5425
  t
5484
5426
  } = useTranslation();
5485
5427
  const history = useHistory();
5486
5428
  const [currentStep, setCurrentStep] = useState(1);
5487
5429
  const [showToast, setShowToast] = useState(null);
5488
- const [canSubmit, setCanSubmit] = useState(false);
5489
5430
  const [, setMutationHappened] = Digit.Hooks.useSessionStorage("FSM_MUTATION_HAPPENED", false);
5490
5431
  const [,, clearError] = Digit.Hooks.useSessionStorage("FSM_ERROR_DATA", false);
5491
5432
  const [,, clearSuccessData] = Digit.Hooks.useSessionStorage("FSM_MUTATION_SUCCESS_DATA", false);
@@ -5512,23 +5453,26 @@ const AddVendor = ({
5512
5453
  const [formData, setFormData] = useState(defaultValues);
5513
5454
  const Config = VendorConfig(t, false, formData);
5514
5455
  const onFormValueChange = (setValue, data) => {
5515
- var _data$serviceType, _formData$serviceType, _data$serviceType2, _data$serviceType3, _data$address, _data$address2;
5516
- if ((data === null || data === void 0 ? void 0 : (_data$serviceType = data.serviceType) === null || _data$serviceType === void 0 ? void 0 : _data$serviceType.code) !== (formData === null || formData === void 0 ? void 0 : (_formData$serviceType = formData.serviceType) === null || _formData$serviceType === void 0 ? void 0 : _formData$serviceType.code) || JSON.stringify(data === null || data === void 0 ? void 0 : data.zoneIds) !== JSON.stringify(formData === null || formData === void 0 ? void 0 : formData.zoneIds)) {
5517
- setFormData(data);
5518
- }
5519
- const isEkyc = (data === null || data === void 0 ? void 0 : (_data$serviceType2 = data.serviceType) === null || _data$serviceType2 === void 0 ? void 0 : _data$serviceType2.code) === "EKYC";
5520
- const isVendorDetailsFilled = (data === null || data === void 0 ? void 0 : data.vendorName) && (data === null || data === void 0 ? void 0 : data.phone) && (data === null || data === void 0 ? void 0 : (_data$serviceType3 = data.serviceType) === null || _data$serviceType3 === void 0 ? void 0 : _data$serviceType3.code);
5521
- const isAddressFilled = (data === null || data === void 0 ? void 0 : (_data$address = data.address) === null || _data$address === void 0 ? void 0 : _data$address.city) && (data === null || data === void 0 ? void 0 : (_data$address2 = data.address) === null || _data$address2 === void 0 ? void 0 : _data$address2.locality);
5522
- let isEkycFieldsFilled = true;
5523
- if (isEkyc) {
5524
- var _data$zoneIds, _data$clusterIds;
5525
- isEkycFieldsFilled = (data === null || data === void 0 ? void 0 : data.ownerName) && (data === null || data === void 0 ? void 0 : data.contractStartDate) && (data === null || data === void 0 ? void 0 : data.contractEndDate) && (data === null || data === void 0 ? void 0 : (_data$zoneIds = data.zoneIds) === null || _data$zoneIds === void 0 ? void 0 : _data$zoneIds.length) > 0 && (data === null || data === void 0 ? void 0 : (_data$clusterIds = data.clusterIds) === null || _data$clusterIds === void 0 ? void 0 : _data$clusterIds.length) > 0 && (data === null || data === void 0 ? void 0 : data.fatherOrHusbandName) && (data === null || data === void 0 ? void 0 : data.gender) && (data === null || data === void 0 ? void 0 : data.dob) && (data === null || data === void 0 ? void 0 : data.relationship);
5456
+ var _data$zoneIds, _data$serviceType, _formData$serviceType, _data$serviceType2;
5457
+ const currentZoneCodes = (data === null || data === void 0 ? void 0 : (_data$zoneIds = data.zoneIds) === null || _data$zoneIds === void 0 ? void 0 : _data$zoneIds.map(item => {
5458
+ var _item$;
5459
+ return item === null || item === void 0 ? void 0 : (_item$ = item[1]) === null || _item$ === void 0 ? void 0 : _item$.code;
5460
+ })) || [];
5461
+ const previousZoneCodes = (formData === null || formData === void 0 ? void 0 : formData.zoneIds) || [];
5462
+ const zoneChanged = currentZoneCodes.join(",") !== previousZoneCodes.join(",");
5463
+ if ((data === null || data === void 0 ? void 0 : (_data$serviceType = data.serviceType) === null || _data$serviceType === void 0 ? void 0 : _data$serviceType.code) !== (formData === null || formData === void 0 ? void 0 : (_formData$serviceType = formData.serviceType) === null || _formData$serviceType === void 0 ? void 0 : _formData$serviceType.code) || zoneChanged) {
5464
+ setFormData(prev => ({
5465
+ ...prev,
5466
+ serviceType: data === null || data === void 0 ? void 0 : data.serviceType
5467
+ }));
5526
5468
  }
5527
- if (isVendorDetailsFilled && isAddressFilled && isEkycFieldsFilled) {
5528
- setCanSubmit(true);
5529
- } else {
5530
- setCanSubmit(false);
5469
+ if (zoneChanged) {
5470
+ setFormData(prev => ({
5471
+ ...prev,
5472
+ zoneIds: currentZoneCodes
5473
+ }));
5531
5474
  }
5475
+ const isVendorDetailsFilled = (data === null || data === void 0 ? void 0 : data.vendorName) && (data === null || data === void 0 ? void 0 : data.phone) && (data === null || data === void 0 ? void 0 : (_data$serviceType2 = data.serviceType) === null || _data$serviceType2 === void 0 ? void 0 : _data$serviceType2.code);
5532
5476
  if (isVendorDetailsFilled) {
5533
5477
  if (currentStep === 1) {
5534
5478
  setCurrentStep(2);
@@ -5563,22 +5507,24 @@ const AddVendor = ({
5563
5507
  setShowToast(null);
5564
5508
  };
5565
5509
  const onSubmit = data => {
5566
- var _mergedData$street, _mergedData$doorNo, _mergedData$plotNo, _mergedData$landmark, _mergedData$address, _mergedData$address$c, _mergedData$address2, _mergedData$address2$, _mergedData$address3, _mergedData$address3$, _mergedData$address4, _mergedData$address4$, _mergedData$buildingN, _mergedData$address5, _mergedData$address5$, _mergedData$address6, _mergedData$address6$, _mergedData$address7, _mergedData$address7$, _mergedData$serviceTy, _mergedData$address8, _mergedData$address9, _mergedData$relations, _mergedData$gender, _mergedData$serviceTy2;
5510
+ var _address$city, _address$city2, _address$city3, _address$city4, _address$locality, _address$locality2, _mergedData$plotNo, _mergedData$buildingN, _mergedData$serviceTy, _mergedData$address, _mergedData$address2, _mergedData$relations, _mergedData$gender, _mergedData$serviceTy2;
5511
+ console.log("-=-=-=-=-=-==-", data);
5567
5512
  const mergedData = data;
5513
+ const address = mergedData === null || mergedData === void 0 ? void 0 : mergedData.propertyAddress;
5514
+ const pincode = address === null || address === void 0 ? void 0 : address.pincode;
5515
+ const street = address === null || address === void 0 ? void 0 : address.streetName;
5516
+ const doorNo = address === null || address === void 0 ? void 0 : address.houseNo;
5517
+ const landmark = address === null || address === void 0 ? void 0 : address.landmark;
5518
+ const city = address === null || address === void 0 ? void 0 : (_address$city = address.city) === null || _address$city === void 0 ? void 0 : _address$city.name;
5519
+ const state = address === null || address === void 0 ? void 0 : (_address$city2 = address.city) === null || _address$city2 === void 0 ? void 0 : _address$city2.name;
5520
+ const district = address === null || address === void 0 ? void 0 : (_address$city3 = address.city) === null || _address$city3 === void 0 ? void 0 : _address$city3.name;
5521
+ const region = address === null || address === void 0 ? void 0 : (_address$city4 = address.city) === null || _address$city4 === void 0 ? void 0 : _address$city4.name;
5522
+ const localityCode = address === null || address === void 0 ? void 0 : (_address$locality = address.locality) === null || _address$locality === void 0 ? void 0 : _address$locality.code;
5523
+ const localityName = address === null || address === void 0 ? void 0 : (_address$locality2 = address.locality) === null || _address$locality2 === void 0 ? void 0 : _address$locality2.name;
5524
+ const localityArea = address === null || address === void 0 ? void 0 : address.subLocality;
5568
5525
  const name = mergedData === null || mergedData === void 0 ? void 0 : mergedData.vendorName;
5569
- const pincode = mergedData === null || mergedData === void 0 ? void 0 : mergedData.pincode;
5570
- const street = mergedData === null || mergedData === void 0 ? void 0 : (_mergedData$street = mergedData.street) === null || _mergedData$street === void 0 ? void 0 : _mergedData$street.trim();
5571
- const doorNo = mergedData === null || mergedData === void 0 ? void 0 : (_mergedData$doorNo = mergedData.doorNo) === null || _mergedData$doorNo === void 0 ? void 0 : _mergedData$doorNo.trim();
5572
5526
  const plotNo = mergedData === null || mergedData === void 0 ? void 0 : (_mergedData$plotNo = mergedData.plotNo) === null || _mergedData$plotNo === void 0 ? void 0 : _mergedData$plotNo.trim();
5573
- const landmark = mergedData === null || mergedData === void 0 ? void 0 : (_mergedData$landmark = mergedData.landmark) === null || _mergedData$landmark === void 0 ? void 0 : _mergedData$landmark.trim();
5574
- const city = mergedData === null || mergedData === void 0 ? void 0 : (_mergedData$address = mergedData.address) === null || _mergedData$address === void 0 ? void 0 : (_mergedData$address$c = _mergedData$address.city) === null || _mergedData$address$c === void 0 ? void 0 : _mergedData$address$c.name;
5575
- const state = mergedData === null || mergedData === void 0 ? void 0 : (_mergedData$address2 = mergedData.address) === null || _mergedData$address2 === void 0 ? void 0 : (_mergedData$address2$ = _mergedData$address2.city) === null || _mergedData$address2$ === void 0 ? void 0 : _mergedData$address2$.state;
5576
- const district = mergedData === null || mergedData === void 0 ? void 0 : (_mergedData$address3 = mergedData.address) === null || _mergedData$address3 === void 0 ? void 0 : (_mergedData$address3$ = _mergedData$address3.city) === null || _mergedData$address3$ === void 0 ? void 0 : _mergedData$address3$.name;
5577
- const region = mergedData === null || mergedData === void 0 ? void 0 : (_mergedData$address4 = mergedData.address) === null || _mergedData$address4 === void 0 ? void 0 : (_mergedData$address4$ = _mergedData$address4.city) === null || _mergedData$address4$ === void 0 ? void 0 : _mergedData$address4$.name;
5578
5527
  const buildingName = mergedData === null || mergedData === void 0 ? void 0 : (_mergedData$buildingN = mergedData.buildingName) === null || _mergedData$buildingN === void 0 ? void 0 : _mergedData$buildingN.trim();
5579
- const localityCode = mergedData === null || mergedData === void 0 ? void 0 : (_mergedData$address5 = mergedData.address) === null || _mergedData$address5 === void 0 ? void 0 : (_mergedData$address5$ = _mergedData$address5.locality) === null || _mergedData$address5$ === void 0 ? void 0 : _mergedData$address5$.code;
5580
- const localityName = mergedData === null || mergedData === void 0 ? void 0 : (_mergedData$address6 = mergedData.address) === null || _mergedData$address6 === void 0 ? void 0 : (_mergedData$address6$ = _mergedData$address6.locality) === null || _mergedData$address6$ === void 0 ? void 0 : _mergedData$address6$.name;
5581
- const localityArea = mergedData === null || mergedData === void 0 ? void 0 : (_mergedData$address7 = mergedData.address) === null || _mergedData$address7 === void 0 ? void 0 : (_mergedData$address7$ = _mergedData$address7.locality) === null || _mergedData$address7$ === void 0 ? void 0 : _mergedData$address7$.area;
5582
5528
  const emailId = mergedData === null || mergedData === void 0 ? void 0 : mergedData.emailId;
5583
5529
  const phone = mergedData === null || mergedData === void 0 ? void 0 : mergedData.phone;
5584
5530
  const isEkyc = (mergedData === null || mergedData === void 0 ? void 0 : (_mergedData$serviceTy = mergedData.serviceType) === null || _mergedData$serviceTy === void 0 ? void 0 : _mergedData$serviceTy.code) === "EKYC";
@@ -5606,9 +5552,13 @@ const AddVendor = ({
5606
5552
  label: "Locality",
5607
5553
  area: localityArea || ""
5608
5554
  },
5555
+ ward: wardCode ? {
5556
+ code: wardCode,
5557
+ name: wardName
5558
+ } : undefined,
5609
5559
  geoLocation: {
5610
- latitude: (mergedData === null || mergedData === void 0 ? void 0 : (_mergedData$address8 = mergedData.address) === null || _mergedData$address8 === void 0 ? void 0 : _mergedData$address8.latitude) || 28.6139,
5611
- longitude: (mergedData === null || mergedData === void 0 ? void 0 : (_mergedData$address9 = mergedData.address) === null || _mergedData$address9 === void 0 ? void 0 : _mergedData$address9.longitude) || 77.2090
5560
+ latitude: (mergedData === null || mergedData === void 0 ? void 0 : (_mergedData$address = mergedData.address) === null || _mergedData$address === void 0 ? void 0 : _mergedData$address.latitude) || 28.6139,
5561
+ longitude: (mergedData === null || mergedData === void 0 ? void 0 : (_mergedData$address2 = mergedData.address) === null || _mergedData$address2 === void 0 ? void 0 : _mergedData$address2.longitude) || 77.209
5612
5562
  }
5613
5563
  },
5614
5564
  owner: {
@@ -5632,12 +5582,19 @@ const AddVendor = ({
5632
5582
  var _mergedData$zoneIds, _mergedData$clusterId;
5633
5583
  vendorData = {
5634
5584
  ...vendorData,
5635
- zoneIds: (mergedData === null || mergedData === void 0 ? void 0 : (_mergedData$zoneIds = mergedData.zoneIds) === null || _mergedData$zoneIds === void 0 ? void 0 : _mergedData$zoneIds.map(z => z.code)) || [],
5636
- clusterIds: (mergedData === null || mergedData === void 0 ? void 0 : (_mergedData$clusterId = mergedData.clusterIds) === null || _mergedData$clusterId === void 0 ? void 0 : _mergedData$clusterId.map(c => c.code)) || [],
5585
+ zoneIds: (mergedData === null || mergedData === void 0 ? void 0 : (_mergedData$zoneIds = mergedData.zoneIds) === null || _mergedData$zoneIds === void 0 ? void 0 : _mergedData$zoneIds.map(z => {
5586
+ var _z$;
5587
+ return z === null || z === void 0 ? void 0 : (_z$ = z[1]) === null || _z$ === void 0 ? void 0 : _z$.code;
5588
+ })) || [],
5589
+ clusterIds: (mergedData === null || mergedData === void 0 ? void 0 : (_mergedData$clusterId = mergedData.clusterIds) === null || _mergedData$clusterId === void 0 ? void 0 : _mergedData$clusterId.map(c => {
5590
+ var _c$;
5591
+ return c === null || c === void 0 ? void 0 : (_c$ = c[1]) === null || _c$ === void 0 ? void 0 : _c$.code;
5592
+ })) || [],
5637
5593
  contractStartDate: mergedData.contractStartDate ? new Date(mergedData.contractStartDate).getTime() : null,
5638
5594
  contractEndDate: mergedData.contractEndDate ? new Date(mergedData.contractEndDate).getTime() : null
5639
5595
  };
5640
5596
  }
5597
+ console.log(vendorData);
5641
5598
  const payload = {
5642
5599
  vendor: vendorData
5643
5600
  };
@@ -5689,19 +5646,14 @@ const AddVendor = ({
5689
5646
  overflowY: "auto"
5690
5647
  }
5691
5648
  }, /*#__PURE__*/React.createElement(FormComposer, {
5649
+ config: Config,
5650
+ userType: "employee",
5651
+ onFormValueChange: onFormValueChange,
5692
5652
  label: t("ES_COMMON_APPLICATION_SUBMIT"),
5693
- config: Config.filter(i => !i.hideInEmployee).map(config => ({
5694
- ...config,
5695
- isCollapsible: true,
5696
- isDefaultOpen: true,
5697
- body: config.body.filter(a => !a.hideInEmployee)
5698
- })),
5699
5653
  onSubmit: onSubmit,
5700
5654
  defaultValues: defaultValues,
5701
- onFormValueChange: onFormValueChange,
5702
- noBreakLine: true,
5703
5655
  noCard: true,
5704
- isDisabled: !canSubmit
5656
+ noBreakLine: true
5705
5657
  }), showToast && /*#__PURE__*/React.createElement(Toast, {
5706
5658
  error: showToast.key === "error",
5707
5659
  label: t(showToast.key === "success" ? `ES_FSM_REGISTRY_${showToast.action}_SUCCESS` : showToast.action),
@@ -5710,8 +5662,8 @@ const AddVendor = ({
5710
5662
  };
5711
5663
 
5712
5664
  const {
5713
- Dropdown: Dropdown$1,
5714
- DatePicker: DatePicker$1
5665
+ Dropdown,
5666
+ DatePicker
5715
5667
  } = require("@djb25/digit-ui-react-components");
5716
5668
  const SupervisorConfig = (t, agencies = [], reportingManagers = [], disabled = false) => {
5717
5669
  return [{
@@ -5763,18 +5715,6 @@ const SupervisorConfig = (t, agencies = [], reportingManagers = [], disabled = f
5763
5715
  defaultValue: "",
5764
5716
  className: "payment-form-text-input-correction"
5765
5717
  }
5766
- }, {
5767
- label: t("ES_VENDOR_SUPERVISOR_EMPLOYEE_ID"),
5768
- isMandatory: true,
5769
- type: "text",
5770
- populators: {
5771
- name: "employeeId",
5772
- validation: {
5773
- required: true
5774
- },
5775
- defaultValue: "",
5776
- className: "payment-form-text-input-correction"
5777
- }
5778
5718
  }, {
5779
5719
  label: t("ES_VENDOR_SUPERVISOR_GENDER"),
5780
5720
  isMandatory: true,
@@ -5822,7 +5762,7 @@ const SupervisorConfig = (t, agencies = [], reportingManagers = [], disabled = f
5822
5762
  validation: {
5823
5763
  required: true
5824
5764
  },
5825
- component: (props, customProps) => /*#__PURE__*/React.createElement(DatePicker$1, Object.assign({
5765
+ component: (props, customProps) => /*#__PURE__*/React.createElement(DatePicker, Object.assign({
5826
5766
  onChange: props.onChange,
5827
5767
  date: props.value
5828
5768
  }, customProps))
@@ -5899,7 +5839,6 @@ const AddSupervisor = ({
5899
5839
  } = useLocation();
5900
5840
  const queryParams = new URLSearchParams(search);
5901
5841
  const vendorIdParam = queryParams.get("vendorId");
5902
- const vendorId = vendorIdParam || (userInfo === null || userInfo === void 0 ? void 0 : userInfo.uuid);
5903
5842
  const Config = SupervisorConfig(t);
5904
5843
  const defaultValues = {
5905
5844
  role: {
@@ -5943,7 +5882,6 @@ const AddSupervisor = ({
5943
5882
  },
5944
5883
  supervisor: {
5945
5884
  tenantId: tenantId,
5946
- vendorId: vendorId,
5947
5885
  assignedZoneId: (data === null || data === void 0 ? void 0 : (_data$assignedZone = data.assignedZone) === null || _data$assignedZone === void 0 ? void 0 : _data$assignedZone.code) || (data === null || data === void 0 ? void 0 : data.assignedZone) || null,
5948
5886
  description: (data === null || data === void 0 ? void 0 : data.description) || "",
5949
5887
  owner: {
@@ -6313,7 +6251,7 @@ const SupervisorDetails = props => {
6313
6251
  });
6314
6252
  }
6315
6253
  if (selectedAction === "ADD_VENDOR" || selectedAction === "EDIT_VENDOR") {
6316
- return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(CardText, null, t(`ES_FSM_REGISTRY_SELECT_VENODOR`)), /*#__PURE__*/React.createElement(Dropdown$3, {
6254
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(CardText, null, t(`ES_FSM_REGISTRY_SELECT_VENODOR`)), /*#__PURE__*/React.createElement(Dropdown$2, {
6317
6255
  t: t,
6318
6256
  option: vendors,
6319
6257
  value: selectedOption,
@@ -6657,8 +6595,8 @@ const EditSupervisor = () => {
6657
6595
  };
6658
6596
 
6659
6597
  const {
6660
- Dropdown: Dropdown$2,
6661
- DatePicker: DatePicker$2
6598
+ Dropdown: Dropdown$1,
6599
+ DatePicker: DatePicker$1
6662
6600
  } = require("@djb25/digit-ui-react-components");
6663
6601
  const SurveyorConfig = (t, agencies = [], reportingManagers = [], disabled = false) => {
6664
6602
  return [{
@@ -6699,16 +6637,6 @@ const SurveyorConfig = (t, agencies = [], reportingManagers = [], disabled = fal
6699
6637
  },
6700
6638
  error: t("ES_VENDOR_INVALID_EMAIL")
6701
6639
  }
6702
- }, {
6703
- label: "ES_VENDOR_SURVEYOR_STAFF_CODE",
6704
- isMandatory: true,
6705
- type: "text",
6706
- populators: {
6707
- name: "employeeId",
6708
- validation: {
6709
- required: true
6710
- }
6711
- }
6712
6640
  }, {
6713
6641
  label: t("ES_VENDOR_SURVEYOR_GENDER"),
6714
6642
  isMandatory: true,
@@ -6756,7 +6684,7 @@ const SurveyorConfig = (t, agencies = [], reportingManagers = [], disabled = fal
6756
6684
  validation: {
6757
6685
  required: true
6758
6686
  },
6759
- component: (props, customProps) => /*#__PURE__*/React.createElement(DatePicker$2, Object.assign({
6687
+ component: (props, customProps) => /*#__PURE__*/React.createElement(DatePicker$1, Object.assign({
6760
6688
  onChange: props.onChange,
6761
6689
  date: props.value
6762
6690
  }, customProps))
@@ -6825,7 +6753,7 @@ const AddSurveyor = ({
6825
6753
  setShowToast(null);
6826
6754
  };
6827
6755
  const onSubmit = data => {
6828
- var _userInfo$roles, _Digit$UserService$ge2, _data$agencyName, _data$agencyName2, _data$reportingManage, _data$reportingManage2, _data$relationship, _data$gender;
6756
+ var _userInfo$roles, _Digit$UserService$ge2, _data$relationship, _data$gender;
6829
6757
  const isSupervisor = userInfo === null || userInfo === void 0 ? void 0 : (_userInfo$roles = userInfo.roles) === null || _userInfo$roles === void 0 ? void 0 : _userInfo$roles.some(role => role.code === "EKYC_SUPERVISOR");
6830
6758
  const formData = {
6831
6759
  RequestInfo: {
@@ -6849,8 +6777,6 @@ const AddSurveyor = ({
6849
6777
  },
6850
6778
  surveyor: {
6851
6779
  tenantId: tenantId,
6852
- vendorId: vendorIdParam || (data === null || data === void 0 ? void 0 : (_data$agencyName = data.agencyName) === null || _data$agencyName === void 0 ? void 0 : _data$agencyName.code) || (data === null || data === void 0 ? void 0 : (_data$agencyName2 = data.agencyName) === null || _data$agencyName2 === void 0 ? void 0 : _data$agencyName2.id) || (userInfo === null || userInfo === void 0 ? void 0 : userInfo.uuid),
6853
- supervisorId: (data === null || data === void 0 ? void 0 : (_data$reportingManage = data.reportingManager) === null || _data$reportingManage === void 0 ? void 0 : _data$reportingManage.code) || (data === null || data === void 0 ? void 0 : (_data$reportingManage2 = data.reportingManager) === null || _data$reportingManage2 === void 0 ? void 0 : _data$reportingManage2.id) || null,
6854
6780
  description: (data === null || data === void 0 ? void 0 : data.description) || "",
6855
6781
  additionalDetails: {
6856
6782
  serviceType: "ekyc"
@@ -7218,7 +7144,7 @@ const SurveyorDetails = props => {
7218
7144
  });
7219
7145
  }
7220
7146
  if (selectedAction === "ADD_VENDOR" || selectedAction === "EDIT_VENDOR") {
7221
- return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(CardText, null, t(`ES_FSM_REGISTRY_SELECT_VENODOR`)), /*#__PURE__*/React.createElement(Dropdown$3, {
7147
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(CardText, null, t(`ES_FSM_REGISTRY_SELECT_VENODOR`)), /*#__PURE__*/React.createElement(Dropdown$2, {
7222
7148
  t: t,
7223
7149
  option: vendors,
7224
7150
  value: selectedOption,
@@ -7947,7 +7873,7 @@ const VENDORCreate = ({
7947
7873
  };
7948
7874
 
7949
7875
  const {
7950
- DatePicker: DatePicker$3
7876
+ DatePicker: DatePicker$2
7951
7877
  } = require("@djb25/digit-ui-react-components");
7952
7878
  const DriverConfig = (t, disabled = false) => {
7953
7879
  return [{
@@ -8041,7 +7967,7 @@ const DriverConfig = (t, disabled = false) => {
8041
7967
  validation: {
8042
7968
  required: true
8043
7969
  },
8044
- component: (props, customProps) => /*#__PURE__*/React.createElement(DatePicker$3, Object.assign({
7970
+ component: (props, customProps) => /*#__PURE__*/React.createElement(DatePicker$2, Object.assign({
8045
7971
  onChange: props.onChange,
8046
7972
  date: props.value
8047
7973
  }, customProps, {
@@ -8566,7 +8492,7 @@ const DriverDetails = () => {
8566
8492
  });
8567
8493
  }
8568
8494
  if (selectedAction === "ADD_VENDOR") {
8569
- return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(CardText, null, t(`ES_FSM_REGISTRY_SELECT_VENODOR`)), /*#__PURE__*/React.createElement(Dropdown$3, {
8495
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(CardText, null, t(`ES_FSM_REGISTRY_SELECT_VENODOR`)), /*#__PURE__*/React.createElement(Dropdown$2, {
8570
8496
  t: t,
8571
8497
  option: vendors,
8572
8498
  value: selectedOption,
@@ -8576,7 +8502,7 @@ const DriverDetails = () => {
8576
8502
  }));
8577
8503
  }
8578
8504
  if (selectedAction === "EDIT_VENDOR") {
8579
- return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(CardText, null, t(`ES_FSM_REGISTRY_SELECT_VENODOR`)), /*#__PURE__*/React.createElement(Dropdown$3, {
8505
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(CardText, null, t(`ES_FSM_REGISTRY_SELECT_VENODOR`)), /*#__PURE__*/React.createElement(Dropdown$2, {
8580
8506
  t: t,
8581
8507
  option: vendors,
8582
8508
  value: selectedOption,
@@ -8690,7 +8616,7 @@ const DriverDetails = () => {
8690
8616
  };
8691
8617
 
8692
8618
  const {
8693
- DatePicker: DatePicker$4
8619
+ DatePicker: DatePicker$3
8694
8620
  } = require("@djb25/digit-ui-react-components");
8695
8621
  const VehicleConfig = (t, disabled = false) => {
8696
8622
  return [{
@@ -8746,7 +8672,7 @@ const VehicleConfig = (t, disabled = false) => {
8746
8672
  validation: {
8747
8673
  required: true
8748
8674
  },
8749
- component: (props, customProps) => /*#__PURE__*/React.createElement(DatePicker$4, Object.assign({
8675
+ component: (props, customProps) => /*#__PURE__*/React.createElement(DatePicker$3, Object.assign({
8750
8676
  onChange: props.onChange,
8751
8677
  date: props.value
8752
8678
  }, customProps))
@@ -8761,7 +8687,7 @@ const VehicleConfig = (t, disabled = false) => {
8761
8687
  validation: {
8762
8688
  required: true
8763
8689
  },
8764
- component: (props, customProps) => /*#__PURE__*/React.createElement(DatePicker$4, Object.assign({
8690
+ component: (props, customProps) => /*#__PURE__*/React.createElement(DatePicker$3, Object.assign({
8765
8691
  onChange: props.onChange,
8766
8692
  date: props.value
8767
8693
  }, customProps))
@@ -8776,7 +8702,7 @@ const VehicleConfig = (t, disabled = false) => {
8776
8702
  validation: {
8777
8703
  required: true
8778
8704
  },
8779
- component: (props, customProps) => /*#__PURE__*/React.createElement(DatePicker$4, Object.assign({
8705
+ component: (props, customProps) => /*#__PURE__*/React.createElement(DatePicker$3, Object.assign({
8780
8706
  onChange: props.onChange,
8781
8707
  date: props.value
8782
8708
  }, customProps))
@@ -8791,7 +8717,7 @@ const VehicleConfig = (t, disabled = false) => {
8791
8717
  validation: {
8792
8718
  required: true
8793
8719
  },
8794
- component: (props, customProps) => /*#__PURE__*/React.createElement(DatePicker$4, Object.assign({
8720
+ component: (props, customProps) => /*#__PURE__*/React.createElement(DatePicker$3, Object.assign({
8795
8721
  onChange: props.onChange,
8796
8722
  date: props.value
8797
8723
  }, customProps))
@@ -8846,7 +8772,7 @@ const VehicleConfig = (t, disabled = false) => {
8846
8772
  validation: {
8847
8773
  required: true
8848
8774
  },
8849
- component: (props, customProps) => /*#__PURE__*/React.createElement(DatePicker$4, Object.assign({
8775
+ component: (props, customProps) => /*#__PURE__*/React.createElement(DatePicker$3, Object.assign({
8850
8776
  onChange: props.onChange,
8851
8777
  date: props.value
8852
8778
  }, customProps, {
@@ -9431,7 +9357,7 @@ const VehicleDetails = props => {
9431
9357
  });
9432
9358
  }
9433
9359
  if (selectedAction === "ADD_VENDOR") {
9434
- return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(CardText, null, t(`ES_FSM_REGISTRY_SELECT_VENODOR`)), /*#__PURE__*/React.createElement(Dropdown$3, {
9360
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(CardText, null, t(`ES_FSM_REGISTRY_SELECT_VENODOR`)), /*#__PURE__*/React.createElement(Dropdown$2, {
9435
9361
  t: t,
9436
9362
  option: vendors,
9437
9363
  value: selectedOption,
@@ -9441,7 +9367,7 @@ const VehicleDetails = props => {
9441
9367
  }));
9442
9368
  }
9443
9369
  if (selectedAction === "EDIT_VENDOR") {
9444
- return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(CardText, null, t(`ES_FSM_REGISTRY_SELECT_VENODOR`)), /*#__PURE__*/React.createElement(Dropdown$3, {
9370
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(CardText, null, t(`ES_FSM_REGISTRY_SELECT_VENODOR`)), /*#__PURE__*/React.createElement(Dropdown$2, {
9445
9371
  t: t,
9446
9372
  option: vendors,
9447
9373
  value: selectedOption,
@@ -9592,8 +9518,8 @@ const SelectEkycZones = ({
9592
9518
  var _boundaryData$egovLo, _boundaryData$egovLo$, _boundaryData$MdmsRes, _boundaryData$MdmsRes2, _boundaryData$MdmsRes3;
9593
9519
  const tenantBoundary = (boundaryData === null || boundaryData === void 0 ? void 0 : (_boundaryData$egovLo = boundaryData["egov-location"]) === null || _boundaryData$egovLo === void 0 ? void 0 : (_boundaryData$egovLo$ = _boundaryData$egovLo.TenantBoundary) === null || _boundaryData$egovLo$ === void 0 ? void 0 : _boundaryData$egovLo$[0]) || (boundaryData === null || boundaryData === void 0 ? void 0 : (_boundaryData$MdmsRes = boundaryData.MdmsRes) === null || _boundaryData$MdmsRes === void 0 ? void 0 : (_boundaryData$MdmsRes2 = _boundaryData$MdmsRes["egov-location"]) === null || _boundaryData$MdmsRes2 === void 0 ? void 0 : (_boundaryData$MdmsRes3 = _boundaryData$MdmsRes2.TenantBoundary) === null || _boundaryData$MdmsRes3 === void 0 ? void 0 : _boundaryData$MdmsRes3[0]);
9594
9520
  const boundaries = (tenantBoundary === null || tenantBoundary === void 0 ? void 0 : tenantBoundary.boundary) || (tenantBoundary === null || tenantBoundary === void 0 ? void 0 : tenantBoundary.children) || [];
9595
- if (Array.isArray(boundaries) && boundaries.length > 0) {
9596
- const zonesList = boundaries.map(b => ({
9521
+ if (Array.isArray(boundaries === null || boundaries === void 0 ? void 0 : boundaries.children) && (boundaries === null || boundaries === void 0 ? void 0 : boundaries.children.length) > 0) {
9522
+ const zonesList = boundaries === null || boundaries === void 0 ? void 0 : boundaries.children.map(b => ({
9597
9523
  code: b.code,
9598
9524
  name: b.name
9599
9525
  }));
@@ -9618,18 +9544,26 @@ const SelectEkycZones = ({
9618
9544
  }
9619
9545
  }, [boundaryData, isLoading]);
9620
9546
  const handleSelect = value => {
9621
- setSelectedZones(value);
9622
- onSelect(config.key, value);
9547
+ const extractedValue = Array.isArray(value) ? value.map(v => Array.isArray(v) ? v[1] : v).filter(Boolean) : value;
9548
+ setSelectedZones(extractedValue);
9549
+ onSelect(config.key, extractedValue);
9623
9550
  };
9624
9551
  if (isLoading) return /*#__PURE__*/React.createElement(Loader, null);
9625
9552
  return /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, t(config.label) + (config.isMandatory ? " *" : "")), /*#__PURE__*/React.createElement("div", {
9626
- className: "field"
9553
+ className: "field",
9554
+ style: {
9555
+ position: "relative",
9556
+ zIndex: 10
9557
+ }
9627
9558
  }, /*#__PURE__*/React.createElement(MultiSelectDropdown, {
9628
9559
  options: zones,
9629
9560
  selected: selectedZones,
9630
9561
  onSelect: handleSelect,
9631
9562
  optionsKey: "name",
9632
- t: t
9563
+ t: t,
9564
+ ServerStyle: {
9565
+ backgroundColor: "#fff"
9566
+ }
9633
9567
  })));
9634
9568
  };
9635
9569
 
@@ -9642,7 +9576,7 @@ const SelectEkycClusters = ({
9642
9576
  const tenantId = Digit.ULBService.getCurrentTenantId();
9643
9577
  const [clusters, setClusters] = useState([]);
9644
9578
  const [selectedClusters, setSelectedClusters] = useState(Array.isArray(formData === null || formData === void 0 ? void 0 : formData.clusterIds) ? formData.clusterIds : []);
9645
- const selectedZones = Array.isArray(formData === null || formData === void 0 ? void 0 : formData.zoneIds) ? formData.zoneIds : [];
9579
+ const selectedZones = React.useMemo(() => Array.isArray(formData === null || formData === void 0 ? void 0 : formData.zoneIds) ? formData.zoneIds : [], [formData === null || formData === void 0 ? void 0 : formData.zoneIds]);
9646
9580
  const {
9647
9581
  data: boundaryData
9648
9582
  } = Digit.Hooks.useCommonMDMS(tenantId, "egov-location", ["TenantBoundary"]);
@@ -9712,20 +9646,33 @@ const SelectEkycClusters = ({
9712
9646
  }];
9713
9647
  }
9714
9648
  }
9649
+ if (allClusters.length > 0) {
9650
+ allClusters = Array.from(new Map(allClusters.map(item => [item.code, item])).values());
9651
+ }
9715
9652
  setClusters(allClusters);
9716
9653
  }, [selectedZones, boundaryData]);
9717
9654
  const handleSelect = value => {
9718
- setSelectedClusters(value);
9719
- onSelect(config.key, value);
9655
+ const extractedValue = Array.isArray(value) ? value.map(v => Array.isArray(v) ? v[1] : v).filter(Boolean) : value;
9656
+ setSelectedClusters(extractedValue);
9657
+ onSelect(config.key, extractedValue);
9720
9658
  };
9659
+ const isDisabled = selectedZones.length === 0;
9721
9660
  return /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, t(config.label) + (config.isMandatory ? " *" : "")), /*#__PURE__*/React.createElement("div", {
9722
- className: "field"
9661
+ className: "field",
9662
+ style: {
9663
+ position: "relative",
9664
+ zIndex: 9
9665
+ }
9723
9666
  }, /*#__PURE__*/React.createElement(MultiSelectDropdown, {
9724
9667
  options: clusters,
9725
9668
  selected: selectedClusters,
9726
9669
  onSelect: handleSelect,
9727
9670
  optionsKey: "name",
9728
- t: t
9671
+ t: t,
9672
+ ServerStyle: {
9673
+ backgroundColor: "#fff"
9674
+ },
9675
+ disable: isDisabled
9729
9676
  })));
9730
9677
  };
9731
9678
 
@@ -9744,7 +9691,7 @@ const SelectEkycDropdown = ({
9744
9691
  };
9745
9692
  return /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, t(config.label)), /*#__PURE__*/React.createElement("div", {
9746
9693
  className: "field"
9747
- }, /*#__PURE__*/React.createElement(Dropdown$3, {
9694
+ }, /*#__PURE__*/React.createElement(Dropdown$2, {
9748
9695
  selected: selected,
9749
9696
  option: options,
9750
9697
  select: handleSelect,