@cityway/basic-ui 1.1.0-beta011 → 1.1.0-beta013

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,7 +1,7 @@
1
1
  import * as i1 from '@angular/common';
2
2
  import { CommonModule, DOCUMENT, isPlatformBrowser, NgClass, NgTemplateOutlet } from '@angular/common';
3
3
  import * as i0 from '@angular/core';
4
- import { inject, ElementRef, model, output, effect, Directive, input, HostBinding, ChangeDetectionStrategy, Component, ChangeDetectorRef, viewChild, signal, contentChildren, DestroyRef, computed, Injectable, NgZone, Renderer2, ViewContainerRef, PLATFORM_ID, EventEmitter, TemplateRef, ContentChild, Output, Input, ApplicationRef, Injector, createComponent, viewChildren, Pipe, forwardRef } from '@angular/core';
4
+ import { inject, ElementRef, model, output, effect, Directive, input, HostBinding, ChangeDetectionStrategy, Component, ChangeDetectorRef, viewChild, signal, contentChildren, DestroyRef, computed, Injectable, NgZone, Renderer2, ViewContainerRef, PLATFORM_ID, Pipe, EventEmitter, TemplateRef, ContentChild, Output, Input, ApplicationRef, Injector, createComponent, viewChildren, forwardRef } from '@angular/core';
5
5
  import * as i2 from '@ngx-translate/core';
6
6
  import { TranslatePipe, TranslateModule, TranslateService } from '@ngx-translate/core';
7
7
  import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
@@ -3102,6 +3102,127 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.20", ngImpo
3102
3102
  }, template: "<!-- Quill instancie la toolbar (avant) et la zone \u00E9ditable DANS ce conteneur. -->\n<div class=\"rich-text-editor-container\">\n <div #editor [hidden]=\"sourceMode()\"></div>\n\n <!-- Mode \u00AB source HTML \u00BB (preset expert) : \u00E9dition du HTML brut. -->\n @if (sourceMode()) {\n <textarea\n class=\"rich-text-editor-source\"\n spellcheck=\"false\"\n aria-label=\"Code HTML\"\n [value]=\"sourceHtml()\"\n [readonly]=\"isDisabled() || isReadonly()\"\n (input)=\"onSourceInput($any($event.target).value)\"></textarea>\n }\n</div>\n" }]
3103
3103
  }], ctorParameters: () => [], propDecorators: { control: [{ type: i0.Input, args: [{ isSignal: true, alias: "control", required: true }] }], options: [{ type: i0.Input, args: [{ isSignal: true, alias: "options", required: false }] }], id: [{ type: i0.Input, args: [{ isSignal: true, alias: "id", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], isRequired: [{ type: i0.Input, args: [{ isSignal: true, alias: "isRequired", required: false }] }], isReadonly: [{ type: i0.Input, args: [{ isSignal: true, alias: "isReadonly", required: false }] }], isDisabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "isDisabled", required: false }] }], ariaInvalid: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaInvalid", required: false }] }], ariaDescribedBy: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaDescribedBy", required: false }] }], valueChange: [{ type: i0.Output, args: ["valueChange"] }], editorRef: [{ type: i0.ViewChild, args: ['editor', { isSignal: true }] }] } });
3104
3104
 
3105
+ const FILE_SIZE_UNITS_FR = ['o', 'Ko', 'Mo', 'Go', 'To', 'Po', 'Eo', 'Zo', 'Yo'];
3106
+ const FILE_SIZE_UNITS_DEFAULT = ['B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'];
3107
+ class FormatFileSizePipe {
3108
+ constructor() {
3109
+ this.translate = inject(TranslateService);
3110
+ }
3111
+ transform(sizeInBytes) {
3112
+ const units = this.translate.currentLang === 'fr' ? FILE_SIZE_UNITS_FR : FILE_SIZE_UNITS_DEFAULT;
3113
+ // Garde: 0/negatif/nullish -> Math.log donne -Infinity => 'NaN undefined'.
3114
+ if (!sizeInBytes || sizeInBytes < 1) {
3115
+ return `0 ${units[0]}`;
3116
+ }
3117
+ let power = Math.round(Math.log(sizeInBytes) / Math.log(1024));
3118
+ power = Math.max(0, Math.min(power, units.length - 1));
3119
+ const size = sizeInBytes / Math.pow(1024, power); // size in new units
3120
+ const formattedSize = Math.round(size * 10) / 10; // keep up to 1 decimal
3121
+ const unit = units[power];
3122
+ return `${formattedSize} ${unit}`;
3123
+ }
3124
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: FormatFileSizePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
3125
+ static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "20.3.20", ngImport: i0, type: FormatFileSizePipe, isStandalone: true, name: "formatFileSize" }); }
3126
+ }
3127
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: FormatFileSizePipe, decorators: [{
3128
+ type: Pipe,
3129
+ args: [{ name: 'formatFileSize' }]
3130
+ }] });
3131
+
3132
+ /** Extensions rendues en VRAIE miniature. Le reste tombe sur le picto d'extension. */
3133
+ const IMAGE_EXTENSIONS = ['png', 'jpg', 'jpeg', 'gif', 'webp'];
3134
+ /**
3135
+ * Picto par extension. Le sprite ne porte que `pdf` / `doc` / `xls` / `zip` : les familles
3136
+ * voisines y sont rabattues (csv sur xls, odt sur doc, …) et tout le reste sur `file`.
3137
+ */
3138
+ const EXTENSION_ICONS = {
3139
+ pdf: SpriteIconEnum.pdf,
3140
+ doc: SpriteIconEnum.doc,
3141
+ docx: SpriteIconEnum.doc,
3142
+ odt: SpriteIconEnum.doc,
3143
+ rtf: SpriteIconEnum.doc,
3144
+ xls: SpriteIconEnum.xls,
3145
+ xlsx: SpriteIconEnum.xls,
3146
+ ods: SpriteIconEnum.xls,
3147
+ csv: SpriteIconEnum.xls,
3148
+ zip: SpriteIconEnum.zip,
3149
+ rar: SpriteIconEnum.zip,
3150
+ '7z': SpriteIconEnum.zip,
3151
+ gz: SpriteIconEnum.zip,
3152
+ };
3153
+ /**
3154
+ * Apercu d'UN fichier : tuile bordee (miniature si c'est une image, sinon picto d'extension),
3155
+ * nom et « EXT · poids » dessous, et deux actions en surimpression de la tuile — « Visualiser »
3156
+ * (ouvre dans un nouvel onglet) et « Supprimer ».
3157
+ *
3158
+ * Deux sources, `file` prioritaire sur `existingFile` :
3159
+ * - `file` : le fichier que l'utilisateur vient de choisir. Le composant cree ET
3160
+ * revoque lui-meme l'objectURL — l'hote n'a aucun cycle de vie a gerer.
3161
+ * - `existingFile` : un fichier deja stocke cote serveur, decrit par `{ url, name, sizeKb }`.
3162
+ *
3163
+ * Le composant ne mute rien : « Supprimer » emet `(remove)`, a charge de l'hote (ou de
3164
+ * `cw-form-field`, qui le branche sur son propre vidage) de decider ce que ca veut dire.
3165
+ *
3166
+ * Rendu base sur les tokens DS (BOU) `File Upload / Picture` et `_File Upload / File`.
3167
+ */
3168
+ class FilePreviewComponent {
3169
+ constructor() {
3170
+ /** Fichier fraichement selectionne. Prioritaire sur `existingFile`. */
3171
+ this.file = input(null, ...(ngDevMode ? [{ debugName: "file" }] : []));
3172
+ /** Fichier deja enregistre cote serveur. Utilise tant qu'aucun `file` n'est fourni. */
3173
+ this.existingFile = input(null, ...(ngDevMode ? [{ debugName: "existingFile" }] : []));
3174
+ /** Boutons « Visualiser » / « Supprimer » sur la tuile. */
3175
+ this.showActions = input(true, ...(ngDevMode ? [{ debugName: "showActions" }] : []));
3176
+ /** Grise le bouton de suppression (le lien « Visualiser » reste actif : consulter n'ecrit rien). */
3177
+ this.disabled = input(false, ...(ngDevMode ? [{ debugName: "disabled" }] : []));
3178
+ this.dataTest = input(...(ngDevMode ? [undefined, { debugName: "dataTest" }] : []));
3179
+ /** Clic sur « Supprimer ». Le composant ne vide rien de lui-meme. */
3180
+ this.remove = output();
3181
+ this.iconSize = IconSizeEnum;
3182
+ this.spriteIcon = SpriteIconEnum;
3183
+ this.buttonType = BoButtonTypeEnum;
3184
+ this.buttonIconSize = ButtonIconSizeEnum;
3185
+ /** objectURL du `File` courant. Cree et revoque par l'effet ci-dessous, jamais par l'hote. */
3186
+ this.objectUrl = signal(null, ...(ngDevMode ? [{ debugName: "objectUrl" }] : []));
3187
+ this.name = computed(() => this.file()?.name ?? this.existingFile()?.name ?? '', ...(ngDevMode ? [{ debugName: "name" }] : []));
3188
+ this.url = computed(() => this.file() ? this.objectUrl() : (this.existingFile()?.url ?? null), ...(ngDevMode ? [{ debugName: "url" }] : []));
3189
+ /** Poids en octets : natif pour un `File`, converti depuis les Ko pour un fichier serveur. */
3190
+ this.sizeInBytes = computed(() => {
3191
+ const file = this.file();
3192
+ if (file)
3193
+ return file.size;
3194
+ const sizeKb = this.existingFile()?.sizeKb;
3195
+ return sizeKb != null ? sizeKb * 1024 : null;
3196
+ }, ...(ngDevMode ? [{ debugName: "sizeInBytes" }] : []));
3197
+ this.extension = computed(() => {
3198
+ const name = this.name();
3199
+ const dot = name.lastIndexOf('.');
3200
+ return dot > -1 ? name.slice(dot + 1).toLowerCase() : '';
3201
+ }, ...(ngDevMode ? [{ debugName: "extension" }] : []));
3202
+ this.isImage = computed(() => IMAGE_EXTENSIONS.includes(this.extension()), ...(ngDevMode ? [{ debugName: "isImage" }] : []));
3203
+ this.icon = computed(() => EXTENSION_ICONS[this.extension()] ?? SpriteIconEnum.file, ...(ngDevMode ? [{ debugName: "icon" }] : []));
3204
+ // Un objectURL vit jusqu'a sa revocation explicite : sans ce nettoyage, chaque fichier
3205
+ // choisi fuiterait pour la duree de la page. `onCleanup` couvre les deux sorties —
3206
+ // changement de fichier et destruction du composant.
3207
+ effect(onCleanup => {
3208
+ const file = this.file();
3209
+ if (!file) {
3210
+ this.objectUrl.set(null);
3211
+ return;
3212
+ }
3213
+ const url = URL.createObjectURL(file);
3214
+ this.objectUrl.set(url);
3215
+ onCleanup(() => URL.revokeObjectURL(url));
3216
+ });
3217
+ }
3218
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: FilePreviewComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
3219
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.20", type: FilePreviewComponent, isStandalone: true, selector: "cw-file-preview", inputs: { file: { classPropertyName: "file", publicName: "file", isSignal: true, isRequired: false, transformFunction: null }, existingFile: { classPropertyName: "existingFile", publicName: "existingFile", isSignal: true, isRequired: false, transformFunction: null }, showActions: { classPropertyName: "showActions", publicName: "showActions", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, dataTest: { classPropertyName: "dataTest", publicName: "dataTest", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { remove: "remove" }, ngImport: i0, template: "@if (name()) {\n <figure class=\"file-preview\" [attr.data-test-ctw]=\"dataTest() || null\">\n <div class=\"file-preview-tile\" [class.file-preview-tile-icon]=\"!isImage() || !url()\">\n @if (isImage() && url(); as source) {\n <img class=\"file-preview-img\" [src]=\"source\" [alt]=\"name()\" />\n } @else {\n <!-- Pas de miniature possible (pdf, doc, archive\u2026) : picto de la famille d'extension. -->\n <cw-icon [icon]=\"icon()\" [iconSize]=\"iconSize['2xl']\" />\n }\n\n @if (showActions()) {\n <div class=\"file-preview-actions\">\n @if (url(); as href) {\n <!-- Vrai lien : c'est une navigation, pas une commande. Reste correct au clavier,\n annonce comme lien, et ouvrable dans un onglet par le menu contextuel.\n `cw-button` n'est pas utilisable ici : son input `link` pose un `routerLink`\n (route interne), pas un href externe ouvert dans un onglet. On reprend donc\n a la main les classes qu'il aurait emises, pour un rendu strictement identique. -->\n <a class=\"btn btn-secondary btn-icon btn-icon-xsmall\" [href]=\"href\" target=\"_blank\" rel=\"noopener\"\n [attr.aria-label]=\"'_COMMON._ACTION.VIEW' | translate\">\n <cw-icon [icon]=\"spriteIcon.newWindow\" [iconSize]=\"iconSize.xs\" />\n </a>\n }\n\n <cw-button [type]=\"buttonType.secondary\" [withIcon]=\"spriteIcon.trash\" [withOnlyIcon]=\"true\"\n [iconSize]=\"buttonIconSize.xsmall\" [label]=\"'_COMMON._ACTION.DELETE'\"\n [isDisabled]=\"disabled()\" (btnAction)=\"remove.emit()\" />\n </div>\n }\n </div>\n\n <figcaption class=\"file-preview-meta\">\n <span class=\"file-preview-name\">{{ name() }}</span>\n\n <span class=\"file-preview-info\">\n @if (extension()) {\n <span>{{ extension().toUpperCase() }}</span>\n }\n @if (sizeInBytes(); as bytes) {\n <span>{{ bytes | formatFileSize }}</span>\n }\n </span>\n </figcaption>\n </figure>\n}\n", dependencies: [{ 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: "pipe", type: TranslatePipe, name: "translate" }, { kind: "pipe", type: FormatFileSizePipe, name: "formatFileSize" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
3220
+ }
3221
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: FilePreviewComponent, decorators: [{
3222
+ type: Component,
3223
+ args: [{ selector: 'cw-file-preview', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, imports: [TranslatePipe, IconComponent, ButtonComponent, FormatFileSizePipe], template: "@if (name()) {\n <figure class=\"file-preview\" [attr.data-test-ctw]=\"dataTest() || null\">\n <div class=\"file-preview-tile\" [class.file-preview-tile-icon]=\"!isImage() || !url()\">\n @if (isImage() && url(); as source) {\n <img class=\"file-preview-img\" [src]=\"source\" [alt]=\"name()\" />\n } @else {\n <!-- Pas de miniature possible (pdf, doc, archive\u2026) : picto de la famille d'extension. -->\n <cw-icon [icon]=\"icon()\" [iconSize]=\"iconSize['2xl']\" />\n }\n\n @if (showActions()) {\n <div class=\"file-preview-actions\">\n @if (url(); as href) {\n <!-- Vrai lien : c'est une navigation, pas une commande. Reste correct au clavier,\n annonce comme lien, et ouvrable dans un onglet par le menu contextuel.\n `cw-button` n'est pas utilisable ici : son input `link` pose un `routerLink`\n (route interne), pas un href externe ouvert dans un onglet. On reprend donc\n a la main les classes qu'il aurait emises, pour un rendu strictement identique. -->\n <a class=\"btn btn-secondary btn-icon btn-icon-xsmall\" [href]=\"href\" target=\"_blank\" rel=\"noopener\"\n [attr.aria-label]=\"'_COMMON._ACTION.VIEW' | translate\">\n <cw-icon [icon]=\"spriteIcon.newWindow\" [iconSize]=\"iconSize.xs\" />\n </a>\n }\n\n <cw-button [type]=\"buttonType.secondary\" [withIcon]=\"spriteIcon.trash\" [withOnlyIcon]=\"true\"\n [iconSize]=\"buttonIconSize.xsmall\" [label]=\"'_COMMON._ACTION.DELETE'\"\n [isDisabled]=\"disabled()\" (btnAction)=\"remove.emit()\" />\n </div>\n }\n </div>\n\n <figcaption class=\"file-preview-meta\">\n <span class=\"file-preview-name\">{{ name() }}</span>\n\n <span class=\"file-preview-info\">\n @if (extension()) {\n <span>{{ extension().toUpperCase() }}</span>\n }\n @if (sizeInBytes(); as bytes) {\n <span>{{ bytes | formatFileSize }}</span>\n }\n </span>\n </figcaption>\n </figure>\n}\n" }]
3224
+ }], ctorParameters: () => [], propDecorators: { file: [{ type: i0.Input, args: [{ isSignal: true, alias: "file", required: false }] }], existingFile: [{ type: i0.Input, args: [{ isSignal: true, alias: "existingFile", required: false }] }], showActions: [{ type: i0.Input, args: [{ isSignal: true, alias: "showActions", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], dataTest: [{ type: i0.Input, args: [{ isSignal: true, alias: "dataTest", required: false }] }], remove: [{ type: i0.Output, args: ["remove"] }] } });
3225
+
3105
3226
  function rangeValidator(group, type) {
3106
3227
  const startControl = group.get('start');
3107
3228
  const endControl = group.get('end');
@@ -3179,6 +3300,12 @@ class FormFieldComponent {
3179
3300
  this.appendTo = 'body';
3180
3301
  /** Code pays ISO 3166-1 alpha-2 utilisé comme pays initial pour `type=phone` (ex. 'fr', 'be'). */
3181
3302
  this.initialCountry = 'fr';
3303
+ /**
3304
+ * `type=file` : affiche sous le champ un aperçu du fichier (`cw-file-preview`) — miniature
3305
+ * si c'est une image, sinon picto d'extension, avec « Visualiser » et « Supprimer ».
3306
+ * La croix native du champ reste en place : les deux vident le même control.
3307
+ */
3308
+ this.showPreview = false;
3182
3309
  this.indeterminate = input(false, ...(ngDevMode ? [{ debugName: "indeterminate" }] : []));
3183
3310
  this.checkboxInputRef = viewChild('checkboxInput', ...(ngDevMode ? [{ debugName: "checkboxInputRef" }] : []));
3184
3311
  this.fileInputRef = viewChild('fileInput', ...(ngDevMode ? [{ debugName: "fileInputRef" }] : []));
@@ -3198,6 +3325,12 @@ class FormFieldComponent {
3198
3325
  /** True si c'est nous (via l'input `isDisabled`) qui avons désactivé le control — sert à ne ré-activer que ce qu'on a désactivé. */
3199
3326
  this.disabledAppliedByUs = false;
3200
3327
  this.refreshEvent = new EventEmitter();
3328
+ /**
3329
+ * Suppression demandée depuis l'aperçu. Émis EN PLUS du vidage du control, parce que le
3330
+ * control peut déjà valoir `null` quand seul `existingFile` est affiché : `setValue(null)`
3331
+ * n'émettrait alors rien et l'hôte n'aurait aucun moyen de savoir qu'on a supprimé.
3332
+ */
3333
+ this.fileRemoved = new EventEmitter();
3201
3334
  this.textChanged = new EventEmitter();
3202
3335
  this.valueChange = new EventEmitter();
3203
3336
  /**
@@ -3421,6 +3554,8 @@ class FormFieldComponent {
3421
3554
  entries.push({ key: '_COMMON._FORM.HELP_FILE_ACCEPT', params: { accept: this.acceptLabel } });
3422
3555
  if (opts.maxSize != null)
3423
3556
  entries.push({ key: '_COMMON._FORM.HELP_FILE_SIZE', params: { maxSize: this.maxSizeLabel } });
3557
+ if (this.recommendedDimensions)
3558
+ entries.push({ key: '_COMMON._FORM.HELP_FILE_DIMENSIONS', params: { dimensions: this.recommendedDimensions } });
3424
3559
  }
3425
3560
  return entries;
3426
3561
  }
@@ -3850,6 +3985,44 @@ class FormFieldComponent {
3850
3985
  const input = this.elementRef.nativeElement.querySelector(`#${CSS.escape(this.name + '_' + path)}`);
3851
3986
  input?.focus();
3852
3987
  }
3988
+ /**
3989
+ * Nom du fichier affiché dans le champ. Le control porte soit un `File`, soit un simple nom
3990
+ * (cas d'un fichier déjà enregistré côté serveur, que l'input natif ne peut pas représenter).
3991
+ */
3992
+ get selectedFileName() {
3993
+ const value = this.formControl?.value;
3994
+ if (value instanceof File)
3995
+ return value.name;
3996
+ return typeof value === 'string' && value.length > 0 ? value : null;
3997
+ }
3998
+ /**
3999
+ * Ouvre le sélecteur de fichier depuis la couche visuelle (l'input natif est masqué).
4000
+ * Un `<label for>` aurait suffi pour le clic, mais il se serait ajouté au libellé du champ
4001
+ * dans le nom accessible de l'input (« Photo de profil Choisir un fichier »).
4002
+ */
4003
+ openFilePicker() {
4004
+ if (this.isEffectivelyDisabled || this.isReadonly)
4005
+ return;
4006
+ this.fileInputRef()?.nativeElement.click();
4007
+ }
4008
+ /** Valeur du control quand c'est un vrai `File` (elle peut aussi être un simple nom en string). */
4009
+ get previewFile() {
4010
+ return this.formControl?.value instanceof File ? this.formControl.value : null;
4011
+ }
4012
+ /** L'aperçu n'a de sens que sur `type=file`, activé, et avec quelque chose à montrer. */
4013
+ get isPreviewVisible() {
4014
+ return this.showPreview
4015
+ && this.type === this.typeField.file
4016
+ && (!!this.previewFile || !!this.existingFile);
4017
+ }
4018
+ /**
4019
+ * Poubelle de l'aperçu : rigoureusement la même chose que la croix du champ (vidage du
4020
+ * control, reset de l'input natif, focus rendu), plus l'événement pour le cas `existingFile`.
4021
+ */
4022
+ onPreviewRemove() {
4023
+ this.onClearField(this.formControl);
4024
+ this.fileRemoved.emit();
4025
+ }
3853
4026
  onClearField(control) {
3854
4027
  control?.setValue(null);
3855
4028
  control?.markAsPristine();
@@ -3933,7 +4106,7 @@ class FormFieldComponent {
3933
4106
  this.formControl.markAsTouched();
3934
4107
  }
3935
4108
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: FormFieldComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
3936
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.20", type: FormFieldComponent, isStandalone: true, selector: "cw-form-field", inputs: { control: { classPropertyName: "control", publicName: "control", isSignal: false, isRequired: false, transformFunction: null }, formGroup: { classPropertyName: "formGroup", publicName: "formGroup", isSignal: false, isRequired: false, transformFunction: null }, type: { classPropertyName: "type", publicName: "type", isSignal: false, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: false, isRequired: false, transformFunction: null }, displayLabel: { classPropertyName: "displayLabel", publicName: "displayLabel", isSignal: false, isRequired: false, transformFunction: null }, name: { classPropertyName: "name", publicName: "name", isSignal: false, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: false, isRequired: false, transformFunction: null }, autocomplete: { classPropertyName: "autocomplete", publicName: "autocomplete", isSignal: false, isRequired: false, transformFunction: null }, options: { classPropertyName: "options", publicName: "options", isSignal: false, isRequired: false, transformFunction: null }, rangeOptions: { classPropertyName: "rangeOptions", publicName: "rangeOptions", isSignal: false, isRequired: false, transformFunction: null }, validationOptions: { classPropertyName: "validationOptions", publicName: "validationOptions", isSignal: false, isRequired: false, transformFunction: null }, autocompleteOptions: { classPropertyName: "autocompleteOptions", publicName: "autocompleteOptions", isSignal: false, isRequired: false, transformFunction: null }, richTextOptions: { classPropertyName: "richTextOptions", publicName: "richTextOptions", isSignal: false, isRequired: false, transformFunction: null }, errorMessages: { classPropertyName: "errorMessages", publicName: "errorMessages", isSignal: false, isRequired: false, transformFunction: null }, isRequired: { classPropertyName: "isRequired", publicName: "isRequired", isSignal: false, isRequired: false, transformFunction: null }, help: { classPropertyName: "help", publicName: "help", isSignal: false, isRequired: false, transformFunction: null }, tooltip: { classPropertyName: "tooltip", publicName: "tooltip", isSignal: false, isRequired: false, transformFunction: null }, addonLeft: { classPropertyName: "addonLeft", publicName: "addonLeft", isSignal: false, isRequired: false, transformFunction: null }, addonRight: { classPropertyName: "addonRight", publicName: "addonRight", isSignal: false, isRequired: false, transformFunction: null }, isInAddon: { classPropertyName: "isInAddon", publicName: "isInAddon", isSignal: false, isRequired: false, transformFunction: null }, isReadonly: { classPropertyName: "isReadonly", publicName: "isReadonly", isSignal: false, isRequired: false, transformFunction: null }, isDisabled: { classPropertyName: "isDisabled", publicName: "isDisabled", isSignal: false, isRequired: false, transformFunction: null }, sliderValue: { classPropertyName: "sliderValue", publicName: "sliderValue", isSignal: false, isRequired: false, transformFunction: null }, sliderOptions: { classPropertyName: "sliderOptions", publicName: "sliderOptions", isSignal: false, isRequired: false, transformFunction: null }, cssClass: { classPropertyName: "cssClass", publicName: "cssClass", isSignal: false, isRequired: false, transformFunction: null }, skeletonMode: { classPropertyName: "skeletonMode", publicName: "skeletonMode", isSignal: false, isRequired: false, transformFunction: null }, clearable: { classPropertyName: "clearable", publicName: "clearable", isSignal: false, isRequired: false, transformFunction: null }, appendTo: { classPropertyName: "appendTo", publicName: "appendTo", isSignal: false, isRequired: false, transformFunction: null }, initialCountry: { classPropertyName: "initialCountry", publicName: "initialCountry", isSignal: false, isRequired: false, transformFunction: null }, indeterminate: { classPropertyName: "indeterminate", publicName: "indeterminate", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { refreshEvent: "refreshEvent", textChanged: "textChanged", valueChange: "valueChange", phoneRegionChange: "phoneRegionChange" }, host: { properties: { "class": "this.hostClasses" } }, queries: [{ propertyName: "optionTemplate", first: true, predicate: ["ngOptionTpl"], descendants: true, read: TemplateRef }, { propertyName: "labelTemplate", first: true, predicate: ["ngLabelTpl"], descendants: true, read: TemplateRef }], viewQueries: [{ propertyName: "checkboxInputRef", first: true, predicate: ["checkboxInput"], descendants: true, isSignal: true }, { propertyName: "fileInputRef", first: true, predicate: ["fileInput"], descendants: true, isSignal: true }, { propertyName: "phoneInputRef", first: true, predicate: ["phoneInput"], descendants: true, isSignal: true }, { propertyName: "autocompleteRef", first: true, predicate: AutocompleteComponent, descendants: true, isSignal: true }], usesOnChanges: true, ngImport: i0, template: "@if (!isInAddon) {\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 <!-- 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 <input #fileInput type=\"file\" class=\"field-control\" [id]=\"name\"\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\" [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\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: "pipe", type: i1.KeyValuePipe, name: "keyvalue" }, { kind: "pipe", type: i2.TranslatePipe, name: "translate" }] }); }
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" }] }); }
3937
4110
  }
3938
4111
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: FormFieldComponent, decorators: [{
3939
4112
  type: Component,
@@ -3947,8 +4120,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.20", ngImpo
3947
4120
  IconComponent,
3948
4121
  ButtonComponent,
3949
4122
  AutocompleteComponent,
3950
- RichTextEditorComponent
3951
- ], 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 <!-- 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 <input #fileInput type=\"file\" class=\"field-control\" [id]=\"name\"\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\" [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\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" }]
4123
+ RichTextEditorComponent,
4124
+ 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" }]
3952
4126
  }], ctorParameters: () => [], propDecorators: { control: [{
3953
4127
  type: Input
3954
4128
  }], formGroup: [{
@@ -4007,8 +4181,16 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.20", ngImpo
4007
4181
  type: Input
4008
4182
  }], initialCountry: [{
4009
4183
  type: Input
4184
+ }], recommendedDimensions: [{
4185
+ type: Input
4186
+ }], showPreview: [{
4187
+ type: Input
4188
+ }], existingFile: [{
4189
+ type: Input
4010
4190
  }], indeterminate: [{ type: i0.Input, args: [{ isSignal: true, alias: "indeterminate", required: false }] }], checkboxInputRef: [{ type: i0.ViewChild, args: ['checkboxInput', { isSignal: true }] }], fileInputRef: [{ type: i0.ViewChild, args: ['fileInput', { isSignal: true }] }], phoneInputRef: [{ type: i0.ViewChild, args: ['phoneInput', { isSignal: true }] }], autocompleteRef: [{ type: i0.ViewChild, args: [i0.forwardRef(() => AutocompleteComponent), { isSignal: true }] }], refreshEvent: [{
4011
4191
  type: Output
4192
+ }], fileRemoved: [{
4193
+ type: Output
4012
4194
  }], textChanged: [{
4013
4195
  type: Output
4014
4196
  }], valueChange: [{
@@ -4591,33 +4773,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.20", ngImpo
4591
4773
  ], template: "<ul class=\"stepper\" role=\"list\" [attr.aria-label]=\"label() | translate\">\n @for (step of steps(); track step; let i = $index) {\n <li id=\"step-{{i}}\" class=\"stepper-item\" [ngClass]=\"{\n 'stepper-item-current': i === activeStep(),\n 'stepper-item-completed': i < activeStep()}\"\n [attr.aria-current]=\"i === activeStep() ? 'step' : null\">\n <span class=\"stepper-label\">\n <span class=\"visually-hidden\">{{i + 1}}</span>\n {{step | translate}}\n </span>\n </li>\n }\n</ul>\n" }]
4592
4774
  }], propDecorators: { activeStep: [{ type: i0.Input, args: [{ isSignal: true, alias: "activeStep", required: false }] }], steps: [{ type: i0.Input, args: [{ isSignal: true, alias: "steps", required: false }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }] } });
4593
4775
 
4594
- const FILE_SIZE_UNITS_FR = ['o', 'Ko', 'Mo', 'Go', 'To', 'Po', 'Eo', 'Zo', 'Yo'];
4595
- const FILE_SIZE_UNITS_DEFAULT = ['B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'];
4596
- class FormatFileSizePipe {
4597
- constructor() {
4598
- this.translate = inject(TranslateService);
4599
- }
4600
- transform(sizeInBytes) {
4601
- const units = this.translate.currentLang === 'fr' ? FILE_SIZE_UNITS_FR : FILE_SIZE_UNITS_DEFAULT;
4602
- // Garde: 0/negatif/nullish -> Math.log donne -Infinity => 'NaN undefined'.
4603
- if (!sizeInBytes || sizeInBytes < 1) {
4604
- return `0 ${units[0]}`;
4605
- }
4606
- let power = Math.round(Math.log(sizeInBytes) / Math.log(1024));
4607
- power = Math.max(0, Math.min(power, units.length - 1));
4608
- const size = sizeInBytes / Math.pow(1024, power); // size in new units
4609
- const formattedSize = Math.round(size * 10) / 10; // keep up to 1 decimal
4610
- const unit = units[power];
4611
- return `${formattedSize} ${unit}`;
4612
- }
4613
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: FormatFileSizePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
4614
- static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "20.3.20", ngImport: i0, type: FormatFileSizePipe, isStandalone: true, name: "formatFileSize" }); }
4615
- }
4616
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: FormatFileSizePipe, decorators: [{
4617
- type: Pipe,
4618
- args: [{ name: 'formatFileSize' }]
4619
- }] });
4620
-
4621
4776
  class FileToDownloadComponent {
4622
4777
  constructor() {
4623
4778
  this.iconType = IconTypeEnum;
@@ -5446,5 +5601,5 @@ const CW_DEFAULT_THEME_OPTIONS = [
5446
5601
  * Generated bundle index. Do not edit.
5447
5602
  */
5448
5603
 
5449
- export { AccordionComponent, AlertComponent, AlertTypeEnum, BadgeComponent, BadgePositionEnum, BadgeTypeEnum, BoButtonTypeEnum, BoTabTypeEnum, BreadcrumbComponent, ButtonComponent, ButtonIconSizeEnum, ButtonPositionEnum, CW_DEFAULT_THEME_OPTIONS, CardComponent, CardTitleRankEnum, CardTypeEnum, ClickOutsideDirective, CollapseDirective, CwThemeKeyEnum, CwTooltipDirective, DropdownComponent, DropdownItemDirective, DropdownPositionEnum, EmptyStateComponent, EmptyStateIllustrationEnum, FileDropComponent, FileDropFileStatusEnum, FileDropModeEnum, FileDropRejectReasonEnum, FileToDownloadComponent, FoButtonTypeEnum, FoTabTypeEnum, FocusTrackerService, FormFieldComponent, FormFieldTypeEnum, IconComponent, IconNotifSizeEnum, IconNotifTypeEnum, IconNotificationComponent, IconSizeEnum, IconTypeEnum, IconUiTypeEnum, ImageComponent, LanguageSelectorComponent, LegendColorEnum, LegendComponent, LegendTypeEnum, LoaderComponent, LoaderSizeEnum, ModalsComponent, ModalsService, ModalsSize, ModalsState, ModalsTextType, ModalsType, NumericalRangeComponent, NumericalRangeLabelPositionEnum, NumericalRangeTypeEnum, PlacementEnum, RequiredInfoComponent, ResponsiveService, SkipLinksComponent, SpriteIconEnum, StepperComponent, TOAST_AUTOHIDE_DELAY_MS, TabComponent, TabContentComponent, ThemeSelectorComponent, ThemeService, TitleComponent, TitleContextEnum, TitleTagEnum, ToastComponent, ToastItemComponent, ToastService, TooltipPositionEnum, TriggerTooltipEnum, TypeTooltipEnum, rangeValidator, resolveArrowPos };
5604
+ export { AccordionComponent, AlertComponent, AlertTypeEnum, BadgeComponent, BadgePositionEnum, BadgeTypeEnum, BoButtonTypeEnum, BoTabTypeEnum, BreadcrumbComponent, ButtonComponent, ButtonIconSizeEnum, ButtonPositionEnum, CW_DEFAULT_THEME_OPTIONS, CardComponent, CardTitleRankEnum, CardTypeEnum, ClickOutsideDirective, CollapseDirective, CwThemeKeyEnum, CwTooltipDirective, DropdownComponent, DropdownItemDirective, DropdownPositionEnum, EmptyStateComponent, EmptyStateIllustrationEnum, FileDropComponent, FileDropFileStatusEnum, FileDropModeEnum, FileDropRejectReasonEnum, FilePreviewComponent, FileToDownloadComponent, FoButtonTypeEnum, FoTabTypeEnum, FocusTrackerService, FormFieldComponent, FormFieldTypeEnum, IconComponent, IconNotifSizeEnum, IconNotifTypeEnum, IconNotificationComponent, IconSizeEnum, IconTypeEnum, IconUiTypeEnum, ImageComponent, LanguageSelectorComponent, LegendColorEnum, LegendComponent, LegendTypeEnum, LoaderComponent, LoaderSizeEnum, ModalsComponent, ModalsService, ModalsSize, ModalsState, ModalsTextType, ModalsType, NumericalRangeComponent, NumericalRangeLabelPositionEnum, NumericalRangeTypeEnum, PlacementEnum, RequiredInfoComponent, ResponsiveService, SkipLinksComponent, SpriteIconEnum, StepperComponent, TOAST_AUTOHIDE_DELAY_MS, TabComponent, TabContentComponent, ThemeSelectorComponent, ThemeService, TitleComponent, TitleContextEnum, TitleTagEnum, ToastComponent, ToastItemComponent, ToastService, TooltipPositionEnum, TriggerTooltipEnum, TypeTooltipEnum, rangeValidator, resolveArrowPos };
5450
5605
  //# sourceMappingURL=cityway-basic-ui.mjs.map