/
_Permanent.svelte
82 lines (76 loc) · 1.87 KB
/
_Permanent.svelte
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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
<div class="drawer-container">
<Drawer>
<Content>
<List>
<Item
href="javascript:void(0)"
on:click={() => (clicked = 'Gray Kittens')}
>
<Text>Gray Kittens</Text>
</Item>
<Item
href="javascript:void(0)"
on:click={() => (clicked = 'A Space Rocket')}
>
<Text>A Space Rocket</Text>
</Item>
<Item
href="javascript:void(0)"
on:click={() => (clicked = '100 Pounds of Gravel')}
>
<Text>100 Pounds of Gravel</Text>
</Item>
<Item
href="javascript:void(0)"
on:click={() => (clicked = 'All of the Shrimp')}
>
<Text>All of the Shrimp</Text>
</Item>
<Item
href="javascript:void(0)"
on:click={() => (clicked = 'A Planet with a Mall')}
>
<Text>A Planet with a Mall</Text>
</Item>
</List>
</Content>
</Drawer>
<AppContent class="app-content">
<main class="main-content">
App content.
<br />
<pre class="status">Clicked: {clicked}</pre>
</main>
</AppContent>
</div>
<script lang="ts">
import Drawer, { AppContent, Content } from '@smui/drawer';
import List, { Item, Text } from '@smui/list';
let clicked = 'nothing yet';
</script>
<style>
/* These classes are only needed because the
drawer is in a container on the page. */
.drawer-container {
position: relative;
display: flex;
height: 350px;
max-width: 600px;
border: 1px solid
var(--mdc-theme-text-hint-on-background, rgba(0, 0, 0, 0.1));
overflow: hidden;
z-index: 0;
}
* :global(.app-content) {
flex: auto;
overflow: auto;
position: relative;
flex-grow: 1;
}
.main-content {
overflow: auto;
padding: 16px;
height: 100%;
box-sizing: border-box;
}
</style>