lkt-item-crud 2.0.36 → 2.0.38

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lkt-item-crud",
3
- "version": "2.0.36",
3
+ "version": "2.0.38",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "module": "./dist/build.js",
@@ -5,9 +5,12 @@
5
5
  import { debug } from '../functions/debug';
6
6
  import {
7
7
  ButtonConfig,
8
- ensureButtonConfig, extractI18nValue, FormUiConfig,
8
+ ensureButtonConfig,
9
+ extractI18nValue,
10
+ FormUiConfig,
9
11
  getDefaultValues,
10
- getFormDataState, getFormSlotKeys,
12
+ getFormDataState,
13
+ getFormSlotKeys,
11
14
  ItemCrud,
12
15
  ItemCrudButtonNavPosition,
13
16
  ItemCrudConfig,
@@ -149,6 +152,16 @@
149
152
 
150
153
  try {
151
154
  const r: HTTPResponse = await httpCall(props.readResource, props.readData);
155
+
156
+ r.notifications?.forEach(notification => {
157
+ if (notification.category === 'toast'){
158
+ openToast(<ToastConfig>{
159
+ positionX: ToastPositionX.Right,
160
+ ...notification.payload,
161
+ });
162
+ }
163
+ })
164
+
152
165
  debug('fetchItem -> response', r);
153
166
  isLoading.value = false;
154
167
  httpStatus.value = r.httpStatus;
@@ -316,6 +329,15 @@
316
329
  },
317
330
  onCreate = ($event: PointerEvent, r: HTTPResponse) => {
318
331
  debug('onCreate');
332
+ r.notifications?.forEach(notification => {
333
+ if (notification.category === 'toast'){
334
+ openToast(<ToastConfig>{
335
+ positionX: ToastPositionX.Right,
336
+ ...notification.payload,
337
+ });
338
+ }
339
+ })
340
+
319
341
  if (!ensureValidResourceSave(r, safeCreateButton.value.resource)) {
320
342
  if (props.notificationType === NotificationType.Toast) {
321
343
  openToast(<ToastConfig>{
@@ -323,6 +345,7 @@
323
345
  details: LktSettings.defaultCreateErrorDetails,
324
346
  icon: LktSettings.defaultCreateErrorIcon,
325
347
  positionX: ToastPositionX.Right,
348
+ ...r.toast,
326
349
  });
327
350
  }
328
351
  return;
@@ -337,6 +360,7 @@
337
360
  details: LktSettings.defaultCreateSuccessDetails,
338
361
  icon: LktSettings.defaultCreateSuccessIcon,
339
362
  positionX: ToastPositionX.Right,
363
+ ...r.toast,
340
364
  });
341
365
  }
342
366
  doAutoReloadId(r, props.redirectOnCreate);
@@ -345,6 +369,16 @@
345
369
  },
346
370
  onUpdate = ($event: PointerEvent, r: HTTPResponse) => {
347
371
  debug('onUpdate');
372
+
373
+ r.notifications?.forEach(notification => {
374
+ if (notification.category === 'toast'){
375
+ openToast(<ToastConfig>{
376
+ positionX: ToastPositionX.Right,
377
+ ...notification.payload,
378
+ });
379
+ }
380
+ })
381
+
348
382
  if (!ensureValidResourceSave(r, safeUpdateButton.value.resource)) {
349
383
  if (props.notificationType === NotificationType.Toast) {
350
384
  openToast(<ToastConfig>{
@@ -352,6 +386,7 @@
352
386
  details: LktSettings.defaultUpdateErrorDetails,
353
387
  icon: LktSettings.defaultUpdateErrorIcon,
354
388
  positionX: ToastPositionX.Right,
389
+ ...r.toast,
355
390
  });
356
391
  }
357
392
  return;
@@ -365,6 +400,7 @@
365
400
  details: LktSettings.defaultUpdateSuccessDetails,
366
401
  icon: LktSettings.defaultUpdateSuccessIcon,
367
402
  positionX: ToastPositionX.Right,
403
+ ...r.toast,
368
404
  });
369
405
  }
370
406
  doAutoReloadId(r);
@@ -372,6 +408,15 @@
372
408
  },
373
409
  onDrop = ($event: PointerEvent, r: HTTPResponse) => {
374
410
  debug('onDrop');
411
+ r.notifications?.forEach(notification => {
412
+ if (notification.category === 'toast'){
413
+ openToast(<ToastConfig>{
414
+ positionX: ToastPositionX.Right,
415
+ ...notification.payload,
416
+ });
417
+ }
418
+ })
419
+
375
420
  if (!ensureValidResourceSave(r, safeDropButton.value.resource)) {
376
421
  if (props.notificationType === NotificationType.Toast) {
377
422
  openToast(<ToastConfig>{
@@ -379,6 +424,7 @@
379
424
  details: LktSettings.defaultDropErrorDetails,
380
425
  icon: LktSettings.defaultDropErrorIcon,
381
426
  positionX: ToastPositionX.Right,
427
+ ...r.toast,
382
428
  });
383
429
  }
384
430
  return;
@@ -389,6 +435,7 @@
389
435
  details: LktSettings.defaultDropSuccessDetails,
390
436
  icon: LktSettings.defaultDropSuccessIcon,
391
437
  positionX: ToastPositionX.Right,
438
+ ...r.toast,
392
439
  });
393
440
  }
394
441
  emit('drop', r);