@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.
- package/dist/common/expand-collapse/index.js +44 -26
- package/dist/common/expand-collapse/index.js.map +1 -1
- package/dist/common/modals/order-action-modal/OrderActionModal.js.map +1 -1
- package/dist/common/modals/order-action-modal/footer/OrderActionFooter.js.map +1 -1
- package/dist/components/client-portal/ClientPortalResponsive.js +148 -0
- package/dist/components/client-portal/ClientPortalResponsive.js.map +1 -0
- package/dist/components/client-portal/OutstandingTable.js +112 -118
- package/dist/components/client-portal/OutstandingTable.js.map +1 -1
- package/dist/components/client-portal/ReturnOverview.js +38 -37
- package/dist/components/client-portal/ReturnOverview.js.map +1 -1
- package/dist/components/client-portal/return-confirm/ConfirmedMain.js +4 -4
- package/dist/components/client-portal/return-confirm/ConfirmedMain.js.map +1 -1
- package/dist/components/client-portal/return-confirm/ReturnConfirmedTable.js +445 -185
- package/dist/components/client-portal/return-confirm/ReturnConfirmedTable.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/common/mediaQuery.js +17 -0
- package/dist/components/order-daily-overview/common/mediaQuery.js.map +1 -0
- package/dist/components/order-daily-overview/filters/FilterStyle.js +174 -11
- package/dist/components/order-daily-overview/filters/FilterStyle.js.map +1 -1
- package/dist/components/order-daily-overview/header/route-header/RouterHeaderStyle.js +9 -4
- package/dist/components/order-daily-overview/header/route-header/RouterHeaderStyle.js.map +1 -1
- package/dist/components/order-daily-overview/header/route-header/title/HeaderTitle.js +11 -1
- package/dist/components/order-daily-overview/header/route-header/title/HeaderTitle.js.map +1 -1
- package/dist/components/order-daily-overview/header-filters/Styledfilters.js +46 -17
- package/dist/components/order-daily-overview/header-filters/Styledfilters.js.map +1 -1
- package/dist/components/order-daily-overview/index.js +76 -53
- package/dist/components/order-daily-overview/index.js.map +1 -1
- package/dist/components/order-daily-overview/return-after-table/table/OrderTable.js +101 -103
- 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 +135 -134
- package/dist/components/order-daily-overview/return-after-table/table-filters/ReturnOrderFilter.js.map +1 -1
- package/dist/components/order-daily-overview/return-after-table/table-filters/TableFilters.js +17 -11
- package/dist/components/order-daily-overview/return-after-table/table-filters/TableFilters.js.map +1 -1
- package/dist/components/order-daily-overview/return-order-table/return-orders-filters/ReturnFilter.js +5 -5
- package/dist/components/order-daily-overview/return-order-table/return-orders-filters/ReturnFilter.js.map +1 -1
- package/dist/components/order-daily-overview/return-order-table/return-orders-filters/ReturnOrderTable.js +129 -135
- package/dist/components/order-daily-overview/return-order-table/return-orders-filters/ReturnOrderTable.js.map +1 -1
- package/dist/components/order-daily-overview/return-order-table/return-orders-filters/returnstyles.js +346 -27
- package/dist/components/order-daily-overview/return-order-table/return-orders-filters/returnstyles.js.map +1 -1
- package/dist/components/order-daily-overview/table/ReturnTable.js +199 -183
- package/dist/components/order-daily-overview/table/ReturnTable.js.map +1 -1
- package/dist/components/order-daily-overview/table/table-data/styles.js +159 -38
- package/dist/components/order-daily-overview/table/table-data/styles.js.map +1 -1
- package/dist/components/order-daily-overview/table-view/PaginationStyle.js +21 -6
- package/dist/components/order-daily-overview/table-view/PaginationStyle.js.map +1 -1
- package/dist/components/order-view/DynamicTable.js +136 -35
- package/dist/components/order-view/DynamicTable.js.map +1 -1
- package/dist/components/order-view/details-filters/DetailsFilters.js +33 -8
- package/dist/components/order-view/details-filters/DetailsFilters.js.map +1 -1
- package/dist/components/order-view/details-filters/left-side-filters/ActionsMenu.js +23 -5
- package/dist/components/order-view/details-filters/left-side-filters/ActionsMenu.js.map +1 -1
- package/dist/components/order-view/details-filters/left-side-filters/dropdowns/DropDowns.js +39 -22
- package/dist/components/order-view/details-filters/left-side-filters/dropdowns/DropDowns.js.map +1 -1
- package/dist/components/order-view/details-filters/right-side-filters/Details.js +25 -12
- package/dist/components/order-view/details-filters/right-side-filters/Details.js.map +1 -1
- package/dist/components/order-view/general-information/Status.js +58 -28
- package/dist/components/order-view/general-information/Status.js.map +1 -1
- package/dist/components/order-view/generic-table/AuditLogs.js +129 -24
- package/dist/components/order-view/generic-table/AuditLogs.js.map +1 -1
- package/dist/components/order-view/notes/logs/index.js +15 -7
- package/dist/components/order-view/notes/logs/index.js.map +1 -1
- package/dist/components/order-view/notes/order-dropdown/NewReturnDropdown.js +7 -7
- package/dist/components/order-view/notes/order-dropdown/NewReturnDropdown.js.map +1 -1
- package/dist/components/order-view/notification/index.js +68 -55
- package/dist/components/order-view/notification/index.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 +45 -47
- 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 +23 -36
- 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 +23 -25
- 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 +88 -89
- 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 +22 -23
- 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 +52 -56
- 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 +26 -27
- 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 +54 -222
- package/dist/components/order-view/order-actions/actions/split-order/SplitOrderTable.js.map +1 -1
- package/dist/components/order-view/order-actions/actions/split-order/index.js +37 -50
- package/dist/components/order-view/order-actions/actions/split-order/index.js.map +1 -1
- package/dist/components/order-view/order-actions/actions/uncancel-order/UncancelOrderTable.js +35 -37
- package/dist/components/order-view/order-actions/actions/uncancel-order/UncancelOrderTable.js.map +1 -1
- package/dist/components/order-view/order-actions/actions/what3words/What3WordsModal.tsx.js +85 -85
- package/dist/components/order-view/order-actions/actions/what3words/What3WordsModal.tsx.js.map +1 -1
- package/dist/components/order-view/order-details/expanded-content/customer-section/contact-info/ContactHome.js +12 -8
- package/dist/components/order-view/order-details/expanded-content/customer-section/contact-info/ContactHome.js.map +1 -1
- package/dist/components/order-view/order-details/expanded-content/customer-section/contact-info/ContactMobile.js +22 -18
- package/dist/components/order-view/order-details/expanded-content/customer-section/contact-info/ContactMobile.js.map +1 -1
- package/dist/components/order-view/order-details/expanded-content/customer-section/contact-info/index.js +14 -8
- package/dist/components/order-view/order-details/expanded-content/customer-section/contact-info/index.js.map +1 -1
- package/dist/components/order-view/order-details/expanded-content/customer-section/index.js +19 -13
- package/dist/components/order-view/order-details/expanded-content/customer-section/index.js.map +1 -1
- package/dist/components/order-view/order-details/expanded-content/customer-section/location-info/Address.js +11 -6
- package/dist/components/order-view/order-details/expanded-content/customer-section/location-info/Address.js.map +1 -1
- package/dist/components/order-view/order-details/expanded-content/customer-section/location-info/Latitude.js +23 -21
- package/dist/components/order-view/order-details/expanded-content/customer-section/location-info/Latitude.js.map +1 -1
- package/dist/components/order-view/order-details/expanded-content/customer-section/location-info/Longitude.js +23 -21
- package/dist/components/order-view/order-details/expanded-content/customer-section/location-info/Longitude.js.map +1 -1
- package/dist/components/order-view/order-details/expanded-content/customer-section/location-info/index.js +39 -21
- package/dist/components/order-view/order-details/expanded-content/customer-section/location-info/index.js.map +1 -1
- package/dist/components/order-view/order-details/expanded-content/footer/index.js +28 -14
- package/dist/components/order-view/order-details/expanded-content/footer/index.js.map +1 -1
- package/dist/components/order-view/order-details/expanded-content/orders-section/index.js +44 -28
- package/dist/components/order-view/order-details/expanded-content/orders-section/index.js.map +1 -1
- package/dist/components/order-view/order-details/expanded-content/services-section/OrderServices.js +28 -20
- 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/ServiceLevel.js +17 -18
- package/dist/components/order-view/order-details/expanded-content/services-section/ServiceLevel.js.map +1 -1
- package/dist/components/order-view/order-details/expanded-content/services-section/ServiceType.js +22 -26
- package/dist/components/order-view/order-details/expanded-content/services-section/ServiceType.js.map +1 -1
- package/dist/components/order-view/order-details/expanded-content/services-section/index.js +79 -25
- package/dist/components/order-view/order-details/expanded-content/services-section/index.js.map +1 -1
- package/dist/components/order-view/order-details/helper.js.map +1 -1
- package/dist/components/order-view/products-info/collapsed-content/index.js +21 -15
- package/dist/components/order-view/products-info/collapsed-content/index.js.map +1 -1
- package/dist/components/order-view/products-info/index.js +36 -36
- package/dist/components/order-view/products-info/index.js.map +1 -1
- package/dist/components/order-view/return-client-products/product-table/ReturnProductTable.js +265 -334
- package/dist/components/order-view/return-client-products/product-table/ReturnProductTable.js.map +1 -1
- package/dist/components/order-view/store.js +155 -162
- package/dist/components/order-view/store.js.map +1 -1
- package/dist/components/order-view/toolbox-resources/expanded-content/index.js +281 -173
- package/dist/components/order-view/toolbox-resources/expanded-content/index.js.map +1 -1
- package/dist/components/utils.js +5 -4
- package/dist/components/utils.js.map +1 -1
- package/dist/types/common/modals/order-action-modal/OrderActionModal.d.ts +1 -2
- package/dist/types/common/modals/order-action-modal/footer/OrderActionFooter.d.ts +1 -1
- package/dist/types/components/client-portal/ClientPortalResponsive.d.ts +15 -0
- package/dist/types/components/order-daily-overview/common/mediaQuery.d.ts +4 -0
- package/dist/types/components/order-daily-overview/filters/FilterStyle.d.ts +1 -0
- package/dist/types/components/order-view/order-actions/Dropdown.d.ts +0 -1
- package/dist/types/components/order-view/return-client-products/product-table/ReturnProductTable.d.ts +1 -0
- package/dist/types/components/order-view/store.d.ts +0 -1
- package/dist/types/components/order-view/types.d.ts +1 -1
- package/dist/types/components/utils.d.ts +1 -0
- package/package.json +2 -2
- package/dist/assets/icons/ChevronDownIcon.js +0 -26
- package/dist/assets/icons/ChevronDownIcon.js.map +0 -1
- package/dist/components/order-view/return-client-products/product-table/palletGrouping.js +0 -47
- package/dist/components/order-view/return-client-products/product-table/palletGrouping.js.map +0 -1
- package/dist/types/components/order-view/return-client-products/product-table/palletGrouping.d.ts +0 -23
package/dist/components/order-view/order-details/expanded-content/services-section/ServiceType.js
CHANGED
|
@@ -1,30 +1,26 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { SelectDropdown as
|
|
3
|
-
import { useOrderStaticData as
|
|
4
|
-
import
|
|
5
|
-
import { capitalize as
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
label: p ? r : u(r),
|
|
13
|
-
value: e.id
|
|
14
|
-
};
|
|
15
|
-
}
|
|
1
|
+
import { jsxs as s, jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import { SelectDropdown as c, Label as m } from "@bjsdistribution/dms-component-library";
|
|
3
|
+
import { useOrderStaticData as u, useOrderDetails as y } from "../../../store.js";
|
|
4
|
+
import a from "styled-components";
|
|
5
|
+
import { capitalize as D } from "../../../utils.js";
|
|
6
|
+
function _() {
|
|
7
|
+
const [i] = u(), [r, l] = y(), p = r?.order_type_id, t = i?.order_type?.map(
|
|
8
|
+
(e) => ({
|
|
9
|
+
label: D(e.type.replaceAll("_", " ")),
|
|
10
|
+
value: e.id
|
|
11
|
+
})
|
|
16
12
|
), d = (e) => {
|
|
17
|
-
const
|
|
18
|
-
n
|
|
13
|
+
const n = { ...r, order_type_id: e.value };
|
|
14
|
+
l(n);
|
|
19
15
|
};
|
|
20
|
-
return /* @__PURE__ */
|
|
21
|
-
/* @__PURE__ */
|
|
22
|
-
/* @__PURE__ */
|
|
23
|
-
|
|
16
|
+
return /* @__PURE__ */ s(f, { children: [
|
|
17
|
+
/* @__PURE__ */ o(m, { label: "Service Type", htmlFor: "serviceTypeDropdown" }),
|
|
18
|
+
/* @__PURE__ */ o(
|
|
19
|
+
v,
|
|
24
20
|
{
|
|
25
21
|
placeholder: "Select Service Type",
|
|
26
|
-
options:
|
|
27
|
-
value:
|
|
22
|
+
options: t || [],
|
|
23
|
+
value: t?.filter((e) => e.value === p),
|
|
28
24
|
inputId: "serviceTypeDropdown",
|
|
29
25
|
openMenuOnFocus: !0,
|
|
30
26
|
onChange: d,
|
|
@@ -34,19 +30,19 @@ function L() {
|
|
|
34
30
|
)
|
|
35
31
|
] });
|
|
36
32
|
}
|
|
37
|
-
const
|
|
33
|
+
const f = a.div`
|
|
38
34
|
display: flex;
|
|
39
35
|
flex-direction: column;
|
|
40
36
|
gap: 6px;
|
|
41
37
|
// flex: 1;
|
|
42
38
|
min-width: 250px;
|
|
43
|
-
`,
|
|
39
|
+
`, v = a(c)`
|
|
44
40
|
&.disabled {
|
|
45
41
|
cursor: not-allowed !important;
|
|
46
42
|
opacity: 0.7;
|
|
47
43
|
}
|
|
48
44
|
`;
|
|
49
45
|
export {
|
|
50
|
-
|
|
46
|
+
_ as default
|
|
51
47
|
};
|
|
52
48
|
//# sourceMappingURL=ServiceType.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ServiceType.js","sources":["../../../../../../src/components/order-view/order-details/expanded-content/services-section/ServiceType.tsx"],"sourcesContent":["import React from 'react';\nimport { Label, SelectDropdown
|
|
1
|
+
{"version":3,"file":"ServiceType.js","sources":["../../../../../../src/components/order-view/order-details/expanded-content/services-section/ServiceType.tsx"],"sourcesContent":["import React from 'react';\nimport { Label, SelectDropdown } from '@bjsdistribution/dms-component-library';\nimport { useOrderDetails, useOrderStaticData } from '../../../store';\nimport styled from 'styled-components';\nimport { capitalize } from '../../../utils';\n\nfunction ServiceTypeDropdown() {\n const [orderStaticData] = useOrderStaticData();\n const [orderData, setOrderData] = useOrderDetails();\n\n const orderTypeId = orderData?.order_type_id;\n\n const serviceTypeOptions = orderStaticData?.order_type?.map(\n (option: any) => ({\n label: capitalize(option.type.replaceAll('_', ' ')),\n value: option.id,\n })\n );\n\n const onChange = (event: any) => {\n const newData = { ...orderData, order_type_id: event.value };\n setOrderData(newData);\n };\n const isDisabled = true;\n\n return (\n <Container>\n <Label label=\"Service Type\" htmlFor=\"serviceTypeDropdown\" />\n <StyledSelectDropdown\n placeholder=\"Select Service Type\"\n options={serviceTypeOptions || []}\n value={serviceTypeOptions?.filter((f: any) => f.value === orderTypeId)}\n inputId=\"serviceTypeDropdown\"\n openMenuOnFocus\n onChange={onChange}\n isDisabled={true}\n className={isDisabled ? 'disabled' : ''}\n />\n </Container>\n );\n}\n\nconst Container = styled.div`\n display: flex;\n flex-direction: column;\n gap: 6px;\n // flex: 1;\n min-width: 250px;\n`;\n\nconst StyledSelectDropdown = styled(SelectDropdown)`\n &.disabled {\n cursor: not-allowed !important;\n opacity: 0.7;\n }\n`;\n\nexport default ServiceTypeDropdown;\n"],"names":["ServiceTypeDropdown","orderStaticData","useOrderStaticData","orderData","setOrderData","useOrderDetails","orderTypeId","serviceTypeOptions","option","capitalize","onChange","event","newData","Container","jsx","Label","StyledSelectDropdown","f","styled","SelectDropdown"],"mappings":";;;;;AAMA,SAASA,IAAsB;AAC7B,QAAM,CAACC,CAAe,IAAIC,EAAA,GACpB,CAACC,GAAWC,CAAY,IAAIC,EAAA,GAE5BC,IAAcH,GAAW,eAEzBI,IAAqBN,GAAiB,YAAY;AAAA,IACtD,CAACO,OAAiB;AAAA,MAChB,OAAOC,EAAWD,EAAO,KAAK,WAAW,KAAK,GAAG,CAAC;AAAA,MAClD,OAAOA,EAAO;AAAA,IAAA;AAAA,EAChB,GAGIE,IAAW,CAACC,MAAe;AAC/B,UAAMC,IAAU,EAAE,GAAGT,GAAW,eAAeQ,EAAM,MAAA;AACrD,IAAAP,EAAaQ,CAAO;AAAA,EACtB;AAGA,2BACGC,GAAA,EACC,UAAA;AAAA,IAAA,gBAAAC,EAACC,GAAA,EAAM,OAAM,gBAAe,SAAQ,uBAAsB;AAAA,IAC1D,gBAAAD;AAAA,MAACE;AAAA,MAAA;AAAA,QACC,aAAY;AAAA,QACZ,SAAST,KAAsB,CAAA;AAAA,QAC/B,OAAOA,GAAoB,OAAO,CAACU,MAAWA,EAAE,UAAUX,CAAW;AAAA,QACrE,SAAQ;AAAA,QACR,iBAAe;AAAA,QACf,UAAAI;AAAA,QACA,YAAY;AAAA,QACZ,WAAwB;AAAA,MAAa;AAAA,IAAA;AAAA,EACvC,GACF;AAEJ;AAEA,MAAMG,IAAYK,EAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,GAQnBF,IAAuBE,EAAOC,CAAc;AAAA;AAAA;AAAA;AAAA;AAAA;"}
|
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { FormSection as
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
1
|
+
import { jsxs as d, jsx as i } from "react/jsx-runtime";
|
|
2
|
+
import { FormSection as r } from "@bjsdistribution/dms-component-library";
|
|
3
|
+
import e from "styled-components";
|
|
4
|
+
import o from "../../common/Header.js";
|
|
5
|
+
import t from "./TimedService.js";
|
|
6
|
+
import n from "./ServiceType.js";
|
|
7
|
+
import p from "./DeliveryPoint.js";
|
|
8
8
|
import a from "./ServiceLevel.js";
|
|
9
9
|
import m from "./AssemblyType.js";
|
|
10
|
-
import
|
|
11
|
-
function
|
|
12
|
-
return /* @__PURE__ */
|
|
13
|
-
/* @__PURE__ */
|
|
14
|
-
/* @__PURE__ */
|
|
15
|
-
/* @__PURE__ */
|
|
16
|
-
/* @__PURE__ */
|
|
17
|
-
/* @__PURE__ */
|
|
18
|
-
/* @__PURE__ */
|
|
10
|
+
import x from "./OrderServices.js";
|
|
11
|
+
function C() {
|
|
12
|
+
return /* @__PURE__ */ d(h, { children: [
|
|
13
|
+
/* @__PURE__ */ i(o, { label: "Services" }),
|
|
14
|
+
/* @__PURE__ */ d(s, { children: [
|
|
15
|
+
/* @__PURE__ */ d(c, { children: [
|
|
16
|
+
/* @__PURE__ */ i(t, {}),
|
|
17
|
+
/* @__PURE__ */ i(n, {}),
|
|
18
|
+
/* @__PURE__ */ i(p, {})
|
|
19
19
|
] }),
|
|
20
|
-
/* @__PURE__ */
|
|
21
|
-
/* @__PURE__ */
|
|
22
|
-
/* @__PURE__ */
|
|
20
|
+
/* @__PURE__ */ d(l, { children: [
|
|
21
|
+
/* @__PURE__ */ i(a, {}),
|
|
22
|
+
/* @__PURE__ */ i(m, {})
|
|
23
23
|
] })
|
|
24
24
|
] }),
|
|
25
|
-
/* @__PURE__ */
|
|
25
|
+
/* @__PURE__ */ i(w, { children: /* @__PURE__ */ i(x, {}) })
|
|
26
26
|
] });
|
|
27
27
|
}
|
|
28
|
-
const s =
|
|
28
|
+
const s = e.div`
|
|
29
29
|
display: flex;
|
|
30
30
|
gap: 30px;
|
|
31
31
|
|
|
@@ -33,19 +33,66 @@ const s = o.div`
|
|
|
33
33
|
flex-direction: column;
|
|
34
34
|
gap: 20px;
|
|
35
35
|
}
|
|
36
|
-
`,
|
|
36
|
+
`, c = e.div`
|
|
37
37
|
display: contents;
|
|
38
38
|
@media screen and (max-width: 1280px) {
|
|
39
39
|
display: flex;
|
|
40
40
|
gap: 15px;
|
|
41
41
|
}
|
|
42
|
-
|
|
42
|
+
|
|
43
|
+
@media screen and (max-width: 768px) {
|
|
44
|
+
flex-direction: column;
|
|
45
|
+
gap: 14px;
|
|
46
|
+
width: 100%;
|
|
47
|
+
min-width: 0;
|
|
48
|
+
> div {
|
|
49
|
+
width: 100%;
|
|
50
|
+
min-width: 0;
|
|
51
|
+
max-width: 100%;
|
|
52
|
+
box-sizing: border-box;
|
|
53
|
+
}
|
|
54
|
+
fieldset {
|
|
55
|
+
min-width: 0;
|
|
56
|
+
max-width: 100%;
|
|
57
|
+
}
|
|
58
|
+
fieldset > div {
|
|
59
|
+
flex-wrap: wrap;
|
|
60
|
+
gap: 10px 16px;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
`, l = e.div`
|
|
43
64
|
display: contents;
|
|
44
65
|
@media screen and (max-width: 1280px) {
|
|
45
66
|
display: flex;
|
|
46
67
|
gap: 15px;
|
|
47
68
|
}
|
|
48
|
-
|
|
69
|
+
|
|
70
|
+
@media screen and (max-width: 768px) {
|
|
71
|
+
flex-direction: column;
|
|
72
|
+
gap: 14px;
|
|
73
|
+
width: 100%;
|
|
74
|
+
min-width: 0;
|
|
75
|
+
> div {
|
|
76
|
+
width: 100%;
|
|
77
|
+
min-width: 0;
|
|
78
|
+
max-width: 100%;
|
|
79
|
+
box-sizing: border-box;
|
|
80
|
+
}
|
|
81
|
+
fieldset {
|
|
82
|
+
min-width: 0;
|
|
83
|
+
max-width: 100%;
|
|
84
|
+
}
|
|
85
|
+
fieldset > div {
|
|
86
|
+
flex-wrap: wrap;
|
|
87
|
+
gap: 10px 16px;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
`, w = e.div`
|
|
91
|
+
@media screen and (max-width: 768px) {
|
|
92
|
+
min-width: 0;
|
|
93
|
+
max-width: 100%;
|
|
94
|
+
}
|
|
95
|
+
`, h = e(r)`
|
|
49
96
|
flex: 1;
|
|
50
97
|
flex-direction: column;
|
|
51
98
|
gap: 10px;
|
|
@@ -57,8 +104,15 @@ const s = o.div`
|
|
|
57
104
|
span {
|
|
58
105
|
cursor: default !important;
|
|
59
106
|
}
|
|
107
|
+
|
|
108
|
+
@media screen and (max-width: 768px) {
|
|
109
|
+
min-width: 0;
|
|
110
|
+
max-width: 100%;
|
|
111
|
+
box-sizing: border-box;
|
|
112
|
+
overflow-x: hidden;
|
|
113
|
+
}
|
|
60
114
|
`;
|
|
61
115
|
export {
|
|
62
|
-
|
|
116
|
+
C as default
|
|
63
117
|
};
|
|
64
118
|
//# sourceMappingURL=index.js.map
|
package/dist/components/order-view/order-details/expanded-content/services-section/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../../../src/components/order-view/order-details/expanded-content/services-section/index.tsx"],"sourcesContent":["import { FormSection } from '@bjsdistribution/dms-component-library';\nimport React from 'react';\nimport styled from 'styled-components';\nimport Header from '../../common/Header';\nimport TimedServiceDropdown from './TimedService';\nimport ServiceTypeDropdown from './ServiceType';\nimport DeliveryPointDropdown from './DeliveryPoint';\nimport ServiceLevel from './ServiceLevel';\nimport AssemblyType from './AssemblyType';\nimport OrderServices from './OrderServices';\n\nfunction ServicesSection() {\n return (\n <CustomFormSection>\n <Header label=\"Services\" />\n <Top>\n <DropDownContainer>\n <TimedServiceDropdown />\n <ServiceTypeDropdown />\n <DeliveryPointDropdown />\n </DropDownContainer>\n <RadioContainer>\n <ServiceLevel />\n <AssemblyType />\n </RadioContainer>\n </Top>\n <Bottom>\n <OrderServices />\n </Bottom>\n </CustomFormSection>\n );\n}\n\nconst Top = styled.div`\n display: flex;\n gap: 30px;\n\n @media screen and (max-width: 1280px) {\n flex-direction: column;\n gap: 20px;\n }\n`;\n\nconst DropDownContainer = styled.div`\n display: contents;\n @media screen and (max-width: 1280px) {\n display: flex;\n gap: 15px;\n }\n`;\n\nconst RadioContainer = styled.div`\n display: contents;\n @media screen and (max-width: 1280px) {\n display: flex;\n gap: 15px;\n }\n`;\n\nconst Bottom = styled.div
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../../../src/components/order-view/order-details/expanded-content/services-section/index.tsx"],"sourcesContent":["import { FormSection } from '@bjsdistribution/dms-component-library';\nimport React from 'react';\nimport styled from 'styled-components';\nimport Header from '../../common/Header';\nimport TimedServiceDropdown from './TimedService';\nimport ServiceTypeDropdown from './ServiceType';\nimport DeliveryPointDropdown from './DeliveryPoint';\nimport ServiceLevel from './ServiceLevel';\nimport AssemblyType from './AssemblyType';\nimport OrderServices from './OrderServices';\n\nfunction ServicesSection() {\n return (\n <CustomFormSection>\n <Header label=\"Services\" />\n <Top>\n <DropDownContainer>\n <TimedServiceDropdown />\n <ServiceTypeDropdown />\n <DeliveryPointDropdown />\n </DropDownContainer>\n <RadioContainer>\n <ServiceLevel />\n <AssemblyType />\n </RadioContainer>\n </Top>\n <Bottom>\n <OrderServices />\n </Bottom>\n </CustomFormSection>\n );\n}\n\nconst Top = styled.div`\n display: flex;\n gap: 30px;\n\n @media screen and (max-width: 1280px) {\n flex-direction: column;\n gap: 20px;\n }\n`;\n\nconst DropDownContainer = styled.div`\n display: contents;\n @media screen and (max-width: 1280px) {\n display: flex;\n gap: 15px;\n }\n\n @media screen and (max-width: 768px) {\n flex-direction: column;\n gap: 14px;\n width: 100%;\n min-width: 0;\n > div {\n width: 100%;\n min-width: 0;\n max-width: 100%;\n box-sizing: border-box;\n }\n fieldset {\n min-width: 0;\n max-width: 100%;\n }\n fieldset > div {\n flex-wrap: wrap;\n gap: 10px 16px;\n }\n }\n`;\n\nconst RadioContainer = styled.div`\n display: contents;\n @media screen and (max-width: 1280px) {\n display: flex;\n gap: 15px;\n }\n\n @media screen and (max-width: 768px) {\n flex-direction: column;\n gap: 14px;\n width: 100%;\n min-width: 0;\n > div {\n width: 100%;\n min-width: 0;\n max-width: 100%;\n box-sizing: border-box;\n }\n fieldset {\n min-width: 0;\n max-width: 100%;\n }\n fieldset > div {\n flex-wrap: wrap;\n gap: 10px 16px;\n }\n }\n`;\n\nconst Bottom = styled.div`\n @media screen and (max-width: 768px) {\n min-width: 0;\n max-width: 100%;\n }\n`;\n\nconst CustomFormSection = styled(FormSection)`\n flex: 1;\n flex-direction: column;\n gap: 10px;\n border-radius: 8px;\n background: #f8fafc;\n box-shadow: 0px 1px 3px 0px rgba(16, 24, 40, 0.1);\n label,\n input,\n span {\n cursor: default !important;\n }\n\n @media screen and (max-width: 768px) {\n min-width: 0;\n max-width: 100%;\n box-sizing: border-box;\n overflow-x: hidden;\n }\n`;\n\nexport default ServicesSection;\n"],"names":["ServicesSection","CustomFormSection","jsx","Header","Top","jsxs","DropDownContainer","TimedServiceDropdown","ServiceTypeDropdown","DeliveryPointDropdown","RadioContainer","ServiceLevel","AssemblyType","Bottom","OrderServices","styled","FormSection"],"mappings":";;;;;;;;;;AAWA,SAASA,IAAkB;AACzB,2BACGC,GAAA,EACC,UAAA;AAAA,IAAA,gBAAAC,EAACC,GAAA,EAAO,OAAM,WAAA,CAAW;AAAA,sBACxBC,GAAA,EACC,UAAA;AAAA,MAAA,gBAAAC,EAACC,GAAA,EACC,UAAA;AAAA,QAAA,gBAAAJ,EAACK,GAAA,EAAqB;AAAA,0BACrBC,GAAA,EAAoB;AAAA,0BACpBC,GAAA,CAAA,CAAsB;AAAA,MAAA,GACzB;AAAA,wBACCC,GAAA,EACC,UAAA;AAAA,QAAA,gBAAAR,EAACS,GAAA,EAAa;AAAA,0BACbC,GAAA,CAAA,CAAa;AAAA,MAAA,EAAA,CAChB;AAAA,IAAA,GACF;AAAA,IACA,gBAAAV,EAACW,GAAA,EACC,UAAA,gBAAAX,EAACY,GAAA,CAAA,CAAc,EAAA,CACjB;AAAA,EAAA,GACF;AAEJ;AAEA,MAAMV,IAAMW,EAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,GAUbT,IAAoBS,EAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,GA6B3BL,IAAiBK,EAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,GA6BxBF,IAASE,EAAO;AAAA;AAAA;AAAA;AAAA;AAAA,GAOhBd,IAAoBc,EAAOC,CAAW;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helper.js","sources":["../../../../src/components/order-view/order-details/helper.ts"],"sourcesContent":["export const depotOptions = [\n {\n label: 'BJS COURIERS',\n value: 'bjs_couriers',\n },\n {\n label: 'BRD 01',\n value: 'brd_01',\n },\n {\n label: 'EXE 01',\n value: 'exe_01',\n },\n];\n\nexport const timedServiceOptions = [\n {\n label: 'All Day',\n value: 'all_day',\n },\n {\n label: 'Business Hours',\n value: 'business_hours',\n },\n {\n label: 'AM (07:00 - 12:00)',\n value: 'am',\n },\n {\n label: 'PM (12:00 - 17:00)',\n value: 'pm',\n },\n {\n label: 'Evening (17:00 - 21:00)',\n value: 'evening',\n },\n {\n label: 'Daytime (11:00 - 16:00)',\n value: 'daytime',\n },\n {\n label: 'Morning (07:00 - 12:00)',\n value: 'morning',\n },\n {\n label: 'Late AM (09:00 - 12:00)',\n value: 'late_am',\n },\n {\n label: 'Late PM (15:00 - 20:00)',\n value: 'late_pm',\n },\n];\n\nexport const serviceTypeOptions = [\n {\n label: 'Delivery',\n value: 'delivery',\n },\n {\n label: '
|
|
1
|
+
{"version":3,"file":"helper.js","sources":["../../../../src/components/order-view/order-details/helper.ts"],"sourcesContent":["export const depotOptions = [\n {\n label: 'BJS COURIERS',\n value: 'bjs_couriers',\n },\n {\n label: 'BRD 01',\n value: 'brd_01',\n },\n {\n label: 'EXE 01',\n value: 'exe_01',\n },\n];\n\nexport const timedServiceOptions = [\n {\n label: 'All Day',\n value: 'all_day',\n },\n {\n label: 'Business Hours',\n value: 'business_hours',\n },\n {\n label: 'AM (07:00 - 12:00)',\n value: 'am',\n },\n {\n label: 'PM (12:00 - 17:00)',\n value: 'pm',\n },\n {\n label: 'Evening (17:00 - 21:00)',\n value: 'evening',\n },\n {\n label: 'Daytime (11:00 - 16:00)',\n value: 'daytime',\n },\n {\n label: 'Morning (07:00 - 12:00)',\n value: 'morning',\n },\n {\n label: 'Late AM (09:00 - 12:00)',\n value: 'late_am',\n },\n {\n label: 'Late PM (15:00 - 20:00)',\n value: 'late_pm',\n },\n];\n\nexport const serviceTypeOptions = [\n {\n label: 'Delivery',\n value: 'delivery',\n },\n {\n label: 'Collection',\n value: 'collection',\n },\n {\n label: 'Exchange',\n value: 'exchange',\n },\n {\n label: 'Service Order',\n value: 'service_order',\n },\n];\n\nexport const deliveryPointOptions = [\n {\n label: 'Room of Choice',\n value: 'roc',\n },\n {\n label: 'Hallway',\n value: 'hallway',\n },\n {\n label: 'Front Door',\n value: 'front_door',\n },\n {\n label: 'Garden',\n value: 'garden',\n },\n];\n\nexport const serviceLevelOptions = [\n {\n label: '1 Man',\n value: '1man',\n },\n {\n label: '1.5 Man',\n value: '1.5man',\n },\n {\n label: '2 Man',\n value: '2man',\n },\n];\n\nexport const assemblyTypeOptions = [\n {\n label: 'Small',\n value: 'small',\n },\n {\n label: 'Medium',\n value: 'medium',\n },\n {\n label: 'Large',\n value: 'large',\n },\n];\n\nexport const vehicleTypeOptions = [\n {\n label: 'LGV',\n value: '1',\n },\n {\n label: 'HGV',\n value: '2',\n },\n];\n"],"names":["vehicleTypeOptions"],"mappings":"AA0HO,MAAMA,IAAqB;AAAA,EAChC;AAAA,IACE,OAAO;AAAA,IACP,OAAO;AAAA,EAAA;AAAA,EAET;AAAA,IACE,OAAO;AAAA,IACP,OAAO;AAAA,EAAA;AAEX;"}
|
|
@@ -1,35 +1,35 @@
|
|
|
1
1
|
import { jsxs as o, jsx as s, Fragment as p } from "react/jsx-runtime";
|
|
2
2
|
import { SectionHeader as f } from "@bjsdistribution/dms-component-library";
|
|
3
3
|
import n from "styled-components";
|
|
4
|
-
import {
|
|
5
|
-
import { WEIGHT_UNIT as
|
|
4
|
+
import { useProductDetails as m } from "../../store.js";
|
|
5
|
+
import { WEIGHT_UNIT as x, VOLUME_UNIT_CONVERT as h } from "../../../../common/utils.js";
|
|
6
6
|
function z() {
|
|
7
|
-
const [
|
|
8
|
-
const i = parseFloat(d?.[
|
|
7
|
+
const [e] = m(), r = (t, l) => t?.reduce((c, d) => {
|
|
8
|
+
const i = parseFloat(d?.[l]);
|
|
9
9
|
return c + (isNaN(i) ? 0 : i);
|
|
10
10
|
}, 0).toFixed(2);
|
|
11
11
|
return /* @__PURE__ */ o(g, { children: [
|
|
12
12
|
/* @__PURE__ */ s(f, { label: "Products" }),
|
|
13
|
-
/* @__PURE__ */ s(
|
|
14
|
-
|
|
15
|
-
/* @__PURE__ */ o(
|
|
13
|
+
/* @__PURE__ */ s(u, { children: "Products to be Returned" }),
|
|
14
|
+
e?.length > 0 && /* @__PURE__ */ o(p, { children: [
|
|
15
|
+
/* @__PURE__ */ o(a, { style: { display: "flex" }, children: [
|
|
16
16
|
"Total: ",
|
|
17
|
-
r(
|
|
18
|
-
|
|
17
|
+
r(e, "weight"),
|
|
18
|
+
x,
|
|
19
19
|
" / ",
|
|
20
|
-
r(
|
|
20
|
+
r(e, "cube"),
|
|
21
21
|
h
|
|
22
22
|
] }),
|
|
23
|
-
/* @__PURE__ */ o(
|
|
23
|
+
/* @__PURE__ */ o(a, { style: { display: "flex" }, children: [
|
|
24
24
|
"Orders- ",
|
|
25
|
-
new Set(
|
|
25
|
+
new Set(e?.map((t) => t?.order_id).filter((t) => t != null)).size,
|
|
26
26
|
" / Products- ",
|
|
27
|
-
|
|
27
|
+
e?.length
|
|
28
28
|
] })
|
|
29
29
|
] })
|
|
30
30
|
] });
|
|
31
31
|
}
|
|
32
|
-
const
|
|
32
|
+
const u = n.span`
|
|
33
33
|
color: #6a7378;
|
|
34
34
|
font-size: 14px;
|
|
35
35
|
font-style: normal;
|
|
@@ -41,7 +41,13 @@ const x = n.span`
|
|
|
41
41
|
/* justify-content: space-between; */
|
|
42
42
|
width: 100%;
|
|
43
43
|
gap: 30px;
|
|
44
|
-
|
|
44
|
+
|
|
45
|
+
@media screen and (max-width: 768px) {
|
|
46
|
+
flex-wrap: wrap;
|
|
47
|
+
gap: 4px 12px;
|
|
48
|
+
min-width: 0;
|
|
49
|
+
}
|
|
50
|
+
`, a = n.span`
|
|
45
51
|
font-family: 'Roboto', sans-serif;
|
|
46
52
|
font-size: 14px;
|
|
47
53
|
font-weight: 500;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../../src/components/order-view/products-info/collapsed-content/index.tsx"],"sourcesContent":["import { SectionHeader } from '@bjsdistribution/dms-component-library';\nimport React from 'react';\nimport styled from 'styled-components';\nimport {
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../../src/components/order-view/products-info/collapsed-content/index.tsx"],"sourcesContent":["import { SectionHeader } from '@bjsdistribution/dms-component-library';\nimport React from 'react';\nimport styled from 'styled-components';\nimport { useProductDetails } from '../../store';\nimport { WEIGHT_UNIT, VOLUME_UNIT_CONVERT } from '../../../../common/utils';\n\nfunction CollapsedContent() {\n const [productsData] = useProductDetails();\n\n const calculateTotal = (items: any[], field: 'cube' | 'weight') => {\n return items\n ?.reduce((total, item) => {\n const val = parseFloat(item?.[field]);\n return total + (isNaN(val) ? 0 : val);\n }, 0)\n .toFixed(2);\n };\n\n return (\n <Container>\n <SectionHeader label=\"Products\" />\n <Dimensions>Products to be Returned</Dimensions>\n\n {productsData?.length > 0 && (\n <>\n <Items style={{ display: 'flex' }}>\n Total: {calculateTotal(productsData, 'weight')}\n {WEIGHT_UNIT} / {calculateTotal(productsData, 'cube')}{VOLUME_UNIT_CONVERT}\n </Items>\n\n <Items style={{ display: 'flex' }}>\n Orders- {new Set(productsData?.map((item: any) => item?.order_id).filter((id: any) => id != null)).size} / Products- {productsData?.length}\n </Items>\n </>\n )}\n </Container>\n );\n}\n\nconst Dimensions = styled.span`\n color: #6a7378;\n font-size: 14px;\n font-style: normal;\n font-weight: 600;\n line-height: 24px; /* 171.429% */\n`;\n\nconst Container = styled.div`\n display: flex;\n align-items: center;\n /* justify-content: space-between; */\n width: 100%;\n gap: 30px;\n\n @media screen and (max-width: 768px) {\n flex-wrap: wrap;\n gap: 4px 12px;\n min-width: 0;\n }\n`;\n\nconst Items = styled.span`\n font-family: 'Roboto', sans-serif;\n font-size: 14px;\n font-weight: 500;\n line-height: 24px;\n color: #8e8a85;\n text-transform: capitalize;\n color: #6a7378;\n`;\n\nexport default CollapsedContent;\n"],"names":["CollapsedContent","productsData","useProductDetails","calculateTotal","items","field","total","item","val","Container","jsx","SectionHeader","Dimensions","jsxs","Fragment","Items","WEIGHT_UNIT","VOLUME_UNIT_CONVERT","id","styled"],"mappings":";;;;;AAMA,SAASA,IAAmB;AAC1B,QAAM,CAACC,CAAY,IAAIC,EAAA,GAEjBC,IAAiB,CAACC,GAAcC,MAC7BD,GACH,OAAO,CAACE,GAAOC,MAAS;AACxB,UAAMC,IAAM,WAAWD,IAAOF,CAAK,CAAC;AACpC,WAAOC,KAAS,MAAME,CAAG,IAAI,IAAIA;AAAA,EACnC,GAAG,CAAC,EACH,QAAQ,CAAC;AAGd,2BACGC,GAAA,EACC,UAAA;AAAA,IAAA,gBAAAC,EAACC,GAAA,EAAc,OAAM,WAAA,CAAW;AAAA,IAChC,gBAAAD,EAACE,KAAW,UAAA,0BAAA,CAAuB;AAAA,IAElCX,GAAc,SAAS,KACtB,gBAAAY,EAAAC,GAAA,EACE,UAAA;AAAA,MAAA,gBAAAD,EAACE,GAAA,EAAM,OAAO,EAAE,SAAS,UAAU,UAAA;AAAA,QAAA;AAAA,QACzBZ,EAAeF,GAAc,QAAQ;AAAA,QAC5Ce;AAAA,QAAY;AAAA,QAAIb,EAAeF,GAAc,MAAM;AAAA,QAAGgB;AAAA,MAAA,GACzD;AAAA,wBAECF,GAAA,EAAM,OAAO,EAAE,SAAS,UAAU,UAAA;AAAA,QAAA;AAAA,QACxB,IAAI,IAAId,GAAc,IAAI,CAACM,MAAcA,GAAM,QAAQ,EAAE,OAAO,CAACW,MAAYA,KAAM,IAAI,CAAC,EAAE;AAAA,QAAK;AAAA,QAAcjB,GAAc;AAAA,MAAA,EAAA,CACtI;AAAA,IAAA,EAAA,CACF;AAAA,EAAA,GAEJ;AAEJ;AAEA,MAAMW,IAAaO,EAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,GAQpBV,IAAYU,EAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,GAcnBJ,IAAQI,EAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;"}
|
|
@@ -1,60 +1,60 @@
|
|
|
1
|
-
import { jsx as e, jsxs as
|
|
2
|
-
import { useState as
|
|
1
|
+
import { jsx as e, jsxs as E } from "react/jsx-runtime";
|
|
2
|
+
import { useState as y, useEffect as u } from "react";
|
|
3
3
|
import S from "./expanded-content/index.js";
|
|
4
|
-
import
|
|
4
|
+
import D from "./collapsed-content/index.js";
|
|
5
5
|
import v from "../../../common/expand-collapse/index.js";
|
|
6
|
-
import { useOrderDetails as
|
|
7
|
-
import { useLoading as
|
|
8
|
-
import { useAxios as
|
|
9
|
-
import { Spin as
|
|
10
|
-
function
|
|
11
|
-
const [
|
|
6
|
+
import { useOrderDetails as O, useProductDetails as P } from "../store.js";
|
|
7
|
+
import { useLoading as k } from "../../order-daily-overview/store/store.js";
|
|
8
|
+
import { useAxios as f } from "@bjsdistribution/dms-component-library";
|
|
9
|
+
import { Spin as w, notification as L } from "antd";
|
|
10
|
+
function A({ locationloading: m }) {
|
|
11
|
+
const [g] = O(), r = g, [x, s] = y(!1), { fetchData: h } = f({
|
|
12
12
|
endpoint: `/v1/export/csv/${r?.id}`,
|
|
13
13
|
method: "POST"
|
|
14
|
-
}),
|
|
15
|
-
t.stopPropagation(), s(!0),
|
|
16
|
-
const
|
|
17
|
-
if (
|
|
18
|
-
const
|
|
19
|
-
|
|
14
|
+
}), b = (t) => {
|
|
15
|
+
t.stopPropagation(), s(!0), h().then((i) => {
|
|
16
|
+
const p = i?.data?.url || i?.url;
|
|
17
|
+
if (p) {
|
|
18
|
+
const a = document.createElement("a");
|
|
19
|
+
a.href = p, a.download = `products_export_${r?.id}.csv`, document.body.appendChild(a), a.click(), document.body.removeChild(a);
|
|
20
20
|
}
|
|
21
21
|
s(!1);
|
|
22
22
|
}).catch((i) => {
|
|
23
|
-
|
|
23
|
+
L.error({
|
|
24
24
|
message: "Failed to export csv",
|
|
25
25
|
description: i?.message || "Export error"
|
|
26
26
|
}), s(!1);
|
|
27
27
|
});
|
|
28
|
-
}, [, l] =
|
|
28
|
+
}, [, l] = P(), [, C] = k(), {
|
|
29
29
|
data: o,
|
|
30
30
|
loading: d,
|
|
31
|
-
fetchData:
|
|
32
|
-
} =
|
|
31
|
+
fetchData: c
|
|
32
|
+
} = f({
|
|
33
33
|
endpoint: `/v1/return/products/${r?.id}`,
|
|
34
34
|
method: "GET",
|
|
35
35
|
pagination: { is_pagination: !1 }
|
|
36
36
|
});
|
|
37
|
-
|
|
38
|
-
r?.id &&
|
|
39
|
-
}, [r.id]),
|
|
40
|
-
if (
|
|
37
|
+
u(() => {
|
|
38
|
+
r?.id && c();
|
|
39
|
+
}, [r.id]), u(() => {
|
|
40
|
+
if (C(d), o && o.data) {
|
|
41
41
|
const t = o.data;
|
|
42
|
-
t?.length > 0 ?
|
|
42
|
+
t?.length > 0 ? l(t) : l([]);
|
|
43
43
|
}
|
|
44
44
|
}, [o, d]);
|
|
45
|
-
const
|
|
45
|
+
const n = !o?.data || o?.data?.length === 0;
|
|
46
46
|
return /* @__PURE__ */ e(
|
|
47
47
|
v,
|
|
48
48
|
{
|
|
49
|
-
collapsedContent: /* @__PURE__ */ e(
|
|
50
|
-
extraActions: /* @__PURE__ */
|
|
49
|
+
collapsedContent: /* @__PURE__ */ e(D, {}),
|
|
50
|
+
extraActions: /* @__PURE__ */ E(
|
|
51
51
|
"div",
|
|
52
52
|
{
|
|
53
53
|
style: {
|
|
54
54
|
display: "flex",
|
|
55
55
|
alignItems: "center",
|
|
56
|
-
cursor:
|
|
57
|
-
opacity:
|
|
56
|
+
cursor: n ? "not-allowed" : "pointer",
|
|
57
|
+
opacity: n ? 0.5 : 1,
|
|
58
58
|
marginRight: "16px",
|
|
59
59
|
backgroundColor: "rgb(243 243 243)",
|
|
60
60
|
border: "1px solid #E2E8F0",
|
|
@@ -64,32 +64,32 @@ function q({ locationloading: g }) {
|
|
|
64
64
|
transition: "background-color 0.2s"
|
|
65
65
|
},
|
|
66
66
|
onClick: (t) => {
|
|
67
|
-
|
|
67
|
+
n || b(t);
|
|
68
68
|
},
|
|
69
69
|
onMouseOver: (t) => {
|
|
70
|
-
|
|
70
|
+
n || (t.currentTarget.style.backgroundColor = "#E2E8F0");
|
|
71
71
|
},
|
|
72
72
|
onMouseOut: (t) => {
|
|
73
|
-
|
|
73
|
+
n || (t.currentTarget.style.backgroundColor = "rgb(243 243 243)");
|
|
74
74
|
},
|
|
75
75
|
children: [
|
|
76
76
|
/* @__PURE__ */ e("span", { style: { color: "#475569", fontFamily: "Lato", fontSize: "13px", fontWeight: 600, whiteSpace: "nowrap", letterSpacing: "0.3px" }, children: "EXPORT CSV" }),
|
|
77
|
-
/* @__PURE__ */ e("span", { style: { marginLeft: "6px", display: "flex", alignItems: "center" }, children: /* @__PURE__ */ e(
|
|
77
|
+
/* @__PURE__ */ e("span", { style: { marginLeft: "6px", display: "flex", alignItems: "center" }, children: /* @__PURE__ */ e(w, { spinning: x, size: "small" }) })
|
|
78
78
|
]
|
|
79
79
|
}
|
|
80
80
|
),
|
|
81
81
|
children: /* @__PURE__ */ e(
|
|
82
82
|
S,
|
|
83
83
|
{
|
|
84
|
-
callReturnProducts:
|
|
84
|
+
callReturnProducts: c,
|
|
85
85
|
loading: d,
|
|
86
|
-
locationloading:
|
|
86
|
+
locationloading: m
|
|
87
87
|
}
|
|
88
88
|
)
|
|
89
89
|
}
|
|
90
90
|
);
|
|
91
91
|
}
|
|
92
92
|
export {
|
|
93
|
-
|
|
93
|
+
A as default
|
|
94
94
|
};
|
|
95
95
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../src/components/order-view/products-info/index.tsx"],"sourcesContent":["import React, { useEffect } from 'react';\nimport ExpandedContent from './expanded-content';\nimport CollapsedContent from './collapsed-content';\nimport CollapsableForm from '../../../common/expand-collapse';\nimport {
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../src/components/order-view/products-info/index.tsx"],"sourcesContent":["import React, { useEffect } from 'react';\nimport ExpandedContent from './expanded-content';\nimport CollapsedContent from './collapsed-content';\nimport CollapsableForm from '../../../common/expand-collapse';\nimport { useOrderDetails, useProductDetails } from '../store';\nimport { useLoading } from '../../order-daily-overview/store/store';\nimport { useAxios } from '@bjsdistribution/dms-component-library';\nimport { notification, Spin } from 'antd';\nimport { useState } from 'react';\n\ninterface ApiResponse {\n message: string;\n code: number;\n error: string | null;\n error_traceback: string | null;\n data: [];\n setShouldPerformAction: boolean;\n}\n\nfunction ProductsInfo({ locationloading }: any) {\n const [data] = useOrderDetails();\n const returnOrder = data;\n\n const [spinLoading, setSpinLoading] = useState<boolean>(false);\n\n // Export functionality\n const { fetchData: callExportCSV } = useAxios<any>({\n endpoint: `/v1/export/csv/${returnOrder?.id}`,\n method: 'POST',\n });\n\n const handleExportCSV = (e: React.MouseEvent) => {\n e.stopPropagation();\n setSpinLoading(true);\n\n callExportCSV()\n .then((res: any) => {\n const urlToDownload = res?.data?.url || res?.url;\n if (urlToDownload) {\n const a = document.createElement('a');\n a.href = urlToDownload;\n a.download = `products_export_${returnOrder?.id}.csv`;\n document.body.appendChild(a);\n a.click();\n document.body.removeChild(a);\n }\n setSpinLoading(false);\n })\n .catch(err => {\n notification.error({\n message: 'Failed to export csv',\n description: err?.message || 'Export error',\n });\n setSpinLoading(false);\n });\n };\n\n // For API Call\n const [, setProductsData] = useProductDetails();\n const [, setLoading] = useLoading();\n const {\n data: returnOrdersData,\n loading,\n fetchData: callReturnProducts,\n } = useAxios<{\n data: ApiResponse[];\n }>({\n endpoint: `/v1/return/products/${returnOrder?.id}`,\n method: 'GET',\n pagination: { is_pagination: false },\n });\n\n useEffect(() => {\n if (returnOrder?.id) {\n callReturnProducts();\n }\n }, [returnOrder.id]);\n\n useEffect(() => {\n setLoading(loading);\n if (returnOrdersData && returnOrdersData.data) {\n const requiredData = returnOrdersData.data;\n if (requiredData?.length > 0) {\n setProductsData(requiredData);\n } else {\n setProductsData([]);\n }\n }\n }, [returnOrdersData, loading]);\n\n const isExportDisabled = !returnOrdersData?.data || returnOrdersData?.data?.length === 0;\n\n return (\n <CollapsableForm\n collapsedContent={<CollapsedContent />}\n extraActions={\n <div\n style={{\n display: 'flex',\n alignItems: 'center',\n cursor: isExportDisabled ? 'not-allowed' : 'pointer',\n opacity: isExportDisabled ? 0.5 : 1,\n marginRight: '16px',\n backgroundColor: 'rgb(243 243 243)',\n border: '1px solid #E2E8F0',\n padding: '6px 14px',\n borderRadius: '10px',\n boxShadow: '0 1px 2px rgba(0,0,0,0.05)',\n transition: 'background-color 0.2s',\n }}\n onClick={(e) => {\n if (isExportDisabled) return;\n handleExportCSV(e);\n }}\n onMouseOver={(e) => {\n if (!isExportDisabled) e.currentTarget.style.backgroundColor = '#E2E8F0';\n }}\n onMouseOut={(e) => {\n if (!isExportDisabled) e.currentTarget.style.backgroundColor = 'rgb(243 243 243)';\n }}\n >\n <span style={{ color: '#475569', fontFamily: 'Lato', fontSize: '13px', fontWeight: 600, whiteSpace: 'nowrap', letterSpacing: '0.3px' }}>\n EXPORT CSV\n </span>\n <span style={{ marginLeft: '6px', display: 'flex', alignItems: 'center' }}>\n <Spin spinning={spinLoading} size=\"small\" />\n </span>\n </div>\n }\n >\n <ExpandedContent\n callReturnProducts={callReturnProducts}\n loading={loading}\n locationloading={locationloading}\n />\n </CollapsableForm>\n );\n}\n\nexport default ProductsInfo;\n"],"names":["ProductsInfo","locationloading","data","useOrderDetails","returnOrder","spinLoading","setSpinLoading","useState","callExportCSV","useAxios","handleExportCSV","e","res","urlToDownload","err","notification","setProductsData","useProductDetails","setLoading","useLoading","returnOrdersData","loading","callReturnProducts","useEffect","requiredData","isExportDisabled","jsx","CollapsableForm","CollapsedContent","jsxs","Spin","ExpandedContent"],"mappings":"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"}
|