@bjsdistribution/dms-client-return 0.1.98-prod → 0.1.99-prod
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/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/location-info/Latitude.js +21 -23
- 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 +21 -23
- package/dist/components/order-view/order-details/expanded-content/customer-section/location-info/Longitude.js.map +1 -1
- package/dist/components/order-view/store.js +2 -2
- package/dist/components/order-view/store.js.map +1 -1
- package/dist/types/components/order-view/types.d.ts +2 -2
- package/dist/types/components/order-view/utils.d.ts +2 -0
- package/package.json +1 -1
|
@@ -1,143 +1,143 @@
|
|
|
1
|
-
import { jsxs as
|
|
1
|
+
import { jsxs as a, jsx as o } from "react/jsx-runtime";
|
|
2
2
|
import { useState as s, useEffect as C } from "react";
|
|
3
|
-
import { useCurrentAction as
|
|
4
|
-
import
|
|
3
|
+
import { useCurrentAction as V, useOrderDetails as B, usePrevOrderDetails as Q, useCustomerInfo as q } from "../../../store.js";
|
|
4
|
+
import J from "../../../../../common/modals/order-action-modal/OrderActionModal.js";
|
|
5
5
|
import { notification as L } from "antd";
|
|
6
|
-
import { useAxios as
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import { compareOrderDetailsStates as
|
|
10
|
-
import { useClientPortal as
|
|
11
|
-
function ge(
|
|
12
|
-
const
|
|
6
|
+
import { useAxios as _, Label as u } from "@bjsdistribution/dms-component-library";
|
|
7
|
+
import n from "styled-components";
|
|
8
|
+
import N from "../../../../../common/custom-input/CustomInput.js";
|
|
9
|
+
import { compareOrderDetailsStates as X } from "../../../utils.js";
|
|
10
|
+
import { useClientPortal as Y } from "../../../../store.js";
|
|
11
|
+
function ge($) {
|
|
12
|
+
const A = /^\/{0,}[^0-9`~!@#$%^&*()+\-_=[{\]}\\|'<,.>?/";:£§º©®\s]{1,}[・.。][^0-9`~!@#$%^&*()+\-_=[{\]}\\|'<,.>?/";:£§º©®\s]{1,}[・.。][^0-9`~!@#$%^&*()+\-_=[{\]}\\|'<,.>?/";:£§º©®\s]{1,}$/, [, I] = V(), [t, f] = B(), [g, P] = Q(), [h] = q(), [l, w] = s(""), [x] = Y(), [v, T] = s(), [d, k] = s(""), [c, W] = s(t?.latitude || ""), [p, y] = s(t?.longitude || ""), b = () => I(void 0), E = (e) => e.replace(/^\/+/, ""), F = (e) => {
|
|
13
13
|
if (e.trim()) {
|
|
14
|
-
const
|
|
15
|
-
|
|
16
|
-
|
|
14
|
+
const i = A.test(e);
|
|
15
|
+
w(
|
|
16
|
+
i ? "" : "Please enter a valid input (format: word.word.word)"
|
|
17
17
|
);
|
|
18
18
|
} else
|
|
19
|
-
|
|
19
|
+
w("Input cannot be empty or only spaces");
|
|
20
|
+
}, R = (e) => {
|
|
21
|
+
const i = e.target.value, r = E(i);
|
|
22
|
+
F(i), k(r);
|
|
20
23
|
}, U = (e) => {
|
|
21
|
-
|
|
22
|
-
R(d), E(n);
|
|
24
|
+
W(e.target.value);
|
|
23
25
|
}, j = (e) => {
|
|
24
26
|
y(e.target.value);
|
|
25
|
-
}, K = (e) => {
|
|
26
|
-
b(e.target.value);
|
|
27
27
|
}, D = (e) => {
|
|
28
28
|
["e", "E", "+", "-"].includes(e.key) && e.preventDefault();
|
|
29
|
-
}, { fetchData:
|
|
29
|
+
}, { fetchData: K } = _({
|
|
30
30
|
endpoint: "/orders/update/",
|
|
31
31
|
method: "PUT"
|
|
32
|
-
}), { fetchData:
|
|
32
|
+
}), { fetchData: M } = _({
|
|
33
33
|
endpoint: "/v1/orders/coordinates_to_w3w/?",
|
|
34
34
|
method: "GET"
|
|
35
35
|
});
|
|
36
36
|
C(() => {
|
|
37
|
-
|
|
38
|
-
endPointQuery: `latitude=${
|
|
37
|
+
t?.latitude && t?.longitude && M({
|
|
38
|
+
endPointQuery: `latitude=${t?.latitude}&longitude=${t?.longitude}`
|
|
39
39
|
}).then((e) => {
|
|
40
|
-
console.log(e?.data),
|
|
40
|
+
console.log(e?.data), T(e?.data?.words);
|
|
41
41
|
});
|
|
42
42
|
}, [
|
|
43
|
-
|
|
44
|
-
|
|
43
|
+
t?.latitude,
|
|
44
|
+
t?.longitude
|
|
45
45
|
]);
|
|
46
|
-
const
|
|
46
|
+
const z = async () => {
|
|
47
47
|
const e = {
|
|
48
|
-
...
|
|
48
|
+
...t,
|
|
49
|
+
latitude: c,
|
|
50
|
+
longitude: p,
|
|
49
51
|
order_recipient: {
|
|
50
|
-
...
|
|
51
|
-
what_3words_address:
|
|
52
|
-
latitude: p,
|
|
53
|
-
longitude: u
|
|
52
|
+
...t?.order_recipient || {},
|
|
53
|
+
what_3words_address: d
|
|
54
54
|
}
|
|
55
|
-
},
|
|
55
|
+
}, i = X(
|
|
56
56
|
g,
|
|
57
57
|
e
|
|
58
58
|
);
|
|
59
|
-
let
|
|
60
|
-
payload: [
|
|
59
|
+
let r = await K({
|
|
60
|
+
payload: [i]
|
|
61
61
|
});
|
|
62
|
-
|
|
62
|
+
r.code === 200 && r?.data?.length > 0 ? (L.success({
|
|
63
63
|
message: "Success",
|
|
64
|
-
description: `${
|
|
65
|
-
}), await
|
|
64
|
+
description: `${r?.message}`
|
|
65
|
+
}), await $?.callOrdersApi(), f(r?.data[0]), P(r?.data[0]), b()) : (L.error({
|
|
66
66
|
message: "Update Failed",
|
|
67
|
-
description:
|
|
68
|
-
}),
|
|
69
|
-
},
|
|
70
|
-
const e =
|
|
71
|
-
return
|
|
67
|
+
description: r?.error || "Unknown error"
|
|
68
|
+
}), f(g));
|
|
69
|
+
}, G = `${h?.recipient_name}, ${h?.postcode}`, H = () => {
|
|
70
|
+
const e = t?.order_recipient || {};
|
|
71
|
+
return d !== (e.what_3words_address || "") || c !== (t?.latitude || "") || p !== (t?.longitude || "");
|
|
72
72
|
};
|
|
73
73
|
return C(() => {
|
|
74
|
-
|
|
75
|
-
}, [
|
|
76
|
-
|
|
74
|
+
W(t?.latitude || ""), y(t?.longitude || "");
|
|
75
|
+
}, [t?.latitude, t?.longitude]), /* @__PURE__ */ a(
|
|
76
|
+
J,
|
|
77
77
|
{
|
|
78
78
|
headerTitle: "WHAT3WORDS",
|
|
79
|
-
onCloseHeader:
|
|
80
|
-
onSubmit:
|
|
79
|
+
onCloseHeader: b,
|
|
80
|
+
onSubmit: z,
|
|
81
81
|
showAdditionalInfo: !0,
|
|
82
|
-
infoText:
|
|
83
|
-
isSubmitDisabled:
|
|
82
|
+
infoText: G,
|
|
83
|
+
isSubmitDisabled: x ? !0 : !H() || !!l,
|
|
84
84
|
submitBtnTitle: "Save Details",
|
|
85
85
|
children: [
|
|
86
|
-
/* @__PURE__ */
|
|
87
|
-
/* @__PURE__ */
|
|
88
|
-
/* @__PURE__ */
|
|
89
|
-
/* @__PURE__ */
|
|
90
|
-
|
|
86
|
+
/* @__PURE__ */ o(O, { children: /* @__PURE__ */ o(ne, { children: /* @__PURE__ */ a(Z, { children: [
|
|
87
|
+
/* @__PURE__ */ o(u, { label: "Words" }),
|
|
88
|
+
/* @__PURE__ */ a(ee, { children: [
|
|
89
|
+
/* @__PURE__ */ o(
|
|
90
|
+
m,
|
|
91
91
|
{
|
|
92
92
|
name: "w3w",
|
|
93
93
|
type: "text",
|
|
94
94
|
placeholder: "Format: word.word.word",
|
|
95
|
-
value:
|
|
96
|
-
onChange:
|
|
97
|
-
disabled:
|
|
95
|
+
value: d,
|
|
96
|
+
onChange: R,
|
|
97
|
+
disabled: x
|
|
98
98
|
}
|
|
99
99
|
),
|
|
100
|
-
l && /* @__PURE__ */
|
|
100
|
+
l && /* @__PURE__ */ o(oe, { children: l })
|
|
101
101
|
] }),
|
|
102
|
-
/* @__PURE__ */
|
|
103
|
-
/* @__PURE__ */
|
|
102
|
+
/* @__PURE__ */ a(te, { children: [
|
|
103
|
+
/* @__PURE__ */ o("strong", { children: "Current:" }),
|
|
104
104
|
" ",
|
|
105
|
-
/* @__PURE__ */
|
|
105
|
+
/* @__PURE__ */ o(
|
|
106
106
|
"a",
|
|
107
107
|
{
|
|
108
|
-
href: `https://what3words.com/${
|
|
108
|
+
href: `https://what3words.com/${v}`,
|
|
109
109
|
target: "_blank",
|
|
110
110
|
rel: "noopener noreferrer",
|
|
111
|
-
children:
|
|
111
|
+
children: v
|
|
112
112
|
}
|
|
113
113
|
)
|
|
114
114
|
] })
|
|
115
115
|
] }) }) }),
|
|
116
|
-
/* @__PURE__ */
|
|
117
|
-
/* @__PURE__ */
|
|
118
|
-
/* @__PURE__ */
|
|
119
|
-
/* @__PURE__ */
|
|
120
|
-
|
|
116
|
+
/* @__PURE__ */ o(O, { children: /* @__PURE__ */ a(re, { children: [
|
|
117
|
+
/* @__PURE__ */ a(S, { children: [
|
|
118
|
+
/* @__PURE__ */ o(u, { label: "Latitude", htmlFor: "lat" }),
|
|
119
|
+
/* @__PURE__ */ o(
|
|
120
|
+
m,
|
|
121
121
|
{
|
|
122
122
|
name: "lat",
|
|
123
123
|
type: "number",
|
|
124
124
|
placeholder: "Lat",
|
|
125
|
-
value:
|
|
126
|
-
onChange:
|
|
125
|
+
value: c,
|
|
126
|
+
onChange: U,
|
|
127
127
|
onKeyDown: D
|
|
128
128
|
}
|
|
129
129
|
)
|
|
130
130
|
] }),
|
|
131
|
-
/* @__PURE__ */
|
|
132
|
-
/* @__PURE__ */
|
|
133
|
-
/* @__PURE__ */
|
|
134
|
-
|
|
131
|
+
/* @__PURE__ */ a(S, { children: [
|
|
132
|
+
/* @__PURE__ */ o(u, { label: "Longitude", htmlFor: "long" }),
|
|
133
|
+
/* @__PURE__ */ o(
|
|
134
|
+
m,
|
|
135
135
|
{
|
|
136
136
|
name: "long",
|
|
137
137
|
type: "number",
|
|
138
138
|
placeholder: "Long",
|
|
139
|
-
value:
|
|
140
|
-
onChange:
|
|
139
|
+
value: p,
|
|
140
|
+
onChange: j,
|
|
141
141
|
onKeyDown: D
|
|
142
142
|
}
|
|
143
143
|
)
|
|
@@ -147,17 +147,17 @@ function ge(A) {
|
|
|
147
147
|
}
|
|
148
148
|
);
|
|
149
149
|
}
|
|
150
|
-
const
|
|
150
|
+
const Z = n.div`
|
|
151
151
|
display: flex;
|
|
152
152
|
flex-direction: row;
|
|
153
153
|
gap: 15px;
|
|
154
154
|
align-items: center;
|
|
155
|
-
`,
|
|
155
|
+
`, ee = n.div`
|
|
156
156
|
display: flex;
|
|
157
157
|
flex-direction: column;
|
|
158
158
|
gap: 4px;
|
|
159
159
|
width: 100%;
|
|
160
|
-
`,
|
|
160
|
+
`, te = n.div`
|
|
161
161
|
font-size: 13px;
|
|
162
162
|
color: #444;
|
|
163
163
|
white-space: nowrap;
|
|
@@ -170,30 +170,30 @@ const ee = r.div`
|
|
|
170
170
|
a:hover {
|
|
171
171
|
text-decoration: underline;
|
|
172
172
|
}
|
|
173
|
-
`,
|
|
173
|
+
`, oe = n.span`
|
|
174
174
|
color: red;
|
|
175
175
|
font-size: 0.85rem;
|
|
176
176
|
margin-top: 4px;
|
|
177
|
-
`,
|
|
177
|
+
`, O = n.div`
|
|
178
178
|
padding: 15px;
|
|
179
179
|
display: flex;
|
|
180
180
|
flex-direction: column;
|
|
181
181
|
gap: 16px;
|
|
182
|
-
`, ne =
|
|
182
|
+
`, ne = n.div`
|
|
183
183
|
display: flex;
|
|
184
184
|
align-items: center;
|
|
185
185
|
gap: 10px;
|
|
186
186
|
flex-wrap: wrap;
|
|
187
|
-
`,
|
|
187
|
+
`, re = n.div`
|
|
188
188
|
display: flex;
|
|
189
189
|
justify-content: space-between;
|
|
190
190
|
gap: 14px;
|
|
191
|
-
`,
|
|
191
|
+
`, S = n.div`
|
|
192
192
|
flex: 1;
|
|
193
193
|
display: flex;
|
|
194
194
|
flex-direction: column;
|
|
195
195
|
gap: 5px;
|
|
196
|
-
`,
|
|
196
|
+
`, m = n(N)`
|
|
197
197
|
width: 100%;
|
|
198
198
|
&::-webkit-outer-spin-button,
|
|
199
199
|
&::-webkit-inner-spin-button {
|
package/dist/components/order-view/order-actions/actions/what3words/What3WordsModal.tsx.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"What3WordsModal.tsx.js","sources":["../../../../../../src/components/order-view/order-actions/actions/what3words/What3WordsModal.tsx.tsx"],"sourcesContent":["import React, { useEffect, useState } from 'react';\nimport {\n useCurrentAction,\n useCustomerInfo,\n useOrderDetails,\n usePrevOrderDetails,\n} from '../../../store';\nimport OrderActionModal from '../../../../../common/modals/order-action-modal/OrderActionModal';\nimport { notification } from 'antd';\nimport { Label, useAxios } from '@bjsdistribution/dms-component-library';\nimport styled from 'styled-components';\nimport GenericInput from '../../../../../common/custom-input/CustomInput';\nimport { compareOrderDetailsStates } from '../../../utils';\nimport { ApiResponse } from '../../../types';\nimport { useClientPortal } from '../../../../store';\n\nfunction What3WordsModal(props: any) {\n const w3wRegex = /^\\/{0,}[^0-9`~!@#$%^&*()+\\-_=[{\\]}\\\\|'<,.>?/\";:£§º©®\\s]{1,}[・.。][^0-9`~!@#$%^&*()+\\-_=[{\\]}\\\\|'<,.>?/\";:£§º©®\\s]{1,}[・.。][^0-9`~!@#$%^&*()+\\-_=[{\\]}\\\\|'<,.>?/\";:£§º©®\\s]{1,}$/;\n const [, setCurrentAction] = useCurrentAction();\n const [orderDetails, setOrderDetails] = useOrderDetails();\n const [prevOrderDetails, setPrevOrderDetails] = usePrevOrderDetails();\n const [customerInfo] = useCustomerInfo();\n const [w3wError, setW3wError] = useState('');\n const [isClientPortal] = useClientPortal();\n const orderRecipient = orderDetails?.order_recipient || {};\n const [currentWhat3Words, setWhat3Words] = useState();\n const [localW3W, setLocalW3W] = useState('');\n const [localLat, setLocalLat] = useState(orderRecipient?.latitude || '');\n const [localLong, setLocalLong] = useState(orderRecipient?.longitude || '');\n\n const closeModal = () => setCurrentAction(undefined);\n\n const cleanW3WAddress = (w3wStr: string) => {\n return w3wStr.replace(/^\\/+/, '');\n };\n\n const validateInput = (value: string) => {\n if (value.trim()) {\n const isValid = w3wRegex.test(value);\n setW3wError(\n isValid ? '' : 'Please enter a valid input (format: word.word.word)'\n );\n } else {\n setW3wError('Input cannot be empty or only spaces');\n }\n };\n\n const onChangeW3W = (e: React.ChangeEvent<HTMLInputElement>) => {\n const rawVal = e.target.value;\n const val = cleanW3WAddress(rawVal);\n validateInput(rawVal); // still validate raw input for dots, etc.\n setLocalW3W(val);\n };\n\n const onChangeLatitude = (e: React.ChangeEvent<HTMLInputElement>) => {\n setLocalLat(e.target.value);\n };\n\n const onChangeLongitude = (e: React.ChangeEvent<HTMLInputElement>) => {\n setLocalLong(e.target.value);\n };\n\n const handleKeyDown = (e: React.KeyboardEvent<HTMLInputElement>) => {\n if (['e', 'E', '+', '-'].includes(e.key)) {\n e.preventDefault();\n }\n };\n\n const { fetchData: callUpdateOrderAPI } = useAxios<{\n data: ApiResponse[];\n }>({\n endpoint: `/orders/update/`,\n method: 'PUT',\n });\n\n const { fetchData: getWhat3Words } = useAxios<{\n data: ApiResponse[];\n }>({\n endpoint: `/v1/orders/coordinates_to_w3w/?`,\n method: 'GET',\n });\n\n useEffect(() => {\n if (\n orderDetails?.order_recipient?.latitude &&\n orderDetails?.order_recipient?.longitude\n ) {\n getWhat3Words({\n endPointQuery: `latitude=${orderDetails?.order_recipient?.latitude}&longitude=${orderDetails?.order_recipient?.longitude}`,\n }).then((response: any) => {\n console.log(response?.data);\n setWhat3Words(response?.data?.words);\n });\n }\n }, [\n orderDetails?.order_recipient?.latitude,\n orderDetails?.order_recipient?.longitude,\n ]);\n\n const onSave = async () => {\n const updatedOrderDetails = {\n ...orderDetails,\n order_recipient: {\n ...(orderDetails?.order_recipient || {}),\n what_3words_address: localW3W,\n latitude: localLat,\n longitude: localLong,\n },\n };\n\n const payload = compareOrderDetailsStates(\n prevOrderDetails,\n updatedOrderDetails\n );\n\n let response = (await callUpdateOrderAPI({\n payload: [payload],\n })) as {\n code: number | null;\n error?: string | null | undefined;\n [key: string]: any;\n };\n\n if (response.code === 200 && response?.data?.length > 0) {\n notification.success({\n message: 'Success',\n description: `${response?.message}`,\n });\n\n await props?.callOrdersApi();\n setOrderDetails(response?.data[0]);\n setPrevOrderDetails(response?.data[0]);\n closeModal();\n } else {\n notification.error({\n message: 'Update Failed',\n description: response?.error || 'Unknown error',\n });\n\n setOrderDetails(prevOrderDetails);\n }\n };\n\n const infoText = `${customerInfo?.recipient_name}, ${customerInfo?.postcode}`;\n\n const isDifferent = () => {\n const original = orderRecipient || {};\n return (\n localW3W !== (original.what_3words_address || '') ||\n localLat !== (original.latitude || '') ||\n localLong !== (original.longitude || '')\n );\n };\n\n useEffect(() => {\n setLocalLat(orderRecipient?.latitude || '');\n setLocalLong(orderRecipient?.longitude || '');\n }, [orderRecipient]);\n\n return (\n <OrderActionModal\n headerTitle=\"WHAT3WORDS\"\n onCloseHeader={closeModal}\n onSubmit={onSave}\n showAdditionalInfo\n infoText={infoText}\n isSubmitDisabled={isClientPortal ? true : !isDifferent() || !!w3wError}\n submitBtnTitle=\"Save Details\"\n >\n <Section>\n <FieldRow>\n <WordsSection>\n <Label label=\"Words\" />\n <WordInputWrapper>\n <CustomInput\n name=\"w3w\"\n type=\"text\"\n placeholder=\"Format: word.word.word\"\n value={localW3W}\n onChange={onChangeW3W}\n disabled={isClientPortal}\n />\n\n {w3wError && <ErrorText>{w3wError}</ErrorText>}\n </WordInputWrapper>\n\n <CurrentText>\n <strong>Current:</strong>{' '}\n <a\n href={`https://what3words.com/${currentWhat3Words}`}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n >\n {currentWhat3Words}\n </a>\n </CurrentText>\n </WordsSection>\n </FieldRow>\n </Section>\n\n <Section>\n <CoordRow>\n <Coordinate>\n <Label label=\"Latitude\" htmlFor=\"lat\" />\n <CustomInput\n name=\"lat\"\n type=\"number\"\n placeholder=\"Lat\"\n value={localLat}\n onChange={onChangeLatitude}\n onKeyDown={handleKeyDown}\n />\n </Coordinate>\n <Coordinate>\n <Label label=\"Longitude\" htmlFor=\"long\" />\n\n <CustomInput\n name=\"long\"\n type=\"number\"\n placeholder=\"Long\"\n value={localLong}\n onChange={onChangeLongitude}\n onKeyDown={handleKeyDown}\n />\n </Coordinate>\n </CoordRow>\n </Section>\n </OrderActionModal>\n );\n}\n\nconst WordsSection = styled.div`\n display: flex;\n flex-direction: row;\n gap: 15px;\n align-items: center;\n`;\n\nconst WordInputWrapper = styled.div`\n display: flex;\n flex-direction: column;\n gap: 4px;\n width: 100%;\n`;\n\nconst CurrentText = styled.div`\n font-size: 13px;\n color: #444;\n white-space: nowrap;\n\n a {\n color: #1677ff;\n text-decoration: none;\n }\n\n a:hover {\n text-decoration: underline;\n }\n`;\n\nconst ErrorText = styled.span`\n color: red;\n font-size: 0.85rem;\n margin-top: 4px;\n`;\n\nconst Section = styled.div`\n padding: 15px;\n display: flex;\n flex-direction: column;\n gap: 16px;\n`;\n\nconst FieldRow = styled.div`\n display: flex;\n align-items: center;\n gap: 10px;\n flex-wrap: wrap;\n`;\n\nconst CoordRow = styled.div`\n display: flex;\n justify-content: space-between;\n gap: 14px;\n`;\n\nconst Coordinate = styled.div`\n flex: 1;\n display: flex;\n flex-direction: column;\n gap: 5px;\n`;\n\nconst CustomInput = styled(GenericInput)`\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`;\n\nexport default What3WordsModal;\n"],"names":["What3WordsModal","props","w3wRegex","setCurrentAction","useCurrentAction","orderDetails","setOrderDetails","useOrderDetails","prevOrderDetails","setPrevOrderDetails","usePrevOrderDetails","customerInfo","useCustomerInfo","w3wError","setW3wError","useState","isClientPortal","useClientPortal","orderRecipient","currentWhat3Words","setWhat3Words","localW3W","setLocalW3W","localLat","setLocalLat","localLong","setLocalLong","closeModal","cleanW3WAddress","w3wStr","validateInput","value","isValid","onChangeW3W","rawVal","val","onChangeLatitude","onChangeLongitude","handleKeyDown","callUpdateOrderAPI","useAxios","getWhat3Words","useEffect","response","onSave","updatedOrderDetails","payload","compareOrderDetailsStates","notification","infoText","isDifferent","original","jsxs","OrderActionModal","jsx","Section","FieldRow","WordsSection","Label","WordInputWrapper","CustomInput","ErrorText","CurrentText","CoordRow","Coordinate","styled","GenericInput"],"mappings":";;;;;;;;;;AAgBA,SAASA,GAAgBC,GAAY;AACnC,QAAMC,IAAW,kLACX,CAAA,EAAGC,CAAgB,IAAIC,EAAA,GACvB,CAACC,GAAcC,CAAe,IAAIC,EAAA,GAClC,CAACC,GAAkBC,CAAmB,IAAIC,EAAA,GAC1C,CAACC,CAAY,IAAIC,EAAA,GACjB,CAACC,GAAUC,CAAW,IAAIC,EAAS,EAAE,GACrC,CAACC,CAAc,IAAIC,EAAA,GACnBC,IAAiBb,GAAc,mBAAmB,CAAA,GAClD,CAACc,GAAmBC,CAAa,IAAIL,EAAA,GACrC,CAACM,GAAUC,CAAW,IAAIP,EAAS,EAAE,GACrC,CAACQ,GAAUC,CAAW,IAAIT,EAASG,GAAgB,YAAY,EAAE,GACjE,CAACO,GAAWC,CAAY,IAAIX,EAASG,GAAgB,aAAa,EAAE,GAEpES,IAAa,MAAMxB,EAAiB,MAAS,GAE7CyB,IAAkB,CAACC,MAChBA,EAAO,QAAQ,QAAQ,EAAE,GAG5BC,IAAgB,CAACC,MAAkB;AACvC,QAAIA,EAAM,QAAQ;AAChB,YAAMC,IAAU9B,EAAS,KAAK6B,CAAK;AACnC,MAAAjB;AAAA,QACEkB,IAAU,KAAK;AAAA,MAAA;AAAA,IAEnB;AACE,MAAAlB,EAAY,sCAAsC;AAAA,EAEtD,GAEMmB,IAAc,CAAC,MAA2C;AAC9D,UAAMC,IAAS,EAAE,OAAO,OAClBC,IAAMP,EAAgBM,CAAM;AAClC,IAAAJ,EAAcI,CAAM,GACpBZ,EAAYa,C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;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAGN;AAEA,MAAMmB,KAAeQ,EAAO;AAAA;AAAA;AAAA;AAAA;AAAA,GAOtBN,KAAmBM,EAAO;AAAA;AAAA;AAAA;AAAA;AAAA,GAO1BH,KAAcG,EAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,GAerBJ,KAAYI,EAAO;AAAA;AAAA;AAAA;AAAA,GAMnBV,IAAUU,EAAO;AAAA;AAAA;AAAA;AAAA;AAAA,GAOjBT,KAAWS,EAAO;AAAA;AAAA;AAAA;AAAA;AAAA,GAOlBF,KAAWE,EAAO;AAAA;AAAA;AAAA;AAAA,GAMlBD,IAAaC,EAAO;AAAA;AAAA;AAAA;AAAA;AAAA,GAOpBL,IAAcK,EAAOC,CAAY;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;"}
|
|
1
|
+
{"version":3,"file":"What3WordsModal.tsx.js","sources":["../../../../../../src/components/order-view/order-actions/actions/what3words/What3WordsModal.tsx.tsx"],"sourcesContent":["import React, { useEffect, useState } from 'react';\nimport {\n useCurrentAction,\n useCustomerInfo,\n useOrderDetails,\n usePrevOrderDetails,\n} from '../../../store';\nimport OrderActionModal from '../../../../../common/modals/order-action-modal/OrderActionModal';\nimport { notification } from 'antd';\nimport { Label, useAxios } from '@bjsdistribution/dms-component-library';\nimport styled from 'styled-components';\nimport GenericInput from '../../../../../common/custom-input/CustomInput';\nimport { compareOrderDetailsStates } from '../../../utils';\nimport { ApiResponse } from '../../../types';\nimport { useClientPortal } from '../../../../store';\n\nfunction What3WordsModal(props: any) {\n const w3wRegex = /^\\/{0,}[^0-9`~!@#$%^&*()+\\-_=[{\\]}\\\\|'<,.>?/\";:£§º©®\\s]{1,}[・.。][^0-9`~!@#$%^&*()+\\-_=[{\\]}\\\\|'<,.>?/\";:£§º©®\\s]{1,}[・.。][^0-9`~!@#$%^&*()+\\-_=[{\\]}\\\\|'<,.>?/\";:£§º©®\\s]{1,}$/;\n const [, setCurrentAction] = useCurrentAction();\n const [orderDetails, setOrderDetails] = useOrderDetails();\n const [prevOrderDetails, setPrevOrderDetails] = usePrevOrderDetails();\n const [customerInfo] = useCustomerInfo();\n const [w3wError, setW3wError] = useState('');\n const [isClientPortal] = useClientPortal();\n const [currentWhat3Words, setWhat3Words] = useState();\n const [localW3W, setLocalW3W] = useState('');\n const [localLat, setLocalLat] = useState(orderDetails?.latitude || '');\n const [localLong, setLocalLong] = useState(orderDetails?.longitude || '');\n\n const closeModal = () => setCurrentAction(undefined);\n\n const cleanW3WAddress = (w3wStr: string) => {\n return w3wStr.replace(/^\\/+/, '');\n };\n\n const validateInput = (value: string) => {\n if (value.trim()) {\n const isValid = w3wRegex.test(value);\n setW3wError(\n isValid ? '' : 'Please enter a valid input (format: word.word.word)'\n );\n } else {\n setW3wError('Input cannot be empty or only spaces');\n }\n };\n\n const onChangeW3W = (e: React.ChangeEvent<HTMLInputElement>) => {\n const rawVal = e.target.value;\n const val = cleanW3WAddress(rawVal);\n validateInput(rawVal); // still validate raw input for dots, etc.\n setLocalW3W(val);\n };\n\n const onChangeLatitude = (e: React.ChangeEvent<HTMLInputElement>) => {\n setLocalLat(e.target.value);\n };\n\n const onChangeLongitude = (e: React.ChangeEvent<HTMLInputElement>) => {\n setLocalLong(e.target.value);\n };\n\n const handleKeyDown = (e: React.KeyboardEvent<HTMLInputElement>) => {\n if (['e', 'E', '+', '-'].includes(e.key)) {\n e.preventDefault();\n }\n };\n\n const { fetchData: callUpdateOrderAPI } = useAxios<{\n data: ApiResponse[];\n }>({\n endpoint: `/orders/update/`,\n method: 'PUT',\n });\n\n const { fetchData: getWhat3Words } = useAxios<{\n data: ApiResponse[];\n }>({\n endpoint: `/v1/orders/coordinates_to_w3w/?`,\n method: 'GET',\n });\n\n useEffect(() => {\n if (\n orderDetails?.latitude &&\n orderDetails?.longitude\n ) {\n getWhat3Words({\n endPointQuery: `latitude=${orderDetails?.latitude}&longitude=${orderDetails?.longitude}`,\n }).then((response: any) => {\n console.log(response?.data);\n setWhat3Words(response?.data?.words);\n });\n }\n }, [\n orderDetails?.latitude,\n orderDetails?.longitude,\n ]);\n\n const onSave = async () => {\n const updatedOrderDetails = {\n ...orderDetails,\n latitude: localLat,\n longitude: localLong,\n order_recipient: {\n ...(orderDetails?.order_recipient || {}),\n what_3words_address: localW3W,\n },\n };\n\n const payload = compareOrderDetailsStates(\n prevOrderDetails,\n updatedOrderDetails\n );\n\n let response = (await callUpdateOrderAPI({\n payload: [payload],\n })) as {\n code: number | null;\n error?: string | null | undefined;\n [key: string]: any;\n };\n\n if (response.code === 200 && response?.data?.length > 0) {\n notification.success({\n message: 'Success',\n description: `${response?.message}`,\n });\n\n await props?.callOrdersApi();\n setOrderDetails(response?.data[0]);\n setPrevOrderDetails(response?.data[0]);\n closeModal();\n } else {\n notification.error({\n message: 'Update Failed',\n description: response?.error || 'Unknown error',\n });\n\n setOrderDetails(prevOrderDetails);\n }\n };\n\n const infoText = `${customerInfo?.recipient_name}, ${customerInfo?.postcode}`;\n\n const isDifferent = () => {\n const originalRecipient = orderDetails?.order_recipient || {};\n return (\n localW3W !== (originalRecipient.what_3words_address || '') ||\n localLat !== (orderDetails?.latitude || '') ||\n localLong !== (orderDetails?.longitude || '')\n );\n };\n\n useEffect(() => {\n setLocalLat(orderDetails?.latitude || '');\n setLocalLong(orderDetails?.longitude || '');\n }, [orderDetails?.latitude, orderDetails?.longitude]);\n\n return (\n <OrderActionModal\n headerTitle=\"WHAT3WORDS\"\n onCloseHeader={closeModal}\n onSubmit={onSave}\n showAdditionalInfo\n infoText={infoText}\n isSubmitDisabled={isClientPortal ? true : !isDifferent() || !!w3wError}\n submitBtnTitle=\"Save Details\"\n >\n <Section>\n <FieldRow>\n <WordsSection>\n <Label label=\"Words\" />\n <WordInputWrapper>\n <CustomInput\n name=\"w3w\"\n type=\"text\"\n placeholder=\"Format: word.word.word\"\n value={localW3W}\n onChange={onChangeW3W}\n disabled={isClientPortal}\n />\n\n {w3wError && <ErrorText>{w3wError}</ErrorText>}\n </WordInputWrapper>\n\n <CurrentText>\n <strong>Current:</strong>{' '}\n <a\n href={`https://what3words.com/${currentWhat3Words}`}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n >\n {currentWhat3Words}\n </a>\n </CurrentText>\n </WordsSection>\n </FieldRow>\n </Section>\n\n <Section>\n <CoordRow>\n <Coordinate>\n <Label label=\"Latitude\" htmlFor=\"lat\" />\n <CustomInput\n name=\"lat\"\n type=\"number\"\n placeholder=\"Lat\"\n value={localLat}\n onChange={onChangeLatitude}\n onKeyDown={handleKeyDown}\n />\n </Coordinate>\n <Coordinate>\n <Label label=\"Longitude\" htmlFor=\"long\" />\n\n <CustomInput\n name=\"long\"\n type=\"number\"\n placeholder=\"Long\"\n value={localLong}\n onChange={onChangeLongitude}\n onKeyDown={handleKeyDown}\n />\n </Coordinate>\n </CoordRow>\n </Section>\n </OrderActionModal>\n );\n}\n\nconst WordsSection = styled.div`\n display: flex;\n flex-direction: row;\n gap: 15px;\n align-items: center;\n`;\n\nconst WordInputWrapper = styled.div`\n display: flex;\n flex-direction: column;\n gap: 4px;\n width: 100%;\n`;\n\nconst CurrentText = styled.div`\n font-size: 13px;\n color: #444;\n white-space: nowrap;\n\n a {\n color: #1677ff;\n text-decoration: none;\n }\n\n a:hover {\n text-decoration: underline;\n }\n`;\n\nconst ErrorText = styled.span`\n color: red;\n font-size: 0.85rem;\n margin-top: 4px;\n`;\n\nconst Section = styled.div`\n padding: 15px;\n display: flex;\n flex-direction: column;\n gap: 16px;\n`;\n\nconst FieldRow = styled.div`\n display: flex;\n align-items: center;\n gap: 10px;\n flex-wrap: wrap;\n`;\n\nconst CoordRow = styled.div`\n display: flex;\n justify-content: space-between;\n gap: 14px;\n`;\n\nconst Coordinate = styled.div`\n flex: 1;\n display: flex;\n flex-direction: column;\n gap: 5px;\n`;\n\nconst CustomInput = styled(GenericInput)`\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`;\n\nexport default What3WordsModal;\n"],"names":["What3WordsModal","props","w3wRegex","setCurrentAction","useCurrentAction","orderDetails","setOrderDetails","useOrderDetails","prevOrderDetails","setPrevOrderDetails","usePrevOrderDetails","customerInfo","useCustomerInfo","w3wError","setW3wError","useState","isClientPortal","useClientPortal","currentWhat3Words","setWhat3Words","localW3W","setLocalW3W","localLat","setLocalLat","localLong","setLocalLong","closeModal","cleanW3WAddress","w3wStr","validateInput","value","isValid","onChangeW3W","rawVal","val","onChangeLatitude","onChangeLongitude","handleKeyDown","callUpdateOrderAPI","useAxios","getWhat3Words","useEffect","response","onSave","updatedOrderDetails","payload","compareOrderDetailsStates","notification","infoText","isDifferent","originalRecipient","jsxs","OrderActionModal","jsx","Section","FieldRow","WordsSection","Label","WordInputWrapper","CustomInput","ErrorText","CurrentText","CoordRow","Coordinate","styled","GenericInput"],"mappings":";;;;;;;;;;AAgBA,SAASA,GAAgBC,GAAY;AACnC,QAAMC,IAAW,kLACX,CAAA,EAAGC,CAAgB,IAAIC,EAAA,GACvB,CAACC,GAAcC,CAAe,IAAIC,EAAA,GAClC,CAACC,GAAkBC,CAAmB,IAAIC,EAAA,GAC1C,CAACC,CAAY,IAAIC,EAAA,GACjB,CAACC,GAAUC,CAAW,IAAIC,EAAS,EAAE,GACrC,CAACC,CAAc,IAAIC,EAAA,GACnB,CAACC,GAAmBC,CAAa,IAAIJ,EAAA,GACrC,CAACK,GAAUC,CAAW,IAAIN,EAAS,EAAE,GACrC,CAACO,GAAUC,CAAW,IAAIR,EAASV,GAAc,YAAY,EAAE,GAC/D,CAACmB,GAAWC,CAAY,IAAIV,EAASV,GAAc,aAAa,EAAE,GAElEqB,IAAa,MAAMvB,EAAiB,MAAS,GAE7CwB,IAAkB,CAACC,MAChBA,EAAO,QAAQ,QAAQ,EAAE,GA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AA;AAAA,YAAA,gBAAAV,EAACI,GAAA,EAAM,OAAM,aAAY,SAAQ,QAAO;AAAA,YAExC,gBAAAJ;AAAA,cAACM;AAAA,cAAA;AAAA,gBACC,MAAK;AAAA,gBACL,MAAK;AAAA,gBACL,aAAY;AAAA,gBACZ,OAAOnC;AAAA,gBACP,UAAUY;AAAA,gBACV,WAAWC;AAAA,cAAA;AAAA,YAAA;AAAA,UACb,EAAA,CACF;AAAA,QAAA,EAAA,CACF,EAAA,CACF;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAGN;AAEA,MAAMmB,IAAeQ,EAAO;AAAA;AAAA;AAAA;AAAA;AAAA,GAOtBN,KAAmBM,EAAO;AAAA;AAAA;AAAA;AAAA;AAAA,GAO1BH,KAAcG,EAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,GAerBJ,KAAYI,EAAO;AAAA;AAAA;AAAA;AAAA,GAMnBV,IAAUU,EAAO;AAAA;AAAA;AAAA;AAAA;AAAA,GAOjBT,KAAWS,EAAO;AAAA;AAAA;AAAA;AAAA;AAAA,GAOlBF,KAAWE,EAAO;AAAA;AAAA;AAAA;AAAA,GAMlBD,IAAaC,EAAO;AAAA;AAAA;AAAA;AAAA;AAAA,GAOpBL,IAAcK,EAAOC,CAAY;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;"}
|
|
@@ -1,35 +1,33 @@
|
|
|
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
|
-
|
|
12
|
-
...u,
|
|
13
|
-
order_recipient: d
|
|
1
|
+
import { jsxs as u, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { Input as s, Label as d } from "@bjsdistribution/dms-component-library";
|
|
3
|
+
import t from "styled-components";
|
|
4
|
+
import { useOrderDetails as p } from "../../../../store.js";
|
|
5
|
+
import { handleKeyDown as m } from "../../../../utils.js";
|
|
6
|
+
function w() {
|
|
7
|
+
const [n, o] = p(), r = (i) => {
|
|
8
|
+
const a = i.target.value;
|
|
9
|
+
o((l) => ({
|
|
10
|
+
...l,
|
|
11
|
+
latitude: a
|
|
14
12
|
}));
|
|
15
13
|
};
|
|
16
|
-
return /* @__PURE__ */
|
|
17
|
-
/* @__PURE__ */
|
|
18
|
-
/* @__PURE__ */
|
|
19
|
-
|
|
14
|
+
return /* @__PURE__ */ u(f, { children: [
|
|
15
|
+
/* @__PURE__ */ e(d, { label: "Latitude", htmlFor: "lat" }),
|
|
16
|
+
/* @__PURE__ */ e(
|
|
17
|
+
c,
|
|
20
18
|
{
|
|
21
19
|
name: "lat",
|
|
22
20
|
type: "number",
|
|
23
21
|
placeholder: "Latitude",
|
|
24
|
-
onKeyDown:
|
|
25
|
-
value:
|
|
26
|
-
onChange:
|
|
22
|
+
onKeyDown: m,
|
|
23
|
+
value: n?.latitude || "",
|
|
24
|
+
onChange: r,
|
|
27
25
|
readOnly: !0
|
|
28
26
|
}
|
|
29
27
|
)
|
|
30
28
|
] });
|
|
31
29
|
}
|
|
32
|
-
const
|
|
30
|
+
const c = t(s)`
|
|
33
31
|
width: 100%;
|
|
34
32
|
&::-webkit-outer-spin-button,
|
|
35
33
|
&::-webkit-inner-spin-button {
|
|
@@ -42,13 +40,13 @@ const b = o(s)`
|
|
|
42
40
|
opacity: 0.8;
|
|
43
41
|
background-color: #f4f4f4;
|
|
44
42
|
pointer-events: none;
|
|
45
|
-
`,
|
|
43
|
+
`, f = t.div`
|
|
46
44
|
display: flex;
|
|
47
45
|
flex-direction: column;
|
|
48
46
|
gap: 6px;
|
|
49
47
|
flex: 1;
|
|
50
48
|
`;
|
|
51
49
|
export {
|
|
52
|
-
|
|
50
|
+
w as default
|
|
53
51
|
};
|
|
54
52
|
//# 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
|
|
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 latitude: val,\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={orderDetails?.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","onChange","e","val","prev","Container","jsx","Label","CustomInput","handleKeyDown","styled","Input"],"mappings":";;;;;AAMA,SAASA,IAAW;AAClB,QAAM,CAACC,GAAcC,CAAe,IAAIC,EAAA,GAElCC,IAAW,CAACC,MAA2C;AAC3D,UAAMC,IAAMD,EAAE,OAAO;AACrB,IAAAH,EAAgB,CAAAK,OAAS;AAAA,MACvB,GAAGA;AAAA,MACH,UAAUD;AAAA,IAAA,EACV;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,OAAOX,GAAc,YAAY;AAAA,QACjC,UAAAG;AAAA,QACA,UAAQ;AAAA,MAAA;AAAA,IAAA;AAAA,EACV,GACF;AAEJ;AAEA,MAAMO,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,35 +1,33 @@
|
|
|
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
|
-
|
|
12
|
-
...d,
|
|
13
|
-
order_recipient: a
|
|
1
|
+
import { jsxs as u, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { Input as s, Label as d } from "@bjsdistribution/dms-component-library";
|
|
3
|
+
import n from "styled-components";
|
|
4
|
+
import { useOrderDetails as p } from "../../../../store.js";
|
|
5
|
+
import { handleKeyDown as m } from "../../../../utils.js";
|
|
6
|
+
function v() {
|
|
7
|
+
const [o, t] = p(), r = (i) => {
|
|
8
|
+
const l = i.target.value;
|
|
9
|
+
t((a) => ({
|
|
10
|
+
...a,
|
|
11
|
+
longitude: l
|
|
14
12
|
}));
|
|
15
13
|
};
|
|
16
|
-
return /* @__PURE__ */
|
|
17
|
-
/* @__PURE__ */
|
|
18
|
-
/* @__PURE__ */
|
|
19
|
-
|
|
14
|
+
return /* @__PURE__ */ u(f, { children: [
|
|
15
|
+
/* @__PURE__ */ e(d, { label: "Longitude", htmlFor: "long" }),
|
|
16
|
+
/* @__PURE__ */ e(
|
|
17
|
+
c,
|
|
20
18
|
{
|
|
21
19
|
name: "long",
|
|
22
20
|
type: "number",
|
|
23
21
|
placeholder: "Longitude",
|
|
24
|
-
onKeyDown:
|
|
25
|
-
value:
|
|
26
|
-
onChange:
|
|
22
|
+
onKeyDown: m,
|
|
23
|
+
value: o?.longitude || "",
|
|
24
|
+
onChange: r,
|
|
27
25
|
readOnly: !0
|
|
28
26
|
}
|
|
29
27
|
)
|
|
30
28
|
] });
|
|
31
29
|
}
|
|
32
|
-
const
|
|
30
|
+
const c = n(s)`
|
|
33
31
|
width: 100%;
|
|
34
32
|
&::-webkit-outer-spin-button,
|
|
35
33
|
&::-webkit-inner-spin-button {
|
|
@@ -42,13 +40,13 @@ const g = o(s)`
|
|
|
42
40
|
opacity: 0.8;
|
|
43
41
|
background-color: #f4f4f4;
|
|
44
42
|
pointer-events: none;
|
|
45
|
-
`,
|
|
43
|
+
`, f = n.div`
|
|
46
44
|
display: flex;
|
|
47
45
|
flex-direction: column;
|
|
48
46
|
gap: 6px;
|
|
49
47
|
flex: 1;
|
|
50
48
|
`;
|
|
51
49
|
export {
|
|
52
|
-
|
|
50
|
+
v as default
|
|
53
51
|
};
|
|
54
52
|
//# 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
|
|
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 longitude: val,\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={orderDetails?.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","onChange","e","val","prev","Container","jsx","Label","CustomInput","handleKeyDown","styled","Input"],"mappings":";;;;;AAMA,SAASA,IAAY;AACnB,QAAM,CAACC,GAAcC,CAAe,IAAIC,EAAA,GAElCC,IAAW,CAACC,MAA2C;AAC3D,UAAMC,IAAMD,EAAE,OAAO;AACrB,IAAAH,EAAgB,CAAAK,OACP;AAAA,MACL,GAAGA;AAAA,MACH,WAAWD;AAAA,IAAA,EAEd;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,OAAOX,GAAc,aAAa;AAAA,QAClC,UAAAG;AAAA,QACA,UAAQ;AAAA,MAAA;AAAA,IAAA;AAAA,EACV,GACF;AAEJ;AAEA,MAAMO,IAAcE,EAAOC,CAAK;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,GAe1BN,IAAYK,EAAO;AAAA;AAAA;AAAA;AAAA;AAAA;"}
|
|
@@ -34,6 +34,8 @@ const i = e({}), d = e({
|
|
|
34
34
|
other_instructions: null,
|
|
35
35
|
schedule_after: null,
|
|
36
36
|
vehicle_type: null,
|
|
37
|
+
latitude: null,
|
|
38
|
+
longitude: null,
|
|
37
39
|
order_locked_by: null,
|
|
38
40
|
delivery_instructions: null,
|
|
39
41
|
drop_time: null,
|
|
@@ -49,8 +51,6 @@ const i = e({}), d = e({
|
|
|
49
51
|
postcode: null,
|
|
50
52
|
postcode_district: null,
|
|
51
53
|
postcode_short: null,
|
|
52
|
-
latitude: null,
|
|
53
|
-
longitude: null,
|
|
54
54
|
what_3words_address: null,
|
|
55
55
|
contact_home: null,
|
|
56
56
|
contact_work: null,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"store.js","sources":["../../../src/components/order-view/store.ts"],"sourcesContent":["import { atom, useAtom } from 'jotai';\nimport { atomWithReducer } from 'jotai/utils';\nimport {\n CancelOrderProductsType,\n ChargesType,\n CreateProduct,\n OrderActionsType,\n OrdersType,\n UnRecieveOrderProduct,\n UpdateOrderProduct,\n} from './types';\nimport {\n ClientData,\n ClientType,\n} from '../order-daily-overview/common/interface';\n// OrderActionsType\nconst activeTabAtom = atom<string>('active');\nconst infoAtom = atom<boolean | undefined>(false);\nconst orderResources = atom<[]>([]);\nconst currentActionAtom = atom<OrderActionsType | undefined>(undefined);\nconst isOnHold = atom<Boolean>(false);\nconst date = atom(new Date());\n\nconst orderStaticDataAtom = atom<any>({});\n\ninterface OrderRecipient {\n recipient_name: string | null;\n postcode: string | null;\n return_action?: string[] | null;\n}\n\nconst customerInfoAtom = atom<OrderRecipient>({\n recipient_name: '',\n postcode: '',\n});\n\nexport const ordersInitialValue: OrdersType = {\n order_locked_time: null,\n depot_id: null,\n gsit_order_id: null,\n customer_id: null,\n trading_name: null,\n recipient_reference: null,\n order_locked: true,\n lock_notes: null,\n order_type_id: null,\n allow_live_tracking: null,\n weight: null,\n cube: null,\n rescheduled: null,\n zone_code: null,\n status: null,\n status_value: null,\n order_status_note: null,\n print_pod: null,\n order_number: null,\n consignment: null,\n action_date: null,\n other_instructions: null,\n schedule_after: null,\n vehicle_type: null,\n order_locked_by: null,\n delivery_instructions: null,\n drop_time: null,\n created_by: null,\n created_at: null,\n recipient_name: '',\n postcode: '',\n order_recipient: {\n id: null,\n order_id: null,\n recipient_name: null,\n address: null,\n postcode: null,\n postcode_district: null,\n postcode_short: null,\n latitude: null,\n longitude: null,\n what_3words_address: null,\n contact_home: null,\n contact_work: null,\n contact_mobile: null,\n contact_email: null,\n is_comms_enabled: null,\n },\n order_services_detail: {\n order_id: null,\n timed_service_id: null,\n order_delivery_point_id: null,\n order_service_level_id: null,\n heavy_order: null,\n heavy_item: null,\n bulky_order: null,\n bulky_item: null,\n id: null,\n },\n order_services: [\n {\n order_id: null,\n order_service_list_id: null,\n service_time: null,\n is_refused: null,\n service_note: null,\n id: null,\n service_category_id: 0,\n },\n ],\n order_routes: null,\n order_eta_updates: [],\n order_delivery_declined_dates: [],\n order_communications: [],\n id: null,\n name: '',\n carrier_id: null,\n order_type: {\n type: null,\n },\n assemble: false,\n disassemble: false,\n unpack_items: false,\n take_packaging_away: false,\n collect_disposal: false,\n assembly_type: null,\n route_id: null,\n hold_untill: null,\n hold_reason: null,\n\n order_on_hold: {\n order_id: null,\n hold_indefinitely: null,\n hold_until: null,\n reason_id: null,\n un_hold: null,\n },\n\n refused_service: [],\n refused_service_reason: '',\n invalid_order: null,\n owner_name: null,\n force_debrief_enabled: null,\n import_reference: null,\n labels: null,\n};\n\nexport const orderProductInitialvalue: CreateProduct = {\n code: '',\n description: '',\n sku: '',\n weight: 0,\n cube: 0,\n order_id: 0,\n order_product_type_id: 0,\n return_reason_id: 0,\n collection_reason_id: 0,\n product_return_action_id: 0,\n return_location: '',\n};\n\nexport const unrecieveOrderProducts: UnRecieveOrderProduct = {\n unrecieve_reason_id: 0,\n unrecieve_note: '',\n // id: 0\n};\n\nexport const updateOrderProducts: UpdateOrderProduct = {\n id: 0,\n order_id: 0,\n product_type_id: 0,\n product_return_action_id: 0,\n return_location: '',\n return_reason_id: 0,\n};\n\n//force debrief\nconst chargesIntialValue: ChargesType = {\n base_charge_type: 1,\n base_charge: 0,\n weight: 0,\n drop_time: 0,\n timed_service: 0,\n wait_time: 0,\n extra_floor: 0,\n bulky_items: 0,\n re_label: 0,\n extra_cube: 0,\n additional_box: 0,\n additional_item: 0,\n weekend: 0,\n re_allocation: 0,\n pre_dated: 0,\n re_package: 0,\n disassemble: 0,\n qc: 0,\n collection_qc: 0,\n return_to_client: 0,\n roc: 0,\n unpack: 0,\n packaging_disposal: 0,\n assembly: 0,\n debrief_notes: '',\n recycle: 0,\n admin: 0,\n disposal: 0,\n disposal_recycling: 0,\n debrief_status: '',\n new_order_status: '',\n adhoc_charges: [],\n};\n\nexport const usedate = () => {\n return useAtom(date);\n};\nfunction useTabType() {\n return useAtom(activeTabAtom);\n}\nfunction useInfoType() {\n return useAtom(infoAtom);\n}\nfunction useOrderResources() {\n return useAtom(orderResources);\n}\nfunction useCurrentAction() {\n return useAtom(currentActionAtom);\n}\n\nfunction useOrderStaticData() {\n return useAtom(orderStaticDataAtom);\n}\n\nexport function useCustomerInfo() {\n return useAtom(customerInfoAtom);\n}\n\n// Define initial modal state\nexport const initialModalState = {\n openModalType: null,\n};\nfunction useIsOnHoldOrder() {\n return useAtom(isOnHold);\n}\n//value\nconst orderId = atom<any>(undefined);\nexport const useOrderId = () => {\n //dddddddddddd\n return useAtom(orderId);\n};\n\nconst escalationIds = atom<number[]>([]);\n\nfunction useEscalationIDs() {\n return useAtom(escalationIds);\n}\n\nconst bulkUpdateSelectedRow = atom<any[]>([]);\nexport const useBulkUpdateSelectedRow = () => {\n return useAtom(bulkUpdateSelectedRow);\n};\n\nexport const initialConfirmOrderErrValues = {\n homeContactError: '',\n workContactError: '',\n mobileError: '',\n emailError: '',\n};\n\nconst errorConfirmOrderAtom = atom(initialConfirmOrderErrValues);\n\nfunction useErrorConfirmOrder() {\n return useAtom(errorConfirmOrderAtom);\n}\n\nconst OrderDetailsConfirmOrder = atom<OrdersType>(ordersInitialValue);\nfunction useOrderDetailsConfirmOrder() {\n return useAtom(OrderDetailsConfirmOrder);\n}\n\nconst selectedAction = atom<string>('');\n\nexport function useSelectionAction() {\n return useAtom(selectedAction);\n}\n\n// REFUSED SERVICES STATE STARTS\n\nconst confirmedDate = atom<{\n previousDate: string | null;\n currentDate: string | null;\n}>({\n previousDate: null,\n currentDate: null,\n});\n\nexport function useNotificationConfirmedDate() {\n return useAtom(confirmedDate);\n}\n\nconst cancelOrderProducts = atom<CancelOrderProductsType[]>([]);\nexport function useCancelOrderProducts() {\n return useAtom(cancelOrderProducts);\n}\n\n// changes customer Account state\nconst customerData = atom<any[]>([]);\nexport const useCustomerData = () => {\n return useAtom(customerData);\n};\n\nconst orderAlertsData = atom<any>({});\nexport function useOrderAlertsData() {\n return useAtom(orderAlertsData);\n}\n\nconst customerList = atom<any>([]);\nexport function useOrderCustomersList() {\n return useAtom(customerList);\n}\n\nexport {\n useTabType,\n useInfoType,\n useOrderResources,\n useCurrentAction,\n useIsOnHoldOrder,\n useOrderStaticData,\n useEscalationIDs,\n useErrorConfirmOrder,\n useOrderDetailsConfirmOrder,\n};\n\n// Remainder count\nconst OrderDetails = atom<OrdersType>(ordersInitialValue);\nfunction useOrderDetails() {\n return useAtom(OrderDetails);\n}\n\nconst prevOrderDetails = atom<OrdersType>(ordersInitialValue);\nfunction usePrevOrderDetails() {\n return useAtom(prevOrderDetails);\n}\n\nconst customerDetails = atom<any>({});\nfunction useCustomerDetails() {\n return useAtom(customerDetails);\n}\n\nconst DepotDeatils = atom<any>(0);\nfunction useDepotDetails() {\n return useAtom(DepotDeatils);\n}\n/**\n * Products of the *order* (`/order/order_products/{id}`), used by the order-action\n * modals. Kept separate from `returnProductDetails` below — the two endpoints return\n * different shapes and only the return-products one carries pallet data.\n */\nconst productDetails = atom<any[]>([]);\nfunction useProductDetails() {\n return useAtom(productDetails);\n}\n\n/** Products of the *return order* (`/v1/return/products/{id}`) — carries `pallet_id`. */\nconst returnProductDetails = atom<any[]>([]);\nexport function useReturnProductDetails() {\n return useAtom(returnProductDetails);\n}\n\nconst fetchAgain = atom<boolean>(false);\nexport function usefetchAgain() {\n return useAtom(fetchAgain);\n}\n\nconst productDetailsCopy = atom<any>([]);\nexport function useProductDetailsCopy() {\n return useAtom(productDetailsCopy);\n}\n\nconst StatusDeatils = atom<any>(0);\nfunction useStatusDetails() {\n return useAtom(StatusDeatils);\n}\n\nconst depotOptions = atom<any>([]);\nfunction useDepotOptions() {\n return useAtom(depotOptions);\n}\n\nconst depotEscData = atom<any>([]);\nfunction useEscData() {\n return useAtom(depotEscData);\n}\nconst deleteProdId = atom<any[]>([]);\nfunction useDeleteProdsID() {\n return useAtom(deleteProdId);\n}\n\nconst createOrderProduct = atom<any[]>([]);\nfunction useCreateOrderProducts() {\n return useAtom(createOrderProduct);\n}\n\nconst unrevieveOrderProduct = atom<UnRecieveOrderProduct>(\n unrecieveOrderProducts\n);\nfunction useRecieveOrderProducts() {\n return useAtom(unrevieveOrderProduct);\n}\n\nconst updateOrderProduct = atom<UpdateOrderProduct>(updateOrderProducts);\nfunction useUpdateOrderProducts() {\n return useAtom(updateOrderProduct);\n}\nconst CallAPi = atom(false);\n\nexport function useCallAPi() {\n return useAtom(CallAPi);\n}\n// export const selectedProductIdAtom = atom<number | null>(null);\n\nexport const selectedProductActionTabKeyAtom = atom<string>(\n 'update_product_type_tab'\n);\nfunction useSelectedProductActionTabKey() {\n return useAtom(selectedProductActionTabKeyAtom);\n}\n\nexport const errorAtom = atom({\n homeContactError: '',\n workCOntanctError: '',\n mobileError: '',\n emailError: '',\n w3wError: '',\n postCodeError: '',\n});\n\nconst orderProductResources = atom<any>([]);\nfunction useOrderProductsResources() {\n return useAtom(orderProductResources);\n}\n\nconst orderProductToolbox = atom<any>([]);\nfunction useOrderProductsToolbox() {\n return useAtom(orderProductToolbox);\n}\n\nexport const initialBulkReasonValues = {\n collection_reason_id: 0,\n return_reason_id: 0,\n product_return_action_id: 0,\n return_location: '',\n};\n\nconst bulkReasonsAtom = atom<any>(initialBulkReasonValues);\nexport function useBulkReasons() {\n return useAtom(bulkReasonsAtom);\n}\n\nconst bulkUpdatePayloadAtom = atom<any>([]);\nexport function useBulkUpdatePayload() {\n return useAtom(bulkUpdatePayloadAtom);\n}\n\nconst singleProductTypeUpdateAtom = atom<any>({\n order_product_type_id: 0,\n order_product_type: '',\n});\nexport function useSingleProductTypeUpdate() {\n return useAtom(singleProductTypeUpdateAtom);\n}\n\nconst locationOptions = atom<any>([]);\nexport function useLocationOptions() {\n return useAtom(locationOptions);\n}\nconst orderProductSystemLogs = atom<any>([]);\nfunction useOrderProductSystemLogs() {\n return useAtom(orderProductSystemLogs);\n}\n\nconst eventNotesData = atom<any>([]);\nfunction useEventNotesData() {\n return useAtom(eventNotesData);\n}\n\nconst selectedProductIdAtom = atom<number | undefined>(undefined);\nfunction useSelectedProductId() {\n return useAtom(selectedProductIdAtom);\n}\nconst returnAfterOrderAtom = atom<any[]>([]);\n\nexport function useReturnAfterOrderData() {\n return useAtom(returnAfterOrderAtom);\n}\n\nconst clientDataAtom = atom<ClientData[]>([]);\nfunction useClientData() {\n return useAtom(clientDataAtom);\n}\n\nconst clientData = atom<ClientType[]>([]);\n\nexport function usegetClientData() {\n return useAtom(clientData);\n}\n\nconst internalSearch = atom<string>('');\n\nfunction useInternalSearchText() {\n return useAtom(internalSearch);\n}\n\nexport {\n useAtom,\n useOrderDetails,\n useCustomerDetails,\n useProductDetails,\n useDepotDetails,\n useStatusDetails,\n useDepotOptions,\n usePrevOrderDetails,\n useEscData,\n useDeleteProdsID,\n useCreateOrderProducts,\n useRecieveOrderProducts,\n useUpdateOrderProducts,\n useOrderProductsResources,\n useOrderProductsToolbox,\n useOrderProductSystemLogs,\n useEventNotesData,\n useSelectedProductId,\n useSelectedProductActionTabKey,\n useClientData,\n useInternalSearchText,\n};\n\nconst notes = atom<any>([]);\n\nexport function usegetNotes() {\n return useAtom(notes);\n}\n\nconst moduleIds = atom<{\n id?: string;\n parentId?: string;\n} | null>(null);\n\nexport function usemoduleIds() {\n return useAtom(moduleIds);\n}\n\nconst callAPi = atom(false);\n\nexport function useLogsCallAPi() {\n return useAtom(callAPi);\n}\n\nconst callOrderProductsApi = atom<boolean>(false);\n\nexport function usecallOrderProductsApi() {\n return useAtom(callOrderProductsApi);\n}\n\nconst selectedProductId = atom<any>([]);\n\nexport function useSelectUpdateOP() {\n return useAtom(selectedProductId);\n}\n\nconst gsitCUstomerId = atom<any>({});\n\nexport function useGsitCUstomerId() {\n return useAtom(gsitCUstomerId);\n}\n\nconst CUstomerId = atom<number | undefined>(undefined);\n\nexport function useCUstomerId() {\n return useAtom(CUstomerId);\n}\n\nconst RouteId = atom<any | null>(null);\n\nexport function useRouteId() {\n return useAtom(RouteId);\n}\n\nconst gsitOrderId = atom<number | undefined>(undefined);\n\nexport function useGsitOrderId() {\n return useAtom(gsitOrderId);\n}\n\nconst orderProductId = atom<number | undefined>(undefined);\n\nexport function useOrderProductId() {\n return useAtom(orderProductId);\n}\nconst returnDataAtom = atom<any[]>([]);\nexport function useReturnData() {\n return useAtom(returnDataAtom);\n}\nconst apiUpdateCalling = atom<boolean>(false);\n\nexport function useUpdateApiCall() {\n return useAtom(apiUpdateCalling);\n}\n\nconst liveRecalling = atom<boolean>(false);\n\n//re api call of live status\nexport function useLiveRecalling() {\n return useAtom(liveRecalling);\n}\n\n//delete products\nconst onDeleteProduct = atom<boolean>(false);\n\nexport function useDeleteRecall() {\n return useAtom(onDeleteProduct);\n}\n\nexport const selectedTabKeyAtom = atom<string>('1');\nexport const letselectedProductIdAtom = atom<number | null>(null);\n\n// const BulkUPdateDisabledState = atom<boolean>(false);\n// export const useBulkUPdateDisabledState = () => {\n// return useAtom(BulkUPdateDisabledState);\n// };\n\nconst auditLogLoadingState = atom<boolean>(true);\nexport function useAuditLogLoadingState() {\n return useAtom(auditLogLoadingState);\n}\n\nconst globalStateHitAuditLog = atom<boolean>(false);\nexport function useGlobalStateHitAuditLog() {\n return useAtom(globalStateHitAuditLog);\n}\n\nconst globalOrderGetApi = atom<boolean>(true);\n\nexport function useGlobalStateHitOrder() {\n return useAtom(globalOrderGetApi);\n}\n\n//force debrief states\nconst globalEscData = atom<any>([]);\nexport function useGlobalEscData() {\n return useAtom(globalEscData);\n}\n\nconst activeTab = atom<any>('success');\n\nexport function useActiveTab() {\n return useAtom(activeTab);\n}\n\nconst chargesStateAtom = atom<ChargesType>(chargesIntialValue);\n\nexport function useChargesState() {\n return useAtom(chargesStateAtom);\n}\n\nconst failureReasonAtom = atom<any>('');\nexport function useFailureReason() {\n return useAtom(failureReasonAtom);\n}\n\nconst escalationCategoryAtom = atom<any>('');\n\nexport function useEscalationCategory() {\n return useAtom(escalationCategoryAtom);\n}\n\nconst escalationLevelAtom = atom<any>('');\n\nexport function useEscalationLevel() {\n return useAtom(escalationLevelAtom);\n}\n\nconst escalationReasonAtom = atom<any>('');\n\nexport function useEscalationReason() {\n return useAtom(escalationReasonAtom);\n}\n\nconst newStatusAtom = atom<any>('');\nexport function useNewStatus() {\n return useAtom(newStatusAtom);\n}\n\nconst orderCancelReasonAtom = atom<any>('');\nexport function useOrderCancelReason() {\n return useAtom(orderCancelReasonAtom);\n}\n\nconst orderHoldReasonAtom = atom<any>('');\nexport function useOrderHoldReason() {\n return useAtom(orderHoldReasonAtom);\n}\n\nconst isFailureReasonChangedAtom = atom<boolean>(false);\nexport function useIsFailureReasonChanged() {\n return useAtom(isFailureReasonChangedAtom);\n}\n\nconst zoomCallLogsApiLoader = atom<boolean>(true);\nexport function useZoomCallLogsLoader() {\n return useAtom(zoomCallLogsApiLoader);\n}\n\nconst zoomCallLogs = atom<any>([]);\nexport function useZoomCallLogs() {\n return useAtom(zoomCallLogs);\n}\n\nconst epodImages = atom<any>([]);\nexport function useEpodImages() {\n return useAtom(epodImages);\n}\n\nexport const skeletonTomTom = atom<boolean>(true);\n\n// Popup state Manage\nconst initialState = null;\n\nconst popupReducer = (state: any, action: any) => {\n if (action.type === 'create-return') {\n state = 'create-return';\n return { state };\n }\n if (action.type === 'bulkUpdate') {\n state = 'bulkUpdate';\n return { state };\n } else if (action.type === 'addProduct') {\n state = 'addProduct';\n return { state };\n } else if (action.type === 'split-order') {\n state = 'split-order';\n return { state };\n } else if (action.type === 'deleteProduct') {\n state = 'deleteProduct';\n return { state };\n } else if (action.type === 'defectsModal') {\n state = 'defectsModal';\n return { state };\n } else if (action.type === 'repackModal') {\n state = 'repackModal';\n return { state };\n } else if (action.type === 'qclog') {\n state = 'qclog';\n return { state };\n } else if (action.type === 'qclogtable') {\n state = 'qclogtable';\n return { state };\n } else if (action.type === 'repack') {\n state = 'repack';\n return { state };\n } else if (action.type === 'close') {\n state = null;\n return { state };\n } else {\n throw new Error('unknown action type');\n }\n};\nexport const countReducerAtom = atomWithReducer(initialState, popupReducer);\n"],"names":["activeTabAtom","atom","infoAtom","currentActionAtom","orderStaticDataAtom","customerInfoAtom","ordersInitialValue","unrecieveOrderProducts","updateOrderProducts","chargesIntialValue","useTabType","useAtom","useInfoType","useCurrentAction","useOrderStaticData","useCustomerInfo","orderId","useOrderId","initialConfirmOrderErrValues","errorConfirmOrderAtom","useErrorConfirmOrder","OrderDetailsConfirmOrder","useOrderDetailsConfirmOrder","selectedAction","useSelectionAction","confirmedDate","useNotificationConfirmedDate","cancelOrderProducts","useCancelOrderProducts","customerData","useCustomerData","orderAlertsData","useOrderAlertsData","customerList","useOrderCustomersList","OrderDetails","useOrderDetails","prevOrderDetails","usePrevOrderDetails","customerDetails","useCustomerDetails","productDetails","useProductDetails","returnProductDetails","useReturnProductDetails","fetchAgain","usefetchAgain","productDetailsCopy","useProductDetailsCopy","StatusDeatils","useStatusDetails","depotOptions","useDepotOptions","deleteProdId","useDeleteProdsID","errorAtom","orderProductResources","useOrderProductsResources","initialBulkReasonValues","locationOptions","useLocationOptions","orderProductSystemLogs","useOrderProductSystemLogs","returnAfterOrderAtom","useReturnAfterOrderData","clientDataAtom","useClientData","clientData","usegetClientData","internalSearch","useInternalSearchText","notes","usegetNotes","moduleIds","usemoduleIds","gsitCUstomerId","useGsitCUstomerId","CUstomerId","useCUstomerId","RouteId","useRouteId","gsitOrderId","useGsitOrderId","orderProductId","useOrderProductId","returnDataAtom","useReturnData","liveRecalling","useLiveRecalling","auditLogLoadingState","useAuditLogLoadingState","globalStateHitAuditLog","useGlobalStateHitAuditLog","globalOrderGetApi","useGlobalStateHitOrder","globalEscData","useGlobalEscData","activeTab","useActiveTab","chargesStateAtom","useChargesState","failureReasonAtom","useFailureReason","escalationCategoryAtom","useEscalationCategory","escalationLevelAtom","useEscalationLevel","escalationReasonAtom","useEscalationReason","newStatusAtom","useNewStatus","orderCancelReasonAtom","useOrderCancelReason","orderHoldReasonAtom","useOrderHoldReason","isFailureReasonChangedAtom","useIsFailureReasonChanged","zoomCallLogsApiLoader","useZoomCallLogsLoader","zoomCallLogs","useZoomCallLogs","epodImages","useEpodImages","skeletonTomTom","initialState","popupReducer","state","action","countReducerAtom","atomWithReducer"],"mappings":";;;AAgBA,MAAMA,IAAgBC,EAAa,QAAQ,GACrCC,IAAWD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{"version":3,"file":"store.js","sources":["../../../src/components/order-view/store.ts"],"sourcesContent":["import { atom, useAtom } from 'jotai';\nimport { atomWithReducer } from 'jotai/utils';\nimport {\n CancelOrderProductsType,\n ChargesType,\n CreateProduct,\n OrderActionsType,\n OrdersType,\n UnRecieveOrderProduct,\n UpdateOrderProduct,\n} from './types';\nimport {\n ClientData,\n ClientType,\n} from '../order-daily-overview/common/interface';\n// OrderActionsType\nconst activeTabAtom = atom<string>('active');\nconst infoAtom = atom<boolean | undefined>(false);\nconst orderResources = atom<[]>([]);\nconst currentActionAtom = atom<OrderActionsType | undefined>(undefined);\nconst isOnHold = atom<Boolean>(false);\nconst date = atom(new Date());\n\nconst orderStaticDataAtom = atom<any>({});\n\ninterface OrderRecipient {\n recipient_name: string | null;\n postcode: string | null;\n return_action?: string[] | null;\n}\n\nconst customerInfoAtom = atom<OrderRecipient>({\n recipient_name: '',\n postcode: '',\n});\n\nexport const ordersInitialValue: OrdersType = {\n order_locked_time: null,\n depot_id: null,\n gsit_order_id: null,\n customer_id: null,\n trading_name: null,\n recipient_reference: null,\n order_locked: true,\n lock_notes: null,\n order_type_id: null,\n allow_live_tracking: null,\n weight: null,\n cube: null,\n rescheduled: null,\n zone_code: null,\n status: null,\n status_value: null,\n order_status_note: null,\n print_pod: null,\n order_number: null,\n consignment: null,\n action_date: null,\n other_instructions: null,\n schedule_after: null,\n vehicle_type: null,\n latitude: null,\n longitude: null,\n order_locked_by: null,\n delivery_instructions: null,\n drop_time: null,\n created_by: null,\n created_at: null,\n recipient_name: '',\n postcode: '',\n order_recipient: {\n id: null,\n order_id: null,\n recipient_name: null,\n address: null,\n postcode: null,\n postcode_district: null,\n postcode_short: null,\n what_3words_address: null,\n contact_home: null,\n contact_work: null,\n contact_mobile: null,\n contact_email: null,\n is_comms_enabled: null,\n },\n order_services_detail: {\n order_id: null,\n timed_service_id: null,\n order_delivery_point_id: null,\n order_service_level_id: null,\n heavy_order: null,\n heavy_item: null,\n bulky_order: null,\n bulky_item: null,\n id: null,\n },\n order_services: [\n {\n order_id: null,\n order_service_list_id: null,\n service_time: null,\n is_refused: null,\n service_note: null,\n id: null,\n service_category_id: 0,\n },\n ],\n order_routes: null,\n order_eta_updates: [],\n order_delivery_declined_dates: [],\n order_communications: [],\n id: null,\n name: '',\n carrier_id: null,\n order_type: {\n type: null,\n },\n assemble: false,\n disassemble: false,\n unpack_items: false,\n take_packaging_away: false,\n collect_disposal: false,\n assembly_type: null,\n route_id: null,\n hold_untill: null,\n hold_reason: null,\n\n order_on_hold: {\n order_id: null,\n hold_indefinitely: null,\n hold_until: null,\n reason_id: null,\n un_hold: null,\n },\n\n refused_service: [],\n refused_service_reason: '',\n invalid_order: null,\n owner_name: null,\n force_debrief_enabled: null,\n import_reference: null,\n labels: null,\n};\n\nexport const orderProductInitialvalue: CreateProduct = {\n code: '',\n description: '',\n sku: '',\n weight: 0,\n cube: 0,\n order_id: 0,\n order_product_type_id: 0,\n return_reason_id: 0,\n collection_reason_id: 0,\n product_return_action_id: 0,\n return_location: '',\n};\n\nexport const unrecieveOrderProducts: UnRecieveOrderProduct = {\n unrecieve_reason_id: 0,\n unrecieve_note: '',\n // id: 0\n};\n\nexport const updateOrderProducts: UpdateOrderProduct = {\n id: 0,\n order_id: 0,\n product_type_id: 0,\n product_return_action_id: 0,\n return_location: '',\n return_reason_id: 0,\n};\n\n//force debrief\nconst chargesIntialValue: ChargesType = {\n base_charge_type: 1,\n base_charge: 0,\n weight: 0,\n drop_time: 0,\n timed_service: 0,\n wait_time: 0,\n extra_floor: 0,\n bulky_items: 0,\n re_label: 0,\n extra_cube: 0,\n additional_box: 0,\n additional_item: 0,\n weekend: 0,\n re_allocation: 0,\n pre_dated: 0,\n re_package: 0,\n disassemble: 0,\n qc: 0,\n collection_qc: 0,\n return_to_client: 0,\n roc: 0,\n unpack: 0,\n packaging_disposal: 0,\n assembly: 0,\n debrief_notes: '',\n recycle: 0,\n admin: 0,\n disposal: 0,\n disposal_recycling: 0,\n debrief_status: '',\n new_order_status: '',\n adhoc_charges: [],\n};\n\nexport const usedate = () => {\n return useAtom(date);\n};\nfunction useTabType() {\n return useAtom(activeTabAtom);\n}\nfunction useInfoType() {\n return useAtom(infoAtom);\n}\nfunction useOrderResources() {\n return useAtom(orderResources);\n}\nfunction useCurrentAction() {\n return useAtom(currentActionAtom);\n}\n\nfunction useOrderStaticData() {\n return useAtom(orderStaticDataAtom);\n}\n\nexport function useCustomerInfo() {\n return useAtom(customerInfoAtom);\n}\n\n// Define initial modal state\nexport const initialModalState = {\n openModalType: null,\n};\nfunction useIsOnHoldOrder() {\n return useAtom(isOnHold);\n}\n//value\nconst orderId = atom<any>(undefined);\nexport const useOrderId = () => {\n //dddddddddddd\n return useAtom(orderId);\n};\n\nconst escalationIds = atom<number[]>([]);\n\nfunction useEscalationIDs() {\n return useAtom(escalationIds);\n}\n\nconst bulkUpdateSelectedRow = atom<any[]>([]);\nexport const useBulkUpdateSelectedRow = () => {\n return useAtom(bulkUpdateSelectedRow);\n};\n\nexport const initialConfirmOrderErrValues = {\n homeContactError: '',\n workContactError: '',\n mobileError: '',\n emailError: '',\n};\n\nconst errorConfirmOrderAtom = atom(initialConfirmOrderErrValues);\n\nfunction useErrorConfirmOrder() {\n return useAtom(errorConfirmOrderAtom);\n}\n\nconst OrderDetailsConfirmOrder = atom<OrdersType>(ordersInitialValue);\nfunction useOrderDetailsConfirmOrder() {\n return useAtom(OrderDetailsConfirmOrder);\n}\n\nconst selectedAction = atom<string>('');\n\nexport function useSelectionAction() {\n return useAtom(selectedAction);\n}\n\n// REFUSED SERVICES STATE STARTS\n\nconst confirmedDate = atom<{\n previousDate: string | null;\n currentDate: string | null;\n}>({\n previousDate: null,\n currentDate: null,\n});\n\nexport function useNotificationConfirmedDate() {\n return useAtom(confirmedDate);\n}\n\nconst cancelOrderProducts = atom<CancelOrderProductsType[]>([]);\nexport function useCancelOrderProducts() {\n return useAtom(cancelOrderProducts);\n}\n\n// changes customer Account state\nconst customerData = atom<any[]>([]);\nexport const useCustomerData = () => {\n return useAtom(customerData);\n};\n\nconst orderAlertsData = atom<any>({});\nexport function useOrderAlertsData() {\n return useAtom(orderAlertsData);\n}\n\nconst customerList = atom<any>([]);\nexport function useOrderCustomersList() {\n return useAtom(customerList);\n}\n\nexport {\n useTabType,\n useInfoType,\n useOrderResources,\n useCurrentAction,\n useIsOnHoldOrder,\n useOrderStaticData,\n useEscalationIDs,\n useErrorConfirmOrder,\n useOrderDetailsConfirmOrder,\n};\n\n// Remainder count\nconst OrderDetails = atom<OrdersType>(ordersInitialValue);\nfunction useOrderDetails() {\n return useAtom(OrderDetails);\n}\n\nconst prevOrderDetails = atom<OrdersType>(ordersInitialValue);\nfunction usePrevOrderDetails() {\n return useAtom(prevOrderDetails);\n}\n\nconst customerDetails = atom<any>({});\nfunction useCustomerDetails() {\n return useAtom(customerDetails);\n}\n\nconst DepotDeatils = atom<any>(0);\nfunction useDepotDetails() {\n return useAtom(DepotDeatils);\n}\n/**\n * Products of the *order* (`/order/order_products/{id}`), used by the order-action\n * modals. Kept separate from `returnProductDetails` below — the two endpoints return\n * different shapes and only the return-products one carries pallet data.\n */\nconst productDetails = atom<any[]>([]);\nfunction useProductDetails() {\n return useAtom(productDetails);\n}\n\n/** Products of the *return order* (`/v1/return/products/{id}`) — carries `pallet_id`. */\nconst returnProductDetails = atom<any[]>([]);\nexport function useReturnProductDetails() {\n return useAtom(returnProductDetails);\n}\n\nconst fetchAgain = atom<boolean>(false);\nexport function usefetchAgain() {\n return useAtom(fetchAgain);\n}\n\nconst productDetailsCopy = atom<any>([]);\nexport function useProductDetailsCopy() {\n return useAtom(productDetailsCopy);\n}\n\nconst StatusDeatils = atom<any>(0);\nfunction useStatusDetails() {\n return useAtom(StatusDeatils);\n}\n\nconst depotOptions = atom<any>([]);\nfunction useDepotOptions() {\n return useAtom(depotOptions);\n}\n\nconst depotEscData = atom<any>([]);\nfunction useEscData() {\n return useAtom(depotEscData);\n}\nconst deleteProdId = atom<any[]>([]);\nfunction useDeleteProdsID() {\n return useAtom(deleteProdId);\n}\n\nconst createOrderProduct = atom<any[]>([]);\nfunction useCreateOrderProducts() {\n return useAtom(createOrderProduct);\n}\n\nconst unrevieveOrderProduct = atom<UnRecieveOrderProduct>(\n unrecieveOrderProducts\n);\nfunction useRecieveOrderProducts() {\n return useAtom(unrevieveOrderProduct);\n}\n\nconst updateOrderProduct = atom<UpdateOrderProduct>(updateOrderProducts);\nfunction useUpdateOrderProducts() {\n return useAtom(updateOrderProduct);\n}\nconst CallAPi = atom(false);\n\nexport function useCallAPi() {\n return useAtom(CallAPi);\n}\n// export const selectedProductIdAtom = atom<number | null>(null);\n\nexport const selectedProductActionTabKeyAtom = atom<string>(\n 'update_product_type_tab'\n);\nfunction useSelectedProductActionTabKey() {\n return useAtom(selectedProductActionTabKeyAtom);\n}\n\nexport const errorAtom = atom({\n homeContactError: '',\n workCOntanctError: '',\n mobileError: '',\n emailError: '',\n w3wError: '',\n postCodeError: '',\n});\n\nconst orderProductResources = atom<any>([]);\nfunction useOrderProductsResources() {\n return useAtom(orderProductResources);\n}\n\nconst orderProductToolbox = atom<any>([]);\nfunction useOrderProductsToolbox() {\n return useAtom(orderProductToolbox);\n}\n\nexport const initialBulkReasonValues = {\n collection_reason_id: 0,\n return_reason_id: 0,\n product_return_action_id: 0,\n return_location: '',\n};\n\nconst bulkReasonsAtom = atom<any>(initialBulkReasonValues);\nexport function useBulkReasons() {\n return useAtom(bulkReasonsAtom);\n}\n\nconst bulkUpdatePayloadAtom = atom<any>([]);\nexport function useBulkUpdatePayload() {\n return useAtom(bulkUpdatePayloadAtom);\n}\n\nconst singleProductTypeUpdateAtom = atom<any>({\n order_product_type_id: 0,\n order_product_type: '',\n});\nexport function useSingleProductTypeUpdate() {\n return useAtom(singleProductTypeUpdateAtom);\n}\n\nconst locationOptions = atom<any>([]);\nexport function useLocationOptions() {\n return useAtom(locationOptions);\n}\nconst orderProductSystemLogs = atom<any>([]);\nfunction useOrderProductSystemLogs() {\n return useAtom(orderProductSystemLogs);\n}\n\nconst eventNotesData = atom<any>([]);\nfunction useEventNotesData() {\n return useAtom(eventNotesData);\n}\n\nconst selectedProductIdAtom = atom<number | undefined>(undefined);\nfunction useSelectedProductId() {\n return useAtom(selectedProductIdAtom);\n}\nconst returnAfterOrderAtom = atom<any[]>([]);\n\nexport function useReturnAfterOrderData() {\n return useAtom(returnAfterOrderAtom);\n}\n\nconst clientDataAtom = atom<ClientData[]>([]);\nfunction useClientData() {\n return useAtom(clientDataAtom);\n}\n\nconst clientData = atom<ClientType[]>([]);\n\nexport function usegetClientData() {\n return useAtom(clientData);\n}\n\nconst internalSearch = atom<string>('');\n\nfunction useInternalSearchText() {\n return useAtom(internalSearch);\n}\n\nexport {\n useAtom,\n useOrderDetails,\n useCustomerDetails,\n useProductDetails,\n useDepotDetails,\n useStatusDetails,\n useDepotOptions,\n usePrevOrderDetails,\n useEscData,\n useDeleteProdsID,\n useCreateOrderProducts,\n useRecieveOrderProducts,\n useUpdateOrderProducts,\n useOrderProductsResources,\n useOrderProductsToolbox,\n useOrderProductSystemLogs,\n useEventNotesData,\n useSelectedProductId,\n useSelectedProductActionTabKey,\n useClientData,\n useInternalSearchText,\n};\n\nconst notes = atom<any>([]);\n\nexport function usegetNotes() {\n return useAtom(notes);\n}\n\nconst moduleIds = atom<{\n id?: string;\n parentId?: string;\n} | null>(null);\n\nexport function usemoduleIds() {\n return useAtom(moduleIds);\n}\n\nconst callAPi = atom(false);\n\nexport function useLogsCallAPi() {\n return useAtom(callAPi);\n}\n\nconst callOrderProductsApi = atom<boolean>(false);\n\nexport function usecallOrderProductsApi() {\n return useAtom(callOrderProductsApi);\n}\n\nconst selectedProductId = atom<any>([]);\n\nexport function useSelectUpdateOP() {\n return useAtom(selectedProductId);\n}\n\nconst gsitCUstomerId = atom<any>({});\n\nexport function useGsitCUstomerId() {\n return useAtom(gsitCUstomerId);\n}\n\nconst CUstomerId = atom<number | undefined>(undefined);\n\nexport function useCUstomerId() {\n return useAtom(CUstomerId);\n}\n\nconst RouteId = atom<any | null>(null);\n\nexport function useRouteId() {\n return useAtom(RouteId);\n}\n\nconst gsitOrderId = atom<number | undefined>(undefined);\n\nexport function useGsitOrderId() {\n return useAtom(gsitOrderId);\n}\n\nconst orderProductId = atom<number | undefined>(undefined);\n\nexport function useOrderProductId() {\n return useAtom(orderProductId);\n}\nconst returnDataAtom = atom<any[]>([]);\nexport function useReturnData() {\n return useAtom(returnDataAtom);\n}\nconst apiUpdateCalling = atom<boolean>(false);\n\nexport function useUpdateApiCall() {\n return useAtom(apiUpdateCalling);\n}\n\nconst liveRecalling = atom<boolean>(false);\n\n//re api call of live status\nexport function useLiveRecalling() {\n return useAtom(liveRecalling);\n}\n\n//delete products\nconst onDeleteProduct = atom<boolean>(false);\n\nexport function useDeleteRecall() {\n return useAtom(onDeleteProduct);\n}\n\nexport const selectedTabKeyAtom = atom<string>('1');\nexport const letselectedProductIdAtom = atom<number | null>(null);\n\n// const BulkUPdateDisabledState = atom<boolean>(false);\n// export const useBulkUPdateDisabledState = () => {\n// return useAtom(BulkUPdateDisabledState);\n// };\n\nconst auditLogLoadingState = atom<boolean>(true);\nexport function useAuditLogLoadingState() {\n return useAtom(auditLogLoadingState);\n}\n\nconst globalStateHitAuditLog = atom<boolean>(false);\nexport function useGlobalStateHitAuditLog() {\n return useAtom(globalStateHitAuditLog);\n}\n\nconst globalOrderGetApi = atom<boolean>(true);\n\nexport function useGlobalStateHitOrder() {\n return useAtom(globalOrderGetApi);\n}\n\n//force debrief states\nconst globalEscData = atom<any>([]);\nexport function useGlobalEscData() {\n return useAtom(globalEscData);\n}\n\nconst activeTab = atom<any>('success');\n\nexport function useActiveTab() {\n return useAtom(activeTab);\n}\n\nconst chargesStateAtom = atom<ChargesType>(chargesIntialValue);\n\nexport function useChargesState() {\n return useAtom(chargesStateAtom);\n}\n\nconst failureReasonAtom = atom<any>('');\nexport function useFailureReason() {\n return useAtom(failureReasonAtom);\n}\n\nconst escalationCategoryAtom = atom<any>('');\n\nexport function useEscalationCategory() {\n return useAtom(escalationCategoryAtom);\n}\n\nconst escalationLevelAtom = atom<any>('');\n\nexport function useEscalationLevel() {\n return useAtom(escalationLevelAtom);\n}\n\nconst escalationReasonAtom = atom<any>('');\n\nexport function useEscalationReason() {\n return useAtom(escalationReasonAtom);\n}\n\nconst newStatusAtom = atom<any>('');\nexport function useNewStatus() {\n return useAtom(newStatusAtom);\n}\n\nconst orderCancelReasonAtom = atom<any>('');\nexport function useOrderCancelReason() {\n return useAtom(orderCancelReasonAtom);\n}\n\nconst orderHoldReasonAtom = atom<any>('');\nexport function useOrderHoldReason() {\n return useAtom(orderHoldReasonAtom);\n}\n\nconst isFailureReasonChangedAtom = atom<boolean>(false);\nexport function useIsFailureReasonChanged() {\n return useAtom(isFailureReasonChangedAtom);\n}\n\nconst zoomCallLogsApiLoader = atom<boolean>(true);\nexport function useZoomCallLogsLoader() {\n return useAtom(zoomCallLogsApiLoader);\n}\n\nconst zoomCallLogs = atom<any>([]);\nexport function useZoomCallLogs() {\n return useAtom(zoomCallLogs);\n}\n\nconst epodImages = atom<any>([]);\nexport function useEpodImages() {\n return useAtom(epodImages);\n}\n\nexport const skeletonTomTom = atom<boolean>(true);\n\n// Popup state Manage\nconst initialState = null;\n\nconst popupReducer = (state: any, action: any) => {\n if (action.type === 'create-return') {\n state = 'create-return';\n return { state };\n }\n if (action.type === 'bulkUpdate') {\n state = 'bulkUpdate';\n return { state };\n } else if (action.type === 'addProduct') {\n state = 'addProduct';\n return { state };\n } else if (action.type === 'split-order') {\n state = 'split-order';\n return { state };\n } else if (action.type === 'deleteProduct') {\n state = 'deleteProduct';\n return { state };\n } else if (action.type === 'defectsModal') {\n state = 'defectsModal';\n return { state };\n } else if (action.type === 'repackModal') {\n state = 'repackModal';\n return { state };\n } else if (action.type === 'qclog') {\n state = 'qclog';\n return { state };\n } else if (action.type === 'qclogtable') {\n state = 'qclogtable';\n return { state };\n } else if (action.type === 'repack') {\n state = 'repack';\n return { state };\n } else if (action.type === 'close') {\n state = null;\n return { state };\n } else {\n throw new Error('unknown action type');\n }\n};\nexport const countReducerAtom = atomWithReducer(initialState, popupReducer);\n"],"names":["activeTabAtom","atom","infoAtom","currentActionAtom","orderStaticDataAtom","customerInfoAtom","ordersInitialValue","unrecieveOrderProducts","updateOrderProducts","chargesIntialValue","useTabType","useAtom","useInfoType","useCurrentAction","useOrderStaticData","useCustomerInfo","orderId","useOrderId","initialConfirmOrderErrValues","errorConfirmOrderAtom","useErrorConfirmOrder","OrderDetailsConfirmOrder","useOrderDetailsConfirmOrder","selectedAction","useSelectionAction","confirmedDate","useNotificationConfirmedDate","cancelOrderProducts","useCancelOrderProducts","customerData","useCustomerData","orderAlertsData","useOrderAlertsData","customerList","useOrderCustomersList","OrderDetails","useOrderDetails","prevOrderDetails","usePrevOrderDetails","customerDetails","useCustomerDetails","productDetails","useProductDetails","returnProductDetails","useReturnProductDetails","fetchAgain","usefetchAgain","productDetailsCopy","useProductDetailsCopy","StatusDeatils","useStatusDetails","depotOptions","useDepotOptions","deleteProdId","useDeleteProdsID","errorAtom","orderProductResources","useOrderProductsResources","initialBulkReasonValues","locationOptions","useLocationOptions","orderProductSystemLogs","useOrderProductSystemLogs","returnAfterOrderAtom","useReturnAfterOrderData","clientDataAtom","useClientData","clientData","usegetClientData","internalSearch","useInternalSearchText","notes","usegetNotes","moduleIds","usemoduleIds","gsitCUstomerId","useGsitCUstomerId","CUstomerId","useCUstomerId","RouteId","useRouteId","gsitOrderId","useGsitOrderId","orderProductId","useOrderProductId","returnDataAtom","useReturnData","liveRecalling","useLiveRecalling","auditLogLoadingState","useAuditLogLoadingState","globalStateHitAuditLog","useGlobalStateHitAuditLog","globalOrderGetApi","useGlobalStateHitOrder","globalEscData","useGlobalEscData","activeTab","useActiveTab","chargesStateAtom","useChargesState","failureReasonAtom","useFailureReason","escalationCategoryAtom","useEscalationCategory","escalationLevelAtom","useEscalationLevel","escalationReasonAtom","useEscalationReason","newStatusAtom","useNewStatus","orderCancelReasonAtom","useOrderCancelReason","orderHoldReasonAtom","useOrderHoldReason","isFailureReasonChangedAtom","useIsFailureReasonChanged","zoomCallLogsApiLoader","useZoomCallLogsLoader","zoomCallLogs","useZoomCallLogs","epodImages","useEpodImages","skeletonTomTom","initialState","popupReducer","state","action","countReducerAtom","atomWithReducer"],"mappings":";;;AAgBA,MAAMA,IAAgBC,EAAa,QAAQ,GACrCC,IAAWD,EAA0B,EAAK;AACzBA,EAAS,CAAA,CAAE;AAClC,MAAME,IAAoBF,EAAmC,MAAS;AACrDA,EAAc,EAAK;AACvBA,EAAK,oBAAI,KAAA,CAAM;AAE5B,MAAMG,IAAsBH,EAAU,EAAE,GAQlCI,IAAmBJ,EAAqB;AAAA,EAC5C,gBAAgB;AAAA,EAChB,UAAU;AACZ,CAAC,GAEYK,IAAiC;AAAA,EAC5C,mBAAmB;AAAA,EACnB,UAAU;AAAA,EACV,eAAe;AAAA,EACf,aAAa;AAAA,EACb,cAAc;AAAA,EACd,qBAAqB;AAAA,EACrB,cAAc;AAAA,EACd,YAAY;AAAA,EACZ,eAAe;AAAA,EACf,qBAAqB;AAAA,EACrB,QAAQ;AAAA,EACR,MAAM;AAAA,EACN,aAAa;AAAA,EACb,WAAW;AAAA,EACX,QAAQ;AAAA,EACR,cAAc;AAAA,EACd,mBAAmB;AAAA,EACnB,WAAW;AAAA,EACX,cAAc;AAAA,EACd,aAAa;AAAA,EACb,aAAa;AAAA,EACb,oBAAoB;AAAA,EACpB,gBAAgB;AAAA,EAChB,cAAc;AAAA,EACd,UAAU;AAAA,EACV,WAAW;AAAA,EACX,iBAAiB;AAAA,EACjB,uBAAuB;AAAA,EACvB,WAAW;AAAA,EACX,YAAY;AAAA,EACZ,YAAY;AAAA,EACZ,gBAAgB;AAAA,EAChB,UAAU;AAAA,EACV,iBAAiB;AAAA,IACf,IAAI;AAAA,IACJ,UAAU;AAAA,IACV,gBAAgB;AAAA,IAChB,SAAS;AAAA,IACT,UAAU;AAA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AACzB,WAAAD,IAAQ,cACD,EAAE,OAAAA,EAAA;AACX,MAAWC,EAAO,SAAS;AACzB,WAAAD,IAAQ,UACD,EAAE,OAAAA,EAAA;AACX,MAAWC,EAAO,SAAS;AACzB,WAAAD,IAAQ,MACD,EAAE,OAAAA,EAAA;AAET,QAAM,IAAI,MAAM,qBAAqB;AAEzC,GACaE,KAAmBC,EAAgBL,IAAcC,EAAY;"}
|
|
@@ -43,8 +43,6 @@ export type OrderRecipientType = {
|
|
|
43
43
|
postcode?: string | null;
|
|
44
44
|
postcode_district?: string | null;
|
|
45
45
|
postcode_short?: string | null;
|
|
46
|
-
latitude?: string | null;
|
|
47
|
-
longitude?: string | null;
|
|
48
46
|
what_3words_address?: string | null;
|
|
49
47
|
contact_home?: string | null;
|
|
50
48
|
contact_work?: string | null;
|
|
@@ -130,6 +128,8 @@ export interface OrdersType {
|
|
|
130
128
|
other_instructions: string | null;
|
|
131
129
|
schedule_after?: any | null;
|
|
132
130
|
vehicle_type: string | null;
|
|
131
|
+
latitude?: string | null;
|
|
132
|
+
longitude?: string | null;
|
|
133
133
|
order_recipient: OrderRecipientType | null;
|
|
134
134
|
order_services_detail: OrderServicesDetailType | null;
|
|
135
135
|
order_services?: OrderServiceType[];
|
|
@@ -55,6 +55,8 @@ export declare const compareOrderDetailsStates: (oldData: OrdersType, newData: O
|
|
|
55
55
|
other_instructions: string | null;
|
|
56
56
|
schedule_after?: any | null;
|
|
57
57
|
vehicle_type: string | null;
|
|
58
|
+
latitude?: string | null;
|
|
59
|
+
longitude?: string | null;
|
|
58
60
|
order_services?: import('./types').OrderServiceType[];
|
|
59
61
|
order_eta_updates: any[];
|
|
60
62
|
order_delivery_declined_dates: any[];
|
package/package.json
CHANGED