fuma 0.4.8 → 0.4.9

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.
@@ -24,12 +24,9 @@ export let value = _value || jsonParse($page.url.searchParams.get(key), []);
24
24
  let dropdown;
25
25
  $:
26
26
  _options = parseOptions(options);
27
- function handleSubmit() {
28
- if (!value?.length) {
29
- goto($urlParam.without(key), { replaceState: true, noScroll: true });
30
- return;
31
- }
32
- goto($urlParam.with({ [key]: JSON.stringify(value) }), { replaceState: true, noScroll: true });
27
+ async function writeUrl() {
28
+ const url = value?.length ? $urlParam.with({ [key]: JSON.stringify(value) }) : $urlParam.without(key);
29
+ return goto(url, { replaceState: true, noScroll: true });
33
30
  }
34
31
  function handleReset() {
35
32
  dropdown.hide();
@@ -40,7 +37,7 @@ function handleReset() {
40
37
 
41
38
  <input type="hidden" name={key} value={JSON.stringify(value)} />
42
39
 
43
- <DropDown bind:this={dropdown} tippyProps={{ onHide: handleSubmit }} classWrapper="mb-[-2px]">
40
+ <DropDown bind:this={dropdown} tippyProps={{ onHidden: writeUrl }} classWrapper="mb-[-2px]">
44
41
  <div class="join" class:ml-2={value?.length} slot="activator">
45
42
  <button class="btn indicator join-item btn-sm {btnClass || ''}">
46
43
  <slot name="label">
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fuma",
3
- "version": "0.4.8",
3
+ "version": "0.4.9",
4
4
  "description": "My fullstack material build with sveltekit, daisyui, zod, prisma, lucia",
5
5
  "author": {
6
6
  "name": "Jonas Voisard",