-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b50ce6b
commit 2cdcc5a
Showing
7 changed files
with
122 additions
and
90 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,45 +1,75 @@ | ||
<script lang="ts"> | ||
import { _ } from 'svelte-i18n'; | ||
import IconButton from '@smui/icon-button/dist/IconButton.svelte'; | ||
import { Title } from '@smui/top-app-bar'; | ||
import Tooltip, { Wrapper } from '@smui/tooltip'; | ||
import Section from '@smui/top-app-bar/dist/Section.svelte'; | ||
import Button, { Label } from '@smui/button'; | ||
import { Divider, type MenuLink, Submenu } from '$lib/Menu/MenuLinks'; | ||
import { CallbackAction, UrlAction } from '$lib/actions'; | ||
import InternalSubmenu from './InternalSubmenu.svelte'; | ||
import {Icon} from "$lib"; | ||
import { Icon } from '$lib'; | ||
export let links: Array<MenuLink> = []; | ||
</script> | ||
|
||
{#each links as link} | ||
{#if link instanceof Submenu} | ||
<InternalSubmenu {link} /> | ||
<Section> | ||
<InternalSubmenu {link} /> | ||
</Section> | ||
{:else if link instanceof Divider} | ||
<br /> | ||
<Section>|</Section> | ||
{:else if link instanceof UrlAction} | ||
<Section toolbar> | ||
<a href={link.url()}> | ||
{#if link.icon} | ||
<Icon icon={link.icon} /> | ||
{/if} | ||
{link.label ? $_(link.label) : ''} | ||
</a> | ||
<Section> | ||
<IconButton tag="a" href={link.url()}> | ||
<Wrapper> | ||
{#if link.icon} | ||
<Icon icon={link.icon} /> | ||
{:else} | ||
<i class="material-icons">link</i> | ||
{/if} | ||
{#if link.label} | ||
<Tooltip> | ||
{link.label ? $_(link.label) : ''} | ||
</Tooltip> | ||
{/if} | ||
</Wrapper> | ||
</IconButton> | ||
</Section> | ||
{:else if link instanceof CallbackAction} | ||
<Section toolbar> | ||
<Button tag="span" type="button" on:click={() => link.call()}> | ||
{#if link.icon} | ||
<Icon icon={link.icon} /> | ||
{/if} | ||
{link.label ? $_(link.label) : ''} | ||
</Button> | ||
<Section> | ||
<IconButton on:click={() => link.call()}> | ||
<Wrapper> | ||
{#if link.icon} | ||
<Icon icon={link.icon} /> | ||
{:else} | ||
<i class="material-icons">article</i> | ||
{/if} | ||
{#if link.label} | ||
<Tooltip> | ||
{link.label ? $_(link.label) : ''} | ||
</Tooltip> | ||
{/if} | ||
</Wrapper> | ||
</IconButton> | ||
</Section> | ||
{:else} | ||
<Section toolbar> | ||
{#if link.icon} | ||
<Icon icon={link.icon} /> | ||
{/if} | ||
<Label>{link.label ? $_(link.label) : ''}</Label> | ||
<Section> | ||
<Title> | ||
<Wrapper> | ||
{#if link.icon} | ||
<Icon icon={link.icon} /> | ||
{:else} | ||
<i class="material-icons">link</i> | ||
{/if} | ||
{#if link.label} | ||
<Tooltip> | ||
{link.label ? $_(link.label) : ''} | ||
</Tooltip> | ||
{/if} | ||
</Wrapper> | ||
</Title> | ||
</Section> | ||
{/if} | ||
{/each} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters