@krosoft/react 0.0.310 → 0.0.312
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/{AppActions-DBxmXROG.js → AppActions-BSFD13aV.js} +2 -2
- package/dist/{AppSubTitle-Ck4UmLrQ.js → AppSubTitle-CVNe5WHv.js} +2 -2
- package/dist/{AppTitle-CA3AuX6v.js → AppTitle-DIHE8uen.js} +1 -1
- package/dist/{ErrorAlert-BuKadO9Z.js → ErrorAlert-D8XnPN0I.js} +1 -1
- package/dist/{GenericForm-tZkFJ7mA.js → GenericForm-Dcn4Xecn.js} +6 -6
- package/dist/{ImageInput-BT08niR9.js → ImageInput-BtV_Ezgp.js} +2 -2
- package/dist/{MultiSelect-D7AFiC_X.js → MultiSelect-DyHOoUsz.js} +3 -3
- package/dist/{SearchInput-tvcgwvmw.js → SearchInput-KPozEk_s.js} +4 -4
- package/dist/{behavior-C2896MtZ.js → behavior-2kM6-wgK.js} +1 -1
- package/dist/{cards-m0h-usz_.js → cards-pQZw-utJ.js} +2 -2
- package/dist/{charts-B1R8vOM7.js → charts-Oxpbp_Ii.js} +1 -1
- package/dist/components/core/cards/index.js +1 -1
- package/dist/components/core/charts/index.js +1 -1
- package/dist/components/core/dialogs/index.js +3 -3
- package/dist/components/core/filters/FiltersContainer.d.ts +11 -0
- package/dist/components/core/filters/FiltersContainer.d.ts.map +1 -0
- package/dist/components/core/filters/FiltersMobileDrawer.d.ts +9 -0
- package/dist/components/core/filters/FiltersMobileDrawer.d.ts.map +1 -0
- package/dist/components/core/filters/index.d.ts +2 -0
- package/dist/components/core/filters/index.d.ts.map +1 -1
- package/dist/components/core/filters/index.js +208 -111
- package/dist/components/core/forms/index.js +1 -1
- package/dist/components/core/index.js +24 -24
- package/dist/components/core/inputs/index.js +4 -4
- package/dist/components/core/language/index.js +1 -1
- package/dist/components/core/layouts/index.js +11 -11
- package/dist/components/core/navbar/index.js +1 -1
- package/dist/components/core/states/index.js +2 -2
- package/dist/components/core/table/index.js +2 -2
- package/dist/components/core/tabs/index.js +5 -5
- package/dist/components/core/theme/index.js +1 -1
- package/dist/components/index.js +24 -24
- package/dist/components/ui/index.js +2 -2
- package/dist/{dialogs--0dbPy6W.js → dialogs-BLrrt68D.js} +5 -5
- package/dist/hooks/behavior/index.js +1 -1
- package/dist/hooks/index.js +7 -7
- package/dist/hooks/ui/index.js +6 -6
- package/dist/i18n/index.js +1 -1
- package/dist/i18n/krosoftLocales.d.ts +6 -0
- package/dist/i18n/krosoftLocales.d.ts.map +1 -1
- package/dist/{i18n-DbPbmPRj.js → i18n-ClZK4zll.js} +6 -0
- package/dist/{inputs-2cwQbuBl.js → inputs-c7vMvV76.js} +3 -3
- package/dist/{language-9LfgyTr7.js → language-VKGAsAfF.js} +2 -2
- package/dist/{navbar-DKgwZj74.js → navbar-C4WWdADW.js} +3 -3
- package/dist/pwa/index.js +1 -1
- package/dist/{sheet-w_xag5lP.js → sheet-BjlRzLnc.js} +1 -1
- package/dist/{states-Ceb6VL--.js → states-C3v4BU7N.js} +2 -2
- package/dist/{theme-BMH6B6jL.js → theme-Bkamu5J6.js} +2 -2
- package/dist/{ui-CfT3vbQZ.js → ui-Bbn7hLKT.js} +3 -3
- package/dist/{ui-k3NqEwlP.js → ui-BwBUIl5y.js} +1 -1
- package/dist/{useDocumentTitle-BISAg9M7.js → useDocumentTitle-Ces2VRou.js} +1 -1
- package/dist/{useLanguage-BVuLE78e.js → useLanguage-c7lPQ7eh.js} +1 -1
- package/dist/{useTheme-DRWux5vA.js → useTheme-CU6lGuO4.js} +1 -1
- package/package.json +6 -6
|
@@ -1,70 +1,72 @@
|
|
|
1
1
|
import { t as e } from "../../../tailwind.helper-CJaRYBmL.js";
|
|
2
|
-
import { t } from "../../../i18n-
|
|
3
|
-
import { At as n,
|
|
4
|
-
import { c as
|
|
5
|
-
import { a, g as
|
|
6
|
-
import { t as
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
2
|
+
import { t } from "../../../i18n-ClZK4zll.js";
|
|
3
|
+
import { At as n, Jt as r, Kt as i, Pn as a, Xt as o, Zt as s, en as c, qt as l, tn as u } from "../../../ui-BwBUIl5y.js";
|
|
4
|
+
import { c as d } from "../../../tooltip-_geGvbS7.js";
|
|
5
|
+
import { a as f, g as p, l as m, o as h, r as g, t as _, u as v } from "../../../sheet-BjlRzLnc.js";
|
|
6
|
+
import { t as y } from "../../../useMobile-pTQ8lWvt.js";
|
|
7
|
+
import { t as b } from "../../../MultiSelect-DyHOoUsz.js";
|
|
8
|
+
import { i as x, n as S, r as C, t as w } from "../../../SearchInput-KPozEk_s.js";
|
|
9
|
+
import "../../../ui-Bbn7hLKT.js";
|
|
10
|
+
import { useEffect as T, useMemo as E, useState as D } from "react";
|
|
11
|
+
import { jsx as O, jsxs as k } from "react/jsx-runtime";
|
|
12
|
+
import { getLocale as A } from "@krosoft/core/helpers";
|
|
13
|
+
import { Filter as j, FilterIcon as M, FilterXIcon as N, XIcon as P } from "lucide-react";
|
|
12
14
|
//#region src/components/core/filters/ActiveFilters.tsx
|
|
13
|
-
var
|
|
14
|
-
if (t instanceof Date) return t.toLocaleDateString(
|
|
15
|
+
var F = (e, t, n, r = {}) => {
|
|
16
|
+
if (t instanceof Date) return t.toLocaleDateString(A());
|
|
15
17
|
let i = String(t), a = r[`${e}_${i}`];
|
|
16
18
|
return a === void 0 ? e.includes("ok") || t === "true" || t === "false" ? n(t === "true" ? "filters.yes" : "filters.no") : i : a;
|
|
17
19
|
};
|
|
18
|
-
function
|
|
20
|
+
function I({ filters: e, onRemoveFilter: n, onClearAll: r, filterLabelKeys: i = {}, optionLabels: o = {} }) {
|
|
19
21
|
let { t: s } = t(), c = Object.entries(e).filter(([e, t]) => !(t == null || t === "" || Array.isArray(t) && t.length === 0));
|
|
20
|
-
return c.length === 0 ? null : /* @__PURE__ */
|
|
22
|
+
return c.length === 0 ? null : /* @__PURE__ */ k("div", {
|
|
21
23
|
className: "flex flex-wrap items-center gap-2 mb-4",
|
|
22
24
|
children: [
|
|
23
|
-
/* @__PURE__ */
|
|
25
|
+
/* @__PURE__ */ O("span", {
|
|
24
26
|
className: "text-sm text-muted-foreground font-medium",
|
|
25
27
|
children: s("filters.active")
|
|
26
28
|
}),
|
|
27
29
|
c.flatMap(([e, t]) => {
|
|
28
|
-
let
|
|
30
|
+
let r = i[e], c = r === void 0 ? e : s(r);
|
|
29
31
|
if (Array.isArray(t)) return t.map((t) => {
|
|
30
|
-
let
|
|
31
|
-
return /* @__PURE__ */
|
|
32
|
+
let r = F(e, t, s, o);
|
|
33
|
+
return /* @__PURE__ */ k(a, {
|
|
32
34
|
variant: "secondary",
|
|
33
35
|
className: "flex items-center gap-1 px-3 py-1 bg-primary/10 text-primary border border-primary/20 hover:bg-primary/20",
|
|
34
36
|
children: [
|
|
35
37
|
c,
|
|
36
38
|
": ",
|
|
37
|
-
|
|
38
|
-
/* @__PURE__ */
|
|
39
|
+
r,
|
|
40
|
+
/* @__PURE__ */ O("button", {
|
|
39
41
|
onClick: () => {
|
|
40
42
|
n(e, t);
|
|
41
43
|
},
|
|
42
44
|
className: "ml-1 hover:bg-primary/20 rounded-full p-0.5",
|
|
43
|
-
children: /* @__PURE__ */
|
|
45
|
+
children: /* @__PURE__ */ O(P, { className: "size-4" })
|
|
44
46
|
})
|
|
45
47
|
]
|
|
46
48
|
}, `${e}_${String(t)}`);
|
|
47
49
|
});
|
|
48
|
-
let l =
|
|
49
|
-
return /* @__PURE__ */
|
|
50
|
+
let l = F(e, t, s, o);
|
|
51
|
+
return /* @__PURE__ */ k(a, {
|
|
50
52
|
variant: "secondary",
|
|
51
53
|
className: "flex items-center gap-1 px-3 py-1 bg-primary/10 text-primary border border-primary/20 hover:bg-primary/20",
|
|
52
54
|
children: [
|
|
53
55
|
c,
|
|
54
56
|
": ",
|
|
55
57
|
l,
|
|
56
|
-
/* @__PURE__ */
|
|
58
|
+
/* @__PURE__ */ O("button", {
|
|
57
59
|
onClick: () => {
|
|
58
60
|
n(e);
|
|
59
61
|
},
|
|
60
62
|
className: "ml-1 hover:bg-primary/20 rounded-full p-0.5",
|
|
61
|
-
children: /* @__PURE__ */
|
|
63
|
+
children: /* @__PURE__ */ O(P, { className: "size-4" })
|
|
62
64
|
})
|
|
63
65
|
]
|
|
64
66
|
}, e);
|
|
65
67
|
}),
|
|
66
|
-
c.length > 0 && /* @__PURE__ */
|
|
67
|
-
onClick:
|
|
68
|
+
c.length > 0 && /* @__PURE__ */ O("button", {
|
|
69
|
+
onClick: r,
|
|
68
70
|
className: "text-xs text-destructive hover:text-destructive/80 transition-colors font-medium ml-auto",
|
|
69
71
|
children: s("filters.clearAll")
|
|
70
72
|
})
|
|
@@ -73,17 +75,17 @@ function E({ filters: e, onRemoveFilter: n, onClearAll: i, filterLabelKeys: a =
|
|
|
73
75
|
}
|
|
74
76
|
//#endregion
|
|
75
77
|
//#region src/components/core/filters/FilterField.tsx
|
|
76
|
-
var
|
|
78
|
+
var L = ({ field: e, value: n, onChange: r, onToggleMultiSelect: i }) => {
|
|
77
79
|
let { t: a } = t();
|
|
78
80
|
switch (e.type) {
|
|
79
|
-
case "text": return /* @__PURE__ */
|
|
81
|
+
case "text": return /* @__PURE__ */ O(p, {
|
|
80
82
|
placeholder: e.placeholder,
|
|
81
83
|
value: n ?? "",
|
|
82
84
|
onChange: (e) => {
|
|
83
85
|
r(e.target.value);
|
|
84
86
|
}
|
|
85
87
|
});
|
|
86
|
-
case "number": return /* @__PURE__ */
|
|
88
|
+
case "number": return /* @__PURE__ */ O(p, {
|
|
87
89
|
type: "number",
|
|
88
90
|
placeholder: e.placeholder,
|
|
89
91
|
value: n ?? "",
|
|
@@ -93,7 +95,7 @@ var D = ({ field: e, value: n, onChange: r, onToggleMultiSelect: i }) => {
|
|
|
93
95
|
min: e.min,
|
|
94
96
|
max: e.max
|
|
95
97
|
});
|
|
96
|
-
case "select": return /* @__PURE__ */
|
|
98
|
+
case "select": return /* @__PURE__ */ O(S, {
|
|
97
99
|
options: e.options ?? [],
|
|
98
100
|
value: n,
|
|
99
101
|
onChange: r,
|
|
@@ -101,17 +103,17 @@ var D = ({ field: e, value: n, onChange: r, onToggleMultiSelect: i }) => {
|
|
|
101
103
|
placeholder: e.placeholder,
|
|
102
104
|
searchPlaceholder: e.searchPlaceholder
|
|
103
105
|
});
|
|
104
|
-
case "date": return /* @__PURE__ */
|
|
106
|
+
case "date": return /* @__PURE__ */ O(x, {
|
|
105
107
|
date: n,
|
|
106
108
|
onDateChange: r,
|
|
107
109
|
placeholder: e.placeholder ?? a("date.pickDate")
|
|
108
110
|
});
|
|
109
|
-
case "date-range": return /* @__PURE__ */
|
|
111
|
+
case "date-range": return /* @__PURE__ */ O(C, {
|
|
110
112
|
value: n,
|
|
111
113
|
onChange: r,
|
|
112
114
|
placeholder: e.placeholder
|
|
113
115
|
});
|
|
114
|
-
case "multi-select": return /* @__PURE__ */ b
|
|
116
|
+
case "multi-select": return /* @__PURE__ */ O(b, {
|
|
115
117
|
options: e.options ?? [],
|
|
116
118
|
selected: n ?? [],
|
|
117
119
|
onToggle: i,
|
|
@@ -125,92 +127,92 @@ var D = ({ field: e, value: n, onChange: r, onToggleMultiSelect: i }) => {
|
|
|
125
127
|
});
|
|
126
128
|
default: return null;
|
|
127
129
|
}
|
|
128
|
-
},
|
|
129
|
-
function
|
|
130
|
-
let { t:
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
}, [r,
|
|
134
|
-
let
|
|
135
|
-
|
|
130
|
+
}, R = (e) => !(e == null || e === "" || Array.isArray(e) && e.length === 0);
|
|
131
|
+
function z({ sections: e, filters: r, onFiltersChange: i, buttonText: a, sheetTitle: o }) {
|
|
132
|
+
let { t: s } = t(), [c, l] = D(!1), [u, p] = D(r);
|
|
133
|
+
T(() => {
|
|
134
|
+
p(r);
|
|
135
|
+
}, [r, c]);
|
|
136
|
+
let y = (e, t) => {
|
|
137
|
+
p((n) => ({
|
|
136
138
|
...n,
|
|
137
139
|
[e]: t
|
|
138
140
|
}));
|
|
139
|
-
},
|
|
140
|
-
let n =
|
|
141
|
-
|
|
142
|
-
},
|
|
143
|
-
|
|
144
|
-
},
|
|
145
|
-
|
|
146
|
-
},
|
|
141
|
+
}, b = (e, t) => {
|
|
142
|
+
let n = u[e], r = Array.isArray(n) ? n : [], i = r.includes(t) ? r.filter((e) => e !== t) : [...r, t];
|
|
143
|
+
y(e, i);
|
|
144
|
+
}, x = () => {
|
|
145
|
+
i(u), l(!1);
|
|
146
|
+
}, S = () => {
|
|
147
|
+
p({}), i({}), l(!1);
|
|
148
|
+
}, C = E(() => {
|
|
147
149
|
let t = new Set(e.flatMap((e) => e.filters.map((e) => e.key)));
|
|
148
|
-
return Object.entries(r).filter(([e, n]) => t.has(e) &&
|
|
150
|
+
return Object.entries(r).filter(([e, n]) => t.has(e) && R(n)).length;
|
|
149
151
|
}, [e, r]);
|
|
150
|
-
return /* @__PURE__ */
|
|
151
|
-
open:
|
|
152
|
-
onOpenChange:
|
|
153
|
-
children: [/* @__PURE__ */
|
|
152
|
+
return /* @__PURE__ */ k(_, {
|
|
153
|
+
open: c,
|
|
154
|
+
onOpenChange: l,
|
|
155
|
+
children: [/* @__PURE__ */ O(v, {
|
|
154
156
|
asChild: !0,
|
|
155
|
-
children: /* @__PURE__ */
|
|
157
|
+
children: /* @__PURE__ */ k(d, {
|
|
156
158
|
variant: "outline",
|
|
157
159
|
className: "gap-2",
|
|
158
160
|
children: [
|
|
159
|
-
/* @__PURE__ */
|
|
160
|
-
|
|
161
|
-
|
|
161
|
+
/* @__PURE__ */ O(j, { className: "size-4 shrink-0" }),
|
|
162
|
+
a ?? s("filters.more"),
|
|
163
|
+
C > 0 && /* @__PURE__ */ O("span", {
|
|
162
164
|
className: "ml-1 flex h-5 min-w-5 items-center justify-center rounded-full bg-primary px-1.5 text-xs font-semibold text-primary-foreground",
|
|
163
|
-
children:
|
|
165
|
+
children: C
|
|
164
166
|
})
|
|
165
167
|
]
|
|
166
168
|
})
|
|
167
|
-
}), /* @__PURE__ */
|
|
169
|
+
}), /* @__PURE__ */ k(g, {
|
|
168
170
|
side: "right",
|
|
169
171
|
className: "w-[400px] sm:w-[500px] flex flex-col p-0",
|
|
170
172
|
children: [
|
|
171
|
-
/* @__PURE__ */
|
|
173
|
+
/* @__PURE__ */ O(h, {
|
|
172
174
|
className: "p-6 pb-0",
|
|
173
|
-
children: /* @__PURE__ */
|
|
175
|
+
children: /* @__PURE__ */ O(m, { children: o ?? s("filters.advanced") })
|
|
174
176
|
}),
|
|
175
|
-
/* @__PURE__ */
|
|
177
|
+
/* @__PURE__ */ O("div", {
|
|
176
178
|
className: "flex-1 overflow-y-auto p-6 pt-6",
|
|
177
|
-
children: /* @__PURE__ */
|
|
179
|
+
children: /* @__PURE__ */ O("div", {
|
|
178
180
|
className: "space-y-6",
|
|
179
|
-
children: e.map((e, t) => /* @__PURE__ */
|
|
181
|
+
children: e.map((e, t) => /* @__PURE__ */ k("div", {
|
|
180
182
|
className: "space-y-4",
|
|
181
|
-
children: [/* @__PURE__ */
|
|
183
|
+
children: [/* @__PURE__ */ O("h3", {
|
|
182
184
|
className: "font-semibold text-sm text-foreground border-b pb-2",
|
|
183
|
-
children:
|
|
184
|
-
}), e.filters.map((e) => /* @__PURE__ */
|
|
185
|
+
children: s(e.titleKey)
|
|
186
|
+
}), e.filters.map((e) => /* @__PURE__ */ k("div", {
|
|
185
187
|
className: "space-y-2",
|
|
186
|
-
children: [/* @__PURE__ */
|
|
188
|
+
children: [/* @__PURE__ */ O(n, {
|
|
187
189
|
htmlFor: e.key,
|
|
188
|
-
children:
|
|
189
|
-
}), /* @__PURE__ */
|
|
190
|
+
children: s(e.labelKey)
|
|
191
|
+
}), /* @__PURE__ */ O(L, {
|
|
190
192
|
field: e,
|
|
191
|
-
value:
|
|
193
|
+
value: u[e.key],
|
|
192
194
|
onChange: (t) => {
|
|
193
|
-
|
|
195
|
+
y(e.key, t);
|
|
194
196
|
},
|
|
195
197
|
onToggleMultiSelect: (t) => {
|
|
196
|
-
|
|
198
|
+
b(e.key, t);
|
|
197
199
|
}
|
|
198
200
|
})]
|
|
199
201
|
}, e.key))]
|
|
200
202
|
}, t))
|
|
201
203
|
})
|
|
202
204
|
}),
|
|
203
|
-
/* @__PURE__ */
|
|
205
|
+
/* @__PURE__ */ k(f, {
|
|
204
206
|
className: "gap-2 p-6 border-t bg-background",
|
|
205
|
-
children: [/* @__PURE__ */
|
|
207
|
+
children: [/* @__PURE__ */ O(d, {
|
|
206
208
|
variant: "outline",
|
|
207
209
|
className: "flex-1",
|
|
208
|
-
onClick:
|
|
209
|
-
children:
|
|
210
|
-
}), /* @__PURE__ */
|
|
210
|
+
onClick: S,
|
|
211
|
+
children: s("filters.clear")
|
|
212
|
+
}), /* @__PURE__ */ O(d, {
|
|
211
213
|
className: "flex-1",
|
|
212
|
-
onClick:
|
|
213
|
-
children:
|
|
214
|
+
onClick: x,
|
|
215
|
+
children: s("filters.apply")
|
|
214
216
|
})]
|
|
215
217
|
})
|
|
216
218
|
]
|
|
@@ -219,28 +221,28 @@ function k({ sections: e, filters: r, onFiltersChange: o, buttonText: f, sheetTi
|
|
|
219
221
|
}
|
|
220
222
|
//#endregion
|
|
221
223
|
//#region src/components/core/filters/FilterPillsGroup.tsx
|
|
222
|
-
var
|
|
224
|
+
var B = {
|
|
223
225
|
solid: "border-foreground bg-foreground text-background",
|
|
224
226
|
outline: "border-primary bg-primary/10 text-primary font-medium"
|
|
225
227
|
};
|
|
226
|
-
function
|
|
227
|
-
return r === void 0 ? t ?
|
|
228
|
+
function V(t, n, r) {
|
|
229
|
+
return r === void 0 ? t ? B[n] : "border-border bg-background text-muted-foreground hover:text-foreground hover:border-foreground/40" : e(r, t ? "font-semibold" : "opacity-60 hover:opacity-100");
|
|
228
230
|
}
|
|
229
|
-
function
|
|
230
|
-
return /* @__PURE__ */
|
|
231
|
+
function H({ options: t, values: n, onToggle: r, variant: i = "solid" }) {
|
|
232
|
+
return /* @__PURE__ */ O("div", {
|
|
231
233
|
className: "flex flex-wrap gap-1.5",
|
|
232
234
|
children: t.map(({ value: t, label: a, count: o, icon: s, className: c }) => {
|
|
233
|
-
let l =
|
|
234
|
-
return /* @__PURE__ */
|
|
235
|
+
let l = V(n.includes(t), i, c);
|
|
236
|
+
return /* @__PURE__ */ k("button", {
|
|
235
237
|
onClick: () => {
|
|
236
238
|
r(t);
|
|
237
239
|
},
|
|
238
240
|
className: e("inline-flex items-center gap-1 text-xs px-2.5 py-1 rounded-control border transition-colors", l),
|
|
239
241
|
children: [
|
|
240
|
-
s && /* @__PURE__ */
|
|
242
|
+
s && /* @__PURE__ */ O(s, { className: "size-3 shrink-0" }),
|
|
241
243
|
a,
|
|
242
244
|
" ",
|
|
243
|
-
o !== void 0 && /* @__PURE__ */
|
|
245
|
+
o !== void 0 && /* @__PURE__ */ k("span", {
|
|
244
246
|
className: "opacity-60",
|
|
245
247
|
children: [
|
|
246
248
|
"(",
|
|
@@ -255,8 +257,8 @@ function M({ options: t, values: n, onToggle: r, variant: i = "solid" }) {
|
|
|
255
257
|
}
|
|
256
258
|
//#endregion
|
|
257
259
|
//#region src/components/core/filters/FilterPills.tsx
|
|
258
|
-
function
|
|
259
|
-
return /* @__PURE__ */
|
|
260
|
+
function U({ options: e, value: t, onChange: n, variant: r = "solid" }) {
|
|
261
|
+
return /* @__PURE__ */ O(H, {
|
|
260
262
|
options: e,
|
|
261
263
|
values: [t],
|
|
262
264
|
onToggle: n,
|
|
@@ -264,20 +266,115 @@ function N({ options: e, value: t, onChange: n, variant: r = "solid" }) {
|
|
|
264
266
|
});
|
|
265
267
|
}
|
|
266
268
|
//#endregion
|
|
269
|
+
//#region src/components/core/filters/FiltersMobileDrawer.tsx
|
|
270
|
+
function W({ children: e, activeFiltersCount: n = 0, onReset: a, onApply: f }) {
|
|
271
|
+
let { t: p } = t(), [m, h] = D(!1);
|
|
272
|
+
return /* @__PURE__ */ k(i, {
|
|
273
|
+
open: m,
|
|
274
|
+
onOpenChange: h,
|
|
275
|
+
children: [/* @__PURE__ */ O(u, {
|
|
276
|
+
asChild: !0,
|
|
277
|
+
children: /* @__PURE__ */ k(d, {
|
|
278
|
+
variant: "outline",
|
|
279
|
+
className: "relative",
|
|
280
|
+
children: [
|
|
281
|
+
/* @__PURE__ */ O(M, { className: "h-4 w-4 mr-2" }),
|
|
282
|
+
p("filters.filter"),
|
|
283
|
+
n > 0 && /* @__PURE__ */ O("span", {
|
|
284
|
+
className: "absolute -top-2 -right-2 flex h-5 w-5 items-center justify-center rounded-full bg-primary text-xs text-primary-foreground",
|
|
285
|
+
children: n
|
|
286
|
+
})
|
|
287
|
+
]
|
|
288
|
+
})
|
|
289
|
+
}), /* @__PURE__ */ k(r, { children: [
|
|
290
|
+
/* @__PURE__ */ O(s, { children: /* @__PURE__ */ O(c, { children: p("filters.title") }) }),
|
|
291
|
+
/* @__PURE__ */ O("div", {
|
|
292
|
+
className: "flex flex-col gap-4 px-4 pb-4",
|
|
293
|
+
children: e
|
|
294
|
+
}),
|
|
295
|
+
/* @__PURE__ */ k(o, {
|
|
296
|
+
className: "flex-row gap-2",
|
|
297
|
+
children: [/* @__PURE__ */ k(d, {
|
|
298
|
+
variant: "outline",
|
|
299
|
+
onClick: () => {
|
|
300
|
+
a?.(), h(!1);
|
|
301
|
+
},
|
|
302
|
+
className: "flex-1",
|
|
303
|
+
children: [/* @__PURE__ */ O(N, { className: "h-4 w-4 mr-2" }), p("filters.reset")]
|
|
304
|
+
}), /* @__PURE__ */ O(l, {
|
|
305
|
+
asChild: !0,
|
|
306
|
+
children: /* @__PURE__ */ O(d, {
|
|
307
|
+
onClick: () => {
|
|
308
|
+
f?.(), h(!1);
|
|
309
|
+
},
|
|
310
|
+
className: "flex-1",
|
|
311
|
+
children: p("actions.apply")
|
|
312
|
+
})
|
|
313
|
+
})]
|
|
314
|
+
})
|
|
315
|
+
] })]
|
|
316
|
+
});
|
|
317
|
+
}
|
|
318
|
+
//#endregion
|
|
319
|
+
//#region src/components/core/filters/FiltersContainer.tsx
|
|
320
|
+
function G({ children: e, search: n, searchPlaceholder: r, activeFiltersCount: i = 0, onReset: a, onSearch: o }) {
|
|
321
|
+
let { t: s } = t();
|
|
322
|
+
return y() ? /* @__PURE__ */ k("div", {
|
|
323
|
+
className: "flex items-center gap-2",
|
|
324
|
+
children: [o !== void 0 && /* @__PURE__ */ O("div", {
|
|
325
|
+
className: "flex-1",
|
|
326
|
+
children: /* @__PURE__ */ O(w, {
|
|
327
|
+
search: n ?? "",
|
|
328
|
+
onSearch: o,
|
|
329
|
+
placeholder: r
|
|
330
|
+
})
|
|
331
|
+
}), /* @__PURE__ */ O(W, {
|
|
332
|
+
activeFiltersCount: i,
|
|
333
|
+
onReset: a,
|
|
334
|
+
children: e
|
|
335
|
+
})]
|
|
336
|
+
}) : /* @__PURE__ */ k("div", {
|
|
337
|
+
className: "flex justify-between",
|
|
338
|
+
children: [/* @__PURE__ */ k("div", {
|
|
339
|
+
className: "flex flex-wrap gap-2",
|
|
340
|
+
children: [o !== void 0 && /* @__PURE__ */ O(w, {
|
|
341
|
+
search: n ?? "",
|
|
342
|
+
onSearch: o,
|
|
343
|
+
placeholder: r
|
|
344
|
+
}), e]
|
|
345
|
+
}), a && /* @__PURE__ */ O("div", {
|
|
346
|
+
className: "flex flex-wrap gap-4",
|
|
347
|
+
children: /* @__PURE__ */ k(d, {
|
|
348
|
+
variant: "outline",
|
|
349
|
+
onClick: a,
|
|
350
|
+
className: "relative",
|
|
351
|
+
children: [
|
|
352
|
+
/* @__PURE__ */ O(N, {}),
|
|
353
|
+
s("filters.reset"),
|
|
354
|
+
i > 0 && /* @__PURE__ */ O("span", {
|
|
355
|
+
className: "absolute -top-2 -right-2 flex h-5 w-5 items-center justify-center rounded-full bg-primary text-xs text-primary-foreground",
|
|
356
|
+
children: i
|
|
357
|
+
})
|
|
358
|
+
]
|
|
359
|
+
})
|
|
360
|
+
})]
|
|
361
|
+
});
|
|
362
|
+
}
|
|
363
|
+
//#endregion
|
|
267
364
|
//#region src/components/core/filters/TableFilter.tsx
|
|
268
|
-
function
|
|
365
|
+
function K({ searchQuery: e, onSearchChange: n, searchPlaceholder: r, filters: i, onFiltersChange: a, sections: o, advancedButtonText: s, sheetTitle: c }) {
|
|
269
366
|
let { t: l } = t(), u = (e, t) => {
|
|
270
367
|
let n = i[e], r = Array.isArray(n) ? n : [], o = r.includes(t) ? r.filter((e) => e !== t) : [...r, t], s = { ...i };
|
|
271
368
|
o.length === 0 ? delete s[e] : s[e] = o, a(s);
|
|
272
369
|
}, d = (e) => {
|
|
273
370
|
let t = { ...i };
|
|
274
371
|
delete t[e], a(t);
|
|
275
|
-
},
|
|
372
|
+
}, f = () => {
|
|
276
373
|
a({});
|
|
277
|
-
},
|
|
374
|
+
}, p = (e, t) => {
|
|
278
375
|
let n = { ...i }, r = n[e];
|
|
279
376
|
Array.isArray(r) ? t === void 0 ? delete n[e] : (n[e] = r.filter((e) => e !== t), Array.isArray(n[e]) && n[e].length === 0 && delete n[e]) : delete n[e], a(n);
|
|
280
|
-
},
|
|
377
|
+
}, m = E(() => {
|
|
281
378
|
let e = [];
|
|
282
379
|
return o.forEach((t) => {
|
|
283
380
|
t.filters.forEach((t) => {
|
|
@@ -290,14 +387,14 @@ function P({ searchQuery: e, onSearchChange: n, searchPlaceholder: r, filters: i
|
|
|
290
387
|
});
|
|
291
388
|
});
|
|
292
389
|
}), e;
|
|
293
|
-
}, [o]),
|
|
390
|
+
}, [o]), h = E(() => {
|
|
294
391
|
let e = {};
|
|
295
392
|
return o.forEach((t) => {
|
|
296
393
|
t.filters.forEach((t) => {
|
|
297
394
|
e[t.key] = t.badgeLabelKey ?? t.labelKey;
|
|
298
395
|
});
|
|
299
396
|
}), e;
|
|
300
|
-
}, [o]),
|
|
397
|
+
}, [o]), g = E(() => {
|
|
301
398
|
let e = {};
|
|
302
399
|
return o.forEach((t) => {
|
|
303
400
|
t.filters.forEach((t) => {
|
|
@@ -307,20 +404,20 @@ function P({ searchQuery: e, onSearchChange: n, searchPlaceholder: r, filters: i
|
|
|
307
404
|
});
|
|
308
405
|
}), e;
|
|
309
406
|
}, [o]);
|
|
310
|
-
return /* @__PURE__ */
|
|
407
|
+
return /* @__PURE__ */ k("div", {
|
|
311
408
|
className: "space-y-4 w-full",
|
|
312
|
-
children: [/* @__PURE__ */
|
|
409
|
+
children: [/* @__PURE__ */ k("div", {
|
|
313
410
|
className: "flex flex-wrap items-center gap-2 justify-between",
|
|
314
|
-
children: [/* @__PURE__ */
|
|
411
|
+
children: [/* @__PURE__ */ k("div", {
|
|
315
412
|
className: "flex flex-wrap items-center gap-2",
|
|
316
|
-
children: [n === void 0 ? null : /* @__PURE__ */
|
|
413
|
+
children: [n === void 0 ? null : /* @__PURE__ */ O(w, {
|
|
317
414
|
searchQuery: e,
|
|
318
415
|
onSearch: n,
|
|
319
416
|
onClear: () => {
|
|
320
417
|
n("");
|
|
321
418
|
},
|
|
322
419
|
placeholder: r ?? l("search.placeholder")
|
|
323
|
-
}),
|
|
420
|
+
}), m.map((e) => /* @__PURE__ */ O(b, {
|
|
324
421
|
variant: "pill",
|
|
325
422
|
labelKey: e.labelKey,
|
|
326
423
|
options: e.options,
|
|
@@ -340,21 +437,21 @@ function P({ searchQuery: e, onSearchChange: n, searchPlaceholder: r, filters: i
|
|
|
340
437
|
searchable: e.searchable,
|
|
341
438
|
searchPlaceholder: e.searchPlaceholder
|
|
342
439
|
}, e.key))]
|
|
343
|
-
}), o.length > 0 && /* @__PURE__ */
|
|
440
|
+
}), o.length > 0 && /* @__PURE__ */ O(z, {
|
|
344
441
|
sections: o,
|
|
345
442
|
filters: i,
|
|
346
443
|
onFiltersChange: a,
|
|
347
444
|
buttonText: s,
|
|
348
445
|
sheetTitle: c
|
|
349
446
|
})]
|
|
350
|
-
}), /* @__PURE__ */
|
|
447
|
+
}), /* @__PURE__ */ O(I, {
|
|
351
448
|
filters: i,
|
|
352
|
-
onRemoveFilter:
|
|
353
|
-
onClearAll:
|
|
354
|
-
filterLabelKeys:
|
|
355
|
-
optionLabels:
|
|
449
|
+
onRemoveFilter: p,
|
|
450
|
+
onClearAll: f,
|
|
451
|
+
filterLabelKeys: h,
|
|
452
|
+
optionLabels: g
|
|
356
453
|
})]
|
|
357
454
|
});
|
|
358
455
|
}
|
|
359
456
|
//#endregion
|
|
360
|
-
export {
|
|
457
|
+
export { I as ActiveFilters, z as AdvancedFilters, L as FilterField, U as FilterPills, H as FilterPillsGroup, G as FiltersContainer, W as FiltersMobileDrawer, K as TableFilter };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as e } from "../../../GenericForm-
|
|
1
|
+
import { t as e } from "../../../GenericForm-Dcn4Xecn.js";
|
|
2
2
|
export { e as GenericForm };
|
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
import { a as e, i as t, n, o as r, r as i, t as a } from "../../cards-
|
|
2
|
-
import { I as o } from "../../ui-
|
|
3
|
-
import { A as s, D as c, E as l, F as u, M as d, N as f, O as p, P as m, j as h, k as g } from "../../sheet-
|
|
4
|
-
import { a as _, c as v, i as y, n as b, o as x, r as S, s as C, t as w } from "../../charts-
|
|
5
|
-
import { t as T } from "../../ErrorAlert-
|
|
6
|
-
import { n as E, r as D, t as O } from "../../dialogs
|
|
7
|
-
import { t as k } from "../../ImageInput-
|
|
8
|
-
import { t as A } from "../../AppActions-
|
|
9
|
-
import { t as j } from "../../AppSubTitle-
|
|
10
|
-
import { t as M } from "../../MultiSelect-
|
|
11
|
-
import { t as N } from "../../GenericForm-
|
|
12
|
-
import { i as P, n as F, r as I, t as L } from "../../SearchInput-
|
|
13
|
-
import { ActiveFilters as R, AdvancedFilters as z, FilterField as B, FilterPills as V, FilterPillsGroup as H,
|
|
1
|
+
import { a as e, i as t, n, o as r, r as i, t as a } from "../../cards-pQZw-utJ.js";
|
|
2
|
+
import { I as o } from "../../ui-BwBUIl5y.js";
|
|
3
|
+
import { A as s, D as c, E as l, F as u, M as d, N as f, O as p, P as m, j as h, k as g } from "../../sheet-BjlRzLnc.js";
|
|
4
|
+
import { a as _, c as v, i as y, n as b, o as x, r as S, s as C, t as w } from "../../charts-Oxpbp_Ii.js";
|
|
5
|
+
import { t as T } from "../../ErrorAlert-D8XnPN0I.js";
|
|
6
|
+
import { n as E, r as D, t as O } from "../../dialogs-BLrrt68D.js";
|
|
7
|
+
import { t as k } from "../../ImageInput-BtV_Ezgp.js";
|
|
8
|
+
import { t as A } from "../../AppActions-BSFD13aV.js";
|
|
9
|
+
import { t as j } from "../../AppSubTitle-CVNe5WHv.js";
|
|
10
|
+
import { t as M } from "../../MultiSelect-DyHOoUsz.js";
|
|
11
|
+
import { t as N } from "../../GenericForm-Dcn4Xecn.js";
|
|
12
|
+
import { i as P, n as F, r as I, t as L } from "../../SearchInput-KPozEk_s.js";
|
|
13
|
+
import { ActiveFilters as R, AdvancedFilters as z, FilterField as B, FilterPills as V, FilterPillsGroup as H, FiltersContainer as U, FiltersMobileDrawer as W, TableFilter as G } from "./filters/index.js";
|
|
14
14
|
import "./forms/index.js";
|
|
15
|
-
import { n as
|
|
16
|
-
import { t as
|
|
17
|
-
import { t as
|
|
18
|
-
import { t as
|
|
19
|
-
import { n as
|
|
20
|
-
import { AppPageHeader as
|
|
21
|
-
import { a as
|
|
22
|
-
import { DataTable as
|
|
23
|
-
import { AppTabContainer as
|
|
24
|
-
import { t as
|
|
25
|
-
export { R as ActiveFilters, z as AdvancedFilters, A as AppActions, D as AppDialog,
|
|
15
|
+
import { n as K, t as q } from "../../icons-n0m_1w7z.js";
|
|
16
|
+
import { t as J } from "../../inputs-c7vMvV76.js";
|
|
17
|
+
import { t as Y } from "../../language-VKGAsAfF.js";
|
|
18
|
+
import { t as X } from "../../AppTitle-DIHE8uen.js";
|
|
19
|
+
import { n as Z, t as Q } from "../../states-C3v4BU7N.js";
|
|
20
|
+
import { AppPageHeader as $, KpiCardsLayout as ee } from "./layouts/index.js";
|
|
21
|
+
import { a as te, i as ne, n as re, o as ie, r as ae, t as oe } from "../../navbar-C4WWdADW.js";
|
|
22
|
+
import { DataTable as se, JsonTableOutput as ce, TableActions as le, TableBody as ue, TableBulkActions as de, TableHeader as fe, TablePagination as pe, TableSettings as me } from "./table/index.js";
|
|
23
|
+
import { AppTabContainer as he, AppTabHeader as ge, AppTabs as _e, AppVerticalTabs as ve } from "./tabs/index.js";
|
|
24
|
+
import { t as ye } from "../../theme-Bkamu5J6.js";
|
|
25
|
+
export { R as ActiveFilters, z as AdvancedFilters, A as AppActions, D as AppDialog, $ as AppPageHeader, j as AppSubTitle, he as AppTabContainer, ge as AppTabHeader, _e as AppTabs, X as AppTitle, ve as AppVerticalTabs, v as BarChartHorizontal, C as BarChartVertical, _ as CHART_COLORS, y as ChartCard, S as CircularGauge, O as ConfirmationDialog, r as DashboardCard, se as DataTable, P as DatePicker, I as DateRangePicker, l as Dialog, c as DialogClose, p as DialogContent, g as DialogDescription, s as DialogFooter, h as DialogHeader, d as DialogOverlay, f as DialogPortal, m as DialogTitle, u as DialogTrigger, T as ErrorAlert, Z as ErrorState, B as FilterField, V as FilterPills, H as FilterPillsGroup, U as FiltersContainer, W as FiltersMobileDrawer, K as FlagFrIcon, q as FlagGbIcon, E as FormDialog, N as GenericForm, ie as GlobalSearch, k as ImageInput, ce as JsonTableOutput, e as KpiCard, t as KpiCards, ee as KpiCardsLayout, Y as LanguageSelector, b as LineChart, Q as LoadingState, i as MetricCard, M as MultiSelect, te as NotificationsBell, w as PieChart, o as Progress, J as RatingInput, L as SearchInput, ae as Sidebar, re as SidebarHeader, ne as SidebarNavItem, F as SingleSelect, n as SkeletonCard, a as SkeletonCards, le as TableActions, ue as TableBody, de as TableBulkActions, G as TableFilter, fe as TableHeader, pe as TablePagination, me as TableSettings, ye as ThemeSelector, oe as Topbar, x as getChartColor };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { t as e } from "../../../ImageInput-
|
|
2
|
-
import { t } from "../../../MultiSelect-
|
|
3
|
-
import { i as n, n as r, r as i, t as a } from "../../../SearchInput-
|
|
4
|
-
import { t as o } from "../../../inputs-
|
|
1
|
+
import { t as e } from "../../../ImageInput-BtV_Ezgp.js";
|
|
2
|
+
import { t } from "../../../MultiSelect-DyHOoUsz.js";
|
|
3
|
+
import { i as n, n as r, r as i, t as a } from "../../../SearchInput-KPozEk_s.js";
|
|
4
|
+
import { t as o } from "../../../inputs-c7vMvV76.js";
|
|
5
5
|
export { n as DatePicker, i as DateRangePicker, e as ImageInput, t as MultiSelect, o as RatingInput, a as SearchInput, r as SingleSelect };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as e } from "../../../language-
|
|
1
|
+
import { t as e } from "../../../language-VKGAsAfF.js";
|
|
2
2
|
export { e as LanguageSelector };
|