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