iconograph-ui 1.7.6 → 1.7.7

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.
@@ -23,8 +23,10 @@
23
23
  let coords = { top: 0, left: 0, width: 0 };
24
24
 
25
25
  async function handleFilter() {
26
- waiting = true;
26
+ if (search.length < 1)
27
+ return;
27
28
 
29
+ waiting = true;
28
30
  const response = await fetch(`${uri}limit=50&page=1&name=${search}`, {
29
31
  method: 'GET',
30
32
  headers: { 'Content-Type': 'application/json' }
@@ -66,18 +68,22 @@
66
68
  <Portal target="#main-container">
67
69
  <div class="list" style="position: absolute; top:{coords.top - 1}px; left:{coords.left - 85}px; width: {coords.width - 2}px;" >
68
70
  <!-- Options -->
69
- {#each results as r}
70
- <div class="option" on:click={() => selectResult(r)}>
71
- {#if type == 'user'}
72
- <UserPicture user={r} size={24}></UserPicture>
73
- <span>{r.firstname} {r.lastname}</span>
74
- {:else}
75
- <span>{r.name}</span>
76
- {/if}
77
- </div>
71
+ {#if waiting}
72
+ <div class="option"><span>Recherche en cours...</span></div>
78
73
  {:else}
79
- <div class="option"><span>Aucun résultat</span></div>
80
- {/each}
74
+ {#each results as r}
75
+ <div class="option" on:click={() => selectResult(r)}>
76
+ {#if type == 'user'}
77
+ <UserPicture user={r} size={24}></UserPicture>
78
+ <span>{r.firstname} {r.lastname}</span>
79
+ {:else}
80
+ <span>{r.name}</span>
81
+ {/if}
82
+ </div>
83
+ {:else}
84
+ <div class="option"><span>Aucun résultat</span></div>
85
+ {/each}
86
+ {/if}
81
87
  </div>
82
88
  </Portal>
83
89
  {/if}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "iconograph-ui",
3
- "version": "1.7.6",
3
+ "version": "1.7.7",
4
4
  "description": "A Svelte Kit components library",
5
5
  "main": "./index.js",
6
6
  "svelte": "./index.js",