@wakastellar/ui 0.1.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/dist/blocks/footer/index.d.ts +19 -0
- package/dist/blocks/headtab/index.d.ts +27 -0
- package/dist/blocks/index.d.ts +5 -0
- package/dist/blocks/language-selector/index.d.ts +6 -0
- package/dist/blocks/layout/index.d.ts +28 -0
- package/dist/blocks/login/index.d.ts +13 -0
- package/dist/components/DataTable/DataTable.d.ts +17 -0
- package/dist/components/DataTable/DataTableAdvanced.d.ts +27 -0
- package/dist/components/DataTable/DataTableColumnResizer.d.ts +8 -0
- package/dist/components/DataTable/DataTableContextMenu.d.ts +47 -0
- package/dist/components/DataTable/DataTableEditCell.d.ts +29 -0
- package/dist/components/DataTable/DataTableFilters.d.ts +14 -0
- package/dist/components/DataTable/DataTableGrouping.d.ts +25 -0
- package/dist/components/DataTable/DataTablePagination.d.ts +8 -0
- package/dist/components/DataTable/DataTableSelection.d.ts +46 -0
- package/dist/components/DataTable/DataTableToolbar.d.ts +14 -0
- package/dist/components/DataTable/examples/EditExample.d.ts +2 -0
- package/dist/components/DataTable/hooks/useDataTable.d.ts +24 -0
- package/dist/components/DataTable/hooks/useDataTableAdvanced.d.ts +38 -0
- package/dist/components/DataTable/hooks/useDataTableEdit.d.ts +22 -0
- package/dist/components/DataTable/hooks/useDataTableExport.d.ts +15 -0
- package/dist/components/DataTable/hooks/useDataTableImport.d.ts +12 -0
- package/dist/components/DataTable/hooks/useDataTableTheme.d.ts +16 -0
- package/dist/components/DataTable/hooks/useDataTableVirtualization.d.ts +19 -0
- package/dist/components/DataTable/hooks/useTableLayout.d.ts +26 -0
- package/dist/components/DataTable/index.d.ts +37 -0
- package/dist/components/DataTable/types.d.ts +461 -0
- package/dist/components/DataTable/utils.d.ts +37 -0
- package/dist/components/accordion/index.d.ts +7 -0
- package/dist/components/alert/index.d.ts +8 -0
- package/dist/components/alert-dialog/index.d.ts +20 -0
- package/dist/components/aspect-ratio/index.d.ts +3 -0
- package/dist/components/avatar/index.d.ts +6 -0
- package/dist/components/badge/index.d.ts +9 -0
- package/dist/components/button/index.d.ts +11 -0
- package/dist/components/calendar/index.d.ts +8 -0
- package/dist/components/card/index.d.ts +8 -0
- package/dist/components/checkbox/index.d.ts +4 -0
- package/dist/components/code/index.d.ts +29 -0
- package/dist/components/collapsible/index.d.ts +5 -0
- package/dist/components/command/index.d.ts +51 -0
- package/dist/components/context-menu/index.d.ts +27 -0
- package/dist/components/dialog/index.d.ts +19 -0
- package/dist/components/dropdown-menu/index.d.ts +27 -0
- package/dist/components/form/index.d.ts +23 -0
- package/dist/components/hover-card/index.d.ts +6 -0
- package/dist/components/index.d.ts +52 -0
- package/dist/components/input/index.d.ts +5 -0
- package/dist/components/input-otp/index.d.ts +51 -0
- package/dist/components/label/index.d.ts +5 -0
- package/dist/components/language-selector/index.d.ts +40 -0
- package/dist/components/menubar/index.d.ts +28 -0
- package/dist/components/navigation-menu/index.d.ts +12 -0
- package/dist/components/popover/index.d.ts +6 -0
- package/dist/components/progress/index.d.ts +4 -0
- package/dist/components/radio-group/index.d.ts +5 -0
- package/dist/components/scroll-area/index.d.ts +5 -0
- package/dist/components/select/index.d.ts +13 -0
- package/dist/components/separator/index.d.ts +4 -0
- package/dist/components/sheet/index.d.ts +27 -0
- package/dist/components/skeleton/index.d.ts +2 -0
- package/dist/components/slider/index.d.ts +4 -0
- package/dist/components/switch/index.d.ts +4 -0
- package/dist/components/table/index.d.ts +10 -0
- package/dist/components/tabs/index.d.ts +7 -0
- package/dist/components/textarea/index.d.ts +5 -0
- package/dist/components/theme-selector/index.d.ts +8 -0
- package/dist/components/toast/index.d.ts +15 -0
- package/dist/components/toaster/index.d.ts +1 -0
- package/dist/components/toggle/index.d.ts +12 -0
- package/dist/components/tooltip/index.d.ts +7 -0
- package/dist/components/typography/index.d.ts +85 -0
- package/dist/components/waka-admincrumb/index.d.ts +41 -0
- package/dist/components/waka-carousel/index.d.ts +105 -0
- package/dist/components/waka-datetime-picker/index.d.ts +135 -0
- package/dist/components/waka-datetime-picker.form-integration/index.d.ts +69 -0
- package/dist/components/waka-notifications/index.d.ts +40 -0
- package/dist/components/waka-spinner/index.d.ts +46 -0
- package/dist/components/waka-theme-creator/index.d.ts +59 -0
- package/dist/components/waka-theme-manager/index.d.ts +62 -0
- package/dist/context/admincrumb-context.d.ts +34 -0
- package/dist/context/index.d.ts +8 -0
- package/dist/context/language-context.d.ts +57 -0
- package/dist/context/theme-context.d.ts +39 -0
- package/dist/context/theme-provider.d.ts +74 -0
- package/dist/context/waka-provider.d.ts +50 -0
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/use-toast.d.ts +44 -0
- package/dist/hooks/use-translation.d.ts +15 -0
- package/dist/hooks/useToast.d.ts +44 -0
- package/dist/index.cjs.js +70 -0
- package/dist/index.d.ts +20 -0
- package/dist/index.es.js +16379 -0
- package/dist/lib/i18n.d.ts +4 -0
- package/dist/types/provider.d.ts +108 -0
- package/dist/ui.css +1 -0
- package/dist/utils/cn.d.ts +1 -0
- package/dist/utils/datetime-helpers.d.ts +137 -0
- package/dist/utils/index.d.ts +5 -0
- package/dist/utils/theme-loader.d.ts +101 -0
- package/dist/utils/tweak.d.ts +18 -0
- package/package.json +118 -0
- package/src/styles/carousel.css +687 -0
- package/src/styles/code-highlight.css +232 -0
- package/src/styles/datepicker.css +420 -0
- package/src/styles/globals.css +84 -0
- package/src/styles/prism.css +261 -0
- package/src/styles/themes/forest.css +55 -0
- package/src/styles/themes/index.css +7 -0
- package/src/styles/themes/monochrome.css +55 -0
- package/src/styles/themes/perpetuity.css +55 -0
- package/src/styles/themes/sunset.css +55 -0
- package/src/styles/themes/twilight.css +55 -0
|
@@ -0,0 +1,461 @@
|
|
|
1
|
+
import { ColumnDef, PaginationState, SortingState, ColumnFiltersState, VisibilityState, ColumnOrderState, ExpandedState, GroupingState } from '@tanstack/react-table';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
import { EditCellConfig } from './DataTableEditCell';
|
|
4
|
+
/**
|
|
5
|
+
* Layout variants pour le DataTable
|
|
6
|
+
*/
|
|
7
|
+
export type DataTableLayout = "standard" | "card" | "compact" | "split" | "infinite";
|
|
8
|
+
/**
|
|
9
|
+
* Variantes visuelles
|
|
10
|
+
*/
|
|
11
|
+
export type DataTableVariant = "bordered" | "minimal" | "striped" | "glass";
|
|
12
|
+
/**
|
|
13
|
+
* Densité d'affichage
|
|
14
|
+
*/
|
|
15
|
+
export type DataTableDensity = "comfortable" | "compact" | "spacious";
|
|
16
|
+
/**
|
|
17
|
+
* Mode de sélection
|
|
18
|
+
*/
|
|
19
|
+
export type SelectionMode = "single" | "multiple" | "range";
|
|
20
|
+
/**
|
|
21
|
+
* Mode de tri
|
|
22
|
+
*/
|
|
23
|
+
export type SortMode = "single" | "multiple";
|
|
24
|
+
/**
|
|
25
|
+
* Type de virtualisation
|
|
26
|
+
*/
|
|
27
|
+
export type VirtualizationType = "none" | "fixed" | "dynamic";
|
|
28
|
+
/**
|
|
29
|
+
* Position des filtres
|
|
30
|
+
*/
|
|
31
|
+
export type FilterPosition = "top" | "bottom" | "left" | "right" | "modal";
|
|
32
|
+
/**
|
|
33
|
+
* Configuration de pagination
|
|
34
|
+
*/
|
|
35
|
+
export interface PaginationConfig {
|
|
36
|
+
/** Mode de pagination */
|
|
37
|
+
mode?: "client" | "server";
|
|
38
|
+
/** Taille de page par défaut */
|
|
39
|
+
pageSize?: number;
|
|
40
|
+
/** Options de tailles de page */
|
|
41
|
+
pageSizeOptions?: number[];
|
|
42
|
+
/** Page courante (mode serveur) */
|
|
43
|
+
currentPage?: number;
|
|
44
|
+
/** Total d'items (mode serveur) */
|
|
45
|
+
totalItems?: number;
|
|
46
|
+
/** Callback de changement de page */
|
|
47
|
+
onPageChange?: (page: number) => void;
|
|
48
|
+
/** Callback de changement de taille */
|
|
49
|
+
onPageSizeChange?: (size: number) => void;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Configuration d'un filtre
|
|
53
|
+
*/
|
|
54
|
+
export interface FilterConfig {
|
|
55
|
+
/** ID unique du filtre */
|
|
56
|
+
id: string;
|
|
57
|
+
/** Libellé du filtre */
|
|
58
|
+
label: string;
|
|
59
|
+
/** Type de filtre */
|
|
60
|
+
type: "text" | "select" | "range" | "date" | "daterange" | "multiselect" | "checkbox" | "number" | "boolean";
|
|
61
|
+
/** Options pour select/multiselect */
|
|
62
|
+
options?: Array<{
|
|
63
|
+
label: string;
|
|
64
|
+
value: string | number;
|
|
65
|
+
}>;
|
|
66
|
+
/** Placeholder */
|
|
67
|
+
placeholder?: string;
|
|
68
|
+
/** Valeur par défaut */
|
|
69
|
+
defaultValue?: any;
|
|
70
|
+
/** Colonne associée */
|
|
71
|
+
column?: string;
|
|
72
|
+
/** Fonction de filtrage personnalisée */
|
|
73
|
+
filterFn?: (row: any, columnId: string, filterValue: any) => boolean;
|
|
74
|
+
/** Validation du filtre */
|
|
75
|
+
validate?: (value: any) => string | null;
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Configuration de groupement
|
|
79
|
+
*/
|
|
80
|
+
export interface GroupingConfig {
|
|
81
|
+
/** Colonnes de groupement */
|
|
82
|
+
columns?: string[];
|
|
83
|
+
/** Fonction d'agrégation personnalisée */
|
|
84
|
+
aggregations?: Record<string, (values: any[]) => any>;
|
|
85
|
+
/** Affichage des totaux */
|
|
86
|
+
showTotals?: boolean;
|
|
87
|
+
/** Position des totaux */
|
|
88
|
+
totalsPosition?: "top" | "bottom" | "both";
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* Configuration de virtualisation
|
|
92
|
+
*/
|
|
93
|
+
export interface VirtualizationConfig {
|
|
94
|
+
/** Type de virtualisation */
|
|
95
|
+
type: VirtualizationType;
|
|
96
|
+
/** Hauteur fixe des lignes */
|
|
97
|
+
itemHeight?: number;
|
|
98
|
+
/** Hauteur estimée pour la virtualisation dynamique */
|
|
99
|
+
estimatedItemHeight?: number;
|
|
100
|
+
/** Nombre d'éléments à pré-rendre */
|
|
101
|
+
overscan?: number;
|
|
102
|
+
/** Hauteur du conteneur */
|
|
103
|
+
containerHeight?: number;
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* Configuration de redimensionnement des colonnes
|
|
107
|
+
*/
|
|
108
|
+
export interface ColumnResizeConfig {
|
|
109
|
+
/** Mode de redimensionnement */
|
|
110
|
+
mode?: "onChange" | "onEnd";
|
|
111
|
+
/** Colonnes redimensionnables */
|
|
112
|
+
resizable?: boolean;
|
|
113
|
+
/** Largeur minimale */
|
|
114
|
+
minSize?: number;
|
|
115
|
+
/** Largeur maximale */
|
|
116
|
+
maxSize?: number;
|
|
117
|
+
/** Largeur par défaut */
|
|
118
|
+
defaultSize?: number;
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* Configuration de réordonnancement
|
|
122
|
+
*/
|
|
123
|
+
export interface ColumnOrderConfig {
|
|
124
|
+
/** Activer le réordonnancement */
|
|
125
|
+
enabled?: boolean;
|
|
126
|
+
/** Colonnes non réordonnables */
|
|
127
|
+
disabled?: string[];
|
|
128
|
+
/** Callback de changement d'ordre */
|
|
129
|
+
onOrderChange?: (newOrder: string[]) => void;
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* Configuration d'expansion des lignes
|
|
133
|
+
*/
|
|
134
|
+
export interface RowExpansionConfig {
|
|
135
|
+
/** Activer l'expansion */
|
|
136
|
+
enabled?: boolean;
|
|
137
|
+
/** Colonne d'expansion */
|
|
138
|
+
columnId?: string;
|
|
139
|
+
/** Fonction de rendu du contenu étendu */
|
|
140
|
+
renderExpanded?: (row: any) => ReactNode;
|
|
141
|
+
/** État d'expansion initial */
|
|
142
|
+
initialExpanded?: Record<string, boolean>;
|
|
143
|
+
}
|
|
144
|
+
/**
|
|
145
|
+
* Action de la toolbar
|
|
146
|
+
*/
|
|
147
|
+
export interface TableAction {
|
|
148
|
+
/** ID unique */
|
|
149
|
+
id: string;
|
|
150
|
+
/** Libellé */
|
|
151
|
+
label: string;
|
|
152
|
+
/** Icône (composant React) */
|
|
153
|
+
icon?: ReactNode;
|
|
154
|
+
/** Callback */
|
|
155
|
+
onClick: (selectedRows: any[]) => void;
|
|
156
|
+
/** Visible seulement si sélection */
|
|
157
|
+
requiresSelection?: boolean;
|
|
158
|
+
/** Variant du bouton */
|
|
159
|
+
variant?: "default" | "destructive" | "outline" | "ghost";
|
|
160
|
+
/** Désactivé */
|
|
161
|
+
disabled?: boolean;
|
|
162
|
+
}
|
|
163
|
+
/**
|
|
164
|
+
* Configuration de la toolbar
|
|
165
|
+
*/
|
|
166
|
+
export interface ToolbarConfig {
|
|
167
|
+
/** Actions personnalisées */
|
|
168
|
+
actions?: TableAction[];
|
|
169
|
+
/** Afficher la recherche globale */
|
|
170
|
+
showSearch?: boolean;
|
|
171
|
+
/** Afficher le sélecteur de colonnes */
|
|
172
|
+
showColumnToggle?: boolean;
|
|
173
|
+
/** Afficher le changement de densité */
|
|
174
|
+
showDensity?: boolean;
|
|
175
|
+
/** Afficher le bouton de refresh */
|
|
176
|
+
showRefresh?: boolean;
|
|
177
|
+
/** Callback de refresh */
|
|
178
|
+
onRefresh?: () => void;
|
|
179
|
+
}
|
|
180
|
+
/**
|
|
181
|
+
* Configuration d'export
|
|
182
|
+
*/
|
|
183
|
+
export interface ExportConfig {
|
|
184
|
+
/** Formats supportés */
|
|
185
|
+
formats?: Array<"csv" | "xlsx" | "json" | "pdf" | "xml">;
|
|
186
|
+
/** Nom du fichier */
|
|
187
|
+
filename?: string;
|
|
188
|
+
/** Callback personnalisé */
|
|
189
|
+
onExport?: (data: any[], format: string) => void;
|
|
190
|
+
/** Colonnes à exporter */
|
|
191
|
+
columns?: string[];
|
|
192
|
+
/** Inclure les en-têtes */
|
|
193
|
+
includeHeaders?: boolean;
|
|
194
|
+
/** Formatage personnalisé */
|
|
195
|
+
formatters?: Record<string, (value: any) => string>;
|
|
196
|
+
/** Options spécifiques par format */
|
|
197
|
+
options?: {
|
|
198
|
+
csv?: {
|
|
199
|
+
delimiter?: string;
|
|
200
|
+
encoding?: string;
|
|
201
|
+
};
|
|
202
|
+
xlsx?: {
|
|
203
|
+
sheetName?: string;
|
|
204
|
+
includeStyles?: boolean;
|
|
205
|
+
};
|
|
206
|
+
pdf?: {
|
|
207
|
+
orientation?: "portrait" | "landscape";
|
|
208
|
+
pageSize?: string;
|
|
209
|
+
};
|
|
210
|
+
};
|
|
211
|
+
}
|
|
212
|
+
/**
|
|
213
|
+
* Configuration d'import
|
|
214
|
+
*/
|
|
215
|
+
export interface ImportConfig {
|
|
216
|
+
/** Formats acceptés */
|
|
217
|
+
accept?: string;
|
|
218
|
+
/** Callback de traitement */
|
|
219
|
+
onImport?: (data: any[]) => void;
|
|
220
|
+
/** Validation des données */
|
|
221
|
+
validate?: (data: any[]) => {
|
|
222
|
+
valid: boolean;
|
|
223
|
+
errors: string[];
|
|
224
|
+
};
|
|
225
|
+
/** Mapping des colonnes */
|
|
226
|
+
columnMapping?: Record<string, string>;
|
|
227
|
+
/** Options de parsing */
|
|
228
|
+
parseOptions?: {
|
|
229
|
+
csv?: {
|
|
230
|
+
delimiter?: string;
|
|
231
|
+
skipEmptyLines?: boolean;
|
|
232
|
+
};
|
|
233
|
+
xlsx?: {
|
|
234
|
+
sheetIndex?: number;
|
|
235
|
+
headerRow?: number;
|
|
236
|
+
};
|
|
237
|
+
};
|
|
238
|
+
}
|
|
239
|
+
/**
|
|
240
|
+
* État de sélection
|
|
241
|
+
*/
|
|
242
|
+
export interface SelectionState {
|
|
243
|
+
/** IDs sélectionnés */
|
|
244
|
+
selectedIds: Set<string>;
|
|
245
|
+
/** Tout sélectionné */
|
|
246
|
+
selectAll: boolean;
|
|
247
|
+
}
|
|
248
|
+
/**
|
|
249
|
+
* Props principales du DataTable
|
|
250
|
+
*/
|
|
251
|
+
export interface DataTableProps<TData> {
|
|
252
|
+
/** Données à afficher */
|
|
253
|
+
data: TData[];
|
|
254
|
+
/** Définition des colonnes */
|
|
255
|
+
columns: ColumnDef<TData, any>[];
|
|
256
|
+
/** Layout d'affichage */
|
|
257
|
+
layout?: DataTableLayout;
|
|
258
|
+
/** Variant visuel */
|
|
259
|
+
variant?: DataTableVariant;
|
|
260
|
+
/** Densité */
|
|
261
|
+
density?: DataTableDensity;
|
|
262
|
+
/** Configuration des filtres */
|
|
263
|
+
filters?: FilterConfig[];
|
|
264
|
+
/** Position des filtres */
|
|
265
|
+
filterPosition?: FilterPosition;
|
|
266
|
+
/** Configuration de la toolbar */
|
|
267
|
+
toolbar?: ToolbarConfig;
|
|
268
|
+
/** Configuration de la pagination */
|
|
269
|
+
pagination?: PaginationConfig;
|
|
270
|
+
/** Mode de sélection */
|
|
271
|
+
selection?: SelectionMode | boolean;
|
|
272
|
+
/** Actions sur les lignes */
|
|
273
|
+
actions?: TableAction[];
|
|
274
|
+
/** Namespace i18n */
|
|
275
|
+
i18nNamespace?: string;
|
|
276
|
+
/** État de chargement */
|
|
277
|
+
loading?: boolean;
|
|
278
|
+
/** Message d'erreur */
|
|
279
|
+
error?: string | null;
|
|
280
|
+
/** État vide personnalisé */
|
|
281
|
+
emptyState?: ReactNode;
|
|
282
|
+
/** Header sticky */
|
|
283
|
+
headerSticky?: boolean;
|
|
284
|
+
/** Toggle de visibilité des colonnes */
|
|
285
|
+
columnVisibilityToggle?: boolean;
|
|
286
|
+
/** Configuration de redimensionnement des colonnes */
|
|
287
|
+
columnResize?: boolean | ColumnResizeConfig;
|
|
288
|
+
/** Configuration de réordonnancement */
|
|
289
|
+
columnOrder?: ColumnOrderConfig;
|
|
290
|
+
/** Configuration de groupement */
|
|
291
|
+
grouping?: GroupingConfig;
|
|
292
|
+
/** Configuration d'expansion des lignes */
|
|
293
|
+
rowExpansion?: RowExpansionConfig;
|
|
294
|
+
/** Configuration de virtualisation */
|
|
295
|
+
virtualization?: VirtualizationConfig;
|
|
296
|
+
/** Mode de tri */
|
|
297
|
+
sortMode?: SortMode;
|
|
298
|
+
/** Activer l'export */
|
|
299
|
+
enableExport?: boolean | ExportConfig;
|
|
300
|
+
/** Activer l'import */
|
|
301
|
+
enableImport?: boolean | ImportConfig;
|
|
302
|
+
/** Activer le réordonnancement */
|
|
303
|
+
enableReorder?: boolean;
|
|
304
|
+
/** Menu contextuel */
|
|
305
|
+
enableContextMenu?: boolean;
|
|
306
|
+
/** Callback de clic sur ligne */
|
|
307
|
+
onRowClick?: (row: TData) => void;
|
|
308
|
+
/** Callback de double-clic */
|
|
309
|
+
onRowDoubleClick?: (row: TData) => void;
|
|
310
|
+
/** Callback de changement de tri */
|
|
311
|
+
onSortingChange?: (sorting: SortingState) => void;
|
|
312
|
+
/** Callback de changement de filtres */
|
|
313
|
+
onFiltersChange?: (filters: ColumnFiltersState) => void;
|
|
314
|
+
/** Callback de changement de sélection */
|
|
315
|
+
onSelectionChange?: (selectedRows: TData[]) => void;
|
|
316
|
+
/** Callback de changement d'ordre des colonnes */
|
|
317
|
+
onColumnOrderChange?: (order: ColumnOrderState) => void;
|
|
318
|
+
/** Callback de changement d'expansion */
|
|
319
|
+
onExpandedChange?: (expanded: ExpandedState) => void;
|
|
320
|
+
/** Callback de changement de groupement */
|
|
321
|
+
onGroupingChange?: (grouping: GroupingState) => void;
|
|
322
|
+
/** Classe CSS personnalisée */
|
|
323
|
+
className?: string;
|
|
324
|
+
/** ID unique pour la persistance */
|
|
325
|
+
tableId?: string;
|
|
326
|
+
/** Configuration d'édition */
|
|
327
|
+
edit?: EditConfig<TData>;
|
|
328
|
+
/** Thème personnalisé */
|
|
329
|
+
theme?: {
|
|
330
|
+
colors?: Record<string, string>;
|
|
331
|
+
spacing?: Record<string, string>;
|
|
332
|
+
typography?: Record<string, any>;
|
|
333
|
+
};
|
|
334
|
+
/** Options de performance */
|
|
335
|
+
performance?: {
|
|
336
|
+
/** Désactiver les animations */
|
|
337
|
+
disableAnimations?: boolean;
|
|
338
|
+
/** Limite de rendu */
|
|
339
|
+
renderLimit?: number;
|
|
340
|
+
/** Délai de debounce pour les filtres */
|
|
341
|
+
filterDebounceMs?: number;
|
|
342
|
+
};
|
|
343
|
+
}
|
|
344
|
+
/**
|
|
345
|
+
* Configuration d'édition pour une colonne
|
|
346
|
+
*/
|
|
347
|
+
export interface ColumnEditConfig<TData> {
|
|
348
|
+
/** Champ éditable */
|
|
349
|
+
field: keyof TData;
|
|
350
|
+
/** Configuration de la cellule d'édition */
|
|
351
|
+
config: EditCellConfig;
|
|
352
|
+
/** Validation personnalisée */
|
|
353
|
+
validate?: (value: any, row: TData) => string | null;
|
|
354
|
+
/** Callback de changement */
|
|
355
|
+
onChange?: (value: any, row: TData) => void;
|
|
356
|
+
}
|
|
357
|
+
/**
|
|
358
|
+
* Configuration d'édition du DataTable
|
|
359
|
+
*/
|
|
360
|
+
export interface EditConfig<TData> {
|
|
361
|
+
/** Colonnes éditables */
|
|
362
|
+
editableColumns?: ColumnEditConfig<TData>[];
|
|
363
|
+
/** Mode d'édition */
|
|
364
|
+
mode?: "inline" | "modal" | "row";
|
|
365
|
+
/** Auto-save */
|
|
366
|
+
autoSave?: boolean;
|
|
367
|
+
/** Délai d'auto-save en ms */
|
|
368
|
+
autoSaveDelay?: number;
|
|
369
|
+
/** Callback de sauvegarde */
|
|
370
|
+
onSave?: (rowId: string, data: Partial<TData>) => Promise<void>;
|
|
371
|
+
/** Callback d'annulation */
|
|
372
|
+
onCancel?: (rowId: string, originalData: TData) => void;
|
|
373
|
+
/** Validation globale */
|
|
374
|
+
validate?: (data: Partial<TData>, row: TData) => Record<string, string>;
|
|
375
|
+
/** Boutons d'action personnalisés */
|
|
376
|
+
actionButtons?: {
|
|
377
|
+
save?: ReactNode;
|
|
378
|
+
cancel?: ReactNode;
|
|
379
|
+
edit?: ReactNode;
|
|
380
|
+
};
|
|
381
|
+
}
|
|
382
|
+
/**
|
|
383
|
+
* État interne du DataTable
|
|
384
|
+
*/
|
|
385
|
+
export interface DataTableState {
|
|
386
|
+
sorting: SortingState;
|
|
387
|
+
columnFilters: ColumnFiltersState;
|
|
388
|
+
columnVisibility: VisibilityState;
|
|
389
|
+
columnOrder: ColumnOrderState;
|
|
390
|
+
expanded: ExpandedState;
|
|
391
|
+
grouping: GroupingState;
|
|
392
|
+
pagination: PaginationState;
|
|
393
|
+
globalFilter: string;
|
|
394
|
+
density: DataTableDensity;
|
|
395
|
+
layout: DataTableLayout;
|
|
396
|
+
rowSelection: Record<string, boolean>;
|
|
397
|
+
}
|
|
398
|
+
/**
|
|
399
|
+
* Configuration de thème personnalisé
|
|
400
|
+
*/
|
|
401
|
+
export interface DataTableTheme {
|
|
402
|
+
/** Couleurs personnalisées */
|
|
403
|
+
colors?: {
|
|
404
|
+
primary?: string;
|
|
405
|
+
secondary?: string;
|
|
406
|
+
accent?: string;
|
|
407
|
+
background?: string;
|
|
408
|
+
surface?: string;
|
|
409
|
+
text?: string;
|
|
410
|
+
textSecondary?: string;
|
|
411
|
+
border?: string;
|
|
412
|
+
hover?: string;
|
|
413
|
+
selected?: string;
|
|
414
|
+
disabled?: string;
|
|
415
|
+
};
|
|
416
|
+
/** Espacement personnalisé */
|
|
417
|
+
spacing?: {
|
|
418
|
+
xs?: string;
|
|
419
|
+
sm?: string;
|
|
420
|
+
md?: string;
|
|
421
|
+
lg?: string;
|
|
422
|
+
xl?: string;
|
|
423
|
+
};
|
|
424
|
+
/** Typographie personnalisée */
|
|
425
|
+
typography?: {
|
|
426
|
+
fontFamily?: string;
|
|
427
|
+
fontSize?: {
|
|
428
|
+
xs?: string;
|
|
429
|
+
sm?: string;
|
|
430
|
+
md?: string;
|
|
431
|
+
lg?: string;
|
|
432
|
+
xl?: string;
|
|
433
|
+
};
|
|
434
|
+
fontWeight?: {
|
|
435
|
+
normal?: string;
|
|
436
|
+
medium?: string;
|
|
437
|
+
semibold?: string;
|
|
438
|
+
bold?: string;
|
|
439
|
+
};
|
|
440
|
+
};
|
|
441
|
+
/** Bordures personnalisées */
|
|
442
|
+
borders?: {
|
|
443
|
+
radius?: {
|
|
444
|
+
sm?: string;
|
|
445
|
+
md?: string;
|
|
446
|
+
lg?: string;
|
|
447
|
+
};
|
|
448
|
+
width?: {
|
|
449
|
+
thin?: string;
|
|
450
|
+
medium?: string;
|
|
451
|
+
thick?: string;
|
|
452
|
+
};
|
|
453
|
+
};
|
|
454
|
+
/** Ombres personnalisées */
|
|
455
|
+
shadows?: {
|
|
456
|
+
sm?: string;
|
|
457
|
+
md?: string;
|
|
458
|
+
lg?: string;
|
|
459
|
+
xl?: string;
|
|
460
|
+
};
|
|
461
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { ClassValue } from 'clsx';
|
|
2
|
+
/**
|
|
3
|
+
* Utilitaire pour merger les classes CSS
|
|
4
|
+
*/
|
|
5
|
+
export declare function cn(...inputs: ClassValue[]): string;
|
|
6
|
+
/**
|
|
7
|
+
* Export des données en CSV
|
|
8
|
+
*/
|
|
9
|
+
export declare function exportToCSV<T extends Record<string, any>>(data: T[], filename?: string): void;
|
|
10
|
+
/**
|
|
11
|
+
* Export des données en JSON
|
|
12
|
+
*/
|
|
13
|
+
export declare function exportToJSON<T>(data: T[], filename?: string): void;
|
|
14
|
+
/**
|
|
15
|
+
* Parse un fichier CSV
|
|
16
|
+
*/
|
|
17
|
+
export declare function parseCSV(file: File): Promise<any[]>;
|
|
18
|
+
/**
|
|
19
|
+
* Sauvegarde de l'état dans localStorage
|
|
20
|
+
*/
|
|
21
|
+
export declare function saveTableState(tableId: string, state: any): void;
|
|
22
|
+
/**
|
|
23
|
+
* Chargement de l'état depuis localStorage
|
|
24
|
+
*/
|
|
25
|
+
export declare function loadTableState(tableId: string): any | null;
|
|
26
|
+
/**
|
|
27
|
+
* Génère un ID unique
|
|
28
|
+
*/
|
|
29
|
+
export declare function generateId(): string;
|
|
30
|
+
/**
|
|
31
|
+
* Debounce une fonction
|
|
32
|
+
*/
|
|
33
|
+
export declare function debounce<T extends (...args: any[]) => any>(func: T, wait: number): (...args: Parameters<T>) => void;
|
|
34
|
+
/**
|
|
35
|
+
* Filtre global sur les données
|
|
36
|
+
*/
|
|
37
|
+
export declare function globalFilterFn<T extends Record<string, any>>(row: T, columnId: string, filterValue: string): boolean;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import * as AccordionPrimitive from "@radix-ui/react-accordion";
|
|
3
|
+
declare const Accordion: typeof AccordionPrimitive.Root;
|
|
4
|
+
declare const AccordionItem: React.ForwardRefExoticComponent<Omit<AccordionPrimitive.AccordionItemProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
5
|
+
declare const AccordionTrigger: React.ForwardRefExoticComponent<Omit<AccordionPrimitive.AccordionTriggerProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
6
|
+
declare const AccordionContent: React.ForwardRefExoticComponent<Omit<AccordionPrimitive.AccordionContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
7
|
+
export { Accordion, AccordionItem, AccordionTrigger, AccordionContent };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { VariantProps } from 'class-variance-authority';
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
declare const Alert: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & VariantProps<(props?: ({
|
|
4
|
+
variant?: "default" | "destructive" | null | undefined;
|
|
5
|
+
} & import('class-variance-authority/dist/types').ClassProp) | undefined) => string> & React.RefAttributes<HTMLDivElement>>;
|
|
6
|
+
declare const AlertTitle: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLHeadingElement> & React.RefAttributes<HTMLParagraphElement>>;
|
|
7
|
+
declare const AlertDescription: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLParagraphElement> & React.RefAttributes<HTMLParagraphElement>>;
|
|
8
|
+
export { Alert, AlertTitle, AlertDescription };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import * as AlertDialogPrimitive from "@radix-ui/react-alert-dialog";
|
|
3
|
+
declare const AlertDialog: typeof AlertDialogPrimitive.Root;
|
|
4
|
+
declare const AlertDialogTrigger: typeof AlertDialogPrimitive.Trigger;
|
|
5
|
+
declare const AlertDialogPortal: typeof AlertDialogPrimitive.Portal;
|
|
6
|
+
declare const AlertDialogOverlay: React.ForwardRefExoticComponent<Omit<AlertDialogPrimitive.AlertDialogOverlayProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
7
|
+
declare const AlertDialogContent: React.ForwardRefExoticComponent<Omit<AlertDialogPrimitive.AlertDialogContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
8
|
+
declare const AlertDialogHeader: {
|
|
9
|
+
({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
displayName: string;
|
|
11
|
+
};
|
|
12
|
+
declare const AlertDialogFooter: {
|
|
13
|
+
({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
displayName: string;
|
|
15
|
+
};
|
|
16
|
+
declare const AlertDialogTitle: React.ForwardRefExoticComponent<Omit<AlertDialogPrimitive.AlertDialogTitleProps & React.RefAttributes<HTMLHeadingElement>, "ref"> & React.RefAttributes<HTMLHeadingElement>>;
|
|
17
|
+
declare const AlertDialogDescription: React.ForwardRefExoticComponent<Omit<AlertDialogPrimitive.AlertDialogDescriptionProps & React.RefAttributes<HTMLParagraphElement>, "ref"> & React.RefAttributes<HTMLParagraphElement>>;
|
|
18
|
+
declare const AlertDialogAction: React.ForwardRefExoticComponent<Omit<AlertDialogPrimitive.AlertDialogActionProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
19
|
+
declare const AlertDialogCancel: React.ForwardRefExoticComponent<Omit<AlertDialogPrimitive.AlertDialogCancelProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
20
|
+
export { AlertDialog, AlertDialogPortal, AlertDialogOverlay, AlertDialogTrigger, AlertDialogContent, AlertDialogHeader, AlertDialogFooter, AlertDialogTitle, AlertDialogDescription, AlertDialogAction, AlertDialogCancel, };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import * as AvatarPrimitive from "@radix-ui/react-avatar";
|
|
3
|
+
declare const Avatar: React.ForwardRefExoticComponent<Omit<AvatarPrimitive.AvatarProps & React.RefAttributes<HTMLSpanElement>, "ref"> & React.RefAttributes<HTMLSpanElement>>;
|
|
4
|
+
declare const AvatarImage: React.ForwardRefExoticComponent<Omit<AvatarPrimitive.AvatarImageProps & React.RefAttributes<HTMLImageElement>, "ref"> & React.RefAttributes<HTMLImageElement>>;
|
|
5
|
+
declare const AvatarFallback: React.ForwardRefExoticComponent<Omit<AvatarPrimitive.AvatarFallbackProps & React.RefAttributes<HTMLSpanElement>, "ref"> & React.RefAttributes<HTMLSpanElement>>;
|
|
6
|
+
export { Avatar, AvatarImage, AvatarFallback };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { VariantProps } from 'class-variance-authority';
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
declare const badgeVariants: (props?: ({
|
|
4
|
+
variant?: "default" | "destructive" | "secondary" | "outline" | null | undefined;
|
|
5
|
+
} & import('class-variance-authority/dist/types').ClassProp) | undefined) => string;
|
|
6
|
+
export interface BadgeProps extends React.HTMLAttributes<HTMLDivElement>, VariantProps<typeof badgeVariants> {
|
|
7
|
+
}
|
|
8
|
+
declare function Badge({ className, variant, ...props }: BadgeProps): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export { Badge, badgeVariants };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { VariantProps } from 'class-variance-authority';
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
declare const buttonVariants: (props?: ({
|
|
4
|
+
variant?: "default" | "link" | "destructive" | "secondary" | "outline" | "ghost" | null | undefined;
|
|
5
|
+
size?: "default" | "sm" | "lg" | "icon" | null | undefined;
|
|
6
|
+
} & import('class-variance-authority/dist/types').ClassProp) | undefined) => string;
|
|
7
|
+
export interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof buttonVariants> {
|
|
8
|
+
asChild?: boolean;
|
|
9
|
+
}
|
|
10
|
+
export declare const Button: React.ForwardRefExoticComponent<ButtonProps & React.RefAttributes<HTMLButtonElement>>;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { DayPicker } from 'react-day-picker';
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
export type CalendarProps = React.ComponentProps<typeof DayPicker>;
|
|
4
|
+
declare function Calendar({ className, classNames, showOutsideDays, ...props }: CalendarProps): import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
declare namespace Calendar {
|
|
6
|
+
var displayName: string;
|
|
7
|
+
}
|
|
8
|
+
export { Calendar };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
declare const Card: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
3
|
+
declare const CardHeader: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
4
|
+
declare const CardTitle: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLHeadingElement> & React.RefAttributes<HTMLParagraphElement>>;
|
|
5
|
+
declare const CardDescription: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLParagraphElement> & React.RefAttributes<HTMLParagraphElement>>;
|
|
6
|
+
declare const CardContent: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
7
|
+
declare const CardFooter: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
8
|
+
export { Card, CardHeader, CardFooter, CardTitle, CardDescription, CardContent };
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import * as CheckboxPrimitive from "@radix-ui/react-checkbox";
|
|
3
|
+
declare const Checkbox: React.ForwardRefExoticComponent<Omit<CheckboxPrimitive.CheckboxProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
4
|
+
export { Checkbox };
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { VariantProps } from 'class-variance-authority';
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
declare const codeVariants: (props?: ({
|
|
4
|
+
variant?: "inline" | "block" | null | undefined;
|
|
5
|
+
size?: "base" | "sm" | "lg" | null | undefined;
|
|
6
|
+
} & import('class-variance-authority/dist/types').ClassProp) | undefined) => string;
|
|
7
|
+
export interface CodeProps extends React.HTMLAttributes<HTMLElement>, VariantProps<typeof codeVariants> {
|
|
8
|
+
language?: string;
|
|
9
|
+
showLineNumbers?: boolean;
|
|
10
|
+
maxHeight?: string | number;
|
|
11
|
+
copyable?: boolean;
|
|
12
|
+
filename?: string;
|
|
13
|
+
theme?: 'light' | 'dark' | 'auto';
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Code - Composant de code avec coloration syntaxique et responsivité complète
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* ```tsx
|
|
20
|
+
* <Code>const hello = "world"</Code>
|
|
21
|
+
* <Code variant="block" language="typescript" copyable>
|
|
22
|
+
* function greet(name: string) {
|
|
23
|
+
* return `Hello, ${name}!`
|
|
24
|
+
* }
|
|
25
|
+
* </Code>
|
|
26
|
+
* ```
|
|
27
|
+
*/
|
|
28
|
+
declare const Code: React.ForwardRefExoticComponent<CodeProps & React.RefAttributes<HTMLElement>>;
|
|
29
|
+
export { Code, codeVariants };
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import * as CollapsiblePrimitive from "@radix-ui/react-collapsible";
|
|
2
|
+
declare const Collapsible: typeof CollapsiblePrimitive.Root;
|
|
3
|
+
declare const CollapsibleTrigger: typeof CollapsiblePrimitive.CollapsibleTrigger;
|
|
4
|
+
declare const CollapsibleContent: typeof CollapsiblePrimitive.CollapsibleContent;
|
|
5
|
+
export { Collapsible, CollapsibleTrigger, CollapsibleContent };
|