@starterlib/ui 0.7.2 → 0.8.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 (35) hide show
  1. package/README.md +95 -42
  2. package/fesm2022/starterlib-ui-arbre.mjs +82 -0
  3. package/fesm2022/starterlib-ui-arbre.mjs.map +1 -0
  4. package/fesm2022/starterlib-ui-donnees.mjs +532 -0
  5. package/fesm2022/starterlib-ui-donnees.mjs.map +1 -0
  6. package/fesm2022/starterlib-ui-formulaires.mjs +2 -1
  7. package/fesm2022/starterlib-ui-formulaires.mjs.map +1 -1
  8. package/fesm2022/starterlib-ui-interactions.mjs +34 -589
  9. package/fesm2022/starterlib-ui-interactions.mjs.map +1 -1
  10. package/fesm2022/starterlib-ui-libelles-en.mjs +142 -0
  11. package/fesm2022/starterlib-ui-libelles-en.mjs.map +1 -0
  12. package/fesm2022/starterlib-ui-listes.mjs +671 -0
  13. package/fesm2022/starterlib-ui-listes.mjs.map +1 -0
  14. package/fesm2022/starterlib-ui-navigation.mjs +246 -0
  15. package/fesm2022/starterlib-ui-navigation.mjs.map +1 -0
  16. package/fesm2022/starterlib-ui-onglets.mjs +137 -0
  17. package/fesm2022/starterlib-ui-onglets.mjs.map +1 -0
  18. package/fesm2022/starterlib-ui-saisie.mjs +1632 -0
  19. package/fesm2022/starterlib-ui-saisie.mjs.map +1 -0
  20. package/fesm2022/starterlib-ui-selection.mjs +269 -0
  21. package/fesm2022/starterlib-ui-selection.mjs.map +1 -0
  22. package/fesm2022/starterlib-ui.mjs +105 -2931
  23. package/fesm2022/starterlib-ui.mjs.map +1 -1
  24. package/package.json +35 -3
  25. package/types/starterlib-ui-arbre.d.ts +51 -0
  26. package/types/starterlib-ui-donnees.d.ts +228 -0
  27. package/types/starterlib-ui-formulaires.d.ts +5 -4
  28. package/types/starterlib-ui-interactions.d.ts +4 -316
  29. package/types/starterlib-ui-libelles-en.d.ts +25 -0
  30. package/types/starterlib-ui-listes.d.ts +432 -0
  31. package/types/starterlib-ui-navigation.d.ts +104 -0
  32. package/types/starterlib-ui-onglets.d.ts +89 -0
  33. package/types/starterlib-ui-saisie.d.ts +924 -0
  34. package/types/starterlib-ui-selection.d.ts +112 -0
  35. package/types/starterlib-ui.d.ts +9 -1575
@@ -0,0 +1,112 @@
1
+ import * as _angular_core from '@angular/core';
2
+ import * as _starterlib_ui from '@starterlib/ui';
3
+ import { AnnonceLocale } from '@starterlib/ui';
4
+ import { ControleDeSaisie, OptionDeListe, ContratDeChamp } from '@starterlib/ui/saisie';
5
+ import { FormValueControl } from '@angular/forms/signals';
6
+
7
+ /** `local` : le composant filtre `options`. `distant` : l'application filtre, sur `recherche`. */
8
+ type FiltrageDeListe = 'local' | 'distant';
9
+ /**
10
+ * Liste de choix a filtrer en tapant, sur `@angular/aria/combobox` et
11
+ * `@angular/aria/listbox`.
12
+ *
13
+ * ```html
14
+ * <st-combobox libelle="Beneficiaire" [options]="beneficiaires" [formField]="virement.beneficiaire" />
15
+ * <!-- liste servie par le serveur : -->
16
+ * <st-combobox libelle="Commune" filtrage="distant" [options]="communes()"
17
+ * (recherche)="terme.set($event)" [formField]="adresse.commune" />
18
+ * ```
19
+ *
20
+ * Le modele est la VALEUR de l'option choisie, `''` sans choix. Le texte tape ne
21
+ * part jamais dans le modele : « Pari » n'est pas une commune.
22
+ *
23
+ * ⚠️ **Pour une longue liste seulement.** Sous une vingtaine d'options,
24
+ * `st-select` — natif — est plus sur, et plus rapide sur mobile.
25
+ *
26
+ * - La liste s'ouvre a la frappe et a la fleche bas ; Entree choisit, Echap
27
+ * ferme. Le focus reste dans le champ (`aria-activedescendant`).
28
+ * - Le nombre de resultats s'annonce apres la frappe, une fois : le lecteur
29
+ * d'ecran ne voit pas la liste se reduire.
30
+ * - ⚠️ **Quitter le champ sans choisir rend le texte du choix precedent.** Un
31
+ * texte qui ne correspond a aucune option ne reste pas affiche comme s'il etait
32
+ * retenu ; un champ vide, lui, retire le choix.
33
+ * - La liste est posee dans la couche superieure du navigateur (`popover`) par le
34
+ * CDK : un dialogue ou un tableau defilant ne la rogne pas.
35
+ *
36
+ * ⚠️ En `distant`, `recherche` est emis a chaque frappe : a l'application de
37
+ * temporiser, et de ne pas mettre le terme dans l'adresse (SEC-6).
38
+ */
39
+ declare class StCombobox extends ControleDeSaisie {
40
+ protected readonly libelles: _angular_core.Signal<_starterlib_ui.LibellesUi>;
41
+ private readonly element;
42
+ private readonly injecteur;
43
+ readonly options: _angular_core.InputSignal<readonly OptionDeListe[]>;
44
+ readonly filtrage: _angular_core.InputSignal<FiltrageDeListe>;
45
+ /** Texte tape, a chaque frappe. Sert au filtrage `distant`. */
46
+ readonly recherche: _angular_core.OutputEmitterRef<string>;
47
+ protected readonly annonce: AnnonceLocale;
48
+ protected readonly ouvert: _angular_core.WritableSignal<boolean>;
49
+ /** Texte du champ : le libelle du choix, tant que la personne ne tape pas. */
50
+ protected readonly texte: _angular_core.WritableSignal<string>;
51
+ /** Ce qui filtre : vide a l'ouverture par la fleche, pour montrer toute la liste. */
52
+ private readonly filtre;
53
+ /** Option active dans la liste ; le choix n'est retenu qu'a la validation. */
54
+ protected readonly surlignee: _angular_core.WritableSignal<string[]>;
55
+ protected readonly visibles: _angular_core.Signal<readonly OptionDeListe[]>;
56
+ private readonly liste;
57
+ constructor();
58
+ protected surSaisie(evenement: Event): void;
59
+ protected basculer(): void;
60
+ protected valider(): void;
61
+ protected aLaSortie(evenement: FocusEvent): void;
62
+ private libelleDe;
63
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<StCombobox, never>;
64
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<StCombobox, "st-combobox", never, { "options": { "alias": "options"; "required": true; "isSignal": true; }; "filtrage": { "alias": "filtrage"; "required": false; "isSignal": true; }; }, { "recherche": "recherche"; }, never, never, true, never>;
65
+ }
66
+
67
+ /**
68
+ * Choix de plusieurs valeurs dans une liste, sur `@angular/aria/combobox` et
69
+ * `@angular/aria/listbox`.
70
+ *
71
+ * ```html
72
+ * <st-multiselect libelle="Comptes a inclure" [options]="comptes" [formField]="releve.comptes" />
73
+ * ```
74
+ *
75
+ * Le modele est la liste des VALEURS choisies, dans l'ordre des options.
76
+ *
77
+ * - Fleche bas, Entree ou Espace ouvrent la liste ; Espace coche ou decoche
78
+ * l'option active sans fermer ; Echap ferme.
79
+ * - ⚠️ **Chaque choix reste visible et retirable** sous le champ, par un bouton
80
+ * « Retirer … ». Un resume « 3 choix » dans le declencheur ne dit pas lesquels,
81
+ * et obligerait a rouvrir la liste pour en retirer un.
82
+ * - Un choix retire rend le focus au retrait suivant, ou au champ : le focus ne
83
+ * tombe jamais sur le document.
84
+ *
85
+ * ⚠️ Sous une dizaine d'options, un groupe de cases a cocher (`st-fieldset` et
86
+ * `st-checkbox`) est plus simple : tout est visible, rien a ouvrir.
87
+ */
88
+ declare class StMultiselect extends ContratDeChamp implements FormValueControl<readonly string[]> {
89
+ protected readonly libelles: _angular_core.Signal<_starterlib_ui.LibellesUi>;
90
+ private readonly element;
91
+ private readonly injecteur;
92
+ readonly value: _angular_core.ModelSignal<readonly string[]>;
93
+ readonly options: _angular_core.InputSignal<readonly OptionDeListe[]>;
94
+ protected readonly annonce: AnnonceLocale;
95
+ protected readonly ouvert: _angular_core.WritableSignal<boolean>;
96
+ private readonly liste;
97
+ /** La liste d'Aria attend un tableau modifiable ; le modele, lui, est en lecture seule. */
98
+ protected readonly valeursDeListe: _angular_core.Signal<string[]>;
99
+ protected readonly choisies: _angular_core.Signal<OptionDeListe[]>;
100
+ protected readonly resume: _angular_core.Signal<string>;
101
+ constructor();
102
+ /** Le declencheur n'est pas un champ natif : la base ne le trouve pas par `#champ`. */
103
+ focus(options?: FocusOptions): void;
104
+ protected surChoix(valeurs: readonly string[]): void;
105
+ protected retirer(valeur: string, indice: number): void;
106
+ protected aLaSortie(evenement: FocusEvent): void;
107
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<StMultiselect, never>;
108
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<StMultiselect, "st-multiselect", never, { "value": { "alias": "value"; "required": false; "isSignal": true; }; "options": { "alias": "options"; "required": true; "isSignal": true; }; }, { "value": "valueChange"; }, never, never, true, never>;
109
+ }
110
+
111
+ export { StCombobox, StMultiselect };
112
+ export type { FiltrageDeListe };