mirror of
https://github.com/dbgate/dbgate
synced 2024-11-08 04:35:58 +00:00
better quick search UX (preserves expanded state()
This commit is contained in:
parent
7699cca6b9
commit
34fce0ef58
@ -52,8 +52,9 @@
|
|||||||
</div>
|
</div>
|
||||||
{/if}
|
{/if}
|
||||||
|
|
||||||
{#each filtered as item}
|
{#each items as item}
|
||||||
<AppObjectListItem
|
<AppObjectListItem
|
||||||
|
isHidden={!item.isMatched}
|
||||||
{...$$restProps}
|
{...$$restProps}
|
||||||
{module}
|
{module}
|
||||||
data={item.data}
|
data={item.data}
|
||||||
|
@ -69,8 +69,9 @@
|
|||||||
/>
|
/>
|
||||||
{/each}
|
{/each}
|
||||||
{:else}
|
{:else}
|
||||||
{#each filtered as data}
|
{#each list as data}
|
||||||
<AppObjectListItem
|
<AppObjectListItem
|
||||||
|
isHidden={!filtered.includes(data)}
|
||||||
{module}
|
{module}
|
||||||
{subItemsComponent}
|
{subItemsComponent}
|
||||||
{expandOnClick}
|
{expandOnClick}
|
||||||
|
@ -10,6 +10,7 @@
|
|||||||
import { tick } from 'svelte';
|
import { tick } from 'svelte';
|
||||||
import { plusExpandIcon } from '../icons/expandIcons';
|
import { plusExpandIcon } from '../icons/expandIcons';
|
||||||
|
|
||||||
|
export let isHidden;
|
||||||
export let filter;
|
export let filter;
|
||||||
export let module;
|
export let module;
|
||||||
export let data;
|
export let data;
|
||||||
@ -38,7 +39,8 @@
|
|||||||
$: if (!expandable && isExpanded) isExpanded = false;
|
$: if (!expandable && isExpanded) isExpanded = false;
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<svelte:component
|
{#if !isHidden}
|
||||||
|
<svelte:component
|
||||||
this={module.default}
|
this={module.default}
|
||||||
{data}
|
{data}
|
||||||
on:click={handleExpand}
|
on:click={handleExpand}
|
||||||
@ -47,12 +49,13 @@
|
|||||||
{checkedObjectsStore}
|
{checkedObjectsStore}
|
||||||
{module}
|
{module}
|
||||||
{disableContextMenu}
|
{disableContextMenu}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
{#if isExpanded && subItemsComponent}
|
{#if isExpanded && subItemsComponent}
|
||||||
<div class="subitems">
|
<div class="subitems">
|
||||||
<svelte:component this={subItemsComponent} {data} {filter} />
|
<svelte:component this={subItemsComponent} {data} {filter} />
|
||||||
</div>
|
</div>
|
||||||
|
{/if}
|
||||||
{/if}
|
{/if}
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
|
Loading…
Reference in New Issue
Block a user