@skeletonlabs/skeleton 2.9.0-dev.c5aafca7 → 2.9.1-dev.0020c671
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.
|
@@ -89,6 +89,7 @@ function onMouseLeave(index) {
|
|
|
89
89
|
classesSnackbar = classesSnackbar.replace(" scale-[105%]", "");
|
|
90
90
|
}
|
|
91
91
|
}
|
|
92
|
+
let wrapperVisible = false;
|
|
92
93
|
$:
|
|
93
94
|
classesWrapper = `${cWrapper} ${cPosition} ${zIndex} ${$$props.class || ""}`;
|
|
94
95
|
$:
|
|
@@ -97,9 +98,13 @@ $:
|
|
|
97
98
|
classesToast = `${cToast} ${width} ${color} ${padding} ${spacing} ${rounded} ${shadow}`;
|
|
98
99
|
$:
|
|
99
100
|
filteredToasts = Array.from($toastStore).slice(0, max);
|
|
101
|
+
$:
|
|
102
|
+
if (filteredToasts.length) {
|
|
103
|
+
wrapperVisible = true;
|
|
104
|
+
}
|
|
100
105
|
</script>
|
|
101
106
|
|
|
102
|
-
{#if
|
|
107
|
+
{#if filteredToasts.length > 0 || wrapperVisible}
|
|
103
108
|
<!-- Wrapper -->
|
|
104
109
|
<div class="snackbar-wrapper {classesWrapper}" data-testid="snackbar-wrapper">
|
|
105
110
|
<!-- List -->
|
|
@@ -117,6 +122,10 @@ $:
|
|
|
117
122
|
params: { x: animAxis.x, y: animAxis.y, ...transitionOutParams },
|
|
118
123
|
enabled: transitions
|
|
119
124
|
}}
|
|
125
|
+
on:outroend={() => {
|
|
126
|
+
const outroFinishedForLastToastOnQueue = filteredToasts.length === 0;
|
|
127
|
+
if (outroFinishedForLastToastOnQueue) wrapperVisible = false;
|
|
128
|
+
}}
|
|
120
129
|
on:mouseenter={() => onMouseEnter(i)}
|
|
121
130
|
on:mouseleave={() => onMouseLeave(i)}
|
|
122
131
|
role={t.hideDismiss ? 'alert' : 'alertdialog'}
|
|
@@ -4,8 +4,12 @@ export let toastSettings = [];
|
|
|
4
4
|
export let max = void 0;
|
|
5
5
|
initializeToastStore();
|
|
6
6
|
const toastStore = getToastStore();
|
|
7
|
-
toastSettings.forEach((
|
|
8
|
-
|
|
7
|
+
toastSettings.forEach(({ triggerDelay, ...settings }) => {
|
|
8
|
+
if (triggerDelay) {
|
|
9
|
+
setTimeout(() => toastStore.trigger(settings), triggerDelay);
|
|
10
|
+
} else {
|
|
11
|
+
toastStore.trigger(settings);
|
|
12
|
+
}
|
|
9
13
|
});
|
|
10
14
|
</script>
|
|
11
15
|
|
|
@@ -2,7 +2,9 @@ import { SvelteComponentTyped } from "svelte";
|
|
|
2
2
|
import type { ToastSettings } from './types.js';
|
|
3
3
|
declare const __propDef: {
|
|
4
4
|
props: {
|
|
5
|
-
toastSettings?: ToastSettings
|
|
5
|
+
toastSettings?: (ToastSettings & {
|
|
6
|
+
triggerDelay?: number | undefined;
|
|
7
|
+
})[] | undefined;
|
|
6
8
|
max?: number | undefined;
|
|
7
9
|
};
|
|
8
10
|
events: {
|