@krosoft/react 0.0.245 → 0.0.247
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/{SearchInput-BJPT0SbB.js → SearchInput-BQyRXzCv.js} +10 -7
- package/dist/behavior-D3JNfIVJ.js +117 -0
- package/dist/components/core/filters/index.js +1 -1
- package/dist/components/core/index.js +2 -2
- package/dist/components/core/inputs/DateRangePicker.d.ts +3 -3
- package/dist/components/core/inputs/DateRangePicker.d.ts.map +1 -1
- package/dist/components/core/inputs/index.js +1 -1
- package/dist/components/core/navbar/index.js +1 -1
- package/dist/components/index.js +2 -2
- package/dist/hooks/behavior/index.d.ts +1 -0
- package/dist/hooks/behavior/index.d.ts.map +1 -1
- package/dist/hooks/behavior/index.js +2 -2
- package/dist/hooks/behavior/useUrlState.d.ts +28 -0
- package/dist/hooks/behavior/useUrlState.d.ts.map +1 -0
- package/dist/hooks/index.js +5 -5
- package/dist/{navbar-Bc5OQWRI.js → navbar-G9FexEW-.js} +1 -1
- package/dist/types/DateRangeValue.d.ts +9 -0
- package/dist/types/DateRangeValue.d.ts.map +1 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/dist/behavior-BR_V9Rpe.js +0 -76
|
@@ -43,10 +43,13 @@ var A = ({ date: n, onDateChange: a, placeholder: o }) => {
|
|
|
43
43
|
})
|
|
44
44
|
}) : null]
|
|
45
45
|
});
|
|
46
|
-
}, j = (
|
|
47
|
-
|
|
46
|
+
}, j = (e) => e ? {
|
|
47
|
+
from: e.from,
|
|
48
|
+
to: e.to
|
|
49
|
+
} : void 0, M = ({ value: n, onChange: o, placeholder: s, className: c }) => {
|
|
50
|
+
let { t: l } = a(), u = i(), [m, h] = g.useState(!1), [_, v] = g.useState(j(n));
|
|
48
51
|
return g.useEffect(() => {
|
|
49
|
-
m && v(n);
|
|
52
|
+
m && v(j(n));
|
|
50
53
|
}, [m, n]), /* @__PURE__ */ x("div", {
|
|
51
54
|
className: e("grid gap-2", c),
|
|
52
55
|
children: /* @__PURE__ */ S(p, {
|
|
@@ -102,7 +105,7 @@ var A = ({ date: n, onDateChange: a, placeholder: o }) => {
|
|
|
102
105
|
variant: "ghost",
|
|
103
106
|
size: "sm",
|
|
104
107
|
onClick: () => {
|
|
105
|
-
v(n), h(!1);
|
|
108
|
+
v(j(n)), h(!1);
|
|
106
109
|
},
|
|
107
110
|
children: l("actions.cancel")
|
|
108
111
|
}), /* @__PURE__ */ x(r, {
|
|
@@ -117,7 +120,7 @@ var A = ({ date: n, onDateChange: a, placeholder: o }) => {
|
|
|
117
120
|
})]
|
|
118
121
|
})
|
|
119
122
|
});
|
|
120
|
-
},
|
|
123
|
+
}, N = ({ options: t = [], value: r, onChange: i, onClear: u, onCreate: g, placeholder: _, searchPlaceholder: y, emptyLabel: C, createLabel: D, disabled: k = !1, modal: A = !0, className: j }) => {
|
|
121
124
|
let { t: M } = a(), [N, P] = b(!1), [F, I] = b(""), L = r !== void 0 && r !== "", R = v(() => L ? t.find((e) => e.value === r) : void 0, [
|
|
122
125
|
L,
|
|
123
126
|
t,
|
|
@@ -223,7 +226,7 @@ var A = ({ date: n, onDateChange: a, placeholder: o }) => {
|
|
|
223
226
|
})
|
|
224
227
|
})]
|
|
225
228
|
});
|
|
226
|
-
},
|
|
229
|
+
}, P = ({ searchQuery: t, search: n, placeholder: r, onSearch: i, onSubmit: o, onClear: s, className: c }) => {
|
|
227
230
|
let { t: l } = a(), d = t ?? n ?? "";
|
|
228
231
|
return /* @__PURE__ */ S("div", {
|
|
229
232
|
className: e("relative h-fit w-full md:w-64", c),
|
|
@@ -252,4 +255,4 @@ var A = ({ date: n, onDateChange: a, placeholder: o }) => {
|
|
|
252
255
|
});
|
|
253
256
|
};
|
|
254
257
|
//#endregion
|
|
255
|
-
export { A as i,
|
|
258
|
+
export { A as i, N as n, M as r, P as t };
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import { t as e } from "./i18n-Dw99bRmg.js";
|
|
2
|
+
import { n as t, t as n } from "./sidebar.context-BahtU6hE.js";
|
|
3
|
+
import * as r from "react";
|
|
4
|
+
import { useCallback as i, useContext as a, useState as o } from "react";
|
|
5
|
+
import { TrashIcon as s } from "lucide-react";
|
|
6
|
+
import { format as c, parse as l } from "date-fns";
|
|
7
|
+
import { useSearchParams as u } from "react-router-dom";
|
|
8
|
+
//#region src/hooks/behavior/useDialog.ts
|
|
9
|
+
var d = (e) => {
|
|
10
|
+
let [t, n] = o(null);
|
|
11
|
+
return {
|
|
12
|
+
id: t?.id ?? null,
|
|
13
|
+
name: t?.name ?? null,
|
|
14
|
+
isOpen: !!t,
|
|
15
|
+
openDialog: (t, r) => {
|
|
16
|
+
e?.onReset?.(), n({
|
|
17
|
+
id: t,
|
|
18
|
+
name: r
|
|
19
|
+
});
|
|
20
|
+
},
|
|
21
|
+
onClose: () => {
|
|
22
|
+
n(null);
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
}, f = ({ titleKey: e, descriptionKey: t, confirmKey: n = "Confirmer", onConfirm: r, onReset: i }) => {
|
|
26
|
+
let a = d({ onReset: i });
|
|
27
|
+
return {
|
|
28
|
+
isOpen: a.isOpen,
|
|
29
|
+
itemName: a.name,
|
|
30
|
+
title: e,
|
|
31
|
+
description: t,
|
|
32
|
+
confirmKey: n,
|
|
33
|
+
openDialog: a.openDialog,
|
|
34
|
+
onClose: a.onClose,
|
|
35
|
+
onConfirm: async () => {
|
|
36
|
+
if (a.id) try {
|
|
37
|
+
await r(a.id), a.onClose();
|
|
38
|
+
} catch (e) {
|
|
39
|
+
console.error("Error confirming action:", e);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
}, p = ({ titleKey: t, descriptionKey: n, confirmKey: r, onConfirm: i, onReset: a }) => {
|
|
44
|
+
let { t: o } = e();
|
|
45
|
+
return {
|
|
46
|
+
...f({
|
|
47
|
+
titleKey: t,
|
|
48
|
+
descriptionKey: n,
|
|
49
|
+
confirmKey: r ?? o("actions.delete"),
|
|
50
|
+
onConfirm: i,
|
|
51
|
+
onReset: a
|
|
52
|
+
}),
|
|
53
|
+
loadingKey: "Suppression...",
|
|
54
|
+
icon: s,
|
|
55
|
+
titleClassName: "flex items-center gap-2 text-destructive",
|
|
56
|
+
headerClassName: "bg-gradient-to-r from-slate-900 to-purple-700 rounded-t-surface shrink-0"
|
|
57
|
+
};
|
|
58
|
+
}, m = (e, t = 250) => {
|
|
59
|
+
let [n, i] = r.useState(e);
|
|
60
|
+
return r.useEffect(() => {
|
|
61
|
+
let n = setTimeout(() => {
|
|
62
|
+
i(e);
|
|
63
|
+
}, t);
|
|
64
|
+
return () => {
|
|
65
|
+
clearTimeout(n);
|
|
66
|
+
};
|
|
67
|
+
}, [e, t]), n;
|
|
68
|
+
}, h = () => {
|
|
69
|
+
let e = a(t);
|
|
70
|
+
if (e === void 0) throw Error("usePage must be used within an PageProvider");
|
|
71
|
+
return e;
|
|
72
|
+
}, g = () => {
|
|
73
|
+
let e = a(n);
|
|
74
|
+
if (e === void 0) throw Error("useSidebar must be used within a SidebarProvider");
|
|
75
|
+
return e;
|
|
76
|
+
}, _ = "yyyy-MM-dd";
|
|
77
|
+
function v(e, t, n, r) {
|
|
78
|
+
let [a, o] = u(), s = a.get(e), c;
|
|
79
|
+
c = s === null ? t : n ? n(s) : s;
|
|
80
|
+
let l = i((n) => {
|
|
81
|
+
o((i) => {
|
|
82
|
+
let a = r ? r(n) : String(n);
|
|
83
|
+
return a === (r ? r(t) : String(t)) || a === "" || a === "undefined" ? i.delete(e) : i.set(e, a), i;
|
|
84
|
+
}, { replace: !0 });
|
|
85
|
+
}, [
|
|
86
|
+
e,
|
|
87
|
+
t,
|
|
88
|
+
r,
|
|
89
|
+
o
|
|
90
|
+
]);
|
|
91
|
+
return [c, l];
|
|
92
|
+
}
|
|
93
|
+
function y(e, t = []) {
|
|
94
|
+
return v(e, t, (e) => e ? e.split(",").filter(Boolean) : [], (e) => e.join(","));
|
|
95
|
+
}
|
|
96
|
+
function b(e, t) {
|
|
97
|
+
return v(e, t, (e) => parseInt(e, 10) || t, (e) => e.toString());
|
|
98
|
+
}
|
|
99
|
+
var x = (e) => {
|
|
100
|
+
if (!e) return;
|
|
101
|
+
let [t, n] = e.split("_"), r = t ? l(t, _, /* @__PURE__ */ new Date()) : void 0;
|
|
102
|
+
if (!r || isNaN(r.getTime())) return;
|
|
103
|
+
let i = n ? l(n, _, /* @__PURE__ */ new Date()) : void 0;
|
|
104
|
+
return {
|
|
105
|
+
from: r,
|
|
106
|
+
to: i && !isNaN(i.getTime()) ? i : void 0
|
|
107
|
+
};
|
|
108
|
+
}, S = (e) => {
|
|
109
|
+
if (!e?.from) return "";
|
|
110
|
+
let t = c(e.from, _), n = e.to ? c(e.to, _) : "";
|
|
111
|
+
return n ? `${t}_${n}` : t;
|
|
112
|
+
};
|
|
113
|
+
function C(e) {
|
|
114
|
+
return v(e, void 0, x, S);
|
|
115
|
+
}
|
|
116
|
+
//#endregion
|
|
117
|
+
export { C as a, g as c, p as d, f, y as i, h as l, x as n, b as o, d as p, S as r, v as s, _ as t, m as u };
|
|
@@ -5,7 +5,7 @@ import { t as o } from "../../../i18n-Dw99bRmg.js";
|
|
|
5
5
|
import { a as s, g as c, h as l, l as u, m as d, o as f, p, r as m, t as h, u as g } from "../../../sheet-CRrYTZrl.js";
|
|
6
6
|
import { i as _, l as v, n as y, t as b, u as x } from "../../../select-ULiTPOr5.js";
|
|
7
7
|
import { t as S } from "../../../MultiSelect-BF0zL0B0.js";
|
|
8
|
-
import { i as C, n as w, r as T, t as E } from "../../../SearchInput-
|
|
8
|
+
import { i as C, n as w, r as T, t as E } from "../../../SearchInput-BQyRXzCv.js";
|
|
9
9
|
import { useEffect as D, useMemo as O, useState as k } from "react";
|
|
10
10
|
import { jsx as A, jsxs as j } from "react/jsx-runtime";
|
|
11
11
|
import { getLocale as M } from "@krosoft/core/helpers";
|
|
@@ -9,7 +9,7 @@ import { t as A } from "../../AppSubTitle-tqqV9nuT.js";
|
|
|
9
9
|
import { t as j } from "../../MultiSelect-BF0zL0B0.js";
|
|
10
10
|
import { t as M } from "../../GenericForm-CWXT5wiv.js";
|
|
11
11
|
import { t as N } from "../../ErrorAlert-BDqDHUUc.js";
|
|
12
|
-
import { i as P, n as F, r as I, t as L } from "../../SearchInput-
|
|
12
|
+
import { i as P, n as F, r as I, t as L } from "../../SearchInput-BQyRXzCv.js";
|
|
13
13
|
import { ActiveFilters as R, AdvancedFilters as z, FilterField as B, SearchableFilterPill as V, TableFilter as H } from "./filters/index.js";
|
|
14
14
|
import "./forms/index.js";
|
|
15
15
|
import "./inputs/index.js";
|
|
@@ -17,7 +17,7 @@ import { t as U } from "../../language-BQpuOau0.js";
|
|
|
17
17
|
import { t as W } from "../../AppTitle-BR4JFZfp.js";
|
|
18
18
|
import { n as G, t as K } from "../../states-N8-LjFng.js";
|
|
19
19
|
import { AppPageHeader as q, KpiCardsLayout as J } from "./layouts/index.js";
|
|
20
|
-
import { a as Y, i as X, n as Z, o as Q, r as $, t as ee } from "../../navbar-
|
|
20
|
+
import { a as Y, i as X, n as Z, o as Q, r as $, t as ee } from "../../navbar-G9FexEW-.js";
|
|
21
21
|
import { a as te, c as ne, d as re, f as ie, i as ae, l as oe, n as se, o as ce, r as le, s as ue, t as de, u as fe } from "../../table-B5ertvpB.js";
|
|
22
22
|
import { AppTabContainer as pe, AppTabHeader as me, AppTabs as he, AppVerticalTabs as ge } from "./tabs/index.js";
|
|
23
23
|
import { t as _e } from "../../theme-BGakUJ9c.js";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
+
import { DateRangeValue } from "../../../types/DateRangeValue";
|
|
1
2
|
import * as React from "react";
|
|
2
|
-
import type { DateRange } from "react-day-picker";
|
|
3
3
|
interface DateRangePickerProps {
|
|
4
|
-
value?:
|
|
5
|
-
onChange: (range?:
|
|
4
|
+
value?: DateRangeValue;
|
|
5
|
+
onChange: (range?: DateRangeValue) => void;
|
|
6
6
|
placeholder?: string;
|
|
7
7
|
className?: string;
|
|
8
8
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DateRangePicker.d.ts","sourceRoot":"","sources":["../../../../src/components/core/inputs/DateRangePicker.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"DateRangePicker.d.ts","sourceRoot":"","sources":["../../../../src/components/core/inputs/DateRangePicker.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAGxD,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,UAAU,oBAAoB;IAC5B,KAAK,CAAC,EAAE,cAAc,CAAC;IACvB,QAAQ,EAAE,CAAC,KAAK,CAAC,EAAE,cAAc,KAAK,IAAI,CAAC;IAC3C,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAKD,eAAO,MAAM,eAAe,GAAI,6CAA6C,oBAAoB,sBA0FhG,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { t as e } from "../../../ImageInput-CN2ozjpc.js";
|
|
2
2
|
import { t } from "../../../MultiSelect-BF0zL0B0.js";
|
|
3
|
-
import { i as n, n as r, r as i, t as a } from "../../../SearchInput-
|
|
3
|
+
import { i as n, n as r, r as i, t as a } from "../../../SearchInput-BQyRXzCv.js";
|
|
4
4
|
export { n as DatePicker, i as DateRangePicker, e as ImageInput, t as MultiSelect, a as SearchInput, r as SearchableSelect };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as e, i as t, n, o as r, r as i, t as a } from "../../../navbar-
|
|
1
|
+
import { a as e, i as t, n, o as r, r as i, t as a } from "../../../navbar-G9FexEW-.js";
|
|
2
2
|
export { r as GlobalSearch, e as NotificationsBell, i as Sidebar, n as SidebarHeader, t as SidebarNavItem, a as Topbar };
|
package/dist/components/index.js
CHANGED
|
@@ -14,13 +14,13 @@ import { t as Nr } from "../AppSubTitle-tqqV9nuT.js";
|
|
|
14
14
|
import { t as Pr } from "../MultiSelect-BF0zL0B0.js";
|
|
15
15
|
import { t as Fr } from "../GenericForm-CWXT5wiv.js";
|
|
16
16
|
import { t as Ir } from "../ErrorAlert-BDqDHUUc.js";
|
|
17
|
-
import { i as Lr, n as Rr, r as zr, t as Br } from "../SearchInput-
|
|
17
|
+
import { i as Lr, n as Rr, r as zr, t as Br } from "../SearchInput-BQyRXzCv.js";
|
|
18
18
|
import { ActiveFilters as Vr, AdvancedFilters as Hr, FilterField as Ur, SearchableFilterPill as Wr, TableFilter as Gr } from "./core/filters/index.js";
|
|
19
19
|
import { t as Kr } from "../language-BQpuOau0.js";
|
|
20
20
|
import { t as qr } from "../AppTitle-BR4JFZfp.js";
|
|
21
21
|
import { n as Jr, t as Yr } from "../states-N8-LjFng.js";
|
|
22
22
|
import { AppPageHeader as Xr, KpiCardsLayout as Zr } from "./core/layouts/index.js";
|
|
23
|
-
import { a as Qr, i as $r, n as ei, o as ti, r as ni, t as ri } from "../navbar-
|
|
23
|
+
import { a as Qr, i as $r, n as ei, o as ti, r as ni, t as ri } from "../navbar-G9FexEW-.js";
|
|
24
24
|
import { a as ii, c as ai, d as oi, f as si, i as ci, l as li, n as ui, o as di, r as fi, s as pi, t as mi, u as hi } from "../table-B5ertvpB.js";
|
|
25
25
|
import { AppTabContainer as gi, AppTabHeader as _i, AppTabs as vi, AppVerticalTabs as yi } from "./core/tabs/index.js";
|
|
26
26
|
import { t as bi } from "../theme-BGakUJ9c.js";
|
|
@@ -5,4 +5,5 @@ export { useDialog } from "./useDialog";
|
|
|
5
5
|
export type { DialogState } from "./useDialog";
|
|
6
6
|
export { usePage } from "./usePage";
|
|
7
7
|
export { useSidebar } from "./useSidebar";
|
|
8
|
+
export { parseDateRange, serializeDateRange, URL_DATE_FORMAT, useUrlArrayState, useUrlDateRangeState, useUrlNumberState, useUrlState } from "./useUrlState";
|
|
8
9
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/hooks/behavior/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,YAAY,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/hooks/behavior/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,YAAY,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,cAAc,EAAE,kBAAkB,EAAE,eAAe,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as e,
|
|
2
|
-
export {
|
|
1
|
+
import { a as e, c as t, d as n, f as r, i, l as a, n as o, o as s, p as c, r as l, s as u, t as d, u as f } from "../../behavior-D3JNfIVJ.js";
|
|
2
|
+
export { d as URL_DATE_FORMAT, o as parseDateRange, l as serializeDateRange, n as useConfirmDeleteDialog, r as useConfirmationDialog, f as useDebouncedValue, c as useDialog, a as usePage, t as useSidebar, i as useUrlArrayState, e as useUrlDateRangeState, s as useUrlNumberState, u as useUrlState };
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { DateRangeValue } from "../../types/DateRangeValue";
|
|
2
|
+
/** Format des dates en URL : compact et lisible. */
|
|
3
|
+
export declare const URL_DATE_FORMAT = "yyyy-MM-dd";
|
|
4
|
+
/**
|
|
5
|
+
* Hook to synchronize state with URL search parameters.
|
|
6
|
+
* @param key - URL parameter key
|
|
7
|
+
* @param defaultValue - Default value when parameter is not in URL
|
|
8
|
+
* @param parser - Optional function to parse string value to T
|
|
9
|
+
* @param serializer - Optional function to serialize T to string
|
|
10
|
+
*/
|
|
11
|
+
export declare function useUrlState<T>(key: string, defaultValue: T, parser?: (value: string) => T, serializer?: (value: T) => string): [T, (value: T) => void];
|
|
12
|
+
/**
|
|
13
|
+
* Hook for string array URL state (comma-separated).
|
|
14
|
+
*/
|
|
15
|
+
export declare function useUrlArrayState(key: string, defaultValue?: string[]): [string[], (value: string[]) => void];
|
|
16
|
+
/**
|
|
17
|
+
* Hook for number URL state.
|
|
18
|
+
*/
|
|
19
|
+
export declare function useUrlNumberState(key: string, defaultValue: number): [number, (value: number) => void];
|
|
20
|
+
/** Analyse une plage de dates au format `from_to` (chaque borne en `yyyy-MM-dd`). */
|
|
21
|
+
export declare const parseDateRange: (value: string) => DateRangeValue | undefined;
|
|
22
|
+
/** Sérialise une plage de dates en `from_to` (borne haute omise si absente). */
|
|
23
|
+
export declare const serializeDateRange: (range: DateRangeValue | undefined) => string;
|
|
24
|
+
/**
|
|
25
|
+
* Hook for date range URL state (from_to, dates formatted as yyyy-MM-dd).
|
|
26
|
+
*/
|
|
27
|
+
export declare function useUrlDateRangeState(key: string): [DateRangeValue | undefined, (value: DateRangeValue | undefined) => void];
|
|
28
|
+
//# sourceMappingURL=useUrlState.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useUrlState.d.ts","sourceRoot":"","sources":["../../../src/hooks/behavior/useUrlState.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAExD,oDAAoD;AACpD,eAAO,MAAM,eAAe,eAAe,CAAC;AAE5C;;;;;;GAMG;AACH,wBAAgB,WAAW,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,EAAE,YAAY,EAAE,CAAC,EAAE,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,CAAC,EAAE,UAAU,CAAC,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,MAAM,GAAG,CAAC,CAAC,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,IAAI,CAAC,CAmCtJ;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,MAAM,EAAE,YAAY,GAAE,MAAM,EAAO,GAAG,CAAC,MAAM,EAAE,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC,CAOhH;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,GAAG,CAAC,MAAM,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC,CAOtG;AAED,qFAAqF;AACrF,eAAO,MAAM,cAAc,GAAI,OAAO,MAAM,KAAG,cAAc,GAAG,SAa/D,CAAC;AAEF,gFAAgF;AAChF,eAAO,MAAM,kBAAkB,GAAI,OAAO,cAAc,GAAG,SAAS,KAAG,MAQtE,CAAC;AAEF;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,MAAM,GAAG,CAAC,cAAc,GAAG,SAAS,EAAE,CAAC,KAAK,EAAE,cAAc,GAAG,SAAS,KAAK,IAAI,CAAC,CAE3H"}
|
package/dist/hooks/index.js
CHANGED
|
@@ -4,8 +4,8 @@ import { t as r } from "../useMobile-pTQ8lWvt.js";
|
|
|
4
4
|
import { t as i } from "../useNotifications-CyhTruIG.js";
|
|
5
5
|
import { t as a } from "../useLanguage-DN3CuBv5.js";
|
|
6
6
|
import { t as o } from "../useDocumentTitle-D7MywIeB.js";
|
|
7
|
-
import { a as s, i as
|
|
8
|
-
import { n as
|
|
9
|
-
import { t as
|
|
10
|
-
import { t as
|
|
11
|
-
export { n as toast,
|
|
7
|
+
import { a as s, c, d as l, f as u, i as d, l as f, n as p, o as m, p as h, r as g, s as _, t as v, u as y } from "../behavior-D3JNfIVJ.js";
|
|
8
|
+
import { n as b, t as x } from "../useFixedColumns-DfAX30tT.js";
|
|
9
|
+
import { t as S } from "../ui-DSVBO3iM.js";
|
|
10
|
+
import { t as C } from "../useTheme-DVfcJ-Qd.js";
|
|
11
|
+
export { v as URL_DATE_FORMAT, p as parseDateRange, g as serializeDateRange, n as toast, l as useConfirmDeleteDialog, u as useConfirmationDialog, b as useDataTable, y as useDebouncedValue, h as useDialog, o as useDocumentTitle, x as useFixedColumns, a as useLanguage, r as useMobile, i as useNotifications, f as usePage, e as useScrollFade, S as useServerTable, c as useSidebar, C as useTheme, t as useToast, d as useUrlArrayState, s as useUrlDateRangeState, m as useUrlNumberState, _ as useUrlState };
|
|
@@ -3,7 +3,7 @@ import { i as t, n, r, s as i, t as a } from "./tooltip-B2dzyfs9.js";
|
|
|
3
3
|
import { t as o } from "./i18n-Dw99bRmg.js";
|
|
4
4
|
import { C as s, S as c, b as l, d as u, g as d, h as f, i as p, l as m, m as h, p as g, r as _, t as v, v as y, x as b, y as x } from "./sheet-CRrYTZrl.js";
|
|
5
5
|
import { t as S } from "./skeleton-D6Ga4BLw.js";
|
|
6
|
-
import {
|
|
6
|
+
import { c as C } from "./behavior-D3JNfIVJ.js";
|
|
7
7
|
import "./hooks/index.js";
|
|
8
8
|
import * as w from "react";
|
|
9
9
|
import { Fragment as T, jsx as E, jsxs as D } from "react/jsx-runtime";
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Plage de dates exposée par la librairie. Type maison volontairement isolé de `react-day-picker`
|
|
3
|
+
* (utilisé en interne par les composants) : un changement de cette dépendance n'impacte pas l'API.
|
|
4
|
+
*/
|
|
5
|
+
export interface DateRangeValue {
|
|
6
|
+
from?: Date;
|
|
7
|
+
to?: Date;
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=DateRangeValue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DateRangeValue.d.ts","sourceRoot":"","sources":["../../src/types/DateRangeValue.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,WAAW,cAAc;IAC7B,IAAI,CAAC,EAAE,IAAI,CAAC;IACZ,EAAE,CAAC,EAAE,IAAI,CAAC;CACX"}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ export * from "./ButtonVariantType";
|
|
|
4
4
|
export * from "./ChartDatum";
|
|
5
5
|
export * from "./ColumnDef";
|
|
6
6
|
export * from "./ConfirmDialogConfig";
|
|
7
|
+
export * from "./DateRangeValue";
|
|
7
8
|
export * from "./FilterFieldConfig";
|
|
8
9
|
export * from "./FilterSection";
|
|
9
10
|
export * from "./forms";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,qBAAqB,CAAC;AACpC,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,uBAAuB,CAAC;AACtC,cAAc,qBAAqB,CAAC;AACpC,cAAc,iBAAiB,CAAC;AAChC,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,qBAAqB,CAAC;AACpC,cAAc,sBAAsB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,qBAAqB,CAAC;AACpC,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,uBAAuB,CAAC;AACtC,cAAc,kBAAkB,CAAC;AACjC,cAAc,qBAAqB,CAAC;AACpC,cAAc,iBAAiB,CAAC;AAChC,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,qBAAqB,CAAC;AACpC,cAAc,sBAAsB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
import { t as e } from "./i18n-Dw99bRmg.js";
|
|
2
|
-
import { n as t, t as n } from "./sidebar.context-BahtU6hE.js";
|
|
3
|
-
import * as r from "react";
|
|
4
|
-
import { useContext as i, useState as a } from "react";
|
|
5
|
-
import { TrashIcon as o } from "lucide-react";
|
|
6
|
-
//#region src/hooks/behavior/useDialog.ts
|
|
7
|
-
var s = (e) => {
|
|
8
|
-
let [t, n] = a(null);
|
|
9
|
-
return {
|
|
10
|
-
id: t?.id ?? null,
|
|
11
|
-
name: t?.name ?? null,
|
|
12
|
-
isOpen: !!t,
|
|
13
|
-
openDialog: (t, r) => {
|
|
14
|
-
e?.onReset?.(), n({
|
|
15
|
-
id: t,
|
|
16
|
-
name: r
|
|
17
|
-
});
|
|
18
|
-
},
|
|
19
|
-
onClose: () => {
|
|
20
|
-
n(null);
|
|
21
|
-
}
|
|
22
|
-
};
|
|
23
|
-
}, c = ({ titleKey: e, descriptionKey: t, confirmKey: n = "Confirmer", onConfirm: r, onReset: i }) => {
|
|
24
|
-
let a = s({ onReset: i });
|
|
25
|
-
return {
|
|
26
|
-
isOpen: a.isOpen,
|
|
27
|
-
itemName: a.name,
|
|
28
|
-
title: e,
|
|
29
|
-
description: t,
|
|
30
|
-
confirmKey: n,
|
|
31
|
-
openDialog: a.openDialog,
|
|
32
|
-
onClose: a.onClose,
|
|
33
|
-
onConfirm: async () => {
|
|
34
|
-
if (a.id) try {
|
|
35
|
-
await r(a.id), a.onClose();
|
|
36
|
-
} catch (e) {
|
|
37
|
-
console.error("Error confirming action:", e);
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
};
|
|
41
|
-
}, l = ({ titleKey: t, descriptionKey: n, confirmKey: r, onConfirm: i, onReset: a }) => {
|
|
42
|
-
let { t: s } = e();
|
|
43
|
-
return {
|
|
44
|
-
...c({
|
|
45
|
-
titleKey: t,
|
|
46
|
-
descriptionKey: n,
|
|
47
|
-
confirmKey: r ?? s("actions.delete"),
|
|
48
|
-
onConfirm: i,
|
|
49
|
-
onReset: a
|
|
50
|
-
}),
|
|
51
|
-
loadingKey: "Suppression...",
|
|
52
|
-
icon: o,
|
|
53
|
-
titleClassName: "flex items-center gap-2 text-destructive",
|
|
54
|
-
headerClassName: "bg-gradient-to-r from-slate-900 to-purple-700 rounded-t-surface shrink-0"
|
|
55
|
-
};
|
|
56
|
-
}, u = (e, t = 250) => {
|
|
57
|
-
let [n, i] = r.useState(e);
|
|
58
|
-
return r.useEffect(() => {
|
|
59
|
-
let n = setTimeout(() => {
|
|
60
|
-
i(e);
|
|
61
|
-
}, t);
|
|
62
|
-
return () => {
|
|
63
|
-
clearTimeout(n);
|
|
64
|
-
};
|
|
65
|
-
}, [e, t]), n;
|
|
66
|
-
}, d = () => {
|
|
67
|
-
let e = i(t);
|
|
68
|
-
if (e === void 0) throw Error("usePage must be used within an PageProvider");
|
|
69
|
-
return e;
|
|
70
|
-
}, f = () => {
|
|
71
|
-
let e = i(n);
|
|
72
|
-
if (e === void 0) throw Error("useSidebar must be used within a SidebarProvider");
|
|
73
|
-
return e;
|
|
74
|
-
};
|
|
75
|
-
//#endregion
|
|
76
|
-
export { c as a, l as i, d as n, s as o, u as r, f as t };
|