anki/ts/editor-toolbar/DropdownItem.svelte
Henrik Giesel 1eafa7d9d0 Remove $$restProps and make explicit dropdown support in buttons
* Currently LabelButton, CommandIconButtton, and IconButton support dropdowns
2021-04-15 13:09:50 +02:00

21 lines
500 B
Svelte

<script lang="typescript">
export let id: string;
export let className = "";
export let tooltip: string;
export let onClick: (event: MouseEvent) => void;
export let label: string;
export let endLabel: string;
</script>
<button
{id}
class={`dropdown-item ${className}`}
title={tooltip}
on:click={onClick}
on:mousedown|preventDefault>
<span class="float-start">{label}</span>
{#if endLabel}<span class="float-end">{endLabel}</span>{/if}
</button>