docuseal-svelte 0.0.3 → 0.0.4
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.
|
@@ -57,6 +57,7 @@
|
|
|
57
57
|
export let onInit: ((detail: any) => void) | undefined = undefined
|
|
58
58
|
export let onDecline: ((detail: any) => void) | undefined = undefined
|
|
59
59
|
export let onLoad: ((detail: any) => void) | undefined = undefined
|
|
60
|
+
export let onError: ((detail: any) => void) | undefined = undefined
|
|
60
61
|
|
|
61
62
|
let el: HTMLElement | null = null
|
|
62
63
|
|
|
@@ -81,12 +82,15 @@
|
|
|
81
82
|
const handleDecline = (e: Event) =>
|
|
82
83
|
onDecline && onDecline((e as CustomEvent).detail)
|
|
83
84
|
const handleLoad = (e: Event) => onLoad && onLoad((e as CustomEvent).detail)
|
|
85
|
+
const handleError = (e: Event) =>
|
|
86
|
+
onError && onError((e as CustomEvent).detail)
|
|
84
87
|
|
|
85
88
|
if (el) {
|
|
86
89
|
el.addEventListener("completed", handleCompleted)
|
|
87
90
|
el.addEventListener("init", handleInit)
|
|
88
91
|
el.addEventListener("declined", handleDecline)
|
|
89
92
|
el.addEventListener("load", handleLoad)
|
|
93
|
+
el.addEventListener("error", handleError)
|
|
90
94
|
}
|
|
91
95
|
|
|
92
96
|
return () => {
|
|
@@ -95,6 +99,7 @@
|
|
|
95
99
|
el.removeEventListener("init", handleInit)
|
|
96
100
|
el.removeEventListener("declined", handleDecline)
|
|
97
101
|
el.removeEventListener("load", handleLoad)
|
|
102
|
+
el.removeEventListener("error", handleError)
|
|
98
103
|
}
|
|
99
104
|
}
|
|
100
105
|
})
|
|
@@ -67,6 +67,7 @@ declare const DocuSealForm: $$__sveltets_2_IsomorphicComponent<{
|
|
|
67
67
|
onInit?: ((detail: any) => void) | undefined;
|
|
68
68
|
onDecline?: ((detail: any) => void) | undefined;
|
|
69
69
|
onLoad?: ((detail: any) => void) | undefined;
|
|
70
|
+
onError?: ((detail: any) => void) | undefined;
|
|
70
71
|
}, {
|
|
71
72
|
[evt: string]: CustomEvent<any>;
|
|
72
73
|
}, {}, {}, string>;
|