@krosoft/react 0.0.428 → 0.0.430
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/core/table/JsonTableOutput.d.ts.map +1 -1
- package/dist/components/core/table/JsonTableOutput.js +46 -42
- package/dist/components/core/table/TableBody.d.ts.map +1 -1
- package/dist/components/core/table/TableBody.js +37 -37
- package/dist/components/core/tabs/AppTabs.d.ts.map +1 -1
- package/dist/components/core/tabs/AppTabs.js +18 -18
- package/dist/components/core/tabs/AppVerticalTabs.d.ts.map +1 -1
- package/dist/components/core/tabs/AppVerticalTabs.js +25 -23
- package/dist/helpers/index.d.ts +1 -0
- package/dist/helpers/index.d.ts.map +1 -1
- package/dist/helpers/index.js +2 -1
- package/dist/helpers/navigation.helper.d.ts +7 -0
- package/dist/helpers/navigation.helper.d.ts.map +1 -0
- package/dist/helpers/navigation.helper.js +3 -0
- package/dist/hooks/behavior/index.d.ts +2 -0
- package/dist/hooks/behavior/index.d.ts.map +1 -1
- package/dist/hooks/behavior/index.js +13 -11
- package/dist/hooks/behavior/useBackNavigation.d.ts +8 -0
- package/dist/hooks/behavior/useBackNavigation.d.ts.map +1 -0
- package/dist/hooks/behavior/useBackNavigation.js +19 -0
- package/dist/hooks/behavior/useNavigateWithBack.d.ts +7 -0
- package/dist/hooks/behavior/useNavigateWithBack.d.ts.map +1 -0
- package/dist/hooks/behavior/useNavigateWithBack.js +11 -0
- package/dist/hooks/index.js +12 -10
- package/dist/types/BackNavigationState.d.ts +5 -0
- package/dist/types/BackNavigationState.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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"JsonTableOutput.d.ts","sourceRoot":"","sources":["../../../../src/components/core/table/JsonTableOutput.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"JsonTableOutput.d.ts","sourceRoot":"","sources":["../../../../src/components/core/table/JsonTableOutput.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAExC,UAAU,oBAAoB;IAC5B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,eAAO,MAAM,eAAe,GAAI,oBAAoB,oBAAoB,KAAG,KAAK,CAAC,GAAG,CAAC,OAAO,GAAG,IA6G9F,CAAC"}
|
|
@@ -1,74 +1,78 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
1
|
+
import { AppCopyableValue as e } from "../clipboard/AppCopyableValue.js";
|
|
2
|
+
import { Label as t } from "../../ui/label.js";
|
|
3
|
+
import { SimpleTable as n, SimpleTableBody as r, SimpleTableCell as i, SimpleTableHead as a, SimpleTableHeader as o, SimpleTableRow as s } from "../../ui/simple-table.js";
|
|
4
|
+
import { Switch as c } from "../../ui/switch.js";
|
|
5
|
+
import { useKrosoftTranslation as l } from "../../../i18n/useKrosoftTranslation.js";
|
|
6
|
+
import { useState as u } from "react";
|
|
7
|
+
import { jsx as d, jsxs as f } from "react/jsx-runtime";
|
|
8
|
+
import { formatJsonValue as p, isRecord as m, tryParseJson as h } from "@krosoft/core/helpers";
|
|
8
9
|
// src/components/core/table/JsonTableOutput.tsx
|
|
9
|
-
var
|
|
10
|
-
let { t:
|
|
10
|
+
var g = ({ header: g, output: _ }) => {
|
|
11
|
+
let { t: v } = l(), [y, b] = u(!0), x = h(_), S = x !== null, C = (t) => {
|
|
12
|
+
let n = p(t);
|
|
13
|
+
return n && /* @__PURE__ */ d(e, { value: n });
|
|
14
|
+
}, w = () => /* @__PURE__ */ f("div", {
|
|
11
15
|
className: "flex items-center justify-between mb-2",
|
|
12
|
-
children: [/* @__PURE__ */
|
|
16
|
+
children: [/* @__PURE__ */ d("span", {
|
|
13
17
|
className: "font-medium text-sm",
|
|
14
|
-
children:
|
|
15
|
-
}), /* @__PURE__ */
|
|
18
|
+
children: g
|
|
19
|
+
}), /* @__PURE__ */ f("div", {
|
|
16
20
|
className: "flex items-center gap-2",
|
|
17
|
-
children: [/* @__PURE__ */
|
|
21
|
+
children: [/* @__PURE__ */ d(c, {
|
|
18
22
|
id: "table-mode",
|
|
19
|
-
checked:
|
|
20
|
-
onCheckedChange:
|
|
21
|
-
}), /* @__PURE__ */
|
|
23
|
+
checked: y,
|
|
24
|
+
onCheckedChange: b
|
|
25
|
+
}), /* @__PURE__ */ d(t, {
|
|
22
26
|
htmlFor: "table-mode",
|
|
23
27
|
className: "text-xs",
|
|
24
|
-
children:
|
|
28
|
+
children: v("table.tableMode")
|
|
25
29
|
})]
|
|
26
30
|
})]
|
|
27
|
-
}),
|
|
31
|
+
}), T = ({ children: e }) => /* @__PURE__ */ d("div", {
|
|
28
32
|
className: "border rounded min-w-0 w-full",
|
|
29
|
-
children: /* @__PURE__ */
|
|
30
|
-
}),
|
|
33
|
+
children: /* @__PURE__ */ d(n, { children: e })
|
|
34
|
+
}), E = () => /* @__PURE__ */ d("pre", {
|
|
31
35
|
className: "text-xs bg-muted p-4 rounded overflow-x-auto whitespace-pre-wrap",
|
|
32
|
-
children:
|
|
36
|
+
children: S && !y ? JSON.stringify(x, null, 2) : _
|
|
33
37
|
});
|
|
34
|
-
return
|
|
38
|
+
return _ ? /* @__PURE__ */ f("div", {
|
|
35
39
|
className: "min-w-0 w-full",
|
|
36
|
-
children: [
|
|
37
|
-
if (!
|
|
38
|
-
if (Array.isArray(
|
|
39
|
-
let e =
|
|
40
|
-
return /* @__PURE__ */
|
|
40
|
+
children: [w(), (() => {
|
|
41
|
+
if (!S || !y) return /* @__PURE__ */ d(E, {});
|
|
42
|
+
if (Array.isArray(x) && x.length > 0 && m(x[0])) {
|
|
43
|
+
let e = x, t = Object.keys(e[0]);
|
|
44
|
+
return /* @__PURE__ */ f(T, { children: [/* @__PURE__ */ d(o, {
|
|
41
45
|
className: "bg-muted/50",
|
|
42
|
-
children: /* @__PURE__ */
|
|
46
|
+
children: /* @__PURE__ */ d(s, { children: t.map((e) => /* @__PURE__ */ d(a, {
|
|
43
47
|
className: "font-medium",
|
|
44
48
|
children: e
|
|
45
49
|
}, e)) })
|
|
46
|
-
}), /* @__PURE__ */
|
|
50
|
+
}), /* @__PURE__ */ d(r, { children: e.map((e, n) => /* @__PURE__ */ d(s, { children: t.map((t) => /* @__PURE__ */ d(i, {
|
|
47
51
|
className: "text-sm whitespace-pre-wrap",
|
|
48
|
-
children:
|
|
52
|
+
children: C(e[t])
|
|
49
53
|
}, t)) }, n)) })] });
|
|
50
54
|
}
|
|
51
|
-
if (
|
|
52
|
-
let e = Object.entries(
|
|
53
|
-
return /* @__PURE__ */
|
|
55
|
+
if (m(x)) {
|
|
56
|
+
let e = Object.entries(x);
|
|
57
|
+
return /* @__PURE__ */ f(T, { children: [/* @__PURE__ */ d(o, {
|
|
54
58
|
className: "bg-muted/50",
|
|
55
|
-
children: /* @__PURE__ */
|
|
59
|
+
children: /* @__PURE__ */ f(s, { children: [/* @__PURE__ */ d(a, {
|
|
56
60
|
className: "font-medium",
|
|
57
|
-
children:
|
|
58
|
-
}), /* @__PURE__ */
|
|
61
|
+
children: v("table.property")
|
|
62
|
+
}), /* @__PURE__ */ d(a, {
|
|
59
63
|
className: "font-medium",
|
|
60
|
-
children:
|
|
64
|
+
children: v("table.value")
|
|
61
65
|
})] })
|
|
62
|
-
}), /* @__PURE__ */
|
|
66
|
+
}), /* @__PURE__ */ d(r, { children: e.map(([e, t]) => /* @__PURE__ */ f(s, { children: [/* @__PURE__ */ d(i, {
|
|
63
67
|
className: "font-medium text-sm",
|
|
64
68
|
children: e
|
|
65
|
-
}), /* @__PURE__ */
|
|
69
|
+
}), /* @__PURE__ */ d(i, {
|
|
66
70
|
className: "text-sm whitespace-pre-wrap",
|
|
67
|
-
children:
|
|
71
|
+
children: C(t)
|
|
68
72
|
})] }, e)) })] });
|
|
69
73
|
}
|
|
70
|
-
return /* @__PURE__ */
|
|
74
|
+
return /* @__PURE__ */ d(E, {});
|
|
71
75
|
})()]
|
|
72
76
|
}) : null;
|
|
73
77
|
};
|
|
74
|
-
export {
|
|
78
|
+
export { g as JsonTableOutput };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TableBody.d.ts","sourceRoot":"","sources":["../../../../src/components/core/table/TableBody.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;
|
|
1
|
+
{"version":3,"file":"TableBody.d.ts","sourceRoot":"","sources":["../../../../src/components/core/table/TableBody.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAGpE,OAAO,EAAE,eAAe,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAEjF,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,MAAM,WAAW,cAAc,CAAC,CAAC;IAC/B,SAAS,EAAE,OAAO,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,YAAY,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,iBAAiB,CAAC;IAC7B,aAAa,EAAE,CAAC,EAAE,CAAC;IACnB,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,KAAK,MAAM,CAAC;IAC3B,UAAU,CAAC,EAAE,CAAC,GAAG,EAAE,CAAC,EAAE,KAAK,EAAE,KAAK,CAAC,UAAU,CAAC,mBAAmB,CAAC,KAAK,IAAI,CAAC;IAC5E,aAAa,CAAC,EAAE,CAAC,GAAG,EAAE,CAAC,KAAK,MAAM,CAAC;IACnC,YAAY,CAAC,EAAE,CAAC,GAAG,EAAE,CAAC,KAAK,OAAO,CAAC;IACnC,cAAc,EAAE,OAAO,CAAC;IACxB,aAAa,CAAC,EAAE,CAAC,GAAG,EAAE,CAAC,KAAK,OAAO,CAAC;IACpC,YAAY,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IAC1B,kBAAkB,EAAE,CAAC,GAAG,EAAE,CAAC,KAAK,IAAI,CAAC;IACrC,mBAAmB,EAAE,eAAe,CAAC,CAAC,CAAC,EAAE,CAAC;IAC1C,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACrC,UAAU,EAAE,OAAO,CAAC;IACpB,OAAO,CAAC,EAAE,kBAAkB,CAAC,CAAC,CAAC,EAAE,CAAC;IAClC,OAAO,EAAE,eAAe,CAAC,CAAC,CAAC,EAAE,CAAC;IAC9B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAE3B,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,iBAAiB,CAAC,CAAC;CAClD;AAED,wBAAgB,SAAS,CAAC,CAAC,EAAE,EAC3B,SAAS,EACT,KAAK,EACL,YAAY,EACZ,QAAQ,EACR,aAAa,EACb,MAAM,EACN,UAAU,EACV,aAAa,EACb,YAAY,EACZ,cAAc,EACd,aAAa,EACb,YAAY,EACZ,kBAAkB,EAClB,mBAAmB,EACnB,YAAY,EACZ,UAAU,EACV,OAAO,EACP,OAAO,EACP,QAAgB,EAChB,KAAa,EACb,gBAAwB,EACxB,YAAiB,GAClB,EAAE,cAAc,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,GAAG,CAAC,OAAO,CA8JvC"}
|
|
@@ -1,74 +1,74 @@
|
|
|
1
1
|
import { Checkbox as e } from "../../ui/checkbox.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
2
|
+
import { useNavigateWithBack as t } from "../../../hooks/behavior/useNavigateWithBack.js";
|
|
3
|
+
import { useKrosoftTranslation as n } from "../../../i18n/useKrosoftTranslation.js";
|
|
4
|
+
import { TableActions as r } from "./TableActions.js";
|
|
5
|
+
import { ACTIONS_COLUMN_KEY as i, SELECTION_COLUMN_KEY as a, getAlignmentClass as o, getColumnAlignment as s, getFixedCellProps as c } from "../../../helpers/table.helper.js";
|
|
5
6
|
import "react";
|
|
6
|
-
import { jsx as
|
|
7
|
-
import { AlertTriangleIcon as
|
|
8
|
-
import { useNavigate as f } from "react-router-dom";
|
|
7
|
+
import { jsx as l, jsxs as u } from "react/jsx-runtime";
|
|
8
|
+
import { AlertTriangleIcon as d, Loader2Icon as f } from "lucide-react";
|
|
9
9
|
// src/components/core/table/TableBody.tsx
|
|
10
10
|
function p({ isLoading: p, error: m, colSpanCount: h, messages: g, paginatedData: _, rowKey: v, onRowClick: y, onRowNavigate: b, rowNavigable: x, hasBulkActions: S, rowSelectable: C, selectedKeys: w, toggleRowSelection: T, visibleColumnsArray: E, columnWidths: D, hasActions: O, actions: k, columns: A, bordered: j = !1, dense: M = !1, resizableColumns: N = !1, fixedColumns: P = {} }) {
|
|
11
|
-
let { t: F } =
|
|
11
|
+
let { t: F } = n(), I = F(g?.loadingKey ?? "states.loading"), L = F(g?.emptyKey ?? "states.noResult"), R = t(), z = (e, t) => {
|
|
12
12
|
let n = A.find((e) => e.key === t);
|
|
13
13
|
if (n?.renderCell !== void 0) return n.renderCell(e);
|
|
14
14
|
let r = e[t];
|
|
15
|
-
return /* @__PURE__ */
|
|
15
|
+
return /* @__PURE__ */ l("span", {
|
|
16
16
|
className: "text-sm truncate",
|
|
17
17
|
children: r == null ? "-" : String(r)
|
|
18
18
|
});
|
|
19
19
|
};
|
|
20
|
-
if (p) return /* @__PURE__ */
|
|
20
|
+
if (p) return /* @__PURE__ */ l("tbody", {
|
|
21
21
|
className: "divide-y divide-border",
|
|
22
|
-
children: /* @__PURE__ */
|
|
22
|
+
children: /* @__PURE__ */ l("tr", { children: /* @__PURE__ */ l("td", {
|
|
23
23
|
colSpan: h,
|
|
24
24
|
className: "py-8 text-center",
|
|
25
|
-
children: /* @__PURE__ */
|
|
25
|
+
children: /* @__PURE__ */ u("div", {
|
|
26
26
|
className: "flex flex-col items-center justify-center gap-2 text-muted-foreground",
|
|
27
|
-
children: [/* @__PURE__ */
|
|
27
|
+
children: [/* @__PURE__ */ l(f, { className: "h-6 w-6 animate-spin text-primary" }), /* @__PURE__ */ l("span", {
|
|
28
28
|
className: "text-sm",
|
|
29
29
|
children: I
|
|
30
30
|
})]
|
|
31
31
|
})
|
|
32
32
|
}) })
|
|
33
33
|
});
|
|
34
|
-
if (m) return /* @__PURE__ */
|
|
34
|
+
if (m) return /* @__PURE__ */ l("tbody", {
|
|
35
35
|
className: "divide-y divide-border",
|
|
36
|
-
children: /* @__PURE__ */
|
|
36
|
+
children: /* @__PURE__ */ l("tr", { children: /* @__PURE__ */ l("td", {
|
|
37
37
|
colSpan: h,
|
|
38
38
|
className: "py-8 text-center",
|
|
39
|
-
children: /* @__PURE__ */
|
|
39
|
+
children: /* @__PURE__ */ u("div", {
|
|
40
40
|
className: "flex flex-col items-center justify-center gap-2 text-destructive",
|
|
41
|
-
children: [/* @__PURE__ */
|
|
41
|
+
children: [/* @__PURE__ */ l(d, { className: "h-6 w-6" }), /* @__PURE__ */ l("span", {
|
|
42
42
|
className: "text-sm",
|
|
43
43
|
children: m
|
|
44
44
|
})]
|
|
45
45
|
})
|
|
46
46
|
}) })
|
|
47
47
|
});
|
|
48
|
-
if (_.length === 0) return /* @__PURE__ */
|
|
48
|
+
if (_.length === 0) return /* @__PURE__ */ l("tbody", {
|
|
49
49
|
className: "divide-y divide-border",
|
|
50
|
-
children: /* @__PURE__ */
|
|
50
|
+
children: /* @__PURE__ */ l("tr", { children: /* @__PURE__ */ l("td", {
|
|
51
51
|
colSpan: h,
|
|
52
52
|
className: "py-8 text-center text-sm text-muted-foreground",
|
|
53
53
|
children: L
|
|
54
54
|
}) })
|
|
55
55
|
});
|
|
56
|
-
let B =
|
|
56
|
+
let B = c(P[a], "body"), V = c(P[i], "body"), H = S && w.size > 0, U = (e) => {
|
|
57
57
|
if (x === void 0 || x(e)) return b?.(e);
|
|
58
58
|
}, W = (e, t, n) => {
|
|
59
|
-
H ? T(e) : t === void 0 ? y?.(e, n) :
|
|
59
|
+
H ? T(e) : t === void 0 ? y?.(e, n) : R(t, n);
|
|
60
60
|
};
|
|
61
|
-
return /* @__PURE__ */
|
|
61
|
+
return /* @__PURE__ */ l("tbody", {
|
|
62
62
|
className: "divide-y divide-border",
|
|
63
63
|
children: _.map((t) => {
|
|
64
|
-
let
|
|
65
|
-
return /* @__PURE__ */
|
|
66
|
-
className: `group hover:bg-muted/50 transition-colors ${H ||
|
|
64
|
+
let n = v(t), i = C === void 0 || C(t), a = U(t);
|
|
65
|
+
return /* @__PURE__ */ u("tr", {
|
|
66
|
+
className: `group hover:bg-muted/50 transition-colors ${H || a !== void 0 || y !== void 0 ? "cursor-pointer" : ""}`,
|
|
67
67
|
onClick: (e) => {
|
|
68
|
-
W(t,
|
|
68
|
+
W(t, a, e);
|
|
69
69
|
},
|
|
70
70
|
children: [
|
|
71
|
-
S ? /* @__PURE__ */
|
|
71
|
+
S ? /* @__PURE__ */ l("td", {
|
|
72
72
|
className: `p-1 text-center align-middle ${B.className}`,
|
|
73
73
|
style: {
|
|
74
74
|
width: "48px",
|
|
@@ -79,10 +79,10 @@ function p({ isLoading: p, error: m, colSpanCount: h, messages: g, paginatedData
|
|
|
79
79
|
onClick: (e) => {
|
|
80
80
|
e.stopPropagation();
|
|
81
81
|
},
|
|
82
|
-
children: /* @__PURE__ */
|
|
82
|
+
children: /* @__PURE__ */ l("div", {
|
|
83
83
|
className: "flex items-center justify-center",
|
|
84
|
-
children: /* @__PURE__ */
|
|
85
|
-
checked: w.has(
|
|
84
|
+
children: /* @__PURE__ */ l(e, {
|
|
85
|
+
checked: w.has(n),
|
|
86
86
|
disabled: !i,
|
|
87
87
|
onCheckedChange: () => {
|
|
88
88
|
T(t);
|
|
@@ -91,20 +91,20 @@ function p({ isLoading: p, error: m, colSpanCount: h, messages: g, paginatedData
|
|
|
91
91
|
})
|
|
92
92
|
}) : null,
|
|
93
93
|
E.map((e, n) => {
|
|
94
|
-
let r = n === E.length - 1, i =
|
|
95
|
-
return /* @__PURE__ */
|
|
96
|
-
className: `${`${n === 0 && !S ? "pl-4" : "pl-2"} ${r && !O ? "pr-4" : "pr-2"}`} ${M ? "py-2" : "py-4"} text-sm ${
|
|
94
|
+
let r = n === E.length - 1, i = c(P[e.key], "body");
|
|
95
|
+
return /* @__PURE__ */ l("td", {
|
|
96
|
+
className: `${`${n === 0 && !S ? "pl-4" : "pl-2"} ${r && !O ? "pr-4" : "pr-2"}`} ${M ? "py-2" : "py-4"} text-sm ${o(s(e))} ${i.className} ${j && !r ? "border-r border-border" : ""} ${e.className ?? ""}`,
|
|
97
97
|
style: {
|
|
98
98
|
...N ? { width: D[e.key] } : { minWidth: D[e.key] },
|
|
99
99
|
...i.style
|
|
100
100
|
},
|
|
101
|
-
children: /* @__PURE__ */
|
|
101
|
+
children: /* @__PURE__ */ l("div", {
|
|
102
102
|
className: "w-full h-full",
|
|
103
103
|
children: z(t, e.key)
|
|
104
104
|
})
|
|
105
105
|
}, e.key);
|
|
106
106
|
}),
|
|
107
|
-
O ? /* @__PURE__ */
|
|
107
|
+
O ? /* @__PURE__ */ l("td", {
|
|
108
108
|
className: `py-1 pl-1 pr-4 text-right align-middle whitespace-nowrap ${V.className}`,
|
|
109
109
|
style: {
|
|
110
110
|
minWidth: "32px",
|
|
@@ -113,16 +113,16 @@ function p({ isLoading: p, error: m, colSpanCount: h, messages: g, paginatedData
|
|
|
113
113
|
onClick: (e) => {
|
|
114
114
|
e.stopPropagation();
|
|
115
115
|
},
|
|
116
|
-
children: k !== void 0 && k.length > 0 ? /* @__PURE__ */
|
|
116
|
+
children: k !== void 0 && k.length > 0 ? /* @__PURE__ */ l("div", {
|
|
117
117
|
className: "flex items-center justify-end",
|
|
118
|
-
children: /* @__PURE__ */
|
|
118
|
+
children: /* @__PURE__ */ l(r, {
|
|
119
119
|
actions: k,
|
|
120
120
|
row: t
|
|
121
121
|
})
|
|
122
122
|
}) : null
|
|
123
123
|
}) : null
|
|
124
124
|
]
|
|
125
|
-
},
|
|
125
|
+
}, n);
|
|
126
126
|
})
|
|
127
127
|
});
|
|
128
128
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AppTabs.d.ts","sourceRoot":"","sources":["../../../../src/components/core/tabs/AppTabs.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAMnD,MAAM,WAAW,YAAY,CAAC,CAAC,GAAG,OAAO;IACvC,IAAI,EAAE,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,IAAI,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC;IAChB,GAAG,CAAC,EAAE,OAAO,CAAC;IAId,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,wBAAgB,OAAO,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,EAAE,SAAiB,EAAE,EAAE,YAAY,GAAG,KAAK,CAAC,GAAG,CAAC,OAAO,
|
|
1
|
+
{"version":3,"file":"AppTabs.d.ts","sourceRoot":"","sources":["../../../../src/components/core/tabs/AppTabs.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAMnD,MAAM,WAAW,YAAY,CAAC,CAAC,GAAG,OAAO;IACvC,IAAI,EAAE,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,IAAI,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC;IAChB,GAAG,CAAC,EAAE,OAAO,CAAC;IAId,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,wBAAgB,OAAO,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,EAAE,SAAiB,EAAE,EAAE,YAAY,GAAG,KAAK,CAAC,GAAG,CAAC,OAAO,CAkDvG"}
|
|
@@ -3,26 +3,26 @@ import { useKrosoftTranslation as i } from "../../../i18n/useKrosoftTranslation.
|
|
|
3
3
|
import { cn as a } from "../../../helpers/tailwind.helper.js";
|
|
4
4
|
import { useEffect as o, useRef as s } from "react";
|
|
5
5
|
import { jsx as c, jsxs as l } from "react/jsx-runtime";
|
|
6
|
-
import {
|
|
6
|
+
import { useLocation as u, useSearchParams as d } from "react-router-dom";
|
|
7
7
|
// src/components/core/tabs/AppTabs.tsx
|
|
8
|
-
function
|
|
9
|
-
let { t:
|
|
10
|
-
let t = new URLSearchParams(
|
|
11
|
-
t.set(
|
|
12
|
-
},
|
|
8
|
+
function f({ tabs: f, itemId: p, item: m, fit: h, paramName: g = "tab" }) {
|
|
9
|
+
let { t: _ } = i(), [v, y] = d(), b = u(), x = v.get(g), S = f.find((e) => e.value === x)?.value ?? f[0]?.value, C = (e) => {
|
|
10
|
+
let t = new URLSearchParams(v);
|
|
11
|
+
t.set(g, e), y(t, { state: b.state });
|
|
12
|
+
}, w = s(null);
|
|
13
13
|
return o(() => {
|
|
14
|
-
(
|
|
14
|
+
(w.current?.querySelector("[data-state=\"active\"]"))?.scrollIntoView?.({
|
|
15
15
|
behavior: "smooth",
|
|
16
16
|
block: "nearest",
|
|
17
17
|
inline: "nearest"
|
|
18
18
|
});
|
|
19
|
-
}, [
|
|
20
|
-
value:
|
|
21
|
-
onValueChange:
|
|
19
|
+
}, [S]), /* @__PURE__ */ l(e, {
|
|
20
|
+
value: S,
|
|
21
|
+
onValueChange: C,
|
|
22
22
|
children: [/* @__PURE__ */ c(n, {
|
|
23
|
-
ref:
|
|
24
|
-
className: a("w-full justify-start",
|
|
25
|
-
children:
|
|
23
|
+
ref: w,
|
|
24
|
+
className: a("w-full justify-start", h && "sm:w-fit"),
|
|
25
|
+
children: f.map((e) => /* @__PURE__ */ l(r, {
|
|
26
26
|
value: e.value,
|
|
27
27
|
className: "gap-2",
|
|
28
28
|
disabled: e.disabled,
|
|
@@ -33,23 +33,23 @@ function d({ tabs: d, itemId: f, item: p, fit: m, paramName: h = "tab" }) {
|
|
|
33
33
|
}) : null,
|
|
34
34
|
/* @__PURE__ */ c("span", {
|
|
35
35
|
className: "text-xs sm:text-sm",
|
|
36
|
-
children:
|
|
36
|
+
children: _(e.titleKey) ?? ""
|
|
37
37
|
}),
|
|
38
38
|
e.count ? /* @__PURE__ */ l("span", {
|
|
39
39
|
className: "text-gray-500 text-xs",
|
|
40
40
|
children: [
|
|
41
41
|
"(",
|
|
42
|
-
e.count(
|
|
42
|
+
e.count(m),
|
|
43
43
|
")"
|
|
44
44
|
]
|
|
45
45
|
}) : null
|
|
46
46
|
]
|
|
47
47
|
}, e.value))
|
|
48
|
-
}),
|
|
48
|
+
}), f.map((e) => /* @__PURE__ */ c(t, {
|
|
49
49
|
value: e.value,
|
|
50
50
|
className: "mt-4",
|
|
51
|
-
children: e.component ? e.component(
|
|
51
|
+
children: e.component ? e.component(p) : null
|
|
52
52
|
}, e.value))]
|
|
53
53
|
});
|
|
54
54
|
}
|
|
55
|
-
export {
|
|
55
|
+
export { f as AppTabs };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AppVerticalTabs.d.ts","sourceRoot":"","sources":["../../../../src/components/core/tabs/AppVerticalTabs.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAKnD,MAAM,WAAW,oBAAoB,CAAC,CAAC,GAAG,OAAO;IAC/C,IAAI,EAAE,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC;IACrB,IAAI,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC;CACjB;AAED,eAAO,MAAM,eAAe,GAAI,gBAAgB,oBAAoB,KAAG,KAAK,CAAC,GAAG,CAAC,
|
|
1
|
+
{"version":3,"file":"AppVerticalTabs.d.ts","sourceRoot":"","sources":["../../../../src/components/core/tabs/AppVerticalTabs.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAKnD,MAAM,WAAW,oBAAoB,CAAC,CAAC,GAAG,OAAO;IAC/C,IAAI,EAAE,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC;IACrB,IAAI,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC;CACjB;AAED,eAAO,MAAM,eAAe,GAAI,gBAAgB,oBAAoB,KAAG,KAAK,CAAC,GAAG,CAAC,OA0FhF,CAAC"}
|
|
@@ -3,16 +3,16 @@ import { Select as t, SelectContent as n, SelectItem as r, SelectTrigger as i, S
|
|
|
3
3
|
import { useKrosoftTranslation as o } from "../../../i18n/useKrosoftTranslation.js";
|
|
4
4
|
import { jsx as s, jsxs as c } from "react/jsx-runtime";
|
|
5
5
|
import { ConstructionIcon as l } from "lucide-react";
|
|
6
|
-
import {
|
|
6
|
+
import { useLocation as u, useSearchParams as d } from "react-router-dom";
|
|
7
7
|
// src/components/core/tabs/AppVerticalTabs.tsx
|
|
8
|
-
var
|
|
9
|
-
let { t:
|
|
8
|
+
var f = ({ tabs: f, item: p }) => {
|
|
9
|
+
let { t: m } = o(), [h, g] = d(), _ = u(), v = h.get("tab"), y = f.find((e) => e.value === v)?.value ?? f[0]?.value, b = (e) => {
|
|
10
10
|
let t = new URLSearchParams();
|
|
11
|
-
t.set("tab", e),
|
|
12
|
-
},
|
|
13
|
-
let e =
|
|
14
|
-
return e ? e.component ? e.component() :
|
|
15
|
-
},
|
|
11
|
+
t.set("tab", e), g(t, { state: _.state });
|
|
12
|
+
}, x = () => {
|
|
13
|
+
let e = f.find((e) => e.value === y);
|
|
14
|
+
return e ? e.component ? e.component() : S() : null;
|
|
15
|
+
}, S = () => /* @__PURE__ */ s("div", {
|
|
16
16
|
className: "p-4 lg:p-6",
|
|
17
17
|
children: /* @__PURE__ */ s("div", {
|
|
18
18
|
className: "flex items-center justify-center h-64 text-gray-500",
|
|
@@ -22,11 +22,11 @@ var d = ({ tabs: d, item: f }) => {
|
|
|
22
22
|
/* @__PURE__ */ s(l, { className: "h-12 w-12 mx-auto mb-4 text-amber-500" }),
|
|
23
23
|
/* @__PURE__ */ s("p", {
|
|
24
24
|
className: "text-lg font-medium",
|
|
25
|
-
children:
|
|
25
|
+
children: m("states.underConstruction")
|
|
26
26
|
}),
|
|
27
27
|
/* @__PURE__ */ s("p", {
|
|
28
28
|
className: "text-sm text-gray-400",
|
|
29
|
-
children:
|
|
29
|
+
children: m("states.comingSoon")
|
|
30
30
|
})
|
|
31
31
|
]
|
|
32
32
|
})
|
|
@@ -41,20 +41,22 @@ var d = ({ tabs: d, item: f }) => {
|
|
|
41
41
|
className: "h-full",
|
|
42
42
|
children: /* @__PURE__ */ s("div", {
|
|
43
43
|
className: "space-y-1",
|
|
44
|
-
children:
|
|
45
|
-
className: `px-2 py-2 rounded-control text-sm transition-colors flex items-center gap-2 ${e.disabled ? "text-gray-400 cursor-not-allowed opacity-50" :
|
|
46
|
-
onClick: () =>
|
|
44
|
+
children: f.map((e, t) => /* @__PURE__ */ c("div", {
|
|
45
|
+
className: `px-2 py-2 rounded-control text-sm transition-colors flex items-center gap-2 ${e.disabled ? "text-gray-400 cursor-not-allowed opacity-50" : y === e.value ? "crm-color-styled font-medium cursor-pointer" : "text-gray-600 hover:bg-gray-100 dark:text-gray-300 dark:hover:bg-gray-700 cursor-pointer"}`,
|
|
46
|
+
onClick: () => {
|
|
47
|
+
e.disabled || b(e.value);
|
|
48
|
+
},
|
|
47
49
|
children: [
|
|
48
50
|
e.icon && /* @__PURE__ */ s(e.icon, { className: "size-4" }),
|
|
49
51
|
/* @__PURE__ */ s("span", {
|
|
50
52
|
className: "flex-1",
|
|
51
|
-
children:
|
|
53
|
+
children: m(e.titleKey)
|
|
52
54
|
}),
|
|
53
55
|
e.count && /* @__PURE__ */ c("span", {
|
|
54
56
|
className: "text-xs text-gray-500",
|
|
55
57
|
children: [
|
|
56
58
|
"(",
|
|
57
|
-
e.count(
|
|
59
|
+
e.count(p),
|
|
58
60
|
")"
|
|
59
61
|
]
|
|
60
62
|
}),
|
|
@@ -67,24 +69,24 @@ var d = ({ tabs: d, item: f }) => {
|
|
|
67
69
|
/* @__PURE__ */ s("div", {
|
|
68
70
|
className: "md:hidden w-full border-b pb-4 mb-4",
|
|
69
71
|
children: /* @__PURE__ */ c(t, {
|
|
70
|
-
value:
|
|
71
|
-
onValueChange:
|
|
72
|
+
value: y,
|
|
73
|
+
onValueChange: b,
|
|
72
74
|
children: [/* @__PURE__ */ s(i, {
|
|
73
75
|
className: "w-full",
|
|
74
|
-
children: /* @__PURE__ */ s(a, { placeholder:
|
|
75
|
-
}), /* @__PURE__ */ s(n, { children:
|
|
76
|
+
children: /* @__PURE__ */ s(a, { placeholder: m("select.section") })
|
|
77
|
+
}), /* @__PURE__ */ s(n, { children: f.map((e, t) => /* @__PURE__ */ s(r, {
|
|
76
78
|
value: e.value,
|
|
77
79
|
disabled: e.disabled,
|
|
78
80
|
children: /* @__PURE__ */ c("div", {
|
|
79
81
|
className: "flex items-center gap-2",
|
|
80
82
|
children: [
|
|
81
83
|
e.icon && /* @__PURE__ */ s(e.icon, { className: "size-4" }),
|
|
82
|
-
/* @__PURE__ */ s("span", { children:
|
|
84
|
+
/* @__PURE__ */ s("span", { children: m(e.titleKey) }),
|
|
83
85
|
e.count && /* @__PURE__ */ c("span", {
|
|
84
86
|
className: "text-xs text-gray-500",
|
|
85
87
|
children: [
|
|
86
88
|
"(",
|
|
87
|
-
e.count(
|
|
89
|
+
e.count(p),
|
|
88
90
|
")"
|
|
89
91
|
]
|
|
90
92
|
}),
|
|
@@ -96,9 +98,9 @@ var d = ({ tabs: d, item: f }) => {
|
|
|
96
98
|
}),
|
|
97
99
|
/* @__PURE__ */ s("div", {
|
|
98
100
|
className: "flex-1 md:px-4 min-w-0 overflow-auto",
|
|
99
|
-
children:
|
|
101
|
+
children: x()
|
|
100
102
|
})
|
|
101
103
|
]
|
|
102
104
|
});
|
|
103
105
|
};
|
|
104
|
-
export {
|
|
106
|
+
export { f as AppVerticalTabs };
|
package/dist/helpers/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/helpers/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC;AAClC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,mBAAmB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/helpers/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC;AAClC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC"}
|
package/dist/helpers/index.js
CHANGED
|
@@ -3,4 +3,5 @@ import { cn as o } from "./tailwind.helper.js";
|
|
|
3
3
|
import { applyTableStateToQuery as s, mapNestedRelationMany as c, mapNestedRelationOne as l } from "./supabase.helper.js";
|
|
4
4
|
import { ACTIONS_COLUMN_KEY as u, SELECTION_COLUMN_KEY as d, getAlignmentClass as f, getColumnAlignment as p, getFixedCellProps as m, localStorageColumnVisibility as h } from "./table.helper.js";
|
|
5
5
|
import { rehypeVersionSlug as g } from "./markdown.helper.js";
|
|
6
|
-
|
|
6
|
+
import { buildBackState as _, isBackNavigationState as v } from "./navigation.helper.js";
|
|
7
|
+
export { u as ACTIONS_COLUMN_KEY, d as SELECTION_COLUMN_KEY, s as applyTableStateToQuery, _ as buildBackState, o as cn, e as filterChangelog, f as getAlignmentClass, t as getChangelogItemAnchors, n as getChangelogTags, p as getColumnAlignment, m as getFixedCellProps, v as isBackNavigationState, h as localStorageColumnVisibility, c as mapNestedRelationMany, l as mapNestedRelationOne, r as parseChangelog, g as rehypeVersionSlug, i as slugifyChangelogTitle, a as splitChangelogItems };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { BackNavigationState } from "../types/BackNavigationState.js";
|
|
2
|
+
import type { Location } from "react-router-dom";
|
|
3
|
+
/** Construit le state à passer à `navigate`/`Link` pour que la page cible puisse revenir à l'URL courante. */
|
|
4
|
+
export declare const buildBackState: (location: Pick<Location, "pathname" | "search">) => BackNavigationState;
|
|
5
|
+
/** Indique si un `location.state` inconnu porte une URL de retour. */
|
|
6
|
+
export declare const isBackNavigationState: (state: unknown) => state is BackNavigationState;
|
|
7
|
+
//# sourceMappingURL=navigation.helper.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"navigation.helper.d.ts","sourceRoot":"","sources":["../../src/helpers/navigation.helper.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AACvE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAEjD,8GAA8G;AAC9G,eAAO,MAAM,cAAc,GAAI,UAAU,IAAI,CAAC,QAAQ,EAAE,UAAU,GAAG,QAAQ,CAAC,KAAG,mBAE/E,CAAC;AAEH,sEAAsE;AACtE,eAAO,MAAM,qBAAqB,GAAI,OAAO,OAAO,KAAG,KAAK,IAAI,mBACkC,CAAC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export { useBackNavigation } from "./useBackNavigation";
|
|
1
2
|
export { useConfirmationDialog } from "./useConfirmationDialog";
|
|
2
3
|
export { useConfirmDeleteDialog } from "./useConfirmDeleteDialog";
|
|
3
4
|
export { useCopyToClipboard } from "./useCopyToClipboard";
|
|
@@ -5,6 +6,7 @@ export type { UseCopyToClipboardOptions, UseCopyToClipboardResult } from "./useC
|
|
|
5
6
|
export { useDebounce } from "./useDebounce";
|
|
6
7
|
export { useDebouncedValue } from "./useDebouncedValue";
|
|
7
8
|
export { useDialog } from "./useDialog";
|
|
9
|
+
export { useNavigateWithBack } from "./useNavigateWithBack";
|
|
8
10
|
export type { DialogState } from "./useDialog";
|
|
9
11
|
export { usePage } from "./usePage";
|
|
10
12
|
export { useSidebar } from "./useSidebar";
|
|
@@ -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,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,YAAY,EAAE,yBAAyB,EAAE,wBAAwB,EAAE,MAAM,sBAAsB,CAAC;AAChG,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,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,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,cAAc,EAAE,kBAAkB,EAAE,eAAe,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/hooks/behavior/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,YAAY,EAAE,yBAAyB,EAAE,wBAAwB,EAAE,MAAM,sBAAsB,CAAC;AAChG,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,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,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,cAAc,EAAE,kBAAkB,EAAE,eAAe,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC"}
|
|
@@ -1,11 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
|
|
1
|
+
import { useBackNavigation as e } from "./useBackNavigation.js";
|
|
2
|
+
import { useConfirmationDialog as t } from "./useConfirmationDialog.js";
|
|
3
|
+
import { useConfirmDeleteDialog as n } from "./useConfirmDeleteDialog.js";
|
|
4
|
+
import { useCopyToClipboard as r } from "./useCopyToClipboard.js";
|
|
5
|
+
import { useDebounce as i } from "./useDebounce.js";
|
|
6
|
+
import { useDebouncedValue as a } from "./useDebouncedValue.js";
|
|
7
|
+
import { useDialog as o } from "./useDialog.js";
|
|
8
|
+
import { useNavigateWithBack as s } from "./useNavigateWithBack.js";
|
|
9
|
+
import { usePage as c } from "./usePage.js";
|
|
10
|
+
import { useSidebar as l } from "./useSidebar.js";
|
|
11
|
+
import { useTable as u } from "./useTable.js";
|
|
12
|
+
import { URL_DATE_FORMAT as d, parseDateRange as f, serializeDateRange as p, useUrlArrayState as m, useUrlDateRangeState as h, useUrlNumberState as g, useUrlState as _ } from "./useUrlState.js";
|
|
13
|
+
export { d as URL_DATE_FORMAT, f as parseDateRange, p as serializeDateRange, e as useBackNavigation, n as useConfirmDeleteDialog, t as useConfirmationDialog, r as useCopyToClipboard, i as useDebounce, a as useDebouncedValue, o as useDialog, s as useNavigateWithBack, c as usePage, l as useSidebar, u as useTable, m as useUrlArrayState, h as useUrlDateRangeState, g as useUrlNumberState, _ as useUrlState };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Retour vers l'URL d'origine transmise dans `location.state.from` (voir `buildBackState`),
|
|
3
|
+
* ou vers `fallbackPath` quand la page a été ouverte directement.
|
|
4
|
+
* L'URL d'origine est mémorisée tant que le pathname ne change pas : un `setSearchParams` sans state
|
|
5
|
+
* (onglets, filtres) ne la perd pas.
|
|
6
|
+
*/
|
|
7
|
+
export declare function useBackNavigation(fallbackPath: string): () => void;
|
|
8
|
+
//# sourceMappingURL=useBackNavigation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useBackNavigation.d.ts","sourceRoot":"","sources":["../../../src/hooks/behavior/useBackNavigation.ts"],"names":[],"mappings":"AAIA;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM,IAAI,CAelE"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { isBackNavigationState as e } from "../../helpers/navigation.helper.js";
|
|
2
|
+
import { useCallback as t, useState as n } from "react";
|
|
3
|
+
import { useLocation as r, useNavigate as i } from "react-router-dom";
|
|
4
|
+
// src/hooks/behavior/useBackNavigation.ts
|
|
5
|
+
function a(a) {
|
|
6
|
+
let o = i(), { pathname: s, state: c } = r(), l = e(c) ? c.from : void 0, [u, d] = n({
|
|
7
|
+
pathname: s,
|
|
8
|
+
from: l
|
|
9
|
+
});
|
|
10
|
+
(u.pathname !== s || l !== void 0 && l !== u.from) && d({
|
|
11
|
+
pathname: s,
|
|
12
|
+
from: l
|
|
13
|
+
});
|
|
14
|
+
let f = (u.pathname === s ? u.from : l) ?? a;
|
|
15
|
+
return t(() => {
|
|
16
|
+
o(f);
|
|
17
|
+
}, [o, f]);
|
|
18
|
+
}
|
|
19
|
+
export { a as useBackNavigation };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type React from "react";
|
|
2
|
+
/**
|
|
3
|
+
* Navigue vers `url` en transmettant l'URL courante comme URL de retour (lue par `useBackNavigation`).
|
|
4
|
+
* Ctrl/Cmd + clic ouvre l'URL dans un nouvel onglet, comme un lien natif.
|
|
5
|
+
*/
|
|
6
|
+
export declare function useNavigateWithBack(): (url: string, event?: React.MouseEvent) => void;
|
|
7
|
+
//# sourceMappingURL=useNavigateWithBack.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useNavigateWithBack.d.ts","sourceRoot":"","sources":["../../../src/hooks/behavior/useNavigateWithBack.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAK/B;;;GAGG;AACH,wBAAgB,mBAAmB,IAAI,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,KAAK,CAAC,UAAU,KAAK,IAAI,CAcrF"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { buildBackState as e } from "../../helpers/navigation.helper.js";
|
|
2
|
+
import { useCallback as t } from "react";
|
|
3
|
+
import { useLocation as n, useNavigate as r } from "react-router-dom";
|
|
4
|
+
// src/hooks/behavior/useNavigateWithBack.ts
|
|
5
|
+
function i() {
|
|
6
|
+
let i = r(), a = n();
|
|
7
|
+
return t((t, n) => {
|
|
8
|
+
n?.ctrlKey === !0 || n?.metaKey === !0 ? window.open(t, "_blank") : i(t, { state: e(a) });
|
|
9
|
+
}, [i, a]);
|
|
10
|
+
}
|
|
11
|
+
export { i as useNavigateWithBack };
|
package/dist/hooks/index.js
CHANGED
|
@@ -9,13 +9,15 @@ import { useFixedColumns as c } from "./ui/useFixedColumns.js";
|
|
|
9
9
|
import { useLanguage as l } from "./ui/useLanguage.js";
|
|
10
10
|
import { useServerTable as u } from "./ui/useServerTable.js";
|
|
11
11
|
import { useTheme as d } from "./ui/useTheme.js";
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
|
|
12
|
+
import { useBackNavigation as f } from "./behavior/useBackNavigation.js";
|
|
13
|
+
import { useDialog as p } from "./behavior/useDialog.js";
|
|
14
|
+
import { useConfirmationDialog as m } from "./behavior/useConfirmationDialog.js";
|
|
15
|
+
import { useConfirmDeleteDialog as h } from "./behavior/useConfirmDeleteDialog.js";
|
|
16
|
+
import { useDebounce as g } from "./behavior/useDebounce.js";
|
|
17
|
+
import { useDebouncedValue as _ } from "./behavior/useDebouncedValue.js";
|
|
18
|
+
import { useNavigateWithBack as v } from "./behavior/useNavigateWithBack.js";
|
|
19
|
+
import { usePage as y } from "./behavior/usePage.js";
|
|
20
|
+
import { useSidebar as b } from "./behavior/useSidebar.js";
|
|
21
|
+
import { useTable as x } from "./behavior/useTable.js";
|
|
22
|
+
import { URL_DATE_FORMAT as S, parseDateRange as C, serializeDateRange as w, useUrlArrayState as T, useUrlDateRangeState as E, useUrlNumberState as D, useUrlState as O } from "./behavior/useUrlState.js";
|
|
23
|
+
export { S as URL_DATE_FORMAT, C as parseDateRange, w as serializeDateRange, t as toast, f as useBackNavigation, h as useConfirmDeleteDialog, m as useConfirmationDialog, i as useCopyToClipboard, o as useDataTable, g as useDebounce, _ as useDebouncedValue, p as useDialog, s as useDocumentTitle, c as useFixedColumns, l as useLanguage, a as useMobile, v as useNavigateWithBack, r as useNotifications, y as usePage, e as useScrollFade, u as useServerTable, b as useSidebar, x as useTable, d as useTheme, n as useToast, T as useUrlArrayState, E as useUrlDateRangeState, D as useUrlNumberState, O as useUrlState };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BackNavigationState.d.ts","sourceRoot":"","sources":["../../src/types/BackNavigationState.ts"],"names":[],"mappings":"AAAA,+GAA+G;AAC/G,MAAM,MAAM,mBAAmB,GAAG;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC"}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,qBAAqB,CAAC;AACpC,cAAc,kBAAkB,CAAC;AACjC,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC;AAC7B,cAAc,uBAAuB,CAAC;AACtC,cAAc,uBAAuB,CAAC;AACtC,cAAc,mBAAmB,CAAC;AAClC,cAAc,kCAAkC,CAAC;AACjD,cAAc,oCAAoC,CAAC;AACnD,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC;AACpC,cAAc,sBAAsB,CAAC;AACrC,cAAc,wBAAwB,CAAC;AACvC,cAAc,kBAAkB,CAAC;AACjC,cAAc,qBAAqB,CAAC;AACpC,cAAc,iBAAiB,CAAC;AAChC,cAAc,SAAS,CAAC;AACxB,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,uBAAuB,CAAC;AACtC,cAAc,qBAAqB,CAAC;AACpC,cAAc,kBAAkB,CAAC;AACjC,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC;AAC7B,cAAc,uBAAuB,CAAC;AACtC,cAAc,uBAAuB,CAAC;AACtC,cAAc,mBAAmB,CAAC;AAClC,cAAc,kCAAkC,CAAC;AACjD,cAAc,oCAAoC,CAAC;AACnD,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC;AACpC,cAAc,sBAAsB,CAAC;AACrC,cAAc,wBAAwB,CAAC;AACvC,cAAc,kBAAkB,CAAC;AACjC,cAAc,qBAAqB,CAAC;AACpC,cAAc,iBAAiB,CAAC;AAChC,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC;AAC5B,cAAc,qBAAqB,CAAC;AACpC,cAAc,sBAAsB,CAAC"}
|