feat: design fixes

This commit is contained in:
Arman committed 2024-08-09 15:25:27 +02:00
1 parent b9110d2085
commit 77638332df
6 files changed
+41 -13

No files matched your search

+3
View File
@@ -5,6 +5,7 @@
export let icon: string = null;
export let event: string = null;
export let loading = false;
export let padding: number | null = null;
function track() {
if (!event) {
@@ -20,6 +21,8 @@
<li class="drop-list-item">
<button
class="drop-button u-flex u-cross-center u-main-space-between"
style:--button-padding-horizontal={padding ? `${padding / 16}rem` : ''}
style:--button-padding-vertical={padding ? `${padding / 16}rem` : ''}
on:click={track}
on:click|preventDefault
{disabled}>
+3 -1
View File
@@ -160,7 +160,9 @@
{#if singleCondition}
<Button text on:click={toggleDropdown}>Cancel</Button>
{:else}
<Button text on:click={clearAll}>Clear all</Button>
<Button disabled={applied === 0} text on:click={clearAll}>
Clear all
</Button>
{/if}
<Button on:click={apply} disabled={isButtonDisabled}>Apply</Button>
</div>
@@ -1,6 +1,5 @@
<script lang="ts">
import { tooltip } from '$lib/actions/tooltip';
import { queries, tagFormat, tags } from './store';
</script>
+3 -1
View File
@@ -1,11 +1,13 @@
<script lang="ts">
// export let data: string[] = [];
export let value = false;
export let padding: number | null = null;
</script>
<li class="drop-list-item">
<button
class="drop-button u-flex u-cross-center u-gap-12"
style:--button-padding-horizontal={padding ? `${padding / 16}rem` : ''}
style:--button-padding-vertical={padding ? `${padding / 16}rem` : ''}
on:click|preventDefault
type="button">
<input type="checkbox" class="is-small" bind:checked={value} />
@@ -167,13 +167,20 @@
}
});
});
let tagCount: number;
afterNavigate(() => {
pathQuery = '';
idQuery = '';
tagCount = $tags?.length;
});
function clearAll() {
queries.clearAll();
queries.apply();
}
function applyFilters() {
if (pathQuery) {
const tagList = $tags.filter((tag) => tag.tag.includes(pathColumn.title));
@@ -241,16 +248,23 @@
durationQuery = null;
}}>
<div class="u-flex u-gap-4">
<Button text on:click={toggle} {disabled} noMargin ariaLabel="open filter">
<Button
text
on:click={toggle}
{disabled}
ariaLabel="open filter"
noMargin={!tagCount}>
<span class="icon-filter-line" />
<span class="text">More filters</span>
{#if tagCount}
<span class="inline-tag">{tagCount}</span>
{/if}
</Button>
{#if tagCount}
<div
style="flex-basis: 1px; background-color: hsl(var(--color-border)); width: 1px;">
</div>
<Button text on:click={clearAll}>Clear All</Button>
{/if}
</div>
<svelte:fragment slot="quick">
<p>Apply <b>quick</b> filter rules to refine the table view</p>
<form on:submit|preventDefault class="u-margin-block-start-16">
<FormList gap={16}>
<InputText
@@ -334,15 +348,11 @@
style="--p-tag-content-height: auto">
<!-- <span class="icon-filter-line" /> -->
<span class="text">More filters</span>
{#if tagCount}
<span class="inline-tag">{tagCount}</span>
{/if}
<span class="icon-cheveron-down" />
</Pill>
</svelte:fragment>
<svelte:fragment slot="quick">
<p>Apply <b>quick</b> filter rules to refine the table view</p>
<form on:submit|preventDefault class="u-margin-block-start-16">
<form on:submit|preventDefault>
<FormList gap={16}>
<InputText
bind:value={pathQuery}
@@ -191,6 +191,7 @@
<svelte:fragment slot="list">
{#each filter.options as option (option.value + option.checked)}
<SelectSearchCheckbox
padding={8}
bind:value={option.checked}
on:click={() => {
option.checked = !option.checked;
@@ -209,6 +210,15 @@
{option.label}
</SelectSearchCheckbox>
{/each}
<DropListItem
padding={8}
on:click={() => {
filter.show = false;
filter.tag = null;
addFilterAndApply(filter.id, filter.title, filter.operator, null, []);
}}>
Clear selection
</DropListItem>
</svelte:fragment>
</DropList>
{/each}
@@ -226,6 +236,7 @@
<svelte:fragment slot="list">
{#each filter.options as option (option.value + option.checked)}
<DropListItem
padding={8}
on:click={() => {
filter.show = false;
@@ -241,6 +252,7 @@
</DropListItem>
{/each}
<DropListItem
padding={8}
on:click={() => {
filter.show = false;
filter.tag = null;