@djb25/digit-ui-module-ws 1.0.16 → 1.0.17

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, { useState, useEffect, useRef, useMemo, Fragment as Fragment$1, useReducer, useCallback } from 'react';
2
2
  import { useTranslation } from 'react-i18next';
3
3
  import { Link, useLocation, Switch, Route, useHistory, useRouteMatch, Redirect, useParams } from 'react-router-dom';
4
- import { Loader, Card, KeyNote, SubmitBar, InfoBannerIcon, Header, BackButton, PrivateRoute, Banner, CardText, ActionBar, HomeIcon, PrintBtnCommon, MultiLink, LinkButton, Toast, BreadcrumbHeader, ArrowLeft, TickMark, FormStep, CardLabel, RadioOrSelect, TextInput, CardHeader, CitizenInfoLabel, CardSubHeader, LabelFieldPair, Dropdown, CardLabelError, UploadFile, CheckBox, RadioButtons, MobileNumber, DatePicker, DeleteIcon, WrapUnMaskComponent, StatusTable, Row, CardSectionHeader, InfoIcon, TextArea, SearchField, FilterFormField, RemoveableTag, MultiSelectDropdown, InboxComposer, DropIcon, WSICon, EmployeeModuleCard, SearchAction, PopUp, DetailsCard, SearchForm, CloseSvg, CollapsibleCardPage, Table, Localities, Modal, DownloadBtnCommon, CollectionIcon, ResponseComposer, TelePhone, DisplayPhotos, CheckPoint, ConnectingCheckPoints, ActionLinks, PDFSvg, EditIcon, CardSectionSubText, DownloadIcon, CardLabelDesc, FormComposer, MultiUploadWrapper, Close as Close$e, BreakLine, ViewsIcon, Menu, ButtonSelector, CitizenHomeCard } from '@djb25/digit-ui-react-components';
4
+ import { Loader, Card, KeyNote, SubmitBar, InfoBannerIcon, Header, BackButton, PrivateRoute, Banner, CardText, ActionBar, HomeIcon, PrintBtnCommon, MultiLink, LinkButton, Toast, BreadcrumbHeader, ArrowLeft, TickMark, FormStep, CardLabel, RadioOrSelect, TextInput, CardHeader, CitizenInfoLabel, CardSubHeader, Dropdown, UploadFile, CheckBox, RadioButtons, MobileNumber, LabelFieldPair, DatePicker, CardLabelError, DeleteIcon, WrapUnMaskComponent, StatusTable, Row, CardSectionHeader, InfoIcon, TextArea, SearchField, FilterFormField, RemoveableTag, MultiSelectDropdown, InboxComposer, DropIcon, WSICon, EmployeeModuleCard, SearchAction, PopUp, DetailsCard, SearchForm, CloseSvg, CollapsibleCardPage, Table, Localities, Modal, DownloadBtnCommon, CollectionIcon, ResponseComposer, TelePhone, DisplayPhotos, CheckPoint, ConnectingCheckPoints, ActionLinks, PDFSvg, EditIcon, CardSectionSubText, DownloadIcon, CardLabelDesc, VerticalTimeline, FormComposer, MultiUploadWrapper, Close as Close$e, BreakLine, ViewsIcon, Menu, ButtonSelector, CitizenHomeCard } from '@djb25/digit-ui-react-components';
5
5
  import { useForm, Controller, useWatch, useFormContext } from 'react-hook-form';
6
6
  import { read, utils as utils$1 } from 'xlsx';
7
7
  import { useQueryClient } from 'react-query';
@@ -9860,15 +9860,6 @@ const WSDocsRequired = ({
9860
9860
  const goNext = () => {
9861
9861
  onSelect("DocsReq", "");
9862
9862
  };
9863
- const {
9864
- control,
9865
- formState: localFormState,
9866
- getValues
9867
- } = useForm();
9868
- const [zro, setZro] = useState({
9869
- value: "",
9870
- error: ""
9871
- });
9872
9863
  sessionStorage.removeItem("Digit.PT_CREATE_EMP_WS_NEW_FORM");
9873
9864
  sessionStorage.removeItem("IsDetailsExists");
9874
9865
  sessionStorage.removeItem("FORMSTATE_ERRORS");
@@ -9935,23 +9926,6 @@ const WSDocsRequired = ({
9935
9926
  onSubmit: goNext
9936
9927
  })));
9937
9928
  }
9938
- const menu = [{
9939
- i18nKey: "ASHOK VIHAR",
9940
- code: "ASHOK VIHAR",
9941
- value: "ASHOK VIHAR"
9942
- }, {
9943
- i18nKey: "BURARI",
9944
- code: "BURARI",
9945
- value: "BURARI"
9946
- }, {
9947
- i18nKey: "DWARKA",
9948
- code: "DWARKA",
9949
- value: "DWARKA"
9950
- }, {
9951
- i18nKey: "OKHLA",
9952
- code: "OKHLA",
9953
- value: "OKHLA"
9954
- }];
9955
9929
  return /*#__PURE__*/React.createElement("div", {
9956
9930
  className: "employee-form-content-with-action-bar"
9957
9931
  }, /*#__PURE__*/React.createElement("div", {
@@ -9980,37 +9954,7 @@ const WSDocsRequired = ({
9980
9954
  }, /*#__PURE__*/React.createElement("span", {
9981
9955
  className: "ws-doc-bullet"
9982
9956
  }, idx + 1, "."), /*#__PURE__*/React.createElement("span", null, t(value === null || value === void 0 ? void 0 : value.i18nKey))))));
9983
- }), /*#__PURE__*/React.createElement(Card, {
9984
- className: "ws-doc-card"
9985
- }, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, {
9986
- className: "card-label-smaller"
9987
- }, "ZRO Location"), /*#__PURE__*/React.createElement("div", {
9988
- className: "field"
9989
- }, /*#__PURE__*/React.createElement(Controller, {
9990
- control: control,
9991
- name: "zro",
9992
- defaultValue: zro,
9993
- rules: {
9994
- required: t("REQUIRED_FIELD")
9995
- },
9996
- isMandatory: true,
9997
- render: props => /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Dropdown, {
9998
- className: "form-field",
9999
- selected: getValues("gender"),
10000
- disable: false,
10001
- option: menu,
10002
- errorStyle: localFormState.touched.gender && zro.error ? true : false,
10003
- select: e => {
10004
- setZro(prev => ({
10005
- ...prev,
10006
- value: e
10007
- }));
10008
- },
10009
- optionKey: "i18nKey",
10010
- onBlur: props.onBlur,
10011
- t: t
10012
- }))
10013
- }))), localFormState && zro.error && /*#__PURE__*/React.createElement(CardLabelError, null, zro.error)))), /*#__PURE__*/React.createElement(ActionBar, {
9957
+ })), /*#__PURE__*/React.createElement(ActionBar, {
10014
9958
  style: {
10015
9959
  display: "flex",
10016
9960
  justifyContent: "flex-end",
@@ -10020,8 +9964,7 @@ const WSDocsRequired = ({
10020
9964
  label: t("ACTION_TEST_APPLY"),
10021
9965
  onSubmit: () => {
10022
9966
  history.push(match.path.replace("create-application", "new-application"));
10023
- },
10024
- disabled: wsDocsLoading || !zro.value ? true : false
9967
+ }
10025
9968
  }))));
10026
9969
  };
10027
9970
 
@@ -31290,6 +31233,7 @@ const NewApplication = () => {
31290
31233
  const stateId = Digit.ULBService.getStateId();
31291
31234
  const tenantId = Digit.ULBService.getCurrentTenantId() || ((_Digit$SessionStorage = Digit.SessionStorage.get("CITIZEN.COMMON.HOME.CITY")) === null || _Digit$SessionStorage === void 0 ? void 0 : _Digit$SessionStorage.code);
31292
31235
  const [previewMode, setPreviewMode] = useState(false);
31236
+ const [currentStep, setCurrentStep] = useState(1);
31293
31237
  const [collapsedSections, setCollapsedSections] = useState(DEFAULT_SECTION_STATE);
31294
31238
  const [showToast, setShowToast] = useState(null);
31295
31239
  const [generatedCaptcha, setGeneratedCaptcha] = useState(generateCaptcha());
@@ -31298,7 +31242,10 @@ const NewApplication = () => {
31298
31242
  const [appDetails, setAppDetails] = useState({});
31299
31243
  const [waterAndSewerageBoth, setWaterAndSewerageBoth] = useState(null);
31300
31244
  const [propertyId, setPropertyId] = useState(new URLSearchParams(location.search).get("propertyId"));
31301
- console.log(propertyId, 'property idddddd');
31245
+ const [zro, setZro] = useState({
31246
+ value: "",
31247
+ error: ""
31248
+ });
31302
31249
  const initialFormValues = buildDefaultValues(getStoredFormData());
31303
31250
  const {
31304
31251
  register,
@@ -31309,8 +31256,10 @@ const NewApplication = () => {
31309
31256
  setError,
31310
31257
  clearErrors,
31311
31258
  reset,
31259
+ getValues,
31312
31260
  formState: {
31313
- errors
31261
+ errors,
31262
+ localFormState
31314
31263
  }
31315
31264
  } = useForm({
31316
31265
  defaultValues: initialFormValues,
@@ -31736,9 +31685,24 @@ const NewApplication = () => {
31736
31685
  if (isEnableLoader || isPropertyLoading) {
31737
31686
  return /*#__PURE__*/React.createElement(Loader, null);
31738
31687
  }
31739
- return /*#__PURE__*/React.createElement("div", {
31740
- className: "employee-form-content-with-action-bar"
31741
- }, /*#__PURE__*/React.createElement("style", null, `
31688
+ const menu = [{
31689
+ i18nKey: "ASHOK VIHAR",
31690
+ code: "ASHOK VIHAR",
31691
+ value: "ASHOK VIHAR"
31692
+ }, {
31693
+ i18nKey: "BURARI",
31694
+ code: "BURARI",
31695
+ value: "BURARI"
31696
+ }, {
31697
+ i18nKey: "DWARKA",
31698
+ code: "DWARKA",
31699
+ value: "DWARKA"
31700
+ }, {
31701
+ i18nKey: "OKHLA",
31702
+ code: "OKHLA",
31703
+ value: "OKHLA"
31704
+ }];
31705
+ return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("style", null, `
31742
31706
  .ws-new-application-collapsible .collapsible-card-tabs {
31743
31707
  display: none;
31744
31708
  }
@@ -31746,55 +31710,176 @@ const NewApplication = () => {
31746
31710
  .ws-new-application-collapsible .collapsible-card-tab-content {
31747
31711
  padding: 0;
31748
31712
  }
31749
- `), /*#__PURE__*/React.createElement(Header, null, t("New Water / Sewerage Application")), /*#__PURE__*/React.createElement(Card, {
31713
+ `), /*#__PURE__*/React.createElement(Header, null, t("New Water / Sewerage Application")), /*#__PURE__*/React.createElement("div", {
31750
31714
  style: {
31751
- marginBottom: "16px"
31715
+ display: "flex",
31716
+ alignItems: "flex-start",
31717
+ gap: "24px"
31752
31718
  }
31753
- }, /*#__PURE__*/React.createElement(CardSubHeader, null, previewMode ? t("Preview Application") : t("Application Form"))), /*#__PURE__*/React.createElement("div", {
31719
+ }, /*#__PURE__*/React.createElement(VerticalTimeline, {
31720
+ config: [{
31721
+ route: "application-selection",
31722
+ timeLine: [{
31723
+ actions: "Application Selection",
31724
+ currentStep: 1
31725
+ }]
31726
+ }, {
31727
+ route: "applicant-details",
31728
+ timeLine: [{
31729
+ actions: "Details of Applicant",
31730
+ currentStep: 2
31731
+ }]
31732
+ }, {
31733
+ route: "contact-details",
31734
+ timeLine: [{
31735
+ actions: "Contact Details",
31736
+ currentStep: 3
31737
+ }]
31738
+ }, {
31739
+ route: "djb-employee",
31740
+ timeLine: [{
31741
+ actions: "For DJB Employee",
31742
+ currentStep: 4
31743
+ }]
31744
+ }, {
31745
+ route: "property-address",
31746
+ timeLine: [{
31747
+ actions: "Property Address",
31748
+ currentStep: 5
31749
+ }]
31750
+ }, {
31751
+ route: "use-details",
31752
+ timeLine: [{
31753
+ actions: "Property & Connection Use Details",
31754
+ currentStep: 6
31755
+ }]
31756
+ }, {
31757
+ route: "bank-details",
31758
+ timeLine: [{
31759
+ actions: "Bank Details",
31760
+ currentStep: 7
31761
+ }]
31762
+ }, {
31763
+ route: "rain-water-harvesting",
31764
+ timeLine: [{
31765
+ actions: "Rain Water Harvesting",
31766
+ currentStep: 8
31767
+ }]
31768
+ }, {
31769
+ route: "documents",
31770
+ timeLine: [{
31771
+ actions: "Documents to be Attached",
31772
+ currentStep: 9
31773
+ }]
31774
+ }, {
31775
+ route: "declaration",
31776
+ timeLine: [{
31777
+ actions: "Declaration / Undertaking",
31778
+ currentStep: 10
31779
+ }]
31780
+ }],
31781
+ currentActiveIndex: currentStep - 1,
31782
+ showFinalStep: false
31783
+ }), /*#__PURE__*/React.createElement("div", {
31754
31784
  style: {
31755
- display: previewMode ? "none" : "block"
31785
+ flex: "1",
31786
+ overflowY: "auto",
31787
+ minWidth: 0
31756
31788
  }
31757
- }, /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(SectionCard, {
31758
- description: "Primary request selections",
31789
+ }, /*#__PURE__*/React.createElement(SectionCard, {
31759
31790
  isOpen: collapsedSections.application,
31760
31791
  onToggle: toggleSection,
31761
31792
  sectionKey: "application",
31762
31793
  title: "Application Selection"
31763
- }, /*#__PURE__*/React.createElement(FieldBlock, {
31764
- error: getFieldError("typeOfRequest"),
31765
- label: "Type of Request",
31766
- required: true
31794
+ }, /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, {
31795
+ className: "card-label-smaller"
31796
+ }, "ZRO Location"), /*#__PURE__*/React.createElement("div", {
31797
+ className: "field"
31767
31798
  }, /*#__PURE__*/React.createElement(Controller, {
31768
31799
  control: control,
31769
- name: "typeOfRequest",
31800
+ name: "zro",
31801
+ defaultValue: zro,
31770
31802
  rules: {
31771
- required: "Type of Request is required."
31803
+ required: t("REQUIRED_FIELD")
31772
31804
  },
31773
- render: props => /*#__PURE__*/React.createElement(RadioButtons, {
31774
- name: "typeOfRequest",
31775
- options: TYPE_OF_REQUEST_OPTIONS,
31776
- optionsKey: "name",
31777
- onSelect: props.onChange,
31778
- selectedOption: props.value
31779
- })
31780
- })), /*#__PURE__*/React.createElement(FieldBlock, {
31781
- error: getFieldError("connectionType"),
31782
- label: "Connection Type",
31783
- required: true
31805
+ isMandatory: true,
31806
+ render: props => /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Dropdown, {
31807
+ className: "form-field",
31808
+ selected: getValues("gender"),
31809
+ disable: false,
31810
+ option: menu,
31811
+ errorStyle: !!getFieldError("zro"),
31812
+ select: e => {
31813
+ setZro(prev => ({
31814
+ ...prev,
31815
+ value: e
31816
+ }));
31817
+ },
31818
+ optionKey: "i18nKey",
31819
+ onBlur: props.onBlur,
31820
+ t: t
31821
+ }))
31822
+ }))), localFormState && zro.error && /*#__PURE__*/React.createElement(CardLabelError, null, zro.error), /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, {
31823
+ className: "card-label-smaller"
31824
+ }, "Type of Request"), /*#__PURE__*/React.createElement("div", {
31825
+ className: "field"
31784
31826
  }, /*#__PURE__*/React.createElement(Controller, {
31785
31827
  control: control,
31786
- name: "connectionType",
31828
+ name: "zro",
31829
+ defaultValue: zro,
31787
31830
  rules: {
31788
- required: "Connection Type is required."
31831
+ required: t("REQUIRED_FIELD")
31789
31832
  },
31790
- render: props => /*#__PURE__*/React.createElement(RadioButtons, {
31791
- name: "connectionType",
31792
- options: CONNECTION_TYPE_OPTIONS,
31793
- optionsKey: "name",
31794
- onSelect: props.onChange,
31795
- selectedOption: props.value
31796
- })
31797
- }))), /*#__PURE__*/React.createElement(SectionCard, {
31833
+ isMandatory: true,
31834
+ render: props => /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Dropdown, {
31835
+ className: "form-field",
31836
+ selected: getValues("gender"),
31837
+ disable: false,
31838
+ option: TYPE_OF_REQUEST_OPTIONS,
31839
+ errorStyle: !!getFieldError("zro"),
31840
+ select: e => {
31841
+ setZro(prev => ({
31842
+ ...prev,
31843
+ value: e
31844
+ }));
31845
+ },
31846
+ optionKey: "name",
31847
+ onBlur: props.onBlur,
31848
+ t: t
31849
+ }))
31850
+ }))), localFormState && zro.error && /*#__PURE__*/React.createElement(CardLabelError, null, zro.error), /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, {
31851
+ className: "card-label-smaller"
31852
+ }, "Connection Type"), /*#__PURE__*/React.createElement("div", {
31853
+ className: "field"
31854
+ }, /*#__PURE__*/React.createElement(Controller, {
31855
+ control: control,
31856
+ name: "zro",
31857
+ defaultValue: zro,
31858
+ rules: {
31859
+ required: t("REQUIRED_FIELD")
31860
+ },
31861
+ isMandatory: true,
31862
+ render: props => /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Dropdown, {
31863
+ className: "form-field",
31864
+ selected: getValues("gender"),
31865
+ disable: false,
31866
+ option: CONNECTION_TYPE_OPTIONS,
31867
+ errorStyle: !!getFieldError("zro"),
31868
+ select: e => {
31869
+ setZro(prev => ({
31870
+ ...prev,
31871
+ value: e
31872
+ }));
31873
+ },
31874
+ optionKey: "name",
31875
+ onBlur: props.onBlur,
31876
+ t: t
31877
+ }))
31878
+ }))), localFormState && zro.error && /*#__PURE__*/React.createElement(CardLabelError, null, zro.error)), /*#__PURE__*/React.createElement("div", {
31879
+ style: {
31880
+ display: previewMode ? "none" : "block"
31881
+ }
31882
+ }, /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(SectionCard, {
31798
31883
  description: "Applicant name, organization details, and supporting ID proof.",
31799
31884
  isOpen: collapsedSections.applicant,
31800
31885
  onToggle: toggleSection,
@@ -32658,7 +32743,7 @@ const NewApplication = () => {
32658
32743
  }), /*#__PURE__*/React.createElement(PreviewItem, {
32659
32744
  label: "I Agree",
32660
32745
  value: formValues === null || formValues === void 0 ? void 0 : (_formValues$declarati4 = formValues.declaration) === null || _formValues$declarati4 === void 0 ? void 0 : _formValues$declarati4.agree
32661
- }))), /*#__PURE__*/React.createElement(ActionBar, {
32746
+ }))))), /*#__PURE__*/React.createElement(ActionBar, {
32662
32747
  style: actionBarStyle
32663
32748
  }, !previewMode ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(SubmitBar, {
32664
32749
  label: "Reset",