@cityway/basic-ui 1.0.2-beta020 → 1.0.2-beta022

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (65) hide show
  1. package/cityway-basic-ui-1.0.2-beta022.tgz +0 -0
  2. package/fesm2022/cityway-basic-ui.mjs +1024 -75
  3. package/fesm2022/cityway-basic-ui.mjs.map +1 -1
  4. package/img/flags.png +0 -0
  5. package/img/flags.webp +0 -0
  6. package/img/flags@2x.png +0 -0
  7. package/img/flags@2x.webp +0 -0
  8. package/index.d.ts +387 -13
  9. package/lib/assets/i18n/common.en.json +3 -1
  10. package/lib/assets/i18n/common.fr.json +3 -1
  11. package/lib/assets/icons/sprite.svg +3 -1
  12. package/package.json +6 -2
  13. package/styles/basic-ui.styles.bo.min.css +1 -1
  14. package/styles/basic-ui.styles.bo.min.css.map +1 -1
  15. package/styles/basic-ui.styles.fo.min.css +1 -1
  16. package/styles/basic-ui.styles.fo.min.css.map +1 -1
  17. package/cityway-basic-ui-1.0.2-beta020.tgz +0 -0
  18. package/lib/assets/styles/scss/_reboot.scss +0 -494
  19. package/lib/assets/styles/scss/_root-bo.scss +0 -10
  20. package/lib/assets/styles/scss/_root-fo.scss +0 -14
  21. package/lib/assets/styles/scss/basic-ui.styles.bo.scss +0 -48
  22. package/lib/assets/styles/scss/basic-ui.styles.fo.scss +0 -48
  23. package/lib/assets/styles/scss/components/_accordion.scss +0 -35
  24. package/lib/assets/styles/scss/components/_alert.scss +0 -78
  25. package/lib/assets/styles/scss/components/_badge.scss +0 -111
  26. package/lib/assets/styles/scss/components/_btn-collapse.scss +0 -23
  27. package/lib/assets/styles/scss/components/_card.scss +0 -87
  28. package/lib/assets/styles/scss/components/_close.scss +0 -11
  29. package/lib/assets/styles/scss/components/_dropdown.scss +0 -90
  30. package/lib/assets/styles/scss/components/_file-to-download.scss +0 -46
  31. package/lib/assets/styles/scss/components/_icon-notification.scss +0 -30
  32. package/lib/assets/styles/scss/components/_icon.scss +0 -138
  33. package/lib/assets/styles/scss/components/_modal.scss +0 -165
  34. package/lib/assets/styles/scss/components/_numerical-range.scss +0 -60
  35. package/lib/assets/styles/scss/components/_stepper.scss +0 -78
  36. package/lib/assets/styles/scss/components/_toast.scss +0 -27
  37. package/lib/assets/styles/scss/components/_tooltip.scss +0 -35
  38. package/lib/assets/styles/scss/components/button/_button-bo-variant.scss +0 -112
  39. package/lib/assets/styles/scss/components/button/_button-fo-variant.scss +0 -57
  40. package/lib/assets/styles/scss/components/button/_button.scss +0 -126
  41. package/lib/assets/styles/scss/components/form-field/_field-check.scss +0 -137
  42. package/lib/assets/styles/scss/components/form-field/_form-field.scss +0 -153
  43. package/lib/assets/styles/scss/components/form-field/_ng-select.scss +0 -93
  44. package/lib/assets/styles/scss/components/form-field/_slider-range.scss +0 -68
  45. package/lib/assets/styles/scss/components/tab/_tab-bo.scss +0 -95
  46. package/lib/assets/styles/scss/components/tab/_tab-fo.scss +0 -83
  47. package/lib/assets/styles/scss/helpers/_skeleton.scss +0 -67
  48. package/lib/assets/styles/scss/helpers/_spinner.scss +0 -36
  49. package/lib/assets/styles/scss/helpers/_stretched-link.scss +0 -9
  50. package/lib/assets/styles/scss/helpers/_visually-hidden.scss +0 -18
  51. package/lib/assets/styles/scss/mixins/_color.scss +0 -16
  52. package/lib/assets/styles/scss/mixins/_flex.scss +0 -11
  53. package/lib/assets/styles/scss/mixins/_popover-tooltip.scss +0 -144
  54. package/lib/assets/styles/scss/mixins/_root.scss +0 -26
  55. package/lib/assets/styles/scss/mixins/_spacing.scss +0 -84
  56. package/lib/assets/styles/scss/mixins/_type.scss +0 -44
  57. package/lib/assets/styles/scss/utilities/_alignment.scss +0 -23
  58. package/lib/assets/styles/scss/utilities/_breakpoints.scss +0 -30
  59. package/lib/assets/styles/scss/utilities/_flex.scss +0 -142
  60. package/lib/assets/styles/scss/utilities/_grid.scss +0 -64
  61. package/lib/assets/styles/scss/utilities/_position.scss +0 -24
  62. package/lib/assets/styles/scss/utilities/_spacing.scss +0 -3
  63. package/lib/assets/styles/scss/utilities/type/_type-bo.scss +0 -48
  64. package/lib/assets/styles/scss/utilities/type/_type-fo.scss +0 -132
  65. package/lib/assets/styles/scss/utilities/type/_type.scss +0 -20
@@ -1,18 +1,22 @@
1
1
  import * as i1 from '@angular/common';
2
2
  import { CommonModule, NgClass, NgTemplateOutlet } from '@angular/common';
3
3
  import * as i0 from '@angular/core';
4
- import { inject, ElementRef, signal, EventEmitter, effect, Output, Input, Directive, input, HostBinding, Component, ChangeDetectorRef, model, output, viewChild, contentChildren, Injectable, NgZone, HostListener, ChangeDetectionStrategy, Renderer2, ViewChild, TemplateRef, ContentChild, ApplicationRef, Injector, createComponent, viewChildren, Pipe, computed } from '@angular/core';
4
+ import { inject, ElementRef, signal, EventEmitter, effect, Output, Input, Directive, input, HostBinding, Component, ChangeDetectorRef, model, output, viewChild, contentChildren, Injectable, NgZone, HostListener, ChangeDetectionStrategy, Renderer2, ViewChild, DestroyRef, computed, TemplateRef, ContentChild, ApplicationRef, Injector, createComponent, viewChildren, Pipe } from '@angular/core';
5
5
  import * as i2 from '@ngx-translate/core';
6
6
  import { TranslatePipe, TranslateModule, TranslateService } from '@ngx-translate/core';
7
- import { BehaviorSubject, fromEvent } from 'rxjs';
7
+ import { RouterLink, Router, ActivatedRoute } from '@angular/router';
8
+ import { BehaviorSubject, fromEvent, tap, filter, debounceTime, switchMap, catchError, of } from 'rxjs';
8
9
  import * as i4 from '@angular-slider/ngx-slider';
9
10
  import { NgxSliderModule } from '@angular-slider/ngx-slider';
10
11
  export { Options } from '@angular-slider/ngx-slider';
12
+ import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
11
13
  import * as i2$1 from '@angular/forms';
12
- import { FormGroup, Validators, FormsModule, ReactiveFormsModule } from '@angular/forms';
14
+ import { FormControl, ReactiveFormsModule, FormGroup, Validators, FormsModule } from '@angular/forms';
15
+ import intlTelInput from 'intl-tel-input';
16
+ import itiEn from 'intl-tel-input/dist/js/i18n/en';
17
+ import itiFr from 'intl-tel-input/dist/js/i18n/fr';
13
18
  import * as i3 from '@ng-select/ng-select';
14
19
  import { NgSelectModule } from '@ng-select/ng-select';
15
- import { Router, ActivatedRoute } from '@angular/router';
16
20
 
17
21
  class CollapseDirective {
18
22
  set cwCollapse(value) {
@@ -626,6 +630,7 @@ var SpriteIconEnum;
626
630
  SpriteIconEnum["wrench"] = "wrench";
627
631
  SpriteIconEnum["xls"] = "xls";
628
632
  SpriteIconEnum["zip"] = "zip";
633
+ SpriteIconEnum["undefined"] = "undefined";
629
634
  })(SpriteIconEnum || (SpriteIconEnum = {}));
630
635
 
631
636
  class IconComponent {
@@ -1384,6 +1389,7 @@ class ButtonComponent {
1384
1389
  this.buttonPositionEnum = ButtonPositionEnum;
1385
1390
  this.id = '';
1386
1391
  this.isDropdown = false;
1392
+ this.hideCaret = false;
1387
1393
  this.withOnlyIcon = false;
1388
1394
  this.iconSize = ButtonIconSizeEnum.default;
1389
1395
  this.iconPosition = this.buttonPositionEnum.left;
@@ -1439,6 +1445,14 @@ class ButtonComponent {
1439
1445
  onBtnAction() {
1440
1446
  this.btnAction.emit();
1441
1447
  }
1448
+ onLinkClick(event) {
1449
+ if (this.isDisabled) {
1450
+ event.preventDefault();
1451
+ event.stopPropagation();
1452
+ return;
1453
+ }
1454
+ this.btnAction.emit();
1455
+ }
1442
1456
  toggleDropdown() {
1443
1457
  this.getPlacement(this.dropdownPosition);
1444
1458
  this.setAriaExpanded();
@@ -1521,7 +1535,7 @@ class ButtonComponent {
1521
1535
  return Math.floor(Math.random() * (max - min + 1)) + min;
1522
1536
  }
1523
1537
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: ButtonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
1524
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.20", type: ButtonComponent, isStandalone: true, selector: "cw-button", inputs: { type: "type", label: "label", id: "id", isDropdown: "isDropdown", withIcon: "withIcon", withOnlyIcon: "withOnlyIcon", iconSize: "iconSize", iconPosition: "iconPosition", dropdownPosition: "dropdownPosition", isMinWidth: "isMinWidth", isDisabled: "isDisabled", isLoading: "isLoading", cssClass: "cssClass", dataTest: "dataTest", skeletonMode: "skeletonMode", withTooltip: "withTooltip", tooltipText: "tooltipText", tooltipTitle: "tooltipTitle", tooltipTrigger: "tooltipTrigger", tooltipPosition: "tooltipPosition", tooltipType: "tooltipType" }, outputs: { btnAction: "btnAction", dropDownClicked: "dropDownClicked" }, host: { properties: { "class": "this.hostClasses" } }, viewQueries: [{ propertyName: "dropdown", first: true, predicate: ["dropdown"], descendants: true }, { propertyName: "dropdownMenu", first: true, predicate: ["dropdownMenu"], descendants: true }, { propertyName: "dropdownToggle", first: true, predicate: ["dropdownToggle"], descendants: true }], ngImport: i0, template: "<!-- Wrapper pour le tooltip -->\r\n@if (withTooltip) {\r\n <div class=\"d-inline-block p-relative\" (clickOutside)=\"onTooltipClickOutside()\" ctwClickOutside>\r\n\r\n <ng-container *ngTemplateOutlet=\"buttonTemplate\"></ng-container>\r\n\r\n <!-- Tooltip/Popover -->\r\n @if (isTooltipOpened) {\r\n <div role=\"tooltip\" [id]=\"'ctw-tooltip-' + tooltipRandomId\" [ngClass]=\"tooltipType + ' fade show ' + tooltipType + '-' + tooltipPosition\">\r\n <div class=\"arrow\"></div>\r\n @if (tooltipTitle) {\r\n <div [ngClass]=\"(tooltipType === typeTooltipEnum.popover ? 'popover' : 'tooltip') + '-header'\"\r\n [innerHTML]=\"tooltipTitle | translate\"></div>\r\n }\r\n <div [ngClass]=\"tooltipType + '-body'\"\r\n [innerHTML]=\"tooltipText | translate\"></div>\r\n </div>\r\n }\r\n </div>\r\n}\r\n@else {\r\n <ng-container *ngTemplateOutlet=\"buttonTemplate\"></ng-container>\r\n}\r\n\r\n<!-- Template du bouton (code existant envelopp\u00E9) -->\r\n<ng-template #buttonTemplate>\r\n @if (!isDropdown) {\r\n <button type=\"button\" class=\"btn\" [class]=\"'btn-' + type + ' ' + cssClass\" [ngClass]=\"getButtonClasses()\"\r\n [disabled]=\"isDisabled\" (click)=\"onBtnAction()\" [attr.data-test-ctw]=\"dataTest\"\r\n [attr.aria-describedby]=\"withTooltip && isTooltipOpened ? 'ctw-tooltip-' + tooltipRandomId : null\"\r\n (mouseenter)=\"withTooltip && tooltipTrigger === 'hover' ? showTooltip() : null\"\r\n (mouseleave)=\"withTooltip && tooltipTrigger === 'hover' ? hideTooltip() : null\"\r\n (click)=\"withTooltip && tooltipTrigger === 'click' ? showTooltip() : null\">\r\n\r\n @if (isLoading) {\r\n <span class=\"spinner-border spinner-border-sm\" aria-hidden=\"true\"></span>\r\n <span class=\"visually-hidden\" role=\"status\">{{ '_COMMON._HTTP.TXT_LOADING' | translate }}</span>\r\n }\r\n\r\n <ng-container *ngTemplateOutlet=\"buttonContent\"></ng-container>\r\n </button>\r\n }\r\n @else {\r\n <div (clickOutside)=\"onClickOutside()\" ctwClickOutside #dropdown class=\"dropdown d-inline-block\">\r\n <button class=\"btn\" [class]=\"'btn-' + type + ' ' + cssClass\" type=\"button\"\r\n [ngClass]=\"getButtonClasses()\"\r\n [disabled]=\"isDisabled\" [id]=\"id\" aria-expanded=\"false\" (click)=\"toggleDropdown()\" #dropdownToggle\r\n [attr.data-test-ctw]=\"dataTest\"\r\n [attr.aria-describedby]=\"withTooltip && isTooltipOpened ? 'ctw-tooltip-' + tooltipRandomId : null\"\r\n (mouseenter)=\"withTooltip && tooltipTrigger === 'hover' ? showTooltip() : null\"\r\n (mouseleave)=\"withTooltip && tooltipTrigger === 'hover' ? hideTooltip() : null\">\r\n\r\n <ng-container *ngTemplateOutlet=\"buttonContent\"></ng-container>\r\n\r\n @if(!withOnlyIcon) {\r\n <cw-icon [icon]=\"spriteIcon.down\" [iconSize]=\"iconSizeEnum['2xs']\" class=\"dropdown-icon\"></cw-icon>\r\n }\r\n </button>\r\n\r\n <div [attr.aria-labelledby]=\"id\" class=\"dropdown-menu\" [ngClass]=\"placementCss\" #dropdownMenu>\r\n <ng-content></ng-content>\r\n </div>\r\n </div>\r\n }\r\n</ng-template>\r\n\r\n<!-- Template existant du contenu du bouton -->\r\n<ng-template #buttonContent>\r\n @if (withIcon && iconPosition === buttonPositionEnum.left) {\r\n <ng-container *ngTemplateOutlet=\"iconContent\"></ng-container>\r\n }\r\n\r\n @if(withOnlyIcon) {\r\n <span class=\"visually-hidden\">{{label | translate }}</span>\r\n }\r\n @else {\r\n {{ label | translate }}\r\n }\r\n\r\n @if (withIcon && iconPosition === buttonPositionEnum.right) {\r\n <ng-container *ngTemplateOutlet=\"iconContent\"></ng-container>\r\n }\r\n</ng-template>\r\n\r\n<ng-template #iconContent>\r\n @if(withOnlyIcon) {\r\n @switch(iconSize) {\r\n @case(buttonIconSizeEnum.xsmall) {\r\n <cw-icon [icon]=\"withIcon\" [iconSize]=\"iconSizeEnum['xs']\"></cw-icon>\r\n }\r\n @case(buttonIconSizeEnum.small) {\r\n <cw-icon [icon]=\"withIcon\" [iconSize]=\"iconSizeEnum['xs']\"></cw-icon>\r\n }\r\n @default {\r\n <cw-icon [icon]=\"withIcon\" [iconSize]=\"iconSizeEnum['sm']\"></cw-icon>\r\n }\r\n }\r\n }\r\n @else {\r\n <cw-icon [icon]=\"withIcon\" [iconSize]=\"iconSizeEnum['sm']\"></cw-icon>\r\n }\r\n</ng-template>\r\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "ngmodule", type: TranslateModule }, { kind: "component", type: IconComponent, selector: "cw-icon", inputs: ["icon", "label", "type", "iconSize", "iconCssClass", "iconUiType", "iconColorCustom", "spritePath"] }, { kind: "directive", type: ClickOutsideDirective, selector: "[clickOutside]", outputs: ["clickOutside"] }, { kind: "pipe", type: i2.TranslatePipe, name: "translate" }] }); }
1538
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.20", type: ButtonComponent, isStandalone: true, selector: "cw-button", inputs: { type: "type", label: "label", id: "id", link: "link", isDropdown: "isDropdown", hideCaret: "hideCaret", withIcon: "withIcon", withOnlyIcon: "withOnlyIcon", iconSize: "iconSize", iconPosition: "iconPosition", dropdownPosition: "dropdownPosition", isMinWidth: "isMinWidth", isDisabled: "isDisabled", isLoading: "isLoading", cssClass: "cssClass", dataTest: "dataTest", skeletonMode: "skeletonMode", withTooltip: "withTooltip", tooltipText: "tooltipText", tooltipTitle: "tooltipTitle", tooltipTrigger: "tooltipTrigger", tooltipPosition: "tooltipPosition", tooltipType: "tooltipType" }, outputs: { btnAction: "btnAction", dropDownClicked: "dropDownClicked" }, host: { properties: { "class": "this.hostClasses" } }, viewQueries: [{ propertyName: "dropdown", first: true, predicate: ["dropdown"], descendants: true }, { propertyName: "dropdownMenu", first: true, predicate: ["dropdownMenu"], descendants: true }, { propertyName: "dropdownToggle", first: true, predicate: ["dropdownToggle"], descendants: true }], ngImport: i0, template: "<!-- Wrapper pour le tooltip -->\r\n@if (withTooltip) {\r\n <div class=\"d-inline-block p-relative\" (clickOutside)=\"onTooltipClickOutside()\" ctwClickOutside>\r\n\r\n <ng-container *ngTemplateOutlet=\"buttonTemplate\"></ng-container>\r\n\r\n <!-- Tooltip/Popover -->\r\n @if (isTooltipOpened) {\r\n <div role=\"tooltip\" [id]=\"'ctw-tooltip-' + tooltipRandomId\" [ngClass]=\"tooltipType + ' fade show ' + tooltipType + '-' + tooltipPosition\">\r\n <div class=\"arrow\"></div>\r\n @if (tooltipTitle) {\r\n <div [ngClass]=\"(tooltipType === typeTooltipEnum.popover ? 'popover' : 'tooltip') + '-header'\"\r\n [innerHTML]=\"tooltipTitle | translate\"></div>\r\n }\r\n <div [ngClass]=\"tooltipType + '-body'\"\r\n [innerHTML]=\"tooltipText | translate\"></div>\r\n </div>\r\n }\r\n </div>\r\n}\r\n@else {\r\n <ng-container *ngTemplateOutlet=\"buttonTemplate\"></ng-container>\r\n}\r\n\r\n<!-- Template du bouton (code existant envelopp\u00E9) -->\r\n<ng-template #buttonTemplate>\r\n @if (!isDropdown) {\r\n @if (link != null) {\r\n <a class=\"btn\" [class]=\"'btn-' + type + ' ' + cssClass\" [ngClass]=\"getButtonClasses()\"\r\n [class.disabled]=\"isDisabled\"\r\n [routerLink]=\"isDisabled ? null : link\"\r\n [attr.aria-disabled]=\"isDisabled ? 'true' : null\"\r\n [attr.tabindex]=\"isDisabled ? -1 : null\"\r\n [attr.data-test-ctw]=\"dataTest\"\r\n [attr.aria-describedby]=\"withTooltip && isTooltipOpened ? 'ctw-tooltip-' + tooltipRandomId : null\"\r\n (click)=\"onLinkClick($event); withTooltip && tooltipTrigger === 'click' ? showTooltip() : null\"\r\n (mouseenter)=\"withTooltip && tooltipTrigger === 'hover' ? showTooltip() : null\"\r\n (mouseleave)=\"withTooltip && tooltipTrigger === 'hover' ? hideTooltip() : null\">\r\n\r\n <ng-container *ngTemplateOutlet=\"buttonContent\"></ng-container>\r\n </a>\r\n } @else {\r\n <button type=\"button\" class=\"btn\" [class]=\"'btn-' + type + ' ' + cssClass\" [ngClass]=\"getButtonClasses()\"\r\n [disabled]=\"isDisabled\" (click)=\"onBtnAction()\" [attr.data-test-ctw]=\"dataTest\"\r\n [attr.aria-describedby]=\"withTooltip && isTooltipOpened ? 'ctw-tooltip-' + tooltipRandomId : null\"\r\n (mouseenter)=\"withTooltip && tooltipTrigger === 'hover' ? showTooltip() : null\"\r\n (mouseleave)=\"withTooltip && tooltipTrigger === 'hover' ? hideTooltip() : null\"\r\n (click)=\"withTooltip && tooltipTrigger === 'click' ? showTooltip() : null\">\r\n\r\n @if (isLoading) {\r\n <span class=\"spinner-border spinner-border-sm\" aria-hidden=\"true\"></span>\r\n <span class=\"visually-hidden\" role=\"status\">{{ '_COMMON._HTTP.TXT_LOADING' | translate }}</span>\r\n }\r\n\r\n <ng-container *ngTemplateOutlet=\"buttonContent\"></ng-container>\r\n </button>\r\n }\r\n }\r\n @else {\r\n <div (clickOutside)=\"onClickOutside()\" ctwClickOutside #dropdown class=\"dropdown d-inline-block\">\r\n <button class=\"btn\" [class]=\"'btn-' + type + ' ' + cssClass\" type=\"button\"\r\n [ngClass]=\"getButtonClasses()\"\r\n [disabled]=\"isDisabled\" [id]=\"id\" aria-expanded=\"false\" (click)=\"toggleDropdown()\" #dropdownToggle\r\n [attr.data-test-ctw]=\"dataTest\"\r\n [attr.aria-describedby]=\"withTooltip && isTooltipOpened ? 'ctw-tooltip-' + tooltipRandomId : null\"\r\n (mouseenter)=\"withTooltip && tooltipTrigger === 'hover' ? showTooltip() : null\"\r\n (mouseleave)=\"withTooltip && tooltipTrigger === 'hover' ? hideTooltip() : null\">\r\n\r\n <ng-container *ngTemplateOutlet=\"buttonContent\"></ng-container>\r\n\r\n @if(!hideCaret) {\r\n <cw-icon [icon]=\"spriteIcon.down\" [iconSize]=\"iconSizeEnum['2xs']\" class=\"dropdown-icon\"></cw-icon>\r\n }\r\n </button>\r\n\r\n <div [attr.aria-labelledby]=\"id\" class=\"dropdown-menu\" [ngClass]=\"placementCss\" #dropdownMenu>\r\n <ng-content></ng-content>\r\n </div>\r\n </div>\r\n }\r\n</ng-template>\r\n\r\n<!-- Template existant du contenu du bouton -->\r\n<ng-template #buttonContent>\r\n @if (withIcon && iconPosition === buttonPositionEnum.left) {\r\n <ng-container *ngTemplateOutlet=\"iconContent\"></ng-container>\r\n }\r\n\r\n @if(withOnlyIcon) {\r\n <span class=\"visually-hidden\">{{label | translate }}</span>\r\n }\r\n @else {\r\n {{ label | translate }}\r\n }\r\n\r\n @if (withIcon && iconPosition === buttonPositionEnum.right) {\r\n <ng-container *ngTemplateOutlet=\"iconContent\"></ng-container>\r\n }\r\n</ng-template>\r\n\r\n<ng-template #iconContent>\r\n @if(withOnlyIcon) {\r\n @switch(iconSize) {\r\n @case(buttonIconSizeEnum.xsmall) {\r\n <cw-icon [icon]=\"withIcon\" [iconSize]=\"iconSizeEnum['xs']\"></cw-icon>\r\n }\r\n @case(buttonIconSizeEnum.small) {\r\n <cw-icon [icon]=\"withIcon\" [iconSize]=\"iconSizeEnum['xs']\"></cw-icon>\r\n }\r\n @default {\r\n <cw-icon [icon]=\"withIcon\" [iconSize]=\"iconSizeEnum['sm']\"></cw-icon>\r\n }\r\n }\r\n }\r\n @else {\r\n <cw-icon [icon]=\"withIcon\" [iconSize]=\"iconSizeEnum['sm']\"></cw-icon>\r\n }\r\n</ng-template>\r\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "ngmodule", type: TranslateModule }, { kind: "component", type: IconComponent, selector: "cw-icon", inputs: ["icon", "label", "type", "iconSize", "iconCssClass", "iconUiType", "iconColorCustom", "spritePath"] }, { kind: "directive", type: ClickOutsideDirective, selector: "[clickOutside]", outputs: ["clickOutside"] }, { kind: "directive", type: RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "pipe", type: i2.TranslatePipe, name: "translate" }] }); }
1525
1539
  }
1526
1540
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: ButtonComponent, decorators: [{
1527
1541
  type: Component,
@@ -1529,16 +1543,21 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.20", ngImpo
1529
1543
  CommonModule,
1530
1544
  TranslateModule,
1531
1545
  IconComponent,
1532
- ClickOutsideDirective
1533
- ], template: "<!-- Wrapper pour le tooltip -->\r\n@if (withTooltip) {\r\n <div class=\"d-inline-block p-relative\" (clickOutside)=\"onTooltipClickOutside()\" ctwClickOutside>\r\n\r\n <ng-container *ngTemplateOutlet=\"buttonTemplate\"></ng-container>\r\n\r\n <!-- Tooltip/Popover -->\r\n @if (isTooltipOpened) {\r\n <div role=\"tooltip\" [id]=\"'ctw-tooltip-' + tooltipRandomId\" [ngClass]=\"tooltipType + ' fade show ' + tooltipType + '-' + tooltipPosition\">\r\n <div class=\"arrow\"></div>\r\n @if (tooltipTitle) {\r\n <div [ngClass]=\"(tooltipType === typeTooltipEnum.popover ? 'popover' : 'tooltip') + '-header'\"\r\n [innerHTML]=\"tooltipTitle | translate\"></div>\r\n }\r\n <div [ngClass]=\"tooltipType + '-body'\"\r\n [innerHTML]=\"tooltipText | translate\"></div>\r\n </div>\r\n }\r\n </div>\r\n}\r\n@else {\r\n <ng-container *ngTemplateOutlet=\"buttonTemplate\"></ng-container>\r\n}\r\n\r\n<!-- Template du bouton (code existant envelopp\u00E9) -->\r\n<ng-template #buttonTemplate>\r\n @if (!isDropdown) {\r\n <button type=\"button\" class=\"btn\" [class]=\"'btn-' + type + ' ' + cssClass\" [ngClass]=\"getButtonClasses()\"\r\n [disabled]=\"isDisabled\" (click)=\"onBtnAction()\" [attr.data-test-ctw]=\"dataTest\"\r\n [attr.aria-describedby]=\"withTooltip && isTooltipOpened ? 'ctw-tooltip-' + tooltipRandomId : null\"\r\n (mouseenter)=\"withTooltip && tooltipTrigger === 'hover' ? showTooltip() : null\"\r\n (mouseleave)=\"withTooltip && tooltipTrigger === 'hover' ? hideTooltip() : null\"\r\n (click)=\"withTooltip && tooltipTrigger === 'click' ? showTooltip() : null\">\r\n\r\n @if (isLoading) {\r\n <span class=\"spinner-border spinner-border-sm\" aria-hidden=\"true\"></span>\r\n <span class=\"visually-hidden\" role=\"status\">{{ '_COMMON._HTTP.TXT_LOADING' | translate }}</span>\r\n }\r\n\r\n <ng-container *ngTemplateOutlet=\"buttonContent\"></ng-container>\r\n </button>\r\n }\r\n @else {\r\n <div (clickOutside)=\"onClickOutside()\" ctwClickOutside #dropdown class=\"dropdown d-inline-block\">\r\n <button class=\"btn\" [class]=\"'btn-' + type + ' ' + cssClass\" type=\"button\"\r\n [ngClass]=\"getButtonClasses()\"\r\n [disabled]=\"isDisabled\" [id]=\"id\" aria-expanded=\"false\" (click)=\"toggleDropdown()\" #dropdownToggle\r\n [attr.data-test-ctw]=\"dataTest\"\r\n [attr.aria-describedby]=\"withTooltip && isTooltipOpened ? 'ctw-tooltip-' + tooltipRandomId : null\"\r\n (mouseenter)=\"withTooltip && tooltipTrigger === 'hover' ? showTooltip() : null\"\r\n (mouseleave)=\"withTooltip && tooltipTrigger === 'hover' ? hideTooltip() : null\">\r\n\r\n <ng-container *ngTemplateOutlet=\"buttonContent\"></ng-container>\r\n\r\n @if(!withOnlyIcon) {\r\n <cw-icon [icon]=\"spriteIcon.down\" [iconSize]=\"iconSizeEnum['2xs']\" class=\"dropdown-icon\"></cw-icon>\r\n }\r\n </button>\r\n\r\n <div [attr.aria-labelledby]=\"id\" class=\"dropdown-menu\" [ngClass]=\"placementCss\" #dropdownMenu>\r\n <ng-content></ng-content>\r\n </div>\r\n </div>\r\n }\r\n</ng-template>\r\n\r\n<!-- Template existant du contenu du bouton -->\r\n<ng-template #buttonContent>\r\n @if (withIcon && iconPosition === buttonPositionEnum.left) {\r\n <ng-container *ngTemplateOutlet=\"iconContent\"></ng-container>\r\n }\r\n\r\n @if(withOnlyIcon) {\r\n <span class=\"visually-hidden\">{{label | translate }}</span>\r\n }\r\n @else {\r\n {{ label | translate }}\r\n }\r\n\r\n @if (withIcon && iconPosition === buttonPositionEnum.right) {\r\n <ng-container *ngTemplateOutlet=\"iconContent\"></ng-container>\r\n }\r\n</ng-template>\r\n\r\n<ng-template #iconContent>\r\n @if(withOnlyIcon) {\r\n @switch(iconSize) {\r\n @case(buttonIconSizeEnum.xsmall) {\r\n <cw-icon [icon]=\"withIcon\" [iconSize]=\"iconSizeEnum['xs']\"></cw-icon>\r\n }\r\n @case(buttonIconSizeEnum.small) {\r\n <cw-icon [icon]=\"withIcon\" [iconSize]=\"iconSizeEnum['xs']\"></cw-icon>\r\n }\r\n @default {\r\n <cw-icon [icon]=\"withIcon\" [iconSize]=\"iconSizeEnum['sm']\"></cw-icon>\r\n }\r\n }\r\n }\r\n @else {\r\n <cw-icon [icon]=\"withIcon\" [iconSize]=\"iconSizeEnum['sm']\"></cw-icon>\r\n }\r\n</ng-template>\r\n" }]
1546
+ ClickOutsideDirective,
1547
+ RouterLink
1548
+ ], template: "<!-- Wrapper pour le tooltip -->\r\n@if (withTooltip) {\r\n <div class=\"d-inline-block p-relative\" (clickOutside)=\"onTooltipClickOutside()\" ctwClickOutside>\r\n\r\n <ng-container *ngTemplateOutlet=\"buttonTemplate\"></ng-container>\r\n\r\n <!-- Tooltip/Popover -->\r\n @if (isTooltipOpened) {\r\n <div role=\"tooltip\" [id]=\"'ctw-tooltip-' + tooltipRandomId\" [ngClass]=\"tooltipType + ' fade show ' + tooltipType + '-' + tooltipPosition\">\r\n <div class=\"arrow\"></div>\r\n @if (tooltipTitle) {\r\n <div [ngClass]=\"(tooltipType === typeTooltipEnum.popover ? 'popover' : 'tooltip') + '-header'\"\r\n [innerHTML]=\"tooltipTitle | translate\"></div>\r\n }\r\n <div [ngClass]=\"tooltipType + '-body'\"\r\n [innerHTML]=\"tooltipText | translate\"></div>\r\n </div>\r\n }\r\n </div>\r\n}\r\n@else {\r\n <ng-container *ngTemplateOutlet=\"buttonTemplate\"></ng-container>\r\n}\r\n\r\n<!-- Template du bouton (code existant envelopp\u00E9) -->\r\n<ng-template #buttonTemplate>\r\n @if (!isDropdown) {\r\n @if (link != null) {\r\n <a class=\"btn\" [class]=\"'btn-' + type + ' ' + cssClass\" [ngClass]=\"getButtonClasses()\"\r\n [class.disabled]=\"isDisabled\"\r\n [routerLink]=\"isDisabled ? null : link\"\r\n [attr.aria-disabled]=\"isDisabled ? 'true' : null\"\r\n [attr.tabindex]=\"isDisabled ? -1 : null\"\r\n [attr.data-test-ctw]=\"dataTest\"\r\n [attr.aria-describedby]=\"withTooltip && isTooltipOpened ? 'ctw-tooltip-' + tooltipRandomId : null\"\r\n (click)=\"onLinkClick($event); withTooltip && tooltipTrigger === 'click' ? showTooltip() : null\"\r\n (mouseenter)=\"withTooltip && tooltipTrigger === 'hover' ? showTooltip() : null\"\r\n (mouseleave)=\"withTooltip && tooltipTrigger === 'hover' ? hideTooltip() : null\">\r\n\r\n <ng-container *ngTemplateOutlet=\"buttonContent\"></ng-container>\r\n </a>\r\n } @else {\r\n <button type=\"button\" class=\"btn\" [class]=\"'btn-' + type + ' ' + cssClass\" [ngClass]=\"getButtonClasses()\"\r\n [disabled]=\"isDisabled\" (click)=\"onBtnAction()\" [attr.data-test-ctw]=\"dataTest\"\r\n [attr.aria-describedby]=\"withTooltip && isTooltipOpened ? 'ctw-tooltip-' + tooltipRandomId : null\"\r\n (mouseenter)=\"withTooltip && tooltipTrigger === 'hover' ? showTooltip() : null\"\r\n (mouseleave)=\"withTooltip && tooltipTrigger === 'hover' ? hideTooltip() : null\"\r\n (click)=\"withTooltip && tooltipTrigger === 'click' ? showTooltip() : null\">\r\n\r\n @if (isLoading) {\r\n <span class=\"spinner-border spinner-border-sm\" aria-hidden=\"true\"></span>\r\n <span class=\"visually-hidden\" role=\"status\">{{ '_COMMON._HTTP.TXT_LOADING' | translate }}</span>\r\n }\r\n\r\n <ng-container *ngTemplateOutlet=\"buttonContent\"></ng-container>\r\n </button>\r\n }\r\n }\r\n @else {\r\n <div (clickOutside)=\"onClickOutside()\" ctwClickOutside #dropdown class=\"dropdown d-inline-block\">\r\n <button class=\"btn\" [class]=\"'btn-' + type + ' ' + cssClass\" type=\"button\"\r\n [ngClass]=\"getButtonClasses()\"\r\n [disabled]=\"isDisabled\" [id]=\"id\" aria-expanded=\"false\" (click)=\"toggleDropdown()\" #dropdownToggle\r\n [attr.data-test-ctw]=\"dataTest\"\r\n [attr.aria-describedby]=\"withTooltip && isTooltipOpened ? 'ctw-tooltip-' + tooltipRandomId : null\"\r\n (mouseenter)=\"withTooltip && tooltipTrigger === 'hover' ? showTooltip() : null\"\r\n (mouseleave)=\"withTooltip && tooltipTrigger === 'hover' ? hideTooltip() : null\">\r\n\r\n <ng-container *ngTemplateOutlet=\"buttonContent\"></ng-container>\r\n\r\n @if(!hideCaret) {\r\n <cw-icon [icon]=\"spriteIcon.down\" [iconSize]=\"iconSizeEnum['2xs']\" class=\"dropdown-icon\"></cw-icon>\r\n }\r\n </button>\r\n\r\n <div [attr.aria-labelledby]=\"id\" class=\"dropdown-menu\" [ngClass]=\"placementCss\" #dropdownMenu>\r\n <ng-content></ng-content>\r\n </div>\r\n </div>\r\n }\r\n</ng-template>\r\n\r\n<!-- Template existant du contenu du bouton -->\r\n<ng-template #buttonContent>\r\n @if (withIcon && iconPosition === buttonPositionEnum.left) {\r\n <ng-container *ngTemplateOutlet=\"iconContent\"></ng-container>\r\n }\r\n\r\n @if(withOnlyIcon) {\r\n <span class=\"visually-hidden\">{{label | translate }}</span>\r\n }\r\n @else {\r\n {{ label | translate }}\r\n }\r\n\r\n @if (withIcon && iconPosition === buttonPositionEnum.right) {\r\n <ng-container *ngTemplateOutlet=\"iconContent\"></ng-container>\r\n }\r\n</ng-template>\r\n\r\n<ng-template #iconContent>\r\n @if(withOnlyIcon) {\r\n @switch(iconSize) {\r\n @case(buttonIconSizeEnum.xsmall) {\r\n <cw-icon [icon]=\"withIcon\" [iconSize]=\"iconSizeEnum['xs']\"></cw-icon>\r\n }\r\n @case(buttonIconSizeEnum.small) {\r\n <cw-icon [icon]=\"withIcon\" [iconSize]=\"iconSizeEnum['xs']\"></cw-icon>\r\n }\r\n @default {\r\n <cw-icon [icon]=\"withIcon\" [iconSize]=\"iconSizeEnum['sm']\"></cw-icon>\r\n }\r\n }\r\n }\r\n @else {\r\n <cw-icon [icon]=\"withIcon\" [iconSize]=\"iconSizeEnum['sm']\"></cw-icon>\r\n }\r\n</ng-template>\r\n" }]
1534
1549
  }], ctorParameters: () => [], propDecorators: { type: [{
1535
1550
  type: Input
1536
1551
  }], label: [{
1537
1552
  type: Input
1538
1553
  }], id: [{
1539
1554
  type: Input
1555
+ }], link: [{
1556
+ type: Input
1540
1557
  }], isDropdown: [{
1541
1558
  type: Input
1559
+ }], hideCaret: [{
1560
+ type: Input
1542
1561
  }], withIcon: [{
1543
1562
  type: Input
1544
1563
  }], withOnlyIcon: [{
@@ -1679,61 +1698,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.20", ngImpo
1679
1698
  args: ['dropdownToggle']
1680
1699
  }] } });
1681
1700
 
1682
- class ShowHidePasswordDirective {
1683
- constructor(el, renderer, translateService) {
1684
- this.el = el;
1685
- this.renderer = renderer;
1686
- this.translateService = translateService;
1687
- this.isShown = false;
1688
- }
1689
- ngOnInit() {
1690
- this.setup();
1691
- }
1692
- setup() {
1693
- const div = this.renderer.createElement('div');
1694
- this.renderer.insertBefore(this.el.nativeElement.parentNode, div, this.el.nativeElement);
1695
- this.renderer.appendChild(div, this.el.nativeElement);
1696
- this.renderer.addClass(div, 'see-password-container');
1697
- const button = this.renderer.createElement('button');
1698
- this.renderer.appendChild(this.el.nativeElement.parentNode, button);
1699
- this.renderer.addClass(button, 'btn');
1700
- this.renderer.setAttribute(button, 'type', 'button');
1701
- this.renderer.addClass(button, 'optyweb');
1702
- this.renderer.addClass(button, 'cw-hide-map');
1703
- this.renderer.addClass(button, 'py-2');
1704
- this.renderer.addClass(button, 'see-password');
1705
- const srOnly = this.renderer.createElement('span');
1706
- this.renderer.appendChild(button, srOnly);
1707
- this.renderer.addClass(srOnly, 'visually-hidden');
1708
- this.renderer.setProperty(srOnly, 'innerHTML', this.translateService.instant('_COMMON._FORM._SHOW_HIDE_PWD.SHOW'));
1709
- this.renderer.listen(button, 'click', (event) => {
1710
- this.isShown = !this.isShown;
1711
- if (this.isShown) {
1712
- this.el.nativeElement.setAttribute('type', 'text');
1713
- this.renderer.removeClass(button, 'cw-hide-map');
1714
- this.renderer.addClass(button, 'cw-show-map');
1715
- this.renderer.setProperty(srOnly, 'innerHTML', this.translateService.instant('_COMMON._FORM._SHOW_HIDE_PWD.HIDE'));
1716
- }
1717
- else {
1718
- this.el.nativeElement.setAttribute('type', 'password');
1719
- this.renderer.addClass(button, 'cw-hide-map');
1720
- this.renderer.removeClass(button, 'cw-show-map');
1721
- this.renderer.setProperty(srOnly, 'innerHTML', this.translateService.instant('_COMMON._FORM._SHOW_HIDE_PWD.SHOW'));
1722
- }
1723
- });
1724
- }
1725
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: ShowHidePasswordDirective, deps: [{ token: i0.ElementRef }, { token: i0.Renderer2 }, { token: i2.TranslateService }], target: i0.ɵɵFactoryTarget.Directive }); }
1726
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.20", type: ShowHidePasswordDirective, isStandalone: true, selector: "[showHidePassword]", ngImport: i0 }); }
1727
- }
1728
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: ShowHidePasswordDirective, decorators: [{
1729
- type: Directive,
1730
- args: [{
1731
- // eslint-disable-next-line @angular-eslint/directive-selector
1732
- selector: '[showHidePassword]',
1733
- standalone: true
1734
- }]
1735
- }], ctorParameters: () => [{ type: i0.ElementRef }, { type: i0.Renderer2 }, { type: i2.TranslateService }] });
1736
-
1737
1701
  var FormFieldTypeEnum;
1738
1702
  (function (FormFieldTypeEnum) {
1739
1703
  FormFieldTypeEnum["text"] = "text";
@@ -1766,8 +1730,742 @@ var FormFieldTypeEnum;
1766
1730
  FormFieldTypeEnum["dateComplexe"] = "dateComplexe";
1767
1731
  FormFieldTypeEnum["dateTimeToDateTime"] = "dateTimeToDateTime";
1768
1732
  FormFieldTypeEnum["timeToTime"] = "timeToTime";
1733
+ FormFieldTypeEnum["zipCode"] = "zipCode";
1734
+ FormFieldTypeEnum["phone"] = "phone";
1735
+ FormFieldTypeEnum["autocomplete"] = "autocomplete";
1736
+ FormFieldTypeEnum["autocompleteMultiple"] = "autocompleteMultiple";
1769
1737
  })(FormFieldTypeEnum || (FormFieldTypeEnum = {}));
1770
1738
 
1739
+ /**
1740
+ * Logique clavier W3C grid-combo, isolée en fonctions pures pour testabilité.
1741
+ *
1742
+ * Pattern : https://www.w3.org/WAI/ARIA/apg/patterns/combobox/examples/grid-combo/
1743
+ *
1744
+ * Le focus DOM reste toujours sur l'input combobox. La navigation dans la grille
1745
+ * est virtuelle, via `aria-activedescendant`. Toutes les touches sont reçues sur
1746
+ * l'input ; ces helpers décident des actions à appliquer en fonction de l'état.
1747
+ *
1748
+ * Conventions sur `activeRow` :
1749
+ * -1 : aucune ligne focalisée
1750
+ * -2 : ligne master (mode multi uniquement — sélection en masse)
1751
+ * >=0 : index dans `items[]`
1752
+ */
1753
+ /** Constante pour identifier la ligne master (mode multi). */
1754
+ const MASTER_ROW = -2;
1755
+ /**
1756
+ * Décide quoi faire quand une touche est pressée sur l'input combobox.
1757
+ * Appelle `event.preventDefault()` quand l'action interceptée empêche
1758
+ * le comportement natif (navigation, édition).
1759
+ */
1760
+ function handleComboboxKey(event, state) {
1761
+ const { isOpen, itemsCount, totalCols, activeRow, activeCol, multi } = state;
1762
+ switch (event.key) {
1763
+ case 'ArrowDown': {
1764
+ event.preventDefault();
1765
+ if (!isOpen) {
1766
+ // Ouvre la grille. En multi, on commence par la master pour exposer le toggle global.
1767
+ const firstRow = multi ? MASTER_ROW : 0;
1768
+ return [{ type: 'open' }, { type: 'setActive', row: firstRow, col: 0 }];
1769
+ }
1770
+ if (itemsCount === 0)
1771
+ return [{ type: 'noop' }];
1772
+ // Master → première row réelle
1773
+ if (multi && activeRow === MASTER_ROW) {
1774
+ return [{ type: 'setActive', row: 0, col: activeCol }];
1775
+ }
1776
+ // Dernière row → master (en multi) ou wrap top
1777
+ if (activeRow + 1 >= itemsCount) {
1778
+ return [{ type: 'setActive', row: multi ? MASTER_ROW : 0, col: activeCol }];
1779
+ }
1780
+ return [{ type: 'setActive', row: activeRow + 1, col: activeCol }];
1781
+ }
1782
+ case 'ArrowUp': {
1783
+ event.preventDefault();
1784
+ if (!isOpen) {
1785
+ const lastRow = itemsCount > 0 ? itemsCount - 1 : (multi ? MASTER_ROW : -1);
1786
+ return [
1787
+ { type: 'open' },
1788
+ { type: 'setActive', row: Math.max(MASTER_ROW, lastRow), col: 0 },
1789
+ ];
1790
+ }
1791
+ if (itemsCount === 0 && !multi)
1792
+ return [{ type: 'noop' }];
1793
+ // Master → dernière row (wrap)
1794
+ if (multi && activeRow === MASTER_ROW) {
1795
+ return [{ type: 'setActive', row: itemsCount - 1, col: activeCol }];
1796
+ }
1797
+ // Row 0 → master (en multi) ou wrap fin
1798
+ if (activeRow - 1 < 0) {
1799
+ return [{ type: 'setActive', row: multi ? MASTER_ROW : itemsCount - 1, col: activeCol }];
1800
+ }
1801
+ return [{ type: 'setActive', row: activeRow - 1, col: activeCol }];
1802
+ }
1803
+ case 'ArrowRight': {
1804
+ // W3C : navigation 2D dans la grille quand popup ouverte.
1805
+ // Si grille fermée, master row, aucune ligne active, ou < 2 colonnes : édition native.
1806
+ if (!isOpen || activeRow < 0 || totalCols <= 1)
1807
+ return [{ type: 'noop' }];
1808
+ event.preventDefault();
1809
+ let nextCol = activeCol + 1;
1810
+ let nextRow = activeRow;
1811
+ if (nextCol >= totalCols) {
1812
+ nextCol = 0;
1813
+ nextRow = (nextRow + 1) % itemsCount;
1814
+ }
1815
+ return [{ type: 'setActive', row: nextRow, col: nextCol }];
1816
+ }
1817
+ case 'ArrowLeft': {
1818
+ if (!isOpen || activeRow < 0 || totalCols <= 1)
1819
+ return [{ type: 'noop' }];
1820
+ event.preventDefault();
1821
+ let nextCol = activeCol - 1;
1822
+ let nextRow = activeRow;
1823
+ if (nextCol < 0) {
1824
+ nextCol = totalCols - 1;
1825
+ nextRow = nextRow - 1 < 0 ? itemsCount - 1 : nextRow - 1;
1826
+ }
1827
+ return [{ type: 'setActive', row: nextRow, col: nextCol }];
1828
+ }
1829
+ case 'Enter': {
1830
+ if (!isOpen)
1831
+ return [{ type: 'noop' }];
1832
+ if (multi) {
1833
+ if (activeRow === MASTER_ROW) {
1834
+ event.preventDefault();
1835
+ return [{ type: 'toggleMaster' }];
1836
+ }
1837
+ if (activeRow >= 0 && activeRow < itemsCount) {
1838
+ event.preventDefault();
1839
+ return [{ type: 'toggle', row: activeRow }];
1840
+ }
1841
+ return [{ type: 'noop' }];
1842
+ }
1843
+ if (activeRow >= 0 && activeRow < itemsCount) {
1844
+ event.preventDefault();
1845
+ return [{ type: 'select', row: activeRow }];
1846
+ }
1847
+ return [{ type: 'noop' }];
1848
+ }
1849
+ case ' ': {
1850
+ // Space dans l'input = caractère par défaut. En multi, si une ligne est focalisée,
1851
+ // c'est un toggle (sinon on insère un espace dans la recherche, comportement natif).
1852
+ if (!multi || !isOpen)
1853
+ return [{ type: 'noop' }];
1854
+ if (activeRow === MASTER_ROW) {
1855
+ event.preventDefault();
1856
+ return [{ type: 'toggleMaster' }];
1857
+ }
1858
+ if (activeRow >= 0 && activeRow < itemsCount) {
1859
+ event.preventDefault();
1860
+ return [{ type: 'toggle', row: activeRow }];
1861
+ }
1862
+ return [{ type: 'noop' }];
1863
+ }
1864
+ case 'Escape': {
1865
+ if (isOpen) {
1866
+ event.preventDefault();
1867
+ return [{ type: 'close' }];
1868
+ }
1869
+ // W3C : Esc avec popup fermée vide le champ
1870
+ return [{ type: 'clearInput' }];
1871
+ }
1872
+ case 'Home':
1873
+ case 'End': {
1874
+ // W3C : Home/End ramène le focus dans l'input + position curseur natif.
1875
+ // Comme le focus est déjà sur l'input, on ferme juste la grille
1876
+ // et on laisse le caret se déplacer naturellement (pas de preventDefault).
1877
+ if (isOpen)
1878
+ return [{ type: 'close' }];
1879
+ return [{ type: 'noop' }];
1880
+ }
1881
+ case 'Tab': {
1882
+ // Laisser le Tab natif sortir du champ. On ferme juste la grille.
1883
+ if (isOpen)
1884
+ return [{ type: 'close' }];
1885
+ return [{ type: 'noop' }];
1886
+ }
1887
+ default:
1888
+ return [{ type: 'noop' }];
1889
+ }
1890
+ }
1891
+
1892
+ class AutocompleteComponent {
1893
+ constructor() {
1894
+ this.destroyRef = inject(DestroyRef);
1895
+ // ---------- Required ----------
1896
+ /** FormControl piloté par le parent. Stocke la `valueField` sélectionnée (mono) ou un tableau (multi). */
1897
+ this.control = input.required(...(ngDevMode ? [{ debugName: "control" }] : []));
1898
+ /** Fonction de recherche : reçoit le terme, renvoie un Observable de résultats. */
1899
+ this.fetcher = input.required(...(ngDevMode ? [{ debugName: "fetcher" }] : []));
1900
+ // ---------- Display config ----------
1901
+ /** Clé de l'item utilisée pour l'affichage dans l'input et dans la 1ère colonne de la grille. */
1902
+ this.displayField = input('label', ...(ngDevMode ? [{ debugName: "displayField" }] : []));
1903
+ /** Clé de l'item utilisée pour la valeur stockée dans le FormControl. */
1904
+ this.valueField = input('id', ...(ngDevMode ? [{ debugName: "valueField" }] : []));
1905
+ /** Colonnes additionnelles (au-delà de la colonne 1 qui contient toujours displayField). */
1906
+ this.columns = input([], ...(ngDevMode ? [{ debugName: "columns" }] : []));
1907
+ // ---------- Behavior ----------
1908
+ /** Active la multi-sélection (impl. à l'étape 4). */
1909
+ this.multiple = input(false, ...(ngDevMode ? [{ debugName: "multiple" }] : []));
1910
+ /** Nombre minimum de caractères avant déclenchement du fetcher. */
1911
+ this.minChars = input(2, ...(ngDevMode ? [{ debugName: "minChars" }] : []));
1912
+ /** Délai d'inactivité (ms) avant déclenchement du fetcher après la frappe. */
1913
+ this.debounceMs = input(250, ...(ngDevMode ? [{ debugName: "debounceMs" }] : []));
1914
+ // ---------- Pre-fill ----------
1915
+ /**
1916
+ * Objet sélectionné initial (mono). Si fourni, le composant l'utilise
1917
+ * directement pour afficher le `displayField`. Réactif : si le parent
1918
+ * pousse l'objet plus tard, l'affichage se met à jour automatiquement
1919
+ * (sauf si une frappe utilisateur est en cours).
1920
+ */
1921
+ this.selectedItem = input(null, ...(ngDevMode ? [{ debugName: "selectedItem" }] : []));
1922
+ /**
1923
+ * Resolver optionnel : si seul la `valueField` est connue (ex. FormControl
1924
+ * initialisé avec un id depuis un store), le composant appelle ce resolver
1925
+ * pour récupérer l'item complet et afficher le bon `displayField`.
1926
+ * Non appelé si `selectedItem` est déjà fourni.
1927
+ */
1928
+ this.resolver = input(null, ...(ngDevMode ? [{ debugName: "resolver" }] : []));
1929
+ /** Objets sélectionnés initiaux (multi) — impl. à l'étape 4. */
1930
+ this.selectedItems = input([], ...(ngDevMode ? [{ debugName: "selectedItems" }] : []));
1931
+ // ---------- Standard form-field ----------
1932
+ // Le label visible et l'astérisque required sont rendus par le parent
1933
+ // (cw-form-field). cw-autocomplete ne porte que la sémantique du champ lui-même.
1934
+ this.placeholder = input('', ...(ngDevMode ? [{ debugName: "placeholder" }] : []));
1935
+ this.id = input('', ...(ngDevMode ? [{ debugName: "id" }] : []));
1936
+ /** Pose `aria-required="true"` sur le combobox. L'astérisque visible relève du parent. */
1937
+ this.isRequired = input(false, ...(ngDevMode ? [{ debugName: "isRequired" }] : []));
1938
+ this.isReadonly = input(false, ...(ngDevMode ? [{ debugName: "isReadonly" }] : []));
1939
+ this.isDisabled = input(false, ...(ngDevMode ? [{ debugName: "isDisabled" }] : []));
1940
+ /**
1941
+ * Reflète `aria-invalid` sur l'input combobox. Typiquement piloté par form-field
1942
+ * via `control.invalid && control.touched`.
1943
+ */
1944
+ this.ariaInvalid = input(false, ...(ngDevMode ? [{ debugName: "ariaInvalid" }] : []));
1945
+ /**
1946
+ * Reflète `aria-describedby` sur l'input combobox. Typiquement piloté par form-field
1947
+ * pour pointer ses div d'erreur / d'aide (`error-{name}`, `{name}-help`).
1948
+ */
1949
+ this.ariaDescribedBy = input(null, ...(ngDevMode ? [{ debugName: "ariaDescribedBy" }] : []));
1950
+ // ---------- Outputs ----------
1951
+ this.itemSelected = output();
1952
+ this.itemsChange = output();
1953
+ // ---------- View refs ----------
1954
+ this.gridEl = viewChild('gridEl', ...(ngDevMode ? [{ debugName: "gridEl" }] : []));
1955
+ this.masterCheckbox = viewChild('masterCheckbox', ...(ngDevMode ? [{ debugName: "masterCheckbox" }] : []));
1956
+ /** Exposé au template pour comparer activeRow() à la sentinelle master. */
1957
+ this.MASTER_ROW = MASTER_ROW;
1958
+ // ---------- Internal state ----------
1959
+ /** FormControl interne lié à l'input HTML — porte le texte tapé, pas la valueField. */
1960
+ this.searchInput = new FormControl('', { nonNullable: true });
1961
+ /** Signal miroir de searchInput.value pour réactivité dans les computed. */
1962
+ this.term = signal('', ...(ngDevMode ? [{ debugName: "term" }] : []));
1963
+ this.isOpen = signal(false, ...(ngDevMode ? [{ debugName: "isOpen" }] : []));
1964
+ this.loading = signal(false, ...(ngDevMode ? [{ debugName: "loading" }] : []));
1965
+ this.items = signal([], ...(ngDevMode ? [{ debugName: "items" }] : []));
1966
+ this.activeRow = signal(-1, ...(ngDevMode ? [{ debugName: "activeRow" }] : []));
1967
+ this.activeCol = signal(0, ...(ngDevMode ? [{ debugName: "activeCol" }] : []));
1968
+ /** Dernier item sélectionné (mono), pour restaurer l'affichage si l'utilisateur quitte sans valider. */
1969
+ this.lastSelected = null;
1970
+ /** État interne de la multi-sélection (liste cumulative à travers les recherches). */
1971
+ this.selectedItemsState = signal([], ...(ngDevMode ? [{ debugName: "selectedItemsState" }] : []));
1972
+ /** Id stable utilisé pour préfixer les ids ARIA (combobox, grid, cells). */
1973
+ this._randomId = Math.floor(Math.random() * 1_000_000);
1974
+ /** Devient true après le passage de ngOnInit — les effects ignorent les runs avant ça. */
1975
+ this._initialized = signal(false, ...(ngDevMode ? [{ debugName: "_initialized" }] : []));
1976
+ // ---------- Computed ----------
1977
+ this.resolvedId = computed(() => this.id() || `cw-ac-${this._randomId}`, ...(ngDevMode ? [{ debugName: "resolvedId" }] : []));
1978
+ this.gridId = computed(() => `${this.resolvedId()}-grid`, ...(ngDevMode ? [{ debugName: "gridId" }] : []));
1979
+ this.liveId = computed(() => `${this.resolvedId()}-live`, ...(ngDevMode ? [{ debugName: "liveId" }] : []));
1980
+ this.totalCols = computed(() => 1 + this.columns().length, ...(ngDevMode ? [{ debugName: "totalCols" }] : []));
1981
+ this.showGrid = computed(() => this.isOpen() && this.items().length > 0, ...(ngDevMode ? [{ debugName: "showGrid" }] : []));
1982
+ this.showNoResult = computed(() => this.isOpen() &&
1983
+ !this.loading() &&
1984
+ this.items().length === 0 &&
1985
+ this.term().length >= this.minChars(), ...(ngDevMode ? [{ debugName: "showNoResult" }] : []));
1986
+ /** Id de la cellule active courante (alimente aria-activedescendant). */
1987
+ this.activeDescendant = computed(() => {
1988
+ if (!this.isOpen())
1989
+ return null;
1990
+ const row = this.activeRow();
1991
+ if (row === MASTER_ROW)
1992
+ return this.masterCellId();
1993
+ if (row < 0)
1994
+ return null;
1995
+ return this.cellId(row, this.activeCol());
1996
+ }, ...(ngDevMode ? [{ debugName: "activeDescendant" }] : []));
1997
+ /**
1998
+ * Items visibles éligibles au master (exclut les `disabled` qui ne sont jamais
1999
+ * cochables/décochables via select-all).
2000
+ */
2001
+ this.selectableItems = computed(() => this.items().filter((it) => !this.isItemDisabled(it)), ...(ngDevMode ? [{ debugName: "selectableItems" }] : []));
2002
+ /** Combien d'items affichés (hors disabled) sont sélectionnés. Sert au master state. */
2003
+ this.currentSelectedCount = computed(() => {
2004
+ const sel = this.selectedItemsState();
2005
+ const val = this.valueField();
2006
+ return this.selectableItems().filter((it) => sel.some((s) => s[val] === it[val])).length;
2007
+ }, ...(ngDevMode ? [{ debugName: "currentSelectedCount" }] : []));
2008
+ /** État de la case master : 'unchecked' | 'indeterminate' | 'checked'. */
2009
+ this.masterState = computed(() => {
2010
+ const total = this.selectableItems().length;
2011
+ const sel = this.currentSelectedCount();
2012
+ if (total === 0)
2013
+ return 'unchecked';
2014
+ if (sel === 0)
2015
+ return 'unchecked';
2016
+ if (sel === total)
2017
+ return 'checked';
2018
+ return 'indeterminate';
2019
+ }, ...(ngDevMode ? [{ debugName: "masterState" }] : []));
2020
+ /**
2021
+ * Indique s'il y a quelque chose à vider via un bouton clear externe.
2022
+ * Mono : texte tapé OU valueField sélectionnée non nulle.
2023
+ * Multi : texte tapé OU au moins un item sélectionné.
2024
+ * Utilisé par form-field pour décider d'afficher son bouton clear.
2025
+ */
2026
+ this.hasAnyContent = computed(() => {
2027
+ if (this.multiple()) {
2028
+ return this.term().length > 0 || this.selectedItemsState().length > 0;
2029
+ }
2030
+ return this.term().length > 0 || this.control().value != null;
2031
+ }, ...(ngDevMode ? [{ debugName: "hasAnyContent" }] : []));
2032
+ /** Clé i18n du message de live region (annonces SR). */
2033
+ this.liveMessageKey = computed(() => {
2034
+ if (this.loading())
2035
+ return null;
2036
+ if (this.showNoResult())
2037
+ return '_COMMON.NO_RESULT';
2038
+ if (!this.isOpen() || this.items().length === 0)
2039
+ return null;
2040
+ return this.items().length === 1
2041
+ ? '_COMMON._PAGINATION.RESULT_S'
2042
+ : '_COMMON._PAGINATION.RESULT_P';
2043
+ }, ...(ngDevMode ? [{ debugName: "liveMessageKey" }] : []));
2044
+ // Sync isDisabled signal -> FormControl interne (évite le warning runtime
2045
+ // "disabled attribute on a reactive form directive").
2046
+ effect(() => {
2047
+ if (this.isDisabled()) {
2048
+ this.searchInput.disable({ emitEvent: false });
2049
+ }
2050
+ else {
2051
+ this.searchInput.enable({ emitEvent: false });
2052
+ }
2053
+ });
2054
+ // Sync selectedItem -> affichage. Ne touche à rien tant que ngOnInit
2055
+ // n'a pas posé l'état initial (sinon on doublonne avec resolveInitialValue).
2056
+ effect(() => {
2057
+ const item = this.selectedItem();
2058
+ if (!this._initialized())
2059
+ return;
2060
+ if (this.multiple())
2061
+ return; // ignoré en multi
2062
+ if (this.isOpen())
2063
+ return; // ne pas écraser une saisie en cours
2064
+ if (item) {
2065
+ this.applySelected(item);
2066
+ }
2067
+ });
2068
+ // Sync selectedItems (multi) -> état interne, après init seulement.
2069
+ effect(() => {
2070
+ const items = this.selectedItems();
2071
+ if (!this._initialized())
2072
+ return;
2073
+ if (!this.multiple())
2074
+ return;
2075
+ // Évite reset si déjà identique (référence) — Angular signals court-circuitent déjà.
2076
+ this.selectedItemsState.set([...items]);
2077
+ });
2078
+ // Sync masterState -> propriété DOM 'indeterminate' (pas d'attribut HTML natif).
2079
+ effect(() => {
2080
+ const state = this.masterState();
2081
+ const ref = this.masterCheckbox();
2082
+ if (ref) {
2083
+ ref.nativeElement.indeterminate = state === 'indeterminate';
2084
+ }
2085
+ });
2086
+ }
2087
+ // ---------- Lifecycle ----------
2088
+ ngOnInit() {
2089
+ // Init multi : copie initiale depuis [selectedItems] (avant que _initialized passe à true).
2090
+ if (this.multiple()) {
2091
+ this.selectedItemsState.set([...this.selectedItems()]);
2092
+ }
2093
+ // Résolution de la valeur initiale dans cet ordre (mono uniquement) :
2094
+ // 1. [selectedItem] fourni → utilisé directement (synchrone)
2095
+ // 2. control.value présent + [resolver] fourni → appel async puis affichage
2096
+ // 3. control.value présent sans resolver → fallback : affichage brut du cast string
2097
+ if (!this.multiple()) {
2098
+ this.resolveInitialValue();
2099
+ }
2100
+ this._initialized.set(true);
2101
+ // Observe le control parent pour réagir aux resets externes (bouton clear
2102
+ // de form-field en mono, patchValue programmatique, etc.). Si le control
2103
+ // est remis à null/undefined (mono) ou à [] (multi), on vide l'état interne.
2104
+ this.control().valueChanges
2105
+ .pipe(takeUntilDestroyed(this.destroyRef))
2106
+ .subscribe((value) => {
2107
+ if (this.multiple()) {
2108
+ if (value == null || (Array.isArray(value) && value.length === 0)) {
2109
+ this.selectedItemsState.set([]);
2110
+ this.searchInput.setValue('', { emitEvent: false });
2111
+ this.term.set('');
2112
+ this.items.set([]);
2113
+ this.isOpen.set(false);
2114
+ }
2115
+ }
2116
+ else {
2117
+ if (value == null || value === '') {
2118
+ this.lastSelected = null;
2119
+ this.searchInput.setValue('', { emitEvent: false });
2120
+ this.term.set('');
2121
+ this.items.set([]);
2122
+ this.isOpen.set(false);
2123
+ }
2124
+ }
2125
+ });
2126
+ // Pipe typeahead : déclenche le fetcher avec debounce + minChars + switchMap.
2127
+ this.searchInput.valueChanges
2128
+ .pipe(tap((t) => this.term.set(t ?? '')), tap((t) => {
2129
+ if ((t?.length ?? 0) < this.minChars()) {
2130
+ this.items.set([]);
2131
+ this.activeRow.set(-1);
2132
+ this.loading.set(false);
2133
+ }
2134
+ }), filter((t) => (t?.length ?? 0) >= this.minChars()), tap(() => {
2135
+ this.loading.set(true);
2136
+ this.isOpen.set(true);
2137
+ }), debounceTime(this.debounceMs()), switchMap((t) => this.fetcher()(t).pipe(catchError(() => of([])))), tap((items) => {
2138
+ this.items.set(items);
2139
+ this.loading.set(false);
2140
+ this.activeRow.set(items.length > 0 ? 0 : -1);
2141
+ this.activeCol.set(0);
2142
+ }), takeUntilDestroyed(this.destroyRef))
2143
+ .subscribe();
2144
+ }
2145
+ // ---------- Template helpers ----------
2146
+ cellId(row, col) {
2147
+ return `${this.resolvedId()}-r${row}-c${col}`;
2148
+ }
2149
+ rowId(row) {
2150
+ return `${this.resolvedId()}-r${row}`;
2151
+ }
2152
+ masterRowId() {
2153
+ return `${this.resolvedId()}-master-row`;
2154
+ }
2155
+ masterCellId() {
2156
+ return `${this.resolvedId()}-master-cell`;
2157
+ }
2158
+ /** Compare un item à la liste des sélectionnés via valueField. */
2159
+ isItemSelected(item) {
2160
+ const val = this.valueField();
2161
+ return this.selectedItemsState().some((s) => s[val] === item[val]);
2162
+ }
2163
+ /** Convention `disabled: true` sur l'item — non sélectionnable, non togglable. */
2164
+ isItemDisabled(item) {
2165
+ return !!item['disabled'];
2166
+ }
2167
+ getDisplay(item) {
2168
+ if (!item)
2169
+ return '';
2170
+ return String(item[this.displayField()] ?? '');
2171
+ }
2172
+ getCellText(item, colIndex) {
2173
+ const field = colIndex === 0 ? this.displayField() : this.columns()[colIndex - 1].field;
2174
+ return String(item[field] ?? '');
2175
+ }
2176
+ /**
2177
+ * Échappe le HTML puis entoure les occurrences du terme courant par <mark>.
2178
+ * Le résultat est binding-é via [innerHTML] (Angular sanitize la sortie).
2179
+ */
2180
+ highlight(text) {
2181
+ const t = this.term();
2182
+ const escaped = this.escapeHtml(text);
2183
+ if (!t)
2184
+ return escaped;
2185
+ const re = new RegExp(`(${this.escapeRegex(t)})`, 'gi');
2186
+ return escaped.replace(re, '<mark>$1</mark>');
2187
+ }
2188
+ // ---------- DOM event handlers ----------
2189
+ onFocus() {
2190
+ // Si on a déjà des résultats en mémoire, on rouvre directement.
2191
+ if (this.items().length > 0) {
2192
+ this.isOpen.set(true);
2193
+ }
2194
+ }
2195
+ /**
2196
+ * Marque le `control` parent comme `touched` à la perte de focus.
2197
+ * Sans ça, form-field ne voit jamais le control comme touché (le blur de
2198
+ * l'input HTML interne touche seulement `searchInput`, pas `control`),
2199
+ * et le message d'erreur required ne s'affiche pas.
2200
+ * Le clic sur la grille ne déclenche pas ce blur grâce au preventDefault
2201
+ * posé sur son mousedown.
2202
+ */
2203
+ onBlur() {
2204
+ this.control().markAsTouched();
2205
+ }
2206
+ onClickOutside() {
2207
+ this.close();
2208
+ }
2209
+ onKeyDown(event) {
2210
+ const actions = handleComboboxKey(event, {
2211
+ isOpen: this.isOpen(),
2212
+ itemsCount: this.items().length,
2213
+ totalCols: this.totalCols(),
2214
+ activeRow: this.activeRow(),
2215
+ activeCol: this.activeCol(),
2216
+ multi: this.multiple(),
2217
+ });
2218
+ for (const a of actions)
2219
+ this.applyAction(a);
2220
+ }
2221
+ onChipRemove(item) {
2222
+ if (this.isDisabled() || this.isReadonly())
2223
+ return;
2224
+ this.toggleItem(item);
2225
+ }
2226
+ /**
2227
+ * Vide intégralement l'état du composant. Appelé par le bouton clear de
2228
+ * form-field. Vide le texte tapé, ferme la grille, et reset le control parent
2229
+ * (null en mono, [] en multi) — ce qui déclenche aussi notre subscription
2230
+ * valueChanges (idempotente).
2231
+ */
2232
+ clear() {
2233
+ this.searchInput.setValue('', { emitEvent: false });
2234
+ this.term.set('');
2235
+ this.items.set([]);
2236
+ this.isOpen.set(false);
2237
+ if (this.multiple()) {
2238
+ this.selectedItemsState.set([]);
2239
+ this.control().setValue([]);
2240
+ this.itemsChange.emit([]);
2241
+ }
2242
+ else {
2243
+ this.lastSelected = null;
2244
+ this.control().setValue(null);
2245
+ }
2246
+ }
2247
+ onMasterClick() {
2248
+ this.toggleMaster();
2249
+ }
2250
+ onMasterMouseEnter() {
2251
+ this.activeRow.set(MASTER_ROW);
2252
+ this.activeCol.set(0);
2253
+ }
2254
+ onRowClick(row) {
2255
+ this.selectRow(row);
2256
+ }
2257
+ onRowMouseEnter(row) {
2258
+ this.activeRow.set(row);
2259
+ this.activeCol.set(0);
2260
+ }
2261
+ // ---------- Internal logic ----------
2262
+ resolveInitialValue() {
2263
+ const item = this.selectedItem();
2264
+ if (item) {
2265
+ this.applySelected(item);
2266
+ return;
2267
+ }
2268
+ const value = this.control().value;
2269
+ if (value == null || value === '')
2270
+ return;
2271
+ const resolver = this.resolver();
2272
+ if (resolver) {
2273
+ resolver(value)
2274
+ .pipe(catchError(() => of(null)), takeUntilDestroyed(this.destroyRef))
2275
+ .subscribe((resolved) => {
2276
+ if (resolved) {
2277
+ this.applySelected(resolved);
2278
+ }
2279
+ else {
2280
+ this.applyRawValue(value);
2281
+ }
2282
+ });
2283
+ }
2284
+ else {
2285
+ this.applyRawValue(value);
2286
+ }
2287
+ }
2288
+ /** Pose un item sélectionné comme état courant (init ou changement externe). */
2289
+ applySelected(item) {
2290
+ this.lastSelected = item;
2291
+ const display = this.getDisplay(item);
2292
+ this.searchInput.setValue(display, { emitEvent: false });
2293
+ this.term.set(display);
2294
+ }
2295
+ /** Fallback quand on n'a ni selectedItem ni resolver : affiche la valueField castée. */
2296
+ applyRawValue(value) {
2297
+ this.lastSelected = null;
2298
+ const display = value == null ? '' : String(value);
2299
+ this.searchInput.setValue(display, { emitEvent: false });
2300
+ this.term.set(display);
2301
+ }
2302
+ applyAction(a) {
2303
+ switch (a.type) {
2304
+ case 'open':
2305
+ this.isOpen.set(true);
2306
+ break;
2307
+ case 'close':
2308
+ this.close();
2309
+ break;
2310
+ case 'setActive':
2311
+ // Master row (-2) est valide en multi ; sinon on borne aux items réels.
2312
+ if (a.row === MASTER_ROW && this.multiple()) {
2313
+ this.activeRow.set(MASTER_ROW);
2314
+ this.activeCol.set(0);
2315
+ this.scrollActiveIntoView();
2316
+ }
2317
+ else if (a.row >= 0 && a.row < this.items().length) {
2318
+ this.activeRow.set(a.row);
2319
+ this.activeCol.set(a.col);
2320
+ this.scrollActiveIntoView();
2321
+ }
2322
+ break;
2323
+ case 'select':
2324
+ this.selectRow(a.row);
2325
+ break;
2326
+ case 'toggle': {
2327
+ const item = this.items()[a.row];
2328
+ if (item)
2329
+ this.toggleItem(item);
2330
+ break;
2331
+ }
2332
+ case 'toggleMaster':
2333
+ this.toggleMaster();
2334
+ break;
2335
+ case 'clearInput':
2336
+ this.searchInput.setValue('');
2337
+ this.term.set('');
2338
+ if (!this.multiple()) {
2339
+ this.lastSelected = null;
2340
+ this.control().setValue(null);
2341
+ }
2342
+ break;
2343
+ case 'noop':
2344
+ break;
2345
+ }
2346
+ }
2347
+ /**
2348
+ * Toggle d'un item en multi-sélection. La grille reste ouverte, le terme tapé
2349
+ * est conservé. Le FormControl reçoit le tableau des valueFields.
2350
+ * Un item `disabled` est ignoré (ni ajout ni retrait).
2351
+ */
2352
+ toggleItem(item) {
2353
+ if (this.isItemDisabled(item))
2354
+ return;
2355
+ const val = this.valueField();
2356
+ const current = this.selectedItemsState();
2357
+ const idx = current.findIndex((s) => s[val] === item[val]);
2358
+ const next = idx >= 0
2359
+ ? [...current.slice(0, idx), ...current.slice(idx + 1)]
2360
+ : [...current, item];
2361
+ this.selectedItemsState.set(next);
2362
+ this.control().setValue(next.map((s) => s[val]));
2363
+ this.itemSelected.emit(item);
2364
+ this.itemsChange.emit(next);
2365
+ }
2366
+ /**
2367
+ * Toggle master : si tous les items affichés (hors disabled) sont cochés → décoche
2368
+ * les N éligibles affichés ; sinon → coche tous les non-cochés éligibles affichés.
2369
+ * Les items hors recherche actuelle et les items `disabled` ne sont jamais touchés.
2370
+ */
2371
+ toggleMaster() {
2372
+ const val = this.valueField();
2373
+ const eligible = this.selectableItems();
2374
+ const current = this.selectedItemsState();
2375
+ const allChecked = this.masterState() === 'checked';
2376
+ let next;
2377
+ if (allChecked) {
2378
+ next = current.filter((s) => !eligible.some((v) => v[val] === s[val]));
2379
+ }
2380
+ else {
2381
+ const toAdd = eligible.filter((v) => !current.some((s) => s[val] === v[val]));
2382
+ next = [...current, ...toAdd];
2383
+ }
2384
+ this.selectedItemsState.set(next);
2385
+ this.control().setValue(next.map((s) => s[val]));
2386
+ this.itemsChange.emit(next);
2387
+ }
2388
+ selectRow(row) {
2389
+ const item = this.items()[row];
2390
+ if (!item)
2391
+ return;
2392
+ if (this.isItemDisabled(item))
2393
+ return;
2394
+ // En multi, la sélection passe par toggle (clic ligne = coche/décoche sans fermer).
2395
+ if (this.multiple()) {
2396
+ this.toggleItem(item);
2397
+ return;
2398
+ }
2399
+ this.lastSelected = item;
2400
+ const display = this.getDisplay(item);
2401
+ this.searchInput.setValue(display, { emitEvent: false });
2402
+ this.term.set(display);
2403
+ this.control().setValue(item[this.valueField()]);
2404
+ this.itemSelected.emit(item);
2405
+ this.close();
2406
+ }
2407
+ close() {
2408
+ this.isOpen.set(false);
2409
+ this.activeRow.set(-1);
2410
+ this.activeCol.set(0);
2411
+ if (this.multiple()) {
2412
+ // En multi : on vide le terme tapé à la fermeture, les items sélectionnés
2413
+ // restent dans formControl + chips. Pas de notion de lastSelected.
2414
+ this.searchInput.setValue('', { emitEvent: false });
2415
+ this.term.set('');
2416
+ this.items.set([]);
2417
+ return;
2418
+ }
2419
+ // Mono — sélection obligatoire : si la valeur tapée ne correspond pas au
2420
+ // lastSelected, on restaure (l'utilisateur a quitté sans valider).
2421
+ const expected = this.getDisplay(this.lastSelected);
2422
+ if (this.searchInput.value !== expected) {
2423
+ this.searchInput.setValue(expected, { emitEvent: false });
2424
+ this.term.set(expected);
2425
+ this.control().setValue(this.lastSelected ? this.lastSelected[this.valueField()] : null);
2426
+ }
2427
+ }
2428
+ /**
2429
+ * Scroll la cellule active dans la vue. W3C : les navigateurs ne le font pas
2430
+ * pour aria-activedescendant, c'est à nous de le faire (critique pour le zoom).
2431
+ */
2432
+ scrollActiveIntoView() {
2433
+ queueMicrotask(() => {
2434
+ const grid = this.gridEl()?.nativeElement;
2435
+ const id = this.activeDescendant();
2436
+ if (!grid || !id)
2437
+ return;
2438
+ const cell = grid.querySelector(`[id="${id}"]`);
2439
+ cell?.scrollIntoView({ block: 'nearest', inline: 'nearest' });
2440
+ });
2441
+ }
2442
+ // ---------- Utilities ----------
2443
+ escapeHtml(s) {
2444
+ const map = {
2445
+ '&': '&amp;',
2446
+ '<': '&lt;',
2447
+ '>': '&gt;',
2448
+ '"': '&quot;',
2449
+ "'": '&#39;',
2450
+ };
2451
+ return s.replace(/[&<>"']/g, (c) => map[c]);
2452
+ }
2453
+ escapeRegex(s) {
2454
+ return s.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
2455
+ }
2456
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: AutocompleteComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
2457
+ 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: "gridEl", first: true, predicate: ["gridEl"], descendants: true, isSignal: true }, { propertyName: "masterCheckbox", first: true, predicate: ["masterCheckbox"], descendants: true, isSignal: true }], ngImport: i0, template: "<div\n class=\"cw-autocomplete-wrapper\"\n (clickOutside)=\"onClickOutside()\">\n\n <div class=\"field-group\">\n <input\n type=\"text\"\n class=\"field-control cw-autocomplete-input\"\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=\"grid\"\n [attr.aria-expanded]=\"isOpen()\"\n [attr.aria-controls]=\"gridId()\"\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 <span class=\"spinner-border spinner-border-sm\" aria-hidden=\"true\"></span>\n }\n </div>\n\n @if (showGrid()) {\n <div\n #gridEl\n class=\"cw-autocomplete-grid\"\n role=\"grid\"\n [id]=\"gridId()\"\n [attr.aria-labelledby]=\"resolvedId()\"\n [style.--cw-ac-cols]=\"totalCols() + (multiple() ? 1 : 0)\"\n (mousedown)=\"$event.preventDefault()\">\n\n @if (multiple()) {\n <div\n role=\"row\"\n [id]=\"masterRowId()\"\n class=\"cw-autocomplete-row cw-autocomplete-row-master\"\n [class.is-active]=\"activeRow() === MASTER_ROW\"\n (mouseenter)=\"onMasterMouseEnter()\"\n (click)=\"onMasterClick()\">\n <div\n role=\"gridcell\"\n [id]=\"masterCellId()\"\n class=\"cw-autocomplete-cell cw-autocomplete-cell-check\"\n [class.is-active]=\"activeRow() === MASTER_ROW\"\n [attr.aria-selected]=\"activeRow() === MASTER_ROW ? 'true' : null\">\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=\"cw-autocomplete-master-label\">\n {{ (masterState() === 'checked'\n ? '_COMMON._ACTION.DESELECT_ALL'\n : '_COMMON._ACTION.SELECT_ALL') | translate }}\n </span>\n </div>\n </div>\n }\n\n @for (item of items(); track $index; let rowIdx = $index) {\n <div\n role=\"row\"\n [id]=\"rowId(rowIdx)\"\n class=\"cw-autocomplete-row\"\n [class.is-active]=\"activeRow() === rowIdx\"\n [class.is-disabled]=\"isItemDisabled(item)\"\n [attr.aria-selected]=\"multiple() ? (isItemSelected(item) ? 'true' : 'false') : null\"\n [attr.aria-disabled]=\"isItemDisabled(item) ? 'true' : null\"\n (mouseenter)=\"onRowMouseEnter(rowIdx)\"\n (click)=\"onRowClick(rowIdx)\">\n\n @if (multiple()) {\n <div\n role=\"gridcell\"\n class=\"cw-autocomplete-cell cw-autocomplete-cell-check\"\n [attr.aria-selected]=\"null\">\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 </div>\n }\n\n <div\n role=\"gridcell\"\n [id]=\"cellId(rowIdx, 0)\"\n class=\"cw-autocomplete-cell\"\n [class.is-active]=\"activeRow() === rowIdx && activeCol() === 0\"\n [attr.aria-selected]=\"activeRow() === rowIdx && activeCol() === 0 ? 'true' : null\"\n [innerHTML]=\"highlight(getCellText(item, 0))\">\n </div>\n\n @for (col of columns(); track col.field; let colIdx = $index) {\n <div\n role=\"gridcell\"\n [id]=\"cellId(rowIdx, colIdx + 1)\"\n class=\"cw-autocomplete-cell\"\n [class.is-active]=\"activeRow() === rowIdx && activeCol() === (colIdx + 1)\"\n [attr.aria-selected]=\"activeRow() === rowIdx && activeCol() === (colIdx + 1) ? 'true' : null\"\n [innerHTML]=\"highlight(getCellText(item, colIdx + 1))\">\n </div>\n }\n </div>\n }\n </div>\n }\n\n @if (showNoResult()) {\n <div class=\"cw-autocomplete-no-result\" aria-hidden=\"true\">\n {{ '_COMMON.NO_RESULT' | translate }}\n </div>\n }\n</div>\n\n @if (multiple() && selectedItemsState().length > 0) {\n <ul class=\"cw-autocomplete-chips\" role=\"list\">\n @for (item of selectedItemsState(); track item[valueField()]) {\n <li>\n <button\n type=\"button\"\n class=\"cw-autocomplete-chip\"\n [disabled]=\"isDisabled() || isReadonly()\"\n (click)=\"onChipRemove(item)\">\n <span>{{ getDisplay(item) }}</span>\n @if (!isDisabled() && !isReadonly()) {\n <span aria-hidden=\"true\" class=\"cw-autocomplete-chip-x\">&times;</span>\n <span class=\"visually-hidden\">\n {{ '_COMMON._ACTION.DELETE' | translate }}\n </span>\n }\n </button>\n </li>\n }\n </ul>\n }\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%}.cw-autocomplete-wrapper{position:relative}.cw-autocomplete-grid{position:absolute;top:100%;left:0;right:0;z-index:1100;margin-top:2px;max-height:16rem;overflow-y:auto;background-color:var(--bs-body-bg, #fff);border:1px solid var(--bs-border-color, #dee2e6);border-radius:.25rem;box-shadow:0 .25rem .75rem #0000001a}.cw-autocomplete-row{display:grid;grid-template-columns:repeat(var(--cw-ac-cols, 1),minmax(0,1fr));align-items:center;cursor:pointer;padding:0}.cw-autocomplete-row.is-active{background-color:var(--bs-primary-bg-subtle, rgba(13, 110, 253, .08))}.cw-autocomplete-row.is-disabled{cursor:not-allowed;opacity:.55}.cw-autocomplete-row.is-disabled.is-active{background-color:var(--bs-secondary-bg-subtle, rgba(0, 0, 0, .04))}.cw-autocomplete-row-master{display:flex;align-items:center;gap:.5rem;padding:.375rem .75rem;background-color:var(--bs-tertiary-bg, #f8f9fa);border-bottom:1px solid var(--bs-border-color, #dee2e6);font-weight:500}.cw-autocomplete-row-master.is-active{background-color:var(--bs-primary-bg-subtle, rgba(13, 110, 253, .12))}.cw-autocomplete-cell{padding:.375rem .75rem;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.cw-autocomplete-cell mark{background-color:transparent;color:inherit;font-weight:700;padding:0}.cw-autocomplete-cell-check{display:flex;align-items:center;gap:.5rem;padding:.375rem .5rem;width:auto;flex:0 0 auto}.cw-autocomplete-cell-check input[type=checkbox]{margin:0;pointer-events:none}.cw-autocomplete-master-label{-webkit-user-select:none;user-select:none}.cw-autocomplete-no-result{position:absolute;top:100%;left:0;right:0;z-index:1100;margin-top:2px;padding:.5rem .75rem;background-color:var(--bs-body-bg, #fff);border:1px solid var(--bs-border-color, #dee2e6);border-radius:.25rem;color:var(--bs-secondary-color, #6c757d);font-style:italic}.cw-autocomplete-chips{display:flex;flex-wrap:wrap;gap:.25rem;margin:.5rem 0 0;padding:0;list-style:none}.cw-autocomplete-chip{display:inline-flex;align-items:center;gap:.375rem;padding:.125rem .5rem;background-color:var(--bs-secondary-bg-subtle, #e9ecef);border:1px solid var(--bs-border-color, #dee2e6);border-radius:1rem;font-size:.875rem;line-height:1.4;cursor:pointer;color:inherit}.cw-autocomplete-chip:hover,.cw-autocomplete-chip:focus-visible{background-color:var(--bs-secondary-bg, #dee2e6);outline:none}.cw-autocomplete-chip:disabled{cursor:not-allowed;opacity:.65;pointer-events:none}.cw-autocomplete-chip-x{font-size:1rem;line-height:1;font-weight:700}\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" }] }); }
2458
+ }
2459
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: AutocompleteComponent, decorators: [{
2460
+ type: Component,
2461
+ args: [{ selector: 'cw-autocomplete', standalone: true, imports: [
2462
+ CommonModule,
2463
+ ReactiveFormsModule,
2464
+ TranslateModule,
2465
+ ClickOutsideDirective
2466
+ ], template: "<div\n class=\"cw-autocomplete-wrapper\"\n (clickOutside)=\"onClickOutside()\">\n\n <div class=\"field-group\">\n <input\n type=\"text\"\n class=\"field-control cw-autocomplete-input\"\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=\"grid\"\n [attr.aria-expanded]=\"isOpen()\"\n [attr.aria-controls]=\"gridId()\"\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 <span class=\"spinner-border spinner-border-sm\" aria-hidden=\"true\"></span>\n }\n </div>\n\n @if (showGrid()) {\n <div\n #gridEl\n class=\"cw-autocomplete-grid\"\n role=\"grid\"\n [id]=\"gridId()\"\n [attr.aria-labelledby]=\"resolvedId()\"\n [style.--cw-ac-cols]=\"totalCols() + (multiple() ? 1 : 0)\"\n (mousedown)=\"$event.preventDefault()\">\n\n @if (multiple()) {\n <div\n role=\"row\"\n [id]=\"masterRowId()\"\n class=\"cw-autocomplete-row cw-autocomplete-row-master\"\n [class.is-active]=\"activeRow() === MASTER_ROW\"\n (mouseenter)=\"onMasterMouseEnter()\"\n (click)=\"onMasterClick()\">\n <div\n role=\"gridcell\"\n [id]=\"masterCellId()\"\n class=\"cw-autocomplete-cell cw-autocomplete-cell-check\"\n [class.is-active]=\"activeRow() === MASTER_ROW\"\n [attr.aria-selected]=\"activeRow() === MASTER_ROW ? 'true' : null\">\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=\"cw-autocomplete-master-label\">\n {{ (masterState() === 'checked'\n ? '_COMMON._ACTION.DESELECT_ALL'\n : '_COMMON._ACTION.SELECT_ALL') | translate }}\n </span>\n </div>\n </div>\n }\n\n @for (item of items(); track $index; let rowIdx = $index) {\n <div\n role=\"row\"\n [id]=\"rowId(rowIdx)\"\n class=\"cw-autocomplete-row\"\n [class.is-active]=\"activeRow() === rowIdx\"\n [class.is-disabled]=\"isItemDisabled(item)\"\n [attr.aria-selected]=\"multiple() ? (isItemSelected(item) ? 'true' : 'false') : null\"\n [attr.aria-disabled]=\"isItemDisabled(item) ? 'true' : null\"\n (mouseenter)=\"onRowMouseEnter(rowIdx)\"\n (click)=\"onRowClick(rowIdx)\">\n\n @if (multiple()) {\n <div\n role=\"gridcell\"\n class=\"cw-autocomplete-cell cw-autocomplete-cell-check\"\n [attr.aria-selected]=\"null\">\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 </div>\n }\n\n <div\n role=\"gridcell\"\n [id]=\"cellId(rowIdx, 0)\"\n class=\"cw-autocomplete-cell\"\n [class.is-active]=\"activeRow() === rowIdx && activeCol() === 0\"\n [attr.aria-selected]=\"activeRow() === rowIdx && activeCol() === 0 ? 'true' : null\"\n [innerHTML]=\"highlight(getCellText(item, 0))\">\n </div>\n\n @for (col of columns(); track col.field; let colIdx = $index) {\n <div\n role=\"gridcell\"\n [id]=\"cellId(rowIdx, colIdx + 1)\"\n class=\"cw-autocomplete-cell\"\n [class.is-active]=\"activeRow() === rowIdx && activeCol() === (colIdx + 1)\"\n [attr.aria-selected]=\"activeRow() === rowIdx && activeCol() === (colIdx + 1) ? 'true' : null\"\n [innerHTML]=\"highlight(getCellText(item, colIdx + 1))\">\n </div>\n }\n </div>\n }\n </div>\n }\n\n @if (showNoResult()) {\n <div class=\"cw-autocomplete-no-result\" aria-hidden=\"true\">\n {{ '_COMMON.NO_RESULT' | translate }}\n </div>\n }\n</div>\n\n @if (multiple() && selectedItemsState().length > 0) {\n <ul class=\"cw-autocomplete-chips\" role=\"list\">\n @for (item of selectedItemsState(); track item[valueField()]) {\n <li>\n <button\n type=\"button\"\n class=\"cw-autocomplete-chip\"\n [disabled]=\"isDisabled() || isReadonly()\"\n (click)=\"onChipRemove(item)\">\n <span>{{ getDisplay(item) }}</span>\n @if (!isDisabled() && !isReadonly()) {\n <span aria-hidden=\"true\" class=\"cw-autocomplete-chip-x\">&times;</span>\n <span class=\"visually-hidden\">\n {{ '_COMMON._ACTION.DELETE' | translate }}\n </span>\n }\n </button>\n </li>\n }\n </ul>\n }\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%}.cw-autocomplete-wrapper{position:relative}.cw-autocomplete-grid{position:absolute;top:100%;left:0;right:0;z-index:1100;margin-top:2px;max-height:16rem;overflow-y:auto;background-color:var(--bs-body-bg, #fff);border:1px solid var(--bs-border-color, #dee2e6);border-radius:.25rem;box-shadow:0 .25rem .75rem #0000001a}.cw-autocomplete-row{display:grid;grid-template-columns:repeat(var(--cw-ac-cols, 1),minmax(0,1fr));align-items:center;cursor:pointer;padding:0}.cw-autocomplete-row.is-active{background-color:var(--bs-primary-bg-subtle, rgba(13, 110, 253, .08))}.cw-autocomplete-row.is-disabled{cursor:not-allowed;opacity:.55}.cw-autocomplete-row.is-disabled.is-active{background-color:var(--bs-secondary-bg-subtle, rgba(0, 0, 0, .04))}.cw-autocomplete-row-master{display:flex;align-items:center;gap:.5rem;padding:.375rem .75rem;background-color:var(--bs-tertiary-bg, #f8f9fa);border-bottom:1px solid var(--bs-border-color, #dee2e6);font-weight:500}.cw-autocomplete-row-master.is-active{background-color:var(--bs-primary-bg-subtle, rgba(13, 110, 253, .12))}.cw-autocomplete-cell{padding:.375rem .75rem;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.cw-autocomplete-cell mark{background-color:transparent;color:inherit;font-weight:700;padding:0}.cw-autocomplete-cell-check{display:flex;align-items:center;gap:.5rem;padding:.375rem .5rem;width:auto;flex:0 0 auto}.cw-autocomplete-cell-check input[type=checkbox]{margin:0;pointer-events:none}.cw-autocomplete-master-label{-webkit-user-select:none;user-select:none}.cw-autocomplete-no-result{position:absolute;top:100%;left:0;right:0;z-index:1100;margin-top:2px;padding:.5rem .75rem;background-color:var(--bs-body-bg, #fff);border:1px solid var(--bs-border-color, #dee2e6);border-radius:.25rem;color:var(--bs-secondary-color, #6c757d);font-style:italic}.cw-autocomplete-chips{display:flex;flex-wrap:wrap;gap:.25rem;margin:.5rem 0 0;padding:0;list-style:none}.cw-autocomplete-chip{display:inline-flex;align-items:center;gap:.375rem;padding:.125rem .5rem;background-color:var(--bs-secondary-bg-subtle, #e9ecef);border:1px solid var(--bs-border-color, #dee2e6);border-radius:1rem;font-size:.875rem;line-height:1.4;cursor:pointer;color:inherit}.cw-autocomplete-chip:hover,.cw-autocomplete-chip:focus-visible{background-color:var(--bs-secondary-bg, #dee2e6);outline:none}.cw-autocomplete-chip:disabled{cursor:not-allowed;opacity:.65;pointer-events:none}.cw-autocomplete-chip-x{font-size:1rem;line-height:1;font-weight:700}\n"] }]
2467
+ }], 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"] }], gridEl: [{ type: i0.ViewChild, args: ['gridEl', { isSignal: true }] }], masterCheckbox: [{ type: i0.ViewChild, args: ['masterCheckbox', { isSignal: true }] }] } });
2468
+
1771
2469
  function rangeValidator(group, type) {
1772
2470
  const startControl = group.get('start');
1773
2471
  const endControl = group.get('end');
@@ -1824,6 +2522,17 @@ class FormFieldComponent {
1824
2522
  }
1825
2523
  constructor() {
1826
2524
  this.displayLabel = true;
2525
+ /**
2526
+ * Valeur de l'attribut HTML `autocomplete` posée sur les inputs texte / date /
2527
+ * password / textarea / phone / etc. Défaut `'off'` pour désactiver les
2528
+ * suggestions du navigateur (sources d'auto-remplissages parasites dans les
2529
+ * formulaires métier). À surcharger ponctuellement avec un token standard
2530
+ * (`'email'`, `'name'`, `'street-address'`, `'postal-code'`, `'tel'`,
2531
+ * `'current-password'`, `'new-password'`, etc.) sur les champs où l'auto-fill
2532
+ * est utile pour l'utilisateur. Note : `autocomplete="off"` peut être ignoré
2533
+ * par certains navigateurs pour les champs password (sécurité), c'est attendu.
2534
+ */
2535
+ this.autocomplete = 'off';
1827
2536
  this.options = [];
1828
2537
  this.isRequired = false;
1829
2538
  this.isInAddon = false;
@@ -1832,20 +2541,44 @@ class FormFieldComponent {
1832
2541
  this.skeletonMode = false;
1833
2542
  this.clearable = true;
1834
2543
  this.appendTo = 'body';
2544
+ /** Code pays ISO 3166-1 alpha-2 utilisé comme pays initial pour `type=phone` (ex. 'fr', 'be'). */
2545
+ this.initialCountry = 'fr';
1835
2546
  this.indeterminate = input(false, ...(ngDevMode ? [{ debugName: "indeterminate" }] : []));
1836
2547
  this.checkboxInputRef = viewChild('checkboxInput', ...(ngDevMode ? [{ debugName: "checkboxInputRef" }] : []));
1837
2548
  this.fileInputRef = viewChild('fileInput', ...(ngDevMode ? [{ debugName: "fileInputRef" }] : []));
2549
+ this.phoneInputRef = viewChild('phoneInput', ...(ngDevMode ? [{ debugName: "phoneInputRef" }] : []));
2550
+ /** Référence à cw-autocomplete (rendu conditionnellement) — sert au bouton clear externe. */
2551
+ this.autocompleteRef = viewChild(AutocompleteComponent, ...(ngDevMode ? [{ debugName: "autocompleteRef" }] : []));
2552
+ this.destroyRef = inject(DestroyRef);
2553
+ this.translateService = inject(TranslateService);
2554
+ this.iti = null;
2555
+ /** True dès que `intl-tel-input/utils` (libphonenumber-js) est chargé — sans ça, getNumber()/isValidNumber() sont indisponibles. */
2556
+ this.utilsReady = false;
1838
2557
  /** True si on a ajouté `Validators.required` nous-mêmes — sert à ne retirer que ce qu'on a mis. */
1839
2558
  this.requiredAppliedMain = false;
1840
2559
  this.requiredAppliedStart = false;
1841
2560
  this.requiredAppliedEnd = false;
2561
+ /** True si c'est nous (via l'input `isDisabled`) qui avons désactivé le control — sert à ne ré-activer que ce qu'on a désactivé. */
2562
+ this.disabledAppliedByUs = false;
1842
2563
  this.refreshEvent = new EventEmitter();
1843
2564
  this.textChanged = new EventEmitter();
1844
2565
  this.valueChange = new EventEmitter();
1845
2566
  this.typeField = FormFieldTypeEnum;
2567
+ /** True quand l'input password est affiché en clair (type=text). Pilote l'icône œil et le SR text. */
2568
+ this.isPasswordShown = false;
1846
2569
  this.spriteIcon = SpriteIconEnum;
1847
2570
  this.buttonType = FoButtonTypeEnum && BoButtonTypeEnum;
1848
2571
  this.buttonIconSize = ButtonIconSizeEnum;
2572
+ /** Comparator passé au pipe `keyvalue` pour préserver l'ordre d'insertion de `errorMessages`. */
2573
+ this.keepOrder = () => 0;
2574
+ /** Validator phone : skip tant que utils non chargé (renvoie null), sinon délègue à iti.isValidNumber(). */
2575
+ this.phoneValidator = (ctrl) => {
2576
+ if (!ctrl.value)
2577
+ return null;
2578
+ if (!this.utilsReady || !this.iti)
2579
+ return null;
2580
+ return this.iti.isValidNumber() ? null : { phone: true };
2581
+ };
1849
2582
  effect(() => {
1850
2583
  const indeterminateValue = this.indeterminate();
1851
2584
  const ref = this.checkboxInputRef();
@@ -1878,11 +2611,39 @@ class FormFieldComponent {
1878
2611
  }
1879
2612
  /**
1880
2613
  * `true` si le champ doit être désactivé visuellement et fonctionnellement.
1881
- * Union entre l'input explicite `isDisabled` et l'état `disabled` du FormControl/FormGroup lié,
1882
- * pour que `control.disable()` ne soit pas écrasé par le binding du template.
2614
+ * Reflète l'état `disabled` du FormControl/FormGroup lié (piloté par `syncDisabledState()`
2615
+ * à partir de l'input `isDisabled`) ; le fallback sur `isDisabled` couvre les types non liés
2616
+ * par `[formControl]` (file, phone) dont l'attribut DOM est posé via le template.
1883
2617
  */
1884
2618
  get isEffectivelyDisabled() {
1885
- return !!this.isDisabled || !!this.controlOrGroup?.disabled;
2619
+ return !!this.controlOrGroup?.disabled || !!this.isDisabled;
2620
+ }
2621
+ /**
2622
+ * Synchronise l'état `disabled` du control lié avec l'input `isDisabled`.
2623
+ *
2624
+ * Indispensable avec les Reactive Forms : sur un input lié par `[formControl]`, le binding
2625
+ * `[disabled]` du template est ignoré — c'est `control.disable()/enable()` qui pilote l'état
2626
+ * (Angular émet sinon un warning et force `disabled=false` dans le DOM). On ne ré-active que
2627
+ * ce qu'on a désactivé nous-mêmes (flag) pour ne pas écraser un `disable()` posé par le parent.
2628
+ */
2629
+ syncDisabledState() {
2630
+ const ctrl = this.controlOrGroup;
2631
+ if (!ctrl)
2632
+ return;
2633
+ if (this.isDisabled) {
2634
+ if (ctrl.enabled) {
2635
+ ctrl.disable({ emitEvent: false });
2636
+ this.disabledAppliedByUs = true;
2637
+ }
2638
+ }
2639
+ else if (this.disabledAppliedByUs) {
2640
+ ctrl.enable({ emitEvent: false });
2641
+ this.disabledAppliedByUs = false;
2642
+ }
2643
+ // type=phone n'est pas lié par [formControl] : on pilote l'instance intl-tel-input directement.
2644
+ if (this.type === this.typeField.phone) {
2645
+ this.iti?.setDisabled(this.isEffectivelyDisabled);
2646
+ }
1886
2647
  }
1887
2648
  /** Types dont min/max représentent un nombre de caractères (→ minlength/maxlength). */
1888
2649
  isTextLengthBased() {
@@ -1897,6 +2658,8 @@ class FormFieldComponent {
1897
2658
  return this.isTextLengthBased() ? (this.validationOptions?.min ?? null) : null;
1898
2659
  }
1899
2660
  get maxLengthAttr() {
2661
+ if (this.type === this.typeField.zipCode)
2662
+ return 6;
1900
2663
  return this.isTextLengthBased() ? (this.validationOptions?.max ?? null) : null;
1901
2664
  }
1902
2665
  get minAttr() {
@@ -2014,10 +2777,36 @@ class FormFieldComponent {
2014
2777
  group.updateValueAndValidity();
2015
2778
  }
2016
2779
  }
2017
- if (this.validationOptions?.applyValidators) {
2780
+ // Pour `type=file`, on applique TOUJOURS les validators Angular dès qu'au moins
2781
+ // une option (`accept` ou `maxSize`) est fournie : l'attribut HTML `accept` ne
2782
+ // valide rien (juste un hint pour le file picker) et `maxSize` n'a aucun
2783
+ // équivalent natif — sans validator, l'erreur n'apparaît jamais alors que
2784
+ // l'aide affichée (`autoHelpEntries`) promet à l'utilisateur que la règle est
2785
+ // imposée. Cas spécial assumé : les autres types gardent l'opt-in `applyValidators`.
2786
+ const opts = this.validationOptions;
2787
+ const fileHasValidationOpts = this.type === this.typeField.file
2788
+ && (!!opts?.accept?.length || opts?.maxSize != null);
2789
+ if (opts?.applyValidators || fileHasValidationOpts) {
2018
2790
  this.applyAngularValidators();
2019
2791
  }
2792
+ if (this.type === this.typeField.email && this.control && !this.control.hasValidator(Validators.email)) {
2793
+ this.control.addValidators(Validators.email);
2794
+ this.control.updateValueAndValidity();
2795
+ }
2020
2796
  this.syncRequiredValidator();
2797
+ this.syncDisabledState();
2798
+ if (this.type === this.typeField.file && this.control) {
2799
+ this.control.valueChanges
2800
+ .pipe(takeUntilDestroyed(this.destroyRef))
2801
+ .subscribe(value => {
2802
+ if (value == null || value === '') {
2803
+ const ref = this.fileInputRef();
2804
+ if (ref) {
2805
+ ref.nativeElement.value = '';
2806
+ }
2807
+ }
2808
+ });
2809
+ }
2021
2810
  }
2022
2811
  /**
2023
2812
  * Synchronise `Validators.required` sur le control lié en fonction de `isRequired`.
@@ -2165,6 +2954,100 @@ class FormFieldComponent {
2165
2954
  if (changes['isRequired'] && !changes['isRequired'].firstChange) {
2166
2955
  this.syncRequiredValidator();
2167
2956
  }
2957
+ if (changes['isDisabled'] && !changes['isDisabled'].firstChange) {
2958
+ this.syncDisabledState();
2959
+ }
2960
+ }
2961
+ ngAfterViewInit() {
2962
+ if (this.type === this.typeField.phone) {
2963
+ this.initPhone();
2964
+ }
2965
+ }
2966
+ ngOnDestroy() {
2967
+ this.iti?.destroy();
2968
+ this.iti = null;
2969
+ }
2970
+ /**
2971
+ * Instancie `intl-tel-input` sur le champ `#phoneInput` et câble la sync bidirectionnelle
2972
+ * avec le FormControl + le validator `phone`. Utils (libphonenumber-js) chargés en lazy.
2973
+ */
2974
+ initPhone() {
2975
+ const ref = this.phoneInputRef();
2976
+ if (!ref || !this.control)
2977
+ return;
2978
+ const el = ref.nativeElement;
2979
+ const lang = (this.translateService.currentLang || this.translateService.defaultLang || 'fr').toLowerCase();
2980
+ // Packs i18n natifs de la lib : couvrent `searchPlaceholder`, `searchEmptyState`
2981
+ // ("Aucun résultat trouvé"), `noCountrySelected` et tous les aria-labels en un objet.
2982
+ // Fallback `en` si la langue de l'app n'est pas couverte par les packs importés.
2983
+ const i18nPack = lang === 'fr' ? itiFr : itiEn;
2984
+ this.iti = intlTelInput(el, {
2985
+ initialCountry: (this.initialCountry || 'fr').toLowerCase(),
2986
+ countrySearch: true,
2987
+ separateDialCode: true,
2988
+ formatAsYouType: true,
2989
+ formatOnDisplay: true,
2990
+ nationalMode: false,
2991
+ countryNameLocale: lang,
2992
+ i18n: i18nPack,
2993
+ loadUtils: () => import('intl-tel-input/utils')
2994
+ });
2995
+ const initialValue = this.control.value;
2996
+ if (typeof initialValue === 'string' && initialValue) {
2997
+ this.iti.setNumber(initialValue);
2998
+ }
2999
+ if (this.isEffectivelyDisabled) {
3000
+ this.iti.setDisabled(true);
3001
+ }
3002
+ this.iti.promise.then(() => {
3003
+ this.utilsReady = true;
3004
+ this.syncPhoneFromInput();
3005
+ this.control?.updateValueAndValidity({ emitEvent: false });
3006
+ });
3007
+ const onPhoneChange = () => this.syncPhoneFromInput();
3008
+ el.addEventListener('countrychange', onPhoneChange);
3009
+ el.addEventListener('input', onPhoneChange);
3010
+ el.addEventListener('change', onPhoneChange);
3011
+ this.destroyRef.onDestroy(() => {
3012
+ el.removeEventListener('countrychange', onPhoneChange);
3013
+ el.removeEventListener('input', onPhoneChange);
3014
+ el.removeEventListener('change', onPhoneChange);
3015
+ });
3016
+ this.control.valueChanges
3017
+ .pipe(takeUntilDestroyed(this.destroyRef))
3018
+ .subscribe(value => {
3019
+ if (!this.iti)
3020
+ return;
3021
+ const current = this.utilsReady ? this.iti.getNumber() : el.value;
3022
+ if (value === current)
3023
+ return;
3024
+ if (value == null || value === '') {
3025
+ this.iti.setNumber('');
3026
+ }
3027
+ else if (typeof value === 'string') {
3028
+ this.iti.setNumber(value);
3029
+ }
3030
+ this.control?.updateValueAndValidity({ emitEvent: false });
3031
+ });
3032
+ this.control.addValidators(this.phoneValidator);
3033
+ this.control.updateValueAndValidity({ emitEvent: false });
3034
+ }
3035
+ /**
3036
+ * Lit la valeur courante depuis l'instance iti et la pousse dans le FormControl (E.164 dès que utils chargés).
3037
+ * Ne marque pas comme `touched` — on s'aligne sur le comportement standard Angular : `touched` est posé sur blur
3038
+ * (via `(blur)="onBlur()"` câblé dans le template), pour ne montrer l'erreur de format qu'après sortie du champ.
3039
+ */
3040
+ syncPhoneFromInput() {
3041
+ if (!this.iti || !this.control)
3042
+ return;
3043
+ const el = this.phoneInputRef()?.nativeElement;
3044
+ if (!el)
3045
+ return;
3046
+ const number = this.utilsReady ? (this.iti.getNumber() || '') : (el.value || '');
3047
+ if (this.control.value === number)
3048
+ return;
3049
+ this.control.setValue(number);
3050
+ this.valueChange.emit(number);
2168
3051
  }
2169
3052
  onCheckboxChange(event) {
2170
3053
  const checkbox = event.target;
@@ -2194,6 +3077,41 @@ class FormFieldComponent {
2194
3077
  this.control.markAsTouched();
2195
3078
  }
2196
3079
  }
3080
+ /**
3081
+ * Au focus du champ : reset `touched` pour cacher l'erreur tant que l'utilisateur
3082
+ * saisit/corrige. `touched` sera reposé au blur via `onBlur()`. Sans ça, après le
3083
+ * premier blur l'erreur reste affichée et "flicker" à chaque caractère pendant la
3084
+ * correction (pas user-friendly).
3085
+ */
3086
+ onFocus() {
3087
+ if (this.control?.touched) {
3088
+ this.control.markAsUntouched();
3089
+ }
3090
+ }
3091
+ /** Variante de `onFocus` pour les types période (start/end portés par des sous-controls). */
3092
+ onFocusRange(path) {
3093
+ const ctrl = this.getControl(path);
3094
+ if (ctrl?.touched) {
3095
+ ctrl.markAsUntouched();
3096
+ }
3097
+ }
3098
+ /**
3099
+ * Blur spécifique au type `phone` : ignore les blurs internes au wrapper `.iti` (sélecteur de pays,
3100
+ * recherche). Sans ça, ouvrir le dropdown pays poserait `touched=true` prématurément et l'erreur
3101
+ * de format apparaîtrait dès la frappe suivante alors que l'utilisateur n'a pas quitté le champ.
3102
+ */
3103
+ onPhoneBlur(event) {
3104
+ const relatedTarget = event.relatedTarget;
3105
+ const itiContainer = this.phoneInputRef()?.nativeElement.closest('.iti');
3106
+ if (relatedTarget && itiContainer?.contains(relatedTarget)) {
3107
+ return;
3108
+ }
3109
+ this.onBlur();
3110
+ }
3111
+ /** Toggle de l'affichage en clair pour `type=password`. */
3112
+ togglePasswordVisibility() {
3113
+ this.isPasswordShown = !this.isPasswordShown;
3114
+ }
2197
3115
  isInInputGroup() {
2198
3116
  const inInputGroup = [
2199
3117
  this.typeField.text,
@@ -2208,6 +3126,9 @@ class FormFieldComponent {
2208
3126
  this.typeField.select,
2209
3127
  this.typeField.ngSelect,
2210
3128
  this.typeField.ngSelectMultiple,
3129
+ this.typeField.zipCode,
3130
+ this.typeField.autocomplete,
3131
+ this.typeField.autocompleteMultiple,
2211
3132
  ].includes(this.type);
2212
3133
  return inInputGroup;
2213
3134
  }
@@ -2293,7 +3214,7 @@ class FormFieldComponent {
2293
3214
  this.formControl.markAsTouched();
2294
3215
  }
2295
3216
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: FormFieldComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
2296
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.20", type: FormFieldComponent, isStandalone: true, selector: "cw-form-field", inputs: { control: { classPropertyName: "control", publicName: "control", isSignal: false, isRequired: false, transformFunction: null }, formGroup: { classPropertyName: "formGroup", publicName: "formGroup", isSignal: false, isRequired: false, transformFunction: null }, type: { classPropertyName: "type", publicName: "type", isSignal: false, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: false, isRequired: false, transformFunction: null }, displayLabel: { classPropertyName: "displayLabel", publicName: "displayLabel", isSignal: false, isRequired: false, transformFunction: null }, name: { classPropertyName: "name", publicName: "name", isSignal: false, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: false, isRequired: false, transformFunction: null }, 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 }, isRequired: { classPropertyName: "isRequired", publicName: "isRequired", isSignal: false, isRequired: false, transformFunction: null }, help: { classPropertyName: "help", publicName: "help", isSignal: false, isRequired: false, transformFunction: null }, tooltip: { classPropertyName: "tooltip", publicName: "tooltip", isSignal: false, isRequired: false, transformFunction: null }, addonLeft: { classPropertyName: "addonLeft", publicName: "addonLeft", isSignal: false, isRequired: false, transformFunction: null }, addonRight: { classPropertyName: "addonRight", publicName: "addonRight", isSignal: false, isRequired: false, transformFunction: null }, isInAddon: { classPropertyName: "isInAddon", publicName: "isInAddon", isSignal: false, isRequired: false, transformFunction: null }, isReadonly: { classPropertyName: "isReadonly", publicName: "isReadonly", isSignal: false, isRequired: false, transformFunction: null }, isDisabled: { classPropertyName: "isDisabled", publicName: "isDisabled", isSignal: false, isRequired: false, transformFunction: null }, sliderValue: { classPropertyName: "sliderValue", publicName: "sliderValue", isSignal: false, isRequired: false, transformFunction: null }, sliderOptions: { classPropertyName: "sliderOptions", publicName: "sliderOptions", isSignal: false, isRequired: false, transformFunction: null }, cssClass: { classPropertyName: "cssClass", publicName: "cssClass", isSignal: false, isRequired: false, transformFunction: null }, skeletonMode: { classPropertyName: "skeletonMode", publicName: "skeletonMode", isSignal: false, isRequired: false, transformFunction: null }, clearable: { classPropertyName: "clearable", publicName: "clearable", isSignal: false, isRequired: false, transformFunction: null }, appendTo: { classPropertyName: "appendTo", publicName: "appendTo", isSignal: false, isRequired: false, transformFunction: null }, indeterminate: { classPropertyName: "indeterminate", publicName: "indeterminate", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { refreshEvent: "refreshEvent", textChanged: "textChanged", valueChange: "valueChange" }, 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 }], usesOnChanges: true, ngImport: i0, template: "@if (!isInAddon) {\r\n @if (\r\n type !== typeField.checkbox &&\r\n type !== typeField.radio &&\r\n type !== typeField.checkboxButton &&\r\n type !== typeField.radioButton &&\r\n type !== typeField.checkboxInline &&\r\n type !== typeField.radioInline &&\r\n type !== typeField.switch &&\r\n type !== typeField.range &&\r\n type !== typeField.switchSmall\r\n ) {\r\n <label [for]=\"name\" class=\"field-label\" [class.visually-hidden]=\"!displayLabel\">\r\n {{ label | translate }}\r\n\r\n @if (isRequired) {\r\n <span class=\"text-danger\">*</span>\r\n }\r\n\r\n @if (tooltip) {\r\n <!-- <button type=\"button\" class=\"btn btn-link btn-popover\" placement=\"bottom\" [ngbPopover]=\"popContent\" container=\"body\"\r\n triggers=\"mouseenter:mouseleave\">\r\n <span class=\"btn-popover-icon bo-icons bo-help\"></span>\r\n </button>\r\n <ng-template #popContent>\r\n <div [innerHTML]=\"tooltip\"></div>\r\n </ng-template> -->\r\n }\r\n </label>\r\n }\r\n\r\n @if (addonLeft || addonRight) {\r\n <div class=\"field-group\">\r\n @if(addonLeft) {\r\n <ng-container [ngTemplateOutlet]=\"addonLeft\"></ng-container>\r\n }\r\n <ng-container [ngTemplateOutlet]=\"field\"></ng-container>\r\n @if(addonRight) {\r\n <ng-container [ngTemplateOutlet]=\"addonRight\"></ng-container>\r\n }\r\n </div>\r\n }\r\n @else {\r\n @if ( isInInputGroup() ) {\r\n <div class=\"field-group\">\r\n <ng-container [ngTemplateOutlet]=\"field\"></ng-container>\r\n </div>\r\n }\r\n @else {\r\n <ng-container [ngTemplateOutlet]=\"field\"></ng-container>\r\n }\r\n }\r\n\r\n <!-- Error message -->\r\n @if (controlOrGroup?.invalid && controlOrGroup?.touched) {\r\n <div class=\"field-invalid\" [id]=\"'error-' + name\">\r\n @if ((controlOrGroup?.errors?.['required']) || (getControl('start')?.errors?.['required'] || getControl('end')?.errors?.['required'])) {\r\n <span [innerHtml]=\"'_COMMON._FORM.ERROR_IS_MANDATORY' | translate: {label: label | translate}\"></span>\r\n }\r\n @if(controlOrGroup?.errors?.['rangeInvalid']) {\r\n <span>{{'_COMMON._DATES.ERROR_START_END_PERIOD' | translate}}</span>\r\n }\r\n @if (controlOrGroup?.errors?.['fileExtension']) {\r\n <span>{{ '_COMMON._FORM.ERROR_FILE_EXTENSION' | translate: { accept: acceptLabel } }}</span>\r\n }\r\n @if (controlOrGroup?.errors?.['fileSize']) {\r\n <span>{{ '_COMMON._FORM.ERROR_FILE_SIZE' | translate: { maxSize: maxSizeLabel } }}</span>\r\n }\r\n </div>\r\n }\r\n\r\n @if (help || autoHelpEntries.length) {\r\n <div [id]=\"name + '-help'\" class=\"field-text\">\r\n @if (help) {\r\n <div>{{ help | translate }}</div>\r\n }\r\n @for (entry of autoHelpEntries; track entry.key) {\r\n <div>{{ entry.key | translate: entry.params }}</div>\r\n }\r\n </div>\r\n }\r\n}\r\n@else {\r\n <ng-container [ngTemplateOutlet]=\"field\"></ng-container>\r\n}\r\n\r\n<ng-template #field>\r\n <!-- Text -->\r\n @if ([typeField.text, typeField.date, typeField.time, typeField.dateTime, typeField.number,\r\n typeField.email,\r\n typeField.color].includes(type)) {\r\n <input [type]=\"type\" class=\"field-control\" [id]=\"name\" [formControl]=\"formControl\"\r\n [ngClass]=\"[(cssClass || ''), formControl?.value ? 'has-value' : '']\"\r\n [attr.placeholder]=\"placeholder ? (placeholder | translate) : null\" [attr.required]=\"isRequired ? 'required' : null\"\r\n [attr.readonly]=\"isReadonly ? 'readonly' : null\" [disabled]=\"isEffectivelyDisabled\" [attr.aria-required]=\"isRequired\"\r\n [attr.minlength]=\"minLengthAttr\" [attr.maxlength]=\"maxLengthAttr\"\r\n [attr.min]=\"minAttr\" [attr.max]=\"maxAttr\" [attr.step]=\"stepAttr\" [attr.pattern]=\"patternAttr\"\r\n [attr.aria-invalid]=\"control.invalid && control.touched\"\r\n [attr.aria-describedby]=\"getDescribedBy(control)\" />\r\n }\r\n\r\n <!-- File -->\r\n @if (type === typeField.file) {\r\n <input #fileInput type=\"file\" class=\"field-control\" [id]=\"name\"\r\n [ngClass]=\"[(cssClass || ''), formControl?.value ? 'has-value' : '']\"\r\n [attr.placeholder]=\"placeholder ? (placeholder | translate) : null\" [attr.required]=\"isRequired ? 'required' : null\"\r\n [attr.readonly]=\"isReadonly ? 'readonly' : null\" [disabled]=\"isEffectivelyDisabled\" [attr.aria-required]=\"isRequired\"\r\n [attr.accept]=\"acceptAttr\"\r\n [attr.aria-invalid]=\"control.invalid && control.touched\"\r\n [attr.aria-describedby]=\"getDescribedBy(control)\"\r\n (change)=\"onFileChange($event)\" (blur)=\"onBlur()\" />\r\n }\r\n\r\n @if (type === typeField.password) {\r\n <input showHidePassword [type]=\"type\" class=\"field-control\" [id]=\"name\" [formControl]=\"formControl\"\r\n [ngClass]=\"[(cssClass || ''), formControl?.value ? 'has-value' : '']\"\r\n [attr.required]=\"isRequired ? 'required' : null\" [attr.readonly]=\"isReadonly ? 'readonly' : null\"\r\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\" [attr.aria-required]=\"isRequired\"\r\n [attr.minlength]=\"minLengthAttr\" [attr.maxlength]=\"maxLengthAttr\" [attr.pattern]=\"patternAttr\"\r\n [attr.aria-invalid]=\"control.invalid && control.touched\"\r\n [attr.aria-describedby]=\"getDescribedBy(control)\" />\r\n }\r\n\r\n <!-- Textarea -->\r\n @if (type === typeField.textarea) {\r\n <textarea class=\"field-control\" [id]=\"name\" [formControl]=\"formControl\"\r\n [ngClass]=\"[(cssClass || ''), formControl?.value ? 'has-value' : '']\"\r\n [attr.placeholder]=\"placeholder ? (placeholder | translate) : null\" [attr.required]=\"isRequired ? 'required' : null\"\r\n [attr.readonly]=\"isReadonly ? 'readonly' : null\" [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\"\r\n [attr.aria-required]=\"isRequired\" [attr.aria-invalid]=\"control.invalid && control.touched\"\r\n [attr.minlength]=\"minLengthAttr\" [attr.maxlength]=\"maxLengthAttr\" [attr.pattern]=\"patternAttr\"\r\n [attr.aria-describedby]=\"getDescribedBy(control)\"></textarea>\r\n }\r\n\r\n <!-- Select -->\r\n @if (type === typeField.select) {\r\n <ng-select [formControl]=\"formControl\" [items]=\"options\" bindLabel=\"label\" [labelForId]=\"name\" [appendTo]=\"appendTo\" bindValue=\"value\"\r\n [ngClass]=\"cssClass\" [searchable]=\"false\" [placeholder]=\"placeholder ? (placeholder | translate) : null\" [readonly]=\"isReadonly\" [clearable]=\"false\"\r\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\" [attr.required]=\"isRequired ? 'required' : null\"\r\n [attr.aria-required]=\"isRequired\" [attr.aria-invalid]=\"control.invalid && control.touched\"\r\n [attr.aria-describedby]=\"getDescribedBy(control)\" [attr.id]=\"name\"\r\n (blur)=\"onBlur()\">\r\n\r\n <!-- Template pour les options -->\r\n <ng-template ng-option-tmp let-item=\"item\" let-index=\"index\" let-search=\"searchTerm\">\r\n @if (optionTemplate) {\r\n <ng-container *ngTemplateOutlet=\"optionTemplate; context: { item: item | translate, index: index, searchTerm: search }\"></ng-container>\r\n }\r\n @else {\r\n <div>{{ item.label | translate }}</div>\r\n }\r\n </ng-template>\r\n\r\n <!-- Template pour le label -->\r\n <ng-template ng-label-tmp let-item=\"item\">\r\n @if (labelTemplate) {\r\n <ng-container *ngTemplateOutlet=\"labelTemplate; context: { item: item | translate }\"></ng-container>\r\n }\r\n @else {\r\n {{ (item.label | translate) || (placeholder | translate) }}\r\n }\r\n </ng-template>\r\n </ng-select>\r\n }\r\n\r\n <!-- NgSelect -->\r\n @if (type === typeField.ngSelect || type === typeField.ngSelectMultiple) {\r\n <ng-select [formControl]=\"formControl\" [items]=\"options\" bindLabel=\"label\" [labelForId]=\"name\" [appendTo]=\"appendTo\" bindValue=\"value\"\r\n [multiple]=\"type === typeField.ngSelectMultiple\" [ngClass]=\"cssClass\" [clearable]=\"false\"\r\n [placeholder]=\"placeholder ? (placeholder | translate) : null\" [readonly]=\"isReadonly\"\r\n [notFoundText]=\"'_COMMON.NO_RESULT' | translate\" [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\"\r\n [attr.required]=\"isRequired ? 'required' : null\" [attr.aria-required]=\"isRequired\"\r\n [attr.aria-invalid]=\"control.invalid && control.touched\"\r\n [attr.aria-describedby]=\"getDescribedBy(control)\" [attr.id]=\"name\"\r\n (blur)=\"onBlur()\" (search)=\"textChanged.emit($event?.term)\">\r\n\r\n <!-- Template pour les options -->\r\n <ng-template ng-option-tmp let-item=\"item\" let-index=\"index\" let-search=\"searchTerm\">\r\n @if (optionTemplate) {\r\n <ng-container *ngTemplateOutlet=\"optionTemplate; context: { item: item, index: index, searchTerm: search }\"></ng-container>\r\n }\r\n @else {\r\n <div>{{ item.label | translate }}</div>\r\n }\r\n </ng-template>\r\n\r\n <!-- Template pour le label -->\r\n <ng-template ng-label-tmp let-item=\"item\" let-clear=\"clear\">\r\n <span class=\"ng-value-icon left\" (click)=\"clear(item)\" aria-hidden=\"true\">\u00D7</span>\r\n @if (labelTemplate) {\r\n <ng-container *ngTemplateOutlet=\"labelTemplate; context: { item: item | translate }\"></ng-container>\r\n }\r\n @else {\r\n {{ (item.label | translate) || (placeholder | translate) }}\r\n }\r\n </ng-template>\r\n </ng-select>\r\n }\r\n\r\n <!-- Radio -->\r\n @if (type === typeField.radioInline || type === typeField.radio) {\r\n <fieldset\r\n [attr.aria-required]=\"isRequired\"\r\n [attr.aria-invalid]=\"control.invalid && control.touched\"\r\n [attr.aria-describedby]=\"getDescribedBy(control)\">\r\n <legend class=\"field-label\" [class.visually-hidden]=\"!displayLabel\">\r\n {{label | translate}}\r\n @if(isRequired) {\r\n <span class=\"text-danger\">*</span>\r\n }\r\n </legend>\r\n <ul class=\"list-unstyled mb-none\" [ngClass]=\"type === typeField.radioInline ? 'd-flex-h gap-md flex-wrap' : 'd-flex-v'\">\r\n @for (opt of options; track opt.value) {\r\n <li class=\"field-check\">\r\n <input type=\"radio\" [id]=\"name + '_' + opt.value\" [value]=\"opt.value\" [formControl]=\"formControl\"\r\n class=\"field-check-input\" [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\" (change)=\"onRadioChange(opt.value)\" />\r\n <label [for]=\"name + '_' + opt.value\" class=\"field-check-label\">{{ opt.label | translate }}</label>\r\n </li>\r\n }\r\n </ul>\r\n </fieldset>\r\n }\r\n\r\n <!-- Radio button -->\r\n @if (type === typeField.radioButton) {\r\n <fieldset\r\n [attr.aria-required]=\"isRequired\"\r\n [attr.aria-invalid]=\"control.invalid && control.touched\"\r\n [attr.aria-describedby]=\"getDescribedBy(control)\">\r\n <legend class=\"field-label\" [class.visually-hidden]=\"!displayLabel\">\r\n {{label | translate}}\r\n @if(isRequired) {\r\n <span class=\"text-danger\">*</span>\r\n }\r\n </legend>\r\n <div class=\"field-group field-group-btn\">\r\n @for (opt of options; track opt.value) {\r\n <input type=\"radio\" [id]=\"name + '_' + opt.value\" [value]=\"opt.value\" [formControl]=\"formControl\"\r\n class=\"visually-hidden\" [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\" (change)=\"onRadioChange(opt.value)\"/>\r\n <label [for]=\"name + '_' + opt.value\" class=\"btn btn-field-group\">{{ opt.label | translate }}</label>\r\n }\r\n </div>\r\n </fieldset>\r\n }\r\n\r\n <!-- Checkbox Switch -->\r\n @if ( type === typeField.switch || type === typeField.switchSmall)\r\n {\r\n <div class=\"field-check field-switch\" [ngClass]=\"{'field-switch-small': type === typeField.switchSmall}\">\r\n <input type=\"checkbox\" [id]=\"name\" [formControl]=\"formControl\" class=\"field-check-input\" [attr.aria-required]=\"isRequired\"\r\n [attr.aria-invalid]=\"control.invalid && control.touched\"\r\n [attr.aria-describedby]=\"getDescribedBy(control)\"\r\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\"/>\r\n <label [for]=\"name\" class=\"field-check-label\">{{ label | translate }}</label>\r\n </div>\r\n }\r\n\r\n <!-- Checkbox -->\r\n @if (type === typeField.checkboxInline || type === typeField.checkbox) {\r\n @if (isSingleCheckbox()) {\r\n <div class=\"field-check\" [class.field-check-inline]=\"type === typeField.checkboxInline\">\r\n <input #checkboxInput type=\"checkbox\" [id]=\"name\" [formControl]=\"formControl\"\r\n class=\"field-check-input\"\r\n [class.is-invalid]=\"control?.invalid && control?.touched\"\r\n [attr.aria-required]=\"isRequired\"\r\n [attr.aria-invalid]=\"control?.invalid && control?.touched\"\r\n [attr.aria-describedby]=\"getDescribedBy(control)\"\r\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\" />\r\n <label [for]=\"name\" class=\"field-check-label\">\r\n {{ label | translate }}\r\n @if (isRequired) {\r\n <span class=\"text-danger\">*</span>\r\n }\r\n </label>\r\n </div>\r\n }\r\n @else if( options.length > 1) {\r\n <fieldset\r\n [attr.aria-required]=\"isRequired\"\r\n [attr.aria-invalid]=\"control.invalid && control.touched\"\r\n [attr.aria-describedby]=\"getDescribedBy(control)\"\r\n [ngClass]=\"{ 'flex-column': type === typeField.checkbox }\">\r\n <legend class=\"field-label\" [class.visually-hidden]=\"!displayLabel\">\r\n {{label | translate}}\r\n @if(isRequired) {\r\n <span class=\"text-danger\">*</span>\r\n }\r\n </legend>\r\n <ul class=\"list-unstyled mb-none\" [ngClass]=\"type === typeField.checkboxInline ? 'd-flex-h gap-md' : 'd-flex-v'\">\r\n @for (opt of options; track opt.value) {\r\n <li class=\"field-check\" [ngClass]=\"{ 'field-check-inline': type === typeField.checkboxInline }\">\r\n <input type=\"checkbox\" [id]=\"name + '_' + opt.value\" [value]=\"opt.value\" (change)=\"onCheckboxChange($event)\"\r\n [checked]=\"control.value?.includes(opt.value)\" class=\"field-check-input\"\r\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\" />\r\n <label [for]=\"name + '_' + opt.value\" class=\"field-check-label\">\r\n {{ opt.label | translate }}\r\n </label>\r\n </li>\r\n }\r\n </ul>\r\n </fieldset>\r\n }\r\n @else {\r\n <fieldset>\r\n <legend class=\"field-label\" [class.visually-hidden]=\"!displayLabel\">\r\n {{label | translate}}\r\n </legend>\r\n <ul class=\"list-unstyled mb-none\" [ngClass]=\"type === typeField.checkboxInline ? 'd-flex-h gap-md' : 'd-flex-v'\">\r\n @for (opt of options; track opt.value) {\r\n <li class=\"field-check\" [ngClass]=\"{ 'field-check-inline': type === typeField.checkboxInline }\">\r\n <input type=\"checkbox\" [id]=\"name + '_' + opt.value\" [value]=\"opt.value\" (change)=\"onCheckboxChange($event)\"\r\n [checked]=\"control.value?.includes(opt.value)\" class=\"field-check-input\"\r\n [attr.aria-required]=\"isRequired\"\r\n [attr.aria-invalid]=\"control.invalid && control.touched\"\r\n [attr.aria-describedby]=\"getDescribedBy(control)\"\r\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\" />\r\n <label [for]=\"name + '_' + opt.value\" class=\"field-check-label\">\r\n {{ opt.label | translate }}\r\n @if(isRequired) {\r\n <span class=\"text-danger\">*</span>\r\n }\r\n </label>\r\n </li>\r\n }\r\n </ul>\r\n </fieldset>\r\n }\r\n }\r\n\r\n <!-- Checkbox button -->\r\n @if (type === typeField.checkboxButton && options.length > 0) {\r\n\r\n @if(options.length > 1) {\r\n <fieldset\r\n [attr.aria-required]=\"isRequired\"\r\n [attr.aria-invalid]=\"control.invalid && control.touched\"\r\n [attr.aria-describedby]=\"getDescribedBy(control)\">\r\n <legend class=\"field-label\" [class.visually-hidden]=\"!displayLabel\">\r\n {{label | translate}}\r\n @if(isRequired) {\r\n <span class=\"text-danger\">*</span>\r\n }\r\n </legend>\r\n <div class=\"field-group field-group-btn\">\r\n @for (opt of options; track opt.value) {\r\n <input type=\"checkbox\" [id]=\"name + '_' + opt.value\" [value]=\"opt.value\" (change)=\"onCheckboxChange($event)\"\r\n [checked]=\"control.value?.includes(opt.value)\" class=\"visually-hidden\"\r\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\" />\r\n <label [for]=\"name + '_' + opt.value\" class=\"btn btn-field-group\">{{ opt.label | translate }}</label>\r\n }\r\n </div>\r\n </fieldset>\r\n }\r\n @else {\r\n <fieldset>\r\n <legend class=\"field-label\" [class.visually-hidden]=\"!displayLabel\">\r\n {{label | translate}}\r\n </legend>\r\n <div class=\"btn-group btn-group-secondary\">\r\n @for (opt of options; track opt.value) {\r\n <input type=\"checkbox\" [id]=\"name + '_' + opt.value\" [value]=\"opt.value\" (change)=\"onCheckboxChange($event)\"\r\n [checked]=\"control.value?.includes(opt.value)\" class=\"visually-hidden\"\r\n [attr.aria-required]=\"isRequired\"\r\n [attr.aria-invalid]=\"control.invalid && control.touched\"\r\n [attr.aria-describedby]=\"getDescribedBy(control)\"\r\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\"/>\r\n <label [for]=\"name + '_' + opt.value\" class=\"btn btn-field-group\">\r\n {{ opt.label | translate}}\r\n @if(isRequired) {\r\n <span class=\"text-danger\">*</span>\r\n }\r\n </label>\r\n }\r\n </div>\r\n </fieldset>\r\n }\r\n }\r\n\r\n <!-- Period - DateToDate / TimeToTime / DateTimeToDateTime -->\r\n @if ([typeField.dateToDate, typeField.timeToTime, typeField.dateTimeToDateTime].includes(type) && isRange) {\r\n\r\n <div class=\"field-group\">\r\n <input [type]=\"getInputType()\" class=\"field-control\" [id]=\"name + '_start'\" [formControl]=\"getControl('start')\"\r\n [attr.placeholder]=\"type === typeField.timeToTime ? ('_COMMON._DATES.FROM' | translate) : ('_COMMON._DATES.FROM_TO_1' | translate)\"\r\n [ngClass]=\"[(cssClass || ''), getControl('start')?.value ? 'has-value' : '']\"\r\n [attr.required]=\"isRequired ? 'required' : null\" [attr.readonly]=\"isReadonly ? 'readonly' : null\"\r\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\" [attr.aria-required]=\"isRequired\"\r\n [attr.min]=\"minStartAttr\" [attr.max]=\"maxStartAttr\" [attr.step]=\"stepAttr\"\r\n [attr.aria-invalid]=\"getControl('start')?.invalid && getControl('start')?.touched\"\r\n [attr.aria-describedby]=\"getDescribedBy(getControl('start'))\" />\r\n\r\n @if(getControl('start')?.value && !isEffectivelyDisabled) {\r\n <button type=\"button\" class=\"btn btn-secondary btn-clear-field\"\r\n (click)=\"onClearFieldPeriod('start')\">\r\n &times;\r\n </button>\r\n }\r\n\r\n <input [type]=\"getInputType()\" class=\"field-control\" [id]=\"name + '_end'\" [formControl]=\"getControl('end')\"\r\n [attr.placeholder]=\"type === typeField.timeToTime ? ('_COMMON._DATES.TO' | translate) : ('_COMMON._DATES.FROM_TO_2' | translate)\"\r\n [ngClass]=\"[(cssClass || ''), getControl('end')?.value ? 'has-value' : '']\"\r\n [attr.required]=\"isRequired ? 'required' : null\" [attr.readonly]=\"isReadonly ? 'readonly' : null\"\r\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\"\r\n [attr.min]=\"minEndAttr\" [attr.max]=\"maxEndAttr\" [attr.step]=\"stepAttr\"\r\n [attr.aria-invalid]=\"getControl('end')?.invalid && getControl('end')?.touched\"\r\n [attr.aria-describedby]=\"getDescribedBy(getControl('end'))\" />\r\n\r\n @if(getControl('end')?.value && !isEffectivelyDisabled) {\r\n <button type=\"button\" class=\"btn btn-secondary btn-clear-field\"\r\n (click)=\"onClearFieldPeriod('end')\">\r\n &times;\r\n </button>\r\n }\r\n </div>\r\n }\r\n\r\n @if ([typeField.datePlusOne, typeField.datePlusTwo, typeField.datePlusSeven, typeField.dateComplexe].includes(type)) {\r\n\r\n @if (type === typeField.dateComplexe) {\r\n <button class=\"btn btn-secondary\" type=\"button\" (click)=\"onDateAddDay('prev')\"\r\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\">\r\n <cw-icon font=\"optyweb\" [icon]=\"spriteIcon.nextLeft\" [label]=\"'Jour pr\u00E9c\u00E9dent'\"></cw-icon>\r\n </button>\r\n }\r\n\r\n <input type=\"date\" class=\"field-control\" [id]=\"name\" [formControl]=\"formControl\"\r\n [ngClass]=\"[(cssClass || ''), formControl?.value ? 'has-value' : '']\"\r\n [attr.placeholder]=\"placeholder ? placeholder : null\" [attr.required]=\"isRequired ? 'required' : null\"\r\n [attr.readonly]=\"isReadonly ? 'readonly' : null\" [disabled]=\"isEffectivelyDisabled\" [attr.aria-required]=\"isRequired\"\r\n [attr.min]=\"minAttr\" [attr.max]=\"maxAttr\" [attr.step]=\"stepAttr\"\r\n [attr.aria-invalid]=\"control.invalid && control.touched\"\r\n [attr.aria-describedby]=\"getDescribedBy(control)\" />\r\n\r\n @if(formControl?.value && !isEffectivelyDisabled) {\r\n <button class=\"btn btn-secondary btn-clear-field\" type=\"button\"\r\n (click)=\"onClearField(formControl)\">&times;</button>\r\n }\r\n\r\n @if (type === typeField.dateComplexe) {\r\n <button class=\"btn btn-secondary\" type=\"button\" (click)=\"onDateAddDay('next')\"\r\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\">\r\n <cw-icon font=\"optyweb\" [icon]=\"spriteIcon.nextRight\" [label]=\"'Jour suivant'\"></cw-icon>\r\n </button>\r\n <button class=\"btn btn-secondary\" type=\"button\" (click)=\"onRefresh()\"\r\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\">\r\n <cw-icon font=\"optyweb\" [icon]=\"spriteIcon.toolbarRefresh\" [label]=\"'Rafra\u00EEchir'\"></cw-icon>\r\n </button>\r\n }\r\n\r\n <button class=\"btn btn-secondary\" type=\"button\" (click)=\"onTodayAddDay(0)\"\r\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\">\r\n J\r\n <span class=\"visually-hidden\">Aujourd'hui</span>\r\n </button>\r\n <button class=\"btn btn-secondary\" type=\"button\" (click)=\"onTodayAddDay(1)\"\r\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\">\r\n J+1\r\n <span class=\"visually-hidden\">Demain</span>\r\n </button>\r\n\r\n @if (type !== typeField.datePlusOne && type !== typeField.dateComplexe) {\r\n <button class=\"btn btn-secondary \" type=\"button\" (click)=\"onTodayAddDay(2)\"\r\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\">\r\n J+2\r\n <span class=\"visually-hidden\">Dans 2 jours</span>\r\n </button>\r\n\r\n @if (type !== typeField.datePlusTwo) {\r\n <button class=\"btn btn-secondary\" type=\"button\" (click)=\"onTodayAddDay(7)\"\r\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\">\r\n J+7\r\n <span class=\"visually-hidden\">Dans 7 jours</span>\r\n </button>\r\n }\r\n }\r\n }\r\n\r\n @if (type === typeField.slider) {\r\n <ngx-slider [(value)]=\"sliderValue\" [options]=\"sliderOptions\" [formControl]=\"formControl\"></ngx-slider>\r\n }\r\n\r\n @if (type === typeField.range) {\r\n <div class=\"slider\">\r\n\r\n <cw-button [isDisabled]=\"formControl.value <= rangeOptions.floor\" [label]=\"'Diminuer ' + formControl.value + ' ' + label\"\r\n [withIcon]=\"spriteIcon.toolbarMinus\" [withOnlyIcon]=\"true\" [type]=\"buttonType.primary\"\r\n [iconSize]=\"buttonIconSize.small\" (btnAction)=\"onRangeStep('decrease')\">\r\n </cw-button>\r\n\r\n <div class=\"slider-input\">\r\n <label [for]=\"name\" class=\"slider-tooltip\" [style.left]=\"getRangePercent() + '%'\" aria-live=\"polite\"\r\n aria-atomic=\"true\">\r\n {{ label | translate }} {{ formControl.value }}\r\n @if (rangeOptions.unit) {\r\n <abbr [title]=\"rangeOptions.unit\">{{ rangeOptions.unit }}</abbr>\r\n }\r\n </label>\r\n\r\n <div class=\"slider-custom-bar\">\r\n <div class=\"slider-custom-bar-selection\" [style.width]=\"getRangePercent() + '%'\">\r\n </div>\r\n </div>\r\n\r\n <input type=\"range\" [id]=\"name\" [formControl]=\"formControl\" [min]=\"rangeOptions.floor\" [max]=\"rangeOptions.ceil\"\r\n [step]=\"rangeOptions.step || 1\" class=\"field-control-range\" [attr.aria-required]=\"isRequired\"\r\n [attr.aria-invalid]=\"control.invalid && control.touched\" [disabled]=\"isEffectivelyDisabled\">\r\n </div>\r\n\r\n <cw-button [isDisabled]=\"formControl.value >= rangeOptions.ceil\" [label]=\"'Augmenter ' + formControl.value + ' ' + label\"\r\n [withIcon]=\"spriteIcon.toolbarPlus\" [withOnlyIcon]=\"true\" [type]=\"buttonType.primary\"\r\n [iconSize]=\"buttonIconSize.small\" (btnAction)=\"onRangeStep('increase')\">\r\n </cw-button>\r\n </div>\r\n }\r\n\r\n @if (isInInputGroup() && clearable && !isEffectivelyDisabled) {\r\n @if(formControl?.value) {\r\n <button class=\"btn btn-secondary btn-clear-field\" type=\"button\"\r\n (click)=\"onClearField(formControl)\">&times;</button>\r\n }\r\n }\r\n\r\n</ng-template>\r\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "ngmodule", type: TranslateModule }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i2$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2$1.RangeValueAccessor, selector: "input[type=range][formControlName],input[type=range][formControl],input[type=range][ngModel]" }, { kind: "directive", type: i2$1.CheckboxControlValueAccessor, selector: "input[type=checkbox][formControlName],input[type=checkbox][formControl],input[type=checkbox][ngModel]" }, { kind: "directive", type: i2$1.RadioControlValueAccessor, selector: "input[type=radio][formControlName],input[type=radio][formControl],input[type=radio][ngModel]", inputs: ["name", "formControlName", "value"] }, { kind: "directive", type: i2$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i2$1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "ngmodule", type: NgSelectModule }, { kind: "component", type: i3.NgSelectComponent, selector: "ng-select", inputs: ["ariaLabelDropdown", "bindLabel", "bindValue", "ariaLabel", "markFirst", "placeholder", "fixedPlaceholder", "notFoundText", "typeToSearchText", "preventToggleOnRightClick", "addTagText", "loadingText", "clearAllText", "appearance", "dropdownPosition", "appendTo", "loading", "closeOnSelect", "hideSelected", "selectOnTab", "openOnEnter", "maxSelectedItems", "groupBy", "groupValue", "bufferAmount", "virtualScroll", "selectableGroup", "selectableGroupAsModel", "searchFn", "trackByFn", "clearOnBackspace", "labelForId", "inputAttrs", "tabIndex", "tabFocusOnClearButton", "readonly", "searchWhileComposing", "minTermLength", "editableSearchTerm", "ngClass", "typeahead", "multiple", "addTag", "searchable", "clearable", "isOpen", "items", "compareWith", "clearSearchOnAdd", "deselectOnClick", "keyDownFn"], outputs: ["blur", "focus", "change", "open", "close", "search", "clear", "add", "remove", "scroll", "scrollToEnd"] }, { kind: "directive", type: i3.NgOptionTemplateDirective, selector: "[ng-option-tmp]" }, { kind: "directive", type: i3.NgLabelTemplateDirective, selector: "[ng-label-tmp]" }, { kind: "ngmodule", type: NgxSliderModule }, { kind: "component", type: i4.SliderComponent, selector: "ngx-slider", inputs: ["value", "highValue", "options", "manualRefresh", "triggerFocus", "cancelUserChange"], outputs: ["valueChange", "highValueChange", "userChangeStart", "userChange", "userChangeEnd"] }, { kind: "directive", type: ShowHidePasswordDirective, selector: "[showHidePassword]" }, { kind: "component", type: IconComponent, selector: "cw-icon", inputs: ["icon", "label", "type", "iconSize", "iconCssClass", "iconUiType", "iconColorCustom", "spritePath"] }, { kind: "component", type: ButtonComponent, selector: "cw-button", inputs: ["type", "label", "id", "isDropdown", "withIcon", "withOnlyIcon", "iconSize", "iconPosition", "dropdownPosition", "isMinWidth", "isDisabled", "isLoading", "cssClass", "dataTest", "skeletonMode", "withTooltip", "tooltipText", "tooltipTitle", "tooltipTrigger", "tooltipPosition", "tooltipType"], outputs: ["btnAction", "dropDownClicked"] }, { kind: "pipe", type: i2.TranslatePipe, name: "translate" }] }); }
3217
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.20", type: FormFieldComponent, isStandalone: true, selector: "cw-form-field", inputs: { control: { classPropertyName: "control", publicName: "control", isSignal: false, isRequired: false, transformFunction: null }, formGroup: { classPropertyName: "formGroup", publicName: "formGroup", isSignal: false, isRequired: false, transformFunction: null }, type: { classPropertyName: "type", publicName: "type", isSignal: false, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: false, isRequired: false, transformFunction: null }, displayLabel: { classPropertyName: "displayLabel", publicName: "displayLabel", isSignal: false, isRequired: false, transformFunction: null }, name: { classPropertyName: "name", publicName: "name", isSignal: false, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: false, isRequired: false, transformFunction: null }, autocomplete: { classPropertyName: "autocomplete", publicName: "autocomplete", isSignal: false, isRequired: false, transformFunction: null }, options: { classPropertyName: "options", publicName: "options", isSignal: false, isRequired: false, transformFunction: null }, rangeOptions: { classPropertyName: "rangeOptions", publicName: "rangeOptions", isSignal: false, isRequired: false, transformFunction: null }, validationOptions: { classPropertyName: "validationOptions", publicName: "validationOptions", isSignal: false, isRequired: false, transformFunction: null }, autocompleteOptions: { classPropertyName: "autocompleteOptions", publicName: "autocompleteOptions", isSignal: false, isRequired: false, transformFunction: null }, errorMessages: { classPropertyName: "errorMessages", publicName: "errorMessages", isSignal: false, isRequired: false, transformFunction: null }, isRequired: { classPropertyName: "isRequired", publicName: "isRequired", isSignal: false, isRequired: false, transformFunction: null }, help: { classPropertyName: "help", publicName: "help", isSignal: false, isRequired: false, transformFunction: null }, tooltip: { classPropertyName: "tooltip", publicName: "tooltip", isSignal: false, isRequired: false, transformFunction: null }, addonLeft: { classPropertyName: "addonLeft", publicName: "addonLeft", isSignal: false, isRequired: false, transformFunction: null }, addonRight: { classPropertyName: "addonRight", publicName: "addonRight", isSignal: false, isRequired: false, transformFunction: null }, isInAddon: { classPropertyName: "isInAddon", publicName: "isInAddon", isSignal: false, isRequired: false, transformFunction: null }, isReadonly: { classPropertyName: "isReadonly", publicName: "isReadonly", isSignal: false, isRequired: false, transformFunction: null }, isDisabled: { classPropertyName: "isDisabled", publicName: "isDisabled", isSignal: false, isRequired: false, transformFunction: null }, sliderValue: { classPropertyName: "sliderValue", publicName: "sliderValue", isSignal: false, isRequired: false, transformFunction: null }, sliderOptions: { classPropertyName: "sliderOptions", publicName: "sliderOptions", isSignal: false, isRequired: false, transformFunction: null }, cssClass: { classPropertyName: "cssClass", publicName: "cssClass", isSignal: false, isRequired: false, transformFunction: null }, skeletonMode: { classPropertyName: "skeletonMode", publicName: "skeletonMode", isSignal: false, isRequired: false, transformFunction: null }, clearable: { classPropertyName: "clearable", publicName: "clearable", isSignal: false, isRequired: false, transformFunction: null }, appendTo: { classPropertyName: "appendTo", publicName: "appendTo", isSignal: false, isRequired: false, transformFunction: null }, initialCountry: { classPropertyName: "initialCountry", publicName: "initialCountry", isSignal: false, isRequired: false, transformFunction: null }, indeterminate: { classPropertyName: "indeterminate", publicName: "indeterminate", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { refreshEvent: "refreshEvent", textChanged: "textChanged", valueChange: "valueChange" }, host: { properties: { "class": "this.hostClasses" } }, queries: [{ propertyName: "optionTemplate", first: true, predicate: ["ngOptionTpl"], descendants: true, read: TemplateRef }, { propertyName: "labelTemplate", first: true, predicate: ["ngLabelTpl"], descendants: true, read: TemplateRef }], viewQueries: [{ propertyName: "checkboxInputRef", first: true, predicate: ["checkboxInput"], descendants: true, isSignal: true }, { propertyName: "fileInputRef", first: true, predicate: ["fileInput"], descendants: true, isSignal: true }, { propertyName: "phoneInputRef", first: true, predicate: ["phoneInput"], descendants: true, isSignal: true }, { propertyName: "autocompleteRef", first: true, predicate: AutocompleteComponent, descendants: true, isSignal: true }], usesOnChanges: true, ngImport: i0, template: "@if (!isInAddon) {\r\n @if (\r\n type !== typeField.checkbox &&\r\n type !== typeField.radio &&\r\n type !== typeField.checkboxButton &&\r\n type !== typeField.radioButton &&\r\n type !== typeField.checkboxInline &&\r\n type !== typeField.radioInline &&\r\n type !== typeField.switch &&\r\n type !== typeField.range &&\r\n type !== typeField.switchSmall\r\n ) {\r\n <label [for]=\"name\" class=\"field-label\" [class.visually-hidden]=\"!displayLabel\">\r\n {{ label | translate }}\r\n\r\n @if (isRequired) {\r\n <span class=\"text-danger\">*</span>\r\n }\r\n\r\n @if (tooltip) {\r\n <!-- <button type=\"button\" class=\"btn btn-link btn-popover\" placement=\"bottom\" [ngbPopover]=\"popContent\" container=\"body\"\r\n triggers=\"mouseenter:mouseleave\">\r\n <span class=\"btn-popover-icon bo-icons bo-help\"></span>\r\n </button>\r\n <ng-template #popContent>\r\n <div [innerHTML]=\"tooltip\"></div>\r\n </ng-template> -->\r\n }\r\n </label>\r\n }\r\n\r\n @if (addonLeft || addonRight) {\r\n <div class=\"field-group\">\r\n @if(addonLeft) {\r\n <ng-container [ngTemplateOutlet]=\"addonLeft\"></ng-container>\r\n }\r\n <ng-container [ngTemplateOutlet]=\"field\"></ng-container>\r\n @if(addonRight) {\r\n <ng-container [ngTemplateOutlet]=\"addonRight\"></ng-container>\r\n }\r\n </div>\r\n }\r\n @else {\r\n @if ( isInInputGroup() ) {\r\n <div class=\"field-group\">\r\n <ng-container [ngTemplateOutlet]=\"field\"></ng-container>\r\n </div>\r\n }\r\n @else {\r\n <ng-container [ngTemplateOutlet]=\"field\"></ng-container>\r\n }\r\n }\r\n\r\n <!-- Error message -->\r\n @if (controlOrGroup?.invalid && controlOrGroup?.touched) {\r\n <div class=\"field-invalid\" [id]=\"'error-' + name\">\r\n @if (\r\n !errorMessages?.['required'] &&\r\n ((controlOrGroup?.errors?.['required']) || (getControl('start')?.errors?.['required'] || getControl('end')?.errors?.['required']))\r\n ) {\r\n <span [innerHtml]=\"'_COMMON._FORM.ERROR_IS_MANDATORY' | translate: {label: label | translate}\"></span>\r\n }\r\n @if (!errorMessages?.['rangeInvalid'] && controlOrGroup?.errors?.['rangeInvalid']) {\r\n <span>{{'_COMMON._DATES.ERROR_START_END_PERIOD' | translate}}</span>\r\n }\r\n @if (!errorMessages?.['fileExtension'] && controlOrGroup?.errors?.['fileExtension']) {\r\n <span>{{ '_COMMON._FORM.ERROR_FILE_EXTENSION' | translate: { accept: acceptLabel } }}</span>\r\n }\r\n @if (!errorMessages?.['fileSize'] && controlOrGroup?.errors?.['fileSize']) {\r\n <span>{{ '_COMMON._FORM.ERROR_FILE_SIZE' | translate: { maxSize: maxSizeLabel } }}</span>\r\n }\r\n @if (!errorMessages?.['email'] && controlOrGroup?.errors?.['email']) {\r\n <span>{{ '_COMMON._FORM.ERROR_INVALID_EMAIL' | translate }}</span>\r\n }\r\n @if (!errorMessages?.['phone'] && controlOrGroup?.errors?.['phone']) {\r\n <span>{{ '_COMMON._FORM.ERROR_INVALID_PHONE' | translate }}</span>\r\n }\r\n @if (errorMessages) {\r\n @for (entry of errorMessages | keyvalue: keepOrder; track entry.key) {\r\n @if (controlOrGroup?.errors?.[entry.key]; as errVal) {\r\n <span>{{ entry.value | translate: (errVal === true ? null : errVal) }}</span>\r\n }\r\n }\r\n }\r\n </div>\r\n }\r\n\r\n @if (help || autoHelpEntries.length) {\r\n <div [id]=\"name + '-help'\" class=\"field-text\">\r\n @if (help) {\r\n <span>{{ help | translate }}</span>\r\n }\r\n @for (entry of autoHelpEntries; track entry.key) {\r\n <span> - {{ entry.key | translate: entry.params }}</span>\r\n }\r\n </div>\r\n }\r\n}\r\n@else {\r\n <ng-container [ngTemplateOutlet]=\"field\"></ng-container>\r\n}\r\n\r\n<ng-template #field>\r\n <!-- Autocomplete (mono / multi) -->\r\n @if ((type === typeField.autocomplete || type === typeField.autocompleteMultiple) && autocompleteOptions) {\r\n <cw-autocomplete\r\n [id]=\"name\"\r\n [control]=\"formControl\"\r\n [fetcher]=\"autocompleteOptions.fetcher\"\r\n [displayField]=\"autocompleteOptions.displayField ?? 'label'\"\r\n [valueField]=\"autocompleteOptions.valueField ?? 'id'\"\r\n [columns]=\"autocompleteOptions.columns ?? []\"\r\n [resolver]=\"autocompleteOptions.resolver ?? null\"\r\n [selectedItem]=\"autocompleteOptions.selectedItem ?? null\"\r\n [selectedItems]=\"autocompleteOptions.selectedItems ?? []\"\r\n [minChars]=\"autocompleteOptions.minChars ?? 2\"\r\n [debounceMs]=\"autocompleteOptions.debounceMs ?? 250\"\r\n [multiple]=\"type === typeField.autocompleteMultiple\"\r\n [isRequired]=\"isRequired\"\r\n [isReadonly]=\"!!isReadonly\"\r\n [isDisabled]=\"isEffectivelyDisabled\"\r\n [ariaInvalid]=\"control.invalid && control.touched\"\r\n [ariaDescribedBy]=\"getDescribedBy(control)\"\r\n [placeholder]=\"placeholder\">\r\n </cw-autocomplete>\r\n }\r\n\r\n <!-- Text -->\r\n @if ([typeField.text, typeField.date, typeField.time, typeField.dateTime, typeField.number,\r\n typeField.email,\r\n typeField.color, typeField.zipCode].includes(type)) {\r\n <input [type]=\"type === typeField.zipCode ? 'text' : type\" class=\"field-control\" [id]=\"name\" [formControl]=\"formControl\"\r\n [ngClass]=\"[(cssClass || ''), formControl?.value ? 'has-value' : '', type === typeField.zipCode ? 'field-control-zipcode' : '']\"\r\n [attr.placeholder]=\"placeholder ? (placeholder | translate) : null\" [attr.required]=\"isRequired ? 'required' : null\"\r\n [attr.readonly]=\"isReadonly ? 'readonly' : null\" [attr.aria-required]=\"isRequired\"\r\n [attr.minlength]=\"minLengthAttr\" [attr.maxlength]=\"maxLengthAttr\"\r\n [attr.min]=\"minAttr\" [attr.max]=\"maxAttr\" [attr.step]=\"stepAttr\" [attr.pattern]=\"patternAttr\"\r\n [attr.autocomplete]=\"autocomplete\"\r\n [attr.aria-invalid]=\"control.invalid && control.touched\"\r\n [attr.aria-describedby]=\"getDescribedBy(control)\"\r\n (focus)=\"onFocus()\" (blur)=\"onBlur()\" />\r\n }\r\n\r\n <!-- Phone (intl-tel-input) -->\r\n @if (type === typeField.phone) {\r\n <input #phoneInput type=\"tel\" class=\"field-control\" [id]=\"name\"\r\n [attr.placeholder]=\"placeholder ? (placeholder | translate) : null\" [attr.required]=\"isRequired ? 'required' : null\"\r\n [attr.readonly]=\"isReadonly ? 'readonly' : null\" [disabled]=\"isEffectivelyDisabled\" [attr.aria-required]=\"isRequired\"\r\n [attr.autocomplete]=\"autocomplete\"\r\n [attr.aria-invalid]=\"control.invalid && control.touched\"\r\n [attr.aria-describedby]=\"getDescribedBy(control)\"\r\n (focus)=\"onFocus()\" (blur)=\"onPhoneBlur($event)\" />\r\n }\r\n\r\n <!-- File -->\r\n @if (type === typeField.file) {\r\n <input #fileInput type=\"file\" class=\"field-control\" [id]=\"name\"\r\n [ngClass]=\"[(cssClass || ''), formControl?.value ? 'has-value' : '']\"\r\n [attr.placeholder]=\"placeholder ? (placeholder | translate) : null\" [attr.required]=\"isRequired ? 'required' : null\"\r\n [attr.readonly]=\"isReadonly ? 'readonly' : null\" [disabled]=\"isEffectivelyDisabled\" [attr.aria-required]=\"isRequired\"\r\n [attr.accept]=\"acceptAttr\"\r\n [attr.aria-invalid]=\"control.invalid && control.touched\"\r\n [attr.aria-describedby]=\"getDescribedBy(control)\"\r\n (change)=\"onFileChange($event)\" (focus)=\"onFocus()\" (blur)=\"onBlur()\" />\r\n }\r\n\r\n @if (type === typeField.password) {\r\n <input [type]=\"isPasswordShown ? 'text' : 'password'\" class=\"field-control\" [id]=\"name\" [formControl]=\"formControl\"\r\n [ngClass]=\"[(cssClass || ''), formControl?.value ? 'has-value' : '']\"\r\n [attr.required]=\"isRequired ? 'required' : null\" [attr.readonly]=\"isReadonly ? 'readonly' : null\"\r\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\" [attr.aria-required]=\"isRequired\"\r\n [attr.minlength]=\"minLengthAttr\" [attr.maxlength]=\"maxLengthAttr\" [attr.pattern]=\"patternAttr\"\r\n [attr.autocomplete]=\"autocomplete\"\r\n [attr.aria-invalid]=\"control.invalid && control.touched\"\r\n [attr.aria-describedby]=\"getDescribedBy(control)\"\r\n (focus)=\"onFocus()\" (blur)=\"onBlur()\" />\r\n <cw-button [type]=\"buttonType.secondary\"\r\n [withIcon]=\"isPasswordShown ? spriteIcon.toolbarHidePassword : spriteIcon.toolbarShowPassword\"\r\n [withOnlyIcon]=\"true\"\r\n [label]=\"isPasswordShown ? '_COMMON._FORM._SHOW_HIDE_PWD.HIDE' : '_COMMON._FORM._SHOW_HIDE_PWD.SHOW'\"\r\n (btnAction)=\"togglePasswordVisibility()\">\r\n </cw-button>\r\n }\r\n\r\n <!-- Textarea -->\r\n @if (type === typeField.textarea) {\r\n <textarea class=\"field-control\" [id]=\"name\" [formControl]=\"formControl\"\r\n [ngClass]=\"[(cssClass || ''), formControl?.value ? 'has-value' : '']\"\r\n [attr.placeholder]=\"placeholder ? (placeholder | translate) : null\" [attr.required]=\"isRequired ? 'required' : null\"\r\n [attr.readonly]=\"isReadonly ? 'readonly' : null\" [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\"\r\n [attr.aria-required]=\"isRequired\" [attr.aria-invalid]=\"control.invalid && control.touched\"\r\n [attr.minlength]=\"minLengthAttr\" [attr.maxlength]=\"maxLengthAttr\" [attr.pattern]=\"patternAttr\"\r\n [attr.autocomplete]=\"autocomplete\"\r\n [attr.aria-describedby]=\"getDescribedBy(control)\"\r\n (focus)=\"onFocus()\" (blur)=\"onBlur()\"></textarea>\r\n }\r\n\r\n <!-- Select -->\r\n @if (type === typeField.select) {\r\n <ng-select [formControl]=\"formControl\" [items]=\"options\" bindLabel=\"label\" [labelForId]=\"name\" [appendTo]=\"appendTo\" bindValue=\"value\"\r\n [ngClass]=\"cssClass\" [searchable]=\"false\" [placeholder]=\"placeholder ? (placeholder | translate) : null\" [readonly]=\"isReadonly\" [clearable]=\"false\"\r\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\" [attr.required]=\"isRequired ? 'required' : null\"\r\n [attr.aria-required]=\"isRequired\" [attr.aria-invalid]=\"control.invalid && control.touched\"\r\n [attr.aria-describedby]=\"getDescribedBy(control)\" [attr.id]=\"name\"\r\n (focus)=\"onFocus()\" (blur)=\"onBlur()\">\r\n\r\n <!-- Template pour les options -->\r\n <ng-template ng-option-tmp let-item=\"item\" let-index=\"index\" let-search=\"searchTerm\">\r\n @if (optionTemplate) {\r\n <ng-container *ngTemplateOutlet=\"optionTemplate; context: { item: item | translate, index: index, searchTerm: search }\"></ng-container>\r\n }\r\n @else {\r\n <div>{{ item.label | translate }}</div>\r\n }\r\n </ng-template>\r\n\r\n <!-- Template pour le label -->\r\n <ng-template ng-label-tmp let-item=\"item\">\r\n @if (labelTemplate) {\r\n <ng-container *ngTemplateOutlet=\"labelTemplate; context: { item: item | translate }\"></ng-container>\r\n }\r\n @else {\r\n {{ (item.label | translate) || (placeholder | translate) }}\r\n }\r\n </ng-template>\r\n </ng-select>\r\n }\r\n\r\n <!-- NgSelect -->\r\n @if (type === typeField.ngSelect || type === typeField.ngSelectMultiple) {\r\n <ng-select [formControl]=\"formControl\" [items]=\"options\" bindLabel=\"label\" [labelForId]=\"name\" [appendTo]=\"appendTo\" bindValue=\"value\"\r\n [multiple]=\"type === typeField.ngSelectMultiple\" [ngClass]=\"cssClass\" [clearable]=\"false\"\r\n [placeholder]=\"placeholder ? (placeholder | translate) : null\" [readonly]=\"isReadonly\"\r\n [notFoundText]=\"'_COMMON.NO_RESULT' | translate\" [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\"\r\n [attr.required]=\"isRequired ? 'required' : null\" [attr.aria-required]=\"isRequired\"\r\n [attr.aria-invalid]=\"control.invalid && control.touched\"\r\n [attr.aria-describedby]=\"getDescribedBy(control)\" [attr.id]=\"name\"\r\n (focus)=\"onFocus()\" (blur)=\"onBlur()\" (search)=\"textChanged.emit($event?.term)\">\r\n\r\n <!-- Template pour les options -->\r\n <ng-template ng-option-tmp let-item=\"item\" let-index=\"index\" let-search=\"searchTerm\">\r\n @if (optionTemplate) {\r\n <ng-container *ngTemplateOutlet=\"optionTemplate; context: { item: item, index: index, searchTerm: search }\"></ng-container>\r\n }\r\n @else {\r\n <div>{{ item.label | translate }}</div>\r\n }\r\n </ng-template>\r\n\r\n <!-- Template pour le label -->\r\n <ng-template ng-label-tmp let-item=\"item\" let-clear=\"clear\">\r\n <span class=\"ng-value-icon left\" (click)=\"clear(item)\" aria-hidden=\"true\">\u00D7</span>\r\n @if (labelTemplate) {\r\n <ng-container *ngTemplateOutlet=\"labelTemplate; context: { item: item | translate }\"></ng-container>\r\n }\r\n @else {\r\n {{ (item.label | translate) || (placeholder | translate) }}\r\n }\r\n </ng-template>\r\n </ng-select>\r\n }\r\n\r\n <!-- Radio -->\r\n @if (type === typeField.radioInline || type === typeField.radio) {\r\n <fieldset\r\n [attr.aria-required]=\"isRequired\"\r\n [attr.aria-invalid]=\"control.invalid && control.touched\"\r\n [attr.aria-describedby]=\"getDescribedBy(control)\">\r\n <legend class=\"field-label\" [class.visually-hidden]=\"!displayLabel\">\r\n {{label | translate}}\r\n @if(isRequired) {\r\n <span class=\"text-danger\">*</span>\r\n }\r\n </legend>\r\n <ul class=\"list-unstyled mb-none\" [ngClass]=\"type === typeField.radioInline ? 'd-flex-h gap-md flex-wrap' : 'd-flex-v'\">\r\n @for (opt of options; track opt.value) {\r\n <li class=\"field-check\">\r\n <input type=\"radio\" [id]=\"name + '_' + opt.value\" [value]=\"opt.value\" [formControl]=\"formControl\"\r\n class=\"field-check-input\" [attr.disabled]=\"(isEffectivelyDisabled || opt.disabled) ? 'disabled' : null\" (change)=\"onRadioChange(opt.value)\" />\r\n <label [for]=\"name + '_' + opt.value\" class=\"field-check-label\">{{ opt.label | translate }}</label>\r\n </li>\r\n }\r\n </ul>\r\n </fieldset>\r\n }\r\n\r\n <!-- Radio button -->\r\n @if (type === typeField.radioButton) {\r\n <fieldset\r\n [attr.aria-required]=\"isRequired\"\r\n [attr.aria-invalid]=\"control.invalid && control.touched\"\r\n [attr.aria-describedby]=\"getDescribedBy(control)\">\r\n <legend class=\"field-label\" [class.visually-hidden]=\"!displayLabel\">\r\n {{label | translate}}\r\n @if(isRequired) {\r\n <span class=\"text-danger\">*</span>\r\n }\r\n </legend>\r\n <div class=\"field-group field-group-btn\">\r\n @for (opt of options; track opt.value) {\r\n <input type=\"radio\" [id]=\"name + '_' + opt.value\" [value]=\"opt.value\" [formControl]=\"formControl\"\r\n class=\"visually-hidden\" [attr.disabled]=\"(isEffectivelyDisabled || opt.disabled) ? 'disabled' : null\" (change)=\"onRadioChange(opt.value)\"/>\r\n <label [for]=\"name + '_' + opt.value\" class=\"btn btn-field-group\">{{ opt.label | translate }}</label>\r\n }\r\n </div>\r\n </fieldset>\r\n }\r\n\r\n <!-- Checkbox Switch -->\r\n @if ( type === typeField.switch || type === typeField.switchSmall)\r\n {\r\n <div class=\"field-check field-switch\" [ngClass]=\"{'field-switch-small': type === typeField.switchSmall}\">\r\n <input type=\"checkbox\" [id]=\"name\" [formControl]=\"formControl\" class=\"field-check-input\" [attr.aria-required]=\"isRequired\"\r\n [attr.aria-invalid]=\"control.invalid && control.touched\"\r\n [attr.aria-describedby]=\"getDescribedBy(control)\"\r\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\"/>\r\n <label [for]=\"name\" class=\"field-check-label\">{{ label | translate }}</label>\r\n </div>\r\n }\r\n\r\n <!-- Checkbox -->\r\n @if (type === typeField.checkboxInline || type === typeField.checkbox) {\r\n @if (isSingleCheckbox()) {\r\n <div class=\"field-check\" [class.field-check-inline]=\"type === typeField.checkboxInline\">\r\n <input #checkboxInput type=\"checkbox\" [id]=\"name\" [formControl]=\"formControl\"\r\n class=\"field-check-input\"\r\n [class.is-invalid]=\"control?.invalid && control?.touched\"\r\n [attr.aria-required]=\"isRequired\"\r\n [attr.aria-invalid]=\"control?.invalid && control?.touched\"\r\n [attr.aria-describedby]=\"getDescribedBy(control)\"\r\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\" />\r\n <label [for]=\"name\" class=\"field-check-label\">\r\n {{ label | translate }}\r\n @if (isRequired) {\r\n <span class=\"text-danger\">*</span>\r\n }\r\n </label>\r\n </div>\r\n }\r\n @else if( options.length > 1) {\r\n <fieldset\r\n [attr.aria-required]=\"isRequired\"\r\n [attr.aria-invalid]=\"control.invalid && control.touched\"\r\n [attr.aria-describedby]=\"getDescribedBy(control)\"\r\n [ngClass]=\"{ 'flex-column': type === typeField.checkbox }\">\r\n <legend class=\"field-label\" [class.visually-hidden]=\"!displayLabel\">\r\n {{label | translate}}\r\n @if(isRequired) {\r\n <span class=\"text-danger\">*</span>\r\n }\r\n </legend>\r\n <ul class=\"list-unstyled mb-none\" [ngClass]=\"type === typeField.checkboxInline ? 'd-flex-h gap-md' : 'd-flex-v'\">\r\n @for (opt of options; track opt.value) {\r\n <li class=\"field-check\" [ngClass]=\"{ 'field-check-inline': type === typeField.checkboxInline }\">\r\n <input type=\"checkbox\" [id]=\"name + '_' + opt.value\" [value]=\"opt.value\" (change)=\"onCheckboxChange($event)\"\r\n [checked]=\"control.value?.includes(opt.value)\" class=\"field-check-input\"\r\n [attr.disabled]=\"(isEffectivelyDisabled || opt.disabled) ? 'disabled' : null\" />\r\n <label [for]=\"name + '_' + opt.value\" class=\"field-check-label\">\r\n {{ opt.label | translate }}\r\n </label>\r\n </li>\r\n }\r\n </ul>\r\n </fieldset>\r\n }\r\n @else {\r\n <fieldset>\r\n <legend class=\"field-label\" [class.visually-hidden]=\"!displayLabel\">\r\n {{label | translate}}\r\n </legend>\r\n <ul class=\"list-unstyled mb-none\" [ngClass]=\"type === typeField.checkboxInline ? 'd-flex-h gap-md' : 'd-flex-v'\">\r\n @for (opt of options; track opt.value) {\r\n <li class=\"field-check\" [ngClass]=\"{ 'field-check-inline': type === typeField.checkboxInline }\">\r\n <input type=\"checkbox\" [id]=\"name + '_' + opt.value\" [value]=\"opt.value\" (change)=\"onCheckboxChange($event)\"\r\n [checked]=\"control.value?.includes(opt.value)\" class=\"field-check-input\"\r\n [attr.aria-required]=\"isRequired\"\r\n [attr.aria-invalid]=\"control.invalid && control.touched\"\r\n [attr.aria-describedby]=\"getDescribedBy(control)\"\r\n [attr.disabled]=\"(isEffectivelyDisabled || opt.disabled) ? 'disabled' : null\" />\r\n <label [for]=\"name + '_' + opt.value\" class=\"field-check-label\">\r\n {{ opt.label | translate }}\r\n @if(isRequired) {\r\n <span class=\"text-danger\">*</span>\r\n }\r\n </label>\r\n </li>\r\n }\r\n </ul>\r\n </fieldset>\r\n }\r\n }\r\n\r\n <!-- Checkbox button -->\r\n @if (type === typeField.checkboxButton && options.length > 0) {\r\n\r\n @if(options.length > 1) {\r\n <fieldset\r\n [attr.aria-required]=\"isRequired\"\r\n [attr.aria-invalid]=\"control.invalid && control.touched\"\r\n [attr.aria-describedby]=\"getDescribedBy(control)\">\r\n <legend class=\"field-label\" [class.visually-hidden]=\"!displayLabel\">\r\n {{label | translate}}\r\n @if(isRequired) {\r\n <span class=\"text-danger\">*</span>\r\n }\r\n </legend>\r\n <div class=\"field-group field-group-btn\">\r\n @for (opt of options; track opt.value) {\r\n <input type=\"checkbox\" [id]=\"name + '_' + opt.value\" [value]=\"opt.value\" (change)=\"onCheckboxChange($event)\"\r\n [checked]=\"control.value?.includes(opt.value)\" class=\"visually-hidden\"\r\n [attr.disabled]=\"(isEffectivelyDisabled || opt.disabled) ? 'disabled' : null\" />\r\n <label [for]=\"name + '_' + opt.value\" class=\"btn btn-field-group\">{{ opt.label | translate }}</label>\r\n }\r\n </div>\r\n </fieldset>\r\n }\r\n @else {\r\n <fieldset>\r\n <legend class=\"field-label\" [class.visually-hidden]=\"!displayLabel\">\r\n {{label | translate}}\r\n </legend>\r\n <div class=\"btn-group btn-group-secondary\">\r\n @for (opt of options; track opt.value) {\r\n <input type=\"checkbox\" [id]=\"name + '_' + opt.value\" [value]=\"opt.value\" (change)=\"onCheckboxChange($event)\"\r\n [checked]=\"control.value?.includes(opt.value)\" class=\"visually-hidden\"\r\n [attr.aria-required]=\"isRequired\"\r\n [attr.aria-invalid]=\"control.invalid && control.touched\"\r\n [attr.aria-describedby]=\"getDescribedBy(control)\"\r\n [attr.disabled]=\"(isEffectivelyDisabled || opt.disabled) ? 'disabled' : null\"/>\r\n <label [for]=\"name + '_' + opt.value\" class=\"btn btn-field-group\">\r\n {{ opt.label | translate}}\r\n @if(isRequired) {\r\n <span class=\"text-danger\">*</span>\r\n }\r\n </label>\r\n }\r\n </div>\r\n </fieldset>\r\n }\r\n }\r\n\r\n <!-- Period - DateToDate / TimeToTime / DateTimeToDateTime -->\r\n @if ([typeField.dateToDate, typeField.timeToTime, typeField.dateTimeToDateTime].includes(type) && isRange) {\r\n\r\n <div class=\"field-group\">\r\n <div class=\"field-group-text\">Du</div>\r\n <input [type]=\"getInputType()\" class=\"field-control\" [id]=\"name + '_start'\" [formControl]=\"getControl('start')\"\r\n [attr.placeholder]=\"type === typeField.timeToTime ? ('_COMMON._DATES.FROM' | translate) : ('_COMMON._DATES.FROM_TO_1' | translate)\"\r\n [ngClass]=\"[(cssClass || ''), getControl('start')?.value ? 'has-value' : '']\"\r\n [attr.required]=\"isRequired ? 'required' : null\" [attr.readonly]=\"isReadonly ? 'readonly' : null\"\r\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\" [attr.aria-required]=\"isRequired\"\r\n [attr.min]=\"minStartAttr\" [attr.max]=\"maxStartAttr\" [attr.step]=\"stepAttr\"\r\n [attr.autocomplete]=\"autocomplete\"\r\n [attr.aria-invalid]=\"getControl('start')?.invalid && getControl('start')?.touched\"\r\n [attr.aria-describedby]=\"getDescribedBy(getControl('start'))\"\r\n (focus)=\"onFocusRange('start')\" />\r\n\r\n @if(getControl('start')?.value && !isEffectivelyDisabled) {\r\n <button type=\"button\" class=\"btn btn-secondary btn-clear-field\"\r\n (click)=\"onClearFieldPeriod('start')\">\r\n &times;\r\n </button>\r\n }\r\n <div class=\"field-group-text\">au</div>\r\n <input [type]=\"getInputType()\" class=\"field-control\" [id]=\"name + '_end'\" [formControl]=\"getControl('end')\"\r\n [attr.placeholder]=\"type === typeField.timeToTime ? ('_COMMON._DATES.TO' | translate) : ('_COMMON._DATES.FROM_TO_2' | translate)\"\r\n [ngClass]=\"[(cssClass || ''), getControl('end')?.value ? 'has-value' : '']\"\r\n [attr.required]=\"isRequired ? 'required' : null\" [attr.readonly]=\"isReadonly ? 'readonly' : null\"\r\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\"\r\n [attr.min]=\"minEndAttr\" [attr.max]=\"maxEndAttr\" [attr.step]=\"stepAttr\"\r\n [attr.autocomplete]=\"autocomplete\"\r\n [attr.aria-invalid]=\"getControl('end')?.invalid && getControl('end')?.touched\"\r\n [attr.aria-describedby]=\"getDescribedBy(getControl('end'))\"\r\n (focus)=\"onFocusRange('end')\" />\r\n\r\n @if(getControl('end')?.value && !isEffectivelyDisabled) {\r\n <button type=\"button\" class=\"btn btn-secondary btn-clear-field\"\r\n (click)=\"onClearFieldPeriod('end')\">\r\n &times;\r\n </button>\r\n }\r\n </div>\r\n }\r\n\r\n @if ([typeField.datePlusOne, typeField.datePlusTwo, typeField.datePlusSeven, typeField.dateComplexe].includes(type)) {\r\n\r\n <div class=\"field-group\">\r\n @if (type === typeField.dateComplexe) {\r\n <button class=\"btn btn-secondary\" type=\"button\" (click)=\"onDateAddDay('prev')\"\r\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\">\r\n <cw-icon font=\"optyweb\" [icon]=\"spriteIcon.nextLeft\" [label]=\"'Jour pr\u00E9c\u00E9dent'\"></cw-icon>\r\n </button>\r\n }\r\n\r\n <input type=\"date\" class=\"field-control\" [id]=\"name\" [formControl]=\"formControl\"\r\n [ngClass]=\"[(cssClass || ''), formControl?.value ? 'has-value' : '']\"\r\n [attr.placeholder]=\"placeholder ? placeholder : null\" [attr.required]=\"isRequired ? 'required' : null\"\r\n [attr.readonly]=\"isReadonly ? 'readonly' : null\" [attr.aria-required]=\"isRequired\"\r\n [attr.min]=\"minAttr\" [attr.max]=\"maxAttr\" [attr.step]=\"stepAttr\"\r\n [attr.autocomplete]=\"autocomplete\"\r\n [attr.aria-invalid]=\"control.invalid && control.touched\"\r\n [attr.aria-describedby]=\"getDescribedBy(control)\"\r\n (focus)=\"onFocus()\" (blur)=\"onBlur()\" />\r\n\r\n @if(formControl?.value && !isEffectivelyDisabled) {\r\n <button class=\"btn btn-secondary btn-clear-field\" type=\"button\"\r\n (click)=\"onClearField(formControl)\">&times;</button>\r\n }\r\n\r\n @if (type === typeField.dateComplexe) {\r\n <button class=\"btn btn-secondary\" type=\"button\" (click)=\"onDateAddDay('next')\"\r\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\">\r\n <cw-icon font=\"optyweb\" [icon]=\"spriteIcon.nextRight\" [label]=\"'Jour suivant'\"></cw-icon>\r\n </button>\r\n <button class=\"btn btn-secondary\" type=\"button\" (click)=\"onRefresh()\"\r\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\">\r\n <cw-icon font=\"optyweb\" [icon]=\"spriteIcon.toolbarRefresh\" [label]=\"'Rafra\u00EEchir'\"></cw-icon>\r\n </button>\r\n }\r\n\r\n <button class=\"btn btn-secondary\" type=\"button\" (click)=\"onTodayAddDay(0)\"\r\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\">\r\n J\r\n <span class=\"visually-hidden\">Aujourd'hui</span>\r\n </button>\r\n <button class=\"btn btn-secondary\" type=\"button\" (click)=\"onTodayAddDay(1)\"\r\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\">\r\n J+1\r\n <span class=\"visually-hidden\">Demain</span>\r\n </button>\r\n\r\n @if (type !== typeField.datePlusOne && type !== typeField.dateComplexe) {\r\n <button class=\"btn btn-secondary \" type=\"button\" (click)=\"onTodayAddDay(2)\"\r\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\">\r\n J+2\r\n <span class=\"visually-hidden\">Dans 2 jours</span>\r\n </button>\r\n\r\n @if (type !== typeField.datePlusTwo) {\r\n <button class=\"btn btn-secondary\" type=\"button\" (click)=\"onTodayAddDay(7)\"\r\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\">\r\n J+7\r\n <span class=\"visually-hidden\">Dans 7 jours</span>\r\n </button>\r\n }\r\n }\r\n </div>\r\n }\r\n\r\n @if (type === typeField.slider) {\r\n <ngx-slider [(value)]=\"sliderValue\" [options]=\"sliderOptions\" [formControl]=\"formControl\"></ngx-slider>\r\n }\r\n\r\n @if (type === typeField.range) {\r\n <div class=\"slider\">\r\n\r\n <cw-button [isDisabled]=\"formControl.value <= rangeOptions.floor\" [label]=\"'Diminuer ' + formControl.value + ' ' + label\"\r\n [withIcon]=\"spriteIcon.toolbarMinus\" [withOnlyIcon]=\"true\" [type]=\"buttonType.primary\"\r\n [iconSize]=\"buttonIconSize.small\" (btnAction)=\"onRangeStep('decrease')\">\r\n </cw-button>\r\n\r\n <div class=\"slider-input\">\r\n <label [for]=\"name\" class=\"slider-tooltip\" [style.left]=\"getRangePercent() + '%'\" aria-live=\"polite\"\r\n aria-atomic=\"true\">\r\n {{ label | translate }} {{ formControl.value }}\r\n @if (rangeOptions.unit) {\r\n <abbr [title]=\"rangeOptions.unit\">{{ rangeOptions.unit }}</abbr>\r\n }\r\n </label>\r\n\r\n <div class=\"slider-custom-bar\">\r\n <div class=\"slider-custom-bar-selection\" [style.width]=\"getRangePercent() + '%'\">\r\n </div>\r\n </div>\r\n\r\n <input type=\"range\" [id]=\"name\" [formControl]=\"formControl\" [min]=\"rangeOptions.floor\" [max]=\"rangeOptions.ceil\"\r\n [step]=\"rangeOptions.step || 1\" class=\"field-control-range\" [attr.aria-required]=\"isRequired\"\r\n [attr.aria-invalid]=\"control.invalid && control.touched\">\r\n </div>\r\n\r\n <cw-button [isDisabled]=\"formControl.value >= rangeOptions.ceil\" [label]=\"'Augmenter ' + formControl.value + ' ' + label\"\r\n [withIcon]=\"spriteIcon.toolbarPlus\" [withOnlyIcon]=\"true\" [type]=\"buttonType.primary\"\r\n [iconSize]=\"buttonIconSize.small\" (btnAction)=\"onRangeStep('increase')\">\r\n </cw-button>\r\n </div>\r\n }\r\n\r\n @if (isInInputGroup() && clearable && !isEffectivelyDisabled && type !== typeField.autocompleteMultiple) {\r\n @if (type === typeField.autocomplete) {\r\n @if (autocompleteRef()?.hasAnyContent()) {\r\n <button class=\"btn btn-secondary btn-clear-field\" type=\"button\"\r\n (click)=\"autocompleteRef()!.clear()\">&times;</button>\r\n }\r\n } @else {\r\n @if(formControl?.value) {\r\n <button class=\"btn btn-secondary btn-clear-field\" type=\"button\"\r\n (click)=\"onClearField(formControl)\">&times;</button>\r\n }\r\n }\r\n }\r\n\r\n</ng-template>\r\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "ngmodule", type: TranslateModule }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i2$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2$1.RangeValueAccessor, selector: "input[type=range][formControlName],input[type=range][formControl],input[type=range][ngModel]" }, { kind: "directive", type: i2$1.CheckboxControlValueAccessor, selector: "input[type=checkbox][formControlName],input[type=checkbox][formControl],input[type=checkbox][ngModel]" }, { kind: "directive", type: i2$1.RadioControlValueAccessor, selector: "input[type=radio][formControlName],input[type=radio][formControl],input[type=radio][ngModel]", inputs: ["name", "formControlName", "value"] }, { kind: "directive", type: i2$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i2$1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "ngmodule", type: NgSelectModule }, { kind: "component", type: i3.NgSelectComponent, selector: "ng-select", inputs: ["ariaLabelDropdown", "bindLabel", "bindValue", "ariaLabel", "markFirst", "placeholder", "fixedPlaceholder", "notFoundText", "typeToSearchText", "preventToggleOnRightClick", "addTagText", "loadingText", "clearAllText", "appearance", "dropdownPosition", "appendTo", "loading", "closeOnSelect", "hideSelected", "selectOnTab", "openOnEnter", "maxSelectedItems", "groupBy", "groupValue", "bufferAmount", "virtualScroll", "selectableGroup", "selectableGroupAsModel", "searchFn", "trackByFn", "clearOnBackspace", "labelForId", "inputAttrs", "tabIndex", "tabFocusOnClearButton", "readonly", "searchWhileComposing", "minTermLength", "editableSearchTerm", "ngClass", "typeahead", "multiple", "addTag", "searchable", "clearable", "isOpen", "items", "compareWith", "clearSearchOnAdd", "deselectOnClick", "keyDownFn"], outputs: ["blur", "focus", "change", "open", "close", "search", "clear", "add", "remove", "scroll", "scrollToEnd"] }, { kind: "directive", type: i3.NgOptionTemplateDirective, selector: "[ng-option-tmp]" }, { kind: "directive", type: i3.NgLabelTemplateDirective, selector: "[ng-label-tmp]" }, { kind: "ngmodule", type: NgxSliderModule }, { kind: "component", type: i4.SliderComponent, selector: "ngx-slider", inputs: ["value", "highValue", "options", "manualRefresh", "triggerFocus", "cancelUserChange"], outputs: ["valueChange", "highValueChange", "userChangeStart", "userChange", "userChangeEnd"] }, { kind: "component", type: IconComponent, selector: "cw-icon", inputs: ["icon", "label", "type", "iconSize", "iconCssClass", "iconUiType", "iconColorCustom", "spritePath"] }, { kind: "component", type: ButtonComponent, selector: "cw-button", inputs: ["type", "label", "id", "link", "isDropdown", "hideCaret", "withIcon", "withOnlyIcon", "iconSize", "iconPosition", "dropdownPosition", "isMinWidth", "isDisabled", "isLoading", "cssClass", "dataTest", "skeletonMode", "withTooltip", "tooltipText", "tooltipTitle", "tooltipTrigger", "tooltipPosition", "tooltipType"], outputs: ["btnAction", "dropDownClicked"] }, { kind: "component", type: AutocompleteComponent, selector: "cw-autocomplete", inputs: ["control", "fetcher", "displayField", "valueField", "columns", "multiple", "minChars", "debounceMs", "selectedItem", "resolver", "selectedItems", "placeholder", "id", "isRequired", "isReadonly", "isDisabled", "ariaInvalid", "ariaDescribedBy"], outputs: ["itemSelected", "itemsChange"] }, { kind: "pipe", type: i1.KeyValuePipe, name: "keyvalue" }, { kind: "pipe", type: i2.TranslatePipe, name: "translate" }] }); }
2297
3218
  }
2298
3219
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: FormFieldComponent, decorators: [{
2299
3220
  type: Component,
@@ -2304,10 +3225,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.20", ngImpo
2304
3225
  ReactiveFormsModule,
2305
3226
  NgSelectModule,
2306
3227
  NgxSliderModule,
2307
- ShowHidePasswordDirective,
2308
3228
  IconComponent,
2309
- ButtonComponent
2310
- ], template: "@if (!isInAddon) {\r\n @if (\r\n type !== typeField.checkbox &&\r\n type !== typeField.radio &&\r\n type !== typeField.checkboxButton &&\r\n type !== typeField.radioButton &&\r\n type !== typeField.checkboxInline &&\r\n type !== typeField.radioInline &&\r\n type !== typeField.switch &&\r\n type !== typeField.range &&\r\n type !== typeField.switchSmall\r\n ) {\r\n <label [for]=\"name\" class=\"field-label\" [class.visually-hidden]=\"!displayLabel\">\r\n {{ label | translate }}\r\n\r\n @if (isRequired) {\r\n <span class=\"text-danger\">*</span>\r\n }\r\n\r\n @if (tooltip) {\r\n <!-- <button type=\"button\" class=\"btn btn-link btn-popover\" placement=\"bottom\" [ngbPopover]=\"popContent\" container=\"body\"\r\n triggers=\"mouseenter:mouseleave\">\r\n <span class=\"btn-popover-icon bo-icons bo-help\"></span>\r\n </button>\r\n <ng-template #popContent>\r\n <div [innerHTML]=\"tooltip\"></div>\r\n </ng-template> -->\r\n }\r\n </label>\r\n }\r\n\r\n @if (addonLeft || addonRight) {\r\n <div class=\"field-group\">\r\n @if(addonLeft) {\r\n <ng-container [ngTemplateOutlet]=\"addonLeft\"></ng-container>\r\n }\r\n <ng-container [ngTemplateOutlet]=\"field\"></ng-container>\r\n @if(addonRight) {\r\n <ng-container [ngTemplateOutlet]=\"addonRight\"></ng-container>\r\n }\r\n </div>\r\n }\r\n @else {\r\n @if ( isInInputGroup() ) {\r\n <div class=\"field-group\">\r\n <ng-container [ngTemplateOutlet]=\"field\"></ng-container>\r\n </div>\r\n }\r\n @else {\r\n <ng-container [ngTemplateOutlet]=\"field\"></ng-container>\r\n }\r\n }\r\n\r\n <!-- Error message -->\r\n @if (controlOrGroup?.invalid && controlOrGroup?.touched) {\r\n <div class=\"field-invalid\" [id]=\"'error-' + name\">\r\n @if ((controlOrGroup?.errors?.['required']) || (getControl('start')?.errors?.['required'] || getControl('end')?.errors?.['required'])) {\r\n <span [innerHtml]=\"'_COMMON._FORM.ERROR_IS_MANDATORY' | translate: {label: label | translate}\"></span>\r\n }\r\n @if(controlOrGroup?.errors?.['rangeInvalid']) {\r\n <span>{{'_COMMON._DATES.ERROR_START_END_PERIOD' | translate}}</span>\r\n }\r\n @if (controlOrGroup?.errors?.['fileExtension']) {\r\n <span>{{ '_COMMON._FORM.ERROR_FILE_EXTENSION' | translate: { accept: acceptLabel } }}</span>\r\n }\r\n @if (controlOrGroup?.errors?.['fileSize']) {\r\n <span>{{ '_COMMON._FORM.ERROR_FILE_SIZE' | translate: { maxSize: maxSizeLabel } }}</span>\r\n }\r\n </div>\r\n }\r\n\r\n @if (help || autoHelpEntries.length) {\r\n <div [id]=\"name + '-help'\" class=\"field-text\">\r\n @if (help) {\r\n <div>{{ help | translate }}</div>\r\n }\r\n @for (entry of autoHelpEntries; track entry.key) {\r\n <div>{{ entry.key | translate: entry.params }}</div>\r\n }\r\n </div>\r\n }\r\n}\r\n@else {\r\n <ng-container [ngTemplateOutlet]=\"field\"></ng-container>\r\n}\r\n\r\n<ng-template #field>\r\n <!-- Text -->\r\n @if ([typeField.text, typeField.date, typeField.time, typeField.dateTime, typeField.number,\r\n typeField.email,\r\n typeField.color].includes(type)) {\r\n <input [type]=\"type\" class=\"field-control\" [id]=\"name\" [formControl]=\"formControl\"\r\n [ngClass]=\"[(cssClass || ''), formControl?.value ? 'has-value' : '']\"\r\n [attr.placeholder]=\"placeholder ? (placeholder | translate) : null\" [attr.required]=\"isRequired ? 'required' : null\"\r\n [attr.readonly]=\"isReadonly ? 'readonly' : null\" [disabled]=\"isEffectivelyDisabled\" [attr.aria-required]=\"isRequired\"\r\n [attr.minlength]=\"minLengthAttr\" [attr.maxlength]=\"maxLengthAttr\"\r\n [attr.min]=\"minAttr\" [attr.max]=\"maxAttr\" [attr.step]=\"stepAttr\" [attr.pattern]=\"patternAttr\"\r\n [attr.aria-invalid]=\"control.invalid && control.touched\"\r\n [attr.aria-describedby]=\"getDescribedBy(control)\" />\r\n }\r\n\r\n <!-- File -->\r\n @if (type === typeField.file) {\r\n <input #fileInput type=\"file\" class=\"field-control\" [id]=\"name\"\r\n [ngClass]=\"[(cssClass || ''), formControl?.value ? 'has-value' : '']\"\r\n [attr.placeholder]=\"placeholder ? (placeholder | translate) : null\" [attr.required]=\"isRequired ? 'required' : null\"\r\n [attr.readonly]=\"isReadonly ? 'readonly' : null\" [disabled]=\"isEffectivelyDisabled\" [attr.aria-required]=\"isRequired\"\r\n [attr.accept]=\"acceptAttr\"\r\n [attr.aria-invalid]=\"control.invalid && control.touched\"\r\n [attr.aria-describedby]=\"getDescribedBy(control)\"\r\n (change)=\"onFileChange($event)\" (blur)=\"onBlur()\" />\r\n }\r\n\r\n @if (type === typeField.password) {\r\n <input showHidePassword [type]=\"type\" class=\"field-control\" [id]=\"name\" [formControl]=\"formControl\"\r\n [ngClass]=\"[(cssClass || ''), formControl?.value ? 'has-value' : '']\"\r\n [attr.required]=\"isRequired ? 'required' : null\" [attr.readonly]=\"isReadonly ? 'readonly' : null\"\r\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\" [attr.aria-required]=\"isRequired\"\r\n [attr.minlength]=\"minLengthAttr\" [attr.maxlength]=\"maxLengthAttr\" [attr.pattern]=\"patternAttr\"\r\n [attr.aria-invalid]=\"control.invalid && control.touched\"\r\n [attr.aria-describedby]=\"getDescribedBy(control)\" />\r\n }\r\n\r\n <!-- Textarea -->\r\n @if (type === typeField.textarea) {\r\n <textarea class=\"field-control\" [id]=\"name\" [formControl]=\"formControl\"\r\n [ngClass]=\"[(cssClass || ''), formControl?.value ? 'has-value' : '']\"\r\n [attr.placeholder]=\"placeholder ? (placeholder | translate) : null\" [attr.required]=\"isRequired ? 'required' : null\"\r\n [attr.readonly]=\"isReadonly ? 'readonly' : null\" [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\"\r\n [attr.aria-required]=\"isRequired\" [attr.aria-invalid]=\"control.invalid && control.touched\"\r\n [attr.minlength]=\"minLengthAttr\" [attr.maxlength]=\"maxLengthAttr\" [attr.pattern]=\"patternAttr\"\r\n [attr.aria-describedby]=\"getDescribedBy(control)\"></textarea>\r\n }\r\n\r\n <!-- Select -->\r\n @if (type === typeField.select) {\r\n <ng-select [formControl]=\"formControl\" [items]=\"options\" bindLabel=\"label\" [labelForId]=\"name\" [appendTo]=\"appendTo\" bindValue=\"value\"\r\n [ngClass]=\"cssClass\" [searchable]=\"false\" [placeholder]=\"placeholder ? (placeholder | translate) : null\" [readonly]=\"isReadonly\" [clearable]=\"false\"\r\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\" [attr.required]=\"isRequired ? 'required' : null\"\r\n [attr.aria-required]=\"isRequired\" [attr.aria-invalid]=\"control.invalid && control.touched\"\r\n [attr.aria-describedby]=\"getDescribedBy(control)\" [attr.id]=\"name\"\r\n (blur)=\"onBlur()\">\r\n\r\n <!-- Template pour les options -->\r\n <ng-template ng-option-tmp let-item=\"item\" let-index=\"index\" let-search=\"searchTerm\">\r\n @if (optionTemplate) {\r\n <ng-container *ngTemplateOutlet=\"optionTemplate; context: { item: item | translate, index: index, searchTerm: search }\"></ng-container>\r\n }\r\n @else {\r\n <div>{{ item.label | translate }}</div>\r\n }\r\n </ng-template>\r\n\r\n <!-- Template pour le label -->\r\n <ng-template ng-label-tmp let-item=\"item\">\r\n @if (labelTemplate) {\r\n <ng-container *ngTemplateOutlet=\"labelTemplate; context: { item: item | translate }\"></ng-container>\r\n }\r\n @else {\r\n {{ (item.label | translate) || (placeholder | translate) }}\r\n }\r\n </ng-template>\r\n </ng-select>\r\n }\r\n\r\n <!-- NgSelect -->\r\n @if (type === typeField.ngSelect || type === typeField.ngSelectMultiple) {\r\n <ng-select [formControl]=\"formControl\" [items]=\"options\" bindLabel=\"label\" [labelForId]=\"name\" [appendTo]=\"appendTo\" bindValue=\"value\"\r\n [multiple]=\"type === typeField.ngSelectMultiple\" [ngClass]=\"cssClass\" [clearable]=\"false\"\r\n [placeholder]=\"placeholder ? (placeholder | translate) : null\" [readonly]=\"isReadonly\"\r\n [notFoundText]=\"'_COMMON.NO_RESULT' | translate\" [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\"\r\n [attr.required]=\"isRequired ? 'required' : null\" [attr.aria-required]=\"isRequired\"\r\n [attr.aria-invalid]=\"control.invalid && control.touched\"\r\n [attr.aria-describedby]=\"getDescribedBy(control)\" [attr.id]=\"name\"\r\n (blur)=\"onBlur()\" (search)=\"textChanged.emit($event?.term)\">\r\n\r\n <!-- Template pour les options -->\r\n <ng-template ng-option-tmp let-item=\"item\" let-index=\"index\" let-search=\"searchTerm\">\r\n @if (optionTemplate) {\r\n <ng-container *ngTemplateOutlet=\"optionTemplate; context: { item: item, index: index, searchTerm: search }\"></ng-container>\r\n }\r\n @else {\r\n <div>{{ item.label | translate }}</div>\r\n }\r\n </ng-template>\r\n\r\n <!-- Template pour le label -->\r\n <ng-template ng-label-tmp let-item=\"item\" let-clear=\"clear\">\r\n <span class=\"ng-value-icon left\" (click)=\"clear(item)\" aria-hidden=\"true\">\u00D7</span>\r\n @if (labelTemplate) {\r\n <ng-container *ngTemplateOutlet=\"labelTemplate; context: { item: item | translate }\"></ng-container>\r\n }\r\n @else {\r\n {{ (item.label | translate) || (placeholder | translate) }}\r\n }\r\n </ng-template>\r\n </ng-select>\r\n }\r\n\r\n <!-- Radio -->\r\n @if (type === typeField.radioInline || type === typeField.radio) {\r\n <fieldset\r\n [attr.aria-required]=\"isRequired\"\r\n [attr.aria-invalid]=\"control.invalid && control.touched\"\r\n [attr.aria-describedby]=\"getDescribedBy(control)\">\r\n <legend class=\"field-label\" [class.visually-hidden]=\"!displayLabel\">\r\n {{label | translate}}\r\n @if(isRequired) {\r\n <span class=\"text-danger\">*</span>\r\n }\r\n </legend>\r\n <ul class=\"list-unstyled mb-none\" [ngClass]=\"type === typeField.radioInline ? 'd-flex-h gap-md flex-wrap' : 'd-flex-v'\">\r\n @for (opt of options; track opt.value) {\r\n <li class=\"field-check\">\r\n <input type=\"radio\" [id]=\"name + '_' + opt.value\" [value]=\"opt.value\" [formControl]=\"formControl\"\r\n class=\"field-check-input\" [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\" (change)=\"onRadioChange(opt.value)\" />\r\n <label [for]=\"name + '_' + opt.value\" class=\"field-check-label\">{{ opt.label | translate }}</label>\r\n </li>\r\n }\r\n </ul>\r\n </fieldset>\r\n }\r\n\r\n <!-- Radio button -->\r\n @if (type === typeField.radioButton) {\r\n <fieldset\r\n [attr.aria-required]=\"isRequired\"\r\n [attr.aria-invalid]=\"control.invalid && control.touched\"\r\n [attr.aria-describedby]=\"getDescribedBy(control)\">\r\n <legend class=\"field-label\" [class.visually-hidden]=\"!displayLabel\">\r\n {{label | translate}}\r\n @if(isRequired) {\r\n <span class=\"text-danger\">*</span>\r\n }\r\n </legend>\r\n <div class=\"field-group field-group-btn\">\r\n @for (opt of options; track opt.value) {\r\n <input type=\"radio\" [id]=\"name + '_' + opt.value\" [value]=\"opt.value\" [formControl]=\"formControl\"\r\n class=\"visually-hidden\" [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\" (change)=\"onRadioChange(opt.value)\"/>\r\n <label [for]=\"name + '_' + opt.value\" class=\"btn btn-field-group\">{{ opt.label | translate }}</label>\r\n }\r\n </div>\r\n </fieldset>\r\n }\r\n\r\n <!-- Checkbox Switch -->\r\n @if ( type === typeField.switch || type === typeField.switchSmall)\r\n {\r\n <div class=\"field-check field-switch\" [ngClass]=\"{'field-switch-small': type === typeField.switchSmall}\">\r\n <input type=\"checkbox\" [id]=\"name\" [formControl]=\"formControl\" class=\"field-check-input\" [attr.aria-required]=\"isRequired\"\r\n [attr.aria-invalid]=\"control.invalid && control.touched\"\r\n [attr.aria-describedby]=\"getDescribedBy(control)\"\r\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\"/>\r\n <label [for]=\"name\" class=\"field-check-label\">{{ label | translate }}</label>\r\n </div>\r\n }\r\n\r\n <!-- Checkbox -->\r\n @if (type === typeField.checkboxInline || type === typeField.checkbox) {\r\n @if (isSingleCheckbox()) {\r\n <div class=\"field-check\" [class.field-check-inline]=\"type === typeField.checkboxInline\">\r\n <input #checkboxInput type=\"checkbox\" [id]=\"name\" [formControl]=\"formControl\"\r\n class=\"field-check-input\"\r\n [class.is-invalid]=\"control?.invalid && control?.touched\"\r\n [attr.aria-required]=\"isRequired\"\r\n [attr.aria-invalid]=\"control?.invalid && control?.touched\"\r\n [attr.aria-describedby]=\"getDescribedBy(control)\"\r\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\" />\r\n <label [for]=\"name\" class=\"field-check-label\">\r\n {{ label | translate }}\r\n @if (isRequired) {\r\n <span class=\"text-danger\">*</span>\r\n }\r\n </label>\r\n </div>\r\n }\r\n @else if( options.length > 1) {\r\n <fieldset\r\n [attr.aria-required]=\"isRequired\"\r\n [attr.aria-invalid]=\"control.invalid && control.touched\"\r\n [attr.aria-describedby]=\"getDescribedBy(control)\"\r\n [ngClass]=\"{ 'flex-column': type === typeField.checkbox }\">\r\n <legend class=\"field-label\" [class.visually-hidden]=\"!displayLabel\">\r\n {{label | translate}}\r\n @if(isRequired) {\r\n <span class=\"text-danger\">*</span>\r\n }\r\n </legend>\r\n <ul class=\"list-unstyled mb-none\" [ngClass]=\"type === typeField.checkboxInline ? 'd-flex-h gap-md' : 'd-flex-v'\">\r\n @for (opt of options; track opt.value) {\r\n <li class=\"field-check\" [ngClass]=\"{ 'field-check-inline': type === typeField.checkboxInline }\">\r\n <input type=\"checkbox\" [id]=\"name + '_' + opt.value\" [value]=\"opt.value\" (change)=\"onCheckboxChange($event)\"\r\n [checked]=\"control.value?.includes(opt.value)\" class=\"field-check-input\"\r\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\" />\r\n <label [for]=\"name + '_' + opt.value\" class=\"field-check-label\">\r\n {{ opt.label | translate }}\r\n </label>\r\n </li>\r\n }\r\n </ul>\r\n </fieldset>\r\n }\r\n @else {\r\n <fieldset>\r\n <legend class=\"field-label\" [class.visually-hidden]=\"!displayLabel\">\r\n {{label | translate}}\r\n </legend>\r\n <ul class=\"list-unstyled mb-none\" [ngClass]=\"type === typeField.checkboxInline ? 'd-flex-h gap-md' : 'd-flex-v'\">\r\n @for (opt of options; track opt.value) {\r\n <li class=\"field-check\" [ngClass]=\"{ 'field-check-inline': type === typeField.checkboxInline }\">\r\n <input type=\"checkbox\" [id]=\"name + '_' + opt.value\" [value]=\"opt.value\" (change)=\"onCheckboxChange($event)\"\r\n [checked]=\"control.value?.includes(opt.value)\" class=\"field-check-input\"\r\n [attr.aria-required]=\"isRequired\"\r\n [attr.aria-invalid]=\"control.invalid && control.touched\"\r\n [attr.aria-describedby]=\"getDescribedBy(control)\"\r\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\" />\r\n <label [for]=\"name + '_' + opt.value\" class=\"field-check-label\">\r\n {{ opt.label | translate }}\r\n @if(isRequired) {\r\n <span class=\"text-danger\">*</span>\r\n }\r\n </label>\r\n </li>\r\n }\r\n </ul>\r\n </fieldset>\r\n }\r\n }\r\n\r\n <!-- Checkbox button -->\r\n @if (type === typeField.checkboxButton && options.length > 0) {\r\n\r\n @if(options.length > 1) {\r\n <fieldset\r\n [attr.aria-required]=\"isRequired\"\r\n [attr.aria-invalid]=\"control.invalid && control.touched\"\r\n [attr.aria-describedby]=\"getDescribedBy(control)\">\r\n <legend class=\"field-label\" [class.visually-hidden]=\"!displayLabel\">\r\n {{label | translate}}\r\n @if(isRequired) {\r\n <span class=\"text-danger\">*</span>\r\n }\r\n </legend>\r\n <div class=\"field-group field-group-btn\">\r\n @for (opt of options; track opt.value) {\r\n <input type=\"checkbox\" [id]=\"name + '_' + opt.value\" [value]=\"opt.value\" (change)=\"onCheckboxChange($event)\"\r\n [checked]=\"control.value?.includes(opt.value)\" class=\"visually-hidden\"\r\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\" />\r\n <label [for]=\"name + '_' + opt.value\" class=\"btn btn-field-group\">{{ opt.label | translate }}</label>\r\n }\r\n </div>\r\n </fieldset>\r\n }\r\n @else {\r\n <fieldset>\r\n <legend class=\"field-label\" [class.visually-hidden]=\"!displayLabel\">\r\n {{label | translate}}\r\n </legend>\r\n <div class=\"btn-group btn-group-secondary\">\r\n @for (opt of options; track opt.value) {\r\n <input type=\"checkbox\" [id]=\"name + '_' + opt.value\" [value]=\"opt.value\" (change)=\"onCheckboxChange($event)\"\r\n [checked]=\"control.value?.includes(opt.value)\" class=\"visually-hidden\"\r\n [attr.aria-required]=\"isRequired\"\r\n [attr.aria-invalid]=\"control.invalid && control.touched\"\r\n [attr.aria-describedby]=\"getDescribedBy(control)\"\r\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\"/>\r\n <label [for]=\"name + '_' + opt.value\" class=\"btn btn-field-group\">\r\n {{ opt.label | translate}}\r\n @if(isRequired) {\r\n <span class=\"text-danger\">*</span>\r\n }\r\n </label>\r\n }\r\n </div>\r\n </fieldset>\r\n }\r\n }\r\n\r\n <!-- Period - DateToDate / TimeToTime / DateTimeToDateTime -->\r\n @if ([typeField.dateToDate, typeField.timeToTime, typeField.dateTimeToDateTime].includes(type) && isRange) {\r\n\r\n <div class=\"field-group\">\r\n <input [type]=\"getInputType()\" class=\"field-control\" [id]=\"name + '_start'\" [formControl]=\"getControl('start')\"\r\n [attr.placeholder]=\"type === typeField.timeToTime ? ('_COMMON._DATES.FROM' | translate) : ('_COMMON._DATES.FROM_TO_1' | translate)\"\r\n [ngClass]=\"[(cssClass || ''), getControl('start')?.value ? 'has-value' : '']\"\r\n [attr.required]=\"isRequired ? 'required' : null\" [attr.readonly]=\"isReadonly ? 'readonly' : null\"\r\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\" [attr.aria-required]=\"isRequired\"\r\n [attr.min]=\"minStartAttr\" [attr.max]=\"maxStartAttr\" [attr.step]=\"stepAttr\"\r\n [attr.aria-invalid]=\"getControl('start')?.invalid && getControl('start')?.touched\"\r\n [attr.aria-describedby]=\"getDescribedBy(getControl('start'))\" />\r\n\r\n @if(getControl('start')?.value && !isEffectivelyDisabled) {\r\n <button type=\"button\" class=\"btn btn-secondary btn-clear-field\"\r\n (click)=\"onClearFieldPeriod('start')\">\r\n &times;\r\n </button>\r\n }\r\n\r\n <input [type]=\"getInputType()\" class=\"field-control\" [id]=\"name + '_end'\" [formControl]=\"getControl('end')\"\r\n [attr.placeholder]=\"type === typeField.timeToTime ? ('_COMMON._DATES.TO' | translate) : ('_COMMON._DATES.FROM_TO_2' | translate)\"\r\n [ngClass]=\"[(cssClass || ''), getControl('end')?.value ? 'has-value' : '']\"\r\n [attr.required]=\"isRequired ? 'required' : null\" [attr.readonly]=\"isReadonly ? 'readonly' : null\"\r\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\"\r\n [attr.min]=\"minEndAttr\" [attr.max]=\"maxEndAttr\" [attr.step]=\"stepAttr\"\r\n [attr.aria-invalid]=\"getControl('end')?.invalid && getControl('end')?.touched\"\r\n [attr.aria-describedby]=\"getDescribedBy(getControl('end'))\" />\r\n\r\n @if(getControl('end')?.value && !isEffectivelyDisabled) {\r\n <button type=\"button\" class=\"btn btn-secondary btn-clear-field\"\r\n (click)=\"onClearFieldPeriod('end')\">\r\n &times;\r\n </button>\r\n }\r\n </div>\r\n }\r\n\r\n @if ([typeField.datePlusOne, typeField.datePlusTwo, typeField.datePlusSeven, typeField.dateComplexe].includes(type)) {\r\n\r\n @if (type === typeField.dateComplexe) {\r\n <button class=\"btn btn-secondary\" type=\"button\" (click)=\"onDateAddDay('prev')\"\r\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\">\r\n <cw-icon font=\"optyweb\" [icon]=\"spriteIcon.nextLeft\" [label]=\"'Jour pr\u00E9c\u00E9dent'\"></cw-icon>\r\n </button>\r\n }\r\n\r\n <input type=\"date\" class=\"field-control\" [id]=\"name\" [formControl]=\"formControl\"\r\n [ngClass]=\"[(cssClass || ''), formControl?.value ? 'has-value' : '']\"\r\n [attr.placeholder]=\"placeholder ? placeholder : null\" [attr.required]=\"isRequired ? 'required' : null\"\r\n [attr.readonly]=\"isReadonly ? 'readonly' : null\" [disabled]=\"isEffectivelyDisabled\" [attr.aria-required]=\"isRequired\"\r\n [attr.min]=\"minAttr\" [attr.max]=\"maxAttr\" [attr.step]=\"stepAttr\"\r\n [attr.aria-invalid]=\"control.invalid && control.touched\"\r\n [attr.aria-describedby]=\"getDescribedBy(control)\" />\r\n\r\n @if(formControl?.value && !isEffectivelyDisabled) {\r\n <button class=\"btn btn-secondary btn-clear-field\" type=\"button\"\r\n (click)=\"onClearField(formControl)\">&times;</button>\r\n }\r\n\r\n @if (type === typeField.dateComplexe) {\r\n <button class=\"btn btn-secondary\" type=\"button\" (click)=\"onDateAddDay('next')\"\r\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\">\r\n <cw-icon font=\"optyweb\" [icon]=\"spriteIcon.nextRight\" [label]=\"'Jour suivant'\"></cw-icon>\r\n </button>\r\n <button class=\"btn btn-secondary\" type=\"button\" (click)=\"onRefresh()\"\r\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\">\r\n <cw-icon font=\"optyweb\" [icon]=\"spriteIcon.toolbarRefresh\" [label]=\"'Rafra\u00EEchir'\"></cw-icon>\r\n </button>\r\n }\r\n\r\n <button class=\"btn btn-secondary\" type=\"button\" (click)=\"onTodayAddDay(0)\"\r\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\">\r\n J\r\n <span class=\"visually-hidden\">Aujourd'hui</span>\r\n </button>\r\n <button class=\"btn btn-secondary\" type=\"button\" (click)=\"onTodayAddDay(1)\"\r\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\">\r\n J+1\r\n <span class=\"visually-hidden\">Demain</span>\r\n </button>\r\n\r\n @if (type !== typeField.datePlusOne && type !== typeField.dateComplexe) {\r\n <button class=\"btn btn-secondary \" type=\"button\" (click)=\"onTodayAddDay(2)\"\r\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\">\r\n J+2\r\n <span class=\"visually-hidden\">Dans 2 jours</span>\r\n </button>\r\n\r\n @if (type !== typeField.datePlusTwo) {\r\n <button class=\"btn btn-secondary\" type=\"button\" (click)=\"onTodayAddDay(7)\"\r\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\">\r\n J+7\r\n <span class=\"visually-hidden\">Dans 7 jours</span>\r\n </button>\r\n }\r\n }\r\n }\r\n\r\n @if (type === typeField.slider) {\r\n <ngx-slider [(value)]=\"sliderValue\" [options]=\"sliderOptions\" [formControl]=\"formControl\"></ngx-slider>\r\n }\r\n\r\n @if (type === typeField.range) {\r\n <div class=\"slider\">\r\n\r\n <cw-button [isDisabled]=\"formControl.value <= rangeOptions.floor\" [label]=\"'Diminuer ' + formControl.value + ' ' + label\"\r\n [withIcon]=\"spriteIcon.toolbarMinus\" [withOnlyIcon]=\"true\" [type]=\"buttonType.primary\"\r\n [iconSize]=\"buttonIconSize.small\" (btnAction)=\"onRangeStep('decrease')\">\r\n </cw-button>\r\n\r\n <div class=\"slider-input\">\r\n <label [for]=\"name\" class=\"slider-tooltip\" [style.left]=\"getRangePercent() + '%'\" aria-live=\"polite\"\r\n aria-atomic=\"true\">\r\n {{ label | translate }} {{ formControl.value }}\r\n @if (rangeOptions.unit) {\r\n <abbr [title]=\"rangeOptions.unit\">{{ rangeOptions.unit }}</abbr>\r\n }\r\n </label>\r\n\r\n <div class=\"slider-custom-bar\">\r\n <div class=\"slider-custom-bar-selection\" [style.width]=\"getRangePercent() + '%'\">\r\n </div>\r\n </div>\r\n\r\n <input type=\"range\" [id]=\"name\" [formControl]=\"formControl\" [min]=\"rangeOptions.floor\" [max]=\"rangeOptions.ceil\"\r\n [step]=\"rangeOptions.step || 1\" class=\"field-control-range\" [attr.aria-required]=\"isRequired\"\r\n [attr.aria-invalid]=\"control.invalid && control.touched\" [disabled]=\"isEffectivelyDisabled\">\r\n </div>\r\n\r\n <cw-button [isDisabled]=\"formControl.value >= rangeOptions.ceil\" [label]=\"'Augmenter ' + formControl.value + ' ' + label\"\r\n [withIcon]=\"spriteIcon.toolbarPlus\" [withOnlyIcon]=\"true\" [type]=\"buttonType.primary\"\r\n [iconSize]=\"buttonIconSize.small\" (btnAction)=\"onRangeStep('increase')\">\r\n </cw-button>\r\n </div>\r\n }\r\n\r\n @if (isInInputGroup() && clearable && !isEffectivelyDisabled) {\r\n @if(formControl?.value) {\r\n <button class=\"btn btn-secondary btn-clear-field\" type=\"button\"\r\n (click)=\"onClearField(formControl)\">&times;</button>\r\n }\r\n }\r\n\r\n</ng-template>\r\n" }]
3229
+ ButtonComponent,
3230
+ AutocompleteComponent
3231
+ ], template: "@if (!isInAddon) {\r\n @if (\r\n type !== typeField.checkbox &&\r\n type !== typeField.radio &&\r\n type !== typeField.checkboxButton &&\r\n type !== typeField.radioButton &&\r\n type !== typeField.checkboxInline &&\r\n type !== typeField.radioInline &&\r\n type !== typeField.switch &&\r\n type !== typeField.range &&\r\n type !== typeField.switchSmall\r\n ) {\r\n <label [for]=\"name\" class=\"field-label\" [class.visually-hidden]=\"!displayLabel\">\r\n {{ label | translate }}\r\n\r\n @if (isRequired) {\r\n <span class=\"text-danger\">*</span>\r\n }\r\n\r\n @if (tooltip) {\r\n <!-- <button type=\"button\" class=\"btn btn-link btn-popover\" placement=\"bottom\" [ngbPopover]=\"popContent\" container=\"body\"\r\n triggers=\"mouseenter:mouseleave\">\r\n <span class=\"btn-popover-icon bo-icons bo-help\"></span>\r\n </button>\r\n <ng-template #popContent>\r\n <div [innerHTML]=\"tooltip\"></div>\r\n </ng-template> -->\r\n }\r\n </label>\r\n }\r\n\r\n @if (addonLeft || addonRight) {\r\n <div class=\"field-group\">\r\n @if(addonLeft) {\r\n <ng-container [ngTemplateOutlet]=\"addonLeft\"></ng-container>\r\n }\r\n <ng-container [ngTemplateOutlet]=\"field\"></ng-container>\r\n @if(addonRight) {\r\n <ng-container [ngTemplateOutlet]=\"addonRight\"></ng-container>\r\n }\r\n </div>\r\n }\r\n @else {\r\n @if ( isInInputGroup() ) {\r\n <div class=\"field-group\">\r\n <ng-container [ngTemplateOutlet]=\"field\"></ng-container>\r\n </div>\r\n }\r\n @else {\r\n <ng-container [ngTemplateOutlet]=\"field\"></ng-container>\r\n }\r\n }\r\n\r\n <!-- Error message -->\r\n @if (controlOrGroup?.invalid && controlOrGroup?.touched) {\r\n <div class=\"field-invalid\" [id]=\"'error-' + name\">\r\n @if (\r\n !errorMessages?.['required'] &&\r\n ((controlOrGroup?.errors?.['required']) || (getControl('start')?.errors?.['required'] || getControl('end')?.errors?.['required']))\r\n ) {\r\n <span [innerHtml]=\"'_COMMON._FORM.ERROR_IS_MANDATORY' | translate: {label: label | translate}\"></span>\r\n }\r\n @if (!errorMessages?.['rangeInvalid'] && controlOrGroup?.errors?.['rangeInvalid']) {\r\n <span>{{'_COMMON._DATES.ERROR_START_END_PERIOD' | translate}}</span>\r\n }\r\n @if (!errorMessages?.['fileExtension'] && controlOrGroup?.errors?.['fileExtension']) {\r\n <span>{{ '_COMMON._FORM.ERROR_FILE_EXTENSION' | translate: { accept: acceptLabel } }}</span>\r\n }\r\n @if (!errorMessages?.['fileSize'] && controlOrGroup?.errors?.['fileSize']) {\r\n <span>{{ '_COMMON._FORM.ERROR_FILE_SIZE' | translate: { maxSize: maxSizeLabel } }}</span>\r\n }\r\n @if (!errorMessages?.['email'] && controlOrGroup?.errors?.['email']) {\r\n <span>{{ '_COMMON._FORM.ERROR_INVALID_EMAIL' | translate }}</span>\r\n }\r\n @if (!errorMessages?.['phone'] && controlOrGroup?.errors?.['phone']) {\r\n <span>{{ '_COMMON._FORM.ERROR_INVALID_PHONE' | translate }}</span>\r\n }\r\n @if (errorMessages) {\r\n @for (entry of errorMessages | keyvalue: keepOrder; track entry.key) {\r\n @if (controlOrGroup?.errors?.[entry.key]; as errVal) {\r\n <span>{{ entry.value | translate: (errVal === true ? null : errVal) }}</span>\r\n }\r\n }\r\n }\r\n </div>\r\n }\r\n\r\n @if (help || autoHelpEntries.length) {\r\n <div [id]=\"name + '-help'\" class=\"field-text\">\r\n @if (help) {\r\n <span>{{ help | translate }}</span>\r\n }\r\n @for (entry of autoHelpEntries; track entry.key) {\r\n <span> - {{ entry.key | translate: entry.params }}</span>\r\n }\r\n </div>\r\n }\r\n}\r\n@else {\r\n <ng-container [ngTemplateOutlet]=\"field\"></ng-container>\r\n}\r\n\r\n<ng-template #field>\r\n <!-- Autocomplete (mono / multi) -->\r\n @if ((type === typeField.autocomplete || type === typeField.autocompleteMultiple) && autocompleteOptions) {\r\n <cw-autocomplete\r\n [id]=\"name\"\r\n [control]=\"formControl\"\r\n [fetcher]=\"autocompleteOptions.fetcher\"\r\n [displayField]=\"autocompleteOptions.displayField ?? 'label'\"\r\n [valueField]=\"autocompleteOptions.valueField ?? 'id'\"\r\n [columns]=\"autocompleteOptions.columns ?? []\"\r\n [resolver]=\"autocompleteOptions.resolver ?? null\"\r\n [selectedItem]=\"autocompleteOptions.selectedItem ?? null\"\r\n [selectedItems]=\"autocompleteOptions.selectedItems ?? []\"\r\n [minChars]=\"autocompleteOptions.minChars ?? 2\"\r\n [debounceMs]=\"autocompleteOptions.debounceMs ?? 250\"\r\n [multiple]=\"type === typeField.autocompleteMultiple\"\r\n [isRequired]=\"isRequired\"\r\n [isReadonly]=\"!!isReadonly\"\r\n [isDisabled]=\"isEffectivelyDisabled\"\r\n [ariaInvalid]=\"control.invalid && control.touched\"\r\n [ariaDescribedBy]=\"getDescribedBy(control)\"\r\n [placeholder]=\"placeholder\">\r\n </cw-autocomplete>\r\n }\r\n\r\n <!-- Text -->\r\n @if ([typeField.text, typeField.date, typeField.time, typeField.dateTime, typeField.number,\r\n typeField.email,\r\n typeField.color, typeField.zipCode].includes(type)) {\r\n <input [type]=\"type === typeField.zipCode ? 'text' : type\" class=\"field-control\" [id]=\"name\" [formControl]=\"formControl\"\r\n [ngClass]=\"[(cssClass || ''), formControl?.value ? 'has-value' : '', type === typeField.zipCode ? 'field-control-zipcode' : '']\"\r\n [attr.placeholder]=\"placeholder ? (placeholder | translate) : null\" [attr.required]=\"isRequired ? 'required' : null\"\r\n [attr.readonly]=\"isReadonly ? 'readonly' : null\" [attr.aria-required]=\"isRequired\"\r\n [attr.minlength]=\"minLengthAttr\" [attr.maxlength]=\"maxLengthAttr\"\r\n [attr.min]=\"minAttr\" [attr.max]=\"maxAttr\" [attr.step]=\"stepAttr\" [attr.pattern]=\"patternAttr\"\r\n [attr.autocomplete]=\"autocomplete\"\r\n [attr.aria-invalid]=\"control.invalid && control.touched\"\r\n [attr.aria-describedby]=\"getDescribedBy(control)\"\r\n (focus)=\"onFocus()\" (blur)=\"onBlur()\" />\r\n }\r\n\r\n <!-- Phone (intl-tel-input) -->\r\n @if (type === typeField.phone) {\r\n <input #phoneInput type=\"tel\" class=\"field-control\" [id]=\"name\"\r\n [attr.placeholder]=\"placeholder ? (placeholder | translate) : null\" [attr.required]=\"isRequired ? 'required' : null\"\r\n [attr.readonly]=\"isReadonly ? 'readonly' : null\" [disabled]=\"isEffectivelyDisabled\" [attr.aria-required]=\"isRequired\"\r\n [attr.autocomplete]=\"autocomplete\"\r\n [attr.aria-invalid]=\"control.invalid && control.touched\"\r\n [attr.aria-describedby]=\"getDescribedBy(control)\"\r\n (focus)=\"onFocus()\" (blur)=\"onPhoneBlur($event)\" />\r\n }\r\n\r\n <!-- File -->\r\n @if (type === typeField.file) {\r\n <input #fileInput type=\"file\" class=\"field-control\" [id]=\"name\"\r\n [ngClass]=\"[(cssClass || ''), formControl?.value ? 'has-value' : '']\"\r\n [attr.placeholder]=\"placeholder ? (placeholder | translate) : null\" [attr.required]=\"isRequired ? 'required' : null\"\r\n [attr.readonly]=\"isReadonly ? 'readonly' : null\" [disabled]=\"isEffectivelyDisabled\" [attr.aria-required]=\"isRequired\"\r\n [attr.accept]=\"acceptAttr\"\r\n [attr.aria-invalid]=\"control.invalid && control.touched\"\r\n [attr.aria-describedby]=\"getDescribedBy(control)\"\r\n (change)=\"onFileChange($event)\" (focus)=\"onFocus()\" (blur)=\"onBlur()\" />\r\n }\r\n\r\n @if (type === typeField.password) {\r\n <input [type]=\"isPasswordShown ? 'text' : 'password'\" class=\"field-control\" [id]=\"name\" [formControl]=\"formControl\"\r\n [ngClass]=\"[(cssClass || ''), formControl?.value ? 'has-value' : '']\"\r\n [attr.required]=\"isRequired ? 'required' : null\" [attr.readonly]=\"isReadonly ? 'readonly' : null\"\r\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\" [attr.aria-required]=\"isRequired\"\r\n [attr.minlength]=\"minLengthAttr\" [attr.maxlength]=\"maxLengthAttr\" [attr.pattern]=\"patternAttr\"\r\n [attr.autocomplete]=\"autocomplete\"\r\n [attr.aria-invalid]=\"control.invalid && control.touched\"\r\n [attr.aria-describedby]=\"getDescribedBy(control)\"\r\n (focus)=\"onFocus()\" (blur)=\"onBlur()\" />\r\n <cw-button [type]=\"buttonType.secondary\"\r\n [withIcon]=\"isPasswordShown ? spriteIcon.toolbarHidePassword : spriteIcon.toolbarShowPassword\"\r\n [withOnlyIcon]=\"true\"\r\n [label]=\"isPasswordShown ? '_COMMON._FORM._SHOW_HIDE_PWD.HIDE' : '_COMMON._FORM._SHOW_HIDE_PWD.SHOW'\"\r\n (btnAction)=\"togglePasswordVisibility()\">\r\n </cw-button>\r\n }\r\n\r\n <!-- Textarea -->\r\n @if (type === typeField.textarea) {\r\n <textarea class=\"field-control\" [id]=\"name\" [formControl]=\"formControl\"\r\n [ngClass]=\"[(cssClass || ''), formControl?.value ? 'has-value' : '']\"\r\n [attr.placeholder]=\"placeholder ? (placeholder | translate) : null\" [attr.required]=\"isRequired ? 'required' : null\"\r\n [attr.readonly]=\"isReadonly ? 'readonly' : null\" [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\"\r\n [attr.aria-required]=\"isRequired\" [attr.aria-invalid]=\"control.invalid && control.touched\"\r\n [attr.minlength]=\"minLengthAttr\" [attr.maxlength]=\"maxLengthAttr\" [attr.pattern]=\"patternAttr\"\r\n [attr.autocomplete]=\"autocomplete\"\r\n [attr.aria-describedby]=\"getDescribedBy(control)\"\r\n (focus)=\"onFocus()\" (blur)=\"onBlur()\"></textarea>\r\n }\r\n\r\n <!-- Select -->\r\n @if (type === typeField.select) {\r\n <ng-select [formControl]=\"formControl\" [items]=\"options\" bindLabel=\"label\" [labelForId]=\"name\" [appendTo]=\"appendTo\" bindValue=\"value\"\r\n [ngClass]=\"cssClass\" [searchable]=\"false\" [placeholder]=\"placeholder ? (placeholder | translate) : null\" [readonly]=\"isReadonly\" [clearable]=\"false\"\r\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\" [attr.required]=\"isRequired ? 'required' : null\"\r\n [attr.aria-required]=\"isRequired\" [attr.aria-invalid]=\"control.invalid && control.touched\"\r\n [attr.aria-describedby]=\"getDescribedBy(control)\" [attr.id]=\"name\"\r\n (focus)=\"onFocus()\" (blur)=\"onBlur()\">\r\n\r\n <!-- Template pour les options -->\r\n <ng-template ng-option-tmp let-item=\"item\" let-index=\"index\" let-search=\"searchTerm\">\r\n @if (optionTemplate) {\r\n <ng-container *ngTemplateOutlet=\"optionTemplate; context: { item: item | translate, index: index, searchTerm: search }\"></ng-container>\r\n }\r\n @else {\r\n <div>{{ item.label | translate }}</div>\r\n }\r\n </ng-template>\r\n\r\n <!-- Template pour le label -->\r\n <ng-template ng-label-tmp let-item=\"item\">\r\n @if (labelTemplate) {\r\n <ng-container *ngTemplateOutlet=\"labelTemplate; context: { item: item | translate }\"></ng-container>\r\n }\r\n @else {\r\n {{ (item.label | translate) || (placeholder | translate) }}\r\n }\r\n </ng-template>\r\n </ng-select>\r\n }\r\n\r\n <!-- NgSelect -->\r\n @if (type === typeField.ngSelect || type === typeField.ngSelectMultiple) {\r\n <ng-select [formControl]=\"formControl\" [items]=\"options\" bindLabel=\"label\" [labelForId]=\"name\" [appendTo]=\"appendTo\" bindValue=\"value\"\r\n [multiple]=\"type === typeField.ngSelectMultiple\" [ngClass]=\"cssClass\" [clearable]=\"false\"\r\n [placeholder]=\"placeholder ? (placeholder | translate) : null\" [readonly]=\"isReadonly\"\r\n [notFoundText]=\"'_COMMON.NO_RESULT' | translate\" [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\"\r\n [attr.required]=\"isRequired ? 'required' : null\" [attr.aria-required]=\"isRequired\"\r\n [attr.aria-invalid]=\"control.invalid && control.touched\"\r\n [attr.aria-describedby]=\"getDescribedBy(control)\" [attr.id]=\"name\"\r\n (focus)=\"onFocus()\" (blur)=\"onBlur()\" (search)=\"textChanged.emit($event?.term)\">\r\n\r\n <!-- Template pour les options -->\r\n <ng-template ng-option-tmp let-item=\"item\" let-index=\"index\" let-search=\"searchTerm\">\r\n @if (optionTemplate) {\r\n <ng-container *ngTemplateOutlet=\"optionTemplate; context: { item: item, index: index, searchTerm: search }\"></ng-container>\r\n }\r\n @else {\r\n <div>{{ item.label | translate }}</div>\r\n }\r\n </ng-template>\r\n\r\n <!-- Template pour le label -->\r\n <ng-template ng-label-tmp let-item=\"item\" let-clear=\"clear\">\r\n <span class=\"ng-value-icon left\" (click)=\"clear(item)\" aria-hidden=\"true\">\u00D7</span>\r\n @if (labelTemplate) {\r\n <ng-container *ngTemplateOutlet=\"labelTemplate; context: { item: item | translate }\"></ng-container>\r\n }\r\n @else {\r\n {{ (item.label | translate) || (placeholder | translate) }}\r\n }\r\n </ng-template>\r\n </ng-select>\r\n }\r\n\r\n <!-- Radio -->\r\n @if (type === typeField.radioInline || type === typeField.radio) {\r\n <fieldset\r\n [attr.aria-required]=\"isRequired\"\r\n [attr.aria-invalid]=\"control.invalid && control.touched\"\r\n [attr.aria-describedby]=\"getDescribedBy(control)\">\r\n <legend class=\"field-label\" [class.visually-hidden]=\"!displayLabel\">\r\n {{label | translate}}\r\n @if(isRequired) {\r\n <span class=\"text-danger\">*</span>\r\n }\r\n </legend>\r\n <ul class=\"list-unstyled mb-none\" [ngClass]=\"type === typeField.radioInline ? 'd-flex-h gap-md flex-wrap' : 'd-flex-v'\">\r\n @for (opt of options; track opt.value) {\r\n <li class=\"field-check\">\r\n <input type=\"radio\" [id]=\"name + '_' + opt.value\" [value]=\"opt.value\" [formControl]=\"formControl\"\r\n class=\"field-check-input\" [attr.disabled]=\"(isEffectivelyDisabled || opt.disabled) ? 'disabled' : null\" (change)=\"onRadioChange(opt.value)\" />\r\n <label [for]=\"name + '_' + opt.value\" class=\"field-check-label\">{{ opt.label | translate }}</label>\r\n </li>\r\n }\r\n </ul>\r\n </fieldset>\r\n }\r\n\r\n <!-- Radio button -->\r\n @if (type === typeField.radioButton) {\r\n <fieldset\r\n [attr.aria-required]=\"isRequired\"\r\n [attr.aria-invalid]=\"control.invalid && control.touched\"\r\n [attr.aria-describedby]=\"getDescribedBy(control)\">\r\n <legend class=\"field-label\" [class.visually-hidden]=\"!displayLabel\">\r\n {{label | translate}}\r\n @if(isRequired) {\r\n <span class=\"text-danger\">*</span>\r\n }\r\n </legend>\r\n <div class=\"field-group field-group-btn\">\r\n @for (opt of options; track opt.value) {\r\n <input type=\"radio\" [id]=\"name + '_' + opt.value\" [value]=\"opt.value\" [formControl]=\"formControl\"\r\n class=\"visually-hidden\" [attr.disabled]=\"(isEffectivelyDisabled || opt.disabled) ? 'disabled' : null\" (change)=\"onRadioChange(opt.value)\"/>\r\n <label [for]=\"name + '_' + opt.value\" class=\"btn btn-field-group\">{{ opt.label | translate }}</label>\r\n }\r\n </div>\r\n </fieldset>\r\n }\r\n\r\n <!-- Checkbox Switch -->\r\n @if ( type === typeField.switch || type === typeField.switchSmall)\r\n {\r\n <div class=\"field-check field-switch\" [ngClass]=\"{'field-switch-small': type === typeField.switchSmall}\">\r\n <input type=\"checkbox\" [id]=\"name\" [formControl]=\"formControl\" class=\"field-check-input\" [attr.aria-required]=\"isRequired\"\r\n [attr.aria-invalid]=\"control.invalid && control.touched\"\r\n [attr.aria-describedby]=\"getDescribedBy(control)\"\r\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\"/>\r\n <label [for]=\"name\" class=\"field-check-label\">{{ label | translate }}</label>\r\n </div>\r\n }\r\n\r\n <!-- Checkbox -->\r\n @if (type === typeField.checkboxInline || type === typeField.checkbox) {\r\n @if (isSingleCheckbox()) {\r\n <div class=\"field-check\" [class.field-check-inline]=\"type === typeField.checkboxInline\">\r\n <input #checkboxInput type=\"checkbox\" [id]=\"name\" [formControl]=\"formControl\"\r\n class=\"field-check-input\"\r\n [class.is-invalid]=\"control?.invalid && control?.touched\"\r\n [attr.aria-required]=\"isRequired\"\r\n [attr.aria-invalid]=\"control?.invalid && control?.touched\"\r\n [attr.aria-describedby]=\"getDescribedBy(control)\"\r\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\" />\r\n <label [for]=\"name\" class=\"field-check-label\">\r\n {{ label | translate }}\r\n @if (isRequired) {\r\n <span class=\"text-danger\">*</span>\r\n }\r\n </label>\r\n </div>\r\n }\r\n @else if( options.length > 1) {\r\n <fieldset\r\n [attr.aria-required]=\"isRequired\"\r\n [attr.aria-invalid]=\"control.invalid && control.touched\"\r\n [attr.aria-describedby]=\"getDescribedBy(control)\"\r\n [ngClass]=\"{ 'flex-column': type === typeField.checkbox }\">\r\n <legend class=\"field-label\" [class.visually-hidden]=\"!displayLabel\">\r\n {{label | translate}}\r\n @if(isRequired) {\r\n <span class=\"text-danger\">*</span>\r\n }\r\n </legend>\r\n <ul class=\"list-unstyled mb-none\" [ngClass]=\"type === typeField.checkboxInline ? 'd-flex-h gap-md' : 'd-flex-v'\">\r\n @for (opt of options; track opt.value) {\r\n <li class=\"field-check\" [ngClass]=\"{ 'field-check-inline': type === typeField.checkboxInline }\">\r\n <input type=\"checkbox\" [id]=\"name + '_' + opt.value\" [value]=\"opt.value\" (change)=\"onCheckboxChange($event)\"\r\n [checked]=\"control.value?.includes(opt.value)\" class=\"field-check-input\"\r\n [attr.disabled]=\"(isEffectivelyDisabled || opt.disabled) ? 'disabled' : null\" />\r\n <label [for]=\"name + '_' + opt.value\" class=\"field-check-label\">\r\n {{ opt.label | translate }}\r\n </label>\r\n </li>\r\n }\r\n </ul>\r\n </fieldset>\r\n }\r\n @else {\r\n <fieldset>\r\n <legend class=\"field-label\" [class.visually-hidden]=\"!displayLabel\">\r\n {{label | translate}}\r\n </legend>\r\n <ul class=\"list-unstyled mb-none\" [ngClass]=\"type === typeField.checkboxInline ? 'd-flex-h gap-md' : 'd-flex-v'\">\r\n @for (opt of options; track opt.value) {\r\n <li class=\"field-check\" [ngClass]=\"{ 'field-check-inline': type === typeField.checkboxInline }\">\r\n <input type=\"checkbox\" [id]=\"name + '_' + opt.value\" [value]=\"opt.value\" (change)=\"onCheckboxChange($event)\"\r\n [checked]=\"control.value?.includes(opt.value)\" class=\"field-check-input\"\r\n [attr.aria-required]=\"isRequired\"\r\n [attr.aria-invalid]=\"control.invalid && control.touched\"\r\n [attr.aria-describedby]=\"getDescribedBy(control)\"\r\n [attr.disabled]=\"(isEffectivelyDisabled || opt.disabled) ? 'disabled' : null\" />\r\n <label [for]=\"name + '_' + opt.value\" class=\"field-check-label\">\r\n {{ opt.label | translate }}\r\n @if(isRequired) {\r\n <span class=\"text-danger\">*</span>\r\n }\r\n </label>\r\n </li>\r\n }\r\n </ul>\r\n </fieldset>\r\n }\r\n }\r\n\r\n <!-- Checkbox button -->\r\n @if (type === typeField.checkboxButton && options.length > 0) {\r\n\r\n @if(options.length > 1) {\r\n <fieldset\r\n [attr.aria-required]=\"isRequired\"\r\n [attr.aria-invalid]=\"control.invalid && control.touched\"\r\n [attr.aria-describedby]=\"getDescribedBy(control)\">\r\n <legend class=\"field-label\" [class.visually-hidden]=\"!displayLabel\">\r\n {{label | translate}}\r\n @if(isRequired) {\r\n <span class=\"text-danger\">*</span>\r\n }\r\n </legend>\r\n <div class=\"field-group field-group-btn\">\r\n @for (opt of options; track opt.value) {\r\n <input type=\"checkbox\" [id]=\"name + '_' + opt.value\" [value]=\"opt.value\" (change)=\"onCheckboxChange($event)\"\r\n [checked]=\"control.value?.includes(opt.value)\" class=\"visually-hidden\"\r\n [attr.disabled]=\"(isEffectivelyDisabled || opt.disabled) ? 'disabled' : null\" />\r\n <label [for]=\"name + '_' + opt.value\" class=\"btn btn-field-group\">{{ opt.label | translate }}</label>\r\n }\r\n </div>\r\n </fieldset>\r\n }\r\n @else {\r\n <fieldset>\r\n <legend class=\"field-label\" [class.visually-hidden]=\"!displayLabel\">\r\n {{label | translate}}\r\n </legend>\r\n <div class=\"btn-group btn-group-secondary\">\r\n @for (opt of options; track opt.value) {\r\n <input type=\"checkbox\" [id]=\"name + '_' + opt.value\" [value]=\"opt.value\" (change)=\"onCheckboxChange($event)\"\r\n [checked]=\"control.value?.includes(opt.value)\" class=\"visually-hidden\"\r\n [attr.aria-required]=\"isRequired\"\r\n [attr.aria-invalid]=\"control.invalid && control.touched\"\r\n [attr.aria-describedby]=\"getDescribedBy(control)\"\r\n [attr.disabled]=\"(isEffectivelyDisabled || opt.disabled) ? 'disabled' : null\"/>\r\n <label [for]=\"name + '_' + opt.value\" class=\"btn btn-field-group\">\r\n {{ opt.label | translate}}\r\n @if(isRequired) {\r\n <span class=\"text-danger\">*</span>\r\n }\r\n </label>\r\n }\r\n </div>\r\n </fieldset>\r\n }\r\n }\r\n\r\n <!-- Period - DateToDate / TimeToTime / DateTimeToDateTime -->\r\n @if ([typeField.dateToDate, typeField.timeToTime, typeField.dateTimeToDateTime].includes(type) && isRange) {\r\n\r\n <div class=\"field-group\">\r\n <div class=\"field-group-text\">Du</div>\r\n <input [type]=\"getInputType()\" class=\"field-control\" [id]=\"name + '_start'\" [formControl]=\"getControl('start')\"\r\n [attr.placeholder]=\"type === typeField.timeToTime ? ('_COMMON._DATES.FROM' | translate) : ('_COMMON._DATES.FROM_TO_1' | translate)\"\r\n [ngClass]=\"[(cssClass || ''), getControl('start')?.value ? 'has-value' : '']\"\r\n [attr.required]=\"isRequired ? 'required' : null\" [attr.readonly]=\"isReadonly ? 'readonly' : null\"\r\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\" [attr.aria-required]=\"isRequired\"\r\n [attr.min]=\"minStartAttr\" [attr.max]=\"maxStartAttr\" [attr.step]=\"stepAttr\"\r\n [attr.autocomplete]=\"autocomplete\"\r\n [attr.aria-invalid]=\"getControl('start')?.invalid && getControl('start')?.touched\"\r\n [attr.aria-describedby]=\"getDescribedBy(getControl('start'))\"\r\n (focus)=\"onFocusRange('start')\" />\r\n\r\n @if(getControl('start')?.value && !isEffectivelyDisabled) {\r\n <button type=\"button\" class=\"btn btn-secondary btn-clear-field\"\r\n (click)=\"onClearFieldPeriod('start')\">\r\n &times;\r\n </button>\r\n }\r\n <div class=\"field-group-text\">au</div>\r\n <input [type]=\"getInputType()\" class=\"field-control\" [id]=\"name + '_end'\" [formControl]=\"getControl('end')\"\r\n [attr.placeholder]=\"type === typeField.timeToTime ? ('_COMMON._DATES.TO' | translate) : ('_COMMON._DATES.FROM_TO_2' | translate)\"\r\n [ngClass]=\"[(cssClass || ''), getControl('end')?.value ? 'has-value' : '']\"\r\n [attr.required]=\"isRequired ? 'required' : null\" [attr.readonly]=\"isReadonly ? 'readonly' : null\"\r\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\"\r\n [attr.min]=\"minEndAttr\" [attr.max]=\"maxEndAttr\" [attr.step]=\"stepAttr\"\r\n [attr.autocomplete]=\"autocomplete\"\r\n [attr.aria-invalid]=\"getControl('end')?.invalid && getControl('end')?.touched\"\r\n [attr.aria-describedby]=\"getDescribedBy(getControl('end'))\"\r\n (focus)=\"onFocusRange('end')\" />\r\n\r\n @if(getControl('end')?.value && !isEffectivelyDisabled) {\r\n <button type=\"button\" class=\"btn btn-secondary btn-clear-field\"\r\n (click)=\"onClearFieldPeriod('end')\">\r\n &times;\r\n </button>\r\n }\r\n </div>\r\n }\r\n\r\n @if ([typeField.datePlusOne, typeField.datePlusTwo, typeField.datePlusSeven, typeField.dateComplexe].includes(type)) {\r\n\r\n <div class=\"field-group\">\r\n @if (type === typeField.dateComplexe) {\r\n <button class=\"btn btn-secondary\" type=\"button\" (click)=\"onDateAddDay('prev')\"\r\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\">\r\n <cw-icon font=\"optyweb\" [icon]=\"spriteIcon.nextLeft\" [label]=\"'Jour pr\u00E9c\u00E9dent'\"></cw-icon>\r\n </button>\r\n }\r\n\r\n <input type=\"date\" class=\"field-control\" [id]=\"name\" [formControl]=\"formControl\"\r\n [ngClass]=\"[(cssClass || ''), formControl?.value ? 'has-value' : '']\"\r\n [attr.placeholder]=\"placeholder ? placeholder : null\" [attr.required]=\"isRequired ? 'required' : null\"\r\n [attr.readonly]=\"isReadonly ? 'readonly' : null\" [attr.aria-required]=\"isRequired\"\r\n [attr.min]=\"minAttr\" [attr.max]=\"maxAttr\" [attr.step]=\"stepAttr\"\r\n [attr.autocomplete]=\"autocomplete\"\r\n [attr.aria-invalid]=\"control.invalid && control.touched\"\r\n [attr.aria-describedby]=\"getDescribedBy(control)\"\r\n (focus)=\"onFocus()\" (blur)=\"onBlur()\" />\r\n\r\n @if(formControl?.value && !isEffectivelyDisabled) {\r\n <button class=\"btn btn-secondary btn-clear-field\" type=\"button\"\r\n (click)=\"onClearField(formControl)\">&times;</button>\r\n }\r\n\r\n @if (type === typeField.dateComplexe) {\r\n <button class=\"btn btn-secondary\" type=\"button\" (click)=\"onDateAddDay('next')\"\r\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\">\r\n <cw-icon font=\"optyweb\" [icon]=\"spriteIcon.nextRight\" [label]=\"'Jour suivant'\"></cw-icon>\r\n </button>\r\n <button class=\"btn btn-secondary\" type=\"button\" (click)=\"onRefresh()\"\r\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\">\r\n <cw-icon font=\"optyweb\" [icon]=\"spriteIcon.toolbarRefresh\" [label]=\"'Rafra\u00EEchir'\"></cw-icon>\r\n </button>\r\n }\r\n\r\n <button class=\"btn btn-secondary\" type=\"button\" (click)=\"onTodayAddDay(0)\"\r\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\">\r\n J\r\n <span class=\"visually-hidden\">Aujourd'hui</span>\r\n </button>\r\n <button class=\"btn btn-secondary\" type=\"button\" (click)=\"onTodayAddDay(1)\"\r\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\">\r\n J+1\r\n <span class=\"visually-hidden\">Demain</span>\r\n </button>\r\n\r\n @if (type !== typeField.datePlusOne && type !== typeField.dateComplexe) {\r\n <button class=\"btn btn-secondary \" type=\"button\" (click)=\"onTodayAddDay(2)\"\r\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\">\r\n J+2\r\n <span class=\"visually-hidden\">Dans 2 jours</span>\r\n </button>\r\n\r\n @if (type !== typeField.datePlusTwo) {\r\n <button class=\"btn btn-secondary\" type=\"button\" (click)=\"onTodayAddDay(7)\"\r\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\">\r\n J+7\r\n <span class=\"visually-hidden\">Dans 7 jours</span>\r\n </button>\r\n }\r\n }\r\n </div>\r\n }\r\n\r\n @if (type === typeField.slider) {\r\n <ngx-slider [(value)]=\"sliderValue\" [options]=\"sliderOptions\" [formControl]=\"formControl\"></ngx-slider>\r\n }\r\n\r\n @if (type === typeField.range) {\r\n <div class=\"slider\">\r\n\r\n <cw-button [isDisabled]=\"formControl.value <= rangeOptions.floor\" [label]=\"'Diminuer ' + formControl.value + ' ' + label\"\r\n [withIcon]=\"spriteIcon.toolbarMinus\" [withOnlyIcon]=\"true\" [type]=\"buttonType.primary\"\r\n [iconSize]=\"buttonIconSize.small\" (btnAction)=\"onRangeStep('decrease')\">\r\n </cw-button>\r\n\r\n <div class=\"slider-input\">\r\n <label [for]=\"name\" class=\"slider-tooltip\" [style.left]=\"getRangePercent() + '%'\" aria-live=\"polite\"\r\n aria-atomic=\"true\">\r\n {{ label | translate }} {{ formControl.value }}\r\n @if (rangeOptions.unit) {\r\n <abbr [title]=\"rangeOptions.unit\">{{ rangeOptions.unit }}</abbr>\r\n }\r\n </label>\r\n\r\n <div class=\"slider-custom-bar\">\r\n <div class=\"slider-custom-bar-selection\" [style.width]=\"getRangePercent() + '%'\">\r\n </div>\r\n </div>\r\n\r\n <input type=\"range\" [id]=\"name\" [formControl]=\"formControl\" [min]=\"rangeOptions.floor\" [max]=\"rangeOptions.ceil\"\r\n [step]=\"rangeOptions.step || 1\" class=\"field-control-range\" [attr.aria-required]=\"isRequired\"\r\n [attr.aria-invalid]=\"control.invalid && control.touched\">\r\n </div>\r\n\r\n <cw-button [isDisabled]=\"formControl.value >= rangeOptions.ceil\" [label]=\"'Augmenter ' + formControl.value + ' ' + label\"\r\n [withIcon]=\"spriteIcon.toolbarPlus\" [withOnlyIcon]=\"true\" [type]=\"buttonType.primary\"\r\n [iconSize]=\"buttonIconSize.small\" (btnAction)=\"onRangeStep('increase')\">\r\n </cw-button>\r\n </div>\r\n }\r\n\r\n @if (isInInputGroup() && clearable && !isEffectivelyDisabled && type !== typeField.autocompleteMultiple) {\r\n @if (type === typeField.autocomplete) {\r\n @if (autocompleteRef()?.hasAnyContent()) {\r\n <button class=\"btn btn-secondary btn-clear-field\" type=\"button\"\r\n (click)=\"autocompleteRef()!.clear()\">&times;</button>\r\n }\r\n } @else {\r\n @if(formControl?.value) {\r\n <button class=\"btn btn-secondary btn-clear-field\" type=\"button\"\r\n (click)=\"onClearField(formControl)\">&times;</button>\r\n }\r\n }\r\n }\r\n\r\n</ng-template>\r\n" }]
2311
3232
  }], ctorParameters: () => [], propDecorators: { control: [{
2312
3233
  type: Input
2313
3234
  }], formGroup: [{
@@ -2322,12 +3243,18 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.20", ngImpo
2322
3243
  type: Input
2323
3244
  }], placeholder: [{
2324
3245
  type: Input
3246
+ }], autocomplete: [{
3247
+ type: Input
2325
3248
  }], options: [{
2326
3249
  type: Input
2327
3250
  }], rangeOptions: [{
2328
3251
  type: Input
2329
3252
  }], validationOptions: [{
2330
3253
  type: Input
3254
+ }], autocompleteOptions: [{
3255
+ type: Input
3256
+ }], errorMessages: [{
3257
+ type: Input
2331
3258
  }], isRequired: [{
2332
3259
  type: Input
2333
3260
  }], help: [{
@@ -2356,7 +3283,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.20", ngImpo
2356
3283
  type: Input
2357
3284
  }], appendTo: [{
2358
3285
  type: Input
2359
- }], indeterminate: [{ type: i0.Input, args: [{ isSignal: true, alias: "indeterminate", required: false }] }], checkboxInputRef: [{ type: i0.ViewChild, args: ['checkboxInput', { isSignal: true }] }], fileInputRef: [{ type: i0.ViewChild, args: ['fileInput', { isSignal: true }] }], refreshEvent: [{
3286
+ }], initialCountry: [{
3287
+ type: Input
3288
+ }], indeterminate: [{ type: i0.Input, args: [{ isSignal: true, alias: "indeterminate", required: false }] }], checkboxInputRef: [{ type: i0.ViewChild, args: ['checkboxInput', { isSignal: true }] }], fileInputRef: [{ type: i0.ViewChild, args: ['fileInput', { isSignal: true }] }], phoneInputRef: [{ type: i0.ViewChild, args: ['phoneInput', { isSignal: true }] }], autocompleteRef: [{ type: i0.ViewChild, args: [i0.forwardRef(() => AutocompleteComponent), { isSignal: true }] }], refreshEvent: [{
2360
3289
  type: Output
2361
3290
  }], textChanged: [{
2362
3291
  type: Output
@@ -2626,11 +3555,11 @@ class ModalsComponent {
2626
3555
  });
2627
3556
  }
2628
3557
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: ModalsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
2629
- 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 }, modalTitle: { classPropertyName: "modalTitle", publicName: "modalTitle", isSignal: true, isRequired: false, transformFunction: null }, itemsToDelete: { classPropertyName: "itemsToDelete", publicName: "itemsToDelete", isSignal: true, isRequired: false, transformFunction: null }, itemsToDeleteTitle: { classPropertyName: "itemsToDeleteTitle", publicName: "itemsToDeleteTitle", isSignal: true, isRequired: false, transformFunction: null }, labelBtnAction1: { classPropertyName: "labelBtnAction1", publicName: "labelBtnAction1", isSignal: true, isRequired: false, transformFunction: null }, labelBtnAction2: { classPropertyName: "labelBtnAction2", publicName: "labelBtnAction2", isSignal: true, isRequired: false, transformFunction: null }, customBodyTemplate: { classPropertyName: "customBodyTemplate", publicName: "customBodyTemplate", isSignal: true, isRequired: false, transformFunction: null }, customBodyContext: { classPropertyName: "customBodyContext", publicName: "customBodyContext", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { btnAction1: "btnAction1", btnAction2: "btnAction2" }, viewQueries: [{ propertyName: "modalContainer", first: true, predicate: ["modalContainer"], descendants: true, isSignal: true }], ngImport: i0, template: "<div class=\"cityway-v8 modal-backdrop fade show\" style=\"z-index: 1050;\" aria-hidden=\"true\"></div>\n\n<div role=\"dialog\" tabindex=\"-1\" aria-modal=\"true\" aria-labelledby=\"modal-basic-title\"\n class=\"cityway-v8 d-flex modal show\" [ngClass]=\"customClass()\" data-test-ctw=\"modal\" (keydown)=\"onKeyDown($event)\">\n\n <div class=\"modal-inner-backdrop\" (click)=\"type() !== modalsType.loader && closeModal()\"></div>\n\n <div #modalContainer role=\"document\" class=\"modal-dialog modal-dialog-centered\"\n [ngClass]=\"['modal-' + size(), scrollable() ? 'modal-dialog-scrollable' : '']\">\n\n <div class=\"modal-content\">\n\n @if (type() !== modalsType.loader) {\n @if (type() == modalsType.delete || type() == modalsType.quickSideView || type() == modalsType.custom) {\n <div class=\"modal-header\">\n @if (type() === modalsType.delete) {\n <h1 class=\"modal-title\" id=\"modal-basic-title\">\n {{ '_COMMON._MODAL_DELETE.TITLE' | translate: { number: itemsToDelete().length, name: itemsToDeleteTitle() | translate } }}\n </h1>\n }\n @else {\n <h1 class=\"modal-title\" id=\"modal-basic-title\">\n {{ modalTitle() | translate }}\n </h1>\n }\n\n <cw-button [label]=\"'_COMMON._ACTION.CLOSE' | translate\" [type]=\"buttonTypeEnum.light\" [withOnlyIcon]=\"true\"\n [withIcon]=\"spriteIcon.toolbarClose\" (btnAction)=\"closeModal()\" dataTest=\"btn-close-modal\"\n cssClass=\"btn-close\">\n </cw-button>\n </div>\n\n <div class=\"modal-body\">\n @if (type() === modalsType.delete) {\n @if (itemsToDelete().length === 1) {\n <div [innerHTML]=\"'_COMMON._MODAL_DELETE.SIMPLE_TEXT' | translate\"></div>\n }\n @if (itemsToDelete().length > 1) {\n <div [innerHTML]=\"'_COMMON._MODAL_DELETE.MULTIPLE_TEXT' | translate\"></div>\n }\n @if (itemsToDelete().length > 0) {\n <ul class=\"mb-none\">\n @for (item of itemsToDelete(); track item) {\n <li>{{ item }}</li>\n }\n </ul>\n }\n }\n @else {\n @if (customBodyTemplate()) {\n <ng-container [ngTemplateOutlet]=\"customBodyTemplate()\" [ngTemplateOutletContext]=\"customBodyContext()\">\n </ng-container>\n }\n }\n </div>\n }\n @else {\n <div class=\"modal-header justify-content-end\">\n <cw-button [label]=\"'_COMMON._ACTION.CLOSE' | translate\" [type]=\"buttonTypeEnum.light\" [withOnlyIcon]=\"true\"\n [withIcon]=\"spriteIcon.toolbarClose\" (btnAction)=\"closeModal()\" dataTest=\"btn-close-modal\"\n cssClass=\"btn-close\">\n </cw-button>\n </div>\n <div class=\"modal-body\">\n <cw-icon [label]=\"'Sucess'\" [iconSize]=\"iconSize['5xl']\" [icon]=\"spriteIcon.toolbarClose\" [type]=\"iconType.rounded\" [iconUiType]=\"iconUiType.success\"></cw-icon>\n\n <h1 class=\"modal-title\" id=\"modal-basic-title\">\n {{ modalTitle() | translate }}\n </h1>\n\n @if (customBodyTemplate()) {\n <ng-container [ngTemplateOutlet]=\"customBodyTemplate()\" [ngTemplateOutletContext]=\"customBodyContext()\">\n </ng-container>\n }\n </div>\n }\n\n <div class=\"modal-footer\">\n @if (type() === modalsType.delete) {\n <cw-button label=\"_COMMON._ACTION.DELETE\" [type]=\"buttonTypeEnum.danger\" [isMinWidth]=\"true\"\n (btnAction)=\"action1Click()\" dataTest=\"btn-action-modal\">\n </cw-button>\n\n <cw-button label=\"_COMMON._ACTION.CLOSE\" [type]=\"buttonTypeEnum.secondary\" [isMinWidth]=\"true\"\n (btnAction)=\"closeModal()\" dataTest=\"btn-close-modal\">\n </cw-button>\n }\n @else {\n @if (labelBtnAction1()) {\n <cw-button [label]=\"labelBtnAction1()\" [type]=\"buttonTypeEnum.primary\" [isMinWidth]=\"true\"\n (btnAction)=\"action1Click()\" dataTest=\"btn-action-modal\">\n </cw-button>\n }\n @if (labelBtnAction2()) {\n <cw-button [label]=\"labelBtnAction2()\" [type]=\"buttonTypeEnum.secondary\" [isMinWidth]=\"true\"\n (btnAction)=\"action2Click()\" dataTest=\"btn-action-modal\">\n </cw-button>\n }\n @else {\n <cw-button label=\"_COMMON._ACTION.CLOSE\" [type]=\"buttonTypeEnum.secondary\" [isMinWidth]=\"true\"\n (btnAction)=\"closeModal()\" dataTest=\"btn-close-modal\">\n </cw-button>\n }\n }\n </div>\n }\n @else {\n <div class=\"modal-body\">\n <cw-loader></cw-loader>\n </div>\n }\n\n </div>\n </div>\n</div>\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "ngmodule", type: TranslateModule }, { kind: "component", type: ButtonComponent, selector: "cw-button", inputs: ["type", "label", "id", "isDropdown", "withIcon", "withOnlyIcon", "iconSize", "iconPosition", "dropdownPosition", "isMinWidth", "isDisabled", "isLoading", "cssClass", "dataTest", "skeletonMode", "withTooltip", "tooltipText", "tooltipTitle", "tooltipTrigger", "tooltipPosition", "tooltipType"], outputs: ["btnAction", "dropDownClicked"] }, { kind: "component", type: LoaderComponent, selector: "cw-loader" }, { kind: "component", type: IconComponent, selector: "cw-icon", inputs: ["icon", "label", "type", "iconSize", "iconCssClass", "iconUiType", "iconColorCustom", "spritePath"] }, { kind: "pipe", type: i2.TranslatePipe, name: "translate" }] }); }
3558
+ 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 }, modalTitle: { classPropertyName: "modalTitle", publicName: "modalTitle", isSignal: true, isRequired: false, transformFunction: null }, itemsToDelete: { classPropertyName: "itemsToDelete", publicName: "itemsToDelete", isSignal: true, isRequired: false, transformFunction: null }, itemsToDeleteTitle: { classPropertyName: "itemsToDeleteTitle", publicName: "itemsToDeleteTitle", isSignal: true, isRequired: false, transformFunction: null }, labelBtnAction1: { classPropertyName: "labelBtnAction1", publicName: "labelBtnAction1", isSignal: true, isRequired: false, transformFunction: null }, labelBtnAction2: { classPropertyName: "labelBtnAction2", publicName: "labelBtnAction2", isSignal: true, isRequired: false, transformFunction: null }, customBodyTemplate: { classPropertyName: "customBodyTemplate", publicName: "customBodyTemplate", isSignal: true, isRequired: false, transformFunction: null }, customBodyContext: { classPropertyName: "customBodyContext", publicName: "customBodyContext", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { btnAction1: "btnAction1", btnAction2: "btnAction2" }, viewQueries: [{ propertyName: "modalContainer", first: true, predicate: ["modalContainer"], descendants: true, isSignal: true }], ngImport: i0, template: "<div class=\"cityway-v8 modal-backdrop fade show\" style=\"z-index: 1050;\" aria-hidden=\"true\"></div>\n\n<div role=\"dialog\" tabindex=\"-1\" aria-modal=\"true\" aria-labelledby=\"modal-basic-title\"\n class=\"cityway-v8 d-flex modal show\" [ngClass]=\"customClass()\" data-test-ctw=\"modal\" (keydown)=\"onKeyDown($event)\">\n\n <div class=\"modal-inner-backdrop\" (click)=\"type() !== modalsType.loader && closeModal()\"></div>\n\n <div #modalContainer role=\"document\" class=\"modal-dialog modal-dialog-centered\"\n [ngClass]=\"['modal-' + size(), scrollable() ? 'modal-dialog-scrollable' : '']\">\n\n <div class=\"modal-content\">\n\n @if (type() !== modalsType.loader) {\n @if (type() == modalsType.delete || type() == modalsType.quickSideView || type() == modalsType.custom) {\n <div class=\"modal-header\">\n @if (type() === modalsType.delete) {\n <h1 class=\"modal-title\" id=\"modal-basic-title\">\n {{ '_COMMON._MODAL_DELETE.TITLE' | translate: { number: itemsToDelete().length, name: itemsToDeleteTitle() | translate } }}\n </h1>\n }\n @else {\n <h1 class=\"modal-title\" id=\"modal-basic-title\">\n {{ modalTitle() | translate }}\n </h1>\n }\n\n <cw-button [label]=\"'_COMMON._ACTION.CLOSE' | translate\" [type]=\"buttonTypeEnum.light\" [withOnlyIcon]=\"true\"\n [withIcon]=\"spriteIcon.toolbarClose\" (btnAction)=\"closeModal()\" dataTest=\"btn-close-modal\"\n cssClass=\"btn-close\">\n </cw-button>\n </div>\n\n <div class=\"modal-body\">\n @if (customBodyTemplate()) {\n <ng-container [ngTemplateOutlet]=\"customBodyTemplate()\" [ngTemplateOutletContext]=\"customBodyContext()\">\n </ng-container>\n }\n\n @if (type() === modalsType.delete) {\n @if (itemsToDelete().length === 1) {\n <div [innerHTML]=\"'_COMMON._MODAL_DELETE.SIMPLE_TEXT' | translate\"></div>\n }\n @if (itemsToDelete().length > 1) {\n <div [innerHTML]=\"'_COMMON._MODAL_DELETE.MULTIPLE_TEXT' | translate\"></div>\n }\n @if (itemsToDelete().length > 0) {\n <ul class=\"mb-none\">\n @for (item of itemsToDelete(); track item) {\n <li>{{ item }}</li>\n }\n </ul>\n }\n }\n </div>\n }\n @else {\n <div class=\"modal-header justify-content-end\">\n <cw-button [label]=\"'_COMMON._ACTION.CLOSE' | translate\" [type]=\"buttonTypeEnum.light\" [withOnlyIcon]=\"true\"\n [withIcon]=\"spriteIcon.toolbarClose\" (btnAction)=\"closeModal()\" dataTest=\"btn-close-modal\"\n cssClass=\"btn-close\">\n </cw-button>\n </div>\n <div class=\"modal-body\">\n <cw-icon [label]=\"'Sucess'\" [iconSize]=\"iconSize['5xl']\" [icon]=\"spriteIcon.toolbarClose\" [type]=\"iconType.rounded\" [iconUiType]=\"iconUiType.success\"></cw-icon>\n\n <h1 class=\"modal-title\" id=\"modal-basic-title\">\n {{ modalTitle() | translate }}\n </h1>\n\n @if (customBodyTemplate()) {\n <ng-container [ngTemplateOutlet]=\"customBodyTemplate()\" [ngTemplateOutletContext]=\"customBodyContext()\">\n </ng-container>\n }\n </div>\n }\n\n <div class=\"modal-footer\">\n @if (type() === modalsType.delete) {\n <cw-button label=\"_COMMON._ACTION.DELETE\" [type]=\"buttonTypeEnum.danger\" [isMinWidth]=\"true\"\n (btnAction)=\"action1Click()\" dataTest=\"btn-action-modal\">\n </cw-button>\n\n <cw-button label=\"_COMMON._ACTION.CLOSE\" [type]=\"buttonTypeEnum.secondary\" [isMinWidth]=\"true\"\n (btnAction)=\"closeModal()\" dataTest=\"btn-close-modal\">\n </cw-button>\n }\n @else {\n @if (labelBtnAction1()) {\n <cw-button [label]=\"labelBtnAction1()\" [type]=\"buttonTypeEnum.primary\" [isMinWidth]=\"true\"\n (btnAction)=\"action1Click()\" dataTest=\"btn-action-modal\">\n </cw-button>\n }\n @if (labelBtnAction2()) {\n <cw-button [label]=\"labelBtnAction2()\" [type]=\"buttonTypeEnum.secondary\" [isMinWidth]=\"true\"\n (btnAction)=\"action2Click()\" dataTest=\"btn-action-modal\">\n </cw-button>\n }\n @else {\n <cw-button label=\"_COMMON._ACTION.CLOSE\" [type]=\"buttonTypeEnum.secondary\" [isMinWidth]=\"true\"\n (btnAction)=\"closeModal()\" dataTest=\"btn-close-modal\">\n </cw-button>\n }\n }\n </div>\n }\n @else {\n <div class=\"modal-body\">\n <cw-loader></cw-loader>\n </div>\n }\n\n </div>\n </div>\n</div>\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "ngmodule", type: TranslateModule }, { kind: "component", type: ButtonComponent, selector: "cw-button", inputs: ["type", "label", "id", "link", "isDropdown", "hideCaret", "withIcon", "withOnlyIcon", "iconSize", "iconPosition", "dropdownPosition", "isMinWidth", "isDisabled", "isLoading", "cssClass", "dataTest", "skeletonMode", "withTooltip", "tooltipText", "tooltipTitle", "tooltipTrigger", "tooltipPosition", "tooltipType"], outputs: ["btnAction", "dropDownClicked"] }, { kind: "component", type: LoaderComponent, selector: "cw-loader" }, { kind: "component", type: IconComponent, selector: "cw-icon", inputs: ["icon", "label", "type", "iconSize", "iconCssClass", "iconUiType", "iconColorCustom", "spritePath"] }, { kind: "pipe", type: i2.TranslatePipe, name: "translate" }] }); }
2630
3559
  }
2631
3560
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: ModalsComponent, decorators: [{
2632
3561
  type: Component,
2633
- args: [{ selector: 'cw-modals', standalone: true, imports: [CommonModule, TranslateModule, NgClass, NgTemplateOutlet, ButtonComponent, LoaderComponent, IconComponent], template: "<div class=\"cityway-v8 modal-backdrop fade show\" style=\"z-index: 1050;\" aria-hidden=\"true\"></div>\n\n<div role=\"dialog\" tabindex=\"-1\" aria-modal=\"true\" aria-labelledby=\"modal-basic-title\"\n class=\"cityway-v8 d-flex modal show\" [ngClass]=\"customClass()\" data-test-ctw=\"modal\" (keydown)=\"onKeyDown($event)\">\n\n <div class=\"modal-inner-backdrop\" (click)=\"type() !== modalsType.loader && closeModal()\"></div>\n\n <div #modalContainer role=\"document\" class=\"modal-dialog modal-dialog-centered\"\n [ngClass]=\"['modal-' + size(), scrollable() ? 'modal-dialog-scrollable' : '']\">\n\n <div class=\"modal-content\">\n\n @if (type() !== modalsType.loader) {\n @if (type() == modalsType.delete || type() == modalsType.quickSideView || type() == modalsType.custom) {\n <div class=\"modal-header\">\n @if (type() === modalsType.delete) {\n <h1 class=\"modal-title\" id=\"modal-basic-title\">\n {{ '_COMMON._MODAL_DELETE.TITLE' | translate: { number: itemsToDelete().length, name: itemsToDeleteTitle() | translate } }}\n </h1>\n }\n @else {\n <h1 class=\"modal-title\" id=\"modal-basic-title\">\n {{ modalTitle() | translate }}\n </h1>\n }\n\n <cw-button [label]=\"'_COMMON._ACTION.CLOSE' | translate\" [type]=\"buttonTypeEnum.light\" [withOnlyIcon]=\"true\"\n [withIcon]=\"spriteIcon.toolbarClose\" (btnAction)=\"closeModal()\" dataTest=\"btn-close-modal\"\n cssClass=\"btn-close\">\n </cw-button>\n </div>\n\n <div class=\"modal-body\">\n @if (type() === modalsType.delete) {\n @if (itemsToDelete().length === 1) {\n <div [innerHTML]=\"'_COMMON._MODAL_DELETE.SIMPLE_TEXT' | translate\"></div>\n }\n @if (itemsToDelete().length > 1) {\n <div [innerHTML]=\"'_COMMON._MODAL_DELETE.MULTIPLE_TEXT' | translate\"></div>\n }\n @if (itemsToDelete().length > 0) {\n <ul class=\"mb-none\">\n @for (item of itemsToDelete(); track item) {\n <li>{{ item }}</li>\n }\n </ul>\n }\n }\n @else {\n @if (customBodyTemplate()) {\n <ng-container [ngTemplateOutlet]=\"customBodyTemplate()\" [ngTemplateOutletContext]=\"customBodyContext()\">\n </ng-container>\n }\n }\n </div>\n }\n @else {\n <div class=\"modal-header justify-content-end\">\n <cw-button [label]=\"'_COMMON._ACTION.CLOSE' | translate\" [type]=\"buttonTypeEnum.light\" [withOnlyIcon]=\"true\"\n [withIcon]=\"spriteIcon.toolbarClose\" (btnAction)=\"closeModal()\" dataTest=\"btn-close-modal\"\n cssClass=\"btn-close\">\n </cw-button>\n </div>\n <div class=\"modal-body\">\n <cw-icon [label]=\"'Sucess'\" [iconSize]=\"iconSize['5xl']\" [icon]=\"spriteIcon.toolbarClose\" [type]=\"iconType.rounded\" [iconUiType]=\"iconUiType.success\"></cw-icon>\n\n <h1 class=\"modal-title\" id=\"modal-basic-title\">\n {{ modalTitle() | translate }}\n </h1>\n\n @if (customBodyTemplate()) {\n <ng-container [ngTemplateOutlet]=\"customBodyTemplate()\" [ngTemplateOutletContext]=\"customBodyContext()\">\n </ng-container>\n }\n </div>\n }\n\n <div class=\"modal-footer\">\n @if (type() === modalsType.delete) {\n <cw-button label=\"_COMMON._ACTION.DELETE\" [type]=\"buttonTypeEnum.danger\" [isMinWidth]=\"true\"\n (btnAction)=\"action1Click()\" dataTest=\"btn-action-modal\">\n </cw-button>\n\n <cw-button label=\"_COMMON._ACTION.CLOSE\" [type]=\"buttonTypeEnum.secondary\" [isMinWidth]=\"true\"\n (btnAction)=\"closeModal()\" dataTest=\"btn-close-modal\">\n </cw-button>\n }\n @else {\n @if (labelBtnAction1()) {\n <cw-button [label]=\"labelBtnAction1()\" [type]=\"buttonTypeEnum.primary\" [isMinWidth]=\"true\"\n (btnAction)=\"action1Click()\" dataTest=\"btn-action-modal\">\n </cw-button>\n }\n @if (labelBtnAction2()) {\n <cw-button [label]=\"labelBtnAction2()\" [type]=\"buttonTypeEnum.secondary\" [isMinWidth]=\"true\"\n (btnAction)=\"action2Click()\" dataTest=\"btn-action-modal\">\n </cw-button>\n }\n @else {\n <cw-button label=\"_COMMON._ACTION.CLOSE\" [type]=\"buttonTypeEnum.secondary\" [isMinWidth]=\"true\"\n (btnAction)=\"closeModal()\" dataTest=\"btn-close-modal\">\n </cw-button>\n }\n }\n </div>\n }\n @else {\n <div class=\"modal-body\">\n <cw-loader></cw-loader>\n </div>\n }\n\n </div>\n </div>\n</div>\n" }]
3562
+ args: [{ selector: 'cw-modals', standalone: true, imports: [CommonModule, TranslateModule, NgClass, NgTemplateOutlet, ButtonComponent, LoaderComponent, IconComponent], template: "<div class=\"cityway-v8 modal-backdrop fade show\" style=\"z-index: 1050;\" aria-hidden=\"true\"></div>\n\n<div role=\"dialog\" tabindex=\"-1\" aria-modal=\"true\" aria-labelledby=\"modal-basic-title\"\n class=\"cityway-v8 d-flex modal show\" [ngClass]=\"customClass()\" data-test-ctw=\"modal\" (keydown)=\"onKeyDown($event)\">\n\n <div class=\"modal-inner-backdrop\" (click)=\"type() !== modalsType.loader && closeModal()\"></div>\n\n <div #modalContainer role=\"document\" class=\"modal-dialog modal-dialog-centered\"\n [ngClass]=\"['modal-' + size(), scrollable() ? 'modal-dialog-scrollable' : '']\">\n\n <div class=\"modal-content\">\n\n @if (type() !== modalsType.loader) {\n @if (type() == modalsType.delete || type() == modalsType.quickSideView || type() == modalsType.custom) {\n <div class=\"modal-header\">\n @if (type() === modalsType.delete) {\n <h1 class=\"modal-title\" id=\"modal-basic-title\">\n {{ '_COMMON._MODAL_DELETE.TITLE' | translate: { number: itemsToDelete().length, name: itemsToDeleteTitle() | translate } }}\n </h1>\n }\n @else {\n <h1 class=\"modal-title\" id=\"modal-basic-title\">\n {{ modalTitle() | translate }}\n </h1>\n }\n\n <cw-button [label]=\"'_COMMON._ACTION.CLOSE' | translate\" [type]=\"buttonTypeEnum.light\" [withOnlyIcon]=\"true\"\n [withIcon]=\"spriteIcon.toolbarClose\" (btnAction)=\"closeModal()\" dataTest=\"btn-close-modal\"\n cssClass=\"btn-close\">\n </cw-button>\n </div>\n\n <div class=\"modal-body\">\n @if (customBodyTemplate()) {\n <ng-container [ngTemplateOutlet]=\"customBodyTemplate()\" [ngTemplateOutletContext]=\"customBodyContext()\">\n </ng-container>\n }\n\n @if (type() === modalsType.delete) {\n @if (itemsToDelete().length === 1) {\n <div [innerHTML]=\"'_COMMON._MODAL_DELETE.SIMPLE_TEXT' | translate\"></div>\n }\n @if (itemsToDelete().length > 1) {\n <div [innerHTML]=\"'_COMMON._MODAL_DELETE.MULTIPLE_TEXT' | translate\"></div>\n }\n @if (itemsToDelete().length > 0) {\n <ul class=\"mb-none\">\n @for (item of itemsToDelete(); track item) {\n <li>{{ item }}</li>\n }\n </ul>\n }\n }\n </div>\n }\n @else {\n <div class=\"modal-header justify-content-end\">\n <cw-button [label]=\"'_COMMON._ACTION.CLOSE' | translate\" [type]=\"buttonTypeEnum.light\" [withOnlyIcon]=\"true\"\n [withIcon]=\"spriteIcon.toolbarClose\" (btnAction)=\"closeModal()\" dataTest=\"btn-close-modal\"\n cssClass=\"btn-close\">\n </cw-button>\n </div>\n <div class=\"modal-body\">\n <cw-icon [label]=\"'Sucess'\" [iconSize]=\"iconSize['5xl']\" [icon]=\"spriteIcon.toolbarClose\" [type]=\"iconType.rounded\" [iconUiType]=\"iconUiType.success\"></cw-icon>\n\n <h1 class=\"modal-title\" id=\"modal-basic-title\">\n {{ modalTitle() | translate }}\n </h1>\n\n @if (customBodyTemplate()) {\n <ng-container [ngTemplateOutlet]=\"customBodyTemplate()\" [ngTemplateOutletContext]=\"customBodyContext()\">\n </ng-container>\n }\n </div>\n }\n\n <div class=\"modal-footer\">\n @if (type() === modalsType.delete) {\n <cw-button label=\"_COMMON._ACTION.DELETE\" [type]=\"buttonTypeEnum.danger\" [isMinWidth]=\"true\"\n (btnAction)=\"action1Click()\" dataTest=\"btn-action-modal\">\n </cw-button>\n\n <cw-button label=\"_COMMON._ACTION.CLOSE\" [type]=\"buttonTypeEnum.secondary\" [isMinWidth]=\"true\"\n (btnAction)=\"closeModal()\" dataTest=\"btn-close-modal\">\n </cw-button>\n }\n @else {\n @if (labelBtnAction1()) {\n <cw-button [label]=\"labelBtnAction1()\" [type]=\"buttonTypeEnum.primary\" [isMinWidth]=\"true\"\n (btnAction)=\"action1Click()\" dataTest=\"btn-action-modal\">\n </cw-button>\n }\n @if (labelBtnAction2()) {\n <cw-button [label]=\"labelBtnAction2()\" [type]=\"buttonTypeEnum.secondary\" [isMinWidth]=\"true\"\n (btnAction)=\"action2Click()\" dataTest=\"btn-action-modal\">\n </cw-button>\n }\n @else {\n <cw-button label=\"_COMMON._ACTION.CLOSE\" [type]=\"buttonTypeEnum.secondary\" [isMinWidth]=\"true\"\n (btnAction)=\"closeModal()\" dataTest=\"btn-close-modal\">\n </cw-button>\n }\n }\n </div>\n }\n @else {\n <div class=\"modal-body\">\n <cw-loader></cw-loader>\n </div>\n }\n\n </div>\n </div>\n</div>\n" }]
2634
3563
  }], 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 }] }], modalTitle: [{ type: i0.Input, args: [{ isSignal: true, alias: "modalTitle", required: false }] }], itemsToDelete: [{ type: i0.Input, args: [{ isSignal: true, alias: "itemsToDelete", required: false }] }], itemsToDeleteTitle: [{ type: i0.Input, args: [{ isSignal: true, alias: "itemsToDeleteTitle", required: false }] }], labelBtnAction1: [{ type: i0.Input, args: [{ isSignal: true, alias: "labelBtnAction1", required: false }] }], labelBtnAction2: [{ type: i0.Input, args: [{ isSignal: true, alias: "labelBtnAction2", required: false }] }], customBodyTemplate: [{ type: i0.Input, args: [{ isSignal: true, alias: "customBodyTemplate", required: false }] }], customBodyContext: [{ type: i0.Input, args: [{ isSignal: true, alias: "customBodyContext", required: false }] }], btnAction1: [{ type: i0.Output, args: ["btnAction1"] }], btnAction2: [{ type: i0.Output, args: ["btnAction2"] }] } });
2635
3564
 
2636
3565
  class TabContentComponent {
@@ -2999,7 +3928,7 @@ class NumericalRangeComponent {
2999
3928
  this.newAmount.emit(next);
3000
3929
  }
3001
3930
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: NumericalRangeComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
3002
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.20", type: NumericalRangeComponent, isStandalone: true, selector: "cw-numerical-range", inputs: { type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, amount: { classPropertyName: "amount", publicName: "amount", isSignal: true, isRequired: false, transformFunction: null }, withIcon: { classPropertyName: "withIcon", publicName: "withIcon", isSignal: true, isRequired: false, transformFunction: null }, withLabelVisible: { classPropertyName: "withLabelVisible", publicName: "withLabelVisible", isSignal: true, isRequired: false, transformFunction: null }, labelPosition: { classPropertyName: "labelPosition", publicName: "labelPosition", isSignal: true, isRequired: false, transformFunction: null }, ceil: { classPropertyName: "ceil", publicName: "ceil", isSignal: true, isRequired: false, transformFunction: null }, floor: { classPropertyName: "floor", publicName: "floor", isSignal: true, isRequired: false, transformFunction: null }, isDisabled: { classPropertyName: "isDisabled", publicName: "isDisabled", isSignal: true, isRequired: false, transformFunction: null }, autoChangeAmount: { classPropertyName: "autoChangeAmount", publicName: "autoChangeAmount", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { amount: "amountChange", newAmount: "newAmount" }, ngImport: i0, template: "<div class=\"numerical-range text-center\" [ngClass]=\"'numerical-range-' + type()\">\n\n @if (labelPosition() == labelPositionValue.outside && withLabelVisible()) {\n <div class=\"numerical-range-label\" aria-hidden=\"true\">\n @if (withIcon() && (type() == numericalRangeType.largeWhite || type() == numericalRangeType.largeGrey)) {\n <cw-icon [icon]=\"withIcon()\" [iconSize]=\"iconSize['lg']\"></cw-icon>\n }\n <span>{{ label() }}</span>\n </div>\n }\n\n <div class=\"numerical-range-container\">\n <cw-button [isDisabled]=\"isDisabled() || amount() <= floor()\" [label]=\"'Diminuer ' + amount() + ' ' + label()\"\n [withIcon]=\"spriteIcon.toolbarMinus\" [withOnlyIcon]=\"true\" [type]=\"buttonType.primary\"\n [iconSize]=\"buttonIconSize.small\" (btnAction)=\"decreaseAmount()\">\n </cw-button>\n\n <div class=\"numerical-range-wrapper\">\n <div class=\"numerical-range-amount\" aria-live=\"polite\" aria-atomic=\"true\">\n {{ amount() }}\n @if (!withLabelVisible() && !withIcon()) {\n <span class=\"sr-only\">{{ label() }}</span>\n }\n </div>\n\n @if ((type() !== numericalRangeType.largeGrey && type() !== numericalRangeType.largeWhite) && (withIcon() ||\n withLabelVisible())) {\n <div class=\"numerical-range-label\">\n @if (withLabelVisible() && labelPosition() == labelPositionValue.inside) {\n @if (withIcon()) {\n <cw-icon [icon]=\"withIcon()\" [iconSize]=\"iconSize['lg']\" aria-hidden=\"true\"></cw-icon>\n }\n <span>{{ label() }}</span>\n }\n @else {\n @if (withIcon()) {\n <cw-icon [icon]=\"withIcon()\" [label]=\"label()\" [iconSize]=\"iconSize['lg']\"></cw-icon>\n }\n }\n </div>\n }\n </div>\n\n <cw-button [isDisabled]=\"isDisabled() || amount() >= ceil()\" [label]=\"'Augmenter ' + amount() + ' ' + label()\"\n [withIcon]=\"spriteIcon.toolbarPlus\" [withOnlyIcon]=\"true\" [type]=\"buttonType.primary\"\n [iconSize]=\"buttonIconSize.small\" (btnAction)=\"increaseAmount()\">\n </cw-button>\n </div>\n</div>\n", dependencies: [{ kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "component", type: IconComponent, selector: "cw-icon", inputs: ["icon", "label", "type", "iconSize", "iconCssClass", "iconUiType", "iconColorCustom", "spritePath"] }, { kind: "component", type: ButtonComponent, selector: "cw-button", inputs: ["type", "label", "id", "isDropdown", "withIcon", "withOnlyIcon", "iconSize", "iconPosition", "dropdownPosition", "isMinWidth", "isDisabled", "isLoading", "cssClass", "dataTest", "skeletonMode", "withTooltip", "tooltipText", "tooltipTitle", "tooltipTrigger", "tooltipPosition", "tooltipType"], outputs: ["btnAction", "dropDownClicked"] }] }); }
3931
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.20", type: NumericalRangeComponent, isStandalone: true, selector: "cw-numerical-range", inputs: { type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, amount: { classPropertyName: "amount", publicName: "amount", isSignal: true, isRequired: false, transformFunction: null }, withIcon: { classPropertyName: "withIcon", publicName: "withIcon", isSignal: true, isRequired: false, transformFunction: null }, withLabelVisible: { classPropertyName: "withLabelVisible", publicName: "withLabelVisible", isSignal: true, isRequired: false, transformFunction: null }, labelPosition: { classPropertyName: "labelPosition", publicName: "labelPosition", isSignal: true, isRequired: false, transformFunction: null }, ceil: { classPropertyName: "ceil", publicName: "ceil", isSignal: true, isRequired: false, transformFunction: null }, floor: { classPropertyName: "floor", publicName: "floor", isSignal: true, isRequired: false, transformFunction: null }, isDisabled: { classPropertyName: "isDisabled", publicName: "isDisabled", isSignal: true, isRequired: false, transformFunction: null }, autoChangeAmount: { classPropertyName: "autoChangeAmount", publicName: "autoChangeAmount", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { amount: "amountChange", newAmount: "newAmount" }, ngImport: i0, template: "<div class=\"numerical-range text-center\" [ngClass]=\"'numerical-range-' + type()\">\n\n @if (labelPosition() == labelPositionValue.outside && withLabelVisible()) {\n <div class=\"numerical-range-label\" aria-hidden=\"true\">\n @if (withIcon() && (type() == numericalRangeType.largeWhite || type() == numericalRangeType.largeGrey)) {\n <cw-icon [icon]=\"withIcon()\" [iconSize]=\"iconSize['lg']\"></cw-icon>\n }\n <span>{{ label() }}</span>\n </div>\n }\n\n <div class=\"numerical-range-container\">\n <cw-button [isDisabled]=\"isDisabled() || amount() <= floor()\" [label]=\"'Diminuer ' + amount() + ' ' + label()\"\n [withIcon]=\"spriteIcon.toolbarMinus\" [withOnlyIcon]=\"true\" [type]=\"buttonType.primary\"\n [iconSize]=\"buttonIconSize.small\" (btnAction)=\"decreaseAmount()\">\n </cw-button>\n\n <div class=\"numerical-range-wrapper\">\n <div class=\"numerical-range-amount\" aria-live=\"polite\" aria-atomic=\"true\">\n {{ amount() }}\n @if (!withLabelVisible() && !withIcon()) {\n <span class=\"sr-only\">{{ label() }}</span>\n }\n </div>\n\n @if ((type() !== numericalRangeType.largeGrey && type() !== numericalRangeType.largeWhite) && (withIcon() ||\n withLabelVisible())) {\n <div class=\"numerical-range-label\">\n @if (withLabelVisible() && labelPosition() == labelPositionValue.inside) {\n @if (withIcon()) {\n <cw-icon [icon]=\"withIcon()\" [iconSize]=\"iconSize['lg']\" aria-hidden=\"true\"></cw-icon>\n }\n <span>{{ label() }}</span>\n }\n @else {\n @if (withIcon()) {\n <cw-icon [icon]=\"withIcon()\" [label]=\"label()\" [iconSize]=\"iconSize['lg']\"></cw-icon>\n }\n }\n </div>\n }\n </div>\n\n <cw-button [isDisabled]=\"isDisabled() || amount() >= ceil()\" [label]=\"'Augmenter ' + amount() + ' ' + label()\"\n [withIcon]=\"spriteIcon.toolbarPlus\" [withOnlyIcon]=\"true\" [type]=\"buttonType.primary\"\n [iconSize]=\"buttonIconSize.small\" (btnAction)=\"increaseAmount()\">\n </cw-button>\n </div>\n</div>\n", dependencies: [{ kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "component", type: IconComponent, selector: "cw-icon", inputs: ["icon", "label", "type", "iconSize", "iconCssClass", "iconUiType", "iconColorCustom", "spritePath"] }, { kind: "component", type: ButtonComponent, selector: "cw-button", inputs: ["type", "label", "id", "link", "isDropdown", "hideCaret", "withIcon", "withOnlyIcon", "iconSize", "iconPosition", "dropdownPosition", "isMinWidth", "isDisabled", "isLoading", "cssClass", "dataTest", "skeletonMode", "withTooltip", "tooltipText", "tooltipTitle", "tooltipTrigger", "tooltipPosition", "tooltipType"], outputs: ["btnAction", "dropDownClicked"] }] }); }
3003
3932
  }
3004
3933
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: NumericalRangeComponent, decorators: [{
3005
3934
  type: Component,
@@ -3084,6 +4013,26 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.20", ngImpo
3084
4013
  ], template: "<p class=\"field-required text-end\">\r\n @if (allFieldsRequired()) {\r\n Tous les champs sont obligatoires.\r\n }\r\n @else {\r\n <span class=\"text-danger\">*</span>&nbsp;champs obligatoires\r\n }\r\n</p>\r\n" }]
3085
4014
  }], propDecorators: { allFieldsRequired: [{ type: i0.Input, args: [{ isSignal: true, alias: "allFieldsRequired", required: false }] }] } });
3086
4015
 
4016
+ class BreadcrumbComponent {
4017
+ constructor() {
4018
+ this.items = input([], ...(ngDevMode ? [{ debugName: "items" }] : []));
4019
+ this.ariaLabel = input('_COMMON._BREADCRUMB.NAV_LABEL', ...(ngDevMode ? [{ debugName: "ariaLabel" }] : []));
4020
+ }
4021
+ isClickable(item) {
4022
+ return !!item.link && item.isCurrent !== true;
4023
+ }
4024
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: BreadcrumbComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
4025
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.20", type: BreadcrumbComponent, isStandalone: true, selector: "cw-breadcrumb", inputs: { items: { classPropertyName: "items", publicName: "items", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "@if (items().length > 0) {\n <nav class=\"breadcrumb\" [attr.aria-label]=\"ariaLabel() | translate\">\n <ol class=\"breadcrumb-list list-unstyled d-flex-h mb-0\">\n @for (item of items(); track $index; let first = $first) {\n <li\n class=\"breadcrumb-item\"\n [class.breadcrumb-item-home]=\"first\"\n [class.active]=\"item.isCurrent === true\"\n >\n @if (isClickable(item)) {\n <a class=\"breadcrumb-link\" [routerLink]=\"item.link\">{{ item.label | translate }}</a>\n } @else {\n <span\n class=\"breadcrumb-text\"\n [attr.aria-current]=\"item.isCurrent === true ? 'page' : null\"\n >{{ item.label | translate }}</span>\n }\n </li>\n }\n </ol>\n </nav>\n}\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "ngmodule", type: TranslateModule }, { kind: "pipe", type: i2.TranslatePipe, name: "translate" }] }); }
4026
+ }
4027
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: BreadcrumbComponent, decorators: [{
4028
+ type: Component,
4029
+ args: [{ selector: 'cw-breadcrumb', standalone: true, imports: [
4030
+ CommonModule,
4031
+ RouterLink,
4032
+ TranslateModule
4033
+ ], template: "@if (items().length > 0) {\n <nav class=\"breadcrumb\" [attr.aria-label]=\"ariaLabel() | translate\">\n <ol class=\"breadcrumb-list list-unstyled d-flex-h mb-0\">\n @for (item of items(); track $index; let first = $first) {\n <li\n class=\"breadcrumb-item\"\n [class.breadcrumb-item-home]=\"first\"\n [class.active]=\"item.isCurrent === true\"\n >\n @if (isClickable(item)) {\n <a class=\"breadcrumb-link\" [routerLink]=\"item.link\">{{ item.label | translate }}</a>\n } @else {\n <span\n class=\"breadcrumb-text\"\n [attr.aria-current]=\"item.isCurrent === true ? 'page' : null\"\n >{{ item.label | translate }}</span>\n }\n </li>\n }\n </ol>\n </nav>\n}\n" }]
4034
+ }], propDecorators: { items: [{ type: i0.Input, args: [{ isSignal: true, alias: "items", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }] } });
4035
+
3087
4036
  var PlacementEnum;
3088
4037
  (function (PlacementEnum) {
3089
4038
  PlacementEnum["Left"] = "left";
@@ -3101,5 +4050,5 @@ var PlacementEnum;
3101
4050
  * Generated bundle index. Do not edit.
3102
4051
  */
3103
4052
 
3104
- export { AccordionComponent, AlertComponent, AlertTypeEnum, BadgeComponent, BadgePositionEnum, BadgeTypeEnum, BoButtonTypeEnum, BoTabTypeEnum, ButtonComponent, ButtonIconSizeEnum, ButtonPositionEnum, CardComponent, CardTitleRankEnum, CardTypeEnum, ClickOutsideDirective, CollapseDirective, DropdownComponent, DropdownItemDirective, DropdownPositionEnum, FileToDownloadComponent, FoButtonTypeEnum, FoTabTypeEnum, FocusTrackerService, FormFieldComponent, FormFieldTypeEnum, IconComponent, IconNotifSizeEnum, IconNotifTypeEnum, IconNotificationComponent, IconSizeEnum, IconTypeEnum, IconUiTypeEnum, ImageComponent, LegendComponent, LegendTypeEnum, LoaderComponent, ModalsComponent, ModalsService, ModalsSize, ModalsType, NumericalRangeComponent, NumericalRangeLabelPositionEnum, NumericalRangeTypeEnum, PlacementEnum, RequiredInfoComponent, ResponsiveService, SkipLinksComponent, SpriteIconEnum, StepperComponent, TOAST_AUTOHIDE_DELAY_MS, TabComponent, TabContentComponent, TitleComponent, TitleContextEnum, TitleTagEnum, ToastComponent, ToastItemComponent, ToastService, TriggerTooltipEnum, TypeTooltipEnum, WizardStepComponent, WizardStepperComponent, rangeValidator };
4053
+ export { AccordionComponent, AlertComponent, AlertTypeEnum, AutocompleteComponent, BadgeComponent, BadgePositionEnum, BadgeTypeEnum, BoButtonTypeEnum, BoTabTypeEnum, BreadcrumbComponent, ButtonComponent, ButtonIconSizeEnum, ButtonPositionEnum, CardComponent, CardTitleRankEnum, CardTypeEnum, ClickOutsideDirective, CollapseDirective, DropdownComponent, DropdownItemDirective, DropdownPositionEnum, FileToDownloadComponent, FoButtonTypeEnum, FoTabTypeEnum, FocusTrackerService, FormFieldComponent, FormFieldTypeEnum, IconComponent, IconNotifSizeEnum, IconNotifTypeEnum, IconNotificationComponent, IconSizeEnum, IconTypeEnum, IconUiTypeEnum, ImageComponent, LegendComponent, LegendTypeEnum, LoaderComponent, ModalsComponent, ModalsService, ModalsSize, ModalsType, NumericalRangeComponent, NumericalRangeLabelPositionEnum, NumericalRangeTypeEnum, PlacementEnum, RequiredInfoComponent, ResponsiveService, SkipLinksComponent, SpriteIconEnum, StepperComponent, TOAST_AUTOHIDE_DELAY_MS, TabComponent, TabContentComponent, TitleComponent, TitleContextEnum, TitleTagEnum, ToastComponent, ToastItemComponent, ToastService, TriggerTooltipEnum, TypeTooltipEnum, WizardStepComponent, WizardStepperComponent, rangeValidator };
3105
4054
  //# sourceMappingURL=cityway-basic-ui.mjs.map