-
-
Notifications
You must be signed in to change notification settings - Fork 280
Expand file tree
/
Copy path_Fullscreen.svelte
More file actions
65 lines (60 loc) · 1.48 KB
/
Copy path_Fullscreen.svelte
File metadata and controls
65 lines (60 loc) · 1.48 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
<Dialog
bind:open
fullscreen
aria-labelledby="fullscreen-title"
aria-describedby="fullscreen-content"
onSMUIDialogClosed={closeHandler}
>
<Header>
<Title id="fullscreen-title">Terms and Conditions</Title>
<CloseTooltipWrapper>
<IconButton action="close">
<Icon class="material-icons">close</Icon>
</IconButton>
</CloseTooltipWrapper>
</Header>
<Content id="fullscreen-content">
{#each Array(3) as _item}
<LoremIpsum />
{/each}
</Content>
<Actions>
<Button action="reject">
<Label>Reject</Label>
</Button>
<Button action="accept" defaultAction>
<Label>Accept</Label>
</Button>
</Actions>
</Dialog>
<Button onclick={() => (open = true)}>
<Label>Open Dialog</Label>
</Button>
<pre class="status">Response: {response}</pre>
<script lang="ts">
import Dialog, {
Header,
Title,
CloseTooltipWrapper,
Content,
Actions,
} from '@smui/dialog';
import IconButton, { Icon } from '@smui/icon-button';
import Button, { Label } from '@smui/button';
import LoremIpsum from '$lib/LoremIpsum.svelte';
let open = $state(false);
let response = $state('Nothing yet.');
function closeHandler(e: CustomEvent<{ action: string }>) {
switch (e.detail.action) {
case 'close':
response = 'Closed without response.';
break;
case 'reject':
response = 'Rejected.';
break;
case 'accept':
response = 'Accepted.';
break;
}
}
</script>