@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.
- package/dist/components/client-portal/OutstandingTable.js +118 -112
- package/dist/components/client-portal/OutstandingTable.js.map +1 -1
- package/dist/components/fakeData.js.map +1 -1
- package/dist/components/order-daily-overview/common/fakedata.js.map +1 -1
- package/dist/components/order-daily-overview/return-after-table/table/OrderTable.js +33 -31
- package/dist/components/order-daily-overview/return-after-table/table/OrderTable.js.map +1 -1
- package/dist/components/order-daily-overview/return-after-table/table-filters/ReturnOrderFilter.js +82 -79
- package/dist/components/order-daily-overview/return-after-table/table-filters/ReturnOrderFilter.js.map +1 -1
- package/dist/components/order-daily-overview/return-order-table/return-orders-filters/ReturnOrderTable.js +157 -151
- package/dist/components/order-daily-overview/return-order-table/return-orders-filters/ReturnOrderTable.js.map +1 -1
- package/dist/components/order-view/order-actions/Dropdown.js +3 -3
- package/dist/components/order-view/order-actions/Dropdown.js.map +1 -1
- package/dist/components/order-view/order-actions/actions/cancel-order/CancelOrderTable.js +47 -45
- package/dist/components/order-view/order-actions/actions/cancel-order/CancelOrderTable.js.map +1 -1
- package/dist/components/order-view/order-actions/actions/cancel-order/ReturnReason.js +36 -23
- package/dist/components/order-view/order-actions/actions/cancel-order/ReturnReason.js.map +1 -1
- package/dist/components/order-view/order-actions/actions/confirm-order/tables/ProductTable.js +25 -23
- package/dist/components/order-view/order-actions/actions/confirm-order/tables/ProductTable.js.map +1 -1
- package/dist/components/order-view/order-actions/actions/force-debrief/ForceDebriefModal.js +89 -88
- package/dist/components/order-view/order-actions/actions/force-debrief/ForceDebriefModal.js.map +1 -1
- package/dist/components/order-view/order-actions/actions/force-debrief/charges/collection-add-ons/index.js +16 -16
- package/dist/components/order-view/order-actions/actions/force-debrief/charges/collection-add-ons/index.js.map +1 -1
- package/dist/components/order-view/order-actions/actions/force-debrief/escalation/EscalationReason.js +23 -22
- package/dist/components/order-view/order-actions/actions/force-debrief/escalation/EscalationReason.js.map +1 -1
- package/dist/components/order-view/order-actions/actions/force-debrief/order-info/RadioButtons.js +56 -52
- package/dist/components/order-view/order-actions/actions/force-debrief/order-info/RadioButtons.js.map +1 -1
- package/dist/components/order-view/order-actions/actions/force-debrief/order-info/dropdowns/FailureReasonDropdown.js +27 -26
- package/dist/components/order-view/order-actions/actions/force-debrief/order-info/dropdowns/FailureReasonDropdown.js.map +1 -1
- package/dist/components/order-view/order-actions/actions/hold-order/HoldOrderModal.js +29 -29
- package/dist/components/order-view/order-actions/actions/hold-order/HoldOrderModal.js.map +1 -1
- package/dist/components/order-view/order-actions/actions/split-order/SplitOrderTable.js +72 -71
- package/dist/components/order-view/order-actions/actions/split-order/SplitOrderTable.js.map +1 -1
- package/dist/components/order-view/order-actions/actions/uncancel-order/UncancelOrderTable.js +37 -35
- package/dist/components/order-view/order-actions/actions/uncancel-order/UncancelOrderTable.js.map +1 -1
- package/dist/components/order-view/order-details/expanded-content/services-section/OrderServices.js +20 -18
- package/dist/components/order-view/order-details/expanded-content/services-section/OrderServices.js.map +1 -1
- package/dist/components/order-view/order-details/expanded-content/services-section/ServiceType.js +26 -22
- package/dist/components/order-view/order-details/expanded-content/services-section/ServiceType.js.map +1 -1
- package/dist/components/order-view/order-details/helper.js.map +1 -1
- package/dist/components/order-view/return-client-products/product-table/ReturnProductTable.js +53 -53
- package/dist/components/order-view/return-client-products/product-table/ReturnProductTable.js.map +1 -1
- package/dist/components/order-view/toolbox-resources/expanded-content/index.js +6 -7
- package/dist/components/order-view/toolbox-resources/expanded-content/index.js.map +1 -1
- package/dist/components/utils.js +4 -5
- package/dist/components/utils.js.map +1 -1
- package/dist/types/components/order-view/order-actions/Dropdown.d.ts +1 -0
- package/dist/types/components/utils.d.ts +0 -1
- package/package.json +2 -2
|
@@ -1,65 +1,66 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { Label as I, SelectDropdown as O } from "@bjsdistribution/dms-component-library";
|
|
3
|
-
import
|
|
4
|
-
import { useOrderStaticData as
|
|
5
|
-
|
|
6
|
-
|
|
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,
|
|
9
|
+
)?.id, F = n?.find(
|
|
9
10
|
(e) => e?.type === "Failure - Fault"
|
|
10
|
-
)?.id,
|
|
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,
|
|
15
|
-
(e) => e?.
|
|
16
|
-
),
|
|
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
|
|
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
|
-
},
|
|
28
|
-
return /* @__PURE__ */
|
|
29
|
-
/* @__PURE__ */
|
|
30
|
-
/* @__PURE__ */
|
|
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:
|
|
38
|
+
options: g
|
|
38
39
|
},
|
|
39
40
|
{
|
|
40
41
|
label: "Non-Fault Reasons",
|
|
41
|
-
options:
|
|
42
|
+
options: b
|
|
42
43
|
}
|
|
43
44
|
] || [],
|
|
44
45
|
inputId: "failurereasondropdown",
|
|
45
46
|
openMenuOnFocus: !0,
|
|
46
|
-
value:
|
|
47
|
+
value: u,
|
|
47
48
|
onChange: (e) => {
|
|
48
|
-
|
|
49
|
+
c(e), d(!0);
|
|
49
50
|
},
|
|
50
|
-
formatGroupLabel: (e) => /* @__PURE__ */
|
|
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
|
|
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
|
-
|
|
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":"
|
|
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,I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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
|
|
3
|
-
import { useAxios as Y, Label as
|
|
4
|
-
import { useOrderId as x, useCurrentAction as
|
|
5
|
-
import
|
|
6
|
-
import { HoldContentContainer as
|
|
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
|
|
8
|
+
import D from "dayjs";
|
|
9
9
|
import { useClientPortal as W } from "../../../../store.js";
|
|
10
|
-
function
|
|
11
|
-
const [a] = x(), [, l] =
|
|
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
|
-
),
|
|
17
|
-
`, { fetchData:
|
|
18
|
-
endpoint:
|
|
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,
|
|
25
|
-
const
|
|
26
|
-
c(
|
|
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
|
|
29
|
+
const e = await g();
|
|
30
30
|
e?.code === 200 && (d.success({
|
|
31
31
|
message: "Success",
|
|
32
32
|
description: `${e.message}`
|
|
33
|
-
}),
|
|
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
|
|
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
|
-
|
|
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(
|
|
60
|
-
/* @__PURE__ */ i(
|
|
61
|
-
/* @__PURE__ */ o(
|
|
62
|
-
/* @__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 :
|
|
69
|
-
disabledDate: (e) => e && e <
|
|
68
|
+
value: t === null ? t : D(t),
|
|
69
|
+
disabledDate: (e) => e && e < D().startOf("day")
|
|
70
70
|
}
|
|
71
71
|
) })
|
|
72
72
|
] }),
|
|
73
|
-
/* @__PURE__ */ i(
|
|
74
|
-
/* @__PURE__ */ o(
|
|
73
|
+
/* @__PURE__ */ i(S, { children: [
|
|
74
|
+
/* @__PURE__ */ o(p, { label: "Hold Reason", required: !0 }),
|
|
75
75
|
/* @__PURE__ */ o(
|
|
76
76
|
_,
|
|
77
77
|
{
|
|
78
|
-
options:
|
|
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
|
-
|
|
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":";;;;;;;;;
|
|
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,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ACV,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
|
|
2
|
-
import L, { useState as u, useMemo as
|
|
3
|
-
import { useReturnProductDetails as
|
|
4
|
-
import { Skeleton as
|
|
5
|
-
import { Checkbox as m } from "@bjsdistribution/dms-component-library";
|
|
6
|
-
import { useLoading as
|
|
7
|
-
import { useSelectedSplit as
|
|
8
|
-
import { StyledTableWrapper as
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
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
|
|
14
|
-
const [
|
|
15
|
-
() => (
|
|
16
|
-
[
|
|
17
|
-
), N =
|
|
18
|
-
() =>
|
|
19
|
-
[
|
|
20
|
-
),
|
|
21
|
-
|
|
22
|
-
]), [
|
|
23
|
-
c(e.map((l) => ({ id: l }))),
|
|
24
|
-
},
|
|
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
|
-
|
|
27
|
-
l ?
|
|
27
|
+
p(l), c(
|
|
28
|
+
l ? i?.map((o) => ({ id: o.id })) : []
|
|
28
29
|
);
|
|
29
|
-
},
|
|
30
|
+
}, R = (e) => {
|
|
30
31
|
c((l) => {
|
|
31
|
-
const
|
|
32
|
-
(
|
|
33
|
-
) ? l?.filter((
|
|
34
|
-
return
|
|
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
|
-
},
|
|
37
|
-
const o = e.items.map((
|
|
38
|
-
|
|
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
|
-
...
|
|
43
|
+
...v,
|
|
43
44
|
return_order: 1,
|
|
44
45
|
// FOR SPLIT ORDER WE ARE ASKED TO SET THIS AS 1
|
|
45
|
-
products:
|
|
46
|
+
products: s?.map((e) => e.id),
|
|
46
47
|
force: !0
|
|
47
48
|
});
|
|
48
|
-
}, [
|
|
49
|
-
const b = (e) => /* @__PURE__ */
|
|
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:
|
|
54
|
+
checked: s?.some(
|
|
54
55
|
(l) => l.id === e.id
|
|
55
56
|
),
|
|
56
|
-
onChange: () =>
|
|
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 =
|
|
67
|
+
const l = I(e), o = e.items.filter(
|
|
67
68
|
(A) => g.includes(A?.id)
|
|
68
|
-
).length,
|
|
69
|
-
return /* @__PURE__ */
|
|
70
|
-
/* @__PURE__ */ t(
|
|
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:
|
|
75
|
-
onChange: () =>
|
|
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__ */
|
|
80
|
-
|
|
80
|
+
/* @__PURE__ */ n(
|
|
81
|
+
te,
|
|
81
82
|
{
|
|
82
83
|
type: "button",
|
|
83
84
|
disabled: e.isNoPallet,
|
|
84
|
-
onClick: e.isNoPallet ? void 0 : () =>
|
|
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(
|
|
88
|
-
/* @__PURE__ */ t("span", { className: "title", children: e.isNoPallet ? /* @__PURE__ */ t("span", { children: "No Pallet ID" }) : /* @__PURE__ */
|
|
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__ */
|
|
93
|
+
/* @__PURE__ */ n("span", { className: "count", children: [
|
|
93
94
|
"(",
|
|
94
|
-
|
|
95
|
+
a,
|
|
95
96
|
")"
|
|
96
97
|
] }),
|
|
97
|
-
o > 0 && /* @__PURE__ */
|
|
98
|
+
o > 0 && /* @__PURE__ */ n("span", { className: "selected", children: [
|
|
98
99
|
o,
|
|
99
100
|
" selected"
|
|
100
101
|
] }),
|
|
101
|
-
!e.isNoPallet && /* @__PURE__ */ t(
|
|
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(
|
|
110
|
-
/* @__PURE__ */ t("thead", { children: /* @__PURE__ */
|
|
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:
|
|
115
|
-
onChange:
|
|
116
|
-
disabled:
|
|
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:
|
|
127
|
-
/* @__PURE__ */ t("td", { colSpan: 6, children: /* @__PURE__ */ t(
|
|
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
|
-
] }) :
|
|
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
|
|
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
|
-
`,
|
|
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
|
-
`,
|
|
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
|
-
`,
|
|
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(${(
|
|
221
|
-
`,
|
|
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
|
-
|
|
237
|
+
be as default
|
|
237
238
|
};
|
|
238
239
|
//# sourceMappingURL=SplitOrderTable.js.map
|