@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
@@ -38,6 +38,7 @@ function Longitude() {
38
38
  }
39
39
 
40
40
  const CustomInput = styled(Input)`
41
+ border-radius: 25px;
41
42
  &::-webkit-outer-spin-button,
42
43
  &::-webkit-inner-spin-button {
43
44
  -webkit-appearance: none;
@@ -41,6 +41,7 @@ function Postcode() {
41
41
  value={orderRecipient?.postcode || ''}
42
42
  onChange={onChange}
43
43
  autoComplete="off"
44
+ style={{ borderRadius: '25px' }}
44
45
  />
45
46
  </Container>
46
47
  );
@@ -64,6 +64,7 @@ const Wrapper = styled.div`
64
64
  `;
65
65
 
66
66
  const CustomInput = styled(Input)`
67
+ border-radius: 25px;
67
68
  &::-webkit-outer-spin-button,
68
69
  &::-webkit-inner-spin-button {
69
70
  -webkit-appearance: none;
@@ -98,9 +98,10 @@ const Container = styled.div`
98
98
  background: #f8fafc;
99
99
  /* margin: 0px -15px -15px -15px; */
100
100
  border-radius: 0px 0px 8px 8px;
101
- margin-bottom: 22px;
101
+ /* margin-bottom: 22px; */
102
102
  position: relative;
103
- top: 21px;
103
+ align-items: center;
104
+ /* top: 21px; */
104
105
  `;
105
106
 
106
107
  export default OrderDetailsFooter;
@@ -49,7 +49,7 @@ const HalfWidth = styled.div`
49
49
  const Container = styled.div`
50
50
  display: flex;
51
51
  flex-wrap: wrap;
52
- gap: 25px;
52
+ gap: 20px;
53
53
  justify-content: space-between;
54
54
 
55
55
  @media (min-width: 769px) {
@@ -21,7 +21,7 @@ function InstructionSection() {
21
21
  const FormInputs = styled.div`
22
22
  display: flex;
23
23
  flex-direction: column;
24
- gap: 15px;
24
+ gap: 7px;
25
25
  flex: 1;
26
26
  `;
27
27
 
@@ -30,6 +30,7 @@ const CustomFormSection = styled(FormSection)`
30
30
  border-radius: 8px;
31
31
  background: #f8fafc;
32
32
  box-shadow: 0px 1px 3px 0px rgba(16, 24, 40, 0.1);
33
+ padding: 10px !important;
33
34
  `;
34
35
 
35
36
  export default InstructionSection;
@@ -11,7 +11,13 @@ function Carrier() {
11
11
  <Label label="Carrier" htmlFor="carrier" />
12
12
  <CopyText text="hello234e" />
13
13
  </Wrapper>
14
- <Input name="carrier" type="text" placeholder="Carrier" disabled />
14
+ <Input
15
+ name="carrier"
16
+ type="text"
17
+ placeholder="Carrier"
18
+ disabled
19
+ style={{ borderRadius: '25PX' }}
20
+ />
15
21
  </Container>
16
22
  );
17
23
  }
@@ -53,6 +53,7 @@ function DeliveryDate() {
53
53
  onChange={onChange}
54
54
  value={actionDate === null ? actionDate : dayjs(actionDate)}
55
55
  format="DD/MM/YY"
56
+ style={{ borderRadius: '25px' }}
56
57
  />
57
58
  </MainContainer>
58
59
  );
@@ -1,4 +1,8 @@
1
- import { Label, SelectDropdown } from '@bjsdistribution/dms-component-library';
1
+ import {
2
+ Label,
3
+ SelectDropdown,
4
+ dropdownStyles,
5
+ } from '@bjsdistribution/dms-component-library';
2
6
  import React from 'react';
3
7
  import styled from 'styled-components';
4
8
  import { useDepotOptions, useOrderDetails } from '../../../store';
@@ -26,6 +30,15 @@ function DepotDropdown() {
26
30
  )}
27
31
  options={depotOptions || []}
28
32
  onChange={onChange}
33
+ styles={{
34
+ ...dropdownStyles,
35
+
36
+ control: styles => ({
37
+ ...styles,
38
+ borderRadius: '25px',
39
+ cursor: 'pointer',
40
+ }),
41
+ }}
29
42
  />
30
43
  </FormContainer>
31
44
  );
@@ -7,7 +7,7 @@ import { handleKeyDown } from '../../../utils';
7
7
  function Droptime() {
8
8
  const [orderDetails, setOrderDetails] = useOrderDetails();
9
9
  const orderRoutes = orderDetails?.order_routes;
10
-
10
+
11
11
  const onChange = (e: React.ChangeEvent<HTMLInputElement>) => {
12
12
  const val = parseFloat(e.target.value);
13
13
  const updatedOrderRoutes = {
@@ -39,6 +39,7 @@ function Droptime() {
39
39
  }
40
40
 
41
41
  const CustomInput = styled(Input)`
42
+ border-radius: 25px;
42
43
  &::-webkit-outer-spin-button,
43
44
  &::-webkit-inner-spin-button {
44
45
  -webkit-appearance: none;
@@ -10,7 +10,7 @@ function OrderNumber() {
10
10
  orderDetails?.order_number !== null &&
11
11
  orderDetails?.order_number !== undefined &&
12
12
  orderDetails?.order_number?.length > 0;
13
-
13
+
14
14
  const onChange = (e: React.ChangeEvent<HTMLInputElement>) => {
15
15
  setOrderDetails(prev => {
16
16
  return {
@@ -31,6 +31,7 @@ function OrderNumber() {
31
31
  placeholder="Order Number"
32
32
  value={orderDetails?.order_number || ''}
33
33
  onChange={onChange}
34
+ style={{ borderRadius: '25px' }}
34
35
  />
35
36
  </Container>
36
37
  );
@@ -5,7 +5,7 @@ import { useOrderDetails } from '../../../store';
5
5
 
6
6
  function RecipientReference() {
7
7
  const [orderDetails, setOrderDetails] = useOrderDetails();
8
-
8
+
9
9
  const onChange = (e: React.ChangeEvent<HTMLInputElement>) => {
10
10
  setOrderDetails(prev => {
11
11
  return {
@@ -23,6 +23,7 @@ function RecipientReference() {
23
23
  placeholder="Enter Recipient Reference"
24
24
  value={orderDetails.recipient_reference || ''}
25
25
  onChange={onChange}
26
+ style={{ borderRadius: '25px' }}
26
27
  />
27
28
  </Container>
28
29
  );
@@ -52,6 +52,7 @@ function ScheduleAfter() {
52
52
  onChange={onChange}
53
53
  value={scheduleDate === null ? scheduleDate : dayjs(scheduleDate)}
54
54
  format="DD/MM/YY"
55
+ style={{ borderRadius: '25px' }}
55
56
  />
56
57
  </MainContainer>
57
58
  );
@@ -1,4 +1,8 @@
1
- import { Label, SelectDropdown } from '@bjsdistribution/dms-component-library';
1
+ import {
2
+ Label,
3
+ SelectDropdown,
4
+ dropdownStyles,
5
+ } from '@bjsdistribution/dms-component-library';
2
6
  import React from 'react';
3
7
  import styled from 'styled-components';
4
8
  import { vehicleTypeOptions } from '../../helper';
@@ -14,6 +18,14 @@ function VehicleTypeDropdown() {
14
18
  openMenuOnFocus
15
19
  isDisabled={true}
16
20
  value={vehicleTypeOptions[1]}
21
+ styles={{
22
+ ...dropdownStyles,
23
+ control: styles => ({
24
+ ...styles,
25
+ borderRadius: '25px',
26
+ cursor: 'pointer',
27
+ }),
28
+ }}
17
29
  />
18
30
  </FormContainer>
19
31
  );
@@ -1,5 +1,9 @@
1
1
  import React from 'react';
2
- import { Label, SelectDropdown } from '@bjsdistribution/dms-component-library';
2
+ import {
3
+ Label,
4
+ SelectDropdown,
5
+ dropdownStyles,
6
+ } from '@bjsdistribution/dms-component-library';
3
7
  import { useOrderDetails, useOrderStaticData } from '../../../store';
4
8
  import styled from 'styled-components';
5
9
  import { capitalize } from '../../../utils';
@@ -38,6 +42,14 @@ function DeliveryPointDropdown() {
38
42
  )}
39
43
  openMenuOnFocus
40
44
  onChange={onChange}
45
+ styles={{
46
+ ...dropdownStyles,
47
+ control: styles => ({
48
+ ...styles,
49
+ borderRadius: '25px',
50
+ cursor: 'pointer',
51
+ }),
52
+ }}
41
53
  />
42
54
  </Container>
43
55
  );
@@ -1,5 +1,9 @@
1
1
  import React from 'react';
2
- import { Label, SelectDropdown } from '@bjsdistribution/dms-component-library';
2
+ import {
3
+ Label,
4
+ SelectDropdown,
5
+ dropdownStyles,
6
+ } from '@bjsdistribution/dms-component-library';
3
7
  import { useOrderDetails, useOrderStaticData } from '../../../store';
4
8
  import styled from 'styled-components';
5
9
  import { capitalize } from '../../../utils';
@@ -32,6 +36,14 @@ function ServiceTypeDropdown() {
32
36
  inputId="serviceTypeDropdown"
33
37
  openMenuOnFocus
34
38
  onChange={onChange}
39
+ styles={{
40
+ ...dropdownStyles,
41
+ control: styles => ({
42
+ ...styles,
43
+ borderRadius: '25px',
44
+ cursor: 'pointer',
45
+ }),
46
+ }}
35
47
  />
36
48
  </Container>
37
49
  );
@@ -1,6 +1,10 @@
1
1
  import React from 'react';
2
2
  import { useOrderDetails, useOrderStaticData } from '../../../store';
3
- import { Label, SelectDropdown } from '@bjsdistribution/dms-component-library';
3
+ import {
4
+ Label,
5
+ SelectDropdown,
6
+ dropdownStyles,
7
+ } from '@bjsdistribution/dms-component-library';
4
8
  import styled from 'styled-components';
5
9
  import { capitalize } from '../../../utils';
6
10
 
@@ -37,6 +41,15 @@ function TimedServiceDropdown() {
37
41
  )}
38
42
  inputId="timedServiceDropdown"
39
43
  onChange={onChange}
44
+ styles={{
45
+ ...dropdownStyles,
46
+
47
+ control: styles => ({
48
+ ...styles,
49
+ borderRadius: '25px',
50
+ cursor: 'pointer',
51
+ }),
52
+ }}
40
53
  />
41
54
  </Container>
42
55
  );
@@ -5,11 +5,11 @@ import {
5
5
  } from '../../../order-daily-overview/return-order-table/return-orders-filters/returnstyles';
6
6
  import { Checkbox } from '@bjsdistribution/dms-component-library';
7
7
  import { data } from '../../../order-daily-overview/table/table-data/Fakedata';
8
- import { useSelectedEmail } from '../../../store';
9
8
  import ActionIcon from '../../../../assets/icons/ActionIcon';
9
+ import { useSelectedOrders } from '../../../store';
10
10
 
11
11
  const ReturnProductTable = () => {
12
- const [selectedInvoices, setSelectedInvoices] = useSelectedEmail();
12
+ const [selectedInvoices, setSelectedInvoices] = useSelectedOrders();
13
13
  const [selectAll, setSelectAll] = useState(false);
14
14
 
15
15
  const handleSelectAll = (e: any) => {
@@ -1,6 +1,13 @@
1
1
  import { atom, useAtom } from 'jotai';
2
2
  import { atomWithReducer } from 'jotai/utils';
3
- import { CreateProduct, OrderActionsType, OrdersType, UnRecieveOrderProduct, UpdateOrderProduct } from './types';
3
+ import {
4
+ CreateProduct,
5
+ OrderActionsType,
6
+ OrdersType,
7
+ UnRecieveOrderProduct,
8
+ UpdateOrderProduct,
9
+ } from './types';
10
+ import { ClientData } from '../order-daily-overview/common/interface';
4
11
  // OrderActionsType
5
12
  const activeTabAtom = atom<string>('active');
6
13
  const infoAtom = atom<boolean | undefined>(false);
@@ -11,6 +18,11 @@ const date = atom(new Date());
11
18
 
12
19
  const orderStaticDataAtom = atom<any>({});
13
20
 
21
+ const clientDataAtom = atom<ClientData[]>([]);
22
+ const returnDataAtom = atom<any[]>([]);
23
+
24
+ const returnAfterOrderAtom = atom<any[]>([]);
25
+
14
26
  export const ordersInitialValue: OrdersType = {
15
27
  depot_id: null,
16
28
  gsit_order_id: null,
@@ -92,18 +104,18 @@ export const orderProductInitialvalue: CreateProduct = {
92
104
  };
93
105
 
94
106
  export const unrecieveOrderProducts: UnRecieveOrderProduct = {
95
- unrecieve_reason_id: 0,
96
- unrecieve_note: '',
97
- // id: 0
107
+ unrecieve_reason_id: 0,
108
+ unrecieve_note: '',
109
+ // id: 0
98
110
  };
99
111
 
100
112
  export const updateOrderProducts: UpdateOrderProduct = {
101
113
  id: 0,
102
- order_id: 0,
103
- product_type_id: 0,
104
- product_return_action_id: 0,
105
- return_location: '',
106
- return_reason_id: 0
114
+ order_id: 0,
115
+ product_type_id: 0,
116
+ product_return_action_id: 0,
117
+ return_location: '',
118
+ return_reason_id: 0,
107
119
  };
108
120
 
109
121
  export const usedate = () => {
@@ -126,6 +138,17 @@ function useOrderStaticData() {
126
138
  return useAtom(orderStaticDataAtom);
127
139
  }
128
140
 
141
+ function useClientData() {
142
+ return useAtom(clientDataAtom);
143
+ }
144
+
145
+ function useReturnData() {
146
+ return useAtom(returnDataAtom);
147
+ }
148
+
149
+ function useReturnAfterOrderData() {
150
+ return useAtom(returnAfterOrderAtom);
151
+ }
129
152
  // Define initial modal state
130
153
  export const initialModalState = {
131
154
  openModalType: null,
@@ -191,7 +214,9 @@ function useCreateOrderProducts() {
191
214
  return useAtom(createOrderProduct);
192
215
  }
193
216
 
194
- const unrevieveOrderProduct = atom<UnRecieveOrderProduct>(unrecieveOrderProducts);
217
+ const unrevieveOrderProduct = atom<UnRecieveOrderProduct>(
218
+ unrecieveOrderProducts
219
+ );
195
220
  function useRecieveOrderProducts() {
196
221
  return useAtom(unrevieveOrderProduct);
197
222
  }
@@ -209,7 +234,7 @@ export const errorAtom = atom({
209
234
  homeError: '',
210
235
  mobileError: '',
211
236
  emailError: '',
212
- w3wError: ''
237
+ w3wError: '',
213
238
  });
214
239
 
215
240
  export {
@@ -224,7 +249,10 @@ export {
224
249
  useDeleteProdsID,
225
250
  useCreateOrderProducts,
226
251
  useRecieveOrderProducts,
227
- useUpdateOrderProducts
252
+ useUpdateOrderProducts,
253
+ useClientData,
254
+ useReturnData,
255
+ useReturnAfterOrderData,
228
256
  };
229
257
  // Popup state Manage
230
258
  const initialState = null;
@@ -21,6 +21,12 @@ const reminderTableData = atom<any[]>([]);
21
21
 
22
22
  const inQueueDataAtom = atom<any>({});
23
23
 
24
+ const customerData = atom<any>([]);
25
+
26
+ const actionTypeData = atom<any>([]);
27
+
28
+ const locationData = atom<any>([]);
29
+
24
30
  function useReminderData() {
25
31
  return useAtom(reminderTableData);
26
32
  }
@@ -49,10 +55,10 @@ function useEmailInvoice() {
49
55
  return useAtom(emailInvoiceData);
50
56
  }
51
57
 
52
- const selectedEmailList = atom<any[]>([]);
58
+ const selectedOrderlList = atom<any[]>([]);
53
59
 
54
- function useSelectedEmail() {
55
- return useAtom(selectedEmailList);
60
+ function useSelectedOrders() {
61
+ return useAtom(selectedOrderlList);
56
62
  }
57
63
 
58
64
  // Sticky menu state
@@ -61,6 +67,18 @@ export const useStickyStatus = () => {
61
67
  return useAtom(stickyStatus);
62
68
  };
63
69
 
70
+ function useCustomerData() {
71
+ return useAtom(customerData);
72
+ }
73
+
74
+ function useActionType() {
75
+ return useAtom(actionTypeData);
76
+ }
77
+
78
+ function useLocationData() {
79
+ return useAtom(locationData);
80
+ }
81
+
64
82
  export {
65
83
  useAtom,
66
84
  useFilter,
@@ -70,5 +88,9 @@ export {
70
88
  useReminderData,
71
89
  useInQueueData,
72
90
  useEmailInvoice,
73
- useSelectedEmail
91
+ // useSelectedEmail,
92
+ useCustomerData,
93
+ useActionType,
94
+ useLocationData,
95
+ useSelectedOrders,
74
96
  };
@@ -9,10 +9,6 @@ export type SelectDateType = {
9
9
 
10
10
  export type OrderViewType = 'add' | 'view' | 'edit';
11
11
 
12
-
13
-
14
-
15
-
16
12
  export interface ColumnConfig {
17
13
  key: string;
18
14
  label: string;
@@ -33,7 +29,7 @@ export interface Column {
33
29
  render?: (data: any, row: TableRow) => React.ReactNode;
34
30
  callback?: (data: any) => void;
35
31
  sortable?: boolean;
36
- showIcon?: boolean
32
+ showIcon?: boolean;
37
33
  }
38
34
 
39
35
  export interface TableRow {
@@ -45,7 +41,7 @@ export interface ApiResponse {
45
41
  code: number;
46
42
  error: string | null;
47
43
  error_traceback: string | null;
48
- data: any;
44
+ data: any[];
49
45
  }
50
46
 
51
47
  export interface InvoiceData {
@@ -1,5 +0,0 @@
1
- declare const useInfiniteScroll: (paginationData: any, setShouldPerformAction: Function, tableScrolling: any) => {
2
- page: number;
3
- scrollActivated: boolean;
4
- };
5
- export default useInfiniteScroll;
@@ -1,3 +0,0 @@
1
- import React from 'react';
2
- declare const RFI: React.FC;
3
- export default RFI;
@@ -1,18 +0,0 @@
1
- import React from 'react';
2
- import { Column } from '../../../types';
3
- export declare const selectedValueAtom: import("jotai/esm/").PrimitiveAtom<null> & {
4
- init: null;
5
- };
6
- export declare const selectedIDAtom: import("jotai/esm/").PrimitiveAtom<null> & {
7
- init: null;
8
- };
9
- interface MyTableProps {
10
- columns: Column[];
11
- data: any;
12
- loading: boolean;
13
- loadingskeleton?: boolean;
14
- view?: 'rfi';
15
- }
16
- declare const MyTable: React.FC<MyTableProps>;
17
- export default MyTable;
18
- export declare const CoverDiv: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
@@ -1,18 +0,0 @@
1
- import React from 'react';
2
- import { Column } from '../../../types';
3
- export declare const selectedValueAtom: import("jotai/esm/").PrimitiveAtom<null> & {
4
- init: null;
5
- };
6
- export declare const selectedIDAtom: import("jotai/esm/").PrimitiveAtom<null> & {
7
- init: null;
8
- };
9
- interface MyTableProps {
10
- columns: Column[];
11
- data: any;
12
- loading: boolean;
13
- loadingskeleton?: boolean;
14
- view?: 'rfi';
15
- }
16
- declare const Table: React.FC<MyTableProps>;
17
- export default Table;
18
- export declare const CoverDiv: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
@@ -1,54 +0,0 @@
1
- import { useCallback, useEffect, useState } from 'react';
2
-
3
- const useInfiniteScroll = (
4
- paginationData: any,
5
- setShouldPerformAction: Function,
6
- tableScrolling: any
7
- ) => {
8
- const [page, setPage] = useState(1);
9
- const [scrollActivated, setScrollActivated] = useState(false);
10
- const debounce = (func: Function, wait: number) => {
11
- let timeout: ReturnType<typeof setTimeout>;
12
- return (...args: any[]) => {
13
- clearTimeout(timeout);
14
- timeout = setTimeout(() => func(...args), wait);
15
- };
16
- };
17
-
18
- const handleInfiniteScroll = useCallback(
19
- debounce(() => {
20
- setScrollActivated(true);
21
- const element = document.getElementById(tableScrolling);
22
- if (element) {
23
- const { scrollHeight, offsetHeight, scrollTop } = element;
24
- let totalPages;
25
- if (paginationData) {
26
- totalPages = JSON.parse(paginationData)?.total_pages;
27
- }
28
- if (
29
- offsetHeight + scrollTop >= scrollHeight &&
30
- totalPages >= page &&
31
- totalPages > page
32
- ) {
33
- setShouldPerformAction(true);
34
- setPage(prev => prev + 1);
35
- }
36
- }
37
- }, 700),
38
- [paginationData, page, setShouldPerformAction]
39
- );
40
- useEffect(() => {
41
- const element = document.getElementById(tableScrolling);
42
- if (element) {
43
- element.addEventListener('scroll', handleInfiniteScroll);
44
- }
45
- return () => {
46
- if (element) {
47
- element.removeEventListener('scroll', handleInfiniteScroll);
48
- }
49
- };
50
- }, [handleInfiniteScroll]);
51
- return { page, scrollActivated };
52
- };
53
-
54
- export default useInfiniteScroll;