fuma 0.4.7 → 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,14 +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
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
if (!value?.length) {
|
|
31
|
-
goto($urlParam.without(key), { replaceState: true, noScroll: true });
|
|
32
|
-
return;
|
|
33
|
-
}
|
|
34
|
-
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 });
|
|
35
30
|
}
|
|
36
31
|
function handleReset() {
|
|
37
32
|
dropdown.hide();
|
|
@@ -42,7 +37,7 @@ function handleReset() {
|
|
|
42
37
|
|
|
43
38
|
<input type="hidden" name={key} value={JSON.stringify(value)} />
|
|
44
39
|
|
|
45
|
-
<DropDown bind:this={dropdown} tippyProps={{
|
|
40
|
+
<DropDown bind:this={dropdown} tippyProps={{ onHidden: writeUrl }} classWrapper="mb-[-2px]">
|
|
46
41
|
<div class="join" class:ml-2={value?.length} slot="activator">
|
|
47
42
|
<button class="btn indicator join-item btn-sm {btnClass || ''}">
|
|
48
43
|
<slot name="label">
|