Update auto column, export and filter buttons to new designs and to support disabled state
This commit is contained in:
parent
2d3618eab0
commit
9e20f0406c
4 changed files with 27 additions and 6 deletions
|
@ -150,14 +150,20 @@
|
||||||
/>
|
/>
|
||||||
{/if}
|
{/if}
|
||||||
<HideAutocolumnButton bind:hideAutocolumns />
|
<HideAutocolumnButton bind:hideAutocolumns />
|
||||||
<!-- always have the export last -->
|
|
||||||
<ExportButton view={$tables.selected?._id} />
|
|
||||||
<ImportButton
|
<ImportButton
|
||||||
tableId={$tables.selected?._id}
|
tableId={$tables.selected?._id}
|
||||||
on:updaterows={onUpdateRows}
|
on:updaterows={onUpdateRows}
|
||||||
/>
|
/>
|
||||||
|
<ExportButton
|
||||||
|
disabled={!hasRows || !hasCols}
|
||||||
|
view={$tables.selected?._id}
|
||||||
|
/>
|
||||||
{#key id}
|
{#key id}
|
||||||
<TableFilterButton {schema} on:change={onFilter} />
|
<TableFilterButton
|
||||||
|
{schema}
|
||||||
|
on:change={onFilter}
|
||||||
|
disabled={!hasCols || !hasRows}
|
||||||
|
/>
|
||||||
{/key}
|
{/key}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -3,11 +3,18 @@
|
||||||
import ExportModal from "../modals/ExportModal.svelte"
|
import ExportModal from "../modals/ExportModal.svelte"
|
||||||
|
|
||||||
export let view
|
export let view
|
||||||
|
export let disabled = false
|
||||||
|
|
||||||
let modal
|
let modal
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<ActionButton icon="DataDownload" size="S" quiet on:click={modal.show}>
|
<ActionButton
|
||||||
|
{disabled}
|
||||||
|
icon="DataDownload"
|
||||||
|
size="S"
|
||||||
|
quiet
|
||||||
|
on:click={modal.show}
|
||||||
|
>
|
||||||
Export
|
Export
|
||||||
</ActionButton>
|
</ActionButton>
|
||||||
<Modal bind:this={modal}>
|
<Modal bind:this={modal}>
|
||||||
|
|
|
@ -8,6 +8,12 @@
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<ActionButton icon="MagicWand" primary size="S" quiet on:click={hideOrUnhide}>
|
<ActionButton
|
||||||
{#if hideAutocolumns}Show auto columns{:else}Hide auto columns{/if}
|
icon={hideAutocolumns ? "VisibilityOff" : "Visibility"}
|
||||||
|
primary
|
||||||
|
size="S"
|
||||||
|
quiet
|
||||||
|
on:click={hideOrUnhide}
|
||||||
|
>
|
||||||
|
Auto columns
|
||||||
</ActionButton>
|
</ActionButton>
|
||||||
|
|
|
@ -5,6 +5,7 @@
|
||||||
|
|
||||||
export let schema
|
export let schema
|
||||||
export let filters
|
export let filters
|
||||||
|
export let disabled = false
|
||||||
|
|
||||||
const dispatch = createEventDispatcher()
|
const dispatch = createEventDispatcher()
|
||||||
let modal
|
let modal
|
||||||
|
@ -17,6 +18,7 @@
|
||||||
icon="Filter"
|
icon="Filter"
|
||||||
size="S"
|
size="S"
|
||||||
quiet
|
quiet
|
||||||
|
{disabled}
|
||||||
on:click={modal.show}
|
on:click={modal.show}
|
||||||
active={tempValue?.length > 0}
|
active={tempValue?.length > 0}
|
||||||
>
|
>
|
||||||
|
|
Loading…
Reference in a new issue