@@ -5,6 +5,7 @@ import { MDCDrawer } from '@material/drawer'
5
5
import { MDCList } from ' @material/list'
6
6
import Button from ' ../Button'
7
7
import IconButton from ' ../IconButton/IconButton.svelte'
8
+ import Tooltip from ' ../Tooltip/Tooltip.svelte'
8
9
import { beforeUrlChange , goto } from ' @roxi/routify'
9
10
import { onMount } from ' svelte'
10
11
import TopAppBar from ' ../TopAppBar'
@@ -125,36 +126,41 @@ main {
125
126
<!-- override built-in padding so height 100 works correctly without creating a vertical scroller -->
126
127
<!-- changing the list to flex causes the margins to not collapse -->
127
128
<nav class ="mdc-list flex column p-0" class:h- 100={isFullHeightMenu } on:click ={onListClick } bind:this ={listElement }>
128
- {#each menuItems as { icon, label, url, hide, button }, i }
129
+ {#each menuItems as { icon, label, url, hide, button, tooltip }, i }
129
130
{#if label === ' --break--' }
130
131
<span class =" grow-1" />
131
132
{:else if ! hide }
132
- {#if button && isNotMini }
133
- <Button class ="m-1" raised prependIcon ={icon } {url }>{label }</Button >
134
- {:else if button }
135
- <IconButton class ="mdc-theme--primary pl-1" {icon } ariaLabel ={label } on:click ={() => $goto (url )} />
136
- {:else if url }
137
- <a
138
- class =" mdc-list-item"
139
- class:mdc-list-item--activated ={isMenuItemActive (currentUrl , url )}
140
- href ={url }
141
- aria-current ={isMenuItemActive (currentUrl , url ) ? ' page' : null }
142
- tabindex ={i === 0 ? 0 : undefined }
143
- >
144
- <span class =" mdc-list-item__ripple" />
145
- {#if icon }
146
- <i class ="material-icons mdc-list-item__graphic" aria-hidden ="true" >{icon }</i >
147
- {/if }
148
-
149
- {#if label && isNotMini }
150
- <span class ="mdc-list-item__text" >{label }</span >
151
- {/if }
152
- </a >
153
- {:else }
154
- <hr
155
- class =" mdc-list-divider mdc-list-divider--inset-leading mdc-list-divider--inset-trailing"
156
- role =" separator"
157
- />
133
+ <Tooltip .Wrapper ariaDescribedBy ={label + ' -tooltip' }>
134
+ {#if button && isNotMini }
135
+ <Button class ="m-1" raised prependIcon ={icon } {url }>{label }</Button >
136
+ {:else if button }
137
+ <IconButton class ="mdc-theme--primary pl-1" {icon } ariaLabel ={label } on:click ={() => $goto (url )} />
138
+ {:else if url }
139
+ <a
140
+ class =" mdc-list-item"
141
+ class:mdc-list-item--activated ={isMenuItemActive (currentUrl , url )}
142
+ href ={url }
143
+ aria-current ={isMenuItemActive (currentUrl , url ) ? ' page' : null }
144
+ tabindex ={i === 0 ? 0 : undefined }
145
+ >
146
+ <span class =" mdc-list-item__ripple" />
147
+ {#if icon }
148
+ <i class ="material-icons mdc-list-item__graphic" aria-hidden ="true" >{icon }</i >
149
+ {/if }
150
+
151
+ {#if label && isNotMini }
152
+ <span class ="mdc-list-item__text" >{label }</span >
153
+ {/if }
154
+ </a >
155
+ {:else }
156
+ <hr
157
+ class =" mdc-list-divider mdc-list-divider--inset-leading mdc-list-divider--inset-trailing"
158
+ role =" separator"
159
+ />
160
+ {/if }
161
+ </Tooltip .Wrapper >
162
+ {#if tooltip }
163
+ <Tooltip tooltipID ={label + ' -tooltip' }>{tooltip }</Tooltip >
158
164
{/if }
159
165
{/if }
160
166
{/each }
0 commit comments