@starterlib/ui 0.3.0 → 0.5.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.
@@ -1,6 +1,6 @@
1
1
  import * as i0 from '@angular/core';
2
- import { InjectionToken, inject, LOCALE_ID, signal, input, computed, ChangeDetectionStrategy, Component, booleanAttribute, ElementRef, DestroyRef, output, model, afterNextRender, effect, TemplateRef, Directive, contentChild, linkedSignal, isDevMode } from '@angular/core';
3
- import { masquerIban, masquerTelephone, masquerCarte, quatreDerniers, formaterIban, formaterMontant, CHOIX_DE_THEME, LANGUES } from '@starterlib/util';
2
+ import { InjectionToken, inject, LOCALE_ID, signal, input, computed, ChangeDetectionStrategy, Component, booleanAttribute, ElementRef, DestroyRef, output, model, afterNextRender, viewChild, Directive, effect, Injector, linkedSignal, TemplateRef, contentChildren, contentChild, isDevMode } from '@angular/core';
3
+ import { masquerIban, masquerTelephone, masquerCarte, quatreDerniers, formaterIban, formaterMontant, formaterTaille, formaterDateLongue, montant, decimalesDe, motifDeDate, formaterDateSaisie, ibanEstValide, normaliserTelephone, typeDeFichierAccepte, normaliserIban, bornerDate, premierJourDeLaSemaine, ajouterJours, semainesDuMois, ajouterMois, jourDeLaSemaine, CHOIX_DE_THEME, LANGUES } from '@starterlib/util';
4
4
  export { ETATS_DE_BLOC } from '@starterlib/util';
5
5
  import { DOCUMENT, NgTemplateOutlet } from '@angular/common';
6
6
  import { RouterLink } from '@angular/router';
@@ -56,7 +56,87 @@ const LIBELLES_FR = {
56
56
  sessionExpireDans: (duree) => `Sans activit\u00e9 de votre part, la session sera ferm\u00e9e dans ${duree}.`,
57
57
  resterConnecte: 'Rester connect\u00e9',
58
58
  seDeconnecter: 'Se d\u00e9connecter',
59
+ obligatoire: '(obligatoire)',
60
+ champObligatoire: 'Ce champ est obligatoire.',
61
+ valeurInvalide: 'Cette valeur n\u2019est pas valide.',
62
+ adresseInvalide: 'Saisissez une adresse \u00e9lectronique, par exemple nom@exemple.fr.',
63
+ formatInvalide: 'Le format n\u2019est pas valide.',
64
+ longueurMinimale: (minimum) => `Saisissez au moins ${String(minimum)} caract\u00e8res.`,
65
+ longueurMaximale: (maximum) => `Saisissez au plus ${String(maximum)} caract\u00e8res.`,
66
+ valeurMinimale: (minimum) => `La valeur doit \u00eatre au moins ${minimum}.`,
67
+ valeurMaximale: (maximum) => `La valeur doit \u00eatre au plus ${maximum}.`,
68
+ caracteresRestants: (restants) => restants <= 1
69
+ ? `${String(restants)} caract\u00e8re restant`
70
+ : `${String(restants)} caract\u00e8res restants`,
71
+ caracteresEnTrop: (enTrop) => enTrop === 1 ? '1 caract\u00e8re en trop' : `${String(enTrop)} caract\u00e8res en trop`,
72
+ erreursACorriger: (nombre) => nombre === 1 ? 'Une erreur \u00e0 corriger' : `${String(nombre)} erreurs \u00e0 corriger`,
73
+ afficherLeMotDePasse: 'Afficher le mot de passe',
74
+ codeAChiffres: (longueur) => `Code \u00e0 ${String(longueur)} chiffres.`,
75
+ ibanInvalide: 'Saisissez un IBAN valide.',
76
+ telephoneInvalide: 'Saisissez un num\u00e9ro de t\u00e9l\u00e9phone en chiffres, avec l\u2019indicatif du pays pour un num\u00e9ro \u00e9tranger.',
77
+ exempleDIban: 'Par exemple FR76 3000 6000 0112 3456 7890 189.',
78
+ rechercher: 'Rechercher',
59
79
  fermerLeMessage: 'Fermer le message',
80
+ montantIllisible: (exemple) => `Saisissez un montant en chiffres, par exemple ${exemple}.`,
81
+ tropDeDecimales: (decimales) => decimales === 0
82
+ ? 'Saisissez un montant sans d\u00e9cimales.'
83
+ : `Saisissez au plus ${String(decimales)} d\u00e9cimale${decimales > 1 ? 's' : ''}.`,
84
+ deviseDuMontant: (devise) => `Devise\u00a0: ${devise}.`,
85
+ lettreDuJour: 'jj',
86
+ lettreDuMois: 'mm',
87
+ lettreDeLAnnee: 'aaaa',
88
+ formatDeDate: (motif, exemple) => `Au format ${motif}, par exemple ${exemple}.`,
89
+ dateIllisible: (motif, exemple) => `Saisissez une date qui existe, au format ${motif}, par exemple ${exemple}.`,
90
+ dateTropTot: (date) => `Saisissez une date \u00e0 partir du ${date}.`,
91
+ dateTropTard: (date) => `Saisissez une date jusqu\u2019au ${date}.`,
92
+ finAvantDebut: 'La date de fin ne peut pas pr\u00e9c\u00e9der la date de d\u00e9but.',
93
+ dateDeDebut: 'Date de d\u00e9but',
94
+ dateDeFin: 'Date de fin',
95
+ choisirDansLeCalendrier: (champ) => `${champ}\u00a0: choisir dans le calendrier`,
96
+ moisPrecedent: 'Mois pr\u00e9c\u00e9dent',
97
+ moisSuivant: 'Mois suivant',
98
+ aideDuCalendrier: 'Fl\u00e8ches pour changer de jour, Page pr\u00e9c\u00e9dente et Page suivante pour changer de mois, \u00c9chap pour fermer.',
99
+ choisir: 'Choisir\u2026',
100
+ nombreDeResultats: (nombre) => nombre === 0
101
+ ? 'Aucun r\u00e9sultat'
102
+ : `${String(nombre)} r\u00e9sultat${nombre > 1 ? 's' : ''}`,
103
+ nombreDeSelections: (nombre) => (nombre === 0 ? 'Aucun choix' : `${String(nombre)} choix`),
104
+ retirerLeChoix: (choix) => `Retirer ${choix}`,
105
+ afficherLesChoix: (champ) => `${champ}\u00a0: afficher les choix`,
106
+ choisirDesFichiers: 'Choisir des fichiers',
107
+ choisirUnFichier: 'Choisir un fichier',
108
+ ouDeposerIci: 'ou d\u00e9posez-les ici',
109
+ aucunFichier: 'Aucun fichier choisi.',
110
+ nombreDeFichiers: (nombre) => nombre === 0
111
+ ? 'Aucun fichier choisi.'
112
+ : `${String(nombre)} fichier${nombre > 1 ? 's' : ''} choisi${nombre > 1 ? 's' : ''}.`,
113
+ retirerLeFichier: (fichier) => `Retirer ${fichier}`,
114
+ fichierTropVolumineux: (fichier, taille) => `${fichier} d\u00e9passe ${taille}.`,
115
+ typeDeFichierRefuse: (fichier) => `${fichier} n\u2019est pas d\u2019un type accept\u00e9.`,
116
+ tropDeFichiers: (nombre) => `Choisissez au plus ${String(nombre)} fichier${nombre > 1 ? 's' : ''}.`,
117
+ typesAcceptes: (types) => `Types accept\u00e9s\u00a0: ${types}.`,
118
+ tailleMaximale: (taille) => `${taille} au plus par fichier.`,
119
+ pagination: 'Pagination',
120
+ pagePrecedente: 'Page pr\u00e9c\u00e9dente',
121
+ pageSuivante: 'Page suivante',
122
+ pageNumero: (numero) => `Page ${String(numero)}`,
123
+ afficherPlus: 'Afficher plus',
124
+ lignesParPage: 'Lignes par page',
125
+ selectionnerLaPage: (nombre) => `S\u00e9lectionner les ${String(nombre)} lignes de la page`,
126
+ selectionnerLaLigne: (ligne) => `S\u00e9lectionner ${ligne}`,
127
+ lignesSelectionnees: (nombre) => nombre === 0
128
+ ? 'Aucune ligne s\u00e9lectionn\u00e9e'
129
+ : `${String(nombre)} ligne${nombre > 1 ? 's' : ''} s\u00e9lectionn\u00e9e${nombre > 1 ? 's' : ''}`,
130
+ trieCroissant: (colonne) => `Tri\u00e9 par ${colonne}, ordre croissant`,
131
+ trieDecroissant: (colonne) => `Tri\u00e9 par ${colonne}, ordre d\u00e9croissant`,
132
+ tableauVide: 'Aucune ligne \u00e0 afficher.',
133
+ nonRenseigne: 'Non renseign\u00e9',
134
+ filtres: 'Filtres',
135
+ filtresActifs: 'Filtres actifs',
136
+ retirerLeFiltre: (filtre) => `Retirer le filtre ${filtre}`,
137
+ effacerLesFiltres: 'Effacer les filtres',
138
+ filtreRetire: (filtre) => `Filtre ${filtre} retir\u00e9`,
139
+ filtresEffaces: 'Filtres effac\u00e9s',
60
140
  confirmer: 'Confirmer',
61
141
  annuler: 'Annuler',
62
142
  recopierPourConfirmer: (texte) => `Pour confirmer, recopiez \u00ab\u202f${texte}\u202f\u00bb`,
@@ -97,7 +177,79 @@ const LIBELLES_EN = {
97
177
  sessionExpireDans: (duree) => `Without any activity, you will be signed out in ${duree}.`,
98
178
  resterConnecte: 'Stay signed in',
99
179
  seDeconnecter: 'Sign out',
180
+ obligatoire: '(required)',
181
+ champObligatoire: 'This field is required.',
182
+ valeurInvalide: 'This value is not valid.',
183
+ adresseInvalide: 'Enter an email address, like name@example.com.',
184
+ formatInvalide: 'The format is not valid.',
185
+ longueurMinimale: (minimum) => `Enter at least ${String(minimum)} characters.`,
186
+ longueurMaximale: (maximum) => `Enter no more than ${String(maximum)} characters.`,
187
+ valeurMinimale: (minimum) => `The value must be at least ${minimum}.`,
188
+ valeurMaximale: (maximum) => `The value must be at most ${maximum}.`,
189
+ caracteresRestants: (restants) => restants === 1 ? '1 character remaining' : `${String(restants)} characters remaining`,
190
+ caracteresEnTrop: (enTrop) => enTrop === 1 ? '1 character too many' : `${String(enTrop)} characters too many`,
191
+ erreursACorriger: (nombre) => nombre === 1 ? 'There is 1 problem to fix' : `There are ${String(nombre)} problems to fix`,
192
+ afficherLeMotDePasse: 'Show password',
193
+ codeAChiffres: (longueur) => `${String(longueur)}-digit code.`,
194
+ ibanInvalide: 'Enter a valid IBAN.',
195
+ telephoneInvalide: 'Enter a phone number using digits, with the country code for a number abroad.',
196
+ exempleDIban: 'For example FR76 3000 6000 0112 3456 7890 189.',
197
+ rechercher: 'Search',
100
198
  fermerLeMessage: 'Dismiss message',
199
+ montantIllisible: (exemple) => `Enter an amount in figures, like ${exemple}.`,
200
+ tropDeDecimales: (decimales) => decimales === 0
201
+ ? 'Enter an amount without decimals.'
202
+ : `Enter no more than ${String(decimales)} decimal place${decimales > 1 ? 's' : ''}.`,
203
+ deviseDuMontant: (devise) => `Currency: ${devise}.`,
204
+ lettreDuJour: 'dd',
205
+ lettreDuMois: 'mm',
206
+ lettreDeLAnnee: 'yyyy',
207
+ formatDeDate: (motif, exemple) => `Use the format ${motif}, like ${exemple}.`,
208
+ dateIllisible: (motif, exemple) => `Enter a real date in the format ${motif}, like ${exemple}.`,
209
+ dateTropTot: (date) => `Enter a date on or after ${date}.`,
210
+ dateTropTard: (date) => `Enter a date on or before ${date}.`,
211
+ finAvantDebut: 'The end date cannot be before the start date.',
212
+ dateDeDebut: 'Start date',
213
+ dateDeFin: 'End date',
214
+ choisirDansLeCalendrier: (champ) => `${champ}: choose from calendar`,
215
+ moisPrecedent: 'Previous month',
216
+ moisSuivant: 'Next month',
217
+ aideDuCalendrier: 'Arrow keys to change day, Page Up and Page Down to change month, Escape to close.',
218
+ choisir: 'Choose\u2026',
219
+ nombreDeResultats: (nombre) => nombre === 0 ? 'No results' : `${String(nombre)} result${nombre > 1 ? 's' : ''}`,
220
+ nombreDeSelections: (nombre) => nombre === 0 ? 'Nothing selected' : `${String(nombre)} selected`,
221
+ retirerLeChoix: (choix) => `Remove ${choix}`,
222
+ afficherLesChoix: (champ) => `${champ}: show options`,
223
+ choisirDesFichiers: 'Choose files',
224
+ choisirUnFichier: 'Choose a file',
225
+ ouDeposerIci: 'or drop them here',
226
+ aucunFichier: 'No file chosen.',
227
+ nombreDeFichiers: (nombre) => nombre === 0 ? 'No file chosen.' : `${String(nombre)} file${nombre > 1 ? 's' : ''} chosen.`,
228
+ retirerLeFichier: (fichier) => `Remove ${fichier}`,
229
+ fichierTropVolumineux: (fichier, taille) => `${fichier} is larger than ${taille}.`,
230
+ typeDeFichierRefuse: (fichier) => `${fichier} is not an accepted file type.`,
231
+ tropDeFichiers: (nombre) => `Choose no more than ${String(nombre)} file${nombre > 1 ? 's' : ''}.`,
232
+ typesAcceptes: (types) => `Accepted types: ${types}.`,
233
+ tailleMaximale: (taille) => `${taille} maximum per file.`,
234
+ pagination: 'Pagination',
235
+ pagePrecedente: 'Previous page',
236
+ pageSuivante: 'Next page',
237
+ pageNumero: (numero) => `Page ${String(numero)}`,
238
+ afficherPlus: 'Show more',
239
+ lignesParPage: 'Rows per page',
240
+ selectionnerLaPage: (nombre) => `Select the ${String(nombre)} rows on this page`,
241
+ selectionnerLaLigne: (ligne) => `Select ${ligne}`,
242
+ lignesSelectionnees: (nombre) => nombre === 0 ? 'No rows selected' : `${String(nombre)} row${nombre > 1 ? 's' : ''} selected`,
243
+ trieCroissant: (colonne) => `Sorted by ${colonne}, ascending`,
244
+ trieDecroissant: (colonne) => `Sorted by ${colonne}, descending`,
245
+ tableauVide: 'No rows to display.',
246
+ nonRenseigne: 'Not provided',
247
+ filtres: 'Filters',
248
+ filtresActifs: 'Active filters',
249
+ retirerLeFiltre: (filtre) => `Remove filter ${filtre}`,
250
+ effacerLesFiltres: 'Clear filters',
251
+ filtreRetire: (filtre) => `Filter ${filtre} removed`,
252
+ filtresEffaces: 'Filters cleared',
101
253
  confirmer: 'Confirm',
102
254
  annuler: 'Cancel',
103
255
  recopierPourConfirmer: (texte) => `To confirm, type \u201c${texte}\u201d`,
@@ -371,6 +523,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.6", ngImpor
371
523
  */
372
524
  const NOMS_DICONE = [
373
525
  'boite-vide',
526
+ 'calendrier',
374
527
  'cercle',
375
528
  'cercle-coche',
376
529
  'cercle-croix',
@@ -383,6 +536,7 @@ const NOMS_DICONE = [
383
536
  'copie',
384
537
  'corbeille',
385
538
  'croix',
539
+ 'fichier',
386
540
  'hors-ligne',
387
541
  'lien-externe',
388
542
  'menu',
@@ -392,6 +546,8 @@ const NOMS_DICONE = [
392
546
  'rafraichir',
393
547
  'recherche',
394
548
  'serveur',
549
+ 'televerser',
550
+ 'tri',
395
551
  'triangle-alerte',
396
552
  'utilisateur',
397
553
  ];
@@ -2094,6 +2250,2220 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.6", ngImpor
2094
2250
  }, template: "<st-icon [nom]=\"icone()\" taille=\"xs\" />\n<span class=\"st-inline-message__texte\"><ng-content /></span>\n", styles: [".st-vh{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}:host([hidden]){display:none!important}:host{display:flex;gap:var(--st-espacement-2);align-items:flex-start;font-size:var(--st-taille-sm);line-height:var(--st-interligne-normal)}:host([data-ton=neutre]){color:var(--st-couleur-texte-discret)}:host([data-ton=primaire]){color:var(--st-couleur-primaire)}:host([data-ton=succes]){color:var(--st-couleur-succes)}:host([data-ton=avertissement]){color:var(--st-couleur-avertissement)}:host([data-ton=danger]){color:var(--st-couleur-danger)}\n"] }]
2095
2251
  }], propDecorators: { ton: [{ type: i0.Input, args: [{ isSignal: true, alias: "ton", required: false }] }], identifiant: [{ type: i0.Input, args: [{ isSignal: true, alias: "identifiant", required: false }] }] } });
2096
2252
 
2253
+ /**
2254
+ * Le texte d'une erreur, dans la langue courante.
2255
+ *
2256
+ * ⚠️ **Un `message` fourni l'emporte toujours.** Un validateur metier, ou une
2257
+ * erreur du serveur deja traduite, en sait plus que le genre : « IBAN d'un pays
2258
+ * non pris en charge » vaut mieux que « Le format n'est pas valide ».
2259
+ *
2260
+ * ⚠️ **Un genre inconnu rend un message generique, jamais le genre brut.**
2261
+ * Afficher `ibanChecksum` a une personne qui saisit un IBAN, c'est lui montrer le
2262
+ * code source.
2263
+ *
2264
+ * La locale sert aux messages qui citent un format, une date ou une taille : « au
2265
+ * format jj/mm/aaaa » n'est pas « mm/dd/yyyy ».
2266
+ */
2267
+ function messageDErreur(erreur, libelles, locale = 'fr-FR') {
2268
+ const fourni = erreur.message?.trim();
2269
+ if (fourni !== undefined && fourni !== '')
2270
+ return fourni;
2271
+ const propriete = (nom) => erreur[nom];
2272
+ const nombre = (nom) => {
2273
+ const valeur = propriete(nom);
2274
+ return typeof valeur === 'number' ? valeur : undefined;
2275
+ };
2276
+ const texte = (nom) => {
2277
+ const valeur = propriete(nom);
2278
+ return typeof valeur === 'string' ? valeur : undefined;
2279
+ };
2280
+ switch (erreur.kind) {
2281
+ case 'required':
2282
+ return libelles.champObligatoire;
2283
+ case 'email':
2284
+ return libelles.adresseInvalide;
2285
+ case 'pattern':
2286
+ return libelles.formatInvalide;
2287
+ case 'iban':
2288
+ return libelles.ibanInvalide;
2289
+ case 'telephone':
2290
+ return libelles.telephoneInvalide;
2291
+ case 'minLength': {
2292
+ const minimum = nombre('minLength');
2293
+ return minimum === undefined ? libelles.valeurInvalide : libelles.longueurMinimale(minimum);
2294
+ }
2295
+ case 'maxLength': {
2296
+ const maximum = nombre('maxLength');
2297
+ return maximum === undefined ? libelles.valeurInvalide : libelles.longueurMaximale(maximum);
2298
+ }
2299
+ case 'min': {
2300
+ const minimum = nombre('min');
2301
+ return minimum === undefined
2302
+ ? libelles.valeurInvalide
2303
+ : libelles.valeurMinimale(String(minimum));
2304
+ }
2305
+ case 'max': {
2306
+ const maximum = nombre('max');
2307
+ return maximum === undefined
2308
+ ? libelles.valeurInvalide
2309
+ : libelles.valeurMaximale(String(maximum));
2310
+ }
2311
+ case 'montant': {
2312
+ const devise = texte('devise') ?? 'EUR';
2313
+ const exemple = formaterMontant(montant((123456n * 10n ** BigInt(decimalesDe(devise))) / 100n, devise), {
2314
+ locale,
2315
+ sansDevise: true,
2316
+ });
2317
+ return libelles.montantIllisible(exemple);
2318
+ }
2319
+ case 'decimales': {
2320
+ const decimales = nombre('decimales');
2321
+ return decimales === undefined
2322
+ ? libelles.valeurInvalide
2323
+ : libelles.tropDeDecimales(decimales);
2324
+ }
2325
+ case 'date':
2326
+ return libelles.dateIllisible(motifLocal(libelles, locale), exempleDeDate(locale));
2327
+ case 'dateMin': {
2328
+ const minimum = texte('min');
2329
+ return minimum === undefined
2330
+ ? libelles.valeurInvalide
2331
+ : libelles.dateTropTot(formaterDateLongue(minimum, locale));
2332
+ }
2333
+ case 'dateMax': {
2334
+ const maximum = texte('max');
2335
+ return maximum === undefined
2336
+ ? libelles.valeurInvalide
2337
+ : libelles.dateTropTard(formaterDateLongue(maximum, locale));
2338
+ }
2339
+ case 'plageDeDates':
2340
+ return libelles.finAvantDebut;
2341
+ case 'fichierTaille': {
2342
+ const fichier = texte('fichier');
2343
+ const maximum = nombre('max');
2344
+ return fichier === undefined || maximum === undefined
2345
+ ? libelles.valeurInvalide
2346
+ : libelles.fichierTropVolumineux(fichier, formaterTaille(maximum, locale));
2347
+ }
2348
+ case 'fichierType': {
2349
+ const fichier = texte('fichier');
2350
+ return fichier === undefined
2351
+ ? libelles.valeurInvalide
2352
+ : libelles.typeDeFichierRefuse(fichier);
2353
+ }
2354
+ case 'fichiersNombre': {
2355
+ const maximum = nombre('max');
2356
+ return maximum === undefined ? libelles.valeurInvalide : libelles.tropDeFichiers(maximum);
2357
+ }
2358
+ default:
2359
+ return libelles.valeurInvalide;
2360
+ }
2361
+ }
2362
+ /** Le motif a taper dans la langue courante : `jj/mm/aaaa`. */
2363
+ function motifLocal(libelles, locale) {
2364
+ return motifDeDate(locale, {
2365
+ jour: libelles.lettreDuJour,
2366
+ mois: libelles.lettreDuMois,
2367
+ annee: libelles.lettreDeLAnnee,
2368
+ });
2369
+ }
2370
+ /**
2371
+ * Un jour superieur a 12 : « 31/03/2026 » montre sans ambiguite ou va le jour,
2372
+ * ce que « 01/02/2026 » ne dit pas.
2373
+ */
2374
+ function exempleDeDate(locale) {
2375
+ return formaterDateSaisie('2026-03-31', locale);
2376
+ }
2377
+ /**
2378
+ * Erreur d'IBAN, a brancher sur un schema :
2379
+ *
2380
+ * ```ts
2381
+ * validate(chemin.iban, ({ value }) => erreurIban(value()));
2382
+ * ```
2383
+ *
2384
+ * Une fonction pure plutot qu'une regle toute faite : fournir la regle
2385
+ * importerait `validate` d'`@angular/forms` A L'EXECUTION, et le socle ne
2386
+ * l'importe que pour ses types (audit de la vague 3, V3-1).
2387
+ *
2388
+ * ⚠️ Confort de saisie, jamais controle (SEC-5) : le serveur revalide. Un champ
2389
+ * vide n'est pas « invalide » ici — c'est `required` qui le dit, avec le bon
2390
+ * message.
2391
+ */
2392
+ function erreurIban(valeur) {
2393
+ if (valeur.trim() === '')
2394
+ return null;
2395
+ return ibanEstValide(valeur) ? null : { kind: 'iban' };
2396
+ }
2397
+ /**
2398
+ * Erreur de FORME d'un numero de telephone : chiffres, `+` de tete facultatif,
2399
+ * de 4 a 15 chiffres — la longueur maximale d'un numero international (E.164).
2400
+ *
2401
+ * ```ts
2402
+ * validate(chemin.telephone, ({ value }) => erreurTelephone(value()));
2403
+ * ```
2404
+ *
2405
+ * ⚠️ Une forme valide ne dit pas que le numero existe : seul le serveur le sait.
2406
+ * Un champ vide n'est pas une erreur de forme : l'obligation est une autre regle.
2407
+ */
2408
+ function erreurTelephone(valeur) {
2409
+ const numero = normaliserTelephone(valeur);
2410
+ if (numero === '')
2411
+ return null;
2412
+ return /^\+?[0-9]{4,15}$/.test(numero) ? null : { kind: 'telephone' };
2413
+ }
2414
+ /**
2415
+ * Erreur de bornes d'une date, a brancher sur un schema :
2416
+ *
2417
+ * ```ts
2418
+ * validate(chemin.naissance, ({ value }) => erreurDate(value(), { max: aujourdHui }));
2419
+ * ```
2420
+ *
2421
+ * Les bornes du schema et celles passees au calendrier doivent etre les memes :
2422
+ * le calendrier grise, le schema refuse une date tapee a la main.
2423
+ */
2424
+ function erreurDate(valeur, bornes) {
2425
+ if (valeur === null || valeur === '')
2426
+ return null;
2427
+ const { min, max } = bornes;
2428
+ if (min !== undefined && min !== null && valeur < min) {
2429
+ return { kind: 'dateMin', min };
2430
+ }
2431
+ if (max !== undefined && max !== null && valeur > max) {
2432
+ return { kind: 'dateMax', max };
2433
+ }
2434
+ return null;
2435
+ }
2436
+ /** Une fin anterieure au debut. Une borne manquante n'est pas une erreur de plage. */
2437
+ function erreurPlageDeDates(plage) {
2438
+ const { debut, fin } = plage;
2439
+ if (debut === null || fin === null)
2440
+ return null;
2441
+ return fin < debut ? { kind: 'plageDeDates' } : null;
2442
+ }
2443
+ /**
2444
+ * Erreurs d'une liste de fichiers, une par fichier refuse, pour dire LEQUEL :
2445
+ *
2446
+ * ```ts
2447
+ * validate(chemin.pieces, ({ value }) => erreursDeFichiers(value(), regles));
2448
+ * ```
2449
+ *
2450
+ * ⚠️ Confort, jamais securite (SEC-5) : le type se deduit de l'extension, et le
2451
+ * serveur relit le contenu.
2452
+ */
2453
+ function erreursDeFichiers(fichiers, regles) {
2454
+ const erreurs = [];
2455
+ const { accept = '', tailleMax, nombreMax } = regles;
2456
+ if (nombreMax !== undefined && fichiers.length > nombreMax) {
2457
+ erreurs.push({ kind: 'fichiersNombre', max: nombreMax });
2458
+ }
2459
+ for (const fichier of fichiers) {
2460
+ if (!typeDeFichierAccepte(fichier, accept)) {
2461
+ erreurs.push({ kind: 'fichierType', fichier: fichier.name });
2462
+ }
2463
+ else if (tailleMax !== undefined && fichier.size > tailleMax) {
2464
+ erreurs.push({
2465
+ kind: 'fichierTaille',
2466
+ fichier: fichier.name,
2467
+ max: tailleMax,
2468
+ });
2469
+ }
2470
+ }
2471
+ return erreurs;
2472
+ }
2473
+ /**
2474
+ * Erreurs a afficher par un champ qui LIT sa saisie (`transformedValue`) : celles
2475
+ * du formulaire, plus les erreurs de lecture qu'il ne connait pas encore.
2476
+ *
2477
+ * ⚠️ Relie a un formulaire, un champ recoit ses erreurs de lecture DANS `errors`,
2478
+ * par Signal Forms. Employe seul, par `[(value)]`, il ne les recoit nulle part :
2479
+ * sans cette fusion, « 12,5,3 » s'afficherait sans le moindre message. Une erreur
2480
+ * deja presente — meme genre, meme partie — n'est pas repetee.
2481
+ */
2482
+ function fusionnerErreurs(formulaire, lecture) {
2483
+ const cle = (erreur) => `${erreur.kind}|${erreur.partie ?? ''}`;
2484
+ const connues = new Set(formulaire.map(cle));
2485
+ return [...formulaire, ...lecture.filter((erreur) => !connues.has(cle(erreur)))];
2486
+ }
2487
+
2488
+ /**
2489
+ * Base des champs du socle : le contrat Signal Forms, ecrit une fois — tout sauf
2490
+ * `value`, dont le type depend du champ (texte, montant, date).
2491
+ *
2492
+ * ⚠️ **Une base, et non une copie par champ.** Neuf membres de contrat recopies
2493
+ * dans six composants, c'est six occasions d'en oublier un — et l'oubli ne se
2494
+ * voit pas : un champ sans `touched` n'affiche jamais ses erreurs, un champ sans
2495
+ * reflet de `hidden` ne se masque pas, et rien n'echoue.
2496
+ *
2497
+ * Les noms restent anglais : voir le glossaire, § 8.
2498
+ *
2499
+ * Le gabarit du champ doit nommer son element natif `#champ`, et le brancher sur
2500
+ * `touch` a la perte du focus.
2501
+ */
2502
+ class ContratDeChamp {
2503
+ libelle = input.required(/* @ts-ignore */
2504
+ ...(ngDevMode ? [{ debugName: "libelle" }] : /* istanbul ignore next */ []));
2505
+ aide = input(null, /* @ts-ignore */
2506
+ ...(ngDevMode ? [{ debugName: "aide" }] : /* istanbul ignore next */ []));
2507
+ errors = input([], /* @ts-ignore */
2508
+ ...(ngDevMode ? [{ debugName: "errors" }] : /* istanbul ignore next */ []));
2509
+ touched = input(false, { ...(ngDevMode ? { debugName: "touched" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
2510
+ disabled = input(false, { ...(ngDevMode ? { debugName: "disabled" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
2511
+ readonly = input(false, { ...(ngDevMode ? { debugName: "readonly" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
2512
+ required = input(false, { ...(ngDevMode ? { debugName: "required" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
2513
+ hidden = input(false, { ...(ngDevMode ? { debugName: "hidden" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
2514
+ name = input('', /* @ts-ignore */
2515
+ ...(ngDevMode ? [{ debugName: "name" }] : /* istanbul ignore next */ []));
2516
+ touch = output();
2517
+ champ = viewChild('champ', /* @ts-ignore */
2518
+ ...(ngDevMode ? [{ debugName: "champ" }] : /* istanbul ignore next */ []));
2519
+ /** Appele par Signal Forms pour amener le focus sur un champ en erreur. */
2520
+ focus(options) {
2521
+ this.champ()?.nativeElement.focus(options);
2522
+ }
2523
+ texteSaisi(evenement) {
2524
+ return evenement.target.value;
2525
+ }
2526
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: ContratDeChamp, deps: [], target: i0.ɵɵFactoryTarget.Directive });
2527
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.2.0", version: "22.1.6", type: ContratDeChamp, isStandalone: true, inputs: { libelle: { classPropertyName: "libelle", publicName: "libelle", isSignal: true, isRequired: true, transformFunction: null }, aide: { classPropertyName: "aide", publicName: "aide", isSignal: true, isRequired: false, transformFunction: null }, errors: { classPropertyName: "errors", publicName: "errors", isSignal: true, isRequired: false, transformFunction: null }, touched: { classPropertyName: "touched", publicName: "touched", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, readonly: { classPropertyName: "readonly", publicName: "readonly", isSignal: true, isRequired: false, transformFunction: null }, required: { classPropertyName: "required", publicName: "required", isSignal: true, isRequired: false, transformFunction: null }, hidden: { classPropertyName: "hidden", publicName: "hidden", isSignal: true, isRequired: false, transformFunction: null }, name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { touch: "touch" }, host: { properties: { "attr.hidden": "hidden() ? \"\" : null" } }, viewQueries: [{ propertyName: "champ", first: true, predicate: ["champ"], descendants: true, isSignal: true }], ngImport: i0 });
2528
+ }
2529
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: ContratDeChamp, decorators: [{
2530
+ type: Directive,
2531
+ args: [{
2532
+ host: {
2533
+ // L'entree `hidden` du contrat n'ecrit pas l'attribut : on le reflete, sans
2534
+ // quoi la regle `:host([hidden])` du socle ne s'applique pas.
2535
+ '[attr.hidden]': 'hidden() ? "" : null',
2536
+ },
2537
+ }]
2538
+ }], propDecorators: { libelle: [{ type: i0.Input, args: [{ isSignal: true, alias: "libelle", required: true }] }], aide: [{ type: i0.Input, args: [{ isSignal: true, alias: "aide", required: false }] }], errors: [{ type: i0.Input, args: [{ isSignal: true, alias: "errors", required: false }] }], touched: [{ type: i0.Input, args: [{ isSignal: true, alias: "touched", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], readonly: [{ type: i0.Input, args: [{ isSignal: true, alias: "readonly", required: false }] }], required: [{ type: i0.Input, args: [{ isSignal: true, alias: "required", required: false }] }], hidden: [{ type: i0.Input, args: [{ isSignal: true, alias: "hidden", required: false }] }], name: [{ type: i0.Input, args: [{ isSignal: true, alias: "name", required: false }] }], touch: [{ type: i0.Output, args: ["touch"] }], champ: [{ type: i0.ViewChild, args: ['champ', { isSignal: true }] }] } });
2539
+ /** Base des champs dont la valeur est le texte saisi. */
2540
+ class ControleDeSaisie extends ContratDeChamp {
2541
+ value = model('', /* @ts-ignore */
2542
+ ...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
2543
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: ControleDeSaisie, deps: null, target: i0.ɵɵFactoryTarget.Directive });
2544
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.1.6", type: ControleDeSaisie, isStandalone: true, inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange" }, usesInheritance: true, ngImport: i0 });
2545
+ }
2546
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: ControleDeSaisie, decorators: [{
2547
+ type: Directive
2548
+ }], propDecorators: { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }] } });
2549
+
2550
+ let compteur$8 = 0;
2551
+ /** Elements qu'un `label for` etiquette. */
2552
+ const ELEMENTS_ETIQUETABLES = new Set([
2553
+ 'INPUT',
2554
+ 'SELECT',
2555
+ 'TEXTAREA',
2556
+ 'BUTTON',
2557
+ 'METER',
2558
+ 'OUTPUT',
2559
+ 'PROGRESS',
2560
+ ]);
2561
+ /**
2562
+ * Etiquette, aide, erreur et controle d'un champ de saisie — et le cablage qui
2563
+ * les relie.
2564
+ *
2565
+ * ⚠️ **Le SEUL endroit ou ce cablage existe** (audit de la vague 3, V3-2). Chaque
2566
+ * champ du socle l'emploie au lieu de refaire identifiants, `aria-describedby` et
2567
+ * `aria-invalid` : c'est precisement le code que l'on croit fini et qui se perd,
2568
+ * un champ specialise a la fois.
2569
+ *
2570
+ * L'ordre visuel suit celui de la lecture : etiquette, aide, erreur, controle.
2571
+ * L'erreur est AU-DESSUS du controle, pour etre vue avant de retaper.
2572
+ *
2573
+ * ⚠️ **L'erreur n'est pas une region vivante.** Annoncee a la perte du focus, elle
2574
+ * couperait la lecture du champ suivant, ou la personne est deja passee. Elle est
2575
+ * reliee au controle, donc lue quand on y revient ; a l'envoi, c'est le
2576
+ * recapitulatif d'erreurs qui prend le focus et les enumere.
2577
+ */
2578
+ class StFormField {
2579
+ libelles = inject(ST_LIBELLES);
2580
+ locale = inject(ST_LOCALE);
2581
+ element = inject(ElementRef);
2582
+ /**
2583
+ * ⚠️ OBLIGATOIRE et toujours visible (UX-1). Un texte indicatif ne le remplace
2584
+ * jamais : il disparait a la premiere frappe.
2585
+ */
2586
+ libelle = input.required(/* @ts-ignore */
2587
+ ...(ngDevMode ? [{ debugName: "libelle" }] : /* istanbul ignore next */ []));
2588
+ /** Aide permanente : format attendu, exemple. Lue apres l'etiquette. */
2589
+ aide = input(null, /* @ts-ignore */
2590
+ ...(ngDevMode ? [{ debugName: "aide" }] : /* istanbul ignore next */ []));
2591
+ /** Texte complementaire tenu a jour par le controle, comme un compteur. */
2592
+ complement = input(null, /* @ts-ignore */
2593
+ ...(ngDevMode ? [{ debugName: "complement" }] : /* istanbul ignore next */ []));
2594
+ erreurs = input([], /* @ts-ignore */
2595
+ ...(ngDevMode ? [{ debugName: "erreurs" }] : /* istanbul ignore next */ []));
2596
+ /**
2597
+ * ⚠️ Faux tant que la personne n'a pas quitte le champ ou tente l'envoi (UX-3) :
2598
+ * un formulaire vierge couvert d'erreurs accuse avant qu'on ait rien fait.
2599
+ */
2600
+ afficherErreurs = input(false, { ...(ngDevMode ? { debugName: "afficherErreurs" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
2601
+ obligatoire = input(false, { ...(ngDevMode ? { debugName: "obligatoire" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
2602
+ /**
2603
+ * ⚠️ Change l'ordre VISUEL, jamais celui du document : l'etiquette reste
2604
+ * reliee par `for`, et l'ordre de tabulation ne passe que par le controle.
2605
+ */
2606
+ disposition = input('empilee', /* @ts-ignore */
2607
+ ...(ngDevMode ? [{ debugName: "disposition" }] : /* istanbul ignore next */ []));
2608
+ /**
2609
+ * Etiquette lue mais non affichee.
2610
+ *
2611
+ * ⚠️ Reservee a la RECHERCHE, ou l'icone, le bouton et la position en tete de
2612
+ * page disent deja le but du champ. Partout ailleurs, une etiquette masquee est
2613
+ * l'etiquette qui manque au moment ou l'on tape (UX-1).
2614
+ */
2615
+ libelleMasque = input(false, { ...(ngDevMode ? { debugName: "libelleMasque" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
2616
+ /** Identifiants du champ, lus par `stControleDeChamp` et par le gabarit. */
2617
+ identifiants = (() => {
2618
+ const base = `st-champ-${(compteur$8 += 1).toString()}`;
2619
+ return {
2620
+ controle: base,
2621
+ libelle: `${base}-libelle`,
2622
+ aide: `${base}-aide`,
2623
+ complement: `${base}-complement`,
2624
+ erreur: `${base}-erreur`,
2625
+ };
2626
+ })();
2627
+ libelleObligatoire = computed(() => this.libelles().obligatoire, /* @ts-ignore */
2628
+ ...(ngDevMode ? [{ debugName: "libelleObligatoire" }] : /* istanbul ignore next */ []));
2629
+ /** Messages a afficher, dans la langue courante. Vide tant qu'ils ne doivent pas l'etre. */
2630
+ messages = computed(() => {
2631
+ if (!this.afficherErreurs())
2632
+ return [];
2633
+ const libelles = this.libelles();
2634
+ const locale = this.locale();
2635
+ return this.erreurs().map((erreur) => messageDErreur(erreur, libelles, locale));
2636
+ }, /* @ts-ignore */
2637
+ ...(ngDevMode ? [{ debugName: "messages" }] : /* istanbul ignore next */ []));
2638
+ /**
2639
+ * Un clic sur l'etiquette d'un controle non natif n'y mene pas de lui-meme :
2640
+ * on y amene le focus, comme le navigateur le fait pour un champ natif.
2641
+ */
2642
+ focaliserLeControle() {
2643
+ const controle = this.element.nativeElement.querySelector(`#${this.identifiants.controle}`);
2644
+ if (controle !== null && !ELEMENTS_ETIQUETABLES.has(controle.tagName))
2645
+ controle.focus();
2646
+ }
2647
+ /** Lu par le controle pour `aria-invalid`. */
2648
+ enErreur = computed(() => this.messages().length > 0, /* @ts-ignore */
2649
+ ...(ngDevMode ? [{ debugName: "enErreur" }] : /* istanbul ignore next */ []));
2650
+ /**
2651
+ * ⚠️ Seuls les elements PRESENTS sont references : un `aria-describedby` qui
2652
+ * vise un identifiant absent est ignore par certains lecteurs d'ecran — tout
2653
+ * entier, y compris les references valides qui l'accompagnent.
2654
+ */
2655
+ descriptions = computed(() => {
2656
+ const ids = [];
2657
+ if (this.aide() !== null)
2658
+ ids.push(this.identifiants.aide);
2659
+ if (this.complement() !== null)
2660
+ ids.push(this.identifiants.complement);
2661
+ if (this.enErreur())
2662
+ ids.push(this.identifiants.erreur);
2663
+ return ids.length === 0 ? null : ids.join(' ');
2664
+ }, /* @ts-ignore */
2665
+ ...(ngDevMode ? [{ debugName: "descriptions" }] : /* istanbul ignore next */ []));
2666
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: StFormField, deps: [], target: i0.ɵɵFactoryTarget.Component });
2667
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.6", type: StFormField, isStandalone: true, selector: "st-form-field", inputs: { libelle: { classPropertyName: "libelle", publicName: "libelle", isSignal: true, isRequired: true, transformFunction: null }, aide: { classPropertyName: "aide", publicName: "aide", isSignal: true, isRequired: false, transformFunction: null }, complement: { classPropertyName: "complement", publicName: "complement", isSignal: true, isRequired: false, transformFunction: null }, erreurs: { classPropertyName: "erreurs", publicName: "erreurs", isSignal: true, isRequired: false, transformFunction: null }, afficherErreurs: { classPropertyName: "afficherErreurs", publicName: "afficherErreurs", isSignal: true, isRequired: false, transformFunction: null }, obligatoire: { classPropertyName: "obligatoire", publicName: "obligatoire", isSignal: true, isRequired: false, transformFunction: null }, disposition: { classPropertyName: "disposition", publicName: "disposition", isSignal: true, isRequired: false, transformFunction: null }, libelleMasque: { classPropertyName: "libelleMasque", publicName: "libelleMasque", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "attr.data-en-erreur": "enErreur() ? \"\" : null", "attr.data-disposition": "disposition()" }, classAttribute: "st-form-field" }, ngImport: i0, template: "<!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events, @angular-eslint/template/interactive-supports-focus --\n Le clic sur une etiquette est une commodite de souris, comme pour tout\n champ natif : au clavier, le controle se rejoint par tabulation, et\n l'etiquette n'a pas a recevoir le focus. -->\n<label\n class=\"st-form-field__libelle\"\n [class.st-vh]=\"libelleMasque()\"\n [id]=\"identifiants.libelle\"\n [for]=\"identifiants.controle\"\n [attr.data-libelle]=\"libelle()\"\n (click)=\"focaliserLeControle()\"\n>\n {{ libelle() }}\n @if (obligatoire()) {\n <span class=\"st-form-field__obligatoire\">{{ libelleObligatoire() }}</span>\n }\n</label>\n\n@if (aide(); as texte) {\n <p class=\"st-form-field__aide\" [id]=\"identifiants.aide\">{{ texte }}</p>\n}\n\n@if (enErreur()) {\n <div class=\"st-form-field__erreurs\" [id]=\"identifiants.erreur\">\n @for (message of messages(); track $index) {\n <st-inline-message ton=\"danger\">{{ message }}</st-inline-message>\n }\n </div>\n}\n\n<div class=\"st-form-field__controle\">\n <ng-content />\n</div>\n\n@if (complement(); as texte) {\n <p class=\"st-form-field__complement\" [id]=\"identifiants.complement\">{{ texte }}</p>\n}\n", styles: [".st-vh{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}:host([hidden]){display:none!important}:host{display:grid;grid-template-areas:\"libelle\" \"aide\" \"erreur\" \"controle\" \"complement\";grid-template-columns:minmax(0,1fr);gap:var(--st-espacement-1);margin-block-end:var(--st-espacement-5)}:host([data-disposition=case]){grid-template-areas:\"erreur erreur\" \"controle libelle\" \". aide\" \". complement\";grid-template-columns:auto minmax(0,1fr);column-gap:var(--st-espacement-2);align-items:center}.st-form-field__libelle{grid-area:libelle}.st-form-field__aide{grid-area:aide}.st-form-field__erreurs{grid-area:erreur}.st-form-field__controle{grid-area:controle}.st-form-field__complement{grid-area:complement}:host([data-disposition=case]) .st-form-field__libelle{font-weight:var(--st-graisse-normale)}.st-form-field__libelle{font-weight:var(--st-graisse-semi);color:var(--st-couleur-texte)}.st-form-field__obligatoire{margin-inline-start:var(--st-espacement-1);font-weight:var(--st-graisse-normale);color:var(--st-couleur-texte-discret)}.st-form-field__aide,.st-form-field__complement{margin:0;font-size:var(--st-taille-sm);color:var(--st-couleur-texte-discret)}:host([data-en-erreur]){padding-inline-start:var(--st-espacement-3);border-inline-start:3px solid var(--st-couleur-danger)}\n"], dependencies: [{ kind: "component", type: StInlineMessage, selector: "st-inline-message", inputs: ["ton", "identifiant"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
2668
+ }
2669
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: StFormField, decorators: [{
2670
+ type: Component,
2671
+ args: [{ selector: 'st-form-field', changeDetection: ChangeDetectionStrategy.OnPush, imports: [StInlineMessage], host: {
2672
+ class: 'st-form-field',
2673
+ '[attr.data-en-erreur]': 'enErreur() ? "" : null',
2674
+ '[attr.data-disposition]': 'disposition()',
2675
+ }, template: "<!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events, @angular-eslint/template/interactive-supports-focus --\n Le clic sur une etiquette est une commodite de souris, comme pour tout\n champ natif : au clavier, le controle se rejoint par tabulation, et\n l'etiquette n'a pas a recevoir le focus. -->\n<label\n class=\"st-form-field__libelle\"\n [class.st-vh]=\"libelleMasque()\"\n [id]=\"identifiants.libelle\"\n [for]=\"identifiants.controle\"\n [attr.data-libelle]=\"libelle()\"\n (click)=\"focaliserLeControle()\"\n>\n {{ libelle() }}\n @if (obligatoire()) {\n <span class=\"st-form-field__obligatoire\">{{ libelleObligatoire() }}</span>\n }\n</label>\n\n@if (aide(); as texte) {\n <p class=\"st-form-field__aide\" [id]=\"identifiants.aide\">{{ texte }}</p>\n}\n\n@if (enErreur()) {\n <div class=\"st-form-field__erreurs\" [id]=\"identifiants.erreur\">\n @for (message of messages(); track $index) {\n <st-inline-message ton=\"danger\">{{ message }}</st-inline-message>\n }\n </div>\n}\n\n<div class=\"st-form-field__controle\">\n <ng-content />\n</div>\n\n@if (complement(); as texte) {\n <p class=\"st-form-field__complement\" [id]=\"identifiants.complement\">{{ texte }}</p>\n}\n", styles: [".st-vh{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}:host([hidden]){display:none!important}:host{display:grid;grid-template-areas:\"libelle\" \"aide\" \"erreur\" \"controle\" \"complement\";grid-template-columns:minmax(0,1fr);gap:var(--st-espacement-1);margin-block-end:var(--st-espacement-5)}:host([data-disposition=case]){grid-template-areas:\"erreur erreur\" \"controle libelle\" \". aide\" \". complement\";grid-template-columns:auto minmax(0,1fr);column-gap:var(--st-espacement-2);align-items:center}.st-form-field__libelle{grid-area:libelle}.st-form-field__aide{grid-area:aide}.st-form-field__erreurs{grid-area:erreur}.st-form-field__controle{grid-area:controle}.st-form-field__complement{grid-area:complement}:host([data-disposition=case]) .st-form-field__libelle{font-weight:var(--st-graisse-normale)}.st-form-field__libelle{font-weight:var(--st-graisse-semi);color:var(--st-couleur-texte)}.st-form-field__obligatoire{margin-inline-start:var(--st-espacement-1);font-weight:var(--st-graisse-normale);color:var(--st-couleur-texte-discret)}.st-form-field__aide,.st-form-field__complement{margin:0;font-size:var(--st-taille-sm);color:var(--st-couleur-texte-discret)}:host([data-en-erreur]){padding-inline-start:var(--st-espacement-3);border-inline-start:3px solid var(--st-couleur-danger)}\n"] }]
2676
+ }], propDecorators: { libelle: [{ type: i0.Input, args: [{ isSignal: true, alias: "libelle", required: true }] }], aide: [{ type: i0.Input, args: [{ isSignal: true, alias: "aide", required: false }] }], complement: [{ type: i0.Input, args: [{ isSignal: true, alias: "complement", required: false }] }], erreurs: [{ type: i0.Input, args: [{ isSignal: true, alias: "erreurs", required: false }] }], afficherErreurs: [{ type: i0.Input, args: [{ isSignal: true, alias: "afficherErreurs", required: false }] }], obligatoire: [{ type: i0.Input, args: [{ isSignal: true, alias: "obligatoire", required: false }] }], disposition: [{ type: i0.Input, args: [{ isSignal: true, alias: "disposition", required: false }] }], libelleMasque: [{ type: i0.Input, args: [{ isSignal: true, alias: "libelleMasque", required: false }] }] } });
2677
+ /**
2678
+ * Pose sur l'element natif d'un champ le cablage de son `st-form-field` :
2679
+ * identifiant, description, invalidite, obligation.
2680
+ *
2681
+ * ⚠️ `aria-required` et NON l'attribut `required` natif. Le natif declenche la
2682
+ * validation du navigateur a l'envoi : une bulle « Veuillez renseigner ce champ »
2683
+ * dans la langue du NAVIGATEUR, pas dans celle de l'application, et qui double
2684
+ * le message du socle.
2685
+ */
2686
+ class StControleDeChamp {
2687
+ champ = inject(StFormField);
2688
+ /**
2689
+ * ⚠️ `label for` n'etiquette que les elements natifs de formulaire. Le
2690
+ * declencheur d'une selection multiple est un `div` de role `combobox` : sans
2691
+ * `aria-labelledby`, il n'aurait aucun nom, et l'etiquette visible ne dirait
2692
+ * rien au lecteur d'ecran.
2693
+ */
2694
+ etiquetable = ELEMENTS_ETIQUETABLES.has(inject(ElementRef).nativeElement.tagName);
2695
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: StControleDeChamp, deps: [], target: i0.ɵɵFactoryTarget.Directive });
2696
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.1.6", type: StControleDeChamp, isStandalone: true, selector: "[stControleDeChamp]", host: { properties: { "id": "champ.identifiants.controle", "attr.aria-labelledby": "etiquetable ? null : champ.identifiants.libelle", "attr.aria-describedby": "champ.descriptions()", "attr.aria-invalid": "champ.enErreur() ? \"true\" : null", "attr.aria-required": "champ.obligatoire() ? \"true\" : null" } }, ngImport: i0 });
2697
+ }
2698
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: StControleDeChamp, decorators: [{
2699
+ type: Directive,
2700
+ args: [{
2701
+ selector: '[stControleDeChamp]',
2702
+ host: {
2703
+ '[id]': 'champ.identifiants.controle',
2704
+ '[attr.aria-labelledby]': 'etiquetable ? null : champ.identifiants.libelle',
2705
+ '[attr.aria-describedby]': 'champ.descriptions()',
2706
+ '[attr.aria-invalid]': 'champ.enErreur() ? "true" : null',
2707
+ '[attr.aria-required]': 'champ.obligatoire() ? "true" : null',
2708
+ },
2709
+ }]
2710
+ }] });
2711
+
2712
+ /**
2713
+ * Champ de saisie d'une ligne, integre a Signal Forms.
2714
+ *
2715
+ * ```html
2716
+ * <st-input libelle="Nom du beneficiaire" autocomplete="name" [formField]="virement.beneficiaire" />
2717
+ * <!-- ou, sans formulaire : -->
2718
+ * <st-input libelle="Reference" [(value)]="reference" />
2719
+ * ```
2720
+ *
2721
+ * ⚠️ **Contrat Signal Forms, noms anglais.** `value`, `errors`, `touched`,
2722
+ * `disabled`… sont cherches PAR LEUR NOM par la directive `[formField]` : les
2723
+ * traduire romprait l'integration sans la moindre erreur (audit de la vague 3,
2724
+ * V3-1). L'import d'`@angular/forms` est un import de TYPE : aucun code n'entre
2725
+ * dans le paquet.
2726
+ *
2727
+ * ⚠️ **Pas d'attribut `maxlength` natif.** Il TRONQUE en silence un texte colle
2728
+ * trop long : la personne croit avoir saisi sa reference entiere, et n'en envoie
2729
+ * que le debut. La limite passe par la validation, qui DIT le depassement.
2730
+ */
2731
+ class StInput extends ControleDeSaisie {
2732
+ type = input('text', /* @ts-ignore */
2733
+ ...(ngDevMode ? [{ debugName: "type" }] : /* istanbul ignore next */ []));
2734
+ /**
2735
+ * WCAG 1.3.5 : identifie le but du champ, pour le remplissage automatique et les
2736
+ * aides techniques. `null` : laisse le navigateur decider.
2737
+ */
2738
+ autocomplete = input(null, /* @ts-ignore */
2739
+ ...(ngDevMode ? [{ debugName: "autocomplete" }] : /* istanbul ignore next */ []));
2740
+ /** Clavier virtuel adapte : `numeric`, `decimal`, `email`… */
2741
+ inputmode = input(null, /* @ts-ignore */
2742
+ ...(ngDevMode ? [{ debugName: "inputmode" }] : /* istanbul ignore next */ []));
2743
+ surSaisie(evenement) {
2744
+ this.value.set(this.texteSaisi(evenement));
2745
+ }
2746
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: StInput, deps: null, target: i0.ɵɵFactoryTarget.Component });
2747
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.1.6", type: StInput, isStandalone: true, selector: "st-input", inputs: { type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: false, transformFunction: null }, autocomplete: { classPropertyName: "autocomplete", publicName: "autocomplete", isSignal: true, isRequired: false, transformFunction: null }, inputmode: { classPropertyName: "inputmode", publicName: "inputmode", isSignal: true, isRequired: false, transformFunction: null } }, host: { classAttribute: "st-input" }, usesInheritance: true, ngImport: i0, template: "<st-form-field\n [libelle]=\"libelle()\"\n [aide]=\"aide()\"\n [erreurs]=\"errors()\"\n [afficherErreurs]=\"touched()\"\n [obligatoire]=\"required()\"\n>\n <input\n #champ\n class=\"st-input__champ\"\n stControleDeChamp\n [type]=\"type()\"\n [value]=\"value()\"\n [attr.name]=\"name() || null\"\n [attr.autocomplete]=\"autocomplete()\"\n [attr.inputmode]=\"inputmode()\"\n [disabled]=\"disabled()\"\n [readOnly]=\"readonly()\"\n (input)=\"surSaisie($event)\"\n (blur)=\"touch.emit()\"\n />\n</st-form-field>\n", styles: [".st-vh{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}:host([hidden]){display:none!important}:host{display:block}.st-input__champ:focus-visible{outline:2px solid var(--st-couleur-anneau-focus);outline-offset:2px}.st-input__champ{box-sizing:border-box;inline-size:100%;min-block-size:var(--st-cible-tactile-min);padding:var(--st-espacement-2) var(--st-espacement-3);font:inherit;color:var(--st-couleur-texte);background:var(--st-couleur-surface);border:1px solid var(--st-couleur-bordure-forte);border-radius:var(--st-rayon-sm)}.st-input__champ[aria-invalid=true]{border-color:var(--st-couleur-danger);box-shadow:inset 0 0 0 1px var(--st-couleur-danger)}.st-input__champ:disabled{color:var(--st-couleur-texte-desactive);cursor:not-allowed;background:var(--st-couleur-surface-enfoncee)}.st-input__champ:read-only:not(:disabled){background:var(--st-couleur-surface-enfoncee)}\n"], dependencies: [{ kind: "component", type: StFormField, selector: "st-form-field", inputs: ["libelle", "aide", "complement", "erreurs", "afficherErreurs", "obligatoire", "disposition", "libelleMasque"] }, { kind: "directive", type: StControleDeChamp, selector: "[stControleDeChamp]" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
2748
+ }
2749
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: StInput, decorators: [{
2750
+ type: Component,
2751
+ args: [{ selector: 'st-input', changeDetection: ChangeDetectionStrategy.OnPush, imports: [StFormField, StControleDeChamp], host: { class: 'st-input' }, template: "<st-form-field\n [libelle]=\"libelle()\"\n [aide]=\"aide()\"\n [erreurs]=\"errors()\"\n [afficherErreurs]=\"touched()\"\n [obligatoire]=\"required()\"\n>\n <input\n #champ\n class=\"st-input__champ\"\n stControleDeChamp\n [type]=\"type()\"\n [value]=\"value()\"\n [attr.name]=\"name() || null\"\n [attr.autocomplete]=\"autocomplete()\"\n [attr.inputmode]=\"inputmode()\"\n [disabled]=\"disabled()\"\n [readOnly]=\"readonly()\"\n (input)=\"surSaisie($event)\"\n (blur)=\"touch.emit()\"\n />\n</st-form-field>\n", styles: [".st-vh{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}:host([hidden]){display:none!important}:host{display:block}.st-input__champ:focus-visible{outline:2px solid var(--st-couleur-anneau-focus);outline-offset:2px}.st-input__champ{box-sizing:border-box;inline-size:100%;min-block-size:var(--st-cible-tactile-min);padding:var(--st-espacement-2) var(--st-espacement-3);font:inherit;color:var(--st-couleur-texte);background:var(--st-couleur-surface);border:1px solid var(--st-couleur-bordure-forte);border-radius:var(--st-rayon-sm)}.st-input__champ[aria-invalid=true]{border-color:var(--st-couleur-danger);box-shadow:inset 0 0 0 1px var(--st-couleur-danger)}.st-input__champ:disabled{color:var(--st-couleur-texte-desactive);cursor:not-allowed;background:var(--st-couleur-surface-enfoncee)}.st-input__champ:read-only:not(:disabled){background:var(--st-couleur-surface-enfoncee)}\n"] }]
2752
+ }], propDecorators: { type: [{ type: i0.Input, args: [{ isSignal: true, alias: "type", required: false }] }], autocomplete: [{ type: i0.Input, args: [{ isSignal: true, alias: "autocomplete", required: false }] }], inputmode: [{ type: i0.Input, args: [{ isSignal: true, alias: "inputmode", required: false }] }] } });
2753
+
2754
+ /** Restant a partir duquel le compteur se signale. */
2755
+ const SEUILS_D_ANNONCE = [20, 10, 0];
2756
+ /**
2757
+ * Zone de texte, integree a Signal Forms, avec compteur quand une longueur
2758
+ * maximale est fixee.
2759
+ *
2760
+ * ⚠️ **Le compteur n'est pas annonce a chaque frappe** : une region vivante qui
2761
+ * change a chaque caractere recouvre ce que la personne tape. Il est RELIE a la
2762
+ * zone — donc lu quand on y revient — et seuls les seuils (20, 10, 0 restants)
2763
+ * et le depassement s'annoncent (UX-11).
2764
+ *
2765
+ * ⚠️ **Pas de `maxlength` natif**, meme raison que `st-input` : un texte colle
2766
+ * serait tronque en silence. Le compteur affiche le depassement, la validation
2767
+ * le refuse.
2768
+ */
2769
+ class StTextarea extends ControleDeSaisie {
2770
+ libelles = inject(ST_LIBELLES);
2771
+ lignes = input(4, /* @ts-ignore */
2772
+ ...(ngDevMode ? [{ debugName: "lignes" }] : /* istanbul ignore next */ []));
2773
+ /** Contrat Signal Forms : la longueur maximale fixee par le schema. */
2774
+ maxLength = input(undefined, /* @ts-ignore */
2775
+ ...(ngDevMode ? [{ debugName: "maxLength" }] : /* istanbul ignore next */ []));
2776
+ annonce = new AnnonceLocale(inject(DestroyRef));
2777
+ restants = computed(() => {
2778
+ const maximum = this.maxLength();
2779
+ return maximum === undefined ? null : maximum - this.value().length;
2780
+ }, /* @ts-ignore */
2781
+ ...(ngDevMode ? [{ debugName: "restants" }] : /* istanbul ignore next */ []));
2782
+ compteur = computed(() => {
2783
+ const restants = this.restants();
2784
+ if (restants === null)
2785
+ return null;
2786
+ const libelles = this.libelles();
2787
+ return restants >= 0
2788
+ ? libelles.caracteresRestants(restants)
2789
+ : libelles.caracteresEnTrop(-restants);
2790
+ }, /* @ts-ignore */
2791
+ ...(ngDevMode ? [{ debugName: "compteur" }] : /* istanbul ignore next */ []));
2792
+ constructor() {
2793
+ super();
2794
+ let precedent = null;
2795
+ effect(() => {
2796
+ const restants = this.restants();
2797
+ if (restants === null)
2798
+ return;
2799
+ const avant = precedent;
2800
+ precedent = restants;
2801
+ if (avant === null)
2802
+ return;
2803
+ const franchi = SEUILS_D_ANNONCE.some((seuil) => avant > seuil && restants <= seuil) ||
2804
+ (avant >= 0 && restants < 0);
2805
+ const texte = this.compteur();
2806
+ if (franchi && texte !== null)
2807
+ this.annonce.annoncer(texte);
2808
+ });
2809
+ }
2810
+ surSaisie(evenement) {
2811
+ this.value.set(this.texteSaisi(evenement));
2812
+ }
2813
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: StTextarea, deps: [], target: i0.ɵɵFactoryTarget.Component });
2814
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.1.6", type: StTextarea, isStandalone: true, selector: "st-textarea", inputs: { lignes: { classPropertyName: "lignes", publicName: "lignes", isSignal: true, isRequired: false, transformFunction: null }, maxLength: { classPropertyName: "maxLength", publicName: "maxLength", isSignal: true, isRequired: false, transformFunction: null } }, host: { classAttribute: "st-textarea" }, usesInheritance: true, ngImport: i0, template: "<st-form-field\n [libelle]=\"libelle()\"\n [aide]=\"aide()\"\n [complement]=\"compteur()\"\n [erreurs]=\"errors()\"\n [afficherErreurs]=\"touched()\"\n [obligatoire]=\"required()\"\n>\n <textarea\n #champ\n class=\"st-textarea__champ\"\n stControleDeChamp\n [rows]=\"lignes()\"\n [value]=\"value()\"\n [attr.name]=\"name() || null\"\n [disabled]=\"disabled()\"\n [readOnly]=\"readonly()\"\n (input)=\"surSaisie($event)\"\n (blur)=\"touch.emit()\"\n ></textarea>\n</st-form-field>\n<span class=\"st-vh\" aria-live=\"polite\">{{ annonce.texte() }}</span>\n", styles: [".st-vh{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}:host([hidden]){display:none!important}:host{display:block}.st-textarea__champ:focus-visible{outline:2px solid var(--st-couleur-anneau-focus);outline-offset:2px}.st-textarea__champ{box-sizing:border-box;inline-size:100%;min-block-size:var(--st-cible-tactile-min);padding:var(--st-espacement-2) var(--st-espacement-3);font:inherit;color:var(--st-couleur-texte);background:var(--st-couleur-surface);border:1px solid var(--st-couleur-bordure-forte);border-radius:var(--st-rayon-sm)}.st-textarea__champ[aria-invalid=true]{border-color:var(--st-couleur-danger);box-shadow:inset 0 0 0 1px var(--st-couleur-danger)}.st-textarea__champ:disabled{color:var(--st-couleur-texte-desactive);cursor:not-allowed;background:var(--st-couleur-surface-enfoncee)}.st-textarea__champ:read-only:not(:disabled){background:var(--st-couleur-surface-enfoncee)}.st-textarea__champ{resize:vertical}\n"], dependencies: [{ kind: "component", type: StFormField, selector: "st-form-field", inputs: ["libelle", "aide", "complement", "erreurs", "afficherErreurs", "obligatoire", "disposition", "libelleMasque"] }, { kind: "directive", type: StControleDeChamp, selector: "[stControleDeChamp]" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
2815
+ }
2816
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: StTextarea, decorators: [{
2817
+ type: Component,
2818
+ args: [{ selector: 'st-textarea', changeDetection: ChangeDetectionStrategy.OnPush, imports: [StFormField, StControleDeChamp], host: { class: 'st-textarea' }, template: "<st-form-field\n [libelle]=\"libelle()\"\n [aide]=\"aide()\"\n [complement]=\"compteur()\"\n [erreurs]=\"errors()\"\n [afficherErreurs]=\"touched()\"\n [obligatoire]=\"required()\"\n>\n <textarea\n #champ\n class=\"st-textarea__champ\"\n stControleDeChamp\n [rows]=\"lignes()\"\n [value]=\"value()\"\n [attr.name]=\"name() || null\"\n [disabled]=\"disabled()\"\n [readOnly]=\"readonly()\"\n (input)=\"surSaisie($event)\"\n (blur)=\"touch.emit()\"\n ></textarea>\n</st-form-field>\n<span class=\"st-vh\" aria-live=\"polite\">{{ annonce.texte() }}</span>\n", styles: [".st-vh{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}:host([hidden]){display:none!important}:host{display:block}.st-textarea__champ:focus-visible{outline:2px solid var(--st-couleur-anneau-focus);outline-offset:2px}.st-textarea__champ{box-sizing:border-box;inline-size:100%;min-block-size:var(--st-cible-tactile-min);padding:var(--st-espacement-2) var(--st-espacement-3);font:inherit;color:var(--st-couleur-texte);background:var(--st-couleur-surface);border:1px solid var(--st-couleur-bordure-forte);border-radius:var(--st-rayon-sm)}.st-textarea__champ[aria-invalid=true]{border-color:var(--st-couleur-danger);box-shadow:inset 0 0 0 1px var(--st-couleur-danger)}.st-textarea__champ:disabled{color:var(--st-couleur-texte-desactive);cursor:not-allowed;background:var(--st-couleur-surface-enfoncee)}.st-textarea__champ:read-only:not(:disabled){background:var(--st-couleur-surface-enfoncee)}.st-textarea__champ{resize:vertical}\n"] }]
2819
+ }], ctorParameters: () => [], propDecorators: { lignes: [{ type: i0.Input, args: [{ isSignal: true, alias: "lignes", required: false }] }], maxLength: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxLength", required: false }] }] } });
2820
+
2821
+ let compteur$7 = 0;
2822
+ /**
2823
+ * Groupe de controles, nomme par sa QUESTION.
2824
+ *
2825
+ * ⚠️ `fieldset` et `legend` natifs (UX-7). Sans legende, un lecteur d'ecran
2826
+ * annonce « Oui, bouton radio » et « Non, bouton radio » : la reponse, jamais la
2827
+ * question. La legende est lue a l'entree dans le groupe.
2828
+ *
2829
+ * C'est le pendant de `st-form-field` pour un GROUPE : l'aide et l'erreur sont
2830
+ * reliees au `fieldset` par `aria-describedby`, et l'erreur porte sur le groupe
2831
+ * entier — « Choisissez un mode de reglement » — et non sur chaque option.
2832
+ *
2833
+ * ⚠️ L'obligation se dit dans la legende, en texte : `aria-required` n'est pas
2834
+ * valide sur un groupe, et `required` natif ferait parler le navigateur dans sa
2835
+ * propre langue.
2836
+ */
2837
+ class StFieldset {
2838
+ libelles = inject(ST_LIBELLES);
2839
+ locale = inject(ST_LOCALE);
2840
+ /** La question posee par le groupe. Obligatoire. */
2841
+ legende = input.required(/* @ts-ignore */
2842
+ ...(ngDevMode ? [{ debugName: "legende" }] : /* istanbul ignore next */ []));
2843
+ aide = input(null, /* @ts-ignore */
2844
+ ...(ngDevMode ? [{ debugName: "aide" }] : /* istanbul ignore next */ []));
2845
+ erreurs = input([], /* @ts-ignore */
2846
+ ...(ngDevMode ? [{ debugName: "erreurs" }] : /* istanbul ignore next */ []));
2847
+ afficherErreurs = input(false, { ...(ngDevMode ? { debugName: "afficherErreurs" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
2848
+ obligatoire = input(false, { ...(ngDevMode ? { debugName: "obligatoire" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
2849
+ base = `st-groupe-${(compteur$7 += 1).toString()}`;
2850
+ identifiantAide = `${this.base}-aide`;
2851
+ identifiantErreur = `${this.base}-erreur`;
2852
+ libelleObligatoire = computed(() => this.libelles().obligatoire, /* @ts-ignore */
2853
+ ...(ngDevMode ? [{ debugName: "libelleObligatoire" }] : /* istanbul ignore next */ []));
2854
+ messages = computed(() => {
2855
+ if (!this.afficherErreurs())
2856
+ return [];
2857
+ const libelles = this.libelles();
2858
+ const locale = this.locale();
2859
+ return this.erreurs().map((erreur) => messageDErreur(erreur, libelles, locale));
2860
+ }, /* @ts-ignore */
2861
+ ...(ngDevMode ? [{ debugName: "messages" }] : /* istanbul ignore next */ []));
2862
+ enErreur = computed(() => this.messages().length > 0, /* @ts-ignore */
2863
+ ...(ngDevMode ? [{ debugName: "enErreur" }] : /* istanbul ignore next */ []));
2864
+ descriptions = computed(() => {
2865
+ const ids = [];
2866
+ if (this.aide() !== null)
2867
+ ids.push(this.identifiantAide);
2868
+ if (this.enErreur())
2869
+ ids.push(this.identifiantErreur);
2870
+ return ids.length === 0 ? null : ids.join(' ');
2871
+ }, /* @ts-ignore */
2872
+ ...(ngDevMode ? [{ debugName: "descriptions" }] : /* istanbul ignore next */ []));
2873
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: StFieldset, deps: [], target: i0.ɵɵFactoryTarget.Component });
2874
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.6", type: StFieldset, isStandalone: true, selector: "st-fieldset", inputs: { legende: { classPropertyName: "legende", publicName: "legende", isSignal: true, isRequired: true, transformFunction: null }, aide: { classPropertyName: "aide", publicName: "aide", isSignal: true, isRequired: false, transformFunction: null }, erreurs: { classPropertyName: "erreurs", publicName: "erreurs", isSignal: true, isRequired: false, transformFunction: null }, afficherErreurs: { classPropertyName: "afficherErreurs", publicName: "afficherErreurs", isSignal: true, isRequired: false, transformFunction: null }, obligatoire: { classPropertyName: "obligatoire", publicName: "obligatoire", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "attr.data-en-erreur": "enErreur() ? \"\" : null" }, classAttribute: "st-fieldset" }, ngImport: i0, template: "<fieldset class=\"st-fieldset__groupe\" [attr.aria-describedby]=\"descriptions()\">\n <legend class=\"st-fieldset__legende\" [attr.data-libelle]=\"legende()\">\n {{ legende() }}\n @if (obligatoire()) {\n <span class=\"st-fieldset__obligatoire\">{{ libelleObligatoire() }}</span>\n }\n </legend>\n\n @if (aide(); as texte) {\n <p class=\"st-fieldset__aide\" [id]=\"identifiantAide\">{{ texte }}</p>\n }\n\n @if (enErreur()) {\n <div class=\"st-fieldset__erreurs\" [id]=\"identifiantErreur\">\n @for (message of messages(); track $index) {\n <st-inline-message ton=\"danger\">{{ message }}</st-inline-message>\n }\n </div>\n }\n\n <div class=\"st-fieldset__controles\">\n <ng-content />\n </div>\n</fieldset>\n", styles: [".st-vh{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}:host([hidden]){display:none!important}:host{display:block;margin-block-end:var(--st-espacement-5)}.st-fieldset__groupe{min-inline-size:0;padding:0;margin:0;border:0}.st-fieldset__legende{padding:0;margin-block-end:var(--st-espacement-2);font-weight:var(--st-graisse-semi);color:var(--st-couleur-texte)}.st-fieldset__obligatoire{margin-inline-start:var(--st-espacement-1);font-weight:var(--st-graisse-normale);color:var(--st-couleur-texte-discret)}.st-fieldset__aide{margin:0 0 var(--st-espacement-2);font-size:var(--st-taille-sm);color:var(--st-couleur-texte-discret)}.st-fieldset__erreurs{margin-block-end:var(--st-espacement-2)}.st-fieldset__controles{display:flex;flex-direction:column;gap:var(--st-espacement-2)}:host([data-en-erreur]) .st-fieldset__groupe{padding-inline-start:var(--st-espacement-3);border-inline-start:3px solid var(--st-couleur-danger)}\n"], dependencies: [{ kind: "component", type: StInlineMessage, selector: "st-inline-message", inputs: ["ton", "identifiant"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
2875
+ }
2876
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: StFieldset, decorators: [{
2877
+ type: Component,
2878
+ args: [{ selector: 'st-fieldset', changeDetection: ChangeDetectionStrategy.OnPush, imports: [StInlineMessage], host: {
2879
+ class: 'st-fieldset',
2880
+ '[attr.data-en-erreur]': 'enErreur() ? "" : null',
2881
+ }, template: "<fieldset class=\"st-fieldset__groupe\" [attr.aria-describedby]=\"descriptions()\">\n <legend class=\"st-fieldset__legende\" [attr.data-libelle]=\"legende()\">\n {{ legende() }}\n @if (obligatoire()) {\n <span class=\"st-fieldset__obligatoire\">{{ libelleObligatoire() }}</span>\n }\n </legend>\n\n @if (aide(); as texte) {\n <p class=\"st-fieldset__aide\" [id]=\"identifiantAide\">{{ texte }}</p>\n }\n\n @if (enErreur()) {\n <div class=\"st-fieldset__erreurs\" [id]=\"identifiantErreur\">\n @for (message of messages(); track $index) {\n <st-inline-message ton=\"danger\">{{ message }}</st-inline-message>\n }\n </div>\n }\n\n <div class=\"st-fieldset__controles\">\n <ng-content />\n </div>\n</fieldset>\n", styles: [".st-vh{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}:host([hidden]){display:none!important}:host{display:block;margin-block-end:var(--st-espacement-5)}.st-fieldset__groupe{min-inline-size:0;padding:0;margin:0;border:0}.st-fieldset__legende{padding:0;margin-block-end:var(--st-espacement-2);font-weight:var(--st-graisse-semi);color:var(--st-couleur-texte)}.st-fieldset__obligatoire{margin-inline-start:var(--st-espacement-1);font-weight:var(--st-graisse-normale);color:var(--st-couleur-texte-discret)}.st-fieldset__aide{margin:0 0 var(--st-espacement-2);font-size:var(--st-taille-sm);color:var(--st-couleur-texte-discret)}.st-fieldset__erreurs{margin-block-end:var(--st-espacement-2)}.st-fieldset__controles{display:flex;flex-direction:column;gap:var(--st-espacement-2)}:host([data-en-erreur]) .st-fieldset__groupe{padding-inline-start:var(--st-espacement-3);border-inline-start:3px solid var(--st-couleur-danger)}\n"] }]
2882
+ }], propDecorators: { legende: [{ type: i0.Input, args: [{ isSignal: true, alias: "legende", required: true }] }], aide: [{ type: i0.Input, args: [{ isSignal: true, alias: "aide", required: false }] }], erreurs: [{ type: i0.Input, args: [{ isSignal: true, alias: "erreurs", required: false }] }], afficherErreurs: [{ type: i0.Input, args: [{ isSignal: true, alias: "afficherErreurs", required: false }] }], obligatoire: [{ type: i0.Input, args: [{ isSignal: true, alias: "obligatoire", required: false }] }] } });
2883
+
2884
+ /**
2885
+ * Case a cocher, integree a Signal Forms.
2886
+ *
2887
+ * ```html
2888
+ * <st-checkbox libelle="J'accepte les conditions generales" [formField]="inscription.conditions" />
2889
+ * ```
2890
+ *
2891
+ * Un element `input type="checkbox"` natif : Espace coche, l'etat est annonce,
2892
+ * et la case suit le reglage de contraste du systeme sans rien ecrire.
2893
+ *
2894
+ * ⚠️ **Pour un choix a envoyer avec un formulaire.** Un reglage qui s'applique
2895
+ * IMMEDIATEMENT est un `st-switch` : la case promet un effet a l'envoi, et
2896
+ * l'interrupteur un effet tout de suite (UX-8).
2897
+ */
2898
+ class StCheckbox {
2899
+ libelle = input.required(/* @ts-ignore */
2900
+ ...(ngDevMode ? [{ debugName: "libelle" }] : /* istanbul ignore next */ []));
2901
+ aide = input(null, /* @ts-ignore */
2902
+ ...(ngDevMode ? [{ debugName: "aide" }] : /* istanbul ignore next */ []));
2903
+ /** Contrat Signal Forms. */
2904
+ checked = model(false, /* @ts-ignore */
2905
+ ...(ngDevMode ? [{ debugName: "checked" }] : /* istanbul ignore next */ []));
2906
+ errors = input([], /* @ts-ignore */
2907
+ ...(ngDevMode ? [{ debugName: "errors" }] : /* istanbul ignore next */ []));
2908
+ touched = input(false, { ...(ngDevMode ? { debugName: "touched" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
2909
+ disabled = input(false, { ...(ngDevMode ? { debugName: "disabled" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
2910
+ required = input(false, { ...(ngDevMode ? { debugName: "required" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
2911
+ hidden = input(false, { ...(ngDevMode ? { debugName: "hidden" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
2912
+ name = input('', /* @ts-ignore */
2913
+ ...(ngDevMode ? [{ debugName: "name" }] : /* istanbul ignore next */ []));
2914
+ touch = output();
2915
+ champ = viewChild.required('champ', /* @ts-ignore */
2916
+ ...(ngDevMode ? [{ debugName: "champ" }] : /* istanbul ignore next */ []));
2917
+ focus(options) {
2918
+ this.champ().nativeElement.focus(options);
2919
+ }
2920
+ surChangement(evenement) {
2921
+ this.checked.set(evenement.target.checked);
2922
+ }
2923
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: StCheckbox, deps: [], target: i0.ɵɵFactoryTarget.Component });
2924
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "22.1.6", type: StCheckbox, isStandalone: true, selector: "st-checkbox", inputs: { libelle: { classPropertyName: "libelle", publicName: "libelle", isSignal: true, isRequired: true, transformFunction: null }, aide: { classPropertyName: "aide", publicName: "aide", isSignal: true, isRequired: false, transformFunction: null }, checked: { classPropertyName: "checked", publicName: "checked", isSignal: true, isRequired: false, transformFunction: null }, errors: { classPropertyName: "errors", publicName: "errors", isSignal: true, isRequired: false, transformFunction: null }, touched: { classPropertyName: "touched", publicName: "touched", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, required: { classPropertyName: "required", publicName: "required", isSignal: true, isRequired: false, transformFunction: null }, hidden: { classPropertyName: "hidden", publicName: "hidden", isSignal: true, isRequired: false, transformFunction: null }, name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { checked: "checkedChange", touch: "touch" }, host: { properties: { "attr.hidden": "hidden() ? \"\" : null" }, classAttribute: "st-checkbox" }, viewQueries: [{ propertyName: "champ", first: true, predicate: ["champ"], descendants: true, isSignal: true }], ngImport: i0, template: "<st-form-field\n disposition=\"case\"\n [libelle]=\"libelle()\"\n [aide]=\"aide()\"\n [erreurs]=\"errors()\"\n [afficherErreurs]=\"touched()\"\n [obligatoire]=\"required()\"\n>\n <input\n #champ\n class=\"st-checkbox__case\"\n type=\"checkbox\"\n stControleDeChamp\n [checked]=\"checked()\"\n [attr.name]=\"name() || null\"\n [disabled]=\"disabled()\"\n (change)=\"surChangement($event)\"\n (blur)=\"touch.emit()\"\n />\n</st-form-field>\n", styles: [".st-vh{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}:host([hidden]){display:none!important}:host{display:block}.st-checkbox__case:focus-visible{outline:2px solid var(--st-couleur-anneau-focus);outline-offset:2px}.st-checkbox__case{inline-size:1.5rem;block-size:1.5rem;margin:0;cursor:pointer;accent-color:var(--st-couleur-primaire)}.st-checkbox__case:disabled{cursor:not-allowed}\n"], dependencies: [{ kind: "component", type: StFormField, selector: "st-form-field", inputs: ["libelle", "aide", "complement", "erreurs", "afficherErreurs", "obligatoire", "disposition", "libelleMasque"] }, { kind: "directive", type: StControleDeChamp, selector: "[stControleDeChamp]" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
2925
+ }
2926
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: StCheckbox, decorators: [{
2927
+ type: Component,
2928
+ args: [{ selector: 'st-checkbox', changeDetection: ChangeDetectionStrategy.OnPush, imports: [StFormField, StControleDeChamp], host: {
2929
+ class: 'st-checkbox',
2930
+ '[attr.hidden]': 'hidden() ? "" : null',
2931
+ }, template: "<st-form-field\n disposition=\"case\"\n [libelle]=\"libelle()\"\n [aide]=\"aide()\"\n [erreurs]=\"errors()\"\n [afficherErreurs]=\"touched()\"\n [obligatoire]=\"required()\"\n>\n <input\n #champ\n class=\"st-checkbox__case\"\n type=\"checkbox\"\n stControleDeChamp\n [checked]=\"checked()\"\n [attr.name]=\"name() || null\"\n [disabled]=\"disabled()\"\n (change)=\"surChangement($event)\"\n (blur)=\"touch.emit()\"\n />\n</st-form-field>\n", styles: [".st-vh{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}:host([hidden]){display:none!important}:host{display:block}.st-checkbox__case:focus-visible{outline:2px solid var(--st-couleur-anneau-focus);outline-offset:2px}.st-checkbox__case{inline-size:1.5rem;block-size:1.5rem;margin:0;cursor:pointer;accent-color:var(--st-couleur-primaire)}.st-checkbox__case:disabled{cursor:not-allowed}\n"] }]
2932
+ }], propDecorators: { libelle: [{ type: i0.Input, args: [{ isSignal: true, alias: "libelle", required: true }] }], aide: [{ type: i0.Input, args: [{ isSignal: true, alias: "aide", required: false }] }], checked: [{ type: i0.Input, args: [{ isSignal: true, alias: "checked", required: false }] }, { type: i0.Output, args: ["checkedChange"] }], errors: [{ type: i0.Input, args: [{ isSignal: true, alias: "errors", required: false }] }], touched: [{ type: i0.Input, args: [{ isSignal: true, alias: "touched", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], required: [{ type: i0.Input, args: [{ isSignal: true, alias: "required", required: false }] }], hidden: [{ type: i0.Input, args: [{ isSignal: true, alias: "hidden", required: false }] }], name: [{ type: i0.Input, args: [{ isSignal: true, alias: "name", required: false }] }], touch: [{ type: i0.Output, args: ["touch"] }], champ: [{ type: i0.ViewChild, args: ['champ', { isSignal: true }] }] } });
2933
+
2934
+ let compteur$6 = 0;
2935
+ /**
2936
+ * Groupe de boutons radio, integre a Signal Forms.
2937
+ *
2938
+ * ```html
2939
+ * <st-radio-group legende="Mode de reglement" [options]="modes" [formField]="commande.mode" />
2940
+ * ```
2941
+ *
2942
+ * ⚠️ **De vrais boutons radio natifs** : un seul arret de tabulation pour le
2943
+ * groupe, deplacement aux fleches, « 2 sur 3 » annonce. Les recrire en ARIA,
2944
+ * c'est cent lignes pour obtenir moins bien — meme raison que `st-theme-toggle`.
2945
+ *
2946
+ * ⚠️ **L'erreur porte sur le groupe**, par `st-fieldset`, et non sur chaque option :
2947
+ * « Choisissez un mode de reglement », une fois.
2948
+ *
2949
+ * `touch` n'est emis que lorsque le focus QUITTE le groupe : passer d'une option a
2950
+ * l'autre aux fleches n'est pas une fin de saisie, et l'erreur n'a pas a surgir
2951
+ * pendant qu'on choisit.
2952
+ */
2953
+ class StRadioGroup {
2954
+ element = inject(ElementRef);
2955
+ legende = input.required(/* @ts-ignore */
2956
+ ...(ngDevMode ? [{ debugName: "legende" }] : /* istanbul ignore next */ []));
2957
+ aide = input(null, /* @ts-ignore */
2958
+ ...(ngDevMode ? [{ debugName: "aide" }] : /* istanbul ignore next */ []));
2959
+ options = input.required(/* @ts-ignore */
2960
+ ...(ngDevMode ? [{ debugName: "options" }] : /* istanbul ignore next */ []));
2961
+ /** Contrat Signal Forms. */
2962
+ value = model('', /* @ts-ignore */
2963
+ ...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
2964
+ errors = input([], /* @ts-ignore */
2965
+ ...(ngDevMode ? [{ debugName: "errors" }] : /* istanbul ignore next */ []));
2966
+ touched = input(false, { ...(ngDevMode ? { debugName: "touched" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
2967
+ disabled = input(false, { ...(ngDevMode ? { debugName: "disabled" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
2968
+ required = input(false, { ...(ngDevMode ? { debugName: "required" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
2969
+ hidden = input(false, { ...(ngDevMode ? { debugName: "hidden" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
2970
+ name = input('', /* @ts-ignore */
2971
+ ...(ngDevMode ? [{ debugName: "name" }] : /* istanbul ignore next */ []));
2972
+ touch = output();
2973
+ /** Nom partage par les options : sans lui, chaque radio forme son propre groupe. */
2974
+ nomParDefaut = `st-radio-${(compteur$6 += 1).toString()}`;
2975
+ nomDuGroupe() {
2976
+ return this.name() === '' ? this.nomParDefaut : this.name();
2977
+ }
2978
+ identifiantAide(indice) {
2979
+ return `${this.nomParDefaut}-aide-${indice.toString()}`;
2980
+ }
2981
+ /** Focus sur l'option cochee, sinon la premiere disponible : c'est l'arret du groupe. */
2982
+ focus(options) {
2983
+ const hote = this.element.nativeElement;
2984
+ const cible = hote.querySelector('input:checked') ??
2985
+ hote.querySelector('input:not(:disabled)');
2986
+ cible?.focus(options);
2987
+ }
2988
+ choisir(valeur) {
2989
+ this.value.set(valeur);
2990
+ }
2991
+ aLaSortie(evenement) {
2992
+ const suivant = evenement.relatedTarget;
2993
+ if (suivant !== null && this.element.nativeElement.contains(suivant))
2994
+ return;
2995
+ this.touch.emit();
2996
+ }
2997
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: StRadioGroup, deps: [], target: i0.ɵɵFactoryTarget.Component });
2998
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.6", type: StRadioGroup, isStandalone: true, selector: "st-radio-group", inputs: { legende: { classPropertyName: "legende", publicName: "legende", isSignal: true, isRequired: true, transformFunction: null }, aide: { classPropertyName: "aide", publicName: "aide", isSignal: true, isRequired: false, transformFunction: null }, options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: true, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, errors: { classPropertyName: "errors", publicName: "errors", isSignal: true, isRequired: false, transformFunction: null }, touched: { classPropertyName: "touched", publicName: "touched", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, required: { classPropertyName: "required", publicName: "required", isSignal: true, isRequired: false, transformFunction: null }, hidden: { classPropertyName: "hidden", publicName: "hidden", isSignal: true, isRequired: false, transformFunction: null }, name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange", touch: "touch" }, host: { listeners: { "focusout": "aLaSortie($event)" }, properties: { "attr.hidden": "hidden() ? \"\" : null" }, classAttribute: "st-radio-group" }, ngImport: i0, template: "<st-fieldset\n [legende]=\"legende()\"\n [aide]=\"aide()\"\n [erreurs]=\"errors()\"\n [afficherErreurs]=\"touched()\"\n [obligatoire]=\"required()\"\n>\n @for (option of options(); track option.valeur; let indice = $index) {\n <div class=\"st-radio-group__option\">\n <input\n class=\"st-radio-group__radio\"\n type=\"radio\"\n [id]=\"nomDuGroupe() + '-' + indice\"\n [name]=\"nomDuGroupe()\"\n [value]=\"option.valeur\"\n [checked]=\"option.valeur === value()\"\n [disabled]=\"disabled() || option.desactivee === true\"\n [attr.aria-describedby]=\"option.aide ? identifiantAide(indice) : null\"\n (change)=\"choisir(option.valeur)\"\n />\n <label class=\"st-radio-group__libelle\" [for]=\"nomDuGroupe() + '-' + indice\">\n {{ option.libelle }}\n </label>\n @if (option.aide; as aide) {\n <p class=\"st-radio-group__aide\" [id]=\"identifiantAide(indice)\">{{ aide }}</p>\n }\n </div>\n }\n</st-fieldset>\n", styles: [".st-vh{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}:host([hidden]){display:none!important}:host{display:block}.st-radio-group__option{display:grid;grid-template-columns:auto minmax(0,1fr);column-gap:var(--st-espacement-2);align-items:center}.st-radio-group__radio:focus-visible{outline:2px solid var(--st-couleur-anneau-focus);outline-offset:2px}.st-radio-group__radio{inline-size:1.5rem;block-size:1.5rem;margin:0;cursor:pointer;accent-color:var(--st-couleur-primaire)}.st-radio-group__radio:disabled{cursor:not-allowed}.st-radio-group__libelle{cursor:pointer}.st-radio-group__aide{grid-column:2;margin:0;font-size:var(--st-taille-sm);color:var(--st-couleur-texte-discret)}\n"], dependencies: [{ kind: "component", type: StFieldset, selector: "st-fieldset", inputs: ["legende", "aide", "erreurs", "afficherErreurs", "obligatoire"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
2999
+ }
3000
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: StRadioGroup, decorators: [{
3001
+ type: Component,
3002
+ args: [{ selector: 'st-radio-group', changeDetection: ChangeDetectionStrategy.OnPush, imports: [StFieldset], host: {
3003
+ class: 'st-radio-group',
3004
+ '[attr.hidden]': 'hidden() ? "" : null',
3005
+ '(focusout)': 'aLaSortie($event)',
3006
+ }, template: "<st-fieldset\n [legende]=\"legende()\"\n [aide]=\"aide()\"\n [erreurs]=\"errors()\"\n [afficherErreurs]=\"touched()\"\n [obligatoire]=\"required()\"\n>\n @for (option of options(); track option.valeur; let indice = $index) {\n <div class=\"st-radio-group__option\">\n <input\n class=\"st-radio-group__radio\"\n type=\"radio\"\n [id]=\"nomDuGroupe() + '-' + indice\"\n [name]=\"nomDuGroupe()\"\n [value]=\"option.valeur\"\n [checked]=\"option.valeur === value()\"\n [disabled]=\"disabled() || option.desactivee === true\"\n [attr.aria-describedby]=\"option.aide ? identifiantAide(indice) : null\"\n (change)=\"choisir(option.valeur)\"\n />\n <label class=\"st-radio-group__libelle\" [for]=\"nomDuGroupe() + '-' + indice\">\n {{ option.libelle }}\n </label>\n @if (option.aide; as aide) {\n <p class=\"st-radio-group__aide\" [id]=\"identifiantAide(indice)\">{{ aide }}</p>\n }\n </div>\n }\n</st-fieldset>\n", styles: [".st-vh{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}:host([hidden]){display:none!important}:host{display:block}.st-radio-group__option{display:grid;grid-template-columns:auto minmax(0,1fr);column-gap:var(--st-espacement-2);align-items:center}.st-radio-group__radio:focus-visible{outline:2px solid var(--st-couleur-anneau-focus);outline-offset:2px}.st-radio-group__radio{inline-size:1.5rem;block-size:1.5rem;margin:0;cursor:pointer;accent-color:var(--st-couleur-primaire)}.st-radio-group__radio:disabled{cursor:not-allowed}.st-radio-group__libelle{cursor:pointer}.st-radio-group__aide{grid-column:2;margin:0;font-size:var(--st-taille-sm);color:var(--st-couleur-texte-discret)}\n"] }]
3007
+ }], propDecorators: { legende: [{ type: i0.Input, args: [{ isSignal: true, alias: "legende", required: true }] }], aide: [{ type: i0.Input, args: [{ isSignal: true, alias: "aide", required: false }] }], options: [{ type: i0.Input, args: [{ isSignal: true, alias: "options", required: true }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }], errors: [{ type: i0.Input, args: [{ isSignal: true, alias: "errors", required: false }] }], touched: [{ type: i0.Input, args: [{ isSignal: true, alias: "touched", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], required: [{ type: i0.Input, args: [{ isSignal: true, alias: "required", required: false }] }], hidden: [{ type: i0.Input, args: [{ isSignal: true, alias: "hidden", required: false }] }], name: [{ type: i0.Input, args: [{ isSignal: true, alias: "name", required: false }] }], touch: [{ type: i0.Output, args: ["touch"] }] } });
3008
+
3009
+ /**
3010
+ * Interrupteur : un reglage qui s'applique IMMEDIATEMENT.
3011
+ *
3012
+ * ```html
3013
+ * <st-switch libelle="Notifications par SMS" [(checked)]="sms" (checkedChange)="enregistrer($event)" />
3014
+ * ```
3015
+ *
3016
+ * ⚠️ **Jamais dans un formulaire a envoyer** (UX-8). Un interrupteur promet que
3017
+ * l'effet a lieu au basculement ; pose au-dessus d'un bouton « Enregistrer », il
3018
+ * ment — la personne croit le reglage applique, quitte la page, et le perd. Pour
3019
+ * un choix envoye plus tard, c'est `st-checkbox`.
3020
+ *
3021
+ * C'est pourquoi il n'affiche aucune erreur de validation : un reglage immediat
3022
+ * ne se valide pas a l'envoi. Un refus du serveur se dit par un message, et
3023
+ * l'interrupteur revient a son etat precedent.
3024
+ *
3025
+ * ⚠️ Une case a cocher native avec `role="switch"` : Espace bascule, l'etiquette
3026
+ * est reliee par `for`, et le lecteur d'ecran annonce « active » ou
3027
+ * « desactive » — mieux qu'un `div` qui imiterait tout cela.
3028
+ */
3029
+ class StSwitch {
3030
+ libelle = input.required(/* @ts-ignore */
3031
+ ...(ngDevMode ? [{ debugName: "libelle" }] : /* istanbul ignore next */ []));
3032
+ aide = input(null, /* @ts-ignore */
3033
+ ...(ngDevMode ? [{ debugName: "aide" }] : /* istanbul ignore next */ []));
3034
+ /** Contrat Signal Forms. */
3035
+ checked = model(false, /* @ts-ignore */
3036
+ ...(ngDevMode ? [{ debugName: "checked" }] : /* istanbul ignore next */ []));
3037
+ disabled = input(false, { ...(ngDevMode ? { debugName: "disabled" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
3038
+ hidden = input(false, { ...(ngDevMode ? { debugName: "hidden" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
3039
+ name = input('', /* @ts-ignore */
3040
+ ...(ngDevMode ? [{ debugName: "name" }] : /* istanbul ignore next */ []));
3041
+ touch = output();
3042
+ champ = viewChild.required('champ', /* @ts-ignore */
3043
+ ...(ngDevMode ? [{ debugName: "champ" }] : /* istanbul ignore next */ []));
3044
+ focus(options) {
3045
+ this.champ().nativeElement.focus(options);
3046
+ }
3047
+ surChangement(evenement) {
3048
+ this.checked.set(evenement.target.checked);
3049
+ }
3050
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: StSwitch, deps: [], target: i0.ɵɵFactoryTarget.Component });
3051
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "22.1.6", type: StSwitch, isStandalone: true, selector: "st-switch", inputs: { libelle: { classPropertyName: "libelle", publicName: "libelle", isSignal: true, isRequired: true, transformFunction: null }, aide: { classPropertyName: "aide", publicName: "aide", isSignal: true, isRequired: false, transformFunction: null }, checked: { classPropertyName: "checked", publicName: "checked", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, hidden: { classPropertyName: "hidden", publicName: "hidden", isSignal: true, isRequired: false, transformFunction: null }, name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { checked: "checkedChange", touch: "touch" }, host: { properties: { "attr.hidden": "hidden() ? \"\" : null" }, classAttribute: "st-switch" }, viewQueries: [{ propertyName: "champ", first: true, predicate: ["champ"], descendants: true, isSignal: true }], ngImport: i0, template: "<st-form-field disposition=\"case\" [libelle]=\"libelle()\" [aide]=\"aide()\">\n <input\n #champ\n class=\"st-switch__interrupteur\"\n type=\"checkbox\"\n role=\"switch\"\n stControleDeChamp\n [checked]=\"checked()\"\n [attr.aria-checked]=\"checked()\"\n [attr.name]=\"name() || null\"\n [disabled]=\"disabled()\"\n (change)=\"surChangement($event)\"\n (blur)=\"touch.emit()\"\n />\n</st-form-field>\n", styles: [".st-vh{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}:host([hidden]){display:none!important}:host{display:block}.st-switch__interrupteur:focus-visible{outline:2px solid var(--st-couleur-anneau-focus);outline-offset:2px}.st-switch__interrupteur{position:relative;inline-size:2.75rem;block-size:1.5rem;margin:0;cursor:pointer;background:var(--st-couleur-surface-enfoncee);border:1px solid var(--st-couleur-bordure-forte);border-radius:var(--st-rayon-pleine);appearance:none}.st-switch__interrupteur:after{position:absolute;inset-block-start:50%;inset-inline-start:.125rem;inline-size:1.125rem;block-size:1.125rem;content:\"\";background:var(--st-couleur-texte-discret);border-radius:var(--st-rayon-pleine);transition:inset-inline-start var(--st-duree-rapide) ease;transform:translateY(-50%)}.st-switch__interrupteur:checked{background:var(--st-couleur-primaire);border-color:var(--st-couleur-primaire)}.st-switch__interrupteur:checked:after{inset-inline-start:calc(100% - 1.25rem);background:var(--st-couleur-sur-primaire)}.st-switch__interrupteur:disabled{cursor:not-allowed;opacity:.6}@media(forced-colors:active){.st-switch__interrupteur{border-color:CanvasText}.st-switch__interrupteur:after{background:CanvasText}.st-switch__interrupteur:checked:after{background:Highlight}}\n"], dependencies: [{ kind: "component", type: StFormField, selector: "st-form-field", inputs: ["libelle", "aide", "complement", "erreurs", "afficherErreurs", "obligatoire", "disposition", "libelleMasque"] }, { kind: "directive", type: StControleDeChamp, selector: "[stControleDeChamp]" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
3052
+ }
3053
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: StSwitch, decorators: [{
3054
+ type: Component,
3055
+ args: [{ selector: 'st-switch', changeDetection: ChangeDetectionStrategy.OnPush, imports: [StFormField, StControleDeChamp], host: {
3056
+ class: 'st-switch',
3057
+ '[attr.hidden]': 'hidden() ? "" : null',
3058
+ }, template: "<st-form-field disposition=\"case\" [libelle]=\"libelle()\" [aide]=\"aide()\">\n <input\n #champ\n class=\"st-switch__interrupteur\"\n type=\"checkbox\"\n role=\"switch\"\n stControleDeChamp\n [checked]=\"checked()\"\n [attr.aria-checked]=\"checked()\"\n [attr.name]=\"name() || null\"\n [disabled]=\"disabled()\"\n (change)=\"surChangement($event)\"\n (blur)=\"touch.emit()\"\n />\n</st-form-field>\n", styles: [".st-vh{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}:host([hidden]){display:none!important}:host{display:block}.st-switch__interrupteur:focus-visible{outline:2px solid var(--st-couleur-anneau-focus);outline-offset:2px}.st-switch__interrupteur{position:relative;inline-size:2.75rem;block-size:1.5rem;margin:0;cursor:pointer;background:var(--st-couleur-surface-enfoncee);border:1px solid var(--st-couleur-bordure-forte);border-radius:var(--st-rayon-pleine);appearance:none}.st-switch__interrupteur:after{position:absolute;inset-block-start:50%;inset-inline-start:.125rem;inline-size:1.125rem;block-size:1.125rem;content:\"\";background:var(--st-couleur-texte-discret);border-radius:var(--st-rayon-pleine);transition:inset-inline-start var(--st-duree-rapide) ease;transform:translateY(-50%)}.st-switch__interrupteur:checked{background:var(--st-couleur-primaire);border-color:var(--st-couleur-primaire)}.st-switch__interrupteur:checked:after{inset-inline-start:calc(100% - 1.25rem);background:var(--st-couleur-sur-primaire)}.st-switch__interrupteur:disabled{cursor:not-allowed;opacity:.6}@media(forced-colors:active){.st-switch__interrupteur{border-color:CanvasText}.st-switch__interrupteur:after{background:CanvasText}.st-switch__interrupteur:checked:after{background:Highlight}}\n"] }]
3059
+ }], propDecorators: { libelle: [{ type: i0.Input, args: [{ isSignal: true, alias: "libelle", required: true }] }], aide: [{ type: i0.Input, args: [{ isSignal: true, alias: "aide", required: false }] }], checked: [{ type: i0.Input, args: [{ isSignal: true, alias: "checked", required: false }] }, { type: i0.Output, args: ["checkedChange"] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], hidden: [{ type: i0.Input, args: [{ isSignal: true, alias: "hidden", required: false }] }], name: [{ type: i0.Input, args: [{ isSignal: true, alias: "name", required: false }] }], touch: [{ type: i0.Output, args: ["touch"] }], champ: [{ type: i0.ViewChild, args: ['champ', { isSignal: true }] }] } });
3060
+
3061
+ let compteur$5 = 0;
3062
+ /**
3063
+ * Recapitulatif des erreurs d'un formulaire, a l'envoi.
3064
+ *
3065
+ * ```html
3066
+ * <st-error-summary [erreurs]="tentative() ? virement().errorSummary() : []" />
3067
+ * ```
3068
+ *
3069
+ * ⚠️ **Il prend le focus en apparaissant** (UX-5). Sans lui, une personne au
3070
+ * clavier ou au lecteur d'ecran appuie sur « Envoyer », et rien ne se passe : le
3071
+ * champ refuse est en haut de la page, hors de sa vue, et personne ne le lui dit.
3072
+ *
3073
+ * ⚠️ **Chaque ligne nomme son champ.** « Ce champ est obligatoire. » repete cinq
3074
+ * fois n'apprend rien ; « Nom du beneficiaire : ce champ est obligatoire. », si.
3075
+ * Le libelle est lu sur l'element lie au champ, par Signal Forms — sans registre,
3076
+ * et quel que soit le composant.
3077
+ *
3078
+ * ⚠️ **Une ligne par champ**, la premiere erreur seulement : trois erreurs sur le
3079
+ * meme IBAN font trois lignes pour une seule correction.
3080
+ *
3081
+ * ⚠️ **Une region nommee par son titre.** Un `div` sans role ne PEUT pas porter
3082
+ * `aria-labelledby` : le nom serait ignore, et le focus n'annoncerait rien. En
3083
+ * region, il annonce « 2 erreurs a corriger » a l'arrivee du focus, et se
3084
+ * retrouve dans la liste des reperes.
3085
+ *
3086
+ * Chaque ligne amene le focus sur son champ : c'est le champ, et non la ligne,
3087
+ * qu'il faut corriger. Une erreur rattachee au formulaire entier — un refus du
3088
+ * serveur sur un champ inconnu — s'affiche sans lien.
3089
+ */
3090
+ class StErrorSummary {
3091
+ libelles = inject(ST_LIBELLES);
3092
+ locale = inject(ST_LOCALE);
3093
+ element = inject(ElementRef);
3094
+ injecteur = inject(Injector);
3095
+ erreurs = input.required(/* @ts-ignore */
3096
+ ...(ngDevMode ? [{ debugName: "erreurs" }] : /* istanbul ignore next */ []));
3097
+ /** `null` : « N erreurs a corriger », du dictionnaire. */
3098
+ titre = input(null, /* @ts-ignore */
3099
+ ...(ngDevMode ? [{ debugName: "titre" }] : /* istanbul ignore next */ []));
3100
+ /** Unique par instance : deux recapitulatifs sur une page partageraient leur titre. */
3101
+ identifiantDuTitre = `st-recapitulatif-${(compteur$5 += 1).toString()}`;
3102
+ lignes = computed(() => {
3103
+ const libelles = this.libelles();
3104
+ const locale = this.locale();
3105
+ const vus = new Set();
3106
+ const lignes = [];
3107
+ for (const erreur of this.erreurs()) {
3108
+ const champ = erreur.fieldTree;
3109
+ if (champ !== undefined) {
3110
+ if (vus.has(champ))
3111
+ continue;
3112
+ vus.add(champ);
3113
+ }
3114
+ const etat = champ?.();
3115
+ const liaison = etat?.formFieldBindings()[0];
3116
+ lignes.push({
3117
+ libelle: liaison === undefined ? null : libelleDe(liaison.element),
3118
+ message: messageDErreur(erreur, libelles, locale),
3119
+ aller: () => {
3120
+ etat?.focusBoundControl();
3121
+ },
3122
+ });
3123
+ }
3124
+ return lignes;
3125
+ }, /* @ts-ignore */
3126
+ ...(ngDevMode ? [{ debugName: "lignes" }] : /* istanbul ignore next */ []));
3127
+ titreLu = computed(() => this.titre() ?? this.libelles().erreursACorriger(this.lignes().length), /* @ts-ignore */
3128
+ ...(ngDevMode ? [{ debugName: "titreLu" }] : /* istanbul ignore next */ []));
3129
+ constructor() {
3130
+ // Le focus a l'APPARITION seulement : le reprendre a chaque correction
3131
+ // arracherait la personne au champ qu'elle est en train de corriger.
3132
+ let visible = false;
3133
+ effect(() => {
3134
+ const maintenant = this.lignes().length > 0;
3135
+ if (maintenant && !visible) {
3136
+ afterNextRender(() => {
3137
+ this.focus();
3138
+ }, { injector: this.injecteur });
3139
+ }
3140
+ visible = maintenant;
3141
+ });
3142
+ }
3143
+ /** A appeler apres un envoi refuse, quand le recapitulatif etait deja visible. */
3144
+ focus() {
3145
+ this.element.nativeElement.querySelector('.st-error-summary__cadre')?.focus();
3146
+ }
3147
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: StErrorSummary, deps: [], target: i0.ɵɵFactoryTarget.Component });
3148
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.6", type: StErrorSummary, isStandalone: true, selector: "st-error-summary", inputs: { erreurs: { classPropertyName: "erreurs", publicName: "erreurs", isSignal: true, isRequired: true, transformFunction: null }, titre: { classPropertyName: "titre", publicName: "titre", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "attr.hidden": "lignes().length === 0 ? \"\" : null" }, classAttribute: "st-error-summary" }, ngImport: i0, template: "@if (lignes().length > 0) {\n <div\n class=\"st-error-summary__cadre\"\n role=\"region\"\n tabindex=\"-1\"\n [attr.aria-labelledby]=\"identifiantDuTitre\"\n >\n <h2 class=\"st-error-summary__titre\" [id]=\"identifiantDuTitre\">\n <st-icon nom=\"cercle-croix\" taille=\"sm\" />\n {{ titreLu() }}\n </h2>\n <ul class=\"st-error-summary__liste\">\n @for (ligne of lignes(); track $index) {\n <li>\n @if (ligne.libelle !== null) {\n <button type=\"button\" class=\"st-error-summary__lien\" (click)=\"ligne.aller()\">\n {{ ligne.libelle }} : {{ ligne.message }}\n </button>\n } @else {\n {{ ligne.message }}\n }\n </li>\n }\n </ul>\n </div>\n}\n", styles: [".st-vh{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}:host([hidden]){display:none!important}:host{display:block;margin-block-end:var(--st-espacement-5)}.st-error-summary__cadre:focus{outline:2px solid var(--st-couleur-anneau-focus);outline-offset:2px}.st-error-summary__cadre{padding:var(--st-espacement-4);color:var(--st-couleur-sur-danger-discret);background:var(--st-couleur-danger-discret);border:2px solid var(--st-couleur-danger);border-radius:var(--st-rayon-md)}.st-error-summary__titre{display:flex;gap:var(--st-espacement-2);align-items:center;margin:0 0 var(--st-espacement-2);font-size:var(--st-taille-lg)}.st-error-summary__liste{padding-inline-start:var(--st-espacement-5);margin:0}.st-error-summary__lien:focus-visible{outline:2px solid var(--st-couleur-anneau-focus);outline-offset:2px}.st-error-summary__lien{padding:0;font:inherit;color:inherit;text-align:start;text-decoration:underline;cursor:pointer;background:none;border:0}@media(forced-colors:active){.st-error-summary__cadre{border-color:CanvasText}}\n"], dependencies: [{ kind: "component", type: StIcon, selector: "st-icon", inputs: ["nom", "taille", "ton", "etiquette"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
3149
+ }
3150
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: StErrorSummary, decorators: [{
3151
+ type: Component,
3152
+ args: [{ selector: 'st-error-summary', changeDetection: ChangeDetectionStrategy.OnPush, imports: [StIcon], host: {
3153
+ class: 'st-error-summary',
3154
+ '[attr.hidden]': 'lignes().length === 0 ? "" : null',
3155
+ }, template: "@if (lignes().length > 0) {\n <div\n class=\"st-error-summary__cadre\"\n role=\"region\"\n tabindex=\"-1\"\n [attr.aria-labelledby]=\"identifiantDuTitre\"\n >\n <h2 class=\"st-error-summary__titre\" [id]=\"identifiantDuTitre\">\n <st-icon nom=\"cercle-croix\" taille=\"sm\" />\n {{ titreLu() }}\n </h2>\n <ul class=\"st-error-summary__liste\">\n @for (ligne of lignes(); track $index) {\n <li>\n @if (ligne.libelle !== null) {\n <button type=\"button\" class=\"st-error-summary__lien\" (click)=\"ligne.aller()\">\n {{ ligne.libelle }} : {{ ligne.message }}\n </button>\n } @else {\n {{ ligne.message }}\n }\n </li>\n }\n </ul>\n </div>\n}\n", styles: [".st-vh{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}:host([hidden]){display:none!important}:host{display:block;margin-block-end:var(--st-espacement-5)}.st-error-summary__cadre:focus{outline:2px solid var(--st-couleur-anneau-focus);outline-offset:2px}.st-error-summary__cadre{padding:var(--st-espacement-4);color:var(--st-couleur-sur-danger-discret);background:var(--st-couleur-danger-discret);border:2px solid var(--st-couleur-danger);border-radius:var(--st-rayon-md)}.st-error-summary__titre{display:flex;gap:var(--st-espacement-2);align-items:center;margin:0 0 var(--st-espacement-2);font-size:var(--st-taille-lg)}.st-error-summary__liste{padding-inline-start:var(--st-espacement-5);margin:0}.st-error-summary__lien:focus-visible{outline:2px solid var(--st-couleur-anneau-focus);outline-offset:2px}.st-error-summary__lien{padding:0;font:inherit;color:inherit;text-align:start;text-decoration:underline;cursor:pointer;background:none;border:0}@media(forced-colors:active){.st-error-summary__cadre{border-color:CanvasText}}\n"] }]
3156
+ }], ctorParameters: () => [], propDecorators: { erreurs: [{ type: i0.Input, args: [{ isSignal: true, alias: "erreurs", required: true }] }], titre: [{ type: i0.Input, args: [{ isSignal: true, alias: "titre", required: false }] }] } });
3157
+ /**
3158
+ * Libelle d'un champ, lu sur l'element lie : l'attribut pose par le socle, sinon
3159
+ * l'etiquette native, sinon `aria-label`.
3160
+ */
3161
+ function libelleDe(element) {
3162
+ const socle = element.querySelector('[data-libelle]')?.getAttribute('data-libelle');
3163
+ if (socle !== null && socle !== undefined)
3164
+ return socle;
3165
+ const etiquette = element.labels?.[0]?.textContent.trim();
3166
+ if (etiquette !== undefined && etiquette !== '')
3167
+ return etiquette;
3168
+ return element.getAttribute('aria-label');
3169
+ }
3170
+
3171
+ /**
3172
+ * Mot de passe, avec revelation.
3173
+ *
3174
+ * ```html
3175
+ * <st-password-field libelle="Mot de passe" usage="creation" [regles]="regles" [formField]="compte.motDePasse" />
3176
+ * ```
3177
+ *
3178
+ * ⚠️ **`autocomplete` selon l'usage** (SEC-2) : `current-password` a la connexion,
3179
+ * `new-password` a la creation — c'est ce qui fait proposer par le gestionnaire
3180
+ * un mot de passe FORT au bon endroit, et non l'ancien.
3181
+ *
3182
+ * ⚠️ **Le collage n'est jamais bloque** (SEC-1, NIST SP 800-63B) : l'interdire
3183
+ * pousse vers des mots de passe courts, retenus de tete, et casse les
3184
+ * gestionnaires de mots de passe.
3185
+ *
3186
+ * ⚠️ **Revele, il se remasque des que le focus quitte le champ, et a l'envoi du
3187
+ * formulaire** (SEC-4) : un mot de passe laisse en clair reste lisible par-dessus
3188
+ * l'epaule, sur l'ecran suivant comme sur celui-ci. L'envoi par Entree ne fait
3189
+ * pas quitter le champ : d'ou l'ecoute de `submit`, qui remonte jusqu'au document.
3190
+ *
3191
+ * Le bouton de revelation est un bouton bascule : `aria-pressed` porte l'etat, et
3192
+ * l'etiquette ne change PAS — « Masquer le mot de passe, enfonce » se lirait
3193
+ * comme une double negation.
3194
+ *
3195
+ * ⚠️ **Aucun indicateur de « force »**, et c'est un refus. Une estimation faite
3196
+ * dans le navigateur donne « fort » a `Motdepasse1!` : elle rassure a tort. Les
3197
+ * regles sont affichees AVANT la saisie (UX-10), et c'est le serveur qui verifie —
3198
+ * y compris contre les mots de passe deja divulgues, qu'aucune regle locale ne
3199
+ * voit.
3200
+ */
3201
+ class StPasswordField extends ControleDeSaisie {
3202
+ libelles = inject(ST_LIBELLES);
3203
+ element = inject(ElementRef);
3204
+ usage = input('connexion', /* @ts-ignore */
3205
+ ...(ngDevMode ? [{ debugName: "usage" }] : /* istanbul ignore next */ []));
3206
+ /** Regles affichees avant la saisie, comme aide du champ. */
3207
+ regles = input([], /* @ts-ignore */
3208
+ ...(ngDevMode ? [{ debugName: "regles" }] : /* istanbul ignore next */ []));
3209
+ revele = signal(false, /* @ts-ignore */
3210
+ ...(ngDevMode ? [{ debugName: "revele" }] : /* istanbul ignore next */ []));
3211
+ autocomplete = computed(() => this.usage() === 'creation' ? 'new-password' : 'current-password', /* @ts-ignore */
3212
+ ...(ngDevMode ? [{ debugName: "autocomplete" }] : /* istanbul ignore next */ []));
3213
+ aideLue = computed(() => {
3214
+ const regles = this.regles();
3215
+ const aide = this.aide();
3216
+ if (regles.length === 0)
3217
+ return aide;
3218
+ return [aide, ...regles].filter((texte) => texte !== null).join(' ');
3219
+ }, /* @ts-ignore */
3220
+ ...(ngDevMode ? [{ debugName: "aideLue" }] : /* istanbul ignore next */ []));
3221
+ basculer() {
3222
+ this.revele.update((revele) => !revele);
3223
+ // Revele alors que le focus est ailleurs — clic direct sur le bouton, champ
3224
+ // rempli par le gestionnaire —, il ne pourrait plus quitter le champ : rien ne
3225
+ // le remasquerait. Au clavier, le focus est deja sur le bouton, et y reste.
3226
+ const hote = this.element.nativeElement;
3227
+ if (this.revele() && !hote.contains(hote.ownerDocument.activeElement))
3228
+ this.focus();
3229
+ }
3230
+ surSaisie(evenement) {
3231
+ this.value.set(this.texteSaisi(evenement));
3232
+ }
3233
+ aLEnvoi(evenement) {
3234
+ const formulaire = evenement.target;
3235
+ if (formulaire?.contains(this.element.nativeElement) === true)
3236
+ this.revele.set(false);
3237
+ }
3238
+ aLaSortie(evenement) {
3239
+ const suivant = evenement.relatedTarget;
3240
+ if (suivant !== null && this.element.nativeElement.contains(suivant))
3241
+ return;
3242
+ this.revele.set(false);
3243
+ }
3244
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: StPasswordField, deps: null, target: i0.ɵɵFactoryTarget.Component });
3245
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.1.6", type: StPasswordField, isStandalone: true, selector: "st-password-field", inputs: { usage: { classPropertyName: "usage", publicName: "usage", isSignal: true, isRequired: false, transformFunction: null }, regles: { classPropertyName: "regles", publicName: "regles", isSignal: true, isRequired: false, transformFunction: null } }, host: { listeners: { "focusout": "aLaSortie($event)", "document:submit": "aLEnvoi($event)" }, classAttribute: "st-password-field" }, usesInheritance: true, ngImport: i0, template: "<st-form-field\n [libelle]=\"libelle()\"\n [aide]=\"aideLue()\"\n [erreurs]=\"errors()\"\n [afficherErreurs]=\"touched()\"\n [obligatoire]=\"required()\"\n>\n <div class=\"st-password-field__ligne\">\n <input\n #champ\n class=\"st-password-field__champ\"\n stControleDeChamp\n spellcheck=\"false\"\n autocapitalize=\"none\"\n autocorrect=\"off\"\n [type]=\"revele() ? 'text' : 'password'\"\n [value]=\"value()\"\n [attr.autocomplete]=\"autocomplete()\"\n [attr.name]=\"name() || null\"\n [disabled]=\"disabled()\"\n [readOnly]=\"readonly()\"\n (input)=\"surSaisie($event)\"\n (blur)=\"touch.emit()\"\n />\n <!-- eslint-disable-next-line @angular-eslint/template/elements-content --\n Le contenu vient du gabarit de stIconButton. Le nom accessible est\n impose par le type (`etiquette` est requis) et verifie par axe.\n `mousedown` sans effet par defaut : le focus reste dans le champ. Safari\n ne donne pas le focus a un bouton clique, et la sortie du champ\n remasquerait juste avant que le clic ne revele a nouveau. -->\n <button\n stIconButton\n type=\"button\"\n [icone]=\"revele() ? 'oeil-barre' : 'oeil'\"\n [etiquette]=\"libelles().afficherLeMotDePasse\"\n [enfonce]=\"revele()\"\n [disabled]=\"disabled()\"\n (mousedown)=\"$event.preventDefault()\"\n (click)=\"basculer()\"\n ></button>\n </div>\n</st-form-field>\n", styles: [".st-vh{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}:host([hidden]){display:none!important}:host{display:block}.st-password-field__ligne{display:flex;gap:var(--st-espacement-1);align-items:center}.st-password-field__champ:focus-visible{outline:2px solid var(--st-couleur-anneau-focus);outline-offset:2px}.st-password-field__champ{box-sizing:border-box;inline-size:100%;min-block-size:var(--st-cible-tactile-min);padding:var(--st-espacement-2) var(--st-espacement-3);font:inherit;color:var(--st-couleur-texte);background:var(--st-couleur-surface);border:1px solid var(--st-couleur-bordure-forte);border-radius:var(--st-rayon-sm)}.st-password-field__champ[aria-invalid=true]{border-color:var(--st-couleur-danger);box-shadow:inset 0 0 0 1px var(--st-couleur-danger)}.st-password-field__champ:disabled{color:var(--st-couleur-texte-desactive);cursor:not-allowed;background:var(--st-couleur-surface-enfoncee)}.st-password-field__champ:read-only:not(:disabled){background:var(--st-couleur-surface-enfoncee)}.st-password-field__champ{flex:1 1 auto}\n"], dependencies: [{ kind: "component", type: StFormField, selector: "st-form-field", inputs: ["libelle", "aide", "complement", "erreurs", "afficherErreurs", "obligatoire", "disposition", "libelleMasque"] }, { kind: "directive", type: StControleDeChamp, selector: "[stControleDeChamp]" }, { kind: "component", type: StIconButton, selector: "button[stIconButton]", inputs: ["icone", "etiquette", "variante", "taille", "enfonce"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
3246
+ }
3247
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: StPasswordField, decorators: [{
3248
+ type: Component,
3249
+ args: [{ selector: 'st-password-field', changeDetection: ChangeDetectionStrategy.OnPush, imports: [StFormField, StControleDeChamp, StIconButton], host: {
3250
+ class: 'st-password-field',
3251
+ '(focusout)': 'aLaSortie($event)',
3252
+ '(document:submit)': 'aLEnvoi($event)',
3253
+ }, template: "<st-form-field\n [libelle]=\"libelle()\"\n [aide]=\"aideLue()\"\n [erreurs]=\"errors()\"\n [afficherErreurs]=\"touched()\"\n [obligatoire]=\"required()\"\n>\n <div class=\"st-password-field__ligne\">\n <input\n #champ\n class=\"st-password-field__champ\"\n stControleDeChamp\n spellcheck=\"false\"\n autocapitalize=\"none\"\n autocorrect=\"off\"\n [type]=\"revele() ? 'text' : 'password'\"\n [value]=\"value()\"\n [attr.autocomplete]=\"autocomplete()\"\n [attr.name]=\"name() || null\"\n [disabled]=\"disabled()\"\n [readOnly]=\"readonly()\"\n (input)=\"surSaisie($event)\"\n (blur)=\"touch.emit()\"\n />\n <!-- eslint-disable-next-line @angular-eslint/template/elements-content --\n Le contenu vient du gabarit de stIconButton. Le nom accessible est\n impose par le type (`etiquette` est requis) et verifie par axe.\n `mousedown` sans effet par defaut : le focus reste dans le champ. Safari\n ne donne pas le focus a un bouton clique, et la sortie du champ\n remasquerait juste avant que le clic ne revele a nouveau. -->\n <button\n stIconButton\n type=\"button\"\n [icone]=\"revele() ? 'oeil-barre' : 'oeil'\"\n [etiquette]=\"libelles().afficherLeMotDePasse\"\n [enfonce]=\"revele()\"\n [disabled]=\"disabled()\"\n (mousedown)=\"$event.preventDefault()\"\n (click)=\"basculer()\"\n ></button>\n </div>\n</st-form-field>\n", styles: [".st-vh{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}:host([hidden]){display:none!important}:host{display:block}.st-password-field__ligne{display:flex;gap:var(--st-espacement-1);align-items:center}.st-password-field__champ:focus-visible{outline:2px solid var(--st-couleur-anneau-focus);outline-offset:2px}.st-password-field__champ{box-sizing:border-box;inline-size:100%;min-block-size:var(--st-cible-tactile-min);padding:var(--st-espacement-2) var(--st-espacement-3);font:inherit;color:var(--st-couleur-texte);background:var(--st-couleur-surface);border:1px solid var(--st-couleur-bordure-forte);border-radius:var(--st-rayon-sm)}.st-password-field__champ[aria-invalid=true]{border-color:var(--st-couleur-danger);box-shadow:inset 0 0 0 1px var(--st-couleur-danger)}.st-password-field__champ:disabled{color:var(--st-couleur-texte-desactive);cursor:not-allowed;background:var(--st-couleur-surface-enfoncee)}.st-password-field__champ:read-only:not(:disabled){background:var(--st-couleur-surface-enfoncee)}.st-password-field__champ{flex:1 1 auto}\n"] }]
3254
+ }], propDecorators: { usage: [{ type: i0.Input, args: [{ isSignal: true, alias: "usage", required: false }] }], regles: [{ type: i0.Input, args: [{ isSignal: true, alias: "regles", required: false }] }] } });
3255
+
3256
+ /**
3257
+ * Code a usage unique : second facteur, code recu par SMS ou par courriel.
3258
+ *
3259
+ * ⚠️ **UN seul champ, pas six cases** (UX-9). Six champs cassent le collage, le
3260
+ * remplissage automatique du code recu par SMS, et la lecture au lecteur d'ecran,
3261
+ * qui annonce six champs sans nom au lieu d'un seul.
3262
+ *
3263
+ * ⚠️ `autocomplete="one-time-code"` : iOS et Android proposent alors le code recu,
3264
+ * d'un toucher. Clavier numerique par `inputmode`, et NON par `type="number"`,
3265
+ * qui retire les zeros de tete et accepte « 1e5 ».
3266
+ *
3267
+ * ⚠️ **Aucun envoi automatique** a la sixieme saisie : un formulaire qui part de
3268
+ * lui-meme surprend (WCAG 3.2.2), et part aussi avec un code mal colle. Le code
3269
+ * colle est nettoye de ses espaces et tirets — « 123 456 » —, jamais tronque.
3270
+ */
3271
+ class StOtpField extends ControleDeSaisie {
3272
+ libelles = inject(ST_LIBELLES);
3273
+ longueur = input(6, /* @ts-ignore */
3274
+ ...(ngDevMode ? [{ debugName: "longueur" }] : /* istanbul ignore next */ []));
3275
+ aideLue = computed(() => this.aide() ?? this.libelles().codeAChiffres(this.longueur()), /* @ts-ignore */
3276
+ ...(ngDevMode ? [{ debugName: "aideLue" }] : /* istanbul ignore next */ []));
3277
+ surSaisie(evenement) {
3278
+ this.value.set(this.texteSaisi(evenement).replace(/[\s-]/g, ''));
3279
+ }
3280
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: StOtpField, deps: null, target: i0.ɵɵFactoryTarget.Component });
3281
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.1.6", type: StOtpField, isStandalone: true, selector: "st-otp-field", inputs: { longueur: { classPropertyName: "longueur", publicName: "longueur", isSignal: true, isRequired: false, transformFunction: null } }, host: { classAttribute: "st-otp-field" }, usesInheritance: true, ngImport: i0, template: "<st-form-field\n [libelle]=\"libelle()\"\n [aide]=\"aideLue()\"\n [erreurs]=\"errors()\"\n [afficherErreurs]=\"touched()\"\n [obligatoire]=\"required()\"\n>\n <input\n #champ\n class=\"st-otp-field__champ\"\n stControleDeChamp\n type=\"text\"\n inputmode=\"numeric\"\n autocomplete=\"one-time-code\"\n spellcheck=\"false\"\n autocapitalize=\"none\"\n [value]=\"value()\"\n [attr.name]=\"name() || null\"\n [disabled]=\"disabled()\"\n [readOnly]=\"readonly()\"\n (input)=\"surSaisie($event)\"\n (blur)=\"touch.emit()\"\n />\n</st-form-field>\n", styles: [".st-vh{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}:host([hidden]){display:none!important}:host{display:block}.st-otp-field__champ:focus-visible{outline:2px solid var(--st-couleur-anneau-focus);outline-offset:2px}.st-otp-field__champ{box-sizing:border-box;inline-size:100%;min-block-size:var(--st-cible-tactile-min);padding:var(--st-espacement-2) var(--st-espacement-3);font:inherit;color:var(--st-couleur-texte);background:var(--st-couleur-surface);border:1px solid var(--st-couleur-bordure-forte);border-radius:var(--st-rayon-sm)}.st-otp-field__champ[aria-invalid=true]{border-color:var(--st-couleur-danger);box-shadow:inset 0 0 0 1px var(--st-couleur-danger)}.st-otp-field__champ:disabled{color:var(--st-couleur-texte-desactive);cursor:not-allowed;background:var(--st-couleur-surface-enfoncee)}.st-otp-field__champ:read-only:not(:disabled){background:var(--st-couleur-surface-enfoncee)}.st-otp-field__champ{max-inline-size:12rem;font-family:var(--st-police-mono);font-variant-numeric:tabular-nums;letter-spacing:.3em}\n"], dependencies: [{ kind: "component", type: StFormField, selector: "st-form-field", inputs: ["libelle", "aide", "complement", "erreurs", "afficherErreurs", "obligatoire", "disposition", "libelleMasque"] }, { kind: "directive", type: StControleDeChamp, selector: "[stControleDeChamp]" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
3282
+ }
3283
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: StOtpField, decorators: [{
3284
+ type: Component,
3285
+ args: [{ selector: 'st-otp-field', changeDetection: ChangeDetectionStrategy.OnPush, imports: [StFormField, StControleDeChamp], host: { class: 'st-otp-field' }, template: "<st-form-field\n [libelle]=\"libelle()\"\n [aide]=\"aideLue()\"\n [erreurs]=\"errors()\"\n [afficherErreurs]=\"touched()\"\n [obligatoire]=\"required()\"\n>\n <input\n #champ\n class=\"st-otp-field__champ\"\n stControleDeChamp\n type=\"text\"\n inputmode=\"numeric\"\n autocomplete=\"one-time-code\"\n spellcheck=\"false\"\n autocapitalize=\"none\"\n [value]=\"value()\"\n [attr.name]=\"name() || null\"\n [disabled]=\"disabled()\"\n [readOnly]=\"readonly()\"\n (input)=\"surSaisie($event)\"\n (blur)=\"touch.emit()\"\n />\n</st-form-field>\n", styles: [".st-vh{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}:host([hidden]){display:none!important}:host{display:block}.st-otp-field__champ:focus-visible{outline:2px solid var(--st-couleur-anneau-focus);outline-offset:2px}.st-otp-field__champ{box-sizing:border-box;inline-size:100%;min-block-size:var(--st-cible-tactile-min);padding:var(--st-espacement-2) var(--st-espacement-3);font:inherit;color:var(--st-couleur-texte);background:var(--st-couleur-surface);border:1px solid var(--st-couleur-bordure-forte);border-radius:var(--st-rayon-sm)}.st-otp-field__champ[aria-invalid=true]{border-color:var(--st-couleur-danger);box-shadow:inset 0 0 0 1px var(--st-couleur-danger)}.st-otp-field__champ:disabled{color:var(--st-couleur-texte-desactive);cursor:not-allowed;background:var(--st-couleur-surface-enfoncee)}.st-otp-field__champ:read-only:not(:disabled){background:var(--st-couleur-surface-enfoncee)}.st-otp-field__champ{max-inline-size:12rem;font-family:var(--st-police-mono);font-variant-numeric:tabular-nums;letter-spacing:.3em}\n"] }]
3286
+ }], propDecorators: { longueur: [{ type: i0.Input, args: [{ isSignal: true, alias: "longueur", required: false }] }] } });
3287
+
3288
+ /**
3289
+ * Champ de recherche : un repere, un champ, un bouton.
3290
+ *
3291
+ * ```html
3292
+ * <st-search-field libelle="Rechercher un beneficiaire" (recherche)="filtrer($event)" />
3293
+ * ```
3294
+ *
3295
+ * ⚠️ **Un repere `search`** : la recherche se retrouve dans la liste des reperes du
3296
+ * lecteur d'ecran, a cote de la navigation et du contenu.
3297
+ *
3298
+ * L'etiquette est lue sans etre affichee — seule exception au socle (UX-1) : la
3299
+ * loupe, le bouton et la position disent deja le but du champ.
3300
+ *
3301
+ * ⚠️ **Jamais dans l'adresse quand le terme est personnel** (SEC-6). Chercher un
3302
+ * nom, un IBAN ou un numero en `?q=` inscrit la donnee dans l'historique, dans les
3303
+ * journaux des intermediaires, et dans l'en-tete `Referer` des pages suivantes.
3304
+ * `recherche` emet le terme : c'est a l'appelant de ne pas le mettre dans l'URL.
3305
+ */
3306
+ class StSearchField extends ControleDeSaisie {
3307
+ libelles = inject(ST_LIBELLES);
3308
+ /** Emis a la validation — Entree ou bouton —, et non a chaque frappe. */
3309
+ recherche = output();
3310
+ surSaisie(evenement) {
3311
+ this.value.set(this.texteSaisi(evenement));
3312
+ }
3313
+ lancer(evenement) {
3314
+ evenement?.preventDefault();
3315
+ this.recherche.emit(this.value().trim());
3316
+ }
3317
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: StSearchField, deps: null, target: i0.ɵɵFactoryTarget.Component });
3318
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.1.6", type: StSearchField, isStandalone: true, selector: "st-search-field", outputs: { recherche: "recherche" }, host: { attributes: { "role": "search" }, classAttribute: "st-search-field" }, usesInheritance: true, ngImport: i0, template: "<st-form-field\n libelleMasque\n [libelle]=\"libelle()\"\n [aide]=\"aide()\"\n [erreurs]=\"errors()\"\n [afficherErreurs]=\"touched()\"\n>\n <div class=\"st-search-field__ligne\">\n <st-icon class=\"st-search-field__loupe\" nom=\"recherche\" taille=\"sm\" />\n <input\n #champ\n class=\"st-search-field__champ\"\n stControleDeChamp\n type=\"search\"\n enterkeyhint=\"search\"\n [value]=\"value()\"\n [attr.name]=\"name() || null\"\n [disabled]=\"disabled()\"\n (input)=\"surSaisie($event)\"\n (keydown.enter)=\"lancer($event)\"\n (blur)=\"touch.emit()\"\n />\n <button stButton type=\"button\" [disabled]=\"disabled()\" (click)=\"lancer()\">\n {{ libelles().rechercher }}\n </button>\n </div>\n</st-form-field>\n", styles: [".st-vh{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}:host([hidden]){display:none!important}:host{display:block}.st-search-field__ligne{position:relative;display:flex;gap:var(--st-espacement-2);align-items:center}.st-search-field__loupe{position:absolute;inset-inline-start:var(--st-espacement-3);color:var(--st-couleur-texte-discret);pointer-events:none}.st-search-field__champ:focus-visible{outline:2px solid var(--st-couleur-anneau-focus);outline-offset:2px}.st-search-field__champ{box-sizing:border-box;inline-size:100%;min-block-size:var(--st-cible-tactile-min);padding:var(--st-espacement-2) var(--st-espacement-3);font:inherit;color:var(--st-couleur-texte);background:var(--st-couleur-surface);border:1px solid var(--st-couleur-bordure-forte);border-radius:var(--st-rayon-sm)}.st-search-field__champ[aria-invalid=true]{border-color:var(--st-couleur-danger);box-shadow:inset 0 0 0 1px var(--st-couleur-danger)}.st-search-field__champ:disabled{color:var(--st-couleur-texte-desactive);cursor:not-allowed;background:var(--st-couleur-surface-enfoncee)}.st-search-field__champ:read-only:not(:disabled){background:var(--st-couleur-surface-enfoncee)}.st-search-field__champ{flex:1 1 auto;padding-inline-start:calc(var(--st-espacement-3) * 2 + 1rem)}\n"], dependencies: [{ kind: "component", type: StFormField, selector: "st-form-field", inputs: ["libelle", "aide", "complement", "erreurs", "afficherErreurs", "obligatoire", "disposition", "libelleMasque"] }, { kind: "directive", type: StControleDeChamp, selector: "[stControleDeChamp]" }, { kind: "component", type: StIcon, selector: "st-icon", inputs: ["nom", "taille", "ton", "etiquette"] }, { kind: "component", type: StButton, selector: "button[stButton]", inputs: ["variante", "taille", "pleineLargeur", "iconeAvant", "iconeApres", "chargement", "indisponible"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
3319
+ }
3320
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: StSearchField, decorators: [{
3321
+ type: Component,
3322
+ args: [{ selector: 'st-search-field', changeDetection: ChangeDetectionStrategy.OnPush, imports: [StFormField, StControleDeChamp, StIcon, StButton], host: { class: 'st-search-field', role: 'search' }, template: "<st-form-field\n libelleMasque\n [libelle]=\"libelle()\"\n [aide]=\"aide()\"\n [erreurs]=\"errors()\"\n [afficherErreurs]=\"touched()\"\n>\n <div class=\"st-search-field__ligne\">\n <st-icon class=\"st-search-field__loupe\" nom=\"recherche\" taille=\"sm\" />\n <input\n #champ\n class=\"st-search-field__champ\"\n stControleDeChamp\n type=\"search\"\n enterkeyhint=\"search\"\n [value]=\"value()\"\n [attr.name]=\"name() || null\"\n [disabled]=\"disabled()\"\n (input)=\"surSaisie($event)\"\n (keydown.enter)=\"lancer($event)\"\n (blur)=\"touch.emit()\"\n />\n <button stButton type=\"button\" [disabled]=\"disabled()\" (click)=\"lancer()\">\n {{ libelles().rechercher }}\n </button>\n </div>\n</st-form-field>\n", styles: [".st-vh{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}:host([hidden]){display:none!important}:host{display:block}.st-search-field__ligne{position:relative;display:flex;gap:var(--st-espacement-2);align-items:center}.st-search-field__loupe{position:absolute;inset-inline-start:var(--st-espacement-3);color:var(--st-couleur-texte-discret);pointer-events:none}.st-search-field__champ:focus-visible{outline:2px solid var(--st-couleur-anneau-focus);outline-offset:2px}.st-search-field__champ{box-sizing:border-box;inline-size:100%;min-block-size:var(--st-cible-tactile-min);padding:var(--st-espacement-2) var(--st-espacement-3);font:inherit;color:var(--st-couleur-texte);background:var(--st-couleur-surface);border:1px solid var(--st-couleur-bordure-forte);border-radius:var(--st-rayon-sm)}.st-search-field__champ[aria-invalid=true]{border-color:var(--st-couleur-danger);box-shadow:inset 0 0 0 1px var(--st-couleur-danger)}.st-search-field__champ:disabled{color:var(--st-couleur-texte-desactive);cursor:not-allowed;background:var(--st-couleur-surface-enfoncee)}.st-search-field__champ:read-only:not(:disabled){background:var(--st-couleur-surface-enfoncee)}.st-search-field__champ{flex:1 1 auto;padding-inline-start:calc(var(--st-espacement-3) * 2 + 1rem)}\n"] }]
3323
+ }], propDecorators: { recherche: [{ type: i0.Output, args: ["recherche"] }] } });
3324
+
3325
+ /**
3326
+ * IBAN. La valeur du modele est NORMALISEE — sans espaces, en majuscules —, et
3327
+ * l'affichage groupe par quatre.
3328
+ *
3329
+ * ```html
3330
+ * <st-iban-field libelle="IBAN du beneficiaire" [formField]="virement.iban" />
3331
+ * <!-- schema : validate(chemin.iban, ({ value }) => erreurIban(value())) -->
3332
+ * ```
3333
+ *
3334
+ * ⚠️ **Le groupement se fait a la sortie du champ, jamais pendant la frappe.**
3335
+ * Reformater a chaque caractere deplace le curseur a la fin : corriger une
3336
+ * erreur au milieu de 27 caracteres devient impossible, chaque frappe renvoyant a
3337
+ * la fin de la ligne.
3338
+ *
3339
+ * ⚠️ **Aucune verification de validite ici** : elle appartient au schema, par
3340
+ * `erreurIban`, pour s'afficher au bon moment et par le bon canal. Et elle reste un
3341
+ * confort (SEC-5) : le serveur revalide.
3342
+ *
3343
+ * `autocapitalize="characters"` et correction orthographique coupee : un IBAN
3344
+ * n'est pas un mot, et une correction automatique le fausserait.
3345
+ */
3346
+ class StIbanField extends ControleDeSaisie {
3347
+ libelles = inject(ST_LIBELLES);
3348
+ enSaisie = signal(false, /* @ts-ignore */
3349
+ ...(ngDevMode ? [{ debugName: "enSaisie" }] : /* istanbul ignore next */ []));
3350
+ brut = signal('', /* @ts-ignore */
3351
+ ...(ngDevMode ? [{ debugName: "brut" }] : /* istanbul ignore next */ []));
3352
+ aideLue = computed(() => this.aide() ?? this.libelles().exempleDIban, /* @ts-ignore */
3353
+ ...(ngDevMode ? [{ debugName: "aideLue" }] : /* istanbul ignore next */ []));
3354
+ /**
3355
+ * Brut pendant la saisie ; groupe par quatre au repos. Une valeur changee de
3356
+ * l'exterieur pendant la saisie — remise a zero du formulaire — l'emporte sur
3357
+ * le brut, qui ne la represente plus.
3358
+ */
3359
+ affichage = computed(() => {
3360
+ const valeur = this.value();
3361
+ const brut = this.brut();
3362
+ return this.enSaisie() && normaliserIban(brut) === valeur ? brut : formaterIban(valeur);
3363
+ }, /* @ts-ignore */
3364
+ ...(ngDevMode ? [{ debugName: "affichage" }] : /* istanbul ignore next */ []));
3365
+ auFocus() {
3366
+ this.brut.set(formaterIban(this.value()));
3367
+ this.enSaisie.set(true);
3368
+ }
3369
+ surSaisie(evenement) {
3370
+ const saisie = this.texteSaisi(evenement);
3371
+ this.brut.set(saisie);
3372
+ this.value.set(normaliserIban(saisie));
3373
+ }
3374
+ aLaSortie() {
3375
+ this.enSaisie.set(false);
3376
+ this.touch.emit();
3377
+ }
3378
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: StIbanField, deps: null, target: i0.ɵɵFactoryTarget.Component });
3379
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.1.6", type: StIbanField, isStandalone: true, selector: "st-iban-field", host: { classAttribute: "st-iban-field" }, usesInheritance: true, ngImport: i0, template: "<st-form-field\n [libelle]=\"libelle()\"\n [aide]=\"aideLue()\"\n [erreurs]=\"errors()\"\n [afficherErreurs]=\"touched()\"\n [obligatoire]=\"required()\"\n>\n <input\n #champ\n class=\"st-iban-field__champ\"\n stControleDeChamp\n type=\"text\"\n autocomplete=\"off\"\n autocapitalize=\"characters\"\n autocorrect=\"off\"\n spellcheck=\"false\"\n [value]=\"affichage()\"\n [attr.name]=\"name() || null\"\n [disabled]=\"disabled()\"\n [readOnly]=\"readonly()\"\n (focus)=\"auFocus()\"\n (input)=\"surSaisie($event)\"\n (blur)=\"aLaSortie()\"\n />\n</st-form-field>\n", styles: [".st-vh{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}:host([hidden]){display:none!important}:host{display:block}.st-iban-field__champ:focus-visible{outline:2px solid var(--st-couleur-anneau-focus);outline-offset:2px}.st-iban-field__champ{box-sizing:border-box;inline-size:100%;min-block-size:var(--st-cible-tactile-min);padding:var(--st-espacement-2) var(--st-espacement-3);font:inherit;color:var(--st-couleur-texte);background:var(--st-couleur-surface);border:1px solid var(--st-couleur-bordure-forte);border-radius:var(--st-rayon-sm)}.st-iban-field__champ[aria-invalid=true]{border-color:var(--st-couleur-danger);box-shadow:inset 0 0 0 1px var(--st-couleur-danger)}.st-iban-field__champ:disabled{color:var(--st-couleur-texte-desactive);cursor:not-allowed;background:var(--st-couleur-surface-enfoncee)}.st-iban-field__champ:read-only:not(:disabled){background:var(--st-couleur-surface-enfoncee)}.st-iban-field__champ{font-family:var(--st-police-mono);font-variant-numeric:tabular-nums}\n"], dependencies: [{ kind: "component", type: StFormField, selector: "st-form-field", inputs: ["libelle", "aide", "complement", "erreurs", "afficherErreurs", "obligatoire", "disposition", "libelleMasque"] }, { kind: "directive", type: StControleDeChamp, selector: "[stControleDeChamp]" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
3380
+ }
3381
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: StIbanField, decorators: [{
3382
+ type: Component,
3383
+ args: [{ selector: 'st-iban-field', changeDetection: ChangeDetectionStrategy.OnPush, imports: [StFormField, StControleDeChamp], host: { class: 'st-iban-field' }, template: "<st-form-field\n [libelle]=\"libelle()\"\n [aide]=\"aideLue()\"\n [erreurs]=\"errors()\"\n [afficherErreurs]=\"touched()\"\n [obligatoire]=\"required()\"\n>\n <input\n #champ\n class=\"st-iban-field__champ\"\n stControleDeChamp\n type=\"text\"\n autocomplete=\"off\"\n autocapitalize=\"characters\"\n autocorrect=\"off\"\n spellcheck=\"false\"\n [value]=\"affichage()\"\n [attr.name]=\"name() || null\"\n [disabled]=\"disabled()\"\n [readOnly]=\"readonly()\"\n (focus)=\"auFocus()\"\n (input)=\"surSaisie($event)\"\n (blur)=\"aLaSortie()\"\n />\n</st-form-field>\n", styles: [".st-vh{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}:host([hidden]){display:none!important}:host{display:block}.st-iban-field__champ:focus-visible{outline:2px solid var(--st-couleur-anneau-focus);outline-offset:2px}.st-iban-field__champ{box-sizing:border-box;inline-size:100%;min-block-size:var(--st-cible-tactile-min);padding:var(--st-espacement-2) var(--st-espacement-3);font:inherit;color:var(--st-couleur-texte);background:var(--st-couleur-surface);border:1px solid var(--st-couleur-bordure-forte);border-radius:var(--st-rayon-sm)}.st-iban-field__champ[aria-invalid=true]{border-color:var(--st-couleur-danger);box-shadow:inset 0 0 0 1px var(--st-couleur-danger)}.st-iban-field__champ:disabled{color:var(--st-couleur-texte-desactive);cursor:not-allowed;background:var(--st-couleur-surface-enfoncee)}.st-iban-field__champ:read-only:not(:disabled){background:var(--st-couleur-surface-enfoncee)}.st-iban-field__champ{font-family:var(--st-police-mono);font-variant-numeric:tabular-nums}\n"] }]
3384
+ }] });
3385
+
3386
+ /**
3387
+ * Numero de telephone. La valeur du modele ne garde que les chiffres et le `+` de
3388
+ * tete ; la saisie s'affiche telle qu'elle a ete tapee.
3389
+ *
3390
+ * ```html
3391
+ * <st-phone-field libelle="Telephone portable" [formField]="contact.telephone" />
3392
+ * <!-- schema : validate(chemin.telephone, ({ value }) => erreurTelephone(value())) -->
3393
+ * ```
3394
+ *
3395
+ * ⚠️ **Aucun formatage automatique.** Le groupement des chiffres depend du pays,
3396
+ * et reformater pendant la frappe renvoie le curseur en fin de ligne. La saisie
3397
+ * reste celle de la personne, espaces et points compris.
3398
+ *
3399
+ * ⚠️ **Pas de selecteur de pays, pas de verification par pays.** Il faudrait une
3400
+ * table des plans de numerotation, lourde et souvent perimee : c'est au serveur
3401
+ * de dire si le numero existe (SEC-5). `erreurTelephone` ne verifie que la forme.
3402
+ *
3403
+ * `type="tel"`, et jamais `type="number"` : un numero n'est pas une quantite, et le
3404
+ * champ numerique retire le zero de tete et le `+`.
3405
+ */
3406
+ class StPhoneField extends ControleDeSaisie {
3407
+ autocomplete = input('tel', /* @ts-ignore */
3408
+ ...(ngDevMode ? [{ debugName: "autocomplete" }] : /* istanbul ignore next */ []));
3409
+ brut = signal(null, /* @ts-ignore */
3410
+ ...(ngDevMode ? [{ debugName: "brut" }] : /* istanbul ignore next */ []));
3411
+ /**
3412
+ * La saisie telle que tapee, tant qu'elle represente encore la valeur ; une
3413
+ * valeur changee de l'exterieur — remise a zero, pre-remplissage — l'emporte.
3414
+ */
3415
+ affichage = computed(() => {
3416
+ const valeur = this.value();
3417
+ const brut = this.brut();
3418
+ return brut !== null && normaliserTelephone(brut) === valeur ? brut : valeur;
3419
+ }, /* @ts-ignore */
3420
+ ...(ngDevMode ? [{ debugName: "affichage" }] : /* istanbul ignore next */ []));
3421
+ surSaisie(evenement) {
3422
+ const saisie = this.texteSaisi(evenement);
3423
+ this.brut.set(saisie);
3424
+ this.value.set(normaliserTelephone(saisie));
3425
+ }
3426
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: StPhoneField, deps: null, target: i0.ɵɵFactoryTarget.Component });
3427
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.1.6", type: StPhoneField, isStandalone: true, selector: "st-phone-field", inputs: { autocomplete: { classPropertyName: "autocomplete", publicName: "autocomplete", isSignal: true, isRequired: false, transformFunction: null } }, host: { classAttribute: "st-phone-field" }, usesInheritance: true, ngImport: i0, template: "<st-form-field\n [libelle]=\"libelle()\"\n [aide]=\"aide()\"\n [erreurs]=\"errors()\"\n [afficherErreurs]=\"touched()\"\n [obligatoire]=\"required()\"\n>\n <input\n #champ\n class=\"st-phone-field__champ\"\n stControleDeChamp\n type=\"tel\"\n [attr.autocomplete]=\"autocomplete()\"\n [value]=\"affichage()\"\n [attr.name]=\"name() || null\"\n [disabled]=\"disabled()\"\n [readOnly]=\"readonly()\"\n (input)=\"surSaisie($event)\"\n (blur)=\"touch.emit()\"\n />\n</st-form-field>\n", styles: [".st-vh{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}:host([hidden]){display:none!important}:host{display:block}.st-phone-field__champ:focus-visible{outline:2px solid var(--st-couleur-anneau-focus);outline-offset:2px}.st-phone-field__champ{box-sizing:border-box;inline-size:100%;min-block-size:var(--st-cible-tactile-min);padding:var(--st-espacement-2) var(--st-espacement-3);font:inherit;color:var(--st-couleur-texte);background:var(--st-couleur-surface);border:1px solid var(--st-couleur-bordure-forte);border-radius:var(--st-rayon-sm)}.st-phone-field__champ[aria-invalid=true]{border-color:var(--st-couleur-danger);box-shadow:inset 0 0 0 1px var(--st-couleur-danger)}.st-phone-field__champ:disabled{color:var(--st-couleur-texte-desactive);cursor:not-allowed;background:var(--st-couleur-surface-enfoncee)}.st-phone-field__champ:read-only:not(:disabled){background:var(--st-couleur-surface-enfoncee)}.st-phone-field__champ{font-variant-numeric:tabular-nums}\n"], dependencies: [{ kind: "component", type: StFormField, selector: "st-form-field", inputs: ["libelle", "aide", "complement", "erreurs", "afficherErreurs", "obligatoire", "disposition", "libelleMasque"] }, { kind: "directive", type: StControleDeChamp, selector: "[stControleDeChamp]" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
3428
+ }
3429
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: StPhoneField, decorators: [{
3430
+ type: Component,
3431
+ args: [{ selector: 'st-phone-field', changeDetection: ChangeDetectionStrategy.OnPush, imports: [StFormField, StControleDeChamp], host: { class: 'st-phone-field' }, template: "<st-form-field\n [libelle]=\"libelle()\"\n [aide]=\"aide()\"\n [erreurs]=\"errors()\"\n [afficherErreurs]=\"touched()\"\n [obligatoire]=\"required()\"\n>\n <input\n #champ\n class=\"st-phone-field__champ\"\n stControleDeChamp\n type=\"tel\"\n [attr.autocomplete]=\"autocomplete()\"\n [value]=\"affichage()\"\n [attr.name]=\"name() || null\"\n [disabled]=\"disabled()\"\n [readOnly]=\"readonly()\"\n (input)=\"surSaisie($event)\"\n (blur)=\"touch.emit()\"\n />\n</st-form-field>\n", styles: [".st-vh{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}:host([hidden]){display:none!important}:host{display:block}.st-phone-field__champ:focus-visible{outline:2px solid var(--st-couleur-anneau-focus);outline-offset:2px}.st-phone-field__champ{box-sizing:border-box;inline-size:100%;min-block-size:var(--st-cible-tactile-min);padding:var(--st-espacement-2) var(--st-espacement-3);font:inherit;color:var(--st-couleur-texte);background:var(--st-couleur-surface);border:1px solid var(--st-couleur-bordure-forte);border-radius:var(--st-rayon-sm)}.st-phone-field__champ[aria-invalid=true]{border-color:var(--st-couleur-danger);box-shadow:inset 0 0 0 1px var(--st-couleur-danger)}.st-phone-field__champ:disabled{color:var(--st-couleur-texte-desactive);cursor:not-allowed;background:var(--st-couleur-surface-enfoncee)}.st-phone-field__champ:read-only:not(:disabled){background:var(--st-couleur-surface-enfoncee)}.st-phone-field__champ{font-variant-numeric:tabular-nums}\n"] }]
3432
+ }], propDecorators: { autocomplete: [{ type: i0.Input, args: [{ isSignal: true, alias: "autocomplete", required: false }] }] } });
3433
+
3434
+ /** Sans accents ni casse : « eleve » trouve « Élève ». */
3435
+ function normaliserPourRecherche(texte) {
3436
+ return texte
3437
+ .normalize('NFD')
3438
+ .replace(/[\u0300-\u036f]/g, '')
3439
+ .toLocaleLowerCase()
3440
+ .trim();
3441
+ }
3442
+ /** Options dont le libelle CONTIENT le texte cherche, sans accents ni casse. */
3443
+ function filtrerOptions(options, recherche) {
3444
+ const cherche = normaliserPourRecherche(recherche);
3445
+ if (cherche === '')
3446
+ return options;
3447
+ return options.filter((option) => normaliserPourRecherche(option.libelle).includes(cherche));
3448
+ }
3449
+
3450
+ /**
3451
+ * Liste deroulante, sur un `select` NATIF.
3452
+ *
3453
+ * ```html
3454
+ * <st-select libelle="Pays" [options]="pays" autocomplete="country" [formField]="adresse.pays" />
3455
+ * ```
3456
+ *
3457
+ * ⚠️ **Natif, et non une liste ARIA** (FE-4). Le `select` natif ouvre le selecteur
3458
+ * du systeme sur mobile, se remplit automatiquement, se parcourt a la lettre, et
3459
+ * se lit partout. Une liste recomposee en ARIA ne fait jamais mieux sur ces
3460
+ * points ; elle ne se justifie que pour filtrer une longue liste — c'est
3461
+ * `st-combobox` — ou choisir plusieurs valeurs — `st-multiselect`.
3462
+ *
3463
+ * La premiere option, vide, dit « Choisir… » : sans elle, la premiere vraie
3464
+ * option paraitrait choisie alors que personne ne l'a fait. Le modele vaut
3465
+ * alors `''`, que `required` refuse.
3466
+ *
3467
+ * `readonly` n'existe pas sur un `select` : le champ annonce `aria-readonly` et
3468
+ * ignore le changement, plutot que d'etre desactive — un champ desactive sort de
3469
+ * l'ordre de tabulation, et sa valeur ne se lit plus.
3470
+ */
3471
+ class StSelect extends ControleDeSaisie {
3472
+ libelles = inject(ST_LIBELLES);
3473
+ options = input.required(/* @ts-ignore */
3474
+ ...(ngDevMode ? [{ debugName: "options" }] : /* istanbul ignore next */ []));
3475
+ /** Texte de l'option vide. Par defaut : « Choisir… ». */
3476
+ texteVide = input(null, /* @ts-ignore */
3477
+ ...(ngDevMode ? [{ debugName: "texteVide" }] : /* istanbul ignore next */ []));
3478
+ /** WCAG 1.3.5 : `country`, `sex`, `honorific-prefix`… */
3479
+ autocomplete = input(null, /* @ts-ignore */
3480
+ ...(ngDevMode ? [{ debugName: "autocomplete" }] : /* istanbul ignore next */ []));
3481
+ /** Options consecutives d'un meme groupe, dans l'ordre fourni. */
3482
+ blocs = computed(() => {
3483
+ const blocs = [];
3484
+ for (const option of this.options()) {
3485
+ const groupe = option.groupe ?? null;
3486
+ const dernier = blocs.at(-1);
3487
+ if (dernier?.groupe === groupe)
3488
+ dernier.options.push(option);
3489
+ else
3490
+ blocs.push({ groupe, options: [option] });
3491
+ }
3492
+ return blocs;
3493
+ }, /* @ts-ignore */
3494
+ ...(ngDevMode ? [{ debugName: "blocs" }] : /* istanbul ignore next */ []));
3495
+ surChoix(evenement) {
3496
+ const element = evenement.target;
3497
+ if (this.readonly()) {
3498
+ element.value = this.value();
3499
+ return;
3500
+ }
3501
+ this.value.set(element.value);
3502
+ }
3503
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: StSelect, deps: null, target: i0.ɵɵFactoryTarget.Component });
3504
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.6", type: StSelect, isStandalone: true, selector: "st-select", inputs: { options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: true, transformFunction: null }, texteVide: { classPropertyName: "texteVide", publicName: "texteVide", isSignal: true, isRequired: false, transformFunction: null }, autocomplete: { classPropertyName: "autocomplete", publicName: "autocomplete", isSignal: true, isRequired: false, transformFunction: null } }, host: { classAttribute: "st-select" }, usesInheritance: true, ngImport: i0, template: "<st-form-field\n [libelle]=\"libelle()\"\n [aide]=\"aide()\"\n [erreurs]=\"errors()\"\n [afficherErreurs]=\"touched()\"\n [obligatoire]=\"required()\"\n>\n <div class=\"st-select__cadre\">\n <select\n #champ\n class=\"st-select__champ\"\n stControleDeChamp\n [attr.name]=\"name() || null\"\n [attr.autocomplete]=\"autocomplete()\"\n [attr.aria-readonly]=\"readonly() ? 'true' : null\"\n [disabled]=\"disabled()\"\n (change)=\"surChoix($event)\"\n (blur)=\"touch.emit()\"\n >\n <option value=\"\" [selected]=\"value() === ''\">{{ texteVide() ?? libelles().choisir }}</option>\n @for (bloc of blocs(); track $index) {\n @if (bloc.groupe === null) {\n @for (option of bloc.options; track option.valeur) {\n <option\n [value]=\"option.valeur\"\n [selected]=\"option.valeur === value()\"\n [disabled]=\"option.desactivee === true\"\n >\n {{ option.libelle }}\n </option>\n }\n } @else {\n <optgroup [label]=\"bloc.groupe\">\n @for (option of bloc.options; track option.valeur) {\n <option\n [value]=\"option.valeur\"\n [selected]=\"option.valeur === value()\"\n [disabled]=\"option.desactivee === true\"\n >\n {{ option.libelle }}\n </option>\n }\n </optgroup>\n }\n }\n </select>\n <st-icon class=\"st-select__chevron\" nom=\"chevron-bas\" taille=\"sm\" />\n </div>\n</st-form-field>\n", styles: [".st-vh{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}:host([hidden]){display:none!important}:host{display:block}.st-select__cadre{position:relative}.st-select__champ:focus-visible{outline:2px solid var(--st-couleur-anneau-focus);outline-offset:2px}.st-select__champ{box-sizing:border-box;inline-size:100%;min-block-size:var(--st-cible-tactile-min);padding:var(--st-espacement-2) var(--st-espacement-3);font:inherit;color:var(--st-couleur-texte);background:var(--st-couleur-surface);border:1px solid var(--st-couleur-bordure-forte);border-radius:var(--st-rayon-sm)}.st-select__champ[aria-invalid=true]{border-color:var(--st-couleur-danger);box-shadow:inset 0 0 0 1px var(--st-couleur-danger)}.st-select__champ:disabled{color:var(--st-couleur-texte-desactive);cursor:not-allowed;background:var(--st-couleur-surface-enfoncee)}.st-select__champ:read-only:not(:disabled){background:var(--st-couleur-surface-enfoncee)}.st-select__champ{padding-inline-end:calc(var(--st-espacement-3) * 2 + 1rem);cursor:pointer;appearance:none}.st-select__chevron{position:absolute;inset-block-start:50%;inset-inline-end:var(--st-espacement-3);color:var(--st-couleur-texte-discret);pointer-events:none;transform:translateY(-50%)}@media(forced-colors:active){.st-select__chevron{color:CanvasText}}\n"], dependencies: [{ kind: "component", type: StFormField, selector: "st-form-field", inputs: ["libelle", "aide", "complement", "erreurs", "afficherErreurs", "obligatoire", "disposition", "libelleMasque"] }, { kind: "directive", type: StControleDeChamp, selector: "[stControleDeChamp]" }, { kind: "component", type: StIcon, selector: "st-icon", inputs: ["nom", "taille", "ton", "etiquette"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
3505
+ }
3506
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: StSelect, decorators: [{
3507
+ type: Component,
3508
+ args: [{ selector: 'st-select', changeDetection: ChangeDetectionStrategy.OnPush, imports: [StFormField, StControleDeChamp, StIcon], host: { class: 'st-select' }, template: "<st-form-field\n [libelle]=\"libelle()\"\n [aide]=\"aide()\"\n [erreurs]=\"errors()\"\n [afficherErreurs]=\"touched()\"\n [obligatoire]=\"required()\"\n>\n <div class=\"st-select__cadre\">\n <select\n #champ\n class=\"st-select__champ\"\n stControleDeChamp\n [attr.name]=\"name() || null\"\n [attr.autocomplete]=\"autocomplete()\"\n [attr.aria-readonly]=\"readonly() ? 'true' : null\"\n [disabled]=\"disabled()\"\n (change)=\"surChoix($event)\"\n (blur)=\"touch.emit()\"\n >\n <option value=\"\" [selected]=\"value() === ''\">{{ texteVide() ?? libelles().choisir }}</option>\n @for (bloc of blocs(); track $index) {\n @if (bloc.groupe === null) {\n @for (option of bloc.options; track option.valeur) {\n <option\n [value]=\"option.valeur\"\n [selected]=\"option.valeur === value()\"\n [disabled]=\"option.desactivee === true\"\n >\n {{ option.libelle }}\n </option>\n }\n } @else {\n <optgroup [label]=\"bloc.groupe\">\n @for (option of bloc.options; track option.valeur) {\n <option\n [value]=\"option.valeur\"\n [selected]=\"option.valeur === value()\"\n [disabled]=\"option.desactivee === true\"\n >\n {{ option.libelle }}\n </option>\n }\n </optgroup>\n }\n }\n </select>\n <st-icon class=\"st-select__chevron\" nom=\"chevron-bas\" taille=\"sm\" />\n </div>\n</st-form-field>\n", styles: [".st-vh{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}:host([hidden]){display:none!important}:host{display:block}.st-select__cadre{position:relative}.st-select__champ:focus-visible{outline:2px solid var(--st-couleur-anneau-focus);outline-offset:2px}.st-select__champ{box-sizing:border-box;inline-size:100%;min-block-size:var(--st-cible-tactile-min);padding:var(--st-espacement-2) var(--st-espacement-3);font:inherit;color:var(--st-couleur-texte);background:var(--st-couleur-surface);border:1px solid var(--st-couleur-bordure-forte);border-radius:var(--st-rayon-sm)}.st-select__champ[aria-invalid=true]{border-color:var(--st-couleur-danger);box-shadow:inset 0 0 0 1px var(--st-couleur-danger)}.st-select__champ:disabled{color:var(--st-couleur-texte-desactive);cursor:not-allowed;background:var(--st-couleur-surface-enfoncee)}.st-select__champ:read-only:not(:disabled){background:var(--st-couleur-surface-enfoncee)}.st-select__champ{padding-inline-end:calc(var(--st-espacement-3) * 2 + 1rem);cursor:pointer;appearance:none}.st-select__chevron{position:absolute;inset-block-start:50%;inset-inline-end:var(--st-espacement-3);color:var(--st-couleur-texte-discret);pointer-events:none;transform:translateY(-50%)}@media(forced-colors:active){.st-select__chevron{color:CanvasText}}\n"] }]
3509
+ }], propDecorators: { options: [{ type: i0.Input, args: [{ isSignal: true, alias: "options", required: true }] }], texteVide: [{ type: i0.Input, args: [{ isSignal: true, alias: "texteVide", required: false }] }], autocomplete: [{ type: i0.Input, args: [{ isSignal: true, alias: "autocomplete", required: false }] }] } });
3510
+
3511
+ let compteur$4 = 0;
3512
+ /** Un lundi connu, pour nommer les jours de la semaine sans horloge. */
3513
+ const LUNDI_DE_REFERENCE = '2006-01-02';
3514
+ /** « Aujourd'hui » dans un fuseau : la date du poste n'est pas celle de la personne. */
3515
+ function dateDuJour(fuseau) {
3516
+ const parties = new Intl.DateTimeFormat('en-CA', {
3517
+ timeZone: fuseau,
3518
+ year: 'numeric',
3519
+ month: '2-digit',
3520
+ day: '2-digit',
3521
+ }).formatToParts(new Date());
3522
+ const partie = (type) => parties.find((p) => p.type === type)?.value ?? '';
3523
+ return `${partie('year')}-${partie('month')}-${partie('day')}`;
3524
+ }
3525
+ /**
3526
+ * Calendrier d'un mois, pour choisir une date.
3527
+ *
3528
+ * ```html
3529
+ * <st-calendar [selection]="depart()" dateMin="2026-09-17" (choix)="depart.set($event)" />
3530
+ * ```
3531
+ *
3532
+ * ⚠️ **Une aide, jamais la seule voie.** Dans `st-date-field`, le calendrier
3533
+ * complete un champ texte : une date de naissance se tape plus vite qu'elle ne se
3534
+ * cherche mois par mois, et un calendrier reste penible au lecteur d'ecran.
3535
+ *
3536
+ * ⚠️ **Le clavier navigue de DATE en date, pas de cellule en cellule** (decision
3537
+ * D7 de l'audit de la vague 3). Fleche droite le 30 septembre mene au 1er
3538
+ * octobre ; Page suivante change de mois, Maj + Page d'annee ; Debut et Fin vont
3539
+ * aux bords de la semaine de la LOCALE. La grille d'Angular Aria deplace un focus
3540
+ * entre cellules affichees : il aurait fallu la contourner sur chaque touche qui
3541
+ * compte, et elle aurait fait entrer le CDK dans les formulaires.
3542
+ *
3543
+ * Semaine commencant au jour de la locale, noms de jours et de mois dans la
3544
+ * langue courante, « aujourd'hui » dans le fuseau de la personne
3545
+ * (`FUSEAU_PAR_DEFAUT`) et non celui du poste.
3546
+ */
3547
+ class StCalendar {
3548
+ libelles = inject(ST_LIBELLES);
3549
+ locale = inject(ST_LOCALE);
3550
+ element = inject(ElementRef);
3551
+ injecteur = inject(Injector);
3552
+ aujourdHui = dateDuJour(inject(FUSEAU_PAR_DEFAUT));
3553
+ selection = input(null, /* @ts-ignore */
3554
+ ...(ngDevMode ? [{ debugName: "selection" }] : /* istanbul ignore next */ []));
3555
+ dateMin = input(null, /* @ts-ignore */
3556
+ ...(ngDevMode ? [{ debugName: "dateMin" }] : /* istanbul ignore next */ []));
3557
+ dateMax = input(null, /* @ts-ignore */
3558
+ ...(ngDevMode ? [{ debugName: "dateMax" }] : /* istanbul ignore next */ []));
3559
+ /** Periode a faire ressortir, pour un choix de plage. */
3560
+ plage = input(null, /* @ts-ignore */
3561
+ ...(ngDevMode ? [{ debugName: "plage" }] : /* istanbul ignore next */ []));
3562
+ choix = output();
3563
+ /** Echap : le conteneur decide de fermer, et ou rendre le focus. */
3564
+ fermeture = output();
3565
+ identifiants = (() => {
3566
+ const base = `st-calendrier-${(compteur$4 += 1).toString()}`;
3567
+ return { titre: `${base}-titre`, aide: `${base}-aide` };
3568
+ })();
3569
+ /** La date qui porte le focus. Suit la selection, bornee. */
3570
+ active = linkedSignal(() => bornerDate(this.selection() ?? this.aujourdHui, this.dateMin(), this.dateMax()), /* @ts-ignore */
3571
+ ...(ngDevMode ? [{ debugName: "active" }] : /* istanbul ignore next */ []));
3572
+ premierJour = computed(() => premierJourDeLaSemaine(this.locale()), /* @ts-ignore */
3573
+ ...(ngDevMode ? [{ debugName: "premierJour" }] : /* istanbul ignore next */ []));
3574
+ titre = computed(() => {
3575
+ const [annee, mois] = this.active().split('-').map(Number);
3576
+ return new Intl.DateTimeFormat(this.locale(), {
3577
+ month: 'long',
3578
+ year: 'numeric',
3579
+ timeZone: 'UTC',
3580
+ }).format(Date.UTC(annee ?? 2000, (mois ?? 1) - 1, 1));
3581
+ }, /* @ts-ignore */
3582
+ ...(ngDevMode ? [{ debugName: "titre" }] : /* istanbul ignore next */ []));
3583
+ joursDeLaSemaine = computed(() => {
3584
+ const locale = this.locale();
3585
+ const court = new Intl.DateTimeFormat(locale, { weekday: 'short', timeZone: 'UTC' });
3586
+ const long = new Intl.DateTimeFormat(locale, { weekday: 'long', timeZone: 'UTC' });
3587
+ return Array.from({ length: 7 }, (_, index) => {
3588
+ const date = ajouterJours(LUNDI_DE_REFERENCE, (this.premierJour() - 1 + index) % 7);
3589
+ const instant = Date.parse(`${date}T00:00:00Z`);
3590
+ return { court: court.format(instant), long: long.format(instant) };
3591
+ });
3592
+ }, /* @ts-ignore */
3593
+ ...(ngDevMode ? [{ debugName: "joursDeLaSemaine" }] : /* istanbul ignore next */ []));
3594
+ semaines = computed(() => {
3595
+ const active = this.active();
3596
+ const [annee, mois] = active.split('-').map(Number);
3597
+ const locale = this.locale();
3598
+ const lecture = new Intl.DateTimeFormat(locale, { dateStyle: 'full', timeZone: 'UTC' });
3599
+ const numero = new Intl.NumberFormat(locale);
3600
+ const selection = this.selection();
3601
+ const debut = this.plage()?.debut ?? null;
3602
+ const fin = this.plage()?.fin ?? null;
3603
+ const min = this.dateMin();
3604
+ const max = this.dateMax();
3605
+ const prefixe = active.slice(0, 7);
3606
+ return semainesDuMois(annee ?? 2000, mois ?? 1, this.premierJour()).map((semaine) => semaine.map((date) => ({
3607
+ date,
3608
+ horsDuMois: !date.startsWith(prefixe),
3609
+ numero: numero.format(Number(date.slice(8))),
3610
+ nom: lecture.format(Date.parse(`${date}T00:00:00Z`)),
3611
+ horsBornes: (min !== null && date < min) || (max !== null && date > max),
3612
+ choisi: date === selection || date === debut || date === fin,
3613
+ dansLaPlage: debut !== null && fin !== null && date > debut && date < fin,
3614
+ aujourdHui: date === this.aujourdHui,
3615
+ })));
3616
+ }, /* @ts-ignore */
3617
+ ...(ngDevMode ? [{ debugName: "semaines" }] : /* istanbul ignore next */ []));
3618
+ moisPrecedentPossible = computed(() => {
3619
+ const min = this.dateMin();
3620
+ return min === null || this.active().slice(0, 7) > min.slice(0, 7);
3621
+ }, /* @ts-ignore */
3622
+ ...(ngDevMode ? [{ debugName: "moisPrecedentPossible" }] : /* istanbul ignore next */ []));
3623
+ moisSuivantPossible = computed(() => {
3624
+ const max = this.dateMax();
3625
+ return max === null || this.active().slice(0, 7) < max.slice(0, 7);
3626
+ }, /* @ts-ignore */
3627
+ ...(ngDevMode ? [{ debugName: "moisSuivantPossible" }] : /* istanbul ignore next */ []));
3628
+ estActive(date) {
3629
+ return date === this.active();
3630
+ }
3631
+ /** Amene le focus sur la date active. */
3632
+ focus() {
3633
+ this.element.nativeElement
3634
+ .querySelector('button[data-date][tabindex="0"]')
3635
+ ?.focus();
3636
+ }
3637
+ changerDeMois(ecart) {
3638
+ this.active.set(bornerDate(ajouterMois(this.active(), ecart), this.dateMin(), this.dateMax()));
3639
+ }
3640
+ choisir(jour) {
3641
+ if (jour.horsBornes)
3642
+ return;
3643
+ this.active.set(jour.date);
3644
+ this.choix.emit(jour.date);
3645
+ }
3646
+ surTouche(evenement) {
3647
+ const active = this.active();
3648
+ const droiteAGauche = getComputedStyle(this.element.nativeElement).direction === 'rtl';
3649
+ const recul = (jourDeLaSemaine(active) - this.premierJour() + 7) % 7;
3650
+ const mois = evenement.shiftKey ? 12 : 1;
3651
+ const cibles = {
3652
+ ArrowRight: () => ajouterJours(active, droiteAGauche ? -1 : 1),
3653
+ ArrowLeft: () => ajouterJours(active, droiteAGauche ? 1 : -1),
3654
+ ArrowDown: () => ajouterJours(active, 7),
3655
+ ArrowUp: () => ajouterJours(active, -7),
3656
+ Home: () => ajouterJours(active, -recul),
3657
+ End: () => ajouterJours(active, 6 - recul),
3658
+ PageDown: () => ajouterMois(active, mois),
3659
+ PageUp: () => ajouterMois(active, -mois),
3660
+ };
3661
+ if (evenement.key === 'Escape') {
3662
+ evenement.preventDefault();
3663
+ this.fermeture.emit();
3664
+ return;
3665
+ }
3666
+ // Les fleches ne deplacent la date que depuis la grille : sur les boutons de
3667
+ // mois, elles gardent leur sens pour le navigateur et le lecteur d'ecran.
3668
+ const depuisLaGrille = evenement.target.hasAttribute('data-date');
3669
+ const cible = cibles[evenement.key];
3670
+ if (cible === undefined || !depuisLaGrille)
3671
+ return;
3672
+ evenement.preventDefault();
3673
+ this.active.set(bornerDate(cible(), this.dateMin(), this.dateMax()));
3674
+ afterNextRender(() => {
3675
+ this.focus();
3676
+ }, { injector: this.injecteur });
3677
+ }
3678
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: StCalendar, deps: [], target: i0.ɵɵFactoryTarget.Component });
3679
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.6", type: StCalendar, isStandalone: true, selector: "st-calendar", inputs: { selection: { classPropertyName: "selection", publicName: "selection", isSignal: true, isRequired: false, transformFunction: null }, dateMin: { classPropertyName: "dateMin", publicName: "dateMin", isSignal: true, isRequired: false, transformFunction: null }, dateMax: { classPropertyName: "dateMax", publicName: "dateMax", isSignal: true, isRequired: false, transformFunction: null }, plage: { classPropertyName: "plage", publicName: "plage", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { choix: "choix", fermeture: "fermeture" }, host: { listeners: { "keydown": "surTouche($event)" }, classAttribute: "st-calendar" }, ngImport: i0, template: "<div class=\"st-calendar__entete\">\n <!-- eslint-disable-next-line @angular-eslint/template/elements-content --\n Le contenu vient du gabarit de stIconButton, et l'etiquette est requise. -->\n <button\n stIconButton\n type=\"button\"\n icone=\"chevron-gauche\"\n [etiquette]=\"libelles().moisPrecedent\"\n [disabled]=\"!moisPrecedentPossible()\"\n (click)=\"changerDeMois(-1)\"\n ></button>\n <!-- Region vivante : changer de mois a la souris ne deplace pas le focus, et le\n nouveau mois doit se dire. -->\n <p class=\"st-calendar__titre\" aria-live=\"polite\" [id]=\"identifiants.titre\">{{ titre() }}</p>\n <!-- eslint-disable-next-line @angular-eslint/template/elements-content --\n Le contenu vient du gabarit de stIconButton, et l'etiquette est requise. -->\n <button\n stIconButton\n type=\"button\"\n icone=\"chevron-droite\"\n [etiquette]=\"libelles().moisSuivant\"\n [disabled]=\"!moisSuivantPossible()\"\n (click)=\"changerDeMois(1)\"\n ></button>\n</div>\n\n<table\n class=\"st-calendar__grille\"\n role=\"grid\"\n [attr.aria-labelledby]=\"identifiants.titre\"\n [attr.aria-describedby]=\"identifiants.aide\"\n>\n <thead>\n <tr>\n @for (jour of joursDeLaSemaine(); track $index) {\n <th class=\"st-calendar__jour-de-semaine\" scope=\"col\" [attr.abbr]=\"jour.long\">\n {{ jour.court }}\n </th>\n }\n </tr>\n </thead>\n <tbody>\n @for (semaine of semaines(); track semaine[0]?.date) {\n <tr>\n @for (jour of semaine; track jour.date) {\n @if (jour.horsDuMois) {\n <td class=\"st-calendar__vide\"></td>\n } @else {\n <td [attr.aria-selected]=\"jour.choisi ? 'true' : null\">\n <button\n class=\"st-calendar__jour\"\n type=\"button\"\n [attr.data-date]=\"jour.date\"\n [attr.data-plage]=\"jour.dansLaPlage ? '' : null\"\n [attr.tabindex]=\"estActive(jour.date) ? 0 : -1\"\n [attr.aria-label]=\"jour.nom\"\n [attr.aria-current]=\"jour.aujourdHui ? 'date' : null\"\n [attr.aria-disabled]=\"jour.horsBornes ? 'true' : null\"\n (click)=\"choisir(jour)\"\n >\n {{ jour.numero }}\n </button>\n </td>\n }\n }\n </tr>\n }\n </tbody>\n</table>\n\n<p class=\"st-calendar__aide\" [id]=\"identifiants.aide\">{{ libelles().aideDuCalendrier }}</p>\n", styles: [".st-vh{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}:host([hidden]){display:none!important}:host{display:inline-block;padding:var(--st-espacement-3);color:var(--st-couleur-texte);background:var(--st-couleur-surface);border:1px solid var(--st-couleur-bordure-forte);border-radius:var(--st-rayon-md)}.st-calendar__entete{display:flex;gap:var(--st-espacement-2);align-items:center;justify-content:space-between;margin-block-end:var(--st-espacement-2)}.st-calendar__titre{margin:0;font-weight:var(--st-graisse-semi);text-transform:capitalize}.st-calendar__grille{border-collapse:collapse}.st-calendar__jour-de-semaine{padding-block-end:var(--st-espacement-1);font-size:var(--st-taille-sm);font-weight:var(--st-graisse-semi);color:var(--st-couleur-texte-discret);text-align:center}.st-calendar__jour:focus-visible{outline:2px solid var(--st-couleur-anneau-focus);outline-offset:2px}.st-calendar__jour{inline-size:var(--st-cible-tactile-min);block-size:var(--st-cible-tactile-min);font:inherit;font-variant-numeric:tabular-nums;color:inherit;cursor:pointer;background:transparent;border:1px solid transparent;border-radius:var(--st-rayon-sm)}.st-calendar__jour:hover:not([aria-disabled=true]){background:var(--st-couleur-surface-enfoncee)}.st-calendar__jour[aria-current=date]{font-weight:var(--st-graisse-semi);border-color:var(--st-couleur-bordure-forte)}.st-calendar__jour[data-plage]{background:var(--st-couleur-surface-enfoncee)}.st-calendar__jour[aria-disabled=true]{color:var(--st-couleur-texte-desactive);text-decoration:line-through;cursor:not-allowed}[aria-selected=true]>.st-calendar__jour{font-weight:var(--st-graisse-semi);color:var(--st-couleur-sur-primaire);background:var(--st-couleur-primaire)}.st-calendar__aide{max-inline-size:20rem;margin:var(--st-espacement-2) 0 0;font-size:var(--st-taille-sm);color:var(--st-couleur-texte-discret)}@media(forced-colors:active){[aria-selected=true]>.st-calendar__jour{forced-color-adjust:none;color:HighlightText;background:Highlight}}\n"], dependencies: [{ kind: "component", type: StIconButton, selector: "button[stIconButton]", inputs: ["icone", "etiquette", "variante", "taille", "enfonce"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
3680
+ }
3681
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: StCalendar, decorators: [{
3682
+ type: Component,
3683
+ args: [{ selector: 'st-calendar', changeDetection: ChangeDetectionStrategy.OnPush, imports: [StIconButton], host: {
3684
+ class: 'st-calendar',
3685
+ '(keydown)': 'surTouche($event)',
3686
+ }, template: "<div class=\"st-calendar__entete\">\n <!-- eslint-disable-next-line @angular-eslint/template/elements-content --\n Le contenu vient du gabarit de stIconButton, et l'etiquette est requise. -->\n <button\n stIconButton\n type=\"button\"\n icone=\"chevron-gauche\"\n [etiquette]=\"libelles().moisPrecedent\"\n [disabled]=\"!moisPrecedentPossible()\"\n (click)=\"changerDeMois(-1)\"\n ></button>\n <!-- Region vivante : changer de mois a la souris ne deplace pas le focus, et le\n nouveau mois doit se dire. -->\n <p class=\"st-calendar__titre\" aria-live=\"polite\" [id]=\"identifiants.titre\">{{ titre() }}</p>\n <!-- eslint-disable-next-line @angular-eslint/template/elements-content --\n Le contenu vient du gabarit de stIconButton, et l'etiquette est requise. -->\n <button\n stIconButton\n type=\"button\"\n icone=\"chevron-droite\"\n [etiquette]=\"libelles().moisSuivant\"\n [disabled]=\"!moisSuivantPossible()\"\n (click)=\"changerDeMois(1)\"\n ></button>\n</div>\n\n<table\n class=\"st-calendar__grille\"\n role=\"grid\"\n [attr.aria-labelledby]=\"identifiants.titre\"\n [attr.aria-describedby]=\"identifiants.aide\"\n>\n <thead>\n <tr>\n @for (jour of joursDeLaSemaine(); track $index) {\n <th class=\"st-calendar__jour-de-semaine\" scope=\"col\" [attr.abbr]=\"jour.long\">\n {{ jour.court }}\n </th>\n }\n </tr>\n </thead>\n <tbody>\n @for (semaine of semaines(); track semaine[0]?.date) {\n <tr>\n @for (jour of semaine; track jour.date) {\n @if (jour.horsDuMois) {\n <td class=\"st-calendar__vide\"></td>\n } @else {\n <td [attr.aria-selected]=\"jour.choisi ? 'true' : null\">\n <button\n class=\"st-calendar__jour\"\n type=\"button\"\n [attr.data-date]=\"jour.date\"\n [attr.data-plage]=\"jour.dansLaPlage ? '' : null\"\n [attr.tabindex]=\"estActive(jour.date) ? 0 : -1\"\n [attr.aria-label]=\"jour.nom\"\n [attr.aria-current]=\"jour.aujourdHui ? 'date' : null\"\n [attr.aria-disabled]=\"jour.horsBornes ? 'true' : null\"\n (click)=\"choisir(jour)\"\n >\n {{ jour.numero }}\n </button>\n </td>\n }\n }\n </tr>\n }\n </tbody>\n</table>\n\n<p class=\"st-calendar__aide\" [id]=\"identifiants.aide\">{{ libelles().aideDuCalendrier }}</p>\n", styles: [".st-vh{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}:host([hidden]){display:none!important}:host{display:inline-block;padding:var(--st-espacement-3);color:var(--st-couleur-texte);background:var(--st-couleur-surface);border:1px solid var(--st-couleur-bordure-forte);border-radius:var(--st-rayon-md)}.st-calendar__entete{display:flex;gap:var(--st-espacement-2);align-items:center;justify-content:space-between;margin-block-end:var(--st-espacement-2)}.st-calendar__titre{margin:0;font-weight:var(--st-graisse-semi);text-transform:capitalize}.st-calendar__grille{border-collapse:collapse}.st-calendar__jour-de-semaine{padding-block-end:var(--st-espacement-1);font-size:var(--st-taille-sm);font-weight:var(--st-graisse-semi);color:var(--st-couleur-texte-discret);text-align:center}.st-calendar__jour:focus-visible{outline:2px solid var(--st-couleur-anneau-focus);outline-offset:2px}.st-calendar__jour{inline-size:var(--st-cible-tactile-min);block-size:var(--st-cible-tactile-min);font:inherit;font-variant-numeric:tabular-nums;color:inherit;cursor:pointer;background:transparent;border:1px solid transparent;border-radius:var(--st-rayon-sm)}.st-calendar__jour:hover:not([aria-disabled=true]){background:var(--st-couleur-surface-enfoncee)}.st-calendar__jour[aria-current=date]{font-weight:var(--st-graisse-semi);border-color:var(--st-couleur-bordure-forte)}.st-calendar__jour[data-plage]{background:var(--st-couleur-surface-enfoncee)}.st-calendar__jour[aria-disabled=true]{color:var(--st-couleur-texte-desactive);text-decoration:line-through;cursor:not-allowed}[aria-selected=true]>.st-calendar__jour{font-weight:var(--st-graisse-semi);color:var(--st-couleur-sur-primaire);background:var(--st-couleur-primaire)}.st-calendar__aide{max-inline-size:20rem;margin:var(--st-espacement-2) 0 0;font-size:var(--st-taille-sm);color:var(--st-couleur-texte-discret)}@media(forced-colors:active){[aria-selected=true]>.st-calendar__jour{forced-color-adjust:none;color:HighlightText;background:Highlight}}\n"] }]
3687
+ }], propDecorators: { selection: [{ type: i0.Input, args: [{ isSignal: true, alias: "selection", required: false }] }], dateMin: [{ type: i0.Input, args: [{ isSignal: true, alias: "dateMin", required: false }] }], dateMax: [{ type: i0.Input, args: [{ isSignal: true, alias: "dateMax", required: false }] }], plage: [{ type: i0.Input, args: [{ isSignal: true, alias: "plage", required: false }] }], choix: [{ type: i0.Output, args: ["choix"] }], fermeture: [{ type: i0.Output, args: ["fermeture"] }] } });
3688
+
3689
+ /** Deux choix du meme fichier ne l'ajoutent pas deux fois. */
3690
+ function empreinte(fichier) {
3691
+ return `${fichier.name}|${fichier.size.toString()}|${fichier.lastModified.toString()}`;
3692
+ }
3693
+ /**
3694
+ * Choix de fichiers, sur un `input type="file"` natif.
3695
+ *
3696
+ * ```html
3697
+ * <st-file-upload libelle="Justificatifs" accept=".pdf, image/*" [tailleMax]="5_000_000" multiple
3698
+ * [formField]="dossier.pieces" />
3699
+ * <!-- schema : validate(chemin.pieces, ({ value }) => erreursDeFichiers(value(), regles)) -->
3700
+ * ```
3701
+ *
3702
+ * Le modele est la liste des `File` choisis. L'envoi appartient a l'application,
3703
+ * par `@starterlib/core` : le composant choisit, il ne televerse pas.
3704
+ *
3705
+ * ⚠️ **L'element natif reste la voie principale** (FE-4) : il ouvre le selecteur
3706
+ * du systeme, l'appareil photo sur mobile, et se commande au clavier. Il est
3707
+ * masque visuellement, pas retire : le bouton affiche est son etiquette. Le
3708
+ * depot par glisser est un complement a la souris, jamais la seule voie.
3709
+ *
3710
+ * ⚠️ **Aucun apercu d'image** (SEC-7). Un apercu passe par une adresse `blob:`
3711
+ * que la politique de securite du contenu doit autoriser, et un SVG affiche peut
3712
+ * porter du script. Le nom et la taille suffisent a reconnaitre un fichier.
3713
+ *
3714
+ * ⚠️ **`accept`, `tailleMax` et `nombreMax` sont un confort** (SEC-5) : ils
3715
+ * s'affichent en aide et filtrent le selecteur du systeme, mais la verification
3716
+ * est dans le schema — `erreursDeFichiers` —, et le serveur relit le contenu.
3717
+ *
3718
+ * Chaque changement de la liste s'annonce : « 2 fichiers choisis ». Un fichier
3719
+ * retire rend le focus au bouton de retrait suivant, ou au choix de fichiers : le
3720
+ * focus ne tombe jamais sur le document.
3721
+ */
3722
+ class StFileUpload extends ContratDeChamp {
3723
+ libelles = inject(ST_LIBELLES);
3724
+ locale = inject(ST_LOCALE);
3725
+ element = inject(ElementRef);
3726
+ injecteur = inject(Injector);
3727
+ value = model([], /* @ts-ignore */
3728
+ ...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
3729
+ /** Attribut `accept` natif : `.pdf, image/*`. */
3730
+ accept = input('', /* @ts-ignore */
3731
+ ...(ngDevMode ? [{ debugName: "accept" }] : /* istanbul ignore next */ []));
3732
+ multiple = input(false, { ...(ngDevMode ? { debugName: "multiple" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
3733
+ /** En octets. Affiche en aide ; la verification est dans le schema. */
3734
+ tailleMax = input(null, /* @ts-ignore */
3735
+ ...(ngDevMode ? [{ debugName: "tailleMax" }] : /* istanbul ignore next */ []));
3736
+ annonce = new AnnonceLocale(inject(DestroyRef));
3737
+ survol = signal(false, /* @ts-ignore */
3738
+ ...(ngDevMode ? [{ debugName: "survol" }] : /* istanbul ignore next */ []));
3739
+ aideLue = computed(() => {
3740
+ const libelles = this.libelles();
3741
+ const textes = [this.aide()];
3742
+ if (this.accept().trim() !== '')
3743
+ textes.push(libelles.typesAcceptes(this.accept()));
3744
+ const taille = this.tailleMax();
3745
+ if (taille !== null)
3746
+ textes.push(libelles.tailleMaximale(formaterTaille(taille, this.locale())));
3747
+ const aide = textes.filter((texte) => texte !== null).join(' ');
3748
+ return aide === '' ? null : aide;
3749
+ }, /* @ts-ignore */
3750
+ ...(ngDevMode ? [{ debugName: "aideLue" }] : /* istanbul ignore next */ []));
3751
+ lignes = computed(() => {
3752
+ const locale = this.locale();
3753
+ return this.value().map((fichier) => ({
3754
+ fichier,
3755
+ cle: empreinte(fichier),
3756
+ taille: formaterTaille(fichier.size, locale),
3757
+ }));
3758
+ }, /* @ts-ignore */
3759
+ ...(ngDevMode ? [{ debugName: "lignes" }] : /* istanbul ignore next */ []));
3760
+ surChoix(evenement) {
3761
+ const element = evenement.target;
3762
+ this.ajouter(Array.from(element.files ?? []));
3763
+ // Vide, pour qu'un second choix du meme fichier declenche encore `change`.
3764
+ element.value = '';
3765
+ }
3766
+ surSurvol(evenement) {
3767
+ if (this.disabled() || this.readonly())
3768
+ return;
3769
+ evenement.preventDefault();
3770
+ this.survol.set(true);
3771
+ }
3772
+ surDepot(evenement) {
3773
+ evenement.preventDefault();
3774
+ this.survol.set(false);
3775
+ if (this.disabled() || this.readonly())
3776
+ return;
3777
+ this.ajouter(Array.from(evenement.dataTransfer?.files ?? []));
3778
+ }
3779
+ retirer(indice) {
3780
+ const restants = this.value().filter((_, position) => position !== indice);
3781
+ this.value.set(restants);
3782
+ this.annonce.annoncer(this.libelles().nombreDeFichiers(restants.length));
3783
+ afterNextRender(() => {
3784
+ const boutons = this.element.nativeElement.querySelectorAll('.st-file-upload__retrait');
3785
+ const suivant = boutons[Math.min(indice, boutons.length - 1)];
3786
+ if (suivant !== undefined)
3787
+ suivant.focus();
3788
+ else
3789
+ this.focus();
3790
+ }, { injector: this.injecteur });
3791
+ }
3792
+ aLaSortie(evenement) {
3793
+ const suivant = evenement.relatedTarget;
3794
+ if (suivant !== null && this.element.nativeElement.contains(suivant))
3795
+ return;
3796
+ this.touch.emit();
3797
+ }
3798
+ ajouter(fichiers) {
3799
+ if (fichiers.length === 0 || this.disabled() || this.readonly())
3800
+ return;
3801
+ let liste;
3802
+ if (this.multiple()) {
3803
+ const connus = new Set(this.value().map(empreinte));
3804
+ liste = [...this.value(), ...fichiers.filter((fichier) => !connus.has(empreinte(fichier)))];
3805
+ }
3806
+ else {
3807
+ liste = fichiers.slice(0, 1);
3808
+ }
3809
+ this.value.set(liste);
3810
+ // Le choix est complet : ses erreurs — taille, type — se montrent tout de suite.
3811
+ this.touch.emit();
3812
+ this.annonce.annoncer(this.libelles().nombreDeFichiers(liste.length));
3813
+ }
3814
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: StFileUpload, deps: null, target: i0.ɵɵFactoryTarget.Component });
3815
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.6", type: StFileUpload, isStandalone: true, selector: "st-file-upload", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, accept: { classPropertyName: "accept", publicName: "accept", isSignal: true, isRequired: false, transformFunction: null }, multiple: { classPropertyName: "multiple", publicName: "multiple", isSignal: true, isRequired: false, transformFunction: null }, tailleMax: { classPropertyName: "tailleMax", publicName: "tailleMax", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange" }, host: { listeners: { "focusout": "aLaSortie($event)" }, classAttribute: "st-file-upload" }, usesInheritance: true, ngImport: i0, template: "<st-form-field\n [libelle]=\"libelle()\"\n [aide]=\"aideLue()\"\n [erreurs]=\"errors()\"\n [afficherErreurs]=\"touched()\"\n [obligatoire]=\"required()\"\n>\n <div\n class=\"st-file-upload__zone\"\n [attr.data-survol]=\"survol() ? '' : null\"\n [attr.data-desactive]=\"disabled() ? '' : null\"\n (dragover)=\"surSurvol($event)\"\n (dragleave)=\"survol.set(false)\"\n (drop)=\"surDepot($event)\"\n >\n <input\n #champ\n class=\"st-file-upload__natif\"\n stControleDeChamp\n type=\"file\"\n [accept]=\"accept()\"\n [multiple]=\"multiple()\"\n [attr.name]=\"name() || null\"\n [disabled]=\"disabled() || readonly()\"\n (change)=\"surChoix($event)\"\n />\n <!-- Voie de la souris vers le champ natif. Masque au lecteur d'ecran et hors\n tabulation : le clavier et le lecteur d'ecran passent par le champ natif,\n deja nomme par l'etiquette du champ. -->\n <span class=\"st-file-upload__bouton\" aria-hidden=\"true\" (click)=\"champ.click()\">\n <st-icon nom=\"televerser\" taille=\"sm\" />\n {{ multiple() ? libelles().choisirDesFichiers : libelles().choisirUnFichier }}\n </span>\n @if (multiple()) {\n <span class=\"st-file-upload__depot\" aria-hidden=\"true\">{{ libelles().ouDeposerIci }}</span>\n }\n </div>\n\n @if (lignes().length > 0) {\n <ul class=\"st-file-upload__liste\">\n @for (ligne of lignes(); track ligne.cle; let indice = $index) {\n <li class=\"st-file-upload__fichier\">\n <st-icon nom=\"fichier\" taille=\"sm\" />\n <span class=\"st-file-upload__nom\">{{ ligne.fichier.name }}</span>\n <span class=\"st-file-upload__taille\">{{ ligne.taille }}</span>\n <!-- eslint-disable-next-line @angular-eslint/template/elements-content --\n Le contenu vient du gabarit de stIconButton, et l'etiquette est requise. -->\n <button\n class=\"st-file-upload__retrait\"\n stIconButton\n type=\"button\"\n icone=\"corbeille\"\n taille=\"sm\"\n [etiquette]=\"libelles().retirerLeFichier(ligne.fichier.name)\"\n [disabled]=\"disabled() || readonly()\"\n (click)=\"retirer(indice)\"\n ></button>\n </li>\n }\n </ul>\n }\n</st-form-field>\n<span class=\"st-vh\" aria-live=\"polite\">{{ annonce.texte() }}</span>\n", styles: [".st-vh{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}:host([hidden]){display:none!important}:host{display:block}.st-file-upload__zone{position:relative;display:flex;flex-wrap:wrap;gap:var(--st-espacement-2) var(--st-espacement-3);align-items:center;padding:var(--st-espacement-3);border:1px dashed var(--st-couleur-bordure-forte);border-radius:var(--st-rayon-md)}.st-file-upload__zone[data-survol]{background:var(--st-couleur-surface-enfoncee);border-style:solid}.st-file-upload__natif{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}.st-file-upload__bouton{display:inline-flex;gap:var(--st-espacement-2);align-items:center;min-block-size:var(--st-cible-tactile-min);padding:var(--st-espacement-2) var(--st-espacement-4);font-weight:var(--st-graisse-semi);color:var(--st-couleur-texte);cursor:pointer;background:var(--st-couleur-surface);border:1px solid var(--st-couleur-bordure-forte);border-radius:var(--st-rayon-sm)}.st-file-upload__natif:focus-visible+.st-file-upload__bouton{outline:2px solid var(--st-couleur-anneau-focus);outline-offset:2px}[aria-invalid=true]+.st-file-upload__bouton{border-color:var(--st-couleur-danger);box-shadow:inset 0 0 0 1px var(--st-couleur-danger)}.st-file-upload__natif:disabled+.st-file-upload__bouton{color:var(--st-couleur-texte-desactive);cursor:not-allowed;background:var(--st-couleur-surface-enfoncee)}.st-file-upload__depot{color:var(--st-couleur-texte-discret)}.st-file-upload__liste{display:grid;gap:var(--st-espacement-1);padding:0;margin:var(--st-espacement-2) 0 0;list-style:none}.st-file-upload__fichier{display:flex;gap:var(--st-espacement-2);align-items:center}.st-file-upload__nom{min-inline-size:0;overflow-wrap:anywhere}.st-file-upload__taille{flex:none;color:var(--st-couleur-texte-discret);font-variant-numeric:tabular-nums}\n"], dependencies: [{ kind: "component", type: StFormField, selector: "st-form-field", inputs: ["libelle", "aide", "complement", "erreurs", "afficherErreurs", "obligatoire", "disposition", "libelleMasque"] }, { kind: "directive", type: StControleDeChamp, selector: "[stControleDeChamp]" }, { kind: "component", type: StIcon, selector: "st-icon", inputs: ["nom", "taille", "ton", "etiquette"] }, { kind: "component", type: StIconButton, selector: "button[stIconButton]", inputs: ["icone", "etiquette", "variante", "taille", "enfonce"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
3816
+ }
3817
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: StFileUpload, decorators: [{
3818
+ type: Component,
3819
+ args: [{ selector: 'st-file-upload', changeDetection: ChangeDetectionStrategy.OnPush, imports: [StFormField, StControleDeChamp, StIcon, StIconButton], host: {
3820
+ class: 'st-file-upload',
3821
+ '(focusout)': 'aLaSortie($event)',
3822
+ }, template: "<st-form-field\n [libelle]=\"libelle()\"\n [aide]=\"aideLue()\"\n [erreurs]=\"errors()\"\n [afficherErreurs]=\"touched()\"\n [obligatoire]=\"required()\"\n>\n <div\n class=\"st-file-upload__zone\"\n [attr.data-survol]=\"survol() ? '' : null\"\n [attr.data-desactive]=\"disabled() ? '' : null\"\n (dragover)=\"surSurvol($event)\"\n (dragleave)=\"survol.set(false)\"\n (drop)=\"surDepot($event)\"\n >\n <input\n #champ\n class=\"st-file-upload__natif\"\n stControleDeChamp\n type=\"file\"\n [accept]=\"accept()\"\n [multiple]=\"multiple()\"\n [attr.name]=\"name() || null\"\n [disabled]=\"disabled() || readonly()\"\n (change)=\"surChoix($event)\"\n />\n <!-- Voie de la souris vers le champ natif. Masque au lecteur d'ecran et hors\n tabulation : le clavier et le lecteur d'ecran passent par le champ natif,\n deja nomme par l'etiquette du champ. -->\n <span class=\"st-file-upload__bouton\" aria-hidden=\"true\" (click)=\"champ.click()\">\n <st-icon nom=\"televerser\" taille=\"sm\" />\n {{ multiple() ? libelles().choisirDesFichiers : libelles().choisirUnFichier }}\n </span>\n @if (multiple()) {\n <span class=\"st-file-upload__depot\" aria-hidden=\"true\">{{ libelles().ouDeposerIci }}</span>\n }\n </div>\n\n @if (lignes().length > 0) {\n <ul class=\"st-file-upload__liste\">\n @for (ligne of lignes(); track ligne.cle; let indice = $index) {\n <li class=\"st-file-upload__fichier\">\n <st-icon nom=\"fichier\" taille=\"sm\" />\n <span class=\"st-file-upload__nom\">{{ ligne.fichier.name }}</span>\n <span class=\"st-file-upload__taille\">{{ ligne.taille }}</span>\n <!-- eslint-disable-next-line @angular-eslint/template/elements-content --\n Le contenu vient du gabarit de stIconButton, et l'etiquette est requise. -->\n <button\n class=\"st-file-upload__retrait\"\n stIconButton\n type=\"button\"\n icone=\"corbeille\"\n taille=\"sm\"\n [etiquette]=\"libelles().retirerLeFichier(ligne.fichier.name)\"\n [disabled]=\"disabled() || readonly()\"\n (click)=\"retirer(indice)\"\n ></button>\n </li>\n }\n </ul>\n }\n</st-form-field>\n<span class=\"st-vh\" aria-live=\"polite\">{{ annonce.texte() }}</span>\n", styles: [".st-vh{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}:host([hidden]){display:none!important}:host{display:block}.st-file-upload__zone{position:relative;display:flex;flex-wrap:wrap;gap:var(--st-espacement-2) var(--st-espacement-3);align-items:center;padding:var(--st-espacement-3);border:1px dashed var(--st-couleur-bordure-forte);border-radius:var(--st-rayon-md)}.st-file-upload__zone[data-survol]{background:var(--st-couleur-surface-enfoncee);border-style:solid}.st-file-upload__natif{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}.st-file-upload__bouton{display:inline-flex;gap:var(--st-espacement-2);align-items:center;min-block-size:var(--st-cible-tactile-min);padding:var(--st-espacement-2) var(--st-espacement-4);font-weight:var(--st-graisse-semi);color:var(--st-couleur-texte);cursor:pointer;background:var(--st-couleur-surface);border:1px solid var(--st-couleur-bordure-forte);border-radius:var(--st-rayon-sm)}.st-file-upload__natif:focus-visible+.st-file-upload__bouton{outline:2px solid var(--st-couleur-anneau-focus);outline-offset:2px}[aria-invalid=true]+.st-file-upload__bouton{border-color:var(--st-couleur-danger);box-shadow:inset 0 0 0 1px var(--st-couleur-danger)}.st-file-upload__natif:disabled+.st-file-upload__bouton{color:var(--st-couleur-texte-desactive);cursor:not-allowed;background:var(--st-couleur-surface-enfoncee)}.st-file-upload__depot{color:var(--st-couleur-texte-discret)}.st-file-upload__liste{display:grid;gap:var(--st-espacement-1);padding:0;margin:var(--st-espacement-2) 0 0;list-style:none}.st-file-upload__fichier{display:flex;gap:var(--st-espacement-2);align-items:center}.st-file-upload__nom{min-inline-size:0;overflow-wrap:anywhere}.st-file-upload__taille{flex:none;color:var(--st-couleur-texte-discret);font-variant-numeric:tabular-nums}\n"] }]
3823
+ }], propDecorators: { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }], accept: [{ type: i0.Input, args: [{ isSignal: true, alias: "accept", required: false }] }], multiple: [{ type: i0.Input, args: [{ isSignal: true, alias: "multiple", required: false }] }], tailleMax: [{ type: i0.Input, args: [{ isSignal: true, alias: "tailleMax", required: false }] }] } });
3824
+
3825
+ /** Plafond du backend : au-dela, la requete est refusee (SEC-7 de la vague 4). */
3826
+ const TAILLE_MAXIMALE = 100;
3827
+ /**
3828
+ * Pagination d'une liste par curseur.
3829
+ *
3830
+ * ```html
3831
+ * <st-data-table #tableau … />
3832
+ * <st-pagination
3833
+ * [numero]="navigation.numeroDePage()"
3834
+ * [precedenteDisponible]="navigation.precedenteDisponible()"
3835
+ * [suivanteDisponible]="page.value()?.hasMore ?? false"
3836
+ * [chargement]="page.isLoading()"
3837
+ * [cible]="tableau"
3838
+ * (precedente)="navigation.precedente()"
3839
+ * (suivante)="navigation.suivante(page.value())"
3840
+ * />
3841
+ * ```
3842
+ *
3843
+ * ⚠️ **Ni total, ni numeros cliquables** : le backend ne compte pas et ne va que
3844
+ * vers l'avant (audit de la vague 4, V4-2). « Page 3 » se dit ; « page 3 sur 12 »
3845
+ * serait invente.
3846
+ *
3847
+ * ⚠️ **Boutons indisponibles, jamais desactives** : sur la derniere page, « Page
3848
+ * suivante » garde le focus qu'il avait. Desactive, il le perdrait, et le lecteur
3849
+ * d'ecran retomberait sur le debut du document.
3850
+ *
3851
+ * ⚠️ **Apres un changement de page, le focus va a la `cible`** — la legende du
3852
+ * tableau — et « Page 2 » s'annonce (UX-13). Sans cela, la personne au clavier
3853
+ * reste en bas, sur « Page suivante », sans savoir que le contenu au-dessus a
3854
+ * change.
3855
+ */
3856
+ class StPagination {
3857
+ libelles = inject(ST_LIBELLES);
3858
+ injecteur = inject(Injector);
3859
+ mode = input('pages', /* @ts-ignore */
3860
+ ...(ngDevMode ? [{ debugName: "mode" }] : /* istanbul ignore next */ []));
3861
+ /** A partir de 1. */
3862
+ numero = input(1, /* @ts-ignore */
3863
+ ...(ngDevMode ? [{ debugName: "numero" }] : /* istanbul ignore next */ []));
3864
+ precedenteDisponible = input(false, { ...(ngDevMode ? { debugName: "precedenteDisponible" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
3865
+ suivanteDisponible = input(false, { ...(ngDevMode ? { debugName: "suivanteDisponible" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
3866
+ chargement = input(false, { ...(ngDevMode ? { debugName: "chargement" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
3867
+ /** Nom de la navigation, quand une page en porte plusieurs. */
3868
+ etiquette = input(null, /* @ts-ignore */
3869
+ ...(ngDevMode ? [{ debugName: "etiquette" }] : /* istanbul ignore next */ []));
3870
+ /** Tailles proposees ; vide, pas de choix. Plafonnees a 100. */
3871
+ taillesDePage = input([], /* @ts-ignore */
3872
+ ...(ngDevMode ? [{ debugName: "taillesDePage" }] : /* istanbul ignore next */ []));
3873
+ taille = model(20, /* @ts-ignore */
3874
+ ...(ngDevMode ? [{ debugName: "taille" }] : /* istanbul ignore next */ []));
3875
+ /** Recoit le focus apres un changement de page. */
3876
+ cible = input(null, /* @ts-ignore */
3877
+ ...(ngDevMode ? [{ debugName: "cible" }] : /* istanbul ignore next */ []));
3878
+ precedente = output();
3879
+ suivante = output();
3880
+ annonce = new AnnonceLocale(inject(DestroyRef));
3881
+ tailles = computed(() => this.taillesDePage().filter((taille) => taille >= 1 && taille <= TAILLE_MAXIMALE), /* @ts-ignore */
3882
+ ...(ngDevMode ? [{ debugName: "tailles" }] : /* istanbul ignore next */ []));
3883
+ etiquetteLue = computed(() => this.etiquette() ?? this.libelles().pagination, /* @ts-ignore */
3884
+ ...(ngDevMode ? [{ debugName: "etiquetteLue" }] : /* istanbul ignore next */ []));
3885
+ constructor() {
3886
+ // Le focus attend la FIN du chargement : amene sur la cible pendant que les
3887
+ // anciennes lignes sont encore la, il ferait relire la page quittee.
3888
+ let dernier = null;
3889
+ let enAttente = false;
3890
+ effect(() => {
3891
+ const numero = this.numero();
3892
+ const chargement = this.chargement();
3893
+ if (dernier === null) {
3894
+ dernier = numero;
3895
+ return;
3896
+ }
3897
+ if (numero !== dernier) {
3898
+ dernier = numero;
3899
+ enAttente = true;
3900
+ if (this.mode() === 'pages')
3901
+ this.annonce.annoncer(this.libelles().pageNumero(numero));
3902
+ }
3903
+ if (!enAttente || chargement)
3904
+ return;
3905
+ enAttente = false;
3906
+ afterNextRender(() => {
3907
+ const cible = this.cible();
3908
+ const element = typeof cible === 'function' ? cible() : cible;
3909
+ element?.focus();
3910
+ }, { injector: this.injecteur });
3911
+ });
3912
+ }
3913
+ surTaille(evenement) {
3914
+ this.taille.set(Number(evenement.target.value));
3915
+ }
3916
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: StPagination, deps: [], target: i0.ɵɵFactoryTarget.Component });
3917
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.6", type: StPagination, isStandalone: true, selector: "st-pagination", inputs: { mode: { classPropertyName: "mode", publicName: "mode", isSignal: true, isRequired: false, transformFunction: null }, numero: { classPropertyName: "numero", publicName: "numero", isSignal: true, isRequired: false, transformFunction: null }, precedenteDisponible: { classPropertyName: "precedenteDisponible", publicName: "precedenteDisponible", isSignal: true, isRequired: false, transformFunction: null }, suivanteDisponible: { classPropertyName: "suivanteDisponible", publicName: "suivanteDisponible", isSignal: true, isRequired: false, transformFunction: null }, chargement: { classPropertyName: "chargement", publicName: "chargement", isSignal: true, isRequired: false, transformFunction: null }, etiquette: { classPropertyName: "etiquette", publicName: "etiquette", isSignal: true, isRequired: false, transformFunction: null }, taillesDePage: { classPropertyName: "taillesDePage", publicName: "taillesDePage", isSignal: true, isRequired: false, transformFunction: null }, taille: { classPropertyName: "taille", publicName: "taille", isSignal: true, isRequired: false, transformFunction: null }, cible: { classPropertyName: "cible", publicName: "cible", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { taille: "tailleChange", precedente: "precedente", suivante: "suivante" }, host: { classAttribute: "st-pagination" }, ngImport: i0, template: "<nav class=\"st-pagination__navigation\" [attr.aria-label]=\"etiquetteLue()\">\n @if (mode() === 'pages') {\n <button\n stButton\n type=\"button\"\n iconeAvant=\"chevron-gauche\"\n [indisponible]=\"!precedenteDisponible() || chargement()\"\n (click)=\"precedente.emit()\"\n >\n {{ libelles().pagePrecedente }}\n </button>\n <span class=\"st-pagination__numero\" aria-current=\"page\">\n {{ libelles().pageNumero(numero()) }}\n </span>\n <button\n stButton\n type=\"button\"\n iconeApres=\"chevron-droite\"\n [indisponible]=\"!suivanteDisponible()\"\n [chargement]=\"chargement()\"\n (click)=\"suivante.emit()\"\n >\n {{ libelles().pageSuivante }}\n </button>\n } @else if (suivanteDisponible()) {\n <button stButton type=\"button\" [chargement]=\"chargement()\" (click)=\"suivante.emit()\">\n {{ libelles().afficherPlus }}\n </button>\n }\n\n @if (tailles().length > 0) {\n <label class=\"st-pagination__taille\">\n <span>{{ libelles().lignesParPage }}</span>\n <select class=\"st-pagination__choix\" (change)=\"surTaille($event)\">\n @for (proposee of tailles(); track proposee) {\n <option [value]=\"proposee\" [selected]=\"proposee === taille()\">{{ proposee }}</option>\n }\n </select>\n </label>\n }\n</nav>\n<span class=\"st-vh\" aria-live=\"polite\">{{ annonce.texte() }}</span>\n", styles: [".st-vh{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}:host([hidden]){display:none!important}:host{display:block}.st-pagination__navigation{display:flex;flex-wrap:wrap;gap:var(--st-espacement-2) var(--st-espacement-3);align-items:center}.st-pagination__numero{font-variant-numeric:tabular-nums;font-weight:var(--st-graisse-semi)}.st-pagination__taille{display:inline-flex;gap:var(--st-espacement-2);align-items:center;margin-inline-start:auto}.st-pagination__choix:focus-visible{outline:2px solid var(--st-couleur-anneau-focus);outline-offset:2px}.st-pagination__choix{box-sizing:border-box;inline-size:100%;min-block-size:var(--st-cible-tactile-min);padding:var(--st-espacement-2) var(--st-espacement-3);font:inherit;color:var(--st-couleur-texte);background:var(--st-couleur-surface);border:1px solid var(--st-couleur-bordure-forte);border-radius:var(--st-rayon-sm)}.st-pagination__choix[aria-invalid=true]{border-color:var(--st-couleur-danger);box-shadow:inset 0 0 0 1px var(--st-couleur-danger)}.st-pagination__choix:disabled{color:var(--st-couleur-texte-desactive);cursor:not-allowed;background:var(--st-couleur-surface-enfoncee)}.st-pagination__choix:read-only:not(:disabled){background:var(--st-couleur-surface-enfoncee)}.st-pagination__choix{inline-size:auto}\n"], dependencies: [{ kind: "component", type: StButton, selector: "button[stButton]", inputs: ["variante", "taille", "pleineLargeur", "iconeAvant", "iconeApres", "chargement", "indisponible"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
3918
+ }
3919
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: StPagination, decorators: [{
3920
+ type: Component,
3921
+ args: [{ selector: 'st-pagination', changeDetection: ChangeDetectionStrategy.OnPush, imports: [StButton], host: { class: 'st-pagination' }, template: "<nav class=\"st-pagination__navigation\" [attr.aria-label]=\"etiquetteLue()\">\n @if (mode() === 'pages') {\n <button\n stButton\n type=\"button\"\n iconeAvant=\"chevron-gauche\"\n [indisponible]=\"!precedenteDisponible() || chargement()\"\n (click)=\"precedente.emit()\"\n >\n {{ libelles().pagePrecedente }}\n </button>\n <span class=\"st-pagination__numero\" aria-current=\"page\">\n {{ libelles().pageNumero(numero()) }}\n </span>\n <button\n stButton\n type=\"button\"\n iconeApres=\"chevron-droite\"\n [indisponible]=\"!suivanteDisponible()\"\n [chargement]=\"chargement()\"\n (click)=\"suivante.emit()\"\n >\n {{ libelles().pageSuivante }}\n </button>\n } @else if (suivanteDisponible()) {\n <button stButton type=\"button\" [chargement]=\"chargement()\" (click)=\"suivante.emit()\">\n {{ libelles().afficherPlus }}\n </button>\n }\n\n @if (tailles().length > 0) {\n <label class=\"st-pagination__taille\">\n <span>{{ libelles().lignesParPage }}</span>\n <select class=\"st-pagination__choix\" (change)=\"surTaille($event)\">\n @for (proposee of tailles(); track proposee) {\n <option [value]=\"proposee\" [selected]=\"proposee === taille()\">{{ proposee }}</option>\n }\n </select>\n </label>\n }\n</nav>\n<span class=\"st-vh\" aria-live=\"polite\">{{ annonce.texte() }}</span>\n", styles: [".st-vh{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}:host([hidden]){display:none!important}:host{display:block}.st-pagination__navigation{display:flex;flex-wrap:wrap;gap:var(--st-espacement-2) var(--st-espacement-3);align-items:center}.st-pagination__numero{font-variant-numeric:tabular-nums;font-weight:var(--st-graisse-semi)}.st-pagination__taille{display:inline-flex;gap:var(--st-espacement-2);align-items:center;margin-inline-start:auto}.st-pagination__choix:focus-visible{outline:2px solid var(--st-couleur-anneau-focus);outline-offset:2px}.st-pagination__choix{box-sizing:border-box;inline-size:100%;min-block-size:var(--st-cible-tactile-min);padding:var(--st-espacement-2) var(--st-espacement-3);font:inherit;color:var(--st-couleur-texte);background:var(--st-couleur-surface);border:1px solid var(--st-couleur-bordure-forte);border-radius:var(--st-rayon-sm)}.st-pagination__choix[aria-invalid=true]{border-color:var(--st-couleur-danger);box-shadow:inset 0 0 0 1px var(--st-couleur-danger)}.st-pagination__choix:disabled{color:var(--st-couleur-texte-desactive);cursor:not-allowed;background:var(--st-couleur-surface-enfoncee)}.st-pagination__choix:read-only:not(:disabled){background:var(--st-couleur-surface-enfoncee)}.st-pagination__choix{inline-size:auto}\n"] }]
3922
+ }], ctorParameters: () => [], propDecorators: { mode: [{ type: i0.Input, args: [{ isSignal: true, alias: "mode", required: false }] }], numero: [{ type: i0.Input, args: [{ isSignal: true, alias: "numero", required: false }] }], precedenteDisponible: [{ type: i0.Input, args: [{ isSignal: true, alias: "precedenteDisponible", required: false }] }], suivanteDisponible: [{ type: i0.Input, args: [{ isSignal: true, alias: "suivanteDisponible", required: false }] }], chargement: [{ type: i0.Input, args: [{ isSignal: true, alias: "chargement", required: false }] }], etiquette: [{ type: i0.Input, args: [{ isSignal: true, alias: "etiquette", required: false }] }], taillesDePage: [{ type: i0.Input, args: [{ isSignal: true, alias: "taillesDePage", required: false }] }], taille: [{ type: i0.Input, args: [{ isSignal: true, alias: "taille", required: false }] }, { type: i0.Output, args: ["tailleChange"] }], cible: [{ type: i0.Input, args: [{ isSignal: true, alias: "cible", required: false }] }], precedente: [{ type: i0.Output, args: ["precedente"] }], suivante: [{ type: i0.Output, args: ["suivante"] }] } });
3923
+
3924
+ /**
3925
+ * Valeur riche d'un element : montant, date, valeur masquee.
3926
+ *
3927
+ * ```html
3928
+ * <ng-template stDescription="iban" let-element>
3929
+ * <st-masked nature="iban" [valeur]="compte().iban" />
3930
+ * </ng-template>
3931
+ * ```
3932
+ */
3933
+ class StDescription {
3934
+ cle = input.required({ ...(ngDevMode ? { debugName: "cle" } : /* istanbul ignore next */ {}), alias: 'stDescription' });
3935
+ gabarit = inject(TemplateRef);
3936
+ static ngTemplateContextGuard(_directive, _contexte) {
3937
+ return true;
3938
+ }
3939
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: StDescription, deps: [], target: i0.ɵɵFactoryTarget.Directive });
3940
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.1.6", type: StDescription, isStandalone: true, selector: "ng-template[stDescription]", inputs: { cle: { classPropertyName: "cle", publicName: "stDescription", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0 });
3941
+ }
3942
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: StDescription, decorators: [{
3943
+ type: Directive,
3944
+ args: [{ selector: 'ng-template[stDescription]' }]
3945
+ }], propDecorators: { cle: [{ type: i0.Input, args: [{ isSignal: true, alias: "stDescription", required: true }] }] } });
3946
+ /**
3947
+ * Liste de descriptions : les proprietes d'un objet, sur une page de detail.
3948
+ *
3949
+ * ```html
3950
+ * <st-description-list [elements]="[
3951
+ * { terme: 'Reference', description: commande().reference },
3952
+ * { cle: 'montant', terme: 'Montant', description: null },
3953
+ * ]">
3954
+ * <ng-template stDescription="montant"><st-money [valeur]="commande().montant" /></ng-template>
3955
+ * </st-description-list>
3956
+ * ```
3957
+ *
3958
+ * ⚠️ **Un vrai `dl`, rendu par le composant.** Le lecteur d'ecran annonce « liste de
3959
+ * descriptions, 4 elements » et lit chaque terme avec sa valeur. Ecrits par
3960
+ * l'application et projetes, `dt` et `dd` echapperaient aux styles du composant,
3961
+ * et un `div` mal place rendrait la liste invalide.
3962
+ *
3963
+ * ⚠️ **Une valeur absente se dit** : « — » a l'ecran, « Non renseigne » au lecteur
3964
+ * d'ecran. Une cellule vide ne distingue pas « aucun » de « pas encore charge ».
3965
+ *
3966
+ * En colonnes quand la place le permet, empile en dessous : la largeur est celle
3967
+ * du CONTENEUR, pas de l'ecran — la meme liste dans une carte etroite s'empile
3968
+ * aussi sur un grand ecran (UX-18).
3969
+ */
3970
+ class StDescriptionList {
3971
+ libelles = inject(ST_LIBELLES);
3972
+ elements = input.required(/* @ts-ignore */
3973
+ ...(ngDevMode ? [{ debugName: "elements" }] : /* istanbul ignore next */ []));
3974
+ gabarits = contentChildren(StDescription, /* @ts-ignore */
3975
+ ...(ngDevMode ? [{ debugName: "gabarits" }] : /* istanbul ignore next */ []));
3976
+ lignes = computed(() => {
3977
+ const gabarits = new Map(this.gabarits().map((gabarit) => [gabarit.cle(), gabarit.gabarit]));
3978
+ return this.elements().map((element) => ({
3979
+ element,
3980
+ gabarit: gabarits.get(element.cle ?? element.terme) ?? null,
3981
+ }));
3982
+ }, /* @ts-ignore */
3983
+ ...(ngDevMode ? [{ debugName: "lignes" }] : /* istanbul ignore next */ []));
3984
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: StDescriptionList, deps: [], target: i0.ɵɵFactoryTarget.Component });
3985
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.6", type: StDescriptionList, isStandalone: true, selector: "st-description-list", inputs: { elements: { classPropertyName: "elements", publicName: "elements", isSignal: true, isRequired: true, transformFunction: null } }, host: { classAttribute: "st-description-list" }, queries: [{ propertyName: "gabarits", predicate: StDescription, isSignal: true }], ngImport: i0, template: "<dl class=\"st-description-list__liste\">\n @for (ligne of lignes(); track ligne.element.cle ?? ligne.element.terme) {\n <div class=\"st-description-list__groupe\">\n <dt class=\"st-description-list__terme\">{{ ligne.element.terme }}</dt>\n <dd class=\"st-description-list__valeur\">\n @if (ligne.gabarit; as gabarit) {\n <ng-container *ngTemplateOutlet=\"gabarit; context: { $implicit: ligne.element }\" />\n } @else if (ligne.element.description === null) {\n <span aria-hidden=\"true\">&#8212;</span>\n <span class=\"st-vh\">{{ libelles().nonRenseigne }}</span>\n } @else {\n {{ ligne.element.description }}\n }\n </dd>\n </div>\n }\n</dl>\n", styles: [".st-vh{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}:host([hidden]){display:none!important}:host{display:block;container-type:inline-size}.st-description-list__liste{margin:0}.st-description-list__groupe{display:grid;gap:var(--st-espacement-1);padding-block:var(--st-espacement-2);border-block-end:1px solid var(--st-couleur-bordure)}.st-description-list__terme{font-weight:var(--st-graisse-semi);color:var(--st-couleur-texte-discret)}.st-description-list__valeur{margin:0;overflow-wrap:anywhere}@container (min-width: 32rem){.st-description-list__groupe{grid-template-columns:minmax(10rem,1fr) 2fr;gap:var(--st-espacement-4)}}\n"], dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
3986
+ }
3987
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: StDescriptionList, decorators: [{
3988
+ type: Component,
3989
+ args: [{ selector: 'st-description-list', changeDetection: ChangeDetectionStrategy.OnPush, imports: [NgTemplateOutlet], host: { class: 'st-description-list' }, template: "<dl class=\"st-description-list__liste\">\n @for (ligne of lignes(); track ligne.element.cle ?? ligne.element.terme) {\n <div class=\"st-description-list__groupe\">\n <dt class=\"st-description-list__terme\">{{ ligne.element.terme }}</dt>\n <dd class=\"st-description-list__valeur\">\n @if (ligne.gabarit; as gabarit) {\n <ng-container *ngTemplateOutlet=\"gabarit; context: { $implicit: ligne.element }\" />\n } @else if (ligne.element.description === null) {\n <span aria-hidden=\"true\">&#8212;</span>\n <span class=\"st-vh\">{{ libelles().nonRenseigne }}</span>\n } @else {\n {{ ligne.element.description }}\n }\n </dd>\n </div>\n }\n</dl>\n", styles: [".st-vh{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}:host([hidden]){display:none!important}:host{display:block;container-type:inline-size}.st-description-list__liste{margin:0}.st-description-list__groupe{display:grid;gap:var(--st-espacement-1);padding-block:var(--st-espacement-2);border-block-end:1px solid var(--st-couleur-bordure)}.st-description-list__terme{font-weight:var(--st-graisse-semi);color:var(--st-couleur-texte-discret)}.st-description-list__valeur{margin:0;overflow-wrap:anywhere}@container (min-width: 32rem){.st-description-list__groupe{grid-template-columns:minmax(10rem,1fr) 2fr;gap:var(--st-espacement-4)}}\n"] }]
3990
+ }], propDecorators: { elements: [{ type: i0.Input, args: [{ isSignal: true, alias: "elements", required: true }] }], gabarits: [{ type: i0.ContentChildren, args: [i0.forwardRef(() => StDescription), { isSignal: true }] }] } });
3991
+
3992
+ /**
3993
+ * Rendu d'un element, type par `[stElementDeListeDe]` :
3994
+ *
3995
+ * ```html
3996
+ * <ng-template stElementDeListe [stElementDeListeDe]="expeditions()" let-expedition>
3997
+ * <a [routerLink]="['/expeditions', expedition.id]">{{ expedition.reference }}</a>
3998
+ * </ng-template>
3999
+ * ```
4000
+ */
4001
+ class StElementDeListe {
4002
+ /** Sert seulement au typage du contexte ; nom de l'attribut, d'ou l'absence d'alias. */
4003
+ stElementDeListeDe = input(undefined, /* @ts-ignore */
4004
+ ...(ngDevMode ? [{ debugName: "stElementDeListeDe" }] : /* istanbul ignore next */ []));
4005
+ gabarit = inject(TemplateRef);
4006
+ static ngTemplateContextGuard(_directive, _contexte) {
4007
+ return true;
4008
+ }
4009
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: StElementDeListe, deps: [], target: i0.ɵɵFactoryTarget.Directive });
4010
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.1.6", type: StElementDeListe, isStandalone: true, selector: "ng-template[stElementDeListe]", inputs: { stElementDeListeDe: { classPropertyName: "stElementDeListeDe", publicName: "stElementDeListeDe", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0 });
4011
+ }
4012
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: StElementDeListe, decorators: [{
4013
+ type: Directive,
4014
+ args: [{ selector: 'ng-template[stElementDeListe]' }]
4015
+ }], propDecorators: { stElementDeListeDe: [{ type: i0.Input, args: [{ isSignal: true, alias: "stElementDeListeDe", required: false }] }] } });
4016
+ /**
4017
+ * Liste d'objets : expeditions, notifications, documents. La forme mobile d'un
4018
+ * tableau (UX-5).
4019
+ *
4020
+ * ```html
4021
+ * <st-list #liste etiquette="Mes expeditions" [elements]="expeditions()" cle="id">
4022
+ * <ng-template stElementDeListe [stElementDeListeDe]="expeditions()" let-expedition>…</ng-template>
4023
+ * </st-list>
4024
+ * <st-pagination mode="suite" [cible]="liste" … />
4025
+ * ```
4026
+ *
4027
+ * ⚠️ **Un lien DANS l'element, jamais un element cliquable** (UX-3) : le lien a un
4028
+ * nom, s'ouvre dans un onglet, et laisse les autres boutons de l'element
4029
+ * atteignables.
4030
+ *
4031
+ * ⚠️ **`focus()` va au premier element AJOUTE** depuis le dernier affichage : apres
4032
+ * « Afficher plus », la lecture reprend la ou la liste s'est allongee, et non en
4033
+ * tete. Apres un filtre, la liste raccourcit, et le focus va au premier element.
4034
+ *
4035
+ * `track` par la cle : un rafraichissement garde le focus sur le bon element.
4036
+ */
4037
+ class StList {
4038
+ element = inject(ElementRef);
4039
+ elements = input.required(/* @ts-ignore */
4040
+ ...(ngDevMode ? [{ debugName: "elements" }] : /* istanbul ignore next */ []));
4041
+ /** Propriete qui identifie un element. */
4042
+ cle = input.required(/* @ts-ignore */
4043
+ ...(ngDevMode ? [{ debugName: "cle" }] : /* istanbul ignore next */ []));
4044
+ /** Nom de la liste, lu a l'entree. */
4045
+ etiquette = input(null, /* @ts-ignore */
4046
+ ...(ngDevMode ? [{ debugName: "etiquette" }] : /* istanbul ignore next */ []));
4047
+ /** `ol` quand l'ordre a un sens : etapes, classement. */
4048
+ ordonnee = input(false, { ...(ngDevMode ? { debugName: "ordonnee" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
4049
+ /** Contenu en cours de remplacement : `aria-busy`. */
4050
+ chargement = input(false, { ...(ngDevMode ? { debugName: "chargement" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
4051
+ gabarit = contentChild(StElementDeListe, /* @ts-ignore */
4052
+ ...(ngDevMode ? [{ debugName: "gabarit" }] : /* istanbul ignore next */ []));
4053
+ indiceDuPremierAjout = 0;
4054
+ lignes = computed(() => {
4055
+ const cle = this.cle();
4056
+ return this.elements().map((valeur, indice) => ({
4057
+ valeur,
4058
+ indice,
4059
+ identifiant: String(valeur[cle]),
4060
+ }));
4061
+ }, /* @ts-ignore */
4062
+ ...(ngDevMode ? [{ debugName: "lignes" }] : /* istanbul ignore next */ []));
4063
+ constructor() {
4064
+ let longueur = 0;
4065
+ effect(() => {
4066
+ const nouvelle = this.elements().length;
4067
+ this.indiceDuPremierAjout = nouvelle > longueur && longueur > 0 ? longueur : 0;
4068
+ longueur = nouvelle;
4069
+ });
4070
+ }
4071
+ /** Focus sur le premier element ajoute, ou sur le premier. */
4072
+ focus(options) {
4073
+ const elements = this.element.nativeElement.querySelectorAll('.st-list__element');
4074
+ (elements[this.indiceDuPremierAjout] ?? elements[0])?.focus(options);
4075
+ }
4076
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: StList, deps: [], target: i0.ɵɵFactoryTarget.Component });
4077
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.6", type: StList, isStandalone: true, selector: "st-list", inputs: { elements: { classPropertyName: "elements", publicName: "elements", isSignal: true, isRequired: true, transformFunction: null }, cle: { classPropertyName: "cle", publicName: "cle", isSignal: true, isRequired: true, transformFunction: null }, etiquette: { classPropertyName: "etiquette", publicName: "etiquette", isSignal: true, isRequired: false, transformFunction: null }, ordonnee: { classPropertyName: "ordonnee", publicName: "ordonnee", isSignal: true, isRequired: false, transformFunction: null }, chargement: { classPropertyName: "chargement", publicName: "chargement", isSignal: true, isRequired: false, transformFunction: null } }, host: { classAttribute: "st-list" }, queries: [{ propertyName: "gabarit", first: true, predicate: StElementDeListe, descendants: true, isSignal: true }], ngImport: i0, template: "@if (ordonnee()) {\n <ol\n class=\"st-list__liste\"\n [attr.aria-label]=\"etiquette()\"\n [attr.aria-busy]=\"chargement() ? 'true' : null\"\n >\n <ng-container *ngTemplateOutlet=\"contenu\" />\n </ol>\n} @else {\n <ul\n class=\"st-list__liste\"\n [attr.aria-label]=\"etiquette()\"\n [attr.aria-busy]=\"chargement() ? 'true' : null\"\n >\n <ng-container *ngTemplateOutlet=\"contenu\" />\n </ul>\n}\n\n<ng-template #contenu>\n @for (ligne of lignes(); track ligne.identifiant) {\n <!-- tabindex -1 : cible du focus apres \u00AB Afficher plus \u00BB, hors tabulation. -->\n <li class=\"st-list__element\" tabindex=\"-1\">\n @if (gabarit(); as gabarit) {\n <ng-container\n *ngTemplateOutlet=\"\n gabarit.gabarit;\n context: { $implicit: ligne.valeur, indice: ligne.indice }\n \"\n />\n } @else {\n {{ ligne.valeur }}\n }\n </li>\n }\n</ng-template>\n", styles: [".st-vh{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}:host([hidden]){display:none!important}:host{display:block}.st-list__liste{padding:0;margin:0;list-style:none}.st-list__liste[aria-busy=true]{cursor:progress}.st-list__element{padding-block:var(--st-espacement-3);border-block-end:1px solid var(--st-couleur-bordure)}.st-list__element:focus{outline:2px solid var(--st-couleur-anneau-focus);outline-offset:2px}\n"], dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
4078
+ }
4079
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: StList, decorators: [{
4080
+ type: Component,
4081
+ args: [{ selector: 'st-list', changeDetection: ChangeDetectionStrategy.OnPush, imports: [NgTemplateOutlet], host: { class: 'st-list' }, template: "@if (ordonnee()) {\n <ol\n class=\"st-list__liste\"\n [attr.aria-label]=\"etiquette()\"\n [attr.aria-busy]=\"chargement() ? 'true' : null\"\n >\n <ng-container *ngTemplateOutlet=\"contenu\" />\n </ol>\n} @else {\n <ul\n class=\"st-list__liste\"\n [attr.aria-label]=\"etiquette()\"\n [attr.aria-busy]=\"chargement() ? 'true' : null\"\n >\n <ng-container *ngTemplateOutlet=\"contenu\" />\n </ul>\n}\n\n<ng-template #contenu>\n @for (ligne of lignes(); track ligne.identifiant) {\n <!-- tabindex -1 : cible du focus apres \u00AB Afficher plus \u00BB, hors tabulation. -->\n <li class=\"st-list__element\" tabindex=\"-1\">\n @if (gabarit(); as gabarit) {\n <ng-container\n *ngTemplateOutlet=\"\n gabarit.gabarit;\n context: { $implicit: ligne.valeur, indice: ligne.indice }\n \"\n />\n } @else {\n {{ ligne.valeur }}\n }\n </li>\n }\n</ng-template>\n", styles: [".st-vh{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}:host([hidden]){display:none!important}:host{display:block}.st-list__liste{padding:0;margin:0;list-style:none}.st-list__liste[aria-busy=true]{cursor:progress}.st-list__element{padding-block:var(--st-espacement-3);border-block-end:1px solid var(--st-couleur-bordure)}.st-list__element:focus{outline:2px solid var(--st-couleur-anneau-focus);outline-offset:2px}\n"] }]
4082
+ }], ctorParameters: () => [], propDecorators: { elements: [{ type: i0.Input, args: [{ isSignal: true, alias: "elements", required: true }] }], cle: [{ type: i0.Input, args: [{ isSignal: true, alias: "cle", required: true }] }], etiquette: [{ type: i0.Input, args: [{ isSignal: true, alias: "etiquette", required: false }] }], ordonnee: [{ type: i0.Input, args: [{ isSignal: true, alias: "ordonnee", required: false }] }], chargement: [{ type: i0.Input, args: [{ isSignal: true, alias: "chargement", required: false }] }], gabarit: [{ type: i0.ContentChild, args: [i0.forwardRef(() => StElementDeListe), { isSignal: true }] }] } });
4083
+
4084
+ /**
4085
+ * Bouton de tri d'une colonne, pose DANS l'en-tete : `<th><button stSortHeader>`.
4086
+ *
4087
+ * ⚠️ **Le bouton, pas l'en-tete cliquable** : un `th` n'est ni focalisable ni
4088
+ * annonce comme actionnable. Et l'etat se porte par `aria-sort` sur le `th`, que
4089
+ * `st-data-table` pose sur la SEULE colonne triee (FE-3).
4090
+ *
4091
+ * ⚠️ **Ne trie rien.** Il dit l'intention ; c'est le serveur qui trie, et le
4092
+ * contrat actuel ne le fait pas (audit de la vague 4, V4-3). Trier la page
4093
+ * affichee ferait croire a un tri de toute la liste.
4094
+ *
4095
+ * Une colonne non triee montre deux chevrons, pour se signaler triable sans
4096
+ * attendre le survol ; l'icone est decorative, l'etat est lu par `aria-sort`.
4097
+ */
4098
+ class StSortHeader {
4099
+ sens = input(null, /* @ts-ignore */
4100
+ ...(ngDevMode ? [{ debugName: "sens" }] : /* istanbul ignore next */ []));
4101
+ icone = computed(() => {
4102
+ const sens = this.sens();
4103
+ if (sens === 'croissant')
4104
+ return 'chevron-haut';
4105
+ if (sens === 'decroissant')
4106
+ return 'chevron-bas';
4107
+ return 'tri';
4108
+ }, /* @ts-ignore */
4109
+ ...(ngDevMode ? [{ debugName: "icone" }] : /* istanbul ignore next */ []));
4110
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: StSortHeader, deps: [], target: i0.ɵɵFactoryTarget.Component });
4111
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.1.6", type: StSortHeader, isStandalone: true, selector: "button[stSortHeader]", inputs: { sens: { classPropertyName: "sens", publicName: "sens", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "type": "button" }, properties: { "attr.data-sens": "sens()" }, classAttribute: "st-sort-header" }, ngImport: i0, template: "<span class=\"st-sort-header__libelle\"><ng-content /></span>\n<st-icon class=\"st-sort-header__icone\" taille=\"sm\" [nom]=\"icone()\" />\n", styles: [".st-vh{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}:host([hidden]){display:none!important}:host:focus-visible{outline:2px solid var(--st-couleur-anneau-focus);outline-offset:2px}:host{display:inline-flex;gap:var(--st-espacement-1);align-items:center;min-block-size:24px;padding:0;font:inherit;font-weight:inherit;color:inherit;text-align:inherit;cursor:pointer;background:none;border:0}.st-sort-header__icone{flex:none;color:var(--st-couleur-texte-discret)}:host([data-sens]) .st-sort-header__icone{color:inherit}\n"], dependencies: [{ kind: "component", type: StIcon, selector: "st-icon", inputs: ["nom", "taille", "ton", "etiquette"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
4112
+ }
4113
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: StSortHeader, decorators: [{
4114
+ type: Component,
4115
+ args: [{ selector: 'button[stSortHeader]', changeDetection: ChangeDetectionStrategy.OnPush, imports: [StIcon], host: {
4116
+ class: 'st-sort-header',
4117
+ type: 'button',
4118
+ '[attr.data-sens]': 'sens()',
4119
+ }, template: "<span class=\"st-sort-header__libelle\"><ng-content /></span>\n<st-icon class=\"st-sort-header__icone\" taille=\"sm\" [nom]=\"icone()\" />\n", styles: [".st-vh{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}:host([hidden]){display:none!important}:host:focus-visible{outline:2px solid var(--st-couleur-anneau-focus);outline-offset:2px}:host{display:inline-flex;gap:var(--st-espacement-1);align-items:center;min-block-size:24px;padding:0;font:inherit;font-weight:inherit;color:inherit;text-align:inherit;cursor:pointer;background:none;border:0}.st-sort-header__icone{flex:none;color:var(--st-couleur-texte-discret)}:host([data-sens]) .st-sort-header__icone{color:inherit}\n"] }]
4120
+ }], propDecorators: { sens: [{ type: i0.Input, args: [{ isSignal: true, alias: "sens", required: false }] }] } });
4121
+
4122
+ let compteur$3 = 0;
4123
+ /**
4124
+ * Rendu d'une cellule, type par `[stCelluleDe]` :
4125
+ *
4126
+ * ```html
4127
+ * <ng-template stCellule="montant" [stCelluleDe]="lignes()" let-ligne>
4128
+ * <st-money [valeur]="ligne.montant" />
4129
+ * </ng-template>
4130
+ * ```
4131
+ */
4132
+ class StCellule {
4133
+ cle = input.required({ ...(ngDevMode ? { debugName: "cle" } : /* istanbul ignore next */ {}), alias: 'stCellule' });
4134
+ /** Sert seulement au typage du contexte ; nom de l'attribut, d'ou l'absence d'alias. */
4135
+ stCelluleDe = input(undefined, /* @ts-ignore */
4136
+ ...(ngDevMode ? [{ debugName: "stCelluleDe" }] : /* istanbul ignore next */ []));
4137
+ gabarit = inject(TemplateRef);
4138
+ static ngTemplateContextGuard(_directive, _contexte) {
4139
+ return true;
4140
+ }
4141
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: StCellule, deps: [], target: i0.ɵɵFactoryTarget.Directive });
4142
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.1.6", type: StCellule, isStandalone: true, selector: "ng-template[stCellule]", inputs: { cle: { classPropertyName: "cle", publicName: "stCellule", isSignal: true, isRequired: true, transformFunction: null }, stCelluleDe: { classPropertyName: "stCelluleDe", publicName: "stCelluleDe", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0 });
4143
+ }
4144
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: StCellule, decorators: [{
4145
+ type: Directive,
4146
+ args: [{ selector: 'ng-template[stCellule]' }]
4147
+ }], propDecorators: { cle: [{ type: i0.Input, args: [{ isSignal: true, alias: "stCellule", required: true }] }], stCelluleDe: [{ type: i0.Input, args: [{ isSignal: true, alias: "stCelluleDe", required: false }] }] } });
4148
+ /** Contenu du tableau vide : un `st-empty`, avec son action. */
4149
+ class StTableauVide {
4150
+ gabarit = inject(TemplateRef);
4151
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: StTableauVide, deps: [], target: i0.ɵɵFactoryTarget.Directive });
4152
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.1.6", type: StTableauVide, isStandalone: true, selector: "ng-template[stTableauVide]", ngImport: i0 });
4153
+ }
4154
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: StTableauVide, decorators: [{
4155
+ type: Directive,
4156
+ args: [{ selector: 'ng-template[stTableauVide]' }]
4157
+ }] });
4158
+ /** Lignes de squelette au premier chargement. */
4159
+ const LIGNES_DE_SQUELETTE = 5;
4160
+ /**
4161
+ * Tableau de donnees, sur un `<table>` NATIF.
4162
+ *
4163
+ * ```html
4164
+ * <st-data-table #tableau legende="Expeditions" [colonnes]="colonnes" [lignes]="lignes()"
4165
+ * cle="id" selectionnable [(selection)]="choisies" [chargement]="page.isLoading()">
4166
+ * <ng-template stCellule="reference" [stCelluleDe]="lignes()" let-ligne>
4167
+ * <a [routerLink]="['/expeditions', ligne.id]">{{ ligne.reference }}</a>
4168
+ * </ng-template>
4169
+ * <button stButton stActionsDeTableau (click)="exporter()">Exporter</button>
4170
+ * </st-data-table>
4171
+ * ```
4172
+ *
4173
+ * ⚠️ **Un tableau, pas une grille** (audit de la vague 4, V4-1). Le lecteur d'ecran
4174
+ * sait parcourir un `<table>` de cellule en cellule ; une grille ARIA remplacerait
4175
+ * ce parcours par les fleches, et rendrait les liens des cellules plus durs a
4176
+ * atteindre. Ni Material, ni `CdkTable` : pas de pair dans le tronc.
4177
+ *
4178
+ * - **Legende obligatoire** (UX-1), et une colonne d'en-tete de ligne — la premiere
4179
+ * par defaut — pour que chaque cellule se lise avec sa ligne (UX-2).
4180
+ * - **Zone de defilement nommee** : focalisable quand le tableau deborde (UX-6),
4181
+ * colonne figee sans masquer le focus (UX-7), en-tete fige seulement avec
4182
+ * `hauteurMax` (UX-8).
4183
+ * - **Selection de la PAGE, par cle** (V4-4) : elle ne garde que les lignes encore
4184
+ * affichees, et se vide donc au changement de page.
4185
+ * - **Tri PILOTE** : le tableau dit la demande et l'annonce, il ne reordonne
4186
+ * jamais les lignes (V4-3).
4187
+ * - **Chargement** : squelette au premier, lignes gardees et `aria-busy` ensuite
4188
+ * (UX-11).
4189
+ * - Export, actions de masse : zone `stActionsDeTableau`, et le SERVEUR fait le
4190
+ * travail (V4-5, SEC-4, SEC-5).
4191
+ */
4192
+ class StDataTable {
4193
+ libelles = inject(ST_LIBELLES);
4194
+ legende = input.required(/* @ts-ignore */
4195
+ ...(ngDevMode ? [{ debugName: "legende" }] : /* istanbul ignore next */ []));
4196
+ /** Lue mais non affichee, quand un titre visible nomme deja le tableau. */
4197
+ legendeMasquee = input(false, { ...(ngDevMode ? { debugName: "legendeMasquee" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
4198
+ colonnes = input.required(/* @ts-ignore */
4199
+ ...(ngDevMode ? [{ debugName: "colonnes" }] : /* istanbul ignore next */ []));
4200
+ lignes = input.required(/* @ts-ignore */
4201
+ ...(ngDevMode ? [{ debugName: "lignes" }] : /* istanbul ignore next */ []));
4202
+ /** Propriete qui identifie une ligne. Jamais l'indice (FE-1). */
4203
+ cle = input.required(/* @ts-ignore */
4204
+ ...(ngDevMode ? [{ debugName: "cle" }] : /* istanbul ignore next */ []));
4205
+ /** Colonne lue comme en-tete de chaque ligne. Par defaut : la premiere. */
4206
+ enTeteDeLigne = input(null, /* @ts-ignore */
4207
+ ...(ngDevMode ? [{ debugName: "enTeteDeLigne" }] : /* istanbul ignore next */ []));
4208
+ premiereColonneFigee = input(false, { ...(ngDevMode ? { debugName: "premiereColonneFigee" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
4209
+ /** Hauteur maximale, `32rem` : l'en-tete se fige, le corps defile. */
4210
+ hauteurMax = input(null, /* @ts-ignore */
4211
+ ...(ngDevMode ? [{ debugName: "hauteurMax" }] : /* istanbul ignore next */ []));
4212
+ densite = input('confortable', /* @ts-ignore */
4213
+ ...(ngDevMode ? [{ debugName: "densite" }] : /* istanbul ignore next */ []));
4214
+ chargement = input(false, { ...(ngDevMode ? { debugName: "chargement" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
4215
+ selectionnable = input(false, { ...(ngDevMode ? { debugName: "selectionnable" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
4216
+ selection = model([], /* @ts-ignore */
4217
+ ...(ngDevMode ? [{ debugName: "selection" }] : /* istanbul ignore next */ []));
4218
+ tri = model(null, /* @ts-ignore */
4219
+ ...(ngDevMode ? [{ debugName: "tri" }] : /* istanbul ignore next */ []));
4220
+ /** Texte du tableau vide, sans gabarit `stTableauVide`. */
4221
+ texteVide = input(null, /* @ts-ignore */
4222
+ ...(ngDevMode ? [{ debugName: "texteVide" }] : /* istanbul ignore next */ []));
4223
+ gabarits = contentChildren(StCellule, /* @ts-ignore */
4224
+ ...(ngDevMode ? [{ debugName: "gabarits" }] : /* istanbul ignore next */ []));
4225
+ gabaritVide = contentChild(StTableauVide, /* @ts-ignore */
4226
+ ...(ngDevMode ? [{ debugName: "gabaritVide" }] : /* istanbul ignore next */ []));
4227
+ zone = viewChild.required('zone', /* @ts-ignore */
4228
+ ...(ngDevMode ? [{ debugName: "zone" }] : /* istanbul ignore next */ []));
4229
+ annonce = new AnnonceLocale(inject(DestroyRef));
4230
+ deborde = signal(false, /* @ts-ignore */
4231
+ ...(ngDevMode ? [{ debugName: "deborde" }] : /* istanbul ignore next */ []));
4232
+ largeurFigee = signal(0, /* @ts-ignore */
4233
+ ...(ngDevMode ? [{ debugName: "largeurFigee" }] : /* istanbul ignore next */ []));
4234
+ identifiants = (() => {
4235
+ const base = `st-tableau-${(compteur$3 += 1).toString()}`;
4236
+ return { legende: `${base}-legende`, selection: `${base}-selection` };
4237
+ })();
4238
+ cleDEnTete = computed(() => this.enTeteDeLigne() ?? this.colonnes()[0]?.cle ?? '', /* @ts-ignore */
4239
+ ...(ngDevMode ? [{ debugName: "cleDEnTete" }] : /* istanbul ignore next */ []));
4240
+ cellules = computed(() => {
4241
+ const gabarits = new Map(this.gabarits().map((gabarit) => [gabarit.cle(), gabarit.gabarit]));
4242
+ return this.colonnes().map((colonne) => ({
4243
+ colonne,
4244
+ gabarit: gabarits.get(colonne.cle) ?? null,
4245
+ enTete: colonne.cle === this.cleDEnTete(),
4246
+ }));
4247
+ }, /* @ts-ignore */
4248
+ ...(ngDevMode ? [{ debugName: "cellules" }] : /* istanbul ignore next */ []));
4249
+ rangees = computed(() => {
4250
+ const cle = this.cle();
4251
+ const entete = this.cleDEnTete();
4252
+ const choisies = new Set(this.selection());
4253
+ return this.lignes().map((valeur) => {
4254
+ const identifiant = String(valeur[cle]);
4255
+ return {
4256
+ valeur,
4257
+ identifiant,
4258
+ nom: texteDe(valeur[entete]),
4259
+ choisie: choisies.has(identifiant),
4260
+ };
4261
+ });
4262
+ }, /* @ts-ignore */
4263
+ ...(ngDevMode ? [{ debugName: "rangees" }] : /* istanbul ignore next */ []));
4264
+ squelette = computed(() => this.chargement() && this.lignes().length === 0
4265
+ ? Array.from({ length: LIGNES_DE_SQUELETTE }, (_, indice) => indice)
4266
+ : [], /* @ts-ignore */
4267
+ ...(ngDevMode ? [{ debugName: "squelette" }] : /* istanbul ignore next */ []));
4268
+ nombreDeColonnes = computed(() => this.colonnes().length + (this.selectionnable() ? 1 : 0), /* @ts-ignore */
4269
+ ...(ngDevMode ? [{ debugName: "nombreDeColonnes" }] : /* istanbul ignore next */ []));
4270
+ colonnesDeSquelette = computed(() => Array.from({ length: this.nombreDeColonnes() }, (_, indice) => indice), /* @ts-ignore */
4271
+ ...(ngDevMode ? [{ debugName: "colonnesDeSquelette" }] : /* istanbul ignore next */ []));
4272
+ toutesChoisies = computed(() => {
4273
+ const rangees = this.rangees();
4274
+ return rangees.length > 0 && rangees.every((rangee) => rangee.choisie);
4275
+ }, /* @ts-ignore */
4276
+ ...(ngDevMode ? [{ debugName: "toutesChoisies" }] : /* istanbul ignore next */ []));
4277
+ quelquesChoisies = computed(() => !this.toutesChoisies() && this.rangees().some((rangee) => rangee.choisie), /* @ts-ignore */
4278
+ ...(ngDevMode ? [{ debugName: "quelquesChoisies" }] : /* istanbul ignore next */ []));
4279
+ constructor() {
4280
+ // V4-4 : une selection ne vise que ce qui est affiche. Nouvelle page, nouvelles
4281
+ // cles : les anciennes tombent.
4282
+ effect(() => {
4283
+ const presentes = new Set(this.rangees().map((rangee) => rangee.identifiant));
4284
+ const selection = this.selection();
4285
+ const gardees = selection.filter((identifiant) => presentes.has(identifiant));
4286
+ if (gardees.length !== selection.length)
4287
+ this.selection.set(gardees);
4288
+ });
4289
+ // Mesures du rendu, jamais sur le serveur (FE-5).
4290
+ const destruction = inject(DestroyRef);
4291
+ afterNextRender(() => {
4292
+ const zone = this.zone().nativeElement;
4293
+ if (typeof ResizeObserver === 'undefined')
4294
+ return;
4295
+ const observateur = new ResizeObserver(() => {
4296
+ this.deborde.set(zone.scrollWidth > zone.clientWidth + 1 || zone.scrollHeight > zone.clientHeight + 1);
4297
+ // UX-7 : la largeur des colonnes figees devient la marge de defilement,
4298
+ // pour que la cellule focalisee s'arrete A COTE d'elles et non dessous.
4299
+ const figees = zone.querySelectorAll('tr:first-child > [data-figee]');
4300
+ let largeur = 0;
4301
+ figees.forEach((cellule) => (largeur += cellule.getBoundingClientRect().width));
4302
+ this.largeurFigee.set(Math.ceil(largeur));
4303
+ });
4304
+ observateur.observe(zone);
4305
+ const tableau = zone.querySelector('table');
4306
+ if (tableau !== null)
4307
+ observateur.observe(tableau);
4308
+ destruction.onDestroy(() => {
4309
+ observateur.disconnect();
4310
+ });
4311
+ });
4312
+ }
4313
+ /** Amene le focus sur le tableau : sa legende est lue (UX-13). */
4314
+ focus(options) {
4315
+ this.zone().nativeElement.focus(options);
4316
+ }
4317
+ sensDe(colonne) {
4318
+ const tri = this.tri();
4319
+ return tri?.cle === colonne.cle ? tri.sens : null;
4320
+ }
4321
+ ariaSort(colonne) {
4322
+ const sens = this.sensDe(colonne);
4323
+ if (sens === null)
4324
+ return null;
4325
+ return sens === 'croissant' ? 'ascending' : 'descending';
4326
+ }
4327
+ trier(colonne) {
4328
+ const sens = this.sensDe(colonne) === 'croissant' ? 'decroissant' : 'croissant';
4329
+ this.tri.set({ cle: colonne.cle, sens });
4330
+ const libelles = this.libelles();
4331
+ this.annonce.annoncer(sens === 'croissant'
4332
+ ? libelles.trieCroissant(colonne.libelle)
4333
+ : libelles.trieDecroissant(colonne.libelle));
4334
+ }
4335
+ basculerTout() {
4336
+ this.selection.set(this.toutesChoisies() ? [] : this.rangees().map((rangee) => rangee.identifiant));
4337
+ }
4338
+ basculer(identifiant) {
4339
+ const selection = this.selection();
4340
+ this.selection.set(selection.includes(identifiant)
4341
+ ? selection.filter((choisie) => choisie !== identifiant)
4342
+ : [...selection, identifiant]);
4343
+ }
4344
+ texteDe(ligne, colonne) {
4345
+ return texteDe(ligne[colonne.cle]);
4346
+ }
4347
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: StDataTable, deps: [], target: i0.ɵɵFactoryTarget.Component });
4348
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.6", type: StDataTable, isStandalone: true, selector: "st-data-table", inputs: { legende: { classPropertyName: "legende", publicName: "legende", isSignal: true, isRequired: true, transformFunction: null }, legendeMasquee: { classPropertyName: "legendeMasquee", publicName: "legendeMasquee", isSignal: true, isRequired: false, transformFunction: null }, colonnes: { classPropertyName: "colonnes", publicName: "colonnes", isSignal: true, isRequired: true, transformFunction: null }, lignes: { classPropertyName: "lignes", publicName: "lignes", isSignal: true, isRequired: true, transformFunction: null }, cle: { classPropertyName: "cle", publicName: "cle", isSignal: true, isRequired: true, transformFunction: null }, enTeteDeLigne: { classPropertyName: "enTeteDeLigne", publicName: "enTeteDeLigne", isSignal: true, isRequired: false, transformFunction: null }, premiereColonneFigee: { classPropertyName: "premiereColonneFigee", publicName: "premiereColonneFigee", isSignal: true, isRequired: false, transformFunction: null }, hauteurMax: { classPropertyName: "hauteurMax", publicName: "hauteurMax", isSignal: true, isRequired: false, transformFunction: null }, densite: { classPropertyName: "densite", publicName: "densite", isSignal: true, isRequired: false, transformFunction: null }, chargement: { classPropertyName: "chargement", publicName: "chargement", isSignal: true, isRequired: false, transformFunction: null }, selectionnable: { classPropertyName: "selectionnable", publicName: "selectionnable", isSignal: true, isRequired: false, transformFunction: null }, selection: { classPropertyName: "selection", publicName: "selection", isSignal: true, isRequired: false, transformFunction: null }, tri: { classPropertyName: "tri", publicName: "tri", isSignal: true, isRequired: false, transformFunction: null }, texteVide: { classPropertyName: "texteVide", publicName: "texteVide", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { selection: "selectionChange", tri: "triChange" }, host: { properties: { "attr.data-densite": "densite()", "attr.data-figee": "premiereColonneFigee() ? \"\" : null" }, classAttribute: "st-data-table" }, queries: [{ propertyName: "gabarits", predicate: StCellule, isSignal: true }, { propertyName: "gabaritVide", first: true, predicate: StTableauVide, descendants: true, isSignal: true }], viewQueries: [{ propertyName: "zone", first: true, predicate: ["zone"], descendants: true, isSignal: true }], ngImport: i0, template: "<!-- UN seul ng-content : la projection se decide a la compilation, et un second\n emplacement de meme selecteur, dans une autre branche, ne recevrait jamais\n rien. -->\n<div class=\"st-data-table__barre\">\n @if (selectionnable()) {\n <p class=\"st-data-table__selection\" role=\"status\" [id]=\"identifiants.selection\">\n {{ selection().length > 0 ? libelles().lignesSelectionnees(selection().length) : '' }}\n </p>\n }\n <div class=\"st-data-table__actions\">\n <ng-content select=\"[stActionsDeTableau]\" />\n </div>\n</div>\n\n<!-- UX-6 : zone nommee par la legende ; focalisable quand elle deborde, et par\n programme toujours, pour recevoir le focus apres un changement de page. -->\n<div\n #zone\n class=\"st-data-table__zone\"\n role=\"region\"\n [attr.aria-labelledby]=\"identifiants.legende\"\n [attr.tabindex]=\"deborde() ? 0 : -1\"\n [attr.data-deborde]=\"deborde() ? '' : null\"\n [style.max-block-size]=\"hauteurMax()\"\n [style.scroll-padding-inline-start.px]=\"largeurFigee()\"\n>\n <table class=\"st-data-table__tableau\" [attr.aria-busy]=\"chargement() ? 'true' : null\">\n <caption\n class=\"st-data-table__legende\"\n [id]=\"identifiants.legende\"\n [class.st-vh]=\"legendeMasquee()\"\n >\n {{\n legende()\n }}\n </caption>\n <thead>\n <tr>\n @if (selectionnable()) {\n <th class=\"st-data-table__case\" scope=\"col\" data-figee>\n <input\n class=\"st-data-table__cocher\"\n type=\"checkbox\"\n [checked]=\"toutesChoisies()\"\n [indeterminate]=\"quelquesChoisies()\"\n [disabled]=\"rangees().length === 0\"\n [attr.aria-label]=\"libelles().selectionnerLaPage(rangees().length)\"\n (change)=\"basculerTout()\"\n />\n </th>\n }\n @for (cellule of cellules(); track cellule.colonne.cle; let premiere = $first) {\n <th\n scope=\"col\"\n [attr.data-alignement]=\"cellule.colonne.alignement ?? 'debut'\"\n [attr.data-figee]=\"premiere && premiereColonneFigee() ? '' : null\"\n [attr.aria-sort]=\"ariaSort(cellule.colonne)\"\n >\n @if (cellule.colonne.triable) {\n <button\n stSortHeader\n type=\"button\"\n [sens]=\"sensDe(cellule.colonne)\"\n (click)=\"trier(cellule.colonne)\"\n >\n {{ cellule.colonne.libelle }}\n </button>\n } @else if (cellule.colonne.libelleMasque) {\n <span class=\"st-vh\">{{ cellule.colonne.libelle }}</span>\n } @else {\n {{ cellule.colonne.libelle }}\n }\n </th>\n }\n </tr>\n </thead>\n <tbody>\n @for (rang of squelette(); track rang) {\n <tr class=\"st-data-table__squelette\" aria-hidden=\"true\">\n @for (colonne of colonnesDeSquelette(); track colonne) {\n <td><span class=\"st-data-table__barre-de-squelette\"></span></td>\n }\n </tr>\n }\n @for (rangee of rangees(); track rangee.identifiant) {\n <tr [attr.data-choisie]=\"rangee.choisie ? '' : null\">\n @if (selectionnable()) {\n <td class=\"st-data-table__case\" data-figee>\n <input\n class=\"st-data-table__cocher\"\n type=\"checkbox\"\n [checked]=\"rangee.choisie\"\n [attr.aria-label]=\"libelles().selectionnerLaLigne(rangee.nom ?? rangee.identifiant)\"\n (change)=\"basculer(rangee.identifiant)\"\n />\n </td>\n }\n @for (cellule of cellules(); track cellule.colonne.cle; let premiere = $first) {\n @if (cellule.enTete) {\n <th\n scope=\"row\"\n [attr.data-alignement]=\"cellule.colonne.alignement ?? 'debut'\"\n [attr.data-figee]=\"premiere && premiereColonneFigee() ? '' : null\"\n >\n <ng-container\n *ngTemplateOutlet=\"\n valeur;\n context: { $implicit: rangee.valeur, cellule: cellule }\n \"\n />\n </th>\n } @else {\n <td\n [attr.data-alignement]=\"cellule.colonne.alignement ?? 'debut'\"\n [attr.data-figee]=\"premiere && premiereColonneFigee() ? '' : null\"\n >\n <ng-container\n *ngTemplateOutlet=\"\n valeur;\n context: { $implicit: rangee.valeur, cellule: cellule }\n \"\n />\n </td>\n }\n }\n </tr>\n } @empty {\n @if (!chargement()) {\n <tr>\n <td class=\"st-data-table__vide\" [attr.colspan]=\"nombreDeColonnes()\">\n @if (gabaritVide(); as vide) {\n <ng-container *ngTemplateOutlet=\"vide.gabarit\" />\n } @else {\n {{ texteVide() ?? libelles().tableauVide }}\n }\n </td>\n </tr>\n }\n }\n </tbody>\n </table>\n</div>\n<span class=\"st-vh\" aria-live=\"polite\">{{ annonce.texte() }}</span>\n\n<ng-template #valeur let-ligne let-cellule=\"cellule\">\n @if (cellule.gabarit; as gabarit) {\n <ng-container\n *ngTemplateOutlet=\"gabarit; context: { $implicit: ligne, colonne: cellule.colonne }\"\n />\n } @else if (texteDe(ligne, cellule.colonne); as texte) {\n {{ texte }}\n } @else {\n <span aria-hidden=\"true\">&#8212;</span><span class=\"st-vh\">{{ libelles().nonRenseigne }}</span>\n }\n</ng-template>\n", styles: [".st-vh{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}:host([hidden]){display:none!important}:host{--st-tableau-cellule-bloc: var(--st-espacement-3);--st-tableau-cellule-ligne: var(--st-espacement-3);--st-tableau-largeur-case: 3rem;display:block}:host([data-densite=compacte]){--st-tableau-cellule-bloc: var(--st-espacement-1);--st-tableau-cellule-ligne: var(--st-espacement-2)}.st-data-table__barre,.st-data-table__actions{display:flex;flex-wrap:wrap;gap:var(--st-espacement-2);align-items:center}.st-data-table__barre{justify-content:space-between}.st-data-table__barre:has(.st-data-table__selection,.st-data-table__actions:not(:empty)){min-block-size:var(--st-cible-tactile-min);margin-block-end:var(--st-espacement-2)}.st-data-table__actions{margin-inline-start:auto}.st-data-table__actions:empty{display:none}.st-data-table__selection{margin:0;font-weight:var(--st-graisse-semi)}.st-data-table__zone:focus{outline:2px solid var(--st-couleur-anneau-focus);outline-offset:2px}.st-data-table__zone{position:relative;overflow:auto;border:1px solid var(--st-couleur-bordure);border-radius:var(--st-rayon-md);background:linear-gradient(to right,var(--st-couleur-surface) 30%,transparent) left/2rem 100% no-repeat local,linear-gradient(to left,var(--st-couleur-surface) 30%,transparent) right/2rem 100% no-repeat local,radial-gradient(farthest-side at 0 50%,rgba(0,0,0,.2),transparent) left/.75rem 100% no-repeat scroll,radial-gradient(farthest-side at 100% 50%,rgba(0,0,0,.2),transparent) right/.75rem 100% no-repeat scroll,var(--st-couleur-surface)}.st-data-table__tableau{inline-size:100%;font-variant-numeric:tabular-nums;border-collapse:separate;border-spacing:0}.st-data-table__legende{padding:var(--st-espacement-3);font-weight:var(--st-graisse-semi);text-align:start}th,td{padding-block:var(--st-tableau-cellule-bloc);padding-inline:var(--st-tableau-cellule-ligne);text-align:start;vertical-align:top;overflow-wrap:anywhere;border-block-end:1px solid var(--st-couleur-bordure)}thead th{font-weight:var(--st-graisse-semi);color:var(--st-couleur-texte-discret);white-space:nowrap;background:var(--st-couleur-surface-enfoncee)}thead th{position:sticky;inset-block-start:0;z-index:2}tbody th{font-weight:var(--st-graisse-semi)}tbody tr:last-child>*{border-block-end:0}tbody tr:hover>*{background:var(--st-couleur-surface-survol)}tbody tr[data-choisie]>*{background:var(--st-couleur-primaire-discret)}tbody tr[data-choisie]>:first-child{box-shadow:inset 3px 0 0 var(--st-couleur-primaire)}:host-context([dir=rtl]) tbody tr[data-choisie]>:first-child{box-shadow:inset -3px 0 0 var(--st-couleur-primaire)}[data-alignement=fin]{text-align:end}.st-data-table__case{inline-size:var(--st-tableau-largeur-case);min-inline-size:var(--st-tableau-largeur-case);text-align:center;vertical-align:middle}.st-data-table__cocher:focus-visible{outline:2px solid var(--st-couleur-anneau-focus);outline-offset:2px}.st-data-table__cocher{inline-size:24px;block-size:24px;margin:0;accent-color:var(--st-couleur-primaire);cursor:pointer}:host([data-figee]) [data-figee]{position:sticky;inset-inline-start:0;z-index:1;background:var(--st-couleur-surface)}:host([data-figee]) .st-data-table__case+[data-figee]{inset-inline-start:var(--st-tableau-largeur-case)}:host([data-figee]) thead [data-figee]{z-index:3;background:var(--st-couleur-surface-enfoncee)}.st-data-table__vide{padding:var(--st-espacement-5);color:var(--st-couleur-texte-discret);text-align:center}.st-data-table__barre-de-squelette{display:block;block-size:1em;background:var(--st-couleur-surface-enfoncee);border-radius:var(--st-rayon-sm)}@media(prefers-reduced-motion:no-preference){.st-data-table__barre-de-squelette{animation:st-tableau-pulsation 1.5s ease-in-out infinite}}@keyframes st-tableau-pulsation{50%{opacity:.5}}.st-data-table__tableau[aria-busy=true]{cursor:progress}@media(forced-colors:active){tbody tr[data-choisie]>:first-child{box-shadow:none;border-inline-start:3px solid Highlight}}\n"], dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: StSortHeader, selector: "button[stSortHeader]", inputs: ["sens"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
4349
+ }
4350
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: StDataTable, decorators: [{
4351
+ type: Component,
4352
+ args: [{ selector: 'st-data-table', changeDetection: ChangeDetectionStrategy.OnPush, imports: [NgTemplateOutlet, StSortHeader], host: {
4353
+ class: 'st-data-table',
4354
+ '[attr.data-densite]': 'densite()',
4355
+ '[attr.data-figee]': 'premiereColonneFigee() ? "" : null',
4356
+ }, template: "<!-- UN seul ng-content : la projection se decide a la compilation, et un second\n emplacement de meme selecteur, dans une autre branche, ne recevrait jamais\n rien. -->\n<div class=\"st-data-table__barre\">\n @if (selectionnable()) {\n <p class=\"st-data-table__selection\" role=\"status\" [id]=\"identifiants.selection\">\n {{ selection().length > 0 ? libelles().lignesSelectionnees(selection().length) : '' }}\n </p>\n }\n <div class=\"st-data-table__actions\">\n <ng-content select=\"[stActionsDeTableau]\" />\n </div>\n</div>\n\n<!-- UX-6 : zone nommee par la legende ; focalisable quand elle deborde, et par\n programme toujours, pour recevoir le focus apres un changement de page. -->\n<div\n #zone\n class=\"st-data-table__zone\"\n role=\"region\"\n [attr.aria-labelledby]=\"identifiants.legende\"\n [attr.tabindex]=\"deborde() ? 0 : -1\"\n [attr.data-deborde]=\"deborde() ? '' : null\"\n [style.max-block-size]=\"hauteurMax()\"\n [style.scroll-padding-inline-start.px]=\"largeurFigee()\"\n>\n <table class=\"st-data-table__tableau\" [attr.aria-busy]=\"chargement() ? 'true' : null\">\n <caption\n class=\"st-data-table__legende\"\n [id]=\"identifiants.legende\"\n [class.st-vh]=\"legendeMasquee()\"\n >\n {{\n legende()\n }}\n </caption>\n <thead>\n <tr>\n @if (selectionnable()) {\n <th class=\"st-data-table__case\" scope=\"col\" data-figee>\n <input\n class=\"st-data-table__cocher\"\n type=\"checkbox\"\n [checked]=\"toutesChoisies()\"\n [indeterminate]=\"quelquesChoisies()\"\n [disabled]=\"rangees().length === 0\"\n [attr.aria-label]=\"libelles().selectionnerLaPage(rangees().length)\"\n (change)=\"basculerTout()\"\n />\n </th>\n }\n @for (cellule of cellules(); track cellule.colonne.cle; let premiere = $first) {\n <th\n scope=\"col\"\n [attr.data-alignement]=\"cellule.colonne.alignement ?? 'debut'\"\n [attr.data-figee]=\"premiere && premiereColonneFigee() ? '' : null\"\n [attr.aria-sort]=\"ariaSort(cellule.colonne)\"\n >\n @if (cellule.colonne.triable) {\n <button\n stSortHeader\n type=\"button\"\n [sens]=\"sensDe(cellule.colonne)\"\n (click)=\"trier(cellule.colonne)\"\n >\n {{ cellule.colonne.libelle }}\n </button>\n } @else if (cellule.colonne.libelleMasque) {\n <span class=\"st-vh\">{{ cellule.colonne.libelle }}</span>\n } @else {\n {{ cellule.colonne.libelle }}\n }\n </th>\n }\n </tr>\n </thead>\n <tbody>\n @for (rang of squelette(); track rang) {\n <tr class=\"st-data-table__squelette\" aria-hidden=\"true\">\n @for (colonne of colonnesDeSquelette(); track colonne) {\n <td><span class=\"st-data-table__barre-de-squelette\"></span></td>\n }\n </tr>\n }\n @for (rangee of rangees(); track rangee.identifiant) {\n <tr [attr.data-choisie]=\"rangee.choisie ? '' : null\">\n @if (selectionnable()) {\n <td class=\"st-data-table__case\" data-figee>\n <input\n class=\"st-data-table__cocher\"\n type=\"checkbox\"\n [checked]=\"rangee.choisie\"\n [attr.aria-label]=\"libelles().selectionnerLaLigne(rangee.nom ?? rangee.identifiant)\"\n (change)=\"basculer(rangee.identifiant)\"\n />\n </td>\n }\n @for (cellule of cellules(); track cellule.colonne.cle; let premiere = $first) {\n @if (cellule.enTete) {\n <th\n scope=\"row\"\n [attr.data-alignement]=\"cellule.colonne.alignement ?? 'debut'\"\n [attr.data-figee]=\"premiere && premiereColonneFigee() ? '' : null\"\n >\n <ng-container\n *ngTemplateOutlet=\"\n valeur;\n context: { $implicit: rangee.valeur, cellule: cellule }\n \"\n />\n </th>\n } @else {\n <td\n [attr.data-alignement]=\"cellule.colonne.alignement ?? 'debut'\"\n [attr.data-figee]=\"premiere && premiereColonneFigee() ? '' : null\"\n >\n <ng-container\n *ngTemplateOutlet=\"\n valeur;\n context: { $implicit: rangee.valeur, cellule: cellule }\n \"\n />\n </td>\n }\n }\n </tr>\n } @empty {\n @if (!chargement()) {\n <tr>\n <td class=\"st-data-table__vide\" [attr.colspan]=\"nombreDeColonnes()\">\n @if (gabaritVide(); as vide) {\n <ng-container *ngTemplateOutlet=\"vide.gabarit\" />\n } @else {\n {{ texteVide() ?? libelles().tableauVide }}\n }\n </td>\n </tr>\n }\n }\n </tbody>\n </table>\n</div>\n<span class=\"st-vh\" aria-live=\"polite\">{{ annonce.texte() }}</span>\n\n<ng-template #valeur let-ligne let-cellule=\"cellule\">\n @if (cellule.gabarit; as gabarit) {\n <ng-container\n *ngTemplateOutlet=\"gabarit; context: { $implicit: ligne, colonne: cellule.colonne }\"\n />\n } @else if (texteDe(ligne, cellule.colonne); as texte) {\n {{ texte }}\n } @else {\n <span aria-hidden=\"true\">&#8212;</span><span class=\"st-vh\">{{ libelles().nonRenseigne }}</span>\n }\n</ng-template>\n", styles: [".st-vh{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}:host([hidden]){display:none!important}:host{--st-tableau-cellule-bloc: var(--st-espacement-3);--st-tableau-cellule-ligne: var(--st-espacement-3);--st-tableau-largeur-case: 3rem;display:block}:host([data-densite=compacte]){--st-tableau-cellule-bloc: var(--st-espacement-1);--st-tableau-cellule-ligne: var(--st-espacement-2)}.st-data-table__barre,.st-data-table__actions{display:flex;flex-wrap:wrap;gap:var(--st-espacement-2);align-items:center}.st-data-table__barre{justify-content:space-between}.st-data-table__barre:has(.st-data-table__selection,.st-data-table__actions:not(:empty)){min-block-size:var(--st-cible-tactile-min);margin-block-end:var(--st-espacement-2)}.st-data-table__actions{margin-inline-start:auto}.st-data-table__actions:empty{display:none}.st-data-table__selection{margin:0;font-weight:var(--st-graisse-semi)}.st-data-table__zone:focus{outline:2px solid var(--st-couleur-anneau-focus);outline-offset:2px}.st-data-table__zone{position:relative;overflow:auto;border:1px solid var(--st-couleur-bordure);border-radius:var(--st-rayon-md);background:linear-gradient(to right,var(--st-couleur-surface) 30%,transparent) left/2rem 100% no-repeat local,linear-gradient(to left,var(--st-couleur-surface) 30%,transparent) right/2rem 100% no-repeat local,radial-gradient(farthest-side at 0 50%,rgba(0,0,0,.2),transparent) left/.75rem 100% no-repeat scroll,radial-gradient(farthest-side at 100% 50%,rgba(0,0,0,.2),transparent) right/.75rem 100% no-repeat scroll,var(--st-couleur-surface)}.st-data-table__tableau{inline-size:100%;font-variant-numeric:tabular-nums;border-collapse:separate;border-spacing:0}.st-data-table__legende{padding:var(--st-espacement-3);font-weight:var(--st-graisse-semi);text-align:start}th,td{padding-block:var(--st-tableau-cellule-bloc);padding-inline:var(--st-tableau-cellule-ligne);text-align:start;vertical-align:top;overflow-wrap:anywhere;border-block-end:1px solid var(--st-couleur-bordure)}thead th{font-weight:var(--st-graisse-semi);color:var(--st-couleur-texte-discret);white-space:nowrap;background:var(--st-couleur-surface-enfoncee)}thead th{position:sticky;inset-block-start:0;z-index:2}tbody th{font-weight:var(--st-graisse-semi)}tbody tr:last-child>*{border-block-end:0}tbody tr:hover>*{background:var(--st-couleur-surface-survol)}tbody tr[data-choisie]>*{background:var(--st-couleur-primaire-discret)}tbody tr[data-choisie]>:first-child{box-shadow:inset 3px 0 0 var(--st-couleur-primaire)}:host-context([dir=rtl]) tbody tr[data-choisie]>:first-child{box-shadow:inset -3px 0 0 var(--st-couleur-primaire)}[data-alignement=fin]{text-align:end}.st-data-table__case{inline-size:var(--st-tableau-largeur-case);min-inline-size:var(--st-tableau-largeur-case);text-align:center;vertical-align:middle}.st-data-table__cocher:focus-visible{outline:2px solid var(--st-couleur-anneau-focus);outline-offset:2px}.st-data-table__cocher{inline-size:24px;block-size:24px;margin:0;accent-color:var(--st-couleur-primaire);cursor:pointer}:host([data-figee]) [data-figee]{position:sticky;inset-inline-start:0;z-index:1;background:var(--st-couleur-surface)}:host([data-figee]) .st-data-table__case+[data-figee]{inset-inline-start:var(--st-tableau-largeur-case)}:host([data-figee]) thead [data-figee]{z-index:3;background:var(--st-couleur-surface-enfoncee)}.st-data-table__vide{padding:var(--st-espacement-5);color:var(--st-couleur-texte-discret);text-align:center}.st-data-table__barre-de-squelette{display:block;block-size:1em;background:var(--st-couleur-surface-enfoncee);border-radius:var(--st-rayon-sm)}@media(prefers-reduced-motion:no-preference){.st-data-table__barre-de-squelette{animation:st-tableau-pulsation 1.5s ease-in-out infinite}}@keyframes st-tableau-pulsation{50%{opacity:.5}}.st-data-table__tableau[aria-busy=true]{cursor:progress}@media(forced-colors:active){tbody tr[data-choisie]>:first-child{box-shadow:none;border-inline-start:3px solid Highlight}}\n"] }]
4357
+ }], ctorParameters: () => [], propDecorators: { legende: [{ type: i0.Input, args: [{ isSignal: true, alias: "legende", required: true }] }], legendeMasquee: [{ type: i0.Input, args: [{ isSignal: true, alias: "legendeMasquee", required: false }] }], colonnes: [{ type: i0.Input, args: [{ isSignal: true, alias: "colonnes", required: true }] }], lignes: [{ type: i0.Input, args: [{ isSignal: true, alias: "lignes", required: true }] }], cle: [{ type: i0.Input, args: [{ isSignal: true, alias: "cle", required: true }] }], enTeteDeLigne: [{ type: i0.Input, args: [{ isSignal: true, alias: "enTeteDeLigne", required: false }] }], premiereColonneFigee: [{ type: i0.Input, args: [{ isSignal: true, alias: "premiereColonneFigee", required: false }] }], hauteurMax: [{ type: i0.Input, args: [{ isSignal: true, alias: "hauteurMax", required: false }] }], densite: [{ type: i0.Input, args: [{ isSignal: true, alias: "densite", required: false }] }], chargement: [{ type: i0.Input, args: [{ isSignal: true, alias: "chargement", required: false }] }], selectionnable: [{ type: i0.Input, args: [{ isSignal: true, alias: "selectionnable", required: false }] }], selection: [{ type: i0.Input, args: [{ isSignal: true, alias: "selection", required: false }] }, { type: i0.Output, args: ["selectionChange"] }], tri: [{ type: i0.Input, args: [{ isSignal: true, alias: "tri", required: false }] }, { type: i0.Output, args: ["triChange"] }], texteVide: [{ type: i0.Input, args: [{ isSignal: true, alias: "texteVide", required: false }] }], gabarits: [{ type: i0.ContentChildren, args: [i0.forwardRef(() => StCellule), { isSignal: true }] }], gabaritVide: [{ type: i0.ContentChild, args: [i0.forwardRef(() => StTableauVide), { isSignal: true }] }], zone: [{ type: i0.ViewChild, args: ['zone', { isSignal: true }] }] } });
4358
+ /** Texte d'une valeur ; `null` quand elle est absente, pour le dire (UX de la vague 4). */
4359
+ function texteDe(valeur) {
4360
+ if (valeur === null || valeur === undefined || valeur === '')
4361
+ return null;
4362
+ if (typeof valeur === 'string')
4363
+ return valeur;
4364
+ if (typeof valeur === 'number' || typeof valeur === 'boolean' || typeof valeur === 'bigint') {
4365
+ return String(valeur);
4366
+ }
4367
+ return null;
4368
+ }
4369
+
4370
+ /**
4371
+ * Filtre actif, retirable : « Statut : Expediee ✕ ».
4372
+ *
4373
+ * ```html
4374
+ * <button stFilterChip libelle="Statut : Expediee" (click)="retirer('statut')"></button>
4375
+ * ```
4376
+ *
4377
+ * ⚠️ **Toute la puce est le bouton**, et son nom CONTIENT le texte visible —
4378
+ * « Retirer le filtre Statut : Expediee » (WCAG 2.5.3) : une commande vocale
4379
+ * « cliquer Statut » l'atteint. Une croix seule, a cote d'un texte inerte, serait
4380
+ * une cible de quelques pixels sans nom.
4381
+ */
4382
+ class StFilterChip {
4383
+ libelles = inject(ST_LIBELLES);
4384
+ libelle = input.required(/* @ts-ignore */
4385
+ ...(ngDevMode ? [{ debugName: "libelle" }] : /* istanbul ignore next */ []));
4386
+ nom = computed(() => this.libelles().retirerLeFiltre(this.libelle()), /* @ts-ignore */
4387
+ ...(ngDevMode ? [{ debugName: "nom" }] : /* istanbul ignore next */ []));
4388
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: StFilterChip, deps: [], target: i0.ɵɵFactoryTarget.Component });
4389
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.1.6", type: StFilterChip, isStandalone: true, selector: "button[stFilterChip]", inputs: { libelle: { classPropertyName: "libelle", publicName: "libelle", isSignal: true, isRequired: true, transformFunction: null } }, host: { attributes: { "type": "button" }, properties: { "attr.aria-label": "nom()" }, classAttribute: "st-filter-chip" }, ngImport: i0, template: "<span class=\"st-filter-chip__libelle\">{{ libelle() }}</span>\n<st-icon class=\"st-filter-chip__croix\" nom=\"croix\" taille=\"sm\" />\n", styles: [".st-vh{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}:host([hidden]){display:none!important}:host:focus-visible{outline:2px solid var(--st-couleur-anneau-focus);outline-offset:2px}:host{display:inline-flex;gap:var(--st-espacement-1);align-items:center;min-block-size:32px;padding-block:var(--st-espacement-1);padding-inline:var(--st-espacement-3) var(--st-espacement-2);font:inherit;color:var(--st-couleur-texte);cursor:pointer;background:var(--st-couleur-surface-enfoncee);border:1px solid var(--st-couleur-bordure-forte);border-radius:var(--st-rayon-pleine)}:host:hover{background:var(--st-couleur-surface-survol)}.st-filter-chip__croix{flex:none}\n"], dependencies: [{ kind: "component", type: StIcon, selector: "st-icon", inputs: ["nom", "taille", "ton", "etiquette"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
4390
+ }
4391
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: StFilterChip, decorators: [{
4392
+ type: Component,
4393
+ args: [{ selector: 'button[stFilterChip]', changeDetection: ChangeDetectionStrategy.OnPush, imports: [StIcon], host: {
4394
+ class: 'st-filter-chip',
4395
+ type: 'button',
4396
+ '[attr.aria-label]': 'nom()',
4397
+ }, template: "<span class=\"st-filter-chip__libelle\">{{ libelle() }}</span>\n<st-icon class=\"st-filter-chip__croix\" nom=\"croix\" taille=\"sm\" />\n", styles: [".st-vh{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}:host([hidden]){display:none!important}:host:focus-visible{outline:2px solid var(--st-couleur-anneau-focus);outline-offset:2px}:host{display:inline-flex;gap:var(--st-espacement-1);align-items:center;min-block-size:32px;padding-block:var(--st-espacement-1);padding-inline:var(--st-espacement-3) var(--st-espacement-2);font:inherit;color:var(--st-couleur-texte);cursor:pointer;background:var(--st-couleur-surface-enfoncee);border:1px solid var(--st-couleur-bordure-forte);border-radius:var(--st-rayon-pleine)}:host:hover{background:var(--st-couleur-surface-survol)}.st-filter-chip__croix{flex:none}\n"] }]
4398
+ }], propDecorators: { libelle: [{ type: i0.Input, args: [{ isSignal: true, alias: "libelle", required: true }] }] } });
4399
+
4400
+ let compteur$2 = 0;
4401
+ /**
4402
+ * Barre de filtres : les champs, puis les filtres en vigueur, retirables.
4403
+ *
4404
+ * ```html
4405
+ * <st-filter-bar [filtresActifs]="actifs()" (retrait)="retirer($event)" (effacement)="effacer()">
4406
+ * <st-select libelle="Statut" [options]="statuts" [(value)]="statut" />
4407
+ * </st-filter-bar>
4408
+ * ```
4409
+ *
4410
+ * Un formulaire NOMME : repere « Filtres » dans la liste des reperes du lecteur
4411
+ * d'ecran. Pas un repere `search` : un `st-search-field` pose dedans en porte deja
4412
+ * un, et deux reperes imbriques se liraient en double.
4413
+ *
4414
+ * ⚠️ **Les filtres s'appliquent au changement**, par l'application : Entree dans
4415
+ * un champ n'envoie rien, et ne recharge pas la page.
4416
+ *
4417
+ * ⚠️ **Retirer un filtre rend le focus a la puce suivante**, sinon a la
4418
+ * precedente, sinon au formulaire ; « Effacer les filtres » le rend au formulaire
4419
+ * (UX-14). Le focus ne tombe jamais sur le document, et le retrait s'annonce.
4420
+ *
4421
+ * ⚠️ **Dans l'adresse, des valeurs d'enumeration seulement** (SEC-2) : un texte
4422
+ * cherche, un nom, un IBAN n'y vont pas. Le composant ne touche pas a l'adresse ;
4423
+ * la regle est pour l'application qui le ferait.
4424
+ */
4425
+ class StFilterBar {
4426
+ libelles = inject(ST_LIBELLES);
4427
+ element = inject(ElementRef);
4428
+ injecteur = inject(Injector);
4429
+ /** Nom du formulaire. Par defaut : « Filtres ». */
4430
+ etiquette = input(null, /* @ts-ignore */
4431
+ ...(ngDevMode ? [{ debugName: "etiquette" }] : /* istanbul ignore next */ []));
4432
+ filtresActifs = input([], /* @ts-ignore */
4433
+ ...(ngDevMode ? [{ debugName: "filtresActifs" }] : /* istanbul ignore next */ []));
4434
+ retrait = output();
4435
+ effacement = output();
4436
+ annonce = new AnnonceLocale(inject(DestroyRef));
4437
+ identifiantActifs = `st-filtres-${(compteur$2 += 1).toString()}-actifs`;
4438
+ etiquetteLue = computed(() => this.etiquette() ?? this.libelles().filtres, /* @ts-ignore */
4439
+ ...(ngDevMode ? [{ debugName: "etiquetteLue" }] : /* istanbul ignore next */ []));
4440
+ retirer(filtre, indice) {
4441
+ this.retrait.emit(filtre.cle);
4442
+ this.annonce.annoncer(this.libelles().filtreRetire(filtre.libelle));
4443
+ this.apresLeRendu(() => {
4444
+ const puces = this.element.nativeElement.querySelectorAll('.st-filter-chip');
4445
+ return puces[Math.min(indice, puces.length - 1)] ?? null;
4446
+ });
4447
+ }
4448
+ effacer() {
4449
+ this.effacement.emit();
4450
+ this.annonce.annoncer(this.libelles().filtresEffaces);
4451
+ this.apresLeRendu(() => null);
4452
+ }
4453
+ apresLeRendu(cible) {
4454
+ afterNextRender(() => {
4455
+ const formulaire = this.element.nativeElement.querySelector('form');
4456
+ (cible() ?? formulaire)?.focus();
4457
+ }, { injector: this.injecteur });
4458
+ }
4459
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: StFilterBar, deps: [], target: i0.ɵɵFactoryTarget.Component });
4460
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.6", type: StFilterBar, isStandalone: true, selector: "st-filter-bar", inputs: { etiquette: { classPropertyName: "etiquette", publicName: "etiquette", isSignal: true, isRequired: false, transformFunction: null }, filtresActifs: { classPropertyName: "filtresActifs", publicName: "filtresActifs", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { retrait: "retrait", effacement: "effacement" }, host: { classAttribute: "st-filter-bar" }, ngImport: i0, template: "<!-- tabindex -1 : cible du focus quand la derniere puce disparait. -->\n<form\n class=\"st-filter-bar__formulaire\"\n tabindex=\"-1\"\n [attr.aria-label]=\"etiquetteLue()\"\n (submit)=\"$event.preventDefault()\"\n>\n <div class=\"st-filter-bar__champs\">\n <ng-content />\n </div>\n\n @if (filtresActifs().length > 0) {\n <div class=\"st-filter-bar__actifs\">\n <p class=\"st-filter-bar__titre\" [id]=\"identifiantActifs\">{{ libelles().filtresActifs }}</p>\n <ul class=\"st-filter-bar__puces\" [attr.aria-labelledby]=\"identifiantActifs\">\n @for (filtre of filtresActifs(); track filtre.cle; let indice = $index) {\n <li>\n <!-- eslint-disable-next-line @angular-eslint/template/elements-content --\n Le contenu vient du gabarit de stFilterChip, et le libelle est requis. -->\n <button\n stFilterChip\n type=\"button\"\n [libelle]=\"filtre.libelle\"\n (click)=\"retirer(filtre, indice)\"\n ></button>\n </li>\n }\n </ul>\n <button stButton type=\"button\" variante=\"discret\" (click)=\"effacer()\">\n {{ libelles().effacerLesFiltres }}\n </button>\n </div>\n }\n</form>\n<span class=\"st-vh\" aria-live=\"polite\">{{ annonce.texte() }}</span>\n", styles: [".st-vh{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}:host([hidden]){display:none!important}:host{display:block}.st-filter-bar__formulaire:focus{outline:2px solid var(--st-couleur-anneau-focus);outline-offset:2px}.st-filter-bar__formulaire{display:grid;gap:var(--st-espacement-3)}.st-filter-bar__champs{display:flex;flex-wrap:wrap;gap:var(--st-espacement-3) var(--st-espacement-4);align-items:flex-end}.st-filter-bar__actifs{display:flex;flex-wrap:wrap;gap:var(--st-espacement-2);align-items:center}.st-filter-bar__titre{margin:0;font-weight:var(--st-graisse-semi)}.st-filter-bar__puces{display:flex;flex-wrap:wrap;gap:var(--st-espacement-2);padding:0;margin:0;list-style:none}\n"], dependencies: [{ kind: "component", type: StButton, selector: "button[stButton]", inputs: ["variante", "taille", "pleineLargeur", "iconeAvant", "iconeApres", "chargement", "indisponible"] }, { kind: "component", type: StFilterChip, selector: "button[stFilterChip]", inputs: ["libelle"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
4461
+ }
4462
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: StFilterBar, decorators: [{
4463
+ type: Component,
4464
+ args: [{ selector: 'st-filter-bar', changeDetection: ChangeDetectionStrategy.OnPush, imports: [StButton, StFilterChip], host: { class: 'st-filter-bar' }, template: "<!-- tabindex -1 : cible du focus quand la derniere puce disparait. -->\n<form\n class=\"st-filter-bar__formulaire\"\n tabindex=\"-1\"\n [attr.aria-label]=\"etiquetteLue()\"\n (submit)=\"$event.preventDefault()\"\n>\n <div class=\"st-filter-bar__champs\">\n <ng-content />\n </div>\n\n @if (filtresActifs().length > 0) {\n <div class=\"st-filter-bar__actifs\">\n <p class=\"st-filter-bar__titre\" [id]=\"identifiantActifs\">{{ libelles().filtresActifs }}</p>\n <ul class=\"st-filter-bar__puces\" [attr.aria-labelledby]=\"identifiantActifs\">\n @for (filtre of filtresActifs(); track filtre.cle; let indice = $index) {\n <li>\n <!-- eslint-disable-next-line @angular-eslint/template/elements-content --\n Le contenu vient du gabarit de stFilterChip, et le libelle est requis. -->\n <button\n stFilterChip\n type=\"button\"\n [libelle]=\"filtre.libelle\"\n (click)=\"retirer(filtre, indice)\"\n ></button>\n </li>\n }\n </ul>\n <button stButton type=\"button\" variante=\"discret\" (click)=\"effacer()\">\n {{ libelles().effacerLesFiltres }}\n </button>\n </div>\n }\n</form>\n<span class=\"st-vh\" aria-live=\"polite\">{{ annonce.texte() }}</span>\n", styles: [".st-vh{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}:host([hidden]){display:none!important}:host{display:block}.st-filter-bar__formulaire:focus{outline:2px solid var(--st-couleur-anneau-focus);outline-offset:2px}.st-filter-bar__formulaire{display:grid;gap:var(--st-espacement-3)}.st-filter-bar__champs{display:flex;flex-wrap:wrap;gap:var(--st-espacement-3) var(--st-espacement-4);align-items:flex-end}.st-filter-bar__actifs{display:flex;flex-wrap:wrap;gap:var(--st-espacement-2);align-items:center}.st-filter-bar__titre{margin:0;font-weight:var(--st-graisse-semi)}.st-filter-bar__puces{display:flex;flex-wrap:wrap;gap:var(--st-espacement-2);padding:0;margin:0;list-style:none}\n"] }]
4465
+ }], propDecorators: { etiquette: [{ type: i0.Input, args: [{ isSignal: true, alias: "etiquette", required: false }] }], filtresActifs: [{ type: i0.Input, args: [{ isSignal: true, alias: "filtresActifs", required: false }] }], retrait: [{ type: i0.Output, args: ["retrait"] }], effacement: [{ type: i0.Output, args: ["effacement"] }] } });
4466
+
2097
4467
  let compteur$1 = 0;
2098
4468
  /**
2099
4469
  * Choix du theme : systeme, clair, sombre.
@@ -2731,5 +5101,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.6", ngImpor
2731
5101
  * Generated bundle index. Do not edit.
2732
5102
  */
2733
5103
 
2734
- export { AnnonceLocale, CHEMIN_DU_SPRITE, FUSEAU_PAR_DEFAUT, GABARITS_D_ETAT, IDENTIFIANT_DU_CONTENU_PRINCIPAL, LIBELLES_EN, LIBELLES_FR, NOMS_DICONE, REGION_VIVANTE_PARENTE, ST_LIBELLES, ST_LOCALE, StAppShell, StAvatar, StBadge, StBanner, StBreadcrumb, StButton, StButtonGroup, StCard, StChargement, StCode, StCopyButton, StCount, StDate, StDivider, StEmpty, StErreur, StError, StHeader, StHeading, StHorsLigne, StIcon, StIconButton, StInlineMessage, StLangSwitch, StLink, StLogo, StMasked, StMoney, StOfflineBanner, StPageTitle, StProgress, StRelativeTime, StSection, StSkeleton, StSkipLink, StSpinner, StState, StStatusPill, StSucces, StTag, StText, StThemeToggle, StTimer, StVide, copierDansLePressePapiers, formaterDuree, fournirCheminDuSprite, pressePapiersDisponible, provideStarterUi };
5104
+ export { AnnonceLocale, CHEMIN_DU_SPRITE, ContratDeChamp, ControleDeSaisie, FUSEAU_PAR_DEFAUT, GABARITS_D_ETAT, IDENTIFIANT_DU_CONTENU_PRINCIPAL, LIBELLES_EN, LIBELLES_FR, NOMS_DICONE, REGION_VIVANTE_PARENTE, ST_LIBELLES, ST_LOCALE, StAppShell, StAvatar, StBadge, StBanner, StBreadcrumb, StButton, StButtonGroup, StCalendar, StCard, StCellule, StChargement, StCheckbox, StCode, StControleDeChamp, StCopyButton, StCount, StDataTable, StDate, StDescription, StDescriptionList, StDivider, StElementDeListe, StEmpty, StErreur, StError, StErrorSummary, StFieldset, StFileUpload, StFilterBar, StFilterChip, StFormField, StHeader, StHeading, StHorsLigne, StIbanField, StIcon, StIconButton, StInlineMessage, StInput, StLangSwitch, StLink, StList, StLogo, StMasked, StMoney, StOfflineBanner, StOtpField, StPageTitle, StPagination, StPasswordField, StPhoneField, StProgress, StRadioGroup, StRelativeTime, StSearchField, StSection, StSelect, StSkeleton, StSkipLink, StSortHeader, StSpinner, StState, StStatusPill, StSucces, StSwitch, StTableauVide, StTag, StText, StTextarea, StThemeToggle, StTimer, StVide, copierDansLePressePapiers, erreurDate, erreurIban, erreurPlageDeDates, erreurTelephone, erreursDeFichiers, exempleDeDate, filtrerOptions, formaterDuree, fournirCheminDuSprite, fusionnerErreurs, messageDErreur, motifLocal, normaliserPourRecherche, pressePapiersDisponible, provideStarterUi };
2735
5105
  //# sourceMappingURL=starterlib-ui.mjs.map