fuma 0.3.12 → 0.3.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -66,13 +66,17 @@ function handleReset() {
66
66
  class="max-h-none"
67
67
  >
68
68
  <button slot="activator" class="menu-item min-h-8 w-full flex-wrap gap-y-1">
69
- <span>{field.label}</span>
69
+ <div class="flex gap-2">
70
+ <span>{field.label}</span>
71
+ {#if !isValidPeriod}
72
+ <Icon path={mdiCalendarFilterOutline} size={15} class="opacity-50" />
73
+ {/if}
74
+ </div>
75
+
70
76
  {#if isValidPeriod}
71
77
  <span class="badge badge-primary badge-xs text-[0.7rem] font-normal text-white">
72
78
  {getLabel(period, time)}
73
79
  </span>
74
- {:else}
75
- <Icon path={mdiCalendarFilterOutline} size={15} class="opacity-50" />
76
80
  {/if}
77
81
  </button>
78
82
 
@@ -50,7 +50,12 @@ $:
50
50
  tippyProps={{ appendTo: () => document.body }}
51
51
  >
52
52
  <button slot="activator" class="menu-item min-h-8 w-full flex-wrap gap-y-1">
53
- <span>{field.label}</span>
53
+ <div class="flex gap-2">
54
+ <span>{field.label}</span>
55
+ {#if !isDefined(min) && !isDefined(max)}
56
+ <Icon path={mdiFilterMultipleOutline} size={15} class="opacity-50" />
57
+ {/if}
58
+ </div>
54
59
 
55
60
  {#if isDefined(min) || isDefined(max)}
56
61
  <span class="badge badge-primary badge-xs text-[0.7rem] font-normal text-white">
@@ -62,8 +67,6 @@ $:
62
67
  ≤ {max}
63
68
  {/if}
64
69
  </span>
65
- {:else}
66
- <Icon path={mdiFilterMultipleOutline} size={15} class="opacity-50" />
67
70
  {/if}
68
71
  </button>
69
72
 
@@ -11,6 +11,8 @@ export let options;
11
11
  export let multiSelect = false;
12
12
  let _options = initOptions($page.url);
13
13
  page.subscribe(({ url }) => _options = initOptions(url));
14
+ $:
15
+ optionsActive = _options.filter((option) => option.isActive);
14
16
  function initOptions({ searchParams }) {
15
17
  const selection = searchParams.get(field.key);
16
18
  const selections = jsonParse(searchParams.get(field.key), []);
@@ -41,11 +43,16 @@ const getHref = derived(urlParam, (params) => (value) => {
41
43
  <th class="p-1">
42
44
  <DropDown hideOnBlur hideOnNav={!multiSelect} tippyProps={{ appendTo: () => document.body }}>
43
45
  <button slot="activator" class="menu-item min-h-8 w-full flex-wrap gap-y-1">
44
- <span>{field.label}</span>
46
+ <div class="flex gap-2">
47
+ {field.label}
48
+ {#if !optionsActive.length}
49
+ <Icon path={mdiOrderBoolAscendingVariant} size={15} class="opacity-50" />
50
+ {/if}
51
+ </div>
45
52
 
46
- {#if _options.filter((option) => option.isActive).length}
53
+ {#if optionsActive.length}
47
54
  <div class="flex flex-wrap gap-1">
48
- {#each _options.filter((option) => option.isActive) as option}
55
+ {#each optionsActive as option}
49
56
  <span class="badge badge-primary badge-xs text-[0.7rem] font-normal text-white">
50
57
  {#if option.icon}
51
58
  <Icon path={option.icon} size={10} class="-translate-x-1 fill-white/80" />
@@ -54,8 +61,6 @@ const getHref = derived(urlParam, (params) => (value) => {
54
61
  </span>
55
62
  {/each}
56
63
  </div>
57
- {:else}
58
- <Icon path={mdiOrderBoolAscendingVariant} size={15} class="opacity-50" />
59
64
  {/if}
60
65
  </button>
61
66
 
@@ -17,15 +17,18 @@ let searchValue = $page.url.searchParams.get(field.key) || "";
17
17
  tippyProps={{ appendTo: () => document.body }}
18
18
  >
19
19
  <button slot="activator" class="menu-item min-h-8 w-full flex-wrap gap-y-1">
20
- <span>{field.label}</span>
20
+ <div class="flex items-center gap-2">
21
+ <span>{field.label}</span>
22
+ {#if !searchValue}
23
+ <Icon path={mdiMagnify} size={15} class="opacity-50" />
24
+ {/if}
25
+ </div>
21
26
 
22
27
  {#if searchValue}
23
28
  <span class="badge badge-primary badge-xs text-[0.7rem] font-normal text-white">
24
29
  <Icon path={mdiMagnify} size={10} class="-translate-x-1 fill-white/80" />
25
30
  <span>{searchValue}</span>
26
31
  </span>
27
- {:else}
28
- <Icon path={mdiMagnify} size={15} class="opacity-50" />
29
32
  {/if}
30
33
  </button>
31
34
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fuma",
3
- "version": "0.3.12",
3
+ "version": "0.3.13",
4
4
  "description": "My fullstack material build with sveltekit, daisyui, zod, prisma, lucia",
5
5
  "author": {
6
6
  "name": "Jonas Voisard",