-
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.
Continue top menu with Material, remaining is tooltips and sub-submenus.
- Loading branch information
1 parent
2cdcc5a
commit 62fcef2
Showing
9 changed files
with
253 additions
and
201 deletions.
There are no files selected for viewing
2 changes: 1 addition & 1 deletion
2
src/lib/themes/material3/FormFieldsComponents/ColumnsField.svelte
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 |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<span></span> | ||
|
||
<style> | ||
span { | ||
display: block; | ||
width: 1px; | ||
margin: 0 0.5rem; | ||
height: 30%; | ||
background-color: #ffffffcc; | ||
} | ||
</style> |
89 changes: 89 additions & 0 deletions
89
src/lib/themes/material3/Menu/Internal/LeftSubmenuItem.svelte
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 |
---|---|---|
@@ -0,0 +1,89 @@ | ||
<script lang="ts"> | ||
import Menu from '@smui/menu'; | ||
import IconButton from '@smui/icon-button/dist/IconButton.svelte'; | ||
import List, {Item, Separator, SecondaryText} from '@smui/list'; | ||
import Button, { Label } from '@smui/button'; | ||
import { _ } from 'svelte-i18n'; | ||
import {Divider, Submenu} from '$lib/Menu/MenuLinks'; | ||
import { CallbackAction, UrlAction } from '$lib/actions'; | ||
import Icon from '$lib/Layout/Icon.svelte'; | ||
export let link: Submenu; | ||
let submenu: Menu; | ||
let isOpen: boolean; | ||
let icon: string = ''; | ||
$: { | ||
icon = isOpen ? 'arrow_drop_up' : 'arrow_drop_down'; | ||
} | ||
</script> | ||
|
||
<div> | ||
<IconButton class="material-icons" on:click={submenu.setOpen(true)}>{icon}</IconButton> | ||
<Menu | ||
bind:this={submenu} | ||
bind:open={isOpen} | ||
anchorCorner="BOTTOM_LEFT" | ||
> | ||
{#if link.icon} | ||
<svelte:component this={link.icon} /> | ||
{/if} | ||
<List dense> | ||
{#each link.links as submenuLink} | ||
{#if submenuLink instanceof Divider} | ||
<Separator /> | ||
{:else if submenuLink instanceof UrlAction} | ||
<Item> | ||
<SecondaryText tag="a" href={submenuLink.url()}> | ||
{#if submenuLink.icon} | ||
<Icon icon={submenuLink.icon} /> | ||
{/if} | ||
{submenuLink.label ? $_(submenuLink.label) : ''} | ||
</SecondaryText> | ||
</Item> | ||
{:else if submenuLink instanceof CallbackAction} | ||
<Item> | ||
<Button tag="span" type="button" on:click={() => submenuLink.call()}> | ||
{#if submenuLink.icon} | ||
<Icon icon={submenuLink.icon} /> | ||
{/if} | ||
{submenuLink.label ? $_(submenuLink.label) : ''} | ||
</Button> | ||
</Item> | ||
{:else} | ||
<Item> | ||
{#if submenuLink.icon} | ||
<Icon icon={submenuLink.icon} /> | ||
{/if} | ||
<Label>{submenuLink.label ? $_(submenuLink.label) : ''}</Label> | ||
</Item> | ||
{/if} | ||
{/each} | ||
</List> | ||
</Menu> | ||
</div> | ||
<!-- | ||
<HeaderNavMenu icon={link.icon || Folder} text={link.label ? $_(link.label) : ''}> | ||
{#each link.links as subLink} | ||
{#if subLink instanceof Divider} | ||
<br /> | ||
{:else if subLink instanceof UrlAction} | ||
<HeaderNavItem icon={subLink.icon || Link} href={subLink.url()}> | ||
{subLink.label ? $_(subLink.label) : ''} | ||
</HeaderNavItem> | ||
{:else if subLink instanceof CallbackAction} | ||
<HeaderNavItem icon={subLink.icon || Link} on:click={() => subLink.call()}> | ||
{subLink.label ? $_(subLink.label) : ''} | ||
</HeaderNavItem> | ||
{:else} | ||
<HeaderNavItem icon={subLink.icon || Link}> | ||
{subLink.label ? $_(subLink.label) : ''} | ||
</HeaderNavItem> | ||
{/if} | ||
{/each} | ||
</HeaderNavMenu> | ||
--> |
This file was deleted.
Oops, something went wrong.
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
Oops, something went wrong.