@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.
- package/dist/components/order-daily-overview/common/interface.d.ts +22 -0
- package/dist/components/order-daily-overview/header-filters/Styledfilters.d.ts +1 -2
- package/dist/components/order-daily-overview/header-filters/filterStore.d.ts +16 -0
- package/dist/components/order-daily-overview/return-order-table/return-orders-filters/returnstyles.d.ts +1 -0
- package/dist/components/order-daily-overview/shared/utlis.d.ts +2 -2
- package/dist/components/order-daily-overview/store/store.d.ts +4 -0
- package/dist/components/order-view/details-filters/left-side-filters/dropdowns/PrintDropDown.d.ts +3 -1
- package/dist/components/order-view/store.d.ts +5 -1
- package/dist/components/store.d.ts +5 -2
- package/dist/components/types.d.ts +1 -1
- package/dist/dms-client-return.cjs.development.js +1065 -964
- package/dist/dms-client-return.cjs.development.js.map +1 -1
- package/dist/dms-client-return.cjs.production.min.js +1 -1
- package/dist/dms-client-return.cjs.production.min.js.map +1 -1
- package/dist/dms-client-return.esm.js +1067 -966
- package/dist/dms-client-return.esm.js.map +1 -1
- package/package.json +2 -2
- package/src/components/order-daily-overview/common/fakedata.tsx +5 -6
- package/src/components/order-daily-overview/common/interface.ts +120 -97
- package/src/components/order-daily-overview/filters/Filters.tsx +1 -8
- package/src/components/order-daily-overview/header-filters/HeaderFilter.tsx +56 -67
- package/src/components/order-daily-overview/header-filters/SelectionFilter.tsx +160 -223
- package/src/components/order-daily-overview/header-filters/Styledfilters.tsx +19 -7
- package/src/components/order-daily-overview/header-filters/filterStore.ts +145 -0
- package/src/components/order-daily-overview/index.tsx +59 -6
- package/src/components/order-daily-overview/return-after-table/ReturnAfterTable.tsx +24 -1
- package/src/components/order-daily-overview/return-after-table/table/OrderTable.tsx +177 -234
- package/src/components/order-daily-overview/return-after-table/table-filters/ReturnOrderFilter.tsx +63 -6
- package/src/components/order-daily-overview/return-order-table/return-orders-filters/ReturnFilter.tsx +5 -47
- package/src/components/order-daily-overview/return-order-table/return-orders-filters/ReturnOrderTable.tsx +51 -185
- package/src/components/order-daily-overview/return-order-table/return-orders-filters/returnstyles.ts +62 -0
- package/src/components/order-daily-overview/store/store.ts +23 -12
- package/src/components/order-daily-overview/table/ReturnTable.tsx +193 -205
- package/src/components/order-view/details-filters/DetailsFilters.tsx +3 -2
- package/src/components/order-view/details-filters/left-side-filters/dropdowns/PrintDropDown.tsx +57 -46
- package/src/components/order-view/general-information/Status.tsx +1 -1
- package/src/components/order-view/index.tsx +6 -4
- package/src/components/order-view/modalsPopup/UnReceiveProduct.tsx +1 -1
- package/src/components/order-view/order-actions/actions/escalation/EscalationModal.tsx +1 -1
- package/src/components/order-view/order-details/expanded-content/customer-section/RecipientName.tsx +1 -0
- package/src/components/order-view/order-details/expanded-content/customer-section/contact-info/ContactEmail.tsx +1 -0
- package/src/components/order-view/order-details/expanded-content/customer-section/contact-info/ContactHome.tsx +1 -0
- package/src/components/order-view/order-details/expanded-content/customer-section/contact-info/ContactMobile.tsx +1 -1
- package/src/components/order-view/order-details/expanded-content/customer-section/contact-info/ContactWork.tsx +1 -0
- package/src/components/order-view/order-details/expanded-content/customer-section/location-info/Address.tsx +1 -0
- package/src/components/order-view/order-details/expanded-content/customer-section/location-info/Latitude.tsx +1 -0
- package/src/components/order-view/order-details/expanded-content/customer-section/location-info/Longitude.tsx +1 -0
- package/src/components/order-view/order-details/expanded-content/customer-section/location-info/Postcode.tsx +1 -0
- package/src/components/order-view/order-details/expanded-content/customer-section/location-info/What3words.tsx +1 -0
- package/src/components/order-view/order-details/expanded-content/footer/index.tsx +3 -2
- package/src/components/order-view/order-details/expanded-content/index.tsx +1 -1
- package/src/components/order-view/order-details/expanded-content/instruction-section/index.tsx +2 -1
- package/src/components/order-view/order-details/expanded-content/orders-section/Carrier.tsx +7 -1
- package/src/components/order-view/order-details/expanded-content/orders-section/DeliveryDate.tsx +1 -0
- package/src/components/order-view/order-details/expanded-content/orders-section/Depot.tsx +14 -1
- package/src/components/order-view/order-details/expanded-content/orders-section/Droptime.tsx +2 -1
- package/src/components/order-view/order-details/expanded-content/orders-section/OrderNumber.tsx +2 -1
- package/src/components/order-view/order-details/expanded-content/orders-section/RecipientReference.tsx +2 -1
- package/src/components/order-view/order-details/expanded-content/orders-section/ScheduleAfter.tsx +1 -0
- package/src/components/order-view/order-details/expanded-content/orders-section/VehicleType.tsx +13 -1
- package/src/components/order-view/order-details/expanded-content/services-section/DeliveryPoint.tsx +13 -1
- package/src/components/order-view/order-details/expanded-content/services-section/ServiceType.tsx +13 -1
- package/src/components/order-view/order-details/expanded-content/services-section/TimedService.tsx +14 -1
- package/src/components/order-view/return-client-products/product-table/ReturnProductTable.tsx +2 -2
- package/src/components/order-view/store.ts +40 -12
- package/src/components/store.ts +26 -4
- package/src/components/types.ts +2 -6
- package/dist/components/order-daily-overview/table/InfiniteScrolling.d.ts +0 -5
- package/dist/components/order-daily-overview/table/Return.d.ts +0 -3
- package/dist/components/order-daily-overview/table/table-data/MyTable.d.ts +0 -18
- package/dist/components/order-daily-overview/table/table-data/Table.d.ts +0 -18
- package/src/components/order-daily-overview/table/InfiniteScrolling.tsx +0 -54
- package/src/components/order-daily-overview/table/Return.tsx +0 -156
- package/src/components/order-daily-overview/table/table-data/MyTable.tsx +0 -433
- package/src/components/order-daily-overview/table/table-data/Table.tsx +0 -445
|
@@ -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
|
-
|
|
103
|
+
align-items: center;
|
|
104
|
+
/* top: 21px; */
|
|
104
105
|
`;
|
|
105
106
|
|
|
106
107
|
export default OrderDetailsFooter;
|
package/src/components/order-view/order-details/expanded-content/instruction-section/index.tsx
CHANGED
|
@@ -21,7 +21,7 @@ function InstructionSection() {
|
|
|
21
21
|
const FormInputs = styled.div`
|
|
22
22
|
display: flex;
|
|
23
23
|
flex-direction: column;
|
|
24
|
-
gap:
|
|
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
|
|
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
|
}
|
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
import {
|
|
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
|
);
|
package/src/components/order-view/order-details/expanded-content/orders-section/Droptime.tsx
CHANGED
|
@@ -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;
|
package/src/components/order-view/order-details/expanded-content/orders-section/OrderNumber.tsx
CHANGED
|
@@ -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
|
);
|
package/src/components/order-view/order-details/expanded-content/orders-section/VehicleType.tsx
CHANGED
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
import {
|
|
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
|
);
|
package/src/components/order-view/order-details/expanded-content/services-section/DeliveryPoint.tsx
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
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
|
);
|
package/src/components/order-view/order-details/expanded-content/services-section/ServiceType.tsx
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
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
|
);
|
package/src/components/order-view/order-details/expanded-content/services-section/TimedService.tsx
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { useOrderDetails, useOrderStaticData } from '../../../store';
|
|
3
|
-
import {
|
|
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
|
);
|
package/src/components/order-view/return-client-products/product-table/ReturnProductTable.tsx
CHANGED
|
@@ -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] =
|
|
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 {
|
|
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
|
-
|
|
96
|
-
|
|
97
|
-
|
|
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
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
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>(
|
|
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;
|
package/src/components/store.ts
CHANGED
|
@@ -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
|
|
58
|
+
const selectedOrderlList = atom<any[]>([]);
|
|
53
59
|
|
|
54
|
-
function
|
|
55
|
-
return useAtom(
|
|
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
|
};
|
package/src/components/types.ts
CHANGED
|
@@ -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,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;
|