@djb25/digit-ui-module-wt 1.0.18 → 1.0.19

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 { TickMark, ArrowDown, MobileNumber, CardLabelError, TextInput, Dropdown, DatePicker, SubmitBar, Card, Table, Loader, Toast, AppContainer, ModuleHeader, ArrowLeft, PrivateRoute, HomeIcon, KeyNote, Modal, CardHeader, CardText, FormStep, CardLabel, RadioButtons, UploadFile, TextArea, CheckBox, CardSubHeader, StatusTable, Row, GenericFileIcon, LinkButton, EditIcon, Banner, CHBIcon, EmployeeModuleCard, CloseSvg, Label, LinkLabel, ActionBar, DetailsCard, SearchAction, FilterAction, PopUp, ShippingTruck, CustomNameDropdown, MultiSelectDropdown, LabelFieldPair, AddIcon, Menu, Header, TelePhone, DisplayPhotos, CardSectionHeader, CheckPoint, ConnectingCheckPoints, MultiLink, Localities, RemoveableTag, FormComposer, PDFSvg, MultiUploadWrapper, Close as Close$g, BreakLine, InfoBannerIcon, ViewsIcon, ButtonSelector, LocationIcon, CitizenHomeCard, PTIcon, ApplicantDetails, AddressDetails } from '@djb25/digit-ui-react-components';
2
2
  import React, { useState, useMemo, useCallback, useEffect, Fragment, useRef } from 'react';
3
3
  import { useTranslation } from 'react-i18next';
4
- import { useLocation, useHistory, useRouteMatch, Switch, Route, Redirect, Link, useParams } from 'react-router-dom';
4
+ import { useLocation, useRouteMatch, useHistory, Switch, Route, Redirect, Link, useParams } from 'react-router-dom';
5
5
  import { useQueryClient } from 'react-query';
6
6
  import { useForm, Controller } from 'react-hook-form';
7
7
  import { io } from 'socket.io-client';
@@ -137,7 +137,6 @@ const VerticalTimeline = ({
137
137
  t
138
138
  } = useTranslation();
139
139
  const location = useLocation();
140
- const history = useHistory();
141
140
  const currentRoute = location.pathname.split("/").pop();
142
141
  if (currentRoute === "info") return null;
143
142
  const steps = config.filter(item => item.timeLine && item.timeLine.length > 0).reduce((acc, item) => {
@@ -156,9 +155,9 @@ const VerticalTimeline = ({
156
155
  return acc;
157
156
  }, []).sort((a, b) => a.stepNumber - b.stepNumber);
158
157
  steps.push({
159
- key: 'final-submit',
160
- label: 'Review & Submit',
161
- routes: ['check', 'wt-acknowledgement', 'mt-acknowledgement', 'tp-acknowledgement'],
158
+ key: "final-submit",
159
+ label: "Review & Submit",
160
+ routes: ["check", "wt-acknowledgement", "mt-acknowledgement", "tp-acknowledgement"],
162
161
  stepNumber: steps.length + 1
163
162
  });
164
163
  const currentStepIndex = steps.findIndex(step => step.routes.includes(currentRoute));
@@ -166,15 +165,17 @@ const VerticalTimeline = ({
166
165
  const handleStepClick = (route, index) => {};
167
166
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
168
167
  className: "vertical-timeline-container"
168
+ }, /*#__PURE__*/React.createElement("div", {
169
+ className: "vertical-timeline-wrapper"
169
170
  }, steps.map((step, index) => {
170
171
  const isCompleted = index < activeStepIndex;
171
172
  const isActive = index === activeStepIndex;
172
173
  return /*#__PURE__*/React.createElement("div", {
173
174
  key: index,
174
- className: `vertical-timeline-step ${isCompleted ? 'completed' : ''} ${isActive ? 'active' : ''}`,
175
+ className: `vertical-timeline-step ${isCompleted ? "completed" : ""} ${isActive ? "active" : ""}`,
175
176
  onClick: () => handleStepClick()
176
177
  }, /*#__PURE__*/React.createElement("div", {
177
- className: `vertical-timeline-connector ${index < activeStepIndex ? 'completed' : ''}`
178
+ className: `vertical-timeline-connector ${index < activeStepIndex ? "completed" : ""}`
178
179
  }), /*#__PURE__*/React.createElement("div", {
179
180
  className: "vertical-timeline-pill"
180
181
  }, isCompleted ? /*#__PURE__*/React.createElement(TickMark, null) : step.stepNumber), /*#__PURE__*/React.createElement("div", {
@@ -182,7 +183,7 @@ const VerticalTimeline = ({
182
183
  }, /*#__PURE__*/React.createElement("div", {
183
184
  className: "vertical-timeline-label"
184
185
  }, t(step.label))));
185
- })));
186
+ }))));
186
187
  };
187
188
 
188
189
  const WTCreate = () => {
@@ -352,26 +353,11 @@ const WTCreate = () => {
352
353
  const MTAcknowledgement = (_Digit3 = Digit) === null || _Digit3 === void 0 ? void 0 : (_Digit3$ComponentRegi = _Digit3.ComponentRegistryService) === null || _Digit3$ComponentRegi === void 0 ? void 0 : _Digit3$ComponentRegi.getComponent("MTAcknowledgement");
353
354
  const TPAcknowledgement = (_Digit4 = Digit) === null || _Digit4 === void 0 ? void 0 : (_Digit4$ComponentRegi = _Digit4.ComponentRegistryService) === null || _Digit4$ComponentRegi === void 0 ? void 0 : _Digit4$ComponentRegi.getComponent("TPAcknowledgement");
354
355
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
355
- style: {
356
- display: "flex",
357
- width: "100%",
358
- gap: "24px"
359
- }
360
- }, !pathname.includes("/info") && /*#__PURE__*/React.createElement("div", {
361
- style: {
362
- flex: "0 0 280px",
363
- background: "#fff",
364
- padding: "20px 0",
365
- boxShadow: "0 2px 4px rgba(0,0,0,0.1)",
366
- borderRadius: "4px"
367
- }
368
- }, /*#__PURE__*/React.createElement(VerticalTimeline, {
356
+ className: "employee-form-section-wrapper"
357
+ }, !pathname.includes("/info") && /*#__PURE__*/React.createElement(VerticalTimeline, {
369
358
  config: config
370
- })), /*#__PURE__*/React.createElement("div", {
371
- style: {
372
- flex: "1",
373
- overflowY: "auto"
374
- }
359
+ }), /*#__PURE__*/React.createElement("div", {
360
+ className: "employee-form-section"
375
361
  }, /*#__PURE__*/React.createElement(Switch, null, config.map((routeObj, index) => {
376
362
  var _userDetails$user;
377
363
  const {
@@ -2547,31 +2533,16 @@ const SearchApplication = ({
2547
2533
  }, t("ES_COMMON_CLEAR_SEARCH"));
2548
2534
  };
2549
2535
  return /*#__PURE__*/React.createElement("form", {
2550
- onSubmit: handleSubmit(onSubmitInput)
2551
- }, /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
2552
- className: "search-container",
2553
- style: {
2554
- width: "auto",
2555
- marginBottom: "16px",
2556
- marginLeft: isInboxPage ? "" : "revert"
2557
- }
2558
- }, /*#__PURE__*/React.createElement("div", {
2559
- className: "search-complaint-container",
2560
- style: {
2561
- width: "100%"
2562
- }
2563
- }, (type === "mobile" || mobileView) && /*#__PURE__*/React.createElement("div", {
2536
+ onSubmit: handleSubmit(onSubmitInput),
2537
+ className: "search-form-wrapper search-complaint-container"
2538
+ }, /*#__PURE__*/React.createElement(React.Fragment, null, (type === "mobile" || mobileView) && /*#__PURE__*/React.createElement("div", {
2564
2539
  className: "complaint-header"
2565
2540
  }, /*#__PURE__*/React.createElement("h2", null, t("ES_COMMON_SEARCH_BY")), /*#__PURE__*/React.createElement("span", {
2566
2541
  onClick: onClose
2567
2542
  }, /*#__PURE__*/React.createElement(CloseSvg, null))), /*#__PURE__*/React.createElement("div", {
2568
- className: "complaint-input-container for-pt " + (!isInboxPage ? "for-search" : ""),
2569
- style: {
2570
- width: "100%",
2571
- display: "grid"
2572
- }
2543
+ className: "formcomposer-section-grid"
2573
2544
  }, searchFields === null || searchFields === void 0 ? void 0 : (_searchFields$filter = searchFields.filter(e => true)) === null || _searchFields$filter === void 0 ? void 0 : _searchFields$filter.map((input, index) => {
2574
- var _formState$dirtyField, _formState$errors, _formState$errors$inp;
2545
+ var _formState$dirtyField, _formState$errors, _formState$errors$inp, _formState$errors2, _formState$errors2$in;
2575
2546
  return /*#__PURE__*/React.createElement("div", {
2576
2547
  key: input.name,
2577
2548
  className: "input-fields"
@@ -2600,7 +2571,7 @@ const SearchApplication = ({
2600
2571
  name: input.name,
2601
2572
  control: control,
2602
2573
  defaultValue: ""
2603
- })), formState !== null && formState !== void 0 && (_formState$dirtyField = formState.dirtyFields) !== null && _formState$dirtyField !== void 0 && _formState$dirtyField[input.name] ? /*#__PURE__*/React.createElement("span", {
2574
+ })), formState !== null && formState !== void 0 && (_formState$dirtyField = formState.dirtyFields) !== null && _formState$dirtyField !== void 0 && _formState$dirtyField[input.name] && formState !== null && formState !== void 0 && (_formState$errors = formState.errors) !== null && _formState$errors !== void 0 && (_formState$errors$inp = _formState$errors[input.name]) !== null && _formState$errors$inp !== void 0 && _formState$errors$inp.message ? /*#__PURE__*/React.createElement("span", {
2604
2575
  style: {
2605
2576
  fontWeight: "700",
2606
2577
  color: "rgba(212, 53, 28)",
@@ -2609,27 +2580,20 @@ const SearchApplication = ({
2609
2580
  fontSize: "12px"
2610
2581
  },
2611
2582
  className: "inbox-search-form-error"
2612
- }, formState === null || formState === void 0 ? void 0 : (_formState$errors = formState.errors) === null || _formState$errors === void 0 ? void 0 : (_formState$errors$inp = _formState$errors[input.name]) === null || _formState$errors$inp === void 0 ? void 0 : _formState$errors$inp.message) : null);
2613
- }), isInboxPage && /*#__PURE__*/React.createElement("div", {
2614
- style: {
2615
- gridColumn: "2/3",
2616
- textAlign: "right",
2617
- paddingTop: "10px",
2618
- padding: "10px"
2619
- },
2620
- className: "input-fields"
2621
- }, /*#__PURE__*/React.createElement("div", null, clearAll())), type === "desktop" && !mobileView && /*#__PURE__*/React.createElement("div", {
2622
- style: {
2623
- maxWidth: "unset",
2624
- marginLeft: "unset"
2625
- },
2626
- className: "search-submit-wrapper"
2627
- }, /*#__PURE__*/React.createElement(SubmitBar, {
2628
- className: "submit-bar-search",
2629
- label: t("ES_COMMON_SEARCH"),
2583
+ }, formState === null || formState === void 0 ? void 0 : (_formState$errors2 = formState.errors) === null || _formState$errors2 === void 0 ? void 0 : (_formState$errors2$in = _formState$errors2[input.name]) === null || _formState$errors2$in === void 0 ? void 0 : _formState$errors2$in.message) : null);
2584
+ })), /*#__PURE__*/React.createElement("div", {
2585
+ className: "formcomposer-section-button"
2586
+ }, isInboxPage ? /*#__PURE__*/React.createElement("div", {
2587
+ className: "generic-button clear-search"
2588
+ }, /*#__PURE__*/React.createElement("p", {
2589
+ onClick: clearSearch
2590
+ }, t("ES_COMMON_CLEAR_SEARCH"))) : /*#__PURE__*/React.createElement("div", null, clearAll()), type === "desktop" && !mobileView && /*#__PURE__*/React.createElement(SubmitBar, {
2591
+ className: "generic-button",
2630
2592
  disabled: !!Object.keys(formState.errors).length || formValueEmpty(),
2631
- submit: true
2632
- }), !isInboxPage && /*#__PURE__*/React.createElement("div", null, clearAll()))))), (type === "mobile" || mobileView) && /*#__PURE__*/React.createElement(ActionBar, {
2593
+ label: t("ES_COMMON_SEARCH"),
2594
+ submit: true,
2595
+ form: "search-form"
2596
+ })), (type === "mobile" || mobileView) && /*#__PURE__*/React.createElement(ActionBar, {
2633
2597
  className: "clear-search-container"
2634
2598
  }, /*#__PURE__*/React.createElement("button", {
2635
2599
  className: "clear-search",