umwd-components 0.1.671 → 0.1.672
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/node_modules/base64-js/index.js +1 -1
- package/dist/node_modules/ieee754/index.js +1 -1
- package/dist/src/components/logistics/vendor/EditVendorForm.js +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/components/logistics/vendor/AddVendorForm.tsx +2 -0
- package/src/components/logistics/vendor/EditVendorForm.tsx +157 -70
package/package.json
CHANGED
|
@@ -149,6 +149,7 @@ export function AddVendorForm({
|
|
|
149
149
|
<Grid item xs={12}>
|
|
150
150
|
<Typography variant="h6">Contacts</Typography>
|
|
151
151
|
</Grid>
|
|
152
|
+
|
|
152
153
|
{newContacts.map((contact, index) => {
|
|
153
154
|
return (
|
|
154
155
|
<Grid
|
|
@@ -187,6 +188,7 @@ export function AddVendorForm({
|
|
|
187
188
|
</Grid>
|
|
188
189
|
);
|
|
189
190
|
})}
|
|
191
|
+
|
|
190
192
|
<Grid
|
|
191
193
|
item
|
|
192
194
|
xs={12}
|
|
@@ -201,38 +201,84 @@ export function EditVendorForm({
|
|
|
201
201
|
if (contact.data?.id) {
|
|
202
202
|
if (open.includes(contact.data?.id)) {
|
|
203
203
|
return (
|
|
204
|
-
<Grid
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
204
|
+
<Grid
|
|
205
|
+
item
|
|
206
|
+
xs={12}
|
|
207
|
+
sm={6}
|
|
208
|
+
md={4}
|
|
209
|
+
lg={3}
|
|
210
|
+
sx={{
|
|
211
|
+
justifyContent: "center",
|
|
212
|
+
display: "flex",
|
|
213
|
+
alignItems: "center",
|
|
214
|
+
}}
|
|
215
|
+
key={contact.data.id}
|
|
216
|
+
>
|
|
217
|
+
<Paper
|
|
218
|
+
sx={{
|
|
219
|
+
p: 2,
|
|
220
|
+
width: "100%",
|
|
221
|
+
display: "flex",
|
|
222
|
+
justifyContent: "center",
|
|
223
|
+
alignItems: "center",
|
|
224
|
+
height: "100%",
|
|
225
|
+
}}
|
|
226
|
+
>
|
|
227
|
+
<ContactsFields
|
|
228
|
+
data={contact.data}
|
|
229
|
+
componentName={`contacts[${index}]`}
|
|
230
|
+
componentReference="logistics-elements.contact"
|
|
231
|
+
deleteCallback={() => {
|
|
232
|
+
setOldContacts(
|
|
233
|
+
oldContacts.filter((_, i) => i !== index)
|
|
234
|
+
);
|
|
235
|
+
/* setOpen(
|
|
214
236
|
open.filter((openId) => openId !== contact.data?.id)
|
|
215
237
|
); */
|
|
216
|
-
|
|
217
|
-
|
|
238
|
+
}}
|
|
239
|
+
/>
|
|
240
|
+
</Paper>
|
|
218
241
|
</Grid>
|
|
219
242
|
);
|
|
220
243
|
} else {
|
|
221
244
|
return (
|
|
222
|
-
<Grid
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
245
|
+
<Grid
|
|
246
|
+
item
|
|
247
|
+
xs={12}
|
|
248
|
+
sm={6}
|
|
249
|
+
md={4}
|
|
250
|
+
lg={3}
|
|
251
|
+
sx={{
|
|
252
|
+
justifyContent: "center",
|
|
253
|
+
display: "flex",
|
|
254
|
+
alignItems: "center",
|
|
255
|
+
}}
|
|
256
|
+
key={contact.data.id}
|
|
257
|
+
>
|
|
258
|
+
<Paper
|
|
259
|
+
sx={{
|
|
260
|
+
p: 2,
|
|
261
|
+
width: "100%",
|
|
262
|
+
display: "flex",
|
|
263
|
+
justifyContent: "center",
|
|
264
|
+
alignItems: "center",
|
|
265
|
+
height: "100%",
|
|
266
|
+
}}
|
|
267
|
+
>
|
|
268
|
+
<input
|
|
269
|
+
type="hidden"
|
|
270
|
+
name={`contacts[${index}].id`}
|
|
271
|
+
value={contact.data.id}
|
|
272
|
+
/>
|
|
273
|
+
<input
|
|
274
|
+
type="hidden"
|
|
275
|
+
name={`contacts[${index}].__component`}
|
|
276
|
+
value="logistics-elements.contact"
|
|
277
|
+
/>
|
|
278
|
+
<Contacts
|
|
279
|
+
data={{ ...contact.data, onClick: onClickHandler }}
|
|
280
|
+
/>
|
|
281
|
+
</Paper>
|
|
236
282
|
</Grid>
|
|
237
283
|
);
|
|
238
284
|
}
|
|
@@ -241,60 +287,101 @@ export function EditVendorForm({
|
|
|
241
287
|
})}
|
|
242
288
|
{newContacts.map((contact, index) => {
|
|
243
289
|
return (
|
|
244
|
-
<Grid
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
290
|
+
<Grid
|
|
291
|
+
item
|
|
292
|
+
xs={12}
|
|
293
|
+
sm={6}
|
|
294
|
+
md={4}
|
|
295
|
+
lg={3}
|
|
296
|
+
sx={{
|
|
297
|
+
justifyContent: "center",
|
|
298
|
+
display: "flex",
|
|
299
|
+
alignItems: "center",
|
|
300
|
+
}}
|
|
301
|
+
key={contact.data?.id || index}
|
|
302
|
+
>
|
|
303
|
+
<Paper
|
|
304
|
+
sx={{
|
|
305
|
+
p: 2,
|
|
306
|
+
width: "100%",
|
|
307
|
+
display: "flex",
|
|
308
|
+
justifyContent: "center",
|
|
309
|
+
alignItems: "center",
|
|
310
|
+
height: "100%",
|
|
262
311
|
}}
|
|
263
|
-
|
|
312
|
+
>
|
|
313
|
+
<ContactsFields
|
|
314
|
+
data={contact.data}
|
|
315
|
+
componentName={contact.componentName}
|
|
316
|
+
componentReference="logistics-elements.contact"
|
|
317
|
+
deleteCallback={() => {
|
|
318
|
+
setNewContacts(
|
|
319
|
+
newContacts
|
|
320
|
+
.filter((_, i) => i !== index)
|
|
321
|
+
.map((_, i) => {
|
|
322
|
+
return {
|
|
323
|
+
..._,
|
|
324
|
+
componentName: `contacts[${
|
|
325
|
+
i + oldContacts.length
|
|
326
|
+
}]`,
|
|
327
|
+
};
|
|
328
|
+
})
|
|
329
|
+
);
|
|
330
|
+
}}
|
|
331
|
+
/>
|
|
332
|
+
</Paper>
|
|
264
333
|
</Grid>
|
|
265
334
|
);
|
|
266
335
|
})}
|
|
267
336
|
<Grid
|
|
268
337
|
item
|
|
269
338
|
xs={12}
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
339
|
+
sm={6}
|
|
340
|
+
md={4}
|
|
341
|
+
lg={3}
|
|
342
|
+
sx={{
|
|
343
|
+
justifyContent: "center",
|
|
344
|
+
display: "flex",
|
|
345
|
+
alignItems: "center",
|
|
346
|
+
}}
|
|
274
347
|
>
|
|
275
|
-
<
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
componentReference: "logistics-elements.contact",
|
|
284
|
-
data: {
|
|
285
|
-
uuid: Math.random(),
|
|
286
|
-
first_name: "",
|
|
287
|
-
last_name: "",
|
|
288
|
-
email: "",
|
|
289
|
-
phone_number: "",
|
|
290
|
-
type: ContactType.Other,
|
|
291
|
-
},
|
|
292
|
-
},
|
|
293
|
-
]);
|
|
348
|
+
<Paper
|
|
349
|
+
sx={{
|
|
350
|
+
p: 2,
|
|
351
|
+
width: "100%",
|
|
352
|
+
display: "flex",
|
|
353
|
+
justifyContent: "center",
|
|
354
|
+
alignItems: "center",
|
|
355
|
+
height: "100%",
|
|
294
356
|
}}
|
|
295
357
|
>
|
|
296
|
-
<
|
|
297
|
-
|
|
358
|
+
<Button
|
|
359
|
+
variant={"contained"}
|
|
360
|
+
startIcon={<AddIcon />}
|
|
361
|
+
onClick={() => {
|
|
362
|
+
setNewContacts([
|
|
363
|
+
...newContacts,
|
|
364
|
+
{
|
|
365
|
+
componentName: `contacts[${
|
|
366
|
+
oldContacts.length + newContacts.length
|
|
367
|
+
}]`,
|
|
368
|
+
componentReference: "logistics-elements.contact",
|
|
369
|
+
data: {
|
|
370
|
+
uuid: Math.random(),
|
|
371
|
+
first_name: "",
|
|
372
|
+
last_name: "",
|
|
373
|
+
email: "",
|
|
374
|
+
phone_number: "",
|
|
375
|
+
type: ContactType.Other,
|
|
376
|
+
},
|
|
377
|
+
},
|
|
378
|
+
]);
|
|
379
|
+
}}
|
|
380
|
+
size="large"
|
|
381
|
+
>
|
|
382
|
+
Add contact
|
|
383
|
+
</Button>
|
|
384
|
+
</Paper>
|
|
298
385
|
</Grid>
|
|
299
386
|
<Grid item xs={12}>
|
|
300
387
|
<Typography variant="h6">Notes</Typography>
|