@ktortu/aaa 0.9.1 → 0.9.3

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 (40) hide show
  1. package/dialog/dialog.css +6 -0
  2. package/fesm2022/ktortu-aaa-button.mjs +10 -2
  3. package/fesm2022/ktortu-aaa-button.mjs.map +1 -1
  4. package/fesm2022/ktortu-aaa-card.mjs +112 -99
  5. package/fesm2022/ktortu-aaa-card.mjs.map +1 -1
  6. package/fesm2022/ktortu-aaa-cdk.mjs +49 -2
  7. package/fesm2022/ktortu-aaa-cdk.mjs.map +1 -1
  8. package/fesm2022/ktortu-aaa-dialog.mjs +240 -32
  9. package/fesm2022/ktortu-aaa-dialog.mjs.map +1 -1
  10. package/fesm2022/ktortu-aaa-disclosure.mjs +203 -0
  11. package/fesm2022/ktortu-aaa-disclosure.mjs.map +1 -0
  12. package/fesm2022/ktortu-aaa-forms.mjs +217 -103
  13. package/fesm2022/ktortu-aaa-forms.mjs.map +1 -1
  14. package/fesm2022/ktortu-aaa-progress-bar.mjs +91 -0
  15. package/fesm2022/ktortu-aaa-progress-bar.mjs.map +1 -0
  16. package/fesm2022/ktortu-aaa-snackbar.mjs +16 -3
  17. package/fesm2022/ktortu-aaa-snackbar.mjs.map +1 -1
  18. package/fesm2022/ktortu-aaa-tooltip.mjs +20 -30
  19. package/fesm2022/ktortu-aaa-tooltip.mjs.map +1 -1
  20. package/fesm2022/ktortu-aaa.mjs +1 -0
  21. package/fesm2022/ktortu-aaa.mjs.map +1 -1
  22. package/forms/field/field.css +16 -0
  23. package/forms/styles/field-box.css +11 -5
  24. package/package.json +9 -1
  25. package/progress-bar/progress-bar.css +127 -0
  26. package/styles/disclosure.css +6 -0
  27. package/styles/progress-bar.css +5 -0
  28. package/styles/styles.css +2 -0
  29. package/themes/theme-cyberpunk.css +11 -0
  30. package/tooltip/tooltip.css +1 -1
  31. package/types/ktortu-aaa-button.d.ts +2 -0
  32. package/types/ktortu-aaa-card.d.ts +69 -65
  33. package/types/ktortu-aaa-cdk.d.ts +27 -1
  34. package/types/ktortu-aaa-dialog.d.ts +134 -15
  35. package/types/ktortu-aaa-disclosure.d.ts +121 -0
  36. package/types/ktortu-aaa-forms.d.ts +69 -16
  37. package/types/ktortu-aaa-progress-bar.d.ts +27 -0
  38. package/types/ktortu-aaa-snackbar.d.ts +11 -68
  39. package/types/ktortu-aaa-tooltip.d.ts +0 -1
  40. package/types/ktortu-aaa.d.ts +1 -0
@@ -0,0 +1,203 @@
1
+ import * as i0 from '@angular/core';
2
+ import { InjectionToken, inject, ElementRef, input, booleanAttribute, Directive, ChangeDetectionStrategy, Component, model, contentChildren, forwardRef } from '@angular/core';
3
+ import { KT_AUDIT_ENABLED, KtIdGenerator } from '@ktortu/aaa/cdk';
4
+
5
+ const KT_DISCLOSURE = new InjectionToken('KT_DISCLOSURE');
6
+
7
+ /**
8
+ * Déclencheur d'un [ktDisclosure] : posé sur un **vrai `<button>`** (clavier Entrée/Espace
9
+ * gratuit). Câble `(click)` → `toggle()` et reflète l'état via `aria-expanded` / `aria-controls`
10
+ * (cf. ADR-0004). `type="button"` est posé **s'il est absent** (ne pas soumettre un formulaire,
11
+ * sans écraser un `type` explicite du consommateur).
12
+ *
13
+ * Le contenu du bouton appartient au consommateur (texte, icône, libellé piloté par `expanded()`). Un
14
+ * **chevron** décoratif (qui pivote selon l'état) est affiché par défaut ; le désactiver avec
15
+ * `[chevron]="false"`. La directive applique elle-même la classe de style — rien à écrire.
16
+ *
17
+ * @example
18
+ * ```html
19
+ * <button ktDisclosureToggle>Détails</button> <!-- avec chevron -->
20
+ * <button ktDisclosureToggle [chevron]="false">Détails</button> <!-- sans chevron -->
21
+ * ```
22
+ */
23
+ class KtDisclosureToggle {
24
+ disclosure = inject(KT_DISCLOSURE);
25
+ host = inject(ElementRef).nativeElement;
26
+ auditEnabled = inject(KT_AUDIT_ENABLED);
27
+ /** Affiche le chevron décoratif (qui pivote selon l'état). @default true */
28
+ chevron = input(true, { ...(ngDevMode ? { debugName: "chevron" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
29
+ constructor() {
30
+ // `type="button"` SI ABSENT (comme @angular/aria) : un attribut statique de host ne surchargerait
31
+ // pas un `type` posé dans le template, donc on le force impérativement à la construction.
32
+ if (!this.host.hasAttribute('type')) {
33
+ this.host.setAttribute('type', 'button');
34
+ }
35
+ }
36
+ ngAfterViewInit() {
37
+ if (!this.auditEnabled)
38
+ return;
39
+ const hasName = !!this.host.textContent?.trim() ||
40
+ !!this.host.getAttribute('aria-label')?.trim() ||
41
+ this.host.hasAttribute('aria-labelledby');
42
+ if (!hasName) {
43
+ console.warn('[ktDisclosureToggle] bouton sans nom accessible : ajoutez du texte visible, ' +
44
+ '[attr.aria-label] ou aria-labelledby (WCAG 4.1.2).');
45
+ }
46
+ }
47
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.1", ngImport: i0, type: KtDisclosureToggle, deps: [], target: i0.ɵɵFactoryTarget.Directive });
48
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.0.1", type: KtDisclosureToggle, isStandalone: true, selector: "button[ktDisclosureToggle]", inputs: { chevron: { classPropertyName: "chevron", publicName: "chevron", isSignal: true, isRequired: false, transformFunction: null } }, host: { listeners: { "click": "disclosure.toggle()" }, properties: { "attr.aria-expanded": "disclosure.expanded()", "attr.aria-controls": "disclosure.contentId", "class.kt-disclosure-toggle--chevron": "chevron()" } }, ngImport: i0 });
49
+ }
50
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.1", ngImport: i0, type: KtDisclosureToggle, decorators: [{
51
+ type: Directive,
52
+ args: [{
53
+ selector: 'button[ktDisclosureToggle]',
54
+ host: {
55
+ '[attr.aria-expanded]': 'disclosure.expanded()',
56
+ '[attr.aria-controls]': 'disclosure.contentId',
57
+ '[class.kt-disclosure-toggle--chevron]': 'chevron()',
58
+ '(click)': 'disclosure.toggle()',
59
+ },
60
+ }]
61
+ }], ctorParameters: () => [], propDecorators: { chevron: [{ type: i0.Input, args: [{ isSignal: true, alias: "chevron", required: false }] }] } });
62
+
63
+ /**
64
+ * Panneau repliable d'un [ktDisclosure]. **Composant** (et non directive) car l'animation grid
65
+ * `0fr ↔ 1fr` exige un **unique enfant `overflow:hidden`** autour du contenu projeté — ce wrapper
66
+ * (`.kt-disclosure-content__inner`) est fourni by le template, le consommateur reste libre d'y
67
+ * mettre autant de blocs qu'il veut.
68
+ *
69
+ * Porte l'`id` (cible de `aria-controls`) et passe **`inert`** quand c'est fermé : le contenu
70
+ * masqué sort de l'ordre de tabulation et de l'arbre d'accessibilité (jamais de focus dans
71
+ * l'invisible). Pas de `role=region` (anti-pollution du rotor de régions). Cf. ADR-0004.
72
+ *
73
+ * @example
74
+ * ```html
75
+ * <kt-disclosure-content>
76
+ * <p>Premier bloc</p>
77
+ * <p>Second bloc…</p>
78
+ * </kt-disclosure-content>
79
+ * ```
80
+ */
81
+ class KtDisclosureContent {
82
+ disclosure = inject(KT_DISCLOSURE);
83
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.1", ngImport: i0, type: KtDisclosureContent, deps: [], target: i0.ɵɵFactoryTarget.Component });
84
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.0.1", type: KtDisclosureContent, isStandalone: true, selector: "kt-disclosure-content", host: { properties: { "id": "disclosure.contentId", "attr.inert": "!disclosure.expanded() ? \"\" : null", "attr.data-expanded": "disclosure.expanded()" } }, ngImport: i0, template: '<div class="kt-disclosure-content__inner"><ng-content /></div>', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
85
+ }
86
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.1", ngImport: i0, type: KtDisclosureContent, decorators: [{
87
+ type: Component,
88
+ args: [{
89
+ selector: 'kt-disclosure-content',
90
+ changeDetection: ChangeDetectionStrategy.OnPush,
91
+ template: '<div class="kt-disclosure-content__inner"><ng-content /></div>',
92
+ host: {
93
+ '[id]': 'disclosure.contentId',
94
+ '[attr.inert]': '!disclosure.expanded() ? "" : null',
95
+ '[attr.data-expanded]': 'disclosure.expanded()',
96
+ },
97
+ }]
98
+ }] });
99
+
100
+ /**
101
+ * Disclosure : replie/déplie un **bloc d'interface** (volet d'options, module de dashboard,
102
+ * section d'une fiche produit). Directive HÔTE d'une famille à trois marqueurs — elle possède
103
+ * l'état, génère l'`id` du panneau et expose des méthodes impératives ; le câblage ARIA et
104
+ * l'animation vivent sur `[ktDisclosureToggle]` / `<kt-disclosure-content>`.
105
+ *
106
+ * Pour une **section de contenu** de page (façon Wikipédia / FAQ), préférer `<details>` natif
107
+ * (sémantique, find-in-page, SEO, zéro JS) — cf. ADR-0004.
108
+ *
109
+ * L'état est exposé via `exportAs: 'ktDisclosure'` : lisez `expanded()` pour piloter le template
110
+ * (ex. libellé « Voir plus / Voir moins ») sans input de libellé (i18n côté consommateur,
111
+ * cf. ADR-0003).
112
+ *
113
+ * Contrat : **un** `[ktDisclosureToggle]` et **un** `<kt-disclosure-content>` par hôte (id de
114
+ * panneau unique / `aria-controls` non ambigu) ; un avertissement dev le signale sinon.
115
+ *
116
+ * @example
117
+ * ```html
118
+ * <div ktDisclosure #d="ktDisclosure">
119
+ * <button ktDisclosureToggle>{{ d.expanded() ? 'Voir moins' : 'Voir plus' }}</button>
120
+ * <kt-disclosure-content><p>Mon contenu</p></kt-disclosure-content>
121
+ * </div>
122
+ * ```
123
+ */
124
+ class KtDisclosure {
125
+ idGen = inject(KtIdGenerator);
126
+ host = inject(ElementRef).nativeElement;
127
+ /** Identifiant stable du panneau contrôlé : cible de l'`aria-controls` du déclencheur. */
128
+ contentId = `kt-disclosure-content-${this.idGen.generateId('disclosure')}`;
129
+ /**
130
+ * État ouvert/fermé. **Toujours utilisé en binding** (`[(expanded)]` / `[expanded]`), jamais en
131
+ * attribut nu : un `model()` n'accepte pas de `booleanAttribute`, donc `<div ktDisclosure expanded>`
132
+ * pousserait la chaîne `''` au lieu de `true`. En binding, la valeur est garantie booléenne.
133
+ * @default false
134
+ */
135
+ expanded = model(false, /* @ts-ignore */
136
+ ...(ngDevMode ? [{ debugName: "expanded" }] : /* istanbul ignore next */ []));
137
+ auditEnabled = inject(KT_AUDIT_ENABLED);
138
+ toggles = contentChildren(forwardRef(() => KtDisclosureToggle), { ...(ngDevMode ? { debugName: "toggles" } : /* istanbul ignore next */ {}), descendants: true });
139
+ contents = contentChildren(forwardRef(() => KtDisclosureContent), { ...(ngDevMode ? { debugName: "contents" } : /* istanbul ignore next */ {}), descendants: true });
140
+ ngAfterContentInit() {
141
+ if (!this.auditEnabled)
142
+ return;
143
+ const myToggles = this.toggles().filter((t) => t.disclosure === this);
144
+ const myContents = this.contents().filter((c) => c.disclosure === this);
145
+ if (myToggles.length > 1 || myContents.length > 1) {
146
+ console.warn('[ktDisclosure] attend UN seul [ktDisclosureToggle] et UN seul <kt-disclosure-content> par ' +
147
+ 'hôte (id de panneau unique / aria-controls non ambigu). Pour plusieurs volets, utilisez ' +
148
+ 'plusieurs [ktDisclosure].');
149
+ }
150
+ }
151
+ /** Bascule l'état. */
152
+ toggle() {
153
+ this.expanded.set(!this.expanded());
154
+ }
155
+ /** Ouvre le panneau. */
156
+ expand() {
157
+ this.expanded.set(true);
158
+ }
159
+ /** Ferme le panneau. */
160
+ collapse() {
161
+ this.expanded.set(false);
162
+ }
163
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.1", ngImport: i0, type: KtDisclosure, deps: [], target: i0.ɵɵFactoryTarget.Directive });
164
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.2.0", version: "22.0.1", type: KtDisclosure, isStandalone: true, selector: "[ktDisclosure]", inputs: { expanded: { classPropertyName: "expanded", publicName: "expanded", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { expanded: "expandedChange" }, host: { properties: { "attr.data-expanded": "expanded()" } }, providers: [
165
+ {
166
+ provide: KT_DISCLOSURE,
167
+ useExisting: forwardRef(() => KtDisclosure),
168
+ },
169
+ ], queries: [{ propertyName: "toggles", predicate: i0.forwardRef(() => KtDisclosureToggle), descendants: true, isSignal: true }, { propertyName: "contents", predicate: i0.forwardRef(() => KtDisclosureContent), descendants: true, isSignal: true }], exportAs: ["ktDisclosure"], ngImport: i0 });
170
+ }
171
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.1", ngImport: i0, type: KtDisclosure, decorators: [{
172
+ type: Directive,
173
+ args: [{
174
+ selector: '[ktDisclosure]',
175
+ exportAs: 'ktDisclosure',
176
+ host: {
177
+ '[attr.data-expanded]': 'expanded()',
178
+ },
179
+ providers: [
180
+ {
181
+ provide: KT_DISCLOSURE,
182
+ useExisting: forwardRef(() => KtDisclosure),
183
+ },
184
+ ],
185
+ }]
186
+ }], propDecorators: { expanded: [{ type: i0.Input, args: [{ isSignal: true, alias: "expanded", required: false }] }, { type: i0.Output, args: ["expandedChange"] }], toggles: [{ type: i0.ContentChildren, args: [forwardRef(() => KtDisclosureToggle), { ...{
187
+ descendants: true,
188
+ }, isSignal: true }] }], contents: [{ type: i0.ContentChildren, args: [forwardRef(() => KtDisclosureContent), { ...{
189
+ descendants: true,
190
+ }, isSignal: true }] }] } });
191
+
192
+ /**
193
+ * Import ergonomique de toute la famille disclosure en une fois :
194
+ * `imports: [KtDisclosureImports]` au lieu d'énumérer chaque marqueur.
195
+ */
196
+ const KtDisclosureImports = [KtDisclosure, KtDisclosureToggle, KtDisclosureContent];
197
+
198
+ /**
199
+ * Generated bundle index. Do not edit.
200
+ */
201
+
202
+ export { KT_DISCLOSURE, KtDisclosure, KtDisclosureContent, KtDisclosureImports, KtDisclosureToggle };
203
+ //# sourceMappingURL=ktortu-aaa-disclosure.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ktortu-aaa-disclosure.mjs","sources":["../../../../projects/ktortu/aaa/disclosure/disclosure-token.ts","../../../../projects/ktortu/aaa/disclosure/disclosure-toggle.ts","../../../../projects/ktortu/aaa/disclosure/disclosure-content.ts","../../../../projects/ktortu/aaa/disclosure/disclosure.ts","../../../../projects/ktortu/aaa/disclosure/public-api.ts","../../../../projects/ktortu/aaa/disclosure/ktortu-aaa-disclosure.ts"],"sourcesContent":["import { InjectionToken } from '@angular/core';\n\nexport interface KtDisclosureInterface {\n readonly contentId: string;\n readonly expanded: () => boolean;\n toggle(): void;\n}\n\nexport const KT_DISCLOSURE = new InjectionToken<KtDisclosureInterface>('KT_DISCLOSURE');\n","import { AfterViewInit, Directive, ElementRef, booleanAttribute, inject, input } from '@angular/core';\nimport { KT_AUDIT_ENABLED } from '@ktortu/aaa/cdk';\nimport { KT_DISCLOSURE } from './disclosure-token';\n\n/**\n * Déclencheur d'un [ktDisclosure] : posé sur un **vrai `<button>`** (clavier Entrée/Espace\n * gratuit). Câble `(click)` → `toggle()` et reflète l'état via `aria-expanded` / `aria-controls`\n * (cf. ADR-0004). `type=\"button\"` est posé **s'il est absent** (ne pas soumettre un formulaire,\n * sans écraser un `type` explicite du consommateur).\n *\n * Le contenu du bouton appartient au consommateur (texte, icône, libellé piloté par `expanded()`). Un\n * **chevron** décoratif (qui pivote selon l'état) est affiché par défaut ; le désactiver avec\n * `[chevron]=\"false\"`. La directive applique elle-même la classe de style — rien à écrire.\n *\n * @example\n * ```html\n * <button ktDisclosureToggle>Détails</button> <!-- avec chevron -->\n * <button ktDisclosureToggle [chevron]=\"false\">Détails</button> <!-- sans chevron -->\n * ```\n */\n@Directive({\n selector: 'button[ktDisclosureToggle]',\n host: {\n '[attr.aria-expanded]': 'disclosure.expanded()',\n '[attr.aria-controls]': 'disclosure.contentId',\n '[class.kt-disclosure-toggle--chevron]': 'chevron()',\n '(click)': 'disclosure.toggle()',\n },\n})\nexport class KtDisclosureToggle implements AfterViewInit {\n readonly disclosure = inject(KT_DISCLOSURE);\n private readonly host = inject<ElementRef<HTMLElement>>(ElementRef).nativeElement;\n private readonly auditEnabled = inject(KT_AUDIT_ENABLED);\n\n /** Affiche le chevron décoratif (qui pivote selon l'état). @default true */\n readonly chevron = input(true, { transform: booleanAttribute });\n\n constructor() {\n // `type=\"button\"` SI ABSENT (comme @angular/aria) : un attribut statique de host ne surchargerait\n // pas un `type` posé dans le template, donc on le force impérativement à la construction.\n if (!this.host.hasAttribute('type')) {\n this.host.setAttribute('type', 'button');\n }\n }\n\n ngAfterViewInit(): void {\n if (!this.auditEnabled) return;\n\n const hasName =\n !!this.host.textContent?.trim() ||\n !!this.host.getAttribute('aria-label')?.trim() ||\n this.host.hasAttribute('aria-labelledby');\n if (!hasName) {\n console.warn(\n '[ktDisclosureToggle] bouton sans nom accessible : ajoutez du texte visible, ' +\n '[attr.aria-label] ou aria-labelledby (WCAG 4.1.2).',\n );\n }\n }\n}\n","import { ChangeDetectionStrategy, Component, inject } from '@angular/core';\nimport { KT_DISCLOSURE } from './disclosure-token';\n\n/**\n * Panneau repliable d'un [ktDisclosure]. **Composant** (et non directive) car l'animation grid\n * `0fr ↔ 1fr` exige un **unique enfant `overflow:hidden`** autour du contenu projeté — ce wrapper\n * (`.kt-disclosure-content__inner`) est fourni by le template, le consommateur reste libre d'y\n * mettre autant de blocs qu'il veut.\n *\n * Porte l'`id` (cible de `aria-controls`) et passe **`inert`** quand c'est fermé : le contenu\n * masqué sort de l'ordre de tabulation et de l'arbre d'accessibilité (jamais de focus dans\n * l'invisible). Pas de `role=region` (anti-pollution du rotor de régions). Cf. ADR-0004.\n *\n * @example\n * ```html\n * <kt-disclosure-content>\n * <p>Premier bloc</p>\n * <p>Second bloc…</p>\n * </kt-disclosure-content>\n * ```\n */\n@Component({\n selector: 'kt-disclosure-content',\n changeDetection: ChangeDetectionStrategy.OnPush,\n template: '<div class=\"kt-disclosure-content__inner\"><ng-content /></div>',\n host: {\n '[id]': 'disclosure.contentId',\n '[attr.inert]': '!disclosure.expanded() ? \"\" : null',\n '[attr.data-expanded]': 'disclosure.expanded()',\n },\n})\nexport class KtDisclosureContent {\n readonly disclosure = inject(KT_DISCLOSURE);\n}\n","import { AfterContentInit, Directive, ElementRef, contentChildren, forwardRef, inject, model } from '@angular/core';\nimport { KT_AUDIT_ENABLED, KtIdGenerator } from '@ktortu/aaa/cdk';\nimport { KT_DISCLOSURE } from './disclosure-token';\nimport { KtDisclosureToggle } from './disclosure-toggle';\nimport { KtDisclosureContent } from './disclosure-content';\n\n/**\n * Disclosure : replie/déplie un **bloc d'interface** (volet d'options, module de dashboard,\n * section d'une fiche produit). Directive HÔTE d'une famille à trois marqueurs — elle possède\n * l'état, génère l'`id` du panneau et expose des méthodes impératives ; le câblage ARIA et\n * l'animation vivent sur `[ktDisclosureToggle]` / `<kt-disclosure-content>`.\n *\n * Pour une **section de contenu** de page (façon Wikipédia / FAQ), préférer `<details>` natif\n * (sémantique, find-in-page, SEO, zéro JS) — cf. ADR-0004.\n *\n * L'état est exposé via `exportAs: 'ktDisclosure'` : lisez `expanded()` pour piloter le template\n * (ex. libellé « Voir plus / Voir moins ») sans input de libellé (i18n côté consommateur,\n * cf. ADR-0003).\n *\n * Contrat : **un** `[ktDisclosureToggle]` et **un** `<kt-disclosure-content>` par hôte (id de\n * panneau unique / `aria-controls` non ambigu) ; un avertissement dev le signale sinon.\n *\n * @example\n * ```html\n * <div ktDisclosure #d=\"ktDisclosure\">\n * <button ktDisclosureToggle>{{ d.expanded() ? 'Voir moins' : 'Voir plus' }}</button>\n * <kt-disclosure-content><p>Mon contenu</p></kt-disclosure-content>\n * </div>\n * ```\n */\n@Directive({\n selector: '[ktDisclosure]',\n exportAs: 'ktDisclosure',\n host: {\n '[attr.data-expanded]': 'expanded()',\n },\n providers: [\n {\n provide: KT_DISCLOSURE,\n useExisting: forwardRef(() => KtDisclosure),\n },\n ],\n})\nexport class KtDisclosure implements AfterContentInit {\n private readonly idGen = inject(KtIdGenerator);\n private readonly host = inject<ElementRef<HTMLElement>>(ElementRef).nativeElement;\n\n /** Identifiant stable du panneau contrôlé : cible de l'`aria-controls` du déclencheur. */\n readonly contentId = `kt-disclosure-content-${this.idGen.generateId('disclosure')}`;\n\n /**\n * État ouvert/fermé. **Toujours utilisé en binding** (`[(expanded)]` / `[expanded]`), jamais en\n * attribut nu : un `model()` n'accepte pas de `booleanAttribute`, donc `<div ktDisclosure expanded>`\n * pousserait la chaîne `''` au lieu de `true`. En binding, la valeur est garantie booléenne.\n * @default false\n */\n readonly expanded = model<boolean>(false);\n\n private readonly auditEnabled = inject(KT_AUDIT_ENABLED);\n\n readonly toggles = contentChildren<KtDisclosureToggle>(\n forwardRef(() => KtDisclosureToggle),\n {\n descendants: true,\n },\n );\n readonly contents = contentChildren<KtDisclosureContent>(\n forwardRef(() => KtDisclosureContent),\n {\n descendants: true,\n },\n );\n\n ngAfterContentInit(): void {\n if (!this.auditEnabled) return;\n const myToggles = this.toggles().filter((t) => t.disclosure === this);\n const myContents = this.contents().filter((c) => c.disclosure === this);\n if (myToggles.length > 1 || myContents.length > 1) {\n console.warn(\n '[ktDisclosure] attend UN seul [ktDisclosureToggle] et UN seul <kt-disclosure-content> par ' +\n 'hôte (id de panneau unique / aria-controls non ambigu). Pour plusieurs volets, utilisez ' +\n 'plusieurs [ktDisclosure].',\n );\n }\n }\n\n /** Bascule l'état. */\n toggle(): void {\n this.expanded.set(!this.expanded());\n }\n\n /** Ouvre le panneau. */\n expand(): void {\n this.expanded.set(true);\n }\n\n /** Ferme le panneau. */\n collapse(): void {\n this.expanded.set(false);\n }\n}\n","import { KtDisclosure } from './disclosure';\nimport { KtDisclosureContent } from './disclosure-content';\nimport { KtDisclosureToggle } from './disclosure-toggle';\n\nexport * from './disclosure';\nexport * from './disclosure-toggle';\nexport * from './disclosure-content';\nexport * from './disclosure-token';\n\n/**\n * Import ergonomique de toute la famille disclosure en une fois :\n * `imports: [KtDisclosureImports]` au lieu d'énumérer chaque marqueur.\n */\nexport const KtDisclosureImports = [KtDisclosure, KtDisclosureToggle, KtDisclosureContent] as const;\n","/**\n *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