@bjsdistribution/dms-client-return 0.0.90 → 0.0.92

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.
@@ -5,7 +5,7 @@ import { Select, notification, Skeleton, Empty, DatePicker, Input as Input$2 } f
5
5
  import { useAtom, atom } from 'jotai';
6
6
  import { format, isValid } from 'date-fns';
7
7
  import { atomWithReducer } from 'jotai/utils';
8
- import { useApiHook, Checkbox as Checkbox$1, AntTable, Alert, AntModal, Label as Label$j, Input as Input$1, TextArea, FormSection, displayValueOrNA as displayValueOrNA$1, dropdownStyles, SelectDropdown, RadioButtonGroup as RadioButtonGroup$1, Switch, useAxios, Button, getBaseEndpoint, formatDateTime, SectionHeader, CrossIcon, AntSelect, CustomRating, CancelationModal, CancelAndCompleteAction, filterDropdownStyles, BackgroundModal as BackgroundModal$1, FlagAlert, ViewIcon } from '@bjsdistribution/dms-component-library';
8
+ import { useApiHook, Checkbox as Checkbox$1, AntTable, Alert, AntModal, Label as Label$j, Input as Input$1, TextArea, FormSection, displayValueOrNA as displayValueOrNA$1, dropdownStyles, SelectDropdown, RadioButtonGroup as RadioButtonGroup$1, Switch, useAxios, Button, formatDateTime, SectionHeader, CrossIcon, AntSelect, CustomRating, CancelationModal, CancelAndCompleteAction, filterDropdownStyles, BackgroundModal as BackgroundModal$1, FlagAlert, ViewIcon } from '@bjsdistribution/dms-component-library';
9
9
  import dayjs from 'dayjs';
10
10
  import 'react-datepicker/dist/react-datepicker.css';
11
11
  import { useReactTable, getCoreRowModel, getSortedRowModel, flexRender } from '@tanstack/react-table';
@@ -1313,22 +1313,21 @@ var ReturnFilter = function ReturnFilter() {
1313
1313
  return React.createElement(React.Fragment, null, React.createElement(StyledFiter, null, React.createElement(Text, null, customerName), React.createElement(StyledFIlterELements, null, React.createElement(StyledTableFilter, null)), React.createElement(RightFilters, null)));
1314
1314
  };
1315
1315
 
1316
- var _templateObject$3, _templateObject2$1, _templateObject3$1, _templateObject4$1, _templateObject34, _templateObject35, _templateObject36, _templateObject37;
1317
- var ColumStyle = /*#__PURE__*/styled.div(_templateObject$3 || (_templateObject$3 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n display: flex;\n width: 67px;\n align-items: center;\n gap: 7px;\n"])));
1318
- var GreyBox = /*#__PURE__*/styled.div(_templateObject2$1 || (_templateObject2$1 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n display: flex;\n padding: 3px 12px;\n align-items: flex-start;\n gap: 24px;\n border-radius: 6px;\n background: rgba(153, 153, 153, 0.1);\n"])));
1319
- // Styled components
1320
- var StyledTableWrapper = /*#__PURE__*/styled.div(_templateObject3$1 || (_templateObject3$1 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n overflow-x: auto;\n max-height: calc(100vh - 396px);\n /* box-shadow: 0px 0px 30px 6px rgba(46, 45, 116, 0.05); */\n &::-webkit-scrollbar {\n width: 5px;\n border-radius: 100px;\n height: 5px;\n }\n\n &::-webkit-scrollbar-track {\n background: #777;\n border-radius: 100px;\n }\n\n &::-webkit-scrollbar-thumb {\n background: #7b61ff;\n border-radius: 100px;\n }\n\n &::-webkit-scrollbar-thumb:hover {\n background: #7b61ff;\n }\n"])));
1321
- var StyledTable = /*#__PURE__*/styled.table(_templateObject4$1 || (_templateObject4$1 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n border-spacing: 0 10px;\n width: 100%;\n /* min-width: 1600px; */\n thead {\n position: sticky;\n top: 10px;\n z-index: 1;\n background: #fff;\n box-shadow: 0px 0px 1px #ffffff, 0px -10px 1px #ffffff;\n tr {\n border-radius: 40px;\n border-spacing: 0 10px;\n font-family: 'lato', sans-serif;\n .emailInvoiceCheckbox {\n padding-right: 0px;\n width: 0;\n > div {\n width: fit-content;\n }\n }\n .emailInvoiceNo {\n padding-left: 12px;\n }\n .emailInvoiceShare {\n width: 100px;\n }\n th {\n color: #3a3630;\n font-size: 14px;\n font-style: normal;\n font-weight: 600;\n line-height: normal;\n padding: 11px 15px;\n background: #f0f2f2;\n border-right: none;\n border-left: none;\n text-align: left;\n border: 1px solid rgba(0, 0, 0, 0.08);\n border-width: 1px 0;\n &:first-child {\n border-radius: 100px 0 0 100px;\n border-left: 1px solid rgba(0, 0, 0, 0.08);\n }\n &:last-child {\n border-radius: 0px 100px 100px 0;\n border-right: 1px solid rgba(0, 0, 0, 0.08);\n }\n }\n }\n }\n tbody {\n max-height: 400px;\n overflow-y: auto;\n tr {\n td {\n color: #3a3630;\n font-size: 13px;\n font-style: normal;\n font-weight: 400;\n line-height: normal;\n padding: 12px 15px;\n background: #fff;\n border: 1px solid rgba(0, 0, 0, 0.08);\n border-right: none;\n border-left: none;\n\n .shareIconContainer {\n display: flex;\n width: 24px;\n height: 24px;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n gap: 10px;\n flex-shrink: 0;\n border-radius: 15px;\n background: #edebe8;\n cursor: pointer;\n }\n .statuscontainer {\n display: flex;\n padding: 6px 10px;\n justify-content: center;\n align-items: center;\n gap: 5px;\n flex: 1 0 0;\n border-radius: 22px;\n background: rgba(41, 204, 106, 0.15);\n }\n }\n &:nth-child(even) td {\n background: #f6fbff;\n }\n td:first-child {\n border-radius: 100px 0 0 100px;\n border-left: 1px solid rgba(0, 0, 0, 0.08);\n }\n td:last-child {\n border-radius: 0px 100px 100px 0;\n border-right: 1px solid rgba(0, 0, 0, 0.08);\n }\n .flex {\n display: flex;\n flex-direction: row;\n gap: 5px;\n height: 29px;\n align-items: center;\n }\n\n &.insideTable {\n td {\n border-radius: 0;\n border: none;\n &:last-child {\n border-radius: 0;\n border-right: none;\n }\n }\n table {\n border-spacing: 0;\n width: 100%;\n border-radius: 5px;\n border: 1px solid rgba(0, 0, 0, 0.08);\n overflow: hidden;\n border-top-left-radius: 15px;\n border-top-right-radius: 15px;\n thead {\n tr {\n border-bottom: none;\n th {\n padding: 14px 20px;\n text-align: left;\n border-top: 0;\n border-right: 0;\n border-left: 0;\n background: #f8fafc;\n\n &:first-child {\n border-radius: 0;\n border-left: 1px solid rgba(0, 0, 0, 0.08);\n border-top-left-radius: 15px;\n }\n &:last-child {\n border-radius: 0;\n }\n }\n }\n }\n tbody {\n tr {\n td {\n padding: 14px 20px;\n text-align: left;\n border-bottom: 1px solid rgba(58, 54, 48, 0.15);\n background: #fff;\n > svg {\n transform: scale(1.5);\n background-color: #edebe8;\n border-radius: 20px;\n padding: 5px;\n }\n &:last-child {\n border-radius: 0;\n border-right: none;\n }\n }\n }\n }\n }\n }\n }\n }\n .actions {\n display: flex;\n align-items: center;\n gap: 20px;\n > svg {\n transform: scale(1.5);\n background-color: #edebe8;\n border-radius: 20px;\n padding: 5px;\n }\n\n .close-icon {\n transform: scale(1.3);\n background-color: transparent;\n border-radius: 0;\n padding: 0;\n }\n }\n"])));
1322
- var EmptyDataContainer = /*#__PURE__*/styled.div(_templateObject34 || (_templateObject34 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n display: flex;\n justify-content: center;\n"])));
1323
- var ClearAll = /*#__PURE__*/styled.div(_templateObject35 || (_templateObject35 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n border-radius: 20px;\n border: 1px solid #edebe8;\n background: #fff;\n display: flex;\n padding: 6px 6px;\n justify-content: center;\n align-items: center;\n gap: 8px;\n cursor: pointer;\n\n &.active {\n background: #313130;\n & > div {\n color: #fff;\n }\n }\n"])));
1324
- var StyledFilterBtnIcon = /*#__PURE__*/styled.div(_templateObject36 || (_templateObject36 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n display: flex;\n width: 24px;\n height: 24px;\n justify-content: center;\n align-items: center;\n border-radius: 20px;\n border: 1px solid #e2e0db;\n background: #b2b3b3;\n .cross {\n position: relative;\n &:after {\n display: inline-block;\n content: 'X';\n font-style: normal;\n font-size: 14px;\n color: #000;\n }\n }\n"])));
1325
- var StyledFilterBtnLabel = /*#__PURE__*/styled.div(_templateObject37 || (_templateObject37 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n color: #6a7378;\n font-size: 13px;\n font-style: normal;\n font-weight: 400;\n line-height: 16px;\n white-space: nowrap;\n"])));
1326
-
1327
- var _templateObject19, _templateObject20, _templateObject21;
1328
- var StyledTable$1 = /*#__PURE__*/styled.table(_templateObject19 || (_templateObject19 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n border-spacing: 0 10px;\n width: 100%;\n /* min-width: 1600px; */\n thead {\n white-space: nowrap;\n position: sticky;\n top: 10px;\n z-index: 1;\n background: #fff;\n box-shadow: 0px 0px 1px #ffffff, 0px -10px 1px #ffffff;\n tr {\n border-radius: 40px;\n border-spacing: 0 10px;\n position: relative;\n font-family: 'lato', sans-serif;\n .emailInvoiceCheckbox {\n padding-right: 0px;\n width: 0;\n > div {\n width: fit-content;\n }\n }\n .custom-check {\n position: absloute;\n }\n .emailInvoiceNo {\n padding-left: 0px;\n }\n .emailInvoiceShare {\n width: 100px;\n }\n th {\n color: #3a3630;\n font-size: 14px;\n font-style: normal;\n font-weight: 600;\n line-height: normal;\n padding: 11px 15px;\n background: #f0f2f2;\n border-right: none;\n border-left: none;\n text-align: left;\n border: 1px solid rgba(0, 0, 0, 0.08);\n border-width: 1px 0;\n &:first-child {\n border-radius: 100px 0 0 100px;\n border-left: 1px solid rgba(0, 0, 0, 0.08);\n }\n &:last-child {\n border-radius: 0px 100px 100px 0;\n border-right: 1px solid rgba(0, 0, 0, 0.08);\n }\n .sortIconClass {\n cursor: pointer;\n display: flex;\n }\n }\n }\n }\n tbody {\n max-height: 400px;\n overflow-y: auto;\n tr {\n td {\n color: #3a3630;\n font-size: 13px;\n font-style: normal;\n font-weight: 400;\n line-height: normal;\n padding: 12px 15px;\n background: #fff;\n border: 1px solid rgba(0, 0, 0, 0.08);\n border-right: none;\n border-left: none;\n position: relative;\n .actionbox {\n display: flex;\n gap: 5px;\n }\n .shareIconContainer {\n display: flex;\n padding: 2px 12px;\n align-items: center;\n gap: 8px;\n border-radius: 20px;\n border: 1px solid var(--tonal-brown-101, #e2e0db);\n background: #fff;\n list-style-type: none;\n /* padding-left: 0; */\n /* fontWeight: 600,\n paddingLeft: 0, */\n cursor: pointer;\n position: relative;\n }\n .statusCancelled {\n color: #e95252;\n /* background: rgba(233, 82, 82, 0.15); */\n padding: 4px 8px;\n border-radius: 4px;\n }\n\n .statusOnHold {\n color: #f4a503;\n /* background: #fff1d6; */\n padding: 4px 8px;\n border-radius: 4px;\n }\n\n .statusSubContracted {\n color: #845adf;\n /* background: rgba(132, 90, 223, 0.15); */\n padding: 4px 8px;\n border-radius: 4px;\n }\n\n .statusAwaiting {\n color: #845adf;\n /* background: rgba(132, 90, 223, 0.15); */\n padding: 4px 8px;\n border-radius: 4px;\n }\n\n .statusCompleted {\n color: #1f9254;\n /* background: rgba(41, 204, 106, 0.15); */\n padding: 4px 8px;\n border-radius: 4px;\n }\n\n .statusOutstanding {\n color: #f4a503;\n /* background: #fff1d6; */\n padding: 4px 8px;\n border-radius: 4px;\n }\n\n .statusUnknown {\n color: #000;\n /* background: #fff; */\n padding: 4px 8px;\n border-radius: 4px;\n }\n .statustext {\n color: #1f9254;\n font-family: 'Open Sans';\n font-size: 12px;\n font-style: normal;\n font-weight: 600;\n line-height: normal;\n }\n .downloadcontainer {\n display: flex;\n padding: 2px 12px;\n align-items: center;\n\n width: 28px;\n height: 28px;\n flex-direction: column;\n\n border-radius: 14px;\n border: 1px solid #e2e0db;\n background: #fff;\n }\n .statuscontainer {\n display: flex;\n padding: 5px 30px 5px 30px;\n justify-content: center;\n align-items: center;\n gap: 5px;\n flex: 1 0 0;\n border-radius: 22px;\n background: rgba(41, 204, 106, 0.15);\n }\n .awaiting {\n display: flex;\n min-width: 85px;\n padding: 6px 10px;\n justify-content: center;\n align-items: center;\n gap: 5px;\n border-radius: 22px;\n background: rgba(233, 82, 82, 0.15);\n color: #e95252;\n font-family: 'Open Sans';\n font-size: 12px;\n font-weight: 600;\n }\n ul > li > a {\n text-decoration: none !important;\n color: #0099ff;\n }\n }\n &:nth-child(even) td {\n background: #f6fbff;\n }\n td:first-child {\n border-radius: 100px 0 0 100px;\n border-left: 1px solid rgba(0, 0, 0, 0.08);\n }\n td:last-child {\n border-radius: 0px 100px 100px 0;\n border-right: 1px solid rgba(0, 0, 0, 0.08);\n }\n .flex {\n display: flex;\n flex-direction: row;\n gap: 5px;\n height: 29px;\n align-items: center;\n }\n\n &.insideTable {\n td {\n border-radius: 0;\n border: none;\n &:last-child {\n border-radius: 0;\n border-right: none;\n }\n }\n table {\n border-spacing: 0;\n width: 100%;\n border-radius: 5px;\n border: 1px solid rgba(0, 0, 0, 0.08);\n overflow: hidden;\n border-top-left-radius: 15px;\n border-top-right-radius: 15px;\n thead {\n tr {\n border-bottom: none;\n th {\n padding: 14px 20px;\n text-align: left;\n border-top: 0;\n border-right: 0;\n border-left: 0;\n background: #f8fafc;\n\n &:first-child {\n border-radius: 0;\n border-left: 1px solid rgba(0, 0, 0, 0.08);\n border-top-left-radius: 15px;\n }\n &:last-child {\n border-radius: 0;\n }\n }\n }\n }\n tbody {\n tr {\n td {\n padding: 14px 20px;\n text-align: left;\n border-bottom: 1px solid rgba(58, 54, 48, 0.15);\n background: #fff;\n > svg {\n transform: scale(1.5);\n background-color: #edebe8;\n border-radius: 20px;\n padding: 5px;\n }\n &:last-child {\n border-radius: 0;\n border-right: none;\n }\n }\n }\n }\n }\n }\n }\n }\n .actions {\n display: flex;\n align-items: center;\n gap: 20px;\n > svg {\n transform: scale(1.5);\n background-color: #edebe8;\n border-radius: 20px;\n padding: 5px;\n }\n\n .close-icon {\n transform: scale(1.3);\n background-color: transparent;\n border-radius: 0;\n padding: 0;\n }\n }\n"])));
1329
- // Styled components
1330
- var StyledTableWrapper$1 = /*#__PURE__*/styled.div(_templateObject20 || (_templateObject20 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n max-height: 60vh;\n overflow-x: auto;\n // min-height: 50vh;\n\n .fortables {\n max-height: 60vh;\n overflow-x: auto;\n min-height: 50vh;\n }\n /* height: 600px; */\n /* box-shadow: 0px 0px 30px 6px rgba(46, 45, 116, 0.05); */\n &::-webkit-scrollbar {\n width: 5px;\n border-radius: 100px;\n height: 5px;\n }\n\n &::-webkit-scrollbar-track {\n background: #777;\n border-radius: 100px;\n }\n\n &::-webkit-scrollbar-thumb {\n background: #7b61ff;\n border-radius: 100px;\n }\n\n &::-webkit-scrollbar-thumb:hover {\n background: #7b61ff;\n }\n"])));
1331
- var CustomDrop = /*#__PURE__*/styled.div(_templateObject21 || (_templateObject21 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n /* border-radius: 20px;\n border: 1px solid #e2e0db;\n background: #fff;\n display: flex;\n padding: 4px 8px;\n gap: 8px;\n align-items: center; */\n cursor: pointer;\n &.active .drop {\n transform: rotate(180deg);\n }\n"])));
1316
+ function DownIcon() {
1317
+ return React.createElement("svg", {
1318
+ xmlns: "http://www.w3.org/2000/svg",
1319
+ width: "18",
1320
+ height: "18",
1321
+ viewBox: "0 0 18 18",
1322
+ fill: "none"
1323
+ }, React.createElement("path", {
1324
+ opacity: "0.4",
1325
+ fillRule: "evenodd",
1326
+ clipRule: "evenodd",
1327
+ d: "M5.0184 7.41839C5.11965 7.31727 5.2569 7.26047 5.4 7.26047C5.5431 7.26047 5.68035 7.31727 5.7816 7.41839L9 10.6368L12.2184 7.41839C12.3208 7.32301 12.4562 7.27108 12.5961 7.27355C12.736 7.27601 12.8694 7.33269 12.9684 7.43162C13.0673 7.53056 13.124 7.66404 13.1264 7.80394C13.1289 7.94383 13.077 8.07923 12.9816 8.18159L9.3816 11.7816C9.28035 11.8827 9.1431 11.9395 9 11.9395C8.8569 11.9395 8.71965 11.8827 8.6184 11.7816L5.0184 8.18159C4.91727 8.08034 4.86047 7.94309 4.86047 7.79999C4.86047 7.65689 4.91727 7.51964 5.0184 7.41839Z",
1328
+ fill: "#3A3630"
1329
+ }));
1330
+ }
1332
1331
 
1333
1332
  var PrinterIcon = function PrinterIcon() {
1334
1333
  return React.createElement("svg", {
@@ -1343,22 +1342,43 @@ var PrinterIcon = function PrinterIcon() {
1343
1342
  }));
1344
1343
  };
1345
1344
 
1346
- function DownIcon() {
1347
- return React.createElement("svg", {
1348
- xmlns: "http://www.w3.org/2000/svg",
1349
- width: "18",
1350
- height: "18",
1345
+ function CaretDownFilledIcon(props) {
1346
+ return React.createElement("svg", Object.assign({
1347
+ width: "16",
1348
+ height: "16",
1351
1349
  viewBox: "0 0 18 18",
1352
- fill: "none"
1350
+ fill: "none",
1351
+ xmlns: "http://www.w3.org/2000/svg"
1352
+ }, props), React.createElement("g", {
1353
+ "clip-path": "url(#clip0_2034_435)"
1353
1354
  }, React.createElement("path", {
1354
- opacity: "0.4",
1355
- fillRule: "evenodd",
1356
- clipRule: "evenodd",
1357
- d: "M5.0184 7.41839C5.11965 7.31727 5.2569 7.26047 5.4 7.26047C5.5431 7.26047 5.68035 7.31727 5.7816 7.41839L9 10.6368L12.2184 7.41839C12.3208 7.32301 12.4562 7.27108 12.5961 7.27355C12.736 7.27601 12.8694 7.33269 12.9684 7.43162C13.0673 7.53056 13.124 7.66404 13.1264 7.80394C13.1289 7.94383 13.077 8.07923 12.9816 8.18159L9.3816 11.7816C9.28035 11.8827 9.1431 11.9395 9 11.9395C8.8569 11.9395 8.71965 11.8827 8.6184 11.7816L5.0184 8.18159C4.91727 8.08034 4.86047 7.94309 4.86047 7.79999C4.86047 7.65689 4.91727 7.51964 5.0184 7.41839Z",
1358
- fill: "#3A3630"
1359
- }));
1355
+ d: "M13.5 6.75C14.139 6.75 14.4727 7.4895 14.0872 7.96725L14.0302 8.03025L9.53021 12.5303C9.40107 12.6594 9.22924 12.737 9.04698 12.7484C8.86471 12.7599 8.68452 12.7044 8.54021 12.5925L8.46971 12.5303L3.96972 8.03025L3.90746 7.95975L3.86697 7.902L3.82647 7.83L3.81371 7.803L3.79347 7.75275L3.76946 7.67175L3.76196 7.632L3.75446 7.587L3.75146 7.54425V7.45575L3.75521 7.41225L3.76196 7.36725L3.76946 7.32825L3.79347 7.24725L3.81371 7.197L3.86622 7.098L3.91496 7.0305L3.96972 6.96975L4.04021 6.9075L4.09797 6.867L4.16996 6.8265L4.19697 6.81375L4.24721 6.7935L4.32821 6.7695L4.36796 6.762L4.41296 6.7545L4.45571 6.7515L13.5 6.75Z",
1356
+ fill: "#9E9E9E"
1357
+ })), React.createElement("defs", null, React.createElement("clipPath", {
1358
+ id: "clip0_2034_435"
1359
+ }, React.createElement("rect", {
1360
+ width: "16",
1361
+ height: "16",
1362
+ fill: "white"
1363
+ }))));
1360
1364
  }
1361
1365
 
1366
+ var SortIcon = function SortIcon() {
1367
+ return React.createElement("svg", {
1368
+ width: "16",
1369
+ height: "17",
1370
+ viewBox: "0 0 16 17",
1371
+ fill: "none",
1372
+ xmlns: "http://www.w3.org/2000/svg"
1373
+ }, React.createElement("g", {
1374
+ id: "bxs:sort-alt"
1375
+ }, React.createElement("path", {
1376
+ id: "Vector",
1377
+ d: "M4.15138 7.83335H11.8494C12.424 7.83335 12.7294 7.15335 12.3474 6.72335L8.49871 2.39335C8.43628 2.32288 8.35961 2.26647 8.27377 2.22783C8.18792 2.1892 8.09485 2.16922 8.00071 2.16922C7.90657 2.16922 7.8135 2.1892 7.72766 2.22783C7.64181 2.26647 7.56514 2.32288 7.50271 2.39335L3.65271 6.72335C3.27071 7.15335 3.57604 7.83335 4.15138 7.83335ZM7.50204 14.606C7.56447 14.6765 7.64114 14.7329 7.72699 14.7715C7.81284 14.8102 7.9059 14.8301 8.00004 14.8301C8.09418 14.8301 8.18725 14.8102 8.2731 14.7715C8.35895 14.7329 8.43562 14.6765 8.49804 14.606L12.3467 10.276C12.7294 9.84668 12.424 9.16668 11.8487 9.16668H4.15138C3.57671 9.16668 3.27138 9.84668 3.65338 10.2767L7.50204 14.606Z",
1378
+ fill: "#9E9E9E"
1379
+ })));
1380
+ };
1381
+
1362
1382
  var CollectionLabelIcon = function CollectionLabelIcon() {
1363
1383
  return React.createElement("svg", {
1364
1384
  xmlns: "http://www.w3.org/2000/svg",
@@ -1517,7 +1537,7 @@ var optionsForReturnPrint = [{
1517
1537
  label: 'Print Return Labels'
1518
1538
  }];
1519
1539
 
1520
- var _templateObject$4, _templateObject2$2;
1540
+ var _templateObject$3, _templateObject2$1;
1521
1541
  var options = optionsForReturnPrint;
1522
1542
  var PrintDropDownReturn = function PrintDropDownReturn(_ref) {
1523
1543
  var legacyURL = _ref.legacyURL,
@@ -1538,8 +1558,8 @@ var PrintDropDownReturn = function PrintDropDownReturn(_ref) {
1538
1558
  }, IconComponent && React.createElement(IconComponent, null), " ", item.label);
1539
1559
  }));
1540
1560
  };
1541
- var OptionsList = /*#__PURE__*/styled.ul(_templateObject$4 || (_templateObject$4 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n margin: 0;\n padding: 0;\n list-style: none;\n box-sizing: border-box;\n border-radius: 6px;\n border: 1px solid rgba(224, 226, 231, 0.5);\n background: #fff;\n box-shadow: 0px 4px 30px 0px rgba(46, 45, 116, 0.05);\n width: 177px;\n padding: 5px 1px 3px 1px;\n position: absolute;\n top: 26px;\n right: 0;\n z-index: 99;\n min-width: 194px;\n"])));
1542
- var OptionsListLi = /*#__PURE__*/styled.li(_templateObject2$2 || (_templateObject2$2 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n border-bottom: 1px solid #f0f2f2;\n padding: 8px 10px;\n display: flex;\n gap: 12px;\n align-items: center;\n font-size: 13px;\n cursor: ", ";\n color: ", ";\n pointer-events: ", ";\n background-color: ", ";\n\n &:last-child {\n border: none;\n }\n"])), function (_ref2) {
1561
+ var OptionsList = /*#__PURE__*/styled.ul(_templateObject$3 || (_templateObject$3 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n margin: 0;\n padding: 0;\n list-style: none;\n box-sizing: border-box;\n border-radius: 6px;\n border: 1px solid rgba(224, 226, 231, 0.5);\n background: #fff;\n box-shadow: 0px 4px 30px 0px rgba(46, 45, 116, 0.05);\n width: 177px;\n padding: 5px 1px 3px 1px;\n position: absolute;\n top: 26px;\n right: 0;\n z-index: 99;\n min-width: 194px;\n"])));
1562
+ var OptionsListLi = /*#__PURE__*/styled.li(_templateObject2$1 || (_templateObject2$1 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n border-bottom: 1px solid #f0f2f2;\n padding: 8px 10px;\n display: flex;\n gap: 12px;\n align-items: center;\n font-size: 13px;\n cursor: ", ";\n color: ", ";\n pointer-events: ", ";\n background-color: ", ";\n\n &:last-child {\n border: none;\n }\n"])), function (_ref2) {
1543
1563
  var disabled = _ref2.disabled;
1544
1564
  return disabled ? 'not-allowed' : 'pointer';
1545
1565
  }, function (_ref3) {
@@ -1553,42 +1573,22 @@ var OptionsListLi = /*#__PURE__*/styled.li(_templateObject2$2 || (_templateObjec
1553
1573
  return disabled ? '#f5f5f5' : 'transparent';
1554
1574
  });
1555
1575
 
1556
- function CaretDownFilledIcon(props) {
1557
- return React.createElement("svg", Object.assign({
1558
- width: "16",
1559
- height: "16",
1560
- viewBox: "0 0 18 18",
1561
- fill: "none",
1562
- xmlns: "http://www.w3.org/2000/svg"
1563
- }, props), React.createElement("g", {
1564
- "clip-path": "url(#clip0_2034_435)"
1565
- }, React.createElement("path", {
1566
- d: "M13.5 6.75C14.139 6.75 14.4727 7.4895 14.0872 7.96725L14.0302 8.03025L9.53021 12.5303C9.40107 12.6594 9.22924 12.737 9.04698 12.7484C8.86471 12.7599 8.68452 12.7044 8.54021 12.5925L8.46971 12.5303L3.96972 8.03025L3.90746 7.95975L3.86697 7.902L3.82647 7.83L3.81371 7.803L3.79347 7.75275L3.76946 7.67175L3.76196 7.632L3.75446 7.587L3.75146 7.54425V7.45575L3.75521 7.41225L3.76196 7.36725L3.76946 7.32825L3.79347 7.24725L3.81371 7.197L3.86622 7.098L3.91496 7.0305L3.96972 6.96975L4.04021 6.9075L4.09797 6.867L4.16996 6.8265L4.19697 6.81375L4.24721 6.7935L4.32821 6.7695L4.36796 6.762L4.41296 6.7545L4.45571 6.7515L13.5 6.75Z",
1567
- fill: "#9E9E9E"
1568
- })), React.createElement("defs", null, React.createElement("clipPath", {
1569
- id: "clip0_2034_435"
1570
- }, React.createElement("rect", {
1571
- width: "16",
1572
- height: "16",
1573
- fill: "white"
1574
- }))));
1575
- }
1576
+ var _templateObject$4, _templateObject2$2, _templateObject3$1, _templateObject4$1, _templateObject34, _templateObject35, _templateObject36, _templateObject37;
1577
+ var ColumStyle = /*#__PURE__*/styled.div(_templateObject$4 || (_templateObject$4 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n display: flex;\n width: 67px;\n align-items: center;\n gap: 7px;\n"])));
1578
+ var GreyBox = /*#__PURE__*/styled.div(_templateObject2$2 || (_templateObject2$2 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n display: flex;\n padding: 3px 12px;\n align-items: flex-start;\n gap: 24px;\n border-radius: 6px;\n background: rgba(153, 153, 153, 0.1);\n"])));
1579
+ // Styled components
1580
+ var StyledTableWrapper = /*#__PURE__*/styled.div(_templateObject3$1 || (_templateObject3$1 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n overflow-x: auto;\n max-height: calc(100vh - 396px);\n /* box-shadow: 0px 0px 30px 6px rgba(46, 45, 116, 0.05); */\n &::-webkit-scrollbar {\n width: 5px;\n border-radius: 100px;\n height: 5px;\n }\n\n &::-webkit-scrollbar-track {\n background: #777;\n border-radius: 100px;\n }\n\n &::-webkit-scrollbar-thumb {\n background: #7b61ff;\n border-radius: 100px;\n }\n\n &::-webkit-scrollbar-thumb:hover {\n background: #7b61ff;\n }\n"])));
1581
+ var StyledTable = /*#__PURE__*/styled.table(_templateObject4$1 || (_templateObject4$1 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n border-spacing: 0 10px;\n width: 100%;\n /* min-width: 1600px; */\n thead {\n position: sticky;\n top: 10px;\n z-index: 1;\n background: #fff;\n box-shadow: 0px 0px 1px #ffffff, 0px -10px 1px #ffffff;\n tr {\n border-radius: 40px;\n border-spacing: 0 10px;\n font-family: 'lato', sans-serif;\n .emailInvoiceCheckbox {\n padding-right: 0px;\n width: 0;\n > div {\n width: fit-content;\n }\n }\n .emailInvoiceNo {\n padding-left: 12px;\n }\n .emailInvoiceShare {\n width: 100px;\n }\n th {\n color: #3a3630;\n font-size: 14px;\n font-style: normal;\n font-weight: 600;\n line-height: normal;\n padding: 11px 15px;\n background: #f0f2f2;\n border-right: none;\n border-left: none;\n text-align: left;\n border: 1px solid rgba(0, 0, 0, 0.08);\n border-width: 1px 0;\n &:first-child {\n border-radius: 100px 0 0 100px;\n border-left: 1px solid rgba(0, 0, 0, 0.08);\n }\n &:last-child {\n border-radius: 0px 100px 100px 0;\n border-right: 1px solid rgba(0, 0, 0, 0.08);\n }\n }\n }\n }\n tbody {\n max-height: 400px;\n overflow-y: auto;\n tr {\n td {\n color: #3a3630;\n font-size: 13px;\n font-style: normal;\n font-weight: 400;\n line-height: normal;\n padding: 12px 15px;\n background: #fff;\n border: 1px solid rgba(0, 0, 0, 0.08);\n border-right: none;\n border-left: none;\n\n .shareIconContainer {\n display: flex;\n width: 24px;\n height: 24px;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n gap: 10px;\n flex-shrink: 0;\n border-radius: 15px;\n background: #edebe8;\n cursor: pointer;\n }\n .statuscontainer {\n display: flex;\n padding: 6px 10px;\n justify-content: center;\n align-items: center;\n gap: 5px;\n flex: 1 0 0;\n border-radius: 22px;\n background: rgba(41, 204, 106, 0.15);\n }\n }\n &:nth-child(even) td {\n background: #f6fbff;\n }\n td:first-child {\n border-radius: 100px 0 0 100px;\n border-left: 1px solid rgba(0, 0, 0, 0.08);\n }\n td:last-child {\n border-radius: 0px 100px 100px 0;\n border-right: 1px solid rgba(0, 0, 0, 0.08);\n }\n .flex {\n display: flex;\n flex-direction: row;\n gap: 5px;\n height: 29px;\n align-items: center;\n }\n\n &.insideTable {\n td {\n border-radius: 0;\n border: none;\n &:last-child {\n border-radius: 0;\n border-right: none;\n }\n }\n table {\n border-spacing: 0;\n width: 100%;\n border-radius: 5px;\n border: 1px solid rgba(0, 0, 0, 0.08);\n overflow: hidden;\n border-top-left-radius: 15px;\n border-top-right-radius: 15px;\n thead {\n tr {\n border-bottom: none;\n th {\n padding: 14px 20px;\n text-align: left;\n border-top: 0;\n border-right: 0;\n border-left: 0;\n background: #f8fafc;\n\n &:first-child {\n border-radius: 0;\n border-left: 1px solid rgba(0, 0, 0, 0.08);\n border-top-left-radius: 15px;\n }\n &:last-child {\n border-radius: 0;\n }\n }\n }\n }\n tbody {\n tr {\n td {\n padding: 14px 20px;\n text-align: left;\n border-bottom: 1px solid rgba(58, 54, 48, 0.15);\n background: #fff;\n > svg {\n transform: scale(1.5);\n background-color: #edebe8;\n border-radius: 20px;\n padding: 5px;\n }\n &:last-child {\n border-radius: 0;\n border-right: none;\n }\n }\n }\n }\n }\n }\n }\n }\n .actions {\n display: flex;\n align-items: center;\n gap: 20px;\n > svg {\n transform: scale(1.5);\n background-color: #edebe8;\n border-radius: 20px;\n padding: 5px;\n }\n\n .close-icon {\n transform: scale(1.3);\n background-color: transparent;\n border-radius: 0;\n padding: 0;\n }\n }\n"])));
1582
+ var EmptyDataContainer = /*#__PURE__*/styled.div(_templateObject34 || (_templateObject34 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n display: flex;\n justify-content: center;\n"])));
1583
+ var ClearAll = /*#__PURE__*/styled.div(_templateObject35 || (_templateObject35 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n border-radius: 20px;\n border: 1px solid #edebe8;\n background: #fff;\n display: flex;\n padding: 6px 6px;\n justify-content: center;\n align-items: center;\n gap: 8px;\n cursor: pointer;\n\n &.active {\n background: #313130;\n & > div {\n color: #fff;\n }\n }\n"])));
1584
+ var StyledFilterBtnIcon = /*#__PURE__*/styled.div(_templateObject36 || (_templateObject36 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n display: flex;\n width: 24px;\n height: 24px;\n justify-content: center;\n align-items: center;\n border-radius: 20px;\n border: 1px solid #e2e0db;\n background: #b2b3b3;\n .cross {\n position: relative;\n &:after {\n display: inline-block;\n content: 'X';\n font-style: normal;\n font-size: 14px;\n color: #000;\n }\n }\n"])));
1585
+ var StyledFilterBtnLabel = /*#__PURE__*/styled.div(_templateObject37 || (_templateObject37 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n color: #6a7378;\n font-size: 13px;\n font-style: normal;\n font-weight: 400;\n line-height: 16px;\n white-space: nowrap;\n"])));
1576
1586
 
1577
- var SortIcon = function SortIcon() {
1578
- return React.createElement("svg", {
1579
- width: "16",
1580
- height: "17",
1581
- viewBox: "0 0 16 17",
1582
- fill: "none",
1583
- xmlns: "http://www.w3.org/2000/svg"
1584
- }, React.createElement("g", {
1585
- id: "bxs:sort-alt"
1586
- }, React.createElement("path", {
1587
- id: "Vector",
1588
- d: "M4.15138 7.83335H11.8494C12.424 7.83335 12.7294 7.15335 12.3474 6.72335L8.49871 2.39335C8.43628 2.32288 8.35961 2.26647 8.27377 2.22783C8.18792 2.1892 8.09485 2.16922 8.00071 2.16922C7.90657 2.16922 7.8135 2.1892 7.72766 2.22783C7.64181 2.26647 7.56514 2.32288 7.50271 2.39335L3.65271 6.72335C3.27071 7.15335 3.57604 7.83335 4.15138 7.83335ZM7.50204 14.606C7.56447 14.6765 7.64114 14.7329 7.72699 14.7715C7.81284 14.8102 7.9059 14.8301 8.00004 14.8301C8.09418 14.8301 8.18725 14.8102 8.2731 14.7715C8.35895 14.7329 8.43562 14.6765 8.49804 14.606L12.3467 10.276C12.7294 9.84668 12.424 9.16668 11.8487 9.16668H4.15138C3.57671 9.16668 3.27138 9.84668 3.65338 10.2767L7.50204 14.606Z",
1589
- fill: "#9E9E9E"
1590
- })));
1591
- };
1587
+ var _templateObject19, _templateObject20, _templateObject21;
1588
+ var StyledTable$1 = /*#__PURE__*/styled.table(_templateObject19 || (_templateObject19 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n border-spacing: 0 10px;\n width: 100%;\n /* min-width: 1600px; */\n thead {\n white-space: nowrap;\n position: sticky;\n top: 10px;\n z-index: 1;\n background: #fff;\n box-shadow: 0px 0px 1px #ffffff, 0px -10px 1px #ffffff;\n tr {\n border-radius: 40px;\n border-spacing: 0 10px;\n position: relative;\n font-family: 'lato', sans-serif;\n .emailInvoiceCheckbox {\n padding-right: 0px;\n width: 0;\n > div {\n width: fit-content;\n }\n }\n .custom-check {\n position: absloute;\n }\n .emailInvoiceNo {\n padding-left: 0px;\n }\n .emailInvoiceShare {\n width: 100px;\n }\n th {\n color: #3a3630;\n font-size: 14px;\n font-style: normal;\n font-weight: 600;\n line-height: normal;\n padding: 11px 15px;\n background: #f0f2f2;\n border-right: none;\n border-left: none;\n text-align: left;\n border: 1px solid rgba(0, 0, 0, 0.08);\n border-width: 1px 0;\n &:first-child {\n border-radius: 100px 0 0 100px;\n border-left: 1px solid rgba(0, 0, 0, 0.08);\n }\n &:last-child {\n border-radius: 0px 100px 100px 0;\n border-right: 1px solid rgba(0, 0, 0, 0.08);\n }\n .sortIconClass {\n cursor: pointer;\n display: flex;\n }\n }\n }\n }\n tbody {\n max-height: 400px;\n overflow-y: auto;\n tr {\n td {\n color: #3a3630;\n font-size: 13px;\n font-style: normal;\n font-weight: 400;\n line-height: normal;\n padding: 12px 15px;\n background: #fff;\n border: 1px solid rgba(0, 0, 0, 0.08);\n border-right: none;\n border-left: none;\n position: relative;\n .actionbox {\n display: flex;\n gap: 5px;\n }\n .shareIconContainer {\n display: flex;\n padding: 2px 12px;\n align-items: center;\n gap: 8px;\n border-radius: 20px;\n border: 1px solid var(--tonal-brown-101, #e2e0db);\n background: #fff;\n list-style-type: none;\n /* padding-left: 0; */\n /* fontWeight: 600,\n paddingLeft: 0, */\n cursor: pointer;\n position: relative;\n }\n .statusCancelled {\n color: #e95252;\n /* background: rgba(233, 82, 82, 0.15); */\n padding: 4px 8px;\n border-radius: 4px;\n }\n\n .statusOnHold {\n color: #f4a503;\n /* background: #fff1d6; */\n padding: 4px 8px;\n border-radius: 4px;\n }\n\n .statusSubContracted {\n color: #845adf;\n /* background: rgba(132, 90, 223, 0.15); */\n padding: 4px 8px;\n border-radius: 4px;\n }\n\n .statusAwaiting {\n color: #845adf;\n /* background: rgba(132, 90, 223, 0.15); */\n padding: 4px 8px;\n border-radius: 4px;\n }\n\n .statusCompleted {\n color: #1f9254;\n /* background: rgba(41, 204, 106, 0.15); */\n padding: 4px 8px;\n border-radius: 4px;\n }\n\n .statusOutstanding {\n color: #f4a503;\n /* background: #fff1d6; */\n padding: 4px 8px;\n border-radius: 4px;\n }\n\n .statusUnknown {\n color: #000;\n /* background: #fff; */\n padding: 4px 8px;\n border-radius: 4px;\n }\n .statustext {\n color: #1f9254;\n font-family: 'Open Sans';\n font-size: 12px;\n font-style: normal;\n font-weight: 600;\n line-height: normal;\n }\n .downloadcontainer {\n display: flex;\n padding: 2px 12px;\n align-items: center;\n\n width: 28px;\n height: 28px;\n flex-direction: column;\n\n border-radius: 14px;\n border: 1px solid #e2e0db;\n background: #fff;\n }\n .statuscontainer {\n display: flex;\n padding: 5px 30px 5px 30px;\n justify-content: center;\n align-items: center;\n gap: 5px;\n flex: 1 0 0;\n border-radius: 22px;\n background: rgba(41, 204, 106, 0.15);\n }\n .awaiting {\n display: flex;\n min-width: 85px;\n padding: 6px 10px;\n justify-content: center;\n align-items: center;\n gap: 5px;\n border-radius: 22px;\n background: rgba(233, 82, 82, 0.15);\n color: #e95252;\n font-family: 'Open Sans';\n font-size: 12px;\n font-weight: 600;\n }\n ul > li > a {\n text-decoration: none !important;\n color: #0099ff;\n }\n }\n &:nth-child(even) td {\n background: #f6fbff;\n }\n td:first-child {\n border-radius: 100px 0 0 100px;\n border-left: 1px solid rgba(0, 0, 0, 0.08);\n }\n td:last-child {\n border-radius: 0px 100px 100px 0;\n border-right: 1px solid rgba(0, 0, 0, 0.08);\n }\n .flex {\n display: flex;\n flex-direction: row;\n gap: 5px;\n height: 29px;\n align-items: center;\n }\n\n &.insideTable {\n td {\n border-radius: 0;\n border: none;\n &:last-child {\n border-radius: 0;\n border-right: none;\n }\n }\n table {\n border-spacing: 0;\n width: 100%;\n border-radius: 5px;\n border: 1px solid rgba(0, 0, 0, 0.08);\n overflow: hidden;\n border-top-left-radius: 15px;\n border-top-right-radius: 15px;\n thead {\n tr {\n border-bottom: none;\n th {\n padding: 14px 20px;\n text-align: left;\n border-top: 0;\n border-right: 0;\n border-left: 0;\n background: #f8fafc;\n\n &:first-child {\n border-radius: 0;\n border-left: 1px solid rgba(0, 0, 0, 0.08);\n border-top-left-radius: 15px;\n }\n &:last-child {\n border-radius: 0;\n }\n }\n }\n }\n tbody {\n tr {\n td {\n padding: 14px 20px;\n text-align: left;\n border-bottom: 1px solid rgba(58, 54, 48, 0.15);\n background: #fff;\n > svg {\n transform: scale(1.5);\n background-color: #edebe8;\n border-radius: 20px;\n padding: 5px;\n }\n &:last-child {\n border-radius: 0;\n border-right: none;\n }\n }\n }\n }\n }\n }\n }\n }\n .actions {\n display: flex;\n align-items: center;\n gap: 20px;\n > svg {\n transform: scale(1.5);\n background-color: #edebe8;\n border-radius: 20px;\n padding: 5px;\n }\n\n .close-icon {\n transform: scale(1.3);\n background-color: transparent;\n border-radius: 0;\n padding: 0;\n }\n }\n"])));
1589
+ // Styled components
1590
+ var StyledTableWrapper$1 = /*#__PURE__*/styled.div(_templateObject20 || (_templateObject20 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n max-height: 60vh;\n overflow-x: auto;\n // min-height: 50vh;\n\n .fortables {\n max-height: 60vh;\n overflow-x: auto;\n min-height: 50vh;\n }\n /* height: 600px; */\n /* box-shadow: 0px 0px 30px 6px rgba(46, 45, 116, 0.05); */\n &::-webkit-scrollbar {\n width: 5px;\n border-radius: 100px;\n height: 5px;\n }\n\n &::-webkit-scrollbar-track {\n background: #777;\n border-radius: 100px;\n }\n\n &::-webkit-scrollbar-thumb {\n background: #7b61ff;\n border-radius: 100px;\n }\n\n &::-webkit-scrollbar-thumb:hover {\n background: #7b61ff;\n }\n"])));
1591
+ var CustomDrop = /*#__PURE__*/styled.div(_templateObject21 || (_templateObject21 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n /* border-radius: 20px;\n border: 1px solid #e2e0db;\n background: #fff;\n display: flex;\n padding: 4px 8px;\n gap: 8px;\n align-items: center; */\n cursor: pointer;\n &.active .drop {\n transform: rotate(180deg);\n }\n"])));
1592
1592
 
1593
1593
  var _excluded = ["count"];
1594
1594
  var ReturnOrderTable = function ReturnOrderTable() {
@@ -1608,7 +1608,6 @@ var ReturnOrderTable = function ReturnOrderTable() {
1608
1608
  var _useLoading = useLoading(),
1609
1609
  load = _useLoading[0],
1610
1610
  setLoading = _useLoading[1];
1611
- // const [postLoading] = usePostLoading();
1612
1611
  var dropdownRefParent = useRef(null);
1613
1612
  var dropdownRef = useRef(null);
1614
1613
  var _usePrintOptionTOggle = usePrintOptionTOggle(),
@@ -1738,12 +1737,14 @@ var ReturnOrderTable = function ReturnOrderTable() {
1738
1737
  // setShouldPerformAction(false);
1739
1738
  }, [fetchedOrderData, returnDataLoad, locationData, state, callForFetch]);
1740
1739
  var handleSelectAll = function handleSelectAll(e) {
1741
- setSelectAll(e.target.checked);
1742
- if (e.target.checked) {
1743
- setSelectedReturnOrder(returnData == null ? void 0 : returnData.filter(function (loc) {
1740
+ var isChecked = e.target.checked;
1741
+ setSelectAll(isChecked);
1742
+ if (isChecked) {
1743
+ var filteredData = returnData == null ? void 0 : returnData.filter(function (loc) {
1744
1744
  var _loc$order_product_re;
1745
1745
  return (loc == null || (_loc$order_product_re = loc.order_product_return_action) == null ? void 0 : _loc$order_product_re.type) === 'RTS';
1746
- }).map(function (loc) {
1746
+ });
1747
+ var selectedOrders = filteredData.map(function (loc) {
1747
1748
  return {
1748
1749
  id: loc.id,
1749
1750
  return_locations: loc == null ? void 0 : loc.return_locations,
@@ -1752,30 +1753,27 @@ var ReturnOrderTable = function ReturnOrderTable() {
1752
1753
  order_product_return_action: loc == null ? void 0 : loc.order_product_return_action,
1753
1754
  return_location_token: loc == null ? void 0 : loc.return_location
1754
1755
  };
1755
- }));
1756
- setNewPayload(returnData == null ? void 0 : returnData.filter(function (loc) {
1756
+ });
1757
+ var newPayload = filteredData.map(function (loc) {
1757
1758
  var _loc$order_product_re2;
1758
- return (loc == null || (_loc$order_product_re2 = loc.order_product_return_action) == null ? void 0 : _loc$order_product_re2.type) === 'RTS';
1759
- }).map(function (loc) {
1760
- var _loc$order_product_re3;
1761
1759
  return {
1762
1760
  id: loc.id,
1763
1761
  account_number: createReturn == null ? void 0 : createReturn.account_number,
1764
1762
  customer_id: +(createReturn == null ? void 0 : createReturn.customer_id),
1765
1763
  products: [loc == null ? void 0 : loc.legacy_product_id],
1766
- return_action: loc == null || (_loc$order_product_re3 = loc.order_product_return_action) == null ? void 0 : _loc$order_product_re3.type,
1764
+ return_action: loc == null || (_loc$order_product_re2 = loc.order_product_return_action) == null ? void 0 : _loc$order_product_re2.type,
1767
1765
  return_location_token: (loc == null ? void 0 : loc.return_location) || null
1768
1766
  };
1769
- }));
1767
+ });
1768
+ setSelectedReturnOrder(selectedOrders);
1769
+ setNewPayload(newPayload);
1770
1770
  } else {
1771
1771
  setSelectedReturnOrder([]);
1772
1772
  setNewPayload([]);
1773
1773
  setGrouped([]);
1774
1774
  }
1775
1775
  };
1776
- var handleSelectOrderReturn = function handleSelectOrderReturn(id, return_location, return_locations, order_product_return_action,
1777
- // new_location: any,
1778
- legacy_product_id) {
1776
+ var handleSelectOrderReturn = function handleSelectOrderReturn(id, return_location, return_locations, order_product_return_action, legacy_product_id) {
1779
1777
  setSelectedReturnOrder(function (prevSelectedLocations) {
1780
1778
  var isSelected = prevSelectedLocations == null ? void 0 : prevSelectedLocations.some(function (loc) {
1781
1779
  return loc.id === id;
@@ -1796,32 +1794,32 @@ var ReturnOrderTable = function ReturnOrderTable() {
1796
1794
  return item.id !== id;
1797
1795
  });
1798
1796
  });
1797
+ setSelectAll(false); // Ensure "select all" is false if one is deselected
1799
1798
  return updatedSelectedLocations;
1800
1799
  } else {
1800
+ var _returnData$filter;
1801
1801
  var newReturnPayload = {
1802
1802
  id: id,
1803
1803
  account_number: createReturn == null ? void 0 : createReturn.account_number,
1804
1804
  customer_id: +(createReturn == null ? void 0 : createReturn.customer_id),
1805
1805
  products: [legacy_product_id],
1806
- return_action: order_product_return_action != null && order_product_return_action.type ? [order_product_return_action.type] : null,
1806
+ return_action: (order_product_return_action == null ? void 0 : order_product_return_action.type) || null,
1807
1807
  return_location_token: return_location || null
1808
1808
  };
1809
1809
  setNewPayload(function (prevPayload) {
1810
1810
  return [].concat(prevPayload, [newReturnPayload]);
1811
1811
  });
1812
- setReturnPayload(function (prevState) {
1813
- return _extends({}, prevState, {
1814
- products: legacy_product_id,
1815
- return_action: (order_product_return_action == null ? void 0 : order_product_return_action.type) || null,
1816
- return_location_token: return_location || null
1817
- });
1818
- });
1819
- return [].concat(prevSelectedLocations, [{
1812
+ var _updatedSelectedLocations = [].concat(prevSelectedLocations, [{
1820
1813
  id: id,
1821
1814
  return_location: return_location,
1822
1815
  return_locations: return_locations,
1823
1816
  order_product_return_action: order_product_return_action
1824
1817
  }]);
1818
+ setSelectAll((_updatedSelectedLocations == null ? void 0 : _updatedSelectedLocations.length) === (returnData == null || (_returnData$filter = returnData.filter(function (loc) {
1819
+ var _loc$order_product_re3;
1820
+ return (loc == null || (_loc$order_product_re3 = loc.order_product_return_action) == null ? void 0 : _loc$order_product_re3.type) === 'RTS';
1821
+ })) == null ? void 0 : _returnData$filter.length));
1822
+ return _updatedSelectedLocations;
1825
1823
  }
1826
1824
  });
1827
1825
  };
@@ -1904,17 +1902,15 @@ var ReturnOrderTable = function ReturnOrderTable() {
1904
1902
  var _item$order_product_r2, _item$orders_products, _item$orders_products2, _item$return_location, _item$order_data, _item$order_data2, _item$order_product_r3, _item$return_reasons, _item$order_product_r4, _item$order_product_r5, _item$collection_reas;
1905
1903
  return React.createElement("tr", {
1906
1904
  key: item.id
1907
- }, React.createElement("td", null, (item == null || (_item$order_product_r2 = item.order_product_return_action) == null ? void 0 : _item$order_product_r2.type) == 'RTS' ? React.createElement(React.Fragment, null, React.createElement(Checkbox$1, {
1905
+ }, React.createElement("td", null, (item == null || (_item$order_product_r2 = item.order_product_return_action) == null ? void 0 : _item$order_product_r2.type) === 'RTS' ? React.createElement(Checkbox$1, {
1908
1906
  className: "custom-check",
1909
- checked: selectedReturnOrder == null ? void 0 : selectedReturnOrder.some(function (selectedInvoice) {
1910
- return (selectedInvoice == null ? void 0 : selectedInvoice.id) === item.id;
1907
+ checked: selectedReturnOrder.some(function (selectedInvoice) {
1908
+ return (selectedInvoice == null ? void 0 : selectedInvoice.id) === (item == null ? void 0 : item.id);
1911
1909
  }),
1912
1910
  onChange: function onChange() {
1913
- return handleSelectOrderReturn(item.id, item.return_location, item.return_locations, item.order_product_return_action,
1914
- // item.new_location,
1915
- item.legacy_product_id);
1911
+ return handleSelectOrderReturn(item == null ? void 0 : item.id, item == null ? void 0 : item.return_location, item == null ? void 0 : item.return_locations, item == null ? void 0 : item.order_product_return_action, item == null ? void 0 : item.legacy_product_id);
1916
1912
  }
1917
- })) : null), React.createElement("td", null, (item == null || (_item$orders_products = item.orders_products_stock) == null ? void 0 : _item$orders_products.location) !== null && (item == null || (_item$orders_products2 = item.orders_products_stock) == null ? void 0 : _item$orders_products2.location) !== undefined ? item.orders_products_stock.location : React.createElement("div", {
1913
+ }) : null), React.createElement("td", null, (item == null || (_item$orders_products = item.orders_products_stock) == null ? void 0 : _item$orders_products.location) !== null && (item == null || (_item$orders_products2 = item.orders_products_stock) == null ? void 0 : _item$orders_products2.location) !== undefined ? item.orders_products_stock.location : React.createElement("div", {
1918
1914
  className: "awaiting"
1919
1915
  }, "Awaiting")), React.createElement("td", null, ' ', displayValueOrNA(item == null || (_item$return_location = item.return_locations) == null ? void 0 : _item$return_location.location_name)), React.createElement("td", null, React.createElement("ul", {
1920
1916
  style: {
@@ -2008,17 +2004,6 @@ var DefectsData = [{
2008
2004
  date: '6/11/2024 11:26:05 AM',
2009
2005
  images: ''
2010
2006
  }];
2011
- var getCookie = function getCookie(name) {
2012
- var value = "; " + document.cookie;
2013
- var parts = value.split("; " + name + "=");
2014
- if (parts.length === 2) {
2015
- var lastPart = parts.pop();
2016
- if (lastPart !== undefined) {
2017
- return lastPart.split(';').shift() || null;
2018
- }
2019
- }
2020
- return null;
2021
- };
2022
2007
  var handleKeyDown = function handleKeyDown(e) {
2023
2008
  // Allowed keys: numbers (0-9), '.', '-', '+'
2024
2009
  var allowedKeys = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '.', '-', '+', 'ArrowLeft', 'ArrowRight'];
@@ -5487,7 +5472,6 @@ function AddNote() {
5487
5472
  var location = useLocation();
5488
5473
  var pathname = location.pathname;
5489
5474
  var orderIdLocaation = pathname.split('/')[1];
5490
- var ssoToken = getCookie('id_token');
5491
5475
  var _usemoduleIds = usemoduleIds(),
5492
5476
  moduleIds = _usemoduleIds[0];
5493
5477
  var _useGlobalStateHitAud = useGlobalStateHitAuditLog(),
@@ -5495,12 +5479,17 @@ function AddNote() {
5495
5479
  var _useSelectedData = useSelectedData(),
5496
5480
  selected = _useSelectedData[0];
5497
5481
  // Save New Note
5482
+ var _useAxios = useAxios({
5483
+ endpoint: "/audit_logs/orders/",
5484
+ method: 'POST'
5485
+ }),
5486
+ callAuditLogs = _useAxios.fetchData;
5498
5487
  var _useState2 = useState(null),
5499
5488
  notificationData = _useState2[0],
5500
5489
  setNotificationData = _useState2[1];
5501
5490
  var saveNote = /*#__PURE__*/function () {
5502
5491
  var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
5503
- var endpoint, payload, response;
5492
+ var payload, response;
5504
5493
  return _regeneratorRuntime().wrap(function _callee$(_context) {
5505
5494
  while (1) switch (_context.prev = _context.next) {
5506
5495
  case 0:
@@ -5511,7 +5500,6 @@ function AddNote() {
5511
5500
  }
5512
5501
  return _context.abrupt("return");
5513
5502
  case 3:
5514
- endpoint = getBaseEndpoint() + "/audit_logs/orders/";
5515
5503
  payload = {
5516
5504
  audit_logs: [{
5517
5505
  parent_object_id: orderId || orderIdLocaation,
@@ -5524,47 +5512,41 @@ function AddNote() {
5524
5512
  manual: 1,
5525
5513
  is_private: selected
5526
5514
  }]
5527
- }; //to change
5528
- _context.prev = 5;
5529
- _context.next = 8;
5530
- return fetch(endpoint, {
5531
- method: 'POST',
5532
- headers: {
5533
- 'Content-Type': 'application/json',
5534
- Authorization: "Bearer " + ssoToken
5535
- },
5536
- body: JSON.stringify(payload)
5515
+ };
5516
+ _context.prev = 4;
5517
+ _context.next = 7;
5518
+ return callAuditLogs({
5519
+ payload: payload
5537
5520
  });
5538
- case 8:
5521
+ case 7:
5539
5522
  response = _context.sent;
5540
- // setNoteLoadingStore(false);
5541
- if (response.ok) {
5523
+ if (response.code == 200 && response != null && response.data) {
5542
5524
  notification.success({
5543
5525
  message: 'Success',
5544
- description: 'Note saved successfully.'
5526
+ description: "" + (response == null ? void 0 : response.message)
5545
5527
  });
5546
5528
  setNoteText('');
5547
5529
  setRecallAuditLog(true);
5548
5530
  } else {
5549
5531
  notification.error({
5550
5532
  message: 'Error',
5551
- description: 'Failed to save note.'
5533
+ description: "" + (response == null ? void 0 : response.error)
5552
5534
  });
5553
5535
  }
5554
- _context.next = 15;
5536
+ _context.next = 14;
5555
5537
  break;
5556
- case 12:
5557
- _context.prev = 12;
5558
- _context.t0 = _context["catch"](5);
5538
+ case 11:
5539
+ _context.prev = 11;
5540
+ _context.t0 = _context["catch"](4);
5559
5541
  notification.error({
5560
5542
  message: 'Error',
5561
5543
  description: 'Failed to save note due to an error.'
5562
5544
  });
5563
- case 15:
5545
+ case 14:
5564
5546
  case "end":
5565
5547
  return _context.stop();
5566
5548
  }
5567
- }, _callee, null, [[5, 12]]);
5549
+ }, _callee, null, [[4, 11]]);
5568
5550
  }));
5569
5551
  return function saveNote() {
5570
5552
  return _ref.apply(this, arguments);
@@ -6797,10 +6779,6 @@ var reminderData = /*#__PURE__*/atom([]);
6797
6779
  var resolvedModalPayload = /*#__PURE__*/atom(resolvedValue);
6798
6780
  var routeDetails = /*#__PURE__*/atom({});
6799
6781
  var orderNotifyCount = /*#__PURE__*/atom(0);
6800
- var taskLoading = /*#__PURE__*/atom(true);
6801
- function useTaskLoading() {
6802
- return useAtom(taskLoading);
6803
- }
6804
6782
  var initialConfirmOrderErrValues = {
6805
6783
  homeContactError: '',
6806
6784
  workContactError: '',
@@ -11590,7 +11568,7 @@ var NotifyFlag = function NotifyFlag() {
11590
11568
  }));
11591
11569
  };
11592
11570
 
11593
- var _templateObject$2e, _templateObject2$1D, _templateObject3$V, _templateObject4$w, _templateObject5$m, _templateObject6$c, _templateObject7$c, _templateObject8$a, _templateObject9$6, _templateObject10$4, _templateObject11$4, _templateObject12$2;
11571
+ var _templateObject$2e, _templateObject2$1D, _templateObject3$V, _templateObject4$w, _templateObject5$m, _templateObject6$c, _templateObject7$c, _templateObject8$a, _templateObject9$6;
11594
11572
  function Notification() {
11595
11573
  var _OrderData$order_rout;
11596
11574
  var _useTabType = useTabType(),
@@ -11603,8 +11581,7 @@ function Notification() {
11603
11581
  var _useNotificationData = useNotificationData(),
11604
11582
  notificationData = _useNotificationData[0],
11605
11583
  setNotififcationData = _useNotificationData[1];
11606
- var _useTaskLoading = useTaskLoading(),
11607
- flagLoading = _useTaskLoading[0];
11584
+ // const [flagLoading] = useTaskLoading();
11608
11585
  var _useReminderNotiData = useReminderNotiData(),
11609
11586
  reminderData = _useReminderNotiData[0],
11610
11587
  setReminderData = _useReminderNotiData[1];
@@ -11756,7 +11733,7 @@ function Notification() {
11756
11733
  onClick: function onClick() {
11757
11734
  return handleTabChange('closed');
11758
11735
  }
11759
- }, "Closed", React.createElement(ClosedCount, null, totalClosedCount)))), flagLoading ? React.createElement(Loader, null, React.createElement(Spinner, null), React.createElement(Text$9, null, "Fetching Notifications...")) : notificationData.length > 0 || reminderData.length > 0 || OrderData ? React.createElement(TabsWrapper, null, React.createElement(Tabs, {
11736
+ }, "Closed", React.createElement(ClosedCount, null, totalClosedCount)))), notificationData.length > 0 || reminderData.length > 0 || OrderData ? React.createElement(TabsWrapper, null, React.createElement(Tabs, {
11760
11737
  activeNotifications: activeNotifications,
11761
11738
  closedNotifications: closedNotifications,
11762
11739
  activeReminders: activeReminders,
@@ -11766,21 +11743,41 @@ function Notification() {
11766
11743
  })) : 'No Notifications Found'));
11767
11744
  }
11768
11745
  var Container$1a = /*#__PURE__*/styled.div(_templateObject$2e || (_templateObject$2e = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n display: flex;\n align-items: center;\n gap: 20px;\n padding: 10px;\n border-bottom: 1px solid #ccc;\n"])));
11769
- var Loader = /*#__PURE__*/styled.div(_templateObject2$1D || (_templateObject2$1D = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n align-items: center;\n justify-content: center;\n display: flex;\n flex-direction: column;\n gap: 10px;\n"])));
11770
- var Spinner = /*#__PURE__*/styled.div(_templateObject3$V || (_templateObject3$V = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n border: 4px solid rgba(0, 0, 0, 0.1);\n border-left-color: #3a3630;\n border-radius: 50%;\n width: 40px;\n height: 40px;\n animation: spin 1s linear infinite;\n\n @keyframes spin {\n 0% {\n transform: rotate(0deg);\n }\n 100% {\n transform: rotate(360deg);\n }\n }\n"])));
11771
- var FlagContainer = /*#__PURE__*/styled.div(_templateObject4$w || (_templateObject4$w = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n padding: 8px;\n background-color: #3a3630;\n border-radius: 10px;\n"])));
11772
- var TabsData = /*#__PURE__*/styled.div(_templateObject5$m || (_templateObject5$m = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n display: flex;\n align-items: center;\n gap: 20px;\n padding: 10px;\n"])));
11773
- var ActiveCount = /*#__PURE__*/styled.div(_templateObject6$c || (_templateObject6$c = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n color: #ffffff;\n padding: 1px 5px;\n background-color: #6396e5;\n border-radius: 6px;\n"])));
11774
- var ClosedCount = /*#__PURE__*/styled.div(_templateObject7$c || (_templateObject7$c = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n color: #ffffff;\n padding: 1px 5px;\n background-color: #e95252;\n border-radius: 6px;\n"])));
11775
- var StyledTab = /*#__PURE__*/styled.div(_templateObject8$a || (_templateObject8$a = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n display: flex;\n gap: 5px;\n cursor: pointer;\n color: ", ";\n border-bottom: ", ";\n transition: border-bottom 0.3s ease;\n font-family: 'Roboto', sans-serif;\n padding-bottom: 5px;\n align-items: center;\n"])), function (props) {
11746
+ // const Loader = styled.div`
11747
+ // align-items: center;
11748
+ // justify-content: center;
11749
+ // display: flex;
11750
+ // flex-direction: column;
11751
+ // gap: 10px;
11752
+ // `;
11753
+ // const Spinner = styled.div`
11754
+ // border: 4px solid rgba(0, 0, 0, 0.1);
11755
+ // border-left-color: #3a3630;
11756
+ // border-radius: 50%;
11757
+ // width: 40px;
11758
+ // height: 40px;
11759
+ // animation: spin 1s linear infinite;
11760
+ // @keyframes spin {
11761
+ // 0% {
11762
+ // transform: rotate(0deg);
11763
+ // }
11764
+ // 100% {
11765
+ // transform: rotate(360deg);
11766
+ // }
11767
+ // }
11768
+ // `;
11769
+ var FlagContainer = /*#__PURE__*/styled.div(_templateObject2$1D || (_templateObject2$1D = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n padding: 8px;\n background-color: #3a3630;\n border-radius: 10px;\n"])));
11770
+ var TabsData = /*#__PURE__*/styled.div(_templateObject3$V || (_templateObject3$V = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n display: flex;\n align-items: center;\n gap: 20px;\n padding: 10px;\n"])));
11771
+ var ActiveCount = /*#__PURE__*/styled.div(_templateObject4$w || (_templateObject4$w = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n color: #ffffff;\n padding: 1px 5px;\n background-color: #6396e5;\n border-radius: 6px;\n"])));
11772
+ var ClosedCount = /*#__PURE__*/styled.div(_templateObject5$m || (_templateObject5$m = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n color: #ffffff;\n padding: 1px 5px;\n background-color: #e95252;\n border-radius: 6px;\n"])));
11773
+ var StyledTab = /*#__PURE__*/styled.div(_templateObject6$c || (_templateObject6$c = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n display: flex;\n gap: 5px;\n cursor: pointer;\n color: ", ";\n border-bottom: ", ";\n transition: border-bottom 0.3s ease;\n font-family: 'Roboto', sans-serif;\n padding-bottom: 5px;\n align-items: center;\n"])), function (props) {
11776
11774
  return props.active ? '#3a3630' : '#AEA9A1';
11777
11775
  }, function (props) {
11778
11776
  return props.active ? '2px solid #feba30' : '2px solid #eeeeee';
11779
11777
  });
11780
- var Section$1 = /*#__PURE__*/styled.div(_templateObject9$6 || (_templateObject9$6 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n display: flex;\n flex-direction: column;\n gap: 14px;\n background: #ffffff;\n border-radius: 12px;\n padding: 10px;\n box-shadow: 0px 4px 30px 0px rgba(46, 45, 116, 0.05);\n border: 1px solid #e0e0e0;\n"])));
11781
- var Label$i = /*#__PURE__*/styled(SectionHeader)(_templateObject10$4 || (_templateObject10$4 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n border-bottom: 1px solid #ccc;\n font-family: 'Roboto', sans-serif;\n font-size: 16px;\n font-style: normal;\n font-weight: 500;\n line-height: 24px; /* 150% */\n text-transform: uppercase;\n"])));
11782
- var TabsWrapper = /*#__PURE__*/styled.div(_templateObject11$4 || (_templateObject11$4 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n /* min-height: 200px; */\n max-height: 250px;\n overflow-y: auto;\n scrollbar-width: none;\n -ms-overflow-style: none;\n\n &:hover {\n scrollbar-width: thin;\n }\n\n &::-webkit-scrollbar {\n width: 0;\n }\n\n &:hover::-webkit-scrollbar {\n width: 8px;\n }\n\n &::-webkit-scrollbar-thumb {\n background-color: rgba(0, 0, 0, 0.5);\n }\n"])));
11783
- var Text$9 = /*#__PURE__*/styled.div(_templateObject12$2 || (_templateObject12$2 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n color: var(--tonal-brown-651, #6a7378);\n font-family: Lato;\n font-size: 13px;\n font-style: normal;\n font-weight: 600;\n"])));
11778
+ var Section$1 = /*#__PURE__*/styled.div(_templateObject7$c || (_templateObject7$c = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n display: flex;\n flex-direction: column;\n gap: 14px;\n background: #ffffff;\n border-radius: 12px;\n padding: 10px;\n box-shadow: 0px 4px 30px 0px rgba(46, 45, 116, 0.05);\n border: 1px solid #e0e0e0;\n"])));
11779
+ var Label$i = /*#__PURE__*/styled(SectionHeader)(_templateObject8$a || (_templateObject8$a = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n border-bottom: 1px solid #ccc;\n font-family: 'Roboto', sans-serif;\n font-size: 16px;\n font-style: normal;\n font-weight: 500;\n line-height: 24px; /* 150% */\n text-transform: uppercase;\n"])));
11780
+ var TabsWrapper = /*#__PURE__*/styled.div(_templateObject9$6 || (_templateObject9$6 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n /* min-height: 200px; */\n max-height: 250px;\n overflow-y: auto;\n scrollbar-width: none;\n -ms-overflow-style: none;\n\n &:hover {\n scrollbar-width: thin;\n }\n\n &::-webkit-scrollbar {\n width: 0;\n }\n\n &:hover::-webkit-scrollbar {\n width: 8px;\n }\n\n &::-webkit-scrollbar-thumb {\n background-color: rgba(0, 0, 0, 0.5);\n }\n"])));
11784
11781
 
11785
11782
  var _templateObject$2f;
11786
11783
  function CollapsedContent$2() {