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