@starterlib/ui 0.7.2 → 0.9.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.
Files changed (55) hide show
  1. package/LICENCES-TIERCES.md +236 -0
  2. package/README.md +163 -56
  3. package/assets/icones/catalogue.json +3296 -0
  4. package/assets/icones/sprite.svg +235 -35
  5. package/fesm2022/starterlib-ui-arbre.mjs +475 -0
  6. package/fesm2022/starterlib-ui-arbre.mjs.map +1 -0
  7. package/fesm2022/starterlib-ui-donnees.mjs +3561 -0
  8. package/fesm2022/starterlib-ui-donnees.mjs.map +1 -0
  9. package/fesm2022/starterlib-ui-formulaires.mjs +3186 -442
  10. package/fesm2022/starterlib-ui-formulaires.mjs.map +1 -1
  11. package/fesm2022/starterlib-ui-libelles-en.mjs +383 -0
  12. package/fesm2022/starterlib-ui-libelles-en.mjs.map +1 -0
  13. package/fesm2022/starterlib-ui-listes.mjs +5367 -0
  14. package/fesm2022/starterlib-ui-listes.mjs.map +1 -0
  15. package/fesm2022/starterlib-ui-messagerie.mjs +737 -0
  16. package/fesm2022/starterlib-ui-messagerie.mjs.map +1 -0
  17. package/fesm2022/starterlib-ui-navigation.mjs +509 -0
  18. package/fesm2022/starterlib-ui-navigation.mjs.map +1 -0
  19. package/fesm2022/starterlib-ui-onglets.mjs +371 -0
  20. package/fesm2022/starterlib-ui-onglets.mjs.map +1 -0
  21. package/fesm2022/starterlib-ui-parcours.mjs +2449 -0
  22. package/fesm2022/starterlib-ui-parcours.mjs.map +1 -0
  23. package/fesm2022/starterlib-ui-qr.mjs +907 -0
  24. package/fesm2022/starterlib-ui-qr.mjs.map +1 -0
  25. package/fesm2022/starterlib-ui-saisie.mjs +8609 -0
  26. package/fesm2022/starterlib-ui-saisie.mjs.map +1 -0
  27. package/fesm2022/starterlib-ui-selection.mjs +1341 -0
  28. package/fesm2022/starterlib-ui-selection.mjs.map +1 -0
  29. package/fesm2022/starterlib-ui-sens.mjs +59 -0
  30. package/fesm2022/starterlib-ui-sens.mjs.map +1 -0
  31. package/fesm2022/starterlib-ui-surfaces.mjs +5140 -1387
  32. package/fesm2022/starterlib-ui-surfaces.mjs.map +1 -1
  33. package/fesm2022/starterlib-ui.mjs +10729 -5689
  34. package/fesm2022/starterlib-ui.mjs.map +1 -1
  35. package/package.json +58 -17
  36. package/styles/amorce.css +69 -0
  37. package/styles/couches.css +178 -0
  38. package/types/starterlib-ui-arbre.d.ts +225 -0
  39. package/types/starterlib-ui-donnees.d.ts +1489 -0
  40. package/types/starterlib-ui-formulaires.d.ts +1174 -138
  41. package/types/starterlib-ui-libelles-en.d.ts +5 -0
  42. package/types/starterlib-ui-listes.d.ts +2487 -0
  43. package/types/starterlib-ui-messagerie.d.ts +317 -0
  44. package/types/starterlib-ui-navigation.d.ts +242 -0
  45. package/types/starterlib-ui-onglets.d.ts +212 -0
  46. package/types/starterlib-ui-parcours.d.ts +916 -0
  47. package/types/starterlib-ui-qr.d.ts +105 -0
  48. package/types/starterlib-ui-saisie.d.ts +3806 -0
  49. package/types/starterlib-ui-selection.d.ts +488 -0
  50. package/types/starterlib-ui-sens.d.ts +44 -0
  51. package/types/starterlib-ui-surfaces.d.ts +1899 -510
  52. package/types/starterlib-ui.d.ts +4731 -2678
  53. package/fesm2022/starterlib-ui-interactions.mjs +0 -598
  54. package/fesm2022/starterlib-ui-interactions.mjs.map +0 -1
  55. package/types/starterlib-ui-interactions.d.ts +0 -316
@@ -0,0 +1,1341 @@
1
+ import * as i0 from "@angular/core";
2
+ import { ChangeDetectionStrategy, Component, DestroyRef, Directive, ElementRef, Injector, TemplateRef, afterNextRender, afterRenderEffect, booleanAttribute, computed, contentChild, effect, inject, input, isDevMode, linkedSignal, model, numberAttribute, output, resource, signal, untracked, viewChild } from "@angular/core";
3
+ import { DOCUMENT, NgTemplateOutlet } from "@angular/common";
4
+ import { Combobox, ComboboxPopup, ComboboxWidget } from "@angular/aria/combobox";
5
+ import { Listbox, Option } from "@angular/aria/listbox";
6
+ import { CdkConnectedOverlay } from "@angular/cdk/overlay";
7
+ import { AnnonceLocale, ST_LIBELLES, ST_LOCALE, ST_RECHERCHE_D_ADRESSES, StButton, StIcon, StIconButton, StIdentifiants, StInlineMessage, StLink, StSpinner, affichageDiffere } from "@starterlib/ui";
8
+ import { ContratDeChamp, ControleDeSaisie, ST_CHAMP_D_ADRESSE, StControleDeChamp, StFormField, filtrerOptions, groupesDOptions, optionsDesPays } from "@starterlib/ui/saisie";
9
+ import { sansCommandesDeDirection } from "@starterlib/util";
10
+ var StOption = class StOption {
11
+ gabarit = inject(TemplateRef);
12
+ static ngTemplateContextGuard(_directive, _contexte) {
13
+ return true;
14
+ }
15
+ static ɵfac = i0.ɵɵngDeclareFactory({
16
+ minVersion: "12.0.0",
17
+ version: "22.2.0",
18
+ ngImport: i0,
19
+ type: StOption,
20
+ deps: [],
21
+ target: i0.ɵɵFactoryTarget.Directive
22
+ });
23
+ static ɵdir = i0.ɵɵngDeclareDirective({
24
+ minVersion: "14.0.0",
25
+ version: "22.2.0",
26
+ type: StOption,
27
+ isStandalone: true,
28
+ selector: "ng-template[stOption]",
29
+ ngImport: i0
30
+ });
31
+ };
32
+ i0.ɵɵngDeclareClassMetadata({
33
+ minVersion: "12.0.0",
34
+ version: "22.2.0",
35
+ ngImport: i0,
36
+ type: StOption,
37
+ decorators: [{
38
+ type: Directive,
39
+ args: [{ selector: "ng-template[stOption]" }]
40
+ }]
41
+ });
42
+ var StCombobox = class StCombobox extends ControleDeSaisie {
43
+ affichable = sansCommandesDeDirection;
44
+ libelles = inject(ST_LIBELLES);
45
+ locale = inject(ST_LOCALE);
46
+ element = inject(ElementRef);
47
+ injecteur = inject(Injector);
48
+ document = inject(DOCUMENT);
49
+ options = input.required(...ngDevMode ? [{ debugName: "options" }] : /* istanbul ignore next */ []);
50
+ filtrage = input("local", ...ngDevMode ? [{ debugName: "filtrage" }] : /* istanbul ignore next */ []);
51
+ icone = input(null, ...ngDevMode ? [{ debugName: "icone" }] : /* istanbul ignore next */ []);
52
+ presentation = input("libelle", ...ngDevMode ? [{ debugName: "presentation" }] : /* istanbul ignore next */ []);
53
+ chargement = input(false, {
54
+ ...ngDevMode ? { debugName: "chargement" } : /* istanbul ignore next */ {},
55
+ transform: booleanAttribute
56
+ });
57
+ effacable = input(false, {
58
+ ...ngDevMode ? { debugName: "effacable" } : /* istanbul ignore next */ {},
59
+ transform: booleanAttribute
60
+ });
61
+ temporisationEnMs = input(250, {
62
+ ...ngDevMode ? { debugName: "temporisationEnMs" } : /* istanbul ignore next */ {},
63
+ transform: numberAttribute
64
+ });
65
+ longueurMinimale = input(0, {
66
+ ...ngDevMode ? { debugName: "longueurMinimale" } : /* istanbul ignore next */ {},
67
+ transform: numberAttribute
68
+ });
69
+ recherche = output();
70
+ annonce = new AnnonceLocale(inject(DestroyRef));
71
+ gabaritDOption = contentChild(StOption, ...ngDevMode ? [{ debugName: "gabaritDOption" }] : /* istanbul ignore next */ []);
72
+ attenteVisible = affichageDiffere(() => this.chargement());
73
+ ouvert = signal(false, ...ngDevMode ? [{ debugName: "ouvert" }] : /* istanbul ignore next */ []);
74
+ texte = linkedSignal({
75
+ ...ngDevMode ? { debugName: "texte" } : /* istanbul ignore next */ {},
76
+ source: this.value,
77
+ computation: (valeur) => untracked(() => this.libelleDe(valeur))
78
+ });
79
+ filtre = signal("", ...ngDevMode ? [{ debugName: "filtre" }] : /* istanbul ignore next */ []);
80
+ surlignee = linkedSignal(() => this.value() === "" ? [] : [this.value()], ...ngDevMode ? [{ debugName: "surlignee" }] : /* istanbul ignore next */ []);
81
+ visibles = computed(() => this.filtrage() === "local" ? filtrerOptions(this.options(), this.filtre(), this.locale()) : this.options(), ...ngDevMode ? [{ debugName: "visibles" }] : /* istanbul ignore next */ []);
82
+ blocs = computed(() => groupesDOptions(this.visibles()), ...ngDevMode ? [{ debugName: "blocs" }] : /* istanbul ignore next */ []);
83
+ tropCourt = computed(() => {
84
+ const minimum = this.longueurMinimale();
85
+ const longueur = this.filtre().trim().length;
86
+ return this.filtrage() === "distant" && minimum > 0 && longueur > 0 && longueur < minimum;
87
+ }, ...ngDevMode ? [{ debugName: "tropCourt" }] : /* istanbul ignore next */ []);
88
+ afficherEffacer = computed(() => this.effacable() && this.value() !== "", ...ngDevMode ? [{ debugName: "afficherEffacer" }] : /* istanbul ignore next */ []);
89
+ choixAffiche = computed(() => this.value() !== "" && this.texte() !== "" && this.texte() === this.libelleDe(this.value()), ...ngDevMode ? [{ debugName: "choixAffiche" }] : /* istanbul ignore next */ []);
90
+ idListe = inject(StIdentifiants).prochain("st-combobox-liste");
91
+ liste = viewChild(Listbox, ...ngDevMode ? [{ debugName: "liste" }] : /* istanbul ignore next */ []);
92
+ champNatif = viewChild("champ", ...ngDevMode ? [{ debugName: "champNatif" }] : /* istanbul ignore next */ []);
93
+ minuterie;
94
+ derniereAnnonce = null;
95
+ constructor() {
96
+ super();
97
+ inject(DestroyRef).onDestroy(() => {
98
+ clearTimeout(this.minuterie);
99
+ });
100
+ afterRenderEffect(() => {
101
+ if (this.ouvert()) this.liste()?.scrollActiveItemIntoView({ block: "nearest" });
102
+ });
103
+ afterRenderEffect(() => {
104
+ const libelle = this.libelleDe(this.value());
105
+ if (this.filtre() !== "") return;
106
+ if (this.document.activeElement === this.champNatif()?.nativeElement) return;
107
+ if (libelle !== "" && libelle !== untracked(this.texte)) this.texte.set(libelle);
108
+ });
109
+ afterRenderEffect(() => {
110
+ if (this.filtrage() !== "distant") return;
111
+ if (this.chargement()) return;
112
+ const nombre = this.options().length;
113
+ if (untracked(() => this.filtre().trim()) === "") return;
114
+ if (untracked(() => this.derniereAnnonce) === nombre) return;
115
+ this.derniereAnnonce = nombre;
116
+ untracked(() => {
117
+ const libelles = this.libelles();
118
+ this.annonce.annoncer(nombre === 0 && this.tropCourt() ? libelles.longueurMinimale(this.longueurMinimale()) : libelles.nombreDeResultats(nombre));
119
+ });
120
+ });
121
+ afterRenderEffect(() => {
122
+ if (!this.attenteVisible()) return;
123
+ untracked(() => {
124
+ if (!this.ouvert()) return;
125
+ this.derniereAnnonce = null;
126
+ this.annonce.annoncer(this.libelles().chargementEnCours);
127
+ });
128
+ });
129
+ }
130
+ surSaisie(evenement) {
131
+ const saisie = this.texteSaisi(evenement);
132
+ this.filtre.set(saisie);
133
+ if (this.filtrage() === "local") {
134
+ this.annoncerLeNombreLocal();
135
+ return;
136
+ }
137
+ this.emettreRecherche(saisie);
138
+ }
139
+ annoncerLeNombreLocal() {
140
+ clearTimeout(this.minuterie);
141
+ this.minuterie = setTimeout(() => {
142
+ this.minuterie = void 0;
143
+ const nombre = this.visibles().length;
144
+ if (nombre === this.derniereAnnonce) return;
145
+ this.derniereAnnonce = nombre;
146
+ this.annonce.annoncer(this.libelles().nombreDeResultats(nombre));
147
+ }, this.temporisationEnMs());
148
+ }
149
+ emettreRecherche(saisie) {
150
+ clearTimeout(this.minuterie);
151
+ if (saisie === "") {
152
+ this.derniereAnnonce = null;
153
+ this.recherche.emit(saisie);
154
+ return;
155
+ }
156
+ this.minuterie = setTimeout(() => {
157
+ this.derniereAnnonce = null;
158
+ this.recherche.emit(saisie);
159
+ }, this.temporisationEnMs());
160
+ }
161
+ annulerRecherche() {
162
+ clearTimeout(this.minuterie);
163
+ this.minuterie = void 0;
164
+ }
165
+ basculer() {
166
+ if (this.desactive() || this.readonly()) return;
167
+ this.filtre.set("");
168
+ this.ouvert.update((ouvert) => !ouvert);
169
+ this.focus();
170
+ }
171
+ effacer() {
172
+ this.annulerRecherche();
173
+ this.value.set("");
174
+ this.texte.set("");
175
+ this.filtre.set("");
176
+ this.derniereAnnonce = null;
177
+ if (this.filtrage() === "distant") this.recherche.emit("");
178
+ this.focus();
179
+ }
180
+ surClic(evenement) {
181
+ if (evenement.target?.closest("[role=\"option\"]:not([aria-disabled=\"true\"])") == null) return;
182
+ this.valider();
183
+ }
184
+ valider() {
185
+ const choisie = this.surlignee()[0];
186
+ if (choisie === void 0) return;
187
+ this.annulerRecherche();
188
+ this.value.set(choisie);
189
+ this.texte.set(this.libelleDe(choisie));
190
+ this.filtre.set("");
191
+ this.ouvert.set(false);
192
+ this.derniereAnnonce = null;
193
+ afterNextRender(() => {
194
+ this.focus();
195
+ }, { injector: this.injecteur });
196
+ }
197
+ aLaSortie(evenement) {
198
+ const suivant = evenement.relatedTarget;
199
+ if (suivant !== null && this.element.nativeElement.contains(suivant)) return;
200
+ this.annulerRecherche();
201
+ if (this.texte().trim() === "") this.value.set("");
202
+ this.texte.set(this.libelleDe(this.value()));
203
+ this.filtre.set("");
204
+ this.derniereAnnonce = null;
205
+ this.touch.emit();
206
+ }
207
+ idDuGroupe(indice) {
208
+ return `${this.idListe}-groupe-${indice.toString()}`;
209
+ }
210
+ idDuContenu(indiceDuBloc, indice) {
211
+ return `${this.idListe}-contenu-${indiceDuBloc.toString()}-${indice.toString()}`;
212
+ }
213
+ idDeLAide(indiceDuBloc, indice) {
214
+ return `${this.idListe}-aide-${indiceDuBloc.toString()}-${indice.toString()}`;
215
+ }
216
+ libelleDe(valeur) {
217
+ if (valeur === "") return "";
218
+ return sansCommandesDeDirection(this.options().find((option) => option.valeur === valeur)?.libelle ?? "");
219
+ }
220
+ static ɵfac = i0.ɵɵngDeclareFactory({
221
+ minVersion: "12.0.0",
222
+ version: "22.2.0",
223
+ ngImport: i0,
224
+ type: StCombobox,
225
+ deps: [],
226
+ target: i0.ɵɵFactoryTarget.Component
227
+ });
228
+ static ɵcmp = i0.ɵɵngDeclareComponent({
229
+ minVersion: "17.0.0",
230
+ version: "22.2.0",
231
+ type: StCombobox,
232
+ isStandalone: true,
233
+ selector: "st-combobox",
234
+ inputs: {
235
+ options: {
236
+ classPropertyName: "options",
237
+ publicName: "options",
238
+ isSignal: true,
239
+ isRequired: true,
240
+ transformFunction: null
241
+ },
242
+ filtrage: {
243
+ classPropertyName: "filtrage",
244
+ publicName: "filtrage",
245
+ isSignal: true,
246
+ isRequired: false,
247
+ transformFunction: null
248
+ },
249
+ icone: {
250
+ classPropertyName: "icone",
251
+ publicName: "icone",
252
+ isSignal: true,
253
+ isRequired: false,
254
+ transformFunction: null
255
+ },
256
+ presentation: {
257
+ classPropertyName: "presentation",
258
+ publicName: "presentation",
259
+ isSignal: true,
260
+ isRequired: false,
261
+ transformFunction: null
262
+ },
263
+ chargement: {
264
+ classPropertyName: "chargement",
265
+ publicName: "chargement",
266
+ isSignal: true,
267
+ isRequired: false,
268
+ transformFunction: null
269
+ },
270
+ effacable: {
271
+ classPropertyName: "effacable",
272
+ publicName: "effacable",
273
+ isSignal: true,
274
+ isRequired: false,
275
+ transformFunction: null
276
+ },
277
+ temporisationEnMs: {
278
+ classPropertyName: "temporisationEnMs",
279
+ publicName: "temporisationEnMs",
280
+ isSignal: true,
281
+ isRequired: false,
282
+ transformFunction: null
283
+ },
284
+ longueurMinimale: {
285
+ classPropertyName: "longueurMinimale",
286
+ publicName: "longueurMinimale",
287
+ isSignal: true,
288
+ isRequired: false,
289
+ transformFunction: null
290
+ }
291
+ },
292
+ outputs: { recherche: "recherche" },
293
+ host: {
294
+ listeners: { "focusout": "aLaSortie($event)" },
295
+ classAttribute: "st-combobox"
296
+ },
297
+ queries: [{
298
+ propertyName: "gabaritDOption",
299
+ first: true,
300
+ predicate: StOption,
301
+ descendants: true,
302
+ isSignal: true
303
+ }],
304
+ viewQueries: [{
305
+ propertyName: "liste",
306
+ first: true,
307
+ predicate: Listbox,
308
+ descendants: true,
309
+ isSignal: true
310
+ }, {
311
+ propertyName: "champNatif",
312
+ first: true,
313
+ predicate: ["champ"],
314
+ descendants: true,
315
+ isSignal: true
316
+ }],
317
+ usesInheritance: true,
318
+ ngImport: i0,
319
+ template: "<st-form-field\n [libelle]=\"libelle()\"\n [aide]=\"aide()\"\n [erreurs]=\"errors()\"\n [afficherErreurs]=\"touched()\"\n [obligatoire]=\"required()\"\n [presentation]=\"presentation()\"\n>\n <div #cadre class=\"st-combobox__cadre\">\n @if (icone(); as nom) {\n <st-icon class=\"st-combobox__icone\" [nom]=\"nom\" taille=\"18\" />\n }\n <input\n #champ\n #combobox=\"ngCombobox\"\n class=\"st-combobox__champ\"\n stControleDeChamp\n ngCombobox\n type=\"text\"\n autocomplete=\"off\"\n spellcheck=\"false\"\n [(value)]=\"texte\"\n [(expanded)]=\"ouvert\"\n [attr.name]=\"name() || null\"\n [attr.data-effacable]=\"afficherEffacer() ? '' : null\"\n [attr.data-icone]=\"icone() ? '' : null\"\n [attr.data-choisi]=\"choixAffiche() ? '' : null\"\n [attr.aria-busy]=\"chargement() ? 'true' : null\"\n [disabled]=\"desactive()\"\n [softDisabled]=\"false\"\n [readonly]=\"readonly()\"\n (input)=\"surSaisie($event)\"\n />\n <!-- Boutons REELS (APG, VoiceOver iOS, TalkBack) : `tabindex=\"-1\"`, hors tabulation, la\n fleche bas du clavier ouvre deja la liste depuis le champ. `mousedown.preventDefault`\n garde le focus dans le champ au clic. -->\n <div class=\"st-combobox__actions\">\n @if (afficherEffacer()) {\n <button\n class=\"st-combobox__effacer\"\n stIconButton\n type=\"button\"\n tabindex=\"-1\"\n taille=\"md\"\n tailleDuGlyphe=\"16\"\n icone=\"croix\"\n [etiquette]=\"libelles().effacerLeChoix\"\n (mousedown)=\"$event.preventDefault()\"\n (click)=\"effacer()\"\n ></button>\n }\n <span class=\"st-combobox__bouton\">\n <button\n class=\"st-combobox__ouvrir\"\n stIconButton\n type=\"button\"\n tabindex=\"-1\"\n taille=\"md\"\n tailleDuGlyphe=\"20\"\n icone=\"chevron-bas\"\n [attr.data-ouvert]=\"ouvert() ? '' : null\"\n [attr.data-attente]=\"attenteVisible() ? '' : null\"\n [etiquette]=\"libelles().afficherLesChoix(libelle())\"\n [attr.aria-expanded]=\"ouvert() ? 'true' : 'false'\"\n [attr.aria-controls]=\"idListe\"\n (mousedown)=\"$event.preventDefault()\"\n (click)=\"basculer()\"\n ></button>\n <!-- Distant, reponse attendue : l'indicateur PREND LA PLACE du glyphe, sur le bouton qui\n reste nomme et operant (la liste s'ouvre et se ferme toujours). Decoratif : l'attente\n se dit par `aria-busy`, puis par l'annonce du nombre de resultats. -->\n @if (attenteVisible()) {\n <span class=\"st-combobox__attente\" aria-hidden=\"true\"\n ><st-spinner taille=\"sm\" ton=\"neutre\"\n /></span>\n }\n </span>\n </div>\n </div>\n\n <!-- ⚠️ La primitive de popup ENVELOPPE la surcouche, et non l'inverse (exemple\n de la documentation d'Aria). Enfermee dans la surcouche, elle ne\n s'enregistre qu'a l'ouverture : liste fermee, le champ annonce\n aria-autocomplete=\"none\" et aucun aria-haspopup, et le lecteur d'ecran\n ignore qu'une liste existe. -->\n <ng-template ngComboboxPopup [combobox]=\"combobox\">\n <ng-template\n [cdkConnectedOverlay]=\"{ origin: cadre, usePopover: 'inline', matchWidth: true }\"\n [cdkConnectedOverlayOpen]=\"ouvert()\"\n >\n <div class=\"st-combobox__popup\">\n <!-- En attente, une liste vide n'est pas « Aucun resultat » : la reponse n'est pas encore\n la (une ressource repasse a sa valeur par defaut quand son terme change). -->\n @if (visibles().length === 0) {\n @if (tropCourt()) {\n <p class=\"st-combobox__vide\">{{ libelles().longueurMinimale(longueurMinimale()) }}</p>\n } @else if (!chargement()) {\n <p class=\"st-combobox__vide\">{{ libelles().aucunResultat }}</p>\n } @else if (attenteVisible()) {\n <p class=\"st-combobox__vide\">{{ libelles().chargementEnCours }}</p>\n }\n }\n <div\n #liste=\"ngListbox\"\n [id]=\"idListe\"\n class=\"st-combobox__liste\"\n ngListbox\n ngComboboxWidget\n focusMode=\"activedescendant\"\n [tabindex]=\"-1\"\n [attr.aria-label]=\"libelle()\"\n [attr.aria-busy]=\"chargement() ? 'true' : null\"\n [activeDescendant]=\"liste.activeDescendant()\"\n [(value)]=\"surlignee\"\n (click)=\"surClic($event)\"\n (keydown.enter)=\"valider()\"\n >\n @for (bloc of blocs(); track bloc.cle; let indiceDuBloc = $index) {\n @if (bloc.groupe === null) {\n @for (option of bloc.options; track option.valeur) {\n <div\n class=\"st-combobox__option\"\n ngOption\n [value]=\"option.valeur\"\n [label]=\"affichable(option.libelle)\"\n [disabled]=\"option.desactivee === true\"\n [attr.aria-label]=\"gabaritDOption() ? null : affichable(option.libelle)\"\n [attr.aria-labelledby]=\"\n gabaritDOption() ? idDuContenu(indiceDuBloc, $index) : null\n \"\n [attr.aria-describedby]=\"option.aide ? idDeLAide(indiceDuBloc, $index) : null\"\n >\n <ng-container\n *ngTemplateOutlet=\"\n contenuDOption;\n context: {\n $implicit: option,\n idAide: idDeLAide(indiceDuBloc, $index),\n idContenu: idDuContenu(indiceDuBloc, $index),\n }\n \"\n />\n <st-icon class=\"st-combobox__coche\" nom=\"coche\" taille=\"sm\" />\n </div>\n }\n } @else {\n <div role=\"group\" [attr.aria-labelledby]=\"idDuGroupe(indiceDuBloc)\">\n <p class=\"st-combobox__groupe\" [id]=\"idDuGroupe(indiceDuBloc)\">\n {{ bloc.groupe }}\n </p>\n @for (option of bloc.options; track option.valeur) {\n <div\n class=\"st-combobox__option\"\n ngOption\n [value]=\"option.valeur\"\n [label]=\"affichable(option.libelle)\"\n [disabled]=\"option.desactivee === true\"\n [attr.aria-label]=\"gabaritDOption() ? null : affichable(option.libelle)\"\n [attr.aria-labelledby]=\"\n gabaritDOption() ? idDuContenu(indiceDuBloc, $index) : null\n \"\n [attr.aria-describedby]=\"option.aide ? idDeLAide(indiceDuBloc, $index) : null\"\n >\n <ng-container\n *ngTemplateOutlet=\"\n contenuDOption;\n context: {\n $implicit: option,\n idAide: idDeLAide(indiceDuBloc, $index),\n idContenu: idDuContenu(indiceDuBloc, $index),\n }\n \"\n />\n <st-icon class=\"st-combobox__coche\" nom=\"coche\" taille=\"sm\" />\n </div>\n }\n </div>\n }\n }\n </div>\n </div>\n </ng-template>\n </ng-template>\n</st-form-field>\n\n<!-- Contenu d'une option. Sans gabarit : le libelle et, dessous, l'aide ; le NOM est le libelle\n (`aria-label`), l'aide la description. Avec le gabarit `stOption` : le NOM est le texte que le\n gabarit REND — ce qui se voit est ce qui se lit (WCAG 1.3.1, 2.5.3) — et l'aide reste la\n description. Le gabarit est rendu DEUX fois : la copie visible est `inert` (un element\n interactif glisse dedans ne prend jamais le focus : il reste dans le champ,\n `aria-activedescendant`) ; la copie `hidden` nomme l'option (`aria-labelledby` lit un noeud\n masque, jamais un noeud inerte : vu au banc Chromium). La marque `choisie` suit la coche :\n l'option `aria-selected`, celle qu'Entree retiendrait. -->\n<ng-template #contenuDOption let-option let-idAide=\"idAide\" let-idContenu=\"idContenu\">\n @if (gabaritDOption(); as gabarit) {\n <span class=\"st-combobox__textes\" inert>\n <ng-container\n *ngTemplateOutlet=\"\n gabarit.gabarit;\n context: { $implicit: option, choisie: surlignee().includes(option.valeur) }\n \"\n />\n </span>\n <span [id]=\"idContenu\" hidden>\n <ng-container\n *ngTemplateOutlet=\"\n gabarit.gabarit;\n context: { $implicit: option, choisie: surlignee().includes(option.valeur) }\n \"\n />\n </span>\n @if (option.aide) {\n <span class=\"st-vh\" [id]=\"idAide\">{{ option.aide }}</span>\n }\n } @else {\n <span class=\"st-combobox__textes\">\n <span class=\"st-combobox__libelle\" dir=\"auto\">{{ affichable(option.libelle) }}</span>\n @if (option.aide) {\n <span class=\"st-combobox__aide\" [id]=\"idAide\">{{ option.aide }}</span>\n }\n </span>\n }\n</ng-template>\n<span class=\"st-vh\" aria-live=\"polite\">{{ annonce.texte() }}</span>\n",
320
+ 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-combobox__cadre{--_glyphe: 1.125rem;position:relative}.st-combobox__champ:focus-visible{outline:var(--st-focus-epaisseur) solid var(--st-couleur-anneau-focus);outline-offset:var(--st-focus-decalage);box-shadow:0 0 0 var(--st-focus-lisere) var(--st-couleur-lisere-focus)}.st-combobox__champ{box-sizing:border-box;inline-size:100%;min-block-size:var(--st-commande-hauteur, var(--st-hauteur-commande-defaut))}.st-combobox__champ:is(input,select){block-size:var(--st-commande-hauteur, var(--st-hauteur-commande-defaut))}.st-combobox__champ{--_remplissage-bloc: max( var(--st-espacement-demi), min( var(--st-espacement-2), calc( (var(--st-commande-hauteur, var(--st-hauteur-commande-defaut)) - var(--st-interligne-sm)) / 2 - var(--st-epaisseur-fine) ) ) );padding-block:var(--_remplissage-bloc);padding-inline:var(--st-espacement-3-5);font-family:inherit;font-size:var(--st-taille-sm);font-weight:var(--st-graisse-normale);line-height:var(--st-interligne-sm);color:var(--st-couleur-texte);background:var(--st-couleur-surface);border:var(--st-epaisseur-fine) solid var(--st-couleur-bordure-forte);border-radius:var(--st-commande-rayon, var(--st-rayon-md))}@media(pointer:coarse){.st-combobox__champ{--_remplissage-bloc: max( var(--st-espacement-demi), min( var(--st-espacement-2), calc( ( var(--st-commande-hauteur, var(--st-hauteur-commande-defaut)) - var( --st-interligne-md ) ) / 2 - var(--st-epaisseur-fine) ) ) );font-size:var(--st-taille-md);line-height:var(--st-interligne-md)}}.st-combobox__champ::placeholder{color:var(--st-couleur-texte-attenue);opacity:1}@media(hover:hover){.st-combobox__champ:hover:not(:disabled,:focus,[aria-invalid=true]){border-color:var(--st-couleur-texte-discret);transition:border-color var(--st-duree-rapide) var(--st-courbe-standard)}}.st-combobox__champ:focus-visible{border-color:var(--st-couleur-primaire)}.st-combobox__champ[aria-invalid=true]{border-color:var(--st-couleur-danger);box-shadow:inset 0 0 0 var(--st-epaisseur-fine) var(--st-couleur-danger)}.st-combobox__champ[aria-invalid=true]:focus-visible{outline:var(--st-focus-epaisseur) solid var(--st-couleur-anneau-focus);outline-offset:var(--st-focus-decalage);box-shadow:0 0 0 var(--st-focus-lisere) var(--st-couleur-lisere-focus),inset 0 0 0 var(--st-epaisseur-fine) var(--st-couleur-danger)}.st-combobox__champ:disabled{color:var(--st-couleur-texte-desactive);cursor:not-allowed;background:var(--st-couleur-surface);border-color:var(--st-couleur-bordure)}.st-combobox__champ:disabled::placeholder{color:var(--st-couleur-texte-desactive)}.st-combobox__champ:is(input,textarea):read-only:not(:disabled),.st-combobox__champ[aria-readonly=true]:not(:disabled){font-weight:var(--st-graisse-moyenne);background:var(--st-couleur-surface-enfoncee)}.st-combobox__champ{padding-inline-end:var(--st-cible-tactile-min)}.st-combobox__champ[data-effacable]{padding-inline-end:calc(var(--st-cible-tactile-min) * 2)}.st-combobox__champ[data-icone]{padding-inline-start:calc(var(--st-espacement-3) + var(--_glyphe) + var(--st-espacement-1-5))}.st-combobox__champ[data-choisi]{font-weight:var(--st-graisse-semi)}.st-combobox__icone{position:absolute;inset-block-start:50%;inset-inline-start:var(--st-espacement-3);color:var(--st-couleur-texte-attenue);pointer-events:none;translate:0 -50%}.st-combobox__cadre:has(.st-combobox__champ:disabled) .st-combobox__icone{color:var(--st-couleur-texte-desactive)}.st-combobox__actions{position:absolute;inset-block:0;inset-inline-end:0;display:flex;align-items:center}.st-combobox__effacer,.st-combobox__ouvrir{color:var(--st-couleur-texte-discret)}.st-combobox__bouton{display:grid}.st-combobox__bouton>*{grid-area:1/1}.st-combobox__attente{display:inline-flex;place-self:center;pointer-events:none}.st-combobox__ouvrir[data-attente] ::ng-deep st-icon{visibility:hidden}.st-combobox__ouvrir[data-ouvert]{rotate:180deg}.st-combobox__cadre:has(.st-combobox__champ:disabled) .st-combobox__actions,.st-combobox__cadre:has(.st-combobox__champ:read-only) .st-combobox__actions{display:none}.st-combobox__popup{box-sizing:border-box;inline-size:100%;max-block-size:var(--st-liste-hauteur-max, 18rem);padding-block:var(--st-espacement-1);overflow-y:auto;color:var(--st-couleur-texte);background:var(--st-couleur-surface-elevee);border:var(--st-epaisseur-fine) solid var(--st-couleur-bordure);border-radius:var(--st-rayon-md);box-shadow:var(--st-ombre-surelevee);transition:opacity var(--st-duree-normale) linear,translate var(--st-duree-normale) var(--st-courbe-entrant)}@starting-style{.st-combobox__popup{opacity:0;translate:0 calc(-1 * var(--st-deplacement-court))}}.st-combobox__vide{padding:var(--st-espacement-2) var(--st-espacement-3);margin:0;color:var(--st-couleur-texte-discret)}.st-combobox__groupe{font-size:var(--st-taille-xs);line-height:var(--st-interligne-xs);font-weight:var(--st-graisse-moyenne);letter-spacing:var(--st-interlettrage-large);padding:var(--st-espacement-2) var(--st-espacement-3) var(--st-espacement-1);margin:0;color:var(--st-couleur-texte-discret)}.st-combobox__option{box-sizing:border-box;display:flex;gap:var(--st-espacement-2);align-items:center;justify-content:space-between;min-block-size:var(--st-cible-tactile-min);padding:var(--st-espacement-2) var(--st-espacement-3);margin-inline:var(--st-espacement-1);border-radius:var(--st-rayon-sm);cursor:pointer}@media(hover:hover){.st-combobox__option:hover:not([aria-disabled=true]){background:var(--st-couleur-surface-survol-elevee)}}.st-combobox__option[aria-disabled=true]{color:var(--st-couleur-texte-desactive);cursor:not-allowed}.st-combobox__option[aria-selected=true]{font-weight:var(--st-graisse-semi);background:var(--st-couleur-surface-selection)}.st-combobox__option[data-active=true]{outline:var(--st-focus-epaisseur) solid var(--st-couleur-anneau-focus);outline-offset:calc(-1 * var(--st-focus-epaisseur));background:var(--st-couleur-surface-survol-elevee)}.st-combobox__option:active:not([aria-disabled=true]){background:var(--st-couleur-surface-active)}.st-combobox__textes{display:flex;flex-direction:column;min-inline-size:0}.st-combobox__aide{font-size:var(--st-taille-sm);line-height:var(--st-interligne-sm);letter-spacing:var(--st-interlettrage-normal);font-weight:var(--st-graisse-normale);color:var(--st-couleur-texte-discret)}[aria-disabled=true] .st-combobox__aide{color:var(--st-couleur-texte-desactive)}.st-combobox__coche{visibility:hidden}[aria-selected=true]>.st-combobox__coche{visibility:visible}\n"],
321
+ dependencies: [
322
+ {
323
+ kind: "component",
324
+ type: StFormField,
325
+ selector: "st-form-field",
326
+ inputs: [
327
+ "libelle",
328
+ "complement",
329
+ "disposition",
330
+ "presentation",
331
+ "libelleMasque",
332
+ "descriptionsDuControle"
333
+ ]
334
+ },
335
+ {
336
+ kind: "directive",
337
+ type: StControleDeChamp,
338
+ selector: "[stControleDeChamp]"
339
+ },
340
+ {
341
+ kind: "component",
342
+ type: StIcon,
343
+ selector: "st-icon",
344
+ inputs: [
345
+ "icone",
346
+ "nom",
347
+ "variante",
348
+ "sprite",
349
+ "nomMetier",
350
+ "taille",
351
+ "ton",
352
+ "etiquette",
353
+ "miroir"
354
+ ]
355
+ },
356
+ {
357
+ kind: "component",
358
+ type: StIconButton,
359
+ selector: "button[stIconButton]",
360
+ inputs: [
361
+ "icone",
362
+ "etiquette",
363
+ "variante",
364
+ "taille",
365
+ "tailleDuGlyphe",
366
+ "enfonce",
367
+ "iconeEnfoncee",
368
+ "chargement",
369
+ "indisponible",
370
+ "raisonIndisponible"
371
+ ]
372
+ },
373
+ {
374
+ kind: "component",
375
+ type: StSpinner,
376
+ selector: "st-spinner",
377
+ inputs: [
378
+ "taille",
379
+ "ton",
380
+ "etiquette",
381
+ "icone"
382
+ ]
383
+ },
384
+ {
385
+ kind: "directive",
386
+ type: NgTemplateOutlet,
387
+ selector: "[ngTemplateOutlet]",
388
+ inputs: [
389
+ "ngTemplateOutletContext",
390
+ "ngTemplateOutlet",
391
+ "ngTemplateOutletInjector"
392
+ ]
393
+ },
394
+ {
395
+ kind: "directive",
396
+ type: Combobox,
397
+ selector: "[ngCombobox]",
398
+ inputs: [
399
+ "disabled",
400
+ "readonly",
401
+ "softDisabled",
402
+ "alwaysExpanded",
403
+ "tabindex",
404
+ "expanded",
405
+ "value",
406
+ "inlineSuggestion"
407
+ ],
408
+ outputs: ["expandedChange", "valueChange"],
409
+ exportAs: ["ngCombobox"]
410
+ },
411
+ {
412
+ kind: "directive",
413
+ type: ComboboxPopup,
414
+ selector: "ng-template[ngComboboxPopup]",
415
+ inputs: ["combobox", "popupType"],
416
+ exportAs: ["ngComboboxPopup"]
417
+ },
418
+ {
419
+ kind: "directive",
420
+ type: ComboboxWidget,
421
+ selector: "[ngComboboxWidget]",
422
+ inputs: ["activeDescendant"],
423
+ exportAs: ["ngComboboxWidget"]
424
+ },
425
+ {
426
+ kind: "directive",
427
+ type: Listbox,
428
+ selector: "[ngListbox]",
429
+ inputs: [
430
+ "id",
431
+ "orientation",
432
+ "multi",
433
+ "wrap",
434
+ "softDisabled",
435
+ "focusMode",
436
+ "selectionMode",
437
+ "typeaheadDelay",
438
+ "disabled",
439
+ "readonly",
440
+ "tabindex",
441
+ "value"
442
+ ],
443
+ outputs: ["valueChange"],
444
+ exportAs: ["ngListbox"]
445
+ },
446
+ {
447
+ kind: "directive",
448
+ type: Option,
449
+ selector: "[ngOption]",
450
+ inputs: [
451
+ "id",
452
+ "value",
453
+ "disabled",
454
+ "label"
455
+ ],
456
+ exportAs: ["ngOption"]
457
+ },
458
+ {
459
+ kind: "directive",
460
+ type: CdkConnectedOverlay,
461
+ selector: "[cdk-connected-overlay], [connected-overlay], [cdkConnectedOverlay]",
462
+ inputs: [
463
+ "cdkConnectedOverlayOrigin",
464
+ "cdkConnectedOverlayPositions",
465
+ "cdkConnectedOverlayPositionStrategy",
466
+ "cdkConnectedOverlayOffsetX",
467
+ "cdkConnectedOverlayOffsetY",
468
+ "cdkConnectedOverlayWidth",
469
+ "cdkConnectedOverlayHeight",
470
+ "cdkConnectedOverlayMinWidth",
471
+ "cdkConnectedOverlayMinHeight",
472
+ "cdkConnectedOverlayBackdropClass",
473
+ "cdkConnectedOverlayPanelClass",
474
+ "cdkConnectedOverlayViewportMargin",
475
+ "cdkConnectedOverlayScrollStrategy",
476
+ "cdkConnectedOverlayOpen",
477
+ "cdkConnectedOverlayDisableClose",
478
+ "cdkConnectedOverlayTransformOriginOn",
479
+ "cdkConnectedOverlayHasBackdrop",
480
+ "cdkConnectedOverlayLockPosition",
481
+ "cdkConnectedOverlayFlexibleDimensions",
482
+ "cdkConnectedOverlayGrowAfterOpen",
483
+ "cdkConnectedOverlayPush",
484
+ "cdkConnectedOverlayDisposeOnNavigation",
485
+ "cdkConnectedOverlayUsePopover",
486
+ "cdkConnectedOverlayMatchWidth",
487
+ "cdkConnectedOverlay"
488
+ ],
489
+ outputs: [
490
+ "backdropClick",
491
+ "positionChange",
492
+ "attach",
493
+ "detach",
494
+ "overlayKeydown",
495
+ "overlayOutsideClick"
496
+ ],
497
+ exportAs: ["cdkConnectedOverlay"]
498
+ }
499
+ ],
500
+ changeDetection: i0.ChangeDetectionStrategy.OnPush
501
+ });
502
+ };
503
+ i0.ɵɵngDeclareClassMetadata({
504
+ minVersion: "12.0.0",
505
+ version: "22.2.0",
506
+ ngImport: i0,
507
+ type: StCombobox,
508
+ decorators: [{
509
+ type: Component,
510
+ args: [{
511
+ selector: "st-combobox",
512
+ changeDetection: ChangeDetectionStrategy.OnPush,
513
+ imports: [
514
+ StFormField,
515
+ StControleDeChamp,
516
+ StIcon,
517
+ StIconButton,
518
+ StSpinner,
519
+ NgTemplateOutlet,
520
+ Combobox,
521
+ ComboboxPopup,
522
+ ComboboxWidget,
523
+ Listbox,
524
+ Option,
525
+ CdkConnectedOverlay
526
+ ],
527
+ host: {
528
+ class: "st-combobox",
529
+ "(focusout)": "aLaSortie($event)"
530
+ },
531
+ template: "<st-form-field\n [libelle]=\"libelle()\"\n [aide]=\"aide()\"\n [erreurs]=\"errors()\"\n [afficherErreurs]=\"touched()\"\n [obligatoire]=\"required()\"\n [presentation]=\"presentation()\"\n>\n <div #cadre class=\"st-combobox__cadre\">\n @if (icone(); as nom) {\n <st-icon class=\"st-combobox__icone\" [nom]=\"nom\" taille=\"18\" />\n }\n <input\n #champ\n #combobox=\"ngCombobox\"\n class=\"st-combobox__champ\"\n stControleDeChamp\n ngCombobox\n type=\"text\"\n autocomplete=\"off\"\n spellcheck=\"false\"\n [(value)]=\"texte\"\n [(expanded)]=\"ouvert\"\n [attr.name]=\"name() || null\"\n [attr.data-effacable]=\"afficherEffacer() ? '' : null\"\n [attr.data-icone]=\"icone() ? '' : null\"\n [attr.data-choisi]=\"choixAffiche() ? '' : null\"\n [attr.aria-busy]=\"chargement() ? 'true' : null\"\n [disabled]=\"desactive()\"\n [softDisabled]=\"false\"\n [readonly]=\"readonly()\"\n (input)=\"surSaisie($event)\"\n />\n <!-- Boutons REELS (APG, VoiceOver iOS, TalkBack) : `tabindex=\"-1\"`, hors tabulation, la\n fleche bas du clavier ouvre deja la liste depuis le champ. `mousedown.preventDefault`\n garde le focus dans le champ au clic. -->\n <div class=\"st-combobox__actions\">\n @if (afficherEffacer()) {\n <button\n class=\"st-combobox__effacer\"\n stIconButton\n type=\"button\"\n tabindex=\"-1\"\n taille=\"md\"\n tailleDuGlyphe=\"16\"\n icone=\"croix\"\n [etiquette]=\"libelles().effacerLeChoix\"\n (mousedown)=\"$event.preventDefault()\"\n (click)=\"effacer()\"\n ></button>\n }\n <span class=\"st-combobox__bouton\">\n <button\n class=\"st-combobox__ouvrir\"\n stIconButton\n type=\"button\"\n tabindex=\"-1\"\n taille=\"md\"\n tailleDuGlyphe=\"20\"\n icone=\"chevron-bas\"\n [attr.data-ouvert]=\"ouvert() ? '' : null\"\n [attr.data-attente]=\"attenteVisible() ? '' : null\"\n [etiquette]=\"libelles().afficherLesChoix(libelle())\"\n [attr.aria-expanded]=\"ouvert() ? 'true' : 'false'\"\n [attr.aria-controls]=\"idListe\"\n (mousedown)=\"$event.preventDefault()\"\n (click)=\"basculer()\"\n ></button>\n <!-- Distant, reponse attendue : l'indicateur PREND LA PLACE du glyphe, sur le bouton qui\n reste nomme et operant (la liste s'ouvre et se ferme toujours). Decoratif : l'attente\n se dit par `aria-busy`, puis par l'annonce du nombre de resultats. -->\n @if (attenteVisible()) {\n <span class=\"st-combobox__attente\" aria-hidden=\"true\"\n ><st-spinner taille=\"sm\" ton=\"neutre\"\n /></span>\n }\n </span>\n </div>\n </div>\n\n <!-- ⚠️ La primitive de popup ENVELOPPE la surcouche, et non l'inverse (exemple\n de la documentation d'Aria). Enfermee dans la surcouche, elle ne\n s'enregistre qu'a l'ouverture : liste fermee, le champ annonce\n aria-autocomplete=\"none\" et aucun aria-haspopup, et le lecteur d'ecran\n ignore qu'une liste existe. -->\n <ng-template ngComboboxPopup [combobox]=\"combobox\">\n <ng-template\n [cdkConnectedOverlay]=\"{ origin: cadre, usePopover: 'inline', matchWidth: true }\"\n [cdkConnectedOverlayOpen]=\"ouvert()\"\n >\n <div class=\"st-combobox__popup\">\n <!-- En attente, une liste vide n'est pas « Aucun resultat » : la reponse n'est pas encore\n la (une ressource repasse a sa valeur par defaut quand son terme change). -->\n @if (visibles().length === 0) {\n @if (tropCourt()) {\n <p class=\"st-combobox__vide\">{{ libelles().longueurMinimale(longueurMinimale()) }}</p>\n } @else if (!chargement()) {\n <p class=\"st-combobox__vide\">{{ libelles().aucunResultat }}</p>\n } @else if (attenteVisible()) {\n <p class=\"st-combobox__vide\">{{ libelles().chargementEnCours }}</p>\n }\n }\n <div\n #liste=\"ngListbox\"\n [id]=\"idListe\"\n class=\"st-combobox__liste\"\n ngListbox\n ngComboboxWidget\n focusMode=\"activedescendant\"\n [tabindex]=\"-1\"\n [attr.aria-label]=\"libelle()\"\n [attr.aria-busy]=\"chargement() ? 'true' : null\"\n [activeDescendant]=\"liste.activeDescendant()\"\n [(value)]=\"surlignee\"\n (click)=\"surClic($event)\"\n (keydown.enter)=\"valider()\"\n >\n @for (bloc of blocs(); track bloc.cle; let indiceDuBloc = $index) {\n @if (bloc.groupe === null) {\n @for (option of bloc.options; track option.valeur) {\n <div\n class=\"st-combobox__option\"\n ngOption\n [value]=\"option.valeur\"\n [label]=\"affichable(option.libelle)\"\n [disabled]=\"option.desactivee === true\"\n [attr.aria-label]=\"gabaritDOption() ? null : affichable(option.libelle)\"\n [attr.aria-labelledby]=\"\n gabaritDOption() ? idDuContenu(indiceDuBloc, $index) : null\n \"\n [attr.aria-describedby]=\"option.aide ? idDeLAide(indiceDuBloc, $index) : null\"\n >\n <ng-container\n *ngTemplateOutlet=\"\n contenuDOption;\n context: {\n $implicit: option,\n idAide: idDeLAide(indiceDuBloc, $index),\n idContenu: idDuContenu(indiceDuBloc, $index),\n }\n \"\n />\n <st-icon class=\"st-combobox__coche\" nom=\"coche\" taille=\"sm\" />\n </div>\n }\n } @else {\n <div role=\"group\" [attr.aria-labelledby]=\"idDuGroupe(indiceDuBloc)\">\n <p class=\"st-combobox__groupe\" [id]=\"idDuGroupe(indiceDuBloc)\">\n {{ bloc.groupe }}\n </p>\n @for (option of bloc.options; track option.valeur) {\n <div\n class=\"st-combobox__option\"\n ngOption\n [value]=\"option.valeur\"\n [label]=\"affichable(option.libelle)\"\n [disabled]=\"option.desactivee === true\"\n [attr.aria-label]=\"gabaritDOption() ? null : affichable(option.libelle)\"\n [attr.aria-labelledby]=\"\n gabaritDOption() ? idDuContenu(indiceDuBloc, $index) : null\n \"\n [attr.aria-describedby]=\"option.aide ? idDeLAide(indiceDuBloc, $index) : null\"\n >\n <ng-container\n *ngTemplateOutlet=\"\n contenuDOption;\n context: {\n $implicit: option,\n idAide: idDeLAide(indiceDuBloc, $index),\n idContenu: idDuContenu(indiceDuBloc, $index),\n }\n \"\n />\n <st-icon class=\"st-combobox__coche\" nom=\"coche\" taille=\"sm\" />\n </div>\n }\n </div>\n }\n }\n </div>\n </div>\n </ng-template>\n </ng-template>\n</st-form-field>\n\n<!-- Contenu d'une option. Sans gabarit : le libelle et, dessous, l'aide ; le NOM est le libelle\n (`aria-label`), l'aide la description. Avec le gabarit `stOption` : le NOM est le texte que le\n gabarit REND — ce qui se voit est ce qui se lit (WCAG 1.3.1, 2.5.3) — et l'aide reste la\n description. Le gabarit est rendu DEUX fois : la copie visible est `inert` (un element\n interactif glisse dedans ne prend jamais le focus : il reste dans le champ,\n `aria-activedescendant`) ; la copie `hidden` nomme l'option (`aria-labelledby` lit un noeud\n masque, jamais un noeud inerte : vu au banc Chromium). La marque `choisie` suit la coche :\n l'option `aria-selected`, celle qu'Entree retiendrait. -->\n<ng-template #contenuDOption let-option let-idAide=\"idAide\" let-idContenu=\"idContenu\">\n @if (gabaritDOption(); as gabarit) {\n <span class=\"st-combobox__textes\" inert>\n <ng-container\n *ngTemplateOutlet=\"\n gabarit.gabarit;\n context: { $implicit: option, choisie: surlignee().includes(option.valeur) }\n \"\n />\n </span>\n <span [id]=\"idContenu\" hidden>\n <ng-container\n *ngTemplateOutlet=\"\n gabarit.gabarit;\n context: { $implicit: option, choisie: surlignee().includes(option.valeur) }\n \"\n />\n </span>\n @if (option.aide) {\n <span class=\"st-vh\" [id]=\"idAide\">{{ option.aide }}</span>\n }\n } @else {\n <span class=\"st-combobox__textes\">\n <span class=\"st-combobox__libelle\" dir=\"auto\">{{ affichable(option.libelle) }}</span>\n @if (option.aide) {\n <span class=\"st-combobox__aide\" [id]=\"idAide\">{{ option.aide }}</span>\n }\n </span>\n }\n</ng-template>\n<span class=\"st-vh\" aria-live=\"polite\">{{ annonce.texte() }}</span>\n",
532
+ 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-combobox__cadre{--_glyphe: 1.125rem;position:relative}.st-combobox__champ:focus-visible{outline:var(--st-focus-epaisseur) solid var(--st-couleur-anneau-focus);outline-offset:var(--st-focus-decalage);box-shadow:0 0 0 var(--st-focus-lisere) var(--st-couleur-lisere-focus)}.st-combobox__champ{box-sizing:border-box;inline-size:100%;min-block-size:var(--st-commande-hauteur, var(--st-hauteur-commande-defaut))}.st-combobox__champ:is(input,select){block-size:var(--st-commande-hauteur, var(--st-hauteur-commande-defaut))}.st-combobox__champ{--_remplissage-bloc: max( var(--st-espacement-demi), min( var(--st-espacement-2), calc( (var(--st-commande-hauteur, var(--st-hauteur-commande-defaut)) - var(--st-interligne-sm)) / 2 - var(--st-epaisseur-fine) ) ) );padding-block:var(--_remplissage-bloc);padding-inline:var(--st-espacement-3-5);font-family:inherit;font-size:var(--st-taille-sm);font-weight:var(--st-graisse-normale);line-height:var(--st-interligne-sm);color:var(--st-couleur-texte);background:var(--st-couleur-surface);border:var(--st-epaisseur-fine) solid var(--st-couleur-bordure-forte);border-radius:var(--st-commande-rayon, var(--st-rayon-md))}@media(pointer:coarse){.st-combobox__champ{--_remplissage-bloc: max( var(--st-espacement-demi), min( var(--st-espacement-2), calc( ( var(--st-commande-hauteur, var(--st-hauteur-commande-defaut)) - var( --st-interligne-md ) ) / 2 - var(--st-epaisseur-fine) ) ) );font-size:var(--st-taille-md);line-height:var(--st-interligne-md)}}.st-combobox__champ::placeholder{color:var(--st-couleur-texte-attenue);opacity:1}@media(hover:hover){.st-combobox__champ:hover:not(:disabled,:focus,[aria-invalid=true]){border-color:var(--st-couleur-texte-discret);transition:border-color var(--st-duree-rapide) var(--st-courbe-standard)}}.st-combobox__champ:focus-visible{border-color:var(--st-couleur-primaire)}.st-combobox__champ[aria-invalid=true]{border-color:var(--st-couleur-danger);box-shadow:inset 0 0 0 var(--st-epaisseur-fine) var(--st-couleur-danger)}.st-combobox__champ[aria-invalid=true]:focus-visible{outline:var(--st-focus-epaisseur) solid var(--st-couleur-anneau-focus);outline-offset:var(--st-focus-decalage);box-shadow:0 0 0 var(--st-focus-lisere) var(--st-couleur-lisere-focus),inset 0 0 0 var(--st-epaisseur-fine) var(--st-couleur-danger)}.st-combobox__champ:disabled{color:var(--st-couleur-texte-desactive);cursor:not-allowed;background:var(--st-couleur-surface);border-color:var(--st-couleur-bordure)}.st-combobox__champ:disabled::placeholder{color:var(--st-couleur-texte-desactive)}.st-combobox__champ:is(input,textarea):read-only:not(:disabled),.st-combobox__champ[aria-readonly=true]:not(:disabled){font-weight:var(--st-graisse-moyenne);background:var(--st-couleur-surface-enfoncee)}.st-combobox__champ{padding-inline-end:var(--st-cible-tactile-min)}.st-combobox__champ[data-effacable]{padding-inline-end:calc(var(--st-cible-tactile-min) * 2)}.st-combobox__champ[data-icone]{padding-inline-start:calc(var(--st-espacement-3) + var(--_glyphe) + var(--st-espacement-1-5))}.st-combobox__champ[data-choisi]{font-weight:var(--st-graisse-semi)}.st-combobox__icone{position:absolute;inset-block-start:50%;inset-inline-start:var(--st-espacement-3);color:var(--st-couleur-texte-attenue);pointer-events:none;translate:0 -50%}.st-combobox__cadre:has(.st-combobox__champ:disabled) .st-combobox__icone{color:var(--st-couleur-texte-desactive)}.st-combobox__actions{position:absolute;inset-block:0;inset-inline-end:0;display:flex;align-items:center}.st-combobox__effacer,.st-combobox__ouvrir{color:var(--st-couleur-texte-discret)}.st-combobox__bouton{display:grid}.st-combobox__bouton>*{grid-area:1/1}.st-combobox__attente{display:inline-flex;place-self:center;pointer-events:none}.st-combobox__ouvrir[data-attente] ::ng-deep st-icon{visibility:hidden}.st-combobox__ouvrir[data-ouvert]{rotate:180deg}.st-combobox__cadre:has(.st-combobox__champ:disabled) .st-combobox__actions,.st-combobox__cadre:has(.st-combobox__champ:read-only) .st-combobox__actions{display:none}.st-combobox__popup{box-sizing:border-box;inline-size:100%;max-block-size:var(--st-liste-hauteur-max, 18rem);padding-block:var(--st-espacement-1);overflow-y:auto;color:var(--st-couleur-texte);background:var(--st-couleur-surface-elevee);border:var(--st-epaisseur-fine) solid var(--st-couleur-bordure);border-radius:var(--st-rayon-md);box-shadow:var(--st-ombre-surelevee);transition:opacity var(--st-duree-normale) linear,translate var(--st-duree-normale) var(--st-courbe-entrant)}@starting-style{.st-combobox__popup{opacity:0;translate:0 calc(-1 * var(--st-deplacement-court))}}.st-combobox__vide{padding:var(--st-espacement-2) var(--st-espacement-3);margin:0;color:var(--st-couleur-texte-discret)}.st-combobox__groupe{font-size:var(--st-taille-xs);line-height:var(--st-interligne-xs);font-weight:var(--st-graisse-moyenne);letter-spacing:var(--st-interlettrage-large);padding:var(--st-espacement-2) var(--st-espacement-3) var(--st-espacement-1);margin:0;color:var(--st-couleur-texte-discret)}.st-combobox__option{box-sizing:border-box;display:flex;gap:var(--st-espacement-2);align-items:center;justify-content:space-between;min-block-size:var(--st-cible-tactile-min);padding:var(--st-espacement-2) var(--st-espacement-3);margin-inline:var(--st-espacement-1);border-radius:var(--st-rayon-sm);cursor:pointer}@media(hover:hover){.st-combobox__option:hover:not([aria-disabled=true]){background:var(--st-couleur-surface-survol-elevee)}}.st-combobox__option[aria-disabled=true]{color:var(--st-couleur-texte-desactive);cursor:not-allowed}.st-combobox__option[aria-selected=true]{font-weight:var(--st-graisse-semi);background:var(--st-couleur-surface-selection)}.st-combobox__option[data-active=true]{outline:var(--st-focus-epaisseur) solid var(--st-couleur-anneau-focus);outline-offset:calc(-1 * var(--st-focus-epaisseur));background:var(--st-couleur-surface-survol-elevee)}.st-combobox__option:active:not([aria-disabled=true]){background:var(--st-couleur-surface-active)}.st-combobox__textes{display:flex;flex-direction:column;min-inline-size:0}.st-combobox__aide{font-size:var(--st-taille-sm);line-height:var(--st-interligne-sm);letter-spacing:var(--st-interlettrage-normal);font-weight:var(--st-graisse-normale);color:var(--st-couleur-texte-discret)}[aria-disabled=true] .st-combobox__aide{color:var(--st-couleur-texte-desactive)}.st-combobox__coche{visibility:hidden}[aria-selected=true]>.st-combobox__coche{visibility:visible}\n"]
533
+ }]
534
+ }],
535
+ ctorParameters: () => [],
536
+ propDecorators: {
537
+ options: [{
538
+ type: i0.Input,
539
+ args: [{
540
+ isSignal: true,
541
+ alias: "options",
542
+ required: true
543
+ }]
544
+ }],
545
+ filtrage: [{
546
+ type: i0.Input,
547
+ args: [{
548
+ isSignal: true,
549
+ alias: "filtrage",
550
+ required: false
551
+ }]
552
+ }],
553
+ icone: [{
554
+ type: i0.Input,
555
+ args: [{
556
+ isSignal: true,
557
+ alias: "icone",
558
+ required: false
559
+ }]
560
+ }],
561
+ presentation: [{
562
+ type: i0.Input,
563
+ args: [{
564
+ isSignal: true,
565
+ alias: "presentation",
566
+ required: false
567
+ }]
568
+ }],
569
+ chargement: [{
570
+ type: i0.Input,
571
+ args: [{
572
+ isSignal: true,
573
+ alias: "chargement",
574
+ required: false
575
+ }]
576
+ }],
577
+ effacable: [{
578
+ type: i0.Input,
579
+ args: [{
580
+ isSignal: true,
581
+ alias: "effacable",
582
+ required: false
583
+ }]
584
+ }],
585
+ temporisationEnMs: [{
586
+ type: i0.Input,
587
+ args: [{
588
+ isSignal: true,
589
+ alias: "temporisationEnMs",
590
+ required: false
591
+ }]
592
+ }],
593
+ longueurMinimale: [{
594
+ type: i0.Input,
595
+ args: [{
596
+ isSignal: true,
597
+ alias: "longueurMinimale",
598
+ required: false
599
+ }]
600
+ }],
601
+ recherche: [{
602
+ type: i0.Output,
603
+ args: ["recherche"]
604
+ }],
605
+ gabaritDOption: [{
606
+ type: i0.ContentChild,
607
+ args: [i0.forwardRef(() => StOption), { isSignal: true }]
608
+ }],
609
+ liste: [{
610
+ type: i0.ViewChild,
611
+ args: [i0.forwardRef(() => Listbox), { isSignal: true }]
612
+ }],
613
+ champNatif: [{
614
+ type: i0.ViewChild,
615
+ args: ["champ", { isSignal: true }]
616
+ }]
617
+ }
618
+ });
619
+ var StMultiselect = class StMultiselect extends ContratDeChamp {
620
+ affichable = sansCommandesDeDirection;
621
+ libelles = inject(ST_LIBELLES);
622
+ locale = inject(ST_LOCALE);
623
+ element = inject(ElementRef);
624
+ injecteur = inject(Injector);
625
+ value = model([], ...ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []);
626
+ options = input.required(...ngDevMode ? [{ debugName: "options" }] : /* istanbul ignore next */ []);
627
+ modeDeResume = input("auto", ...ngDevMode ? [{ debugName: "modeDeResume" }] : /* istanbul ignore next */ []);
628
+ toutRetirer = input(true, {
629
+ ...ngDevMode ? { debugName: "toutRetirer" } : /* istanbul ignore next */ {},
630
+ transform: booleanAttribute
631
+ });
632
+ puces = input(true, {
633
+ ...ngDevMode ? { debugName: "puces" } : /* istanbul ignore next */ {},
634
+ transform: booleanAttribute
635
+ });
636
+ annonce = new AnnonceLocale(inject(DestroyRef));
637
+ ouvert = signal(false, ...ngDevMode ? [{ debugName: "ouvert" }] : /* istanbul ignore next */ []);
638
+ liste = viewChild(Listbox, ...ngDevMode ? [{ debugName: "liste" }] : /* istanbul ignore next */ []);
639
+ idListe = inject(StIdentifiants).prochain("st-multiselect-liste");
640
+ valeursDeListe = computed(() => [...this.value()], ...ngDevMode ? [{ debugName: "valeursDeListe" }] : /* istanbul ignore next */ []);
641
+ choisies = computed(() => {
642
+ const valeurs = new Set(this.value());
643
+ return this.options().filter((option) => valeurs.has(option.valeur));
644
+ }, ...ngDevMode ? [{ debugName: "choisies" }] : /* istanbul ignore next */ []);
645
+ blocs = computed(() => groupesDOptions(this.options()), ...ngDevMode ? [{ debugName: "blocs" }] : /* istanbul ignore next */ []);
646
+ resume = computed(() => {
647
+ const choisies = this.choisies();
648
+ const libelles = this.libelles();
649
+ if (choisies.length === 0) return [{
650
+ texte: libelles.choisir,
651
+ libelle: false
652
+ }];
653
+ const mode = this.modeDeResume();
654
+ if (mode === "nombre" || mode === "auto" && choisies.length > 3) return [{
655
+ texte: libelles.nombreDeSelections(choisies.length),
656
+ libelle: false
657
+ }];
658
+ return new Intl.ListFormat(this.locale(), { type: "conjunction" }).formatToParts(choisies.map((option) => sansCommandesDeDirection(option.libelle))).map((partie) => ({
659
+ texte: partie.value,
660
+ libelle: partie.type === "element"
661
+ }));
662
+ }, ...ngDevMode ? [{ debugName: "resume" }] : /* istanbul ignore next */ []);
663
+ constructor() {
664
+ super();
665
+ afterRenderEffect(() => {
666
+ if (this.ouvert()) this.liste()?.scrollActiveItemIntoView({ block: "nearest" });
667
+ });
668
+ }
669
+ focus(options) {
670
+ this.element.nativeElement.querySelector("[ngCombobox]")?.focus(options);
671
+ }
672
+ surChoix(valeurs) {
673
+ if (this.readonly()) return;
674
+ const precedentes = new Set(this.value());
675
+ const suivantes = new Set(valeurs);
676
+ const ajoutee = valeurs.find((valeur) => !precedentes.has(valeur));
677
+ const retiree = this.value().find((valeur) => !suivantes.has(valeur));
678
+ const bascule = ajoutee ?? retiree;
679
+ const retenues = this.options().filter((option) => suivantes.has(option.valeur)).map((option) => option.valeur);
680
+ this.value.set(retenues);
681
+ if (bascule === void 0) return;
682
+ const option = this.options().find((candidate) => candidate.valeur === bascule);
683
+ if (option === void 0) return;
684
+ this.annonce.annoncer(this.libelles().choixBascule(sansCommandesDeDirection(option.libelle), ajoutee !== void 0, retenues.length));
685
+ }
686
+ retirer(valeur, indice) {
687
+ const restantes = this.value().filter((choisie) => choisie !== valeur);
688
+ this.value.set(restantes);
689
+ this.annonce.annoncer(this.libelles().nombreDeSelections(restantes.length));
690
+ afterNextRender(() => {
691
+ const boutons = this.element.nativeElement.querySelectorAll(".st-multiselect__retrait");
692
+ const suivant = boutons[Math.min(indice, boutons.length - 1)];
693
+ if (suivant !== void 0) suivant.focus();
694
+ else this.focus();
695
+ }, { injector: this.injecteur });
696
+ }
697
+ retirerTout() {
698
+ this.value.set([]);
699
+ this.annonce.annoncer(this.libelles().nombreDeSelections(0));
700
+ this.focus();
701
+ }
702
+ aLaSortie(evenement) {
703
+ const suivant = evenement.relatedTarget;
704
+ if (suivant !== null && this.element.nativeElement.contains(suivant)) return;
705
+ this.touch.emit();
706
+ }
707
+ idDuGroupe(indice) {
708
+ return `${this.idListe}-groupe-${indice.toString()}`;
709
+ }
710
+ static ɵfac = i0.ɵɵngDeclareFactory({
711
+ minVersion: "12.0.0",
712
+ version: "22.2.0",
713
+ ngImport: i0,
714
+ type: StMultiselect,
715
+ deps: [],
716
+ target: i0.ɵɵFactoryTarget.Component
717
+ });
718
+ static ɵcmp = i0.ɵɵngDeclareComponent({
719
+ minVersion: "17.0.0",
720
+ version: "22.2.0",
721
+ type: StMultiselect,
722
+ isStandalone: true,
723
+ selector: "st-multiselect",
724
+ inputs: {
725
+ value: {
726
+ classPropertyName: "value",
727
+ publicName: "value",
728
+ isSignal: true,
729
+ isRequired: false,
730
+ transformFunction: null
731
+ },
732
+ options: {
733
+ classPropertyName: "options",
734
+ publicName: "options",
735
+ isSignal: true,
736
+ isRequired: true,
737
+ transformFunction: null
738
+ },
739
+ modeDeResume: {
740
+ classPropertyName: "modeDeResume",
741
+ publicName: "modeDeResume",
742
+ isSignal: true,
743
+ isRequired: false,
744
+ transformFunction: null
745
+ },
746
+ toutRetirer: {
747
+ classPropertyName: "toutRetirer",
748
+ publicName: "toutRetirer",
749
+ isSignal: true,
750
+ isRequired: false,
751
+ transformFunction: null
752
+ },
753
+ puces: {
754
+ classPropertyName: "puces",
755
+ publicName: "puces",
756
+ isSignal: true,
757
+ isRequired: false,
758
+ transformFunction: null
759
+ }
760
+ },
761
+ outputs: { value: "valueChange" },
762
+ host: {
763
+ listeners: { "focusout": "aLaSortie($event)" },
764
+ classAttribute: "st-multiselect"
765
+ },
766
+ viewQueries: [{
767
+ propertyName: "liste",
768
+ first: true,
769
+ predicate: Listbox,
770
+ descendants: true,
771
+ isSignal: true
772
+ }],
773
+ usesInheritance: true,
774
+ ngImport: i0,
775
+ template: "<st-form-field\n [libelle]=\"libelle()\"\n [aide]=\"aide()\"\n [erreurs]=\"errors()\"\n [afficherErreurs]=\"touched()\"\n [obligatoire]=\"required()\"\n>\n <div\n #combobox=\"ngCombobox\"\n class=\"st-multiselect__declencheur\"\n stControleDeChamp\n ngCombobox\n [attr.data-vide]=\"choisies().length === 0 ? '' : null\"\n [attr.data-readonly]=\"readonly() ? '' : null\"\n [(expanded)]=\"ouvert\"\n [disabled]=\"desactive()\"\n [softDisabled]=\"false\"\n [readonly]=\"readonly()\"\n >\n <!-- Chaque libelle isole (`dir=\"auto\"`), la liste dans la forme de la langue (D-5, D-28) ;\n chaque texte dans son element : aucun blanc de mise en page ne s'y glisse. -->\n <span class=\"st-multiselect__resume\">\n @for (morceau of resume(); track $index) {\n @if (morceau.libelle) {\n <span dir=\"auto\">{{ morceau.texte }}</span>\n } @else {\n <span>{{ morceau.texte }}</span>\n }\n }\n </span>\n @if (!readonly()) {\n <st-icon class=\"st-multiselect__chevron\" nom=\"chevron-bas\" taille=\"sm\" />\n }\n </div>\n\n <!-- ⚠️ La primitive de popup ENVELOPPE la surcouche, et non l'inverse (exemple\n de la documentation d'Aria). Enfermee dans la surcouche, elle ne\n s'enregistre qu'a l'ouverture : liste fermee, le champ annonce\n aria-autocomplete=\"none\" et aucun aria-haspopup, et le lecteur d'ecran\n ignore qu'une liste existe. -->\n <ng-template ngComboboxPopup [combobox]=\"combobox\">\n <ng-template\n [cdkConnectedOverlay]=\"{ origin: combobox.element, usePopover: 'inline', matchWidth: true }\"\n [cdkConnectedOverlayOpen]=\"ouvert()\"\n >\n <div class=\"st-multiselect__popup\">\n <div\n #liste=\"ngListbox\"\n [id]=\"idListe\"\n class=\"st-multiselect__liste\"\n ngListbox\n ngComboboxWidget\n focusMode=\"activedescendant\"\n selectionMode=\"explicit\"\n [multi]=\"true\"\n [tabindex]=\"-1\"\n [attr.aria-label]=\"libelle()\"\n [activeDescendant]=\"liste.activeDescendant()\"\n [value]=\"valeursDeListe()\"\n (valueChange)=\"surChoix($event)\"\n >\n @for (bloc of blocs(); track bloc.cle; let indiceDuBloc = $index) {\n @if (bloc.groupe === null) {\n @for (option of bloc.options; track option.valeur) {\n <div\n class=\"st-multiselect__option\"\n ngOption\n [value]=\"option.valeur\"\n [label]=\"affichable(option.libelle)\"\n [disabled]=\"option.desactivee === true\"\n >\n <span class=\"st-multiselect__case\" aria-hidden=\"true\">\n <st-icon class=\"st-multiselect__coche\" nom=\"coche\" taille=\"xs\" />\n </span>\n <span dir=\"auto\">{{ affichable(option.libelle) }}</span>\n </div>\n }\n } @else {\n <div role=\"group\" [attr.aria-labelledby]=\"idDuGroupe(indiceDuBloc)\">\n <p class=\"st-multiselect__groupe\" [id]=\"idDuGroupe(indiceDuBloc)\">\n {{ bloc.groupe }}\n </p>\n @for (option of bloc.options; track option.valeur) {\n <div\n class=\"st-multiselect__option\"\n ngOption\n [value]=\"option.valeur\"\n [label]=\"affichable(option.libelle)\"\n [disabled]=\"option.desactivee === true\"\n >\n <span class=\"st-multiselect__case\" aria-hidden=\"true\">\n <st-icon class=\"st-multiselect__coche\" nom=\"coche\" taille=\"xs\" />\n </span>\n <span dir=\"auto\">{{ affichable(option.libelle) }}</span>\n </div>\n }\n </div>\n }\n }\n </div>\n </div>\n </ng-template>\n </ng-template>\n\n @if (puces() && choisies().length > 0) {\n <!-- `role=\"list\"` : sans puces, Safari ne lit plus une liste comme une liste (D-1). -->\n <ul class=\"st-multiselect__choix\" role=\"list\" [attr.aria-label]=\"libelles().choixRetenus\">\n @for (option of choisies(); track option.valeur; let indice = $index) {\n <li class=\"st-multiselect__puce\">\n <span dir=\"auto\">{{ affichable(option.libelle) }}</span>\n @if (!readonly()) {\n <button\n class=\"st-multiselect__retrait\"\n stIconButton\n type=\"button\"\n icone=\"croix\"\n taille=\"sm\"\n [etiquette]=\"libelles().retirerLeChoix(affichable(option.libelle))\"\n [disabled]=\"desactive()\"\n (click)=\"retirer(option.valeur, indice)\"\n ></button>\n }\n </li>\n }\n </ul>\n @if (toutRetirer() && choisies().length > 1 && !readonly()) {\n <button\n class=\"st-multiselect__tout-retirer\"\n stButton\n type=\"button\"\n variante=\"discret\"\n [disabled]=\"desactive()\"\n (click)=\"retirerTout()\"\n >\n {{ libelles().toutRetirer }}\n </button>\n }\n }\n</st-form-field>\n<span class=\"st-vh\" aria-live=\"polite\">{{ annonce.texte() }}</span>\n",
776
+ 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-multiselect__declencheur:focus-visible{outline:var(--st-focus-epaisseur) solid var(--st-couleur-anneau-focus);outline-offset:var(--st-focus-decalage);box-shadow:0 0 0 var(--st-focus-lisere) var(--st-couleur-lisere-focus)}.st-multiselect__declencheur{box-sizing:border-box;inline-size:100%;min-block-size:var(--st-commande-hauteur, var(--st-hauteur-commande-defaut))}.st-multiselect__declencheur:is(input,select){block-size:var(--st-commande-hauteur, var(--st-hauteur-commande-defaut))}.st-multiselect__declencheur{--_remplissage-bloc: max( var(--st-espacement-demi), min( var(--st-espacement-2), calc( (var(--st-commande-hauteur, var(--st-hauteur-commande-defaut)) - var(--st-interligne-sm)) / 2 - var(--st-epaisseur-fine) ) ) );padding-block:var(--_remplissage-bloc);padding-inline:var(--st-espacement-3-5);font-family:inherit;font-size:var(--st-taille-sm);font-weight:var(--st-graisse-normale);line-height:var(--st-interligne-sm);color:var(--st-couleur-texte);background:var(--st-couleur-surface);border:var(--st-epaisseur-fine) solid var(--st-couleur-bordure-forte);border-radius:var(--st-commande-rayon, var(--st-rayon-md))}@media(pointer:coarse){.st-multiselect__declencheur{--_remplissage-bloc: max( var(--st-espacement-demi), min( var(--st-espacement-2), calc( ( var(--st-commande-hauteur, var(--st-hauteur-commande-defaut)) - var( --st-interligne-md ) ) / 2 - var(--st-epaisseur-fine) ) ) );font-size:var(--st-taille-md);line-height:var(--st-interligne-md)}}.st-multiselect__declencheur::placeholder{color:var(--st-couleur-texte-attenue);opacity:1}@media(hover:hover){.st-multiselect__declencheur:hover:not(:disabled,:focus,[aria-invalid=true]){border-color:var(--st-couleur-texte-discret);transition:border-color var(--st-duree-rapide) var(--st-courbe-standard)}}.st-multiselect__declencheur:focus-visible{border-color:var(--st-couleur-primaire)}.st-multiselect__declencheur[aria-invalid=true]{border-color:var(--st-couleur-danger);box-shadow:inset 0 0 0 var(--st-epaisseur-fine) var(--st-couleur-danger)}.st-multiselect__declencheur[aria-invalid=true]:focus-visible{outline:var(--st-focus-epaisseur) solid var(--st-couleur-anneau-focus);outline-offset:var(--st-focus-decalage);box-shadow:0 0 0 var(--st-focus-lisere) var(--st-couleur-lisere-focus),inset 0 0 0 var(--st-epaisseur-fine) var(--st-couleur-danger)}.st-multiselect__declencheur:disabled{color:var(--st-couleur-texte-desactive);cursor:not-allowed;background:var(--st-couleur-surface);border-color:var(--st-couleur-bordure)}.st-multiselect__declencheur:disabled::placeholder{color:var(--st-couleur-texte-desactive)}.st-multiselect__declencheur:is(input,textarea):read-only:not(:disabled),.st-multiselect__declencheur[aria-readonly=true]:not(:disabled){font-weight:var(--st-graisse-moyenne);background:var(--st-couleur-surface-enfoncee)}.st-multiselect__declencheur{display:flex;gap:var(--st-espacement-2);align-items:center;justify-content:space-between;cursor:pointer}.st-multiselect__declencheur[aria-disabled=true]{color:var(--st-couleur-texte-desactive);cursor:not-allowed;background:var(--st-couleur-surface-enfoncee)}.st-multiselect__declencheur[data-readonly]{cursor:default;background:var(--st-couleur-surface-enfoncee)}.st-multiselect__resume{min-inline-size:0;overflow-wrap:break-word}[data-vide]>.st-multiselect__resume{color:var(--st-couleur-texte-discret)}.st-multiselect__chevron{flex:none;color:var(--st-couleur-texte-discret)}.st-multiselect__popup{box-sizing:border-box;inline-size:100%;max-block-size:var(--st-liste-hauteur-max, 18rem);padding-block:var(--st-espacement-1);overflow-y:auto;color:var(--st-couleur-texte);background:var(--st-couleur-surface-elevee);border:var(--st-epaisseur-fine) solid var(--st-couleur-bordure);border-radius:var(--st-rayon-md);box-shadow:var(--st-ombre-surelevee);transition:opacity var(--st-duree-normale) linear,translate var(--st-duree-normale) var(--st-courbe-entrant)}@starting-style{.st-multiselect__popup{opacity:0;translate:0 calc(-1 * var(--st-deplacement-court))}}.st-multiselect__groupe{font-size:var(--st-taille-xs);line-height:var(--st-interligne-xs);font-weight:var(--st-graisse-moyenne);letter-spacing:var(--st-interlettrage-large);padding:var(--st-espacement-2) var(--st-espacement-3) var(--st-espacement-1);margin:0;color:var(--st-couleur-texte-discret)}.st-multiselect__option{box-sizing:border-box;display:flex;gap:var(--st-espacement-2);align-items:center;justify-content:space-between;min-block-size:var(--st-cible-tactile-min);padding:var(--st-espacement-2) var(--st-espacement-3);margin-inline:var(--st-espacement-1);border-radius:var(--st-rayon-sm);cursor:pointer}@media(hover:hover){.st-multiselect__option:hover:not([aria-disabled=true]){background:var(--st-couleur-surface-survol-elevee)}}.st-multiselect__option[aria-disabled=true]{color:var(--st-couleur-texte-desactive);cursor:not-allowed}.st-multiselect__option[aria-selected=true]{font-weight:var(--st-graisse-semi);background:var(--st-couleur-surface-selection)}.st-multiselect__option[data-active=true]{outline:var(--st-focus-epaisseur) solid var(--st-couleur-anneau-focus);outline-offset:calc(-1 * var(--st-focus-epaisseur));background:var(--st-couleur-surface-survol-elevee)}.st-multiselect__option:active:not([aria-disabled=true]){background:var(--st-couleur-surface-active)}.st-multiselect__option{justify-content:flex-start}.st-multiselect__option[aria-selected=true]:not([data-active=true]){background:transparent}.st-multiselect__case{display:inline-flex;flex:none;align-items:center;justify-content:center;inline-size:var(--st-cible-min);block-size:var(--st-cible-min);color:var(--st-couleur-sur-primaire);background:var(--st-couleur-surface);border:var(--st-epaisseur-fine) solid var(--st-couleur-bordure-forte);border-radius:var(--st-rayon-xs)}.st-multiselect__coche{visibility:hidden}[aria-selected=true]>.st-multiselect__case{background:var(--st-couleur-primaire);border-color:var(--st-couleur-primaire)}[aria-selected=true] .st-multiselect__coche{visibility:visible}.st-multiselect__choix{display:flex;flex-wrap:wrap;gap:var(--st-espacement-2);padding:0;margin:var(--st-espacement-2) 0 0;list-style:none}.st-multiselect__puce{display:inline-flex;gap:var(--st-espacement-1);align-items:center;padding-inline-start:var(--st-espacement-3);background:var(--st-couleur-surface-enfoncee);border:var(--st-epaisseur-fine) solid var(--st-couleur-bordure-forte);border-radius:var(--st-rayon-pleine)}.st-multiselect__tout-retirer{margin-block-start:var(--st-espacement-2)}\n"],
777
+ dependencies: [
778
+ {
779
+ kind: "component",
780
+ type: StFormField,
781
+ selector: "st-form-field",
782
+ inputs: [
783
+ "libelle",
784
+ "complement",
785
+ "disposition",
786
+ "presentation",
787
+ "libelleMasque",
788
+ "descriptionsDuControle"
789
+ ]
790
+ },
791
+ {
792
+ kind: "directive",
793
+ type: StControleDeChamp,
794
+ selector: "[stControleDeChamp]"
795
+ },
796
+ {
797
+ kind: "component",
798
+ type: StButton,
799
+ selector: "button[stButton]",
800
+ inputs: [
801
+ "variante",
802
+ "taille",
803
+ "pleineLargeur",
804
+ "iconeAvant",
805
+ "iconeApres",
806
+ "chargement",
807
+ "indisponible",
808
+ "raisonIndisponible"
809
+ ]
810
+ },
811
+ {
812
+ kind: "component",
813
+ type: StIcon,
814
+ selector: "st-icon",
815
+ inputs: [
816
+ "icone",
817
+ "nom",
818
+ "variante",
819
+ "sprite",
820
+ "nomMetier",
821
+ "taille",
822
+ "ton",
823
+ "etiquette",
824
+ "miroir"
825
+ ]
826
+ },
827
+ {
828
+ kind: "component",
829
+ type: StIconButton,
830
+ selector: "button[stIconButton]",
831
+ inputs: [
832
+ "icone",
833
+ "etiquette",
834
+ "variante",
835
+ "taille",
836
+ "tailleDuGlyphe",
837
+ "enfonce",
838
+ "iconeEnfoncee",
839
+ "chargement",
840
+ "indisponible",
841
+ "raisonIndisponible"
842
+ ]
843
+ },
844
+ {
845
+ kind: "directive",
846
+ type: Combobox,
847
+ selector: "[ngCombobox]",
848
+ inputs: [
849
+ "disabled",
850
+ "readonly",
851
+ "softDisabled",
852
+ "alwaysExpanded",
853
+ "tabindex",
854
+ "expanded",
855
+ "value",
856
+ "inlineSuggestion"
857
+ ],
858
+ outputs: ["expandedChange", "valueChange"],
859
+ exportAs: ["ngCombobox"]
860
+ },
861
+ {
862
+ kind: "directive",
863
+ type: ComboboxPopup,
864
+ selector: "ng-template[ngComboboxPopup]",
865
+ inputs: ["combobox", "popupType"],
866
+ exportAs: ["ngComboboxPopup"]
867
+ },
868
+ {
869
+ kind: "directive",
870
+ type: ComboboxWidget,
871
+ selector: "[ngComboboxWidget]",
872
+ inputs: ["activeDescendant"],
873
+ exportAs: ["ngComboboxWidget"]
874
+ },
875
+ {
876
+ kind: "directive",
877
+ type: Listbox,
878
+ selector: "[ngListbox]",
879
+ inputs: [
880
+ "id",
881
+ "orientation",
882
+ "multi",
883
+ "wrap",
884
+ "softDisabled",
885
+ "focusMode",
886
+ "selectionMode",
887
+ "typeaheadDelay",
888
+ "disabled",
889
+ "readonly",
890
+ "tabindex",
891
+ "value"
892
+ ],
893
+ outputs: ["valueChange"],
894
+ exportAs: ["ngListbox"]
895
+ },
896
+ {
897
+ kind: "directive",
898
+ type: Option,
899
+ selector: "[ngOption]",
900
+ inputs: [
901
+ "id",
902
+ "value",
903
+ "disabled",
904
+ "label"
905
+ ],
906
+ exportAs: ["ngOption"]
907
+ },
908
+ {
909
+ kind: "directive",
910
+ type: CdkConnectedOverlay,
911
+ selector: "[cdk-connected-overlay], [connected-overlay], [cdkConnectedOverlay]",
912
+ inputs: [
913
+ "cdkConnectedOverlayOrigin",
914
+ "cdkConnectedOverlayPositions",
915
+ "cdkConnectedOverlayPositionStrategy",
916
+ "cdkConnectedOverlayOffsetX",
917
+ "cdkConnectedOverlayOffsetY",
918
+ "cdkConnectedOverlayWidth",
919
+ "cdkConnectedOverlayHeight",
920
+ "cdkConnectedOverlayMinWidth",
921
+ "cdkConnectedOverlayMinHeight",
922
+ "cdkConnectedOverlayBackdropClass",
923
+ "cdkConnectedOverlayPanelClass",
924
+ "cdkConnectedOverlayViewportMargin",
925
+ "cdkConnectedOverlayScrollStrategy",
926
+ "cdkConnectedOverlayOpen",
927
+ "cdkConnectedOverlayDisableClose",
928
+ "cdkConnectedOverlayTransformOriginOn",
929
+ "cdkConnectedOverlayHasBackdrop",
930
+ "cdkConnectedOverlayLockPosition",
931
+ "cdkConnectedOverlayFlexibleDimensions",
932
+ "cdkConnectedOverlayGrowAfterOpen",
933
+ "cdkConnectedOverlayPush",
934
+ "cdkConnectedOverlayDisposeOnNavigation",
935
+ "cdkConnectedOverlayUsePopover",
936
+ "cdkConnectedOverlayMatchWidth",
937
+ "cdkConnectedOverlay"
938
+ ],
939
+ outputs: [
940
+ "backdropClick",
941
+ "positionChange",
942
+ "attach",
943
+ "detach",
944
+ "overlayKeydown",
945
+ "overlayOutsideClick"
946
+ ],
947
+ exportAs: ["cdkConnectedOverlay"]
948
+ }
949
+ ],
950
+ changeDetection: i0.ChangeDetectionStrategy.OnPush
951
+ });
952
+ };
953
+ i0.ɵɵngDeclareClassMetadata({
954
+ minVersion: "12.0.0",
955
+ version: "22.2.0",
956
+ ngImport: i0,
957
+ type: StMultiselect,
958
+ decorators: [{
959
+ type: Component,
960
+ args: [{
961
+ selector: "st-multiselect",
962
+ changeDetection: ChangeDetectionStrategy.OnPush,
963
+ imports: [
964
+ StFormField,
965
+ StControleDeChamp,
966
+ StButton,
967
+ StIcon,
968
+ StIconButton,
969
+ Combobox,
970
+ ComboboxPopup,
971
+ ComboboxWidget,
972
+ Listbox,
973
+ Option,
974
+ CdkConnectedOverlay
975
+ ],
976
+ host: {
977
+ class: "st-multiselect",
978
+ "(focusout)": "aLaSortie($event)"
979
+ },
980
+ template: "<st-form-field\n [libelle]=\"libelle()\"\n [aide]=\"aide()\"\n [erreurs]=\"errors()\"\n [afficherErreurs]=\"touched()\"\n [obligatoire]=\"required()\"\n>\n <div\n #combobox=\"ngCombobox\"\n class=\"st-multiselect__declencheur\"\n stControleDeChamp\n ngCombobox\n [attr.data-vide]=\"choisies().length === 0 ? '' : null\"\n [attr.data-readonly]=\"readonly() ? '' : null\"\n [(expanded)]=\"ouvert\"\n [disabled]=\"desactive()\"\n [softDisabled]=\"false\"\n [readonly]=\"readonly()\"\n >\n <!-- Chaque libelle isole (`dir=\"auto\"`), la liste dans la forme de la langue (D-5, D-28) ;\n chaque texte dans son element : aucun blanc de mise en page ne s'y glisse. -->\n <span class=\"st-multiselect__resume\">\n @for (morceau of resume(); track $index) {\n @if (morceau.libelle) {\n <span dir=\"auto\">{{ morceau.texte }}</span>\n } @else {\n <span>{{ morceau.texte }}</span>\n }\n }\n </span>\n @if (!readonly()) {\n <st-icon class=\"st-multiselect__chevron\" nom=\"chevron-bas\" taille=\"sm\" />\n }\n </div>\n\n <!-- ⚠️ La primitive de popup ENVELOPPE la surcouche, et non l'inverse (exemple\n de la documentation d'Aria). Enfermee dans la surcouche, elle ne\n s'enregistre qu'a l'ouverture : liste fermee, le champ annonce\n aria-autocomplete=\"none\" et aucun aria-haspopup, et le lecteur d'ecran\n ignore qu'une liste existe. -->\n <ng-template ngComboboxPopup [combobox]=\"combobox\">\n <ng-template\n [cdkConnectedOverlay]=\"{ origin: combobox.element, usePopover: 'inline', matchWidth: true }\"\n [cdkConnectedOverlayOpen]=\"ouvert()\"\n >\n <div class=\"st-multiselect__popup\">\n <div\n #liste=\"ngListbox\"\n [id]=\"idListe\"\n class=\"st-multiselect__liste\"\n ngListbox\n ngComboboxWidget\n focusMode=\"activedescendant\"\n selectionMode=\"explicit\"\n [multi]=\"true\"\n [tabindex]=\"-1\"\n [attr.aria-label]=\"libelle()\"\n [activeDescendant]=\"liste.activeDescendant()\"\n [value]=\"valeursDeListe()\"\n (valueChange)=\"surChoix($event)\"\n >\n @for (bloc of blocs(); track bloc.cle; let indiceDuBloc = $index) {\n @if (bloc.groupe === null) {\n @for (option of bloc.options; track option.valeur) {\n <div\n class=\"st-multiselect__option\"\n ngOption\n [value]=\"option.valeur\"\n [label]=\"affichable(option.libelle)\"\n [disabled]=\"option.desactivee === true\"\n >\n <span class=\"st-multiselect__case\" aria-hidden=\"true\">\n <st-icon class=\"st-multiselect__coche\" nom=\"coche\" taille=\"xs\" />\n </span>\n <span dir=\"auto\">{{ affichable(option.libelle) }}</span>\n </div>\n }\n } @else {\n <div role=\"group\" [attr.aria-labelledby]=\"idDuGroupe(indiceDuBloc)\">\n <p class=\"st-multiselect__groupe\" [id]=\"idDuGroupe(indiceDuBloc)\">\n {{ bloc.groupe }}\n </p>\n @for (option of bloc.options; track option.valeur) {\n <div\n class=\"st-multiselect__option\"\n ngOption\n [value]=\"option.valeur\"\n [label]=\"affichable(option.libelle)\"\n [disabled]=\"option.desactivee === true\"\n >\n <span class=\"st-multiselect__case\" aria-hidden=\"true\">\n <st-icon class=\"st-multiselect__coche\" nom=\"coche\" taille=\"xs\" />\n </span>\n <span dir=\"auto\">{{ affichable(option.libelle) }}</span>\n </div>\n }\n </div>\n }\n }\n </div>\n </div>\n </ng-template>\n </ng-template>\n\n @if (puces() && choisies().length > 0) {\n <!-- `role=\"list\"` : sans puces, Safari ne lit plus une liste comme une liste (D-1). -->\n <ul class=\"st-multiselect__choix\" role=\"list\" [attr.aria-label]=\"libelles().choixRetenus\">\n @for (option of choisies(); track option.valeur; let indice = $index) {\n <li class=\"st-multiselect__puce\">\n <span dir=\"auto\">{{ affichable(option.libelle) }}</span>\n @if (!readonly()) {\n <button\n class=\"st-multiselect__retrait\"\n stIconButton\n type=\"button\"\n icone=\"croix\"\n taille=\"sm\"\n [etiquette]=\"libelles().retirerLeChoix(affichable(option.libelle))\"\n [disabled]=\"desactive()\"\n (click)=\"retirer(option.valeur, indice)\"\n ></button>\n }\n </li>\n }\n </ul>\n @if (toutRetirer() && choisies().length > 1 && !readonly()) {\n <button\n class=\"st-multiselect__tout-retirer\"\n stButton\n type=\"button\"\n variante=\"discret\"\n [disabled]=\"desactive()\"\n (click)=\"retirerTout()\"\n >\n {{ libelles().toutRetirer }}\n </button>\n }\n }\n</st-form-field>\n<span class=\"st-vh\" aria-live=\"polite\">{{ annonce.texte() }}</span>\n",
981
+ 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-multiselect__declencheur:focus-visible{outline:var(--st-focus-epaisseur) solid var(--st-couleur-anneau-focus);outline-offset:var(--st-focus-decalage);box-shadow:0 0 0 var(--st-focus-lisere) var(--st-couleur-lisere-focus)}.st-multiselect__declencheur{box-sizing:border-box;inline-size:100%;min-block-size:var(--st-commande-hauteur, var(--st-hauteur-commande-defaut))}.st-multiselect__declencheur:is(input,select){block-size:var(--st-commande-hauteur, var(--st-hauteur-commande-defaut))}.st-multiselect__declencheur{--_remplissage-bloc: max( var(--st-espacement-demi), min( var(--st-espacement-2), calc( (var(--st-commande-hauteur, var(--st-hauteur-commande-defaut)) - var(--st-interligne-sm)) / 2 - var(--st-epaisseur-fine) ) ) );padding-block:var(--_remplissage-bloc);padding-inline:var(--st-espacement-3-5);font-family:inherit;font-size:var(--st-taille-sm);font-weight:var(--st-graisse-normale);line-height:var(--st-interligne-sm);color:var(--st-couleur-texte);background:var(--st-couleur-surface);border:var(--st-epaisseur-fine) solid var(--st-couleur-bordure-forte);border-radius:var(--st-commande-rayon, var(--st-rayon-md))}@media(pointer:coarse){.st-multiselect__declencheur{--_remplissage-bloc: max( var(--st-espacement-demi), min( var(--st-espacement-2), calc( ( var(--st-commande-hauteur, var(--st-hauteur-commande-defaut)) - var( --st-interligne-md ) ) / 2 - var(--st-epaisseur-fine) ) ) );font-size:var(--st-taille-md);line-height:var(--st-interligne-md)}}.st-multiselect__declencheur::placeholder{color:var(--st-couleur-texte-attenue);opacity:1}@media(hover:hover){.st-multiselect__declencheur:hover:not(:disabled,:focus,[aria-invalid=true]){border-color:var(--st-couleur-texte-discret);transition:border-color var(--st-duree-rapide) var(--st-courbe-standard)}}.st-multiselect__declencheur:focus-visible{border-color:var(--st-couleur-primaire)}.st-multiselect__declencheur[aria-invalid=true]{border-color:var(--st-couleur-danger);box-shadow:inset 0 0 0 var(--st-epaisseur-fine) var(--st-couleur-danger)}.st-multiselect__declencheur[aria-invalid=true]:focus-visible{outline:var(--st-focus-epaisseur) solid var(--st-couleur-anneau-focus);outline-offset:var(--st-focus-decalage);box-shadow:0 0 0 var(--st-focus-lisere) var(--st-couleur-lisere-focus),inset 0 0 0 var(--st-epaisseur-fine) var(--st-couleur-danger)}.st-multiselect__declencheur:disabled{color:var(--st-couleur-texte-desactive);cursor:not-allowed;background:var(--st-couleur-surface);border-color:var(--st-couleur-bordure)}.st-multiselect__declencheur:disabled::placeholder{color:var(--st-couleur-texte-desactive)}.st-multiselect__declencheur:is(input,textarea):read-only:not(:disabled),.st-multiselect__declencheur[aria-readonly=true]:not(:disabled){font-weight:var(--st-graisse-moyenne);background:var(--st-couleur-surface-enfoncee)}.st-multiselect__declencheur{display:flex;gap:var(--st-espacement-2);align-items:center;justify-content:space-between;cursor:pointer}.st-multiselect__declencheur[aria-disabled=true]{color:var(--st-couleur-texte-desactive);cursor:not-allowed;background:var(--st-couleur-surface-enfoncee)}.st-multiselect__declencheur[data-readonly]{cursor:default;background:var(--st-couleur-surface-enfoncee)}.st-multiselect__resume{min-inline-size:0;overflow-wrap:break-word}[data-vide]>.st-multiselect__resume{color:var(--st-couleur-texte-discret)}.st-multiselect__chevron{flex:none;color:var(--st-couleur-texte-discret)}.st-multiselect__popup{box-sizing:border-box;inline-size:100%;max-block-size:var(--st-liste-hauteur-max, 18rem);padding-block:var(--st-espacement-1);overflow-y:auto;color:var(--st-couleur-texte);background:var(--st-couleur-surface-elevee);border:var(--st-epaisseur-fine) solid var(--st-couleur-bordure);border-radius:var(--st-rayon-md);box-shadow:var(--st-ombre-surelevee);transition:opacity var(--st-duree-normale) linear,translate var(--st-duree-normale) var(--st-courbe-entrant)}@starting-style{.st-multiselect__popup{opacity:0;translate:0 calc(-1 * var(--st-deplacement-court))}}.st-multiselect__groupe{font-size:var(--st-taille-xs);line-height:var(--st-interligne-xs);font-weight:var(--st-graisse-moyenne);letter-spacing:var(--st-interlettrage-large);padding:var(--st-espacement-2) var(--st-espacement-3) var(--st-espacement-1);margin:0;color:var(--st-couleur-texte-discret)}.st-multiselect__option{box-sizing:border-box;display:flex;gap:var(--st-espacement-2);align-items:center;justify-content:space-between;min-block-size:var(--st-cible-tactile-min);padding:var(--st-espacement-2) var(--st-espacement-3);margin-inline:var(--st-espacement-1);border-radius:var(--st-rayon-sm);cursor:pointer}@media(hover:hover){.st-multiselect__option:hover:not([aria-disabled=true]){background:var(--st-couleur-surface-survol-elevee)}}.st-multiselect__option[aria-disabled=true]{color:var(--st-couleur-texte-desactive);cursor:not-allowed}.st-multiselect__option[aria-selected=true]{font-weight:var(--st-graisse-semi);background:var(--st-couleur-surface-selection)}.st-multiselect__option[data-active=true]{outline:var(--st-focus-epaisseur) solid var(--st-couleur-anneau-focus);outline-offset:calc(-1 * var(--st-focus-epaisseur));background:var(--st-couleur-surface-survol-elevee)}.st-multiselect__option:active:not([aria-disabled=true]){background:var(--st-couleur-surface-active)}.st-multiselect__option{justify-content:flex-start}.st-multiselect__option[aria-selected=true]:not([data-active=true]){background:transparent}.st-multiselect__case{display:inline-flex;flex:none;align-items:center;justify-content:center;inline-size:var(--st-cible-min);block-size:var(--st-cible-min);color:var(--st-couleur-sur-primaire);background:var(--st-couleur-surface);border:var(--st-epaisseur-fine) solid var(--st-couleur-bordure-forte);border-radius:var(--st-rayon-xs)}.st-multiselect__coche{visibility:hidden}[aria-selected=true]>.st-multiselect__case{background:var(--st-couleur-primaire);border-color:var(--st-couleur-primaire)}[aria-selected=true] .st-multiselect__coche{visibility:visible}.st-multiselect__choix{display:flex;flex-wrap:wrap;gap:var(--st-espacement-2);padding:0;margin:var(--st-espacement-2) 0 0;list-style:none}.st-multiselect__puce{display:inline-flex;gap:var(--st-espacement-1);align-items:center;padding-inline-start:var(--st-espacement-3);background:var(--st-couleur-surface-enfoncee);border:var(--st-epaisseur-fine) solid var(--st-couleur-bordure-forte);border-radius:var(--st-rayon-pleine)}.st-multiselect__tout-retirer{margin-block-start:var(--st-espacement-2)}\n"]
982
+ }]
983
+ }],
984
+ ctorParameters: () => [],
985
+ propDecorators: {
986
+ value: [{
987
+ type: i0.Input,
988
+ args: [{
989
+ isSignal: true,
990
+ alias: "value",
991
+ required: false
992
+ }]
993
+ }, {
994
+ type: i0.Output,
995
+ args: ["valueChange"]
996
+ }],
997
+ options: [{
998
+ type: i0.Input,
999
+ args: [{
1000
+ isSignal: true,
1001
+ alias: "options",
1002
+ required: true
1003
+ }]
1004
+ }],
1005
+ modeDeResume: [{
1006
+ type: i0.Input,
1007
+ args: [{
1008
+ isSignal: true,
1009
+ alias: "modeDeResume",
1010
+ required: false
1011
+ }]
1012
+ }],
1013
+ toutRetirer: [{
1014
+ type: i0.Input,
1015
+ args: [{
1016
+ isSignal: true,
1017
+ alias: "toutRetirer",
1018
+ required: false
1019
+ }]
1020
+ }],
1021
+ puces: [{
1022
+ type: i0.Input,
1023
+ args: [{
1024
+ isSignal: true,
1025
+ alias: "puces",
1026
+ required: false
1027
+ }]
1028
+ }],
1029
+ liste: [{
1030
+ type: i0.ViewChild,
1031
+ args: [i0.forwardRef(() => Listbox), { isSignal: true }]
1032
+ }]
1033
+ }
1034
+ });
1035
+ const MINIMUM = 3;
1036
+ const LIMITE = 5;
1037
+ var StAddressSearch = class StAddressSearch {
1038
+ source = inject(ST_RECHERCHE_D_ADRESSES);
1039
+ champ = inject(ST_CHAMP_D_ADRESSE, { optional: true });
1040
+ libelles = inject(ST_LIBELLES);
1041
+ locale = inject(ST_LOCALE);
1042
+ minimum = MINIMUM;
1043
+ active = this.source !== null && this.champ !== null;
1044
+ attribution = this.source?.attribution ?? null;
1045
+ terme = signal("", ...ngDevMode ? [{ debugName: "terme" }] : /* istanbul ignore next */ []);
1046
+ choix = signal("", ...ngDevMode ? [{ debugName: "choix" }] : /* istanbul ignore next */ []);
1047
+ inactive = computed(() => !(this.champ?.modifiable() ?? false), ...ngDevMode ? [{ debugName: "inactive" }] : /* istanbul ignore next */ []);
1048
+ demande = computed(() => {
1049
+ const texte = this.terme().trim();
1050
+ if (!this.active || texte.length < MINIMUM) return void 0;
1051
+ const pays = this.champ?.pays() ?? "";
1052
+ return {
1053
+ texte,
1054
+ pays: pays === "" ? null : pays,
1055
+ langue: this.locale(),
1056
+ limite: LIMITE
1057
+ };
1058
+ }, ...ngDevMode ? [{ debugName: "demande" }] : /* istanbul ignore next */ []);
1059
+ suggestions = resource({
1060
+ ...ngDevMode ? { debugName: "suggestions" } : /* istanbul ignore next */ {},
1061
+ params: () => this.demande(),
1062
+ loader: ({ params, abortSignal }) => this.source === null ? Promise.resolve([]) : this.source.suggerer(params, abortSignal)
1063
+ });
1064
+ servies = computed(() => this.suggestions.hasValue() ? this.suggestions.value() : [], ...ngDevMode ? [{ debugName: "servies" }] : /* istanbul ignore next */ []);
1065
+ options = computed(() => this.servies().map((suggestion) => suggestion.precision === null || suggestion.precision === "" ? {
1066
+ valeur: suggestion.id,
1067
+ libelle: suggestion.libelle
1068
+ } : {
1069
+ valeur: suggestion.id,
1070
+ libelle: suggestion.libelle,
1071
+ aide: suggestion.precision
1072
+ }), ...ngDevMode ? [{ debugName: "options" }] : /* istanbul ignore next */ []);
1073
+ indisponible = signal(false, ...ngDevMode ? [{ debugName: "indisponible" }] : /* istanbul ignore next */ []);
1074
+ arret = new AbortController();
1075
+ constructor() {
1076
+ inject(DestroyRef).onDestroy(() => {
1077
+ this.arret.abort();
1078
+ });
1079
+ if (isDevMode() && this.champ === null) console.error("[st-address-search] a placer dans st-address-fieldset : rien ne sera rendu.");
1080
+ effect(() => {
1081
+ const enPanne = this.suggestions.status() === "error";
1082
+ if (enPanne === untracked(this.indisponible)) return;
1083
+ this.indisponible.set(enPanne);
1084
+ if (enPanne) this.champ?.annoncer(untracked(this.libelles).rechercheDAdresseIndisponible);
1085
+ });
1086
+ }
1087
+ async choisir(id) {
1088
+ this.choix.set(id);
1089
+ const suggestion = this.servies().find((une) => une.id === id);
1090
+ if (suggestion === void 0 || this.source === null || this.champ === null) return;
1091
+ try {
1092
+ const adresse = suggestion.adresse ?? await this.source.detailler(suggestion, this.arret.signal);
1093
+ this.indisponible.set(false);
1094
+ this.champ.remplir(adresse);
1095
+ this.champ.annoncer(this.libelles().adresseReportee);
1096
+ } catch {
1097
+ if (this.arret.signal.aborted) return;
1098
+ this.indisponible.set(true);
1099
+ this.champ.annoncer(this.libelles().rechercheDAdresseIndisponible);
1100
+ }
1101
+ }
1102
+ static ɵfac = i0.ɵɵngDeclareFactory({
1103
+ minVersion: "12.0.0",
1104
+ version: "22.2.0",
1105
+ ngImport: i0,
1106
+ type: StAddressSearch,
1107
+ deps: [],
1108
+ target: i0.ɵɵFactoryTarget.Component
1109
+ });
1110
+ static ɵcmp = i0.ɵɵngDeclareComponent({
1111
+ minVersion: "17.0.0",
1112
+ version: "22.2.0",
1113
+ type: StAddressSearch,
1114
+ isStandalone: true,
1115
+ selector: "st-address-search",
1116
+ host: { classAttribute: "st-address-search" },
1117
+ ngImport: i0,
1118
+ template: "@if (active) {\n <st-combobox\n [libelle]=\"libelles().rechercherUneAdresse\"\n [aide]=\"libelles().aideRechercheDAdresse(minimum)\"\n filtrage=\"distant\"\n icone=\"recherche\"\n [longueurMinimale]=\"minimum\"\n [options]=\"options()\"\n [chargement]=\"suggestions.isLoading()\"\n [disabled]=\"inactive()\"\n [value]=\"choix()\"\n (valueChange)=\"choisir($event)\"\n (recherche)=\"terme.set($event)\"\n />\n @if (indisponible()) {\n <st-inline-message class=\"st-address-search__panne\" ton=\"avertissement\">{{\n libelles().rechercheDAdresseIndisponible\n }}</st-inline-message>\n }\n @if (attribution; as source) {\n <p class=\"st-address-search__attribution\">\n @if (source.lien; as lien) {\n <a stLink externe [href]=\"lien\">{{ source.texte }}</a>\n } @else {\n {{ source.texte }}\n }\n </p>\n }\n}\n",
1119
+ 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;flex-direction:column;gap:var(--st-espacement-2);min-inline-size:0}:host:empty{display:none}.st-address-search__attribution{margin:0;font-size:var(--st-taille-xs);line-height:var(--st-interligne-xs);color:var(--st-couleur-texte-discret)}\n"],
1120
+ dependencies: [
1121
+ {
1122
+ kind: "component",
1123
+ type: StCombobox,
1124
+ selector: "st-combobox",
1125
+ inputs: [
1126
+ "options",
1127
+ "filtrage",
1128
+ "icone",
1129
+ "presentation",
1130
+ "chargement",
1131
+ "effacable",
1132
+ "temporisationEnMs",
1133
+ "longueurMinimale"
1134
+ ],
1135
+ outputs: ["recherche"]
1136
+ },
1137
+ {
1138
+ kind: "component",
1139
+ type: StInlineMessage,
1140
+ selector: "st-inline-message",
1141
+ inputs: [
1142
+ "ton",
1143
+ "identifiant",
1144
+ "annonce",
1145
+ "encadre",
1146
+ "icone"
1147
+ ]
1148
+ },
1149
+ {
1150
+ kind: "component",
1151
+ type: StLink,
1152
+ selector: "a[stLink]",
1153
+ inputs: [
1154
+ "variante",
1155
+ "externe",
1156
+ "mentionExterne",
1157
+ "iconeAvant",
1158
+ "iconeApres"
1159
+ ]
1160
+ }
1161
+ ],
1162
+ changeDetection: i0.ChangeDetectionStrategy.OnPush
1163
+ });
1164
+ };
1165
+ i0.ɵɵngDeclareClassMetadata({
1166
+ minVersion: "12.0.0",
1167
+ version: "22.2.0",
1168
+ ngImport: i0,
1169
+ type: StAddressSearch,
1170
+ decorators: [{
1171
+ type: Component,
1172
+ args: [{
1173
+ selector: "st-address-search",
1174
+ changeDetection: ChangeDetectionStrategy.OnPush,
1175
+ imports: [
1176
+ StCombobox,
1177
+ StInlineMessage,
1178
+ StLink
1179
+ ],
1180
+ host: { class: "st-address-search" },
1181
+ template: "@if (active) {\n <st-combobox\n [libelle]=\"libelles().rechercherUneAdresse\"\n [aide]=\"libelles().aideRechercheDAdresse(minimum)\"\n filtrage=\"distant\"\n icone=\"recherche\"\n [longueurMinimale]=\"minimum\"\n [options]=\"options()\"\n [chargement]=\"suggestions.isLoading()\"\n [disabled]=\"inactive()\"\n [value]=\"choix()\"\n (valueChange)=\"choisir($event)\"\n (recherche)=\"terme.set($event)\"\n />\n @if (indisponible()) {\n <st-inline-message class=\"st-address-search__panne\" ton=\"avertissement\">{{\n libelles().rechercheDAdresseIndisponible\n }}</st-inline-message>\n }\n @if (attribution; as source) {\n <p class=\"st-address-search__attribution\">\n @if (source.lien; as lien) {\n <a stLink externe [href]=\"lien\">{{ source.texte }}</a>\n } @else {\n {{ source.texte }}\n }\n </p>\n }\n}\n",
1182
+ 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;flex-direction:column;gap:var(--st-espacement-2);min-inline-size:0}:host:empty{display:none}.st-address-search__attribution{margin:0;font-size:var(--st-taille-xs);line-height:var(--st-interligne-xs);color:var(--st-couleur-texte-discret)}\n"]
1183
+ }]
1184
+ }],
1185
+ ctorParameters: () => []
1186
+ });
1187
+ var StCountryCombobox = class StCountryCombobox extends ControleDeSaisie {
1188
+ libelles = inject(ST_LIBELLES);
1189
+ locale = inject(ST_LOCALE);
1190
+ codes = input(null, ...ngDevMode ? [{ debugName: "codes" }] : /* istanbul ignore next */ []);
1191
+ enTete = input([], ...ngDevMode ? [{ debugName: "enTete" }] : /* istanbul ignore next */ []);
1192
+ effacable = input(false, {
1193
+ ...ngDevMode ? { debugName: "effacable" } : /* istanbul ignore next */ {},
1194
+ transform: booleanAttribute
1195
+ });
1196
+ presentation = input("libelle", ...ngDevMode ? [{ debugName: "presentation" }] : /* istanbul ignore next */ []);
1197
+ liste = viewChild.required(StCombobox, ...ngDevMode ? [{ debugName: "liste" }] : /* istanbul ignore next */ []);
1198
+ options = computed(() => optionsDesPays({
1199
+ locale: this.locale(),
1200
+ codes: this.codes(),
1201
+ enTete: this.enTete(),
1202
+ courant: this.value(),
1203
+ groupes: {
1204
+ frequents: this.libelles().paysFrequents,
1205
+ tous: this.libelles().tousLesPays
1206
+ }
1207
+ }), ...ngDevMode ? [{ debugName: "options" }] : /* istanbul ignore next */ []);
1208
+ focus(options) {
1209
+ this.liste().focus(options);
1210
+ }
1211
+ static ɵfac = i0.ɵɵngDeclareFactory({
1212
+ minVersion: "12.0.0",
1213
+ version: "22.2.0",
1214
+ ngImport: i0,
1215
+ type: StCountryCombobox,
1216
+ deps: null,
1217
+ target: i0.ɵɵFactoryTarget.Component
1218
+ });
1219
+ static ɵcmp = i0.ɵɵngDeclareComponent({
1220
+ minVersion: "17.2.0",
1221
+ version: "22.2.0",
1222
+ type: StCountryCombobox,
1223
+ isStandalone: true,
1224
+ selector: "st-country-combobox",
1225
+ inputs: {
1226
+ codes: {
1227
+ classPropertyName: "codes",
1228
+ publicName: "codes",
1229
+ isSignal: true,
1230
+ isRequired: false,
1231
+ transformFunction: null
1232
+ },
1233
+ enTete: {
1234
+ classPropertyName: "enTete",
1235
+ publicName: "enTete",
1236
+ isSignal: true,
1237
+ isRequired: false,
1238
+ transformFunction: null
1239
+ },
1240
+ effacable: {
1241
+ classPropertyName: "effacable",
1242
+ publicName: "effacable",
1243
+ isSignal: true,
1244
+ isRequired: false,
1245
+ transformFunction: null
1246
+ },
1247
+ presentation: {
1248
+ classPropertyName: "presentation",
1249
+ publicName: "presentation",
1250
+ isSignal: true,
1251
+ isRequired: false,
1252
+ transformFunction: null
1253
+ }
1254
+ },
1255
+ host: { classAttribute: "st-country-combobox" },
1256
+ viewQueries: [{
1257
+ propertyName: "liste",
1258
+ first: true,
1259
+ predicate: StCombobox,
1260
+ descendants: true,
1261
+ isSignal: true
1262
+ }],
1263
+ usesInheritance: true,
1264
+ ngImport: i0,
1265
+ template: "<st-combobox\n [libelle]=\"libelle()\"\n [aide]=\"aide()\"\n [options]=\"options()\"\n [presentation]=\"presentation()\"\n [effacable]=\"effacable()\"\n [value]=\"value()\"\n (valueChange)=\"value.set($event)\"\n [errors]=\"errors()\"\n [touched]=\"touched()\"\n [dirty]=\"dirty()\"\n [pending]=\"pending()\"\n [disabled]=\"disabled()\"\n [disabledReasons]=\"disabledReasons()\"\n [readonly]=\"readonly()\"\n [required]=\"required()\"\n [name]=\"name()\"\n (touch)=\"touch.emit()\"\n/>\n",
1266
+ dependencies: [{
1267
+ kind: "component",
1268
+ type: StCombobox,
1269
+ selector: "st-combobox",
1270
+ inputs: [
1271
+ "options",
1272
+ "filtrage",
1273
+ "icone",
1274
+ "presentation",
1275
+ "chargement",
1276
+ "effacable",
1277
+ "temporisationEnMs",
1278
+ "longueurMinimale"
1279
+ ],
1280
+ outputs: ["recherche"]
1281
+ }],
1282
+ changeDetection: i0.ChangeDetectionStrategy.OnPush
1283
+ });
1284
+ };
1285
+ i0.ɵɵngDeclareClassMetadata({
1286
+ minVersion: "12.0.0",
1287
+ version: "22.2.0",
1288
+ ngImport: i0,
1289
+ type: StCountryCombobox,
1290
+ decorators: [{
1291
+ type: Component,
1292
+ args: [{
1293
+ selector: "st-country-combobox",
1294
+ changeDetection: ChangeDetectionStrategy.OnPush,
1295
+ imports: [StCombobox],
1296
+ host: { class: "st-country-combobox" },
1297
+ template: "<st-combobox\n [libelle]=\"libelle()\"\n [aide]=\"aide()\"\n [options]=\"options()\"\n [presentation]=\"presentation()\"\n [effacable]=\"effacable()\"\n [value]=\"value()\"\n (valueChange)=\"value.set($event)\"\n [errors]=\"errors()\"\n [touched]=\"touched()\"\n [dirty]=\"dirty()\"\n [pending]=\"pending()\"\n [disabled]=\"disabled()\"\n [disabledReasons]=\"disabledReasons()\"\n [readonly]=\"readonly()\"\n [required]=\"required()\"\n [name]=\"name()\"\n (touch)=\"touch.emit()\"\n/>\n"
1298
+ }]
1299
+ }],
1300
+ propDecorators: {
1301
+ codes: [{
1302
+ type: i0.Input,
1303
+ args: [{
1304
+ isSignal: true,
1305
+ alias: "codes",
1306
+ required: false
1307
+ }]
1308
+ }],
1309
+ enTete: [{
1310
+ type: i0.Input,
1311
+ args: [{
1312
+ isSignal: true,
1313
+ alias: "enTete",
1314
+ required: false
1315
+ }]
1316
+ }],
1317
+ effacable: [{
1318
+ type: i0.Input,
1319
+ args: [{
1320
+ isSignal: true,
1321
+ alias: "effacable",
1322
+ required: false
1323
+ }]
1324
+ }],
1325
+ presentation: [{
1326
+ type: i0.Input,
1327
+ args: [{
1328
+ isSignal: true,
1329
+ alias: "presentation",
1330
+ required: false
1331
+ }]
1332
+ }],
1333
+ liste: [{
1334
+ type: i0.ViewChild,
1335
+ args: [i0.forwardRef(() => StCombobox), { isSignal: true }]
1336
+ }]
1337
+ }
1338
+ });
1339
+ export { StAddressSearch, StCombobox, StCountryCombobox, StMultiselect, StOption };
1340
+
1341
+ //# sourceMappingURL=starterlib-ui-selection.mjs.map