fuma 0.3.11 → 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.
|
@@ -6,6 +6,8 @@ import { formatRange } from "../../../utils/formatRange.js";
|
|
|
6
6
|
import { PeriodPicker } from "../../period/index.js";
|
|
7
7
|
import { urlParam } from "../../../store/param.js";
|
|
8
8
|
import { jsonParse } from "../../../utils/jsonParse.js";
|
|
9
|
+
import { Icon } from "../../icon/index.js";
|
|
10
|
+
import { mdiCalendarFilterOutline } from "@mdi/js";
|
|
9
11
|
export let field;
|
|
10
12
|
let dropDown;
|
|
11
13
|
const initialValue = jsonParse(
|
|
@@ -64,7 +66,13 @@ function handleReset() {
|
|
|
64
66
|
class="max-h-none"
|
|
65
67
|
>
|
|
66
68
|
<button slot="activator" class="menu-item min-h-8 w-full flex-wrap gap-y-1">
|
|
67
|
-
<
|
|
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
|
+
|
|
68
76
|
{#if isValidPeriod}
|
|
69
77
|
<span class="badge badge-primary badge-xs text-[0.7rem] font-normal text-white">
|
|
70
78
|
{getLabel(period, time)}
|
|
@@ -6,6 +6,8 @@ import { DropDown } from "../../menu/index.js";
|
|
|
6
6
|
import { InputNumber } from "../../input/index.js";
|
|
7
7
|
import { urlParam } from "../../../store/param.js";
|
|
8
8
|
import { jsonParse } from "../../../utils/jsonParse.js";
|
|
9
|
+
import { mdiFilterMultipleOutline } from "@mdi/js";
|
|
10
|
+
import { Icon } from "../../icon/index.js";
|
|
9
11
|
export let field;
|
|
10
12
|
let tip;
|
|
11
13
|
let { min, max } = initRange($page.url);
|
|
@@ -48,7 +50,12 @@ $:
|
|
|
48
50
|
tippyProps={{ appendTo: () => document.body }}
|
|
49
51
|
>
|
|
50
52
|
<button slot="activator" class="menu-item min-h-8 w-full flex-wrap gap-y-1">
|
|
51
|
-
<
|
|
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>
|
|
52
59
|
|
|
53
60
|
{#if isDefined(min) || isDefined(max)}
|
|
54
61
|
<span class="badge badge-primary badge-xs text-[0.7rem] font-normal text-white">
|
|
@@ -5,11 +5,14 @@ import { DropDown } from "../../menu/index.js";
|
|
|
5
5
|
import { Icon } from "../../icon/index.js";
|
|
6
6
|
import { parseOptions } from "../../../utils/options.js";
|
|
7
7
|
import { urlParam } from "../../../store/param.js";
|
|
8
|
+
import { mdiOrderBoolAscendingVariant } from "@mdi/js";
|
|
8
9
|
export let field;
|
|
9
10
|
export let options;
|
|
10
11
|
export let multiSelect = false;
|
|
11
12
|
let _options = initOptions($page.url);
|
|
12
13
|
page.subscribe(({ url }) => _options = initOptions(url));
|
|
14
|
+
$:
|
|
15
|
+
optionsActive = _options.filter((option) => option.isActive);
|
|
13
16
|
function initOptions({ searchParams }) {
|
|
14
17
|
const selection = searchParams.get(field.key);
|
|
15
18
|
const selections = jsonParse(searchParams.get(field.key), []);
|
|
@@ -40,11 +43,16 @@ const getHref = derived(urlParam, (params) => (value) => {
|
|
|
40
43
|
<th class="p-1">
|
|
41
44
|
<DropDown hideOnBlur hideOnNav={!multiSelect} tippyProps={{ appendTo: () => document.body }}>
|
|
42
45
|
<button slot="activator" class="menu-item min-h-8 w-full flex-wrap gap-y-1">
|
|
43
|
-
<
|
|
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>
|
|
44
52
|
|
|
45
|
-
{#if
|
|
53
|
+
{#if optionsActive.length}
|
|
46
54
|
<div class="flex flex-wrap gap-1">
|
|
47
|
-
{#each
|
|
55
|
+
{#each optionsActive as option}
|
|
48
56
|
<span class="badge badge-primary badge-xs text-[0.7rem] font-normal text-white">
|
|
49
57
|
{#if option.icon}
|
|
50
58
|
<Icon path={option.icon} size={10} class="-translate-x-1 fill-white/80" />
|
|
@@ -17,7 +17,12 @@ 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
|
-
<
|
|
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">
|