@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,1037 @@
|
|
|
1
|
+
# Bleet TypeScript/Aurelia API Reference
|
|
2
|
+
|
|
3
|
+
Documentation des services, composants, attributs et interfaces Aurelia pour Bleet.
|
|
4
|
+
|
|
5
|
+
## Architecture
|
|
6
|
+
|
|
7
|
+
```
|
|
8
|
+
bleet/
|
|
9
|
+
├── services/ → Services DI singleton
|
|
10
|
+
├── components/ → Custom Elements <bleet-*>
|
|
11
|
+
├── attributes/ → Custom Attributes [bleet-*]
|
|
12
|
+
├── interfaces/ → Types TypeScript
|
|
13
|
+
├── enums/ → Constantes
|
|
14
|
+
└── configure.ts → Configuration
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
## Configuration
|
|
20
|
+
|
|
21
|
+
### BleetConfiguration
|
|
22
|
+
|
|
23
|
+
```typescript
|
|
24
|
+
import { BleetConfiguration } from 'bleet';
|
|
25
|
+
|
|
26
|
+
Aurelia.register(
|
|
27
|
+
BleetConfiguration.customize((config) => {
|
|
28
|
+
// Transport simple
|
|
29
|
+
config.transports = Transport.Http;
|
|
30
|
+
|
|
31
|
+
// Transport avec baseUrl
|
|
32
|
+
config.transports = { type: Transport.Http, baseUrl: '/api' };
|
|
33
|
+
|
|
34
|
+
// Transports multiples (fallback)
|
|
35
|
+
config.transports = [
|
|
36
|
+
{ type: Transport.Socketio, baseUrl: 'ws://localhost:3000' },
|
|
37
|
+
{ type: Transport.Http, baseUrl: '/api' }
|
|
38
|
+
];
|
|
39
|
+
|
|
40
|
+
// BaseUrl global (fallback)
|
|
41
|
+
config.baseUrl = '/api';
|
|
42
|
+
})
|
|
43
|
+
);
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
### IBleetConfiguration
|
|
47
|
+
|
|
48
|
+
```typescript
|
|
49
|
+
interface ConfigInterface {
|
|
50
|
+
transports?: TransportConfig;
|
|
51
|
+
baseUrl?: string;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
// Injection
|
|
55
|
+
constructor(private config: IBleetConfiguration = resolve(IBleetConfiguration)) {}
|
|
56
|
+
|
|
57
|
+
// API
|
|
58
|
+
config.getConfig(): ConfigInterface
|
|
59
|
+
config.get<T>(key: string): T
|
|
60
|
+
config.set<T>(key: string, val: T): T
|
|
61
|
+
config.getTransports(): Transport[]
|
|
62
|
+
config.getBaseUrl(transport: Transport): string
|
|
63
|
+
config.getTransport(type: Transport): ITransport | null
|
|
64
|
+
config.getAvailableTransports(): ITransport[]
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
---
|
|
68
|
+
|
|
69
|
+
## Services
|
|
70
|
+
|
|
71
|
+
### IApiService
|
|
72
|
+
|
|
73
|
+
Service principal pour les requêtes API avec pipeline codec, cache et fallback transport.
|
|
74
|
+
|
|
75
|
+
```typescript
|
|
76
|
+
import { IApiService } from 'bleet';
|
|
77
|
+
|
|
78
|
+
constructor(private api: IApiService = resolve(IApiService)) {}
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
#### API
|
|
82
|
+
|
|
83
|
+
```typescript
|
|
84
|
+
// Builder fluent
|
|
85
|
+
api.url(path: string, params?: Record<string, any>): ApiRequestBuilder
|
|
86
|
+
|
|
87
|
+
// Raccourci HTML (dialogs AJAX)
|
|
88
|
+
api.fetchHtml(url: string): Promise<IHttpResponse<string>>
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
#### ApiRequestBuilder
|
|
92
|
+
|
|
93
|
+
```typescript
|
|
94
|
+
api.url('/users/:id', { id: 42 })
|
|
95
|
+
// Query string
|
|
96
|
+
.queryString({ search: 'foo', page: 1 })
|
|
97
|
+
|
|
98
|
+
// Format entrée
|
|
99
|
+
.fromJson(data?) // Content-Type: application/json
|
|
100
|
+
.fromForm(data?) // Content-Type: application/x-www-form-urlencoded
|
|
101
|
+
.fromMultipart(formData?) // Content-Type: multipart/form-data
|
|
102
|
+
|
|
103
|
+
// Format sortie
|
|
104
|
+
.toJson() // Accept: application/json (défaut)
|
|
105
|
+
.toText() // Accept: text/plain
|
|
106
|
+
.toBlob() // Accept: application/octet-stream
|
|
107
|
+
.toXls() // Accept: application/vnd.openxmlformats...
|
|
108
|
+
.toArrayBuffer() // Accept: application/octet-stream
|
|
109
|
+
|
|
110
|
+
// Codecs
|
|
111
|
+
.withInputCodec(codec) // Transforme request avant envoi
|
|
112
|
+
.withOutputCodec(codec) // Transforme response après réception
|
|
113
|
+
|
|
114
|
+
// Options
|
|
115
|
+
.withPagination({ pageSize: 20, page: 1 })
|
|
116
|
+
.withCache({ ttl: 300, storage: 'session' | 'memory' })
|
|
117
|
+
|
|
118
|
+
// Exécution
|
|
119
|
+
.get<T>(): Promise<IHttpResponse<T>>
|
|
120
|
+
.post<T>(): Promise<IHttpResponse<T>>
|
|
121
|
+
.put<T>(): Promise<IHttpResponse<T>>
|
|
122
|
+
.patch<T>(): Promise<IHttpResponse<T>>
|
|
123
|
+
.delete<T>(): Promise<IHttpResponse<T>>
|
|
124
|
+
.request<T>(verb: string): Promise<IHttpResponse<T>>
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
#### Exemple
|
|
128
|
+
|
|
129
|
+
```typescript
|
|
130
|
+
// GET simple
|
|
131
|
+
const users = await this.api.url('/users').get<User[]>();
|
|
132
|
+
|
|
133
|
+
// POST avec données
|
|
134
|
+
const user = await this.api
|
|
135
|
+
.url('/users')
|
|
136
|
+
.fromJson({ name: 'John', email: 'john@example.com' })
|
|
137
|
+
.post<User>();
|
|
138
|
+
|
|
139
|
+
// GET avec path params
|
|
140
|
+
const user = await this.api
|
|
141
|
+
.url('/users/:id', { id: 42 })
|
|
142
|
+
.get<User>();
|
|
143
|
+
|
|
144
|
+
// Upload fichier
|
|
145
|
+
const result = await this.api
|
|
146
|
+
.url('/upload')
|
|
147
|
+
.fromMultipart(formData)
|
|
148
|
+
.post<UploadResult>();
|
|
149
|
+
|
|
150
|
+
// Avec cache
|
|
151
|
+
const data = await this.api
|
|
152
|
+
.url('/products')
|
|
153
|
+
.withCache({ ttl: 60, storage: 'session' })
|
|
154
|
+
.get<Product[]>();
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
---
|
|
158
|
+
|
|
159
|
+
### IHttpService
|
|
160
|
+
|
|
161
|
+
Transport HTTP via Fetch API. Implémente `ITransport`.
|
|
162
|
+
|
|
163
|
+
```typescript
|
|
164
|
+
import { IHttpService } from 'bleet';
|
|
165
|
+
|
|
166
|
+
// Automatiquement configuré avec :
|
|
167
|
+
// - X-Requested-With: XMLHttpRequest
|
|
168
|
+
// - credentials: include
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
---
|
|
172
|
+
|
|
173
|
+
### ISocketioService
|
|
174
|
+
|
|
175
|
+
Transport WebSocket via Socket.io. Implémente `ITransport`. Chargé à la demande.
|
|
176
|
+
|
|
177
|
+
```typescript
|
|
178
|
+
import { ISocketioService } from 'bleet';
|
|
179
|
+
|
|
180
|
+
constructor(private socket: ISocketioService = resolve(ISocketioService)) {}
|
|
181
|
+
|
|
182
|
+
// API
|
|
183
|
+
socket.connect(namespace?: string, options?: Record<string, any>): Promise<void>
|
|
184
|
+
socket.disconnect(): void
|
|
185
|
+
socket.isConnected(): boolean
|
|
186
|
+
socket.isAvailable(): boolean
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
**Note** : Requiert `npm install socket.io-client`.
|
|
190
|
+
|
|
191
|
+
---
|
|
192
|
+
|
|
193
|
+
### IStorageService
|
|
194
|
+
|
|
195
|
+
Wrapper localStorage avec JSON auto.
|
|
196
|
+
|
|
197
|
+
```typescript
|
|
198
|
+
import { IStorageService } from 'bleet';
|
|
199
|
+
|
|
200
|
+
constructor(private storage: IStorageService = resolve(IStorageService)) {}
|
|
201
|
+
|
|
202
|
+
storage.load(key: string, def?: any): any
|
|
203
|
+
storage.save(key: string, value: any): void
|
|
204
|
+
storage.remove(key: string): void
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
---
|
|
208
|
+
|
|
209
|
+
### ISvgService
|
|
210
|
+
|
|
211
|
+
Service d'icônes SVG intégrées.
|
|
212
|
+
|
|
213
|
+
```typescript
|
|
214
|
+
import { ISvgService } from 'bleet';
|
|
215
|
+
|
|
216
|
+
constructor(private svg: ISvgService = resolve(ISvgService)) {}
|
|
217
|
+
|
|
218
|
+
svg.get(icon: string): string | null // Retourne SVG ou icon tel quel
|
|
219
|
+
svg.has(key: string): boolean
|
|
220
|
+
```
|
|
221
|
+
|
|
222
|
+
**Icônes intégrées** : `information-circle`, `check-circle`, `exclamation-triangle`, `x-circle`, `x-mark`
|
|
223
|
+
|
|
224
|
+
---
|
|
225
|
+
|
|
226
|
+
### ITransitionService
|
|
227
|
+
|
|
228
|
+
Gestion des transitions CSS avec callback.
|
|
229
|
+
|
|
230
|
+
```typescript
|
|
231
|
+
import { ITransitionService } from 'bleet';
|
|
232
|
+
|
|
233
|
+
constructor(private transition: ITransitionService = resolve(ITransitionService)) {}
|
|
234
|
+
|
|
235
|
+
transition.securityTimeout: number // défaut: 2000ms
|
|
236
|
+
|
|
237
|
+
transition.run(
|
|
238
|
+
element: HTMLElement,
|
|
239
|
+
before: (e: HTMLElement) => void,
|
|
240
|
+
after?: (e: HTMLElement) => void
|
|
241
|
+
): void
|
|
242
|
+
```
|
|
243
|
+
|
|
244
|
+
---
|
|
245
|
+
|
|
246
|
+
### ITrapFocusService
|
|
247
|
+
|
|
248
|
+
Focus trap pour modals/drawers. **Transient** (nouvelle instance par injection).
|
|
249
|
+
|
|
250
|
+
```typescript
|
|
251
|
+
import { ITrapFocusService } from 'bleet';
|
|
252
|
+
|
|
253
|
+
constructor(private trap: ITrapFocusService = resolve(ITrapFocusService)) {}
|
|
254
|
+
|
|
255
|
+
trap.focusableElementsQuerySelector: string // Sélecteur éléments focusables
|
|
256
|
+
|
|
257
|
+
trap.start(
|
|
258
|
+
opener: HTMLElement, // Élément qui a ouvert (recevra le focus au stop)
|
|
259
|
+
target: HTMLElement, // Container du trap
|
|
260
|
+
globalElement: HTMLElement, // Pour détection clic extérieur
|
|
261
|
+
startCallback?: Function,
|
|
262
|
+
stopCallback?: Function,
|
|
263
|
+
initialFocusElement?: HTMLElement
|
|
264
|
+
): Promise<void>
|
|
265
|
+
|
|
266
|
+
trap.stop(): Promise<void>
|
|
267
|
+
```
|
|
268
|
+
|
|
269
|
+
**Raccourcis clavier** : Tab (loop), Shift+Tab (reverse), ArrowUp/Down (no loop), Escape (stop)
|
|
270
|
+
|
|
271
|
+
---
|
|
272
|
+
|
|
273
|
+
## Custom Elements
|
|
274
|
+
|
|
275
|
+
### <bleet-modal>
|
|
276
|
+
|
|
277
|
+
Modal AJAX avec chargement dynamique.
|
|
278
|
+
|
|
279
|
+
```html
|
|
280
|
+
<bleet-modal id="editUser"></bleet-modal>
|
|
281
|
+
```
|
|
282
|
+
|
|
283
|
+
```typescript
|
|
284
|
+
@bindable id: string = '';
|
|
285
|
+
```
|
|
286
|
+
|
|
287
|
+
**Cycle de vie** :
|
|
288
|
+
1. Écoute `Channels.Modal` pour `ModalAction.Open/Close/Toggle`
|
|
289
|
+
2. Charge URL via `IApiService`
|
|
290
|
+
3. Applique `IDialogResponse` (header/content/footer/actions)
|
|
291
|
+
4. Gère soumission formulaire automatiquement
|
|
292
|
+
|
|
293
|
+
**Fermeture** : `data-modal="close"` sur n'importe quel élément
|
|
294
|
+
|
|
295
|
+
---
|
|
296
|
+
|
|
297
|
+
### <bleet-drawer>
|
|
298
|
+
|
|
299
|
+
Drawer latéral AJAX (slide-in depuis la droite).
|
|
300
|
+
|
|
301
|
+
```html
|
|
302
|
+
<bleet-drawer id="settings"></bleet-drawer>
|
|
303
|
+
```
|
|
304
|
+
|
|
305
|
+
```typescript
|
|
306
|
+
@bindable id: string = '';
|
|
307
|
+
```
|
|
308
|
+
|
|
309
|
+
**Identique à modal** mais avec transition `translate-x`.
|
|
310
|
+
|
|
311
|
+
**Fermeture** : `data-drawer="close"` sur n'importe quel élément
|
|
312
|
+
|
|
313
|
+
---
|
|
314
|
+
|
|
315
|
+
### <bleet-overlay>
|
|
316
|
+
|
|
317
|
+
Fond semi-transparent pour modals/drawers.
|
|
318
|
+
|
|
319
|
+
```html
|
|
320
|
+
<bleet-overlay class="fixed inset-0 z-40 bg-black/50 hidden opacity-0 transition-opacity"></bleet-overlay>
|
|
321
|
+
```
|
|
322
|
+
|
|
323
|
+
Écoute `Channels.Overlay` pour `OverlayAction.Open/Close/Toggle`.
|
|
324
|
+
|
|
325
|
+
---
|
|
326
|
+
|
|
327
|
+
### <bleet-toaster>
|
|
328
|
+
|
|
329
|
+
Container pour toasts. Une seule instance dans le layout.
|
|
330
|
+
|
|
331
|
+
```html
|
|
332
|
+
<bleet-toaster></bleet-toaster>
|
|
333
|
+
```
|
|
334
|
+
|
|
335
|
+
Écoute `Channels.Toaster` pour `ToasterAction.Add/Remove`.
|
|
336
|
+
|
|
337
|
+
---
|
|
338
|
+
|
|
339
|
+
### <bleet-toast>
|
|
340
|
+
|
|
341
|
+
Toast individuel (géré par toaster).
|
|
342
|
+
|
|
343
|
+
```typescript
|
|
344
|
+
@bindable id: string = '';
|
|
345
|
+
@bindable color: UiColor = UiColor.Info;
|
|
346
|
+
@bindable icon: UiToastIcon = UiToastIcon.Info;
|
|
347
|
+
@bindable title: string = '';
|
|
348
|
+
@bindable content: string = '';
|
|
349
|
+
@bindable duration: number = 0; // 0 = pas d'auto-close
|
|
350
|
+
```
|
|
351
|
+
|
|
352
|
+
---
|
|
353
|
+
|
|
354
|
+
### <bleet-toaster-trigger>
|
|
355
|
+
|
|
356
|
+
Déclenche un toast au chargement de la page.
|
|
357
|
+
|
|
358
|
+
```html
|
|
359
|
+
<bleet-toaster-trigger
|
|
360
|
+
id="welcome"
|
|
361
|
+
color="success"
|
|
362
|
+
icon="check-circle"
|
|
363
|
+
title="Bienvenue"
|
|
364
|
+
content="Connexion réussie"
|
|
365
|
+
duration="5000"
|
|
366
|
+
></bleet-toaster-trigger>
|
|
367
|
+
```
|
|
368
|
+
|
|
369
|
+
---
|
|
370
|
+
|
|
371
|
+
### <bleet-ajaxify>
|
|
372
|
+
|
|
373
|
+
Zone rechargeable via AJAX.
|
|
374
|
+
|
|
375
|
+
```html
|
|
376
|
+
<bleet-ajaxify id="userList" url="/api/users/list"></bleet-ajaxify>
|
|
377
|
+
```
|
|
378
|
+
|
|
379
|
+
```typescript
|
|
380
|
+
@bindable id: string = '';
|
|
381
|
+
@bindable url?: string;
|
|
382
|
+
```
|
|
383
|
+
|
|
384
|
+
Écoute `Channels.Ajaxify` pour `AjaxifyAction.Refresh`.
|
|
385
|
+
|
|
386
|
+
---
|
|
387
|
+
|
|
388
|
+
## Custom Attributes
|
|
389
|
+
|
|
390
|
+
### [bleet-modal-trigger]
|
|
391
|
+
|
|
392
|
+
Déclenche l'ouverture d'un modal.
|
|
393
|
+
|
|
394
|
+
```html
|
|
395
|
+
<button bleet-modal-trigger="editUser" url="/modal/user/42">Modifier</button>
|
|
396
|
+
```
|
|
397
|
+
|
|
398
|
+
```typescript
|
|
399
|
+
@bindable({ primary: true }) id: string = '';
|
|
400
|
+
@bindable url: string = '';
|
|
401
|
+
@bindable color: string = 'primary';
|
|
402
|
+
```
|
|
403
|
+
|
|
404
|
+
---
|
|
405
|
+
|
|
406
|
+
### [bleet-drawer-trigger]
|
|
407
|
+
|
|
408
|
+
Déclenche l'ouverture d'un drawer.
|
|
409
|
+
|
|
410
|
+
```html
|
|
411
|
+
<button bleet-drawer-trigger="settings" url="/drawer/settings">Paramètres</button>
|
|
412
|
+
```
|
|
413
|
+
|
|
414
|
+
```typescript
|
|
415
|
+
@bindable({ primary: true }) id: string = '';
|
|
416
|
+
@bindable url: string = '';
|
|
417
|
+
@bindable color: string = 'primary';
|
|
418
|
+
```
|
|
419
|
+
|
|
420
|
+
---
|
|
421
|
+
|
|
422
|
+
### [bleet-toaster-trigger]
|
|
423
|
+
|
|
424
|
+
Déclenche un toast au clic.
|
|
425
|
+
|
|
426
|
+
```html
|
|
427
|
+
<button bleet-toaster-trigger="notif" color="success" content="Action réussie">Clic</button>
|
|
428
|
+
```
|
|
429
|
+
|
|
430
|
+
```typescript
|
|
431
|
+
@bindable({ primary: true }) id: string = '';
|
|
432
|
+
@bindable color: UiColor = UiColor.Info;
|
|
433
|
+
@bindable icon: UiToastIcon = UiToastIcon.Info;
|
|
434
|
+
@bindable title: string = '';
|
|
435
|
+
@bindable content: string = '';
|
|
436
|
+
@bindable duration: number = 0;
|
|
437
|
+
```
|
|
438
|
+
|
|
439
|
+
---
|
|
440
|
+
|
|
441
|
+
### [bleet-alert]
|
|
442
|
+
|
|
443
|
+
Gestion fermeture alert avec animation.
|
|
444
|
+
|
|
445
|
+
```html
|
|
446
|
+
<div bleet-alert class="transition-all overflow-hidden">
|
|
447
|
+
<button data-alert="close">×</button>
|
|
448
|
+
Contenu alert
|
|
449
|
+
</div>
|
|
450
|
+
```
|
|
451
|
+
|
|
452
|
+
**Fermeture** : `data-alert="close"` déclenche animation height→0 puis remove.
|
|
453
|
+
|
|
454
|
+
---
|
|
455
|
+
|
|
456
|
+
### [bleet-badge]
|
|
457
|
+
|
|
458
|
+
Badge avec bouton de suppression.
|
|
459
|
+
|
|
460
|
+
```html
|
|
461
|
+
<span bleet-badge="tag-1">
|
|
462
|
+
Tag
|
|
463
|
+
<button data-badge="remove">×</button>
|
|
464
|
+
</span>
|
|
465
|
+
```
|
|
466
|
+
|
|
467
|
+
```typescript
|
|
468
|
+
@bindable({ primary: true }) id: string = '';
|
|
469
|
+
```
|
|
470
|
+
|
|
471
|
+
Publie `Channels.Badge` avec `BadgeAction.Remove` puis `element.remove()`.
|
|
472
|
+
|
|
473
|
+
---
|
|
474
|
+
|
|
475
|
+
### [bleet-burger]
|
|
476
|
+
|
|
477
|
+
Bouton burger pour ouvrir le menu sidebar.
|
|
478
|
+
|
|
479
|
+
```html
|
|
480
|
+
<button bleet-burger>☰</button>
|
|
481
|
+
```
|
|
482
|
+
|
|
483
|
+
Publie `Channels.Menu` avec `MenuAction.Open`.
|
|
484
|
+
|
|
485
|
+
---
|
|
486
|
+
|
|
487
|
+
### [bleet-menu]
|
|
488
|
+
|
|
489
|
+
Sidebar avec sous-menus collapsibles.
|
|
490
|
+
|
|
491
|
+
```html
|
|
492
|
+
<nav bleet-menu class="-translate-x-full transition-transform">
|
|
493
|
+
<button data-menu="close">×</button>
|
|
494
|
+
<button data-menu="toggle-button-sub1">Section</button>
|
|
495
|
+
<ul data-menu="toggle-list-sub1" class="hidden">...</ul>
|
|
496
|
+
</nav>
|
|
497
|
+
```
|
|
498
|
+
|
|
499
|
+
**Data attributes** :
|
|
500
|
+
- `data-menu="close"` : Ferme le menu
|
|
501
|
+
- `data-menu="toggle-button-{id}"` : Toggle sous-menu
|
|
502
|
+
- `data-menu="toggle-list-{id}"` : Liste à toggle
|
|
503
|
+
- `data-menu="icon"` : Icône rotation (sur svg dans le button)
|
|
504
|
+
|
|
505
|
+
État des sous-menus persisté en localStorage.
|
|
506
|
+
|
|
507
|
+
---
|
|
508
|
+
|
|
509
|
+
### [bleet-profile]
|
|
510
|
+
|
|
511
|
+
Dropdown profil utilisateur avec focus trap.
|
|
512
|
+
|
|
513
|
+
```html
|
|
514
|
+
<div bleet-profile="user-menu">
|
|
515
|
+
<button data-profile="toggle">Avatar</button>
|
|
516
|
+
<div data-profile="panel" class="hidden">
|
|
517
|
+
<a href="/profile">Mon profil</a>
|
|
518
|
+
<a href="/logout">Déconnexion</a>
|
|
519
|
+
</div>
|
|
520
|
+
</div>
|
|
521
|
+
```
|
|
522
|
+
|
|
523
|
+
```typescript
|
|
524
|
+
@bindable({ primary: true }) id: string = '';
|
|
525
|
+
```
|
|
526
|
+
|
|
527
|
+
---
|
|
528
|
+
|
|
529
|
+
### [bleet-select]
|
|
530
|
+
|
|
531
|
+
Select custom avec panel dropdown.
|
|
532
|
+
|
|
533
|
+
```html
|
|
534
|
+
<div bleet-select>
|
|
535
|
+
<select class="sr-only">
|
|
536
|
+
<option value="1">Option 1</option>
|
|
537
|
+
<option value="2">Option 2</option>
|
|
538
|
+
</select>
|
|
539
|
+
<button>
|
|
540
|
+
<span data-select="value">Sélectionner</span>
|
|
541
|
+
</button>
|
|
542
|
+
<div data-select="items" class="hidden">
|
|
543
|
+
<template data-select="item-template">
|
|
544
|
+
<button data-value="">
|
|
545
|
+
<span data-select="item-text"></span>
|
|
546
|
+
<span data-select="item-check"></span>
|
|
547
|
+
</button>
|
|
548
|
+
</template>
|
|
549
|
+
</div>
|
|
550
|
+
</div>
|
|
551
|
+
```
|
|
552
|
+
|
|
553
|
+
**Data attributes** :
|
|
554
|
+
- `data-select="value"` : Texte affiché dans le bouton
|
|
555
|
+
- `data-select="items"` : Container des options
|
|
556
|
+
- `data-select="item-template"` : Template option
|
|
557
|
+
- `data-select="item-text"` : Texte option
|
|
558
|
+
- `data-select="item-check"` : Checkmark
|
|
559
|
+
- `data-value` : Valeur de l'option
|
|
560
|
+
- `data-class-active` / `data-class-inactive` : Classes à swap
|
|
561
|
+
|
|
562
|
+
---
|
|
563
|
+
|
|
564
|
+
### [bleet-dropdown]
|
|
565
|
+
|
|
566
|
+
Dropdown avancé avec recherche, multi-sélection, tags.
|
|
567
|
+
|
|
568
|
+
```html
|
|
569
|
+
<div bleet-dropdown>
|
|
570
|
+
<select multiple class="sr-only">...</select>
|
|
571
|
+
<button>
|
|
572
|
+
<span data-dropdown="placeholder">Sélectionner</span>
|
|
573
|
+
<span data-dropdown="value"></span>
|
|
574
|
+
<span data-dropdown="tags"></span>
|
|
575
|
+
</button>
|
|
576
|
+
<div data-dropdown="items" class="hidden">
|
|
577
|
+
<input data-dropdown="search" placeholder="Rechercher...">
|
|
578
|
+
<div data-dropdown="items-container"></div>
|
|
579
|
+
<div data-dropdown="empty" class="hidden">Aucun résultat</div>
|
|
580
|
+
<template data-dropdown="item-template">...</template>
|
|
581
|
+
<template data-dropdown="tag-template">
|
|
582
|
+
<span data-tag-value="">
|
|
583
|
+
<span data-dropdown="tag-text"></span>
|
|
584
|
+
<button data-dropdown="tag-remove">×</button>
|
|
585
|
+
</span>
|
|
586
|
+
</template>
|
|
587
|
+
</div>
|
|
588
|
+
</div>
|
|
589
|
+
```
|
|
590
|
+
|
|
591
|
+
Détecte automatiquement `multiple` et mode tags (présence de `tag-template`).
|
|
592
|
+
|
|
593
|
+
---
|
|
594
|
+
|
|
595
|
+
### [bleet-tabs]
|
|
596
|
+
|
|
597
|
+
Onglets avec synchronisation select mobile.
|
|
598
|
+
|
|
599
|
+
```html
|
|
600
|
+
<div bleet-tabs>
|
|
601
|
+
<select class="sm:hidden">
|
|
602
|
+
<option value="0">Tab 1</option>
|
|
603
|
+
<option value="1">Tab 2</option>
|
|
604
|
+
</select>
|
|
605
|
+
<div class="hidden sm:block">
|
|
606
|
+
<button data-tabs="tab-0" aria-selected="true">Tab 1</button>
|
|
607
|
+
<button data-tabs="tab-1" aria-selected="false">Tab 2</button>
|
|
608
|
+
</div>
|
|
609
|
+
<div data-tabs="panel-0">Contenu 1</div>
|
|
610
|
+
<div data-tabs="panel-1" class="hidden">Contenu 2</div>
|
|
611
|
+
</div>
|
|
612
|
+
```
|
|
613
|
+
|
|
614
|
+
---
|
|
615
|
+
|
|
616
|
+
### [bleet-pager]
|
|
617
|
+
|
|
618
|
+
Pagination avec select mobile.
|
|
619
|
+
|
|
620
|
+
```html
|
|
621
|
+
<div bleet-pager>
|
|
622
|
+
<select data-pager="select">
|
|
623
|
+
<option value="1">Page 1</option>
|
|
624
|
+
<option value="2">Page 2</option>
|
|
625
|
+
</select>
|
|
626
|
+
<a data-pager="page-1" href="?page=1">1</a>
|
|
627
|
+
<a data-pager="page-2" href="?page=2">2</a>
|
|
628
|
+
</div>
|
|
629
|
+
```
|
|
630
|
+
|
|
631
|
+
---
|
|
632
|
+
|
|
633
|
+
### [bleet-password]
|
|
634
|
+
|
|
635
|
+
Toggle show/hide password.
|
|
636
|
+
|
|
637
|
+
```html
|
|
638
|
+
<div bleet-password>
|
|
639
|
+
<input type="password">
|
|
640
|
+
<button data-password="toggle">
|
|
641
|
+
<svg data-password="icon-hidden">👁</svg>
|
|
642
|
+
<svg data-password="icon-visible" class="hidden">👁🗨</svg>
|
|
643
|
+
</button>
|
|
644
|
+
</div>
|
|
645
|
+
```
|
|
646
|
+
|
|
647
|
+
---
|
|
648
|
+
|
|
649
|
+
### [bleet-upload]
|
|
650
|
+
|
|
651
|
+
Upload fichier avec Resumable.js (chunked).
|
|
652
|
+
|
|
653
|
+
```html
|
|
654
|
+
<div bleet-upload
|
|
655
|
+
endpoint="/api/upload"
|
|
656
|
+
preview-endpoint="/api/files/{name}"
|
|
657
|
+
delete-endpoint="/api/files/{name}"
|
|
658
|
+
accept="jpg,png,pdf"
|
|
659
|
+
max-files="5"
|
|
660
|
+
chunk-size="1048576">
|
|
661
|
+
<input type="hidden" name="files" value="">
|
|
662
|
+
</div>
|
|
663
|
+
```
|
|
664
|
+
|
|
665
|
+
```typescript
|
|
666
|
+
@bindable endpoint: string = '';
|
|
667
|
+
@bindable previewEndpoint: string = '';
|
|
668
|
+
@bindable deleteEndpoint: string = '';
|
|
669
|
+
@bindable accept: string = ''; // Extensions séparées par virgule
|
|
670
|
+
@bindable maxFiles: number = 1;
|
|
671
|
+
@bindable chunkSize: number = 1048576; // 1MB
|
|
672
|
+
```
|
|
673
|
+
|
|
674
|
+
---
|
|
675
|
+
|
|
676
|
+
### [bleet-ajaxify-trigger]
|
|
677
|
+
|
|
678
|
+
Trigger AJAX générique pour formulaires partiels.
|
|
679
|
+
|
|
680
|
+
```html
|
|
681
|
+
<form action="/api/items" method="POST">
|
|
682
|
+
<input type="hidden" name="_csrf" value="...">
|
|
683
|
+
|
|
684
|
+
<div bleet-ajaxify-trigger url="/api/item/toggle" verb="POST" id="toggle-1">
|
|
685
|
+
<input type="checkbox" name="active" value="1">
|
|
686
|
+
</div>
|
|
687
|
+
</form>
|
|
688
|
+
```
|
|
689
|
+
|
|
690
|
+
```typescript
|
|
691
|
+
@bindable({ primary: true }) url: string = '';
|
|
692
|
+
@bindable verb: string = ''; // Défaut: form.method ou POST
|
|
693
|
+
@bindable event: string = 'click'; // Événement déclencheur
|
|
694
|
+
@bindable id: string = ''; // Pour collecter inputs data-ajaxify="{id}"
|
|
695
|
+
```
|
|
696
|
+
|
|
697
|
+
**Réponse** : `IAjaxifyResponse` avec `element` (HTML pour sync), `toast`, `ajaxify`.
|
|
698
|
+
|
|
699
|
+
---
|
|
700
|
+
|
|
701
|
+
## Interfaces
|
|
702
|
+
|
|
703
|
+
### IHttpRequest
|
|
704
|
+
|
|
705
|
+
```typescript
|
|
706
|
+
interface IHttpRequest<T = any> {
|
|
707
|
+
url: string;
|
|
708
|
+
method: string;
|
|
709
|
+
headers: Record<string, string>;
|
|
710
|
+
data?: T;
|
|
711
|
+
pathParams?: Record<string, any>;
|
|
712
|
+
}
|
|
713
|
+
```
|
|
714
|
+
|
|
715
|
+
### IHttpResponse
|
|
716
|
+
|
|
717
|
+
```typescript
|
|
718
|
+
interface IHttpResponse<T = any> {
|
|
719
|
+
statusCode: number;
|
|
720
|
+
headers: Record<string, string>;
|
|
721
|
+
body: T;
|
|
722
|
+
pagination?: IPagination;
|
|
723
|
+
}
|
|
724
|
+
```
|
|
725
|
+
|
|
726
|
+
### IPagination
|
|
727
|
+
|
|
728
|
+
```typescript
|
|
729
|
+
interface IPagination {
|
|
730
|
+
page: number;
|
|
731
|
+
pageCount: number;
|
|
732
|
+
pageSize: number;
|
|
733
|
+
totalCount: number;
|
|
734
|
+
}
|
|
735
|
+
```
|
|
736
|
+
|
|
737
|
+
### ICodec
|
|
738
|
+
|
|
739
|
+
```typescript
|
|
740
|
+
interface ICodec<TIn = any, TOut = any> {
|
|
741
|
+
encode?: (ctx: IHttpRequest<TIn>) => Promise<IHttpRequest<TIn>>;
|
|
742
|
+
decode?: (ctx: IHttpResponse<TOut>) => Promise<IHttpResponse<TOut>>;
|
|
743
|
+
}
|
|
744
|
+
```
|
|
745
|
+
|
|
746
|
+
### ITransport
|
|
747
|
+
|
|
748
|
+
```typescript
|
|
749
|
+
interface ITransport {
|
|
750
|
+
readonly type: Transport;
|
|
751
|
+
isAvailable(): boolean;
|
|
752
|
+
prepareRequest(ctx: IHttpRequest): IHttpRequest;
|
|
753
|
+
execute<T>(ctx: IHttpRequest, responseType?: string): Promise<IHttpResponse<T>>;
|
|
754
|
+
}
|
|
755
|
+
```
|
|
756
|
+
|
|
757
|
+
### IDialogResponse
|
|
758
|
+
|
|
759
|
+
Réponse serveur pour modal/drawer.
|
|
760
|
+
|
|
761
|
+
```typescript
|
|
762
|
+
interface IDialogResponse {
|
|
763
|
+
// Style
|
|
764
|
+
color?: UiColor;
|
|
765
|
+
icon?: string | null;
|
|
766
|
+
|
|
767
|
+
// Contenu HTML
|
|
768
|
+
header?: string;
|
|
769
|
+
content?: string;
|
|
770
|
+
footer?: string;
|
|
771
|
+
|
|
772
|
+
// Action primaire (obligatoire)
|
|
773
|
+
action: DialogAction; // 'keep' | 'close'
|
|
774
|
+
|
|
775
|
+
// Actions secondaires (combinables)
|
|
776
|
+
toast?: IToast;
|
|
777
|
+
ajaxify?: IAjaxify;
|
|
778
|
+
redirect?: string;
|
|
779
|
+
refresh?: boolean;
|
|
780
|
+
}
|
|
781
|
+
```
|
|
782
|
+
|
|
783
|
+
### IToast
|
|
784
|
+
|
|
785
|
+
```typescript
|
|
786
|
+
interface IToast {
|
|
787
|
+
id?: string;
|
|
788
|
+
icon?: UiToastIcon;
|
|
789
|
+
color: UiColor;
|
|
790
|
+
title?: string;
|
|
791
|
+
content: string;
|
|
792
|
+
duration?: number; // ms, 0 = pas d'auto-close
|
|
793
|
+
}
|
|
794
|
+
```
|
|
795
|
+
|
|
796
|
+
### IAjaxify
|
|
797
|
+
|
|
798
|
+
```typescript
|
|
799
|
+
interface IAjaxify {
|
|
800
|
+
action: AjaxifyAction; // 'refresh'
|
|
801
|
+
id?: string;
|
|
802
|
+
url?: string;
|
|
803
|
+
}
|
|
804
|
+
```
|
|
805
|
+
|
|
806
|
+
### IAjaxifyResponse
|
|
807
|
+
|
|
808
|
+
```typescript
|
|
809
|
+
interface IAjaxifyResponse {
|
|
810
|
+
element?: string; // HTML pour remplacer l'élément
|
|
811
|
+
checked?: boolean;
|
|
812
|
+
toast?: IToast;
|
|
813
|
+
ajaxify?: IAjaxify;
|
|
814
|
+
}
|
|
815
|
+
```
|
|
816
|
+
|
|
817
|
+
---
|
|
818
|
+
|
|
819
|
+
## Enums
|
|
820
|
+
|
|
821
|
+
### Transport
|
|
822
|
+
|
|
823
|
+
```typescript
|
|
824
|
+
enum Transport {
|
|
825
|
+
Socketio = 'socketio',
|
|
826
|
+
Http = 'http',
|
|
827
|
+
}
|
|
828
|
+
```
|
|
829
|
+
|
|
830
|
+
### Channels (Event Aggregator)
|
|
831
|
+
|
|
832
|
+
```typescript
|
|
833
|
+
enum Channels {
|
|
834
|
+
Overlay = 'bleet:overlay',
|
|
835
|
+
OverlayStatus = 'bleet:overlay:status',
|
|
836
|
+
Modal = 'bleet:modal',
|
|
837
|
+
ModalStatus = 'bleet:modal:status',
|
|
838
|
+
Drawer = 'bleet:drawer',
|
|
839
|
+
DrawerStatus = 'bleet:drawer:status',
|
|
840
|
+
Toaster = 'bleet:toaster',
|
|
841
|
+
ToasterStatus = 'bleet:toaster:status',
|
|
842
|
+
Menu = 'bleet:menu',
|
|
843
|
+
MenuStatus = 'bleet:menu:status',
|
|
844
|
+
Badge = 'bleet:badge',
|
|
845
|
+
Profile = 'bleet:profile',
|
|
846
|
+
ProfileStatus = 'bleet:profile:status',
|
|
847
|
+
Ajaxify = 'bleet:ajaxify',
|
|
848
|
+
}
|
|
849
|
+
```
|
|
850
|
+
|
|
851
|
+
### Actions
|
|
852
|
+
|
|
853
|
+
```typescript
|
|
854
|
+
enum OverlayAction { Open, Close, Toggle }
|
|
855
|
+
enum ModalAction { Open, Close, Toggle }
|
|
856
|
+
enum DrawerAction { Open, Close, Toggle }
|
|
857
|
+
enum MenuAction { Open, Close, Toggle }
|
|
858
|
+
enum ProfileAction { Open, Close, Toggle }
|
|
859
|
+
enum ToasterAction { Add, Remove }
|
|
860
|
+
enum BadgeAction { Remove }
|
|
861
|
+
enum AjaxifyAction { Refresh }
|
|
862
|
+
enum DialogAction { Keep, Close }
|
|
863
|
+
```
|
|
864
|
+
|
|
865
|
+
### Status
|
|
866
|
+
|
|
867
|
+
```typescript
|
|
868
|
+
enum OverlayStatus { Opening, Closing, Opened, Closed }
|
|
869
|
+
enum ModalStatus { Opening, Closing, Opened, Closed }
|
|
870
|
+
enum DrawerStatus { Opening, Closing, Opened, Closed }
|
|
871
|
+
enum MenuStatus { Opening, Closing, Opened, Closed }
|
|
872
|
+
enum ProfileStatus { Opening, Closing, Opened, Closed }
|
|
873
|
+
enum ToasterStatus { Added, Removed }
|
|
874
|
+
```
|
|
875
|
+
|
|
876
|
+
### UiColor
|
|
877
|
+
|
|
878
|
+
```typescript
|
|
879
|
+
enum UiColor {
|
|
880
|
+
Primary = 'primary',
|
|
881
|
+
Secondary = 'secondary',
|
|
882
|
+
Success = 'success',
|
|
883
|
+
Danger = 'danger',
|
|
884
|
+
Warning = 'warning',
|
|
885
|
+
Info = 'info',
|
|
886
|
+
Accent = 'accent',
|
|
887
|
+
}
|
|
888
|
+
```
|
|
889
|
+
|
|
890
|
+
### UiIcon / UiToastIcon
|
|
891
|
+
|
|
892
|
+
```typescript
|
|
893
|
+
enum UiToastIcon {
|
|
894
|
+
Info = 'information-circle',
|
|
895
|
+
Success = 'check-circle',
|
|
896
|
+
Warning = 'exclamation-triangle',
|
|
897
|
+
Danger = 'x-circle',
|
|
898
|
+
}
|
|
899
|
+
|
|
900
|
+
enum UiIcon {
|
|
901
|
+
// Alias courts
|
|
902
|
+
Info = 'information-circle',
|
|
903
|
+
Success = 'check-circle',
|
|
904
|
+
Warning = 'exclamation-triangle',
|
|
905
|
+
Danger = 'x-circle',
|
|
906
|
+
// Alias longs (match heroicon)
|
|
907
|
+
InformationCircle = 'information-circle',
|
|
908
|
+
CheckCircle = 'check-circle',
|
|
909
|
+
ExclamationTriangle = 'exclamation-triangle',
|
|
910
|
+
XCircle = 'x-circle',
|
|
911
|
+
}
|
|
912
|
+
```
|
|
913
|
+
|
|
914
|
+
---
|
|
915
|
+
|
|
916
|
+
## Codecs
|
|
917
|
+
|
|
918
|
+
### RequestCodec
|
|
919
|
+
|
|
920
|
+
Ajoute `X-Requested-With: XMLHttpRequest`.
|
|
921
|
+
|
|
922
|
+
```typescript
|
|
923
|
+
import { RequestCodec } from 'bleet/codecs/request-codec';
|
|
924
|
+
|
|
925
|
+
api.url('/endpoint')
|
|
926
|
+
.withInputCodec(RequestCodec.codec)
|
|
927
|
+
.get();
|
|
928
|
+
```
|
|
929
|
+
|
|
930
|
+
---
|
|
931
|
+
|
|
932
|
+
## Usage PHP avec Aurelia
|
|
933
|
+
|
|
934
|
+
### Attributs générés par PHP
|
|
935
|
+
|
|
936
|
+
Les widgets PHP génèrent des attributs pour Aurelia via :
|
|
937
|
+
|
|
938
|
+
```php
|
|
939
|
+
use Blackcube\Bleet\Aurelia;
|
|
940
|
+
|
|
941
|
+
// Custom attributes (string JSON)
|
|
942
|
+
Aurelia::attributesCustomAttribute(array $options): string
|
|
943
|
+
|
|
944
|
+
// Custom elements (array pour Html::tag)
|
|
945
|
+
Aurelia::attributesCustomElement(array $options): array
|
|
946
|
+
```
|
|
947
|
+
|
|
948
|
+
### Exemples
|
|
949
|
+
|
|
950
|
+
```php
|
|
951
|
+
// Modal trigger
|
|
952
|
+
Bleet::button('Modifier')
|
|
953
|
+
->attributes(Bleet::modal('editUser')->trigger('/api/user/42'))
|
|
954
|
+
->render();
|
|
955
|
+
// Génère: <button bleet-modal-trigger="editUser" url="/api/user/42">
|
|
956
|
+
|
|
957
|
+
// Toast trigger
|
|
958
|
+
Bleet::toast()
|
|
959
|
+
->id('welcome')
|
|
960
|
+
->color(UiColor::Success)
|
|
961
|
+
->title('Bienvenue')
|
|
962
|
+
->content('Connexion réussie')
|
|
963
|
+
->duration(5000)
|
|
964
|
+
->render();
|
|
965
|
+
// Génère: <bleet-toaster-trigger id="welcome" color="success" ...>
|
|
966
|
+
|
|
967
|
+
// Drawer trigger
|
|
968
|
+
Bleet::button('Paramètres')
|
|
969
|
+
->attributes(Bleet::drawer('settings')->trigger('/api/settings'))
|
|
970
|
+
->render();
|
|
971
|
+
// Génère: <button bleet-drawer-trigger="settings" url="/api/settings">
|
|
972
|
+
```
|
|
973
|
+
|
|
974
|
+
---
|
|
975
|
+
|
|
976
|
+
## Exports
|
|
977
|
+
|
|
978
|
+
```typescript
|
|
979
|
+
// Attributes
|
|
980
|
+
BleetAlertCustomAttribute
|
|
981
|
+
BleetBadgeCustomAttribute
|
|
982
|
+
BleetBurgerCustomAttribute
|
|
983
|
+
BleetDrawerTriggerCustomAttribute
|
|
984
|
+
BleetDropdownCustomAttribute
|
|
985
|
+
BleetMenuCustomAttribute
|
|
986
|
+
BleetModalTriggerCustomAttribute
|
|
987
|
+
BleetPagerCustomAttribute
|
|
988
|
+
BleetPasswordCustomAttribute
|
|
989
|
+
BleetProfileCustomAttribute
|
|
990
|
+
BleetSelectCustomAttribute
|
|
991
|
+
BleetTabsCustomAttribute
|
|
992
|
+
BleetToasterTriggerCustomAttribute
|
|
993
|
+
BleetUploadCustomAttribute
|
|
994
|
+
BleetAjaxifyTriggerCustomAttribute
|
|
995
|
+
|
|
996
|
+
// Components
|
|
997
|
+
BleetOverlay
|
|
998
|
+
BleetToast
|
|
999
|
+
BleetToaster
|
|
1000
|
+
BleetToasterTrigger
|
|
1001
|
+
BleetModal
|
|
1002
|
+
BleetDrawer
|
|
1003
|
+
BleetAjaxify
|
|
1004
|
+
|
|
1005
|
+
// Services
|
|
1006
|
+
IHttpService
|
|
1007
|
+
IApiService
|
|
1008
|
+
ISocketioService
|
|
1009
|
+
IStorageService
|
|
1010
|
+
ITransitionService
|
|
1011
|
+
ITrapFocusService
|
|
1012
|
+
ISvgService
|
|
1013
|
+
|
|
1014
|
+
// Enums
|
|
1015
|
+
Channels, Transport
|
|
1016
|
+
OverlayAction, OverlayStatus
|
|
1017
|
+
ModalAction, ModalStatus
|
|
1018
|
+
DrawerAction, DrawerStatus
|
|
1019
|
+
ToasterAction, ToasterStatus
|
|
1020
|
+
MenuAction, MenuStatus
|
|
1021
|
+
ProfileAction, ProfileStatus
|
|
1022
|
+
BadgeAction, AjaxifyAction
|
|
1023
|
+
DialogAction
|
|
1024
|
+
UiColor, UiToastIcon, UiIcon
|
|
1025
|
+
|
|
1026
|
+
// Interfaces
|
|
1027
|
+
ITransport
|
|
1028
|
+
IOverlay, IOverlayStatus
|
|
1029
|
+
IModal, IModalStatus
|
|
1030
|
+
IDrawer, IDrawerStatus
|
|
1031
|
+
IToaster, IToasterStatus, IToast
|
|
1032
|
+
IMenu, IMenuStatus
|
|
1033
|
+
IBadge
|
|
1034
|
+
IProfile, IProfileStatus
|
|
1035
|
+
IDialogResponse
|
|
1036
|
+
IAjaxify, IAjaxifyResponse
|
|
1037
|
+
```
|