@etic-insa/ui 0.2.0 → 0.3.0
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/README.md +438 -37
- package/dist/components/etic/action.d.ts +16 -7
- package/dist/components/etic/action.js +25 -25
- package/dist/components/etic/action.js.map +1 -1
- package/dist/components/etic/app-shell.d.ts +16 -7
- package/dist/components/etic/app-shell.js +92 -85
- package/dist/components/etic/app-shell.js.map +1 -1
- package/dist/components/etic/auth-image.d.ts +29 -6
- package/dist/components/etic/auth-image.js +41 -18
- package/dist/components/etic/auth-image.js.map +1 -1
- package/dist/components/etic/button-link.d.ts +19 -0
- package/dist/components/etic/button-link.js +19 -0
- package/dist/components/etic/button-link.js.map +1 -0
- package/dist/components/etic/centered-screen.d.ts +13 -0
- package/dist/components/etic/centered-screen.js +13 -0
- package/dist/components/etic/centered-screen.js.map +1 -0
- package/dist/components/etic/confirm-dialog.d.ts +33 -3
- package/dist/components/etic/confirm-dialog.js +92 -67
- package/dist/components/etic/confirm-dialog.js.map +1 -1
- package/dist/components/etic/copy-button.d.ts +3 -2
- package/dist/components/etic/copy-button.js +3 -3
- package/dist/components/etic/copy-button.js.map +1 -1
- package/dist/components/etic/data-table-bulk-actions.d.ts +28 -4
- package/dist/components/etic/data-table-bulk-actions.js +48 -41
- package/dist/components/etic/data-table-bulk-actions.js.map +1 -1
- package/dist/components/etic/data-table-focus.d.ts +17 -0
- package/dist/components/etic/data-table-focus.js +29 -0
- package/dist/components/etic/data-table-focus.js.map +1 -0
- package/dist/components/etic/data-table-format.d.ts +3 -10
- package/dist/components/etic/data-table-format.js +4 -3
- package/dist/components/etic/data-table-format.js.map +1 -1
- package/dist/components/etic/data-table-pagination.d.ts +20 -6
- package/dist/components/etic/data-table-pagination.js +73 -43
- package/dist/components/etic/data-table-pagination.js.map +1 -1
- package/dist/components/etic/data-table-toolbar.d.ts +34 -13
- package/dist/components/etic/data-table-toolbar.js +66 -62
- package/dist/components/etic/data-table-toolbar.js.map +1 -1
- package/dist/components/etic/data-table-view-options.d.ts +44 -4
- package/dist/components/etic/data-table-view-options.js +145 -98
- package/dist/components/etic/data-table-view-options.js.map +1 -1
- package/dist/components/etic/data-table.d.ts +173 -15
- package/dist/components/etic/data-table.js +381 -202
- package/dist/components/etic/data-table.js.map +1 -1
- package/dist/components/etic/date-picker.d.ts +5 -1
- package/dist/components/etic/date-picker.js +97 -84
- package/dist/components/etic/date-picker.js.map +1 -1
- package/dist/components/etic/delete-button.d.ts +12 -4
- package/dist/components/etic/delete-button.js +21 -22
- package/dist/components/etic/delete-button.js.map +1 -1
- package/dist/components/etic/detail-list.d.ts +16 -4
- package/dist/components/etic/detail-list.js +30 -20
- package/dist/components/etic/detail-list.js.map +1 -1
- package/dist/components/etic/disclosure.d.ts +52 -0
- package/dist/components/etic/disclosure.js +70 -0
- package/dist/components/etic/disclosure.js.map +1 -0
- package/dist/components/etic/draft-resume-dialog.d.ts +42 -0
- package/dist/components/etic/draft-resume-dialog.js +60 -0
- package/dist/components/etic/draft-resume-dialog.js.map +1 -0
- package/dist/components/etic/error-banner.js +34 -38
- package/dist/components/etic/error-banner.js.map +1 -1
- package/dist/components/etic/error-boundary.js +4 -3
- package/dist/components/etic/error-boundary.js.map +1 -1
- package/dist/components/etic/explained-badge.d.ts +26 -0
- package/dist/components/etic/explained-badge.js +17 -0
- package/dist/components/etic/explained-badge.js.map +1 -0
- package/dist/components/etic/file-upload.js +66 -71
- package/dist/components/etic/file-upload.js.map +1 -1
- package/dist/components/etic/form-dialog.d.ts +25 -2
- package/dist/components/etic/form-dialog.js +95 -77
- package/dist/components/etic/form-dialog.js.map +1 -1
- package/dist/components/etic/icon-toggle.d.ts +27 -9
- package/dist/components/etic/icon-toggle.js +31 -19
- package/dist/components/etic/icon-toggle.js.map +1 -1
- package/dist/components/etic/lien.d.ts +34 -0
- package/dist/components/etic/lien.js +17 -0
- package/dist/components/etic/lien.js.map +1 -0
- package/dist/components/etic/loading.d.ts +0 -8
- package/dist/components/etic/loading.js +17 -25
- package/dist/components/etic/loading.js.map +1 -1
- package/dist/components/etic/page-container.d.ts +10 -0
- package/dist/components/etic/page-container.js +9 -5
- package/dist/components/etic/page-container.js.map +1 -1
- package/dist/components/etic/page-header.d.ts +10 -4
- package/dist/components/etic/page-header.js +48 -43
- package/dist/components/etic/page-header.js.map +1 -1
- package/dist/components/etic/phone-input.d.ts +16 -0
- package/dist/components/etic/phone-input.js +71 -65
- package/dist/components/etic/phone-input.js.map +1 -1
- package/dist/components/etic/query-boundary.d.ts +25 -2
- package/dist/components/etic/query-boundary.js +24 -12
- package/dist/components/etic/query-boundary.js.map +1 -1
- package/dist/components/etic/removable-badge.d.ts +30 -0
- package/dist/components/etic/removable-badge.js +31 -0
- package/dist/components/etic/removable-badge.js.map +1 -0
- package/dist/components/etic/save-bar.d.ts +31 -0
- package/dist/components/etic/save-bar.js +45 -0
- package/dist/components/etic/save-bar.js.map +1 -0
- package/dist/components/etic/search-select.js +1 -1
- package/dist/components/etic/search-select.js.map +1 -1
- package/dist/components/etic/segmented-control.d.ts +6 -2
- package/dist/components/etic/segmented-control.js +28 -27
- package/dist/components/etic/segmented-control.js.map +1 -1
- package/dist/components/etic/stat-grid.d.ts +15 -0
- package/dist/components/etic/stat-grid.js +17 -0
- package/dist/components/etic/stat-grid.js.map +1 -0
- package/dist/components/etic/stat-tile.d.ts +1 -1
- package/dist/components/etic/stat-tile.js +12 -18
- package/dist/components/etic/stat-tile.js.map +1 -1
- package/dist/components/etic/status-badge.d.ts +2 -4
- package/dist/components/etic/status-badge.js +13 -23
- package/dist/components/etic/status-badge.js.map +1 -1
- package/dist/components/etic/tailles-dialogue.d.ts +8 -0
- package/dist/components/etic/tailles-dialogue.js +10 -0
- package/dist/components/etic/tailles-dialogue.js.map +1 -0
- package/dist/components/etic/theme-menu.d.ts +1 -2
- package/dist/components/etic/theme-menu.js +45 -41
- package/dist/components/etic/theme-menu.js.map +1 -1
- package/dist/components/etic/toggletip.d.ts +36 -0
- package/dist/components/etic/toggletip.js +59 -0
- package/dist/components/etic/toggletip.js.map +1 -0
- package/dist/components/etic/tooltip-button.d.ts +13 -3
- package/dist/components/etic/tooltip-button.js +19 -19
- package/dist/components/etic/tooltip-button.js.map +1 -1
- package/dist/components/etic/unsaved-changes.d.ts +41 -0
- package/dist/components/etic/unsaved-changes.js +17 -0
- package/dist/components/etic/unsaved-changes.js.map +1 -0
- package/dist/components/etic/use-draft-autosave.d.ts +3 -1
- package/dist/components/etic/use-draft-autosave.js +74 -78
- package/dist/components/etic/use-draft-autosave.js.map +1 -1
- package/dist/components/etic/use-unsaved-changes-warning.d.ts +10 -0
- package/dist/components/etic/use-unsaved-changes-warning.js +20 -0
- package/dist/components/etic/use-unsaved-changes-warning.js.map +1 -0
- package/dist/components/ui/alert-dialog.js +2 -2
- package/dist/components/ui/alert-dialog.js.map +1 -1
- package/dist/components/ui/avatar.d.ts +5 -1
- package/dist/components/ui/avatar.js +20 -11
- package/dist/components/ui/avatar.js.map +1 -1
- package/dist/components/ui/badge.d.ts +3 -2
- package/dist/components/ui/badge.js +27 -14
- package/dist/components/ui/badge.js.map +1 -1
- package/dist/components/ui/breadcrumb.js +13 -13
- package/dist/components/ui/button.d.ts +15 -2
- package/dist/components/ui/button.js +27 -15
- package/dist/components/ui/button.js.map +1 -1
- package/dist/components/ui/calendar.js +1 -1
- package/dist/components/ui/calendar.js.map +1 -1
- package/dist/components/ui/checkbox.js +1 -1
- package/dist/components/ui/checkbox.js.map +1 -1
- package/dist/components/ui/combobox.d.ts +2 -2
- package/dist/components/ui/combobox.js +45 -32
- package/dist/components/ui/combobox.js.map +1 -1
- package/dist/components/ui/dialog.d.ts +10 -1
- package/dist/components/ui/dialog.js +12 -5
- package/dist/components/ui/dialog.js.map +1 -1
- package/dist/components/ui/input-group.d.ts +1 -1
- package/dist/components/ui/popover.d.ts +1 -1
- package/dist/components/ui/popover.js +3 -2
- package/dist/components/ui/popover.js.map +1 -1
- package/dist/components/ui/progress.d.ts +16 -2
- package/dist/components/ui/progress.js +34 -26
- package/dist/components/ui/progress.js.map +1 -1
- package/dist/components/ui/radio-group.js +1 -1
- package/dist/components/ui/radio-group.js.map +1 -1
- package/dist/components/ui/select.d.ts +10 -2
- package/dist/components/ui/select.js +70 -50
- package/dist/components/ui/select.js.map +1 -1
- package/dist/components/ui/sidebar.d.ts +6 -1
- package/dist/components/ui/sidebar.js +92 -92
- package/dist/components/ui/sidebar.js.map +1 -1
- package/dist/components/ui/spinner.d.ts +7 -1
- package/dist/components/ui/spinner.js +9 -1
- package/dist/components/ui/spinner.js.map +1 -1
- package/dist/components/ui/switch.js +1 -1
- package/dist/components/ui/switch.js.map +1 -1
- package/dist/components/ui/table.js +1 -1
- package/dist/components/ui/table.js.map +1 -1
- package/dist/components/ui/tabs.js +2 -2
- package/dist/components/ui/tabs.js.map +1 -1
- package/dist/components/ui/tooltip.d.ts +7 -2
- package/dist/components/ui/tooltip.js +27 -19
- package/dist/components/ui/tooltip.js.map +1 -1
- package/dist/hooks/use-column-prefs.d.ts +84 -0
- package/dist/hooks/use-column-prefs.js +71 -0
- package/dist/hooks/use-column-prefs.js.map +1 -0
- package/dist/hooks/use-debounced-value.d.ts +13 -0
- package/dist/hooks/use-debounced-value.js +12 -0
- package/dist/hooks/use-debounced-value.js.map +1 -0
- package/dist/hooks/use-document-title.d.ts +5 -0
- package/dist/hooks/use-document-title.js +13 -0
- package/dist/hooks/use-document-title.js.map +1 -0
- package/dist/hooks/use-persisted-state.d.ts +43 -0
- package/dist/hooks/use-persisted-state.js +40 -0
- package/dist/hooks/use-persisted-state.js.map +1 -0
- package/dist/index.d.ts +40 -16
- package/dist/index.js +99 -76
- package/dist/lib/autofill.d.ts +18 -0
- package/dist/lib/autofill.js +10 -0
- package/dist/lib/autofill.js.map +1 -0
- package/dist/lib/dates.d.ts +20 -0
- package/dist/lib/dates.js +16 -0
- package/dist/lib/dates.js.map +1 -0
- package/dist/lib/focus-rendu.d.ts +24 -0
- package/dist/lib/focus-rendu.js +14 -0
- package/dist/lib/focus-rendu.js.map +1 -0
- package/dist/lib/format.d.ts +54 -0
- package/dist/lib/format.js +80 -0
- package/dist/lib/format.js.map +1 -0
- package/dist/lib/normalize.d.ts +28 -0
- package/dist/lib/normalize.js +21 -0
- package/dist/lib/normalize.js.map +1 -0
- package/dist/lib/ordre-colonnes.d.ts +15 -0
- package/dist/lib/ordre-colonnes.js +14 -0
- package/dist/lib/ordre-colonnes.js.map +1 -0
- package/dist/lib/ton.d.ts +23 -0
- package/dist/lib/ton.js +51 -0
- package/dist/lib/ton.js.map +1 -0
- package/dist/styles.css +110 -63
- package/dist/theme.d.ts +34 -0
- package/dist/theme.js +45 -0
- package/dist/theme.js.map +1 -0
- package/package.json +4 -2
- package/src/theme-boot.js +22 -0
|
@@ -1,122 +1,222 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
1
|
+
import { nombreFr as e, participe as t } from "../../lib/format.js";
|
|
2
|
+
import { Button as n } from "../ui/button.js";
|
|
3
|
+
import { Checkbox as r } from "../ui/checkbox.js";
|
|
4
|
+
import { DropdownMenu as i, DropdownMenuContent as a, DropdownMenuTrigger as o } from "../ui/dropdown-menu.js";
|
|
5
|
+
import { Skeleton as s } from "../ui/skeleton.js";
|
|
6
|
+
import { Table as c, TableBody as l, TableCell as u, TableHead as d, TableHeader as f, TableRow as p } from "../ui/table.js";
|
|
7
|
+
import { Tooltip as m, TooltipContent as h, TooltipTrigger as g } from "../ui/tooltip.js";
|
|
8
|
+
import { UNITE_PAR_DEFAUT as ee } from "./data-table-format.js";
|
|
9
|
+
import { useLien as _ } from "./lien.js";
|
|
10
|
+
import { focaliserTableau as v, rendreFocusApresLigne as y } from "./data-table-focus.js";
|
|
11
|
+
import { QueryErrorBanner as te } from "./query-boundary.js";
|
|
12
|
+
import { comparerFr as b, normaliser as x, normaliserRecherche as S } from "../../lib/normalize.js";
|
|
13
|
+
import { cn as C } from "cn";
|
|
14
|
+
import { memo as w, useCallback as T, useEffect as ne, useEffectEvent as E, useId as D, useLayoutEffect as O, useRef as k, useState as A } from "react";
|
|
15
|
+
import { Fragment as j, jsx as M, jsxs as N } from "react/jsx-runtime";
|
|
16
|
+
import { ArrowDownIcon as re, ArrowUpIcon as ie, ChevronRightIcon as P, ChevronsUpDownIcon as F, MoreHorizontalIcon as I } from "lucide-react";
|
|
17
|
+
import { columnFilteringFeature as ae, columnOrderingFeature as L, columnVisibilityFeature as oe, constructFilterFn as R, constructSortFn as se, createColumnHelper as z, createFilteredRowModel as B, createPaginatedRowModel as V, createSortedRowModel as ce, filterFn_arrIncludes as le, filterFn_arrIncludesAll as ue, filterFn_arrIncludesSome as H, filterFn_equals as U, filterFn_equalsString as W, filterFn_inDateRange as G, filterFn_inNumberRange as K, filterFn_includesString as de, filterFn_weakEquals as q, functionalUpdate as fe, globalFilteringFeature as J, metaHelper as Y, rowExpandingFeature as pe, rowPaginationFeature as me, rowSelectionFeature as he, rowSortingFeature as ge, sortFn_alphanumeric as _e, sortFn_basic as ve, sortFn_datetime as ye, sortFn_text as be, tableFeatures as xe, useTable as Se } from "@tanstack/react-table";
|
|
13
18
|
// src/components/etic/data-table.tsx
|
|
14
|
-
var
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
19
|
+
var Ce = /* @__PURE__ */ new WeakMap();
|
|
20
|
+
function we(e) {
|
|
21
|
+
let { data: t, columns: n } = e.table.options, r = Ce.get(t);
|
|
22
|
+
r || Ce.set(t, r = /* @__PURE__ */ new WeakMap());
|
|
23
|
+
let i = r.get(n);
|
|
24
|
+
return i || r.set(n, i = /* @__PURE__ */ new Map()), i;
|
|
25
|
+
}
|
|
26
|
+
function Te(e, t) {
|
|
27
|
+
let n = we(e), r = `${e.id}\u0000${t}`;
|
|
28
|
+
if (n.has(r)) return n.get(r);
|
|
29
|
+
let i = e.getValue(t), a = i == null ? void 0 : x(String(i));
|
|
30
|
+
return n.set(r, a), a;
|
|
31
|
+
}
|
|
32
|
+
var Ee = R({
|
|
33
|
+
filter: (e, t, n, r) => t === "" || (Te(n, r)?.includes(t) ?? !1),
|
|
34
|
+
autoRemove: (e) => S(String(e ?? "")) === "",
|
|
35
|
+
resolveFilterValue: (e) => S(String(e ?? ""))
|
|
36
|
+
}), De = se({
|
|
37
|
+
resolveDataValue: (e) => e == null ? "" : String(e),
|
|
38
|
+
sort: b
|
|
39
|
+
}), Oe = xe({
|
|
40
|
+
columnFilteringFeature: ae,
|
|
41
|
+
columnOrderingFeature: L,
|
|
42
|
+
columnVisibilityFeature: oe,
|
|
43
|
+
globalFilteringFeature: J,
|
|
44
|
+
rowExpandingFeature: pe,
|
|
45
|
+
rowPaginationFeature: me,
|
|
46
|
+
rowSelectionFeature: he,
|
|
47
|
+
rowSortingFeature: ge,
|
|
48
|
+
filteredRowModel: B(),
|
|
49
|
+
paginatedRowModel: V(),
|
|
50
|
+
sortedRowModel: ce(),
|
|
51
|
+
filterFns: {
|
|
52
|
+
arrIncludes: le,
|
|
53
|
+
arrIncludesAll: ue,
|
|
54
|
+
arrIncludesSome: H,
|
|
55
|
+
equals: U,
|
|
56
|
+
equalsString: W,
|
|
57
|
+
inDateRange: G,
|
|
58
|
+
inNumberRange: K,
|
|
59
|
+
includesString: de,
|
|
60
|
+
texteFr: Ee,
|
|
61
|
+
weakEquals: q
|
|
62
|
+
},
|
|
21
63
|
sortFns: {
|
|
22
|
-
alphanumeric:
|
|
23
|
-
basic:
|
|
24
|
-
datetime:
|
|
25
|
-
text:
|
|
64
|
+
alphanumeric: _e,
|
|
65
|
+
basic: ve,
|
|
66
|
+
datetime: ye,
|
|
67
|
+
text: be,
|
|
68
|
+
texteFr: De
|
|
26
69
|
},
|
|
27
|
-
columnMeta:
|
|
28
|
-
tableMeta:
|
|
70
|
+
columnMeta: Y(),
|
|
71
|
+
tableMeta: Y()
|
|
29
72
|
});
|
|
30
73
|
function X() {
|
|
31
|
-
return
|
|
74
|
+
return z();
|
|
32
75
|
}
|
|
33
|
-
function
|
|
76
|
+
function ke(e) {
|
|
34
77
|
let { meta: t, header: n } = e.columnDef;
|
|
35
78
|
return t?.libelle ? t.libelle : typeof n == "string" ? n : e.id;
|
|
36
79
|
}
|
|
37
|
-
function
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
80
|
+
function Z(e) {
|
|
81
|
+
let t = e.options.meta;
|
|
82
|
+
if (!t) throw Error("DataTable : instance sans `meta`. Créez-la avec `useDataTable`.");
|
|
83
|
+
return t;
|
|
84
|
+
}
|
|
85
|
+
function Ae(e) {
|
|
86
|
+
let { pageIndex: t, pageSize: n } = e.state.pagination;
|
|
87
|
+
return {
|
|
88
|
+
manuelle: !!e.options.manualPagination,
|
|
89
|
+
total: e.getRowCount(),
|
|
90
|
+
decalage: e.options.manualPagination ? 0 : t * n,
|
|
91
|
+
limite: n,
|
|
92
|
+
nombre: e.getRowModel().rows.length
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
function je(n, r, i) {
|
|
96
|
+
return `Les ${e(n)} ${r.pluriel} sont ${t("sélectionné", 2, i)}.`;
|
|
97
|
+
}
|
|
98
|
+
function Q(e, t, n) {
|
|
99
|
+
let [r, i] = A(n), a = e === void 0 ? r : e;
|
|
100
|
+
return [a, (n) => {
|
|
101
|
+
Object.is(n, a) || (e === void 0 && i(n), t?.(n));
|
|
102
|
+
}];
|
|
42
103
|
}
|
|
104
|
+
var Me = 25;
|
|
43
105
|
function $(e, t) {
|
|
44
|
-
let n = Object.entries(e).filter(([e]) => t
|
|
106
|
+
let n = Object.entries(e).filter(([e]) => t(e));
|
|
45
107
|
return n.length === Object.keys(e).length ? e : Object.fromEntries(n);
|
|
46
108
|
}
|
|
47
|
-
function
|
|
48
|
-
let [
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
let [
|
|
53
|
-
|
|
54
|
-
let t =
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
let [R, B] = E(w?.lignesDepliees ?? {}), V = _ ?? R;
|
|
58
|
-
N.expanded = V, P.onExpandedChange = (e) => {
|
|
59
|
-
let t = z(e, V), n = t === !0 ? Object.fromEntries(H.getCoreRowModel().rows.filter((e) => e.getCanExpand()).map((e) => [e.id, !0])) : t;
|
|
60
|
-
if (b) {
|
|
61
|
-
let e = Object.keys(n).filter((e) => n[e] && !V[e]).at(-1);
|
|
109
|
+
function Ne({ donnees: e, colonnes: t, idLigne: n, tri: r, onTriChange: i, triManuel: a, paginationClient: o = !1, pagination: s, onPaginationChange: c, filtresColonnes: l, onFiltresColonnesChange: u, filtreGlobal: d, onFiltreGlobalChange: f, visibiliteColonnes: p, onVisibiliteColonnesChange: m, ordreColonnes: h, onOrdreColonnesChange: g, colonnesReglables: ee, selection: _, onSelectionChange: v, ligneSelectionnable: y, conserverSelection: te = !1, total: b, toutSelectionne: x, onToutSelectionneChange: S, lignesDepliees: C, onLignesDeplieesChange: w, ligneDepliable: T, uneSeuleLigneDepliee: A = !1, etatInitial: j }) {
|
|
110
|
+
let [M, N] = Q(x, S, !1), re = k(null), ie = D(), P = {}, F = {};
|
|
111
|
+
r !== void 0 && (P.sorting = r), i && (F.onSortingChange = i), p !== void 0 && (P.columnVisibility = p), m && (F.onColumnVisibilityChange = m), h !== void 0 && (P.columnOrder = h), g && (F.onColumnOrderChange = g), s !== void 0 && (P.pagination = s), c && (F.onPaginationChange = c), l !== void 0 && (P.columnFilters = l), u && (F.onColumnFiltersChange = u), d !== void 0 && (P.globalFilter = d), f && (F.onGlobalFilterChange = f);
|
|
112
|
+
let [I, ae] = Q(_, v, {});
|
|
113
|
+
P.rowSelection = I, F.onRowSelectionChange = (e) => ae(fe(e, I));
|
|
114
|
+
let [L, oe] = Q(C, w, j?.lignesDepliees ?? {});
|
|
115
|
+
P.expanded = L, F.onExpandedChange = (e) => {
|
|
116
|
+
let t = fe(e, L), n = t === !0 ? Object.fromEntries(R.getCoreRowModel().rows.filter((e) => e.getCanExpand()).map((e) => [e.id, !0])) : t;
|
|
117
|
+
if (A) {
|
|
118
|
+
let e = Object.keys(n).filter((e) => n[e] && !L[e]).at(-1);
|
|
62
119
|
e && (n = { [e]: !0 });
|
|
63
120
|
}
|
|
64
|
-
|
|
121
|
+
oe(n);
|
|
65
122
|
};
|
|
66
|
-
let
|
|
67
|
-
features:
|
|
123
|
+
let R = Se({
|
|
124
|
+
features: Oe,
|
|
68
125
|
data: e,
|
|
69
126
|
columns: t,
|
|
70
127
|
getRowId: n,
|
|
71
128
|
manualSorting: a,
|
|
129
|
+
manualPagination: !o,
|
|
130
|
+
autoResetPageIndex: !1,
|
|
131
|
+
globalFilterFn: "texteFr",
|
|
72
132
|
enableMultiSort: !1,
|
|
73
|
-
enableRowSelection:
|
|
74
|
-
getRowCanExpand:
|
|
133
|
+
enableRowSelection: y ? (e) => y(e.original) : !0,
|
|
134
|
+
getRowCanExpand: T ? (e) => T(e.original) : () => !0,
|
|
75
135
|
autoResetExpanded: !1,
|
|
76
136
|
initialState: {
|
|
77
|
-
sorting:
|
|
78
|
-
columnVisibility:
|
|
79
|
-
columnOrder:
|
|
137
|
+
sorting: j?.tri ?? [],
|
|
138
|
+
columnVisibility: j?.visibiliteColonnes ?? {},
|
|
139
|
+
columnOrder: j?.ordreColonnes ?? [],
|
|
140
|
+
pagination: {
|
|
141
|
+
pageIndex: 0,
|
|
142
|
+
pageSize: Me,
|
|
143
|
+
...j?.pagination
|
|
144
|
+
},
|
|
145
|
+
columnFilters: j?.filtresColonnes ?? [],
|
|
146
|
+
globalFilter: j?.filtreGlobal ?? ""
|
|
80
147
|
},
|
|
81
|
-
state:
|
|
82
|
-
...
|
|
148
|
+
state: P,
|
|
149
|
+
...F,
|
|
83
150
|
meta: {
|
|
84
|
-
total:
|
|
151
|
+
total: b,
|
|
85
152
|
get toutSelectionne() {
|
|
86
|
-
return
|
|
153
|
+
return M && B;
|
|
87
154
|
},
|
|
88
155
|
changerToutSelectionne: (e) => {
|
|
89
|
-
e &&
|
|
156
|
+
e && R.toggleAllPageRowsSelected(!0), N(e);
|
|
90
157
|
},
|
|
91
158
|
toutDeselectionner: () => {
|
|
92
|
-
|
|
159
|
+
R.resetRowSelection(!0), N(!1);
|
|
160
|
+
},
|
|
161
|
+
deselectionner: (e) => {
|
|
162
|
+
let t = new Set(e);
|
|
163
|
+
R.setRowSelection((e) => $(e, (e) => !t.has(e))), N(!1);
|
|
93
164
|
},
|
|
94
|
-
racine:
|
|
95
|
-
idDetail: (e) => `${
|
|
165
|
+
racine: re,
|
|
166
|
+
idDetail: (e) => `${ie}detail-${encodeURIComponent(e)}`,
|
|
167
|
+
colonnesReglables: ee
|
|
96
168
|
}
|
|
97
|
-
}),
|
|
98
|
-
|
|
99
|
-
let e =
|
|
100
|
-
|
|
101
|
-
}
|
|
102
|
-
let K = G(), q = T(W), J = S(() => A(!1));
|
|
103
|
-
x(() => {
|
|
104
|
-
let e = q.current !== W;
|
|
105
|
-
q.current = W, k && (e || !K) && J();
|
|
169
|
+
}), se = R.getCoreRowModel().rows, z = R.getRowModel().rows, B = R.getIsAllPageRowsSelected(), V = k(null), ce = E(() => N(!1));
|
|
170
|
+
ne(() => {
|
|
171
|
+
let e = z.map((e) => e.id).sort().join("\0"), t = V.current !== null && V.current !== e;
|
|
172
|
+
V.current = e, M && (t || !B) && ce();
|
|
106
173
|
}, [
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
174
|
+
z,
|
|
175
|
+
B,
|
|
176
|
+
M
|
|
110
177
|
]);
|
|
111
|
-
let
|
|
112
|
-
|
|
113
|
-
|
|
178
|
+
let le = E(() => {
|
|
179
|
+
if (te || Object.keys(I).length === 0) return;
|
|
180
|
+
let e = new Set(z.map((e) => e.id));
|
|
181
|
+
R.setRowSelection((t) => $(t, (t) => e.has(t)));
|
|
182
|
+
});
|
|
183
|
+
O(() => {
|
|
184
|
+
le();
|
|
185
|
+
}, [z]);
|
|
186
|
+
let ue = E(() => {
|
|
187
|
+
if (Object.keys(L).length === 0) return;
|
|
188
|
+
let { rowsById: e } = R.getCoreRowModel();
|
|
189
|
+
R.setExpanded((t) => t === !0 ? t : $(t, (t) => t in e));
|
|
190
|
+
});
|
|
191
|
+
O(() => {
|
|
192
|
+
ue();
|
|
193
|
+
}, [se]);
|
|
194
|
+
let { columnFilters: H, globalFilter: U, sorting: W, pagination: G } = R.state, K = k(null), de = E(() => {
|
|
195
|
+
o && R.state.pagination.pageIndex !== 0 && R.setPageIndex(0);
|
|
114
196
|
});
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
197
|
+
O(() => {
|
|
198
|
+
let e = JSON.stringify([
|
|
199
|
+
H,
|
|
200
|
+
U,
|
|
201
|
+
W
|
|
202
|
+
]), t = K.current;
|
|
203
|
+
K.current = e, t !== null && t !== e && de();
|
|
204
|
+
}, [
|
|
205
|
+
H,
|
|
206
|
+
U,
|
|
207
|
+
W
|
|
208
|
+
]);
|
|
209
|
+
let q = R.getPageCount(), J = R.getRowCount(), Y = E(() => R.setPageIndex(Math.max(0, q - 1)));
|
|
210
|
+
return O(() => {
|
|
211
|
+
o && J > 0 && G.pageIndex > 0 && G.pageIndex >= q && Y();
|
|
212
|
+
}, [
|
|
213
|
+
o,
|
|
214
|
+
J,
|
|
215
|
+
G.pageIndex,
|
|
216
|
+
q
|
|
217
|
+
]), R;
|
|
118
218
|
}
|
|
119
|
-
var
|
|
219
|
+
var Pe = [
|
|
120
220
|
"a[href]",
|
|
121
221
|
"button",
|
|
122
222
|
"input",
|
|
@@ -145,200 +245,241 @@ var ne = [
|
|
|
145
245
|
"menuitemradio"
|
|
146
246
|
].map((e) => `[role=${e}]`)
|
|
147
247
|
].join(", ");
|
|
148
|
-
function
|
|
248
|
+
function Fe(e) {
|
|
149
249
|
let t = e.currentTarget, n = e.target;
|
|
150
250
|
if (!t.contains(n)) return !1;
|
|
151
|
-
let r = n.closest(
|
|
251
|
+
let r = n.closest(Pe);
|
|
152
252
|
return r && r !== t && t.contains(r) ? !1 : !window.getSelection()?.toString();
|
|
153
253
|
}
|
|
154
|
-
function
|
|
155
|
-
let y = e.getRowModel().rows,
|
|
156
|
-
|
|
157
|
-
|
|
254
|
+
function Ie({ table: e, libelle: t, requete: n, enChargement: r = n?.isFetching ?? !1, lignesChargement: i = 10, vide: a = "Aucun résultat.", onActiverLigne: o, rendreDetail: m, unite: h = ee, feminin: g = !1, className: _ }) {
|
|
255
|
+
let v = n?.isError ?? !1 ? null : a, y = e.getRowModel().rows, b = e.getVisibleLeafColumns(), x = b.map((e) => e.id).join(" "), { racine: S } = Z(e), w = k(null);
|
|
256
|
+
O(() => {
|
|
257
|
+
w.current = o ? (e) => o(e.original) : m ? (e) => e.toggleExpanded() : null;
|
|
158
258
|
});
|
|
159
|
-
let
|
|
160
|
-
|
|
161
|
-
let e =
|
|
162
|
-
if (!e || typeof ResizeObserver > "u") return;
|
|
163
|
-
let
|
|
164
|
-
return
|
|
165
|
-
}, [
|
|
166
|
-
let
|
|
167
|
-
unite:
|
|
259
|
+
let E = T((e) => w.current?.(e), []);
|
|
260
|
+
ne(() => {
|
|
261
|
+
let e = S.current, t = e?.querySelector("[data-slot=\"table-container\"]");
|
|
262
|
+
if (!e || !t || typeof ResizeObserver > "u") return;
|
|
263
|
+
let n = new ResizeObserver(() => e.style.setProperty("--data-table-largeur", `${t.clientWidth}px`));
|
|
264
|
+
return n.observe(t), () => n.disconnect();
|
|
265
|
+
}, [S]), Le(S, y.length > 0, x);
|
|
266
|
+
let D = Re(e, r && y.length === 0, {
|
|
267
|
+
unite: h,
|
|
168
268
|
feminin: g
|
|
169
269
|
});
|
|
170
|
-
return /* @__PURE__ */
|
|
171
|
-
ref:
|
|
270
|
+
return /* @__PURE__ */ N(j, { children: [n ? /* @__PURE__ */ M(te, { requete: n }) : null, /* @__PURE__ */ N("div", {
|
|
271
|
+
ref: S,
|
|
172
272
|
"data-slot": "data-table",
|
|
173
|
-
className:
|
|
174
|
-
style: N ? { "--data-table-largeur": `${N}px` } : void 0,
|
|
273
|
+
className: C("min-w-0 overflow-hidden rounded-md border bg-card", _),
|
|
175
274
|
children: [
|
|
176
|
-
/* @__PURE__ */
|
|
275
|
+
/* @__PURE__ */ M("p", {
|
|
177
276
|
className: "sr-only",
|
|
178
277
|
"aria-live": "polite",
|
|
179
278
|
"aria-atomic": "true",
|
|
180
|
-
children:
|
|
279
|
+
children: D
|
|
181
280
|
}),
|
|
182
|
-
/* @__PURE__ */
|
|
281
|
+
/* @__PURE__ */ M(We, {
|
|
183
282
|
table: e,
|
|
184
|
-
unite:
|
|
283
|
+
unite: h,
|
|
185
284
|
feminin: g
|
|
186
285
|
}),
|
|
187
|
-
/* @__PURE__ */
|
|
286
|
+
/* @__PURE__ */ N(c, {
|
|
188
287
|
"aria-label": t,
|
|
189
|
-
"aria-busy":
|
|
190
|
-
children: [/* @__PURE__ */
|
|
288
|
+
"aria-busy": r || void 0,
|
|
289
|
+
children: [/* @__PURE__ */ M(f, { children: e.getHeaderGroups().map((t) => /* @__PURE__ */ M(p, { children: t.headers.map((t) => /* @__PURE__ */ M(d, {
|
|
191
290
|
colSpan: t.colSpan,
|
|
192
|
-
"aria-sort":
|
|
291
|
+
"aria-sort": Ge(t.column),
|
|
193
292
|
className: t.column.columnDef.meta?.className,
|
|
194
|
-
children: t.isPlaceholder ? null : /* @__PURE__ */
|
|
195
|
-
}, t.id)) }, t.id)) }), /* @__PURE__ */
|
|
196
|
-
className:
|
|
197
|
-
children: y.length ? y.map((t) => /* @__PURE__ */
|
|
293
|
+
children: t.isPlaceholder ? null : /* @__PURE__ */ M(e.FlexRender, { header: t })
|
|
294
|
+
}, t.id)) }, t.id)) }), /* @__PURE__ */ M(l, {
|
|
295
|
+
className: C(r && y.length > 0 && "opacity-60 transition-opacity"),
|
|
296
|
+
children: y.length ? y.map((t) => /* @__PURE__ */ M(Ue, {
|
|
198
297
|
row: t,
|
|
199
298
|
selectionnee: t.getIsSelected(),
|
|
200
299
|
selectionnable: t.getCanSelect(),
|
|
201
300
|
depliee: t.getIsExpanded(),
|
|
202
301
|
depliable: t.getCanExpand(),
|
|
203
|
-
cleColonnes:
|
|
302
|
+
cleColonnes: x,
|
|
204
303
|
colonnes: e.options.columns,
|
|
205
|
-
cliquable:
|
|
206
|
-
activer:
|
|
207
|
-
rendreDetail:
|
|
208
|
-
|
|
209
|
-
idDetail: D?.idDetail(t.id)
|
|
210
|
-
}, t.id)) : n ? Array.from({ length: r }, (e, t) => /* @__PURE__ */ O(d, {
|
|
304
|
+
cliquable: o !== void 0 || m !== void 0 && t.getCanExpand(),
|
|
305
|
+
activer: E,
|
|
306
|
+
rendreDetail: m
|
|
307
|
+
}, t.id)) : r ? Array.from({ length: i }, (e, t) => /* @__PURE__ */ M(p, {
|
|
211
308
|
"data-slot": "data-table-skeleton",
|
|
212
309
|
"aria-hidden": !0,
|
|
213
|
-
children:
|
|
214
|
-
}, t)) : /* @__PURE__ */
|
|
310
|
+
children: b.map((e) => /* @__PURE__ */ M(u, { children: /* @__PURE__ */ M(s, { className: "h-4 w-full max-w-32" }) }, e.id))
|
|
311
|
+
}, t)) : /* @__PURE__ */ M(p, {
|
|
215
312
|
className: "hover:bg-transparent",
|
|
216
|
-
children: /* @__PURE__ */
|
|
217
|
-
colSpan:
|
|
313
|
+
children: /* @__PURE__ */ M(u, {
|
|
314
|
+
colSpan: b.length || 1,
|
|
218
315
|
className: "h-24 p-0 text-center whitespace-normal text-muted-foreground",
|
|
219
|
-
children: /* @__PURE__ */
|
|
316
|
+
children: /* @__PURE__ */ M("div", {
|
|
220
317
|
className: "sticky left-0 w-[var(--data-table-largeur,100%)] p-2",
|
|
221
|
-
children:
|
|
318
|
+
children: v
|
|
222
319
|
})
|
|
223
320
|
})
|
|
224
321
|
})
|
|
225
322
|
})]
|
|
226
323
|
})
|
|
227
324
|
]
|
|
228
|
-
});
|
|
325
|
+
})] });
|
|
326
|
+
}
|
|
327
|
+
function Le(e, t, n) {
|
|
328
|
+
let r = k(/* @__PURE__ */ new WeakMap()), i = k(t), a = k(!1), o = () => e.current?.querySelectorAll("[data-slot=\"table-header\"] [data-slot=\"table-head\"]") ?? [];
|
|
329
|
+
O(() => {
|
|
330
|
+
if (typeof ResizeObserver > "u") return;
|
|
331
|
+
let e = new ResizeObserver((e) => {
|
|
332
|
+
if (i.current) for (let { target: t, borderBoxSize: n, contentRect: i } of e) r.current.set(t, n?.[0]?.inlineSize ?? i.width);
|
|
333
|
+
});
|
|
334
|
+
for (let t of o()) e.observe(t);
|
|
335
|
+
return () => e.disconnect();
|
|
336
|
+
}, [e, n]), O(() => {
|
|
337
|
+
if (i.current = t, a.current) {
|
|
338
|
+
for (let e of o()) e.style.removeProperty("width");
|
|
339
|
+
a.current = !1;
|
|
340
|
+
}
|
|
341
|
+
if (!t) for (let e of o()) {
|
|
342
|
+
let t = r.current.get(e);
|
|
343
|
+
t && (e.style.width = `${t}px`, a.current = !0);
|
|
344
|
+
}
|
|
345
|
+
}, [t, n]);
|
|
229
346
|
}
|
|
230
|
-
function
|
|
231
|
-
let [i] = e.state.sorting ?? [], a = i ? e.getColumn(i.id) : void 0, o = a ? `Trié par ${
|
|
347
|
+
function Re(e, t, { unite: n, feminin: r }) {
|
|
348
|
+
let [i] = e.state.sorting ?? [], a = i ? e.getColumn(i.id) : void 0, o = a ? `Trié par ${ke(a)}, ordre ${i.desc ? "décroissant" : "croissant"}.` : "", [s, c] = A(o), [l, u] = A("");
|
|
232
349
|
o !== s && (c(o), u(o));
|
|
233
|
-
let d = e
|
|
234
|
-
return t ? "Chargement…" : d
|
|
350
|
+
let d = Z(e);
|
|
351
|
+
return t ? "Chargement…" : d.toutSelectionne && d.total !== void 0 ? je(d.total, n, r) : l;
|
|
235
352
|
}
|
|
236
|
-
function
|
|
237
|
-
|
|
238
|
-
|
|
353
|
+
function ze(e, t) {
|
|
354
|
+
O(() => () => {
|
|
355
|
+
let n = e.current;
|
|
356
|
+
n && t.current.actif && y(n, t.current.rang);
|
|
357
|
+
}, [e, t]);
|
|
358
|
+
}
|
|
359
|
+
function Be(e, t, n = !0) {
|
|
360
|
+
if (t.actif = !0, !n) return;
|
|
361
|
+
let r = e.target.closest("td, th");
|
|
362
|
+
r instanceof HTMLTableCellElement && e.currentTarget.contains(r) && (t.rang = r.cellIndex);
|
|
363
|
+
}
|
|
364
|
+
function Ve(e) {
|
|
365
|
+
e.actif = !1;
|
|
366
|
+
}
|
|
367
|
+
function He({ row: e, selectionnee: t, depliee: n, cliquable: r, activer: i, rendreDetail: a }) {
|
|
368
|
+
let o = e.table, s = k(null), c = k({
|
|
369
|
+
actif: !1,
|
|
370
|
+
rang: -1
|
|
371
|
+
});
|
|
372
|
+
ze(s, c);
|
|
373
|
+
let l = e.getVisibleCells();
|
|
374
|
+
return /* @__PURE__ */ N(j, { children: [/* @__PURE__ */ M(p, {
|
|
375
|
+
ref: s,
|
|
376
|
+
onFocus: (e) => Be(e, c.current),
|
|
377
|
+
onBlur: () => Ve(c.current),
|
|
239
378
|
"data-state": t ? "selected" : void 0,
|
|
240
|
-
className:
|
|
379
|
+
className: C(r && "cursor-pointer"),
|
|
241
380
|
onClick: r ? (t) => {
|
|
242
|
-
|
|
381
|
+
Fe(t) && i(e);
|
|
243
382
|
} : void 0,
|
|
244
|
-
children:
|
|
383
|
+
children: l.map((e) => /* @__PURE__ */ M(u, {
|
|
245
384
|
className: e.column.columnDef.meta?.className,
|
|
246
|
-
children: /* @__PURE__ */
|
|
385
|
+
children: /* @__PURE__ */ M(o.FlexRender, { cell: e })
|
|
247
386
|
}, e.id))
|
|
248
|
-
}), n && a ? /* @__PURE__ */
|
|
387
|
+
}), n && a ? /* @__PURE__ */ M(p, {
|
|
249
388
|
"data-slot": "data-table-detail",
|
|
250
389
|
className: "bg-muted/30 hover:bg-muted/30",
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
390
|
+
onFocus: (e) => Be(e, c.current, !1),
|
|
391
|
+
onBlur: () => Ve(c.current),
|
|
392
|
+
children: /* @__PURE__ */ M(u, {
|
|
393
|
+
id: Z(o).idDetail(e.id),
|
|
394
|
+
colSpan: l.length,
|
|
254
395
|
className: "p-0 whitespace-normal",
|
|
255
|
-
children: /* @__PURE__ */
|
|
396
|
+
children: /* @__PURE__ */ M("div", {
|
|
256
397
|
className: "sticky left-0 w-[var(--data-table-largeur,100%)] p-3",
|
|
257
398
|
children: a(e.original)
|
|
258
399
|
})
|
|
259
400
|
})
|
|
260
401
|
}) : null] });
|
|
261
402
|
}
|
|
262
|
-
var
|
|
263
|
-
function
|
|
264
|
-
let
|
|
265
|
-
return
|
|
403
|
+
var Ue = w(He, (e, t) => e.row === t.row && e.selectionnee === t.selectionnee && e.selectionnable === t.selectionnable && e.depliee === t.depliee && e.depliable === t.depliable && e.cleColonnes === t.cleColonnes && e.colonnes === t.colonnes && e.cliquable === t.cliquable && e.activer === t.activer && (!t.depliee || e.rendreDetail === t.rendreDetail));
|
|
404
|
+
function We({ table: r, unite: i, feminin: a }) {
|
|
405
|
+
let o = Z(r), s = r.getRowModel().rows, { total: c } = o, l = s.filter((e) => e.getIsSelected()).length;
|
|
406
|
+
return c === void 0 || s.length === 0 || !r.getIsAllPageRowsSelected() || c <= l ? null : /* @__PURE__ */ M("div", {
|
|
266
407
|
"data-slot": "data-table-select-all",
|
|
267
408
|
className: "flex flex-wrap items-center justify-center gap-x-2 border-b bg-muted/50 px-3 py-1.5 text-center text-sm",
|
|
268
|
-
children:
|
|
409
|
+
children: o.toutSelectionne ? /* @__PURE__ */ N(j, { children: [/* @__PURE__ */ M("span", { children: je(c, i, a) }), /* @__PURE__ */ M(n, {
|
|
269
410
|
variant: "link",
|
|
270
411
|
className: "h-auto px-0",
|
|
271
412
|
onClick: () => {
|
|
272
|
-
|
|
413
|
+
v(o.racine.current), o.toutDeselectionner();
|
|
273
414
|
},
|
|
274
415
|
children: "Tout désélectionner"
|
|
275
|
-
})] }) : /* @__PURE__ */
|
|
416
|
+
})] }) : /* @__PURE__ */ N(j, { children: [/* @__PURE__ */ M("span", { children: l > 1 ? `Les ${e(l)} ${i.pluriel} de la page sont ${t("sélectionné", 2, a)}.` : `1 ${i.singulier} de la page est ${t("sélectionné", 1, a)}.` }), /* @__PURE__ */ M(n, {
|
|
276
417
|
variant: "link",
|
|
277
418
|
className: "h-auto px-0",
|
|
278
|
-
onClick: () =>
|
|
279
|
-
children: `Sélectionner les ${
|
|
419
|
+
onClick: () => o.changerToutSelectionne(!0),
|
|
420
|
+
children: `Sélectionner les ${e(c)} ${i.pluriel}`
|
|
280
421
|
})] })
|
|
281
422
|
});
|
|
282
423
|
}
|
|
283
|
-
function
|
|
424
|
+
function Ge(e) {
|
|
284
425
|
let t = e.getIsSorted();
|
|
285
426
|
if (t === "asc") return "ascending";
|
|
286
427
|
if (t === "desc") return "descending";
|
|
287
428
|
}
|
|
288
|
-
function
|
|
289
|
-
if (!
|
|
429
|
+
function Ke({ column: e, libelle: t, className: r }) {
|
|
430
|
+
if (!e.getCanSort()) return /* @__PURE__ */ M("div", {
|
|
290
431
|
className: r,
|
|
291
|
-
children:
|
|
432
|
+
children: t
|
|
292
433
|
});
|
|
293
|
-
let i =
|
|
294
|
-
return /* @__PURE__ */
|
|
295
|
-
className:
|
|
296
|
-
children: /* @__PURE__ */
|
|
434
|
+
let i = e.getIsSorted(), a = i === "desc" ? re : i === "asc" ? ie : F;
|
|
435
|
+
return /* @__PURE__ */ M("div", {
|
|
436
|
+
className: C("flex items-center gap-2", r),
|
|
437
|
+
children: /* @__PURE__ */ N(n, {
|
|
297
438
|
variant: "ghost",
|
|
298
439
|
size: "sm",
|
|
299
440
|
className: "-ml-2.5 h-8 text-sm",
|
|
300
|
-
onClick: () =>
|
|
301
|
-
children: [/* @__PURE__ */
|
|
441
|
+
onClick: () => e.toggleSorting(i === "asc"),
|
|
442
|
+
children: [/* @__PURE__ */ M("span", { children: t }), /* @__PURE__ */ M(a, {
|
|
302
443
|
"data-icon": "inline-end",
|
|
303
|
-
className:
|
|
444
|
+
className: C(!i && "text-muted-foreground")
|
|
304
445
|
})]
|
|
305
446
|
})
|
|
306
447
|
});
|
|
307
448
|
}
|
|
308
|
-
function
|
|
449
|
+
function qe({ libelleLigne: e, libelleTout: t = "Sélectionner la page", verrouLigne: n } = {}) {
|
|
309
450
|
return X().display({
|
|
310
451
|
id: "select",
|
|
311
452
|
header: ({ table: e }) => {
|
|
312
|
-
let
|
|
313
|
-
return /* @__PURE__ */
|
|
453
|
+
let n = e.getRowModel().rows.filter((e) => e.getCanSelect()), i = e.getIsAllPageRowsSelected();
|
|
454
|
+
return /* @__PURE__ */ M(r, {
|
|
314
455
|
checked: i,
|
|
315
456
|
indeterminate: e.getIsSomePageRowsSelected() && !i,
|
|
316
|
-
disabled:
|
|
457
|
+
disabled: n.length === 0,
|
|
317
458
|
onCheckedChange: (t) => e.toggleAllPageRowsSelected(t),
|
|
318
|
-
"aria-label":
|
|
319
|
-
className:
|
|
459
|
+
"aria-label": t,
|
|
460
|
+
className: Je
|
|
320
461
|
});
|
|
321
462
|
},
|
|
322
|
-
cell: ({ row: t }) => /* @__PURE__ */
|
|
463
|
+
cell: ({ row: t }) => /* @__PURE__ */ M(Ze, {
|
|
323
464
|
row: t,
|
|
324
465
|
libelle: e?.(t.original) ?? "Sélectionner la ligne",
|
|
325
|
-
verrou: t.getCanSelect() ? void 0 :
|
|
466
|
+
verrou: t.getCanSelect() ? void 0 : n?.(t.original)
|
|
326
467
|
}),
|
|
327
468
|
enableSorting: !1,
|
|
328
469
|
enableHiding: !1,
|
|
329
|
-
meta: { className:
|
|
470
|
+
meta: { className: Ye }
|
|
330
471
|
});
|
|
331
472
|
}
|
|
332
|
-
var
|
|
333
|
-
function
|
|
334
|
-
let i =
|
|
473
|
+
var Je = "after:-inset-3", Ye = "w-10 px-3 [&:has([role=checkbox])]:pr-3", Xe = "aria-disabled:cursor-not-allowed aria-disabled:opacity-100 aria-disabled:not-data-checked:bg-muted aria-disabled:data-checked:border-muted-foreground aria-disabled:data-checked:bg-muted-foreground aria-disabled:data-checked:text-background";
|
|
474
|
+
function Ze({ row: e, libelle: t, verrou: n }) {
|
|
475
|
+
let i = D(), a = e.getToggleSelectedHandler(), o = e.getCanSelect(), s = /* @__PURE__ */ M(r, {
|
|
335
476
|
checked: e.getIsSelected(),
|
|
336
|
-
disabled: !o && !
|
|
477
|
+
disabled: !o && !n,
|
|
337
478
|
readOnly: !o,
|
|
338
479
|
"aria-disabled": !o || void 0,
|
|
339
|
-
"aria-describedby":
|
|
340
|
-
"aria-label":
|
|
341
|
-
className:
|
|
480
|
+
"aria-describedby": n ? i : void 0,
|
|
481
|
+
"aria-label": t,
|
|
482
|
+
className: C(Je, Xe),
|
|
342
483
|
onCheckedChange: (e, t) => a({
|
|
343
484
|
target: { checked: e },
|
|
344
485
|
shiftKey: t.event.shiftKey
|
|
@@ -347,57 +488,95 @@ function pe({ row: e, libelle: n, verrou: r }) {
|
|
|
347
488
|
e.shiftKey && e.preventDefault();
|
|
348
489
|
}
|
|
349
490
|
});
|
|
350
|
-
return
|
|
491
|
+
return n ? /* @__PURE__ */ N(j, { children: [/* @__PURE__ */ N(m, { children: [/* @__PURE__ */ M(g, { render: s }), /* @__PURE__ */ M(h, { children: n })] }), /* @__PURE__ */ M("span", {
|
|
351
492
|
id: i,
|
|
352
493
|
hidden: !0,
|
|
353
|
-
children:
|
|
494
|
+
children: n
|
|
354
495
|
})] }) : s;
|
|
355
496
|
}
|
|
356
|
-
function
|
|
497
|
+
function Qe({ libelleLigne: e, libelle: t = "Détail" } = {}) {
|
|
357
498
|
return X().display({
|
|
358
499
|
id: "expand",
|
|
359
|
-
header: () => /* @__PURE__ */
|
|
500
|
+
header: () => /* @__PURE__ */ M("span", {
|
|
360
501
|
className: "sr-only",
|
|
361
502
|
children: t
|
|
362
503
|
}),
|
|
363
|
-
cell: ({ row: t, table: n }) => t.getCanExpand() ? /* @__PURE__ */
|
|
504
|
+
cell: ({ row: t, table: n }) => t.getCanExpand() ? /* @__PURE__ */ M($e, {
|
|
364
505
|
deplie: t.getIsExpanded(),
|
|
365
506
|
onBasculer: () => t.toggleExpanded(),
|
|
366
507
|
libelle: e?.(t.original) ?? "Détail de la ligne",
|
|
367
|
-
idDetail: n.
|
|
508
|
+
idDetail: t.getIsExpanded() ? Z(n).idDetail(t.id) : void 0
|
|
368
509
|
}) : null,
|
|
369
510
|
enableSorting: !1,
|
|
370
511
|
enableHiding: !1,
|
|
371
512
|
meta: { className: "w-8" }
|
|
372
513
|
});
|
|
373
514
|
}
|
|
374
|
-
function
|
|
375
|
-
return /* @__PURE__ */
|
|
376
|
-
render: /* @__PURE__ */
|
|
515
|
+
function $e({ deplie: e, onBasculer: t, libelle: r, idDetail: i }) {
|
|
516
|
+
return /* @__PURE__ */ N(m, { children: [/* @__PURE__ */ M(g, {
|
|
517
|
+
render: /* @__PURE__ */ M(n, {
|
|
377
518
|
variant: "ghost",
|
|
378
519
|
size: "icon-xs",
|
|
379
520
|
"aria-label": r,
|
|
380
|
-
"aria-expanded":
|
|
381
|
-
"aria-controls":
|
|
382
|
-
onClick:
|
|
521
|
+
"aria-expanded": e,
|
|
522
|
+
"aria-controls": e ? i : void 0,
|
|
523
|
+
onClick: t
|
|
383
524
|
}),
|
|
384
|
-
children: /* @__PURE__ */
|
|
385
|
-
}), /* @__PURE__ */
|
|
525
|
+
children: /* @__PURE__ */ M(P, { className: C("transition-transform motion-reduce:transition-none", e && "rotate-90") })
|
|
526
|
+
}), /* @__PURE__ */ M(h, { children: r })] });
|
|
386
527
|
}
|
|
387
|
-
function
|
|
388
|
-
return /* @__PURE__ */
|
|
389
|
-
render: /* @__PURE__ */
|
|
528
|
+
function et({ children: e, libelle: t }) {
|
|
529
|
+
return /* @__PURE__ */ N(i, { children: [/* @__PURE__ */ N(m, { children: [/* @__PURE__ */ M(g, {
|
|
530
|
+
render: /* @__PURE__ */ M(o, { render: /* @__PURE__ */ M(n, {
|
|
390
531
|
variant: "ghost",
|
|
391
532
|
size: "icon-xs",
|
|
392
|
-
"aria-label":
|
|
533
|
+
"aria-label": t
|
|
393
534
|
}) }),
|
|
394
|
-
children: /* @__PURE__ */
|
|
395
|
-
}), /* @__PURE__ */
|
|
535
|
+
children: /* @__PURE__ */ M(I, {})
|
|
536
|
+
}), /* @__PURE__ */ M(h, { children: t })] }), /* @__PURE__ */ M(a, {
|
|
396
537
|
align: "end",
|
|
397
538
|
className: "w-44",
|
|
398
|
-
children:
|
|
539
|
+
children: e
|
|
399
540
|
})] });
|
|
400
541
|
}
|
|
401
|
-
|
|
542
|
+
function tt({ actions: e, libelle: t = "Actions", id: n = "actions", enableHiding: r = !1, className: i }) {
|
|
543
|
+
return X().display({
|
|
544
|
+
id: n,
|
|
545
|
+
header: () => /* @__PURE__ */ M("span", {
|
|
546
|
+
className: "sr-only",
|
|
547
|
+
children: t
|
|
548
|
+
}),
|
|
549
|
+
cell: ({ row: t }) => /* @__PURE__ */ M("div", {
|
|
550
|
+
className: "flex items-center justify-end gap-1",
|
|
551
|
+
children: e(t.original)
|
|
552
|
+
}),
|
|
553
|
+
enableSorting: !1,
|
|
554
|
+
enableHiding: r,
|
|
555
|
+
meta: {
|
|
556
|
+
libelle: t,
|
|
557
|
+
className: C("w-px", i)
|
|
558
|
+
}
|
|
559
|
+
});
|
|
560
|
+
}
|
|
561
|
+
var nt = "rounded-sm text-left font-medium underline-offset-4 outline-none hover:underline focus-visible:ring-3 focus-visible:ring-ring/50";
|
|
562
|
+
function rt(e) {
|
|
563
|
+
let { lien: t, ...n } = e, r = _(t);
|
|
564
|
+
if (n.href !== void 0) {
|
|
565
|
+
let { className: e, ...t } = n;
|
|
566
|
+
return /* @__PURE__ */ M(r, {
|
|
567
|
+
"data-slot": "data-table-cell-link",
|
|
568
|
+
className: C(nt, e),
|
|
569
|
+
...t
|
|
570
|
+
});
|
|
571
|
+
}
|
|
572
|
+
let { className: i, type: a = "button", ...o } = n;
|
|
573
|
+
return /* @__PURE__ */ M("button", {
|
|
574
|
+
"data-slot": "data-table-cell-link",
|
|
575
|
+
type: a,
|
|
576
|
+
className: C(nt, "cursor-pointer", i),
|
|
577
|
+
...o
|
|
578
|
+
});
|
|
579
|
+
}
|
|
580
|
+
export { Xe as CASE_VERROUILLEE, Ie as DataTable, rt as DataTableCellLink, Ke as DataTableColumnHeader, et as DataTableRowActions, X as createDataTableColumnHelper, tt as dataTableActionsColumn, Qe as dataTableExpandColumn, Oe as dataTableFeatures, qe as dataTableSelectionColumn, ke as libelleColonne, Z as metaDe, Ae as paginationDuTableau, Ne as useDataTable };
|
|
402
581
|
|
|
403
582
|
//# sourceMappingURL=data-table.js.map
|