@bjsdistribution/dms-client-return 0.2.2-prod → 0.2.3-prod

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.
Files changed (151) hide show
  1. package/dist/common/expand-collapse/index.js +44 -26
  2. package/dist/common/expand-collapse/index.js.map +1 -1
  3. package/dist/common/modals/order-action-modal/OrderActionModal.js.map +1 -1
  4. package/dist/common/modals/order-action-modal/footer/OrderActionFooter.js.map +1 -1
  5. package/dist/components/client-portal/ClientPortalResponsive.js +148 -0
  6. package/dist/components/client-portal/ClientPortalResponsive.js.map +1 -0
  7. package/dist/components/client-portal/OutstandingTable.js +112 -118
  8. package/dist/components/client-portal/OutstandingTable.js.map +1 -1
  9. package/dist/components/client-portal/ReturnOverview.js +38 -37
  10. package/dist/components/client-portal/ReturnOverview.js.map +1 -1
  11. package/dist/components/client-portal/return-confirm/ConfirmedMain.js +4 -4
  12. package/dist/components/client-portal/return-confirm/ConfirmedMain.js.map +1 -1
  13. package/dist/components/client-portal/return-confirm/ReturnConfirmedTable.js +445 -185
  14. package/dist/components/client-portal/return-confirm/ReturnConfirmedTable.js.map +1 -1
  15. package/dist/components/fakeData.js.map +1 -1
  16. package/dist/components/order-daily-overview/common/fakedata.js.map +1 -1
  17. package/dist/components/order-daily-overview/common/mediaQuery.js +17 -0
  18. package/dist/components/order-daily-overview/common/mediaQuery.js.map +1 -0
  19. package/dist/components/order-daily-overview/filters/FilterStyle.js +174 -11
  20. package/dist/components/order-daily-overview/filters/FilterStyle.js.map +1 -1
  21. package/dist/components/order-daily-overview/header/route-header/RouterHeaderStyle.js +9 -4
  22. package/dist/components/order-daily-overview/header/route-header/RouterHeaderStyle.js.map +1 -1
  23. package/dist/components/order-daily-overview/header/route-header/title/HeaderTitle.js +11 -1
  24. package/dist/components/order-daily-overview/header/route-header/title/HeaderTitle.js.map +1 -1
  25. package/dist/components/order-daily-overview/header-filters/Styledfilters.js +46 -17
  26. package/dist/components/order-daily-overview/header-filters/Styledfilters.js.map +1 -1
  27. package/dist/components/order-daily-overview/index.js +76 -53
  28. package/dist/components/order-daily-overview/index.js.map +1 -1
  29. package/dist/components/order-daily-overview/return-after-table/table/OrderTable.js +101 -103
  30. package/dist/components/order-daily-overview/return-after-table/table/OrderTable.js.map +1 -1
  31. package/dist/components/order-daily-overview/return-after-table/table-filters/ReturnOrderFilter.js +135 -134
  32. package/dist/components/order-daily-overview/return-after-table/table-filters/ReturnOrderFilter.js.map +1 -1
  33. package/dist/components/order-daily-overview/return-after-table/table-filters/TableFilters.js +17 -11
  34. package/dist/components/order-daily-overview/return-after-table/table-filters/TableFilters.js.map +1 -1
  35. package/dist/components/order-daily-overview/return-order-table/return-orders-filters/ReturnFilter.js +5 -5
  36. package/dist/components/order-daily-overview/return-order-table/return-orders-filters/ReturnFilter.js.map +1 -1
  37. package/dist/components/order-daily-overview/return-order-table/return-orders-filters/ReturnOrderTable.js +129 -135
  38. package/dist/components/order-daily-overview/return-order-table/return-orders-filters/ReturnOrderTable.js.map +1 -1
  39. package/dist/components/order-daily-overview/return-order-table/return-orders-filters/returnstyles.js +346 -27
  40. package/dist/components/order-daily-overview/return-order-table/return-orders-filters/returnstyles.js.map +1 -1
  41. package/dist/components/order-daily-overview/table/ReturnTable.js +199 -183
  42. package/dist/components/order-daily-overview/table/ReturnTable.js.map +1 -1
  43. package/dist/components/order-daily-overview/table/table-data/styles.js +159 -38
  44. package/dist/components/order-daily-overview/table/table-data/styles.js.map +1 -1
  45. package/dist/components/order-daily-overview/table-view/PaginationStyle.js +21 -6
  46. package/dist/components/order-daily-overview/table-view/PaginationStyle.js.map +1 -1
  47. package/dist/components/order-view/DynamicTable.js +136 -35
  48. package/dist/components/order-view/DynamicTable.js.map +1 -1
  49. package/dist/components/order-view/details-filters/DetailsFilters.js +33 -8
  50. package/dist/components/order-view/details-filters/DetailsFilters.js.map +1 -1
  51. package/dist/components/order-view/details-filters/left-side-filters/ActionsMenu.js +23 -5
  52. package/dist/components/order-view/details-filters/left-side-filters/ActionsMenu.js.map +1 -1
  53. package/dist/components/order-view/details-filters/left-side-filters/dropdowns/DropDowns.js +39 -22
  54. package/dist/components/order-view/details-filters/left-side-filters/dropdowns/DropDowns.js.map +1 -1
  55. package/dist/components/order-view/details-filters/right-side-filters/Details.js +25 -12
  56. package/dist/components/order-view/details-filters/right-side-filters/Details.js.map +1 -1
  57. package/dist/components/order-view/general-information/Status.js +58 -28
  58. package/dist/components/order-view/general-information/Status.js.map +1 -1
  59. package/dist/components/order-view/generic-table/AuditLogs.js +129 -24
  60. package/dist/components/order-view/generic-table/AuditLogs.js.map +1 -1
  61. package/dist/components/order-view/notes/logs/index.js +15 -7
  62. package/dist/components/order-view/notes/logs/index.js.map +1 -1
  63. package/dist/components/order-view/notes/order-dropdown/NewReturnDropdown.js +7 -7
  64. package/dist/components/order-view/notes/order-dropdown/NewReturnDropdown.js.map +1 -1
  65. package/dist/components/order-view/notification/index.js +68 -55
  66. package/dist/components/order-view/notification/index.js.map +1 -1
  67. package/dist/components/order-view/order-actions/Dropdown.js +3 -3
  68. package/dist/components/order-view/order-actions/Dropdown.js.map +1 -1
  69. package/dist/components/order-view/order-actions/actions/cancel-order/CancelOrderTable.js +45 -47
  70. package/dist/components/order-view/order-actions/actions/cancel-order/CancelOrderTable.js.map +1 -1
  71. package/dist/components/order-view/order-actions/actions/cancel-order/ReturnReason.js +23 -36
  72. package/dist/components/order-view/order-actions/actions/cancel-order/ReturnReason.js.map +1 -1
  73. package/dist/components/order-view/order-actions/actions/confirm-order/tables/ProductTable.js +23 -25
  74. package/dist/components/order-view/order-actions/actions/confirm-order/tables/ProductTable.js.map +1 -1
  75. package/dist/components/order-view/order-actions/actions/force-debrief/ForceDebriefModal.js +88 -89
  76. package/dist/components/order-view/order-actions/actions/force-debrief/ForceDebriefModal.js.map +1 -1
  77. package/dist/components/order-view/order-actions/actions/force-debrief/charges/collection-add-ons/index.js +16 -16
  78. package/dist/components/order-view/order-actions/actions/force-debrief/charges/collection-add-ons/index.js.map +1 -1
  79. package/dist/components/order-view/order-actions/actions/force-debrief/escalation/EscalationReason.js +22 -23
  80. package/dist/components/order-view/order-actions/actions/force-debrief/escalation/EscalationReason.js.map +1 -1
  81. package/dist/components/order-view/order-actions/actions/force-debrief/order-info/RadioButtons.js +52 -56
  82. package/dist/components/order-view/order-actions/actions/force-debrief/order-info/RadioButtons.js.map +1 -1
  83. package/dist/components/order-view/order-actions/actions/force-debrief/order-info/dropdowns/FailureReasonDropdown.js +26 -27
  84. package/dist/components/order-view/order-actions/actions/force-debrief/order-info/dropdowns/FailureReasonDropdown.js.map +1 -1
  85. package/dist/components/order-view/order-actions/actions/hold-order/HoldOrderModal.js +29 -29
  86. package/dist/components/order-view/order-actions/actions/hold-order/HoldOrderModal.js.map +1 -1
  87. package/dist/components/order-view/order-actions/actions/split-order/SplitOrderTable.js +54 -222
  88. package/dist/components/order-view/order-actions/actions/split-order/SplitOrderTable.js.map +1 -1
  89. package/dist/components/order-view/order-actions/actions/split-order/index.js +37 -50
  90. package/dist/components/order-view/order-actions/actions/split-order/index.js.map +1 -1
  91. package/dist/components/order-view/order-actions/actions/uncancel-order/UncancelOrderTable.js +35 -37
  92. package/dist/components/order-view/order-actions/actions/uncancel-order/UncancelOrderTable.js.map +1 -1
  93. package/dist/components/order-view/order-actions/actions/what3words/What3WordsModal.tsx.js +85 -85
  94. package/dist/components/order-view/order-actions/actions/what3words/What3WordsModal.tsx.js.map +1 -1
  95. package/dist/components/order-view/order-details/expanded-content/customer-section/contact-info/ContactHome.js +12 -8
  96. package/dist/components/order-view/order-details/expanded-content/customer-section/contact-info/ContactHome.js.map +1 -1
  97. package/dist/components/order-view/order-details/expanded-content/customer-section/contact-info/ContactMobile.js +22 -18
  98. package/dist/components/order-view/order-details/expanded-content/customer-section/contact-info/ContactMobile.js.map +1 -1
  99. package/dist/components/order-view/order-details/expanded-content/customer-section/contact-info/index.js +14 -8
  100. package/dist/components/order-view/order-details/expanded-content/customer-section/contact-info/index.js.map +1 -1
  101. package/dist/components/order-view/order-details/expanded-content/customer-section/index.js +19 -13
  102. package/dist/components/order-view/order-details/expanded-content/customer-section/index.js.map +1 -1
  103. package/dist/components/order-view/order-details/expanded-content/customer-section/location-info/Address.js +11 -6
  104. package/dist/components/order-view/order-details/expanded-content/customer-section/location-info/Address.js.map +1 -1
  105. package/dist/components/order-view/order-details/expanded-content/customer-section/location-info/Latitude.js +23 -21
  106. package/dist/components/order-view/order-details/expanded-content/customer-section/location-info/Latitude.js.map +1 -1
  107. package/dist/components/order-view/order-details/expanded-content/customer-section/location-info/Longitude.js +23 -21
  108. package/dist/components/order-view/order-details/expanded-content/customer-section/location-info/Longitude.js.map +1 -1
  109. package/dist/components/order-view/order-details/expanded-content/customer-section/location-info/index.js +39 -21
  110. package/dist/components/order-view/order-details/expanded-content/customer-section/location-info/index.js.map +1 -1
  111. package/dist/components/order-view/order-details/expanded-content/footer/index.js +28 -14
  112. package/dist/components/order-view/order-details/expanded-content/footer/index.js.map +1 -1
  113. package/dist/components/order-view/order-details/expanded-content/orders-section/index.js +44 -28
  114. package/dist/components/order-view/order-details/expanded-content/orders-section/index.js.map +1 -1
  115. package/dist/components/order-view/order-details/expanded-content/services-section/OrderServices.js +28 -20
  116. package/dist/components/order-view/order-details/expanded-content/services-section/OrderServices.js.map +1 -1
  117. package/dist/components/order-view/order-details/expanded-content/services-section/ServiceLevel.js +17 -18
  118. package/dist/components/order-view/order-details/expanded-content/services-section/ServiceLevel.js.map +1 -1
  119. package/dist/components/order-view/order-details/expanded-content/services-section/ServiceType.js +22 -26
  120. package/dist/components/order-view/order-details/expanded-content/services-section/ServiceType.js.map +1 -1
  121. package/dist/components/order-view/order-details/expanded-content/services-section/index.js +79 -25
  122. package/dist/components/order-view/order-details/expanded-content/services-section/index.js.map +1 -1
  123. package/dist/components/order-view/order-details/helper.js.map +1 -1
  124. package/dist/components/order-view/products-info/collapsed-content/index.js +21 -15
  125. package/dist/components/order-view/products-info/collapsed-content/index.js.map +1 -1
  126. package/dist/components/order-view/products-info/index.js +36 -36
  127. package/dist/components/order-view/products-info/index.js.map +1 -1
  128. package/dist/components/order-view/return-client-products/product-table/ReturnProductTable.js +265 -334
  129. package/dist/components/order-view/return-client-products/product-table/ReturnProductTable.js.map +1 -1
  130. package/dist/components/order-view/store.js +155 -162
  131. package/dist/components/order-view/store.js.map +1 -1
  132. package/dist/components/order-view/toolbox-resources/expanded-content/index.js +281 -173
  133. package/dist/components/order-view/toolbox-resources/expanded-content/index.js.map +1 -1
  134. package/dist/components/utils.js +5 -4
  135. package/dist/components/utils.js.map +1 -1
  136. package/dist/types/common/modals/order-action-modal/OrderActionModal.d.ts +1 -2
  137. package/dist/types/common/modals/order-action-modal/footer/OrderActionFooter.d.ts +1 -1
  138. package/dist/types/components/client-portal/ClientPortalResponsive.d.ts +15 -0
  139. package/dist/types/components/order-daily-overview/common/mediaQuery.d.ts +4 -0
  140. package/dist/types/components/order-daily-overview/filters/FilterStyle.d.ts +1 -0
  141. package/dist/types/components/order-view/order-actions/Dropdown.d.ts +0 -1
  142. package/dist/types/components/order-view/return-client-products/product-table/ReturnProductTable.d.ts +1 -0
  143. package/dist/types/components/order-view/store.d.ts +0 -1
  144. package/dist/types/components/order-view/types.d.ts +1 -1
  145. package/dist/types/components/utils.d.ts +1 -0
  146. package/package.json +2 -2
  147. package/dist/assets/icons/ChevronDownIcon.js +0 -26
  148. package/dist/assets/icons/ChevronDownIcon.js.map +0 -1
  149. package/dist/components/order-view/return-client-products/product-table/palletGrouping.js +0 -47
  150. package/dist/components/order-view/return-client-products/product-table/palletGrouping.js.map +0 -1
  151. package/dist/types/components/order-view/return-client-products/product-table/palletGrouping.d.ts +0 -23
@@ -1,256 +1,279 @@
1
- import { jsxs as o, jsx as t, Fragment as K } from "react/jsx-runtime";
2
- import k, { useState as m, useMemo as D, useEffect as Q } from "react";
3
- import { StyledTableWrapper as U, StyledTable as X } from "../../../order-daily-overview/return-order-table/return-orders-filters/returnstyles.js";
4
- import { Checkbox as Y, CancelationModal as Z, CancelAndCompleteAction as ee, useAxios as te, displayValueOrNA as E, toReverseDeliveryLabel as ne } from "@bjsdistribution/dms-component-library";
5
- import oe from "../../../../assets/icons/ActionIcon.js";
6
- import { useReturnProductDetails as le, useOrderId as ie } from "../../store.js";
7
- import { Skeleton as re, Empty as ae, Spin as de, notification as C } from "antd";
8
- import { useSelectedProducts as se, useNewReturnOrderData as ce, useIsShowNorthSouth as pe, useClientPortal as he } from "../../../store.js";
9
- import i from "styled-components";
10
- import { NavLink as me } from "react-router-dom";
11
- import { EmptyDataContainer as fe } from "../../order-actions/actions/charge-log/index.js";
12
- import f from "../../northern-southern-info/CustomInput.js";
13
- import ue from "../../../../assets/icons/ChevronDownIcon.js";
14
- import { groupProductsByPallet as ge, hasAnyPallet as xe, toggleGroupSelectionIds as be } from "./palletGrouping.js";
15
- const Be = (a) => {
16
- const [u, s] = se(), [g, N] = m(!1), [l] = le(), [S] = ie(), [R] = ce(), [T] = pe(), [c] = he(), [A, x] = m(null), [O, b] = m(!1), { loading: p, fetchData: G } = te({
1
+ import { jsxs as r, jsx as e } from "react/jsx-runtime";
2
+ import T, { useState as l } from "react";
3
+ import { StyledTableWrapper as E, StyledTable as j } from "../../../order-daily-overview/return-order-table/return-orders-filters/returnstyles.js";
4
+ import { Checkbox as M, CancelationModal as z, CancelAndCompleteAction as L, useAxios as W, displayValueOrNA as b } from "@bjsdistribution/dms-component-library";
5
+ import B from "../../../../assets/icons/ActionIcon.js";
6
+ import { useProductDetails as F, useOrderId as V } from "../../store.js";
7
+ import { Skeleton as G, Empty as $, Spin as q, notification as f } from "antd";
8
+ import { useSelectedProducts as H, useNewReturnOrderData as J, useIsShowNorthSouth as K, useClientPortal as Q } from "../../../store.js";
9
+ import n from "styled-components";
10
+ import { NavLink as U } from "react-router-dom";
11
+ import { EmptyDataContainer as X } from "../../order-actions/actions/charge-log/index.js";
12
+ import a from "../../northern-southern-info/CustomInput.js";
13
+ const xe = (s) => {
14
+ const [_, c] = H(), [p, w] = l(!1), [i, oe] = F(), [re, ne] = l(null), [v] = V(), [C] = J(), [A] = K(), [h] = Q(), [g, m] = l(null), [S, u] = l(!1), { loading: d, fetchData: N } = W({
17
15
  endpoint: "v1/return/product/remove/",
18
16
  method: "POST"
19
- }), L = (e) => {
20
- x(e), b(!0);
21
- }, j = async () => {
22
- if (A === null) return;
23
- const e = A;
17
+ }), P = (t) => {
18
+ m(t), u(!0);
19
+ }, D = async () => {
20
+ if (g === null) return;
21
+ const t = g;
24
22
  try {
25
- const n = await G({
23
+ const o = await N({
26
24
  payload: {
27
- return_order_product_id: e,
28
- return_order_id: +S
25
+ return_order_product_id: t,
26
+ return_order_id: +v
29
27
  }
30
28
  });
31
- n?.code === 200 ? (C.success({
29
+ o?.code === 200 ? (f.success({
32
30
  message: "Success",
33
- description: n?.message || "Product deleted successfully."
34
- }), a?.callReturnProducts()) : C.error({
31
+ description: o?.message || "Product deleted successfully."
32
+ }), s?.callReturnProducts()) : f.error({
35
33
  message: "Deletion Failed",
36
- description: n?.message || "Could not delete the product."
34
+ description: o?.message || "Could not delete the product."
37
35
  });
38
- } catch (n) {
39
- console.error("Error deleting product:", n), C.error({
36
+ } catch (o) {
37
+ console.error("Error deleting product:", o), f.error({
40
38
  message: "Error",
41
39
  //@ts-ignore
42
- description: n?.message || "An unexpected error occurred."
40
+ description: o?.message || "An unexpected error occurred."
43
41
  });
44
42
  } finally {
45
- x(null), b(!1);
43
+ m(null), u(!1);
46
44
  }
47
- }, M = () => {
48
- p || (x(null), b(!1));
49
- }, $ = () => {
50
- if (g)
51
- s([]);
45
+ }, I = () => {
46
+ d || (m(null), u(!1));
47
+ }, k = () => {
48
+ if (p)
49
+ c([]);
52
50
  else {
53
- const e = l?.map((n) => n.id);
54
- s(e);
51
+ const t = i?.map((o) => o.id);
52
+ c(t);
55
53
  }
56
- N(!g);
57
- }, z = (e) => {
58
- s(
59
- (n) => n.includes(e) ? n.filter((r) => r !== e) : [...n, e]
54
+ w(!p);
55
+ }, R = (t) => {
56
+ c(
57
+ (o) => o.includes(t) ? o.filter((O) => O !== t) : [...o, t]
60
58
  );
61
- }, y = l?.length == 0 || R?.length == 0, h = c ? 8 : 9, B = D(() => ge(l), [
62
- l
63
- ]), F = D(() => xe(l), [l]), [H, w] = m({});
64
- Q(() => {
65
- w({});
66
- }, [S]);
67
- const W = (e) => e.isNoPallet || !!H[e.key], V = (e) => w((n) => ({ ...n, [e]: !n[e] })), I = (e) => /* @__PURE__ */ o(k.Fragment, { children: [
68
- /* @__PURE__ */ o("tr", { className: "product-row", children: [
69
- /* @__PURE__ */ t("td", { children: /* @__PURE__ */ t(
70
- P,
71
- {
72
- checked: u?.includes(e?.id),
73
- onChange: () => z(e?.id),
74
- disabled: y
75
- }
76
- ) }),
77
- /* @__PURE__ */ t("td", { children: e?.location || "N/A" }),
78
- /* @__PURE__ */ t("td", { children: /* @__PURE__ */ o("ul", { style: { listStyleType: "none", padding: 0 }, children: [
79
- /* @__PURE__ */ t(
80
- "li",
81
- {
82
- style: {
83
- color: "#0099ff",
84
- fontWeight: 600
85
- },
86
- children: /* @__PURE__ */ t(me, { to: `/orders/view/${e?.order_id}`, children: E(e?.recipient_name) })
87
- }
88
- ),
89
- /* @__PURE__ */ t("li", { style: { color: "#888075" }, children: E(e?.postcode) })
90
- ] }) }),
91
- /* @__PURE__ */ t("td", { children: e?.code }),
92
- /* @__PURE__ */ t("td", { children: e?.description }),
93
- /* @__PURE__ */ t("td", { children: c ? e?.return_reason : ne(e?.return_reason) }),
94
- !c && /* @__PURE__ */ t("td", { children: Array.isArray(e?.product_addon_services) && e?.product_addon_services?.length > 0 ? e.product_addon_services.map((n) => n?.service_code || n?.name || n).filter(Boolean).join(", ") : Array.isArray(e?.addon_services) && e?.addon_services?.length > 0 ? e.addon_services.map((n) => n?.service_code || n?.name || n).filter(Boolean).join(", ") : Array.isArray(e?.addon_services_list) && e?.addon_services_list?.length > 0 ? e.addon_services_list.join(", ") : typeof e?.addon_services == "string" && e?.addon_services.trim() !== "" ? e.addon_services : "NA" }),
95
- /* @__PURE__ */ t("td", { children: e?.part }),
96
- /* @__PURE__ */ t("td", { children: /* @__PURE__ */ t(
97
- "div",
98
- {
99
- onClick: (n) => {
100
- n.stopPropagation(), n.preventDefault(), L(e?.id);
101
- },
102
- style: { cursor: "pointer" },
103
- children: /* @__PURE__ */ t(oe, {})
104
- }
105
- ) })
106
- ] }),
107
- T === !0 && /* @__PURE__ */ t("td", { colSpan: h, children: /* @__PURE__ */ o(ye, { children: [
108
- /* @__PURE__ */ t("div", { className: "left", children: "Northern/Southern Ireland" }),
109
- /* @__PURE__ */ t("div", { className: "left-end" }),
110
- /* @__PURE__ */ o("div", { className: "section", children: [
111
- /* @__PURE__ */ t(
112
- f,
113
- {
114
- label: "Commodity Code",
115
- type: "text",
116
- direction: "row",
117
- placeholder: "Enter Commodity Code",
118
- value: e?.product_customs_details?.commodity_code || "NA",
119
- disabled: !0
120
- }
121
- ),
122
- /* @__PURE__ */ t(
123
- f,
124
- {
125
- label: "Country of Origin",
126
- type: "text",
127
- direction: "row",
128
- placeholder: "Enter Country of Origin",
129
- value: e?.product_customs_details?.country_of_origin || "NA",
130
- disabled: !0
131
- }
132
- ),
133
- /* @__PURE__ */ t(
134
- f,
135
- {
136
- label: "Item Invoice Amount",
137
- type: "number",
138
- direction: "row",
139
- placeholder: "Enter Item Invoice Amount",
140
- value: e?.product_customs_details?.item_invoice_amount || 0,
141
- disabled: !0
142
- }
143
- ),
144
- /* @__PURE__ */ t(
145
- f,
146
- {
147
- label: "NI Additional Info Codes",
148
- type: "text",
149
- direction: "row",
150
- placeholder: "Enter NI Add Info Codes",
151
- value: e?.product_customs_details?.ni_additional_information_codes || "NA",
152
- disabled: !0
153
- }
154
- )
155
- ] })
156
- ] }) })
157
- ] }, e.id), q = (e, n) => {
158
- const r = e.items.map((v) => v?.id), d = be(
159
- u,
160
- r,
161
- n
162
- );
163
- s(d), N(d.length === l?.length);
164
- }, J = (e) => {
165
- const n = W(e), r = e.items.filter(
166
- (_) => u?.includes(_?.id)
167
- ).length, d = e.items.length > 0 && r === e.items.length, v = `${e.items.length} ${e.items.length === 1 ? "item" : "items"}`;
168
- return /* @__PURE__ */ o(k.Fragment, { children: [
169
- /* @__PURE__ */ t(ve, { className: e.isNoPallet ? "no-pallet" : void 0, children: /* @__PURE__ */ t("td", { colSpan: h, children: /* @__PURE__ */ o(_e, { children: [
170
- /* @__PURE__ */ t(
171
- P,
172
- {
173
- checked: d,
174
- onChange: () => q(e, d),
175
- disabled: y,
176
- "aria-label": e.isNoPallet ? "Select all items with no pallet ID" : `Select all items on pallet ${e.label}`
177
- }
178
- ),
179
- /* @__PURE__ */ o(
180
- Ce,
181
- {
182
- type: "button",
183
- disabled: e.isNoPallet,
184
- onClick: e.isNoPallet ? void 0 : () => V(e.key),
185
- "aria-expanded": e.isNoPallet ? void 0 : n,
186
- children: [
187
- !e.isNoPallet && /* @__PURE__ */ t(Pe, { $isExpanded: n, children: /* @__PURE__ */ t(ue, {}) }),
188
- /* @__PURE__ */ t("span", { className: "title", children: e.isNoPallet ? /* @__PURE__ */ t("span", { children: "No Pallet ID" }) : /* @__PURE__ */ o(K, { children: [
189
- /* @__PURE__ */ t("span", { children: "Pallet ID:" }),
190
- /* @__PURE__ */ t("strong", { children: e.label })
191
- ] }) }),
192
- /* @__PURE__ */ o("span", { className: "count", children: [
193
- "(",
194
- v,
195
- ")"
196
- ] }),
197
- e.depotLocation && /* @__PURE__ */ t("span", { className: "depot", children: e.depotLocation }),
198
- r > 0 && /* @__PURE__ */ o("span", { className: "selected", children: [
199
- r,
200
- " selected"
201
- ] }),
202
- !e.isNoPallet && /* @__PURE__ */ t(Ne, { "aria-hidden": "true", children: n ? "−" : "+" })
203
- ]
204
- }
205
- )
206
- ] }) }) }),
207
- n && e.items.map((_) => I(_))
208
- ] }, e.key);
209
- };
210
- return /* @__PURE__ */ o("div", { children: [
211
- /* @__PURE__ */ t(U, { id: "tableScrolling", className: "orderProductTable", children: /* @__PURE__ */ o(X, { children: [
212
- /* @__PURE__ */ t("thead", { children: /* @__PURE__ */ o("tr", { children: [
213
- /* @__PURE__ */ t("th", { className: "emailproductsCheckbox", children: /* @__PURE__ */ t(
214
- P,
59
+ }, x = i?.length == 0 || C?.length == 0;
60
+ return /* @__PURE__ */ r(Y, { children: [
61
+ /* @__PURE__ */ e(E, { id: "tableScrolling", className: "orderProductTable", children: /* @__PURE__ */ r(j, { children: [
62
+ /* @__PURE__ */ e("thead", { children: /* @__PURE__ */ r("tr", { children: [
63
+ /* @__PURE__ */ e("th", { className: "emailproductsCheckbox", children: /* @__PURE__ */ e(
64
+ y,
215
65
  {
216
- disabled: y,
217
- checked: g,
218
- onChange: $
66
+ disabled: x,
67
+ checked: p,
68
+ onChange: k
219
69
  }
220
70
  ) }),
221
- /* @__PURE__ */ t("th", { children: "Location" }),
222
- /* @__PURE__ */ t("th", { children: "Sender" }),
223
- /* @__PURE__ */ t("th", { children: "Code" }),
224
- /* @__PURE__ */ t("th", { children: "Description" }),
225
- /* @__PURE__ */ t("th", { children: "Return Reason" }),
226
- !c && /* @__PURE__ */ t("th", { children: "Additional Services" }),
227
- /* @__PURE__ */ t("th", { children: "Part" }),
228
- /* @__PURE__ */ t("th", { children: "Action" })
71
+ /* @__PURE__ */ e("th", { children: "Location" }),
72
+ /* @__PURE__ */ e("th", { children: "Sender" }),
73
+ /* @__PURE__ */ e("th", { children: "Code" }),
74
+ /* @__PURE__ */ e("th", { children: "Description" }),
75
+ /* @__PURE__ */ e("th", { children: "Return Reason" }),
76
+ !h && /* @__PURE__ */ e("th", { children: "Additional Services" }),
77
+ /* @__PURE__ */ e("th", { children: "Part" }),
78
+ /* @__PURE__ */ e("th", { children: "Action" })
229
79
  ] }) }),
230
- /* @__PURE__ */ t("tbody", { children: a?.loading || a?.locationloading ? /* @__PURE__ */ t("tr", { children: /* @__PURE__ */ t("td", { colSpan: h, children: /* @__PURE__ */ t(re, { active: !0 }) }) }) : l?.length === 0 ? /* @__PURE__ */ t("tr", { children: /* @__PURE__ */ t("td", { colSpan: h, children: /* @__PURE__ */ t(fe, { children: /* @__PURE__ */ t(ae, {}) }) }) }) : F ? B.map(J) : (
231
- /* Called explicitly so `map`'s index is not passed as `isNoPallet`. */
232
- l?.map((e) => I(e))
233
- ) })
80
+ /* @__PURE__ */ e("tbody", { children: s?.loading || s?.locationloading ? /* @__PURE__ */ e("tr", { children: /* @__PURE__ */ e("td", { colSpan: 14, children: /* @__PURE__ */ e(G, { active: !0 }) }) }) : i?.length === 0 ? /* @__PURE__ */ e("tr", { children: /* @__PURE__ */ e("td", { colSpan: 14, children: /* @__PURE__ */ e(X, { children: /* @__PURE__ */ e($, {}) }) }) }) : i?.map((t) => /* @__PURE__ */ r(T.Fragment, { children: [
81
+ /* @__PURE__ */ r("tr", { className: "product-row", children: [
82
+ /* @__PURE__ */ e("td", { children: /* @__PURE__ */ e(
83
+ y,
84
+ {
85
+ checked: _?.includes(t?.id),
86
+ onChange: () => R(t?.id),
87
+ disabled: x
88
+ }
89
+ ) }),
90
+ /* @__PURE__ */ e("td", { "data-label": "Location", children: t?.location || "N/A" }),
91
+ /* @__PURE__ */ e("td", { "data-label": "Sender", children: /* @__PURE__ */ r("ul", { style: { listStyleType: "none", padding: 0 }, children: [
92
+ /* @__PURE__ */ e(
93
+ "li",
94
+ {
95
+ style: {
96
+ color: "#0099ff",
97
+ fontWeight: 600
98
+ },
99
+ children: /* @__PURE__ */ e(U, { to: `/orders/view/${t?.order_id}`, children: b(t?.recipient_name) })
100
+ }
101
+ ),
102
+ /* @__PURE__ */ e("li", { style: { color: "#888075" }, children: b(t?.postcode) })
103
+ ] }) }),
104
+ /* @__PURE__ */ e("td", { "data-label": "Code", children: t?.code }),
105
+ /* @__PURE__ */ e("td", { "data-label": "Description", children: t?.description }),
106
+ /* @__PURE__ */ e("td", { "data-label": "Return Reason", children: t?.return_reason }),
107
+ !h && /* @__PURE__ */ e("td", { "data-label": "Additional Services", children: Array.isArray(t?.product_addon_services) && t?.product_addon_services?.length > 0 ? t.product_addon_services.map((o) => o?.service_code || o?.name || o).filter(Boolean).join(", ") : Array.isArray(t?.addon_services) && t?.addon_services?.length > 0 ? t.addon_services.map((o) => o?.service_code || o?.name || o).filter(Boolean).join(", ") : Array.isArray(t?.addon_services_list) && t?.addon_services_list?.length > 0 ? t.addon_services_list.join(", ") : typeof t?.addon_services == "string" && t?.addon_services.trim() !== "" ? t.addon_services : "NA" }),
108
+ /* @__PURE__ */ e("td", { "data-label": "Part", children: t?.part }),
109
+ /* @__PURE__ */ e("td", { "data-label": "Action", children: /* @__PURE__ */ e(
110
+ "div",
111
+ {
112
+ onClick: (o) => {
113
+ o.stopPropagation(), o.preventDefault(), P(t?.id);
114
+ },
115
+ style: { cursor: "pointer" },
116
+ children: /* @__PURE__ */ e(B, {})
117
+ }
118
+ ) })
119
+ ] }),
120
+ A === !0 && /* @__PURE__ */ e("td", { colSpan: h ? 8 : 9, children: /* @__PURE__ */ r(Z, { children: [
121
+ /* @__PURE__ */ e("div", { className: "left", children: "Northern/Southern Ireland" }),
122
+ /* @__PURE__ */ e("div", { className: "left-end" }),
123
+ /* @__PURE__ */ r("div", { className: "section", children: [
124
+ /* @__PURE__ */ e(
125
+ a,
126
+ {
127
+ label: "Commodity Code",
128
+ type: "text",
129
+ direction: "row",
130
+ placeholder: "Enter Commodity Code",
131
+ value: t?.product_customs_details?.commodity_code || "NA",
132
+ disabled: !0
133
+ }
134
+ ),
135
+ /* @__PURE__ */ e(
136
+ a,
137
+ {
138
+ label: "Country of Origin",
139
+ type: "text",
140
+ direction: "row",
141
+ placeholder: "Enter Country of Origin",
142
+ value: t?.product_customs_details?.country_of_origin || "NA",
143
+ disabled: !0
144
+ }
145
+ ),
146
+ /* @__PURE__ */ e(
147
+ a,
148
+ {
149
+ label: "Item Invoice Amount",
150
+ type: "number",
151
+ direction: "row",
152
+ placeholder: "Enter Item Invoice Amount",
153
+ value: t?.product_customs_details?.item_invoice_amount || 0,
154
+ disabled: !0
155
+ }
156
+ ),
157
+ /* @__PURE__ */ e(
158
+ a,
159
+ {
160
+ label: "NI Additional Info Codes",
161
+ type: "text",
162
+ direction: "row",
163
+ placeholder: "Enter NI Add Info Codes",
164
+ value: t?.product_customs_details?.ni_additional_information_codes || "NA",
165
+ disabled: !0
166
+ }
167
+ )
168
+ ] })
169
+ ] }) })
170
+ ] }, t.id)) })
234
171
  ] }) }),
235
- O && /* @__PURE__ */ t(de, { spinning: p, children: /* @__PURE__ */ t(
236
- Se,
172
+ S && /* @__PURE__ */ e(q, { spinning: d, children: /* @__PURE__ */ e(
173
+ ee,
237
174
  {
238
175
  title: "Remove Product",
239
176
  description: "Are you sure, you want to remove this order product for returns?",
240
- actions: /* @__PURE__ */ t(
241
- Ae,
177
+ actions: /* @__PURE__ */ e(
178
+ te,
242
179
  {
243
180
  cancelLabel: "Cancel",
244
- onCancel: M,
245
- completeLabel: p ? "REMOVING..." : "Confirm",
246
- isDisabled: p,
247
- onComplete: j
181
+ onCancel: I,
182
+ completeLabel: d ? "REMOVING..." : "Confirm",
183
+ isDisabled: d,
184
+ onComplete: D
248
185
  }
249
186
  )
250
187
  }
251
188
  ) })
252
189
  ] });
253
- }, ye = i.div`
190
+ }, Y = n.div`
191
+ @media screen and (max-width: 768px) {
192
+ .orderProductTable {
193
+ overflow: visible;
194
+ max-width: 100%;
195
+
196
+ table,
197
+ thead,
198
+ tbody {
199
+ display: block;
200
+ width: 100%;
201
+ min-width: 0;
202
+ }
203
+
204
+ thead tr {
205
+ display: flex;
206
+ align-items: center;
207
+ margin-bottom: 8px;
208
+ }
209
+ thead th {
210
+ display: none;
211
+ }
212
+ thead th.emailproductsCheckbox {
213
+ display: flex;
214
+ align-items: center;
215
+ gap: 8px;
216
+ width: auto;
217
+ &::after {
218
+ content: 'Select all';
219
+ font-size: 13px;
220
+ font-weight: 600;
221
+ color: #3a3630;
222
+ }
223
+ }
224
+
225
+ tr.product-row {
226
+ display: block;
227
+ margin-bottom: 12px;
228
+ padding: 10px 12px;
229
+ border: 1px solid #e3e3e3;
230
+ border-radius: 12px;
231
+ background: #fff;
232
+ box-shadow: 0px 1px 2px 0px rgba(16, 24, 40, 0.05);
233
+ }
234
+
235
+ tr.product-row td {
236
+ display: flex;
237
+ align-items: flex-start;
238
+ justify-content: space-between;
239
+ gap: 12px;
240
+ width: 100%;
241
+ box-sizing: border-box;
242
+ padding: 8px 0;
243
+ border: 0;
244
+ border-bottom: 1px solid #f0f2f2;
245
+ text-align: right;
246
+ word-break: break-word;
247
+ }
248
+ tr.product-row td:last-child {
249
+ border-bottom: 0;
250
+ justify-content: flex-end;
251
+ }
252
+ tr.product-row td[data-label]::before {
253
+ content: attr(data-label);
254
+ flex: 0 0 38%;
255
+ text-align: left;
256
+ font-size: 12px;
257
+ font-weight: 600;
258
+ text-transform: uppercase;
259
+ color: #6a7378;
260
+ }
261
+ tr.product-row td ul {
262
+ margin: 0;
263
+ text-align: right;
264
+ }
265
+
266
+ /* loading / empty rows and the N/S expanded row */
267
+ tbody > tr:not(.product-row),
268
+ tbody > tr:not(.product-row) td,
269
+ tbody > td {
270
+ display: block;
271
+ width: 100%;
272
+ box-sizing: border-box;
273
+ }
274
+ }
275
+ }
276
+ `, Z = n.div`
254
277
  display: flex;
255
278
  width: 100%;
256
279
  padding: 5px 10px;
@@ -264,6 +287,15 @@ const Be = (a) => {
264
287
  background: rgb(248, 250, 252);
265
288
  margin-bottom: 14px;
266
289
 
290
+ @media screen and (max-width: 768px) {
291
+ flex-direction: column;
292
+ align-items: stretch;
293
+ box-sizing: border-box;
294
+ .left-end {
295
+ display: none;
296
+ }
297
+ }
298
+
267
299
  .left {
268
300
  display: flex;
269
301
  padding-right: 10px;
@@ -295,6 +327,12 @@ const Be = (a) => {
295
327
  gap: 30px;
296
328
  flex: 1 0 0;
297
329
 
330
+ @media screen and (max-width: 768px) {
331
+ flex-direction: column;
332
+ align-items: stretch;
333
+ gap: 10px;
334
+ }
335
+
298
336
  input {
299
337
  display: flex;
300
338
  height: 28px;
@@ -307,121 +345,13 @@ const Be = (a) => {
307
345
  background: #fff;
308
346
  }
309
347
  }
310
- `, ve = i.tr`
311
- > td {
312
- padding: 0;
313
- border: none;
314
- }
315
-
316
- /*
317
- Spec: the No Pallet ID group must be separated from the palletised groups by
318
- a divider line. Neutral rule only — the rows themselves keep their normal
319
- background, and the header keeps the same design as the pallet headers.
320
- */
321
- &.no-pallet > td {
322
- border-top: 1px solid #c9c6c1;
323
- padding-top: 10px;
324
- }
325
- `, _e = i.div`
326
- /*
327
- The library Checkbox renders its real <input> as position:absolute with no
328
- offsets, so it needs a positioned ancestor or the click target drifts away
329
- from the visible box as the table scrolls. The shared table CSS happens to
330
- position td already; pinning it here too so this does not depend on that.
331
- */
332
- position: relative;
333
- display: flex;
334
- align-items: center;
335
- gap: 8px;
336
- width: 100%;
337
- padding: 8px 12px;
338
- border: 1px solid #e2e0db;
339
- border-radius: 6px;
340
- background: #f1f5f9;
341
- font-family: 'Roboto', sans-serif;
342
- font-size: 13px;
343
- font-weight: 500;
344
- color: #3a3630;
345
-
346
- &:hover {
347
- background: #e7edf4;
348
- }
349
-
350
- `, Ce = i.button`
351
- display: flex;
352
- align-items: center;
353
- gap: 8px;
354
- flex: 1;
355
- padding: 0;
356
- border: none;
357
- background: transparent;
358
- cursor: pointer;
359
- text-align: left;
360
- font: inherit;
361
- color: inherit;
362
-
363
- &:disabled {
364
- cursor: default;
365
- /* Inert, but must not read as a greyed-out disabled control. */
366
- opacity: 1;
367
- }
368
-
369
- .title {
370
- display: flex;
371
- align-items: center;
372
- gap: 6px;
373
- text-transform: uppercase;
374
- letter-spacing: 0.3px;
375
-
376
- strong {
377
- font-weight: 700;
378
- text-transform: none;
379
- letter-spacing: 0;
380
- }
381
- }
382
-
383
- .count {
384
- color: #6a7378;
385
- font-weight: 400;
386
- }
387
-
388
- .depot {
389
- color: #888075;
390
- font-weight: 400;
391
- font-size: 12px;
392
- }
393
-
394
- .selected {
395
- color: #0099ff;
396
- font-weight: 600;
397
- font-size: 12px;
398
- }
399
-
400
- `, Pe = i.span`
401
- display: inline-flex;
402
- align-items: center;
403
- transition: transform 0.15s ease-in-out;
404
- transform: rotate(${(a) => a.$isExpanded ? "0deg" : "-90deg"});
405
- `, Ne = i.span`
406
- margin-left: auto;
407
- display: inline-flex;
408
- align-items: center;
409
- justify-content: center;
410
- width: 20px;
411
- height: 20px;
412
- border: 1px solid #cbd5e1;
413
- border-radius: 4px;
414
- background: #fff;
415
- font-size: 14px;
416
- line-height: 1;
417
- color: #475569;
418
- `, P = i(Y)`
348
+ `, y = n(M)`
419
349
  &:disabled {
420
350
  background-color: gray;
421
351
  cursor: not-allowed;
422
352
  opacity: -0.4;
423
353
  }
424
- `, Se = i(Z)`
354
+ `, ee = n(z)`
425
355
  div {
426
356
  & > div > div:first-child {
427
357
  padding: 8px !important;
@@ -431,11 +361,12 @@ const Be = (a) => {
431
361
  width: 28px !important;
432
362
  height: 28px !important;
433
363
  }
434
- `, Ae = i(ee)`
364
+ `, te = n(L)`
435
365
  justify-content: center;
436
366
  `;
437
367
  export {
438
- ye as NSWrapper,
439
- Be as default
368
+ Y as MobileTableRoot,
369
+ Z as NSWrapper,
370
+ xe as default
440
371
  };
441
372
  //# sourceMappingURL=ReturnProductTable.js.map