@arche-mc2/vue-ui-lib 1.2.45 → 1.2.46
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 +616 -177
- package/dist/vue-ui-lib.css +1 -1
- package/dist/vue-ui-lib.es.js +168 -160
- package/dist/vue-ui-lib.umd.js +4 -4
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -47,7 +47,7 @@ import type { Option, ButtonTypes, IconName } from '@arche-mc2/vue-ui-lib'
|
|
|
47
47
|
|
|
48
48
|
---
|
|
49
49
|
|
|
50
|
-
## Composants disponibles (
|
|
50
|
+
## Composants disponibles (28)
|
|
51
51
|
|
|
52
52
|
| Composant | Description |
|
|
53
53
|
|-----------|-------------|
|
|
@@ -74,6 +74,11 @@ import type { Option, ButtonTypes, IconName } from '@arche-mc2/vue-ui-lib'
|
|
|
74
74
|
| [TagBase](#tagbase) | Badge coloré |
|
|
75
75
|
| [ListWithSearch](#listwithsearch) | Liste filtrée avec recherche |
|
|
76
76
|
| [SelectionGroup](#selectiongroup) | Tags de sélection avec débordement |
|
|
77
|
+
| [AvatarBase](#avatarbase) | Avatar photo ou initiales en fallback |
|
|
78
|
+
| [HistoryItem](#historyitem) | Ligne d'historique expandable (badge, avatar, diff) |
|
|
79
|
+
| [DiffValue](#diffvalue) | Rendu d'un diff ancienne → nouvelle valeur |
|
|
80
|
+
| [HistoryBadge](#historybadge) | Badge de type d'action (modification/création/suppression) |
|
|
81
|
+
| [HistoryFilter](#historyfilter) | Bouton de filtre d'historique |
|
|
77
82
|
|
|
78
83
|
---
|
|
79
84
|
|
|
@@ -81,53 +86,61 @@ import type { Option, ButtonTypes, IconName } from '@arche-mc2/vue-ui-lib'
|
|
|
81
86
|
|
|
82
87
|
### ButtonBase
|
|
83
88
|
|
|
84
|
-
|
|
85
|
-
<ButtonBase type="primary" @click="save">Enregistrer</ButtonBase>
|
|
86
|
-
<ButtonBase type="secondary" icon-name="plus" :loading="isSaving">Ajouter</ButtonBase>
|
|
87
|
-
```
|
|
89
|
+
Bouton avec variantes de style, icône optionnelle et état de chargement.
|
|
88
90
|
|
|
91
|
+
**Props :**
|
|
89
92
|
| Prop | Type | Défaut | Description |
|
|
90
93
|
|------|------|--------|-------------|
|
|
91
94
|
| `type` | `ButtonTypes` | `'primary'` | Variante visuelle |
|
|
92
95
|
| `iconName` | `IconName` | — | Icône à gauche du texte |
|
|
93
|
-
| `loading` | `boolean` | — | Affiche un loader |
|
|
96
|
+
| `loading` | `boolean` | — | Affiche un loader, remplace le contenu |
|
|
94
97
|
| `disabled` | `boolean` | — | Désactive le bouton |
|
|
95
|
-
| `active` | `boolean` | — | État actif |
|
|
98
|
+
| `active` | `boolean` | — | État actif (classe CSS) |
|
|
96
99
|
| `id` | `string` | — | Attribut id HTML |
|
|
97
100
|
| `inert` | `boolean` | — | Attribut inert HTML |
|
|
98
101
|
|
|
99
|
-
**
|
|
102
|
+
**Slots :** `default` (texte/contenu du bouton)
|
|
100
103
|
|
|
101
104
|
**`ButtonTypes` :** `'primary'` `'primary-pink'` `'secondary'` `'secondary-pink'` `'action1'`…`'action7'`
|
|
102
105
|
|
|
106
|
+
```html
|
|
107
|
+
<ButtonBase type="primary" @click="save">Enregistrer</ButtonBase>
|
|
108
|
+
<ButtonBase type="secondary" icon-name="plus" :loading="isSaving">Ajouter</ButtonBase>
|
|
109
|
+
<ButtonBase type="action1" :disabled="true">Désactivé</ButtonBase>
|
|
110
|
+
```
|
|
111
|
+
|
|
103
112
|
---
|
|
104
113
|
|
|
105
114
|
### InputBase
|
|
106
115
|
|
|
107
|
-
|
|
108
|
-
<InputBase v-model="name" label="Nom" />
|
|
109
|
-
<InputBase v-model="search" type="search" icon-name="search" clearable />
|
|
110
|
-
<InputBase v-model="pass" type="password" label="Mot de passe" password-control />
|
|
111
|
-
<InputBase v-model="date" type="date" label="Date de naissance" />
|
|
112
|
-
<InputBase v-model="email" type="email" label="Email" :error="true" error-message="Email invalide" required />
|
|
113
|
-
```
|
|
116
|
+
Champ de saisie avancé : texte, nombre, email, password, recherche, tel, url, date (avec masque dd/mm/yyyy et datepicker intégré), suggestions autocomplete.
|
|
114
117
|
|
|
118
|
+
**Props :**
|
|
115
119
|
| Prop | Type | Défaut | Description |
|
|
116
120
|
|------|------|--------|-------------|
|
|
117
121
|
| `modelValue` | `string \| number` | — | Valeur (v-model) |
|
|
118
122
|
| `label` | `string` | — | Label flottant |
|
|
119
123
|
| `type` | `'text'\|'number'\|'time'\|'search'\|'email'\|'password'\|'tel'\|'url'\|'date'` | `'text'` | Type d'input |
|
|
120
|
-
| `iconName` | `IconName` | — | Icône |
|
|
124
|
+
| `iconName` | `IconName` | — | Icône (gauche sans label, droite avec label) |
|
|
121
125
|
| `clearable` | `boolean` | — | Bouton de vidage |
|
|
122
|
-
| `passwordControl` | `boolean` | — | Bouton afficher/masquer |
|
|
123
|
-
| `disabled` | `boolean` | — |
|
|
124
|
-
| `error` | `boolean` | — | État d'erreur |
|
|
125
|
-
| `errorMessage` | `string` | — | Message sous le champ |
|
|
126
|
-
| `required` | `boolean` | — |
|
|
127
|
-
| `placeholder` | `string` | — |
|
|
128
|
-
| `suggestions` | `Option[]` | — |
|
|
126
|
+
| `passwordControl` | `boolean` | — | Bouton afficher/masquer mdp |
|
|
127
|
+
| `disabled` | `boolean` | — | Désactivé |
|
|
128
|
+
| `error` | `boolean` | — | État d'erreur (bordure rouge) |
|
|
129
|
+
| `errorMessage` | `string` | — | Message d'erreur affiché sous le champ |
|
|
130
|
+
| `required` | `boolean` | — | Affiche badge "Requis" |
|
|
131
|
+
| `placeholder` | `string` | — | Placeholder |
|
|
132
|
+
| `suggestions` | `Option[]` | — | Liste de suggestions autocomplete |
|
|
129
133
|
|
|
130
|
-
**É
|
|
134
|
+
**Événements :** `update:modelValue(value: string | number)`
|
|
135
|
+
|
|
136
|
+
```html
|
|
137
|
+
<InputBase v-model="name" label="Nom" />
|
|
138
|
+
<InputBase v-model="search" type="search" icon-name="search" clearable placeholder="Rechercher..." />
|
|
139
|
+
<InputBase v-model="password" type="password" label="Mot de passe" password-control />
|
|
140
|
+
<InputBase v-model="birthdate" type="date" label="Date de naissance" />
|
|
141
|
+
<InputBase v-model="email" type="email" label="Email" :error="hasError" error-message="Email invalide" required />
|
|
142
|
+
<InputBase v-model="city" label="Ville" :suggestions="citySuggestions" />
|
|
143
|
+
```
|
|
131
144
|
|
|
132
145
|
> Le type `date` intègre un masque `dd/mm/yyyy` et un DatePicker popup automatique.
|
|
133
146
|
|
|
@@ -135,305 +148,471 @@ import type { Option, ButtonTypes, IconName } from '@arche-mc2/vue-ui-lib'
|
|
|
135
148
|
|
|
136
149
|
### SelectBase
|
|
137
150
|
|
|
138
|
-
|
|
139
|
-
const selected = ref<Option[]>([])
|
|
140
|
-
const options = [{ value: 'fr', label: 'France' }, { value: 'de', label: 'Allemagne' }]
|
|
141
|
-
```
|
|
142
|
-
```html
|
|
143
|
-
<SelectBase v-model="selected" :options="options" label="Pays" placeholder="Choisir..." />
|
|
144
|
-
<SelectBase v-model="tags" :options="tagOpts" label="Tags" multiple searchable />
|
|
145
|
-
```
|
|
151
|
+
Liste déroulante mono ou multi-sélection avec recherche, s'ouvre via Teleport.
|
|
146
152
|
|
|
153
|
+
**Props :**
|
|
147
154
|
| Prop | Type | Défaut | Description |
|
|
148
155
|
|------|------|--------|-------------|
|
|
149
|
-
| `modelValue` | `Option[]` |
|
|
150
|
-
| `options` | `Option[]` | requis |
|
|
156
|
+
| `modelValue` | `Option[]` | — | Sélection courante (v-model, toujours un tableau) |
|
|
157
|
+
| `options` | `Option[]` | requis | Liste des options |
|
|
151
158
|
| `label` | `string` | — | Label flottant |
|
|
152
|
-
| `placeholder` | `string` | — |
|
|
159
|
+
| `placeholder` | `string` | — | Texte placeholder |
|
|
153
160
|
| `multiple` | `boolean` | — | Multi-sélection |
|
|
154
|
-
| `searchable` | `boolean` | — |
|
|
155
|
-
| `clearable` | `boolean` | `true` |
|
|
156
|
-
| `disabled` | `boolean` | — |
|
|
161
|
+
| `searchable` | `boolean` | — | Activer la recherche |
|
|
162
|
+
| `clearable` | `boolean` | `true` | Bouton de suppression sur les tags |
|
|
163
|
+
| `disabled` | `boolean` | — | Désactivé |
|
|
164
|
+
|
|
165
|
+
**Événements :** `update:modelValue(value: Option[])`
|
|
166
|
+
|
|
167
|
+
```ts
|
|
168
|
+
const civility = ref<Option[]>([])
|
|
169
|
+
const options = [
|
|
170
|
+
{ value: 'mr', label: 'Monsieur' },
|
|
171
|
+
{ value: 'mme', label: 'Madame' },
|
|
172
|
+
]
|
|
173
|
+
```
|
|
174
|
+
```html
|
|
175
|
+
<SelectBase v-model="civility" :options="options" label="Civilité" placeholder="Choisir..." />
|
|
176
|
+
<SelectBase v-model="tags" :options="tagOptions" label="Tags" multiple searchable />
|
|
177
|
+
```
|
|
157
178
|
|
|
158
179
|
---
|
|
159
180
|
|
|
160
181
|
### CheckboxBase
|
|
161
182
|
|
|
183
|
+
Case à cocher avec label optionnel, état indéterminé et thème personnalisable.
|
|
184
|
+
|
|
185
|
+
**Props :**
|
|
186
|
+
| Prop | Type | Défaut | Description |
|
|
187
|
+
|------|------|--------|-------------|
|
|
188
|
+
| `modelValue` | `boolean` | `false` | Coché ou non (v-model) |
|
|
189
|
+
| `label` | `string` | — | Texte affiché à droite |
|
|
190
|
+
| `icon` | `IconName` | — | Icône supplémentaire |
|
|
191
|
+
| `iconStyle` | `{height?,width?}` | — | Taille de l'icône |
|
|
192
|
+
| `theme` | `{--amc2-checkbox-color?, --amc2-checkbox-disabled-color?, --amc2-checkmark-color?}` | — | Couleurs custom |
|
|
193
|
+
| `indeterminate` | `boolean` | — | État partiel (icône minus) |
|
|
194
|
+
| `disabled` | `boolean` | — | Désactivé |
|
|
195
|
+
| `className` | `string` | — | Classe CSS additionnelle |
|
|
196
|
+
|
|
197
|
+
**Événements natifs :** `change`
|
|
198
|
+
|
|
162
199
|
```html
|
|
163
|
-
<CheckboxBase v-model="accepted" label="J'accepte les
|
|
200
|
+
<CheckboxBase v-model="accepted" label="J'accepte les conditions" />
|
|
164
201
|
<CheckboxBase v-model="allSelected" :indeterminate="isPartial" />
|
|
165
202
|
```
|
|
166
203
|
|
|
167
|
-
| Prop | Type | Défaut |
|
|
168
|
-
|------|------|--------|
|
|
169
|
-
| `modelValue` | `boolean` | `false` |
|
|
170
|
-
| `label` | `string` | — |
|
|
171
|
-
| `indeterminate` | `boolean` | — |
|
|
172
|
-
| `disabled` | `boolean` | — |
|
|
173
|
-
| `icon` | `IconName` | — |
|
|
174
|
-
| `theme` | `{--amc2-checkbox-color?, --amc2-checkmark-color?, ...}` | — |
|
|
175
|
-
|
|
176
204
|
---
|
|
177
205
|
|
|
178
206
|
### RadioBase
|
|
179
207
|
|
|
208
|
+
Bouton radio. Toujours utilisé avec `v-model` partagé + prop `value` distincte par option.
|
|
209
|
+
|
|
210
|
+
**Props :**
|
|
211
|
+
| Prop | Type | Défaut | Description |
|
|
212
|
+
|------|------|--------|-------------|
|
|
213
|
+
| `modelValue` | `any` | — | Valeur courante du groupe (v-model) |
|
|
214
|
+
| `value` | `any` | requis | Valeur de cette option |
|
|
215
|
+
| `label` | `string` | — | Texte affiché |
|
|
216
|
+
| `icon` | `IconName` | — | Icône |
|
|
217
|
+
| `theme` | `{--amc2-radio-color?, --amc2-radio-disabled-color?, --amc2-radio-point-color?, --amc2-radio-point-disabled-color?}` | — | Couleurs custom |
|
|
218
|
+
| `disabled` | `boolean` | — | Désactivé |
|
|
219
|
+
| `className` | `string` | — | Classe CSS additionnelle |
|
|
220
|
+
|
|
221
|
+
**Événements :** `update:modelValue(value: any)`
|
|
222
|
+
|
|
180
223
|
```html
|
|
181
224
|
<RadioBase v-model="gender" value="male" label="Homme" />
|
|
182
225
|
<RadioBase v-model="gender" value="female" label="Femme" />
|
|
183
226
|
```
|
|
184
227
|
|
|
185
|
-
| Prop | Type | Description |
|
|
186
|
-
|------|------|-------------|
|
|
187
|
-
| `modelValue` | `any` | Valeur partagée du groupe (v-model) |
|
|
188
|
-
| `value` | `any` | **Requis** — valeur de cette option |
|
|
189
|
-
| `label` | `string` | — |
|
|
190
|
-
| `disabled` | `boolean` | — |
|
|
191
|
-
| `theme` | `{--amc2-radio-color?, ...}` | — |
|
|
192
|
-
|
|
193
228
|
---
|
|
194
229
|
|
|
195
230
|
### ToggleBase
|
|
196
231
|
|
|
232
|
+
Interrupteur on/off simple avec label et icône optionnels.
|
|
233
|
+
|
|
234
|
+
**Props :**
|
|
235
|
+
| Prop | Type | Défaut | Description |
|
|
236
|
+
|------|------|--------|-------------|
|
|
237
|
+
| `modelValue` | `boolean` | — | État (v-model) |
|
|
238
|
+
| `label` | `string` | — | Texte affiché |
|
|
239
|
+
| `icon` | `string` | — | Nom d'icône |
|
|
240
|
+
| `theme` | `ToggleTheme` | — | CSS custom properties de couleurs |
|
|
241
|
+
| `disabled` | `boolean` | — | Désactivé |
|
|
242
|
+
|
|
243
|
+
**Événements :** `update:modelValue(value: boolean)`
|
|
244
|
+
|
|
197
245
|
```html
|
|
198
246
|
<ToggleBase v-model="notifications" label="Notifications" />
|
|
247
|
+
<ToggleBase v-model="darkMode" :disabled="isPremium === false" />
|
|
199
248
|
```
|
|
200
249
|
|
|
201
|
-
| Prop | Type | Description |
|
|
202
|
-
|------|------|-------------|
|
|
203
|
-
| `modelValue` | `boolean` | État (v-model) |
|
|
204
|
-
| `label` | `string` | — |
|
|
205
|
-
| `disabled` | `boolean` | — |
|
|
206
|
-
| `theme` | `ToggleTheme` | CSS custom properties de couleurs |
|
|
207
|
-
|
|
208
250
|
---
|
|
209
251
|
|
|
210
252
|
### ToggleAdvanced
|
|
211
253
|
|
|
254
|
+
Interrupteur à deux boutons (gauche/droite) avec labels et icônes.
|
|
255
|
+
|
|
256
|
+
**Props :**
|
|
257
|
+
| Prop | Type | Défaut | Description |
|
|
258
|
+
|------|------|--------|-------------|
|
|
259
|
+
| `modelValue` | `boolean` | — | `true` = gauche actif, `false` = droite actif (v-model) |
|
|
260
|
+
| `labelLeft` | `string` | — | Texte bouton gauche |
|
|
261
|
+
| `iconLeft` | `IconName` | — | Icône bouton gauche |
|
|
262
|
+
| `labelRight` | `string` | — | Texte bouton droit |
|
|
263
|
+
| `iconRight` | `IconName` | — | Icône bouton droit |
|
|
264
|
+
| `theme` | `ToggleTheme` | — | Couleurs custom |
|
|
265
|
+
| `disabled` | `boolean` | — | Désactivé |
|
|
266
|
+
|
|
267
|
+
**Événements :** `update:modelValue(value: boolean)`
|
|
268
|
+
|
|
212
269
|
```html
|
|
213
|
-
<ToggleAdvanced v-model="isListView" label-left="Liste"
|
|
214
|
-
|
|
270
|
+
<ToggleAdvanced v-model="isListView" label-left="Liste" label-right="Grille"
|
|
271
|
+
icon-left="list" icon-right="grid" />
|
|
215
272
|
```
|
|
216
273
|
|
|
217
|
-
| Prop | Type | Description |
|
|
218
|
-
|------|------|-------------|
|
|
219
|
-
| `modelValue` | `boolean` | `true` = gauche actif (v-model) |
|
|
220
|
-
| `labelLeft` / `iconLeft` | `string` / `IconName` | Bouton gauche |
|
|
221
|
-
| `labelRight` / `iconRight` | `string` / `IconName` | Bouton droit |
|
|
222
|
-
| `disabled` | `boolean` | — |
|
|
223
|
-
| `theme` | `ToggleTheme` | — |
|
|
224
|
-
|
|
225
274
|
---
|
|
226
275
|
|
|
227
276
|
### SegmentedButton
|
|
228
277
|
|
|
278
|
+
Bouton segmenté 3 positions (gauche/centre/droite) avec tooltips. Conçu pour le tri.
|
|
279
|
+
|
|
280
|
+
**Props :**
|
|
281
|
+
| Prop | Type | Défaut | Description |
|
|
282
|
+
|------|------|--------|-------------|
|
|
283
|
+
| `modelValue` | `'left'\|'center'\|'right'` | `'center'` | Position active (v-model) |
|
|
284
|
+
| `labelLeft` | `string` | `'Croissant'` | — |
|
|
285
|
+
| `iconLeft` | `IconName` | `'arrow-down-a-z'` | — |
|
|
286
|
+
| `toolTipLabelLeft` | `string` | — | Tooltip gauche |
|
|
287
|
+
| `labelCenter` | `string` | `'Aucun tri'` | — |
|
|
288
|
+
| `iconCenter` | `IconName` | — | — |
|
|
289
|
+
| `toolTipLabelCenter` | `string` | — | Tooltip centre |
|
|
290
|
+
| `labelRight` | `string` | `'Décroissant'` | — |
|
|
291
|
+
| `iconRight` | `IconName` | `'arrow-down-z-a'` | — |
|
|
292
|
+
| `toolTipLabelRight` | `string` | — | Tooltip droit |
|
|
293
|
+
| `disabled` | `boolean` | — | — |
|
|
294
|
+
| `theme` | `SegmentedButtonTheme` | — | CSS vars de couleur |
|
|
295
|
+
|
|
296
|
+
**Événements :** `update:modelValue(value: 'left' | 'center' | 'right')`
|
|
297
|
+
|
|
229
298
|
```html
|
|
230
299
|
<SegmentedButton v-model="sortOrder" label-left="A→Z" label-right="Z→A" />
|
|
231
300
|
```
|
|
232
301
|
|
|
233
|
-
`modelValue` : `'left' | 'center' | 'right'` (défaut : `'center'`)
|
|
234
|
-
|
|
235
302
|
---
|
|
236
303
|
|
|
237
304
|
### ModalBase
|
|
238
305
|
|
|
306
|
+
Modale avec titre, fond sombre, croix de fermeture. Supporte les modales empilées.
|
|
307
|
+
|
|
308
|
+
**Props :**
|
|
309
|
+
| Prop | Type | Défaut | Description |
|
|
310
|
+
|------|------|--------|-------------|
|
|
311
|
+
| `visible` | `boolean` | requis | Affichage |
|
|
312
|
+
| `title` | `string` | requis | Titre de la modale |
|
|
313
|
+
| `additionnal` | `boolean` | — | Modale secondaire (style décalé) |
|
|
314
|
+
|
|
315
|
+
**Événements :** `close`
|
|
316
|
+
|
|
317
|
+
**Slots :** `default` (contenu de la modale)
|
|
318
|
+
|
|
239
319
|
```html
|
|
240
|
-
<ModalBase :visible="showModal" title="
|
|
241
|
-
<p
|
|
242
|
-
<ButtonBase @click="
|
|
320
|
+
<ModalBase :visible="showModal" title="Confirmer la suppression" @close="showModal = false">
|
|
321
|
+
<p>Cette action est irréversible.</p>
|
|
322
|
+
<ButtonBase type="secondary" @click="showModal = false">Annuler</ButtonBase>
|
|
323
|
+
<ButtonBase type="primary" @click="confirmDelete">Supprimer</ButtonBase>
|
|
243
324
|
</ModalBase>
|
|
244
325
|
```
|
|
245
326
|
|
|
246
|
-
| Prop | Type | Description |
|
|
247
|
-
|------|------|-------------|
|
|
248
|
-
| `visible` | `boolean` | **Requis** |
|
|
249
|
-
| `title` | `string` | **Requis** |
|
|
250
|
-
| `additionnal` | `boolean` | Modale secondaire (empilée) |
|
|
251
|
-
|
|
252
|
-
**Événement :** `close` | **Slot :** `default`
|
|
253
|
-
|
|
254
327
|
---
|
|
255
328
|
|
|
256
329
|
### ToastBase + useToast
|
|
257
330
|
|
|
331
|
+
Système de notifications. Nécessite `provideToast(app)` dans main.ts. Placer `<ToastBase />` une seule fois dans App.vue.
|
|
332
|
+
|
|
333
|
+
**Setup main.ts :** `provideToast(app)` (voir section [Setup](#setup))
|
|
334
|
+
|
|
335
|
+
**Utilisation :**
|
|
258
336
|
```ts
|
|
259
337
|
import { useToast } from '@arche-mc2/vue-ui-lib'
|
|
260
338
|
const toast = useToast()
|
|
261
|
-
|
|
262
|
-
toast.show('
|
|
263
|
-
toast.show('
|
|
264
|
-
toast.show('
|
|
265
|
-
toast.show('Données incomplètes', 'warning')
|
|
339
|
+
toast.show('Enregistré avec succès', 'success') // durée défaut 3000ms
|
|
340
|
+
toast.show('Email invalide', 'error', 5000)
|
|
341
|
+
toast.show('Mise à jour disponible', 'info')
|
|
342
|
+
toast.show('Attention, données incomplètes', 'warning')
|
|
266
343
|
```
|
|
267
344
|
|
|
268
|
-
Intents
|
|
345
|
+
**Intents disponibles :** `'success'` | `'warning'` | `'error'` | `'info'`
|
|
269
346
|
|
|
270
347
|
---
|
|
271
348
|
|
|
272
349
|
### TooltipBase
|
|
273
350
|
|
|
351
|
+
Tooltip au survol, positionnée automatiquement, avec flèche.
|
|
352
|
+
|
|
353
|
+
**Props :**
|
|
354
|
+
| Prop | Type | Défaut | Description |
|
|
355
|
+
|------|------|--------|-------------|
|
|
356
|
+
| `position` | `Position` | `'bottom'` | Côté d'apparition |
|
|
357
|
+
| `className` | `string` | — | Classe CSS sur le tooltip |
|
|
358
|
+
| `style` | `CSSProperties` | — | Styles inline |
|
|
359
|
+
| `removeDelay` | `number` | — | Délai de disparition en ms (utile si contenu cliquable) |
|
|
360
|
+
|
|
361
|
+
**Slots :** `default` (élément déclencheur), `content` (contenu du tooltip)
|
|
362
|
+
|
|
274
363
|
```html
|
|
275
364
|
<TooltipBase position="top">
|
|
276
365
|
<ButtonBase>Supprimer</ButtonBase>
|
|
277
|
-
<template #content>
|
|
366
|
+
<template #content>Cette action est irréversible</template>
|
|
278
367
|
</TooltipBase>
|
|
279
368
|
```
|
|
280
369
|
|
|
370
|
+
---
|
|
371
|
+
|
|
372
|
+
### FlyoutMenu
|
|
373
|
+
|
|
374
|
+
Menu contextuel positionné, déclenché au clic. Peut afficher une liste d'items ou du contenu libre.
|
|
375
|
+
|
|
376
|
+
**Props :**
|
|
281
377
|
| Prop | Type | Défaut | Description |
|
|
282
378
|
|------|------|--------|-------------|
|
|
283
|
-
| `
|
|
284
|
-
| `
|
|
285
|
-
| `
|
|
286
|
-
|
|
287
|
-
**Slots :** `default` (déclencheur) · `content` (contenu)
|
|
379
|
+
| `items` | `FlyoutMenuItem[]` | — | Liste de `{label, onClick?}` (mode liste simple) |
|
|
380
|
+
| `position` | `Position` | `'bottom'` | Position du menu |
|
|
381
|
+
| `displayEl` | `HTMLElement \| null` | — | Conteneur scrollable (pour repositionnement) |
|
|
382
|
+
| `autoClose` | `boolean` | `true` | Fermeture automatique après clic item |
|
|
288
383
|
|
|
289
|
-
|
|
384
|
+
**Événements :** `close`
|
|
290
385
|
|
|
291
|
-
|
|
386
|
+
**Slots :** `default` (déclencheur), `content` (contenu libre, si pas de prop `items`)
|
|
292
387
|
|
|
293
388
|
```html
|
|
294
|
-
<!--
|
|
295
|
-
<FlyoutMenu :items="[{ label: 'Éditer', onClick: edit }]">
|
|
389
|
+
<!-- Mode liste -->
|
|
390
|
+
<FlyoutMenu :items="[{ label: 'Éditer', onClick: edit }, { label: 'Supprimer', onClick: del }]">
|
|
296
391
|
<ButtonBase>Actions</ButtonBase>
|
|
297
392
|
</FlyoutMenu>
|
|
298
393
|
|
|
299
|
-
<!--
|
|
394
|
+
<!-- Mode contenu libre -->
|
|
300
395
|
<FlyoutMenu position="bottom-left">
|
|
301
396
|
<SvgIcon icon-name="settings" />
|
|
302
|
-
<template #content
|
|
397
|
+
<template #content>
|
|
398
|
+
<div>Contenu personnalisé</div>
|
|
399
|
+
</template>
|
|
303
400
|
</FlyoutMenu>
|
|
304
401
|
```
|
|
305
402
|
|
|
306
|
-
| Prop | Type | Défaut |
|
|
307
|
-
|------|------|--------|
|
|
308
|
-
| `items` | `FlyoutMenuItem[]` | — |
|
|
309
|
-
| `position` | `Position` | `'bottom'` |
|
|
310
|
-
| `autoClose` | `boolean` | `true` |
|
|
311
|
-
|
|
312
|
-
**Événement :** `close` | **Slots :** `default` · `content`
|
|
313
|
-
|
|
314
403
|
---
|
|
315
404
|
|
|
316
405
|
### SideMenu
|
|
317
406
|
|
|
407
|
+
Menu latéral de navigation avec items hiérarchiques (2 niveaux), icônes, et sélection active.
|
|
408
|
+
|
|
409
|
+
**Props :**
|
|
410
|
+
| Prop | Type | Défaut | Description |
|
|
411
|
+
|------|------|--------|-------------|
|
|
412
|
+
| `items` | `MenuItem[]` | requis | Arbre de navigation |
|
|
413
|
+
| `idSelected` | `number` | — | ID de l'item actif au montage |
|
|
414
|
+
|
|
415
|
+
La navigation appelle `item.action?.()` à la sélection. Les sous-menus s'ouvrent en accordéon.
|
|
416
|
+
|
|
318
417
|
```ts
|
|
319
|
-
const
|
|
320
|
-
{ id: 1, label: '
|
|
321
|
-
{
|
|
322
|
-
|
|
323
|
-
|
|
418
|
+
const menuItems: MenuItem[] = [
|
|
419
|
+
{ id: 1, label: 'Tableau de bord', icon: 'home', action: () => router.push('/') },
|
|
420
|
+
{
|
|
421
|
+
id: 2, label: 'Gestion', icon: 'users',
|
|
422
|
+
children: [
|
|
423
|
+
{ id: 3, label: 'Clients', action: () => router.push('/clients') },
|
|
424
|
+
{ id: 4, label: 'Contrats', action: () => router.push('/contracts') },
|
|
425
|
+
]
|
|
426
|
+
},
|
|
324
427
|
]
|
|
325
428
|
```
|
|
326
429
|
```html
|
|
327
|
-
<SideMenu :items="
|
|
430
|
+
<SideMenu :items="menuItems" :id-selected="currentId" />
|
|
328
431
|
```
|
|
329
432
|
|
|
330
433
|
---
|
|
331
434
|
|
|
332
435
|
### TabBar
|
|
333
436
|
|
|
437
|
+
Barre d'onglets simple avec liste de labels.
|
|
438
|
+
|
|
439
|
+
**Props :**
|
|
440
|
+
| Prop | Type | Défaut | Description |
|
|
441
|
+
|------|------|--------|-------------|
|
|
442
|
+
| `listItems` | `string[]` | requis | Labels des onglets |
|
|
443
|
+
| `listType` | `string` | requis | Onglet actif courant |
|
|
444
|
+
|
|
445
|
+
**Événements :** `change(selectedItem: string)`
|
|
446
|
+
|
|
334
447
|
```ts
|
|
335
|
-
const tabs = ['
|
|
336
|
-
const
|
|
448
|
+
const tabs = ['Informations', 'Contrats', 'Documents']
|
|
449
|
+
const activeTab = ref('Informations')
|
|
337
450
|
```
|
|
338
451
|
```html
|
|
339
|
-
<TabBar :list-items="tabs" :list-type="
|
|
452
|
+
<TabBar :list-items="tabs" :list-type="activeTab" @change="activeTab = $event" />
|
|
340
453
|
```
|
|
341
454
|
|
|
342
455
|
---
|
|
343
456
|
|
|
344
457
|
### DataGrid
|
|
345
458
|
|
|
346
|
-
Grille
|
|
459
|
+
Grille de données avec colonnes configurables, tri, filtre, sélection par checkbox, scroll infini, menu d'actions par ligne, et colonne de paramétrage de visibilité des colonnes.
|
|
460
|
+
|
|
461
|
+
**Props :**
|
|
462
|
+
| Prop | Type | Défaut | Description |
|
|
463
|
+
|------|------|--------|-------------|
|
|
464
|
+
| `headers` | `DatagridHeader[]` | requis | Définition des colonnes |
|
|
465
|
+
| `items` | `any[]` | requis | Données. Chaque item doit avoir `id: number`, et peut avoir `isSelected: boolean`, `actions: FlyoutMenuItem[]`, `onClick_<key>: () => void` |
|
|
466
|
+
| `hasMore` | `boolean` | requis | Indique s'il y a plus de données à charger |
|
|
467
|
+
| `selection` | `boolean` | `false` | Activer colonne de checkboxes |
|
|
468
|
+
| `allCheckState` | `{isChecked: boolean, partially: boolean}` | `{false,false}` | État checkbox "tout cocher" |
|
|
469
|
+
| `displaySettingsHeader` | `boolean` | `true` | Afficher la colonne de paramétrage |
|
|
470
|
+
| `displaySettings` | `boolean` | `true` | Afficher le menu d'actions par ligne |
|
|
471
|
+
| `modalFilter` | `(header: DatagridHeader) => void` | — | Callback clic filtre |
|
|
472
|
+
| `dataSort` | `(header: DatagridHeader) => void` | — | Callback clic tri |
|
|
473
|
+
|
|
474
|
+
**Événements :**
|
|
475
|
+
- `loadMore` — déclenché au scroll infini (et au montage)
|
|
476
|
+
- `updateCheckItem(id: number, isChecked: boolean)` — checkbox ligne
|
|
477
|
+
- `updateCheckAll(isChecked: boolean)` — checkbox header
|
|
478
|
+
|
|
479
|
+
**Expose :** `resetScroll()`, `checkLoadMore()`
|
|
480
|
+
|
|
481
|
+
**Contenu d'un item :**
|
|
482
|
+
- `item[header.key]` → valeur texte, nombre, date, ou tableau (formaté automatiquement)
|
|
483
|
+
- `item[header.key] = { render: Component }` → rendu d'un composant Vue dans la cellule
|
|
484
|
+
- `item['onClick_<key>']` → rend la cellule cliquable (lien `<a>`)
|
|
485
|
+
- `item.actions` → tableau `FlyoutMenuItem[]` pour le menu d'actions rapides
|
|
486
|
+
- `item.isSelected` → état de sélection checkbox
|
|
347
487
|
|
|
348
488
|
```ts
|
|
489
|
+
import { DataGrid } from '@arche-mc2/vue-ui-lib'
|
|
490
|
+
import type { DatagridHeader, FlyoutMenuItem } from '@arche-mc2/vue-ui-lib'
|
|
491
|
+
|
|
349
492
|
const headers = ref<DatagridHeader[]>([
|
|
350
493
|
{
|
|
351
494
|
key: 'name', label: 'Nom', dataType: 'string', sortable: true,
|
|
352
495
|
visibility: { isShown: true, isDisabled: false, update: (v) => { headers.value[0].visibility.isShown = v } }
|
|
353
496
|
},
|
|
497
|
+
{
|
|
498
|
+
key: 'date', label: 'Date', dataType: 'date', sortable: true,
|
|
499
|
+
visibility: { isShown: true, isDisabled: false, update: (v) => { headers.value[1].visibility.isShown = v } }
|
|
500
|
+
},
|
|
354
501
|
])
|
|
355
502
|
|
|
356
503
|
const items = ref([
|
|
357
|
-
{ id: 1, name: 'Alice', isSelected: false,
|
|
358
|
-
actions: [{ label: '
|
|
504
|
+
{ id: 1, name: 'Alice', date: '01/01/2024', isSelected: false,
|
|
505
|
+
actions: [{ label: 'Voir', onClick: () => openDetail(1) }] },
|
|
359
506
|
])
|
|
507
|
+
|
|
508
|
+
const gridRef = ref()
|
|
509
|
+
const page = ref(0)
|
|
510
|
+
|
|
511
|
+
const loadMore = async () => {
|
|
512
|
+
const data = await fetchPage(page.value++)
|
|
513
|
+
items.value = [...items.value, ...data]
|
|
514
|
+
hasMore.value = data.length === PAGE_SIZE
|
|
515
|
+
}
|
|
360
516
|
```
|
|
361
517
|
```html
|
|
362
518
|
<DataGrid
|
|
363
|
-
|
|
519
|
+
ref="gridRef"
|
|
520
|
+
:headers="headers"
|
|
521
|
+
:items="items"
|
|
522
|
+
:has-more="hasMore"
|
|
364
523
|
selection
|
|
365
524
|
@load-more="loadMore"
|
|
366
|
-
@update-check-item="(id,
|
|
525
|
+
@update-check-item="(id, checked) => toggleItem(id, checked)"
|
|
526
|
+
@update-check-all="(checked) => toggleAll(checked)"
|
|
367
527
|
/>
|
|
368
528
|
```
|
|
369
529
|
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
| Prop | Type | Défaut |
|
|
373
|
-
|------|------|--------|
|
|
374
|
-
| `headers` | `DatagridHeader[]` | requis |
|
|
375
|
-
| `items` | `any[]` | requis |
|
|
376
|
-
| `hasMore` | `boolean` | requis |
|
|
377
|
-
| `selection` | `boolean` | `false` |
|
|
378
|
-
| `displaySettingsHeader` | `boolean` | `true` |
|
|
379
|
-
| `displaySettings` | `boolean` | `true` |
|
|
380
|
-
| `modalFilter` | `(header) => void` | — |
|
|
381
|
-
| `dataSort` | `(header) => void` | — |
|
|
530
|
+
---
|
|
382
531
|
|
|
383
|
-
|
|
532
|
+
### WidgetBase
|
|
384
533
|
|
|
385
|
-
|
|
534
|
+
Conteneur carte avec slots header/body/footer, état de chargement, et état vide automatique.
|
|
386
535
|
|
|
387
|
-
**
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
---
|
|
536
|
+
**Props :**
|
|
537
|
+
| Prop | Type | Défaut | Description |
|
|
538
|
+
|------|------|--------|-------------|
|
|
539
|
+
| `width` | `string` | `'50%'` | Largeur CSS |
|
|
540
|
+
| `height` | `string` | `'180px'` | Hauteur CSS |
|
|
541
|
+
| `color` | `string` | — | Couleur de fond |
|
|
542
|
+
| `isLoading` | `boolean` | — | Affiche un loader à la place du body |
|
|
395
543
|
|
|
396
|
-
|
|
544
|
+
**Slots :** `header`, `body`, `footer`
|
|
545
|
+
Si `body` est vide, affiche automatiquement une icône "Aucune donnée".
|
|
397
546
|
|
|
398
547
|
```html
|
|
399
|
-
<WidgetBase width="100%" height="
|
|
400
|
-
<template #header
|
|
401
|
-
|
|
402
|
-
|
|
548
|
+
<WidgetBase width="100%" height="300px" :is-loading="loading">
|
|
549
|
+
<template #header>
|
|
550
|
+
<h3>Statistiques du mois</h3>
|
|
551
|
+
</template>
|
|
552
|
+
<template #body>
|
|
553
|
+
<p>42 contrats signés</p>
|
|
554
|
+
</template>
|
|
555
|
+
<template #footer>
|
|
556
|
+
<ButtonBase type="secondary">Voir le détail</ButtonBase>
|
|
557
|
+
</template>
|
|
403
558
|
</WidgetBase>
|
|
404
559
|
```
|
|
405
560
|
|
|
406
|
-
| Prop | Type | Défaut |
|
|
407
|
-
|------|------|--------|
|
|
408
|
-
| `width` | `string` | `'50%'` |
|
|
409
|
-
| `height` | `string` | `'180px'` |
|
|
410
|
-
| `color` | `string` | — |
|
|
411
|
-
| `isLoading` | `boolean` | — |
|
|
412
|
-
|
|
413
561
|
---
|
|
414
562
|
|
|
415
563
|
### CalendarBase
|
|
416
564
|
|
|
565
|
+
Calendrier plein-écran (FullCalendar) avec vues jour/semaine/mois, événements et sélection de plage.
|
|
566
|
+
|
|
567
|
+
**Props :**
|
|
568
|
+
| Prop | Type | Défaut | Description |
|
|
569
|
+
|------|------|--------|-------------|
|
|
570
|
+
| `events` | `CalendarEvent[]` | — | Événements à afficher |
|
|
571
|
+
| `initialView` | `'day'\|'week'\|'month'` | `'month'` | Vue initiale |
|
|
572
|
+
| `btnToday` | `boolean` | — | Afficher bouton "Aujourd'hui" |
|
|
573
|
+
| `btnViewOption` | `boolean` | — | Afficher les boutons de changement de vue |
|
|
574
|
+
|
|
575
|
+
**Événements :**
|
|
576
|
+
- `onSelectDate(range: CalendarRange)` — sélection d'une plage (clic + drag)
|
|
577
|
+
- `onClickEvent(event: CalendarEvent)` — clic sur un événement
|
|
578
|
+
- `onChangeView(range: CalendarRange)` — changement de période/vue
|
|
579
|
+
|
|
580
|
+
```ts
|
|
581
|
+
const events: CalendarEvent[] = [
|
|
582
|
+
{ id: '1', title: 'Réunion', start: '2024-04-15T09:00:00', end: '2024-04-15T10:00:00' }
|
|
583
|
+
]
|
|
584
|
+
```
|
|
417
585
|
```html
|
|
418
586
|
<CalendarBase
|
|
419
|
-
:events="events"
|
|
587
|
+
:events="events"
|
|
588
|
+
initial-view="week"
|
|
589
|
+
btn-today
|
|
590
|
+
btn-view-option
|
|
420
591
|
@on-select-date="range => createEvent(range)"
|
|
421
592
|
@on-click-event="event => openEvent(event)"
|
|
422
593
|
/>
|
|
423
594
|
```
|
|
424
595
|
|
|
425
|
-
```ts
|
|
426
|
-
// Type event
|
|
427
|
-
interface CalendarEvent { id: string; title: string; start: string; end: string }
|
|
428
|
-
```
|
|
429
|
-
|
|
430
596
|
---
|
|
431
597
|
|
|
432
598
|
### DatePicker
|
|
433
599
|
|
|
434
|
-
|
|
600
|
+
Sélecteur de date avec navigation mois/année. Généralement intégré via `InputBase` (type="date"). Peut aussi être utilisé seul.
|
|
601
|
+
|
|
602
|
+
**Props :**
|
|
603
|
+
| Prop | Type | Défaut | Description |
|
|
604
|
+
|------|------|--------|-------------|
|
|
605
|
+
| `modelValue` | `Date` | — | Date sélectionnée (v-model) |
|
|
606
|
+
| `min` | `Date` | — | Date minimale |
|
|
607
|
+
| `max` | `Date` | — | Date maximale |
|
|
608
|
+
|
|
609
|
+
**Événements :** `update:modelValue(date: Date)`
|
|
435
610
|
|
|
436
611
|
```html
|
|
612
|
+
<!-- Usage recommandé via InputBase -->
|
|
613
|
+
<InputBase v-model="birthdate" type="date" label="Date de naissance" />
|
|
614
|
+
|
|
615
|
+
<!-- Usage direct -->
|
|
437
616
|
<DatePicker v-model="selectedDate" :min="minDate" :max="maxDate" />
|
|
438
617
|
```
|
|
439
618
|
|
|
@@ -441,24 +620,44 @@ Principalement utilisé via `InputBase` avec `type="date"`. Usage direct :
|
|
|
441
620
|
|
|
442
621
|
### SvgIcon
|
|
443
622
|
|
|
444
|
-
|
|
623
|
+
Icône SVG depuis le sprite interne. 532 icônes disponibles.
|
|
624
|
+
|
|
625
|
+
**Props :**
|
|
626
|
+
| Prop | Type | Défaut | Description |
|
|
627
|
+
|------|------|--------|-------------|
|
|
628
|
+
| `iconName` | `IconName` | requis | Nom de l'icône |
|
|
629
|
+
| `color` | `string` | `'#2C2274'` | Couleur primaire (fill) |
|
|
630
|
+
| `colorSecondary` | `string` | `'transparent'` | Couleur secondaire |
|
|
631
|
+
| `colorHover` | `string` | — | Couleur au survol |
|
|
632
|
+
| `colorSecondaryHover` | `string` | — | Couleur secondaire au survol |
|
|
633
|
+
| `height` | `string` | `'20'` | Hauteur en px |
|
|
634
|
+
| `width` | `string` | `'20'` | Largeur en px |
|
|
635
|
+
| `accessibilityTitle` | `string` | — | `<title>` SVG pour accessibilité |
|
|
636
|
+
| `classIcon` | `string` | — | Classe CSS |
|
|
637
|
+
| `id` | `string` | — | Attribut id |
|
|
445
638
|
|
|
446
639
|
```html
|
|
447
640
|
<SvgIcon icon-name="user" color="#5B4DBE" width="24" height="24" />
|
|
641
|
+
<SvgIcon icon-name="check" color="#55BDBE" />
|
|
448
642
|
```
|
|
449
643
|
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
| `height` / `width` | `string` | `'20'` |
|
|
456
|
-
| `accessibilityTitle` | `string` | — |
|
|
644
|
+
Pour obtenir la liste complète des icônes :
|
|
645
|
+
```ts
|
|
646
|
+
import { iconNames } from '@arche-mc2/vue-ui-lib'
|
|
647
|
+
// iconNames est un tableau de 532 strings
|
|
648
|
+
```
|
|
457
649
|
|
|
458
650
|
---
|
|
459
651
|
|
|
460
652
|
### LoaderBase
|
|
461
653
|
|
|
654
|
+
Gif de chargement animé.
|
|
655
|
+
|
|
656
|
+
**Props :**
|
|
657
|
+
| Prop | Type | Défaut |
|
|
658
|
+
|------|------|--------|
|
|
659
|
+
| `size` | `number` | `50` |
|
|
660
|
+
|
|
462
661
|
```html
|
|
463
662
|
<LoaderBase :size="30" />
|
|
464
663
|
```
|
|
@@ -467,11 +666,162 @@ Principalement utilisé via `InputBase` avec `type="date"`. Usage direct :
|
|
|
467
666
|
|
|
468
667
|
### TagBase
|
|
469
668
|
|
|
669
|
+
Badge coloré avec label.
|
|
670
|
+
|
|
671
|
+
**Props :**
|
|
672
|
+
| Prop | Type | Défaut | Description |
|
|
673
|
+
|------|------|--------|-------------|
|
|
674
|
+
| `label` | `string` | — | Texte du badge |
|
|
675
|
+
| `backgroundColor` | `'blue'\|'green'\|'primary'\|'secondary'` | requis | Couleur de fond |
|
|
676
|
+
|
|
470
677
|
```html
|
|
471
678
|
<TagBase label="Actif" background-color="green" />
|
|
679
|
+
<TagBase background-color="secondary" />
|
|
472
680
|
```
|
|
473
681
|
|
|
474
|
-
|
|
682
|
+
---
|
|
683
|
+
|
|
684
|
+
### ListWithSearch
|
|
685
|
+
|
|
686
|
+
Liste d'options avec recherche et sélection mono/multi. Composant interne de SelectBase, mais peut être utilisé seul.
|
|
687
|
+
|
|
688
|
+
**Props :**
|
|
689
|
+
| Prop | Type | Défaut | Description |
|
|
690
|
+
|------|------|--------|-------------|
|
|
691
|
+
| `modelValue` | `Option[]` | requis | Sélection courante (v-model) |
|
|
692
|
+
| `options` | `Option[]` | requis | Options disponibles |
|
|
693
|
+
| `multiple` | `boolean` | — | Multi-sélection |
|
|
694
|
+
| `searchable` | `boolean` | — | Activer la recherche |
|
|
695
|
+
| `stickyHeader` | `boolean` | `true` | Header (search + tout sélectionner) sticky |
|
|
696
|
+
| `emptyMessage` | `string` | `'Aucune valeur'` | Message si liste vide |
|
|
697
|
+
| `disabled` | `boolean` | — | — |
|
|
698
|
+
|
|
699
|
+
**Événements :** `update:modelValue(value: Option[])`
|
|
700
|
+
|
|
701
|
+
---
|
|
702
|
+
|
|
703
|
+
### SelectionGroup
|
|
704
|
+
|
|
705
|
+
Affichage compact des valeurs sélectionnées sous forme de tags, avec gestion du débordement (tooltip "+N").
|
|
706
|
+
|
|
707
|
+
**Props :**
|
|
708
|
+
| Prop | Type | Défaut | Description |
|
|
709
|
+
|------|------|--------|-------------|
|
|
710
|
+
| `modelValue` | `{value: any, label: string}[]` | requis | Items sélectionnés (v-model) |
|
|
711
|
+
| `clearable` | `boolean` | — | Bouton de suppression par item |
|
|
712
|
+
| `disabled` | `boolean` | — | — |
|
|
713
|
+
| `placeholder` | `string` | — | Texte si vide |
|
|
714
|
+
| `tooltipPosition` | `Position` | — | Position du tooltip "+N" |
|
|
715
|
+
| `tooltipStyle` | `CSSProperties` | — | Style custom du tooltip |
|
|
716
|
+
|
|
717
|
+
**Événements :** `update:modelValue`, `clearAll(previous: Option[])`, `clear(option: Option)`
|
|
718
|
+
|
|
719
|
+
---
|
|
720
|
+
|
|
721
|
+
### AvatarBase
|
|
722
|
+
|
|
723
|
+
Avatar utilisateur : photo, ou initiales en fallback si pas d'image.
|
|
724
|
+
|
|
725
|
+
**Props :**
|
|
726
|
+
| Prop | Type | Défaut | Description |
|
|
727
|
+
|------|------|--------|-------------|
|
|
728
|
+
| `src` | `string` | — | URL de l'image ; si absent, affiche les initiales |
|
|
729
|
+
| `alt` | `string` | `''` | Texte alternatif de l'image |
|
|
730
|
+
| `initials` | `string` | `'?'` | 1 ou 2 caractères affichés en fallback |
|
|
731
|
+
| `size` | `AvatarSize` | `'md'` | `'xs'` `'sm'` `'md'` `'lg'` `'xl'` |
|
|
732
|
+
| `shape` | `AvatarShape` | `'circle'` | `'circle'` `'square'` |
|
|
733
|
+
| `color` | `AvatarColor` | `'primary'` | `'primary'` `'secondary'` `'green'` `'blue'` `'grey'` |
|
|
734
|
+
|
|
735
|
+
```html
|
|
736
|
+
<AvatarBase initials="GV" size="md" color="primary" />
|
|
737
|
+
<AvatarBase src="/photos/user.jpg" alt="Jean Dupont" size="lg" />
|
|
738
|
+
<AvatarBase initials="AB" shape="square" color="secondary" />
|
|
739
|
+
```
|
|
740
|
+
|
|
741
|
+
---
|
|
742
|
+
|
|
743
|
+
### HistoryItem
|
|
744
|
+
|
|
745
|
+
Ligne d'historique d'une fiche. Affiche une action (Modification, Création ou Suppression) avec badge de type, horodatage et auteur. Cliquable : dépliée, elle révèle un panneau détaillant les champs concernés. Compose `HistoryBadge`, `AvatarBase` et `DiffValue`. Le rendu des valeurs dépend du `type` : modification (ancienne barrée → nouvelle), création (nouvelle seule), suppression (ancienne barrée → « Supprimé »).
|
|
746
|
+
|
|
747
|
+
**Props :**
|
|
748
|
+
| Prop | Type | Défaut | Description |
|
|
749
|
+
|------|------|--------|-------------|
|
|
750
|
+
| `type` | `HistoryItemType` | `'modification'` | Type d'action ; pilote le badge et le rendu des valeurs |
|
|
751
|
+
| `open` | `boolean` | `false` | Panneau de détail déplié (v-model:open) |
|
|
752
|
+
| `date` | `string` | `''` | Horodatage affiché |
|
|
753
|
+
| `author` | `string` | `''` | Nom de l'auteur |
|
|
754
|
+
| `initials` | `string` | `'?'` | Initiales de l'auteur (avatar) |
|
|
755
|
+
| `fields` | `HistoryItemField[]` | `[]` | Champs détaillés affichés quand `open` |
|
|
756
|
+
|
|
757
|
+
> Le bloc avatar + nom est **masqué** quand aucun auteur n'est connu (`author` vide et
|
|
758
|
+
> `initials` vide ou `'?'`) : le chevron reste aligné à droite. Utile pour les actions
|
|
759
|
+
> automatiques ou les logs sans utilisateur.
|
|
760
|
+
|
|
761
|
+
**Événements :** `update:open(value: boolean)` · `toggle(value: boolean)`
|
|
762
|
+
|
|
763
|
+
```html
|
|
764
|
+
<HistoryItem
|
|
765
|
+
type="modification"
|
|
766
|
+
v-model:open="open"
|
|
767
|
+
date="02/05/2026 14:08"
|
|
768
|
+
author="Gilles Vasse"
|
|
769
|
+
initials="GV"
|
|
770
|
+
:fields="[{ label: 'Prénom', oldValue: 'Jean', newValue: 'Jean-Pierre' }]"
|
|
771
|
+
/>
|
|
772
|
+
```
|
|
773
|
+
|
|
774
|
+
---
|
|
775
|
+
|
|
776
|
+
### DiffValue
|
|
777
|
+
|
|
778
|
+
Rendu d'un diff de valeur selon le type d'action : modification (ancienne barrée → nouvelle), création (nouvelle seule), suppression (ancienne barrée → « Supprimé »). Utilisé par `HistoryItem`, utilisable seul.
|
|
779
|
+
|
|
780
|
+
**Props :**
|
|
781
|
+
| Prop | Type | Défaut | Description |
|
|
782
|
+
|------|------|--------|-------------|
|
|
783
|
+
| `kind` | `DiffValueKind` | `'modification'` | Pilote le rendu (couple, nouvelle seule, suppression) |
|
|
784
|
+
| `oldValue` | `string` | `''` | Ancienne valeur (modification, suppression) |
|
|
785
|
+
| `newValue` | `string` | `''` | Nouvelle valeur (modification, création) |
|
|
786
|
+
|
|
787
|
+
```html
|
|
788
|
+
<DiffValue kind="modification" old-value="Jean" new-value="Jean-Pierre" />
|
|
789
|
+
<DiffValue kind="creation" new-value="jean@exemple.fr" />
|
|
790
|
+
<DiffValue kind="suppression" old-value="06 12 34 56 78" />
|
|
791
|
+
```
|
|
792
|
+
|
|
793
|
+
---
|
|
794
|
+
|
|
795
|
+
### HistoryBadge
|
|
796
|
+
|
|
797
|
+
Badge coloré du type d'action d'historique (libellé automatique : Modification / Création / Suppression).
|
|
798
|
+
|
|
799
|
+
**Props :**
|
|
800
|
+
| Prop | Type | Défaut | Description |
|
|
801
|
+
|------|------|--------|-------------|
|
|
802
|
+
| `type` | `HistoryBadgeType` | requis | `'modification'` `'creation'` `'suppression'` |
|
|
803
|
+
|
|
804
|
+
```html
|
|
805
|
+
<HistoryBadge type="creation" />
|
|
806
|
+
```
|
|
807
|
+
|
|
808
|
+
---
|
|
809
|
+
|
|
810
|
+
### HistoryFilter
|
|
811
|
+
|
|
812
|
+
Bouton de filtre d'historique (libellé automatique : Tout / Modification / Création / Suppression). Exclusif au sein d'un groupe : l'état actif est porté par le parent.
|
|
813
|
+
|
|
814
|
+
**Props :**
|
|
815
|
+
| Prop | Type | Défaut | Description |
|
|
816
|
+
|------|------|--------|-------------|
|
|
817
|
+
| `type` | `HistoryFilterType` | requis | `'all'` `'modification'` `'creation'` `'suppression'` |
|
|
818
|
+
| `active` | `boolean` | — | État sélectionné (piloté par le parent) |
|
|
819
|
+
|
|
820
|
+
**Événements :** `click`
|
|
821
|
+
|
|
822
|
+
```html
|
|
823
|
+
<HistoryFilter type="all" :active="filter === 'all'" @click="filter = 'all'" />
|
|
824
|
+
```
|
|
475
825
|
|
|
476
826
|
---
|
|
477
827
|
|
|
@@ -483,10 +833,99 @@ import type {
|
|
|
483
833
|
MenuItem, Header, DatagridHeader,
|
|
484
834
|
FlyoutMenuItem, ToggleTheme,
|
|
485
835
|
CalendarEvent, CalendarRange,
|
|
486
|
-
Toast, DayInfo, WeekInfo
|
|
836
|
+
Toast, DayInfo, WeekInfo,
|
|
837
|
+
AvatarSize, AvatarShape, AvatarColor,
|
|
838
|
+
HistoryItemType, HistoryItemField,
|
|
839
|
+
DiffValueKind, HistoryBadgeType, HistoryFilterType
|
|
487
840
|
} from '@arche-mc2/vue-ui-lib'
|
|
488
841
|
```
|
|
489
842
|
|
|
843
|
+
Détail des principaux types :
|
|
844
|
+
|
|
845
|
+
```ts
|
|
846
|
+
// Variantes de bouton
|
|
847
|
+
type ButtonTypes = 'primary' | 'primary-pink' | 'secondary' | 'secondary-pink'
|
|
848
|
+
| 'action1' | 'action2' | 'action3' | 'action4' | 'action5' | 'action6' | 'action7'
|
|
849
|
+
|
|
850
|
+
// Position tooltip/flyout
|
|
851
|
+
type Position = 'top' | 'bottom' | 'left' | 'right' | 'bottom-left'
|
|
852
|
+
|
|
853
|
+
// Option pour Select, ListWithSearch, SelectionGroup
|
|
854
|
+
type Option = { value: string; label: string; id?: number }
|
|
855
|
+
|
|
856
|
+
// Intent pour Toast
|
|
857
|
+
type Intent = 'success' | 'warning' | 'error' | 'info'
|
|
858
|
+
|
|
859
|
+
// Icône SVG (union de 532 noms)
|
|
860
|
+
type IconName = string // voir iconNames[] pour la liste complète
|
|
861
|
+
|
|
862
|
+
// Interface MenuItem (SideMenu)
|
|
863
|
+
interface MenuItem {
|
|
864
|
+
id: number; label: string; icon?: IconName
|
|
865
|
+
action?: () => void; children?: MenuItem[]
|
|
866
|
+
}
|
|
867
|
+
|
|
868
|
+
// Interface Header (DataGrid)
|
|
869
|
+
interface Header {
|
|
870
|
+
key: string; label: string; style?: CSSProperties
|
|
871
|
+
sortable?: boolean; filtered?: boolean; sortOrder?: 'ASC' | 'DESC'
|
|
872
|
+
dataType: 'string' | 'number' | 'date' | 'array'
|
|
873
|
+
}
|
|
874
|
+
interface DatagridHeader extends Header {
|
|
875
|
+
visibility: { isShown: boolean; isDisabled: boolean; update: (value: boolean) => void }
|
|
876
|
+
fixedWidth?: boolean
|
|
877
|
+
}
|
|
878
|
+
|
|
879
|
+
// Thème ToggleBase / ToggleAdvanced (CSS custom properties)
|
|
880
|
+
interface ToggleTheme {
|
|
881
|
+
'amc2-toggle-on-color'?: string
|
|
882
|
+
'amc2-toggle-off-color'?: string
|
|
883
|
+
'amc2-toggle-on-disabled-color'?: string
|
|
884
|
+
'amc2-toggle-off-disabled-color'?: string
|
|
885
|
+
'amc2-slider-on-color'?: string
|
|
886
|
+
'amc2-slider-off-color'?: string
|
|
887
|
+
'amc2-slider-on-disabled-color'?: string
|
|
888
|
+
'amc2-slider-off-disabled-color'?: string
|
|
889
|
+
}
|
|
890
|
+
|
|
891
|
+
// Événements CalendarBase
|
|
892
|
+
interface CalendarRange { start: string; end: string }
|
|
893
|
+
interface CalendarEvent extends CalendarRange { id: string; title: string }
|
|
894
|
+
|
|
895
|
+
// AvatarBase
|
|
896
|
+
type AvatarSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl'
|
|
897
|
+
type AvatarShape = 'circle' | 'square'
|
|
898
|
+
type AvatarColor = 'primary' | 'secondary' | 'green' | 'blue' | 'grey'
|
|
899
|
+
|
|
900
|
+
// Historique (HistoryItem / DiffValue / HistoryBadge / HistoryFilter)
|
|
901
|
+
type HistoryItemType = 'modification' | 'creation' | 'suppression'
|
|
902
|
+
interface HistoryItemField { label: string; oldValue?: string; newValue?: string }
|
|
903
|
+
type DiffValueKind = 'modification' | 'creation' | 'suppression'
|
|
904
|
+
type HistoryBadgeType = 'modification' | 'creation' | 'suppression'
|
|
905
|
+
type HistoryFilterType = 'all' | 'modification' | 'creation' | 'suppression'
|
|
906
|
+
```
|
|
907
|
+
|
|
908
|
+
---
|
|
909
|
+
|
|
910
|
+
## Theming — CSS Custom Properties
|
|
911
|
+
|
|
912
|
+
Les composants avec prop `theme` acceptent des CSS custom properties :
|
|
913
|
+
|
|
914
|
+
```html
|
|
915
|
+
<!-- CheckboxBase -->
|
|
916
|
+
<CheckboxBase :theme="{ '--amc2-checkbox-color': '#5B4DBE' }" v-model="checked" />
|
|
917
|
+
|
|
918
|
+
<!-- RadioBase -->
|
|
919
|
+
<RadioBase :theme="{ '--amc2-radio-color': '#EB5A77' }" v-model="val" :value="1" />
|
|
920
|
+
|
|
921
|
+
<!-- ToggleBase / ToggleAdvanced -->
|
|
922
|
+
<ToggleBase :theme="{
|
|
923
|
+
'amc2-toggle-on-color': '#5B4DBE',
|
|
924
|
+
'amc2-toggle-off-color': '#CCC',
|
|
925
|
+
'amc2-slider-on-color': '#FFF',
|
|
926
|
+
}" v-model="on" />
|
|
927
|
+
```
|
|
928
|
+
|
|
490
929
|
---
|
|
491
930
|
|
|
492
931
|
## Développement
|