File tree Expand file tree Collapse file tree 1 file changed +4
-17
lines changed
src/lib/components/filters Expand file tree Collapse file tree 1 file changed +4
-17
lines changed Original file line number Diff line number Diff line change 8
8
InputSelectCheckbox ,
9
9
InputDateTime
10
10
} from ' $lib/elements/forms' ;
11
- import { createEventDispatcher , onMount } from ' svelte' ;
12
- import { operators , addFilter , queries , type TagValue } from ' ./store' ;
11
+ import { onMount } from ' svelte' ;
12
+ import { operators , addFilter , queries , tags } from ' ./store' ;
13
13
import type { Column } from ' $lib/helpers/types' ;
14
14
import type { Writable } from ' svelte/store' ;
15
15
import { TagList } from ' .' ;
35
35
}));
36
36
37
37
$ : operator = operatorKey ? operators [operatorKey ] : null ;
38
- $ : {
39
- columnId ;
40
- operatorKey = null ;
41
- }
42
-
43
38
$ : isDisabled = ! operator ;
44
39
45
- let localTags: TagValue [] = [];
46
-
47
40
onMount (() => {
48
41
value = column ?.array ? [] : null ;
49
42
if (column ?.type === ' datetime' ) {
62
55
queries .apply ();
63
56
}
64
57
}
65
-
66
- const dispatch = createEventDispatcher <{
67
- clear: void ;
68
- apply: { applied: number };
69
- }>();
70
- dispatch (' apply' , { applied: localTags .length });
71
58
</script >
72
59
73
60
<div >
151
138
{/if }
152
139
</form >
153
140
154
- {#if ! singleCondition }
141
+ {#if ! singleCondition && $tags . length > 0 }
155
142
<ul class =" u-flex u-flex-wrap u-cross-center u-gap-8 u-margin-block-start-16 tags" >
156
143
<TagList
157
- tags ={localTags }
144
+ tags ={$tags }
158
145
on:remove ={(e ) => {
159
146
queries .removeFilter (e .detail );
160
147
queries .apply ();
You can’t perform that action at this time.
0 commit comments