@djb25/digit-ui-module-vendor 1.0.14 → 1.0.16

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,7 +1,7 @@
1
1
  import React, { useEffect, useMemo, useCallback, useState, Fragment as Fragment$1 } from 'react';
2
2
  import { useTranslation } from 'react-i18next';
3
3
  import { useParams, useLocation, Switch, Link, useHistory, useRouteMatch, Route, Redirect } from 'react-router-dom';
4
- import { Header, SearchForm, SearchField, Dropdown as Dropdown$2, MobileNumber, CardLabelError, DatePicker as DatePicker$3, SubmitBar, Card, Table, Loader, Toast, AppContainer, ModuleHeader, ArrowLeft, PrivateRoute, HomeIcon, PropertyHouse, EmployeeModuleCard, Stepper, FormComposer, TickMark, FormStep, CardLabel, TextInput, LabelFieldPair, UploadFile, CardSubHeader, CardText, RadioOrSelect, ShippingTruck, CheckBox, RadioButtons, CloseSvg, Localities, RemoveableTag, ActionBar, ApplyFilterBar, AddIcon, Menu, Label, LinkLabel, ToggleSwitch, CardSectionHeader, StatusTable, Row, EditIcon, DeleteIcon, Modal, InfoIcon, CardHeader, LinkButton, Banner } from '@djb25/digit-ui-react-components';
4
+ import { Header, SearchForm, SearchField, Dropdown as Dropdown$2, MobileNumber, CardLabelError, DatePicker as DatePicker$3, SubmitBar, Card, Table, Loader, Toast, AppContainer, ModuleHeader, ArrowLeft, PrivateRoute, LayoutWrapper, HomeIcon, PropertyHouse, EmployeeModuleCard, VerticalTimeline, FormComposer, FormStep, CardLabel, Tooltip, TextInput, LabelFieldPair, UploadFile, CardSubHeader, CardText, RadioOrSelect, ShippingTruck, CheckBox, RadioButtons, CloseSvg, Localities, RemoveableTag, ActionBar, ApplyFilterBar, AddIcon, Menu, Label, LinkLabel, ToggleSwitch, CardSectionHeader, Row, EditIcon, DeleteIcon, Modal, InfoIcon, CardHeader, StatusTable, LinkButton, Banner } from '@djb25/digit-ui-react-components';
5
5
  import { useForm, Controller } from 'react-hook-form';
6
6
  import { useQueryClient } from 'react-query';
7
7
 
@@ -383,49 +383,67 @@ const EmployeeApp = ({
383
383
  breadcrumbs: getDynamicBreadcrumbs()
384
384
  }), /*#__PURE__*/React.createElement(PrivateRoute, {
385
385
  path: `${path}/search-vendor`,
386
- component: renderWithLayout(props => /*#__PURE__*/React.createElement(SearchVendor, Object.assign({}, props, {
386
+ component: props => /*#__PURE__*/React.createElement(LayoutWrapper, {
387
+ layoutClass: "normal"
388
+ }, /*#__PURE__*/React.createElement(SearchVendor, Object.assign({}, props, {
387
389
  parentRoute: path
388
- })), layouts.normal)
390
+ })))
389
391
  }), /*#__PURE__*/React.createElement(PrivateRoute, {
390
392
  path: `${path}/registry/new-driver`,
391
- component: renderWithLayout(props => /*#__PURE__*/React.createElement(AddDriver, Object.assign({}, props, {
393
+ component: props => /*#__PURE__*/React.createElement(LayoutWrapper, {
394
+ layoutClass: "action"
395
+ }, /*#__PURE__*/React.createElement(AddDriver, Object.assign({}, props, {
392
396
  parentRoute: path
393
- })), layouts.normal)
397
+ })))
394
398
  }), /*#__PURE__*/React.createElement(PrivateRoute, {
395
399
  path: `${path}/registry/new-vehicle`,
396
- component: renderWithLayout(props => /*#__PURE__*/React.createElement(AddVehicle, Object.assign({}, props, {
400
+ component: props => /*#__PURE__*/React.createElement(LayoutWrapper, {
401
+ layoutClass: "action"
402
+ }, /*#__PURE__*/React.createElement(AddVehicle, Object.assign({}, props, {
397
403
  parentRoute: path
398
- })), layouts.normal)
404
+ })))
399
405
  }), /*#__PURE__*/React.createElement(PrivateRoute, {
400
406
  path: `${path}/registry/additionaldetails`,
401
- component: renderWithLayout(props => /*#__PURE__*/React.createElement(VendorCreate, Object.assign({}, props, {
407
+ component: renderWithLayout(props => /*#__PURE__*/React.createElement(LayoutWrapper, {
408
+ layoutClass: "normal"
409
+ }, /*#__PURE__*/React.createElement(VendorCreate, Object.assign({}, props, {
402
410
  parentRoute: path
403
- })), layouts.normal)
411
+ }))), layouts.action)
404
412
  }), /*#__PURE__*/React.createElement(PrivateRoute, {
405
413
  path: `${path}/registry/driver-details/:id`,
406
- component: renderWithLayout(props => /*#__PURE__*/React.createElement(DriverDetails, Object.assign({}, props, {
414
+ component: renderWithLayout(props => /*#__PURE__*/React.createElement(LayoutWrapper, {
415
+ layoutClass: "action"
416
+ }, /*#__PURE__*/React.createElement(DriverDetails, Object.assign({}, props, {
407
417
  parentRoute: path
408
- })), layouts.action)
418
+ }))).layouts.action)
409
419
  }), /*#__PURE__*/React.createElement(PrivateRoute, {
410
420
  path: `${path}/common-search/:id`,
411
- component: renderWithLayout(props => /*#__PURE__*/React.createElement(SearchApp, Object.assign({}, props, {
421
+ component: props => /*#__PURE__*/React.createElement(LayoutWrapper, {
422
+ layoutClass: "normal"
423
+ }, /*#__PURE__*/React.createElement(SearchApp, Object.assign({}, props, {
412
424
  parentRoute: path
413
- })), layouts.normal)
425
+ })))
414
426
  }), /*#__PURE__*/React.createElement(PrivateRoute, {
415
427
  path: `${path}/registry/new-vendor`,
416
- component: renderWithLayout(props => /*#__PURE__*/React.createElement(AddVendor, Object.assign({}, props, {
428
+ component: props => /*#__PURE__*/React.createElement(LayoutWrapper, {
429
+ layoutClass: "action"
430
+ }, /*#__PURE__*/React.createElement(AddVendor, Object.assign({}, props, {
417
431
  parentRoute: path
418
- })), layouts.action)
432
+ })))
419
433
  }), /*#__PURE__*/React.createElement(PrivateRoute, {
420
434
  path: `${path}/registry/vendor-details/:id`,
421
- component: renderWithLayout(props => /*#__PURE__*/React.createElement(EditVendorDetails, Object.assign({}, props, {
435
+ component: props => /*#__PURE__*/React.createElement(LayoutWrapper, {
436
+ layoutClass: "action"
437
+ }, /*#__PURE__*/React.createElement(EditVendorDetails, Object.assign({}, props, {
422
438
  parentRoute: path
423
- })), layouts.action)
439
+ })))
424
440
  }), /*#__PURE__*/React.createElement(PrivateRoute, {
425
441
  path: `${path}/registry/vehicle-details/:id`,
426
- component: renderWithLayout(props => /*#__PURE__*/React.createElement(VehicleDetails, Object.assign({}, props, {
442
+ component: props => /*#__PURE__*/React.createElement(LayoutWrapper, {
443
+ layoutClass: "action"
444
+ }, /*#__PURE__*/React.createElement(VehicleDetails, Object.assign({}, props, {
427
445
  parentRoute: path
428
- })), layouts.action)
446
+ })))
429
447
  })))));
430
448
  };
431
449
  const renderWithLayout = (Component, layoutClass) => routeProps => /*#__PURE__*/React.createElement("div", {
@@ -471,19 +489,6 @@ const checkForNotNull = (value = "") => {
471
489
  const checkForNA = (value = "") => {
472
490
  return checkForNotNull(value) ? value : "NA";
473
491
  };
474
- const convertEpochToDate = (dateEpoch, businessService) => {
475
- const dateFromApi = new Date(dateEpoch);
476
- if (dateEpoch) {
477
- let month = dateFromApi.getMonth() + 1;
478
- let day = dateFromApi.getDate();
479
- let year = dateFromApi.getFullYear();
480
- month = (month > 9 ? "" : "0") + month;
481
- day = (day > 9 ? "" : "0") + day;
482
- if (businessService == "asset-create") return `${day}-${month}-${year}`;else return `${day}/${month}/${year}`;
483
- } else {
484
- return null;
485
- }
486
- };
487
492
  const VendorData = data => {
488
493
  var _data$vendordet, _data$vendordet2, _data$vendordet3, _data$vendordet4, _data$vendordet5, _data$vendordet6, _data$vendordet7, _data$vendordet8, _data$vendordet9, _data$vendordet0, _data$vendordet1, _data$vendordet10, _data$vendordet11, _data$vendordet12, _data$vendordet13, _data$vendordet13$Sta, _data$vendordet14, _data$vendordet14$Ven, _data$vendordet15, _data$vendordet16, _data$vendordet17, _data$vendordet17$Ven, _data$documents, _data$vendordet18, _data$vendordet19;
489
494
  const formdata = {
@@ -544,7 +549,7 @@ const VendorConfig = (t, disabled = false) => {
544
549
  name: "vendorName",
545
550
  validation: {
546
551
  required: true,
547
- pattern: /^[A-Za-z]/
552
+ pattern: /^[A-Za-z\s]+$/
548
553
  },
549
554
  error: t("FSM_REGISTRY_INVALID_NAME"),
550
555
  defaultValue: "",
@@ -732,11 +737,6 @@ const AddVendor = ({
732
737
  };
733
738
  const vendorStepConfig = Config.filter(config => config.head === "ES_VRNDOR_NEW_VENDOR_DETAILS");
734
739
  const addressStepConfig = Config.filter(config => config.head === "ES_FSM_REGISTRY_NEW_ADDRESS_DETAILS");
735
- const steps = [{
736
- label: "ES_VRNDOR_NEW_VENDOR_DETAILS"
737
- }, {
738
- label: "ES_FSM_REGISTRY_NEW_ADDRESS_DETAILS"
739
- }];
740
740
  const onFormValueChange = (setValue, formData) => {
741
741
  var _formData$serviceType;
742
742
  if (formData !== null && formData !== void 0 && formData.vendorName && formData !== null && formData !== void 0 && formData.phone && formData !== null && formData !== void 0 && (_formData$serviceType = formData.serviceType) !== null && _formData$serviceType !== void 0 && _formData$serviceType.code) {
@@ -843,17 +843,29 @@ const AddVendor = ({
843
843
  }
844
844
  });
845
845
  };
846
- return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Stepper, {
847
- steps: steps,
848
- currentStep: currentStep - 1,
849
- onStepClick: () => {},
850
- t: t
846
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(VerticalTimeline, {
847
+ config: [{
848
+ route: "vendor-details",
849
+ timeLine: [{
850
+ actions: "New Vendor Details",
851
+ currentStep: 1
852
+ }]
853
+ }, {
854
+ route: "address-details",
855
+ timeLine: [{
856
+ actions: "Address Details",
857
+ currentStep: 2
858
+ }]
859
+ }],
860
+ currentActiveIndex: currentStep - 1,
861
+ showFinalStep: false
851
862
  }), /*#__PURE__*/React.createElement("div", {
852
863
  style: {
853
864
  flex: "1",
854
865
  overflowY: "auto"
855
866
  }
856
867
  }, currentStep === 1 && /*#__PURE__*/React.createElement(FormComposer, {
868
+ key: "step1",
857
869
  isDisabled: !canSubmit,
858
870
  label: t("CS_COMMON_NEXT"),
859
871
  config: vendorStepConfig.filter(i => !i.hideInEmployee).map(config => ({
@@ -868,13 +880,16 @@ const AddVendor = ({
868
880
  onFormValueChange: onFormValueChange,
869
881
  noBreakLine: true
870
882
  }), currentStep === 2 && /*#__PURE__*/React.createElement(FormComposer, {
883
+ key: "step2",
871
884
  label: t("ES_COMMON_APPLICATION_SUBMIT"),
872
885
  config: addressStepConfig.filter(i => !i.hideInEmployee).map(config => ({
873
886
  ...config,
874
887
  body: config.body.filter(a => !a.hideInEmployee)
875
888
  })),
876
889
  onSubmit: onSubmit,
877
- defaultValues: defaultValues,
890
+ defaultValues: {
891
+ ...defaultValues
892
+ },
878
893
  onFormValueChange: (setValue, formData) => {},
879
894
  noBreakLine: true
880
895
  }), showToast && /*#__PURE__*/React.createElement(Toast, {
@@ -884,40 +899,6 @@ const AddVendor = ({
884
899
  })));
885
900
  };
886
901
 
887
- const Timeline = ({
888
- steps: _steps = [],
889
- currentStep: _currentStep = 1
890
- }) => {
891
- const {
892
- t
893
- } = useTranslation();
894
- return /*#__PURE__*/React.createElement("div", {
895
- className: "custom-stepper-card"
896
- }, _steps.map((label, index) => {
897
- const stepNumber = index + 1;
898
- const isActive = stepNumber === _currentStep;
899
- const isCompleted = stepNumber < _currentStep;
900
- return /*#__PURE__*/React.createElement("div", {
901
- className: "stepper-row-vendor",
902
- key: index
903
- }, /*#__PURE__*/React.createElement("div", {
904
- className: "stepper-left"
905
- }, /*#__PURE__*/React.createElement("div", {
906
- className: `step-circle
907
- ${isActive ? "active" : ""}
908
- ${isCompleted ? "completed" : ""}`
909
- }, isCompleted ? /*#__PURE__*/React.createElement(TickMark, {
910
- fillColor: "#fff"
911
- }) : stepNumber), index !== _steps.length - 1 && /*#__PURE__*/React.createElement("div", {
912
- className: `step-line ${isCompleted ? "completed-line" : ""}`
913
- })), /*#__PURE__*/React.createElement("div", {
914
- className: `step-label
915
- ${isActive ? "active-text" : ""}
916
- ${isCompleted ? "completed-text" : ""}`
917
- }, t(label)));
918
- }));
919
- };
920
-
921
902
  const VendorDetails = ({
922
903
  t,
923
904
  config,
@@ -926,11 +907,8 @@ const VendorDetails = ({
926
907
  formData,
927
908
  ownerIndex
928
909
  }) => {
929
- const location = useLocation();
930
- console.log(formData, "oiuyt");
931
910
  let index = 0;
932
911
  let validation = {};
933
- const steps = ["VENDOR_ADDITIONAL_DETAILS", "VENDOR_DOCUMENT_DETAILS", "VENDOR_SUMMARY"];
934
912
  const [VendorCompany, setVendorCompany] = useState("");
935
913
  const [VendorPhone, setVendorPhone] = useState("");
936
914
  const [VendorAddress, setVendorAddress] = useState("");
@@ -1023,14 +1001,10 @@ const VendorDetails = ({
1023
1001
  function setesino(e) {
1024
1002
  setEsiNo(e.target.value);
1025
1003
  }
1026
- function setphoneno(e) {
1027
- setPhoneNo(e.target.value);
1028
- }
1029
1004
  function setcontactperson(e) {
1030
1005
  setContactPerson(e.target.value);
1031
1006
  }
1032
1007
  const tenantId = Digit.ULBService.getCurrentTenantId();
1033
- const stateId = Digit.ULBService.getStateId();
1034
1008
  const {
1035
1009
  control
1036
1010
  } = useForm();
@@ -1101,15 +1075,25 @@ const VendorDetails = ({
1101
1075
  goNext();
1102
1076
  }
1103
1077
  }, [VendorCompany, VendorPhone, VendorAddress, VendorCategory, VendorEmail, VendorId, userName, Bank, BankbranchName, IFSC, AccountNo, PanNo, GstNo, GstState, RegistrationNo, EpfNo, EsiNo, VendorType, Status, micrNo, PhoneNo, ContactPerson, Company, goNext, userType]);
1104
- return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
1105
- style: {
1106
- display: "flex",
1107
- width: "100%",
1108
- gap: "24px"
1109
- }
1110
- }, /*#__PURE__*/React.createElement(Timeline, {
1111
- steps: steps,
1112
- currentStep: 1
1078
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(VerticalTimeline, {
1079
+ config: [{
1080
+ timeLine: [{
1081
+ actions: t("VENDOR_ADDITIONAL_DETAILS"),
1082
+ currentStep: 1
1083
+ }]
1084
+ }, {
1085
+ timeLine: [{
1086
+ actions: t("VENDOR_DOCUMENT_DETAILS"),
1087
+ currentStep: 2
1088
+ }]
1089
+ }, {
1090
+ timeLine: [{
1091
+ actions: t("VENDOR_SUMMARY"),
1092
+ currentStep: 3
1093
+ }]
1094
+ }],
1095
+ currentActiveIndex: 0,
1096
+ showFinalStep: false
1113
1097
  }), /*#__PURE__*/React.createElement("div", {
1114
1098
  style: {
1115
1099
  flex: "1",
@@ -1119,7 +1103,13 @@ const VendorDetails = ({
1119
1103
  config: config,
1120
1104
  onSelect: goNext,
1121
1105
  t: t
1122
- }, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(CardLabel, null, `${t("IFSC_CODE")}`), /*#__PURE__*/React.createElement(TextInput, Object.assign({
1106
+ }, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(CardLabel, {
1107
+ className: "card-label-smaller"
1108
+ }, /*#__PURE__*/React.createElement(Tooltip, {
1109
+ label: `${t("IFSC_CODE")}`,
1110
+ isMandatory: false,
1111
+ message: t("INVALID_IFSC_CODE_ERROR_MESSAGE")
1112
+ })), /*#__PURE__*/React.createElement(TextInput, Object.assign({
1123
1113
  t: t,
1124
1114
  type: "text",
1125
1115
  isMandatory: false,
@@ -1200,25 +1190,14 @@ const VendorDetails = ({
1200
1190
  pattern: "[0-9]{9,18}",
1201
1191
  type: "text",
1202
1192
  title: t("INVALID_ACCOUNT_NO_ERROR_MESSAGE")
1203
- }))), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(CardLabel, null, `${t("PHONE_NO")}`), /*#__PURE__*/React.createElement(TextInput, Object.assign({
1204
- t: t,
1205
- type: "text",
1206
- isMandatory: false,
1207
- optionKey: "i18nKey",
1208
- name: "PhoneNo",
1193
+ }))), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(CardLabel, null, `${t("PHONE_NO")}`), /*#__PURE__*/React.createElement(MobileNumber, {
1209
1194
  value: PhoneNo,
1210
- onChange: setphoneno,
1195
+ name: "PhoneNo",
1196
+ onChange: setPhoneNo,
1211
1197
  style: {
1212
1198
  width: "100%"
1213
- },
1214
- ValidationRequired: true
1215
- }, validation = {
1216
- isRequired: true,
1217
- pattern: "[0-9]{9,18}",
1218
- type: "text",
1219
- title: t("INVALID_ACCOUNT_NO_ERROR_MESSAGE"),
1220
- length: 10
1221
- }))), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(CardLabel, null, `${t("CONTACT_PERSON")}`), /*#__PURE__*/React.createElement(TextInput, Object.assign({
1199
+ }
1200
+ })), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(CardLabel, null, `${t("CONTACT_PERSON")}`), /*#__PURE__*/React.createElement(TextInput, Object.assign({
1222
1201
  t: t,
1223
1202
  type: "text",
1224
1203
  isMandatory: false,
@@ -1461,7 +1440,7 @@ const VendorDetails = ({
1461
1440
  placeholder: "Select",
1462
1441
  t: t
1463
1442
  })
1464
- }))))));
1443
+ })))));
1465
1444
  };
1466
1445
 
1467
1446
  const VendorDocuments = ({
@@ -1475,7 +1454,6 @@ const VendorDocuments = ({
1475
1454
  const [uploadedFiles, setUploadedFiles] = useState([null]);
1476
1455
  const [error, setError] = useState(null);
1477
1456
  const [ind, setInd] = useState(1);
1478
- const steps = ["VENDOR_ADDITIONAL_DETAILS", "VENDOR_DOCUMENT_DETAILS", "VENDOR_SUMMARY"];
1479
1457
  const tenantId = Digit.ULBService.getStateId();
1480
1458
  const stateId = Digit.ULBService.getStateId();
1481
1459
  const [documents, setDocuments] = useState((formData === null || formData === void 0 ? void 0 : (_formData$documents = formData.documents) === null || _formData$documents === void 0 ? void 0 : _formData$documents.documents) || []);
@@ -1532,21 +1510,26 @@ const VendorDocuments = ({
1532
1510
  });
1533
1511
  handleFileUpload(file, index);
1534
1512
  };
1535
- return /*#__PURE__*/React.createElement("div", {
1536
- style: {
1537
- display: "flex",
1538
- width: "100%",
1539
- gap: "24px"
1540
- }
1541
- }, /*#__PURE__*/React.createElement(Timeline, {
1542
- steps: steps,
1543
- currentStep: 2
1544
- }), /*#__PURE__*/React.createElement("div", {
1545
- style: {
1546
- flex: "1",
1547
- overflowY: "auto"
1548
- }
1549
- }, /*#__PURE__*/React.createElement(FormStep, {
1513
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(VerticalTimeline, {
1514
+ config: [{
1515
+ timeLine: [{
1516
+ actions: t("VENDOR_ADDITIONAL_DETAILS"),
1517
+ currentStep: 1
1518
+ }]
1519
+ }, {
1520
+ timeLine: [{
1521
+ actions: t("VENDOR_DOCUMENT_DETAILS"),
1522
+ currentStep: 2
1523
+ }]
1524
+ }, {
1525
+ timeLine: [{
1526
+ actions: t("VENDOR_SUMMARY"),
1527
+ currentStep: 3
1528
+ }]
1529
+ }],
1530
+ currentActiveIndex: 1,
1531
+ showFinalStep: false
1532
+ }), /*#__PURE__*/React.createElement(FormStep, {
1550
1533
  t: t,
1551
1534
  config: config,
1552
1535
  onSelect: handleSubmit,
@@ -1585,7 +1568,7 @@ const VendorDocuments = ({
1585
1568
  label: error,
1586
1569
  onClose: () => setError(null),
1587
1570
  error: true
1588
- }))));
1571
+ })));
1589
1572
  };
1590
1573
 
1591
1574
  const ServiceDoc = ({
@@ -7692,9 +7675,16 @@ const ApplicationTable = ({
7692
7675
  pageSizeLimit,
7693
7676
  sortParams,
7694
7677
  totalRecords,
7695
- isPaginationRequired
7678
+ isPaginationRequired,
7679
+ showCSVExport,
7680
+ csvExportFileName,
7681
+ csvExportData,
7682
+ getCSVExportData,
7683
+ csvExportColumns,
7684
+ csvExportButtonLabel,
7685
+ ...rest
7696
7686
  }) => {
7697
- return /*#__PURE__*/React.createElement(Table, {
7687
+ return /*#__PURE__*/React.createElement(Table, Object.assign({
7698
7688
  className: _className,
7699
7689
  t: t,
7700
7690
  data: data,
@@ -7709,8 +7699,14 @@ const ApplicationTable = ({
7709
7699
  onSort: onSort,
7710
7700
  sortParams: sortParams,
7711
7701
  totalRecords: totalRecords,
7712
- isPaginationRequired: isPaginationRequired
7713
- });
7702
+ isPaginationRequired: isPaginationRequired,
7703
+ showCSVExport: showCSVExport,
7704
+ csvExportFileName: csvExportFileName,
7705
+ csvExportData: csvExportData,
7706
+ getCSVExportData: getCSVExportData,
7707
+ csvExportColumns: csvExportColumns,
7708
+ csvExportButtonLabel: csvExportButtonLabel
7709
+ }, rest));
7714
7710
  };
7715
7711
 
7716
7712
  const StatusCount = ({
@@ -8030,10 +8026,7 @@ const SearchApplication = ({
8030
8026
  const mobileViewStyles = mobileView ? {
8031
8027
  margin: 0,
8032
8028
  display: "inline"
8033
- } : {
8034
- marginTop: "40px",
8035
- marginLeft: "16px"
8036
- };
8029
+ } : {};
8037
8030
  return /*#__PURE__*/React.createElement(LinkLabel, {
8038
8031
  style: {
8039
8032
  ...mobileViewStyles
@@ -8149,26 +8142,39 @@ const SearchApplication = ({
8149
8142
  style: {
8150
8143
  display: "grid",
8151
8144
  width: "100%",
8152
- gridTemplateColumns: "33.33% 66.66% 0%"
8145
+ gridTemplateColumns: "33.33% 66.66% 0%",
8146
+ gap: "16px"
8153
8147
  }
8154
8148
  }, searchFields === null || searchFields === void 0 ? void 0 : searchFields.map((input, index) => /*#__PURE__*/React.createElement("span", {
8155
8149
  key: index,
8156
8150
  className: index === 0 ? "complaint-input" : "mobile-input"
8157
8151
  }, /*#__PURE__*/React.createElement(Label, null, input.label), getFields(input), " ")), /*#__PURE__*/React.createElement("div", {
8158
8152
  style: {
8159
- display: "flex"
8153
+ display: "flex",
8154
+ alignItems: "end",
8155
+ gap: "16px"
8160
8156
  }
8161
8157
  }, type === "desktop" && !mobileView && /*#__PURE__*/React.createElement(SubmitBar, {
8162
8158
  className: "submit-bar-search",
8163
8159
  label: t("ES_COMMON_SEARCH"),
8164
8160
  submit: true
8165
8161
  }), type === "desktop" && !mobileView && /*#__PURE__*/React.createElement("span", {
8166
- className: "clear-search"
8162
+ className: "clear-search generic-button"
8167
8163
  }, clearAll()))), error ? /*#__PURE__*/React.createElement(CardLabelError, {
8168
8164
  className: "search-error-label"
8169
8165
  }, t("ES_SEARCH_APPLICATION_ERROR")) : null))));
8170
8166
  };
8171
8167
 
8168
+ const parseAdditionalDetails = additionalDetails => {
8169
+ if (!additionalDetails) return {};
8170
+ if (typeof additionalDetails === "object") return additionalDetails;
8171
+ if (typeof additionalDetails !== "string") return {};
8172
+ try {
8173
+ return JSON.parse(additionalDetails);
8174
+ } catch (error) {
8175
+ return {};
8176
+ }
8177
+ };
8172
8178
  const VendorInbox = props => {
8173
8179
  const tenantId = Digit.ULBService.getCurrentTenantId();
8174
8180
  const {
@@ -8452,7 +8458,8 @@ const VendorInbox = props => {
8452
8458
  enabled: (vendorIds === null || vendorIds === void 0 ? void 0 : vendorIds.length) > 0
8453
8459
  });
8454
8460
  const {
8455
- data: allFillingPointsData
8461
+ data: allFillingPointsData,
8462
+ isLoading: isAllFillingPointsLoading
8456
8463
  } = Digit.Hooks.wt.useFillPointSearch({
8457
8464
  tenantId,
8458
8465
  filters: {
@@ -8478,6 +8485,8 @@ const VendorInbox = props => {
8478
8485
  setToast({
8479
8486
  label: t("WT_FIXED_FILLING_MAPPING_SUCCESS")
8480
8487
  });
8488
+ props.refetchData();
8489
+ props.refetchVendor && props.refetchVendor();
8481
8490
  setTimeout(closeToast, 5000);
8482
8491
  },
8483
8492
  onError: err => {
@@ -8517,8 +8526,8 @@ const VendorInbox = props => {
8517
8526
  }, {
8518
8527
  Header: t("WT_FILLING_POINT"),
8519
8528
  accessor: row => {
8520
- var _row$fillingpointmeta;
8521
- return (row === null || row === void 0 ? void 0 : row.fillingPointId) || (row === null || row === void 0 ? void 0 : (_row$fillingpointmeta = row.fillingpointmetadata) === null || _row$fillingpointmeta === void 0 ? void 0 : _row$fillingpointmeta.fillingPointId) || (row === null || row === void 0 ? void 0 : row.filling_pt_name) || (row === null || row === void 0 ? void 0 : row.fillingPoint) || "NA";
8529
+ var _row$dsoDetails, _row$dsoDetails2, _row$dsoDetails$filli, _row$dsoDetails3, _row$fillingpointmeta;
8530
+ return (row === null || row === void 0 ? void 0 : row.fillingPointId) || ((_row$dsoDetails = row.dsoDetails) === null || _row$dsoDetails === void 0 ? void 0 : _row$dsoDetails.fillingPointId) || ((_row$dsoDetails2 = row.dsoDetails) !== null && _row$dsoDetails2 !== void 0 && _row$dsoDetails2.fillingPoint && typeof row.dsoDetails.fillingPoint === "object" ? (_row$dsoDetails$filli = row.dsoDetails.fillingPoint) === null || _row$dsoDetails$filli === void 0 ? void 0 : _row$dsoDetails$filli.fillingPointName : (_row$dsoDetails3 = row.dsoDetails) === null || _row$dsoDetails3 === void 0 ? void 0 : _row$dsoDetails3.fillingPoint) || (row === null || row === void 0 ? void 0 : (_row$fillingpointmeta = row.fillingpointmetadata) === null || _row$fillingpointmeta === void 0 ? void 0 : _row$fillingpointmeta.fillingPointId) || (row === null || row === void 0 ? void 0 : row.filling_pt_name) || (row === null || row === void 0 ? void 0 : row.fillingPoint) || "NA";
8522
8531
  },
8523
8532
  id: "fillingPoint",
8524
8533
  Cell: ({
@@ -8527,10 +8536,10 @@ const VendorInbox = props => {
8527
8536
  return /*#__PURE__*/React.createElement(Dropdown$2, {
8528
8537
  className: "fsm-registry-dropdown",
8529
8538
  selected: allFillingPoints === null || allFillingPoints === void 0 ? void 0 : allFillingPoints.find(fp => {
8530
- var _fp$fillingpointmetad, _row$original$filling, _row$original$filling2, _row$original$filling3;
8539
+ var _fp$fillingpointmetad, _row$original$dsoDeta, _row$original$dsoDeta2, _row$original$dsoDeta3, _row$original$filling, _row$original$filling2, _row$original$filling3, _row$original$filling4;
8531
8540
  const fpId = String(fp.id || fp.bookingId || fp.fillingPointId || fp.uuid || ((_fp$fillingpointmetad = fp.fillingpointmetadata) === null || _fp$fillingpointmetad === void 0 ? void 0 : _fp$fillingpointmetad.fillingPointId));
8532
- const rowFpId = String(row.original.fillingPointId || ((_row$original$filling = row.original.fillingpointmetadata) === null || _row$original$filling === void 0 ? void 0 : _row$original$filling.fillingPointId) || row.original.filling_pt_name || row.original.fillingPoint || ((_row$original$filling2 = row.original.fillingPointDetail) === null || _row$original$filling2 === void 0 ? void 0 : _row$original$filling2.id) || ((_row$original$filling3 = row.original.fillingPointDetail) === null || _row$original$filling3 === void 0 ? void 0 : _row$original$filling3.bookingId));
8533
- return fpId === rowFpId && rowFpId !== "undefined" && rowFpId !== "null";
8541
+ const rowFpId = String(row.original.fillingPointId || ((_row$original$dsoDeta = row.original.dsoDetails) === null || _row$original$dsoDeta === void 0 ? void 0 : _row$original$dsoDeta.fillingPointId) || ((_row$original$dsoDeta2 = row.original.dsoDetails) === null || _row$original$dsoDeta2 === void 0 ? void 0 : (_row$original$dsoDeta3 = _row$original$dsoDeta2.fillingPoint) === null || _row$original$dsoDeta3 === void 0 ? void 0 : _row$original$dsoDeta3.id) || ((_row$original$filling = row.original.fillingpointmetadata) === null || _row$original$filling === void 0 ? void 0 : _row$original$filling.fillingPointId) || row.original.filling_pt_name || (row.original.fillingPoint && typeof row.original.fillingPoint === "object" ? (_row$original$filling2 = row.original.fillingPoint) === null || _row$original$filling2 === void 0 ? void 0 : _row$original$filling2.id : row.original.fillingPoint) || ((_row$original$filling3 = row.original.fillingPointDetail) === null || _row$original$filling3 === void 0 ? void 0 : _row$original$filling3.id) || ((_row$original$filling4 = row.original.fillingPointDetail) === null || _row$original$filling4 === void 0 ? void 0 : _row$original$filling4.bookingId) || "");
8542
+ return fpId === rowFpId && rowFpId !== "undefined" && rowFpId !== "null" && rowFpId !== "";
8534
8543
  }),
8535
8544
  option: allFillingPoints,
8536
8545
  select: value => onFillingPointSelect(row, value),
@@ -8545,8 +8554,8 @@ const VendorInbox = props => {
8545
8554
  Header: t("ES_VENDOR_INBOX_SERVICE_TYPE"),
8546
8555
  id: "serviceType",
8547
8556
  accessor: row => {
8548
- var _row$dsoDetails, _additionalDetails;
8549
- let additionalDetails = (_row$dsoDetails = row.dsoDetails) === null || _row$dsoDetails === void 0 ? void 0 : _row$dsoDetails.additionalDetails;
8557
+ var _row$dsoDetails4, _additionalDetails;
8558
+ let additionalDetails = (_row$dsoDetails4 = row.dsoDetails) === null || _row$dsoDetails4 === void 0 ? void 0 : _row$dsoDetails4.additionalDetails;
8550
8559
  if (typeof additionalDetails === "string") {
8551
8560
  try {
8552
8561
  additionalDetails = JSON.parse(additionalDetails);
@@ -8559,8 +8568,8 @@ const VendorInbox = props => {
8559
8568
  Cell: ({
8560
8569
  row
8561
8570
  }) => {
8562
- var _row$original$dsoDeta, _additionalDetails2;
8563
- let additionalDetails = (_row$original$dsoDeta = row.original.dsoDetails) === null || _row$original$dsoDeta === void 0 ? void 0 : _row$original$dsoDeta.additionalDetails;
8571
+ var _row$original$dsoDeta4, _additionalDetails2;
8572
+ let additionalDetails = (_row$original$dsoDeta4 = row.original.dsoDetails) === null || _row$original$dsoDeta4 === void 0 ? void 0 : _row$original$dsoDeta4.additionalDetails;
8564
8573
  if (typeof additionalDetails === "string") {
8565
8574
  try {
8566
8575
  additionalDetails = JSON.parse(additionalDetails);
@@ -8576,8 +8585,8 @@ const VendorInbox = props => {
8576
8585
  Header: t("ES_VENDOR_REGISTRY_INBOX_ENABLED"),
8577
8586
  id: "status",
8578
8587
  accessor: row => {
8579
- var _row$dsoDetails2;
8580
- return ((_row$dsoDetails2 = row.dsoDetails) === null || _row$dsoDetails2 === void 0 ? void 0 : _row$dsoDetails2.status) || "";
8588
+ var _row$dsoDetails5;
8589
+ return ((_row$dsoDetails5 = row.dsoDetails) === null || _row$dsoDetails5 === void 0 ? void 0 : _row$dsoDetails5.status) || "";
8581
8590
  },
8582
8591
  Cell: ({
8583
8592
  row
@@ -8815,9 +8824,106 @@ const VendorInbox = props => {
8815
8824
  default:
8816
8825
  return [];
8817
8826
  }
8818
- }, [props.selectedTab, vendors, drivers, tableData, additionalVendorData, t]);
8827
+ }, [props.selectedTab, vendors, drivers, tableData, additionalVendorData, allFillingPoints, t]);
8828
+ const csvExportColumns = React.useMemo(() => {
8829
+ switch (props.selectedTab) {
8830
+ case "VENDOR":
8831
+ return [{
8832
+ Header: t("ES_VENDOR_INBOX_VENDOR_NAME"),
8833
+ exportAccessor: row => {
8834
+ var _row$dsoDetails6;
8835
+ return (row === null || row === void 0 ? void 0 : row.name) || (row === null || row === void 0 ? void 0 : (_row$dsoDetails6 = row.dsoDetails) === null || _row$dsoDetails6 === void 0 ? void 0 : _row$dsoDetails6.name) || "NA";
8836
+ }
8837
+ }, {
8838
+ Header: t("ES_VENDOR_INBOX_DATE_VENDOR_CREATION"),
8839
+ exportAccessor: row => {
8840
+ var _row$auditDetails, _row$auditDetails2;
8841
+ return row !== null && row !== void 0 && (_row$auditDetails = row.auditDetails) !== null && _row$auditDetails !== void 0 && _row$auditDetails.createdTime ? Digit.DateUtils.ConvertEpochToDate(row === null || row === void 0 ? void 0 : (_row$auditDetails2 = row.auditDetails) === null || _row$auditDetails2 === void 0 ? void 0 : _row$auditDetails2.createdTime) : "";
8842
+ }
8843
+ }, {
8844
+ Header: t("WT_FILLING_POINT"),
8845
+ exportAccessor: row => {
8846
+ var _row$dsoDetails7, _row$dsoDetails7$fill, _row$dsoDetails8, _row$dsoDetails9;
8847
+ return (row === null || row === void 0 ? void 0 : (_row$dsoDetails7 = row.dsoDetails) === null || _row$dsoDetails7 === void 0 ? void 0 : (_row$dsoDetails7$fill = _row$dsoDetails7.fillingPoint) === null || _row$dsoDetails7$fill === void 0 ? void 0 : _row$dsoDetails7$fill.fillingPointName) || (row === null || row === void 0 ? void 0 : (_row$dsoDetails8 = row.dsoDetails) === null || _row$dsoDetails8 === void 0 ? void 0 : _row$dsoDetails8.fillingPoint) || (row === null || row === void 0 ? void 0 : row.fillingPoint) || (row === null || row === void 0 ? void 0 : (_row$dsoDetails9 = row.dsoDetails) === null || _row$dsoDetails9 === void 0 ? void 0 : _row$dsoDetails9.fillingPointId) || (row === null || row === void 0 ? void 0 : row.fillingPointId) || "NA";
8848
+ }
8849
+ }, {
8850
+ Header: t("ES_VENDOR_INBOX_SERVICE_TYPE"),
8851
+ exportAccessor: row => {
8852
+ var _parseAdditionalDetai, _row$dsoDetails0;
8853
+ return ((_parseAdditionalDetai = parseAdditionalDetails(row === null || row === void 0 ? void 0 : (_row$dsoDetails0 = row.dsoDetails) === null || _row$dsoDetails0 === void 0 ? void 0 : _row$dsoDetails0.additionalDetails)) === null || _parseAdditionalDetai === void 0 ? void 0 : _parseAdditionalDetai.serviceType) || "N/A";
8854
+ }
8855
+ }, {
8856
+ Header: t("ES_VENDOR_REGISTRY_INBOX_ENABLED"),
8857
+ exportAccessor: row => {
8858
+ var _row$dsoDetails1;
8859
+ return (row === null || row === void 0 ? void 0 : (_row$dsoDetails1 = row.dsoDetails) === null || _row$dsoDetails1 === void 0 ? void 0 : _row$dsoDetails1.status) || "NA";
8860
+ }
8861
+ }];
8862
+ case "VEHICLE":
8863
+ return [{
8864
+ Header: t("ES_FSM_REGISTRY_INBOX_VEHICLE_NAME"),
8865
+ exportAccessor: row => (row === null || row === void 0 ? void 0 : row.registrationNumber) || "NA"
8866
+ }, {
8867
+ Header: t("ES_FSM_REGISTRY_INBOX_DATE_VEHICLE_CREATION"),
8868
+ exportAccessor: row => {
8869
+ var _row$auditDetails3, _row$auditDetails4;
8870
+ return row !== null && row !== void 0 && (_row$auditDetails3 = row.auditDetails) !== null && _row$auditDetails3 !== void 0 && _row$auditDetails3.createdTime ? Digit.DateUtils.ConvertEpochToDate(row === null || row === void 0 ? void 0 : (_row$auditDetails4 = row.auditDetails) === null || _row$auditDetails4 === void 0 ? void 0 : _row$auditDetails4.createdTime) : "";
8871
+ }
8872
+ }, {
8873
+ Header: t("ES_FSM_REGISTRY_INBOX_VENDOR_NAME"),
8874
+ exportAccessor: row => {
8875
+ var _row$vendor3;
8876
+ return (row === null || row === void 0 ? void 0 : (_row$vendor3 = row.vendor) === null || _row$vendor3 === void 0 ? void 0 : _row$vendor3.name) || "NA";
8877
+ }
8878
+ }, {
8879
+ Header: t("ES_VENDOR_INBOX_SERVICE_TYPE"),
8880
+ exportAccessor: row => {
8881
+ var _parseAdditionalDetai2;
8882
+ return ((_parseAdditionalDetai2 = parseAdditionalDetails(row === null || row === void 0 ? void 0 : row.additionalDetails)) === null || _parseAdditionalDetai2 === void 0 ? void 0 : _parseAdditionalDetai2.serviceType) || "N/A";
8883
+ }
8884
+ }, {
8885
+ Header: t("ES_FSM_REGISTRY_SELECT_DRIVER"),
8886
+ exportAccessor: row => {
8887
+ var _row$driverData2, _row$driver2;
8888
+ return (row === null || row === void 0 ? void 0 : (_row$driverData2 = row.driverData) === null || _row$driverData2 === void 0 ? void 0 : _row$driverData2.name) || (row === null || row === void 0 ? void 0 : (_row$driver2 = row.driver) === null || _row$driver2 === void 0 ? void 0 : _row$driver2.name) || "NA";
8889
+ }
8890
+ }, {
8891
+ Header: t("ES_FSM_REGISTRY_INBOX_ENABLED"),
8892
+ exportAccessor: row => (row === null || row === void 0 ? void 0 : row.status) || "NA"
8893
+ }];
8894
+ case "DRIVER":
8895
+ return [{
8896
+ Header: t("ES_FSM_REGISTRY_INBOX_USERNAME"),
8897
+ exportAccessor: row => {
8898
+ var _row$owner2;
8899
+ return (row === null || row === void 0 ? void 0 : (_row$owner2 = row.owner) === null || _row$owner2 === void 0 ? void 0 : _row$owner2.userName) || "NA";
8900
+ }
8901
+ }, {
8902
+ Header: t("ES_FSM_REGISTRY_INBOX_DRIVER_NAME"),
8903
+ exportAccessor: row => (row === null || row === void 0 ? void 0 : row.name) || "NA"
8904
+ }, {
8905
+ Header: t("ES_FSM_REGISTRY_INBOX_DATE_DRIVER_CREATION"),
8906
+ exportAccessor: row => {
8907
+ var _row$auditDetails5, _row$auditDetails6;
8908
+ return row !== null && row !== void 0 && (_row$auditDetails5 = row.auditDetails) !== null && _row$auditDetails5 !== void 0 && _row$auditDetails5.createdTime ? Digit.DateUtils.ConvertEpochToDate(row === null || row === void 0 ? void 0 : (_row$auditDetails6 = row.auditDetails) === null || _row$auditDetails6 === void 0 ? void 0 : _row$auditDetails6.createdTime) : "";
8909
+ }
8910
+ }, {
8911
+ Header: t("ES_FSM_REGISTRY_INBOX_VENDOR_NAME"),
8912
+ exportAccessor: row => {
8913
+ var _row$vendorData2, _row$vendor4;
8914
+ return (row === null || row === void 0 ? void 0 : (_row$vendorData2 = row.vendorData) === null || _row$vendorData2 === void 0 ? void 0 : _row$vendorData2.name) || (row === null || row === void 0 ? void 0 : (_row$vendor4 = row.vendor) === null || _row$vendor4 === void 0 ? void 0 : _row$vendor4.name) || "NA";
8915
+ }
8916
+ }, {
8917
+ Header: t("ES_FSM_REGISTRY_INBOX_ENABLED"),
8918
+ exportAccessor: row => (row === null || row === void 0 ? void 0 : row.status) || "NA"
8919
+ }];
8920
+ default:
8921
+ return [];
8922
+ }
8923
+ }, [props.selectedTab, t]);
8924
+ const getCSVExportData = React.useCallback(async () => tableData, [tableData]);
8819
8925
  let result;
8820
- if (props.isLoading) {
8926
+ if (props.isLoading || isAllFillingPointsLoading) {
8821
8927
  result = /*#__PURE__*/React.createElement(Loader, null);
8822
8928
  } else if (tableData.length === 0) {
8823
8929
  let emptyCardText = "";
@@ -8876,7 +8982,11 @@ const VendorInbox = props => {
8876
8982
  onSort: props.onSort,
8877
8983
  disableSort: props.disableSort,
8878
8984
  sortParams: props.sortParams,
8879
- totalRecords: props.totalRecords
8985
+ totalRecords: props.totalRecords,
8986
+ showCSVExport: true,
8987
+ getCSVExportData: getCSVExportData,
8988
+ csvExportColumns: csvExportColumns,
8989
+ csvExportFileName: `vendor-${String(props.selectedTab || "registry").toLowerCase()}-inbox`
8880
8990
  });
8881
8991
  }
8882
8992
  return /*#__PURE__*/React.createElement("div", {
@@ -8898,6 +9008,7 @@ const VendorInbox = props => {
8898
9008
  }))), /*#__PURE__*/React.createElement("div", {
8899
9009
  style: {
8900
9010
  flex: 1,
9011
+ width: "100%",
8901
9012
  marginLeft: props.userRole === "FSM_ADMIN" ? "" : "24px"
8902
9013
  }
8903
9014
  }, /*#__PURE__*/React.createElement(SearchApplication, {
@@ -8927,6 +9038,9 @@ const SearchVendor = () => {
8927
9038
  t
8928
9039
  } = useTranslation();
8929
9040
  const tenantId = Digit.ULBService.getCurrentTenantId();
9041
+ const {
9042
+ selectedTabs
9043
+ } = Digit.Hooks.useQueryParams();
8930
9044
  const [searchParams, setSearchParams] = useState({});
8931
9045
  const [sortParams, setSortParams] = useState([{
8932
9046
  id: "createdTime",
@@ -8934,7 +9048,7 @@ const SearchVendor = () => {
8934
9048
  }]);
8935
9049
  const [pageOffset, setPageOffset] = useState(0);
8936
9050
  const [pageSize, setPageSize] = useState(10);
8937
- const [tab, setTab] = useState("VENDOR");
9051
+ const [tab, setTab] = useState(selectedTabs || "VENDOR");
8938
9052
  const [vehicleIds, setVehicleIds] = useState("");
8939
9053
  const [driverIds, setDriverIds] = useState("");
8940
9054
  const [tableData, setTableData] = useState([]);
@@ -9246,7 +9360,10 @@ const DriverConfig = (t, disabled = false) => {
9246
9360
  name: "driverName",
9247
9361
  validation: {
9248
9362
  required: true,
9249
- pattern: /^[A-Za-z]/
9363
+ pattern: {
9364
+ value: /^[A-Za-z\s]+$/,
9365
+ message: t("FSM_REGISTRY_INVALID_NAME")
9366
+ }
9250
9367
  },
9251
9368
  error: t("FSM_REGISTRY_INVALID_NAME"),
9252
9369
  defaultValue: "",
@@ -9261,9 +9378,12 @@ const DriverConfig = (t, disabled = false) => {
9261
9378
  name: "license",
9262
9379
  validation: {
9263
9380
  required: true,
9264
- pattern: /^[a-zA-Z-]{0,}[- ]{0,1}[ 0-9]{1,}/
9381
+ pattern: {
9382
+ value: /^[A-Z]{2}-[0-9]{2}-[0-9]{4}-[0-9]{7}$/,
9383
+ message: t("ES_FSM_REGISTRY_INVALID_LICENSE")
9384
+ }
9265
9385
  },
9266
- error: t("FSM_REGISTRY_INVALID_DRIVER_LICENSE"),
9386
+ error: t("ES_FSM_REGISTRY_INVALID_LICENSE"),
9267
9387
  required: false,
9268
9388
  defaultValue: "",
9269
9389
  className: "payment-form-text-input-correction"
@@ -9304,7 +9424,7 @@ const DriverConfig = (t, disabled = false) => {
9304
9424
  }
9305
9425
  }, {
9306
9426
  label: t("ES_FSM_REGISTRY_NEW_DOB"),
9307
- isMandatory: false,
9427
+ isMandatory: true,
9308
9428
  type: "custom",
9309
9429
  key: "dob",
9310
9430
  populators: {
@@ -9316,7 +9436,11 @@ const DriverConfig = (t, disabled = false) => {
9316
9436
  onChange: props.onChange,
9317
9437
  date: props.value
9318
9438
  }, customProps, {
9319
- max: convertEpochToDate(new Date().setFullYear(new Date().getFullYear()))
9439
+ max: (() => {
9440
+ const date = new Date();
9441
+ date.setFullYear(date.getFullYear() - 18);
9442
+ return date.toISOString().split("T")[0];
9443
+ })()
9320
9444
  }))
9321
9445
  }
9322
9446
  }, {
@@ -9368,7 +9492,6 @@ const AddDriver = ({
9368
9492
  } = useTranslation();
9369
9493
  const stateId = Digit.ULBService.getStateId();
9370
9494
  const [showToast, setShowToast] = useState(null);
9371
- const history = useHistory();
9372
9495
  const [currentStep, setCurrentStep] = useState(1);
9373
9496
  const queryClient = useQueryClient();
9374
9497
  const steps = [t("ES_FSM_REGISTRY_TITLE_NEW_DRIVER")];
@@ -9397,7 +9520,18 @@ const AddDriver = ({
9397
9520
  }
9398
9521
  };
9399
9522
  const onFormValueChange = (setValue, formData) => {
9400
- if (formData !== null && formData !== void 0 && formData.driverName && formData !== null && formData !== void 0 && formData.selectGender) {
9523
+ if (formData !== null && formData !== void 0 && formData.license) {
9524
+ const cleaned = formData.license.replace(/[^A-Za-z0-9]/g, "").toUpperCase();
9525
+ let formatted = cleaned;
9526
+ if (cleaned.length > 2) formatted = cleaned.slice(0, 2) + "-" + cleaned.slice(2);
9527
+ if (cleaned.length > 4) formatted = formatted.slice(0, 5) + "-" + formatted.slice(5);
9528
+ if (cleaned.length > 8) formatted = formatted.slice(0, 10) + "-" + formatted.slice(10);
9529
+ const finalFormatted = formatted.slice(0, 18);
9530
+ if (formData.license !== finalFormatted) {
9531
+ setValue("license", finalFormatted);
9532
+ }
9533
+ }
9534
+ if (formData !== null && formData !== void 0 && formData.driverName && /^[A-Za-z\s]+$/.test(formData === null || formData === void 0 ? void 0 : formData.driverName) && formData !== null && formData !== void 0 && formData.license && /^[A-Z]{2}-[0-9]{2}-[0-9]{4}-[0-9]{7}$/.test(formData === null || formData === void 0 ? void 0 : formData.license) && formData !== null && formData !== void 0 && formData.selectGender && formData !== null && formData !== void 0 && formData.dob && new Date(formData === null || formData === void 0 ? void 0 : formData.dob).getTime() <= new Date().setFullYear(new Date().getFullYear() - 18)) {
9401
9535
  setSubmitValve(true);
9402
9536
  } else {
9403
9537
  setSubmitValve(false);
@@ -9455,16 +9589,16 @@ const AddDriver = ({
9455
9589
  }
9456
9590
  });
9457
9591
  };
9458
- const isMobile = window.Digit.Utils.browser.isMobile();
9459
- return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
9460
- style: {
9461
- display: "flex",
9462
- width: "100%",
9463
- gap: "24px"
9464
- }
9465
- }, /*#__PURE__*/React.createElement(Timeline, {
9466
- steps: steps,
9467
- currentStep: currentStep
9592
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(VerticalTimeline, {
9593
+ config: [{
9594
+ route: "vendor-details",
9595
+ timeLine: [{
9596
+ actions: t("ES_FSM_REGISTRY_TITLE_NEW_DRIVER"),
9597
+ currentStep: 1
9598
+ }]
9599
+ }],
9600
+ currentActiveIndex: currentStep - 1,
9601
+ showFinalStep: false
9468
9602
  }), /*#__PURE__*/React.createElement("div", {
9469
9603
  style: {
9470
9604
  flex: "1",
@@ -9485,12 +9619,13 @@ const AddDriver = ({
9485
9619
  onSubmit: onSubmit,
9486
9620
  defaultValues: defaultValues,
9487
9621
  onFormValueChange: onFormValueChange,
9488
- noBreakLine: true
9622
+ noBreakLine: true,
9623
+ mode: "onChange"
9489
9624
  }), showToast && /*#__PURE__*/React.createElement(Toast, {
9490
9625
  error: showToast.key === "error" ? true : false,
9491
9626
  label: t(showToast.key === "success" ? `ES_FSM_${showToast.action}_SUCCESS` : showToast.action),
9492
9627
  onClose: closeToast
9493
- }))));
9628
+ })));
9494
9629
  };
9495
9630
 
9496
9631
  const ConfirmationBox = ({
@@ -9802,12 +9937,7 @@ const EditVendorDetails = props => {
9802
9937
  const excludedKeys = ["vendorAdditionalDetailsId", "vendorId", "tenantId", "code", "lastModifiedTime", "createdTime", "lastModifiedBy", "createdBy", "active", "status", "vendorType", "vendorGroup", "narration", "documents"];
9803
9938
  return /*#__PURE__*/React.createElement("div", {
9804
9939
  className: "employee-form-content"
9805
- }, !isLoading ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Card, {
9806
- style: {
9807
- position: "relative",
9808
- paddingLeft: "30px"
9809
- }
9810
- }, dsoData === null || dsoData === void 0 ? void 0 : (_dsoData$4 = dsoData[0]) === null || _dsoData$4 === void 0 ? void 0 : (_dsoData$4$employeeRe = _dsoData$4.employeeResponse) === null || _dsoData$4$employeeRe === void 0 ? void 0 : _dsoData$4$employeeRe.map((detail, index) => {
9940
+ }, !isLoading ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Card, null, dsoData === null || dsoData === void 0 ? void 0 : (_dsoData$4 = dsoData[0]) === null || _dsoData$4 === void 0 ? void 0 : (_dsoData$4$employeeRe = _dsoData$4.employeeResponse) === null || _dsoData$4$employeeRe === void 0 ? void 0 : _dsoData$4$employeeRe.map((detail, index) => {
9811
9941
  var _detail$values, _detail$child;
9812
9942
  return /*#__PURE__*/React.createElement(React.Fragment, {
9813
9943
  key: index
@@ -9816,11 +9946,9 @@ const EditVendorDetails = props => {
9816
9946
  marginBottom: "16px",
9817
9947
  marginTop: "32px"
9818
9948
  }
9819
- }, t(detail.title)), /*#__PURE__*/React.createElement("div", {
9820
- style: !isMobile ? {
9821
- marginLeft: "-15px"
9822
- } : {}
9823
- }, /*#__PURE__*/React.createElement(StatusTable, null, detail === null || detail === void 0 ? void 0 : (_detail$values = detail.values) === null || _detail$values === void 0 ? void 0 : _detail$values.map((value, index) => {
9949
+ }, t(detail.title)), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
9950
+ className: "formcomposer-section-grid"
9951
+ }, detail === null || detail === void 0 ? void 0 : (_detail$values = detail.values) === null || _detail$values === void 0 ? void 0 : _detail$values.map((value, index) => {
9824
9952
  var _detail$values2;
9825
9953
  if (value.title === "ES_FSM_REGISTRY_DETAILS_ADDITIONAL_DETAILS") {
9826
9954
  var _vendorAdditionalData, _vendorAdditionalData2;
@@ -9831,7 +9959,7 @@ const EditVendorDetails = props => {
9831
9959
  }, /*#__PURE__*/React.createElement(Row, {
9832
9960
  label: t(value.title),
9833
9961
  text: "",
9834
- className: "border-none"
9962
+ className: "border-none flex-box"
9835
9963
  }), isVendorAdditionalLoading ? /*#__PURE__*/React.createElement(Loader, null) : additionalDetails ? /*#__PURE__*/React.createElement(Card, {
9836
9964
  className: "card-with-background",
9837
9965
  style: {
@@ -9879,7 +10007,7 @@ const EditVendorDetails = props => {
9879
10007
  text: value.value ? t(String(value.value)) : "N/A",
9880
10008
  last: index === (detail === null || detail === void 0 ? void 0 : (_detail$values2 = detail.values) === null || _detail$values2 === void 0 ? void 0 : _detail$values2.length) - 1,
9881
10009
  caption: value.caption,
9882
- className: `border-none ${!isMobile ? "vendor-details-row" : ""}`
10010
+ className: `border-none flex-box ${!isMobile ? "vendor-details-row" : ""}`
9883
10011
  });
9884
10012
  }), detail === null || detail === void 0 ? void 0 : (_detail$child = detail.child) === null || _detail$child === void 0 ? void 0 : _detail$child.map((data, index) => {
9885
10013
  var _data$values;
@@ -10082,7 +10210,10 @@ const VehicleConfig = (t, disabled = false) => {
10082
10210
  name: "ownerName",
10083
10211
  validation: {
10084
10212
  required: true,
10085
- pattern: /^[A-Za-z]/
10213
+ pattern: {
10214
+ value: /^[A-Za-z\s]+$/,
10215
+ message: t("FSM_REGISTRY_INVALID_NAME")
10216
+ }
10086
10217
  },
10087
10218
  error: t("FSM_REGISTRY_INVALID_NAME"),
10088
10219
  defaultValue: ""
@@ -10112,7 +10243,7 @@ const VehicleConfig = (t, disabled = false) => {
10112
10243
  component: "SelectGender"
10113
10244
  }, {
10114
10245
  label: t("ES_FSM_REGISTRY_NEW_DOB"),
10115
- isMandatory: false,
10246
+ isMandatory: true,
10116
10247
  type: "custom",
10117
10248
  key: "dob",
10118
10249
  populators: {
@@ -10124,7 +10255,11 @@ const VehicleConfig = (t, disabled = false) => {
10124
10255
  onChange: props.onChange,
10125
10256
  date: props.value
10126
10257
  }, customProps, {
10127
- max: convertEpochToDate(new Date().setFullYear(new Date().getFullYear()))
10258
+ max: (() => {
10259
+ const date = new Date();
10260
+ date.setFullYear(date.getFullYear() - 18);
10261
+ return date.toISOString().split("T")[0];
10262
+ })()
10128
10263
  }))
10129
10264
  }
10130
10265
  }, {
@@ -10217,7 +10352,7 @@ const AddVehicle = ({
10217
10352
  setValue("registrationNumber", updatedRegNo);
10218
10353
  }
10219
10354
  }
10220
- if (formData !== null && formData !== void 0 && formData.registrationNumber && formData !== null && formData !== void 0 && formData.ownerName && formData !== null && formData !== void 0 && formData.phone && formData !== null && formData !== void 0 && (_formData$vehicle = formData.vehicle) !== null && _formData$vehicle !== void 0 && _formData$vehicle.modal && formData !== null && formData !== void 0 && (_formData$vehicle2 = formData.vehicle) !== null && _formData$vehicle2 !== void 0 && _formData$vehicle2.type && formData !== null && formData !== void 0 && formData.selectGender) {
10355
+ if (formData !== null && formData !== void 0 && formData.registrationNumber && formData !== null && formData !== void 0 && formData.ownerName && formData !== null && formData !== void 0 && formData.phone && formData !== null && formData !== void 0 && (_formData$vehicle = formData.vehicle) !== null && _formData$vehicle !== void 0 && _formData$vehicle.modal && formData !== null && formData !== void 0 && (_formData$vehicle2 = formData.vehicle) !== null && _formData$vehicle2 !== void 0 && _formData$vehicle2.type && formData !== null && formData !== void 0 && formData.selectGender && formData !== null && formData !== void 0 && formData.dob && new Date(formData === null || formData === void 0 ? void 0 : formData.dob).getTime() <= new Date().setFullYear(new Date().getFullYear() - 18)) {
10221
10356
  setSubmitValve(true);
10222
10357
  } else {
10223
10358
  setSubmitValve(false);
@@ -10288,21 +10423,24 @@ const AddVehicle = ({
10288
10423
  key: "success",
10289
10424
  action: "ADD_VEHICLE"
10290
10425
  });
10291
- setTimeout(closeToast, 5000);
10292
10426
  queryClient.invalidateQueries("FSM_VEICLES_SEARCH");
10427
+ setTimeout(() => {
10428
+ closeToast();
10429
+ history.push(`/digit-ui/employee/vendor/search-vendor?selectedTabs=VEHICLE`);
10430
+ }, 3000);
10293
10431
  }
10294
10432
  });
10295
10433
  };
10296
- const isMobile = window.Digit.Utils.browser.isMobile();
10297
- return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
10298
- style: {
10299
- display: "flex",
10300
- width: "100%",
10301
- gap: "24px"
10302
- }
10303
- }, /*#__PURE__*/React.createElement(Timeline, {
10304
- steps: steps,
10305
- currentStep: currentStep
10434
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(VerticalTimeline, {
10435
+ config: [{
10436
+ route: "vendor-details",
10437
+ timeLine: [{
10438
+ actions: t("ES_FSM_REGISTRY_TITLE_NEW_VEHICLE"),
10439
+ currentStep: 1
10440
+ }]
10441
+ }],
10442
+ currentActiveIndex: currentStep - 1,
10443
+ showFinalStep: false
10306
10444
  }), /*#__PURE__*/React.createElement("div", {
10307
10445
  style: {
10308
10446
  flex: "1",
@@ -10323,12 +10461,13 @@ const AddVehicle = ({
10323
10461
  onSubmit: onSubmit,
10324
10462
  defaultValues: defaultValues,
10325
10463
  onFormValueChange: onFormValueChange,
10326
- noBreakLine: true
10464
+ noBreakLine: true,
10465
+ mode: "onChange"
10327
10466
  }), showToast && /*#__PURE__*/React.createElement(Toast, {
10328
10467
  error: showToast.key === "error" ? true : false,
10329
10468
  label: t(showToast.key === "success" ? `ES_FSM_REGISTRY_${showToast.action}_SUCCESS` : showToast.action),
10330
10469
  onClose: closeToast
10331
- }))));
10470
+ })));
10332
10471
  };
10333
10472
 
10334
10473
  const createConfig = [{
@@ -10476,18 +10615,7 @@ const VENDORCreate = ({
10476
10615
  config.indexRoute = "info";
10477
10616
  const CheckPage = (_Digit = Digit) === null || _Digit === void 0 ? void 0 : (_Digit$ComponentRegis = _Digit.ComponentRegistryService) === null || _Digit$ComponentRegis === void 0 ? void 0 : _Digit$ComponentRegis.getComponent("VENDORCheckPage");
10478
10617
  const NewResponse = (_Digit2 = Digit) === null || _Digit2 === void 0 ? void 0 : (_Digit2$ComponentRegi = _Digit2.ComponentRegistryService) === null || _Digit2$ComponentRegi === void 0 ? void 0 : _Digit2$ComponentRegi.getComponent("NewResponse");
10479
- return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
10480
- style: {
10481
- display: "flex",
10482
- width: "100%",
10483
- gap: "24px"
10484
- }
10485
- }, /*#__PURE__*/React.createElement("div", {
10486
- style: {
10487
- flex: "1",
10488
- overflowY: "auto"
10489
- }
10490
- }, /*#__PURE__*/React.createElement(Switch, null, config.map((routeObj, index) => {
10618
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Switch, null, config.map((routeObj, index) => {
10491
10619
  const {
10492
10620
  component,
10493
10621
  texts,
@@ -10522,7 +10650,7 @@ const VENDORCreate = ({
10522
10650
  onSuccess: onSuccess
10523
10651
  })), /*#__PURE__*/React.createElement(Route, null, /*#__PURE__*/React.createElement(Redirect, {
10524
10652
  to: `${match.path}/${config.indexRoute}`
10525
- }))))));
10653
+ }))));
10526
10654
  };
10527
10655
 
10528
10656
  const ActionButton = ({
@@ -10551,7 +10679,6 @@ const CheckPage = ({
10551
10679
  } = useTranslation();
10552
10680
  const history = useHistory();
10553
10681
  const [categoriesWiseData, setCategoriesWiseData] = useState();
10554
- const steps = ["VENDOR_ADDITIONAL_DETAILS", "VENDOR_DOCUMENT_DETAILS", "VENDOR_SUMMARY"];
10555
10682
  const tenantId = Digit.ULBService.getCurrentTenantId();
10556
10683
  const stateTenantId = Digit.ULBService.getStateId();
10557
10684
  const {
@@ -10589,19 +10716,30 @@ const CheckPage = ({
10589
10716
  }
10590
10717
  });
10591
10718
  };
10592
- return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
10593
- style: {
10594
- display: "flex",
10595
- width: "100%",
10596
- gap: "24px"
10597
- }
10598
- }, window.location.href.includes("/employee") ? /*#__PURE__*/React.createElement(Timeline, {
10599
- steps: steps,
10600
- currentStep: 5
10719
+ return /*#__PURE__*/React.createElement(React.Fragment, null, window.location.href.includes("/employee") ? /*#__PURE__*/React.createElement(VerticalTimeline, {
10720
+ config: [{
10721
+ timeLine: [{
10722
+ actions: t("VENDOR_ADDITIONAL_DETAILS"),
10723
+ currentStep: 1
10724
+ }]
10725
+ }, {
10726
+ timeLine: [{
10727
+ actions: t("VENDOR_DOCUMENT_DETAILS"),
10728
+ currentStep: 2
10729
+ }]
10730
+ }, {
10731
+ timeLine: [{
10732
+ actions: t("VENDOR_SUMMARY"),
10733
+ currentStep: 3
10734
+ }]
10735
+ }],
10736
+ currentActiveIndex: 2,
10737
+ showFinalStep: false
10601
10738
  }) : null, /*#__PURE__*/React.createElement("div", {
10602
10739
  style: {
10603
10740
  flex: "1",
10604
- overflowY: "auto"
10741
+ overflowY: "auto",
10742
+ marginBottom: "20px"
10605
10743
  }
10606
10744
  }, /*#__PURE__*/React.createElement(Card, null, /*#__PURE__*/React.createElement(CardHeader, null, t("VENDOR_CHECK_DETAILS")), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("br", null), /*#__PURE__*/React.createElement(CardSubHeader, null, t("VENDOR_ADDITIONAL_DETAILS")), /*#__PURE__*/React.createElement(StatusTable, null, /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Row, {
10607
10745
  label: t("VENDOR_ID"),
@@ -10716,7 +10854,7 @@ const CheckPage = ({
10716
10854
  label: t("COMMON_BUTTON_SUBMIT"),
10717
10855
  onSubmit: onSubmit,
10718
10856
  disabled: !agree
10719
- })))));
10857
+ }))));
10720
10858
  };
10721
10859
 
10722
10860
  const GetActionMessage = props => {
@@ -10772,7 +10910,9 @@ const NewResponse = ({
10772
10910
  console.log("mutation in acknowejkfdlgi ::: ", mutation);
10773
10911
  } catch (err) {}
10774
10912
  }, []);
10775
- return mutation.isLoading || mutation.isIdle ? /*#__PURE__*/React.createElement(Loader, null) : /*#__PURE__*/React.createElement(Card, null, /*#__PURE__*/React.createElement(BannerPicker, {
10913
+ return mutation.isLoading || mutation.isIdle ? /*#__PURE__*/React.createElement(Loader, null) : /*#__PURE__*/React.createElement(Card, {
10914
+ className: "vehicle-details-card"
10915
+ }, /*#__PURE__*/React.createElement(BannerPicker, {
10776
10916
  t: t,
10777
10917
  data: mutation.data,
10778
10918
  isSuccess: mutation.isSuccess,
@@ -11507,7 +11647,9 @@ const VehicleDetails = props => {
11507
11647
  if (isLoading) {
11508
11648
  return /*#__PURE__*/React.createElement(Loader, null);
11509
11649
  }
11510
- return /*#__PURE__*/React.createElement(React.Fragment, null, !isLoading ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Card, {
11650
+ return /*#__PURE__*/React.createElement(React.Fragment, null, !isLoading ? /*#__PURE__*/React.createElement("div", {
11651
+ className: "employee-form-content"
11652
+ }, /*#__PURE__*/React.createElement(Card, {
11511
11653
  className: "vehicle-details-card",
11512
11654
  style: {
11513
11655
  position: "relative"