@cityway/basic-ui 1.1.0-beta014 → 1.1.0-beta016

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.
@@ -1031,6 +1031,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.20", ngImpo
1031
1031
  }], ctorParameters: () => [] });
1032
1032
 
1033
1033
  const TOAST_AUTOHIDE_DELAY_MS = 6000;
1034
+ // Compteur plutôt que `crypto.randomUUID()` : ce dernier n'existe qu'en contexte sécurisé
1035
+ // (HTTPS / localhost) et fait planter `show()` en HTTP. L'id n'a besoin d'être unique que dans la page.
1036
+ let nextToastId = 0;
1034
1037
  class ToastService {
1035
1038
  constructor() {
1036
1039
  this.focusService = inject(FocusTrackerService);
@@ -1042,7 +1045,7 @@ class ToastService {
1042
1045
  return;
1043
1046
  }
1044
1047
  const toast = {
1045
- id: crypto.randomUUID(),
1048
+ id: `cw-toast-${nextToastId++}`,
1046
1049
  type: options.type,
1047
1050
  title: options.title,
1048
1051
  message: options.message,
@@ -1193,7 +1196,7 @@ class ToastItemComponent {
1193
1196
  }
1194
1197
  }
1195
1198
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: ToastItemComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
1196
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.20", type: ToastItemComponent, isStandalone: true, selector: "cw-toast-item", inputs: { toast: { classPropertyName: "toast", publicName: "toast", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { action: "action" }, host: { listeners: { "mouseenter": "onMouseEnter()", "mouseleave": "onMouseLeave()", "focusin": "onFocusIn()", "focusout": "onFocusOut($event)" } }, ngImport: i0, template: "<cw-alert\n [type]=\"toast().type\"\n [isDismissible]=\"true\"\n [title]=\"(toast().title ?? '') | translate\"\n (close)=\"onClose()\"\n [dataTest]=\"'toast-' + toast().type\">\n <span [innerHTML]=\"toast().message | translate\"></span>&nbsp;\n @if (toast().action; as action) {\n <a href=\"javascript:void(0);\" (click)=\"onAction()\" class=\"alert-link\">{{ action.label }}</a>\n }\n</cw-alert>\n\n@if (toast().autohide) {\n <div class=\"toast-progress\" [style.width.%]=\"progress()\"></div>\n}\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "component", type: AlertComponent, selector: "cw-alert", inputs: ["type", "title", "isDismissible", "cssClass", "dataTest"], outputs: ["close"] }, { kind: "pipe", type: TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
1199
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.20", type: ToastItemComponent, isStandalone: true, selector: "cw-toast-item", inputs: { toast: { classPropertyName: "toast", publicName: "toast", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { action: "action" }, host: { listeners: { "mouseenter": "onMouseEnter()", "mouseleave": "onMouseLeave()", "focusin": "onFocusIn()", "focusout": "onFocusOut($event)" } }, ngImport: i0, template: "<cw-alert\n [type]=\"toast().type\"\n [isDismissible]=\"true\"\n [title]=\"(toast().title ?? '') | translate\"\n (close)=\"onClose()\"\n [dataTest]=\"'toast-' + toast().type\">\n <span [innerHTML]=\"toast().message | translate\"></span>&nbsp;\n @if (toast().action; as action) {\n <button type=\"button\" class=\"alert-link\" (click)=\"onAction()\">{{ action.label }}</button>\n }\n</cw-alert>\n\n@if (toast().autohide) {\n <div class=\"toast-progress\" [style.width.%]=\"progress()\"></div>\n}\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "component", type: AlertComponent, selector: "cw-alert", inputs: ["type", "title", "isDismissible", "cssClass", "dataTest"], outputs: ["close"] }, { kind: "pipe", type: TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
1197
1200
  }
1198
1201
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: ToastItemComponent, decorators: [{
1199
1202
  type: Component,
@@ -1202,7 +1205,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.20", ngImpo
1202
1205
  '(mouseleave)': 'onMouseLeave()',
1203
1206
  '(focusin)': 'onFocusIn()',
1204
1207
  '(focusout)': 'onFocusOut($event)',
1205
- }, template: "<cw-alert\n [type]=\"toast().type\"\n [isDismissible]=\"true\"\n [title]=\"(toast().title ?? '') | translate\"\n (close)=\"onClose()\"\n [dataTest]=\"'toast-' + toast().type\">\n <span [innerHTML]=\"toast().message | translate\"></span>&nbsp;\n @if (toast().action; as action) {\n <a href=\"javascript:void(0);\" (click)=\"onAction()\" class=\"alert-link\">{{ action.label }}</a>\n }\n</cw-alert>\n\n@if (toast().autohide) {\n <div class=\"toast-progress\" [style.width.%]=\"progress()\"></div>\n}\n" }]
1208
+ }, template: "<cw-alert\n [type]=\"toast().type\"\n [isDismissible]=\"true\"\n [title]=\"(toast().title ?? '') | translate\"\n (close)=\"onClose()\"\n [dataTest]=\"'toast-' + toast().type\">\n <span [innerHTML]=\"toast().message | translate\"></span>&nbsp;\n @if (toast().action; as action) {\n <button type=\"button\" class=\"alert-link\" (click)=\"onAction()\">{{ action.label }}</button>\n }\n</cw-alert>\n\n@if (toast().autohide) {\n <div class=\"toast-progress\" [style.width.%]=\"progress()\"></div>\n}\n" }]
1206
1209
  }], propDecorators: { toast: [{ type: i0.Input, args: [{ isSignal: true, alias: "toast", required: true }] }], action: [{ type: i0.Output, args: ["action"] }] } });
1207
1210
 
1208
1211
  class ToastComponent {
@@ -3917,6 +3920,13 @@ class FormFieldComponent {
3917
3920
  ctrl.markAsUntouched();
3918
3921
  }
3919
3922
  }
3923
+ /** Variante de `onBlur` pour les types période (start/end portés par des sous-controls). */
3924
+ onBlurRange(path) {
3925
+ const ctrl = this.getControl(path);
3926
+ if (ctrl && !ctrl.touched) {
3927
+ ctrl.markAsTouched();
3928
+ }
3929
+ }
3920
3930
  /**
3921
3931
  * Blur spécifique au type `phone` : ignore les blurs internes au wrapper `.iti` (sélecteur de pays,
3922
3932
  * recherche). Sans ça, ouvrir le dropdown pays poserait `touched=true` prématurément et l'erreur
@@ -4055,9 +4065,12 @@ class FormFieldComponent {
4055
4065
  ctrl?.markAsUntouched();
4056
4066
  this.focusFieldControl();
4057
4067
  }
4058
- /** Redonne le focus à l'input principal du champ (`.field-control`) après une action de clear. */
4068
+ /**
4069
+ * Redonne le focus à l'input principal du champ après une action de clear : `.field-control`,
4070
+ * ou l'input interne de ng-select (types select/ngSelect) qui ne porte pas cette classe.
4071
+ */
4059
4072
  focusFieldControl() {
4060
- const el = this.elementRef.nativeElement.querySelector('.field-control');
4073
+ const el = this.elementRef.nativeElement.querySelector('.field-control, .ng-select input');
4061
4074
  el?.focus();
4062
4075
  }
4063
4076
  onDateAddDay(direction) {
@@ -4106,7 +4119,7 @@ class FormFieldComponent {
4106
4119
  this.formControl.markAsTouched();
4107
4120
  }
4108
4121
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: FormFieldComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
4109
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.20", type: FormFieldComponent, isStandalone: true, selector: "cw-form-field", inputs: { control: { classPropertyName: "control", publicName: "control", isSignal: false, isRequired: false, transformFunction: null }, formGroup: { classPropertyName: "formGroup", publicName: "formGroup", isSignal: false, isRequired: false, transformFunction: null }, type: { classPropertyName: "type", publicName: "type", isSignal: false, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: false, isRequired: false, transformFunction: null }, displayLabel: { classPropertyName: "displayLabel", publicName: "displayLabel", isSignal: false, isRequired: false, transformFunction: null }, name: { classPropertyName: "name", publicName: "name", isSignal: false, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: false, isRequired: false, transformFunction: null }, autocomplete: { classPropertyName: "autocomplete", publicName: "autocomplete", isSignal: false, isRequired: false, transformFunction: null }, options: { classPropertyName: "options", publicName: "options", isSignal: false, isRequired: false, transformFunction: null }, rangeOptions: { classPropertyName: "rangeOptions", publicName: "rangeOptions", isSignal: false, isRequired: false, transformFunction: null }, validationOptions: { classPropertyName: "validationOptions", publicName: "validationOptions", isSignal: false, isRequired: false, transformFunction: null }, autocompleteOptions: { classPropertyName: "autocompleteOptions", publicName: "autocompleteOptions", isSignal: false, isRequired: false, transformFunction: null }, richTextOptions: { classPropertyName: "richTextOptions", publicName: "richTextOptions", isSignal: false, isRequired: false, transformFunction: null }, errorMessages: { classPropertyName: "errorMessages", publicName: "errorMessages", isSignal: false, isRequired: false, transformFunction: null }, isRequired: { classPropertyName: "isRequired", publicName: "isRequired", isSignal: false, isRequired: false, transformFunction: null }, help: { classPropertyName: "help", publicName: "help", isSignal: false, isRequired: false, transformFunction: null }, tooltip: { classPropertyName: "tooltip", publicName: "tooltip", isSignal: false, isRequired: false, transformFunction: null }, addonLeft: { classPropertyName: "addonLeft", publicName: "addonLeft", isSignal: false, isRequired: false, transformFunction: null }, addonRight: { classPropertyName: "addonRight", publicName: "addonRight", isSignal: false, isRequired: false, transformFunction: null }, isInAddon: { classPropertyName: "isInAddon", publicName: "isInAddon", isSignal: false, isRequired: false, transformFunction: null }, isReadonly: { classPropertyName: "isReadonly", publicName: "isReadonly", isSignal: false, isRequired: false, transformFunction: null }, isDisabled: { classPropertyName: "isDisabled", publicName: "isDisabled", isSignal: false, isRequired: false, transformFunction: null }, sliderValue: { classPropertyName: "sliderValue", publicName: "sliderValue", isSignal: false, isRequired: false, transformFunction: null }, sliderOptions: { classPropertyName: "sliderOptions", publicName: "sliderOptions", isSignal: false, isRequired: false, transformFunction: null }, cssClass: { classPropertyName: "cssClass", publicName: "cssClass", isSignal: false, isRequired: false, transformFunction: null }, skeletonMode: { classPropertyName: "skeletonMode", publicName: "skeletonMode", isSignal: false, isRequired: false, transformFunction: null }, clearable: { classPropertyName: "clearable", publicName: "clearable", isSignal: false, isRequired: false, transformFunction: null }, appendTo: { classPropertyName: "appendTo", publicName: "appendTo", isSignal: false, isRequired: false, transformFunction: null }, initialCountry: { classPropertyName: "initialCountry", publicName: "initialCountry", isSignal: false, isRequired: false, transformFunction: null }, recommendedDimensions: { classPropertyName: "recommendedDimensions", publicName: "recommendedDimensions", isSignal: false, isRequired: false, transformFunction: null }, showPreview: { classPropertyName: "showPreview", publicName: "showPreview", isSignal: false, isRequired: false, transformFunction: null }, existingFile: { classPropertyName: "existingFile", publicName: "existingFile", isSignal: false, isRequired: false, transformFunction: null }, indeterminate: { classPropertyName: "indeterminate", publicName: "indeterminate", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { refreshEvent: "refreshEvent", fileRemoved: "fileRemoved", textChanged: "textChanged", valueChange: "valueChange", phoneRegionChange: "phoneRegionChange" }, host: { properties: { "class": "this.hostClasses" } }, queries: [{ propertyName: "optionTemplate", first: true, predicate: ["ngOptionTpl"], descendants: true, read: TemplateRef }, { propertyName: "labelTemplate", first: true, predicate: ["ngLabelTpl"], descendants: true, read: TemplateRef }], viewQueries: [{ propertyName: "checkboxInputRef", first: true, predicate: ["checkboxInput"], descendants: true, isSignal: true }, { propertyName: "fileInputRef", first: true, predicate: ["fileInput"], descendants: true, isSignal: true }, { propertyName: "phoneInputRef", first: true, predicate: ["phoneInput"], descendants: true, isSignal: true }, { propertyName: "autocompleteRef", first: true, predicate: AutocompleteComponent, descendants: true, isSignal: true }], usesOnChanges: true, ngImport: i0, template: "@if (!isInAddon) {\n @if (\n type !== typeField.checkbox &&\n type !== typeField.radio &&\n type !== typeField.checkboxButton &&\n type !== typeField.radioButton &&\n type !== typeField.checkboxInline &&\n type !== typeField.radioInline &&\n type !== typeField.switch &&\n type !== typeField.range &&\n type !== typeField.switchSmall\n ) {\n <label [for]=\"name\" class=\"field-label\" [class.visually-hidden]=\"!displayLabel\">\n {{ label | translate }}\n\n @if (isRequired) {\n <span class=\"text-danger\">*</span>\n }\n\n @if (tooltip) {\n <!-- <button type=\"button\" class=\"btn btn-link btn-popover\" placement=\"bottom\" [ngbPopover]=\"popContent\" container=\"body\"\n triggers=\"mouseenter:mouseleave\">\n <span class=\"btn-popover-icon bo-icons bo-help\"></span>\n </button>\n <ng-template #popContent>\n <div [innerHTML]=\"tooltip\"></div>\n </ng-template> -->\n }\n </label>\n }\n\n @if (addonLeft || addonRight) {\n <div class=\"field-group\" [class.field-group-invalid]=\"isInvalid\" [class.field-group-disabled]=\"isDisabledOrReadonly\">\n @if(addonLeft) {\n <div class=\"field-group-addon-left\">\n <ng-container [ngTemplateOutlet]=\"addonLeft\"></ng-container>\n </div>\n }\n <ng-container [ngTemplateOutlet]=\"field\"></ng-container>\n @if(addonRight) {\n <div class=\"field-group-addon-right\">\n <ng-container [ngTemplateOutlet]=\"addonRight\"></ng-container>\n </div>\n }\n </div>\n }\n @else {\n @if ( isInInputGroup() ) {\n <div class=\"field-group\" [class.field-group-invalid]=\"isInvalid\" [class.field-group-disabled]=\"isDisabledOrReadonly\">\n <ng-container [ngTemplateOutlet]=\"field\"></ng-container>\n </div>\n }\n @else {\n <ng-container [ngTemplateOutlet]=\"field\"></ng-container>\n }\n }\n\n <!-- Error message -->\n @if (controlOrGroup?.invalid && controlOrGroup?.touched) {\n <div class=\"field-invalid\" [id]=\"'error-' + name\">\n @if (\n !errorMessages?.['required'] &&\n ((controlOrGroup?.errors?.['required']) || (getControl('start')?.errors?.['required'] || getControl('end')?.errors?.['required']))\n ) {\n <span [innerHtml]=\"'_COMMON._FORM.ERROR_IS_MANDATORY' | translate: {label: label | translate}\"></span>\n }\n @if (!errorMessages?.['rangeInvalid'] && controlOrGroup?.errors?.['rangeInvalid']) {\n <span>{{'_COMMON._DATES.ERROR_START_END_PERIOD' | translate}}</span>\n }\n @if (!errorMessages?.['fileExtension'] && controlOrGroup?.errors?.['fileExtension']) {\n <span>{{ '_COMMON._FORM.ERROR_FILE_EXTENSION' | translate: { accept: acceptLabel } }}</span>\n }\n @if (!errorMessages?.['fileSize'] && controlOrGroup?.errors?.['fileSize']) {\n <span>{{ '_COMMON._FORM.ERROR_FILE_SIZE' | translate: { maxSize: maxSizeLabel } }}</span>\n }\n @if (!errorMessages?.['email'] && controlOrGroup?.errors?.['email']) {\n <span>{{ '_COMMON._FORM.ERROR_INVALID_EMAIL' | translate }}</span>\n }\n @if (!errorMessages?.['phone'] && controlOrGroup?.errors?.['phone']) {\n <span>{{ '_COMMON._FORM.ERROR_INVALID_PHONE' | translate }}</span>\n }\n @if (errorMessages) {\n @for (entry of errorMessages | keyvalue: keepOrder; track entry.key) {\n @if (controlOrGroup?.errors?.[entry.key]; as errVal) {\n <span>{{ entry.value | translate: (errVal === true ? null : errVal) }}</span>\n }\n }\n }\n </div>\n }\n\n @if (help || autoHelpEntries.length) {\n <div [id]=\"name + '-help'\" class=\"field-text\">\n @if (help) {\n <span>{{ help | translate }}</span>\n }\n @for (entry of autoHelpEntries; track entry.key) {\n <span>{{ entry.key | translate: entry.params }}</span>\n }\n </div>\n }\n\n <!-- Aper\u00E7u du fichier (type=file, opt-in) : sous le champ et ses aides, comme dans la\n maquette DS. La croix native du champ n'est pas retir\u00E9e \u2014 les deux vident le m\u00EAme\n control, l'aper\u00E7u ajoute juste \u00AB Visualiser \u00BB et une cible plus grande. -->\n @if (isPreviewVisible) {\n <cw-file-preview [file]=\"previewFile\" [existingFile]=\"existingFile ?? null\"\n [disabled]=\"!!isDisabledOrReadonly\" (remove)=\"onPreviewRemove()\" />\n }\n\n <!-- Chips de la multi-s\u00E9lection (autocomplete) : rendus ici, hors du field-group et apr\u00E8s\n erreur/help, pour \u00EAtre visuellement d\u00E9tach\u00E9s du champ. La donn\u00E9e et le retrait restent\n port\u00E9s par cw-autocomplete (`chips()` / `onChipRemove()`), seul l'affichage est d\u00E9l\u00E9gu\u00E9. -->\n @if (type === typeField.autocompleteMultiple && autocompleteRef()?.chips()?.length) {\n <ul class=\"autocomplete-chips\" role=\"list\">\n @for (chip of autocompleteRef()!.chips(); track chip.item) {\n <li>\n <button type=\"button\" class=\"autocomplete-chip\"\n [disabled]=\"isEffectivelyDisabled || isReadonly\"\n (click)=\"autocompleteRef()!.onChipRemove(chip.item)\">\n <span>{{ chip.label }}</span>\n @if (!isEffectivelyDisabled && !isReadonly) {\n <span aria-hidden=\"true\" class=\"autocomplete-chip-x\">&times;</span>\n <span class=\"visually-hidden\">{{ '_COMMON._ACTION.DELETE' | translate }}</span>\n }\n </button>\n </li>\n }\n </ul>\n }\n}\n@else {\n <ng-container [ngTemplateOutlet]=\"field\"></ng-container>\n}\n\n<ng-template #field>\n <!-- Autocomplete (mono / multi) -->\n @if ((type === typeField.autocomplete || type === typeField.autocompleteMultiple) && autocompleteOptions) {\n <cw-autocomplete\n [id]=\"name\"\n [control]=\"formControl\"\n [fetcher]=\"autocompleteOptions.fetcher\"\n [displayField]=\"autocompleteOptions.displayField ?? 'label'\"\n [valueField]=\"autocompleteOptions.valueField ?? 'id'\"\n [columns]=\"autocompleteOptions.columns ?? []\"\n [resolver]=\"autocompleteOptions.resolver ?? null\"\n [selectedItem]=\"autocompleteOptions.selectedItem ?? null\"\n [selectedItems]=\"autocompleteOptions.selectedItems ?? []\"\n [minChars]=\"autocompleteOptions.minChars ?? 2\"\n [debounceMs]=\"autocompleteOptions.debounceMs ?? 250\"\n [multiple]=\"type === typeField.autocompleteMultiple\"\n [isRequired]=\"isRequired\"\n [isReadonly]=\"!!isReadonly\"\n [isDisabled]=\"isEffectivelyDisabled\"\n [ariaInvalid]=\"control.invalid && control.touched\"\n [ariaDescribedBy]=\"getDescribedBy(control)\"\n [placeholder]=\"placeholder\">\n </cw-autocomplete>\n }\n\n <!-- Rich text editor (Quill) : sous-composant interne, sans field-group ni bouton clear\n (il porte sa propre bordure + toolbar). Le label statique du form-field reste au-dessus. -->\n @if (type === typeField.richText) {\n <cw-rich-text-editor\n [id]=\"name\"\n [control]=\"formControl\"\n [options]=\"richTextOptions\"\n [placeholder]=\"placeholder ? (placeholder | translate) : ''\"\n [isRequired]=\"isRequired\"\n [isReadonly]=\"!!isReadonly\"\n [isDisabled]=\"isEffectivelyDisabled\"\n [ariaInvalid]=\"control.invalid && control.touched\"\n [ariaDescribedBy]=\"getDescribedBy(control)\">\n </cw-rich-text-editor>\n }\n\n <!-- Text -->\n @if ([typeField.text, typeField.date, typeField.time, typeField.dateTime, typeField.number,\n typeField.email,\n typeField.color, typeField.zipCode].includes(type)) {\n <input [type]=\"type === typeField.zipCode ? 'text' : type\" class=\"field-control\" [id]=\"name\" [formControl]=\"formControl\"\n [ngClass]=\"[(cssClass || ''), formControl?.value ? 'has-value' : '', type === typeField.zipCode ? 'field-control-zipcode' : '']\"\n [attr.placeholder]=\"placeholder ? (placeholder | translate) : null\" [attr.required]=\"isRequired ? 'required' : null\"\n [attr.readonly]=\"isReadonly ? 'readonly' : null\" [attr.aria-required]=\"isRequired\"\n [attr.minlength]=\"minLengthAttr\" [attr.maxlength]=\"maxLengthAttr\"\n [attr.min]=\"minAttr\" [attr.max]=\"maxAttr\" [attr.step]=\"stepAttr\" [attr.pattern]=\"patternAttr\"\n [attr.autocomplete]=\"autocomplete\"\n [attr.aria-invalid]=\"control.invalid && control.touched\"\n [attr.aria-describedby]=\"getDescribedBy(control)\"\n (focus)=\"onFocus()\" (blur)=\"onBlur()\" />\n }\n\n <!-- Phone (intl-tel-input) -->\n @if (type === typeField.phone) {\n <input #phoneInput type=\"tel\" class=\"field-control\" [id]=\"name\"\n [attr.placeholder]=\"placeholder ? (placeholder | translate) : null\" [attr.required]=\"isRequired ? 'required' : null\"\n [attr.readonly]=\"isReadonly ? 'readonly' : null\" [disabled]=\"isEffectivelyDisabled\" [attr.aria-required]=\"isRequired\"\n [attr.autocomplete]=\"autocomplete\"\n [attr.aria-invalid]=\"control.invalid && control.touched\"\n [attr.aria-describedby]=\"getDescribedBy(control)\"\n (focus)=\"onFocus()\" (blur)=\"onPhoneBlur($event)\" />\n }\n\n <!-- File -->\n @if (type === typeField.file) {\n <!-- L'input natif reste LE controle (focus, clavier, restitution aux lecteurs d'ecran,\n validation), mais il est masque visuellement : le libelle de son bouton et son\n \u00AB aucun fichier choisi \u00BB sont ecrits par le NAVIGATEUR, dans SA langue. Ils sont\n intraduisibles et ne suivent pas la langue de l'application \u2014 un utilisateur qui\n bascule en anglais garderait \u00AB Choisir un fichier \u00BB. On les reecrit donc a cote,\n traduits, dans une couche purement visuelle. -->\n <input #fileInput type=\"file\" class=\"field-control visually-hidden\" [id]=\"name\"\n [ngClass]=\"[(cssClass || ''), formControl?.value ? 'has-value' : '']\"\n [attr.required]=\"isRequired ? 'required' : null\"\n [attr.readonly]=\"isReadonly ? 'readonly' : null\" [disabled]=\"isEffectivelyDisabled\" [attr.aria-required]=\"isRequired\"\n [attr.accept]=\"acceptAttr\"\n [attr.aria-invalid]=\"control.invalid && control.touched\"\n [attr.aria-describedby]=\"getDescribedBy(control)\"\n (change)=\"onFileChange($event)\" (focus)=\"onFocus()\" (blur)=\"onBlur()\" />\n\n <!-- `aria-hidden` : doublon visuel de l'input, que les lecteurs d'ecran restituent deja\n (nom du champ, bouton de parcours, fichier selectionne). L'annoncer une seconde fois\n ne ferait que bavarder. Le clic est relaye a l'input, le clavier passe par lui. -->\n <span class=\"field-file\" aria-hidden=\"true\" (click)=\"openFilePicker()\">\n <span class=\"field-file-button\">{{ '_COMMON._FORM.CHOOSE_FILE' | translate }}</span>\n <span class=\"field-file-name\" [class.field-file-name-empty]=\"!selectedFileName\">\n {{ selectedFileName ?? ('_COMMON._FORM.NO_FILE_SELECTED' | translate) }}\n </span>\n </span>\n }\n\n @if (type === typeField.password) {\n <input [type]=\"isPasswordShown ? 'text' : 'password'\" class=\"field-control\" [id]=\"name\" [formControl]=\"formControl\"\n [ngClass]=\"[(cssClass || ''), formControl?.value ? 'has-value' : '']\"\n [attr.required]=\"isRequired ? 'required' : null\" [attr.readonly]=\"isReadonly ? 'readonly' : null\"\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\" [attr.aria-required]=\"isRequired\"\n [attr.minlength]=\"minLengthAttr\" [attr.maxlength]=\"maxLengthAttr\" [attr.pattern]=\"patternAttr\"\n [attr.autocomplete]=\"autocomplete\"\n [attr.aria-invalid]=\"control.invalid && control.touched\"\n [attr.aria-describedby]=\"getDescribedBy(control)\"\n (focus)=\"onFocus()\" (blur)=\"onBlur()\" />\n <cw-button [type]=\"buttonType.ghost\"\n cssClass=\"btn-password-field\"\n [withIcon]=\"isPasswordShown ? spriteIcon.toolbarHidePassword : spriteIcon.toolbarShowPassword\"\n [withOnlyIcon]=\"true\"\n [label]=\"isPasswordShown ? '_COMMON._FORM._SHOW_HIDE_PWD.HIDE' : '_COMMON._FORM._SHOW_HIDE_PWD.SHOW'\"\n (btnAction)=\"togglePasswordVisibility()\">\n </cw-button>\n }\n\n <!-- Textarea -->\n @if (type === typeField.textarea) {\n <textarea class=\"field-control\" [id]=\"name\" [formControl]=\"formControl\"\n [ngClass]=\"[(cssClass || ''), formControl?.value ? 'has-value' : '']\"\n [attr.placeholder]=\"placeholder ? (placeholder | translate) : null\" [attr.required]=\"isRequired ? 'required' : null\"\n [attr.readonly]=\"isReadonly ? 'readonly' : null\" [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\"\n [attr.aria-required]=\"isRequired\" [attr.aria-invalid]=\"control.invalid && control.touched\"\n [attr.minlength]=\"minLengthAttr\" [attr.maxlength]=\"maxLengthAttr\" [attr.pattern]=\"patternAttr\"\n [attr.autocomplete]=\"autocomplete\"\n [attr.aria-describedby]=\"getDescribedBy(control)\"\n (focus)=\"onFocus()\" (blur)=\"onBlur()\"></textarea>\n }\n\n <!-- Select -->\n @if (type === typeField.select) {\n <ng-select [formControl]=\"formControl\" [items]=\"options\" bindLabel=\"label\" [labelForId]=\"name\" [appendTo]=\"appendTo ?? ''\" bindValue=\"value\"\n [ngClass]=\"cssClass\" [searchable]=\"false\" [placeholder]=\"placeholder ? (placeholder | translate) : ''\" [readonly]=\"isReadonly\" [clearable]=\"false\"\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\" [attr.required]=\"isRequired ? 'required' : null\"\n [attr.aria-required]=\"isRequired\" [attr.aria-invalid]=\"control.invalid && control.touched\"\n [attr.aria-describedby]=\"getDescribedBy(control)\" [attr.id]=\"name\"\n (focus)=\"onFocus()\" (blur)=\"onBlur()\">\n\n <!-- Template pour les options -->\n <ng-template ng-option-tmp let-item=\"item\" let-index=\"index\" let-search=\"searchTerm\">\n @if (optionTemplate) {\n <ng-container *ngTemplateOutlet=\"optionTemplate; context: { item: item | translate, index: index, searchTerm: search }\"></ng-container>\n }\n @else {\n <div>{{ item.label | translate }}</div>\n }\n </ng-template>\n\n <!-- Template pour le label -->\n <ng-template ng-label-tmp let-item=\"item\">\n @if (labelTemplate) {\n <ng-container *ngTemplateOutlet=\"labelTemplate; context: { item: item | translate }\"></ng-container>\n }\n @else {\n {{ (item.label | translate) || (placeholder | translate) }}\n }\n </ng-template>\n </ng-select>\n }\n\n <!-- NgSelect -->\n @if (type === typeField.ngSelect || type === typeField.ngSelectMultiple) {\n <ng-select [formControl]=\"formControl\" [items]=\"options\" bindLabel=\"label\" [labelForId]=\"name\" [appendTo]=\"appendTo ?? ''\" bindValue=\"value\"\n [multiple]=\"type === typeField.ngSelectMultiple\" [ngClass]=\"cssClass\" [clearable]=\"false\"\n [placeholder]=\"placeholder ? (placeholder | translate) : ''\" [readonly]=\"isReadonly\"\n [notFoundText]=\"'_COMMON.NO_RESULT' | translate\" [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\"\n [attr.required]=\"isRequired ? 'required' : null\" [attr.aria-required]=\"isRequired\"\n [attr.aria-invalid]=\"control.invalid && control.touched\"\n [attr.aria-describedby]=\"getDescribedBy(control)\" [attr.id]=\"name\"\n (focus)=\"onFocus()\" (blur)=\"onBlur()\" (search)=\"textChanged.emit($event?.term)\">\n\n <!-- Template pour les options -->\n <ng-template ng-option-tmp let-item=\"item\" let-index=\"index\" let-search=\"searchTerm\">\n @if (optionTemplate) {\n <ng-container *ngTemplateOutlet=\"optionTemplate; context: { item: item, index: index, searchTerm: search }\"></ng-container>\n }\n @else {\n <div>{{ item.label | translate }}</div>\n }\n </ng-template>\n\n <!-- Template pour le label -->\n <ng-template ng-label-tmp let-item=\"item\" let-clear=\"clear\">\n <span class=\"ng-value-icon left\" (click)=\"clear(item)\" aria-hidden=\"true\">\u00D7</span>\n @if (labelTemplate) {\n <ng-container *ngTemplateOutlet=\"labelTemplate; context: { item: item | translate }\"></ng-container>\n }\n @else {\n {{ (item.label | translate) || (placeholder | translate) }}\n }\n </ng-template>\n </ng-select>\n }\n\n <!-- Radio -->\n @if (type === typeField.radioInline || type === typeField.radio) {\n <fieldset\n [attr.aria-required]=\"isRequired\"\n [attr.aria-invalid]=\"control.invalid && control.touched\"\n [attr.aria-describedby]=\"getDescribedBy(control)\">\n <legend class=\"field-label\" [class.visually-hidden]=\"!displayLabel\">\n {{label | translate}}\n @if(isRequired) {\n <span class=\"text-danger\">*</span>\n }\n </legend>\n <ul class=\"list-unstyled mb-none\" [ngClass]=\"type === typeField.radioInline ? 'd-flex-h gap-md flex-wrap' : 'd-flex-v'\">\n @for (opt of options; track opt.value) {\n <li class=\"field-check\">\n <input type=\"radio\" [id]=\"name + '_' + opt.value\" [value]=\"opt.value\" [formControl]=\"formControl\"\n class=\"field-check-input\" [attr.disabled]=\"(isEffectivelyDisabled || opt.disabled) ? 'disabled' : null\" (change)=\"onRadioChange(opt.value)\" />\n <label [for]=\"name + '_' + opt.value\" class=\"field-check-label\">{{ opt.label | translate }}</label>\n </li>\n }\n </ul>\n </fieldset>\n }\n\n <!-- Radio button -->\n @if (type === typeField.radioButton) {\n <fieldset\n [attr.aria-required]=\"isRequired\"\n [attr.aria-invalid]=\"control.invalid && control.touched\"\n [attr.aria-describedby]=\"getDescribedBy(control)\">\n <legend class=\"field-label\" [class.visually-hidden]=\"!displayLabel\">\n {{label | translate}}\n @if(isRequired) {\n <span class=\"text-danger\">*</span>\n }\n </legend>\n <div class=\"field-group field-group-btn\">\n @for (opt of options; track opt.value) {\n <input type=\"radio\" [id]=\"name + '_' + opt.value\" [value]=\"opt.value\" [formControl]=\"formControl\"\n class=\"visually-hidden\" [attr.disabled]=\"(isEffectivelyDisabled || opt.disabled) ? 'disabled' : null\" (change)=\"onRadioChange(opt.value)\"/>\n <label [for]=\"name + '_' + opt.value\" class=\"btn btn-field-group\">{{ opt.label | translate }}</label>\n }\n </div>\n </fieldset>\n }\n\n <!-- Checkbox Switch -->\n @if ( type === typeField.switch || type === typeField.switchSmall)\n {\n <div class=\"field-check field-switch\" [ngClass]=\"{'field-switch-small': type === typeField.switchSmall}\">\n <input type=\"checkbox\" [id]=\"name\" [formControl]=\"formControl\" class=\"field-check-input\" [attr.aria-required]=\"isRequired\"\n [attr.aria-invalid]=\"control.invalid && control.touched\"\n [attr.aria-describedby]=\"getDescribedBy(control)\"\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\"/>\n <label [for]=\"name\" class=\"field-check-label\">{{ label | translate }}</label>\n </div>\n }\n\n <!-- Checkbox -->\n @if (type === typeField.checkboxInline || type === typeField.checkbox) {\n @if (isSingleCheckbox()) {\n <div class=\"field-check\" [class.field-check-inline]=\"type === typeField.checkboxInline\">\n <input #checkboxInput type=\"checkbox\" [id]=\"name\" [formControl]=\"formControl\"\n class=\"field-check-input\"\n [class.is-invalid]=\"control?.invalid && control?.touched\"\n [attr.aria-required]=\"isRequired\"\n [attr.aria-invalid]=\"control?.invalid && control?.touched\"\n [attr.aria-describedby]=\"getDescribedBy(control)\"\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\" />\n <label [for]=\"name\" class=\"field-check-label\">\n {{ label | translate }}\n @if (isRequired) {\n <span class=\"text-danger\">*</span>\n }\n </label>\n </div>\n }\n @else if( options.length > 1) {\n <fieldset\n [attr.aria-required]=\"isRequired\"\n [attr.aria-invalid]=\"control.invalid && control.touched\"\n [attr.aria-describedby]=\"getDescribedBy(control)\"\n [ngClass]=\"{ 'flex-column': type === typeField.checkbox }\">\n <legend class=\"field-label\" [class.visually-hidden]=\"!displayLabel\">\n {{label | translate}}\n @if(isRequired) {\n <span class=\"text-danger\">*</span>\n }\n </legend>\n <ul class=\"list-unstyled mb-none\" [ngClass]=\"type === typeField.checkboxInline ? 'd-flex-h gap-md' : 'd-flex-v'\">\n @for (opt of options; track opt.value) {\n <li class=\"field-check\" [ngClass]=\"{ 'field-check-inline': type === typeField.checkboxInline }\">\n <input type=\"checkbox\" [id]=\"name + '_' + opt.value\" [value]=\"opt.value\" (change)=\"onCheckboxChange($event)\"\n [checked]=\"control.value?.includes(opt.value)\" class=\"field-check-input\"\n [attr.disabled]=\"(isEffectivelyDisabled || opt.disabled) ? 'disabled' : null\" />\n <label [for]=\"name + '_' + opt.value\" class=\"field-check-label\">\n {{ opt.label | translate }}\n </label>\n </li>\n }\n </ul>\n </fieldset>\n }\n @else {\n <fieldset>\n <legend class=\"field-label\" [class.visually-hidden]=\"!displayLabel\">\n {{label | translate}}\n </legend>\n <ul class=\"list-unstyled mb-none\" [ngClass]=\"type === typeField.checkboxInline ? 'd-flex-h gap-md' : 'd-flex-v'\">\n @for (opt of options; track opt.value) {\n <li class=\"field-check\" [ngClass]=\"{ 'field-check-inline': type === typeField.checkboxInline }\">\n <input type=\"checkbox\" [id]=\"name + '_' + opt.value\" [value]=\"opt.value\" (change)=\"onCheckboxChange($event)\"\n [checked]=\"control.value?.includes(opt.value)\" class=\"field-check-input\"\n [attr.aria-required]=\"isRequired\"\n [attr.aria-invalid]=\"control.invalid && control.touched\"\n [attr.aria-describedby]=\"getDescribedBy(control)\"\n [attr.disabled]=\"(isEffectivelyDisabled || opt.disabled) ? 'disabled' : null\" />\n <label [for]=\"name + '_' + opt.value\" class=\"field-check-label\">\n {{ opt.label | translate }}\n @if(isRequired) {\n <span class=\"text-danger\">*</span>\n }\n </label>\n </li>\n }\n </ul>\n </fieldset>\n }\n }\n\n <!-- Checkbox button -->\n @if (type === typeField.checkboxButton && options.length > 0) {\n\n @if(options.length > 1) {\n <fieldset\n [attr.aria-required]=\"isRequired\"\n [attr.aria-invalid]=\"control.invalid && control.touched\"\n [attr.aria-describedby]=\"getDescribedBy(control)\">\n <legend class=\"field-label\" [class.visually-hidden]=\"!displayLabel\">\n {{label | translate}}\n @if(isRequired) {\n <span class=\"text-danger\">*</span>\n }\n </legend>\n <div class=\"field-group field-group-btn\">\n @for (opt of options; track opt.value) {\n <input type=\"checkbox\" [id]=\"name + '_' + opt.value\" [value]=\"opt.value\" (change)=\"onCheckboxChange($event)\"\n [checked]=\"control.value?.includes(opt.value)\" class=\"visually-hidden\"\n [attr.disabled]=\"(isEffectivelyDisabled || opt.disabled) ? 'disabled' : null\" />\n <label [for]=\"name + '_' + opt.value\" class=\"btn btn-field-group\">{{ opt.label | translate }}</label>\n }\n </div>\n </fieldset>\n }\n @else {\n <fieldset>\n <legend class=\"field-label\" [class.visually-hidden]=\"!displayLabel\">\n {{label | translate}}\n </legend>\n <div class=\"btn-group btn-group-secondary\">\n @for (opt of options; track opt.value) {\n <input type=\"checkbox\" [id]=\"name + '_' + opt.value\" [value]=\"opt.value\" (change)=\"onCheckboxChange($event)\"\n [checked]=\"control.value?.includes(opt.value)\" class=\"visually-hidden\"\n [attr.aria-required]=\"isRequired\"\n [attr.aria-invalid]=\"control.invalid && control.touched\"\n [attr.aria-describedby]=\"getDescribedBy(control)\"\n [attr.disabled]=\"(isEffectivelyDisabled || opt.disabled) ? 'disabled' : null\"/>\n <label [for]=\"name + '_' + opt.value\" class=\"btn btn-field-group\">\n {{ opt.label | translate}}\n @if(isRequired) {\n <span class=\"text-danger\">*</span>\n }\n </label>\n }\n </div>\n </fieldset>\n }\n }\n\n <!-- Period - DateToDate / TimeToTime / DateTimeToDateTime -->\n @if ([typeField.dateToDate, typeField.timeToTime, typeField.dateTimeToDateTime].includes(type) && isRange) {\n\n <div class=\"field-group\">\n <div class=\"field-group-addon-left\">Du</div>\n <input [type]=\"getInputType()\" class=\"field-control\" [id]=\"name + '_start'\" [formControl]=\"getControl('start')!\"\n [attr.placeholder]=\"type === typeField.timeToTime ? ('_COMMON._DATES.FROM' | translate) : ('_COMMON._DATES.FROM_TO_1' | translate)\"\n [ngClass]=\"[(cssClass || ''), getControl('start')?.value ? 'has-value' : '']\"\n [attr.required]=\"isRequired ? 'required' : null\" [attr.readonly]=\"isReadonly ? 'readonly' : null\"\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\" [attr.aria-required]=\"isRequired\"\n [attr.min]=\"minStartAttr\" [attr.max]=\"maxStartAttr\" [attr.step]=\"stepAttr\"\n [attr.autocomplete]=\"autocomplete\"\n [attr.aria-invalid]=\"getControl('start')?.invalid && getControl('start')?.touched\"\n [attr.aria-describedby]=\"getDescribedBy(getControl('start'))\"\n (focus)=\"onFocusRange('start')\" />\n\n @if(getControl('start')?.value && !isDisabledOrReadonly) {\n <button type=\"button\" class=\"btn btn-secondary btn-clear-field\"\n (click)=\"onClearFieldPeriod('start')\">\n &times;\n </button>\n }\n <div class=\"field-group-addon-center\">au</div>\n <input [type]=\"getInputType()\" class=\"field-control\" [id]=\"name + '_end'\" [formControl]=\"getControl('end')!\"\n [attr.placeholder]=\"type === typeField.timeToTime ? ('_COMMON._DATES.TO' | translate) : ('_COMMON._DATES.FROM_TO_2' | translate)\"\n [ngClass]=\"[(cssClass || ''), getControl('end')?.value ? 'has-value' : '']\"\n [attr.required]=\"isRequired ? 'required' : null\" [attr.readonly]=\"isReadonly ? 'readonly' : null\"\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\"\n [attr.min]=\"minEndAttr\" [attr.max]=\"maxEndAttr\" [attr.step]=\"stepAttr\"\n [attr.autocomplete]=\"autocomplete\"\n [attr.aria-invalid]=\"getControl('end')?.invalid && getControl('end')?.touched\"\n [attr.aria-describedby]=\"getDescribedBy(getControl('end'))\"\n (focus)=\"onFocusRange('end')\" />\n\n @if(getControl('end')?.value && !isDisabledOrReadonly) {\n <button type=\"button\" class=\"btn btn-ghost btn-clear-field\"\n (click)=\"onClearFieldPeriod('end')\">\n &times;\n </button>\n }\n </div>\n }\n\n @if ([typeField.datePlusOne, typeField.datePlusTwo, typeField.datePlusSeven, typeField.dateComplexe].includes(type)) {\n\n <div class=\"field-group\">\n @if (type === typeField.dateComplexe) {\n <div class=\"field-group-addon-left\">\n <button class=\"btn btn-ghost\" type=\"button\" (click)=\"onDateAddDay('prev')\"\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\">\n <cw-icon font=\"optyweb\" [icon]=\"spriteIcon.nextLeft\" [label]=\"'Jour pr\u00E9c\u00E9dent'\"></cw-icon>\n </button>\n </div>\n }\n\n <input type=\"date\" class=\"field-control\" [id]=\"name\" [formControl]=\"formControl\"\n [ngClass]=\"[(cssClass || ''), formControl?.value ? 'has-value' : '']\"\n [attr.placeholder]=\"placeholder ? placeholder : null\" [attr.required]=\"isRequired ? 'required' : null\"\n [attr.readonly]=\"isReadonly ? 'readonly' : null\" [attr.aria-required]=\"isRequired\"\n [attr.min]=\"minAttr\" [attr.max]=\"maxAttr\" [attr.step]=\"stepAttr\"\n [attr.autocomplete]=\"autocomplete\"\n [attr.aria-invalid]=\"control.invalid && control.touched\"\n [attr.aria-describedby]=\"getDescribedBy(control)\"\n (focus)=\"onFocus()\" (blur)=\"onBlur()\" />\n\n @if(formControl?.value && !isDisabledOrReadonly) {\n <button class=\"btn btn-ghost btn-clear-field\" type=\"button\"\n (click)=\"onClearField(formControl)\">&times;</button>\n }\n\n\n @if (type === typeField.dateComplexe) {\n <div class=\"field-group-addon-right\">\n <button class=\"btn btn-ghost\" type=\"button\" (click)=\"onDateAddDay('next')\"\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\">\n <cw-icon font=\"optyweb\" [icon]=\"spriteIcon.nextRight\" [label]=\"'Jour suivant'\"></cw-icon>\n </button>\n </div>\n <div class=\"field-group-addon-right\">\n <button class=\"btn btn-ghost\" type=\"button\" (click)=\"onRefresh()\"\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\">\n <cw-icon font=\"optyweb\" [icon]=\"spriteIcon.toolbarRefresh\" [label]=\"'Rafra\u00EEchir'\"></cw-icon>\n </button>\n </div>\n }\n\n <div class=\"field-group-addon-right\">\n <button class=\"btn btn-ghost\" type=\"button\" (click)=\"onTodayAddDay(0)\"\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\">\n J\n <span class=\"visually-hidden\">Aujourd'hui</span>\n </button>\n </div>\n <div class=\"field-group-addon-right\">\n <button class=\"btn btn-ghost\" type=\"button\" (click)=\"onTodayAddDay(1)\"\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\">\n J+1\n <span class=\"visually-hidden\">Demain</span>\n </button>\n </div>\n\n @if (type !== typeField.datePlusOne && type !== typeField.dateComplexe) {\n <div class=\"field-group-addon-right\">\n <button class=\"btn btn-ghost \" type=\"button\" (click)=\"onTodayAddDay(2)\"\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\">\n J+2\n <span class=\"visually-hidden\">Dans 2 jours</span>\n </button>\n </div>\n\n @if (type !== typeField.datePlusTwo) {\n <div class=\"field-group-addon-right\">\n <button class=\"btn btn-ghost\" type=\"button\" (click)=\"onTodayAddDay(7)\"\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\">\n J+7\n <span class=\"visually-hidden\">Dans 7 jours</span>\n </button>\n </div>\n }\n }\n </div>\n }\n\n @if (type === typeField.slider) {\n <ngx-slider [(value)]=\"sliderValue\" [options]=\"sliderOptions\" [formControl]=\"formControl\"></ngx-slider>\n }\n\n @if (type === typeField.range) {\n <div class=\"slider\">\n\n <cw-button [isDisabled]=\"formControl.value <= rangeOptions.floor\" [label]=\"'Diminuer ' + formControl.value + ' ' + label\"\n [withIcon]=\"spriteIcon.toolbarMinus\" [withOnlyIcon]=\"true\" [type]=\"buttonType.primary\"\n [iconSize]=\"buttonIconSize.small\" (btnAction)=\"onRangeStep('decrease')\">\n </cw-button>\n\n <div class=\"slider-input\">\n <label [for]=\"name\" class=\"slider-tooltip\" [style.left]=\"getRangePercent() + '%'\" aria-live=\"polite\"\n aria-atomic=\"true\">\n {{ label | translate }} {{ formControl.value }}\n @if (rangeOptions.unit) {\n <abbr [title]=\"rangeOptions.unit\">{{ rangeOptions.unit }}</abbr>\n }\n </label>\n\n <div class=\"slider-custom-bar\">\n <div class=\"slider-custom-bar-selection\" [style.width]=\"getRangePercent() + '%'\">\n </div>\n </div>\n\n <input type=\"range\" [id]=\"name\" [formControl]=\"formControl\" [min]=\"rangeOptions.floor\" [max]=\"rangeOptions.ceil\"\n [step]=\"rangeOptions.step || 1\" class=\"field-control-range\" [attr.aria-required]=\"isRequired\"\n [attr.aria-invalid]=\"control.invalid && control.touched\">\n </div>\n\n <cw-button [isDisabled]=\"formControl.value >= rangeOptions.ceil\" [label]=\"'Augmenter ' + formControl.value + ' ' + label\"\n [withIcon]=\"spriteIcon.toolbarPlus\" [withOnlyIcon]=\"true\" [type]=\"buttonType.primary\"\n [iconSize]=\"buttonIconSize.small\" (btnAction)=\"onRangeStep('increase')\">\n </cw-button>\n </div>\n }\n\n @if (isInInputGroup() && clearable && !isDisabledOrReadonly && type !== typeField.autocompleteMultiple) {\n @if (type === typeField.autocomplete) {\n @if (autocompleteRef()?.hasAnyContent()) {\n <button class=\"btn btn-secondary btn-clear-field\" type=\"button\"\n (click)=\"onClearAutocomplete()\">&times;</button>\n }\n } @else if (type === typeField.ngSelectMultiple) {\n <!-- value est un tableau : un [] vide \u00E9tant truthy, on teste .length pour n'afficher le clear global que s'il y a au moins une s\u00E9lection. -->\n @if (formControl?.value?.length) {\n <button class=\"btn btn-ghost btn-clear-field\" type=\"button\"\n (click)=\"onClearField(formControl)\">&times;</button>\n }\n } @else {\n @if(formControl?.value) {\n <button class=\"btn btn-ghost btn-clear-field\" type=\"button\"\n (click)=\"onClearField(formControl)\">&times;</button>\n }\n }\n }\n\n</ng-template>\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "ngmodule", type: TranslateModule }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i2$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2$1.RangeValueAccessor, selector: "input[type=range][formControlName],input[type=range][formControl],input[type=range][ngModel]" }, { kind: "directive", type: i2$1.CheckboxControlValueAccessor, selector: "input[type=checkbox][formControlName],input[type=checkbox][formControl],input[type=checkbox][ngModel]" }, { kind: "directive", type: i2$1.RadioControlValueAccessor, selector: "input[type=radio][formControlName],input[type=radio][formControl],input[type=radio][ngModel]", inputs: ["name", "formControlName", "value"] }, { kind: "directive", type: i2$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i2$1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "ngmodule", type: NgSelectModule }, { kind: "component", type: i3.NgSelectComponent, selector: "ng-select", inputs: ["ariaLabelDropdown", "bindLabel", "bindValue", "ariaLabel", "markFirst", "placeholder", "fixedPlaceholder", "notFoundText", "typeToSearchText", "preventToggleOnRightClick", "addTagText", "loadingText", "clearAllText", "appearance", "dropdownPosition", "appendTo", "loading", "closeOnSelect", "hideSelected", "selectOnTab", "openOnEnter", "maxSelectedItems", "groupBy", "groupValue", "bufferAmount", "virtualScroll", "selectableGroup", "selectableGroupAsModel", "searchFn", "trackByFn", "clearOnBackspace", "labelForId", "inputAttrs", "tabIndex", "tabFocusOnClearButton", "readonly", "searchWhileComposing", "minTermLength", "editableSearchTerm", "ngClass", "typeahead", "multiple", "addTag", "searchable", "clearable", "isOpen", "items", "compareWith", "clearSearchOnAdd", "deselectOnClick", "keyDownFn"], outputs: ["blur", "focus", "change", "open", "close", "search", "clear", "add", "remove", "scroll", "scrollToEnd"] }, { kind: "directive", type: i3.NgOptionTemplateDirective, selector: "[ng-option-tmp]" }, { kind: "directive", type: i3.NgLabelTemplateDirective, selector: "[ng-label-tmp]" }, { kind: "ngmodule", type: NgxSliderModule }, { kind: "component", type: i4.SliderComponent, selector: "ngx-slider", inputs: ["value", "highValue", "options", "manualRefresh", "triggerFocus", "cancelUserChange"], outputs: ["valueChange", "highValueChange", "userChangeStart", "userChange", "userChangeEnd"] }, { kind: "component", type: IconComponent, selector: "cw-icon", inputs: ["icon", "label", "type", "iconSize", "iconCssClass", "iconUiType", "iconColorCustom", "spritePath"] }, { kind: "component", type: ButtonComponent, selector: "cw-button", inputs: ["type", "label", "id", "link", "isDropdown", "hideCaret", "withIcon", "withOnlyIcon", "iconSize", "iconPosition", "dropdownPosition", "isMinWidth", "isDisabled", "isLoading", "loadingAnnounce", "cssClass", "dataTest", "skeletonMode", "withTooltip", "tooltipText", "tooltipTitle", "tooltipTrigger", "tooltipPosition", "tooltipType"], outputs: ["btnAction", "dropDownClicked"] }, { kind: "component", type: AutocompleteComponent, selector: "cw-autocomplete", inputs: ["control", "fetcher", "displayField", "valueField", "columns", "multiple", "minChars", "debounceMs", "selectedItem", "resolver", "selectedItems", "placeholder", "id", "isRequired", "isReadonly", "isDisabled", "ariaInvalid", "ariaDescribedBy"], outputs: ["itemSelected", "itemsChange"] }, { kind: "component", type: RichTextEditorComponent, selector: "cw-rich-text-editor", inputs: ["control", "options", "id", "placeholder", "isRequired", "isReadonly", "isDisabled", "ariaInvalid", "ariaDescribedBy"], outputs: ["valueChange"] }, { kind: "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" }] }); }
4122
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.20", type: FormFieldComponent, isStandalone: true, selector: "cw-form-field", inputs: { control: { classPropertyName: "control", publicName: "control", isSignal: false, isRequired: false, transformFunction: null }, formGroup: { classPropertyName: "formGroup", publicName: "formGroup", isSignal: false, isRequired: false, transformFunction: null }, type: { classPropertyName: "type", publicName: "type", isSignal: false, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: false, isRequired: false, transformFunction: null }, displayLabel: { classPropertyName: "displayLabel", publicName: "displayLabel", isSignal: false, isRequired: false, transformFunction: null }, name: { classPropertyName: "name", publicName: "name", isSignal: false, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: false, isRequired: false, transformFunction: null }, autocomplete: { classPropertyName: "autocomplete", publicName: "autocomplete", isSignal: false, isRequired: false, transformFunction: null }, options: { classPropertyName: "options", publicName: "options", isSignal: false, isRequired: false, transformFunction: null }, rangeOptions: { classPropertyName: "rangeOptions", publicName: "rangeOptions", isSignal: false, isRequired: false, transformFunction: null }, validationOptions: { classPropertyName: "validationOptions", publicName: "validationOptions", isSignal: false, isRequired: false, transformFunction: null }, autocompleteOptions: { classPropertyName: "autocompleteOptions", publicName: "autocompleteOptions", isSignal: false, isRequired: false, transformFunction: null }, richTextOptions: { classPropertyName: "richTextOptions", publicName: "richTextOptions", isSignal: false, isRequired: false, transformFunction: null }, errorMessages: { classPropertyName: "errorMessages", publicName: "errorMessages", isSignal: false, isRequired: false, transformFunction: null }, isRequired: { classPropertyName: "isRequired", publicName: "isRequired", isSignal: false, isRequired: false, transformFunction: null }, help: { classPropertyName: "help", publicName: "help", isSignal: false, isRequired: false, transformFunction: null }, tooltip: { classPropertyName: "tooltip", publicName: "tooltip", isSignal: false, isRequired: false, transformFunction: null }, addonLeft: { classPropertyName: "addonLeft", publicName: "addonLeft", isSignal: false, isRequired: false, transformFunction: null }, addonRight: { classPropertyName: "addonRight", publicName: "addonRight", isSignal: false, isRequired: false, transformFunction: null }, isInAddon: { classPropertyName: "isInAddon", publicName: "isInAddon", isSignal: false, isRequired: false, transformFunction: null }, isReadonly: { classPropertyName: "isReadonly", publicName: "isReadonly", isSignal: false, isRequired: false, transformFunction: null }, isDisabled: { classPropertyName: "isDisabled", publicName: "isDisabled", isSignal: false, isRequired: false, transformFunction: null }, sliderValue: { classPropertyName: "sliderValue", publicName: "sliderValue", isSignal: false, isRequired: false, transformFunction: null }, sliderOptions: { classPropertyName: "sliderOptions", publicName: "sliderOptions", isSignal: false, isRequired: false, transformFunction: null }, cssClass: { classPropertyName: "cssClass", publicName: "cssClass", isSignal: false, isRequired: false, transformFunction: null }, skeletonMode: { classPropertyName: "skeletonMode", publicName: "skeletonMode", isSignal: false, isRequired: false, transformFunction: null }, clearable: { classPropertyName: "clearable", publicName: "clearable", isSignal: false, isRequired: false, transformFunction: null }, appendTo: { classPropertyName: "appendTo", publicName: "appendTo", isSignal: false, isRequired: false, transformFunction: null }, initialCountry: { classPropertyName: "initialCountry", publicName: "initialCountry", isSignal: false, isRequired: false, transformFunction: null }, recommendedDimensions: { classPropertyName: "recommendedDimensions", publicName: "recommendedDimensions", isSignal: false, isRequired: false, transformFunction: null }, showPreview: { classPropertyName: "showPreview", publicName: "showPreview", isSignal: false, isRequired: false, transformFunction: null }, existingFile: { classPropertyName: "existingFile", publicName: "existingFile", isSignal: false, isRequired: false, transformFunction: null }, indeterminate: { classPropertyName: "indeterminate", publicName: "indeterminate", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { refreshEvent: "refreshEvent", fileRemoved: "fileRemoved", textChanged: "textChanged", valueChange: "valueChange", phoneRegionChange: "phoneRegionChange" }, host: { properties: { "class": "this.hostClasses" } }, queries: [{ propertyName: "optionTemplate", first: true, predicate: ["ngOptionTpl"], descendants: true, read: TemplateRef }, { propertyName: "labelTemplate", first: true, predicate: ["ngLabelTpl"], descendants: true, read: TemplateRef }], viewQueries: [{ propertyName: "checkboxInputRef", first: true, predicate: ["checkboxInput"], descendants: true, isSignal: true }, { propertyName: "fileInputRef", first: true, predicate: ["fileInput"], descendants: true, isSignal: true }, { propertyName: "phoneInputRef", first: true, predicate: ["phoneInput"], descendants: true, isSignal: true }, { propertyName: "autocompleteRef", first: true, predicate: AutocompleteComponent, descendants: true, isSignal: true }], usesOnChanges: true, ngImport: i0, template: "@if (!isInAddon) {\n @if (\n type !== typeField.checkbox &&\n type !== typeField.radio &&\n type !== typeField.checkboxButton &&\n type !== typeField.radioButton &&\n type !== typeField.checkboxInline &&\n type !== typeField.radioInline &&\n type !== typeField.switch &&\n type !== typeField.range &&\n type !== typeField.switchSmall\n ) {\n <label [for]=\"name\" class=\"field-label\" [class.visually-hidden]=\"!displayLabel\">\n {{ label | translate }}\n\n @if (isRequired) {\n <span class=\"text-danger\">*</span>\n }\n\n @if (tooltip) {\n <!-- <button type=\"button\" class=\"btn btn-link btn-popover\" placement=\"bottom\" [ngbPopover]=\"popContent\" container=\"body\"\n triggers=\"mouseenter:mouseleave\">\n <span class=\"btn-popover-icon bo-icons bo-help\"></span>\n </button>\n <ng-template #popContent>\n <div [innerHTML]=\"tooltip\"></div>\n </ng-template> -->\n }\n </label>\n }\n\n @if (addonLeft || addonRight) {\n <div class=\"field-group\" [class.field-group-invalid]=\"isInvalid\" [class.field-group-disabled]=\"isDisabledOrReadonly\">\n @if(addonLeft) {\n <div class=\"field-group-addon-left\">\n <ng-container [ngTemplateOutlet]=\"addonLeft\"></ng-container>\n </div>\n }\n <ng-container [ngTemplateOutlet]=\"field\"></ng-container>\n @if(addonRight) {\n <div class=\"field-group-addon-right\">\n <ng-container [ngTemplateOutlet]=\"addonRight\"></ng-container>\n </div>\n }\n </div>\n }\n @else {\n @if ( isInInputGroup() ) {\n <div class=\"field-group\" [class.field-group-invalid]=\"isInvalid\" [class.field-group-disabled]=\"isDisabledOrReadonly\">\n <ng-container [ngTemplateOutlet]=\"field\"></ng-container>\n </div>\n }\n @else {\n <ng-container [ngTemplateOutlet]=\"field\"></ng-container>\n }\n }\n\n <!-- Error message -->\n @if (controlOrGroup?.invalid && controlOrGroup?.touched) {\n <div class=\"field-invalid\" [id]=\"'error-' + name\">\n @if (\n !errorMessages?.['required'] &&\n ((controlOrGroup?.errors?.['required']) || (getControl('start')?.errors?.['required'] || getControl('end')?.errors?.['required']))\n ) {\n <span [innerHtml]=\"'_COMMON._FORM.ERROR_IS_MANDATORY' | translate: {label: label | translate}\"></span>\n }\n @if (!errorMessages?.['rangeInvalid'] && controlOrGroup?.errors?.['rangeInvalid']) {\n <span>{{'_COMMON._DATES.ERROR_START_END_PERIOD' | translate}}</span>\n }\n @if (!errorMessages?.['fileExtension'] && controlOrGroup?.errors?.['fileExtension']) {\n <span>{{ '_COMMON._FORM.ERROR_FILE_EXTENSION' | translate: { accept: acceptLabel } }}</span>\n }\n @if (!errorMessages?.['fileSize'] && controlOrGroup?.errors?.['fileSize']) {\n <span>{{ '_COMMON._FORM.ERROR_FILE_SIZE' | translate: { maxSize: maxSizeLabel } }}</span>\n }\n @if (!errorMessages?.['email'] && controlOrGroup?.errors?.['email']) {\n <span>{{ '_COMMON._FORM.ERROR_INVALID_EMAIL' | translate }}</span>\n }\n @if (!errorMessages?.['phone'] && controlOrGroup?.errors?.['phone']) {\n <span>{{ '_COMMON._FORM.ERROR_INVALID_PHONE' | translate }}</span>\n }\n @if (errorMessages) {\n @for (entry of errorMessages | keyvalue: keepOrder; track entry.key) {\n @if (controlOrGroup?.errors?.[entry.key]; as errVal) {\n <span>{{ entry.value | translate: (errVal === true ? null : errVal) }}</span>\n }\n }\n }\n </div>\n }\n\n @if (help || autoHelpEntries.length) {\n <div [id]=\"name + '-help'\" class=\"field-text\">\n @if (help) {\n <span>{{ help | translate }}</span>\n }\n @for (entry of autoHelpEntries; track entry.key) {\n <!-- Espace explicite : les blancs entre balises sont supprim\u00E9s \u00E0 la compilation. -->\n {{ ' ' }}<span>{{ entry.key | translate: entry.params }}</span>\n }\n </div>\n }\n\n <!-- Aper\u00E7u du fichier (type=file, opt-in) : sous le champ et ses aides, comme dans la\n maquette DS. La croix native du champ n'est pas retir\u00E9e \u2014 les deux vident le m\u00EAme\n control, l'aper\u00E7u ajoute juste \u00AB Visualiser \u00BB et une cible plus grande. -->\n @if (isPreviewVisible) {\n <cw-file-preview [file]=\"previewFile\" [existingFile]=\"existingFile ?? null\"\n [disabled]=\"!!isDisabledOrReadonly\" (remove)=\"onPreviewRemove()\" />\n }\n\n <!-- Chips de la multi-s\u00E9lection (autocomplete) : rendus ici, hors du field-group et apr\u00E8s\n erreur/help, pour \u00EAtre visuellement d\u00E9tach\u00E9s du champ. La donn\u00E9e et le retrait restent\n port\u00E9s par cw-autocomplete (`chips()` / `onChipRemove()`), seul l'affichage est d\u00E9l\u00E9gu\u00E9. -->\n @if (type === typeField.autocompleteMultiple && autocompleteRef()?.chips()?.length) {\n <ul class=\"autocomplete-chips\" role=\"list\">\n @for (chip of autocompleteRef()!.chips(); track chip.item) {\n <li>\n <button type=\"button\" class=\"autocomplete-chip\"\n [disabled]=\"isEffectivelyDisabled || isReadonly\"\n (click)=\"autocompleteRef()!.onChipRemove(chip.item)\">\n <span>{{ chip.label }}</span>\n @if (!isEffectivelyDisabled && !isReadonly) {\n <span aria-hidden=\"true\" class=\"autocomplete-chip-x\">&times;</span>\n <span class=\"visually-hidden\">{{ '_COMMON._ACTION.DELETE' | translate }}</span>\n }\n </button>\n </li>\n }\n </ul>\n }\n}\n@else {\n <ng-container [ngTemplateOutlet]=\"field\"></ng-container>\n}\n\n<ng-template #field>\n <!-- Autocomplete (mono / multi) -->\n @if ((type === typeField.autocomplete || type === typeField.autocompleteMultiple) && autocompleteOptions) {\n <cw-autocomplete\n [id]=\"name\"\n [control]=\"formControl\"\n [fetcher]=\"autocompleteOptions.fetcher\"\n [displayField]=\"autocompleteOptions.displayField ?? 'label'\"\n [valueField]=\"autocompleteOptions.valueField ?? 'id'\"\n [columns]=\"autocompleteOptions.columns ?? []\"\n [resolver]=\"autocompleteOptions.resolver ?? null\"\n [selectedItem]=\"autocompleteOptions.selectedItem ?? null\"\n [selectedItems]=\"autocompleteOptions.selectedItems ?? []\"\n [minChars]=\"autocompleteOptions.minChars ?? 2\"\n [debounceMs]=\"autocompleteOptions.debounceMs ?? 250\"\n [multiple]=\"type === typeField.autocompleteMultiple\"\n [isRequired]=\"isRequired\"\n [isReadonly]=\"!!isReadonly\"\n [isDisabled]=\"isEffectivelyDisabled\"\n [ariaInvalid]=\"control.invalid && control.touched\"\n [ariaDescribedBy]=\"getDescribedBy(control)\"\n [placeholder]=\"placeholder\">\n </cw-autocomplete>\n }\n\n <!-- Rich text editor (Quill) : sous-composant interne, sans field-group ni bouton clear\n (il porte sa propre bordure + toolbar). Le label statique du form-field reste au-dessus. -->\n @if (type === typeField.richText) {\n <cw-rich-text-editor\n [id]=\"name\"\n [control]=\"formControl\"\n [options]=\"richTextOptions\"\n [placeholder]=\"placeholder ? (placeholder | translate) : ''\"\n [isRequired]=\"isRequired\"\n [isReadonly]=\"!!isReadonly\"\n [isDisabled]=\"isEffectivelyDisabled\"\n [ariaInvalid]=\"control.invalid && control.touched\"\n [ariaDescribedBy]=\"getDescribedBy(control)\">\n </cw-rich-text-editor>\n }\n\n <!-- Text -->\n @if ([typeField.text, typeField.date, typeField.time, typeField.dateTime, typeField.number,\n typeField.email,\n typeField.color, typeField.zipCode].includes(type)) {\n <input [type]=\"type === typeField.zipCode ? 'text' : type\" class=\"field-control\" [id]=\"name\" [formControl]=\"formControl\"\n [ngClass]=\"[(cssClass || ''), formControl?.value ? 'has-value' : '', type === typeField.zipCode ? 'field-control-zipcode' : '']\"\n [attr.placeholder]=\"placeholder ? (placeholder | translate) : null\" [attr.required]=\"isRequired ? 'required' : null\"\n [attr.readonly]=\"isReadonly ? 'readonly' : null\" [attr.aria-required]=\"isRequired\"\n [attr.minlength]=\"minLengthAttr\" [attr.maxlength]=\"maxLengthAttr\"\n [attr.min]=\"minAttr\" [attr.max]=\"maxAttr\" [attr.step]=\"stepAttr\" [attr.pattern]=\"patternAttr\"\n [attr.autocomplete]=\"autocomplete\"\n [attr.aria-invalid]=\"control.invalid && control.touched\"\n [attr.aria-describedby]=\"getDescribedBy(control)\"\n (focus)=\"onFocus()\" (blur)=\"onBlur()\" />\n }\n\n <!-- Phone (intl-tel-input) -->\n @if (type === typeField.phone) {\n <input #phoneInput type=\"tel\" class=\"field-control\" [id]=\"name\"\n [attr.placeholder]=\"placeholder ? (placeholder | translate) : null\" [attr.required]=\"isRequired ? 'required' : null\"\n [attr.readonly]=\"isReadonly ? 'readonly' : null\" [disabled]=\"isEffectivelyDisabled\" [attr.aria-required]=\"isRequired\"\n [attr.autocomplete]=\"autocomplete\"\n [attr.aria-invalid]=\"control.invalid && control.touched\"\n [attr.aria-describedby]=\"getDescribedBy(control)\"\n (focus)=\"onFocus()\" (blur)=\"onPhoneBlur($event)\" />\n }\n\n <!-- File -->\n @if (type === typeField.file) {\n <!-- L'input natif reste LE controle (focus, clavier, restitution aux lecteurs d'ecran,\n validation), mais il est masque visuellement : le libelle de son bouton et son\n \u00AB aucun fichier choisi \u00BB sont ecrits par le NAVIGATEUR, dans SA langue. Ils sont\n intraduisibles et ne suivent pas la langue de l'application \u2014 un utilisateur qui\n bascule en anglais garderait \u00AB Choisir un fichier \u00BB. On les reecrit donc a cote,\n traduits, dans une couche purement visuelle. -->\n <input #fileInput type=\"file\" class=\"field-control visually-hidden\" [id]=\"name\"\n [ngClass]=\"[(cssClass || ''), formControl?.value ? 'has-value' : '']\"\n [attr.required]=\"isRequired ? 'required' : null\"\n [attr.readonly]=\"isReadonly ? 'readonly' : null\" [disabled]=\"isEffectivelyDisabled\" [attr.aria-required]=\"isRequired\"\n [attr.accept]=\"acceptAttr\"\n [attr.aria-invalid]=\"control.invalid && control.touched\"\n [attr.aria-describedby]=\"getDescribedBy(control)\"\n (change)=\"onFileChange($event)\" (focus)=\"onFocus()\" (blur)=\"onBlur()\" />\n\n <!-- `aria-hidden` : doublon visuel de l'input, que les lecteurs d'ecran restituent deja\n (nom du champ, bouton de parcours, fichier selectionne). L'annoncer une seconde fois\n ne ferait que bavarder. Le clic est relaye a l'input, le clavier passe par lui. -->\n <span class=\"field-file\" aria-hidden=\"true\" (click)=\"openFilePicker()\">\n <span class=\"field-file-button\">{{ '_COMMON._FORM.CHOOSE_FILE' | translate }}</span>\n <span class=\"field-file-name\" [class.field-file-name-empty]=\"!selectedFileName\">\n {{ selectedFileName ?? ('_COMMON._FORM.NO_FILE_SELECTED' | translate) }}\n </span>\n </span>\n }\n\n @if (type === typeField.password) {\n <input [type]=\"isPasswordShown ? 'text' : 'password'\" class=\"field-control\" [id]=\"name\" [formControl]=\"formControl\"\n [ngClass]=\"[(cssClass || ''), formControl?.value ? 'has-value' : '']\"\n [attr.required]=\"isRequired ? 'required' : null\" [attr.readonly]=\"isReadonly ? 'readonly' : null\"\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\" [attr.aria-required]=\"isRequired\"\n [attr.minlength]=\"minLengthAttr\" [attr.maxlength]=\"maxLengthAttr\" [attr.pattern]=\"patternAttr\"\n [attr.autocomplete]=\"autocomplete\"\n [attr.aria-invalid]=\"control.invalid && control.touched\"\n [attr.aria-describedby]=\"getDescribedBy(control)\"\n (focus)=\"onFocus()\" (blur)=\"onBlur()\" />\n <cw-button [type]=\"buttonType.ghost\"\n cssClass=\"btn-password-field\"\n [withIcon]=\"isPasswordShown ? spriteIcon.toolbarHidePassword : spriteIcon.toolbarShowPassword\"\n [withOnlyIcon]=\"true\"\n [label]=\"isPasswordShown ? '_COMMON._FORM._SHOW_HIDE_PWD.HIDE' : '_COMMON._FORM._SHOW_HIDE_PWD.SHOW'\"\n (btnAction)=\"togglePasswordVisibility()\">\n </cw-button>\n }\n\n <!-- Textarea -->\n @if (type === typeField.textarea) {\n <textarea class=\"field-control\" [id]=\"name\" [formControl]=\"formControl\"\n [ngClass]=\"[(cssClass || ''), formControl?.value ? 'has-value' : '']\"\n [attr.placeholder]=\"placeholder ? (placeholder | translate) : null\" [attr.required]=\"isRequired ? 'required' : null\"\n [attr.readonly]=\"isReadonly ? 'readonly' : null\" [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\"\n [attr.aria-required]=\"isRequired\" [attr.aria-invalid]=\"control.invalid && control.touched\"\n [attr.minlength]=\"minLengthAttr\" [attr.maxlength]=\"maxLengthAttr\" [attr.pattern]=\"patternAttr\"\n [attr.autocomplete]=\"autocomplete\"\n [attr.aria-describedby]=\"getDescribedBy(control)\"\n (focus)=\"onFocus()\" (blur)=\"onBlur()\"></textarea>\n }\n\n <!-- Select -->\n @if (type === typeField.select) {\n <ng-select [formControl]=\"formControl\" [items]=\"options\" bindLabel=\"label\" [labelForId]=\"name\" [appendTo]=\"appendTo ?? ''\" bindValue=\"value\"\n [ngClass]=\"cssClass\" [searchable]=\"false\" [placeholder]=\"placeholder ? (placeholder | translate) : ''\" [readonly]=\"isReadonly\" [clearable]=\"false\"\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\" [attr.required]=\"isRequired ? 'required' : null\"\n [attr.aria-required]=\"isRequired\" [attr.aria-invalid]=\"control.invalid && control.touched\"\n [attr.aria-describedby]=\"getDescribedBy(control)\" [attr.id]=\"name\"\n (focus)=\"onFocus()\" (blur)=\"onBlur()\">\n\n <!-- Template pour les options -->\n <ng-template ng-option-tmp let-item=\"item\" let-index=\"index\" let-search=\"searchTerm\">\n @if (optionTemplate) {\n <ng-container *ngTemplateOutlet=\"optionTemplate; context: { item: item | translate, index: index, searchTerm: search }\"></ng-container>\n }\n @else {\n <div>{{ item.label | translate }}</div>\n }\n </ng-template>\n\n <!-- Template pour le label -->\n <ng-template ng-label-tmp let-item=\"item\">\n @if (labelTemplate) {\n <ng-container *ngTemplateOutlet=\"labelTemplate; context: { item: item | translate }\"></ng-container>\n }\n @else {\n {{ (item.label | translate) || (placeholder | translate) }}\n }\n </ng-template>\n </ng-select>\n }\n\n <!-- NgSelect -->\n @if (type === typeField.ngSelect || type === typeField.ngSelectMultiple) {\n <ng-select [formControl]=\"formControl\" [items]=\"options\" bindLabel=\"label\" [labelForId]=\"name\" [appendTo]=\"appendTo ?? ''\" bindValue=\"value\"\n [multiple]=\"type === typeField.ngSelectMultiple\" [ngClass]=\"cssClass\" [clearable]=\"false\"\n [placeholder]=\"placeholder ? (placeholder | translate) : ''\" [readonly]=\"isReadonly\"\n [notFoundText]=\"'_COMMON.NO_RESULT' | translate\" [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\"\n [attr.required]=\"isRequired ? 'required' : null\" [attr.aria-required]=\"isRequired\"\n [attr.aria-invalid]=\"control.invalid && control.touched\"\n [attr.aria-describedby]=\"getDescribedBy(control)\" [attr.id]=\"name\"\n (focus)=\"onFocus()\" (blur)=\"onBlur()\" (search)=\"textChanged.emit($event?.term)\">\n\n <!-- Template pour les options -->\n <ng-template ng-option-tmp let-item=\"item\" let-index=\"index\" let-search=\"searchTerm\">\n @if (optionTemplate) {\n <ng-container *ngTemplateOutlet=\"optionTemplate; context: { item: item, index: index, searchTerm: search }\"></ng-container>\n }\n @else {\n <div>{{ item.label | translate }}</div>\n }\n </ng-template>\n\n <!-- Template pour le label -->\n <ng-template ng-label-tmp let-item=\"item\" let-clear=\"clear\">\n <span class=\"ng-value-icon left\" (click)=\"clear(item)\" aria-hidden=\"true\">\u00D7</span>\n @if (labelTemplate) {\n <ng-container *ngTemplateOutlet=\"labelTemplate; context: { item: item | translate }\"></ng-container>\n }\n @else {\n {{ (item.label | translate) || (placeholder | translate) }}\n }\n </ng-template>\n </ng-select>\n }\n\n <!-- Radio -->\n @if (type === typeField.radioInline || type === typeField.radio) {\n <fieldset\n [attr.aria-required]=\"isRequired\"\n [attr.aria-invalid]=\"control.invalid && control.touched\"\n [attr.aria-describedby]=\"getDescribedBy(control)\">\n <legend class=\"field-label\" [class.visually-hidden]=\"!displayLabel\">\n {{label | translate}}\n @if(isRequired) {\n <span class=\"text-danger\">*</span>\n }\n </legend>\n <ul class=\"list-unstyled mb-none\" [ngClass]=\"type === typeField.radioInline ? 'd-flex-h gap-md flex-wrap' : 'd-flex-v'\">\n @for (opt of options; track opt.value) {\n <li class=\"field-check\">\n <input type=\"radio\" [id]=\"name + '_' + opt.value\" [value]=\"opt.value\" [formControl]=\"formControl\"\n class=\"field-check-input\" [attr.disabled]=\"(isEffectivelyDisabled || opt.disabled) ? 'disabled' : null\" (change)=\"onRadioChange(opt.value)\" />\n <label [for]=\"name + '_' + opt.value\" class=\"field-check-label\">{{ opt.label | translate }}</label>\n </li>\n }\n </ul>\n </fieldset>\n }\n\n <!-- Radio button -->\n @if (type === typeField.radioButton) {\n <fieldset\n [attr.aria-required]=\"isRequired\"\n [attr.aria-invalid]=\"control.invalid && control.touched\"\n [attr.aria-describedby]=\"getDescribedBy(control)\">\n <legend class=\"field-label\" [class.visually-hidden]=\"!displayLabel\">\n {{label | translate}}\n @if(isRequired) {\n <span class=\"text-danger\">*</span>\n }\n </legend>\n <div class=\"field-group field-group-btn\">\n @for (opt of options; track opt.value) {\n <input type=\"radio\" [id]=\"name + '_' + opt.value\" [value]=\"opt.value\" [formControl]=\"formControl\"\n class=\"visually-hidden\" [attr.disabled]=\"(isEffectivelyDisabled || opt.disabled) ? 'disabled' : null\" (change)=\"onRadioChange(opt.value)\"/>\n <label [for]=\"name + '_' + opt.value\" class=\"btn btn-field-group\">{{ opt.label | translate }}</label>\n }\n </div>\n </fieldset>\n }\n\n <!-- Checkbox Switch -->\n @if ( type === typeField.switch || type === typeField.switchSmall)\n {\n <div class=\"field-check field-switch\" [ngClass]=\"{'field-switch-small': type === typeField.switchSmall}\">\n <input type=\"checkbox\" [id]=\"name\" [formControl]=\"formControl\" class=\"field-check-input\" [attr.aria-required]=\"isRequired\"\n [attr.aria-invalid]=\"control.invalid && control.touched\"\n [attr.aria-describedby]=\"getDescribedBy(control)\"\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\"/>\n <label [for]=\"name\" class=\"field-check-label\">{{ label | translate }}</label>\n </div>\n }\n\n <!-- Checkbox -->\n @if (type === typeField.checkboxInline || type === typeField.checkbox) {\n @if (isSingleCheckbox()) {\n <div class=\"field-check\" [class.field-check-inline]=\"type === typeField.checkboxInline\">\n <input #checkboxInput type=\"checkbox\" [id]=\"name\" [formControl]=\"formControl\"\n class=\"field-check-input\"\n [class.is-invalid]=\"control?.invalid && control?.touched\"\n [attr.aria-required]=\"isRequired\"\n [attr.aria-invalid]=\"control?.invalid && control?.touched\"\n [attr.aria-describedby]=\"getDescribedBy(control)\"\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\" />\n <label [for]=\"name\" class=\"field-check-label\">\n {{ label | translate }}\n @if (isRequired) {\n <span class=\"text-danger\">*</span>\n }\n </label>\n </div>\n }\n @else if( options.length > 1) {\n <fieldset\n [attr.aria-required]=\"isRequired\"\n [attr.aria-invalid]=\"control.invalid && control.touched\"\n [attr.aria-describedby]=\"getDescribedBy(control)\"\n [ngClass]=\"{ 'flex-column': type === typeField.checkbox }\">\n <legend class=\"field-label\" [class.visually-hidden]=\"!displayLabel\">\n {{label | translate}}\n @if(isRequired) {\n <span class=\"text-danger\">*</span>\n }\n </legend>\n <ul class=\"list-unstyled mb-none\" [ngClass]=\"type === typeField.checkboxInline ? 'd-flex-h gap-md' : 'd-flex-v'\">\n @for (opt of options; track opt.value) {\n <li class=\"field-check\" [ngClass]=\"{ 'field-check-inline': type === typeField.checkboxInline }\">\n <input type=\"checkbox\" [id]=\"name + '_' + opt.value\" [value]=\"opt.value\" (change)=\"onCheckboxChange($event)\"\n [checked]=\"control.value?.includes(opt.value)\" class=\"field-check-input\"\n [attr.disabled]=\"(isEffectivelyDisabled || opt.disabled) ? 'disabled' : null\" />\n <label [for]=\"name + '_' + opt.value\" class=\"field-check-label\">\n {{ opt.label | translate }}\n </label>\n </li>\n }\n </ul>\n </fieldset>\n }\n @else {\n <fieldset>\n <legend class=\"field-label\" [class.visually-hidden]=\"!displayLabel\">\n {{label | translate}}\n </legend>\n <ul class=\"list-unstyled mb-none\" [ngClass]=\"type === typeField.checkboxInline ? 'd-flex-h gap-md' : 'd-flex-v'\">\n @for (opt of options; track opt.value) {\n <li class=\"field-check\" [ngClass]=\"{ 'field-check-inline': type === typeField.checkboxInline }\">\n <input type=\"checkbox\" [id]=\"name + '_' + opt.value\" [value]=\"opt.value\" (change)=\"onCheckboxChange($event)\"\n [checked]=\"control.value?.includes(opt.value)\" class=\"field-check-input\"\n [attr.aria-required]=\"isRequired\"\n [attr.aria-invalid]=\"control.invalid && control.touched\"\n [attr.aria-describedby]=\"getDescribedBy(control)\"\n [attr.disabled]=\"(isEffectivelyDisabled || opt.disabled) ? 'disabled' : null\" />\n <label [for]=\"name + '_' + opt.value\" class=\"field-check-label\">\n {{ opt.label | translate }}\n @if(isRequired) {\n <span class=\"text-danger\">*</span>\n }\n </label>\n </li>\n }\n </ul>\n </fieldset>\n }\n }\n\n <!-- Checkbox button -->\n @if (type === typeField.checkboxButton && options.length > 0) {\n\n @if(options.length > 1) {\n <fieldset\n [attr.aria-required]=\"isRequired\"\n [attr.aria-invalid]=\"control.invalid && control.touched\"\n [attr.aria-describedby]=\"getDescribedBy(control)\">\n <legend class=\"field-label\" [class.visually-hidden]=\"!displayLabel\">\n {{label | translate}}\n @if(isRequired) {\n <span class=\"text-danger\">*</span>\n }\n </legend>\n <div class=\"field-group field-group-btn\">\n @for (opt of options; track opt.value) {\n <input type=\"checkbox\" [id]=\"name + '_' + opt.value\" [value]=\"opt.value\" (change)=\"onCheckboxChange($event)\"\n [checked]=\"control.value?.includes(opt.value)\" class=\"visually-hidden\"\n [attr.disabled]=\"(isEffectivelyDisabled || opt.disabled) ? 'disabled' : null\" />\n <label [for]=\"name + '_' + opt.value\" class=\"btn btn-field-group\">{{ opt.label | translate }}</label>\n }\n </div>\n </fieldset>\n }\n @else {\n <fieldset>\n <legend class=\"field-label\" [class.visually-hidden]=\"!displayLabel\">\n {{label | translate}}\n </legend>\n <div class=\"btn-group btn-group-secondary\">\n @for (opt of options; track opt.value) {\n <input type=\"checkbox\" [id]=\"name + '_' + opt.value\" [value]=\"opt.value\" (change)=\"onCheckboxChange($event)\"\n [checked]=\"control.value?.includes(opt.value)\" class=\"visually-hidden\"\n [attr.aria-required]=\"isRequired\"\n [attr.aria-invalid]=\"control.invalid && control.touched\"\n [attr.aria-describedby]=\"getDescribedBy(control)\"\n [attr.disabled]=\"(isEffectivelyDisabled || opt.disabled) ? 'disabled' : null\"/>\n <label [for]=\"name + '_' + opt.value\" class=\"btn btn-field-group\">\n {{ opt.label | translate}}\n @if(isRequired) {\n <span class=\"text-danger\">*</span>\n }\n </label>\n }\n </div>\n </fieldset>\n }\n }\n\n <!-- Period - DateToDate / TimeToTime / DateTimeToDateTime -->\n @if ([typeField.dateToDate, typeField.timeToTime, typeField.dateTimeToDateTime].includes(type) && isRange) {\n\n <div class=\"field-group\">\n <div class=\"field-group-addon-left\">Du</div>\n <input [type]=\"getInputType()\" class=\"field-control\" [id]=\"name + '_start'\" [formControl]=\"getControl('start')!\"\n [attr.placeholder]=\"type === typeField.timeToTime ? ('_COMMON._DATES.FROM' | translate) : ('_COMMON._DATES.FROM_TO_1' | translate)\"\n [ngClass]=\"[(cssClass || ''), getControl('start')?.value ? 'has-value' : '']\"\n [attr.required]=\"isRequired ? 'required' : null\" [attr.readonly]=\"isReadonly ? 'readonly' : null\"\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\" [attr.aria-required]=\"isRequired\"\n [attr.min]=\"minStartAttr\" [attr.max]=\"maxStartAttr\" [attr.step]=\"stepAttr\"\n [attr.autocomplete]=\"autocomplete\"\n [attr.aria-invalid]=\"getControl('start')?.invalid && getControl('start')?.touched\"\n [attr.aria-describedby]=\"getDescribedBy(getControl('start'))\"\n (focus)=\"onFocusRange('start')\" (blur)=\"onBlurRange('start')\" />\n\n @if(getControl('start')?.value && !isDisabledOrReadonly) {\n <button type=\"button\" class=\"btn btn-secondary btn-clear-field\"\n (click)=\"onClearFieldPeriod('start')\">\n &times;\n </button>\n }\n <div class=\"field-group-addon-center\">au</div>\n <input [type]=\"getInputType()\" class=\"field-control\" [id]=\"name + '_end'\" [formControl]=\"getControl('end')!\"\n [attr.placeholder]=\"type === typeField.timeToTime ? ('_COMMON._DATES.TO' | translate) : ('_COMMON._DATES.FROM_TO_2' | translate)\"\n [ngClass]=\"[(cssClass || ''), getControl('end')?.value ? 'has-value' : '']\"\n [attr.required]=\"isRequired ? 'required' : null\" [attr.readonly]=\"isReadonly ? 'readonly' : null\"\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\"\n [attr.min]=\"minEndAttr\" [attr.max]=\"maxEndAttr\" [attr.step]=\"stepAttr\"\n [attr.autocomplete]=\"autocomplete\"\n [attr.aria-invalid]=\"getControl('end')?.invalid && getControl('end')?.touched\"\n [attr.aria-describedby]=\"getDescribedBy(getControl('end'))\"\n (focus)=\"onFocusRange('end')\" (blur)=\"onBlurRange('end')\" />\n\n @if(getControl('end')?.value && !isDisabledOrReadonly) {\n <button type=\"button\" class=\"btn btn-ghost btn-clear-field\"\n (click)=\"onClearFieldPeriod('end')\">\n &times;\n </button>\n }\n </div>\n }\n\n @if ([typeField.datePlusOne, typeField.datePlusTwo, typeField.datePlusSeven, typeField.dateComplexe].includes(type)) {\n\n <div class=\"field-group\">\n @if (type === typeField.dateComplexe) {\n <div class=\"field-group-addon-left\">\n <button class=\"btn btn-ghost\" type=\"button\" (click)=\"onDateAddDay('prev')\"\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\">\n <cw-icon font=\"optyweb\" [icon]=\"spriteIcon.nextLeft\" [label]=\"'Jour pr\u00E9c\u00E9dent'\"></cw-icon>\n </button>\n </div>\n }\n\n <input type=\"date\" class=\"field-control\" [id]=\"name\" [formControl]=\"formControl\"\n [ngClass]=\"[(cssClass || ''), formControl?.value ? 'has-value' : '']\"\n [attr.placeholder]=\"placeholder ? placeholder : null\" [attr.required]=\"isRequired ? 'required' : null\"\n [attr.readonly]=\"isReadonly ? 'readonly' : null\" [attr.aria-required]=\"isRequired\"\n [attr.min]=\"minAttr\" [attr.max]=\"maxAttr\" [attr.step]=\"stepAttr\"\n [attr.autocomplete]=\"autocomplete\"\n [attr.aria-invalid]=\"control.invalid && control.touched\"\n [attr.aria-describedby]=\"getDescribedBy(control)\"\n (focus)=\"onFocus()\" (blur)=\"onBlur()\" />\n\n @if(formControl?.value && !isDisabledOrReadonly) {\n <button class=\"btn btn-ghost btn-clear-field\" type=\"button\"\n (click)=\"onClearField(formControl)\">&times;</button>\n }\n\n\n @if (type === typeField.dateComplexe) {\n <div class=\"field-group-addon-right\">\n <button class=\"btn btn-ghost\" type=\"button\" (click)=\"onDateAddDay('next')\"\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\">\n <cw-icon font=\"optyweb\" [icon]=\"spriteIcon.nextRight\" [label]=\"'Jour suivant'\"></cw-icon>\n </button>\n </div>\n <div class=\"field-group-addon-right\">\n <button class=\"btn btn-ghost\" type=\"button\" (click)=\"onRefresh()\"\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\">\n <cw-icon font=\"optyweb\" [icon]=\"spriteIcon.toolbarRefresh\" [label]=\"'Rafra\u00EEchir'\"></cw-icon>\n </button>\n </div>\n }\n\n <div class=\"field-group-addon-right\">\n <button class=\"btn btn-ghost\" type=\"button\" (click)=\"onTodayAddDay(0)\"\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\">\n J\n <span class=\"visually-hidden\">Aujourd'hui</span>\n </button>\n </div>\n <div class=\"field-group-addon-right\">\n <button class=\"btn btn-ghost\" type=\"button\" (click)=\"onTodayAddDay(1)\"\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\">\n J+1\n <span class=\"visually-hidden\">Demain</span>\n </button>\n </div>\n\n @if (type !== typeField.datePlusOne && type !== typeField.dateComplexe) {\n <div class=\"field-group-addon-right\">\n <button class=\"btn btn-ghost \" type=\"button\" (click)=\"onTodayAddDay(2)\"\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\">\n J+2\n <span class=\"visually-hidden\">Dans 2 jours</span>\n </button>\n </div>\n\n @if (type !== typeField.datePlusTwo) {\n <div class=\"field-group-addon-right\">\n <button class=\"btn btn-ghost\" type=\"button\" (click)=\"onTodayAddDay(7)\"\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\">\n J+7\n <span class=\"visually-hidden\">Dans 7 jours</span>\n </button>\n </div>\n }\n }\n </div>\n }\n\n @if (type === typeField.slider) {\n <ngx-slider [(value)]=\"sliderValue\" [options]=\"sliderOptions\" [formControl]=\"formControl\"></ngx-slider>\n }\n\n @if (type === typeField.range) {\n <div class=\"slider\">\n\n <cw-button [isDisabled]=\"formControl.value <= rangeOptions.floor\" [label]=\"'Diminuer ' + formControl.value + ' ' + label\"\n [withIcon]=\"spriteIcon.toolbarMinus\" [withOnlyIcon]=\"true\" [type]=\"buttonType.primary\"\n [iconSize]=\"buttonIconSize.small\" (btnAction)=\"onRangeStep('decrease')\">\n </cw-button>\n\n <div class=\"slider-input\">\n <label [for]=\"name\" class=\"slider-tooltip\" [style.left]=\"getRangePercent() + '%'\" aria-live=\"polite\"\n aria-atomic=\"true\">\n {{ label | translate }} {{ formControl.value }}\n @if (rangeOptions.unit) {\n <abbr [title]=\"rangeOptions.unit\">{{ rangeOptions.unit }}</abbr>\n }\n </label>\n\n <div class=\"slider-custom-bar\">\n <div class=\"slider-custom-bar-selection\" [style.width]=\"getRangePercent() + '%'\">\n </div>\n </div>\n\n <input type=\"range\" [id]=\"name\" [formControl]=\"formControl\" [min]=\"rangeOptions.floor\" [max]=\"rangeOptions.ceil\"\n [step]=\"rangeOptions.step || 1\" class=\"field-control-range\" [attr.aria-required]=\"isRequired\"\n [attr.aria-invalid]=\"control.invalid && control.touched\">\n </div>\n\n <cw-button [isDisabled]=\"formControl.value >= rangeOptions.ceil\" [label]=\"'Augmenter ' + formControl.value + ' ' + label\"\n [withIcon]=\"spriteIcon.toolbarPlus\" [withOnlyIcon]=\"true\" [type]=\"buttonType.primary\"\n [iconSize]=\"buttonIconSize.small\" (btnAction)=\"onRangeStep('increase')\">\n </cw-button>\n </div>\n }\n\n @if (isInInputGroup() && clearable && !isDisabledOrReadonly && type !== typeField.autocompleteMultiple) {\n @if (type === typeField.autocomplete) {\n @if (autocompleteRef()?.hasAnyContent()) {\n <button class=\"btn btn-secondary btn-clear-field\" type=\"button\"\n (click)=\"onClearAutocomplete()\">&times;</button>\n }\n } @else if (type === typeField.ngSelectMultiple) {\n <!-- value est un tableau : un [] vide \u00E9tant truthy, on teste .length pour n'afficher le clear global que s'il y a au moins une s\u00E9lection. -->\n @if (formControl?.value?.length) {\n <button class=\"btn btn-ghost btn-clear-field\" type=\"button\"\n (click)=\"onClearField(formControl)\">&times;</button>\n }\n } @else {\n @if(formControl?.value) {\n <button class=\"btn btn-ghost btn-clear-field\" type=\"button\"\n (click)=\"onClearField(formControl)\">&times;</button>\n }\n }\n }\n\n</ng-template>\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "ngmodule", type: TranslateModule }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i2$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2$1.RangeValueAccessor, selector: "input[type=range][formControlName],input[type=range][formControl],input[type=range][ngModel]" }, { kind: "directive", type: i2$1.CheckboxControlValueAccessor, selector: "input[type=checkbox][formControlName],input[type=checkbox][formControl],input[type=checkbox][ngModel]" }, { kind: "directive", type: i2$1.RadioControlValueAccessor, selector: "input[type=radio][formControlName],input[type=radio][formControl],input[type=radio][ngModel]", inputs: ["name", "formControlName", "value"] }, { kind: "directive", type: i2$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i2$1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "ngmodule", type: NgSelectModule }, { kind: "component", type: i3.NgSelectComponent, selector: "ng-select", inputs: ["ariaLabelDropdown", "bindLabel", "bindValue", "ariaLabel", "markFirst", "placeholder", "fixedPlaceholder", "notFoundText", "typeToSearchText", "preventToggleOnRightClick", "addTagText", "loadingText", "clearAllText", "appearance", "dropdownPosition", "appendTo", "loading", "closeOnSelect", "hideSelected", "selectOnTab", "openOnEnter", "maxSelectedItems", "groupBy", "groupValue", "bufferAmount", "virtualScroll", "selectableGroup", "selectableGroupAsModel", "searchFn", "trackByFn", "clearOnBackspace", "labelForId", "inputAttrs", "tabIndex", "tabFocusOnClearButton", "readonly", "searchWhileComposing", "minTermLength", "editableSearchTerm", "ngClass", "typeahead", "multiple", "addTag", "searchable", "clearable", "isOpen", "items", "compareWith", "clearSearchOnAdd", "deselectOnClick", "keyDownFn"], outputs: ["blur", "focus", "change", "open", "close", "search", "clear", "add", "remove", "scroll", "scrollToEnd"] }, { kind: "directive", type: i3.NgOptionTemplateDirective, selector: "[ng-option-tmp]" }, { kind: "directive", type: i3.NgLabelTemplateDirective, selector: "[ng-label-tmp]" }, { kind: "ngmodule", type: NgxSliderModule }, { kind: "component", type: i4.SliderComponent, selector: "ngx-slider", inputs: ["value", "highValue", "options", "manualRefresh", "triggerFocus", "cancelUserChange"], outputs: ["valueChange", "highValueChange", "userChangeStart", "userChange", "userChangeEnd"] }, { kind: "component", type: IconComponent, selector: "cw-icon", inputs: ["icon", "label", "type", "iconSize", "iconCssClass", "iconUiType", "iconColorCustom", "spritePath"] }, { kind: "component", type: ButtonComponent, selector: "cw-button", inputs: ["type", "label", "id", "link", "isDropdown", "hideCaret", "withIcon", "withOnlyIcon", "iconSize", "iconPosition", "dropdownPosition", "isMinWidth", "isDisabled", "isLoading", "loadingAnnounce", "cssClass", "dataTest", "skeletonMode", "withTooltip", "tooltipText", "tooltipTitle", "tooltipTrigger", "tooltipPosition", "tooltipType"], outputs: ["btnAction", "dropDownClicked"] }, { kind: "component", type: AutocompleteComponent, selector: "cw-autocomplete", inputs: ["control", "fetcher", "displayField", "valueField", "columns", "multiple", "minChars", "debounceMs", "selectedItem", "resolver", "selectedItems", "placeholder", "id", "isRequired", "isReadonly", "isDisabled", "ariaInvalid", "ariaDescribedBy"], outputs: ["itemSelected", "itemsChange"] }, { kind: "component", type: RichTextEditorComponent, selector: "cw-rich-text-editor", inputs: ["control", "options", "id", "placeholder", "isRequired", "isReadonly", "isDisabled", "ariaInvalid", "ariaDescribedBy"], outputs: ["valueChange"] }, { kind: "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" }] }); }
4110
4123
  }
4111
4124
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: FormFieldComponent, decorators: [{
4112
4125
  type: Component,
@@ -4122,7 +4135,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.20", ngImpo
4122
4135
  AutocompleteComponent,
4123
4136
  RichTextEditorComponent,
4124
4137
  FilePreviewComponent
4125
- ], template: "@if (!isInAddon) {\n @if (\n type !== typeField.checkbox &&\n type !== typeField.radio &&\n type !== typeField.checkboxButton &&\n type !== typeField.radioButton &&\n type !== typeField.checkboxInline &&\n type !== typeField.radioInline &&\n type !== typeField.switch &&\n type !== typeField.range &&\n type !== typeField.switchSmall\n ) {\n <label [for]=\"name\" class=\"field-label\" [class.visually-hidden]=\"!displayLabel\">\n {{ label | translate }}\n\n @if (isRequired) {\n <span class=\"text-danger\">*</span>\n }\n\n @if (tooltip) {\n <!-- <button type=\"button\" class=\"btn btn-link btn-popover\" placement=\"bottom\" [ngbPopover]=\"popContent\" container=\"body\"\n triggers=\"mouseenter:mouseleave\">\n <span class=\"btn-popover-icon bo-icons bo-help\"></span>\n </button>\n <ng-template #popContent>\n <div [innerHTML]=\"tooltip\"></div>\n </ng-template> -->\n }\n </label>\n }\n\n @if (addonLeft || addonRight) {\n <div class=\"field-group\" [class.field-group-invalid]=\"isInvalid\" [class.field-group-disabled]=\"isDisabledOrReadonly\">\n @if(addonLeft) {\n <div class=\"field-group-addon-left\">\n <ng-container [ngTemplateOutlet]=\"addonLeft\"></ng-container>\n </div>\n }\n <ng-container [ngTemplateOutlet]=\"field\"></ng-container>\n @if(addonRight) {\n <div class=\"field-group-addon-right\">\n <ng-container [ngTemplateOutlet]=\"addonRight\"></ng-container>\n </div>\n }\n </div>\n }\n @else {\n @if ( isInInputGroup() ) {\n <div class=\"field-group\" [class.field-group-invalid]=\"isInvalid\" [class.field-group-disabled]=\"isDisabledOrReadonly\">\n <ng-container [ngTemplateOutlet]=\"field\"></ng-container>\n </div>\n }\n @else {\n <ng-container [ngTemplateOutlet]=\"field\"></ng-container>\n }\n }\n\n <!-- Error message -->\n @if (controlOrGroup?.invalid && controlOrGroup?.touched) {\n <div class=\"field-invalid\" [id]=\"'error-' + name\">\n @if (\n !errorMessages?.['required'] &&\n ((controlOrGroup?.errors?.['required']) || (getControl('start')?.errors?.['required'] || getControl('end')?.errors?.['required']))\n ) {\n <span [innerHtml]=\"'_COMMON._FORM.ERROR_IS_MANDATORY' | translate: {label: label | translate}\"></span>\n }\n @if (!errorMessages?.['rangeInvalid'] && controlOrGroup?.errors?.['rangeInvalid']) {\n <span>{{'_COMMON._DATES.ERROR_START_END_PERIOD' | translate}}</span>\n }\n @if (!errorMessages?.['fileExtension'] && controlOrGroup?.errors?.['fileExtension']) {\n <span>{{ '_COMMON._FORM.ERROR_FILE_EXTENSION' | translate: { accept: acceptLabel } }}</span>\n }\n @if (!errorMessages?.['fileSize'] && controlOrGroup?.errors?.['fileSize']) {\n <span>{{ '_COMMON._FORM.ERROR_FILE_SIZE' | translate: { maxSize: maxSizeLabel } }}</span>\n }\n @if (!errorMessages?.['email'] && controlOrGroup?.errors?.['email']) {\n <span>{{ '_COMMON._FORM.ERROR_INVALID_EMAIL' | translate }}</span>\n }\n @if (!errorMessages?.['phone'] && controlOrGroup?.errors?.['phone']) {\n <span>{{ '_COMMON._FORM.ERROR_INVALID_PHONE' | translate }}</span>\n }\n @if (errorMessages) {\n @for (entry of errorMessages | keyvalue: keepOrder; track entry.key) {\n @if (controlOrGroup?.errors?.[entry.key]; as errVal) {\n <span>{{ entry.value | translate: (errVal === true ? null : errVal) }}</span>\n }\n }\n }\n </div>\n }\n\n @if (help || autoHelpEntries.length) {\n <div [id]=\"name + '-help'\" class=\"field-text\">\n @if (help) {\n <span>{{ help | translate }}</span>\n }\n @for (entry of autoHelpEntries; track entry.key) {\n <span>{{ entry.key | translate: entry.params }}</span>\n }\n </div>\n }\n\n <!-- Aper\u00E7u du fichier (type=file, opt-in) : sous le champ et ses aides, comme dans la\n maquette DS. La croix native du champ n'est pas retir\u00E9e \u2014 les deux vident le m\u00EAme\n control, l'aper\u00E7u ajoute juste \u00AB Visualiser \u00BB et une cible plus grande. -->\n @if (isPreviewVisible) {\n <cw-file-preview [file]=\"previewFile\" [existingFile]=\"existingFile ?? null\"\n [disabled]=\"!!isDisabledOrReadonly\" (remove)=\"onPreviewRemove()\" />\n }\n\n <!-- Chips de la multi-s\u00E9lection (autocomplete) : rendus ici, hors du field-group et apr\u00E8s\n erreur/help, pour \u00EAtre visuellement d\u00E9tach\u00E9s du champ. La donn\u00E9e et le retrait restent\n port\u00E9s par cw-autocomplete (`chips()` / `onChipRemove()`), seul l'affichage est d\u00E9l\u00E9gu\u00E9. -->\n @if (type === typeField.autocompleteMultiple && autocompleteRef()?.chips()?.length) {\n <ul class=\"autocomplete-chips\" role=\"list\">\n @for (chip of autocompleteRef()!.chips(); track chip.item) {\n <li>\n <button type=\"button\" class=\"autocomplete-chip\"\n [disabled]=\"isEffectivelyDisabled || isReadonly\"\n (click)=\"autocompleteRef()!.onChipRemove(chip.item)\">\n <span>{{ chip.label }}</span>\n @if (!isEffectivelyDisabled && !isReadonly) {\n <span aria-hidden=\"true\" class=\"autocomplete-chip-x\">&times;</span>\n <span class=\"visually-hidden\">{{ '_COMMON._ACTION.DELETE' | translate }}</span>\n }\n </button>\n </li>\n }\n </ul>\n }\n}\n@else {\n <ng-container [ngTemplateOutlet]=\"field\"></ng-container>\n}\n\n<ng-template #field>\n <!-- Autocomplete (mono / multi) -->\n @if ((type === typeField.autocomplete || type === typeField.autocompleteMultiple) && autocompleteOptions) {\n <cw-autocomplete\n [id]=\"name\"\n [control]=\"formControl\"\n [fetcher]=\"autocompleteOptions.fetcher\"\n [displayField]=\"autocompleteOptions.displayField ?? 'label'\"\n [valueField]=\"autocompleteOptions.valueField ?? 'id'\"\n [columns]=\"autocompleteOptions.columns ?? []\"\n [resolver]=\"autocompleteOptions.resolver ?? null\"\n [selectedItem]=\"autocompleteOptions.selectedItem ?? null\"\n [selectedItems]=\"autocompleteOptions.selectedItems ?? []\"\n [minChars]=\"autocompleteOptions.minChars ?? 2\"\n [debounceMs]=\"autocompleteOptions.debounceMs ?? 250\"\n [multiple]=\"type === typeField.autocompleteMultiple\"\n [isRequired]=\"isRequired\"\n [isReadonly]=\"!!isReadonly\"\n [isDisabled]=\"isEffectivelyDisabled\"\n [ariaInvalid]=\"control.invalid && control.touched\"\n [ariaDescribedBy]=\"getDescribedBy(control)\"\n [placeholder]=\"placeholder\">\n </cw-autocomplete>\n }\n\n <!-- Rich text editor (Quill) : sous-composant interne, sans field-group ni bouton clear\n (il porte sa propre bordure + toolbar). Le label statique du form-field reste au-dessus. -->\n @if (type === typeField.richText) {\n <cw-rich-text-editor\n [id]=\"name\"\n [control]=\"formControl\"\n [options]=\"richTextOptions\"\n [placeholder]=\"placeholder ? (placeholder | translate) : ''\"\n [isRequired]=\"isRequired\"\n [isReadonly]=\"!!isReadonly\"\n [isDisabled]=\"isEffectivelyDisabled\"\n [ariaInvalid]=\"control.invalid && control.touched\"\n [ariaDescribedBy]=\"getDescribedBy(control)\">\n </cw-rich-text-editor>\n }\n\n <!-- Text -->\n @if ([typeField.text, typeField.date, typeField.time, typeField.dateTime, typeField.number,\n typeField.email,\n typeField.color, typeField.zipCode].includes(type)) {\n <input [type]=\"type === typeField.zipCode ? 'text' : type\" class=\"field-control\" [id]=\"name\" [formControl]=\"formControl\"\n [ngClass]=\"[(cssClass || ''), formControl?.value ? 'has-value' : '', type === typeField.zipCode ? 'field-control-zipcode' : '']\"\n [attr.placeholder]=\"placeholder ? (placeholder | translate) : null\" [attr.required]=\"isRequired ? 'required' : null\"\n [attr.readonly]=\"isReadonly ? 'readonly' : null\" [attr.aria-required]=\"isRequired\"\n [attr.minlength]=\"minLengthAttr\" [attr.maxlength]=\"maxLengthAttr\"\n [attr.min]=\"minAttr\" [attr.max]=\"maxAttr\" [attr.step]=\"stepAttr\" [attr.pattern]=\"patternAttr\"\n [attr.autocomplete]=\"autocomplete\"\n [attr.aria-invalid]=\"control.invalid && control.touched\"\n [attr.aria-describedby]=\"getDescribedBy(control)\"\n (focus)=\"onFocus()\" (blur)=\"onBlur()\" />\n }\n\n <!-- Phone (intl-tel-input) -->\n @if (type === typeField.phone) {\n <input #phoneInput type=\"tel\" class=\"field-control\" [id]=\"name\"\n [attr.placeholder]=\"placeholder ? (placeholder | translate) : null\" [attr.required]=\"isRequired ? 'required' : null\"\n [attr.readonly]=\"isReadonly ? 'readonly' : null\" [disabled]=\"isEffectivelyDisabled\" [attr.aria-required]=\"isRequired\"\n [attr.autocomplete]=\"autocomplete\"\n [attr.aria-invalid]=\"control.invalid && control.touched\"\n [attr.aria-describedby]=\"getDescribedBy(control)\"\n (focus)=\"onFocus()\" (blur)=\"onPhoneBlur($event)\" />\n }\n\n <!-- File -->\n @if (type === typeField.file) {\n <!-- L'input natif reste LE controle (focus, clavier, restitution aux lecteurs d'ecran,\n validation), mais il est masque visuellement : le libelle de son bouton et son\n \u00AB aucun fichier choisi \u00BB sont ecrits par le NAVIGATEUR, dans SA langue. Ils sont\n intraduisibles et ne suivent pas la langue de l'application \u2014 un utilisateur qui\n bascule en anglais garderait \u00AB Choisir un fichier \u00BB. On les reecrit donc a cote,\n traduits, dans une couche purement visuelle. -->\n <input #fileInput type=\"file\" class=\"field-control visually-hidden\" [id]=\"name\"\n [ngClass]=\"[(cssClass || ''), formControl?.value ? 'has-value' : '']\"\n [attr.required]=\"isRequired ? 'required' : null\"\n [attr.readonly]=\"isReadonly ? 'readonly' : null\" [disabled]=\"isEffectivelyDisabled\" [attr.aria-required]=\"isRequired\"\n [attr.accept]=\"acceptAttr\"\n [attr.aria-invalid]=\"control.invalid && control.touched\"\n [attr.aria-describedby]=\"getDescribedBy(control)\"\n (change)=\"onFileChange($event)\" (focus)=\"onFocus()\" (blur)=\"onBlur()\" />\n\n <!-- `aria-hidden` : doublon visuel de l'input, que les lecteurs d'ecran restituent deja\n (nom du champ, bouton de parcours, fichier selectionne). L'annoncer une seconde fois\n ne ferait que bavarder. Le clic est relaye a l'input, le clavier passe par lui. -->\n <span class=\"field-file\" aria-hidden=\"true\" (click)=\"openFilePicker()\">\n <span class=\"field-file-button\">{{ '_COMMON._FORM.CHOOSE_FILE' | translate }}</span>\n <span class=\"field-file-name\" [class.field-file-name-empty]=\"!selectedFileName\">\n {{ selectedFileName ?? ('_COMMON._FORM.NO_FILE_SELECTED' | translate) }}\n </span>\n </span>\n }\n\n @if (type === typeField.password) {\n <input [type]=\"isPasswordShown ? 'text' : 'password'\" class=\"field-control\" [id]=\"name\" [formControl]=\"formControl\"\n [ngClass]=\"[(cssClass || ''), formControl?.value ? 'has-value' : '']\"\n [attr.required]=\"isRequired ? 'required' : null\" [attr.readonly]=\"isReadonly ? 'readonly' : null\"\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\" [attr.aria-required]=\"isRequired\"\n [attr.minlength]=\"minLengthAttr\" [attr.maxlength]=\"maxLengthAttr\" [attr.pattern]=\"patternAttr\"\n [attr.autocomplete]=\"autocomplete\"\n [attr.aria-invalid]=\"control.invalid && control.touched\"\n [attr.aria-describedby]=\"getDescribedBy(control)\"\n (focus)=\"onFocus()\" (blur)=\"onBlur()\" />\n <cw-button [type]=\"buttonType.ghost\"\n cssClass=\"btn-password-field\"\n [withIcon]=\"isPasswordShown ? spriteIcon.toolbarHidePassword : spriteIcon.toolbarShowPassword\"\n [withOnlyIcon]=\"true\"\n [label]=\"isPasswordShown ? '_COMMON._FORM._SHOW_HIDE_PWD.HIDE' : '_COMMON._FORM._SHOW_HIDE_PWD.SHOW'\"\n (btnAction)=\"togglePasswordVisibility()\">\n </cw-button>\n }\n\n <!-- Textarea -->\n @if (type === typeField.textarea) {\n <textarea class=\"field-control\" [id]=\"name\" [formControl]=\"formControl\"\n [ngClass]=\"[(cssClass || ''), formControl?.value ? 'has-value' : '']\"\n [attr.placeholder]=\"placeholder ? (placeholder | translate) : null\" [attr.required]=\"isRequired ? 'required' : null\"\n [attr.readonly]=\"isReadonly ? 'readonly' : null\" [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\"\n [attr.aria-required]=\"isRequired\" [attr.aria-invalid]=\"control.invalid && control.touched\"\n [attr.minlength]=\"minLengthAttr\" [attr.maxlength]=\"maxLengthAttr\" [attr.pattern]=\"patternAttr\"\n [attr.autocomplete]=\"autocomplete\"\n [attr.aria-describedby]=\"getDescribedBy(control)\"\n (focus)=\"onFocus()\" (blur)=\"onBlur()\"></textarea>\n }\n\n <!-- Select -->\n @if (type === typeField.select) {\n <ng-select [formControl]=\"formControl\" [items]=\"options\" bindLabel=\"label\" [labelForId]=\"name\" [appendTo]=\"appendTo ?? ''\" bindValue=\"value\"\n [ngClass]=\"cssClass\" [searchable]=\"false\" [placeholder]=\"placeholder ? (placeholder | translate) : ''\" [readonly]=\"isReadonly\" [clearable]=\"false\"\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\" [attr.required]=\"isRequired ? 'required' : null\"\n [attr.aria-required]=\"isRequired\" [attr.aria-invalid]=\"control.invalid && control.touched\"\n [attr.aria-describedby]=\"getDescribedBy(control)\" [attr.id]=\"name\"\n (focus)=\"onFocus()\" (blur)=\"onBlur()\">\n\n <!-- Template pour les options -->\n <ng-template ng-option-tmp let-item=\"item\" let-index=\"index\" let-search=\"searchTerm\">\n @if (optionTemplate) {\n <ng-container *ngTemplateOutlet=\"optionTemplate; context: { item: item | translate, index: index, searchTerm: search }\"></ng-container>\n }\n @else {\n <div>{{ item.label | translate }}</div>\n }\n </ng-template>\n\n <!-- Template pour le label -->\n <ng-template ng-label-tmp let-item=\"item\">\n @if (labelTemplate) {\n <ng-container *ngTemplateOutlet=\"labelTemplate; context: { item: item | translate }\"></ng-container>\n }\n @else {\n {{ (item.label | translate) || (placeholder | translate) }}\n }\n </ng-template>\n </ng-select>\n }\n\n <!-- NgSelect -->\n @if (type === typeField.ngSelect || type === typeField.ngSelectMultiple) {\n <ng-select [formControl]=\"formControl\" [items]=\"options\" bindLabel=\"label\" [labelForId]=\"name\" [appendTo]=\"appendTo ?? ''\" bindValue=\"value\"\n [multiple]=\"type === typeField.ngSelectMultiple\" [ngClass]=\"cssClass\" [clearable]=\"false\"\n [placeholder]=\"placeholder ? (placeholder | translate) : ''\" [readonly]=\"isReadonly\"\n [notFoundText]=\"'_COMMON.NO_RESULT' | translate\" [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\"\n [attr.required]=\"isRequired ? 'required' : null\" [attr.aria-required]=\"isRequired\"\n [attr.aria-invalid]=\"control.invalid && control.touched\"\n [attr.aria-describedby]=\"getDescribedBy(control)\" [attr.id]=\"name\"\n (focus)=\"onFocus()\" (blur)=\"onBlur()\" (search)=\"textChanged.emit($event?.term)\">\n\n <!-- Template pour les options -->\n <ng-template ng-option-tmp let-item=\"item\" let-index=\"index\" let-search=\"searchTerm\">\n @if (optionTemplate) {\n <ng-container *ngTemplateOutlet=\"optionTemplate; context: { item: item, index: index, searchTerm: search }\"></ng-container>\n }\n @else {\n <div>{{ item.label | translate }}</div>\n }\n </ng-template>\n\n <!-- Template pour le label -->\n <ng-template ng-label-tmp let-item=\"item\" let-clear=\"clear\">\n <span class=\"ng-value-icon left\" (click)=\"clear(item)\" aria-hidden=\"true\">\u00D7</span>\n @if (labelTemplate) {\n <ng-container *ngTemplateOutlet=\"labelTemplate; context: { item: item | translate }\"></ng-container>\n }\n @else {\n {{ (item.label | translate) || (placeholder | translate) }}\n }\n </ng-template>\n </ng-select>\n }\n\n <!-- Radio -->\n @if (type === typeField.radioInline || type === typeField.radio) {\n <fieldset\n [attr.aria-required]=\"isRequired\"\n [attr.aria-invalid]=\"control.invalid && control.touched\"\n [attr.aria-describedby]=\"getDescribedBy(control)\">\n <legend class=\"field-label\" [class.visually-hidden]=\"!displayLabel\">\n {{label | translate}}\n @if(isRequired) {\n <span class=\"text-danger\">*</span>\n }\n </legend>\n <ul class=\"list-unstyled mb-none\" [ngClass]=\"type === typeField.radioInline ? 'd-flex-h gap-md flex-wrap' : 'd-flex-v'\">\n @for (opt of options; track opt.value) {\n <li class=\"field-check\">\n <input type=\"radio\" [id]=\"name + '_' + opt.value\" [value]=\"opt.value\" [formControl]=\"formControl\"\n class=\"field-check-input\" [attr.disabled]=\"(isEffectivelyDisabled || opt.disabled) ? 'disabled' : null\" (change)=\"onRadioChange(opt.value)\" />\n <label [for]=\"name + '_' + opt.value\" class=\"field-check-label\">{{ opt.label | translate }}</label>\n </li>\n }\n </ul>\n </fieldset>\n }\n\n <!-- Radio button -->\n @if (type === typeField.radioButton) {\n <fieldset\n [attr.aria-required]=\"isRequired\"\n [attr.aria-invalid]=\"control.invalid && control.touched\"\n [attr.aria-describedby]=\"getDescribedBy(control)\">\n <legend class=\"field-label\" [class.visually-hidden]=\"!displayLabel\">\n {{label | translate}}\n @if(isRequired) {\n <span class=\"text-danger\">*</span>\n }\n </legend>\n <div class=\"field-group field-group-btn\">\n @for (opt of options; track opt.value) {\n <input type=\"radio\" [id]=\"name + '_' + opt.value\" [value]=\"opt.value\" [formControl]=\"formControl\"\n class=\"visually-hidden\" [attr.disabled]=\"(isEffectivelyDisabled || opt.disabled) ? 'disabled' : null\" (change)=\"onRadioChange(opt.value)\"/>\n <label [for]=\"name + '_' + opt.value\" class=\"btn btn-field-group\">{{ opt.label | translate }}</label>\n }\n </div>\n </fieldset>\n }\n\n <!-- Checkbox Switch -->\n @if ( type === typeField.switch || type === typeField.switchSmall)\n {\n <div class=\"field-check field-switch\" [ngClass]=\"{'field-switch-small': type === typeField.switchSmall}\">\n <input type=\"checkbox\" [id]=\"name\" [formControl]=\"formControl\" class=\"field-check-input\" [attr.aria-required]=\"isRequired\"\n [attr.aria-invalid]=\"control.invalid && control.touched\"\n [attr.aria-describedby]=\"getDescribedBy(control)\"\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\"/>\n <label [for]=\"name\" class=\"field-check-label\">{{ label | translate }}</label>\n </div>\n }\n\n <!-- Checkbox -->\n @if (type === typeField.checkboxInline || type === typeField.checkbox) {\n @if (isSingleCheckbox()) {\n <div class=\"field-check\" [class.field-check-inline]=\"type === typeField.checkboxInline\">\n <input #checkboxInput type=\"checkbox\" [id]=\"name\" [formControl]=\"formControl\"\n class=\"field-check-input\"\n [class.is-invalid]=\"control?.invalid && control?.touched\"\n [attr.aria-required]=\"isRequired\"\n [attr.aria-invalid]=\"control?.invalid && control?.touched\"\n [attr.aria-describedby]=\"getDescribedBy(control)\"\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\" />\n <label [for]=\"name\" class=\"field-check-label\">\n {{ label | translate }}\n @if (isRequired) {\n <span class=\"text-danger\">*</span>\n }\n </label>\n </div>\n }\n @else if( options.length > 1) {\n <fieldset\n [attr.aria-required]=\"isRequired\"\n [attr.aria-invalid]=\"control.invalid && control.touched\"\n [attr.aria-describedby]=\"getDescribedBy(control)\"\n [ngClass]=\"{ 'flex-column': type === typeField.checkbox }\">\n <legend class=\"field-label\" [class.visually-hidden]=\"!displayLabel\">\n {{label | translate}}\n @if(isRequired) {\n <span class=\"text-danger\">*</span>\n }\n </legend>\n <ul class=\"list-unstyled mb-none\" [ngClass]=\"type === typeField.checkboxInline ? 'd-flex-h gap-md' : 'd-flex-v'\">\n @for (opt of options; track opt.value) {\n <li class=\"field-check\" [ngClass]=\"{ 'field-check-inline': type === typeField.checkboxInline }\">\n <input type=\"checkbox\" [id]=\"name + '_' + opt.value\" [value]=\"opt.value\" (change)=\"onCheckboxChange($event)\"\n [checked]=\"control.value?.includes(opt.value)\" class=\"field-check-input\"\n [attr.disabled]=\"(isEffectivelyDisabled || opt.disabled) ? 'disabled' : null\" />\n <label [for]=\"name + '_' + opt.value\" class=\"field-check-label\">\n {{ opt.label | translate }}\n </label>\n </li>\n }\n </ul>\n </fieldset>\n }\n @else {\n <fieldset>\n <legend class=\"field-label\" [class.visually-hidden]=\"!displayLabel\">\n {{label | translate}}\n </legend>\n <ul class=\"list-unstyled mb-none\" [ngClass]=\"type === typeField.checkboxInline ? 'd-flex-h gap-md' : 'd-flex-v'\">\n @for (opt of options; track opt.value) {\n <li class=\"field-check\" [ngClass]=\"{ 'field-check-inline': type === typeField.checkboxInline }\">\n <input type=\"checkbox\" [id]=\"name + '_' + opt.value\" [value]=\"opt.value\" (change)=\"onCheckboxChange($event)\"\n [checked]=\"control.value?.includes(opt.value)\" class=\"field-check-input\"\n [attr.aria-required]=\"isRequired\"\n [attr.aria-invalid]=\"control.invalid && control.touched\"\n [attr.aria-describedby]=\"getDescribedBy(control)\"\n [attr.disabled]=\"(isEffectivelyDisabled || opt.disabled) ? 'disabled' : null\" />\n <label [for]=\"name + '_' + opt.value\" class=\"field-check-label\">\n {{ opt.label | translate }}\n @if(isRequired) {\n <span class=\"text-danger\">*</span>\n }\n </label>\n </li>\n }\n </ul>\n </fieldset>\n }\n }\n\n <!-- Checkbox button -->\n @if (type === typeField.checkboxButton && options.length > 0) {\n\n @if(options.length > 1) {\n <fieldset\n [attr.aria-required]=\"isRequired\"\n [attr.aria-invalid]=\"control.invalid && control.touched\"\n [attr.aria-describedby]=\"getDescribedBy(control)\">\n <legend class=\"field-label\" [class.visually-hidden]=\"!displayLabel\">\n {{label | translate}}\n @if(isRequired) {\n <span class=\"text-danger\">*</span>\n }\n </legend>\n <div class=\"field-group field-group-btn\">\n @for (opt of options; track opt.value) {\n <input type=\"checkbox\" [id]=\"name + '_' + opt.value\" [value]=\"opt.value\" (change)=\"onCheckboxChange($event)\"\n [checked]=\"control.value?.includes(opt.value)\" class=\"visually-hidden\"\n [attr.disabled]=\"(isEffectivelyDisabled || opt.disabled) ? 'disabled' : null\" />\n <label [for]=\"name + '_' + opt.value\" class=\"btn btn-field-group\">{{ opt.label | translate }}</label>\n }\n </div>\n </fieldset>\n }\n @else {\n <fieldset>\n <legend class=\"field-label\" [class.visually-hidden]=\"!displayLabel\">\n {{label | translate}}\n </legend>\n <div class=\"btn-group btn-group-secondary\">\n @for (opt of options; track opt.value) {\n <input type=\"checkbox\" [id]=\"name + '_' + opt.value\" [value]=\"opt.value\" (change)=\"onCheckboxChange($event)\"\n [checked]=\"control.value?.includes(opt.value)\" class=\"visually-hidden\"\n [attr.aria-required]=\"isRequired\"\n [attr.aria-invalid]=\"control.invalid && control.touched\"\n [attr.aria-describedby]=\"getDescribedBy(control)\"\n [attr.disabled]=\"(isEffectivelyDisabled || opt.disabled) ? 'disabled' : null\"/>\n <label [for]=\"name + '_' + opt.value\" class=\"btn btn-field-group\">\n {{ opt.label | translate}}\n @if(isRequired) {\n <span class=\"text-danger\">*</span>\n }\n </label>\n }\n </div>\n </fieldset>\n }\n }\n\n <!-- Period - DateToDate / TimeToTime / DateTimeToDateTime -->\n @if ([typeField.dateToDate, typeField.timeToTime, typeField.dateTimeToDateTime].includes(type) && isRange) {\n\n <div class=\"field-group\">\n <div class=\"field-group-addon-left\">Du</div>\n <input [type]=\"getInputType()\" class=\"field-control\" [id]=\"name + '_start'\" [formControl]=\"getControl('start')!\"\n [attr.placeholder]=\"type === typeField.timeToTime ? ('_COMMON._DATES.FROM' | translate) : ('_COMMON._DATES.FROM_TO_1' | translate)\"\n [ngClass]=\"[(cssClass || ''), getControl('start')?.value ? 'has-value' : '']\"\n [attr.required]=\"isRequired ? 'required' : null\" [attr.readonly]=\"isReadonly ? 'readonly' : null\"\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\" [attr.aria-required]=\"isRequired\"\n [attr.min]=\"minStartAttr\" [attr.max]=\"maxStartAttr\" [attr.step]=\"stepAttr\"\n [attr.autocomplete]=\"autocomplete\"\n [attr.aria-invalid]=\"getControl('start')?.invalid && getControl('start')?.touched\"\n [attr.aria-describedby]=\"getDescribedBy(getControl('start'))\"\n (focus)=\"onFocusRange('start')\" />\n\n @if(getControl('start')?.value && !isDisabledOrReadonly) {\n <button type=\"button\" class=\"btn btn-secondary btn-clear-field\"\n (click)=\"onClearFieldPeriod('start')\">\n &times;\n </button>\n }\n <div class=\"field-group-addon-center\">au</div>\n <input [type]=\"getInputType()\" class=\"field-control\" [id]=\"name + '_end'\" [formControl]=\"getControl('end')!\"\n [attr.placeholder]=\"type === typeField.timeToTime ? ('_COMMON._DATES.TO' | translate) : ('_COMMON._DATES.FROM_TO_2' | translate)\"\n [ngClass]=\"[(cssClass || ''), getControl('end')?.value ? 'has-value' : '']\"\n [attr.required]=\"isRequired ? 'required' : null\" [attr.readonly]=\"isReadonly ? 'readonly' : null\"\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\"\n [attr.min]=\"minEndAttr\" [attr.max]=\"maxEndAttr\" [attr.step]=\"stepAttr\"\n [attr.autocomplete]=\"autocomplete\"\n [attr.aria-invalid]=\"getControl('end')?.invalid && getControl('end')?.touched\"\n [attr.aria-describedby]=\"getDescribedBy(getControl('end'))\"\n (focus)=\"onFocusRange('end')\" />\n\n @if(getControl('end')?.value && !isDisabledOrReadonly) {\n <button type=\"button\" class=\"btn btn-ghost btn-clear-field\"\n (click)=\"onClearFieldPeriod('end')\">\n &times;\n </button>\n }\n </div>\n }\n\n @if ([typeField.datePlusOne, typeField.datePlusTwo, typeField.datePlusSeven, typeField.dateComplexe].includes(type)) {\n\n <div class=\"field-group\">\n @if (type === typeField.dateComplexe) {\n <div class=\"field-group-addon-left\">\n <button class=\"btn btn-ghost\" type=\"button\" (click)=\"onDateAddDay('prev')\"\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\">\n <cw-icon font=\"optyweb\" [icon]=\"spriteIcon.nextLeft\" [label]=\"'Jour pr\u00E9c\u00E9dent'\"></cw-icon>\n </button>\n </div>\n }\n\n <input type=\"date\" class=\"field-control\" [id]=\"name\" [formControl]=\"formControl\"\n [ngClass]=\"[(cssClass || ''), formControl?.value ? 'has-value' : '']\"\n [attr.placeholder]=\"placeholder ? placeholder : null\" [attr.required]=\"isRequired ? 'required' : null\"\n [attr.readonly]=\"isReadonly ? 'readonly' : null\" [attr.aria-required]=\"isRequired\"\n [attr.min]=\"minAttr\" [attr.max]=\"maxAttr\" [attr.step]=\"stepAttr\"\n [attr.autocomplete]=\"autocomplete\"\n [attr.aria-invalid]=\"control.invalid && control.touched\"\n [attr.aria-describedby]=\"getDescribedBy(control)\"\n (focus)=\"onFocus()\" (blur)=\"onBlur()\" />\n\n @if(formControl?.value && !isDisabledOrReadonly) {\n <button class=\"btn btn-ghost btn-clear-field\" type=\"button\"\n (click)=\"onClearField(formControl)\">&times;</button>\n }\n\n\n @if (type === typeField.dateComplexe) {\n <div class=\"field-group-addon-right\">\n <button class=\"btn btn-ghost\" type=\"button\" (click)=\"onDateAddDay('next')\"\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\">\n <cw-icon font=\"optyweb\" [icon]=\"spriteIcon.nextRight\" [label]=\"'Jour suivant'\"></cw-icon>\n </button>\n </div>\n <div class=\"field-group-addon-right\">\n <button class=\"btn btn-ghost\" type=\"button\" (click)=\"onRefresh()\"\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\">\n <cw-icon font=\"optyweb\" [icon]=\"spriteIcon.toolbarRefresh\" [label]=\"'Rafra\u00EEchir'\"></cw-icon>\n </button>\n </div>\n }\n\n <div class=\"field-group-addon-right\">\n <button class=\"btn btn-ghost\" type=\"button\" (click)=\"onTodayAddDay(0)\"\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\">\n J\n <span class=\"visually-hidden\">Aujourd'hui</span>\n </button>\n </div>\n <div class=\"field-group-addon-right\">\n <button class=\"btn btn-ghost\" type=\"button\" (click)=\"onTodayAddDay(1)\"\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\">\n J+1\n <span class=\"visually-hidden\">Demain</span>\n </button>\n </div>\n\n @if (type !== typeField.datePlusOne && type !== typeField.dateComplexe) {\n <div class=\"field-group-addon-right\">\n <button class=\"btn btn-ghost \" type=\"button\" (click)=\"onTodayAddDay(2)\"\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\">\n J+2\n <span class=\"visually-hidden\">Dans 2 jours</span>\n </button>\n </div>\n\n @if (type !== typeField.datePlusTwo) {\n <div class=\"field-group-addon-right\">\n <button class=\"btn btn-ghost\" type=\"button\" (click)=\"onTodayAddDay(7)\"\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\">\n J+7\n <span class=\"visually-hidden\">Dans 7 jours</span>\n </button>\n </div>\n }\n }\n </div>\n }\n\n @if (type === typeField.slider) {\n <ngx-slider [(value)]=\"sliderValue\" [options]=\"sliderOptions\" [formControl]=\"formControl\"></ngx-slider>\n }\n\n @if (type === typeField.range) {\n <div class=\"slider\">\n\n <cw-button [isDisabled]=\"formControl.value <= rangeOptions.floor\" [label]=\"'Diminuer ' + formControl.value + ' ' + label\"\n [withIcon]=\"spriteIcon.toolbarMinus\" [withOnlyIcon]=\"true\" [type]=\"buttonType.primary\"\n [iconSize]=\"buttonIconSize.small\" (btnAction)=\"onRangeStep('decrease')\">\n </cw-button>\n\n <div class=\"slider-input\">\n <label [for]=\"name\" class=\"slider-tooltip\" [style.left]=\"getRangePercent() + '%'\" aria-live=\"polite\"\n aria-atomic=\"true\">\n {{ label | translate }} {{ formControl.value }}\n @if (rangeOptions.unit) {\n <abbr [title]=\"rangeOptions.unit\">{{ rangeOptions.unit }}</abbr>\n }\n </label>\n\n <div class=\"slider-custom-bar\">\n <div class=\"slider-custom-bar-selection\" [style.width]=\"getRangePercent() + '%'\">\n </div>\n </div>\n\n <input type=\"range\" [id]=\"name\" [formControl]=\"formControl\" [min]=\"rangeOptions.floor\" [max]=\"rangeOptions.ceil\"\n [step]=\"rangeOptions.step || 1\" class=\"field-control-range\" [attr.aria-required]=\"isRequired\"\n [attr.aria-invalid]=\"control.invalid && control.touched\">\n </div>\n\n <cw-button [isDisabled]=\"formControl.value >= rangeOptions.ceil\" [label]=\"'Augmenter ' + formControl.value + ' ' + label\"\n [withIcon]=\"spriteIcon.toolbarPlus\" [withOnlyIcon]=\"true\" [type]=\"buttonType.primary\"\n [iconSize]=\"buttonIconSize.small\" (btnAction)=\"onRangeStep('increase')\">\n </cw-button>\n </div>\n }\n\n @if (isInInputGroup() && clearable && !isDisabledOrReadonly && type !== typeField.autocompleteMultiple) {\n @if (type === typeField.autocomplete) {\n @if (autocompleteRef()?.hasAnyContent()) {\n <button class=\"btn btn-secondary btn-clear-field\" type=\"button\"\n (click)=\"onClearAutocomplete()\">&times;</button>\n }\n } @else if (type === typeField.ngSelectMultiple) {\n <!-- value est un tableau : un [] vide \u00E9tant truthy, on teste .length pour n'afficher le clear global que s'il y a au moins une s\u00E9lection. -->\n @if (formControl?.value?.length) {\n <button class=\"btn btn-ghost btn-clear-field\" type=\"button\"\n (click)=\"onClearField(formControl)\">&times;</button>\n }\n } @else {\n @if(formControl?.value) {\n <button class=\"btn btn-ghost btn-clear-field\" type=\"button\"\n (click)=\"onClearField(formControl)\">&times;</button>\n }\n }\n }\n\n</ng-template>\n" }]
4138
+ ], template: "@if (!isInAddon) {\n @if (\n type !== typeField.checkbox &&\n type !== typeField.radio &&\n type !== typeField.checkboxButton &&\n type !== typeField.radioButton &&\n type !== typeField.checkboxInline &&\n type !== typeField.radioInline &&\n type !== typeField.switch &&\n type !== typeField.range &&\n type !== typeField.switchSmall\n ) {\n <label [for]=\"name\" class=\"field-label\" [class.visually-hidden]=\"!displayLabel\">\n {{ label | translate }}\n\n @if (isRequired) {\n <span class=\"text-danger\">*</span>\n }\n\n @if (tooltip) {\n <!-- <button type=\"button\" class=\"btn btn-link btn-popover\" placement=\"bottom\" [ngbPopover]=\"popContent\" container=\"body\"\n triggers=\"mouseenter:mouseleave\">\n <span class=\"btn-popover-icon bo-icons bo-help\"></span>\n </button>\n <ng-template #popContent>\n <div [innerHTML]=\"tooltip\"></div>\n </ng-template> -->\n }\n </label>\n }\n\n @if (addonLeft || addonRight) {\n <div class=\"field-group\" [class.field-group-invalid]=\"isInvalid\" [class.field-group-disabled]=\"isDisabledOrReadonly\">\n @if(addonLeft) {\n <div class=\"field-group-addon-left\">\n <ng-container [ngTemplateOutlet]=\"addonLeft\"></ng-container>\n </div>\n }\n <ng-container [ngTemplateOutlet]=\"field\"></ng-container>\n @if(addonRight) {\n <div class=\"field-group-addon-right\">\n <ng-container [ngTemplateOutlet]=\"addonRight\"></ng-container>\n </div>\n }\n </div>\n }\n @else {\n @if ( isInInputGroup() ) {\n <div class=\"field-group\" [class.field-group-invalid]=\"isInvalid\" [class.field-group-disabled]=\"isDisabledOrReadonly\">\n <ng-container [ngTemplateOutlet]=\"field\"></ng-container>\n </div>\n }\n @else {\n <ng-container [ngTemplateOutlet]=\"field\"></ng-container>\n }\n }\n\n <!-- Error message -->\n @if (controlOrGroup?.invalid && controlOrGroup?.touched) {\n <div class=\"field-invalid\" [id]=\"'error-' + name\">\n @if (\n !errorMessages?.['required'] &&\n ((controlOrGroup?.errors?.['required']) || (getControl('start')?.errors?.['required'] || getControl('end')?.errors?.['required']))\n ) {\n <span [innerHtml]=\"'_COMMON._FORM.ERROR_IS_MANDATORY' | translate: {label: label | translate}\"></span>\n }\n @if (!errorMessages?.['rangeInvalid'] && controlOrGroup?.errors?.['rangeInvalid']) {\n <span>{{'_COMMON._DATES.ERROR_START_END_PERIOD' | translate}}</span>\n }\n @if (!errorMessages?.['fileExtension'] && controlOrGroup?.errors?.['fileExtension']) {\n <span>{{ '_COMMON._FORM.ERROR_FILE_EXTENSION' | translate: { accept: acceptLabel } }}</span>\n }\n @if (!errorMessages?.['fileSize'] && controlOrGroup?.errors?.['fileSize']) {\n <span>{{ '_COMMON._FORM.ERROR_FILE_SIZE' | translate: { maxSize: maxSizeLabel } }}</span>\n }\n @if (!errorMessages?.['email'] && controlOrGroup?.errors?.['email']) {\n <span>{{ '_COMMON._FORM.ERROR_INVALID_EMAIL' | translate }}</span>\n }\n @if (!errorMessages?.['phone'] && controlOrGroup?.errors?.['phone']) {\n <span>{{ '_COMMON._FORM.ERROR_INVALID_PHONE' | translate }}</span>\n }\n @if (errorMessages) {\n @for (entry of errorMessages | keyvalue: keepOrder; track entry.key) {\n @if (controlOrGroup?.errors?.[entry.key]; as errVal) {\n <span>{{ entry.value | translate: (errVal === true ? null : errVal) }}</span>\n }\n }\n }\n </div>\n }\n\n @if (help || autoHelpEntries.length) {\n <div [id]=\"name + '-help'\" class=\"field-text\">\n @if (help) {\n <span>{{ help | translate }}</span>\n }\n @for (entry of autoHelpEntries; track entry.key) {\n <!-- Espace explicite : les blancs entre balises sont supprim\u00E9s \u00E0 la compilation. -->\n {{ ' ' }}<span>{{ entry.key | translate: entry.params }}</span>\n }\n </div>\n }\n\n <!-- Aper\u00E7u du fichier (type=file, opt-in) : sous le champ et ses aides, comme dans la\n maquette DS. La croix native du champ n'est pas retir\u00E9e \u2014 les deux vident le m\u00EAme\n control, l'aper\u00E7u ajoute juste \u00AB Visualiser \u00BB et une cible plus grande. -->\n @if (isPreviewVisible) {\n <cw-file-preview [file]=\"previewFile\" [existingFile]=\"existingFile ?? null\"\n [disabled]=\"!!isDisabledOrReadonly\" (remove)=\"onPreviewRemove()\" />\n }\n\n <!-- Chips de la multi-s\u00E9lection (autocomplete) : rendus ici, hors du field-group et apr\u00E8s\n erreur/help, pour \u00EAtre visuellement d\u00E9tach\u00E9s du champ. La donn\u00E9e et le retrait restent\n port\u00E9s par cw-autocomplete (`chips()` / `onChipRemove()`), seul l'affichage est d\u00E9l\u00E9gu\u00E9. -->\n @if (type === typeField.autocompleteMultiple && autocompleteRef()?.chips()?.length) {\n <ul class=\"autocomplete-chips\" role=\"list\">\n @for (chip of autocompleteRef()!.chips(); track chip.item) {\n <li>\n <button type=\"button\" class=\"autocomplete-chip\"\n [disabled]=\"isEffectivelyDisabled || isReadonly\"\n (click)=\"autocompleteRef()!.onChipRemove(chip.item)\">\n <span>{{ chip.label }}</span>\n @if (!isEffectivelyDisabled && !isReadonly) {\n <span aria-hidden=\"true\" class=\"autocomplete-chip-x\">&times;</span>\n <span class=\"visually-hidden\">{{ '_COMMON._ACTION.DELETE' | translate }}</span>\n }\n </button>\n </li>\n }\n </ul>\n }\n}\n@else {\n <ng-container [ngTemplateOutlet]=\"field\"></ng-container>\n}\n\n<ng-template #field>\n <!-- Autocomplete (mono / multi) -->\n @if ((type === typeField.autocomplete || type === typeField.autocompleteMultiple) && autocompleteOptions) {\n <cw-autocomplete\n [id]=\"name\"\n [control]=\"formControl\"\n [fetcher]=\"autocompleteOptions.fetcher\"\n [displayField]=\"autocompleteOptions.displayField ?? 'label'\"\n [valueField]=\"autocompleteOptions.valueField ?? 'id'\"\n [columns]=\"autocompleteOptions.columns ?? []\"\n [resolver]=\"autocompleteOptions.resolver ?? null\"\n [selectedItem]=\"autocompleteOptions.selectedItem ?? null\"\n [selectedItems]=\"autocompleteOptions.selectedItems ?? []\"\n [minChars]=\"autocompleteOptions.minChars ?? 2\"\n [debounceMs]=\"autocompleteOptions.debounceMs ?? 250\"\n [multiple]=\"type === typeField.autocompleteMultiple\"\n [isRequired]=\"isRequired\"\n [isReadonly]=\"!!isReadonly\"\n [isDisabled]=\"isEffectivelyDisabled\"\n [ariaInvalid]=\"control.invalid && control.touched\"\n [ariaDescribedBy]=\"getDescribedBy(control)\"\n [placeholder]=\"placeholder\">\n </cw-autocomplete>\n }\n\n <!-- Rich text editor (Quill) : sous-composant interne, sans field-group ni bouton clear\n (il porte sa propre bordure + toolbar). Le label statique du form-field reste au-dessus. -->\n @if (type === typeField.richText) {\n <cw-rich-text-editor\n [id]=\"name\"\n [control]=\"formControl\"\n [options]=\"richTextOptions\"\n [placeholder]=\"placeholder ? (placeholder | translate) : ''\"\n [isRequired]=\"isRequired\"\n [isReadonly]=\"!!isReadonly\"\n [isDisabled]=\"isEffectivelyDisabled\"\n [ariaInvalid]=\"control.invalid && control.touched\"\n [ariaDescribedBy]=\"getDescribedBy(control)\">\n </cw-rich-text-editor>\n }\n\n <!-- Text -->\n @if ([typeField.text, typeField.date, typeField.time, typeField.dateTime, typeField.number,\n typeField.email,\n typeField.color, typeField.zipCode].includes(type)) {\n <input [type]=\"type === typeField.zipCode ? 'text' : type\" class=\"field-control\" [id]=\"name\" [formControl]=\"formControl\"\n [ngClass]=\"[(cssClass || ''), formControl?.value ? 'has-value' : '', type === typeField.zipCode ? 'field-control-zipcode' : '']\"\n [attr.placeholder]=\"placeholder ? (placeholder | translate) : null\" [attr.required]=\"isRequired ? 'required' : null\"\n [attr.readonly]=\"isReadonly ? 'readonly' : null\" [attr.aria-required]=\"isRequired\"\n [attr.minlength]=\"minLengthAttr\" [attr.maxlength]=\"maxLengthAttr\"\n [attr.min]=\"minAttr\" [attr.max]=\"maxAttr\" [attr.step]=\"stepAttr\" [attr.pattern]=\"patternAttr\"\n [attr.autocomplete]=\"autocomplete\"\n [attr.aria-invalid]=\"control.invalid && control.touched\"\n [attr.aria-describedby]=\"getDescribedBy(control)\"\n (focus)=\"onFocus()\" (blur)=\"onBlur()\" />\n }\n\n <!-- Phone (intl-tel-input) -->\n @if (type === typeField.phone) {\n <input #phoneInput type=\"tel\" class=\"field-control\" [id]=\"name\"\n [attr.placeholder]=\"placeholder ? (placeholder | translate) : null\" [attr.required]=\"isRequired ? 'required' : null\"\n [attr.readonly]=\"isReadonly ? 'readonly' : null\" [disabled]=\"isEffectivelyDisabled\" [attr.aria-required]=\"isRequired\"\n [attr.autocomplete]=\"autocomplete\"\n [attr.aria-invalid]=\"control.invalid && control.touched\"\n [attr.aria-describedby]=\"getDescribedBy(control)\"\n (focus)=\"onFocus()\" (blur)=\"onPhoneBlur($event)\" />\n }\n\n <!-- File -->\n @if (type === typeField.file) {\n <!-- L'input natif reste LE controle (focus, clavier, restitution aux lecteurs d'ecran,\n validation), mais il est masque visuellement : le libelle de son bouton et son\n \u00AB aucun fichier choisi \u00BB sont ecrits par le NAVIGATEUR, dans SA langue. Ils sont\n intraduisibles et ne suivent pas la langue de l'application \u2014 un utilisateur qui\n bascule en anglais garderait \u00AB Choisir un fichier \u00BB. On les reecrit donc a cote,\n traduits, dans une couche purement visuelle. -->\n <input #fileInput type=\"file\" class=\"field-control visually-hidden\" [id]=\"name\"\n [ngClass]=\"[(cssClass || ''), formControl?.value ? 'has-value' : '']\"\n [attr.required]=\"isRequired ? 'required' : null\"\n [attr.readonly]=\"isReadonly ? 'readonly' : null\" [disabled]=\"isEffectivelyDisabled\" [attr.aria-required]=\"isRequired\"\n [attr.accept]=\"acceptAttr\"\n [attr.aria-invalid]=\"control.invalid && control.touched\"\n [attr.aria-describedby]=\"getDescribedBy(control)\"\n (change)=\"onFileChange($event)\" (focus)=\"onFocus()\" (blur)=\"onBlur()\" />\n\n <!-- `aria-hidden` : doublon visuel de l'input, que les lecteurs d'ecran restituent deja\n (nom du champ, bouton de parcours, fichier selectionne). L'annoncer une seconde fois\n ne ferait que bavarder. Le clic est relaye a l'input, le clavier passe par lui. -->\n <span class=\"field-file\" aria-hidden=\"true\" (click)=\"openFilePicker()\">\n <span class=\"field-file-button\">{{ '_COMMON._FORM.CHOOSE_FILE' | translate }}</span>\n <span class=\"field-file-name\" [class.field-file-name-empty]=\"!selectedFileName\">\n {{ selectedFileName ?? ('_COMMON._FORM.NO_FILE_SELECTED' | translate) }}\n </span>\n </span>\n }\n\n @if (type === typeField.password) {\n <input [type]=\"isPasswordShown ? 'text' : 'password'\" class=\"field-control\" [id]=\"name\" [formControl]=\"formControl\"\n [ngClass]=\"[(cssClass || ''), formControl?.value ? 'has-value' : '']\"\n [attr.required]=\"isRequired ? 'required' : null\" [attr.readonly]=\"isReadonly ? 'readonly' : null\"\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\" [attr.aria-required]=\"isRequired\"\n [attr.minlength]=\"minLengthAttr\" [attr.maxlength]=\"maxLengthAttr\" [attr.pattern]=\"patternAttr\"\n [attr.autocomplete]=\"autocomplete\"\n [attr.aria-invalid]=\"control.invalid && control.touched\"\n [attr.aria-describedby]=\"getDescribedBy(control)\"\n (focus)=\"onFocus()\" (blur)=\"onBlur()\" />\n <cw-button [type]=\"buttonType.ghost\"\n cssClass=\"btn-password-field\"\n [withIcon]=\"isPasswordShown ? spriteIcon.toolbarHidePassword : spriteIcon.toolbarShowPassword\"\n [withOnlyIcon]=\"true\"\n [label]=\"isPasswordShown ? '_COMMON._FORM._SHOW_HIDE_PWD.HIDE' : '_COMMON._FORM._SHOW_HIDE_PWD.SHOW'\"\n (btnAction)=\"togglePasswordVisibility()\">\n </cw-button>\n }\n\n <!-- Textarea -->\n @if (type === typeField.textarea) {\n <textarea class=\"field-control\" [id]=\"name\" [formControl]=\"formControl\"\n [ngClass]=\"[(cssClass || ''), formControl?.value ? 'has-value' : '']\"\n [attr.placeholder]=\"placeholder ? (placeholder | translate) : null\" [attr.required]=\"isRequired ? 'required' : null\"\n [attr.readonly]=\"isReadonly ? 'readonly' : null\" [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\"\n [attr.aria-required]=\"isRequired\" [attr.aria-invalid]=\"control.invalid && control.touched\"\n [attr.minlength]=\"minLengthAttr\" [attr.maxlength]=\"maxLengthAttr\" [attr.pattern]=\"patternAttr\"\n [attr.autocomplete]=\"autocomplete\"\n [attr.aria-describedby]=\"getDescribedBy(control)\"\n (focus)=\"onFocus()\" (blur)=\"onBlur()\"></textarea>\n }\n\n <!-- Select -->\n @if (type === typeField.select) {\n <ng-select [formControl]=\"formControl\" [items]=\"options\" bindLabel=\"label\" [labelForId]=\"name\" [appendTo]=\"appendTo ?? ''\" bindValue=\"value\"\n [ngClass]=\"cssClass\" [searchable]=\"false\" [placeholder]=\"placeholder ? (placeholder | translate) : ''\" [readonly]=\"isReadonly\" [clearable]=\"false\"\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\" [attr.required]=\"isRequired ? 'required' : null\"\n [attr.aria-required]=\"isRequired\" [attr.aria-invalid]=\"control.invalid && control.touched\"\n [attr.aria-describedby]=\"getDescribedBy(control)\" [attr.id]=\"name\"\n (focus)=\"onFocus()\" (blur)=\"onBlur()\">\n\n <!-- Template pour les options -->\n <ng-template ng-option-tmp let-item=\"item\" let-index=\"index\" let-search=\"searchTerm\">\n @if (optionTemplate) {\n <ng-container *ngTemplateOutlet=\"optionTemplate; context: { item: item | translate, index: index, searchTerm: search }\"></ng-container>\n }\n @else {\n <div>{{ item.label | translate }}</div>\n }\n </ng-template>\n\n <!-- Template pour le label -->\n <ng-template ng-label-tmp let-item=\"item\">\n @if (labelTemplate) {\n <ng-container *ngTemplateOutlet=\"labelTemplate; context: { item: item | translate }\"></ng-container>\n }\n @else {\n {{ (item.label | translate) || (placeholder | translate) }}\n }\n </ng-template>\n </ng-select>\n }\n\n <!-- NgSelect -->\n @if (type === typeField.ngSelect || type === typeField.ngSelectMultiple) {\n <ng-select [formControl]=\"formControl\" [items]=\"options\" bindLabel=\"label\" [labelForId]=\"name\" [appendTo]=\"appendTo ?? ''\" bindValue=\"value\"\n [multiple]=\"type === typeField.ngSelectMultiple\" [ngClass]=\"cssClass\" [clearable]=\"false\"\n [placeholder]=\"placeholder ? (placeholder | translate) : ''\" [readonly]=\"isReadonly\"\n [notFoundText]=\"'_COMMON.NO_RESULT' | translate\" [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\"\n [attr.required]=\"isRequired ? 'required' : null\" [attr.aria-required]=\"isRequired\"\n [attr.aria-invalid]=\"control.invalid && control.touched\"\n [attr.aria-describedby]=\"getDescribedBy(control)\" [attr.id]=\"name\"\n (focus)=\"onFocus()\" (blur)=\"onBlur()\" (search)=\"textChanged.emit($event?.term)\">\n\n <!-- Template pour les options -->\n <ng-template ng-option-tmp let-item=\"item\" let-index=\"index\" let-search=\"searchTerm\">\n @if (optionTemplate) {\n <ng-container *ngTemplateOutlet=\"optionTemplate; context: { item: item, index: index, searchTerm: search }\"></ng-container>\n }\n @else {\n <div>{{ item.label | translate }}</div>\n }\n </ng-template>\n\n <!-- Template pour le label -->\n <ng-template ng-label-tmp let-item=\"item\" let-clear=\"clear\">\n <span class=\"ng-value-icon left\" (click)=\"clear(item)\" aria-hidden=\"true\">\u00D7</span>\n @if (labelTemplate) {\n <ng-container *ngTemplateOutlet=\"labelTemplate; context: { item: item | translate }\"></ng-container>\n }\n @else {\n {{ (item.label | translate) || (placeholder | translate) }}\n }\n </ng-template>\n </ng-select>\n }\n\n <!-- Radio -->\n @if (type === typeField.radioInline || type === typeField.radio) {\n <fieldset\n [attr.aria-required]=\"isRequired\"\n [attr.aria-invalid]=\"control.invalid && control.touched\"\n [attr.aria-describedby]=\"getDescribedBy(control)\">\n <legend class=\"field-label\" [class.visually-hidden]=\"!displayLabel\">\n {{label | translate}}\n @if(isRequired) {\n <span class=\"text-danger\">*</span>\n }\n </legend>\n <ul class=\"list-unstyled mb-none\" [ngClass]=\"type === typeField.radioInline ? 'd-flex-h gap-md flex-wrap' : 'd-flex-v'\">\n @for (opt of options; track opt.value) {\n <li class=\"field-check\">\n <input type=\"radio\" [id]=\"name + '_' + opt.value\" [value]=\"opt.value\" [formControl]=\"formControl\"\n class=\"field-check-input\" [attr.disabled]=\"(isEffectivelyDisabled || opt.disabled) ? 'disabled' : null\" (change)=\"onRadioChange(opt.value)\" />\n <label [for]=\"name + '_' + opt.value\" class=\"field-check-label\">{{ opt.label | translate }}</label>\n </li>\n }\n </ul>\n </fieldset>\n }\n\n <!-- Radio button -->\n @if (type === typeField.radioButton) {\n <fieldset\n [attr.aria-required]=\"isRequired\"\n [attr.aria-invalid]=\"control.invalid && control.touched\"\n [attr.aria-describedby]=\"getDescribedBy(control)\">\n <legend class=\"field-label\" [class.visually-hidden]=\"!displayLabel\">\n {{label | translate}}\n @if(isRequired) {\n <span class=\"text-danger\">*</span>\n }\n </legend>\n <div class=\"field-group field-group-btn\">\n @for (opt of options; track opt.value) {\n <input type=\"radio\" [id]=\"name + '_' + opt.value\" [value]=\"opt.value\" [formControl]=\"formControl\"\n class=\"visually-hidden\" [attr.disabled]=\"(isEffectivelyDisabled || opt.disabled) ? 'disabled' : null\" (change)=\"onRadioChange(opt.value)\"/>\n <label [for]=\"name + '_' + opt.value\" class=\"btn btn-field-group\">{{ opt.label | translate }}</label>\n }\n </div>\n </fieldset>\n }\n\n <!-- Checkbox Switch -->\n @if ( type === typeField.switch || type === typeField.switchSmall)\n {\n <div class=\"field-check field-switch\" [ngClass]=\"{'field-switch-small': type === typeField.switchSmall}\">\n <input type=\"checkbox\" [id]=\"name\" [formControl]=\"formControl\" class=\"field-check-input\" [attr.aria-required]=\"isRequired\"\n [attr.aria-invalid]=\"control.invalid && control.touched\"\n [attr.aria-describedby]=\"getDescribedBy(control)\"\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\"/>\n <label [for]=\"name\" class=\"field-check-label\">{{ label | translate }}</label>\n </div>\n }\n\n <!-- Checkbox -->\n @if (type === typeField.checkboxInline || type === typeField.checkbox) {\n @if (isSingleCheckbox()) {\n <div class=\"field-check\" [class.field-check-inline]=\"type === typeField.checkboxInline\">\n <input #checkboxInput type=\"checkbox\" [id]=\"name\" [formControl]=\"formControl\"\n class=\"field-check-input\"\n [class.is-invalid]=\"control?.invalid && control?.touched\"\n [attr.aria-required]=\"isRequired\"\n [attr.aria-invalid]=\"control?.invalid && control?.touched\"\n [attr.aria-describedby]=\"getDescribedBy(control)\"\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\" />\n <label [for]=\"name\" class=\"field-check-label\">\n {{ label | translate }}\n @if (isRequired) {\n <span class=\"text-danger\">*</span>\n }\n </label>\n </div>\n }\n @else if( options.length > 1) {\n <fieldset\n [attr.aria-required]=\"isRequired\"\n [attr.aria-invalid]=\"control.invalid && control.touched\"\n [attr.aria-describedby]=\"getDescribedBy(control)\"\n [ngClass]=\"{ 'flex-column': type === typeField.checkbox }\">\n <legend class=\"field-label\" [class.visually-hidden]=\"!displayLabel\">\n {{label | translate}}\n @if(isRequired) {\n <span class=\"text-danger\">*</span>\n }\n </legend>\n <ul class=\"list-unstyled mb-none\" [ngClass]=\"type === typeField.checkboxInline ? 'd-flex-h gap-md' : 'd-flex-v'\">\n @for (opt of options; track opt.value) {\n <li class=\"field-check\" [ngClass]=\"{ 'field-check-inline': type === typeField.checkboxInline }\">\n <input type=\"checkbox\" [id]=\"name + '_' + opt.value\" [value]=\"opt.value\" (change)=\"onCheckboxChange($event)\"\n [checked]=\"control.value?.includes(opt.value)\" class=\"field-check-input\"\n [attr.disabled]=\"(isEffectivelyDisabled || opt.disabled) ? 'disabled' : null\" />\n <label [for]=\"name + '_' + opt.value\" class=\"field-check-label\">\n {{ opt.label | translate }}\n </label>\n </li>\n }\n </ul>\n </fieldset>\n }\n @else {\n <fieldset>\n <legend class=\"field-label\" [class.visually-hidden]=\"!displayLabel\">\n {{label | translate}}\n </legend>\n <ul class=\"list-unstyled mb-none\" [ngClass]=\"type === typeField.checkboxInline ? 'd-flex-h gap-md' : 'd-flex-v'\">\n @for (opt of options; track opt.value) {\n <li class=\"field-check\" [ngClass]=\"{ 'field-check-inline': type === typeField.checkboxInline }\">\n <input type=\"checkbox\" [id]=\"name + '_' + opt.value\" [value]=\"opt.value\" (change)=\"onCheckboxChange($event)\"\n [checked]=\"control.value?.includes(opt.value)\" class=\"field-check-input\"\n [attr.aria-required]=\"isRequired\"\n [attr.aria-invalid]=\"control.invalid && control.touched\"\n [attr.aria-describedby]=\"getDescribedBy(control)\"\n [attr.disabled]=\"(isEffectivelyDisabled || opt.disabled) ? 'disabled' : null\" />\n <label [for]=\"name + '_' + opt.value\" class=\"field-check-label\">\n {{ opt.label | translate }}\n @if(isRequired) {\n <span class=\"text-danger\">*</span>\n }\n </label>\n </li>\n }\n </ul>\n </fieldset>\n }\n }\n\n <!-- Checkbox button -->\n @if (type === typeField.checkboxButton && options.length > 0) {\n\n @if(options.length > 1) {\n <fieldset\n [attr.aria-required]=\"isRequired\"\n [attr.aria-invalid]=\"control.invalid && control.touched\"\n [attr.aria-describedby]=\"getDescribedBy(control)\">\n <legend class=\"field-label\" [class.visually-hidden]=\"!displayLabel\">\n {{label | translate}}\n @if(isRequired) {\n <span class=\"text-danger\">*</span>\n }\n </legend>\n <div class=\"field-group field-group-btn\">\n @for (opt of options; track opt.value) {\n <input type=\"checkbox\" [id]=\"name + '_' + opt.value\" [value]=\"opt.value\" (change)=\"onCheckboxChange($event)\"\n [checked]=\"control.value?.includes(opt.value)\" class=\"visually-hidden\"\n [attr.disabled]=\"(isEffectivelyDisabled || opt.disabled) ? 'disabled' : null\" />\n <label [for]=\"name + '_' + opt.value\" class=\"btn btn-field-group\">{{ opt.label | translate }}</label>\n }\n </div>\n </fieldset>\n }\n @else {\n <fieldset>\n <legend class=\"field-label\" [class.visually-hidden]=\"!displayLabel\">\n {{label | translate}}\n </legend>\n <div class=\"btn-group btn-group-secondary\">\n @for (opt of options; track opt.value) {\n <input type=\"checkbox\" [id]=\"name + '_' + opt.value\" [value]=\"opt.value\" (change)=\"onCheckboxChange($event)\"\n [checked]=\"control.value?.includes(opt.value)\" class=\"visually-hidden\"\n [attr.aria-required]=\"isRequired\"\n [attr.aria-invalid]=\"control.invalid && control.touched\"\n [attr.aria-describedby]=\"getDescribedBy(control)\"\n [attr.disabled]=\"(isEffectivelyDisabled || opt.disabled) ? 'disabled' : null\"/>\n <label [for]=\"name + '_' + opt.value\" class=\"btn btn-field-group\">\n {{ opt.label | translate}}\n @if(isRequired) {\n <span class=\"text-danger\">*</span>\n }\n </label>\n }\n </div>\n </fieldset>\n }\n }\n\n <!-- Period - DateToDate / TimeToTime / DateTimeToDateTime -->\n @if ([typeField.dateToDate, typeField.timeToTime, typeField.dateTimeToDateTime].includes(type) && isRange) {\n\n <div class=\"field-group\">\n <div class=\"field-group-addon-left\">Du</div>\n <input [type]=\"getInputType()\" class=\"field-control\" [id]=\"name + '_start'\" [formControl]=\"getControl('start')!\"\n [attr.placeholder]=\"type === typeField.timeToTime ? ('_COMMON._DATES.FROM' | translate) : ('_COMMON._DATES.FROM_TO_1' | translate)\"\n [ngClass]=\"[(cssClass || ''), getControl('start')?.value ? 'has-value' : '']\"\n [attr.required]=\"isRequired ? 'required' : null\" [attr.readonly]=\"isReadonly ? 'readonly' : null\"\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\" [attr.aria-required]=\"isRequired\"\n [attr.min]=\"minStartAttr\" [attr.max]=\"maxStartAttr\" [attr.step]=\"stepAttr\"\n [attr.autocomplete]=\"autocomplete\"\n [attr.aria-invalid]=\"getControl('start')?.invalid && getControl('start')?.touched\"\n [attr.aria-describedby]=\"getDescribedBy(getControl('start'))\"\n (focus)=\"onFocusRange('start')\" (blur)=\"onBlurRange('start')\" />\n\n @if(getControl('start')?.value && !isDisabledOrReadonly) {\n <button type=\"button\" class=\"btn btn-secondary btn-clear-field\"\n (click)=\"onClearFieldPeriod('start')\">\n &times;\n </button>\n }\n <div class=\"field-group-addon-center\">au</div>\n <input [type]=\"getInputType()\" class=\"field-control\" [id]=\"name + '_end'\" [formControl]=\"getControl('end')!\"\n [attr.placeholder]=\"type === typeField.timeToTime ? ('_COMMON._DATES.TO' | translate) : ('_COMMON._DATES.FROM_TO_2' | translate)\"\n [ngClass]=\"[(cssClass || ''), getControl('end')?.value ? 'has-value' : '']\"\n [attr.required]=\"isRequired ? 'required' : null\" [attr.readonly]=\"isReadonly ? 'readonly' : null\"\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\"\n [attr.min]=\"minEndAttr\" [attr.max]=\"maxEndAttr\" [attr.step]=\"stepAttr\"\n [attr.autocomplete]=\"autocomplete\"\n [attr.aria-invalid]=\"getControl('end')?.invalid && getControl('end')?.touched\"\n [attr.aria-describedby]=\"getDescribedBy(getControl('end'))\"\n (focus)=\"onFocusRange('end')\" (blur)=\"onBlurRange('end')\" />\n\n @if(getControl('end')?.value && !isDisabledOrReadonly) {\n <button type=\"button\" class=\"btn btn-ghost btn-clear-field\"\n (click)=\"onClearFieldPeriod('end')\">\n &times;\n </button>\n }\n </div>\n }\n\n @if ([typeField.datePlusOne, typeField.datePlusTwo, typeField.datePlusSeven, typeField.dateComplexe].includes(type)) {\n\n <div class=\"field-group\">\n @if (type === typeField.dateComplexe) {\n <div class=\"field-group-addon-left\">\n <button class=\"btn btn-ghost\" type=\"button\" (click)=\"onDateAddDay('prev')\"\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\">\n <cw-icon font=\"optyweb\" [icon]=\"spriteIcon.nextLeft\" [label]=\"'Jour pr\u00E9c\u00E9dent'\"></cw-icon>\n </button>\n </div>\n }\n\n <input type=\"date\" class=\"field-control\" [id]=\"name\" [formControl]=\"formControl\"\n [ngClass]=\"[(cssClass || ''), formControl?.value ? 'has-value' : '']\"\n [attr.placeholder]=\"placeholder ? placeholder : null\" [attr.required]=\"isRequired ? 'required' : null\"\n [attr.readonly]=\"isReadonly ? 'readonly' : null\" [attr.aria-required]=\"isRequired\"\n [attr.min]=\"minAttr\" [attr.max]=\"maxAttr\" [attr.step]=\"stepAttr\"\n [attr.autocomplete]=\"autocomplete\"\n [attr.aria-invalid]=\"control.invalid && control.touched\"\n [attr.aria-describedby]=\"getDescribedBy(control)\"\n (focus)=\"onFocus()\" (blur)=\"onBlur()\" />\n\n @if(formControl?.value && !isDisabledOrReadonly) {\n <button class=\"btn btn-ghost btn-clear-field\" type=\"button\"\n (click)=\"onClearField(formControl)\">&times;</button>\n }\n\n\n @if (type === typeField.dateComplexe) {\n <div class=\"field-group-addon-right\">\n <button class=\"btn btn-ghost\" type=\"button\" (click)=\"onDateAddDay('next')\"\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\">\n <cw-icon font=\"optyweb\" [icon]=\"spriteIcon.nextRight\" [label]=\"'Jour suivant'\"></cw-icon>\n </button>\n </div>\n <div class=\"field-group-addon-right\">\n <button class=\"btn btn-ghost\" type=\"button\" (click)=\"onRefresh()\"\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\">\n <cw-icon font=\"optyweb\" [icon]=\"spriteIcon.toolbarRefresh\" [label]=\"'Rafra\u00EEchir'\"></cw-icon>\n </button>\n </div>\n }\n\n <div class=\"field-group-addon-right\">\n <button class=\"btn btn-ghost\" type=\"button\" (click)=\"onTodayAddDay(0)\"\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\">\n J\n <span class=\"visually-hidden\">Aujourd'hui</span>\n </button>\n </div>\n <div class=\"field-group-addon-right\">\n <button class=\"btn btn-ghost\" type=\"button\" (click)=\"onTodayAddDay(1)\"\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\">\n J+1\n <span class=\"visually-hidden\">Demain</span>\n </button>\n </div>\n\n @if (type !== typeField.datePlusOne && type !== typeField.dateComplexe) {\n <div class=\"field-group-addon-right\">\n <button class=\"btn btn-ghost \" type=\"button\" (click)=\"onTodayAddDay(2)\"\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\">\n J+2\n <span class=\"visually-hidden\">Dans 2 jours</span>\n </button>\n </div>\n\n @if (type !== typeField.datePlusTwo) {\n <div class=\"field-group-addon-right\">\n <button class=\"btn btn-ghost\" type=\"button\" (click)=\"onTodayAddDay(7)\"\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\">\n J+7\n <span class=\"visually-hidden\">Dans 7 jours</span>\n </button>\n </div>\n }\n }\n </div>\n }\n\n @if (type === typeField.slider) {\n <ngx-slider [(value)]=\"sliderValue\" [options]=\"sliderOptions\" [formControl]=\"formControl\"></ngx-slider>\n }\n\n @if (type === typeField.range) {\n <div class=\"slider\">\n\n <cw-button [isDisabled]=\"formControl.value <= rangeOptions.floor\" [label]=\"'Diminuer ' + formControl.value + ' ' + label\"\n [withIcon]=\"spriteIcon.toolbarMinus\" [withOnlyIcon]=\"true\" [type]=\"buttonType.primary\"\n [iconSize]=\"buttonIconSize.small\" (btnAction)=\"onRangeStep('decrease')\">\n </cw-button>\n\n <div class=\"slider-input\">\n <label [for]=\"name\" class=\"slider-tooltip\" [style.left]=\"getRangePercent() + '%'\" aria-live=\"polite\"\n aria-atomic=\"true\">\n {{ label | translate }} {{ formControl.value }}\n @if (rangeOptions.unit) {\n <abbr [title]=\"rangeOptions.unit\">{{ rangeOptions.unit }}</abbr>\n }\n </label>\n\n <div class=\"slider-custom-bar\">\n <div class=\"slider-custom-bar-selection\" [style.width]=\"getRangePercent() + '%'\">\n </div>\n </div>\n\n <input type=\"range\" [id]=\"name\" [formControl]=\"formControl\" [min]=\"rangeOptions.floor\" [max]=\"rangeOptions.ceil\"\n [step]=\"rangeOptions.step || 1\" class=\"field-control-range\" [attr.aria-required]=\"isRequired\"\n [attr.aria-invalid]=\"control.invalid && control.touched\">\n </div>\n\n <cw-button [isDisabled]=\"formControl.value >= rangeOptions.ceil\" [label]=\"'Augmenter ' + formControl.value + ' ' + label\"\n [withIcon]=\"spriteIcon.toolbarPlus\" [withOnlyIcon]=\"true\" [type]=\"buttonType.primary\"\n [iconSize]=\"buttonIconSize.small\" (btnAction)=\"onRangeStep('increase')\">\n </cw-button>\n </div>\n }\n\n @if (isInInputGroup() && clearable && !isDisabledOrReadonly && type !== typeField.autocompleteMultiple) {\n @if (type === typeField.autocomplete) {\n @if (autocompleteRef()?.hasAnyContent()) {\n <button class=\"btn btn-secondary btn-clear-field\" type=\"button\"\n (click)=\"onClearAutocomplete()\">&times;</button>\n }\n } @else if (type === typeField.ngSelectMultiple) {\n <!-- value est un tableau : un [] vide \u00E9tant truthy, on teste .length pour n'afficher le clear global que s'il y a au moins une s\u00E9lection. -->\n @if (formControl?.value?.length) {\n <button class=\"btn btn-ghost btn-clear-field\" type=\"button\"\n (click)=\"onClearField(formControl)\">&times;</button>\n }\n } @else {\n @if(formControl?.value) {\n <button class=\"btn btn-ghost btn-clear-field\" type=\"button\"\n (click)=\"onClearField(formControl)\">&times;</button>\n }\n }\n }\n\n</ng-template>\n" }]
4126
4139
  }], ctorParameters: () => [], propDecorators: { control: [{
4127
4140
  type: Input
4128
4141
  }], formGroup: [{
@@ -4438,6 +4451,13 @@ class ModalsComponent {
4438
4451
  this.renderer = inject(Renderer2);
4439
4452
  this.destroyRef = inject(DestroyRef);
4440
4453
  this.modalContainer = viewChild.required('modalContainer');
4454
+ /**
4455
+ * Id du titre, unique par instance : `aria-labelledby` du dialog le reference, et
4456
+ * plusieurs modales coexistent dans le DOM (pile). Auparavant `modal-basic-title`
4457
+ * en dur — deux modales empilees produisaient deux elements de meme id, et le
4458
+ * `aria-labelledby` de la seconde resolvait sur le titre de la premiere.
4459
+ */
4460
+ this.titleId = `modal-title-${Math.random().toString(36).substring(2, 11)}`;
4441
4461
  this.size = input(ModalsSize.md, ...(ngDevMode ? [{ debugName: "size" }] : []));
4442
4462
  this.customClass = input('', ...(ngDevMode ? [{ debugName: "customClass" }] : []));
4443
4463
  this.scrollable = input(false, ...(ngDevMode ? [{ debugName: "scrollable" }] : []));
@@ -4663,11 +4683,11 @@ class ModalsComponent {
4663
4683
  this.destroyRef.onDestroy(unlisten);
4664
4684
  }
4665
4685
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: ModalsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
4666
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.20", type: ModalsComponent, isStandalone: true, selector: "cw-modals", inputs: { size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, customClass: { classPropertyName: "customClass", publicName: "customClass", isSignal: true, isRequired: false, transformFunction: null }, scrollable: { classPropertyName: "scrollable", publicName: "scrollable", isSignal: true, isRequired: false, transformFunction: null }, isAutcompModal: { classPropertyName: "isAutcompModal", publicName: "isAutcompModal", isSignal: true, isRequired: false, transformFunction: null }, type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: true, transformFunction: null }, state: { classPropertyName: "state", publicName: "state", isSignal: true, isRequired: false, transformFunction: null }, textType: { classPropertyName: "textType", publicName: "textType", isSignal: true, isRequired: false, transformFunction: null }, modalTitle: { classPropertyName: "modalTitle", publicName: "modalTitle", isSignal: true, isRequired: false, transformFunction: null }, itemsToDelete: { classPropertyName: "itemsToDelete", publicName: "itemsToDelete", isSignal: true, isRequired: false, transformFunction: null }, itemsToDeleteTitle: { classPropertyName: "itemsToDeleteTitle", publicName: "itemsToDeleteTitle", isSignal: true, isRequired: false, transformFunction: null }, labelBtnAction1: { classPropertyName: "labelBtnAction1", publicName: "labelBtnAction1", isSignal: true, isRequired: false, transformFunction: null }, labelBtnAction2: { classPropertyName: "labelBtnAction2", publicName: "labelBtnAction2", isSignal: true, isRequired: false, transformFunction: null }, disableBtnAction1: { classPropertyName: "disableBtnAction1", publicName: "disableBtnAction1", isSignal: true, isRequired: false, transformFunction: null }, disableBtnAction2: { classPropertyName: "disableBtnAction2", publicName: "disableBtnAction2", isSignal: true, isRequired: false, transformFunction: null }, customBodyTemplate: { classPropertyName: "customBodyTemplate", publicName: "customBodyTemplate", isSignal: true, isRequired: false, transformFunction: null }, customBodyContext: { classPropertyName: "customBodyContext", publicName: "customBodyContext", isSignal: true, isRequired: false, transformFunction: null }, closeLocked: { classPropertyName: "closeLocked", publicName: "closeLocked", isSignal: true, isRequired: false, transformFunction: null }, closeLockedMessage: { classPropertyName: "closeLockedMessage", publicName: "closeLockedMessage", isSignal: true, isRequired: false, transformFunction: null }, keepOpenOnAction1: { classPropertyName: "keepOpenOnAction1", publicName: "keepOpenOnAction1", isSignal: true, isRequired: false, transformFunction: null }, keepOpenOnAction2: { classPropertyName: "keepOpenOnAction2", publicName: "keepOpenOnAction2", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { btnAction1: "btnAction1", btnAction2: "btnAction2" }, viewQueries: [{ propertyName: "modalContainer", first: true, predicate: ["modalContainer"], descendants: true, isSignal: true }], ngImport: i0, template: "<div class=\"cityway-v8 modal-backdrop fade show\" style=\"z-index: 1050;\" aria-hidden=\"true\"></div>\n\n<div role=\"dialog\" tabindex=\"-1\" aria-modal=\"true\"\n [attr.aria-labelledby]=\"type() === modalsType.loader ? null : 'modal-basic-title'\"\n [attr.aria-label]=\"type() === modalsType.loader ? ('_COMMON._HTTP.TXT_LOADING' | translate) : null\"\n class=\"cityway-v8 d-flex modal show\" [ngClass]=\"customClass()\" data-test-ctw=\"modal\" (keydown)=\"onKeyDown($event)\">\n\n <!-- Backdrop : fermeture a la souris (confort). Le clavier (Escape) est gere\n par onKeyDown du dialog ; le backdrop n'est pas un element interactif focusable.\n requestClose() applique le verrou (cf. isCloseLocked) : plus de test sur le type ici. -->\n <!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events, @angular-eslint/template/interactive-supports-focus -->\n <div class=\"modal-inner-backdrop\" (click)=\"requestClose()\"></div>\n\n <div #modalContainer role=\"document\" class=\"modal-dialog modal-dialog-centered\"\n [ngClass]=\"['modal-' + size(), scrollable() ? 'modal-dialog-scrollable' : '']\">\n\n <div class=\"modal-content\">\n\n <!-- Verrou actif : region live qui annonce chaque tentative de fermeture refusee\n (Echap, backdrop, croix). Rendue vide au repos car une region live doit\n pre-exister dans le DOM pour que son remplissage soit annonce. Absente pour\n le loader, qui possede deja la sienne dans cw-loader. -->\n @if (showCloseLockedStatus()) {\n <span class=\"visually-hidden\" role=\"status\" aria-live=\"polite\">{{ closeLockedAnnouncement() | translate }}</span>\n }\n\n @if (type() === modalsType.loader) {\n <div class=\"modal-body\">\n <cw-loader></cw-loader>\n </div>\n }\n @else {\n @if (isStateLike()) {\n <!-- state + delete : close en absolu (top-right, hors flux donc ne reserve\n pas de hauteur), body centre avec le picto de statut EN TETE du flux\n (il pousse donc le titre normalement) -->\n <!-- aria-disabled + .disabled (Bootstrap) plutot que `disabled` natif : la croix\n reste focusable et annoncee \u00AB desactivee \u00BB, et le focus trap conserve une\n cible. Un `disabled` natif la sortirait du selecteur de focusables. -->\n <button type=\"button\" class=\"btn-close modal-close-floating\" [attr.aria-label]=\"'_COMMON._ACTION.CLOSE' | translate\"\n [class.disabled]=\"isCloseLocked()\" [attr.aria-disabled]=\"isCloseLocked() ? 'true' : null\"\n (click)=\"requestClose()\" data-test-ctw=\"btn-close-modal\">\n <cw-icon [icon]=\"spriteIcon.toolbarClose\" [iconSize]=\"iconSize['lg']\" [type]=\"iconType.default\" aria-hidden=\"true\"></cw-icon>\n </button>\n\n <div class=\"modal-body modal-body-state d-flex-v gap-md items-center\" [class.modal-text-center]=\"isBodyCentered()\">\n <cw-icon [icon]=\"statusIcon()\" [iconSize]=\"iconSize['xl']\" [type]=\"iconType.square\"\n [iconUiType]=\"statusUiType()\" aria-hidden=\"true\"></cw-icon>\n\n <h1 class=\"modal-title\" id=\"modal-basic-title\">\n @if (type() === modalsType.delete) {\n {{ '_COMMON._MODAL_DELETE.TITLE' | translate: { number: itemsToDelete().length, name: itemsToDeleteTitle() | translate } }}\n }\n @else {\n {{ (modalTitle() ?? '') | translate }}\n }\n </h1>\n\n @if (type() === modalsType.delete) {\n <!-- zone delete en dur : texte + liste + avertissement, pleine largeur aligne a gauche -->\n <div class=\"w-100 d-flex-v gap-md\">\n @if (itemsToDelete().length > 1) {\n <div [innerHTML]=\"'_COMMON._MODAL_DELETE.MULTIPLE_TEXT' | translate\"></div>\n }\n @else {\n <div [innerHTML]=\"'_COMMON._MODAL_DELETE.SIMPLE_TEXT' | translate\"></div>\n }\n\n @if (itemsToDelete().length > 0) {\n <ul class=\"mb-none\">\n @for (item of itemsToDelete(); track item) {\n <li>{{ item }}</li>\n }\n </ul>\n }\n\n <div [innerHTML]=\"'_COMMON._MODAL_DELETE.IRREVERSIBLE' | translate\"></div>\n </div>\n }\n\n @if (customBodyTemplate()) {\n <div class=\"w-100\">\n <ng-container [ngTemplateOutlet]=\"customBodyTemplate()\" [ngTemplateOutletContext]=\"customBodyContext()\">\n </ng-container>\n </div>\n }\n </div>\n }\n @else {\n <!-- default + sidepanel : header titre + close, body = contenu libre (slot) -->\n <div class=\"modal-header\">\n <h1 class=\"modal-title\" id=\"modal-basic-title\">\n {{ (modalTitle() ?? '') | translate }}\n </h1>\n\n <!-- cf. croix state/delete : aria-disabled, pas `disabled` natif -->\n <button type=\"button\" class=\"btn-close\" [attr.aria-label]=\"'_COMMON._ACTION.CLOSE' | translate\"\n [class.disabled]=\"isCloseLocked()\" [attr.aria-disabled]=\"isCloseLocked() ? 'true' : null\"\n (click)=\"requestClose()\" data-test-ctw=\"btn-close-modal\">\n <cw-icon [icon]=\"spriteIcon.toolbarClose\" [iconSize]=\"iconSize['lg']\" [type]=\"iconType.default\" aria-hidden=\"true\"></cw-icon>\n </button>\n </div>\n\n <div class=\"modal-body d-flex-v gap-md\">\n @if (customBodyTemplate()) {\n <ng-container [ngTemplateOutlet]=\"customBodyTemplate()\" [ngTemplateOutletContext]=\"customBodyContext()\">\n </ng-container>\n }\n </div>\n }\n\n <!-- footer commun : secondaire a gauche, primaire/danger a droite (ordre DS) -->\n <div class=\"modal-footer\">\n @if (type() === modalsType.delete) {\n <cw-button label=\"_COMMON._ACTION.CLOSE\" [type]=\"buttonTypeEnum.secondary\"\n [isDisabled]=\"isCloseLocked()\" (btnAction)=\"requestClose()\" dataTest=\"btn-close-modal\">\n </cw-button>\n\n <cw-button label=\"_COMMON._ACTION.DELETE\" [type]=\"buttonTypeEnum.danger\"\n [isDisabled]=\"disableBtnAction1()\" (btnAction)=\"action1Click()\" dataTest=\"btn-action-modal\">\n </cw-button>\n }\n @else {\n @if (labelBtnAction2()) {\n <cw-button [label]=\"labelBtnAction2()\" [type]=\"buttonTypeEnum.secondary\"\n [isDisabled]=\"disableBtnAction2()\" (btnAction)=\"action2Click()\" dataTest=\"btn-action-modal\">\n </cw-button>\n }\n @else {\n <!-- Bouton de repli : il occupe la place de l'action 2, il applique donc\n disableBtnAction2 (auparavant le seul bouton du composant a ignorer\n son input de desactivation). -->\n <cw-button label=\"_COMMON._ACTION.CLOSE\" [type]=\"buttonTypeEnum.secondary\"\n [isDisabled]=\"isCloseLocked() || disableBtnAction2()\"\n (btnAction)=\"fallbackCloseClick()\" dataTest=\"btn-close-modal\">\n </cw-button>\n }\n @if (labelBtnAction1()) {\n <cw-button [label]=\"labelBtnAction1()\" [type]=\"buttonTypeEnum.primary\"\n [isDisabled]=\"disableBtnAction1()\" (btnAction)=\"action1Click()\" dataTest=\"btn-action-modal\">\n </cw-button>\n }\n }\n </div>\n }\n\n </div>\n </div>\n</div>\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "ngmodule", type: TranslateModule }, { kind: "component", type: ButtonComponent, selector: "cw-button", inputs: ["type", "label", "id", "link", "isDropdown", "hideCaret", "withIcon", "withOnlyIcon", "iconSize", "iconPosition", "dropdownPosition", "isMinWidth", "isDisabled", "isLoading", "loadingAnnounce", "cssClass", "dataTest", "skeletonMode", "withTooltip", "tooltipText", "tooltipTitle", "tooltipTrigger", "tooltipPosition", "tooltipType"], outputs: ["btnAction", "dropDownClicked"] }, { kind: "component", type: LoaderComponent, selector: "cw-loader", inputs: ["size", "displayText"] }, { kind: "component", type: IconComponent, selector: "cw-icon", inputs: ["icon", "label", "type", "iconSize", "iconCssClass", "iconUiType", "iconColorCustom", "spritePath"] }, { kind: "pipe", type: i2.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
4686
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.20", type: ModalsComponent, isStandalone: true, selector: "cw-modals", inputs: { size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, customClass: { classPropertyName: "customClass", publicName: "customClass", isSignal: true, isRequired: false, transformFunction: null }, scrollable: { classPropertyName: "scrollable", publicName: "scrollable", isSignal: true, isRequired: false, transformFunction: null }, isAutcompModal: { classPropertyName: "isAutcompModal", publicName: "isAutcompModal", isSignal: true, isRequired: false, transformFunction: null }, type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: true, transformFunction: null }, state: { classPropertyName: "state", publicName: "state", isSignal: true, isRequired: false, transformFunction: null }, textType: { classPropertyName: "textType", publicName: "textType", isSignal: true, isRequired: false, transformFunction: null }, modalTitle: { classPropertyName: "modalTitle", publicName: "modalTitle", isSignal: true, isRequired: false, transformFunction: null }, itemsToDelete: { classPropertyName: "itemsToDelete", publicName: "itemsToDelete", isSignal: true, isRequired: false, transformFunction: null }, itemsToDeleteTitle: { classPropertyName: "itemsToDeleteTitle", publicName: "itemsToDeleteTitle", isSignal: true, isRequired: false, transformFunction: null }, labelBtnAction1: { classPropertyName: "labelBtnAction1", publicName: "labelBtnAction1", isSignal: true, isRequired: false, transformFunction: null }, labelBtnAction2: { classPropertyName: "labelBtnAction2", publicName: "labelBtnAction2", isSignal: true, isRequired: false, transformFunction: null }, disableBtnAction1: { classPropertyName: "disableBtnAction1", publicName: "disableBtnAction1", isSignal: true, isRequired: false, transformFunction: null }, disableBtnAction2: { classPropertyName: "disableBtnAction2", publicName: "disableBtnAction2", isSignal: true, isRequired: false, transformFunction: null }, customBodyTemplate: { classPropertyName: "customBodyTemplate", publicName: "customBodyTemplate", isSignal: true, isRequired: false, transformFunction: null }, customBodyContext: { classPropertyName: "customBodyContext", publicName: "customBodyContext", isSignal: true, isRequired: false, transformFunction: null }, closeLocked: { classPropertyName: "closeLocked", publicName: "closeLocked", isSignal: true, isRequired: false, transformFunction: null }, closeLockedMessage: { classPropertyName: "closeLockedMessage", publicName: "closeLockedMessage", isSignal: true, isRequired: false, transformFunction: null }, keepOpenOnAction1: { classPropertyName: "keepOpenOnAction1", publicName: "keepOpenOnAction1", isSignal: true, isRequired: false, transformFunction: null }, keepOpenOnAction2: { classPropertyName: "keepOpenOnAction2", publicName: "keepOpenOnAction2", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { btnAction1: "btnAction1", btnAction2: "btnAction2" }, viewQueries: [{ propertyName: "modalContainer", first: true, predicate: ["modalContainer"], descendants: true, isSignal: true }], ngImport: i0, template: "<div class=\"cityway-v8 modal-backdrop fade show\" style=\"z-index: 1050;\" aria-hidden=\"true\"></div>\n\n<div role=\"dialog\" tabindex=\"-1\" aria-modal=\"true\"\n [attr.aria-labelledby]=\"type() === modalsType.loader ? null : titleId\"\n [attr.aria-label]=\"type() === modalsType.loader ? ('_COMMON._HTTP.TXT_LOADING' | translate) : null\"\n class=\"cityway-v8 d-flex modal show\" [ngClass]=\"customClass()\" data-test-ctw=\"modal\" (keydown)=\"onKeyDown($event)\">\n\n <!-- Backdrop : fermeture a la souris (confort). Le clavier (Escape) est gere\n par onKeyDown du dialog ; le backdrop n'est pas un element interactif focusable.\n requestClose() applique le verrou (cf. isCloseLocked) : plus de test sur le type ici. -->\n <!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events, @angular-eslint/template/interactive-supports-focus -->\n <div class=\"modal-inner-backdrop\" (click)=\"requestClose()\"></div>\n\n <div #modalContainer role=\"document\" class=\"modal-dialog modal-dialog-centered\"\n [ngClass]=\"['modal-' + size(), scrollable() ? 'modal-dialog-scrollable' : '']\">\n\n <div class=\"modal-content\">\n\n <!-- Verrou actif : region live qui annonce chaque tentative de fermeture refusee\n (Echap, backdrop, croix). Rendue vide au repos car une region live doit\n pre-exister dans le DOM pour que son remplissage soit annonce. Absente pour\n le loader, qui possede deja la sienne dans cw-loader. -->\n @if (showCloseLockedStatus()) {\n <span class=\"visually-hidden\" role=\"status\" aria-live=\"polite\">{{ closeLockedAnnouncement() | translate }}</span>\n }\n\n @if (type() === modalsType.loader) {\n <div class=\"modal-body\">\n <cw-loader></cw-loader>\n </div>\n }\n @else {\n @if (isStateLike()) {\n <!-- state + delete : close en absolu (top-right, hors flux donc ne reserve\n pas de hauteur), body centre avec le picto de statut EN TETE du flux\n (il pousse donc le titre normalement) -->\n <!-- aria-disabled + .disabled (Bootstrap) plutot que `disabled` natif : la croix\n reste focusable et annoncee \u00AB desactivee \u00BB, et le focus trap conserve une\n cible. Un `disabled` natif la sortirait du selecteur de focusables. -->\n <button type=\"button\" class=\"btn-close modal-close-floating\" [attr.aria-label]=\"'_COMMON._ACTION.CLOSE' | translate\"\n [class.disabled]=\"isCloseLocked()\" [attr.aria-disabled]=\"isCloseLocked() ? 'true' : null\"\n (click)=\"requestClose()\" data-test-ctw=\"btn-close-modal\">\n <cw-icon [icon]=\"spriteIcon.toolbarClose\" [iconSize]=\"iconSize['lg']\" [type]=\"iconType.default\" aria-hidden=\"true\"></cw-icon>\n </button>\n\n <div class=\"modal-body modal-body-state d-flex-v gap-md items-center\" [class.modal-text-center]=\"isBodyCentered()\">\n <cw-icon [icon]=\"statusIcon()\" [iconSize]=\"iconSize['xl']\" [type]=\"iconType.square\"\n [iconUiType]=\"statusUiType()\" aria-hidden=\"true\"></cw-icon>\n\n <h1 class=\"modal-title\" [id]=\"titleId\">\n @if (type() === modalsType.delete) {\n {{ '_COMMON._MODAL_DELETE.TITLE' | translate: { number: itemsToDelete().length, name: itemsToDeleteTitle() | translate } }}\n }\n @else {\n {{ (modalTitle() ?? '') | translate }}\n }\n </h1>\n\n @if (type() === modalsType.delete) {\n <!-- zone delete en dur : texte + liste + avertissement, pleine largeur aligne a gauche -->\n <div class=\"w-100 d-flex-v gap-md\">\n @if (itemsToDelete().length > 1) {\n <div [innerHTML]=\"'_COMMON._MODAL_DELETE.MULTIPLE_TEXT' | translate\"></div>\n }\n @else {\n <div [innerHTML]=\"'_COMMON._MODAL_DELETE.SIMPLE_TEXT' | translate\"></div>\n }\n\n @if (itemsToDelete().length > 0) {\n <ul class=\"mb-none\">\n @for (item of itemsToDelete(); track item) {\n <li>{{ item }}</li>\n }\n </ul>\n }\n\n <div [innerHTML]=\"'_COMMON._MODAL_DELETE.IRREVERSIBLE' | translate\"></div>\n </div>\n }\n\n @if (customBodyTemplate()) {\n <div class=\"w-100\">\n <ng-container [ngTemplateOutlet]=\"customBodyTemplate()\" [ngTemplateOutletContext]=\"customBodyContext()\">\n </ng-container>\n </div>\n }\n </div>\n }\n @else {\n <!-- default + sidepanel : header titre + close, body = contenu libre (slot) -->\n <div class=\"modal-header\">\n <h1 class=\"modal-title\" [id]=\"titleId\">\n {{ (modalTitle() ?? '') | translate }}\n </h1>\n\n <!-- cf. croix state/delete : aria-disabled, pas `disabled` natif -->\n <button type=\"button\" class=\"btn-close\" [attr.aria-label]=\"'_COMMON._ACTION.CLOSE' | translate\"\n [class.disabled]=\"isCloseLocked()\" [attr.aria-disabled]=\"isCloseLocked() ? 'true' : null\"\n (click)=\"requestClose()\" data-test-ctw=\"btn-close-modal\">\n <cw-icon [icon]=\"spriteIcon.toolbarClose\" [iconSize]=\"iconSize['lg']\" [type]=\"iconType.default\" aria-hidden=\"true\"></cw-icon>\n </button>\n </div>\n\n <div class=\"modal-body d-flex-v gap-md\">\n @if (customBodyTemplate()) {\n <ng-container [ngTemplateOutlet]=\"customBodyTemplate()\" [ngTemplateOutletContext]=\"customBodyContext()\">\n </ng-container>\n }\n </div>\n }\n\n <!-- footer commun : secondaire a gauche, primaire/danger a droite (ordre DS) -->\n <div class=\"modal-footer\">\n @if (type() === modalsType.delete) {\n <cw-button label=\"_COMMON._ACTION.CLOSE\" [type]=\"buttonTypeEnum.secondary\"\n [isDisabled]=\"isCloseLocked()\" (btnAction)=\"requestClose()\" dataTest=\"btn-close-modal\">\n </cw-button>\n\n <cw-button label=\"_COMMON._ACTION.DELETE\" [type]=\"buttonTypeEnum.danger\"\n [isDisabled]=\"disableBtnAction1()\" (btnAction)=\"action1Click()\" dataTest=\"btn-action-modal\">\n </cw-button>\n }\n @else {\n @if (labelBtnAction2()) {\n <cw-button [label]=\"labelBtnAction2()\" [type]=\"buttonTypeEnum.secondary\"\n [isDisabled]=\"disableBtnAction2()\" (btnAction)=\"action2Click()\" dataTest=\"btn-action-modal\">\n </cw-button>\n }\n @else {\n <!-- Bouton de repli : il occupe la place de l'action 2, il applique donc\n disableBtnAction2 (auparavant le seul bouton du composant a ignorer\n son input de desactivation). -->\n <cw-button label=\"_COMMON._ACTION.CLOSE\" [type]=\"buttonTypeEnum.secondary\"\n [isDisabled]=\"isCloseLocked() || disableBtnAction2()\"\n (btnAction)=\"fallbackCloseClick()\" dataTest=\"btn-close-modal\">\n </cw-button>\n }\n @if (labelBtnAction1()) {\n <cw-button [label]=\"labelBtnAction1()\" [type]=\"buttonTypeEnum.primary\"\n [isDisabled]=\"disableBtnAction1()\" (btnAction)=\"action1Click()\" dataTest=\"btn-action-modal\">\n </cw-button>\n }\n }\n </div>\n }\n\n </div>\n </div>\n</div>\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "ngmodule", type: TranslateModule }, { kind: "component", type: ButtonComponent, selector: "cw-button", inputs: ["type", "label", "id", "link", "isDropdown", "hideCaret", "withIcon", "withOnlyIcon", "iconSize", "iconPosition", "dropdownPosition", "isMinWidth", "isDisabled", "isLoading", "loadingAnnounce", "cssClass", "dataTest", "skeletonMode", "withTooltip", "tooltipText", "tooltipTitle", "tooltipTrigger", "tooltipPosition", "tooltipType"], outputs: ["btnAction", "dropDownClicked"] }, { kind: "component", type: LoaderComponent, selector: "cw-loader", inputs: ["size", "displayText"] }, { kind: "component", type: IconComponent, selector: "cw-icon", inputs: ["icon", "label", "type", "iconSize", "iconCssClass", "iconUiType", "iconColorCustom", "spritePath"] }, { kind: "pipe", type: i2.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
4667
4687
  }
4668
4688
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: ModalsComponent, decorators: [{
4669
4689
  type: Component,
4670
- args: [{ selector: 'cw-modals', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, imports: [CommonModule, TranslateModule, NgClass, NgTemplateOutlet, ButtonComponent, LoaderComponent, IconComponent], template: "<div class=\"cityway-v8 modal-backdrop fade show\" style=\"z-index: 1050;\" aria-hidden=\"true\"></div>\n\n<div role=\"dialog\" tabindex=\"-1\" aria-modal=\"true\"\n [attr.aria-labelledby]=\"type() === modalsType.loader ? null : 'modal-basic-title'\"\n [attr.aria-label]=\"type() === modalsType.loader ? ('_COMMON._HTTP.TXT_LOADING' | translate) : null\"\n class=\"cityway-v8 d-flex modal show\" [ngClass]=\"customClass()\" data-test-ctw=\"modal\" (keydown)=\"onKeyDown($event)\">\n\n <!-- Backdrop : fermeture a la souris (confort). Le clavier (Escape) est gere\n par onKeyDown du dialog ; le backdrop n'est pas un element interactif focusable.\n requestClose() applique le verrou (cf. isCloseLocked) : plus de test sur le type ici. -->\n <!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events, @angular-eslint/template/interactive-supports-focus -->\n <div class=\"modal-inner-backdrop\" (click)=\"requestClose()\"></div>\n\n <div #modalContainer role=\"document\" class=\"modal-dialog modal-dialog-centered\"\n [ngClass]=\"['modal-' + size(), scrollable() ? 'modal-dialog-scrollable' : '']\">\n\n <div class=\"modal-content\">\n\n <!-- Verrou actif : region live qui annonce chaque tentative de fermeture refusee\n (Echap, backdrop, croix). Rendue vide au repos car une region live doit\n pre-exister dans le DOM pour que son remplissage soit annonce. Absente pour\n le loader, qui possede deja la sienne dans cw-loader. -->\n @if (showCloseLockedStatus()) {\n <span class=\"visually-hidden\" role=\"status\" aria-live=\"polite\">{{ closeLockedAnnouncement() | translate }}</span>\n }\n\n @if (type() === modalsType.loader) {\n <div class=\"modal-body\">\n <cw-loader></cw-loader>\n </div>\n }\n @else {\n @if (isStateLike()) {\n <!-- state + delete : close en absolu (top-right, hors flux donc ne reserve\n pas de hauteur), body centre avec le picto de statut EN TETE du flux\n (il pousse donc le titre normalement) -->\n <!-- aria-disabled + .disabled (Bootstrap) plutot que `disabled` natif : la croix\n reste focusable et annoncee \u00AB desactivee \u00BB, et le focus trap conserve une\n cible. Un `disabled` natif la sortirait du selecteur de focusables. -->\n <button type=\"button\" class=\"btn-close modal-close-floating\" [attr.aria-label]=\"'_COMMON._ACTION.CLOSE' | translate\"\n [class.disabled]=\"isCloseLocked()\" [attr.aria-disabled]=\"isCloseLocked() ? 'true' : null\"\n (click)=\"requestClose()\" data-test-ctw=\"btn-close-modal\">\n <cw-icon [icon]=\"spriteIcon.toolbarClose\" [iconSize]=\"iconSize['lg']\" [type]=\"iconType.default\" aria-hidden=\"true\"></cw-icon>\n </button>\n\n <div class=\"modal-body modal-body-state d-flex-v gap-md items-center\" [class.modal-text-center]=\"isBodyCentered()\">\n <cw-icon [icon]=\"statusIcon()\" [iconSize]=\"iconSize['xl']\" [type]=\"iconType.square\"\n [iconUiType]=\"statusUiType()\" aria-hidden=\"true\"></cw-icon>\n\n <h1 class=\"modal-title\" id=\"modal-basic-title\">\n @if (type() === modalsType.delete) {\n {{ '_COMMON._MODAL_DELETE.TITLE' | translate: { number: itemsToDelete().length, name: itemsToDeleteTitle() | translate } }}\n }\n @else {\n {{ (modalTitle() ?? '') | translate }}\n }\n </h1>\n\n @if (type() === modalsType.delete) {\n <!-- zone delete en dur : texte + liste + avertissement, pleine largeur aligne a gauche -->\n <div class=\"w-100 d-flex-v gap-md\">\n @if (itemsToDelete().length > 1) {\n <div [innerHTML]=\"'_COMMON._MODAL_DELETE.MULTIPLE_TEXT' | translate\"></div>\n }\n @else {\n <div [innerHTML]=\"'_COMMON._MODAL_DELETE.SIMPLE_TEXT' | translate\"></div>\n }\n\n @if (itemsToDelete().length > 0) {\n <ul class=\"mb-none\">\n @for (item of itemsToDelete(); track item) {\n <li>{{ item }}</li>\n }\n </ul>\n }\n\n <div [innerHTML]=\"'_COMMON._MODAL_DELETE.IRREVERSIBLE' | translate\"></div>\n </div>\n }\n\n @if (customBodyTemplate()) {\n <div class=\"w-100\">\n <ng-container [ngTemplateOutlet]=\"customBodyTemplate()\" [ngTemplateOutletContext]=\"customBodyContext()\">\n </ng-container>\n </div>\n }\n </div>\n }\n @else {\n <!-- default + sidepanel : header titre + close, body = contenu libre (slot) -->\n <div class=\"modal-header\">\n <h1 class=\"modal-title\" id=\"modal-basic-title\">\n {{ (modalTitle() ?? '') | translate }}\n </h1>\n\n <!-- cf. croix state/delete : aria-disabled, pas `disabled` natif -->\n <button type=\"button\" class=\"btn-close\" [attr.aria-label]=\"'_COMMON._ACTION.CLOSE' | translate\"\n [class.disabled]=\"isCloseLocked()\" [attr.aria-disabled]=\"isCloseLocked() ? 'true' : null\"\n (click)=\"requestClose()\" data-test-ctw=\"btn-close-modal\">\n <cw-icon [icon]=\"spriteIcon.toolbarClose\" [iconSize]=\"iconSize['lg']\" [type]=\"iconType.default\" aria-hidden=\"true\"></cw-icon>\n </button>\n </div>\n\n <div class=\"modal-body d-flex-v gap-md\">\n @if (customBodyTemplate()) {\n <ng-container [ngTemplateOutlet]=\"customBodyTemplate()\" [ngTemplateOutletContext]=\"customBodyContext()\">\n </ng-container>\n }\n </div>\n }\n\n <!-- footer commun : secondaire a gauche, primaire/danger a droite (ordre DS) -->\n <div class=\"modal-footer\">\n @if (type() === modalsType.delete) {\n <cw-button label=\"_COMMON._ACTION.CLOSE\" [type]=\"buttonTypeEnum.secondary\"\n [isDisabled]=\"isCloseLocked()\" (btnAction)=\"requestClose()\" dataTest=\"btn-close-modal\">\n </cw-button>\n\n <cw-button label=\"_COMMON._ACTION.DELETE\" [type]=\"buttonTypeEnum.danger\"\n [isDisabled]=\"disableBtnAction1()\" (btnAction)=\"action1Click()\" dataTest=\"btn-action-modal\">\n </cw-button>\n }\n @else {\n @if (labelBtnAction2()) {\n <cw-button [label]=\"labelBtnAction2()\" [type]=\"buttonTypeEnum.secondary\"\n [isDisabled]=\"disableBtnAction2()\" (btnAction)=\"action2Click()\" dataTest=\"btn-action-modal\">\n </cw-button>\n }\n @else {\n <!-- Bouton de repli : il occupe la place de l'action 2, il applique donc\n disableBtnAction2 (auparavant le seul bouton du composant a ignorer\n son input de desactivation). -->\n <cw-button label=\"_COMMON._ACTION.CLOSE\" [type]=\"buttonTypeEnum.secondary\"\n [isDisabled]=\"isCloseLocked() || disableBtnAction2()\"\n (btnAction)=\"fallbackCloseClick()\" dataTest=\"btn-close-modal\">\n </cw-button>\n }\n @if (labelBtnAction1()) {\n <cw-button [label]=\"labelBtnAction1()\" [type]=\"buttonTypeEnum.primary\"\n [isDisabled]=\"disableBtnAction1()\" (btnAction)=\"action1Click()\" dataTest=\"btn-action-modal\">\n </cw-button>\n }\n }\n </div>\n }\n\n </div>\n </div>\n</div>\n" }]
4690
+ args: [{ selector: 'cw-modals', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, imports: [CommonModule, TranslateModule, NgClass, NgTemplateOutlet, ButtonComponent, LoaderComponent, IconComponent], template: "<div class=\"cityway-v8 modal-backdrop fade show\" style=\"z-index: 1050;\" aria-hidden=\"true\"></div>\n\n<div role=\"dialog\" tabindex=\"-1\" aria-modal=\"true\"\n [attr.aria-labelledby]=\"type() === modalsType.loader ? null : titleId\"\n [attr.aria-label]=\"type() === modalsType.loader ? ('_COMMON._HTTP.TXT_LOADING' | translate) : null\"\n class=\"cityway-v8 d-flex modal show\" [ngClass]=\"customClass()\" data-test-ctw=\"modal\" (keydown)=\"onKeyDown($event)\">\n\n <!-- Backdrop : fermeture a la souris (confort). Le clavier (Escape) est gere\n par onKeyDown du dialog ; le backdrop n'est pas un element interactif focusable.\n requestClose() applique le verrou (cf. isCloseLocked) : plus de test sur le type ici. -->\n <!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events, @angular-eslint/template/interactive-supports-focus -->\n <div class=\"modal-inner-backdrop\" (click)=\"requestClose()\"></div>\n\n <div #modalContainer role=\"document\" class=\"modal-dialog modal-dialog-centered\"\n [ngClass]=\"['modal-' + size(), scrollable() ? 'modal-dialog-scrollable' : '']\">\n\n <div class=\"modal-content\">\n\n <!-- Verrou actif : region live qui annonce chaque tentative de fermeture refusee\n (Echap, backdrop, croix). Rendue vide au repos car une region live doit\n pre-exister dans le DOM pour que son remplissage soit annonce. Absente pour\n le loader, qui possede deja la sienne dans cw-loader. -->\n @if (showCloseLockedStatus()) {\n <span class=\"visually-hidden\" role=\"status\" aria-live=\"polite\">{{ closeLockedAnnouncement() | translate }}</span>\n }\n\n @if (type() === modalsType.loader) {\n <div class=\"modal-body\">\n <cw-loader></cw-loader>\n </div>\n }\n @else {\n @if (isStateLike()) {\n <!-- state + delete : close en absolu (top-right, hors flux donc ne reserve\n pas de hauteur), body centre avec le picto de statut EN TETE du flux\n (il pousse donc le titre normalement) -->\n <!-- aria-disabled + .disabled (Bootstrap) plutot que `disabled` natif : la croix\n reste focusable et annoncee \u00AB desactivee \u00BB, et le focus trap conserve une\n cible. Un `disabled` natif la sortirait du selecteur de focusables. -->\n <button type=\"button\" class=\"btn-close modal-close-floating\" [attr.aria-label]=\"'_COMMON._ACTION.CLOSE' | translate\"\n [class.disabled]=\"isCloseLocked()\" [attr.aria-disabled]=\"isCloseLocked() ? 'true' : null\"\n (click)=\"requestClose()\" data-test-ctw=\"btn-close-modal\">\n <cw-icon [icon]=\"spriteIcon.toolbarClose\" [iconSize]=\"iconSize['lg']\" [type]=\"iconType.default\" aria-hidden=\"true\"></cw-icon>\n </button>\n\n <div class=\"modal-body modal-body-state d-flex-v gap-md items-center\" [class.modal-text-center]=\"isBodyCentered()\">\n <cw-icon [icon]=\"statusIcon()\" [iconSize]=\"iconSize['xl']\" [type]=\"iconType.square\"\n [iconUiType]=\"statusUiType()\" aria-hidden=\"true\"></cw-icon>\n\n <h1 class=\"modal-title\" [id]=\"titleId\">\n @if (type() === modalsType.delete) {\n {{ '_COMMON._MODAL_DELETE.TITLE' | translate: { number: itemsToDelete().length, name: itemsToDeleteTitle() | translate } }}\n }\n @else {\n {{ (modalTitle() ?? '') | translate }}\n }\n </h1>\n\n @if (type() === modalsType.delete) {\n <!-- zone delete en dur : texte + liste + avertissement, pleine largeur aligne a gauche -->\n <div class=\"w-100 d-flex-v gap-md\">\n @if (itemsToDelete().length > 1) {\n <div [innerHTML]=\"'_COMMON._MODAL_DELETE.MULTIPLE_TEXT' | translate\"></div>\n }\n @else {\n <div [innerHTML]=\"'_COMMON._MODAL_DELETE.SIMPLE_TEXT' | translate\"></div>\n }\n\n @if (itemsToDelete().length > 0) {\n <ul class=\"mb-none\">\n @for (item of itemsToDelete(); track item) {\n <li>{{ item }}</li>\n }\n </ul>\n }\n\n <div [innerHTML]=\"'_COMMON._MODAL_DELETE.IRREVERSIBLE' | translate\"></div>\n </div>\n }\n\n @if (customBodyTemplate()) {\n <div class=\"w-100\">\n <ng-container [ngTemplateOutlet]=\"customBodyTemplate()\" [ngTemplateOutletContext]=\"customBodyContext()\">\n </ng-container>\n </div>\n }\n </div>\n }\n @else {\n <!-- default + sidepanel : header titre + close, body = contenu libre (slot) -->\n <div class=\"modal-header\">\n <h1 class=\"modal-title\" [id]=\"titleId\">\n {{ (modalTitle() ?? '') | translate }}\n </h1>\n\n <!-- cf. croix state/delete : aria-disabled, pas `disabled` natif -->\n <button type=\"button\" class=\"btn-close\" [attr.aria-label]=\"'_COMMON._ACTION.CLOSE' | translate\"\n [class.disabled]=\"isCloseLocked()\" [attr.aria-disabled]=\"isCloseLocked() ? 'true' : null\"\n (click)=\"requestClose()\" data-test-ctw=\"btn-close-modal\">\n <cw-icon [icon]=\"spriteIcon.toolbarClose\" [iconSize]=\"iconSize['lg']\" [type]=\"iconType.default\" aria-hidden=\"true\"></cw-icon>\n </button>\n </div>\n\n <div class=\"modal-body d-flex-v gap-md\">\n @if (customBodyTemplate()) {\n <ng-container [ngTemplateOutlet]=\"customBodyTemplate()\" [ngTemplateOutletContext]=\"customBodyContext()\">\n </ng-container>\n }\n </div>\n }\n\n <!-- footer commun : secondaire a gauche, primaire/danger a droite (ordre DS) -->\n <div class=\"modal-footer\">\n @if (type() === modalsType.delete) {\n <cw-button label=\"_COMMON._ACTION.CLOSE\" [type]=\"buttonTypeEnum.secondary\"\n [isDisabled]=\"isCloseLocked()\" (btnAction)=\"requestClose()\" dataTest=\"btn-close-modal\">\n </cw-button>\n\n <cw-button label=\"_COMMON._ACTION.DELETE\" [type]=\"buttonTypeEnum.danger\"\n [isDisabled]=\"disableBtnAction1()\" (btnAction)=\"action1Click()\" dataTest=\"btn-action-modal\">\n </cw-button>\n }\n @else {\n @if (labelBtnAction2()) {\n <cw-button [label]=\"labelBtnAction2()\" [type]=\"buttonTypeEnum.secondary\"\n [isDisabled]=\"disableBtnAction2()\" (btnAction)=\"action2Click()\" dataTest=\"btn-action-modal\">\n </cw-button>\n }\n @else {\n <!-- Bouton de repli : il occupe la place de l'action 2, il applique donc\n disableBtnAction2 (auparavant le seul bouton du composant a ignorer\n son input de desactivation). -->\n <cw-button label=\"_COMMON._ACTION.CLOSE\" [type]=\"buttonTypeEnum.secondary\"\n [isDisabled]=\"isCloseLocked() || disableBtnAction2()\"\n (btnAction)=\"fallbackCloseClick()\" dataTest=\"btn-close-modal\">\n </cw-button>\n }\n @if (labelBtnAction1()) {\n <cw-button [label]=\"labelBtnAction1()\" [type]=\"buttonTypeEnum.primary\"\n [isDisabled]=\"disableBtnAction1()\" (btnAction)=\"action1Click()\" dataTest=\"btn-action-modal\">\n </cw-button>\n }\n }\n </div>\n }\n\n </div>\n </div>\n</div>\n" }]
4671
4691
  }], propDecorators: { modalContainer: [{ type: i0.ViewChild, args: ['modalContainer', { isSignal: true }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], customClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "customClass", required: false }] }], scrollable: [{ type: i0.Input, args: [{ isSignal: true, alias: "scrollable", required: false }] }], isAutcompModal: [{ type: i0.Input, args: [{ isSignal: true, alias: "isAutcompModal", required: false }] }], type: [{ type: i0.Input, args: [{ isSignal: true, alias: "type", required: true }] }], state: [{ type: i0.Input, args: [{ isSignal: true, alias: "state", required: false }] }], textType: [{ type: i0.Input, args: [{ isSignal: true, alias: "textType", required: false }] }], modalTitle: [{ type: i0.Input, args: [{ isSignal: true, alias: "modalTitle", required: false }] }], itemsToDelete: [{ type: i0.Input, args: [{ isSignal: true, alias: "itemsToDelete", required: false }] }], itemsToDeleteTitle: [{ type: i0.Input, args: [{ isSignal: true, alias: "itemsToDeleteTitle", required: false }] }], labelBtnAction1: [{ type: i0.Input, args: [{ isSignal: true, alias: "labelBtnAction1", required: false }] }], labelBtnAction2: [{ type: i0.Input, args: [{ isSignal: true, alias: "labelBtnAction2", required: false }] }], disableBtnAction1: [{ type: i0.Input, args: [{ isSignal: true, alias: "disableBtnAction1", required: false }] }], disableBtnAction2: [{ type: i0.Input, args: [{ isSignal: true, alias: "disableBtnAction2", required: false }] }], customBodyTemplate: [{ type: i0.Input, args: [{ isSignal: true, alias: "customBodyTemplate", required: false }] }], customBodyContext: [{ type: i0.Input, args: [{ isSignal: true, alias: "customBodyContext", required: false }] }], closeLocked: [{ type: i0.Input, args: [{ isSignal: true, alias: "closeLocked", required: false }] }], closeLockedMessage: [{ type: i0.Input, args: [{ isSignal: true, alias: "closeLockedMessage", required: false }] }], keepOpenOnAction1: [{ type: i0.Input, args: [{ isSignal: true, alias: "keepOpenOnAction1", required: false }] }], keepOpenOnAction2: [{ type: i0.Input, args: [{ isSignal: true, alias: "keepOpenOnAction2", required: false }] }], btnAction1: [{ type: i0.Output, args: ["btnAction1"] }], btnAction2: [{ type: i0.Output, args: ["btnAction2"] }] } });
4672
4692
 
4673
4693
  class TabContentComponent {