@cityway/basic-ui 1.1.0-beta004 → 1.1.0-beta006

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,14 +1,15 @@
1
1
  import * as i1 from '@angular/common';
2
- import { CommonModule, NgClass, NgTemplateOutlet } from '@angular/common';
2
+ import { CommonModule, DOCUMENT, isPlatformBrowser, NgClass, NgTemplateOutlet } from '@angular/common';
3
3
  import * as i0 from '@angular/core';
4
- import { inject, ElementRef, signal, EventEmitter, effect, Output, Input, Directive, input, HostBinding, Component, ChangeDetectorRef, model, output, viewChild, contentChildren, Injectable, NgZone, HostListener, ChangeDetectionStrategy, Renderer2, ViewContainerRef, DestroyRef, ViewChild, computed, TemplateRef, ContentChild, ApplicationRef, Injector, createComponent, viewChildren, Pipe, forwardRef } from '@angular/core';
4
+ import { inject, ElementRef, model, output, effect, Directive, input, HostBinding, ChangeDetectionStrategy, Component, ChangeDetectorRef, viewChild, signal, contentChildren, DestroyRef, computed, Injectable, NgZone, Renderer2, ViewContainerRef, PLATFORM_ID, EventEmitter, TemplateRef, ContentChild, Output, Input, ApplicationRef, Injector, createComponent, viewChildren, Pipe, forwardRef } from '@angular/core';
5
5
  import * as i2 from '@ngx-translate/core';
6
6
  import { TranslatePipe, TranslateModule, TranslateService } from '@ngx-translate/core';
7
+ import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
7
8
  import { RouterLink, Router, ActivatedRoute } from '@angular/router';
8
9
  import { ComponentPortal } from '@angular/cdk/portal';
9
10
  import { Overlay, OverlayPositionBuilder } from '@angular/cdk/overlay';
10
- import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
11
- import { BehaviorSubject, fromEvent, tap, filter, debounceTime, switchMap, catchError, of } from 'rxjs';
11
+ import { BehaviorSubject, fromEvent, tap, filter, debounce, timer, switchMap, catchError, of } from 'rxjs';
12
+ import { map, distinctUntilChanged } from 'rxjs/operators';
12
13
  import * as i4 from '@angular-slider/ngx-slider';
13
14
  import { NgxSliderModule } from '@angular-slider/ngx-slider';
14
15
  export { Options } from '@angular-slider/ngx-slider';
@@ -19,52 +20,51 @@ import itiEn from 'intl-tel-input/dist/js/i18n/en.js';
19
20
  import itiFr from 'intl-tel-input/dist/js/i18n/fr.js';
20
21
  import * as i3 from '@ng-select/ng-select';
21
22
  import { NgSelectModule } from '@ng-select/ng-select';
23
+ import Quill from 'quill';
22
24
 
23
25
  class CollapseDirective {
24
- set cwCollapse(value) {
25
- this.collapsedSignal.set(value);
26
- }
27
- get cwCollapse() {
28
- return this.collapsedSignal();
29
- }
30
26
  constructor() {
31
27
  this.elementRef = inject(ElementRef);
32
- // Utilisation de signals pour la réactivité
33
- this.collapsedSignal = signal(false, ...(ngDevMode ? [{ debugName: "collapsedSignal" }] : []));
34
- this.shown = new EventEmitter();
35
- this.hidden = new EventEmitter();
36
- // Effect pour réagir aux changements de collapsed
28
+ /** Etat replie (true = masque). Signal writable : pilotable via `[cwCollapse]`, `[(cwCollapse)]` ou les methodes. */
29
+ this.cwCollapse = model(false, ...(ngDevMode ? [{ debugName: "cwCollapse" }] : []));
30
+ this.shown = output();
31
+ this.hidden = output();
32
+ // L'effect applique l'etat visuel (classe `show`) et emet shown/hidden UNIQUEMENT
33
+ // sur changement reel : la 1re execution (init) applique la classe sans emettre,
34
+ // evitant l'emission prematuree/dupliquee.
35
+ let firstRun = true;
37
36
  effect(() => {
38
- const isCollapsed = this.collapsedSignal();
39
- this.updateClasses(isCollapsed);
37
+ const isCollapsed = this.cwCollapse();
38
+ this.applyClasses(isCollapsed);
39
+ if (!firstRun) {
40
+ (isCollapsed ? this.hidden : this.shown).emit();
41
+ }
42
+ firstRun = false;
40
43
  });
41
44
  }
42
45
  ngOnInit() {
43
46
  this.elementRef.nativeElement.classList.add('collapse');
44
- this.updateClasses(this.collapsedSignal());
45
47
  }
46
- updateClasses(isCollapsed) {
48
+ applyClasses(isCollapsed) {
47
49
  const element = this.elementRef.nativeElement;
48
50
  if (isCollapsed) {
49
51
  element.classList.remove('show');
50
- this.hidden.emit();
51
52
  }
52
53
  else {
53
54
  element.classList.add('show');
54
- this.shown.emit();
55
55
  }
56
56
  }
57
57
  toggle() {
58
- this.collapsedSignal.update(value => !value);
58
+ this.cwCollapse.update(value => !value);
59
59
  }
60
60
  show() {
61
- this.collapsedSignal.set(false);
61
+ this.cwCollapse.set(false);
62
62
  }
63
63
  hide() {
64
- this.collapsedSignal.set(true);
64
+ this.cwCollapse.set(true);
65
65
  }
66
66
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: CollapseDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
67
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.20", type: CollapseDirective, isStandalone: true, selector: "[cwCollapse]", inputs: { cwCollapse: "cwCollapse" }, outputs: { shown: "shown", hidden: "hidden" }, exportAs: ["cwCollapse"], ngImport: i0 }); }
67
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "20.3.20", type: CollapseDirective, isStandalone: true, selector: "[cwCollapse]", inputs: { cwCollapse: { classPropertyName: "cwCollapse", publicName: "cwCollapse", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { cwCollapse: "cwCollapseChange", shown: "shown", hidden: "hidden" }, exportAs: ["cwCollapse"], ngImport: i0 }); }
68
68
  }
69
69
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: CollapseDirective, decorators: [{
70
70
  type: Directive,
@@ -73,14 +73,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.20", ngImpo
73
73
  exportAs: 'cwCollapse',
74
74
  standalone: true
75
75
  }]
76
- }], ctorParameters: () => [], propDecorators: { cwCollapse: [{
77
- type: Input,
78
- args: [{ required: false }]
79
- }], shown: [{
80
- type: Output
81
- }], hidden: [{
82
- type: Output
83
- }] } });
76
+ }], ctorParameters: () => [], propDecorators: { cwCollapse: [{ type: i0.Input, args: [{ isSignal: true, alias: "cwCollapse", required: false }] }, { type: i0.Output, args: ["cwCollapseChange"] }], shown: [{ type: i0.Output, args: ["shown"] }], hidden: [{ type: i0.Output, args: ["hidden"] }] } });
84
77
 
85
78
  // Échelle DS (component/icon/default/size/*) — picto.
86
79
  var IconSizeEnum;
@@ -110,6 +103,7 @@ var IconUiTypeEnum;
110
103
  IconUiTypeEnum["warning"] = "warning";
111
104
  IconUiTypeEnum["danger"] = "danger";
112
105
  IconUiTypeEnum["neutral"] = "neutral";
106
+ IconUiTypeEnum["disabled"] = "disabled";
113
107
  })(IconUiTypeEnum || (IconUiTypeEnum = {}));
114
108
 
115
109
  // AUTO-GENERATED — ne pas éditer manuellement
@@ -655,11 +649,11 @@ class IconComponent {
655
649
  return `icon icon-${this.iconSize()}`;
656
650
  }
657
651
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: IconComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
658
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.20", type: IconComponent, isStandalone: true, selector: "cw-icon", inputs: { icon: { classPropertyName: "icon", publicName: "icon", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: false, transformFunction: null }, iconSize: { classPropertyName: "iconSize", publicName: "iconSize", isSignal: true, isRequired: false, transformFunction: null }, iconCssClass: { classPropertyName: "iconCssClass", publicName: "iconCssClass", isSignal: true, isRequired: false, transformFunction: null }, iconUiType: { classPropertyName: "iconUiType", publicName: "iconUiType", isSignal: true, isRequired: false, transformFunction: null }, iconColorCustom: { classPropertyName: "iconColorCustom", publicName: "iconColorCustom", isSignal: true, isRequired: false, transformFunction: null }, spritePath: { classPropertyName: "spritePath", publicName: "spritePath", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "this.hostClasses" } }, ngImport: i0, template: "@if (type() == iconTypeEnum.circular || type() == iconTypeEnum.square) {\n <span class=\"icon\">\n <ng-container *ngTemplateOutlet=\"iconContent\"></ng-container>\n </span>\n} @else {\n <ng-container *ngTemplateOutlet=\"iconContent\"></ng-container>\n}\n\n<ng-template #iconContent>\n <svg class=\"icon-svg\" [ngClass]=\"iconCssClass()\" aria-hidden=\"true\"\n [attr.style]=\"iconColorCustom() ? 'color: ' + iconColorCustom() : null\">\n <use [attr.href]=\"spritePath() + '#' + icon()\" />\n </svg>\n @if (label()) {\n <span class=\"visually-hidden\">{{ label() }}</span>\n }\n</ng-template>\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }] }); }
652
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.20", type: IconComponent, isStandalone: true, selector: "cw-icon", inputs: { icon: { classPropertyName: "icon", publicName: "icon", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: false, transformFunction: null }, iconSize: { classPropertyName: "iconSize", publicName: "iconSize", isSignal: true, isRequired: false, transformFunction: null }, iconCssClass: { classPropertyName: "iconCssClass", publicName: "iconCssClass", isSignal: true, isRequired: false, transformFunction: null }, iconUiType: { classPropertyName: "iconUiType", publicName: "iconUiType", isSignal: true, isRequired: false, transformFunction: null }, iconColorCustom: { classPropertyName: "iconColorCustom", publicName: "iconColorCustom", isSignal: true, isRequired: false, transformFunction: null }, spritePath: { classPropertyName: "spritePath", publicName: "spritePath", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "this.hostClasses" } }, ngImport: i0, template: "@if (type() === iconTypeEnum.circular || type() === iconTypeEnum.square) {\n <span class=\"icon\">\n <ng-container *ngTemplateOutlet=\"iconContent\"></ng-container>\n </span>\n} @else {\n <ng-container *ngTemplateOutlet=\"iconContent\"></ng-container>\n}\n\n<ng-template #iconContent>\n <svg class=\"icon-svg\" [ngClass]=\"iconCssClass()\" aria-hidden=\"true\"\n [attr.style]=\"iconColorCustom() ? 'color: ' + iconColorCustom() : null\">\n <use [attr.href]=\"spritePath() + '#' + icon()\" />\n </svg>\n @if (label()) {\n <span class=\"visually-hidden\">{{ label() }}</span>\n }\n</ng-template>\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
659
653
  }
660
654
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: IconComponent, decorators: [{
661
655
  type: Component,
662
- args: [{ selector: 'cw-icon', standalone: true, imports: [CommonModule], template: "@if (type() == iconTypeEnum.circular || type() == iconTypeEnum.square) {\n <span class=\"icon\">\n <ng-container *ngTemplateOutlet=\"iconContent\"></ng-container>\n </span>\n} @else {\n <ng-container *ngTemplateOutlet=\"iconContent\"></ng-container>\n}\n\n<ng-template #iconContent>\n <svg class=\"icon-svg\" [ngClass]=\"iconCssClass()\" aria-hidden=\"true\"\n [attr.style]=\"iconColorCustom() ? 'color: ' + iconColorCustom() : null\">\n <use [attr.href]=\"spritePath() + '#' + icon()\" />\n </svg>\n @if (label()) {\n <span class=\"visually-hidden\">{{ label() }}</span>\n }\n</ng-template>\n" }]
656
+ args: [{ selector: 'cw-icon', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, imports: [CommonModule], template: "@if (type() === iconTypeEnum.circular || type() === iconTypeEnum.square) {\n <span class=\"icon\">\n <ng-container *ngTemplateOutlet=\"iconContent\"></ng-container>\n </span>\n} @else {\n <ng-container *ngTemplateOutlet=\"iconContent\"></ng-container>\n}\n\n<ng-template #iconContent>\n <svg class=\"icon-svg\" [ngClass]=\"iconCssClass()\" aria-hidden=\"true\"\n [attr.style]=\"iconColorCustom() ? 'color: ' + iconColorCustom() : null\">\n <use [attr.href]=\"spritePath() + '#' + icon()\" />\n </svg>\n @if (label()) {\n <span class=\"visually-hidden\">{{ label() }}</span>\n }\n</ng-template>\n" }]
663
657
  }], propDecorators: { icon: [{ type: i0.Input, args: [{ isSignal: true, alias: "icon", required: false }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], type: [{ type: i0.Input, args: [{ isSignal: true, alias: "type", required: false }] }], iconSize: [{ type: i0.Input, args: [{ isSignal: true, alias: "iconSize", required: false }] }], iconCssClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "iconCssClass", required: false }] }], iconUiType: [{ type: i0.Input, args: [{ isSignal: true, alias: "iconUiType", required: false }] }], iconColorCustom: [{ type: i0.Input, args: [{ isSignal: true, alias: "iconColorCustom", required: false }] }], spritePath: [{ type: i0.Input, args: [{ isSignal: true, alias: "spritePath", required: false }] }], hostClasses: [{
664
658
  type: HostBinding,
665
659
  args: ['class']
@@ -688,6 +682,19 @@ class CardComponent {
688
682
  this.collapsed = input(false, ...(ngDevMode ? [{ debugName: "collapsed" }] : []));
689
683
  /** Panneau collapsible desactive : non depliable/repliable, grise. Sans effet si non collapsible. */
690
684
  this.disabled = input(false, ...(ngDevMode ? [{ debugName: "disabled" }] : []));
685
+ /**
686
+ * Verrouille le pliage SANS griser le panneau : le chevron n'est pas rendu et l'en-tete
687
+ * n'est plus cliquable, mais titre et sous-titre gardent leur couleur normale.
688
+ *
689
+ * Difference avec `disabled` : `disabled` signifie « pas encore accessible » (grise),
690
+ * `collapseLocked` signifie « etat fige, pilote par l'hote » — typiquement une etape
691
+ * d'assistant deja validee, qu'on ne veut ni griser ni laisser rouvrir.
692
+ *
693
+ * L'hote garde la main via `collapse()` / `expand()`, qui ignorent le verrou : celui-ci
694
+ * ne bloque que l'interaction utilisateur et l'automatisme de `cw-accordion`.
695
+ * Sans effet si non collapsible.
696
+ */
697
+ this.collapseLocked = input(false, ...(ngDevMode ? [{ debugName: "collapseLocked" }] : []));
691
698
  /**
692
699
  * Applique `stretched-link` sur le bouton de collapse (clic sur tout l'en-tête).
693
700
  * À passer à `false` quand l'en-tête contient des éléments interactifs (poignée de
@@ -700,7 +707,7 @@ class CardComponent {
700
707
  this.collapseClicked = output();
701
708
  this.collapseDirective = viewChild('collapse', ...(ngDevMode ? [{ debugName: "collapseDirective" }] : []));
702
709
  this.cardFooter = viewChild('cardFooter', ...(ngDevMode ? [{ debugName: "cardFooter" }] : []));
703
- this.showFooter = true;
710
+ this.showFooter = signal(true, ...(ngDevMode ? [{ debugName: "showFooter" }] : []));
704
711
  this.titleRankEnum = CardTitleRankEnum;
705
712
  this.typeEnum = CardTypeEnum;
706
713
  this.isCollapsed = signal(false, ...(ngDevMode ? [{ debugName: "isCollapsed" }] : []));
@@ -716,11 +723,11 @@ class CardComponent {
716
723
  }
717
724
  ngAfterViewInit() {
718
725
  const el = this.cardFooter()?.nativeElement;
719
- this.showFooter = !!el && el.children.length > 0;
726
+ this.showFooter.set(!!el && el.children.length > 0);
720
727
  this.cdRef.detectChanges();
721
728
  }
722
729
  toggleCollapse() {
723
- if (this.collapsible() && !this.disabled()) {
730
+ if (this.collapsible() && !this.disabled() && !this.collapseLocked()) {
724
731
  const newCollapsedState = !this.isCollapsed();
725
732
  this.updateCollapseState(newCollapsedState);
726
733
  }
@@ -732,7 +739,12 @@ class CardComponent {
732
739
  this.updateCollapseState(false);
733
740
  }
734
741
  updateCollapseState(collapsed) {
735
- if (!collapsed && this.destroyOnHide() && !this.shouldRenderBody()) {
742
+ // Restauration inconditionnelle : `destroyOnHide` conditionne le RETRAIT du body, pas son
743
+ // retour. Le tester ici laissait un panneau vide dans un cas precis : `ngOnInit` retire le
744
+ // body (destroyOnHide vaut encore son defaut `true`), puis un parent le passe a `false`
745
+ // apres coup (cw-accordion, dans son ngAfterContentInit) -> l'expansion ne le remettait
746
+ // jamais. Deplier doit toujours garantir un body rendu.
747
+ if (!collapsed && !this.shouldRenderBody()) {
736
748
  this.shouldRenderBody.set(true);
737
749
  this.cdRef.detectChanges();
738
750
  }
@@ -751,17 +763,17 @@ class CardComponent {
751
763
  return this.isCollapsed();
752
764
  }
753
765
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: CardComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
754
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.20", type: CardComponent, isStandalone: true, selector: "cw-card", inputs: { title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: false, transformFunction: null }, subtitle: { classPropertyName: "subtitle", publicName: "subtitle", isSignal: true, isRequired: false, transformFunction: null }, type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: false, transformFunction: null }, titleRank: { classPropertyName: "titleRank", publicName: "titleRank", isSignal: true, isRequired: false, transformFunction: null }, cssClass: { classPropertyName: "cssClass", publicName: "cssClass", isSignal: true, isRequired: false, transformFunction: null }, collapsible: { classPropertyName: "collapsible", publicName: "collapsible", isSignal: true, isRequired: false, transformFunction: null }, collapsed: { classPropertyName: "collapsed", publicName: "collapsed", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, collapseStretched: { classPropertyName: "collapseStretched", publicName: "collapseStretched", isSignal: true, isRequired: false, transformFunction: null }, collapseId: { classPropertyName: "collapseId", publicName: "collapseId", isSignal: true, isRequired: false, transformFunction: null }, destroyOnHide: { classPropertyName: "destroyOnHide", publicName: "destroyOnHide", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { collapsible: "collapsibleChange", destroyOnHide: "destroyOnHideChange", collapseClicked: "collapseClicked" }, viewQueries: [{ propertyName: "collapseDirective", first: true, predicate: ["collapse"], descendants: true, isSignal: true }, { propertyName: "cardFooter", first: true, predicate: ["cardFooter"], descendants: true, isSignal: true }], ngImport: i0, template: "<div class=\"card\" [ngClass]=\"cssClass()\" [class.card-collapse]=\"collapsible()\" [class.card-disabled]=\"collapsible() && disabled()\" [class.card-light]=\"type() == typeEnum.light\">\n @if (title()) {\n <div class=\"card-header\" [class.card-header-collapse]=\"collapsible()\"\n [class.card-header-collapsed]=\"collapsible() && isCollapsed()\">\n <ng-container *ngTemplateOutlet=\"header\"></ng-container>\n </div>\n }\n\n @if(collapsible()) {\n <div [cwCollapse]=\"isCollapsed()\" [id]=\"collapseId()\" #collapse=\"cwCollapse\">\n <ng-container *ngTemplateOutlet=\"content\"></ng-container>\n </div>\n }\n @else {\n <ng-container *ngTemplateOutlet=\"content\"></ng-container>\n }\n</div>\n\n<ng-template #header>\n <ng-content select=\"[header-start]\"></ng-content>\n\n <div class=\"card-header-content\">\n @if (titleRank() == titleRankEnum.h2) {\n <h2 class=\"text-truncate\">{{title() | translate}}</h2>\n }\n @else if (titleRank() == titleRankEnum.h3) {\n <h3 class=\"text-truncate\">{{title() | translate}}</h3>\n }\n\n <div class=\"card-subtitle fs fs-xs text-light text-truncate\" [innerHTML]=\"subtitle()\"></div>\n </div>\n\n <div class=\"card-header-custom-area\">\n <ng-content select=\"[header-custom-area]\"></ng-content>\n </div>\n\n @if (collapsible()) {\n <button type=\"button\" class=\"btn btn-collapse\" [class.stretched-link]=\"collapseStretched() && !disabled()\"\n (click)=\"toggleCollapse()\" [disabled]=\"disabled()\" [attr.aria-disabled]=\"disabled()\"\n [attr.aria-expanded]=\"!isCollapsed()\" [class.collapsed]=\"isCollapsed()\" [attr.aria-controls]=\"collapseId()\">\n <cw-icon [icon]=\"spriteIcon.up\" [iconSize]=\"iconSize['xs']\"></cw-icon>\n <span class=\"visually-hidden\">D\u00E9plier/Plier</span>\n </button>\n }\n</ng-template>\n\n<ng-template #content>\n @if (shouldRenderBody()) {\n <div class=\"card-body\">\n <ng-content></ng-content>\n </div>\n\n @if (showFooter) {\n <div class=\"card-footer\" #cardFooter>\n <ng-content select=\"[card-footer]\"></ng-content>\n </div>\n }\n }\n</ng-template>\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: CollapseDirective, selector: "[cwCollapse]", inputs: ["cwCollapse"], outputs: ["shown", "hidden"], exportAs: ["cwCollapse"] }, { kind: "component", type: IconComponent, selector: "cw-icon", inputs: ["icon", "label", "type", "iconSize", "iconCssClass", "iconUiType", "iconColorCustom", "spritePath"] }, { kind: "pipe", type: TranslatePipe, name: "translate" }] }); }
766
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.20", type: CardComponent, isStandalone: true, selector: "cw-card", inputs: { title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: false, transformFunction: null }, subtitle: { classPropertyName: "subtitle", publicName: "subtitle", isSignal: true, isRequired: false, transformFunction: null }, type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: false, transformFunction: null }, titleRank: { classPropertyName: "titleRank", publicName: "titleRank", isSignal: true, isRequired: false, transformFunction: null }, cssClass: { classPropertyName: "cssClass", publicName: "cssClass", isSignal: true, isRequired: false, transformFunction: null }, collapsible: { classPropertyName: "collapsible", publicName: "collapsible", isSignal: true, isRequired: false, transformFunction: null }, collapsed: { classPropertyName: "collapsed", publicName: "collapsed", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, collapseLocked: { classPropertyName: "collapseLocked", publicName: "collapseLocked", isSignal: true, isRequired: false, transformFunction: null }, collapseStretched: { classPropertyName: "collapseStretched", publicName: "collapseStretched", isSignal: true, isRequired: false, transformFunction: null }, collapseId: { classPropertyName: "collapseId", publicName: "collapseId", isSignal: true, isRequired: false, transformFunction: null }, destroyOnHide: { classPropertyName: "destroyOnHide", publicName: "destroyOnHide", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { collapsible: "collapsibleChange", destroyOnHide: "destroyOnHideChange", collapseClicked: "collapseClicked" }, viewQueries: [{ propertyName: "collapseDirective", first: true, predicate: ["collapse"], descendants: true, isSignal: true }, { propertyName: "cardFooter", first: true, predicate: ["cardFooter"], descendants: true, isSignal: true }], ngImport: i0, template: "<div class=\"card\" [ngClass]=\"cssClass()\" [class.card-collapse]=\"collapsible()\" [class.card-disabled]=\"collapsible() && disabled()\" [class.card-light]=\"type() === typeEnum.light\">\r\n @if (title()) {\r\n <div class=\"card-header\" [class.card-header-collapse]=\"collapsible()\"\r\n [class.card-header-collapsed]=\"collapsible() && isCollapsed()\">\r\n <ng-container *ngTemplateOutlet=\"header\"></ng-container>\r\n </div>\r\n }\r\n\r\n @if(collapsible()) {\r\n <div [cwCollapse]=\"isCollapsed()\" [id]=\"collapseId()\" #collapse=\"cwCollapse\">\r\n <ng-container *ngTemplateOutlet=\"content\"></ng-container>\r\n </div>\r\n }\r\n @else {\r\n <ng-container *ngTemplateOutlet=\"content\"></ng-container>\r\n }\r\n</div>\r\n\r\n<ng-template #header>\r\n <ng-content select=\"[header-start]\"></ng-content>\r\n\r\n <div class=\"card-header-content\">\r\n @if (titleRank() === titleRankEnum.h2) {\r\n <h2 class=\"text-truncate\">{{title() | translate}}</h2>\r\n }\r\n @else if (titleRank() === titleRankEnum.h3) {\r\n <h3 class=\"text-truncate\">{{title() | translate}}</h3>\r\n }\r\n\r\n <div class=\"card-subtitle fs fs-xs text-light text-truncate\" [innerHTML]=\"subtitle()\"></div>\r\n </div>\r\n\r\n <div class=\"card-header-custom-area\">\r\n <ng-content select=\"[header-custom-area]\"></ng-content>\r\n </div>\r\n\r\n <!-- collapseLocked : pas de chevron, donc pas de stretched-link -> en-tete non cliquable,\r\n sans passer par `disabled` (qui grise titre et sous-titre). -->\r\n @if (collapsible() && !collapseLocked()) {\r\n <button type=\"button\" class=\"btn btn-collapse\" [class.stretched-link]=\"collapseStretched() && !disabled()\"\r\n (click)=\"toggleCollapse()\" [disabled]=\"disabled()\" [attr.aria-disabled]=\"disabled()\"\r\n [attr.aria-expanded]=\"!isCollapsed()\" [class.collapsed]=\"isCollapsed()\" [attr.aria-controls]=\"collapseId()\">\r\n <cw-icon [icon]=\"spriteIcon.up\" [iconSize]=\"iconSize['xs']\"></cw-icon>\r\n <span class=\"visually-hidden\">{{ '_COMMON._ACTION.EXPAND_COLLAPSE' | translate }}</span>\r\n </button>\r\n }\r\n</ng-template>\r\n\r\n<ng-template #content>\r\n @if (shouldRenderBody()) {\r\n <div class=\"card-body\">\r\n <ng-content></ng-content>\r\n </div>\r\n\r\n @if (showFooter()) {\r\n <div class=\"card-footer\" #cardFooter>\r\n <ng-content select=\"[card-footer]\"></ng-content>\r\n </div>\r\n }\r\n }\r\n</ng-template>\r\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: CollapseDirective, selector: "[cwCollapse]", inputs: ["cwCollapse"], outputs: ["cwCollapseChange", "shown", "hidden"], exportAs: ["cwCollapse"] }, { kind: "component", type: IconComponent, selector: "cw-icon", inputs: ["icon", "label", "type", "iconSize", "iconCssClass", "iconUiType", "iconColorCustom", "spritePath"] }, { kind: "pipe", type: TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
755
767
  }
756
768
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: CardComponent, decorators: [{
757
769
  type: Component,
758
- args: [{ selector: 'cw-card', standalone: true, imports: [
770
+ args: [{ selector: 'cw-card', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, imports: [
759
771
  CommonModule,
760
772
  CollapseDirective,
761
773
  IconComponent,
762
774
  TranslatePipe
763
- ], template: "<div class=\"card\" [ngClass]=\"cssClass()\" [class.card-collapse]=\"collapsible()\" [class.card-disabled]=\"collapsible() && disabled()\" [class.card-light]=\"type() == typeEnum.light\">\n @if (title()) {\n <div class=\"card-header\" [class.card-header-collapse]=\"collapsible()\"\n [class.card-header-collapsed]=\"collapsible() && isCollapsed()\">\n <ng-container *ngTemplateOutlet=\"header\"></ng-container>\n </div>\n }\n\n @if(collapsible()) {\n <div [cwCollapse]=\"isCollapsed()\" [id]=\"collapseId()\" #collapse=\"cwCollapse\">\n <ng-container *ngTemplateOutlet=\"content\"></ng-container>\n </div>\n }\n @else {\n <ng-container *ngTemplateOutlet=\"content\"></ng-container>\n }\n</div>\n\n<ng-template #header>\n <ng-content select=\"[header-start]\"></ng-content>\n\n <div class=\"card-header-content\">\n @if (titleRank() == titleRankEnum.h2) {\n <h2 class=\"text-truncate\">{{title() | translate}}</h2>\n }\n @else if (titleRank() == titleRankEnum.h3) {\n <h3 class=\"text-truncate\">{{title() | translate}}</h3>\n }\n\n <div class=\"card-subtitle fs fs-xs text-light text-truncate\" [innerHTML]=\"subtitle()\"></div>\n </div>\n\n <div class=\"card-header-custom-area\">\n <ng-content select=\"[header-custom-area]\"></ng-content>\n </div>\n\n @if (collapsible()) {\n <button type=\"button\" class=\"btn btn-collapse\" [class.stretched-link]=\"collapseStretched() && !disabled()\"\n (click)=\"toggleCollapse()\" [disabled]=\"disabled()\" [attr.aria-disabled]=\"disabled()\"\n [attr.aria-expanded]=\"!isCollapsed()\" [class.collapsed]=\"isCollapsed()\" [attr.aria-controls]=\"collapseId()\">\n <cw-icon [icon]=\"spriteIcon.up\" [iconSize]=\"iconSize['xs']\"></cw-icon>\n <span class=\"visually-hidden\">D\u00E9plier/Plier</span>\n </button>\n }\n</ng-template>\n\n<ng-template #content>\n @if (shouldRenderBody()) {\n <div class=\"card-body\">\n <ng-content></ng-content>\n </div>\n\n @if (showFooter) {\n <div class=\"card-footer\" #cardFooter>\n <ng-content select=\"[card-footer]\"></ng-content>\n </div>\n }\n }\n</ng-template>\n" }]
764
- }], propDecorators: { title: [{ type: i0.Input, args: [{ isSignal: true, alias: "title", required: false }] }], subtitle: [{ type: i0.Input, args: [{ isSignal: true, alias: "subtitle", required: false }] }], type: [{ type: i0.Input, args: [{ isSignal: true, alias: "type", required: false }] }], titleRank: [{ type: i0.Input, args: [{ isSignal: true, alias: "titleRank", required: false }] }], cssClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "cssClass", required: false }] }], collapsible: [{ type: i0.Input, args: [{ isSignal: true, alias: "collapsible", required: false }] }, { type: i0.Output, args: ["collapsibleChange"] }], collapsed: [{ type: i0.Input, args: [{ isSignal: true, alias: "collapsed", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], collapseStretched: [{ type: i0.Input, args: [{ isSignal: true, alias: "collapseStretched", required: false }] }], collapseId: [{ type: i0.Input, args: [{ isSignal: true, alias: "collapseId", required: false }] }], destroyOnHide: [{ type: i0.Input, args: [{ isSignal: true, alias: "destroyOnHide", required: false }] }, { type: i0.Output, args: ["destroyOnHideChange"] }], collapseClicked: [{ type: i0.Output, args: ["collapseClicked"] }], collapseDirective: [{ type: i0.ViewChild, args: ['collapse', { isSignal: true }] }], cardFooter: [{ type: i0.ViewChild, args: ['cardFooter', { isSignal: true }] }] } });
775
+ ], template: "<div class=\"card\" [ngClass]=\"cssClass()\" [class.card-collapse]=\"collapsible()\" [class.card-disabled]=\"collapsible() && disabled()\" [class.card-light]=\"type() === typeEnum.light\">\r\n @if (title()) {\r\n <div class=\"card-header\" [class.card-header-collapse]=\"collapsible()\"\r\n [class.card-header-collapsed]=\"collapsible() && isCollapsed()\">\r\n <ng-container *ngTemplateOutlet=\"header\"></ng-container>\r\n </div>\r\n }\r\n\r\n @if(collapsible()) {\r\n <div [cwCollapse]=\"isCollapsed()\" [id]=\"collapseId()\" #collapse=\"cwCollapse\">\r\n <ng-container *ngTemplateOutlet=\"content\"></ng-container>\r\n </div>\r\n }\r\n @else {\r\n <ng-container *ngTemplateOutlet=\"content\"></ng-container>\r\n }\r\n</div>\r\n\r\n<ng-template #header>\r\n <ng-content select=\"[header-start]\"></ng-content>\r\n\r\n <div class=\"card-header-content\">\r\n @if (titleRank() === titleRankEnum.h2) {\r\n <h2 class=\"text-truncate\">{{title() | translate}}</h2>\r\n }\r\n @else if (titleRank() === titleRankEnum.h3) {\r\n <h3 class=\"text-truncate\">{{title() | translate}}</h3>\r\n }\r\n\r\n <div class=\"card-subtitle fs fs-xs text-light text-truncate\" [innerHTML]=\"subtitle()\"></div>\r\n </div>\r\n\r\n <div class=\"card-header-custom-area\">\r\n <ng-content select=\"[header-custom-area]\"></ng-content>\r\n </div>\r\n\r\n <!-- collapseLocked : pas de chevron, donc pas de stretched-link -> en-tete non cliquable,\r\n sans passer par `disabled` (qui grise titre et sous-titre). -->\r\n @if (collapsible() && !collapseLocked()) {\r\n <button type=\"button\" class=\"btn btn-collapse\" [class.stretched-link]=\"collapseStretched() && !disabled()\"\r\n (click)=\"toggleCollapse()\" [disabled]=\"disabled()\" [attr.aria-disabled]=\"disabled()\"\r\n [attr.aria-expanded]=\"!isCollapsed()\" [class.collapsed]=\"isCollapsed()\" [attr.aria-controls]=\"collapseId()\">\r\n <cw-icon [icon]=\"spriteIcon.up\" [iconSize]=\"iconSize['xs']\"></cw-icon>\r\n <span class=\"visually-hidden\">{{ '_COMMON._ACTION.EXPAND_COLLAPSE' | translate }}</span>\r\n </button>\r\n }\r\n</ng-template>\r\n\r\n<ng-template #content>\r\n @if (shouldRenderBody()) {\r\n <div class=\"card-body\">\r\n <ng-content></ng-content>\r\n </div>\r\n\r\n @if (showFooter()) {\r\n <div class=\"card-footer\" #cardFooter>\r\n <ng-content select=\"[card-footer]\"></ng-content>\r\n </div>\r\n }\r\n }\r\n</ng-template>\r\n" }]
776
+ }], propDecorators: { title: [{ type: i0.Input, args: [{ isSignal: true, alias: "title", required: false }] }], subtitle: [{ type: i0.Input, args: [{ isSignal: true, alias: "subtitle", required: false }] }], type: [{ type: i0.Input, args: [{ isSignal: true, alias: "type", required: false }] }], titleRank: [{ type: i0.Input, args: [{ isSignal: true, alias: "titleRank", required: false }] }], cssClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "cssClass", required: false }] }], collapsible: [{ type: i0.Input, args: [{ isSignal: true, alias: "collapsible", required: false }] }, { type: i0.Output, args: ["collapsibleChange"] }], collapsed: [{ type: i0.Input, args: [{ isSignal: true, alias: "collapsed", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], collapseLocked: [{ type: i0.Input, args: [{ isSignal: true, alias: "collapseLocked", required: false }] }], collapseStretched: [{ type: i0.Input, args: [{ isSignal: true, alias: "collapseStretched", required: false }] }], collapseId: [{ type: i0.Input, args: [{ isSignal: true, alias: "collapseId", required: false }] }], destroyOnHide: [{ type: i0.Input, args: [{ isSignal: true, alias: "destroyOnHide", required: false }] }, { type: i0.Output, args: ["destroyOnHideChange"] }], collapseClicked: [{ type: i0.Output, args: ["collapseClicked"] }], collapseDirective: [{ type: i0.ViewChild, args: ['collapse', { isSignal: true }] }], cardFooter: [{ type: i0.ViewChild, args: ['cardFooter', { isSignal: true }] }] } });
765
777
 
766
778
  class AccordionComponent {
767
779
  constructor() {
@@ -771,6 +783,7 @@ class AccordionComponent {
771
783
  this.panelOpened = output();
772
784
  this.panelClosed = output();
773
785
  this.cards = contentChildren(CardComponent, ...(ngDevMode ? [{ debugName: "cards" }] : []));
786
+ this.destroyRef = inject(DestroyRef);
774
787
  this.cardMap = new Map();
775
788
  }
776
789
  ngAfterContentInit() {
@@ -782,14 +795,17 @@ class AccordionComponent {
782
795
  card.destroyOnHide.set(this.destroyOnHide());
783
796
  }
784
797
  this.cardMap.set(card.collapseId(), card);
785
- card.collapseClicked.subscribe((isCollapsed) => {
798
+ // collapseClicked est un OutputEmitterRef (output signal) : sa souscription hors
799
+ // contexte d'injection n'est pas nettoyee automatiquement -> teardown explicite.
800
+ const sub = card.collapseClicked.subscribe((isCollapsed) => {
786
801
  this.onCardToggle(card.collapseId(), isCollapsed);
787
802
  });
803
+ this.destroyRef.onDestroy(() => sub.unsubscribe());
788
804
  });
789
805
  }
790
806
  openPanel(panelId) {
791
807
  const card = this.cardMap.get(panelId);
792
- if (card && !card.disabled()) {
808
+ if (card && this.isTogglable(card)) {
793
809
  if (this.shouldCloseOthers()) {
794
810
  this.closeAllExcept(panelId);
795
811
  }
@@ -798,7 +814,7 @@ class AccordionComponent {
798
814
  }
799
815
  closePanel(panelId) {
800
816
  const card = this.cardMap.get(panelId);
801
- if (card && !card.disabled()) {
817
+ if (card && this.isTogglable(card)) {
802
818
  card.collapse();
803
819
  }
804
820
  }
@@ -815,14 +831,14 @@ class AccordionComponent {
815
831
  }
816
832
  closeAll() {
817
833
  this.cards().forEach(card => {
818
- if (!card.disabled())
834
+ if (this.isTogglable(card))
819
835
  card.collapse();
820
836
  });
821
837
  }
822
838
  openAll() {
823
839
  if (!this.shouldCloseOthers()) {
824
840
  this.cards().forEach(card => {
825
- if (!card.disabled())
841
+ if (this.isTogglable(card))
826
842
  card.expand();
827
843
  });
828
844
  }
@@ -840,7 +856,7 @@ class AccordionComponent {
840
856
  }
841
857
  closeAllExcept(exceptId) {
842
858
  this.cards().forEach(card => {
843
- if (card.collapseId() !== exceptId && !card.disabled()) {
859
+ if (card.collapseId() !== exceptId && this.isTogglable(card)) {
844
860
  card.collapse();
845
861
  }
846
862
  });
@@ -848,12 +864,20 @@ class AccordionComponent {
848
864
  shouldCloseOthers() {
849
865
  return this.closeOthers() && !this.allowMultiple();
850
866
  }
867
+ /**
868
+ * Panneaux que l'accordeon s'autorise a plier/deplier : `disabled` = pas encore accessible,
869
+ * `collapseLocked` = etat fige pilote par l'hote. Dans les deux cas l'automatisme
870
+ * (dont `closeOthers`) doit laisser le panneau tel quel.
871
+ */
872
+ isTogglable(card) {
873
+ return !card.disabled() && !card.collapseLocked();
874
+ }
851
875
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: AccordionComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
852
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "20.3.20", type: AccordionComponent, isStandalone: true, selector: "cw-accordion", inputs: { closeOthers: { classPropertyName: "closeOthers", publicName: "closeOthers", isSignal: true, isRequired: false, transformFunction: null }, allowMultiple: { classPropertyName: "allowMultiple", publicName: "allowMultiple", isSignal: true, isRequired: false, transformFunction: null }, destroyOnHide: { classPropertyName: "destroyOnHide", publicName: "destroyOnHide", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { panelOpened: "panelOpened", panelClosed: "panelClosed" }, queries: [{ propertyName: "cards", predicate: CardComponent, isSignal: true }], ngImport: i0, template: "<div class=\"accordion\">\r\n <ng-content></ng-content>\r\n</div>\r\n", dependencies: [{ kind: "ngmodule", type: CommonModule }] }); }
876
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "20.3.20", type: AccordionComponent, isStandalone: true, selector: "cw-accordion", inputs: { closeOthers: { classPropertyName: "closeOthers", publicName: "closeOthers", isSignal: true, isRequired: false, transformFunction: null }, allowMultiple: { classPropertyName: "allowMultiple", publicName: "allowMultiple", isSignal: true, isRequired: false, transformFunction: null }, destroyOnHide: { classPropertyName: "destroyOnHide", publicName: "destroyOnHide", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { panelOpened: "panelOpened", panelClosed: "panelClosed" }, queries: [{ propertyName: "cards", predicate: CardComponent, isSignal: true }], ngImport: i0, template: "<div class=\"accordion\">\r\n <ng-content></ng-content>\r\n</div>\r\n", dependencies: [{ kind: "ngmodule", type: CommonModule }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
853
877
  }
854
878
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: AccordionComponent, decorators: [{
855
879
  type: Component,
856
- args: [{ selector: 'cw-accordion', standalone: true, imports: [CommonModule], template: "<div class=\"accordion\">\r\n <ng-content></ng-content>\r\n</div>\r\n" }]
880
+ args: [{ selector: 'cw-accordion', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, imports: [CommonModule], template: "<div class=\"accordion\">\r\n <ng-content></ng-content>\r\n</div>\r\n" }]
857
881
  }], propDecorators: { closeOthers: [{ type: i0.Input, args: [{ isSignal: true, alias: "closeOthers", required: false }] }], allowMultiple: [{ type: i0.Input, args: [{ isSignal: true, alias: "allowMultiple", required: false }] }], destroyOnHide: [{ type: i0.Input, args: [{ isSignal: true, alias: "destroyOnHide", required: false }] }], panelOpened: [{ type: i0.Output, args: ["panelOpened"] }], panelClosed: [{ type: i0.Output, args: ["panelClosed"] }], cards: [{ type: i0.ContentChildren, args: [i0.forwardRef(() => CardComponent), { isSignal: true }] }] } });
858
882
 
859
883
  var AlertTypeEnum;
@@ -882,43 +906,30 @@ class IconNotificationComponent {
882
906
  constructor() {
883
907
  this.type = input(IconNotifTypeEnum.info, ...(ngDevMode ? [{ debugName: "type" }] : []));
884
908
  this.iconSizeEnum = IconSizeEnum;
885
- }
909
+ this.icon = computed(() => IconNotificationComponent.CONFIG[this.type()].icon, ...(ngDevMode ? [{ debugName: "icon" }] : []));
910
+ this.labelKey = computed(() => IconNotificationComponent.CONFIG[this.type()].labelKey, ...(ngDevMode ? [{ debugName: "labelKey" }] : []));
911
+ }
912
+ // Config par type : picto + cle i18n du libelle accessible.
913
+ static { this.CONFIG = {
914
+ [IconNotifTypeEnum.info]: { icon: SpriteIconEnum.infoCircle, labelKey: '_COMMON._ICON_NOTIF.INFO' },
915
+ [IconNotifTypeEnum.success]: { icon: SpriteIconEnum.checkCircle, labelKey: '_COMMON._ICON_NOTIF.SUCCESS' },
916
+ [IconNotifTypeEnum.warning]: { icon: SpriteIconEnum.alertCircle, labelKey: '_COMMON._ICON_NOTIF.WARNING' },
917
+ [IconNotifTypeEnum.danger]: { icon: SpriteIconEnum.closeCircle, labelKey: '_COMMON._ICON_NOTIF.DANGER' },
918
+ [IconNotifTypeEnum.careful]: { icon: SpriteIconEnum.event, labelKey: '_COMMON._ICON_NOTIF.CAREFUL' },
919
+ }; }
886
920
  get hostClasses() {
887
921
  return 'icon-notification icon-notification-' + this.type();
888
922
  }
889
- ngOnInit() {
890
- switch (this.type()) {
891
- case IconNotifTypeEnum.info:
892
- this.icon = SpriteIconEnum.infoCircle;
893
- this.label = 'Informatiion';
894
- break;
895
- case IconNotifTypeEnum.success:
896
- this.icon = SpriteIconEnum.checkCircle;
897
- this.label = 'Succès';
898
- break;
899
- case IconNotifTypeEnum.warning:
900
- this.icon = SpriteIconEnum.alertCircle;
901
- this.label = 'Avertisement';
902
- break;
903
- case IconNotifTypeEnum.danger:
904
- this.icon = SpriteIconEnum.closeCircle;
905
- this.label = 'Erreur';
906
- break;
907
- case IconNotifTypeEnum.careful:
908
- this.icon = SpriteIconEnum.event;
909
- this.label = 'Attention';
910
- break;
911
- }
912
- }
913
923
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: IconNotificationComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
914
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "20.3.20", type: IconNotificationComponent, isStandalone: true, selector: "cw-icon-notification", inputs: { type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "this.hostClasses" } }, ngImport: i0, template: "\r\n<span class=\"icon\">\r\n <cw-icon [label]=\"label\" [iconSize]=\"iconSizeEnum['sm']\" [icon]=\"icon\"></cw-icon>\r\n</span>\r\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "component", type: IconComponent, selector: "cw-icon", inputs: ["icon", "label", "type", "iconSize", "iconCssClass", "iconUiType", "iconColorCustom", "spritePath"] }] }); }
924
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "20.3.20", type: IconNotificationComponent, isStandalone: true, selector: "cw-icon-notification", inputs: { type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "this.hostClasses" } }, ngImport: i0, template: "\r\n<span class=\"icon\">\r\n <cw-icon [label]=\"labelKey() | translate\" [iconSize]=\"iconSizeEnum['sm']\" [icon]=\"icon()\"></cw-icon>\r\n</span>\r\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "component", type: IconComponent, selector: "cw-icon", inputs: ["icon", "label", "type", "iconSize", "iconCssClass", "iconUiType", "iconColorCustom", "spritePath"] }, { kind: "pipe", type: TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
915
925
  }
916
926
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: IconNotificationComponent, decorators: [{
917
927
  type: Component,
918
- args: [{ selector: 'cw-icon-notification', standalone: true, imports: [
928
+ args: [{ selector: 'cw-icon-notification', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, imports: [
919
929
  CommonModule,
920
- IconComponent
921
- ], template: "\r\n<span class=\"icon\">\r\n <cw-icon [label]=\"label\" [iconSize]=\"iconSizeEnum['sm']\" [icon]=\"icon\"></cw-icon>\r\n</span>\r\n" }]
930
+ IconComponent,
931
+ TranslatePipe
932
+ ], template: "\r\n<span class=\"icon\">\r\n <cw-icon [label]=\"labelKey() | translate\" [iconSize]=\"iconSizeEnum['sm']\" [icon]=\"icon()\"></cw-icon>\r\n</span>\r\n" }]
922
933
  }], propDecorators: { type: [{ type: i0.Input, args: [{ isSignal: true, alias: "type", required: false }] }], hostClasses: [{
923
934
  type: HostBinding,
924
935
  args: ['class']
@@ -932,37 +943,25 @@ class AlertComponent {
932
943
  this.isDismissible = input(false, ...(ngDevMode ? [{ debugName: "isDismissible" }] : []));
933
944
  this.cssClass = input('', ...(ngDevMode ? [{ debugName: "cssClass" }] : []));
934
945
  this.dataTest = input(...(ngDevMode ? [undefined, { debugName: "dataTest" }] : []));
946
+ // Nom expose dans la public-api (consomme via `(close)`) : renommer serait un
947
+ // breaking change. Candidat a renommer (ex: `closed`) lors d'un futur bump majeur.
948
+ // eslint-disable-next-line @angular-eslint/no-output-native
935
949
  this.close = output();
936
950
  this.alertContent = viewChild('alertContent', ...(ngDevMode ? [{ debugName: "alertContent" }] : []));
937
951
  this.isVisible = true;
938
952
  this.showContent = true;
939
953
  this.iconSize = IconSizeEnum;
940
954
  this.spriteIcon = SpriteIconEnum;
941
- }
942
- ngOnInit() {
943
- this.resolvedDataTest = this.dataTest() ? this.dataTest() : 'alert' + this.type();
944
- switch (this.type()) {
945
- case AlertTypeEnum.info:
946
- this.icon = "cw-alert-info2";
947
- this.iconNotifType = IconNotifTypeEnum.info;
948
- break;
949
- case AlertTypeEnum.danger:
950
- this.icon = "cw-toolbar-close1";
951
- this.iconNotifType = IconNotifTypeEnum.danger;
952
- break;
953
- case AlertTypeEnum.warning:
954
- this.icon = "cw-event-warning";
955
- this.iconNotifType = IconNotifTypeEnum.warning;
956
- break;
957
- case AlertTypeEnum.success:
958
- this.icon = "cw-alert-success2";
959
- this.iconNotifType = IconNotifTypeEnum.success;
960
- break;
961
- default:
962
- this.icon = "cw-alert-info2";
963
- this.iconNotifType = IconNotifTypeEnum.info;
964
- break;
965
- }
955
+ this.resolvedDataTest = computed(() => this.dataTest() || 'alert' + this.type(), ...(ngDevMode ? [{ debugName: "resolvedDataTest" }] : []));
956
+ this.iconNotifType = computed(() => {
957
+ switch (this.type()) {
958
+ case AlertTypeEnum.danger: return IconNotifTypeEnum.danger;
959
+ case AlertTypeEnum.warning: return IconNotifTypeEnum.warning;
960
+ case AlertTypeEnum.success: return IconNotifTypeEnum.success;
961
+ case AlertTypeEnum.info:
962
+ default: return IconNotifTypeEnum.info;
963
+ }
964
+ }, ...(ngDevMode ? [{ debugName: "iconNotifType" }] : []));
966
965
  }
967
966
  ngAfterViewInit() {
968
967
  const el = this.alertContent()?.nativeElement;
@@ -993,36 +992,35 @@ class AlertComponent {
993
992
  this.close.emit(true);
994
993
  }
995
994
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: AlertComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
996
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.20", type: AlertComponent, isStandalone: true, selector: "cw-alert", inputs: { type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: false, transformFunction: null }, title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: false, transformFunction: null }, isDismissible: { classPropertyName: "isDismissible", publicName: "isDismissible", isSignal: true, isRequired: false, transformFunction: null }, cssClass: { classPropertyName: "cssClass", publicName: "cssClass", isSignal: true, isRequired: false, transformFunction: null }, dataTest: { classPropertyName: "dataTest", publicName: "dataTest", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { close: "close" }, viewQueries: [{ propertyName: "alertContent", first: true, predicate: ["alertContent"], descendants: true, isSignal: true }], ngImport: i0, template: "@if (isVisible) {\n <div [class]=\"'alert alert-' + type() + ' '+ cssClass()\" [ngClass]=\"{ 'alert-dismissible fade show': isDismissible() }\"\n [attr.data-test-ctw]=\"resolvedDataTest\">\n <cw-icon-notification [type]=\"iconNotifType\"></cw-icon-notification>\n <div class=\"alert-content\">\n @if (title()) {\n <div class=\"fw-bold\">{{ title() | translate }}</div>\n }\n\n <p #alertContent [hidden]=\"!showContent\">\n <ng-content></ng-content>\n </p>\n </div>\n @if (isDismissible()) {\n <button type=\"button\" class=\"btn-close\" (click)=\"closeAlert()\"\n [attr.aria-label]=\"'_COMMON._ACTION.CLOSE' | translate\"\n [attr.data-test-ctw]=\"'close-' + resolvedDataTest\">\n <cw-icon [label]=\"'_COMMON._ACTION.CLOSE' | translate\" [iconSize]=\"iconSize['sm']\" [icon]=\"spriteIcon.toolbarClose\"></cw-icon>\n </button>\n }\n </div>\n}\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "ngmodule", type: TranslateModule }, { kind: "component", type: IconNotificationComponent, selector: "cw-icon-notification", inputs: ["type"] }, { kind: "component", type: IconComponent, selector: "cw-icon", inputs: ["icon", "label", "type", "iconSize", "iconCssClass", "iconUiType", "iconColorCustom", "spritePath"] }, { kind: "pipe", type: i2.TranslatePipe, name: "translate" }] }); }
995
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.20", type: AlertComponent, isStandalone: true, selector: "cw-alert", inputs: { type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: false, transformFunction: null }, title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: false, transformFunction: null }, isDismissible: { classPropertyName: "isDismissible", publicName: "isDismissible", isSignal: true, isRequired: false, transformFunction: null }, cssClass: { classPropertyName: "cssClass", publicName: "cssClass", isSignal: true, isRequired: false, transformFunction: null }, dataTest: { classPropertyName: "dataTest", publicName: "dataTest", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { close: "close" }, viewQueries: [{ propertyName: "alertContent", first: true, predicate: ["alertContent"], descendants: true, isSignal: true }], ngImport: i0, template: "@if (isVisible) {\n <div [class]=\"'alert alert-' + type() + ' '+ cssClass()\" [ngClass]=\"{ 'alert-dismissible fade show': isDismissible() }\"\n [attr.data-test-ctw]=\"resolvedDataTest()\">\n <cw-icon-notification [type]=\"iconNotifType()\"></cw-icon-notification>\n <div class=\"alert-content\">\n @if (title()) {\n <div class=\"fw-bold\">{{ title() | translate }}</div>\n }\n\n <p #alertContent [hidden]=\"!showContent\">\n <ng-content></ng-content>\n </p>\n </div>\n @if (isDismissible()) {\n <button type=\"button\" class=\"btn-close\" (click)=\"closeAlert()\"\n [attr.aria-label]=\"'_COMMON._ACTION.CLOSE' | translate\"\n [attr.data-test-ctw]=\"'close-' + resolvedDataTest()\">\n <cw-icon [label]=\"'_COMMON._ACTION.CLOSE' | translate\" [iconSize]=\"iconSize['sm']\" [icon]=\"spriteIcon.toolbarClose\"></cw-icon>\n </button>\n }\n </div>\n}\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "ngmodule", type: TranslateModule }, { kind: "component", type: IconNotificationComponent, selector: "cw-icon-notification", inputs: ["type"] }, { kind: "component", type: IconComponent, selector: "cw-icon", inputs: ["icon", "label", "type", "iconSize", "iconCssClass", "iconUiType", "iconColorCustom", "spritePath"] }, { kind: "pipe", type: i2.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
997
996
  }
998
997
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: AlertComponent, decorators: [{
999
998
  type: Component,
1000
- args: [{ selector: 'cw-alert', standalone: true, imports: [
999
+ args: [{ selector: 'cw-alert', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, imports: [
1001
1000
  CommonModule,
1002
1001
  TranslateModule,
1003
1002
  IconNotificationComponent,
1004
1003
  IconComponent
1005
- ], template: "@if (isVisible) {\n <div [class]=\"'alert alert-' + type() + ' '+ cssClass()\" [ngClass]=\"{ 'alert-dismissible fade show': isDismissible() }\"\n [attr.data-test-ctw]=\"resolvedDataTest\">\n <cw-icon-notification [type]=\"iconNotifType\"></cw-icon-notification>\n <div class=\"alert-content\">\n @if (title()) {\n <div class=\"fw-bold\">{{ title() | translate }}</div>\n }\n\n <p #alertContent [hidden]=\"!showContent\">\n <ng-content></ng-content>\n </p>\n </div>\n @if (isDismissible()) {\n <button type=\"button\" class=\"btn-close\" (click)=\"closeAlert()\"\n [attr.aria-label]=\"'_COMMON._ACTION.CLOSE' | translate\"\n [attr.data-test-ctw]=\"'close-' + resolvedDataTest\">\n <cw-icon [label]=\"'_COMMON._ACTION.CLOSE' | translate\" [iconSize]=\"iconSize['sm']\" [icon]=\"spriteIcon.toolbarClose\"></cw-icon>\n </button>\n }\n </div>\n}\n" }]
1004
+ ], template: "@if (isVisible) {\n <div [class]=\"'alert alert-' + type() + ' '+ cssClass()\" [ngClass]=\"{ 'alert-dismissible fade show': isDismissible() }\"\n [attr.data-test-ctw]=\"resolvedDataTest()\">\n <cw-icon-notification [type]=\"iconNotifType()\"></cw-icon-notification>\n <div class=\"alert-content\">\n @if (title()) {\n <div class=\"fw-bold\">{{ title() | translate }}</div>\n }\n\n <p #alertContent [hidden]=\"!showContent\">\n <ng-content></ng-content>\n </p>\n </div>\n @if (isDismissible()) {\n <button type=\"button\" class=\"btn-close\" (click)=\"closeAlert()\"\n [attr.aria-label]=\"'_COMMON._ACTION.CLOSE' | translate\"\n [attr.data-test-ctw]=\"'close-' + resolvedDataTest()\">\n <cw-icon [label]=\"'_COMMON._ACTION.CLOSE' | translate\" [iconSize]=\"iconSize['sm']\" [icon]=\"spriteIcon.toolbarClose\"></cw-icon>\n </button>\n }\n </div>\n}\n" }]
1006
1005
  }], propDecorators: { type: [{ type: i0.Input, args: [{ isSignal: true, alias: "type", required: false }] }], title: [{ type: i0.Input, args: [{ isSignal: true, alias: "title", required: false }] }], isDismissible: [{ type: i0.Input, args: [{ isSignal: true, alias: "isDismissible", required: false }] }], cssClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "cssClass", required: false }] }], dataTest: [{ type: i0.Input, args: [{ isSignal: true, alias: "dataTest", required: false }] }], close: [{ type: i0.Output, args: ["close"] }], alertContent: [{ type: i0.ViewChild, args: ['alertContent', { isSignal: true }] }] } });
1007
1006
 
1008
1007
  class FocusTrackerService {
1009
1008
  constructor() {
1009
+ this.document = inject(DOCUMENT);
1010
1010
  this.lastFocusedElement = null;
1011
- this.focusListener = this.onFocus.bind(this);
1012
- document.addEventListener('focus', this.focusListener, true);
1013
- }
1014
- onFocus(event) {
1015
- const target = event.target;
1016
- if (target) {
1017
- this.lastFocusedElement = target;
1018
- }
1011
+ this.onFocus = (event) => {
1012
+ const target = event.target;
1013
+ if (target) {
1014
+ this.lastFocusedElement = target;
1015
+ }
1016
+ };
1017
+ // Service `root` (duree de vie = application) : listener capture, pas de teardown
1018
+ // necessaire. inject(DOCUMENT) plutot que le global `document` => sur pour le SSR.
1019
+ this.document.addEventListener('focus', this.onFocus, true);
1019
1020
  }
1020
1021
  getFocusedElement() {
1021
1022
  return this.lastFocusedElement;
1022
1023
  }
1023
- ngOnDestroy() {
1024
- document.removeEventListener('focus', this.focusListener, true);
1025
- }
1026
1024
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: FocusTrackerService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
1027
1025
  static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: FocusTrackerService, providedIn: 'root' }); }
1028
1026
  }
@@ -1200,44 +1198,44 @@ class ToastItemComponent {
1200
1198
  }
1201
1199
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: ToastItemComponent, decorators: [{
1202
1200
  type: Component,
1203
- args: [{ selector: 'cw-toast-item', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, imports: [CommonModule, AlertComponent, TranslatePipe], template: "<cw-alert\n [type]=\"toast().type\"\n [isDismissible]=\"true\"\n [title]=\"toast().title | translate\"\n (close)=\"onClose()\"\n [dataTest]=\"'toast-' + toast().type\">\n <span [innerHTML]=\"toast().message | translate\"></span>&nbsp;\n @if (toast().action; as action) {\n <a href=\"javascript:void(0);\" (click)=\"onAction()\" class=\"alert-link\">{{ action.label }}</a>\n }\n</cw-alert>\n\n@if (toast().autohide) {\n <div class=\"toast-progress\" [style.width.%]=\"progress()\"></div>\n}\n" }]
1204
- }], propDecorators: { toast: [{ type: i0.Input, args: [{ isSignal: true, alias: "toast", required: true }] }], action: [{ type: i0.Output, args: ["action"] }], onMouseEnter: [{
1205
- type: HostListener,
1206
- args: ['mouseenter']
1207
- }], onMouseLeave: [{
1208
- type: HostListener,
1209
- args: ['mouseleave']
1210
- }], onFocusIn: [{
1211
- type: HostListener,
1212
- args: ['focusin']
1213
- }], onFocusOut: [{
1214
- type: HostListener,
1215
- args: ['focusout', ['$event']]
1216
- }] } });
1201
+ args: [{ selector: 'cw-toast-item', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, imports: [CommonModule, AlertComponent, TranslatePipe], host: {
1202
+ '(mouseenter)': 'onMouseEnter()',
1203
+ '(mouseleave)': 'onMouseLeave()',
1204
+ '(focusin)': 'onFocusIn()',
1205
+ '(focusout)': 'onFocusOut($event)',
1206
+ }, template: "<cw-alert\n [type]=\"toast().type\"\n [isDismissible]=\"true\"\n [title]=\"toast().title | translate\"\n (close)=\"onClose()\"\n [dataTest]=\"'toast-' + toast().type\">\n <span [innerHTML]=\"toast().message | translate\"></span>&nbsp;\n @if (toast().action; as action) {\n <a href=\"javascript:void(0);\" (click)=\"onAction()\" class=\"alert-link\">{{ action.label }}</a>\n }\n</cw-alert>\n\n@if (toast().autohide) {\n <div class=\"toast-progress\" [style.width.%]=\"progress()\"></div>\n}\n" }]
1207
+ }], propDecorators: { toast: [{ type: i0.Input, args: [{ isSignal: true, alias: "toast", required: true }] }], action: [{ type: i0.Output, args: ["action"] }] } });
1217
1208
 
1218
1209
  class ToastComponent {
1219
1210
  constructor() {
1220
1211
  this.toastService = inject(ToastService);
1221
1212
  this.elRef = inject(ElementRef);
1213
+ this.renderer = inject(Renderer2);
1214
+ this.destroyRef = inject(DestroyRef);
1222
1215
  this.action = output();
1223
1216
  }
1224
1217
  ngAfterViewInit() {
1225
- const elemPosition = this.elRef.nativeElement.getBoundingClientRect();
1226
- document.addEventListener("scroll", () => {
1227
- if (window.scrollY >= elemPosition.top * 2) {
1218
+ // Listener enregistre via Renderer2 + teardown DestroyRef (auparavant addEventListener jamais retire).
1219
+ const unlisten = this.renderer.listen('document', 'scroll', () => {
1220
+ // Offset document (invariant au scroll, mais recalcule => reflete les changements de layout ;
1221
+ // auparavant getBoundingClientRect() etait fige une seule fois dans ngAfterViewInit).
1222
+ const rect = this.elRef.nativeElement.getBoundingClientRect();
1223
+ const elemDocTop = rect.top + window.scrollY;
1224
+ if (window.scrollY >= elemDocTop * 2) {
1228
1225
  this.elRef.nativeElement.classList.remove('is-absolute');
1229
1226
  }
1230
1227
  else {
1231
1228
  this.elRef.nativeElement.classList.add('is-absolute');
1232
1229
  }
1233
1230
  });
1231
+ this.destroyRef.onDestroy(unlisten);
1234
1232
  }
1235
1233
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: ToastComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
1236
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.20", type: ToastComponent, isStandalone: true, selector: "cw-toast", outputs: { action: "action" }, host: { properties: { "class.toast": "true" } }, ngImport: i0, template: "@for (toast of toastService.toasts(); track toast.id) {\n <cw-toast-item [toast]=\"toast\" (action)=\"action.emit($event)\"></cw-toast-item>\n}\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "component", type: ToastItemComponent, selector: "cw-toast-item", inputs: ["toast"], outputs: ["action"] }] }); }
1234
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.20", type: ToastComponent, isStandalone: true, selector: "cw-toast", outputs: { action: "action" }, host: { properties: { "class.toast": "true" } }, ngImport: i0, template: "@for (toast of toastService.toasts(); track toast.id) {\n <cw-toast-item [toast]=\"toast\" (action)=\"action.emit($event)\"></cw-toast-item>\n}\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "component", type: ToastItemComponent, selector: "cw-toast-item", inputs: ["toast"], outputs: ["action"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
1237
1235
  }
1238
1236
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: ToastComponent, decorators: [{
1239
1237
  type: Component,
1240
- args: [{ selector: 'cw-toast', standalone: true, imports: [CommonModule, ToastItemComponent], host: { '[class.toast]': 'true' }, template: "@for (toast of toastService.toasts(); track toast.id) {\n <cw-toast-item [toast]=\"toast\" (action)=\"action.emit($event)\"></cw-toast-item>\n}\n" }]
1238
+ args: [{ selector: 'cw-toast', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, imports: [CommonModule, ToastItemComponent], host: { '[class.toast]': 'true' }, template: "@for (toast of toastService.toasts(); track toast.id) {\n <cw-toast-item [toast]=\"toast\" (action)=\"action.emit($event)\"></cw-toast-item>\n}\n" }]
1241
1239
  }], propDecorators: { action: [{ type: i0.Output, args: ["action"] }] } });
1242
1240
 
1243
1241
  var BadgeTypeEnum;
@@ -1280,17 +1278,21 @@ class BadgeComponent {
1280
1278
  return this.skeletonMode() ? 'skeleton badge' : '';
1281
1279
  }
1282
1280
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: BadgeComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
1283
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.20", type: BadgeComponent, isStandalone: true, selector: "cw-badge", inputs: { type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: true, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, withIcon: { classPropertyName: "withIcon", publicName: "withIcon", isSignal: true, isRequired: false, transformFunction: null }, iconPosition: { classPropertyName: "iconPosition", publicName: "iconPosition", isSignal: true, isRequired: false, transformFunction: null }, cssClass: { classPropertyName: "cssClass", publicName: "cssClass", isSignal: true, isRequired: false, transformFunction: null }, skeletonMode: { classPropertyName: "skeletonMode", publicName: "skeletonMode", isSignal: true, isRequired: false, transformFunction: null }, dataTest: { classPropertyName: "dataTest", publicName: "dataTest", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "this.hostClasses" } }, ngImport: i0, template: "<div [class]=\"'badge badge-' + type() + ' '+ cssClass()\" [attr.data-test-ctw]=\"dataTest() ? dataTest() : null\">\n\n @if (withIcon() && iconPosition() === badgePositionEnum.left) {\n <cw-icon [icon]=\"withIcon()\" [iconSize]=\"iconSizeEnum['2xs']\"></cw-icon>\n }\n\n @if (label()) {\n {{ label() | translate }}\n }\n\n @if (withIcon() && iconPosition() === badgePositionEnum.right) {\n <cw-icon [icon]=\"withIcon()\" [iconSize]=\"iconSizeEnum['2xs']\"></cw-icon>\n }\n</div>\n", dependencies: [{ kind: "component", type: IconComponent, selector: "cw-icon", inputs: ["icon", "label", "type", "iconSize", "iconCssClass", "iconUiType", "iconColorCustom", "spritePath"] }, { kind: "pipe", type: TranslatePipe, name: "translate" }] }); }
1281
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.20", type: BadgeComponent, isStandalone: true, selector: "cw-badge", inputs: { type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: true, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, withIcon: { classPropertyName: "withIcon", publicName: "withIcon", isSignal: true, isRequired: false, transformFunction: null }, iconPosition: { classPropertyName: "iconPosition", publicName: "iconPosition", isSignal: true, isRequired: false, transformFunction: null }, cssClass: { classPropertyName: "cssClass", publicName: "cssClass", isSignal: true, isRequired: false, transformFunction: null }, skeletonMode: { classPropertyName: "skeletonMode", publicName: "skeletonMode", isSignal: true, isRequired: false, transformFunction: null }, dataTest: { classPropertyName: "dataTest", publicName: "dataTest", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "this.hostClasses" } }, ngImport: i0, template: "<div [class]=\"'badge badge-' + type() + ' '+ cssClass()\" [attr.data-test-ctw]=\"dataTest() ? dataTest() : null\">\n\n @if (withIcon() && iconPosition() === badgePositionEnum.left) {\n <cw-icon [icon]=\"withIcon()\" [iconSize]=\"iconSizeEnum['2xs']\"></cw-icon>\n }\n\n @if (label()) {\n {{ label() | translate }}\n }\n\n @if (withIcon() && iconPosition() === badgePositionEnum.right) {\n <cw-icon [icon]=\"withIcon()\" [iconSize]=\"iconSizeEnum['2xs']\"></cw-icon>\n }\n</div>\n", dependencies: [{ kind: "component", type: IconComponent, selector: "cw-icon", inputs: ["icon", "label", "type", "iconSize", "iconCssClass", "iconUiType", "iconColorCustom", "spritePath"] }, { kind: "pipe", type: TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
1284
1282
  }
1285
1283
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: BadgeComponent, decorators: [{
1286
1284
  type: Component,
1287
- args: [{ selector: 'cw-badge', standalone: true, imports: [IconComponent, TranslatePipe], template: "<div [class]=\"'badge badge-' + type() + ' '+ cssClass()\" [attr.data-test-ctw]=\"dataTest() ? dataTest() : null\">\n\n @if (withIcon() && iconPosition() === badgePositionEnum.left) {\n <cw-icon [icon]=\"withIcon()\" [iconSize]=\"iconSizeEnum['2xs']\"></cw-icon>\n }\n\n @if (label()) {\n {{ label() | translate }}\n }\n\n @if (withIcon() && iconPosition() === badgePositionEnum.right) {\n <cw-icon [icon]=\"withIcon()\" [iconSize]=\"iconSizeEnum['2xs']\"></cw-icon>\n }\n</div>\n" }]
1285
+ args: [{ selector: 'cw-badge', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, imports: [IconComponent, TranslatePipe], template: "<div [class]=\"'badge badge-' + type() + ' '+ cssClass()\" [attr.data-test-ctw]=\"dataTest() ? dataTest() : null\">\n\n @if (withIcon() && iconPosition() === badgePositionEnum.left) {\n <cw-icon [icon]=\"withIcon()\" [iconSize]=\"iconSizeEnum['2xs']\"></cw-icon>\n }\n\n @if (label()) {\n {{ label() | translate }}\n }\n\n @if (withIcon() && iconPosition() === badgePositionEnum.right) {\n <cw-icon [icon]=\"withIcon()\" [iconSize]=\"iconSizeEnum['2xs']\"></cw-icon>\n }\n</div>\n" }]
1288
1286
  }], propDecorators: { type: [{ type: i0.Input, args: [{ isSignal: true, alias: "type", required: true }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], withIcon: [{ type: i0.Input, args: [{ isSignal: true, alias: "withIcon", required: false }] }], iconPosition: [{ type: i0.Input, args: [{ isSignal: true, alias: "iconPosition", required: false }] }], cssClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "cssClass", required: false }] }], skeletonMode: [{ type: i0.Input, args: [{ isSignal: true, alias: "skeletonMode", required: false }] }], dataTest: [{ type: i0.Input, args: [{ isSignal: true, alias: "dataTest", required: false }] }], hostClasses: [{
1289
1287
  type: HostBinding,
1290
1288
  args: ['class']
1291
1289
  }] } });
1292
1290
 
1293
1291
  class ClickOutsideDirective {
1292
+ constructor() {
1293
+ this.elementRef = inject(ElementRef);
1294
+ this.clickOutside = output();
1295
+ }
1294
1296
  onClick(event) {
1295
1297
  const target = event.target;
1296
1298
  const clickedInside = this.elementRef.nativeElement.contains(target);
@@ -1298,25 +1300,20 @@ class ClickOutsideDirective {
1298
1300
  this.clickOutside.emit();
1299
1301
  }
1300
1302
  }
1301
- constructor(elementRef) {
1302
- this.elementRef = elementRef;
1303
- this.clickOutside = new EventEmitter();
1304
- }
1305
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: ClickOutsideDirective, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive }); }
1303
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: ClickOutsideDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
1306
1304
  static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.20", type: ClickOutsideDirective, isStandalone: true, selector: "[clickOutside]", outputs: { clickOutside: "clickOutside" }, host: { listeners: { "document:click": "onClick($event)" } }, ngImport: i0 }); }
1307
1305
  }
1308
1306
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: ClickOutsideDirective, decorators: [{
1309
1307
  type: Directive,
1310
1308
  args: [{
1309
+ // Selecteur historique expose dans la public-api (sans prefixe cw) : renommer
1310
+ // serait un breaking change pour les consommateurs de la lib.
1311
+ // eslint-disable-next-line @angular-eslint/directive-selector
1311
1312
  selector: '[clickOutside]',
1312
- standalone: true
1313
+ standalone: true,
1314
+ host: { '(document:click)': 'onClick($event)' }
1313
1315
  }]
1314
- }], ctorParameters: () => [{ type: i0.ElementRef }], propDecorators: { clickOutside: [{
1315
- type: Output
1316
- }], onClick: [{
1317
- type: HostListener,
1318
- args: ['document:click', ['$event']]
1319
- }] } });
1316
+ }], propDecorators: { clickOutside: [{ type: i0.Output, args: ["clickOutside"] }] } });
1320
1317
 
1321
1318
  /**
1322
1319
  * Position du tooltip/popover par rapport à son élément hôte.
@@ -1382,22 +1379,22 @@ var TriggerTooltipEnum;
1382
1379
  */
1383
1380
  class TooltipContentComponent {
1384
1381
  constructor() {
1385
- this.id = '';
1386
- this.text = '';
1387
- this.title = '';
1388
- this.type = TypeTooltipEnum.tooltip;
1389
- this.arrowPosition = TooltipPositionEnum.right;
1382
+ this.id = input('', ...(ngDevMode ? [{ debugName: "id" }] : []));
1383
+ this.text = input('', ...(ngDevMode ? [{ debugName: "text" }] : []));
1384
+ this.title = input('', ...(ngDevMode ? [{ debugName: "title" }] : []));
1385
+ this.type = input(TypeTooltipEnum.tooltip, ...(ngDevMode ? [{ debugName: "type" }] : []));
1386
+ this.arrowPosition = input(TooltipPositionEnum.right, ...(ngDevMode ? [{ debugName: "arrowPosition" }] : []));
1390
1387
  this.typeTooltipEnum = TypeTooltipEnum;
1391
1388
  }
1392
1389
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: TooltipContentComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
1393
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.20", type: TooltipContentComponent, isStandalone: true, selector: "cw-tooltip-content", inputs: { id: "id", text: "text", title: "title", type: "type", arrowPosition: "arrowPosition" }, ngImport: i0, template: `
1394
- <div role="tooltip" [id]="id" [ngClass]="type + ' fade show ' + type + '-' + arrowPosition">
1390
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.20", type: TooltipContentComponent, isStandalone: true, selector: "cw-tooltip-content", inputs: { id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null }, text: { classPropertyName: "text", publicName: "text", isSignal: true, isRequired: false, transformFunction: null }, title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: false, transformFunction: null }, type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: false, transformFunction: null }, arrowPosition: { classPropertyName: "arrowPosition", publicName: "arrowPosition", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: `
1391
+ <div role="tooltip" [id]="id()" [ngClass]="type() + ' fade show ' + type() + '-' + arrowPosition()">
1395
1392
  <div class="arrow"></div>
1396
- @if (title) {
1397
- <div [ngClass]="(type === typeTooltipEnum.popover ? 'popover' : 'tooltip') + '-header'"
1398
- [innerHTML]="title | translate"></div>
1393
+ @if (title()) {
1394
+ <div [ngClass]="(type() === typeTooltipEnum.popover ? 'popover' : 'tooltip') + '-header'"
1395
+ [innerHTML]="title() | translate"></div>
1399
1396
  }
1400
- <div [ngClass]="type + '-body'" [innerHTML]="text | translate"></div>
1397
+ <div [ngClass]="type() + '-body'" [innerHTML]="text() | translate"></div>
1401
1398
  </div>
1402
1399
  `, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "ngmodule", type: TranslateModule }, { kind: "pipe", type: i2.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
1403
1400
  }
@@ -1409,27 +1406,17 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.20", ngImpo
1409
1406
  changeDetection: ChangeDetectionStrategy.OnPush,
1410
1407
  imports: [CommonModule, TranslateModule],
1411
1408
  template: `
1412
- <div role="tooltip" [id]="id" [ngClass]="type + ' fade show ' + type + '-' + arrowPosition">
1409
+ <div role="tooltip" [id]="id()" [ngClass]="type() + ' fade show ' + type() + '-' + arrowPosition()">
1413
1410
  <div class="arrow"></div>
1414
- @if (title) {
1415
- <div [ngClass]="(type === typeTooltipEnum.popover ? 'popover' : 'tooltip') + '-header'"
1416
- [innerHTML]="title | translate"></div>
1411
+ @if (title()) {
1412
+ <div [ngClass]="(type() === typeTooltipEnum.popover ? 'popover' : 'tooltip') + '-header'"
1413
+ [innerHTML]="title() | translate"></div>
1417
1414
  }
1418
- <div [ngClass]="type + '-body'" [innerHTML]="text | translate"></div>
1415
+ <div [ngClass]="type() + '-body'" [innerHTML]="text() | translate"></div>
1419
1416
  </div>
1420
1417
  `,
1421
1418
  }]
1422
- }], propDecorators: { id: [{
1423
- type: Input
1424
- }], text: [{
1425
- type: Input
1426
- }], title: [{
1427
- type: Input
1428
- }], type: [{
1429
- type: Input
1430
- }], arrowPosition: [{
1431
- type: Input
1432
- }] } });
1419
+ }], propDecorators: { id: [{ type: i0.Input, args: [{ isSignal: true, alias: "id", required: false }] }], text: [{ type: i0.Input, args: [{ isSignal: true, alias: "text", required: false }] }], title: [{ type: i0.Input, args: [{ isSignal: true, alias: "title", required: false }] }], type: [{ type: i0.Input, args: [{ isSignal: true, alias: "type", required: false }] }], arrowPosition: [{ type: i0.Input, args: [{ isSignal: true, alias: "arrowPosition", required: false }] }] } });
1433
1420
 
1434
1421
  /** Espace (px) entre l'hôte et la boîte du tooltip (laisse la place à la flèche). */
1435
1422
  const TOOLTIP_GAP = 24;
@@ -1450,17 +1437,17 @@ class CwTooltipDirective {
1450
1437
  this.viewContainerRef = inject(ViewContainerRef);
1451
1438
  this.destroyRef = inject(DestroyRef);
1452
1439
  /** Texte (clé i18n) du tooltip. Alias principal : `[cwTooltip]="key"`. */
1453
- this.text = '';
1454
- this.cwTooltipTitle = '';
1455
- this.cwTooltipType = TypeTooltipEnum.tooltip;
1456
- this.cwTooltipTrigger = TriggerTooltipEnum.hover;
1457
- this.cwTooltipPosition = TooltipPositionEnum.right;
1440
+ this.text = input('', ...(ngDevMode ? [{ debugName: "text", alias: 'cwTooltip' }] : [{ alias: 'cwTooltip' }]));
1441
+ this.cwTooltipTitle = input('', ...(ngDevMode ? [{ debugName: "cwTooltipTitle" }] : []));
1442
+ this.cwTooltipType = input(TypeTooltipEnum.tooltip, ...(ngDevMode ? [{ debugName: "cwTooltipType" }] : []));
1443
+ this.cwTooltipTrigger = input(TriggerTooltipEnum.hover, ...(ngDevMode ? [{ debugName: "cwTooltipTrigger" }] : []));
1444
+ this.cwTooltipPosition = input(TooltipPositionEnum.right, ...(ngDevMode ? [{ debugName: "cwTooltipPosition" }] : []));
1458
1445
  /** Désactive le tooltip sans retirer la directive (pass-through de `withTooltip`). */
1459
- this.cwTooltipDisabled = false;
1446
+ this.cwTooltipDisabled = input(false, ...(ngDevMode ? [{ debugName: "cwTooltipDisabled" }] : []));
1460
1447
  this.tooltipId = `ctw-tooltip-${nextTooltipId++}`;
1461
1448
  }
1462
1449
  get isHover() {
1463
- return this.cwTooltipTrigger === TriggerTooltipEnum.hover;
1450
+ return this.cwTooltipTrigger() === TriggerTooltipEnum.hover;
1464
1451
  }
1465
1452
  onEnter() {
1466
1453
  if (this.isHover) {
@@ -1478,7 +1465,10 @@ class CwTooltipDirective {
1478
1465
  }
1479
1466
  }
1480
1467
  onEscape() {
1481
- this.hide();
1468
+ // Ne fait rien si aucun overlay n'est ouvert (Echap global sur toute la page).
1469
+ if (this.overlayRef?.hasAttached()) {
1470
+ this.hide();
1471
+ }
1482
1472
  }
1483
1473
  ngOnDestroy() {
1484
1474
  this.overlayRef?.dispose();
@@ -1487,16 +1477,16 @@ class CwTooltipDirective {
1487
1477
  this.overlayRef?.hasAttached() ? this.hide() : this.show();
1488
1478
  }
1489
1479
  show() {
1490
- if (this.cwTooltipDisabled || !this.text || this.overlayRef?.hasAttached()) {
1480
+ if (this.cwTooltipDisabled() || !this.text() || this.overlayRef?.hasAttached()) {
1491
1481
  return;
1492
1482
  }
1493
1483
  const overlayRef = this.ensureOverlay();
1494
1484
  this.contentRef = overlayRef.attach(new ComponentPortal(TooltipContentComponent, this.viewContainerRef));
1495
1485
  this.contentRef.setInput('id', this.tooltipId);
1496
- this.contentRef.setInput('text', this.text);
1497
- this.contentRef.setInput('title', this.cwTooltipTitle);
1498
- this.contentRef.setInput('type', this.cwTooltipType);
1499
- this.contentRef.setInput('arrowPosition', this.cwTooltipPosition);
1486
+ this.contentRef.setInput('text', this.text());
1487
+ this.contentRef.setInput('title', this.cwTooltipTitle());
1488
+ this.contentRef.setInput('type', this.cwTooltipType());
1489
+ this.contentRef.setInput('arrowPosition', this.cwTooltipPosition());
1500
1490
  this.renderer.setAttribute(this.elementRef.nativeElement, 'aria-describedby', this.tooltipId);
1501
1491
  }
1502
1492
  hide() {
@@ -1512,6 +1502,11 @@ class CwTooltipDirective {
1512
1502
  }
1513
1503
  const positionStrategy = this.positionBuilder
1514
1504
  .flexibleConnectedTo(this.elementRef)
1505
+ // Sans ceci, le CDK utilise une "bounding box" pleine hauteur + flexbox pour
1506
+ // placer le pane : au 1er rendu (contenu OnPush pas encore mesure) il se colle
1507
+ // en haut de l'ecran avant de se repositionner (flash). Le flip reste assure
1508
+ // par withPositions().
1509
+ .withFlexibleDimensions(false)
1515
1510
  .withPositions(this.buildPositions())
1516
1511
  .withPush(false);
1517
1512
  // La position réelle peut différer de celle demandée (flip si débordement viewport) :
@@ -1539,54 +1534,32 @@ class CwTooltipDirective {
1539
1534
  }
1540
1535
  /** Position préférée (celle demandée) puis fallbacks pour le flip. */
1541
1536
  buildPositions() {
1537
+ const pos = this.cwTooltipPosition();
1542
1538
  const ordered = [
1543
- this.cwTooltipPosition,
1544
- OPPOSITE[this.cwTooltipPosition],
1545
- ...PERPENDICULAR[this.cwTooltipPosition],
1539
+ pos,
1540
+ OPPOSITE[pos],
1541
+ ...PERPENDICULAR[pos],
1546
1542
  ];
1547
1543
  return ordered.map((p) => POSITIONS[p]);
1548
1544
  }
1549
1545
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: CwTooltipDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
1550
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.20", type: CwTooltipDirective, isStandalone: true, selector: "[cwTooltip]", inputs: { text: ["cwTooltip", "text"], cwTooltipTitle: "cwTooltipTitle", cwTooltipType: "cwTooltipType", cwTooltipTrigger: "cwTooltipTrigger", cwTooltipPosition: "cwTooltipPosition", cwTooltipDisabled: "cwTooltipDisabled" }, host: { listeners: { "mouseenter": "onEnter()", "focusin": "onEnter()", "mouseleave": "onLeave()", "focusout": "onLeave()", "click": "onClick()", "document:keydown.escape": "onEscape()" } }, ngImport: i0 }); }
1546
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "20.3.20", type: CwTooltipDirective, isStandalone: true, selector: "[cwTooltip]", inputs: { text: { classPropertyName: "text", publicName: "cwTooltip", isSignal: true, isRequired: false, transformFunction: null }, cwTooltipTitle: { classPropertyName: "cwTooltipTitle", publicName: "cwTooltipTitle", isSignal: true, isRequired: false, transformFunction: null }, cwTooltipType: { classPropertyName: "cwTooltipType", publicName: "cwTooltipType", isSignal: true, isRequired: false, transformFunction: null }, cwTooltipTrigger: { classPropertyName: "cwTooltipTrigger", publicName: "cwTooltipTrigger", isSignal: true, isRequired: false, transformFunction: null }, cwTooltipPosition: { classPropertyName: "cwTooltipPosition", publicName: "cwTooltipPosition", isSignal: true, isRequired: false, transformFunction: null }, cwTooltipDisabled: { classPropertyName: "cwTooltipDisabled", publicName: "cwTooltipDisabled", isSignal: true, isRequired: false, transformFunction: null } }, host: { listeners: { "mouseenter": "onEnter()", "focusin": "onEnter()", "mouseleave": "onLeave()", "focusout": "onLeave()", "click": "onClick()", "document:keydown.escape": "onEscape()" } }, ngImport: i0 }); }
1551
1547
  }
1552
1548
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: CwTooltipDirective, decorators: [{
1553
1549
  type: Directive,
1554
1550
  args: [{
1555
1551
  selector: '[cwTooltip]',
1556
1552
  standalone: true,
1553
+ host: {
1554
+ '(mouseenter)': 'onEnter()',
1555
+ '(focusin)': 'onEnter()',
1556
+ '(mouseleave)': 'onLeave()',
1557
+ '(focusout)': 'onLeave()',
1558
+ '(click)': 'onClick()',
1559
+ '(document:keydown.escape)': 'onEscape()',
1560
+ },
1557
1561
  }]
1558
- }], propDecorators: { text: [{
1559
- type: Input,
1560
- args: ['cwTooltip']
1561
- }], cwTooltipTitle: [{
1562
- type: Input
1563
- }], cwTooltipType: [{
1564
- type: Input
1565
- }], cwTooltipTrigger: [{
1566
- type: Input
1567
- }], cwTooltipPosition: [{
1568
- type: Input
1569
- }], cwTooltipDisabled: [{
1570
- type: Input
1571
- }], onEnter: [{
1572
- type: HostListener,
1573
- args: ['mouseenter']
1574
- }, {
1575
- type: HostListener,
1576
- args: ['focusin']
1577
- }], onLeave: [{
1578
- type: HostListener,
1579
- args: ['mouseleave']
1580
- }, {
1581
- type: HostListener,
1582
- args: ['focusout']
1583
- }], onClick: [{
1584
- type: HostListener,
1585
- args: ['click']
1586
- }], onEscape: [{
1587
- type: HostListener,
1588
- args: ['document:keydown.escape']
1589
- }] } });
1562
+ }], propDecorators: { text: [{ type: i0.Input, args: [{ isSignal: true, alias: "cwTooltip", required: false }] }], cwTooltipTitle: [{ type: i0.Input, args: [{ isSignal: true, alias: "cwTooltipTitle", required: false }] }], cwTooltipType: [{ type: i0.Input, args: [{ isSignal: true, alias: "cwTooltipType", required: false }] }], cwTooltipTrigger: [{ type: i0.Input, args: [{ isSignal: true, alias: "cwTooltipTrigger", required: false }] }], cwTooltipPosition: [{ type: i0.Input, args: [{ isSignal: true, alias: "cwTooltipPosition", required: false }] }], cwTooltipDisabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "cwTooltipDisabled", required: false }] }] } });
1590
1563
  const POSITIONS = {
1591
1564
  [TooltipPositionEnum.right]: {
1592
1565
  originX: 'end', originY: 'center', overlayX: 'start', overlayY: 'center', offsetX: TOOLTIP_GAP,
@@ -1629,10 +1602,13 @@ function resolveArrowPos(pair) {
1629
1602
 
1630
1603
  class ResponsiveService {
1631
1604
  constructor() {
1605
+ this.destroyRef = inject(DestroyRef);
1632
1606
  this.checkIsMobileResolution$ = new BehaviorSubject(this.checkIsMobileResolution());
1633
- fromEvent(window, 'resize').subscribe(e => {
1634
- this.checkIsMobileResolution$.next(this.checkIsMobileResolution());
1635
- });
1607
+ // takeUntilDestroyed => plus de souscription orpheline ; distinctUntilChanged => on
1608
+ // n'emet que quand le booleen bascule (auparavant : un next() a chaque resize).
1609
+ fromEvent(window, 'resize')
1610
+ .pipe(map(() => this.checkIsMobileResolution()), distinctUntilChanged(), takeUntilDestroyed(this.destroyRef))
1611
+ .subscribe(isMobile => this.checkIsMobileResolution$.next(isMobile));
1636
1612
  }
1637
1613
  checkIsMobileResolution() {
1638
1614
  return window.innerWidth < 768;
@@ -1677,39 +1653,43 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.20", ngImpo
1677
1653
  args: [{ selector: '[cwDropdownItem]' }]
1678
1654
  }] });
1679
1655
  class ButtonComponent {
1680
- /** Mappe `tooltipPosition` (qui peut valoir `static`) vers une position de tooltip exploitable. */
1681
- get tooltipPositionResolved() {
1682
- return this.tooltipPosition === DropdownPositionEnum.static
1683
- ? TooltipPositionEnum.right
1684
- : this.tooltipPosition;
1685
- }
1686
- get hostClasses() {
1687
- return this.skeletonMode ? 'skeleton btn' : '';
1688
- }
1689
1656
  constructor() {
1690
1657
  this.renderer = inject(Renderer2);
1658
+ this.destroyRef = inject(DestroyRef);
1691
1659
  this.responsiveService = inject(ResponsiveService);
1692
1660
  this.buttonPositionEnum = ButtonPositionEnum;
1693
- this.id = '';
1694
- this.isDropdown = false;
1695
- this.hideCaret = false;
1696
- this.withOnlyIcon = false;
1697
- this.iconSize = ButtonIconSizeEnum.default;
1698
- this.iconPosition = this.buttonPositionEnum.left;
1699
- this.dropdownPosition = DropdownPositionEnum.right;
1700
- this.isMinWidth = false;
1701
- this.isDisabled = false;
1702
- this.isLoading = false;
1703
- this.cssClass = '';
1704
- this.skeletonMode = false;
1705
- this.withTooltip = false;
1706
- this.tooltipText = '';
1707
- this.tooltipTitle = '';
1708
- this.tooltipTrigger = TriggerTooltipEnum.hover;
1709
- this.tooltipPosition = TooltipPositionEnum.right;
1710
- this.tooltipType = TypeTooltipEnum.tooltip;
1711
- this.btnAction = new EventEmitter();
1712
- this.dropDownClicked = new EventEmitter();
1661
+ this.type = input(...(ngDevMode ? [undefined, { debugName: "type" }] : []));
1662
+ this.label = input(...(ngDevMode ? [undefined, { debugName: "label" }] : []));
1663
+ this.id = input('', ...(ngDevMode ? [{ debugName: "id" }] : []));
1664
+ /**
1665
+ * Si défini, le bouton est rendu comme `<a [routerLink]="link">` au lieu d'un `<button>`.
1666
+ * Ignoré quand `isDropdown` est actif.
1667
+ */
1668
+ this.link = input(...(ngDevMode ? [undefined, { debugName: "link" }] : []));
1669
+ this.isDropdown = input(false, ...(ngDevMode ? [{ debugName: "isDropdown" }] : []));
1670
+ this.hideCaret = input(false, ...(ngDevMode ? [{ debugName: "hideCaret" }] : []));
1671
+ this.withIcon = input(...(ngDevMode ? [undefined, { debugName: "withIcon" }] : []));
1672
+ this.withOnlyIcon = input(false, ...(ngDevMode ? [{ debugName: "withOnlyIcon" }] : []));
1673
+ this.iconSize = input(ButtonIconSizeEnum.default, ...(ngDevMode ? [{ debugName: "iconSize" }] : []));
1674
+ this.iconPosition = input(ButtonPositionEnum.left, ...(ngDevMode ? [{ debugName: "iconPosition" }] : []));
1675
+ this.dropdownPosition = input(DropdownPositionEnum.right, ...(ngDevMode ? [{ debugName: "dropdownPosition" }] : []));
1676
+ this.isMinWidth = input(false, ...(ngDevMode ? [{ debugName: "isMinWidth" }] : []));
1677
+ this.isDisabled = input(false, ...(ngDevMode ? [{ debugName: "isDisabled" }] : []));
1678
+ this.isLoading = input(false, ...(ngDevMode ? [{ debugName: "isLoading" }] : []));
1679
+ this.cssClass = input('', ...(ngDevMode ? [{ debugName: "cssClass" }] : []));
1680
+ this.dataTest = input(...(ngDevMode ? [undefined, { debugName: "dataTest" }] : []));
1681
+ this.skeletonMode = input(false, ...(ngDevMode ? [{ debugName: "skeletonMode" }] : []));
1682
+ this.withTooltip = input(false, ...(ngDevMode ? [{ debugName: "withTooltip" }] : []));
1683
+ this.tooltipText = input('', ...(ngDevMode ? [{ debugName: "tooltipText" }] : []));
1684
+ this.tooltipTitle = input('', ...(ngDevMode ? [{ debugName: "tooltipTitle" }] : []));
1685
+ this.tooltipTrigger = input(TriggerTooltipEnum.hover, ...(ngDevMode ? [{ debugName: "tooltipTrigger" }] : []));
1686
+ this.tooltipPosition = input(TooltipPositionEnum.right, ...(ngDevMode ? [{ debugName: "tooltipPosition" }] : []));
1687
+ this.tooltipType = input(TypeTooltipEnum.tooltip, ...(ngDevMode ? [{ debugName: "tooltipType" }] : []));
1688
+ this.btnAction = output();
1689
+ this.dropDownClicked = output();
1690
+ this.dropdown = viewChild('dropdown', ...(ngDevMode ? [{ debugName: "dropdown" }] : []));
1691
+ this.dropdownMenu = viewChild('dropdownMenu', ...(ngDevMode ? [{ debugName: "dropdownMenu" }] : []));
1692
+ this.dropdownToggle = viewChild('dropdownToggle', ...(ngDevMode ? [{ debugName: "dropdownToggle" }] : []));
1713
1693
  this.iconSizeEnum = IconSizeEnum;
1714
1694
  this.iconType = IconTypeEnum;
1715
1695
  this.iconUiType = IconUiTypeEnum;
@@ -1718,33 +1698,42 @@ class ButtonComponent {
1718
1698
  this.placementCss = '';
1719
1699
  this.isOpen = false;
1720
1700
  this.focusOutInitialized = false;
1721
- this.renderer.listen('window', 'click', (e) => {
1722
- const target = e.target;
1723
- if (target.classList.contains('dropdown-item')) {
1724
- this.onClickOutside();
1725
- }
1726
- });
1701
+ /** `data-test-ctw` : valeur fournie, sinon derivee du label. */
1702
+ this.resolvedDataTest = computed(() => this.dataTest() ?? `btn-${UtilsHelper.slugify(this.label() ?? '')}`, ...(ngDevMode ? [{ debugName: "resolvedDataTest" }] : []));
1703
+ }
1704
+ /** Mappe `tooltipPosition` (qui peut valoir `static`) vers une position de tooltip exploitable. */
1705
+ get tooltipPositionResolved() {
1706
+ return this.tooltipPosition() === DropdownPositionEnum.static
1707
+ ? TooltipPositionEnum.right
1708
+ : this.tooltipPosition();
1727
1709
  }
1728
1710
  ngOnInit() {
1729
- this.responsiveService.checkIsMobileResolution$.subscribe({
1730
- next: () => {
1731
- this.getPlacement(this.dropdownPosition);
1732
- }
1733
- });
1734
- this.dataTest ??= `btn-${UtilsHelper.slugify(this.label)}`;
1711
+ this.responsiveService.checkIsMobileResolution$
1712
+ .pipe(takeUntilDestroyed(this.destroyRef))
1713
+ .subscribe(() => this.getPlacement(this.dropdownPosition()));
1714
+ if (this.isDropdown()) {
1715
+ // Ferme CE dropdown au clic sur un item de SON propre menu.
1716
+ const unlisten = this.renderer.listen('window', 'click', (e) => {
1717
+ const target = e.target;
1718
+ if (target.classList.contains('dropdown-item') && this.dropdownMenu()?.nativeElement.contains(target)) {
1719
+ this.onClickOutside();
1720
+ }
1721
+ });
1722
+ this.destroyRef.onDestroy(unlisten);
1723
+ }
1735
1724
  }
1736
1725
  getButtonClasses() {
1737
1726
  return {
1738
- 'btn-min-width': this.isMinWidth,
1739
- 'btn-icon': this.withOnlyIcon,
1740
- [`btn-icon-${this.iconSize}`]: !!this.iconSize && this.withOnlyIcon
1727
+ 'btn-min-width': this.isMinWidth(),
1728
+ 'btn-icon': this.withOnlyIcon(),
1729
+ [`btn-icon-${this.iconSize()}`]: !!this.iconSize() && this.withOnlyIcon()
1741
1730
  };
1742
1731
  }
1743
1732
  onBtnAction() {
1744
1733
  this.btnAction.emit();
1745
1734
  }
1746
1735
  onLinkClick(event) {
1747
- if (this.isDisabled) {
1736
+ if (this.isDisabled()) {
1748
1737
  event.preventDefault();
1749
1738
  event.stopPropagation();
1750
1739
  return;
@@ -1752,14 +1741,14 @@ class ButtonComponent {
1752
1741
  this.btnAction.emit();
1753
1742
  }
1754
1743
  toggleDropdown() {
1755
- this.getPlacement(this.dropdownPosition);
1756
- this.setAriaExpanded();
1757
- this.dropdown?.nativeElement.classList.toggle("show");
1758
- this.dropdownMenu.nativeElement.classList.toggle("show");
1744
+ this.getPlacement(this.dropdownPosition());
1745
+ this.dropdown()?.nativeElement.classList.toggle("show");
1746
+ this.dropdownMenu()?.nativeElement.classList.toggle("show");
1759
1747
  this.isOpen = !this.isOpen;
1760
1748
  this.dropDownClicked.emit(this.isOpen);
1761
- if (this.isOpen && !this.focusOutInitialized) {
1762
- this.focusOut(this.dropdownMenu.nativeElement);
1749
+ const menu = this.dropdownMenu()?.nativeElement;
1750
+ if (this.isOpen && !this.focusOutInitialized && menu) {
1751
+ this.focusOut(menu);
1763
1752
  this.focusOutInitialized = true;
1764
1753
  }
1765
1754
  }
@@ -1768,21 +1757,15 @@ class ButtonComponent {
1768
1757
  }
1769
1758
  /**
1770
1759
  * Ferme le panneau dropdown de façon programmatique (no-op si déjà fermé).
1771
- * Symétrique de `DropdownComponent.closeDropdown()` : retire la classe `show`,
1772
- * repositionne `aria-expanded`, met `isOpen` à false et émet `dropDownClicked(false)`.
1760
+ * Retire la classe `show`, met `isOpen` à false et émet `dropDownClicked(false)`.
1761
+ * `aria-expanded` est lié à `isOpen` dans le template.
1773
1762
  */
1774
1763
  closeDropdown() {
1775
- this.dropdownToggle?.nativeElement.setAttribute('aria-expanded', 'false');
1776
- this.dropdown?.nativeElement.classList.remove("show");
1777
- this.dropdownMenu?.nativeElement.classList.remove("show");
1764
+ this.dropdown()?.nativeElement.classList.remove("show");
1765
+ this.dropdownMenu()?.nativeElement.classList.remove("show");
1778
1766
  this.isOpen = false;
1779
1767
  this.dropDownClicked.emit(this.isOpen);
1780
1768
  }
1781
- setAriaExpanded() {
1782
- const button = this.dropdownToggle.nativeElement;
1783
- const currentAriaExpanded = button.getAttribute('aria-expanded') === 'true';
1784
- button.setAttribute('aria-expanded', (!currentAriaExpanded).toString());
1785
- }
1786
1769
  getPlacement(placement) {
1787
1770
  switch (placement) {
1788
1771
  case DropdownPositionEnum.right:
@@ -1797,16 +1780,16 @@ class ButtonComponent {
1797
1780
  }
1798
1781
  // Fermer la dropdown si on focus out en tab ou shift tab
1799
1782
  focusOut(element) {
1800
- const focusableEls1 = element.querySelectorAll('a[href], button, textarea, input[type="text"],' +
1801
- 'input[type="radio"]:checked, input[type="checkbox"], select');
1802
- const focusableEls = Array.from(focusableEls1)
1803
- .filter((el) => !el.disabled);
1804
- const firstFocusableEl = focusableEls[0];
1805
- const lastFocusableEl = focusableEls[focusableEls.length - 1];
1806
- element.addEventListener('keydown', (e) => {
1807
- const isTabPressed = e.key === 'Tab'; // isTabPressed
1808
- if (!isTabPressed)
1783
+ // Listener enregistre via Renderer2 + teardown DestroyRef (auparavant addEventListener jamais retire).
1784
+ const unlisten = this.renderer.listen(element, 'keydown', (e) => {
1785
+ if (e.key !== 'Tab')
1809
1786
  return;
1787
+ // Recalcule les focusables a chaque frappe : le contenu du menu peut changer
1788
+ // apres l'ouverture (auparavant fige au 1er open, ignorant les items ajoutes ensuite).
1789
+ const focusableEls = Array.from(element.querySelectorAll('a[href], button, textarea, input[type="text"],' +
1790
+ 'input[type="radio"]:checked, input[type="checkbox"], select')).filter((el) => !el.disabled);
1791
+ const firstFocusableEl = focusableEls[0];
1792
+ const lastFocusableEl = focusableEls[focusableEls.length - 1];
1810
1793
  if (e.shiftKey) /* shift + tab */ {
1811
1794
  if (document.activeElement === firstFocusableEl) {
1812
1795
  this.toggleDropdown();
@@ -1818,112 +1801,124 @@ class ButtonComponent {
1818
1801
  }
1819
1802
  }
1820
1803
  });
1804
+ this.destroyRef.onDestroy(unlisten);
1821
1805
  }
1822
1806
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: ButtonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
1823
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.20", type: ButtonComponent, isStandalone: true, selector: "cw-button", inputs: { type: "type", label: "label", id: "id", link: "link", isDropdown: "isDropdown", hideCaret: "hideCaret", withIcon: "withIcon", withOnlyIcon: "withOnlyIcon", iconSize: "iconSize", iconPosition: "iconPosition", dropdownPosition: "dropdownPosition", isMinWidth: "isMinWidth", isDisabled: "isDisabled", isLoading: "isLoading", cssClass: "cssClass", dataTest: "dataTest", skeletonMode: "skeletonMode", withTooltip: "withTooltip", tooltipText: "tooltipText", tooltipTitle: "tooltipTitle", tooltipTrigger: "tooltipTrigger", tooltipPosition: "tooltipPosition", tooltipType: "tooltipType" }, outputs: { btnAction: "btnAction", dropDownClicked: "dropDownClicked" }, host: { properties: { "class": "this.hostClasses" } }, viewQueries: [{ propertyName: "dropdown", first: true, predicate: ["dropdown"], descendants: true }, { propertyName: "dropdownMenu", first: true, predicate: ["dropdownMenu"], descendants: true }, { propertyName: "dropdownToggle", first: true, predicate: ["dropdownToggle"], descendants: true }], ngImport: i0, template: "<ng-container *ngTemplateOutlet=\"buttonTemplate\"></ng-container>\r\n\r\n<!-- Template du bouton (code existant envelopp\u00E9) -->\r\n<ng-template #buttonTemplate>\r\n @if (!isDropdown) {\r\n @if (link != null) {\r\n <a class=\"btn\" [class]=\"'btn-' + type + ' ' + cssClass\" [ngClass]=\"getButtonClasses()\"\r\n [class.disabled]=\"isDisabled\"\r\n [routerLink]=\"isDisabled ? null : link\"\r\n [attr.aria-disabled]=\"isDisabled ? 'true' : null\"\r\n [attr.tabindex]=\"isDisabled ? -1 : null\"\r\n [attr.data-test-ctw]=\"dataTest\"\r\n [cwTooltip]=\"tooltipText\" [cwTooltipDisabled]=\"!withTooltip\" [cwTooltipTitle]=\"tooltipTitle\"\r\n [cwTooltipType]=\"tooltipType\" [cwTooltipTrigger]=\"tooltipTrigger\" [cwTooltipPosition]=\"tooltipPositionResolved\"\r\n (click)=\"onLinkClick($event)\">\r\n\r\n <ng-container *ngTemplateOutlet=\"buttonContent\"></ng-container>\r\n </a>\r\n } @else {\r\n <button type=\"button\" class=\"btn\" [class]=\"'btn-' + type + ' ' + cssClass\" [ngClass]=\"getButtonClasses()\"\r\n [disabled]=\"isDisabled\" (click)=\"onBtnAction()\" [attr.data-test-ctw]=\"dataTest\"\r\n [cwTooltip]=\"tooltipText\" [cwTooltipDisabled]=\"!withTooltip\" [cwTooltipTitle]=\"tooltipTitle\"\r\n [cwTooltipType]=\"tooltipType\" [cwTooltipTrigger]=\"tooltipTrigger\" [cwTooltipPosition]=\"tooltipPositionResolved\">\r\n\r\n @if (isLoading) {\r\n <span class=\"spinner-border spinner-border-sm\" aria-hidden=\"true\"></span>\r\n <span class=\"visually-hidden\" role=\"status\">{{ '_COMMON._HTTP.TXT_LOADING' | translate }}</span>\r\n }\r\n\r\n <ng-container *ngTemplateOutlet=\"buttonContent\"></ng-container>\r\n </button>\r\n }\r\n }\r\n @else {\r\n <div (clickOutside)=\"onClickOutside()\" ctwClickOutside #dropdown class=\"dropdown d-inline-block\">\r\n <button class=\"btn\" [class]=\"'btn-' + type + ' ' + cssClass\" type=\"button\"\r\n [ngClass]=\"getButtonClasses()\"\r\n [disabled]=\"isDisabled\" [id]=\"id\" aria-expanded=\"false\" (click)=\"toggleDropdown()\" #dropdownToggle\r\n [attr.data-test-ctw]=\"dataTest\"\r\n [cwTooltip]=\"tooltipText\" [cwTooltipDisabled]=\"!withTooltip\" [cwTooltipTitle]=\"tooltipTitle\"\r\n [cwTooltipType]=\"tooltipType\" [cwTooltipTrigger]=\"tooltipTrigger\" [cwTooltipPosition]=\"tooltipPositionResolved\">\r\n\r\n <ng-container *ngTemplateOutlet=\"buttonContent\"></ng-container>\r\n\r\n @if(!hideCaret) {\r\n <cw-icon [icon]=\"spriteIcon.down\" [iconSize]=\"iconSizeEnum['2xs']\" class=\"dropdown-icon\"></cw-icon>\r\n }\r\n </button>\r\n\r\n <div [attr.aria-labelledby]=\"id\" class=\"dropdown-menu\" [ngClass]=\"placementCss\" #dropdownMenu>\r\n <div class=\"dropdown-menu-inner\">\r\n <ng-content></ng-content>\r\n </div>\r\n </div>\r\n </div>\r\n }\r\n</ng-template>\r\n\r\n<!-- Template existant du contenu du bouton -->\r\n<ng-template #buttonContent>\r\n @if (withIcon && iconPosition === buttonPositionEnum.left) {\r\n <ng-container *ngTemplateOutlet=\"iconContent\"></ng-container>\r\n }\r\n\r\n @if(withOnlyIcon) {\r\n <span class=\"visually-hidden\">{{label | translate }}</span>\r\n }\r\n @else {\r\n {{ label | translate }}\r\n }\r\n\r\n @if (withIcon && iconPosition === buttonPositionEnum.right) {\r\n <ng-container *ngTemplateOutlet=\"iconContent\"></ng-container>\r\n }\r\n</ng-template>\r\n\r\n<ng-template #iconContent>\r\n @if(withOnlyIcon) {\r\n @switch(iconSize) {\r\n @case(buttonIconSizeEnum.xsmall) {\r\n <cw-icon [icon]=\"withIcon\" [iconSize]=\"iconSizeEnum['xs']\"></cw-icon>\r\n }\r\n @case(buttonIconSizeEnum.small) {\r\n <cw-icon [icon]=\"withIcon\" [iconSize]=\"iconSizeEnum['xs']\"></cw-icon>\r\n }\r\n @default {\r\n <cw-icon [icon]=\"withIcon\" [iconSize]=\"iconSizeEnum['sm']\"></cw-icon>\r\n }\r\n }\r\n }\r\n @else {\r\n <cw-icon [icon]=\"withIcon\" [iconSize]=\"iconSizeEnum['sm']\"></cw-icon>\r\n }\r\n</ng-template>\r\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "ngmodule", type: TranslateModule }, { kind: "component", type: IconComponent, selector: "cw-icon", inputs: ["icon", "label", "type", "iconSize", "iconCssClass", "iconUiType", "iconColorCustom", "spritePath"] }, { kind: "directive", type: ClickOutsideDirective, selector: "[clickOutside]", outputs: ["clickOutside"] }, { kind: "directive", type: CwTooltipDirective, selector: "[cwTooltip]", inputs: ["cwTooltip", "cwTooltipTitle", "cwTooltipType", "cwTooltipTrigger", "cwTooltipPosition", "cwTooltipDisabled"] }, { kind: "directive", type: RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "pipe", type: i2.TranslatePipe, name: "translate" }] }); }
1807
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.20", type: ButtonComponent, isStandalone: true, selector: "cw-button", inputs: { type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null }, link: { classPropertyName: "link", publicName: "link", isSignal: true, isRequired: false, transformFunction: null }, isDropdown: { classPropertyName: "isDropdown", publicName: "isDropdown", isSignal: true, isRequired: false, transformFunction: null }, hideCaret: { classPropertyName: "hideCaret", publicName: "hideCaret", isSignal: true, isRequired: false, transformFunction: null }, withIcon: { classPropertyName: "withIcon", publicName: "withIcon", isSignal: true, isRequired: false, transformFunction: null }, withOnlyIcon: { classPropertyName: "withOnlyIcon", publicName: "withOnlyIcon", isSignal: true, isRequired: false, transformFunction: null }, iconSize: { classPropertyName: "iconSize", publicName: "iconSize", isSignal: true, isRequired: false, transformFunction: null }, iconPosition: { classPropertyName: "iconPosition", publicName: "iconPosition", isSignal: true, isRequired: false, transformFunction: null }, dropdownPosition: { classPropertyName: "dropdownPosition", publicName: "dropdownPosition", isSignal: true, isRequired: false, transformFunction: null }, isMinWidth: { classPropertyName: "isMinWidth", publicName: "isMinWidth", isSignal: true, isRequired: false, transformFunction: null }, isDisabled: { classPropertyName: "isDisabled", publicName: "isDisabled", isSignal: true, isRequired: false, transformFunction: null }, isLoading: { classPropertyName: "isLoading", publicName: "isLoading", isSignal: true, isRequired: false, transformFunction: null }, cssClass: { classPropertyName: "cssClass", publicName: "cssClass", isSignal: true, isRequired: false, transformFunction: null }, dataTest: { classPropertyName: "dataTest", publicName: "dataTest", isSignal: true, isRequired: false, transformFunction: null }, skeletonMode: { classPropertyName: "skeletonMode", publicName: "skeletonMode", isSignal: true, isRequired: false, transformFunction: null }, withTooltip: { classPropertyName: "withTooltip", publicName: "withTooltip", isSignal: true, isRequired: false, transformFunction: null }, tooltipText: { classPropertyName: "tooltipText", publicName: "tooltipText", isSignal: true, isRequired: false, transformFunction: null }, tooltipTitle: { classPropertyName: "tooltipTitle", publicName: "tooltipTitle", isSignal: true, isRequired: false, transformFunction: null }, tooltipTrigger: { classPropertyName: "tooltipTrigger", publicName: "tooltipTrigger", isSignal: true, isRequired: false, transformFunction: null }, tooltipPosition: { classPropertyName: "tooltipPosition", publicName: "tooltipPosition", isSignal: true, isRequired: false, transformFunction: null }, tooltipType: { classPropertyName: "tooltipType", publicName: "tooltipType", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { btnAction: "btnAction", dropDownClicked: "dropDownClicked" }, host: { properties: { "class.skeleton": "skeletonMode()", "class.btn": "skeletonMode()" } }, viewQueries: [{ propertyName: "dropdown", first: true, predicate: ["dropdown"], descendants: true, isSignal: true }, { propertyName: "dropdownMenu", first: true, predicate: ["dropdownMenu"], descendants: true, isSignal: true }, { propertyName: "dropdownToggle", first: true, predicate: ["dropdownToggle"], descendants: true, isSignal: true }], ngImport: i0, template: "<ng-container *ngTemplateOutlet=\"buttonTemplate\"></ng-container>\n\n<!-- Template du bouton (code existant envelopp\u00E9) -->\n<ng-template #buttonTemplate>\n @if (!isDropdown()) {\n @if (link() != null) {\n <a class=\"btn\" [class]=\"'btn-' + type() + ' ' + cssClass()\" [ngClass]=\"getButtonClasses()\"\n [class.disabled]=\"isDisabled()\"\n [routerLink]=\"isDisabled() ? null : link()\"\n [attr.aria-disabled]=\"isDisabled() ? 'true' : null\"\n [attr.tabindex]=\"isDisabled() ? -1 : null\"\n [attr.data-test-ctw]=\"resolvedDataTest()\"\n [cwTooltip]=\"tooltipText()\" [cwTooltipDisabled]=\"!withTooltip()\" [cwTooltipTitle]=\"tooltipTitle()\"\n [cwTooltipType]=\"tooltipType()\" [cwTooltipTrigger]=\"tooltipTrigger()\" [cwTooltipPosition]=\"tooltipPositionResolved\"\n (click)=\"onLinkClick($event)\">\n\n <ng-container *ngTemplateOutlet=\"buttonContent\"></ng-container>\n </a>\n } @else {\n <button type=\"button\" class=\"btn\" [class]=\"'btn-' + type() + ' ' + cssClass()\" [ngClass]=\"getButtonClasses()\"\n [disabled]=\"isDisabled()\" (click)=\"onBtnAction()\" [attr.data-test-ctw]=\"resolvedDataTest()\"\n [cwTooltip]=\"tooltipText()\" [cwTooltipDisabled]=\"!withTooltip()\" [cwTooltipTitle]=\"tooltipTitle()\"\n [cwTooltipType]=\"tooltipType()\" [cwTooltipTrigger]=\"tooltipTrigger()\" [cwTooltipPosition]=\"tooltipPositionResolved\">\n\n @if (isLoading()) {\n <span class=\"spinner-border spinner-border-sm\" aria-hidden=\"true\"></span>\n <span class=\"visually-hidden\" role=\"status\">{{ '_COMMON._HTTP.TXT_LOADING' | translate }}</span>\n }\n\n <ng-container *ngTemplateOutlet=\"buttonContent\"></ng-container>\n </button>\n }\n }\n @else {\n <div (clickOutside)=\"onClickOutside()\" ctwClickOutside #dropdown class=\"dropdown d-inline-block\">\n <button class=\"btn\" [class]=\"'btn-' + type() + ' ' + cssClass()\" type=\"button\"\n [ngClass]=\"getButtonClasses()\"\n [disabled]=\"isDisabled()\" [id]=\"id()\" [attr.aria-expanded]=\"isOpen\" (click)=\"toggleDropdown()\" #dropdownToggle\n [attr.data-test-ctw]=\"resolvedDataTest()\"\n [cwTooltip]=\"tooltipText()\" [cwTooltipDisabled]=\"!withTooltip()\" [cwTooltipTitle]=\"tooltipTitle()\"\n [cwTooltipType]=\"tooltipType()\" [cwTooltipTrigger]=\"tooltipTrigger()\" [cwTooltipPosition]=\"tooltipPositionResolved\">\n\n <ng-container *ngTemplateOutlet=\"buttonContent\"></ng-container>\n\n @if(!hideCaret()) {\n <cw-icon [icon]=\"spriteIcon.down\" [iconSize]=\"iconSizeEnum['2xs']\" class=\"dropdown-icon\"></cw-icon>\n }\n </button>\n\n <div [attr.aria-labelledby]=\"id()\" class=\"dropdown-menu\" [ngClass]=\"placementCss\" #dropdownMenu>\n <div class=\"dropdown-menu-inner\">\n <ng-content></ng-content>\n </div>\n </div>\n </div>\n }\n</ng-template>\n\n<!-- Template existant du contenu du bouton -->\n<ng-template #buttonContent>\n @if (withIcon() && iconPosition() === buttonPositionEnum.left) {\n <ng-container *ngTemplateOutlet=\"iconContent\"></ng-container>\n }\n\n @if(withOnlyIcon()) {\n <span class=\"visually-hidden\">{{label() | translate }}</span>\n }\n @else {\n {{ label() | translate }}\n }\n\n @if (withIcon() && iconPosition() === buttonPositionEnum.right) {\n <ng-container *ngTemplateOutlet=\"iconContent\"></ng-container>\n }\n</ng-template>\n\n<ng-template #iconContent>\n @if(withOnlyIcon()) {\n @switch(iconSize()) {\n @case(buttonIconSizeEnum.xsmall) {\n <cw-icon [icon]=\"withIcon()\" [iconSize]=\"iconSizeEnum['xs']\"></cw-icon>\n }\n @case(buttonIconSizeEnum.small) {\n <cw-icon [icon]=\"withIcon()\" [iconSize]=\"iconSizeEnum['xs']\"></cw-icon>\n }\n @default {\n <cw-icon [icon]=\"withIcon()\" [iconSize]=\"iconSizeEnum['sm']\"></cw-icon>\n }\n }\n }\n @else {\n <cw-icon [icon]=\"withIcon()\" [iconSize]=\"iconSizeEnum['sm']\"></cw-icon>\n }\n</ng-template>\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "ngmodule", type: TranslateModule }, { kind: "component", type: IconComponent, selector: "cw-icon", inputs: ["icon", "label", "type", "iconSize", "iconCssClass", "iconUiType", "iconColorCustom", "spritePath"] }, { kind: "directive", type: ClickOutsideDirective, selector: "[clickOutside]", outputs: ["clickOutside"] }, { kind: "directive", type: CwTooltipDirective, selector: "[cwTooltip]", inputs: ["cwTooltip", "cwTooltipTitle", "cwTooltipType", "cwTooltipTrigger", "cwTooltipPosition", "cwTooltipDisabled"] }, { kind: "directive", type: RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "pipe", type: i2.TranslatePipe, name: "translate" }] }); }
1824
1808
  }
1825
1809
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: ButtonComponent, decorators: [{
1826
1810
  type: Component,
1827
- args: [{ selector: 'cw-button', standalone: true, imports: [
1811
+ args: [{ selector: 'cw-button', standalone: true, host: {
1812
+ '[class.skeleton]': 'skeletonMode()',
1813
+ '[class.btn]': 'skeletonMode()'
1814
+ }, imports: [
1828
1815
  CommonModule,
1829
1816
  TranslateModule,
1830
1817
  IconComponent,
1831
1818
  ClickOutsideDirective,
1832
1819
  CwTooltipDirective,
1833
1820
  RouterLink
1834
- ], template: "<ng-container *ngTemplateOutlet=\"buttonTemplate\"></ng-container>\r\n\r\n<!-- Template du bouton (code existant envelopp\u00E9) -->\r\n<ng-template #buttonTemplate>\r\n @if (!isDropdown) {\r\n @if (link != null) {\r\n <a class=\"btn\" [class]=\"'btn-' + type + ' ' + cssClass\" [ngClass]=\"getButtonClasses()\"\r\n [class.disabled]=\"isDisabled\"\r\n [routerLink]=\"isDisabled ? null : link\"\r\n [attr.aria-disabled]=\"isDisabled ? 'true' : null\"\r\n [attr.tabindex]=\"isDisabled ? -1 : null\"\r\n [attr.data-test-ctw]=\"dataTest\"\r\n [cwTooltip]=\"tooltipText\" [cwTooltipDisabled]=\"!withTooltip\" [cwTooltipTitle]=\"tooltipTitle\"\r\n [cwTooltipType]=\"tooltipType\" [cwTooltipTrigger]=\"tooltipTrigger\" [cwTooltipPosition]=\"tooltipPositionResolved\"\r\n (click)=\"onLinkClick($event)\">\r\n\r\n <ng-container *ngTemplateOutlet=\"buttonContent\"></ng-container>\r\n </a>\r\n } @else {\r\n <button type=\"button\" class=\"btn\" [class]=\"'btn-' + type + ' ' + cssClass\" [ngClass]=\"getButtonClasses()\"\r\n [disabled]=\"isDisabled\" (click)=\"onBtnAction()\" [attr.data-test-ctw]=\"dataTest\"\r\n [cwTooltip]=\"tooltipText\" [cwTooltipDisabled]=\"!withTooltip\" [cwTooltipTitle]=\"tooltipTitle\"\r\n [cwTooltipType]=\"tooltipType\" [cwTooltipTrigger]=\"tooltipTrigger\" [cwTooltipPosition]=\"tooltipPositionResolved\">\r\n\r\n @if (isLoading) {\r\n <span class=\"spinner-border spinner-border-sm\" aria-hidden=\"true\"></span>\r\n <span class=\"visually-hidden\" role=\"status\">{{ '_COMMON._HTTP.TXT_LOADING' | translate }}</span>\r\n }\r\n\r\n <ng-container *ngTemplateOutlet=\"buttonContent\"></ng-container>\r\n </button>\r\n }\r\n }\r\n @else {\r\n <div (clickOutside)=\"onClickOutside()\" ctwClickOutside #dropdown class=\"dropdown d-inline-block\">\r\n <button class=\"btn\" [class]=\"'btn-' + type + ' ' + cssClass\" type=\"button\"\r\n [ngClass]=\"getButtonClasses()\"\r\n [disabled]=\"isDisabled\" [id]=\"id\" aria-expanded=\"false\" (click)=\"toggleDropdown()\" #dropdownToggle\r\n [attr.data-test-ctw]=\"dataTest\"\r\n [cwTooltip]=\"tooltipText\" [cwTooltipDisabled]=\"!withTooltip\" [cwTooltipTitle]=\"tooltipTitle\"\r\n [cwTooltipType]=\"tooltipType\" [cwTooltipTrigger]=\"tooltipTrigger\" [cwTooltipPosition]=\"tooltipPositionResolved\">\r\n\r\n <ng-container *ngTemplateOutlet=\"buttonContent\"></ng-container>\r\n\r\n @if(!hideCaret) {\r\n <cw-icon [icon]=\"spriteIcon.down\" [iconSize]=\"iconSizeEnum['2xs']\" class=\"dropdown-icon\"></cw-icon>\r\n }\r\n </button>\r\n\r\n <div [attr.aria-labelledby]=\"id\" class=\"dropdown-menu\" [ngClass]=\"placementCss\" #dropdownMenu>\r\n <div class=\"dropdown-menu-inner\">\r\n <ng-content></ng-content>\r\n </div>\r\n </div>\r\n </div>\r\n }\r\n</ng-template>\r\n\r\n<!-- Template existant du contenu du bouton -->\r\n<ng-template #buttonContent>\r\n @if (withIcon && iconPosition === buttonPositionEnum.left) {\r\n <ng-container *ngTemplateOutlet=\"iconContent\"></ng-container>\r\n }\r\n\r\n @if(withOnlyIcon) {\r\n <span class=\"visually-hidden\">{{label | translate }}</span>\r\n }\r\n @else {\r\n {{ label | translate }}\r\n }\r\n\r\n @if (withIcon && iconPosition === buttonPositionEnum.right) {\r\n <ng-container *ngTemplateOutlet=\"iconContent\"></ng-container>\r\n }\r\n</ng-template>\r\n\r\n<ng-template #iconContent>\r\n @if(withOnlyIcon) {\r\n @switch(iconSize) {\r\n @case(buttonIconSizeEnum.xsmall) {\r\n <cw-icon [icon]=\"withIcon\" [iconSize]=\"iconSizeEnum['xs']\"></cw-icon>\r\n }\r\n @case(buttonIconSizeEnum.small) {\r\n <cw-icon [icon]=\"withIcon\" [iconSize]=\"iconSizeEnum['xs']\"></cw-icon>\r\n }\r\n @default {\r\n <cw-icon [icon]=\"withIcon\" [iconSize]=\"iconSizeEnum['sm']\"></cw-icon>\r\n }\r\n }\r\n }\r\n @else {\r\n <cw-icon [icon]=\"withIcon\" [iconSize]=\"iconSizeEnum['sm']\"></cw-icon>\r\n }\r\n</ng-template>\r\n" }]
1835
- }], ctorParameters: () => [], propDecorators: { type: [{
1836
- type: Input
1837
- }], label: [{
1838
- type: Input
1839
- }], id: [{
1840
- type: Input
1841
- }], link: [{
1842
- type: Input
1843
- }], isDropdown: [{
1844
- type: Input
1845
- }], hideCaret: [{
1846
- type: Input
1847
- }], withIcon: [{
1848
- type: Input
1849
- }], withOnlyIcon: [{
1850
- type: Input
1851
- }], iconSize: [{
1852
- type: Input
1853
- }], iconPosition: [{
1854
- type: Input
1855
- }], dropdownPosition: [{
1856
- type: Input
1857
- }], isMinWidth: [{
1858
- type: Input
1859
- }], isDisabled: [{
1860
- type: Input
1861
- }], isLoading: [{
1862
- type: Input
1863
- }], cssClass: [{
1864
- type: Input
1865
- }], dataTest: [{
1866
- type: Input
1867
- }], skeletonMode: [{
1868
- type: Input
1869
- }], withTooltip: [{
1870
- type: Input
1871
- }], tooltipText: [{
1872
- type: Input
1873
- }], tooltipTitle: [{
1874
- type: Input
1875
- }], tooltipTrigger: [{
1876
- type: Input
1877
- }], tooltipPosition: [{
1878
- type: Input
1879
- }], tooltipType: [{
1880
- type: Input
1881
- }], btnAction: [{
1882
- type: Output
1883
- }], dropDownClicked: [{
1884
- type: Output
1885
- }], dropdown: [{
1886
- type: ViewChild,
1887
- args: ['dropdown']
1888
- }], dropdownMenu: [{
1889
- type: ViewChild,
1890
- args: ['dropdownMenu']
1891
- }], dropdownToggle: [{
1892
- type: ViewChild,
1893
- args: ['dropdownToggle']
1894
- }], hostClasses: [{
1895
- type: HostBinding,
1896
- args: ['class']
1897
- }] } });
1821
+ ], template: "<ng-container *ngTemplateOutlet=\"buttonTemplate\"></ng-container>\n\n<!-- Template du bouton (code existant envelopp\u00E9) -->\n<ng-template #buttonTemplate>\n @if (!isDropdown()) {\n @if (link() != null) {\n <a class=\"btn\" [class]=\"'btn-' + type() + ' ' + cssClass()\" [ngClass]=\"getButtonClasses()\"\n [class.disabled]=\"isDisabled()\"\n [routerLink]=\"isDisabled() ? null : link()\"\n [attr.aria-disabled]=\"isDisabled() ? 'true' : null\"\n [attr.tabindex]=\"isDisabled() ? -1 : null\"\n [attr.data-test-ctw]=\"resolvedDataTest()\"\n [cwTooltip]=\"tooltipText()\" [cwTooltipDisabled]=\"!withTooltip()\" [cwTooltipTitle]=\"tooltipTitle()\"\n [cwTooltipType]=\"tooltipType()\" [cwTooltipTrigger]=\"tooltipTrigger()\" [cwTooltipPosition]=\"tooltipPositionResolved\"\n (click)=\"onLinkClick($event)\">\n\n <ng-container *ngTemplateOutlet=\"buttonContent\"></ng-container>\n </a>\n } @else {\n <button type=\"button\" class=\"btn\" [class]=\"'btn-' + type() + ' ' + cssClass()\" [ngClass]=\"getButtonClasses()\"\n [disabled]=\"isDisabled()\" (click)=\"onBtnAction()\" [attr.data-test-ctw]=\"resolvedDataTest()\"\n [cwTooltip]=\"tooltipText()\" [cwTooltipDisabled]=\"!withTooltip()\" [cwTooltipTitle]=\"tooltipTitle()\"\n [cwTooltipType]=\"tooltipType()\" [cwTooltipTrigger]=\"tooltipTrigger()\" [cwTooltipPosition]=\"tooltipPositionResolved\">\n\n @if (isLoading()) {\n <span class=\"spinner-border spinner-border-sm\" aria-hidden=\"true\"></span>\n <span class=\"visually-hidden\" role=\"status\">{{ '_COMMON._HTTP.TXT_LOADING' | translate }}</span>\n }\n\n <ng-container *ngTemplateOutlet=\"buttonContent\"></ng-container>\n </button>\n }\n }\n @else {\n <div (clickOutside)=\"onClickOutside()\" ctwClickOutside #dropdown class=\"dropdown d-inline-block\">\n <button class=\"btn\" [class]=\"'btn-' + type() + ' ' + cssClass()\" type=\"button\"\n [ngClass]=\"getButtonClasses()\"\n [disabled]=\"isDisabled()\" [id]=\"id()\" [attr.aria-expanded]=\"isOpen\" (click)=\"toggleDropdown()\" #dropdownToggle\n [attr.data-test-ctw]=\"resolvedDataTest()\"\n [cwTooltip]=\"tooltipText()\" [cwTooltipDisabled]=\"!withTooltip()\" [cwTooltipTitle]=\"tooltipTitle()\"\n [cwTooltipType]=\"tooltipType()\" [cwTooltipTrigger]=\"tooltipTrigger()\" [cwTooltipPosition]=\"tooltipPositionResolved\">\n\n <ng-container *ngTemplateOutlet=\"buttonContent\"></ng-container>\n\n @if(!hideCaret()) {\n <cw-icon [icon]=\"spriteIcon.down\" [iconSize]=\"iconSizeEnum['2xs']\" class=\"dropdown-icon\"></cw-icon>\n }\n </button>\n\n <div [attr.aria-labelledby]=\"id()\" class=\"dropdown-menu\" [ngClass]=\"placementCss\" #dropdownMenu>\n <div class=\"dropdown-menu-inner\">\n <ng-content></ng-content>\n </div>\n </div>\n </div>\n }\n</ng-template>\n\n<!-- Template existant du contenu du bouton -->\n<ng-template #buttonContent>\n @if (withIcon() && iconPosition() === buttonPositionEnum.left) {\n <ng-container *ngTemplateOutlet=\"iconContent\"></ng-container>\n }\n\n @if(withOnlyIcon()) {\n <span class=\"visually-hidden\">{{label() | translate }}</span>\n }\n @else {\n {{ label() | translate }}\n }\n\n @if (withIcon() && iconPosition() === buttonPositionEnum.right) {\n <ng-container *ngTemplateOutlet=\"iconContent\"></ng-container>\n }\n</ng-template>\n\n<ng-template #iconContent>\n @if(withOnlyIcon()) {\n @switch(iconSize()) {\n @case(buttonIconSizeEnum.xsmall) {\n <cw-icon [icon]=\"withIcon()\" [iconSize]=\"iconSizeEnum['xs']\"></cw-icon>\n }\n @case(buttonIconSizeEnum.small) {\n <cw-icon [icon]=\"withIcon()\" [iconSize]=\"iconSizeEnum['xs']\"></cw-icon>\n }\n @default {\n <cw-icon [icon]=\"withIcon()\" [iconSize]=\"iconSizeEnum['sm']\"></cw-icon>\n }\n }\n }\n @else {\n <cw-icon [icon]=\"withIcon()\" [iconSize]=\"iconSizeEnum['sm']\"></cw-icon>\n }\n</ng-template>\n" }]
1822
+ }], propDecorators: { type: [{ type: i0.Input, args: [{ isSignal: true, alias: "type", required: false }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], id: [{ type: i0.Input, args: [{ isSignal: true, alias: "id", required: false }] }], link: [{ type: i0.Input, args: [{ isSignal: true, alias: "link", required: false }] }], isDropdown: [{ type: i0.Input, args: [{ isSignal: true, alias: "isDropdown", required: false }] }], hideCaret: [{ type: i0.Input, args: [{ isSignal: true, alias: "hideCaret", required: false }] }], withIcon: [{ type: i0.Input, args: [{ isSignal: true, alias: "withIcon", required: false }] }], withOnlyIcon: [{ type: i0.Input, args: [{ isSignal: true, alias: "withOnlyIcon", required: false }] }], iconSize: [{ type: i0.Input, args: [{ isSignal: true, alias: "iconSize", required: false }] }], iconPosition: [{ type: i0.Input, args: [{ isSignal: true, alias: "iconPosition", required: false }] }], dropdownPosition: [{ type: i0.Input, args: [{ isSignal: true, alias: "dropdownPosition", required: false }] }], isMinWidth: [{ type: i0.Input, args: [{ isSignal: true, alias: "isMinWidth", required: false }] }], isDisabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "isDisabled", required: false }] }], isLoading: [{ type: i0.Input, args: [{ isSignal: true, alias: "isLoading", required: false }] }], cssClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "cssClass", required: false }] }], dataTest: [{ type: i0.Input, args: [{ isSignal: true, alias: "dataTest", required: false }] }], skeletonMode: [{ type: i0.Input, args: [{ isSignal: true, alias: "skeletonMode", required: false }] }], withTooltip: [{ type: i0.Input, args: [{ isSignal: true, alias: "withTooltip", required: false }] }], tooltipText: [{ type: i0.Input, args: [{ isSignal: true, alias: "tooltipText", required: false }] }], tooltipTitle: [{ type: i0.Input, args: [{ isSignal: true, alias: "tooltipTitle", required: false }] }], tooltipTrigger: [{ type: i0.Input, args: [{ isSignal: true, alias: "tooltipTrigger", required: false }] }], tooltipPosition: [{ type: i0.Input, args: [{ isSignal: true, alias: "tooltipPosition", required: false }] }], tooltipType: [{ type: i0.Input, args: [{ isSignal: true, alias: "tooltipType", required: false }] }], btnAction: [{ type: i0.Output, args: ["btnAction"] }], dropDownClicked: [{ type: i0.Output, args: ["dropDownClicked"] }], dropdown: [{ type: i0.ViewChild, args: ['dropdown', { isSignal: true }] }], dropdownMenu: [{ type: i0.ViewChild, args: ['dropdownMenu', { isSignal: true }] }], dropdownToggle: [{ type: i0.ViewChild, args: ['dropdownToggle', { isSignal: true }] }] } });
1823
+
1824
+ /**
1825
+ * Navigation clavier ARIA d'un conteneur de menu.
1826
+ *
1827
+ * Deplace le focus entre les items du conteneur (fleches Haut/Bas avec bouclage,
1828
+ * Home, End) et emet `escapePressed` sur Echap (au consommateur de fermer le menu
1829
+ * et de rendre le focus au declencheur).
1830
+ *
1831
+ * Les items ciblables sont configurables via `menuItemSelector` (defaut :
1832
+ * `[role="menuitemradio"]`, ex. language-selector). Le dropdown generique passe
1833
+ * `.dropdown-item:not([disabled]):not(.disabled)`.
1834
+ *
1835
+ * Usage : `<div role="menu" cwMenuKeyboard (escapePressed)="trigger()?.closeDropdown()">`.
1836
+ */
1837
+ class MenuKeyboardDirective {
1838
+ constructor() {
1839
+ this.host = inject(ElementRef);
1840
+ /** Selecteur CSS des items navigables du menu. */
1841
+ this.menuItemSelector = input('[role="menuitemradio"]', ...(ngDevMode ? [{ debugName: "menuItemSelector" }] : []));
1842
+ this.escapePressed = output();
1843
+ }
1844
+ onKeydown(event) {
1845
+ const items = Array.from(this.host.nativeElement.querySelectorAll(this.menuItemSelector()));
1846
+ if (!items.length)
1847
+ return;
1848
+ const currentIndex = items.indexOf(document.activeElement);
1849
+ let nextIndex;
1850
+ switch (event.key) {
1851
+ case 'ArrowDown':
1852
+ nextIndex = currentIndex < 0 ? 0 : (currentIndex + 1) % items.length;
1853
+ break;
1854
+ case 'ArrowUp':
1855
+ nextIndex = currentIndex <= 0 ? items.length - 1 : currentIndex - 1;
1856
+ break;
1857
+ case 'Home':
1858
+ nextIndex = 0;
1859
+ break;
1860
+ case 'End':
1861
+ nextIndex = items.length - 1;
1862
+ break;
1863
+ case 'Escape':
1864
+ this.escapePressed.emit();
1865
+ return;
1866
+ default: return;
1867
+ }
1868
+ event.preventDefault();
1869
+ items[nextIndex]?.focus();
1870
+ }
1871
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: MenuKeyboardDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
1872
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "20.3.20", type: MenuKeyboardDirective, isStandalone: true, selector: "[cwMenuKeyboard]", inputs: { menuItemSelector: { classPropertyName: "menuItemSelector", publicName: "menuItemSelector", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { escapePressed: "escapePressed" }, host: { listeners: { "keydown": "onKeydown($event)" } }, ngImport: i0 }); }
1873
+ }
1874
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: MenuKeyboardDirective, decorators: [{
1875
+ type: Directive,
1876
+ args: [{
1877
+ selector: '[cwMenuKeyboard]',
1878
+ standalone: true,
1879
+ host: { '(keydown)': 'onKeydown($event)' }
1880
+ }]
1881
+ }], propDecorators: { menuItemSelector: [{ type: i0.Input, args: [{ isSignal: true, alias: "menuItemSelector", required: false }] }], escapePressed: [{ type: i0.Output, args: ["escapePressed"] }] } });
1898
1882
 
1899
1883
  class DropdownComponent {
1900
1884
  constructor() {
1901
- this.title = 'Dropdown';
1902
- this.icon = 'cw-nav-small-menu';
1903
- this.btnCustom = false;
1904
- this.btnCssClass = 'btn-secondary';
1905
- this.menuClass = '';
1906
- this.placement = 'bottom-start';
1907
- this.autoClose = true;
1885
+ this.renderer = inject(Renderer2);
1886
+ this.destroyRef = inject(DestroyRef);
1887
+ this.id = input(...(ngDevMode ? [undefined, { debugName: "id" }] : []));
1888
+ this.title = input('Dropdown', ...(ngDevMode ? [{ debugName: "title" }] : []));
1889
+ this.icon = input('cw-nav-small-menu', ...(ngDevMode ? [{ debugName: "icon" }] : []));
1890
+ this.btnCustom = input(false, ...(ngDevMode ? [{ debugName: "btnCustom" }] : []));
1891
+ this.btnCssClass = input('btn-secondary', ...(ngDevMode ? [{ debugName: "btnCssClass" }] : []));
1892
+ this.menuClass = input('', ...(ngDevMode ? [{ debugName: "menuClass" }] : []));
1893
+ this.placement = input('bottom-start', ...(ngDevMode ? [{ debugName: "placement" }] : []));
1894
+ this.autoClose = input(true, ...(ngDevMode ? [{ debugName: "autoClose" }] : []));
1908
1895
  this.opened = output();
1909
1896
  this.closed = output();
1897
+ this.dropdownMenu = viewChild('dropdownMenu', ...(ngDevMode ? [{ debugName: "dropdownMenu" }] : []));
1898
+ this.dropdownToggle = viewChild('dropdownToggle', ...(ngDevMode ? [{ debugName: "dropdownToggle" }] : []));
1910
1899
  this.isOpen = signal(false, ...(ngDevMode ? [{ debugName: "isOpen" }] : []));
1900
+ // Fallback stable calcule une seule fois : sans quoi le getter regenerait un id
1901
+ // a chaque lecture (button [id] vs menu [aria-labelledby] => association cassee).
1902
+ this.fallbackId = `dropdown-${Math.random().toString(36).substring(2, 11)}`;
1911
1903
  }
1912
1904
  get dropdownId() {
1913
- return this.id || `dropdown-${Math.random().toString(36).substring(2, 11)}`;
1905
+ return this.id() || this.fallbackId;
1914
1906
  }
1915
1907
  get placementCss() {
1916
- return this.placement;
1908
+ return this.placement();
1917
1909
  }
1918
1910
  ngAfterViewInit() {
1919
- // Fermer au clic sur un item du menu
1920
- if (this.autoClose && this.dropdownMenu) {
1921
- this.dropdownMenu.nativeElement.addEventListener('click', (event) => {
1911
+ // Fermer au clic sur un item du menu (Renderer2.listen + teardown DestroyRef ;
1912
+ // auparavant addEventListener jamais retire).
1913
+ const menu = this.dropdownMenu();
1914
+ if (this.autoClose() && menu) {
1915
+ const unlisten = this.renderer.listen(menu.nativeElement, 'click', (event) => {
1922
1916
  const target = event.target;
1923
1917
  if (target.classList.contains('dropdown-item')) {
1924
1918
  this.closeDropdown();
1925
1919
  }
1926
1920
  });
1921
+ this.destroyRef.onDestroy(unlisten);
1927
1922
  }
1928
1923
  }
1929
1924
  toggleDropdown() {
@@ -1947,42 +1942,25 @@ class DropdownComponent {
1947
1942
  this.closeDropdown();
1948
1943
  }
1949
1944
  }
1945
+ /** Echap : ferme le menu et rend le focus au bouton declencheur. */
1946
+ onEscape() {
1947
+ if (this.isOpen()) {
1948
+ this.closeDropdown();
1949
+ this.dropdownToggle()?.nativeElement.focus();
1950
+ }
1951
+ }
1950
1952
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: DropdownComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
1951
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.20", type: DropdownComponent, isStandalone: true, selector: "cw-dropdown", inputs: { id: "id", title: "title", icon: "icon", btnCustom: "btnCustom", btnCssClass: "btnCssClass", menuClass: "menuClass", placement: "placement", autoClose: "autoClose" }, outputs: { opened: "opened", closed: "closed" }, viewQueries: [{ propertyName: "dropdownElement", first: true, predicate: ["dropdown"], descendants: true }, { propertyName: "dropdownMenu", first: true, predicate: ["dropdownMenu"], descendants: true }, { propertyName: "dropdownToggle", first: true, predicate: ["dropdownToggle"], descendants: true }], ngImport: i0, template: "<div class=\"dropdown\" [class.show]=\"isOpen()\" (clickOutside)=\"onClickOutside()\" clickOutside #dropdown>\r\n\r\n <button type=\"button\" class=\"dropdown-toggle btn\" [id]=\"dropdownId\" [attr.aria-expanded]=\"isOpen()\"\r\n [attr.aria-haspopup]=\"true\" (click)=\"toggleDropdown()\" [ngClass]=\"btnCssClass\" #dropdownToggle>\r\n\r\n <!-- Custom button content -->\r\n <ng-content select=\"[button]\"></ng-content>\r\n\r\n <!-- Classic button with icon -->\r\n @if (!btnCustom) {\r\n <cw-icon label=\"Menu\"></cw-icon>\r\n }\r\n </button>\r\n\r\n <div [attr.aria-labelledby]=\"dropdownId\" class=\"dropdown-menu\" [class.show]=\"isOpen()\"\r\n [ngClass]=\"placementCss + ' ' + menuClass\" #dropdownMenu>\r\n <ng-content></ng-content>\r\n </div>\r\n</div>\r\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: ClickOutsideDirective, selector: "[clickOutside]", outputs: ["clickOutside"] }, { kind: "component", type: IconComponent, selector: "cw-icon", inputs: ["icon", "label", "type", "iconSize", "iconCssClass", "iconUiType", "iconColorCustom", "spritePath"] }] }); }
1953
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.20", type: DropdownComponent, isStandalone: true, selector: "cw-dropdown", inputs: { id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null }, title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: false, transformFunction: null }, icon: { classPropertyName: "icon", publicName: "icon", isSignal: true, isRequired: false, transformFunction: null }, btnCustom: { classPropertyName: "btnCustom", publicName: "btnCustom", isSignal: true, isRequired: false, transformFunction: null }, btnCssClass: { classPropertyName: "btnCssClass", publicName: "btnCssClass", isSignal: true, isRequired: false, transformFunction: null }, menuClass: { classPropertyName: "menuClass", publicName: "menuClass", isSignal: true, isRequired: false, transformFunction: null }, placement: { classPropertyName: "placement", publicName: "placement", isSignal: true, isRequired: false, transformFunction: null }, autoClose: { classPropertyName: "autoClose", publicName: "autoClose", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { opened: "opened", closed: "closed" }, viewQueries: [{ propertyName: "dropdownMenu", first: true, predicate: ["dropdownMenu"], descendants: true, isSignal: true }, { propertyName: "dropdownToggle", first: true, predicate: ["dropdownToggle"], descendants: true, isSignal: true }], ngImport: i0, template: "<!-- Conteneur : Escape delegue depuis les enfants (bouton natif focusable +\r\n items via cwMenuKeyboard) ; le wrapper n'a pas a etre focusable. -->\r\n<!-- eslint-disable-next-line @angular-eslint/template/interactive-supports-focus -->\r\n<div class=\"dropdown\" [class.show]=\"isOpen()\" (clickOutside)=\"onClickOutside()\" clickOutside (keydown.escape)=\"onEscape()\" #dropdown>\r\n\r\n <button type=\"button\" class=\"dropdown-toggle btn\" [id]=\"dropdownId\" [attr.aria-expanded]=\"isOpen()\"\r\n [attr.aria-haspopup]=\"true\" (click)=\"toggleDropdown()\" [ngClass]=\"btnCssClass()\" #dropdownToggle>\r\n\r\n <!-- Custom button content -->\r\n <ng-content select=\"[button]\"></ng-content>\r\n\r\n <!-- Classic button with icon -->\r\n @if (!btnCustom()) {\r\n <cw-icon label=\"Menu\"></cw-icon>\r\n }\r\n </button>\r\n\r\n <div [attr.aria-labelledby]=\"dropdownId\" class=\"dropdown-menu\" [class.show]=\"isOpen()\"\r\n [ngClass]=\"placementCss + ' ' + menuClass()\" cwMenuKeyboard\r\n [menuItemSelector]=\"'.dropdown-item:not([disabled]):not(.disabled)'\" #dropdownMenu>\r\n <ng-content></ng-content>\r\n </div>\r\n</div>\r\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: ClickOutsideDirective, selector: "[clickOutside]", outputs: ["clickOutside"] }, { kind: "directive", type: MenuKeyboardDirective, selector: "[cwMenuKeyboard]", inputs: ["menuItemSelector"], outputs: ["escapePressed"] }, { kind: "component", type: IconComponent, selector: "cw-icon", inputs: ["icon", "label", "type", "iconSize", "iconCssClass", "iconUiType", "iconColorCustom", "spritePath"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
1952
1954
  }
1953
1955
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: DropdownComponent, decorators: [{
1954
1956
  type: Component,
1955
- args: [{ selector: 'cw-dropdown', standalone: true, imports: [
1957
+ args: [{ selector: 'cw-dropdown', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, imports: [
1956
1958
  CommonModule,
1957
1959
  ClickOutsideDirective,
1960
+ MenuKeyboardDirective,
1958
1961
  IconComponent
1959
- ], template: "<div class=\"dropdown\" [class.show]=\"isOpen()\" (clickOutside)=\"onClickOutside()\" clickOutside #dropdown>\r\n\r\n <button type=\"button\" class=\"dropdown-toggle btn\" [id]=\"dropdownId\" [attr.aria-expanded]=\"isOpen()\"\r\n [attr.aria-haspopup]=\"true\" (click)=\"toggleDropdown()\" [ngClass]=\"btnCssClass\" #dropdownToggle>\r\n\r\n <!-- Custom button content -->\r\n <ng-content select=\"[button]\"></ng-content>\r\n\r\n <!-- Classic button with icon -->\r\n @if (!btnCustom) {\r\n <cw-icon label=\"Menu\"></cw-icon>\r\n }\r\n </button>\r\n\r\n <div [attr.aria-labelledby]=\"dropdownId\" class=\"dropdown-menu\" [class.show]=\"isOpen()\"\r\n [ngClass]=\"placementCss + ' ' + menuClass\" #dropdownMenu>\r\n <ng-content></ng-content>\r\n </div>\r\n</div>\r\n" }]
1960
- }], propDecorators: { id: [{
1961
- type: Input
1962
- }], title: [{
1963
- type: Input
1964
- }], icon: [{
1965
- type: Input
1966
- }], btnCustom: [{
1967
- type: Input
1968
- }], btnCssClass: [{
1969
- type: Input
1970
- }], menuClass: [{
1971
- type: Input
1972
- }], placement: [{
1973
- type: Input
1974
- }], autoClose: [{
1975
- type: Input
1976
- }], opened: [{ type: i0.Output, args: ["opened"] }], closed: [{ type: i0.Output, args: ["closed"] }], dropdownElement: [{
1977
- type: ViewChild,
1978
- args: ['dropdown']
1979
- }], dropdownMenu: [{
1980
- type: ViewChild,
1981
- args: ['dropdownMenu']
1982
- }], dropdownToggle: [{
1983
- type: ViewChild,
1984
- args: ['dropdownToggle']
1985
- }] } });
1962
+ ], template: "<!-- Conteneur : Escape delegue depuis les enfants (bouton natif focusable +\r\n items via cwMenuKeyboard) ; le wrapper n'a pas a etre focusable. -->\r\n<!-- eslint-disable-next-line @angular-eslint/template/interactive-supports-focus -->\r\n<div class=\"dropdown\" [class.show]=\"isOpen()\" (clickOutside)=\"onClickOutside()\" clickOutside (keydown.escape)=\"onEscape()\" #dropdown>\r\n\r\n <button type=\"button\" class=\"dropdown-toggle btn\" [id]=\"dropdownId\" [attr.aria-expanded]=\"isOpen()\"\r\n [attr.aria-haspopup]=\"true\" (click)=\"toggleDropdown()\" [ngClass]=\"btnCssClass()\" #dropdownToggle>\r\n\r\n <!-- Custom button content -->\r\n <ng-content select=\"[button]\"></ng-content>\r\n\r\n <!-- Classic button with icon -->\r\n @if (!btnCustom()) {\r\n <cw-icon label=\"Menu\"></cw-icon>\r\n }\r\n </button>\r\n\r\n <div [attr.aria-labelledby]=\"dropdownId\" class=\"dropdown-menu\" [class.show]=\"isOpen()\"\r\n [ngClass]=\"placementCss + ' ' + menuClass()\" cwMenuKeyboard\r\n [menuItemSelector]=\"'.dropdown-item:not([disabled]):not(.disabled)'\" #dropdownMenu>\r\n <ng-content></ng-content>\r\n </div>\r\n</div>\r\n" }]
1963
+ }], propDecorators: { id: [{ type: i0.Input, args: [{ isSignal: true, alias: "id", required: false }] }], title: [{ type: i0.Input, args: [{ isSignal: true, alias: "title", required: false }] }], icon: [{ type: i0.Input, args: [{ isSignal: true, alias: "icon", required: false }] }], btnCustom: [{ type: i0.Input, args: [{ isSignal: true, alias: "btnCustom", required: false }] }], btnCssClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "btnCssClass", required: false }] }], menuClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "menuClass", required: false }] }], placement: [{ type: i0.Input, args: [{ isSignal: true, alias: "placement", required: false }] }], autoClose: [{ type: i0.Input, args: [{ isSignal: true, alias: "autoClose", required: false }] }], opened: [{ type: i0.Output, args: ["opened"] }], closed: [{ type: i0.Output, args: ["closed"] }], dropdownMenu: [{ type: i0.ViewChild, args: ['dropdownMenu', { isSignal: true }] }], dropdownToggle: [{ type: i0.ViewChild, args: ['dropdownToggle', { isSignal: true }] }] } });
1986
1964
 
1987
1965
  var FormFieldTypeEnum;
1988
1966
  (function (FormFieldTypeEnum) {
@@ -2020,6 +1998,7 @@ var FormFieldTypeEnum;
2020
1998
  FormFieldTypeEnum["phone"] = "phone";
2021
1999
  FormFieldTypeEnum["autocomplete"] = "autocomplete";
2022
2000
  FormFieldTypeEnum["autocompleteMultiple"] = "autocompleteMultiple";
2001
+ FormFieldTypeEnum["richText"] = "richText";
2023
2002
  })(FormFieldTypeEnum || (FormFieldTypeEnum = {}));
2024
2003
 
2025
2004
  /**
@@ -2406,7 +2385,10 @@ class AutocompleteComponent {
2406
2385
  }), filter((t) => (t?.length ?? 0) >= this.minChars()), tap(() => {
2407
2386
  this.loading.set(true);
2408
2387
  this.isOpen.set(true);
2409
- }), debounceTime(this.debounceMs()), switchMap((t) => this.fetcher()(t).pipe(catchError(() => of([])))), tap((items) => {
2388
+ }),
2389
+ // debounce(() => timer(...)) lit debounceMs() a chaque emission : reactif si
2390
+ // le parent change le delai apres init (debounceTime le figeait a la souscription).
2391
+ debounce(() => timer(this.debounceMs())), switchMap((t) => this.fetcher()(t).pipe(catchError(() => of([])))), tap((items) => {
2410
2392
  this.items.set(items);
2411
2393
  this.loading.set(false);
2412
2394
  this.activeRow.set(items.length > 0 ? 0 : -1);
@@ -2712,7 +2694,7 @@ class AutocompleteComponent {
2712
2694
  return s.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
2713
2695
  }
2714
2696
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: AutocompleteComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
2715
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.20", type: AutocompleteComponent, isStandalone: true, selector: "cw-autocomplete", inputs: { control: { classPropertyName: "control", publicName: "control", isSignal: true, isRequired: true, transformFunction: null }, fetcher: { classPropertyName: "fetcher", publicName: "fetcher", isSignal: true, isRequired: true, transformFunction: null }, displayField: { classPropertyName: "displayField", publicName: "displayField", isSignal: true, isRequired: false, transformFunction: null }, valueField: { classPropertyName: "valueField", publicName: "valueField", isSignal: true, isRequired: false, transformFunction: null }, columns: { classPropertyName: "columns", publicName: "columns", isSignal: true, isRequired: false, transformFunction: null }, multiple: { classPropertyName: "multiple", publicName: "multiple", isSignal: true, isRequired: false, transformFunction: null }, minChars: { classPropertyName: "minChars", publicName: "minChars", isSignal: true, isRequired: false, transformFunction: null }, debounceMs: { classPropertyName: "debounceMs", publicName: "debounceMs", isSignal: true, isRequired: false, transformFunction: null }, selectedItem: { classPropertyName: "selectedItem", publicName: "selectedItem", isSignal: true, isRequired: false, transformFunction: null }, resolver: { classPropertyName: "resolver", publicName: "resolver", isSignal: true, isRequired: false, transformFunction: null }, selectedItems: { classPropertyName: "selectedItems", publicName: "selectedItems", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null }, isRequired: { classPropertyName: "isRequired", publicName: "isRequired", isSignal: true, isRequired: false, transformFunction: null }, isReadonly: { classPropertyName: "isReadonly", publicName: "isReadonly", isSignal: true, isRequired: false, transformFunction: null }, isDisabled: { classPropertyName: "isDisabled", publicName: "isDisabled", isSignal: true, isRequired: false, transformFunction: null }, ariaInvalid: { classPropertyName: "ariaInvalid", publicName: "ariaInvalid", isSignal: true, isRequired: false, transformFunction: null }, ariaDescribedBy: { classPropertyName: "ariaDescribedBy", publicName: "ariaDescribedBy", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { itemSelected: "itemSelected", itemsChange: "itemsChange" }, viewQueries: [{ propertyName: "listboxEl", first: true, predicate: ["listboxEl"], descendants: true, isSignal: true }, { propertyName: "masterCheckbox", first: true, predicate: ["masterCheckbox"], descendants: true, isSignal: true }], ngImport: i0, template: "<div\n class=\"autocomplete-wrapper\"\n (clickOutside)=\"onClickOutside()\">\n\n <div class=\"field-group\">\n <input\n type=\"text\"\n class=\"field-control autocomplete-input\"\n [class.has-value]=\"hasAnyContent()\"\n [id]=\"resolvedId()\"\n [formControl]=\"searchInput\"\n [attr.placeholder]=\"placeholder() ? (placeholder() | translate) : null\"\n [attr.readonly]=\"isReadonly() ? 'readonly' : null\"\n role=\"combobox\"\n aria-autocomplete=\"list\"\n aria-haspopup=\"listbox\"\n [attr.aria-expanded]=\"isOpen()\"\n [attr.aria-controls]=\"listboxId()\"\n [attr.aria-activedescendant]=\"activeDescendant()\"\n [attr.aria-required]=\"isRequired() ? 'true' : null\"\n [attr.aria-invalid]=\"ariaInvalid() ? 'true' : null\"\n [attr.aria-describedby]=\"ariaDescribedBy()\"\n autocomplete=\"off\"\n (focus)=\"onFocus()\"\n (blur)=\"onBlur()\"\n (keydown)=\"onKeyDown($event)\">\n\n @if (loading()) {\n <div class=\"autocomplete-loader-container d-flex-h\">\n <span class=\"autocomplete-loader spinner-border spinner-border-sm\" aria-hidden=\"true\"></span>\n </div>\n }\n </div>\n\n @if (showListbox()) {\n <ul\n #listboxEl\n class=\"list-unstyled autocomplete-listbox dropdown-menu show\"\n role=\"listbox\"\n [id]=\"listboxId()\"\n [attr.aria-labelledby]=\"resolvedId()\"\n [attr.aria-multiselectable]=\"multiple() ? 'true' : null\"\n (mousedown)=\"$event.preventDefault()\">\n\n @if (multiple()) {\n <li\n role=\"option\"\n [id]=\"masterOptionId()\"\n class=\"autocomplete-option autocomplete-option-master\"\n [class.is-active]=\"activeRow() === MASTER_ROW\"\n [attr.aria-selected]=\"masterState() === 'checked' ? 'true' : 'false'\"\n (mouseenter)=\"onMasterMouseEnter()\"\n (click)=\"onMasterClick()\">\n <input\n #masterCheckbox\n type=\"checkbox\"\n class=\"field-check-input\"\n tabindex=\"-1\"\n aria-hidden=\"true\"\n [checked]=\"masterState() === 'checked'\">\n <span class=\"autocomplete-master-label fs-sm\">\n {{ (masterState() === 'checked'\n ? '_COMMON._ACTION.DESELECT_ALL'\n : '_COMMON._ACTION.SELECT_ALL') | translate }}\n </span>\n </li>\n }\n\n @for (item of items(); track $index; let rowIdx = $index) {\n <li\n role=\"option\"\n [id]=\"optionId(rowIdx)\"\n class=\"autocomplete-option\"\n [class.is-active]=\"activeRow() === rowIdx\"\n [class.is-disabled]=\"isItemDisabled(item)\"\n [attr.aria-selected]=\"multiple() ? (isItemSelected(item) ? 'true' : 'false') : (activeRow() === rowIdx ? 'true' : null)\"\n [attr.aria-disabled]=\"isItemDisabled(item) ? 'true' : null\"\n (mouseenter)=\"onRowMouseEnter(rowIdx)\"\n (click)=\"onRowClick(rowIdx)\">\n\n @if (multiple()) {\n <input\n type=\"checkbox\"\n class=\"field-check-input\"\n tabindex=\"-1\"\n aria-hidden=\"true\"\n [disabled]=\"isItemDisabled(item)\"\n [checked]=\"isItemSelected(item)\">\n }\n\n <span class=\"autocomplete-option-main fs-sm\" [innerHTML]=\"highlight(getColumnText(item, 0))\"></span>\n\n @for (col of columns(); track col.field; let colIdx = $index) {\n <span class=\"autocomplete-option-additionnal text-muted fs-xs\"\n [innerHTML]=\"highlight(getColumnText(item, colIdx + 1))\"></span>\n }\n </li>\n }\n </ul>\n }\n\n @if (showNoResult()) {\n <div class=\"autocomplete-listbox dropdown-menu show fs-sm px-md\" aria-hidden=\"true\">\n {{ '_COMMON.NO_RESULT' | translate }}\n </div>\n }\n</div>\n\n <!-- Les chips de la multi-s\u00E9lection sont rendus par le parent cw-form-field (hors field-group),\n \u00E0 partir de `chips()` + `onChipRemove()`. Voir form-field.component.html. -->\n\n <!-- Live region pour annonces lecteur d'\u00E9cran -->\n <div\n [id]=\"liveId()\"\n class=\"visually-hidden\"\n role=\"status\"\n aria-live=\"polite\"\n aria-atomic=\"true\">\n @if (liveMessageKey(); as key) {\n {{ key | translate: { total: items().length } }}\n }\n </div>\n", styles: [":host{display:block;width:100%}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i2$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2$1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "ngmodule", type: TranslateModule }, { kind: "directive", type: ClickOutsideDirective, selector: "[clickOutside]", outputs: ["clickOutside"] }, { kind: "pipe", type: i2.TranslatePipe, name: "translate" }] }); }
2697
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.20", type: AutocompleteComponent, isStandalone: true, selector: "cw-autocomplete", inputs: { control: { classPropertyName: "control", publicName: "control", isSignal: true, isRequired: true, transformFunction: null }, fetcher: { classPropertyName: "fetcher", publicName: "fetcher", isSignal: true, isRequired: true, transformFunction: null }, displayField: { classPropertyName: "displayField", publicName: "displayField", isSignal: true, isRequired: false, transformFunction: null }, valueField: { classPropertyName: "valueField", publicName: "valueField", isSignal: true, isRequired: false, transformFunction: null }, columns: { classPropertyName: "columns", publicName: "columns", isSignal: true, isRequired: false, transformFunction: null }, multiple: { classPropertyName: "multiple", publicName: "multiple", isSignal: true, isRequired: false, transformFunction: null }, minChars: { classPropertyName: "minChars", publicName: "minChars", isSignal: true, isRequired: false, transformFunction: null }, debounceMs: { classPropertyName: "debounceMs", publicName: "debounceMs", isSignal: true, isRequired: false, transformFunction: null }, selectedItem: { classPropertyName: "selectedItem", publicName: "selectedItem", isSignal: true, isRequired: false, transformFunction: null }, resolver: { classPropertyName: "resolver", publicName: "resolver", isSignal: true, isRequired: false, transformFunction: null }, selectedItems: { classPropertyName: "selectedItems", publicName: "selectedItems", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null }, isRequired: { classPropertyName: "isRequired", publicName: "isRequired", isSignal: true, isRequired: false, transformFunction: null }, isReadonly: { classPropertyName: "isReadonly", publicName: "isReadonly", isSignal: true, isRequired: false, transformFunction: null }, isDisabled: { classPropertyName: "isDisabled", publicName: "isDisabled", isSignal: true, isRequired: false, transformFunction: null }, ariaInvalid: { classPropertyName: "ariaInvalid", publicName: "ariaInvalid", isSignal: true, isRequired: false, transformFunction: null }, ariaDescribedBy: { classPropertyName: "ariaDescribedBy", publicName: "ariaDescribedBy", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { itemSelected: "itemSelected", itemsChange: "itemsChange" }, viewQueries: [{ propertyName: "listboxEl", first: true, predicate: ["listboxEl"], descendants: true, isSignal: true }, { propertyName: "masterCheckbox", first: true, predicate: ["masterCheckbox"], descendants: true, isSignal: true }], ngImport: i0, template: "<div\n class=\"autocomplete-wrapper\"\n (clickOutside)=\"onClickOutside()\">\n\n <div class=\"field-group\">\n <input\n type=\"text\"\n class=\"field-control autocomplete-input\"\n [class.has-value]=\"hasAnyContent()\"\n [id]=\"resolvedId()\"\n [formControl]=\"searchInput\"\n [attr.placeholder]=\"placeholder() ? (placeholder() | translate) : null\"\n [attr.readonly]=\"isReadonly() ? 'readonly' : null\"\n role=\"combobox\"\n aria-autocomplete=\"list\"\n aria-haspopup=\"listbox\"\n [attr.aria-expanded]=\"isOpen()\"\n [attr.aria-controls]=\"listboxId()\"\n [attr.aria-activedescendant]=\"activeDescendant()\"\n [attr.aria-required]=\"isRequired() ? 'true' : null\"\n [attr.aria-invalid]=\"ariaInvalid() ? 'true' : null\"\n [attr.aria-describedby]=\"ariaDescribedBy()\"\n autocomplete=\"off\"\n (focus)=\"onFocus()\"\n (blur)=\"onBlur()\"\n (keydown)=\"onKeyDown($event)\">\n\n @if (loading()) {\n <div class=\"autocomplete-loader-container d-flex-h\">\n <span class=\"autocomplete-loader spinner-border spinner-border-sm\" aria-hidden=\"true\"></span>\n </div>\n }\n </div>\n\n @if (showListbox()) {\n <ul\n #listboxEl\n class=\"list-unstyled autocomplete-listbox dropdown-menu show\"\n role=\"listbox\"\n [id]=\"listboxId()\"\n [attr.aria-labelledby]=\"resolvedId()\"\n [attr.aria-multiselectable]=\"multiple() ? 'true' : null\"\n (mousedown)=\"$event.preventDefault()\">\n\n @if (multiple()) {\n <!-- Option de listbox : le clavier est gere sur l'input role=\"combobox\"\n (aria-activedescendant + onKeyDown) ; conformement au pattern WAI-ARIA,\n les options ne sont pas focusables et le (click) est un confort souris. -->\n <!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events, @angular-eslint/template/interactive-supports-focus -->\n <li\n role=\"option\"\n [id]=\"masterOptionId()\"\n class=\"autocomplete-option autocomplete-option-master\"\n [class.is-active]=\"activeRow() === MASTER_ROW\"\n [attr.aria-selected]=\"masterState() === 'checked' ? 'true' : 'false'\"\n (mouseenter)=\"onMasterMouseEnter()\"\n (click)=\"onMasterClick()\">\n <input\n #masterCheckbox\n type=\"checkbox\"\n class=\"field-check-input\"\n tabindex=\"-1\"\n aria-hidden=\"true\"\n [checked]=\"masterState() === 'checked'\">\n <span class=\"autocomplete-master-label fs-sm\">\n {{ (masterState() === 'checked'\n ? '_COMMON._ACTION.DESELECT_ALL'\n : '_COMMON._ACTION.SELECT_ALL') | translate }}\n </span>\n </li>\n }\n\n @for (item of items(); track $index; let rowIdx = $index) {\n <!-- Option de listbox : clavier gere sur l'input role=\"combobox\"\n (aria-activedescendant + onKeyDown) ; options non focusables (WAI-ARIA),\n (click) = confort souris. -->\n <!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events, @angular-eslint/template/interactive-supports-focus -->\n <li\n role=\"option\"\n [id]=\"optionId(rowIdx)\"\n class=\"autocomplete-option\"\n [class.is-active]=\"activeRow() === rowIdx\"\n [class.is-disabled]=\"isItemDisabled(item)\"\n [attr.aria-selected]=\"multiple() ? (isItemSelected(item) ? 'true' : 'false') : (activeRow() === rowIdx ? 'true' : null)\"\n [attr.aria-disabled]=\"isItemDisabled(item) ? 'true' : null\"\n (mouseenter)=\"onRowMouseEnter(rowIdx)\"\n (click)=\"onRowClick(rowIdx)\">\n\n @if (multiple()) {\n <input\n type=\"checkbox\"\n class=\"field-check-input\"\n tabindex=\"-1\"\n aria-hidden=\"true\"\n [disabled]=\"isItemDisabled(item)\"\n [checked]=\"isItemSelected(item)\">\n }\n\n <span class=\"autocomplete-option-main fs-sm\" [innerHTML]=\"highlight(getColumnText(item, 0))\"></span>\n\n @for (col of columns(); track col.field; let colIdx = $index) {\n <span class=\"autocomplete-option-additionnal text-muted fs-xs\"\n [innerHTML]=\"highlight(getColumnText(item, colIdx + 1))\"></span>\n }\n </li>\n }\n </ul>\n }\n\n @if (showNoResult()) {\n <div class=\"autocomplete-listbox dropdown-menu show fs-sm px-md\" aria-hidden=\"true\">\n {{ '_COMMON.NO_RESULT' | translate }}\n </div>\n }\n</div>\n\n <!-- Les chips de la multi-s\u00E9lection sont rendus par le parent cw-form-field (hors field-group),\n \u00E0 partir de `chips()` + `onChipRemove()`. Voir form-field.component.html. -->\n\n <!-- Live region pour annonces lecteur d'\u00E9cran -->\n <div\n [id]=\"liveId()\"\n class=\"visually-hidden\"\n role=\"status\"\n aria-live=\"polite\"\n aria-atomic=\"true\">\n @if (liveMessageKey(); as key) {\n {{ key | translate: { total: items().length } }}\n }\n </div>\n", styles: [":host{display:block;width:100%}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i2$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2$1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "ngmodule", type: TranslateModule }, { kind: "directive", type: ClickOutsideDirective, selector: "[clickOutside]", outputs: ["clickOutside"] }, { kind: "pipe", type: i2.TranslatePipe, name: "translate" }] }); }
2716
2698
  }
2717
2699
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: AutocompleteComponent, decorators: [{
2718
2700
  type: Component,
@@ -2721,9 +2703,359 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.20", ngImpo
2721
2703
  ReactiveFormsModule,
2722
2704
  TranslateModule,
2723
2705
  ClickOutsideDirective
2724
- ], template: "<div\n class=\"autocomplete-wrapper\"\n (clickOutside)=\"onClickOutside()\">\n\n <div class=\"field-group\">\n <input\n type=\"text\"\n class=\"field-control autocomplete-input\"\n [class.has-value]=\"hasAnyContent()\"\n [id]=\"resolvedId()\"\n [formControl]=\"searchInput\"\n [attr.placeholder]=\"placeholder() ? (placeholder() | translate) : null\"\n [attr.readonly]=\"isReadonly() ? 'readonly' : null\"\n role=\"combobox\"\n aria-autocomplete=\"list\"\n aria-haspopup=\"listbox\"\n [attr.aria-expanded]=\"isOpen()\"\n [attr.aria-controls]=\"listboxId()\"\n [attr.aria-activedescendant]=\"activeDescendant()\"\n [attr.aria-required]=\"isRequired() ? 'true' : null\"\n [attr.aria-invalid]=\"ariaInvalid() ? 'true' : null\"\n [attr.aria-describedby]=\"ariaDescribedBy()\"\n autocomplete=\"off\"\n (focus)=\"onFocus()\"\n (blur)=\"onBlur()\"\n (keydown)=\"onKeyDown($event)\">\n\n @if (loading()) {\n <div class=\"autocomplete-loader-container d-flex-h\">\n <span class=\"autocomplete-loader spinner-border spinner-border-sm\" aria-hidden=\"true\"></span>\n </div>\n }\n </div>\n\n @if (showListbox()) {\n <ul\n #listboxEl\n class=\"list-unstyled autocomplete-listbox dropdown-menu show\"\n role=\"listbox\"\n [id]=\"listboxId()\"\n [attr.aria-labelledby]=\"resolvedId()\"\n [attr.aria-multiselectable]=\"multiple() ? 'true' : null\"\n (mousedown)=\"$event.preventDefault()\">\n\n @if (multiple()) {\n <li\n role=\"option\"\n [id]=\"masterOptionId()\"\n class=\"autocomplete-option autocomplete-option-master\"\n [class.is-active]=\"activeRow() === MASTER_ROW\"\n [attr.aria-selected]=\"masterState() === 'checked' ? 'true' : 'false'\"\n (mouseenter)=\"onMasterMouseEnter()\"\n (click)=\"onMasterClick()\">\n <input\n #masterCheckbox\n type=\"checkbox\"\n class=\"field-check-input\"\n tabindex=\"-1\"\n aria-hidden=\"true\"\n [checked]=\"masterState() === 'checked'\">\n <span class=\"autocomplete-master-label fs-sm\">\n {{ (masterState() === 'checked'\n ? '_COMMON._ACTION.DESELECT_ALL'\n : '_COMMON._ACTION.SELECT_ALL') | translate }}\n </span>\n </li>\n }\n\n @for (item of items(); track $index; let rowIdx = $index) {\n <li\n role=\"option\"\n [id]=\"optionId(rowIdx)\"\n class=\"autocomplete-option\"\n [class.is-active]=\"activeRow() === rowIdx\"\n [class.is-disabled]=\"isItemDisabled(item)\"\n [attr.aria-selected]=\"multiple() ? (isItemSelected(item) ? 'true' : 'false') : (activeRow() === rowIdx ? 'true' : null)\"\n [attr.aria-disabled]=\"isItemDisabled(item) ? 'true' : null\"\n (mouseenter)=\"onRowMouseEnter(rowIdx)\"\n (click)=\"onRowClick(rowIdx)\">\n\n @if (multiple()) {\n <input\n type=\"checkbox\"\n class=\"field-check-input\"\n tabindex=\"-1\"\n aria-hidden=\"true\"\n [disabled]=\"isItemDisabled(item)\"\n [checked]=\"isItemSelected(item)\">\n }\n\n <span class=\"autocomplete-option-main fs-sm\" [innerHTML]=\"highlight(getColumnText(item, 0))\"></span>\n\n @for (col of columns(); track col.field; let colIdx = $index) {\n <span class=\"autocomplete-option-additionnal text-muted fs-xs\"\n [innerHTML]=\"highlight(getColumnText(item, colIdx + 1))\"></span>\n }\n </li>\n }\n </ul>\n }\n\n @if (showNoResult()) {\n <div class=\"autocomplete-listbox dropdown-menu show fs-sm px-md\" aria-hidden=\"true\">\n {{ '_COMMON.NO_RESULT' | translate }}\n </div>\n }\n</div>\n\n <!-- Les chips de la multi-s\u00E9lection sont rendus par le parent cw-form-field (hors field-group),\n \u00E0 partir de `chips()` + `onChipRemove()`. Voir form-field.component.html. -->\n\n <!-- Live region pour annonces lecteur d'\u00E9cran -->\n <div\n [id]=\"liveId()\"\n class=\"visually-hidden\"\n role=\"status\"\n aria-live=\"polite\"\n aria-atomic=\"true\">\n @if (liveMessageKey(); as key) {\n {{ key | translate: { total: items().length } }}\n }\n </div>\n", styles: [":host{display:block;width:100%}\n"] }]
2706
+ ], template: "<div\n class=\"autocomplete-wrapper\"\n (clickOutside)=\"onClickOutside()\">\n\n <div class=\"field-group\">\n <input\n type=\"text\"\n class=\"field-control autocomplete-input\"\n [class.has-value]=\"hasAnyContent()\"\n [id]=\"resolvedId()\"\n [formControl]=\"searchInput\"\n [attr.placeholder]=\"placeholder() ? (placeholder() | translate) : null\"\n [attr.readonly]=\"isReadonly() ? 'readonly' : null\"\n role=\"combobox\"\n aria-autocomplete=\"list\"\n aria-haspopup=\"listbox\"\n [attr.aria-expanded]=\"isOpen()\"\n [attr.aria-controls]=\"listboxId()\"\n [attr.aria-activedescendant]=\"activeDescendant()\"\n [attr.aria-required]=\"isRequired() ? 'true' : null\"\n [attr.aria-invalid]=\"ariaInvalid() ? 'true' : null\"\n [attr.aria-describedby]=\"ariaDescribedBy()\"\n autocomplete=\"off\"\n (focus)=\"onFocus()\"\n (blur)=\"onBlur()\"\n (keydown)=\"onKeyDown($event)\">\n\n @if (loading()) {\n <div class=\"autocomplete-loader-container d-flex-h\">\n <span class=\"autocomplete-loader spinner-border spinner-border-sm\" aria-hidden=\"true\"></span>\n </div>\n }\n </div>\n\n @if (showListbox()) {\n <ul\n #listboxEl\n class=\"list-unstyled autocomplete-listbox dropdown-menu show\"\n role=\"listbox\"\n [id]=\"listboxId()\"\n [attr.aria-labelledby]=\"resolvedId()\"\n [attr.aria-multiselectable]=\"multiple() ? 'true' : null\"\n (mousedown)=\"$event.preventDefault()\">\n\n @if (multiple()) {\n <!-- Option de listbox : le clavier est gere sur l'input role=\"combobox\"\n (aria-activedescendant + onKeyDown) ; conformement au pattern WAI-ARIA,\n les options ne sont pas focusables et le (click) est un confort souris. -->\n <!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events, @angular-eslint/template/interactive-supports-focus -->\n <li\n role=\"option\"\n [id]=\"masterOptionId()\"\n class=\"autocomplete-option autocomplete-option-master\"\n [class.is-active]=\"activeRow() === MASTER_ROW\"\n [attr.aria-selected]=\"masterState() === 'checked' ? 'true' : 'false'\"\n (mouseenter)=\"onMasterMouseEnter()\"\n (click)=\"onMasterClick()\">\n <input\n #masterCheckbox\n type=\"checkbox\"\n class=\"field-check-input\"\n tabindex=\"-1\"\n aria-hidden=\"true\"\n [checked]=\"masterState() === 'checked'\">\n <span class=\"autocomplete-master-label fs-sm\">\n {{ (masterState() === 'checked'\n ? '_COMMON._ACTION.DESELECT_ALL'\n : '_COMMON._ACTION.SELECT_ALL') | translate }}\n </span>\n </li>\n }\n\n @for (item of items(); track $index; let rowIdx = $index) {\n <!-- Option de listbox : clavier gere sur l'input role=\"combobox\"\n (aria-activedescendant + onKeyDown) ; options non focusables (WAI-ARIA),\n (click) = confort souris. -->\n <!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events, @angular-eslint/template/interactive-supports-focus -->\n <li\n role=\"option\"\n [id]=\"optionId(rowIdx)\"\n class=\"autocomplete-option\"\n [class.is-active]=\"activeRow() === rowIdx\"\n [class.is-disabled]=\"isItemDisabled(item)\"\n [attr.aria-selected]=\"multiple() ? (isItemSelected(item) ? 'true' : 'false') : (activeRow() === rowIdx ? 'true' : null)\"\n [attr.aria-disabled]=\"isItemDisabled(item) ? 'true' : null\"\n (mouseenter)=\"onRowMouseEnter(rowIdx)\"\n (click)=\"onRowClick(rowIdx)\">\n\n @if (multiple()) {\n <input\n type=\"checkbox\"\n class=\"field-check-input\"\n tabindex=\"-1\"\n aria-hidden=\"true\"\n [disabled]=\"isItemDisabled(item)\"\n [checked]=\"isItemSelected(item)\">\n }\n\n <span class=\"autocomplete-option-main fs-sm\" [innerHTML]=\"highlight(getColumnText(item, 0))\"></span>\n\n @for (col of columns(); track col.field; let colIdx = $index) {\n <span class=\"autocomplete-option-additionnal text-muted fs-xs\"\n [innerHTML]=\"highlight(getColumnText(item, colIdx + 1))\"></span>\n }\n </li>\n }\n </ul>\n }\n\n @if (showNoResult()) {\n <div class=\"autocomplete-listbox dropdown-menu show fs-sm px-md\" aria-hidden=\"true\">\n {{ '_COMMON.NO_RESULT' | translate }}\n </div>\n }\n</div>\n\n <!-- Les chips de la multi-s\u00E9lection sont rendus par le parent cw-form-field (hors field-group),\n \u00E0 partir de `chips()` + `onChipRemove()`. Voir form-field.component.html. -->\n\n <!-- Live region pour annonces lecteur d'\u00E9cran -->\n <div\n [id]=\"liveId()\"\n class=\"visually-hidden\"\n role=\"status\"\n aria-live=\"polite\"\n aria-atomic=\"true\">\n @if (liveMessageKey(); as key) {\n {{ key | translate: { total: items().length } }}\n }\n </div>\n", styles: [":host{display:block;width:100%}\n"] }]
2725
2707
  }], ctorParameters: () => [], propDecorators: { control: [{ type: i0.Input, args: [{ isSignal: true, alias: "control", required: true }] }], fetcher: [{ type: i0.Input, args: [{ isSignal: true, alias: "fetcher", required: true }] }], displayField: [{ type: i0.Input, args: [{ isSignal: true, alias: "displayField", required: false }] }], valueField: [{ type: i0.Input, args: [{ isSignal: true, alias: "valueField", required: false }] }], columns: [{ type: i0.Input, args: [{ isSignal: true, alias: "columns", required: false }] }], multiple: [{ type: i0.Input, args: [{ isSignal: true, alias: "multiple", required: false }] }], minChars: [{ type: i0.Input, args: [{ isSignal: true, alias: "minChars", required: false }] }], debounceMs: [{ type: i0.Input, args: [{ isSignal: true, alias: "debounceMs", required: false }] }], selectedItem: [{ type: i0.Input, args: [{ isSignal: true, alias: "selectedItem", required: false }] }], resolver: [{ type: i0.Input, args: [{ isSignal: true, alias: "resolver", required: false }] }], selectedItems: [{ type: i0.Input, args: [{ isSignal: true, alias: "selectedItems", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], id: [{ type: i0.Input, args: [{ isSignal: true, alias: "id", required: false }] }], isRequired: [{ type: i0.Input, args: [{ isSignal: true, alias: "isRequired", required: false }] }], isReadonly: [{ type: i0.Input, args: [{ isSignal: true, alias: "isReadonly", required: false }] }], isDisabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "isDisabled", required: false }] }], ariaInvalid: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaInvalid", required: false }] }], ariaDescribedBy: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaDescribedBy", required: false }] }], itemSelected: [{ type: i0.Output, args: ["itemSelected"] }], itemsChange: [{ type: i0.Output, args: ["itemsChange"] }], listboxEl: [{ type: i0.ViewChild, args: ['listboxEl', { isSignal: true }] }], masterCheckbox: [{ type: i0.ViewChild, args: ['masterCheckbox', { isSignal: true }] }] } });
2726
2708
 
2709
+ /**
2710
+ * Icône du bouton « édition HTML » (preset `expert`), enregistrée dans le registre
2711
+ * d'icônes Quill (global) pour que la toolbar la rende sur le bouton `code-view`.
2712
+ * Utilise `ql-stroke` pour hériter de la couleur des autres icônes de la toolbar.
2713
+ */
2714
+ const quillIcons = Quill.import('ui/icons');
2715
+ quillIcons['code-view'] =
2716
+ '<svg viewBox="0 0 18 18">' +
2717
+ '<polyline class="ql-stroke" points="5 7 3 9 5 11"></polyline>' +
2718
+ '<polyline class="ql-stroke" points="13 7 15 9 13 11"></polyline>' +
2719
+ '<line class="ql-stroke" x1="10" x2="8" y1="5" y2="13"></line>' +
2720
+ '</svg>';
2721
+ /**
2722
+ * Mapping preset → toolbar Quill. Interne au composant : Quill reste un détail
2723
+ * d'implémentation, le consommateur ne manipule que des presets (ou un override
2724
+ * `toolbar` s'il veut sortir du cadre). Contenu provisoire (à affiner avec le DS).
2725
+ */
2726
+ const TOOLBAR_PRESETS = {
2727
+ minimal: [['bold', 'italic'], ['link'], ['clean']],
2728
+ standard: [
2729
+ ['bold', 'italic'],
2730
+ [{ header: 1 }, { header: 2 }],
2731
+ [{ list: 'ordered' }, { list: 'bullet' }],
2732
+ ['link'],
2733
+ ['clean'],
2734
+ ],
2735
+ full: [
2736
+ ['bold', 'italic', 'underline'],
2737
+ [{ header: 1 }, { header: 2 }, { header: 3 }],
2738
+ [{ list: 'ordered' }, { list: 'bullet' }],
2739
+ [{ indent: '-1' }, { indent: '+1' }],
2740
+ ['link'],
2741
+ ['clean'],
2742
+ ],
2743
+ // `expert` = `full` + bouton d'édition HTML (mode source). À réserver aux profils
2744
+ // techniques (le mode source permet de saisir du HTML arbitraire).
2745
+ expert: [
2746
+ ['bold', 'italic', 'underline'],
2747
+ [{ header: 1 }, { header: 2 }, { header: 3 }],
2748
+ [{ list: 'ordered' }, { list: 'bullet' }],
2749
+ [{ indent: '-1' }, { indent: '+1' }],
2750
+ ['link'],
2751
+ ['clean'],
2752
+ ['code-view'],
2753
+ ],
2754
+ };
2755
+ /**
2756
+ * Éditeur de texte riche HTML basé sur Quill 2 (thème « snow »), wrappé maison.
2757
+ *
2758
+ * Composant INTERNE : non exporté du `public-api`, consommé uniquement par
2759
+ * `cw-form-field` via `type=richText`. Il ne réinvente rien du form-field —
2760
+ * il reçoit le `control` parent (comme `cw-autocomplete`) et pilote sa valeur
2761
+ * (HTML), son état `disabled` et son `touched` exactement comme un input natif.
2762
+ *
2763
+ * - Valeur du form : HTML sémantique via `quill.getSemanticHTML()` + normalisation
2764
+ * maison (cf. `serialize()`/`normalizeHtml()`) ; `''` si l'éditeur est vide, pour
2765
+ * que `Validators.required` réponde correctement.
2766
+ * - Collage : toujours sans mise en forme (texte brut), cf. `onPaste`.
2767
+ * - Preset `expert` : ajoute un bouton d'édition HTML (mode source `<textarea>`),
2768
+ * à réserver aux profils techniques.
2769
+ * - Quill : peerDependency (`quill`), CSS `quill.snow.css` importé par le
2770
+ * bundle de styles basic-ui (thème BO).
2771
+ */
2772
+ class RichTextEditorComponent {
2773
+ constructor() {
2774
+ // ---------- Inputs (calqués sur cw-autocomplete) ----------
2775
+ /** FormControl piloté par le parent. Stocke le HTML de l'éditeur. */
2776
+ this.control = input.required(...(ngDevMode ? [{ debugName: "control" }] : []));
2777
+ /** Configuration (toolbar / preset). Défaut : preset `standard`. */
2778
+ this.options = input(...(ngDevMode ? [undefined, { debugName: "options" }] : []));
2779
+ /** Id posé sur la racine éditable (association ARIA côté form-field). */
2780
+ this.id = input('', ...(ngDevMode ? [{ debugName: "id" }] : []));
2781
+ /** Texte d'invite affiché quand l'éditeur est vide (déjà traduit par le form-field). */
2782
+ this.placeholder = input('', ...(ngDevMode ? [{ debugName: "placeholder" }] : []));
2783
+ /** Pose `aria-required` sur la racine éditable. L'astérisque visible relève du parent. */
2784
+ this.isRequired = input(false, ...(ngDevMode ? [{ debugName: "isRequired" }] : []));
2785
+ this.isReadonly = input(false, ...(ngDevMode ? [{ debugName: "isReadonly" }] : []));
2786
+ this.isDisabled = input(false, ...(ngDevMode ? [{ debugName: "isDisabled" }] : []));
2787
+ /** Reflète `aria-invalid` — piloté par le form-field via `control.invalid && control.touched`. */
2788
+ this.ariaInvalid = input(false, ...(ngDevMode ? [{ debugName: "ariaInvalid" }] : []));
2789
+ /** Reflète `aria-describedby` — pointe les blocs erreur/aide du form-field. */
2790
+ this.ariaDescribedBy = input(null, ...(ngDevMode ? [{ debugName: "ariaDescribedBy" }] : []));
2791
+ // ---------- Output ----------
2792
+ /** Émis à chaque édition (HTML courant), en miroir du `valueChange` du form-field. */
2793
+ this.valueChange = output();
2794
+ // ---------- Refs / internals ----------
2795
+ this.editorRef = viewChild.required('editor');
2796
+ this.host = inject(ElementRef);
2797
+ this.destroyRef = inject(DestroyRef);
2798
+ this.zone = inject(NgZone);
2799
+ this.isBrowser = isPlatformBrowser(inject(PLATFORM_ID));
2800
+ this.quill = null;
2801
+ /** Garde anti-boucle : true pendant qu'on répercute une édition vers le control. */
2802
+ this.syncingFromEditor = false;
2803
+ /** Mode « source HTML » actif (preset `expert`) : la zone de texte remplace l'éditeur riche. */
2804
+ this.sourceMode = signal(false, ...(ngDevMode ? [{ debugName: "sourceMode" }] : []));
2805
+ /** Contenu HTML brut affiché/édité en mode source. */
2806
+ this.sourceHtml = signal('', ...(ngDevMode ? [{ debugName: "sourceHtml" }] : []));
2807
+ this.onTextChange = () => {
2808
+ if (!this.quill)
2809
+ return;
2810
+ const html = this.serialize();
2811
+ if (this.control().value === html)
2812
+ return;
2813
+ // Les événements Quill tournent hors zone Angular : on repasse dans la zone
2814
+ // pour que la validité/valeur (et le bloc d'erreur du form-field) se rafraîchissent.
2815
+ this.zone.run(() => {
2816
+ this.syncingFromEditor = true;
2817
+ this.control().setValue(html);
2818
+ this.valueChange.emit(html);
2819
+ this.syncingFromEditor = false;
2820
+ });
2821
+ };
2822
+ /**
2823
+ * Focus/blur du widget (toolbar + éditeur) → états `touched`/`untouched` du control,
2824
+ * comme un input natif du form-field (focus = masque l'erreur pendant la saisie,
2825
+ * blur = réaffiche). On écoute `focusout`/`focusin` sur l'hôte plutôt que le
2826
+ * `selection-change` de Quill : ce dernier n'émet pas de blur fiable quand on quitte
2827
+ * l'éditeur au clavier (Tab). Un `relatedTarget` hors de l'hôte = focus réellement
2828
+ * sorti du widget ; les allers-retours vers la toolbar restent internes (pas de faux
2829
+ * positif). Événements DOM → déjà dans la zone Angular (pas besoin de `zone.run`).
2830
+ */
2831
+ this.onFocusOut = (event) => {
2832
+ const next = event.relatedTarget;
2833
+ if (next && this.host.nativeElement.contains(next))
2834
+ return; // focus resté dans le widget
2835
+ const ctrl = this.control();
2836
+ if (!ctrl.touched)
2837
+ ctrl.markAsTouched();
2838
+ };
2839
+ this.onFocusIn = (event) => {
2840
+ const prev = event.relatedTarget;
2841
+ if (prev && this.host.nativeElement.contains(prev))
2842
+ return; // focus venait déjà du widget
2843
+ const ctrl = this.control();
2844
+ if (ctrl.touched)
2845
+ ctrl.markAsUntouched();
2846
+ };
2847
+ /**
2848
+ * Collage sans mise en forme (équivalent Ctrl+Shift+V), systématique : on insère le
2849
+ * `text/plain` du presse-papier, jamais le HTML. Le client recompose sa mise en forme
2850
+ * proprement dans l'éditeur — aucune balise/classe externe (Word, Docs…) n'entre.
2851
+ *
2852
+ * Écouté en phase CAPTURE + `stopImmediatePropagation` pour court-circuiter le listener
2853
+ * `paste` de Quill (attaché en bubble sur `quill.root`) et éviter un double collage.
2854
+ */
2855
+ this.onPaste = (event) => {
2856
+ if (!this.quill || !this.quill.isEnabled())
2857
+ return;
2858
+ event.preventDefault();
2859
+ event.stopImmediatePropagation();
2860
+ const text = event.clipboardData?.getData('text/plain') ?? '';
2861
+ const range = this.quill.getSelection(true);
2862
+ if (!range)
2863
+ return;
2864
+ this.quill.deleteText(range.index, range.length, 'user');
2865
+ this.quill.insertText(range.index, text, 'user');
2866
+ this.quill.setSelection(range.index + text.length, 0, 'silent');
2867
+ };
2868
+ // Réactivité des états après init (l'instance peut ne pas exister au 1er run).
2869
+ effect(() => {
2870
+ const disabled = this.isDisabled() || this.isReadonly();
2871
+ this.quill?.enable(!disabled);
2872
+ });
2873
+ effect(() => {
2874
+ const invalid = this.ariaInvalid();
2875
+ this.quill?.root.setAttribute('aria-invalid', String(invalid));
2876
+ });
2877
+ effect(() => {
2878
+ const describedBy = this.ariaDescribedBy();
2879
+ if (!this.quill)
2880
+ return;
2881
+ if (describedBy)
2882
+ this.quill.root.setAttribute('aria-describedby', describedBy);
2883
+ else
2884
+ this.quill.root.removeAttribute('aria-describedby');
2885
+ });
2886
+ }
2887
+ ngAfterViewInit() {
2888
+ // SSR-safe : Quill manipule le DOM, on n'instancie que côté navigateur.
2889
+ if (!this.isBrowser)
2890
+ return;
2891
+ const opts = this.options();
2892
+ const toolbar = opts?.toolbar ?? TOOLBAR_PRESETS[opts?.preset ?? 'standard'];
2893
+ const config = {
2894
+ theme: 'snow',
2895
+ placeholder: this.placeholder() || undefined,
2896
+ readOnly: this.isDisabled() || this.isReadonly(),
2897
+ modules: {
2898
+ toolbar: {
2899
+ container: toolbar,
2900
+ handlers: {
2901
+ // Indentation réservée aux listes (ul/ol) : hors liste, le bouton est sans effet.
2902
+ // Évite les classes `ql-indent-*` sur des <p> (aucune correspondance CSS côté front).
2903
+ // Le nesting de listes reste géré (getSemanticHTML l'imbrique en <ul>/<ol>).
2904
+ indent(value) {
2905
+ const range = this.quill.getSelection();
2906
+ if (!range)
2907
+ return;
2908
+ const formats = this.quill.getFormat(range);
2909
+ if (formats['list'] == null)
2910
+ return;
2911
+ const current = parseInt(String(formats['indent'] ?? '0'), 10);
2912
+ const modifier = value === '+1' ? 1 : -1;
2913
+ this.quill.format('indent', Math.max(0, current + modifier), 'user');
2914
+ },
2915
+ // Bascule édition HTML (preset `expert`). Arrow → `this` = composant.
2916
+ 'code-view': () => this.toggleSourceMode(),
2917
+ },
2918
+ },
2919
+ },
2920
+ };
2921
+ this.quill = new Quill(this.editorRef().nativeElement, config);
2922
+ // A11y (WCAG 2.1.2, pas de piège clavier) : par défaut Quill capture Tab pour
2923
+ // insérer une tabulation / indenter, ce qui empêche de sortir du champ au clavier.
2924
+ // On retire toutes les liaisons Tab → Tab / Shift+Tab déplacent le focus nativement
2925
+ // (le champ suivant / la toolbar). L'indentation reste accessible via la toolbar.
2926
+ const keyboard = this.quill.getModule('keyboard');
2927
+ if (keyboard?.bindings) {
2928
+ delete keyboard.bindings['Tab'];
2929
+ }
2930
+ // ARIA sur la racine éditable (contenteditable → role textbox implicite).
2931
+ const root = this.quill.root;
2932
+ root.setAttribute('aria-multiline', 'true');
2933
+ if (this.id())
2934
+ root.setAttribute('id', this.id());
2935
+ if (this.isRequired())
2936
+ root.setAttribute('aria-required', 'true');
2937
+ root.setAttribute('aria-invalid', String(this.ariaInvalid()));
2938
+ const describedBy = this.ariaDescribedBy();
2939
+ if (describedBy)
2940
+ root.setAttribute('aria-describedby', describedBy);
2941
+ // Valeur initiale (HTML) → éditeur, sans émettre.
2942
+ const initial = this.control().value;
2943
+ if (typeof initial === 'string' && initial) {
2944
+ this.quill.clipboard.dangerouslyPasteHTML(initial);
2945
+ }
2946
+ this.quill.on('text-change', this.onTextChange);
2947
+ // Focus/blur au niveau widget (toolbar + éditeur) — fiable au clavier (Tab) et à la souris.
2948
+ const host = this.host.nativeElement;
2949
+ const editorRoot = this.quill.root;
2950
+ host.addEventListener('focusout', this.onFocusOut);
2951
+ host.addEventListener('focusin', this.onFocusIn);
2952
+ // Capture = true : passe avant le listener paste de Quill (bubble) pour l'annuler.
2953
+ editorRoot.addEventListener('paste', this.onPaste, true);
2954
+ this.destroyRef.onDestroy(() => {
2955
+ host.removeEventListener('focusout', this.onFocusOut);
2956
+ host.removeEventListener('focusin', this.onFocusIn);
2957
+ editorRoot.removeEventListener('paste', this.onPaste, true);
2958
+ });
2959
+ // Poussées externes de valeur (reset de formulaire, patchValue…) → éditeur.
2960
+ this.control()
2961
+ .valueChanges.pipe(takeUntilDestroyed(this.destroyRef))
2962
+ .subscribe((value) => {
2963
+ // En mode source, la valeur vient de la zone de texte : on ne la reformate pas dans Quill.
2964
+ if (!this.quill || this.syncingFromEditor || this.sourceMode())
2965
+ return;
2966
+ const incoming = typeof value === 'string' && value ? value : '';
2967
+ const current = this.serialize();
2968
+ if (incoming === current)
2969
+ return;
2970
+ if (incoming) {
2971
+ this.quill.clipboard.dangerouslyPasteHTML(incoming);
2972
+ }
2973
+ else {
2974
+ this.quill.setText('');
2975
+ }
2976
+ });
2977
+ }
2978
+ ngOnDestroy() {
2979
+ // Quill 2 n'expose pas de destroy() : on retire nos listeners et on lâche
2980
+ // l'instance (le DOM de l'éditeur est supprimé avec le composant).
2981
+ if (this.quill) {
2982
+ this.quill.off('text-change', this.onTextChange);
2983
+ this.quill = null;
2984
+ }
2985
+ }
2986
+ /**
2987
+ * Bascule entre l'éditeur riche et le mode « source HTML » (bouton du preset `expert`).
2988
+ * - riche → source : la zone de texte reçoit le HTML sémantique courant ;
2989
+ * - source → riche : le HTML source est reparsé par Quill (donc renormalisé/nettoyé),
2990
+ * ce qui met à jour le control via `text-change`.
2991
+ * Réservé aux profils techniques (gabarits d'e-mail…).
2992
+ */
2993
+ toggleSourceMode() {
2994
+ if (!this.quill || this.isDisabled() || this.isReadonly())
2995
+ return;
2996
+ if (this.sourceMode()) {
2997
+ const html = this.sourceHtml();
2998
+ this.sourceMode.set(false);
2999
+ this.quill.setText('');
3000
+ if (html)
3001
+ this.quill.clipboard.dangerouslyPasteHTML(html);
3002
+ }
3003
+ else {
3004
+ this.sourceHtml.set(this.serialize());
3005
+ this.sourceMode.set(true);
3006
+ }
3007
+ }
3008
+ /** Édition en mode source : le HTML brut de la zone de texte devient la valeur du control. */
3009
+ onSourceInput(html) {
3010
+ this.sourceHtml.set(html);
3011
+ this.syncingFromEditor = true;
3012
+ this.control().setValue(html);
3013
+ this.valueChange.emit(html);
3014
+ this.syncingFromEditor = false;
3015
+ }
3016
+ /** True si l'éditeur ne contient aucun texte (Quill garde toujours un `\n` final). */
3017
+ isEditorEmpty() {
3018
+ return !this.quill || this.quill.getText().trim().length === 0;
3019
+ }
3020
+ /**
3021
+ * HTML sémantique et nettoyé de l'éditeur (valeur exposée au FormControl). `''` si vide.
3022
+ *
3023
+ * On part de `quill.getSemanticHTML()` (et NON de `root.innerHTML`) : il produit un HTML
3024
+ * exportable — `<ul>`/`<ol>` corrects, indentation des listes par imbrication, sans les
3025
+ * artefacts d'édition (`data-list`, `span.ql-ui`, classes `ql-indent-*`). On applique
3026
+ * ensuite `normalizeHtml()` pour corriger ses deux travers résiduels.
3027
+ */
3028
+ serialize() {
3029
+ if (!this.quill || this.isEditorEmpty())
3030
+ return '';
3031
+ return this.normalizeHtml(this.quill.getSemanticHTML());
3032
+ }
3033
+ /**
3034
+ * Nettoie le HTML sémantique de Quill pour une consommation front hors contexte Quill :
3035
+ * - `getSemanticHTML()` remplace TOUTES les espaces par `&nbsp;` → on rétablit des espaces
3036
+ * normales (les entités proviennent de Quill, pas du contenu utilisateur qui, lui, est
3037
+ * échappé en `&amp;nbsp;` — donc non impacté) ;
3038
+ * - les paragraphes vides (lignes blanches) `<p></p>` / `<p><br></p>` sont marqués
3039
+ * `role="presentation"` (pas de contenu sémantique, simple espacement voulu par l'auteur).
3040
+ */
3041
+ normalizeHtml(html) {
3042
+ return html
3043
+ .replace(/&nbsp;/g, ' ')
3044
+ .replace(/<p>(?:<br\s*\/?>)?<\/p>/gi, '<p role="presentation"></p>');
3045
+ }
3046
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: RichTextEditorComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
3047
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.20", type: RichTextEditorComponent, isStandalone: true, selector: "cw-rich-text-editor", inputs: { control: { classPropertyName: "control", publicName: "control", isSignal: true, isRequired: true, transformFunction: null }, options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: false, transformFunction: null }, id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, isRequired: { classPropertyName: "isRequired", publicName: "isRequired", isSignal: true, isRequired: false, transformFunction: null }, isReadonly: { classPropertyName: "isReadonly", publicName: "isReadonly", isSignal: true, isRequired: false, transformFunction: null }, isDisabled: { classPropertyName: "isDisabled", publicName: "isDisabled", isSignal: true, isRequired: false, transformFunction: null }, ariaInvalid: { classPropertyName: "ariaInvalid", publicName: "ariaInvalid", isSignal: true, isRequired: false, transformFunction: null }, ariaDescribedBy: { classPropertyName: "ariaDescribedBy", publicName: "ariaDescribedBy", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { valueChange: "valueChange" }, host: { properties: { "class.is-invalid": "ariaInvalid()", "class.is-disabled": "isDisabled() || isReadonly()", "class.is-source-mode": "sourceMode()" }, classAttribute: "cw-rich-text-editor" }, viewQueries: [{ propertyName: "editorRef", first: true, predicate: ["editor"], descendants: true, isSignal: true }], ngImport: i0, template: "<!-- Quill instancie la toolbar (avant) et la zone \u00E9ditable DANS ce conteneur. -->\n<div class=\"rich-text-editor-container\">\n <div #editor [hidden]=\"sourceMode()\"></div>\n\n <!-- Mode \u00AB source HTML \u00BB (preset expert) : \u00E9dition du HTML brut. -->\n @if (sourceMode()) {\n <textarea\n class=\"rich-text-editor-source\"\n spellcheck=\"false\"\n aria-label=\"Code HTML\"\n [value]=\"sourceHtml()\"\n [readonly]=\"isDisabled() || isReadonly()\"\n (input)=\"onSourceInput($any($event.target).value)\"></textarea>\n }\n</div>\n", changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
3048
+ }
3049
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: RichTextEditorComponent, decorators: [{
3050
+ type: Component,
3051
+ args: [{ selector: 'cw-rich-text-editor', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, host: {
3052
+ class: 'cw-rich-text-editor',
3053
+ '[class.is-invalid]': 'ariaInvalid()',
3054
+ '[class.is-disabled]': 'isDisabled() || isReadonly()',
3055
+ '[class.is-source-mode]': 'sourceMode()',
3056
+ }, template: "<!-- Quill instancie la toolbar (avant) et la zone \u00E9ditable DANS ce conteneur. -->\n<div class=\"rich-text-editor-container\">\n <div #editor [hidden]=\"sourceMode()\"></div>\n\n <!-- Mode \u00AB source HTML \u00BB (preset expert) : \u00E9dition du HTML brut. -->\n @if (sourceMode()) {\n <textarea\n class=\"rich-text-editor-source\"\n spellcheck=\"false\"\n aria-label=\"Code HTML\"\n [value]=\"sourceHtml()\"\n [readonly]=\"isDisabled() || isReadonly()\"\n (input)=\"onSourceInput($any($event.target).value)\"></textarea>\n }\n</div>\n" }]
3057
+ }], ctorParameters: () => [], propDecorators: { control: [{ type: i0.Input, args: [{ isSignal: true, alias: "control", required: true }] }], options: [{ type: i0.Input, args: [{ isSignal: true, alias: "options", required: false }] }], id: [{ type: i0.Input, args: [{ isSignal: true, alias: "id", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], isRequired: [{ type: i0.Input, args: [{ isSignal: true, alias: "isRequired", required: false }] }], isReadonly: [{ type: i0.Input, args: [{ isSignal: true, alias: "isReadonly", required: false }] }], isDisabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "isDisabled", required: false }] }], ariaInvalid: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaInvalid", required: false }] }], ariaDescribedBy: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaDescribedBy", required: false }] }], valueChange: [{ type: i0.Output, args: ["valueChange"] }], editorRef: [{ type: i0.ViewChild, args: ['editor', { isSignal: true }] }] } });
3058
+
2727
3059
  function rangeValidator(group, type) {
2728
3060
  const startControl = group.get('start');
2729
3061
  const endControl = group.get('end');
@@ -3555,7 +3887,7 @@ class FormFieldComponent {
3555
3887
  this.formControl.markAsTouched();
3556
3888
  }
3557
3889
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: FormFieldComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
3558
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.20", type: FormFieldComponent, isStandalone: true, selector: "cw-form-field", inputs: { control: { classPropertyName: "control", publicName: "control", isSignal: false, isRequired: false, transformFunction: null }, formGroup: { classPropertyName: "formGroup", publicName: "formGroup", isSignal: false, isRequired: false, transformFunction: null }, type: { classPropertyName: "type", publicName: "type", isSignal: false, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: false, isRequired: false, transformFunction: null }, displayLabel: { classPropertyName: "displayLabel", publicName: "displayLabel", isSignal: false, isRequired: false, transformFunction: null }, name: { classPropertyName: "name", publicName: "name", isSignal: false, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: false, isRequired: false, transformFunction: null }, autocomplete: { classPropertyName: "autocomplete", publicName: "autocomplete", isSignal: false, isRequired: false, transformFunction: null }, options: { classPropertyName: "options", publicName: "options", isSignal: false, isRequired: false, transformFunction: null }, rangeOptions: { classPropertyName: "rangeOptions", publicName: "rangeOptions", isSignal: false, isRequired: false, transformFunction: null }, validationOptions: { classPropertyName: "validationOptions", publicName: "validationOptions", isSignal: false, isRequired: false, transformFunction: null }, autocompleteOptions: { classPropertyName: "autocompleteOptions", publicName: "autocompleteOptions", isSignal: false, isRequired: false, transformFunction: null }, errorMessages: { classPropertyName: "errorMessages", publicName: "errorMessages", isSignal: false, isRequired: false, transformFunction: null }, isRequired: { classPropertyName: "isRequired", publicName: "isRequired", isSignal: false, isRequired: false, transformFunction: null }, help: { classPropertyName: "help", publicName: "help", isSignal: false, isRequired: false, transformFunction: null }, tooltip: { classPropertyName: "tooltip", publicName: "tooltip", isSignal: false, isRequired: false, transformFunction: null }, addonLeft: { classPropertyName: "addonLeft", publicName: "addonLeft", isSignal: false, isRequired: false, transformFunction: null }, addonRight: { classPropertyName: "addonRight", publicName: "addonRight", isSignal: false, isRequired: false, transformFunction: null }, isInAddon: { classPropertyName: "isInAddon", publicName: "isInAddon", isSignal: false, isRequired: false, transformFunction: null }, isReadonly: { classPropertyName: "isReadonly", publicName: "isReadonly", isSignal: false, isRequired: false, transformFunction: null }, isDisabled: { classPropertyName: "isDisabled", publicName: "isDisabled", isSignal: false, isRequired: false, transformFunction: null }, sliderValue: { classPropertyName: "sliderValue", publicName: "sliderValue", isSignal: false, isRequired: false, transformFunction: null }, sliderOptions: { classPropertyName: "sliderOptions", publicName: "sliderOptions", isSignal: false, isRequired: false, transformFunction: null }, cssClass: { classPropertyName: "cssClass", publicName: "cssClass", isSignal: false, isRequired: false, transformFunction: null }, skeletonMode: { classPropertyName: "skeletonMode", publicName: "skeletonMode", isSignal: false, isRequired: false, transformFunction: null }, clearable: { classPropertyName: "clearable", publicName: "clearable", isSignal: false, isRequired: false, transformFunction: null }, appendTo: { classPropertyName: "appendTo", publicName: "appendTo", isSignal: false, isRequired: false, transformFunction: null }, initialCountry: { classPropertyName: "initialCountry", publicName: "initialCountry", isSignal: false, isRequired: false, transformFunction: null }, indeterminate: { classPropertyName: "indeterminate", publicName: "indeterminate", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { refreshEvent: "refreshEvent", textChanged: "textChanged", valueChange: "valueChange", phoneRegionChange: "phoneRegionChange" }, host: { properties: { "class": "this.hostClasses" } }, queries: [{ propertyName: "optionTemplate", first: true, predicate: ["ngOptionTpl"], descendants: true, read: TemplateRef }, { propertyName: "labelTemplate", first: true, predicate: ["ngLabelTpl"], descendants: true, read: TemplateRef }], viewQueries: [{ propertyName: "checkboxInputRef", first: true, predicate: ["checkboxInput"], descendants: true, isSignal: true }, { propertyName: "fileInputRef", first: true, predicate: ["fileInput"], descendants: true, isSignal: true }, { propertyName: "phoneInputRef", first: true, predicate: ["phoneInput"], descendants: true, isSignal: true }, { propertyName: "autocompleteRef", first: true, predicate: AutocompleteComponent, descendants: true, isSignal: true }], usesOnChanges: true, ngImport: i0, template: "@if (!isInAddon) {\r\n @if (\r\n type !== typeField.checkbox &&\r\n type !== typeField.radio &&\r\n type !== typeField.checkboxButton &&\r\n type !== typeField.radioButton &&\r\n type !== typeField.checkboxInline &&\r\n type !== typeField.radioInline &&\r\n type !== typeField.switch &&\r\n type !== typeField.range &&\r\n type !== typeField.switchSmall\r\n ) {\r\n <label [for]=\"name\" class=\"field-label\" [class.visually-hidden]=\"!displayLabel\">\r\n {{ label | translate }}\r\n\r\n @if (isRequired) {\r\n <span class=\"text-danger\">*</span>\r\n }\r\n\r\n @if (tooltip) {\r\n <!-- <button type=\"button\" class=\"btn btn-link btn-popover\" placement=\"bottom\" [ngbPopover]=\"popContent\" container=\"body\"\r\n triggers=\"mouseenter:mouseleave\">\r\n <span class=\"btn-popover-icon bo-icons bo-help\"></span>\r\n </button>\r\n <ng-template #popContent>\r\n <div [innerHTML]=\"tooltip\"></div>\r\n </ng-template> -->\r\n }\r\n </label>\r\n }\r\n\r\n @if (addonLeft || addonRight) {\r\n <div class=\"field-group\" [class.field-group-invalid]=\"isInvalid\" [class.field-group-disabled]=\"isDisabledOrReadonly\">\r\n @if(addonLeft) {\r\n <div class=\"field-group-addon-left\">\r\n <ng-container [ngTemplateOutlet]=\"addonLeft\"></ng-container>\r\n </div>\r\n }\r\n <ng-container [ngTemplateOutlet]=\"field\"></ng-container>\r\n @if(addonRight) {\r\n <div class=\"field-group-addon-right\">\r\n <ng-container [ngTemplateOutlet]=\"addonRight\"></ng-container>\r\n </div>\r\n }\r\n </div>\r\n }\r\n @else {\r\n @if ( isInInputGroup() ) {\r\n <div class=\"field-group\" [class.field-group-invalid]=\"isInvalid\" [class.field-group-disabled]=\"isDisabledOrReadonly\">\r\n <ng-container [ngTemplateOutlet]=\"field\"></ng-container>\r\n </div>\r\n }\r\n @else {\r\n <ng-container [ngTemplateOutlet]=\"field\"></ng-container>\r\n }\r\n }\r\n\r\n <!-- Error message -->\r\n @if (controlOrGroup?.invalid && controlOrGroup?.touched) {\r\n <div class=\"field-invalid\" [id]=\"'error-' + name\">\r\n @if (\r\n !errorMessages?.['required'] &&\r\n ((controlOrGroup?.errors?.['required']) || (getControl('start')?.errors?.['required'] || getControl('end')?.errors?.['required']))\r\n ) {\r\n <span [innerHtml]=\"'_COMMON._FORM.ERROR_IS_MANDATORY' | translate: {label: label | translate}\"></span>\r\n }\r\n @if (!errorMessages?.['rangeInvalid'] && controlOrGroup?.errors?.['rangeInvalid']) {\r\n <span>{{'_COMMON._DATES.ERROR_START_END_PERIOD' | translate}}</span>\r\n }\r\n @if (!errorMessages?.['fileExtension'] && controlOrGroup?.errors?.['fileExtension']) {\r\n <span>{{ '_COMMON._FORM.ERROR_FILE_EXTENSION' | translate: { accept: acceptLabel } }}</span>\r\n }\r\n @if (!errorMessages?.['fileSize'] && controlOrGroup?.errors?.['fileSize']) {\r\n <span>{{ '_COMMON._FORM.ERROR_FILE_SIZE' | translate: { maxSize: maxSizeLabel } }}</span>\r\n }\r\n @if (!errorMessages?.['email'] && controlOrGroup?.errors?.['email']) {\r\n <span>{{ '_COMMON._FORM.ERROR_INVALID_EMAIL' | translate }}</span>\r\n }\r\n @if (!errorMessages?.['phone'] && controlOrGroup?.errors?.['phone']) {\r\n <span>{{ '_COMMON._FORM.ERROR_INVALID_PHONE' | translate }}</span>\r\n }\r\n @if (errorMessages) {\r\n @for (entry of errorMessages | keyvalue: keepOrder; track entry.key) {\r\n @if (controlOrGroup?.errors?.[entry.key]; as errVal) {\r\n <span>{{ entry.value | translate: (errVal === true ? null : errVal) }}</span>\r\n }\r\n }\r\n }\r\n </div>\r\n }\r\n\r\n @if (help || autoHelpEntries.length) {\r\n <div [id]=\"name + '-help'\" class=\"field-text\">\r\n @if (help) {\r\n <span>{{ help | translate }}</span>\r\n }\r\n @for (entry of autoHelpEntries; track entry.key) {\r\n <span>{{ entry.key | translate: entry.params }}</span>\r\n }\r\n </div>\r\n }\r\n\r\n <!-- Chips de la multi-s\u00E9lection (autocomplete) : rendus ici, hors du field-group et apr\u00E8s\r\n erreur/help, pour \u00EAtre visuellement d\u00E9tach\u00E9s du champ. La donn\u00E9e et le retrait restent\r\n port\u00E9s par cw-autocomplete (`chips()` / `onChipRemove()`), seul l'affichage est d\u00E9l\u00E9gu\u00E9. -->\r\n @if (type === typeField.autocompleteMultiple && autocompleteRef()?.chips()?.length) {\r\n <ul class=\"autocomplete-chips\" role=\"list\">\r\n @for (chip of autocompleteRef()!.chips(); track chip.item) {\r\n <li>\r\n <button type=\"button\" class=\"autocomplete-chip\"\r\n [disabled]=\"isEffectivelyDisabled || isReadonly\"\r\n (click)=\"autocompleteRef()!.onChipRemove(chip.item)\">\r\n <span>{{ chip.label }}</span>\r\n @if (!isEffectivelyDisabled && !isReadonly) {\r\n <span aria-hidden=\"true\" class=\"autocomplete-chip-x\">&times;</span>\r\n <span class=\"visually-hidden\">{{ '_COMMON._ACTION.DELETE' | translate }}</span>\r\n }\r\n </button>\r\n </li>\r\n }\r\n </ul>\r\n }\r\n}\r\n@else {\r\n <ng-container [ngTemplateOutlet]=\"field\"></ng-container>\r\n}\r\n\r\n<ng-template #field>\r\n <!-- Autocomplete (mono / multi) -->\r\n @if ((type === typeField.autocomplete || type === typeField.autocompleteMultiple) && autocompleteOptions) {\r\n <cw-autocomplete\r\n [id]=\"name\"\r\n [control]=\"formControl\"\r\n [fetcher]=\"autocompleteOptions.fetcher\"\r\n [displayField]=\"autocompleteOptions.displayField ?? 'label'\"\r\n [valueField]=\"autocompleteOptions.valueField ?? 'id'\"\r\n [columns]=\"autocompleteOptions.columns ?? []\"\r\n [resolver]=\"autocompleteOptions.resolver ?? null\"\r\n [selectedItem]=\"autocompleteOptions.selectedItem ?? null\"\r\n [selectedItems]=\"autocompleteOptions.selectedItems ?? []\"\r\n [minChars]=\"autocompleteOptions.minChars ?? 2\"\r\n [debounceMs]=\"autocompleteOptions.debounceMs ?? 250\"\r\n [multiple]=\"type === typeField.autocompleteMultiple\"\r\n [isRequired]=\"isRequired\"\r\n [isReadonly]=\"!!isReadonly\"\r\n [isDisabled]=\"isEffectivelyDisabled\"\r\n [ariaInvalid]=\"control.invalid && control.touched\"\r\n [ariaDescribedBy]=\"getDescribedBy(control)\"\r\n [placeholder]=\"placeholder\">\r\n </cw-autocomplete>\r\n }\r\n\r\n <!-- Text -->\r\n @if ([typeField.text, typeField.date, typeField.time, typeField.dateTime, typeField.number,\r\n typeField.email,\r\n typeField.color, typeField.zipCode].includes(type)) {\r\n <input [type]=\"type === typeField.zipCode ? 'text' : type\" class=\"field-control\" [id]=\"name\" [formControl]=\"formControl\"\r\n [ngClass]=\"[(cssClass || ''), formControl?.value ? 'has-value' : '', type === typeField.zipCode ? 'field-control-zipcode' : '']\"\r\n [attr.placeholder]=\"placeholder ? (placeholder | translate) : null\" [attr.required]=\"isRequired ? 'required' : null\"\r\n [attr.readonly]=\"isReadonly ? 'readonly' : null\" [attr.aria-required]=\"isRequired\"\r\n [attr.minlength]=\"minLengthAttr\" [attr.maxlength]=\"maxLengthAttr\"\r\n [attr.min]=\"minAttr\" [attr.max]=\"maxAttr\" [attr.step]=\"stepAttr\" [attr.pattern]=\"patternAttr\"\r\n [attr.autocomplete]=\"autocomplete\"\r\n [attr.aria-invalid]=\"control.invalid && control.touched\"\r\n [attr.aria-describedby]=\"getDescribedBy(control)\"\r\n (focus)=\"onFocus()\" (blur)=\"onBlur()\" />\r\n }\r\n\r\n <!-- Phone (intl-tel-input) -->\r\n @if (type === typeField.phone) {\r\n <input #phoneInput type=\"tel\" class=\"field-control\" [id]=\"name\"\r\n [attr.placeholder]=\"placeholder ? (placeholder | translate) : null\" [attr.required]=\"isRequired ? 'required' : null\"\r\n [attr.readonly]=\"isReadonly ? 'readonly' : null\" [disabled]=\"isEffectivelyDisabled\" [attr.aria-required]=\"isRequired\"\r\n [attr.autocomplete]=\"autocomplete\"\r\n [attr.aria-invalid]=\"control.invalid && control.touched\"\r\n [attr.aria-describedby]=\"getDescribedBy(control)\"\r\n (focus)=\"onFocus()\" (blur)=\"onPhoneBlur($event)\" />\r\n }\r\n\r\n <!-- File -->\r\n @if (type === typeField.file) {\r\n <input #fileInput type=\"file\" class=\"field-control\" [id]=\"name\"\r\n [ngClass]=\"[(cssClass || ''), formControl?.value ? 'has-value' : '']\"\r\n [attr.placeholder]=\"placeholder ? (placeholder | translate) : null\" [attr.required]=\"isRequired ? 'required' : null\"\r\n [attr.readonly]=\"isReadonly ? 'readonly' : null\" [disabled]=\"isEffectivelyDisabled\" [attr.aria-required]=\"isRequired\"\r\n [attr.accept]=\"acceptAttr\"\r\n [attr.aria-invalid]=\"control.invalid && control.touched\"\r\n [attr.aria-describedby]=\"getDescribedBy(control)\"\r\n (change)=\"onFileChange($event)\" (focus)=\"onFocus()\" (blur)=\"onBlur()\" />\r\n }\r\n\r\n @if (type === typeField.password) {\r\n <input [type]=\"isPasswordShown ? 'text' : 'password'\" class=\"field-control\" [id]=\"name\" [formControl]=\"formControl\"\r\n [ngClass]=\"[(cssClass || ''), formControl?.value ? 'has-value' : '']\"\r\n [attr.required]=\"isRequired ? 'required' : null\" [attr.readonly]=\"isReadonly ? 'readonly' : null\"\r\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\" [attr.aria-required]=\"isRequired\"\r\n [attr.minlength]=\"minLengthAttr\" [attr.maxlength]=\"maxLengthAttr\" [attr.pattern]=\"patternAttr\"\r\n [attr.autocomplete]=\"autocomplete\"\r\n [attr.aria-invalid]=\"control.invalid && control.touched\"\r\n [attr.aria-describedby]=\"getDescribedBy(control)\"\r\n (focus)=\"onFocus()\" (blur)=\"onBlur()\" />\r\n <cw-button [type]=\"buttonType.ghost\"\r\n cssClass=\"btn-password-field\"\r\n [withIcon]=\"isPasswordShown ? spriteIcon.toolbarHidePassword : spriteIcon.toolbarShowPassword\"\r\n [withOnlyIcon]=\"true\"\r\n [label]=\"isPasswordShown ? '_COMMON._FORM._SHOW_HIDE_PWD.HIDE' : '_COMMON._FORM._SHOW_HIDE_PWD.SHOW'\"\r\n (btnAction)=\"togglePasswordVisibility()\">\r\n </cw-button>\r\n }\r\n\r\n <!-- Textarea -->\r\n @if (type === typeField.textarea) {\r\n <textarea class=\"field-control\" [id]=\"name\" [formControl]=\"formControl\"\r\n [ngClass]=\"[(cssClass || ''), formControl?.value ? 'has-value' : '']\"\r\n [attr.placeholder]=\"placeholder ? (placeholder | translate) : null\" [attr.required]=\"isRequired ? 'required' : null\"\r\n [attr.readonly]=\"isReadonly ? 'readonly' : null\" [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\"\r\n [attr.aria-required]=\"isRequired\" [attr.aria-invalid]=\"control.invalid && control.touched\"\r\n [attr.minlength]=\"minLengthAttr\" [attr.maxlength]=\"maxLengthAttr\" [attr.pattern]=\"patternAttr\"\r\n [attr.autocomplete]=\"autocomplete\"\r\n [attr.aria-describedby]=\"getDescribedBy(control)\"\r\n (focus)=\"onFocus()\" (blur)=\"onBlur()\"></textarea>\r\n }\r\n\r\n <!-- Select -->\r\n @if (type === typeField.select) {\r\n <ng-select [formControl]=\"formControl\" [items]=\"options\" bindLabel=\"label\" [labelForId]=\"name\" [appendTo]=\"appendTo\" bindValue=\"value\"\r\n [ngClass]=\"cssClass\" [searchable]=\"false\" [placeholder]=\"placeholder ? (placeholder | translate) : null\" [readonly]=\"isReadonly\" [clearable]=\"false\"\r\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\" [attr.required]=\"isRequired ? 'required' : null\"\r\n [attr.aria-required]=\"isRequired\" [attr.aria-invalid]=\"control.invalid && control.touched\"\r\n [attr.aria-describedby]=\"getDescribedBy(control)\" [attr.id]=\"name\"\r\n (focus)=\"onFocus()\" (blur)=\"onBlur()\">\r\n\r\n <!-- Template pour les options -->\r\n <ng-template ng-option-tmp let-item=\"item\" let-index=\"index\" let-search=\"searchTerm\">\r\n @if (optionTemplate) {\r\n <ng-container *ngTemplateOutlet=\"optionTemplate; context: { item: item | translate, index: index, searchTerm: search }\"></ng-container>\r\n }\r\n @else {\r\n <div>{{ item.label | translate }}</div>\r\n }\r\n </ng-template>\r\n\r\n <!-- Template pour le label -->\r\n <ng-template ng-label-tmp let-item=\"item\">\r\n @if (labelTemplate) {\r\n <ng-container *ngTemplateOutlet=\"labelTemplate; context: { item: item | translate }\"></ng-container>\r\n }\r\n @else {\r\n {{ (item.label | translate) || (placeholder | translate) }}\r\n }\r\n </ng-template>\r\n </ng-select>\r\n }\r\n\r\n <!-- NgSelect -->\r\n @if (type === typeField.ngSelect || type === typeField.ngSelectMultiple) {\r\n <ng-select [formControl]=\"formControl\" [items]=\"options\" bindLabel=\"label\" [labelForId]=\"name\" [appendTo]=\"appendTo\" bindValue=\"value\"\r\n [multiple]=\"type === typeField.ngSelectMultiple\" [ngClass]=\"cssClass\" [clearable]=\"false\"\r\n [placeholder]=\"placeholder ? (placeholder | translate) : null\" [readonly]=\"isReadonly\"\r\n [notFoundText]=\"'_COMMON.NO_RESULT' | translate\" [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\"\r\n [attr.required]=\"isRequired ? 'required' : null\" [attr.aria-required]=\"isRequired\"\r\n [attr.aria-invalid]=\"control.invalid && control.touched\"\r\n [attr.aria-describedby]=\"getDescribedBy(control)\" [attr.id]=\"name\"\r\n (focus)=\"onFocus()\" (blur)=\"onBlur()\" (search)=\"textChanged.emit($event?.term)\">\r\n\r\n <!-- Template pour les options -->\r\n <ng-template ng-option-tmp let-item=\"item\" let-index=\"index\" let-search=\"searchTerm\">\r\n @if (optionTemplate) {\r\n <ng-container *ngTemplateOutlet=\"optionTemplate; context: { item: item, index: index, searchTerm: search }\"></ng-container>\r\n }\r\n @else {\r\n <div>{{ item.label | translate }}</div>\r\n }\r\n </ng-template>\r\n\r\n <!-- Template pour le label -->\r\n <ng-template ng-label-tmp let-item=\"item\" let-clear=\"clear\">\r\n <span class=\"ng-value-icon left\" (click)=\"clear(item)\" aria-hidden=\"true\">\u00D7</span>\r\n @if (labelTemplate) {\r\n <ng-container *ngTemplateOutlet=\"labelTemplate; context: { item: item | translate }\"></ng-container>\r\n }\r\n @else {\r\n {{ (item.label | translate) || (placeholder | translate) }}\r\n }\r\n </ng-template>\r\n </ng-select>\r\n }\r\n\r\n <!-- Radio -->\r\n @if (type === typeField.radioInline || type === typeField.radio) {\r\n <fieldset\r\n [attr.aria-required]=\"isRequired\"\r\n [attr.aria-invalid]=\"control.invalid && control.touched\"\r\n [attr.aria-describedby]=\"getDescribedBy(control)\">\r\n <legend class=\"field-label\" [class.visually-hidden]=\"!displayLabel\">\r\n {{label | translate}}\r\n @if(isRequired) {\r\n <span class=\"text-danger\">*</span>\r\n }\r\n </legend>\r\n <ul class=\"list-unstyled mb-none\" [ngClass]=\"type === typeField.radioInline ? 'd-flex-h gap-md flex-wrap' : 'd-flex-v'\">\r\n @for (opt of options; track opt.value) {\r\n <li class=\"field-check\">\r\n <input type=\"radio\" [id]=\"name + '_' + opt.value\" [value]=\"opt.value\" [formControl]=\"formControl\"\r\n class=\"field-check-input\" [attr.disabled]=\"(isEffectivelyDisabled || opt.disabled) ? 'disabled' : null\" (change)=\"onRadioChange(opt.value)\" />\r\n <label [for]=\"name + '_' + opt.value\" class=\"field-check-label\">{{ opt.label | translate }}</label>\r\n </li>\r\n }\r\n </ul>\r\n </fieldset>\r\n }\r\n\r\n <!-- Radio button -->\r\n @if (type === typeField.radioButton) {\r\n <fieldset\r\n [attr.aria-required]=\"isRequired\"\r\n [attr.aria-invalid]=\"control.invalid && control.touched\"\r\n [attr.aria-describedby]=\"getDescribedBy(control)\">\r\n <legend class=\"field-label\" [class.visually-hidden]=\"!displayLabel\">\r\n {{label | translate}}\r\n @if(isRequired) {\r\n <span class=\"text-danger\">*</span>\r\n }\r\n </legend>\r\n <div class=\"field-group field-group-btn\">\r\n @for (opt of options; track opt.value) {\r\n <input type=\"radio\" [id]=\"name + '_' + opt.value\" [value]=\"opt.value\" [formControl]=\"formControl\"\r\n class=\"visually-hidden\" [attr.disabled]=\"(isEffectivelyDisabled || opt.disabled) ? 'disabled' : null\" (change)=\"onRadioChange(opt.value)\"/>\r\n <label [for]=\"name + '_' + opt.value\" class=\"btn btn-field-group\">{{ opt.label | translate }}</label>\r\n }\r\n </div>\r\n </fieldset>\r\n }\r\n\r\n <!-- Checkbox Switch -->\r\n @if ( type === typeField.switch || type === typeField.switchSmall)\r\n {\r\n <div class=\"field-check field-switch\" [ngClass]=\"{'field-switch-small': type === typeField.switchSmall}\">\r\n <input type=\"checkbox\" [id]=\"name\" [formControl]=\"formControl\" class=\"field-check-input\" [attr.aria-required]=\"isRequired\"\r\n [attr.aria-invalid]=\"control.invalid && control.touched\"\r\n [attr.aria-describedby]=\"getDescribedBy(control)\"\r\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\"/>\r\n <label [for]=\"name\" class=\"field-check-label\">{{ label | translate }}</label>\r\n </div>\r\n }\r\n\r\n <!-- Checkbox -->\r\n @if (type === typeField.checkboxInline || type === typeField.checkbox) {\r\n @if (isSingleCheckbox()) {\r\n <div class=\"field-check\" [class.field-check-inline]=\"type === typeField.checkboxInline\">\r\n <input #checkboxInput type=\"checkbox\" [id]=\"name\" [formControl]=\"formControl\"\r\n class=\"field-check-input\"\r\n [class.is-invalid]=\"control?.invalid && control?.touched\"\r\n [attr.aria-required]=\"isRequired\"\r\n [attr.aria-invalid]=\"control?.invalid && control?.touched\"\r\n [attr.aria-describedby]=\"getDescribedBy(control)\"\r\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\" />\r\n <label [for]=\"name\" class=\"field-check-label\">\r\n {{ label | translate }}\r\n @if (isRequired) {\r\n <span class=\"text-danger\">*</span>\r\n }\r\n </label>\r\n </div>\r\n }\r\n @else if( options.length > 1) {\r\n <fieldset\r\n [attr.aria-required]=\"isRequired\"\r\n [attr.aria-invalid]=\"control.invalid && control.touched\"\r\n [attr.aria-describedby]=\"getDescribedBy(control)\"\r\n [ngClass]=\"{ 'flex-column': type === typeField.checkbox }\">\r\n <legend class=\"field-label\" [class.visually-hidden]=\"!displayLabel\">\r\n {{label | translate}}\r\n @if(isRequired) {\r\n <span class=\"text-danger\">*</span>\r\n }\r\n </legend>\r\n <ul class=\"list-unstyled mb-none\" [ngClass]=\"type === typeField.checkboxInline ? 'd-flex-h gap-md' : 'd-flex-v'\">\r\n @for (opt of options; track opt.value) {\r\n <li class=\"field-check\" [ngClass]=\"{ 'field-check-inline': type === typeField.checkboxInline }\">\r\n <input type=\"checkbox\" [id]=\"name + '_' + opt.value\" [value]=\"opt.value\" (change)=\"onCheckboxChange($event)\"\r\n [checked]=\"control.value?.includes(opt.value)\" class=\"field-check-input\"\r\n [attr.disabled]=\"(isEffectivelyDisabled || opt.disabled) ? 'disabled' : null\" />\r\n <label [for]=\"name + '_' + opt.value\" class=\"field-check-label\">\r\n {{ opt.label | translate }}\r\n </label>\r\n </li>\r\n }\r\n </ul>\r\n </fieldset>\r\n }\r\n @else {\r\n <fieldset>\r\n <legend class=\"field-label\" [class.visually-hidden]=\"!displayLabel\">\r\n {{label | translate}}\r\n </legend>\r\n <ul class=\"list-unstyled mb-none\" [ngClass]=\"type === typeField.checkboxInline ? 'd-flex-h gap-md' : 'd-flex-v'\">\r\n @for (opt of options; track opt.value) {\r\n <li class=\"field-check\" [ngClass]=\"{ 'field-check-inline': type === typeField.checkboxInline }\">\r\n <input type=\"checkbox\" [id]=\"name + '_' + opt.value\" [value]=\"opt.value\" (change)=\"onCheckboxChange($event)\"\r\n [checked]=\"control.value?.includes(opt.value)\" class=\"field-check-input\"\r\n [attr.aria-required]=\"isRequired\"\r\n [attr.aria-invalid]=\"control.invalid && control.touched\"\r\n [attr.aria-describedby]=\"getDescribedBy(control)\"\r\n [attr.disabled]=\"(isEffectivelyDisabled || opt.disabled) ? 'disabled' : null\" />\r\n <label [for]=\"name + '_' + opt.value\" class=\"field-check-label\">\r\n {{ opt.label | translate }}\r\n @if(isRequired) {\r\n <span class=\"text-danger\">*</span>\r\n }\r\n </label>\r\n </li>\r\n }\r\n </ul>\r\n </fieldset>\r\n }\r\n }\r\n\r\n <!-- Checkbox button -->\r\n @if (type === typeField.checkboxButton && options.length > 0) {\r\n\r\n @if(options.length > 1) {\r\n <fieldset\r\n [attr.aria-required]=\"isRequired\"\r\n [attr.aria-invalid]=\"control.invalid && control.touched\"\r\n [attr.aria-describedby]=\"getDescribedBy(control)\">\r\n <legend class=\"field-label\" [class.visually-hidden]=\"!displayLabel\">\r\n {{label | translate}}\r\n @if(isRequired) {\r\n <span class=\"text-danger\">*</span>\r\n }\r\n </legend>\r\n <div class=\"field-group field-group-btn\">\r\n @for (opt of options; track opt.value) {\r\n <input type=\"checkbox\" [id]=\"name + '_' + opt.value\" [value]=\"opt.value\" (change)=\"onCheckboxChange($event)\"\r\n [checked]=\"control.value?.includes(opt.value)\" class=\"visually-hidden\"\r\n [attr.disabled]=\"(isEffectivelyDisabled || opt.disabled) ? 'disabled' : null\" />\r\n <label [for]=\"name + '_' + opt.value\" class=\"btn btn-field-group\">{{ opt.label | translate }}</label>\r\n }\r\n </div>\r\n </fieldset>\r\n }\r\n @else {\r\n <fieldset>\r\n <legend class=\"field-label\" [class.visually-hidden]=\"!displayLabel\">\r\n {{label | translate}}\r\n </legend>\r\n <div class=\"btn-group btn-group-secondary\">\r\n @for (opt of options; track opt.value) {\r\n <input type=\"checkbox\" [id]=\"name + '_' + opt.value\" [value]=\"opt.value\" (change)=\"onCheckboxChange($event)\"\r\n [checked]=\"control.value?.includes(opt.value)\" class=\"visually-hidden\"\r\n [attr.aria-required]=\"isRequired\"\r\n [attr.aria-invalid]=\"control.invalid && control.touched\"\r\n [attr.aria-describedby]=\"getDescribedBy(control)\"\r\n [attr.disabled]=\"(isEffectivelyDisabled || opt.disabled) ? 'disabled' : null\"/>\r\n <label [for]=\"name + '_' + opt.value\" class=\"btn btn-field-group\">\r\n {{ opt.label | translate}}\r\n @if(isRequired) {\r\n <span class=\"text-danger\">*</span>\r\n }\r\n </label>\r\n }\r\n </div>\r\n </fieldset>\r\n }\r\n }\r\n\r\n <!-- Period - DateToDate / TimeToTime / DateTimeToDateTime -->\r\n @if ([typeField.dateToDate, typeField.timeToTime, typeField.dateTimeToDateTime].includes(type) && isRange) {\r\n\r\n <div class=\"field-group\">\r\n <div class=\"field-group-addon-left\">Du</div>\r\n <input [type]=\"getInputType()\" class=\"field-control\" [id]=\"name + '_start'\" [formControl]=\"getControl('start')\"\r\n [attr.placeholder]=\"type === typeField.timeToTime ? ('_COMMON._DATES.FROM' | translate) : ('_COMMON._DATES.FROM_TO_1' | translate)\"\r\n [ngClass]=\"[(cssClass || ''), getControl('start')?.value ? 'has-value' : '']\"\r\n [attr.required]=\"isRequired ? 'required' : null\" [attr.readonly]=\"isReadonly ? 'readonly' : null\"\r\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\" [attr.aria-required]=\"isRequired\"\r\n [attr.min]=\"minStartAttr\" [attr.max]=\"maxStartAttr\" [attr.step]=\"stepAttr\"\r\n [attr.autocomplete]=\"autocomplete\"\r\n [attr.aria-invalid]=\"getControl('start')?.invalid && getControl('start')?.touched\"\r\n [attr.aria-describedby]=\"getDescribedBy(getControl('start'))\"\r\n (focus)=\"onFocusRange('start')\" />\r\n\r\n @if(getControl('start')?.value && !isDisabledOrReadonly) {\r\n <button type=\"button\" class=\"btn btn-secondary btn-clear-field\"\r\n (click)=\"onClearFieldPeriod('start')\">\r\n &times;\r\n </button>\r\n }\r\n <div class=\"field-group-addon-center\">au</div>\r\n <input [type]=\"getInputType()\" class=\"field-control\" [id]=\"name + '_end'\" [formControl]=\"getControl('end')\"\r\n [attr.placeholder]=\"type === typeField.timeToTime ? ('_COMMON._DATES.TO' | translate) : ('_COMMON._DATES.FROM_TO_2' | translate)\"\r\n [ngClass]=\"[(cssClass || ''), getControl('end')?.value ? 'has-value' : '']\"\r\n [attr.required]=\"isRequired ? 'required' : null\" [attr.readonly]=\"isReadonly ? 'readonly' : null\"\r\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\"\r\n [attr.min]=\"minEndAttr\" [attr.max]=\"maxEndAttr\" [attr.step]=\"stepAttr\"\r\n [attr.autocomplete]=\"autocomplete\"\r\n [attr.aria-invalid]=\"getControl('end')?.invalid && getControl('end')?.touched\"\r\n [attr.aria-describedby]=\"getDescribedBy(getControl('end'))\"\r\n (focus)=\"onFocusRange('end')\" />\r\n\r\n @if(getControl('end')?.value && !isDisabledOrReadonly) {\r\n <button type=\"button\" class=\"btn btn-ghost btn-clear-field\"\r\n (click)=\"onClearFieldPeriod('end')\">\r\n &times;\r\n </button>\r\n }\r\n </div>\r\n }\r\n\r\n @if ([typeField.datePlusOne, typeField.datePlusTwo, typeField.datePlusSeven, typeField.dateComplexe].includes(type)) {\r\n\r\n <div class=\"field-group\">\r\n @if (type === typeField.dateComplexe) {\r\n <div class=\"field-group-addon-left\">\r\n <button class=\"btn btn-ghost\" type=\"button\" (click)=\"onDateAddDay('prev')\"\r\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\">\r\n <cw-icon font=\"optyweb\" [icon]=\"spriteIcon.nextLeft\" [label]=\"'Jour pr\u00E9c\u00E9dent'\"></cw-icon>\r\n </button>\r\n </div>\r\n }\r\n\r\n <input type=\"date\" class=\"field-control\" [id]=\"name\" [formControl]=\"formControl\"\r\n [ngClass]=\"[(cssClass || ''), formControl?.value ? 'has-value' : '']\"\r\n [attr.placeholder]=\"placeholder ? placeholder : null\" [attr.required]=\"isRequired ? 'required' : null\"\r\n [attr.readonly]=\"isReadonly ? 'readonly' : null\" [attr.aria-required]=\"isRequired\"\r\n [attr.min]=\"minAttr\" [attr.max]=\"maxAttr\" [attr.step]=\"stepAttr\"\r\n [attr.autocomplete]=\"autocomplete\"\r\n [attr.aria-invalid]=\"control.invalid && control.touched\"\r\n [attr.aria-describedby]=\"getDescribedBy(control)\"\r\n (focus)=\"onFocus()\" (blur)=\"onBlur()\" />\r\n\r\n @if(formControl?.value && !isDisabledOrReadonly) {\r\n <button class=\"btn btn-ghost btn-clear-field\" type=\"button\"\r\n (click)=\"onClearField(formControl)\">&times;</button>\r\n }\r\n\r\n\r\n @if (type === typeField.dateComplexe) {\r\n <div class=\"field-group-addon-right\">\r\n <button class=\"btn btn-ghost\" type=\"button\" (click)=\"onDateAddDay('next')\"\r\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\">\r\n <cw-icon font=\"optyweb\" [icon]=\"spriteIcon.nextRight\" [label]=\"'Jour suivant'\"></cw-icon>\r\n </button>\r\n </div>\r\n <div class=\"field-group-addon-right\">\r\n <button class=\"btn btn-ghost\" type=\"button\" (click)=\"onRefresh()\"\r\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\">\r\n <cw-icon font=\"optyweb\" [icon]=\"spriteIcon.toolbarRefresh\" [label]=\"'Rafra\u00EEchir'\"></cw-icon>\r\n </button>\r\n </div>\r\n }\r\n\r\n <div class=\"field-group-addon-right\">\r\n <button class=\"btn btn-ghost\" type=\"button\" (click)=\"onTodayAddDay(0)\"\r\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\">\r\n J\r\n <span class=\"visually-hidden\">Aujourd'hui</span>\r\n </button>\r\n </div>\r\n <div class=\"field-group-addon-right\">\r\n <button class=\"btn btn-ghost\" type=\"button\" (click)=\"onTodayAddDay(1)\"\r\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\">\r\n J+1\r\n <span class=\"visually-hidden\">Demain</span>\r\n </button>\r\n </div>\r\n\r\n @if (type !== typeField.datePlusOne && type !== typeField.dateComplexe) {\r\n <div class=\"field-group-addon-right\">\r\n <button class=\"btn btn-ghost \" type=\"button\" (click)=\"onTodayAddDay(2)\"\r\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\">\r\n J+2\r\n <span class=\"visually-hidden\">Dans 2 jours</span>\r\n </button>\r\n </div>\r\n\r\n @if (type !== typeField.datePlusTwo) {\r\n <div class=\"field-group-addon-right\">\r\n <button class=\"btn btn-ghost\" type=\"button\" (click)=\"onTodayAddDay(7)\"\r\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\">\r\n J+7\r\n <span class=\"visually-hidden\">Dans 7 jours</span>\r\n </button>\r\n </div>\r\n }\r\n }\r\n </div>\r\n }\r\n\r\n @if (type === typeField.slider) {\r\n <ngx-slider [(value)]=\"sliderValue\" [options]=\"sliderOptions\" [formControl]=\"formControl\"></ngx-slider>\r\n }\r\n\r\n @if (type === typeField.range) {\r\n <div class=\"slider\">\r\n\r\n <cw-button [isDisabled]=\"formControl.value <= rangeOptions.floor\" [label]=\"'Diminuer ' + formControl.value + ' ' + label\"\r\n [withIcon]=\"spriteIcon.toolbarMinus\" [withOnlyIcon]=\"true\" [type]=\"buttonType.primary\"\r\n [iconSize]=\"buttonIconSize.small\" (btnAction)=\"onRangeStep('decrease')\">\r\n </cw-button>\r\n\r\n <div class=\"slider-input\">\r\n <label [for]=\"name\" class=\"slider-tooltip\" [style.left]=\"getRangePercent() + '%'\" aria-live=\"polite\"\r\n aria-atomic=\"true\">\r\n {{ label | translate }} {{ formControl.value }}\r\n @if (rangeOptions.unit) {\r\n <abbr [title]=\"rangeOptions.unit\">{{ rangeOptions.unit }}</abbr>\r\n }\r\n </label>\r\n\r\n <div class=\"slider-custom-bar\">\r\n <div class=\"slider-custom-bar-selection\" [style.width]=\"getRangePercent() + '%'\">\r\n </div>\r\n </div>\r\n\r\n <input type=\"range\" [id]=\"name\" [formControl]=\"formControl\" [min]=\"rangeOptions.floor\" [max]=\"rangeOptions.ceil\"\r\n [step]=\"rangeOptions.step || 1\" class=\"field-control-range\" [attr.aria-required]=\"isRequired\"\r\n [attr.aria-invalid]=\"control.invalid && control.touched\">\r\n </div>\r\n\r\n <cw-button [isDisabled]=\"formControl.value >= rangeOptions.ceil\" [label]=\"'Augmenter ' + formControl.value + ' ' + label\"\r\n [withIcon]=\"spriteIcon.toolbarPlus\" [withOnlyIcon]=\"true\" [type]=\"buttonType.primary\"\r\n [iconSize]=\"buttonIconSize.small\" (btnAction)=\"onRangeStep('increase')\">\r\n </cw-button>\r\n </div>\r\n }\r\n\r\n @if (isInInputGroup() && clearable && !isDisabledOrReadonly && type !== typeField.autocompleteMultiple) {\r\n @if (type === typeField.autocomplete) {\r\n @if (autocompleteRef()?.hasAnyContent()) {\r\n <button class=\"btn btn-secondary btn-clear-field\" type=\"button\"\r\n (click)=\"onClearAutocomplete()\">&times;</button>\r\n }\r\n } @else if (type === typeField.ngSelectMultiple) {\r\n <!-- value est un tableau : un [] vide \u00E9tant truthy, on teste .length pour n'afficher le clear global que s'il y a au moins une s\u00E9lection. -->\r\n @if (formControl?.value?.length) {\r\n <button class=\"btn btn-ghost btn-clear-field\" type=\"button\"\r\n (click)=\"onClearField(formControl)\">&times;</button>\r\n }\r\n } @else {\r\n @if(formControl?.value) {\r\n <button class=\"btn btn-ghost btn-clear-field\" type=\"button\"\r\n (click)=\"onClearField(formControl)\">&times;</button>\r\n }\r\n }\r\n }\r\n\r\n</ng-template>\r\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "ngmodule", type: TranslateModule }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i2$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2$1.RangeValueAccessor, selector: "input[type=range][formControlName],input[type=range][formControl],input[type=range][ngModel]" }, { kind: "directive", type: i2$1.CheckboxControlValueAccessor, selector: "input[type=checkbox][formControlName],input[type=checkbox][formControl],input[type=checkbox][ngModel]" }, { kind: "directive", type: i2$1.RadioControlValueAccessor, selector: "input[type=radio][formControlName],input[type=radio][formControl],input[type=radio][ngModel]", inputs: ["name", "formControlName", "value"] }, { kind: "directive", type: i2$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i2$1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "ngmodule", type: NgSelectModule }, { kind: "component", type: i3.NgSelectComponent, selector: "ng-select", inputs: ["ariaLabelDropdown", "bindLabel", "bindValue", "ariaLabel", "markFirst", "placeholder", "fixedPlaceholder", "notFoundText", "typeToSearchText", "preventToggleOnRightClick", "addTagText", "loadingText", "clearAllText", "appearance", "dropdownPosition", "appendTo", "loading", "closeOnSelect", "hideSelected", "selectOnTab", "openOnEnter", "maxSelectedItems", "groupBy", "groupValue", "bufferAmount", "virtualScroll", "selectableGroup", "selectableGroupAsModel", "searchFn", "trackByFn", "clearOnBackspace", "labelForId", "inputAttrs", "tabIndex", "tabFocusOnClearButton", "readonly", "searchWhileComposing", "minTermLength", "editableSearchTerm", "ngClass", "typeahead", "multiple", "addTag", "searchable", "clearable", "isOpen", "items", "compareWith", "clearSearchOnAdd", "deselectOnClick", "keyDownFn"], outputs: ["blur", "focus", "change", "open", "close", "search", "clear", "add", "remove", "scroll", "scrollToEnd"] }, { kind: "directive", type: i3.NgOptionTemplateDirective, selector: "[ng-option-tmp]" }, { kind: "directive", type: i3.NgLabelTemplateDirective, selector: "[ng-label-tmp]" }, { kind: "ngmodule", type: NgxSliderModule }, { kind: "component", type: i4.SliderComponent, selector: "ngx-slider", inputs: ["value", "highValue", "options", "manualRefresh", "triggerFocus", "cancelUserChange"], outputs: ["valueChange", "highValueChange", "userChangeStart", "userChange", "userChangeEnd"] }, { kind: "component", type: IconComponent, selector: "cw-icon", inputs: ["icon", "label", "type", "iconSize", "iconCssClass", "iconUiType", "iconColorCustom", "spritePath"] }, { kind: "component", type: ButtonComponent, selector: "cw-button", inputs: ["type", "label", "id", "link", "isDropdown", "hideCaret", "withIcon", "withOnlyIcon", "iconSize", "iconPosition", "dropdownPosition", "isMinWidth", "isDisabled", "isLoading", "cssClass", "dataTest", "skeletonMode", "withTooltip", "tooltipText", "tooltipTitle", "tooltipTrigger", "tooltipPosition", "tooltipType"], outputs: ["btnAction", "dropDownClicked"] }, { kind: "component", type: AutocompleteComponent, selector: "cw-autocomplete", inputs: ["control", "fetcher", "displayField", "valueField", "columns", "multiple", "minChars", "debounceMs", "selectedItem", "resolver", "selectedItems", "placeholder", "id", "isRequired", "isReadonly", "isDisabled", "ariaInvalid", "ariaDescribedBy"], outputs: ["itemSelected", "itemsChange"] }, { kind: "pipe", type: i1.KeyValuePipe, name: "keyvalue" }, { kind: "pipe", type: i2.TranslatePipe, name: "translate" }] }); }
3890
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.20", type: FormFieldComponent, isStandalone: true, selector: "cw-form-field", inputs: { control: { classPropertyName: "control", publicName: "control", isSignal: false, isRequired: false, transformFunction: null }, formGroup: { classPropertyName: "formGroup", publicName: "formGroup", isSignal: false, isRequired: false, transformFunction: null }, type: { classPropertyName: "type", publicName: "type", isSignal: false, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: false, isRequired: false, transformFunction: null }, displayLabel: { classPropertyName: "displayLabel", publicName: "displayLabel", isSignal: false, isRequired: false, transformFunction: null }, name: { classPropertyName: "name", publicName: "name", isSignal: false, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: false, isRequired: false, transformFunction: null }, autocomplete: { classPropertyName: "autocomplete", publicName: "autocomplete", isSignal: false, isRequired: false, transformFunction: null }, options: { classPropertyName: "options", publicName: "options", isSignal: false, isRequired: false, transformFunction: null }, rangeOptions: { classPropertyName: "rangeOptions", publicName: "rangeOptions", isSignal: false, isRequired: false, transformFunction: null }, validationOptions: { classPropertyName: "validationOptions", publicName: "validationOptions", isSignal: false, isRequired: false, transformFunction: null }, autocompleteOptions: { classPropertyName: "autocompleteOptions", publicName: "autocompleteOptions", isSignal: false, isRequired: false, transformFunction: null }, richTextOptions: { classPropertyName: "richTextOptions", publicName: "richTextOptions", isSignal: false, isRequired: false, transformFunction: null }, errorMessages: { classPropertyName: "errorMessages", publicName: "errorMessages", isSignal: false, isRequired: false, transformFunction: null }, isRequired: { classPropertyName: "isRequired", publicName: "isRequired", isSignal: false, isRequired: false, transformFunction: null }, help: { classPropertyName: "help", publicName: "help", isSignal: false, isRequired: false, transformFunction: null }, tooltip: { classPropertyName: "tooltip", publicName: "tooltip", isSignal: false, isRequired: false, transformFunction: null }, addonLeft: { classPropertyName: "addonLeft", publicName: "addonLeft", isSignal: false, isRequired: false, transformFunction: null }, addonRight: { classPropertyName: "addonRight", publicName: "addonRight", isSignal: false, isRequired: false, transformFunction: null }, isInAddon: { classPropertyName: "isInAddon", publicName: "isInAddon", isSignal: false, isRequired: false, transformFunction: null }, isReadonly: { classPropertyName: "isReadonly", publicName: "isReadonly", isSignal: false, isRequired: false, transformFunction: null }, isDisabled: { classPropertyName: "isDisabled", publicName: "isDisabled", isSignal: false, isRequired: false, transformFunction: null }, sliderValue: { classPropertyName: "sliderValue", publicName: "sliderValue", isSignal: false, isRequired: false, transformFunction: null }, sliderOptions: { classPropertyName: "sliderOptions", publicName: "sliderOptions", isSignal: false, isRequired: false, transformFunction: null }, cssClass: { classPropertyName: "cssClass", publicName: "cssClass", isSignal: false, isRequired: false, transformFunction: null }, skeletonMode: { classPropertyName: "skeletonMode", publicName: "skeletonMode", isSignal: false, isRequired: false, transformFunction: null }, clearable: { classPropertyName: "clearable", publicName: "clearable", isSignal: false, isRequired: false, transformFunction: null }, appendTo: { classPropertyName: "appendTo", publicName: "appendTo", isSignal: false, isRequired: false, transformFunction: null }, initialCountry: { classPropertyName: "initialCountry", publicName: "initialCountry", isSignal: false, isRequired: false, transformFunction: null }, indeterminate: { classPropertyName: "indeterminate", publicName: "indeterminate", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { refreshEvent: "refreshEvent", textChanged: "textChanged", valueChange: "valueChange", phoneRegionChange: "phoneRegionChange" }, host: { properties: { "class": "this.hostClasses" } }, queries: [{ propertyName: "optionTemplate", first: true, predicate: ["ngOptionTpl"], descendants: true, read: TemplateRef }, { propertyName: "labelTemplate", first: true, predicate: ["ngLabelTpl"], descendants: true, read: TemplateRef }], viewQueries: [{ propertyName: "checkboxInputRef", first: true, predicate: ["checkboxInput"], descendants: true, isSignal: true }, { propertyName: "fileInputRef", first: true, predicate: ["fileInput"], descendants: true, isSignal: true }, { propertyName: "phoneInputRef", first: true, predicate: ["phoneInput"], descendants: true, isSignal: true }, { propertyName: "autocompleteRef", first: true, predicate: AutocompleteComponent, descendants: true, isSignal: true }], usesOnChanges: true, ngImport: i0, template: "@if (!isInAddon) {\r\n @if (\r\n type !== typeField.checkbox &&\r\n type !== typeField.radio &&\r\n type !== typeField.checkboxButton &&\r\n type !== typeField.radioButton &&\r\n type !== typeField.checkboxInline &&\r\n type !== typeField.radioInline &&\r\n type !== typeField.switch &&\r\n type !== typeField.range &&\r\n type !== typeField.switchSmall\r\n ) {\r\n <label [for]=\"name\" class=\"field-label\" [class.visually-hidden]=\"!displayLabel\">\r\n {{ label | translate }}\r\n\r\n @if (isRequired) {\r\n <span class=\"text-danger\">*</span>\r\n }\r\n\r\n @if (tooltip) {\r\n <!-- <button type=\"button\" class=\"btn btn-link btn-popover\" placement=\"bottom\" [ngbPopover]=\"popContent\" container=\"body\"\r\n triggers=\"mouseenter:mouseleave\">\r\n <span class=\"btn-popover-icon bo-icons bo-help\"></span>\r\n </button>\r\n <ng-template #popContent>\r\n <div [innerHTML]=\"tooltip\"></div>\r\n </ng-template> -->\r\n }\r\n </label>\r\n }\r\n\r\n @if (addonLeft || addonRight) {\r\n <div class=\"field-group\" [class.field-group-invalid]=\"isInvalid\" [class.field-group-disabled]=\"isDisabledOrReadonly\">\r\n @if(addonLeft) {\r\n <div class=\"field-group-addon-left\">\r\n <ng-container [ngTemplateOutlet]=\"addonLeft\"></ng-container>\r\n </div>\r\n }\r\n <ng-container [ngTemplateOutlet]=\"field\"></ng-container>\r\n @if(addonRight) {\r\n <div class=\"field-group-addon-right\">\r\n <ng-container [ngTemplateOutlet]=\"addonRight\"></ng-container>\r\n </div>\r\n }\r\n </div>\r\n }\r\n @else {\r\n @if ( isInInputGroup() ) {\r\n <div class=\"field-group\" [class.field-group-invalid]=\"isInvalid\" [class.field-group-disabled]=\"isDisabledOrReadonly\">\r\n <ng-container [ngTemplateOutlet]=\"field\"></ng-container>\r\n </div>\r\n }\r\n @else {\r\n <ng-container [ngTemplateOutlet]=\"field\"></ng-container>\r\n }\r\n }\r\n\r\n <!-- Error message -->\r\n @if (controlOrGroup?.invalid && controlOrGroup?.touched) {\r\n <div class=\"field-invalid\" [id]=\"'error-' + name\">\r\n @if (\r\n !errorMessages?.['required'] &&\r\n ((controlOrGroup?.errors?.['required']) || (getControl('start')?.errors?.['required'] || getControl('end')?.errors?.['required']))\r\n ) {\r\n <span [innerHtml]=\"'_COMMON._FORM.ERROR_IS_MANDATORY' | translate: {label: label | translate}\"></span>\r\n }\r\n @if (!errorMessages?.['rangeInvalid'] && controlOrGroup?.errors?.['rangeInvalid']) {\r\n <span>{{'_COMMON._DATES.ERROR_START_END_PERIOD' | translate}}</span>\r\n }\r\n @if (!errorMessages?.['fileExtension'] && controlOrGroup?.errors?.['fileExtension']) {\r\n <span>{{ '_COMMON._FORM.ERROR_FILE_EXTENSION' | translate: { accept: acceptLabel } }}</span>\r\n }\r\n @if (!errorMessages?.['fileSize'] && controlOrGroup?.errors?.['fileSize']) {\r\n <span>{{ '_COMMON._FORM.ERROR_FILE_SIZE' | translate: { maxSize: maxSizeLabel } }}</span>\r\n }\r\n @if (!errorMessages?.['email'] && controlOrGroup?.errors?.['email']) {\r\n <span>{{ '_COMMON._FORM.ERROR_INVALID_EMAIL' | translate }}</span>\r\n }\r\n @if (!errorMessages?.['phone'] && controlOrGroup?.errors?.['phone']) {\r\n <span>{{ '_COMMON._FORM.ERROR_INVALID_PHONE' | translate }}</span>\r\n }\r\n @if (errorMessages) {\r\n @for (entry of errorMessages | keyvalue: keepOrder; track entry.key) {\r\n @if (controlOrGroup?.errors?.[entry.key]; as errVal) {\r\n <span>{{ entry.value | translate: (errVal === true ? null : errVal) }}</span>\r\n }\r\n }\r\n }\r\n </div>\r\n }\r\n\r\n @if (help || autoHelpEntries.length) {\r\n <div [id]=\"name + '-help'\" class=\"field-text\">\r\n @if (help) {\r\n <span>{{ help | translate }}</span>\r\n }\r\n @for (entry of autoHelpEntries; track entry.key) {\r\n <span>{{ entry.key | translate: entry.params }}</span>\r\n }\r\n </div>\r\n }\r\n\r\n <!-- Chips de la multi-s\u00E9lection (autocomplete) : rendus ici, hors du field-group et apr\u00E8s\r\n erreur/help, pour \u00EAtre visuellement d\u00E9tach\u00E9s du champ. La donn\u00E9e et le retrait restent\r\n port\u00E9s par cw-autocomplete (`chips()` / `onChipRemove()`), seul l'affichage est d\u00E9l\u00E9gu\u00E9. -->\r\n @if (type === typeField.autocompleteMultiple && autocompleteRef()?.chips()?.length) {\r\n <ul class=\"autocomplete-chips\" role=\"list\">\r\n @for (chip of autocompleteRef()!.chips(); track chip.item) {\r\n <li>\r\n <button type=\"button\" class=\"autocomplete-chip\"\r\n [disabled]=\"isEffectivelyDisabled || isReadonly\"\r\n (click)=\"autocompleteRef()!.onChipRemove(chip.item)\">\r\n <span>{{ chip.label }}</span>\r\n @if (!isEffectivelyDisabled && !isReadonly) {\r\n <span aria-hidden=\"true\" class=\"autocomplete-chip-x\">&times;</span>\r\n <span class=\"visually-hidden\">{{ '_COMMON._ACTION.DELETE' | translate }}</span>\r\n }\r\n </button>\r\n </li>\r\n }\r\n </ul>\r\n }\r\n}\r\n@else {\r\n <ng-container [ngTemplateOutlet]=\"field\"></ng-container>\r\n}\r\n\r\n<ng-template #field>\r\n <!-- Autocomplete (mono / multi) -->\r\n @if ((type === typeField.autocomplete || type === typeField.autocompleteMultiple) && autocompleteOptions) {\r\n <cw-autocomplete\r\n [id]=\"name\"\r\n [control]=\"formControl\"\r\n [fetcher]=\"autocompleteOptions.fetcher\"\r\n [displayField]=\"autocompleteOptions.displayField ?? 'label'\"\r\n [valueField]=\"autocompleteOptions.valueField ?? 'id'\"\r\n [columns]=\"autocompleteOptions.columns ?? []\"\r\n [resolver]=\"autocompleteOptions.resolver ?? null\"\r\n [selectedItem]=\"autocompleteOptions.selectedItem ?? null\"\r\n [selectedItems]=\"autocompleteOptions.selectedItems ?? []\"\r\n [minChars]=\"autocompleteOptions.minChars ?? 2\"\r\n [debounceMs]=\"autocompleteOptions.debounceMs ?? 250\"\r\n [multiple]=\"type === typeField.autocompleteMultiple\"\r\n [isRequired]=\"isRequired\"\r\n [isReadonly]=\"!!isReadonly\"\r\n [isDisabled]=\"isEffectivelyDisabled\"\r\n [ariaInvalid]=\"control.invalid && control.touched\"\r\n [ariaDescribedBy]=\"getDescribedBy(control)\"\r\n [placeholder]=\"placeholder\">\r\n </cw-autocomplete>\r\n }\r\n\r\n <!-- Rich text editor (Quill) : sous-composant interne, sans field-group ni bouton clear\r\n (il porte sa propre bordure + toolbar). Le label statique du form-field reste au-dessus. -->\r\n @if (type === typeField.richText) {\r\n <cw-rich-text-editor\r\n [id]=\"name\"\r\n [control]=\"formControl\"\r\n [options]=\"richTextOptions\"\r\n [placeholder]=\"placeholder ? (placeholder | translate) : ''\"\r\n [isRequired]=\"isRequired\"\r\n [isReadonly]=\"!!isReadonly\"\r\n [isDisabled]=\"isEffectivelyDisabled\"\r\n [ariaInvalid]=\"control.invalid && control.touched\"\r\n [ariaDescribedBy]=\"getDescribedBy(control)\">\r\n </cw-rich-text-editor>\r\n }\r\n\r\n <!-- Text -->\r\n @if ([typeField.text, typeField.date, typeField.time, typeField.dateTime, typeField.number,\r\n typeField.email,\r\n typeField.color, typeField.zipCode].includes(type)) {\r\n <input [type]=\"type === typeField.zipCode ? 'text' : type\" class=\"field-control\" [id]=\"name\" [formControl]=\"formControl\"\r\n [ngClass]=\"[(cssClass || ''), formControl?.value ? 'has-value' : '', type === typeField.zipCode ? 'field-control-zipcode' : '']\"\r\n [attr.placeholder]=\"placeholder ? (placeholder | translate) : null\" [attr.required]=\"isRequired ? 'required' : null\"\r\n [attr.readonly]=\"isReadonly ? 'readonly' : null\" [attr.aria-required]=\"isRequired\"\r\n [attr.minlength]=\"minLengthAttr\" [attr.maxlength]=\"maxLengthAttr\"\r\n [attr.min]=\"minAttr\" [attr.max]=\"maxAttr\" [attr.step]=\"stepAttr\" [attr.pattern]=\"patternAttr\"\r\n [attr.autocomplete]=\"autocomplete\"\r\n [attr.aria-invalid]=\"control.invalid && control.touched\"\r\n [attr.aria-describedby]=\"getDescribedBy(control)\"\r\n (focus)=\"onFocus()\" (blur)=\"onBlur()\" />\r\n }\r\n\r\n <!-- Phone (intl-tel-input) -->\r\n @if (type === typeField.phone) {\r\n <input #phoneInput type=\"tel\" class=\"field-control\" [id]=\"name\"\r\n [attr.placeholder]=\"placeholder ? (placeholder | translate) : null\" [attr.required]=\"isRequired ? 'required' : null\"\r\n [attr.readonly]=\"isReadonly ? 'readonly' : null\" [disabled]=\"isEffectivelyDisabled\" [attr.aria-required]=\"isRequired\"\r\n [attr.autocomplete]=\"autocomplete\"\r\n [attr.aria-invalid]=\"control.invalid && control.touched\"\r\n [attr.aria-describedby]=\"getDescribedBy(control)\"\r\n (focus)=\"onFocus()\" (blur)=\"onPhoneBlur($event)\" />\r\n }\r\n\r\n <!-- File -->\r\n @if (type === typeField.file) {\r\n <input #fileInput type=\"file\" class=\"field-control\" [id]=\"name\"\r\n [ngClass]=\"[(cssClass || ''), formControl?.value ? 'has-value' : '']\"\r\n [attr.placeholder]=\"placeholder ? (placeholder | translate) : null\" [attr.required]=\"isRequired ? 'required' : null\"\r\n [attr.readonly]=\"isReadonly ? 'readonly' : null\" [disabled]=\"isEffectivelyDisabled\" [attr.aria-required]=\"isRequired\"\r\n [attr.accept]=\"acceptAttr\"\r\n [attr.aria-invalid]=\"control.invalid && control.touched\"\r\n [attr.aria-describedby]=\"getDescribedBy(control)\"\r\n (change)=\"onFileChange($event)\" (focus)=\"onFocus()\" (blur)=\"onBlur()\" />\r\n }\r\n\r\n @if (type === typeField.password) {\r\n <input [type]=\"isPasswordShown ? 'text' : 'password'\" class=\"field-control\" [id]=\"name\" [formControl]=\"formControl\"\r\n [ngClass]=\"[(cssClass || ''), formControl?.value ? 'has-value' : '']\"\r\n [attr.required]=\"isRequired ? 'required' : null\" [attr.readonly]=\"isReadonly ? 'readonly' : null\"\r\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\" [attr.aria-required]=\"isRequired\"\r\n [attr.minlength]=\"minLengthAttr\" [attr.maxlength]=\"maxLengthAttr\" [attr.pattern]=\"patternAttr\"\r\n [attr.autocomplete]=\"autocomplete\"\r\n [attr.aria-invalid]=\"control.invalid && control.touched\"\r\n [attr.aria-describedby]=\"getDescribedBy(control)\"\r\n (focus)=\"onFocus()\" (blur)=\"onBlur()\" />\r\n <cw-button [type]=\"buttonType.ghost\"\r\n cssClass=\"btn-password-field\"\r\n [withIcon]=\"isPasswordShown ? spriteIcon.toolbarHidePassword : spriteIcon.toolbarShowPassword\"\r\n [withOnlyIcon]=\"true\"\r\n [label]=\"isPasswordShown ? '_COMMON._FORM._SHOW_HIDE_PWD.HIDE' : '_COMMON._FORM._SHOW_HIDE_PWD.SHOW'\"\r\n (btnAction)=\"togglePasswordVisibility()\">\r\n </cw-button>\r\n }\r\n\r\n <!-- Textarea -->\r\n @if (type === typeField.textarea) {\r\n <textarea class=\"field-control\" [id]=\"name\" [formControl]=\"formControl\"\r\n [ngClass]=\"[(cssClass || ''), formControl?.value ? 'has-value' : '']\"\r\n [attr.placeholder]=\"placeholder ? (placeholder | translate) : null\" [attr.required]=\"isRequired ? 'required' : null\"\r\n [attr.readonly]=\"isReadonly ? 'readonly' : null\" [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\"\r\n [attr.aria-required]=\"isRequired\" [attr.aria-invalid]=\"control.invalid && control.touched\"\r\n [attr.minlength]=\"minLengthAttr\" [attr.maxlength]=\"maxLengthAttr\" [attr.pattern]=\"patternAttr\"\r\n [attr.autocomplete]=\"autocomplete\"\r\n [attr.aria-describedby]=\"getDescribedBy(control)\"\r\n (focus)=\"onFocus()\" (blur)=\"onBlur()\"></textarea>\r\n }\r\n\r\n <!-- Select -->\r\n @if (type === typeField.select) {\r\n <ng-select [formControl]=\"formControl\" [items]=\"options\" bindLabel=\"label\" [labelForId]=\"name\" [appendTo]=\"appendTo\" bindValue=\"value\"\r\n [ngClass]=\"cssClass\" [searchable]=\"false\" [placeholder]=\"placeholder ? (placeholder | translate) : null\" [readonly]=\"isReadonly\" [clearable]=\"false\"\r\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\" [attr.required]=\"isRequired ? 'required' : null\"\r\n [attr.aria-required]=\"isRequired\" [attr.aria-invalid]=\"control.invalid && control.touched\"\r\n [attr.aria-describedby]=\"getDescribedBy(control)\" [attr.id]=\"name\"\r\n (focus)=\"onFocus()\" (blur)=\"onBlur()\">\r\n\r\n <!-- Template pour les options -->\r\n <ng-template ng-option-tmp let-item=\"item\" let-index=\"index\" let-search=\"searchTerm\">\r\n @if (optionTemplate) {\r\n <ng-container *ngTemplateOutlet=\"optionTemplate; context: { item: item | translate, index: index, searchTerm: search }\"></ng-container>\r\n }\r\n @else {\r\n <div>{{ item.label | translate }}</div>\r\n }\r\n </ng-template>\r\n\r\n <!-- Template pour le label -->\r\n <ng-template ng-label-tmp let-item=\"item\">\r\n @if (labelTemplate) {\r\n <ng-container *ngTemplateOutlet=\"labelTemplate; context: { item: item | translate }\"></ng-container>\r\n }\r\n @else {\r\n {{ (item.label | translate) || (placeholder | translate) }}\r\n }\r\n </ng-template>\r\n </ng-select>\r\n }\r\n\r\n <!-- NgSelect -->\r\n @if (type === typeField.ngSelect || type === typeField.ngSelectMultiple) {\r\n <ng-select [formControl]=\"formControl\" [items]=\"options\" bindLabel=\"label\" [labelForId]=\"name\" [appendTo]=\"appendTo\" bindValue=\"value\"\r\n [multiple]=\"type === typeField.ngSelectMultiple\" [ngClass]=\"cssClass\" [clearable]=\"false\"\r\n [placeholder]=\"placeholder ? (placeholder | translate) : null\" [readonly]=\"isReadonly\"\r\n [notFoundText]=\"'_COMMON.NO_RESULT' | translate\" [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\"\r\n [attr.required]=\"isRequired ? 'required' : null\" [attr.aria-required]=\"isRequired\"\r\n [attr.aria-invalid]=\"control.invalid && control.touched\"\r\n [attr.aria-describedby]=\"getDescribedBy(control)\" [attr.id]=\"name\"\r\n (focus)=\"onFocus()\" (blur)=\"onBlur()\" (search)=\"textChanged.emit($event?.term)\">\r\n\r\n <!-- Template pour les options -->\r\n <ng-template ng-option-tmp let-item=\"item\" let-index=\"index\" let-search=\"searchTerm\">\r\n @if (optionTemplate) {\r\n <ng-container *ngTemplateOutlet=\"optionTemplate; context: { item: item, index: index, searchTerm: search }\"></ng-container>\r\n }\r\n @else {\r\n <div>{{ item.label | translate }}</div>\r\n }\r\n </ng-template>\r\n\r\n <!-- Template pour le label -->\r\n <ng-template ng-label-tmp let-item=\"item\" let-clear=\"clear\">\r\n <span class=\"ng-value-icon left\" (click)=\"clear(item)\" aria-hidden=\"true\">\u00D7</span>\r\n @if (labelTemplate) {\r\n <ng-container *ngTemplateOutlet=\"labelTemplate; context: { item: item | translate }\"></ng-container>\r\n }\r\n @else {\r\n {{ (item.label | translate) || (placeholder | translate) }}\r\n }\r\n </ng-template>\r\n </ng-select>\r\n }\r\n\r\n <!-- Radio -->\r\n @if (type === typeField.radioInline || type === typeField.radio) {\r\n <fieldset\r\n [attr.aria-required]=\"isRequired\"\r\n [attr.aria-invalid]=\"control.invalid && control.touched\"\r\n [attr.aria-describedby]=\"getDescribedBy(control)\">\r\n <legend class=\"field-label\" [class.visually-hidden]=\"!displayLabel\">\r\n {{label | translate}}\r\n @if(isRequired) {\r\n <span class=\"text-danger\">*</span>\r\n }\r\n </legend>\r\n <ul class=\"list-unstyled mb-none\" [ngClass]=\"type === typeField.radioInline ? 'd-flex-h gap-md flex-wrap' : 'd-flex-v'\">\r\n @for (opt of options; track opt.value) {\r\n <li class=\"field-check\">\r\n <input type=\"radio\" [id]=\"name + '_' + opt.value\" [value]=\"opt.value\" [formControl]=\"formControl\"\r\n class=\"field-check-input\" [attr.disabled]=\"(isEffectivelyDisabled || opt.disabled) ? 'disabled' : null\" (change)=\"onRadioChange(opt.value)\" />\r\n <label [for]=\"name + '_' + opt.value\" class=\"field-check-label\">{{ opt.label | translate }}</label>\r\n </li>\r\n }\r\n </ul>\r\n </fieldset>\r\n }\r\n\r\n <!-- Radio button -->\r\n @if (type === typeField.radioButton) {\r\n <fieldset\r\n [attr.aria-required]=\"isRequired\"\r\n [attr.aria-invalid]=\"control.invalid && control.touched\"\r\n [attr.aria-describedby]=\"getDescribedBy(control)\">\r\n <legend class=\"field-label\" [class.visually-hidden]=\"!displayLabel\">\r\n {{label | translate}}\r\n @if(isRequired) {\r\n <span class=\"text-danger\">*</span>\r\n }\r\n </legend>\r\n <div class=\"field-group field-group-btn\">\r\n @for (opt of options; track opt.value) {\r\n <input type=\"radio\" [id]=\"name + '_' + opt.value\" [value]=\"opt.value\" [formControl]=\"formControl\"\r\n class=\"visually-hidden\" [attr.disabled]=\"(isEffectivelyDisabled || opt.disabled) ? 'disabled' : null\" (change)=\"onRadioChange(opt.value)\"/>\r\n <label [for]=\"name + '_' + opt.value\" class=\"btn btn-field-group\">{{ opt.label | translate }}</label>\r\n }\r\n </div>\r\n </fieldset>\r\n }\r\n\r\n <!-- Checkbox Switch -->\r\n @if ( type === typeField.switch || type === typeField.switchSmall)\r\n {\r\n <div class=\"field-check field-switch\" [ngClass]=\"{'field-switch-small': type === typeField.switchSmall}\">\r\n <input type=\"checkbox\" [id]=\"name\" [formControl]=\"formControl\" class=\"field-check-input\" [attr.aria-required]=\"isRequired\"\r\n [attr.aria-invalid]=\"control.invalid && control.touched\"\r\n [attr.aria-describedby]=\"getDescribedBy(control)\"\r\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\"/>\r\n <label [for]=\"name\" class=\"field-check-label\">{{ label | translate }}</label>\r\n </div>\r\n }\r\n\r\n <!-- Checkbox -->\r\n @if (type === typeField.checkboxInline || type === typeField.checkbox) {\r\n @if (isSingleCheckbox()) {\r\n <div class=\"field-check\" [class.field-check-inline]=\"type === typeField.checkboxInline\">\r\n <input #checkboxInput type=\"checkbox\" [id]=\"name\" [formControl]=\"formControl\"\r\n class=\"field-check-input\"\r\n [class.is-invalid]=\"control?.invalid && control?.touched\"\r\n [attr.aria-required]=\"isRequired\"\r\n [attr.aria-invalid]=\"control?.invalid && control?.touched\"\r\n [attr.aria-describedby]=\"getDescribedBy(control)\"\r\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\" />\r\n <label [for]=\"name\" class=\"field-check-label\">\r\n {{ label | translate }}\r\n @if (isRequired) {\r\n <span class=\"text-danger\">*</span>\r\n }\r\n </label>\r\n </div>\r\n }\r\n @else if( options.length > 1) {\r\n <fieldset\r\n [attr.aria-required]=\"isRequired\"\r\n [attr.aria-invalid]=\"control.invalid && control.touched\"\r\n [attr.aria-describedby]=\"getDescribedBy(control)\"\r\n [ngClass]=\"{ 'flex-column': type === typeField.checkbox }\">\r\n <legend class=\"field-label\" [class.visually-hidden]=\"!displayLabel\">\r\n {{label | translate}}\r\n @if(isRequired) {\r\n <span class=\"text-danger\">*</span>\r\n }\r\n </legend>\r\n <ul class=\"list-unstyled mb-none\" [ngClass]=\"type === typeField.checkboxInline ? 'd-flex-h gap-md' : 'd-flex-v'\">\r\n @for (opt of options; track opt.value) {\r\n <li class=\"field-check\" [ngClass]=\"{ 'field-check-inline': type === typeField.checkboxInline }\">\r\n <input type=\"checkbox\" [id]=\"name + '_' + opt.value\" [value]=\"opt.value\" (change)=\"onCheckboxChange($event)\"\r\n [checked]=\"control.value?.includes(opt.value)\" class=\"field-check-input\"\r\n [attr.disabled]=\"(isEffectivelyDisabled || opt.disabled) ? 'disabled' : null\" />\r\n <label [for]=\"name + '_' + opt.value\" class=\"field-check-label\">\r\n {{ opt.label | translate }}\r\n </label>\r\n </li>\r\n }\r\n </ul>\r\n </fieldset>\r\n }\r\n @else {\r\n <fieldset>\r\n <legend class=\"field-label\" [class.visually-hidden]=\"!displayLabel\">\r\n {{label | translate}}\r\n </legend>\r\n <ul class=\"list-unstyled mb-none\" [ngClass]=\"type === typeField.checkboxInline ? 'd-flex-h gap-md' : 'd-flex-v'\">\r\n @for (opt of options; track opt.value) {\r\n <li class=\"field-check\" [ngClass]=\"{ 'field-check-inline': type === typeField.checkboxInline }\">\r\n <input type=\"checkbox\" [id]=\"name + '_' + opt.value\" [value]=\"opt.value\" (change)=\"onCheckboxChange($event)\"\r\n [checked]=\"control.value?.includes(opt.value)\" class=\"field-check-input\"\r\n [attr.aria-required]=\"isRequired\"\r\n [attr.aria-invalid]=\"control.invalid && control.touched\"\r\n [attr.aria-describedby]=\"getDescribedBy(control)\"\r\n [attr.disabled]=\"(isEffectivelyDisabled || opt.disabled) ? 'disabled' : null\" />\r\n <label [for]=\"name + '_' + opt.value\" class=\"field-check-label\">\r\n {{ opt.label | translate }}\r\n @if(isRequired) {\r\n <span class=\"text-danger\">*</span>\r\n }\r\n </label>\r\n </li>\r\n }\r\n </ul>\r\n </fieldset>\r\n }\r\n }\r\n\r\n <!-- Checkbox button -->\r\n @if (type === typeField.checkboxButton && options.length > 0) {\r\n\r\n @if(options.length > 1) {\r\n <fieldset\r\n [attr.aria-required]=\"isRequired\"\r\n [attr.aria-invalid]=\"control.invalid && control.touched\"\r\n [attr.aria-describedby]=\"getDescribedBy(control)\">\r\n <legend class=\"field-label\" [class.visually-hidden]=\"!displayLabel\">\r\n {{label | translate}}\r\n @if(isRequired) {\r\n <span class=\"text-danger\">*</span>\r\n }\r\n </legend>\r\n <div class=\"field-group field-group-btn\">\r\n @for (opt of options; track opt.value) {\r\n <input type=\"checkbox\" [id]=\"name + '_' + opt.value\" [value]=\"opt.value\" (change)=\"onCheckboxChange($event)\"\r\n [checked]=\"control.value?.includes(opt.value)\" class=\"visually-hidden\"\r\n [attr.disabled]=\"(isEffectivelyDisabled || opt.disabled) ? 'disabled' : null\" />\r\n <label [for]=\"name + '_' + opt.value\" class=\"btn btn-field-group\">{{ opt.label | translate }}</label>\r\n }\r\n </div>\r\n </fieldset>\r\n }\r\n @else {\r\n <fieldset>\r\n <legend class=\"field-label\" [class.visually-hidden]=\"!displayLabel\">\r\n {{label | translate}}\r\n </legend>\r\n <div class=\"btn-group btn-group-secondary\">\r\n @for (opt of options; track opt.value) {\r\n <input type=\"checkbox\" [id]=\"name + '_' + opt.value\" [value]=\"opt.value\" (change)=\"onCheckboxChange($event)\"\r\n [checked]=\"control.value?.includes(opt.value)\" class=\"visually-hidden\"\r\n [attr.aria-required]=\"isRequired\"\r\n [attr.aria-invalid]=\"control.invalid && control.touched\"\r\n [attr.aria-describedby]=\"getDescribedBy(control)\"\r\n [attr.disabled]=\"(isEffectivelyDisabled || opt.disabled) ? 'disabled' : null\"/>\r\n <label [for]=\"name + '_' + opt.value\" class=\"btn btn-field-group\">\r\n {{ opt.label | translate}}\r\n @if(isRequired) {\r\n <span class=\"text-danger\">*</span>\r\n }\r\n </label>\r\n }\r\n </div>\r\n </fieldset>\r\n }\r\n }\r\n\r\n <!-- Period - DateToDate / TimeToTime / DateTimeToDateTime -->\r\n @if ([typeField.dateToDate, typeField.timeToTime, typeField.dateTimeToDateTime].includes(type) && isRange) {\r\n\r\n <div class=\"field-group\">\r\n <div class=\"field-group-addon-left\">Du</div>\r\n <input [type]=\"getInputType()\" class=\"field-control\" [id]=\"name + '_start'\" [formControl]=\"getControl('start')\"\r\n [attr.placeholder]=\"type === typeField.timeToTime ? ('_COMMON._DATES.FROM' | translate) : ('_COMMON._DATES.FROM_TO_1' | translate)\"\r\n [ngClass]=\"[(cssClass || ''), getControl('start')?.value ? 'has-value' : '']\"\r\n [attr.required]=\"isRequired ? 'required' : null\" [attr.readonly]=\"isReadonly ? 'readonly' : null\"\r\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\" [attr.aria-required]=\"isRequired\"\r\n [attr.min]=\"minStartAttr\" [attr.max]=\"maxStartAttr\" [attr.step]=\"stepAttr\"\r\n [attr.autocomplete]=\"autocomplete\"\r\n [attr.aria-invalid]=\"getControl('start')?.invalid && getControl('start')?.touched\"\r\n [attr.aria-describedby]=\"getDescribedBy(getControl('start'))\"\r\n (focus)=\"onFocusRange('start')\" />\r\n\r\n @if(getControl('start')?.value && !isDisabledOrReadonly) {\r\n <button type=\"button\" class=\"btn btn-secondary btn-clear-field\"\r\n (click)=\"onClearFieldPeriod('start')\">\r\n &times;\r\n </button>\r\n }\r\n <div class=\"field-group-addon-center\">au</div>\r\n <input [type]=\"getInputType()\" class=\"field-control\" [id]=\"name + '_end'\" [formControl]=\"getControl('end')\"\r\n [attr.placeholder]=\"type === typeField.timeToTime ? ('_COMMON._DATES.TO' | translate) : ('_COMMON._DATES.FROM_TO_2' | translate)\"\r\n [ngClass]=\"[(cssClass || ''), getControl('end')?.value ? 'has-value' : '']\"\r\n [attr.required]=\"isRequired ? 'required' : null\" [attr.readonly]=\"isReadonly ? 'readonly' : null\"\r\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\"\r\n [attr.min]=\"minEndAttr\" [attr.max]=\"maxEndAttr\" [attr.step]=\"stepAttr\"\r\n [attr.autocomplete]=\"autocomplete\"\r\n [attr.aria-invalid]=\"getControl('end')?.invalid && getControl('end')?.touched\"\r\n [attr.aria-describedby]=\"getDescribedBy(getControl('end'))\"\r\n (focus)=\"onFocusRange('end')\" />\r\n\r\n @if(getControl('end')?.value && !isDisabledOrReadonly) {\r\n <button type=\"button\" class=\"btn btn-ghost btn-clear-field\"\r\n (click)=\"onClearFieldPeriod('end')\">\r\n &times;\r\n </button>\r\n }\r\n </div>\r\n }\r\n\r\n @if ([typeField.datePlusOne, typeField.datePlusTwo, typeField.datePlusSeven, typeField.dateComplexe].includes(type)) {\r\n\r\n <div class=\"field-group\">\r\n @if (type === typeField.dateComplexe) {\r\n <div class=\"field-group-addon-left\">\r\n <button class=\"btn btn-ghost\" type=\"button\" (click)=\"onDateAddDay('prev')\"\r\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\">\r\n <cw-icon font=\"optyweb\" [icon]=\"spriteIcon.nextLeft\" [label]=\"'Jour pr\u00E9c\u00E9dent'\"></cw-icon>\r\n </button>\r\n </div>\r\n }\r\n\r\n <input type=\"date\" class=\"field-control\" [id]=\"name\" [formControl]=\"formControl\"\r\n [ngClass]=\"[(cssClass || ''), formControl?.value ? 'has-value' : '']\"\r\n [attr.placeholder]=\"placeholder ? placeholder : null\" [attr.required]=\"isRequired ? 'required' : null\"\r\n [attr.readonly]=\"isReadonly ? 'readonly' : null\" [attr.aria-required]=\"isRequired\"\r\n [attr.min]=\"minAttr\" [attr.max]=\"maxAttr\" [attr.step]=\"stepAttr\"\r\n [attr.autocomplete]=\"autocomplete\"\r\n [attr.aria-invalid]=\"control.invalid && control.touched\"\r\n [attr.aria-describedby]=\"getDescribedBy(control)\"\r\n (focus)=\"onFocus()\" (blur)=\"onBlur()\" />\r\n\r\n @if(formControl?.value && !isDisabledOrReadonly) {\r\n <button class=\"btn btn-ghost btn-clear-field\" type=\"button\"\r\n (click)=\"onClearField(formControl)\">&times;</button>\r\n }\r\n\r\n\r\n @if (type === typeField.dateComplexe) {\r\n <div class=\"field-group-addon-right\">\r\n <button class=\"btn btn-ghost\" type=\"button\" (click)=\"onDateAddDay('next')\"\r\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\">\r\n <cw-icon font=\"optyweb\" [icon]=\"spriteIcon.nextRight\" [label]=\"'Jour suivant'\"></cw-icon>\r\n </button>\r\n </div>\r\n <div class=\"field-group-addon-right\">\r\n <button class=\"btn btn-ghost\" type=\"button\" (click)=\"onRefresh()\"\r\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\">\r\n <cw-icon font=\"optyweb\" [icon]=\"spriteIcon.toolbarRefresh\" [label]=\"'Rafra\u00EEchir'\"></cw-icon>\r\n </button>\r\n </div>\r\n }\r\n\r\n <div class=\"field-group-addon-right\">\r\n <button class=\"btn btn-ghost\" type=\"button\" (click)=\"onTodayAddDay(0)\"\r\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\">\r\n J\r\n <span class=\"visually-hidden\">Aujourd'hui</span>\r\n </button>\r\n </div>\r\n <div class=\"field-group-addon-right\">\r\n <button class=\"btn btn-ghost\" type=\"button\" (click)=\"onTodayAddDay(1)\"\r\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\">\r\n J+1\r\n <span class=\"visually-hidden\">Demain</span>\r\n </button>\r\n </div>\r\n\r\n @if (type !== typeField.datePlusOne && type !== typeField.dateComplexe) {\r\n <div class=\"field-group-addon-right\">\r\n <button class=\"btn btn-ghost \" type=\"button\" (click)=\"onTodayAddDay(2)\"\r\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\">\r\n J+2\r\n <span class=\"visually-hidden\">Dans 2 jours</span>\r\n </button>\r\n </div>\r\n\r\n @if (type !== typeField.datePlusTwo) {\r\n <div class=\"field-group-addon-right\">\r\n <button class=\"btn btn-ghost\" type=\"button\" (click)=\"onTodayAddDay(7)\"\r\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\">\r\n J+7\r\n <span class=\"visually-hidden\">Dans 7 jours</span>\r\n </button>\r\n </div>\r\n }\r\n }\r\n </div>\r\n }\r\n\r\n @if (type === typeField.slider) {\r\n <ngx-slider [(value)]=\"sliderValue\" [options]=\"sliderOptions\" [formControl]=\"formControl\"></ngx-slider>\r\n }\r\n\r\n @if (type === typeField.range) {\r\n <div class=\"slider\">\r\n\r\n <cw-button [isDisabled]=\"formControl.value <= rangeOptions.floor\" [label]=\"'Diminuer ' + formControl.value + ' ' + label\"\r\n [withIcon]=\"spriteIcon.toolbarMinus\" [withOnlyIcon]=\"true\" [type]=\"buttonType.primary\"\r\n [iconSize]=\"buttonIconSize.small\" (btnAction)=\"onRangeStep('decrease')\">\r\n </cw-button>\r\n\r\n <div class=\"slider-input\">\r\n <label [for]=\"name\" class=\"slider-tooltip\" [style.left]=\"getRangePercent() + '%'\" aria-live=\"polite\"\r\n aria-atomic=\"true\">\r\n {{ label | translate }} {{ formControl.value }}\r\n @if (rangeOptions.unit) {\r\n <abbr [title]=\"rangeOptions.unit\">{{ rangeOptions.unit }}</abbr>\r\n }\r\n </label>\r\n\r\n <div class=\"slider-custom-bar\">\r\n <div class=\"slider-custom-bar-selection\" [style.width]=\"getRangePercent() + '%'\">\r\n </div>\r\n </div>\r\n\r\n <input type=\"range\" [id]=\"name\" [formControl]=\"formControl\" [min]=\"rangeOptions.floor\" [max]=\"rangeOptions.ceil\"\r\n [step]=\"rangeOptions.step || 1\" class=\"field-control-range\" [attr.aria-required]=\"isRequired\"\r\n [attr.aria-invalid]=\"control.invalid && control.touched\">\r\n </div>\r\n\r\n <cw-button [isDisabled]=\"formControl.value >= rangeOptions.ceil\" [label]=\"'Augmenter ' + formControl.value + ' ' + label\"\r\n [withIcon]=\"spriteIcon.toolbarPlus\" [withOnlyIcon]=\"true\" [type]=\"buttonType.primary\"\r\n [iconSize]=\"buttonIconSize.small\" (btnAction)=\"onRangeStep('increase')\">\r\n </cw-button>\r\n </div>\r\n }\r\n\r\n @if (isInInputGroup() && clearable && !isDisabledOrReadonly && type !== typeField.autocompleteMultiple) {\r\n @if (type === typeField.autocomplete) {\r\n @if (autocompleteRef()?.hasAnyContent()) {\r\n <button class=\"btn btn-secondary btn-clear-field\" type=\"button\"\r\n (click)=\"onClearAutocomplete()\">&times;</button>\r\n }\r\n } @else if (type === typeField.ngSelectMultiple) {\r\n <!-- value est un tableau : un [] vide \u00E9tant truthy, on teste .length pour n'afficher le clear global que s'il y a au moins une s\u00E9lection. -->\r\n @if (formControl?.value?.length) {\r\n <button class=\"btn btn-ghost btn-clear-field\" type=\"button\"\r\n (click)=\"onClearField(formControl)\">&times;</button>\r\n }\r\n } @else {\r\n @if(formControl?.value) {\r\n <button class=\"btn btn-ghost btn-clear-field\" type=\"button\"\r\n (click)=\"onClearField(formControl)\">&times;</button>\r\n }\r\n }\r\n }\r\n\r\n</ng-template>\r\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "ngmodule", type: TranslateModule }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i2$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2$1.RangeValueAccessor, selector: "input[type=range][formControlName],input[type=range][formControl],input[type=range][ngModel]" }, { kind: "directive", type: i2$1.CheckboxControlValueAccessor, selector: "input[type=checkbox][formControlName],input[type=checkbox][formControl],input[type=checkbox][ngModel]" }, { kind: "directive", type: i2$1.RadioControlValueAccessor, selector: "input[type=radio][formControlName],input[type=radio][formControl],input[type=radio][ngModel]", inputs: ["name", "formControlName", "value"] }, { kind: "directive", type: i2$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i2$1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "ngmodule", type: NgSelectModule }, { kind: "component", type: i3.NgSelectComponent, selector: "ng-select", inputs: ["ariaLabelDropdown", "bindLabel", "bindValue", "ariaLabel", "markFirst", "placeholder", "fixedPlaceholder", "notFoundText", "typeToSearchText", "preventToggleOnRightClick", "addTagText", "loadingText", "clearAllText", "appearance", "dropdownPosition", "appendTo", "loading", "closeOnSelect", "hideSelected", "selectOnTab", "openOnEnter", "maxSelectedItems", "groupBy", "groupValue", "bufferAmount", "virtualScroll", "selectableGroup", "selectableGroupAsModel", "searchFn", "trackByFn", "clearOnBackspace", "labelForId", "inputAttrs", "tabIndex", "tabFocusOnClearButton", "readonly", "searchWhileComposing", "minTermLength", "editableSearchTerm", "ngClass", "typeahead", "multiple", "addTag", "searchable", "clearable", "isOpen", "items", "compareWith", "clearSearchOnAdd", "deselectOnClick", "keyDownFn"], outputs: ["blur", "focus", "change", "open", "close", "search", "clear", "add", "remove", "scroll", "scrollToEnd"] }, { kind: "directive", type: i3.NgOptionTemplateDirective, selector: "[ng-option-tmp]" }, { kind: "directive", type: i3.NgLabelTemplateDirective, selector: "[ng-label-tmp]" }, { kind: "ngmodule", type: NgxSliderModule }, { kind: "component", type: i4.SliderComponent, selector: "ngx-slider", inputs: ["value", "highValue", "options", "manualRefresh", "triggerFocus", "cancelUserChange"], outputs: ["valueChange", "highValueChange", "userChangeStart", "userChange", "userChangeEnd"] }, { kind: "component", type: IconComponent, selector: "cw-icon", inputs: ["icon", "label", "type", "iconSize", "iconCssClass", "iconUiType", "iconColorCustom", "spritePath"] }, { kind: "component", type: ButtonComponent, selector: "cw-button", inputs: ["type", "label", "id", "link", "isDropdown", "hideCaret", "withIcon", "withOnlyIcon", "iconSize", "iconPosition", "dropdownPosition", "isMinWidth", "isDisabled", "isLoading", "cssClass", "dataTest", "skeletonMode", "withTooltip", "tooltipText", "tooltipTitle", "tooltipTrigger", "tooltipPosition", "tooltipType"], outputs: ["btnAction", "dropDownClicked"] }, { kind: "component", type: AutocompleteComponent, selector: "cw-autocomplete", inputs: ["control", "fetcher", "displayField", "valueField", "columns", "multiple", "minChars", "debounceMs", "selectedItem", "resolver", "selectedItems", "placeholder", "id", "isRequired", "isReadonly", "isDisabled", "ariaInvalid", "ariaDescribedBy"], outputs: ["itemSelected", "itemsChange"] }, { kind: "component", type: RichTextEditorComponent, selector: "cw-rich-text-editor", inputs: ["control", "options", "id", "placeholder", "isRequired", "isReadonly", "isDisabled", "ariaInvalid", "ariaDescribedBy"], outputs: ["valueChange"] }, { kind: "pipe", type: i1.KeyValuePipe, name: "keyvalue" }, { kind: "pipe", type: i2.TranslatePipe, name: "translate" }] }); }
3559
3891
  }
3560
3892
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: FormFieldComponent, decorators: [{
3561
3893
  type: Component,
@@ -3568,8 +3900,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.20", ngImpo
3568
3900
  NgxSliderModule,
3569
3901
  IconComponent,
3570
3902
  ButtonComponent,
3571
- AutocompleteComponent
3572
- ], template: "@if (!isInAddon) {\r\n @if (\r\n type !== typeField.checkbox &&\r\n type !== typeField.radio &&\r\n type !== typeField.checkboxButton &&\r\n type !== typeField.radioButton &&\r\n type !== typeField.checkboxInline &&\r\n type !== typeField.radioInline &&\r\n type !== typeField.switch &&\r\n type !== typeField.range &&\r\n type !== typeField.switchSmall\r\n ) {\r\n <label [for]=\"name\" class=\"field-label\" [class.visually-hidden]=\"!displayLabel\">\r\n {{ label | translate }}\r\n\r\n @if (isRequired) {\r\n <span class=\"text-danger\">*</span>\r\n }\r\n\r\n @if (tooltip) {\r\n <!-- <button type=\"button\" class=\"btn btn-link btn-popover\" placement=\"bottom\" [ngbPopover]=\"popContent\" container=\"body\"\r\n triggers=\"mouseenter:mouseleave\">\r\n <span class=\"btn-popover-icon bo-icons bo-help\"></span>\r\n </button>\r\n <ng-template #popContent>\r\n <div [innerHTML]=\"tooltip\"></div>\r\n </ng-template> -->\r\n }\r\n </label>\r\n }\r\n\r\n @if (addonLeft || addonRight) {\r\n <div class=\"field-group\" [class.field-group-invalid]=\"isInvalid\" [class.field-group-disabled]=\"isDisabledOrReadonly\">\r\n @if(addonLeft) {\r\n <div class=\"field-group-addon-left\">\r\n <ng-container [ngTemplateOutlet]=\"addonLeft\"></ng-container>\r\n </div>\r\n }\r\n <ng-container [ngTemplateOutlet]=\"field\"></ng-container>\r\n @if(addonRight) {\r\n <div class=\"field-group-addon-right\">\r\n <ng-container [ngTemplateOutlet]=\"addonRight\"></ng-container>\r\n </div>\r\n }\r\n </div>\r\n }\r\n @else {\r\n @if ( isInInputGroup() ) {\r\n <div class=\"field-group\" [class.field-group-invalid]=\"isInvalid\" [class.field-group-disabled]=\"isDisabledOrReadonly\">\r\n <ng-container [ngTemplateOutlet]=\"field\"></ng-container>\r\n </div>\r\n }\r\n @else {\r\n <ng-container [ngTemplateOutlet]=\"field\"></ng-container>\r\n }\r\n }\r\n\r\n <!-- Error message -->\r\n @if (controlOrGroup?.invalid && controlOrGroup?.touched) {\r\n <div class=\"field-invalid\" [id]=\"'error-' + name\">\r\n @if (\r\n !errorMessages?.['required'] &&\r\n ((controlOrGroup?.errors?.['required']) || (getControl('start')?.errors?.['required'] || getControl('end')?.errors?.['required']))\r\n ) {\r\n <span [innerHtml]=\"'_COMMON._FORM.ERROR_IS_MANDATORY' | translate: {label: label | translate}\"></span>\r\n }\r\n @if (!errorMessages?.['rangeInvalid'] && controlOrGroup?.errors?.['rangeInvalid']) {\r\n <span>{{'_COMMON._DATES.ERROR_START_END_PERIOD' | translate}}</span>\r\n }\r\n @if (!errorMessages?.['fileExtension'] && controlOrGroup?.errors?.['fileExtension']) {\r\n <span>{{ '_COMMON._FORM.ERROR_FILE_EXTENSION' | translate: { accept: acceptLabel } }}</span>\r\n }\r\n @if (!errorMessages?.['fileSize'] && controlOrGroup?.errors?.['fileSize']) {\r\n <span>{{ '_COMMON._FORM.ERROR_FILE_SIZE' | translate: { maxSize: maxSizeLabel } }}</span>\r\n }\r\n @if (!errorMessages?.['email'] && controlOrGroup?.errors?.['email']) {\r\n <span>{{ '_COMMON._FORM.ERROR_INVALID_EMAIL' | translate }}</span>\r\n }\r\n @if (!errorMessages?.['phone'] && controlOrGroup?.errors?.['phone']) {\r\n <span>{{ '_COMMON._FORM.ERROR_INVALID_PHONE' | translate }}</span>\r\n }\r\n @if (errorMessages) {\r\n @for (entry of errorMessages | keyvalue: keepOrder; track entry.key) {\r\n @if (controlOrGroup?.errors?.[entry.key]; as errVal) {\r\n <span>{{ entry.value | translate: (errVal === true ? null : errVal) }}</span>\r\n }\r\n }\r\n }\r\n </div>\r\n }\r\n\r\n @if (help || autoHelpEntries.length) {\r\n <div [id]=\"name + '-help'\" class=\"field-text\">\r\n @if (help) {\r\n <span>{{ help | translate }}</span>\r\n }\r\n @for (entry of autoHelpEntries; track entry.key) {\r\n <span>{{ entry.key | translate: entry.params }}</span>\r\n }\r\n </div>\r\n }\r\n\r\n <!-- Chips de la multi-s\u00E9lection (autocomplete) : rendus ici, hors du field-group et apr\u00E8s\r\n erreur/help, pour \u00EAtre visuellement d\u00E9tach\u00E9s du champ. La donn\u00E9e et le retrait restent\r\n port\u00E9s par cw-autocomplete (`chips()` / `onChipRemove()`), seul l'affichage est d\u00E9l\u00E9gu\u00E9. -->\r\n @if (type === typeField.autocompleteMultiple && autocompleteRef()?.chips()?.length) {\r\n <ul class=\"autocomplete-chips\" role=\"list\">\r\n @for (chip of autocompleteRef()!.chips(); track chip.item) {\r\n <li>\r\n <button type=\"button\" class=\"autocomplete-chip\"\r\n [disabled]=\"isEffectivelyDisabled || isReadonly\"\r\n (click)=\"autocompleteRef()!.onChipRemove(chip.item)\">\r\n <span>{{ chip.label }}</span>\r\n @if (!isEffectivelyDisabled && !isReadonly) {\r\n <span aria-hidden=\"true\" class=\"autocomplete-chip-x\">&times;</span>\r\n <span class=\"visually-hidden\">{{ '_COMMON._ACTION.DELETE' | translate }}</span>\r\n }\r\n </button>\r\n </li>\r\n }\r\n </ul>\r\n }\r\n}\r\n@else {\r\n <ng-container [ngTemplateOutlet]=\"field\"></ng-container>\r\n}\r\n\r\n<ng-template #field>\r\n <!-- Autocomplete (mono / multi) -->\r\n @if ((type === typeField.autocomplete || type === typeField.autocompleteMultiple) && autocompleteOptions) {\r\n <cw-autocomplete\r\n [id]=\"name\"\r\n [control]=\"formControl\"\r\n [fetcher]=\"autocompleteOptions.fetcher\"\r\n [displayField]=\"autocompleteOptions.displayField ?? 'label'\"\r\n [valueField]=\"autocompleteOptions.valueField ?? 'id'\"\r\n [columns]=\"autocompleteOptions.columns ?? []\"\r\n [resolver]=\"autocompleteOptions.resolver ?? null\"\r\n [selectedItem]=\"autocompleteOptions.selectedItem ?? null\"\r\n [selectedItems]=\"autocompleteOptions.selectedItems ?? []\"\r\n [minChars]=\"autocompleteOptions.minChars ?? 2\"\r\n [debounceMs]=\"autocompleteOptions.debounceMs ?? 250\"\r\n [multiple]=\"type === typeField.autocompleteMultiple\"\r\n [isRequired]=\"isRequired\"\r\n [isReadonly]=\"!!isReadonly\"\r\n [isDisabled]=\"isEffectivelyDisabled\"\r\n [ariaInvalid]=\"control.invalid && control.touched\"\r\n [ariaDescribedBy]=\"getDescribedBy(control)\"\r\n [placeholder]=\"placeholder\">\r\n </cw-autocomplete>\r\n }\r\n\r\n <!-- Text -->\r\n @if ([typeField.text, typeField.date, typeField.time, typeField.dateTime, typeField.number,\r\n typeField.email,\r\n typeField.color, typeField.zipCode].includes(type)) {\r\n <input [type]=\"type === typeField.zipCode ? 'text' : type\" class=\"field-control\" [id]=\"name\" [formControl]=\"formControl\"\r\n [ngClass]=\"[(cssClass || ''), formControl?.value ? 'has-value' : '', type === typeField.zipCode ? 'field-control-zipcode' : '']\"\r\n [attr.placeholder]=\"placeholder ? (placeholder | translate) : null\" [attr.required]=\"isRequired ? 'required' : null\"\r\n [attr.readonly]=\"isReadonly ? 'readonly' : null\" [attr.aria-required]=\"isRequired\"\r\n [attr.minlength]=\"minLengthAttr\" [attr.maxlength]=\"maxLengthAttr\"\r\n [attr.min]=\"minAttr\" [attr.max]=\"maxAttr\" [attr.step]=\"stepAttr\" [attr.pattern]=\"patternAttr\"\r\n [attr.autocomplete]=\"autocomplete\"\r\n [attr.aria-invalid]=\"control.invalid && control.touched\"\r\n [attr.aria-describedby]=\"getDescribedBy(control)\"\r\n (focus)=\"onFocus()\" (blur)=\"onBlur()\" />\r\n }\r\n\r\n <!-- Phone (intl-tel-input) -->\r\n @if (type === typeField.phone) {\r\n <input #phoneInput type=\"tel\" class=\"field-control\" [id]=\"name\"\r\n [attr.placeholder]=\"placeholder ? (placeholder | translate) : null\" [attr.required]=\"isRequired ? 'required' : null\"\r\n [attr.readonly]=\"isReadonly ? 'readonly' : null\" [disabled]=\"isEffectivelyDisabled\" [attr.aria-required]=\"isRequired\"\r\n [attr.autocomplete]=\"autocomplete\"\r\n [attr.aria-invalid]=\"control.invalid && control.touched\"\r\n [attr.aria-describedby]=\"getDescribedBy(control)\"\r\n (focus)=\"onFocus()\" (blur)=\"onPhoneBlur($event)\" />\r\n }\r\n\r\n <!-- File -->\r\n @if (type === typeField.file) {\r\n <input #fileInput type=\"file\" class=\"field-control\" [id]=\"name\"\r\n [ngClass]=\"[(cssClass || ''), formControl?.value ? 'has-value' : '']\"\r\n [attr.placeholder]=\"placeholder ? (placeholder | translate) : null\" [attr.required]=\"isRequired ? 'required' : null\"\r\n [attr.readonly]=\"isReadonly ? 'readonly' : null\" [disabled]=\"isEffectivelyDisabled\" [attr.aria-required]=\"isRequired\"\r\n [attr.accept]=\"acceptAttr\"\r\n [attr.aria-invalid]=\"control.invalid && control.touched\"\r\n [attr.aria-describedby]=\"getDescribedBy(control)\"\r\n (change)=\"onFileChange($event)\" (focus)=\"onFocus()\" (blur)=\"onBlur()\" />\r\n }\r\n\r\n @if (type === typeField.password) {\r\n <input [type]=\"isPasswordShown ? 'text' : 'password'\" class=\"field-control\" [id]=\"name\" [formControl]=\"formControl\"\r\n [ngClass]=\"[(cssClass || ''), formControl?.value ? 'has-value' : '']\"\r\n [attr.required]=\"isRequired ? 'required' : null\" [attr.readonly]=\"isReadonly ? 'readonly' : null\"\r\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\" [attr.aria-required]=\"isRequired\"\r\n [attr.minlength]=\"minLengthAttr\" [attr.maxlength]=\"maxLengthAttr\" [attr.pattern]=\"patternAttr\"\r\n [attr.autocomplete]=\"autocomplete\"\r\n [attr.aria-invalid]=\"control.invalid && control.touched\"\r\n [attr.aria-describedby]=\"getDescribedBy(control)\"\r\n (focus)=\"onFocus()\" (blur)=\"onBlur()\" />\r\n <cw-button [type]=\"buttonType.ghost\"\r\n cssClass=\"btn-password-field\"\r\n [withIcon]=\"isPasswordShown ? spriteIcon.toolbarHidePassword : spriteIcon.toolbarShowPassword\"\r\n [withOnlyIcon]=\"true\"\r\n [label]=\"isPasswordShown ? '_COMMON._FORM._SHOW_HIDE_PWD.HIDE' : '_COMMON._FORM._SHOW_HIDE_PWD.SHOW'\"\r\n (btnAction)=\"togglePasswordVisibility()\">\r\n </cw-button>\r\n }\r\n\r\n <!-- Textarea -->\r\n @if (type === typeField.textarea) {\r\n <textarea class=\"field-control\" [id]=\"name\" [formControl]=\"formControl\"\r\n [ngClass]=\"[(cssClass || ''), formControl?.value ? 'has-value' : '']\"\r\n [attr.placeholder]=\"placeholder ? (placeholder | translate) : null\" [attr.required]=\"isRequired ? 'required' : null\"\r\n [attr.readonly]=\"isReadonly ? 'readonly' : null\" [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\"\r\n [attr.aria-required]=\"isRequired\" [attr.aria-invalid]=\"control.invalid && control.touched\"\r\n [attr.minlength]=\"minLengthAttr\" [attr.maxlength]=\"maxLengthAttr\" [attr.pattern]=\"patternAttr\"\r\n [attr.autocomplete]=\"autocomplete\"\r\n [attr.aria-describedby]=\"getDescribedBy(control)\"\r\n (focus)=\"onFocus()\" (blur)=\"onBlur()\"></textarea>\r\n }\r\n\r\n <!-- Select -->\r\n @if (type === typeField.select) {\r\n <ng-select [formControl]=\"formControl\" [items]=\"options\" bindLabel=\"label\" [labelForId]=\"name\" [appendTo]=\"appendTo\" bindValue=\"value\"\r\n [ngClass]=\"cssClass\" [searchable]=\"false\" [placeholder]=\"placeholder ? (placeholder | translate) : null\" [readonly]=\"isReadonly\" [clearable]=\"false\"\r\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\" [attr.required]=\"isRequired ? 'required' : null\"\r\n [attr.aria-required]=\"isRequired\" [attr.aria-invalid]=\"control.invalid && control.touched\"\r\n [attr.aria-describedby]=\"getDescribedBy(control)\" [attr.id]=\"name\"\r\n (focus)=\"onFocus()\" (blur)=\"onBlur()\">\r\n\r\n <!-- Template pour les options -->\r\n <ng-template ng-option-tmp let-item=\"item\" let-index=\"index\" let-search=\"searchTerm\">\r\n @if (optionTemplate) {\r\n <ng-container *ngTemplateOutlet=\"optionTemplate; context: { item: item | translate, index: index, searchTerm: search }\"></ng-container>\r\n }\r\n @else {\r\n <div>{{ item.label | translate }}</div>\r\n }\r\n </ng-template>\r\n\r\n <!-- Template pour le label -->\r\n <ng-template ng-label-tmp let-item=\"item\">\r\n @if (labelTemplate) {\r\n <ng-container *ngTemplateOutlet=\"labelTemplate; context: { item: item | translate }\"></ng-container>\r\n }\r\n @else {\r\n {{ (item.label | translate) || (placeholder | translate) }}\r\n }\r\n </ng-template>\r\n </ng-select>\r\n }\r\n\r\n <!-- NgSelect -->\r\n @if (type === typeField.ngSelect || type === typeField.ngSelectMultiple) {\r\n <ng-select [formControl]=\"formControl\" [items]=\"options\" bindLabel=\"label\" [labelForId]=\"name\" [appendTo]=\"appendTo\" bindValue=\"value\"\r\n [multiple]=\"type === typeField.ngSelectMultiple\" [ngClass]=\"cssClass\" [clearable]=\"false\"\r\n [placeholder]=\"placeholder ? (placeholder | translate) : null\" [readonly]=\"isReadonly\"\r\n [notFoundText]=\"'_COMMON.NO_RESULT' | translate\" [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\"\r\n [attr.required]=\"isRequired ? 'required' : null\" [attr.aria-required]=\"isRequired\"\r\n [attr.aria-invalid]=\"control.invalid && control.touched\"\r\n [attr.aria-describedby]=\"getDescribedBy(control)\" [attr.id]=\"name\"\r\n (focus)=\"onFocus()\" (blur)=\"onBlur()\" (search)=\"textChanged.emit($event?.term)\">\r\n\r\n <!-- Template pour les options -->\r\n <ng-template ng-option-tmp let-item=\"item\" let-index=\"index\" let-search=\"searchTerm\">\r\n @if (optionTemplate) {\r\n <ng-container *ngTemplateOutlet=\"optionTemplate; context: { item: item, index: index, searchTerm: search }\"></ng-container>\r\n }\r\n @else {\r\n <div>{{ item.label | translate }}</div>\r\n }\r\n </ng-template>\r\n\r\n <!-- Template pour le label -->\r\n <ng-template ng-label-tmp let-item=\"item\" let-clear=\"clear\">\r\n <span class=\"ng-value-icon left\" (click)=\"clear(item)\" aria-hidden=\"true\">\u00D7</span>\r\n @if (labelTemplate) {\r\n <ng-container *ngTemplateOutlet=\"labelTemplate; context: { item: item | translate }\"></ng-container>\r\n }\r\n @else {\r\n {{ (item.label | translate) || (placeholder | translate) }}\r\n }\r\n </ng-template>\r\n </ng-select>\r\n }\r\n\r\n <!-- Radio -->\r\n @if (type === typeField.radioInline || type === typeField.radio) {\r\n <fieldset\r\n [attr.aria-required]=\"isRequired\"\r\n [attr.aria-invalid]=\"control.invalid && control.touched\"\r\n [attr.aria-describedby]=\"getDescribedBy(control)\">\r\n <legend class=\"field-label\" [class.visually-hidden]=\"!displayLabel\">\r\n {{label | translate}}\r\n @if(isRequired) {\r\n <span class=\"text-danger\">*</span>\r\n }\r\n </legend>\r\n <ul class=\"list-unstyled mb-none\" [ngClass]=\"type === typeField.radioInline ? 'd-flex-h gap-md flex-wrap' : 'd-flex-v'\">\r\n @for (opt of options; track opt.value) {\r\n <li class=\"field-check\">\r\n <input type=\"radio\" [id]=\"name + '_' + opt.value\" [value]=\"opt.value\" [formControl]=\"formControl\"\r\n class=\"field-check-input\" [attr.disabled]=\"(isEffectivelyDisabled || opt.disabled) ? 'disabled' : null\" (change)=\"onRadioChange(opt.value)\" />\r\n <label [for]=\"name + '_' + opt.value\" class=\"field-check-label\">{{ opt.label | translate }}</label>\r\n </li>\r\n }\r\n </ul>\r\n </fieldset>\r\n }\r\n\r\n <!-- Radio button -->\r\n @if (type === typeField.radioButton) {\r\n <fieldset\r\n [attr.aria-required]=\"isRequired\"\r\n [attr.aria-invalid]=\"control.invalid && control.touched\"\r\n [attr.aria-describedby]=\"getDescribedBy(control)\">\r\n <legend class=\"field-label\" [class.visually-hidden]=\"!displayLabel\">\r\n {{label | translate}}\r\n @if(isRequired) {\r\n <span class=\"text-danger\">*</span>\r\n }\r\n </legend>\r\n <div class=\"field-group field-group-btn\">\r\n @for (opt of options; track opt.value) {\r\n <input type=\"radio\" [id]=\"name + '_' + opt.value\" [value]=\"opt.value\" [formControl]=\"formControl\"\r\n class=\"visually-hidden\" [attr.disabled]=\"(isEffectivelyDisabled || opt.disabled) ? 'disabled' : null\" (change)=\"onRadioChange(opt.value)\"/>\r\n <label [for]=\"name + '_' + opt.value\" class=\"btn btn-field-group\">{{ opt.label | translate }}</label>\r\n }\r\n </div>\r\n </fieldset>\r\n }\r\n\r\n <!-- Checkbox Switch -->\r\n @if ( type === typeField.switch || type === typeField.switchSmall)\r\n {\r\n <div class=\"field-check field-switch\" [ngClass]=\"{'field-switch-small': type === typeField.switchSmall}\">\r\n <input type=\"checkbox\" [id]=\"name\" [formControl]=\"formControl\" class=\"field-check-input\" [attr.aria-required]=\"isRequired\"\r\n [attr.aria-invalid]=\"control.invalid && control.touched\"\r\n [attr.aria-describedby]=\"getDescribedBy(control)\"\r\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\"/>\r\n <label [for]=\"name\" class=\"field-check-label\">{{ label | translate }}</label>\r\n </div>\r\n }\r\n\r\n <!-- Checkbox -->\r\n @if (type === typeField.checkboxInline || type === typeField.checkbox) {\r\n @if (isSingleCheckbox()) {\r\n <div class=\"field-check\" [class.field-check-inline]=\"type === typeField.checkboxInline\">\r\n <input #checkboxInput type=\"checkbox\" [id]=\"name\" [formControl]=\"formControl\"\r\n class=\"field-check-input\"\r\n [class.is-invalid]=\"control?.invalid && control?.touched\"\r\n [attr.aria-required]=\"isRequired\"\r\n [attr.aria-invalid]=\"control?.invalid && control?.touched\"\r\n [attr.aria-describedby]=\"getDescribedBy(control)\"\r\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\" />\r\n <label [for]=\"name\" class=\"field-check-label\">\r\n {{ label | translate }}\r\n @if (isRequired) {\r\n <span class=\"text-danger\">*</span>\r\n }\r\n </label>\r\n </div>\r\n }\r\n @else if( options.length > 1) {\r\n <fieldset\r\n [attr.aria-required]=\"isRequired\"\r\n [attr.aria-invalid]=\"control.invalid && control.touched\"\r\n [attr.aria-describedby]=\"getDescribedBy(control)\"\r\n [ngClass]=\"{ 'flex-column': type === typeField.checkbox }\">\r\n <legend class=\"field-label\" [class.visually-hidden]=\"!displayLabel\">\r\n {{label | translate}}\r\n @if(isRequired) {\r\n <span class=\"text-danger\">*</span>\r\n }\r\n </legend>\r\n <ul class=\"list-unstyled mb-none\" [ngClass]=\"type === typeField.checkboxInline ? 'd-flex-h gap-md' : 'd-flex-v'\">\r\n @for (opt of options; track opt.value) {\r\n <li class=\"field-check\" [ngClass]=\"{ 'field-check-inline': type === typeField.checkboxInline }\">\r\n <input type=\"checkbox\" [id]=\"name + '_' + opt.value\" [value]=\"opt.value\" (change)=\"onCheckboxChange($event)\"\r\n [checked]=\"control.value?.includes(opt.value)\" class=\"field-check-input\"\r\n [attr.disabled]=\"(isEffectivelyDisabled || opt.disabled) ? 'disabled' : null\" />\r\n <label [for]=\"name + '_' + opt.value\" class=\"field-check-label\">\r\n {{ opt.label | translate }}\r\n </label>\r\n </li>\r\n }\r\n </ul>\r\n </fieldset>\r\n }\r\n @else {\r\n <fieldset>\r\n <legend class=\"field-label\" [class.visually-hidden]=\"!displayLabel\">\r\n {{label | translate}}\r\n </legend>\r\n <ul class=\"list-unstyled mb-none\" [ngClass]=\"type === typeField.checkboxInline ? 'd-flex-h gap-md' : 'd-flex-v'\">\r\n @for (opt of options; track opt.value) {\r\n <li class=\"field-check\" [ngClass]=\"{ 'field-check-inline': type === typeField.checkboxInline }\">\r\n <input type=\"checkbox\" [id]=\"name + '_' + opt.value\" [value]=\"opt.value\" (change)=\"onCheckboxChange($event)\"\r\n [checked]=\"control.value?.includes(opt.value)\" class=\"field-check-input\"\r\n [attr.aria-required]=\"isRequired\"\r\n [attr.aria-invalid]=\"control.invalid && control.touched\"\r\n [attr.aria-describedby]=\"getDescribedBy(control)\"\r\n [attr.disabled]=\"(isEffectivelyDisabled || opt.disabled) ? 'disabled' : null\" />\r\n <label [for]=\"name + '_' + opt.value\" class=\"field-check-label\">\r\n {{ opt.label | translate }}\r\n @if(isRequired) {\r\n <span class=\"text-danger\">*</span>\r\n }\r\n </label>\r\n </li>\r\n }\r\n </ul>\r\n </fieldset>\r\n }\r\n }\r\n\r\n <!-- Checkbox button -->\r\n @if (type === typeField.checkboxButton && options.length > 0) {\r\n\r\n @if(options.length > 1) {\r\n <fieldset\r\n [attr.aria-required]=\"isRequired\"\r\n [attr.aria-invalid]=\"control.invalid && control.touched\"\r\n [attr.aria-describedby]=\"getDescribedBy(control)\">\r\n <legend class=\"field-label\" [class.visually-hidden]=\"!displayLabel\">\r\n {{label | translate}}\r\n @if(isRequired) {\r\n <span class=\"text-danger\">*</span>\r\n }\r\n </legend>\r\n <div class=\"field-group field-group-btn\">\r\n @for (opt of options; track opt.value) {\r\n <input type=\"checkbox\" [id]=\"name + '_' + opt.value\" [value]=\"opt.value\" (change)=\"onCheckboxChange($event)\"\r\n [checked]=\"control.value?.includes(opt.value)\" class=\"visually-hidden\"\r\n [attr.disabled]=\"(isEffectivelyDisabled || opt.disabled) ? 'disabled' : null\" />\r\n <label [for]=\"name + '_' + opt.value\" class=\"btn btn-field-group\">{{ opt.label | translate }}</label>\r\n }\r\n </div>\r\n </fieldset>\r\n }\r\n @else {\r\n <fieldset>\r\n <legend class=\"field-label\" [class.visually-hidden]=\"!displayLabel\">\r\n {{label | translate}}\r\n </legend>\r\n <div class=\"btn-group btn-group-secondary\">\r\n @for (opt of options; track opt.value) {\r\n <input type=\"checkbox\" [id]=\"name + '_' + opt.value\" [value]=\"opt.value\" (change)=\"onCheckboxChange($event)\"\r\n [checked]=\"control.value?.includes(opt.value)\" class=\"visually-hidden\"\r\n [attr.aria-required]=\"isRequired\"\r\n [attr.aria-invalid]=\"control.invalid && control.touched\"\r\n [attr.aria-describedby]=\"getDescribedBy(control)\"\r\n [attr.disabled]=\"(isEffectivelyDisabled || opt.disabled) ? 'disabled' : null\"/>\r\n <label [for]=\"name + '_' + opt.value\" class=\"btn btn-field-group\">\r\n {{ opt.label | translate}}\r\n @if(isRequired) {\r\n <span class=\"text-danger\">*</span>\r\n }\r\n </label>\r\n }\r\n </div>\r\n </fieldset>\r\n }\r\n }\r\n\r\n <!-- Period - DateToDate / TimeToTime / DateTimeToDateTime -->\r\n @if ([typeField.dateToDate, typeField.timeToTime, typeField.dateTimeToDateTime].includes(type) && isRange) {\r\n\r\n <div class=\"field-group\">\r\n <div class=\"field-group-addon-left\">Du</div>\r\n <input [type]=\"getInputType()\" class=\"field-control\" [id]=\"name + '_start'\" [formControl]=\"getControl('start')\"\r\n [attr.placeholder]=\"type === typeField.timeToTime ? ('_COMMON._DATES.FROM' | translate) : ('_COMMON._DATES.FROM_TO_1' | translate)\"\r\n [ngClass]=\"[(cssClass || ''), getControl('start')?.value ? 'has-value' : '']\"\r\n [attr.required]=\"isRequired ? 'required' : null\" [attr.readonly]=\"isReadonly ? 'readonly' : null\"\r\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\" [attr.aria-required]=\"isRequired\"\r\n [attr.min]=\"minStartAttr\" [attr.max]=\"maxStartAttr\" [attr.step]=\"stepAttr\"\r\n [attr.autocomplete]=\"autocomplete\"\r\n [attr.aria-invalid]=\"getControl('start')?.invalid && getControl('start')?.touched\"\r\n [attr.aria-describedby]=\"getDescribedBy(getControl('start'))\"\r\n (focus)=\"onFocusRange('start')\" />\r\n\r\n @if(getControl('start')?.value && !isDisabledOrReadonly) {\r\n <button type=\"button\" class=\"btn btn-secondary btn-clear-field\"\r\n (click)=\"onClearFieldPeriod('start')\">\r\n &times;\r\n </button>\r\n }\r\n <div class=\"field-group-addon-center\">au</div>\r\n <input [type]=\"getInputType()\" class=\"field-control\" [id]=\"name + '_end'\" [formControl]=\"getControl('end')\"\r\n [attr.placeholder]=\"type === typeField.timeToTime ? ('_COMMON._DATES.TO' | translate) : ('_COMMON._DATES.FROM_TO_2' | translate)\"\r\n [ngClass]=\"[(cssClass || ''), getControl('end')?.value ? 'has-value' : '']\"\r\n [attr.required]=\"isRequired ? 'required' : null\" [attr.readonly]=\"isReadonly ? 'readonly' : null\"\r\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\"\r\n [attr.min]=\"minEndAttr\" [attr.max]=\"maxEndAttr\" [attr.step]=\"stepAttr\"\r\n [attr.autocomplete]=\"autocomplete\"\r\n [attr.aria-invalid]=\"getControl('end')?.invalid && getControl('end')?.touched\"\r\n [attr.aria-describedby]=\"getDescribedBy(getControl('end'))\"\r\n (focus)=\"onFocusRange('end')\" />\r\n\r\n @if(getControl('end')?.value && !isDisabledOrReadonly) {\r\n <button type=\"button\" class=\"btn btn-ghost btn-clear-field\"\r\n (click)=\"onClearFieldPeriod('end')\">\r\n &times;\r\n </button>\r\n }\r\n </div>\r\n }\r\n\r\n @if ([typeField.datePlusOne, typeField.datePlusTwo, typeField.datePlusSeven, typeField.dateComplexe].includes(type)) {\r\n\r\n <div class=\"field-group\">\r\n @if (type === typeField.dateComplexe) {\r\n <div class=\"field-group-addon-left\">\r\n <button class=\"btn btn-ghost\" type=\"button\" (click)=\"onDateAddDay('prev')\"\r\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\">\r\n <cw-icon font=\"optyweb\" [icon]=\"spriteIcon.nextLeft\" [label]=\"'Jour pr\u00E9c\u00E9dent'\"></cw-icon>\r\n </button>\r\n </div>\r\n }\r\n\r\n <input type=\"date\" class=\"field-control\" [id]=\"name\" [formControl]=\"formControl\"\r\n [ngClass]=\"[(cssClass || ''), formControl?.value ? 'has-value' : '']\"\r\n [attr.placeholder]=\"placeholder ? placeholder : null\" [attr.required]=\"isRequired ? 'required' : null\"\r\n [attr.readonly]=\"isReadonly ? 'readonly' : null\" [attr.aria-required]=\"isRequired\"\r\n [attr.min]=\"minAttr\" [attr.max]=\"maxAttr\" [attr.step]=\"stepAttr\"\r\n [attr.autocomplete]=\"autocomplete\"\r\n [attr.aria-invalid]=\"control.invalid && control.touched\"\r\n [attr.aria-describedby]=\"getDescribedBy(control)\"\r\n (focus)=\"onFocus()\" (blur)=\"onBlur()\" />\r\n\r\n @if(formControl?.value && !isDisabledOrReadonly) {\r\n <button class=\"btn btn-ghost btn-clear-field\" type=\"button\"\r\n (click)=\"onClearField(formControl)\">&times;</button>\r\n }\r\n\r\n\r\n @if (type === typeField.dateComplexe) {\r\n <div class=\"field-group-addon-right\">\r\n <button class=\"btn btn-ghost\" type=\"button\" (click)=\"onDateAddDay('next')\"\r\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\">\r\n <cw-icon font=\"optyweb\" [icon]=\"spriteIcon.nextRight\" [label]=\"'Jour suivant'\"></cw-icon>\r\n </button>\r\n </div>\r\n <div class=\"field-group-addon-right\">\r\n <button class=\"btn btn-ghost\" type=\"button\" (click)=\"onRefresh()\"\r\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\">\r\n <cw-icon font=\"optyweb\" [icon]=\"spriteIcon.toolbarRefresh\" [label]=\"'Rafra\u00EEchir'\"></cw-icon>\r\n </button>\r\n </div>\r\n }\r\n\r\n <div class=\"field-group-addon-right\">\r\n <button class=\"btn btn-ghost\" type=\"button\" (click)=\"onTodayAddDay(0)\"\r\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\">\r\n J\r\n <span class=\"visually-hidden\">Aujourd'hui</span>\r\n </button>\r\n </div>\r\n <div class=\"field-group-addon-right\">\r\n <button class=\"btn btn-ghost\" type=\"button\" (click)=\"onTodayAddDay(1)\"\r\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\">\r\n J+1\r\n <span class=\"visually-hidden\">Demain</span>\r\n </button>\r\n </div>\r\n\r\n @if (type !== typeField.datePlusOne && type !== typeField.dateComplexe) {\r\n <div class=\"field-group-addon-right\">\r\n <button class=\"btn btn-ghost \" type=\"button\" (click)=\"onTodayAddDay(2)\"\r\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\">\r\n J+2\r\n <span class=\"visually-hidden\">Dans 2 jours</span>\r\n </button>\r\n </div>\r\n\r\n @if (type !== typeField.datePlusTwo) {\r\n <div class=\"field-group-addon-right\">\r\n <button class=\"btn btn-ghost\" type=\"button\" (click)=\"onTodayAddDay(7)\"\r\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\">\r\n J+7\r\n <span class=\"visually-hidden\">Dans 7 jours</span>\r\n </button>\r\n </div>\r\n }\r\n }\r\n </div>\r\n }\r\n\r\n @if (type === typeField.slider) {\r\n <ngx-slider [(value)]=\"sliderValue\" [options]=\"sliderOptions\" [formControl]=\"formControl\"></ngx-slider>\r\n }\r\n\r\n @if (type === typeField.range) {\r\n <div class=\"slider\">\r\n\r\n <cw-button [isDisabled]=\"formControl.value <= rangeOptions.floor\" [label]=\"'Diminuer ' + formControl.value + ' ' + label\"\r\n [withIcon]=\"spriteIcon.toolbarMinus\" [withOnlyIcon]=\"true\" [type]=\"buttonType.primary\"\r\n [iconSize]=\"buttonIconSize.small\" (btnAction)=\"onRangeStep('decrease')\">\r\n </cw-button>\r\n\r\n <div class=\"slider-input\">\r\n <label [for]=\"name\" class=\"slider-tooltip\" [style.left]=\"getRangePercent() + '%'\" aria-live=\"polite\"\r\n aria-atomic=\"true\">\r\n {{ label | translate }} {{ formControl.value }}\r\n @if (rangeOptions.unit) {\r\n <abbr [title]=\"rangeOptions.unit\">{{ rangeOptions.unit }}</abbr>\r\n }\r\n </label>\r\n\r\n <div class=\"slider-custom-bar\">\r\n <div class=\"slider-custom-bar-selection\" [style.width]=\"getRangePercent() + '%'\">\r\n </div>\r\n </div>\r\n\r\n <input type=\"range\" [id]=\"name\" [formControl]=\"formControl\" [min]=\"rangeOptions.floor\" [max]=\"rangeOptions.ceil\"\r\n [step]=\"rangeOptions.step || 1\" class=\"field-control-range\" [attr.aria-required]=\"isRequired\"\r\n [attr.aria-invalid]=\"control.invalid && control.touched\">\r\n </div>\r\n\r\n <cw-button [isDisabled]=\"formControl.value >= rangeOptions.ceil\" [label]=\"'Augmenter ' + formControl.value + ' ' + label\"\r\n [withIcon]=\"spriteIcon.toolbarPlus\" [withOnlyIcon]=\"true\" [type]=\"buttonType.primary\"\r\n [iconSize]=\"buttonIconSize.small\" (btnAction)=\"onRangeStep('increase')\">\r\n </cw-button>\r\n </div>\r\n }\r\n\r\n @if (isInInputGroup() && clearable && !isDisabledOrReadonly && type !== typeField.autocompleteMultiple) {\r\n @if (type === typeField.autocomplete) {\r\n @if (autocompleteRef()?.hasAnyContent()) {\r\n <button class=\"btn btn-secondary btn-clear-field\" type=\"button\"\r\n (click)=\"onClearAutocomplete()\">&times;</button>\r\n }\r\n } @else if (type === typeField.ngSelectMultiple) {\r\n <!-- value est un tableau : un [] vide \u00E9tant truthy, on teste .length pour n'afficher le clear global que s'il y a au moins une s\u00E9lection. -->\r\n @if (formControl?.value?.length) {\r\n <button class=\"btn btn-ghost btn-clear-field\" type=\"button\"\r\n (click)=\"onClearField(formControl)\">&times;</button>\r\n }\r\n } @else {\r\n @if(formControl?.value) {\r\n <button class=\"btn btn-ghost btn-clear-field\" type=\"button\"\r\n (click)=\"onClearField(formControl)\">&times;</button>\r\n }\r\n }\r\n }\r\n\r\n</ng-template>\r\n" }]
3903
+ AutocompleteComponent,
3904
+ RichTextEditorComponent
3905
+ ], template: "@if (!isInAddon) {\r\n @if (\r\n type !== typeField.checkbox &&\r\n type !== typeField.radio &&\r\n type !== typeField.checkboxButton &&\r\n type !== typeField.radioButton &&\r\n type !== typeField.checkboxInline &&\r\n type !== typeField.radioInline &&\r\n type !== typeField.switch &&\r\n type !== typeField.range &&\r\n type !== typeField.switchSmall\r\n ) {\r\n <label [for]=\"name\" class=\"field-label\" [class.visually-hidden]=\"!displayLabel\">\r\n {{ label | translate }}\r\n\r\n @if (isRequired) {\r\n <span class=\"text-danger\">*</span>\r\n }\r\n\r\n @if (tooltip) {\r\n <!-- <button type=\"button\" class=\"btn btn-link btn-popover\" placement=\"bottom\" [ngbPopover]=\"popContent\" container=\"body\"\r\n triggers=\"mouseenter:mouseleave\">\r\n <span class=\"btn-popover-icon bo-icons bo-help\"></span>\r\n </button>\r\n <ng-template #popContent>\r\n <div [innerHTML]=\"tooltip\"></div>\r\n </ng-template> -->\r\n }\r\n </label>\r\n }\r\n\r\n @if (addonLeft || addonRight) {\r\n <div class=\"field-group\" [class.field-group-invalid]=\"isInvalid\" [class.field-group-disabled]=\"isDisabledOrReadonly\">\r\n @if(addonLeft) {\r\n <div class=\"field-group-addon-left\">\r\n <ng-container [ngTemplateOutlet]=\"addonLeft\"></ng-container>\r\n </div>\r\n }\r\n <ng-container [ngTemplateOutlet]=\"field\"></ng-container>\r\n @if(addonRight) {\r\n <div class=\"field-group-addon-right\">\r\n <ng-container [ngTemplateOutlet]=\"addonRight\"></ng-container>\r\n </div>\r\n }\r\n </div>\r\n }\r\n @else {\r\n @if ( isInInputGroup() ) {\r\n <div class=\"field-group\" [class.field-group-invalid]=\"isInvalid\" [class.field-group-disabled]=\"isDisabledOrReadonly\">\r\n <ng-container [ngTemplateOutlet]=\"field\"></ng-container>\r\n </div>\r\n }\r\n @else {\r\n <ng-container [ngTemplateOutlet]=\"field\"></ng-container>\r\n }\r\n }\r\n\r\n <!-- Error message -->\r\n @if (controlOrGroup?.invalid && controlOrGroup?.touched) {\r\n <div class=\"field-invalid\" [id]=\"'error-' + name\">\r\n @if (\r\n !errorMessages?.['required'] &&\r\n ((controlOrGroup?.errors?.['required']) || (getControl('start')?.errors?.['required'] || getControl('end')?.errors?.['required']))\r\n ) {\r\n <span [innerHtml]=\"'_COMMON._FORM.ERROR_IS_MANDATORY' | translate: {label: label | translate}\"></span>\r\n }\r\n @if (!errorMessages?.['rangeInvalid'] && controlOrGroup?.errors?.['rangeInvalid']) {\r\n <span>{{'_COMMON._DATES.ERROR_START_END_PERIOD' | translate}}</span>\r\n }\r\n @if (!errorMessages?.['fileExtension'] && controlOrGroup?.errors?.['fileExtension']) {\r\n <span>{{ '_COMMON._FORM.ERROR_FILE_EXTENSION' | translate: { accept: acceptLabel } }}</span>\r\n }\r\n @if (!errorMessages?.['fileSize'] && controlOrGroup?.errors?.['fileSize']) {\r\n <span>{{ '_COMMON._FORM.ERROR_FILE_SIZE' | translate: { maxSize: maxSizeLabel } }}</span>\r\n }\r\n @if (!errorMessages?.['email'] && controlOrGroup?.errors?.['email']) {\r\n <span>{{ '_COMMON._FORM.ERROR_INVALID_EMAIL' | translate }}</span>\r\n }\r\n @if (!errorMessages?.['phone'] && controlOrGroup?.errors?.['phone']) {\r\n <span>{{ '_COMMON._FORM.ERROR_INVALID_PHONE' | translate }}</span>\r\n }\r\n @if (errorMessages) {\r\n @for (entry of errorMessages | keyvalue: keepOrder; track entry.key) {\r\n @if (controlOrGroup?.errors?.[entry.key]; as errVal) {\r\n <span>{{ entry.value | translate: (errVal === true ? null : errVal) }}</span>\r\n }\r\n }\r\n }\r\n </div>\r\n }\r\n\r\n @if (help || autoHelpEntries.length) {\r\n <div [id]=\"name + '-help'\" class=\"field-text\">\r\n @if (help) {\r\n <span>{{ help | translate }}</span>\r\n }\r\n @for (entry of autoHelpEntries; track entry.key) {\r\n <span>{{ entry.key | translate: entry.params }}</span>\r\n }\r\n </div>\r\n }\r\n\r\n <!-- Chips de la multi-s\u00E9lection (autocomplete) : rendus ici, hors du field-group et apr\u00E8s\r\n erreur/help, pour \u00EAtre visuellement d\u00E9tach\u00E9s du champ. La donn\u00E9e et le retrait restent\r\n port\u00E9s par cw-autocomplete (`chips()` / `onChipRemove()`), seul l'affichage est d\u00E9l\u00E9gu\u00E9. -->\r\n @if (type === typeField.autocompleteMultiple && autocompleteRef()?.chips()?.length) {\r\n <ul class=\"autocomplete-chips\" role=\"list\">\r\n @for (chip of autocompleteRef()!.chips(); track chip.item) {\r\n <li>\r\n <button type=\"button\" class=\"autocomplete-chip\"\r\n [disabled]=\"isEffectivelyDisabled || isReadonly\"\r\n (click)=\"autocompleteRef()!.onChipRemove(chip.item)\">\r\n <span>{{ chip.label }}</span>\r\n @if (!isEffectivelyDisabled && !isReadonly) {\r\n <span aria-hidden=\"true\" class=\"autocomplete-chip-x\">&times;</span>\r\n <span class=\"visually-hidden\">{{ '_COMMON._ACTION.DELETE' | translate }}</span>\r\n }\r\n </button>\r\n </li>\r\n }\r\n </ul>\r\n }\r\n}\r\n@else {\r\n <ng-container [ngTemplateOutlet]=\"field\"></ng-container>\r\n}\r\n\r\n<ng-template #field>\r\n <!-- Autocomplete (mono / multi) -->\r\n @if ((type === typeField.autocomplete || type === typeField.autocompleteMultiple) && autocompleteOptions) {\r\n <cw-autocomplete\r\n [id]=\"name\"\r\n [control]=\"formControl\"\r\n [fetcher]=\"autocompleteOptions.fetcher\"\r\n [displayField]=\"autocompleteOptions.displayField ?? 'label'\"\r\n [valueField]=\"autocompleteOptions.valueField ?? 'id'\"\r\n [columns]=\"autocompleteOptions.columns ?? []\"\r\n [resolver]=\"autocompleteOptions.resolver ?? null\"\r\n [selectedItem]=\"autocompleteOptions.selectedItem ?? null\"\r\n [selectedItems]=\"autocompleteOptions.selectedItems ?? []\"\r\n [minChars]=\"autocompleteOptions.minChars ?? 2\"\r\n [debounceMs]=\"autocompleteOptions.debounceMs ?? 250\"\r\n [multiple]=\"type === typeField.autocompleteMultiple\"\r\n [isRequired]=\"isRequired\"\r\n [isReadonly]=\"!!isReadonly\"\r\n [isDisabled]=\"isEffectivelyDisabled\"\r\n [ariaInvalid]=\"control.invalid && control.touched\"\r\n [ariaDescribedBy]=\"getDescribedBy(control)\"\r\n [placeholder]=\"placeholder\">\r\n </cw-autocomplete>\r\n }\r\n\r\n <!-- Rich text editor (Quill) : sous-composant interne, sans field-group ni bouton clear\r\n (il porte sa propre bordure + toolbar). Le label statique du form-field reste au-dessus. -->\r\n @if (type === typeField.richText) {\r\n <cw-rich-text-editor\r\n [id]=\"name\"\r\n [control]=\"formControl\"\r\n [options]=\"richTextOptions\"\r\n [placeholder]=\"placeholder ? (placeholder | translate) : ''\"\r\n [isRequired]=\"isRequired\"\r\n [isReadonly]=\"!!isReadonly\"\r\n [isDisabled]=\"isEffectivelyDisabled\"\r\n [ariaInvalid]=\"control.invalid && control.touched\"\r\n [ariaDescribedBy]=\"getDescribedBy(control)\">\r\n </cw-rich-text-editor>\r\n }\r\n\r\n <!-- Text -->\r\n @if ([typeField.text, typeField.date, typeField.time, typeField.dateTime, typeField.number,\r\n typeField.email,\r\n typeField.color, typeField.zipCode].includes(type)) {\r\n <input [type]=\"type === typeField.zipCode ? 'text' : type\" class=\"field-control\" [id]=\"name\" [formControl]=\"formControl\"\r\n [ngClass]=\"[(cssClass || ''), formControl?.value ? 'has-value' : '', type === typeField.zipCode ? 'field-control-zipcode' : '']\"\r\n [attr.placeholder]=\"placeholder ? (placeholder | translate) : null\" [attr.required]=\"isRequired ? 'required' : null\"\r\n [attr.readonly]=\"isReadonly ? 'readonly' : null\" [attr.aria-required]=\"isRequired\"\r\n [attr.minlength]=\"minLengthAttr\" [attr.maxlength]=\"maxLengthAttr\"\r\n [attr.min]=\"minAttr\" [attr.max]=\"maxAttr\" [attr.step]=\"stepAttr\" [attr.pattern]=\"patternAttr\"\r\n [attr.autocomplete]=\"autocomplete\"\r\n [attr.aria-invalid]=\"control.invalid && control.touched\"\r\n [attr.aria-describedby]=\"getDescribedBy(control)\"\r\n (focus)=\"onFocus()\" (blur)=\"onBlur()\" />\r\n }\r\n\r\n <!-- Phone (intl-tel-input) -->\r\n @if (type === typeField.phone) {\r\n <input #phoneInput type=\"tel\" class=\"field-control\" [id]=\"name\"\r\n [attr.placeholder]=\"placeholder ? (placeholder | translate) : null\" [attr.required]=\"isRequired ? 'required' : null\"\r\n [attr.readonly]=\"isReadonly ? 'readonly' : null\" [disabled]=\"isEffectivelyDisabled\" [attr.aria-required]=\"isRequired\"\r\n [attr.autocomplete]=\"autocomplete\"\r\n [attr.aria-invalid]=\"control.invalid && control.touched\"\r\n [attr.aria-describedby]=\"getDescribedBy(control)\"\r\n (focus)=\"onFocus()\" (blur)=\"onPhoneBlur($event)\" />\r\n }\r\n\r\n <!-- File -->\r\n @if (type === typeField.file) {\r\n <input #fileInput type=\"file\" class=\"field-control\" [id]=\"name\"\r\n [ngClass]=\"[(cssClass || ''), formControl?.value ? 'has-value' : '']\"\r\n [attr.placeholder]=\"placeholder ? (placeholder | translate) : null\" [attr.required]=\"isRequired ? 'required' : null\"\r\n [attr.readonly]=\"isReadonly ? 'readonly' : null\" [disabled]=\"isEffectivelyDisabled\" [attr.aria-required]=\"isRequired\"\r\n [attr.accept]=\"acceptAttr\"\r\n [attr.aria-invalid]=\"control.invalid && control.touched\"\r\n [attr.aria-describedby]=\"getDescribedBy(control)\"\r\n (change)=\"onFileChange($event)\" (focus)=\"onFocus()\" (blur)=\"onBlur()\" />\r\n }\r\n\r\n @if (type === typeField.password) {\r\n <input [type]=\"isPasswordShown ? 'text' : 'password'\" class=\"field-control\" [id]=\"name\" [formControl]=\"formControl\"\r\n [ngClass]=\"[(cssClass || ''), formControl?.value ? 'has-value' : '']\"\r\n [attr.required]=\"isRequired ? 'required' : null\" [attr.readonly]=\"isReadonly ? 'readonly' : null\"\r\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\" [attr.aria-required]=\"isRequired\"\r\n [attr.minlength]=\"minLengthAttr\" [attr.maxlength]=\"maxLengthAttr\" [attr.pattern]=\"patternAttr\"\r\n [attr.autocomplete]=\"autocomplete\"\r\n [attr.aria-invalid]=\"control.invalid && control.touched\"\r\n [attr.aria-describedby]=\"getDescribedBy(control)\"\r\n (focus)=\"onFocus()\" (blur)=\"onBlur()\" />\r\n <cw-button [type]=\"buttonType.ghost\"\r\n cssClass=\"btn-password-field\"\r\n [withIcon]=\"isPasswordShown ? spriteIcon.toolbarHidePassword : spriteIcon.toolbarShowPassword\"\r\n [withOnlyIcon]=\"true\"\r\n [label]=\"isPasswordShown ? '_COMMON._FORM._SHOW_HIDE_PWD.HIDE' : '_COMMON._FORM._SHOW_HIDE_PWD.SHOW'\"\r\n (btnAction)=\"togglePasswordVisibility()\">\r\n </cw-button>\r\n }\r\n\r\n <!-- Textarea -->\r\n @if (type === typeField.textarea) {\r\n <textarea class=\"field-control\" [id]=\"name\" [formControl]=\"formControl\"\r\n [ngClass]=\"[(cssClass || ''), formControl?.value ? 'has-value' : '']\"\r\n [attr.placeholder]=\"placeholder ? (placeholder | translate) : null\" [attr.required]=\"isRequired ? 'required' : null\"\r\n [attr.readonly]=\"isReadonly ? 'readonly' : null\" [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\"\r\n [attr.aria-required]=\"isRequired\" [attr.aria-invalid]=\"control.invalid && control.touched\"\r\n [attr.minlength]=\"minLengthAttr\" [attr.maxlength]=\"maxLengthAttr\" [attr.pattern]=\"patternAttr\"\r\n [attr.autocomplete]=\"autocomplete\"\r\n [attr.aria-describedby]=\"getDescribedBy(control)\"\r\n (focus)=\"onFocus()\" (blur)=\"onBlur()\"></textarea>\r\n }\r\n\r\n <!-- Select -->\r\n @if (type === typeField.select) {\r\n <ng-select [formControl]=\"formControl\" [items]=\"options\" bindLabel=\"label\" [labelForId]=\"name\" [appendTo]=\"appendTo\" bindValue=\"value\"\r\n [ngClass]=\"cssClass\" [searchable]=\"false\" [placeholder]=\"placeholder ? (placeholder | translate) : null\" [readonly]=\"isReadonly\" [clearable]=\"false\"\r\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\" [attr.required]=\"isRequired ? 'required' : null\"\r\n [attr.aria-required]=\"isRequired\" [attr.aria-invalid]=\"control.invalid && control.touched\"\r\n [attr.aria-describedby]=\"getDescribedBy(control)\" [attr.id]=\"name\"\r\n (focus)=\"onFocus()\" (blur)=\"onBlur()\">\r\n\r\n <!-- Template pour les options -->\r\n <ng-template ng-option-tmp let-item=\"item\" let-index=\"index\" let-search=\"searchTerm\">\r\n @if (optionTemplate) {\r\n <ng-container *ngTemplateOutlet=\"optionTemplate; context: { item: item | translate, index: index, searchTerm: search }\"></ng-container>\r\n }\r\n @else {\r\n <div>{{ item.label | translate }}</div>\r\n }\r\n </ng-template>\r\n\r\n <!-- Template pour le label -->\r\n <ng-template ng-label-tmp let-item=\"item\">\r\n @if (labelTemplate) {\r\n <ng-container *ngTemplateOutlet=\"labelTemplate; context: { item: item | translate }\"></ng-container>\r\n }\r\n @else {\r\n {{ (item.label | translate) || (placeholder | translate) }}\r\n }\r\n </ng-template>\r\n </ng-select>\r\n }\r\n\r\n <!-- NgSelect -->\r\n @if (type === typeField.ngSelect || type === typeField.ngSelectMultiple) {\r\n <ng-select [formControl]=\"formControl\" [items]=\"options\" bindLabel=\"label\" [labelForId]=\"name\" [appendTo]=\"appendTo\" bindValue=\"value\"\r\n [multiple]=\"type === typeField.ngSelectMultiple\" [ngClass]=\"cssClass\" [clearable]=\"false\"\r\n [placeholder]=\"placeholder ? (placeholder | translate) : null\" [readonly]=\"isReadonly\"\r\n [notFoundText]=\"'_COMMON.NO_RESULT' | translate\" [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\"\r\n [attr.required]=\"isRequired ? 'required' : null\" [attr.aria-required]=\"isRequired\"\r\n [attr.aria-invalid]=\"control.invalid && control.touched\"\r\n [attr.aria-describedby]=\"getDescribedBy(control)\" [attr.id]=\"name\"\r\n (focus)=\"onFocus()\" (blur)=\"onBlur()\" (search)=\"textChanged.emit($event?.term)\">\r\n\r\n <!-- Template pour les options -->\r\n <ng-template ng-option-tmp let-item=\"item\" let-index=\"index\" let-search=\"searchTerm\">\r\n @if (optionTemplate) {\r\n <ng-container *ngTemplateOutlet=\"optionTemplate; context: { item: item, index: index, searchTerm: search }\"></ng-container>\r\n }\r\n @else {\r\n <div>{{ item.label | translate }}</div>\r\n }\r\n </ng-template>\r\n\r\n <!-- Template pour le label -->\r\n <ng-template ng-label-tmp let-item=\"item\" let-clear=\"clear\">\r\n <span class=\"ng-value-icon left\" (click)=\"clear(item)\" aria-hidden=\"true\">\u00D7</span>\r\n @if (labelTemplate) {\r\n <ng-container *ngTemplateOutlet=\"labelTemplate; context: { item: item | translate }\"></ng-container>\r\n }\r\n @else {\r\n {{ (item.label | translate) || (placeholder | translate) }}\r\n }\r\n </ng-template>\r\n </ng-select>\r\n }\r\n\r\n <!-- Radio -->\r\n @if (type === typeField.radioInline || type === typeField.radio) {\r\n <fieldset\r\n [attr.aria-required]=\"isRequired\"\r\n [attr.aria-invalid]=\"control.invalid && control.touched\"\r\n [attr.aria-describedby]=\"getDescribedBy(control)\">\r\n <legend class=\"field-label\" [class.visually-hidden]=\"!displayLabel\">\r\n {{label | translate}}\r\n @if(isRequired) {\r\n <span class=\"text-danger\">*</span>\r\n }\r\n </legend>\r\n <ul class=\"list-unstyled mb-none\" [ngClass]=\"type === typeField.radioInline ? 'd-flex-h gap-md flex-wrap' : 'd-flex-v'\">\r\n @for (opt of options; track opt.value) {\r\n <li class=\"field-check\">\r\n <input type=\"radio\" [id]=\"name + '_' + opt.value\" [value]=\"opt.value\" [formControl]=\"formControl\"\r\n class=\"field-check-input\" [attr.disabled]=\"(isEffectivelyDisabled || opt.disabled) ? 'disabled' : null\" (change)=\"onRadioChange(opt.value)\" />\r\n <label [for]=\"name + '_' + opt.value\" class=\"field-check-label\">{{ opt.label | translate }}</label>\r\n </li>\r\n }\r\n </ul>\r\n </fieldset>\r\n }\r\n\r\n <!-- Radio button -->\r\n @if (type === typeField.radioButton) {\r\n <fieldset\r\n [attr.aria-required]=\"isRequired\"\r\n [attr.aria-invalid]=\"control.invalid && control.touched\"\r\n [attr.aria-describedby]=\"getDescribedBy(control)\">\r\n <legend class=\"field-label\" [class.visually-hidden]=\"!displayLabel\">\r\n {{label | translate}}\r\n @if(isRequired) {\r\n <span class=\"text-danger\">*</span>\r\n }\r\n </legend>\r\n <div class=\"field-group field-group-btn\">\r\n @for (opt of options; track opt.value) {\r\n <input type=\"radio\" [id]=\"name + '_' + opt.value\" [value]=\"opt.value\" [formControl]=\"formControl\"\r\n class=\"visually-hidden\" [attr.disabled]=\"(isEffectivelyDisabled || opt.disabled) ? 'disabled' : null\" (change)=\"onRadioChange(opt.value)\"/>\r\n <label [for]=\"name + '_' + opt.value\" class=\"btn btn-field-group\">{{ opt.label | translate }}</label>\r\n }\r\n </div>\r\n </fieldset>\r\n }\r\n\r\n <!-- Checkbox Switch -->\r\n @if ( type === typeField.switch || type === typeField.switchSmall)\r\n {\r\n <div class=\"field-check field-switch\" [ngClass]=\"{'field-switch-small': type === typeField.switchSmall}\">\r\n <input type=\"checkbox\" [id]=\"name\" [formControl]=\"formControl\" class=\"field-check-input\" [attr.aria-required]=\"isRequired\"\r\n [attr.aria-invalid]=\"control.invalid && control.touched\"\r\n [attr.aria-describedby]=\"getDescribedBy(control)\"\r\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\"/>\r\n <label [for]=\"name\" class=\"field-check-label\">{{ label | translate }}</label>\r\n </div>\r\n }\r\n\r\n <!-- Checkbox -->\r\n @if (type === typeField.checkboxInline || type === typeField.checkbox) {\r\n @if (isSingleCheckbox()) {\r\n <div class=\"field-check\" [class.field-check-inline]=\"type === typeField.checkboxInline\">\r\n <input #checkboxInput type=\"checkbox\" [id]=\"name\" [formControl]=\"formControl\"\r\n class=\"field-check-input\"\r\n [class.is-invalid]=\"control?.invalid && control?.touched\"\r\n [attr.aria-required]=\"isRequired\"\r\n [attr.aria-invalid]=\"control?.invalid && control?.touched\"\r\n [attr.aria-describedby]=\"getDescribedBy(control)\"\r\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\" />\r\n <label [for]=\"name\" class=\"field-check-label\">\r\n {{ label | translate }}\r\n @if (isRequired) {\r\n <span class=\"text-danger\">*</span>\r\n }\r\n </label>\r\n </div>\r\n }\r\n @else if( options.length > 1) {\r\n <fieldset\r\n [attr.aria-required]=\"isRequired\"\r\n [attr.aria-invalid]=\"control.invalid && control.touched\"\r\n [attr.aria-describedby]=\"getDescribedBy(control)\"\r\n [ngClass]=\"{ 'flex-column': type === typeField.checkbox }\">\r\n <legend class=\"field-label\" [class.visually-hidden]=\"!displayLabel\">\r\n {{label | translate}}\r\n @if(isRequired) {\r\n <span class=\"text-danger\">*</span>\r\n }\r\n </legend>\r\n <ul class=\"list-unstyled mb-none\" [ngClass]=\"type === typeField.checkboxInline ? 'd-flex-h gap-md' : 'd-flex-v'\">\r\n @for (opt of options; track opt.value) {\r\n <li class=\"field-check\" [ngClass]=\"{ 'field-check-inline': type === typeField.checkboxInline }\">\r\n <input type=\"checkbox\" [id]=\"name + '_' + opt.value\" [value]=\"opt.value\" (change)=\"onCheckboxChange($event)\"\r\n [checked]=\"control.value?.includes(opt.value)\" class=\"field-check-input\"\r\n [attr.disabled]=\"(isEffectivelyDisabled || opt.disabled) ? 'disabled' : null\" />\r\n <label [for]=\"name + '_' + opt.value\" class=\"field-check-label\">\r\n {{ opt.label | translate }}\r\n </label>\r\n </li>\r\n }\r\n </ul>\r\n </fieldset>\r\n }\r\n @else {\r\n <fieldset>\r\n <legend class=\"field-label\" [class.visually-hidden]=\"!displayLabel\">\r\n {{label | translate}}\r\n </legend>\r\n <ul class=\"list-unstyled mb-none\" [ngClass]=\"type === typeField.checkboxInline ? 'd-flex-h gap-md' : 'd-flex-v'\">\r\n @for (opt of options; track opt.value) {\r\n <li class=\"field-check\" [ngClass]=\"{ 'field-check-inline': type === typeField.checkboxInline }\">\r\n <input type=\"checkbox\" [id]=\"name + '_' + opt.value\" [value]=\"opt.value\" (change)=\"onCheckboxChange($event)\"\r\n [checked]=\"control.value?.includes(opt.value)\" class=\"field-check-input\"\r\n [attr.aria-required]=\"isRequired\"\r\n [attr.aria-invalid]=\"control.invalid && control.touched\"\r\n [attr.aria-describedby]=\"getDescribedBy(control)\"\r\n [attr.disabled]=\"(isEffectivelyDisabled || opt.disabled) ? 'disabled' : null\" />\r\n <label [for]=\"name + '_' + opt.value\" class=\"field-check-label\">\r\n {{ opt.label | translate }}\r\n @if(isRequired) {\r\n <span class=\"text-danger\">*</span>\r\n }\r\n </label>\r\n </li>\r\n }\r\n </ul>\r\n </fieldset>\r\n }\r\n }\r\n\r\n <!-- Checkbox button -->\r\n @if (type === typeField.checkboxButton && options.length > 0) {\r\n\r\n @if(options.length > 1) {\r\n <fieldset\r\n [attr.aria-required]=\"isRequired\"\r\n [attr.aria-invalid]=\"control.invalid && control.touched\"\r\n [attr.aria-describedby]=\"getDescribedBy(control)\">\r\n <legend class=\"field-label\" [class.visually-hidden]=\"!displayLabel\">\r\n {{label | translate}}\r\n @if(isRequired) {\r\n <span class=\"text-danger\">*</span>\r\n }\r\n </legend>\r\n <div class=\"field-group field-group-btn\">\r\n @for (opt of options; track opt.value) {\r\n <input type=\"checkbox\" [id]=\"name + '_' + opt.value\" [value]=\"opt.value\" (change)=\"onCheckboxChange($event)\"\r\n [checked]=\"control.value?.includes(opt.value)\" class=\"visually-hidden\"\r\n [attr.disabled]=\"(isEffectivelyDisabled || opt.disabled) ? 'disabled' : null\" />\r\n <label [for]=\"name + '_' + opt.value\" class=\"btn btn-field-group\">{{ opt.label | translate }}</label>\r\n }\r\n </div>\r\n </fieldset>\r\n }\r\n @else {\r\n <fieldset>\r\n <legend class=\"field-label\" [class.visually-hidden]=\"!displayLabel\">\r\n {{label | translate}}\r\n </legend>\r\n <div class=\"btn-group btn-group-secondary\">\r\n @for (opt of options; track opt.value) {\r\n <input type=\"checkbox\" [id]=\"name + '_' + opt.value\" [value]=\"opt.value\" (change)=\"onCheckboxChange($event)\"\r\n [checked]=\"control.value?.includes(opt.value)\" class=\"visually-hidden\"\r\n [attr.aria-required]=\"isRequired\"\r\n [attr.aria-invalid]=\"control.invalid && control.touched\"\r\n [attr.aria-describedby]=\"getDescribedBy(control)\"\r\n [attr.disabled]=\"(isEffectivelyDisabled || opt.disabled) ? 'disabled' : null\"/>\r\n <label [for]=\"name + '_' + opt.value\" class=\"btn btn-field-group\">\r\n {{ opt.label | translate}}\r\n @if(isRequired) {\r\n <span class=\"text-danger\">*</span>\r\n }\r\n </label>\r\n }\r\n </div>\r\n </fieldset>\r\n }\r\n }\r\n\r\n <!-- Period - DateToDate / TimeToTime / DateTimeToDateTime -->\r\n @if ([typeField.dateToDate, typeField.timeToTime, typeField.dateTimeToDateTime].includes(type) && isRange) {\r\n\r\n <div class=\"field-group\">\r\n <div class=\"field-group-addon-left\">Du</div>\r\n <input [type]=\"getInputType()\" class=\"field-control\" [id]=\"name + '_start'\" [formControl]=\"getControl('start')\"\r\n [attr.placeholder]=\"type === typeField.timeToTime ? ('_COMMON._DATES.FROM' | translate) : ('_COMMON._DATES.FROM_TO_1' | translate)\"\r\n [ngClass]=\"[(cssClass || ''), getControl('start')?.value ? 'has-value' : '']\"\r\n [attr.required]=\"isRequired ? 'required' : null\" [attr.readonly]=\"isReadonly ? 'readonly' : null\"\r\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\" [attr.aria-required]=\"isRequired\"\r\n [attr.min]=\"minStartAttr\" [attr.max]=\"maxStartAttr\" [attr.step]=\"stepAttr\"\r\n [attr.autocomplete]=\"autocomplete\"\r\n [attr.aria-invalid]=\"getControl('start')?.invalid && getControl('start')?.touched\"\r\n [attr.aria-describedby]=\"getDescribedBy(getControl('start'))\"\r\n (focus)=\"onFocusRange('start')\" />\r\n\r\n @if(getControl('start')?.value && !isDisabledOrReadonly) {\r\n <button type=\"button\" class=\"btn btn-secondary btn-clear-field\"\r\n (click)=\"onClearFieldPeriod('start')\">\r\n &times;\r\n </button>\r\n }\r\n <div class=\"field-group-addon-center\">au</div>\r\n <input [type]=\"getInputType()\" class=\"field-control\" [id]=\"name + '_end'\" [formControl]=\"getControl('end')\"\r\n [attr.placeholder]=\"type === typeField.timeToTime ? ('_COMMON._DATES.TO' | translate) : ('_COMMON._DATES.FROM_TO_2' | translate)\"\r\n [ngClass]=\"[(cssClass || ''), getControl('end')?.value ? 'has-value' : '']\"\r\n [attr.required]=\"isRequired ? 'required' : null\" [attr.readonly]=\"isReadonly ? 'readonly' : null\"\r\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\"\r\n [attr.min]=\"minEndAttr\" [attr.max]=\"maxEndAttr\" [attr.step]=\"stepAttr\"\r\n [attr.autocomplete]=\"autocomplete\"\r\n [attr.aria-invalid]=\"getControl('end')?.invalid && getControl('end')?.touched\"\r\n [attr.aria-describedby]=\"getDescribedBy(getControl('end'))\"\r\n (focus)=\"onFocusRange('end')\" />\r\n\r\n @if(getControl('end')?.value && !isDisabledOrReadonly) {\r\n <button type=\"button\" class=\"btn btn-ghost btn-clear-field\"\r\n (click)=\"onClearFieldPeriod('end')\">\r\n &times;\r\n </button>\r\n }\r\n </div>\r\n }\r\n\r\n @if ([typeField.datePlusOne, typeField.datePlusTwo, typeField.datePlusSeven, typeField.dateComplexe].includes(type)) {\r\n\r\n <div class=\"field-group\">\r\n @if (type === typeField.dateComplexe) {\r\n <div class=\"field-group-addon-left\">\r\n <button class=\"btn btn-ghost\" type=\"button\" (click)=\"onDateAddDay('prev')\"\r\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\">\r\n <cw-icon font=\"optyweb\" [icon]=\"spriteIcon.nextLeft\" [label]=\"'Jour pr\u00E9c\u00E9dent'\"></cw-icon>\r\n </button>\r\n </div>\r\n }\r\n\r\n <input type=\"date\" class=\"field-control\" [id]=\"name\" [formControl]=\"formControl\"\r\n [ngClass]=\"[(cssClass || ''), formControl?.value ? 'has-value' : '']\"\r\n [attr.placeholder]=\"placeholder ? placeholder : null\" [attr.required]=\"isRequired ? 'required' : null\"\r\n [attr.readonly]=\"isReadonly ? 'readonly' : null\" [attr.aria-required]=\"isRequired\"\r\n [attr.min]=\"minAttr\" [attr.max]=\"maxAttr\" [attr.step]=\"stepAttr\"\r\n [attr.autocomplete]=\"autocomplete\"\r\n [attr.aria-invalid]=\"control.invalid && control.touched\"\r\n [attr.aria-describedby]=\"getDescribedBy(control)\"\r\n (focus)=\"onFocus()\" (blur)=\"onBlur()\" />\r\n\r\n @if(formControl?.value && !isDisabledOrReadonly) {\r\n <button class=\"btn btn-ghost btn-clear-field\" type=\"button\"\r\n (click)=\"onClearField(formControl)\">&times;</button>\r\n }\r\n\r\n\r\n @if (type === typeField.dateComplexe) {\r\n <div class=\"field-group-addon-right\">\r\n <button class=\"btn btn-ghost\" type=\"button\" (click)=\"onDateAddDay('next')\"\r\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\">\r\n <cw-icon font=\"optyweb\" [icon]=\"spriteIcon.nextRight\" [label]=\"'Jour suivant'\"></cw-icon>\r\n </button>\r\n </div>\r\n <div class=\"field-group-addon-right\">\r\n <button class=\"btn btn-ghost\" type=\"button\" (click)=\"onRefresh()\"\r\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\">\r\n <cw-icon font=\"optyweb\" [icon]=\"spriteIcon.toolbarRefresh\" [label]=\"'Rafra\u00EEchir'\"></cw-icon>\r\n </button>\r\n </div>\r\n }\r\n\r\n <div class=\"field-group-addon-right\">\r\n <button class=\"btn btn-ghost\" type=\"button\" (click)=\"onTodayAddDay(0)\"\r\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\">\r\n J\r\n <span class=\"visually-hidden\">Aujourd'hui</span>\r\n </button>\r\n </div>\r\n <div class=\"field-group-addon-right\">\r\n <button class=\"btn btn-ghost\" type=\"button\" (click)=\"onTodayAddDay(1)\"\r\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\">\r\n J+1\r\n <span class=\"visually-hidden\">Demain</span>\r\n </button>\r\n </div>\r\n\r\n @if (type !== typeField.datePlusOne && type !== typeField.dateComplexe) {\r\n <div class=\"field-group-addon-right\">\r\n <button class=\"btn btn-ghost \" type=\"button\" (click)=\"onTodayAddDay(2)\"\r\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\">\r\n J+2\r\n <span class=\"visually-hidden\">Dans 2 jours</span>\r\n </button>\r\n </div>\r\n\r\n @if (type !== typeField.datePlusTwo) {\r\n <div class=\"field-group-addon-right\">\r\n <button class=\"btn btn-ghost\" type=\"button\" (click)=\"onTodayAddDay(7)\"\r\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\">\r\n J+7\r\n <span class=\"visually-hidden\">Dans 7 jours</span>\r\n </button>\r\n </div>\r\n }\r\n }\r\n </div>\r\n }\r\n\r\n @if (type === typeField.slider) {\r\n <ngx-slider [(value)]=\"sliderValue\" [options]=\"sliderOptions\" [formControl]=\"formControl\"></ngx-slider>\r\n }\r\n\r\n @if (type === typeField.range) {\r\n <div class=\"slider\">\r\n\r\n <cw-button [isDisabled]=\"formControl.value <= rangeOptions.floor\" [label]=\"'Diminuer ' + formControl.value + ' ' + label\"\r\n [withIcon]=\"spriteIcon.toolbarMinus\" [withOnlyIcon]=\"true\" [type]=\"buttonType.primary\"\r\n [iconSize]=\"buttonIconSize.small\" (btnAction)=\"onRangeStep('decrease')\">\r\n </cw-button>\r\n\r\n <div class=\"slider-input\">\r\n <label [for]=\"name\" class=\"slider-tooltip\" [style.left]=\"getRangePercent() + '%'\" aria-live=\"polite\"\r\n aria-atomic=\"true\">\r\n {{ label | translate }} {{ formControl.value }}\r\n @if (rangeOptions.unit) {\r\n <abbr [title]=\"rangeOptions.unit\">{{ rangeOptions.unit }}</abbr>\r\n }\r\n </label>\r\n\r\n <div class=\"slider-custom-bar\">\r\n <div class=\"slider-custom-bar-selection\" [style.width]=\"getRangePercent() + '%'\">\r\n </div>\r\n </div>\r\n\r\n <input type=\"range\" [id]=\"name\" [formControl]=\"formControl\" [min]=\"rangeOptions.floor\" [max]=\"rangeOptions.ceil\"\r\n [step]=\"rangeOptions.step || 1\" class=\"field-control-range\" [attr.aria-required]=\"isRequired\"\r\n [attr.aria-invalid]=\"control.invalid && control.touched\">\r\n </div>\r\n\r\n <cw-button [isDisabled]=\"formControl.value >= rangeOptions.ceil\" [label]=\"'Augmenter ' + formControl.value + ' ' + label\"\r\n [withIcon]=\"spriteIcon.toolbarPlus\" [withOnlyIcon]=\"true\" [type]=\"buttonType.primary\"\r\n [iconSize]=\"buttonIconSize.small\" (btnAction)=\"onRangeStep('increase')\">\r\n </cw-button>\r\n </div>\r\n }\r\n\r\n @if (isInInputGroup() && clearable && !isDisabledOrReadonly && type !== typeField.autocompleteMultiple) {\r\n @if (type === typeField.autocomplete) {\r\n @if (autocompleteRef()?.hasAnyContent()) {\r\n <button class=\"btn btn-secondary btn-clear-field\" type=\"button\"\r\n (click)=\"onClearAutocomplete()\">&times;</button>\r\n }\r\n } @else if (type === typeField.ngSelectMultiple) {\r\n <!-- value est un tableau : un [] vide \u00E9tant truthy, on teste .length pour n'afficher le clear global que s'il y a au moins une s\u00E9lection. -->\r\n @if (formControl?.value?.length) {\r\n <button class=\"btn btn-ghost btn-clear-field\" type=\"button\"\r\n (click)=\"onClearField(formControl)\">&times;</button>\r\n }\r\n } @else {\r\n @if(formControl?.value) {\r\n <button class=\"btn btn-ghost btn-clear-field\" type=\"button\"\r\n (click)=\"onClearField(formControl)\">&times;</button>\r\n }\r\n }\r\n }\r\n\r\n</ng-template>\r\n" }]
3573
3906
  }], ctorParameters: () => [], propDecorators: { control: [{
3574
3907
  type: Input
3575
3908
  }], formGroup: [{
@@ -3594,6 +3927,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.20", ngImpo
3594
3927
  type: Input
3595
3928
  }], autocompleteOptions: [{
3596
3929
  type: Input
3930
+ }], richTextOptions: [{
3931
+ type: Input
3597
3932
  }], errorMessages: [{
3598
3933
  type: Input
3599
3934
  }], isRequired: [{
@@ -3651,6 +3986,26 @@ var LegendTypeEnum;
3651
3986
  LegendTypeEnum["badge"] = "badge";
3652
3987
  LegendTypeEnum["color"] = "color";
3653
3988
  })(LegendTypeEnum || (LegendTypeEnum = {}));
3989
+ /**
3990
+ * Couleur predefinie d'une entree de legende (`DataLegend.colorUi`).
3991
+ * type `icon` -> classe `text-{valeur}` ; type `color` -> classe `legend-{valeur}`.
3992
+ *
3993
+ * Remplace l'ancien `UiTypeEnum` (qui se voulait un type UI "standard" transverse,
3994
+ * notion abandonnee) : la legende porte desormais son propre enum.
3995
+ */
3996
+ var LegendColorEnum;
3997
+ (function (LegendColorEnum) {
3998
+ LegendColorEnum["primary"] = "primary";
3999
+ LegendColorEnum["secondary"] = "secondary";
4000
+ LegendColorEnum["light"] = "light";
4001
+ LegendColorEnum["info"] = "info";
4002
+ LegendColorEnum["success"] = "success";
4003
+ LegendColorEnum["warning"] = "warning";
4004
+ LegendColorEnum["danger"] = "danger";
4005
+ LegendColorEnum["link"] = "link";
4006
+ LegendColorEnum["dark"] = "dark";
4007
+ LegendColorEnum["custom"] = "custom";
4008
+ })(LegendColorEnum || (LegendColorEnum = {}));
3654
4009
 
3655
4010
  class LegendComponent {
3656
4011
  constructor() {
@@ -3659,11 +4014,11 @@ class LegendComponent {
3659
4014
  this.legendTypeEnum = LegendTypeEnum;
3660
4015
  }
3661
4016
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: LegendComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
3662
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.20", type: LegendComponent, isStandalone: true, selector: "cw-legend", inputs: { legend: { classPropertyName: "legend", publicName: "legend", isSignal: true, isRequired: true, transformFunction: null }, displayInline: { classPropertyName: "displayInline", publicName: "displayInline", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "@if (legend().title) {\n <div class=\"legend-title\">\n {{ '_COMMON._TABLE.LEGEND' | translate }}\n </div>\n}\n\n<ul class=\"legend-items\" [class.list-inline]=\"displayInline()\">\n @for (item of legend().data; track $index) {\n <li class=\"legend-item\" [class.list-inline-item]=\"displayInline()\">\n @switch (item.type) {\n @case (legendTypeEnum.icon) {\n <cw-icon [icon]=\"item.icon\" [label]=\"item.label\" [iconCssClass]=\"'text-' + item.colorUi\" [iconColorCustom]=\"item.colorCustom\"></cw-icon>\n }\n @case (legendTypeEnum.badge) {\n <cw-badge [type]=\"item.colorBadge\" [label]=\"item.labelBadge\"></cw-badge>\n {{item.label}}\n }\n @case (legendTypeEnum.color) {\n <span class=\"legend-item-color\" [ngClass]=\"item.colorUi ?'legend-' + item.colorUi : ''\" [style.background-color]=\"item.colorCustom\"></span>\n {{item.label}}\n }\n }\n </li>\n }\n</ul>\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "component", type: IconComponent, selector: "cw-icon", inputs: ["icon", "label", "type", "iconSize", "iconCssClass", "iconUiType", "iconColorCustom", "spritePath"] }, { kind: "component", type: BadgeComponent, selector: "cw-badge", inputs: ["type", "label", "withIcon", "iconPosition", "cssClass", "skeletonMode", "dataTest"] }, { kind: "ngmodule", type: TranslateModule }, { kind: "pipe", type: i2.TranslatePipe, name: "translate" }] }); }
4017
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.20", type: LegendComponent, isStandalone: true, selector: "cw-legend", inputs: { legend: { classPropertyName: "legend", publicName: "legend", isSignal: true, isRequired: true, transformFunction: null }, displayInline: { classPropertyName: "displayInline", publicName: "displayInline", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "@if (legend().title) {\n <div class=\"legend-title\">\n {{ '_COMMON._TABLE.LEGEND' | translate }}\n </div>\n}\n\n<ul class=\"legend-items\" [class.list-inline]=\"displayInline()\">\n @for (item of legend().data; track $index) {\n <li class=\"legend-item\" [class.list-inline-item]=\"displayInline()\">\n @switch (item.type) {\n @case (legendTypeEnum.icon) {\n <cw-icon [icon]=\"item.icon\" [label]=\"item.label\" [iconCssClass]=\"'text-' + item.colorUi\" [iconColorCustom]=\"item.colorCustom\"></cw-icon>\n }\n @case (legendTypeEnum.badge) {\n <cw-badge [type]=\"item.colorBadge\" [label]=\"item.labelBadge\"></cw-badge>\n {{item.label}}\n }\n @case (legendTypeEnum.color) {\n <span class=\"legend-item-color\" [ngClass]=\"item.colorUi ?'legend-' + item.colorUi : ''\" [style.background-color]=\"item.colorCustom\"></span>\n {{item.label}}\n }\n }\n </li>\n }\n</ul>\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "component", type: IconComponent, selector: "cw-icon", inputs: ["icon", "label", "type", "iconSize", "iconCssClass", "iconUiType", "iconColorCustom", "spritePath"] }, { kind: "component", type: BadgeComponent, selector: "cw-badge", inputs: ["type", "label", "withIcon", "iconPosition", "cssClass", "skeletonMode", "dataTest"] }, { kind: "ngmodule", type: TranslateModule }, { kind: "pipe", type: i2.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
3663
4018
  }
3664
4019
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: LegendComponent, decorators: [{
3665
4020
  type: Component,
3666
- args: [{ selector: 'cw-legend', standalone: true, imports: [
4021
+ args: [{ selector: 'cw-legend', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, imports: [
3667
4022
  CommonModule,
3668
4023
  IconComponent,
3669
4024
  BadgeComponent,
@@ -3683,11 +4038,11 @@ class LoaderComponent {
3683
4038
  this.displayText = input(true, ...(ngDevMode ? [{ debugName: "displayText" }] : []));
3684
4039
  }
3685
4040
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: LoaderComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
3686
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.20", type: LoaderComponent, isStandalone: true, selector: "cw-loader", inputs: { size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, displayText: { classPropertyName: "displayText", publicName: "displayText", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<div class=\"d-flex-v gap-md loader items-center\" [ngClass]=\"'loader-' + size()\">\n <span class=\"spinner-border\" aria-hidden=\"true\"></span>\n @if (displayText()) {\n <span role=\"status\">{{ '_COMMON._HTTP.TXT_LOADING' | translate }}</span>\n }\n</div>\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "ngmodule", type: TranslateModule }, { kind: "pipe", type: i2.TranslatePipe, name: "translate" }] }); }
4041
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.20", type: LoaderComponent, isStandalone: true, selector: "cw-loader", inputs: { size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, displayText: { classPropertyName: "displayText", publicName: "displayText", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<div class=\"d-flex-v gap-md loader items-center\" [ngClass]=\"'loader-' + size()\">\n <span class=\"spinner-border\" aria-hidden=\"true\"></span>\n @if (displayText()) {\n <span role=\"status\">{{ '_COMMON._HTTP.TXT_LOADING' | translate }}</span>\n }\n</div>\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "ngmodule", type: TranslateModule }, { kind: "pipe", type: i2.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
3687
4042
  }
3688
4043
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: LoaderComponent, decorators: [{
3689
4044
  type: Component,
3690
- args: [{ selector: 'cw-loader', standalone: true, imports: [
4045
+ args: [{ selector: 'cw-loader', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, imports: [
3691
4046
  CommonModule,
3692
4047
  TranslateModule
3693
4048
  ], template: "<div class=\"d-flex-v gap-md loader items-center\" [ngClass]=\"'loader-' + size()\">\n <span class=\"spinner-border\" aria-hidden=\"true\"></span>\n @if (displayText()) {\n <span role=\"status\">{{ '_COMMON._HTTP.TXT_LOADING' | translate }}</span>\n }\n</div>\n" }]
@@ -3762,7 +4117,11 @@ class ModalsService {
3762
4117
  }
3763
4118
  }
3764
4119
  }
4120
+ // `reject` de CETTE modale, appele uniquement quand elle est fermee (voir closeModal),
4121
+ // et non via un emetteur partage qui rejetterait aussi les modales encore ouvertes.
4122
+ let dismissReject = () => { };
3765
4123
  const resultPromise = new Promise((resolve, reject) => {
4124
+ dismissReject = reject;
3766
4125
  const subAction = componentRef.instance.btnAction1.subscribe((data) => {
3767
4126
  subAction.unsubscribe();
3768
4127
  resolve(data || 'confirm');
@@ -3771,17 +4130,13 @@ class ModalsService {
3771
4130
  subAction2.unsubscribe();
3772
4131
  resolve(data || 'confirm');
3773
4132
  });
3774
- const subDismiss = this.dismissModal.subscribe(() => {
3775
- subDismiss.unsubscribe();
3776
- reject('closed');
3777
- });
3778
4133
  });
3779
4134
  const domElem = componentRef.hostView.rootNodes[0];
3780
4135
  document.body.appendChild(domElem);
3781
4136
  this.appRef.attachView(componentRef.hostView);
3782
4137
  document.body.classList.add('modal-open');
3783
4138
  this.saveFocus();
3784
- this.modalsStack.push(componentRef);
4139
+ this.modalsStack.push({ ref: componentRef, reject: dismissReject });
3785
4140
  return {
3786
4141
  componentInstance: componentRef.instance,
3787
4142
  result: resultPromise,
@@ -3796,13 +4151,18 @@ class ModalsService {
3796
4151
  closeModal() {
3797
4152
  const currentModal = this.modalsStack.pop();
3798
4153
  if (currentModal) {
3799
- const modalClass = currentModal.instance.customClass() ?? '';
3800
- this.appRef.detachView(currentModal.hostView);
3801
- currentModal.destroy();
4154
+ const modalClass = currentModal.ref.instance.customClass() ?? '';
4155
+ this.appRef.detachView(currentModal.ref.hostView);
4156
+ currentModal.ref.destroy();
3802
4157
  if (this.modalsStack.length === 0) {
3803
4158
  document.body.classList.remove('modal-open');
3804
4159
  }
3805
4160
  this.restoreFocus();
4161
+ // Rejette la promesse `result` de la SEULE modale fermee (no-op si deja resolue via btnAction).
4162
+ // Error (et non string) : respecte la convention de rejet de promesse ; message 'closed' conserve
4163
+ // pour distinguer une fermeture d'une vraie erreur cote consommateur.
4164
+ currentModal.reject(new Error('closed'));
4165
+ // Conserve pour les abonnes externes de `dismissModal` (compat) : classe CSS de la modale fermee.
3806
4166
  this.dismissModal.emit(modalClass);
3807
4167
  }
3808
4168
  }
@@ -3844,7 +4204,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.20", ngImpo
3844
4204
  class ModalsComponent {
3845
4205
  constructor() {
3846
4206
  this.modalService = inject(ModalsService);
3847
- this.translateService = inject(TranslateService);
4207
+ this.renderer = inject(Renderer2);
4208
+ this.destroyRef = inject(DestroyRef);
3848
4209
  this.modalContainer = viewChild.required('modalContainer');
3849
4210
  this.size = input(ModalsSize.md, ...(ngDevMode ? [{ debugName: "size" }] : []));
3850
4211
  this.customClass = input('', ...(ngDevMode ? [{ debugName: "customClass" }] : []));
@@ -3855,7 +4216,7 @@ class ModalsComponent {
3855
4216
  this.textType = input(...(ngDevMode ? [undefined, { debugName: "textType" }] : []));
3856
4217
  this.modalTitle = input(...(ngDevMode ? [undefined, { debugName: "modalTitle" }] : []));
3857
4218
  this.itemsToDelete = input([], ...(ngDevMode ? [{ debugName: "itemsToDelete" }] : []));
3858
- this.itemsToDeleteTitle = input(this.translateService.instant('_COMMON._MODAL_DELETE.DEFAULT_TYPE'), ...(ngDevMode ? [{ debugName: "itemsToDeleteTitle" }] : []));
4219
+ this.itemsToDeleteTitle = input('_COMMON._MODAL_DELETE.DEFAULT_TYPE', ...(ngDevMode ? [{ debugName: "itemsToDeleteTitle" }] : []));
3859
4220
  this.labelBtnAction1 = input(...(ngDevMode ? [undefined, { debugName: "labelBtnAction1" }] : []));
3860
4221
  this.labelBtnAction2 = input(...(ngDevMode ? [undefined, { debugName: "labelBtnAction2" }] : []));
3861
4222
  this.disableBtnAction1 = input(false, ...(ngDevMode ? [{ debugName: "disableBtnAction1" }] : []));
@@ -3934,21 +4295,27 @@ class ModalsComponent {
3934
4295
  }
3935
4296
  trapFocus(element) {
3936
4297
  const focusableSelector = 'a[href], button:not([disabled]), textarea, input:not([disabled]), select';
3937
- const focusableEls = Array.from(element.querySelectorAll(focusableSelector));
3938
- if (focusableEls.length === 0)
4298
+ const initialEls = Array.from(element.querySelectorAll(focusableSelector));
4299
+ if (initialEls.length === 0)
3939
4300
  return;
3940
- const firstFocusableEl = focusableEls[0];
3941
- const lastFocusableEl = focusableEls[focusableEls.length - 1];
3942
- const autocompleteInput = focusableEls.find(x => x.getAttribute('aria-controls') === 'autocompletion-panel');
4301
+ const autocompleteInput = initialEls.find(x => x.getAttribute('aria-controls') === 'autocompletion-panel');
3943
4302
  if (autocompleteInput && this.isAutcompModal()) {
3944
4303
  autocompleteInput.focus();
3945
4304
  }
3946
4305
  else {
3947
- firstFocusableEl.focus();
4306
+ initialEls[0].focus();
3948
4307
  }
3949
- element.addEventListener('keydown', (e) => {
4308
+ // Listener enregistre via Renderer2 + teardown DestroyRef (auparavant addEventListener
4309
+ // jamais retire). Les focusables sont recalcules a chaque Tab : le contenu de la modale
4310
+ // peut changer apres l'ouverture (auparavant fige a l'ouverture).
4311
+ const unlisten = this.renderer.listen(element, 'keydown', (e) => {
3950
4312
  if (e.key !== 'Tab')
3951
4313
  return;
4314
+ const focusableEls = Array.from(element.querySelectorAll(focusableSelector));
4315
+ if (focusableEls.length === 0)
4316
+ return;
4317
+ const firstFocusableEl = focusableEls[0];
4318
+ const lastFocusableEl = focusableEls[focusableEls.length - 1];
3952
4319
  if (e.shiftKey) {
3953
4320
  if (document.activeElement === firstFocusableEl) {
3954
4321
  lastFocusableEl.focus();
@@ -3962,13 +4329,14 @@ class ModalsComponent {
3962
4329
  }
3963
4330
  }
3964
4331
  });
4332
+ this.destroyRef.onDestroy(unlisten);
3965
4333
  }
3966
4334
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: ModalsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
3967
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.20", type: ModalsComponent, isStandalone: true, selector: "cw-modals", inputs: { size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, customClass: { classPropertyName: "customClass", publicName: "customClass", isSignal: true, isRequired: false, transformFunction: null }, scrollable: { classPropertyName: "scrollable", publicName: "scrollable", isSignal: true, isRequired: false, transformFunction: null }, isAutcompModal: { classPropertyName: "isAutcompModal", publicName: "isAutcompModal", isSignal: true, isRequired: false, transformFunction: null }, type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: true, transformFunction: null }, state: { classPropertyName: "state", publicName: "state", isSignal: true, isRequired: false, transformFunction: null }, textType: { classPropertyName: "textType", publicName: "textType", isSignal: true, isRequired: false, transformFunction: null }, modalTitle: { classPropertyName: "modalTitle", publicName: "modalTitle", isSignal: true, isRequired: false, transformFunction: null }, itemsToDelete: { classPropertyName: "itemsToDelete", publicName: "itemsToDelete", isSignal: true, isRequired: false, transformFunction: null }, itemsToDeleteTitle: { classPropertyName: "itemsToDeleteTitle", publicName: "itemsToDeleteTitle", isSignal: true, isRequired: false, transformFunction: null }, labelBtnAction1: { classPropertyName: "labelBtnAction1", publicName: "labelBtnAction1", isSignal: true, isRequired: false, transformFunction: null }, labelBtnAction2: { classPropertyName: "labelBtnAction2", publicName: "labelBtnAction2", isSignal: true, isRequired: false, transformFunction: null }, disableBtnAction1: { classPropertyName: "disableBtnAction1", publicName: "disableBtnAction1", isSignal: true, isRequired: false, transformFunction: null }, disableBtnAction2: { classPropertyName: "disableBtnAction2", publicName: "disableBtnAction2", isSignal: true, isRequired: false, transformFunction: null }, customBodyTemplate: { classPropertyName: "customBodyTemplate", publicName: "customBodyTemplate", isSignal: true, isRequired: false, transformFunction: null }, customBodyContext: { classPropertyName: "customBodyContext", publicName: "customBodyContext", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { btnAction1: "btnAction1", btnAction2: "btnAction2" }, viewQueries: [{ propertyName: "modalContainer", first: true, predicate: ["modalContainer"], descendants: true, isSignal: true }], ngImport: i0, template: "<div class=\"cityway-v8 modal-backdrop fade show\" style=\"z-index: 1050;\" aria-hidden=\"true\"></div>\n\n<div role=\"dialog\" tabindex=\"-1\" aria-modal=\"true\" aria-labelledby=\"modal-basic-title\"\n class=\"cityway-v8 d-flex modal show\" [ngClass]=\"customClass()\" data-test-ctw=\"modal\" (keydown)=\"onKeyDown($event)\">\n\n <div class=\"modal-inner-backdrop\" (click)=\"type() !== modalsType.loader && closeModal()\"></div>\n\n <div #modalContainer role=\"document\" class=\"modal-dialog modal-dialog-centered\"\n [ngClass]=\"['modal-' + size(), scrollable() ? 'modal-dialog-scrollable' : '']\">\n\n <div class=\"modal-content\">\n\n @if (type() === modalsType.loader) {\n <div class=\"modal-body\">\n <cw-loader></cw-loader>\n </div>\n }\n @else {\n @if (isStateLike()) {\n <!-- state + delete : close en absolu (top-right, hors flux donc ne reserve\n pas de hauteur), body centre avec le picto de statut EN TETE du flux\n (il pousse donc le titre normalement) -->\n <button type=\"button\" class=\"btn-close modal-close-floating\" [attr.aria-label]=\"'_COMMON._ACTION.CLOSE' | translate\"\n (click)=\"closeModal()\" data-test-ctw=\"btn-close-modal\">\n <cw-icon [icon]=\"spriteIcon.toolbarClose\" [iconSize]=\"iconSize['lg']\" [type]=\"iconType.default\" aria-hidden=\"true\"></cw-icon>\n </button>\n\n <div class=\"modal-body modal-body-state d-flex-v gap-md items-center\" [class.modal-text-center]=\"isBodyCentered()\">\n <cw-icon [icon]=\"statusIcon()\" [iconSize]=\"iconSize['xl']\" [type]=\"iconType.square\"\n [iconUiType]=\"statusUiType()\" aria-hidden=\"true\"></cw-icon>\n\n <h1 class=\"modal-title\" id=\"modal-basic-title\">\n @if (type() === modalsType.delete) {\n {{ '_COMMON._MODAL_DELETE.TITLE' | translate: { number: itemsToDelete().length, name: itemsToDeleteTitle() | translate } }}\n }\n @else {\n {{ modalTitle() | translate }}\n }\n </h1>\n\n @if (type() === modalsType.delete) {\n <!-- zone delete en dur : texte + liste + avertissement, pleine largeur aligne a gauche -->\n <div class=\"w-100 d-flex-v gap-md\">\n @if (itemsToDelete().length > 1) {\n <div [innerHTML]=\"'_COMMON._MODAL_DELETE.MULTIPLE_TEXT' | translate\"></div>\n }\n @else {\n <div [innerHTML]=\"'_COMMON._MODAL_DELETE.SIMPLE_TEXT' | translate\"></div>\n }\n\n @if (itemsToDelete().length > 0) {\n <ul class=\"mb-none\">\n @for (item of itemsToDelete(); track item) {\n <li>{{ item }}</li>\n }\n </ul>\n }\n\n <div [innerHTML]=\"'_COMMON._MODAL_DELETE.IRREVERSIBLE' | translate\"></div>\n </div>\n }\n\n @if (customBodyTemplate()) {\n <div class=\"w-100\">\n <ng-container [ngTemplateOutlet]=\"customBodyTemplate()\" [ngTemplateOutletContext]=\"customBodyContext()\">\n </ng-container>\n </div>\n }\n </div>\n }\n @else {\n <!-- default + sidepanel : header titre + close, body = contenu libre (slot) -->\n <div class=\"modal-header\">\n <h1 class=\"modal-title\" id=\"modal-basic-title\">\n {{ modalTitle() | translate }}\n </h1>\n\n <button type=\"button\" class=\"btn-close\" [attr.aria-label]=\"'_COMMON._ACTION.CLOSE' | translate\"\n (click)=\"closeModal()\" data-test-ctw=\"btn-close-modal\">\n <cw-icon [icon]=\"spriteIcon.toolbarClose\" [iconSize]=\"iconSize['lg']\" [type]=\"iconType.default\" aria-hidden=\"true\"></cw-icon>\n </button>\n </div>\n\n <div class=\"modal-body d-flex-v gap-md\">\n @if (customBodyTemplate()) {\n <ng-container [ngTemplateOutlet]=\"customBodyTemplate()\" [ngTemplateOutletContext]=\"customBodyContext()\">\n </ng-container>\n }\n </div>\n }\n\n <!-- footer commun : secondaire a gauche, primaire/danger a droite (ordre DS) -->\n <div class=\"modal-footer\">\n @if (type() === modalsType.delete) {\n <cw-button label=\"_COMMON._ACTION.CLOSE\" [type]=\"buttonTypeEnum.secondary\"\n (btnAction)=\"closeModal()\" dataTest=\"btn-close-modal\">\n </cw-button>\n\n <cw-button label=\"_COMMON._ACTION.DELETE\" [type]=\"buttonTypeEnum.danger\"\n [isDisabled]=\"disableBtnAction1()\" (btnAction)=\"action1Click()\" dataTest=\"btn-action-modal\">\n </cw-button>\n }\n @else {\n @if (labelBtnAction2()) {\n <cw-button [label]=\"labelBtnAction2()\" [type]=\"buttonTypeEnum.secondary\"\n [isDisabled]=\"disableBtnAction2()\" (btnAction)=\"action2Click()\" dataTest=\"btn-action-modal\">\n </cw-button>\n }\n @else {\n <cw-button label=\"_COMMON._ACTION.CLOSE\" [type]=\"buttonTypeEnum.secondary\"\n (btnAction)=\"closeModal()\" dataTest=\"btn-close-modal\">\n </cw-button>\n }\n @if (labelBtnAction1()) {\n <cw-button [label]=\"labelBtnAction1()\" [type]=\"buttonTypeEnum.primary\"\n [isDisabled]=\"disableBtnAction1()\" (btnAction)=\"action1Click()\" dataTest=\"btn-action-modal\">\n </cw-button>\n }\n }\n </div>\n }\n\n </div>\n </div>\n</div>\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "ngmodule", type: TranslateModule }, { kind: "component", type: ButtonComponent, selector: "cw-button", inputs: ["type", "label", "id", "link", "isDropdown", "hideCaret", "withIcon", "withOnlyIcon", "iconSize", "iconPosition", "dropdownPosition", "isMinWidth", "isDisabled", "isLoading", "cssClass", "dataTest", "skeletonMode", "withTooltip", "tooltipText", "tooltipTitle", "tooltipTrigger", "tooltipPosition", "tooltipType"], outputs: ["btnAction", "dropDownClicked"] }, { kind: "component", type: LoaderComponent, selector: "cw-loader", inputs: ["size", "displayText"] }, { kind: "component", type: IconComponent, selector: "cw-icon", inputs: ["icon", "label", "type", "iconSize", "iconCssClass", "iconUiType", "iconColorCustom", "spritePath"] }, { kind: "pipe", type: i2.TranslatePipe, name: "translate" }] }); }
4335
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.20", type: ModalsComponent, isStandalone: true, selector: "cw-modals", inputs: { size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, customClass: { classPropertyName: "customClass", publicName: "customClass", isSignal: true, isRequired: false, transformFunction: null }, scrollable: { classPropertyName: "scrollable", publicName: "scrollable", isSignal: true, isRequired: false, transformFunction: null }, isAutcompModal: { classPropertyName: "isAutcompModal", publicName: "isAutcompModal", isSignal: true, isRequired: false, transformFunction: null }, type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: true, transformFunction: null }, state: { classPropertyName: "state", publicName: "state", isSignal: true, isRequired: false, transformFunction: null }, textType: { classPropertyName: "textType", publicName: "textType", isSignal: true, isRequired: false, transformFunction: null }, modalTitle: { classPropertyName: "modalTitle", publicName: "modalTitle", isSignal: true, isRequired: false, transformFunction: null }, itemsToDelete: { classPropertyName: "itemsToDelete", publicName: "itemsToDelete", isSignal: true, isRequired: false, transformFunction: null }, itemsToDeleteTitle: { classPropertyName: "itemsToDeleteTitle", publicName: "itemsToDeleteTitle", isSignal: true, isRequired: false, transformFunction: null }, labelBtnAction1: { classPropertyName: "labelBtnAction1", publicName: "labelBtnAction1", isSignal: true, isRequired: false, transformFunction: null }, labelBtnAction2: { classPropertyName: "labelBtnAction2", publicName: "labelBtnAction2", isSignal: true, isRequired: false, transformFunction: null }, disableBtnAction1: { classPropertyName: "disableBtnAction1", publicName: "disableBtnAction1", isSignal: true, isRequired: false, transformFunction: null }, disableBtnAction2: { classPropertyName: "disableBtnAction2", publicName: "disableBtnAction2", isSignal: true, isRequired: false, transformFunction: null }, customBodyTemplate: { classPropertyName: "customBodyTemplate", publicName: "customBodyTemplate", isSignal: true, isRequired: false, transformFunction: null }, customBodyContext: { classPropertyName: "customBodyContext", publicName: "customBodyContext", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { btnAction1: "btnAction1", btnAction2: "btnAction2" }, viewQueries: [{ propertyName: "modalContainer", first: true, predicate: ["modalContainer"], descendants: true, isSignal: true }], ngImport: i0, template: "<div class=\"cityway-v8 modal-backdrop fade show\" style=\"z-index: 1050;\" aria-hidden=\"true\"></div>\n\n<div role=\"dialog\" tabindex=\"-1\" aria-modal=\"true\"\n [attr.aria-labelledby]=\"type() === modalsType.loader ? null : 'modal-basic-title'\"\n [attr.aria-label]=\"type() === modalsType.loader ? ('_COMMON._HTTP.TXT_LOADING' | translate) : null\"\n class=\"cityway-v8 d-flex modal show\" [ngClass]=\"customClass()\" data-test-ctw=\"modal\" (keydown)=\"onKeyDown($event)\">\n\n <!-- Backdrop : fermeture a la souris (confort). Le clavier (Escape) est gere\n par onKeyDown du dialog ; le backdrop n'est pas un element interactif focusable. -->\n <!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events, @angular-eslint/template/interactive-supports-focus -->\n <div class=\"modal-inner-backdrop\" (click)=\"type() !== modalsType.loader && closeModal()\"></div>\n\n <div #modalContainer role=\"document\" class=\"modal-dialog modal-dialog-centered\"\n [ngClass]=\"['modal-' + size(), scrollable() ? 'modal-dialog-scrollable' : '']\">\n\n <div class=\"modal-content\">\n\n @if (type() === modalsType.loader) {\n <div class=\"modal-body\">\n <cw-loader></cw-loader>\n </div>\n }\n @else {\n @if (isStateLike()) {\n <!-- state + delete : close en absolu (top-right, hors flux donc ne reserve\n pas de hauteur), body centre avec le picto de statut EN TETE du flux\n (il pousse donc le titre normalement) -->\n <button type=\"button\" class=\"btn-close modal-close-floating\" [attr.aria-label]=\"'_COMMON._ACTION.CLOSE' | translate\"\n (click)=\"closeModal()\" data-test-ctw=\"btn-close-modal\">\n <cw-icon [icon]=\"spriteIcon.toolbarClose\" [iconSize]=\"iconSize['lg']\" [type]=\"iconType.default\" aria-hidden=\"true\"></cw-icon>\n </button>\n\n <div class=\"modal-body modal-body-state d-flex-v gap-md items-center\" [class.modal-text-center]=\"isBodyCentered()\">\n <cw-icon [icon]=\"statusIcon()\" [iconSize]=\"iconSize['xl']\" [type]=\"iconType.square\"\n [iconUiType]=\"statusUiType()\" aria-hidden=\"true\"></cw-icon>\n\n <h1 class=\"modal-title\" id=\"modal-basic-title\">\n @if (type() === modalsType.delete) {\n {{ '_COMMON._MODAL_DELETE.TITLE' | translate: { number: itemsToDelete().length, name: itemsToDeleteTitle() | translate } }}\n }\n @else {\n {{ modalTitle() | translate }}\n }\n </h1>\n\n @if (type() === modalsType.delete) {\n <!-- zone delete en dur : texte + liste + avertissement, pleine largeur aligne a gauche -->\n <div class=\"w-100 d-flex-v gap-md\">\n @if (itemsToDelete().length > 1) {\n <div [innerHTML]=\"'_COMMON._MODAL_DELETE.MULTIPLE_TEXT' | translate\"></div>\n }\n @else {\n <div [innerHTML]=\"'_COMMON._MODAL_DELETE.SIMPLE_TEXT' | translate\"></div>\n }\n\n @if (itemsToDelete().length > 0) {\n <ul class=\"mb-none\">\n @for (item of itemsToDelete(); track item) {\n <li>{{ item }}</li>\n }\n </ul>\n }\n\n <div [innerHTML]=\"'_COMMON._MODAL_DELETE.IRREVERSIBLE' | translate\"></div>\n </div>\n }\n\n @if (customBodyTemplate()) {\n <div class=\"w-100\">\n <ng-container [ngTemplateOutlet]=\"customBodyTemplate()\" [ngTemplateOutletContext]=\"customBodyContext()\">\n </ng-container>\n </div>\n }\n </div>\n }\n @else {\n <!-- default + sidepanel : header titre + close, body = contenu libre (slot) -->\n <div class=\"modal-header\">\n <h1 class=\"modal-title\" id=\"modal-basic-title\">\n {{ modalTitle() | translate }}\n </h1>\n\n <button type=\"button\" class=\"btn-close\" [attr.aria-label]=\"'_COMMON._ACTION.CLOSE' | translate\"\n (click)=\"closeModal()\" data-test-ctw=\"btn-close-modal\">\n <cw-icon [icon]=\"spriteIcon.toolbarClose\" [iconSize]=\"iconSize['lg']\" [type]=\"iconType.default\" aria-hidden=\"true\"></cw-icon>\n </button>\n </div>\n\n <div class=\"modal-body d-flex-v gap-md\">\n @if (customBodyTemplate()) {\n <ng-container [ngTemplateOutlet]=\"customBodyTemplate()\" [ngTemplateOutletContext]=\"customBodyContext()\">\n </ng-container>\n }\n </div>\n }\n\n <!-- footer commun : secondaire a gauche, primaire/danger a droite (ordre DS) -->\n <div class=\"modal-footer\">\n @if (type() === modalsType.delete) {\n <cw-button label=\"_COMMON._ACTION.CLOSE\" [type]=\"buttonTypeEnum.secondary\"\n (btnAction)=\"closeModal()\" dataTest=\"btn-close-modal\">\n </cw-button>\n\n <cw-button label=\"_COMMON._ACTION.DELETE\" [type]=\"buttonTypeEnum.danger\"\n [isDisabled]=\"disableBtnAction1()\" (btnAction)=\"action1Click()\" dataTest=\"btn-action-modal\">\n </cw-button>\n }\n @else {\n @if (labelBtnAction2()) {\n <cw-button [label]=\"labelBtnAction2()\" [type]=\"buttonTypeEnum.secondary\"\n [isDisabled]=\"disableBtnAction2()\" (btnAction)=\"action2Click()\" dataTest=\"btn-action-modal\">\n </cw-button>\n }\n @else {\n <cw-button label=\"_COMMON._ACTION.CLOSE\" [type]=\"buttonTypeEnum.secondary\"\n (btnAction)=\"closeModal()\" dataTest=\"btn-close-modal\">\n </cw-button>\n }\n @if (labelBtnAction1()) {\n <cw-button [label]=\"labelBtnAction1()\" [type]=\"buttonTypeEnum.primary\"\n [isDisabled]=\"disableBtnAction1()\" (btnAction)=\"action1Click()\" dataTest=\"btn-action-modal\">\n </cw-button>\n }\n }\n </div>\n }\n\n </div>\n </div>\n</div>\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "ngmodule", type: TranslateModule }, { kind: "component", type: ButtonComponent, selector: "cw-button", inputs: ["type", "label", "id", "link", "isDropdown", "hideCaret", "withIcon", "withOnlyIcon", "iconSize", "iconPosition", "dropdownPosition", "isMinWidth", "isDisabled", "isLoading", "cssClass", "dataTest", "skeletonMode", "withTooltip", "tooltipText", "tooltipTitle", "tooltipTrigger", "tooltipPosition", "tooltipType"], outputs: ["btnAction", "dropDownClicked"] }, { kind: "component", type: LoaderComponent, selector: "cw-loader", inputs: ["size", "displayText"] }, { kind: "component", type: IconComponent, selector: "cw-icon", inputs: ["icon", "label", "type", "iconSize", "iconCssClass", "iconUiType", "iconColorCustom", "spritePath"] }, { kind: "pipe", type: i2.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
3968
4336
  }
3969
4337
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: ModalsComponent, decorators: [{
3970
4338
  type: Component,
3971
- args: [{ selector: 'cw-modals', standalone: true, imports: [CommonModule, TranslateModule, NgClass, NgTemplateOutlet, ButtonComponent, LoaderComponent, IconComponent], template: "<div class=\"cityway-v8 modal-backdrop fade show\" style=\"z-index: 1050;\" aria-hidden=\"true\"></div>\n\n<div role=\"dialog\" tabindex=\"-1\" aria-modal=\"true\" aria-labelledby=\"modal-basic-title\"\n class=\"cityway-v8 d-flex modal show\" [ngClass]=\"customClass()\" data-test-ctw=\"modal\" (keydown)=\"onKeyDown($event)\">\n\n <div class=\"modal-inner-backdrop\" (click)=\"type() !== modalsType.loader && closeModal()\"></div>\n\n <div #modalContainer role=\"document\" class=\"modal-dialog modal-dialog-centered\"\n [ngClass]=\"['modal-' + size(), scrollable() ? 'modal-dialog-scrollable' : '']\">\n\n <div class=\"modal-content\">\n\n @if (type() === modalsType.loader) {\n <div class=\"modal-body\">\n <cw-loader></cw-loader>\n </div>\n }\n @else {\n @if (isStateLike()) {\n <!-- state + delete : close en absolu (top-right, hors flux donc ne reserve\n pas de hauteur), body centre avec le picto de statut EN TETE du flux\n (il pousse donc le titre normalement) -->\n <button type=\"button\" class=\"btn-close modal-close-floating\" [attr.aria-label]=\"'_COMMON._ACTION.CLOSE' | translate\"\n (click)=\"closeModal()\" data-test-ctw=\"btn-close-modal\">\n <cw-icon [icon]=\"spriteIcon.toolbarClose\" [iconSize]=\"iconSize['lg']\" [type]=\"iconType.default\" aria-hidden=\"true\"></cw-icon>\n </button>\n\n <div class=\"modal-body modal-body-state d-flex-v gap-md items-center\" [class.modal-text-center]=\"isBodyCentered()\">\n <cw-icon [icon]=\"statusIcon()\" [iconSize]=\"iconSize['xl']\" [type]=\"iconType.square\"\n [iconUiType]=\"statusUiType()\" aria-hidden=\"true\"></cw-icon>\n\n <h1 class=\"modal-title\" id=\"modal-basic-title\">\n @if (type() === modalsType.delete) {\n {{ '_COMMON._MODAL_DELETE.TITLE' | translate: { number: itemsToDelete().length, name: itemsToDeleteTitle() | translate } }}\n }\n @else {\n {{ modalTitle() | translate }}\n }\n </h1>\n\n @if (type() === modalsType.delete) {\n <!-- zone delete en dur : texte + liste + avertissement, pleine largeur aligne a gauche -->\n <div class=\"w-100 d-flex-v gap-md\">\n @if (itemsToDelete().length > 1) {\n <div [innerHTML]=\"'_COMMON._MODAL_DELETE.MULTIPLE_TEXT' | translate\"></div>\n }\n @else {\n <div [innerHTML]=\"'_COMMON._MODAL_DELETE.SIMPLE_TEXT' | translate\"></div>\n }\n\n @if (itemsToDelete().length > 0) {\n <ul class=\"mb-none\">\n @for (item of itemsToDelete(); track item) {\n <li>{{ item }}</li>\n }\n </ul>\n }\n\n <div [innerHTML]=\"'_COMMON._MODAL_DELETE.IRREVERSIBLE' | translate\"></div>\n </div>\n }\n\n @if (customBodyTemplate()) {\n <div class=\"w-100\">\n <ng-container [ngTemplateOutlet]=\"customBodyTemplate()\" [ngTemplateOutletContext]=\"customBodyContext()\">\n </ng-container>\n </div>\n }\n </div>\n }\n @else {\n <!-- default + sidepanel : header titre + close, body = contenu libre (slot) -->\n <div class=\"modal-header\">\n <h1 class=\"modal-title\" id=\"modal-basic-title\">\n {{ modalTitle() | translate }}\n </h1>\n\n <button type=\"button\" class=\"btn-close\" [attr.aria-label]=\"'_COMMON._ACTION.CLOSE' | translate\"\n (click)=\"closeModal()\" data-test-ctw=\"btn-close-modal\">\n <cw-icon [icon]=\"spriteIcon.toolbarClose\" [iconSize]=\"iconSize['lg']\" [type]=\"iconType.default\" aria-hidden=\"true\"></cw-icon>\n </button>\n </div>\n\n <div class=\"modal-body d-flex-v gap-md\">\n @if (customBodyTemplate()) {\n <ng-container [ngTemplateOutlet]=\"customBodyTemplate()\" [ngTemplateOutletContext]=\"customBodyContext()\">\n </ng-container>\n }\n </div>\n }\n\n <!-- footer commun : secondaire a gauche, primaire/danger a droite (ordre DS) -->\n <div class=\"modal-footer\">\n @if (type() === modalsType.delete) {\n <cw-button label=\"_COMMON._ACTION.CLOSE\" [type]=\"buttonTypeEnum.secondary\"\n (btnAction)=\"closeModal()\" dataTest=\"btn-close-modal\">\n </cw-button>\n\n <cw-button label=\"_COMMON._ACTION.DELETE\" [type]=\"buttonTypeEnum.danger\"\n [isDisabled]=\"disableBtnAction1()\" (btnAction)=\"action1Click()\" dataTest=\"btn-action-modal\">\n </cw-button>\n }\n @else {\n @if (labelBtnAction2()) {\n <cw-button [label]=\"labelBtnAction2()\" [type]=\"buttonTypeEnum.secondary\"\n [isDisabled]=\"disableBtnAction2()\" (btnAction)=\"action2Click()\" dataTest=\"btn-action-modal\">\n </cw-button>\n }\n @else {\n <cw-button label=\"_COMMON._ACTION.CLOSE\" [type]=\"buttonTypeEnum.secondary\"\n (btnAction)=\"closeModal()\" dataTest=\"btn-close-modal\">\n </cw-button>\n }\n @if (labelBtnAction1()) {\n <cw-button [label]=\"labelBtnAction1()\" [type]=\"buttonTypeEnum.primary\"\n [isDisabled]=\"disableBtnAction1()\" (btnAction)=\"action1Click()\" dataTest=\"btn-action-modal\">\n </cw-button>\n }\n }\n </div>\n }\n\n </div>\n </div>\n</div>\n" }]
4339
+ args: [{ selector: 'cw-modals', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, imports: [CommonModule, TranslateModule, NgClass, NgTemplateOutlet, ButtonComponent, LoaderComponent, IconComponent], template: "<div class=\"cityway-v8 modal-backdrop fade show\" style=\"z-index: 1050;\" aria-hidden=\"true\"></div>\n\n<div role=\"dialog\" tabindex=\"-1\" aria-modal=\"true\"\n [attr.aria-labelledby]=\"type() === modalsType.loader ? null : 'modal-basic-title'\"\n [attr.aria-label]=\"type() === modalsType.loader ? ('_COMMON._HTTP.TXT_LOADING' | translate) : null\"\n class=\"cityway-v8 d-flex modal show\" [ngClass]=\"customClass()\" data-test-ctw=\"modal\" (keydown)=\"onKeyDown($event)\">\n\n <!-- Backdrop : fermeture a la souris (confort). Le clavier (Escape) est gere\n par onKeyDown du dialog ; le backdrop n'est pas un element interactif focusable. -->\n <!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events, @angular-eslint/template/interactive-supports-focus -->\n <div class=\"modal-inner-backdrop\" (click)=\"type() !== modalsType.loader && closeModal()\"></div>\n\n <div #modalContainer role=\"document\" class=\"modal-dialog modal-dialog-centered\"\n [ngClass]=\"['modal-' + size(), scrollable() ? 'modal-dialog-scrollable' : '']\">\n\n <div class=\"modal-content\">\n\n @if (type() === modalsType.loader) {\n <div class=\"modal-body\">\n <cw-loader></cw-loader>\n </div>\n }\n @else {\n @if (isStateLike()) {\n <!-- state + delete : close en absolu (top-right, hors flux donc ne reserve\n pas de hauteur), body centre avec le picto de statut EN TETE du flux\n (il pousse donc le titre normalement) -->\n <button type=\"button\" class=\"btn-close modal-close-floating\" [attr.aria-label]=\"'_COMMON._ACTION.CLOSE' | translate\"\n (click)=\"closeModal()\" data-test-ctw=\"btn-close-modal\">\n <cw-icon [icon]=\"spriteIcon.toolbarClose\" [iconSize]=\"iconSize['lg']\" [type]=\"iconType.default\" aria-hidden=\"true\"></cw-icon>\n </button>\n\n <div class=\"modal-body modal-body-state d-flex-v gap-md items-center\" [class.modal-text-center]=\"isBodyCentered()\">\n <cw-icon [icon]=\"statusIcon()\" [iconSize]=\"iconSize['xl']\" [type]=\"iconType.square\"\n [iconUiType]=\"statusUiType()\" aria-hidden=\"true\"></cw-icon>\n\n <h1 class=\"modal-title\" id=\"modal-basic-title\">\n @if (type() === modalsType.delete) {\n {{ '_COMMON._MODAL_DELETE.TITLE' | translate: { number: itemsToDelete().length, name: itemsToDeleteTitle() | translate } }}\n }\n @else {\n {{ modalTitle() | translate }}\n }\n </h1>\n\n @if (type() === modalsType.delete) {\n <!-- zone delete en dur : texte + liste + avertissement, pleine largeur aligne a gauche -->\n <div class=\"w-100 d-flex-v gap-md\">\n @if (itemsToDelete().length > 1) {\n <div [innerHTML]=\"'_COMMON._MODAL_DELETE.MULTIPLE_TEXT' | translate\"></div>\n }\n @else {\n <div [innerHTML]=\"'_COMMON._MODAL_DELETE.SIMPLE_TEXT' | translate\"></div>\n }\n\n @if (itemsToDelete().length > 0) {\n <ul class=\"mb-none\">\n @for (item of itemsToDelete(); track item) {\n <li>{{ item }}</li>\n }\n </ul>\n }\n\n <div [innerHTML]=\"'_COMMON._MODAL_DELETE.IRREVERSIBLE' | translate\"></div>\n </div>\n }\n\n @if (customBodyTemplate()) {\n <div class=\"w-100\">\n <ng-container [ngTemplateOutlet]=\"customBodyTemplate()\" [ngTemplateOutletContext]=\"customBodyContext()\">\n </ng-container>\n </div>\n }\n </div>\n }\n @else {\n <!-- default + sidepanel : header titre + close, body = contenu libre (slot) -->\n <div class=\"modal-header\">\n <h1 class=\"modal-title\" id=\"modal-basic-title\">\n {{ modalTitle() | translate }}\n </h1>\n\n <button type=\"button\" class=\"btn-close\" [attr.aria-label]=\"'_COMMON._ACTION.CLOSE' | translate\"\n (click)=\"closeModal()\" data-test-ctw=\"btn-close-modal\">\n <cw-icon [icon]=\"spriteIcon.toolbarClose\" [iconSize]=\"iconSize['lg']\" [type]=\"iconType.default\" aria-hidden=\"true\"></cw-icon>\n </button>\n </div>\n\n <div class=\"modal-body d-flex-v gap-md\">\n @if (customBodyTemplate()) {\n <ng-container [ngTemplateOutlet]=\"customBodyTemplate()\" [ngTemplateOutletContext]=\"customBodyContext()\">\n </ng-container>\n }\n </div>\n }\n\n <!-- footer commun : secondaire a gauche, primaire/danger a droite (ordre DS) -->\n <div class=\"modal-footer\">\n @if (type() === modalsType.delete) {\n <cw-button label=\"_COMMON._ACTION.CLOSE\" [type]=\"buttonTypeEnum.secondary\"\n (btnAction)=\"closeModal()\" dataTest=\"btn-close-modal\">\n </cw-button>\n\n <cw-button label=\"_COMMON._ACTION.DELETE\" [type]=\"buttonTypeEnum.danger\"\n [isDisabled]=\"disableBtnAction1()\" (btnAction)=\"action1Click()\" dataTest=\"btn-action-modal\">\n </cw-button>\n }\n @else {\n @if (labelBtnAction2()) {\n <cw-button [label]=\"labelBtnAction2()\" [type]=\"buttonTypeEnum.secondary\"\n [isDisabled]=\"disableBtnAction2()\" (btnAction)=\"action2Click()\" dataTest=\"btn-action-modal\">\n </cw-button>\n }\n @else {\n <cw-button label=\"_COMMON._ACTION.CLOSE\" [type]=\"buttonTypeEnum.secondary\"\n (btnAction)=\"closeModal()\" dataTest=\"btn-close-modal\">\n </cw-button>\n }\n @if (labelBtnAction1()) {\n <cw-button [label]=\"labelBtnAction1()\" [type]=\"buttonTypeEnum.primary\"\n [isDisabled]=\"disableBtnAction1()\" (btnAction)=\"action1Click()\" dataTest=\"btn-action-modal\">\n </cw-button>\n }\n }\n </div>\n }\n\n </div>\n </div>\n</div>\n" }]
3972
4340
  }], propDecorators: { modalContainer: [{ type: i0.ViewChild, args: ['modalContainer', { isSignal: true }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], customClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "customClass", required: false }] }], scrollable: [{ type: i0.Input, args: [{ isSignal: true, alias: "scrollable", required: false }] }], isAutcompModal: [{ type: i0.Input, args: [{ isSignal: true, alias: "isAutcompModal", required: false }] }], type: [{ type: i0.Input, args: [{ isSignal: true, alias: "type", required: true }] }], state: [{ type: i0.Input, args: [{ isSignal: true, alias: "state", required: false }] }], textType: [{ type: i0.Input, args: [{ isSignal: true, alias: "textType", required: false }] }], modalTitle: [{ type: i0.Input, args: [{ isSignal: true, alias: "modalTitle", required: false }] }], itemsToDelete: [{ type: i0.Input, args: [{ isSignal: true, alias: "itemsToDelete", required: false }] }], itemsToDeleteTitle: [{ type: i0.Input, args: [{ isSignal: true, alias: "itemsToDeleteTitle", required: false }] }], labelBtnAction1: [{ type: i0.Input, args: [{ isSignal: true, alias: "labelBtnAction1", required: false }] }], labelBtnAction2: [{ type: i0.Input, args: [{ isSignal: true, alias: "labelBtnAction2", required: false }] }], disableBtnAction1: [{ type: i0.Input, args: [{ isSignal: true, alias: "disableBtnAction1", required: false }] }], disableBtnAction2: [{ type: i0.Input, args: [{ isSignal: true, alias: "disableBtnAction2", required: false }] }], customBodyTemplate: [{ type: i0.Input, args: [{ isSignal: true, alias: "customBodyTemplate", required: false }] }], customBodyContext: [{ type: i0.Input, args: [{ isSignal: true, alias: "customBodyContext", required: false }] }], btnAction1: [{ type: i0.Output, args: ["btnAction1"] }], btnAction2: [{ type: i0.Output, args: ["btnAction2"] }] } });
3973
4341
 
3974
4342
  class TabContentComponent {
@@ -3976,43 +4344,46 @@ class TabContentComponent {
3976
4344
  this.title = input.required(...(ngDevMode ? [{ debugName: "title" }] : []));
3977
4345
  this.disabled = input(false, ...(ngDevMode ? [{ debugName: "disabled" }] : []));
3978
4346
  this.withIcon = input(...(ngDevMode ? [undefined, { debugName: "withIcon" }] : []));
3979
- this.id = 0;
3980
- this.active = false;
4347
+ // Etat pilote par le parent `cw-tab` : signaux writable (le parent appelle `.set()`)
4348
+ // pour declencher la detection de changement sous OnPush.
4349
+ this.id = signal(0, ...(ngDevMode ? [{ debugName: "id" }] : []));
4350
+ this.active = signal(false, ...(ngDevMode ? [{ debugName: "active" }] : []));
3981
4351
  }
3982
4352
  get fragment() {
3983
4353
  return UtilsHelper.slugify(this.title());
3984
4354
  }
3985
4355
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: TabContentComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
3986
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "20.3.20", type: TabContentComponent, isStandalone: true, selector: "cw-tab-content", inputs: { title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: true, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, withIcon: { classPropertyName: "withIcon", publicName: "withIcon", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: `
3987
- <div class="tab-pane"
3988
- [class.fade]="!active"
3989
- [class.active]="active"
3990
- [class.show]="active"
3991
- [class.d-none]="!active"
3992
- [id]="'cw-nav-' + id + '-panel'"
3993
- role="tabpanel"
3994
- [attr.aria-labelledby]="'cw-nav-' + id">
3995
- <ng-content></ng-content>
3996
- </div>
3997
- `, isInline: true }); }
4356
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "20.3.20", type: TabContentComponent, isStandalone: true, selector: "cw-tab-content", inputs: { title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: true, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, withIcon: { classPropertyName: "withIcon", publicName: "withIcon", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: `
4357
+ <div class="tab-pane"
4358
+ [class.fade]="!active()"
4359
+ [class.active]="active()"
4360
+ [class.show]="active()"
4361
+ [class.d-none]="!active()"
4362
+ [id]="'cw-nav-' + id() + '-panel'"
4363
+ role="tabpanel"
4364
+ [attr.aria-labelledby]="'cw-nav-' + id()">
4365
+ <ng-content></ng-content>
4366
+ </div>
4367
+ `, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
3998
4368
  }
3999
4369
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: TabContentComponent, decorators: [{
4000
4370
  type: Component,
4001
4371
  args: [{
4002
4372
  selector: 'cw-tab-content',
4003
- template: `
4004
- <div class="tab-pane"
4005
- [class.fade]="!active"
4006
- [class.active]="active"
4007
- [class.show]="active"
4008
- [class.d-none]="!active"
4009
- [id]="'cw-nav-' + id + '-panel'"
4010
- role="tabpanel"
4011
- [attr.aria-labelledby]="'cw-nav-' + id">
4012
- <ng-content></ng-content>
4013
- </div>
4373
+ template: `
4374
+ <div class="tab-pane"
4375
+ [class.fade]="!active()"
4376
+ [class.active]="active()"
4377
+ [class.show]="active()"
4378
+ [class.d-none]="!active()"
4379
+ [id]="'cw-nav-' + id() + '-panel'"
4380
+ role="tabpanel"
4381
+ [attr.aria-labelledby]="'cw-nav-' + id()">
4382
+ <ng-content></ng-content>
4383
+ </div>
4014
4384
  `,
4015
- standalone: true
4385
+ standalone: true,
4386
+ changeDetection: ChangeDetectionStrategy.OnPush
4016
4387
  }]
4017
4388
  }], propDecorators: { title: [{ type: i0.Input, args: [{ isSignal: true, alias: "title", required: true }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], withIcon: [{ type: i0.Input, args: [{ isSignal: true, alias: "withIcon", required: false }] }] } });
4018
4389
 
@@ -4031,6 +4402,7 @@ class TabComponent {
4031
4402
  constructor() {
4032
4403
  this.router = inject(Router);
4033
4404
  this.route = inject(ActivatedRoute);
4405
+ this.destroyRef = inject(DestroyRef);
4034
4406
  this.type = input(FoTabTypeEnum.defaultMd, ...(ngDevMode ? [{ debugName: "type" }] : []));
4035
4407
  this.id = input(...(ngDevMode ? [undefined, { debugName: "id" }] : []));
4036
4408
  this.useFragment = input(true, ...(ngDevMode ? [{ debugName: "useFragment" }] : []));
@@ -4042,18 +4414,22 @@ class TabComponent {
4042
4414
  this.tabChanged = output();
4043
4415
  this.activeId = 0;
4044
4416
  this.iconSize = IconSizeEnum['md'];
4045
- this.tabTypeEnum = FoTabTypeEnum && BoTabTypeEnum;
4046
4417
  }
4047
4418
  ngAfterContentInit() {
4048
4419
  const tabsArray = [...this.tabs()];
4049
4420
  tabsArray.forEach((tab, index) => {
4050
- tab.id = index;
4051
- tab.active = false;
4421
+ tab.id.set(index);
4422
+ tab.active.set(false);
4052
4423
  });
4053
4424
  const firstActiveIndex = tabsArray.findIndex(t => !t.disabled());
4054
- this.activeId = this.activeTabIndex() ?? (firstActiveIndex !== -1 ? firstActiveIndex : 0);
4425
+ // Onglet demande s'il est valide et non desactive ; sinon 1er onglet actif ; sinon 0.
4426
+ const requested = this.activeTabIndex();
4427
+ const requestedOk = requested >= 0 && requested < tabsArray.length && !tabsArray[requested]?.disabled();
4428
+ this.activeId = requestedOk ? requested : (firstActiveIndex !== -1 ? firstActiveIndex : 0);
4055
4429
  if (this.useFragment()) {
4056
- this.route.fragment.subscribe(fragment => {
4430
+ this.route.fragment
4431
+ .pipe(takeUntilDestroyed(this.destroyRef))
4432
+ .subscribe(fragment => {
4057
4433
  if (fragment) {
4058
4434
  const foundIndex = tabsArray.findIndex(tab => tab.fragment === fragment && !tab.disabled());
4059
4435
  if (foundIndex !== -1) {
@@ -4070,9 +4446,9 @@ class TabComponent {
4070
4446
  selectTab(tab) {
4071
4447
  if (tab.disabled())
4072
4448
  return;
4073
- this.tabs().forEach(t => t.active = false);
4074
- tab.active = true;
4075
- this.activeId = tab.id;
4449
+ this.tabs().forEach(t => t.active.set(false));
4450
+ tab.active.set(true);
4451
+ this.activeId = tab.id();
4076
4452
  if (this.useFragment()) {
4077
4453
  this.router.navigate([], {
4078
4454
  relativeTo: this.route,
@@ -4110,7 +4486,7 @@ class TabComponent {
4110
4486
  }
4111
4487
  selectPreviousTab() {
4112
4488
  const tabsArray = [...this.tabs()];
4113
- const activeIndex = tabsArray.findIndex(tab => tab.active);
4489
+ const activeIndex = tabsArray.findIndex(tab => tab.active());
4114
4490
  if (activeIndex !== -1) {
4115
4491
  let newIndex = (activeIndex - 1 + tabsArray.length) % tabsArray.length;
4116
4492
  while (tabsArray[newIndex].disabled() && newIndex !== activeIndex) {
@@ -4124,7 +4500,7 @@ class TabComponent {
4124
4500
  }
4125
4501
  selectNextTab() {
4126
4502
  const tabsArray = [...this.tabs()];
4127
- const activeIndex = tabsArray.findIndex(tab => tab.active);
4503
+ const activeIndex = tabsArray.findIndex(tab => tab.active());
4128
4504
  if (activeIndex !== -1) {
4129
4505
  let newIndex = (activeIndex + 1) % tabsArray.length;
4130
4506
  while (tabsArray[newIndex].disabled() && newIndex !== activeIndex) {
@@ -4137,11 +4513,11 @@ class TabComponent {
4137
4513
  }
4138
4514
  }
4139
4515
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: TabComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
4140
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.20", type: TabComponent, isStandalone: true, selector: "cw-tab", inputs: { type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: false, transformFunction: null }, id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null }, useFragment: { classPropertyName: "useFragment", publicName: "useFragment", isSignal: true, isRequired: false, transformFunction: null }, title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: false, transformFunction: null }, tabContentCssClass: { classPropertyName: "tabContentCssClass", publicName: "tabContentCssClass", isSignal: true, isRequired: false, transformFunction: null }, activeTabIndex: { classPropertyName: "activeTabIndex", publicName: "activeTabIndex", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { tabChanged: "tabChanged" }, host: { classAttribute: "cw-tab" }, queries: [{ propertyName: "tabs", predicate: TabContentComponent, isSignal: true }], viewQueries: [{ propertyName: "tabLinks", predicate: ["tabLink"], descendants: true, isSignal: true }], ngImport: i0, template: "<div class=\"tab\" [ngClass]=\"'tab-' + type()\">\n @if (title()) {\n <h2>{{ title() | translate }}</h2>\n }\n <ul class=\"tab-items d-flex-h\" [ngClass]=\"'tab-items-' + type()\" role=\"tablist\" appRwdTabs>\n @for (tab of tabs(); track tab; let i = $index) {\n <li class=\"tab-item\" role=\"presentation\">\n <button #tabLink type=\"button\" class=\"tab-link btn\" [class.active]=\"tab.active\" [class.disabled]=\"tab.disabled()\"\n [disabled]=\"tab.disabled()\" [attr.id]=\"'cw-nav-' + i\" [attr.data-test-ctw]=\"'link-tab-' + id() + '-' + i\"\n [attr.aria-selected]=\"tab.active\" [attr.aria-controls]=\"'cw-nav-' + i + '-panel'\"\n [attr.tabindex]=\"tab.active ? '0' : '-1'\" (click)=\"selectTab(tab)\" (keydown)=\"onKeydown($event)\" role=\"tab\">\n @if (tab.withIcon()) {\n <cw-icon [icon]=\"tab.withIcon()\" [iconSize]=\"iconSize\"></cw-icon>\n }\n {{ tab.title() | translate }}\n </button>\n </li>\n }\n </ul>\n</div>\n\n<div [class]=\"'tab-content ' + tabContentCssClass()\" [ngClass]=\"'tab-content-' + type()\">\n <ng-content></ng-content>\n</div>\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "component", type: IconComponent, selector: "cw-icon", inputs: ["icon", "label", "type", "iconSize", "iconCssClass", "iconUiType", "iconColorCustom", "spritePath"] }, { kind: "ngmodule", type: TranslateModule }, { kind: "pipe", type: i2.TranslatePipe, name: "translate" }] }); }
4516
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.20", type: TabComponent, isStandalone: true, selector: "cw-tab", inputs: { type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: false, transformFunction: null }, id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null }, useFragment: { classPropertyName: "useFragment", publicName: "useFragment", isSignal: true, isRequired: false, transformFunction: null }, title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: false, transformFunction: null }, tabContentCssClass: { classPropertyName: "tabContentCssClass", publicName: "tabContentCssClass", isSignal: true, isRequired: false, transformFunction: null }, activeTabIndex: { classPropertyName: "activeTabIndex", publicName: "activeTabIndex", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { tabChanged: "tabChanged" }, host: { classAttribute: "cw-tab" }, queries: [{ propertyName: "tabs", predicate: TabContentComponent, isSignal: true }], viewQueries: [{ propertyName: "tabLinks", predicate: ["tabLink"], descendants: true, isSignal: true }], ngImport: i0, template: "<div class=\"tab\" [ngClass]=\"'tab-' + type()\">\n @if (title()) {\n <h2>{{ title() | translate }}</h2>\n }\n <ul class=\"tab-items d-flex-h\" [ngClass]=\"'tab-items-' + type()\" role=\"tablist\">\n @for (tab of tabs(); track tab; let i = $index) {\n <li class=\"tab-item\" role=\"presentation\">\n <button #tabLink type=\"button\" class=\"tab-link btn\" [class.active]=\"tab.active()\" [class.disabled]=\"tab.disabled()\"\n [disabled]=\"tab.disabled()\" [attr.id]=\"'cw-nav-' + i\" [attr.data-test-ctw]=\"'link-tab-' + id() + '-' + i\"\n [attr.aria-selected]=\"tab.active()\" [attr.aria-controls]=\"'cw-nav-' + i + '-panel'\"\n [attr.tabindex]=\"tab.active() ? '0' : '-1'\" (click)=\"selectTab(tab)\" (keydown)=\"onKeydown($event)\" role=\"tab\">\n @if (tab.withIcon()) {\n <cw-icon [icon]=\"tab.withIcon()\" [iconSize]=\"iconSize\"></cw-icon>\n }\n {{ tab.title() | translate }}\n </button>\n </li>\n }\n </ul>\n</div>\n\n<div [class]=\"'tab-content ' + tabContentCssClass()\" [ngClass]=\"'tab-content-' + type()\">\n <ng-content></ng-content>\n</div>\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "component", type: IconComponent, selector: "cw-icon", inputs: ["icon", "label", "type", "iconSize", "iconCssClass", "iconUiType", "iconColorCustom", "spritePath"] }, { kind: "ngmodule", type: TranslateModule }, { kind: "pipe", type: i2.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
4141
4517
  }
4142
4518
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: TabComponent, decorators: [{
4143
4519
  type: Component,
4144
- args: [{ selector: 'cw-tab', standalone: true, host: {
4520
+ args: [{ selector: 'cw-tab', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, host: {
4145
4521
  // Porte le scope des tokens layout `.cw-tab` (ex. --cw-tab-card-px) generes
4146
4522
  // dans @cityway/design-tokens, sans quoi le gap des onglets card ne resout pas.
4147
4523
  class: 'cw-tab'
@@ -4149,24 +4525,24 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.20", ngImpo
4149
4525
  CommonModule,
4150
4526
  IconComponent,
4151
4527
  TranslateModule
4152
- ], template: "<div class=\"tab\" [ngClass]=\"'tab-' + type()\">\n @if (title()) {\n <h2>{{ title() | translate }}</h2>\n }\n <ul class=\"tab-items d-flex-h\" [ngClass]=\"'tab-items-' + type()\" role=\"tablist\" appRwdTabs>\n @for (tab of tabs(); track tab; let i = $index) {\n <li class=\"tab-item\" role=\"presentation\">\n <button #tabLink type=\"button\" class=\"tab-link btn\" [class.active]=\"tab.active\" [class.disabled]=\"tab.disabled()\"\n [disabled]=\"tab.disabled()\" [attr.id]=\"'cw-nav-' + i\" [attr.data-test-ctw]=\"'link-tab-' + id() + '-' + i\"\n [attr.aria-selected]=\"tab.active\" [attr.aria-controls]=\"'cw-nav-' + i + '-panel'\"\n [attr.tabindex]=\"tab.active ? '0' : '-1'\" (click)=\"selectTab(tab)\" (keydown)=\"onKeydown($event)\" role=\"tab\">\n @if (tab.withIcon()) {\n <cw-icon [icon]=\"tab.withIcon()\" [iconSize]=\"iconSize\"></cw-icon>\n }\n {{ tab.title() | translate }}\n </button>\n </li>\n }\n </ul>\n</div>\n\n<div [class]=\"'tab-content ' + tabContentCssClass()\" [ngClass]=\"'tab-content-' + type()\">\n <ng-content></ng-content>\n</div>\n" }]
4528
+ ], template: "<div class=\"tab\" [ngClass]=\"'tab-' + type()\">\n @if (title()) {\n <h2>{{ title() | translate }}</h2>\n }\n <ul class=\"tab-items d-flex-h\" [ngClass]=\"'tab-items-' + type()\" role=\"tablist\">\n @for (tab of tabs(); track tab; let i = $index) {\n <li class=\"tab-item\" role=\"presentation\">\n <button #tabLink type=\"button\" class=\"tab-link btn\" [class.active]=\"tab.active()\" [class.disabled]=\"tab.disabled()\"\n [disabled]=\"tab.disabled()\" [attr.id]=\"'cw-nav-' + i\" [attr.data-test-ctw]=\"'link-tab-' + id() + '-' + i\"\n [attr.aria-selected]=\"tab.active()\" [attr.aria-controls]=\"'cw-nav-' + i + '-panel'\"\n [attr.tabindex]=\"tab.active() ? '0' : '-1'\" (click)=\"selectTab(tab)\" (keydown)=\"onKeydown($event)\" role=\"tab\">\n @if (tab.withIcon()) {\n <cw-icon [icon]=\"tab.withIcon()\" [iconSize]=\"iconSize\"></cw-icon>\n }\n {{ tab.title() | translate }}\n </button>\n </li>\n }\n </ul>\n</div>\n\n<div [class]=\"'tab-content ' + tabContentCssClass()\" [ngClass]=\"'tab-content-' + type()\">\n <ng-content></ng-content>\n</div>\n" }]
4153
4529
  }], propDecorators: { type: [{ type: i0.Input, args: [{ isSignal: true, alias: "type", required: false }] }], id: [{ type: i0.Input, args: [{ isSignal: true, alias: "id", required: false }] }], useFragment: [{ type: i0.Input, args: [{ isSignal: true, alias: "useFragment", required: false }] }], title: [{ type: i0.Input, args: [{ isSignal: true, alias: "title", required: false }] }], tabContentCssClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "tabContentCssClass", required: false }] }], activeTabIndex: [{ type: i0.Input, args: [{ isSignal: true, alias: "activeTabIndex", required: false }] }], tabs: [{ type: i0.ContentChildren, args: [i0.forwardRef(() => TabContentComponent), { isSignal: true }] }], tabLinks: [{ type: i0.ViewChildren, args: ['tabLink', { isSignal: true }] }], tabChanged: [{ type: i0.Output, args: ["tabChanged"] }] } });
4154
4530
 
4155
4531
  class StepperComponent {
4156
4532
  constructor() {
4157
4533
  this.activeStep = input(0, ...(ngDevMode ? [{ debugName: "activeStep" }] : []));
4158
4534
  this.steps = input([], ...(ngDevMode ? [{ debugName: "steps" }] : []));
4159
- this.label = input('Étapes de progression', ...(ngDevMode ? [{ debugName: "label" }] : []));
4535
+ this.label = input('_COMMON._STEPPER.NAV_LABEL', ...(ngDevMode ? [{ debugName: "label" }] : []));
4160
4536
  }
4161
4537
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: StepperComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
4162
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.20", type: StepperComponent, isStandalone: true, selector: "cw-stepper", inputs: { activeStep: { classPropertyName: "activeStep", publicName: "activeStep", isSignal: true, isRequired: false, transformFunction: null }, steps: { classPropertyName: "steps", publicName: "steps", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<ul class=\"stepper\" role=\"list\" [attr.aria-label]=\"label()\">\n @for (step of steps(); track step; let i = $index) {\n <li id=\"step-{{i}}\" class=\"stepper-item\" [ngClass]=\"{\n 'stepper-item-current': i === activeStep(),\n 'stepper-item-completed': i < activeStep()}\"\n [attr.aria-current]=\"i === activeStep() ? 'step' : null\">\n <span class=\"stepper-label\">\n <span class=\"visually-hidden\">{{i + 1}}</span>\n {{step | translate}}\n </span>\n </li>\n }\n</ul>\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "ngmodule", type: TranslateModule }, { kind: "pipe", type: i2.TranslatePipe, name: "translate" }] }); }
4538
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.20", type: StepperComponent, isStandalone: true, selector: "cw-stepper", inputs: { activeStep: { classPropertyName: "activeStep", publicName: "activeStep", isSignal: true, isRequired: false, transformFunction: null }, steps: { classPropertyName: "steps", publicName: "steps", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<ul class=\"stepper\" role=\"list\" [attr.aria-label]=\"label() | translate\">\n @for (step of steps(); track step; let i = $index) {\n <li id=\"step-{{i}}\" class=\"stepper-item\" [ngClass]=\"{\n 'stepper-item-current': i === activeStep(),\n 'stepper-item-completed': i < activeStep()}\"\n [attr.aria-current]=\"i === activeStep() ? 'step' : null\">\n <span class=\"stepper-label\">\n <span class=\"visually-hidden\">{{i + 1}}</span>\n {{step | translate}}\n </span>\n </li>\n }\n</ul>\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "ngmodule", type: TranslateModule }, { kind: "pipe", type: i2.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
4163
4539
  }
4164
4540
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: StepperComponent, decorators: [{
4165
4541
  type: Component,
4166
- args: [{ selector: 'cw-stepper', standalone: true, imports: [
4542
+ args: [{ selector: 'cw-stepper', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, imports: [
4167
4543
  CommonModule,
4168
4544
  TranslateModule
4169
- ], template: "<ul class=\"stepper\" role=\"list\" [attr.aria-label]=\"label()\">\n @for (step of steps(); track step; let i = $index) {\n <li id=\"step-{{i}}\" class=\"stepper-item\" [ngClass]=\"{\n 'stepper-item-current': i === activeStep(),\n 'stepper-item-completed': i < activeStep()}\"\n [attr.aria-current]=\"i === activeStep() ? 'step' : null\">\n <span class=\"stepper-label\">\n <span class=\"visually-hidden\">{{i + 1}}</span>\n {{step | translate}}\n </span>\n </li>\n }\n</ul>\n" }]
4545
+ ], template: "<ul class=\"stepper\" role=\"list\" [attr.aria-label]=\"label() | translate\">\n @for (step of steps(); track step; let i = $index) {\n <li id=\"step-{{i}}\" class=\"stepper-item\" [ngClass]=\"{\n 'stepper-item-current': i === activeStep(),\n 'stepper-item-completed': i < activeStep()}\"\n [attr.aria-current]=\"i === activeStep() ? 'step' : null\">\n <span class=\"stepper-label\">\n <span class=\"visually-hidden\">{{i + 1}}</span>\n {{step | translate}}\n </span>\n </li>\n }\n</ul>\n" }]
4170
4546
  }], propDecorators: { activeStep: [{ type: i0.Input, args: [{ isSignal: true, alias: "activeStep", required: false }] }], steps: [{ type: i0.Input, args: [{ isSignal: true, alias: "steps", required: false }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }] } });
4171
4547
 
4172
4548
  const FILE_SIZE_UNITS_FR = ['o', 'Ko', 'Mo', 'Go', 'To', 'Po', 'Eo', 'Zo', 'Yo'];
@@ -4177,8 +4553,12 @@ class FormatFileSizePipe {
4177
4553
  }
4178
4554
  transform(sizeInBytes) {
4179
4555
  const units = this.translate.currentLang === 'fr' ? FILE_SIZE_UNITS_FR : FILE_SIZE_UNITS_DEFAULT;
4556
+ // Garde: 0/negatif/nullish -> Math.log donne -Infinity => 'NaN undefined'.
4557
+ if (!sizeInBytes || sizeInBytes < 1) {
4558
+ return `0 ${units[0]}`;
4559
+ }
4180
4560
  let power = Math.round(Math.log(sizeInBytes) / Math.log(1024));
4181
- power = Math.min(power, units.length - 1);
4561
+ power = Math.max(0, Math.min(power, units.length - 1));
4182
4562
  const size = sizeInBytes / Math.pow(1024, power); // size in new units
4183
4563
  const formattedSize = Math.round(size * 10) / 10; // keep up to 1 decimal
4184
4564
  const unit = units[power];
@@ -4194,18 +4574,17 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.20", ngImpo
4194
4574
 
4195
4575
  class FileToDownloadComponent {
4196
4576
  constructor() {
4197
- this.translate = inject(TranslateService);
4198
4577
  this.iconType = IconTypeEnum;
4199
4578
  this.iconSize = IconSizeEnum;
4200
4579
  this.spriteIcon = SpriteIconEnum.toolbarDownload;
4201
4580
  this.attachments = input.required(...(ngDevMode ? [{ debugName: "attachments" }] : []));
4202
4581
  }
4203
4582
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: FileToDownloadComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
4204
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.20", type: FileToDownloadComponent, isStandalone: true, selector: "cw-file-to-download", inputs: { attachments: { classPropertyName: "attachments", publicName: "attachments", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0, template: "<!-- If one file -->\n@if (attachments().length === 1 ) {\n<ng-container *ngTemplateOutlet=\"file;context:{attachment:attachments()[0]}\"></ng-container>\n}\n\n<!-- If two files or more, li loop -->\n@if (attachments().length > 1) {\n<ul class=\"list-unstyled file-to-download-items\">\n @for (attachment of attachments(); track attachment) {\n <li class=\"file-to-download-list-item\">\n <ng-container *ngTemplateOutlet=\"file;context:{attachment:attachment}\"></ng-container>\n </li>\n }\n</ul>\n}\n\n<ng-template #file let-attachment=\"attachment\">\n <a [href]=\"attachment.url\" class=\"file-to-download-link\" target=\"_blank\">\n <span class=\"file-to-download-name\">\n {{ attachment.label ? attachment.label : ('_SHARED.ATTACHMENT_DEFAULT_LABEL' | translate ) }}\n </span>\n <span class=\"file-to-download-info\">\n @if (attachment.extension && attachment.size) {\n {{attachment.extension.toUpperCase()}} {{attachment.size * 1024 | formatFileSize}}\n }\n <cw-icon [icon]=\"spriteIcon\" font=\"optyweb\" [label]=\"'_COMMON.NEW_WINDOW' |translate\" [type]=\"iconType.default\"\n [iconSize]=\"iconSize['md']\" iconCssClass=\"file-to-download-download\"></cw-icon>\n </span>\n </a>\n</ng-template>\n", dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: IconComponent, selector: "cw-icon", inputs: ["icon", "label", "type", "iconSize", "iconCssClass", "iconUiType", "iconColorCustom", "spritePath"] }, { kind: "pipe", type: TranslatePipe, name: "translate" }, { kind: "pipe", type: FormatFileSizePipe, name: "formatFileSize" }] }); }
4583
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.20", type: FileToDownloadComponent, isStandalone: true, selector: "cw-file-to-download", inputs: { attachments: { classPropertyName: "attachments", publicName: "attachments", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0, template: "<!-- If one file -->\n@if (attachments().length === 1 ) {\n<ng-container *ngTemplateOutlet=\"file;context:{attachment:attachments()[0]}\"></ng-container>\n}\n\n<!-- If two files or more, li loop -->\n@if (attachments().length > 1) {\n<ul class=\"list-unstyled file-to-download-items\">\n @for (attachment of attachments(); track attachment) {\n <li class=\"file-to-download-list-item\">\n <ng-container *ngTemplateOutlet=\"file;context:{attachment:attachment}\"></ng-container>\n </li>\n }\n</ul>\n}\n\n<ng-template #file let-attachment=\"attachment\">\n <a [href]=\"attachment.url\" class=\"file-to-download-link\" target=\"_blank\" rel=\"noopener noreferrer\">\n <span class=\"file-to-download-name\">\n {{ attachment.label ? attachment.label : ('_SHARED.ATTACHMENT_DEFAULT_LABEL' | translate ) }}\n </span>\n <span class=\"file-to-download-info\">\n @if (attachment.extension && attachment.size) {\n {{attachment.extension.toUpperCase()}} {{attachment.size * 1024 | formatFileSize}}\n }\n <cw-icon [icon]=\"spriteIcon\" font=\"optyweb\" [label]=\"'_COMMON.NEW_WINDOW' |translate\" [type]=\"iconType.default\"\n [iconSize]=\"iconSize['md']\" iconCssClass=\"file-to-download-download\"></cw-icon>\n </span>\n </a>\n</ng-template>\n", dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: IconComponent, selector: "cw-icon", inputs: ["icon", "label", "type", "iconSize", "iconCssClass", "iconUiType", "iconColorCustom", "spritePath"] }, { kind: "pipe", type: TranslatePipe, name: "translate" }, { kind: "pipe", type: FormatFileSizePipe, name: "formatFileSize" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
4205
4584
  }
4206
4585
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: FileToDownloadComponent, decorators: [{
4207
4586
  type: Component,
4208
- args: [{ selector: 'cw-file-to-download', imports: [NgTemplateOutlet, TranslatePipe, FormatFileSizePipe, IconComponent], template: "<!-- If one file -->\n@if (attachments().length === 1 ) {\n<ng-container *ngTemplateOutlet=\"file;context:{attachment:attachments()[0]}\"></ng-container>\n}\n\n<!-- If two files or more, li loop -->\n@if (attachments().length > 1) {\n<ul class=\"list-unstyled file-to-download-items\">\n @for (attachment of attachments(); track attachment) {\n <li class=\"file-to-download-list-item\">\n <ng-container *ngTemplateOutlet=\"file;context:{attachment:attachment}\"></ng-container>\n </li>\n }\n</ul>\n}\n\n<ng-template #file let-attachment=\"attachment\">\n <a [href]=\"attachment.url\" class=\"file-to-download-link\" target=\"_blank\">\n <span class=\"file-to-download-name\">\n {{ attachment.label ? attachment.label : ('_SHARED.ATTACHMENT_DEFAULT_LABEL' | translate ) }}\n </span>\n <span class=\"file-to-download-info\">\n @if (attachment.extension && attachment.size) {\n {{attachment.extension.toUpperCase()}} {{attachment.size * 1024 | formatFileSize}}\n }\n <cw-icon [icon]=\"spriteIcon\" font=\"optyweb\" [label]=\"'_COMMON.NEW_WINDOW' |translate\" [type]=\"iconType.default\"\n [iconSize]=\"iconSize['md']\" iconCssClass=\"file-to-download-download\"></cw-icon>\n </span>\n </a>\n</ng-template>\n" }]
4587
+ args: [{ selector: 'cw-file-to-download', changeDetection: ChangeDetectionStrategy.OnPush, imports: [NgTemplateOutlet, TranslatePipe, FormatFileSizePipe, IconComponent], template: "<!-- If one file -->\n@if (attachments().length === 1 ) {\n<ng-container *ngTemplateOutlet=\"file;context:{attachment:attachments()[0]}\"></ng-container>\n}\n\n<!-- If two files or more, li loop -->\n@if (attachments().length > 1) {\n<ul class=\"list-unstyled file-to-download-items\">\n @for (attachment of attachments(); track attachment) {\n <li class=\"file-to-download-list-item\">\n <ng-container *ngTemplateOutlet=\"file;context:{attachment:attachment}\"></ng-container>\n </li>\n }\n</ul>\n}\n\n<ng-template #file let-attachment=\"attachment\">\n <a [href]=\"attachment.url\" class=\"file-to-download-link\" target=\"_blank\" rel=\"noopener noreferrer\">\n <span class=\"file-to-download-name\">\n {{ attachment.label ? attachment.label : ('_SHARED.ATTACHMENT_DEFAULT_LABEL' | translate ) }}\n </span>\n <span class=\"file-to-download-info\">\n @if (attachment.extension && attachment.size) {\n {{attachment.extension.toUpperCase()}} {{attachment.size * 1024 | formatFileSize}}\n }\n <cw-icon [icon]=\"spriteIcon\" font=\"optyweb\" [label]=\"'_COMMON.NEW_WINDOW' |translate\" [type]=\"iconType.default\"\n [iconSize]=\"iconSize['md']\" iconCssClass=\"file-to-download-download\"></cw-icon>\n </span>\n </a>\n</ng-template>\n" }]
4209
4588
  }], propDecorators: { attachments: [{ type: i0.Input, args: [{ isSignal: true, alias: "attachments", required: true }] }] } });
4210
4589
 
4211
4590
  var NumericalRangeTypeEnum;
@@ -4263,11 +4642,11 @@ class NumericalRangeComponent {
4263
4642
  this.newAmount.emit(next);
4264
4643
  }
4265
4644
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: NumericalRangeComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
4266
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.20", type: NumericalRangeComponent, isStandalone: true, selector: "cw-numerical-range", inputs: { type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, amount: { classPropertyName: "amount", publicName: "amount", isSignal: true, isRequired: false, transformFunction: null }, withIcon: { classPropertyName: "withIcon", publicName: "withIcon", isSignal: true, isRequired: false, transformFunction: null }, withLabelVisible: { classPropertyName: "withLabelVisible", publicName: "withLabelVisible", isSignal: true, isRequired: false, transformFunction: null }, labelPosition: { classPropertyName: "labelPosition", publicName: "labelPosition", isSignal: true, isRequired: false, transformFunction: null }, ceil: { classPropertyName: "ceil", publicName: "ceil", isSignal: true, isRequired: false, transformFunction: null }, floor: { classPropertyName: "floor", publicName: "floor", isSignal: true, isRequired: false, transformFunction: null }, isDisabled: { classPropertyName: "isDisabled", publicName: "isDisabled", isSignal: true, isRequired: false, transformFunction: null }, autoChangeAmount: { classPropertyName: "autoChangeAmount", publicName: "autoChangeAmount", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { amount: "amountChange", newAmount: "newAmount" }, ngImport: i0, template: "<div class=\"numerical-range text-center\" [ngClass]=\"'numerical-range-' + type()\">\n\n @if (labelPosition() == labelPositionValue.outside && withLabelVisible()) {\n <div class=\"numerical-range-label\" aria-hidden=\"true\">\n @if (withIcon() && (type() == numericalRangeType.largeWhite || type() == numericalRangeType.largeGrey)) {\n <cw-icon [icon]=\"withIcon()\" [iconSize]=\"iconSize['lg']\"></cw-icon>\n }\n <span>{{ label() }}</span>\n </div>\n }\n\n <div class=\"numerical-range-container\">\n <cw-button [isDisabled]=\"isDisabled() || amount() <= floor()\" [label]=\"'Diminuer ' + amount() + ' ' + label()\"\n [withIcon]=\"spriteIcon.toolbarMinus\" [withOnlyIcon]=\"true\" [type]=\"buttonType.primary\"\n [iconSize]=\"buttonIconSize.small\" (btnAction)=\"decreaseAmount()\">\n </cw-button>\n\n <div class=\"numerical-range-wrapper\">\n <div class=\"numerical-range-amount\" aria-live=\"polite\" aria-atomic=\"true\">\n {{ amount() }}\n @if (!withLabelVisible() && !withIcon()) {\n <span class=\"sr-only\">{{ label() }}</span>\n }\n </div>\n\n @if ((type() !== numericalRangeType.largeGrey && type() !== numericalRangeType.largeWhite) && (withIcon() ||\n withLabelVisible())) {\n <div class=\"numerical-range-label\">\n @if (withLabelVisible() && labelPosition() == labelPositionValue.inside) {\n @if (withIcon()) {\n <cw-icon [icon]=\"withIcon()\" [iconSize]=\"iconSize['lg']\" aria-hidden=\"true\"></cw-icon>\n }\n <span>{{ label() }}</span>\n }\n @else {\n @if (withIcon()) {\n <cw-icon [icon]=\"withIcon()\" [label]=\"label()\" [iconSize]=\"iconSize['lg']\"></cw-icon>\n }\n }\n </div>\n }\n </div>\n\n <cw-button [isDisabled]=\"isDisabled() || amount() >= ceil()\" [label]=\"'Augmenter ' + amount() + ' ' + label()\"\n [withIcon]=\"spriteIcon.toolbarPlus\" [withOnlyIcon]=\"true\" [type]=\"buttonType.primary\"\n [iconSize]=\"buttonIconSize.small\" (btnAction)=\"increaseAmount()\">\n </cw-button>\n </div>\n</div>\n", dependencies: [{ kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "component", type: IconComponent, selector: "cw-icon", inputs: ["icon", "label", "type", "iconSize", "iconCssClass", "iconUiType", "iconColorCustom", "spritePath"] }, { kind: "component", type: ButtonComponent, selector: "cw-button", inputs: ["type", "label", "id", "link", "isDropdown", "hideCaret", "withIcon", "withOnlyIcon", "iconSize", "iconPosition", "dropdownPosition", "isMinWidth", "isDisabled", "isLoading", "cssClass", "dataTest", "skeletonMode", "withTooltip", "tooltipText", "tooltipTitle", "tooltipTrigger", "tooltipPosition", "tooltipType"], outputs: ["btnAction", "dropDownClicked"] }] }); }
4645
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.20", type: NumericalRangeComponent, isStandalone: true, selector: "cw-numerical-range", inputs: { type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, amount: { classPropertyName: "amount", publicName: "amount", isSignal: true, isRequired: false, transformFunction: null }, withIcon: { classPropertyName: "withIcon", publicName: "withIcon", isSignal: true, isRequired: false, transformFunction: null }, withLabelVisible: { classPropertyName: "withLabelVisible", publicName: "withLabelVisible", isSignal: true, isRequired: false, transformFunction: null }, labelPosition: { classPropertyName: "labelPosition", publicName: "labelPosition", isSignal: true, isRequired: false, transformFunction: null }, ceil: { classPropertyName: "ceil", publicName: "ceil", isSignal: true, isRequired: false, transformFunction: null }, floor: { classPropertyName: "floor", publicName: "floor", isSignal: true, isRequired: false, transformFunction: null }, isDisabled: { classPropertyName: "isDisabled", publicName: "isDisabled", isSignal: true, isRequired: false, transformFunction: null }, autoChangeAmount: { classPropertyName: "autoChangeAmount", publicName: "autoChangeAmount", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { amount: "amountChange", newAmount: "newAmount" }, ngImport: i0, template: "<div class=\"numerical-range text-center\" [ngClass]=\"'numerical-range-' + type()\">\n\n @if (labelPosition() === labelPositionValue.outside && withLabelVisible()) {\n <div class=\"numerical-range-label\" aria-hidden=\"true\">\n @if (withIcon() && (type() === numericalRangeType.largeWhite || type() === numericalRangeType.largeGrey)) {\n <cw-icon [icon]=\"withIcon()\" [iconSize]=\"iconSize['lg']\"></cw-icon>\n }\n <span>{{ label() }}</span>\n </div>\n }\n\n <div class=\"numerical-range-container\">\n <cw-button [isDisabled]=\"isDisabled() || amount() <= floor()\" [label]=\"'Diminuer ' + amount() + ' ' + label()\"\n [withIcon]=\"spriteIcon.toolbarMinus\" [withOnlyIcon]=\"true\" [type]=\"buttonType.primary\"\n [iconSize]=\"buttonIconSize.small\" (btnAction)=\"decreaseAmount()\">\n </cw-button>\n\n <div class=\"numerical-range-wrapper\">\n <div class=\"numerical-range-amount\" aria-live=\"polite\" aria-atomic=\"true\">\n {{ amount() }}\n @if (!withLabelVisible() && !withIcon()) {\n <span class=\"sr-only\">{{ label() }}</span>\n }\n </div>\n\n @if ((type() !== numericalRangeType.largeGrey && type() !== numericalRangeType.largeWhite) && (withIcon() ||\n withLabelVisible())) {\n <div class=\"numerical-range-label\">\n @if (withLabelVisible() && labelPosition() === labelPositionValue.inside) {\n @if (withIcon()) {\n <cw-icon [icon]=\"withIcon()\" [iconSize]=\"iconSize['lg']\" aria-hidden=\"true\"></cw-icon>\n }\n <span>{{ label() }}</span>\n }\n @else {\n @if (withIcon()) {\n <cw-icon [icon]=\"withIcon()\" [label]=\"label()\" [iconSize]=\"iconSize['lg']\"></cw-icon>\n }\n }\n </div>\n }\n </div>\n\n <cw-button [isDisabled]=\"isDisabled() || amount() >= ceil()\" [label]=\"'Augmenter ' + amount() + ' ' + label()\"\n [withIcon]=\"spriteIcon.toolbarPlus\" [withOnlyIcon]=\"true\" [type]=\"buttonType.primary\"\n [iconSize]=\"buttonIconSize.small\" (btnAction)=\"increaseAmount()\">\n </cw-button>\n </div>\n</div>\n", dependencies: [{ kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "component", type: IconComponent, selector: "cw-icon", inputs: ["icon", "label", "type", "iconSize", "iconCssClass", "iconUiType", "iconColorCustom", "spritePath"] }, { kind: "component", type: ButtonComponent, selector: "cw-button", inputs: ["type", "label", "id", "link", "isDropdown", "hideCaret", "withIcon", "withOnlyIcon", "iconSize", "iconPosition", "dropdownPosition", "isMinWidth", "isDisabled", "isLoading", "cssClass", "dataTest", "skeletonMode", "withTooltip", "tooltipText", "tooltipTitle", "tooltipTrigger", "tooltipPosition", "tooltipType"], outputs: ["btnAction", "dropDownClicked"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
4267
4646
  }
4268
4647
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: NumericalRangeComponent, decorators: [{
4269
4648
  type: Component,
4270
- args: [{ selector: 'cw-numerical-range', imports: [NgClass, IconComponent, ButtonComponent], standalone: true, template: "<div class=\"numerical-range text-center\" [ngClass]=\"'numerical-range-' + type()\">\n\n @if (labelPosition() == labelPositionValue.outside && withLabelVisible()) {\n <div class=\"numerical-range-label\" aria-hidden=\"true\">\n @if (withIcon() && (type() == numericalRangeType.largeWhite || type() == numericalRangeType.largeGrey)) {\n <cw-icon [icon]=\"withIcon()\" [iconSize]=\"iconSize['lg']\"></cw-icon>\n }\n <span>{{ label() }}</span>\n </div>\n }\n\n <div class=\"numerical-range-container\">\n <cw-button [isDisabled]=\"isDisabled() || amount() <= floor()\" [label]=\"'Diminuer ' + amount() + ' ' + label()\"\n [withIcon]=\"spriteIcon.toolbarMinus\" [withOnlyIcon]=\"true\" [type]=\"buttonType.primary\"\n [iconSize]=\"buttonIconSize.small\" (btnAction)=\"decreaseAmount()\">\n </cw-button>\n\n <div class=\"numerical-range-wrapper\">\n <div class=\"numerical-range-amount\" aria-live=\"polite\" aria-atomic=\"true\">\n {{ amount() }}\n @if (!withLabelVisible() && !withIcon()) {\n <span class=\"sr-only\">{{ label() }}</span>\n }\n </div>\n\n @if ((type() !== numericalRangeType.largeGrey && type() !== numericalRangeType.largeWhite) && (withIcon() ||\n withLabelVisible())) {\n <div class=\"numerical-range-label\">\n @if (withLabelVisible() && labelPosition() == labelPositionValue.inside) {\n @if (withIcon()) {\n <cw-icon [icon]=\"withIcon()\" [iconSize]=\"iconSize['lg']\" aria-hidden=\"true\"></cw-icon>\n }\n <span>{{ label() }}</span>\n }\n @else {\n @if (withIcon()) {\n <cw-icon [icon]=\"withIcon()\" [label]=\"label()\" [iconSize]=\"iconSize['lg']\"></cw-icon>\n }\n }\n </div>\n }\n </div>\n\n <cw-button [isDisabled]=\"isDisabled() || amount() >= ceil()\" [label]=\"'Augmenter ' + amount() + ' ' + label()\"\n [withIcon]=\"spriteIcon.toolbarPlus\" [withOnlyIcon]=\"true\" [type]=\"buttonType.primary\"\n [iconSize]=\"buttonIconSize.small\" (btnAction)=\"increaseAmount()\">\n </cw-button>\n </div>\n</div>\n" }]
4649
+ args: [{ selector: 'cw-numerical-range', imports: [NgClass, IconComponent, ButtonComponent], standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"numerical-range text-center\" [ngClass]=\"'numerical-range-' + type()\">\n\n @if (labelPosition() === labelPositionValue.outside && withLabelVisible()) {\n <div class=\"numerical-range-label\" aria-hidden=\"true\">\n @if (withIcon() && (type() === numericalRangeType.largeWhite || type() === numericalRangeType.largeGrey)) {\n <cw-icon [icon]=\"withIcon()\" [iconSize]=\"iconSize['lg']\"></cw-icon>\n }\n <span>{{ label() }}</span>\n </div>\n }\n\n <div class=\"numerical-range-container\">\n <cw-button [isDisabled]=\"isDisabled() || amount() <= floor()\" [label]=\"'Diminuer ' + amount() + ' ' + label()\"\n [withIcon]=\"spriteIcon.toolbarMinus\" [withOnlyIcon]=\"true\" [type]=\"buttonType.primary\"\n [iconSize]=\"buttonIconSize.small\" (btnAction)=\"decreaseAmount()\">\n </cw-button>\n\n <div class=\"numerical-range-wrapper\">\n <div class=\"numerical-range-amount\" aria-live=\"polite\" aria-atomic=\"true\">\n {{ amount() }}\n @if (!withLabelVisible() && !withIcon()) {\n <span class=\"sr-only\">{{ label() }}</span>\n }\n </div>\n\n @if ((type() !== numericalRangeType.largeGrey && type() !== numericalRangeType.largeWhite) && (withIcon() ||\n withLabelVisible())) {\n <div class=\"numerical-range-label\">\n @if (withLabelVisible() && labelPosition() === labelPositionValue.inside) {\n @if (withIcon()) {\n <cw-icon [icon]=\"withIcon()\" [iconSize]=\"iconSize['lg']\" aria-hidden=\"true\"></cw-icon>\n }\n <span>{{ label() }}</span>\n }\n @else {\n @if (withIcon()) {\n <cw-icon [icon]=\"withIcon()\" [label]=\"label()\" [iconSize]=\"iconSize['lg']\"></cw-icon>\n }\n }\n </div>\n }\n </div>\n\n <cw-button [isDisabled]=\"isDisabled() || amount() >= ceil()\" [label]=\"'Augmenter ' + amount() + ' ' + label()\"\n [withIcon]=\"spriteIcon.toolbarPlus\" [withOnlyIcon]=\"true\" [type]=\"buttonType.primary\"\n [iconSize]=\"buttonIconSize.small\" (btnAction)=\"increaseAmount()\">\n </cw-button>\n </div>\n</div>\n" }]
4271
4650
  }], propDecorators: { type: [{ type: i0.Input, args: [{ isSignal: true, alias: "type", required: false }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], amount: [{ type: i0.Input, args: [{ isSignal: true, alias: "amount", required: false }] }, { type: i0.Output, args: ["amountChange"] }], withIcon: [{ type: i0.Input, args: [{ isSignal: true, alias: "withIcon", required: false }] }], withLabelVisible: [{ type: i0.Input, args: [{ isSignal: true, alias: "withLabelVisible", required: false }] }], labelPosition: [{ type: i0.Input, args: [{ isSignal: true, alias: "labelPosition", required: false }] }], ceil: [{ type: i0.Input, args: [{ isSignal: true, alias: "ceil", required: false }] }], floor: [{ type: i0.Input, args: [{ isSignal: true, alias: "floor", required: false }] }], isDisabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "isDisabled", required: false }] }], autoChangeAmount: [{ type: i0.Input, args: [{ isSignal: true, alias: "autoChangeAmount", required: false }] }], newAmount: [{ type: i0.Output, args: ["newAmount"] }] } });
4272
4651
 
4273
4652
  class ImageComponent {
@@ -4280,11 +4659,11 @@ class ImageComponent {
4280
4659
  this.height = input('', ...(ngDevMode ? [{ debugName: "height" }] : []));
4281
4660
  }
4282
4661
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: ImageComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
4283
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "20.3.20", type: ImageComponent, isStandalone: true, selector: "cw-image", inputs: { source: { classPropertyName: "source", publicName: "source", isSignal: true, isRequired: false, transformFunction: null }, alt: { classPropertyName: "alt", publicName: "alt", isSignal: true, isRequired: false, transformFunction: null }, isAriaHidden: { classPropertyName: "isAriaHidden", publicName: "isAriaHidden", isSignal: true, isRequired: false, transformFunction: null }, cssClass: { classPropertyName: "cssClass", publicName: "cssClass", isSignal: true, isRequired: false, transformFunction: null }, width: { classPropertyName: "width", publicName: "width", isSignal: true, isRequired: false, transformFunction: null }, height: { classPropertyName: "height", publicName: "height", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<img [src]=\"source()\" [attr.aria-hidden]=\"isAriaHidden() ? 'true' : null\" [class]=\"cssClass()\" [alt]=\"alt()\"\n [attr.width]=\"width() ? width() : null\" [attr.height]=\"height() ? height() : null\">\n" }); }
4662
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "20.3.20", type: ImageComponent, isStandalone: true, selector: "cw-image", inputs: { source: { classPropertyName: "source", publicName: "source", isSignal: true, isRequired: false, transformFunction: null }, alt: { classPropertyName: "alt", publicName: "alt", isSignal: true, isRequired: false, transformFunction: null }, isAriaHidden: { classPropertyName: "isAriaHidden", publicName: "isAriaHidden", isSignal: true, isRequired: false, transformFunction: null }, cssClass: { classPropertyName: "cssClass", publicName: "cssClass", isSignal: true, isRequired: false, transformFunction: null }, width: { classPropertyName: "width", publicName: "width", isSignal: true, isRequired: false, transformFunction: null }, height: { classPropertyName: "height", publicName: "height", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<img [src]=\"source()\" [attr.aria-hidden]=\"isAriaHidden() ? 'true' : null\" [class]=\"cssClass()\" [alt]=\"alt()\"\n [attr.width]=\"width() ? width() : null\" [attr.height]=\"height() ? height() : null\">\n", changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
4284
4663
  }
4285
4664
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: ImageComponent, decorators: [{
4286
4665
  type: Component,
4287
- args: [{ selector: 'cw-image', standalone: true, template: "<img [src]=\"source()\" [attr.aria-hidden]=\"isAriaHidden() ? 'true' : null\" [class]=\"cssClass()\" [alt]=\"alt()\"\n [attr.width]=\"width() ? width() : null\" [attr.height]=\"height() ? height() : null\">\n" }]
4666
+ args: [{ selector: 'cw-image', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, template: "<img [src]=\"source()\" [attr.aria-hidden]=\"isAriaHidden() ? 'true' : null\" [class]=\"cssClass()\" [alt]=\"alt()\"\n [attr.width]=\"width() ? width() : null\" [attr.height]=\"height() ? height() : null\">\n" }]
4288
4667
  }], propDecorators: { source: [{ type: i0.Input, args: [{ isSignal: true, alias: "source", required: false }] }], alt: [{ type: i0.Input, args: [{ isSignal: true, alias: "alt", required: false }] }], isAriaHidden: [{ type: i0.Input, args: [{ isSignal: true, alias: "isAriaHidden", required: false }] }], cssClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "cssClass", required: false }] }], width: [{ type: i0.Input, args: [{ isSignal: true, alias: "width", required: false }] }], height: [{ type: i0.Input, args: [{ isSignal: true, alias: "height", required: false }] }] } });
4289
4668
 
4290
4669
  var TitleTagEnum;
@@ -4312,11 +4691,11 @@ class TitleComponent {
4312
4691
  ].filter(Boolean).join(' '), ...(ngDevMode ? [{ debugName: "classes" }] : []));
4313
4692
  }
4314
4693
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: TitleComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
4315
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.20", type: TitleComponent, isStandalone: true, selector: "cw-title", inputs: { tag: { classPropertyName: "tag", publicName: "tag", isSignal: true, isRequired: false, transformFunction: null }, context: { classPropertyName: "context", publicName: "context", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "@switch (tag()) {\r\n @case ('h1') {\r\n <h1 [class]=\"classes()\">\r\n <ng-container *ngTemplateOutlet=\"content\" />\r\n </h1>\r\n }\r\n @case ('h2') {\r\n <h2 [class]=\"classes()\">\r\n <ng-container *ngTemplateOutlet=\"content\" />\r\n </h2>\r\n }\r\n @case ('h3') {\r\n <h3 [class]=\"classes()\">\r\n <ng-container *ngTemplateOutlet=\"content\" />\r\n </h3>\r\n }\r\n @case ('h4') {\r\n <h4 [class]=\"classes()\">\r\n <ng-container *ngTemplateOutlet=\"content\" />\r\n </h4>\r\n }\r\n}\r\n\r\n<ng-template #content>\r\n <ng-content />\r\n</ng-template>\r\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }] }); }
4694
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.20", type: TitleComponent, isStandalone: true, selector: "cw-title", inputs: { tag: { classPropertyName: "tag", publicName: "tag", isSignal: true, isRequired: false, transformFunction: null }, context: { classPropertyName: "context", publicName: "context", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "@switch (tag()) {\r\n @case ('h1') {\r\n <h1 [class]=\"classes()\">\r\n <ng-container *ngTemplateOutlet=\"content\" />\r\n </h1>\r\n }\r\n @case ('h2') {\r\n <h2 [class]=\"classes()\">\r\n <ng-container *ngTemplateOutlet=\"content\" />\r\n </h2>\r\n }\r\n @case ('h3') {\r\n <h3 [class]=\"classes()\">\r\n <ng-container *ngTemplateOutlet=\"content\" />\r\n </h3>\r\n }\r\n @case ('h4') {\r\n <h4 [class]=\"classes()\">\r\n <ng-container *ngTemplateOutlet=\"content\" />\r\n </h4>\r\n }\r\n}\r\n\r\n<ng-template #content>\r\n <ng-content />\r\n</ng-template>\r\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
4316
4695
  }
4317
4696
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: TitleComponent, decorators: [{
4318
4697
  type: Component,
4319
- args: [{ selector: 'cw-title', standalone: true, imports: [
4698
+ args: [{ selector: 'cw-title', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, imports: [
4320
4699
  CommonModule
4321
4700
  ], template: "@switch (tag()) {\r\n @case ('h1') {\r\n <h1 [class]=\"classes()\">\r\n <ng-container *ngTemplateOutlet=\"content\" />\r\n </h1>\r\n }\r\n @case ('h2') {\r\n <h2 [class]=\"classes()\">\r\n <ng-container *ngTemplateOutlet=\"content\" />\r\n </h2>\r\n }\r\n @case ('h3') {\r\n <h3 [class]=\"classes()\">\r\n <ng-container *ngTemplateOutlet=\"content\" />\r\n </h3>\r\n }\r\n @case ('h4') {\r\n <h4 [class]=\"classes()\">\r\n <ng-container *ngTemplateOutlet=\"content\" />\r\n </h4>\r\n }\r\n}\r\n\r\n<ng-template #content>\r\n <ng-content />\r\n</ng-template>\r\n" }]
4322
4701
  }], propDecorators: { tag: [{ type: i0.Input, args: [{ isSignal: true, alias: "tag", required: false }] }], context: [{ type: i0.Input, args: [{ isSignal: true, alias: "context", required: false }] }] } });
@@ -4326,11 +4705,11 @@ class SkipLinksComponent {
4326
4705
  this.links = input([], ...(ngDevMode ? [{ debugName: "links" }] : []));
4327
4706
  }
4328
4707
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: SkipLinksComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
4329
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.20", type: SkipLinksComponent, isStandalone: true, selector: "cw-skiplinks", inputs: { links: { classPropertyName: "links", publicName: "links", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<ul class=\"skip-links d-flex-h mb-0\">\r\n @for (link of links(); track link.id) {\r\n <li class=\"list-inline-item\">\r\n <a [href]=\"'#' + link.id\">{{ link.label }}</a>\r\n </li>\r\n }\r\n</ul>\r\n", dependencies: [{ kind: "ngmodule", type: CommonModule }] }); }
4708
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.20", type: SkipLinksComponent, isStandalone: true, selector: "cw-skiplinks", inputs: { links: { classPropertyName: "links", publicName: "links", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<ul class=\"skip-links d-flex-h mb-0\">\r\n @for (link of links(); track link.id) {\r\n <li class=\"list-inline-item\">\r\n <a [href]=\"'#' + link.id\">{{ link.label }}</a>\r\n </li>\r\n }\r\n</ul>\r\n", dependencies: [{ kind: "ngmodule", type: CommonModule }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
4330
4709
  }
4331
4710
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: SkipLinksComponent, decorators: [{
4332
4711
  type: Component,
4333
- args: [{ selector: 'cw-skiplinks', standalone: true, imports: [CommonModule], template: "<ul class=\"skip-links d-flex-h mb-0\">\r\n @for (link of links(); track link.id) {\r\n <li class=\"list-inline-item\">\r\n <a [href]=\"'#' + link.id\">{{ link.label }}</a>\r\n </li>\r\n }\r\n</ul>\r\n" }]
4712
+ args: [{ selector: 'cw-skiplinks', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, imports: [CommonModule], template: "<ul class=\"skip-links d-flex-h mb-0\">\r\n @for (link of links(); track link.id) {\r\n <li class=\"list-inline-item\">\r\n <a [href]=\"'#' + link.id\">{{ link.label }}</a>\r\n </li>\r\n }\r\n</ul>\r\n" }]
4334
4713
  }], propDecorators: { links: [{ type: i0.Input, args: [{ isSignal: true, alias: "links", required: false }] }] } });
4335
4714
 
4336
4715
  class RequiredInfoComponent {
@@ -4338,11 +4717,11 @@ class RequiredInfoComponent {
4338
4717
  this.allFieldsRequired = input(false, ...(ngDevMode ? [{ debugName: "allFieldsRequired" }] : []));
4339
4718
  }
4340
4719
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: RequiredInfoComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
4341
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.20", type: RequiredInfoComponent, isStandalone: true, selector: "cw-required-info", inputs: { allFieldsRequired: { classPropertyName: "allFieldsRequired", publicName: "allFieldsRequired", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<p class=\"field-required\">\r\n @if (allFieldsRequired()) {\r\n Tous les champs sont obligatoires.\r\n }\r\n @else {\r\n <span class=\"text-danger\">*</span>&nbsp;Champs obligatoires\r\n }\r\n</p>\r\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: TranslateModule }] }); }
4720
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.20", type: RequiredInfoComponent, isStandalone: true, selector: "cw-required-info", inputs: { allFieldsRequired: { classPropertyName: "allFieldsRequired", publicName: "allFieldsRequired", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<p class=\"field-required\">\r\n @if (allFieldsRequired()) {\r\n Tous les champs sont obligatoires.\r\n }\r\n @else {\r\n <span class=\"text-danger\">*</span>&nbsp;Champs obligatoires\r\n }\r\n</p>\r\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: TranslateModule }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
4342
4721
  }
4343
4722
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: RequiredInfoComponent, decorators: [{
4344
4723
  type: Component,
4345
- args: [{ selector: 'cw-required-info', standalone: true, imports: [
4724
+ args: [{ selector: 'cw-required-info', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, imports: [
4346
4725
  CommonModule,
4347
4726
  TranslateModule,
4348
4727
  ], template: "<p class=\"field-required\">\r\n @if (allFieldsRequired()) {\r\n Tous les champs sont obligatoires.\r\n }\r\n @else {\r\n <span class=\"text-danger\">*</span>&nbsp;Champs obligatoires\r\n }\r\n</p>\r\n" }]
@@ -4361,11 +4740,11 @@ class BreadcrumbComponent {
4361
4740
  return !!item.link && item.isCurrent !== true;
4362
4741
  }
4363
4742
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: BreadcrumbComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
4364
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.20", type: BreadcrumbComponent, isStandalone: true, selector: "cw-breadcrumb", inputs: { items: { classPropertyName: "items", publicName: "items", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "@if (items().length > 0) {\n <nav class=\"breadcrumb\" [attr.aria-label]=\"ariaLabel() | translate\">\n <ol class=\"breadcrumb-list list-unstyled d-flex-h mb-0\">\n @for (item of items(); track $index; let first = $first) {\n <li\n class=\"breadcrumb-item\"\n [class.breadcrumb-item-home]=\"first\"\n [class.active]=\"item.isCurrent === true\"\n >\n @if (!first) {\n <cw-icon\n class=\"breadcrumb-separator\"\n [icon]=\"separatorIcon\"\n [iconSize]=\"iconSizeEnum['2xs']\"\n [type]=\"iconType.default\"\n aria-hidden=\"true\"\n ></cw-icon>\n }\n @if (isClickable(item)) {\n <a class=\"breadcrumb-link\" [routerLink]=\"item.link\">{{ item.label | translate }}</a>\n } @else {\n <span\n class=\"breadcrumb-text\"\n [attr.aria-current]=\"item.isCurrent === true ? 'page' : null\"\n >{{ item.label | translate }}</span>\n }\n </li>\n }\n </ol>\n </nav>\n}\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "ngmodule", type: TranslateModule }, { kind: "component", type: IconComponent, selector: "cw-icon", inputs: ["icon", "label", "type", "iconSize", "iconCssClass", "iconUiType", "iconColorCustom", "spritePath"] }, { kind: "pipe", type: i2.TranslatePipe, name: "translate" }] }); }
4743
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.20", type: BreadcrumbComponent, isStandalone: true, selector: "cw-breadcrumb", inputs: { items: { classPropertyName: "items", publicName: "items", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "@if (items().length > 0) {\n <nav class=\"breadcrumb\" [attr.aria-label]=\"ariaLabel() | translate\">\n <ol class=\"breadcrumb-list list-unstyled d-flex-h mb-0\">\n @for (item of items(); track $index; let first = $first) {\n <li\n class=\"breadcrumb-item\"\n [class.breadcrumb-item-home]=\"first\"\n [class.active]=\"item.isCurrent === true\"\n >\n @if (!first) {\n <cw-icon\n class=\"breadcrumb-separator\"\n [icon]=\"separatorIcon\"\n [iconSize]=\"iconSizeEnum['2xs']\"\n [type]=\"iconType.default\"\n aria-hidden=\"true\"\n ></cw-icon>\n }\n @if (isClickable(item)) {\n <a class=\"breadcrumb-link\" [routerLink]=\"item.link\">{{ item.label | translate }}</a>\n } @else {\n <span\n class=\"breadcrumb-text\"\n [attr.aria-current]=\"item.isCurrent === true ? 'page' : null\"\n >{{ item.label | translate }}</span>\n }\n </li>\n }\n </ol>\n </nav>\n}\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "ngmodule", type: TranslateModule }, { kind: "component", type: IconComponent, selector: "cw-icon", inputs: ["icon", "label", "type", "iconSize", "iconCssClass", "iconUiType", "iconColorCustom", "spritePath"] }, { kind: "pipe", type: i2.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
4365
4744
  }
4366
4745
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: BreadcrumbComponent, decorators: [{
4367
4746
  type: Component,
4368
- args: [{ selector: 'cw-breadcrumb', standalone: true, imports: [
4747
+ args: [{ selector: 'cw-breadcrumb', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, imports: [
4369
4748
  CommonModule,
4370
4749
  RouterLink,
4371
4750
  TranslateModule,
@@ -4415,6 +4794,8 @@ class FileDropComponent {
4415
4794
  this.mode = input(FileDropModeEnum.file, ...(ngDevMode ? [{ debugName: "mode" }] : []));
4416
4795
  /** Autorise plusieurs fichiers. */
4417
4796
  this.multiple = input(false, ...(ngDevMode ? [{ debugName: "multiple" }] : []));
4797
+ /** Nombre maximum de fichiers (mode `multiple`). Limite atteinte -> la zone de depot est masquee. */
4798
+ this.maxFiles = input(...(ngDevMode ? [undefined, { debugName: "maxFiles" }] : []));
4418
4799
  /** Filtre natif + validation. Ex. `'.pdf,.png'` ou `'image/*'`. Defaut `image/*` en mode picture. */
4419
4800
  this.accept = input('', ...(ngDevMode ? [{ debugName: "accept" }] : []));
4420
4801
  /** Libelle lisible des formats acceptes (texte d'aide). Ex. `'PDF, PNG, JPG'`. */
@@ -4456,6 +4837,7 @@ class FileDropComponent {
4456
4837
  this.iconUiType = IconUiTypeEnum;
4457
4838
  this.buttonType = BoButtonTypeEnum;
4458
4839
  this.buttonIconSize = ButtonIconSizeEnum;
4840
+ this.badgeType = BadgeTypeEnum;
4459
4841
  // --- Derives ------------------------------------------------------------
4460
4842
  this.disabled = computed(() => this.disabledByForm() || this.isDisabled(), ...(ngDevMode ? [{ debugName: "disabled" }] : []));
4461
4843
  this.isPicture = computed(() => this.mode() === FileDropModeEnum.picture, ...(ngDevMode ? [{ debugName: "isPicture" }] : []));
@@ -4466,6 +4848,12 @@ class FileDropComponent {
4466
4848
  return a;
4467
4849
  return this.isPicture() ? 'image/*' : '';
4468
4850
  }, ...(ngDevMode ? [{ debugName: "effectiveAccept" }] : []));
4851
+ /** Nombre de fichiers acceptes (valides) actuellement. */
4852
+ this.acceptedCount = computed(() => this.items().filter((i) => i.status === FileDropFileStatusEnum.success).length, ...(ngDevMode ? [{ debugName: "acceptedCount" }] : []));
4853
+ /** Limite effective : 1 en mono, `maxFiles` (ou infini) en multiple. */
4854
+ this.effectiveMaxFiles = computed(() => this.multiple() ? this.maxFiles() ?? Infinity : 1, ...(ngDevMode ? [{ debugName: "effectiveMaxFiles" }] : []));
4855
+ /** Vrai quand la limite est atteinte : la zone de depot est alors masquee (seule la liste reste). */
4856
+ this.limitReached = computed(() => this.acceptedCount() >= this.effectiveMaxFiles(), ...(ngDevMode ? [{ debugName: "limitReached" }] : []));
4469
4857
  // --- ControlValueAccessor ----------------------------------------------
4470
4858
  this.onChange = () => { };
4471
4859
  this.onTouched = () => { };
@@ -4565,15 +4953,19 @@ class FileDropComponent {
4565
4953
  const accepted = [];
4566
4954
  const errored = [];
4567
4955
  const rejections = [];
4956
+ // Slots disponibles : en mono on remplace (base videe), en multiple on complete.
4957
+ let remaining = this.effectiveMaxFiles() - (this.multiple() ? this.acceptedCount() : 0);
4568
4958
  for (const file of incoming) {
4569
4959
  const reason = this.validate(file);
4570
4960
  if (reason) {
4571
4961
  errored.push({ file, status: FileDropFileStatusEnum.error, reason });
4572
4962
  rejections.push({ file, reason });
4573
4963
  }
4574
- else {
4964
+ else if (remaining > 0) {
4575
4965
  accepted.push({ file, status: FileDropFileStatusEnum.success });
4966
+ remaining--;
4576
4967
  }
4968
+ // Fichier valide au-dela de la limite : ignore silencieusement.
4577
4969
  }
4578
4970
  this.items.update((list) => {
4579
4971
  const base = this.multiple() ? list : [];
@@ -4641,24 +5033,100 @@ class FileDropComponent {
4641
5033
  return (Math.round(n * 10) / 10).toLocaleString('fr-FR');
4642
5034
  }
4643
5035
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: FileDropComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
4644
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.20", type: FileDropComponent, isStandalone: true, selector: "cw-file-drop", inputs: { mode: { classPropertyName: "mode", publicName: "mode", isSignal: true, isRequired: false, transformFunction: null }, multiple: { classPropertyName: "multiple", publicName: "multiple", isSignal: true, isRequired: false, transformFunction: null }, accept: { classPropertyName: "accept", publicName: "accept", isSignal: true, isRequired: false, transformFunction: null }, acceptLabel: { classPropertyName: "acceptLabel", publicName: "acceptLabel", isSignal: true, isRequired: false, transformFunction: null }, maxSizeMb: { classPropertyName: "maxSizeMb", publicName: "maxSizeMb", isSignal: true, isRequired: false, transformFunction: null }, recommendedDimensions: { classPropertyName: "recommendedDimensions", publicName: "recommendedDimensions", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, isDisabled: { classPropertyName: "isDisabled", publicName: "isDisabled", isSignal: true, isRequired: false, transformFunction: null }, errorMessage: { classPropertyName: "errorMessage", publicName: "errorMessage", isSignal: true, isRequired: false, transformFunction: null }, dataTest: { classPropertyName: "dataTest", publicName: "dataTest", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { filesChange: "filesChange", rejected: "rejected", retry: "retry" }, providers: [
5036
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.20", type: FileDropComponent, isStandalone: true, selector: "cw-file-drop", inputs: { mode: { classPropertyName: "mode", publicName: "mode", isSignal: true, isRequired: false, transformFunction: null }, multiple: { classPropertyName: "multiple", publicName: "multiple", isSignal: true, isRequired: false, transformFunction: null }, maxFiles: { classPropertyName: "maxFiles", publicName: "maxFiles", isSignal: true, isRequired: false, transformFunction: null }, accept: { classPropertyName: "accept", publicName: "accept", isSignal: true, isRequired: false, transformFunction: null }, acceptLabel: { classPropertyName: "acceptLabel", publicName: "acceptLabel", isSignal: true, isRequired: false, transformFunction: null }, maxSizeMb: { classPropertyName: "maxSizeMb", publicName: "maxSizeMb", isSignal: true, isRequired: false, transformFunction: null }, recommendedDimensions: { classPropertyName: "recommendedDimensions", publicName: "recommendedDimensions", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, isDisabled: { classPropertyName: "isDisabled", publicName: "isDisabled", isSignal: true, isRequired: false, transformFunction: null }, errorMessage: { classPropertyName: "errorMessage", publicName: "errorMessage", isSignal: true, isRequired: false, transformFunction: null }, dataTest: { classPropertyName: "dataTest", publicName: "dataTest", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { filesChange: "filesChange", rejected: "rejected", retry: "retry" }, providers: [
4645
5037
  {
4646
5038
  provide: NG_VALUE_ACCESSOR,
4647
5039
  useExisting: forwardRef(() => FileDropComponent),
4648
5040
  multi: true,
4649
5041
  },
4650
- ], viewQueries: [{ propertyName: "fileInput", first: true, predicate: ["fileInput"], descendants: true, isSignal: true }], ngImport: i0, template: "<input\n #fileInput\n type=\"file\"\n hidden\n [accept]=\"effectiveAccept()\"\n [multiple]=\"multiple()\"\n [disabled]=\"disabled()\"\n (change)=\"onInputChange($event)\" />\n\n@if (errorMessage()) {\n <!-- Etat erreur global (DS : Dropzone / Connexion Error) -->\n <div class=\"file-drop file-drop-error\" [attr.data-test-ctw]=\"dataTest() || null\">\n <cw-icon class=\"file-drop-icon file-drop-icon-danger\" [icon]=\"spriteIcon.error\" [iconSize]=\"iconSize.xl\"></cw-icon>\n <p class=\"file-drop-title\">{{ errorMessage() }}</p>\n <cw-button\n [type]=\"buttonType.secondary\"\n [label]=\"'_COMMON._FILE_DROP.RETRY' | translate\"\n [withIcon]=\"spriteIcon.toolbarUpload\"\n (click)=\"onRetry()\"></cw-button>\n </div>\n} @else {\n <!-- Zone de depot -->\n <div\n class=\"file-drop\"\n [class.file-drop-dragging]=\"isDragging()\"\n [class.file-drop-disabled]=\"disabled()\"\n [class.file-drop-picture]=\"isPicture()\"\n role=\"button\"\n [attr.tabindex]=\"disabled() ? -1 : 0\"\n [attr.aria-label]=\"label() || null\"\n [attr.aria-disabled]=\"disabled() || null\"\n [attr.data-test-ctw]=\"dataTest() || null\"\n (click)=\"openPicker()\"\n (keydown)=\"onKeydown($event)\"\n (dragenter)=\"onDragEnter($event)\"\n (dragover)=\"onDragOver($event)\"\n (dragleave)=\"onDragLeave($event)\"\n (drop)=\"onDrop($event)\">\n\n @if (isPicture()) {\n <span class=\"file-drop-illustration\" aria-hidden=\"true\">\n <svg width=\"64\" height=\"64\" viewBox=\"0 0 64 64\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <defs>\n <clipPath id=\"cw-file-drop-illu\"><rect width=\"64\" height=\"64\" rx=\"8\" /></clipPath>\n </defs>\n <g clip-path=\"url(#cw-file-drop-illu)\">\n <rect width=\"64\" height=\"64\" fill=\"#dde8f5\" />\n <circle cx=\"45\" cy=\"19\" r=\"7\" fill=\"#ffd166\" />\n <path d=\"M0 64 L22 36 L38 58 L50 28 L64 50 L64 64 Z\" fill=\"#8bbd5a\" />\n <path d=\"M0 64 L16 44 L32 64 Z\" fill=\"#a8c97a\" />\n </g>\n <rect x=\"0.5\" y=\"0.5\" width=\"63\" height=\"63\" rx=\"7.5\" fill=\"none\" stroke=\"#c8d6df\" />\n </svg>\n </span>\n } @else {\n <cw-icon class=\"file-drop-icon\" [icon]=\"spriteIcon.toolbarUpload\" [iconSize]=\"iconSize.xl\"></cw-icon>\n }\n\n <p class=\"file-drop-title\">\n {{ (isPicture() ? '_COMMON._FILE_DROP.DROP_PICTURE' : '_COMMON._FILE_DROP.DROP_FILE') | translate }}\n </p>\n <span class=\"file-drop-or\">{{ '_COMMON._FILE_DROP.OR' | translate }}</span>\n <cw-button\n class=\"file-drop-browse\"\n [type]=\"buttonType.secondary\"\n [label]=\"(isPicture() ? '_COMMON._FILE_DROP.BROWSE_PICTURE' : '_COMMON._FILE_DROP.BROWSE') | translate\"\n [withIcon]=\"spriteIcon.toolbarUpload\"\n [isDisabled]=\"disabled()\"\n (click)=\"onBrowse($event)\"></cw-button>\n </div>\n\n <!-- Textes d'aide -->\n @if (acceptLabel() || maxSizeMb() != null || (isPicture() && recommendedDimensions())) {\n <ul class=\"file-drop-hints\">\n @if (acceptLabel()) {\n <li>{{ '_COMMON._FILE_DROP.ACCEPTED_FORMATS' | translate: { formats: acceptLabel() } }}</li>\n }\n @if (maxSizeMb() != null) {\n <li>{{ '_COMMON._FILE_DROP.MAX_SIZE' | translate: { size: maxSizeMb() + ' Mo' } }}</li>\n }\n @if (isPicture() && recommendedDimensions()) {\n <li>{{ '_COMMON._FILE_DROP.RECOMMENDED_DIMENSIONS' | translate: { dimensions: recommendedDimensions() } }}</li>\n }\n </ul>\n }\n\n <!-- Liste des fichiers / miniatures -->\n @if (items().length) {\n @if (isPicture()) {\n <ul class=\"file-drop-previews\">\n @for (item of items(); track item.file) {\n <li class=\"file-drop-preview\" [class.file-drop-preview-error]=\"item.status === statusEnum.error\">\n @if (item.previewUrl) {\n <img class=\"file-drop-preview-img\" [src]=\"item.previewUrl\" [alt]=\"item.file.name\" />\n } @else {\n <cw-icon [icon]=\"spriteIcon.poiPhoto\" [iconSize]=\"iconSize.lg\"></cw-icon>\n }\n <button\n type=\"button\"\n class=\"file-drop-remove\"\n [disabled]=\"disabled()\"\n [attr.aria-label]=\"'_COMMON._FILE_DROP.REMOVE' | translate: { name: item.file.name }\"\n (click)=\"remove(item)\">\n <cw-icon [icon]=\"spriteIcon.close\" [iconSize]=\"iconSize.xs\"></cw-icon>\n </button>\n @if (item.status === statusEnum.error) {\n <span class=\"file-drop-preview-reason\">{{ reasonKey(item) | translate }}</span>\n }\n </li>\n }\n </ul>\n } @else {\n <ul class=\"file-drop-list\">\n @for (item of items(); track item.file) {\n <li\n class=\"file-drop-file\"\n [class.file-drop-file-success]=\"item.status === statusEnum.success\"\n [class.file-drop-file-error]=\"item.status === statusEnum.error\">\n <cw-icon\n class=\"file-drop-file-icon\"\n [icon]=\"item.status === statusEnum.error ? spriteIcon.error : spriteIcon.file\"\n [iconSize]=\"iconSize.sm\"></cw-icon>\n <span class=\"file-drop-file-name\">{{ item.file.name }}</span>\n @if (item.status === statusEnum.error) {\n <span class=\"file-drop-file-reason\">{{ reasonKey(item) | translate }}</span>\n } @else {\n <span class=\"file-drop-file-size\">{{ humanSize(item.file.size) }}</span>\n }\n <button\n type=\"button\"\n class=\"file-drop-remove\"\n [disabled]=\"disabled()\"\n [attr.aria-label]=\"'_COMMON._FILE_DROP.REMOVE' | translate: { name: item.file.name }\"\n (click)=\"remove(item)\">\n <cw-icon [icon]=\"spriteIcon.trash\" [iconSize]=\"iconSize.sm\"></cw-icon>\n </button>\n </li>\n }\n </ul>\n }\n }\n}\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "component", type: IconComponent, selector: "cw-icon", inputs: ["icon", "label", "type", "iconSize", "iconCssClass", "iconUiType", "iconColorCustom", "spritePath"] }, { kind: "component", type: ButtonComponent, selector: "cw-button", inputs: ["type", "label", "id", "link", "isDropdown", "hideCaret", "withIcon", "withOnlyIcon", "iconSize", "iconPosition", "dropdownPosition", "isMinWidth", "isDisabled", "isLoading", "cssClass", "dataTest", "skeletonMode", "withTooltip", "tooltipText", "tooltipTitle", "tooltipTrigger", "tooltipPosition", "tooltipType"], outputs: ["btnAction", "dropDownClicked"] }, { kind: "pipe", type: TranslatePipe, name: "translate" }] }); }
5042
+ ], viewQueries: [{ propertyName: "fileInput", first: true, predicate: ["fileInput"], descendants: true, isSignal: true }], ngImport: i0, template: "<input\n #fileInput\n type=\"file\"\n hidden\n [accept]=\"effectiveAccept()\"\n [multiple]=\"multiple()\"\n [disabled]=\"disabled()\"\n (change)=\"onInputChange($event)\" />\n\n@if (label()) {\n <span class=\"file-drop-label\">{{ label()! | translate }}</span>\n}\n\n@if (errorMessage()) {\n <!-- Etat erreur global (DS : Dropzone / Connexion Error) -->\n <div class=\"file-drop file-drop-error\" [attr.data-test-ctw]=\"dataTest() || null\">\n <cw-icon class=\"file-drop-icon\" [icon]=\"spriteIcon.error\" [iconSize]=\"iconSize['2xl']\"></cw-icon>\n <p class=\"file-drop-text\">{{ errorMessage() }}</p>\n <cw-button\n [type]=\"buttonType.secondary\"\n [label]=\"'_COMMON._FILE_DROP.RETRY' | translate\"\n [withIcon]=\"spriteIcon.refresh\"\n (click)=\"onRetry()\"></cw-button>\n </div>\n} @else {\n <!-- Zone de depot (masquee quand la limite de fichiers est atteinte) -->\n @if (!limitReached()) {\n <div\n class=\"file-drop\"\n [class.file-drop-dragging]=\"isDragging()\"\n [class.file-drop-disabled]=\"disabled()\"\n [class.file-drop-picture]=\"isPicture()\"\n role=\"button\"\n [attr.tabindex]=\"disabled() ? -1 : 0\"\n [attr.aria-label]=\"(label() | translate) || null\"\n [attr.aria-disabled]=\"disabled() || null\"\n [attr.data-test-ctw]=\"dataTest() || null\"\n (click)=\"openPicker()\"\n (keydown)=\"onKeydown($event)\"\n (dragenter)=\"onDragEnter($event)\"\n (dragover)=\"onDragOver($event)\"\n (dragleave)=\"onDragLeave($event)\"\n (drop)=\"onDrop($event)\">\n\n @if (isPicture()) {\n <span class=\"file-drop-illustration\" aria-hidden=\"true\">\n <svg width=\"64\" height=\"64\" viewBox=\"0 0 64 64\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <defs>\n <clipPath id=\"cw-file-drop-illu\"><rect width=\"64\" height=\"64\" rx=\"8\" /></clipPath>\n </defs>\n <g clip-path=\"url(#cw-file-drop-illu)\">\n <rect width=\"64\" height=\"64\" fill=\"#dde8f5\" />\n <circle cx=\"45\" cy=\"19\" r=\"7\" fill=\"#ffd166\" />\n <path d=\"M0 64 L22 36 L38 58 L50 28 L64 50 L64 64 Z\" fill=\"#8bbd5a\" />\n <path d=\"M0 64 L16 44 L32 64 Z\" fill=\"#a8c97a\" />\n </g>\n <rect x=\"0.5\" y=\"0.5\" width=\"63\" height=\"63\" rx=\"7.5\" fill=\"none\" stroke=\"#c8d6df\" />\n </svg>\n </span>\n } @else {\n <svg\n class=\"file-drop-icon\"\n width=\"40\"\n height=\"40\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"1.6\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n aria-hidden=\"true\"\n xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"M16 16.5h1.5a3.5 3.5 0 0 0 .4-6.98A5.5 5.5 0 0 0 7.5 8.6 4 4 0 0 0 7 16.5h1\" />\n <path d=\"M12 20.5V12\" />\n <path d=\"M8.75 15.25 12 12l3.25 3.25\" />\n </svg>\n }\n\n <p class=\"file-drop-text\">\n <span class=\"file-drop-link\">{{ '_COMMON._FILE_DROP.EXPLORE' | translate }}</span>\n {{ (isPicture() ? '_COMMON._FILE_DROP.DROP_HINT_PICTURE' : '_COMMON._FILE_DROP.DROP_HINT') | translate }}\n </p>\n\n @if (acceptLabel() || maxSizeMb() != null || (isPicture() && recommendedDimensions())) {\n <ul class=\"file-drop-hints\">\n @if (acceptLabel()) {\n <li>{{ '_COMMON._FILE_DROP.ACCEPTED_FORMATS' | translate: { formats: acceptLabel() } }}</li>\n }\n @if (maxSizeMb() != null) {\n <li>{{ '_COMMON._FILE_DROP.MAX_SIZE' | translate: { size: maxSizeMb() + ' Mo' } }}</li>\n }\n @if (isPicture() && recommendedDimensions()) {\n <li>{{ '_COMMON._FILE_DROP.RECOMMENDED_DIMENSIONS' | translate: { dimensions: recommendedDimensions() } }}</li>\n }\n </ul>\n }\n </div>\n }\n\n <!-- Liste des fichiers / miniatures -->\n @if (items().length) {\n @if (isPicture()) {\n <ul class=\"file-drop-previews\">\n @for (item of items(); track item.file) {\n <li class=\"file-drop-preview\" [class.file-drop-preview-error]=\"item.status === statusEnum.error\">\n @if (item.previewUrl) {\n <img class=\"file-drop-preview-img\" [src]=\"item.previewUrl\" [alt]=\"item.file.name\" />\n } @else {\n <cw-icon [icon]=\"spriteIcon.poiPhoto\" [iconSize]=\"iconSize.lg\"></cw-icon>\n }\n <button\n type=\"button\"\n class=\"file-drop-remove\"\n [disabled]=\"disabled()\"\n [attr.aria-label]=\"'_COMMON._FILE_DROP.REMOVE' | translate: { name: item.file.name }\"\n (click)=\"remove(item)\">\n <cw-icon [icon]=\"spriteIcon.close\" [iconSize]=\"iconSize.xs\"></cw-icon>\n </button>\n @if (item.status === statusEnum.error) {\n <span class=\"file-drop-preview-reason\">{{ reasonKey(item) | translate }}</span>\n }\n </li>\n }\n </ul>\n } @else {\n <ul class=\"file-drop-list\">\n @for (item of items(); track item.file) {\n <li\n class=\"file-drop-file\"\n [class.file-drop-file-error]=\"item.status === statusEnum.error\">\n <span class=\"file-drop-file-label\">\n {{ '_COMMON._FILE_DROP.SELECTED_FILE' | translate }}\n <span class=\"file-drop-file-name\">{{ item.file.name }}</span>\n <span class=\"file-drop-file-size\">({{ humanSize(item.file.size) }})</span>\n </span>\n\n @if (item.status === statusEnum.error) {\n <cw-badge [type]=\"badgeType.lightDanger\" [label]=\"reasonKey(item)\"></cw-badge>\n } @else {\n <cw-badge [type]=\"badgeType.lightSuccess\" [label]=\"'_COMMON._FILE_DROP.IMPORTED'\"></cw-badge>\n }\n\n <button\n type=\"button\"\n class=\"file-drop-remove file-drop-remove-danger\"\n [disabled]=\"disabled()\"\n [attr.aria-label]=\"'_COMMON._FILE_DROP.REMOVE' | translate: { name: item.file.name }\"\n (click)=\"remove(item)\">\n <cw-icon [icon]=\"spriteIcon.trash\" [iconSize]=\"iconSize.sm\"></cw-icon>\n </button>\n </li>\n }\n </ul>\n }\n }\n}\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "component", type: IconComponent, selector: "cw-icon", inputs: ["icon", "label", "type", "iconSize", "iconCssClass", "iconUiType", "iconColorCustom", "spritePath"] }, { kind: "component", type: ButtonComponent, selector: "cw-button", inputs: ["type", "label", "id", "link", "isDropdown", "hideCaret", "withIcon", "withOnlyIcon", "iconSize", "iconPosition", "dropdownPosition", "isMinWidth", "isDisabled", "isLoading", "cssClass", "dataTest", "skeletonMode", "withTooltip", "tooltipText", "tooltipTitle", "tooltipTrigger", "tooltipPosition", "tooltipType"], outputs: ["btnAction", "dropDownClicked"] }, { kind: "component", type: BadgeComponent, selector: "cw-badge", inputs: ["type", "label", "withIcon", "iconPosition", "cssClass", "skeletonMode", "dataTest"] }, { kind: "pipe", type: TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
4651
5043
  }
4652
5044
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: FileDropComponent, decorators: [{
4653
5045
  type: Component,
4654
- args: [{ selector: 'cw-file-drop', standalone: true, imports: [CommonModule, TranslatePipe, IconComponent, ButtonComponent], providers: [
5046
+ args: [{ selector: 'cw-file-drop', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, imports: [CommonModule, TranslatePipe, IconComponent, ButtonComponent, BadgeComponent], providers: [
4655
5047
  {
4656
5048
  provide: NG_VALUE_ACCESSOR,
4657
5049
  useExisting: forwardRef(() => FileDropComponent),
4658
5050
  multi: true,
4659
5051
  },
4660
- ], template: "<input\n #fileInput\n type=\"file\"\n hidden\n [accept]=\"effectiveAccept()\"\n [multiple]=\"multiple()\"\n [disabled]=\"disabled()\"\n (change)=\"onInputChange($event)\" />\n\n@if (errorMessage()) {\n <!-- Etat erreur global (DS : Dropzone / Connexion Error) -->\n <div class=\"file-drop file-drop-error\" [attr.data-test-ctw]=\"dataTest() || null\">\n <cw-icon class=\"file-drop-icon file-drop-icon-danger\" [icon]=\"spriteIcon.error\" [iconSize]=\"iconSize.xl\"></cw-icon>\n <p class=\"file-drop-title\">{{ errorMessage() }}</p>\n <cw-button\n [type]=\"buttonType.secondary\"\n [label]=\"'_COMMON._FILE_DROP.RETRY' | translate\"\n [withIcon]=\"spriteIcon.toolbarUpload\"\n (click)=\"onRetry()\"></cw-button>\n </div>\n} @else {\n <!-- Zone de depot -->\n <div\n class=\"file-drop\"\n [class.file-drop-dragging]=\"isDragging()\"\n [class.file-drop-disabled]=\"disabled()\"\n [class.file-drop-picture]=\"isPicture()\"\n role=\"button\"\n [attr.tabindex]=\"disabled() ? -1 : 0\"\n [attr.aria-label]=\"label() || null\"\n [attr.aria-disabled]=\"disabled() || null\"\n [attr.data-test-ctw]=\"dataTest() || null\"\n (click)=\"openPicker()\"\n (keydown)=\"onKeydown($event)\"\n (dragenter)=\"onDragEnter($event)\"\n (dragover)=\"onDragOver($event)\"\n (dragleave)=\"onDragLeave($event)\"\n (drop)=\"onDrop($event)\">\n\n @if (isPicture()) {\n <span class=\"file-drop-illustration\" aria-hidden=\"true\">\n <svg width=\"64\" height=\"64\" viewBox=\"0 0 64 64\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <defs>\n <clipPath id=\"cw-file-drop-illu\"><rect width=\"64\" height=\"64\" rx=\"8\" /></clipPath>\n </defs>\n <g clip-path=\"url(#cw-file-drop-illu)\">\n <rect width=\"64\" height=\"64\" fill=\"#dde8f5\" />\n <circle cx=\"45\" cy=\"19\" r=\"7\" fill=\"#ffd166\" />\n <path d=\"M0 64 L22 36 L38 58 L50 28 L64 50 L64 64 Z\" fill=\"#8bbd5a\" />\n <path d=\"M0 64 L16 44 L32 64 Z\" fill=\"#a8c97a\" />\n </g>\n <rect x=\"0.5\" y=\"0.5\" width=\"63\" height=\"63\" rx=\"7.5\" fill=\"none\" stroke=\"#c8d6df\" />\n </svg>\n </span>\n } @else {\n <cw-icon class=\"file-drop-icon\" [icon]=\"spriteIcon.toolbarUpload\" [iconSize]=\"iconSize.xl\"></cw-icon>\n }\n\n <p class=\"file-drop-title\">\n {{ (isPicture() ? '_COMMON._FILE_DROP.DROP_PICTURE' : '_COMMON._FILE_DROP.DROP_FILE') | translate }}\n </p>\n <span class=\"file-drop-or\">{{ '_COMMON._FILE_DROP.OR' | translate }}</span>\n <cw-button\n class=\"file-drop-browse\"\n [type]=\"buttonType.secondary\"\n [label]=\"(isPicture() ? '_COMMON._FILE_DROP.BROWSE_PICTURE' : '_COMMON._FILE_DROP.BROWSE') | translate\"\n [withIcon]=\"spriteIcon.toolbarUpload\"\n [isDisabled]=\"disabled()\"\n (click)=\"onBrowse($event)\"></cw-button>\n </div>\n\n <!-- Textes d'aide -->\n @if (acceptLabel() || maxSizeMb() != null || (isPicture() && recommendedDimensions())) {\n <ul class=\"file-drop-hints\">\n @if (acceptLabel()) {\n <li>{{ '_COMMON._FILE_DROP.ACCEPTED_FORMATS' | translate: { formats: acceptLabel() } }}</li>\n }\n @if (maxSizeMb() != null) {\n <li>{{ '_COMMON._FILE_DROP.MAX_SIZE' | translate: { size: maxSizeMb() + ' Mo' } }}</li>\n }\n @if (isPicture() && recommendedDimensions()) {\n <li>{{ '_COMMON._FILE_DROP.RECOMMENDED_DIMENSIONS' | translate: { dimensions: recommendedDimensions() } }}</li>\n }\n </ul>\n }\n\n <!-- Liste des fichiers / miniatures -->\n @if (items().length) {\n @if (isPicture()) {\n <ul class=\"file-drop-previews\">\n @for (item of items(); track item.file) {\n <li class=\"file-drop-preview\" [class.file-drop-preview-error]=\"item.status === statusEnum.error\">\n @if (item.previewUrl) {\n <img class=\"file-drop-preview-img\" [src]=\"item.previewUrl\" [alt]=\"item.file.name\" />\n } @else {\n <cw-icon [icon]=\"spriteIcon.poiPhoto\" [iconSize]=\"iconSize.lg\"></cw-icon>\n }\n <button\n type=\"button\"\n class=\"file-drop-remove\"\n [disabled]=\"disabled()\"\n [attr.aria-label]=\"'_COMMON._FILE_DROP.REMOVE' | translate: { name: item.file.name }\"\n (click)=\"remove(item)\">\n <cw-icon [icon]=\"spriteIcon.close\" [iconSize]=\"iconSize.xs\"></cw-icon>\n </button>\n @if (item.status === statusEnum.error) {\n <span class=\"file-drop-preview-reason\">{{ reasonKey(item) | translate }}</span>\n }\n </li>\n }\n </ul>\n } @else {\n <ul class=\"file-drop-list\">\n @for (item of items(); track item.file) {\n <li\n class=\"file-drop-file\"\n [class.file-drop-file-success]=\"item.status === statusEnum.success\"\n [class.file-drop-file-error]=\"item.status === statusEnum.error\">\n <cw-icon\n class=\"file-drop-file-icon\"\n [icon]=\"item.status === statusEnum.error ? spriteIcon.error : spriteIcon.file\"\n [iconSize]=\"iconSize.sm\"></cw-icon>\n <span class=\"file-drop-file-name\">{{ item.file.name }}</span>\n @if (item.status === statusEnum.error) {\n <span class=\"file-drop-file-reason\">{{ reasonKey(item) | translate }}</span>\n } @else {\n <span class=\"file-drop-file-size\">{{ humanSize(item.file.size) }}</span>\n }\n <button\n type=\"button\"\n class=\"file-drop-remove\"\n [disabled]=\"disabled()\"\n [attr.aria-label]=\"'_COMMON._FILE_DROP.REMOVE' | translate: { name: item.file.name }\"\n (click)=\"remove(item)\">\n <cw-icon [icon]=\"spriteIcon.trash\" [iconSize]=\"iconSize.sm\"></cw-icon>\n </button>\n </li>\n }\n </ul>\n }\n }\n}\n" }]
4661
- }], propDecorators: { mode: [{ type: i0.Input, args: [{ isSignal: true, alias: "mode", required: false }] }], multiple: [{ type: i0.Input, args: [{ isSignal: true, alias: "multiple", required: false }] }], accept: [{ type: i0.Input, args: [{ isSignal: true, alias: "accept", required: false }] }], acceptLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "acceptLabel", required: false }] }], maxSizeMb: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxSizeMb", required: false }] }], recommendedDimensions: [{ type: i0.Input, args: [{ isSignal: true, alias: "recommendedDimensions", required: false }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], isDisabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "isDisabled", required: false }] }], errorMessage: [{ type: i0.Input, args: [{ isSignal: true, alias: "errorMessage", required: false }] }], dataTest: [{ type: i0.Input, args: [{ isSignal: true, alias: "dataTest", required: false }] }], filesChange: [{ type: i0.Output, args: ["filesChange"] }], rejected: [{ type: i0.Output, args: ["rejected"] }], retry: [{ type: i0.Output, args: ["retry"] }], fileInput: [{ type: i0.ViewChild, args: ['fileInput', { isSignal: true }] }] } });
5052
+ ], template: "<input\n #fileInput\n type=\"file\"\n hidden\n [accept]=\"effectiveAccept()\"\n [multiple]=\"multiple()\"\n [disabled]=\"disabled()\"\n (change)=\"onInputChange($event)\" />\n\n@if (label()) {\n <span class=\"file-drop-label\">{{ label()! | translate }}</span>\n}\n\n@if (errorMessage()) {\n <!-- Etat erreur global (DS : Dropzone / Connexion Error) -->\n <div class=\"file-drop file-drop-error\" [attr.data-test-ctw]=\"dataTest() || null\">\n <cw-icon class=\"file-drop-icon\" [icon]=\"spriteIcon.error\" [iconSize]=\"iconSize['2xl']\"></cw-icon>\n <p class=\"file-drop-text\">{{ errorMessage() }}</p>\n <cw-button\n [type]=\"buttonType.secondary\"\n [label]=\"'_COMMON._FILE_DROP.RETRY' | translate\"\n [withIcon]=\"spriteIcon.refresh\"\n (click)=\"onRetry()\"></cw-button>\n </div>\n} @else {\n <!-- Zone de depot (masquee quand la limite de fichiers est atteinte) -->\n @if (!limitReached()) {\n <div\n class=\"file-drop\"\n [class.file-drop-dragging]=\"isDragging()\"\n [class.file-drop-disabled]=\"disabled()\"\n [class.file-drop-picture]=\"isPicture()\"\n role=\"button\"\n [attr.tabindex]=\"disabled() ? -1 : 0\"\n [attr.aria-label]=\"(label() | translate) || null\"\n [attr.aria-disabled]=\"disabled() || null\"\n [attr.data-test-ctw]=\"dataTest() || null\"\n (click)=\"openPicker()\"\n (keydown)=\"onKeydown($event)\"\n (dragenter)=\"onDragEnter($event)\"\n (dragover)=\"onDragOver($event)\"\n (dragleave)=\"onDragLeave($event)\"\n (drop)=\"onDrop($event)\">\n\n @if (isPicture()) {\n <span class=\"file-drop-illustration\" aria-hidden=\"true\">\n <svg width=\"64\" height=\"64\" viewBox=\"0 0 64 64\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <defs>\n <clipPath id=\"cw-file-drop-illu\"><rect width=\"64\" height=\"64\" rx=\"8\" /></clipPath>\n </defs>\n <g clip-path=\"url(#cw-file-drop-illu)\">\n <rect width=\"64\" height=\"64\" fill=\"#dde8f5\" />\n <circle cx=\"45\" cy=\"19\" r=\"7\" fill=\"#ffd166\" />\n <path d=\"M0 64 L22 36 L38 58 L50 28 L64 50 L64 64 Z\" fill=\"#8bbd5a\" />\n <path d=\"M0 64 L16 44 L32 64 Z\" fill=\"#a8c97a\" />\n </g>\n <rect x=\"0.5\" y=\"0.5\" width=\"63\" height=\"63\" rx=\"7.5\" fill=\"none\" stroke=\"#c8d6df\" />\n </svg>\n </span>\n } @else {\n <svg\n class=\"file-drop-icon\"\n width=\"40\"\n height=\"40\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"1.6\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n aria-hidden=\"true\"\n xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"M16 16.5h1.5a3.5 3.5 0 0 0 .4-6.98A5.5 5.5 0 0 0 7.5 8.6 4 4 0 0 0 7 16.5h1\" />\n <path d=\"M12 20.5V12\" />\n <path d=\"M8.75 15.25 12 12l3.25 3.25\" />\n </svg>\n }\n\n <p class=\"file-drop-text\">\n <span class=\"file-drop-link\">{{ '_COMMON._FILE_DROP.EXPLORE' | translate }}</span>\n {{ (isPicture() ? '_COMMON._FILE_DROP.DROP_HINT_PICTURE' : '_COMMON._FILE_DROP.DROP_HINT') | translate }}\n </p>\n\n @if (acceptLabel() || maxSizeMb() != null || (isPicture() && recommendedDimensions())) {\n <ul class=\"file-drop-hints\">\n @if (acceptLabel()) {\n <li>{{ '_COMMON._FILE_DROP.ACCEPTED_FORMATS' | translate: { formats: acceptLabel() } }}</li>\n }\n @if (maxSizeMb() != null) {\n <li>{{ '_COMMON._FILE_DROP.MAX_SIZE' | translate: { size: maxSizeMb() + ' Mo' } }}</li>\n }\n @if (isPicture() && recommendedDimensions()) {\n <li>{{ '_COMMON._FILE_DROP.RECOMMENDED_DIMENSIONS' | translate: { dimensions: recommendedDimensions() } }}</li>\n }\n </ul>\n }\n </div>\n }\n\n <!-- Liste des fichiers / miniatures -->\n @if (items().length) {\n @if (isPicture()) {\n <ul class=\"file-drop-previews\">\n @for (item of items(); track item.file) {\n <li class=\"file-drop-preview\" [class.file-drop-preview-error]=\"item.status === statusEnum.error\">\n @if (item.previewUrl) {\n <img class=\"file-drop-preview-img\" [src]=\"item.previewUrl\" [alt]=\"item.file.name\" />\n } @else {\n <cw-icon [icon]=\"spriteIcon.poiPhoto\" [iconSize]=\"iconSize.lg\"></cw-icon>\n }\n <button\n type=\"button\"\n class=\"file-drop-remove\"\n [disabled]=\"disabled()\"\n [attr.aria-label]=\"'_COMMON._FILE_DROP.REMOVE' | translate: { name: item.file.name }\"\n (click)=\"remove(item)\">\n <cw-icon [icon]=\"spriteIcon.close\" [iconSize]=\"iconSize.xs\"></cw-icon>\n </button>\n @if (item.status === statusEnum.error) {\n <span class=\"file-drop-preview-reason\">{{ reasonKey(item) | translate }}</span>\n }\n </li>\n }\n </ul>\n } @else {\n <ul class=\"file-drop-list\">\n @for (item of items(); track item.file) {\n <li\n class=\"file-drop-file\"\n [class.file-drop-file-error]=\"item.status === statusEnum.error\">\n <span class=\"file-drop-file-label\">\n {{ '_COMMON._FILE_DROP.SELECTED_FILE' | translate }}\n <span class=\"file-drop-file-name\">{{ item.file.name }}</span>\n <span class=\"file-drop-file-size\">({{ humanSize(item.file.size) }})</span>\n </span>\n\n @if (item.status === statusEnum.error) {\n <cw-badge [type]=\"badgeType.lightDanger\" [label]=\"reasonKey(item)\"></cw-badge>\n } @else {\n <cw-badge [type]=\"badgeType.lightSuccess\" [label]=\"'_COMMON._FILE_DROP.IMPORTED'\"></cw-badge>\n }\n\n <button\n type=\"button\"\n class=\"file-drop-remove file-drop-remove-danger\"\n [disabled]=\"disabled()\"\n [attr.aria-label]=\"'_COMMON._FILE_DROP.REMOVE' | translate: { name: item.file.name }\"\n (click)=\"remove(item)\">\n <cw-icon [icon]=\"spriteIcon.trash\" [iconSize]=\"iconSize.sm\"></cw-icon>\n </button>\n </li>\n }\n </ul>\n }\n }\n}\n" }]
5053
+ }], propDecorators: { mode: [{ type: i0.Input, args: [{ isSignal: true, alias: "mode", required: false }] }], multiple: [{ type: i0.Input, args: [{ isSignal: true, alias: "multiple", required: false }] }], maxFiles: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxFiles", required: false }] }], accept: [{ type: i0.Input, args: [{ isSignal: true, alias: "accept", required: false }] }], acceptLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "acceptLabel", required: false }] }], maxSizeMb: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxSizeMb", required: false }] }], recommendedDimensions: [{ type: i0.Input, args: [{ isSignal: true, alias: "recommendedDimensions", required: false }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], isDisabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "isDisabled", required: false }] }], errorMessage: [{ type: i0.Input, args: [{ isSignal: true, alias: "errorMessage", required: false }] }], dataTest: [{ type: i0.Input, args: [{ isSignal: true, alias: "dataTest", required: false }] }], filesChange: [{ type: i0.Output, args: ["filesChange"] }], rejected: [{ type: i0.Output, args: ["rejected"] }], retry: [{ type: i0.Output, args: ["retry"] }], fileInput: [{ type: i0.ViewChild, args: ['fileInput', { isSignal: true }] }] } });
5054
+
5055
+ // Types du composant `cw-empty-state` — alignes sur le DS (BOU) `Empty State / *`.
5056
+ /** Illustration integree (SVG maison cale sur les tokens DS `illustration/*`). */
5057
+ var EmptyStateIllustrationEnum;
5058
+ (function (EmptyStateIllustrationEnum) {
5059
+ /** Carte + badge « + » : aucune donnee, inviter a creer/importer. */
5060
+ EmptyStateIllustrationEnum["noData"] = "no-data";
5061
+ /** Carte + badge « x » : aucun resultat apres filtrage. */
5062
+ EmptyStateIllustrationEnum["noResult"] = "no-result";
5063
+ /** Carte image + badge upload : aucun fichier. */
5064
+ EmptyStateIllustrationEnum["noFile"] = "no-file";
5065
+ /** Pas d'illustration. */
5066
+ EmptyStateIllustrationEnum["none"] = "none";
5067
+ })(EmptyStateIllustrationEnum || (EmptyStateIllustrationEnum = {}));
5068
+
5069
+ /**
5070
+ * Etat vide parametrable (illustration + titre + description + 2 boutons), base sur le DS
5071
+ * (BOU) `Empty State / *`. Utilisable seul ou via `cw-table` (configs noData / noResult).
5072
+ *
5073
+ * - `illustration` : 3 visuels SVG integres (noData / noResult / noFile) ou `none`.
5074
+ * - `imageSource` : image custom qui PRIME sur l'illustration integree.
5075
+ * - `primaryButton` (CTA, style primaire) et `secondaryButton` (style secondaire) sont
5076
+ * optionnels ; ils n'apparaissent que si fournis et emettent `primaryClick` / `secondaryClick`.
5077
+ */
5078
+ class EmptyStateComponent {
5079
+ constructor() {
5080
+ /** Illustration integree. Defaut `noData`. Ignoree si `imageSource` est fourni. */
5081
+ this.illustration = input(EmptyStateIllustrationEnum.noData, ...(ngDevMode ? [{ debugName: "illustration" }] : []));
5082
+ /**
5083
+ * Dossier des SVG d'illustration integres. Defaut `/assets/images/empty-states`
5084
+ * (les assets de basic-ui y sont copies, cf. angular.json / staticDirs Storybook).
5085
+ * A surcharger si l'app sert les assets ailleurs.
5086
+ */
5087
+ this.illustrationBasePath = input('/assets/images/empty-states', ...(ngDevMode ? [{ debugName: "illustrationBasePath" }] : []));
5088
+ /** Image custom (URL) ; prime sur `illustration`. */
5089
+ this.imageSource = input(...(ngDevMode ? [undefined, { debugName: "imageSource" }] : []));
5090
+ /** Texte alternatif de l'image custom (les illustrations integrees sont decoratives). */
5091
+ this.imageAlt = input('', ...(ngDevMode ? [{ debugName: "imageAlt" }] : []));
5092
+ /** Titre (cle i18n). */
5093
+ this.title = input.required(...(ngDevMode ? [{ debugName: "title" }] : []));
5094
+ /** Description (cle i18n). */
5095
+ this.description = input(...(ngDevMode ? [undefined, { debugName: "description" }] : []));
5096
+ /** Bouton principal (CTA primaire). */
5097
+ this.primaryButton = input(...(ngDevMode ? [undefined, { debugName: "primaryButton" }] : []));
5098
+ /** Bouton secondaire. */
5099
+ this.secondaryButton = input(...(ngDevMode ? [undefined, { debugName: "secondaryButton" }] : []));
5100
+ /** Attribut `data-test-ctw`. */
5101
+ this.dataTest = input(...(ngDevMode ? [undefined, { debugName: "dataTest" }] : []));
5102
+ /** Clic sur le bouton principal. */
5103
+ this.primaryClick = output();
5104
+ /** Clic sur le bouton secondaire. */
5105
+ this.secondaryClick = output();
5106
+ this.illustrationEnum = EmptyStateIllustrationEnum;
5107
+ this.buttonType = BoButtonTypeEnum;
5108
+ /** Nom de fichier SVG par illustration (dossier `assets/images/empty-states`). */
5109
+ this.illustrationFiles = {
5110
+ [EmptyStateIllustrationEnum.noData]: 'no-data',
5111
+ [EmptyStateIllustrationEnum.noResult]: 'no-result',
5112
+ [EmptyStateIllustrationEnum.noFile]: 'no-upload',
5113
+ [EmptyStateIllustrationEnum.none]: '',
5114
+ };
5115
+ /** Affiche une illustration integree (ni image custom, ni `none`). */
5116
+ this.showIllustration = computed(() => !this.imageSource() && this.illustration() !== EmptyStateIllustrationEnum.none, ...(ngDevMode ? [{ debugName: "showIllustration" }] : []));
5117
+ /** URL du SVG d'illustration integre. */
5118
+ this.illustrationSrc = computed(() => {
5119
+ const file = this.illustrationFiles[this.illustration()];
5120
+ return file ? `${this.illustrationBasePath()}/${file}.svg` : '';
5121
+ }, ...(ngDevMode ? [{ debugName: "illustrationSrc" }] : []));
5122
+ }
5123
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: EmptyStateComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
5124
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.20", type: EmptyStateComponent, isStandalone: true, selector: "cw-empty-state", inputs: { illustration: { classPropertyName: "illustration", publicName: "illustration", isSignal: true, isRequired: false, transformFunction: null }, illustrationBasePath: { classPropertyName: "illustrationBasePath", publicName: "illustrationBasePath", isSignal: true, isRequired: false, transformFunction: null }, imageSource: { classPropertyName: "imageSource", publicName: "imageSource", isSignal: true, isRequired: false, transformFunction: null }, imageAlt: { classPropertyName: "imageAlt", publicName: "imageAlt", isSignal: true, isRequired: false, transformFunction: null }, title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: true, transformFunction: null }, description: { classPropertyName: "description", publicName: "description", isSignal: true, isRequired: false, transformFunction: null }, primaryButton: { classPropertyName: "primaryButton", publicName: "primaryButton", isSignal: true, isRequired: false, transformFunction: null }, secondaryButton: { classPropertyName: "secondaryButton", publicName: "secondaryButton", isSignal: true, isRequired: false, transformFunction: null }, dataTest: { classPropertyName: "dataTest", publicName: "dataTest", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { primaryClick: "primaryClick", secondaryClick: "secondaryClick" }, ngImport: i0, template: "<div class=\"empty-state\" [attr.data-test-ctw]=\"dataTest() || null\">\n @if (imageSource()) {\n <img\n class=\"empty-state-illustration\"\n [src]=\"imageSource()!\"\n [alt]=\"imageAlt()\"\n [attr.aria-hidden]=\"imageAlt() ? null : 'true'\" />\n } @else if (showIllustration()) {\n <img class=\"empty-state-illustration\" [src]=\"illustrationSrc()\" alt=\"\" aria-hidden=\"true\" />\n }\n\n <p class=\"empty-state-title\">{{ title() | translate }}</p>\n @if (description()) {\n <p class=\"empty-state-description\">{{ description()! | translate }}</p>\n }\n\n @if (secondaryButton() || primaryButton()) {\n <div class=\"empty-state-actions\">\n @if (secondaryButton(); as btn) {\n <cw-button\n [type]=\"buttonType.secondary\"\n [label]=\"btn.label\"\n [withIcon]=\"btn.icon\"\n [isDisabled]=\"btn.disabled ?? false\"\n (btnAction)=\"secondaryClick.emit()\"></cw-button>\n }\n @if (primaryButton(); as btn) {\n <cw-button\n [type]=\"buttonType.primary\"\n [label]=\"btn.label\"\n [withIcon]=\"btn.icon\"\n [isDisabled]=\"btn.disabled ?? false\"\n (btnAction)=\"primaryClick.emit()\"></cw-button>\n }\n </div>\n }\n</div>\n", dependencies: [{ kind: "component", type: ButtonComponent, selector: "cw-button", inputs: ["type", "label", "id", "link", "isDropdown", "hideCaret", "withIcon", "withOnlyIcon", "iconSize", "iconPosition", "dropdownPosition", "isMinWidth", "isDisabled", "isLoading", "cssClass", "dataTest", "skeletonMode", "withTooltip", "tooltipText", "tooltipTitle", "tooltipTrigger", "tooltipPosition", "tooltipType"], outputs: ["btnAction", "dropDownClicked"] }, { kind: "pipe", type: TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
5125
+ }
5126
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: EmptyStateComponent, decorators: [{
5127
+ type: Component,
5128
+ args: [{ selector: 'cw-empty-state', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, imports: [TranslatePipe, ButtonComponent], template: "<div class=\"empty-state\" [attr.data-test-ctw]=\"dataTest() || null\">\n @if (imageSource()) {\n <img\n class=\"empty-state-illustration\"\n [src]=\"imageSource()!\"\n [alt]=\"imageAlt()\"\n [attr.aria-hidden]=\"imageAlt() ? null : 'true'\" />\n } @else if (showIllustration()) {\n <img class=\"empty-state-illustration\" [src]=\"illustrationSrc()\" alt=\"\" aria-hidden=\"true\" />\n }\n\n <p class=\"empty-state-title\">{{ title() | translate }}</p>\n @if (description()) {\n <p class=\"empty-state-description\">{{ description()! | translate }}</p>\n }\n\n @if (secondaryButton() || primaryButton()) {\n <div class=\"empty-state-actions\">\n @if (secondaryButton(); as btn) {\n <cw-button\n [type]=\"buttonType.secondary\"\n [label]=\"btn.label\"\n [withIcon]=\"btn.icon\"\n [isDisabled]=\"btn.disabled ?? false\"\n (btnAction)=\"secondaryClick.emit()\"></cw-button>\n }\n @if (primaryButton(); as btn) {\n <cw-button\n [type]=\"buttonType.primary\"\n [label]=\"btn.label\"\n [withIcon]=\"btn.icon\"\n [isDisabled]=\"btn.disabled ?? false\"\n (btnAction)=\"primaryClick.emit()\"></cw-button>\n }\n </div>\n }\n</div>\n" }]
5129
+ }], propDecorators: { illustration: [{ type: i0.Input, args: [{ isSignal: true, alias: "illustration", required: false }] }], illustrationBasePath: [{ type: i0.Input, args: [{ isSignal: true, alias: "illustrationBasePath", required: false }] }], imageSource: [{ type: i0.Input, args: [{ isSignal: true, alias: "imageSource", required: false }] }], imageAlt: [{ type: i0.Input, args: [{ isSignal: true, alias: "imageAlt", required: false }] }], title: [{ type: i0.Input, args: [{ isSignal: true, alias: "title", required: true }] }], description: [{ type: i0.Input, args: [{ isSignal: true, alias: "description", required: false }] }], primaryButton: [{ type: i0.Input, args: [{ isSignal: true, alias: "primaryButton", required: false }] }], secondaryButton: [{ type: i0.Input, args: [{ isSignal: true, alias: "secondaryButton", required: false }] }], dataTest: [{ type: i0.Input, args: [{ isSignal: true, alias: "dataTest", required: false }] }], primaryClick: [{ type: i0.Output, args: ["primaryClick"] }], secondaryClick: [{ type: i0.Output, args: ["secondaryClick"] }] } });
4662
5130
 
4663
5131
  /**
4664
5132
  * Sélecteur de langue présentational.
@@ -4686,6 +5154,16 @@ class LanguageSelectorComponent {
4686
5154
  this.spriteIcon = SpriteIconEnum;
4687
5155
  this.iconSizeEnum = IconSizeEnum;
4688
5156
  this.btnType = FoButtonTypeEnum;
5157
+ /**
5158
+ * Langues prêtes à l'affichage. `hasName` est résolu ici (une fois par changement
5159
+ * de `languages()`) plutôt qu'appelé dans le template : évite un `translate.instant`
5160
+ * par ligne à chaque cycle de détection.
5161
+ */
5162
+ this.langItems = computed(() => this.languages().map((code) => ({
5163
+ code,
5164
+ nameKey: this.langNameKey(code),
5165
+ hasName: this.hasName(code),
5166
+ })), ...(ngDevMode ? [{ debugName: "langItems" }] : []));
4689
5167
  }
4690
5168
  /** Clé i18n du nom d'une langue, ex. 'fr' → '_COMMON._LANG.LBL_FR'. */
4691
5169
  langNameKey(code) {
@@ -4707,16 +5185,17 @@ class LanguageSelectorComponent {
4707
5185
  this.trigger()?.closeDropdown();
4708
5186
  }
4709
5187
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: LanguageSelectorComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
4710
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.20", type: LanguageSelectorComponent, isStandalone: true, selector: "cw-language-selector", inputs: { languages: { classPropertyName: "languages", publicName: "languages", isSignal: true, isRequired: false, transformFunction: null }, currentLang: { classPropertyName: "currentLang", publicName: "currentLang", isSignal: true, isRequired: true, transformFunction: null }, showReloadHint: { classPropertyName: "showReloadHint", publicName: "showReloadHint", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { languageChange: "languageChange" }, host: { classAttribute: "d-flex-h" }, viewQueries: [{ propertyName: "trigger", first: true, predicate: ButtonComponent, descendants: true, isSignal: true }], ngImport: i0, template: "<cw-button\n [label]=\"currentLang() | uppercase\"\n [type]=\"btnType.ghost\"\n [withIcon]=\"spriteIcon.language\"\n [isDropdown]=\"true\">\n\n <div class=\"selector-menu d-flex-v gap-md\" role=\"menu\" [attr.aria-label]=\"'_COMMON._LANG.LBL_LANG' | translate\">\n @if (showReloadHint()) {\n <p class=\"selector-menu-hint fs-xs\">{{ '_COMMON._LANG.RELOAD_HINT' | translate }}</p>\n }\n\n <div class=\"d-flex-v gap-2xs\">\n <div class=\"selector-menu-title fs-sm fw-bold\">{{ '_COMMON._LANG.LBL_LANG' | translate }}</div>\n\n <ul class=\"list-unstyled\">\n @for (lang of languages(); track lang) {\n <li>\n <button\n type=\"button\"\n role=\"menuitemradio\"\n class=\"justify-between\"\n [class.active]=\"lang === currentLang()\"\n [attr.aria-checked]=\"lang === currentLang()\"\n (click)=\"onSelect(lang)\">\n <span class=\"flex-1\">@if (hasName(lang)) { {{ lang | uppercase }} - {{ langNameKey(lang) | translate }} } @else { {{ lang | uppercase }} }</span>\n @if (lang === currentLang()) {\n <cw-icon [icon]=\"spriteIcon.check\" [iconSize]=\"iconSizeEnum.xs\"></cw-icon>\n }\n </button>\n </li>\n }\n </ul>\n </div>\n </div>\n</cw-button>\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: TranslateModule }, { kind: "component", type: ButtonComponent, selector: "cw-button", inputs: ["type", "label", "id", "link", "isDropdown", "hideCaret", "withIcon", "withOnlyIcon", "iconSize", "iconPosition", "dropdownPosition", "isMinWidth", "isDisabled", "isLoading", "cssClass", "dataTest", "skeletonMode", "withTooltip", "tooltipText", "tooltipTitle", "tooltipTrigger", "tooltipPosition", "tooltipType"], outputs: ["btnAction", "dropDownClicked"] }, { kind: "component", type: IconComponent, selector: "cw-icon", inputs: ["icon", "label", "type", "iconSize", "iconCssClass", "iconUiType", "iconColorCustom", "spritePath"] }, { kind: "pipe", type: i1.UpperCasePipe, name: "uppercase" }, { kind: "pipe", type: i2.TranslatePipe, name: "translate" }] }); }
5188
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.20", type: LanguageSelectorComponent, isStandalone: true, selector: "cw-language-selector", inputs: { languages: { classPropertyName: "languages", publicName: "languages", isSignal: true, isRequired: false, transformFunction: null }, currentLang: { classPropertyName: "currentLang", publicName: "currentLang", isSignal: true, isRequired: true, transformFunction: null }, showReloadHint: { classPropertyName: "showReloadHint", publicName: "showReloadHint", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { languageChange: "languageChange" }, host: { classAttribute: "d-flex-h" }, viewQueries: [{ propertyName: "trigger", first: true, predicate: ButtonComponent, descendants: true, isSignal: true }], ngImport: i0, template: "<cw-button\n [label]=\"currentLang() | uppercase\"\n [type]=\"btnType.ghost\"\n [withIcon]=\"spriteIcon.language\"\n [isDropdown]=\"true\">\n\n <div class=\"selector-menu d-flex-v gap-md\" role=\"menu\" [attr.aria-label]=\"'_COMMON._LANG.LBL_LANG' | translate\" cwMenuKeyboard (escapePressed)=\"trigger()?.closeDropdown()\">\n @if (showReloadHint()) {\n <p class=\"selector-menu-hint fs-xs\">{{ '_COMMON._LANG.RELOAD_HINT' | translate }}</p>\n }\n\n <div class=\"d-flex-v gap-2xs\">\n <div class=\"selector-menu-title fs-sm fw-bold\">{{ '_COMMON._LANG.LBL_LANG' | translate }}</div>\n\n <ul class=\"list-unstyled\" role=\"group\">\n @for (item of langItems(); track item.code) {\n <li role=\"none\">\n <button\n type=\"button\"\n role=\"menuitemradio\"\n class=\"justify-between\"\n [class.active]=\"item.code === currentLang()\"\n [attr.aria-checked]=\"item.code === currentLang()\"\n (click)=\"onSelect(item.code)\">\n <span class=\"flex-1\">@if (item.hasName) { {{ item.code | uppercase }} - {{ item.nameKey | translate }} } @else { {{ item.code | uppercase }} }</span>\n @if (item.code === currentLang()) {\n <cw-icon [icon]=\"spriteIcon.check\" [iconSize]=\"iconSizeEnum.xs\"></cw-icon>\n }\n </button>\n </li>\n }\n </ul>\n </div>\n </div>\n</cw-button>\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: TranslateModule }, { kind: "component", type: ButtonComponent, selector: "cw-button", inputs: ["type", "label", "id", "link", "isDropdown", "hideCaret", "withIcon", "withOnlyIcon", "iconSize", "iconPosition", "dropdownPosition", "isMinWidth", "isDisabled", "isLoading", "cssClass", "dataTest", "skeletonMode", "withTooltip", "tooltipText", "tooltipTitle", "tooltipTrigger", "tooltipPosition", "tooltipType"], outputs: ["btnAction", "dropDownClicked"] }, { kind: "component", type: IconComponent, selector: "cw-icon", inputs: ["icon", "label", "type", "iconSize", "iconCssClass", "iconUiType", "iconColorCustom", "spritePath"] }, { kind: "directive", type: MenuKeyboardDirective, selector: "[cwMenuKeyboard]", inputs: ["menuItemSelector"], outputs: ["escapePressed"] }, { kind: "pipe", type: i1.UpperCasePipe, name: "uppercase" }, { kind: "pipe", type: i2.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
4711
5189
  }
4712
5190
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: LanguageSelectorComponent, decorators: [{
4713
5191
  type: Component,
4714
- args: [{ selector: 'cw-language-selector', standalone: true, host: { 'class': 'd-flex-h' }, imports: [
5192
+ args: [{ selector: 'cw-language-selector', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, host: { 'class': 'd-flex-h' }, imports: [
4715
5193
  CommonModule,
4716
5194
  TranslateModule,
4717
5195
  ButtonComponent,
4718
- IconComponent
4719
- ], template: "<cw-button\n [label]=\"currentLang() | uppercase\"\n [type]=\"btnType.ghost\"\n [withIcon]=\"spriteIcon.language\"\n [isDropdown]=\"true\">\n\n <div class=\"selector-menu d-flex-v gap-md\" role=\"menu\" [attr.aria-label]=\"'_COMMON._LANG.LBL_LANG' | translate\">\n @if (showReloadHint()) {\n <p class=\"selector-menu-hint fs-xs\">{{ '_COMMON._LANG.RELOAD_HINT' | translate }}</p>\n }\n\n <div class=\"d-flex-v gap-2xs\">\n <div class=\"selector-menu-title fs-sm fw-bold\">{{ '_COMMON._LANG.LBL_LANG' | translate }}</div>\n\n <ul class=\"list-unstyled\">\n @for (lang of languages(); track lang) {\n <li>\n <button\n type=\"button\"\n role=\"menuitemradio\"\n class=\"justify-between\"\n [class.active]=\"lang === currentLang()\"\n [attr.aria-checked]=\"lang === currentLang()\"\n (click)=\"onSelect(lang)\">\n <span class=\"flex-1\">@if (hasName(lang)) { {{ lang | uppercase }} - {{ langNameKey(lang) | translate }} } @else { {{ lang | uppercase }} }</span>\n @if (lang === currentLang()) {\n <cw-icon [icon]=\"spriteIcon.check\" [iconSize]=\"iconSizeEnum.xs\"></cw-icon>\n }\n </button>\n </li>\n }\n </ul>\n </div>\n </div>\n</cw-button>\n" }]
5196
+ IconComponent,
5197
+ MenuKeyboardDirective
5198
+ ], template: "<cw-button\n [label]=\"currentLang() | uppercase\"\n [type]=\"btnType.ghost\"\n [withIcon]=\"spriteIcon.language\"\n [isDropdown]=\"true\">\n\n <div class=\"selector-menu d-flex-v gap-md\" role=\"menu\" [attr.aria-label]=\"'_COMMON._LANG.LBL_LANG' | translate\" cwMenuKeyboard (escapePressed)=\"trigger()?.closeDropdown()\">\n @if (showReloadHint()) {\n <p class=\"selector-menu-hint fs-xs\">{{ '_COMMON._LANG.RELOAD_HINT' | translate }}</p>\n }\n\n <div class=\"d-flex-v gap-2xs\">\n <div class=\"selector-menu-title fs-sm fw-bold\">{{ '_COMMON._LANG.LBL_LANG' | translate }}</div>\n\n <ul class=\"list-unstyled\" role=\"group\">\n @for (item of langItems(); track item.code) {\n <li role=\"none\">\n <button\n type=\"button\"\n role=\"menuitemradio\"\n class=\"justify-between\"\n [class.active]=\"item.code === currentLang()\"\n [attr.aria-checked]=\"item.code === currentLang()\"\n (click)=\"onSelect(item.code)\">\n <span class=\"flex-1\">@if (item.hasName) { {{ item.code | uppercase }} - {{ item.nameKey | translate }} } @else { {{ item.code | uppercase }} }</span>\n @if (item.code === currentLang()) {\n <cw-icon [icon]=\"spriteIcon.check\" [iconSize]=\"iconSizeEnum.xs\"></cw-icon>\n }\n </button>\n </li>\n }\n </ul>\n </div>\n </div>\n</cw-button>\n" }]
4720
5199
  }], propDecorators: { languages: [{ type: i0.Input, args: [{ isSignal: true, alias: "languages", required: false }] }], currentLang: [{ type: i0.Input, args: [{ isSignal: true, alias: "currentLang", required: true }] }], showReloadHint: [{ type: i0.Input, args: [{ isSignal: true, alias: "showReloadHint", required: false }] }], languageChange: [{ type: i0.Output, args: ["languageChange"] }], trigger: [{ type: i0.ViewChild, args: [i0.forwardRef(() => ButtonComponent), { isSignal: true }] }] } });
4721
5200
 
4722
5201
  /**
@@ -4755,16 +5234,17 @@ class ThemeSelectorComponent {
4755
5234
  this.trigger()?.closeDropdown();
4756
5235
  }
4757
5236
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: ThemeSelectorComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
4758
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.20", type: ThemeSelectorComponent, isStandalone: true, selector: "cw-theme-selector", inputs: { themes: { classPropertyName: "themes", publicName: "themes", isSignal: true, isRequired: false, transformFunction: null }, currentTheme: { classPropertyName: "currentTheme", publicName: "currentTheme", isSignal: true, isRequired: true, transformFunction: null }, showReloadHint: { classPropertyName: "showReloadHint", publicName: "showReloadHint", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { themeChange: "themeChange" }, host: { classAttribute: "d-flex-h" }, viewQueries: [{ propertyName: "trigger", first: true, predicate: ButtonComponent, descendants: true, isSignal: true }], ngImport: i0, template: "<cw-button\n [label]=\"activeOption()?.labelKey ?? '_COMMON._THEME.LBL_THEME'\"\n [type]=\"btnType.ghost\"\n [withIcon]=\"activeOption()?.icon\"\n [withOnlyIcon]=\"true\"\n [isDropdown]=\"true\">\n\n <div class=\"selector-menu d-flex-v gap-md\" role=\"menu\" [attr.aria-label]=\"'_COMMON._THEME.LBL_THEME' | translate\">\n @if (showReloadHint()) {\n <p class=\"selector-menu-hint fs-xs\">{{ '_COMMON._THEME.RELOAD_HINT' | translate }}</p>\n }\n\n <div class=\"d-flex-v gap-2xs\">\n <div class=\"selector-menu-title fs-sm fw-bold\">{{ '_COMMON._THEME.LBL_THEME' | translate }}</div>\n\n <ul class=\"list-unstyled\">\n @for (theme of themes(); track theme.key) {\n <li>\n <button\n type=\"button\"\n role=\"menuitemradio\"\n class=\"justify-between\"\n [class.active]=\"theme.key === currentTheme()\"\n [attr.aria-checked]=\"theme.key === currentTheme()\"\n (click)=\"onSelect(theme.key)\">\n <cw-icon [icon]=\"theme.icon\" [iconSize]=\"iconSizeEnum.sm\"></cw-icon>\n <span class=\"flex-1\">{{ theme.labelKey | translate }}</span>\n @if (theme.key === currentTheme()) {\n <cw-icon [icon]=\"spriteIcon.check\" [iconSize]=\"iconSizeEnum.xs\"></cw-icon>\n }\n </button>\n </li>\n }\n </ul>\n </div>\n </div>\n</cw-button>\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: TranslateModule }, { kind: "component", type: ButtonComponent, selector: "cw-button", inputs: ["type", "label", "id", "link", "isDropdown", "hideCaret", "withIcon", "withOnlyIcon", "iconSize", "iconPosition", "dropdownPosition", "isMinWidth", "isDisabled", "isLoading", "cssClass", "dataTest", "skeletonMode", "withTooltip", "tooltipText", "tooltipTitle", "tooltipTrigger", "tooltipPosition", "tooltipType"], outputs: ["btnAction", "dropDownClicked"] }, { kind: "component", type: IconComponent, selector: "cw-icon", inputs: ["icon", "label", "type", "iconSize", "iconCssClass", "iconUiType", "iconColorCustom", "spritePath"] }, { kind: "pipe", type: i2.TranslatePipe, name: "translate" }] }); }
5237
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.20", type: ThemeSelectorComponent, isStandalone: true, selector: "cw-theme-selector", inputs: { themes: { classPropertyName: "themes", publicName: "themes", isSignal: true, isRequired: false, transformFunction: null }, currentTheme: { classPropertyName: "currentTheme", publicName: "currentTheme", isSignal: true, isRequired: true, transformFunction: null }, showReloadHint: { classPropertyName: "showReloadHint", publicName: "showReloadHint", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { themeChange: "themeChange" }, host: { classAttribute: "d-flex-h" }, viewQueries: [{ propertyName: "trigger", first: true, predicate: ButtonComponent, descendants: true, isSignal: true }], ngImport: i0, template: "<cw-button\n [label]=\"activeOption()?.labelKey ?? '_COMMON._THEME.LBL_THEME'\"\n [type]=\"btnType.ghost\"\n [withIcon]=\"activeOption()?.icon\"\n [withOnlyIcon]=\"true\"\n [isDropdown]=\"true\">\n\n <div class=\"selector-menu d-flex-v gap-md\" role=\"menu\" [attr.aria-label]=\"'_COMMON._THEME.LBL_THEME' | translate\" cwMenuKeyboard (escapePressed)=\"trigger()?.closeDropdown()\">\n @if (showReloadHint()) {\n <p class=\"selector-menu-hint fs-xs\">{{ '_COMMON._THEME.RELOAD_HINT' | translate }}</p>\n }\n\n <div class=\"d-flex-v gap-2xs\">\n <div class=\"selector-menu-title fs-sm fw-bold\">{{ '_COMMON._THEME.LBL_THEME' | translate }}</div>\n\n <ul class=\"list-unstyled\" role=\"group\">\n @for (theme of themes(); track theme.key) {\n <li role=\"none\">\n <button\n type=\"button\"\n role=\"menuitemradio\"\n class=\"justify-between\"\n [class.active]=\"theme.key === currentTheme()\"\n [attr.aria-checked]=\"theme.key === currentTheme()\"\n (click)=\"onSelect(theme.key)\">\n <cw-icon [icon]=\"theme.icon\" [iconSize]=\"iconSizeEnum.sm\"></cw-icon>\n <span class=\"flex-1\">{{ theme.labelKey | translate }}</span>\n @if (theme.key === currentTheme()) {\n <cw-icon [icon]=\"spriteIcon.check\" [iconSize]=\"iconSizeEnum.xs\"></cw-icon>\n }\n </button>\n </li>\n }\n </ul>\n </div>\n </div>\n</cw-button>\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: TranslateModule }, { kind: "component", type: ButtonComponent, selector: "cw-button", inputs: ["type", "label", "id", "link", "isDropdown", "hideCaret", "withIcon", "withOnlyIcon", "iconSize", "iconPosition", "dropdownPosition", "isMinWidth", "isDisabled", "isLoading", "cssClass", "dataTest", "skeletonMode", "withTooltip", "tooltipText", "tooltipTitle", "tooltipTrigger", "tooltipPosition", "tooltipType"], outputs: ["btnAction", "dropDownClicked"] }, { kind: "component", type: IconComponent, selector: "cw-icon", inputs: ["icon", "label", "type", "iconSize", "iconCssClass", "iconUiType", "iconColorCustom", "spritePath"] }, { kind: "directive", type: MenuKeyboardDirective, selector: "[cwMenuKeyboard]", inputs: ["menuItemSelector"], outputs: ["escapePressed"] }, { kind: "pipe", type: i2.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
4759
5238
  }
4760
5239
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: ThemeSelectorComponent, decorators: [{
4761
5240
  type: Component,
4762
- args: [{ selector: 'cw-theme-selector', standalone: true, host: { 'class': 'd-flex-h' }, imports: [
5241
+ args: [{ selector: 'cw-theme-selector', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, host: { 'class': 'd-flex-h' }, imports: [
4763
5242
  CommonModule,
4764
5243
  TranslateModule,
4765
5244
  ButtonComponent,
4766
- IconComponent
4767
- ], template: "<cw-button\n [label]=\"activeOption()?.labelKey ?? '_COMMON._THEME.LBL_THEME'\"\n [type]=\"btnType.ghost\"\n [withIcon]=\"activeOption()?.icon\"\n [withOnlyIcon]=\"true\"\n [isDropdown]=\"true\">\n\n <div class=\"selector-menu d-flex-v gap-md\" role=\"menu\" [attr.aria-label]=\"'_COMMON._THEME.LBL_THEME' | translate\">\n @if (showReloadHint()) {\n <p class=\"selector-menu-hint fs-xs\">{{ '_COMMON._THEME.RELOAD_HINT' | translate }}</p>\n }\n\n <div class=\"d-flex-v gap-2xs\">\n <div class=\"selector-menu-title fs-sm fw-bold\">{{ '_COMMON._THEME.LBL_THEME' | translate }}</div>\n\n <ul class=\"list-unstyled\">\n @for (theme of themes(); track theme.key) {\n <li>\n <button\n type=\"button\"\n role=\"menuitemradio\"\n class=\"justify-between\"\n [class.active]=\"theme.key === currentTheme()\"\n [attr.aria-checked]=\"theme.key === currentTheme()\"\n (click)=\"onSelect(theme.key)\">\n <cw-icon [icon]=\"theme.icon\" [iconSize]=\"iconSizeEnum.sm\"></cw-icon>\n <span class=\"flex-1\">{{ theme.labelKey | translate }}</span>\n @if (theme.key === currentTheme()) {\n <cw-icon [icon]=\"spriteIcon.check\" [iconSize]=\"iconSizeEnum.xs\"></cw-icon>\n }\n </button>\n </li>\n }\n </ul>\n </div>\n </div>\n</cw-button>\n" }]
5245
+ IconComponent,
5246
+ MenuKeyboardDirective
5247
+ ], template: "<cw-button\n [label]=\"activeOption()?.labelKey ?? '_COMMON._THEME.LBL_THEME'\"\n [type]=\"btnType.ghost\"\n [withIcon]=\"activeOption()?.icon\"\n [withOnlyIcon]=\"true\"\n [isDropdown]=\"true\">\n\n <div class=\"selector-menu d-flex-v gap-md\" role=\"menu\" [attr.aria-label]=\"'_COMMON._THEME.LBL_THEME' | translate\" cwMenuKeyboard (escapePressed)=\"trigger()?.closeDropdown()\">\n @if (showReloadHint()) {\n <p class=\"selector-menu-hint fs-xs\">{{ '_COMMON._THEME.RELOAD_HINT' | translate }}</p>\n }\n\n <div class=\"d-flex-v gap-2xs\">\n <div class=\"selector-menu-title fs-sm fw-bold\">{{ '_COMMON._THEME.LBL_THEME' | translate }}</div>\n\n <ul class=\"list-unstyled\" role=\"group\">\n @for (theme of themes(); track theme.key) {\n <li role=\"none\">\n <button\n type=\"button\"\n role=\"menuitemradio\"\n class=\"justify-between\"\n [class.active]=\"theme.key === currentTheme()\"\n [attr.aria-checked]=\"theme.key === currentTheme()\"\n (click)=\"onSelect(theme.key)\">\n <cw-icon [icon]=\"theme.icon\" [iconSize]=\"iconSizeEnum.sm\"></cw-icon>\n <span class=\"flex-1\">{{ theme.labelKey | translate }}</span>\n @if (theme.key === currentTheme()) {\n <cw-icon [icon]=\"spriteIcon.check\" [iconSize]=\"iconSizeEnum.xs\"></cw-icon>\n }\n </button>\n </li>\n }\n </ul>\n </div>\n </div>\n</cw-button>\n" }]
4768
5248
  }], propDecorators: { themes: [{ type: i0.Input, args: [{ isSignal: true, alias: "themes", required: false }] }], currentTheme: [{ type: i0.Input, args: [{ isSignal: true, alias: "currentTheme", required: true }] }], showReloadHint: [{ type: i0.Input, args: [{ isSignal: true, alias: "showReloadHint", required: false }] }], themeChange: [{ type: i0.Output, args: ["themeChange"] }], trigger: [{ type: i0.ViewChild, args: [i0.forwardRef(() => ButtonComponent), { isSignal: true }] }] } });
4769
5249
 
4770
5250
  var PlacementEnum;
@@ -4920,5 +5400,5 @@ const CW_DEFAULT_THEME_OPTIONS = [
4920
5400
  * Generated bundle index. Do not edit.
4921
5401
  */
4922
5402
 
4923
- export { AccordionComponent, AlertComponent, AlertTypeEnum, BadgeComponent, BadgePositionEnum, BadgeTypeEnum, BoButtonTypeEnum, BoTabTypeEnum, BreadcrumbComponent, ButtonComponent, ButtonIconSizeEnum, ButtonPositionEnum, CW_DEFAULT_THEME_OPTIONS, CardComponent, CardTitleRankEnum, CardTypeEnum, ClickOutsideDirective, CollapseDirective, CwThemeKeyEnum, CwTooltipDirective, DropdownComponent, DropdownItemDirective, DropdownPositionEnum, FileDropComponent, FileDropFileStatusEnum, FileDropModeEnum, FileDropRejectReasonEnum, FileToDownloadComponent, FoButtonTypeEnum, FoTabTypeEnum, FocusTrackerService, FormFieldComponent, FormFieldTypeEnum, IconComponent, IconNotifSizeEnum, IconNotifTypeEnum, IconNotificationComponent, IconSizeEnum, IconTypeEnum, IconUiTypeEnum, ImageComponent, LanguageSelectorComponent, LegendComponent, LegendTypeEnum, LoaderComponent, LoaderSizeEnum, ModalsComponent, ModalsService, ModalsSize, ModalsState, ModalsTextType, ModalsType, NumericalRangeComponent, NumericalRangeLabelPositionEnum, NumericalRangeTypeEnum, PlacementEnum, RequiredInfoComponent, ResponsiveService, SkipLinksComponent, SpriteIconEnum, StepperComponent, TOAST_AUTOHIDE_DELAY_MS, TabComponent, TabContentComponent, ThemeSelectorComponent, ThemeService, TitleComponent, TitleContextEnum, TitleTagEnum, ToastComponent, ToastItemComponent, ToastService, TooltipPositionEnum, TriggerTooltipEnum, TypeTooltipEnum, rangeValidator, resolveArrowPos };
5403
+ export { AccordionComponent, AlertComponent, AlertTypeEnum, BadgeComponent, BadgePositionEnum, BadgeTypeEnum, BoButtonTypeEnum, BoTabTypeEnum, BreadcrumbComponent, ButtonComponent, ButtonIconSizeEnum, ButtonPositionEnum, CW_DEFAULT_THEME_OPTIONS, CardComponent, CardTitleRankEnum, CardTypeEnum, ClickOutsideDirective, CollapseDirective, CwThemeKeyEnum, CwTooltipDirective, DropdownComponent, DropdownItemDirective, DropdownPositionEnum, EmptyStateComponent, EmptyStateIllustrationEnum, FileDropComponent, FileDropFileStatusEnum, FileDropModeEnum, FileDropRejectReasonEnum, FileToDownloadComponent, FoButtonTypeEnum, FoTabTypeEnum, FocusTrackerService, FormFieldComponent, FormFieldTypeEnum, IconComponent, IconNotifSizeEnum, IconNotifTypeEnum, IconNotificationComponent, IconSizeEnum, IconTypeEnum, IconUiTypeEnum, ImageComponent, LanguageSelectorComponent, LegendColorEnum, LegendComponent, LegendTypeEnum, LoaderComponent, LoaderSizeEnum, ModalsComponent, ModalsService, ModalsSize, ModalsState, ModalsTextType, ModalsType, NumericalRangeComponent, NumericalRangeLabelPositionEnum, NumericalRangeTypeEnum, PlacementEnum, RequiredInfoComponent, ResponsiveService, SkipLinksComponent, SpriteIconEnum, StepperComponent, TOAST_AUTOHIDE_DELAY_MS, TabComponent, TabContentComponent, ThemeSelectorComponent, ThemeService, TitleComponent, TitleContextEnum, TitleTagEnum, ToastComponent, ToastItemComponent, ToastService, TooltipPositionEnum, TriggerTooltipEnum, TypeTooltipEnum, rangeValidator, resolveArrowPos };
4924
5404
  //# sourceMappingURL=cityway-basic-ui.mjs.map