@wakastellar/ui 0.1.3 → 0.1.5
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 +403 -199
- package/dist/blocks/activity-timeline/index.d.ts +73 -0
- package/dist/blocks/calendar-view/index.d.ts +56 -0
- package/dist/blocks/chat/index.d.ts +87 -0
- package/dist/blocks/dashboard/index.d.ts +92 -0
- package/dist/blocks/empty-states/index.d.ts +44 -0
- package/dist/blocks/error-pages/index.d.ts +52 -0
- package/dist/blocks/faq/index.d.ts +54 -0
- package/dist/blocks/file-manager/index.d.ts +81 -0
- package/dist/blocks/header/index.d.ts +86 -0
- package/dist/blocks/i18n-editor/index.d.ts +63 -0
- package/dist/blocks/kanban-board/index.d.ts +77 -0
- package/dist/blocks/landing/index.d.ts +101 -0
- package/dist/blocks/login/index.d.ts +12 -1
- package/dist/blocks/login/types.d.ts +46 -7
- package/dist/blocks/pricing/index.d.ts +60 -0
- package/dist/blocks/profile/index.d.ts +98 -0
- package/dist/blocks/settings/index.d.ts +62 -0
- package/dist/blocks/sidebar/index.d.ts +151 -0
- package/dist/blocks/theme-creator-block/index.d.ts +86 -0
- package/dist/blocks/user-management/index.d.ts +95 -0
- package/dist/blocks/wizard/index.d.ts +88 -0
- package/dist/charts.d.ts +17 -0
- package/dist/components/DataTable/DataTableBody.d.ts +70 -0
- package/dist/components/DataTable/DataTableCell.d.ts +38 -0
- package/dist/components/DataTable/DataTableConflictResolver.d.ts +45 -0
- package/dist/components/DataTable/DataTableFilterBuilder.d.ts +14 -0
- package/dist/components/DataTable/DataTableHeader.d.ts +50 -0
- package/dist/components/DataTable/DataTableSyncStatus.d.ts +31 -0
- package/dist/components/DataTable/formatters/index.d.ts +127 -0
- package/dist/components/DataTable/hooks/useDataTableAdvancedFilters.d.ts +18 -0
- package/dist/components/DataTable/hooks/useDataTableColumnTemplates.d.ts +28 -0
- package/dist/components/DataTable/hooks/useDataTableExport.d.ts +1 -1
- package/dist/components/DataTable/hooks/useDataTableOffline.d.ts +80 -0
- package/dist/components/DataTable/services/IndexedDBService.d.ts +117 -0
- package/dist/components/DataTable/templates/index.d.ts +104 -0
- package/dist/components/DataTable/workers/exportWorker.d.ts +29 -0
- package/dist/components/error-boundary/ErrorBoundary.d.ts +102 -0
- package/dist/components/error-boundary/index.d.ts +2 -0
- package/dist/components/waka-autocomplete/index.d.ts +59 -0
- package/dist/components/waka-barcode/index.d.ts +27 -0
- package/dist/components/waka-breadcrumb/index.d.ts +43 -0
- package/dist/components/waka-charts/WakaAreaChart.d.ts +12 -0
- package/dist/components/waka-charts/WakaBarChart.d.ts +12 -0
- package/dist/components/waka-charts/WakaChart.d.ts +17 -0
- package/dist/components/waka-charts/WakaLineChart.d.ts +12 -0
- package/dist/components/waka-charts/WakaMiniChart.d.ts +13 -0
- package/dist/components/waka-charts/WakaPieChart.d.ts +12 -0
- package/dist/components/waka-charts/WakaSparkline.d.ts +13 -0
- package/dist/components/waka-charts/dataTableHelpers.d.ts +34 -0
- package/dist/components/waka-charts/hooks/useChartTheme.d.ts +23 -0
- package/dist/components/waka-charts/hooks/useRechartsLoader.d.ts +161 -0
- package/dist/components/waka-charts/index.d.ts +57 -0
- package/dist/components/waka-charts/types.d.ts +298 -0
- package/dist/components/waka-color-picker/index.d.ts +40 -0
- package/dist/components/waka-combobox/index.d.ts +81 -0
- package/dist/components/waka-date-range-picker/index.d.ts +68 -0
- package/dist/components/waka-drawer/index.d.ts +59 -0
- package/dist/components/waka-file-upload/index.d.ts +49 -0
- package/dist/components/waka-image/index.d.ts +59 -0
- package/dist/components/waka-kanban/index.d.ts +68 -0
- package/dist/components/waka-modal/index.d.ts +82 -0
- package/dist/components/waka-number-input/index.d.ts +60 -0
- package/dist/components/waka-pagination/index.d.ts +67 -0
- package/dist/components/waka-qrcode/index.d.ts +32 -0
- package/dist/components/waka-rich-text-editor/index.d.ts +36 -0
- package/dist/components/waka-segmented-control/index.d.ts +42 -0
- package/dist/components/waka-stat/index.d.ts +57 -0
- package/dist/components/waka-stepper/index.d.ts +76 -0
- package/dist/components/waka-time-picker/index.d.ts +51 -0
- package/dist/components/waka-timeline/index.d.ts +46 -0
- package/dist/components/waka-tree/index.d.ts +67 -0
- package/dist/components/waka-video/index.d.ts +66 -0
- package/dist/components/waka-virtual-list/index.d.ts +54 -0
- package/dist/export.d.ts +28 -0
- package/dist/index.cjs.js +25 -23
- package/dist/index.es.js +5665 -5527
- package/dist/rich-text.d.ts +21 -0
- package/dist/ui.css +1 -1
- package/dist/utils/error-handling.d.ts +190 -0
- package/package.json +5 -2
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
export interface SidebarMenuItem {
|
|
3
|
+
/** Identifiant unique */
|
|
4
|
+
id: string;
|
|
5
|
+
/** Label du menu */
|
|
6
|
+
label: string;
|
|
7
|
+
/** Icône (composant React) */
|
|
8
|
+
icon?: React.ReactNode;
|
|
9
|
+
/** URL de navigation */
|
|
10
|
+
href?: string;
|
|
11
|
+
/** Callback au clic */
|
|
12
|
+
onClick?: () => void;
|
|
13
|
+
/** Sous-menus */
|
|
14
|
+
children?: SidebarMenuItem[];
|
|
15
|
+
/** Menu actif */
|
|
16
|
+
active?: boolean;
|
|
17
|
+
/** Badge/compteur */
|
|
18
|
+
badge?: string | number;
|
|
19
|
+
/** Désactivé */
|
|
20
|
+
disabled?: boolean;
|
|
21
|
+
}
|
|
22
|
+
export interface SidebarUserConfig {
|
|
23
|
+
/** Nom de l'utilisateur */
|
|
24
|
+
name: string;
|
|
25
|
+
/** Email ou sous-titre */
|
|
26
|
+
email?: string;
|
|
27
|
+
/** URL de l'avatar */
|
|
28
|
+
avatarUrl?: string;
|
|
29
|
+
/** Initiales pour le fallback */
|
|
30
|
+
initials?: string;
|
|
31
|
+
/** Actions du menu utilisateur */
|
|
32
|
+
actions?: {
|
|
33
|
+
id: string;
|
|
34
|
+
label: string;
|
|
35
|
+
icon?: React.ReactNode;
|
|
36
|
+
onClick?: () => void;
|
|
37
|
+
href?: string;
|
|
38
|
+
variant?: "default" | "destructive";
|
|
39
|
+
}[];
|
|
40
|
+
}
|
|
41
|
+
export interface SidebarLogoConfig {
|
|
42
|
+
/** Image du logo */
|
|
43
|
+
src?: string;
|
|
44
|
+
/** Texte alternatif */
|
|
45
|
+
alt?: string;
|
|
46
|
+
/** Texte à côté du logo */
|
|
47
|
+
title?: string;
|
|
48
|
+
/** URL au clic sur le logo */
|
|
49
|
+
href?: string;
|
|
50
|
+
/** Callback au clic */
|
|
51
|
+
onClick?: () => void;
|
|
52
|
+
/** Composant logo personnalisé */
|
|
53
|
+
component?: React.ReactNode;
|
|
54
|
+
}
|
|
55
|
+
export interface WakaSidebarProps {
|
|
56
|
+
/** Configuration du logo */
|
|
57
|
+
logo?: SidebarLogoConfig;
|
|
58
|
+
/** Éléments du menu */
|
|
59
|
+
menu: SidebarMenuItem[];
|
|
60
|
+
/** Configuration utilisateur */
|
|
61
|
+
user?: SidebarUserConfig;
|
|
62
|
+
/** Largeur de la sidebar (desktop) */
|
|
63
|
+
width?: number;
|
|
64
|
+
/** Breakpoint pour le mode mobile (en px) */
|
|
65
|
+
mobileBreakpoint?: number;
|
|
66
|
+
/** Sidebar ouverte (mode mobile) */
|
|
67
|
+
open?: boolean;
|
|
68
|
+
/** Callback changement d'état (mode mobile) */
|
|
69
|
+
onOpenChange?: (open: boolean) => void;
|
|
70
|
+
/** Classes CSS additionnelles */
|
|
71
|
+
className?: string;
|
|
72
|
+
/** Classes CSS du contenu */
|
|
73
|
+
contentClassName?: string;
|
|
74
|
+
/** Couleur de fond */
|
|
75
|
+
backgroundColor?: string;
|
|
76
|
+
/** Couleur du texte */
|
|
77
|
+
textColor?: string;
|
|
78
|
+
/** Couleur de l'élément actif */
|
|
79
|
+
activeColor?: string;
|
|
80
|
+
/** Couleur de survol */
|
|
81
|
+
hoverColor?: string;
|
|
82
|
+
/** Position du menu utilisateur */
|
|
83
|
+
userPosition?: "top" | "bottom";
|
|
84
|
+
/** Afficher le bouton hamburger */
|
|
85
|
+
showHamburger?: boolean;
|
|
86
|
+
/** Position du bouton hamburger (pour usage externe) */
|
|
87
|
+
hamburgerPosition?: "left" | "right";
|
|
88
|
+
/** Rendu personnalisé d'un item */
|
|
89
|
+
renderItem?: (item: SidebarMenuItem, isChild: boolean) => React.ReactNode;
|
|
90
|
+
/** Footer personnalisé */
|
|
91
|
+
footer?: React.ReactNode;
|
|
92
|
+
/** Header personnalisé (après le logo) */
|
|
93
|
+
header?: React.ReactNode;
|
|
94
|
+
/** Mode de positionnement : "fixed" pour app layout, "relative" pour preview/demo */
|
|
95
|
+
position?: "fixed" | "relative";
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* WakaSidebar - Sidebar personnalisable avec menu hamburger responsive
|
|
99
|
+
*
|
|
100
|
+
* @example
|
|
101
|
+
* ```tsx
|
|
102
|
+
* <WakaSidebar
|
|
103
|
+
* logo={{ src: "/logo.svg", title: "WAKASTART" }}
|
|
104
|
+
* menu={[
|
|
105
|
+
* { id: "dashboard", label: "Tableau de bord", icon: <Home /> },
|
|
106
|
+
* {
|
|
107
|
+
* id: "admin",
|
|
108
|
+
* label: "Administration",
|
|
109
|
+
* icon: <Settings />,
|
|
110
|
+
* children: [
|
|
111
|
+
* { id: "users", label: "Utilisateurs" },
|
|
112
|
+
* { id: "roles", label: "Rôles" },
|
|
113
|
+
* ],
|
|
114
|
+
* },
|
|
115
|
+
* ]}
|
|
116
|
+
* user={{
|
|
117
|
+
* name: "John Doe",
|
|
118
|
+
* email: "john@example.com",
|
|
119
|
+
* avatarUrl: "/avatar.jpg",
|
|
120
|
+
* }}
|
|
121
|
+
* />
|
|
122
|
+
* ```
|
|
123
|
+
*/
|
|
124
|
+
export declare function WakaSidebar({ logo, menu, user, width, mobileBreakpoint, open, onOpenChange, className, contentClassName, backgroundColor, textColor, activeColor, hoverColor, userPosition, showHamburger, hamburgerPosition, renderItem, footer, header, position, }: WakaSidebarProps): import("react/jsx-runtime").JSX.Element;
|
|
125
|
+
/**
|
|
126
|
+
* Hook pour gérer l'état de la sidebar externalement
|
|
127
|
+
*/
|
|
128
|
+
export declare function useSidebar(): {
|
|
129
|
+
isOpen: boolean;
|
|
130
|
+
setIsOpen: React.Dispatch<React.SetStateAction<boolean>>;
|
|
131
|
+
open: () => void;
|
|
132
|
+
close: () => void;
|
|
133
|
+
toggle: () => void;
|
|
134
|
+
};
|
|
135
|
+
export interface SidebarLayoutProps {
|
|
136
|
+
/** Configuration de la sidebar */
|
|
137
|
+
sidebar: WakaSidebarProps;
|
|
138
|
+
/** Contenu principal */
|
|
139
|
+
children: React.ReactNode;
|
|
140
|
+
/** Largeur de la sidebar (override) */
|
|
141
|
+
sidebarWidth?: number;
|
|
142
|
+
/** Classes CSS du conteneur */
|
|
143
|
+
className?: string;
|
|
144
|
+
/** Classes CSS du contenu principal */
|
|
145
|
+
contentClassName?: string;
|
|
146
|
+
}
|
|
147
|
+
/**
|
|
148
|
+
* Layout avec sidebar intégrée
|
|
149
|
+
*/
|
|
150
|
+
export declare function SidebarLayout({ sidebar, children, sidebarWidth, className, contentClassName, }: SidebarLayoutProps): import("react/jsx-runtime").JSX.Element;
|
|
151
|
+
export default WakaSidebar;
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
export interface ThemeBlockColors {
|
|
3
|
+
background: string;
|
|
4
|
+
foreground: string;
|
|
5
|
+
card: string;
|
|
6
|
+
cardForeground: string;
|
|
7
|
+
popover: string;
|
|
8
|
+
popoverForeground: string;
|
|
9
|
+
primary: string;
|
|
10
|
+
primaryForeground: string;
|
|
11
|
+
secondary: string;
|
|
12
|
+
secondaryForeground: string;
|
|
13
|
+
muted: string;
|
|
14
|
+
mutedForeground: string;
|
|
15
|
+
accent: string;
|
|
16
|
+
accentForeground: string;
|
|
17
|
+
destructive: string;
|
|
18
|
+
destructiveForeground: string;
|
|
19
|
+
border: string;
|
|
20
|
+
input: string;
|
|
21
|
+
ring: string;
|
|
22
|
+
chart1: string;
|
|
23
|
+
chart2: string;
|
|
24
|
+
chart3: string;
|
|
25
|
+
chart4: string;
|
|
26
|
+
chart5: string;
|
|
27
|
+
sidebarBackground?: string;
|
|
28
|
+
sidebarForeground?: string;
|
|
29
|
+
sidebarPrimary?: string;
|
|
30
|
+
sidebarPrimaryForeground?: string;
|
|
31
|
+
sidebarAccent?: string;
|
|
32
|
+
sidebarAccentForeground?: string;
|
|
33
|
+
sidebarBorder?: string;
|
|
34
|
+
sidebarRing?: string;
|
|
35
|
+
}
|
|
36
|
+
export interface ThemeBlockAssets {
|
|
37
|
+
logoLight?: string;
|
|
38
|
+
logoDark?: string;
|
|
39
|
+
backgroundLight?: string;
|
|
40
|
+
backgroundDark?: string;
|
|
41
|
+
favicon?: string;
|
|
42
|
+
sponsorLight?: string;
|
|
43
|
+
sponsorDark?: string;
|
|
44
|
+
}
|
|
45
|
+
export interface ThemeCreatorBlockTheme {
|
|
46
|
+
id: string;
|
|
47
|
+
name: string;
|
|
48
|
+
description?: string;
|
|
49
|
+
author?: string;
|
|
50
|
+
lightColors: ThemeBlockColors;
|
|
51
|
+
darkColors: ThemeBlockColors;
|
|
52
|
+
assets?: ThemeBlockAssets;
|
|
53
|
+
radius?: string;
|
|
54
|
+
fonts?: {
|
|
55
|
+
sans?: string;
|
|
56
|
+
mono?: string;
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
export interface ThemeColorGroup {
|
|
60
|
+
id: string;
|
|
61
|
+
label: string;
|
|
62
|
+
icon?: React.ReactNode;
|
|
63
|
+
colors: {
|
|
64
|
+
key: keyof ThemeBlockColors;
|
|
65
|
+
label: string;
|
|
66
|
+
description?: string;
|
|
67
|
+
}[];
|
|
68
|
+
}
|
|
69
|
+
export interface WakaThemeCreatorBlockProps {
|
|
70
|
+
themes?: ThemeCreatorBlockTheme[];
|
|
71
|
+
initialTheme?: ThemeCreatorBlockTheme;
|
|
72
|
+
onThemeChange?: (theme: ThemeCreatorBlockTheme) => void;
|
|
73
|
+
onSave?: (theme: ThemeCreatorBlockTheme) => Promise<void>;
|
|
74
|
+
onUploadAsset?: (file: File, assetType: keyof ThemeBlockAssets) => Promise<string>;
|
|
75
|
+
onExport?: (theme: ThemeCreatorBlockTheme, format: 'json' | 'css') => void;
|
|
76
|
+
showTypography?: boolean;
|
|
77
|
+
showSidebarColors?: boolean;
|
|
78
|
+
previewTabs?: ('login' | 'dashboard' | 'chat')[];
|
|
79
|
+
customPreview?: React.ReactNode;
|
|
80
|
+
className?: string;
|
|
81
|
+
}
|
|
82
|
+
export declare const defaultThemes: ThemeCreatorBlockTheme[];
|
|
83
|
+
export declare function WakaThemeCreatorBlock({ themes, initialTheme, onThemeChange, onSave, onUploadAsset, showSidebarColors, previewTabs, className, }: WakaThemeCreatorBlockProps): import("react/jsx-runtime").JSX.Element;
|
|
84
|
+
export declare namespace WakaThemeCreatorBlock {
|
|
85
|
+
var displayName: string;
|
|
86
|
+
}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
export type UserRole = "admin" | "moderator" | "user" | "guest";
|
|
2
|
+
export type UserStatus = "active" | "inactive" | "pending" | "banned";
|
|
3
|
+
export interface UserPermission {
|
|
4
|
+
id: string;
|
|
5
|
+
name: string;
|
|
6
|
+
description?: string;
|
|
7
|
+
category?: string;
|
|
8
|
+
}
|
|
9
|
+
export interface UserData {
|
|
10
|
+
id: string;
|
|
11
|
+
email: string;
|
|
12
|
+
displayName: string;
|
|
13
|
+
firstName?: string;
|
|
14
|
+
lastName?: string;
|
|
15
|
+
avatarUrl?: string;
|
|
16
|
+
role: UserRole;
|
|
17
|
+
status: UserStatus;
|
|
18
|
+
permissions?: string[];
|
|
19
|
+
createdAt: Date | string;
|
|
20
|
+
lastLogin?: Date | string;
|
|
21
|
+
metadata?: Record<string, unknown>;
|
|
22
|
+
}
|
|
23
|
+
export interface UserFormData {
|
|
24
|
+
email: string;
|
|
25
|
+
displayName: string;
|
|
26
|
+
firstName?: string;
|
|
27
|
+
lastName?: string;
|
|
28
|
+
role: UserRole;
|
|
29
|
+
status: UserStatus;
|
|
30
|
+
permissions?: string[];
|
|
31
|
+
}
|
|
32
|
+
export interface WakaUserManagementProps {
|
|
33
|
+
/** Liste des utilisateurs */
|
|
34
|
+
users: UserData[];
|
|
35
|
+
/** Rôles disponibles */
|
|
36
|
+
roles?: {
|
|
37
|
+
value: UserRole;
|
|
38
|
+
label: string;
|
|
39
|
+
color?: string;
|
|
40
|
+
}[];
|
|
41
|
+
/** Permissions disponibles */
|
|
42
|
+
permissions?: UserPermission[];
|
|
43
|
+
/** Utilisateurs sélectionnés */
|
|
44
|
+
selectedUsers?: string[];
|
|
45
|
+
/** Callback sélection */
|
|
46
|
+
onSelectionChange?: (userIds: string[]) => void;
|
|
47
|
+
/** Callback création */
|
|
48
|
+
onCreate?: (user: UserFormData) => void | Promise<void>;
|
|
49
|
+
/** Callback modification */
|
|
50
|
+
onEdit?: (userId: string, data: Partial<UserFormData>) => void | Promise<void>;
|
|
51
|
+
/** Callback suppression */
|
|
52
|
+
onDelete?: (userId: string) => void | Promise<void>;
|
|
53
|
+
/** Callback suppression multiple */
|
|
54
|
+
onBulkDelete?: (userIds: string[]) => void | Promise<void>;
|
|
55
|
+
/** Callback changement de rôle */
|
|
56
|
+
onRoleChange?: (userId: string, role: UserRole) => void | Promise<void>;
|
|
57
|
+
/** Callback changement de statut */
|
|
58
|
+
onStatusChange?: (userId: string, status: UserStatus) => void | Promise<void>;
|
|
59
|
+
/** Callback réinitialisation mot de passe */
|
|
60
|
+
onResetPassword?: (userId: string) => void | Promise<void>;
|
|
61
|
+
/** Callback export */
|
|
62
|
+
onExport?: () => void;
|
|
63
|
+
/** Callback rafraîchissement */
|
|
64
|
+
onRefresh?: () => void;
|
|
65
|
+
/** En cours de chargement */
|
|
66
|
+
loading?: boolean;
|
|
67
|
+
/** En cours d'action */
|
|
68
|
+
actionLoading?: boolean;
|
|
69
|
+
/** Recherche */
|
|
70
|
+
searchQuery?: string;
|
|
71
|
+
/** Callback recherche */
|
|
72
|
+
onSearchChange?: (query: string) => void;
|
|
73
|
+
/** Filtre par rôle */
|
|
74
|
+
roleFilter?: UserRole | "all";
|
|
75
|
+
/** Callback filtre rôle */
|
|
76
|
+
onRoleFilterChange?: (role: UserRole | "all") => void;
|
|
77
|
+
/** Filtre par statut */
|
|
78
|
+
statusFilter?: UserStatus | "all";
|
|
79
|
+
/** Callback filtre statut */
|
|
80
|
+
onStatusFilterChange?: (status: UserStatus | "all") => void;
|
|
81
|
+
/** Afficher les actions en masse */
|
|
82
|
+
showBulkActions?: boolean;
|
|
83
|
+
/** Afficher le bouton création */
|
|
84
|
+
showCreateButton?: boolean;
|
|
85
|
+
/** Titre */
|
|
86
|
+
title?: string;
|
|
87
|
+
/** Description */
|
|
88
|
+
description?: string;
|
|
89
|
+
/** Classes CSS additionnelles */
|
|
90
|
+
className?: string;
|
|
91
|
+
}
|
|
92
|
+
export declare function WakaUserManagement({ users, roles, permissions, selectedUsers, onSelectionChange, onCreate, onEdit, onDelete, onBulkDelete, onRoleChange, onStatusChange, onResetPassword, onExport, onRefresh, loading, actionLoading, searchQuery, onSearchChange, roleFilter, onRoleFilterChange, statusFilter, onStatusFilterChange, showBulkActions, showCreateButton, title, description, className, }: WakaUserManagementProps): import("react/jsx-runtime").JSX.Element;
|
|
93
|
+
export declare const defaultUsers: UserData[];
|
|
94
|
+
export declare const defaultPermissions: UserPermission[];
|
|
95
|
+
export default WakaUserManagement;
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
export type WizardStepStatus = "pending" | "current" | "completed" | "error" | "skipped";
|
|
3
|
+
export interface WizardStep {
|
|
4
|
+
id: string;
|
|
5
|
+
title: string;
|
|
6
|
+
description?: string;
|
|
7
|
+
icon?: React.ReactNode;
|
|
8
|
+
content: React.ReactNode;
|
|
9
|
+
/** Étape optionnelle (peut être sautée) */
|
|
10
|
+
optional?: boolean;
|
|
11
|
+
/** Validation de l'étape */
|
|
12
|
+
validate?: () => boolean | Promise<boolean>;
|
|
13
|
+
/** Callback avant de quitter l'étape */
|
|
14
|
+
onLeave?: () => void | Promise<void>;
|
|
15
|
+
/** Callback en entrant dans l'étape */
|
|
16
|
+
onEnter?: () => void | Promise<void>;
|
|
17
|
+
}
|
|
18
|
+
export interface WizardSubmitData {
|
|
19
|
+
steps: {
|
|
20
|
+
id: string;
|
|
21
|
+
status: WizardStepStatus;
|
|
22
|
+
}[];
|
|
23
|
+
completedSteps: string[];
|
|
24
|
+
skippedSteps: string[];
|
|
25
|
+
}
|
|
26
|
+
export interface WakaWizardProps {
|
|
27
|
+
/** Étapes du wizard */
|
|
28
|
+
steps: WizardStep[];
|
|
29
|
+
/** Étape courante (contrôlé) */
|
|
30
|
+
currentStep?: number;
|
|
31
|
+
/** Callback changement d'étape */
|
|
32
|
+
onStepChange?: (step: number) => void;
|
|
33
|
+
/** Callback de soumission */
|
|
34
|
+
onSubmit?: (data: WizardSubmitData) => void | Promise<void>;
|
|
35
|
+
/** Callback d'annulation */
|
|
36
|
+
onCancel?: () => void;
|
|
37
|
+
/** Titre du wizard */
|
|
38
|
+
title?: string;
|
|
39
|
+
/** Description */
|
|
40
|
+
description?: string;
|
|
41
|
+
/** Texte du bouton précédent */
|
|
42
|
+
prevButtonText?: string;
|
|
43
|
+
/** Texte du bouton suivant */
|
|
44
|
+
nextButtonText?: string;
|
|
45
|
+
/** Texte du bouton terminer */
|
|
46
|
+
finishButtonText?: string;
|
|
47
|
+
/** Texte du bouton annuler */
|
|
48
|
+
cancelButtonText?: string;
|
|
49
|
+
/** Texte du bouton passer */
|
|
50
|
+
skipButtonText?: string;
|
|
51
|
+
/** Afficher le bouton annuler */
|
|
52
|
+
showCancelButton?: boolean;
|
|
53
|
+
/** Afficher la progression */
|
|
54
|
+
showProgress?: boolean;
|
|
55
|
+
/** Afficher les numéros d'étapes */
|
|
56
|
+
showStepNumbers?: boolean;
|
|
57
|
+
/** Afficher le stepper */
|
|
58
|
+
showStepper?: boolean;
|
|
59
|
+
/** Position du stepper */
|
|
60
|
+
stepperPosition?: "top" | "left";
|
|
61
|
+
/** Permettre la navigation vers les étapes précédentes */
|
|
62
|
+
allowBackNavigation?: boolean;
|
|
63
|
+
/** Confirmer l'annulation */
|
|
64
|
+
confirmCancel?: boolean;
|
|
65
|
+
/** Message de confirmation d'annulation */
|
|
66
|
+
cancelConfirmMessage?: string;
|
|
67
|
+
/** En cours de soumission */
|
|
68
|
+
submitting?: boolean;
|
|
69
|
+
/** Layout */
|
|
70
|
+
layout?: "card" | "page" | "minimal";
|
|
71
|
+
/** Classes CSS additionnelles */
|
|
72
|
+
className?: string;
|
|
73
|
+
}
|
|
74
|
+
interface WizardContextValue {
|
|
75
|
+
currentStep: number;
|
|
76
|
+
totalSteps: number;
|
|
77
|
+
stepStatuses: WizardStepStatus[];
|
|
78
|
+
goToStep: (step: number) => void;
|
|
79
|
+
nextStep: () => void;
|
|
80
|
+
prevStep: () => void;
|
|
81
|
+
skipStep: () => void;
|
|
82
|
+
isFirstStep: boolean;
|
|
83
|
+
isLastStep: boolean;
|
|
84
|
+
}
|
|
85
|
+
export declare function useWizard(): WizardContextValue;
|
|
86
|
+
export declare function WakaWizard({ steps, currentStep: externalCurrentStep, onStepChange, onSubmit, onCancel, title, description, prevButtonText, nextButtonText, finishButtonText, cancelButtonText, skipButtonText, showCancelButton, showProgress, showStepNumbers, showStepper, stepperPosition, allowBackNavigation, confirmCancel, cancelConfirmMessage, submitting, layout, className, }: WakaWizardProps): import("react/jsx-runtime").JSX.Element;
|
|
87
|
+
export declare const defaultWizardSteps: WizardStep[];
|
|
88
|
+
export default WakaWizard;
|
package/dist/charts.d.ts
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Entry point pour les composants WakaCharts
|
|
3
|
+
*
|
|
4
|
+
* Usage:
|
|
5
|
+
* ```ts
|
|
6
|
+
* import { WakaBarChart, WakaLineChart, WakaPieChart } from "@wakastellar/ui/charts"
|
|
7
|
+
* ```
|
|
8
|
+
*
|
|
9
|
+
* Dépendances requises:
|
|
10
|
+
* - recharts (>=2.10.0)
|
|
11
|
+
*
|
|
12
|
+
* Installation:
|
|
13
|
+
* ```bash
|
|
14
|
+
* pnpm add recharts
|
|
15
|
+
* ```
|
|
16
|
+
*/
|
|
17
|
+
export * from './components/waka-charts';
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { Table, Row } from '@tanstack/react-table';
|
|
2
|
+
import { ColumnEditConfig, EditableCellValue, RowExpansionConfig } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* Props pour le composant DataTableBody
|
|
5
|
+
*/
|
|
6
|
+
export interface DataTableBodyProps<TData extends Record<string, unknown>> {
|
|
7
|
+
/** Instance de la table TanStack */
|
|
8
|
+
table: Table<TData>;
|
|
9
|
+
/** Configuration d'expansion des lignes */
|
|
10
|
+
rowExpansion?: RowExpansionConfig<TData>;
|
|
11
|
+
/** Classes CSS pour la densité */
|
|
12
|
+
densityClasses?: {
|
|
13
|
+
header?: string;
|
|
14
|
+
table?: string;
|
|
15
|
+
cell?: string;
|
|
16
|
+
};
|
|
17
|
+
/** Callback de clic sur ligne */
|
|
18
|
+
onRowClick?: (row: TData) => void;
|
|
19
|
+
/** Callback de double-clic */
|
|
20
|
+
onRowDoubleClick?: (row: TData) => void;
|
|
21
|
+
/** ID de la ligne en cours d'édition */
|
|
22
|
+
editingRowId?: string | null;
|
|
23
|
+
/** Configuration d'édition des colonnes */
|
|
24
|
+
editableColumns?: ColumnEditConfig<TData>[];
|
|
25
|
+
/** Callback pour mettre à jour un champ */
|
|
26
|
+
onUpdateField?: (field: keyof TData, value: EditableCellValue) => void;
|
|
27
|
+
/** Callback pour démarrer l'édition */
|
|
28
|
+
onStartEdit?: (rowId: string, originalData: TData) => void;
|
|
29
|
+
/** Callback pour sauvegarder */
|
|
30
|
+
onSaveEdit?: () => void;
|
|
31
|
+
/** Callback pour annuler */
|
|
32
|
+
onCancelEdit?: () => void;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Composant Body réutilisable pour DataTable
|
|
36
|
+
*
|
|
37
|
+
* Gère :
|
|
38
|
+
* - Le rendu des lignes
|
|
39
|
+
* - L'expansion des lignes
|
|
40
|
+
* - Le groupement
|
|
41
|
+
* - L'édition inline
|
|
42
|
+
*/
|
|
43
|
+
export declare function DataTableBody<TData extends Record<string, unknown>>({ table, rowExpansion, densityClasses, onRowClick, onRowDoubleClick, editingRowId, editableColumns, onUpdateField, onStartEdit, onSaveEdit, onCancelEdit, }: DataTableBodyProps<TData>): import("react/jsx-runtime").JSX.Element;
|
|
44
|
+
/**
|
|
45
|
+
* Props pour DataTableBodyRow
|
|
46
|
+
*/
|
|
47
|
+
interface DataTableBodyRowProps<TData extends Record<string, unknown>> {
|
|
48
|
+
row: Row<TData>;
|
|
49
|
+
rowExpansion?: RowExpansionConfig<TData>;
|
|
50
|
+
densityClasses: {
|
|
51
|
+
header?: string;
|
|
52
|
+
table?: string;
|
|
53
|
+
cell?: string;
|
|
54
|
+
};
|
|
55
|
+
onRowClick?: (row: TData) => void;
|
|
56
|
+
onRowDoubleClick?: (row: TData) => void;
|
|
57
|
+
editingRowId?: string | null;
|
|
58
|
+
editableColumns?: ColumnEditConfig<TData>[];
|
|
59
|
+
onUpdateField?: (field: keyof TData, value: EditableCellValue) => void;
|
|
60
|
+
onStartEdit?: (rowId: string, originalData: TData) => void;
|
|
61
|
+
onSaveEdit?: () => void;
|
|
62
|
+
onCancelEdit?: () => void;
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Ligne individuelle du body
|
|
66
|
+
* Optimisé avec React.memo pour éviter les re-renders inutiles
|
|
67
|
+
*/
|
|
68
|
+
declare function DataTableBodyRowInner<TData extends Record<string, unknown>>({ row, rowExpansion, densityClasses, onRowClick, onRowDoubleClick, editingRowId, editableColumns, onUpdateField, onStartEdit, onSaveEdit, onCancelEdit, }: DataTableBodyRowProps<TData>): import("react/jsx-runtime").JSX.Element;
|
|
69
|
+
declare const DataTableBodyRow: typeof DataTableBodyRowInner;
|
|
70
|
+
export { DataTableBodyRow };
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { Cell, Row } from '@tanstack/react-table';
|
|
2
|
+
import { ColumnEditConfig, EditableCellValue } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* Props pour le composant DataTableCell
|
|
5
|
+
*/
|
|
6
|
+
export interface DataTableCellProps<TData extends Record<string, unknown>> {
|
|
7
|
+
/** Cellule TanStack Table */
|
|
8
|
+
cell: Cell<TData, unknown>;
|
|
9
|
+
/** Ligne parente */
|
|
10
|
+
row: Row<TData>;
|
|
11
|
+
/** ID de la ligne en cours d'édition */
|
|
12
|
+
editingRowId?: string | null;
|
|
13
|
+
/** Configuration d'édition des colonnes */
|
|
14
|
+
editableColumns?: ColumnEditConfig<TData>[];
|
|
15
|
+
/** Callback pour mettre à jour un champ */
|
|
16
|
+
onUpdateField?: (field: keyof TData, value: EditableCellValue) => void;
|
|
17
|
+
/** Callback pour démarrer l'édition */
|
|
18
|
+
onStartEdit?: (rowId: string, originalData: TData) => void;
|
|
19
|
+
/** Callback pour sauvegarder */
|
|
20
|
+
onSaveEdit?: () => void;
|
|
21
|
+
/** Callback pour annuler */
|
|
22
|
+
onCancelEdit?: () => void;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Composant de cellule réutilisable pour DataTable
|
|
26
|
+
*
|
|
27
|
+
* Gère tous les types de cellules :
|
|
28
|
+
* - Cellules normales
|
|
29
|
+
* - Cellules éditables
|
|
30
|
+
* - Cellules groupées
|
|
31
|
+
* - Cellules agrégées
|
|
32
|
+
* - Cellules placeholder
|
|
33
|
+
*
|
|
34
|
+
* Optimisé avec React.memo pour éviter les re-renders inutiles
|
|
35
|
+
*/
|
|
36
|
+
declare function DataTableCellInner<TData extends Record<string, unknown>>({ cell, row, editingRowId, editableColumns, onUpdateField, onStartEdit, onSaveEdit, onCancelEdit, }: DataTableCellProps<TData>): import("react/jsx-runtime").JSX.Element | null;
|
|
37
|
+
export declare const DataTableCell: typeof DataTableCellInner;
|
|
38
|
+
export {};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { ConflictEntry } from './services/IndexedDBService';
|
|
2
|
+
/**
|
|
3
|
+
* DataTableConflictResolver - Interface de résolution des conflits
|
|
4
|
+
*/
|
|
5
|
+
import * as React from "react";
|
|
6
|
+
export interface DataTableConflictResolverProps<TData> {
|
|
7
|
+
/** Liste des conflits */
|
|
8
|
+
conflicts: ConflictEntry<TData>[];
|
|
9
|
+
/** Callback de résolution */
|
|
10
|
+
onResolve: (conflictId: string, resolution: "local" | "server" | "merge", mergedData?: Partial<TData>) => Promise<void>;
|
|
11
|
+
/** Ouvert */
|
|
12
|
+
open?: boolean;
|
|
13
|
+
/** Callback de fermeture */
|
|
14
|
+
onOpenChange?: (open: boolean) => void;
|
|
15
|
+
/** Afficher en mode sheet (sidebar) ou dialog */
|
|
16
|
+
mode?: "dialog" | "sheet";
|
|
17
|
+
/** Labels personnalisés */
|
|
18
|
+
labels?: {
|
|
19
|
+
title?: string;
|
|
20
|
+
description?: string;
|
|
21
|
+
localVersion?: string;
|
|
22
|
+
serverVersion?: string;
|
|
23
|
+
keepLocal?: string;
|
|
24
|
+
keepServer?: string;
|
|
25
|
+
merge?: string;
|
|
26
|
+
resolve?: string;
|
|
27
|
+
skip?: string;
|
|
28
|
+
noConflicts?: string;
|
|
29
|
+
conflictType?: Record<"create" | "update" | "delete", string>;
|
|
30
|
+
};
|
|
31
|
+
/** Fonction de rendu personnalisé pour les données */
|
|
32
|
+
renderData?: (data: Partial<TData> | null, type: "local" | "server") => React.ReactNode;
|
|
33
|
+
/** Clés à afficher dans la comparaison */
|
|
34
|
+
displayKeys?: (keyof TData)[];
|
|
35
|
+
/** Labels des clés */
|
|
36
|
+
keyLabels?: Record<string, string>;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Interface de résolution des conflits de synchronisation
|
|
40
|
+
*/
|
|
41
|
+
export declare function DataTableConflictResolver<TData extends Record<string, unknown>>({ conflicts, onResolve, open, onOpenChange, mode, labels: customLabels, renderData, displayKeys, keyLabels, }: DataTableConflictResolverProps<TData>): import("react/jsx-runtime").JSX.Element;
|
|
42
|
+
export declare namespace DataTableConflictResolver {
|
|
43
|
+
var displayName: string;
|
|
44
|
+
}
|
|
45
|
+
export default DataTableConflictResolver;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { FilterOperator, FilterableColumn, AdvancedFiltersState, AdvancedFiltersActions } from './types';
|
|
2
|
+
interface DataTableFilterBuilderProps<TData> {
|
|
3
|
+
state: AdvancedFiltersState<TData>;
|
|
4
|
+
actions: AdvancedFiltersActions<TData>;
|
|
5
|
+
columns: FilterableColumn<TData>[];
|
|
6
|
+
getOperatorsForColumn: (column: keyof TData | string) => FilterOperator[];
|
|
7
|
+
className?: string;
|
|
8
|
+
maxNestingDepth?: number;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Composant de construction de filtres avancés
|
|
12
|
+
*/
|
|
13
|
+
export declare function DataTableFilterBuilder<TData>({ state, actions, columns, getOperatorsForColumn, className, maxNestingDepth, }: DataTableFilterBuilderProps<TData>): import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
export default DataTableFilterBuilder;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { Table, HeaderGroup } from '@tanstack/react-table';
|
|
2
|
+
/**
|
|
3
|
+
* Props pour le composant DataTableHeader
|
|
4
|
+
*/
|
|
5
|
+
export interface DataTableHeaderProps<TData> {
|
|
6
|
+
/** Instance de la table TanStack */
|
|
7
|
+
table: Table<TData>;
|
|
8
|
+
/** Header sticky */
|
|
9
|
+
headerSticky?: boolean;
|
|
10
|
+
/** Classes CSS pour la densité */
|
|
11
|
+
densityClasses?: {
|
|
12
|
+
header?: string;
|
|
13
|
+
table?: string;
|
|
14
|
+
cell?: string;
|
|
15
|
+
};
|
|
16
|
+
/** Activer le redimensionnement des colonnes */
|
|
17
|
+
enableColumnResize?: boolean;
|
|
18
|
+
/** Mode de redimensionnement */
|
|
19
|
+
columnResizeMode?: "onChange" | "onEnd";
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Composant Header réutilisable pour DataTable
|
|
23
|
+
*
|
|
24
|
+
* Gère :
|
|
25
|
+
* - Le tri des colonnes
|
|
26
|
+
* - Le redimensionnement
|
|
27
|
+
* - Le sticky header
|
|
28
|
+
*/
|
|
29
|
+
export declare function DataTableHeader<TData>({ table, headerSticky, densityClasses, enableColumnResize, columnResizeMode, }: DataTableHeaderProps<TData>): import("react/jsx-runtime").JSX.Element;
|
|
30
|
+
/**
|
|
31
|
+
* Props pour DataTableHeaderRow
|
|
32
|
+
*/
|
|
33
|
+
interface DataTableHeaderRowProps<TData> {
|
|
34
|
+
headerGroup: HeaderGroup<TData>;
|
|
35
|
+
densityClasses: {
|
|
36
|
+
header?: string;
|
|
37
|
+
table?: string;
|
|
38
|
+
cell?: string;
|
|
39
|
+
};
|
|
40
|
+
enableColumnResize: boolean;
|
|
41
|
+
columnResizeMode: "onChange" | "onEnd";
|
|
42
|
+
table: Table<TData>;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Ligne d'en-tête individuelle
|
|
46
|
+
* Optimisé avec React.memo pour éviter les re-renders inutiles
|
|
47
|
+
*/
|
|
48
|
+
declare function DataTableHeaderRowInner<TData>({ headerGroup, densityClasses, enableColumnResize, columnResizeMode, table, }: DataTableHeaderRowProps<TData>): import("react/jsx-runtime").JSX.Element;
|
|
49
|
+
declare const DataTableHeaderRow: typeof DataTableHeaderRowInner;
|
|
50
|
+
export { DataTableHeaderRow };
|