@blackcube/aurelia2-bleet 1.0.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/blackcube-aurelia2-bleet-1.0.0.tgz +0 -0
- package/dist/index.es.js +4514 -0
- package/dist/index.es.js.map +1 -0
- package/dist/index.js +4549 -0
- package/dist/index.js.map +1 -0
- package/dist/types/attributes/ajaxify-trigger.d.ts +36 -0
- package/dist/types/attributes/ajaxify-trigger.d.ts.map +1 -0
- package/dist/types/attributes/alert.d.ts +15 -0
- package/dist/types/attributes/alert.d.ts.map +1 -0
- package/dist/types/attributes/badge.d.ts +13 -0
- package/dist/types/attributes/badge.d.ts.map +1 -0
- package/dist/types/attributes/burger.d.ts +11 -0
- package/dist/types/attributes/burger.d.ts.map +1 -0
- package/dist/types/attributes/drawer-trigger.d.ts +16 -0
- package/dist/types/attributes/drawer-trigger.d.ts.map +1 -0
- package/dist/types/attributes/dropdown.d.ts +38 -0
- package/dist/types/attributes/dropdown.d.ts.map +1 -0
- package/dist/types/attributes/index.d.ts +16 -0
- package/dist/types/attributes/index.d.ts.map +1 -0
- package/dist/types/attributes/menu.d.ts +32 -0
- package/dist/types/attributes/menu.d.ts.map +1 -0
- package/dist/types/attributes/modal-trigger.d.ts +16 -0
- package/dist/types/attributes/modal-trigger.d.ts.map +1 -0
- package/dist/types/attributes/pager.d.ts +13 -0
- package/dist/types/attributes/pager.d.ts.map +1 -0
- package/dist/types/attributes/password.d.ts +15 -0
- package/dist/types/attributes/password.d.ts.map +1 -0
- package/dist/types/attributes/profile.d.ts +24 -0
- package/dist/types/attributes/profile.d.ts.map +1 -0
- package/dist/types/attributes/select.d.ts +24 -0
- package/dist/types/attributes/select.d.ts.map +1 -0
- package/dist/types/attributes/tabs.d.ts +16 -0
- package/dist/types/attributes/tabs.d.ts.map +1 -0
- package/dist/types/attributes/toaster-trigger.d.ts +19 -0
- package/dist/types/attributes/toaster-trigger.d.ts.map +1 -0
- package/dist/types/attributes/upload.d.ts +57 -0
- package/dist/types/attributes/upload.d.ts.map +1 -0
- package/dist/types/codecs/ajaxify-codec.d.ts +5 -0
- package/dist/types/codecs/ajaxify-codec.d.ts.map +1 -0
- package/dist/types/codecs/csrf-codec.d.ts +7 -0
- package/dist/types/codecs/csrf-codec.d.ts.map +1 -0
- package/dist/types/codecs/request-codec.d.ts +5 -0
- package/dist/types/codecs/request-codec.d.ts.map +1 -0
- package/dist/types/components/bleet-ajaxify.d.ts +17 -0
- package/dist/types/components/bleet-ajaxify.d.ts.map +1 -0
- package/dist/types/components/bleet-ajaxify.html.d.ts +3 -0
- package/dist/types/components/bleet-ajaxify.html.d.ts.map +1 -0
- package/dist/types/components/bleet-drawer.d.ts +40 -0
- package/dist/types/components/bleet-drawer.d.ts.map +1 -0
- package/dist/types/components/bleet-drawer.html.d.ts +3 -0
- package/dist/types/components/bleet-drawer.html.d.ts.map +1 -0
- package/dist/types/components/bleet-modal.d.ts +46 -0
- package/dist/types/components/bleet-modal.d.ts.map +1 -0
- package/dist/types/components/bleet-modal.html.d.ts +3 -0
- package/dist/types/components/bleet-modal.html.d.ts.map +1 -0
- package/dist/types/components/bleet-overlay.d.ts +21 -0
- package/dist/types/components/bleet-overlay.d.ts.map +1 -0
- package/dist/types/components/bleet-quilljs.d.ts +19 -0
- package/dist/types/components/bleet-quilljs.d.ts.map +1 -0
- package/dist/types/components/bleet-quilljs.html.d.ts +3 -0
- package/dist/types/components/bleet-quilljs.html.d.ts.map +1 -0
- package/dist/types/components/bleet-toast.d.ts +26 -0
- package/dist/types/components/bleet-toast.d.ts.map +1 -0
- package/dist/types/components/bleet-toast.html.d.ts +3 -0
- package/dist/types/components/bleet-toast.html.d.ts.map +1 -0
- package/dist/types/components/bleet-toaster-trigger.d.ts +20 -0
- package/dist/types/components/bleet-toaster-trigger.d.ts.map +1 -0
- package/dist/types/components/bleet-toaster.d.ts +15 -0
- package/dist/types/components/bleet-toaster.d.ts.map +1 -0
- package/dist/types/components/bleet-toaster.html.d.ts +3 -0
- package/dist/types/components/bleet-toaster.html.d.ts.map +1 -0
- package/dist/types/components/index.d.ts +9 -0
- package/dist/types/components/index.d.ts.map +1 -0
- package/dist/types/configure.d.ts +35 -0
- package/dist/types/configure.d.ts.map +1 -0
- package/dist/types/enums/api.d.ts +11 -0
- package/dist/types/enums/api.d.ts.map +1 -0
- package/dist/types/enums/event-aggregator.d.ts +123 -0
- package/dist/types/enums/event-aggregator.d.ts.map +1 -0
- package/dist/types/index.d.ts +26 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/interfaces/api.d.ts +56 -0
- package/dist/types/interfaces/api.d.ts.map +1 -0
- package/dist/types/interfaces/dialog.d.ts +18 -0
- package/dist/types/interfaces/dialog.d.ts.map +1 -0
- package/dist/types/interfaces/event-aggregator.d.ts +75 -0
- package/dist/types/interfaces/event-aggregator.d.ts.map +1 -0
- package/dist/types/services/api-service.d.ts +64 -0
- package/dist/types/services/api-service.d.ts.map +1 -0
- package/dist/types/services/http-service.d.ts +22 -0
- package/dist/types/services/http-service.d.ts.map +1 -0
- package/dist/types/services/socketio-service.d.ts +23 -0
- package/dist/types/services/socketio-service.d.ts.map +1 -0
- package/dist/types/services/storage-service.d.ts +13 -0
- package/dist/types/services/storage-service.d.ts.map +1 -0
- package/dist/types/services/svg-service.d.ts +17 -0
- package/dist/types/services/svg-service.d.ts.map +1 -0
- package/dist/types/services/transition-service.d.ts +13 -0
- package/dist/types/services/transition-service.d.ts.map +1 -0
- package/dist/types/services/trap-focus-service.d.ts +28 -0
- package/dist/types/services/trap-focus-service.d.ts.map +1 -0
- package/doc/bleet-api-reference.md +1333 -0
- package/doc/bleet-model-api-reference.md +379 -0
- package/doc/bleet-typescript-api-reference.md +1037 -0
- package/package.json +43 -0
- package/resource.d.ts +22 -0
- package/src/attributes/ajaxify-trigger.ts +218 -0
- package/src/attributes/alert.ts +55 -0
- package/src/attributes/badge.ts +39 -0
- package/src/attributes/burger.ts +36 -0
- package/src/attributes/drawer-trigger.ts +53 -0
- package/src/attributes/dropdown.ts +377 -0
- package/src/attributes/index.ts +15 -0
- package/src/attributes/menu.ts +179 -0
- package/src/attributes/modal-trigger.ts +53 -0
- package/src/attributes/pager.ts +43 -0
- package/src/attributes/password.ts +47 -0
- package/src/attributes/profile.ts +112 -0
- package/src/attributes/select.ts +214 -0
- package/src/attributes/tabs.ts +99 -0
- package/src/attributes/toaster-trigger.ts +54 -0
- package/src/attributes/upload.ts +380 -0
- package/src/codecs/ajaxify-codec.ts +16 -0
- package/src/codecs/csrf-codec.ts +41 -0
- package/src/codecs/request-codec.ts +16 -0
- package/src/components/bleet-ajaxify.html.ts +4 -0
- package/src/components/bleet-ajaxify.ts +62 -0
- package/src/components/bleet-drawer.html.ts +36 -0
- package/src/components/bleet-drawer.ts +236 -0
- package/src/components/bleet-modal.html.ts +30 -0
- package/src/components/bleet-modal.ts +274 -0
- package/src/components/bleet-overlay.ts +111 -0
- package/src/components/bleet-quilljs.html.ts +4 -0
- package/src/components/bleet-quilljs.ts +73 -0
- package/src/components/bleet-toast.html.ts +44 -0
- package/src/components/bleet-toast.ts +133 -0
- package/src/components/bleet-toaster-trigger.ts +66 -0
- package/src/components/bleet-toaster.html.ts +11 -0
- package/src/components/bleet-toaster.ts +72 -0
- package/src/components/index.ts +8 -0
- package/src/configure.ts +121 -0
- package/src/enums/api.ts +12 -0
- package/src/enums/event-aggregator.ts +131 -0
- package/src/index.ts +220 -0
- package/src/interfaces/api.ts +64 -0
- package/src/interfaces/dialog.ts +25 -0
- package/src/interfaces/event-aggregator.ts +88 -0
- package/src/services/api-service.ts +387 -0
- package/src/services/http-service.ts +166 -0
- package/src/services/socketio-service.ts +138 -0
- package/src/services/storage-service.ts +36 -0
- package/src/services/svg-service.ts +35 -0
- package/src/services/transition-service.ts +39 -0
- package/src/services/trap-focus-service.ts +213 -0
- package/src/types/css.d.ts +4 -0
- package/src/types/html.d.ts +12 -0
- package/src/types/svg.d.ts +4 -0
|
@@ -0,0 +1,1333 @@
|
|
|
1
|
+
# Bleet API Reference
|
|
2
|
+
|
|
3
|
+
Documentation complète de la librairie de widgets Bleet pour Yii3.
|
|
4
|
+
|
|
5
|
+
## Architecture
|
|
6
|
+
|
|
7
|
+
### Classe principale
|
|
8
|
+
|
|
9
|
+
```php
|
|
10
|
+
use Blackcube\Bleet\Bleet;
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
Factory statique pour tous les widgets. Chaque méthode retourne une instance immutable (fluent API avec `clone`).
|
|
14
|
+
|
|
15
|
+
### Constantes
|
|
16
|
+
|
|
17
|
+
```php
|
|
18
|
+
// Couleurs
|
|
19
|
+
Bleet::COLOR_PRIMARY = 'primary';
|
|
20
|
+
Bleet::COLOR_SECONDARY = 'secondary';
|
|
21
|
+
Bleet::COLOR_SUCCESS = 'success';
|
|
22
|
+
Bleet::COLOR_DANGER = 'danger';
|
|
23
|
+
Bleet::COLOR_WARNING = 'warning';
|
|
24
|
+
Bleet::COLOR_INFO = 'info';
|
|
25
|
+
Bleet::COLOR_ACCENT = 'accent';
|
|
26
|
+
|
|
27
|
+
Bleet::COLORS = [...]; // Toutes les couleurs
|
|
28
|
+
|
|
29
|
+
// Tailles
|
|
30
|
+
Bleet::SIZE_XS = 'xs';
|
|
31
|
+
Bleet::SIZE_SM = 'sm';
|
|
32
|
+
Bleet::SIZE_MD = 'md';
|
|
33
|
+
Bleet::SIZE_LG = 'lg';
|
|
34
|
+
Bleet::SIZE_XL = 'xl';
|
|
35
|
+
|
|
36
|
+
Bleet::SIZES = [...]; // Toutes les tailles
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
### AbstractWidget (base)
|
|
40
|
+
|
|
41
|
+
Tous les widgets héritant de `AbstractWidget` disposent de :
|
|
42
|
+
|
|
43
|
+
```php
|
|
44
|
+
// Couleurs (fluent)
|
|
45
|
+
->color(string)
|
|
46
|
+
->primary() ->secondary() ->success() ->danger() ->warning() ->info() ->accent()
|
|
47
|
+
|
|
48
|
+
// Tailles (fluent)
|
|
49
|
+
->size(string)
|
|
50
|
+
->xs() ->sm() ->md() ->lg() ->xl()
|
|
51
|
+
|
|
52
|
+
// Rendu
|
|
53
|
+
->render(): string
|
|
54
|
+
->__toString(): string
|
|
55
|
+
|
|
56
|
+
// Begin/End (certains widgets)
|
|
57
|
+
->begin(): ?string
|
|
58
|
+
static::end(): string
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
### Règle Aurelia
|
|
62
|
+
|
|
63
|
+
**IMPORTANT** : Les composants Aurelia (custom elements et custom attributes) doivent TOUJOURS utiliser les helpers :
|
|
64
|
+
|
|
65
|
+
```php
|
|
66
|
+
use Blackcube\Bleet\Aurelia;
|
|
67
|
+
|
|
68
|
+
// Pour les custom elements (<bleet-modal>, <bleet-toast>, etc.)
|
|
69
|
+
Aurelia::attributesCustomElement(array $options): array
|
|
70
|
+
|
|
71
|
+
// Pour les custom attributes (bleet-upload, bleet-select, etc.)
|
|
72
|
+
Aurelia::attributesCustomAttribute(array $options): string
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
---
|
|
76
|
+
|
|
77
|
+
## Widgets Typographie
|
|
78
|
+
|
|
79
|
+
### Code
|
|
80
|
+
|
|
81
|
+
```php
|
|
82
|
+
Bleet::code(string $content = '')
|
|
83
|
+
->content(string)
|
|
84
|
+
->encode(bool) // défaut: true
|
|
85
|
+
// + AbstractWidget
|
|
86
|
+
// Couleur par défaut : primary
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
### Del
|
|
90
|
+
|
|
91
|
+
```php
|
|
92
|
+
Bleet::del(string $content = '')
|
|
93
|
+
->content(string)
|
|
94
|
+
->datetime(string) // ISO 8601
|
|
95
|
+
->cite(string) // URL source
|
|
96
|
+
->encode(bool)
|
|
97
|
+
// + AbstractWidget
|
|
98
|
+
// Couleur par défaut : danger
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
### Em
|
|
102
|
+
|
|
103
|
+
```php
|
|
104
|
+
Bleet::em(string $content = '')
|
|
105
|
+
->content(string)
|
|
106
|
+
->encode(bool)
|
|
107
|
+
// + AbstractWidget
|
|
108
|
+
// Couleur par défaut : secondary
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
### Ins
|
|
112
|
+
|
|
113
|
+
```php
|
|
114
|
+
Bleet::ins(string $content = '')
|
|
115
|
+
->content(string)
|
|
116
|
+
->datetime(string) // ISO 8601
|
|
117
|
+
->cite(string) // URL source
|
|
118
|
+
->encode(bool)
|
|
119
|
+
// + AbstractWidget
|
|
120
|
+
// Couleur par défaut : success
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
### Mark
|
|
124
|
+
|
|
125
|
+
```php
|
|
126
|
+
Bleet::mark(string $content = '')
|
|
127
|
+
->content(string)
|
|
128
|
+
->encode(bool)
|
|
129
|
+
// + AbstractWidget
|
|
130
|
+
// Couleur par défaut : warning
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
### Paragraph (p)
|
|
134
|
+
|
|
135
|
+
```php
|
|
136
|
+
Bleet::p()
|
|
137
|
+
->content(string|Stringable...)
|
|
138
|
+
->encode(bool)
|
|
139
|
+
->id(?string)
|
|
140
|
+
->class(string...)
|
|
141
|
+
->addClass(string...)
|
|
142
|
+
->attribute(string, mixed)
|
|
143
|
+
->attributes(array)
|
|
144
|
+
// + AbstractWidget
|
|
145
|
+
// Couleur par défaut : secondary
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
### Pre
|
|
149
|
+
|
|
150
|
+
```php
|
|
151
|
+
Bleet::pre(string $content = '')
|
|
152
|
+
->content(string|Widget|Closure)
|
|
153
|
+
->beginContent() / ->endContent()
|
|
154
|
+
->title(string) // nom de fichier, etc.
|
|
155
|
+
->encode(bool)
|
|
156
|
+
->id(string)
|
|
157
|
+
->addClass(string...)
|
|
158
|
+
->attribute(string, mixed)
|
|
159
|
+
// + AbstractWidget
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
### Small
|
|
163
|
+
|
|
164
|
+
```php
|
|
165
|
+
Bleet::small(string $content = '')
|
|
166
|
+
->content(string)
|
|
167
|
+
->encode(bool)
|
|
168
|
+
->id(string)
|
|
169
|
+
->addClass(string...)
|
|
170
|
+
->attribute(string, mixed)
|
|
171
|
+
// + AbstractWidget
|
|
172
|
+
// Taille par défaut : sm
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
### Strong
|
|
176
|
+
|
|
177
|
+
```php
|
|
178
|
+
Bleet::strong(string $content = '')
|
|
179
|
+
->content(string)
|
|
180
|
+
->encode(bool)
|
|
181
|
+
->id(string)
|
|
182
|
+
->addClass(string...)
|
|
183
|
+
->attribute(string, mixed)
|
|
184
|
+
// + AbstractWidget
|
|
185
|
+
// Couleur par défaut : secondary
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
---
|
|
189
|
+
|
|
190
|
+
## Widgets Titres
|
|
191
|
+
|
|
192
|
+
Tous les widgets H1-H6 partagent une API similaire.
|
|
193
|
+
|
|
194
|
+
### H1
|
|
195
|
+
|
|
196
|
+
Page header avec gradient, CTAs optionnels.
|
|
197
|
+
|
|
198
|
+
```php
|
|
199
|
+
Bleet::h1(string $title = '')
|
|
200
|
+
->title(string)
|
|
201
|
+
->subtitle(string)
|
|
202
|
+
->primaryCta(string $label, ?string $url) // bouton blanc
|
|
203
|
+
->secondaryCta(string $label, ?string $url) // bouton coloré
|
|
204
|
+
->id(string)
|
|
205
|
+
->addClass(string...)
|
|
206
|
+
->attribute(string, mixed)
|
|
207
|
+
// + AbstractWidget
|
|
208
|
+
```
|
|
209
|
+
|
|
210
|
+
### H2
|
|
211
|
+
|
|
212
|
+
Section header avec fond coloré.
|
|
213
|
+
|
|
214
|
+
```php
|
|
215
|
+
Bleet::h2(string $title = '')
|
|
216
|
+
->title(string)
|
|
217
|
+
->subtitle(string)
|
|
218
|
+
->id(string)
|
|
219
|
+
->addClass(string...)
|
|
220
|
+
->attribute(string, mixed)
|
|
221
|
+
// + AbstractWidget
|
|
222
|
+
```
|
|
223
|
+
|
|
224
|
+
### H3
|
|
225
|
+
|
|
226
|
+
Section header avec bordure bottom.
|
|
227
|
+
|
|
228
|
+
```php
|
|
229
|
+
Bleet::h3(string $title = '')
|
|
230
|
+
->title(string)
|
|
231
|
+
->subtitle(string)
|
|
232
|
+
->id(string)
|
|
233
|
+
->addClass(string...)
|
|
234
|
+
->attribute(string, mixed)
|
|
235
|
+
// + AbstractWidget
|
|
236
|
+
```
|
|
237
|
+
|
|
238
|
+
### H4
|
|
239
|
+
|
|
240
|
+
Subsection header avec bordure bottom (plus petit).
|
|
241
|
+
|
|
242
|
+
```php
|
|
243
|
+
Bleet::h4(string $title = '')
|
|
244
|
+
->title(string)
|
|
245
|
+
->subtitle(string)
|
|
246
|
+
->id(string)
|
|
247
|
+
->addClass(string...)
|
|
248
|
+
->attribute(string, mixed)
|
|
249
|
+
// + AbstractWidget
|
|
250
|
+
```
|
|
251
|
+
|
|
252
|
+
### H5
|
|
253
|
+
|
|
254
|
+
Minor section header (sans bordure).
|
|
255
|
+
|
|
256
|
+
```php
|
|
257
|
+
Bleet::h5(string $title = '')
|
|
258
|
+
->title(string)
|
|
259
|
+
->subtitle(string)
|
|
260
|
+
->id(string)
|
|
261
|
+
->addClass(string...)
|
|
262
|
+
->attribute(string, mixed)
|
|
263
|
+
// + AbstractWidget
|
|
264
|
+
```
|
|
265
|
+
|
|
266
|
+
### H6
|
|
267
|
+
|
|
268
|
+
Smallest header (titre uniquement, pas de subtitle).
|
|
269
|
+
|
|
270
|
+
```php
|
|
271
|
+
Bleet::h6(string $title = '')
|
|
272
|
+
->title(string)
|
|
273
|
+
->id(string)
|
|
274
|
+
->addClass(string...)
|
|
275
|
+
->attribute(string, mixed)
|
|
276
|
+
// + AbstractWidget
|
|
277
|
+
```
|
|
278
|
+
|
|
279
|
+
---
|
|
280
|
+
|
|
281
|
+
## Widgets Listes
|
|
282
|
+
|
|
283
|
+
### OrderedList (ol)
|
|
284
|
+
|
|
285
|
+
```php
|
|
286
|
+
Bleet::ol(array $items = [])
|
|
287
|
+
->items(array) // [string|array|ListItem]
|
|
288
|
+
->addItem(string|array|ListItem)
|
|
289
|
+
->encode(bool)
|
|
290
|
+
->id(string)
|
|
291
|
+
->addClass(string...)
|
|
292
|
+
->attribute(string, mixed)
|
|
293
|
+
// + AbstractWidget
|
|
294
|
+
// Couleur par défaut : secondary
|
|
295
|
+
```
|
|
296
|
+
|
|
297
|
+
### UnorderedList (ul)
|
|
298
|
+
|
|
299
|
+
```php
|
|
300
|
+
Bleet::ul(array $items = [])
|
|
301
|
+
->items(array) // [string|array|ListItem]
|
|
302
|
+
->addItem(string|array|ListItem)
|
|
303
|
+
->encode(bool)
|
|
304
|
+
->id(string)
|
|
305
|
+
->addClass(string...)
|
|
306
|
+
->attribute(string, mixed)
|
|
307
|
+
// + AbstractWidget
|
|
308
|
+
// Couleur par défaut : secondary
|
|
309
|
+
```
|
|
310
|
+
|
|
311
|
+
### ListItem
|
|
312
|
+
|
|
313
|
+
Helper pour items avec icônes. **N'hérite PAS de AbstractWidget.**
|
|
314
|
+
|
|
315
|
+
```php
|
|
316
|
+
Bleet::listItem(string $content = '')
|
|
317
|
+
->content(string)
|
|
318
|
+
->solid(string) // icône solid 24x24
|
|
319
|
+
->outline(string) // icône outline 24x24
|
|
320
|
+
->mini(string) // icône 20x20
|
|
321
|
+
->micro(string) // icône 16x16
|
|
322
|
+
->color(string) // override couleur parent
|
|
323
|
+
->primary() ->secondary() ->success() ->danger() ->warning() ->info()
|
|
324
|
+
->encode(bool)
|
|
325
|
+
```
|
|
326
|
+
|
|
327
|
+
### DescriptionList (dl)
|
|
328
|
+
|
|
329
|
+
```php
|
|
330
|
+
Bleet::dl(array $items = [])
|
|
331
|
+
->items(array) // [TermItem|array]
|
|
332
|
+
->addItem(TermItem|array)
|
|
333
|
+
->cols(int) // 0=stacked, 1=flex, 2+=grid
|
|
334
|
+
->tableMode(bool) // auto si cols>=2
|
|
335
|
+
// + AbstractWidget
|
|
336
|
+
// Couleur par défaut : primary
|
|
337
|
+
```
|
|
338
|
+
|
|
339
|
+
### TermItem
|
|
340
|
+
|
|
341
|
+
Helper pour dl. **N'hérite PAS de AbstractWidget.**
|
|
342
|
+
|
|
343
|
+
```php
|
|
344
|
+
Bleet::termItem(string $term = '')
|
|
345
|
+
->term(string)
|
|
346
|
+
->encodeTerm(bool)
|
|
347
|
+
->detail(string) // raccourci addDetail
|
|
348
|
+
->addDetail(DetailItem)
|
|
349
|
+
->details(array) // [DetailItem|string]
|
|
350
|
+
->level(int) // niveau arborescent
|
|
351
|
+
```
|
|
352
|
+
|
|
353
|
+
### DetailItem
|
|
354
|
+
|
|
355
|
+
Helper pour dd. **N'hérite PAS de AbstractWidget.**
|
|
356
|
+
|
|
357
|
+
```php
|
|
358
|
+
Bleet::detailItem(string $content = '')
|
|
359
|
+
->content(string)
|
|
360
|
+
->encode(bool)
|
|
361
|
+
```
|
|
362
|
+
|
|
363
|
+
---
|
|
364
|
+
|
|
365
|
+
## Widgets Liens & Boutons
|
|
366
|
+
|
|
367
|
+
### Anchor (a)
|
|
368
|
+
|
|
369
|
+
```php
|
|
370
|
+
Bleet::a(?string $url = null)
|
|
371
|
+
->url(string)
|
|
372
|
+
->content(string|Widget|Closure)
|
|
373
|
+
->beginContent() / ->endContent()
|
|
374
|
+
->target(string) // _blank, _self, etc.
|
|
375
|
+
->external() // target=_blank + rel
|
|
376
|
+
->encode(bool)
|
|
377
|
+
->id(string)
|
|
378
|
+
->addClass(string...)
|
|
379
|
+
->attribute(string, mixed)
|
|
380
|
+
->attributes(array)
|
|
381
|
+
// + AbstractWidget
|
|
382
|
+
// Couleur par défaut : primary
|
|
383
|
+
```
|
|
384
|
+
|
|
385
|
+
### Button
|
|
386
|
+
|
|
387
|
+
```php
|
|
388
|
+
Bleet::button(string $content = '')
|
|
389
|
+
->content(string)
|
|
390
|
+
->icon(string $name, string $type = 'outline')
|
|
391
|
+
->badge(int) // compteur position absolue
|
|
392
|
+
->outline(bool) ->ghost(bool) ->inverse(bool)
|
|
393
|
+
->submit() ->reset() ->button()
|
|
394
|
+
->disabled(bool)
|
|
395
|
+
->attributes(array) // MERGE (pas replace)
|
|
396
|
+
->renderAsMenuItem(string ...$classes): string
|
|
397
|
+
// + AbstractWidget
|
|
398
|
+
```
|
|
399
|
+
|
|
400
|
+
### ButtonsBar
|
|
401
|
+
|
|
402
|
+
```php
|
|
403
|
+
Bleet::buttonsBar()
|
|
404
|
+
->addButton(Button|Anchor)
|
|
405
|
+
->buttons(array)
|
|
406
|
+
```
|
|
407
|
+
|
|
408
|
+
---
|
|
409
|
+
|
|
410
|
+
## Widgets Formulaire
|
|
411
|
+
|
|
412
|
+
### Label
|
|
413
|
+
|
|
414
|
+
```php
|
|
415
|
+
Bleet::label(string $content = '')
|
|
416
|
+
->active(FormModelInterface, string)
|
|
417
|
+
->content(string)
|
|
418
|
+
->for(string)
|
|
419
|
+
->required(bool) // ajoute *
|
|
420
|
+
->id(string)
|
|
421
|
+
->addClass(string...)
|
|
422
|
+
// + AbstractWidget
|
|
423
|
+
// Couleur par défaut : secondary
|
|
424
|
+
```
|
|
425
|
+
|
|
426
|
+
### Input
|
|
427
|
+
|
|
428
|
+
```php
|
|
429
|
+
Bleet::input()
|
|
430
|
+
->active(FormModelInterface, string)
|
|
431
|
+
// Types
|
|
432
|
+
->type(string)
|
|
433
|
+
->text() ->password() ->email() ->number() ->date() ->hidden() ->tel()
|
|
434
|
+
// Attributs
|
|
435
|
+
->name(string)
|
|
436
|
+
->id(string)
|
|
437
|
+
->value(string)
|
|
438
|
+
->placeholder(string)
|
|
439
|
+
->disabled(bool)
|
|
440
|
+
->readonly(bool)
|
|
441
|
+
->required(bool)
|
|
442
|
+
->labelledBy(string)
|
|
443
|
+
->describedBy(string)
|
|
444
|
+
->autocomplete(string)
|
|
445
|
+
// Décoration
|
|
446
|
+
->floatingLabel(string|Label)
|
|
447
|
+
->icon(string|Svg) // trailing (droite)
|
|
448
|
+
->iconLeft(string|Svg) // leading (gauche)
|
|
449
|
+
->showable(bool) // toggle show/hide password
|
|
450
|
+
->addClass(string...)
|
|
451
|
+
->fieldData(array)
|
|
452
|
+
// + AbstractWidget
|
|
453
|
+
// Couleur par défaut : secondary
|
|
454
|
+
```
|
|
455
|
+
|
|
456
|
+
### Textarea
|
|
457
|
+
|
|
458
|
+
```php
|
|
459
|
+
Bleet::textarea()
|
|
460
|
+
->active(FormModelInterface, string)
|
|
461
|
+
->name(string)
|
|
462
|
+
->id(string)
|
|
463
|
+
->value(string)
|
|
464
|
+
->placeholder(string)
|
|
465
|
+
->rows(int) // défaut: 4
|
|
466
|
+
->cols(int)
|
|
467
|
+
->disabled(bool)
|
|
468
|
+
->readonly(bool)
|
|
469
|
+
->required(bool)
|
|
470
|
+
->labelledBy(string)
|
|
471
|
+
->describedBy(string)
|
|
472
|
+
->floatingLabel(string|Label)
|
|
473
|
+
->addClass(string...)
|
|
474
|
+
->fieldData(array)
|
|
475
|
+
// + AbstractWidget
|
|
476
|
+
// Couleur par défaut : secondary
|
|
477
|
+
```
|
|
478
|
+
|
|
479
|
+
### Select
|
|
480
|
+
|
|
481
|
+
```php
|
|
482
|
+
Bleet::select()
|
|
483
|
+
->active(FormModelInterface, string)
|
|
484
|
+
->name(string)
|
|
485
|
+
->label(string|bool) // string=custom, false=hide
|
|
486
|
+
->placeholder(string)
|
|
487
|
+
->options(array) // ['value' => 'label'] ou groupes
|
|
488
|
+
->selected(?string)
|
|
489
|
+
->labelledBy(string)
|
|
490
|
+
->describedBy(string)
|
|
491
|
+
->id(string)
|
|
492
|
+
->addClass(string...)
|
|
493
|
+
->attribute(string, mixed)
|
|
494
|
+
->fieldData(array)
|
|
495
|
+
// + AbstractWidget
|
|
496
|
+
// Couleur par défaut : secondary
|
|
497
|
+
```
|
|
498
|
+
|
|
499
|
+
### Dropdown
|
|
500
|
+
|
|
501
|
+
Dropdown avancé avec recherche, sélection multiple, mode tags.
|
|
502
|
+
|
|
503
|
+
```php
|
|
504
|
+
Bleet::dropdown()
|
|
505
|
+
->active(FormModelInterface, string)
|
|
506
|
+
->name(string)
|
|
507
|
+
->label(string)
|
|
508
|
+
->placeholder(string)
|
|
509
|
+
->searchPlaceholder(string)
|
|
510
|
+
->emptyText(string)
|
|
511
|
+
->options(array) // ['value' => 'label'] ou groupes
|
|
512
|
+
->selected(string|array|null)
|
|
513
|
+
->searchable(bool)
|
|
514
|
+
->multiple(bool)
|
|
515
|
+
->withTags(bool) // mode Gmail
|
|
516
|
+
->labelledBy(string)
|
|
517
|
+
->describedBy(string)
|
|
518
|
+
->fieldData(array)
|
|
519
|
+
// + AbstractWidget
|
|
520
|
+
// Couleur par défaut : secondary
|
|
521
|
+
```
|
|
522
|
+
|
|
523
|
+
### Checkbox
|
|
524
|
+
|
|
525
|
+
```php
|
|
526
|
+
Bleet::checkbox()
|
|
527
|
+
->active(FormModelInterface, string)
|
|
528
|
+
->name(string)
|
|
529
|
+
->id(string)
|
|
530
|
+
->value(string)
|
|
531
|
+
->uncheckValue(string) // hidden input pour unchecked
|
|
532
|
+
->checked(bool)
|
|
533
|
+
->disabled(bool)
|
|
534
|
+
->required(bool)
|
|
535
|
+
->label(string|Label)
|
|
536
|
+
->description(string) // active mode avec description
|
|
537
|
+
->fieldData(array)
|
|
538
|
+
// + AbstractWidget
|
|
539
|
+
// Couleur par défaut : secondary
|
|
540
|
+
```
|
|
541
|
+
|
|
542
|
+
### CheckboxList
|
|
543
|
+
|
|
544
|
+
```php
|
|
545
|
+
Bleet::checkboxList()
|
|
546
|
+
->active(FormModelInterface, string)
|
|
547
|
+
->name(string) // auto-append [] si manquant
|
|
548
|
+
->id(string)
|
|
549
|
+
->items(array) // ['value' => 'label']
|
|
550
|
+
->values(array) // valeurs sélectionnées
|
|
551
|
+
->disabled(bool)
|
|
552
|
+
->required(bool)
|
|
553
|
+
->label(string)
|
|
554
|
+
->hint(string)
|
|
555
|
+
->fieldData(array)
|
|
556
|
+
// + AbstractWidget
|
|
557
|
+
// Couleur par défaut : secondary
|
|
558
|
+
```
|
|
559
|
+
|
|
560
|
+
### Radio
|
|
561
|
+
|
|
562
|
+
```php
|
|
563
|
+
Bleet::radio()
|
|
564
|
+
->active(FormModelInterface, string)
|
|
565
|
+
->name(string)
|
|
566
|
+
->id(string)
|
|
567
|
+
->value(string)
|
|
568
|
+
->checked(bool)
|
|
569
|
+
->disabled(bool)
|
|
570
|
+
->required(bool)
|
|
571
|
+
->label(string|Label)
|
|
572
|
+
->description(string)
|
|
573
|
+
->fieldData(array)
|
|
574
|
+
// + AbstractWidget
|
|
575
|
+
// Couleur par défaut : secondary
|
|
576
|
+
```
|
|
577
|
+
|
|
578
|
+
### RadioList
|
|
579
|
+
|
|
580
|
+
```php
|
|
581
|
+
Bleet::radioList()
|
|
582
|
+
->active(FormModelInterface, string)
|
|
583
|
+
->name(string)
|
|
584
|
+
->id(string)
|
|
585
|
+
->items(array) // ['value' => 'label']
|
|
586
|
+
->value(?string)
|
|
587
|
+
->disabled(bool)
|
|
588
|
+
->required(bool)
|
|
589
|
+
->label(string)
|
|
590
|
+
->hint(string)
|
|
591
|
+
->fieldData(array)
|
|
592
|
+
// + AbstractWidget
|
|
593
|
+
// Couleur par défaut : secondary
|
|
594
|
+
```
|
|
595
|
+
|
|
596
|
+
### Toggle
|
|
597
|
+
|
|
598
|
+
```php
|
|
599
|
+
Bleet::toggle()
|
|
600
|
+
->active(FormModelInterface, string)
|
|
601
|
+
->name(string)
|
|
602
|
+
->id(string)
|
|
603
|
+
->value(string) // défaut: '1'
|
|
604
|
+
->checked(bool)
|
|
605
|
+
->disabled(bool)
|
|
606
|
+
->label(string|Label)
|
|
607
|
+
->ariaLabel(string) // si pas de label visible
|
|
608
|
+
->attributes(array) // sur wrapper
|
|
609
|
+
->fieldData(array)
|
|
610
|
+
// + AbstractWidget
|
|
611
|
+
// Couleur par défaut : secondary
|
|
612
|
+
```
|
|
613
|
+
|
|
614
|
+
Génère automatiquement un hidden input avec value='0'.
|
|
615
|
+
|
|
616
|
+
### Upload
|
|
617
|
+
|
|
618
|
+
```php
|
|
619
|
+
Bleet::upload(?UploadConfig $config = null)
|
|
620
|
+
->active(FormModelInterface, string)
|
|
621
|
+
->endpoint(string)
|
|
622
|
+
->previewEndpoint(string) // {name} placeholder
|
|
623
|
+
->deleteEndpoint(string)
|
|
624
|
+
->accept(array) // ['jpg', 'pdf', ...]
|
|
625
|
+
->maxFiles(int) // défaut: 1
|
|
626
|
+
->multiple(bool)
|
|
627
|
+
->chunkSize(int)
|
|
628
|
+
->name(string)
|
|
629
|
+
->id(string)
|
|
630
|
+
->value(?string) // fichiers existants (CSV)
|
|
631
|
+
->label(string)
|
|
632
|
+
->hint(string)
|
|
633
|
+
->disabled(bool)
|
|
634
|
+
->required(bool)
|
|
635
|
+
// + AbstractWidget
|
|
636
|
+
// Couleur par défaut : secondary
|
|
637
|
+
```
|
|
638
|
+
|
|
639
|
+
Utilise Resumable.js pour l'upload chunked. Custom attribute Aurelia : `bleet-upload`.
|
|
640
|
+
|
|
641
|
+
---
|
|
642
|
+
|
|
643
|
+
## Widgets Layout
|
|
644
|
+
|
|
645
|
+
### Card
|
|
646
|
+
|
|
647
|
+
```php
|
|
648
|
+
Bleet::card(string|Widget|Closure $content = '')
|
|
649
|
+
->content()
|
|
650
|
+
->beginContent() / ->endContent()
|
|
651
|
+
->header() / ->beginHeader() / ->endHeader()
|
|
652
|
+
->title(string)
|
|
653
|
+
->description(string)
|
|
654
|
+
->headerButton(label, url)
|
|
655
|
+
->footer() / ->beginFooter() / ->endFooter()
|
|
656
|
+
->footerButton(label, url)
|
|
657
|
+
->encode(bool)
|
|
658
|
+
// + AbstractWidget
|
|
659
|
+
// Couleur par défaut : secondary
|
|
660
|
+
```
|
|
661
|
+
|
|
662
|
+
### CardHeader
|
|
663
|
+
|
|
664
|
+
```php
|
|
665
|
+
Bleet::cardHeader()
|
|
666
|
+
->title(string)
|
|
667
|
+
->icon(string)
|
|
668
|
+
->left(Stringable|string)
|
|
669
|
+
->badges(Stringable[])
|
|
670
|
+
->button(Stringable|string)
|
|
671
|
+
// + AbstractWidget
|
|
672
|
+
// Couleur par défaut : primary
|
|
673
|
+
```
|
|
674
|
+
|
|
675
|
+
### EmptyState
|
|
676
|
+
|
|
677
|
+
Extends Card.
|
|
678
|
+
|
|
679
|
+
```php
|
|
680
|
+
Bleet::emptyState()
|
|
681
|
+
->icon(string) // heroicon outline
|
|
682
|
+
->title(string)
|
|
683
|
+
->description(string)
|
|
684
|
+
->button(string $label, string $url) // auto-inclut icône +
|
|
685
|
+
// + AbstractWidget
|
|
686
|
+
// Couleur par défaut : secondary
|
|
687
|
+
```
|
|
688
|
+
|
|
689
|
+
### Figure
|
|
690
|
+
|
|
691
|
+
```php
|
|
692
|
+
Bleet::figure(string $src = '', string $alt = '')
|
|
693
|
+
->src(string)
|
|
694
|
+
->alt(string)
|
|
695
|
+
->caption(string|Widget|Closure)
|
|
696
|
+
->beginCaption() / ->endCaption()
|
|
697
|
+
->description(string) // active mode détaillé
|
|
698
|
+
->prefix(string) // ex: 'Figure 1.'
|
|
699
|
+
->center()
|
|
700
|
+
->rounded()
|
|
701
|
+
// + AbstractWidget
|
|
702
|
+
// Couleur par défaut : primary
|
|
703
|
+
```
|
|
704
|
+
|
|
705
|
+
### Hr
|
|
706
|
+
|
|
707
|
+
```php
|
|
708
|
+
Bleet::hr(?string $text = null)
|
|
709
|
+
->text(string) // texte au centre
|
|
710
|
+
->id(string)
|
|
711
|
+
->addClass(string...)
|
|
712
|
+
->attribute(string, mixed)
|
|
713
|
+
// + AbstractWidget
|
|
714
|
+
```
|
|
715
|
+
|
|
716
|
+
---
|
|
717
|
+
|
|
718
|
+
## Widgets Navigation
|
|
719
|
+
|
|
720
|
+
### Header
|
|
721
|
+
|
|
722
|
+
```php
|
|
723
|
+
Bleet::header()
|
|
724
|
+
->title(string) // défaut: 'Bleet'
|
|
725
|
+
->withBurgerMenu() / ->withoutBurgerMenu()
|
|
726
|
+
->search(?string $action, string $placeholder = 'Rechercher')
|
|
727
|
+
->actions(array) // [Anchor|Button]
|
|
728
|
+
->addAction(Anchor|Button)
|
|
729
|
+
->profile(Profile)
|
|
730
|
+
->id(string)
|
|
731
|
+
->addClass(string...)
|
|
732
|
+
->attribute(string, mixed)
|
|
733
|
+
// + AbstractWidget
|
|
734
|
+
```
|
|
735
|
+
|
|
736
|
+
### Footer
|
|
737
|
+
|
|
738
|
+
```php
|
|
739
|
+
Bleet::footer()
|
|
740
|
+
->version(string)
|
|
741
|
+
->copyright(string) // défaut: 'All rights reserved'
|
|
742
|
+
// + AbstractWidget
|
|
743
|
+
// Couleur par défaut : primary
|
|
744
|
+
```
|
|
745
|
+
|
|
746
|
+
### Sidebar
|
|
747
|
+
|
|
748
|
+
```php
|
|
749
|
+
Bleet::sidebar()
|
|
750
|
+
->logo(string|Img)
|
|
751
|
+
->encode(bool) // défaut: true (false pour HTML brut)
|
|
752
|
+
->separator(bool) // ligne entre logo et nav
|
|
753
|
+
->items(array) // [SidebarItem|array]
|
|
754
|
+
->addItem(SidebarItem|array)
|
|
755
|
+
->id(string)
|
|
756
|
+
->addClass(string...)
|
|
757
|
+
// + AbstractWidget
|
|
758
|
+
```
|
|
759
|
+
|
|
760
|
+
### SidebarItem
|
|
761
|
+
|
|
762
|
+
**N'hérite PAS de AbstractWidget.**
|
|
763
|
+
|
|
764
|
+
```php
|
|
765
|
+
Bleet::sidebarItem(string $label = '')
|
|
766
|
+
->label(string)
|
|
767
|
+
->url(string)
|
|
768
|
+
->outline(string) // icône outline (défaut)
|
|
769
|
+
->solid(string) // icône solid
|
|
770
|
+
->active(bool)
|
|
771
|
+
->toggleId(string) // pour sous-menu
|
|
772
|
+
->children(array) // [SidebarItem]
|
|
773
|
+
->addChild(SidebarItem)
|
|
774
|
+
```
|
|
775
|
+
|
|
776
|
+
### Breadcrumb
|
|
777
|
+
|
|
778
|
+
```php
|
|
779
|
+
Bleet::breadcrumb()
|
|
780
|
+
->homeUrl(string)
|
|
781
|
+
->homeLabel(string)
|
|
782
|
+
->homeIcon(string)
|
|
783
|
+
->items(array) // [BreadcrumbItem|array]
|
|
784
|
+
->addItem(BreadcrumbItem|array)
|
|
785
|
+
->id(string)
|
|
786
|
+
->addClass(string...)
|
|
787
|
+
// + AbstractWidget
|
|
788
|
+
```
|
|
789
|
+
|
|
790
|
+
### BreadcrumbItem
|
|
791
|
+
|
|
792
|
+
**N'hérite PAS de AbstractWidget.**
|
|
793
|
+
|
|
794
|
+
```php
|
|
795
|
+
Bleet::breadcrumbItem(string $label = '')
|
|
796
|
+
->label(string)
|
|
797
|
+
->url(?string)
|
|
798
|
+
->icon(string)
|
|
799
|
+
->encode(bool)
|
|
800
|
+
```
|
|
801
|
+
|
|
802
|
+
### Pager
|
|
803
|
+
|
|
804
|
+
```php
|
|
805
|
+
Bleet::pager(OffsetPaginator $paginator, UrlGeneratorInterface $urlGenerator)
|
|
806
|
+
->pageParam(string) // défaut: 'page'
|
|
807
|
+
->maxButtonCount(int) // défaut: 10
|
|
808
|
+
->hideOnSinglePage(bool) // défaut: true
|
|
809
|
+
->showInfo(bool) / ->hideInfo()
|
|
810
|
+
->showMobileSelect(bool) / ->hideMobileSelect()
|
|
811
|
+
->id(string)
|
|
812
|
+
->addClass(string...)
|
|
813
|
+
->attribute(string, mixed)
|
|
814
|
+
// + AbstractWidget
|
|
815
|
+
```
|
|
816
|
+
|
|
817
|
+
### Step
|
|
818
|
+
|
|
819
|
+
```php
|
|
820
|
+
Bleet::step()
|
|
821
|
+
->current(int) // index 0-based
|
|
822
|
+
->steps(array) // [['label' => '', 'url' => '']]
|
|
823
|
+
->addStep(string $label, ?string $url)
|
|
824
|
+
->id(string)
|
|
825
|
+
->addClass(string...)
|
|
826
|
+
->attribute(string, mixed)
|
|
827
|
+
// + AbstractWidget
|
|
828
|
+
```
|
|
829
|
+
|
|
830
|
+
États automatiques : completed (< current), current (= current), upcoming (> current).
|
|
831
|
+
|
|
832
|
+
### Tab / TabPanel
|
|
833
|
+
|
|
834
|
+
```php
|
|
835
|
+
Tab::widget()
|
|
836
|
+
->id(string)
|
|
837
|
+
->addClass(string...)
|
|
838
|
+
->attribute(string, mixed)
|
|
839
|
+
// + AbstractWidget
|
|
840
|
+
```
|
|
841
|
+
|
|
842
|
+
Usage (begin/end) :
|
|
843
|
+
|
|
844
|
+
```php
|
|
845
|
+
<?php Tab::widget()->primary()->begin() ?>
|
|
846
|
+
<?php TabPanel::begin('Profil', active: true) ?>
|
|
847
|
+
Contenu
|
|
848
|
+
<?php TabPanel::end() ?>
|
|
849
|
+
<?php echo Tab::end() ?>
|
|
850
|
+
```
|
|
851
|
+
|
|
852
|
+
**TabPanel** (N'hérite PAS de AbstractWidget) :
|
|
853
|
+
|
|
854
|
+
```php
|
|
855
|
+
TabPanel::begin(string $label, bool $active = false, ?string $badge = null)
|
|
856
|
+
TabPanel::end()
|
|
857
|
+
```
|
|
858
|
+
|
|
859
|
+
---
|
|
860
|
+
|
|
861
|
+
## Widgets Dashboard
|
|
862
|
+
|
|
863
|
+
### StatCard
|
|
864
|
+
|
|
865
|
+
```php
|
|
866
|
+
Bleet::statCard(string $label = '', string $value = '')
|
|
867
|
+
->label(string)
|
|
868
|
+
->value(string)
|
|
869
|
+
->icon(string) // heroicon outline
|
|
870
|
+
->trend(float, ?string $label) // auto-format +/- %, direction auto
|
|
871
|
+
->id(string)
|
|
872
|
+
->addClass(string...)
|
|
873
|
+
->attribute(string, mixed)
|
|
874
|
+
// + AbstractWidget
|
|
875
|
+
```
|
|
876
|
+
|
|
877
|
+
### ShortcutCard
|
|
878
|
+
|
|
879
|
+
```php
|
|
880
|
+
Bleet::shortcutCard(string $label = '', string $url = '#')
|
|
881
|
+
->label(string)
|
|
882
|
+
->url(string)
|
|
883
|
+
->icon(string) // heroicon outline
|
|
884
|
+
->id(string)
|
|
885
|
+
->addClass(string...)
|
|
886
|
+
->attribute(string, mixed)
|
|
887
|
+
// + AbstractWidget
|
|
888
|
+
```
|
|
889
|
+
|
|
890
|
+
### ActivityFeed
|
|
891
|
+
|
|
892
|
+
```php
|
|
893
|
+
Bleet::activityFeed()
|
|
894
|
+
->items(array)
|
|
895
|
+
->addItem(ActivityItem|array)
|
|
896
|
+
// + AbstractWidget
|
|
897
|
+
// Couleur par défaut : secondary
|
|
898
|
+
```
|
|
899
|
+
|
|
900
|
+
### ActivityItem
|
|
901
|
+
|
|
902
|
+
**N'hérite PAS de AbstractWidget.**
|
|
903
|
+
|
|
904
|
+
```php
|
|
905
|
+
Bleet::activityItem()
|
|
906
|
+
->content(string|Widget|Closure)
|
|
907
|
+
->datetime(string)
|
|
908
|
+
->avatar(string|Img)
|
|
909
|
+
->icon(string)
|
|
910
|
+
->iconColor(string)
|
|
911
|
+
->encode(bool)
|
|
912
|
+
```
|
|
913
|
+
|
|
914
|
+
### Progress
|
|
915
|
+
|
|
916
|
+
**Couleurs restreintes** : primary, success, warning, danger.
|
|
917
|
+
|
|
918
|
+
```php
|
|
919
|
+
Bleet::progress(int $percent = 0)
|
|
920
|
+
->percent(int)
|
|
921
|
+
->title(string)
|
|
922
|
+
->labels(array) // étapes sous la barre
|
|
923
|
+
->auto() // couleur auto selon %
|
|
924
|
+
->id(string)
|
|
925
|
+
->addClass(string...)
|
|
926
|
+
->attribute(string, mixed)
|
|
927
|
+
// + AbstractWidget (couleurs restreintes)
|
|
928
|
+
```
|
|
929
|
+
|
|
930
|
+
Couleurs auto : < 33% → danger, < 66% → warning, ≥ 66% → success.
|
|
931
|
+
|
|
932
|
+
---
|
|
933
|
+
|
|
934
|
+
## Widgets Interactifs
|
|
935
|
+
|
|
936
|
+
### Alert
|
|
937
|
+
|
|
938
|
+
```php
|
|
939
|
+
Bleet::alert(string $content = '')
|
|
940
|
+
->content(string|Widget|Closure)
|
|
941
|
+
->beginContent() / ->endContent()
|
|
942
|
+
->title(?string)
|
|
943
|
+
->closable(bool)
|
|
944
|
+
->encode(bool)
|
|
945
|
+
// + AbstractWidget
|
|
946
|
+
// Couleur par défaut : info
|
|
947
|
+
```
|
|
948
|
+
|
|
949
|
+
### Badge
|
|
950
|
+
|
|
951
|
+
```php
|
|
952
|
+
Bleet::badge(string $content = '')
|
|
953
|
+
->content(string)
|
|
954
|
+
->dot(bool) // mode point coloré
|
|
955
|
+
->rounded(bool) // défaut: true (arrondi)
|
|
956
|
+
->flat(bool) // fond transparent
|
|
957
|
+
->encode(bool)
|
|
958
|
+
// + AbstractWidget
|
|
959
|
+
// Couleur par défaut : primary
|
|
960
|
+
```
|
|
961
|
+
|
|
962
|
+
### Avatar
|
|
963
|
+
|
|
964
|
+
```php
|
|
965
|
+
Bleet::avatar()
|
|
966
|
+
->initials(string)
|
|
967
|
+
->img(string|Img)
|
|
968
|
+
->sm() ->md() ->lg() ->xl()
|
|
969
|
+
// + AbstractWidget
|
|
970
|
+
```
|
|
971
|
+
|
|
972
|
+
### Modal
|
|
973
|
+
|
|
974
|
+
Custom element Aurelia : `<bleet-modal>`.
|
|
975
|
+
|
|
976
|
+
```php
|
|
977
|
+
Bleet::modal(string $id)
|
|
978
|
+
// + AbstractWidget
|
|
979
|
+
```
|
|
980
|
+
|
|
981
|
+
**Méthodes terminales :**
|
|
982
|
+
|
|
983
|
+
```php
|
|
984
|
+
->trigger(?string $url = null): array // attributs pour bouton
|
|
985
|
+
->render(): string // coquille <bleet-modal>
|
|
986
|
+
->asArray(): array // export EA/AJAX
|
|
987
|
+
```
|
|
988
|
+
|
|
989
|
+
**Usage :**
|
|
990
|
+
|
|
991
|
+
```php
|
|
992
|
+
// Trigger (utilise Aurelia::attributesCustomAttribute)
|
|
993
|
+
<?php echo Bleet::button('Modifier')
|
|
994
|
+
->attributes(Bleet::modal('editUser')->trigger('/api/user/1'))
|
|
995
|
+
->render();
|
|
996
|
+
|
|
997
|
+
// Shell dans layout
|
|
998
|
+
<?php echo Bleet::modal('editUser')->render();
|
|
999
|
+
```
|
|
1000
|
+
|
|
1001
|
+
### Drawer
|
|
1002
|
+
|
|
1003
|
+
Custom element Aurelia : `<bleet-drawer>`.
|
|
1004
|
+
|
|
1005
|
+
```php
|
|
1006
|
+
Bleet::drawer(string $id = 'drawer')
|
|
1007
|
+
// + AbstractWidget
|
|
1008
|
+
// Couleur par défaut : primary
|
|
1009
|
+
```
|
|
1010
|
+
|
|
1011
|
+
**Méthodes terminales :**
|
|
1012
|
+
|
|
1013
|
+
```php
|
|
1014
|
+
->trigger(?string $url = null): array
|
|
1015
|
+
->render(): string
|
|
1016
|
+
->asArray(): array
|
|
1017
|
+
```
|
|
1018
|
+
|
|
1019
|
+
### Toast
|
|
1020
|
+
|
|
1021
|
+
Custom element Aurelia : `<bleet-toast>`.
|
|
1022
|
+
|
|
1023
|
+
```php
|
|
1024
|
+
Bleet::toast()
|
|
1025
|
+
->id(string)
|
|
1026
|
+
->title(string)
|
|
1027
|
+
->content(string)
|
|
1028
|
+
->duration(int) // ms, 0 = pas d'auto-close
|
|
1029
|
+
->icon(UiIcon|string) // override auto-selection
|
|
1030
|
+
// + AbstractWidget
|
|
1031
|
+
// Couleur par défaut : info
|
|
1032
|
+
```
|
|
1033
|
+
|
|
1034
|
+
**Icônes auto selon couleur :**
|
|
1035
|
+
- success → check-circle
|
|
1036
|
+
- danger → x-circle
|
|
1037
|
+
- warning → exclamation-triangle
|
|
1038
|
+
- autres → information-circle
|
|
1039
|
+
|
|
1040
|
+
**Méthodes terminales :**
|
|
1041
|
+
|
|
1042
|
+
```php
|
|
1043
|
+
->trigger(): array // attributs pour bouton
|
|
1044
|
+
->render(): string // composant invisible (page load)
|
|
1045
|
+
->asArray(): array
|
|
1046
|
+
```
|
|
1047
|
+
|
|
1048
|
+
### Toaster
|
|
1049
|
+
|
|
1050
|
+
Container pour toasts. Une seule fois dans le layout.
|
|
1051
|
+
|
|
1052
|
+
```php
|
|
1053
|
+
Bleet::toaster()
|
|
1054
|
+
->id(string)
|
|
1055
|
+
->addClass(string...)
|
|
1056
|
+
// + AbstractWidget
|
|
1057
|
+
```
|
|
1058
|
+
|
|
1059
|
+
---
|
|
1060
|
+
|
|
1061
|
+
## Widgets Média
|
|
1062
|
+
|
|
1063
|
+
### Img
|
|
1064
|
+
|
|
1065
|
+
```php
|
|
1066
|
+
Bleet::img(string $src = '', string $alt = '')
|
|
1067
|
+
->src(string)
|
|
1068
|
+
->alt(string)
|
|
1069
|
+
->rounded()
|
|
1070
|
+
->resize(?int $width, ?int $height = null)
|
|
1071
|
+
->width(int)
|
|
1072
|
+
->height(int)
|
|
1073
|
+
->quality(int) // 0-100
|
|
1074
|
+
->rotate(float) // degrés, sens anti-horaire
|
|
1075
|
+
->greyscale()
|
|
1076
|
+
->watermark(string)
|
|
1077
|
+
->cache(bool) // défaut: true (sinon base64)
|
|
1078
|
+
->id(string)
|
|
1079
|
+
->addClass(string...)
|
|
1080
|
+
->attribute(string, mixed)
|
|
1081
|
+
// + AbstractWidget
|
|
1082
|
+
```
|
|
1083
|
+
|
|
1084
|
+
**Méthode spéciale :**
|
|
1085
|
+
|
|
1086
|
+
```php
|
|
1087
|
+
->url(): string // retourne l'URL ou data URI
|
|
1088
|
+
```
|
|
1089
|
+
|
|
1090
|
+
**Configuration statique :**
|
|
1091
|
+
|
|
1092
|
+
```php
|
|
1093
|
+
Img::setFileProvider(?FileProviderInterface $provider);
|
|
1094
|
+
Img::setCachePath(string $path, string $url);
|
|
1095
|
+
```
|
|
1096
|
+
|
|
1097
|
+
### File
|
|
1098
|
+
|
|
1099
|
+
```php
|
|
1100
|
+
Bleet::file(string $src = '')
|
|
1101
|
+
->src(string)
|
|
1102
|
+
->label(string)
|
|
1103
|
+
->cache(bool) // défaut: true
|
|
1104
|
+
->url(): string
|
|
1105
|
+
```
|
|
1106
|
+
|
|
1107
|
+
**Configuration statique :**
|
|
1108
|
+
|
|
1109
|
+
```php
|
|
1110
|
+
File::setFileProvider(?FileProviderInterface $provider);
|
|
1111
|
+
File::setCachePath(string $path, string $url);
|
|
1112
|
+
```
|
|
1113
|
+
|
|
1114
|
+
### Svg
|
|
1115
|
+
|
|
1116
|
+
**N'hérite PAS de AbstractWidget** — Classe autonome.
|
|
1117
|
+
|
|
1118
|
+
```php
|
|
1119
|
+
// Heroicons
|
|
1120
|
+
Svg::heroicon()
|
|
1121
|
+
->outline(string) // 24x24 outline
|
|
1122
|
+
->solid(string) // 24x24 solid
|
|
1123
|
+
->mini(string) // 20x20 solid
|
|
1124
|
+
->micro(string) // 16x16 solid
|
|
1125
|
+
|
|
1126
|
+
// Custom icons
|
|
1127
|
+
Svg::icon()
|
|
1128
|
+
->ui(string) // 24x24 custom
|
|
1129
|
+
->logo(string) // 200x200 custom
|
|
1130
|
+
|
|
1131
|
+
// Commun
|
|
1132
|
+
->id(string)
|
|
1133
|
+
->addClass(string...)
|
|
1134
|
+
->attribute(string, mixed)
|
|
1135
|
+
->attributes(array)
|
|
1136
|
+
```
|
|
1137
|
+
|
|
1138
|
+
**Alias via Bleet :**
|
|
1139
|
+
|
|
1140
|
+
```php
|
|
1141
|
+
Bleet::svg()->outline('chevron-right')->addClass('w-6', 'h-6')->render();
|
|
1142
|
+
```
|
|
1143
|
+
|
|
1144
|
+
---
|
|
1145
|
+
|
|
1146
|
+
## Widgets Profil
|
|
1147
|
+
|
|
1148
|
+
### Profile
|
|
1149
|
+
|
|
1150
|
+
```php
|
|
1151
|
+
Bleet::profile()
|
|
1152
|
+
->avatar(string|Img) // initiales ou image
|
|
1153
|
+
->name(string) // affiché en desktop
|
|
1154
|
+
->items(array) // [Anchor|Button]
|
|
1155
|
+
->addItem(Anchor|Button)
|
|
1156
|
+
->id(string)
|
|
1157
|
+
->addClass(string...)
|
|
1158
|
+
// + AbstractWidget
|
|
1159
|
+
```
|
|
1160
|
+
|
|
1161
|
+
---
|
|
1162
|
+
|
|
1163
|
+
## Helpers
|
|
1164
|
+
|
|
1165
|
+
### ActiveHelper
|
|
1166
|
+
|
|
1167
|
+
Helper pour générer noms/IDs d'input depuis les modèles.
|
|
1168
|
+
|
|
1169
|
+
```php
|
|
1170
|
+
namespace Blackcube\Bleet\Helper;
|
|
1171
|
+
|
|
1172
|
+
ActiveHelper::getInputName(FormModelInterface $model, string $attribute): string
|
|
1173
|
+
ActiveHelper::getInputId(FormModelInterface $model, string $attribute): string
|
|
1174
|
+
ActiveHelper::nameToId(string $name): string
|
|
1175
|
+
ActiveHelper::getAttributeName(string $attribute): string
|
|
1176
|
+
```
|
|
1177
|
+
|
|
1178
|
+
### Aurelia
|
|
1179
|
+
|
|
1180
|
+
Helper pour les attributs Aurelia.
|
|
1181
|
+
|
|
1182
|
+
```php
|
|
1183
|
+
namespace Blackcube\Bleet;
|
|
1184
|
+
|
|
1185
|
+
// Pour les custom elements
|
|
1186
|
+
Aurelia::attributesCustomElement(array $options): array
|
|
1187
|
+
|
|
1188
|
+
// Pour les custom attributes
|
|
1189
|
+
Aurelia::attributesCustomAttribute(array $options): string
|
|
1190
|
+
```
|
|
1191
|
+
|
|
1192
|
+
---
|
|
1193
|
+
|
|
1194
|
+
## Enums
|
|
1195
|
+
|
|
1196
|
+
### UiColor
|
|
1197
|
+
|
|
1198
|
+
```php
|
|
1199
|
+
namespace Blackcube\Bleet\Enum;
|
|
1200
|
+
|
|
1201
|
+
enum UiColor: string
|
|
1202
|
+
{
|
|
1203
|
+
case Primary = 'primary';
|
|
1204
|
+
case Secondary = 'secondary';
|
|
1205
|
+
case Success = 'success';
|
|
1206
|
+
case Danger = 'danger';
|
|
1207
|
+
case Warning = 'warning';
|
|
1208
|
+
case Info = 'info';
|
|
1209
|
+
case Accent = 'accent';
|
|
1210
|
+
}
|
|
1211
|
+
```
|
|
1212
|
+
|
|
1213
|
+
### UiIcon
|
|
1214
|
+
|
|
1215
|
+
```php
|
|
1216
|
+
namespace Blackcube\Bleet\Enum;
|
|
1217
|
+
|
|
1218
|
+
enum UiIcon: string
|
|
1219
|
+
{
|
|
1220
|
+
case Info = 'information-circle';
|
|
1221
|
+
case Success = 'check-circle';
|
|
1222
|
+
case Warning = 'exclamation-triangle';
|
|
1223
|
+
case Danger = 'x-circle';
|
|
1224
|
+
}
|
|
1225
|
+
```
|
|
1226
|
+
|
|
1227
|
+
### DialogAction
|
|
1228
|
+
|
|
1229
|
+
```php
|
|
1230
|
+
namespace Blackcube\Bleet\Enum;
|
|
1231
|
+
|
|
1232
|
+
enum DialogAction: string
|
|
1233
|
+
{
|
|
1234
|
+
case Keep = 'keep';
|
|
1235
|
+
case Close = 'close';
|
|
1236
|
+
}
|
|
1237
|
+
```
|
|
1238
|
+
|
|
1239
|
+
### AjaxifyAction
|
|
1240
|
+
|
|
1241
|
+
```php
|
|
1242
|
+
namespace Blackcube\Bleet\Enum;
|
|
1243
|
+
|
|
1244
|
+
enum AjaxifyAction: string
|
|
1245
|
+
{
|
|
1246
|
+
case Refresh = 'refresh';
|
|
1247
|
+
}
|
|
1248
|
+
```
|
|
1249
|
+
|
|
1250
|
+
---
|
|
1251
|
+
|
|
1252
|
+
## Interfaces
|
|
1253
|
+
|
|
1254
|
+
### WidgetInterface
|
|
1255
|
+
|
|
1256
|
+
```php
|
|
1257
|
+
namespace Blackcube\Bleet\Contracts;
|
|
1258
|
+
|
|
1259
|
+
interface WidgetInterface
|
|
1260
|
+
{
|
|
1261
|
+
public function render(): string;
|
|
1262
|
+
}
|
|
1263
|
+
```
|
|
1264
|
+
|
|
1265
|
+
---
|
|
1266
|
+
|
|
1267
|
+
## Traits
|
|
1268
|
+
|
|
1269
|
+
### BleetModelAwareTrait
|
|
1270
|
+
|
|
1271
|
+
Binding au FormModelInterface via `->active($model, 'property')`.
|
|
1272
|
+
|
|
1273
|
+
### BleetFieldDataTrait
|
|
1274
|
+
|
|
1275
|
+
Gestion des attributs `data-*` via `->fieldData(array)`.
|
|
1276
|
+
|
|
1277
|
+
### BleetColorTrait
|
|
1278
|
+
|
|
1279
|
+
Helpers couleur : `textColorClass()`, `textMutedColorClass()`, `inputColorClasses()`, `focusVisibleRingClasses()`.
|
|
1280
|
+
|
|
1281
|
+
### BleetExportableTrait
|
|
1282
|
+
|
|
1283
|
+
Export pour EA/AJAX via `->asArray()`.
|
|
1284
|
+
|
|
1285
|
+
### SlotCaptureTrait
|
|
1286
|
+
|
|
1287
|
+
Capture de contenu via `->beginSlot()` / `->endSlot()`.
|
|
1288
|
+
|
|
1289
|
+
### RenderViewTrait
|
|
1290
|
+
|
|
1291
|
+
Rendu de vues PHP via `->renderView(string $viewName, array $params)`.
|
|
1292
|
+
|
|
1293
|
+
---
|
|
1294
|
+
|
|
1295
|
+
## Conventions Bleet
|
|
1296
|
+
|
|
1297
|
+
### Règle prepareClasses()
|
|
1298
|
+
|
|
1299
|
+
Tous les widgets implémentent :
|
|
1300
|
+
|
|
1301
|
+
```php
|
|
1302
|
+
protected function prepareClasses(): array
|
|
1303
|
+
{
|
|
1304
|
+
$baseClasses = [...];
|
|
1305
|
+
$colorClasses = [...];
|
|
1306
|
+
$sizeClasses = [...];
|
|
1307
|
+
return [...$baseClasses, ...$colorClasses, ...$sizeClasses];
|
|
1308
|
+
}
|
|
1309
|
+
```
|
|
1310
|
+
|
|
1311
|
+
Classes séparées en base/color/size, spread variadic, pas de helper hack.
|
|
1312
|
+
|
|
1313
|
+
### Couleurs par défaut
|
|
1314
|
+
|
|
1315
|
+
| Widget | Couleur |
|
|
1316
|
+
|--------|---------|
|
|
1317
|
+
| Code, CardHeader, Footer, Drawer, DescriptionList, Figure, H1-H6 | primary |
|
|
1318
|
+
| Card, Checkbox, CheckboxList, Dropdown, Em, EmptyState, Input, Label, Paragraph, Radio, RadioList, Select, Strong, Textarea, Toggle, Upload, UnorderedList, OrderedList, ActivityFeed | secondary |
|
|
1319
|
+
| Del | danger |
|
|
1320
|
+
| Ins | success |
|
|
1321
|
+
| Mark, Badge | warning |
|
|
1322
|
+
| Alert, Toast | info |
|
|
1323
|
+
|
|
1324
|
+
### Widgets sans AbstractWidget
|
|
1325
|
+
|
|
1326
|
+
- ListItem
|
|
1327
|
+
- BreadcrumbItem
|
|
1328
|
+
- SidebarItem
|
|
1329
|
+
- TermItem
|
|
1330
|
+
- DetailItem
|
|
1331
|
+
- ActivityItem
|
|
1332
|
+
- TabPanel
|
|
1333
|
+
- Svg
|