@bjsdistribution/dms-client-return 0.1.99-prod → 0.2.0-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 (48) hide show
  1. package/dist/components/client-portal/OutstandingTable.js +118 -112
  2. package/dist/components/client-portal/OutstandingTable.js.map +1 -1
  3. package/dist/components/fakeData.js.map +1 -1
  4. package/dist/components/order-daily-overview/common/fakedata.js.map +1 -1
  5. package/dist/components/order-daily-overview/return-after-table/table/OrderTable.js +33 -31
  6. package/dist/components/order-daily-overview/return-after-table/table/OrderTable.js.map +1 -1
  7. package/dist/components/order-daily-overview/return-after-table/table-filters/ReturnOrderFilter.js +82 -79
  8. package/dist/components/order-daily-overview/return-after-table/table-filters/ReturnOrderFilter.js.map +1 -1
  9. package/dist/components/order-daily-overview/return-order-table/return-orders-filters/ReturnOrderTable.js +157 -151
  10. package/dist/components/order-daily-overview/return-order-table/return-orders-filters/ReturnOrderTable.js.map +1 -1
  11. package/dist/components/order-view/order-actions/Dropdown.js +3 -3
  12. package/dist/components/order-view/order-actions/Dropdown.js.map +1 -1
  13. package/dist/components/order-view/order-actions/actions/cancel-order/CancelOrderTable.js +47 -45
  14. package/dist/components/order-view/order-actions/actions/cancel-order/CancelOrderTable.js.map +1 -1
  15. package/dist/components/order-view/order-actions/actions/cancel-order/ReturnReason.js +36 -23
  16. package/dist/components/order-view/order-actions/actions/cancel-order/ReturnReason.js.map +1 -1
  17. package/dist/components/order-view/order-actions/actions/confirm-order/tables/ProductTable.js +25 -23
  18. package/dist/components/order-view/order-actions/actions/confirm-order/tables/ProductTable.js.map +1 -1
  19. package/dist/components/order-view/order-actions/actions/force-debrief/ForceDebriefModal.js +89 -88
  20. package/dist/components/order-view/order-actions/actions/force-debrief/ForceDebriefModal.js.map +1 -1
  21. package/dist/components/order-view/order-actions/actions/force-debrief/charges/collection-add-ons/index.js +16 -16
  22. package/dist/components/order-view/order-actions/actions/force-debrief/charges/collection-add-ons/index.js.map +1 -1
  23. package/dist/components/order-view/order-actions/actions/force-debrief/escalation/EscalationReason.js +23 -22
  24. package/dist/components/order-view/order-actions/actions/force-debrief/escalation/EscalationReason.js.map +1 -1
  25. package/dist/components/order-view/order-actions/actions/force-debrief/order-info/RadioButtons.js +56 -52
  26. package/dist/components/order-view/order-actions/actions/force-debrief/order-info/RadioButtons.js.map +1 -1
  27. package/dist/components/order-view/order-actions/actions/force-debrief/order-info/dropdowns/FailureReasonDropdown.js +27 -26
  28. package/dist/components/order-view/order-actions/actions/force-debrief/order-info/dropdowns/FailureReasonDropdown.js.map +1 -1
  29. package/dist/components/order-view/order-actions/actions/hold-order/HoldOrderModal.js +29 -29
  30. package/dist/components/order-view/order-actions/actions/hold-order/HoldOrderModal.js.map +1 -1
  31. package/dist/components/order-view/order-actions/actions/split-order/SplitOrderTable.js +72 -71
  32. package/dist/components/order-view/order-actions/actions/split-order/SplitOrderTable.js.map +1 -1
  33. package/dist/components/order-view/order-actions/actions/uncancel-order/UncancelOrderTable.js +37 -35
  34. package/dist/components/order-view/order-actions/actions/uncancel-order/UncancelOrderTable.js.map +1 -1
  35. package/dist/components/order-view/order-details/expanded-content/services-section/OrderServices.js +20 -18
  36. package/dist/components/order-view/order-details/expanded-content/services-section/OrderServices.js.map +1 -1
  37. package/dist/components/order-view/order-details/expanded-content/services-section/ServiceType.js +26 -22
  38. package/dist/components/order-view/order-details/expanded-content/services-section/ServiceType.js.map +1 -1
  39. package/dist/components/order-view/order-details/helper.js.map +1 -1
  40. package/dist/components/order-view/return-client-products/product-table/ReturnProductTable.js +53 -53
  41. package/dist/components/order-view/return-client-products/product-table/ReturnProductTable.js.map +1 -1
  42. package/dist/components/order-view/toolbox-resources/expanded-content/index.js +6 -7
  43. package/dist/components/order-view/toolbox-resources/expanded-content/index.js.map +1 -1
  44. package/dist/components/utils.js +4 -5
  45. package/dist/components/utils.js.map +1 -1
  46. package/dist/types/components/order-view/order-actions/Dropdown.d.ts +1 -0
  47. package/dist/types/components/utils.d.ts +0 -1
  48. package/package.json +2 -2
@@ -1,65 +1,66 @@
1
- import { jsxs as b, jsx as n } from "react/jsx-runtime";
2
- import { Label as I, SelectDropdown as O } from "@bjsdistribution/dms-component-library";
3
- import x from "styled-components";
4
- import { useOrderStaticData as C, useFailureReason as S, useIsFailureReasonChanged as w } from "../../../../../store.js";
5
- function q() {
6
- const [a] = C(), [i, u] = S(), [, c] = w(), d = a?.failure_reasons, t = a?.escalation_category, s = a?.escalation_types, l = a?.fault_non_fault_reasons, p = t?.find(
1
+ import { jsxs as C, jsx as t } from "react/jsx-runtime";
2
+ import { Label as I, SelectDropdown as O, toReverseDeliveryLabel as x } from "@bjsdistribution/dms-component-library";
3
+ import v from "styled-components";
4
+ import { useOrderStaticData as D, useFailureReason as S, useIsFailureReasonChanged as w } from "../../../../../store.js";
5
+ import { useClientPortal as N } from "../../../../../../store.js";
6
+ function z() {
7
+ const [a] = D(), [i] = N(), [u, c] = S(), [, d] = w(), p = a?.failure_reasons, n = a?.escalation_category, s = a?.escalation_types, l = a?.fault_non_fault_reasons, f = n?.find(
7
8
  (e) => e?.type === "Failure - Non Fault"
8
- )?.id, f = t?.find(
9
+ )?.id, F = n?.find(
9
10
  (e) => e?.type === "Failure - Fault"
10
- )?.id, F = s?.filter(
11
- (e) => e?.escalation_category_id === p
12
- )[0]?.id, R = s?.filter(
11
+ )?.id, R = s?.filter(
13
12
  (e) => e?.escalation_category_id === f
14
- )[0]?.id, _ = l?.filter(
15
- (e) => e?.escalation_type_id === F
16
- ), m = l?.filter(
13
+ )[0]?.id, m = s?.filter(
14
+ (e) => e?.escalation_category_id === F
15
+ )[0]?.id, y = l?.filter(
17
16
  (e) => e?.escalation_type_id === R
17
+ ), _ = l?.filter(
18
+ (e) => e?.escalation_type_id === m
18
19
  ), r = (e) => {
19
20
  const h = new Set(
20
21
  e?.map((o) => o?.order_reason_id)
21
22
  );
22
- return d?.filter((o) => h?.has(o?.id))?.map((o) => ({
23
+ return p?.filter((o) => h?.has(o?.id))?.map((o) => ({
23
24
  value: o?.reason,
24
- label: o?.title,
25
+ label: i ? o?.title : x(o?.title),
25
26
  id: o?.id
26
27
  }));
27
- }, y = r(m), g = r(_);
28
- return /* @__PURE__ */ b(D, { children: [
29
- /* @__PURE__ */ n(I, { label: "Failure Reason", htmlFor: "failurereasondropdown", required: !0 }),
30
- /* @__PURE__ */ n(
28
+ }, g = r(_), b = r(y);
29
+ return /* @__PURE__ */ C(L, { children: [
30
+ /* @__PURE__ */ t(I, { label: "Failure Reason", htmlFor: "failurereasondropdown", required: !0 }),
31
+ /* @__PURE__ */ t(
31
32
  O,
32
33
  {
33
34
  placeholder: "Select Reason",
34
35
  options: [
35
36
  {
36
37
  label: "Fault Reasons",
37
- options: y
38
+ options: g
38
39
  },
39
40
  {
40
41
  label: "Non-Fault Reasons",
41
- options: g
42
+ options: b
42
43
  }
43
44
  ] || [],
44
45
  inputId: "failurereasondropdown",
45
46
  openMenuOnFocus: !0,
46
- value: i,
47
+ value: u,
47
48
  onChange: (e) => {
48
- u(e), c(!0);
49
+ c(e), d(!0);
49
50
  },
50
- formatGroupLabel: (e) => /* @__PURE__ */ n("div", { style: { color: "rgba(0,0,0,0.8)" }, children: /* @__PURE__ */ n("span", { children: e?.label }) }),
51
+ formatGroupLabel: (e) => /* @__PURE__ */ t("div", { style: { color: "rgba(0,0,0,0.8)" }, children: /* @__PURE__ */ t("span", { children: e?.label }) }),
51
52
  isDisabled: !1
52
53
  }
53
54
  )
54
55
  ] });
55
56
  }
56
- const D = x.div`
57
+ const L = v.div`
57
58
  display: flex;
58
59
  flex-direction: column;
59
60
  gap: 6px;
60
61
  flex: 1;
61
62
  `;
62
63
  export {
63
- q as default
64
+ z as default
64
65
  };
65
66
  //# sourceMappingURL=FailureReasonDropdown.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"FailureReasonDropdown.js","sources":["../../../../../../../../src/components/order-view/order-actions/actions/force-debrief/order-info/dropdowns/FailureReasonDropdown.tsx"],"sourcesContent":["import { Label, SelectDropdown } from '@bjsdistribution/dms-component-library';\nimport React from 'react';\nimport styled from 'styled-components';\nimport {\n useFailureReason,\n useIsFailureReasonChanged,\n useOrderStaticData,\n} from '../../../../../store';\n\nfunction FailureReasonDropdown() {\n const [orderStaticData] = useOrderStaticData();\n const [failureReasonState, setFailureReason] = useFailureReason();\n const [, setIsFailureReasonChanged] = useIsFailureReasonChanged(); // to map esc reason properly\n const failureReasons = orderStaticData?.failure_reasons;\n const escalationCategory = orderStaticData?.escalation_category;\n const escalationTypes = orderStaticData?.escalation_types;\n const faultNonFaultReasons = orderStaticData?.fault_non_fault_reasons;\n\n // Step 1: Get IDs of \"Failure-Non_Fault\" and \"Failure-Fault\"\n const failureNonFaultId = escalationCategory?.find(\n (category: any) => category?.type === 'Failure - Non Fault'\n )?.id;\n const failureFaultId = escalationCategory?.find(\n (category: any) => category?.type === 'Failure - Fault'\n )?.id;\n\n // Step 2: Map to get escalation type IDs\n\n const failureNonFaultEscTypeId = escalationTypes?.filter(\n (type: any) => type?.escalation_category_id === failureNonFaultId\n )[0]?.id;\n const failureFaultEscTypeId = escalationTypes?.filter(\n (type: any) => type?.escalation_category_id === failureFaultId\n )[0]?.id;\n\n // Step 3: Separate fault and non-fault reasons\n const nonFaultReasons = faultNonFaultReasons?.filter(\n (reason: any) => reason?.escalation_type_id === failureNonFaultEscTypeId\n );\n const faultReasons = faultNonFaultReasons?.filter(\n (reason: any) => reason?.escalation_type_id === failureFaultEscTypeId\n );\n\n // Step 4: Simplified mapping to failureReasons\n const mapReasonsToFailures = (reasons: any) => {\n const reasonIds = new Set(\n reasons?.map((reason: any) => reason?.order_reason_id)\n );\n return failureReasons\n ?.filter((failure: any) => reasonIds?.has(failure?.id))\n ?.map((failure: any) => ({\n value: failure?.reason,\n label: failure?.title,\n id: failure?.id,\n }));\n };\n\n const faultReasonOptions = mapReasonsToFailures(faultReasons);\n const nonFaultReasonOptions = mapReasonsToFailures(nonFaultReasons);\n\n const groupedOptions: any = [\n {\n label: 'Fault Reasons',\n options: faultReasonOptions,\n },\n {\n label: 'Non-Fault Reasons',\n options: nonFaultReasonOptions,\n },\n ];\n\n const onChangeOption = (option: any) => {\n setFailureReason(option);\n setIsFailureReasonChanged(true);\n };\n\n const formatGroupLabel = (data: any) => (\n <div style={{ color: 'rgba(0,0,0,0.8)' }}>\n <span>{data?.label}</span>\n {/* <span>{data?.options?.length}</span> */}\n </div>\n );\n\n return (\n <Container>\n <Label label=\"Failure Reason\" htmlFor=\"failurereasondropdown\" required />\n <SelectDropdown\n placeholder=\"Select Reason\"\n options={groupedOptions || []}\n inputId=\"failurereasondropdown\"\n openMenuOnFocus\n value={failureReasonState}\n onChange={onChangeOption}\n formatGroupLabel={formatGroupLabel}\n isDisabled={false}\n />\n </Container>\n );\n}\n\nconst Container = styled.div`\n display: flex;\n flex-direction: column;\n gap: 6px;\n flex: 1;\n`;\n\nexport default FailureReasonDropdown;\n"],"names":["FailureReasonDropdown","orderStaticData","useOrderStaticData","failureReasonState","setFailureReason","useFailureReason","setIsFailureReasonChanged","useIsFailureReasonChanged","failureReasons","escalationCategory","escalationTypes","faultNonFaultReasons","failureNonFaultId","category","failureFaultId","failureNonFaultEscTypeId","type","failureFaultEscTypeId","nonFaultReasons","reason","faultReasons","mapReasonsToFailures","reasons","reasonIds","failure","faultReasonOptions","nonFaultReasonOptions","Container","jsx","Label","SelectDropdown","option","data","styled"],"mappings":";;;;AASA,SAASA,IAAwB;AAC/B,QAAM,CAACC,CAAe,IAAIC,EAAA,GACpB,CAACC,GAAoBC,CAAgB,IAAIC,EAAA,GACzC,CAAA,EAAGC,CAAyB,IAAIC,EAAA,GAChCC,IAAiBP,GAAiB,iBAClCQ,IAAqBR,GAAiB,qBACtCS,IAAkBT,GAAiB,kBACnCU,IAAuBV,GAAiB,yBAGxCW,IAAoBH,GAAoB;AAAA,IAC5C,CAACI,MAAkBA,GAAU,SAAS;AAAA,EAAA,GACrC,IACGC,IAAiBL,GAAoB;AAAA,I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AM,GACvBzB,EAA0B,EAAI;AAAA,QAChC;AAAA,QAmBM,kBAjBmB,CAAC0B,MACxB,gBAAAJ,EAAC,SAAI,OAAO,EAAE,OAAO,kBAAA,GACnB,UAAA,gBAAAA,EAAC,QAAA,EAAM,UAAAI,GAAM,OAAM,GAErB;AAAA,QAcI,YAAY;AAAA,MAAA;AAAA,IAAA;AAAA,EACd,GACF;AAEJ;AAEA,MAAML,IAAYM,EAAO;AAAA;AAAA;AAAA;AAAA;AAAA;"}
1
+ {"version":3,"file":"FailureReasonDropdown.js","sources":["../../../../../../../../src/components/order-view/order-actions/actions/force-debrief/order-info/dropdowns/FailureReasonDropdown.tsx"],"sourcesContent":["import { Label, SelectDropdown, toReverseDeliveryLabel } from '@bjsdistribution/dms-component-library';\nimport React from 'react';\nimport styled from 'styled-components';\nimport {\n useFailureReason,\n useIsFailureReasonChanged,\n useOrderStaticData,\n} from '../../../../../store';\nimport { useClientPortal } from '../../../../../../store';\n\nfunction FailureReasonDropdown() {\n const [orderStaticData] = useOrderStaticData();\n const [isClientPortal] = useClientPortal();\n const [failureReasonState, setFailureReason] = useFailureReason();\n const [, setIsFailureReasonChanged] = useIsFailureReasonChanged(); // to map esc reason properly\n const failureReasons = orderStaticData?.failure_reasons;\n const escalationCategory = orderStaticData?.escalation_category;\n const escalationTypes = orderStaticData?.escalation_types;\n const faultNonFaultReasons = orderStaticData?.fault_non_fault_reasons;\n\n // Step 1: Get IDs of \"Failure-Non_Fault\" and \"Failure-Fault\"\n const failureNonFaultId = escalationCategory?.find(\n (category: any) => category?.type === 'Failure - Non Fault'\n )?.id;\n const failureFaultId = escalationCategory?.find(\n (category: any) => category?.type === 'Failure - Fault'\n )?.id;\n\n // Step 2: Map to get escalation type IDs\n\n const failureNonFaultEscTypeId = escalationTypes?.filter(\n (type: any) => type?.escalation_category_id === failureNonFaultId\n )[0]?.id;\n const failureFaultEscTypeId = escalationTypes?.filter(\n (type: any) => type?.escalation_category_id === failureFaultId\n )[0]?.id;\n\n // Step 3: Separate fault and non-fault reasons\n const nonFaultReasons = faultNonFaultReasons?.filter(\n (reason: any) => reason?.escalation_type_id === failureNonFaultEscTypeId\n );\n const faultReasons = faultNonFaultReasons?.filter(\n (reason: any) => reason?.escalation_type_id === failureFaultEscTypeId\n );\n\n // Step 4: Simplified mapping to failureReasons\n const mapReasonsToFailures = (reasons: any) => {\n const reasonIds = new Set(\n reasons?.map((reason: any) => reason?.order_reason_id)\n );\n return failureReasons\n ?.filter((failure: any) => reasonIds?.has(failure?.id))\n ?.map((failure: any) => ({\n value: failure?.reason,\n label: isClientPortal\n ? failure?.title\n : toReverseDeliveryLabel(failure?.title),\n id: failure?.id,\n }));\n };\n\n const faultReasonOptions = mapReasonsToFailures(faultReasons);\n const nonFaultReasonOptions = mapReasonsToFailures(nonFaultReasons);\n\n const groupedOptions: any = [\n {\n label: 'Fault Reasons',\n options: faultReasonOptions,\n },\n {\n label: 'Non-Fault Reasons',\n options: nonFaultReasonOptions,\n },\n ];\n\n const onChangeOption = (option: any) => {\n setFailureReason(option);\n setIsFailureReasonChanged(true);\n };\n\n const formatGroupLabel = (data: any) => (\n <div style={{ color: 'rgba(0,0,0,0.8)' }}>\n <span>{data?.label}</span>\n {/* <span>{data?.options?.length}</span> */}\n </div>\n );\n\n return (\n <Container>\n <Label label=\"Failure Reason\" htmlFor=\"failurereasondropdown\" required />\n <SelectDropdown\n placeholder=\"Select Reason\"\n options={groupedOptions || []}\n inputId=\"failurereasondropdown\"\n openMenuOnFocus\n value={failureReasonState}\n onChange={onChangeOption}\n formatGroupLabel={formatGroupLabel}\n isDisabled={false}\n />\n </Container>\n );\n}\n\nconst Container = styled.div`\n display: flex;\n flex-direction: column;\n gap: 6px;\n flex: 1;\n`;\n\nexport default FailureReasonDropdown;\n"],"names":["FailureReasonDropdown","orderStaticData","useOrderStaticData","isClientPortal","useClientPortal","failureReasonState","setFailureReason","useFailureReason","setIsFailureReasonChanged","useIsFailureReasonChanged","failureReasons","escalationCategory","escalationTypes","faultNonFaultReasons","failureNonFaultId","category","failureFaultId","failureNonFaultEscTypeId","type","failureFaultEscTypeId","nonFaultReasons","reason","faultReasons","mapReasonsToFailures","reasons","reasonIds","failure","toReverseDeliveryLabel","faultReasonOptions","nonFaultReasonOptions","Container","jsx","Label","SelectDropdown","option","data","styled"],"mappings":";;;;;AAUA,SAASA,IAAwB;AAC/B,QAAM,CAACC,CAAe,IAAIC,EAAA,GACpB,CAACC,CAAc,IAAIC,EAAA,GACnB,CAACC,GAAoBC,CAAgB,IAAIC,EAAA,GACzC,CAAA,EAAGC,CAAyB,IAAIC,EAAA,GAChCC,IAAiBT,GAAiB,iBAClCU,IAAqBV,GAAiB,qBACtCW,IAAkBX,GAAiB,kBACnCY,IAAuBZ,GAAiB,yBAGxCa,IAAoBH,GAAoB;AAAA,IAC5C,CAACI,MAAkBA,GAAU,SAAS;AAAA,EAAA,GACrC,IACGC,IAAiBL,GAAoB;AAAA,IACzC,CAACI,MAAkBA,GAAU,SAAS;AAAA,EAAA,GACrC,IAIGE,IAA2BL,GAAiB;AAAA,IAChD,CAACM,MAAcA,GAAM,2BAA2BJ;AAAA,EAAA,EAChD,CAAC,GAAG,IACAK,IAAwBP,GAAiB;AAAA,IAC7C,CAACM,MAAcA,GAAM,2BAA2BF;AAAA,EAAA,EAChD,CAAC,GAAG,IAGAI,IAAkBP,GAAsB;AAAA,IAC5C,CAACQ,MAAgBA,GAAQ,uBAAuBJ;AAAA,EAAA,GAE5CK,IAAeT,GAAsB;AAAA,IACzC,CAACQ,MAAgBA,GAAQ,uBAAuBF;AAAA,EAAA,GAI5CI,IAAuB,CAACC,MAAiB;AAC7C,UAAMC,IAAY,IAAI;AAAA,MACpBD,GAAS,IAAI,CAACH,MAAgBA,GAAQ,eAAe;AAAA,IAAA;AAEvD,WAAOX,GACH,OAAO,CAACgB,MAAiBD,GAAW,IAAIC,GAAS,EAAE,CAAC,GACpD,IAAI,CAACA,OAAkB;AAAA,MACvB,OAAOA,GAAS;AAAA,MAChB,OAAOvB,IACHuB,GAAS,QACTC,EAAuBD,GAAS,KAAK;AAAA,MACzC,IAAIA,GAAS;AAAA,IAAA,EACb;AAAA,EACN,GAEME,IAAqBL,EAAqBD,CAAY,GACtDO,IAAwBN,EAAqBH,CAAe;AAyBlE,2BACGU,GAAA,EACC,UAAA;AAAA,IAAA,gBAAAC,EAACC,KAAM,OAAM,kBAAiB,SAAQ,yBAAwB,UAAQ,IAAC;AAAA,IACvE,gBAAAD;AAAA,MAACE;AAAA,MAAA;AAAA,QACC,aAAY;AAAA,QACZ,SA5BsB;AAAA,UAC1B;AAAA,YACE,OAAO;AAAA,YACP,SAASL;AAAA,UAAA;AAAA,UAEX;AAAA,YACE,OAAO;AAAA,YACP,SAASC;AAAA,UAAA;AAAA,QACX,KAoB+B,CAAA;AAAA,QAC3B,SAAQ;AAAA,QACR,iBAAe;AAAA,QACf,OAAOxB;AAAA,QACP,UArBiB,CAAC6B,MAAgB;AACtC,UAAA5B,EAAiB4B,CAAM,GACvB1B,EAA0B,EAAI;AAAA,QAChC;AAAA,QAmBM,kBAjBmB,CAAC2B,MACxB,gBAAAJ,EAAC,SAAI,OAAO,EAAE,OAAO,kBAAA,GACnB,UAAA,gBAAAA,EAAC,QAAA,EAAM,UAAAI,GAAM,OAAM,GAErB;AAAA,QAcI,YAAY;AAAA,MAAA;AAAA,IAAA;AAAA,EACd,GACF;AAEJ;AAEA,MAAML,IAAYM,EAAO;AAAA;AAAA;AAAA;AAAA;AAAA;"}
@@ -1,42 +1,42 @@
1
1
  import { jsx as o, jsxs as i } from "react/jsx-runtime";
2
- import { useState as f, useEffect as T } from "react";
3
- import { useAxios as Y, Label as h, AntSelect as _ } from "@bjsdistribution/dms-component-library";
4
- import { useOrderId as x, useCurrentAction as y, useOrderStaticData as I, useCustomerInfo as R } from "../../../store.js";
5
- import P from "../../../../../common/modals/order-action-modal/OrderActionModal.js";
6
- import { HoldContentContainer as k, SplitText as j, HoldRow as p, HoldDatePickerWrap as B } from "../modalstyle.js";
2
+ import { useState as h, useEffect as y } from "react";
3
+ import { toReverseDeliveryLabel as T, useAxios as Y, Label as p, AntSelect as _ } from "@bjsdistribution/dms-component-library";
4
+ import { useOrderId as x, useCurrentAction as R, useOrderStaticData as I, useCustomerInfo as P } from "../../../store.js";
5
+ import k from "../../../../../common/modals/order-action-modal/OrderActionModal.js";
6
+ import { HoldContentContainer as j, SplitText as B, HoldRow as S, HoldDatePickerWrap as L } from "../modalstyle.js";
7
7
  import { notification as d, DatePicker as U } from "antd";
8
- import S from "dayjs";
8
+ import D from "dayjs";
9
9
  import { useClientPortal as W } from "../../../../store.js";
10
- function X(n) {
11
- const [a] = x(), [, l] = y(), [H] = I(), [t, c] = f(null), [s, C] = f(void 0), [m] = R(), [D] = W(), b = `${m?.recipient_name}, ${m?.postcode}`, w = H?.onhold_reasons?.map(
10
+ function Z(n) {
11
+ const [a] = x(), [, l] = R(), [H] = I(), [t, c] = h(null), [s, C] = h(void 0), [u] = P(), [m] = W(), b = `${u?.recipient_name}, ${u?.postcode}`, v = H?.onhold_reasons?.map(
12
12
  (e) => ({
13
- label: e?.reason,
13
+ label: m ? e?.reason : T(e?.reason),
14
14
  value: e?.reason
15
15
  })
16
- ), g = t ? `orders/${a}/hold/?hold_reason=${s}&hold_until=${t}` : `orders/${a}/hold/?hold_reason=${s}
17
- `, { fetchData: v, error: r } = Y({
18
- endpoint: g,
16
+ ), w = t ? `orders/${a}/hold/?hold_reason=${s}&hold_until=${t}` : `orders/${a}/hold/?hold_reason=${s}
17
+ `, { fetchData: g, error: r } = Y({
18
+ endpoint: w,
19
19
  method: "POST"
20
20
  }), A = () => {
21
21
  l(void 0);
22
22
  }, O = (e) => {
23
23
  C(e);
24
- }, $ = (e, L) => {
25
- const u = e?.format("YYYY-MM-DDTHH:mm:ss");
26
- c(u !== void 0 ? u : null);
24
+ }, $ = (e, q) => {
25
+ const f = e?.format("YYYY-MM-DDTHH:mm:ss");
26
+ c(f !== void 0 ? f : null);
27
27
  }, M = async () => {
28
28
  if (a) {
29
- const e = await v();
29
+ const e = await g();
30
30
  e?.code === 200 && (d.success({
31
31
  message: "Success",
32
32
  description: `${e.message}`
33
- }), D && await n?.callUnresolvedTaskApi(), await n?.callOrderAlertsApi(), await n?.callOrderStatusApi(), await n?.callOrdersApi()), e?.code !== 200 && (d.error({
33
+ }), m && await n?.callUnresolvedTaskApi(), await n?.callOrderAlertsApi(), await n?.callOrderStatusApi(), await n?.callOrdersApi()), e?.code !== 200 && (d.error({
34
34
  message: "Error",
35
35
  description: `${e.error}`
36
36
  }), l(void 0));
37
37
  }
38
38
  };
39
- return T(() => {
39
+ return y(() => {
40
40
  r !== null && r?.code !== 200 && (console.log("entered"), d.error({
41
41
  //@ts-ignore
42
42
  message: `${r?.error}`,
@@ -46,7 +46,7 @@ function X(n) {
46
46
  )
47
47
  }), l(void 0));
48
48
  }, [r]), /* @__PURE__ */ o(
49
- P,
49
+ k,
50
50
  {
51
51
  minWidth: "24vw",
52
52
  headerTitle: "Hold order",
@@ -56,26 +56,26 @@ function X(n) {
56
56
  infoText: b,
57
57
  submitBtnTitle: "Save Details",
58
58
  isSubmitDisabled: !(s !== void 0),
59
- children: /* @__PURE__ */ o(k, { children: /* @__PURE__ */ i(j, { children: [
60
- /* @__PURE__ */ i(p, { children: [
61
- /* @__PURE__ */ o(h, { label: "Hold Until (leave blank for indefinite)" }),
62
- /* @__PURE__ */ o(B, { children: /* @__PURE__ */ o(
59
+ children: /* @__PURE__ */ o(j, { children: /* @__PURE__ */ i(B, { children: [
60
+ /* @__PURE__ */ i(S, { children: [
61
+ /* @__PURE__ */ o(p, { label: "Hold Until (leave blank for indefinite)" }),
62
+ /* @__PURE__ */ o(L, { children: /* @__PURE__ */ o(
63
63
  U,
64
64
  {
65
65
  needConfirm: !0,
66
66
  format: "MMMM D, YYYY",
67
67
  onChange: $,
68
- value: t === null ? t : S(t),
69
- disabledDate: (e) => e && e < S().startOf("day")
68
+ value: t === null ? t : D(t),
69
+ disabledDate: (e) => e && e < D().startOf("day")
70
70
  }
71
71
  ) })
72
72
  ] }),
73
- /* @__PURE__ */ i(p, { children: [
74
- /* @__PURE__ */ o(h, { label: "Hold Reason", required: !0 }),
73
+ /* @__PURE__ */ i(S, { children: [
74
+ /* @__PURE__ */ o(p, { label: "Hold Reason", required: !0 }),
75
75
  /* @__PURE__ */ o(
76
76
  _,
77
77
  {
78
- options: w || [],
78
+ options: v || [],
79
79
  placeholder: "Select Hold Reason",
80
80
  onChange: O,
81
81
  disabled: !1,
@@ -92,6 +92,6 @@ function X(n) {
92
92
  );
93
93
  }
94
94
  export {
95
- X as default
95
+ Z as default
96
96
  };
97
97
  //# sourceMappingURL=HoldOrderModal.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"HoldOrderModal.js","sources":["../../../../../../src/components/order-view/order-actions/actions/hold-order/HoldOrderModal.tsx"],"sourcesContent":["import React, { useEffect, useState } from 'react';\nimport {\n AntSelect,\n Label,\n useAxios,\n} from '@bjsdistribution/dms-component-library';\nimport {\n useCurrentAction,\n useCustomerInfo,\n useOrderId,\n useOrderStaticData,\n} from '../../../store';\nimport OrderActionModal from '../../../../../common/modals/order-action-modal/OrderActionModal';\nimport {\n HoldContentContainer,\n HoldDatePickerWrap,\n HoldRow,\n SplitText,\n} from '../modalstyle';\nimport { DatePicker, DatePickerProps, notification } from 'antd';\nimport dayjs from 'dayjs';\nimport { ApiResponse } from '../../../types';\nimport { useClientPortal } from '../../../../store';\n\ninterface IProps {\n callOrderAlertsApi: any;\n callOrdersApi?: any;\n callOrderStatusApi: any;\n callUnresolvedTaskApi?: any;\n}\n\nfunction HoldOrderModal(props: IProps) {\n const [orderId] = useOrderId();\n const [, setCurrentAction] = useCurrentAction();\n const [orderStaticData] = useOrderStaticData();\n const [selectedDate, setDate] = useState<Date | string | null>(null);\n const [holdReason, setHoldReason] = useState<string | undefined>(undefined);\n const [customerInfo] = useCustomerInfo();\n const [isClientPortal] = useClientPortal();\n const infoText = `${customerInfo?.recipient_name}, ${customerInfo?.postcode}`;\n\n const onHoldReasonOptions = orderStaticData?.onhold_reasons?.map(\n (item: any) => {\n return {\n label: item?.reason,\n value: item?.reason,\n };\n }\n );\n\n const dynamicUrl = selectedDate\n ? `orders/${orderId}/hold/?hold_reason=${holdReason}&hold_until=${selectedDate}`\n : `orders/${orderId}/hold/?hold_reason=${holdReason}\n`;\n\n const { fetchData: callOnHoldApi, error } = useAxios<{\n data: ApiResponse[];\n }>({\n endpoint: dynamicUrl,\n method: 'POST',\n });\n\n const onClose = () => {\n setCurrentAction(undefined);\n };\n\n const onChangeHold = (value: string) => {\n setHoldReason(value);\n };\n\n const handleDateChange: DatePickerProps['onChange'] = (date, _dateString) => {\n const newDate = date?.format('YYYY-MM-DDTHH:mm:ss');\n if (newDate !== undefined) {\n setDate(newDate);\n } else {\n setDate(null);\n }\n };\n\n const onSubmitHold = async () => {\n if (orderId) {\n const response = (await callOnHoldApi()) as {\n code: number | null;\n error?: string | null | undefined;\n [key: string]: any;\n };\n if (response?.code === 200) {\n notification.success({\n message: 'Success',\n description: `${response.message}`,\n });\n // call orders api to update status\n if (isClientPortal) {\n await props?.callUnresolvedTaskApi();\n }\n await props?.callOrderAlertsApi();\n await props?.callOrderStatusApi();\n await props?.callOrdersApi();\n }\n if (response?.code !== 200) {\n notification.error({\n message: 'Error',\n description: `${response.error}`,\n });\n setCurrentAction(undefined);\n }\n }\n };\n\n useEffect(() => {\n //@ts-ignore\n if (error !== null && error?.code !== 200) {\n console.log('entered');\n notification.error({\n //@ts-ignore\n message: `${error?.error}`,\n description: (\n //@ts-ignore\n <span dangerouslySetInnerHTML={{ __html: error?.message }} />\n ),\n });\n setCurrentAction(undefined);\n }\n }, [error]);\n\n const showSubmitBtn = holdReason !== undefined;\n\n return (\n <OrderActionModal\n minWidth=\"24vw\"\n headerTitle=\"Hold order\"\n onCloseHeader={onClose}\n onSubmit={onSubmitHold}\n showAdditionalInfo\n infoText={infoText}\n submitBtnTitle=\"Save Details\"\n isSubmitDisabled={!showSubmitBtn}\n >\n <HoldContentContainer>\n <SplitText>\n <HoldRow>\n <Label label=\"Hold Until (leave blank for indefinite)\" />\n <HoldDatePickerWrap>\n <DatePicker\n needConfirm\n format={'MMMM D, YYYY'}\n onChange={handleDateChange}\n value={\n selectedDate === null ? selectedDate : dayjs(selectedDate)\n }\n disabledDate={current => {\n return current && current < dayjs().startOf('day');\n }}\n />\n </HoldDatePickerWrap>\n </HoldRow>\n\n <HoldRow>\n <Label label=\"Hold Reason\" required />\n <AntSelect\n options={onHoldReasonOptions || []}\n placeholder=\"Select Hold Reason\"\n onChange={onChangeHold}\n disabled={false}\n style={{ width: '346px', height: 40 }}\n showSearch={true}\n popupClassName={'dropDownStyle'}\n selectWrapperClass={'rounded'}\n defaultValue={holdReason}\n />\n </HoldRow>\n </SplitText>\n </HoldContentContainer>\n </OrderActionModal>\n );\n}\n\nexport default HoldOrderModal;\n"],"names":["HoldOrderModal","props","orderId","useOrderId","setCurrentAction","useCurrentAction","orderStaticData","useOrderStaticData","selectedDate","setDate","useState","holdReason","setHoldReason","customerInfo","useCustomerInfo","isClientPortal","useClientPortal","infoText","onHoldReasonOptions","item","dynamicUrl","callOnHoldApi","error","useAxios","onClose","onChangeHold","value","handleDateChange","date","_dateString","newDate","onSubmitHold","response","notification","useEffect","jsx","OrderActionModal","HoldContentContainer","jsxs","SplitText","HoldRow","Label","HoldDatePickerWrap","DatePicker","dayjs","current","AntSelect"],"mappings":";;;;;;;;;AA+BA,SAASA,EAAeC,GAAe;AACrC,QAAM,CAACC,CAAO,IAAIC,EAAA,GACZ,CAAA,EAAGC,CAAgB,IAAIC,EAAA,GACvB,CAACC,CAAe,IAAIC,EAAA,GACpB,CAACC,GAAcC,CAAO,IAAIC,EAA+B,IAAI,GAC7D,CAACC,GAAYC,CAAa,IAAIF,EAA6B,MAAS,GACpE,CAACG,CAAY,IAAIC,EAAA,GACjB,CAACC,CAAc,IAAIC,EAAA,GACnBC,IAAW,GAAGJ,GAAc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A,UAAA;AAAA,QAChB,EAAA,CACF;AAAA,MAAA,EAAA,CACF,EAAA,CACF;AAAA,IAAA;AAAA,EAAA;AAGN;"}
1
+ {"version":3,"file":"HoldOrderModal.js","sources":["../../../../../../src/components/order-view/order-actions/actions/hold-order/HoldOrderModal.tsx"],"sourcesContent":["import React, { useEffect, useState } from 'react';\nimport {\n AntSelect,\n Label,\n toReverseDeliveryLabel,\n useAxios,\n} from '@bjsdistribution/dms-component-library';\nimport {\n useCurrentAction,\n useCustomerInfo,\n useOrderId,\n useOrderStaticData,\n} from '../../../store';\nimport OrderActionModal from '../../../../../common/modals/order-action-modal/OrderActionModal';\nimport {\n HoldContentContainer,\n HoldDatePickerWrap,\n HoldRow,\n SplitText,\n} from '../modalstyle';\nimport { DatePicker, DatePickerProps, notification } from 'antd';\nimport dayjs from 'dayjs';\nimport { ApiResponse } from '../../../types';\nimport { useClientPortal } from '../../../../store';\n\ninterface IProps {\n callOrderAlertsApi: any;\n callOrdersApi?: any;\n callOrderStatusApi: any;\n callUnresolvedTaskApi?: any;\n}\n\nfunction HoldOrderModal(props: IProps) {\n const [orderId] = useOrderId();\n const [, setCurrentAction] = useCurrentAction();\n const [orderStaticData] = useOrderStaticData();\n const [selectedDate, setDate] = useState<Date | string | null>(null);\n const [holdReason, setHoldReason] = useState<string | undefined>(undefined);\n const [customerInfo] = useCustomerInfo();\n const [isClientPortal] = useClientPortal();\n const infoText = `${customerInfo?.recipient_name}, ${customerInfo?.postcode}`;\n\n const onHoldReasonOptions = orderStaticData?.onhold_reasons?.map(\n (item: any) => {\n return {\n label: isClientPortal\n ? item?.reason\n : toReverseDeliveryLabel(item?.reason),\n value: item?.reason,\n };\n }\n );\n\n const dynamicUrl = selectedDate\n ? `orders/${orderId}/hold/?hold_reason=${holdReason}&hold_until=${selectedDate}`\n : `orders/${orderId}/hold/?hold_reason=${holdReason}\n`;\n\n const { fetchData: callOnHoldApi, error } = useAxios<{\n data: ApiResponse[];\n }>({\n endpoint: dynamicUrl,\n method: 'POST',\n });\n\n const onClose = () => {\n setCurrentAction(undefined);\n };\n\n const onChangeHold = (value: string) => {\n setHoldReason(value);\n };\n\n const handleDateChange: DatePickerProps['onChange'] = (date, _dateString) => {\n const newDate = date?.format('YYYY-MM-DDTHH:mm:ss');\n if (newDate !== undefined) {\n setDate(newDate);\n } else {\n setDate(null);\n }\n };\n\n const onSubmitHold = async () => {\n if (orderId) {\n const response = (await callOnHoldApi()) as {\n code: number | null;\n error?: string | null | undefined;\n [key: string]: any;\n };\n if (response?.code === 200) {\n notification.success({\n message: 'Success',\n description: `${response.message}`,\n });\n // call orders api to update status\n if (isClientPortal) {\n await props?.callUnresolvedTaskApi();\n }\n await props?.callOrderAlertsApi();\n await props?.callOrderStatusApi();\n await props?.callOrdersApi();\n }\n if (response?.code !== 200) {\n notification.error({\n message: 'Error',\n description: `${response.error}`,\n });\n setCurrentAction(undefined);\n }\n }\n };\n\n useEffect(() => {\n //@ts-ignore\n if (error !== null && error?.code !== 200) {\n console.log('entered');\n notification.error({\n //@ts-ignore\n message: `${error?.error}`,\n description: (\n //@ts-ignore\n <span dangerouslySetInnerHTML={{ __html: error?.message }} />\n ),\n });\n setCurrentAction(undefined);\n }\n }, [error]);\n\n const showSubmitBtn = holdReason !== undefined;\n\n return (\n <OrderActionModal\n minWidth=\"24vw\"\n headerTitle=\"Hold order\"\n onCloseHeader={onClose}\n onSubmit={onSubmitHold}\n showAdditionalInfo\n infoText={infoText}\n submitBtnTitle=\"Save Details\"\n isSubmitDisabled={!showSubmitBtn}\n >\n <HoldContentContainer>\n <SplitText>\n <HoldRow>\n <Label label=\"Hold Until (leave blank for indefinite)\" />\n <HoldDatePickerWrap>\n <DatePicker\n needConfirm\n format={'MMMM D, YYYY'}\n onChange={handleDateChange}\n value={\n selectedDate === null ? selectedDate : dayjs(selectedDate)\n }\n disabledDate={current => {\n return current && current < dayjs().startOf('day');\n }}\n />\n </HoldDatePickerWrap>\n </HoldRow>\n\n <HoldRow>\n <Label label=\"Hold Reason\" required />\n <AntSelect\n options={onHoldReasonOptions || []}\n placeholder=\"Select Hold Reason\"\n onChange={onChangeHold}\n disabled={false}\n style={{ width: '346px', height: 40 }}\n showSearch={true}\n popupClassName={'dropDownStyle'}\n selectWrapperClass={'rounded'}\n defaultValue={holdReason}\n />\n </HoldRow>\n </SplitText>\n </HoldContentContainer>\n </OrderActionModal>\n );\n}\n\nexport default HoldOrderModal;\n"],"names":["HoldOrderModal","props","orderId","useOrderId","setCurrentAction","useCurrentAction","orderStaticData","useOrderStaticData","selectedDate","setDate","useState","holdReason","setHoldReason","customerInfo","useCustomerInfo","isClientPortal","useClientPortal","infoText","onHoldReasonOptions","item","toReverseDeliveryLabel","dynamicUrl","callOnHoldApi","error","useAxios","onClose","onChangeHold","value","handleDateChange","date","_dateString","newDate","onSubmitHold","response","notification","useEffect","jsx","OrderActionModal","HoldContentContainer","jsxs","SplitText","HoldRow","Label","HoldDatePickerWrap","DatePicker","dayjs","current","AntSelect"],"mappings":";;;;;;;;;AAgCA,SAASA,EAAeC,GAAe;AACrC,QAAM,CAACC,CAAO,IAAIC,EAAA,GACZ,CAAA,EAAGC,CAAgB,IAAIC,EAAA,GACvB,CAACC,CAAe,IAAIC,EAAA,GACpB,CAACC,GAAcC,CAAO,IAAIC,EAA+B,IAAI,GAC7D,CAACC,GAAYC,CAAa,IAAIF,EAA6B,MAAS,GACpE,CAACG,CAAY,IAAIC,EAAA,GACjB,CAACC,CAAc,IAAIC,EAAA,GACnBC,IAAW,GAAGJ,GAAc,cAAc,KAAKA,GAAc,QAAQ,IAErEK,IAAsBZ,GAAiB,gBAAgB;AAAA,IAC3D,CAACa,OACQ;AAAA,MACL,OAAOJ,IACHI,GAAM,SACNC,EAAuBD,GAAM,MAAM;AAAA,MACvC,OAAOA,GAAM;AAAA,IAAA;AAAA,EAEjB,GAGIE,IAAab,IACf,UAAUN,CAAO,sBAAsBS,CAAU,eAAeH,CAAY,KAC5E,UAAUN,CAAO,sBAAsBS,CA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AA,MACZ,eAAeZ;AAAA,MACf,UAAUO;AAAA,MACV,oBAAkB;AAAA,MAClB,UAAAf;AAAA,MACA,gBAAe;AAAA,MACf,kBAAkB,EAXAN,MAAe;AAAA,MAajC,UAAA,gBAAAyB,EAACE,GAAA,EACC,UAAA,gBAAAC,EAACC,GAAA,EACC,UAAA;AAAA,QAAA,gBAAAD,EAACE,GAAA,EACC,UAAA;AAAA,UAAA,gBAAAL,EAACM,GAAA,EAAM,OAAM,0CAAA,CAA0C;AAAA,4BACtDC,GAAA,EACC,UAAA,gBAAAP;AAAA,YAACQ;AAAA,YAAA;AAAA,cACC,aAAW;AAAA,cACX,QAAQ;AAAA,cACR,UAAUhB;AAAA,cACV,OACEpB,MAAiB,OAAOA,IAAeqC,EAAMrC,CAAY;AAAA,cAE3D,cAAc,CAAAsC,MACLA,KAAWA,IAAUD,EAAA,EAAQ,QAAQ,KAAK;AAAA,YACnD;AAAA,UAAA,EACF,CACF;AAAA,QAAA,GACF;AAAA,0BAECJ,GAAA,EACC,UAAA;AAAA,UAAA,gBAAAL,EAACM,GAAA,EAAM,OAAM,eAAc,UAAQ,IAAC;AAAA,UACpC,gBAAAN;AAAA,YAACW;AAAA,YAAA;AAAA,cACC,SAAS7B,KAAuB,CAAA;AAAA,cAChC,aAAY;AAAA,cACZ,UAAUQ;AAAA,cACV,UAAU;AAAA,cACV,OAAO,EAAE,OAAO,SAAS,QAAQ,GAAA;AAAA,cACjC,YAAY;AAAA,cACZ,gBAAgB;AAAA,cAChB,oBAAoB;AAAA,cACpB,cAAcf;AAAA,YAAA;AAAA,UAAA;AAAA,QAChB,EAAA,CACF;AAAA,MAAA,EAAA,CACF,EAAA,CACF;AAAA,IAAA;AAAA,EAAA;AAGN;"}
@@ -1,104 +1,105 @@
1
- import { jsx as t, Fragment as x, jsxs as i } from "react/jsx-runtime";
2
- import L, { useState as u, useMemo as p, useEffect as _ } from "react";
3
- import { useReturnProductDetails as j } from "../../../store.js";
4
- import { Skeleton as z, Empty as B } from "antd";
5
- import { Checkbox as m } from "@bjsdistribution/dms-component-library";
6
- import { useLoading as F } from "../../../../order-daily-overview/store/store.js";
7
- import { useSelectedSplit as H, useSplitOrderPayload as M } from "../../store.js";
8
- import { StyledTableWrapper as O, StyledTable as U, EmptyDataContainer as q } from "../confirm-order/tables/ReminderStyles.js";
9
- import a from "styled-components";
10
- import W from "../../../../../assets/icons/ChevronDownIcon.js";
11
- import { groupProductsByPallet as J, hasAnyPallet as K, toggleGroupSelectionIds as Q } from "../../../return-client-products/product-table/palletGrouping.js";
1
+ import { jsx as t, Fragment as x, jsxs as n } from "react/jsx-runtime";
2
+ import L, { useState as u, useMemo as h, useEffect as j } from "react";
3
+ import { useReturnProductDetails as z } from "../../../store.js";
4
+ import { Skeleton as B, Empty as F } from "antd";
5
+ import { Checkbox as m, toReverseDeliveryLabel as H } from "@bjsdistribution/dms-component-library";
6
+ import { useLoading as M } from "../../../../order-daily-overview/store/store.js";
7
+ import { useSelectedSplit as O, useSplitOrderPayload as U } from "../../store.js";
8
+ import { StyledTableWrapper as q, StyledTable as W, EmptyDataContainer as J } from "../confirm-order/tables/ReminderStyles.js";
9
+ import { useClientPortal as K } from "../../../../store.js";
10
+ import d from "styled-components";
11
+ import Q from "../../../../../assets/icons/ChevronDownIcon.js";
12
+ import { groupProductsByPallet as V, hasAnyPallet as X, toggleGroupSelectionIds as Y } from "../../../return-client-products/product-table/palletGrouping.js";
12
13
  const y = 7;
13
- function pe() {
14
- const [n] = j(), [S] = F(), [r, c] = H(), [P, h] = u(!1), [k, f] = M(), g = p(
15
- () => (r ?? []).map((e) => e?.id),
16
- [r]
17
- ), N = p(
18
- () => J(n),
19
- [n]
20
- ), v = p(() => K(n), [
21
- n
22
- ]), [w, C] = u({}), D = (e) => e.isNoPallet || !!w[e.key], I = (e) => C((l) => ({ ...l, [e]: !l[e] })), G = (e) => {
23
- c(e.map((l) => ({ id: l }))), h(e.length === n?.length);
24
- }, T = (e) => {
14
+ function be() {
15
+ const [i] = z(), [P] = M(), [s, c] = O(), [S, p] = u(!1), [v, f] = U(), [k] = K(), g = h(
16
+ () => (s ?? []).map((e) => e?.id),
17
+ [s]
18
+ ), N = h(
19
+ () => V(i),
20
+ [i]
21
+ ), w = h(() => X(i), [
22
+ i
23
+ ]), [C, D] = u({}), I = (e) => e.isNoPallet || !!C[e.key], G = (e) => D((l) => ({ ...l, [e]: !l[e] })), T = (e) => {
24
+ c(e.map((l) => ({ id: l }))), p(e.length === i?.length);
25
+ }, E = (e) => {
25
26
  const l = e.target.checked;
26
- h(l), c(
27
- l ? n?.map((o) => ({ id: o.id })) : []
27
+ p(l), c(
28
+ l ? i?.map((o) => ({ id: o.id })) : []
28
29
  );
29
- }, E = (e) => {
30
+ }, R = (e) => {
30
31
  c((l) => {
31
- const s = l?.some(
32
- (d) => d.id === e
33
- ) ? l?.filter((d) => d.id !== e) : [...l, { id: e }];
34
- return h(s?.length === n?.length), s;
32
+ const r = l?.some(
33
+ (a) => a.id === e
34
+ ) ? l?.filter((a) => a.id !== e) : [...l, { id: e }];
35
+ return p(r?.length === i?.length), r;
35
36
  });
36
- }, R = (e, l) => {
37
- const o = e.items.map((s) => s?.id);
38
- G(Q(g, o, l));
37
+ }, _ = (e, l) => {
38
+ const o = e.items.map((r) => r?.id);
39
+ T(Y(g, o, l));
39
40
  };
40
- _(() => {
41
+ j(() => {
41
42
  f({
42
- ...k,
43
+ ...v,
43
44
  return_order: 1,
44
45
  // FOR SPLIT ORDER WE ARE ASKED TO SET THIS AS 1
45
- products: r?.map((e) => e.id),
46
+ products: s?.map((e) => e.id),
46
47
  force: !0
47
48
  });
48
- }, [r, f]);
49
- const b = (e) => /* @__PURE__ */ i("tr", { children: [
49
+ }, [s, f]);
50
+ const b = (e) => /* @__PURE__ */ n("tr", { children: [
50
51
  /* @__PURE__ */ t("td", { style: { position: "relative" }, children: /* @__PURE__ */ t(
51
52
  m,
52
53
  {
53
- checked: r?.some(
54
+ checked: s?.some(
54
55
  (l) => l.id === e.id
55
56
  ),
56
- onChange: () => E(e.id)
57
+ onChange: () => R(e.id)
57
58
  }
58
59
  ) }),
59
- /* @__PURE__ */ t("td", { children: e?.order_product_type?.type }),
60
+ /* @__PURE__ */ t("td", { children: k ? e?.order_product_type?.type : H(e?.order_product_type?.type) }),
60
61
  /* @__PURE__ */ t("td", { children: e?.code }),
61
62
  /* @__PURE__ */ t("td", { children: e?.description }),
62
63
  /* @__PURE__ */ t("td", { children: e?.description }),
63
64
  /* @__PURE__ */ t("td", { children: e?.description }),
64
65
  /* @__PURE__ */ t("td", { children: e?.sku })
65
66
  ] }, e.id), $ = (e) => {
66
- const l = D(e), o = e.items.filter(
67
+ const l = I(e), o = e.items.filter(
67
68
  (A) => g.includes(A?.id)
68
- ).length, s = e.items.length > 0 && o === e.items.length, d = `${e.items.length} ${e.items.length === 1 ? "item" : "items"}`;
69
- return /* @__PURE__ */ i(L.Fragment, { children: [
70
- /* @__PURE__ */ t(V, { children: /* @__PURE__ */ t("td", { colSpan: y, children: /* @__PURE__ */ t("div", { className: e.isNoPallet ? "no-pallet-divider" : void 0, children: /* @__PURE__ */ i(X, { children: [
69
+ ).length, r = e.items.length > 0 && o === e.items.length, a = `${e.items.length} ${e.items.length === 1 ? "item" : "items"}`;
70
+ return /* @__PURE__ */ n(L.Fragment, { children: [
71
+ /* @__PURE__ */ t(Z, { children: /* @__PURE__ */ t("td", { colSpan: y, children: /* @__PURE__ */ t("div", { className: e.isNoPallet ? "no-pallet-divider" : void 0, children: /* @__PURE__ */ n(ee, { children: [
71
72
  /* @__PURE__ */ t(
72
73
  m,
73
74
  {
74
- checked: s,
75
- onChange: () => R(e, s),
75
+ checked: r,
76
+ onChange: () => _(e, r),
76
77
  "aria-label": e.isNoPallet ? "Select all items with no pallet ID" : `Select whole pallet ${e.label}`
77
78
  }
78
79
  ),
79
- /* @__PURE__ */ i(
80
- Y,
80
+ /* @__PURE__ */ n(
81
+ te,
81
82
  {
82
83
  type: "button",
83
84
  disabled: e.isNoPallet,
84
- onClick: e.isNoPallet ? void 0 : () => I(e.key),
85
+ onClick: e.isNoPallet ? void 0 : () => G(e.key),
85
86
  "aria-expanded": e.isNoPallet ? void 0 : l,
86
87
  children: [
87
- !e.isNoPallet && /* @__PURE__ */ t(Z, { $isExpanded: l, children: /* @__PURE__ */ t(W, {}) }),
88
- /* @__PURE__ */ t("span", { className: "title", children: e.isNoPallet ? /* @__PURE__ */ t("span", { children: "No Pallet ID" }) : /* @__PURE__ */ i(x, { children: [
88
+ !e.isNoPallet && /* @__PURE__ */ t(le, { $isExpanded: l, children: /* @__PURE__ */ t(Q, {}) }),
89
+ /* @__PURE__ */ t("span", { className: "title", children: e.isNoPallet ? /* @__PURE__ */ t("span", { children: "No Pallet ID" }) : /* @__PURE__ */ n(x, { children: [
89
90
  /* @__PURE__ */ t("span", { children: "Pallet ID:" }),
90
91
  /* @__PURE__ */ t("strong", { children: e.label })
91
92
  ] }) }),
92
- /* @__PURE__ */ i("span", { className: "count", children: [
93
+ /* @__PURE__ */ n("span", { className: "count", children: [
93
94
  "(",
94
- d,
95
+ a,
95
96
  ")"
96
97
  ] }),
97
- o > 0 && /* @__PURE__ */ i("span", { className: "selected", children: [
98
+ o > 0 && /* @__PURE__ */ n("span", { className: "selected", children: [
98
99
  o,
99
100
  " selected"
100
101
  ] }),
101
- !e.isNoPallet && /* @__PURE__ */ t(ee, { "aria-hidden": "true", children: l ? "−" : "+" })
102
+ !e.isNoPallet && /* @__PURE__ */ t(ie, { "aria-hidden": "true", children: l ? "−" : "+" })
102
103
  ]
103
104
  }
104
105
  )
@@ -106,14 +107,14 @@ function pe() {
106
107
  l && e.items.map(b)
107
108
  ] }, e.key);
108
109
  };
109
- return /* @__PURE__ */ t(x, { children: /* @__PURE__ */ t(O, { id: "tableScrolling", children: /* @__PURE__ */ i(U, { children: [
110
- /* @__PURE__ */ t("thead", { children: /* @__PURE__ */ i("tr", { children: [
110
+ return /* @__PURE__ */ t(x, { children: /* @__PURE__ */ t(q, { id: "tableScrolling", children: /* @__PURE__ */ n(W, { children: [
111
+ /* @__PURE__ */ t("thead", { children: /* @__PURE__ */ n("tr", { children: [
111
112
  /* @__PURE__ */ t("th", { style: { position: "relative" }, children: /* @__PURE__ */ t(
112
113
  m,
113
114
  {
114
- checked: P,
115
- onChange: T,
116
- disabled: n?.length === 0 || n?.length === null
115
+ checked: S,
116
+ onChange: E,
117
+ disabled: i?.length === 0 || i?.length === null
117
118
  }
118
119
  ) }),
119
120
  /* @__PURE__ */ t("th", { children: "Type" }),
@@ -123,15 +124,15 @@ function pe() {
123
124
  /* @__PURE__ */ t("th", { children: "Delivery Instructions" }),
124
125
  /* @__PURE__ */ t("th", { children: "Barcode" })
125
126
  ] }) }),
126
- /* @__PURE__ */ t("tbody", { children: S ? /* @__PURE__ */ i("tr", { children: [
127
- /* @__PURE__ */ t("td", { colSpan: 6, children: /* @__PURE__ */ t(z, { active: !0 }) }),
127
+ /* @__PURE__ */ t("tbody", { children: P ? /* @__PURE__ */ n("tr", { children: [
128
+ /* @__PURE__ */ t("td", { colSpan: 6, children: /* @__PURE__ */ t(B, { active: !0 }) }),
128
129
  /* @__PURE__ */ t("td", { colSpan: 6 })
129
- ] }) : n?.length === 0 ? /* @__PURE__ */ t("tr", { children: /* @__PURE__ */ t("td", { className: "emptyTd", colSpan: y, children: /* @__PURE__ */ t(q, { children: /* @__PURE__ */ t(B, { description: "No Data Found" }) }) }) }) : v ? N.map($) : n?.length > 0 && n?.map(
130
+ ] }) : i?.length === 0 ? /* @__PURE__ */ t("tr", { children: /* @__PURE__ */ t("td", { className: "emptyTd", colSpan: y, children: /* @__PURE__ */ t(J, { children: /* @__PURE__ */ t(F, { description: "No Data Found" }) }) }) }) : w ? N.map($) : i?.length > 0 && i?.map(
130
131
  (e) => b(e)
131
132
  ) })
132
133
  ] }) }) });
133
134
  }
134
- const V = a.tr`
135
+ const Z = d.tr`
135
136
  && > td {
136
137
  padding: 4px 0;
137
138
  background: transparent;
@@ -149,7 +150,7 @@ const V = a.tr`
149
150
  padding-top: 10px;
150
151
  margin-top: 4px;
151
152
  }
152
- `, X = a.div`
153
+ `, ee = d.div`
153
154
  /*
154
155
  Required. The library Checkbox renders its real <input> as position:absolute
155
156
  with no offsets, so it needs a positioned ancestor here — otherwise its
@@ -171,7 +172,7 @@ const V = a.tr`
171
172
  font-weight: 500;
172
173
  color: #3a3630;
173
174
 
174
- `, Y = a.button`
175
+ `, te = d.button`
175
176
  display: flex;
176
177
  align-items: center;
177
178
  gap: 8px;
@@ -213,12 +214,12 @@ const V = a.tr`
213
214
  font-weight: 600;
214
215
  font-size: 12px;
215
216
  }
216
- `, Z = a.span`
217
+ `, le = d.span`
217
218
  display: inline-flex;
218
219
  align-items: center;
219
220
  transition: transform 0.15s ease-in-out;
220
- transform: rotate(${(n) => n.$isExpanded ? "0deg" : "-90deg"});
221
- `, ee = a.span`
221
+ transform: rotate(${(i) => i.$isExpanded ? "0deg" : "-90deg"});
222
+ `, ie = d.span`
222
223
  margin-left: auto;
223
224
  display: inline-flex;
224
225
  align-items: center;
@@ -233,6 +234,6 @@ const V = a.tr`
233
234
  color: #475569;
234
235
  `;
235
236
  export {
236
- pe as default
237
+ be as default
237
238
  };
238
239
  //# sourceMappingURL=SplitOrderTable.js.map