sveltacular 0.0.73 → 0.0.74
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.
|
@@ -9,6 +9,7 @@ export let flex = false;
|
|
|
9
9
|
export let disabled = false;
|
|
10
10
|
export let noMargin = false;
|
|
11
11
|
export let collapse = false;
|
|
12
|
+
export let repeatSubmitDelay = 500;
|
|
12
13
|
const dispatch = createEventDispatcher();
|
|
13
14
|
const click = (e) => {
|
|
14
15
|
if (disabled) {
|
|
@@ -17,6 +18,12 @@ const click = (e) => {
|
|
|
17
18
|
return;
|
|
18
19
|
}
|
|
19
20
|
dispatch("click");
|
|
21
|
+
if (repeatSubmitDelay) {
|
|
22
|
+
disabled = true;
|
|
23
|
+
if (repeatSubmitDelay !== "infinite") {
|
|
24
|
+
setTimeout(() => disabled = false, repeatSubmitDelay);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
20
27
|
if (href) {
|
|
21
28
|
navigateTo(href);
|
|
22
29
|
}
|