@yuno-payments/dashboard-design-system 1.1.2 → 1.1.3-beta.2
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/dist/components/atoms/filter-dropdown/filter-dropdown.js +202 -218
- package/dist/index.esm.min.js +1095 -1111
- package/dist/index.umd.min.js +10 -10
- package/package.json +1 -1
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
import { j as
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
import { Button as
|
|
4
|
-
import { Separator as
|
|
5
|
-
import { Icon as
|
|
6
|
-
import { FilterSection as
|
|
7
|
-
import { FilterDateRangeValue as
|
|
1
|
+
import { j as s } from "../../../_virtual/jsx-runtime.js";
|
|
2
|
+
import { forwardRef as N, useState as w, useRef as E, useCallback as T, useEffect as $ } from "react";
|
|
3
|
+
import { Button as j } from "../../../vendor/shadcn/button.js";
|
|
4
|
+
import { Separator as q } from "../../../vendor/shadcn/separator.js";
|
|
5
|
+
import { Icon as p } from "../icon/icon.js";
|
|
6
|
+
import { FilterSection as G } from "../filter/filter.js";
|
|
7
|
+
import { FilterDateRangeValue as k, FilterDateRange as we } from "../filter/filter-date-range.js";
|
|
8
8
|
import { cn as h } from "../../../lib/utils.js";
|
|
9
|
-
const
|
|
10
|
-
({ icon: d, label:
|
|
9
|
+
const J = N(
|
|
10
|
+
({ icon: d, label: C, isActive: l = !1, showChevron: x = !1, className: b, ...u }, v) => /* @__PURE__ */ s.jsxs(
|
|
11
11
|
"button",
|
|
12
12
|
{
|
|
13
|
-
ref:
|
|
13
|
+
ref: v,
|
|
14
14
|
className: h(
|
|
15
15
|
"flex items-center gap-2 h-8 px-2 rounded-md w-full transition-colors shrink-0 hover:bg-secondary",
|
|
16
16
|
b
|
|
17
17
|
),
|
|
18
18
|
...u,
|
|
19
19
|
children: [
|
|
20
|
-
d && /* @__PURE__ */
|
|
21
|
-
|
|
20
|
+
d && /* @__PURE__ */ s.jsx(
|
|
21
|
+
p,
|
|
22
22
|
{
|
|
23
23
|
name: d,
|
|
24
24
|
className: h(
|
|
@@ -27,18 +27,18 @@ const G = S(
|
|
|
27
27
|
)
|
|
28
28
|
}
|
|
29
29
|
),
|
|
30
|
-
/* @__PURE__ */
|
|
30
|
+
/* @__PURE__ */ s.jsx(
|
|
31
31
|
"span",
|
|
32
32
|
{
|
|
33
33
|
className: h(
|
|
34
34
|
"flex-1 text-sm font-normal text-left truncate",
|
|
35
35
|
l ? "text-primary" : "text-foreground"
|
|
36
36
|
),
|
|
37
|
-
children:
|
|
37
|
+
children: C
|
|
38
38
|
}
|
|
39
39
|
),
|
|
40
|
-
(l ||
|
|
41
|
-
|
|
40
|
+
(l || x) && /* @__PURE__ */ s.jsx(
|
|
41
|
+
p,
|
|
42
42
|
{
|
|
43
43
|
name: "CaretRight",
|
|
44
44
|
className: h(
|
|
@@ -51,22 +51,22 @@ const G = S(
|
|
|
51
51
|
}
|
|
52
52
|
)
|
|
53
53
|
);
|
|
54
|
-
|
|
55
|
-
const
|
|
56
|
-
({ items: d, activeItemId:
|
|
54
|
+
J.displayName = "FilterMenuItem";
|
|
55
|
+
const Q = N(
|
|
56
|
+
({ items: d, activeItemId: C, onItemClick: l, className: x }, b) => /* @__PURE__ */ s.jsx(
|
|
57
57
|
"div",
|
|
58
58
|
{
|
|
59
59
|
ref: b,
|
|
60
60
|
className: h(
|
|
61
61
|
"flex flex-col gap-2 w-64 h-full p-2 bg-muted border border-border rounded-md overflow-y-auto",
|
|
62
|
-
|
|
62
|
+
x
|
|
63
63
|
),
|
|
64
|
-
children: d.map((u) => /* @__PURE__ */
|
|
65
|
-
|
|
64
|
+
children: d.map((u) => /* @__PURE__ */ s.jsx(
|
|
65
|
+
J,
|
|
66
66
|
{
|
|
67
67
|
icon: u.icon,
|
|
68
68
|
label: u.label,
|
|
69
|
-
isActive:
|
|
69
|
+
isActive: C === u.id,
|
|
70
70
|
showChevron: u.showChevron,
|
|
71
71
|
onClick: () => l?.(u.id)
|
|
72
72
|
},
|
|
@@ -75,220 +75,204 @@ const J = S(
|
|
|
75
75
|
}
|
|
76
76
|
)
|
|
77
77
|
);
|
|
78
|
-
|
|
79
|
-
const
|
|
78
|
+
Q.displayName = "FilterMenu";
|
|
79
|
+
const Ee = N(
|
|
80
80
|
({
|
|
81
81
|
filters: d,
|
|
82
|
-
buttonText:
|
|
82
|
+
buttonText: C = "Add filter",
|
|
83
83
|
appliedFilters: l = [],
|
|
84
|
-
onRemoveFilter:
|
|
84
|
+
onRemoveFilter: x,
|
|
85
85
|
onClearAllFilters: b,
|
|
86
86
|
onOpenChange: u,
|
|
87
|
-
maxVisibleTags:
|
|
88
|
-
className:
|
|
89
|
-
disabled:
|
|
90
|
-
applyOnClose:
|
|
91
|
-
},
|
|
92
|
-
const [
|
|
87
|
+
maxVisibleTags: v = 4,
|
|
88
|
+
className: Z,
|
|
89
|
+
disabled: O = !1,
|
|
90
|
+
applyOnClose: o = !1
|
|
91
|
+
}, D) => {
|
|
92
|
+
const [m, ee] = w(!1), [f, te] = w({}), I = E({}), S = E(d), c = T(
|
|
93
93
|
(e) => {
|
|
94
|
-
|
|
95
|
-
const
|
|
96
|
-
return
|
|
94
|
+
te((n) => {
|
|
95
|
+
const r = typeof e == "function" ? e(n) : e;
|
|
96
|
+
return I.current = r, r;
|
|
97
97
|
});
|
|
98
98
|
},
|
|
99
99
|
[]
|
|
100
100
|
);
|
|
101
|
-
|
|
102
|
-
|
|
101
|
+
$(() => {
|
|
102
|
+
S.current = d;
|
|
103
103
|
}, [d]);
|
|
104
|
-
const
|
|
105
|
-
if (
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
changesCount: Object.keys(e).length,
|
|
112
|
-
changes: e,
|
|
113
|
-
filtersCount: r.length
|
|
114
|
-
}), Object.entries(e).forEach(([a, n]) => {
|
|
115
|
-
const i = r.find((x) => x.id === a);
|
|
116
|
-
if (console.log("[FilterDropdown] Processing filter", { filterId: a, filter: !!i, changes: n }), !!i)
|
|
117
|
-
switch (n.type) {
|
|
104
|
+
const F = T(() => {
|
|
105
|
+
if (!o) return;
|
|
106
|
+
const e = I.current, n = S.current;
|
|
107
|
+
Object.entries(e).forEach(([r, a]) => {
|
|
108
|
+
const i = n.find((g) => g.id === r);
|
|
109
|
+
if (i)
|
|
110
|
+
switch (a.type) {
|
|
118
111
|
case "checkbox":
|
|
119
|
-
|
|
112
|
+
a.checkboxValues !== void 0 && i.onChange?.(a.checkboxValues);
|
|
120
113
|
break;
|
|
121
114
|
case "radio":
|
|
122
|
-
|
|
115
|
+
a.radioValue !== void 0 && i.onValueChange?.(a.radioValue);
|
|
123
116
|
break;
|
|
124
117
|
case "date":
|
|
125
|
-
|
|
118
|
+
a.dateValue !== void 0 && i.onDateValueChange?.(a.dateValue), a.dateInit !== void 0 && i.onDateInitChange?.(a.dateInit), a.dateEnd !== void 0 && i.onDateEndChange?.(a.dateEnd), a.startTime !== void 0 && i.onStartTimeChange?.(a.startTime), a.endTime !== void 0 && i.onEndTimeChange?.(a.endTime);
|
|
126
119
|
break;
|
|
127
120
|
case "custom":
|
|
128
|
-
|
|
121
|
+
a.customValue !== void 0 && i.onCustomChange?.(a.customValue);
|
|
129
122
|
break;
|
|
130
123
|
}
|
|
131
124
|
}), c({});
|
|
132
|
-
}, [
|
|
125
|
+
}, [o, c]), V = T(
|
|
133
126
|
(e) => {
|
|
134
|
-
|
|
135
|
-
open: e,
|
|
136
|
-
isOpen: f,
|
|
137
|
-
applyOnClose: s,
|
|
138
|
-
bufferedChanges: D.current
|
|
139
|
-
}), !e && f && s && (console.log("[FilterDropdown] Applying buffered changes on close", D.current), y()), e && !f && s && (console.log("[FilterDropdown] Clearing buffered changes on open"), c({})), O(e), u?.(e);
|
|
127
|
+
!e && m && o && F(), e && !m && o && c({}), ee(e), u?.(e);
|
|
140
128
|
},
|
|
141
|
-
[u,
|
|
142
|
-
), [
|
|
129
|
+
[u, m, o, F, c]
|
|
130
|
+
), [y, B] = w(
|
|
143
131
|
d.length > 0 && d[0]?.id || ""
|
|
144
|
-
), M =
|
|
132
|
+
), M = E(null), ne = T(
|
|
145
133
|
(e) => {
|
|
146
|
-
M.current = e, typeof
|
|
134
|
+
M.current = e, typeof D == "function" ? D(e) : D && (D.current = e);
|
|
147
135
|
},
|
|
148
|
-
[
|
|
136
|
+
[D]
|
|
149
137
|
);
|
|
150
|
-
|
|
151
|
-
if (!
|
|
152
|
-
const e = (
|
|
153
|
-
const i =
|
|
138
|
+
$(() => {
|
|
139
|
+
if (!m) return;
|
|
140
|
+
const e = (a) => {
|
|
141
|
+
const i = a.target;
|
|
154
142
|
M.current?.contains(i) || i.closest?.(
|
|
155
143
|
"[data-radix-popper-content-wrapper], [data-radix-portal]"
|
|
156
144
|
) || i.closest?.(
|
|
157
145
|
".rdp, .rdp-root, [data-calendar]"
|
|
158
|
-
) ||
|
|
159
|
-
},
|
|
160
|
-
|
|
161
|
-
},
|
|
162
|
-
document.addEventListener("mousedown", e), document.addEventListener("keydown",
|
|
146
|
+
) || V(!1);
|
|
147
|
+
}, n = (a) => {
|
|
148
|
+
a.key === "Escape" && V(!1);
|
|
149
|
+
}, r = setTimeout(() => {
|
|
150
|
+
document.addEventListener("mousedown", e), document.addEventListener("keydown", n);
|
|
163
151
|
}, 0);
|
|
164
152
|
return () => {
|
|
165
|
-
clearTimeout(
|
|
153
|
+
clearTimeout(r), document.removeEventListener("mousedown", e), document.removeEventListener("keydown", n);
|
|
166
154
|
};
|
|
167
|
-
}, [
|
|
168
|
-
const
|
|
169
|
-
if (d.find((
|
|
170
|
-
const
|
|
171
|
-
if (
|
|
172
|
-
const
|
|
173
|
-
if (d.find((
|
|
155
|
+
}, [m, V]);
|
|
156
|
+
const ae = l.length > 0, re = l.slice(0, v), R = l.length - v, A = (e) => {
|
|
157
|
+
if (d.find((a) => a.id === e)) return e;
|
|
158
|
+
const r = e.split("-");
|
|
159
|
+
if (r.length > 1) {
|
|
160
|
+
const a = r[0];
|
|
161
|
+
if (d.find((g) => g.id === a)) return a;
|
|
174
162
|
}
|
|
175
163
|
return e;
|
|
176
|
-
},
|
|
177
|
-
const
|
|
178
|
-
return d.find((
|
|
179
|
-
},
|
|
180
|
-
const
|
|
181
|
-
|
|
164
|
+
}, H = (e) => {
|
|
165
|
+
const n = A(e);
|
|
166
|
+
return d.find((a) => a.id === n)?.clearable !== !1;
|
|
167
|
+
}, se = (e) => {
|
|
168
|
+
const n = A(e);
|
|
169
|
+
B(n), V(!0);
|
|
182
170
|
}, oe = l.some(
|
|
183
|
-
(e) =>
|
|
184
|
-
),
|
|
171
|
+
(e) => H(e.id)
|
|
172
|
+
), ie = d.map((e) => ({
|
|
185
173
|
id: e.id,
|
|
186
174
|
icon: e.icon,
|
|
187
175
|
label: e.label
|
|
188
|
-
})), t = d.find((e) => e.id ===
|
|
189
|
-
|
|
190
|
-
console.log("[FilterDropdown] Blocked: minimum selection not met", { minSelection: a, actualLength: n.length });
|
|
191
|
-
return;
|
|
192
|
-
}
|
|
193
|
-
s ? (console.log("[FilterDropdown] Buffering checkbox values", { filterId: e, values: n }), c((i) => ({
|
|
176
|
+
})), t = d.find((e) => e.id === y), de = (e, n) => o ? f[e]?.checkboxValues ?? n : n, ce = (e, n) => o ? f[e]?.radioValue ?? n : n, le = (e, n) => o ? f[e]?.dateValue ?? n : n, ue = (e, n) => o ? f[e]?.dateInit ?? n : n, fe = (e, n) => o ? f[e]?.dateEnd ?? n : n, me = (e, n) => o ? f[e]?.startTime ?? n : n, he = (e, n) => o ? f[e]?.endTime ?? n : n, xe = (e, n, r) => (a) => {
|
|
177
|
+
r !== void 0 && r > 0 && a.length < r || (o ? c((i) => ({
|
|
194
178
|
...i,
|
|
195
179
|
[e]: {
|
|
196
180
|
...i[e],
|
|
197
181
|
type: "checkbox",
|
|
198
|
-
checkboxValues:
|
|
182
|
+
checkboxValues: a
|
|
199
183
|
}
|
|
200
|
-
}))
|
|
201
|
-
},
|
|
202
|
-
|
|
203
|
-
...
|
|
184
|
+
})) : n?.(a));
|
|
185
|
+
}, be = (e, n) => (r) => {
|
|
186
|
+
o ? c((a) => ({
|
|
187
|
+
...a,
|
|
204
188
|
[e]: {
|
|
205
|
-
...
|
|
189
|
+
...a[e],
|
|
206
190
|
type: "radio",
|
|
207
|
-
radioValue:
|
|
191
|
+
radioValue: r
|
|
208
192
|
}
|
|
209
|
-
})) :
|
|
210
|
-
},
|
|
211
|
-
|
|
212
|
-
...
|
|
193
|
+
})) : n?.(r);
|
|
194
|
+
}, ge = (e, n) => (r) => {
|
|
195
|
+
o ? c((a) => ({
|
|
196
|
+
...a,
|
|
213
197
|
[e]: {
|
|
214
|
-
...
|
|
198
|
+
...a[e],
|
|
215
199
|
type: "date",
|
|
216
|
-
dateValue:
|
|
200
|
+
dateValue: r
|
|
217
201
|
}
|
|
218
|
-
})) :
|
|
219
|
-
},
|
|
220
|
-
|
|
221
|
-
...
|
|
202
|
+
})) : n?.(r);
|
|
203
|
+
}, Ce = (e, n) => (r) => {
|
|
204
|
+
o ? c((a) => ({
|
|
205
|
+
...a,
|
|
222
206
|
[e]: {
|
|
223
|
-
...
|
|
207
|
+
...a[e],
|
|
224
208
|
type: "date",
|
|
225
|
-
dateInit:
|
|
209
|
+
dateInit: r
|
|
226
210
|
}
|
|
227
|
-
})) :
|
|
228
|
-
},
|
|
229
|
-
|
|
230
|
-
...
|
|
211
|
+
})) : n?.(r);
|
|
212
|
+
}, De = (e, n) => (r) => {
|
|
213
|
+
o ? c((a) => ({
|
|
214
|
+
...a,
|
|
231
215
|
[e]: {
|
|
232
|
-
...
|
|
216
|
+
...a[e],
|
|
233
217
|
type: "date",
|
|
234
|
-
dateEnd:
|
|
218
|
+
dateEnd: r
|
|
235
219
|
}
|
|
236
|
-
})) :
|
|
237
|
-
},
|
|
238
|
-
|
|
239
|
-
...
|
|
220
|
+
})) : n?.(r);
|
|
221
|
+
}, Ve = (e, n) => (r) => {
|
|
222
|
+
o ? c((a) => ({
|
|
223
|
+
...a,
|
|
240
224
|
[e]: {
|
|
241
|
-
...
|
|
225
|
+
...a[e],
|
|
242
226
|
type: "date",
|
|
243
|
-
startTime:
|
|
227
|
+
startTime: r
|
|
244
228
|
}
|
|
245
|
-
})) :
|
|
246
|
-
},
|
|
247
|
-
|
|
248
|
-
...
|
|
229
|
+
})) : n?.(r);
|
|
230
|
+
}, ve = (e, n) => (r) => {
|
|
231
|
+
o ? c((a) => ({
|
|
232
|
+
...a,
|
|
249
233
|
[e]: {
|
|
250
|
-
...
|
|
234
|
+
...a[e],
|
|
251
235
|
type: "date",
|
|
252
|
-
endTime:
|
|
236
|
+
endTime: r
|
|
253
237
|
}
|
|
254
|
-
})) :
|
|
255
|
-
},
|
|
238
|
+
})) : n?.(r);
|
|
239
|
+
}, Te = () => {
|
|
256
240
|
if (!t) return null;
|
|
257
241
|
switch (t.type) {
|
|
258
242
|
case "checkbox": {
|
|
259
|
-
const e =
|
|
243
|
+
const e = de(
|
|
260
244
|
t.id,
|
|
261
245
|
t.selectedValues || []
|
|
262
|
-
),
|
|
263
|
-
return /* @__PURE__ */
|
|
264
|
-
|
|
246
|
+
), n = t.description && (t.descriptionMinSelection === void 0 || e.length >= t.descriptionMinSelection);
|
|
247
|
+
return /* @__PURE__ */ s.jsx(
|
|
248
|
+
G,
|
|
265
249
|
{
|
|
266
250
|
title: t.label,
|
|
267
251
|
items: t.items || [],
|
|
268
252
|
selectedValues: e,
|
|
269
|
-
onChange:
|
|
253
|
+
onChange: xe(t.id, t.onChange, t.minSelection),
|
|
270
254
|
searchable: t.searchable,
|
|
271
255
|
searchPlaceholder: t.searchPlaceholder,
|
|
272
256
|
showActions: t.showActions,
|
|
273
257
|
enableSelectAll: t.enableSelectAll,
|
|
274
258
|
enableInverse: t.enableInverse,
|
|
275
259
|
enableNone: t.enableNone,
|
|
276
|
-
description:
|
|
260
|
+
description: n ? t.description : void 0
|
|
277
261
|
}
|
|
278
262
|
);
|
|
279
263
|
}
|
|
280
264
|
case "radio":
|
|
281
|
-
return /* @__PURE__ */
|
|
282
|
-
|
|
265
|
+
return /* @__PURE__ */ s.jsx(
|
|
266
|
+
G,
|
|
283
267
|
{
|
|
284
268
|
type: "radio",
|
|
285
269
|
title: t.label,
|
|
286
270
|
items: t.items || [],
|
|
287
|
-
selectedValue:
|
|
271
|
+
selectedValue: ce(
|
|
288
272
|
t.id,
|
|
289
273
|
t.selectedValue || ""
|
|
290
274
|
),
|
|
291
|
-
onChange:
|
|
275
|
+
onChange: be(t.id, t.onValueChange),
|
|
292
276
|
searchable: t.searchable,
|
|
293
277
|
searchPlaceholder: t.searchPlaceholder,
|
|
294
278
|
showActions: t.showActions,
|
|
@@ -299,63 +283,63 @@ const Te = S(
|
|
|
299
283
|
}
|
|
300
284
|
);
|
|
301
285
|
case "date": {
|
|
302
|
-
const e =
|
|
286
|
+
const e = le(
|
|
303
287
|
t.id,
|
|
304
|
-
t.dateValue ||
|
|
305
|
-
),
|
|
288
|
+
t.dateValue || k.LAST_7_DAYS
|
|
289
|
+
), n = ue(t.id, t.dateInit), r = fe(t.id, t.dateEnd), a = me(t.id, t.startTime || ""), i = he(t.id, t.endTime || ""), g = o && f[t.id]?.dateInit !== void 0, z = o && f[t.id]?.dateEnd !== void 0, je = ge(
|
|
306
290
|
t.id,
|
|
307
291
|
t.onDateValueChange
|
|
308
|
-
),
|
|
292
|
+
), L = Ce(
|
|
309
293
|
t.id,
|
|
310
294
|
t.onDateInitChange
|
|
311
|
-
),
|
|
295
|
+
), P = De(
|
|
312
296
|
t.id,
|
|
313
297
|
t.onDateEndChange
|
|
314
|
-
),
|
|
298
|
+
), U = Ve(
|
|
315
299
|
t.id,
|
|
316
300
|
t.onStartTimeChange
|
|
317
|
-
),
|
|
301
|
+
), _ = ve(
|
|
318
302
|
t.id,
|
|
319
303
|
t.onEndTimeChange
|
|
320
|
-
),
|
|
321
|
-
if (
|
|
322
|
-
const
|
|
323
|
-
|
|
324
|
-
const
|
|
325
|
-
|
|
304
|
+
), pe = (K) => {
|
|
305
|
+
if (je(K), K === k.CUSTOM && !g && !z) {
|
|
306
|
+
const W = /* @__PURE__ */ new Date(), X = new Date(W);
|
|
307
|
+
X.setHours(23, 59, 59, 999);
|
|
308
|
+
const Y = new Date(W);
|
|
309
|
+
Y.setHours(0, 0, 0, 0), L(Y), P(X), U("00:00:00"), _("23:59:59");
|
|
326
310
|
}
|
|
327
311
|
};
|
|
328
|
-
return /* @__PURE__ */
|
|
329
|
-
|
|
312
|
+
return /* @__PURE__ */ s.jsx(
|
|
313
|
+
we,
|
|
330
314
|
{
|
|
331
315
|
value: e,
|
|
332
|
-
onValueChange:
|
|
333
|
-
showCustomFields: e ===
|
|
334
|
-
startDate:
|
|
335
|
-
endDate:
|
|
336
|
-
startTime:
|
|
316
|
+
onValueChange: pe,
|
|
317
|
+
showCustomFields: e === k.CUSTOM,
|
|
318
|
+
startDate: n,
|
|
319
|
+
endDate: r,
|
|
320
|
+
startTime: a,
|
|
337
321
|
endTime: i,
|
|
338
322
|
mode: t.dateMode || "range",
|
|
339
323
|
singleDayLabel: t.singleDayLabel,
|
|
340
324
|
showAllTime: t.showAllTime,
|
|
341
|
-
onStartDateChange:
|
|
342
|
-
onEndDateChange:
|
|
343
|
-
onStartTimeChange:
|
|
344
|
-
onEndTimeChange:
|
|
325
|
+
onStartDateChange: L,
|
|
326
|
+
onEndDateChange: P,
|
|
327
|
+
onStartTimeChange: U,
|
|
328
|
+
onEndTimeChange: _,
|
|
345
329
|
announcement: t.description
|
|
346
330
|
}
|
|
347
331
|
);
|
|
348
332
|
}
|
|
349
333
|
case "custom": {
|
|
350
|
-
const e =
|
|
351
|
-
bufferedValue:
|
|
352
|
-
onDeferredChange: (
|
|
353
|
-
c((
|
|
354
|
-
...
|
|
334
|
+
const e = o ? {
|
|
335
|
+
bufferedValue: f[t.id]?.customValue,
|
|
336
|
+
onDeferredChange: (n) => {
|
|
337
|
+
c((r) => ({
|
|
338
|
+
...r,
|
|
355
339
|
[t.id]: {
|
|
356
|
-
...
|
|
340
|
+
...r[t.id],
|
|
357
341
|
type: "custom",
|
|
358
|
-
customValue:
|
|
342
|
+
customValue: n
|
|
359
343
|
}
|
|
360
344
|
}));
|
|
361
345
|
},
|
|
@@ -367,50 +351,50 @@ const Te = S(
|
|
|
367
351
|
return null;
|
|
368
352
|
}
|
|
369
353
|
};
|
|
370
|
-
return /* @__PURE__ */
|
|
354
|
+
return /* @__PURE__ */ s.jsxs(
|
|
371
355
|
"div",
|
|
372
356
|
{
|
|
373
|
-
ref:
|
|
374
|
-
className: h("flex flex-col gap-1 relative",
|
|
357
|
+
ref: ne,
|
|
358
|
+
className: h("flex flex-col gap-1 relative", Z),
|
|
375
359
|
children: [
|
|
376
|
-
/* @__PURE__ */
|
|
377
|
-
/* @__PURE__ */
|
|
378
|
-
|
|
360
|
+
/* @__PURE__ */ s.jsxs("div", { className: "flex items-center gap-4", children: [
|
|
361
|
+
/* @__PURE__ */ s.jsxs(
|
|
362
|
+
j,
|
|
379
363
|
{
|
|
380
364
|
variant: "outline",
|
|
381
365
|
size: "sm",
|
|
382
366
|
className: "gap-2",
|
|
383
|
-
onClick: () =>
|
|
384
|
-
disabled:
|
|
367
|
+
onClick: () => V(!m),
|
|
368
|
+
disabled: O,
|
|
385
369
|
children: [
|
|
386
|
-
/* @__PURE__ */
|
|
387
|
-
|
|
370
|
+
/* @__PURE__ */ s.jsx(p, { name: "FunnelSimple", className: "size-4" }),
|
|
371
|
+
C
|
|
388
372
|
]
|
|
389
373
|
}
|
|
390
374
|
),
|
|
391
|
-
|
|
392
|
-
/* @__PURE__ */
|
|
393
|
-
/* @__PURE__ */
|
|
375
|
+
ae ? /* @__PURE__ */ s.jsxs(s.Fragment, { children: [
|
|
376
|
+
/* @__PURE__ */ s.jsx(q, { orientation: "vertical", className: "h-5" }),
|
|
377
|
+
/* @__PURE__ */ s.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
394
378
|
re.map((e) => {
|
|
395
|
-
const
|
|
396
|
-
return /* @__PURE__ */
|
|
397
|
-
|
|
379
|
+
const n = H(e.id);
|
|
380
|
+
return /* @__PURE__ */ s.jsxs(
|
|
381
|
+
j,
|
|
398
382
|
{
|
|
399
383
|
variant: "secondary",
|
|
400
|
-
onClick: () =>
|
|
384
|
+
onClick: () => se(e.id),
|
|
401
385
|
className: "display-flex items-center gap-2",
|
|
402
386
|
size: "sm",
|
|
403
387
|
children: [
|
|
404
388
|
e.label,
|
|
405
|
-
|
|
389
|
+
x && n && /* @__PURE__ */ s.jsx(
|
|
406
390
|
"button",
|
|
407
391
|
{
|
|
408
|
-
onClick: (
|
|
409
|
-
|
|
392
|
+
onClick: (r) => {
|
|
393
|
+
r.stopPropagation(), x(e.id);
|
|
410
394
|
},
|
|
411
395
|
className: "inline-flex items-center justify-center",
|
|
412
396
|
"aria-label": `Remove ${e.label} filter`,
|
|
413
|
-
children: /* @__PURE__ */
|
|
397
|
+
children: /* @__PURE__ */ s.jsx(p, { name: "X", className: "size-4" })
|
|
414
398
|
}
|
|
415
399
|
)
|
|
416
400
|
]
|
|
@@ -418,28 +402,28 @@ const Te = S(
|
|
|
418
402
|
e.id
|
|
419
403
|
);
|
|
420
404
|
}),
|
|
421
|
-
R > 0 && /* @__PURE__ */
|
|
405
|
+
R > 0 && /* @__PURE__ */ s.jsxs(j, { children: [
|
|
422
406
|
"+",
|
|
423
407
|
R,
|
|
424
408
|
" more"
|
|
425
409
|
] }),
|
|
426
|
-
b && oe && /* @__PURE__ */
|
|
427
|
-
|
|
410
|
+
b && oe && /* @__PURE__ */ s.jsx(
|
|
411
|
+
j,
|
|
428
412
|
{
|
|
429
413
|
variant: "ghost",
|
|
430
414
|
size: "sm",
|
|
431
415
|
className: "h-8 px-3 py-2",
|
|
432
416
|
onClick: b,
|
|
433
|
-
children: /* @__PURE__ */
|
|
417
|
+
children: /* @__PURE__ */ s.jsx("span", { className: "text-xs font-medium leading-none text-primary", children: "Clear filters" })
|
|
434
418
|
}
|
|
435
419
|
)
|
|
436
420
|
] })
|
|
437
|
-
] }) : /* @__PURE__ */
|
|
438
|
-
/* @__PURE__ */
|
|
439
|
-
/* @__PURE__ */
|
|
421
|
+
] }) : /* @__PURE__ */ s.jsxs(s.Fragment, { children: [
|
|
422
|
+
/* @__PURE__ */ s.jsx(q, { orientation: "vertical", className: "h-5" }),
|
|
423
|
+
/* @__PURE__ */ s.jsx("span", { className: "text-sm font-normal text-muted-foreground", children: "No filters applied" })
|
|
440
424
|
] })
|
|
441
425
|
] }),
|
|
442
|
-
|
|
426
|
+
m && /* @__PURE__ */ s.jsxs(
|
|
443
427
|
"div",
|
|
444
428
|
{
|
|
445
429
|
className: h(
|
|
@@ -450,15 +434,15 @@ const Te = S(
|
|
|
450
434
|
"bg-popover border border-border rounded-md p-2"
|
|
451
435
|
),
|
|
452
436
|
children: [
|
|
453
|
-
/* @__PURE__ */
|
|
454
|
-
|
|
437
|
+
/* @__PURE__ */ s.jsx(
|
|
438
|
+
Q,
|
|
455
439
|
{
|
|
456
|
-
items:
|
|
457
|
-
activeItemId:
|
|
458
|
-
onItemClick:
|
|
440
|
+
items: ie,
|
|
441
|
+
activeItemId: y,
|
|
442
|
+
onItemClick: B
|
|
459
443
|
}
|
|
460
444
|
),
|
|
461
|
-
/* @__PURE__ */
|
|
445
|
+
/* @__PURE__ */ s.jsx("div", { className: "flex flex-col gap-4 p-6 bg-popover w-[448px] h-full rounded-md overflow-y-auto", children: Te() })
|
|
462
446
|
]
|
|
463
447
|
}
|
|
464
448
|
)
|
|
@@ -467,9 +451,9 @@ const Te = S(
|
|
|
467
451
|
);
|
|
468
452
|
}
|
|
469
453
|
);
|
|
470
|
-
|
|
454
|
+
Ee.displayName = "FilterDropdown";
|
|
471
455
|
export {
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
456
|
+
Ee as FilterDropdown,
|
|
457
|
+
Q as FilterMenu,
|
|
458
|
+
J as FilterMenuItem
|
|
475
459
|
};
|