@krosoft/react 0.0.373 → 0.0.374
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-DwzK-4t7.js → AppActions-ooZhFY4I.js} +1 -1
- package/dist/{AppMarkdown-ZT7xBtTk.js → AppMarkdown-DR9Xzort.js} +1 -1
- package/dist/{AppSubTitle-Bf9rFryk.js → AppSubTitle-RDgLo82r.js} +2 -2
- package/dist/{AppTitle-CQgw2Ody.js → AppTitle-HcuNVulh.js} +1 -1
- package/dist/{ErrorAlert-BYy61fcZ.js → ErrorAlert-Cyqycy2z.js} +1 -1
- package/dist/{GenericForm-C-vJXpaF.js → GenericForm-DrFyl2wt.js} +5 -5
- package/dist/{ImageInput-BDTQi0U9.js → ImageInput-Br8DQPTc.js} +1 -1
- package/dist/{MultiSelect-60rgAOBX.js → MultiSelect-Bht0L5il.js} +2 -2
- package/dist/SearchInput-VVu1aIU4.js +36 -0
- package/dist/{SearchInput-CqU6crOu.js → SingleSelect-8V30LYCi.js} +107 -134
- package/dist/{behavior-DRGttGb4.js → behavior-DUMKzliu.js} +1 -1
- package/dist/{cards-Bwm6Scwc.js → cards-s1HOBgc6.js} +1 -1
- package/dist/changelog-m-U0JTTM.js +139 -0
- package/dist/{charts-hsygNEkd.js → charts-DH_x5yPB.js} +1 -1
- package/dist/components/core/cards/index.js +1 -1
- package/dist/components/core/changelog/AppChangelog.d.ts +3 -1
- package/dist/components/core/changelog/AppChangelog.d.ts.map +1 -1
- package/dist/components/core/changelog/index.js +1 -1
- package/dist/components/core/charts/index.js +1 -1
- package/dist/components/core/dialogs/index.js +2 -2
- package/dist/components/core/filters/index.js +20 -19
- package/dist/components/core/forms/index.js +1 -1
- package/dist/components/core/index.js +21 -20
- package/dist/components/core/inputs/index.js +6 -5
- package/dist/components/core/language/index.js +1 -1
- package/dist/components/core/layouts/index.js +7 -7
- package/dist/components/core/markdown/index.js +1 -1
- 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 +4 -4
- package/dist/components/core/theme/index.js +1 -1
- package/dist/components/index.js +21 -20
- package/dist/components/ui/index.js +1 -1
- package/dist/{dialogs-0PwhK6c1.js → dialogs-BGwVb_uW.js} +4 -4
- package/dist/helpers/changelog.helper.d.ts +5 -0
- package/dist/helpers/changelog.helper.d.ts.map +1 -1
- package/dist/helpers/index.js +50 -15
- package/dist/hooks/behavior/index.js +1 -1
- package/dist/hooks/index.js +4 -4
- package/dist/hooks/ui/index.js +3 -3
- package/dist/i18n/index.js +1 -1
- package/dist/i18n/krosoftLocales.d.ts +4 -0
- package/dist/i18n/krosoftLocales.d.ts.map +1 -1
- package/dist/{i18n-CytpX2hK.js → i18n-Cpw8DZt1.js} +6 -2
- package/dist/{inputs-D-ZCdo5D.js → inputs-ClkjpjY4.js} +1 -1
- package/dist/{language-Du46nzYN.js → language-Bb_6jQEn.js} +2 -2
- package/dist/{navbar-j2_a1yrA.js → navbar-CBtXvlA_.js} +3 -3
- package/dist/pwa/index.js +1 -1
- package/dist/seasonal/index.js +1 -1
- package/dist/{sheet-AgDmjyf2.js → sheet-DOU2o0gO.js} +1 -1
- package/dist/{states-BVEFGM99.js → states-CuRWHlch.js} +1 -1
- package/dist/{theme-CVY1Dh3F.js → theme-DsMX9lZ7.js} +2 -2
- package/dist/{useDocumentTitle-DYRVJ5wt.js → useDocumentTitle-BX7aZKoT.js} +1 -1
- package/dist/{useLanguage-CJM24_Ab.js → useLanguage-BigJQQLb.js} +1 -1
- package/dist/{useTheme-C5PI6ifZ.js → useTheme-C_AhwSy3.js} +1 -1
- package/package.json +1 -1
- package/dist/changelog-DA5nb3BI.js +0 -126
- package/dist/changelog.helper-BjCKlB0M.js +0 -31
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as e } from "./tailwind.helper-CJaRYBmL.js";
|
|
2
|
-
import { t } from "./i18n-
|
|
2
|
+
import { t } from "./i18n-Cpw8DZt1.js";
|
|
3
3
|
import { Nt as n, Rt as r, Ut as i, jt as a, kt as o } from "./ui-Fxy95kSJ.js";
|
|
4
4
|
import { c as s } from "./tooltip-_geGvbS7.js";
|
|
5
5
|
import { t as c } from "./useMobile-pTQ8lWvt.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as e } from "./tailwind.helper-CJaRYBmL.js";
|
|
2
2
|
import { t } from "./markdown.helper-YJE2H5KQ.js";
|
|
3
|
-
import { t as n } from "./i18n-
|
|
3
|
+
import { t as n } from "./i18n-Cpw8DZt1.js";
|
|
4
4
|
import { t as r } from "./useNotifications-CyhTruIG.js";
|
|
5
5
|
import { useEffect as i } from "react";
|
|
6
6
|
import { jsx as a, jsxs as o } from "react/jsx-runtime";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { t as e } from "./i18n-
|
|
2
|
-
import { t } from "./AppActions-
|
|
1
|
+
import { t as e } from "./i18n-Cpw8DZt1.js";
|
|
2
|
+
import { t } from "./AppActions-ooZhFY4I.js";
|
|
3
3
|
import { jsx as n, jsxs as r } from "react/jsx-runtime";
|
|
4
4
|
//#region src/components/core/layouts/AppSubTitle.tsx
|
|
5
5
|
function i({ titleKey: i, actions: a, className: o }) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as e } from "./tailwind.helper-CJaRYBmL.js";
|
|
2
|
-
import { t } from "./i18n-
|
|
2
|
+
import { t } from "./i18n-Cpw8DZt1.js";
|
|
3
3
|
import { jsx as n, jsxs as r } from "react/jsx-runtime";
|
|
4
4
|
//#region src/components/core/layouts/AppTitle.tsx
|
|
5
5
|
function i({ titleKey: i, descriptionKey: a, isSubTitle: o, inline: s }) {
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { t as e } from "./tailwind.helper-CJaRYBmL.js";
|
|
2
2
|
import { c as t, d as n, s as r } from "./chart-wW-fwL3s.js";
|
|
3
|
-
import { t as i } from "./i18n-
|
|
3
|
+
import { t as i } from "./i18n-Cpw8DZt1.js";
|
|
4
4
|
import { Dt as a, Et as o, St as s, Tt as c, p as l, vn as u, wt as d, xt as f } from "./ui-Fxy95kSJ.js";
|
|
5
5
|
import { c as p } from "./tooltip-_geGvbS7.js";
|
|
6
|
-
import { g as m } from "./sheet-
|
|
6
|
+
import { g as m } from "./sheet-DOU2o0gO.js";
|
|
7
7
|
import { i as h, l as g, n as _, t as ee, u as v } from "./select-KWMg2_7Z.js";
|
|
8
8
|
import { n as y } from "./useToast-UeDRLovh.js";
|
|
9
|
-
import { t as b } from "./ImageInput-
|
|
10
|
-
import { t as x } from "./AppSubTitle-
|
|
11
|
-
import { t as S } from "./MultiSelect-
|
|
9
|
+
import { t as b } from "./ImageInput-Br8DQPTc.js";
|
|
10
|
+
import { t as x } from "./AppSubTitle-RDgLo82r.js";
|
|
11
|
+
import { t as S } from "./MultiSelect-Bht0L5il.js";
|
|
12
12
|
import { useEffect as C, useRef as w, useState as T } from "react";
|
|
13
13
|
import { jsx as E, jsxs as D } from "react/jsx-runtime";
|
|
14
14
|
import { useForm as O } from "react-hook-form";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as e } from "./tailwind.helper-CJaRYBmL.js";
|
|
2
|
-
import { t } from "./i18n-
|
|
2
|
+
import { t } from "./i18n-Cpw8DZt1.js";
|
|
3
3
|
import { c as n } from "./tooltip-_geGvbS7.js";
|
|
4
4
|
import { t as r } from "./useNotifications-CyhTruIG.js";
|
|
5
5
|
import { forwardRef as i, useRef as a, useState as o } from "react";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { t as e } from "./tailwind.helper-CJaRYBmL.js";
|
|
2
|
-
import { t } from "./i18n-
|
|
2
|
+
import { t } from "./i18n-Cpw8DZt1.js";
|
|
3
3
|
import { Mn as n, vn as r } from "./ui-Fxy95kSJ.js";
|
|
4
4
|
import { a as i, o as a, s as o } from "./tooltip-_geGvbS7.js";
|
|
5
|
-
import { h as s, m as c, p as l } from "./sheet-
|
|
5
|
+
import { h as s, m as c, p as l } from "./sheet-DOU2o0gO.js";
|
|
6
6
|
import { useCallback as u, useLayoutEffect as d, useMemo as f, useRef as p, useState as m } from "react";
|
|
7
7
|
import { Fragment as h, jsx as g, jsxs as _ } from "react/jsx-runtime";
|
|
8
8
|
import { ChevronDownIcon as v, SearchIcon as y, XIcon as b } from "lucide-react";
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { t as e } from "./tailwind.helper-CJaRYBmL.js";
|
|
2
|
+
import { t } from "./i18n-Cpw8DZt1.js";
|
|
3
|
+
import { g as n } from "./sheet-DOU2o0gO.js";
|
|
4
|
+
import { jsx as r, jsxs as i } from "react/jsx-runtime";
|
|
5
|
+
import { SearchIcon as a, XIcon as o } from "lucide-react";
|
|
6
|
+
//#region src/components/core/inputs/SearchInput.tsx
|
|
7
|
+
var s = ({ searchQuery: s, search: c, placeholder: l, onSearch: u, onSubmit: d, onClear: f, className: p }) => {
|
|
8
|
+
let { t: m } = t(), h = s ?? c ?? "";
|
|
9
|
+
return /* @__PURE__ */ i("div", {
|
|
10
|
+
className: e("relative h-fit w-full md:w-64", p),
|
|
11
|
+
children: [
|
|
12
|
+
/* @__PURE__ */ r(a, { className: "absolute left-3 top-1/2 transform -translate-y-1/2 text-muted-foreground w-4 h-4" }),
|
|
13
|
+
/* @__PURE__ */ r(n, {
|
|
14
|
+
placeholder: l ?? m("search.placeholder"),
|
|
15
|
+
value: h,
|
|
16
|
+
onChange: (e) => {
|
|
17
|
+
u(e.target.value);
|
|
18
|
+
},
|
|
19
|
+
className: "pl-8",
|
|
20
|
+
onKeyDown: (e) => {
|
|
21
|
+
e.key === "Enter" && d !== void 0 && (e.preventDefault(), d());
|
|
22
|
+
}
|
|
23
|
+
}),
|
|
24
|
+
h === "" ? null : /* @__PURE__ */ r("button", {
|
|
25
|
+
onClick: () => {
|
|
26
|
+
u(""), f !== void 0 && f();
|
|
27
|
+
},
|
|
28
|
+
className: "absolute right-3 top-1/2 -translate-y-1/2 text-gray-500 hover:text-gray-700",
|
|
29
|
+
type: "button",
|
|
30
|
+
children: /* @__PURE__ */ r(o, { className: "size-4" })
|
|
31
|
+
})
|
|
32
|
+
]
|
|
33
|
+
});
|
|
34
|
+
};
|
|
35
|
+
//#endregion
|
|
36
|
+
export { s as t };
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import { t as e } from "./tailwind.helper-CJaRYBmL.js";
|
|
2
|
-
import { r as t, t as n } from "./i18n-
|
|
2
|
+
import { r as t, t as n } from "./i18n-Cpw8DZt1.js";
|
|
3
3
|
import { wn as r } from "./ui-Fxy95kSJ.js";
|
|
4
4
|
import { c as i, o as a, s as o } from "./tooltip-_geGvbS7.js";
|
|
5
|
-
import {
|
|
6
|
-
import { i as
|
|
7
|
-
import { n as
|
|
8
|
-
import * as
|
|
9
|
-
import { useEffect as
|
|
10
|
-
import { jsx as
|
|
11
|
-
import { CalendarIcon as
|
|
12
|
-
import { Command as
|
|
13
|
-
import { format as
|
|
5
|
+
import { h as s, m as c, p as l } from "./sheet-DOU2o0gO.js";
|
|
6
|
+
import { i as u, l as d, n as f, t as p, u as m } from "./select-KWMg2_7Z.js";
|
|
7
|
+
import { n as h, r as g } from "./MultiSelect-Bht0L5il.js";
|
|
8
|
+
import * as _ from "react";
|
|
9
|
+
import { useEffect as v, useMemo as y, useRef as b, useState as x } from "react";
|
|
10
|
+
import { jsx as S, jsxs as C } from "react/jsx-runtime";
|
|
11
|
+
import { CalendarIcon as w, CheckIcon as T, ChevronDownIcon as ee, PlusIcon as te, SearchIcon as E, XIcon as D } from "lucide-react";
|
|
12
|
+
import { Command as O } from "cmdk";
|
|
13
|
+
import { format as k } from "date-fns";
|
|
14
14
|
//#region src/components/core/inputs/DatePicker.tsx
|
|
15
|
-
var
|
|
16
|
-
let s = t(), [c, l] =
|
|
17
|
-
return
|
|
15
|
+
var A = ({ date: n, onDateChange: a, placeholder: o }) => {
|
|
16
|
+
let s = t(), [c, l] = x(!1), u = b(null);
|
|
17
|
+
return v(() => {
|
|
18
18
|
if (!c) return;
|
|
19
19
|
let e = (e) => {
|
|
20
20
|
u.current !== null && !u.current.contains(e.target) && l(!1);
|
|
@@ -22,20 +22,20 @@ var M = ({ date: n, onDateChange: a, placeholder: o }) => {
|
|
|
22
22
|
return document.addEventListener("mousedown", e), () => {
|
|
23
23
|
document.removeEventListener("mousedown", e);
|
|
24
24
|
};
|
|
25
|
-
}, [c]), /* @__PURE__ */
|
|
25
|
+
}, [c]), /* @__PURE__ */ C("div", {
|
|
26
26
|
ref: u,
|
|
27
27
|
className: "relative w-full",
|
|
28
|
-
children: [/* @__PURE__ */
|
|
28
|
+
children: [/* @__PURE__ */ C(i, {
|
|
29
29
|
variant: "outline",
|
|
30
30
|
type: "button",
|
|
31
31
|
onClick: () => {
|
|
32
32
|
l((e) => !e);
|
|
33
33
|
},
|
|
34
34
|
className: e("w-full justify-start text-left font-normal focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2", c && "ring-2 ring-ring ring-offset-2", n === void 0 && "text-muted-foreground"),
|
|
35
|
-
children: [/* @__PURE__ */
|
|
36
|
-
}), c ? /* @__PURE__ */
|
|
35
|
+
children: [/* @__PURE__ */ S(w, { className: "mr-2 size-4 shrink-0" }), n === void 0 ? /* @__PURE__ */ S("span", { children: o }) : k(n, "dd/MM/yyyy", { locale: s })]
|
|
36
|
+
}), c ? /* @__PURE__ */ S("div", {
|
|
37
37
|
className: "absolute left-0 top-[calc(100%+4px)] z-[100] rounded-surface border bg-popover text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 slide-in-from-top-2",
|
|
38
|
-
children: /* @__PURE__ */
|
|
38
|
+
children: /* @__PURE__ */ S(r, {
|
|
39
39
|
mode: "single",
|
|
40
40
|
locale: s,
|
|
41
41
|
defaultMonth: n,
|
|
@@ -46,28 +46,28 @@ var M = ({ date: n, onDateChange: a, placeholder: o }) => {
|
|
|
46
46
|
})
|
|
47
47
|
}) : null]
|
|
48
48
|
});
|
|
49
|
-
},
|
|
49
|
+
}, j = (e) => e ? {
|
|
50
50
|
from: e.from,
|
|
51
51
|
to: e.to
|
|
52
|
-
} : void 0,
|
|
53
|
-
let { t: f } = n(), p = t(), [m, h] =
|
|
54
|
-
return
|
|
55
|
-
m &&
|
|
56
|
-
}, [m, a]), /* @__PURE__ */
|
|
52
|
+
} : void 0, M = ({ value: a, onChange: o, placeholder: u, className: d }) => {
|
|
53
|
+
let { t: f } = n(), p = t(), [m, h] = _.useState(!1), [g, v] = _.useState(j(a));
|
|
54
|
+
return _.useEffect(() => {
|
|
55
|
+
m && v(j(a));
|
|
56
|
+
}, [m, a]), /* @__PURE__ */ S("div", {
|
|
57
57
|
className: e("grid gap-2", d),
|
|
58
|
-
children: /* @__PURE__ */
|
|
58
|
+
children: /* @__PURE__ */ C(l, {
|
|
59
59
|
open: m,
|
|
60
60
|
onOpenChange: h,
|
|
61
|
-
children: [/* @__PURE__ */
|
|
61
|
+
children: [/* @__PURE__ */ S(s, {
|
|
62
62
|
asChild: !0,
|
|
63
|
-
children: /* @__PURE__ */
|
|
63
|
+
children: /* @__PURE__ */ C(i, {
|
|
64
64
|
id: "date",
|
|
65
65
|
variant: "outline",
|
|
66
66
|
className: e("w-[300px] justify-start text-left font-normal", !a?.from && "text-muted-foreground"),
|
|
67
67
|
children: [
|
|
68
|
-
/* @__PURE__ */
|
|
69
|
-
((e) => e?.from ? !e.to || e.from.getTime() === e.to.getTime() ?
|
|
70
|
-
a?.from && /* @__PURE__ */
|
|
68
|
+
/* @__PURE__ */ S(w, { className: "mr-2 size-4" }),
|
|
69
|
+
((e) => e?.from ? !e.to || e.from.getTime() === e.to.getTime() ? k(e.from, "dd MMM yyyy", { locale: p }) : `${k(e.from, "dd MMM yyyy", { locale: p })} - ${k(e.to, "dd MMM yyyy", { locale: p })}` : u ?? f("date.pickPeriod"))(a),
|
|
70
|
+
a?.from && /* @__PURE__ */ S(i, {
|
|
71
71
|
type: "button",
|
|
72
72
|
variant: "ghost",
|
|
73
73
|
size: "icon",
|
|
@@ -76,43 +76,43 @@ var M = ({ date: n, onDateChange: a, placeholder: o }) => {
|
|
|
76
76
|
onClick: (e) => {
|
|
77
77
|
e.stopPropagation(), o(void 0), h(!1);
|
|
78
78
|
},
|
|
79
|
-
children: /* @__PURE__ */
|
|
79
|
+
children: /* @__PURE__ */ S(D, { className: "size-4" })
|
|
80
80
|
})
|
|
81
81
|
]
|
|
82
82
|
})
|
|
83
|
-
}), /* @__PURE__ */
|
|
83
|
+
}), /* @__PURE__ */ C(c, {
|
|
84
84
|
className: "w-auto p-0",
|
|
85
85
|
align: "start",
|
|
86
86
|
side: "bottom",
|
|
87
87
|
sideOffset: 4,
|
|
88
|
-
children: [/* @__PURE__ */
|
|
88
|
+
children: [/* @__PURE__ */ S(r, {
|
|
89
89
|
mode: "range",
|
|
90
90
|
resetOnSelect: !0,
|
|
91
91
|
defaultMonth: g?.from,
|
|
92
92
|
selected: g,
|
|
93
|
-
onSelect:
|
|
93
|
+
onSelect: v,
|
|
94
94
|
numberOfMonths: 2,
|
|
95
95
|
locale: p,
|
|
96
96
|
className: "pointer-events-auto p-3"
|
|
97
|
-
}), /* @__PURE__ */
|
|
97
|
+
}), /* @__PURE__ */ C("div", {
|
|
98
98
|
className: "flex items-center justify-between border-t border-border px-3 py-2",
|
|
99
|
-
children: [/* @__PURE__ */
|
|
99
|
+
children: [/* @__PURE__ */ S(i, {
|
|
100
100
|
variant: "ghost",
|
|
101
101
|
size: "sm",
|
|
102
102
|
onClick: () => {
|
|
103
|
-
|
|
103
|
+
v(void 0);
|
|
104
104
|
},
|
|
105
105
|
children: f("actions.clear")
|
|
106
|
-
}), /* @__PURE__ */
|
|
106
|
+
}), /* @__PURE__ */ C("div", {
|
|
107
107
|
className: "flex gap-2",
|
|
108
|
-
children: [/* @__PURE__ */
|
|
108
|
+
children: [/* @__PURE__ */ S(i, {
|
|
109
109
|
variant: "ghost",
|
|
110
110
|
size: "sm",
|
|
111
111
|
onClick: () => {
|
|
112
|
-
|
|
112
|
+
v(j(a)), h(!1);
|
|
113
113
|
},
|
|
114
114
|
children: f("actions.cancel")
|
|
115
|
-
}), /* @__PURE__ */
|
|
115
|
+
}), /* @__PURE__ */ S(i, {
|
|
116
116
|
size: "sm",
|
|
117
117
|
onClick: () => {
|
|
118
118
|
o(g), h(!1);
|
|
@@ -124,40 +124,40 @@ var M = ({ date: n, onDateChange: a, placeholder: o }) => {
|
|
|
124
124
|
})]
|
|
125
125
|
})
|
|
126
126
|
});
|
|
127
|
-
},
|
|
128
|
-
let { t:
|
|
129
|
-
|
|
127
|
+
}, N = ({ options: t = [], value: r, onChange: i, onClear: _, searchable: v = !1, onCreate: b, placeholder: w, searchPlaceholder: k, emptyLabel: A, createLabel: j, disabled: M = !1, modal: N = !0, variant: P = "input", className: F, ...I }) => {
|
|
128
|
+
let { t: L } = n(), [R, z] = x(!1), [B, V] = x(""), H = P === "filter" ? a : void 0, U = r !== void 0 && r !== "", W = y(() => U ? t.find((e) => e.value === r) : void 0, [
|
|
129
|
+
U,
|
|
130
130
|
t,
|
|
131
131
|
r
|
|
132
|
-
]),
|
|
132
|
+
]), G = U ? W?.label ?? r : void 0, K = B.trim(), q = y(() => {
|
|
133
133
|
if (K === "") return t;
|
|
134
134
|
let e = K.toLowerCase();
|
|
135
135
|
return t.filter((t) => `${t.label} ${t.description ?? ""}`.toLowerCase().includes(e));
|
|
136
|
-
}, [t, K]), { listRef: ne, virtualized: J, startIndex: re, endIndex: ie, padTop: Y, padBottom: X, onScroll: ae, resetScroll: Z } =
|
|
137
|
-
if (!v) return /* @__PURE__ */
|
|
136
|
+
}, [t, K]), { listRef: ne, virtualized: J, startIndex: re, endIndex: ie, padTop: Y, padBottom: X, onScroll: ae, resetScroll: Z } = g(R, q.length, t.some((e) => e.imageUrl !== void 0)), oe = J ? q.slice(re, ie) : q;
|
|
137
|
+
if (!v) return /* @__PURE__ */ C(p, {
|
|
138
138
|
value: r ?? "",
|
|
139
139
|
onValueChange: i,
|
|
140
|
-
disabled:
|
|
141
|
-
children: [/* @__PURE__ */
|
|
142
|
-
...
|
|
143
|
-
className: e(!
|
|
144
|
-
onClear:
|
|
145
|
-
e.preventDefault(), e.stopPropagation(),
|
|
140
|
+
disabled: M,
|
|
141
|
+
children: [/* @__PURE__ */ S(d, {
|
|
142
|
+
...I,
|
|
143
|
+
className: e(!U && "text-muted-foreground", H, F),
|
|
144
|
+
onClear: _ !== void 0 && U && !M ? (e) => {
|
|
145
|
+
e.preventDefault(), e.stopPropagation(), _();
|
|
146
146
|
} : void 0,
|
|
147
|
-
children: /* @__PURE__ */
|
|
148
|
-
}), /* @__PURE__ */
|
|
147
|
+
children: /* @__PURE__ */ S(m, { placeholder: w ?? L("select.placeholder") })
|
|
148
|
+
}), /* @__PURE__ */ S(f, { children: t.map((e) => /* @__PURE__ */ S(u, {
|
|
149
149
|
value: e.value,
|
|
150
150
|
disabled: e.disabled,
|
|
151
|
-
children: /* @__PURE__ */
|
|
151
|
+
children: /* @__PURE__ */ C("span", {
|
|
152
152
|
className: "flex items-center",
|
|
153
153
|
children: [
|
|
154
|
-
|
|
155
|
-
e.color !== void 0 && /* @__PURE__ */
|
|
154
|
+
h(e.imageUrl, "mr-2"),
|
|
155
|
+
e.color !== void 0 && /* @__PURE__ */ S("span", {
|
|
156
156
|
className: "mr-2 size-2.5 shrink-0 rounded-full",
|
|
157
157
|
style: { backgroundColor: e.color }
|
|
158
158
|
}),
|
|
159
159
|
e.label,
|
|
160
|
-
e.description !== void 0 && /* @__PURE__ */
|
|
160
|
+
e.description !== void 0 && /* @__PURE__ */ C("span", {
|
|
161
161
|
className: "ml-1 text-muted-foreground",
|
|
162
162
|
children: [
|
|
163
163
|
"(",
|
|
@@ -169,97 +169,97 @@ var M = ({ date: n, onDateChange: a, placeholder: o }) => {
|
|
|
169
169
|
})
|
|
170
170
|
}, e.value)) })]
|
|
171
171
|
});
|
|
172
|
-
let Q =
|
|
173
|
-
|
|
172
|
+
let Q = b !== void 0 && K !== "" && !t.some((e) => e.label.toLowerCase() === K.toLowerCase()), $ = (e) => {
|
|
173
|
+
z(e), e ? Z() : V("");
|
|
174
174
|
}, se = (e) => {
|
|
175
|
-
|
|
175
|
+
V(e), Z();
|
|
176
176
|
}, ce = (e) => {
|
|
177
177
|
i(e), $(!1);
|
|
178
178
|
}, le = () => {
|
|
179
|
-
|
|
179
|
+
b?.(K), $(!1);
|
|
180
180
|
};
|
|
181
|
-
return /* @__PURE__ */
|
|
182
|
-
open:
|
|
181
|
+
return /* @__PURE__ */ C(l, {
|
|
182
|
+
open: R,
|
|
183
183
|
onOpenChange: $,
|
|
184
|
-
modal:
|
|
185
|
-
children: [/* @__PURE__ */
|
|
184
|
+
modal: N,
|
|
185
|
+
children: [/* @__PURE__ */ S(s, {
|
|
186
186
|
asChild: !0,
|
|
187
|
-
children: /* @__PURE__ */
|
|
188
|
-
...
|
|
187
|
+
children: /* @__PURE__ */ C("button", {
|
|
188
|
+
...I,
|
|
189
189
|
type: "button",
|
|
190
190
|
role: "combobox",
|
|
191
|
-
"aria-expanded":
|
|
192
|
-
disabled:
|
|
193
|
-
className: e(o, "w-full",
|
|
194
|
-
children: [/* @__PURE__ */
|
|
191
|
+
"aria-expanded": R,
|
|
192
|
+
disabled: M,
|
|
193
|
+
className: e(o, "w-full", H, "data-[state=open]:ring-2 data-[state=open]:ring-ring data-[state=open]:ring-offset-2", !U && "text-muted-foreground", F),
|
|
194
|
+
children: [/* @__PURE__ */ C("div", {
|
|
195
195
|
className: "flex min-w-0 items-center truncate",
|
|
196
196
|
children: [
|
|
197
|
-
|
|
198
|
-
|
|
197
|
+
h(W?.imageUrl, "mr-2 h-6 w-8"),
|
|
198
|
+
W?.color && /* @__PURE__ */ S("span", {
|
|
199
199
|
className: "mr-2 size-2.5 shrink-0 rounded-full",
|
|
200
|
-
style: { backgroundColor:
|
|
200
|
+
style: { backgroundColor: W.color }
|
|
201
201
|
}),
|
|
202
|
-
/* @__PURE__ */
|
|
202
|
+
/* @__PURE__ */ S("span", {
|
|
203
203
|
className: "truncate",
|
|
204
|
-
children:
|
|
204
|
+
children: G ?? w ?? L("select.placeholder")
|
|
205
205
|
}),
|
|
206
|
-
|
|
206
|
+
W?.description !== void 0 && /* @__PURE__ */ C("span", {
|
|
207
207
|
className: "ml-1 truncate text-muted-foreground",
|
|
208
208
|
children: [
|
|
209
209
|
"(",
|
|
210
|
-
|
|
210
|
+
W.description,
|
|
211
211
|
")"
|
|
212
212
|
]
|
|
213
213
|
})
|
|
214
214
|
]
|
|
215
|
-
}), /* @__PURE__ */
|
|
215
|
+
}), /* @__PURE__ */ C("div", {
|
|
216
216
|
className: "flex items-center gap-1",
|
|
217
|
-
children: [
|
|
217
|
+
children: [_ && U && !M && /* @__PURE__ */ S("span", {
|
|
218
218
|
role: "button",
|
|
219
219
|
tabIndex: -1,
|
|
220
220
|
onClick: (e) => {
|
|
221
221
|
e.stopPropagation();
|
|
222
222
|
},
|
|
223
223
|
onPointerDown: (e) => {
|
|
224
|
-
e.preventDefault(), e.stopPropagation(),
|
|
224
|
+
e.preventDefault(), e.stopPropagation(), _();
|
|
225
225
|
},
|
|
226
226
|
className: "text-muted-foreground hover:text-foreground",
|
|
227
|
-
children: /* @__PURE__ */
|
|
228
|
-
}), /* @__PURE__ */
|
|
227
|
+
children: /* @__PURE__ */ S(D, { className: "size-4" })
|
|
228
|
+
}), /* @__PURE__ */ S(ee, { className: e("size-4 shrink-0 opacity-50 transition-transform", R && "rotate-180") })]
|
|
229
229
|
})]
|
|
230
230
|
})
|
|
231
|
-
}), /* @__PURE__ */
|
|
231
|
+
}), /* @__PURE__ */ S(c, {
|
|
232
232
|
className: "w-[var(--radix-popover-trigger-width)] p-0",
|
|
233
233
|
align: "start",
|
|
234
|
-
children: /* @__PURE__ */
|
|
234
|
+
children: /* @__PURE__ */ C(O, {
|
|
235
235
|
shouldFilter: !1,
|
|
236
236
|
className: "flex flex-col",
|
|
237
|
-
children: [/* @__PURE__ */
|
|
237
|
+
children: [/* @__PURE__ */ S("div", {
|
|
238
238
|
className: "border-b border-border p-2",
|
|
239
|
-
children: /* @__PURE__ */
|
|
239
|
+
children: /* @__PURE__ */ C("div", {
|
|
240
240
|
className: "relative",
|
|
241
|
-
children: [/* @__PURE__ */
|
|
242
|
-
value:
|
|
241
|
+
children: [/* @__PURE__ */ S(E, { className: "absolute left-2 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-muted-foreground" }), /* @__PURE__ */ S(O.Input, {
|
|
242
|
+
value: B,
|
|
243
243
|
onValueChange: se,
|
|
244
|
-
placeholder:
|
|
244
|
+
placeholder: k ?? L("search.placeholder"),
|
|
245
245
|
className: "w-full rounded-control bg-muted/50 py-1.5 pl-7 pr-2 text-sm text-foreground placeholder:text-muted-foreground outline-none focus:ring-1 focus:ring-ring",
|
|
246
246
|
autoFocus: !0
|
|
247
247
|
})]
|
|
248
248
|
})
|
|
249
|
-
}), /* @__PURE__ */
|
|
249
|
+
}), /* @__PURE__ */ C(O.List, {
|
|
250
250
|
ref: ne,
|
|
251
251
|
onScroll: ae,
|
|
252
252
|
className: e("flex flex-col max-h-56 overflow-y-auto overflow-x-hidden p-1.5 scrollbar-thin scrollbar-thumb-rounded scrollbar-thumb-muted-foreground/20 scrollbar-track-transparent [&::-webkit-scrollbar]:w-1.5 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-thumb]:bg-muted-foreground/20 [&::-webkit-scrollbar-track]:bg-transparent", !J && "gap-0.5"),
|
|
253
253
|
children: [
|
|
254
|
-
q.length === 0 && !Q && /* @__PURE__ */
|
|
254
|
+
q.length === 0 && !Q && /* @__PURE__ */ S("div", {
|
|
255
255
|
className: "px-2 py-3 text-center text-xs text-muted-foreground",
|
|
256
|
-
children:
|
|
256
|
+
children: A ?? L("states.noResult")
|
|
257
257
|
}),
|
|
258
|
-
Y > 0 && /* @__PURE__ */
|
|
258
|
+
Y > 0 && /* @__PURE__ */ S("div", {
|
|
259
259
|
"aria-hidden": !0,
|
|
260
260
|
style: { height: Y }
|
|
261
261
|
}),
|
|
262
|
-
oe.map((t) => /* @__PURE__ */
|
|
262
|
+
oe.map((t) => /* @__PURE__ */ C(O.Item, {
|
|
263
263
|
value: t.value,
|
|
264
264
|
keywords: [t.label, t.description ?? ""],
|
|
265
265
|
disabled: t.disabled,
|
|
@@ -268,17 +268,17 @@ var M = ({ date: n, onDateChange: a, placeholder: o }) => {
|
|
|
268
268
|
},
|
|
269
269
|
className: "flex min-w-0 items-center gap-2 rounded-md px-2 py-2 text-sm cursor-pointer transition-colors data-[selected=true]:bg-muted data-[disabled=true]:cursor-not-allowed data-[disabled=true]:opacity-50",
|
|
270
270
|
children: [
|
|
271
|
-
|
|
272
|
-
t.color && /* @__PURE__ */
|
|
271
|
+
h(t.imageUrl),
|
|
272
|
+
t.color && /* @__PURE__ */ S("span", {
|
|
273
273
|
className: "size-2.5 shrink-0 rounded-full",
|
|
274
274
|
style: { backgroundColor: t.color }
|
|
275
275
|
}),
|
|
276
|
-
/* @__PURE__ */
|
|
276
|
+
/* @__PURE__ */ S("span", {
|
|
277
277
|
className: "min-w-0 flex-1 truncate",
|
|
278
278
|
title: t.label,
|
|
279
279
|
children: t.label
|
|
280
280
|
}),
|
|
281
|
-
t.description !== void 0 && /* @__PURE__ */
|
|
281
|
+
t.description !== void 0 && /* @__PURE__ */ C("span", {
|
|
282
282
|
className: "shrink-0 truncate text-muted-foreground",
|
|
283
283
|
children: [
|
|
284
284
|
"(",
|
|
@@ -286,21 +286,21 @@ var M = ({ date: n, onDateChange: a, placeholder: o }) => {
|
|
|
286
286
|
")"
|
|
287
287
|
]
|
|
288
288
|
}),
|
|
289
|
-
/* @__PURE__ */
|
|
289
|
+
/* @__PURE__ */ S(T, { className: e("ml-auto size-4 shrink-0", r === t.value ? "opacity-100" : "opacity-0") })
|
|
290
290
|
]
|
|
291
291
|
}, t.value)),
|
|
292
|
-
X > 0 && /* @__PURE__ */
|
|
292
|
+
X > 0 && /* @__PURE__ */ S("div", {
|
|
293
293
|
"aria-hidden": !0,
|
|
294
294
|
style: { height: X }
|
|
295
295
|
}),
|
|
296
|
-
Q && /* @__PURE__ */
|
|
296
|
+
Q && /* @__PURE__ */ C(O.Item, {
|
|
297
297
|
forceMount: !0,
|
|
298
298
|
value: "__create__",
|
|
299
299
|
onSelect: le,
|
|
300
300
|
className: "flex min-w-0 items-center gap-2.5 rounded-md px-2 py-2 text-sm cursor-pointer transition-colors data-[selected=true]:bg-muted",
|
|
301
|
-
children: [/* @__PURE__ */
|
|
301
|
+
children: [/* @__PURE__ */ S(te, { className: "size-4 shrink-0" }), /* @__PURE__ */ S("span", {
|
|
302
302
|
className: "truncate",
|
|
303
|
-
children:
|
|
303
|
+
children: j ? j(K) : L("select.create", { search: K })
|
|
304
304
|
})]
|
|
305
305
|
})
|
|
306
306
|
]
|
|
@@ -308,33 +308,6 @@ var M = ({ date: n, onDateChange: a, placeholder: o }) => {
|
|
|
308
308
|
})
|
|
309
309
|
})]
|
|
310
310
|
});
|
|
311
|
-
}, I = ({ searchQuery: t, search: r, placeholder: i, onSearch: a, onSubmit: o, onClear: c, className: l }) => {
|
|
312
|
-
let { t: u } = n(), d = t ?? r ?? "";
|
|
313
|
-
return /* @__PURE__ */ w("div", {
|
|
314
|
-
className: e("relative h-fit w-full md:w-64", l),
|
|
315
|
-
children: [
|
|
316
|
-
/* @__PURE__ */ C(O, { className: "absolute left-3 top-1/2 transform -translate-y-1/2 text-muted-foreground w-4 h-4" }),
|
|
317
|
-
/* @__PURE__ */ C(s, {
|
|
318
|
-
placeholder: i ?? u("search.placeholder"),
|
|
319
|
-
value: d,
|
|
320
|
-
onChange: (e) => {
|
|
321
|
-
a(e.target.value);
|
|
322
|
-
},
|
|
323
|
-
className: "pl-8",
|
|
324
|
-
onKeyDown: (e) => {
|
|
325
|
-
e.key === "Enter" && o !== void 0 && (e.preventDefault(), o());
|
|
326
|
-
}
|
|
327
|
-
}),
|
|
328
|
-
d === "" ? null : /* @__PURE__ */ C("button", {
|
|
329
|
-
onClick: () => {
|
|
330
|
-
a(""), c !== void 0 && c();
|
|
331
|
-
},
|
|
332
|
-
className: "absolute right-3 top-1/2 -translate-y-1/2 text-gray-500 hover:text-gray-700",
|
|
333
|
-
type: "button",
|
|
334
|
-
children: /* @__PURE__ */ C(k, { className: "size-4" })
|
|
335
|
-
})
|
|
336
|
-
]
|
|
337
|
-
});
|
|
338
311
|
};
|
|
339
312
|
//#endregion
|
|
340
|
-
export { M as
|
|
313
|
+
export { M as n, A as r, N as t };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as e } from "./tailwind.helper-CJaRYBmL.js";
|
|
2
2
|
import { c as t, d as n, f as r, s as i } from "./chart-wW-fwL3s.js";
|
|
3
|
-
import { t as a } from "./i18n-
|
|
3
|
+
import { t as a } from "./i18n-Cpw8DZt1.js";
|
|
4
4
|
import { t as o } from "./skeleton-D6Ga4BLw.js";
|
|
5
5
|
import "react";
|
|
6
6
|
import { Fragment as s, jsx as c, jsxs as l } from "react/jsx-runtime";
|