@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
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { jsxs as u, jsx as l } from "react/jsx-runtime";
|
|
2
|
-
import { Input as
|
|
2
|
+
import { Input as w, Label as y } from "@bjsdistribution/dms-component-library";
|
|
3
3
|
import c from "styled-components";
|
|
4
|
-
import { errorAtom as
|
|
4
|
+
import { errorAtom as D, useOrderDetails as E, usePrevOrderDetails as W } from "../../../../store.js";
|
|
5
5
|
import { handleKeyDown as _ } from "../../../../utils.js";
|
|
6
6
|
import { useClientPortal as H } from "../../../../../store.js";
|
|
7
7
|
import O from "./CallCustomer.js";
|
|
8
8
|
import { Tooltip as N } from "antd";
|
|
9
9
|
import { useAtom as $ } from "jotai";
|
|
10
10
|
function G() {
|
|
11
|
-
const [
|
|
11
|
+
const [d, m] = $(D), [x] = H(), [g, C] = E(), [b] = W(), f = b?.order_recipient?.contact_home, p = g?.order_recipient, v = (i) => {
|
|
12
12
|
let t = i.target.value.replace(/\s+/g, "");
|
|
13
13
|
if (console.log(t, "valuee"), !/^\+?\d*$/.test(t)) return;
|
|
14
14
|
let s = ["+44", "44", "0", "+353", "353"].find((o) => t.startsWith(o)) || "", n = t.slice(s.length);
|
|
@@ -26,7 +26,7 @@ function G() {
|
|
|
26
26
|
})) : m((o) => ({ ...o, homeContactError: "" })) : m((o) => ({ ...o, homeContactError: "" }));
|
|
27
27
|
};
|
|
28
28
|
return /* @__PURE__ */ u(j, { children: [
|
|
29
|
-
/* @__PURE__ */ l(I, { children: /* @__PURE__ */ l(
|
|
29
|
+
/* @__PURE__ */ l(I, { children: /* @__PURE__ */ l(y, { label: "Contact Home", htmlFor: "contact-home" }) }),
|
|
30
30
|
/* @__PURE__ */ u(k, { children: [
|
|
31
31
|
/* @__PURE__ */ l(
|
|
32
32
|
L,
|
|
@@ -40,8 +40,8 @@ function G() {
|
|
|
40
40
|
disabled: x
|
|
41
41
|
}
|
|
42
42
|
),
|
|
43
|
-
|
|
44
|
-
const i =
|
|
43
|
+
f && (() => {
|
|
44
|
+
const i = f.replace(/\s+/g, "");
|
|
45
45
|
let t = i.replace(/\D/g, ""), e = "", r = "";
|
|
46
46
|
i.startsWith("+44") ? (e = "+44", r = t.slice(2)) : i.startsWith("44") ? (e = "44", r = t.slice(2)) : i.startsWith("0") ? (e = "0", r = t.slice(1)) : i.startsWith("+353") ? (e = "+353", r = t.slice(3)) : i.startsWith("353") ? (e = "353", r = t.slice(3)) : r = t;
|
|
47
47
|
const s = e === "+353" || e === "353" ? 9 : 10;
|
|
@@ -52,7 +52,7 @@ function G() {
|
|
|
52
52
|
return /* @__PURE__ */ l(N, { placement: "top", title: /* @__PURE__ */ l("span", { children: "Zoom" }), children: /* @__PURE__ */ l("a", { href: a, style: { cursor: "pointer" }, children: /* @__PURE__ */ l(O, {}) }) });
|
|
53
53
|
})()
|
|
54
54
|
] }),
|
|
55
|
-
|
|
55
|
+
d.homeContactError && /* @__PURE__ */ l(A, { children: d.homeContactError })
|
|
56
56
|
] });
|
|
57
57
|
}
|
|
58
58
|
const k = c.div`
|
|
@@ -63,9 +63,13 @@ const k = c.div`
|
|
|
63
63
|
display: flex;
|
|
64
64
|
align-items: center;
|
|
65
65
|
gap: 5px;
|
|
66
|
-
`, L = c(
|
|
66
|
+
`, L = c(w)`
|
|
67
67
|
width: 80%;
|
|
68
68
|
|
|
69
|
+
@media screen and (max-width: 768px) {
|
|
70
|
+
width: 100%;
|
|
71
|
+
}
|
|
72
|
+
|
|
69
73
|
&::-webkit-outer-spin-button,
|
|
70
74
|
&::-webkit-inner-spin-button {
|
|
71
75
|
-webkit-appearance: none;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContactHome.js","sources":["../../../../../../../src/components/order-view/order-details/expanded-content/customer-section/contact-info/ContactHome.tsx"],"sourcesContent":["import { Input, Label } from '@bjsdistribution/dms-component-library';\nimport React from 'react';\nimport styled from 'styled-components';\nimport {\n errorAtom,\n useAtom,\n useOrderDetails,\n usePrevOrderDetails,\n} from '../../../../store';\nimport { handleKeyDown } from '../../../../utils';\nimport { useClientPortal } from '../../../../../store';\n\n//import { VALIDATE_UK_IRISH_NUMBER_REGEX } from '../../../helper';\nimport CallCustomer from './CallCustomer';\nimport { Tooltip } from 'antd';\n\nfunction ContactHome() {\n const [errors, setErrors] = useAtom(errorAtom);\n const [isClientPortal] = useClientPortal();\n const [orderDetails, setOrderDetails] = useOrderDetails();\n const [prevOrderDetails] = usePrevOrderDetails();\n const apiContactHome = prevOrderDetails?.order_recipient?.contact_home;\n const orderRecipient = orderDetails?.order_recipient;\n\n const onChange = (e: React.ChangeEvent<HTMLInputElement>) => {\n let val = e.target.value.replace(/\\s+/g, '');\n console.log(val, 'valuee');\n\n if (!/^\\+?\\d*$/.test(val)) return;\n\n const validPrefixes = ['+44', '44', '0', '+353', '353'];\n\n let matchedPrefix = validPrefixes.find(prefix => val.startsWith(prefix));\n let prefix = matchedPrefix || '';\n let numberPart = val.slice(prefix.length);\n\n const digitLimit = prefix === '+353' || prefix === '353' ? 9 : 10;\n\n if (numberPart.length > digitLimit) return;\n\n const contactValue = val;\n\n const updatedOrderRecipient = {\n ...(orderRecipient === null\n ? { contact_home: contactValue }\n : { ...orderRecipient, contact_home: contactValue }),\n };\n\n setOrderDetails(prev => ({\n ...prev,\n order_recipient: updatedOrderRecipient,\n }));\n\n if (!numberPart) {\n setErrors(prev => ({ ...prev, homeContactError: '' }));\n } else if (numberPart.length !== digitLimit) {\n setErrors(prev => ({\n ...prev,\n homeContactError: `Number must have exactly ${digitLimit} digits after the prefix.`,\n }));\n } else {\n setErrors(prev => ({ ...prev, homeContactError: '' }));\n }\n };\n\n return (\n <Container>\n <Wrapper>\n <Label label=\"Contact Home\" htmlFor=\"contact-home\" />\n </Wrapper>\n <InputContainer>\n <CustomInput\n name=\"contact-home\"\n // maxLength={12}\n type=\"text\"\n placeholder=\"Home Number\"\n onKeyDown={handleKeyDown}\n value={orderRecipient?.contact_home || ''}\n onChange={onChange}\n disabled={isClientPortal}\n />\n {/* \n <CallCustomer /> */}\n {apiContactHome &&\n (() => {\n const rawNumber = apiContactHome.replace(/\\s+/g, '');\n\n let formattedNumber = rawNumber.replace(/\\D/g, ''); // digits only\n let prefix = '';\n let numberPart = '';\n\n if (rawNumber.startsWith('+44')) {\n prefix = '+44';\n numberPart = formattedNumber.slice(2);\n } else if (rawNumber.startsWith('44')) {\n prefix = '44';\n numberPart = formattedNumber.slice(2);\n } else if (rawNumber.startsWith('0')) {\n prefix = '0';\n numberPart = formattedNumber.slice(1);\n } else if (rawNumber.startsWith('+353')) {\n prefix = '+353';\n numberPart = formattedNumber.slice(3);\n } else if (rawNumber.startsWith('353')) {\n prefix = '353';\n numberPart = formattedNumber.slice(3);\n } else {\n numberPart = formattedNumber;\n }\n\n // Set digit limit based on prefix\n const digitLimit = prefix === '+353' || prefix === '353' ? 9 : 10;\n\n if (numberPart.length !== digitLimit) return null;\n\n let hrefPrefix = '';\n\n if (prefix === '0' || prefix === '44' || prefix === '+44') {\n hrefPrefix = '+44';\n } else if (prefix === '353' || prefix === '+353') {\n hrefPrefix = '+353';\n } else {\n hrefPrefix = '+44';\n }\n\n const finalHref = `tel:${hrefPrefix}${numberPart}`;\n\n return (\n <Tooltip placement=\"top\" title={<span>Zoom</span>}>\n <a href={finalHref} style={{ cursor: 'pointer' }}>\n <CallCustomer />\n </a>\n </Tooltip>\n );\n })()}\n </InputContainer>\n {errors.homeContactError && (\n <ErrorText>{errors.homeContactError}</ErrorText>\n )}\n </Container>\n );\n}\n\nconst InputContainer = styled.div`\n display: flex;\n gap: 7px;\n align-items: center;\n`;\n\nconst Wrapper = styled.div`\n display: flex;\n align-items: center;\n gap: 5px;\n`;\n\nconst CustomInput = styled(Input)`\n width: 80%;\n\n &::-webkit-outer-spin-button,\n &::-webkit-inner-spin-button {\n -webkit-appearance: none;\n margin: 0;\n }\n &:focus-visible {\n outline: none;\n }\n`;\n\nconst Container = styled.div`\n display: flex;\n flex-direction: column;\n gap: 6px;\n flex: 1;\n`;\n\nconst ErrorText = styled.span`\n color: red;\n font-size: 0.85rem;\n margin-top: 4px;\n`;\n\nexport default ContactHome;\n"],"names":["ContactHome","errors","setErrors","useAtom","errorAtom","isClientPortal","useClientPortal","orderDetails","setOrderDetails","useOrderDetails","prevOrderDetails","usePrevOrderDetails","apiContactHome","orderRecipient","onChange","e","val","prefix","numberPart","digitLimit","contactValue","updatedOrderRecipient","prev","Container","jsx","Wrapper","Label","InputContainer","CustomInput","handleKeyDown","rawNumber","formattedNumber","hrefPrefix","finalHref","Tooltip","CallCustomer","ErrorText","styled","Input"],"mappings":";;;;;;;;;AAgBA,SAASA,IAAc;AACrB,QAAM,CAACC,GAAQC,CAAS,IAAIC,EAAQC,CAAS,GACvC,CAACC,CAAc,IAAIC,EAAA,GACnB,CAACC,GAAcC,CAAe,IAAIC,EAAA,GAClC,CAACC,CAAgB,IAAIC,EAAA,GACrBC,IAAiBF,GAAkB,iB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MAAMT,IAAiBU,EAAO;AAAA;AAAA;AAAA;AAAA,GAMxBZ,IAAUY,EAAO;AAAA;AAAA;AAAA;AAAA,GAMjBT,IAAcS,EAAOC,CAAK;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,
|
|
1
|
+
{"version":3,"file":"ContactHome.js","sources":["../../../../../../../src/components/order-view/order-details/expanded-content/customer-section/contact-info/ContactHome.tsx"],"sourcesContent":["import { Input, Label } from '@bjsdistribution/dms-component-library';\nimport React from 'react';\nimport styled from 'styled-components';\nimport {\n errorAtom,\n useAtom,\n useOrderDetails,\n usePrevOrderDetails,\n} from '../../../../store';\nimport { handleKeyDown } from '../../../../utils';\nimport { useClientPortal } from '../../../../../store';\n\n//import { VALIDATE_UK_IRISH_NUMBER_REGEX } from '../../../helper';\nimport CallCustomer from './CallCustomer';\nimport { Tooltip } from 'antd';\n\nfunction ContactHome() {\n const [errors, setErrors] = useAtom(errorAtom);\n const [isClientPortal] = useClientPortal();\n const [orderDetails, setOrderDetails] = useOrderDetails();\n const [prevOrderDetails] = usePrevOrderDetails();\n const apiContactHome = prevOrderDetails?.order_recipient?.contact_home;\n const orderRecipient = orderDetails?.order_recipient;\n\n const onChange = (e: React.ChangeEvent<HTMLInputElement>) => {\n let val = e.target.value.replace(/\\s+/g, '');\n console.log(val, 'valuee');\n\n if (!/^\\+?\\d*$/.test(val)) return;\n\n const validPrefixes = ['+44', '44', '0', '+353', '353'];\n\n let matchedPrefix = validPrefixes.find(prefix => val.startsWith(prefix));\n let prefix = matchedPrefix || '';\n let numberPart = val.slice(prefix.length);\n\n const digitLimit = prefix === '+353' || prefix === '353' ? 9 : 10;\n\n if (numberPart.length > digitLimit) return;\n\n const contactValue = val;\n\n const updatedOrderRecipient = {\n ...(orderRecipient === null\n ? { contact_home: contactValue }\n : { ...orderRecipient, contact_home: contactValue }),\n };\n\n setOrderDetails(prev => ({\n ...prev,\n order_recipient: updatedOrderRecipient,\n }));\n\n if (!numberPart) {\n setErrors(prev => ({ ...prev, homeContactError: '' }));\n } else if (numberPart.length !== digitLimit) {\n setErrors(prev => ({\n ...prev,\n homeContactError: `Number must have exactly ${digitLimit} digits after the prefix.`,\n }));\n } else {\n setErrors(prev => ({ ...prev, homeContactError: '' }));\n }\n };\n\n return (\n <Container>\n <Wrapper>\n <Label label=\"Contact Home\" htmlFor=\"contact-home\" />\n </Wrapper>\n <InputContainer>\n <CustomInput\n name=\"contact-home\"\n // maxLength={12}\n type=\"text\"\n placeholder=\"Home Number\"\n onKeyDown={handleKeyDown}\n value={orderRecipient?.contact_home || ''}\n onChange={onChange}\n disabled={isClientPortal}\n />\n {/* \n <CallCustomer /> */}\n {apiContactHome &&\n (() => {\n const rawNumber = apiContactHome.replace(/\\s+/g, '');\n\n let formattedNumber = rawNumber.replace(/\\D/g, ''); // digits only\n let prefix = '';\n let numberPart = '';\n\n if (rawNumber.startsWith('+44')) {\n prefix = '+44';\n numberPart = formattedNumber.slice(2);\n } else if (rawNumber.startsWith('44')) {\n prefix = '44';\n numberPart = formattedNumber.slice(2);\n } else if (rawNumber.startsWith('0')) {\n prefix = '0';\n numberPart = formattedNumber.slice(1);\n } else if (rawNumber.startsWith('+353')) {\n prefix = '+353';\n numberPart = formattedNumber.slice(3);\n } else if (rawNumber.startsWith('353')) {\n prefix = '353';\n numberPart = formattedNumber.slice(3);\n } else {\n numberPart = formattedNumber;\n }\n\n // Set digit limit based on prefix\n const digitLimit = prefix === '+353' || prefix === '353' ? 9 : 10;\n\n if (numberPart.length !== digitLimit) return null;\n\n let hrefPrefix = '';\n\n if (prefix === '0' || prefix === '44' || prefix === '+44') {\n hrefPrefix = '+44';\n } else if (prefix === '353' || prefix === '+353') {\n hrefPrefix = '+353';\n } else {\n hrefPrefix = '+44';\n }\n\n const finalHref = `tel:${hrefPrefix}${numberPart}`;\n\n return (\n <Tooltip placement=\"top\" title={<span>Zoom</span>}>\n <a href={finalHref} style={{ cursor: 'pointer' }}>\n <CallCustomer />\n </a>\n </Tooltip>\n );\n })()}\n </InputContainer>\n {errors.homeContactError && (\n <ErrorText>{errors.homeContactError}</ErrorText>\n )}\n </Container>\n );\n}\n\nconst InputContainer = styled.div`\n display: flex;\n gap: 7px;\n align-items: center;\n`;\n\nconst Wrapper = styled.div`\n display: flex;\n align-items: center;\n gap: 5px;\n`;\n\nconst CustomInput = styled(Input)`\n width: 80%;\n\n @media screen and (max-width: 768px) {\n width: 100%;\n }\n\n &::-webkit-outer-spin-button,\n &::-webkit-inner-spin-button {\n -webkit-appearance: none;\n margin: 0;\n }\n &:focus-visible {\n outline: none;\n }\n`;\n\nconst Container = styled.div`\n display: flex;\n flex-direction: column;\n gap: 6px;\n flex: 1;\n`;\n\nconst ErrorText = styled.span`\n color: red;\n font-size: 0.85rem;\n margin-top: 4px;\n`;\n\nexport default ContactHome;\n"],"names":["ContactHome","errors","setErrors","useAtom","errorAtom","isClientPortal","useClientPortal","orderDetails","setOrderDetails","useOrderDetails","prevOrderDetails","usePrevOrderDetails","apiContactHome","orderRecipient","onChange","e","val","prefix","numberPart","digitLimit","contactValue","updatedOrderRecipient","prev","Container","jsx","Wrapper","Label","InputContainer","CustomInput","handleKeyDown","rawNumber","formattedNumber","hrefPrefix","finalHref","Tooltip","CallCustomer","ErrorText","styled","Input"],"mappings":";;;;;;;;;AAgBA,SAASA,IAAc;AACrB,QAAM,CAACC,GAAQC,CAAS,IAAIC,EAAQC,CAAS,GACvC,CAACC,CAAc,IAAIC,EAAA,GACnB,CAACC,GAAcC,CAAe,IAAIC,EAAA,GAClC,CAACC,CAAgB,IAAIC,EAAA,GACrBC,IAAiBF,GAAkB,iBAAiB,cACpDG,IAAiBN,GAAc,iBAE/BO,IAAW,CAACC,MAA2C;AAC3D,QAAIC,IAAMD,EAAE,OAAO,MAAM,QAAQ,QAAQ,EAAE;AAG3C,QAFA,QAAQ,IAAIC,GAAK,QAAQ,GAErB,CAAC,WAAW,KAAKA,CAAG,EAAG;AAK3B,QAAIC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AA,GAiB1Bf,IAAYc,EAAO;AAAA;AAAA;AAAA;AAAA;AAAA,GAOnBD,IAAYC,EAAO;AAAA;AAAA;AAAA;AAAA;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { Input as
|
|
1
|
+
import { jsxs as d, jsx as n } from "react/jsx-runtime";
|
|
2
|
+
import { Input as w, Label as P } from "@bjsdistribution/dms-component-library";
|
|
3
3
|
import m from "styled-components";
|
|
4
4
|
import D from "../../../../../../common/copy/CopyText.js";
|
|
5
5
|
import E from "./CallCustomer.js";
|
|
@@ -9,29 +9,29 @@ import { useClientPortal as N } from "../../../../../store.js";
|
|
|
9
9
|
import { Tooltip as $ } from "antd";
|
|
10
10
|
import { useAtom as k } from "jotai";
|
|
11
11
|
function Q() {
|
|
12
|
-
const [
|
|
12
|
+
const [f, p] = k(W), [h] = N(), [x, g] = O(), [v] = I(), u = v?.order_recipient?.contact_mobile, s = x?.order_recipient, C = s?.contact_mobile !== void 0 && s?.contact_mobile !== null && s?.contact_mobile?.length > 0, y = (o) => {
|
|
13
13
|
let t = o.target.value.replace(/\s+/g, "");
|
|
14
14
|
if (!/^\+?\d*$/.test(t)) return;
|
|
15
|
-
let
|
|
16
|
-
const
|
|
17
|
-
if (l.length >
|
|
15
|
+
let a = ["+44", "44", "0", "+353", "353"].find((i) => t.startsWith(i)) || "", l = t.slice(a.length);
|
|
16
|
+
const c = a === "+353" || a === "353" ? 9 : 10;
|
|
17
|
+
if (l.length > c) return;
|
|
18
18
|
const b = t, _ = {
|
|
19
19
|
...s === null ? { contact_mobile: b } : { ...s, contact_mobile: b }
|
|
20
20
|
};
|
|
21
21
|
g((i) => ({
|
|
22
22
|
...i,
|
|
23
23
|
order_recipient: _
|
|
24
|
-
})), l ? l.length !==
|
|
24
|
+
})), l ? l.length !== c ? p((i) => ({
|
|
25
25
|
...i,
|
|
26
|
-
mobileError: `Number must have exactly ${
|
|
26
|
+
mobileError: `Number must have exactly ${c} digits after the prefix.`
|
|
27
27
|
})) : p((i) => ({ ...i, mobileError: "" })) : p((i) => ({ ...i, mobileError: "" }));
|
|
28
28
|
};
|
|
29
|
-
return /* @__PURE__ */
|
|
30
|
-
/* @__PURE__ */
|
|
31
|
-
/* @__PURE__ */ n(
|
|
29
|
+
return /* @__PURE__ */ d(A, { children: [
|
|
30
|
+
/* @__PURE__ */ d(T, { children: [
|
|
31
|
+
/* @__PURE__ */ n(P, { label: "Contact Mobile", htmlFor: "contact-mobile" }),
|
|
32
32
|
C && /* @__PURE__ */ n(D, { text: s?.contact_mobile })
|
|
33
33
|
] }),
|
|
34
|
-
/* @__PURE__ */
|
|
34
|
+
/* @__PURE__ */ d(L, { children: [
|
|
35
35
|
/* @__PURE__ */ n(
|
|
36
36
|
j,
|
|
37
37
|
{
|
|
@@ -48,15 +48,15 @@ function Q() {
|
|
|
48
48
|
const o = u.replace(/\s+/g, "");
|
|
49
49
|
let t = o.replace(/\D/g, ""), e = "", r = "";
|
|
50
50
|
o.startsWith("+44") ? (e = "+44", r = t.slice(2)) : o.startsWith("44") ? (e = "44", r = t.slice(2)) : o.startsWith("0") ? (e = "0", r = t.slice(1)) : o.startsWith("+353") ? (e = "+353", r = t.slice(3)) : o.startsWith("353") ? (e = "353", r = t.slice(3)) : r = t;
|
|
51
|
-
const
|
|
52
|
-
if (r.length !==
|
|
51
|
+
const a = e === "+353" || e === "353" ? 9 : 10;
|
|
52
|
+
if (r.length !== a) return null;
|
|
53
53
|
let l = "";
|
|
54
54
|
e === "0" || e === "44" || e === "+44" ? l = "+44" : e === "353" || e === "+353" ? l = "+353" : l = "+44";
|
|
55
|
-
const
|
|
56
|
-
return /* @__PURE__ */ n($, { placement: "top", title: /* @__PURE__ */ n("span", { children: "Zoom" }), children: /* @__PURE__ */ n("a", { href:
|
|
55
|
+
const c = `tel:${l}${r}`;
|
|
56
|
+
return /* @__PURE__ */ n($, { placement: "top", title: /* @__PURE__ */ n("span", { children: "Zoom" }), children: /* @__PURE__ */ n("a", { href: c, style: { cursor: "pointer" }, children: /* @__PURE__ */ n(E, {}) }) });
|
|
57
57
|
})()
|
|
58
58
|
] }),
|
|
59
|
-
|
|
59
|
+
f.mobileError && /* @__PURE__ */ n(K, { children: f.mobileError })
|
|
60
60
|
] });
|
|
61
61
|
}
|
|
62
62
|
const L = m.div`
|
|
@@ -67,9 +67,13 @@ const L = m.div`
|
|
|
67
67
|
display: flex;
|
|
68
68
|
align-items: center;
|
|
69
69
|
gap: 5px;
|
|
70
|
-
`, j = m(
|
|
70
|
+
`, j = m(w)`
|
|
71
71
|
width: 80%;
|
|
72
72
|
|
|
73
|
+
@media screen and (max-width: 768px) {
|
|
74
|
+
width: 100%;
|
|
75
|
+
}
|
|
76
|
+
|
|
73
77
|
&::-webkit-outer-spin-button,
|
|
74
78
|
&::-webkit-inner-spin-button {
|
|
75
79
|
-webkit-appearance: none;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContactMobile.js","sources":["../../../../../../../src/components/order-view/order-details/expanded-content/customer-section/contact-info/ContactMobile.tsx"],"sourcesContent":["import { Input, Label } from '@bjsdistribution/dms-component-library';\nimport React from 'react';\nimport styled from 'styled-components';\nimport CopyText from '../../../../../../common/copy/CopyText';\nimport CallCustomer from './CallCustomer';\nimport {\n errorAtom,\n useAtom,\n useOrderDetails,\n usePrevOrderDetails,\n} from '../../../../store';\nimport { handleKeyDown } from '../../../../utils';\nimport { useClientPortal } from '../../../../../store';\nimport { Tooltip } from 'antd';\n\nfunction ContactMobile() {\n const [errors, setErrors] = useAtom(errorAtom);\n const [isClientPortal] = useClientPortal();\n const [orderDetails, setOrderDetails] = useOrderDetails();\n const [prevOrderDetails] = usePrevOrderDetails();\n const apiContactMobile = prevOrderDetails?.order_recipient?.contact_mobile;\n const orderRecipient = orderDetails?.order_recipient;\n\n const showCopyIcon =\n orderRecipient?.contact_mobile !== undefined &&\n orderRecipient?.contact_mobile !== null &&\n orderRecipient?.contact_mobile?.length > 0;\n\n const onChange = (e: React.ChangeEvent<HTMLInputElement>) => {\n let val = e.target.value.replace(/\\s+/g, '');\n\n if (!/^\\+?\\d*$/.test(val)) return;\n\n const validPrefixes = ['+44', '44', '0', '+353', '353'];\n\n let matchedPrefix = validPrefixes.find(prefix => val.startsWith(prefix));\n let prefix = matchedPrefix || '';\n let numberPart = val.slice(prefix.length);\n\n const digitLimit = prefix === '+353' || prefix === '353' ? 9 : 10;\n\n if (numberPart.length > digitLimit) return;\n\n const contactValue = val;\n\n const updatedOrderRecipient = {\n ...(orderRecipient === null\n ? { contact_mobile: contactValue }\n : { ...orderRecipient, contact_mobile: contactValue }),\n };\n\n setOrderDetails(prev => ({\n ...prev,\n order_recipient: updatedOrderRecipient,\n }));\n\n // Validation errors\n if (!numberPart) {\n setErrors(prev => ({ ...prev, mobileError: '' }));\n } else if (numberPart.length !== digitLimit) {\n setErrors(prev => ({\n ...prev,\n mobileError: `Number must have exactly ${digitLimit} digits after the prefix.`,\n }));\n } else {\n setErrors(prev => ({ ...prev, mobileError: '' }));\n }\n };\n\n return (\n <Container>\n <Wrapper>\n <Label label=\"Contact Mobile\" htmlFor=\"contact-mobile\" />\n {showCopyIcon && <CopyText text={orderRecipient?.contact_mobile!} />}\n </Wrapper>\n <InputContainer>\n <CustomInput\n name=\"contact-mobile\"\n // maxLength={12}\n type=\"text\"\n placeholder=\"Mobile Number\"\n onKeyDown={handleKeyDown}\n value={orderRecipient?.contact_mobile || ''}\n onChange={onChange}\n disabled={isClientPortal}\n />\n\n {apiContactMobile &&\n (() => {\n const rawNumber = apiContactMobile.replace(/\\s+/g, '');\n\n let formattedNumber = rawNumber.replace(/\\D/g, '');\n let prefix = '';\n let numberPart = '';\n\n if (rawNumber.startsWith('+44')) {\n prefix = '+44';\n numberPart = formattedNumber.slice(2);\n } else if (rawNumber.startsWith('44')) {\n prefix = '44';\n numberPart = formattedNumber.slice(2);\n } else if (rawNumber.startsWith('0')) {\n prefix = '0';\n numberPart = formattedNumber.slice(1);\n } else if (rawNumber.startsWith('+353')) {\n prefix = '+353';\n numberPart = formattedNumber.slice(3);\n } else if (rawNumber.startsWith('353')) {\n prefix = '353';\n numberPart = formattedNumber.slice(3);\n } else {\n numberPart = formattedNumber;\n }\n\n // Set digit limit based on prefix\n const digitLimit = prefix === '+353' || prefix === '353' ? 9 : 10;\n\n if (numberPart.length !== digitLimit) return null;\n\n let hrefPrefix = '';\n\n if (prefix === '0' || prefix === '44' || prefix === '+44') {\n hrefPrefix = '+44';\n } else if (prefix === '353' || prefix === '+353') {\n hrefPrefix = '+353';\n } else {\n hrefPrefix = '+44';\n }\n\n const finalHref = `tel:${hrefPrefix}${numberPart}`;\n\n return (\n <Tooltip placement=\"top\" title={<span>Zoom</span>}>\n <a href={finalHref} style={{ cursor: 'pointer' }}>\n <CallCustomer />\n </a>\n </Tooltip>\n );\n })()}\n </InputContainer>\n\n {errors.mobileError && <ErrorText>{errors.mobileError}</ErrorText>}\n </Container>\n );\n}\n\nconst InputContainer = styled.div`\n display: flex;\n gap: 7px;\n align-items: center;\n`;\n\nconst Wrapper = styled.div`\n display: flex;\n align-items: center;\n gap: 5px;\n`;\n\nconst CustomInput = styled(Input)`\n width: 80%;\n\n &::-webkit-outer-spin-button,\n &::-webkit-inner-spin-button {\n -webkit-appearance: none;\n margin: 0;\n }\n &:focus-visible {\n outline: none;\n }\n`;\n\nconst Container = styled.div`\n display: flex;\n flex-direction: column;\n gap: 6px;\n flex: 1;\n`;\n\nconst ErrorText = styled.span`\n color: red;\n font-size: 0.85rem;\n margin-top: 4px;\n`;\n\nexport default ContactMobile;\n"],"names":["ContactMobile","errors","setErrors","useAtom","errorAtom","isClientPortal","useClientPortal","orderDetails","setOrderDetails","useOrderDetails","prevOrderDetails","usePrevOrderDetails","apiContactMobile","orderRecipient","showCopyIcon","onChange","e","val","prefix","numberPart","digitLimit","contactValue","updatedOrderRecipient","prev","Container","jsxs","Wrapper","jsx","Label","CopyText","InputContainer","CustomInput","handleKeyDown","rawNumber","form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a,SAEbA,IAAa;AAGf,cAAMC,IAAY,OAAOD,CAAU,GAAGhB,CAAU;AAEhD,eACE,gBAAAQ,EAACU,KAAQ,WAAU,OAAM,OAAO,gBAAAV,EAAC,QAAA,EAAK,kBAAI,GACxC,UAAA,gBAAAA,EAAC,OAAE,MAAMS,GAAW,OAAO,EAAE,QAAQ,aACnC,UAAA,gBAAAT,EAACW,GAAA,CAAA,CAAa,EAAA,CAChB,EAAA,CACF;AAAA,MAEJ,GAAA;AAAA,IAAG,GACP;AAAA,IAECrC,EAAO,eAAe,gBAAA0B,EAACY,GAAA,EAAW,YAAO,YAAA,CAAY;AAAA,EAAA,GACxD;AAEJ;AAEA,MAAMT,IAAiBU,EAAO;AAAA;AAAA;AAAA;AAAA,GAMxBd,IAAUc,EAAO;AAAA;AAAA;AAAA;AAAA,GAMjBT,IAAcS,EAAOC,CAAK;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,
|
|
1
|
+
{"version":3,"file":"ContactMobile.js","sources":["../../../../../../../src/components/order-view/order-details/expanded-content/customer-section/contact-info/ContactMobile.tsx"],"sourcesContent":["import { Input, Label } from '@bjsdistribution/dms-component-library';\nimport React from 'react';\nimport styled from 'styled-components';\nimport CopyText from '../../../../../../common/copy/CopyText';\nimport CallCustomer from './CallCustomer';\nimport {\n errorAtom,\n useAtom,\n useOrderDetails,\n usePrevOrderDetails,\n} from '../../../../store';\nimport { handleKeyDown } from '../../../../utils';\nimport { useClientPortal } from '../../../../../store';\nimport { Tooltip } from 'antd';\n\nfunction ContactMobile() {\n const [errors, setErrors] = useAtom(errorAtom);\n const [isClientPortal] = useClientPortal();\n const [orderDetails, setOrderDetails] = useOrderDetails();\n const [prevOrderDetails] = usePrevOrderDetails();\n const apiContactMobile = prevOrderDetails?.order_recipient?.contact_mobile;\n const orderRecipient = orderDetails?.order_recipient;\n\n const showCopyIcon =\n orderRecipient?.contact_mobile !== undefined &&\n orderRecipient?.contact_mobile !== null &&\n orderRecipient?.contact_mobile?.length > 0;\n\n const onChange = (e: React.ChangeEvent<HTMLInputElement>) => {\n let val = e.target.value.replace(/\\s+/g, '');\n\n if (!/^\\+?\\d*$/.test(val)) return;\n\n const validPrefixes = ['+44', '44', '0', '+353', '353'];\n\n let matchedPrefix = validPrefixes.find(prefix => val.startsWith(prefix));\n let prefix = matchedPrefix || '';\n let numberPart = val.slice(prefix.length);\n\n const digitLimit = prefix === '+353' || prefix === '353' ? 9 : 10;\n\n if (numberPart.length > digitLimit) return;\n\n const contactValue = val;\n\n const updatedOrderRecipient = {\n ...(orderRecipient === null\n ? { contact_mobile: contactValue }\n : { ...orderRecipient, contact_mobile: contactValue }),\n };\n\n setOrderDetails(prev => ({\n ...prev,\n order_recipient: updatedOrderRecipient,\n }));\n\n // Validation errors\n if (!numberPart) {\n setErrors(prev => ({ ...prev, mobileError: '' }));\n } else if (numberPart.length !== digitLimit) {\n setErrors(prev => ({\n ...prev,\n mobileError: `Number must have exactly ${digitLimit} digits after the prefix.`,\n }));\n } else {\n setErrors(prev => ({ ...prev, mobileError: '' }));\n }\n };\n\n return (\n <Container>\n <Wrapper>\n <Label label=\"Contact Mobile\" htmlFor=\"contact-mobile\" />\n {showCopyIcon && <CopyText text={orderRecipient?.contact_mobile!} />}\n </Wrapper>\n <InputContainer>\n <CustomInput\n name=\"contact-mobile\"\n // maxLength={12}\n type=\"text\"\n placeholder=\"Mobile Number\"\n onKeyDown={handleKeyDown}\n value={orderRecipient?.contact_mobile || ''}\n onChange={onChange}\n disabled={isClientPortal}\n />\n\n {apiContactMobile &&\n (() => {\n const rawNumber = apiContactMobile.replace(/\\s+/g, '');\n\n let formattedNumber = rawNumber.replace(/\\D/g, '');\n let prefix = '';\n let numberPart = '';\n\n if (rawNumber.startsWith('+44')) {\n prefix = '+44';\n numberPart = formattedNumber.slice(2);\n } else if (rawNumber.startsWith('44')) {\n prefix = '44';\n numberPart = formattedNumber.slice(2);\n } else if (rawNumber.startsWith('0')) {\n prefix = '0';\n numberPart = formattedNumber.slice(1);\n } else if (rawNumber.startsWith('+353')) {\n prefix = '+353';\n numberPart = formattedNumber.slice(3);\n } else if (rawNumber.startsWith('353')) {\n prefix = '353';\n numberPart = formattedNumber.slice(3);\n } else {\n numberPart = formattedNumber;\n }\n\n // Set digit limit based on prefix\n const digitLimit = prefix === '+353' || prefix === '353' ? 9 : 10;\n\n if (numberPart.length !== digitLimit) return null;\n\n let hrefPrefix = '';\n\n if (prefix === '0' || prefix === '44' || prefix === '+44') {\n hrefPrefix = '+44';\n } else if (prefix === '353' || prefix === '+353') {\n hrefPrefix = '+353';\n } else {\n hrefPrefix = '+44';\n }\n\n const finalHref = `tel:${hrefPrefix}${numberPart}`;\n\n return (\n <Tooltip placement=\"top\" title={<span>Zoom</span>}>\n <a href={finalHref} style={{ cursor: 'pointer' }}>\n <CallCustomer />\n </a>\n </Tooltip>\n );\n })()}\n </InputContainer>\n\n {errors.mobileError && <ErrorText>{errors.mobileError}</ErrorText>}\n </Container>\n );\n}\n\nconst InputContainer = styled.div`\n display: flex;\n gap: 7px;\n align-items: center;\n`;\n\nconst Wrapper = styled.div`\n display: flex;\n align-items: center;\n gap: 5px;\n`;\n\nconst CustomInput = styled(Input)`\n width: 80%;\n\n @media screen and (max-width: 768px) {\n width: 100%;\n }\n\n &::-webkit-outer-spin-button,\n &::-webkit-inner-spin-button {\n -webkit-appearance: none;\n margin: 0;\n }\n &:focus-visible {\n outline: none;\n }\n`;\n\nconst Container = styled.div`\n display: flex;\n flex-direction: column;\n gap: 6px;\n flex: 1;\n`;\n\nconst ErrorText = styled.span`\n color: red;\n font-size: 0.85rem;\n margin-top: 4px;\n`;\n\nexport default ContactMobile;\n"],"names":["ContactMobile","errors","setErrors","useAtom","errorAtom","isClientPortal","useClientPortal","orderDetails","setOrderDetails","useOrderDetails","prevOrderDetails","usePrevOrderDetails","apiContactMobile","orderRecipient","showCopyIcon","onChange","e","val","prefix","numberPart","digitLimit","contactValue","updatedOrderRecipient","prev","Container","jsxs","Wrapper","jsx","Label","CopyText","InputContainer","CustomInput","handleKeyDown","rawNumber","formattedNumber","hrefPrefix","finalHref","Tooltip","CallCustomer","ErrorText","styled","Input"],"mappings":";;;;;;;;;;AAeA,SAASA,IAAgB;AACvB,QAAM,CAACC,GAAQC,CAAS,IAAIC,EAAQC,CAAS,GACvC,CAACC,CAAc,IAAIC,EAAA,GACnB,CAACC,GAAcC,CAAe,IAAIC,EAAA,GAClC,CAACC,CAAgB,IAAIC,EAAA,GACrBC,IAAmBF,GAAkB,iBAAiB,gBACtDG,IAAiBN,GAAc,iBAE/BO,IACJD,GAAgB,mBAAmB,UACnCA,GAAgB,mBAAmB,QACnCA,GAAgB,gBAAgB,SAAS,GAErCE,IAAW,CAACC,MAA2C;AAC3D,QAAIC,IAAMD,EAAE,OAAO,MAAM,QAAQ,QAAQ,EAAE;AAE3C,QAAI,CAAC,WAAW,KAAKC,CAAG,EAAG;AAK3B,QAAIC,IAHkB,CAAC,OAAO,MAAM,KAAK,QAAQ,KAAK,EAEpB,KAAK,CAAAA,MAAUD,EAAI,WAAWC,CAAM,CAAC,KACzC,IAC1BC,IAAaF,EAAI,MAAMC,EAAO,MAAM;AAExC,UAAME,IAAaF,MAAW,UAAUA,MAAW,QAAQ,IAAI;AAE/D,QAAIC,EAAW,SAASC,EAAY;AAEpC,UAAMC,IAAeJ,GAEfK,IAAwB;AAAA,MAC5B,GAAIT,MAAmB,OACnB,EAAE,gBAAgBQ,EAAA,IAClB,EAAE,GAAGR,GAAgB,gBAAgBQ,EAAA;AAAA,IAAa;AAGxD,IAAAb,EAAgB,CAAAe,OAAS;AAAA,MACvB,GAAGA;AAAA,MACH,iBAAiBD;AAAA,IAAA,EACjB,GAGGH,IAEMA,EAAW,WAAWC,IAC/BlB,EAAU,CAAAqB,OAAS;AAAA,MACjB,GAAGA;AAAA,MACH,aAAa,4BAA4BH,CAAU;AAAA,IAAA,EACnD,IAEFlB,EAAU,QAAS,EAAE,GAAGqB,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MAAW,QAAQA,MAAW,QAClDiB,IAAa,QACJjB,MAAW,SAASA,MAAW,SACxCiB,IAAa,SAEbA,IAAa;AAGf,cAAMC,IAAY,OAAOD,CAAU,GAAGhB,CAAU;AAEhD,eACE,gBAAAQ,EAACU,KAAQ,WAAU,OAAM,OAAO,gBAAAV,EAAC,QAAA,EAAK,kBAAI,GACxC,UAAA,gBAAAA,EAAC,OAAE,MAAMS,GAAW,OAAO,EAAE,QAAQ,aACnC,UAAA,gBAAAT,EAACW,GAAA,CAAA,CAAa,EAAA,CAChB,EAAA,CACF;AAAA,MAEJ,GAAA;AAAA,IAAG,GACP;AAAA,IAECrC,EAAO,eAAe,gBAAA0B,EAACY,GAAA,EAAW,YAAO,YAAA,CAAY;AAAA,EAAA,GACxD;AAEJ;AAEA,MAAMT,IAAiBU,EAAO;AAAA;AAAA;AAAA;AAAA,GAMxBd,IAAUc,EAAO;AAAA;AAAA;AAAA;AAAA,GAMjBT,IAAcS,EAAOC,CAAK;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,GAiB1BjB,IAAYgB,EAAO;AAAA;AAAA;AAAA;AAAA;AAAA,GAOnBD,IAAYC,EAAO;AAAA;AAAA;AAAA;AAAA;"}
|
|
@@ -1,25 +1,31 @@
|
|
|
1
1
|
import { jsxs as t, jsx as o } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
2
|
+
import r from "styled-components";
|
|
3
3
|
import n from "./ContactHome.js";
|
|
4
4
|
import e from "./ContactWork.js";
|
|
5
5
|
import m from "./ContactMobile.js";
|
|
6
|
-
import
|
|
6
|
+
import a from "./ContactEmail.js";
|
|
7
7
|
function u() {
|
|
8
|
-
return /* @__PURE__ */ t(
|
|
9
|
-
/* @__PURE__ */ t(
|
|
8
|
+
return /* @__PURE__ */ t(p, { children: [
|
|
9
|
+
/* @__PURE__ */ t(i, { children: [
|
|
10
10
|
/* @__PURE__ */ o(n, {}),
|
|
11
11
|
/* @__PURE__ */ o(e, {})
|
|
12
12
|
] }),
|
|
13
|
-
/* @__PURE__ */ t(
|
|
13
|
+
/* @__PURE__ */ t(i, { children: [
|
|
14
14
|
/* @__PURE__ */ o(m, {}),
|
|
15
|
-
/* @__PURE__ */ o(
|
|
15
|
+
/* @__PURE__ */ o(a, {})
|
|
16
16
|
] })
|
|
17
17
|
] });
|
|
18
18
|
}
|
|
19
|
-
const
|
|
19
|
+
const i = r.div`
|
|
20
20
|
display: flex;
|
|
21
21
|
gap: 15px;
|
|
22
|
-
|
|
22
|
+
|
|
23
|
+
@media screen and (max-width: 768px) {
|
|
24
|
+
flex-direction: column;
|
|
25
|
+
gap: 15px;
|
|
26
|
+
min-width: 0;
|
|
27
|
+
}
|
|
28
|
+
`, p = r.div`
|
|
23
29
|
display: flex;
|
|
24
30
|
flex-direction: column;
|
|
25
31
|
gap: 10px;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../../../../src/components/order-view/order-details/expanded-content/customer-section/contact-info/index.tsx"],"sourcesContent":["import styled from 'styled-components';\nimport React from 'react';\nimport ContactHome from './ContactHome';\nimport ContactWork from './ContactWork';\nimport ContactMobile from './ContactMobile';\nimport ContactEmail from './ContactEmail';\n\nfunction ContactDetails() {\n return (\n <Container>\n <GroupedInputs>\n <ContactHome />\n <ContactWork />\n </GroupedInputs>\n <GroupedInputs>\n <ContactMobile />\n <ContactEmail />\n </GroupedInputs>\n </Container>\n );\n}\n\nconst GroupedInputs = styled.div`\n display: flex;\n gap: 15px;\n`;\n\nconst Container = styled.div`\n display: flex;\n flex-direction: column;\n gap: 10px;\n`;\n\nexport default ContactDetails;\n"],"names":["ContactDetails","Container","jsxs","GroupedInputs","jsx","ContactHome","ContactWork","ContactMobile","ContactEmail","styled"],"mappings":";;;;;;AAOA,SAASA,IAAiB;AACxB,2BACGC,GAAA,EACC,UAAA;AAAA,IAAA,gBAAAC,EAACC,GAAA,EACC,UAAA;AAAA,MAAA,gBAAAC,EAACC,GAAA,EAAY;AAAA,wBACZC,GAAA,CAAA,CAAY;AAAA,IAAA,GACf;AAAA,sBACCH,GAAA,EACC,UAAA;AAAA,MAAA,gBAAAC,EAACG,GAAA,EAAc;AAAA,wBACdC,GAAA,CAAA,CAAa;AAAA,IAAA,EAAA,CAChB;AAAA,EAAA,GACF;AAEJ;AAEA,MAAML,IAAgBM,EAAO;AAAA;AAAA;AAAA,
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../../../../src/components/order-view/order-details/expanded-content/customer-section/contact-info/index.tsx"],"sourcesContent":["import styled from 'styled-components';\nimport React from 'react';\nimport ContactHome from './ContactHome';\nimport ContactWork from './ContactWork';\nimport ContactMobile from './ContactMobile';\nimport ContactEmail from './ContactEmail';\n\nfunction ContactDetails() {\n return (\n <Container>\n <GroupedInputs>\n <ContactHome />\n <ContactWork />\n </GroupedInputs>\n <GroupedInputs>\n <ContactMobile />\n <ContactEmail />\n </GroupedInputs>\n </Container>\n );\n}\n\nconst GroupedInputs = styled.div`\n display: flex;\n gap: 15px;\n\n @media screen and (max-width: 768px) {\n flex-direction: column;\n gap: 15px;\n min-width: 0;\n }\n`;\n\nconst Container = styled.div`\n display: flex;\n flex-direction: column;\n gap: 10px;\n`;\n\nexport default ContactDetails;\n"],"names":["ContactDetails","Container","jsxs","GroupedInputs","jsx","ContactHome","ContactWork","ContactMobile","ContactEmail","styled"],"mappings":";;;;;;AAOA,SAASA,IAAiB;AACxB,2BACGC,GAAA,EACC,UAAA;AAAA,IAAA,gBAAAC,EAACC,GAAA,EACC,UAAA;AAAA,MAAA,gBAAAC,EAACC,GAAA,EAAY;AAAA,wBACZC,GAAA,CAAA,CAAY;AAAA,IAAA,GACf;AAAA,sBACCH,GAAA,EACC,UAAA;AAAA,MAAA,gBAAAC,EAACG,GAAA,EAAc;AAAA,wBACdC,GAAA,CAAA,CAAa;AAAA,IAAA,EAAA,CAChB;AAAA,EAAA,GACF;AAEJ;AAEA,MAAML,IAAgBM,EAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,GAWvBR,IAAYQ,EAAO;AAAA;AAAA;AAAA;AAAA;"}
|
|
@@ -1,31 +1,37 @@
|
|
|
1
1
|
import { jsxs as r, jsx as o } from "react/jsx-runtime";
|
|
2
|
-
import { FormSection as
|
|
2
|
+
import { FormSection as i } from "@bjsdistribution/dms-component-library";
|
|
3
3
|
import t from "styled-components";
|
|
4
|
-
import
|
|
4
|
+
import e from "../../common/Header.js";
|
|
5
5
|
import m from "./RecipientName.js";
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
function
|
|
9
|
-
return /* @__PURE__ */ r(
|
|
10
|
-
/* @__PURE__ */ o(
|
|
11
|
-
/* @__PURE__ */ r(
|
|
6
|
+
import n from "./location-info/index.js";
|
|
7
|
+
import a from "./contact-info/index.js";
|
|
8
|
+
function h() {
|
|
9
|
+
return /* @__PURE__ */ r(d, { children: [
|
|
10
|
+
/* @__PURE__ */ o(e, { label: "Customer" }),
|
|
11
|
+
/* @__PURE__ */ r(p, { children: [
|
|
12
12
|
/* @__PURE__ */ o(m, {}),
|
|
13
|
-
/* @__PURE__ */ o(
|
|
14
|
-
/* @__PURE__ */ o(
|
|
13
|
+
/* @__PURE__ */ o(n, {}),
|
|
14
|
+
/* @__PURE__ */ o(a, {})
|
|
15
15
|
] })
|
|
16
16
|
] });
|
|
17
17
|
}
|
|
18
|
-
const
|
|
18
|
+
const p = t.div`
|
|
19
19
|
display: flex;
|
|
20
20
|
flex-direction: column;
|
|
21
21
|
gap: 15px;
|
|
22
|
-
`,
|
|
22
|
+
`, d = t(i)`
|
|
23
23
|
flex: 1;
|
|
24
24
|
border-radius: 8px;
|
|
25
25
|
background: #f8fafc;
|
|
26
26
|
box-shadow: 0px 1px 3px 0px rgba(16, 24, 40, 0.1);
|
|
27
|
+
|
|
28
|
+
@media screen and (max-width: 768px) {
|
|
29
|
+
min-width: 0;
|
|
30
|
+
max-width: 100%;
|
|
31
|
+
box-sizing: border-box;
|
|
32
|
+
}
|
|
27
33
|
`;
|
|
28
34
|
export {
|
|
29
|
-
|
|
35
|
+
h as default
|
|
30
36
|
};
|
|
31
37
|
//# sourceMappingURL=index.js.map
|
package/dist/components/order-view/order-details/expanded-content/customer-section/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../../../src/components/order-view/order-details/expanded-content/customer-section/index.tsx"],"sourcesContent":["import React from 'react';\nimport { FormSection } from '@bjsdistribution/dms-component-library';\nimport styled from 'styled-components';\nimport Header from '../../common/Header';\nimport RecipientName from './RecipientName';\nimport LocationDetails from './location-info';\nimport ContactDetails from './contact-info';\n\nfunction CustomerSection() {\n return (\n <CustomFormSection>\n <Header label=\"Customer\" />\n <FormInputs>\n <RecipientName />\n <LocationDetails />\n <ContactDetails />\n </FormInputs>\n </CustomFormSection>\n );\n}\n\nconst FormInputs = styled.div`\n display: flex;\n flex-direction: column;\n gap: 15px;\n`;\n\nconst CustomFormSection = styled(FormSection)`\n flex: 1;\n border-radius: 8px;\n background: #f8fafc;\n box-shadow: 0px 1px 3px 0px rgba(16, 24, 40, 0.1);\n`;\n\nexport default CustomerSection;\n"],"names":["CustomerSection","CustomFormSection","jsx","Header","FormInputs","RecipientName","LocationDetails","ContactDetails","styled","FormSection"],"mappings":";;;;;;;AAQA,SAASA,IAAkB;AACzB,2BACGC,GAAA,EACC,UAAA;AAAA,IAAA,gBAAAC,EAACC,GAAA,EAAO,OAAM,WAAA,CAAW;AAAA,sBACxBC,GAAA,EACC,UAAA;AAAA,MAAA,gBAAAF,EAACG,GAAA,EAAc;AAAA,wBACdC,GAAA,EAAgB;AAAA,wBAChBC,GAAA,CAAA,CAAe;AAAA,IAAA,EAAA,CAClB;AAAA,EAAA,GACF;AAEJ;AAEA,MAAMH,IAAaI,EAAO;AAAA;AAAA;AAAA;AAAA,GAMpBP,IAAoBO,EAAOC,CAAW;AAAA;AAAA;AAAA;AAAA;AAAA;"}
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../../../src/components/order-view/order-details/expanded-content/customer-section/index.tsx"],"sourcesContent":["import React from 'react';\nimport { FormSection } from '@bjsdistribution/dms-component-library';\nimport styled from 'styled-components';\nimport Header from '../../common/Header';\nimport RecipientName from './RecipientName';\nimport LocationDetails from './location-info';\nimport ContactDetails from './contact-info';\n\nfunction CustomerSection() {\n return (\n <CustomFormSection>\n <Header label=\"Customer\" />\n <FormInputs>\n <RecipientName />\n <LocationDetails />\n <ContactDetails />\n </FormInputs>\n </CustomFormSection>\n );\n}\n\nconst FormInputs = styled.div`\n display: flex;\n flex-direction: column;\n gap: 15px;\n`;\n\nconst CustomFormSection = styled(FormSection)`\n flex: 1;\n border-radius: 8px;\n background: #f8fafc;\n box-shadow: 0px 1px 3px 0px rgba(16, 24, 40, 0.1);\n\n @media screen and (max-width: 768px) {\n min-width: 0;\n max-width: 100%;\n box-sizing: border-box;\n }\n`;\n\nexport default CustomerSection;\n"],"names":["CustomerSection","CustomFormSection","jsx","Header","FormInputs","RecipientName","LocationDetails","ContactDetails","styled","FormSection"],"mappings":";;;;;;;AAQA,SAASA,IAAkB;AACzB,2BACGC,GAAA,EACC,UAAA;AAAA,IAAA,gBAAAC,EAACC,GAAA,EAAO,OAAM,WAAA,CAAW;AAAA,sBACxBC,GAAA,EACC,UAAA;AAAA,MAAA,gBAAAF,EAACG,GAAA,EAAc;AAAA,wBACdC,GAAA,EAAgB;AAAA,wBAChBC,GAAA,CAAA,CAAe;AAAA,IAAA,EAAA,CAClB;AAAA,EAAA,GACF;AAEJ;AAEA,MAAMH,IAAaI,EAAO;AAAA;AAAA;AAAA;AAAA,GAMpBP,IAAoBO,EAAOC,CAAW;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { jsxs as t, jsx as r } from "react/jsx-runtime";
|
|
2
2
|
import { TextArea as m, Label as x } from "@bjsdistribution/dms-component-library";
|
|
3
3
|
import s from "styled-components";
|
|
4
|
-
import
|
|
5
|
-
import { useOrderDetails as
|
|
4
|
+
import h from "../../../../../../common/copy/CopyText.js";
|
|
5
|
+
import { useOrderDetails as u } from "../../../../store.js";
|
|
6
6
|
function O() {
|
|
7
|
-
const [o, n] =
|
|
7
|
+
const [o, n] = u(), e = o?.order_recipient, a = e?.address !== void 0 && e?.address !== null && e?.address?.length > 0, i = (l) => {
|
|
8
8
|
const d = l.target.value, p = {
|
|
9
9
|
...e === null ? { address: d } : { ...e, address: d }
|
|
10
10
|
};
|
|
@@ -14,9 +14,9 @@ function O() {
|
|
|
14
14
|
}));
|
|
15
15
|
};
|
|
16
16
|
return /* @__PURE__ */ t(g, { children: [
|
|
17
|
-
/* @__PURE__ */ t(
|
|
17
|
+
/* @__PURE__ */ t(f, { children: [
|
|
18
18
|
/* @__PURE__ */ r(x, { label: "Address", htmlFor: "address" }),
|
|
19
|
-
a && /* @__PURE__ */ r(
|
|
19
|
+
a && /* @__PURE__ */ r(h, { text: e?.address })
|
|
20
20
|
] }),
|
|
21
21
|
/* @__PURE__ */ r(
|
|
22
22
|
v,
|
|
@@ -29,7 +29,7 @@ function O() {
|
|
|
29
29
|
)
|
|
30
30
|
] });
|
|
31
31
|
}
|
|
32
|
-
const
|
|
32
|
+
const f = s.div`
|
|
33
33
|
display: flex;
|
|
34
34
|
align-items: center;
|
|
35
35
|
gap: 5px;
|
|
@@ -42,6 +42,11 @@ const h = s.div`
|
|
|
42
42
|
resize: none;
|
|
43
43
|
height: 70%;
|
|
44
44
|
border-radius: 15px;
|
|
45
|
+
|
|
46
|
+
@media screen and (max-width: 768px) {
|
|
47
|
+
height: auto;
|
|
48
|
+
min-height: 90px;
|
|
49
|
+
}
|
|
45
50
|
`;
|
|
46
51
|
export {
|
|
47
52
|
O as default
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Address.js","sources":["../../../../../../../src/components/order-view/order-details/expanded-content/customer-section/location-info/Address.tsx"],"sourcesContent":["import { Label, TextArea } from '@bjsdistribution/dms-component-library';\nimport React from 'react';\nimport styled from 'styled-components';\nimport CopyText from '../../../../../../common/copy/CopyText';\nimport { useOrderDetails } from '../../../../store';\n\nfunction Address() {\n // show copy icon if there is input value\n const [orderDetails, setOrderDetails] = useOrderDetails();\n const orderRecipient = orderDetails?.order_recipient;\n\n const showCopyIcon =\n orderRecipient?.address !== undefined &&\n orderRecipient?.address !== null &&\n orderRecipient?.address?.length > 0;\n\n const onChange = (e: React.ChangeEvent<HTMLTextAreaElement>) => {\n const val = e.target.value;\n const updatedOrderRecipient = {\n ...(orderRecipient === null\n ? { address: val }\n : { ...orderRecipient, address: val }),\n };\n setOrderDetails(prev => {\n return {\n ...prev,\n order_recipient: updatedOrderRecipient,\n };\n });\n };\n\n return (\n <Container>\n <Wrapper>\n <Label label=\"Address\" htmlFor=\"address\" />\n {showCopyIcon && <CopyText text={orderRecipient?.address!} />}\n </Wrapper>\n <TextContainer\n name=\"address\"\n placeholder=\"Address\"\n value={orderRecipient?.address || ''}\n onChange={onChange}\n />\n </Container>\n );\n}\n\nconst Wrapper = styled.div`\n display: flex;\n align-items: center;\n gap: 5px;\n`;\n\nconst Container = styled.div`\n display: flex;\n flex-direction: column;\n gap: 6px;\n flex: 1;\n`;\nconst TextContainer = styled(TextArea)`\n resize: none;\n height: 70%;\n border-radius: 15px;\n`;\n\nexport default Address;\n"],"names":["Address","orderDetails","setOrderDetails","useOrderDetails","orderRecipient","showCopyIcon","onChange","e","val","updatedOrderRecipient","prev","Container","jsxs","Wrapper","jsx","Label","CopyText","TextContainer","styled","TextArea"],"mappings":";;;;;AAMA,SAASA,IAAU;AAEjB,QAAM,CAACC,GAAcC,CAAe,IAAIC,EAAA,GAClCC,IAAiBH,GAAc,iBAE/BI,IACJD,GAAgB,YAAY,UAC5BA,GAAgB,YAAY,QAC5BA,GAAgB,SAAS,SAAS,GAE9BE,IAAW,CAACC,MAA8C;AAC9D,UAAMC,IAAMD,EAAE,OAAO,OACfE,IAAwB;AAAA,MAC5B,GAAIL,MAAmB,OACnB,EAAE,SAASI,EAAA,IACX,EAAE,GAAGJ,GAAgB,SAASI,EAAA;AAAA,IAAI;AAExC,IAAAN,EAAgB,CAAAQ,OACP;AAAA,MACL,GAAGA;AAAA,MACH,iBAAiBD;AAAA,IAAA,EAEpB;AAAA,EACH;AAEA,2BACGE,GAAA,EACC,UAAA;AAAA,IAAA,gBAAAC,EAACC,GAAA,EACC,UAAA;AAAA,MAAA,gBAAAC,EAACC,GAAA,EAAM,OAAM,WAAU,SAAQ,WAAU;AAAA,MACxCV,KAAgB,gBAAAS,EAACE,GAAA,EAAS,MAAMZ,GAAgB,QAAA,CAAU;AAAA,IAAA,GAC7D;AAAA,IACA,gBAAAU;AAAA,MAACG;AAAA,MAAA;AAAA,QACC,MAAK;AAAA,QACL,aAAY;AAAA,QACZ,OAAOb,GAAgB,WAAW;AAAA,QAClC,UAAAE;AAAA,MAAA;AAAA,IAAA;AAAA,EACF,GACF;AAEJ;AAEA,MAAMO,IAAUK,EAAO;AAAA;AAAA;AAAA;AAAA,GAMjBP,IAAYO,EAAO;AAAA;AAAA;AAAA;AAAA;AAAA,GAMnBD,IAAgBC,EAAOC,CAAQ;AAAA;AAAA;AAAA;AAAA;"}
|
|
1
|
+
{"version":3,"file":"Address.js","sources":["../../../../../../../src/components/order-view/order-details/expanded-content/customer-section/location-info/Address.tsx"],"sourcesContent":["import { Label, TextArea } from '@bjsdistribution/dms-component-library';\nimport React from 'react';\nimport styled from 'styled-components';\nimport CopyText from '../../../../../../common/copy/CopyText';\nimport { useOrderDetails } from '../../../../store';\n\nfunction Address() {\n // show copy icon if there is input value\n const [orderDetails, setOrderDetails] = useOrderDetails();\n const orderRecipient = orderDetails?.order_recipient;\n\n const showCopyIcon =\n orderRecipient?.address !== undefined &&\n orderRecipient?.address !== null &&\n orderRecipient?.address?.length > 0;\n\n const onChange = (e: React.ChangeEvent<HTMLTextAreaElement>) => {\n const val = e.target.value;\n const updatedOrderRecipient = {\n ...(orderRecipient === null\n ? { address: val }\n : { ...orderRecipient, address: val }),\n };\n setOrderDetails(prev => {\n return {\n ...prev,\n order_recipient: updatedOrderRecipient,\n };\n });\n };\n\n return (\n <Container>\n <Wrapper>\n <Label label=\"Address\" htmlFor=\"address\" />\n {showCopyIcon && <CopyText text={orderRecipient?.address!} />}\n </Wrapper>\n <TextContainer\n name=\"address\"\n placeholder=\"Address\"\n value={orderRecipient?.address || ''}\n onChange={onChange}\n />\n </Container>\n );\n}\n\nconst Wrapper = styled.div`\n display: flex;\n align-items: center;\n gap: 5px;\n`;\n\nconst Container = styled.div`\n display: flex;\n flex-direction: column;\n gap: 6px;\n flex: 1;\n`;\nconst TextContainer = styled(TextArea)`\n resize: none;\n height: 70%;\n border-radius: 15px;\n\n @media screen and (max-width: 768px) {\n height: auto;\n min-height: 90px;\n }\n`;\n\nexport default Address;\n"],"names":["Address","orderDetails","setOrderDetails","useOrderDetails","orderRecipient","showCopyIcon","onChange","e","val","updatedOrderRecipient","prev","Container","jsxs","Wrapper","jsx","Label","CopyText","TextContainer","styled","TextArea"],"mappings":";;;;;AAMA,SAASA,IAAU;AAEjB,QAAM,CAACC,GAAcC,CAAe,IAAIC,EAAA,GAClCC,IAAiBH,GAAc,iBAE/BI,IACJD,GAAgB,YAAY,UAC5BA,GAAgB,YAAY,QAC5BA,GAAgB,SAAS,SAAS,GAE9BE,IAAW,CAACC,MAA8C;AAC9D,UAAMC,IAAMD,EAAE,OAAO,OACfE,IAAwB;AAAA,MAC5B,GAAIL,MAAmB,OACnB,EAAE,SAASI,EAAA,IACX,EAAE,GAAGJ,GAAgB,SAASI,EAAA;AAAA,IAAI;AAExC,IAAAN,EAAgB,CAAAQ,OACP;AAAA,MACL,GAAGA;AAAA,MACH,iBAAiBD;AAAA,IAAA,EAEpB;AAAA,EACH;AAEA,2BACGE,GAAA,EACC,UAAA;AAAA,IAAA,gBAAAC,EAACC,GAAA,EACC,UAAA;AAAA,MAAA,gBAAAC,EAACC,GAAA,EAAM,OAAM,WAAU,SAAQ,WAAU;AAAA,MACxCV,KAAgB,gBAAAS,EAACE,GAAA,EAAS,MAAMZ,GAAgB,QAAA,CAAU;AAAA,IAAA,GAC7D;AAAA,IACA,gBAAAU;AAAA,MAACG;AAAA,MAAA;AAAA,QACC,MAAK;AAAA,QACL,aAAY;AAAA,QACZ,OAAOb,GAAgB,WAAW;AAAA,QAClC,UAAAE;AAAA,MAAA;AAAA,IAAA;AAAA,EACF,GACF;AAEJ;AAEA,MAAMO,IAAUK,EAAO;AAAA;AAAA;AAAA;AAAA,GAMjBP,IAAYO,EAAO;AAAA;AAAA;AAAA;AAAA;AAAA,GAMnBD,IAAgBC,EAAOC,CAAQ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;"}
|
|
@@ -1,33 +1,35 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { Input as s, Label as
|
|
3
|
-
import
|
|
4
|
-
import { useOrderDetails as
|
|
5
|
-
import { handleKeyDown as
|
|
6
|
-
function
|
|
7
|
-
const [
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
1
|
+
import { jsxs as p, jsx as n } from "react/jsx-runtime";
|
|
2
|
+
import { Input as s, Label as c } from "@bjsdistribution/dms-component-library";
|
|
3
|
+
import o from "styled-components";
|
|
4
|
+
import { useOrderDetails as m } from "../../../../store.js";
|
|
5
|
+
import { handleKeyDown as f } from "../../../../utils.js";
|
|
6
|
+
function D() {
|
|
7
|
+
const [r, i] = m(), e = r?.order_recipient, a = (l) => {
|
|
8
|
+
const t = l.target.value, d = {
|
|
9
|
+
...e === null ? { latitude: t } : { ...e, latitude: t }
|
|
10
|
+
};
|
|
11
|
+
i((u) => ({
|
|
12
|
+
...u,
|
|
13
|
+
order_recipient: d
|
|
12
14
|
}));
|
|
13
15
|
};
|
|
14
|
-
return /* @__PURE__ */
|
|
15
|
-
/* @__PURE__ */
|
|
16
|
-
/* @__PURE__ */
|
|
17
|
-
|
|
16
|
+
return /* @__PURE__ */ p(x, { children: [
|
|
17
|
+
/* @__PURE__ */ n(c, { label: "Latitude", htmlFor: "lat" }),
|
|
18
|
+
/* @__PURE__ */ n(
|
|
19
|
+
b,
|
|
18
20
|
{
|
|
19
21
|
name: "lat",
|
|
20
22
|
type: "number",
|
|
21
23
|
placeholder: "Latitude",
|
|
22
|
-
onKeyDown:
|
|
23
|
-
value:
|
|
24
|
-
onChange:
|
|
24
|
+
onKeyDown: f,
|
|
25
|
+
value: e?.latitude || "",
|
|
26
|
+
onChange: a,
|
|
25
27
|
readOnly: !0
|
|
26
28
|
}
|
|
27
29
|
)
|
|
28
30
|
] });
|
|
29
31
|
}
|
|
30
|
-
const
|
|
32
|
+
const b = o(s)`
|
|
31
33
|
width: 100%;
|
|
32
34
|
&::-webkit-outer-spin-button,
|
|
33
35
|
&::-webkit-inner-spin-button {
|
|
@@ -40,13 +42,13 @@ const c = t(s)`
|
|
|
40
42
|
opacity: 0.8;
|
|
41
43
|
background-color: #f4f4f4;
|
|
42
44
|
pointer-events: none;
|
|
43
|
-
`,
|
|
45
|
+
`, x = o.div`
|
|
44
46
|
display: flex;
|
|
45
47
|
flex-direction: column;
|
|
46
48
|
gap: 6px;
|
|
47
49
|
flex: 1;
|
|
48
50
|
`;
|
|
49
51
|
export {
|
|
50
|
-
|
|
52
|
+
D as default
|
|
51
53
|
};
|
|
52
54
|
//# sourceMappingURL=Latitude.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Latitude.js","sources":["../../../../../../../src/components/order-view/order-details/expanded-content/customer-section/location-info/Latitude.tsx"],"sourcesContent":["import { Input, Label } from '@bjsdistribution/dms-component-library';\nimport React from 'react';\nimport styled from 'styled-components';\nimport { useOrderDetails } from '../../../../store';\nimport { handleKeyDown } from '../../../../utils';\n\nfunction Latitude() {\n const [orderDetails, setOrderDetails] = useOrderDetails();\n\n const onChange = (e: React.ChangeEvent<HTMLInputElement>) => {\n const val = e.target.value;\n setOrderDetails(prev => ({\n ...prev,\n
|
|
1
|
+
{"version":3,"file":"Latitude.js","sources":["../../../../../../../src/components/order-view/order-details/expanded-content/customer-section/location-info/Latitude.tsx"],"sourcesContent":["import { Input, Label } from '@bjsdistribution/dms-component-library';\nimport React from 'react';\nimport styled from 'styled-components';\nimport { useOrderDetails } from '../../../../store';\nimport { handleKeyDown } from '../../../../utils';\n\nfunction Latitude() {\n const [orderDetails, setOrderDetails] = useOrderDetails();\n const orderRecipient = orderDetails?.order_recipient;\n\n const onChange = (e: React.ChangeEvent<HTMLInputElement>) => {\n const val = e.target.value;\n const updatedOrderRecipient = {\n ...(orderRecipient === null\n ? { latitude: val }\n : { ...orderRecipient, latitude: val }),\n };\n setOrderDetails(prev => ({\n ...prev,\n order_recipient: updatedOrderRecipient,\n }));\n };\n\n return (\n <Container>\n <Label label=\"Latitude\" htmlFor=\"lat\" />\n <CustomInput\n name=\"lat\"\n type=\"number\"\n placeholder=\"Latitude\"\n onKeyDown={handleKeyDown}\n value={orderRecipient?.latitude || ''}\n onChange={onChange}\n readOnly\n />\n </Container>\n );\n}\n\nconst CustomInput = styled(Input)`\n width: 100%;\n &::-webkit-outer-spin-button,\n &::-webkit-inner-spin-button {\n -webkit-appearance: none;\n margin: 0;\n }\n &:focus-visible {\n outline: none;\n }\n opacity: 0.8;\n background-color: #f4f4f4;\n pointer-events: none;\n`;\n\nconst Container = styled.div`\n display: flex;\n flex-direction: column;\n gap: 6px;\n flex: 1;\n`;\n\nexport default Latitude;\n"],"names":["Latitude","orderDetails","setOrderDetails","useOrderDetails","orderRecipient","onChange","e","val","updatedOrderRecipient","prev","Container","jsx","Label","CustomInput","handleKeyDown","styled","Input"],"mappings":";;;;;AAMA,SAASA,IAAW;AAClB,QAAM,CAACC,GAAcC,CAAe,IAAIC,EAAA,GAClCC,IAAiBH,GAAc,iBAE/BI,IAAW,CAACC,MAA2C;AAC3D,UAAMC,IAAMD,EAAE,OAAO,OACfE,IAAwB;AAAA,MAC5B,GAAIJ,MAAmB,OACnB,EAAE,UAAUG,EAAA,IACZ,EAAE,GAAGH,GAAgB,UAAUG,EAAA;AAAA,IAAI;AAEzC,IAAAL,EAAgB,CAAAO,OAAS;AAAA,MACvB,GAAGA;AAAA,MACH,iBAAiBD;AAAA,IAAA,EACjB;AAAA,EACJ;AAEA,2BACGE,GAAA,EACC,UAAA;AAAA,IAAA,gBAAAC,EAACC,GAAA,EAAM,OAAM,YAAW,SAAQ,OAAM;AAAA,IACtC,gBAAAD;AAAA,MAACE;AAAA,MAAA;AAAA,QACC,MAAK;AAAA,QACL,MAAK;AAAA,QACL,aAAY;AAAA,QACZ,WAAWC;AAAA,QACX,OAAOV,GAAgB,YAAY;AAAA,QACnC,UAAAC;AAAA,QACA,UAAQ;AAAA,MAAA;AAAA,IAAA;AAAA,EACV,GACF;AAEJ;AAEA,MAAMQ,IAAcE,EAAOC,CAAK;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,GAe1BN,IAAYK,EAAO;AAAA;AAAA;AAAA;AAAA;AAAA;"}
|
|
@@ -1,33 +1,35 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { Input as s, Label as
|
|
3
|
-
import
|
|
4
|
-
import { useOrderDetails as
|
|
5
|
-
import { handleKeyDown as
|
|
6
|
-
function
|
|
7
|
-
const [
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
1
|
+
import { jsxs as p, jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { Input as s, Label as c } from "@bjsdistribution/dms-component-library";
|
|
3
|
+
import o from "styled-components";
|
|
4
|
+
import { useOrderDetails as m } from "../../../../store.js";
|
|
5
|
+
import { handleKeyDown as f } from "../../../../utils.js";
|
|
6
|
+
function D() {
|
|
7
|
+
const [r, i] = m(), e = r?.order_recipient, l = (u) => {
|
|
8
|
+
const n = u.target.value, a = {
|
|
9
|
+
...e === null ? { longitude: n } : { ...e, longitude: n }
|
|
10
|
+
};
|
|
11
|
+
i((d) => ({
|
|
12
|
+
...d,
|
|
13
|
+
order_recipient: a
|
|
12
14
|
}));
|
|
13
15
|
};
|
|
14
|
-
return /* @__PURE__ */
|
|
15
|
-
/* @__PURE__ */
|
|
16
|
-
/* @__PURE__ */
|
|
17
|
-
|
|
16
|
+
return /* @__PURE__ */ p(b, { children: [
|
|
17
|
+
/* @__PURE__ */ t(c, { label: "Longitude", htmlFor: "long" }),
|
|
18
|
+
/* @__PURE__ */ t(
|
|
19
|
+
g,
|
|
18
20
|
{
|
|
19
21
|
name: "long",
|
|
20
22
|
type: "number",
|
|
21
23
|
placeholder: "Longitude",
|
|
22
|
-
onKeyDown:
|
|
23
|
-
value:
|
|
24
|
-
onChange:
|
|
24
|
+
onKeyDown: f,
|
|
25
|
+
value: e?.longitude || "",
|
|
26
|
+
onChange: l,
|
|
25
27
|
readOnly: !0
|
|
26
28
|
}
|
|
27
29
|
)
|
|
28
30
|
] });
|
|
29
31
|
}
|
|
30
|
-
const
|
|
32
|
+
const g = o(s)`
|
|
31
33
|
width: 100%;
|
|
32
34
|
&::-webkit-outer-spin-button,
|
|
33
35
|
&::-webkit-inner-spin-button {
|
|
@@ -40,13 +42,13 @@ const c = n(s)`
|
|
|
40
42
|
opacity: 0.8;
|
|
41
43
|
background-color: #f4f4f4;
|
|
42
44
|
pointer-events: none;
|
|
43
|
-
`,
|
|
45
|
+
`, b = o.div`
|
|
44
46
|
display: flex;
|
|
45
47
|
flex-direction: column;
|
|
46
48
|
gap: 6px;
|
|
47
49
|
flex: 1;
|
|
48
50
|
`;
|
|
49
51
|
export {
|
|
50
|
-
|
|
52
|
+
D as default
|
|
51
53
|
};
|
|
52
54
|
//# sourceMappingURL=Longitude.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Longitude.js","sources":["../../../../../../../src/components/order-view/order-details/expanded-content/customer-section/location-info/Longitude.tsx"],"sourcesContent":["import { Input, Label } from '@bjsdistribution/dms-component-library';\nimport React from 'react';\nimport styled from 'styled-components';\nimport { useOrderDetails } from '../../../../store';\nimport { handleKeyDown } from '../../../../utils';\n\nfunction Longitude() {\n const [orderDetails, setOrderDetails] = useOrderDetails();\n\n const onChange = (e: React.ChangeEvent<HTMLInputElement>) => {\n const val = e.target.value;\n setOrderDetails(prev => {\n return {\n ...prev,\n
|
|
1
|
+
{"version":3,"file":"Longitude.js","sources":["../../../../../../../src/components/order-view/order-details/expanded-content/customer-section/location-info/Longitude.tsx"],"sourcesContent":["import { Input, Label } from '@bjsdistribution/dms-component-library';\nimport React from 'react';\nimport styled from 'styled-components';\nimport { useOrderDetails } from '../../../../store';\nimport { handleKeyDown } from '../../../../utils';\n\nfunction Longitude() {\n const [orderDetails, setOrderDetails] = useOrderDetails();\n const orderRecipient = orderDetails?.order_recipient;\n\n const onChange = (e: React.ChangeEvent<HTMLInputElement>) => {\n const val = e.target.value;\n const updatedOrderRecipient = {\n ...(orderRecipient === null\n ? { longitude: val }\n : { ...orderRecipient, longitude: val }),\n };\n setOrderDetails(prev => {\n return {\n ...prev,\n order_recipient: updatedOrderRecipient,\n };\n });\n };\n return (\n <Container>\n <Label label=\"Longitude\" htmlFor=\"long\" />\n <CustomInput\n name=\"long\"\n type=\"number\"\n placeholder=\"Longitude\"\n onKeyDown={handleKeyDown}\n value={orderRecipient?.longitude || ''}\n onChange={onChange}\n readOnly\n />\n </Container>\n );\n}\n\nconst CustomInput = styled(Input)`\n width: 100%;\n &::-webkit-outer-spin-button,\n &::-webkit-inner-spin-button {\n -webkit-appearance: none;\n margin: 0;\n }\n &:focus-visible {\n outline: none;\n }\n opacity: 0.8;\n background-color: #f4f4f4;\n pointer-events: none;\n`;\n\nconst Container = styled.div`\n display: flex;\n flex-direction: column;\n gap: 6px;\n flex: 1;\n`;\n\nexport default Longitude;\n"],"names":["Longitude","orderDetails","setOrderDetails","useOrderDetails","orderRecipient","onChange","e","val","updatedOrderRecipient","prev","Container","jsx","Label","CustomInput","handleKeyDown","styled","Input"],"mappings":";;;;;AAMA,SAASA,IAAY;AACnB,QAAM,CAACC,GAAcC,CAAe,IAAIC,EAAA,GAClCC,IAAiBH,GAAc,iBAE/BI,IAAW,CAACC,MAA2C;AAC3D,UAAMC,IAAMD,EAAE,OAAO,OACfE,IAAwB;AAAA,MAC5B,GAAIJ,MAAmB,OACnB,EAAE,WAAWG,EAAA,IACb,EAAE,GAAGH,GAAgB,WAAWG,EAAA;AAAA,IAAI;AAE1C,IAAAL,EAAgB,CAAAO,OACP;AAAA,MACL,GAAGA;AAAA,MACH,iBAAiBD;AAAA,IAAA,EAEpB;AAAA,EACH;AACA,2BACGE,GAAA,EACC,UAAA;AAAA,IAAA,gBAAAC,EAACC,GAAA,EAAM,OAAM,aAAY,SAAQ,QAAO;AAAA,IACxC,gBAAAD;AAAA,MAACE;AAAA,MAAA;AAAA,QACC,MAAK;AAAA,QACL,MAAK;AAAA,QACL,aAAY;AAAA,QACZ,WAAWC;AAAA,QACX,OAAOV,GAAgB,aAAa;AAAA,QACpC,UAAAC;AAAA,QACA,UAAQ;AAAA,MAAA;AAAA,IAAA;AAAA,EACV,GACF;AAEJ;AAEA,MAAMQ,IAAcE,EAAOC,CAAK;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,GAe1BN,IAAYK,EAAO;AAAA;AAAA;AAAA;AAAA;AAAA;"}
|