@cityway/basic-ui 1.1.0-beta030 → 1.1.0-beta031

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 (109) hide show
  1. package/cityway-basic-ui-1.1.0-beta031.tgz +0 -0
  2. package/docs/00-overview.md +2 -2
  3. package/docs/MIGRATION.md +239 -0
  4. package/docs/components/card.md +2 -2
  5. package/docs/components/skiplinks.md +122 -122
  6. package/docs/styles-fo.md +144 -0
  7. package/fesm2022/cityway-basic-ui-slider-field.component-DNoKU63R.mjs +35 -0
  8. package/fesm2022/cityway-basic-ui-slider-field.component-DNoKU63R.mjs.map +1 -0
  9. package/fesm2022/cityway-basic-ui.mjs +146 -136
  10. package/fesm2022/cityway-basic-ui.mjs.map +1 -1
  11. package/index.d.ts +7 -1
  12. package/lib/styles/scss/_reboot.scss +484 -0
  13. package/lib/styles/scss/_root-bo.scss +123 -0
  14. package/lib/styles/scss/_root-fo.scss +316 -0
  15. package/lib/styles/scss/basic-ui.styles.bo.scss +73 -0
  16. package/lib/styles/scss/basic-ui.styles.fo.scss +84 -0
  17. package/lib/styles/scss/components/_accordion.scss +76 -0
  18. package/lib/styles/scss/components/_breadcrumb.scss +58 -0
  19. package/lib/styles/scss/components/_btn-collapse.scss +31 -0
  20. package/lib/styles/scss/components/_card.scss +222 -0
  21. package/lib/styles/scss/components/_close.scss +23 -0
  22. package/lib/styles/scss/components/_divider.scss +18 -0
  23. package/lib/styles/scss/components/_dropdown.scss +127 -0
  24. package/lib/styles/scss/components/_empty-state.scss +50 -0
  25. package/lib/styles/scss/components/_file-drop.scss +234 -0
  26. package/lib/styles/scss/components/_file-preview.scss +94 -0
  27. package/lib/styles/scss/components/_file-to-download.scss +77 -0
  28. package/lib/styles/scss/components/_modal.scss +363 -0
  29. package/lib/styles/scss/components/_numerical-range.scss +60 -0
  30. package/lib/styles/scss/components/_overlay-cdk.scss +7 -0
  31. package/lib/styles/scss/components/_selector-menu.scss +39 -0
  32. package/lib/styles/scss/components/_skip-links.scss +27 -0
  33. package/lib/styles/scss/components/_stepper.scss +58 -0
  34. package/lib/styles/scss/components/_toast.scss +39 -0
  35. package/lib/styles/scss/components/_tooltip.scss +44 -0
  36. package/lib/styles/scss/components/alert/_alert-bo-variant.scss +38 -0
  37. package/lib/styles/scss/components/alert/_alert-fo-variant.scss +29 -0
  38. package/lib/styles/scss/components/alert/_alert.scss +87 -0
  39. package/lib/styles/scss/components/badge/_badge-bo-variant.scss +39 -0
  40. package/lib/styles/scss/components/badge/_badge-fo-variant.scss +77 -0
  41. package/lib/styles/scss/components/badge/_badge.scss +47 -0
  42. package/lib/styles/scss/components/button/_button-bo-variant.scss +102 -0
  43. package/lib/styles/scss/components/button/_button-fo-variant.scss +74 -0
  44. package/lib/styles/scss/components/button/_button.scss +178 -0
  45. package/lib/styles/scss/components/form-field/_autocomplete.scss +108 -0
  46. package/lib/styles/scss/components/form-field/_field-check.scss +255 -0
  47. package/lib/styles/scss/components/form-field/_field-group-btn-bo.scss +80 -0
  48. package/lib/styles/scss/components/form-field/_form-field.scss +312 -0
  49. package/lib/styles/scss/components/form-field/_ng-select.scss +172 -0
  50. package/lib/styles/scss/components/form-field/_phone.scss +12 -0
  51. package/lib/styles/scss/components/form-field/_rich-text-editor.scss +105 -0
  52. package/lib/styles/scss/components/form-field/_slider-range.scss +68 -0
  53. package/lib/styles/scss/components/icon/_icon-bo-variant.scss +38 -0
  54. package/lib/styles/scss/components/icon/_icon-fo-variant.scss +22 -0
  55. package/lib/styles/scss/components/icon/_icon.scss +146 -0
  56. package/lib/styles/scss/components/tab/_tab-bo.scss +165 -0
  57. package/lib/styles/scss/components/tab/_tab-fo.scss +83 -0
  58. package/lib/styles/scss/extras/_ng-select.scss +4 -0
  59. package/lib/styles/scss/extras/_phone.scss +4 -0
  60. package/lib/styles/scss/extras/_slider.scss +2 -0
  61. package/lib/styles/scss/fo/_breakpoints.scss +15 -0
  62. package/lib/styles/scss/fo/_card-icon.scss +21 -0
  63. package/lib/styles/scss/fo/_disclosure.scss +47 -0
  64. package/lib/styles/scss/fo/_form.scss +14 -0
  65. package/lib/styles/scss/fo/_illustration.scss +34 -0
  66. package/lib/styles/scss/fo/_layout-sidenav.scss +100 -0
  67. package/lib/styles/scss/fo/_motifs.scss +11 -0
  68. package/lib/styles/scss/fo/_page-head.scss +119 -0
  69. package/lib/styles/scss/fo/_page.scss +38 -0
  70. package/lib/styles/scss/fo/_patterns.scss +25 -0
  71. package/lib/styles/scss/fo/_site-header.scss +125 -0
  72. package/lib/styles/scss/fo/_tile.scss +68 -0
  73. package/lib/styles/scss/fo/_typography.scss +53 -0
  74. package/lib/styles/scss/fo/_utilities.scss +54 -0
  75. package/lib/styles/scss/helpers/_skeleton.scss +67 -0
  76. package/lib/styles/scss/helpers/_spinner.scss +60 -0
  77. package/lib/styles/scss/helpers/_stretched-link.scss +9 -0
  78. package/lib/styles/scss/helpers/_visually-hidden.scss +18 -0
  79. package/lib/styles/scss/mixins/_color.scss +16 -0
  80. package/lib/styles/scss/mixins/_flex.scss +25 -0
  81. package/lib/styles/scss/mixins/_popover-tooltip.scss +191 -0
  82. package/lib/styles/scss/mixins/_root.scss +26 -0
  83. package/lib/styles/scss/mixins/_spacing.scss +84 -0
  84. package/lib/styles/scss/mixins/_type.scss +62 -0
  85. package/lib/styles/scss/utilities/_alignment.scss +29 -0
  86. package/lib/styles/scss/utilities/_border.scss +23 -0
  87. package/lib/styles/scss/utilities/_breakpoints.scss +30 -0
  88. package/lib/styles/scss/utilities/_flex.scss +161 -0
  89. package/lib/styles/scss/utilities/_grid.scss +82 -0
  90. package/lib/styles/scss/utilities/_position.scss +24 -0
  91. package/lib/styles/scss/utilities/_scrollbar.scss +40 -0
  92. package/lib/styles/scss/utilities/_spacing.scss +3 -0
  93. package/lib/styles/scss/utilities/type/_type-bo.scss +40 -0
  94. package/lib/styles/scss/utilities/type/_type-fo.scss +132 -0
  95. package/lib/styles/scss/utilities/type/_type.scss +39 -0
  96. package/package.json +2 -2
  97. package/styles/basic-ui.styles.bo.min.css +2 -2
  98. package/styles/basic-ui.styles.bo.min.css.map +1 -1
  99. package/styles/basic-ui.styles.fo-ng-select.min.css +1 -0
  100. package/styles/basic-ui.styles.fo-ng-select.min.css.map +1 -0
  101. package/styles/basic-ui.styles.fo-patterns.min.css +1 -0
  102. package/styles/basic-ui.styles.fo-patterns.min.css.map +1 -0
  103. package/styles/basic-ui.styles.fo-phone.min.css +1 -0
  104. package/styles/basic-ui.styles.fo-phone.min.css.map +1 -0
  105. package/styles/basic-ui.styles.fo-slider.min.css +1 -0
  106. package/styles/basic-ui.styles.fo-slider.min.css.map +1 -0
  107. package/styles/basic-ui.styles.fo.min.css +1 -1
  108. package/styles/basic-ui.styles.fo.min.css.map +1 -1
  109. package/cityway-basic-ui-1.1.0-beta030.tgz +0 -0
@@ -11,16 +11,8 @@ import { ComponentPortal } from '@angular/cdk/portal';
11
11
  import { Overlay, OverlayPositionBuilder } from '@angular/cdk/overlay';
12
12
  import { BehaviorSubject, fromEvent, tap, filter, debounce, timer, switchMap, catchError, of } from 'rxjs';
13
13
  import { map, distinctUntilChanged } from 'rxjs/operators';
14
- import * as i4 from '@angular-slider/ngx-slider';
15
- import { NgxSliderModule } from '@angular-slider/ngx-slider';
16
- export { Options } from '@angular-slider/ngx-slider';
17
14
  import * as i2$1 from '@angular/forms';
18
15
  import { FormControl, ReactiveFormsModule, FormGroup, Validators, FormsModule, NG_VALUE_ACCESSOR } from '@angular/forms';
19
- import intlTelInput from 'intl-tel-input';
20
- import itiEn from 'intl-tel-input/dist/js/i18n/en.js';
21
- import itiFr from 'intl-tel-input/dist/js/i18n/fr.js';
22
- import * as i3 from '@ng-select/ng-select';
23
- import { NgSelectComponent, NgSelectModule } from '@ng-select/ng-select';
24
16
 
25
17
  class CollapseDirective {
26
18
  constructor() {
@@ -851,7 +843,7 @@ class CardComponent {
851
843
  return this.isCollapsed();
852
844
  }
853
845
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: CardComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
854
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.20", type: CardComponent, isStandalone: true, selector: "cw-card", inputs: { title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: false, transformFunction: null }, titleParams: { classPropertyName: "titleParams", publicName: "titleParams", isSignal: true, isRequired: false, transformFunction: null }, translateTitle: { classPropertyName: "translateTitle", publicName: "translateTitle", isSignal: true, isRequired: false, transformFunction: null }, titleId: { classPropertyName: "titleId", publicName: "titleId", isSignal: true, isRequired: false, transformFunction: null }, subtitle: { classPropertyName: "subtitle", publicName: "subtitle", isSignal: true, isRequired: false, transformFunction: null }, subtitleKey: { classPropertyName: "subtitleKey", publicName: "subtitleKey", isSignal: true, isRequired: false, transformFunction: null }, subtitleParams: { classPropertyName: "subtitleParams", publicName: "subtitleParams", isSignal: true, isRequired: false, transformFunction: null }, truncateSubtitle: { classPropertyName: "truncateSubtitle", publicName: "truncateSubtitle", isSignal: true, isRequired: false, transformFunction: null }, type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: false, transformFunction: null }, titleRank: { classPropertyName: "titleRank", publicName: "titleRank", isSignal: true, isRequired: false, transformFunction: null }, cssClass: { classPropertyName: "cssClass", publicName: "cssClass", isSignal: true, isRequired: false, transformFunction: null }, collapsible: { classPropertyName: "collapsible", publicName: "collapsible", isSignal: true, isRequired: false, transformFunction: null }, collapsed: { classPropertyName: "collapsed", publicName: "collapsed", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, collapseLocked: { classPropertyName: "collapseLocked", publicName: "collapseLocked", isSignal: true, isRequired: false, transformFunction: null }, collapseStretched: { classPropertyName: "collapseStretched", publicName: "collapseStretched", isSignal: true, isRequired: false, transformFunction: null }, collapseId: { classPropertyName: "collapseId", publicName: "collapseId", isSignal: true, isRequired: false, transformFunction: null }, destroyOnHide: { classPropertyName: "destroyOnHide", publicName: "destroyOnHide", isSignal: true, isRequired: false, transformFunction: null }, fullHeight: { classPropertyName: "fullHeight", publicName: "fullHeight", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { collapsible: "collapsibleChange", destroyOnHide: "destroyOnHideChange", collapseClicked: "collapseClicked" }, host: { properties: { "class.card-full-height": "fullHeight()" } }, viewQueries: [{ propertyName: "collapseDirective", first: true, predicate: ["collapse"], descendants: true, isSignal: true }, { propertyName: "cardFooter", first: true, predicate: ["cardFooter"], descendants: true, isSignal: true }, { propertyName: "cardHeader", first: true, predicate: ["cardHeader"], descendants: true, isSignal: true }], ngImport: i0, template: "<div class=\"card\" [ngClass]=\"cssClass()\" [class.card-collapse]=\"collapsible()\" [class.card-disabled]=\"collapsible() && disabled()\" [class.card-light]=\"type() === typeEnum.light\">\r\n <!-- Toujours dans le DOM (masque si vide) : un slot d'en-tete rempli apres coup doit pouvoir s'y projeter. -->\r\n <div #cardHeader class=\"card-header\" [class.d-none]=\"!hasHeader()\" [class.card-header-collapse]=\"collapsible()\"\r\n [class.card-header-collapsed]=\"collapsible() && isCollapsed()\">\r\n <ng-container *ngTemplateOutlet=\"header\"></ng-container>\r\n </div>\r\n\r\n @if(collapsible()) {\r\n <div [cwCollapse]=\"isCollapsed()\" [id]=\"collapseId()\" #collapse=\"cwCollapse\">\r\n <ng-container *ngTemplateOutlet=\"content\"></ng-container>\r\n </div>\r\n }\r\n @else {\r\n <ng-container *ngTemplateOutlet=\"content\"></ng-container>\r\n }\r\n</div>\r\n\r\n<ng-template #header>\r\n <ng-content select=\"[header-start]\"></ng-content>\r\n\r\n <div class=\"card-header-content\">\r\n @if (title(); as title) {\r\n @let titleText = translateTitle() ? (title | translate: titleParams()) : title;\r\n @if (titleRank() === titleRankEnum.h2) {\r\n <h2 class=\"text-truncate\" [id]=\"titleId()\">{{ titleText }}</h2>\r\n }\r\n @else if (titleRank() === titleRankEnum.h3) {\r\n <h3 class=\"text-truncate\" [id]=\"titleId()\">{{ titleText }}</h3>\r\n }\r\n }\r\n\r\n @if (subtitleKey(); as subtitleKey) {\r\n <div class=\"card-subtitle fs fs-xs text-light\" [class.text-truncate]=\"truncateSubtitle()\">{{ subtitleKey | translate: subtitleParams() }}</div>\r\n }\r\n @else if (subtitle(); as subtitle) {\r\n <div class=\"card-subtitle fs fs-xs text-light\" [class.text-truncate]=\"truncateSubtitle()\">{{ subtitle }}</div>\r\n }\r\n </div>\r\n\r\n <div class=\"card-header-custom-area\">\r\n <ng-content select=\"[header-custom-area]\"></ng-content>\r\n </div>\r\n\r\n <!-- collapseLocked : pas de chevron, donc pas de stretched-link -> en-tete non cliquable,\r\n sans passer par `disabled` (qui grise titre et sous-titre). -->\r\n @if (collapsible() && !collapseLocked()) {\r\n <button type=\"button\" class=\"btn btn-collapse\" [class.stretched-link]=\"collapseStretched() && !disabled()\"\r\n (click)=\"toggleCollapse()\" [disabled]=\"disabled()\" [attr.aria-disabled]=\"disabled()\"\r\n [attr.aria-expanded]=\"!isCollapsed()\" [class.collapsed]=\"isCollapsed()\" [attr.aria-controls]=\"collapseId()\">\r\n <cw-icon [icon]=\"spriteIcon.up\" [iconSize]=\"iconSize['xs']\"></cw-icon>\r\n <span class=\"visually-hidden\">{{ '_COMMON._ACTION.EXPAND_COLLAPSE' | translate }}</span>\r\n </button>\r\n }\r\n</ng-template>\r\n\r\n<ng-template #content>\r\n @if (shouldRenderBody()) {\r\n <!-- Listes pleine largeur, avant (`[card-list-top]`) ou apres (`[card-list-bottom]`) le corps :\r\n une ligne par enfant direct, separees par une bordure. -->\r\n <ng-content select=\"[card-list-top]\"></ng-content>\r\n\r\n <div class=\"card-body\">\r\n <ng-content></ng-content>\r\n </div>\r\n\r\n <ng-content select=\"[card-list-bottom]\"></ng-content>\r\n\r\n <div class=\"card-footer\" #cardFooter [class.d-none]=\"!showFooter()\">\r\n <ng-content select=\"[card-footer]\"></ng-content>\r\n </div>\r\n }\r\n</ng-template>\r\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: CollapseDirective, selector: "[cwCollapse]", inputs: ["cwCollapse"], outputs: ["cwCollapseChange", "shown", "hidden"], exportAs: ["cwCollapse"] }, { kind: "component", type: IconComponent, selector: "cw-icon", inputs: ["icon", "text", "label", "type", "iconSize", "iconCssClass", "iconUiType", "iconColorCustom", "spritePath"] }, { kind: "pipe", type: TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
846
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.20", type: CardComponent, isStandalone: true, selector: "cw-card", inputs: { title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: false, transformFunction: null }, titleParams: { classPropertyName: "titleParams", publicName: "titleParams", isSignal: true, isRequired: false, transformFunction: null }, translateTitle: { classPropertyName: "translateTitle", publicName: "translateTitle", isSignal: true, isRequired: false, transformFunction: null }, titleId: { classPropertyName: "titleId", publicName: "titleId", isSignal: true, isRequired: false, transformFunction: null }, subtitle: { classPropertyName: "subtitle", publicName: "subtitle", isSignal: true, isRequired: false, transformFunction: null }, subtitleKey: { classPropertyName: "subtitleKey", publicName: "subtitleKey", isSignal: true, isRequired: false, transformFunction: null }, subtitleParams: { classPropertyName: "subtitleParams", publicName: "subtitleParams", isSignal: true, isRequired: false, transformFunction: null }, truncateSubtitle: { classPropertyName: "truncateSubtitle", publicName: "truncateSubtitle", isSignal: true, isRequired: false, transformFunction: null }, type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: false, transformFunction: null }, titleRank: { classPropertyName: "titleRank", publicName: "titleRank", isSignal: true, isRequired: false, transformFunction: null }, cssClass: { classPropertyName: "cssClass", publicName: "cssClass", isSignal: true, isRequired: false, transformFunction: null }, collapsible: { classPropertyName: "collapsible", publicName: "collapsible", isSignal: true, isRequired: false, transformFunction: null }, collapsed: { classPropertyName: "collapsed", publicName: "collapsed", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, collapseLocked: { classPropertyName: "collapseLocked", publicName: "collapseLocked", isSignal: true, isRequired: false, transformFunction: null }, collapseStretched: { classPropertyName: "collapseStretched", publicName: "collapseStretched", isSignal: true, isRequired: false, transformFunction: null }, collapseId: { classPropertyName: "collapseId", publicName: "collapseId", isSignal: true, isRequired: false, transformFunction: null }, destroyOnHide: { classPropertyName: "destroyOnHide", publicName: "destroyOnHide", isSignal: true, isRequired: false, transformFunction: null }, fullHeight: { classPropertyName: "fullHeight", publicName: "fullHeight", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { collapsible: "collapsibleChange", destroyOnHide: "destroyOnHideChange", collapseClicked: "collapseClicked" }, host: { properties: { "class.card-full-height": "fullHeight()" } }, viewQueries: [{ propertyName: "collapseDirective", first: true, predicate: ["collapse"], descendants: true, isSignal: true }, { propertyName: "cardFooter", first: true, predicate: ["cardFooter"], descendants: true, isSignal: true }, { propertyName: "cardHeader", first: true, predicate: ["cardHeader"], descendants: true, isSignal: true }], ngImport: i0, template: "<div class=\"card\" [ngClass]=\"cssClass()\" [class.card-collapse]=\"collapsible()\" [class.card-disabled]=\"collapsible() && disabled()\" [class.card-light]=\"type() === typeEnum.light\">\r\n <!-- Toujours dans le DOM (masque si vide) : un slot d'en-tete rempli apres coup doit pouvoir s'y projeter. -->\r\n <div #cardHeader class=\"card-header\" [class.d-none]=\"!hasHeader()\" [class.card-header-collapse]=\"collapsible()\"\r\n [class.card-header-collapsed]=\"collapsible() && isCollapsed()\">\r\n <ng-container *ngTemplateOutlet=\"header\"></ng-container>\r\n </div>\r\n\r\n @if(collapsible()) {\r\n <div [cwCollapse]=\"isCollapsed()\" [id]=\"collapseId()\" #collapse=\"cwCollapse\">\r\n <ng-container *ngTemplateOutlet=\"content\"></ng-container>\r\n </div>\r\n }\r\n @else {\r\n <ng-container *ngTemplateOutlet=\"content\"></ng-container>\r\n }\r\n</div>\r\n\r\n<ng-template #header>\r\n <ng-content select=\"[header-start]\"></ng-content>\r\n\r\n <div class=\"card-header-content\">\r\n @if (title(); as title) {\r\n @let titleText = translateTitle() ? (title | translate: titleParams()) : title;\r\n @if (titleRank() === titleRankEnum.h2) {\r\n <h2 class=\"text-truncate\" [id]=\"titleId()\">{{ titleText }}</h2>\r\n }\r\n @else if (titleRank() === titleRankEnum.h3) {\r\n <h3 class=\"text-truncate\" [id]=\"titleId()\">{{ titleText }}</h3>\r\n }\r\n }\r\n\r\n @if (subtitleKey(); as subtitleKey) {\r\n <div class=\"card-subtitle fs fs-xs text-light\" [class.text-truncate]=\"truncateSubtitle()\">{{ subtitleKey | translate: subtitleParams() }}</div>\r\n }\r\n @else if (subtitle(); as subtitle) {\r\n <div class=\"card-subtitle fs fs-xs text-light\" [class.text-truncate]=\"truncateSubtitle()\">{{ subtitle }}</div>\r\n }\r\n </div>\r\n\r\n <div class=\"card-header-custom-area\">\r\n <ng-content select=\"[header-custom-area]\"></ng-content>\r\n </div>\r\n\r\n <!-- collapseLocked : pas de chevron, donc pas de stretched-link -> en-tete non cliquable,\r\n sans passer par `disabled` (qui grise titre et sous-titre). -->\r\n @if (collapsible() && !collapseLocked()) {\r\n <button type=\"button\" class=\"btn btn-collapse\" [class.stretched-link]=\"collapseStretched() && !disabled()\"\r\n (click)=\"toggleCollapse()\" [disabled]=\"disabled()\" [attr.aria-disabled]=\"disabled()\"\r\n [attr.aria-expanded]=\"!isCollapsed()\" [class.collapsed]=\"isCollapsed()\" [attr.aria-controls]=\"collapseId()\">\r\n <!-- Deux pictos, un seul visible selon le theme (jetons --cw-btn-collapse-*-display) : chevron par defaut,\r\n \u00AB + \u00BB / \u00AB \u2212 \u00BB pour l'accordion FO. -->\r\n <cw-icon class=\"btn-collapse-chevron\" [icon]=\"spriteIcon.up\" [iconSize]=\"iconSize['xs']\"></cw-icon>\r\n <cw-icon class=\"btn-collapse-toggle\" [icon]=\"isCollapsed() ? spriteIcon.toolbarPlus : spriteIcon.toolbarMinus\" [iconSize]=\"iconSize['sm']\"></cw-icon>\r\n <span class=\"visually-hidden\">{{ '_COMMON._ACTION.EXPAND_COLLAPSE' | translate }}</span>\r\n </button>\r\n }\r\n</ng-template>\r\n\r\n<ng-template #content>\r\n @if (shouldRenderBody()) {\r\n <!-- Listes pleine largeur, avant (`[card-list-top]`) ou apres (`[card-list-bottom]`) le corps :\r\n une ligne par enfant direct, separees par une bordure. -->\r\n <ng-content select=\"[card-list-top]\"></ng-content>\r\n\r\n <div class=\"card-body\">\r\n <ng-content></ng-content>\r\n </div>\r\n\r\n <ng-content select=\"[card-list-bottom]\"></ng-content>\r\n\r\n <div class=\"card-footer\" #cardFooter [class.d-none]=\"!showFooter()\">\r\n <ng-content select=\"[card-footer]\"></ng-content>\r\n </div>\r\n }\r\n</ng-template>\r\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: CollapseDirective, selector: "[cwCollapse]", inputs: ["cwCollapse"], outputs: ["cwCollapseChange", "shown", "hidden"], exportAs: ["cwCollapse"] }, { kind: "component", type: IconComponent, selector: "cw-icon", inputs: ["icon", "text", "label", "type", "iconSize", "iconCssClass", "iconUiType", "iconColorCustom", "spritePath"] }, { kind: "pipe", type: TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
855
847
  }
856
848
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: CardComponent, decorators: [{
857
849
  type: Component,
@@ -862,7 +854,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.20", ngImpo
862
854
  CollapseDirective,
863
855
  IconComponent,
864
856
  TranslatePipe
865
- ], template: "<div class=\"card\" [ngClass]=\"cssClass()\" [class.card-collapse]=\"collapsible()\" [class.card-disabled]=\"collapsible() && disabled()\" [class.card-light]=\"type() === typeEnum.light\">\r\n <!-- Toujours dans le DOM (masque si vide) : un slot d'en-tete rempli apres coup doit pouvoir s'y projeter. -->\r\n <div #cardHeader class=\"card-header\" [class.d-none]=\"!hasHeader()\" [class.card-header-collapse]=\"collapsible()\"\r\n [class.card-header-collapsed]=\"collapsible() && isCollapsed()\">\r\n <ng-container *ngTemplateOutlet=\"header\"></ng-container>\r\n </div>\r\n\r\n @if(collapsible()) {\r\n <div [cwCollapse]=\"isCollapsed()\" [id]=\"collapseId()\" #collapse=\"cwCollapse\">\r\n <ng-container *ngTemplateOutlet=\"content\"></ng-container>\r\n </div>\r\n }\r\n @else {\r\n <ng-container *ngTemplateOutlet=\"content\"></ng-container>\r\n }\r\n</div>\r\n\r\n<ng-template #header>\r\n <ng-content select=\"[header-start]\"></ng-content>\r\n\r\n <div class=\"card-header-content\">\r\n @if (title(); as title) {\r\n @let titleText = translateTitle() ? (title | translate: titleParams()) : title;\r\n @if (titleRank() === titleRankEnum.h2) {\r\n <h2 class=\"text-truncate\" [id]=\"titleId()\">{{ titleText }}</h2>\r\n }\r\n @else if (titleRank() === titleRankEnum.h3) {\r\n <h3 class=\"text-truncate\" [id]=\"titleId()\">{{ titleText }}</h3>\r\n }\r\n }\r\n\r\n @if (subtitleKey(); as subtitleKey) {\r\n <div class=\"card-subtitle fs fs-xs text-light\" [class.text-truncate]=\"truncateSubtitle()\">{{ subtitleKey | translate: subtitleParams() }}</div>\r\n }\r\n @else if (subtitle(); as subtitle) {\r\n <div class=\"card-subtitle fs fs-xs text-light\" [class.text-truncate]=\"truncateSubtitle()\">{{ subtitle }}</div>\r\n }\r\n </div>\r\n\r\n <div class=\"card-header-custom-area\">\r\n <ng-content select=\"[header-custom-area]\"></ng-content>\r\n </div>\r\n\r\n <!-- collapseLocked : pas de chevron, donc pas de stretched-link -> en-tete non cliquable,\r\n sans passer par `disabled` (qui grise titre et sous-titre). -->\r\n @if (collapsible() && !collapseLocked()) {\r\n <button type=\"button\" class=\"btn btn-collapse\" [class.stretched-link]=\"collapseStretched() && !disabled()\"\r\n (click)=\"toggleCollapse()\" [disabled]=\"disabled()\" [attr.aria-disabled]=\"disabled()\"\r\n [attr.aria-expanded]=\"!isCollapsed()\" [class.collapsed]=\"isCollapsed()\" [attr.aria-controls]=\"collapseId()\">\r\n <cw-icon [icon]=\"spriteIcon.up\" [iconSize]=\"iconSize['xs']\"></cw-icon>\r\n <span class=\"visually-hidden\">{{ '_COMMON._ACTION.EXPAND_COLLAPSE' | translate }}</span>\r\n </button>\r\n }\r\n</ng-template>\r\n\r\n<ng-template #content>\r\n @if (shouldRenderBody()) {\r\n <!-- Listes pleine largeur, avant (`[card-list-top]`) ou apres (`[card-list-bottom]`) le corps :\r\n une ligne par enfant direct, separees par une bordure. -->\r\n <ng-content select=\"[card-list-top]\"></ng-content>\r\n\r\n <div class=\"card-body\">\r\n <ng-content></ng-content>\r\n </div>\r\n\r\n <ng-content select=\"[card-list-bottom]\"></ng-content>\r\n\r\n <div class=\"card-footer\" #cardFooter [class.d-none]=\"!showFooter()\">\r\n <ng-content select=\"[card-footer]\"></ng-content>\r\n </div>\r\n }\r\n</ng-template>\r\n" }]
857
+ ], template: "<div class=\"card\" [ngClass]=\"cssClass()\" [class.card-collapse]=\"collapsible()\" [class.card-disabled]=\"collapsible() && disabled()\" [class.card-light]=\"type() === typeEnum.light\">\r\n <!-- Toujours dans le DOM (masque si vide) : un slot d'en-tete rempli apres coup doit pouvoir s'y projeter. -->\r\n <div #cardHeader class=\"card-header\" [class.d-none]=\"!hasHeader()\" [class.card-header-collapse]=\"collapsible()\"\r\n [class.card-header-collapsed]=\"collapsible() && isCollapsed()\">\r\n <ng-container *ngTemplateOutlet=\"header\"></ng-container>\r\n </div>\r\n\r\n @if(collapsible()) {\r\n <div [cwCollapse]=\"isCollapsed()\" [id]=\"collapseId()\" #collapse=\"cwCollapse\">\r\n <ng-container *ngTemplateOutlet=\"content\"></ng-container>\r\n </div>\r\n }\r\n @else {\r\n <ng-container *ngTemplateOutlet=\"content\"></ng-container>\r\n }\r\n</div>\r\n\r\n<ng-template #header>\r\n <ng-content select=\"[header-start]\"></ng-content>\r\n\r\n <div class=\"card-header-content\">\r\n @if (title(); as title) {\r\n @let titleText = translateTitle() ? (title | translate: titleParams()) : title;\r\n @if (titleRank() === titleRankEnum.h2) {\r\n <h2 class=\"text-truncate\" [id]=\"titleId()\">{{ titleText }}</h2>\r\n }\r\n @else if (titleRank() === titleRankEnum.h3) {\r\n <h3 class=\"text-truncate\" [id]=\"titleId()\">{{ titleText }}</h3>\r\n }\r\n }\r\n\r\n @if (subtitleKey(); as subtitleKey) {\r\n <div class=\"card-subtitle fs fs-xs text-light\" [class.text-truncate]=\"truncateSubtitle()\">{{ subtitleKey | translate: subtitleParams() }}</div>\r\n }\r\n @else if (subtitle(); as subtitle) {\r\n <div class=\"card-subtitle fs fs-xs text-light\" [class.text-truncate]=\"truncateSubtitle()\">{{ subtitle }}</div>\r\n }\r\n </div>\r\n\r\n <div class=\"card-header-custom-area\">\r\n <ng-content select=\"[header-custom-area]\"></ng-content>\r\n </div>\r\n\r\n <!-- collapseLocked : pas de chevron, donc pas de stretched-link -> en-tete non cliquable,\r\n sans passer par `disabled` (qui grise titre et sous-titre). -->\r\n @if (collapsible() && !collapseLocked()) {\r\n <button type=\"button\" class=\"btn btn-collapse\" [class.stretched-link]=\"collapseStretched() && !disabled()\"\r\n (click)=\"toggleCollapse()\" [disabled]=\"disabled()\" [attr.aria-disabled]=\"disabled()\"\r\n [attr.aria-expanded]=\"!isCollapsed()\" [class.collapsed]=\"isCollapsed()\" [attr.aria-controls]=\"collapseId()\">\r\n <!-- Deux pictos, un seul visible selon le theme (jetons --cw-btn-collapse-*-display) : chevron par defaut,\r\n \u00AB + \u00BB / \u00AB \u2212 \u00BB pour l'accordion FO. -->\r\n <cw-icon class=\"btn-collapse-chevron\" [icon]=\"spriteIcon.up\" [iconSize]=\"iconSize['xs']\"></cw-icon>\r\n <cw-icon class=\"btn-collapse-toggle\" [icon]=\"isCollapsed() ? spriteIcon.toolbarPlus : spriteIcon.toolbarMinus\" [iconSize]=\"iconSize['sm']\"></cw-icon>\r\n <span class=\"visually-hidden\">{{ '_COMMON._ACTION.EXPAND_COLLAPSE' | translate }}</span>\r\n </button>\r\n }\r\n</ng-template>\r\n\r\n<ng-template #content>\r\n @if (shouldRenderBody()) {\r\n <!-- Listes pleine largeur, avant (`[card-list-top]`) ou apres (`[card-list-bottom]`) le corps :\r\n une ligne par enfant direct, separees par une bordure. -->\r\n <ng-content select=\"[card-list-top]\"></ng-content>\r\n\r\n <div class=\"card-body\">\r\n <ng-content></ng-content>\r\n </div>\r\n\r\n <ng-content select=\"[card-list-bottom]\"></ng-content>\r\n\r\n <div class=\"card-footer\" #cardFooter [class.d-none]=\"!showFooter()\">\r\n <ng-content select=\"[card-footer]\"></ng-content>\r\n </div>\r\n }\r\n</ng-template>\r\n" }]
866
858
  }], ctorParameters: () => [], propDecorators: { title: [{ type: i0.Input, args: [{ isSignal: true, alias: "title", required: false }] }], titleParams: [{ type: i0.Input, args: [{ isSignal: true, alias: "titleParams", required: false }] }], translateTitle: [{ type: i0.Input, args: [{ isSignal: true, alias: "translateTitle", required: false }] }], titleId: [{ type: i0.Input, args: [{ isSignal: true, alias: "titleId", required: false }] }], subtitle: [{ type: i0.Input, args: [{ isSignal: true, alias: "subtitle", required: false }] }], subtitleKey: [{ type: i0.Input, args: [{ isSignal: true, alias: "subtitleKey", required: false }] }], subtitleParams: [{ type: i0.Input, args: [{ isSignal: true, alias: "subtitleParams", required: false }] }], truncateSubtitle: [{ type: i0.Input, args: [{ isSignal: true, alias: "truncateSubtitle", required: false }] }], type: [{ type: i0.Input, args: [{ isSignal: true, alias: "type", required: false }] }], titleRank: [{ type: i0.Input, args: [{ isSignal: true, alias: "titleRank", required: false }] }], cssClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "cssClass", required: false }] }], collapsible: [{ type: i0.Input, args: [{ isSignal: true, alias: "collapsible", required: false }] }, { type: i0.Output, args: ["collapsibleChange"] }], collapsed: [{ type: i0.Input, args: [{ isSignal: true, alias: "collapsed", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], collapseLocked: [{ type: i0.Input, args: [{ isSignal: true, alias: "collapseLocked", required: false }] }], collapseStretched: [{ type: i0.Input, args: [{ isSignal: true, alias: "collapseStretched", required: false }] }], collapseId: [{ type: i0.Input, args: [{ isSignal: true, alias: "collapseId", required: false }] }], destroyOnHide: [{ type: i0.Input, args: [{ isSignal: true, alias: "destroyOnHide", required: false }] }, { type: i0.Output, args: ["destroyOnHideChange"] }], fullHeight: [{ type: i0.Input, args: [{ isSignal: true, alias: "fullHeight", required: false }] }], collapseClicked: [{ type: i0.Output, args: ["collapseClicked"] }], collapseDirective: [{ type: i0.ViewChild, args: ['collapse', { isSignal: true }] }], cardFooter: [{ type: i0.ViewChild, args: ['cardFooter', { isSignal: true }] }], cardHeader: [{ type: i0.ViewChild, args: ['cardHeader', { isSignal: true }] }] } });
867
859
  /**
868
860
  * Observe les enfants de `el` et appelle `update` a chaque ajout / retrait. Renvoie la fonction
@@ -3680,7 +3672,7 @@ class FormFieldComponent {
3680
3672
  this.phoneInputRef = viewChild('phoneInput', ...(ngDevMode ? [{ debugName: "phoneInputRef" }] : []));
3681
3673
  /** Référence à cw-autocomplete (rendu conditionnellement) — sert au bouton clear externe. */
3682
3674
  this.autocompleteRef = viewChild(AutocompleteComponent, ...(ngDevMode ? [{ debugName: "autocompleteRef" }] : []));
3683
- this.ngSelectRef = viewChild(NgSelectComponent, ...(ngDevMode ? [{ debugName: "ngSelectRef" }] : []));
3675
+ this.ngSelectRef = viewChild('ngSelect', ...(ngDevMode ? [{ debugName: "ngSelectRef" }] : []));
3684
3676
  this.zone = inject(NgZone);
3685
3677
  this.destroyRef = inject(DestroyRef);
3686
3678
  this.translateService = inject(TranslateService);
@@ -3688,6 +3680,8 @@ class FormFieldComponent {
3688
3680
  this.iti = null;
3689
3681
  /** True dès que `intl-tel-input/utils` (libphonenumber-js) est chargé — sans ça, getNumber()/isValidNumber() sont indisponibles. */
3690
3682
  this.utilsReady = false;
3683
+ /** Pose a la destruction : un chargement asynchrone d'intl-tel-input qui se termine apres ne doit rien instancier. */
3684
+ this.destroyed = false;
3691
3685
  /** True si on a ajouté `Validators.required` nous-mêmes — sert à ne retirer que ce qu'on a mis. */
3692
3686
  this.requiredAppliedMain = false;
3693
3687
  this.requiredAppliedStart = false;
@@ -4247,6 +4241,7 @@ class FormFieldComponent {
4247
4241
  }
4248
4242
  }
4249
4243
  ngOnDestroy() {
4244
+ this.destroyed = true;
4250
4245
  this.iti?.destroy();
4251
4246
  this.iti = null;
4252
4247
  this.onDropdownClose();
@@ -4277,9 +4272,11 @@ class FormFieldComponent {
4277
4272
  }
4278
4273
  /**
4279
4274
  * Instancie `intl-tel-input` sur le champ `#phoneInput` et câble la sync bidirectionnelle
4280
- * avec le FormControl + le validator `phone`. Utils (libphonenumber-js) chargés en lazy.
4275
+ * avec le FormControl + le validator `phone`. Bibliotheque, packs de langue et utils (libphonenumber-js)
4276
+ * sont charges a la demande : tant que le chargement n'est pas termine, le champ est un `<input>` simple
4277
+ * et le validator `phone` n'est pas encore pose.
4281
4278
  */
4282
- initPhone() {
4279
+ async initPhone() {
4283
4280
  const ref = this.phoneInputRef();
4284
4281
  if (!ref || !this.control)
4285
4282
  return;
@@ -4288,7 +4285,9 @@ class FormFieldComponent {
4288
4285
  // Packs i18n natifs de la lib : couvrent `searchPlaceholder`, `searchEmptyState`
4289
4286
  // ("Aucun résultat trouvé"), `noCountrySelected` et tous les aria-labels en un objet.
4290
4287
  // Fallback `en` si la langue de l'app n'est pas couverte par les packs importés.
4291
- const i18nPack = lang === 'fr' ? itiFr : itiEn;
4288
+ const [{ default: intlTelInput }, i18nPack] = await Promise.all([import('intl-tel-input'), this.loadItiI18n(lang)]);
4289
+ if (this.destroyed)
4290
+ return;
4292
4291
  this.iti = intlTelInput(el, {
4293
4292
  initialCountry: (this.initialCountry || 'fr').toLowerCase(),
4294
4293
  countrySearch: true,
@@ -4344,6 +4343,15 @@ class FormFieldComponent {
4344
4343
  this.control.addValidators(this.phoneValidator);
4345
4344
  this.control.updateValueAndValidity({ emitEvent: false });
4346
4345
  }
4346
+ /** Pack de langue d'intl-tel-input (`fr`, sinon `en`), charge a la demande. */
4347
+ async loadItiI18n(lang) {
4348
+ const pack = lang === 'fr'
4349
+ // @ts-ignore
4350
+ ? await import('intl-tel-input/dist/js/i18n/fr.js')
4351
+ // @ts-ignore
4352
+ : await import('intl-tel-input/dist/js/i18n/en.js');
4353
+ return (pack.default ?? pack);
4354
+ }
4347
4355
  /**
4348
4356
  * Lit la valeur courante depuis l'instance iti et la pousse dans le FormControl (E.164 dès que utils chargés).
4349
4357
  * Ne marque pas comme `touched` — on s'aligne sur le comportement standard Angular : `touched` est posé sur blur
@@ -4625,127 +4633,129 @@ class FormFieldComponent {
4625
4633
  this.formControl.markAsTouched();
4626
4634
  }
4627
4635
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: FormFieldComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
4628
- 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 }, labelParams: { classPropertyName: "labelParams", publicName: "labelParams", isSignal: false, isRequired: false, transformFunction: null }, displayLabel: { classPropertyName: "displayLabel", publicName: "displayLabel", isSignal: false, isRequired: false, transformFunction: null }, fieldTitle: { classPropertyName: "fieldTitle", publicName: "fieldTitle", isSignal: false, isRequired: false, transformFunction: null }, name: { classPropertyName: "name", publicName: "name", isSignal: false, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: false, isRequired: false, transformFunction: null }, autocomplete: { classPropertyName: "autocomplete", publicName: "autocomplete", isSignal: false, isRequired: false, transformFunction: null }, options: { classPropertyName: "options", publicName: "options", isSignal: false, isRequired: false, transformFunction: null }, rangeOptions: { classPropertyName: "rangeOptions", publicName: "rangeOptions", isSignal: false, isRequired: false, transformFunction: null }, validationOptions: { classPropertyName: "validationOptions", publicName: "validationOptions", isSignal: false, isRequired: false, transformFunction: null }, autocompleteOptions: { classPropertyName: "autocompleteOptions", publicName: "autocompleteOptions", isSignal: false, isRequired: false, transformFunction: null }, richTextOptions: { classPropertyName: "richTextOptions", publicName: "richTextOptions", isSignal: false, isRequired: false, transformFunction: null }, errorMessages: { classPropertyName: "errorMessages", publicName: "errorMessages", isSignal: false, isRequired: false, transformFunction: null }, isRequired: { classPropertyName: "isRequired", publicName: "isRequired", isSignal: false, isRequired: false, transformFunction: null }, requiredStart: { classPropertyName: "requiredStart", publicName: "requiredStart", isSignal: false, isRequired: false, transformFunction: null }, requiredEnd: { classPropertyName: "requiredEnd", publicName: "requiredEnd", isSignal: false, isRequired: false, transformFunction: null }, periodShortcuts: { classPropertyName: "periodShortcuts", publicName: "periodShortcuts", isSignal: false, isRequired: false, transformFunction: null }, description: { classPropertyName: "description", publicName: "description", isSignal: false, isRequired: false, transformFunction: null }, help: { classPropertyName: "help", publicName: "help", isSignal: false, isRequired: false, transformFunction: null }, helpParams: { classPropertyName: "helpParams", publicName: "helpParams", isSignal: false, isRequired: false, transformFunction: null }, tooltip: { classPropertyName: "tooltip", publicName: "tooltip", isSignal: false, isRequired: false, transformFunction: null }, ariaDescribedBy: { classPropertyName: "ariaDescribedBy", publicName: "ariaDescribedBy", isSignal: false, isRequired: false, transformFunction: null }, addonLeft: { classPropertyName: "addonLeft", publicName: "addonLeft", isSignal: false, isRequired: false, transformFunction: null }, addonRight: { classPropertyName: "addonRight", publicName: "addonRight", isSignal: false, isRequired: false, transformFunction: null }, isInAddon: { classPropertyName: "isInAddon", publicName: "isInAddon", isSignal: false, isRequired: false, transformFunction: null }, isReadonly: { classPropertyName: "isReadonly", publicName: "isReadonly", isSignal: false, isRequired: false, transformFunction: null }, isDisabled: { classPropertyName: "isDisabled", publicName: "isDisabled", isSignal: false, isRequired: false, transformFunction: null }, sliderValue: { classPropertyName: "sliderValue", publicName: "sliderValue", isSignal: false, isRequired: false, transformFunction: null }, sliderOptions: { classPropertyName: "sliderOptions", publicName: "sliderOptions", isSignal: false, isRequired: false, transformFunction: null }, cssClass: { classPropertyName: "cssClass", publicName: "cssClass", isSignal: false, isRequired: false, transformFunction: null }, skeletonMode: { classPropertyName: "skeletonMode", publicName: "skeletonMode", isSignal: false, isRequired: false, transformFunction: null }, clearable: { classPropertyName: "clearable", publicName: "clearable", isSignal: false, isRequired: false, transformFunction: null }, appendTo: { classPropertyName: "appendTo", publicName: "appendTo", isSignal: false, isRequired: false, transformFunction: null }, initialCountry: { classPropertyName: "initialCountry", publicName: "initialCountry", isSignal: false, isRequired: false, transformFunction: null }, recommendedDimensions: { classPropertyName: "recommendedDimensions", publicName: "recommendedDimensions", isSignal: false, isRequired: false, transformFunction: null }, showPreview: { classPropertyName: "showPreview", publicName: "showPreview", isSignal: false, isRequired: false, transformFunction: null }, existingFile: { classPropertyName: "existingFile", publicName: "existingFile", isSignal: false, isRequired: false, transformFunction: null }, indeterminate: { classPropertyName: "indeterminate", publicName: "indeterminate", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { refreshEvent: "refreshEvent", fileRemoved: "fileRemoved", textChanged: "textChanged", valueChange: "valueChange", phoneRegionChange: "phoneRegionChange" }, host: { properties: { "class": "this.hostClasses" } }, queries: [{ propertyName: "optionTemplate", first: true, predicate: ["ngOptionTpl"], descendants: true, read: TemplateRef }, { propertyName: "labelTemplate", first: true, predicate: ["ngLabelTpl"], descendants: true, read: TemplateRef }, { propertyName: "autocompleteOptionTpl", first: true, predicate: CwAutocompleteOptionDirective, descendants: true }], viewQueries: [{ propertyName: "checkboxInputRef", first: true, predicate: ["checkboxInput"], descendants: true, isSignal: true }, { propertyName: "fileInputRef", first: true, predicate: ["fileInput"], descendants: true, isSignal: true }, { propertyName: "phoneInputRef", first: true, predicate: ["phoneInput"], descendants: true, isSignal: true }, { propertyName: "autocompleteRef", first: true, predicate: AutocompleteComponent, descendants: true, isSignal: true }, { propertyName: "ngSelectRef", first: true, predicate: NgSelectComponent, descendants: true, isSignal: true }], usesOnChanges: true, ngImport: i0, template: "@if (!isInAddon) {\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 !isChoiceCard &&\r\n !isPeriod\r\n ) {\r\n <!-- Bouton d'aide HORS du <label> (bouton dans un label = HTML invalide, son libelle\r\n polluerait le nom accessible du champ et un clic activerait le label) : on aligne\r\n label + bouton dans un conteneur flex, seulement quand il y a une aide. -->\r\n @if (hasFieldTooltip) {\r\n <div class=\"d-flex-h gap-2xs\">\r\n <ng-container *ngTemplateOutlet=\"fieldLabel\"></ng-container>\r\n <ng-container *ngTemplateOutlet=\"fieldTooltip\"></ng-container>\r\n </div>\r\n } @else {\r\n <ng-container *ngTemplateOutlet=\"fieldLabel\"></ng-container>\r\n }\r\n }\r\n\r\n <!-- Une p\u00E9riode rend ses addons dans son propre field-group (entre les bornes et le fieldset). -->\r\n @if ((addonLeft || addonRight) && !isPeriod) {\r\n <div class=\"field-group\" [class.field-group-invalid]=\"isInvalid\" [class.field-group-disabled]=\"isDisabledOrReadonly\">\r\n @if(addonLeft) {\r\n <div class=\"field-group-addon-left\">\r\n <ng-container [ngTemplateOutlet]=\"addonLeft\"></ng-container>\r\n </div>\r\n }\r\n <ng-container [ngTemplateOutlet]=\"field\"></ng-container>\r\n @if(addonRight) {\r\n <div class=\"field-group-addon-right\">\r\n <ng-container [ngTemplateOutlet]=\"addonRight\"></ng-container>\r\n </div>\r\n }\r\n </div>\r\n }\r\n @else {\r\n @if ( isInInputGroup() ) {\r\n <div class=\"field-group\" [class.field-group-invalid]=\"isInvalid\" [class.field-group-disabled]=\"isDisabledOrReadonly\">\r\n <ng-container [ngTemplateOutlet]=\"field\"></ng-container>\r\n </div>\r\n }\r\n @else {\r\n <ng-container [ngTemplateOutlet]=\"field\"></ng-container>\r\n }\r\n }\r\n\r\n <!-- Error message -->\r\n @if (controlOrGroup?.invalid && controlOrGroup?.touched) {\r\n <div class=\"field-invalid\" [id]=\"'error-' + name\">\r\n @if (\r\n !errorMessages?.['required'] &&\r\n ((controlOrGroup?.errors?.['required']) || (getControl('start')?.errors?.['required'] || getControl('end')?.errors?.['required']))\r\n ) {\r\n <span [innerHtml]=\"'_COMMON._FORM.ERROR_IS_MANDATORY' | translate: {label: label | translate: labelParams}\"></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: helpParams }}</span>\r\n }\r\n @for (entry of autoHelpEntries; track entry.key) {\r\n <!-- Espace explicite : les blancs entre balises sont supprim\u00E9s \u00E0 la compilation. -->\r\n {{ ' ' }}<span>{{ entry.key | translate: entry.params }}</span>\r\n }\r\n </div>\r\n }\r\n\r\n <!-- Aper\u00E7u du fichier (type=file, opt-in) : sous le champ et ses aides, comme dans la\r\n maquette DS. La croix native du champ n'est pas retir\u00E9e \u2014 les deux vident le m\u00EAme\r\n control, l'aper\u00E7u ajoute juste \u00AB Visualiser \u00BB et une cible plus grande. -->\r\n @if (isPreviewVisible) {\r\n <cw-file-preview [file]=\"previewFile\" [existingFile]=\"existingFile ?? null\"\r\n [disabled]=\"!!isDisabledOrReadonly\" (remove)=\"onPreviewRemove()\" />\r\n }\r\n\r\n <!-- Chips de la multi-s\u00E9lection (autocomplete) : rendus ici, hors du field-group et apr\u00E8s\r\n erreur/help, pour \u00EAtre visuellement d\u00E9tach\u00E9s du champ. La donn\u00E9e et le retrait restent\r\n port\u00E9s par cw-autocomplete (`chips()` / `onChipRemove()`), seul l'affichage est d\u00E9l\u00E9gu\u00E9. -->\r\n @if (type === typeField.autocompleteMultiple && autocompleteRef()?.chips()?.length) {\r\n <ul class=\"autocomplete-chips\" role=\"list\">\r\n @for (chip of autocompleteRef()!.chips(); track chip.item) {\r\n <li>\r\n <button type=\"button\" class=\"autocomplete-chip\"\r\n [disabled]=\"isEffectivelyDisabled || isReadonly\"\r\n (click)=\"autocompleteRef()!.onChipRemove(chip.item)\">\r\n <span>{{ chip.label }}</span>\r\n @if (!isEffectivelyDisabled && !isReadonly) {\r\n <span aria-hidden=\"true\" class=\"autocomplete-chip-x\">&times;</span>\r\n <span class=\"visually-hidden\">{{ '_COMMON._ACTION.DELETE' | translate }}</span>\r\n }\r\n </button>\r\n </li>\r\n }\r\n </ul>\r\n }\r\n}\r\n@else {\r\n <ng-container [ngTemplateOutlet]=\"field\"></ng-container>\r\n}\r\n\r\n<ng-template #field>\r\n <!-- Autocomplete (mono / multi) -->\r\n @if ((type === typeField.autocomplete || type === typeField.autocompleteMultiple) && autocompleteOptions) {\r\n <cw-autocomplete\r\n [id]=\"name\"\r\n [control]=\"formControl\"\r\n [fetcher]=\"autocompleteOptions.fetcher\"\r\n [displayField]=\"autocompleteOptions.displayField ?? 'label'\"\r\n [valueField]=\"autocompleteOptions.valueField ?? 'id'\"\r\n [columns]=\"autocompleteOptions.columns ?? []\"\r\n [optionTemplate]=\"autocompleteOptions.optionTemplate ?? autocompleteOptionTpl?.templateRef ?? null\"\r\n [resolver]=\"autocompleteOptions.resolver ?? null\"\r\n [selectedItem]=\"autocompleteOptions.selectedItem ?? null\"\r\n [selectedItems]=\"autocompleteOptions.selectedItems ?? []\"\r\n [minChars]=\"autocompleteOptions.minChars ?? 2\"\r\n [debounceMs]=\"autocompleteOptions.debounceMs ?? 250\"\r\n [multiple]=\"type === typeField.autocompleteMultiple\"\r\n [isRequired]=\"isRequired\"\r\n [isReadonly]=\"!!isReadonly\"\r\n [isDisabled]=\"isEffectivelyDisabled\"\r\n [ariaInvalid]=\"control.invalid && control.touched\"\r\n [ariaDescribedBy]=\"getDescribedBy(control)\"\r\n [placeholder]=\"placeholder\">\r\n </cw-autocomplete>\r\n }\r\n\r\n <!-- Rich text editor (Quill) : sous-composant interne, sans field-group ni bouton clear\r\n (il porte sa propre bordure + toolbar). Le label statique du form-field reste au-dessus. -->\r\n @if (type === typeField.richText) {\r\n <cw-rich-text-editor\r\n [id]=\"name\"\r\n [control]=\"formControl\"\r\n [options]=\"richTextOptions\"\r\n [placeholder]=\"placeholder ? (placeholder | translate) : ''\"\r\n [isRequired]=\"isRequired\"\r\n [isReadonly]=\"!!isReadonly\"\r\n [isDisabled]=\"isEffectivelyDisabled\"\r\n [ariaInvalid]=\"control.invalid && control.touched\"\r\n [ariaDescribedBy]=\"getDescribedBy(control)\">\r\n </cw-rich-text-editor>\r\n }\r\n\r\n <!-- Text -->\r\n @if ([typeField.text, typeField.date, typeField.time, typeField.dateTime, typeField.number,\r\n typeField.email,\r\n typeField.color, typeField.zipCode].includes(type)) {\r\n <input [type]=\"type === typeField.zipCode ? 'text' : type\" class=\"field-control\" [id]=\"name\" [formControl]=\"formControl\"\r\n [attr.title]=\"fieldTitle ? (fieldTitle | translate) : null\"\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 <!-- L'input natif reste LE controle (focus, clavier, restitution aux lecteurs d'ecran,\r\n validation), mais il est masque visuellement : le libelle de son bouton et son\r\n \u00AB aucun fichier choisi \u00BB sont ecrits par le NAVIGATEUR, dans SA langue. Ils sont\r\n intraduisibles et ne suivent pas la langue de l'application \u2014 un utilisateur qui\r\n bascule en anglais garderait \u00AB Choisir un fichier \u00BB. On les reecrit donc a cote,\r\n traduits, dans une couche purement visuelle. -->\r\n <input #fileInput type=\"file\" class=\"field-control visually-hidden\" [id]=\"name\"\r\n [ngClass]=\"[(cssClass || ''), formControl?.value ? 'has-value' : '']\"\r\n [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 <!-- `aria-hidden` : doublon visuel de l'input, que les lecteurs d'ecran restituent deja\r\n (nom du champ, bouton de parcours, fichier selectionne). L'annoncer une seconde fois\r\n ne ferait que bavarder. Le clic est relaye a l'input, le clavier passe par lui. -->\r\n <span class=\"field-file\" aria-hidden=\"true\" (click)=\"openFilePicker()\">\r\n <span class=\"field-file-button\">{{ '_COMMON._FORM.CHOOSE_FILE' | translate }}</span>\r\n <span class=\"field-file-name\" [class.field-file-name-empty]=\"!selectedFileName\">\r\n {{ selectedFileName ?? ('_COMMON._FORM.NO_FILE_SELECTED' | translate) }}\r\n </span>\r\n </span>\r\n }\r\n\r\n @if (type === typeField.password) {\r\n <input [type]=\"isPasswordShown ? 'text' : 'password'\" class=\"field-control\" [id]=\"name\" [formControl]=\"formControl\"\r\n [ngClass]=\"[(cssClass || ''), formControl?.value ? 'has-value' : '']\"\r\n [attr.required]=\"isRequired ? 'required' : null\" [attr.readonly]=\"isReadonly ? 'readonly' : null\"\r\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\" [attr.aria-required]=\"isRequired\"\r\n [attr.minlength]=\"minLengthAttr\" [attr.maxlength]=\"maxLengthAttr\" [attr.pattern]=\"patternAttr\"\r\n [attr.autocomplete]=\"autocomplete\"\r\n [attr.aria-invalid]=\"control.invalid && control.touched\"\r\n [attr.aria-describedby]=\"getDescribedBy(control)\"\r\n (focus)=\"onFocus()\" (blur)=\"onBlur()\" />\r\n <cw-button [type]=\"buttonType.ghost\"\r\n cssClass=\"btn-password-field\"\r\n [withIcon]=\"isPasswordShown ? spriteIcon.toolbarHidePassword : spriteIcon.toolbarShowPassword\"\r\n [withOnlyIcon]=\"true\"\r\n [label]=\"isPasswordShown ? '_COMMON._FORM._SHOW_HIDE_PWD.HIDE' : '_COMMON._FORM._SHOW_HIDE_PWD.SHOW'\"\r\n (btnAction)=\"togglePasswordVisibility()\">\r\n </cw-button>\r\n }\r\n\r\n <!-- Textarea -->\r\n @if (type === typeField.textarea) {\r\n <textarea class=\"field-control\" [id]=\"name\" [formControl]=\"formControl\"\r\n [ngClass]=\"[(cssClass || ''), formControl?.value ? 'has-value' : '']\"\r\n [attr.placeholder]=\"placeholder ? (placeholder | translate) : null\" [attr.required]=\"isRequired ? 'required' : null\"\r\n [attr.readonly]=\"isReadonly ? 'readonly' : null\" [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\"\r\n [attr.aria-required]=\"isRequired\" [attr.aria-invalid]=\"control.invalid && control.touched\"\r\n [attr.minlength]=\"minLengthAttr\" [attr.maxlength]=\"maxLengthAttr\" [attr.pattern]=\"patternAttr\"\r\n [attr.autocomplete]=\"autocomplete\"\r\n [attr.aria-describedby]=\"getDescribedBy(control)\"\r\n (focus)=\"onFocus()\" (blur)=\"onBlur()\"></textarea>\r\n }\r\n\r\n <!-- Select -->\r\n @if (type === typeField.select) {\r\n <ng-select [formControl]=\"formControl\" [items]=\"options\" bindLabel=\"label\" [labelForId]=\"name\" [appendTo]=\"appendTo ?? ''\" bindValue=\"value\"\r\n [ngClass]=\"cssClass\" [searchable]=\"false\" [placeholder]=\"placeholder ? (placeholder | translate) : ''\" [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()\" (open)=\"onDropdownOpen()\" (close)=\"onDropdownClose()\">\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) : ''\" [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 (open)=\"onDropdownOpen()\" (close)=\"onDropdownClose()\">\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 [attr.aria-labelledby]=\"hasFieldTooltip ? legendId : null\"\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\" [class.d-flex-h]=\"hasFieldTooltip\" [class.gap-2xs]=\"hasFieldTooltip\">\r\n <span [id]=\"legendId\">\r\n {{label | translate: labelParams}}\r\n @if(isRequired) {\r\n <span class=\"text-danger\">*</span>\r\n }\r\n </span>\r\n @if (hasFieldTooltip) {\r\n <ng-container *ngTemplateOutlet=\"fieldTooltip\"></ng-container>\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 gap-sm'\">\r\n @for (opt of options; track opt.value) {\r\n <li class=\"field-check\">\r\n <input type=\"radio\" [id]=\"name + '_' + opt.value\" [attr.name]=\"name\" [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 [attr.aria-labelledby]=\"hasFieldTooltip ? legendId : null\"\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\" [class.d-flex-h]=\"hasFieldTooltip\" [class.gap-2xs]=\"hasFieldTooltip\">\r\n <span [id]=\"legendId\">\r\n {{label | translate: labelParams}}\r\n @if(isRequired) {\r\n <span class=\"text-danger\">*</span>\r\n }\r\n </span>\r\n @if (hasFieldTooltip) {\r\n <ng-container *ngTemplateOutlet=\"fieldTooltip\"></ng-container>\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\" [attr.name]=\"name\" [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 <!-- Cartes : checkbox / radio / switch (contr\u00F4le \u00E0 gauche, titre, description facultative) -->\r\n @if (isChoiceCard) {\r\n @if (isBooleanChoiceCard) {\r\n <!-- Carte bool\u00E9enne (sans options) : une case li\u00E9e au FormControl<boolean>, nomm\u00E9e par le titre. -->\r\n <div class=\"field-card-list\" [class.field-card-list-compact]=\"isChoiceCardCompact\">\r\n <label class=\"field-card d-flex-h items-start gap-xs\" [for]=\"name\" [class.field-switch]=\"isSwitchCard\" [class.field-switch-small]=\"isSwitchCard\">\r\n <input type=\"checkbox\" [id]=\"name\" [formControl]=\"formControl\" class=\"field-check-input\"\r\n [attr.role]=\"isSwitchCard ? 'switch' : null\"\r\n [attr.aria-required]=\"isRequired\"\r\n [attr.aria-invalid]=\"control.invalid && control.touched\"\r\n [attr.aria-describedby]=\"booleanCardDescribedBy\"\r\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\" />\r\n <span class=\"d-flex-v gap-5xs\">\r\n <span class=\"field-card-title\">\r\n {{ label | translate: labelParams }}\r\n @if (isRequired) {\r\n <span class=\"text-danger\">*</span>\r\n }\r\n </span>\r\n @if (!isChoiceCardCompact && description) {\r\n <span class=\"field-text\" [id]=\"name + '-desc'\">{{ description | translate }}</span>\r\n }\r\n </span>\r\n </label>\r\n </div>\r\n } @else {\r\n <fieldset [attr.aria-labelledby]=\"hasFieldTooltip ? legendId : null\"\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\" [class.d-flex-h]=\"hasFieldTooltip\" [class.gap-2xs]=\"hasFieldTooltip\">\r\n <span [id]=\"legendId\">\r\n {{label | translate: labelParams}}\r\n @if(isRequired) {\r\n <span class=\"text-danger\">*</span>\r\n }\r\n </span>\r\n @if (hasFieldTooltip) {\r\n <ng-container *ngTemplateOutlet=\"fieldTooltip\"></ng-container>\r\n }\r\n </legend>\r\n <ul class=\"field-card-list list-unstyled mb-none\" [class.field-card-list-compact]=\"isChoiceCardCompact\">\r\n @for (opt of options; track opt.value) {\r\n <li class=\"d-flex-v\">\r\n <!-- Le label englobe toute la carte : un clic n'importe o\u00F9 coche l'option. -->\r\n <label class=\"field-card d-flex-h items-start gap-xs flex-1\" [for]=\"name + '_' + opt.value\" [class.field-switch]=\"isSwitchCard\" [class.field-switch-small]=\"isSwitchCard\">\r\n @if (isRadioCard) {\r\n <input type=\"radio\" [id]=\"name + '_' + opt.value\" [attr.name]=\"name\" [value]=\"opt.value\" [formControl]=\"formControl\"\r\n class=\"field-check-input\"\r\n [attr.aria-describedby]=\"(!isChoiceCardCompact && opt.description) ? name + '_' + opt.value + '-desc' : null\"\r\n [attr.disabled]=\"(isEffectivelyDisabled || opt.disabled) ? 'disabled' : null\" (change)=\"onRadioChange(opt.value)\" />\r\n } @else {\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.role]=\"isSwitchCard ? 'switch' : null\"\r\n [attr.aria-describedby]=\"(!isChoiceCardCompact && opt.description) ? name + '_' + opt.value + '-desc' : null\"\r\n [attr.disabled]=\"(isEffectivelyDisabled || opt.disabled) ? 'disabled' : null\" />\r\n }\r\n <span class=\"d-flex-v gap-5xs\">\r\n <span class=\"field-card-title\">{{ opt.label | translate }}</span>\r\n @if (!isChoiceCardCompact && opt.description) {\r\n <span class=\"field-text\" [id]=\"name + '_' + opt.value + '-desc'\">{{ opt.description | translate }}</span>\r\n }\r\n </span>\r\n </label>\r\n </li>\r\n }\r\n </ul>\r\n </fieldset>\r\n }\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: labelParams }}</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: labelParams }}\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 [attr.aria-labelledby]=\"hasFieldTooltip ? legendId : null\"\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\" [class.d-flex-h]=\"hasFieldTooltip\" [class.gap-2xs]=\"hasFieldTooltip\">\r\n <span [id]=\"legendId\">\r\n {{label | translate: labelParams}}\r\n @if(isRequired) {\r\n <span class=\"text-danger\">*</span>\r\n }\r\n </span>\r\n @if (hasFieldTooltip) {\r\n <ng-container *ngTemplateOutlet=\"fieldTooltip\"></ng-container>\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 gap-sm'\">\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 [attr.aria-labelledby]=\"hasFieldTooltip ? legendId : null\">\r\n <legend class=\"field-label\" [class.visually-hidden]=\"!displayLabel\" [class.d-flex-h]=\"hasFieldTooltip\" [class.gap-2xs]=\"hasFieldTooltip\">\r\n <span [id]=\"legendId\">\r\n {{label | translate: labelParams}}\r\n </span>\r\n @if (hasFieldTooltip) {\r\n <ng-container *ngTemplateOutlet=\"fieldTooltip\"></ng-container>\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 gap-sm'\">\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 [attr.aria-labelledby]=\"hasFieldTooltip ? legendId : null\"\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\" [class.d-flex-h]=\"hasFieldTooltip\" [class.gap-2xs]=\"hasFieldTooltip\">\r\n <span [id]=\"legendId\">\r\n {{label | translate: labelParams}}\r\n @if(isRequired) {\r\n <span class=\"text-danger\">*</span>\r\n }\r\n </span>\r\n @if (hasFieldTooltip) {\r\n <ng-container *ngTemplateOutlet=\"fieldTooltip\"></ng-container>\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 [attr.aria-labelledby]=\"hasFieldTooltip ? legendId : null\">\r\n <legend class=\"field-label\" [class.visually-hidden]=\"!displayLabel\" [class.d-flex-h]=\"hasFieldTooltip\" [class.gap-2xs]=\"hasFieldTooltip\">\r\n <span [id]=\"legendId\">\r\n {{label | translate: labelParams}}\r\n </span>\r\n @if (hasFieldTooltip) {\r\n <ng-container *ngTemplateOutlet=\"fieldTooltip\"></ng-container>\r\n }\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 (isPeriod) {\r\n <!-- Fieldset : le legend nomme la p\u00E9riode, \u00AB Du \u00BB / \u00AB au \u00BB sont les labels de chaque input. -->\r\n <fieldset [attr.aria-labelledby]=\"hasFieldTooltip ? legendId : null\">\r\n <legend class=\"field-label\" [class.visually-hidden]=\"!displayLabel\" [class.d-flex-h]=\"hasFieldTooltip\" [class.gap-2xs]=\"hasFieldTooltip\">\r\n <span [id]=\"legendId\">\r\n {{label | translate: labelParams}}\r\n <!-- Deux bornes obligatoires : ast\u00E9risque sur la p\u00E9riode ; une seule : sur sa borne. -->\r\n @if(isStartRequired && isEndRequired) {\r\n <span class=\"text-danger\">*</span>\r\n }\r\n </span>\r\n @if (hasFieldTooltip) {\r\n <ng-container *ngTemplateOutlet=\"fieldTooltip\"></ng-container>\r\n }\r\n </legend>\r\n <!-- \u00C9tats invalide / d\u00E9sactiv\u00E9 pos\u00E9s seulement avec addon ou raccourcis (rendu historique sinon). -->\r\n <div class=\"field-group\"\r\n [class.field-group-invalid]=\"hasPeriodAddons && isInvalid\"\r\n [class.field-group-disabled]=\"hasPeriodAddons && isDisabledOrReadonly\">\r\n @if (addonLeft) {\r\n <div class=\"field-group-addon-left\">\r\n <ng-container [ngTemplateOutlet]=\"addonLeft\"></ng-container>\r\n </div>\r\n }\r\n <label class=\"field-group-addon-left\" [for]=\"name + '_start'\">\r\n {{ '_COMMON._DATES.FROM_TO_1' | translate }}\r\n @if(isStartRequired && !isEndRequired) {\r\n <span class=\"text-danger\">*</span>\r\n }\r\n </label>\r\n <input [type]=\"getInputType()\" class=\"field-control\" [id]=\"name + '_start'\" [formControl]=\"getControl('start')!\"\r\n [attr.title]=\"fieldTitle ? (fieldTitle | translate) + ' \u2013 ' + ('_COMMON._DATES.FROM_TO_1' | translate) : null\"\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]=\"isStartRequired ? 'required' : null\" [attr.readonly]=\"isReadonly ? 'readonly' : null\"\r\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\" [attr.aria-required]=\"isStartRequired\"\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')\" (blur)=\"onBlurRange('start')\" />\r\n\r\n @if(getControl('start')?.value && !isDisabledOrReadonly) {\r\n <button type=\"button\" class=\"btn btn-secondary btn-clear-field\"\r\n [attr.aria-label]=\"'_COMMON._FORM.CLEAR_START' | translate: { label: label | translate: labelParams }\"\r\n (click)=\"onClearFieldPeriod('start')\">\r\n <span aria-hidden=\"true\">&times;</span>\r\n </button>\r\n }\r\n <label class=\"field-group-addon-center\" [for]=\"name + '_end'\">\r\n {{ '_COMMON._DATES.FROM_TO_2' | translate }}\r\n @if(isEndRequired && !isStartRequired) {\r\n <span class=\"text-danger\">*</span>\r\n }\r\n </label>\r\n <input [type]=\"getInputType()\" class=\"field-control\" [id]=\"name + '_end'\" [formControl]=\"getControl('end')!\"\r\n [attr.title]=\"fieldTitle ? (fieldTitle | translate) + ' \u2013 ' + ('_COMMON._DATES.FROM_TO_2' | translate) : null\"\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]=\"isEndRequired ? 'required' : null\" [attr.readonly]=\"isReadonly ? 'readonly' : null\"\r\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\" [attr.aria-required]=\"isEndRequired\"\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')\" (blur)=\"onBlurRange('end')\" />\r\n\r\n @if(getControl('end')?.value && !isDisabledOrReadonly) {\r\n <button type=\"button\" class=\"btn btn-ghost btn-clear-field\"\r\n [attr.aria-label]=\"'_COMMON._FORM.CLEAR_END' | translate: { label: label | translate: labelParams }\"\r\n (click)=\"onClearFieldPeriod('end')\">\r\n <span aria-hidden=\"true\">&times;</span>\r\n </button>\r\n }\r\n\r\n <!-- Raccourcis (dateToDate) puis addon droit : dans le fieldset, apr\u00E8s la borne de fin. -->\r\n @for (shortcut of activePeriodShortcuts; track $index) {\r\n <div class=\"field-group-addon-right\">\r\n <button type=\"button\" class=\"btn btn-ghost\"\r\n [class.active]=\"isPeriodShortcutActive(shortcut)\"\r\n [attr.aria-pressed]=\"isPeriodShortcutActive(shortcut)\"\r\n [attr.aria-label]=\"shortcut.ariaLabel ? (shortcut.ariaLabel | translate) : null\"\r\n [attr.disabled]=\"isDisabledOrReadonly ? 'disabled' : null\"\r\n (click)=\"onPeriodShortcut(shortcut)\">\r\n {{ shortcut.label | translate }}\r\n </button>\r\n </div>\r\n }\r\n @if (addonRight) {\r\n <div class=\"field-group-addon-right\">\r\n <ng-container [ngTemplateOutlet]=\"addonRight\"></ng-container>\r\n </div>\r\n }\r\n </div>\r\n </fieldset>\r\n }\r\n\r\n @if ([typeField.datePlusOne, typeField.datePlusTwo, typeField.datePlusSeven, typeField.dateComplexe].includes(type)) {\r\n\r\n <div class=\"field-group\">\r\n @if (type === typeField.dateComplexe) {\r\n <div class=\"field-group-addon-left\">\r\n <button class=\"btn btn-ghost\" type=\"button\" (click)=\"onDateAddDay('prev')\"\r\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\">\r\n <cw-icon font=\"optyweb\" [icon]=\"spriteIcon.nextLeft\" [label]=\"'Jour pr\u00E9c\u00E9dent'\"></cw-icon>\r\n </button>\r\n </div>\r\n }\r\n\r\n <input type=\"date\" class=\"field-control\" [id]=\"name\" [formControl]=\"formControl\"\r\n [attr.title]=\"fieldTitle ? (fieldTitle | translate) : null\"\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.aria-required]=\"isRequired\"\r\n [attr.min]=\"minAttr\" [attr.max]=\"maxAttr\" [attr.step]=\"stepAttr\"\r\n [attr.autocomplete]=\"autocomplete\"\r\n [attr.aria-invalid]=\"control.invalid && control.touched\"\r\n [attr.aria-describedby]=\"getDescribedBy(control)\"\r\n (focus)=\"onFocus()\" (blur)=\"onBlur()\" />\r\n\r\n @if(formControl?.value && !isDisabledOrReadonly) {\r\n <button class=\"btn btn-ghost btn-clear-field\" type=\"button\"\r\n [attr.aria-label]=\"'_COMMON._FORM.CLEAR_FIELD' | translate: { label: label | translate: labelParams }\"\r\n (click)=\"onClearField(formControl)\"><span aria-hidden=\"true\">&times;</span></button>\r\n }\r\n\r\n\r\n @if (type === typeField.dateComplexe) {\r\n <div class=\"field-group-addon-right\">\r\n <button class=\"btn btn-ghost\" type=\"button\" (click)=\"onDateAddDay('next')\"\r\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\">\r\n <cw-icon font=\"optyweb\" [icon]=\"spriteIcon.nextRight\" [label]=\"'Jour suivant'\"></cw-icon>\r\n </button>\r\n </div>\r\n <div class=\"field-group-addon-right\">\r\n <button class=\"btn btn-ghost\" type=\"button\" (click)=\"onRefresh()\"\r\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\">\r\n <cw-icon font=\"optyweb\" [icon]=\"spriteIcon.toolbarRefresh\" [label]=\"'Rafra\u00EEchir'\"></cw-icon>\r\n </button>\r\n </div>\r\n }\r\n\r\n <div class=\"field-group-addon-right\">\r\n <button class=\"btn btn-ghost\" type=\"button\" (click)=\"onTodayAddDay(0)\"\r\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\">\r\n J\r\n <span class=\"visually-hidden\">Aujourd'hui</span>\r\n </button>\r\n </div>\r\n <div class=\"field-group-addon-right\">\r\n <button class=\"btn btn-ghost\" type=\"button\" (click)=\"onTodayAddDay(1)\"\r\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\">\r\n J+1\r\n <span class=\"visually-hidden\">Demain</span>\r\n </button>\r\n </div>\r\n\r\n @if (type !== typeField.datePlusOne && type !== typeField.dateComplexe) {\r\n <div class=\"field-group-addon-right\">\r\n <button class=\"btn btn-ghost \" type=\"button\" (click)=\"onTodayAddDay(2)\"\r\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\">\r\n J+2\r\n <span class=\"visually-hidden\">Dans 2 jours</span>\r\n </button>\r\n </div>\r\n\r\n @if (type !== typeField.datePlusTwo) {\r\n <div class=\"field-group-addon-right\">\r\n <button class=\"btn btn-ghost\" type=\"button\" (click)=\"onTodayAddDay(7)\"\r\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\">\r\n J+7\r\n <span class=\"visually-hidden\">Dans 7 jours</span>\r\n </button>\r\n </div>\r\n }\r\n }\r\n </div>\r\n }\r\n\r\n @if (type === typeField.slider) {\r\n <ngx-slider [(value)]=\"sliderValue\" [options]=\"sliderOptions\" [formControl]=\"formControl\"></ngx-slider>\r\n }\r\n\r\n @if (type === typeField.range) {\r\n <div class=\"slider\">\r\n\r\n <cw-button [isDisabled]=\"formControl.value <= rangeOptions.floor\" [label]=\"'Diminuer ' + formControl.value + ' ' + label\"\r\n [withIcon]=\"spriteIcon.toolbarMinus\" [withOnlyIcon]=\"true\" [type]=\"buttonType.primary\"\r\n [iconSize]=\"buttonIconSize.small\" (btnAction)=\"onRangeStep('decrease')\">\r\n </cw-button>\r\n\r\n <div class=\"slider-input\">\r\n <label [for]=\"name\" class=\"slider-tooltip\" [style.left]=\"getRangePercent() + '%'\" aria-live=\"polite\"\r\n aria-atomic=\"true\">\r\n {{ label | translate: labelParams }} {{ formControl.value }}\r\n @if (rangeOptions.unit) {\r\n <abbr [title]=\"rangeOptions.unit\">{{ rangeOptions.unit }}</abbr>\r\n }\r\n </label>\r\n\r\n <div class=\"slider-custom-bar\">\r\n <div class=\"slider-custom-bar-selection\" [style.width]=\"getRangePercent() + '%'\">\r\n </div>\r\n </div>\r\n\r\n <input type=\"range\" [id]=\"name\" [formControl]=\"formControl\" [min]=\"rangeOptions.floor\" [max]=\"rangeOptions.ceil\"\r\n [step]=\"rangeOptions.step || 1\" class=\"field-control-range\" [attr.aria-required]=\"isRequired\"\r\n [attr.aria-invalid]=\"control.invalid && control.touched\">\r\n </div>\r\n\r\n <cw-button [isDisabled]=\"formControl.value >= rangeOptions.ceil\" [label]=\"'Augmenter ' + formControl.value + ' ' + label\"\r\n [withIcon]=\"spriteIcon.toolbarPlus\" [withOnlyIcon]=\"true\" [type]=\"buttonType.primary\"\r\n [iconSize]=\"buttonIconSize.small\" (btnAction)=\"onRangeStep('increase')\">\r\n </cw-button>\r\n </div>\r\n }\r\n\r\n @if (isInInputGroup() && clearable && !isDisabledOrReadonly && type !== typeField.autocompleteMultiple) {\r\n @if (type === typeField.autocomplete) {\r\n @if (autocompleteRef()?.hasAnyContent()) {\r\n <button class=\"btn btn-secondary btn-clear-field\" type=\"button\"\r\n [attr.aria-label]=\"'_COMMON._FORM.CLEAR_FIELD' | translate: { label: label | translate: labelParams }\"\r\n (click)=\"onClearAutocomplete()\"><span aria-hidden=\"true\">&times;</span></button>\r\n }\r\n } @else if (type === typeField.ngSelectMultiple) {\r\n <!-- value est un tableau : un [] vide \u00E9tant truthy, on teste .length pour n'afficher le clear global que s'il y a au moins une s\u00E9lection. -->\r\n @if (formControl?.value?.length) {\r\n <button class=\"btn btn-ghost btn-clear-field\" type=\"button\"\r\n [attr.aria-label]=\"'_COMMON._FORM.CLEAR_FIELD' | translate: { label: label | translate: labelParams }\"\r\n (click)=\"onClearField(formControl)\"><span aria-hidden=\"true\">&times;</span></button>\r\n }\r\n } @else {\r\n @if(formControl?.value) {\r\n <button class=\"btn btn-ghost btn-clear-field\" type=\"button\"\r\n [attr.aria-label]=\"'_COMMON._FORM.CLEAR_FIELD' | translate: { label: label | translate: labelParams }\"\r\n (click)=\"onClearField(formControl)\"><span aria-hidden=\"true\">&times;</span></button>\r\n }\r\n }\r\n }\r\n\r\n</ng-template>\r\n\r\n<ng-template #fieldLabel>\r\n <label [for]=\"name\" class=\"field-label\" [class.visually-hidden]=\"!displayLabel\">\r\n {{ label | translate: labelParams }}\r\n\r\n @if (isRequired) {\r\n <span class=\"text-danger\">*</span>\r\n }\r\n </label>\r\n</ng-template>\r\n\r\n<!-- Bouton d'aide (tooltip) partage label/legend. Hors du <label> (sinon son libelle\r\n s'ajoute au nom du champ et le clic active le label) ; dans un <legend>, le fieldset\r\n est nomme par aria-labelledby sur le seul texte (legendId) pour la meme raison. -->\r\n<ng-template #fieldTooltip>\r\n <button type=\"button\" class=\"btn btn-ghost btn-field-tooltip\"\r\n [cwTooltip]=\"tooltip ?? ''\"\r\n [attr.data-test-ctw]=\"'tooltip-' + name\">\r\n <cw-icon [icon]=\"spriteIcon.alertHelp\" [type]=\"iconType.circular\" [iconUiType]=\"iconUiType.info\"\r\n [iconSize]=\"iconSize.xs\" [label]=\"'_COMMON._FORM.TOOLTIP_HELP' | translate\"></cw-icon>\r\n </button>\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", "text", "label", "type", "iconSize", "iconCssClass", "iconUiType", "iconColorCustom", "spritePath"] }, { kind: "component", type: ButtonComponent, selector: "cw-button", inputs: ["type", "label", "labelParams", "id", "link", "isDropdown", "hideCaret", "withIcon", "withOnlyIcon", "iconSize", "iconPosition", "dropdownPosition", "isMinWidth", "isDisabled", "isLoading", "loadingAnnounce", "cssClass", "dataTest", "skeletonMode", "isPressed", "ariaDescribedBy", "ariaLabel", "ariaExpanded", "ariaControls", "withTooltip", "tooltipText", "tooltipTitle", "tooltipTrigger", "tooltipPosition", "tooltipType"], outputs: ["btnAction", "dropDownClicked"] }, { kind: "directive", type: CwTooltipDirective, selector: "[cwTooltip]", inputs: ["cwTooltip", "cwTooltipTitle", "cwTooltipType", "cwTooltipTrigger", "cwTooltipPosition", "cwTooltipDisabled"] }, { kind: "component", type: AutocompleteComponent, selector: "cw-autocomplete", inputs: ["control", "fetcher", "displayField", "valueField", "columns", "optionTemplate", "multiple", "minChars", "debounceMs", "selectedItem", "resolver", "selectedItems", "placeholder", "id", "isRequired", "isReadonly", "isDisabled", "ariaInvalid", "ariaDescribedBy"], outputs: ["itemSelected", "itemsChange"] }, { kind: "component", type: RichTextEditorComponent, selector: "cw-rich-text-editor", inputs: ["control", "options", "id", "placeholder", "isRequired", "isReadonly", "isDisabled", "ariaInvalid", "ariaDescribedBy"], outputs: ["valueChange"] }, { kind: "component", type: FilePreviewComponent, selector: "cw-file-preview", inputs: ["file", "existingFile", "showActions", "disabled", "dataTest"], outputs: ["remove"] }, { kind: "pipe", type: i1.KeyValuePipe, name: "keyvalue" }, { kind: "pipe", type: i2.TranslatePipe, name: "translate" }] }); }
4636
+ 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 }, labelParams: { classPropertyName: "labelParams", publicName: "labelParams", isSignal: false, isRequired: false, transformFunction: null }, displayLabel: { classPropertyName: "displayLabel", publicName: "displayLabel", isSignal: false, isRequired: false, transformFunction: null }, fieldTitle: { classPropertyName: "fieldTitle", publicName: "fieldTitle", isSignal: false, isRequired: false, transformFunction: null }, name: { classPropertyName: "name", publicName: "name", isSignal: false, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: false, isRequired: false, transformFunction: null }, autocomplete: { classPropertyName: "autocomplete", publicName: "autocomplete", isSignal: false, isRequired: false, transformFunction: null }, options: { classPropertyName: "options", publicName: "options", isSignal: false, isRequired: false, transformFunction: null }, rangeOptions: { classPropertyName: "rangeOptions", publicName: "rangeOptions", isSignal: false, isRequired: false, transformFunction: null }, validationOptions: { classPropertyName: "validationOptions", publicName: "validationOptions", isSignal: false, isRequired: false, transformFunction: null }, autocompleteOptions: { classPropertyName: "autocompleteOptions", publicName: "autocompleteOptions", isSignal: false, isRequired: false, transformFunction: null }, richTextOptions: { classPropertyName: "richTextOptions", publicName: "richTextOptions", isSignal: false, isRequired: false, transformFunction: null }, errorMessages: { classPropertyName: "errorMessages", publicName: "errorMessages", isSignal: false, isRequired: false, transformFunction: null }, isRequired: { classPropertyName: "isRequired", publicName: "isRequired", isSignal: false, isRequired: false, transformFunction: null }, requiredStart: { classPropertyName: "requiredStart", publicName: "requiredStart", isSignal: false, isRequired: false, transformFunction: null }, requiredEnd: { classPropertyName: "requiredEnd", publicName: "requiredEnd", isSignal: false, isRequired: false, transformFunction: null }, periodShortcuts: { classPropertyName: "periodShortcuts", publicName: "periodShortcuts", isSignal: false, isRequired: false, transformFunction: null }, description: { classPropertyName: "description", publicName: "description", isSignal: false, isRequired: false, transformFunction: null }, help: { classPropertyName: "help", publicName: "help", isSignal: false, isRequired: false, transformFunction: null }, helpParams: { classPropertyName: "helpParams", publicName: "helpParams", isSignal: false, isRequired: false, transformFunction: null }, tooltip: { classPropertyName: "tooltip", publicName: "tooltip", isSignal: false, isRequired: false, transformFunction: null }, ariaDescribedBy: { classPropertyName: "ariaDescribedBy", publicName: "ariaDescribedBy", isSignal: false, isRequired: false, transformFunction: null }, addonLeft: { classPropertyName: "addonLeft", publicName: "addonLeft", isSignal: false, isRequired: false, transformFunction: null }, addonRight: { classPropertyName: "addonRight", publicName: "addonRight", isSignal: false, isRequired: false, transformFunction: null }, isInAddon: { classPropertyName: "isInAddon", publicName: "isInAddon", isSignal: false, isRequired: false, transformFunction: null }, isReadonly: { classPropertyName: "isReadonly", publicName: "isReadonly", isSignal: false, isRequired: false, transformFunction: null }, isDisabled: { classPropertyName: "isDisabled", publicName: "isDisabled", isSignal: false, isRequired: false, transformFunction: null }, sliderValue: { classPropertyName: "sliderValue", publicName: "sliderValue", isSignal: false, isRequired: false, transformFunction: null }, sliderOptions: { classPropertyName: "sliderOptions", publicName: "sliderOptions", isSignal: false, isRequired: false, transformFunction: null }, cssClass: { classPropertyName: "cssClass", publicName: "cssClass", isSignal: false, isRequired: false, transformFunction: null }, skeletonMode: { classPropertyName: "skeletonMode", publicName: "skeletonMode", isSignal: false, isRequired: false, transformFunction: null }, clearable: { classPropertyName: "clearable", publicName: "clearable", isSignal: false, isRequired: false, transformFunction: null }, appendTo: { classPropertyName: "appendTo", publicName: "appendTo", isSignal: false, isRequired: false, transformFunction: null }, initialCountry: { classPropertyName: "initialCountry", publicName: "initialCountry", isSignal: false, isRequired: false, transformFunction: null }, recommendedDimensions: { classPropertyName: "recommendedDimensions", publicName: "recommendedDimensions", isSignal: false, isRequired: false, transformFunction: null }, showPreview: { classPropertyName: "showPreview", publicName: "showPreview", isSignal: false, isRequired: false, transformFunction: null }, existingFile: { classPropertyName: "existingFile", publicName: "existingFile", isSignal: false, isRequired: false, transformFunction: null }, indeterminate: { classPropertyName: "indeterminate", publicName: "indeterminate", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { refreshEvent: "refreshEvent", fileRemoved: "fileRemoved", textChanged: "textChanged", valueChange: "valueChange", phoneRegionChange: "phoneRegionChange" }, host: { properties: { "class": "this.hostClasses" } }, queries: [{ propertyName: "optionTemplate", first: true, predicate: ["ngOptionTpl"], descendants: true, read: TemplateRef }, { propertyName: "labelTemplate", first: true, predicate: ["ngLabelTpl"], descendants: true, read: TemplateRef }, { propertyName: "autocompleteOptionTpl", first: true, predicate: CwAutocompleteOptionDirective, descendants: true }], viewQueries: [{ propertyName: "checkboxInputRef", first: true, predicate: ["checkboxInput"], descendants: true, isSignal: true }, { propertyName: "fileInputRef", first: true, predicate: ["fileInput"], descendants: true, isSignal: true }, { propertyName: "phoneInputRef", first: true, predicate: ["phoneInput"], descendants: true, isSignal: true }, { propertyName: "autocompleteRef", first: true, predicate: AutocompleteComponent, descendants: true, isSignal: true }, { propertyName: "ngSelectRef", first: true, predicate: ["ngSelect"], 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 !isChoiceCard &&\r\n !isPeriod\r\n ) {\r\n <!-- Bouton d'aide HORS du <label> (bouton dans un label = HTML invalide, son libelle\r\n polluerait le nom accessible du champ et un clic activerait le label) : on aligne\r\n label + bouton dans un conteneur flex, seulement quand il y a une aide. -->\r\n @if (hasFieldTooltip) {\r\n <div class=\"d-flex-h gap-2xs\">\r\n <ng-container *ngTemplateOutlet=\"fieldLabel\"></ng-container>\r\n <ng-container *ngTemplateOutlet=\"fieldTooltip\"></ng-container>\r\n </div>\r\n } @else {\r\n <ng-container *ngTemplateOutlet=\"fieldLabel\"></ng-container>\r\n }\r\n }\r\n\r\n <!-- Une p\u00E9riode rend ses addons dans son propre field-group (entre les bornes et le fieldset). -->\r\n @if ((addonLeft || addonRight) && !isPeriod) {\r\n <div class=\"field-group\" [class.field-group-invalid]=\"isInvalid\" [class.field-group-disabled]=\"isDisabledOrReadonly\">\r\n @if(addonLeft) {\r\n <div class=\"field-group-addon-left\">\r\n <ng-container [ngTemplateOutlet]=\"addonLeft\"></ng-container>\r\n </div>\r\n }\r\n <ng-container [ngTemplateOutlet]=\"field\"></ng-container>\r\n @if(addonRight) {\r\n <div class=\"field-group-addon-right\">\r\n <ng-container [ngTemplateOutlet]=\"addonRight\"></ng-container>\r\n </div>\r\n }\r\n </div>\r\n }\r\n @else {\r\n @if ( isInInputGroup() ) {\r\n <div class=\"field-group\" [class.field-group-invalid]=\"isInvalid\" [class.field-group-disabled]=\"isDisabledOrReadonly\">\r\n <ng-container [ngTemplateOutlet]=\"field\"></ng-container>\r\n </div>\r\n }\r\n @else {\r\n <ng-container [ngTemplateOutlet]=\"field\"></ng-container>\r\n }\r\n }\r\n\r\n <!-- Error message -->\r\n @if (controlOrGroup?.invalid && controlOrGroup?.touched) {\r\n <div class=\"field-invalid\" [id]=\"'error-' + name\">\r\n @if (\r\n !errorMessages?.['required'] &&\r\n ((controlOrGroup?.errors?.['required']) || (getControl('start')?.errors?.['required'] || getControl('end')?.errors?.['required']))\r\n ) {\r\n <span [innerHtml]=\"'_COMMON._FORM.ERROR_IS_MANDATORY' | translate: {label: label | translate: labelParams}\"></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: helpParams }}</span>\r\n }\r\n @for (entry of autoHelpEntries; track entry.key) {\r\n <!-- Espace explicite : les blancs entre balises sont supprim\u00E9s \u00E0 la compilation. -->\r\n {{ ' ' }}<span>{{ entry.key | translate: entry.params }}</span>\r\n }\r\n </div>\r\n }\r\n\r\n <!-- Aper\u00E7u du fichier (type=file, opt-in) : sous le champ et ses aides, comme dans la\r\n maquette DS. La croix native du champ n'est pas retir\u00E9e \u2014 les deux vident le m\u00EAme\r\n control, l'aper\u00E7u ajoute juste \u00AB Visualiser \u00BB et une cible plus grande. -->\r\n @if (isPreviewVisible) {\r\n <cw-file-preview [file]=\"previewFile\" [existingFile]=\"existingFile ?? null\"\r\n [disabled]=\"!!isDisabledOrReadonly\" (remove)=\"onPreviewRemove()\" />\r\n }\r\n\r\n <!-- Chips de la multi-s\u00E9lection (autocomplete) : rendus ici, hors du field-group et apr\u00E8s\r\n erreur/help, pour \u00EAtre visuellement d\u00E9tach\u00E9s du champ. La donn\u00E9e et le retrait restent\r\n port\u00E9s par cw-autocomplete (`chips()` / `onChipRemove()`), seul l'affichage est d\u00E9l\u00E9gu\u00E9. -->\r\n @if (type === typeField.autocompleteMultiple && autocompleteRef()?.chips()?.length) {\r\n <ul class=\"autocomplete-chips\" role=\"list\">\r\n @for (chip of autocompleteRef()!.chips(); track chip.item) {\r\n <li>\r\n <button type=\"button\" class=\"autocomplete-chip\"\r\n [disabled]=\"isEffectivelyDisabled || isReadonly\"\r\n (click)=\"autocompleteRef()!.onChipRemove(chip.item)\">\r\n <span>{{ chip.label }}</span>\r\n @if (!isEffectivelyDisabled && !isReadonly) {\r\n <span aria-hidden=\"true\" class=\"autocomplete-chip-x\">&times;</span>\r\n <span class=\"visually-hidden\">{{ '_COMMON._ACTION.DELETE' | translate }}</span>\r\n }\r\n </button>\r\n </li>\r\n }\r\n </ul>\r\n }\r\n}\r\n@else {\r\n <ng-container [ngTemplateOutlet]=\"field\"></ng-container>\r\n}\r\n\r\n<ng-template #field>\r\n <!-- Autocomplete (mono / multi) -->\r\n @if ((type === typeField.autocomplete || type === typeField.autocompleteMultiple) && autocompleteOptions) {\r\n <cw-autocomplete\r\n [id]=\"name\"\r\n [control]=\"formControl\"\r\n [fetcher]=\"autocompleteOptions.fetcher\"\r\n [displayField]=\"autocompleteOptions.displayField ?? 'label'\"\r\n [valueField]=\"autocompleteOptions.valueField ?? 'id'\"\r\n [columns]=\"autocompleteOptions.columns ?? []\"\r\n [optionTemplate]=\"autocompleteOptions.optionTemplate ?? autocompleteOptionTpl?.templateRef ?? null\"\r\n [resolver]=\"autocompleteOptions.resolver ?? null\"\r\n [selectedItem]=\"autocompleteOptions.selectedItem ?? null\"\r\n [selectedItems]=\"autocompleteOptions.selectedItems ?? []\"\r\n [minChars]=\"autocompleteOptions.minChars ?? 2\"\r\n [debounceMs]=\"autocompleteOptions.debounceMs ?? 250\"\r\n [multiple]=\"type === typeField.autocompleteMultiple\"\r\n [isRequired]=\"isRequired\"\r\n [isReadonly]=\"!!isReadonly\"\r\n [isDisabled]=\"isEffectivelyDisabled\"\r\n [ariaInvalid]=\"control.invalid && control.touched\"\r\n [ariaDescribedBy]=\"getDescribedBy(control)\"\r\n [placeholder]=\"placeholder\">\r\n </cw-autocomplete>\r\n }\r\n\r\n <!-- Rich text editor (Quill) : sous-composant interne, sans field-group ni bouton clear\r\n (il porte sa propre bordure + toolbar). Le label statique du form-field reste au-dessus. -->\r\n @if (type === typeField.richText) {\r\n <cw-rich-text-editor\r\n [id]=\"name\"\r\n [control]=\"formControl\"\r\n [options]=\"richTextOptions\"\r\n [placeholder]=\"placeholder ? (placeholder | translate) : ''\"\r\n [isRequired]=\"isRequired\"\r\n [isReadonly]=\"!!isReadonly\"\r\n [isDisabled]=\"isEffectivelyDisabled\"\r\n [ariaInvalid]=\"control.invalid && control.touched\"\r\n [ariaDescribedBy]=\"getDescribedBy(control)\">\r\n </cw-rich-text-editor>\r\n }\r\n\r\n <!-- Text -->\r\n @if ([typeField.text, typeField.date, typeField.time, typeField.dateTime, typeField.number,\r\n typeField.email,\r\n typeField.color, typeField.zipCode].includes(type)) {\r\n <input [type]=\"type === typeField.zipCode ? 'text' : type\" class=\"field-control\" [id]=\"name\" [formControl]=\"formControl\"\r\n [attr.title]=\"fieldTitle ? (fieldTitle | translate) : null\"\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 <!-- L'input natif reste LE controle (focus, clavier, restitution aux lecteurs d'ecran,\r\n validation), mais il est masque visuellement : le libelle de son bouton et son\r\n \u00AB aucun fichier choisi \u00BB sont ecrits par le NAVIGATEUR, dans SA langue. Ils sont\r\n intraduisibles et ne suivent pas la langue de l'application \u2014 un utilisateur qui\r\n bascule en anglais garderait \u00AB Choisir un fichier \u00BB. On les reecrit donc a cote,\r\n traduits, dans une couche purement visuelle. -->\r\n <input #fileInput type=\"file\" class=\"field-control visually-hidden\" [id]=\"name\"\r\n [ngClass]=\"[(cssClass || ''), formControl?.value ? 'has-value' : '']\"\r\n [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 <!-- `aria-hidden` : doublon visuel de l'input, que les lecteurs d'ecran restituent deja\r\n (nom du champ, bouton de parcours, fichier selectionne). L'annoncer une seconde fois\r\n ne ferait que bavarder. Le clic est relaye a l'input, le clavier passe par lui. -->\r\n <span class=\"field-file\" aria-hidden=\"true\" (click)=\"openFilePicker()\">\r\n <span class=\"field-file-button\">{{ '_COMMON._FORM.CHOOSE_FILE' | translate }}</span>\r\n <span class=\"field-file-name\" [class.field-file-name-empty]=\"!selectedFileName\">\r\n {{ selectedFileName ?? ('_COMMON._FORM.NO_FILE_SELECTED' | translate) }}\r\n </span>\r\n </span>\r\n }\r\n\r\n @if (type === typeField.password) {\r\n <input [type]=\"isPasswordShown ? 'text' : 'password'\" class=\"field-control\" [id]=\"name\" [formControl]=\"formControl\"\r\n [ngClass]=\"[(cssClass || ''), formControl?.value ? 'has-value' : '']\"\r\n [attr.required]=\"isRequired ? 'required' : null\" [attr.readonly]=\"isReadonly ? 'readonly' : null\"\r\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\" [attr.aria-required]=\"isRequired\"\r\n [attr.minlength]=\"minLengthAttr\" [attr.maxlength]=\"maxLengthAttr\" [attr.pattern]=\"patternAttr\"\r\n [attr.autocomplete]=\"autocomplete\"\r\n [attr.aria-invalid]=\"control.invalid && control.touched\"\r\n [attr.aria-describedby]=\"getDescribedBy(control)\"\r\n (focus)=\"onFocus()\" (blur)=\"onBlur()\" />\r\n <cw-button [type]=\"buttonType.ghost\"\r\n cssClass=\"btn-password-field\"\r\n [withIcon]=\"isPasswordShown ? spriteIcon.toolbarHidePassword : spriteIcon.toolbarShowPassword\"\r\n [withOnlyIcon]=\"true\"\r\n [label]=\"isPasswordShown ? '_COMMON._FORM._SHOW_HIDE_PWD.HIDE' : '_COMMON._FORM._SHOW_HIDE_PWD.SHOW'\"\r\n (btnAction)=\"togglePasswordVisibility()\">\r\n </cw-button>\r\n }\r\n\r\n <!-- Textarea -->\r\n @if (type === typeField.textarea) {\r\n <textarea class=\"field-control\" [id]=\"name\" [formControl]=\"formControl\"\r\n [ngClass]=\"[(cssClass || ''), formControl?.value ? 'has-value' : '']\"\r\n [attr.placeholder]=\"placeholder ? (placeholder | translate) : null\" [attr.required]=\"isRequired ? 'required' : null\"\r\n [attr.readonly]=\"isReadonly ? 'readonly' : null\" [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\"\r\n [attr.aria-required]=\"isRequired\" [attr.aria-invalid]=\"control.invalid && control.touched\"\r\n [attr.minlength]=\"minLengthAttr\" [attr.maxlength]=\"maxLengthAttr\" [attr.pattern]=\"patternAttr\"\r\n [attr.autocomplete]=\"autocomplete\"\r\n [attr.aria-describedby]=\"getDescribedBy(control)\"\r\n (focus)=\"onFocus()\" (blur)=\"onBlur()\"></textarea>\r\n }\r\n\r\n <!-- Select -->\r\n @if (type === typeField.select) {\r\n @defer (on immediate) {\r\n <ng-select #ngSelect [formControl]=\"formControl\" [items]=\"options\" bindLabel=\"label\" [labelForId]=\"name\" [appendTo]=\"appendTo ?? ''\" bindValue=\"value\"\r\n [ngClass]=\"cssClass\" [searchable]=\"false\" [placeholder]=\"placeholder ? (placeholder | translate) : ''\" [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()\" (open)=\"onDropdownOpen()\" (close)=\"onDropdownClose()\">\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 } @placeholder {\r\n <div class=\"field-control\" aria-hidden=\"true\"></div>\r\n }\r\n }\r\n\r\n <!-- NgSelect -->\r\n @if (type === typeField.ngSelect || type === typeField.ngSelectMultiple) {\r\n @defer (on immediate) {\r\n <ng-select #ngSelect [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) : ''\" [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 (open)=\"onDropdownOpen()\" (close)=\"onDropdownClose()\">\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 } @placeholder {\r\n <div class=\"field-control\" aria-hidden=\"true\"></div>\r\n }\r\n }\r\n\r\n <!-- Radio -->\r\n @if (type === typeField.radioInline || type === typeField.radio) {\r\n <fieldset [attr.aria-labelledby]=\"hasFieldTooltip ? legendId : null\"\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\" [class.d-flex-h]=\"hasFieldTooltip\" [class.gap-2xs]=\"hasFieldTooltip\">\r\n <span [id]=\"legendId\">\r\n {{label | translate: labelParams}}\r\n @if(isRequired) {\r\n <span class=\"text-danger\">*</span>\r\n }\r\n </span>\r\n @if (hasFieldTooltip) {\r\n <ng-container *ngTemplateOutlet=\"fieldTooltip\"></ng-container>\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 gap-sm'\">\r\n @for (opt of options; track opt.value) {\r\n <li class=\"field-check\">\r\n <input type=\"radio\" [id]=\"name + '_' + opt.value\" [attr.name]=\"name\" [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 [attr.aria-labelledby]=\"hasFieldTooltip ? legendId : null\"\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\" [class.d-flex-h]=\"hasFieldTooltip\" [class.gap-2xs]=\"hasFieldTooltip\">\r\n <span [id]=\"legendId\">\r\n {{label | translate: labelParams}}\r\n @if(isRequired) {\r\n <span class=\"text-danger\">*</span>\r\n }\r\n </span>\r\n @if (hasFieldTooltip) {\r\n <ng-container *ngTemplateOutlet=\"fieldTooltip\"></ng-container>\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\" [attr.name]=\"name\" [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 <!-- Cartes : checkbox / radio / switch (contr\u00F4le \u00E0 gauche, titre, description facultative) -->\r\n @if (isChoiceCard) {\r\n @if (isBooleanChoiceCard) {\r\n <!-- Carte bool\u00E9enne (sans options) : une case li\u00E9e au FormControl<boolean>, nomm\u00E9e par le titre. -->\r\n <div class=\"field-card-list\" [class.field-card-list-compact]=\"isChoiceCardCompact\">\r\n <label class=\"field-card d-flex-h items-start gap-xs\" [for]=\"name\" [class.field-switch]=\"isSwitchCard\" [class.field-switch-small]=\"isSwitchCard\">\r\n <input type=\"checkbox\" [id]=\"name\" [formControl]=\"formControl\" class=\"field-check-input\"\r\n [attr.role]=\"isSwitchCard ? 'switch' : null\"\r\n [attr.aria-required]=\"isRequired\"\r\n [attr.aria-invalid]=\"control.invalid && control.touched\"\r\n [attr.aria-describedby]=\"booleanCardDescribedBy\"\r\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\" />\r\n <span class=\"d-flex-v gap-5xs\">\r\n <span class=\"field-card-title\">\r\n {{ label | translate: labelParams }}\r\n @if (isRequired) {\r\n <span class=\"text-danger\">*</span>\r\n }\r\n </span>\r\n @if (!isChoiceCardCompact && description) {\r\n <span class=\"field-text\" [id]=\"name + '-desc'\">{{ description | translate }}</span>\r\n }\r\n </span>\r\n </label>\r\n </div>\r\n } @else {\r\n <fieldset [attr.aria-labelledby]=\"hasFieldTooltip ? legendId : null\"\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\" [class.d-flex-h]=\"hasFieldTooltip\" [class.gap-2xs]=\"hasFieldTooltip\">\r\n <span [id]=\"legendId\">\r\n {{label | translate: labelParams}}\r\n @if(isRequired) {\r\n <span class=\"text-danger\">*</span>\r\n }\r\n </span>\r\n @if (hasFieldTooltip) {\r\n <ng-container *ngTemplateOutlet=\"fieldTooltip\"></ng-container>\r\n }\r\n </legend>\r\n <ul class=\"field-card-list list-unstyled mb-none\" [class.field-card-list-compact]=\"isChoiceCardCompact\">\r\n @for (opt of options; track opt.value) {\r\n <li class=\"d-flex-v\">\r\n <!-- Le label englobe toute la carte : un clic n'importe o\u00F9 coche l'option. -->\r\n <label class=\"field-card d-flex-h items-start gap-xs flex-1\" [for]=\"name + '_' + opt.value\" [class.field-switch]=\"isSwitchCard\" [class.field-switch-small]=\"isSwitchCard\">\r\n @if (isRadioCard) {\r\n <input type=\"radio\" [id]=\"name + '_' + opt.value\" [attr.name]=\"name\" [value]=\"opt.value\" [formControl]=\"formControl\"\r\n class=\"field-check-input\"\r\n [attr.aria-describedby]=\"(!isChoiceCardCompact && opt.description) ? name + '_' + opt.value + '-desc' : null\"\r\n [attr.disabled]=\"(isEffectivelyDisabled || opt.disabled) ? 'disabled' : null\" (change)=\"onRadioChange(opt.value)\" />\r\n } @else {\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.role]=\"isSwitchCard ? 'switch' : null\"\r\n [attr.aria-describedby]=\"(!isChoiceCardCompact && opt.description) ? name + '_' + opt.value + '-desc' : null\"\r\n [attr.disabled]=\"(isEffectivelyDisabled || opt.disabled) ? 'disabled' : null\" />\r\n }\r\n <span class=\"d-flex-v gap-5xs\">\r\n <span class=\"field-card-title\">{{ opt.label | translate }}</span>\r\n @if (!isChoiceCardCompact && opt.description) {\r\n <span class=\"field-text\" [id]=\"name + '_' + opt.value + '-desc'\">{{ opt.description | translate }}</span>\r\n }\r\n </span>\r\n </label>\r\n </li>\r\n }\r\n </ul>\r\n </fieldset>\r\n }\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: labelParams }}</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: labelParams }}\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 [attr.aria-labelledby]=\"hasFieldTooltip ? legendId : null\"\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\" [class.d-flex-h]=\"hasFieldTooltip\" [class.gap-2xs]=\"hasFieldTooltip\">\r\n <span [id]=\"legendId\">\r\n {{label | translate: labelParams}}\r\n @if(isRequired) {\r\n <span class=\"text-danger\">*</span>\r\n }\r\n </span>\r\n @if (hasFieldTooltip) {\r\n <ng-container *ngTemplateOutlet=\"fieldTooltip\"></ng-container>\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 gap-sm'\">\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 [attr.aria-labelledby]=\"hasFieldTooltip ? legendId : null\">\r\n <legend class=\"field-label\" [class.visually-hidden]=\"!displayLabel\" [class.d-flex-h]=\"hasFieldTooltip\" [class.gap-2xs]=\"hasFieldTooltip\">\r\n <span [id]=\"legendId\">\r\n {{label | translate: labelParams}}\r\n </span>\r\n @if (hasFieldTooltip) {\r\n <ng-container *ngTemplateOutlet=\"fieldTooltip\"></ng-container>\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 gap-sm'\">\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 [attr.aria-labelledby]=\"hasFieldTooltip ? legendId : null\"\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\" [class.d-flex-h]=\"hasFieldTooltip\" [class.gap-2xs]=\"hasFieldTooltip\">\r\n <span [id]=\"legendId\">\r\n {{label | translate: labelParams}}\r\n @if(isRequired) {\r\n <span class=\"text-danger\">*</span>\r\n }\r\n </span>\r\n @if (hasFieldTooltip) {\r\n <ng-container *ngTemplateOutlet=\"fieldTooltip\"></ng-container>\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 [attr.aria-labelledby]=\"hasFieldTooltip ? legendId : null\">\r\n <legend class=\"field-label\" [class.visually-hidden]=\"!displayLabel\" [class.d-flex-h]=\"hasFieldTooltip\" [class.gap-2xs]=\"hasFieldTooltip\">\r\n <span [id]=\"legendId\">\r\n {{label | translate: labelParams}}\r\n </span>\r\n @if (hasFieldTooltip) {\r\n <ng-container *ngTemplateOutlet=\"fieldTooltip\"></ng-container>\r\n }\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 (isPeriod) {\r\n <!-- Fieldset : le legend nomme la p\u00E9riode, \u00AB Du \u00BB / \u00AB au \u00BB sont les labels de chaque input. -->\r\n <fieldset [attr.aria-labelledby]=\"hasFieldTooltip ? legendId : null\">\r\n <legend class=\"field-label\" [class.visually-hidden]=\"!displayLabel\" [class.d-flex-h]=\"hasFieldTooltip\" [class.gap-2xs]=\"hasFieldTooltip\">\r\n <span [id]=\"legendId\">\r\n {{label | translate: labelParams}}\r\n <!-- Deux bornes obligatoires : ast\u00E9risque sur la p\u00E9riode ; une seule : sur sa borne. -->\r\n @if(isStartRequired && isEndRequired) {\r\n <span class=\"text-danger\">*</span>\r\n }\r\n </span>\r\n @if (hasFieldTooltip) {\r\n <ng-container *ngTemplateOutlet=\"fieldTooltip\"></ng-container>\r\n }\r\n </legend>\r\n <!-- \u00C9tats invalide / d\u00E9sactiv\u00E9 pos\u00E9s seulement avec addon ou raccourcis (rendu historique sinon). -->\r\n <div class=\"field-group\"\r\n [class.field-group-invalid]=\"hasPeriodAddons && isInvalid\"\r\n [class.field-group-disabled]=\"hasPeriodAddons && isDisabledOrReadonly\">\r\n @if (addonLeft) {\r\n <div class=\"field-group-addon-left\">\r\n <ng-container [ngTemplateOutlet]=\"addonLeft\"></ng-container>\r\n </div>\r\n }\r\n <label class=\"field-group-addon-left\" [for]=\"name + '_start'\">\r\n {{ '_COMMON._DATES.FROM_TO_1' | translate }}\r\n @if(isStartRequired && !isEndRequired) {\r\n <span class=\"text-danger\">*</span>\r\n }\r\n </label>\r\n <input [type]=\"getInputType()\" class=\"field-control\" [id]=\"name + '_start'\" [formControl]=\"getControl('start')!\"\r\n [attr.title]=\"fieldTitle ? (fieldTitle | translate) + ' \u2013 ' + ('_COMMON._DATES.FROM_TO_1' | translate) : null\"\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]=\"isStartRequired ? 'required' : null\" [attr.readonly]=\"isReadonly ? 'readonly' : null\"\r\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\" [attr.aria-required]=\"isStartRequired\"\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')\" (blur)=\"onBlurRange('start')\" />\r\n\r\n @if(getControl('start')?.value && !isDisabledOrReadonly) {\r\n <button type=\"button\" class=\"btn btn-secondary btn-clear-field\"\r\n [attr.aria-label]=\"'_COMMON._FORM.CLEAR_START' | translate: { label: label | translate: labelParams }\"\r\n (click)=\"onClearFieldPeriod('start')\">\r\n <span aria-hidden=\"true\">&times;</span>\r\n </button>\r\n }\r\n <label class=\"field-group-addon-center\" [for]=\"name + '_end'\">\r\n {{ '_COMMON._DATES.FROM_TO_2' | translate }}\r\n @if(isEndRequired && !isStartRequired) {\r\n <span class=\"text-danger\">*</span>\r\n }\r\n </label>\r\n <input [type]=\"getInputType()\" class=\"field-control\" [id]=\"name + '_end'\" [formControl]=\"getControl('end')!\"\r\n [attr.title]=\"fieldTitle ? (fieldTitle | translate) + ' \u2013 ' + ('_COMMON._DATES.FROM_TO_2' | translate) : null\"\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]=\"isEndRequired ? 'required' : null\" [attr.readonly]=\"isReadonly ? 'readonly' : null\"\r\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\" [attr.aria-required]=\"isEndRequired\"\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')\" (blur)=\"onBlurRange('end')\" />\r\n\r\n @if(getControl('end')?.value && !isDisabledOrReadonly) {\r\n <button type=\"button\" class=\"btn btn-ghost btn-clear-field\"\r\n [attr.aria-label]=\"'_COMMON._FORM.CLEAR_END' | translate: { label: label | translate: labelParams }\"\r\n (click)=\"onClearFieldPeriod('end')\">\r\n <span aria-hidden=\"true\">&times;</span>\r\n </button>\r\n }\r\n\r\n <!-- Raccourcis (dateToDate) puis addon droit : dans le fieldset, apr\u00E8s la borne de fin. -->\r\n @for (shortcut of activePeriodShortcuts; track $index) {\r\n <div class=\"field-group-addon-right\">\r\n <button type=\"button\" class=\"btn btn-ghost\"\r\n [class.active]=\"isPeriodShortcutActive(shortcut)\"\r\n [attr.aria-pressed]=\"isPeriodShortcutActive(shortcut)\"\r\n [attr.aria-label]=\"shortcut.ariaLabel ? (shortcut.ariaLabel | translate) : null\"\r\n [attr.disabled]=\"isDisabledOrReadonly ? 'disabled' : null\"\r\n (click)=\"onPeriodShortcut(shortcut)\">\r\n {{ shortcut.label | translate }}\r\n </button>\r\n </div>\r\n }\r\n @if (addonRight) {\r\n <div class=\"field-group-addon-right\">\r\n <ng-container [ngTemplateOutlet]=\"addonRight\"></ng-container>\r\n </div>\r\n }\r\n </div>\r\n </fieldset>\r\n }\r\n\r\n @if ([typeField.datePlusOne, typeField.datePlusTwo, typeField.datePlusSeven, typeField.dateComplexe].includes(type)) {\r\n\r\n <div class=\"field-group\">\r\n @if (type === typeField.dateComplexe) {\r\n <div class=\"field-group-addon-left\">\r\n <button class=\"btn btn-ghost\" type=\"button\" (click)=\"onDateAddDay('prev')\"\r\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\">\r\n <cw-icon font=\"optyweb\" [icon]=\"spriteIcon.nextLeft\" [label]=\"'Jour pr\u00E9c\u00E9dent'\"></cw-icon>\r\n </button>\r\n </div>\r\n }\r\n\r\n <input type=\"date\" class=\"field-control\" [id]=\"name\" [formControl]=\"formControl\"\r\n [attr.title]=\"fieldTitle ? (fieldTitle | translate) : null\"\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.aria-required]=\"isRequired\"\r\n [attr.min]=\"minAttr\" [attr.max]=\"maxAttr\" [attr.step]=\"stepAttr\"\r\n [attr.autocomplete]=\"autocomplete\"\r\n [attr.aria-invalid]=\"control.invalid && control.touched\"\r\n [attr.aria-describedby]=\"getDescribedBy(control)\"\r\n (focus)=\"onFocus()\" (blur)=\"onBlur()\" />\r\n\r\n @if(formControl?.value && !isDisabledOrReadonly) {\r\n <button class=\"btn btn-ghost btn-clear-field\" type=\"button\"\r\n [attr.aria-label]=\"'_COMMON._FORM.CLEAR_FIELD' | translate: { label: label | translate: labelParams }\"\r\n (click)=\"onClearField(formControl)\"><span aria-hidden=\"true\">&times;</span></button>\r\n }\r\n\r\n\r\n @if (type === typeField.dateComplexe) {\r\n <div class=\"field-group-addon-right\">\r\n <button class=\"btn btn-ghost\" type=\"button\" (click)=\"onDateAddDay('next')\"\r\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\">\r\n <cw-icon font=\"optyweb\" [icon]=\"spriteIcon.nextRight\" [label]=\"'Jour suivant'\"></cw-icon>\r\n </button>\r\n </div>\r\n <div class=\"field-group-addon-right\">\r\n <button class=\"btn btn-ghost\" type=\"button\" (click)=\"onRefresh()\"\r\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\">\r\n <cw-icon font=\"optyweb\" [icon]=\"spriteIcon.toolbarRefresh\" [label]=\"'Rafra\u00EEchir'\"></cw-icon>\r\n </button>\r\n </div>\r\n }\r\n\r\n <div class=\"field-group-addon-right\">\r\n <button class=\"btn btn-ghost\" type=\"button\" (click)=\"onTodayAddDay(0)\"\r\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\">\r\n J\r\n <span class=\"visually-hidden\">Aujourd'hui</span>\r\n </button>\r\n </div>\r\n <div class=\"field-group-addon-right\">\r\n <button class=\"btn btn-ghost\" type=\"button\" (click)=\"onTodayAddDay(1)\"\r\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\">\r\n J+1\r\n <span class=\"visually-hidden\">Demain</span>\r\n </button>\r\n </div>\r\n\r\n @if (type !== typeField.datePlusOne && type !== typeField.dateComplexe) {\r\n <div class=\"field-group-addon-right\">\r\n <button class=\"btn btn-ghost \" type=\"button\" (click)=\"onTodayAddDay(2)\"\r\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\">\r\n J+2\r\n <span class=\"visually-hidden\">Dans 2 jours</span>\r\n </button>\r\n </div>\r\n\r\n @if (type !== typeField.datePlusTwo) {\r\n <div class=\"field-group-addon-right\">\r\n <button class=\"btn btn-ghost\" type=\"button\" (click)=\"onTodayAddDay(7)\"\r\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\">\r\n J+7\r\n <span class=\"visually-hidden\">Dans 7 jours</span>\r\n </button>\r\n </div>\r\n }\r\n }\r\n </div>\r\n }\r\n\r\n @if (type === typeField.slider) {\r\n @defer (on immediate) {\r\n <cw-slider-field [(value)]=\"sliderValue\" [options]=\"sliderOptions\" [control]=\"formControl\" />\r\n }\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: labelParams }} {{ formControl.value }}\r\n @if (rangeOptions.unit) {\r\n <abbr [title]=\"rangeOptions.unit\">{{ rangeOptions.unit }}</abbr>\r\n }\r\n </label>\r\n\r\n <div class=\"slider-custom-bar\">\r\n <div class=\"slider-custom-bar-selection\" [style.width]=\"getRangePercent() + '%'\">\r\n </div>\r\n </div>\r\n\r\n <input type=\"range\" [id]=\"name\" [formControl]=\"formControl\" [min]=\"rangeOptions.floor\" [max]=\"rangeOptions.ceil\"\r\n [step]=\"rangeOptions.step || 1\" class=\"field-control-range\" [attr.aria-required]=\"isRequired\"\r\n [attr.aria-invalid]=\"control.invalid && control.touched\">\r\n </div>\r\n\r\n <cw-button [isDisabled]=\"formControl.value >= rangeOptions.ceil\" [label]=\"'Augmenter ' + formControl.value + ' ' + label\"\r\n [withIcon]=\"spriteIcon.toolbarPlus\" [withOnlyIcon]=\"true\" [type]=\"buttonType.primary\"\r\n [iconSize]=\"buttonIconSize.small\" (btnAction)=\"onRangeStep('increase')\">\r\n </cw-button>\r\n </div>\r\n }\r\n\r\n @if (isInInputGroup() && clearable && !isDisabledOrReadonly && type !== typeField.autocompleteMultiple) {\r\n @if (type === typeField.autocomplete) {\r\n @if (autocompleteRef()?.hasAnyContent()) {\r\n <button class=\"btn btn-secondary btn-clear-field\" type=\"button\"\r\n [attr.aria-label]=\"'_COMMON._FORM.CLEAR_FIELD' | translate: { label: label | translate: labelParams }\"\r\n (click)=\"onClearAutocomplete()\"><span aria-hidden=\"true\">&times;</span></button>\r\n }\r\n } @else if (type === typeField.ngSelectMultiple) {\r\n <!-- value est un tableau : un [] vide \u00E9tant truthy, on teste .length pour n'afficher le clear global que s'il y a au moins une s\u00E9lection. -->\r\n @if (formControl?.value?.length) {\r\n <button class=\"btn btn-ghost btn-clear-field\" type=\"button\"\r\n [attr.aria-label]=\"'_COMMON._FORM.CLEAR_FIELD' | translate: { label: label | translate: labelParams }\"\r\n (click)=\"onClearField(formControl)\"><span aria-hidden=\"true\">&times;</span></button>\r\n }\r\n } @else {\r\n @if(formControl?.value) {\r\n <button class=\"btn btn-ghost btn-clear-field\" type=\"button\"\r\n [attr.aria-label]=\"'_COMMON._FORM.CLEAR_FIELD' | translate: { label: label | translate: labelParams }\"\r\n (click)=\"onClearField(formControl)\"><span aria-hidden=\"true\">&times;</span></button>\r\n }\r\n }\r\n }\r\n\r\n</ng-template>\r\n\r\n<ng-template #fieldLabel>\r\n <label [for]=\"name\" class=\"field-label\" [class.visually-hidden]=\"!displayLabel\">\r\n {{ label | translate: labelParams }}\r\n\r\n @if (isRequired) {\r\n <span class=\"text-danger\">*</span>\r\n }\r\n </label>\r\n</ng-template>\r\n\r\n<!-- Bouton d'aide (tooltip) partage label/legend. Hors du <label> (sinon son libelle\r\n s'ajoute au nom du champ et le clic active le label) ; dans un <legend>, le fieldset\r\n est nomme par aria-labelledby sur le seul texte (legendId) pour la meme raison. -->\r\n<ng-template #fieldTooltip>\r\n <button type=\"button\" class=\"btn btn-ghost btn-field-tooltip\"\r\n [cwTooltip]=\"tooltip ?? ''\"\r\n [attr.data-test-ctw]=\"'tooltip-' + name\">\r\n <cw-icon [icon]=\"spriteIcon.alertHelp\" [type]=\"iconType.circular\" [iconUiType]=\"iconUiType.info\"\r\n [iconSize]=\"iconSize.xs\" [label]=\"'_COMMON._FORM.TOOLTIP_HELP' | translate\"></cw-icon>\r\n </button>\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: "component", type: IconComponent, selector: "cw-icon", inputs: ["icon", "text", "label", "type", "iconSize", "iconCssClass", "iconUiType", "iconColorCustom", "spritePath"] }, { kind: "component", type: ButtonComponent, selector: "cw-button", inputs: ["type", "label", "labelParams", "id", "link", "isDropdown", "hideCaret", "withIcon", "withOnlyIcon", "iconSize", "iconPosition", "dropdownPosition", "isMinWidth", "isDisabled", "isLoading", "loadingAnnounce", "cssClass", "dataTest", "skeletonMode", "isPressed", "ariaDescribedBy", "ariaLabel", "ariaExpanded", "ariaControls", "withTooltip", "tooltipText", "tooltipTitle", "tooltipTrigger", "tooltipPosition", "tooltipType"], outputs: ["btnAction", "dropDownClicked"] }, { kind: "directive", type: CwTooltipDirective, selector: "[cwTooltip]", inputs: ["cwTooltip", "cwTooltipTitle", "cwTooltipType", "cwTooltipTrigger", "cwTooltipPosition", "cwTooltipDisabled"] }, { kind: "component", type: AutocompleteComponent, selector: "cw-autocomplete", inputs: ["control", "fetcher", "displayField", "valueField", "columns", "optionTemplate", "multiple", "minChars", "debounceMs", "selectedItem", "resolver", "selectedItems", "placeholder", "id", "isRequired", "isReadonly", "isDisabled", "ariaInvalid", "ariaDescribedBy"], outputs: ["itemSelected", "itemsChange"] }, { kind: "component", type: RichTextEditorComponent, selector: "cw-rich-text-editor", inputs: ["control", "options", "id", "placeholder", "isRequired", "isReadonly", "isDisabled", "ariaInvalid", "ariaDescribedBy"], outputs: ["valueChange"] }, { kind: "component", type: FilePreviewComponent, selector: "cw-file-preview", inputs: ["file", "existingFile", "showActions", "disabled", "dataTest"], outputs: ["remove"] }, { kind: "pipe", type: i1.KeyValuePipe, name: "keyvalue" }, { kind: "pipe", type: i2.TranslatePipe, name: "translate" }], deferBlockDependencies: [() => [i1.NgClass, i1.NgTemplateOutlet, i2$1.NgControlStatus, i2$1.FormControlDirective, import('@ng-select/ng-select').then(m => m.NgSelectComponent), import('@ng-select/ng-select').then(m => m.NgOptionTemplateDirective), import('@ng-select/ng-select').then(m => m.NgLabelTemplateDirective), i2.TranslatePipe], () => [i1.NgClass, i1.NgTemplateOutlet, i2$1.NgControlStatus, i2$1.FormControlDirective, import('@ng-select/ng-select').then(m => m.NgSelectComponent), import('@ng-select/ng-select').then(m => m.NgOptionTemplateDirective), import('@ng-select/ng-select').then(m => m.NgLabelTemplateDirective), i2.TranslatePipe], () => [import('./cityway-basic-ui-slider-field.component-DNoKU63R.mjs').then(m => m.SliderFieldComponent)]] }); }
4629
4637
  }
4630
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: FormFieldComponent, decorators: [{
4631
- type: Component,
4632
- args: [{ selector: 'cw-form-field', standalone: true, imports: [
4633
- CommonModule,
4634
- TranslateModule,
4635
- FormsModule,
4636
- ReactiveFormsModule,
4637
- NgSelectModule,
4638
- NgxSliderModule,
4639
- IconComponent,
4640
- ButtonComponent,
4641
- CwTooltipDirective,
4642
- AutocompleteComponent,
4643
- RichTextEditorComponent,
4644
- FilePreviewComponent
4645
- ], 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 !isChoiceCard &&\r\n !isPeriod\r\n ) {\r\n <!-- Bouton d'aide HORS du <label> (bouton dans un label = HTML invalide, son libelle\r\n polluerait le nom accessible du champ et un clic activerait le label) : on aligne\r\n label + bouton dans un conteneur flex, seulement quand il y a une aide. -->\r\n @if (hasFieldTooltip) {\r\n <div class=\"d-flex-h gap-2xs\">\r\n <ng-container *ngTemplateOutlet=\"fieldLabel\"></ng-container>\r\n <ng-container *ngTemplateOutlet=\"fieldTooltip\"></ng-container>\r\n </div>\r\n } @else {\r\n <ng-container *ngTemplateOutlet=\"fieldLabel\"></ng-container>\r\n }\r\n }\r\n\r\n <!-- Une p\u00E9riode rend ses addons dans son propre field-group (entre les bornes et le fieldset). -->\r\n @if ((addonLeft || addonRight) && !isPeriod) {\r\n <div class=\"field-group\" [class.field-group-invalid]=\"isInvalid\" [class.field-group-disabled]=\"isDisabledOrReadonly\">\r\n @if(addonLeft) {\r\n <div class=\"field-group-addon-left\">\r\n <ng-container [ngTemplateOutlet]=\"addonLeft\"></ng-container>\r\n </div>\r\n }\r\n <ng-container [ngTemplateOutlet]=\"field\"></ng-container>\r\n @if(addonRight) {\r\n <div class=\"field-group-addon-right\">\r\n <ng-container [ngTemplateOutlet]=\"addonRight\"></ng-container>\r\n </div>\r\n }\r\n </div>\r\n }\r\n @else {\r\n @if ( isInInputGroup() ) {\r\n <div class=\"field-group\" [class.field-group-invalid]=\"isInvalid\" [class.field-group-disabled]=\"isDisabledOrReadonly\">\r\n <ng-container [ngTemplateOutlet]=\"field\"></ng-container>\r\n </div>\r\n }\r\n @else {\r\n <ng-container [ngTemplateOutlet]=\"field\"></ng-container>\r\n }\r\n }\r\n\r\n <!-- Error message -->\r\n @if (controlOrGroup?.invalid && controlOrGroup?.touched) {\r\n <div class=\"field-invalid\" [id]=\"'error-' + name\">\r\n @if (\r\n !errorMessages?.['required'] &&\r\n ((controlOrGroup?.errors?.['required']) || (getControl('start')?.errors?.['required'] || getControl('end')?.errors?.['required']))\r\n ) {\r\n <span [innerHtml]=\"'_COMMON._FORM.ERROR_IS_MANDATORY' | translate: {label: label | translate: labelParams}\"></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: helpParams }}</span>\r\n }\r\n @for (entry of autoHelpEntries; track entry.key) {\r\n <!-- Espace explicite : les blancs entre balises sont supprim\u00E9s \u00E0 la compilation. -->\r\n {{ ' ' }}<span>{{ entry.key | translate: entry.params }}</span>\r\n }\r\n </div>\r\n }\r\n\r\n <!-- Aper\u00E7u du fichier (type=file, opt-in) : sous le champ et ses aides, comme dans la\r\n maquette DS. La croix native du champ n'est pas retir\u00E9e \u2014 les deux vident le m\u00EAme\r\n control, l'aper\u00E7u ajoute juste \u00AB Visualiser \u00BB et une cible plus grande. -->\r\n @if (isPreviewVisible) {\r\n <cw-file-preview [file]=\"previewFile\" [existingFile]=\"existingFile ?? null\"\r\n [disabled]=\"!!isDisabledOrReadonly\" (remove)=\"onPreviewRemove()\" />\r\n }\r\n\r\n <!-- Chips de la multi-s\u00E9lection (autocomplete) : rendus ici, hors du field-group et apr\u00E8s\r\n erreur/help, pour \u00EAtre visuellement d\u00E9tach\u00E9s du champ. La donn\u00E9e et le retrait restent\r\n port\u00E9s par cw-autocomplete (`chips()` / `onChipRemove()`), seul l'affichage est d\u00E9l\u00E9gu\u00E9. -->\r\n @if (type === typeField.autocompleteMultiple && autocompleteRef()?.chips()?.length) {\r\n <ul class=\"autocomplete-chips\" role=\"list\">\r\n @for (chip of autocompleteRef()!.chips(); track chip.item) {\r\n <li>\r\n <button type=\"button\" class=\"autocomplete-chip\"\r\n [disabled]=\"isEffectivelyDisabled || isReadonly\"\r\n (click)=\"autocompleteRef()!.onChipRemove(chip.item)\">\r\n <span>{{ chip.label }}</span>\r\n @if (!isEffectivelyDisabled && !isReadonly) {\r\n <span aria-hidden=\"true\" class=\"autocomplete-chip-x\">&times;</span>\r\n <span class=\"visually-hidden\">{{ '_COMMON._ACTION.DELETE' | translate }}</span>\r\n }\r\n </button>\r\n </li>\r\n }\r\n </ul>\r\n }\r\n}\r\n@else {\r\n <ng-container [ngTemplateOutlet]=\"field\"></ng-container>\r\n}\r\n\r\n<ng-template #field>\r\n <!-- Autocomplete (mono / multi) -->\r\n @if ((type === typeField.autocomplete || type === typeField.autocompleteMultiple) && autocompleteOptions) {\r\n <cw-autocomplete\r\n [id]=\"name\"\r\n [control]=\"formControl\"\r\n [fetcher]=\"autocompleteOptions.fetcher\"\r\n [displayField]=\"autocompleteOptions.displayField ?? 'label'\"\r\n [valueField]=\"autocompleteOptions.valueField ?? 'id'\"\r\n [columns]=\"autocompleteOptions.columns ?? []\"\r\n [optionTemplate]=\"autocompleteOptions.optionTemplate ?? autocompleteOptionTpl?.templateRef ?? null\"\r\n [resolver]=\"autocompleteOptions.resolver ?? null\"\r\n [selectedItem]=\"autocompleteOptions.selectedItem ?? null\"\r\n [selectedItems]=\"autocompleteOptions.selectedItems ?? []\"\r\n [minChars]=\"autocompleteOptions.minChars ?? 2\"\r\n [debounceMs]=\"autocompleteOptions.debounceMs ?? 250\"\r\n [multiple]=\"type === typeField.autocompleteMultiple\"\r\n [isRequired]=\"isRequired\"\r\n [isReadonly]=\"!!isReadonly\"\r\n [isDisabled]=\"isEffectivelyDisabled\"\r\n [ariaInvalid]=\"control.invalid && control.touched\"\r\n [ariaDescribedBy]=\"getDescribedBy(control)\"\r\n [placeholder]=\"placeholder\">\r\n </cw-autocomplete>\r\n }\r\n\r\n <!-- Rich text editor (Quill) : sous-composant interne, sans field-group ni bouton clear\r\n (il porte sa propre bordure + toolbar). Le label statique du form-field reste au-dessus. -->\r\n @if (type === typeField.richText) {\r\n <cw-rich-text-editor\r\n [id]=\"name\"\r\n [control]=\"formControl\"\r\n [options]=\"richTextOptions\"\r\n [placeholder]=\"placeholder ? (placeholder | translate) : ''\"\r\n [isRequired]=\"isRequired\"\r\n [isReadonly]=\"!!isReadonly\"\r\n [isDisabled]=\"isEffectivelyDisabled\"\r\n [ariaInvalid]=\"control.invalid && control.touched\"\r\n [ariaDescribedBy]=\"getDescribedBy(control)\">\r\n </cw-rich-text-editor>\r\n }\r\n\r\n <!-- Text -->\r\n @if ([typeField.text, typeField.date, typeField.time, typeField.dateTime, typeField.number,\r\n typeField.email,\r\n typeField.color, typeField.zipCode].includes(type)) {\r\n <input [type]=\"type === typeField.zipCode ? 'text' : type\" class=\"field-control\" [id]=\"name\" [formControl]=\"formControl\"\r\n [attr.title]=\"fieldTitle ? (fieldTitle | translate) : null\"\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 <!-- L'input natif reste LE controle (focus, clavier, restitution aux lecteurs d'ecran,\r\n validation), mais il est masque visuellement : le libelle de son bouton et son\r\n \u00AB aucun fichier choisi \u00BB sont ecrits par le NAVIGATEUR, dans SA langue. Ils sont\r\n intraduisibles et ne suivent pas la langue de l'application \u2014 un utilisateur qui\r\n bascule en anglais garderait \u00AB Choisir un fichier \u00BB. On les reecrit donc a cote,\r\n traduits, dans une couche purement visuelle. -->\r\n <input #fileInput type=\"file\" class=\"field-control visually-hidden\" [id]=\"name\"\r\n [ngClass]=\"[(cssClass || ''), formControl?.value ? 'has-value' : '']\"\r\n [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 <!-- `aria-hidden` : doublon visuel de l'input, que les lecteurs d'ecran restituent deja\r\n (nom du champ, bouton de parcours, fichier selectionne). L'annoncer une seconde fois\r\n ne ferait que bavarder. Le clic est relaye a l'input, le clavier passe par lui. -->\r\n <span class=\"field-file\" aria-hidden=\"true\" (click)=\"openFilePicker()\">\r\n <span class=\"field-file-button\">{{ '_COMMON._FORM.CHOOSE_FILE' | translate }}</span>\r\n <span class=\"field-file-name\" [class.field-file-name-empty]=\"!selectedFileName\">\r\n {{ selectedFileName ?? ('_COMMON._FORM.NO_FILE_SELECTED' | translate) }}\r\n </span>\r\n </span>\r\n }\r\n\r\n @if (type === typeField.password) {\r\n <input [type]=\"isPasswordShown ? 'text' : 'password'\" class=\"field-control\" [id]=\"name\" [formControl]=\"formControl\"\r\n [ngClass]=\"[(cssClass || ''), formControl?.value ? 'has-value' : '']\"\r\n [attr.required]=\"isRequired ? 'required' : null\" [attr.readonly]=\"isReadonly ? 'readonly' : null\"\r\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\" [attr.aria-required]=\"isRequired\"\r\n [attr.minlength]=\"minLengthAttr\" [attr.maxlength]=\"maxLengthAttr\" [attr.pattern]=\"patternAttr\"\r\n [attr.autocomplete]=\"autocomplete\"\r\n [attr.aria-invalid]=\"control.invalid && control.touched\"\r\n [attr.aria-describedby]=\"getDescribedBy(control)\"\r\n (focus)=\"onFocus()\" (blur)=\"onBlur()\" />\r\n <cw-button [type]=\"buttonType.ghost\"\r\n cssClass=\"btn-password-field\"\r\n [withIcon]=\"isPasswordShown ? spriteIcon.toolbarHidePassword : spriteIcon.toolbarShowPassword\"\r\n [withOnlyIcon]=\"true\"\r\n [label]=\"isPasswordShown ? '_COMMON._FORM._SHOW_HIDE_PWD.HIDE' : '_COMMON._FORM._SHOW_HIDE_PWD.SHOW'\"\r\n (btnAction)=\"togglePasswordVisibility()\">\r\n </cw-button>\r\n }\r\n\r\n <!-- Textarea -->\r\n @if (type === typeField.textarea) {\r\n <textarea class=\"field-control\" [id]=\"name\" [formControl]=\"formControl\"\r\n [ngClass]=\"[(cssClass || ''), formControl?.value ? 'has-value' : '']\"\r\n [attr.placeholder]=\"placeholder ? (placeholder | translate) : null\" [attr.required]=\"isRequired ? 'required' : null\"\r\n [attr.readonly]=\"isReadonly ? 'readonly' : null\" [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\"\r\n [attr.aria-required]=\"isRequired\" [attr.aria-invalid]=\"control.invalid && control.touched\"\r\n [attr.minlength]=\"minLengthAttr\" [attr.maxlength]=\"maxLengthAttr\" [attr.pattern]=\"patternAttr\"\r\n [attr.autocomplete]=\"autocomplete\"\r\n [attr.aria-describedby]=\"getDescribedBy(control)\"\r\n (focus)=\"onFocus()\" (blur)=\"onBlur()\"></textarea>\r\n }\r\n\r\n <!-- Select -->\r\n @if (type === typeField.select) {\r\n <ng-select [formControl]=\"formControl\" [items]=\"options\" bindLabel=\"label\" [labelForId]=\"name\" [appendTo]=\"appendTo ?? ''\" bindValue=\"value\"\r\n [ngClass]=\"cssClass\" [searchable]=\"false\" [placeholder]=\"placeholder ? (placeholder | translate) : ''\" [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()\" (open)=\"onDropdownOpen()\" (close)=\"onDropdownClose()\">\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) : ''\" [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 (open)=\"onDropdownOpen()\" (close)=\"onDropdownClose()\">\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 [attr.aria-labelledby]=\"hasFieldTooltip ? legendId : null\"\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\" [class.d-flex-h]=\"hasFieldTooltip\" [class.gap-2xs]=\"hasFieldTooltip\">\r\n <span [id]=\"legendId\">\r\n {{label | translate: labelParams}}\r\n @if(isRequired) {\r\n <span class=\"text-danger\">*</span>\r\n }\r\n </span>\r\n @if (hasFieldTooltip) {\r\n <ng-container *ngTemplateOutlet=\"fieldTooltip\"></ng-container>\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 gap-sm'\">\r\n @for (opt of options; track opt.value) {\r\n <li class=\"field-check\">\r\n <input type=\"radio\" [id]=\"name + '_' + opt.value\" [attr.name]=\"name\" [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 [attr.aria-labelledby]=\"hasFieldTooltip ? legendId : null\"\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\" [class.d-flex-h]=\"hasFieldTooltip\" [class.gap-2xs]=\"hasFieldTooltip\">\r\n <span [id]=\"legendId\">\r\n {{label | translate: labelParams}}\r\n @if(isRequired) {\r\n <span class=\"text-danger\">*</span>\r\n }\r\n </span>\r\n @if (hasFieldTooltip) {\r\n <ng-container *ngTemplateOutlet=\"fieldTooltip\"></ng-container>\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\" [attr.name]=\"name\" [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 <!-- Cartes : checkbox / radio / switch (contr\u00F4le \u00E0 gauche, titre, description facultative) -->\r\n @if (isChoiceCard) {\r\n @if (isBooleanChoiceCard) {\r\n <!-- Carte bool\u00E9enne (sans options) : une case li\u00E9e au FormControl<boolean>, nomm\u00E9e par le titre. -->\r\n <div class=\"field-card-list\" [class.field-card-list-compact]=\"isChoiceCardCompact\">\r\n <label class=\"field-card d-flex-h items-start gap-xs\" [for]=\"name\" [class.field-switch]=\"isSwitchCard\" [class.field-switch-small]=\"isSwitchCard\">\r\n <input type=\"checkbox\" [id]=\"name\" [formControl]=\"formControl\" class=\"field-check-input\"\r\n [attr.role]=\"isSwitchCard ? 'switch' : null\"\r\n [attr.aria-required]=\"isRequired\"\r\n [attr.aria-invalid]=\"control.invalid && control.touched\"\r\n [attr.aria-describedby]=\"booleanCardDescribedBy\"\r\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\" />\r\n <span class=\"d-flex-v gap-5xs\">\r\n <span class=\"field-card-title\">\r\n {{ label | translate: labelParams }}\r\n @if (isRequired) {\r\n <span class=\"text-danger\">*</span>\r\n }\r\n </span>\r\n @if (!isChoiceCardCompact && description) {\r\n <span class=\"field-text\" [id]=\"name + '-desc'\">{{ description | translate }}</span>\r\n }\r\n </span>\r\n </label>\r\n </div>\r\n } @else {\r\n <fieldset [attr.aria-labelledby]=\"hasFieldTooltip ? legendId : null\"\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\" [class.d-flex-h]=\"hasFieldTooltip\" [class.gap-2xs]=\"hasFieldTooltip\">\r\n <span [id]=\"legendId\">\r\n {{label | translate: labelParams}}\r\n @if(isRequired) {\r\n <span class=\"text-danger\">*</span>\r\n }\r\n </span>\r\n @if (hasFieldTooltip) {\r\n <ng-container *ngTemplateOutlet=\"fieldTooltip\"></ng-container>\r\n }\r\n </legend>\r\n <ul class=\"field-card-list list-unstyled mb-none\" [class.field-card-list-compact]=\"isChoiceCardCompact\">\r\n @for (opt of options; track opt.value) {\r\n <li class=\"d-flex-v\">\r\n <!-- Le label englobe toute la carte : un clic n'importe o\u00F9 coche l'option. -->\r\n <label class=\"field-card d-flex-h items-start gap-xs flex-1\" [for]=\"name + '_' + opt.value\" [class.field-switch]=\"isSwitchCard\" [class.field-switch-small]=\"isSwitchCard\">\r\n @if (isRadioCard) {\r\n <input type=\"radio\" [id]=\"name + '_' + opt.value\" [attr.name]=\"name\" [value]=\"opt.value\" [formControl]=\"formControl\"\r\n class=\"field-check-input\"\r\n [attr.aria-describedby]=\"(!isChoiceCardCompact && opt.description) ? name + '_' + opt.value + '-desc' : null\"\r\n [attr.disabled]=\"(isEffectivelyDisabled || opt.disabled) ? 'disabled' : null\" (change)=\"onRadioChange(opt.value)\" />\r\n } @else {\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.role]=\"isSwitchCard ? 'switch' : null\"\r\n [attr.aria-describedby]=\"(!isChoiceCardCompact && opt.description) ? name + '_' + opt.value + '-desc' : null\"\r\n [attr.disabled]=\"(isEffectivelyDisabled || opt.disabled) ? 'disabled' : null\" />\r\n }\r\n <span class=\"d-flex-v gap-5xs\">\r\n <span class=\"field-card-title\">{{ opt.label | translate }}</span>\r\n @if (!isChoiceCardCompact && opt.description) {\r\n <span class=\"field-text\" [id]=\"name + '_' + opt.value + '-desc'\">{{ opt.description | translate }}</span>\r\n }\r\n </span>\r\n </label>\r\n </li>\r\n }\r\n </ul>\r\n </fieldset>\r\n }\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: labelParams }}</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: labelParams }}\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 [attr.aria-labelledby]=\"hasFieldTooltip ? legendId : null\"\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\" [class.d-flex-h]=\"hasFieldTooltip\" [class.gap-2xs]=\"hasFieldTooltip\">\r\n <span [id]=\"legendId\">\r\n {{label | translate: labelParams}}\r\n @if(isRequired) {\r\n <span class=\"text-danger\">*</span>\r\n }\r\n </span>\r\n @if (hasFieldTooltip) {\r\n <ng-container *ngTemplateOutlet=\"fieldTooltip\"></ng-container>\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 gap-sm'\">\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 [attr.aria-labelledby]=\"hasFieldTooltip ? legendId : null\">\r\n <legend class=\"field-label\" [class.visually-hidden]=\"!displayLabel\" [class.d-flex-h]=\"hasFieldTooltip\" [class.gap-2xs]=\"hasFieldTooltip\">\r\n <span [id]=\"legendId\">\r\n {{label | translate: labelParams}}\r\n </span>\r\n @if (hasFieldTooltip) {\r\n <ng-container *ngTemplateOutlet=\"fieldTooltip\"></ng-container>\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 gap-sm'\">\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 [attr.aria-labelledby]=\"hasFieldTooltip ? legendId : null\"\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\" [class.d-flex-h]=\"hasFieldTooltip\" [class.gap-2xs]=\"hasFieldTooltip\">\r\n <span [id]=\"legendId\">\r\n {{label | translate: labelParams}}\r\n @if(isRequired) {\r\n <span class=\"text-danger\">*</span>\r\n }\r\n </span>\r\n @if (hasFieldTooltip) {\r\n <ng-container *ngTemplateOutlet=\"fieldTooltip\"></ng-container>\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 [attr.aria-labelledby]=\"hasFieldTooltip ? legendId : null\">\r\n <legend class=\"field-label\" [class.visually-hidden]=\"!displayLabel\" [class.d-flex-h]=\"hasFieldTooltip\" [class.gap-2xs]=\"hasFieldTooltip\">\r\n <span [id]=\"legendId\">\r\n {{label | translate: labelParams}}\r\n </span>\r\n @if (hasFieldTooltip) {\r\n <ng-container *ngTemplateOutlet=\"fieldTooltip\"></ng-container>\r\n }\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 (isPeriod) {\r\n <!-- Fieldset : le legend nomme la p\u00E9riode, \u00AB Du \u00BB / \u00AB au \u00BB sont les labels de chaque input. -->\r\n <fieldset [attr.aria-labelledby]=\"hasFieldTooltip ? legendId : null\">\r\n <legend class=\"field-label\" [class.visually-hidden]=\"!displayLabel\" [class.d-flex-h]=\"hasFieldTooltip\" [class.gap-2xs]=\"hasFieldTooltip\">\r\n <span [id]=\"legendId\">\r\n {{label | translate: labelParams}}\r\n <!-- Deux bornes obligatoires : ast\u00E9risque sur la p\u00E9riode ; une seule : sur sa borne. -->\r\n @if(isStartRequired && isEndRequired) {\r\n <span class=\"text-danger\">*</span>\r\n }\r\n </span>\r\n @if (hasFieldTooltip) {\r\n <ng-container *ngTemplateOutlet=\"fieldTooltip\"></ng-container>\r\n }\r\n </legend>\r\n <!-- \u00C9tats invalide / d\u00E9sactiv\u00E9 pos\u00E9s seulement avec addon ou raccourcis (rendu historique sinon). -->\r\n <div class=\"field-group\"\r\n [class.field-group-invalid]=\"hasPeriodAddons && isInvalid\"\r\n [class.field-group-disabled]=\"hasPeriodAddons && isDisabledOrReadonly\">\r\n @if (addonLeft) {\r\n <div class=\"field-group-addon-left\">\r\n <ng-container [ngTemplateOutlet]=\"addonLeft\"></ng-container>\r\n </div>\r\n }\r\n <label class=\"field-group-addon-left\" [for]=\"name + '_start'\">\r\n {{ '_COMMON._DATES.FROM_TO_1' | translate }}\r\n @if(isStartRequired && !isEndRequired) {\r\n <span class=\"text-danger\">*</span>\r\n }\r\n </label>\r\n <input [type]=\"getInputType()\" class=\"field-control\" [id]=\"name + '_start'\" [formControl]=\"getControl('start')!\"\r\n [attr.title]=\"fieldTitle ? (fieldTitle | translate) + ' \u2013 ' + ('_COMMON._DATES.FROM_TO_1' | translate) : null\"\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]=\"isStartRequired ? 'required' : null\" [attr.readonly]=\"isReadonly ? 'readonly' : null\"\r\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\" [attr.aria-required]=\"isStartRequired\"\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')\" (blur)=\"onBlurRange('start')\" />\r\n\r\n @if(getControl('start')?.value && !isDisabledOrReadonly) {\r\n <button type=\"button\" class=\"btn btn-secondary btn-clear-field\"\r\n [attr.aria-label]=\"'_COMMON._FORM.CLEAR_START' | translate: { label: label | translate: labelParams }\"\r\n (click)=\"onClearFieldPeriod('start')\">\r\n <span aria-hidden=\"true\">&times;</span>\r\n </button>\r\n }\r\n <label class=\"field-group-addon-center\" [for]=\"name + '_end'\">\r\n {{ '_COMMON._DATES.FROM_TO_2' | translate }}\r\n @if(isEndRequired && !isStartRequired) {\r\n <span class=\"text-danger\">*</span>\r\n }\r\n </label>\r\n <input [type]=\"getInputType()\" class=\"field-control\" [id]=\"name + '_end'\" [formControl]=\"getControl('end')!\"\r\n [attr.title]=\"fieldTitle ? (fieldTitle | translate) + ' \u2013 ' + ('_COMMON._DATES.FROM_TO_2' | translate) : null\"\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]=\"isEndRequired ? 'required' : null\" [attr.readonly]=\"isReadonly ? 'readonly' : null\"\r\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\" [attr.aria-required]=\"isEndRequired\"\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')\" (blur)=\"onBlurRange('end')\" />\r\n\r\n @if(getControl('end')?.value && !isDisabledOrReadonly) {\r\n <button type=\"button\" class=\"btn btn-ghost btn-clear-field\"\r\n [attr.aria-label]=\"'_COMMON._FORM.CLEAR_END' | translate: { label: label | translate: labelParams }\"\r\n (click)=\"onClearFieldPeriod('end')\">\r\n <span aria-hidden=\"true\">&times;</span>\r\n </button>\r\n }\r\n\r\n <!-- Raccourcis (dateToDate) puis addon droit : dans le fieldset, apr\u00E8s la borne de fin. -->\r\n @for (shortcut of activePeriodShortcuts; track $index) {\r\n <div class=\"field-group-addon-right\">\r\n <button type=\"button\" class=\"btn btn-ghost\"\r\n [class.active]=\"isPeriodShortcutActive(shortcut)\"\r\n [attr.aria-pressed]=\"isPeriodShortcutActive(shortcut)\"\r\n [attr.aria-label]=\"shortcut.ariaLabel ? (shortcut.ariaLabel | translate) : null\"\r\n [attr.disabled]=\"isDisabledOrReadonly ? 'disabled' : null\"\r\n (click)=\"onPeriodShortcut(shortcut)\">\r\n {{ shortcut.label | translate }}\r\n </button>\r\n </div>\r\n }\r\n @if (addonRight) {\r\n <div class=\"field-group-addon-right\">\r\n <ng-container [ngTemplateOutlet]=\"addonRight\"></ng-container>\r\n </div>\r\n }\r\n </div>\r\n </fieldset>\r\n }\r\n\r\n @if ([typeField.datePlusOne, typeField.datePlusTwo, typeField.datePlusSeven, typeField.dateComplexe].includes(type)) {\r\n\r\n <div class=\"field-group\">\r\n @if (type === typeField.dateComplexe) {\r\n <div class=\"field-group-addon-left\">\r\n <button class=\"btn btn-ghost\" type=\"button\" (click)=\"onDateAddDay('prev')\"\r\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\">\r\n <cw-icon font=\"optyweb\" [icon]=\"spriteIcon.nextLeft\" [label]=\"'Jour pr\u00E9c\u00E9dent'\"></cw-icon>\r\n </button>\r\n </div>\r\n }\r\n\r\n <input type=\"date\" class=\"field-control\" [id]=\"name\" [formControl]=\"formControl\"\r\n [attr.title]=\"fieldTitle ? (fieldTitle | translate) : null\"\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.aria-required]=\"isRequired\"\r\n [attr.min]=\"minAttr\" [attr.max]=\"maxAttr\" [attr.step]=\"stepAttr\"\r\n [attr.autocomplete]=\"autocomplete\"\r\n [attr.aria-invalid]=\"control.invalid && control.touched\"\r\n [attr.aria-describedby]=\"getDescribedBy(control)\"\r\n (focus)=\"onFocus()\" (blur)=\"onBlur()\" />\r\n\r\n @if(formControl?.value && !isDisabledOrReadonly) {\r\n <button class=\"btn btn-ghost btn-clear-field\" type=\"button\"\r\n [attr.aria-label]=\"'_COMMON._FORM.CLEAR_FIELD' | translate: { label: label | translate: labelParams }\"\r\n (click)=\"onClearField(formControl)\"><span aria-hidden=\"true\">&times;</span></button>\r\n }\r\n\r\n\r\n @if (type === typeField.dateComplexe) {\r\n <div class=\"field-group-addon-right\">\r\n <button class=\"btn btn-ghost\" type=\"button\" (click)=\"onDateAddDay('next')\"\r\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\">\r\n <cw-icon font=\"optyweb\" [icon]=\"spriteIcon.nextRight\" [label]=\"'Jour suivant'\"></cw-icon>\r\n </button>\r\n </div>\r\n <div class=\"field-group-addon-right\">\r\n <button class=\"btn btn-ghost\" type=\"button\" (click)=\"onRefresh()\"\r\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\">\r\n <cw-icon font=\"optyweb\" [icon]=\"spriteIcon.toolbarRefresh\" [label]=\"'Rafra\u00EEchir'\"></cw-icon>\r\n </button>\r\n </div>\r\n }\r\n\r\n <div class=\"field-group-addon-right\">\r\n <button class=\"btn btn-ghost\" type=\"button\" (click)=\"onTodayAddDay(0)\"\r\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\">\r\n J\r\n <span class=\"visually-hidden\">Aujourd'hui</span>\r\n </button>\r\n </div>\r\n <div class=\"field-group-addon-right\">\r\n <button class=\"btn btn-ghost\" type=\"button\" (click)=\"onTodayAddDay(1)\"\r\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\">\r\n J+1\r\n <span class=\"visually-hidden\">Demain</span>\r\n </button>\r\n </div>\r\n\r\n @if (type !== typeField.datePlusOne && type !== typeField.dateComplexe) {\r\n <div class=\"field-group-addon-right\">\r\n <button class=\"btn btn-ghost \" type=\"button\" (click)=\"onTodayAddDay(2)\"\r\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\">\r\n J+2\r\n <span class=\"visually-hidden\">Dans 2 jours</span>\r\n </button>\r\n </div>\r\n\r\n @if (type !== typeField.datePlusTwo) {\r\n <div class=\"field-group-addon-right\">\r\n <button class=\"btn btn-ghost\" type=\"button\" (click)=\"onTodayAddDay(7)\"\r\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\">\r\n J+7\r\n <span class=\"visually-hidden\">Dans 7 jours</span>\r\n </button>\r\n </div>\r\n }\r\n }\r\n </div>\r\n }\r\n\r\n @if (type === typeField.slider) {\r\n <ngx-slider [(value)]=\"sliderValue\" [options]=\"sliderOptions\" [formControl]=\"formControl\"></ngx-slider>\r\n }\r\n\r\n @if (type === typeField.range) {\r\n <div class=\"slider\">\r\n\r\n <cw-button [isDisabled]=\"formControl.value <= rangeOptions.floor\" [label]=\"'Diminuer ' + formControl.value + ' ' + label\"\r\n [withIcon]=\"spriteIcon.toolbarMinus\" [withOnlyIcon]=\"true\" [type]=\"buttonType.primary\"\r\n [iconSize]=\"buttonIconSize.small\" (btnAction)=\"onRangeStep('decrease')\">\r\n </cw-button>\r\n\r\n <div class=\"slider-input\">\r\n <label [for]=\"name\" class=\"slider-tooltip\" [style.left]=\"getRangePercent() + '%'\" aria-live=\"polite\"\r\n aria-atomic=\"true\">\r\n {{ label | translate: labelParams }} {{ formControl.value }}\r\n @if (rangeOptions.unit) {\r\n <abbr [title]=\"rangeOptions.unit\">{{ rangeOptions.unit }}</abbr>\r\n }\r\n </label>\r\n\r\n <div class=\"slider-custom-bar\">\r\n <div class=\"slider-custom-bar-selection\" [style.width]=\"getRangePercent() + '%'\">\r\n </div>\r\n </div>\r\n\r\n <input type=\"range\" [id]=\"name\" [formControl]=\"formControl\" [min]=\"rangeOptions.floor\" [max]=\"rangeOptions.ceil\"\r\n [step]=\"rangeOptions.step || 1\" class=\"field-control-range\" [attr.aria-required]=\"isRequired\"\r\n [attr.aria-invalid]=\"control.invalid && control.touched\">\r\n </div>\r\n\r\n <cw-button [isDisabled]=\"formControl.value >= rangeOptions.ceil\" [label]=\"'Augmenter ' + formControl.value + ' ' + label\"\r\n [withIcon]=\"spriteIcon.toolbarPlus\" [withOnlyIcon]=\"true\" [type]=\"buttonType.primary\"\r\n [iconSize]=\"buttonIconSize.small\" (btnAction)=\"onRangeStep('increase')\">\r\n </cw-button>\r\n </div>\r\n }\r\n\r\n @if (isInInputGroup() && clearable && !isDisabledOrReadonly && type !== typeField.autocompleteMultiple) {\r\n @if (type === typeField.autocomplete) {\r\n @if (autocompleteRef()?.hasAnyContent()) {\r\n <button class=\"btn btn-secondary btn-clear-field\" type=\"button\"\r\n [attr.aria-label]=\"'_COMMON._FORM.CLEAR_FIELD' | translate: { label: label | translate: labelParams }\"\r\n (click)=\"onClearAutocomplete()\"><span aria-hidden=\"true\">&times;</span></button>\r\n }\r\n } @else if (type === typeField.ngSelectMultiple) {\r\n <!-- value est un tableau : un [] vide \u00E9tant truthy, on teste .length pour n'afficher le clear global que s'il y a au moins une s\u00E9lection. -->\r\n @if (formControl?.value?.length) {\r\n <button class=\"btn btn-ghost btn-clear-field\" type=\"button\"\r\n [attr.aria-label]=\"'_COMMON._FORM.CLEAR_FIELD' | translate: { label: label | translate: labelParams }\"\r\n (click)=\"onClearField(formControl)\"><span aria-hidden=\"true\">&times;</span></button>\r\n }\r\n } @else {\r\n @if(formControl?.value) {\r\n <button class=\"btn btn-ghost btn-clear-field\" type=\"button\"\r\n [attr.aria-label]=\"'_COMMON._FORM.CLEAR_FIELD' | translate: { label: label | translate: labelParams }\"\r\n (click)=\"onClearField(formControl)\"><span aria-hidden=\"true\">&times;</span></button>\r\n }\r\n }\r\n }\r\n\r\n</ng-template>\r\n\r\n<ng-template #fieldLabel>\r\n <label [for]=\"name\" class=\"field-label\" [class.visually-hidden]=\"!displayLabel\">\r\n {{ label | translate: labelParams }}\r\n\r\n @if (isRequired) {\r\n <span class=\"text-danger\">*</span>\r\n }\r\n </label>\r\n</ng-template>\r\n\r\n<!-- Bouton d'aide (tooltip) partage label/legend. Hors du <label> (sinon son libelle\r\n s'ajoute au nom du champ et le clic active le label) ; dans un <legend>, le fieldset\r\n est nomme par aria-labelledby sur le seul texte (legendId) pour la meme raison. -->\r\n<ng-template #fieldTooltip>\r\n <button type=\"button\" class=\"btn btn-ghost btn-field-tooltip\"\r\n [cwTooltip]=\"tooltip ?? ''\"\r\n [attr.data-test-ctw]=\"'tooltip-' + name\">\r\n <cw-icon [icon]=\"spriteIcon.alertHelp\" [type]=\"iconType.circular\" [iconUiType]=\"iconUiType.info\"\r\n [iconSize]=\"iconSize.xs\" [label]=\"'_COMMON._FORM.TOOLTIP_HELP' | translate\"></cw-icon>\r\n </button>\r\n</ng-template>\r\n" }]
4646
- }], ctorParameters: () => [], propDecorators: { control: [{
4647
- type: Input
4648
- }], formGroup: [{
4649
- type: Input
4650
- }], type: [{
4651
- type: Input
4652
- }], label: [{
4653
- type: Input
4654
- }], labelParams: [{
4655
- type: Input
4656
- }], displayLabel: [{
4657
- type: Input
4658
- }], fieldTitle: [{
4659
- type: Input
4660
- }], name: [{
4661
- type: Input
4662
- }], placeholder: [{
4663
- type: Input
4664
- }], autocomplete: [{
4665
- type: Input
4666
- }], options: [{
4667
- type: Input
4668
- }], rangeOptions: [{
4669
- type: Input
4670
- }], validationOptions: [{
4671
- type: Input
4672
- }], autocompleteOptions: [{
4673
- type: Input
4674
- }], richTextOptions: [{
4675
- type: Input
4676
- }], errorMessages: [{
4677
- type: Input
4678
- }], isRequired: [{
4679
- type: Input
4680
- }], requiredStart: [{
4681
- type: Input
4682
- }], requiredEnd: [{
4683
- type: Input
4684
- }], periodShortcuts: [{
4685
- type: Input
4686
- }], description: [{
4687
- type: Input
4688
- }], help: [{
4689
- type: Input
4690
- }], helpParams: [{
4691
- type: Input
4692
- }], tooltip: [{
4693
- type: Input
4694
- }], ariaDescribedBy: [{
4695
- type: Input
4696
- }], addonLeft: [{
4697
- type: Input
4698
- }], addonRight: [{
4699
- type: Input
4700
- }], isInAddon: [{
4701
- type: Input
4702
- }], isReadonly: [{
4703
- type: Input
4704
- }], isDisabled: [{
4705
- type: Input
4706
- }], sliderValue: [{
4707
- type: Input
4708
- }], sliderOptions: [{
4709
- type: Input
4710
- }], cssClass: [{
4711
- type: Input
4712
- }], skeletonMode: [{
4713
- type: Input
4714
- }], clearable: [{
4715
- type: Input
4716
- }], appendTo: [{
4717
- type: Input
4718
- }], initialCountry: [{
4719
- type: Input
4720
- }], recommendedDimensions: [{
4721
- type: Input
4722
- }], showPreview: [{
4723
- type: Input
4724
- }], existingFile: [{
4725
- type: Input
4726
- }], 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 }] }], ngSelectRef: [{ type: i0.ViewChild, args: [i0.forwardRef(() => NgSelectComponent), { isSignal: true }] }], refreshEvent: [{
4727
- type: Output
4728
- }], fileRemoved: [{
4729
- type: Output
4730
- }], textChanged: [{
4731
- type: Output
4732
- }], valueChange: [{
4733
- type: Output
4734
- }], phoneRegionChange: [{
4735
- type: Output
4736
- }], optionTemplate: [{
4737
- type: ContentChild,
4738
- args: ['ngOptionTpl', { read: TemplateRef }]
4739
- }], labelTemplate: [{
4740
- type: ContentChild,
4741
- args: ['ngLabelTpl', { read: TemplateRef }]
4742
- }], autocompleteOptionTpl: [{
4743
- type: ContentChild,
4744
- args: [CwAutocompleteOptionDirective]
4745
- }], hostClasses: [{
4746
- type: HostBinding,
4747
- args: ['class']
4748
- }] } });
4638
+ i0.ɵɵngDeclareClassMetadataAsync({ minVersion: "18.0.0", version: "20.3.20", ngImport: i0, type: FormFieldComponent, resolveDeferredDeps: () => [import('@ng-select/ng-select').then(m => m.NgSelectComponent), import('@ng-select/ng-select').then(m => m.NgOptionTemplateDirective), import('@ng-select/ng-select').then(m => m.NgLabelTemplateDirective), import('./cityway-basic-ui-slider-field.component-DNoKU63R.mjs').then(m => m.SliderFieldComponent)], resolveMetadata: (NgSelectComponent, NgOptionTemplateDirective, NgLabelTemplateDirective, SliderFieldComponent) => ({ decorators: [{
4639
+ type: Component,
4640
+ args: [{ selector: 'cw-form-field', standalone: true, imports: [
4641
+ CommonModule,
4642
+ TranslateModule,
4643
+ FormsModule,
4644
+ ReactiveFormsModule,
4645
+ NgSelectComponent,
4646
+ NgOptionTemplateDirective,
4647
+ NgLabelTemplateDirective,
4648
+ SliderFieldComponent,
4649
+ IconComponent,
4650
+ ButtonComponent,
4651
+ CwTooltipDirective,
4652
+ AutocompleteComponent,
4653
+ RichTextEditorComponent,
4654
+ FilePreviewComponent
4655
+ ], 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 !isChoiceCard &&\r\n !isPeriod\r\n ) {\r\n <!-- Bouton d'aide HORS du <label> (bouton dans un label = HTML invalide, son libelle\r\n polluerait le nom accessible du champ et un clic activerait le label) : on aligne\r\n label + bouton dans un conteneur flex, seulement quand il y a une aide. -->\r\n @if (hasFieldTooltip) {\r\n <div class=\"d-flex-h gap-2xs\">\r\n <ng-container *ngTemplateOutlet=\"fieldLabel\"></ng-container>\r\n <ng-container *ngTemplateOutlet=\"fieldTooltip\"></ng-container>\r\n </div>\r\n } @else {\r\n <ng-container *ngTemplateOutlet=\"fieldLabel\"></ng-container>\r\n }\r\n }\r\n\r\n <!-- Une p\u00E9riode rend ses addons dans son propre field-group (entre les bornes et le fieldset). -->\r\n @if ((addonLeft || addonRight) && !isPeriod) {\r\n <div class=\"field-group\" [class.field-group-invalid]=\"isInvalid\" [class.field-group-disabled]=\"isDisabledOrReadonly\">\r\n @if(addonLeft) {\r\n <div class=\"field-group-addon-left\">\r\n <ng-container [ngTemplateOutlet]=\"addonLeft\"></ng-container>\r\n </div>\r\n }\r\n <ng-container [ngTemplateOutlet]=\"field\"></ng-container>\r\n @if(addonRight) {\r\n <div class=\"field-group-addon-right\">\r\n <ng-container [ngTemplateOutlet]=\"addonRight\"></ng-container>\r\n </div>\r\n }\r\n </div>\r\n }\r\n @else {\r\n @if ( isInInputGroup() ) {\r\n <div class=\"field-group\" [class.field-group-invalid]=\"isInvalid\" [class.field-group-disabled]=\"isDisabledOrReadonly\">\r\n <ng-container [ngTemplateOutlet]=\"field\"></ng-container>\r\n </div>\r\n }\r\n @else {\r\n <ng-container [ngTemplateOutlet]=\"field\"></ng-container>\r\n }\r\n }\r\n\r\n <!-- Error message -->\r\n @if (controlOrGroup?.invalid && controlOrGroup?.touched) {\r\n <div class=\"field-invalid\" [id]=\"'error-' + name\">\r\n @if (\r\n !errorMessages?.['required'] &&\r\n ((controlOrGroup?.errors?.['required']) || (getControl('start')?.errors?.['required'] || getControl('end')?.errors?.['required']))\r\n ) {\r\n <span [innerHtml]=\"'_COMMON._FORM.ERROR_IS_MANDATORY' | translate: {label: label | translate: labelParams}\"></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: helpParams }}</span>\r\n }\r\n @for (entry of autoHelpEntries; track entry.key) {\r\n <!-- Espace explicite : les blancs entre balises sont supprim\u00E9s \u00E0 la compilation. -->\r\n {{ ' ' }}<span>{{ entry.key | translate: entry.params }}</span>\r\n }\r\n </div>\r\n }\r\n\r\n <!-- Aper\u00E7u du fichier (type=file, opt-in) : sous le champ et ses aides, comme dans la\r\n maquette DS. La croix native du champ n'est pas retir\u00E9e \u2014 les deux vident le m\u00EAme\r\n control, l'aper\u00E7u ajoute juste \u00AB Visualiser \u00BB et une cible plus grande. -->\r\n @if (isPreviewVisible) {\r\n <cw-file-preview [file]=\"previewFile\" [existingFile]=\"existingFile ?? null\"\r\n [disabled]=\"!!isDisabledOrReadonly\" (remove)=\"onPreviewRemove()\" />\r\n }\r\n\r\n <!-- Chips de la multi-s\u00E9lection (autocomplete) : rendus ici, hors du field-group et apr\u00E8s\r\n erreur/help, pour \u00EAtre visuellement d\u00E9tach\u00E9s du champ. La donn\u00E9e et le retrait restent\r\n port\u00E9s par cw-autocomplete (`chips()` / `onChipRemove()`), seul l'affichage est d\u00E9l\u00E9gu\u00E9. -->\r\n @if (type === typeField.autocompleteMultiple && autocompleteRef()?.chips()?.length) {\r\n <ul class=\"autocomplete-chips\" role=\"list\">\r\n @for (chip of autocompleteRef()!.chips(); track chip.item) {\r\n <li>\r\n <button type=\"button\" class=\"autocomplete-chip\"\r\n [disabled]=\"isEffectivelyDisabled || isReadonly\"\r\n (click)=\"autocompleteRef()!.onChipRemove(chip.item)\">\r\n <span>{{ chip.label }}</span>\r\n @if (!isEffectivelyDisabled && !isReadonly) {\r\n <span aria-hidden=\"true\" class=\"autocomplete-chip-x\">&times;</span>\r\n <span class=\"visually-hidden\">{{ '_COMMON._ACTION.DELETE' | translate }}</span>\r\n }\r\n </button>\r\n </li>\r\n }\r\n </ul>\r\n }\r\n}\r\n@else {\r\n <ng-container [ngTemplateOutlet]=\"field\"></ng-container>\r\n}\r\n\r\n<ng-template #field>\r\n <!-- Autocomplete (mono / multi) -->\r\n @if ((type === typeField.autocomplete || type === typeField.autocompleteMultiple) && autocompleteOptions) {\r\n <cw-autocomplete\r\n [id]=\"name\"\r\n [control]=\"formControl\"\r\n [fetcher]=\"autocompleteOptions.fetcher\"\r\n [displayField]=\"autocompleteOptions.displayField ?? 'label'\"\r\n [valueField]=\"autocompleteOptions.valueField ?? 'id'\"\r\n [columns]=\"autocompleteOptions.columns ?? []\"\r\n [optionTemplate]=\"autocompleteOptions.optionTemplate ?? autocompleteOptionTpl?.templateRef ?? null\"\r\n [resolver]=\"autocompleteOptions.resolver ?? null\"\r\n [selectedItem]=\"autocompleteOptions.selectedItem ?? null\"\r\n [selectedItems]=\"autocompleteOptions.selectedItems ?? []\"\r\n [minChars]=\"autocompleteOptions.minChars ?? 2\"\r\n [debounceMs]=\"autocompleteOptions.debounceMs ?? 250\"\r\n [multiple]=\"type === typeField.autocompleteMultiple\"\r\n [isRequired]=\"isRequired\"\r\n [isReadonly]=\"!!isReadonly\"\r\n [isDisabled]=\"isEffectivelyDisabled\"\r\n [ariaInvalid]=\"control.invalid && control.touched\"\r\n [ariaDescribedBy]=\"getDescribedBy(control)\"\r\n [placeholder]=\"placeholder\">\r\n </cw-autocomplete>\r\n }\r\n\r\n <!-- Rich text editor (Quill) : sous-composant interne, sans field-group ni bouton clear\r\n (il porte sa propre bordure + toolbar). Le label statique du form-field reste au-dessus. -->\r\n @if (type === typeField.richText) {\r\n <cw-rich-text-editor\r\n [id]=\"name\"\r\n [control]=\"formControl\"\r\n [options]=\"richTextOptions\"\r\n [placeholder]=\"placeholder ? (placeholder | translate) : ''\"\r\n [isRequired]=\"isRequired\"\r\n [isReadonly]=\"!!isReadonly\"\r\n [isDisabled]=\"isEffectivelyDisabled\"\r\n [ariaInvalid]=\"control.invalid && control.touched\"\r\n [ariaDescribedBy]=\"getDescribedBy(control)\">\r\n </cw-rich-text-editor>\r\n }\r\n\r\n <!-- Text -->\r\n @if ([typeField.text, typeField.date, typeField.time, typeField.dateTime, typeField.number,\r\n typeField.email,\r\n typeField.color, typeField.zipCode].includes(type)) {\r\n <input [type]=\"type === typeField.zipCode ? 'text' : type\" class=\"field-control\" [id]=\"name\" [formControl]=\"formControl\"\r\n [attr.title]=\"fieldTitle ? (fieldTitle | translate) : null\"\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 <!-- L'input natif reste LE controle (focus, clavier, restitution aux lecteurs d'ecran,\r\n validation), mais il est masque visuellement : le libelle de son bouton et son\r\n \u00AB aucun fichier choisi \u00BB sont ecrits par le NAVIGATEUR, dans SA langue. Ils sont\r\n intraduisibles et ne suivent pas la langue de l'application \u2014 un utilisateur qui\r\n bascule en anglais garderait \u00AB Choisir un fichier \u00BB. On les reecrit donc a cote,\r\n traduits, dans une couche purement visuelle. -->\r\n <input #fileInput type=\"file\" class=\"field-control visually-hidden\" [id]=\"name\"\r\n [ngClass]=\"[(cssClass || ''), formControl?.value ? 'has-value' : '']\"\r\n [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 <!-- `aria-hidden` : doublon visuel de l'input, que les lecteurs d'ecran restituent deja\r\n (nom du champ, bouton de parcours, fichier selectionne). L'annoncer une seconde fois\r\n ne ferait que bavarder. Le clic est relaye a l'input, le clavier passe par lui. -->\r\n <span class=\"field-file\" aria-hidden=\"true\" (click)=\"openFilePicker()\">\r\n <span class=\"field-file-button\">{{ '_COMMON._FORM.CHOOSE_FILE' | translate }}</span>\r\n <span class=\"field-file-name\" [class.field-file-name-empty]=\"!selectedFileName\">\r\n {{ selectedFileName ?? ('_COMMON._FORM.NO_FILE_SELECTED' | translate) }}\r\n </span>\r\n </span>\r\n }\r\n\r\n @if (type === typeField.password) {\r\n <input [type]=\"isPasswordShown ? 'text' : 'password'\" class=\"field-control\" [id]=\"name\" [formControl]=\"formControl\"\r\n [ngClass]=\"[(cssClass || ''), formControl?.value ? 'has-value' : '']\"\r\n [attr.required]=\"isRequired ? 'required' : null\" [attr.readonly]=\"isReadonly ? 'readonly' : null\"\r\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\" [attr.aria-required]=\"isRequired\"\r\n [attr.minlength]=\"minLengthAttr\" [attr.maxlength]=\"maxLengthAttr\" [attr.pattern]=\"patternAttr\"\r\n [attr.autocomplete]=\"autocomplete\"\r\n [attr.aria-invalid]=\"control.invalid && control.touched\"\r\n [attr.aria-describedby]=\"getDescribedBy(control)\"\r\n (focus)=\"onFocus()\" (blur)=\"onBlur()\" />\r\n <cw-button [type]=\"buttonType.ghost\"\r\n cssClass=\"btn-password-field\"\r\n [withIcon]=\"isPasswordShown ? spriteIcon.toolbarHidePassword : spriteIcon.toolbarShowPassword\"\r\n [withOnlyIcon]=\"true\"\r\n [label]=\"isPasswordShown ? '_COMMON._FORM._SHOW_HIDE_PWD.HIDE' : '_COMMON._FORM._SHOW_HIDE_PWD.SHOW'\"\r\n (btnAction)=\"togglePasswordVisibility()\">\r\n </cw-button>\r\n }\r\n\r\n <!-- Textarea -->\r\n @if (type === typeField.textarea) {\r\n <textarea class=\"field-control\" [id]=\"name\" [formControl]=\"formControl\"\r\n [ngClass]=\"[(cssClass || ''), formControl?.value ? 'has-value' : '']\"\r\n [attr.placeholder]=\"placeholder ? (placeholder | translate) : null\" [attr.required]=\"isRequired ? 'required' : null\"\r\n [attr.readonly]=\"isReadonly ? 'readonly' : null\" [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\"\r\n [attr.aria-required]=\"isRequired\" [attr.aria-invalid]=\"control.invalid && control.touched\"\r\n [attr.minlength]=\"minLengthAttr\" [attr.maxlength]=\"maxLengthAttr\" [attr.pattern]=\"patternAttr\"\r\n [attr.autocomplete]=\"autocomplete\"\r\n [attr.aria-describedby]=\"getDescribedBy(control)\"\r\n (focus)=\"onFocus()\" (blur)=\"onBlur()\"></textarea>\r\n }\r\n\r\n <!-- Select -->\r\n @if (type === typeField.select) {\r\n @defer (on immediate) {\r\n <ng-select #ngSelect [formControl]=\"formControl\" [items]=\"options\" bindLabel=\"label\" [labelForId]=\"name\" [appendTo]=\"appendTo ?? ''\" bindValue=\"value\"\r\n [ngClass]=\"cssClass\" [searchable]=\"false\" [placeholder]=\"placeholder ? (placeholder | translate) : ''\" [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()\" (open)=\"onDropdownOpen()\" (close)=\"onDropdownClose()\">\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 } @placeholder {\r\n <div class=\"field-control\" aria-hidden=\"true\"></div>\r\n }\r\n }\r\n\r\n <!-- NgSelect -->\r\n @if (type === typeField.ngSelect || type === typeField.ngSelectMultiple) {\r\n @defer (on immediate) {\r\n <ng-select #ngSelect [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) : ''\" [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 (open)=\"onDropdownOpen()\" (close)=\"onDropdownClose()\">\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 } @placeholder {\r\n <div class=\"field-control\" aria-hidden=\"true\"></div>\r\n }\r\n }\r\n\r\n <!-- Radio -->\r\n @if (type === typeField.radioInline || type === typeField.radio) {\r\n <fieldset [attr.aria-labelledby]=\"hasFieldTooltip ? legendId : null\"\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\" [class.d-flex-h]=\"hasFieldTooltip\" [class.gap-2xs]=\"hasFieldTooltip\">\r\n <span [id]=\"legendId\">\r\n {{label | translate: labelParams}}\r\n @if(isRequired) {\r\n <span class=\"text-danger\">*</span>\r\n }\r\n </span>\r\n @if (hasFieldTooltip) {\r\n <ng-container *ngTemplateOutlet=\"fieldTooltip\"></ng-container>\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 gap-sm'\">\r\n @for (opt of options; track opt.value) {\r\n <li class=\"field-check\">\r\n <input type=\"radio\" [id]=\"name + '_' + opt.value\" [attr.name]=\"name\" [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 [attr.aria-labelledby]=\"hasFieldTooltip ? legendId : null\"\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\" [class.d-flex-h]=\"hasFieldTooltip\" [class.gap-2xs]=\"hasFieldTooltip\">\r\n <span [id]=\"legendId\">\r\n {{label | translate: labelParams}}\r\n @if(isRequired) {\r\n <span class=\"text-danger\">*</span>\r\n }\r\n </span>\r\n @if (hasFieldTooltip) {\r\n <ng-container *ngTemplateOutlet=\"fieldTooltip\"></ng-container>\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\" [attr.name]=\"name\" [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 <!-- Cartes : checkbox / radio / switch (contr\u00F4le \u00E0 gauche, titre, description facultative) -->\r\n @if (isChoiceCard) {\r\n @if (isBooleanChoiceCard) {\r\n <!-- Carte bool\u00E9enne (sans options) : une case li\u00E9e au FormControl<boolean>, nomm\u00E9e par le titre. -->\r\n <div class=\"field-card-list\" [class.field-card-list-compact]=\"isChoiceCardCompact\">\r\n <label class=\"field-card d-flex-h items-start gap-xs\" [for]=\"name\" [class.field-switch]=\"isSwitchCard\" [class.field-switch-small]=\"isSwitchCard\">\r\n <input type=\"checkbox\" [id]=\"name\" [formControl]=\"formControl\" class=\"field-check-input\"\r\n [attr.role]=\"isSwitchCard ? 'switch' : null\"\r\n [attr.aria-required]=\"isRequired\"\r\n [attr.aria-invalid]=\"control.invalid && control.touched\"\r\n [attr.aria-describedby]=\"booleanCardDescribedBy\"\r\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\" />\r\n <span class=\"d-flex-v gap-5xs\">\r\n <span class=\"field-card-title\">\r\n {{ label | translate: labelParams }}\r\n @if (isRequired) {\r\n <span class=\"text-danger\">*</span>\r\n }\r\n </span>\r\n @if (!isChoiceCardCompact && description) {\r\n <span class=\"field-text\" [id]=\"name + '-desc'\">{{ description | translate }}</span>\r\n }\r\n </span>\r\n </label>\r\n </div>\r\n } @else {\r\n <fieldset [attr.aria-labelledby]=\"hasFieldTooltip ? legendId : null\"\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\" [class.d-flex-h]=\"hasFieldTooltip\" [class.gap-2xs]=\"hasFieldTooltip\">\r\n <span [id]=\"legendId\">\r\n {{label | translate: labelParams}}\r\n @if(isRequired) {\r\n <span class=\"text-danger\">*</span>\r\n }\r\n </span>\r\n @if (hasFieldTooltip) {\r\n <ng-container *ngTemplateOutlet=\"fieldTooltip\"></ng-container>\r\n }\r\n </legend>\r\n <ul class=\"field-card-list list-unstyled mb-none\" [class.field-card-list-compact]=\"isChoiceCardCompact\">\r\n @for (opt of options; track opt.value) {\r\n <li class=\"d-flex-v\">\r\n <!-- Le label englobe toute la carte : un clic n'importe o\u00F9 coche l'option. -->\r\n <label class=\"field-card d-flex-h items-start gap-xs flex-1\" [for]=\"name + '_' + opt.value\" [class.field-switch]=\"isSwitchCard\" [class.field-switch-small]=\"isSwitchCard\">\r\n @if (isRadioCard) {\r\n <input type=\"radio\" [id]=\"name + '_' + opt.value\" [attr.name]=\"name\" [value]=\"opt.value\" [formControl]=\"formControl\"\r\n class=\"field-check-input\"\r\n [attr.aria-describedby]=\"(!isChoiceCardCompact && opt.description) ? name + '_' + opt.value + '-desc' : null\"\r\n [attr.disabled]=\"(isEffectivelyDisabled || opt.disabled) ? 'disabled' : null\" (change)=\"onRadioChange(opt.value)\" />\r\n } @else {\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.role]=\"isSwitchCard ? 'switch' : null\"\r\n [attr.aria-describedby]=\"(!isChoiceCardCompact && opt.description) ? name + '_' + opt.value + '-desc' : null\"\r\n [attr.disabled]=\"(isEffectivelyDisabled || opt.disabled) ? 'disabled' : null\" />\r\n }\r\n <span class=\"d-flex-v gap-5xs\">\r\n <span class=\"field-card-title\">{{ opt.label | translate }}</span>\r\n @if (!isChoiceCardCompact && opt.description) {\r\n <span class=\"field-text\" [id]=\"name + '_' + opt.value + '-desc'\">{{ opt.description | translate }}</span>\r\n }\r\n </span>\r\n </label>\r\n </li>\r\n }\r\n </ul>\r\n </fieldset>\r\n }\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: labelParams }}</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: labelParams }}\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 [attr.aria-labelledby]=\"hasFieldTooltip ? legendId : null\"\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\" [class.d-flex-h]=\"hasFieldTooltip\" [class.gap-2xs]=\"hasFieldTooltip\">\r\n <span [id]=\"legendId\">\r\n {{label | translate: labelParams}}\r\n @if(isRequired) {\r\n <span class=\"text-danger\">*</span>\r\n }\r\n </span>\r\n @if (hasFieldTooltip) {\r\n <ng-container *ngTemplateOutlet=\"fieldTooltip\"></ng-container>\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 gap-sm'\">\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 [attr.aria-labelledby]=\"hasFieldTooltip ? legendId : null\">\r\n <legend class=\"field-label\" [class.visually-hidden]=\"!displayLabel\" [class.d-flex-h]=\"hasFieldTooltip\" [class.gap-2xs]=\"hasFieldTooltip\">\r\n <span [id]=\"legendId\">\r\n {{label | translate: labelParams}}\r\n </span>\r\n @if (hasFieldTooltip) {\r\n <ng-container *ngTemplateOutlet=\"fieldTooltip\"></ng-container>\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 gap-sm'\">\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 [attr.aria-labelledby]=\"hasFieldTooltip ? legendId : null\"\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\" [class.d-flex-h]=\"hasFieldTooltip\" [class.gap-2xs]=\"hasFieldTooltip\">\r\n <span [id]=\"legendId\">\r\n {{label | translate: labelParams}}\r\n @if(isRequired) {\r\n <span class=\"text-danger\">*</span>\r\n }\r\n </span>\r\n @if (hasFieldTooltip) {\r\n <ng-container *ngTemplateOutlet=\"fieldTooltip\"></ng-container>\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 [attr.aria-labelledby]=\"hasFieldTooltip ? legendId : null\">\r\n <legend class=\"field-label\" [class.visually-hidden]=\"!displayLabel\" [class.d-flex-h]=\"hasFieldTooltip\" [class.gap-2xs]=\"hasFieldTooltip\">\r\n <span [id]=\"legendId\">\r\n {{label | translate: labelParams}}\r\n </span>\r\n @if (hasFieldTooltip) {\r\n <ng-container *ngTemplateOutlet=\"fieldTooltip\"></ng-container>\r\n }\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 (isPeriod) {\r\n <!-- Fieldset : le legend nomme la p\u00E9riode, \u00AB Du \u00BB / \u00AB au \u00BB sont les labels de chaque input. -->\r\n <fieldset [attr.aria-labelledby]=\"hasFieldTooltip ? legendId : null\">\r\n <legend class=\"field-label\" [class.visually-hidden]=\"!displayLabel\" [class.d-flex-h]=\"hasFieldTooltip\" [class.gap-2xs]=\"hasFieldTooltip\">\r\n <span [id]=\"legendId\">\r\n {{label | translate: labelParams}}\r\n <!-- Deux bornes obligatoires : ast\u00E9risque sur la p\u00E9riode ; une seule : sur sa borne. -->\r\n @if(isStartRequired && isEndRequired) {\r\n <span class=\"text-danger\">*</span>\r\n }\r\n </span>\r\n @if (hasFieldTooltip) {\r\n <ng-container *ngTemplateOutlet=\"fieldTooltip\"></ng-container>\r\n }\r\n </legend>\r\n <!-- \u00C9tats invalide / d\u00E9sactiv\u00E9 pos\u00E9s seulement avec addon ou raccourcis (rendu historique sinon). -->\r\n <div class=\"field-group\"\r\n [class.field-group-invalid]=\"hasPeriodAddons && isInvalid\"\r\n [class.field-group-disabled]=\"hasPeriodAddons && isDisabledOrReadonly\">\r\n @if (addonLeft) {\r\n <div class=\"field-group-addon-left\">\r\n <ng-container [ngTemplateOutlet]=\"addonLeft\"></ng-container>\r\n </div>\r\n }\r\n <label class=\"field-group-addon-left\" [for]=\"name + '_start'\">\r\n {{ '_COMMON._DATES.FROM_TO_1' | translate }}\r\n @if(isStartRequired && !isEndRequired) {\r\n <span class=\"text-danger\">*</span>\r\n }\r\n </label>\r\n <input [type]=\"getInputType()\" class=\"field-control\" [id]=\"name + '_start'\" [formControl]=\"getControl('start')!\"\r\n [attr.title]=\"fieldTitle ? (fieldTitle | translate) + ' \u2013 ' + ('_COMMON._DATES.FROM_TO_1' | translate) : null\"\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]=\"isStartRequired ? 'required' : null\" [attr.readonly]=\"isReadonly ? 'readonly' : null\"\r\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\" [attr.aria-required]=\"isStartRequired\"\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')\" (blur)=\"onBlurRange('start')\" />\r\n\r\n @if(getControl('start')?.value && !isDisabledOrReadonly) {\r\n <button type=\"button\" class=\"btn btn-secondary btn-clear-field\"\r\n [attr.aria-label]=\"'_COMMON._FORM.CLEAR_START' | translate: { label: label | translate: labelParams }\"\r\n (click)=\"onClearFieldPeriod('start')\">\r\n <span aria-hidden=\"true\">&times;</span>\r\n </button>\r\n }\r\n <label class=\"field-group-addon-center\" [for]=\"name + '_end'\">\r\n {{ '_COMMON._DATES.FROM_TO_2' | translate }}\r\n @if(isEndRequired && !isStartRequired) {\r\n <span class=\"text-danger\">*</span>\r\n }\r\n </label>\r\n <input [type]=\"getInputType()\" class=\"field-control\" [id]=\"name + '_end'\" [formControl]=\"getControl('end')!\"\r\n [attr.title]=\"fieldTitle ? (fieldTitle | translate) + ' \u2013 ' + ('_COMMON._DATES.FROM_TO_2' | translate) : null\"\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]=\"isEndRequired ? 'required' : null\" [attr.readonly]=\"isReadonly ? 'readonly' : null\"\r\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\" [attr.aria-required]=\"isEndRequired\"\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')\" (blur)=\"onBlurRange('end')\" />\r\n\r\n @if(getControl('end')?.value && !isDisabledOrReadonly) {\r\n <button type=\"button\" class=\"btn btn-ghost btn-clear-field\"\r\n [attr.aria-label]=\"'_COMMON._FORM.CLEAR_END' | translate: { label: label | translate: labelParams }\"\r\n (click)=\"onClearFieldPeriod('end')\">\r\n <span aria-hidden=\"true\">&times;</span>\r\n </button>\r\n }\r\n\r\n <!-- Raccourcis (dateToDate) puis addon droit : dans le fieldset, apr\u00E8s la borne de fin. -->\r\n @for (shortcut of activePeriodShortcuts; track $index) {\r\n <div class=\"field-group-addon-right\">\r\n <button type=\"button\" class=\"btn btn-ghost\"\r\n [class.active]=\"isPeriodShortcutActive(shortcut)\"\r\n [attr.aria-pressed]=\"isPeriodShortcutActive(shortcut)\"\r\n [attr.aria-label]=\"shortcut.ariaLabel ? (shortcut.ariaLabel | translate) : null\"\r\n [attr.disabled]=\"isDisabledOrReadonly ? 'disabled' : null\"\r\n (click)=\"onPeriodShortcut(shortcut)\">\r\n {{ shortcut.label | translate }}\r\n </button>\r\n </div>\r\n }\r\n @if (addonRight) {\r\n <div class=\"field-group-addon-right\">\r\n <ng-container [ngTemplateOutlet]=\"addonRight\"></ng-container>\r\n </div>\r\n }\r\n </div>\r\n </fieldset>\r\n }\r\n\r\n @if ([typeField.datePlusOne, typeField.datePlusTwo, typeField.datePlusSeven, typeField.dateComplexe].includes(type)) {\r\n\r\n <div class=\"field-group\">\r\n @if (type === typeField.dateComplexe) {\r\n <div class=\"field-group-addon-left\">\r\n <button class=\"btn btn-ghost\" type=\"button\" (click)=\"onDateAddDay('prev')\"\r\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\">\r\n <cw-icon font=\"optyweb\" [icon]=\"spriteIcon.nextLeft\" [label]=\"'Jour pr\u00E9c\u00E9dent'\"></cw-icon>\r\n </button>\r\n </div>\r\n }\r\n\r\n <input type=\"date\" class=\"field-control\" [id]=\"name\" [formControl]=\"formControl\"\r\n [attr.title]=\"fieldTitle ? (fieldTitle | translate) : null\"\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.aria-required]=\"isRequired\"\r\n [attr.min]=\"minAttr\" [attr.max]=\"maxAttr\" [attr.step]=\"stepAttr\"\r\n [attr.autocomplete]=\"autocomplete\"\r\n [attr.aria-invalid]=\"control.invalid && control.touched\"\r\n [attr.aria-describedby]=\"getDescribedBy(control)\"\r\n (focus)=\"onFocus()\" (blur)=\"onBlur()\" />\r\n\r\n @if(formControl?.value && !isDisabledOrReadonly) {\r\n <button class=\"btn btn-ghost btn-clear-field\" type=\"button\"\r\n [attr.aria-label]=\"'_COMMON._FORM.CLEAR_FIELD' | translate: { label: label | translate: labelParams }\"\r\n (click)=\"onClearField(formControl)\"><span aria-hidden=\"true\">&times;</span></button>\r\n }\r\n\r\n\r\n @if (type === typeField.dateComplexe) {\r\n <div class=\"field-group-addon-right\">\r\n <button class=\"btn btn-ghost\" type=\"button\" (click)=\"onDateAddDay('next')\"\r\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\">\r\n <cw-icon font=\"optyweb\" [icon]=\"spriteIcon.nextRight\" [label]=\"'Jour suivant'\"></cw-icon>\r\n </button>\r\n </div>\r\n <div class=\"field-group-addon-right\">\r\n <button class=\"btn btn-ghost\" type=\"button\" (click)=\"onRefresh()\"\r\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\">\r\n <cw-icon font=\"optyweb\" [icon]=\"spriteIcon.toolbarRefresh\" [label]=\"'Rafra\u00EEchir'\"></cw-icon>\r\n </button>\r\n </div>\r\n }\r\n\r\n <div class=\"field-group-addon-right\">\r\n <button class=\"btn btn-ghost\" type=\"button\" (click)=\"onTodayAddDay(0)\"\r\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\">\r\n J\r\n <span class=\"visually-hidden\">Aujourd'hui</span>\r\n </button>\r\n </div>\r\n <div class=\"field-group-addon-right\">\r\n <button class=\"btn btn-ghost\" type=\"button\" (click)=\"onTodayAddDay(1)\"\r\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\">\r\n J+1\r\n <span class=\"visually-hidden\">Demain</span>\r\n </button>\r\n </div>\r\n\r\n @if (type !== typeField.datePlusOne && type !== typeField.dateComplexe) {\r\n <div class=\"field-group-addon-right\">\r\n <button class=\"btn btn-ghost \" type=\"button\" (click)=\"onTodayAddDay(2)\"\r\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\">\r\n J+2\r\n <span class=\"visually-hidden\">Dans 2 jours</span>\r\n </button>\r\n </div>\r\n\r\n @if (type !== typeField.datePlusTwo) {\r\n <div class=\"field-group-addon-right\">\r\n <button class=\"btn btn-ghost\" type=\"button\" (click)=\"onTodayAddDay(7)\"\r\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\">\r\n J+7\r\n <span class=\"visually-hidden\">Dans 7 jours</span>\r\n </button>\r\n </div>\r\n }\r\n }\r\n </div>\r\n }\r\n\r\n @if (type === typeField.slider) {\r\n @defer (on immediate) {\r\n <cw-slider-field [(value)]=\"sliderValue\" [options]=\"sliderOptions\" [control]=\"formControl\" />\r\n }\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: labelParams }} {{ formControl.value }}\r\n @if (rangeOptions.unit) {\r\n <abbr [title]=\"rangeOptions.unit\">{{ rangeOptions.unit }}</abbr>\r\n }\r\n </label>\r\n\r\n <div class=\"slider-custom-bar\">\r\n <div class=\"slider-custom-bar-selection\" [style.width]=\"getRangePercent() + '%'\">\r\n </div>\r\n </div>\r\n\r\n <input type=\"range\" [id]=\"name\" [formControl]=\"formControl\" [min]=\"rangeOptions.floor\" [max]=\"rangeOptions.ceil\"\r\n [step]=\"rangeOptions.step || 1\" class=\"field-control-range\" [attr.aria-required]=\"isRequired\"\r\n [attr.aria-invalid]=\"control.invalid && control.touched\">\r\n </div>\r\n\r\n <cw-button [isDisabled]=\"formControl.value >= rangeOptions.ceil\" [label]=\"'Augmenter ' + formControl.value + ' ' + label\"\r\n [withIcon]=\"spriteIcon.toolbarPlus\" [withOnlyIcon]=\"true\" [type]=\"buttonType.primary\"\r\n [iconSize]=\"buttonIconSize.small\" (btnAction)=\"onRangeStep('increase')\">\r\n </cw-button>\r\n </div>\r\n }\r\n\r\n @if (isInInputGroup() && clearable && !isDisabledOrReadonly && type !== typeField.autocompleteMultiple) {\r\n @if (type === typeField.autocomplete) {\r\n @if (autocompleteRef()?.hasAnyContent()) {\r\n <button class=\"btn btn-secondary btn-clear-field\" type=\"button\"\r\n [attr.aria-label]=\"'_COMMON._FORM.CLEAR_FIELD' | translate: { label: label | translate: labelParams }\"\r\n (click)=\"onClearAutocomplete()\"><span aria-hidden=\"true\">&times;</span></button>\r\n }\r\n } @else if (type === typeField.ngSelectMultiple) {\r\n <!-- value est un tableau : un [] vide \u00E9tant truthy, on teste .length pour n'afficher le clear global que s'il y a au moins une s\u00E9lection. -->\r\n @if (formControl?.value?.length) {\r\n <button class=\"btn btn-ghost btn-clear-field\" type=\"button\"\r\n [attr.aria-label]=\"'_COMMON._FORM.CLEAR_FIELD' | translate: { label: label | translate: labelParams }\"\r\n (click)=\"onClearField(formControl)\"><span aria-hidden=\"true\">&times;</span></button>\r\n }\r\n } @else {\r\n @if(formControl?.value) {\r\n <button class=\"btn btn-ghost btn-clear-field\" type=\"button\"\r\n [attr.aria-label]=\"'_COMMON._FORM.CLEAR_FIELD' | translate: { label: label | translate: labelParams }\"\r\n (click)=\"onClearField(formControl)\"><span aria-hidden=\"true\">&times;</span></button>\r\n }\r\n }\r\n }\r\n\r\n</ng-template>\r\n\r\n<ng-template #fieldLabel>\r\n <label [for]=\"name\" class=\"field-label\" [class.visually-hidden]=\"!displayLabel\">\r\n {{ label | translate: labelParams }}\r\n\r\n @if (isRequired) {\r\n <span class=\"text-danger\">*</span>\r\n }\r\n </label>\r\n</ng-template>\r\n\r\n<!-- Bouton d'aide (tooltip) partage label/legend. Hors du <label> (sinon son libelle\r\n s'ajoute au nom du champ et le clic active le label) ; dans un <legend>, le fieldset\r\n est nomme par aria-labelledby sur le seul texte (legendId) pour la meme raison. -->\r\n<ng-template #fieldTooltip>\r\n <button type=\"button\" class=\"btn btn-ghost btn-field-tooltip\"\r\n [cwTooltip]=\"tooltip ?? ''\"\r\n [attr.data-test-ctw]=\"'tooltip-' + name\">\r\n <cw-icon [icon]=\"spriteIcon.alertHelp\" [type]=\"iconType.circular\" [iconUiType]=\"iconUiType.info\"\r\n [iconSize]=\"iconSize.xs\" [label]=\"'_COMMON._FORM.TOOLTIP_HELP' | translate\"></cw-icon>\r\n </button>\r\n</ng-template>\r\n" }]
4656
+ }], ctorParameters: () => [], propDecorators: { control: [{
4657
+ type: Input
4658
+ }], formGroup: [{
4659
+ type: Input
4660
+ }], type: [{
4661
+ type: Input
4662
+ }], label: [{
4663
+ type: Input
4664
+ }], labelParams: [{
4665
+ type: Input
4666
+ }], displayLabel: [{
4667
+ type: Input
4668
+ }], fieldTitle: [{
4669
+ type: Input
4670
+ }], name: [{
4671
+ type: Input
4672
+ }], placeholder: [{
4673
+ type: Input
4674
+ }], autocomplete: [{
4675
+ type: Input
4676
+ }], options: [{
4677
+ type: Input
4678
+ }], rangeOptions: [{
4679
+ type: Input
4680
+ }], validationOptions: [{
4681
+ type: Input
4682
+ }], autocompleteOptions: [{
4683
+ type: Input
4684
+ }], richTextOptions: [{
4685
+ type: Input
4686
+ }], errorMessages: [{
4687
+ type: Input
4688
+ }], isRequired: [{
4689
+ type: Input
4690
+ }], requiredStart: [{
4691
+ type: Input
4692
+ }], requiredEnd: [{
4693
+ type: Input
4694
+ }], periodShortcuts: [{
4695
+ type: Input
4696
+ }], description: [{
4697
+ type: Input
4698
+ }], help: [{
4699
+ type: Input
4700
+ }], helpParams: [{
4701
+ type: Input
4702
+ }], tooltip: [{
4703
+ type: Input
4704
+ }], ariaDescribedBy: [{
4705
+ type: Input
4706
+ }], addonLeft: [{
4707
+ type: Input
4708
+ }], addonRight: [{
4709
+ type: Input
4710
+ }], isInAddon: [{
4711
+ type: Input
4712
+ }], isReadonly: [{
4713
+ type: Input
4714
+ }], isDisabled: [{
4715
+ type: Input
4716
+ }], sliderValue: [{
4717
+ type: Input
4718
+ }], sliderOptions: [{
4719
+ type: Input
4720
+ }], cssClass: [{
4721
+ type: Input
4722
+ }], skeletonMode: [{
4723
+ type: Input
4724
+ }], clearable: [{
4725
+ type: Input
4726
+ }], appendTo: [{
4727
+ type: Input
4728
+ }], initialCountry: [{
4729
+ type: Input
4730
+ }], recommendedDimensions: [{
4731
+ type: Input
4732
+ }], showPreview: [{
4733
+ type: Input
4734
+ }], existingFile: [{
4735
+ type: Input
4736
+ }], 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 }] }], ngSelectRef: [{ type: i0.ViewChild, args: ['ngSelect', { isSignal: true }] }], refreshEvent: [{
4737
+ type: Output
4738
+ }], fileRemoved: [{
4739
+ type: Output
4740
+ }], textChanged: [{
4741
+ type: Output
4742
+ }], valueChange: [{
4743
+ type: Output
4744
+ }], phoneRegionChange: [{
4745
+ type: Output
4746
+ }], optionTemplate: [{
4747
+ type: ContentChild,
4748
+ args: ['ngOptionTpl', { read: TemplateRef }]
4749
+ }], labelTemplate: [{
4750
+ type: ContentChild,
4751
+ args: ['ngLabelTpl', { read: TemplateRef }]
4752
+ }], autocompleteOptionTpl: [{
4753
+ type: ContentChild,
4754
+ args: [CwAutocompleteOptionDirective]
4755
+ }], hostClasses: [{
4756
+ type: HostBinding,
4757
+ args: ['class']
4758
+ }] } }) });
4749
4759
 
4750
4760
  var LegendTypeEnum;
4751
4761
  (function (LegendTypeEnum) {
@@ -5593,11 +5603,11 @@ class FileToDownloadComponent {
5593
5603
  this.attachments = input.required(...(ngDevMode ? [{ debugName: "attachments" }] : []));
5594
5604
  }
5595
5605
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: FileToDownloadComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
5596
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.20", type: FileToDownloadComponent, isStandalone: true, selector: "cw-file-to-download", inputs: { attachments: { classPropertyName: "attachments", publicName: "attachments", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0, template: "<!-- If one file -->\n@if (attachments().length === 1 ) {\n<ng-container *ngTemplateOutlet=\"file;context:{attachment:attachments()[0]}\"></ng-container>\n}\n\n<!-- If two files or more, li loop -->\n@if (attachments().length > 1) {\n<ul class=\"list-unstyled file-to-download-items\">\n @for (attachment of attachments(); track attachment) {\n <li class=\"file-to-download-list-item\">\n <ng-container *ngTemplateOutlet=\"file;context:{attachment:attachment}\"></ng-container>\n </li>\n }\n</ul>\n}\n\n<ng-template #file let-attachment=\"attachment\">\n <a [href]=\"attachment.url\" class=\"file-to-download-link\" target=\"_blank\" rel=\"noopener noreferrer\">\n <span class=\"file-to-download-name\">\n {{ attachment.label ? attachment.label : ('_SHARED.ATTACHMENT_DEFAULT_LABEL' | translate ) }}\n </span>\n <span class=\"file-to-download-info\">\n @if (attachment.extension && attachment.size) {\n {{attachment.extension.toUpperCase()}} {{attachment.size * 1024 | formatFileSize}}\n }\n <cw-icon [icon]=\"spriteIcon\" font=\"optyweb\" [label]=\"'_COMMON.NEW_WINDOW' |translate\" [type]=\"iconType.default\"\n [iconSize]=\"iconSize['md']\" iconCssClass=\"file-to-download-download\"></cw-icon>\n </span>\n </a>\n</ng-template>\n", dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: IconComponent, selector: "cw-icon", inputs: ["icon", "text", "label", "type", "iconSize", "iconCssClass", "iconUiType", "iconColorCustom", "spritePath"] }, { kind: "pipe", type: TranslatePipe, name: "translate" }, { kind: "pipe", type: FormatFileSizePipe, name: "formatFileSize" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
5606
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.20", type: FileToDownloadComponent, isStandalone: true, selector: "cw-file-to-download", inputs: { attachments: { classPropertyName: "attachments", publicName: "attachments", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0, template: "<!-- If one file : meme conteneur que la liste, sans <ul> -->\r\n@if (attachments().length === 1 ) {\r\n<div class=\"file-to-download-items\">\r\n <ng-container *ngTemplateOutlet=\"file;context:{attachment:attachments()[0]}\"></ng-container>\r\n</div>\r\n}\r\n\r\n<!-- If two files or more, li loop -->\r\n@if (attachments().length > 1) {\r\n<ul class=\"list-unstyled file-to-download-items\">\r\n @for (attachment of attachments(); track attachment) {\r\n <li class=\"file-to-download-list-item\">\r\n <ng-container *ngTemplateOutlet=\"file;context:{attachment:attachment}\"></ng-container>\r\n </li>\r\n }\r\n</ul>\r\n}\r\n\r\n<ng-template #file let-attachment=\"attachment\">\r\n <a [href]=\"attachment.url\" class=\"file-to-download-link\" target=\"_blank\" rel=\"noopener noreferrer\">\r\n @if (attachment.extension) {\r\n <span class=\"file-to-download-type\" aria-hidden=\"true\">{{attachment.extension.toUpperCase()}}</span>\r\n }\r\n <span class=\"file-to-download-content\">\r\n <span class=\"file-to-download-name\">\r\n {{ attachment.label ? attachment.label : ('_SHARED.ATTACHMENT_DEFAULT_LABEL' | translate ) }}\r\n </span>\r\n @if (attachment.extension && attachment.size) {\r\n <span class=\"file-to-download-info\">{{attachment.extension.toUpperCase()}} \u00B7 {{attachment.size * 1024 | formatFileSize}}</span>\r\n }\r\n </span>\r\n <cw-icon [icon]=\"spriteIcon\" font=\"optyweb\" [label]=\"'_COMMON.NEW_WINDOW' |translate\" [type]=\"iconType.default\"\r\n [iconSize]=\"iconSize['md']\" iconCssClass=\"file-to-download-download\"></cw-icon>\r\n </a>\r\n</ng-template>\r\n", dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: IconComponent, selector: "cw-icon", inputs: ["icon", "text", "label", "type", "iconSize", "iconCssClass", "iconUiType", "iconColorCustom", "spritePath"] }, { kind: "pipe", type: TranslatePipe, name: "translate" }, { kind: "pipe", type: FormatFileSizePipe, name: "formatFileSize" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
5597
5607
  }
5598
5608
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: FileToDownloadComponent, decorators: [{
5599
5609
  type: Component,
5600
- args: [{ selector: 'cw-file-to-download', changeDetection: ChangeDetectionStrategy.OnPush, imports: [NgTemplateOutlet, TranslatePipe, FormatFileSizePipe, IconComponent], template: "<!-- If one file -->\n@if (attachments().length === 1 ) {\n<ng-container *ngTemplateOutlet=\"file;context:{attachment:attachments()[0]}\"></ng-container>\n}\n\n<!-- If two files or more, li loop -->\n@if (attachments().length > 1) {\n<ul class=\"list-unstyled file-to-download-items\">\n @for (attachment of attachments(); track attachment) {\n <li class=\"file-to-download-list-item\">\n <ng-container *ngTemplateOutlet=\"file;context:{attachment:attachment}\"></ng-container>\n </li>\n }\n</ul>\n}\n\n<ng-template #file let-attachment=\"attachment\">\n <a [href]=\"attachment.url\" class=\"file-to-download-link\" target=\"_blank\" rel=\"noopener noreferrer\">\n <span class=\"file-to-download-name\">\n {{ attachment.label ? attachment.label : ('_SHARED.ATTACHMENT_DEFAULT_LABEL' | translate ) }}\n </span>\n <span class=\"file-to-download-info\">\n @if (attachment.extension && attachment.size) {\n {{attachment.extension.toUpperCase()}} {{attachment.size * 1024 | formatFileSize}}\n }\n <cw-icon [icon]=\"spriteIcon\" font=\"optyweb\" [label]=\"'_COMMON.NEW_WINDOW' |translate\" [type]=\"iconType.default\"\n [iconSize]=\"iconSize['md']\" iconCssClass=\"file-to-download-download\"></cw-icon>\n </span>\n </a>\n</ng-template>\n" }]
5610
+ args: [{ selector: 'cw-file-to-download', changeDetection: ChangeDetectionStrategy.OnPush, imports: [NgTemplateOutlet, TranslatePipe, FormatFileSizePipe, IconComponent], template: "<!-- If one file : meme conteneur que la liste, sans <ul> -->\r\n@if (attachments().length === 1 ) {\r\n<div class=\"file-to-download-items\">\r\n <ng-container *ngTemplateOutlet=\"file;context:{attachment:attachments()[0]}\"></ng-container>\r\n</div>\r\n}\r\n\r\n<!-- If two files or more, li loop -->\r\n@if (attachments().length > 1) {\r\n<ul class=\"list-unstyled file-to-download-items\">\r\n @for (attachment of attachments(); track attachment) {\r\n <li class=\"file-to-download-list-item\">\r\n <ng-container *ngTemplateOutlet=\"file;context:{attachment:attachment}\"></ng-container>\r\n </li>\r\n }\r\n</ul>\r\n}\r\n\r\n<ng-template #file let-attachment=\"attachment\">\r\n <a [href]=\"attachment.url\" class=\"file-to-download-link\" target=\"_blank\" rel=\"noopener noreferrer\">\r\n @if (attachment.extension) {\r\n <span class=\"file-to-download-type\" aria-hidden=\"true\">{{attachment.extension.toUpperCase()}}</span>\r\n }\r\n <span class=\"file-to-download-content\">\r\n <span class=\"file-to-download-name\">\r\n {{ attachment.label ? attachment.label : ('_SHARED.ATTACHMENT_DEFAULT_LABEL' | translate ) }}\r\n </span>\r\n @if (attachment.extension && attachment.size) {\r\n <span class=\"file-to-download-info\">{{attachment.extension.toUpperCase()}} \u00B7 {{attachment.size * 1024 | formatFileSize}}</span>\r\n }\r\n </span>\r\n <cw-icon [icon]=\"spriteIcon\" font=\"optyweb\" [label]=\"'_COMMON.NEW_WINDOW' |translate\" [type]=\"iconType.default\"\r\n [iconSize]=\"iconSize['md']\" iconCssClass=\"file-to-download-download\"></cw-icon>\r\n </a>\r\n</ng-template>\r\n" }]
5601
5611
  }], propDecorators: { attachments: [{ type: i0.Input, args: [{ isSignal: true, alias: "attachments", required: true }] }] } });
5602
5612
 
5603
5613
  var NumericalRangeTypeEnum;