@etic-insa/ui 0.6.0 → 0.7.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 +250 -62
- package/dist/components/etic/app-shell.d.ts +10 -0
- package/dist/components/etic/app-shell.js +144 -117
- package/dist/components/etic/app-shell.js.map +1 -1
- package/dist/components/etic/code-block.d.ts +15 -0
- package/dist/components/etic/code-block.js +21 -0
- package/dist/components/etic/code-block.js.map +1 -0
- package/dist/components/etic/data-table-toolbar.d.ts +12 -1
- package/dist/components/etic/data-table-toolbar.js +50 -39
- package/dist/components/etic/data-table-toolbar.js.map +1 -1
- package/dist/components/etic/data-table-view-options.d.ts +2 -1
- package/dist/components/etic/data-table-view-options.js +1 -1
- package/dist/components/etic/data-table-view-options.js.map +1 -1
- package/dist/components/etic/detail-meta.d.ts +28 -0
- package/dist/components/etic/detail-meta.js +51 -0
- package/dist/components/etic/detail-meta.js.map +1 -0
- package/dist/components/etic/detail-sheet.d.ts +36 -0
- package/dist/components/etic/detail-sheet.js +37 -0
- package/dist/components/etic/detail-sheet.js.map +1 -0
- package/dist/components/etic/empty-state.d.ts +15 -0
- package/dist/components/etic/empty-state.js +24 -12
- package/dist/components/etic/empty-state.js.map +1 -1
- package/dist/components/etic/external-link.d.ts +40 -0
- package/dist/components/etic/external-link.js +47 -0
- package/dist/components/etic/external-link.js.map +1 -0
- package/dist/components/etic/file-upload.d.ts +19 -0
- package/dist/components/etic/file-upload.js +24 -1
- package/dist/components/etic/file-upload.js.map +1 -1
- package/dist/components/etic/nav-tabs.d.ts +27 -0
- package/dist/components/etic/nav-tabs.js +22 -0
- package/dist/components/etic/nav-tabs.js.map +1 -0
- package/dist/components/etic/phone-input.d.ts +4 -3
- package/dist/components/etic/phone-input.js +51 -37
- package/dist/components/etic/phone-input.js.map +1 -1
- package/dist/components/etic/save-bar.d.ts +3 -2
- package/dist/components/etic/save-bar.js +16 -15
- package/dist/components/etic/save-bar.js.map +1 -1
- package/dist/components/etic/select-field.d.ts +38 -0
- package/dist/components/etic/select-field.js +42 -0
- package/dist/components/etic/select-field.js.map +1 -0
- package/dist/components/etic/sub-section.d.ts +15 -0
- package/dist/components/etic/sub-section.js +23 -0
- package/dist/components/etic/sub-section.js.map +1 -0
- package/dist/components/etic/use-detail-sheet.d.ts +58 -0
- package/dist/components/etic/use-detail-sheet.js +35 -0
- package/dist/components/etic/use-detail-sheet.js.map +1 -0
- package/dist/components/etic/use-server-pagination.d.ts +55 -0
- package/dist/components/etic/use-server-pagination.js +31 -0
- package/dist/components/etic/use-server-pagination.js.map +1 -0
- package/dist/components/etic/use-server-sorting.d.ts +29 -0
- package/dist/components/etic/use-server-sorting.js +19 -0
- package/dist/components/etic/use-server-sorting.js.map +1 -0
- package/dist/components/ui/sheet.d.ts +20 -2
- package/dist/components/ui/sheet.js +21 -8
- package/dist/components/ui/sheet.js.map +1 -1
- package/dist/hooks/use-column-prefs.d.ts +25 -7
- package/dist/hooks/use-column-prefs.js +44 -35
- package/dist/hooks/use-column-prefs.js.map +1 -1
- package/dist/hooks/use-debounced-search.d.ts +29 -0
- package/dist/hooks/use-debounced-search.js +29 -0
- package/dist/hooks/use-debounced-search.js.map +1 -0
- package/dist/hooks/use-fresh-dialog.d.ts +33 -0
- package/dist/hooks/use-fresh-dialog.js +17 -0
- package/dist/hooks/use-fresh-dialog.js.map +1 -0
- package/dist/hooks/use-load-on-open.d.ts +23 -0
- package/dist/hooks/use-load-on-open.js +21 -0
- package/dist/hooks/use-load-on-open.js.map +1 -0
- package/dist/hooks/use-save-by-key.d.ts +45 -0
- package/dist/hooks/use-save-by-key.js +49 -0
- package/dist/hooks/use-save-by-key.js.map +1 -0
- package/dist/index.d.ts +18 -4
- package/dist/index.js +117 -103
- package/dist/lib/format.d.ts +31 -0
- package/dist/lib/format.js +53 -18
- package/dist/lib/format.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { useCallback as e, useState as t } from "react";
|
|
2
|
+
// src/hooks/use-save-by-key.ts
|
|
3
|
+
function n() {
|
|
4
|
+
let [n, r] = t({}), [i, a] = t(null), [o, s] = t(!1), [c, l] = t(!1);
|
|
5
|
+
async function u(e, t, n) {
|
|
6
|
+
s(!0), a(null), l(!1);
|
|
7
|
+
let i = {}, o = null;
|
|
8
|
+
try {
|
|
9
|
+
for (let r of e) try {
|
|
10
|
+
await t(r);
|
|
11
|
+
} catch (e) {
|
|
12
|
+
let t = n(e);
|
|
13
|
+
if (t === null) {
|
|
14
|
+
o = e;
|
|
15
|
+
break;
|
|
16
|
+
}
|
|
17
|
+
i[r.cle] = t;
|
|
18
|
+
}
|
|
19
|
+
} catch (e) {
|
|
20
|
+
o = e;
|
|
21
|
+
} finally {
|
|
22
|
+
r(i), a(o), s(!1), l(o === null && Object.keys(i).length === 0);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
let d = e((e) => {
|
|
26
|
+
r((t) => {
|
|
27
|
+
if (!(e in t)) return t;
|
|
28
|
+
let n = { ...t };
|
|
29
|
+
return delete n[e], n;
|
|
30
|
+
});
|
|
31
|
+
}, []);
|
|
32
|
+
return {
|
|
33
|
+
refus: n,
|
|
34
|
+
panne: i,
|
|
35
|
+
enCours: o,
|
|
36
|
+
enregistre: c,
|
|
37
|
+
enregistrer: u,
|
|
38
|
+
saisieChangee: e((e) => {
|
|
39
|
+
l(!1), d(e);
|
|
40
|
+
}, [d]),
|
|
41
|
+
oublierRefus: d,
|
|
42
|
+
oublierTout: e(() => {
|
|
43
|
+
r({}), a(null);
|
|
44
|
+
}, [])
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
export { n as useSaveByKey };
|
|
48
|
+
|
|
49
|
+
//# sourceMappingURL=use-save-by-key.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-save-by-key.js","names":["useSaveByKey","refus","setRefus","useState","panne","setPanne","enCours","setEnCours","enregistre","setEnregistre","enregistrer","refuses","echec","envoi","envois","envoyer","erreur","motif","refusDe","oublierRefus","useCallback","cle","avant","reste"],"sources":["../../src/hooks/use-save-by-key.ts"],"sourcesContent":["import { useCallback, useState } from \"react\"\n\nexport interface SaveByKeyEtat<R> {\n /** Le refus de chaque clé refusée, à afficher sous son champ. */\n refus: Readonly<Record<string, R>>\n /** La panne qui a arrêté l'enregistrement (bandeau), ou `null`. */\n panne: unknown\n enCours: boolean\n /** Tout est parti sans refus ni panne (« Enregistré »). */\n enregistre: boolean\n /**\n * Envoie chaque élément, dans l'ordre. `refusDe` lit le refus d'une\n * saisie (une erreur de validation), ou rend `null` pour une panne, qui\n * arrête l'enregistrement.\n */\n enregistrer: <E extends { cle: string }>(\n envois: readonly E[],\n envoyer: (envoi: E) => Promise<unknown>,\n refusDe: (erreur: unknown) => R | null\n ) => Promise<void>\n /** Une saisie change : son refus visait la précédente, et « Enregistré »\n * ne vaut plus. Stable. */\n saisieChangee: (cle: string) => void\n /** Retire le refus d'une clé. Stable. */\n oublierRefus: (cle: string) => void\n /** « Annuler » : refus et panne disparaissent avec la saisie. Stable. */\n oublierTout: () => void\n}\n\n/**\n * L'enregistrement d'un formulaire de réglages dont chaque valeur part\n * seule (une requête par clé) : les clés modifiées partent l'une après\n * l'autre. Un refus de la saisie reste sous son champ et les suivantes\n * partent quand même ; une panne (réseau, serveur) arrête l'enregistrement\n * et s'affiche en bandeau. `R` : ce que le champ refusé affiche (l'erreur,\n * ou son message).\n *\n * ```tsx\n * const sauvegarde = useSaveByKey<string>()\n * await sauvegarde.enregistrer(\n * modifiees, // [{ cle: \"delai\", valeur: 30 }, …]\n * ({ cle, valeur }) => api.reglages.ecrire(cle, valeur),\n * (erreur) => (estRefusDeSaisie(erreur) ? erreur.message : null)\n * )\n * <FormField erreur={sauvegarde.refus.delai} …>\n * <ErrorBanner erreur={sauvegarde.panne} />\n * <SaveBar enCours={sauvegarde.enCours} enregistre={sauvegarde.enregistre} … />\n * ```\n */\nexport function useSaveByKey<R>(): SaveByKeyEtat<R> {\n const [refus, setRefus] = useState<Readonly<Record<string, R>>>({})\n const [panne, setPanne] = useState<unknown>(null)\n const [enCours, setEnCours] = useState(false)\n const [enregistre, setEnregistre] = useState(false)\n\n async function enregistrer<E extends { cle: string }>(\n envois: readonly E[],\n envoyer: (envoi: E) => Promise<unknown>,\n refusDe: (erreur: unknown) => R | null\n ) {\n setEnCours(true)\n setPanne(null)\n setEnregistre(false)\n const refuses: Record<string, R> = {}\n let echec: unknown = null\n try {\n for (const envoi of envois) {\n try {\n await envoyer(envoi)\n } catch (erreur) {\n const motif = refusDe(erreur)\n if (motif === null) {\n echec = erreur\n break\n }\n refuses[envoi.cle] = motif\n }\n }\n } catch (erreur) {\n // Une lecture du refus qui lève : une panne, pas un formulaire\n // bloqué « en cours ».\n echec = erreur\n } finally {\n setRefus(refuses)\n setPanne(echec)\n setEnCours(false)\n setEnregistre(echec === null && Object.keys(refuses).length === 0)\n }\n }\n\n const oublierRefus = useCallback((cle: string) => {\n setRefus((avant) => {\n if (!(cle in avant)) return avant\n const reste = { ...avant }\n delete reste[cle]\n return reste\n })\n }, [])\n\n const saisieChangee = useCallback(\n (cle: string) => {\n setEnregistre(false)\n oublierRefus(cle)\n },\n [oublierRefus]\n )\n\n const oublierTout = useCallback(() => {\n setRefus({})\n setPanne(null)\n }, [])\n\n return {\n refus,\n panne,\n enCours,\n enregistre,\n enregistrer,\n saisieChangee,\n oublierRefus,\n oublierTout,\n }\n}\n"],"mappings":";;AAiDA,SAAgBA,IAAoC;CAClD,IAAM,CAACC,GAAOC,KAAYC,EAAsC,CAAC,CAAC,GAC5D,CAACC,GAAOC,KAAYF,EAAkB,IAAI,GAC1C,CAACG,GAASC,KAAcJ,EAAS,EAAK,GACtC,CAACK,GAAYC,KAAiBN,EAAS,EAAK;CAElD,eAAeO,EACb,GACA,GACA,GACA;EAGA,AAFAH,EAAW,EAAI,GACfF,EAAS,IAAI,GACbI,EAAc,EAAK;EACnB,IAAME,IAA6B,CAAC,GAChCC,IAAiB;EACrB,IAAI;GACF,KAAK,IAAMC,KAASC,GAClB,IAAI;IACF,MAAMC,EAAQF,CAAK;GACrB,SAASG,GAAQ;IACf,IAAMC,IAAQC,EAAQF,CAAM;IAC5B,IAAIC,MAAU,MAAM;KAClB,IAAQD;KACR;IACF;IACA,EAAQH,EAAM,OAAOI;GACvB;EAEJ,SAASD,GAAQ;GAGf,IAAQA;EACV,UAAU;GAIR,AAHAd,EAASS,CAAO,GAChBN,EAASO,CAAK,GACdL,EAAW,EAAK,GAChBE,EAAcG,MAAU,QAAQ,OAAO,KAAKD,CAAO,CAAC,CAAC,WAAW,CAAC;EACnE;CACF;CAEA,IAAMQ,IAAeC,GAAa,MAAgB;EAChD,GAAU,MAAU;GAClB,IAAI,EAAEC,KAAOC,IAAQ,OAAOA;GAC5B,IAAMC,IAAQ,EAAE,GAAGD,EAAM;GAEzB,OADA,OAAOC,EAAMF,IACNE;EACT,CAAC;CACH,GAAG,CAAC,CAAC;CAeL,OAAO;EACL;EACA;EACA;EACA;EACA;EACA,eAnBoBH,GACnB,MAAgB;GAEf,AADAX,EAAc,EAAK,GACnBU,EAAaE,CAAG;EAClB,GACA,CAACF,CAAY,CAcb;EACA;EACA,aAbkBC,QAAkB;GAEpC,AADAlB,EAAS,CAAC,CAAC,GACXG,EAAS,IAAI;EACf,GAAG,CAAC,CAUF;CACF;AACF"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
export { cn } from './lib/utils';
|
|
2
2
|
export { MOBILE_MEDIA_QUERY, useIsMobile } from './hooks/use-mobile';
|
|
3
|
-
export { accorde, type AncienneteOptions, compte, formaterAnciennete, formaterDate, formaterDateHeure, formaterDateHeureLongue, formaterDuree, formaterDureeArrondie, formaterHorodatage, formaterOctets, nombreFr, participe, type Unite, uniteAccordee, } from './lib/format';
|
|
3
|
+
export { accorde, type AncienneteOptions, capitaliser, compte, formaterAnciennete, formaterDate, formaterDateHeure, formaterDateHeureLongue, formaterDuree, formaterDureeArrondie, formaterDureePrecise, formaterHeure, formaterHorodatage, formaterMontant, formaterNombre, formaterOctets, formaterPourcentage, initiales, nombreFr, participe, type Unite, uniteAccordee, } from './lib/format';
|
|
4
4
|
export { ecrireDateIso, lireDateIso } from './lib/dates';
|
|
5
5
|
export { comparerFr, correspondance, normaliser, normaliserRecherche, } from './lib/normalize';
|
|
6
6
|
export { NO_AUTOFILL } from './lib/autofill';
|
|
7
7
|
export { useDebouncedValue } from './hooks/use-debounced-value';
|
|
8
|
+
export { useDebouncedSearch, type UseDebouncedSearchOptions, } from './hooks/use-debounced-search';
|
|
9
|
+
export { type FreshDialogEtat, useFreshDialog } from './hooks/use-fresh-dialog';
|
|
10
|
+
export { type LectureAOuverture, useLoadOnOpen } from './hooks/use-load-on-open';
|
|
11
|
+
export { type SaveByKeyEtat, useSaveByKey } from './hooks/use-save-by-key';
|
|
8
12
|
export { useDocumentTitle } from './hooks/use-document-title';
|
|
9
13
|
export { Alert, AlertAction, AlertDescription, AlertTitle, } from './components/ui/alert';
|
|
10
14
|
export { AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogMedia, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, } from './components/ui/alert-dialog';
|
|
@@ -35,7 +39,7 @@ export { RadioGroup, RadioGroupItem } from './components/ui/radio-group';
|
|
|
35
39
|
export { ScrollArea, ScrollBar } from './components/ui/scroll-area';
|
|
36
40
|
export { Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, } from './components/ui/select';
|
|
37
41
|
export { Separator } from './components/ui/separator';
|
|
38
|
-
export { Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetTitle, SheetTrigger, } from './components/ui/sheet';
|
|
42
|
+
export { Sheet, SheetBody, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, type SheetTaille, SheetTitle, SheetTrigger, } from './components/ui/sheet';
|
|
39
43
|
export { Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupAction, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarInput, SidebarInset, SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuItem, SidebarMenuSkeleton, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem, SidebarProvider, SidebarRail, SidebarSeparator, SidebarTrigger, useSidebar, } from './components/ui/sidebar';
|
|
40
44
|
export { Skeleton } from './components/ui/skeleton';
|
|
41
45
|
export { Slider } from './components/ui/slider';
|
|
@@ -48,6 +52,7 @@ export { Toggle, toggleVariants } from './components/ui/toggle';
|
|
|
48
52
|
export { ToggleGroup, ToggleGroupItem } from './components/ui/toggle-group';
|
|
49
53
|
export { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, } from './components/ui/tooltip';
|
|
50
54
|
export { AppShell, type AppShellCompte, type AppShellEntreeCompte, type AppShellLien, type AppShellLienComposant, type AppShellProps, type AppShellSection, } from './components/etic/app-shell';
|
|
55
|
+
export { NavTabs, type NavTabsLien, type NavTabsProps, } from './components/etic/nav-tabs';
|
|
51
56
|
export { type LienComposant, LienProvider, type LienProviderProps, useLien, } from './components/etic/lien';
|
|
52
57
|
export { ThemeMenu, type ThemeMenuProps } from './components/etic/theme-menu';
|
|
53
58
|
export { appliquerTheme, useThemeApplique } from './theme';
|
|
@@ -56,24 +61,30 @@ export type { ActionDialogue } from './components/etic/action';
|
|
|
56
61
|
export { fermerSaufEnCours } from './components/etic/action';
|
|
57
62
|
export { AuthAvatar, type AuthAvatarProps, AuthImage, type AuthImageCharger, type AuthImageProps, type AuthObjectUrlEtat, useAuthObjectUrl, useAuthObjectUrlEtat, } from './components/etic/auth-image';
|
|
58
63
|
export { ButtonLink, type ButtonLinkProps } from './components/etic/button-link';
|
|
64
|
+
export { DropdownMenuExternalLink, type DropdownMenuExternalLinkProps, ExternalLink, type ExternalLinkProps, } from './components/etic/external-link';
|
|
59
65
|
export { CenteredScreen, type CenteredScreenProps, MessageScreen, type MessageScreenProps, } from './components/etic/centered-screen';
|
|
60
66
|
export { ConfirmDialog, type ConfirmDialogProps, type ConfirmDialogSaisie, type ConfirmDialogTaille, type DialogFinalFocus, } from './components/etic/confirm-dialog';
|
|
61
67
|
export { CopyButton, type CopyButtonProps } from './components/etic/copy-button';
|
|
62
68
|
export { DeleteButton, type DeleteButtonProps, } from './components/etic/delete-button';
|
|
63
69
|
export { DetailItem, type DetailItemProps, DetailList, type DetailListProps, type DetailListDisposition, } from './components/etic/detail-list';
|
|
70
|
+
export { DetailSheet, type DetailSheetIntrouvable, type DetailSheetProps, } from './components/etic/detail-sheet';
|
|
71
|
+
export { useDetailSheet, type UseDetailSheetOptions, type UseDetailSheetResultat, } from './components/etic/use-detail-sheet';
|
|
64
72
|
export { Disclosure, type DisclosureProps, type DisclosureTaille, DisclosureTrigger, type DisclosureTriggerProps, type DisclosureVariante, } from './components/etic/disclosure';
|
|
65
73
|
export { DropdownMenuAction, type DropdownMenuActionProps, } from './components/etic/dropdown-menu-action';
|
|
66
74
|
export { DraftResumeDialog, type DraftResumeDialogProps, } from './components/etic/draft-resume-dialog';
|
|
67
|
-
export { EmptyState, type EmptyStateProps } from './components/etic/empty-state';
|
|
75
|
+
export { EmptyState, type EmptyStateProps, FilteredEmptyState, type FilteredEmptyStateProps, } from './components/etic/empty-state';
|
|
68
76
|
export { BoutonReessayer, type BoutonReessayerProps, decrireErreur, DetailTechnique, type ErreurDecrite, ErrorBanner, type ErrorBannerProps, ErrorBannerProvider, type ErrorBannerProviderProps, } from './components/etic/error-banner';
|
|
69
77
|
export { ErrorBoundary, type ErrorBoundaryProps, } from './components/etic/error-boundary';
|
|
70
78
|
export { FormDialog, type FormDialogActionSecondaire, type FormDialogProps, type FormDialogTaille, } from './components/etic/form-dialog';
|
|
71
79
|
export { IconToggle, type IconToggleProps } from './components/etic/icon-toggle';
|
|
72
80
|
export { Loading, type LoadingProps, SkeletonCard, type SkeletonCardProps, SkeletonPage, type SkeletonPageProps, SkeletonTable, type SkeletonTableProps, } from './components/etic/loading';
|
|
73
81
|
export { DetailHeader, type DetailHeaderActionSecondaire, type DetailHeaderEtape, type DetailHeaderProps, PageHeader, type PageHeaderProps, } from './components/etic/page-header';
|
|
82
|
+
export { DetailMeta, DetailMetaLink, type DetailMetaLinkProps, type DetailMetaProps, } from './components/etic/detail-meta';
|
|
74
83
|
export { PageContainer, type PageContainerLargeur, type PageContainerProps, } from './components/etic/page-container';
|
|
75
84
|
export { QueryBoundary, type QueryBoundaryProps, type QueryBoundaryRequete, QueryErrorBanner, type QueryErrorBannerProps, } from './components/etic/query-boundary';
|
|
76
85
|
export { SectionCard, type SectionCardProps, } from './components/etic/section-card';
|
|
86
|
+
export { SubSection, type SubSectionProps } from './components/etic/sub-section';
|
|
87
|
+
export { CodeBlock, type CodeBlockProps } from './components/etic/code-block';
|
|
77
88
|
export { StatTile, type StatTileProps } from './components/etic/stat-tile';
|
|
78
89
|
export { ProgressRing, type ProgressRingProps, } from './components/etic/progress-ring';
|
|
79
90
|
export { VerdictPanel, type VerdictPanelProps, } from './components/etic/verdict-panel';
|
|
@@ -91,7 +102,8 @@ export { FormField, type FormFieldControleProps, type FormFieldProps, FormSectio
|
|
|
91
102
|
export { type FormFieldContexte, useFormField, } from './components/etic/form-field-context';
|
|
92
103
|
export { DatePicker, type DatePickerDetails, type DatePickerProps, } from './components/etic/date-picker';
|
|
93
104
|
export { type CountryCode, formaterTelephone, PhoneInput, type PhoneInputDetails, type PhoneInputProps, } from './components/etic/phone-input';
|
|
94
|
-
export { FileDropZone, type FileDropZoneProps, type FileUploadAccept, FileUploadButton, type FileUploadButtonProps, type FileUploadOptions, } from './components/etic/file-upload';
|
|
105
|
+
export { FileDropZone, type FileDropZoneProps, type FileUploadAccept, FileUploadButton, type FileUploadButtonProps, type FileUploadOptions, SelectedFile, type SelectedFileProps, } from './components/etic/file-upload';
|
|
106
|
+
export { SelectField, type SelectFieldOption, type SelectFieldProps, } from './components/etic/select-field';
|
|
95
107
|
export { SegmentedControl, type SegmentedControlOption, type SegmentedControlProps, } from './components/etic/segmented-control';
|
|
96
108
|
export { CheckboxList, type CheckboxListOption, type CheckboxListProps, } from './components/etic/checkbox-list';
|
|
97
109
|
export { type DraftAutosave, type DraftAutosaveOptions, useDraftAutosave, } from './components/etic/use-draft-autosave';
|
|
@@ -105,4 +117,6 @@ export { DataTableCount, DataTableSelectFilter, DataTableToolbar, type DataTable
|
|
|
105
117
|
export { DataTableViewOptions, type DataTableViewOptionsProps, type DataTableViewOptionsColonne, type DataTableViewOptionsColonnesProps, type DataTableViewOptionsTableProps, } from './components/etic/data-table-view-options';
|
|
106
118
|
export { PorteeStockageLocal, usePersistedState, type PorteeStockageLocalProps, type UsePersistedStateOptions, } from './hooks/use-persisted-state';
|
|
107
119
|
export { useColumnPrefs, type ColumnPrefs, type ColumnPrefsOptionsTableau, type ColumnPrefsResultat, type UseColumnPrefsOptions, } from './hooks/use-column-prefs';
|
|
120
|
+
export { type ServerPageRequete, useServerPagination, type UseServerPaginationOptions, type UseServerPaginationResultat, } from './components/etic/use-server-pagination';
|
|
121
|
+
export { type SensTri, useServerSorting, type UseServerSortingOptions, type UseServerSortingResultat, } from './components/etic/use-server-sorting';
|
|
108
122
|
export type { ColumnOrderState, ColumnVisibilityState, ExpandedStateList, OnChangeFn, RowSelectionState, SortingState, ColumnFiltersState, PaginationState, } from '@tanstack/react-table';
|
package/dist/index.js
CHANGED
|
@@ -1,105 +1,119 @@
|
|
|
1
1
|
import { cn as e } from "./lib/utils.js";
|
|
2
2
|
import { MOBILE_MEDIA_QUERY as t, useIsMobile as n } from "./hooks/use-mobile.js";
|
|
3
|
-
import { accorde as r,
|
|
4
|
-
import { ecrireDateIso as
|
|
5
|
-
import { comparerFr as
|
|
6
|
-
import { NO_AUTOFILL as
|
|
7
|
-
import { useDebouncedValue as
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
27
|
-
import {
|
|
28
|
-
import {
|
|
29
|
-
import {
|
|
30
|
-
import {
|
|
31
|
-
import {
|
|
32
|
-
import {
|
|
33
|
-
import {
|
|
34
|
-
import {
|
|
35
|
-
import {
|
|
36
|
-
import {
|
|
37
|
-
import {
|
|
38
|
-
import {
|
|
39
|
-
import {
|
|
40
|
-
import {
|
|
41
|
-
import {
|
|
42
|
-
import {
|
|
43
|
-
import {
|
|
44
|
-
import {
|
|
45
|
-
import {
|
|
46
|
-
import {
|
|
47
|
-
import {
|
|
48
|
-
import {
|
|
49
|
-
import {
|
|
50
|
-
import {
|
|
51
|
-
import {
|
|
52
|
-
import {
|
|
53
|
-
import {
|
|
54
|
-
import {
|
|
55
|
-
import {
|
|
56
|
-
import {
|
|
57
|
-
import {
|
|
58
|
-
import {
|
|
59
|
-
import {
|
|
60
|
-
import {
|
|
61
|
-
import {
|
|
62
|
-
import {
|
|
63
|
-
import {
|
|
64
|
-
import {
|
|
65
|
-
import {
|
|
66
|
-
import {
|
|
67
|
-
import {
|
|
68
|
-
import {
|
|
69
|
-
import {
|
|
70
|
-
import {
|
|
71
|
-
import {
|
|
72
|
-
import {
|
|
73
|
-
import {
|
|
74
|
-
import {
|
|
75
|
-
import {
|
|
76
|
-
import {
|
|
77
|
-
import {
|
|
78
|
-
import {
|
|
79
|
-
import {
|
|
80
|
-
import {
|
|
81
|
-
import {
|
|
82
|
-
import {
|
|
83
|
-
import {
|
|
84
|
-
import {
|
|
85
|
-
import {
|
|
86
|
-
import {
|
|
87
|
-
import {
|
|
88
|
-
import {
|
|
89
|
-
import {
|
|
90
|
-
import {
|
|
91
|
-
import {
|
|
92
|
-
import {
|
|
93
|
-
import {
|
|
94
|
-
import {
|
|
95
|
-
import {
|
|
96
|
-
import {
|
|
97
|
-
import {
|
|
98
|
-
import {
|
|
99
|
-
import {
|
|
100
|
-
import {
|
|
101
|
-
import {
|
|
102
|
-
import {
|
|
103
|
-
import {
|
|
104
|
-
import {
|
|
105
|
-
|
|
3
|
+
import { accorde as r, capitaliser as i, compte as a, formaterAnciennete as o, formaterDate as s, formaterDateHeure as c, formaterDateHeureLongue as l, formaterDuree as u, formaterDureeArrondie as d, formaterDureePrecise as f, formaterHeure as p, formaterHorodatage as m, formaterMontant as h, formaterNombre as g, formaterOctets as _, formaterPourcentage as v, initiales as y, nombreFr as b, participe as x, uniteAccordee as S } from "./lib/format.js";
|
|
4
|
+
import { ecrireDateIso as C, lireDateIso as w } from "./lib/dates.js";
|
|
5
|
+
import { comparerFr as T, correspondance as E, normaliser as D, normaliserRecherche as O } from "./lib/normalize.js";
|
|
6
|
+
import { NO_AUTOFILL as k } from "./lib/autofill.js";
|
|
7
|
+
import { useDebouncedValue as A } from "./hooks/use-debounced-value.js";
|
|
8
|
+
import { useDebouncedSearch as j } from "./hooks/use-debounced-search.js";
|
|
9
|
+
import { useFreshDialog as M } from "./hooks/use-fresh-dialog.js";
|
|
10
|
+
import { useLoadOnOpen as N } from "./hooks/use-load-on-open.js";
|
|
11
|
+
import { useSaveByKey as P } from "./hooks/use-save-by-key.js";
|
|
12
|
+
import { useDocumentTitle as F } from "./hooks/use-document-title.js";
|
|
13
|
+
import { Alert as I, AlertAction as L, AlertDescription as R, AlertTitle as z } from "./components/ui/alert.js";
|
|
14
|
+
import { AlertDialog as B, AlertDialogAction as V, AlertDialogCancel as H, AlertDialogContent as U, AlertDialogDescription as W, AlertDialogFooter as G, AlertDialogHeader as K, AlertDialogMedia as q, AlertDialogOverlay as J, AlertDialogPortal as Y, AlertDialogTitle as X, AlertDialogTrigger as Z } from "./components/ui/alert-dialog.js";
|
|
15
|
+
import { Avatar as Q, AvatarBadge as $, AvatarFallback as ee, AvatarGroup as te, AvatarGroupCount as ne, AvatarImage as re } from "./components/ui/avatar.js";
|
|
16
|
+
import { Badge as ie, badgeVariants as ae } from "./components/ui/badge.js";
|
|
17
|
+
import { Breadcrumb as oe, BreadcrumbEllipsis as se, BreadcrumbItem as ce, BreadcrumbLink as le, BreadcrumbList as ue, BreadcrumbPage as de, BreadcrumbSeparator as fe } from "./components/ui/breadcrumb.js";
|
|
18
|
+
import { Button as pe, buttonVariants as me } from "./components/ui/button.js";
|
|
19
|
+
import { ButtonGroup as he, ButtonGroupSeparator as ge, ButtonGroupText as _e, buttonGroupVariants as ve } from "./components/ui/button-group.js";
|
|
20
|
+
import { Calendar as ye, CalendarDayButton as be } from "./components/ui/calendar.js";
|
|
21
|
+
import { Card as xe, CardAction as Se, CardContent as Ce, CardDescription as we, CardFooter as Te, CardHeader as Ee, CardTitle as De } from "./components/ui/card.js";
|
|
22
|
+
import { Checkbox as Oe } from "./components/ui/checkbox.js";
|
|
23
|
+
import { Collapsible as ke, CollapsibleContent as Ae, CollapsibleTrigger as je } from "./components/ui/collapsible.js";
|
|
24
|
+
import { Combobox as Me, ComboboxChip as Ne, ComboboxChips as Pe, ComboboxChipsInput as Fe, ComboboxCollection as Ie, ComboboxContent as Le, ComboboxEmpty as Re, ComboboxGroup as ze, ComboboxInput as Be, ComboboxItem as Ve, ComboboxLabel as He, ComboboxList as Ue, ComboboxSeparator as We, ComboboxTrigger as Ge, ComboboxValue as Ke, useComboboxAnchor as qe } from "./components/ui/combobox.js";
|
|
25
|
+
import { Dialog as Je, DialogBody as Ye, DialogClose as Xe, DialogContent as Ze, DialogDescription as Qe, DialogFooter as $e, DialogHeader as et, DialogOverlay as tt, DialogPortal as nt, DialogTitle as rt, DialogTrigger as it } from "./components/ui/dialog.js";
|
|
26
|
+
import { DropdownMenu as at, DropdownMenuCheckboxItem as ot, DropdownMenuContent as st, DropdownMenuGroup as ct, DropdownMenuItem as lt, DropdownMenuLabel as ut, DropdownMenuPortal as dt, DropdownMenuRadioGroup as ft, DropdownMenuRadioItem as pt, DropdownMenuSeparator as mt, DropdownMenuShortcut as ht, DropdownMenuSub as gt, DropdownMenuSubContent as _t, DropdownMenuSubTrigger as vt, DropdownMenuTrigger as yt } from "./components/ui/dropdown-menu.js";
|
|
27
|
+
import { Empty as bt, EmptyContent as xt, EmptyDescription as St, EmptyHeader as Ct, EmptyMedia as wt, EmptyTitle as Tt } from "./components/ui/empty.js";
|
|
28
|
+
import { Field as Et, FieldContent as Dt, FieldDescription as Ot, FieldError as kt, FieldGroup as At, FieldLabel as jt, FieldLegend as Mt, FieldSeparator as Nt, FieldSet as Pt, FieldTitle as Ft } from "./components/ui/field.js";
|
|
29
|
+
import { Input as It } from "./components/ui/input.js";
|
|
30
|
+
import { InputGroup as Lt, InputGroupAddon as Rt, InputGroupButton as zt, InputGroupInput as Bt, InputGroupText as Vt, InputGroupTextarea as Ht } from "./components/ui/input-group.js";
|
|
31
|
+
import { Item as Ut, ItemActions as Wt, ItemContent as Gt, ItemDescription as Kt, ItemFooter as qt, ItemGroup as Jt, ItemHeader as Yt, ItemMedia as Xt, ItemSeparator as Zt, ItemTitle as Qt } from "./components/ui/item.js";
|
|
32
|
+
import { Kbd as $t, KbdGroup as en } from "./components/ui/kbd.js";
|
|
33
|
+
import { Label as tn } from "./components/ui/label.js";
|
|
34
|
+
import { NativeSelect as nn, NativeSelectOptGroup as rn, NativeSelectOption as an } from "./components/ui/native-select.js";
|
|
35
|
+
import { Pagination as on, PaginationContent as sn, PaginationEllipsis as cn, PaginationItem as ln, PaginationLink as un, PaginationNext as dn, PaginationPrevious as fn } from "./components/ui/pagination.js";
|
|
36
|
+
import { Popover as pn, PopoverContent as mn, PopoverDescription as hn, PopoverHeader as gn, PopoverTitle as _n, PopoverTrigger as vn } from "./components/ui/popover.js";
|
|
37
|
+
import { Progress as yn, ProgressIndicator as bn, ProgressLabel as xn, ProgressTrack as Sn, ProgressValue as Cn } from "./components/ui/progress.js";
|
|
38
|
+
import { RadioGroup as wn, RadioGroupItem as Tn } from "./components/ui/radio-group.js";
|
|
39
|
+
import { ScrollArea as En, ScrollBar as Dn } from "./components/ui/scroll-area.js";
|
|
40
|
+
import { Select as On, SelectContent as kn, SelectGroup as An, SelectItem as jn, SelectLabel as Mn, SelectScrollDownButton as Nn, SelectScrollUpButton as Pn, SelectSeparator as Fn, SelectTrigger as In, SelectValue as Ln } from "./components/ui/select.js";
|
|
41
|
+
import { Separator as Rn } from "./components/ui/separator.js";
|
|
42
|
+
import { Sheet as zn, SheetBody as Bn, SheetClose as Vn, SheetContent as Hn, SheetDescription as Un, SheetFooter as Wn, SheetHeader as Gn, SheetTitle as Kn, SheetTrigger as qn } from "./components/ui/sheet.js";
|
|
43
|
+
import { Sidebar as Jn, SidebarContent as Yn, SidebarFooter as Xn, SidebarGroup as Zn, SidebarGroupAction as Qn, SidebarGroupContent as $n, SidebarGroupLabel as er, SidebarHeader as tr, SidebarInput as nr, SidebarInset as rr, SidebarMenu as ir, SidebarMenuAction as ar, SidebarMenuBadge as or, SidebarMenuButton as sr, SidebarMenuItem as cr, SidebarMenuSkeleton as lr, SidebarMenuSub as ur, SidebarMenuSubButton as dr, SidebarMenuSubItem as fr, SidebarProvider as pr, SidebarRail as mr, SidebarSeparator as hr, SidebarTrigger as gr, useSidebar as _r } from "./components/ui/sidebar.js";
|
|
44
|
+
import { Skeleton as vr } from "./components/ui/skeleton.js";
|
|
45
|
+
import { Slider as yr } from "./components/ui/slider.js";
|
|
46
|
+
import { Spinner as br, SpinnerDecoratif as xr } from "./components/ui/spinner.js";
|
|
47
|
+
import { Switch as Sr } from "./components/ui/switch.js";
|
|
48
|
+
import { Table as Cr, TableBody as wr, TableCaption as Tr, TableCell as Er, TableFooter as Dr, TableHead as Or, TableHeader as kr, TableRow as Ar } from "./components/ui/table.js";
|
|
49
|
+
import { Tabs as jr, TabsContent as Mr, TabsList as Nr, TabsTrigger as Pr, tabsListVariants as Fr } from "./components/ui/tabs.js";
|
|
50
|
+
import { Textarea as Ir } from "./components/ui/textarea.js";
|
|
51
|
+
import { Toggle as Lr, toggleVariants as Rr } from "./components/ui/toggle.js";
|
|
52
|
+
import { ToggleGroup as zr, ToggleGroupItem as Br } from "./components/ui/toggle-group.js";
|
|
53
|
+
import { Tooltip as Vr, TooltipContent as Hr, TooltipProvider as Ur, TooltipTrigger as Wr } from "./components/ui/tooltip.js";
|
|
54
|
+
import { AppShell as Gr } from "./components/etic/app-shell.js";
|
|
55
|
+
import { NavTabs as Kr } from "./components/etic/nav-tabs.js";
|
|
56
|
+
import { LienProvider as qr, useLien as Jr } from "./components/etic/lien.js";
|
|
57
|
+
import { ThemeMenu as Yr } from "./components/etic/theme-menu.js";
|
|
58
|
+
import { appliquerTheme as Xr, useThemeApplique as Zr } from "./theme.js";
|
|
59
|
+
import { fermerSaufEnCours as Qr } from "./components/etic/action.js";
|
|
60
|
+
import { AuthAvatar as $r, AuthImage as ei, useAuthObjectUrl as ti, useAuthObjectUrlEtat as ni } from "./components/etic/auth-image.js";
|
|
61
|
+
import { ButtonLink as ri } from "./components/etic/button-link.js";
|
|
62
|
+
import { DropdownMenuExternalLink as ii, ExternalLink as ai } from "./components/etic/external-link.js";
|
|
63
|
+
import { CenteredScreen as oi, MessageScreen as si } from "./components/etic/centered-screen.js";
|
|
64
|
+
import { ConfirmDialog as ci } from "./components/etic/confirm-dialog.js";
|
|
65
|
+
import { CopyButton as li } from "./components/etic/copy-button.js";
|
|
66
|
+
import { DeleteButton as ui } from "./components/etic/delete-button.js";
|
|
67
|
+
import { DetailItem as di, DetailList as fi } from "./components/etic/detail-list.js";
|
|
68
|
+
import { DetailSheet as pi } from "./components/etic/detail-sheet.js";
|
|
69
|
+
import { useDetailSheet as mi } from "./components/etic/use-detail-sheet.js";
|
|
70
|
+
import { Disclosure as hi, DisclosureTrigger as gi } from "./components/etic/disclosure.js";
|
|
71
|
+
import { DropdownMenuAction as _i } from "./components/etic/dropdown-menu-action.js";
|
|
72
|
+
import { DraftResumeDialog as vi } from "./components/etic/draft-resume-dialog.js";
|
|
73
|
+
import { EmptyState as yi, FilteredEmptyState as bi } from "./components/etic/empty-state.js";
|
|
74
|
+
import { BoutonReessayer as xi, DetailTechnique as Si, ErrorBanner as Ci, ErrorBannerProvider as wi, decrireErreur as Ti } from "./components/etic/error-banner.js";
|
|
75
|
+
import { ErrorBoundary as Ei } from "./components/etic/error-boundary.js";
|
|
76
|
+
import { FormDialog as Di } from "./components/etic/form-dialog.js";
|
|
77
|
+
import { IconToggle as Oi } from "./components/etic/icon-toggle.js";
|
|
78
|
+
import { Loading as ki, SkeletonCard as Ai, SkeletonPage as ji, SkeletonTable as Mi } from "./components/etic/loading.js";
|
|
79
|
+
import { DetailHeader as Ni, PageHeader as Pi } from "./components/etic/page-header.js";
|
|
80
|
+
import { DetailMeta as Fi, DetailMetaLink as Ii } from "./components/etic/detail-meta.js";
|
|
81
|
+
import { PageContainer as Li } from "./components/etic/page-container.js";
|
|
82
|
+
import { QueryBoundary as Ri, QueryErrorBanner as zi } from "./components/etic/query-boundary.js";
|
|
83
|
+
import { SectionCard as Bi } from "./components/etic/section-card.js";
|
|
84
|
+
import { SubSection as Vi } from "./components/etic/sub-section.js";
|
|
85
|
+
import { CodeBlock as Hi } from "./components/etic/code-block.js";
|
|
86
|
+
import { StatTile as Ui } from "./components/etic/stat-tile.js";
|
|
87
|
+
import { ProgressRing as Wi } from "./components/etic/progress-ring.js";
|
|
88
|
+
import { VerdictPanel as Gi } from "./components/etic/verdict-panel.js";
|
|
89
|
+
import { StatGrid as Ki } from "./components/etic/stat-grid.js";
|
|
90
|
+
import { StatusBadge as qi } from "./components/etic/status-badge.js";
|
|
91
|
+
import { RemovableBadge as Ji } from "./components/etic/removable-badge.js";
|
|
92
|
+
import { ExplainedBadge as Yi } from "./components/etic/explained-badge.js";
|
|
93
|
+
import { Toggletip as Xi } from "./components/etic/toggletip.js";
|
|
94
|
+
import { SaveBar as Zi } from "./components/etic/save-bar.js";
|
|
95
|
+
import { ResetButton as Qi } from "./components/etic/reset-button.js";
|
|
96
|
+
import { TooltipButton as $i } from "./components/etic/tooltip-button.js";
|
|
97
|
+
import { UnsavedChangesDialog as ea } from "./components/etic/unsaved-changes.js";
|
|
98
|
+
import { useUnsavedChangesWarning as ta } from "./components/etic/use-unsaved-changes-warning.js";
|
|
99
|
+
import { FormField as na, FormSection as ra, RequiredMark as ia } from "./components/etic/form-field.js";
|
|
100
|
+
import { useFormField as aa } from "./components/etic/form-field-context.js";
|
|
101
|
+
import { DatePicker as oa } from "./components/etic/date-picker.js";
|
|
102
|
+
import { PhoneInput as sa, formaterTelephone as ca } from "./components/etic/phone-input.js";
|
|
103
|
+
import { FileDropZone as la, FileUploadButton as ua, SelectedFile as da } from "./components/etic/file-upload.js";
|
|
104
|
+
import { SelectField as fa } from "./components/etic/select-field.js";
|
|
105
|
+
import { SegmentedControl as pa } from "./components/etic/segmented-control.js";
|
|
106
|
+
import { CheckboxList as ma } from "./components/etic/checkbox-list.js";
|
|
107
|
+
import { useDraftAutosave as ha } from "./components/etic/use-draft-autosave.js";
|
|
108
|
+
import { SearchSelect as ga } from "./components/etic/search-select.js";
|
|
109
|
+
import { DataTable as _a, DataTableCellLink as va, DataTableColumnHeader as ya, DataTableRowActions as ba, createDataTableColumnHelper as xa, dataTableActionsColumn as Sa, dataTableExpandColumn as Ca, dataTableFeatures as wa, dataTableSelectionColumn as Ta, useDataTable as Ea } from "./components/etic/data-table.js";
|
|
110
|
+
import { focaliserTableau as Da } from "./components/etic/data-table-focus.js";
|
|
111
|
+
import { DataTableBulkActions as Oa } from "./components/etic/data-table-bulk-actions.js";
|
|
112
|
+
import { DataTablePagination as ka } from "./components/etic/data-table-pagination.js";
|
|
113
|
+
import { DataTableCount as Aa, DataTableSelectFilter as ja, DataTableToolbar as Ma } from "./components/etic/data-table-toolbar.js";
|
|
114
|
+
import { DataTableViewOptions as Na } from "./components/etic/data-table-view-options.js";
|
|
115
|
+
import { PorteeStockageLocal as Pa, usePersistedState as Fa } from "./hooks/use-persisted-state.js";
|
|
116
|
+
import { useColumnPrefs as Ia } from "./hooks/use-column-prefs.js";
|
|
117
|
+
import { useServerPagination as La } from "./components/etic/use-server-pagination.js";
|
|
118
|
+
import { useServerSorting as Ra } from "./components/etic/use-server-sorting.js";
|
|
119
|
+
export { I as Alert, L as AlertAction, R as AlertDescription, B as AlertDialog, V as AlertDialogAction, H as AlertDialogCancel, U as AlertDialogContent, W as AlertDialogDescription, G as AlertDialogFooter, K as AlertDialogHeader, q as AlertDialogMedia, J as AlertDialogOverlay, Y as AlertDialogPortal, X as AlertDialogTitle, Z as AlertDialogTrigger, z as AlertTitle, Gr as AppShell, $r as AuthAvatar, ei as AuthImage, Q as Avatar, $ as AvatarBadge, ee as AvatarFallback, te as AvatarGroup, ne as AvatarGroupCount, re as AvatarImage, ie as Badge, xi as BoutonReessayer, oe as Breadcrumb, se as BreadcrumbEllipsis, ce as BreadcrumbItem, le as BreadcrumbLink, ue as BreadcrumbList, de as BreadcrumbPage, fe as BreadcrumbSeparator, pe as Button, he as ButtonGroup, ge as ButtonGroupSeparator, _e as ButtonGroupText, ri as ButtonLink, ye as Calendar, be as CalendarDayButton, xe as Card, Se as CardAction, Ce as CardContent, we as CardDescription, Te as CardFooter, Ee as CardHeader, De as CardTitle, oi as CenteredScreen, Oe as Checkbox, ma as CheckboxList, Hi as CodeBlock, ke as Collapsible, Ae as CollapsibleContent, je as CollapsibleTrigger, Me as Combobox, Ne as ComboboxChip, Pe as ComboboxChips, Fe as ComboboxChipsInput, Ie as ComboboxCollection, Le as ComboboxContent, Re as ComboboxEmpty, ze as ComboboxGroup, Be as ComboboxInput, Ve as ComboboxItem, He as ComboboxLabel, Ue as ComboboxList, We as ComboboxSeparator, Ge as ComboboxTrigger, Ke as ComboboxValue, ci as ConfirmDialog, li as CopyButton, _a as DataTable, Oa as DataTableBulkActions, va as DataTableCellLink, ya as DataTableColumnHeader, Aa as DataTableCount, ka as DataTablePagination, ba as DataTableRowActions, ja as DataTableSelectFilter, Ma as DataTableToolbar, Na as DataTableViewOptions, oa as DatePicker, ui as DeleteButton, Ni as DetailHeader, di as DetailItem, fi as DetailList, Fi as DetailMeta, Ii as DetailMetaLink, pi as DetailSheet, Si as DetailTechnique, Je as Dialog, Ye as DialogBody, Xe as DialogClose, Ze as DialogContent, Qe as DialogDescription, $e as DialogFooter, et as DialogHeader, tt as DialogOverlay, nt as DialogPortal, rt as DialogTitle, it as DialogTrigger, hi as Disclosure, gi as DisclosureTrigger, vi as DraftResumeDialog, at as DropdownMenu, _i as DropdownMenuAction, ot as DropdownMenuCheckboxItem, st as DropdownMenuContent, ii as DropdownMenuExternalLink, ct as DropdownMenuGroup, lt as DropdownMenuItem, ut as DropdownMenuLabel, dt as DropdownMenuPortal, ft as DropdownMenuRadioGroup, pt as DropdownMenuRadioItem, mt as DropdownMenuSeparator, ht as DropdownMenuShortcut, gt as DropdownMenuSub, _t as DropdownMenuSubContent, vt as DropdownMenuSubTrigger, yt as DropdownMenuTrigger, bt as Empty, xt as EmptyContent, St as EmptyDescription, Ct as EmptyHeader, wt as EmptyMedia, yi as EmptyState, Tt as EmptyTitle, Ci as ErrorBanner, wi as ErrorBannerProvider, Ei as ErrorBoundary, Yi as ExplainedBadge, ai as ExternalLink, Et as Field, Dt as FieldContent, Ot as FieldDescription, kt as FieldError, At as FieldGroup, jt as FieldLabel, Mt as FieldLegend, Nt as FieldSeparator, Pt as FieldSet, Ft as FieldTitle, la as FileDropZone, ua as FileUploadButton, bi as FilteredEmptyState, Di as FormDialog, na as FormField, ra as FormSection, Oi as IconToggle, It as Input, Lt as InputGroup, Rt as InputGroupAddon, zt as InputGroupButton, Bt as InputGroupInput, Vt as InputGroupText, Ht as InputGroupTextarea, Ut as Item, Wt as ItemActions, Gt as ItemContent, Kt as ItemDescription, qt as ItemFooter, Jt as ItemGroup, Yt as ItemHeader, Xt as ItemMedia, Zt as ItemSeparator, Qt as ItemTitle, $t as Kbd, en as KbdGroup, tn as Label, qr as LienProvider, ki as Loading, t as MOBILE_MEDIA_QUERY, si as MessageScreen, k as NO_AUTOFILL, nn as NativeSelect, rn as NativeSelectOptGroup, an as NativeSelectOption, Kr as NavTabs, Li as PageContainer, Pi as PageHeader, on as Pagination, sn as PaginationContent, cn as PaginationEllipsis, ln as PaginationItem, un as PaginationLink, dn as PaginationNext, fn as PaginationPrevious, sa as PhoneInput, pn as Popover, mn as PopoverContent, hn as PopoverDescription, gn as PopoverHeader, _n as PopoverTitle, vn as PopoverTrigger, Pa as PorteeStockageLocal, yn as Progress, bn as ProgressIndicator, xn as ProgressLabel, Wi as ProgressRing, Sn as ProgressTrack, Cn as ProgressValue, Ri as QueryBoundary, zi as QueryErrorBanner, wn as RadioGroup, Tn as RadioGroupItem, Ji as RemovableBadge, ia as RequiredMark, Qi as ResetButton, Zi as SaveBar, En as ScrollArea, Dn as ScrollBar, ga as SearchSelect, Bi as SectionCard, pa as SegmentedControl, On as Select, kn as SelectContent, fa as SelectField, An as SelectGroup, jn as SelectItem, Mn as SelectLabel, Nn as SelectScrollDownButton, Pn as SelectScrollUpButton, Fn as SelectSeparator, In as SelectTrigger, Ln as SelectValue, da as SelectedFile, Rn as Separator, zn as Sheet, Bn as SheetBody, Vn as SheetClose, Hn as SheetContent, Un as SheetDescription, Wn as SheetFooter, Gn as SheetHeader, Kn as SheetTitle, qn as SheetTrigger, Jn as Sidebar, Yn as SidebarContent, Xn as SidebarFooter, Zn as SidebarGroup, Qn as SidebarGroupAction, $n as SidebarGroupContent, er as SidebarGroupLabel, tr as SidebarHeader, nr as SidebarInput, rr as SidebarInset, ir as SidebarMenu, ar as SidebarMenuAction, or as SidebarMenuBadge, sr as SidebarMenuButton, cr as SidebarMenuItem, lr as SidebarMenuSkeleton, ur as SidebarMenuSub, dr as SidebarMenuSubButton, fr as SidebarMenuSubItem, pr as SidebarProvider, mr as SidebarRail, hr as SidebarSeparator, gr as SidebarTrigger, vr as Skeleton, Ai as SkeletonCard, ji as SkeletonPage, Mi as SkeletonTable, yr as Slider, br as Spinner, xr as SpinnerDecoratif, Ki as StatGrid, Ui as StatTile, qi as StatusBadge, Vi as SubSection, Sr as Switch, Cr as Table, wr as TableBody, Tr as TableCaption, Er as TableCell, Dr as TableFooter, Or as TableHead, kr as TableHeader, Ar as TableRow, jr as Tabs, Mr as TabsContent, Nr as TabsList, Pr as TabsTrigger, Ir as Textarea, Yr as ThemeMenu, Lr as Toggle, zr as ToggleGroup, Br as ToggleGroupItem, Xi as Toggletip, Vr as Tooltip, $i as TooltipButton, Hr as TooltipContent, Ur as TooltipProvider, Wr as TooltipTrigger, ea as UnsavedChangesDialog, Gi as VerdictPanel, r as accorde, Xr as appliquerTheme, ae as badgeVariants, ve as buttonGroupVariants, me as buttonVariants, i as capitaliser, e as cn, T as comparerFr, a as compte, E as correspondance, xa as createDataTableColumnHelper, Sa as dataTableActionsColumn, Ca as dataTableExpandColumn, wa as dataTableFeatures, Ta as dataTableSelectionColumn, Ti as decrireErreur, C as ecrireDateIso, Qr as fermerSaufEnCours, Da as focaliserTableau, o as formaterAnciennete, s as formaterDate, c as formaterDateHeure, l as formaterDateHeureLongue, u as formaterDuree, d as formaterDureeArrondie, f as formaterDureePrecise, p as formaterHeure, m as formaterHorodatage, h as formaterMontant, g as formaterNombre, _ as formaterOctets, v as formaterPourcentage, ca as formaterTelephone, y as initiales, w as lireDateIso, b as nombreFr, D as normaliser, O as normaliserRecherche, x as participe, Fr as tabsListVariants, Rr as toggleVariants, S as uniteAccordee, ti as useAuthObjectUrl, ni as useAuthObjectUrlEtat, Ia as useColumnPrefs, qe as useComboboxAnchor, Ea as useDataTable, j as useDebouncedSearch, A as useDebouncedValue, mi as useDetailSheet, F as useDocumentTitle, ha as useDraftAutosave, aa as useFormField, M as useFreshDialog, n as useIsMobile, Jr as useLien, N as useLoadOnOpen, Fa as usePersistedState, P as useSaveByKey, La as useServerPagination, Ra as useServerSorting, _r as useSidebar, Zr as useThemeApplique, ta as useUnsavedChangesWarning };
|
package/dist/lib/format.d.ts
CHANGED
|
@@ -21,12 +21,38 @@ export declare const accorde: (n: number, singulier: string, pluriel?: string) =
|
|
|
21
21
|
/** Nombre et nom accordé : `compte(1234, "ligne")` → « 1 234 lignes »,
|
|
22
22
|
* `compte(0, "doublon")` → « 0 doublon ». */
|
|
23
23
|
export declare const compte: (n: number, singulier: string, pluriel?: string) => string;
|
|
24
|
+
/** Nombre à la française (« 2,5 », « 1 234 ») ; le repli sans valeur. */
|
|
25
|
+
export declare function formaterNombre(valeur: number | null | undefined, repli?: string): string;
|
|
26
|
+
/** Montant : « 1 234,50 € » (euros par défaut, `devise` ISO 4217 sinon). */
|
|
27
|
+
export declare function formaterMontant(valeur: number | null | undefined, { devise, repli }?: {
|
|
28
|
+
devise?: string;
|
|
29
|
+
repli?: string;
|
|
30
|
+
}): string;
|
|
31
|
+
/** Une fraction en pourcentage : 0,55 → « 55 % » ; `decimales` au plus
|
|
32
|
+
* (0 par défaut : arrondi à l'unité). */
|
|
33
|
+
export declare function formaterPourcentage(fraction: number | null | undefined, { decimales, repli }?: {
|
|
34
|
+
decimales?: number;
|
|
35
|
+
repli?: string;
|
|
36
|
+
}): string;
|
|
37
|
+
/** Première lettre en capitale : un libellé servi en minuscules qui ouvre
|
|
38
|
+
* une ligne (« en attente » → « En attente »). */
|
|
39
|
+
export declare function capitaliser(texte: string): string;
|
|
40
|
+
/**
|
|
41
|
+
* Initiales d'un nom affiché, pour un avatar : les deux premiers mots
|
|
42
|
+
* (« Camille Martin » → « CM »), sinon la première lettre du `secours`
|
|
43
|
+
* (l'adresse e-mail), sinon « ? ».
|
|
44
|
+
*/
|
|
45
|
+
export declare function initiales(nom: string | null | undefined, secours?: string | null): string;
|
|
24
46
|
/** Taille en octets, en base 1024 : « 0 o », « 512 o », « 1,5 Ko »,
|
|
25
47
|
* « 120 Mo » (une décimale sous 100). */
|
|
26
48
|
export declare function formaterOctets(octets: number | null | undefined, repli?: string): string;
|
|
27
49
|
/** Durée en secondes, ses deux plus grandes unités : « 3 j 4 h »,
|
|
28
50
|
* « 2 h 15 min », « 15 min », « 42 s ». */
|
|
29
51
|
export declare function formaterDuree(secondes: number | null | undefined, repli?: string): string;
|
|
52
|
+
/** Durée à la seconde, pour une opération qui se compte en secondes ou en
|
|
53
|
+
* minutes (un traitement, un envoi) : « moins d'une seconde », « 23 s »,
|
|
54
|
+
* « 1 min 05 s », « 1 h 02 min 05 s ». */
|
|
55
|
+
export declare function formaterDureePrecise(secondes: number | null | undefined, repli?: string): string;
|
|
30
56
|
/** L'ordre de grandeur d'une durée, sa plus grande unité seulement : « 3 j »,
|
|
31
57
|
* « 18 h », « 15 min » (jamais en secondes : « 0 min » sous la minute). */
|
|
32
58
|
export declare function formaterDureeArrondie(secondes: number): string;
|
|
@@ -50,5 +76,10 @@ export declare function formaterDateHeure(valeur: string | null | undefined, rep
|
|
|
50
76
|
/** Date et heure à la seconde : « 05/07/2026 14:30:12 », là où l'instant
|
|
51
77
|
* exact compte (journal, événements). */
|
|
52
78
|
export declare function formaterHorodatage(valeur: string | null | undefined, repli?: string): string;
|
|
79
|
+
/** Heure seule, à la seconde : « 14:30:12 ». Accepte un instant en
|
|
80
|
+
* millisecondes (`Date.now()`, `dataUpdatedAt` de TanStack Query) comme
|
|
81
|
+
* une date ISO. Le repli pour `0` (`dataUpdatedAt` avant la première
|
|
82
|
+
* réponse) et pour un nombre non fini. */
|
|
83
|
+
export declare function formaterHeure(valeur: number | string | null | undefined, repli?: string): string;
|
|
53
84
|
/** Date et heure, mois en lettres, pour une fiche : « 05 juillet 2026 à 14:30 ». */
|
|
54
85
|
export declare function formaterDateHeureLongue(valeur: string | null | undefined, repli?: string): string;
|