@bjsdistribution/dms-client-return 0.0.1 → 0.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (75) hide show
  1. package/dist/components/order-daily-overview/common/interface.d.ts +22 -0
  2. package/dist/components/order-daily-overview/header-filters/Styledfilters.d.ts +1 -2
  3. package/dist/components/order-daily-overview/header-filters/filterStore.d.ts +16 -0
  4. package/dist/components/order-daily-overview/return-order-table/return-orders-filters/returnstyles.d.ts +1 -0
  5. package/dist/components/order-daily-overview/shared/utlis.d.ts +2 -2
  6. package/dist/components/order-daily-overview/store/store.d.ts +4 -0
  7. package/dist/components/order-view/details-filters/left-side-filters/dropdowns/PrintDropDown.d.ts +3 -1
  8. package/dist/components/order-view/store.d.ts +5 -1
  9. package/dist/components/store.d.ts +5 -2
  10. package/dist/components/types.d.ts +1 -1
  11. package/dist/dms-client-return.cjs.development.js +1065 -964
  12. package/dist/dms-client-return.cjs.development.js.map +1 -1
  13. package/dist/dms-client-return.cjs.production.min.js +1 -1
  14. package/dist/dms-client-return.cjs.production.min.js.map +1 -1
  15. package/dist/dms-client-return.esm.js +1067 -966
  16. package/dist/dms-client-return.esm.js.map +1 -1
  17. package/package.json +2 -2
  18. package/src/components/order-daily-overview/common/fakedata.tsx +5 -6
  19. package/src/components/order-daily-overview/common/interface.ts +120 -97
  20. package/src/components/order-daily-overview/filters/Filters.tsx +1 -8
  21. package/src/components/order-daily-overview/header-filters/HeaderFilter.tsx +56 -67
  22. package/src/components/order-daily-overview/header-filters/SelectionFilter.tsx +160 -223
  23. package/src/components/order-daily-overview/header-filters/Styledfilters.tsx +19 -7
  24. package/src/components/order-daily-overview/header-filters/filterStore.ts +145 -0
  25. package/src/components/order-daily-overview/index.tsx +59 -6
  26. package/src/components/order-daily-overview/return-after-table/ReturnAfterTable.tsx +24 -1
  27. package/src/components/order-daily-overview/return-after-table/table/OrderTable.tsx +177 -234
  28. package/src/components/order-daily-overview/return-after-table/table-filters/ReturnOrderFilter.tsx +63 -6
  29. package/src/components/order-daily-overview/return-order-table/return-orders-filters/ReturnFilter.tsx +5 -47
  30. package/src/components/order-daily-overview/return-order-table/return-orders-filters/ReturnOrderTable.tsx +51 -185
  31. package/src/components/order-daily-overview/return-order-table/return-orders-filters/returnstyles.ts +62 -0
  32. package/src/components/order-daily-overview/store/store.ts +23 -12
  33. package/src/components/order-daily-overview/table/ReturnTable.tsx +193 -205
  34. package/src/components/order-view/details-filters/DetailsFilters.tsx +3 -2
  35. package/src/components/order-view/details-filters/left-side-filters/dropdowns/PrintDropDown.tsx +57 -46
  36. package/src/components/order-view/general-information/Status.tsx +1 -1
  37. package/src/components/order-view/index.tsx +6 -4
  38. package/src/components/order-view/modalsPopup/UnReceiveProduct.tsx +1 -1
  39. package/src/components/order-view/order-actions/actions/escalation/EscalationModal.tsx +1 -1
  40. package/src/components/order-view/order-details/expanded-content/customer-section/RecipientName.tsx +1 -0
  41. package/src/components/order-view/order-details/expanded-content/customer-section/contact-info/ContactEmail.tsx +1 -0
  42. package/src/components/order-view/order-details/expanded-content/customer-section/contact-info/ContactHome.tsx +1 -0
  43. package/src/components/order-view/order-details/expanded-content/customer-section/contact-info/ContactMobile.tsx +1 -1
  44. package/src/components/order-view/order-details/expanded-content/customer-section/contact-info/ContactWork.tsx +1 -0
  45. package/src/components/order-view/order-details/expanded-content/customer-section/location-info/Address.tsx +1 -0
  46. package/src/components/order-view/order-details/expanded-content/customer-section/location-info/Latitude.tsx +1 -0
  47. package/src/components/order-view/order-details/expanded-content/customer-section/location-info/Longitude.tsx +1 -0
  48. package/src/components/order-view/order-details/expanded-content/customer-section/location-info/Postcode.tsx +1 -0
  49. package/src/components/order-view/order-details/expanded-content/customer-section/location-info/What3words.tsx +1 -0
  50. package/src/components/order-view/order-details/expanded-content/footer/index.tsx +3 -2
  51. package/src/components/order-view/order-details/expanded-content/index.tsx +1 -1
  52. package/src/components/order-view/order-details/expanded-content/instruction-section/index.tsx +2 -1
  53. package/src/components/order-view/order-details/expanded-content/orders-section/Carrier.tsx +7 -1
  54. package/src/components/order-view/order-details/expanded-content/orders-section/DeliveryDate.tsx +1 -0
  55. package/src/components/order-view/order-details/expanded-content/orders-section/Depot.tsx +14 -1
  56. package/src/components/order-view/order-details/expanded-content/orders-section/Droptime.tsx +2 -1
  57. package/src/components/order-view/order-details/expanded-content/orders-section/OrderNumber.tsx +2 -1
  58. package/src/components/order-view/order-details/expanded-content/orders-section/RecipientReference.tsx +2 -1
  59. package/src/components/order-view/order-details/expanded-content/orders-section/ScheduleAfter.tsx +1 -0
  60. package/src/components/order-view/order-details/expanded-content/orders-section/VehicleType.tsx +13 -1
  61. package/src/components/order-view/order-details/expanded-content/services-section/DeliveryPoint.tsx +13 -1
  62. package/src/components/order-view/order-details/expanded-content/services-section/ServiceType.tsx +13 -1
  63. package/src/components/order-view/order-details/expanded-content/services-section/TimedService.tsx +14 -1
  64. package/src/components/order-view/return-client-products/product-table/ReturnProductTable.tsx +2 -2
  65. package/src/components/order-view/store.ts +40 -12
  66. package/src/components/store.ts +26 -4
  67. package/src/components/types.ts +2 -6
  68. package/dist/components/order-daily-overview/table/InfiniteScrolling.d.ts +0 -5
  69. package/dist/components/order-daily-overview/table/Return.d.ts +0 -3
  70. package/dist/components/order-daily-overview/table/table-data/MyTable.d.ts +0 -18
  71. package/dist/components/order-daily-overview/table/table-data/Table.d.ts +0 -18
  72. package/src/components/order-daily-overview/table/InfiniteScrolling.tsx +0 -54
  73. package/src/components/order-daily-overview/table/Return.tsx +0 -156
  74. package/src/components/order-daily-overview/table/table-data/MyTable.tsx +0 -433
  75. package/src/components/order-daily-overview/table/table-data/Table.tsx +0 -445
@@ -1,445 +0,0 @@
1
- import React from 'react';
2
- import {
3
- Back,
4
- Buttons,
5
- EmptyDataContainer,
6
- Header,
7
- Remove,
8
- StyledTable,
9
- StyledTableWrapper,
10
- StyledTdBasic,
11
- } from './styles';
12
- import styled from 'styled-components';
13
- // import CustomSelectDropdown from '../../components/inqueue/helper';
14
- import { format } from 'date-fns';
15
- // import { useStaticData } from '../../components/inqueue/store';
16
- // import DropdownIcon from '../../assets/DropdownIcon';
17
- // import { getIntegerValue } from '../../components/utils';
18
- // import { Skeleton } from 'antd';
19
- import { atom, useAtom } from 'jotai';
20
- // import { countReducerAtom } from '../../components/invoice-actions/store';
21
- import { Empty, Skeleton } from 'antd';
22
- // import { EmptyDataContainer } from '../../components/emailInvoice/emailStyles';
23
- // import { Column } from '../../components/readyforinvoice/types';
24
- import { ConfigProvider } from 'antd';
25
- import { Column } from '../../../types';
26
- import ArrowIcon from '../../../../assets/icons/ArrowIcon';
27
- import ArrivalIcon from '../../../../assets/icons/ArrivalIcon';
28
- import VehicleIcon from '../../../../assets/icons/VehicleIcon';
29
- import { getIntegerValue } from '../../../utils';
30
- import CustomSelectDropdown from './helper';
31
- import { useStaticData } from '../../../store';
32
- // import GreenDotIcon from '../../assets/GreenDotIcon';
33
- // import RedDotIcon from '../../assets/RedDotIcon';
34
- // import OrangeDotIcon from '../../assets/OrangeDotIcon';
35
-
36
- export const selectedValueAtom = atom(null);
37
- export const selectedIDAtom = atom(null);
38
-
39
- interface TableRow {
40
- [key: string]: any;
41
- }
42
-
43
- interface MyTableProps {
44
- columns: Column[];
45
- data: any;
46
- loading: boolean;
47
- loadingskeleton?: boolean;
48
- view?: 'rfi';
49
- }
50
-
51
- // Function to render nested content
52
- const Table: React.FC<MyTableProps> = ({
53
- columns,
54
- data,
55
- // loading,
56
- loadingskeleton,
57
- view,
58
- }) => {
59
- const [staticData] = useStaticData();
60
-
61
- const statusOptions = staticData?.invoice_discount_status?.map(
62
- (item: any) => ({
63
- value: item?.id,
64
- label: item?.status,
65
- icon:
66
- item?.status?.toLowerCase() === 'pending' ? (
67
- <ArrivalIcon />
68
- ) : item?.status?.toLowerCase() === 'approved' ? (
69
- <ArrivalIcon />
70
- ) : (
71
- <VehicleIcon />
72
- ),
73
- })
74
- );
75
-
76
- const renderContent = (content: any): React.ReactNode => {
77
- if (Array.isArray(content)) {
78
- return (
79
- <div>
80
- {content.map((item, index) => (
81
- <div key={index}>{renderContent(item)}</div>
82
- ))}
83
- </div>
84
- );
85
- } else if (typeof content === 'object' && content !== null) {
86
- return (
87
- <div>
88
- {Object.entries(content).map(([key, value]) => (
89
- <div key={key}>{renderContent(value)}</div>
90
- ))}
91
- </div>
92
- );
93
- }
94
- return content;
95
- };
96
-
97
- // const [, dispatch] = useAtom(countReducerAtom);
98
- const [, setSelectedValue] = useAtom(selectedValueAtom);
99
- const [, setSelectedID] = useAtom(selectedIDAtom);
100
-
101
- const handleSelect = (id: any) => {
102
- setSelectedID(id);
103
- };
104
-
105
- const handleOption = (event: any) => {
106
- const selectedValue = event;
107
- setSelectedValue(selectedValue);
108
- // 1: For pending 2: For Rejected 3: For Approved
109
- if (selectedValue === 2 || selectedValue === 3) {
110
- // dispatch({ type: 'discount-modal' });
111
- }
112
- };
113
-
114
- const renderCellContent = (column: Column, tableRow: TableRow) => {
115
- const cellData = tableRow[column?.accessor];
116
- const statusID = tableRow?.invoice_discount_queues?.status_id;
117
- const selectedOption = statusOptions?.find(
118
- (option: any) => option?.value === statusID
119
- );
120
-
121
- switch (column.accessor) {
122
- case 'action':
123
- return (
124
- <Buttons>
125
- <Back onClick={() => console.log('Action button clicked')}>
126
- Back to debrief
127
- </Back>
128
- <Remove onClick={() => console.log('Another button clicked')}>
129
- Remove from Invoice
130
- </Remove>
131
- </Buttons>
132
- );
133
- case 'invoice_date':
134
- if (!cellData) {
135
- return null;
136
- }
137
- const formattedInvoiceDate = format(new Date(cellData), 'dd/MM/yyyy');
138
- return <span>{formattedInvoiceDate}</span>;
139
-
140
- case 'date':
141
- if (!cellData) {
142
- return null;
143
- }
144
- const formattedDate = format(new Date(cellData), 'dd/MM/yyyy');
145
- return <span>{formattedDate}</span>;
146
-
147
- case 'total_orders':
148
- return (
149
- <span
150
- style={{
151
- backgroundColor: 'rgba(153, 153, 153, 0.10)',
152
- padding: '3px 12px',
153
- borderRadius: '4px',
154
- color: '#6A7378',
155
- }}
156
- >
157
- {view !== 'rfi' ? cellData : tableRow?.grand_total?.total_orders}
158
- </span>
159
- );
160
- case 'total_amount':
161
- const val = +tableRow?.grand_total?.total_amount;
162
- return (
163
- <span
164
- style={{
165
- backgroundColor: 'rgba(153, 153, 153, 0.10)',
166
- padding: '3px 12px',
167
- borderRadius: '4px',
168
- color: '#6A7378',
169
- }}
170
- >
171
- {view !== 'rfi'
172
- ? cellData?.toLocaleString()
173
- : val?.toLocaleString()}
174
- </span>
175
- );
176
- case 'discount':
177
- return (
178
- <span
179
- style={{
180
- display: 'flex',
181
- flexDirection: 'row',
182
- gap: '5px',
183
- alignItems: 'center',
184
- }}
185
- >
186
- <Percentage>
187
- {tableRow?.invoice_discount_queues?.new_discount}
188
- {'%'}
189
- </Percentage>
190
-
191
- <span
192
- style={{
193
- alignItems: 'center',
194
- fontSize: '14px',
195
- color: '#3A3630',
196
- }}
197
- >
198
- {getIntegerValue(cellData)}
199
- </span>
200
- </span>
201
- );
202
- case 'total':
203
- const totalVal = +tableRow?.grand_total?.grand_total;
204
- return (
205
- <span>
206
- {'£'}
207
- {view !== 'rfi'
208
- ? cellData?.toLocaleString()
209
- : totalVal?.toLocaleString()}
210
- </span>
211
- );
212
- case 'amount':
213
- return (
214
- <span>
215
- {'£'}
216
- {cellData?.toLocaleString()}
217
- </span>
218
- );
219
- case 'zone':
220
- return (
221
- <span
222
- style={{
223
- backgroundColor: 'rgba(153, 153, 153, 0.10)',
224
- padding: '3px 12px',
225
- borderRadius: '4px',
226
- }}
227
- >
228
- {cellData}
229
- </span>
230
- );
231
- case 'vat_rate':
232
- return (
233
- <span
234
- style={{
235
- backgroundColor: 'rgba(153, 153, 153, 0.10)',
236
- padding: '3px 12px',
237
- borderRadius: '4px',
238
- }}
239
- >
240
- {' '}
241
- {view !== 'rfi' ? cellData : tableRow?.grand_total?.vat_rate}
242
- {'%'}
243
- </span>
244
- );
245
- case 'products':
246
- return (
247
- <span
248
- style={{
249
- backgroundColor: 'rgba(153, 153, 153, 0.10)',
250
- padding: '3px 12px',
251
- borderRadius: '4px',
252
- }}
253
- >
254
- {cellData}
255
- </span>
256
- );
257
- case 'customer_name':
258
- return (
259
- <span
260
- style={{
261
- color: '#0099ff',
262
- fontWeight: 600,
263
- cursor: 'pointer',
264
- }}
265
- onClick={() =>
266
- column.callback !== undefined &&
267
- column?.callback({
268
- label: tableRow?.customer_name,
269
- value: tableRow?.customer_id,
270
- })
271
- }
272
- >
273
- {cellData}
274
- </span>
275
- );
276
- case 'status_id':
277
- return (
278
- <>
279
- <div onClick={() => handleSelect(tableRow?.id)}>
280
- <DropdownContainer>
281
- <ConfigProvider
282
- theme={{
283
- components: {
284
- Select: {
285
- /* here is your component tokens */
286
- optionPadding: '10px 6px',
287
- optionFontSize: 13,
288
- optionHeight: 16,
289
- optionSelectedFontWeight: 400,
290
- },
291
- },
292
- }}
293
- >
294
- <CustomSelectDropdown
295
- value={selectedOption}
296
- options={statusOptions}
297
- onChange={handleOption}
298
- variant="borderless"
299
- optionRender={(option: any) => (
300
- <div
301
- style={{
302
- display: 'flex',
303
- gap: '8px',
304
- alignItems: 'center',
305
- }}
306
- >
307
- <span
308
- style={{ display: 'flex' }}
309
- aria-label={option.data.label}
310
- >
311
- {option.data.icon}
312
- </span>
313
- <span style={{ color: '#8D8F90' }}>
314
- {option.data.label}
315
- </span>
316
- </div>
317
- )}
318
- />
319
- <IconContainer>
320
- <ArrowIcon />
321
- </IconContainer>
322
- </ConfigProvider>
323
- </DropdownContainer>
324
- </div>
325
- </>
326
- );
327
- default:
328
- return (
329
- <span
330
- style={{
331
- backgroundColor: 'rgba(153, 153, 153, 0.10)',
332
- padding: '3px 12px',
333
- borderRadius: '4px',
334
- color: '#6A7378',
335
- }}
336
- >
337
- {renderContent(cellData)}
338
- </span>
339
- );
340
- }
341
- };
342
-
343
- return (
344
- <CoverDiv>
345
- <StyledTableWrapper id="tableScrolling">
346
- <StyledTable className="mainTable">
347
- <thead>
348
- <tr>
349
- {columns?.map(column => (
350
- <Header key={column.accessor}>{column.Header}</Header>
351
- ))}
352
- </tr>
353
- {/* <tr>
354
- {columns?.map(column => (
355
- <Header key={column.accessor}>
356
- {column.Header}
357
- {column.showIcon && column.sortable && (
358
- <div style={{ marginTop: '5px' }}>
359
- <InvoiceSortIcon />
360
- </div>
361
- )}
362
- </Header>
363
- ))}
364
- </tr> */}
365
- </thead>
366
- <tbody>
367
- {loadingskeleton ? (
368
- <tr>
369
- <td colSpan={columns?.length || 7}>
370
- <Skeleton active />
371
- </td>
372
- </tr>
373
- ) : data?.length ? (
374
- data.map((tableRow: TableRow, index: any) => (
375
- <tr key={index}>
376
- {columns?.map(column => (
377
- <StyledTdBasic key={column.accessor}>
378
- {renderCellContent(column, tableRow)}
379
- </StyledTdBasic>
380
- ))}
381
- </tr>
382
- ))
383
- ) : (
384
- <tr>
385
- <td colSpan={columns?.length || 7}>
386
- <EmptyDataContainer>
387
- <Empty />
388
- </EmptyDataContainer>
389
- </td>
390
- </tr>
391
- )}
392
- </tbody>
393
- </StyledTable>
394
- </StyledTableWrapper>
395
- </CoverDiv>
396
- );
397
- };
398
-
399
- export default Table;
400
-
401
- const Percentage = styled.div`
402
- border-radius: 4px;
403
- background: rgba(42, 175, 77, 0.12);
404
- display: flex;
405
- padding: 4px 8px;
406
- align-items: flex-start;
407
- gap: 24px;
408
- color: #2aaf4d;
409
- `;
410
-
411
- const IconContainer = styled.div`
412
- position: absolute;
413
- top: 7px;
414
- left: 71px;
415
- border-radius: 18px;
416
- background: rgba(255, 255, 255, 0.5);
417
- box-shadow: 0px 1px 4px 0px rgba(0, 0, 0, 0.1);
418
- display: flex;
419
- width: 18px;
420
- height: 18px;
421
- justify-content: center;
422
- align-items: center;
423
- cursor: pointer;
424
- pointer-events: none;
425
- `;
426
-
427
- const DropdownContainer = styled.div`
428
- position: relative;
429
- .custom-dropdown {
430
- .ant-select-item {
431
- font-weight: 400;
432
- font-size: 13px;
433
- }
434
- }
435
- `;
436
-
437
- export const CoverDiv = styled.div`
438
- position: relative;
439
- min-height: calc(100vh - 396px);
440
- .ant-skeleton {
441
- position: absolute;
442
- bottom: 0;
443
- background: #fff;
444
- }
445
- `;