hamzus-ui 0.0.255 → 0.0.256

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hamzus-ui",
3
- "version": "0.0.255",
3
+ "version": "0.0.256",
4
4
  "type": "module",
5
5
  "main": "index.js",
6
6
  "svelte": "index.js",
@@ -47,7 +47,13 @@
47
47
 
48
48
  $: handleChange(search);
49
49
 
50
- $: onChange(selection ?? null)
50
+ $: updateSelection(selection ?? null)
51
+
52
+ function updateSelection(selection) {
53
+ if (!isMounted) return;
54
+
55
+ onChange(selection);
56
+ }
51
57
 
52
58
  // fnctions
53
59
  function formatInput(inputValue) {
@@ -188,9 +194,9 @@
188
194
  {style}
189
195
  {...$$restProps}
190
196
  >
191
- {#if required && !selection}
192
- <input type="text" name={name} {required} style="display: none;">
193
- {/if}
197
+ {#if required && !selection}
198
+ <input type="text" {name} {required} style="display: none;" />
199
+ {/if}
194
200
  <div
195
201
  class="input {errorMessage ? ' error' : ''}"
196
202
  style="{variant == 'collapse'
@@ -283,9 +289,9 @@
283
289
  <svelte:component this={component} selected={isSelected()} {...result} onClick={handleSelect}
284
290
  ></svelte:component>
285
291
  {/each}
286
- {#if results.length === 0}
287
- <slot name="nothing"/>
288
- {/if}
292
+ {#if results.length === 0}
293
+ <slot name="nothing" />
294
+ {/if}
289
295
  {#if results.length < totalOfRows}
290
296
  <Button
291
297
  label="charger plus"