@krosoft/react 0.0.428 → 0.0.429

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.
Files changed (29) hide show
  1. package/dist/components/core/table/JsonTableOutput.d.ts.map +1 -1
  2. package/dist/components/core/table/JsonTableOutput.js +46 -42
  3. package/dist/components/core/table/TableBody.d.ts.map +1 -1
  4. package/dist/components/core/table/TableBody.js +37 -37
  5. package/dist/components/core/tabs/AppTabs.d.ts.map +1 -1
  6. package/dist/components/core/tabs/AppTabs.js +18 -18
  7. package/dist/components/core/tabs/AppVerticalTabs.d.ts.map +1 -1
  8. package/dist/components/core/tabs/AppVerticalTabs.js +23 -23
  9. package/dist/helpers/index.d.ts +1 -0
  10. package/dist/helpers/index.d.ts.map +1 -1
  11. package/dist/helpers/index.js +2 -1
  12. package/dist/helpers/navigation.helper.d.ts +7 -0
  13. package/dist/helpers/navigation.helper.d.ts.map +1 -0
  14. package/dist/helpers/navigation.helper.js +3 -0
  15. package/dist/hooks/behavior/index.d.ts +2 -0
  16. package/dist/hooks/behavior/index.d.ts.map +1 -1
  17. package/dist/hooks/behavior/index.js +13 -11
  18. package/dist/hooks/behavior/useBackNavigation.d.ts +8 -0
  19. package/dist/hooks/behavior/useBackNavigation.d.ts.map +1 -0
  20. package/dist/hooks/behavior/useBackNavigation.js +19 -0
  21. package/dist/hooks/behavior/useNavigateWithBack.d.ts +7 -0
  22. package/dist/hooks/behavior/useNavigateWithBack.d.ts.map +1 -0
  23. package/dist/hooks/behavior/useNavigateWithBack.js +11 -0
  24. package/dist/hooks/index.js +12 -10
  25. package/dist/types/BackNavigationState.d.ts +5 -0
  26. package/dist/types/BackNavigationState.d.ts.map +1 -0
  27. package/dist/types/index.d.ts +1 -0
  28. package/dist/types/index.d.ts.map +1 -1
  29. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"JsonTableOutput.d.ts","sourceRoot":"","sources":["../../../../src/components/core/table/JsonTableOutput.tsx"],"names":[],"mappings":"AAGA,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,IAwG9F,CAAC"}
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 { Label as e } from "../../ui/label.js";
2
- import { SimpleTable as t, SimpleTableBody as n, SimpleTableCell as r, SimpleTableHead as i, SimpleTableHeader as a, SimpleTableRow as o } from "../../ui/simple-table.js";
3
- import { Switch as s } from "../../ui/switch.js";
4
- import { useKrosoftTranslation as c } from "../../../i18n/useKrosoftTranslation.js";
5
- import { useState as l } from "react";
6
- import { jsx as u, jsxs as d } from "react/jsx-runtime";
7
- import { formatJsonValue as f, isRecord as p, tryParseJson as m } from "@krosoft/core/helpers";
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 h = ({ header: h, output: g }) => {
10
- let { t: _ } = c(), [v, y] = l(!0), b = m(g), x = b !== null, S = () => /* @__PURE__ */ d("div", {
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__ */ u("span", {
16
+ children: [/* @__PURE__ */ d("span", {
13
17
  className: "font-medium text-sm",
14
- children: h
15
- }), /* @__PURE__ */ d("div", {
18
+ children: g
19
+ }), /* @__PURE__ */ f("div", {
16
20
  className: "flex items-center gap-2",
17
- children: [/* @__PURE__ */ u(s, {
21
+ children: [/* @__PURE__ */ d(c, {
18
22
  id: "table-mode",
19
- checked: v,
20
- onCheckedChange: y
21
- }), /* @__PURE__ */ u(e, {
23
+ checked: y,
24
+ onCheckedChange: b
25
+ }), /* @__PURE__ */ d(t, {
22
26
  htmlFor: "table-mode",
23
27
  className: "text-xs",
24
- children: _("table.tableMode")
28
+ children: v("table.tableMode")
25
29
  })]
26
30
  })]
27
- }), C = ({ children: e }) => /* @__PURE__ */ u("div", {
31
+ }), T = ({ children: e }) => /* @__PURE__ */ d("div", {
28
32
  className: "border rounded min-w-0 w-full",
29
- children: /* @__PURE__ */ u(t, { children: e })
30
- }), w = () => /* @__PURE__ */ u("pre", {
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: x && !v ? JSON.stringify(b, null, 2) : g
36
+ children: S && !y ? JSON.stringify(x, null, 2) : _
33
37
  });
34
- return g ? /* @__PURE__ */ d("div", {
38
+ return _ ? /* @__PURE__ */ f("div", {
35
39
  className: "min-w-0 w-full",
36
- children: [S(), (() => {
37
- if (!x || !v) return /* @__PURE__ */ u(w, {});
38
- if (Array.isArray(b) && b.length > 0 && p(b[0])) {
39
- let e = b, t = Object.keys(e[0]);
40
- return /* @__PURE__ */ d(C, { children: [/* @__PURE__ */ u(a, {
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__ */ u(o, { children: t.map((e) => /* @__PURE__ */ u(i, {
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__ */ u(n, { children: e.map((e, n) => /* @__PURE__ */ u(o, { children: t.map((t) => /* @__PURE__ */ u(r, {
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: f(e[t])
52
+ children: p(e[t])
49
53
  }, t)) }, n)) })] });
50
54
  }
51
- if (p(b)) {
52
- let e = Object.entries(b);
53
- return /* @__PURE__ */ d(C, { children: [/* @__PURE__ */ u(a, {
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__ */ d(o, { children: [/* @__PURE__ */ u(i, {
59
+ children: /* @__PURE__ */ f(s, { children: [/* @__PURE__ */ d(a, {
56
60
  className: "font-medium",
57
- children: _("table.property")
58
- }), /* @__PURE__ */ u(i, {
61
+ children: v("table.property")
62
+ }), /* @__PURE__ */ d(a, {
59
63
  className: "font-medium",
60
- children: _("table.value")
64
+ children: v("table.value")
61
65
  })] })
62
- }), /* @__PURE__ */ u(n, { children: e.map(([e, t]) => /* @__PURE__ */ d(o, { children: [/* @__PURE__ */ u(r, {
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__ */ u(r, {
69
+ }), /* @__PURE__ */ d(i, {
66
70
  className: "text-sm whitespace-pre-wrap",
67
- children: f(t)
71
+ children: C(t)
68
72
  })] }, e)) })] });
69
73
  }
70
- return /* @__PURE__ */ u(w, {});
74
+ return /* @__PURE__ */ d(E, {});
71
75
  })()]
72
76
  }) : null;
73
77
  };
74
- export { h as JsonTableOutput };
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;AAEpE,OAAO,EAAE,eAAe,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAEjF,OAAO,KAAK,MAAM,OAAO,CAAC;AAK1B,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,CAiKvC"}
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 { useKrosoftTranslation as t } from "../../../i18n/useKrosoftTranslation.js";
3
- import { TableActions as n } from "./TableActions.js";
4
- import { ACTIONS_COLUMN_KEY as r, SELECTION_COLUMN_KEY as i, getAlignmentClass as a, getColumnAlignment as o, getFixedCellProps as s } from "../../../helpers/table.helper.js";
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 c, jsxs as l } from "react/jsx-runtime";
7
- import { AlertTriangleIcon as u, Loader2Icon as d } from "lucide-react";
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 } = t(), I = F(g?.loadingKey ?? "states.loading"), L = F(g?.emptyKey ?? "states.noResult"), R = f(), z = (e, t) => {
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__ */ c("span", {
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__ */ c("tbody", {
20
+ if (p) return /* @__PURE__ */ l("tbody", {
21
21
  className: "divide-y divide-border",
22
- children: /* @__PURE__ */ c("tr", { children: /* @__PURE__ */ c("td", {
22
+ children: /* @__PURE__ */ l("tr", { children: /* @__PURE__ */ l("td", {
23
23
  colSpan: h,
24
24
  className: "py-8 text-center",
25
- children: /* @__PURE__ */ l("div", {
25
+ children: /* @__PURE__ */ u("div", {
26
26
  className: "flex flex-col items-center justify-center gap-2 text-muted-foreground",
27
- children: [/* @__PURE__ */ c(d, { className: "h-6 w-6 animate-spin text-primary" }), /* @__PURE__ */ c("span", {
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__ */ c("tbody", {
34
+ if (m) return /* @__PURE__ */ l("tbody", {
35
35
  className: "divide-y divide-border",
36
- children: /* @__PURE__ */ c("tr", { children: /* @__PURE__ */ c("td", {
36
+ children: /* @__PURE__ */ l("tr", { children: /* @__PURE__ */ l("td", {
37
37
  colSpan: h,
38
38
  className: "py-8 text-center",
39
- children: /* @__PURE__ */ l("div", {
39
+ children: /* @__PURE__ */ u("div", {
40
40
  className: "flex flex-col items-center justify-center gap-2 text-destructive",
41
- children: [/* @__PURE__ */ c(u, { className: "h-6 w-6" }), /* @__PURE__ */ c("span", {
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__ */ c("tbody", {
48
+ if (_.length === 0) return /* @__PURE__ */ l("tbody", {
49
49
  className: "divide-y divide-border",
50
- children: /* @__PURE__ */ c("tr", { children: /* @__PURE__ */ c("td", {
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 = s(P[i], "body"), V = s(P[r], "body"), H = S && w.size > 0, U = (e) => {
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) : n.ctrlKey || n.metaKey ? window.open(t, "_blank") : R(t);
59
+ H ? T(e) : t === void 0 ? y?.(e, n) : R(t, n);
60
60
  };
61
- return /* @__PURE__ */ c("tbody", {
61
+ return /* @__PURE__ */ l("tbody", {
62
62
  className: "divide-y divide-border",
63
63
  children: _.map((t) => {
64
- let r = v(t), i = C === void 0 || C(t), u = U(t);
65
- return /* @__PURE__ */ l("tr", {
66
- className: `group hover:bg-muted/50 transition-colors ${H || u !== void 0 || y !== void 0 ? "cursor-pointer" : ""}`,
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, u, e);
68
+ W(t, a, e);
69
69
  },
70
70
  children: [
71
- S ? /* @__PURE__ */ c("td", {
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__ */ c("div", {
82
+ children: /* @__PURE__ */ l("div", {
83
83
  className: "flex items-center justify-center",
84
- children: /* @__PURE__ */ c(e, {
85
- checked: w.has(r),
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 = s(P[e.key], "body");
95
- return /* @__PURE__ */ c("td", {
96
- className: `${`${n === 0 && !S ? "pl-4" : "pl-2"} ${r && !O ? "pr-4" : "pr-2"}`} ${M ? "py-2" : "py-4"} text-sm ${a(o(e))} ${i.className} ${j && !r ? "border-r border-border" : ""} ${e.className ?? ""}`,
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__ */ c("div", {
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__ */ c("td", {
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__ */ c("div", {
116
+ children: k !== void 0 && k.length > 0 ? /* @__PURE__ */ l("div", {
117
117
  className: "flex items-center justify-end",
118
- children: /* @__PURE__ */ c(n, {
118
+ children: /* @__PURE__ */ l(r, {
119
119
  actions: k,
120
120
  row: t
121
121
  })
122
122
  }) : null
123
123
  }) : null
124
124
  ]
125
- }, r);
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,CAgDvG"}
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 { useSearchParams as u } from "react-router-dom";
6
+ import { useLocation as u, useSearchParams as d } from "react-router-dom";
7
7
  // src/components/core/tabs/AppTabs.tsx
8
- function d({ tabs: d, itemId: f, item: p, fit: m, paramName: h = "tab" }) {
9
- let { t: g } = i(), [_, v] = u(), y = _.get(h), b = d.find((e) => e.value === y)?.value ?? d[0]?.value, x = (e) => {
10
- let t = new URLSearchParams(_);
11
- t.set(h, e), v(t);
12
- }, S = s(null);
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
- (S.current?.querySelector("[data-state=\"active\"]"))?.scrollIntoView?.({
14
+ (w.current?.querySelector("[data-state=\"active\"]"))?.scrollIntoView?.({
15
15
  behavior: "smooth",
16
16
  block: "nearest",
17
17
  inline: "nearest"
18
18
  });
19
- }, [b]), /* @__PURE__ */ l(e, {
20
- value: b,
21
- onValueChange: x,
19
+ }, [S]), /* @__PURE__ */ l(e, {
20
+ value: S,
21
+ onValueChange: C,
22
22
  children: [/* @__PURE__ */ c(n, {
23
- ref: S,
24
- className: a("w-full justify-start", m && "sm:w-fit"),
25
- children: d.map((e) => /* @__PURE__ */ l(r, {
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: g(e.titleKey) ?? ""
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(p),
42
+ e.count(m),
43
43
  ")"
44
44
  ]
45
45
  }) : null
46
46
  ]
47
47
  }, e.value))
48
- }), d.map((e) => /* @__PURE__ */ c(t, {
48
+ }), f.map((e) => /* @__PURE__ */ c(t, {
49
49
  value: e.value,
50
50
  className: "mt-4",
51
- children: e.component ? e.component(f) : null
51
+ children: e.component ? e.component(p) : null
52
52
  }, e.value))]
53
53
  });
54
54
  }
55
- export { d as AppTabs };
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,OAoFhF,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,OAsFhF,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 { useSearchParams as u } from "react-router-dom";
6
+ import { useLocation as u, useSearchParams as d } from "react-router-dom";
7
7
  // src/components/core/tabs/AppVerticalTabs.tsx
8
- var d = ({ tabs: d, item: f }) => {
9
- let { t: p } = o(), [m, h] = u(), g = m.get("tab"), _ = d.find((e) => e.value === g)?.value ?? d[0]?.value, v = (e) => {
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), h(t);
12
- }, y = () => {
13
- let e = d.find((e) => e.value === _);
14
- return e ? e.component ? e.component() : b() : null;
15
- }, b = () => /* @__PURE__ */ s("div", {
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: p("states.underConstruction")
25
+ children: m("states.underConstruction")
26
26
  }),
27
27
  /* @__PURE__ */ s("p", {
28
28
  className: "text-sm text-gray-400",
29
- children: p("states.comingSoon")
29
+ children: m("states.comingSoon")
30
30
  })
31
31
  ]
32
32
  })
@@ -41,20 +41,20 @@ 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: d.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" : _ === 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: () => !e.disabled && v(e.value),
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: () => !e.disabled && b(e.value),
47
47
  children: [
48
48
  e.icon && /* @__PURE__ */ s(e.icon, { className: "size-4" }),
49
49
  /* @__PURE__ */ s("span", {
50
50
  className: "flex-1",
51
- children: p(e.titleKey)
51
+ children: m(e.titleKey)
52
52
  }),
53
53
  e.count && /* @__PURE__ */ c("span", {
54
54
  className: "text-xs text-gray-500",
55
55
  children: [
56
56
  "(",
57
- e.count(f),
57
+ e.count(p),
58
58
  ")"
59
59
  ]
60
60
  }),
@@ -67,24 +67,24 @@ var d = ({ tabs: d, item: f }) => {
67
67
  /* @__PURE__ */ s("div", {
68
68
  className: "md:hidden w-full border-b pb-4 mb-4",
69
69
  children: /* @__PURE__ */ c(t, {
70
- value: _,
71
- onValueChange: v,
70
+ value: y,
71
+ onValueChange: b,
72
72
  children: [/* @__PURE__ */ s(i, {
73
73
  className: "w-full",
74
- children: /* @__PURE__ */ s(a, { placeholder: p("select.section") })
75
- }), /* @__PURE__ */ s(n, { children: d.map((e, t) => /* @__PURE__ */ s(r, {
74
+ children: /* @__PURE__ */ s(a, { placeholder: m("select.section") })
75
+ }), /* @__PURE__ */ s(n, { children: f.map((e, t) => /* @__PURE__ */ s(r, {
76
76
  value: e.value,
77
77
  disabled: e.disabled,
78
78
  children: /* @__PURE__ */ c("div", {
79
79
  className: "flex items-center gap-2",
80
80
  children: [
81
81
  e.icon && /* @__PURE__ */ s(e.icon, { className: "size-4" }),
82
- /* @__PURE__ */ s("span", { children: p(e.titleKey) }),
82
+ /* @__PURE__ */ s("span", { children: m(e.titleKey) }),
83
83
  e.count && /* @__PURE__ */ c("span", {
84
84
  className: "text-xs text-gray-500",
85
85
  children: [
86
86
  "(",
87
- e.count(f),
87
+ e.count(p),
88
88
  ")"
89
89
  ]
90
90
  }),
@@ -96,9 +96,9 @@ var d = ({ tabs: d, item: f }) => {
96
96
  }),
97
97
  /* @__PURE__ */ s("div", {
98
98
  className: "flex-1 md:px-4 min-w-0 overflow-auto",
99
- children: y()
99
+ children: x()
100
100
  })
101
101
  ]
102
102
  });
103
103
  };
104
- export { d as AppVerticalTabs };
104
+ export { f as AppVerticalTabs };
@@ -3,4 +3,5 @@ export * from "./tailwind.helper";
3
3
  export * from "./supabase.helper";
4
4
  export * from "./table.helper";
5
5
  export * from "./markdown.helper";
6
+ export * from "./navigation.helper";
6
7
  //# sourceMappingURL=index.d.ts.map
@@ -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"}
@@ -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
- export { u as ACTIONS_COLUMN_KEY, d as SELECTION_COLUMN_KEY, s as applyTableStateToQuery, o as cn, e as filterChangelog, f as getAlignmentClass, t as getChangelogItemAnchors, n as getChangelogTags, p as getColumnAlignment, m as getFixedCellProps, h as localStorageColumnVisibility, c as mapNestedRelationMany, l as mapNestedRelationOne, r as parseChangelog, g as rehypeVersionSlug, i as slugifyChangelogTitle, a as splitChangelogItems };
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"}
@@ -0,0 +1,3 @@
1
+ // src/helpers/navigation.helper.ts
2
+ var e = (e) => ({ from: e.pathname + e.search }), t = (e) => typeof e == "object" && !!e && "from" in e && typeof e.from == "string";
3
+ export { e as buildBackState, t as isBackNavigationState };
@@ -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 { useConfirmationDialog as e } from "./useConfirmationDialog.js";
2
- import { useConfirmDeleteDialog as t } from "./useConfirmDeleteDialog.js";
3
- import { useCopyToClipboard as n } from "./useCopyToClipboard.js";
4
- import { useDebounce as r } from "./useDebounce.js";
5
- import { useDebouncedValue as i } from "./useDebouncedValue.js";
6
- import { useDialog as a } from "./useDialog.js";
7
- import { usePage as o } from "./usePage.js";
8
- import { useSidebar as s } from "./useSidebar.js";
9
- import { useTable as c } from "./useTable.js";
10
- import { URL_DATE_FORMAT as l, parseDateRange as u, serializeDateRange as d, useUrlArrayState as f, useUrlDateRangeState as p, useUrlNumberState as m, useUrlState as h } from "./useUrlState.js";
11
- export { l as URL_DATE_FORMAT, u as parseDateRange, d as serializeDateRange, t as useConfirmDeleteDialog, e as useConfirmationDialog, n as useCopyToClipboard, r as useDebounce, i as useDebouncedValue, a as useDialog, o as usePage, s as useSidebar, c as useTable, f as useUrlArrayState, p as useUrlDateRangeState, m as useUrlNumberState, h as useUrlState };
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 };
@@ -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 { useDialog as f } from "./behavior/useDialog.js";
13
- import { useConfirmationDialog as p } from "./behavior/useConfirmationDialog.js";
14
- import { useConfirmDeleteDialog as m } from "./behavior/useConfirmDeleteDialog.js";
15
- import { useDebounce as h } from "./behavior/useDebounce.js";
16
- import { useDebouncedValue as g } from "./behavior/useDebouncedValue.js";
17
- import { usePage as _ } from "./behavior/usePage.js";
18
- import { useSidebar as v } from "./behavior/useSidebar.js";
19
- import { useTable as y } from "./behavior/useTable.js";
20
- import { URL_DATE_FORMAT as b, parseDateRange as x, serializeDateRange as S, useUrlArrayState as C, useUrlDateRangeState as w, useUrlNumberState as T, useUrlState as E } from "./behavior/useUrlState.js";
21
- export { b as URL_DATE_FORMAT, x as parseDateRange, S as serializeDateRange, t as toast, m as useConfirmDeleteDialog, p as useConfirmationDialog, i as useCopyToClipboard, o as useDataTable, h as useDebounce, g as useDebouncedValue, f as useDialog, s as useDocumentTitle, c as useFixedColumns, l as useLanguage, a as useMobile, r as useNotifications, _ as usePage, e as useScrollFade, u as useServerTable, v as useSidebar, y as useTable, d as useTheme, n as useToast, C as useUrlArrayState, w as useUrlDateRangeState, T as useUrlNumberState, E as useUrlState };
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,5 @@
1
+ /** State de navigation transmis à une page détail pour revenir à l'URL d'origine (filtres et page compris). */
2
+ export type BackNavigationState = {
3
+ from: string;
4
+ };
5
+ //# sourceMappingURL=BackNavigationState.d.ts.map
@@ -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"}
@@ -1,4 +1,5 @@
1
1
  export * from "./AppAction";
2
+ export * from "./BackNavigationState";
2
3
  export * from "./ButtonVariantType";
3
4
  export * from "./ChangelogEntry";
4
5
  export * from "./ChangelogItem";
@@ -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"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@krosoft/react",
3
- "version": "0.0.428",
3
+ "version": "0.0.429",
4
4
  "description": "Krosoft shared React package",
5
5
  "type": "module",
6
6
  "sideEffects": [