@sierra-95/svelte-scaffold 1.0.28 → 1.0.30
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.
|
@@ -1,9 +1,29 @@
|
|
|
1
|
-
<script>
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { onMount, onDestroy } from "svelte";
|
|
3
|
+
import { browser } from "$app/environment";
|
|
4
|
+
|
|
2
5
|
let {
|
|
3
6
|
open = $bindable(false),
|
|
4
7
|
zIndex = 15,
|
|
5
8
|
children
|
|
6
9
|
} = $props();
|
|
10
|
+
|
|
11
|
+
function handleEscape(e: KeyboardEvent) {
|
|
12
|
+
if (e.key === 'Escape' && open) {
|
|
13
|
+
e.preventDefault();
|
|
14
|
+
open = false;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
onMount(() => {
|
|
19
|
+
if (!browser) return;
|
|
20
|
+
window.addEventListener('keydown', handleEscape);
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
onDestroy(() => {
|
|
24
|
+
if (!browser) return;
|
|
25
|
+
window.removeEventListener('keydown', handleEscape);
|
|
26
|
+
});
|
|
7
27
|
</script>
|
|
8
28
|
<style>
|
|
9
29
|
#sierra-blur {
|
|
@@ -1,15 +1,7 @@
|
|
|
1
|
-
export default Backdrop;
|
|
2
|
-
type Backdrop = {
|
|
3
|
-
$on?(type: string, callback: (e: any) => void): () => void;
|
|
4
|
-
$set?(props: Partial<$$ComponentProps>): void;
|
|
5
|
-
};
|
|
6
1
|
declare const Backdrop: import("svelte").Component<{
|
|
7
2
|
open?: boolean;
|
|
8
3
|
zIndex?: number;
|
|
9
4
|
children: any;
|
|
10
5
|
}, {}, "open">;
|
|
11
|
-
type
|
|
12
|
-
|
|
13
|
-
zIndex?: number;
|
|
14
|
-
children: any;
|
|
15
|
-
};
|
|
6
|
+
type Backdrop = ReturnType<typeof Backdrop>;
|
|
7
|
+
export default Backdrop;
|
|
@@ -18,8 +18,6 @@ declare const Main: $$__sveltets_2_IsomorphicComponent<{
|
|
|
18
18
|
exportText?: string;
|
|
19
19
|
}, {
|
|
20
20
|
[evt: string]: CustomEvent<any>;
|
|
21
|
-
}, {}, {
|
|
22
|
-
exportText: string;
|
|
23
|
-
}, string>;
|
|
21
|
+
}, {}, {}, string>;
|
|
24
22
|
type Main = InstanceType<typeof Main>;
|
|
25
23
|
export default Main;
|