intelliwaketssveltekitv25 0.1.94 → 0.1.95

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/Modal.svelte CHANGED
@@ -40,6 +40,7 @@
40
40
 
41
41
  onOK = () => {
42
42
  },
43
+ onOKPromise,
43
44
  onCancel = () => {
44
45
  },
45
46
  onClose = () => {
@@ -72,6 +73,7 @@
72
73
  borderFooter?: boolean
73
74
 
74
75
  onOK?: () => void
76
+ onOKPromise?: () => Promise<void>
75
77
  onCancel?: () => void
76
78
  onClose?: () => void
77
79
  } = $props()
@@ -82,10 +84,19 @@
82
84
  e?.stopPropagation()
83
85
  if (show !== noShowValue && !okDisabled && !disable) {
84
86
  onOK()
85
- if (!noCloseOnOK) {
86
- onClose()
87
- await tick()
88
- show = noShowValue
87
+ if (onOKPromise) {
88
+ return onOKPromise()
89
+ .then(async () => {
90
+ onClose()
91
+ await tick()
92
+ show = noShowValue
93
+ })
94
+ } else {
95
+ if (!noCloseOnOK) {
96
+ onClose()
97
+ await tick()
98
+ show = noShowValue
99
+ }
89
100
  }
90
101
  }
91
102
  }
@@ -27,6 +27,7 @@ type $$ComponentProps = {
27
27
  classButton?: string;
28
28
  borderFooter?: boolean;
29
29
  onOK?: () => void;
30
+ onOKPromise?: () => Promise<void>;
30
31
  onCancel?: () => void;
31
32
  onClose?: () => void;
32
33
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "intelliwaketssveltekitv25",
3
- "version": "0.1.94",
3
+ "version": "0.1.95",
4
4
  "exports": {
5
5
  ".": {
6
6
  "types": "./dist/index.d.ts",