db diff filter row

This commit is contained in:
Jan Prochazka
2021-11-07 20:11:15 +01:00
parent f60673fe36
commit dcfc695678
4 changed files with 115 additions and 10 deletions

View File

@@ -0,0 +1,28 @@
<script lang="ts">
import InlineButton from '../elements/InlineButton.svelte';
import FontIcon from '../icons/FontIcon.svelte';
export let icon;
export let label;
export let values;
export let field;
export let count;
</script>
{#if count > 0}
<InlineButton
on:click={() => {
$values = { ...$values, [field]: !$values[field] };
}}
>
<FontIcon {icon} />
<span class="switch">{label} ({count})</span>
<FontIcon icon={$values && !$values[field] ? 'icon checkbox-marked' : 'icon checkbox-blank'} />
</InlineButton>
{/if}
<style>
.switch {
margin-left: 5px;
}
</style>