mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-19 00:16:00 +00:00
db diff filter row
This commit is contained in:
28
packages/web/src/forms/RowsFilterSwitcher.svelte
Normal file
28
packages/web/src/forms/RowsFilterSwitcher.svelte
Normal 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>
|
||||
Reference in New Issue
Block a user