@cityway/basic-ui 1.1.0-beta025 → 1.1.0-beta027

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,7 +1,7 @@
1
1
  import * as i1 from '@angular/common';
2
2
  import { CommonModule, DOCUMENT, isPlatformBrowser, NgClass, NgTemplateOutlet } from '@angular/common';
3
3
  import * as i0 from '@angular/core';
4
- import { inject, ElementRef, model, output, effect, Directive, input, HostBinding, ChangeDetectionStrategy, Component, ChangeDetectorRef, viewChild, signal, computed, untracked, contentChildren, DestroyRef, Injectable, NgZone, Renderer2, ViewContainerRef, PLATFORM_ID, Pipe, EventEmitter, TemplateRef, ContentChild, Output, Input, ApplicationRef, Injector, createComponent, viewChildren, forwardRef } from '@angular/core';
4
+ import { inject, ElementRef, model, output, effect, Directive, input, HostBinding, ChangeDetectionStrategy, Component, ChangeDetectorRef, viewChild, signal, computed, untracked, contentChildren, DestroyRef, Injectable, NgZone, Renderer2, ViewContainerRef, PLATFORM_ID, Pipe, EventEmitter, TemplateRef, ContentChild, Output, Input, ApplicationRef, Injector, createComponent, contentChild, viewChildren, forwardRef } from '@angular/core';
5
5
  import * as i2 from '@ngx-translate/core';
6
6
  import { TranslatePipe, TranslateModule, TranslateService } from '@ngx-translate/core';
7
7
  import { LiveAnnouncer } from '@angular/cdk/a11y';
@@ -829,7 +829,7 @@ class CardComponent {
829
829
  return this.isCollapsed();
830
830
  }
831
831
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: CardComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
832
- 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 }, titleId: { classPropertyName: "titleId", publicName: "titleId", isSignal: true, isRequired: false, transformFunction: null }, subtitle: { classPropertyName: "subtitle", publicName: "subtitle", isSignal: true, isRequired: false, transformFunction: null }, truncateSubtitle: { classPropertyName: "truncateSubtitle", publicName: "truncateSubtitle", 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 }, fullHeight: { classPropertyName: "fullHeight", publicName: "fullHeight", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { collapsible: "collapsibleChange", destroyOnHide: "destroyOnHideChange", collapseClicked: "collapseClicked" }, host: { properties: { "class.card-full-height": "fullHeight()" } }, viewQueries: [{ propertyName: "collapseDirective", first: true, predicate: ["collapse"], descendants: true, isSignal: true }, { propertyName: "cardFooter", first: true, predicate: ["cardFooter"], descendants: true, isSignal: true }, { propertyName: "cardHeader", first: true, predicate: ["cardHeader"], 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 (hasHeader()) {\r\n <div #cardHeader 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 (title(); as title) {\r\n @if (titleRank() === titleRankEnum.h2) {\r\n <h2 class=\"text-truncate\" [id]=\"titleId()\">{{ title | translate }}</h2>\r\n }\r\n @else if (titleRank() === titleRankEnum.h3) {\r\n <h3 class=\"text-truncate\" [id]=\"titleId()\">{{ title | translate }}</h3>\r\n }\r\n }\r\n\r\n @if (subtitle(); as subtitle) {\r\n <div class=\"card-subtitle fs fs-xs text-light\" [class.text-truncate]=\"truncateSubtitle()\">{{ subtitle }}</div>\r\n }\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", "text", "label", "type", "iconSize", "iconCssClass", "iconUiType", "iconColorCustom", "spritePath"] }, { kind: "pipe", type: TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
832
+ 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 }, titleId: { classPropertyName: "titleId", publicName: "titleId", isSignal: true, isRequired: false, transformFunction: null }, subtitle: { classPropertyName: "subtitle", publicName: "subtitle", isSignal: true, isRequired: false, transformFunction: null }, truncateSubtitle: { classPropertyName: "truncateSubtitle", publicName: "truncateSubtitle", 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 }, fullHeight: { classPropertyName: "fullHeight", publicName: "fullHeight", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { collapsible: "collapsibleChange", destroyOnHide: "destroyOnHideChange", collapseClicked: "collapseClicked" }, host: { properties: { "class.card-full-height": "fullHeight()" } }, viewQueries: [{ propertyName: "collapseDirective", first: true, predicate: ["collapse"], descendants: true, isSignal: true }, { propertyName: "cardFooter", first: true, predicate: ["cardFooter"], descendants: true, isSignal: true }, { propertyName: "cardHeader", first: true, predicate: ["cardHeader"], 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 (hasHeader()) {\r\n <div #cardHeader 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 (title(); as title) {\r\n @if (titleRank() === titleRankEnum.h2) {\r\n <h2 class=\"text-truncate\" [id]=\"titleId()\">{{ title | translate }}</h2>\r\n }\r\n @else if (titleRank() === titleRankEnum.h3) {\r\n <h3 class=\"text-truncate\" [id]=\"titleId()\">{{ title | translate }}</h3>\r\n }\r\n }\r\n\r\n @if (subtitle(); as subtitle) {\r\n <div class=\"card-subtitle fs fs-xs text-light\" [class.text-truncate]=\"truncateSubtitle()\">{{ subtitle }}</div>\r\n }\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 <!-- Listes pleine largeur, avant (`[card-list-top]`) ou apres (`[card-list-bottom]`) le corps :\r\n une ligne par enfant direct, separees par une bordure. -->\r\n <ng-content select=\"[card-list-top]\"></ng-content>\r\n\r\n <div class=\"card-body\">\r\n <ng-content></ng-content>\r\n </div>\r\n\r\n <ng-content select=\"[card-list-bottom]\"></ng-content>\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", "text", "label", "type", "iconSize", "iconCssClass", "iconUiType", "iconColorCustom", "spritePath"] }, { kind: "pipe", type: TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
833
833
  }
834
834
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: CardComponent, decorators: [{
835
835
  type: Component,
@@ -840,7 +840,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.20", ngImpo
840
840
  CollapseDirective,
841
841
  IconComponent,
842
842
  TranslatePipe
843
- ], template: "<div class=\"card\" [ngClass]=\"cssClass()\" [class.card-collapse]=\"collapsible()\" [class.card-disabled]=\"collapsible() && disabled()\" [class.card-light]=\"type() === typeEnum.light\">\r\n @if (hasHeader()) {\r\n <div #cardHeader 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 (title(); as title) {\r\n @if (titleRank() === titleRankEnum.h2) {\r\n <h2 class=\"text-truncate\" [id]=\"titleId()\">{{ title | translate }}</h2>\r\n }\r\n @else if (titleRank() === titleRankEnum.h3) {\r\n <h3 class=\"text-truncate\" [id]=\"titleId()\">{{ title | translate }}</h3>\r\n }\r\n }\r\n\r\n @if (subtitle(); as subtitle) {\r\n <div class=\"card-subtitle fs fs-xs text-light\" [class.text-truncate]=\"truncateSubtitle()\">{{ subtitle }}</div>\r\n }\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" }]
843
+ ], template: "<div class=\"card\" [ngClass]=\"cssClass()\" [class.card-collapse]=\"collapsible()\" [class.card-disabled]=\"collapsible() && disabled()\" [class.card-light]=\"type() === typeEnum.light\">\r\n @if (hasHeader()) {\r\n <div #cardHeader 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 (title(); as title) {\r\n @if (titleRank() === titleRankEnum.h2) {\r\n <h2 class=\"text-truncate\" [id]=\"titleId()\">{{ title | translate }}</h2>\r\n }\r\n @else if (titleRank() === titleRankEnum.h3) {\r\n <h3 class=\"text-truncate\" [id]=\"titleId()\">{{ title | translate }}</h3>\r\n }\r\n }\r\n\r\n @if (subtitle(); as subtitle) {\r\n <div class=\"card-subtitle fs fs-xs text-light\" [class.text-truncate]=\"truncateSubtitle()\">{{ subtitle }}</div>\r\n }\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 <!-- Listes pleine largeur, avant (`[card-list-top]`) ou apres (`[card-list-bottom]`) le corps :\r\n une ligne par enfant direct, separees par une bordure. -->\r\n <ng-content select=\"[card-list-top]\"></ng-content>\r\n\r\n <div class=\"card-body\">\r\n <ng-content></ng-content>\r\n </div>\r\n\r\n <ng-content select=\"[card-list-bottom]\"></ng-content>\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" }]
844
844
  }], ctorParameters: () => [], propDecorators: { title: [{ type: i0.Input, args: [{ isSignal: true, alias: "title", required: false }] }], titleId: [{ type: i0.Input, args: [{ isSignal: true, alias: "titleId", required: false }] }], subtitle: [{ type: i0.Input, args: [{ isSignal: true, alias: "subtitle", required: false }] }], truncateSubtitle: [{ type: i0.Input, args: [{ isSignal: true, alias: "truncateSubtitle", 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"] }], fullHeight: [{ type: i0.Input, args: [{ isSignal: true, alias: "fullHeight", required: false }] }], collapseClicked: [{ type: i0.Output, args: ["collapseClicked"] }], collapseDirective: [{ type: i0.ViewChild, args: ['collapse', { isSignal: true }] }], cardFooter: [{ type: i0.ViewChild, args: ['cardFooter', { isSignal: true }] }], cardHeader: [{ type: i0.ViewChild, args: ['cardHeader', { isSignal: true }] }] } });
845
845
 
846
846
  class AccordionComponent {
@@ -1364,6 +1364,8 @@ var BadgeTypeEnum;
1364
1364
  BadgeTypeEnum["lightWarning"] = "light-warning";
1365
1365
  BadgeTypeEnum["lightDanger"] = "light-danger";
1366
1366
  BadgeTypeEnum["lightLight"] = "light-light";
1367
+ /** Fond blanc (surface/default) : badge pose sur une surface claire (bande de sous-onglets, card light). */
1368
+ BadgeTypeEnum["lightWhite"] = "light-white";
1367
1369
  // Heavy variants
1368
1370
  BadgeTypeEnum["heavyPrimary"] = "heavy-primary";
1369
1371
  BadgeTypeEnum["heavyInfo"] = "heavy-info";
@@ -1947,6 +1949,12 @@ class ButtonComponent {
1947
1949
  this.dropdownMenu()?.nativeElement.classList.toggle("show");
1948
1950
  this.isOpen = !this.isOpen;
1949
1951
  this.dropDownClicked.emit(this.isOpen);
1952
+ if (this.isOpen) {
1953
+ this.escapeClipping();
1954
+ }
1955
+ else {
1956
+ this.releaseFixedMenu?.();
1957
+ }
1950
1958
  const menu = this.dropdownMenu()?.nativeElement;
1951
1959
  if (this.isOpen && !this.focusOutInitialized && menu) {
1952
1960
  this.focusOut(menu);
@@ -1966,6 +1974,55 @@ class ButtonComponent {
1966
1974
  this.dropdownMenu()?.nativeElement.classList.remove("show");
1967
1975
  this.isOpen = false;
1968
1976
  this.dropDownClicked.emit(this.isOpen);
1977
+ this.releaseFixedMenu?.();
1978
+ }
1979
+ /**
1980
+ * Menu ouvert dans un conteneur qui rogne (`overflow` non visible : table qui defile
1981
+ * horizontalement, panneau scrollable...) : le menu en `position: absolute` y serait coupe. Il
1982
+ * passe alors en `position: fixed`, cale sur le bouton, recale a chaque defilement (fenetre ou
1983
+ * conteneur) et ferme au redimensionnement. Sans conteneur qui rogne, rien ne change.
1984
+ *
1985
+ * Pas de mode fixe sous un ancetre transforme (modale animee par `translate` / `scale`...) : le
1986
+ * `fixed` s'y calerait sur cet ancetre et non sur la fenetre, le menu serait mal place.
1987
+ */
1988
+ escapeClipping() {
1989
+ const menu = this.dropdownMenu()?.nativeElement;
1990
+ const toggle = this.dropdownToggle()?.nativeElement;
1991
+ if (!menu || !toggle || typeof window === 'undefined' || !this.isClippedWithoutTransform(toggle))
1992
+ return;
1993
+ const alignRight = this.placementCss === 'dropdown-menu-right';
1994
+ const place = () => {
1995
+ const rect = toggle.getBoundingClientRect();
1996
+ menu.style.position = 'fixed';
1997
+ menu.style.top = `${rect.bottom}px`;
1998
+ menu.style.left = alignRight ? 'auto' : `${rect.left}px`;
1999
+ menu.style.right = alignRight ? `${document.documentElement.clientWidth - rect.right}px` : 'auto';
2000
+ };
2001
+ place();
2002
+ // Capture : attrape aussi le defilement des conteneurs (l'evenement scroll ne remonte pas).
2003
+ window.addEventListener('scroll', place, true);
2004
+ const unlistenResize = this.renderer.listen('window', 'resize', () => this.closeDropdown());
2005
+ this.releaseFixedMenu = () => {
2006
+ window.removeEventListener('scroll', place, true);
2007
+ unlistenResize();
2008
+ menu.style.position = menu.style.top = menu.style.left = menu.style.right = '';
2009
+ this.releaseFixedMenu = undefined;
2010
+ };
2011
+ }
2012
+ /** Un ancetre rogne son contenu, et aucun ancetre ne fausserait un `position: fixed`. */
2013
+ isClippedWithoutTransform(element) {
2014
+ let clipped = false;
2015
+ for (let el = element.parentElement; el && el !== document.body; el = el.parentElement) {
2016
+ const style = getComputedStyle(el);
2017
+ if (style.transform !== 'none' || style.translate !== 'none' || style.scale !== 'none'
2018
+ || style.rotate !== 'none' || style.filter !== 'none' || style.perspective !== 'none'
2019
+ || /paint|layout|strict|content/.test(style.contain)) {
2020
+ return false;
2021
+ }
2022
+ if (style.overflowX !== 'visible' || style.overflowY !== 'visible')
2023
+ clipped = true;
2024
+ }
2025
+ return clipped;
1969
2026
  }
1970
2027
  getPlacement(placement) {
1971
2028
  switch (placement) {
@@ -2907,7 +2964,7 @@ class AutocompleteComponent {
2907
2964
  return s.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
2908
2965
  }
2909
2966
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: AutocompleteComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
2910
- 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" }] }); }
2967
+ 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 <!-- Texte principal et colonnes additionnelles empiles, a cote de la case (mode multiple). -->\n <span class=\"d-flex-v gap-5xs\">\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 </span>\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" }] }); }
2911
2968
  }
2912
2969
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: AutocompleteComponent, decorators: [{
2913
2970
  type: Component,
@@ -2916,7 +2973,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.20", ngImpo
2916
2973
  ReactiveFormsModule,
2917
2974
  TranslateModule,
2918
2975
  ClickOutsideDirective
2919
- ], 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"] }]
2976
+ ], 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 <!-- Texte principal et colonnes additionnelles empiles, a cote de la case (mode multiple). -->\n <span class=\"d-flex-v gap-5xs\">\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 </span>\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"] }]
2920
2977
  }], 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 }] }] } });
2921
2978
 
2922
2979
  /**
@@ -3601,12 +3658,20 @@ class FormFieldComponent {
3601
3658
  || this.type === this.typeField.checkboxCardCompact
3602
3659
  || this.isSwitchCard;
3603
3660
  }
3661
+ /** Branchement `[control]` ou `[formGroup]` + `[name]` : les deux sont détectés. */
3604
3662
  get isRange() {
3605
- if (!this.control)
3606
- return false;
3607
- return this.control instanceof FormGroup &&
3608
- 'start' in this.control.controls &&
3609
- 'end' in this.control.controls;
3663
+ const ctrl = this.controlOrGroup;
3664
+ return ctrl instanceof FormGroup &&
3665
+ 'start' in ctrl.controls &&
3666
+ 'end' in ctrl.controls;
3667
+ }
3668
+ /** Borne `start` obligatoire : `requiredStart` si fourni, sinon `isRequired`. */
3669
+ get isStartRequired() {
3670
+ return this.requiredStart ?? this.isRequired;
3671
+ }
3672
+ /** Borne `end` obligatoire : `requiredEnd` si fourni, sinon `isRequired`. */
3673
+ get isEndRequired() {
3674
+ return this.requiredEnd ?? this.isRequired;
3610
3675
  }
3611
3676
  get formControl() {
3612
3677
  return this.control;
@@ -3804,23 +3869,7 @@ class FormFieldComponent {
3804
3869
  return entries;
3805
3870
  }
3806
3871
  ngOnInit() {
3807
- if (this.formGroup && this.name) {
3808
- const group = this.formGroup.get(this.name);
3809
- if (group instanceof FormGroup) {
3810
- switch (this.type) {
3811
- case this.typeField.dateToDate:
3812
- group.setValidators(g => rangeValidator(g, 'date'));
3813
- break;
3814
- case this.typeField.timeToTime:
3815
- group.setValidators(g => rangeValidator(g, 'time'));
3816
- break;
3817
- case this.typeField.dateTimeToDateTime:
3818
- group.setValidators(g => rangeValidator(g, 'datetime'));
3819
- break;
3820
- }
3821
- group.updateValueAndValidity({ emitEvent: false });
3822
- }
3823
- }
3872
+ this.applyRangeValidator();
3824
3873
  // Pour `type=file`, on applique TOUJOURS les validators Angular dès qu'au moins
3825
3874
  // une option (`accept` ou `maxSize`) est fournie : l'attribut HTML `accept` ne
3826
3875
  // valide rien (juste un hint pour le file picker) et `maxSize` n'a aucun
@@ -3854,29 +3903,47 @@ class FormFieldComponent {
3854
3903
  });
3855
3904
  }
3856
3905
  }
3906
+ /**
3907
+ * Pose `rangeValidator` (erreur `rangeInvalid` si start > end) sur le groupe d'une période,
3908
+ * quel que soit le branchement (`[control]` ou `[formGroup]` + `[name]`). Ajouté (pas
3909
+ * `setValidators`) pour ne pas écraser les validators du parent.
3910
+ */
3911
+ applyRangeValidator() {
3912
+ if (!this.isRange)
3913
+ return;
3914
+ const kind = this.type === this.typeField.dateToDate ? 'date'
3915
+ : this.type === this.typeField.timeToTime ? 'time'
3916
+ : this.type === this.typeField.dateTimeToDateTime ? 'datetime'
3917
+ : null;
3918
+ if (!kind)
3919
+ return;
3920
+ const group = this.controlOrGroup;
3921
+ group.addValidators(g => rangeValidator(g, kind));
3922
+ group.updateValueAndValidity({ emitEvent: false });
3923
+ }
3857
3924
  /**
3858
3925
  * Synchronise `Validators.required` sur le control lié en fonction de `isRequired`.
3859
3926
  * - Ne mute que ce qui a été ajouté ici (tracking via flags) pour ne pas écraser un validator du parent.
3860
- * - Étend aux sous-controls `start`/`end` pour les types période.
3927
+ * - Périodes : chaque sous-control `start`/`end` suit `isStartRequired` / `isEndRequired`.
3861
3928
  */
3862
3929
  syncRequiredValidator() {
3863
3930
  if (this.isRange) {
3864
3931
  const startCtrl = this.getControl('start');
3865
3932
  const endCtrl = this.getControl('end');
3866
3933
  if (startCtrl)
3867
- this.requiredAppliedStart = this.toggleRequired(startCtrl, this.requiredAppliedStart);
3934
+ this.requiredAppliedStart = this.toggleRequired(startCtrl, this.requiredAppliedStart, this.isStartRequired);
3868
3935
  if (endCtrl)
3869
- this.requiredAppliedEnd = this.toggleRequired(endCtrl, this.requiredAppliedEnd);
3936
+ this.requiredAppliedEnd = this.toggleRequired(endCtrl, this.requiredAppliedEnd, this.isEndRequired);
3870
3937
  }
3871
3938
  else {
3872
3939
  const ctrl = this.controlOrGroup;
3873
3940
  if (ctrl)
3874
- this.requiredAppliedMain = this.toggleRequired(ctrl, this.requiredAppliedMain);
3941
+ this.requiredAppliedMain = this.toggleRequired(ctrl, this.requiredAppliedMain, this.isRequired);
3875
3942
  }
3876
3943
  }
3877
- /** Ajoute/retire `Validators.required` selon `isRequired`, et retourne le nouveau flag "appliqué par nous". */
3878
- toggleRequired(ctrl, alreadyApplied) {
3879
- if (this.isRequired) {
3944
+ /** Ajoute/retire `Validators.required` selon `required`, et retourne le nouveau flag "appliqué par nous". */
3945
+ toggleRequired(ctrl, alreadyApplied, required) {
3946
+ if (required) {
3880
3947
  if (!ctrl.hasValidator(Validators.required)) {
3881
3948
  ctrl.addValidators(Validators.required);
3882
3949
  ctrl.updateValueAndValidity({ emitEvent: false });
@@ -3997,7 +4064,7 @@ class FormFieldComponent {
3997
4064
  if (changes['options'] && changes['options'].currentValue) {
3998
4065
  this.options = [...changes['options'].currentValue];
3999
4066
  }
4000
- if (changes['isRequired'] && !changes['isRequired'].firstChange) {
4067
+ if (['isRequired', 'requiredStart', 'requiredEnd'].some(k => changes[k] && !changes[k].firstChange)) {
4001
4068
  this.syncRequiredValidator();
4002
4069
  }
4003
4070
  if (changes['isDisabled'] && !changes['isDisabled'].firstChange) {
@@ -4237,7 +4304,7 @@ class FormFieldComponent {
4237
4304
  getControl(path) {
4238
4305
  if (!this.isRange)
4239
4306
  return null;
4240
- const group = this.control;
4307
+ const group = this.controlOrGroup;
4241
4308
  return group.get(path);
4242
4309
  }
4243
4310
  getInputType() {
@@ -4388,7 +4455,7 @@ class FormFieldComponent {
4388
4455
  this.formControl.markAsTouched();
4389
4456
  }
4390
4457
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: FormFieldComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
4391
- 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 }, fieldTitle: { classPropertyName: "fieldTitle", publicName: "fieldTitle", 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 }, ariaDescribedBy: { classPropertyName: "ariaDescribedBy", publicName: "ariaDescribedBy", 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 }, recommendedDimensions: { classPropertyName: "recommendedDimensions", publicName: "recommendedDimensions", isSignal: false, isRequired: false, transformFunction: null }, showPreview: { classPropertyName: "showPreview", publicName: "showPreview", isSignal: false, isRequired: false, transformFunction: null }, existingFile: { classPropertyName: "existingFile", publicName: "existingFile", isSignal: false, isRequired: false, transformFunction: null }, indeterminate: { classPropertyName: "indeterminate", publicName: "indeterminate", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { refreshEvent: "refreshEvent", fileRemoved: "fileRemoved", 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 }, { propertyName: "ngSelectRef", first: true, predicate: NgSelectComponent, descendants: true, isSignal: true }], usesOnChanges: true, ngImport: i0, template: "@if (!isInAddon) {\n @if (\n type !== typeField.checkbox &&\n type !== typeField.radio &&\n type !== typeField.checkboxButton &&\n type !== typeField.radioButton &&\n type !== typeField.checkboxInline &&\n type !== typeField.radioInline &&\n type !== typeField.switch &&\n type !== typeField.range &&\n type !== typeField.switchSmall &&\n !isChoiceCard &&\n !isPeriod\n ) {\n <!-- Bouton d'aide HORS du <label> (bouton dans un label = HTML invalide, son libelle\n polluerait le nom accessible du champ et un clic activerait le label) : on aligne\n label + bouton dans un conteneur flex, seulement quand il y a une aide. -->\n @if (hasFieldTooltip) {\n <div class=\"d-flex-h gap-2xs\">\n <ng-container *ngTemplateOutlet=\"fieldLabel\"></ng-container>\n <ng-container *ngTemplateOutlet=\"fieldTooltip\"></ng-container>\n </div>\n } @else {\n <ng-container *ngTemplateOutlet=\"fieldLabel\"></ng-container>\n }\n }\n\n @if (addonLeft || addonRight) {\n <div class=\"field-group\" [class.field-group-invalid]=\"isInvalid\" [class.field-group-disabled]=\"isDisabledOrReadonly\">\n @if(addonLeft) {\n <div class=\"field-group-addon-left\">\n <ng-container [ngTemplateOutlet]=\"addonLeft\"></ng-container>\n </div>\n }\n <ng-container [ngTemplateOutlet]=\"field\"></ng-container>\n @if(addonRight) {\n <div class=\"field-group-addon-right\">\n <ng-container [ngTemplateOutlet]=\"addonRight\"></ng-container>\n </div>\n }\n </div>\n }\n @else {\n @if ( isInInputGroup() ) {\n <div class=\"field-group\" [class.field-group-invalid]=\"isInvalid\" [class.field-group-disabled]=\"isDisabledOrReadonly\">\n <ng-container [ngTemplateOutlet]=\"field\"></ng-container>\n </div>\n }\n @else {\n <ng-container [ngTemplateOutlet]=\"field\"></ng-container>\n }\n }\n\n <!-- Error message -->\n @if (controlOrGroup?.invalid && controlOrGroup?.touched) {\n <div class=\"field-invalid\" [id]=\"'error-' + name\">\n @if (\n !errorMessages?.['required'] &&\n ((controlOrGroup?.errors?.['required']) || (getControl('start')?.errors?.['required'] || getControl('end')?.errors?.['required']))\n ) {\n <span [innerHtml]=\"'_COMMON._FORM.ERROR_IS_MANDATORY' | translate: {label: label | translate}\"></span>\n }\n @if (!errorMessages?.['rangeInvalid'] && controlOrGroup?.errors?.['rangeInvalid']) {\n <span>{{'_COMMON._DATES.ERROR_START_END_PERIOD' | translate}}</span>\n }\n @if (!errorMessages?.['fileExtension'] && controlOrGroup?.errors?.['fileExtension']) {\n <span>{{ '_COMMON._FORM.ERROR_FILE_EXTENSION' | translate: { accept: acceptLabel } }}</span>\n }\n @if (!errorMessages?.['fileSize'] && controlOrGroup?.errors?.['fileSize']) {\n <span>{{ '_COMMON._FORM.ERROR_FILE_SIZE' | translate: { maxSize: maxSizeLabel } }}</span>\n }\n @if (!errorMessages?.['email'] && controlOrGroup?.errors?.['email']) {\n <span>{{ '_COMMON._FORM.ERROR_INVALID_EMAIL' | translate }}</span>\n }\n @if (!errorMessages?.['phone'] && controlOrGroup?.errors?.['phone']) {\n <span>{{ '_COMMON._FORM.ERROR_INVALID_PHONE' | translate }}</span>\n }\n @if (errorMessages) {\n @for (entry of errorMessages | keyvalue: keepOrder; track entry.key) {\n @if (controlOrGroup?.errors?.[entry.key]; as errVal) {\n <span>{{ entry.value | translate: (errVal === true ? null : errVal) }}</span>\n }\n }\n }\n </div>\n }\n\n @if (help || autoHelpEntries.length) {\n <div [id]=\"name + '-help'\" class=\"field-text\">\n @if (help) {\n <span>{{ help | translate }}</span>\n }\n @for (entry of autoHelpEntries; track entry.key) {\n <!-- Espace explicite : les blancs entre balises sont supprim\u00E9s \u00E0 la compilation. -->\n {{ ' ' }}<span>{{ entry.key | translate: entry.params }}</span>\n }\n </div>\n }\n\n <!-- Aper\u00E7u du fichier (type=file, opt-in) : sous le champ et ses aides, comme dans la\n maquette DS. La croix native du champ n'est pas retir\u00E9e \u2014 les deux vident le m\u00EAme\n control, l'aper\u00E7u ajoute juste \u00AB Visualiser \u00BB et une cible plus grande. -->\n @if (isPreviewVisible) {\n <cw-file-preview [file]=\"previewFile\" [existingFile]=\"existingFile ?? null\"\n [disabled]=\"!!isDisabledOrReadonly\" (remove)=\"onPreviewRemove()\" />\n }\n\n <!-- Chips de la multi-s\u00E9lection (autocomplete) : rendus ici, hors du field-group et apr\u00E8s\n erreur/help, pour \u00EAtre visuellement d\u00E9tach\u00E9s du champ. La donn\u00E9e et le retrait restent\n port\u00E9s par cw-autocomplete (`chips()` / `onChipRemove()`), seul l'affichage est d\u00E9l\u00E9gu\u00E9. -->\n @if (type === typeField.autocompleteMultiple && autocompleteRef()?.chips()?.length) {\n <ul class=\"autocomplete-chips\" role=\"list\">\n @for (chip of autocompleteRef()!.chips(); track chip.item) {\n <li>\n <button type=\"button\" class=\"autocomplete-chip\"\n [disabled]=\"isEffectivelyDisabled || isReadonly\"\n (click)=\"autocompleteRef()!.onChipRemove(chip.item)\">\n <span>{{ chip.label }}</span>\n @if (!isEffectivelyDisabled && !isReadonly) {\n <span aria-hidden=\"true\" class=\"autocomplete-chip-x\">&times;</span>\n <span class=\"visually-hidden\">{{ '_COMMON._ACTION.DELETE' | translate }}</span>\n }\n </button>\n </li>\n }\n </ul>\n }\n}\n@else {\n <ng-container [ngTemplateOutlet]=\"field\"></ng-container>\n}\n\n<ng-template #field>\n <!-- Autocomplete (mono / multi) -->\n @if ((type === typeField.autocomplete || type === typeField.autocompleteMultiple) && autocompleteOptions) {\n <cw-autocomplete\n [id]=\"name\"\n [control]=\"formControl\"\n [fetcher]=\"autocompleteOptions.fetcher\"\n [displayField]=\"autocompleteOptions.displayField ?? 'label'\"\n [valueField]=\"autocompleteOptions.valueField ?? 'id'\"\n [columns]=\"autocompleteOptions.columns ?? []\"\n [resolver]=\"autocompleteOptions.resolver ?? null\"\n [selectedItem]=\"autocompleteOptions.selectedItem ?? null\"\n [selectedItems]=\"autocompleteOptions.selectedItems ?? []\"\n [minChars]=\"autocompleteOptions.minChars ?? 2\"\n [debounceMs]=\"autocompleteOptions.debounceMs ?? 250\"\n [multiple]=\"type === typeField.autocompleteMultiple\"\n [isRequired]=\"isRequired\"\n [isReadonly]=\"!!isReadonly\"\n [isDisabled]=\"isEffectivelyDisabled\"\n [ariaInvalid]=\"control.invalid && control.touched\"\n [ariaDescribedBy]=\"getDescribedBy(control)\"\n [placeholder]=\"placeholder\">\n </cw-autocomplete>\n }\n\n <!-- Rich text editor (Quill) : sous-composant interne, sans field-group ni bouton clear\n (il porte sa propre bordure + toolbar). Le label statique du form-field reste au-dessus. -->\n @if (type === typeField.richText) {\n <cw-rich-text-editor\n [id]=\"name\"\n [control]=\"formControl\"\n [options]=\"richTextOptions\"\n [placeholder]=\"placeholder ? (placeholder | translate) : ''\"\n [isRequired]=\"isRequired\"\n [isReadonly]=\"!!isReadonly\"\n [isDisabled]=\"isEffectivelyDisabled\"\n [ariaInvalid]=\"control.invalid && control.touched\"\n [ariaDescribedBy]=\"getDescribedBy(control)\">\n </cw-rich-text-editor>\n }\n\n <!-- Text -->\n @if ([typeField.text, typeField.date, typeField.time, typeField.dateTime, typeField.number,\n typeField.email,\n typeField.color, typeField.zipCode].includes(type)) {\n <input [type]=\"type === typeField.zipCode ? 'text' : type\" class=\"field-control\" [id]=\"name\" [formControl]=\"formControl\"\n [attr.title]=\"fieldTitle ? (fieldTitle | translate) : null\"\n [ngClass]=\"[(cssClass || ''), formControl?.value ? 'has-value' : '', type === typeField.zipCode ? 'field-control-zipcode' : '']\"\n [attr.placeholder]=\"placeholder ? (placeholder | translate) : null\" [attr.required]=\"isRequired ? 'required' : null\"\n [attr.readonly]=\"isReadonly ? 'readonly' : null\" [attr.aria-required]=\"isRequired\"\n [attr.minlength]=\"minLengthAttr\" [attr.maxlength]=\"maxLengthAttr\"\n [attr.min]=\"minAttr\" [attr.max]=\"maxAttr\" [attr.step]=\"stepAttr\" [attr.pattern]=\"patternAttr\"\n [attr.autocomplete]=\"autocomplete\"\n [attr.aria-invalid]=\"control.invalid && control.touched\"\n [attr.aria-describedby]=\"getDescribedBy(control)\"\n (focus)=\"onFocus()\" (blur)=\"onBlur()\" />\n }\n\n <!-- Phone (intl-tel-input) -->\n @if (type === typeField.phone) {\n <input #phoneInput type=\"tel\" class=\"field-control\" [id]=\"name\"\n [attr.placeholder]=\"placeholder ? (placeholder | translate) : null\" [attr.required]=\"isRequired ? 'required' : null\"\n [attr.readonly]=\"isReadonly ? 'readonly' : null\" [disabled]=\"isEffectivelyDisabled\" [attr.aria-required]=\"isRequired\"\n [attr.autocomplete]=\"autocomplete\"\n [attr.aria-invalid]=\"control.invalid && control.touched\"\n [attr.aria-describedby]=\"getDescribedBy(control)\"\n (focus)=\"onFocus()\" (blur)=\"onPhoneBlur($event)\" />\n }\n\n <!-- File -->\n @if (type === typeField.file) {\n <!-- L'input natif reste LE controle (focus, clavier, restitution aux lecteurs d'ecran,\n validation), mais il est masque visuellement : le libelle de son bouton et son\n \u00AB aucun fichier choisi \u00BB sont ecrits par le NAVIGATEUR, dans SA langue. Ils sont\n intraduisibles et ne suivent pas la langue de l'application \u2014 un utilisateur qui\n bascule en anglais garderait \u00AB Choisir un fichier \u00BB. On les reecrit donc a cote,\n traduits, dans une couche purement visuelle. -->\n <input #fileInput type=\"file\" class=\"field-control visually-hidden\" [id]=\"name\"\n [ngClass]=\"[(cssClass || ''), formControl?.value ? 'has-value' : '']\"\n [attr.required]=\"isRequired ? 'required' : null\"\n [attr.readonly]=\"isReadonly ? 'readonly' : null\" [disabled]=\"isEffectivelyDisabled\" [attr.aria-required]=\"isRequired\"\n [attr.accept]=\"acceptAttr\"\n [attr.aria-invalid]=\"control.invalid && control.touched\"\n [attr.aria-describedby]=\"getDescribedBy(control)\"\n (change)=\"onFileChange($event)\" (focus)=\"onFocus()\" (blur)=\"onBlur()\" />\n\n <!-- `aria-hidden` : doublon visuel de l'input, que les lecteurs d'ecran restituent deja\n (nom du champ, bouton de parcours, fichier selectionne). L'annoncer une seconde fois\n ne ferait que bavarder. Le clic est relaye a l'input, le clavier passe par lui. -->\n <span class=\"field-file\" aria-hidden=\"true\" (click)=\"openFilePicker()\">\n <span class=\"field-file-button\">{{ '_COMMON._FORM.CHOOSE_FILE' | translate }}</span>\n <span class=\"field-file-name\" [class.field-file-name-empty]=\"!selectedFileName\">\n {{ selectedFileName ?? ('_COMMON._FORM.NO_FILE_SELECTED' | translate) }}\n </span>\n </span>\n }\n\n @if (type === typeField.password) {\n <input [type]=\"isPasswordShown ? 'text' : 'password'\" class=\"field-control\" [id]=\"name\" [formControl]=\"formControl\"\n [ngClass]=\"[(cssClass || ''), formControl?.value ? 'has-value' : '']\"\n [attr.required]=\"isRequired ? 'required' : null\" [attr.readonly]=\"isReadonly ? 'readonly' : null\"\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\" [attr.aria-required]=\"isRequired\"\n [attr.minlength]=\"minLengthAttr\" [attr.maxlength]=\"maxLengthAttr\" [attr.pattern]=\"patternAttr\"\n [attr.autocomplete]=\"autocomplete\"\n [attr.aria-invalid]=\"control.invalid && control.touched\"\n [attr.aria-describedby]=\"getDescribedBy(control)\"\n (focus)=\"onFocus()\" (blur)=\"onBlur()\" />\n <cw-button [type]=\"buttonType.ghost\"\n cssClass=\"btn-password-field\"\n [withIcon]=\"isPasswordShown ? spriteIcon.toolbarHidePassword : spriteIcon.toolbarShowPassword\"\n [withOnlyIcon]=\"true\"\n [label]=\"isPasswordShown ? '_COMMON._FORM._SHOW_HIDE_PWD.HIDE' : '_COMMON._FORM._SHOW_HIDE_PWD.SHOW'\"\n (btnAction)=\"togglePasswordVisibility()\">\n </cw-button>\n }\n\n <!-- Textarea -->\n @if (type === typeField.textarea) {\n <textarea class=\"field-control\" [id]=\"name\" [formControl]=\"formControl\"\n [ngClass]=\"[(cssClass || ''), formControl?.value ? 'has-value' : '']\"\n [attr.placeholder]=\"placeholder ? (placeholder | translate) : null\" [attr.required]=\"isRequired ? 'required' : null\"\n [attr.readonly]=\"isReadonly ? 'readonly' : null\" [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\"\n [attr.aria-required]=\"isRequired\" [attr.aria-invalid]=\"control.invalid && control.touched\"\n [attr.minlength]=\"minLengthAttr\" [attr.maxlength]=\"maxLengthAttr\" [attr.pattern]=\"patternAttr\"\n [attr.autocomplete]=\"autocomplete\"\n [attr.aria-describedby]=\"getDescribedBy(control)\"\n (focus)=\"onFocus()\" (blur)=\"onBlur()\"></textarea>\n }\n\n <!-- Select -->\n @if (type === typeField.select) {\n <ng-select [formControl]=\"formControl\" [items]=\"options\" bindLabel=\"label\" [labelForId]=\"name\" [appendTo]=\"appendTo ?? ''\" bindValue=\"value\"\n [ngClass]=\"cssClass\" [searchable]=\"false\" [placeholder]=\"placeholder ? (placeholder | translate) : ''\" [readonly]=\"isReadonly\" [clearable]=\"false\"\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\" [attr.required]=\"isRequired ? 'required' : null\"\n [attr.aria-required]=\"isRequired\" [attr.aria-invalid]=\"control.invalid && control.touched\"\n [attr.aria-describedby]=\"getDescribedBy(control)\" [attr.id]=\"name\"\n (focus)=\"onFocus()\" (blur)=\"onBlur()\" (open)=\"onDropdownOpen()\" (close)=\"onDropdownClose()\">\n\n <!-- Template pour les options -->\n <ng-template ng-option-tmp let-item=\"item\" let-index=\"index\" let-search=\"searchTerm\">\n @if (optionTemplate) {\n <ng-container *ngTemplateOutlet=\"optionTemplate; context: { item: item | translate, index: index, searchTerm: search }\"></ng-container>\n }\n @else {\n <div>{{ item.label | translate }}</div>\n }\n </ng-template>\n\n <!-- Template pour le label -->\n <ng-template ng-label-tmp let-item=\"item\">\n @if (labelTemplate) {\n <ng-container *ngTemplateOutlet=\"labelTemplate; context: { item: item | translate }\"></ng-container>\n }\n @else {\n {{ (item.label | translate) || (placeholder | translate) }}\n }\n </ng-template>\n </ng-select>\n }\n\n <!-- NgSelect -->\n @if (type === typeField.ngSelect || type === typeField.ngSelectMultiple) {\n <ng-select [formControl]=\"formControl\" [items]=\"options\" bindLabel=\"label\" [labelForId]=\"name\" [appendTo]=\"appendTo ?? ''\" bindValue=\"value\"\n [multiple]=\"type === typeField.ngSelectMultiple\" [ngClass]=\"cssClass\" [clearable]=\"false\"\n [placeholder]=\"placeholder ? (placeholder | translate) : ''\" [readonly]=\"isReadonly\"\n [notFoundText]=\"'_COMMON.NO_RESULT' | translate\" [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\"\n [attr.required]=\"isRequired ? 'required' : null\" [attr.aria-required]=\"isRequired\"\n [attr.aria-invalid]=\"control.invalid && control.touched\"\n [attr.aria-describedby]=\"getDescribedBy(control)\" [attr.id]=\"name\"\n (focus)=\"onFocus()\" (blur)=\"onBlur()\" (search)=\"textChanged.emit($event?.term)\"\n (open)=\"onDropdownOpen()\" (close)=\"onDropdownClose()\">\n\n <!-- Template pour les options -->\n <ng-template ng-option-tmp let-item=\"item\" let-index=\"index\" let-search=\"searchTerm\">\n @if (optionTemplate) {\n <ng-container *ngTemplateOutlet=\"optionTemplate; context: { item: item, index: index, searchTerm: search }\"></ng-container>\n }\n @else {\n <div>{{ item.label | translate }}</div>\n }\n </ng-template>\n\n <!-- Template pour le label -->\n <ng-template ng-label-tmp let-item=\"item\" let-clear=\"clear\">\n <span class=\"ng-value-icon left\" (click)=\"clear(item)\" aria-hidden=\"true\">\u00D7</span>\n @if (labelTemplate) {\n <ng-container *ngTemplateOutlet=\"labelTemplate; context: { item: item | translate }\"></ng-container>\n }\n @else {\n {{ (item.label | translate) || (placeholder | translate) }}\n }\n </ng-template>\n </ng-select>\n }\n\n <!-- Radio -->\n @if (type === typeField.radioInline || type === typeField.radio) {\n <fieldset [attr.aria-labelledby]=\"hasFieldTooltip ? legendId : null\"\n [attr.aria-required]=\"isRequired\"\n [attr.aria-invalid]=\"control.invalid && control.touched\"\n [attr.aria-describedby]=\"getDescribedBy(control)\">\n <legend class=\"field-label\" [class.visually-hidden]=\"!displayLabel\" [class.d-flex-h]=\"hasFieldTooltip\" [class.gap-2xs]=\"hasFieldTooltip\">\n <span [id]=\"legendId\">\n {{label | translate}}\n @if(isRequired) {\n <span class=\"text-danger\">*</span>\n }\n </span>\n @if (hasFieldTooltip) {\n <ng-container *ngTemplateOutlet=\"fieldTooltip\"></ng-container>\n }\n </legend>\n <ul class=\"list-unstyled mb-none\" [ngClass]=\"type === typeField.radioInline ? 'd-flex-h gap-md flex-wrap' : 'd-flex-v gap-sm'\">\n @for (opt of options; track opt.value) {\n <li class=\"field-check\">\n <input type=\"radio\" [id]=\"name + '_' + opt.value\" [attr.name]=\"name\" [value]=\"opt.value\" [formControl]=\"formControl\"\n class=\"field-check-input\" [attr.disabled]=\"(isEffectivelyDisabled || opt.disabled) ? 'disabled' : null\" (change)=\"onRadioChange(opt.value)\" />\n <label [for]=\"name + '_' + opt.value\" class=\"field-check-label\">{{ opt.label | translate }}</label>\n </li>\n }\n </ul>\n </fieldset>\n }\n\n <!-- Radio button -->\n @if (type === typeField.radioButton) {\n <fieldset [attr.aria-labelledby]=\"hasFieldTooltip ? legendId : null\"\n [attr.aria-required]=\"isRequired\"\n [attr.aria-invalid]=\"control.invalid && control.touched\"\n [attr.aria-describedby]=\"getDescribedBy(control)\">\n <legend class=\"field-label\" [class.visually-hidden]=\"!displayLabel\" [class.d-flex-h]=\"hasFieldTooltip\" [class.gap-2xs]=\"hasFieldTooltip\">\n <span [id]=\"legendId\">\n {{label | translate}}\n @if(isRequired) {\n <span class=\"text-danger\">*</span>\n }\n </span>\n @if (hasFieldTooltip) {\n <ng-container *ngTemplateOutlet=\"fieldTooltip\"></ng-container>\n }\n </legend>\n <div class=\"field-group field-group-btn\">\n @for (opt of options; track opt.value) {\n <input type=\"radio\" [id]=\"name + '_' + opt.value\" [attr.name]=\"name\" [value]=\"opt.value\" [formControl]=\"formControl\"\n class=\"visually-hidden\" [attr.disabled]=\"(isEffectivelyDisabled || opt.disabled) ? 'disabled' : null\" (change)=\"onRadioChange(opt.value)\"/>\n <label [for]=\"name + '_' + opt.value\" class=\"btn btn-field-group\">{{ opt.label | translate }}</label>\n }\n </div>\n </fieldset>\n }\n\n <!-- Cartes : checkbox / radio / switch (contr\u00F4le \u00E0 gauche, titre, description facultative) -->\n @if (isChoiceCard) {\n <fieldset [attr.aria-labelledby]=\"hasFieldTooltip ? legendId : null\"\n [attr.aria-required]=\"isRequired\"\n [attr.aria-invalid]=\"control.invalid && control.touched\"\n [attr.aria-describedby]=\"getDescribedBy(control)\">\n <legend class=\"field-label\" [class.visually-hidden]=\"!displayLabel\" [class.d-flex-h]=\"hasFieldTooltip\" [class.gap-2xs]=\"hasFieldTooltip\">\n <span [id]=\"legendId\">\n {{label | translate}}\n @if(isRequired) {\n <span class=\"text-danger\">*</span>\n }\n </span>\n @if (hasFieldTooltip) {\n <ng-container *ngTemplateOutlet=\"fieldTooltip\"></ng-container>\n }\n </legend>\n <ul class=\"field-card-list list-unstyled mb-none\" [class.field-card-list-compact]=\"isChoiceCardCompact\">\n @for (opt of options; track opt.value) {\n <li class=\"d-flex-v\">\n <!-- Le label englobe toute la carte : un clic n'importe o\u00F9 coche l'option. -->\n <label class=\"field-card d-flex-h items-start gap-xs flex-1\" [for]=\"name + '_' + opt.value\" [class.field-switch]=\"isSwitchCard\" [class.field-switch-small]=\"isSwitchCard\">\n @if (isRadioCard) {\n <input type=\"radio\" [id]=\"name + '_' + opt.value\" [attr.name]=\"name\" [value]=\"opt.value\" [formControl]=\"formControl\"\n class=\"field-check-input\"\n [attr.aria-describedby]=\"(!isChoiceCardCompact && opt.description) ? name + '_' + opt.value + '-desc' : null\"\n [attr.disabled]=\"(isEffectivelyDisabled || opt.disabled) ? 'disabled' : null\" (change)=\"onRadioChange(opt.value)\" />\n } @else {\n <input type=\"checkbox\" [id]=\"name + '_' + opt.value\" [value]=\"opt.value\" (change)=\"onCheckboxChange($event)\"\n [checked]=\"control.value?.includes(opt.value)\" class=\"field-check-input\"\n [attr.role]=\"isSwitchCard ? 'switch' : null\"\n [attr.aria-describedby]=\"(!isChoiceCardCompact && opt.description) ? name + '_' + opt.value + '-desc' : null\"\n [attr.disabled]=\"(isEffectivelyDisabled || opt.disabled) ? 'disabled' : null\" />\n }\n <span class=\"d-flex-v gap-5xs\">\n <span class=\"field-card-title\">{{ opt.label | translate }}</span>\n @if (!isChoiceCardCompact && opt.description) {\n <span class=\"field-text\" [id]=\"name + '_' + opt.value + '-desc'\">{{ opt.description | translate }}</span>\n }\n </span>\n </label>\n </li>\n }\n </ul>\n </fieldset>\n }\n\n <!-- Checkbox Switch -->\n @if ( type === typeField.switch || type === typeField.switchSmall)\n {\n <div class=\"field-check field-switch\" [ngClass]=\"{'field-switch-small': type === typeField.switchSmall}\">\n <input type=\"checkbox\" [id]=\"name\" [formControl]=\"formControl\" class=\"field-check-input\" [attr.aria-required]=\"isRequired\"\n [attr.aria-invalid]=\"control.invalid && control.touched\"\n [attr.aria-describedby]=\"getDescribedBy(control)\"\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\"/>\n <label [for]=\"name\" class=\"field-check-label\">{{ label | translate }}</label>\n </div>\n }\n\n <!-- Checkbox -->\n @if (type === typeField.checkboxInline || type === typeField.checkbox) {\n @if (isSingleCheckbox()) {\n <div class=\"field-check\" [class.field-check-inline]=\"type === typeField.checkboxInline\">\n <input #checkboxInput type=\"checkbox\" [id]=\"name\" [formControl]=\"formControl\"\n class=\"field-check-input\"\n [class.is-invalid]=\"control?.invalid && control?.touched\"\n [attr.aria-required]=\"isRequired\"\n [attr.aria-invalid]=\"control?.invalid && control?.touched\"\n [attr.aria-describedby]=\"getDescribedBy(control)\"\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\" />\n <label [for]=\"name\" class=\"field-check-label\">\n {{ label | translate }}\n @if (isRequired) {\n <span class=\"text-danger\">*</span>\n }\n </label>\n </div>\n }\n @else if( options.length > 1) {\n <fieldset [attr.aria-labelledby]=\"hasFieldTooltip ? legendId : null\"\n [attr.aria-required]=\"isRequired\"\n [attr.aria-invalid]=\"control.invalid && control.touched\"\n [attr.aria-describedby]=\"getDescribedBy(control)\"\n [ngClass]=\"{ 'flex-column': type === typeField.checkbox }\">\n <legend class=\"field-label\" [class.visually-hidden]=\"!displayLabel\" [class.d-flex-h]=\"hasFieldTooltip\" [class.gap-2xs]=\"hasFieldTooltip\">\n <span [id]=\"legendId\">\n {{label | translate}}\n @if(isRequired) {\n <span class=\"text-danger\">*</span>\n }\n </span>\n @if (hasFieldTooltip) {\n <ng-container *ngTemplateOutlet=\"fieldTooltip\"></ng-container>\n }\n </legend>\n <ul class=\"list-unstyled mb-none\" [ngClass]=\"type === typeField.checkboxInline ? 'd-flex-h gap-md' : 'd-flex-v gap-sm'\">\n @for (opt of options; track opt.value) {\n <li class=\"field-check\" [ngClass]=\"{ 'field-check-inline': type === typeField.checkboxInline }\">\n <input type=\"checkbox\" [id]=\"name + '_' + opt.value\" [value]=\"opt.value\" (change)=\"onCheckboxChange($event)\"\n [checked]=\"control.value?.includes(opt.value)\" class=\"field-check-input\"\n [attr.disabled]=\"(isEffectivelyDisabled || opt.disabled) ? 'disabled' : null\" />\n <label [for]=\"name + '_' + opt.value\" class=\"field-check-label\">\n {{ opt.label | translate }}\n </label>\n </li>\n }\n </ul>\n </fieldset>\n }\n @else {\n <fieldset [attr.aria-labelledby]=\"hasFieldTooltip ? legendId : null\">\n <legend class=\"field-label\" [class.visually-hidden]=\"!displayLabel\" [class.d-flex-h]=\"hasFieldTooltip\" [class.gap-2xs]=\"hasFieldTooltip\">\n <span [id]=\"legendId\">\n {{label | translate}}\n </span>\n @if (hasFieldTooltip) {\n <ng-container *ngTemplateOutlet=\"fieldTooltip\"></ng-container>\n }\n </legend>\n <ul class=\"list-unstyled mb-none\" [ngClass]=\"type === typeField.checkboxInline ? 'd-flex-h gap-md' : 'd-flex-v gap-sm'\">\n @for (opt of options; track opt.value) {\n <li class=\"field-check\" [ngClass]=\"{ 'field-check-inline': type === typeField.checkboxInline }\">\n <input type=\"checkbox\" [id]=\"name + '_' + opt.value\" [value]=\"opt.value\" (change)=\"onCheckboxChange($event)\"\n [checked]=\"control.value?.includes(opt.value)\" class=\"field-check-input\"\n [attr.aria-required]=\"isRequired\"\n [attr.aria-invalid]=\"control.invalid && control.touched\"\n [attr.aria-describedby]=\"getDescribedBy(control)\"\n [attr.disabled]=\"(isEffectivelyDisabled || opt.disabled) ? 'disabled' : null\" />\n <label [for]=\"name + '_' + opt.value\" class=\"field-check-label\">\n {{ opt.label | translate }}\n @if(isRequired) {\n <span class=\"text-danger\">*</span>\n }\n </label>\n </li>\n }\n </ul>\n </fieldset>\n }\n }\n\n <!-- Checkbox button -->\n @if (type === typeField.checkboxButton && options.length > 0) {\n\n @if(options.length > 1) {\n <fieldset [attr.aria-labelledby]=\"hasFieldTooltip ? legendId : null\"\n [attr.aria-required]=\"isRequired\"\n [attr.aria-invalid]=\"control.invalid && control.touched\"\n [attr.aria-describedby]=\"getDescribedBy(control)\">\n <legend class=\"field-label\" [class.visually-hidden]=\"!displayLabel\" [class.d-flex-h]=\"hasFieldTooltip\" [class.gap-2xs]=\"hasFieldTooltip\">\n <span [id]=\"legendId\">\n {{label | translate}}\n @if(isRequired) {\n <span class=\"text-danger\">*</span>\n }\n </span>\n @if (hasFieldTooltip) {\n <ng-container *ngTemplateOutlet=\"fieldTooltip\"></ng-container>\n }\n </legend>\n <div class=\"field-group field-group-btn\">\n @for (opt of options; track opt.value) {\n <input type=\"checkbox\" [id]=\"name + '_' + opt.value\" [value]=\"opt.value\" (change)=\"onCheckboxChange($event)\"\n [checked]=\"control.value?.includes(opt.value)\" class=\"visually-hidden\"\n [attr.disabled]=\"(isEffectivelyDisabled || opt.disabled) ? 'disabled' : null\" />\n <label [for]=\"name + '_' + opt.value\" class=\"btn btn-field-group\">{{ opt.label | translate }}</label>\n }\n </div>\n </fieldset>\n }\n @else {\n <fieldset [attr.aria-labelledby]=\"hasFieldTooltip ? legendId : null\">\n <legend class=\"field-label\" [class.visually-hidden]=\"!displayLabel\" [class.d-flex-h]=\"hasFieldTooltip\" [class.gap-2xs]=\"hasFieldTooltip\">\n <span [id]=\"legendId\">\n {{label | translate}}\n </span>\n @if (hasFieldTooltip) {\n <ng-container *ngTemplateOutlet=\"fieldTooltip\"></ng-container>\n }\n </legend>\n <div class=\"btn-group btn-group-secondary\">\n @for (opt of options; track opt.value) {\n <input type=\"checkbox\" [id]=\"name + '_' + opt.value\" [value]=\"opt.value\" (change)=\"onCheckboxChange($event)\"\n [checked]=\"control.value?.includes(opt.value)\" class=\"visually-hidden\"\n [attr.aria-required]=\"isRequired\"\n [attr.aria-invalid]=\"control.invalid && control.touched\"\n [attr.aria-describedby]=\"getDescribedBy(control)\"\n [attr.disabled]=\"(isEffectivelyDisabled || opt.disabled) ? 'disabled' : null\"/>\n <label [for]=\"name + '_' + opt.value\" class=\"btn btn-field-group\">\n {{ opt.label | translate}}\n @if(isRequired) {\n <span class=\"text-danger\">*</span>\n }\n </label>\n }\n </div>\n </fieldset>\n }\n }\n\n <!-- Period - DateToDate / TimeToTime / DateTimeToDateTime -->\n @if (isPeriod) {\n <!-- Fieldset : le legend nomme la p\u00E9riode, \u00AB Du \u00BB / \u00AB au \u00BB sont les labels de chaque input. -->\n <fieldset [attr.aria-labelledby]=\"hasFieldTooltip ? legendId : null\">\n <legend class=\"field-label\" [class.visually-hidden]=\"!displayLabel\" [class.d-flex-h]=\"hasFieldTooltip\" [class.gap-2xs]=\"hasFieldTooltip\">\n <span [id]=\"legendId\">\n {{label | translate}}\n @if(isRequired) {\n <span class=\"text-danger\">*</span>\n }\n </span>\n @if (hasFieldTooltip) {\n <ng-container *ngTemplateOutlet=\"fieldTooltip\"></ng-container>\n }\n </legend>\n <div class=\"field-group\">\n <label class=\"field-group-addon-left\" [for]=\"name + '_start'\">{{ '_COMMON._DATES.FROM_TO_1' | translate }}</label>\n <input [type]=\"getInputType()\" class=\"field-control\" [id]=\"name + '_start'\" [formControl]=\"getControl('start')!\"\n [attr.title]=\"fieldTitle ? (fieldTitle | translate) + ' \u2013 ' + ('_COMMON._DATES.FROM_TO_1' | translate) : null\"\n [attr.placeholder]=\"type === typeField.timeToTime ? ('_COMMON._DATES.FROM' | translate) : ('_COMMON._DATES.FROM_TO_1' | translate)\"\n [ngClass]=\"[(cssClass || ''), getControl('start')?.value ? 'has-value' : '']\"\n [attr.required]=\"isRequired ? 'required' : null\" [attr.readonly]=\"isReadonly ? 'readonly' : null\"\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\" [attr.aria-required]=\"isRequired\"\n [attr.min]=\"minStartAttr\" [attr.max]=\"maxStartAttr\" [attr.step]=\"stepAttr\"\n [attr.autocomplete]=\"autocomplete\"\n [attr.aria-invalid]=\"getControl('start')?.invalid && getControl('start')?.touched\"\n [attr.aria-describedby]=\"getDescribedBy(getControl('start'))\"\n (focus)=\"onFocusRange('start')\" (blur)=\"onBlurRange('start')\" />\n\n @if(getControl('start')?.value && !isDisabledOrReadonly) {\n <button type=\"button\" class=\"btn btn-secondary btn-clear-field\"\n [attr.aria-label]=\"'_COMMON._FORM.CLEAR_START' | translate: { label: label | translate }\"\n (click)=\"onClearFieldPeriod('start')\">\n <span aria-hidden=\"true\">&times;</span>\n </button>\n }\n <label class=\"field-group-addon-center\" [for]=\"name + '_end'\">{{ '_COMMON._DATES.FROM_TO_2' | translate }}</label>\n <input [type]=\"getInputType()\" class=\"field-control\" [id]=\"name + '_end'\" [formControl]=\"getControl('end')!\"\n [attr.title]=\"fieldTitle ? (fieldTitle | translate) + ' \u2013 ' + ('_COMMON._DATES.FROM_TO_2' | translate) : null\"\n [attr.placeholder]=\"type === typeField.timeToTime ? ('_COMMON._DATES.TO' | translate) : ('_COMMON._DATES.FROM_TO_2' | translate)\"\n [ngClass]=\"[(cssClass || ''), getControl('end')?.value ? 'has-value' : '']\"\n [attr.required]=\"isRequired ? 'required' : null\" [attr.readonly]=\"isReadonly ? 'readonly' : null\"\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\"\n [attr.min]=\"minEndAttr\" [attr.max]=\"maxEndAttr\" [attr.step]=\"stepAttr\"\n [attr.autocomplete]=\"autocomplete\"\n [attr.aria-invalid]=\"getControl('end')?.invalid && getControl('end')?.touched\"\n [attr.aria-describedby]=\"getDescribedBy(getControl('end'))\"\n (focus)=\"onFocusRange('end')\" (blur)=\"onBlurRange('end')\" />\n\n @if(getControl('end')?.value && !isDisabledOrReadonly) {\n <button type=\"button\" class=\"btn btn-ghost btn-clear-field\"\n [attr.aria-label]=\"'_COMMON._FORM.CLEAR_END' | translate: { label: label | translate }\"\n (click)=\"onClearFieldPeriod('end')\">\n <span aria-hidden=\"true\">&times;</span>\n </button>\n }\n </div>\n </fieldset>\n }\n\n @if ([typeField.datePlusOne, typeField.datePlusTwo, typeField.datePlusSeven, typeField.dateComplexe].includes(type)) {\n\n <div class=\"field-group\">\n @if (type === typeField.dateComplexe) {\n <div class=\"field-group-addon-left\">\n <button class=\"btn btn-ghost\" type=\"button\" (click)=\"onDateAddDay('prev')\"\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\">\n <cw-icon font=\"optyweb\" [icon]=\"spriteIcon.nextLeft\" [label]=\"'Jour pr\u00E9c\u00E9dent'\"></cw-icon>\n </button>\n </div>\n }\n\n <input type=\"date\" class=\"field-control\" [id]=\"name\" [formControl]=\"formControl\"\n [attr.title]=\"fieldTitle ? (fieldTitle | translate) : null\"\n [ngClass]=\"[(cssClass || ''), formControl?.value ? 'has-value' : '']\"\n [attr.placeholder]=\"placeholder ? (placeholder | translate) : null\" [attr.required]=\"isRequired ? 'required' : null\"\n [attr.readonly]=\"isReadonly ? 'readonly' : null\" [attr.aria-required]=\"isRequired\"\n [attr.min]=\"minAttr\" [attr.max]=\"maxAttr\" [attr.step]=\"stepAttr\"\n [attr.autocomplete]=\"autocomplete\"\n [attr.aria-invalid]=\"control.invalid && control.touched\"\n [attr.aria-describedby]=\"getDescribedBy(control)\"\n (focus)=\"onFocus()\" (blur)=\"onBlur()\" />\n\n @if(formControl?.value && !isDisabledOrReadonly) {\n <button class=\"btn btn-ghost btn-clear-field\" type=\"button\"\n [attr.aria-label]=\"'_COMMON._FORM.CLEAR_FIELD' | translate: { label: label | translate }\"\n (click)=\"onClearField(formControl)\"><span aria-hidden=\"true\">&times;</span></button>\n }\n\n\n @if (type === typeField.dateComplexe) {\n <div class=\"field-group-addon-right\">\n <button class=\"btn btn-ghost\" type=\"button\" (click)=\"onDateAddDay('next')\"\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\">\n <cw-icon font=\"optyweb\" [icon]=\"spriteIcon.nextRight\" [label]=\"'Jour suivant'\"></cw-icon>\n </button>\n </div>\n <div class=\"field-group-addon-right\">\n <button class=\"btn btn-ghost\" type=\"button\" (click)=\"onRefresh()\"\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\">\n <cw-icon font=\"optyweb\" [icon]=\"spriteIcon.toolbarRefresh\" [label]=\"'Rafra\u00EEchir'\"></cw-icon>\n </button>\n </div>\n }\n\n <div class=\"field-group-addon-right\">\n <button class=\"btn btn-ghost\" type=\"button\" (click)=\"onTodayAddDay(0)\"\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\">\n J\n <span class=\"visually-hidden\">Aujourd'hui</span>\n </button>\n </div>\n <div class=\"field-group-addon-right\">\n <button class=\"btn btn-ghost\" type=\"button\" (click)=\"onTodayAddDay(1)\"\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\">\n J+1\n <span class=\"visually-hidden\">Demain</span>\n </button>\n </div>\n\n @if (type !== typeField.datePlusOne && type !== typeField.dateComplexe) {\n <div class=\"field-group-addon-right\">\n <button class=\"btn btn-ghost \" type=\"button\" (click)=\"onTodayAddDay(2)\"\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\">\n J+2\n <span class=\"visually-hidden\">Dans 2 jours</span>\n </button>\n </div>\n\n @if (type !== typeField.datePlusTwo) {\n <div class=\"field-group-addon-right\">\n <button class=\"btn btn-ghost\" type=\"button\" (click)=\"onTodayAddDay(7)\"\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\">\n J+7\n <span class=\"visually-hidden\">Dans 7 jours</span>\n </button>\n </div>\n }\n }\n </div>\n }\n\n @if (type === typeField.slider) {\n <ngx-slider [(value)]=\"sliderValue\" [options]=\"sliderOptions\" [formControl]=\"formControl\"></ngx-slider>\n }\n\n @if (type === typeField.range) {\n <div class=\"slider\">\n\n <cw-button [isDisabled]=\"formControl.value <= rangeOptions.floor\" [label]=\"'Diminuer ' + formControl.value + ' ' + label\"\n [withIcon]=\"spriteIcon.toolbarMinus\" [withOnlyIcon]=\"true\" [type]=\"buttonType.primary\"\n [iconSize]=\"buttonIconSize.small\" (btnAction)=\"onRangeStep('decrease')\">\n </cw-button>\n\n <div class=\"slider-input\">\n <label [for]=\"name\" class=\"slider-tooltip\" [style.left]=\"getRangePercent() + '%'\" aria-live=\"polite\"\n aria-atomic=\"true\">\n {{ label | translate }} {{ formControl.value }}\n @if (rangeOptions.unit) {\n <abbr [title]=\"rangeOptions.unit\">{{ rangeOptions.unit }}</abbr>\n }\n </label>\n\n <div class=\"slider-custom-bar\">\n <div class=\"slider-custom-bar-selection\" [style.width]=\"getRangePercent() + '%'\">\n </div>\n </div>\n\n <input type=\"range\" [id]=\"name\" [formControl]=\"formControl\" [min]=\"rangeOptions.floor\" [max]=\"rangeOptions.ceil\"\n [step]=\"rangeOptions.step || 1\" class=\"field-control-range\" [attr.aria-required]=\"isRequired\"\n [attr.aria-invalid]=\"control.invalid && control.touched\">\n </div>\n\n <cw-button [isDisabled]=\"formControl.value >= rangeOptions.ceil\" [label]=\"'Augmenter ' + formControl.value + ' ' + label\"\n [withIcon]=\"spriteIcon.toolbarPlus\" [withOnlyIcon]=\"true\" [type]=\"buttonType.primary\"\n [iconSize]=\"buttonIconSize.small\" (btnAction)=\"onRangeStep('increase')\">\n </cw-button>\n </div>\n }\n\n @if (isInInputGroup() && clearable && !isDisabledOrReadonly && type !== typeField.autocompleteMultiple) {\n @if (type === typeField.autocomplete) {\n @if (autocompleteRef()?.hasAnyContent()) {\n <button class=\"btn btn-secondary btn-clear-field\" type=\"button\"\n [attr.aria-label]=\"'_COMMON._FORM.CLEAR_FIELD' | translate: { label: label | translate }\"\n (click)=\"onClearAutocomplete()\"><span aria-hidden=\"true\">&times;</span></button>\n }\n } @else if (type === typeField.ngSelectMultiple) {\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. -->\n @if (formControl?.value?.length) {\n <button class=\"btn btn-ghost btn-clear-field\" type=\"button\"\n [attr.aria-label]=\"'_COMMON._FORM.CLEAR_FIELD' | translate: { label: label | translate }\"\n (click)=\"onClearField(formControl)\"><span aria-hidden=\"true\">&times;</span></button>\n }\n } @else {\n @if(formControl?.value) {\n <button class=\"btn btn-ghost btn-clear-field\" type=\"button\"\n [attr.aria-label]=\"'_COMMON._FORM.CLEAR_FIELD' | translate: { label: label | translate }\"\n (click)=\"onClearField(formControl)\"><span aria-hidden=\"true\">&times;</span></button>\n }\n }\n }\n\n</ng-template>\n\n<ng-template #fieldLabel>\n <label [for]=\"name\" class=\"field-label\" [class.visually-hidden]=\"!displayLabel\">\n {{ label | translate }}\n\n @if (isRequired) {\n <span class=\"text-danger\">*</span>\n }\n </label>\n</ng-template>\n\n<!-- Bouton d'aide (tooltip) partage label/legend. Hors du <label> (sinon son libelle\n s'ajoute au nom du champ et le clic active le label) ; dans un <legend>, le fieldset\n est nomme par aria-labelledby sur le seul texte (legendId) pour la meme raison. -->\n<ng-template #fieldTooltip>\n <button type=\"button\" class=\"btn btn-ghost btn-field-tooltip\"\n [cwTooltip]=\"tooltip ?? ''\"\n [attr.data-test-ctw]=\"'tooltip-' + name\">\n <cw-icon [icon]=\"spriteIcon.alertHelp\" [type]=\"iconType.circular\" [iconUiType]=\"iconUiType.info\"\n [iconSize]=\"iconSize.xs\" [label]=\"'_COMMON._FORM.TOOLTIP_HELP' | translate\"></cw-icon>\n </button>\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: "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", "text", "label", "type", "iconSize", "iconCssClass", "iconUiType", "iconColorCustom", "spritePath"] }, { kind: "component", type: ButtonComponent, selector: "cw-button", inputs: ["type", "label", "labelParams", "id", "link", "isDropdown", "hideCaret", "withIcon", "withOnlyIcon", "iconSize", "iconPosition", "dropdownPosition", "isMinWidth", "isDisabled", "isLoading", "loadingAnnounce", "cssClass", "dataTest", "skeletonMode", "isPressed", "ariaDescribedBy", "ariaLabel", "ariaExpanded", "ariaControls", "withTooltip", "tooltipText", "tooltipTitle", "tooltipTrigger", "tooltipPosition", "tooltipType"], outputs: ["btnAction", "dropDownClicked"] }, { kind: "directive", type: CwTooltipDirective, selector: "[cwTooltip]", inputs: ["cwTooltip", "cwTooltipTitle", "cwTooltipType", "cwTooltipTrigger", "cwTooltipPosition", "cwTooltipDisabled"] }, { 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: "component", type: FilePreviewComponent, selector: "cw-file-preview", inputs: ["file", "existingFile", "showActions", "disabled", "dataTest"], outputs: ["remove"] }, { kind: "pipe", type: i1.KeyValuePipe, name: "keyvalue" }, { kind: "pipe", type: i2.TranslatePipe, name: "translate" }] }); }
4458
+ 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 }, fieldTitle: { classPropertyName: "fieldTitle", publicName: "fieldTitle", 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 }, requiredStart: { classPropertyName: "requiredStart", publicName: "requiredStart", isSignal: false, isRequired: false, transformFunction: null }, requiredEnd: { classPropertyName: "requiredEnd", publicName: "requiredEnd", isSignal: false, isRequired: false, transformFunction: null }, help: { classPropertyName: "help", publicName: "help", isSignal: false, isRequired: false, transformFunction: null }, helpParams: { classPropertyName: "helpParams", publicName: "helpParams", isSignal: false, isRequired: false, transformFunction: null }, tooltip: { classPropertyName: "tooltip", publicName: "tooltip", isSignal: false, isRequired: false, transformFunction: null }, ariaDescribedBy: { classPropertyName: "ariaDescribedBy", publicName: "ariaDescribedBy", 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 }, recommendedDimensions: { classPropertyName: "recommendedDimensions", publicName: "recommendedDimensions", isSignal: false, isRequired: false, transformFunction: null }, showPreview: { classPropertyName: "showPreview", publicName: "showPreview", isSignal: false, isRequired: false, transformFunction: null }, existingFile: { classPropertyName: "existingFile", publicName: "existingFile", isSignal: false, isRequired: false, transformFunction: null }, indeterminate: { classPropertyName: "indeterminate", publicName: "indeterminate", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { refreshEvent: "refreshEvent", fileRemoved: "fileRemoved", 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 }, { propertyName: "ngSelectRef", first: true, predicate: NgSelectComponent, descendants: true, isSignal: true }], usesOnChanges: true, ngImport: i0, template: "@if (!isInAddon) {\n @if (\n type !== typeField.checkbox &&\n type !== typeField.radio &&\n type !== typeField.checkboxButton &&\n type !== typeField.radioButton &&\n type !== typeField.checkboxInline &&\n type !== typeField.radioInline &&\n type !== typeField.switch &&\n type !== typeField.range &&\n type !== typeField.switchSmall &&\n !isChoiceCard &&\n !isPeriod\n ) {\n <!-- Bouton d'aide HORS du <label> (bouton dans un label = HTML invalide, son libelle\n polluerait le nom accessible du champ et un clic activerait le label) : on aligne\n label + bouton dans un conteneur flex, seulement quand il y a une aide. -->\n @if (hasFieldTooltip) {\n <div class=\"d-flex-h gap-2xs\">\n <ng-container *ngTemplateOutlet=\"fieldLabel\"></ng-container>\n <ng-container *ngTemplateOutlet=\"fieldTooltip\"></ng-container>\n </div>\n } @else {\n <ng-container *ngTemplateOutlet=\"fieldLabel\"></ng-container>\n }\n }\n\n @if (addonLeft || addonRight) {\n <div class=\"field-group\" [class.field-group-invalid]=\"isInvalid\" [class.field-group-disabled]=\"isDisabledOrReadonly\">\n @if(addonLeft) {\n <div class=\"field-group-addon-left\">\n <ng-container [ngTemplateOutlet]=\"addonLeft\"></ng-container>\n </div>\n }\n <ng-container [ngTemplateOutlet]=\"field\"></ng-container>\n @if(addonRight) {\n <div class=\"field-group-addon-right\">\n <ng-container [ngTemplateOutlet]=\"addonRight\"></ng-container>\n </div>\n }\n </div>\n }\n @else {\n @if ( isInInputGroup() ) {\n <div class=\"field-group\" [class.field-group-invalid]=\"isInvalid\" [class.field-group-disabled]=\"isDisabledOrReadonly\">\n <ng-container [ngTemplateOutlet]=\"field\"></ng-container>\n </div>\n }\n @else {\n <ng-container [ngTemplateOutlet]=\"field\"></ng-container>\n }\n }\n\n <!-- Error message -->\n @if (controlOrGroup?.invalid && controlOrGroup?.touched) {\n <div class=\"field-invalid\" [id]=\"'error-' + name\">\n @if (\n !errorMessages?.['required'] &&\n ((controlOrGroup?.errors?.['required']) || (getControl('start')?.errors?.['required'] || getControl('end')?.errors?.['required']))\n ) {\n <span [innerHtml]=\"'_COMMON._FORM.ERROR_IS_MANDATORY' | translate: {label: label | translate}\"></span>\n }\n @if (!errorMessages?.['rangeInvalid'] && controlOrGroup?.errors?.['rangeInvalid']) {\n <span>{{'_COMMON._DATES.ERROR_START_END_PERIOD' | translate}}</span>\n }\n @if (!errorMessages?.['fileExtension'] && controlOrGroup?.errors?.['fileExtension']) {\n <span>{{ '_COMMON._FORM.ERROR_FILE_EXTENSION' | translate: { accept: acceptLabel } }}</span>\n }\n @if (!errorMessages?.['fileSize'] && controlOrGroup?.errors?.['fileSize']) {\n <span>{{ '_COMMON._FORM.ERROR_FILE_SIZE' | translate: { maxSize: maxSizeLabel } }}</span>\n }\n @if (!errorMessages?.['email'] && controlOrGroup?.errors?.['email']) {\n <span>{{ '_COMMON._FORM.ERROR_INVALID_EMAIL' | translate }}</span>\n }\n @if (!errorMessages?.['phone'] && controlOrGroup?.errors?.['phone']) {\n <span>{{ '_COMMON._FORM.ERROR_INVALID_PHONE' | translate }}</span>\n }\n @if (errorMessages) {\n @for (entry of errorMessages | keyvalue: keepOrder; track entry.key) {\n @if (controlOrGroup?.errors?.[entry.key]; as errVal) {\n <span>{{ entry.value | translate: (errVal === true ? null : errVal) }}</span>\n }\n }\n }\n </div>\n }\n\n @if (help || autoHelpEntries.length) {\n <div [id]=\"name + '-help'\" class=\"field-text\">\n @if (help) {\n <span>{{ help | translate: helpParams }}</span>\n }\n @for (entry of autoHelpEntries; track entry.key) {\n <!-- Espace explicite : les blancs entre balises sont supprim\u00E9s \u00E0 la compilation. -->\n {{ ' ' }}<span>{{ entry.key | translate: entry.params }}</span>\n }\n </div>\n }\n\n <!-- Aper\u00E7u du fichier (type=file, opt-in) : sous le champ et ses aides, comme dans la\n maquette DS. La croix native du champ n'est pas retir\u00E9e \u2014 les deux vident le m\u00EAme\n control, l'aper\u00E7u ajoute juste \u00AB Visualiser \u00BB et une cible plus grande. -->\n @if (isPreviewVisible) {\n <cw-file-preview [file]=\"previewFile\" [existingFile]=\"existingFile ?? null\"\n [disabled]=\"!!isDisabledOrReadonly\" (remove)=\"onPreviewRemove()\" />\n }\n\n <!-- Chips de la multi-s\u00E9lection (autocomplete) : rendus ici, hors du field-group et apr\u00E8s\n erreur/help, pour \u00EAtre visuellement d\u00E9tach\u00E9s du champ. La donn\u00E9e et le retrait restent\n port\u00E9s par cw-autocomplete (`chips()` / `onChipRemove()`), seul l'affichage est d\u00E9l\u00E9gu\u00E9. -->\n @if (type === typeField.autocompleteMultiple && autocompleteRef()?.chips()?.length) {\n <ul class=\"autocomplete-chips\" role=\"list\">\n @for (chip of autocompleteRef()!.chips(); track chip.item) {\n <li>\n <button type=\"button\" class=\"autocomplete-chip\"\n [disabled]=\"isEffectivelyDisabled || isReadonly\"\n (click)=\"autocompleteRef()!.onChipRemove(chip.item)\">\n <span>{{ chip.label }}</span>\n @if (!isEffectivelyDisabled && !isReadonly) {\n <span aria-hidden=\"true\" class=\"autocomplete-chip-x\">&times;</span>\n <span class=\"visually-hidden\">{{ '_COMMON._ACTION.DELETE' | translate }}</span>\n }\n </button>\n </li>\n }\n </ul>\n }\n}\n@else {\n <ng-container [ngTemplateOutlet]=\"field\"></ng-container>\n}\n\n<ng-template #field>\n <!-- Autocomplete (mono / multi) -->\n @if ((type === typeField.autocomplete || type === typeField.autocompleteMultiple) && autocompleteOptions) {\n <cw-autocomplete\n [id]=\"name\"\n [control]=\"formControl\"\n [fetcher]=\"autocompleteOptions.fetcher\"\n [displayField]=\"autocompleteOptions.displayField ?? 'label'\"\n [valueField]=\"autocompleteOptions.valueField ?? 'id'\"\n [columns]=\"autocompleteOptions.columns ?? []\"\n [resolver]=\"autocompleteOptions.resolver ?? null\"\n [selectedItem]=\"autocompleteOptions.selectedItem ?? null\"\n [selectedItems]=\"autocompleteOptions.selectedItems ?? []\"\n [minChars]=\"autocompleteOptions.minChars ?? 2\"\n [debounceMs]=\"autocompleteOptions.debounceMs ?? 250\"\n [multiple]=\"type === typeField.autocompleteMultiple\"\n [isRequired]=\"isRequired\"\n [isReadonly]=\"!!isReadonly\"\n [isDisabled]=\"isEffectivelyDisabled\"\n [ariaInvalid]=\"control.invalid && control.touched\"\n [ariaDescribedBy]=\"getDescribedBy(control)\"\n [placeholder]=\"placeholder\">\n </cw-autocomplete>\n }\n\n <!-- Rich text editor (Quill) : sous-composant interne, sans field-group ni bouton clear\n (il porte sa propre bordure + toolbar). Le label statique du form-field reste au-dessus. -->\n @if (type === typeField.richText) {\n <cw-rich-text-editor\n [id]=\"name\"\n [control]=\"formControl\"\n [options]=\"richTextOptions\"\n [placeholder]=\"placeholder ? (placeholder | translate) : ''\"\n [isRequired]=\"isRequired\"\n [isReadonly]=\"!!isReadonly\"\n [isDisabled]=\"isEffectivelyDisabled\"\n [ariaInvalid]=\"control.invalid && control.touched\"\n [ariaDescribedBy]=\"getDescribedBy(control)\">\n </cw-rich-text-editor>\n }\n\n <!-- Text -->\n @if ([typeField.text, typeField.date, typeField.time, typeField.dateTime, typeField.number,\n typeField.email,\n typeField.color, typeField.zipCode].includes(type)) {\n <input [type]=\"type === typeField.zipCode ? 'text' : type\" class=\"field-control\" [id]=\"name\" [formControl]=\"formControl\"\n [attr.title]=\"fieldTitle ? (fieldTitle | translate) : null\"\n [ngClass]=\"[(cssClass || ''), formControl?.value ? 'has-value' : '', type === typeField.zipCode ? 'field-control-zipcode' : '']\"\n [attr.placeholder]=\"placeholder ? (placeholder | translate) : null\" [attr.required]=\"isRequired ? 'required' : null\"\n [attr.readonly]=\"isReadonly ? 'readonly' : null\" [attr.aria-required]=\"isRequired\"\n [attr.minlength]=\"minLengthAttr\" [attr.maxlength]=\"maxLengthAttr\"\n [attr.min]=\"minAttr\" [attr.max]=\"maxAttr\" [attr.step]=\"stepAttr\" [attr.pattern]=\"patternAttr\"\n [attr.autocomplete]=\"autocomplete\"\n [attr.aria-invalid]=\"control.invalid && control.touched\"\n [attr.aria-describedby]=\"getDescribedBy(control)\"\n (focus)=\"onFocus()\" (blur)=\"onBlur()\" />\n }\n\n <!-- Phone (intl-tel-input) -->\n @if (type === typeField.phone) {\n <input #phoneInput type=\"tel\" class=\"field-control\" [id]=\"name\"\n [attr.placeholder]=\"placeholder ? (placeholder | translate) : null\" [attr.required]=\"isRequired ? 'required' : null\"\n [attr.readonly]=\"isReadonly ? 'readonly' : null\" [disabled]=\"isEffectivelyDisabled\" [attr.aria-required]=\"isRequired\"\n [attr.autocomplete]=\"autocomplete\"\n [attr.aria-invalid]=\"control.invalid && control.touched\"\n [attr.aria-describedby]=\"getDescribedBy(control)\"\n (focus)=\"onFocus()\" (blur)=\"onPhoneBlur($event)\" />\n }\n\n <!-- File -->\n @if (type === typeField.file) {\n <!-- L'input natif reste LE controle (focus, clavier, restitution aux lecteurs d'ecran,\n validation), mais il est masque visuellement : le libelle de son bouton et son\n \u00AB aucun fichier choisi \u00BB sont ecrits par le NAVIGATEUR, dans SA langue. Ils sont\n intraduisibles et ne suivent pas la langue de l'application \u2014 un utilisateur qui\n bascule en anglais garderait \u00AB Choisir un fichier \u00BB. On les reecrit donc a cote,\n traduits, dans une couche purement visuelle. -->\n <input #fileInput type=\"file\" class=\"field-control visually-hidden\" [id]=\"name\"\n [ngClass]=\"[(cssClass || ''), formControl?.value ? 'has-value' : '']\"\n [attr.required]=\"isRequired ? 'required' : null\"\n [attr.readonly]=\"isReadonly ? 'readonly' : null\" [disabled]=\"isEffectivelyDisabled\" [attr.aria-required]=\"isRequired\"\n [attr.accept]=\"acceptAttr\"\n [attr.aria-invalid]=\"control.invalid && control.touched\"\n [attr.aria-describedby]=\"getDescribedBy(control)\"\n (change)=\"onFileChange($event)\" (focus)=\"onFocus()\" (blur)=\"onBlur()\" />\n\n <!-- `aria-hidden` : doublon visuel de l'input, que les lecteurs d'ecran restituent deja\n (nom du champ, bouton de parcours, fichier selectionne). L'annoncer une seconde fois\n ne ferait que bavarder. Le clic est relaye a l'input, le clavier passe par lui. -->\n <span class=\"field-file\" aria-hidden=\"true\" (click)=\"openFilePicker()\">\n <span class=\"field-file-button\">{{ '_COMMON._FORM.CHOOSE_FILE' | translate }}</span>\n <span class=\"field-file-name\" [class.field-file-name-empty]=\"!selectedFileName\">\n {{ selectedFileName ?? ('_COMMON._FORM.NO_FILE_SELECTED' | translate) }}\n </span>\n </span>\n }\n\n @if (type === typeField.password) {\n <input [type]=\"isPasswordShown ? 'text' : 'password'\" class=\"field-control\" [id]=\"name\" [formControl]=\"formControl\"\n [ngClass]=\"[(cssClass || ''), formControl?.value ? 'has-value' : '']\"\n [attr.required]=\"isRequired ? 'required' : null\" [attr.readonly]=\"isReadonly ? 'readonly' : null\"\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\" [attr.aria-required]=\"isRequired\"\n [attr.minlength]=\"minLengthAttr\" [attr.maxlength]=\"maxLengthAttr\" [attr.pattern]=\"patternAttr\"\n [attr.autocomplete]=\"autocomplete\"\n [attr.aria-invalid]=\"control.invalid && control.touched\"\n [attr.aria-describedby]=\"getDescribedBy(control)\"\n (focus)=\"onFocus()\" (blur)=\"onBlur()\" />\n <cw-button [type]=\"buttonType.ghost\"\n cssClass=\"btn-password-field\"\n [withIcon]=\"isPasswordShown ? spriteIcon.toolbarHidePassword : spriteIcon.toolbarShowPassword\"\n [withOnlyIcon]=\"true\"\n [label]=\"isPasswordShown ? '_COMMON._FORM._SHOW_HIDE_PWD.HIDE' : '_COMMON._FORM._SHOW_HIDE_PWD.SHOW'\"\n (btnAction)=\"togglePasswordVisibility()\">\n </cw-button>\n }\n\n <!-- Textarea -->\n @if (type === typeField.textarea) {\n <textarea class=\"field-control\" [id]=\"name\" [formControl]=\"formControl\"\n [ngClass]=\"[(cssClass || ''), formControl?.value ? 'has-value' : '']\"\n [attr.placeholder]=\"placeholder ? (placeholder | translate) : null\" [attr.required]=\"isRequired ? 'required' : null\"\n [attr.readonly]=\"isReadonly ? 'readonly' : null\" [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\"\n [attr.aria-required]=\"isRequired\" [attr.aria-invalid]=\"control.invalid && control.touched\"\n [attr.minlength]=\"minLengthAttr\" [attr.maxlength]=\"maxLengthAttr\" [attr.pattern]=\"patternAttr\"\n [attr.autocomplete]=\"autocomplete\"\n [attr.aria-describedby]=\"getDescribedBy(control)\"\n (focus)=\"onFocus()\" (blur)=\"onBlur()\"></textarea>\n }\n\n <!-- Select -->\n @if (type === typeField.select) {\n <ng-select [formControl]=\"formControl\" [items]=\"options\" bindLabel=\"label\" [labelForId]=\"name\" [appendTo]=\"appendTo ?? ''\" bindValue=\"value\"\n [ngClass]=\"cssClass\" [searchable]=\"false\" [placeholder]=\"placeholder ? (placeholder | translate) : ''\" [readonly]=\"isReadonly\" [clearable]=\"false\"\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\" [attr.required]=\"isRequired ? 'required' : null\"\n [attr.aria-required]=\"isRequired\" [attr.aria-invalid]=\"control.invalid && control.touched\"\n [attr.aria-describedby]=\"getDescribedBy(control)\" [attr.id]=\"name\"\n (focus)=\"onFocus()\" (blur)=\"onBlur()\" (open)=\"onDropdownOpen()\" (close)=\"onDropdownClose()\">\n\n <!-- Template pour les options -->\n <ng-template ng-option-tmp let-item=\"item\" let-index=\"index\" let-search=\"searchTerm\">\n @if (optionTemplate) {\n <ng-container *ngTemplateOutlet=\"optionTemplate; context: { item: item | translate, index: index, searchTerm: search }\"></ng-container>\n }\n @else {\n <div>{{ item.label | translate }}</div>\n }\n </ng-template>\n\n <!-- Template pour le label -->\n <ng-template ng-label-tmp let-item=\"item\">\n @if (labelTemplate) {\n <ng-container *ngTemplateOutlet=\"labelTemplate; context: { item: item | translate }\"></ng-container>\n }\n @else {\n {{ (item.label | translate) || (placeholder | translate) }}\n }\n </ng-template>\n </ng-select>\n }\n\n <!-- NgSelect -->\n @if (type === typeField.ngSelect || type === typeField.ngSelectMultiple) {\n <ng-select [formControl]=\"formControl\" [items]=\"options\" bindLabel=\"label\" [labelForId]=\"name\" [appendTo]=\"appendTo ?? ''\" bindValue=\"value\"\n [multiple]=\"type === typeField.ngSelectMultiple\" [ngClass]=\"cssClass\" [clearable]=\"false\"\n [placeholder]=\"placeholder ? (placeholder | translate) : ''\" [readonly]=\"isReadonly\"\n [notFoundText]=\"'_COMMON.NO_RESULT' | translate\" [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\"\n [attr.required]=\"isRequired ? 'required' : null\" [attr.aria-required]=\"isRequired\"\n [attr.aria-invalid]=\"control.invalid && control.touched\"\n [attr.aria-describedby]=\"getDescribedBy(control)\" [attr.id]=\"name\"\n (focus)=\"onFocus()\" (blur)=\"onBlur()\" (search)=\"textChanged.emit($event?.term)\"\n (open)=\"onDropdownOpen()\" (close)=\"onDropdownClose()\">\n\n <!-- Template pour les options -->\n <ng-template ng-option-tmp let-item=\"item\" let-index=\"index\" let-search=\"searchTerm\">\n @if (optionTemplate) {\n <ng-container *ngTemplateOutlet=\"optionTemplate; context: { item: item, index: index, searchTerm: search }\"></ng-container>\n }\n @else {\n <div>{{ item.label | translate }}</div>\n }\n </ng-template>\n\n <!-- Template pour le label -->\n <ng-template ng-label-tmp let-item=\"item\" let-clear=\"clear\">\n <span class=\"ng-value-icon left\" (click)=\"clear(item)\" aria-hidden=\"true\">\u00D7</span>\n @if (labelTemplate) {\n <ng-container *ngTemplateOutlet=\"labelTemplate; context: { item: item | translate }\"></ng-container>\n }\n @else {\n {{ (item.label | translate) || (placeholder | translate) }}\n }\n </ng-template>\n </ng-select>\n }\n\n <!-- Radio -->\n @if (type === typeField.radioInline || type === typeField.radio) {\n <fieldset [attr.aria-labelledby]=\"hasFieldTooltip ? legendId : null\"\n [attr.aria-required]=\"isRequired\"\n [attr.aria-invalid]=\"control.invalid && control.touched\"\n [attr.aria-describedby]=\"getDescribedBy(control)\">\n <legend class=\"field-label\" [class.visually-hidden]=\"!displayLabel\" [class.d-flex-h]=\"hasFieldTooltip\" [class.gap-2xs]=\"hasFieldTooltip\">\n <span [id]=\"legendId\">\n {{label | translate}}\n @if(isRequired) {\n <span class=\"text-danger\">*</span>\n }\n </span>\n @if (hasFieldTooltip) {\n <ng-container *ngTemplateOutlet=\"fieldTooltip\"></ng-container>\n }\n </legend>\n <ul class=\"list-unstyled mb-none\" [ngClass]=\"type === typeField.radioInline ? 'd-flex-h gap-md flex-wrap' : 'd-flex-v gap-sm'\">\n @for (opt of options; track opt.value) {\n <li class=\"field-check\">\n <input type=\"radio\" [id]=\"name + '_' + opt.value\" [attr.name]=\"name\" [value]=\"opt.value\" [formControl]=\"formControl\"\n class=\"field-check-input\" [attr.disabled]=\"(isEffectivelyDisabled || opt.disabled) ? 'disabled' : null\" (change)=\"onRadioChange(opt.value)\" />\n <label [for]=\"name + '_' + opt.value\" class=\"field-check-label\">{{ opt.label | translate }}</label>\n </li>\n }\n </ul>\n </fieldset>\n }\n\n <!-- Radio button -->\n @if (type === typeField.radioButton) {\n <fieldset [attr.aria-labelledby]=\"hasFieldTooltip ? legendId : null\"\n [attr.aria-required]=\"isRequired\"\n [attr.aria-invalid]=\"control.invalid && control.touched\"\n [attr.aria-describedby]=\"getDescribedBy(control)\">\n <legend class=\"field-label\" [class.visually-hidden]=\"!displayLabel\" [class.d-flex-h]=\"hasFieldTooltip\" [class.gap-2xs]=\"hasFieldTooltip\">\n <span [id]=\"legendId\">\n {{label | translate}}\n @if(isRequired) {\n <span class=\"text-danger\">*</span>\n }\n </span>\n @if (hasFieldTooltip) {\n <ng-container *ngTemplateOutlet=\"fieldTooltip\"></ng-container>\n }\n </legend>\n <div class=\"field-group field-group-btn\">\n @for (opt of options; track opt.value) {\n <input type=\"radio\" [id]=\"name + '_' + opt.value\" [attr.name]=\"name\" [value]=\"opt.value\" [formControl]=\"formControl\"\n class=\"visually-hidden\" [attr.disabled]=\"(isEffectivelyDisabled || opt.disabled) ? 'disabled' : null\" (change)=\"onRadioChange(opt.value)\"/>\n <label [for]=\"name + '_' + opt.value\" class=\"btn btn-field-group\">{{ opt.label | translate }}</label>\n }\n </div>\n </fieldset>\n }\n\n <!-- Cartes : checkbox / radio / switch (contr\u00F4le \u00E0 gauche, titre, description facultative) -->\n @if (isChoiceCard) {\n <fieldset [attr.aria-labelledby]=\"hasFieldTooltip ? legendId : null\"\n [attr.aria-required]=\"isRequired\"\n [attr.aria-invalid]=\"control.invalid && control.touched\"\n [attr.aria-describedby]=\"getDescribedBy(control)\">\n <legend class=\"field-label\" [class.visually-hidden]=\"!displayLabel\" [class.d-flex-h]=\"hasFieldTooltip\" [class.gap-2xs]=\"hasFieldTooltip\">\n <span [id]=\"legendId\">\n {{label | translate}}\n @if(isRequired) {\n <span class=\"text-danger\">*</span>\n }\n </span>\n @if (hasFieldTooltip) {\n <ng-container *ngTemplateOutlet=\"fieldTooltip\"></ng-container>\n }\n </legend>\n <ul class=\"field-card-list list-unstyled mb-none\" [class.field-card-list-compact]=\"isChoiceCardCompact\">\n @for (opt of options; track opt.value) {\n <li class=\"d-flex-v\">\n <!-- Le label englobe toute la carte : un clic n'importe o\u00F9 coche l'option. -->\n <label class=\"field-card d-flex-h items-start gap-xs flex-1\" [for]=\"name + '_' + opt.value\" [class.field-switch]=\"isSwitchCard\" [class.field-switch-small]=\"isSwitchCard\">\n @if (isRadioCard) {\n <input type=\"radio\" [id]=\"name + '_' + opt.value\" [attr.name]=\"name\" [value]=\"opt.value\" [formControl]=\"formControl\"\n class=\"field-check-input\"\n [attr.aria-describedby]=\"(!isChoiceCardCompact && opt.description) ? name + '_' + opt.value + '-desc' : null\"\n [attr.disabled]=\"(isEffectivelyDisabled || opt.disabled) ? 'disabled' : null\" (change)=\"onRadioChange(opt.value)\" />\n } @else {\n <input type=\"checkbox\" [id]=\"name + '_' + opt.value\" [value]=\"opt.value\" (change)=\"onCheckboxChange($event)\"\n [checked]=\"control.value?.includes(opt.value)\" class=\"field-check-input\"\n [attr.role]=\"isSwitchCard ? 'switch' : null\"\n [attr.aria-describedby]=\"(!isChoiceCardCompact && opt.description) ? name + '_' + opt.value + '-desc' : null\"\n [attr.disabled]=\"(isEffectivelyDisabled || opt.disabled) ? 'disabled' : null\" />\n }\n <span class=\"d-flex-v gap-5xs\">\n <span class=\"field-card-title\">{{ opt.label | translate }}</span>\n @if (!isChoiceCardCompact && opt.description) {\n <span class=\"field-text\" [id]=\"name + '_' + opt.value + '-desc'\">{{ opt.description | translate }}</span>\n }\n </span>\n </label>\n </li>\n }\n </ul>\n </fieldset>\n }\n\n <!-- Checkbox Switch -->\n @if ( type === typeField.switch || type === typeField.switchSmall)\n {\n <div class=\"field-check field-switch\" [ngClass]=\"{'field-switch-small': type === typeField.switchSmall}\">\n <input type=\"checkbox\" [id]=\"name\" [formControl]=\"formControl\" class=\"field-check-input\" [attr.aria-required]=\"isRequired\"\n [attr.aria-invalid]=\"control.invalid && control.touched\"\n [attr.aria-describedby]=\"getDescribedBy(control)\"\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\"/>\n <label [for]=\"name\" class=\"field-check-label\">{{ label | translate }}</label>\n </div>\n }\n\n <!-- Checkbox -->\n @if (type === typeField.checkboxInline || type === typeField.checkbox) {\n @if (isSingleCheckbox()) {\n <div class=\"field-check\" [class.field-check-inline]=\"type === typeField.checkboxInline\">\n <input #checkboxInput type=\"checkbox\" [id]=\"name\" [formControl]=\"formControl\"\n class=\"field-check-input\"\n [class.is-invalid]=\"control?.invalid && control?.touched\"\n [attr.aria-required]=\"isRequired\"\n [attr.aria-invalid]=\"control?.invalid && control?.touched\"\n [attr.aria-describedby]=\"getDescribedBy(control)\"\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\" />\n <label [for]=\"name\" class=\"field-check-label\">\n {{ label | translate }}\n @if (isRequired) {\n <span class=\"text-danger\">*</span>\n }\n </label>\n </div>\n }\n @else if( options.length > 1) {\n <fieldset [attr.aria-labelledby]=\"hasFieldTooltip ? legendId : null\"\n [attr.aria-required]=\"isRequired\"\n [attr.aria-invalid]=\"control.invalid && control.touched\"\n [attr.aria-describedby]=\"getDescribedBy(control)\"\n [ngClass]=\"{ 'flex-column': type === typeField.checkbox }\">\n <legend class=\"field-label\" [class.visually-hidden]=\"!displayLabel\" [class.d-flex-h]=\"hasFieldTooltip\" [class.gap-2xs]=\"hasFieldTooltip\">\n <span [id]=\"legendId\">\n {{label | translate}}\n @if(isRequired) {\n <span class=\"text-danger\">*</span>\n }\n </span>\n @if (hasFieldTooltip) {\n <ng-container *ngTemplateOutlet=\"fieldTooltip\"></ng-container>\n }\n </legend>\n <ul class=\"list-unstyled mb-none\" [ngClass]=\"type === typeField.checkboxInline ? 'd-flex-h gap-md' : 'd-flex-v gap-sm'\">\n @for (opt of options; track opt.value) {\n <li class=\"field-check\" [ngClass]=\"{ 'field-check-inline': type === typeField.checkboxInline }\">\n <input type=\"checkbox\" [id]=\"name + '_' + opt.value\" [value]=\"opt.value\" (change)=\"onCheckboxChange($event)\"\n [checked]=\"control.value?.includes(opt.value)\" class=\"field-check-input\"\n [attr.disabled]=\"(isEffectivelyDisabled || opt.disabled) ? 'disabled' : null\" />\n <label [for]=\"name + '_' + opt.value\" class=\"field-check-label\">\n {{ opt.label | translate }}\n </label>\n </li>\n }\n </ul>\n </fieldset>\n }\n @else {\n <fieldset [attr.aria-labelledby]=\"hasFieldTooltip ? legendId : null\">\n <legend class=\"field-label\" [class.visually-hidden]=\"!displayLabel\" [class.d-flex-h]=\"hasFieldTooltip\" [class.gap-2xs]=\"hasFieldTooltip\">\n <span [id]=\"legendId\">\n {{label | translate}}\n </span>\n @if (hasFieldTooltip) {\n <ng-container *ngTemplateOutlet=\"fieldTooltip\"></ng-container>\n }\n </legend>\n <ul class=\"list-unstyled mb-none\" [ngClass]=\"type === typeField.checkboxInline ? 'd-flex-h gap-md' : 'd-flex-v gap-sm'\">\n @for (opt of options; track opt.value) {\n <li class=\"field-check\" [ngClass]=\"{ 'field-check-inline': type === typeField.checkboxInline }\">\n <input type=\"checkbox\" [id]=\"name + '_' + opt.value\" [value]=\"opt.value\" (change)=\"onCheckboxChange($event)\"\n [checked]=\"control.value?.includes(opt.value)\" class=\"field-check-input\"\n [attr.aria-required]=\"isRequired\"\n [attr.aria-invalid]=\"control.invalid && control.touched\"\n [attr.aria-describedby]=\"getDescribedBy(control)\"\n [attr.disabled]=\"(isEffectivelyDisabled || opt.disabled) ? 'disabled' : null\" />\n <label [for]=\"name + '_' + opt.value\" class=\"field-check-label\">\n {{ opt.label | translate }}\n @if(isRequired) {\n <span class=\"text-danger\">*</span>\n }\n </label>\n </li>\n }\n </ul>\n </fieldset>\n }\n }\n\n <!-- Checkbox button -->\n @if (type === typeField.checkboxButton && options.length > 0) {\n\n @if(options.length > 1) {\n <fieldset [attr.aria-labelledby]=\"hasFieldTooltip ? legendId : null\"\n [attr.aria-required]=\"isRequired\"\n [attr.aria-invalid]=\"control.invalid && control.touched\"\n [attr.aria-describedby]=\"getDescribedBy(control)\">\n <legend class=\"field-label\" [class.visually-hidden]=\"!displayLabel\" [class.d-flex-h]=\"hasFieldTooltip\" [class.gap-2xs]=\"hasFieldTooltip\">\n <span [id]=\"legendId\">\n {{label | translate}}\n @if(isRequired) {\n <span class=\"text-danger\">*</span>\n }\n </span>\n @if (hasFieldTooltip) {\n <ng-container *ngTemplateOutlet=\"fieldTooltip\"></ng-container>\n }\n </legend>\n <div class=\"field-group field-group-btn\">\n @for (opt of options; track opt.value) {\n <input type=\"checkbox\" [id]=\"name + '_' + opt.value\" [value]=\"opt.value\" (change)=\"onCheckboxChange($event)\"\n [checked]=\"control.value?.includes(opt.value)\" class=\"visually-hidden\"\n [attr.disabled]=\"(isEffectivelyDisabled || opt.disabled) ? 'disabled' : null\" />\n <label [for]=\"name + '_' + opt.value\" class=\"btn btn-field-group\">{{ opt.label | translate }}</label>\n }\n </div>\n </fieldset>\n }\n @else {\n <fieldset [attr.aria-labelledby]=\"hasFieldTooltip ? legendId : null\">\n <legend class=\"field-label\" [class.visually-hidden]=\"!displayLabel\" [class.d-flex-h]=\"hasFieldTooltip\" [class.gap-2xs]=\"hasFieldTooltip\">\n <span [id]=\"legendId\">\n {{label | translate}}\n </span>\n @if (hasFieldTooltip) {\n <ng-container *ngTemplateOutlet=\"fieldTooltip\"></ng-container>\n }\n </legend>\n <div class=\"btn-group btn-group-secondary\">\n @for (opt of options; track opt.value) {\n <input type=\"checkbox\" [id]=\"name + '_' + opt.value\" [value]=\"opt.value\" (change)=\"onCheckboxChange($event)\"\n [checked]=\"control.value?.includes(opt.value)\" class=\"visually-hidden\"\n [attr.aria-required]=\"isRequired\"\n [attr.aria-invalid]=\"control.invalid && control.touched\"\n [attr.aria-describedby]=\"getDescribedBy(control)\"\n [attr.disabled]=\"(isEffectivelyDisabled || opt.disabled) ? 'disabled' : null\"/>\n <label [for]=\"name + '_' + opt.value\" class=\"btn btn-field-group\">\n {{ opt.label | translate}}\n @if(isRequired) {\n <span class=\"text-danger\">*</span>\n }\n </label>\n }\n </div>\n </fieldset>\n }\n }\n\n <!-- Period - DateToDate / TimeToTime / DateTimeToDateTime -->\n @if (isPeriod) {\n <!-- Fieldset : le legend nomme la p\u00E9riode, \u00AB Du \u00BB / \u00AB au \u00BB sont les labels de chaque input. -->\n <fieldset [attr.aria-labelledby]=\"hasFieldTooltip ? legendId : null\">\n <legend class=\"field-label\" [class.visually-hidden]=\"!displayLabel\" [class.d-flex-h]=\"hasFieldTooltip\" [class.gap-2xs]=\"hasFieldTooltip\">\n <span [id]=\"legendId\">\n {{label | translate}}\n <!-- Deux bornes obligatoires : ast\u00E9risque sur la p\u00E9riode ; une seule : sur sa borne. -->\n @if(isStartRequired && isEndRequired) {\n <span class=\"text-danger\">*</span>\n }\n </span>\n @if (hasFieldTooltip) {\n <ng-container *ngTemplateOutlet=\"fieldTooltip\"></ng-container>\n }\n </legend>\n <div class=\"field-group\">\n <label class=\"field-group-addon-left\" [for]=\"name + '_start'\">\n {{ '_COMMON._DATES.FROM_TO_1' | translate }}\n @if(isStartRequired && !isEndRequired) {\n <span class=\"text-danger\">*</span>\n }\n </label>\n <input [type]=\"getInputType()\" class=\"field-control\" [id]=\"name + '_start'\" [formControl]=\"getControl('start')!\"\n [attr.title]=\"fieldTitle ? (fieldTitle | translate) + ' \u2013 ' + ('_COMMON._DATES.FROM_TO_1' | translate) : null\"\n [attr.placeholder]=\"type === typeField.timeToTime ? ('_COMMON._DATES.FROM' | translate) : ('_COMMON._DATES.FROM_TO_1' | translate)\"\n [ngClass]=\"[(cssClass || ''), getControl('start')?.value ? 'has-value' : '']\"\n [attr.required]=\"isStartRequired ? 'required' : null\" [attr.readonly]=\"isReadonly ? 'readonly' : null\"\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\" [attr.aria-required]=\"isStartRequired\"\n [attr.min]=\"minStartAttr\" [attr.max]=\"maxStartAttr\" [attr.step]=\"stepAttr\"\n [attr.autocomplete]=\"autocomplete\"\n [attr.aria-invalid]=\"getControl('start')?.invalid && getControl('start')?.touched\"\n [attr.aria-describedby]=\"getDescribedBy(getControl('start'))\"\n (focus)=\"onFocusRange('start')\" (blur)=\"onBlurRange('start')\" />\n\n @if(getControl('start')?.value && !isDisabledOrReadonly) {\n <button type=\"button\" class=\"btn btn-secondary btn-clear-field\"\n [attr.aria-label]=\"'_COMMON._FORM.CLEAR_START' | translate: { label: label | translate }\"\n (click)=\"onClearFieldPeriod('start')\">\n <span aria-hidden=\"true\">&times;</span>\n </button>\n }\n <label class=\"field-group-addon-center\" [for]=\"name + '_end'\">\n {{ '_COMMON._DATES.FROM_TO_2' | translate }}\n @if(isEndRequired && !isStartRequired) {\n <span class=\"text-danger\">*</span>\n }\n </label>\n <input [type]=\"getInputType()\" class=\"field-control\" [id]=\"name + '_end'\" [formControl]=\"getControl('end')!\"\n [attr.title]=\"fieldTitle ? (fieldTitle | translate) + ' \u2013 ' + ('_COMMON._DATES.FROM_TO_2' | translate) : null\"\n [attr.placeholder]=\"type === typeField.timeToTime ? ('_COMMON._DATES.TO' | translate) : ('_COMMON._DATES.FROM_TO_2' | translate)\"\n [ngClass]=\"[(cssClass || ''), getControl('end')?.value ? 'has-value' : '']\"\n [attr.required]=\"isEndRequired ? 'required' : null\" [attr.readonly]=\"isReadonly ? 'readonly' : null\"\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\" [attr.aria-required]=\"isEndRequired\"\n [attr.min]=\"minEndAttr\" [attr.max]=\"maxEndAttr\" [attr.step]=\"stepAttr\"\n [attr.autocomplete]=\"autocomplete\"\n [attr.aria-invalid]=\"getControl('end')?.invalid && getControl('end')?.touched\"\n [attr.aria-describedby]=\"getDescribedBy(getControl('end'))\"\n (focus)=\"onFocusRange('end')\" (blur)=\"onBlurRange('end')\" />\n\n @if(getControl('end')?.value && !isDisabledOrReadonly) {\n <button type=\"button\" class=\"btn btn-ghost btn-clear-field\"\n [attr.aria-label]=\"'_COMMON._FORM.CLEAR_END' | translate: { label: label | translate }\"\n (click)=\"onClearFieldPeriod('end')\">\n <span aria-hidden=\"true\">&times;</span>\n </button>\n }\n </div>\n </fieldset>\n }\n\n @if ([typeField.datePlusOne, typeField.datePlusTwo, typeField.datePlusSeven, typeField.dateComplexe].includes(type)) {\n\n <div class=\"field-group\">\n @if (type === typeField.dateComplexe) {\n <div class=\"field-group-addon-left\">\n <button class=\"btn btn-ghost\" type=\"button\" (click)=\"onDateAddDay('prev')\"\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\">\n <cw-icon font=\"optyweb\" [icon]=\"spriteIcon.nextLeft\" [label]=\"'Jour pr\u00E9c\u00E9dent'\"></cw-icon>\n </button>\n </div>\n }\n\n <input type=\"date\" class=\"field-control\" [id]=\"name\" [formControl]=\"formControl\"\n [attr.title]=\"fieldTitle ? (fieldTitle | translate) : null\"\n [ngClass]=\"[(cssClass || ''), formControl?.value ? 'has-value' : '']\"\n [attr.placeholder]=\"placeholder ? (placeholder | translate) : null\" [attr.required]=\"isRequired ? 'required' : null\"\n [attr.readonly]=\"isReadonly ? 'readonly' : null\" [attr.aria-required]=\"isRequired\"\n [attr.min]=\"minAttr\" [attr.max]=\"maxAttr\" [attr.step]=\"stepAttr\"\n [attr.autocomplete]=\"autocomplete\"\n [attr.aria-invalid]=\"control.invalid && control.touched\"\n [attr.aria-describedby]=\"getDescribedBy(control)\"\n (focus)=\"onFocus()\" (blur)=\"onBlur()\" />\n\n @if(formControl?.value && !isDisabledOrReadonly) {\n <button class=\"btn btn-ghost btn-clear-field\" type=\"button\"\n [attr.aria-label]=\"'_COMMON._FORM.CLEAR_FIELD' | translate: { label: label | translate }\"\n (click)=\"onClearField(formControl)\"><span aria-hidden=\"true\">&times;</span></button>\n }\n\n\n @if (type === typeField.dateComplexe) {\n <div class=\"field-group-addon-right\">\n <button class=\"btn btn-ghost\" type=\"button\" (click)=\"onDateAddDay('next')\"\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\">\n <cw-icon font=\"optyweb\" [icon]=\"spriteIcon.nextRight\" [label]=\"'Jour suivant'\"></cw-icon>\n </button>\n </div>\n <div class=\"field-group-addon-right\">\n <button class=\"btn btn-ghost\" type=\"button\" (click)=\"onRefresh()\"\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\">\n <cw-icon font=\"optyweb\" [icon]=\"spriteIcon.toolbarRefresh\" [label]=\"'Rafra\u00EEchir'\"></cw-icon>\n </button>\n </div>\n }\n\n <div class=\"field-group-addon-right\">\n <button class=\"btn btn-ghost\" type=\"button\" (click)=\"onTodayAddDay(0)\"\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\">\n J\n <span class=\"visually-hidden\">Aujourd'hui</span>\n </button>\n </div>\n <div class=\"field-group-addon-right\">\n <button class=\"btn btn-ghost\" type=\"button\" (click)=\"onTodayAddDay(1)\"\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\">\n J+1\n <span class=\"visually-hidden\">Demain</span>\n </button>\n </div>\n\n @if (type !== typeField.datePlusOne && type !== typeField.dateComplexe) {\n <div class=\"field-group-addon-right\">\n <button class=\"btn btn-ghost \" type=\"button\" (click)=\"onTodayAddDay(2)\"\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\">\n J+2\n <span class=\"visually-hidden\">Dans 2 jours</span>\n </button>\n </div>\n\n @if (type !== typeField.datePlusTwo) {\n <div class=\"field-group-addon-right\">\n <button class=\"btn btn-ghost\" type=\"button\" (click)=\"onTodayAddDay(7)\"\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\">\n J+7\n <span class=\"visually-hidden\">Dans 7 jours</span>\n </button>\n </div>\n }\n }\n </div>\n }\n\n @if (type === typeField.slider) {\n <ngx-slider [(value)]=\"sliderValue\" [options]=\"sliderOptions\" [formControl]=\"formControl\"></ngx-slider>\n }\n\n @if (type === typeField.range) {\n <div class=\"slider\">\n\n <cw-button [isDisabled]=\"formControl.value <= rangeOptions.floor\" [label]=\"'Diminuer ' + formControl.value + ' ' + label\"\n [withIcon]=\"spriteIcon.toolbarMinus\" [withOnlyIcon]=\"true\" [type]=\"buttonType.primary\"\n [iconSize]=\"buttonIconSize.small\" (btnAction)=\"onRangeStep('decrease')\">\n </cw-button>\n\n <div class=\"slider-input\">\n <label [for]=\"name\" class=\"slider-tooltip\" [style.left]=\"getRangePercent() + '%'\" aria-live=\"polite\"\n aria-atomic=\"true\">\n {{ label | translate }} {{ formControl.value }}\n @if (rangeOptions.unit) {\n <abbr [title]=\"rangeOptions.unit\">{{ rangeOptions.unit }}</abbr>\n }\n </label>\n\n <div class=\"slider-custom-bar\">\n <div class=\"slider-custom-bar-selection\" [style.width]=\"getRangePercent() + '%'\">\n </div>\n </div>\n\n <input type=\"range\" [id]=\"name\" [formControl]=\"formControl\" [min]=\"rangeOptions.floor\" [max]=\"rangeOptions.ceil\"\n [step]=\"rangeOptions.step || 1\" class=\"field-control-range\" [attr.aria-required]=\"isRequired\"\n [attr.aria-invalid]=\"control.invalid && control.touched\">\n </div>\n\n <cw-button [isDisabled]=\"formControl.value >= rangeOptions.ceil\" [label]=\"'Augmenter ' + formControl.value + ' ' + label\"\n [withIcon]=\"spriteIcon.toolbarPlus\" [withOnlyIcon]=\"true\" [type]=\"buttonType.primary\"\n [iconSize]=\"buttonIconSize.small\" (btnAction)=\"onRangeStep('increase')\">\n </cw-button>\n </div>\n }\n\n @if (isInInputGroup() && clearable && !isDisabledOrReadonly && type !== typeField.autocompleteMultiple) {\n @if (type === typeField.autocomplete) {\n @if (autocompleteRef()?.hasAnyContent()) {\n <button class=\"btn btn-secondary btn-clear-field\" type=\"button\"\n [attr.aria-label]=\"'_COMMON._FORM.CLEAR_FIELD' | translate: { label: label | translate }\"\n (click)=\"onClearAutocomplete()\"><span aria-hidden=\"true\">&times;</span></button>\n }\n } @else if (type === typeField.ngSelectMultiple) {\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. -->\n @if (formControl?.value?.length) {\n <button class=\"btn btn-ghost btn-clear-field\" type=\"button\"\n [attr.aria-label]=\"'_COMMON._FORM.CLEAR_FIELD' | translate: { label: label | translate }\"\n (click)=\"onClearField(formControl)\"><span aria-hidden=\"true\">&times;</span></button>\n }\n } @else {\n @if(formControl?.value) {\n <button class=\"btn btn-ghost btn-clear-field\" type=\"button\"\n [attr.aria-label]=\"'_COMMON._FORM.CLEAR_FIELD' | translate: { label: label | translate }\"\n (click)=\"onClearField(formControl)\"><span aria-hidden=\"true\">&times;</span></button>\n }\n }\n }\n\n</ng-template>\n\n<ng-template #fieldLabel>\n <label [for]=\"name\" class=\"field-label\" [class.visually-hidden]=\"!displayLabel\">\n {{ label | translate }}\n\n @if (isRequired) {\n <span class=\"text-danger\">*</span>\n }\n </label>\n</ng-template>\n\n<!-- Bouton d'aide (tooltip) partage label/legend. Hors du <label> (sinon son libelle\n s'ajoute au nom du champ et le clic active le label) ; dans un <legend>, le fieldset\n est nomme par aria-labelledby sur le seul texte (legendId) pour la meme raison. -->\n<ng-template #fieldTooltip>\n <button type=\"button\" class=\"btn btn-ghost btn-field-tooltip\"\n [cwTooltip]=\"tooltip ?? ''\"\n [attr.data-test-ctw]=\"'tooltip-' + name\">\n <cw-icon [icon]=\"spriteIcon.alertHelp\" [type]=\"iconType.circular\" [iconUiType]=\"iconUiType.info\"\n [iconSize]=\"iconSize.xs\" [label]=\"'_COMMON._FORM.TOOLTIP_HELP' | translate\"></cw-icon>\n </button>\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: "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", "text", "label", "type", "iconSize", "iconCssClass", "iconUiType", "iconColorCustom", "spritePath"] }, { kind: "component", type: ButtonComponent, selector: "cw-button", inputs: ["type", "label", "labelParams", "id", "link", "isDropdown", "hideCaret", "withIcon", "withOnlyIcon", "iconSize", "iconPosition", "dropdownPosition", "isMinWidth", "isDisabled", "isLoading", "loadingAnnounce", "cssClass", "dataTest", "skeletonMode", "isPressed", "ariaDescribedBy", "ariaLabel", "ariaExpanded", "ariaControls", "withTooltip", "tooltipText", "tooltipTitle", "tooltipTrigger", "tooltipPosition", "tooltipType"], outputs: ["btnAction", "dropDownClicked"] }, { kind: "directive", type: CwTooltipDirective, selector: "[cwTooltip]", inputs: ["cwTooltip", "cwTooltipTitle", "cwTooltipType", "cwTooltipTrigger", "cwTooltipPosition", "cwTooltipDisabled"] }, { 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: "component", type: FilePreviewComponent, selector: "cw-file-preview", inputs: ["file", "existingFile", "showActions", "disabled", "dataTest"], outputs: ["remove"] }, { kind: "pipe", type: i1.KeyValuePipe, name: "keyvalue" }, { kind: "pipe", type: i2.TranslatePipe, name: "translate" }] }); }
4392
4459
  }
4393
4460
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: FormFieldComponent, decorators: [{
4394
4461
  type: Component,
@@ -4405,7 +4472,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.20", ngImpo
4405
4472
  AutocompleteComponent,
4406
4473
  RichTextEditorComponent,
4407
4474
  FilePreviewComponent
4408
- ], template: "@if (!isInAddon) {\n @if (\n type !== typeField.checkbox &&\n type !== typeField.radio &&\n type !== typeField.checkboxButton &&\n type !== typeField.radioButton &&\n type !== typeField.checkboxInline &&\n type !== typeField.radioInline &&\n type !== typeField.switch &&\n type !== typeField.range &&\n type !== typeField.switchSmall &&\n !isChoiceCard &&\n !isPeriod\n ) {\n <!-- Bouton d'aide HORS du <label> (bouton dans un label = HTML invalide, son libelle\n polluerait le nom accessible du champ et un clic activerait le label) : on aligne\n label + bouton dans un conteneur flex, seulement quand il y a une aide. -->\n @if (hasFieldTooltip) {\n <div class=\"d-flex-h gap-2xs\">\n <ng-container *ngTemplateOutlet=\"fieldLabel\"></ng-container>\n <ng-container *ngTemplateOutlet=\"fieldTooltip\"></ng-container>\n </div>\n } @else {\n <ng-container *ngTemplateOutlet=\"fieldLabel\"></ng-container>\n }\n }\n\n @if (addonLeft || addonRight) {\n <div class=\"field-group\" [class.field-group-invalid]=\"isInvalid\" [class.field-group-disabled]=\"isDisabledOrReadonly\">\n @if(addonLeft) {\n <div class=\"field-group-addon-left\">\n <ng-container [ngTemplateOutlet]=\"addonLeft\"></ng-container>\n </div>\n }\n <ng-container [ngTemplateOutlet]=\"field\"></ng-container>\n @if(addonRight) {\n <div class=\"field-group-addon-right\">\n <ng-container [ngTemplateOutlet]=\"addonRight\"></ng-container>\n </div>\n }\n </div>\n }\n @else {\n @if ( isInInputGroup() ) {\n <div class=\"field-group\" [class.field-group-invalid]=\"isInvalid\" [class.field-group-disabled]=\"isDisabledOrReadonly\">\n <ng-container [ngTemplateOutlet]=\"field\"></ng-container>\n </div>\n }\n @else {\n <ng-container [ngTemplateOutlet]=\"field\"></ng-container>\n }\n }\n\n <!-- Error message -->\n @if (controlOrGroup?.invalid && controlOrGroup?.touched) {\n <div class=\"field-invalid\" [id]=\"'error-' + name\">\n @if (\n !errorMessages?.['required'] &&\n ((controlOrGroup?.errors?.['required']) || (getControl('start')?.errors?.['required'] || getControl('end')?.errors?.['required']))\n ) {\n <span [innerHtml]=\"'_COMMON._FORM.ERROR_IS_MANDATORY' | translate: {label: label | translate}\"></span>\n }\n @if (!errorMessages?.['rangeInvalid'] && controlOrGroup?.errors?.['rangeInvalid']) {\n <span>{{'_COMMON._DATES.ERROR_START_END_PERIOD' | translate}}</span>\n }\n @if (!errorMessages?.['fileExtension'] && controlOrGroup?.errors?.['fileExtension']) {\n <span>{{ '_COMMON._FORM.ERROR_FILE_EXTENSION' | translate: { accept: acceptLabel } }}</span>\n }\n @if (!errorMessages?.['fileSize'] && controlOrGroup?.errors?.['fileSize']) {\n <span>{{ '_COMMON._FORM.ERROR_FILE_SIZE' | translate: { maxSize: maxSizeLabel } }}</span>\n }\n @if (!errorMessages?.['email'] && controlOrGroup?.errors?.['email']) {\n <span>{{ '_COMMON._FORM.ERROR_INVALID_EMAIL' | translate }}</span>\n }\n @if (!errorMessages?.['phone'] && controlOrGroup?.errors?.['phone']) {\n <span>{{ '_COMMON._FORM.ERROR_INVALID_PHONE' | translate }}</span>\n }\n @if (errorMessages) {\n @for (entry of errorMessages | keyvalue: keepOrder; track entry.key) {\n @if (controlOrGroup?.errors?.[entry.key]; as errVal) {\n <span>{{ entry.value | translate: (errVal === true ? null : errVal) }}</span>\n }\n }\n }\n </div>\n }\n\n @if (help || autoHelpEntries.length) {\n <div [id]=\"name + '-help'\" class=\"field-text\">\n @if (help) {\n <span>{{ help | translate }}</span>\n }\n @for (entry of autoHelpEntries; track entry.key) {\n <!-- Espace explicite : les blancs entre balises sont supprim\u00E9s \u00E0 la compilation. -->\n {{ ' ' }}<span>{{ entry.key | translate: entry.params }}</span>\n }\n </div>\n }\n\n <!-- Aper\u00E7u du fichier (type=file, opt-in) : sous le champ et ses aides, comme dans la\n maquette DS. La croix native du champ n'est pas retir\u00E9e \u2014 les deux vident le m\u00EAme\n control, l'aper\u00E7u ajoute juste \u00AB Visualiser \u00BB et une cible plus grande. -->\n @if (isPreviewVisible) {\n <cw-file-preview [file]=\"previewFile\" [existingFile]=\"existingFile ?? null\"\n [disabled]=\"!!isDisabledOrReadonly\" (remove)=\"onPreviewRemove()\" />\n }\n\n <!-- Chips de la multi-s\u00E9lection (autocomplete) : rendus ici, hors du field-group et apr\u00E8s\n erreur/help, pour \u00EAtre visuellement d\u00E9tach\u00E9s du champ. La donn\u00E9e et le retrait restent\n port\u00E9s par cw-autocomplete (`chips()` / `onChipRemove()`), seul l'affichage est d\u00E9l\u00E9gu\u00E9. -->\n @if (type === typeField.autocompleteMultiple && autocompleteRef()?.chips()?.length) {\n <ul class=\"autocomplete-chips\" role=\"list\">\n @for (chip of autocompleteRef()!.chips(); track chip.item) {\n <li>\n <button type=\"button\" class=\"autocomplete-chip\"\n [disabled]=\"isEffectivelyDisabled || isReadonly\"\n (click)=\"autocompleteRef()!.onChipRemove(chip.item)\">\n <span>{{ chip.label }}</span>\n @if (!isEffectivelyDisabled && !isReadonly) {\n <span aria-hidden=\"true\" class=\"autocomplete-chip-x\">&times;</span>\n <span class=\"visually-hidden\">{{ '_COMMON._ACTION.DELETE' | translate }}</span>\n }\n </button>\n </li>\n }\n </ul>\n }\n}\n@else {\n <ng-container [ngTemplateOutlet]=\"field\"></ng-container>\n}\n\n<ng-template #field>\n <!-- Autocomplete (mono / multi) -->\n @if ((type === typeField.autocomplete || type === typeField.autocompleteMultiple) && autocompleteOptions) {\n <cw-autocomplete\n [id]=\"name\"\n [control]=\"formControl\"\n [fetcher]=\"autocompleteOptions.fetcher\"\n [displayField]=\"autocompleteOptions.displayField ?? 'label'\"\n [valueField]=\"autocompleteOptions.valueField ?? 'id'\"\n [columns]=\"autocompleteOptions.columns ?? []\"\n [resolver]=\"autocompleteOptions.resolver ?? null\"\n [selectedItem]=\"autocompleteOptions.selectedItem ?? null\"\n [selectedItems]=\"autocompleteOptions.selectedItems ?? []\"\n [minChars]=\"autocompleteOptions.minChars ?? 2\"\n [debounceMs]=\"autocompleteOptions.debounceMs ?? 250\"\n [multiple]=\"type === typeField.autocompleteMultiple\"\n [isRequired]=\"isRequired\"\n [isReadonly]=\"!!isReadonly\"\n [isDisabled]=\"isEffectivelyDisabled\"\n [ariaInvalid]=\"control.invalid && control.touched\"\n [ariaDescribedBy]=\"getDescribedBy(control)\"\n [placeholder]=\"placeholder\">\n </cw-autocomplete>\n }\n\n <!-- Rich text editor (Quill) : sous-composant interne, sans field-group ni bouton clear\n (il porte sa propre bordure + toolbar). Le label statique du form-field reste au-dessus. -->\n @if (type === typeField.richText) {\n <cw-rich-text-editor\n [id]=\"name\"\n [control]=\"formControl\"\n [options]=\"richTextOptions\"\n [placeholder]=\"placeholder ? (placeholder | translate) : ''\"\n [isRequired]=\"isRequired\"\n [isReadonly]=\"!!isReadonly\"\n [isDisabled]=\"isEffectivelyDisabled\"\n [ariaInvalid]=\"control.invalid && control.touched\"\n [ariaDescribedBy]=\"getDescribedBy(control)\">\n </cw-rich-text-editor>\n }\n\n <!-- Text -->\n @if ([typeField.text, typeField.date, typeField.time, typeField.dateTime, typeField.number,\n typeField.email,\n typeField.color, typeField.zipCode].includes(type)) {\n <input [type]=\"type === typeField.zipCode ? 'text' : type\" class=\"field-control\" [id]=\"name\" [formControl]=\"formControl\"\n [attr.title]=\"fieldTitle ? (fieldTitle | translate) : null\"\n [ngClass]=\"[(cssClass || ''), formControl?.value ? 'has-value' : '', type === typeField.zipCode ? 'field-control-zipcode' : '']\"\n [attr.placeholder]=\"placeholder ? (placeholder | translate) : null\" [attr.required]=\"isRequired ? 'required' : null\"\n [attr.readonly]=\"isReadonly ? 'readonly' : null\" [attr.aria-required]=\"isRequired\"\n [attr.minlength]=\"minLengthAttr\" [attr.maxlength]=\"maxLengthAttr\"\n [attr.min]=\"minAttr\" [attr.max]=\"maxAttr\" [attr.step]=\"stepAttr\" [attr.pattern]=\"patternAttr\"\n [attr.autocomplete]=\"autocomplete\"\n [attr.aria-invalid]=\"control.invalid && control.touched\"\n [attr.aria-describedby]=\"getDescribedBy(control)\"\n (focus)=\"onFocus()\" (blur)=\"onBlur()\" />\n }\n\n <!-- Phone (intl-tel-input) -->\n @if (type === typeField.phone) {\n <input #phoneInput type=\"tel\" class=\"field-control\" [id]=\"name\"\n [attr.placeholder]=\"placeholder ? (placeholder | translate) : null\" [attr.required]=\"isRequired ? 'required' : null\"\n [attr.readonly]=\"isReadonly ? 'readonly' : null\" [disabled]=\"isEffectivelyDisabled\" [attr.aria-required]=\"isRequired\"\n [attr.autocomplete]=\"autocomplete\"\n [attr.aria-invalid]=\"control.invalid && control.touched\"\n [attr.aria-describedby]=\"getDescribedBy(control)\"\n (focus)=\"onFocus()\" (blur)=\"onPhoneBlur($event)\" />\n }\n\n <!-- File -->\n @if (type === typeField.file) {\n <!-- L'input natif reste LE controle (focus, clavier, restitution aux lecteurs d'ecran,\n validation), mais il est masque visuellement : le libelle de son bouton et son\n \u00AB aucun fichier choisi \u00BB sont ecrits par le NAVIGATEUR, dans SA langue. Ils sont\n intraduisibles et ne suivent pas la langue de l'application \u2014 un utilisateur qui\n bascule en anglais garderait \u00AB Choisir un fichier \u00BB. On les reecrit donc a cote,\n traduits, dans une couche purement visuelle. -->\n <input #fileInput type=\"file\" class=\"field-control visually-hidden\" [id]=\"name\"\n [ngClass]=\"[(cssClass || ''), formControl?.value ? 'has-value' : '']\"\n [attr.required]=\"isRequired ? 'required' : null\"\n [attr.readonly]=\"isReadonly ? 'readonly' : null\" [disabled]=\"isEffectivelyDisabled\" [attr.aria-required]=\"isRequired\"\n [attr.accept]=\"acceptAttr\"\n [attr.aria-invalid]=\"control.invalid && control.touched\"\n [attr.aria-describedby]=\"getDescribedBy(control)\"\n (change)=\"onFileChange($event)\" (focus)=\"onFocus()\" (blur)=\"onBlur()\" />\n\n <!-- `aria-hidden` : doublon visuel de l'input, que les lecteurs d'ecran restituent deja\n (nom du champ, bouton de parcours, fichier selectionne). L'annoncer une seconde fois\n ne ferait que bavarder. Le clic est relaye a l'input, le clavier passe par lui. -->\n <span class=\"field-file\" aria-hidden=\"true\" (click)=\"openFilePicker()\">\n <span class=\"field-file-button\">{{ '_COMMON._FORM.CHOOSE_FILE' | translate }}</span>\n <span class=\"field-file-name\" [class.field-file-name-empty]=\"!selectedFileName\">\n {{ selectedFileName ?? ('_COMMON._FORM.NO_FILE_SELECTED' | translate) }}\n </span>\n </span>\n }\n\n @if (type === typeField.password) {\n <input [type]=\"isPasswordShown ? 'text' : 'password'\" class=\"field-control\" [id]=\"name\" [formControl]=\"formControl\"\n [ngClass]=\"[(cssClass || ''), formControl?.value ? 'has-value' : '']\"\n [attr.required]=\"isRequired ? 'required' : null\" [attr.readonly]=\"isReadonly ? 'readonly' : null\"\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\" [attr.aria-required]=\"isRequired\"\n [attr.minlength]=\"minLengthAttr\" [attr.maxlength]=\"maxLengthAttr\" [attr.pattern]=\"patternAttr\"\n [attr.autocomplete]=\"autocomplete\"\n [attr.aria-invalid]=\"control.invalid && control.touched\"\n [attr.aria-describedby]=\"getDescribedBy(control)\"\n (focus)=\"onFocus()\" (blur)=\"onBlur()\" />\n <cw-button [type]=\"buttonType.ghost\"\n cssClass=\"btn-password-field\"\n [withIcon]=\"isPasswordShown ? spriteIcon.toolbarHidePassword : spriteIcon.toolbarShowPassword\"\n [withOnlyIcon]=\"true\"\n [label]=\"isPasswordShown ? '_COMMON._FORM._SHOW_HIDE_PWD.HIDE' : '_COMMON._FORM._SHOW_HIDE_PWD.SHOW'\"\n (btnAction)=\"togglePasswordVisibility()\">\n </cw-button>\n }\n\n <!-- Textarea -->\n @if (type === typeField.textarea) {\n <textarea class=\"field-control\" [id]=\"name\" [formControl]=\"formControl\"\n [ngClass]=\"[(cssClass || ''), formControl?.value ? 'has-value' : '']\"\n [attr.placeholder]=\"placeholder ? (placeholder | translate) : null\" [attr.required]=\"isRequired ? 'required' : null\"\n [attr.readonly]=\"isReadonly ? 'readonly' : null\" [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\"\n [attr.aria-required]=\"isRequired\" [attr.aria-invalid]=\"control.invalid && control.touched\"\n [attr.minlength]=\"minLengthAttr\" [attr.maxlength]=\"maxLengthAttr\" [attr.pattern]=\"patternAttr\"\n [attr.autocomplete]=\"autocomplete\"\n [attr.aria-describedby]=\"getDescribedBy(control)\"\n (focus)=\"onFocus()\" (blur)=\"onBlur()\"></textarea>\n }\n\n <!-- Select -->\n @if (type === typeField.select) {\n <ng-select [formControl]=\"formControl\" [items]=\"options\" bindLabel=\"label\" [labelForId]=\"name\" [appendTo]=\"appendTo ?? ''\" bindValue=\"value\"\n [ngClass]=\"cssClass\" [searchable]=\"false\" [placeholder]=\"placeholder ? (placeholder | translate) : ''\" [readonly]=\"isReadonly\" [clearable]=\"false\"\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\" [attr.required]=\"isRequired ? 'required' : null\"\n [attr.aria-required]=\"isRequired\" [attr.aria-invalid]=\"control.invalid && control.touched\"\n [attr.aria-describedby]=\"getDescribedBy(control)\" [attr.id]=\"name\"\n (focus)=\"onFocus()\" (blur)=\"onBlur()\" (open)=\"onDropdownOpen()\" (close)=\"onDropdownClose()\">\n\n <!-- Template pour les options -->\n <ng-template ng-option-tmp let-item=\"item\" let-index=\"index\" let-search=\"searchTerm\">\n @if (optionTemplate) {\n <ng-container *ngTemplateOutlet=\"optionTemplate; context: { item: item | translate, index: index, searchTerm: search }\"></ng-container>\n }\n @else {\n <div>{{ item.label | translate }}</div>\n }\n </ng-template>\n\n <!-- Template pour le label -->\n <ng-template ng-label-tmp let-item=\"item\">\n @if (labelTemplate) {\n <ng-container *ngTemplateOutlet=\"labelTemplate; context: { item: item | translate }\"></ng-container>\n }\n @else {\n {{ (item.label | translate) || (placeholder | translate) }}\n }\n </ng-template>\n </ng-select>\n }\n\n <!-- NgSelect -->\n @if (type === typeField.ngSelect || type === typeField.ngSelectMultiple) {\n <ng-select [formControl]=\"formControl\" [items]=\"options\" bindLabel=\"label\" [labelForId]=\"name\" [appendTo]=\"appendTo ?? ''\" bindValue=\"value\"\n [multiple]=\"type === typeField.ngSelectMultiple\" [ngClass]=\"cssClass\" [clearable]=\"false\"\n [placeholder]=\"placeholder ? (placeholder | translate) : ''\" [readonly]=\"isReadonly\"\n [notFoundText]=\"'_COMMON.NO_RESULT' | translate\" [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\"\n [attr.required]=\"isRequired ? 'required' : null\" [attr.aria-required]=\"isRequired\"\n [attr.aria-invalid]=\"control.invalid && control.touched\"\n [attr.aria-describedby]=\"getDescribedBy(control)\" [attr.id]=\"name\"\n (focus)=\"onFocus()\" (blur)=\"onBlur()\" (search)=\"textChanged.emit($event?.term)\"\n (open)=\"onDropdownOpen()\" (close)=\"onDropdownClose()\">\n\n <!-- Template pour les options -->\n <ng-template ng-option-tmp let-item=\"item\" let-index=\"index\" let-search=\"searchTerm\">\n @if (optionTemplate) {\n <ng-container *ngTemplateOutlet=\"optionTemplate; context: { item: item, index: index, searchTerm: search }\"></ng-container>\n }\n @else {\n <div>{{ item.label | translate }}</div>\n }\n </ng-template>\n\n <!-- Template pour le label -->\n <ng-template ng-label-tmp let-item=\"item\" let-clear=\"clear\">\n <span class=\"ng-value-icon left\" (click)=\"clear(item)\" aria-hidden=\"true\">\u00D7</span>\n @if (labelTemplate) {\n <ng-container *ngTemplateOutlet=\"labelTemplate; context: { item: item | translate }\"></ng-container>\n }\n @else {\n {{ (item.label | translate) || (placeholder | translate) }}\n }\n </ng-template>\n </ng-select>\n }\n\n <!-- Radio -->\n @if (type === typeField.radioInline || type === typeField.radio) {\n <fieldset [attr.aria-labelledby]=\"hasFieldTooltip ? legendId : null\"\n [attr.aria-required]=\"isRequired\"\n [attr.aria-invalid]=\"control.invalid && control.touched\"\n [attr.aria-describedby]=\"getDescribedBy(control)\">\n <legend class=\"field-label\" [class.visually-hidden]=\"!displayLabel\" [class.d-flex-h]=\"hasFieldTooltip\" [class.gap-2xs]=\"hasFieldTooltip\">\n <span [id]=\"legendId\">\n {{label | translate}}\n @if(isRequired) {\n <span class=\"text-danger\">*</span>\n }\n </span>\n @if (hasFieldTooltip) {\n <ng-container *ngTemplateOutlet=\"fieldTooltip\"></ng-container>\n }\n </legend>\n <ul class=\"list-unstyled mb-none\" [ngClass]=\"type === typeField.radioInline ? 'd-flex-h gap-md flex-wrap' : 'd-flex-v gap-sm'\">\n @for (opt of options; track opt.value) {\n <li class=\"field-check\">\n <input type=\"radio\" [id]=\"name + '_' + opt.value\" [attr.name]=\"name\" [value]=\"opt.value\" [formControl]=\"formControl\"\n class=\"field-check-input\" [attr.disabled]=\"(isEffectivelyDisabled || opt.disabled) ? 'disabled' : null\" (change)=\"onRadioChange(opt.value)\" />\n <label [for]=\"name + '_' + opt.value\" class=\"field-check-label\">{{ opt.label | translate }}</label>\n </li>\n }\n </ul>\n </fieldset>\n }\n\n <!-- Radio button -->\n @if (type === typeField.radioButton) {\n <fieldset [attr.aria-labelledby]=\"hasFieldTooltip ? legendId : null\"\n [attr.aria-required]=\"isRequired\"\n [attr.aria-invalid]=\"control.invalid && control.touched\"\n [attr.aria-describedby]=\"getDescribedBy(control)\">\n <legend class=\"field-label\" [class.visually-hidden]=\"!displayLabel\" [class.d-flex-h]=\"hasFieldTooltip\" [class.gap-2xs]=\"hasFieldTooltip\">\n <span [id]=\"legendId\">\n {{label | translate}}\n @if(isRequired) {\n <span class=\"text-danger\">*</span>\n }\n </span>\n @if (hasFieldTooltip) {\n <ng-container *ngTemplateOutlet=\"fieldTooltip\"></ng-container>\n }\n </legend>\n <div class=\"field-group field-group-btn\">\n @for (opt of options; track opt.value) {\n <input type=\"radio\" [id]=\"name + '_' + opt.value\" [attr.name]=\"name\" [value]=\"opt.value\" [formControl]=\"formControl\"\n class=\"visually-hidden\" [attr.disabled]=\"(isEffectivelyDisabled || opt.disabled) ? 'disabled' : null\" (change)=\"onRadioChange(opt.value)\"/>\n <label [for]=\"name + '_' + opt.value\" class=\"btn btn-field-group\">{{ opt.label | translate }}</label>\n }\n </div>\n </fieldset>\n }\n\n <!-- Cartes : checkbox / radio / switch (contr\u00F4le \u00E0 gauche, titre, description facultative) -->\n @if (isChoiceCard) {\n <fieldset [attr.aria-labelledby]=\"hasFieldTooltip ? legendId : null\"\n [attr.aria-required]=\"isRequired\"\n [attr.aria-invalid]=\"control.invalid && control.touched\"\n [attr.aria-describedby]=\"getDescribedBy(control)\">\n <legend class=\"field-label\" [class.visually-hidden]=\"!displayLabel\" [class.d-flex-h]=\"hasFieldTooltip\" [class.gap-2xs]=\"hasFieldTooltip\">\n <span [id]=\"legendId\">\n {{label | translate}}\n @if(isRequired) {\n <span class=\"text-danger\">*</span>\n }\n </span>\n @if (hasFieldTooltip) {\n <ng-container *ngTemplateOutlet=\"fieldTooltip\"></ng-container>\n }\n </legend>\n <ul class=\"field-card-list list-unstyled mb-none\" [class.field-card-list-compact]=\"isChoiceCardCompact\">\n @for (opt of options; track opt.value) {\n <li class=\"d-flex-v\">\n <!-- Le label englobe toute la carte : un clic n'importe o\u00F9 coche l'option. -->\n <label class=\"field-card d-flex-h items-start gap-xs flex-1\" [for]=\"name + '_' + opt.value\" [class.field-switch]=\"isSwitchCard\" [class.field-switch-small]=\"isSwitchCard\">\n @if (isRadioCard) {\n <input type=\"radio\" [id]=\"name + '_' + opt.value\" [attr.name]=\"name\" [value]=\"opt.value\" [formControl]=\"formControl\"\n class=\"field-check-input\"\n [attr.aria-describedby]=\"(!isChoiceCardCompact && opt.description) ? name + '_' + opt.value + '-desc' : null\"\n [attr.disabled]=\"(isEffectivelyDisabled || opt.disabled) ? 'disabled' : null\" (change)=\"onRadioChange(opt.value)\" />\n } @else {\n <input type=\"checkbox\" [id]=\"name + '_' + opt.value\" [value]=\"opt.value\" (change)=\"onCheckboxChange($event)\"\n [checked]=\"control.value?.includes(opt.value)\" class=\"field-check-input\"\n [attr.role]=\"isSwitchCard ? 'switch' : null\"\n [attr.aria-describedby]=\"(!isChoiceCardCompact && opt.description) ? name + '_' + opt.value + '-desc' : null\"\n [attr.disabled]=\"(isEffectivelyDisabled || opt.disabled) ? 'disabled' : null\" />\n }\n <span class=\"d-flex-v gap-5xs\">\n <span class=\"field-card-title\">{{ opt.label | translate }}</span>\n @if (!isChoiceCardCompact && opt.description) {\n <span class=\"field-text\" [id]=\"name + '_' + opt.value + '-desc'\">{{ opt.description | translate }}</span>\n }\n </span>\n </label>\n </li>\n }\n </ul>\n </fieldset>\n }\n\n <!-- Checkbox Switch -->\n @if ( type === typeField.switch || type === typeField.switchSmall)\n {\n <div class=\"field-check field-switch\" [ngClass]=\"{'field-switch-small': type === typeField.switchSmall}\">\n <input type=\"checkbox\" [id]=\"name\" [formControl]=\"formControl\" class=\"field-check-input\" [attr.aria-required]=\"isRequired\"\n [attr.aria-invalid]=\"control.invalid && control.touched\"\n [attr.aria-describedby]=\"getDescribedBy(control)\"\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\"/>\n <label [for]=\"name\" class=\"field-check-label\">{{ label | translate }}</label>\n </div>\n }\n\n <!-- Checkbox -->\n @if (type === typeField.checkboxInline || type === typeField.checkbox) {\n @if (isSingleCheckbox()) {\n <div class=\"field-check\" [class.field-check-inline]=\"type === typeField.checkboxInline\">\n <input #checkboxInput type=\"checkbox\" [id]=\"name\" [formControl]=\"formControl\"\n class=\"field-check-input\"\n [class.is-invalid]=\"control?.invalid && control?.touched\"\n [attr.aria-required]=\"isRequired\"\n [attr.aria-invalid]=\"control?.invalid && control?.touched\"\n [attr.aria-describedby]=\"getDescribedBy(control)\"\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\" />\n <label [for]=\"name\" class=\"field-check-label\">\n {{ label | translate }}\n @if (isRequired) {\n <span class=\"text-danger\">*</span>\n }\n </label>\n </div>\n }\n @else if( options.length > 1) {\n <fieldset [attr.aria-labelledby]=\"hasFieldTooltip ? legendId : null\"\n [attr.aria-required]=\"isRequired\"\n [attr.aria-invalid]=\"control.invalid && control.touched\"\n [attr.aria-describedby]=\"getDescribedBy(control)\"\n [ngClass]=\"{ 'flex-column': type === typeField.checkbox }\">\n <legend class=\"field-label\" [class.visually-hidden]=\"!displayLabel\" [class.d-flex-h]=\"hasFieldTooltip\" [class.gap-2xs]=\"hasFieldTooltip\">\n <span [id]=\"legendId\">\n {{label | translate}}\n @if(isRequired) {\n <span class=\"text-danger\">*</span>\n }\n </span>\n @if (hasFieldTooltip) {\n <ng-container *ngTemplateOutlet=\"fieldTooltip\"></ng-container>\n }\n </legend>\n <ul class=\"list-unstyled mb-none\" [ngClass]=\"type === typeField.checkboxInline ? 'd-flex-h gap-md' : 'd-flex-v gap-sm'\">\n @for (opt of options; track opt.value) {\n <li class=\"field-check\" [ngClass]=\"{ 'field-check-inline': type === typeField.checkboxInline }\">\n <input type=\"checkbox\" [id]=\"name + '_' + opt.value\" [value]=\"opt.value\" (change)=\"onCheckboxChange($event)\"\n [checked]=\"control.value?.includes(opt.value)\" class=\"field-check-input\"\n [attr.disabled]=\"(isEffectivelyDisabled || opt.disabled) ? 'disabled' : null\" />\n <label [for]=\"name + '_' + opt.value\" class=\"field-check-label\">\n {{ opt.label | translate }}\n </label>\n </li>\n }\n </ul>\n </fieldset>\n }\n @else {\n <fieldset [attr.aria-labelledby]=\"hasFieldTooltip ? legendId : null\">\n <legend class=\"field-label\" [class.visually-hidden]=\"!displayLabel\" [class.d-flex-h]=\"hasFieldTooltip\" [class.gap-2xs]=\"hasFieldTooltip\">\n <span [id]=\"legendId\">\n {{label | translate}}\n </span>\n @if (hasFieldTooltip) {\n <ng-container *ngTemplateOutlet=\"fieldTooltip\"></ng-container>\n }\n </legend>\n <ul class=\"list-unstyled mb-none\" [ngClass]=\"type === typeField.checkboxInline ? 'd-flex-h gap-md' : 'd-flex-v gap-sm'\">\n @for (opt of options; track opt.value) {\n <li class=\"field-check\" [ngClass]=\"{ 'field-check-inline': type === typeField.checkboxInline }\">\n <input type=\"checkbox\" [id]=\"name + '_' + opt.value\" [value]=\"opt.value\" (change)=\"onCheckboxChange($event)\"\n [checked]=\"control.value?.includes(opt.value)\" class=\"field-check-input\"\n [attr.aria-required]=\"isRequired\"\n [attr.aria-invalid]=\"control.invalid && control.touched\"\n [attr.aria-describedby]=\"getDescribedBy(control)\"\n [attr.disabled]=\"(isEffectivelyDisabled || opt.disabled) ? 'disabled' : null\" />\n <label [for]=\"name + '_' + opt.value\" class=\"field-check-label\">\n {{ opt.label | translate }}\n @if(isRequired) {\n <span class=\"text-danger\">*</span>\n }\n </label>\n </li>\n }\n </ul>\n </fieldset>\n }\n }\n\n <!-- Checkbox button -->\n @if (type === typeField.checkboxButton && options.length > 0) {\n\n @if(options.length > 1) {\n <fieldset [attr.aria-labelledby]=\"hasFieldTooltip ? legendId : null\"\n [attr.aria-required]=\"isRequired\"\n [attr.aria-invalid]=\"control.invalid && control.touched\"\n [attr.aria-describedby]=\"getDescribedBy(control)\">\n <legend class=\"field-label\" [class.visually-hidden]=\"!displayLabel\" [class.d-flex-h]=\"hasFieldTooltip\" [class.gap-2xs]=\"hasFieldTooltip\">\n <span [id]=\"legendId\">\n {{label | translate}}\n @if(isRequired) {\n <span class=\"text-danger\">*</span>\n }\n </span>\n @if (hasFieldTooltip) {\n <ng-container *ngTemplateOutlet=\"fieldTooltip\"></ng-container>\n }\n </legend>\n <div class=\"field-group field-group-btn\">\n @for (opt of options; track opt.value) {\n <input type=\"checkbox\" [id]=\"name + '_' + opt.value\" [value]=\"opt.value\" (change)=\"onCheckboxChange($event)\"\n [checked]=\"control.value?.includes(opt.value)\" class=\"visually-hidden\"\n [attr.disabled]=\"(isEffectivelyDisabled || opt.disabled) ? 'disabled' : null\" />\n <label [for]=\"name + '_' + opt.value\" class=\"btn btn-field-group\">{{ opt.label | translate }}</label>\n }\n </div>\n </fieldset>\n }\n @else {\n <fieldset [attr.aria-labelledby]=\"hasFieldTooltip ? legendId : null\">\n <legend class=\"field-label\" [class.visually-hidden]=\"!displayLabel\" [class.d-flex-h]=\"hasFieldTooltip\" [class.gap-2xs]=\"hasFieldTooltip\">\n <span [id]=\"legendId\">\n {{label | translate}}\n </span>\n @if (hasFieldTooltip) {\n <ng-container *ngTemplateOutlet=\"fieldTooltip\"></ng-container>\n }\n </legend>\n <div class=\"btn-group btn-group-secondary\">\n @for (opt of options; track opt.value) {\n <input type=\"checkbox\" [id]=\"name + '_' + opt.value\" [value]=\"opt.value\" (change)=\"onCheckboxChange($event)\"\n [checked]=\"control.value?.includes(opt.value)\" class=\"visually-hidden\"\n [attr.aria-required]=\"isRequired\"\n [attr.aria-invalid]=\"control.invalid && control.touched\"\n [attr.aria-describedby]=\"getDescribedBy(control)\"\n [attr.disabled]=\"(isEffectivelyDisabled || opt.disabled) ? 'disabled' : null\"/>\n <label [for]=\"name + '_' + opt.value\" class=\"btn btn-field-group\">\n {{ opt.label | translate}}\n @if(isRequired) {\n <span class=\"text-danger\">*</span>\n }\n </label>\n }\n </div>\n </fieldset>\n }\n }\n\n <!-- Period - DateToDate / TimeToTime / DateTimeToDateTime -->\n @if (isPeriod) {\n <!-- Fieldset : le legend nomme la p\u00E9riode, \u00AB Du \u00BB / \u00AB au \u00BB sont les labels de chaque input. -->\n <fieldset [attr.aria-labelledby]=\"hasFieldTooltip ? legendId : null\">\n <legend class=\"field-label\" [class.visually-hidden]=\"!displayLabel\" [class.d-flex-h]=\"hasFieldTooltip\" [class.gap-2xs]=\"hasFieldTooltip\">\n <span [id]=\"legendId\">\n {{label | translate}}\n @if(isRequired) {\n <span class=\"text-danger\">*</span>\n }\n </span>\n @if (hasFieldTooltip) {\n <ng-container *ngTemplateOutlet=\"fieldTooltip\"></ng-container>\n }\n </legend>\n <div class=\"field-group\">\n <label class=\"field-group-addon-left\" [for]=\"name + '_start'\">{{ '_COMMON._DATES.FROM_TO_1' | translate }}</label>\n <input [type]=\"getInputType()\" class=\"field-control\" [id]=\"name + '_start'\" [formControl]=\"getControl('start')!\"\n [attr.title]=\"fieldTitle ? (fieldTitle | translate) + ' \u2013 ' + ('_COMMON._DATES.FROM_TO_1' | translate) : null\"\n [attr.placeholder]=\"type === typeField.timeToTime ? ('_COMMON._DATES.FROM' | translate) : ('_COMMON._DATES.FROM_TO_1' | translate)\"\n [ngClass]=\"[(cssClass || ''), getControl('start')?.value ? 'has-value' : '']\"\n [attr.required]=\"isRequired ? 'required' : null\" [attr.readonly]=\"isReadonly ? 'readonly' : null\"\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\" [attr.aria-required]=\"isRequired\"\n [attr.min]=\"minStartAttr\" [attr.max]=\"maxStartAttr\" [attr.step]=\"stepAttr\"\n [attr.autocomplete]=\"autocomplete\"\n [attr.aria-invalid]=\"getControl('start')?.invalid && getControl('start')?.touched\"\n [attr.aria-describedby]=\"getDescribedBy(getControl('start'))\"\n (focus)=\"onFocusRange('start')\" (blur)=\"onBlurRange('start')\" />\n\n @if(getControl('start')?.value && !isDisabledOrReadonly) {\n <button type=\"button\" class=\"btn btn-secondary btn-clear-field\"\n [attr.aria-label]=\"'_COMMON._FORM.CLEAR_START' | translate: { label: label | translate }\"\n (click)=\"onClearFieldPeriod('start')\">\n <span aria-hidden=\"true\">&times;</span>\n </button>\n }\n <label class=\"field-group-addon-center\" [for]=\"name + '_end'\">{{ '_COMMON._DATES.FROM_TO_2' | translate }}</label>\n <input [type]=\"getInputType()\" class=\"field-control\" [id]=\"name + '_end'\" [formControl]=\"getControl('end')!\"\n [attr.title]=\"fieldTitle ? (fieldTitle | translate) + ' \u2013 ' + ('_COMMON._DATES.FROM_TO_2' | translate) : null\"\n [attr.placeholder]=\"type === typeField.timeToTime ? ('_COMMON._DATES.TO' | translate) : ('_COMMON._DATES.FROM_TO_2' | translate)\"\n [ngClass]=\"[(cssClass || ''), getControl('end')?.value ? 'has-value' : '']\"\n [attr.required]=\"isRequired ? 'required' : null\" [attr.readonly]=\"isReadonly ? 'readonly' : null\"\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\"\n [attr.min]=\"minEndAttr\" [attr.max]=\"maxEndAttr\" [attr.step]=\"stepAttr\"\n [attr.autocomplete]=\"autocomplete\"\n [attr.aria-invalid]=\"getControl('end')?.invalid && getControl('end')?.touched\"\n [attr.aria-describedby]=\"getDescribedBy(getControl('end'))\"\n (focus)=\"onFocusRange('end')\" (blur)=\"onBlurRange('end')\" />\n\n @if(getControl('end')?.value && !isDisabledOrReadonly) {\n <button type=\"button\" class=\"btn btn-ghost btn-clear-field\"\n [attr.aria-label]=\"'_COMMON._FORM.CLEAR_END' | translate: { label: label | translate }\"\n (click)=\"onClearFieldPeriod('end')\">\n <span aria-hidden=\"true\">&times;</span>\n </button>\n }\n </div>\n </fieldset>\n }\n\n @if ([typeField.datePlusOne, typeField.datePlusTwo, typeField.datePlusSeven, typeField.dateComplexe].includes(type)) {\n\n <div class=\"field-group\">\n @if (type === typeField.dateComplexe) {\n <div class=\"field-group-addon-left\">\n <button class=\"btn btn-ghost\" type=\"button\" (click)=\"onDateAddDay('prev')\"\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\">\n <cw-icon font=\"optyweb\" [icon]=\"spriteIcon.nextLeft\" [label]=\"'Jour pr\u00E9c\u00E9dent'\"></cw-icon>\n </button>\n </div>\n }\n\n <input type=\"date\" class=\"field-control\" [id]=\"name\" [formControl]=\"formControl\"\n [attr.title]=\"fieldTitle ? (fieldTitle | translate) : null\"\n [ngClass]=\"[(cssClass || ''), formControl?.value ? 'has-value' : '']\"\n [attr.placeholder]=\"placeholder ? (placeholder | translate) : null\" [attr.required]=\"isRequired ? 'required' : null\"\n [attr.readonly]=\"isReadonly ? 'readonly' : null\" [attr.aria-required]=\"isRequired\"\n [attr.min]=\"minAttr\" [attr.max]=\"maxAttr\" [attr.step]=\"stepAttr\"\n [attr.autocomplete]=\"autocomplete\"\n [attr.aria-invalid]=\"control.invalid && control.touched\"\n [attr.aria-describedby]=\"getDescribedBy(control)\"\n (focus)=\"onFocus()\" (blur)=\"onBlur()\" />\n\n @if(formControl?.value && !isDisabledOrReadonly) {\n <button class=\"btn btn-ghost btn-clear-field\" type=\"button\"\n [attr.aria-label]=\"'_COMMON._FORM.CLEAR_FIELD' | translate: { label: label | translate }\"\n (click)=\"onClearField(formControl)\"><span aria-hidden=\"true\">&times;</span></button>\n }\n\n\n @if (type === typeField.dateComplexe) {\n <div class=\"field-group-addon-right\">\n <button class=\"btn btn-ghost\" type=\"button\" (click)=\"onDateAddDay('next')\"\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\">\n <cw-icon font=\"optyweb\" [icon]=\"spriteIcon.nextRight\" [label]=\"'Jour suivant'\"></cw-icon>\n </button>\n </div>\n <div class=\"field-group-addon-right\">\n <button class=\"btn btn-ghost\" type=\"button\" (click)=\"onRefresh()\"\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\">\n <cw-icon font=\"optyweb\" [icon]=\"spriteIcon.toolbarRefresh\" [label]=\"'Rafra\u00EEchir'\"></cw-icon>\n </button>\n </div>\n }\n\n <div class=\"field-group-addon-right\">\n <button class=\"btn btn-ghost\" type=\"button\" (click)=\"onTodayAddDay(0)\"\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\">\n J\n <span class=\"visually-hidden\">Aujourd'hui</span>\n </button>\n </div>\n <div class=\"field-group-addon-right\">\n <button class=\"btn btn-ghost\" type=\"button\" (click)=\"onTodayAddDay(1)\"\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\">\n J+1\n <span class=\"visually-hidden\">Demain</span>\n </button>\n </div>\n\n @if (type !== typeField.datePlusOne && type !== typeField.dateComplexe) {\n <div class=\"field-group-addon-right\">\n <button class=\"btn btn-ghost \" type=\"button\" (click)=\"onTodayAddDay(2)\"\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\">\n J+2\n <span class=\"visually-hidden\">Dans 2 jours</span>\n </button>\n </div>\n\n @if (type !== typeField.datePlusTwo) {\n <div class=\"field-group-addon-right\">\n <button class=\"btn btn-ghost\" type=\"button\" (click)=\"onTodayAddDay(7)\"\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\">\n J+7\n <span class=\"visually-hidden\">Dans 7 jours</span>\n </button>\n </div>\n }\n }\n </div>\n }\n\n @if (type === typeField.slider) {\n <ngx-slider [(value)]=\"sliderValue\" [options]=\"sliderOptions\" [formControl]=\"formControl\"></ngx-slider>\n }\n\n @if (type === typeField.range) {\n <div class=\"slider\">\n\n <cw-button [isDisabled]=\"formControl.value <= rangeOptions.floor\" [label]=\"'Diminuer ' + formControl.value + ' ' + label\"\n [withIcon]=\"spriteIcon.toolbarMinus\" [withOnlyIcon]=\"true\" [type]=\"buttonType.primary\"\n [iconSize]=\"buttonIconSize.small\" (btnAction)=\"onRangeStep('decrease')\">\n </cw-button>\n\n <div class=\"slider-input\">\n <label [for]=\"name\" class=\"slider-tooltip\" [style.left]=\"getRangePercent() + '%'\" aria-live=\"polite\"\n aria-atomic=\"true\">\n {{ label | translate }} {{ formControl.value }}\n @if (rangeOptions.unit) {\n <abbr [title]=\"rangeOptions.unit\">{{ rangeOptions.unit }}</abbr>\n }\n </label>\n\n <div class=\"slider-custom-bar\">\n <div class=\"slider-custom-bar-selection\" [style.width]=\"getRangePercent() + '%'\">\n </div>\n </div>\n\n <input type=\"range\" [id]=\"name\" [formControl]=\"formControl\" [min]=\"rangeOptions.floor\" [max]=\"rangeOptions.ceil\"\n [step]=\"rangeOptions.step || 1\" class=\"field-control-range\" [attr.aria-required]=\"isRequired\"\n [attr.aria-invalid]=\"control.invalid && control.touched\">\n </div>\n\n <cw-button [isDisabled]=\"formControl.value >= rangeOptions.ceil\" [label]=\"'Augmenter ' + formControl.value + ' ' + label\"\n [withIcon]=\"spriteIcon.toolbarPlus\" [withOnlyIcon]=\"true\" [type]=\"buttonType.primary\"\n [iconSize]=\"buttonIconSize.small\" (btnAction)=\"onRangeStep('increase')\">\n </cw-button>\n </div>\n }\n\n @if (isInInputGroup() && clearable && !isDisabledOrReadonly && type !== typeField.autocompleteMultiple) {\n @if (type === typeField.autocomplete) {\n @if (autocompleteRef()?.hasAnyContent()) {\n <button class=\"btn btn-secondary btn-clear-field\" type=\"button\"\n [attr.aria-label]=\"'_COMMON._FORM.CLEAR_FIELD' | translate: { label: label | translate }\"\n (click)=\"onClearAutocomplete()\"><span aria-hidden=\"true\">&times;</span></button>\n }\n } @else if (type === typeField.ngSelectMultiple) {\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. -->\n @if (formControl?.value?.length) {\n <button class=\"btn btn-ghost btn-clear-field\" type=\"button\"\n [attr.aria-label]=\"'_COMMON._FORM.CLEAR_FIELD' | translate: { label: label | translate }\"\n (click)=\"onClearField(formControl)\"><span aria-hidden=\"true\">&times;</span></button>\n }\n } @else {\n @if(formControl?.value) {\n <button class=\"btn btn-ghost btn-clear-field\" type=\"button\"\n [attr.aria-label]=\"'_COMMON._FORM.CLEAR_FIELD' | translate: { label: label | translate }\"\n (click)=\"onClearField(formControl)\"><span aria-hidden=\"true\">&times;</span></button>\n }\n }\n }\n\n</ng-template>\n\n<ng-template #fieldLabel>\n <label [for]=\"name\" class=\"field-label\" [class.visually-hidden]=\"!displayLabel\">\n {{ label | translate }}\n\n @if (isRequired) {\n <span class=\"text-danger\">*</span>\n }\n </label>\n</ng-template>\n\n<!-- Bouton d'aide (tooltip) partage label/legend. Hors du <label> (sinon son libelle\n s'ajoute au nom du champ et le clic active le label) ; dans un <legend>, le fieldset\n est nomme par aria-labelledby sur le seul texte (legendId) pour la meme raison. -->\n<ng-template #fieldTooltip>\n <button type=\"button\" class=\"btn btn-ghost btn-field-tooltip\"\n [cwTooltip]=\"tooltip ?? ''\"\n [attr.data-test-ctw]=\"'tooltip-' + name\">\n <cw-icon [icon]=\"spriteIcon.alertHelp\" [type]=\"iconType.circular\" [iconUiType]=\"iconUiType.info\"\n [iconSize]=\"iconSize.xs\" [label]=\"'_COMMON._FORM.TOOLTIP_HELP' | translate\"></cw-icon>\n </button>\n</ng-template>\n" }]
4475
+ ], template: "@if (!isInAddon) {\n @if (\n type !== typeField.checkbox &&\n type !== typeField.radio &&\n type !== typeField.checkboxButton &&\n type !== typeField.radioButton &&\n type !== typeField.checkboxInline &&\n type !== typeField.radioInline &&\n type !== typeField.switch &&\n type !== typeField.range &&\n type !== typeField.switchSmall &&\n !isChoiceCard &&\n !isPeriod\n ) {\n <!-- Bouton d'aide HORS du <label> (bouton dans un label = HTML invalide, son libelle\n polluerait le nom accessible du champ et un clic activerait le label) : on aligne\n label + bouton dans un conteneur flex, seulement quand il y a une aide. -->\n @if (hasFieldTooltip) {\n <div class=\"d-flex-h gap-2xs\">\n <ng-container *ngTemplateOutlet=\"fieldLabel\"></ng-container>\n <ng-container *ngTemplateOutlet=\"fieldTooltip\"></ng-container>\n </div>\n } @else {\n <ng-container *ngTemplateOutlet=\"fieldLabel\"></ng-container>\n }\n }\n\n @if (addonLeft || addonRight) {\n <div class=\"field-group\" [class.field-group-invalid]=\"isInvalid\" [class.field-group-disabled]=\"isDisabledOrReadonly\">\n @if(addonLeft) {\n <div class=\"field-group-addon-left\">\n <ng-container [ngTemplateOutlet]=\"addonLeft\"></ng-container>\n </div>\n }\n <ng-container [ngTemplateOutlet]=\"field\"></ng-container>\n @if(addonRight) {\n <div class=\"field-group-addon-right\">\n <ng-container [ngTemplateOutlet]=\"addonRight\"></ng-container>\n </div>\n }\n </div>\n }\n @else {\n @if ( isInInputGroup() ) {\n <div class=\"field-group\" [class.field-group-invalid]=\"isInvalid\" [class.field-group-disabled]=\"isDisabledOrReadonly\">\n <ng-container [ngTemplateOutlet]=\"field\"></ng-container>\n </div>\n }\n @else {\n <ng-container [ngTemplateOutlet]=\"field\"></ng-container>\n }\n }\n\n <!-- Error message -->\n @if (controlOrGroup?.invalid && controlOrGroup?.touched) {\n <div class=\"field-invalid\" [id]=\"'error-' + name\">\n @if (\n !errorMessages?.['required'] &&\n ((controlOrGroup?.errors?.['required']) || (getControl('start')?.errors?.['required'] || getControl('end')?.errors?.['required']))\n ) {\n <span [innerHtml]=\"'_COMMON._FORM.ERROR_IS_MANDATORY' | translate: {label: label | translate}\"></span>\n }\n @if (!errorMessages?.['rangeInvalid'] && controlOrGroup?.errors?.['rangeInvalid']) {\n <span>{{'_COMMON._DATES.ERROR_START_END_PERIOD' | translate}}</span>\n }\n @if (!errorMessages?.['fileExtension'] && controlOrGroup?.errors?.['fileExtension']) {\n <span>{{ '_COMMON._FORM.ERROR_FILE_EXTENSION' | translate: { accept: acceptLabel } }}</span>\n }\n @if (!errorMessages?.['fileSize'] && controlOrGroup?.errors?.['fileSize']) {\n <span>{{ '_COMMON._FORM.ERROR_FILE_SIZE' | translate: { maxSize: maxSizeLabel } }}</span>\n }\n @if (!errorMessages?.['email'] && controlOrGroup?.errors?.['email']) {\n <span>{{ '_COMMON._FORM.ERROR_INVALID_EMAIL' | translate }}</span>\n }\n @if (!errorMessages?.['phone'] && controlOrGroup?.errors?.['phone']) {\n <span>{{ '_COMMON._FORM.ERROR_INVALID_PHONE' | translate }}</span>\n }\n @if (errorMessages) {\n @for (entry of errorMessages | keyvalue: keepOrder; track entry.key) {\n @if (controlOrGroup?.errors?.[entry.key]; as errVal) {\n <span>{{ entry.value | translate: (errVal === true ? null : errVal) }}</span>\n }\n }\n }\n </div>\n }\n\n @if (help || autoHelpEntries.length) {\n <div [id]=\"name + '-help'\" class=\"field-text\">\n @if (help) {\n <span>{{ help | translate: helpParams }}</span>\n }\n @for (entry of autoHelpEntries; track entry.key) {\n <!-- Espace explicite : les blancs entre balises sont supprim\u00E9s \u00E0 la compilation. -->\n {{ ' ' }}<span>{{ entry.key | translate: entry.params }}</span>\n }\n </div>\n }\n\n <!-- Aper\u00E7u du fichier (type=file, opt-in) : sous le champ et ses aides, comme dans la\n maquette DS. La croix native du champ n'est pas retir\u00E9e \u2014 les deux vident le m\u00EAme\n control, l'aper\u00E7u ajoute juste \u00AB Visualiser \u00BB et une cible plus grande. -->\n @if (isPreviewVisible) {\n <cw-file-preview [file]=\"previewFile\" [existingFile]=\"existingFile ?? null\"\n [disabled]=\"!!isDisabledOrReadonly\" (remove)=\"onPreviewRemove()\" />\n }\n\n <!-- Chips de la multi-s\u00E9lection (autocomplete) : rendus ici, hors du field-group et apr\u00E8s\n erreur/help, pour \u00EAtre visuellement d\u00E9tach\u00E9s du champ. La donn\u00E9e et le retrait restent\n port\u00E9s par cw-autocomplete (`chips()` / `onChipRemove()`), seul l'affichage est d\u00E9l\u00E9gu\u00E9. -->\n @if (type === typeField.autocompleteMultiple && autocompleteRef()?.chips()?.length) {\n <ul class=\"autocomplete-chips\" role=\"list\">\n @for (chip of autocompleteRef()!.chips(); track chip.item) {\n <li>\n <button type=\"button\" class=\"autocomplete-chip\"\n [disabled]=\"isEffectivelyDisabled || isReadonly\"\n (click)=\"autocompleteRef()!.onChipRemove(chip.item)\">\n <span>{{ chip.label }}</span>\n @if (!isEffectivelyDisabled && !isReadonly) {\n <span aria-hidden=\"true\" class=\"autocomplete-chip-x\">&times;</span>\n <span class=\"visually-hidden\">{{ '_COMMON._ACTION.DELETE' | translate }}</span>\n }\n </button>\n </li>\n }\n </ul>\n }\n}\n@else {\n <ng-container [ngTemplateOutlet]=\"field\"></ng-container>\n}\n\n<ng-template #field>\n <!-- Autocomplete (mono / multi) -->\n @if ((type === typeField.autocomplete || type === typeField.autocompleteMultiple) && autocompleteOptions) {\n <cw-autocomplete\n [id]=\"name\"\n [control]=\"formControl\"\n [fetcher]=\"autocompleteOptions.fetcher\"\n [displayField]=\"autocompleteOptions.displayField ?? 'label'\"\n [valueField]=\"autocompleteOptions.valueField ?? 'id'\"\n [columns]=\"autocompleteOptions.columns ?? []\"\n [resolver]=\"autocompleteOptions.resolver ?? null\"\n [selectedItem]=\"autocompleteOptions.selectedItem ?? null\"\n [selectedItems]=\"autocompleteOptions.selectedItems ?? []\"\n [minChars]=\"autocompleteOptions.minChars ?? 2\"\n [debounceMs]=\"autocompleteOptions.debounceMs ?? 250\"\n [multiple]=\"type === typeField.autocompleteMultiple\"\n [isRequired]=\"isRequired\"\n [isReadonly]=\"!!isReadonly\"\n [isDisabled]=\"isEffectivelyDisabled\"\n [ariaInvalid]=\"control.invalid && control.touched\"\n [ariaDescribedBy]=\"getDescribedBy(control)\"\n [placeholder]=\"placeholder\">\n </cw-autocomplete>\n }\n\n <!-- Rich text editor (Quill) : sous-composant interne, sans field-group ni bouton clear\n (il porte sa propre bordure + toolbar). Le label statique du form-field reste au-dessus. -->\n @if (type === typeField.richText) {\n <cw-rich-text-editor\n [id]=\"name\"\n [control]=\"formControl\"\n [options]=\"richTextOptions\"\n [placeholder]=\"placeholder ? (placeholder | translate) : ''\"\n [isRequired]=\"isRequired\"\n [isReadonly]=\"!!isReadonly\"\n [isDisabled]=\"isEffectivelyDisabled\"\n [ariaInvalid]=\"control.invalid && control.touched\"\n [ariaDescribedBy]=\"getDescribedBy(control)\">\n </cw-rich-text-editor>\n }\n\n <!-- Text -->\n @if ([typeField.text, typeField.date, typeField.time, typeField.dateTime, typeField.number,\n typeField.email,\n typeField.color, typeField.zipCode].includes(type)) {\n <input [type]=\"type === typeField.zipCode ? 'text' : type\" class=\"field-control\" [id]=\"name\" [formControl]=\"formControl\"\n [attr.title]=\"fieldTitle ? (fieldTitle | translate) : null\"\n [ngClass]=\"[(cssClass || ''), formControl?.value ? 'has-value' : '', type === typeField.zipCode ? 'field-control-zipcode' : '']\"\n [attr.placeholder]=\"placeholder ? (placeholder | translate) : null\" [attr.required]=\"isRequired ? 'required' : null\"\n [attr.readonly]=\"isReadonly ? 'readonly' : null\" [attr.aria-required]=\"isRequired\"\n [attr.minlength]=\"minLengthAttr\" [attr.maxlength]=\"maxLengthAttr\"\n [attr.min]=\"minAttr\" [attr.max]=\"maxAttr\" [attr.step]=\"stepAttr\" [attr.pattern]=\"patternAttr\"\n [attr.autocomplete]=\"autocomplete\"\n [attr.aria-invalid]=\"control.invalid && control.touched\"\n [attr.aria-describedby]=\"getDescribedBy(control)\"\n (focus)=\"onFocus()\" (blur)=\"onBlur()\" />\n }\n\n <!-- Phone (intl-tel-input) -->\n @if (type === typeField.phone) {\n <input #phoneInput type=\"tel\" class=\"field-control\" [id]=\"name\"\n [attr.placeholder]=\"placeholder ? (placeholder | translate) : null\" [attr.required]=\"isRequired ? 'required' : null\"\n [attr.readonly]=\"isReadonly ? 'readonly' : null\" [disabled]=\"isEffectivelyDisabled\" [attr.aria-required]=\"isRequired\"\n [attr.autocomplete]=\"autocomplete\"\n [attr.aria-invalid]=\"control.invalid && control.touched\"\n [attr.aria-describedby]=\"getDescribedBy(control)\"\n (focus)=\"onFocus()\" (blur)=\"onPhoneBlur($event)\" />\n }\n\n <!-- File -->\n @if (type === typeField.file) {\n <!-- L'input natif reste LE controle (focus, clavier, restitution aux lecteurs d'ecran,\n validation), mais il est masque visuellement : le libelle de son bouton et son\n \u00AB aucun fichier choisi \u00BB sont ecrits par le NAVIGATEUR, dans SA langue. Ils sont\n intraduisibles et ne suivent pas la langue de l'application \u2014 un utilisateur qui\n bascule en anglais garderait \u00AB Choisir un fichier \u00BB. On les reecrit donc a cote,\n traduits, dans une couche purement visuelle. -->\n <input #fileInput type=\"file\" class=\"field-control visually-hidden\" [id]=\"name\"\n [ngClass]=\"[(cssClass || ''), formControl?.value ? 'has-value' : '']\"\n [attr.required]=\"isRequired ? 'required' : null\"\n [attr.readonly]=\"isReadonly ? 'readonly' : null\" [disabled]=\"isEffectivelyDisabled\" [attr.aria-required]=\"isRequired\"\n [attr.accept]=\"acceptAttr\"\n [attr.aria-invalid]=\"control.invalid && control.touched\"\n [attr.aria-describedby]=\"getDescribedBy(control)\"\n (change)=\"onFileChange($event)\" (focus)=\"onFocus()\" (blur)=\"onBlur()\" />\n\n <!-- `aria-hidden` : doublon visuel de l'input, que les lecteurs d'ecran restituent deja\n (nom du champ, bouton de parcours, fichier selectionne). L'annoncer une seconde fois\n ne ferait que bavarder. Le clic est relaye a l'input, le clavier passe par lui. -->\n <span class=\"field-file\" aria-hidden=\"true\" (click)=\"openFilePicker()\">\n <span class=\"field-file-button\">{{ '_COMMON._FORM.CHOOSE_FILE' | translate }}</span>\n <span class=\"field-file-name\" [class.field-file-name-empty]=\"!selectedFileName\">\n {{ selectedFileName ?? ('_COMMON._FORM.NO_FILE_SELECTED' | translate) }}\n </span>\n </span>\n }\n\n @if (type === typeField.password) {\n <input [type]=\"isPasswordShown ? 'text' : 'password'\" class=\"field-control\" [id]=\"name\" [formControl]=\"formControl\"\n [ngClass]=\"[(cssClass || ''), formControl?.value ? 'has-value' : '']\"\n [attr.required]=\"isRequired ? 'required' : null\" [attr.readonly]=\"isReadonly ? 'readonly' : null\"\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\" [attr.aria-required]=\"isRequired\"\n [attr.minlength]=\"minLengthAttr\" [attr.maxlength]=\"maxLengthAttr\" [attr.pattern]=\"patternAttr\"\n [attr.autocomplete]=\"autocomplete\"\n [attr.aria-invalid]=\"control.invalid && control.touched\"\n [attr.aria-describedby]=\"getDescribedBy(control)\"\n (focus)=\"onFocus()\" (blur)=\"onBlur()\" />\n <cw-button [type]=\"buttonType.ghost\"\n cssClass=\"btn-password-field\"\n [withIcon]=\"isPasswordShown ? spriteIcon.toolbarHidePassword : spriteIcon.toolbarShowPassword\"\n [withOnlyIcon]=\"true\"\n [label]=\"isPasswordShown ? '_COMMON._FORM._SHOW_HIDE_PWD.HIDE' : '_COMMON._FORM._SHOW_HIDE_PWD.SHOW'\"\n (btnAction)=\"togglePasswordVisibility()\">\n </cw-button>\n }\n\n <!-- Textarea -->\n @if (type === typeField.textarea) {\n <textarea class=\"field-control\" [id]=\"name\" [formControl]=\"formControl\"\n [ngClass]=\"[(cssClass || ''), formControl?.value ? 'has-value' : '']\"\n [attr.placeholder]=\"placeholder ? (placeholder | translate) : null\" [attr.required]=\"isRequired ? 'required' : null\"\n [attr.readonly]=\"isReadonly ? 'readonly' : null\" [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\"\n [attr.aria-required]=\"isRequired\" [attr.aria-invalid]=\"control.invalid && control.touched\"\n [attr.minlength]=\"minLengthAttr\" [attr.maxlength]=\"maxLengthAttr\" [attr.pattern]=\"patternAttr\"\n [attr.autocomplete]=\"autocomplete\"\n [attr.aria-describedby]=\"getDescribedBy(control)\"\n (focus)=\"onFocus()\" (blur)=\"onBlur()\"></textarea>\n }\n\n <!-- Select -->\n @if (type === typeField.select) {\n <ng-select [formControl]=\"formControl\" [items]=\"options\" bindLabel=\"label\" [labelForId]=\"name\" [appendTo]=\"appendTo ?? ''\" bindValue=\"value\"\n [ngClass]=\"cssClass\" [searchable]=\"false\" [placeholder]=\"placeholder ? (placeholder | translate) : ''\" [readonly]=\"isReadonly\" [clearable]=\"false\"\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\" [attr.required]=\"isRequired ? 'required' : null\"\n [attr.aria-required]=\"isRequired\" [attr.aria-invalid]=\"control.invalid && control.touched\"\n [attr.aria-describedby]=\"getDescribedBy(control)\" [attr.id]=\"name\"\n (focus)=\"onFocus()\" (blur)=\"onBlur()\" (open)=\"onDropdownOpen()\" (close)=\"onDropdownClose()\">\n\n <!-- Template pour les options -->\n <ng-template ng-option-tmp let-item=\"item\" let-index=\"index\" let-search=\"searchTerm\">\n @if (optionTemplate) {\n <ng-container *ngTemplateOutlet=\"optionTemplate; context: { item: item | translate, index: index, searchTerm: search }\"></ng-container>\n }\n @else {\n <div>{{ item.label | translate }}</div>\n }\n </ng-template>\n\n <!-- Template pour le label -->\n <ng-template ng-label-tmp let-item=\"item\">\n @if (labelTemplate) {\n <ng-container *ngTemplateOutlet=\"labelTemplate; context: { item: item | translate }\"></ng-container>\n }\n @else {\n {{ (item.label | translate) || (placeholder | translate) }}\n }\n </ng-template>\n </ng-select>\n }\n\n <!-- NgSelect -->\n @if (type === typeField.ngSelect || type === typeField.ngSelectMultiple) {\n <ng-select [formControl]=\"formControl\" [items]=\"options\" bindLabel=\"label\" [labelForId]=\"name\" [appendTo]=\"appendTo ?? ''\" bindValue=\"value\"\n [multiple]=\"type === typeField.ngSelectMultiple\" [ngClass]=\"cssClass\" [clearable]=\"false\"\n [placeholder]=\"placeholder ? (placeholder | translate) : ''\" [readonly]=\"isReadonly\"\n [notFoundText]=\"'_COMMON.NO_RESULT' | translate\" [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\"\n [attr.required]=\"isRequired ? 'required' : null\" [attr.aria-required]=\"isRequired\"\n [attr.aria-invalid]=\"control.invalid && control.touched\"\n [attr.aria-describedby]=\"getDescribedBy(control)\" [attr.id]=\"name\"\n (focus)=\"onFocus()\" (blur)=\"onBlur()\" (search)=\"textChanged.emit($event?.term)\"\n (open)=\"onDropdownOpen()\" (close)=\"onDropdownClose()\">\n\n <!-- Template pour les options -->\n <ng-template ng-option-tmp let-item=\"item\" let-index=\"index\" let-search=\"searchTerm\">\n @if (optionTemplate) {\n <ng-container *ngTemplateOutlet=\"optionTemplate; context: { item: item, index: index, searchTerm: search }\"></ng-container>\n }\n @else {\n <div>{{ item.label | translate }}</div>\n }\n </ng-template>\n\n <!-- Template pour le label -->\n <ng-template ng-label-tmp let-item=\"item\" let-clear=\"clear\">\n <span class=\"ng-value-icon left\" (click)=\"clear(item)\" aria-hidden=\"true\">\u00D7</span>\n @if (labelTemplate) {\n <ng-container *ngTemplateOutlet=\"labelTemplate; context: { item: item | translate }\"></ng-container>\n }\n @else {\n {{ (item.label | translate) || (placeholder | translate) }}\n }\n </ng-template>\n </ng-select>\n }\n\n <!-- Radio -->\n @if (type === typeField.radioInline || type === typeField.radio) {\n <fieldset [attr.aria-labelledby]=\"hasFieldTooltip ? legendId : null\"\n [attr.aria-required]=\"isRequired\"\n [attr.aria-invalid]=\"control.invalid && control.touched\"\n [attr.aria-describedby]=\"getDescribedBy(control)\">\n <legend class=\"field-label\" [class.visually-hidden]=\"!displayLabel\" [class.d-flex-h]=\"hasFieldTooltip\" [class.gap-2xs]=\"hasFieldTooltip\">\n <span [id]=\"legendId\">\n {{label | translate}}\n @if(isRequired) {\n <span class=\"text-danger\">*</span>\n }\n </span>\n @if (hasFieldTooltip) {\n <ng-container *ngTemplateOutlet=\"fieldTooltip\"></ng-container>\n }\n </legend>\n <ul class=\"list-unstyled mb-none\" [ngClass]=\"type === typeField.radioInline ? 'd-flex-h gap-md flex-wrap' : 'd-flex-v gap-sm'\">\n @for (opt of options; track opt.value) {\n <li class=\"field-check\">\n <input type=\"radio\" [id]=\"name + '_' + opt.value\" [attr.name]=\"name\" [value]=\"opt.value\" [formControl]=\"formControl\"\n class=\"field-check-input\" [attr.disabled]=\"(isEffectivelyDisabled || opt.disabled) ? 'disabled' : null\" (change)=\"onRadioChange(opt.value)\" />\n <label [for]=\"name + '_' + opt.value\" class=\"field-check-label\">{{ opt.label | translate }}</label>\n </li>\n }\n </ul>\n </fieldset>\n }\n\n <!-- Radio button -->\n @if (type === typeField.radioButton) {\n <fieldset [attr.aria-labelledby]=\"hasFieldTooltip ? legendId : null\"\n [attr.aria-required]=\"isRequired\"\n [attr.aria-invalid]=\"control.invalid && control.touched\"\n [attr.aria-describedby]=\"getDescribedBy(control)\">\n <legend class=\"field-label\" [class.visually-hidden]=\"!displayLabel\" [class.d-flex-h]=\"hasFieldTooltip\" [class.gap-2xs]=\"hasFieldTooltip\">\n <span [id]=\"legendId\">\n {{label | translate}}\n @if(isRequired) {\n <span class=\"text-danger\">*</span>\n }\n </span>\n @if (hasFieldTooltip) {\n <ng-container *ngTemplateOutlet=\"fieldTooltip\"></ng-container>\n }\n </legend>\n <div class=\"field-group field-group-btn\">\n @for (opt of options; track opt.value) {\n <input type=\"radio\" [id]=\"name + '_' + opt.value\" [attr.name]=\"name\" [value]=\"opt.value\" [formControl]=\"formControl\"\n class=\"visually-hidden\" [attr.disabled]=\"(isEffectivelyDisabled || opt.disabled) ? 'disabled' : null\" (change)=\"onRadioChange(opt.value)\"/>\n <label [for]=\"name + '_' + opt.value\" class=\"btn btn-field-group\">{{ opt.label | translate }}</label>\n }\n </div>\n </fieldset>\n }\n\n <!-- Cartes : checkbox / radio / switch (contr\u00F4le \u00E0 gauche, titre, description facultative) -->\n @if (isChoiceCard) {\n <fieldset [attr.aria-labelledby]=\"hasFieldTooltip ? legendId : null\"\n [attr.aria-required]=\"isRequired\"\n [attr.aria-invalid]=\"control.invalid && control.touched\"\n [attr.aria-describedby]=\"getDescribedBy(control)\">\n <legend class=\"field-label\" [class.visually-hidden]=\"!displayLabel\" [class.d-flex-h]=\"hasFieldTooltip\" [class.gap-2xs]=\"hasFieldTooltip\">\n <span [id]=\"legendId\">\n {{label | translate}}\n @if(isRequired) {\n <span class=\"text-danger\">*</span>\n }\n </span>\n @if (hasFieldTooltip) {\n <ng-container *ngTemplateOutlet=\"fieldTooltip\"></ng-container>\n }\n </legend>\n <ul class=\"field-card-list list-unstyled mb-none\" [class.field-card-list-compact]=\"isChoiceCardCompact\">\n @for (opt of options; track opt.value) {\n <li class=\"d-flex-v\">\n <!-- Le label englobe toute la carte : un clic n'importe o\u00F9 coche l'option. -->\n <label class=\"field-card d-flex-h items-start gap-xs flex-1\" [for]=\"name + '_' + opt.value\" [class.field-switch]=\"isSwitchCard\" [class.field-switch-small]=\"isSwitchCard\">\n @if (isRadioCard) {\n <input type=\"radio\" [id]=\"name + '_' + opt.value\" [attr.name]=\"name\" [value]=\"opt.value\" [formControl]=\"formControl\"\n class=\"field-check-input\"\n [attr.aria-describedby]=\"(!isChoiceCardCompact && opt.description) ? name + '_' + opt.value + '-desc' : null\"\n [attr.disabled]=\"(isEffectivelyDisabled || opt.disabled) ? 'disabled' : null\" (change)=\"onRadioChange(opt.value)\" />\n } @else {\n <input type=\"checkbox\" [id]=\"name + '_' + opt.value\" [value]=\"opt.value\" (change)=\"onCheckboxChange($event)\"\n [checked]=\"control.value?.includes(opt.value)\" class=\"field-check-input\"\n [attr.role]=\"isSwitchCard ? 'switch' : null\"\n [attr.aria-describedby]=\"(!isChoiceCardCompact && opt.description) ? name + '_' + opt.value + '-desc' : null\"\n [attr.disabled]=\"(isEffectivelyDisabled || opt.disabled) ? 'disabled' : null\" />\n }\n <span class=\"d-flex-v gap-5xs\">\n <span class=\"field-card-title\">{{ opt.label | translate }}</span>\n @if (!isChoiceCardCompact && opt.description) {\n <span class=\"field-text\" [id]=\"name + '_' + opt.value + '-desc'\">{{ opt.description | translate }}</span>\n }\n </span>\n </label>\n </li>\n }\n </ul>\n </fieldset>\n }\n\n <!-- Checkbox Switch -->\n @if ( type === typeField.switch || type === typeField.switchSmall)\n {\n <div class=\"field-check field-switch\" [ngClass]=\"{'field-switch-small': type === typeField.switchSmall}\">\n <input type=\"checkbox\" [id]=\"name\" [formControl]=\"formControl\" class=\"field-check-input\" [attr.aria-required]=\"isRequired\"\n [attr.aria-invalid]=\"control.invalid && control.touched\"\n [attr.aria-describedby]=\"getDescribedBy(control)\"\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\"/>\n <label [for]=\"name\" class=\"field-check-label\">{{ label | translate }}</label>\n </div>\n }\n\n <!-- Checkbox -->\n @if (type === typeField.checkboxInline || type === typeField.checkbox) {\n @if (isSingleCheckbox()) {\n <div class=\"field-check\" [class.field-check-inline]=\"type === typeField.checkboxInline\">\n <input #checkboxInput type=\"checkbox\" [id]=\"name\" [formControl]=\"formControl\"\n class=\"field-check-input\"\n [class.is-invalid]=\"control?.invalid && control?.touched\"\n [attr.aria-required]=\"isRequired\"\n [attr.aria-invalid]=\"control?.invalid && control?.touched\"\n [attr.aria-describedby]=\"getDescribedBy(control)\"\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\" />\n <label [for]=\"name\" class=\"field-check-label\">\n {{ label | translate }}\n @if (isRequired) {\n <span class=\"text-danger\">*</span>\n }\n </label>\n </div>\n }\n @else if( options.length > 1) {\n <fieldset [attr.aria-labelledby]=\"hasFieldTooltip ? legendId : null\"\n [attr.aria-required]=\"isRequired\"\n [attr.aria-invalid]=\"control.invalid && control.touched\"\n [attr.aria-describedby]=\"getDescribedBy(control)\"\n [ngClass]=\"{ 'flex-column': type === typeField.checkbox }\">\n <legend class=\"field-label\" [class.visually-hidden]=\"!displayLabel\" [class.d-flex-h]=\"hasFieldTooltip\" [class.gap-2xs]=\"hasFieldTooltip\">\n <span [id]=\"legendId\">\n {{label | translate}}\n @if(isRequired) {\n <span class=\"text-danger\">*</span>\n }\n </span>\n @if (hasFieldTooltip) {\n <ng-container *ngTemplateOutlet=\"fieldTooltip\"></ng-container>\n }\n </legend>\n <ul class=\"list-unstyled mb-none\" [ngClass]=\"type === typeField.checkboxInline ? 'd-flex-h gap-md' : 'd-flex-v gap-sm'\">\n @for (opt of options; track opt.value) {\n <li class=\"field-check\" [ngClass]=\"{ 'field-check-inline': type === typeField.checkboxInline }\">\n <input type=\"checkbox\" [id]=\"name + '_' + opt.value\" [value]=\"opt.value\" (change)=\"onCheckboxChange($event)\"\n [checked]=\"control.value?.includes(opt.value)\" class=\"field-check-input\"\n [attr.disabled]=\"(isEffectivelyDisabled || opt.disabled) ? 'disabled' : null\" />\n <label [for]=\"name + '_' + opt.value\" class=\"field-check-label\">\n {{ opt.label | translate }}\n </label>\n </li>\n }\n </ul>\n </fieldset>\n }\n @else {\n <fieldset [attr.aria-labelledby]=\"hasFieldTooltip ? legendId : null\">\n <legend class=\"field-label\" [class.visually-hidden]=\"!displayLabel\" [class.d-flex-h]=\"hasFieldTooltip\" [class.gap-2xs]=\"hasFieldTooltip\">\n <span [id]=\"legendId\">\n {{label | translate}}\n </span>\n @if (hasFieldTooltip) {\n <ng-container *ngTemplateOutlet=\"fieldTooltip\"></ng-container>\n }\n </legend>\n <ul class=\"list-unstyled mb-none\" [ngClass]=\"type === typeField.checkboxInline ? 'd-flex-h gap-md' : 'd-flex-v gap-sm'\">\n @for (opt of options; track opt.value) {\n <li class=\"field-check\" [ngClass]=\"{ 'field-check-inline': type === typeField.checkboxInline }\">\n <input type=\"checkbox\" [id]=\"name + '_' + opt.value\" [value]=\"opt.value\" (change)=\"onCheckboxChange($event)\"\n [checked]=\"control.value?.includes(opt.value)\" class=\"field-check-input\"\n [attr.aria-required]=\"isRequired\"\n [attr.aria-invalid]=\"control.invalid && control.touched\"\n [attr.aria-describedby]=\"getDescribedBy(control)\"\n [attr.disabled]=\"(isEffectivelyDisabled || opt.disabled) ? 'disabled' : null\" />\n <label [for]=\"name + '_' + opt.value\" class=\"field-check-label\">\n {{ opt.label | translate }}\n @if(isRequired) {\n <span class=\"text-danger\">*</span>\n }\n </label>\n </li>\n }\n </ul>\n </fieldset>\n }\n }\n\n <!-- Checkbox button -->\n @if (type === typeField.checkboxButton && options.length > 0) {\n\n @if(options.length > 1) {\n <fieldset [attr.aria-labelledby]=\"hasFieldTooltip ? legendId : null\"\n [attr.aria-required]=\"isRequired\"\n [attr.aria-invalid]=\"control.invalid && control.touched\"\n [attr.aria-describedby]=\"getDescribedBy(control)\">\n <legend class=\"field-label\" [class.visually-hidden]=\"!displayLabel\" [class.d-flex-h]=\"hasFieldTooltip\" [class.gap-2xs]=\"hasFieldTooltip\">\n <span [id]=\"legendId\">\n {{label | translate}}\n @if(isRequired) {\n <span class=\"text-danger\">*</span>\n }\n </span>\n @if (hasFieldTooltip) {\n <ng-container *ngTemplateOutlet=\"fieldTooltip\"></ng-container>\n }\n </legend>\n <div class=\"field-group field-group-btn\">\n @for (opt of options; track opt.value) {\n <input type=\"checkbox\" [id]=\"name + '_' + opt.value\" [value]=\"opt.value\" (change)=\"onCheckboxChange($event)\"\n [checked]=\"control.value?.includes(opt.value)\" class=\"visually-hidden\"\n [attr.disabled]=\"(isEffectivelyDisabled || opt.disabled) ? 'disabled' : null\" />\n <label [for]=\"name + '_' + opt.value\" class=\"btn btn-field-group\">{{ opt.label | translate }}</label>\n }\n </div>\n </fieldset>\n }\n @else {\n <fieldset [attr.aria-labelledby]=\"hasFieldTooltip ? legendId : null\">\n <legend class=\"field-label\" [class.visually-hidden]=\"!displayLabel\" [class.d-flex-h]=\"hasFieldTooltip\" [class.gap-2xs]=\"hasFieldTooltip\">\n <span [id]=\"legendId\">\n {{label | translate}}\n </span>\n @if (hasFieldTooltip) {\n <ng-container *ngTemplateOutlet=\"fieldTooltip\"></ng-container>\n }\n </legend>\n <div class=\"btn-group btn-group-secondary\">\n @for (opt of options; track opt.value) {\n <input type=\"checkbox\" [id]=\"name + '_' + opt.value\" [value]=\"opt.value\" (change)=\"onCheckboxChange($event)\"\n [checked]=\"control.value?.includes(opt.value)\" class=\"visually-hidden\"\n [attr.aria-required]=\"isRequired\"\n [attr.aria-invalid]=\"control.invalid && control.touched\"\n [attr.aria-describedby]=\"getDescribedBy(control)\"\n [attr.disabled]=\"(isEffectivelyDisabled || opt.disabled) ? 'disabled' : null\"/>\n <label [for]=\"name + '_' + opt.value\" class=\"btn btn-field-group\">\n {{ opt.label | translate}}\n @if(isRequired) {\n <span class=\"text-danger\">*</span>\n }\n </label>\n }\n </div>\n </fieldset>\n }\n }\n\n <!-- Period - DateToDate / TimeToTime / DateTimeToDateTime -->\n @if (isPeriod) {\n <!-- Fieldset : le legend nomme la p\u00E9riode, \u00AB Du \u00BB / \u00AB au \u00BB sont les labels de chaque input. -->\n <fieldset [attr.aria-labelledby]=\"hasFieldTooltip ? legendId : null\">\n <legend class=\"field-label\" [class.visually-hidden]=\"!displayLabel\" [class.d-flex-h]=\"hasFieldTooltip\" [class.gap-2xs]=\"hasFieldTooltip\">\n <span [id]=\"legendId\">\n {{label | translate}}\n <!-- Deux bornes obligatoires : ast\u00E9risque sur la p\u00E9riode ; une seule : sur sa borne. -->\n @if(isStartRequired && isEndRequired) {\n <span class=\"text-danger\">*</span>\n }\n </span>\n @if (hasFieldTooltip) {\n <ng-container *ngTemplateOutlet=\"fieldTooltip\"></ng-container>\n }\n </legend>\n <div class=\"field-group\">\n <label class=\"field-group-addon-left\" [for]=\"name + '_start'\">\n {{ '_COMMON._DATES.FROM_TO_1' | translate }}\n @if(isStartRequired && !isEndRequired) {\n <span class=\"text-danger\">*</span>\n }\n </label>\n <input [type]=\"getInputType()\" class=\"field-control\" [id]=\"name + '_start'\" [formControl]=\"getControl('start')!\"\n [attr.title]=\"fieldTitle ? (fieldTitle | translate) + ' \u2013 ' + ('_COMMON._DATES.FROM_TO_1' | translate) : null\"\n [attr.placeholder]=\"type === typeField.timeToTime ? ('_COMMON._DATES.FROM' | translate) : ('_COMMON._DATES.FROM_TO_1' | translate)\"\n [ngClass]=\"[(cssClass || ''), getControl('start')?.value ? 'has-value' : '']\"\n [attr.required]=\"isStartRequired ? 'required' : null\" [attr.readonly]=\"isReadonly ? 'readonly' : null\"\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\" [attr.aria-required]=\"isStartRequired\"\n [attr.min]=\"minStartAttr\" [attr.max]=\"maxStartAttr\" [attr.step]=\"stepAttr\"\n [attr.autocomplete]=\"autocomplete\"\n [attr.aria-invalid]=\"getControl('start')?.invalid && getControl('start')?.touched\"\n [attr.aria-describedby]=\"getDescribedBy(getControl('start'))\"\n (focus)=\"onFocusRange('start')\" (blur)=\"onBlurRange('start')\" />\n\n @if(getControl('start')?.value && !isDisabledOrReadonly) {\n <button type=\"button\" class=\"btn btn-secondary btn-clear-field\"\n [attr.aria-label]=\"'_COMMON._FORM.CLEAR_START' | translate: { label: label | translate }\"\n (click)=\"onClearFieldPeriod('start')\">\n <span aria-hidden=\"true\">&times;</span>\n </button>\n }\n <label class=\"field-group-addon-center\" [for]=\"name + '_end'\">\n {{ '_COMMON._DATES.FROM_TO_2' | translate }}\n @if(isEndRequired && !isStartRequired) {\n <span class=\"text-danger\">*</span>\n }\n </label>\n <input [type]=\"getInputType()\" class=\"field-control\" [id]=\"name + '_end'\" [formControl]=\"getControl('end')!\"\n [attr.title]=\"fieldTitle ? (fieldTitle | translate) + ' \u2013 ' + ('_COMMON._DATES.FROM_TO_2' | translate) : null\"\n [attr.placeholder]=\"type === typeField.timeToTime ? ('_COMMON._DATES.TO' | translate) : ('_COMMON._DATES.FROM_TO_2' | translate)\"\n [ngClass]=\"[(cssClass || ''), getControl('end')?.value ? 'has-value' : '']\"\n [attr.required]=\"isEndRequired ? 'required' : null\" [attr.readonly]=\"isReadonly ? 'readonly' : null\"\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\" [attr.aria-required]=\"isEndRequired\"\n [attr.min]=\"minEndAttr\" [attr.max]=\"maxEndAttr\" [attr.step]=\"stepAttr\"\n [attr.autocomplete]=\"autocomplete\"\n [attr.aria-invalid]=\"getControl('end')?.invalid && getControl('end')?.touched\"\n [attr.aria-describedby]=\"getDescribedBy(getControl('end'))\"\n (focus)=\"onFocusRange('end')\" (blur)=\"onBlurRange('end')\" />\n\n @if(getControl('end')?.value && !isDisabledOrReadonly) {\n <button type=\"button\" class=\"btn btn-ghost btn-clear-field\"\n [attr.aria-label]=\"'_COMMON._FORM.CLEAR_END' | translate: { label: label | translate }\"\n (click)=\"onClearFieldPeriod('end')\">\n <span aria-hidden=\"true\">&times;</span>\n </button>\n }\n </div>\n </fieldset>\n }\n\n @if ([typeField.datePlusOne, typeField.datePlusTwo, typeField.datePlusSeven, typeField.dateComplexe].includes(type)) {\n\n <div class=\"field-group\">\n @if (type === typeField.dateComplexe) {\n <div class=\"field-group-addon-left\">\n <button class=\"btn btn-ghost\" type=\"button\" (click)=\"onDateAddDay('prev')\"\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\">\n <cw-icon font=\"optyweb\" [icon]=\"spriteIcon.nextLeft\" [label]=\"'Jour pr\u00E9c\u00E9dent'\"></cw-icon>\n </button>\n </div>\n }\n\n <input type=\"date\" class=\"field-control\" [id]=\"name\" [formControl]=\"formControl\"\n [attr.title]=\"fieldTitle ? (fieldTitle | translate) : null\"\n [ngClass]=\"[(cssClass || ''), formControl?.value ? 'has-value' : '']\"\n [attr.placeholder]=\"placeholder ? (placeholder | translate) : null\" [attr.required]=\"isRequired ? 'required' : null\"\n [attr.readonly]=\"isReadonly ? 'readonly' : null\" [attr.aria-required]=\"isRequired\"\n [attr.min]=\"minAttr\" [attr.max]=\"maxAttr\" [attr.step]=\"stepAttr\"\n [attr.autocomplete]=\"autocomplete\"\n [attr.aria-invalid]=\"control.invalid && control.touched\"\n [attr.aria-describedby]=\"getDescribedBy(control)\"\n (focus)=\"onFocus()\" (blur)=\"onBlur()\" />\n\n @if(formControl?.value && !isDisabledOrReadonly) {\n <button class=\"btn btn-ghost btn-clear-field\" type=\"button\"\n [attr.aria-label]=\"'_COMMON._FORM.CLEAR_FIELD' | translate: { label: label | translate }\"\n (click)=\"onClearField(formControl)\"><span aria-hidden=\"true\">&times;</span></button>\n }\n\n\n @if (type === typeField.dateComplexe) {\n <div class=\"field-group-addon-right\">\n <button class=\"btn btn-ghost\" type=\"button\" (click)=\"onDateAddDay('next')\"\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\">\n <cw-icon font=\"optyweb\" [icon]=\"spriteIcon.nextRight\" [label]=\"'Jour suivant'\"></cw-icon>\n </button>\n </div>\n <div class=\"field-group-addon-right\">\n <button class=\"btn btn-ghost\" type=\"button\" (click)=\"onRefresh()\"\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\">\n <cw-icon font=\"optyweb\" [icon]=\"spriteIcon.toolbarRefresh\" [label]=\"'Rafra\u00EEchir'\"></cw-icon>\n </button>\n </div>\n }\n\n <div class=\"field-group-addon-right\">\n <button class=\"btn btn-ghost\" type=\"button\" (click)=\"onTodayAddDay(0)\"\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\">\n J\n <span class=\"visually-hidden\">Aujourd'hui</span>\n </button>\n </div>\n <div class=\"field-group-addon-right\">\n <button class=\"btn btn-ghost\" type=\"button\" (click)=\"onTodayAddDay(1)\"\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\">\n J+1\n <span class=\"visually-hidden\">Demain</span>\n </button>\n </div>\n\n @if (type !== typeField.datePlusOne && type !== typeField.dateComplexe) {\n <div class=\"field-group-addon-right\">\n <button class=\"btn btn-ghost \" type=\"button\" (click)=\"onTodayAddDay(2)\"\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\">\n J+2\n <span class=\"visually-hidden\">Dans 2 jours</span>\n </button>\n </div>\n\n @if (type !== typeField.datePlusTwo) {\n <div class=\"field-group-addon-right\">\n <button class=\"btn btn-ghost\" type=\"button\" (click)=\"onTodayAddDay(7)\"\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\">\n J+7\n <span class=\"visually-hidden\">Dans 7 jours</span>\n </button>\n </div>\n }\n }\n </div>\n }\n\n @if (type === typeField.slider) {\n <ngx-slider [(value)]=\"sliderValue\" [options]=\"sliderOptions\" [formControl]=\"formControl\"></ngx-slider>\n }\n\n @if (type === typeField.range) {\n <div class=\"slider\">\n\n <cw-button [isDisabled]=\"formControl.value <= rangeOptions.floor\" [label]=\"'Diminuer ' + formControl.value + ' ' + label\"\n [withIcon]=\"spriteIcon.toolbarMinus\" [withOnlyIcon]=\"true\" [type]=\"buttonType.primary\"\n [iconSize]=\"buttonIconSize.small\" (btnAction)=\"onRangeStep('decrease')\">\n </cw-button>\n\n <div class=\"slider-input\">\n <label [for]=\"name\" class=\"slider-tooltip\" [style.left]=\"getRangePercent() + '%'\" aria-live=\"polite\"\n aria-atomic=\"true\">\n {{ label | translate }} {{ formControl.value }}\n @if (rangeOptions.unit) {\n <abbr [title]=\"rangeOptions.unit\">{{ rangeOptions.unit }}</abbr>\n }\n </label>\n\n <div class=\"slider-custom-bar\">\n <div class=\"slider-custom-bar-selection\" [style.width]=\"getRangePercent() + '%'\">\n </div>\n </div>\n\n <input type=\"range\" [id]=\"name\" [formControl]=\"formControl\" [min]=\"rangeOptions.floor\" [max]=\"rangeOptions.ceil\"\n [step]=\"rangeOptions.step || 1\" class=\"field-control-range\" [attr.aria-required]=\"isRequired\"\n [attr.aria-invalid]=\"control.invalid && control.touched\">\n </div>\n\n <cw-button [isDisabled]=\"formControl.value >= rangeOptions.ceil\" [label]=\"'Augmenter ' + formControl.value + ' ' + label\"\n [withIcon]=\"spriteIcon.toolbarPlus\" [withOnlyIcon]=\"true\" [type]=\"buttonType.primary\"\n [iconSize]=\"buttonIconSize.small\" (btnAction)=\"onRangeStep('increase')\">\n </cw-button>\n </div>\n }\n\n @if (isInInputGroup() && clearable && !isDisabledOrReadonly && type !== typeField.autocompleteMultiple) {\n @if (type === typeField.autocomplete) {\n @if (autocompleteRef()?.hasAnyContent()) {\n <button class=\"btn btn-secondary btn-clear-field\" type=\"button\"\n [attr.aria-label]=\"'_COMMON._FORM.CLEAR_FIELD' | translate: { label: label | translate }\"\n (click)=\"onClearAutocomplete()\"><span aria-hidden=\"true\">&times;</span></button>\n }\n } @else if (type === typeField.ngSelectMultiple) {\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. -->\n @if (formControl?.value?.length) {\n <button class=\"btn btn-ghost btn-clear-field\" type=\"button\"\n [attr.aria-label]=\"'_COMMON._FORM.CLEAR_FIELD' | translate: { label: label | translate }\"\n (click)=\"onClearField(formControl)\"><span aria-hidden=\"true\">&times;</span></button>\n }\n } @else {\n @if(formControl?.value) {\n <button class=\"btn btn-ghost btn-clear-field\" type=\"button\"\n [attr.aria-label]=\"'_COMMON._FORM.CLEAR_FIELD' | translate: { label: label | translate }\"\n (click)=\"onClearField(formControl)\"><span aria-hidden=\"true\">&times;</span></button>\n }\n }\n }\n\n</ng-template>\n\n<ng-template #fieldLabel>\n <label [for]=\"name\" class=\"field-label\" [class.visually-hidden]=\"!displayLabel\">\n {{ label | translate }}\n\n @if (isRequired) {\n <span class=\"text-danger\">*</span>\n }\n </label>\n</ng-template>\n\n<!-- Bouton d'aide (tooltip) partage label/legend. Hors du <label> (sinon son libelle\n s'ajoute au nom du champ et le clic active le label) ; dans un <legend>, le fieldset\n est nomme par aria-labelledby sur le seul texte (legendId) pour la meme raison. -->\n<ng-template #fieldTooltip>\n <button type=\"button\" class=\"btn btn-ghost btn-field-tooltip\"\n [cwTooltip]=\"tooltip ?? ''\"\n [attr.data-test-ctw]=\"'tooltip-' + name\">\n <cw-icon [icon]=\"spriteIcon.alertHelp\" [type]=\"iconType.circular\" [iconUiType]=\"iconUiType.info\"\n [iconSize]=\"iconSize.xs\" [label]=\"'_COMMON._FORM.TOOLTIP_HELP' | translate\"></cw-icon>\n </button>\n</ng-template>\n" }]
4409
4476
  }], ctorParameters: () => [], propDecorators: { control: [{
4410
4477
  type: Input
4411
4478
  }], formGroup: [{
@@ -4438,8 +4505,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.20", ngImpo
4438
4505
  type: Input
4439
4506
  }], isRequired: [{
4440
4507
  type: Input
4508
+ }], requiredStart: [{
4509
+ type: Input
4510
+ }], requiredEnd: [{
4511
+ type: Input
4441
4512
  }], help: [{
4442
4513
  type: Input
4514
+ }], helpParams: [{
4515
+ type: Input
4443
4516
  }], tooltip: [{
4444
4517
  type: Input
4445
4518
  }], ariaDescribedBy: [{
@@ -4755,6 +4828,12 @@ class ModalsComponent {
4755
4828
  this.modalTitle = input(...(ngDevMode ? [undefined, { debugName: "modalTitle" }] : []));
4756
4829
  /** Parametres de traduction de `modalTitle` (ex. `{ count: 3 }`), passes au pipe `translate`. */
4757
4830
  this.modalTitleParams = input(...(ngDevMode ? [undefined, { debugName: "modalTitleParams" }] : []));
4831
+ /**
4832
+ * Sous-titre du header (`default` / `sidepanel`), meme rendu que `cw-card` : texte brut
4833
+ * (interpole, non traduit), relie au dialog par `aria-describedby`.
4834
+ */
4835
+ this.modalSubtitle = input(...(ngDevMode ? [undefined, { debugName: "modalSubtitle" }] : []));
4836
+ this.subtitleId = uniqueId('modal-subtitle');
4758
4837
  this.itemsToDelete = input([], ...(ngDevMode ? [{ debugName: "itemsToDelete" }] : []));
4759
4838
  this.itemsToDeleteTitle = input('_COMMON._MODAL_DELETE.DEFAULT_TYPE', ...(ngDevMode ? [{ debugName: "itemsToDeleteTitle" }] : []));
4760
4839
  this.labelBtnAction1 = input(...(ngDevMode ? [undefined, { debugName: "labelBtnAction1" }] : []));
@@ -4972,13 +5051,32 @@ class ModalsComponent {
4972
5051
  this.destroyRef.onDestroy(unlisten);
4973
5052
  }
4974
5053
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: ModalsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
4975
- 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 }, modalTitleParams: { classPropertyName: "modalTitleParams", publicName: "modalTitleParams", 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 }, closeLocked: { classPropertyName: "closeLocked", publicName: "closeLocked", isSignal: true, isRequired: false, transformFunction: null }, closeLockedMessage: { classPropertyName: "closeLockedMessage", publicName: "closeLockedMessage", isSignal: true, isRequired: false, transformFunction: null }, keepOpenOnAction1: { classPropertyName: "keepOpenOnAction1", publicName: "keepOpenOnAction1", isSignal: true, isRequired: false, transformFunction: null }, keepOpenOnAction2: { classPropertyName: "keepOpenOnAction2", publicName: "keepOpenOnAction2", 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>\r\n\r\n<div role=\"dialog\" tabindex=\"-1\" aria-modal=\"true\"\r\n [attr.aria-labelledby]=\"type() === modalsType.loader ? null : titleId\"\r\n [attr.aria-label]=\"type() === modalsType.loader ? ('_COMMON._HTTP.TXT_LOADING' | translate) : null\"\r\n class=\"cityway-v8 d-flex modal show\" [ngClass]=\"customClass()\" data-test-ctw=\"modal\" (keydown)=\"onKeyDown($event)\">\r\n\r\n <!-- Backdrop : fermeture a la souris (confort). Le clavier (Escape) est gere\r\n par onKeyDown du dialog ; le backdrop n'est pas un element interactif focusable.\r\n requestClose() applique le verrou (cf. isCloseLocked) : plus de test sur le type ici. -->\r\n <!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events, @angular-eslint/template/interactive-supports-focus -->\r\n <div class=\"modal-inner-backdrop\" (click)=\"requestClose()\"></div>\r\n\r\n <div #modalContainer role=\"document\" class=\"modal-dialog\"\r\n [ngClass]=\"['modal-' + size(), scrollable() ? 'modal-dialog-scrollable' : '']\">\r\n\r\n <div class=\"modal-content\">\r\n\r\n <!-- Verrou actif : region live qui annonce chaque tentative de fermeture refusee\r\n (Echap, backdrop, croix). Rendue vide au repos car une region live doit\r\n pre-exister dans le DOM pour que son remplissage soit annonce. Absente pour\r\n le loader, qui possede deja la sienne dans cw-loader. -->\r\n @if (showCloseLockedStatus()) {\r\n <span class=\"visually-hidden\" role=\"status\" aria-live=\"polite\">{{ closeLockedAnnouncement() | translate }}</span>\r\n }\r\n\r\n @if (type() === modalsType.loader) {\r\n <div class=\"modal-body\">\r\n <cw-loader></cw-loader>\r\n </div>\r\n }\r\n @else {\r\n @if (isStateLike()) {\r\n <!-- state + delete : close en absolu (top-right, hors flux donc ne reserve\r\n pas de hauteur), body centre avec le picto de statut EN TETE du flux\r\n (il pousse donc le titre normalement) -->\r\n <!-- aria-disabled + .disabled (Bootstrap) plutot que `disabled` natif : la croix\r\n reste focusable et annoncee \u00AB desactivee \u00BB, et le focus trap conserve une\r\n cible. Un `disabled` natif la sortirait du selecteur de focusables. -->\r\n <button type=\"button\" class=\"btn-close modal-close-floating\" [attr.aria-label]=\"'_COMMON._ACTION.CLOSE' | translate\"\r\n [class.disabled]=\"isCloseLocked()\" [attr.aria-disabled]=\"isCloseLocked() ? 'true' : null\"\r\n (click)=\"requestClose()\" data-test-ctw=\"btn-close-modal\">\r\n <cw-icon [icon]=\"spriteIcon.toolbarClose\" [iconSize]=\"iconSize['lg']\" [type]=\"iconType.default\" aria-hidden=\"true\"></cw-icon>\r\n </button>\r\n\r\n <div class=\"modal-body modal-body-state d-flex-v gap-md items-center\" [class.modal-text-center]=\"isBodyCentered()\">\r\n <cw-icon [icon]=\"statusIcon()\" [iconSize]=\"iconSize['xl']\" [type]=\"iconType.square\"\r\n [iconUiType]=\"statusUiType()\" aria-hidden=\"true\"></cw-icon>\r\n\r\n <h1 class=\"modal-title\" [id]=\"titleId\">\r\n @if (type() === modalsType.delete) {\r\n {{ '_COMMON._MODAL_DELETE.TITLE' | translate: { number: itemsToDelete().length, name: itemsToDeleteTitle() | translate } }}\r\n }\r\n @else {\r\n {{ (modalTitle() ?? '') | translate: modalTitleParams() }}\r\n }\r\n </h1>\r\n\r\n @if (type() === modalsType.delete) {\r\n <!-- zone delete en dur : texte + liste + avertissement, pleine largeur aligne a gauche -->\r\n <div class=\"w-100 d-flex-v gap-md\">\r\n @if (itemsToDelete().length > 1) {\r\n <div [innerHTML]=\"'_COMMON._MODAL_DELETE.MULTIPLE_TEXT' | translate\"></div>\r\n }\r\n @else {\r\n <div [innerHTML]=\"'_COMMON._MODAL_DELETE.SIMPLE_TEXT' | translate\"></div>\r\n }\r\n\r\n @if (itemsToDelete().length > 0) {\r\n <ul class=\"mb-none\">\r\n @for (item of itemsToDelete(); track item) {\r\n <li>{{ item }}</li>\r\n }\r\n </ul>\r\n }\r\n\r\n <div [innerHTML]=\"'_COMMON._MODAL_DELETE.IRREVERSIBLE' | translate\"></div>\r\n </div>\r\n }\r\n\r\n @if (customBodyTemplate()) {\r\n <div class=\"w-100\">\r\n <ng-container [ngTemplateOutlet]=\"customBodyTemplate()\" [ngTemplateOutletContext]=\"customBodyContext()\">\r\n </ng-container>\r\n </div>\r\n }\r\n </div>\r\n }\r\n @else {\r\n <!-- default + sidepanel : header titre + close, body = contenu libre (slot) -->\r\n <div class=\"modal-header\">\r\n <h1 class=\"modal-title\" [id]=\"titleId\">\r\n {{ (modalTitle() ?? '') | translate: modalTitleParams() }}\r\n </h1>\r\n\r\n <!-- cf. croix state/delete : aria-disabled, pas `disabled` natif -->\r\n <button type=\"button\" class=\"btn-close\" [attr.aria-label]=\"'_COMMON._ACTION.CLOSE' | translate\"\r\n [class.disabled]=\"isCloseLocked()\" [attr.aria-disabled]=\"isCloseLocked() ? 'true' : null\"\r\n (click)=\"requestClose()\" data-test-ctw=\"btn-close-modal\">\r\n <cw-icon [icon]=\"spriteIcon.toolbarClose\" [iconSize]=\"iconSize['lg']\" [type]=\"iconType.default\" aria-hidden=\"true\"></cw-icon>\r\n </button>\r\n </div>\r\n\r\n <div class=\"modal-body d-flex-v gap-md\">\r\n @if (customBodyTemplate()) {\r\n <ng-container [ngTemplateOutlet]=\"customBodyTemplate()\" [ngTemplateOutletContext]=\"customBodyContext()\">\r\n </ng-container>\r\n }\r\n </div>\r\n }\r\n\r\n <!-- footer commun : secondaire a gauche, primaire/danger a droite (ordre DS) -->\r\n <div class=\"modal-footer\">\r\n @if (type() === modalsType.delete) {\r\n <cw-button label=\"_COMMON._ACTION.CLOSE\" [type]=\"buttonTypeEnum.secondary\"\r\n [isDisabled]=\"isCloseLocked()\" (btnAction)=\"requestClose()\" dataTest=\"btn-close-modal\">\r\n </cw-button>\r\n\r\n <cw-button label=\"_COMMON._ACTION.DELETE\" [type]=\"buttonTypeEnum.danger\"\r\n [isDisabled]=\"disableBtnAction1()\" (btnAction)=\"action1Click()\" dataTest=\"btn-action-modal\">\r\n </cw-button>\r\n }\r\n @else {\r\n @if (labelBtnAction2()) {\r\n <cw-button [label]=\"labelBtnAction2()\" [type]=\"buttonTypeEnum.secondary\"\r\n [isDisabled]=\"disableBtnAction2()\" (btnAction)=\"action2Click()\" dataTest=\"btn-action-modal\">\r\n </cw-button>\r\n }\r\n @else {\r\n <!-- Bouton de repli : il occupe la place de l'action 2, il applique donc\r\n disableBtnAction2 (auparavant le seul bouton du composant a ignorer\r\n son input de desactivation). -->\r\n <cw-button label=\"_COMMON._ACTION.CLOSE\" [type]=\"buttonTypeEnum.secondary\"\r\n [isDisabled]=\"isCloseLocked() || disableBtnAction2()\"\r\n (btnAction)=\"fallbackCloseClick()\" dataTest=\"btn-close-modal\">\r\n </cw-button>\r\n }\r\n @if (labelBtnAction1()) {\r\n <cw-button [label]=\"labelBtnAction1()\" [type]=\"buttonTypeEnum.primary\"\r\n [isDisabled]=\"disableBtnAction1()\" (btnAction)=\"action1Click()\" dataTest=\"btn-action-modal\">\r\n </cw-button>\r\n }\r\n }\r\n </div>\r\n }\r\n\r\n </div>\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: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "ngmodule", type: TranslateModule }, { kind: "component", type: ButtonComponent, selector: "cw-button", inputs: ["type", "label", "labelParams", "id", "link", "isDropdown", "hideCaret", "withIcon", "withOnlyIcon", "iconSize", "iconPosition", "dropdownPosition", "isMinWidth", "isDisabled", "isLoading", "loadingAnnounce", "cssClass", "dataTest", "skeletonMode", "isPressed", "ariaDescribedBy", "ariaLabel", "ariaExpanded", "ariaControls", "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", "text", "label", "type", "iconSize", "iconCssClass", "iconUiType", "iconColorCustom", "spritePath"] }, { kind: "pipe", type: i2.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
5054
+ 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 }, modalTitleParams: { classPropertyName: "modalTitleParams", publicName: "modalTitleParams", isSignal: true, isRequired: false, transformFunction: null }, modalSubtitle: { classPropertyName: "modalSubtitle", publicName: "modalSubtitle", 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 }, closeLocked: { classPropertyName: "closeLocked", publicName: "closeLocked", isSignal: true, isRequired: false, transformFunction: null }, closeLockedMessage: { classPropertyName: "closeLockedMessage", publicName: "closeLockedMessage", isSignal: true, isRequired: false, transformFunction: null }, keepOpenOnAction1: { classPropertyName: "keepOpenOnAction1", publicName: "keepOpenOnAction1", isSignal: true, isRequired: false, transformFunction: null }, keepOpenOnAction2: { classPropertyName: "keepOpenOnAction2", publicName: "keepOpenOnAction2", 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>\r\n\r\n<div role=\"dialog\" tabindex=\"-1\" aria-modal=\"true\"\r\n [attr.aria-labelledby]=\"type() === modalsType.loader ? null : titleId\"\r\n [attr.aria-label]=\"type() === modalsType.loader ? ('_COMMON._HTTP.TXT_LOADING' | translate) : null\"\r\n [attr.aria-describedby]=\"modalSubtitle() && !isStateLike() && type() !== modalsType.loader ? subtitleId : null\"\r\n class=\"cityway-v8 d-flex modal show\" [ngClass]=\"customClass()\" data-test-ctw=\"modal\" (keydown)=\"onKeyDown($event)\">\r\n\r\n <!-- Backdrop : fermeture a la souris (confort). Le clavier (Escape) est gere\r\n par onKeyDown du dialog ; le backdrop n'est pas un element interactif focusable.\r\n requestClose() applique le verrou (cf. isCloseLocked) : plus de test sur le type ici. -->\r\n <!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events, @angular-eslint/template/interactive-supports-focus -->\r\n <div class=\"modal-inner-backdrop\" (click)=\"requestClose()\"></div>\r\n\r\n <div #modalContainer role=\"document\" class=\"modal-dialog\"\r\n [ngClass]=\"['modal-' + size(), scrollable() ? 'modal-dialog-scrollable' : '']\">\r\n\r\n <div class=\"modal-content\">\r\n\r\n <!-- Verrou actif : region live qui annonce chaque tentative de fermeture refusee\r\n (Echap, backdrop, croix). Rendue vide au repos car une region live doit\r\n pre-exister dans le DOM pour que son remplissage soit annonce. Absente pour\r\n le loader, qui possede deja la sienne dans cw-loader. -->\r\n @if (showCloseLockedStatus()) {\r\n <span class=\"visually-hidden\" role=\"status\" aria-live=\"polite\">{{ closeLockedAnnouncement() | translate }}</span>\r\n }\r\n\r\n @if (type() === modalsType.loader) {\r\n <div class=\"modal-body\">\r\n <cw-loader></cw-loader>\r\n </div>\r\n }\r\n @else {\r\n @if (isStateLike()) {\r\n <!-- state + delete : close en absolu (top-right, hors flux donc ne reserve\r\n pas de hauteur), body centre avec le picto de statut EN TETE du flux\r\n (il pousse donc le titre normalement) -->\r\n <!-- aria-disabled + .disabled (Bootstrap) plutot que `disabled` natif : la croix\r\n reste focusable et annoncee \u00AB desactivee \u00BB, et le focus trap conserve une\r\n cible. Un `disabled` natif la sortirait du selecteur de focusables. -->\r\n <button type=\"button\" class=\"btn-close modal-close-floating\" [attr.aria-label]=\"'_COMMON._ACTION.CLOSE' | translate\"\r\n [class.disabled]=\"isCloseLocked()\" [attr.aria-disabled]=\"isCloseLocked() ? 'true' : null\"\r\n (click)=\"requestClose()\" data-test-ctw=\"btn-close-modal\">\r\n <cw-icon [icon]=\"spriteIcon.toolbarClose\" [iconSize]=\"iconSize['lg']\" [type]=\"iconType.default\" aria-hidden=\"true\"></cw-icon>\r\n </button>\r\n\r\n <div class=\"modal-body modal-body-state d-flex-v gap-md items-center\" [class.modal-text-center]=\"isBodyCentered()\">\r\n <cw-icon [icon]=\"statusIcon()\" [iconSize]=\"iconSize['xl']\" [type]=\"iconType.square\"\r\n [iconUiType]=\"statusUiType()\" aria-hidden=\"true\"></cw-icon>\r\n\r\n <h1 class=\"modal-title\" [id]=\"titleId\">\r\n @if (type() === modalsType.delete) {\r\n {{ '_COMMON._MODAL_DELETE.TITLE' | translate: { number: itemsToDelete().length, name: itemsToDeleteTitle() | translate } }}\r\n }\r\n @else {\r\n {{ (modalTitle() ?? '') | translate: modalTitleParams() }}\r\n }\r\n </h1>\r\n\r\n @if (type() === modalsType.delete) {\r\n <!-- zone delete en dur : texte + liste + avertissement, pleine largeur aligne a gauche -->\r\n <div class=\"w-100 d-flex-v gap-md\">\r\n @if (itemsToDelete().length > 1) {\r\n <div [innerHTML]=\"'_COMMON._MODAL_DELETE.MULTIPLE_TEXT' | translate\"></div>\r\n }\r\n @else {\r\n <div [innerHTML]=\"'_COMMON._MODAL_DELETE.SIMPLE_TEXT' | translate\"></div>\r\n }\r\n\r\n @if (itemsToDelete().length > 0) {\r\n <ul class=\"mb-none\">\r\n @for (item of itemsToDelete(); track item) {\r\n <li>{{ item }}</li>\r\n }\r\n </ul>\r\n }\r\n\r\n <div [innerHTML]=\"'_COMMON._MODAL_DELETE.IRREVERSIBLE' | translate\"></div>\r\n </div>\r\n }\r\n\r\n @if (customBodyTemplate()) {\r\n <div class=\"w-100\">\r\n <ng-container [ngTemplateOutlet]=\"customBodyTemplate()\" [ngTemplateOutletContext]=\"customBodyContext()\">\r\n </ng-container>\r\n </div>\r\n }\r\n </div>\r\n }\r\n @else {\r\n <!-- default + sidepanel : header titre + close, body = contenu libre (slot) -->\r\n <div class=\"modal-header\">\r\n <!-- Titre + sous-titre empiles ; sous-titre aux classes du sous-titre de cw-card. -->\r\n <div class=\"flex-1\">\r\n <h1 class=\"modal-title\" [id]=\"titleId\">\r\n {{ (modalTitle() ?? '') | translate: modalTitleParams() }}\r\n </h1>\r\n @if (modalSubtitle(); as subtitle) {\r\n <div class=\"modal-subtitle fs fs-xs text-light\" [id]=\"subtitleId\">{{ subtitle }}</div>\r\n }\r\n </div>\r\n\r\n <!-- cf. croix state/delete : aria-disabled, pas `disabled` natif -->\r\n <button type=\"button\" class=\"btn-close\" [attr.aria-label]=\"'_COMMON._ACTION.CLOSE' | translate\"\r\n [class.disabled]=\"isCloseLocked()\" [attr.aria-disabled]=\"isCloseLocked() ? 'true' : null\"\r\n (click)=\"requestClose()\" data-test-ctw=\"btn-close-modal\">\r\n <cw-icon [icon]=\"spriteIcon.toolbarClose\" [iconSize]=\"iconSize['lg']\" [type]=\"iconType.default\" aria-hidden=\"true\"></cw-icon>\r\n </button>\r\n </div>\r\n\r\n <div class=\"modal-body d-flex-v gap-md\">\r\n @if (customBodyTemplate()) {\r\n <ng-container [ngTemplateOutlet]=\"customBodyTemplate()\" [ngTemplateOutletContext]=\"customBodyContext()\">\r\n </ng-container>\r\n }\r\n </div>\r\n }\r\n\r\n <!-- footer commun : secondaire a gauche, primaire/danger a droite (ordre DS) -->\r\n <div class=\"modal-footer\">\r\n @if (type() === modalsType.delete) {\r\n <cw-button label=\"_COMMON._ACTION.CLOSE\" [type]=\"buttonTypeEnum.secondary\"\r\n [isDisabled]=\"isCloseLocked()\" (btnAction)=\"requestClose()\" dataTest=\"btn-close-modal\">\r\n </cw-button>\r\n\r\n <cw-button label=\"_COMMON._ACTION.DELETE\" [type]=\"buttonTypeEnum.danger\"\r\n [isDisabled]=\"disableBtnAction1()\" (btnAction)=\"action1Click()\" dataTest=\"btn-action-modal\">\r\n </cw-button>\r\n }\r\n @else {\r\n @if (labelBtnAction2()) {\r\n <cw-button [label]=\"labelBtnAction2()\" [type]=\"buttonTypeEnum.secondary\"\r\n [isDisabled]=\"disableBtnAction2()\" (btnAction)=\"action2Click()\" dataTest=\"btn-action-modal\">\r\n </cw-button>\r\n }\r\n @else {\r\n <!-- Bouton de repli : il occupe la place de l'action 2, il applique donc\r\n disableBtnAction2 (auparavant le seul bouton du composant a ignorer\r\n son input de desactivation). -->\r\n <cw-button label=\"_COMMON._ACTION.CLOSE\" [type]=\"buttonTypeEnum.secondary\"\r\n [isDisabled]=\"isCloseLocked() || disableBtnAction2()\"\r\n (btnAction)=\"fallbackCloseClick()\" dataTest=\"btn-close-modal\">\r\n </cw-button>\r\n }\r\n @if (labelBtnAction1()) {\r\n <cw-button [label]=\"labelBtnAction1()\" [type]=\"buttonTypeEnum.primary\"\r\n [isDisabled]=\"disableBtnAction1()\" (btnAction)=\"action1Click()\" dataTest=\"btn-action-modal\">\r\n </cw-button>\r\n }\r\n }\r\n </div>\r\n }\r\n\r\n </div>\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: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "ngmodule", type: TranslateModule }, { kind: "component", type: ButtonComponent, selector: "cw-button", inputs: ["type", "label", "labelParams", "id", "link", "isDropdown", "hideCaret", "withIcon", "withOnlyIcon", "iconSize", "iconPosition", "dropdownPosition", "isMinWidth", "isDisabled", "isLoading", "loadingAnnounce", "cssClass", "dataTest", "skeletonMode", "isPressed", "ariaDescribedBy", "ariaLabel", "ariaExpanded", "ariaControls", "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", "text", "label", "type", "iconSize", "iconCssClass", "iconUiType", "iconColorCustom", "spritePath"] }, { kind: "pipe", type: i2.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
4976
5055
  }
4977
5056
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: ModalsComponent, decorators: [{
4978
5057
  type: Component,
4979
- 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>\r\n\r\n<div role=\"dialog\" tabindex=\"-1\" aria-modal=\"true\"\r\n [attr.aria-labelledby]=\"type() === modalsType.loader ? null : titleId\"\r\n [attr.aria-label]=\"type() === modalsType.loader ? ('_COMMON._HTTP.TXT_LOADING' | translate) : null\"\r\n class=\"cityway-v8 d-flex modal show\" [ngClass]=\"customClass()\" data-test-ctw=\"modal\" (keydown)=\"onKeyDown($event)\">\r\n\r\n <!-- Backdrop : fermeture a la souris (confort). Le clavier (Escape) est gere\r\n par onKeyDown du dialog ; le backdrop n'est pas un element interactif focusable.\r\n requestClose() applique le verrou (cf. isCloseLocked) : plus de test sur le type ici. -->\r\n <!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events, @angular-eslint/template/interactive-supports-focus -->\r\n <div class=\"modal-inner-backdrop\" (click)=\"requestClose()\"></div>\r\n\r\n <div #modalContainer role=\"document\" class=\"modal-dialog\"\r\n [ngClass]=\"['modal-' + size(), scrollable() ? 'modal-dialog-scrollable' : '']\">\r\n\r\n <div class=\"modal-content\">\r\n\r\n <!-- Verrou actif : region live qui annonce chaque tentative de fermeture refusee\r\n (Echap, backdrop, croix). Rendue vide au repos car une region live doit\r\n pre-exister dans le DOM pour que son remplissage soit annonce. Absente pour\r\n le loader, qui possede deja la sienne dans cw-loader. -->\r\n @if (showCloseLockedStatus()) {\r\n <span class=\"visually-hidden\" role=\"status\" aria-live=\"polite\">{{ closeLockedAnnouncement() | translate }}</span>\r\n }\r\n\r\n @if (type() === modalsType.loader) {\r\n <div class=\"modal-body\">\r\n <cw-loader></cw-loader>\r\n </div>\r\n }\r\n @else {\r\n @if (isStateLike()) {\r\n <!-- state + delete : close en absolu (top-right, hors flux donc ne reserve\r\n pas de hauteur), body centre avec le picto de statut EN TETE du flux\r\n (il pousse donc le titre normalement) -->\r\n <!-- aria-disabled + .disabled (Bootstrap) plutot que `disabled` natif : la croix\r\n reste focusable et annoncee \u00AB desactivee \u00BB, et le focus trap conserve une\r\n cible. Un `disabled` natif la sortirait du selecteur de focusables. -->\r\n <button type=\"button\" class=\"btn-close modal-close-floating\" [attr.aria-label]=\"'_COMMON._ACTION.CLOSE' | translate\"\r\n [class.disabled]=\"isCloseLocked()\" [attr.aria-disabled]=\"isCloseLocked() ? 'true' : null\"\r\n (click)=\"requestClose()\" data-test-ctw=\"btn-close-modal\">\r\n <cw-icon [icon]=\"spriteIcon.toolbarClose\" [iconSize]=\"iconSize['lg']\" [type]=\"iconType.default\" aria-hidden=\"true\"></cw-icon>\r\n </button>\r\n\r\n <div class=\"modal-body modal-body-state d-flex-v gap-md items-center\" [class.modal-text-center]=\"isBodyCentered()\">\r\n <cw-icon [icon]=\"statusIcon()\" [iconSize]=\"iconSize['xl']\" [type]=\"iconType.square\"\r\n [iconUiType]=\"statusUiType()\" aria-hidden=\"true\"></cw-icon>\r\n\r\n <h1 class=\"modal-title\" [id]=\"titleId\">\r\n @if (type() === modalsType.delete) {\r\n {{ '_COMMON._MODAL_DELETE.TITLE' | translate: { number: itemsToDelete().length, name: itemsToDeleteTitle() | translate } }}\r\n }\r\n @else {\r\n {{ (modalTitle() ?? '') | translate: modalTitleParams() }}\r\n }\r\n </h1>\r\n\r\n @if (type() === modalsType.delete) {\r\n <!-- zone delete en dur : texte + liste + avertissement, pleine largeur aligne a gauche -->\r\n <div class=\"w-100 d-flex-v gap-md\">\r\n @if (itemsToDelete().length > 1) {\r\n <div [innerHTML]=\"'_COMMON._MODAL_DELETE.MULTIPLE_TEXT' | translate\"></div>\r\n }\r\n @else {\r\n <div [innerHTML]=\"'_COMMON._MODAL_DELETE.SIMPLE_TEXT' | translate\"></div>\r\n }\r\n\r\n @if (itemsToDelete().length > 0) {\r\n <ul class=\"mb-none\">\r\n @for (item of itemsToDelete(); track item) {\r\n <li>{{ item }}</li>\r\n }\r\n </ul>\r\n }\r\n\r\n <div [innerHTML]=\"'_COMMON._MODAL_DELETE.IRREVERSIBLE' | translate\"></div>\r\n </div>\r\n }\r\n\r\n @if (customBodyTemplate()) {\r\n <div class=\"w-100\">\r\n <ng-container [ngTemplateOutlet]=\"customBodyTemplate()\" [ngTemplateOutletContext]=\"customBodyContext()\">\r\n </ng-container>\r\n </div>\r\n }\r\n </div>\r\n }\r\n @else {\r\n <!-- default + sidepanel : header titre + close, body = contenu libre (slot) -->\r\n <div class=\"modal-header\">\r\n <h1 class=\"modal-title\" [id]=\"titleId\">\r\n {{ (modalTitle() ?? '') | translate: modalTitleParams() }}\r\n </h1>\r\n\r\n <!-- cf. croix state/delete : aria-disabled, pas `disabled` natif -->\r\n <button type=\"button\" class=\"btn-close\" [attr.aria-label]=\"'_COMMON._ACTION.CLOSE' | translate\"\r\n [class.disabled]=\"isCloseLocked()\" [attr.aria-disabled]=\"isCloseLocked() ? 'true' : null\"\r\n (click)=\"requestClose()\" data-test-ctw=\"btn-close-modal\">\r\n <cw-icon [icon]=\"spriteIcon.toolbarClose\" [iconSize]=\"iconSize['lg']\" [type]=\"iconType.default\" aria-hidden=\"true\"></cw-icon>\r\n </button>\r\n </div>\r\n\r\n <div class=\"modal-body d-flex-v gap-md\">\r\n @if (customBodyTemplate()) {\r\n <ng-container [ngTemplateOutlet]=\"customBodyTemplate()\" [ngTemplateOutletContext]=\"customBodyContext()\">\r\n </ng-container>\r\n }\r\n </div>\r\n }\r\n\r\n <!-- footer commun : secondaire a gauche, primaire/danger a droite (ordre DS) -->\r\n <div class=\"modal-footer\">\r\n @if (type() === modalsType.delete) {\r\n <cw-button label=\"_COMMON._ACTION.CLOSE\" [type]=\"buttonTypeEnum.secondary\"\r\n [isDisabled]=\"isCloseLocked()\" (btnAction)=\"requestClose()\" dataTest=\"btn-close-modal\">\r\n </cw-button>\r\n\r\n <cw-button label=\"_COMMON._ACTION.DELETE\" [type]=\"buttonTypeEnum.danger\"\r\n [isDisabled]=\"disableBtnAction1()\" (btnAction)=\"action1Click()\" dataTest=\"btn-action-modal\">\r\n </cw-button>\r\n }\r\n @else {\r\n @if (labelBtnAction2()) {\r\n <cw-button [label]=\"labelBtnAction2()\" [type]=\"buttonTypeEnum.secondary\"\r\n [isDisabled]=\"disableBtnAction2()\" (btnAction)=\"action2Click()\" dataTest=\"btn-action-modal\">\r\n </cw-button>\r\n }\r\n @else {\r\n <!-- Bouton de repli : il occupe la place de l'action 2, il applique donc\r\n disableBtnAction2 (auparavant le seul bouton du composant a ignorer\r\n son input de desactivation). -->\r\n <cw-button label=\"_COMMON._ACTION.CLOSE\" [type]=\"buttonTypeEnum.secondary\"\r\n [isDisabled]=\"isCloseLocked() || disableBtnAction2()\"\r\n (btnAction)=\"fallbackCloseClick()\" dataTest=\"btn-close-modal\">\r\n </cw-button>\r\n }\r\n @if (labelBtnAction1()) {\r\n <cw-button [label]=\"labelBtnAction1()\" [type]=\"buttonTypeEnum.primary\"\r\n [isDisabled]=\"disableBtnAction1()\" (btnAction)=\"action1Click()\" dataTest=\"btn-action-modal\">\r\n </cw-button>\r\n }\r\n }\r\n </div>\r\n }\r\n\r\n </div>\r\n </div>\r\n</div>\r\n" }]
4980
- }], 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 }] }], modalTitleParams: [{ type: i0.Input, args: [{ isSignal: true, alias: "modalTitleParams", 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 }] }], closeLocked: [{ type: i0.Input, args: [{ isSignal: true, alias: "closeLocked", required: false }] }], closeLockedMessage: [{ type: i0.Input, args: [{ isSignal: true, alias: "closeLockedMessage", required: false }] }], keepOpenOnAction1: [{ type: i0.Input, args: [{ isSignal: true, alias: "keepOpenOnAction1", required: false }] }], keepOpenOnAction2: [{ type: i0.Input, args: [{ isSignal: true, alias: "keepOpenOnAction2", required: false }] }], btnAction1: [{ type: i0.Output, args: ["btnAction1"] }], btnAction2: [{ type: i0.Output, args: ["btnAction2"] }] } });
5058
+ 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>\r\n\r\n<div role=\"dialog\" tabindex=\"-1\" aria-modal=\"true\"\r\n [attr.aria-labelledby]=\"type() === modalsType.loader ? null : titleId\"\r\n [attr.aria-label]=\"type() === modalsType.loader ? ('_COMMON._HTTP.TXT_LOADING' | translate) : null\"\r\n [attr.aria-describedby]=\"modalSubtitle() && !isStateLike() && type() !== modalsType.loader ? subtitleId : null\"\r\n class=\"cityway-v8 d-flex modal show\" [ngClass]=\"customClass()\" data-test-ctw=\"modal\" (keydown)=\"onKeyDown($event)\">\r\n\r\n <!-- Backdrop : fermeture a la souris (confort). Le clavier (Escape) est gere\r\n par onKeyDown du dialog ; le backdrop n'est pas un element interactif focusable.\r\n requestClose() applique le verrou (cf. isCloseLocked) : plus de test sur le type ici. -->\r\n <!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events, @angular-eslint/template/interactive-supports-focus -->\r\n <div class=\"modal-inner-backdrop\" (click)=\"requestClose()\"></div>\r\n\r\n <div #modalContainer role=\"document\" class=\"modal-dialog\"\r\n [ngClass]=\"['modal-' + size(), scrollable() ? 'modal-dialog-scrollable' : '']\">\r\n\r\n <div class=\"modal-content\">\r\n\r\n <!-- Verrou actif : region live qui annonce chaque tentative de fermeture refusee\r\n (Echap, backdrop, croix). Rendue vide au repos car une region live doit\r\n pre-exister dans le DOM pour que son remplissage soit annonce. Absente pour\r\n le loader, qui possede deja la sienne dans cw-loader. -->\r\n @if (showCloseLockedStatus()) {\r\n <span class=\"visually-hidden\" role=\"status\" aria-live=\"polite\">{{ closeLockedAnnouncement() | translate }}</span>\r\n }\r\n\r\n @if (type() === modalsType.loader) {\r\n <div class=\"modal-body\">\r\n <cw-loader></cw-loader>\r\n </div>\r\n }\r\n @else {\r\n @if (isStateLike()) {\r\n <!-- state + delete : close en absolu (top-right, hors flux donc ne reserve\r\n pas de hauteur), body centre avec le picto de statut EN TETE du flux\r\n (il pousse donc le titre normalement) -->\r\n <!-- aria-disabled + .disabled (Bootstrap) plutot que `disabled` natif : la croix\r\n reste focusable et annoncee \u00AB desactivee \u00BB, et le focus trap conserve une\r\n cible. Un `disabled` natif la sortirait du selecteur de focusables. -->\r\n <button type=\"button\" class=\"btn-close modal-close-floating\" [attr.aria-label]=\"'_COMMON._ACTION.CLOSE' | translate\"\r\n [class.disabled]=\"isCloseLocked()\" [attr.aria-disabled]=\"isCloseLocked() ? 'true' : null\"\r\n (click)=\"requestClose()\" data-test-ctw=\"btn-close-modal\">\r\n <cw-icon [icon]=\"spriteIcon.toolbarClose\" [iconSize]=\"iconSize['lg']\" [type]=\"iconType.default\" aria-hidden=\"true\"></cw-icon>\r\n </button>\r\n\r\n <div class=\"modal-body modal-body-state d-flex-v gap-md items-center\" [class.modal-text-center]=\"isBodyCentered()\">\r\n <cw-icon [icon]=\"statusIcon()\" [iconSize]=\"iconSize['xl']\" [type]=\"iconType.square\"\r\n [iconUiType]=\"statusUiType()\" aria-hidden=\"true\"></cw-icon>\r\n\r\n <h1 class=\"modal-title\" [id]=\"titleId\">\r\n @if (type() === modalsType.delete) {\r\n {{ '_COMMON._MODAL_DELETE.TITLE' | translate: { number: itemsToDelete().length, name: itemsToDeleteTitle() | translate } }}\r\n }\r\n @else {\r\n {{ (modalTitle() ?? '') | translate: modalTitleParams() }}\r\n }\r\n </h1>\r\n\r\n @if (type() === modalsType.delete) {\r\n <!-- zone delete en dur : texte + liste + avertissement, pleine largeur aligne a gauche -->\r\n <div class=\"w-100 d-flex-v gap-md\">\r\n @if (itemsToDelete().length > 1) {\r\n <div [innerHTML]=\"'_COMMON._MODAL_DELETE.MULTIPLE_TEXT' | translate\"></div>\r\n }\r\n @else {\r\n <div [innerHTML]=\"'_COMMON._MODAL_DELETE.SIMPLE_TEXT' | translate\"></div>\r\n }\r\n\r\n @if (itemsToDelete().length > 0) {\r\n <ul class=\"mb-none\">\r\n @for (item of itemsToDelete(); track item) {\r\n <li>{{ item }}</li>\r\n }\r\n </ul>\r\n }\r\n\r\n <div [innerHTML]=\"'_COMMON._MODAL_DELETE.IRREVERSIBLE' | translate\"></div>\r\n </div>\r\n }\r\n\r\n @if (customBodyTemplate()) {\r\n <div class=\"w-100\">\r\n <ng-container [ngTemplateOutlet]=\"customBodyTemplate()\" [ngTemplateOutletContext]=\"customBodyContext()\">\r\n </ng-container>\r\n </div>\r\n }\r\n </div>\r\n }\r\n @else {\r\n <!-- default + sidepanel : header titre + close, body = contenu libre (slot) -->\r\n <div class=\"modal-header\">\r\n <!-- Titre + sous-titre empiles ; sous-titre aux classes du sous-titre de cw-card. -->\r\n <div class=\"flex-1\">\r\n <h1 class=\"modal-title\" [id]=\"titleId\">\r\n {{ (modalTitle() ?? '') | translate: modalTitleParams() }}\r\n </h1>\r\n @if (modalSubtitle(); as subtitle) {\r\n <div class=\"modal-subtitle fs fs-xs text-light\" [id]=\"subtitleId\">{{ subtitle }}</div>\r\n }\r\n </div>\r\n\r\n <!-- cf. croix state/delete : aria-disabled, pas `disabled` natif -->\r\n <button type=\"button\" class=\"btn-close\" [attr.aria-label]=\"'_COMMON._ACTION.CLOSE' | translate\"\r\n [class.disabled]=\"isCloseLocked()\" [attr.aria-disabled]=\"isCloseLocked() ? 'true' : null\"\r\n (click)=\"requestClose()\" data-test-ctw=\"btn-close-modal\">\r\n <cw-icon [icon]=\"spriteIcon.toolbarClose\" [iconSize]=\"iconSize['lg']\" [type]=\"iconType.default\" aria-hidden=\"true\"></cw-icon>\r\n </button>\r\n </div>\r\n\r\n <div class=\"modal-body d-flex-v gap-md\">\r\n @if (customBodyTemplate()) {\r\n <ng-container [ngTemplateOutlet]=\"customBodyTemplate()\" [ngTemplateOutletContext]=\"customBodyContext()\">\r\n </ng-container>\r\n }\r\n </div>\r\n }\r\n\r\n <!-- footer commun : secondaire a gauche, primaire/danger a droite (ordre DS) -->\r\n <div class=\"modal-footer\">\r\n @if (type() === modalsType.delete) {\r\n <cw-button label=\"_COMMON._ACTION.CLOSE\" [type]=\"buttonTypeEnum.secondary\"\r\n [isDisabled]=\"isCloseLocked()\" (btnAction)=\"requestClose()\" dataTest=\"btn-close-modal\">\r\n </cw-button>\r\n\r\n <cw-button label=\"_COMMON._ACTION.DELETE\" [type]=\"buttonTypeEnum.danger\"\r\n [isDisabled]=\"disableBtnAction1()\" (btnAction)=\"action1Click()\" dataTest=\"btn-action-modal\">\r\n </cw-button>\r\n }\r\n @else {\r\n @if (labelBtnAction2()) {\r\n <cw-button [label]=\"labelBtnAction2()\" [type]=\"buttonTypeEnum.secondary\"\r\n [isDisabled]=\"disableBtnAction2()\" (btnAction)=\"action2Click()\" dataTest=\"btn-action-modal\">\r\n </cw-button>\r\n }\r\n @else {\r\n <!-- Bouton de repli : il occupe la place de l'action 2, il applique donc\r\n disableBtnAction2 (auparavant le seul bouton du composant a ignorer\r\n son input de desactivation). -->\r\n <cw-button label=\"_COMMON._ACTION.CLOSE\" [type]=\"buttonTypeEnum.secondary\"\r\n [isDisabled]=\"isCloseLocked() || disableBtnAction2()\"\r\n (btnAction)=\"fallbackCloseClick()\" dataTest=\"btn-close-modal\">\r\n </cw-button>\r\n }\r\n @if (labelBtnAction1()) {\r\n <cw-button [label]=\"labelBtnAction1()\" [type]=\"buttonTypeEnum.primary\"\r\n [isDisabled]=\"disableBtnAction1()\" (btnAction)=\"action1Click()\" dataTest=\"btn-action-modal\">\r\n </cw-button>\r\n }\r\n }\r\n </div>\r\n }\r\n\r\n </div>\r\n </div>\r\n</div>\r\n" }]
5059
+ }], 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 }] }], modalTitleParams: [{ type: i0.Input, args: [{ isSignal: true, alias: "modalTitleParams", required: false }] }], modalSubtitle: [{ type: i0.Input, args: [{ isSignal: true, alias: "modalSubtitle", 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 }] }], closeLocked: [{ type: i0.Input, args: [{ isSignal: true, alias: "closeLocked", required: false }] }], closeLockedMessage: [{ type: i0.Input, args: [{ isSignal: true, alias: "closeLockedMessage", required: false }] }], keepOpenOnAction1: [{ type: i0.Input, args: [{ isSignal: true, alias: "keepOpenOnAction1", required: false }] }], keepOpenOnAction2: [{ type: i0.Input, args: [{ isSignal: true, alias: "keepOpenOnAction2", required: false }] }], btnAction1: [{ type: i0.Output, args: ["btnAction1"] }], btnAction2: [{ type: i0.Output, args: ["btnAction2"] }] } });
4981
5060
 
5061
+ /**
5062
+ * Contenu d'onglet cree a la premiere ouverture de l'onglet (puis conserve) :
5063
+ * `<ng-template cwTabLazy>…</ng-template>` dans un `cw-tab-content`. Sans lui, le contenu est cree
5064
+ * des l'arrivee sur la page et seulement masque (tableaux et appels API de tous les onglets).
5065
+ */
5066
+ class TabLazyDirective {
5067
+ constructor() {
5068
+ this.templateRef = inject(TemplateRef);
5069
+ }
5070
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: TabLazyDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
5071
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.20", type: TabLazyDirective, isStandalone: true, selector: "ng-template[cwTabLazy]", ngImport: i0 }); }
5072
+ }
5073
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: TabLazyDirective, decorators: [{
5074
+ type: Directive,
5075
+ args: [{
5076
+ selector: 'ng-template[cwTabLazy]',
5077
+ standalone: true,
5078
+ }]
5079
+ }] });
4982
5080
  class TabContentComponent {
4983
5081
  constructor() {
4984
5082
  this.title = input.required(...(ngDevMode ? [{ debugName: "title" }] : []));
@@ -4986,45 +5084,71 @@ class TabContentComponent {
4986
5084
  this.withIcon = input(...(ngDevMode ? [undefined, { debugName: "withIcon" }] : []));
4987
5085
  /** Badge affiché après le libellé de l'onglet (compteur, statut). */
4988
5086
  this.badge = input(...(ngDevMode ? [undefined, { debugName: "badge" }] : []));
5087
+ /**
5088
+ * Sous-onglets : `cw-tab-content` imbriques directement dans celui-ci. Leur barre est dessinee
5089
+ * par le `cw-tab` parent, sous la barre principale ; leurs panneaux restent dans ce panneau.
5090
+ */
5091
+ this.children = contentChildren(TabContentComponent, ...(ngDevMode ? [{ debugName: "children" }] : []));
5092
+ /** Contenu differe (`ng-template cwTabLazy`) de CE panneau, pas d'un sous-onglet. */
5093
+ this.lazy = contentChild(TabLazyDirective, ...(ngDevMode ? [{ debugName: "lazy", descendants: false }] : [{ descendants: false }]));
4989
5094
  // Etat pilote par le parent `cw-tab` : signaux writable (le parent appelle `.set()`)
4990
5095
  // pour declencher la detection de changement sous OnPush.
4991
5096
  this.id = signal(0, ...(ngDevMode ? [{ debugName: "id" }] : []));
4992
5097
  this.active = signal(false, ...(ngDevMode ? [{ debugName: "active" }] : []));
5098
+ /** Ids DOM de l'onglet et de son panneau, uniques par `cw-tab` (pose par le parent). */
5099
+ this.tabId = signal('', ...(ngDevMode ? [{ debugName: "tabId" }] : []));
5100
+ this.panelId = signal('', ...(ngDevMode ? [{ debugName: "panelId" }] : []));
5101
+ /** Index du sous-onglet choisi, memorise quand on change d'onglet principal. */
5102
+ this.selectedChild = signal(0, ...(ngDevMode ? [{ debugName: "selectedChild" }] : []));
5103
+ /** Le contenu differe est cree a la 1re activation, puis garde (etat, filtres, scroll). */
5104
+ this.opened = signal(false, ...(ngDevMode ? [{ debugName: "opened" }] : []));
5105
+ this.lazyRendered = computed(() => !!this.lazy() && (this.active() || this.opened()), ...(ngDevMode ? [{ debugName: "lazyRendered" }] : []));
5106
+ effect(() => {
5107
+ if (this.active())
5108
+ this.opened.set(true);
5109
+ });
4993
5110
  }
4994
5111
  get fragment() {
4995
5112
  return UtilsHelper.slugify(this.title());
4996
5113
  }
4997
5114
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: TabContentComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
4998
- 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 }, badge: { classPropertyName: "badge", publicName: "badge", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "attr.title": "null" } }, ngImport: i0, template: `
4999
- <div class="tab-pane"
5000
- [class.fade]="!active()"
5001
- [class.active]="active()"
5002
- [class.show]="active()"
5003
- [class.d-none]="!active()"
5004
- [id]="'cw-nav-' + id() + '-panel'"
5005
- role="tabpanel"
5006
- [attr.aria-labelledby]="'cw-nav-' + id()">
5007
- <ng-content></ng-content>
5008
- </div>
5009
- `, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
5115
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.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 }, badge: { classPropertyName: "badge", publicName: "badge", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "attr.title": "null" } }, queries: [{ propertyName: "children", predicate: TabContentComponent, isSignal: true }, { propertyName: "lazy", first: true, predicate: TabLazyDirective, isSignal: true }], ngImport: i0, template: `
5116
+ <div class="tab-pane"
5117
+ [class.fade]="!active()"
5118
+ [class.active]="active()"
5119
+ [class.show]="active()"
5120
+ [class.d-none]="!active()"
5121
+ [id]="panelId()"
5122
+ role="tabpanel"
5123
+ [attr.aria-labelledby]="tabId()">
5124
+ <ng-content></ng-content>
5125
+ @if (lazyRendered()) {
5126
+ <ng-container [ngTemplateOutlet]="lazy()!.templateRef"></ng-container>
5127
+ }
5128
+ </div>
5129
+ `, isInline: true, dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
5010
5130
  }
5011
5131
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: TabContentComponent, decorators: [{
5012
5132
  type: Component,
5013
5133
  args: [{
5014
5134
  selector: 'cw-tab-content',
5015
- template: `
5016
- <div class="tab-pane"
5017
- [class.fade]="!active()"
5018
- [class.active]="active()"
5019
- [class.show]="active()"
5020
- [class.d-none]="!active()"
5021
- [id]="'cw-nav-' + id() + '-panel'"
5022
- role="tabpanel"
5023
- [attr.aria-labelledby]="'cw-nav-' + id()">
5024
- <ng-content></ng-content>
5025
- </div>
5135
+ template: `
5136
+ <div class="tab-pane"
5137
+ [class.fade]="!active()"
5138
+ [class.active]="active()"
5139
+ [class.show]="active()"
5140
+ [class.d-none]="!active()"
5141
+ [id]="panelId()"
5142
+ role="tabpanel"
5143
+ [attr.aria-labelledby]="tabId()">
5144
+ <ng-content></ng-content>
5145
+ @if (lazyRendered()) {
5146
+ <ng-container [ngTemplateOutlet]="lazy()!.templateRef"></ng-container>
5147
+ }
5148
+ </div>
5026
5149
  `,
5027
5150
  standalone: true,
5151
+ imports: [NgTemplateOutlet],
5028
5152
  changeDetection: ChangeDetectionStrategy.OnPush,
5029
5153
  host: {
5030
5154
  // `title` est aussi un attribut HTML global : écrit en attribut statique (`title="KEY"`),
@@ -5033,7 +5157,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.20", ngImpo
5033
5157
  '[attr.title]': 'null'
5034
5158
  }
5035
5159
  }]
5036
- }], 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 }] }], badge: [{ type: i0.Input, args: [{ isSignal: true, alias: "badge", required: false }] }] } });
5160
+ }], ctorParameters: () => [], 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 }] }], badge: [{ type: i0.Input, args: [{ isSignal: true, alias: "badge", required: false }] }], children: [{ type: i0.ContentChildren, args: [i0.forwardRef(() => TabContentComponent), { isSignal: true }] }], lazy: [{ type: i0.ContentChild, args: [i0.forwardRef(() => TabLazyDirective), { ...{ descendants: false }, isSignal: true }] }] } });
5037
5161
 
5038
5162
  var FoTabTypeEnum;
5039
5163
  (function (FoTabTypeEnum) {
@@ -5046,6 +5170,8 @@ var BoTabTypeEnum;
5046
5170
  BoTabTypeEnum["card"] = "card";
5047
5171
  })(BoTabTypeEnum || (BoTabTypeEnum = {}));
5048
5172
 
5173
+ /** Separateur onglet / sous-onglet dans le fragment d'URL (`#mtickets/validations`). */
5174
+ const FRAGMENT_SEPARATOR = '/';
5049
5175
  class TabComponent {
5050
5176
  constructor() {
5051
5177
  this.router = inject(Router);
@@ -5057,33 +5183,51 @@ class TabComponent {
5057
5183
  this.title = input(...(ngDevMode ? [undefined, { debugName: "title" }] : []));
5058
5184
  this.tabContentCssClass = input('', ...(ngDevMode ? [{ debugName: "tabContentCssClass" }] : []));
5059
5185
  this.activeTabIndex = input(0, ...(ngDevMode ? [{ debugName: "activeTabIndex" }] : []));
5186
+ /** Onglets principaux : `cw-tab-content` enfants directs (les sous-onglets sont dans ceux-ci). */
5060
5187
  this.tabs = contentChildren(TabContentComponent, ...(ngDevMode ? [{ debugName: "tabs" }] : []));
5061
5188
  this.tabLinks = viewChildren('tabLink', ...(ngDevMode ? [{ debugName: "tabLinks" }] : []));
5062
5189
  this.tabChanged = output();
5190
+ /** Emis au choix d'un sous-onglet (clic, clavier, fragment d'URL). */
5191
+ this.subTabChanged = output();
5192
+ /**
5193
+ * Prefixe des ids DOM, unique par instance : deux `cw-tab` sur une page (ou une page qui en
5194
+ * contenait un dans un onglet d'un autre) produisaient deux `cw-nav-0`, et `aria-controls` /
5195
+ * `aria-labelledby` pointaient sur le mauvais element.
5196
+ */
5197
+ this.uid = uniqueId('cw-tab');
5063
5198
  this.activeId = 0;
5064
5199
  this.iconSize = IconSizeEnum['md'];
5200
+ /** Onglet principal actif : sa liste de sous-onglets alimente la seconde barre. */
5201
+ this.activeTab = signal(undefined, ...(ngDevMode ? [{ debugName: "activeTab" }] : []));
5202
+ this.subTabs = computed(() => this.activeTab()?.children() ?? [], ...(ngDevMode ? [{ debugName: "subTabs" }] : []));
5203
+ // Ids DOM des onglets et panneaux, recalcules si la liste change (`@for`, `@if`).
5204
+ effect(() => {
5205
+ this.tabs().forEach((tab, i) => {
5206
+ tab.id.set(i);
5207
+ tab.tabId.set(`${this.uid}-tab-${i}`);
5208
+ tab.panelId.set(`${this.uid}-panel-${i}`);
5209
+ tab.children().forEach((child, j) => {
5210
+ child.id.set(j);
5211
+ child.tabId.set(`${this.uid}-tab-${i}-${j}`);
5212
+ child.panelId.set(`${this.uid}-panel-${i}-${j}`);
5213
+ });
5214
+ });
5215
+ });
5065
5216
  }
5066
5217
  ngAfterContentInit() {
5067
5218
  const tabsArray = [...this.tabs()];
5068
- tabsArray.forEach((tab, index) => {
5069
- tab.id.set(index);
5070
- tab.active.set(false);
5071
- });
5072
- const firstActiveIndex = tabsArray.findIndex(t => !t.disabled());
5219
+ tabsArray.forEach(tab => tab.selectedChild.set(this.firstEnabledIndex(tab.children())));
5220
+ const firstActiveIndex = this.firstEnabledIndex(tabsArray);
5073
5221
  // Onglet demande s'il est valide et non desactive ; sinon 1er onglet actif ; sinon 0.
5074
5222
  const requested = this.activeTabIndex();
5075
5223
  const requestedOk = requested >= 0 && requested < tabsArray.length && !tabsArray[requested]?.disabled();
5076
- this.activeId = requestedOk ? requested : (firstActiveIndex !== -1 ? firstActiveIndex : 0);
5224
+ this.activeId = requestedOk ? requested : firstActiveIndex;
5077
5225
  if (this.useFragment()) {
5078
5226
  this.route.fragment
5079
5227
  .pipe(takeUntilDestroyed(this.destroyRef))
5080
5228
  .subscribe(fragment => {
5081
- if (fragment) {
5082
- const foundIndex = tabsArray.findIndex(tab => tab.fragment === fragment && !tab.disabled());
5083
- if (foundIndex !== -1) {
5084
- this.activeId = foundIndex;
5085
- }
5086
- }
5229
+ if (fragment)
5230
+ this.applyFragment(fragment);
5087
5231
  this.activateTabByIndex(this.activeId);
5088
5232
  });
5089
5233
  }
@@ -5094,74 +5238,116 @@ class TabComponent {
5094
5238
  selectTab(tab) {
5095
5239
  if (tab.disabled())
5096
5240
  return;
5097
- this.tabs().forEach(t => t.active.set(false));
5098
- tab.active.set(true);
5099
5241
  this.activeId = tab.id();
5100
- if (this.useFragment()) {
5101
- this.router.navigate([], {
5102
- relativeTo: this.route,
5103
- fragment: tab.fragment,
5104
- queryParamsHandling: 'preserve',
5105
- replaceUrl: true
5106
- });
5107
- }
5242
+ this.syncActive();
5243
+ this.writeFragment();
5108
5244
  this.tabChanged.emit(this.activeId);
5109
5245
  }
5110
- activateTabByIndex(index) {
5111
- const tab = this.tabs()[index];
5112
- if (tab && !tab.disabled()) {
5113
- this.selectTab(tab);
5114
- }
5115
- }
5116
- onKeydown(event) {
5246
+ /** Choisit un sous-onglet de l'onglet principal `parent`. */
5247
+ selectSubTab(parent, child) {
5248
+ if (child.disabled() || parent.disabled())
5249
+ return;
5250
+ this.activeId = parent.id();
5251
+ parent.selectedChild.set(child.id());
5252
+ this.syncActive();
5253
+ this.writeFragment();
5254
+ this.subTabChanged.emit({ tabIndex: parent.id(), subTabIndex: child.id() });
5255
+ }
5256
+ /** Fleches / Debut / Fin dans une barre (principale ou sous-onglets), focus suivant la selection. */
5257
+ onKeydown(event, level = 'tab') {
5258
+ const list = level === 'tab' ? [...this.tabs()] : [...this.subTabs()];
5259
+ const current = level === 'tab' ? this.activeId : (this.activeTab()?.selectedChild() ?? 0);
5260
+ let next;
5117
5261
  switch (event.key) {
5118
5262
  case 'ArrowLeft':
5119
- event.preventDefault();
5120
- this.selectPreviousTab();
5263
+ next = this.nextEnabled(list, current, -1);
5121
5264
  break;
5122
5265
  case 'ArrowRight':
5123
- event.preventDefault();
5124
- this.selectNextTab();
5266
+ next = this.nextEnabled(list, current, 1);
5267
+ break;
5268
+ case 'Home':
5269
+ next = this.nextEnabled(list, -1, 1);
5125
5270
  break;
5271
+ case 'End':
5272
+ next = this.nextEnabled(list, list.length, -1);
5273
+ break;
5274
+ default: return;
5126
5275
  }
5276
+ event.preventDefault();
5277
+ if (next === undefined || next === current)
5278
+ return;
5279
+ if (level === 'tab') {
5280
+ this.selectTab(list[next]);
5281
+ }
5282
+ else {
5283
+ this.selectSubTab(this.activeTab(), list[next]);
5284
+ }
5285
+ // Focus sur l'onglet selectionne de LA MEME barre (roving tabindex).
5286
+ const tablist = event.currentTarget?.closest('[role="tablist"]');
5287
+ setTimeout(() => tablist?.querySelector('[aria-selected="true"]')?.focus());
5127
5288
  }
5128
- moveFocus() {
5129
- this.tabLinks().forEach((link) => {
5130
- if (link.nativeElement.getAttribute('aria-selected') === 'true') {
5131
- link.nativeElement.focus();
5132
- }
5289
+ /** Etat `active` de tous les panneaux : onglet actif, et son sous-onglet choisi. */
5290
+ syncActive() {
5291
+ const tabsArray = [...this.tabs()];
5292
+ tabsArray.forEach((tab, i) => {
5293
+ const isActive = i === this.activeId;
5294
+ tab.active.set(isActive);
5295
+ tab.children().forEach((child, j) => child.active.set(isActive && j === tab.selectedChild()));
5133
5296
  });
5297
+ this.activeTab.set(tabsArray[this.activeId]);
5134
5298
  }
5135
- selectPreviousTab() {
5136
- const tabsArray = [...this.tabs()];
5137
- const activeIndex = tabsArray.findIndex(tab => tab.active());
5138
- if (activeIndex !== -1) {
5139
- let newIndex = (activeIndex - 1 + tabsArray.length) % tabsArray.length;
5140
- while (tabsArray[newIndex].disabled() && newIndex !== activeIndex) {
5141
- newIndex = (newIndex - 1 + tabsArray.length) % tabsArray.length;
5142
- }
5143
- if (!tabsArray[newIndex].disabled()) {
5144
- this.selectTab(tabsArray[newIndex]);
5145
- setTimeout(() => this.moveFocus());
5146
- }
5299
+ activateTabByIndex(index) {
5300
+ const tab = this.tabs()[index];
5301
+ if (tab && !tab.disabled()) {
5302
+ this.selectTab(tab);
5147
5303
  }
5148
5304
  }
5149
- selectNextTab() {
5305
+ /** `#onglet` ou `#onglet/sous-onglet` (slugs des titres). Un fragment inconnu est ignore. */
5306
+ applyFragment(fragment) {
5307
+ const [tabSlug, subSlug] = fragment.split(FRAGMENT_SEPARATOR);
5150
5308
  const tabsArray = [...this.tabs()];
5151
- const activeIndex = tabsArray.findIndex(tab => tab.active());
5152
- if (activeIndex !== -1) {
5153
- let newIndex = (activeIndex + 1) % tabsArray.length;
5154
- while (tabsArray[newIndex].disabled() && newIndex !== activeIndex) {
5155
- newIndex = (newIndex + 1) % tabsArray.length;
5156
- }
5157
- if (!tabsArray[newIndex].disabled()) {
5158
- this.selectTab(tabsArray[newIndex]);
5159
- setTimeout(() => this.moveFocus());
5160
- }
5309
+ const tabIndex = tabsArray.findIndex(t => t.fragment === tabSlug && !t.disabled());
5310
+ if (tabIndex === -1)
5311
+ return;
5312
+ this.activeId = tabIndex;
5313
+ if (subSlug) {
5314
+ const children = tabsArray[tabIndex].children();
5315
+ const subIndex = children.findIndex(c => c.fragment === subSlug && !c.disabled());
5316
+ if (subIndex !== -1)
5317
+ tabsArray[tabIndex].selectedChild.set(subIndex);
5318
+ }
5319
+ }
5320
+ writeFragment() {
5321
+ if (!this.useFragment())
5322
+ return;
5323
+ const tab = this.tabs()[this.activeId];
5324
+ if (!tab)
5325
+ return;
5326
+ const sub = tab.children()[tab.selectedChild()];
5327
+ this.router.navigate([], {
5328
+ relativeTo: this.route,
5329
+ fragment: sub ? `${tab.fragment}${FRAGMENT_SEPARATOR}${sub.fragment}` : tab.fragment,
5330
+ queryParamsHandling: 'preserve',
5331
+ replaceUrl: true
5332
+ });
5333
+ }
5334
+ firstEnabledIndex(list) {
5335
+ const index = list.findIndex(t => !t.disabled());
5336
+ return index === -1 ? 0 : index;
5337
+ }
5338
+ /** Prochain onglet non desactive dans le sens `step`, en bouclant ; `undefined` si aucun. */
5339
+ nextEnabled(list, from, step) {
5340
+ if (!list.length)
5341
+ return undefined;
5342
+ for (let k = 1; k <= list.length; k++) {
5343
+ const index = (((from + step * k) % list.length) + list.length) % list.length;
5344
+ if (!list[index].disabled())
5345
+ return index;
5161
5346
  }
5347
+ return undefined;
5162
5348
  }
5163
5349
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: TabComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
5164
- 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()\">\r\n @if (title(); as title) {\r\n <h2>{{ title | translate }}</h2>\r\n }\r\n <ul class=\"tab-items d-flex-h\" [ngClass]=\"'tab-items-' + type()\" role=\"tablist\">\r\n @for (tab of tabs(); track tab; let i = $index) {\r\n <li class=\"tab-item\" role=\"presentation\">\r\n <button #tabLink type=\"button\" class=\"tab-link btn\" [class.active]=\"tab.active()\" [class.disabled]=\"tab.disabled()\"\r\n [disabled]=\"tab.disabled()\" [attr.id]=\"'cw-nav-' + i\" [attr.data-test-ctw]=\"'link-tab-' + id() + '-' + i\"\r\n [attr.aria-selected]=\"tab.active()\" [attr.aria-controls]=\"'cw-nav-' + i + '-panel'\"\r\n [attr.tabindex]=\"tab.active() ? '0' : '-1'\" (click)=\"selectTab(tab)\" (keydown)=\"onKeydown($event)\" role=\"tab\">\r\n @if (tab.withIcon(); as icon) {\r\n <cw-icon [icon]=\"icon\" [iconSize]=\"iconSize\"></cw-icon>\r\n }\r\n {{ tab.title() | translate }}\r\n @if (tab.badge(); as badge) {\r\n <cw-badge [type]=\"badge.type\" [label]=\"badge.label\" [withIcon]=\"badge.withIcon\"\r\n [iconPosition]=\"badge.iconPosition\" [cssClass]=\"badge.cssClass ?? ''\" [dataTest]=\"badge.dataTest\"></cw-badge>\r\n }\r\n </button>\r\n </li>\r\n }\r\n </ul>\r\n</div>\r\n\r\n<div [class]=\"'tab-content ' + tabContentCssClass()\" [ngClass]=\"'tab-content-' + type()\">\r\n <ng-content></ng-content>\r\n</div>\r\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", "text", "label", "type", "iconSize", "iconCssClass", "iconUiType", "iconColorCustom", "spritePath"] }, { kind: "component", type: BadgeComponent, selector: "cw-badge", inputs: ["type", "label", "labelParams", "withIcon", "iconPosition", "cssClass", "skeletonMode", "dataTest"] }, { kind: "ngmodule", type: TranslateModule }, { kind: "pipe", type: i2.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
5350
+ 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", subTabChanged: "subTabChanged" }, 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 <!-- En-tete libre au-dessus des onglets (identite d'une fiche...), dans la meme carte en variante\n `card`. Masque quand rien n'est projete (`:empty`). -->\n <div class=\"tab-header\"><ng-content select=\"[tab-header]\"></ng-content></div>\n\n @if (title(); as 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]=\"tab.tabId()\" [attr.data-test-ctw]=\"'link-tab-' + id() + '-' + i\"\n [attr.aria-selected]=\"tab.active()\" [attr.aria-controls]=\"tab.panelId()\"\n [attr.tabindex]=\"tab.active() ? '0' : '-1'\" (click)=\"selectTab(tab)\" (keydown)=\"onKeydown($event)\" role=\"tab\">\n <ng-container *ngTemplateOutlet=\"tabLabel; context: { $implicit: tab }\"></ng-container>\n </button>\n </li>\n }\n </ul>\n\n <!-- Sous-onglets de l'onglet actif (`cw-tab-content` imbriques), sous la barre principale :\n seconde tablist, nommee par l'onglet principal actif. -->\n @if (activeTab(); as parent) {\n @if (subTabs().length) {\n <ul class=\"tab-items tab-items-sub d-flex-h\" role=\"tablist\" [attr.aria-labelledby]=\"parent.tabId()\">\n @for (sub of subTabs(); track sub; let j = $index) {\n <li class=\"tab-item\" role=\"presentation\">\n <button type=\"button\" class=\"tab-link btn\" [class.active]=\"sub.active()\" [class.disabled]=\"sub.disabled()\"\n [disabled]=\"sub.disabled()\" [attr.id]=\"sub.tabId()\" [attr.data-test-ctw]=\"'link-tab-' + id() + '-' + activeId + '-' + j\"\n [attr.aria-selected]=\"sub.active()\" [attr.aria-controls]=\"sub.panelId()\"\n [attr.tabindex]=\"sub.active() ? '0' : '-1'\" (click)=\"selectSubTab(parent, sub)\" (keydown)=\"onKeydown($event, 'sub')\" role=\"tab\">\n <ng-container *ngTemplateOutlet=\"tabLabel; context: { $implicit: sub }\"></ng-container>\n </button>\n </li>\n }\n </ul>\n }\n }\n</div>\n\n<div [class]=\"'tab-content ' + tabContentCssClass()\" [ngClass]=\"'tab-content-' + type()\">\n <ng-content></ng-content>\n</div>\n\n<!-- Libelle d'un onglet (principal ou sous-onglet) : picto, titre, badge. -->\n<ng-template #tabLabel let-tab>\n @if (tab.withIcon(); as icon) {\n <cw-icon [icon]=\"icon\" [iconSize]=\"iconSize\"></cw-icon>\n }\n {{ tab.title() | translate }}\n @if (tab.badge(); as badge) {\n <cw-badge [type]=\"badge.type\" [label]=\"badge.label\" [withIcon]=\"badge.withIcon\"\n [iconPosition]=\"badge.iconPosition\" [cssClass]=\"badge.cssClass ?? ''\" [dataTest]=\"badge.dataTest\"></cw-badge>\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: "component", type: IconComponent, selector: "cw-icon", inputs: ["icon", "text", "label", "type", "iconSize", "iconCssClass", "iconUiType", "iconColorCustom", "spritePath"] }, { kind: "component", type: BadgeComponent, selector: "cw-badge", inputs: ["type", "label", "labelParams", "withIcon", "iconPosition", "cssClass", "skeletonMode", "dataTest"] }, { kind: "ngmodule", type: TranslateModule }, { kind: "pipe", type: i2.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
5165
5351
  }
5166
5352
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: TabComponent, decorators: [{
5167
5353
  type: Component,
@@ -5174,8 +5360,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.20", ngImpo
5174
5360
  IconComponent,
5175
5361
  BadgeComponent,
5176
5362
  TranslateModule
5177
- ], template: "<div class=\"tab\" [ngClass]=\"'tab-' + type()\">\r\n @if (title(); as title) {\r\n <h2>{{ title | translate }}</h2>\r\n }\r\n <ul class=\"tab-items d-flex-h\" [ngClass]=\"'tab-items-' + type()\" role=\"tablist\">\r\n @for (tab of tabs(); track tab; let i = $index) {\r\n <li class=\"tab-item\" role=\"presentation\">\r\n <button #tabLink type=\"button\" class=\"tab-link btn\" [class.active]=\"tab.active()\" [class.disabled]=\"tab.disabled()\"\r\n [disabled]=\"tab.disabled()\" [attr.id]=\"'cw-nav-' + i\" [attr.data-test-ctw]=\"'link-tab-' + id() + '-' + i\"\r\n [attr.aria-selected]=\"tab.active()\" [attr.aria-controls]=\"'cw-nav-' + i + '-panel'\"\r\n [attr.tabindex]=\"tab.active() ? '0' : '-1'\" (click)=\"selectTab(tab)\" (keydown)=\"onKeydown($event)\" role=\"tab\">\r\n @if (tab.withIcon(); as icon) {\r\n <cw-icon [icon]=\"icon\" [iconSize]=\"iconSize\"></cw-icon>\r\n }\r\n {{ tab.title() | translate }}\r\n @if (tab.badge(); as badge) {\r\n <cw-badge [type]=\"badge.type\" [label]=\"badge.label\" [withIcon]=\"badge.withIcon\"\r\n [iconPosition]=\"badge.iconPosition\" [cssClass]=\"badge.cssClass ?? ''\" [dataTest]=\"badge.dataTest\"></cw-badge>\r\n }\r\n </button>\r\n </li>\r\n }\r\n </ul>\r\n</div>\r\n\r\n<div [class]=\"'tab-content ' + tabContentCssClass()\" [ngClass]=\"'tab-content-' + type()\">\r\n <ng-content></ng-content>\r\n</div>\r\n" }]
5178
- }], 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"] }] } });
5363
+ ], template: "<div class=\"tab\" [ngClass]=\"'tab-' + type()\">\n <!-- En-tete libre au-dessus des onglets (identite d'une fiche...), dans la meme carte en variante\n `card`. Masque quand rien n'est projete (`:empty`). -->\n <div class=\"tab-header\"><ng-content select=\"[tab-header]\"></ng-content></div>\n\n @if (title(); as 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]=\"tab.tabId()\" [attr.data-test-ctw]=\"'link-tab-' + id() + '-' + i\"\n [attr.aria-selected]=\"tab.active()\" [attr.aria-controls]=\"tab.panelId()\"\n [attr.tabindex]=\"tab.active() ? '0' : '-1'\" (click)=\"selectTab(tab)\" (keydown)=\"onKeydown($event)\" role=\"tab\">\n <ng-container *ngTemplateOutlet=\"tabLabel; context: { $implicit: tab }\"></ng-container>\n </button>\n </li>\n }\n </ul>\n\n <!-- Sous-onglets de l'onglet actif (`cw-tab-content` imbriques), sous la barre principale :\n seconde tablist, nommee par l'onglet principal actif. -->\n @if (activeTab(); as parent) {\n @if (subTabs().length) {\n <ul class=\"tab-items tab-items-sub d-flex-h\" role=\"tablist\" [attr.aria-labelledby]=\"parent.tabId()\">\n @for (sub of subTabs(); track sub; let j = $index) {\n <li class=\"tab-item\" role=\"presentation\">\n <button type=\"button\" class=\"tab-link btn\" [class.active]=\"sub.active()\" [class.disabled]=\"sub.disabled()\"\n [disabled]=\"sub.disabled()\" [attr.id]=\"sub.tabId()\" [attr.data-test-ctw]=\"'link-tab-' + id() + '-' + activeId + '-' + j\"\n [attr.aria-selected]=\"sub.active()\" [attr.aria-controls]=\"sub.panelId()\"\n [attr.tabindex]=\"sub.active() ? '0' : '-1'\" (click)=\"selectSubTab(parent, sub)\" (keydown)=\"onKeydown($event, 'sub')\" role=\"tab\">\n <ng-container *ngTemplateOutlet=\"tabLabel; context: { $implicit: sub }\"></ng-container>\n </button>\n </li>\n }\n </ul>\n }\n }\n</div>\n\n<div [class]=\"'tab-content ' + tabContentCssClass()\" [ngClass]=\"'tab-content-' + type()\">\n <ng-content></ng-content>\n</div>\n\n<!-- Libelle d'un onglet (principal ou sous-onglet) : picto, titre, badge. -->\n<ng-template #tabLabel let-tab>\n @if (tab.withIcon(); as icon) {\n <cw-icon [icon]=\"icon\" [iconSize]=\"iconSize\"></cw-icon>\n }\n {{ tab.title() | translate }}\n @if (tab.badge(); as badge) {\n <cw-badge [type]=\"badge.type\" [label]=\"badge.label\" [withIcon]=\"badge.withIcon\"\n [iconPosition]=\"badge.iconPosition\" [cssClass]=\"badge.cssClass ?? ''\" [dataTest]=\"badge.dataTest\"></cw-badge>\n }\n</ng-template>\n" }]
5364
+ }], ctorParameters: () => [], 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"] }], subTabChanged: [{ type: i0.Output, args: ["subTabChanged"] }] } });
5179
5365
 
5180
5366
  class StepperComponent {
5181
5367
  constructor() {
@@ -6069,5 +6255,5 @@ const CW_DEFAULT_THEME_OPTIONS = [
6069
6255
  * Generated bundle index. Do not edit.
6070
6256
  */
6071
6257
 
6072
- export { AccordionComponent, AlertComponent, AlertLiveEnum, AlertTypeEnum, BadgeComponent, BadgePositionEnum, BadgeTypeEnum, BoButtonTypeEnum, BoTabTypeEnum, BreadcrumbComponent, ButtonComponent, ButtonIconSizeEnum, ButtonPositionEnum, CW_DEFAULT_THEME_OPTIONS, CardComponent, CardTitleRankEnum, CardTypeEnum, ClickOutsideDirective, CollapseDirective, CwThemeKeyEnum, CwTooltipDirective, DividerComponent, DropdownComponent, DropdownItemDirective, DropdownPositionEnum, EmptyStateComponent, EmptyStateIllustrationEnum, FileDropComponent, FileDropFileStatusEnum, FileDropModeEnum, FileDropRejectReasonEnum, FilePreviewComponent, 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 };
6258
+ export { AccordionComponent, AlertComponent, AlertLiveEnum, AlertTypeEnum, BadgeComponent, BadgePositionEnum, BadgeTypeEnum, BoButtonTypeEnum, BoTabTypeEnum, BreadcrumbComponent, ButtonComponent, ButtonIconSizeEnum, ButtonPositionEnum, CW_DEFAULT_THEME_OPTIONS, CardComponent, CardTitleRankEnum, CardTypeEnum, ClickOutsideDirective, CollapseDirective, CwThemeKeyEnum, CwTooltipDirective, DividerComponent, DropdownComponent, DropdownItemDirective, DropdownPositionEnum, EmptyStateComponent, EmptyStateIllustrationEnum, FileDropComponent, FileDropFileStatusEnum, FileDropModeEnum, FileDropRejectReasonEnum, FilePreviewComponent, 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, TabLazyDirective, ThemeSelectorComponent, ThemeService, TitleComponent, TitleContextEnum, TitleTagEnum, ToastComponent, ToastItemComponent, ToastService, TooltipPositionEnum, TriggerTooltipEnum, TypeTooltipEnum, rangeValidator, resolveArrowPos };
6073
6259
  //# sourceMappingURL=cityway-basic-ui.mjs.map