moved some widgets to elements

This commit is contained in:
Jan Prochazka
2021-03-06 08:09:29 +01:00
parent dcfd6ee1dc
commit 78d71602bf
20 changed files with 19 additions and 19 deletions

View File

@@ -0,0 +1,22 @@
<script lang="ts">
import _ from 'lodash';
import FontIcon from '../icons/FontIcon.svelte';
import { currentDropDownMenu } from '../stores';
import InlineButton from './InlineButton.svelte';
export let icon = 'icon chevron-down';
export let menu;
let domButton;
function handleClick() {
const rect = domButton.getBoundingClientRect();
const left = rect.left;
const top = rect.bottom;
currentDropDownMenu.set({ left, top, items: _.isFunction(menu) ? menu() : menu });
}
</script>
<InlineButton square on:click={handleClick} bind:this={domButton}>
<FontIcon {icon} />
</InlineButton>