@bjsdistribution/dms-client-return 0.0.12 → 0.0.13
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/css/TableStyle.d.ts +13 -30
- package/dist/components/order-view/store.d.ts +77 -28
- package/dist/components/order-view/types.d.ts +61 -11
- package/dist/components/order-view/utils.d.ts +4 -0
- package/dist/dms-client-return.cjs.development.js +1543 -1011
- 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 +1545 -1013
- package/dist/dms-client-return.esm.js.map +1 -1
- package/package.json +2 -2
- package/src/common/expand-collapse/index.tsx +4 -4
- package/src/components/order-daily-overview/common/css/TableStyle.tsx +42 -342
- package/src/components/order-daily-overview/index.tsx +2 -2
- package/src/components/order-daily-overview/return-after-table/ReturnAfterTable.tsx +2 -2
- package/src/components/order-daily-overview/return-order-table/ReturnTable.tsx +2 -2
- package/src/components/order-daily-overview/return-order-table/return-orders-filters/returnstyles.ts +2 -2
- package/src/components/order-daily-overview/table/table-data/styles.ts +1 -1
- package/src/components/order-view/DynamicTable.tsx +12 -3
- package/src/components/order-view/flags-action-modal/Actions.tsx +1 -2
- package/src/components/order-view/general-information/Status.tsx +13 -17
- package/src/components/order-view/generic-table/AuditLogs.tsx +81 -19
- package/src/components/order-view/index.tsx +192 -192
- package/src/components/order-view/modalsPopup/ModalManager.tsx +2 -2
- package/src/components/order-view/modalsPopup/ProductAction.tsx +1 -1
- package/src/components/order-view/notes/AddNote.tsx +2 -3
- package/src/components/order-view/notes/index.tsx +9 -22
- package/src/components/order-view/order-details/expanded-content/footer/index.tsx +90 -73
- package/src/components/order-view/order-details/expanded-content/instruction-section/DeliveryInstructions.tsx +2 -9
- package/src/components/order-view/order-details/expanded-content/orders-section/Droptime.tsx +2 -10
- package/src/components/order-view/order-details/expanded-content/orders-section/VehicleType.tsx +16 -15
- package/src/components/order-view/order-details/expanded-content/services-section/AssemblyType.tsx +88 -15
- package/src/components/order-view/order-details/expanded-content/services-section/DeliveryPoint.tsx +1 -13
- package/src/components/order-view/order-details/expanded-content/services-section/OrderServices.tsx +141 -16
- package/src/components/order-view/order-details/expanded-content/services-section/ServiceType.tsx +1 -13
- package/src/components/order-view/order-details/expanded-content/services-section/TimedService.tsx +19 -18
- package/src/components/order-view/products-info/expanded-content/products/index.tsx +2 -2
- package/src/components/order-view/return-client-products/ProductTable.tsx +1 -1
- package/src/components/order-view/return-client-products/product-table/ReturnProductTable.tsx +79 -70
- package/src/components/order-view/return-client-products/product-table-footer/ProductDetailsFooter.tsx +5 -5
- package/src/components/order-view/store.ts +215 -53
- package/src/components/order-view/system-event-logs/expanded-content/index.tsx +6 -10
- package/src/components/order-view/toolbox-resources/expanded-content/index.tsx +68 -6
- package/src/components/order-view/types.ts +89 -33
- package/src/components/order-view/utils.ts +20 -17
- package/src/index.tsx +13 -9
|
@@ -109,28 +109,25 @@ export const getCookie = (name: string): string | null => {
|
|
|
109
109
|
};
|
|
110
110
|
|
|
111
111
|
export const handleKeyDown = (e: React.KeyboardEvent<HTMLInputElement>) => {
|
|
112
|
-
// Allowed keys: numbers (0-9), '.', '-'
|
|
113
|
-
const allowedKeys = [
|
|
114
|
-
'0',
|
|
115
|
-
'1',
|
|
116
|
-
'2',
|
|
117
|
-
'3',
|
|
118
|
-
'4',
|
|
119
|
-
'5',
|
|
120
|
-
'6',
|
|
121
|
-
'7',
|
|
122
|
-
'8',
|
|
123
|
-
'9',
|
|
124
|
-
'.',
|
|
125
|
-
'-',
|
|
126
|
-
'+',
|
|
127
|
-
];
|
|
112
|
+
// Allowed keys: numbers (0-9), '.', '-', '+'
|
|
113
|
+
const allowedKeys = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '.', '-', '+'];
|
|
128
114
|
|
|
129
|
-
// Allow backspace, delete and Tab keys
|
|
115
|
+
// Allow backspace, delete, and Tab keys
|
|
130
116
|
if (e.key === 'Backspace' || e.key === 'Delete' || e.key === 'Tab') {
|
|
131
117
|
return;
|
|
132
118
|
}
|
|
133
119
|
|
|
120
|
+
const input = e.currentTarget;
|
|
121
|
+
|
|
122
|
+
// Check if '+' is allowed only at the start and not duplicated
|
|
123
|
+
if (e.key === '+') {
|
|
124
|
+
// Prevent if '+' is not at the start or there is already a '+' in the input
|
|
125
|
+
if (input.selectionStart !== 0 || input.value.includes('+')) {
|
|
126
|
+
e.preventDefault();
|
|
127
|
+
return;
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
|
|
134
131
|
// Prevent input if key is not in allowedKeys
|
|
135
132
|
if (!allowedKeys.includes(e.key)) {
|
|
136
133
|
e.preventDefault();
|
|
@@ -148,6 +145,11 @@ export const generateObj = (keys: string[], sourceObj: any) => {
|
|
|
148
145
|
};
|
|
149
146
|
|
|
150
147
|
export const findDifference = (obj1: any, obj2: any) => {
|
|
148
|
+
// Check if obj1 or obj2 is null or undefined and return an empty object if so
|
|
149
|
+
if (!obj1 || !obj2) {
|
|
150
|
+
return {};
|
|
151
|
+
}
|
|
152
|
+
|
|
151
153
|
const diffKeys = Object.keys(obj1).reduce((acc: any, key) => {
|
|
152
154
|
if (!(key in obj2) || obj1[key] !== obj2[key]) {
|
|
153
155
|
acc.push(key);
|
|
@@ -162,6 +164,7 @@ export const findDifference = (obj1: any, obj2: any) => {
|
|
|
162
164
|
}
|
|
163
165
|
}
|
|
164
166
|
});
|
|
167
|
+
|
|
165
168
|
const newObj = generateObj(diffKeys, obj2);
|
|
166
169
|
return newObj;
|
|
167
170
|
};
|
package/src/index.tsx
CHANGED
|
@@ -9,6 +9,7 @@ import { useTableName } from './components/order-daily-overview/store/store';
|
|
|
9
9
|
// import ReturnOrderTable from './components/order-daily-overview/return-order-table/return-orders-filters/ReturnOrderTable';
|
|
10
10
|
import ReturnMainTable from './components/order-daily-overview';
|
|
11
11
|
import { notification } from 'antd';
|
|
12
|
+
import RouterHeader from './components/order-daily-overview/header/route-header/RouterHeader';
|
|
12
13
|
|
|
13
14
|
function ReturnClient() {
|
|
14
15
|
notification.config({
|
|
@@ -38,14 +39,16 @@ function ReturnClient() {
|
|
|
38
39
|
}, [selectedClient]);
|
|
39
40
|
|
|
40
41
|
return (
|
|
41
|
-
|
|
42
|
-
<
|
|
43
|
-
|
|
44
|
-
<
|
|
45
|
-
|
|
46
|
-
|
|
42
|
+
<>
|
|
43
|
+
<RouterHeader />
|
|
44
|
+
<Suspense fallback={<LoadingMessage />}>
|
|
45
|
+
<Routes>
|
|
46
|
+
<Route path="" element={<ReturnMainTable />} />
|
|
47
|
+
<Route path="order-return" element={<ReturnAfterTable />} />
|
|
48
|
+
<Route path="order-return/:id" element={<OrderView />} />
|
|
49
|
+
<Route path="filter/:clientName" element={<ReturnTable />} />
|
|
47
50
|
|
|
48
|
-
|
|
51
|
+
{/* <Route
|
|
49
52
|
path=""
|
|
50
53
|
element={
|
|
51
54
|
selectedClientString ? (
|
|
@@ -55,8 +58,9 @@ function ReturnClient() {
|
|
|
55
58
|
)
|
|
56
59
|
}
|
|
57
60
|
/> */}
|
|
58
|
-
|
|
59
|
-
|
|
61
|
+
</Routes>
|
|
62
|
+
</Suspense>
|
|
63
|
+
</>
|
|
60
64
|
);
|
|
61
65
|
}
|
|
62
66
|
|