@cityway/bo-ui 1.1.0-beta005 → 1.1.0-beta006

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,17 +1,17 @@
1
1
  import * as i0 from '@angular/core';
2
- import { input, ChangeDetectionStrategy, Component, output, effect, HostListener, Directive, computed, inject, contentChild, signal, isSignal, DestroyRef, afterNextRender, viewChild, contentChildren } from '@angular/core';
3
- import * as i1$1 from '@ngx-translate/core';
4
- import { TranslateModule } from '@ngx-translate/core';
5
- import * as i1 from '@angular/common';
6
- import { CommonModule, NgTemplateOutlet, Location } from '@angular/common';
7
- import * as i2 from '@angular/cdk/drag-drop';
2
+ import { input, ChangeDetectionStrategy, Component, output, effect, computed, inject, contentChild, signal, isSignal, DestroyRef, viewChildren, viewChild, afterRenderEffect, afterNextRender, contentChildren } from '@angular/core';
3
+ import * as i1 from '@ngx-translate/core';
4
+ import { TranslateModule, TranslateService } from '@ngx-translate/core';
5
+ import * as i1$3 from '@angular/common';
6
+ import { DatePipe, NgClass, NgTemplateOutlet, Location, CommonModule } from '@angular/common';
7
+ import * as i1$1 from '@angular/cdk/drag-drop';
8
8
  import { moveItemInArray, transferArrayItem, DragDropModule } from '@angular/cdk/drag-drop';
9
- import { CardComponent, SpriteIconEnum, IconSizeEnum, BoButtonTypeEnum, ButtonPositionEnum, ButtonIconSizeEnum, AlertTypeEnum, CardTypeEnum, BadgeComponent, IconComponent, ButtonComponent, AlertComponent, FormFieldTypeEnum, FormFieldComponent, ModalsService, IconTypeEnum, IconUiTypeEnum, EmptyStateIllustrationEnum, BadgeTypeEnum, ModalsType, LoaderComponent, ImageComponent, EmptyStateComponent, DropdownItemDirective } from '@cityway/basic-ui';
9
+ import { CardComponent, SpriteIconEnum, IconSizeEnum, BoButtonTypeEnum, ButtonPositionEnum, ButtonIconSizeEnum, AlertTypeEnum, CardTypeEnum, BadgeComponent, IconComponent, ButtonComponent, AlertComponent, FormFieldTypeEnum, FormFieldComponent, ModalsService, IconTypeEnum, IconUiTypeEnum, EmptyStateIllustrationEnum, BadgeTypeEnum, ModalsType, LoaderComponent, ImageComponent, EmptyStateComponent, ToastService, DropdownItemDirective, LoaderSizeEnum, AccordionComponent, FileDropComponent, FileToDownloadComponent } from '@cityway/basic-ui';
10
+ import { takeUntilDestroyed, toSignal } from '@angular/core/rxjs-interop';
10
11
  import * as i1$2 from '@angular/forms';
11
12
  import { FormControl, ReactiveFormsModule, FormGroup } from '@angular/forms';
12
- import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
13
13
  import { Router, ActivatedRoute } from '@angular/router';
14
- import { debounceTime } from 'rxjs';
14
+ import { debounceTime, take, map } from 'rxjs';
15
15
  import { HttpParams } from '@angular/common/http';
16
16
 
17
17
  class CustomListComponent {
@@ -34,12 +34,12 @@ class CustomListComponent {
34
34
  return true;
35
35
  }
36
36
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: CustomListComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
37
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.20", type: CustomListComponent, isStandalone: true, selector: "cw-custom-list", inputs: { customListData: { classPropertyName: "customListData", publicName: "customListData", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<div class=\"card custom-card-light\">\r\n <div class=\"card-body d-flex-v gap-md\">\r\n @for (group of customListData(); track group.title) {\r\n @if (group.title) {\r\n <h3>{{ group.title | translate }}</h3>\r\n }\r\n\r\n <ul class=\"custom-description-list list-unstyled fs fs-sm\">\r\n @for (field of group.fields; track field.label) {\r\n @if (!field.hideIfEmpty || hasValue(field.value)) {\r\n <li>\r\n <div class=\"fs fw-bold\" [innerHTML]=\"'_LABEL.COLON' | translate: { label: (field.label | translate) }\"></div>\r\n <div>\r\n @switch (field.type) {\r\n @case ('date') {\r\n {{ field.value | date: 'short' }}\r\n }\r\n @case ('boolean') {\r\n {{ (field.value ? '_COMMON._PRO_SENTENCE.YES' : '_COMMON._PRO_SENTENCE.NO') | translate }}\r\n }\r\n @case ('html') {\r\n <span [innerHTML]=\"field.value\"></span>\r\n }\r\n @default {\r\n {{ field.translateValue ? (field.value | translate) : field.value }}\r\n }\r\n }\r\n </div>\r\n </li>\r\n }\r\n }\r\n </ul>\r\n }\r\n </div>\r\n</div>\r\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: TranslateModule }, { kind: "pipe", type: i1.DatePipe, name: "date" }, { kind: "pipe", type: i1$1.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
37
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.20", type: CustomListComponent, isStandalone: true, selector: "cw-custom-list", inputs: { customListData: { classPropertyName: "customListData", publicName: "customListData", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<div class=\"card custom-card-light\">\r\n <div class=\"card-body d-flex-v gap-md\">\r\n @for (group of customListData(); track group.title) {\r\n @if (group.title) {\r\n <h3>{{ group.title | translate }}</h3>\r\n }\r\n\r\n <ul class=\"custom-description-list list-unstyled fs fs-sm\">\r\n @for (field of group.fields; track field.label) {\r\n @if (!field.hideIfEmpty || hasValue(field.value)) {\r\n <li>\r\n <div class=\"fs fw-bold\" [innerHTML]=\"'_LABEL.COLON' | translate: { label: (field.label | translate) }\"></div>\r\n <div>\r\n @switch (field.type) {\r\n @case ('date') {\r\n {{ field.value | date: 'short' }}\r\n }\r\n @case ('boolean') {\r\n {{ (field.value ? '_COMMON._PRO_SENTENCE.YES' : '_COMMON._PRO_SENTENCE.NO') | translate }}\r\n }\r\n @case ('html') {\r\n <span [innerHTML]=\"field.value\"></span>\r\n }\r\n @default {\r\n {{ field.translateValue ? (field.value | translate) : field.value }}\r\n }\r\n }\r\n </div>\r\n </li>\r\n }\r\n }\r\n </ul>\r\n }\r\n </div>\r\n</div>\r\n", dependencies: [{ kind: "ngmodule", type: TranslateModule }, { kind: "pipe", type: DatePipe, name: "date" }, { kind: "pipe", type: i1.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
38
38
  }
39
39
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: CustomListComponent, decorators: [{
40
40
  type: Component,
41
41
  args: [{ selector: 'cw-custom-list', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, imports: [
42
- CommonModule,
42
+ DatePipe,
43
43
  TranslateModule
44
44
  ], template: "<div class=\"card custom-card-light\">\r\n <div class=\"card-body d-flex-v gap-md\">\r\n @for (group of customListData(); track group.title) {\r\n @if (group.title) {\r\n <h3>{{ group.title | translate }}</h3>\r\n }\r\n\r\n <ul class=\"custom-description-list list-unstyled fs fs-sm\">\r\n @for (field of group.fields; track field.label) {\r\n @if (!field.hideIfEmpty || hasValue(field.value)) {\r\n <li>\r\n <div class=\"fs fw-bold\" [innerHTML]=\"'_LABEL.COLON' | translate: { label: (field.label | translate) }\"></div>\r\n <div>\r\n @switch (field.type) {\r\n @case ('date') {\r\n {{ field.value | date: 'short' }}\r\n }\r\n @case ('boolean') {\r\n {{ (field.value ? '_COMMON._PRO_SENTENCE.YES' : '_COMMON._PRO_SENTENCE.NO') | translate }}\r\n }\r\n @case ('html') {\r\n <span [innerHTML]=\"field.value\"></span>\r\n }\r\n @default {\r\n {{ field.translateValue ? (field.value | translate) : field.value }}\r\n }\r\n }\r\n </div>\r\n </li>\r\n }\r\n }\r\n </ul>\r\n }\r\n </div>\r\n</div>\r\n" }]
45
45
  }], propDecorators: { customListData: [{ type: i0.Input, args: [{ isSignal: true, alias: "customListData", required: false }] }] } });
@@ -149,11 +149,11 @@ class DragNDropListComponent {
149
149
  this.activeItemsChange.emit(this.activeItems());
150
150
  }
151
151
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: DragNDropListComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
152
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.20", type: DragNDropListComponent, isStandalone: true, selector: "cw-drag-n-drop-list", inputs: { availableItems: { classPropertyName: "availableItems", publicName: "availableItems", isSignal: true, isRequired: false, transformFunction: null }, activeItems: { classPropertyName: "activeItems", publicName: "activeItems", isSignal: true, isRequired: false, transformFunction: null }, adapter: { classPropertyName: "adapter", publicName: "adapter", isSignal: true, isRequired: false, transformFunction: null }, itemTemplate: { classPropertyName: "itemTemplate", publicName: "itemTemplate", isSignal: true, isRequired: false, transformFunction: null }, availableColumn: { classPropertyName: "availableColumn", publicName: "availableColumn", isSignal: true, isRequired: false, transformFunction: null }, activeColumn: { classPropertyName: "activeColumn", publicName: "activeColumn", isSignal: true, isRequired: false, transformFunction: null }, reorderOnDrop: { classPropertyName: "reorderOnDrop", publicName: "reorderOnDrop", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { availableItemsChange: "availableItemsChange", activeItemsChange: "activeItemsChange" }, ngImport: i0, template: "<div class=\"drag-drop-list row\">\r\n <div class=\"col-lg-6 d-flex-v gap-4xs\">\r\n <div class=\"fs fs-xs fw-bold\">{{ availableColumn().title | translate }}</div>\r\n @if (availableColumn().description) {\r\n <p class=\"fs fs-xs\">{{ availableColumn().description | translate }}</p>\r\n }\r\n @if (availableColumn().descriptionRwd) {\r\n <p class=\"d-sm-none fs fs-xs\" [innerHTML]=\"availableColumn().descriptionRwd | translate\"></p>\r\n }\r\n <ul class=\"list-unstyled drag-drop-list-column drag-drop-list-column-available\" [ngClass]=\"availableColumn().cssClass\"\r\n cdkDropList #availableList=\"cdkDropList\"\r\n [cdkDropListData]=\"_available\"\r\n [cdkDropListConnectedTo]=\"[activeList]\"\r\n (cdkDropListDropped)=\"drop($event)\">\r\n @for (item of _available; track item.id) {\r\n <li cdkDrag [cdkDragDisabled]=\"item.disabled ?? false\">\r\n <cw-card>\r\n <ng-container *ngTemplateOutlet=\"itemTemplate() || defaultTemplate; context: { $implicit: item }\"/>\r\n </cw-card>\r\n </li>\r\n }\r\n </ul>\r\n </div>\r\n\r\n <div class=\"col-lg-6 d-flex-v gap-4xs\">\r\n <div class=\"fs fs-xs fw-bold\">{{ activeColumn().title | translate }}</div>\r\n @if (activeColumn().description) {\r\n <p class=\"fs fs-xs\">{{ activeColumn().description | translate }}</p>\r\n }\r\n @if (activeColumn().descriptionRwd) {\r\n <p class=\"d-sm-none fs fs-xs\" [innerHTML]=\"activeColumn().descriptionRwd | translate\"></p>\r\n }\r\n <ul class=\"list-unstyled drag-drop-list-column drag-drop-list-column-active\" [ngClass]=\"activeColumn().cssClass\"\r\n cdkDropList #activeList=\"cdkDropList\"\r\n [cdkDropListData]=\"_active\"\r\n [cdkDropListConnectedTo]=\"[availableList]\"\r\n (cdkDropListDropped)=\"drop($event)\">\r\n @for (item of _active; track item.id) {\r\n <li cdkDrag [cdkDragDisabled]=\"item.disabled ?? false\">\r\n <cw-card>\r\n <ng-container *ngTemplateOutlet=\"itemTemplate() || defaultTemplate; context: { $implicit: item }\"/>\r\n </cw-card>\r\n </li>\r\n }\r\n </ul>\r\n </div>\r\n</div>\r\n\r\n<ng-template #defaultTemplate let-item>\r\n <div class=\"default-item d-flex justify-content-between\">\r\n <span>\r\n {{ item.label }}\r\n @if (item.code) { <span class=\"text-muted\">({{ item.code }})</span> }\r\n </span>\r\n @if (item.order != null) {\r\n <span class=\"fw-bold\">#{{ item.order }}</span>\r\n }\r\n </div>\r\n</ng-template>\r\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "ngmodule", type: TranslateModule }, { kind: "ngmodule", type: DragDropModule }, { kind: "directive", type: i2.CdkDropList, selector: "[cdkDropList], cdk-drop-list", inputs: ["cdkDropListConnectedTo", "cdkDropListData", "cdkDropListOrientation", "id", "cdkDropListLockAxis", "cdkDropListDisabled", "cdkDropListSortingDisabled", "cdkDropListEnterPredicate", "cdkDropListSortPredicate", "cdkDropListAutoScrollDisabled", "cdkDropListAutoScrollStep", "cdkDropListElementContainer", "cdkDropListHasAnchor"], outputs: ["cdkDropListDropped", "cdkDropListEntered", "cdkDropListExited", "cdkDropListSorted"], exportAs: ["cdkDropList"] }, { kind: "directive", type: i2.CdkDrag, selector: "[cdkDrag]", inputs: ["cdkDragData", "cdkDragLockAxis", "cdkDragRootElement", "cdkDragBoundary", "cdkDragStartDelay", "cdkDragFreeDragPosition", "cdkDragDisabled", "cdkDragConstrainPosition", "cdkDragPreviewClass", "cdkDragPreviewContainer", "cdkDragScale"], outputs: ["cdkDragStarted", "cdkDragReleased", "cdkDragEnded", "cdkDragEntered", "cdkDragExited", "cdkDragDropped", "cdkDragMoved"], exportAs: ["cdkDrag"] }, { kind: "component", type: CardComponent, selector: "cw-card", inputs: ["title", "subtitle", "type", "titleRank", "cssClass", "collapsible", "collapsed", "disabled", "collapseStretched", "collapseId", "destroyOnHide"], outputs: ["collapsibleChange", "destroyOnHideChange", "collapseClicked"] }, { kind: "pipe", type: i1$1.TranslatePipe, name: "translate" }] }); }
152
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.20", type: DragNDropListComponent, isStandalone: true, selector: "cw-drag-n-drop-list", inputs: { availableItems: { classPropertyName: "availableItems", publicName: "availableItems", isSignal: true, isRequired: false, transformFunction: null }, activeItems: { classPropertyName: "activeItems", publicName: "activeItems", isSignal: true, isRequired: false, transformFunction: null }, adapter: { classPropertyName: "adapter", publicName: "adapter", isSignal: true, isRequired: false, transformFunction: null }, itemTemplate: { classPropertyName: "itemTemplate", publicName: "itemTemplate", isSignal: true, isRequired: false, transformFunction: null }, availableColumn: { classPropertyName: "availableColumn", publicName: "availableColumn", isSignal: true, isRequired: false, transformFunction: null }, activeColumn: { classPropertyName: "activeColumn", publicName: "activeColumn", isSignal: true, isRequired: false, transformFunction: null }, reorderOnDrop: { classPropertyName: "reorderOnDrop", publicName: "reorderOnDrop", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { availableItemsChange: "availableItemsChange", activeItemsChange: "activeItemsChange" }, ngImport: i0, template: "<div class=\"drag-drop-list row\">\r\n <div class=\"col-lg-6 d-flex-v gap-4xs\">\r\n <div class=\"fs fs-xs fw-bold\">{{ availableColumn().title | translate }}</div>\r\n @if (availableColumn().description) {\r\n <p class=\"fs fs-xs\">{{ availableColumn().description | translate }}</p>\r\n }\r\n @if (availableColumn().descriptionRwd) {\r\n <p class=\"d-sm-none fs fs-xs\" [innerHTML]=\"availableColumn().descriptionRwd | translate\"></p>\r\n }\r\n <ul class=\"list-unstyled drag-drop-list-column drag-drop-list-column-available\" [ngClass]=\"availableColumn().cssClass\"\r\n cdkDropList #availableList=\"cdkDropList\"\r\n [cdkDropListData]=\"_available\"\r\n [cdkDropListConnectedTo]=\"[activeList]\"\r\n (cdkDropListDropped)=\"drop($event)\">\r\n @for (item of _available; track item.id) {\r\n <li cdkDrag [cdkDragDisabled]=\"item.disabled ?? false\">\r\n <cw-card>\r\n <ng-container *ngTemplateOutlet=\"itemTemplate() || defaultTemplate; context: { $implicit: item }\"/>\r\n </cw-card>\r\n </li>\r\n }\r\n </ul>\r\n </div>\r\n\r\n <div class=\"col-lg-6 d-flex-v gap-4xs\">\r\n <div class=\"fs fs-xs fw-bold\">{{ activeColumn().title | translate }}</div>\r\n @if (activeColumn().description) {\r\n <p class=\"fs fs-xs\">{{ activeColumn().description | translate }}</p>\r\n }\r\n @if (activeColumn().descriptionRwd) {\r\n <p class=\"d-sm-none fs fs-xs\" [innerHTML]=\"activeColumn().descriptionRwd | translate\"></p>\r\n }\r\n <ul class=\"list-unstyled drag-drop-list-column drag-drop-list-column-active\" [ngClass]=\"activeColumn().cssClass\"\r\n cdkDropList #activeList=\"cdkDropList\"\r\n [cdkDropListData]=\"_active\"\r\n [cdkDropListConnectedTo]=\"[availableList]\"\r\n (cdkDropListDropped)=\"drop($event)\">\r\n @for (item of _active; track item.id) {\r\n <li cdkDrag [cdkDragDisabled]=\"item.disabled ?? false\">\r\n <cw-card>\r\n <ng-container *ngTemplateOutlet=\"itemTemplate() || defaultTemplate; context: { $implicit: item }\"/>\r\n </cw-card>\r\n </li>\r\n }\r\n </ul>\r\n </div>\r\n</div>\r\n\r\n<ng-template #defaultTemplate let-item>\r\n <div class=\"default-item d-flex justify-content-between\">\r\n <span>\r\n {{ item.label }}\r\n @if (item.code) { <span class=\"text-muted\">({{ item.code }})</span> }\r\n </span>\r\n @if (item.order != null) {\r\n <span class=\"fw-bold\">#{{ item.order }}</span>\r\n }\r\n </div>\r\n</ng-template>\r\n", dependencies: [{ kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "ngmodule", type: TranslateModule }, { kind: "ngmodule", type: DragDropModule }, { kind: "directive", type: i1$1.CdkDropList, selector: "[cdkDropList], cdk-drop-list", inputs: ["cdkDropListConnectedTo", "cdkDropListData", "cdkDropListOrientation", "id", "cdkDropListLockAxis", "cdkDropListDisabled", "cdkDropListSortingDisabled", "cdkDropListEnterPredicate", "cdkDropListSortPredicate", "cdkDropListAutoScrollDisabled", "cdkDropListAutoScrollStep", "cdkDropListElementContainer", "cdkDropListHasAnchor"], outputs: ["cdkDropListDropped", "cdkDropListEntered", "cdkDropListExited", "cdkDropListSorted"], exportAs: ["cdkDropList"] }, { kind: "directive", type: i1$1.CdkDrag, selector: "[cdkDrag]", inputs: ["cdkDragData", "cdkDragLockAxis", "cdkDragRootElement", "cdkDragBoundary", "cdkDragStartDelay", "cdkDragFreeDragPosition", "cdkDragDisabled", "cdkDragConstrainPosition", "cdkDragPreviewClass", "cdkDragPreviewContainer", "cdkDragScale"], outputs: ["cdkDragStarted", "cdkDragReleased", "cdkDragEnded", "cdkDragEntered", "cdkDragExited", "cdkDragDropped", "cdkDragMoved"], exportAs: ["cdkDrag"] }, { kind: "component", type: CardComponent, selector: "cw-card", inputs: ["title", "subtitle", "type", "titleRank", "cssClass", "collapsible", "collapsed", "disabled", "collapseLocked", "collapseStretched", "collapseId", "destroyOnHide"], outputs: ["collapsibleChange", "destroyOnHideChange", "collapseClicked"] }, { kind: "pipe", type: i1.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
153
153
  }
154
154
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: DragNDropListComponent, decorators: [{
155
155
  type: Component,
156
- args: [{ selector: 'cw-drag-n-drop-list', standalone: true, imports: [CommonModule, TranslateModule, DragDropModule, CardComponent], template: "<div class=\"drag-drop-list row\">\r\n <div class=\"col-lg-6 d-flex-v gap-4xs\">\r\n <div class=\"fs fs-xs fw-bold\">{{ availableColumn().title | translate }}</div>\r\n @if (availableColumn().description) {\r\n <p class=\"fs fs-xs\">{{ availableColumn().description | translate }}</p>\r\n }\r\n @if (availableColumn().descriptionRwd) {\r\n <p class=\"d-sm-none fs fs-xs\" [innerHTML]=\"availableColumn().descriptionRwd | translate\"></p>\r\n }\r\n <ul class=\"list-unstyled drag-drop-list-column drag-drop-list-column-available\" [ngClass]=\"availableColumn().cssClass\"\r\n cdkDropList #availableList=\"cdkDropList\"\r\n [cdkDropListData]=\"_available\"\r\n [cdkDropListConnectedTo]=\"[activeList]\"\r\n (cdkDropListDropped)=\"drop($event)\">\r\n @for (item of _available; track item.id) {\r\n <li cdkDrag [cdkDragDisabled]=\"item.disabled ?? false\">\r\n <cw-card>\r\n <ng-container *ngTemplateOutlet=\"itemTemplate() || defaultTemplate; context: { $implicit: item }\"/>\r\n </cw-card>\r\n </li>\r\n }\r\n </ul>\r\n </div>\r\n\r\n <div class=\"col-lg-6 d-flex-v gap-4xs\">\r\n <div class=\"fs fs-xs fw-bold\">{{ activeColumn().title | translate }}</div>\r\n @if (activeColumn().description) {\r\n <p class=\"fs fs-xs\">{{ activeColumn().description | translate }}</p>\r\n }\r\n @if (activeColumn().descriptionRwd) {\r\n <p class=\"d-sm-none fs fs-xs\" [innerHTML]=\"activeColumn().descriptionRwd | translate\"></p>\r\n }\r\n <ul class=\"list-unstyled drag-drop-list-column drag-drop-list-column-active\" [ngClass]=\"activeColumn().cssClass\"\r\n cdkDropList #activeList=\"cdkDropList\"\r\n [cdkDropListData]=\"_active\"\r\n [cdkDropListConnectedTo]=\"[availableList]\"\r\n (cdkDropListDropped)=\"drop($event)\">\r\n @for (item of _active; track item.id) {\r\n <li cdkDrag [cdkDragDisabled]=\"item.disabled ?? false\">\r\n <cw-card>\r\n <ng-container *ngTemplateOutlet=\"itemTemplate() || defaultTemplate; context: { $implicit: item }\"/>\r\n </cw-card>\r\n </li>\r\n }\r\n </ul>\r\n </div>\r\n</div>\r\n\r\n<ng-template #defaultTemplate let-item>\r\n <div class=\"default-item d-flex justify-content-between\">\r\n <span>\r\n {{ item.label }}\r\n @if (item.code) { <span class=\"text-muted\">({{ item.code }})</span> }\r\n </span>\r\n @if (item.order != null) {\r\n <span class=\"fw-bold\">#{{ item.order }}</span>\r\n }\r\n </div>\r\n</ng-template>\r\n" }]
156
+ args: [{ selector: 'cw-drag-n-drop-list', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, imports: [NgClass, NgTemplateOutlet, TranslateModule, DragDropModule, CardComponent], template: "<div class=\"drag-drop-list row\">\r\n <div class=\"col-lg-6 d-flex-v gap-4xs\">\r\n <div class=\"fs fs-xs fw-bold\">{{ availableColumn().title | translate }}</div>\r\n @if (availableColumn().description) {\r\n <p class=\"fs fs-xs\">{{ availableColumn().description | translate }}</p>\r\n }\r\n @if (availableColumn().descriptionRwd) {\r\n <p class=\"d-sm-none fs fs-xs\" [innerHTML]=\"availableColumn().descriptionRwd | translate\"></p>\r\n }\r\n <ul class=\"list-unstyled drag-drop-list-column drag-drop-list-column-available\" [ngClass]=\"availableColumn().cssClass\"\r\n cdkDropList #availableList=\"cdkDropList\"\r\n [cdkDropListData]=\"_available\"\r\n [cdkDropListConnectedTo]=\"[activeList]\"\r\n (cdkDropListDropped)=\"drop($event)\">\r\n @for (item of _available; track item.id) {\r\n <li cdkDrag [cdkDragDisabled]=\"item.disabled ?? false\">\r\n <cw-card>\r\n <ng-container *ngTemplateOutlet=\"itemTemplate() || defaultTemplate; context: { $implicit: item }\"/>\r\n </cw-card>\r\n </li>\r\n }\r\n </ul>\r\n </div>\r\n\r\n <div class=\"col-lg-6 d-flex-v gap-4xs\">\r\n <div class=\"fs fs-xs fw-bold\">{{ activeColumn().title | translate }}</div>\r\n @if (activeColumn().description) {\r\n <p class=\"fs fs-xs\">{{ activeColumn().description | translate }}</p>\r\n }\r\n @if (activeColumn().descriptionRwd) {\r\n <p class=\"d-sm-none fs fs-xs\" [innerHTML]=\"activeColumn().descriptionRwd | translate\"></p>\r\n }\r\n <ul class=\"list-unstyled drag-drop-list-column drag-drop-list-column-active\" [ngClass]=\"activeColumn().cssClass\"\r\n cdkDropList #activeList=\"cdkDropList\"\r\n [cdkDropListData]=\"_active\"\r\n [cdkDropListConnectedTo]=\"[availableList]\"\r\n (cdkDropListDropped)=\"drop($event)\">\r\n @for (item of _active; track item.id) {\r\n <li cdkDrag [cdkDragDisabled]=\"item.disabled ?? false\">\r\n <cw-card>\r\n <ng-container *ngTemplateOutlet=\"itemTemplate() || defaultTemplate; context: { $implicit: item }\"/>\r\n </cw-card>\r\n </li>\r\n }\r\n </ul>\r\n </div>\r\n</div>\r\n\r\n<ng-template #defaultTemplate let-item>\r\n <div class=\"default-item d-flex justify-content-between\">\r\n <span>\r\n {{ item.label }}\r\n @if (item.code) { <span class=\"text-muted\">({{ item.code }})</span> }\r\n </span>\r\n @if (item.order != null) {\r\n <span class=\"fw-bold\">#{{ item.order }}</span>\r\n }\r\n </div>\r\n</ng-template>\r\n" }]
157
157
  }], ctorParameters: () => [], propDecorators: { availableItems: [{ type: i0.Input, args: [{ isSignal: true, alias: "availableItems", required: false }] }], activeItems: [{ type: i0.Input, args: [{ isSignal: true, alias: "activeItems", required: false }] }], adapter: [{ type: i0.Input, args: [{ isSignal: true, alias: "adapter", required: false }] }], itemTemplate: [{ type: i0.Input, args: [{ isSignal: true, alias: "itemTemplate", required: false }] }], availableColumn: [{ type: i0.Input, args: [{ isSignal: true, alias: "availableColumn", required: false }] }], activeColumn: [{ type: i0.Input, args: [{ isSignal: true, alias: "activeColumn", required: false }] }], reorderOnDrop: [{ type: i0.Input, args: [{ isSignal: true, alias: "reorderOnDrop", required: false }] }], availableItemsChange: [{ type: i0.Output, args: ["availableItemsChange"] }], activeItemsChange: [{ type: i0.Output, args: ["activeItemsChange"] }] } });
158
158
 
159
159
  class DragNDropNestedListComponent {
@@ -341,73 +341,13 @@ class DragNDropNestedListComponent {
341
341
  }));
342
342
  }
343
343
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: DragNDropNestedListComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
344
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.20", type: DragNDropNestedListComponent, isStandalone: true, selector: "cw-drag-n-drop-nested-list", inputs: { items: { classPropertyName: "items", publicName: "items", isSignal: true, isRequired: false, transformFunction: null }, itemTemplate: { classPropertyName: "itemTemplate", publicName: "itemTemplate", isSignal: true, isRequired: false, transformFunction: null }, column: { classPropertyName: "column", publicName: "column", isSignal: true, isRequired: false, transformFunction: null }, reorderOnDrop: { classPropertyName: "reorderOnDrop", publicName: "reorderOnDrop", isSignal: true, isRequired: false, transformFunction: null }, maxDepth: { classPropertyName: "maxDepth", publicName: "maxDepth", isSignal: true, isRequired: false, transformFunction: null }, selectedId: { classPropertyName: "selectedId", publicName: "selectedId", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { itemsChange: "itemsChange", view: "view", edit: "edit", delete: "delete", restore: "restore", add: "add" }, ngImport: i0, template: "<div class=\"ddn-list d-flex-v gap-md\">\n <div class=\"d-flex-h justify-between\">\n @if (column()?.title) {\n <h2>{{ column()!.title | translate }} ({{ columnCountLabel() }})</h2>\n }\n\n @if (column()?.showAddRoot) {\n <cw-button cssClass=\"ddn-list-add\" [type]=\"buttonType.link\" [withIcon]=\"spriteIcon.add\"\n [iconPosition]=\"buttonPosition.left\" [label]=\"column()?.addRootLabel ?? column()?.addLabel ?? '_COMMON._ACTION.ADD'\"\n [isDisabled]=\"isLevelFull(_items, 0)\" (btnAction)=\"onAdd(undefined, 0)\" />\n }\n </div>\n\n <ng-container *ngTemplateOutlet=\"nodeTpl; context: { $implicit: _items, depth: 0, parent: undefined }\" />\n</div>\n\n<!--\n Template r\u00E9cursif : \u00E0 chaque niveau, on rend un cdkDropList isol\u00E9\n (pas de cdkDropListConnectedTo => transfert inter-listes impossible),\n puis on r\u00E9-instancie le m\u00EAme template pour la sous-liste de chaque enfant.\n-->\n<ng-template #nodeTpl let-nodes let-depth=\"depth\" let-parent=\"parent\">\n @if (isLevelFull(nodes, depth)) {\n <cw-alert [type]=\"alertType.warning\" cssClass=\"ddn-list-max-alert\">\n {{ (column()?.maxReachedLabel ?? '_COMMON.MAX_ITEMS_REACHED') | translate:{ max: levelMax(depth) } }}\n </cw-alert>\n }\n\n <ul class=\"list-unstyled d-flex-v gap-md ms-none\" [ngClass]=\"column()?.cssClass\" [attr.data-depth]=\"depth\"\n cdkDropList [cdkDropListData]=\"nodes\" (cdkDropListDropped)=\"drop($event)\">\n\n @for (item of nodes; track item.id) {\n <li cdkDrag [cdkDragDisabled]=\"(item.disabled ?? false) || (item.pendingDelete ?? false)\" cdkDragPreviewClass=\"ddn-list-card-preview\">\n <cw-card [cssClass]=\"cardCssClass(item)\" [title]=\"(item.title ?? item.label) || ''\"\n [subtitle]=\"item.subtitle ?? ''\" [type]=\"cardType(depth)\" [collapsible]=\"isCollapsible(item, depth)\"\n [collapsed]=\"isCollapsible(item, depth)\" [collapseStretched]=\"false\">\n\n <!-- Poign\u00E9e de drag (\u00E0 gauche du titre) : le glisser ne d\u00E9marre que d'ici -->\n <button header-start type=\"button\" class=\"ddn-list-handle\" cdkDragHandle\n [disabled]=\"(item.disabled ?? false) || (item.pendingDelete ?? false)\" [attr.aria-label]=\"'_COMMON._ACTION.MOVE' | translate\">\n <cw-icon [icon]=\"spriteIcon.grip\" [iconSize]=\"iconSize['md']\" />\n </button>\n\n <!-- En-t\u00EAte : compteur d'enfants + badge + actions -->\n <div header-custom-area class=\"d-flex-h gap-2xs justify-end align-start\">\n @if (childrenCountLabel(item, depth); as count) {\n <span class=\"ddn-list-count fs fs-xs\">{{ count }}</span>\n }\n\n @if (item.badge) {\n <cw-badge [type]=\"item.badge.type\" [label]=\"item.badge.label\" [withIcon]=\"item.badge.icon\" />\n }\n\n <!-- Sur une carte pendingDelete, seul \u00AB Restaurer \u00BB est propos\u00E9 (view/edit masqu\u00E9s). -->\n @if (!item.pendingDelete && showAction(item, 'view')) {\n <cw-button label=\"_COMMON._ACTION.VIEW\" [withIcon]=\"spriteIcon.search\" [withOnlyIcon]=\"true\"\n [type]=\"buttonType.secondary\" [iconSize]=\"buttonIconSize.xsmall\" (btnAction)=\"view.emit(item)\" />\n }\n @if (!item.pendingDelete && showAction(item, 'edit')) {\n <cw-button label=\"_COMMON._ACTION.EDIT\" [withIcon]=\"spriteIcon.edit\" [withOnlyIcon]=\"true\"\n [type]=\"buttonType.secondary\" [iconSize]=\"buttonIconSize.xsmall\" (btnAction)=\"edit.emit(item)\" />\n }\n @if (showAction(item, 'delete')) {\n @if (item.pendingDelete) {\n <!-- Soft-delete : la corbeille bascule en \u00AB Restaurer \u00BB (d\u00E9sactiv\u00E9 si le niveau est plein). -->\n <cw-button label=\"_COMMON._ACTION.RESTORE\" [withIcon]=\"spriteIcon.toolbarRefresh\" [withOnlyIcon]=\"true\"\n [type]=\"buttonType.secondary\" cssClass=\"ddn-list-action-restore\"\n [isDisabled]=\"isRestoreBlocked(nodes, depth)\"\n [iconSize]=\"buttonIconSize.xsmall\" (btnAction)=\"restore.emit(item)\" />\n } @else {\n <cw-button label=\"_COMMON._ACTION.DELETE\" [withIcon]=\"spriteIcon.trash\" [withOnlyIcon]=\"true\"\n [type]=\"buttonType.secondary\" cssClass=\"ddn-list-action-delete\"\n [iconSize]=\"buttonIconSize.xsmall\" (btnAction)=\"delete.emit(item)\" />\n }\n }\n </div>\n\n <!-- Restauration impossible : niveau plein (mode excludePendingDeleteFromMax). -->\n @if (item.pendingDelete && isRestoreBlocked(nodes, depth)) {\n <cw-alert [type]=\"alertType.warning\" cssClass=\"ddn-list-restore-blocked-alert\">\n {{ (column()?.restoreBlockedLabel ?? '_COMMON.MAX_RESTORE_BLOCKED') | translate:{ max: levelMax(depth) } }}\n </cw-alert>\n }\n\n <!-- Corps masqu\u00E9 sur une carte pendingDelete : on n'affiche que l'en-t\u00EAte (carte compacte,\n non pliable, non d\u00E9pla\u00E7able). L'encart \u00AB restauration impossible \u00BB ci-dessus reste, lui, visible. -->\n @if (!item.pendingDelete) {\n <!-- Corps : template custom (slot) ou fallback -->\n <ng-container\n *ngTemplateOutlet=\"itemTemplate() || defaultTemplate; context: { $implicit: item, depth: depth }\" />\n\n @if (item.children?.length) {\n <ng-container\n *ngTemplateOutlet=\"nodeTpl; context: { $implicit: item.children, depth: depth + 1, parent: item }\" />\n }\n\n @if (canAdd(item, depth)) {\n <div class=\"d-flex-h justify-end\">\n <cw-button class=\"ddn-list-add\" [type]=\"buttonType.link\" [withIcon]=\"spriteIcon.add\"\n [iconPosition]=\"buttonPosition.left\" [label]=\"column()?.addLabel ?? '_COMMON._ACTION.ADD'\"\n [isDisabled]=\"isLevelFull(item.children ?? [], depth + 1)\" (btnAction)=\"onAdd(item, depth + 1)\" />\n </div>\n }\n }\n </cw-card>\n </li>\n }\n\n </ul>\n</ng-template>\n\n<ng-template #defaultTemplate let-item>\n <div class=\"default-item d-flex justify-content-between\">\n <span>\n {{ item.label }}\n @if (item.code) { <span class=\"text-muted\">({{ item.code }})</span> }\n </span>\n <!-- @if (item.order != null) {\n <span class=\"fw-bold\">#{{ item.order }}</span>\n } -->\n </div>\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: DragDropModule }, { kind: "directive", type: i2.CdkDropList, selector: "[cdkDropList], cdk-drop-list", inputs: ["cdkDropListConnectedTo", "cdkDropListData", "cdkDropListOrientation", "id", "cdkDropListLockAxis", "cdkDropListDisabled", "cdkDropListSortingDisabled", "cdkDropListEnterPredicate", "cdkDropListSortPredicate", "cdkDropListAutoScrollDisabled", "cdkDropListAutoScrollStep", "cdkDropListElementContainer", "cdkDropListHasAnchor"], outputs: ["cdkDropListDropped", "cdkDropListEntered", "cdkDropListExited", "cdkDropListSorted"], exportAs: ["cdkDropList"] }, { kind: "directive", type: i2.CdkDrag, selector: "[cdkDrag]", inputs: ["cdkDragData", "cdkDragLockAxis", "cdkDragRootElement", "cdkDragBoundary", "cdkDragStartDelay", "cdkDragFreeDragPosition", "cdkDragDisabled", "cdkDragConstrainPosition", "cdkDragPreviewClass", "cdkDragPreviewContainer", "cdkDragScale"], outputs: ["cdkDragStarted", "cdkDragReleased", "cdkDragEnded", "cdkDragEntered", "cdkDragExited", "cdkDragDropped", "cdkDragMoved"], exportAs: ["cdkDrag"] }, { kind: "directive", type: i2.CdkDragHandle, selector: "[cdkDragHandle]", inputs: ["cdkDragHandleDisabled"] }, { kind: "component", type: CardComponent, selector: "cw-card", inputs: ["title", "subtitle", "type", "titleRank", "cssClass", "collapsible", "collapsed", "disabled", "collapseStretched", "collapseId", "destroyOnHide"], outputs: ["collapsibleChange", "destroyOnHideChange", "collapseClicked"] }, { kind: "component", type: BadgeComponent, selector: "cw-badge", inputs: ["type", "label", "withIcon", "iconPosition", "cssClass", "skeletonMode", "dataTest"] }, { kind: "component", type: IconComponent, selector: "cw-icon", inputs: ["icon", "label", "type", "iconSize", "iconCssClass", "iconUiType", "iconColorCustom", "spritePath"] }, { kind: "component", type: ButtonComponent, selector: "cw-button", inputs: ["type", "label", "id", "link", "isDropdown", "hideCaret", "withIcon", "withOnlyIcon", "iconSize", "iconPosition", "dropdownPosition", "isMinWidth", "isDisabled", "isLoading", "cssClass", "dataTest", "skeletonMode", "withTooltip", "tooltipText", "tooltipTitle", "tooltipTrigger", "tooltipPosition", "tooltipType"], outputs: ["btnAction", "dropDownClicked"] }, { kind: "component", type: AlertComponent, selector: "cw-alert", inputs: ["type", "title", "isDismissible", "cssClass", "dataTest"], outputs: ["close"] }, { kind: "pipe", type: i1$1.TranslatePipe, name: "translate" }] }); }
344
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.20", type: DragNDropNestedListComponent, isStandalone: true, selector: "cw-drag-n-drop-nested-list", inputs: { items: { classPropertyName: "items", publicName: "items", isSignal: true, isRequired: false, transformFunction: null }, itemTemplate: { classPropertyName: "itemTemplate", publicName: "itemTemplate", isSignal: true, isRequired: false, transformFunction: null }, column: { classPropertyName: "column", publicName: "column", isSignal: true, isRequired: false, transformFunction: null }, reorderOnDrop: { classPropertyName: "reorderOnDrop", publicName: "reorderOnDrop", isSignal: true, isRequired: false, transformFunction: null }, maxDepth: { classPropertyName: "maxDepth", publicName: "maxDepth", isSignal: true, isRequired: false, transformFunction: null }, selectedId: { classPropertyName: "selectedId", publicName: "selectedId", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { itemsChange: "itemsChange", view: "view", edit: "edit", delete: "delete", restore: "restore", add: "add" }, ngImport: i0, template: "<div class=\"ddn-list d-flex-v gap-md\">\n <div class=\"d-flex-h justify-between\">\n @if (column()?.title) {\n <h2>{{ column()!.title | translate }} ({{ columnCountLabel() }})</h2>\n }\n\n @if (column()?.showAddRoot) {\n <cw-button cssClass=\"ddn-list-add\" [type]=\"buttonType.link\" [withIcon]=\"spriteIcon.add\"\n [iconPosition]=\"buttonPosition.left\" [label]=\"column()?.addRootLabel ?? column()?.addLabel ?? '_COMMON._ACTION.ADD'\"\n [isDisabled]=\"isLevelFull(_items, 0)\" (btnAction)=\"onAdd(undefined, 0)\" />\n }\n </div>\n\n <ng-container *ngTemplateOutlet=\"nodeTpl; context: { $implicit: _items, depth: 0, parent: undefined }\" />\n</div>\n\n<!--\n Template r\u00E9cursif : \u00E0 chaque niveau, on rend un cdkDropList isol\u00E9\n (pas de cdkDropListConnectedTo => transfert inter-listes impossible),\n puis on r\u00E9-instancie le m\u00EAme template pour la sous-liste de chaque enfant.\n-->\n<ng-template #nodeTpl let-nodes let-depth=\"depth\" let-parent=\"parent\">\n @if (isLevelFull(nodes, depth)) {\n <cw-alert [type]=\"alertType.warning\" cssClass=\"ddn-list-max-alert\">\n {{ (column()?.maxReachedLabel ?? '_COMMON.MAX_ITEMS_REACHED') | translate:{ max: levelMax(depth) } }}\n </cw-alert>\n }\n\n <ul class=\"list-unstyled d-flex-v gap-md ms-none\" [ngClass]=\"column()?.cssClass\" [attr.data-depth]=\"depth\"\n cdkDropList [cdkDropListData]=\"nodes\" (cdkDropListDropped)=\"drop($event)\">\n\n @for (item of nodes; track item.id) {\n <li cdkDrag [cdkDragDisabled]=\"(item.disabled ?? false) || (item.pendingDelete ?? false)\" cdkDragPreviewClass=\"ddn-list-card-preview\">\n <cw-card [cssClass]=\"cardCssClass(item)\" [title]=\"(item.title ?? item.label) || ''\"\n [subtitle]=\"item.subtitle ?? ''\" [type]=\"cardType(depth)\" [collapsible]=\"isCollapsible(item, depth)\"\n [collapsed]=\"isCollapsible(item, depth)\" [collapseStretched]=\"false\">\n\n <!-- Poign\u00E9e de drag (\u00E0 gauche du titre) : le glisser ne d\u00E9marre que d'ici -->\n <button header-start type=\"button\" class=\"ddn-list-handle\" cdkDragHandle\n [disabled]=\"(item.disabled ?? false) || (item.pendingDelete ?? false)\" [attr.aria-label]=\"'_COMMON._ACTION.MOVE' | translate\">\n <cw-icon [icon]=\"spriteIcon.grip\" [iconSize]=\"iconSize['md']\" />\n </button>\n\n <!-- En-t\u00EAte : compteur d'enfants + badge + actions -->\n <div header-custom-area class=\"d-flex-h gap-2xs justify-end align-start\">\n @if (childrenCountLabel(item, depth); as count) {\n <span class=\"ddn-list-count fs fs-xs\">{{ count }}</span>\n }\n\n @if (item.badge) {\n <cw-badge [type]=\"item.badge.type\" [label]=\"item.badge.label\" [withIcon]=\"item.badge.icon\" />\n }\n\n <!-- Sur une carte pendingDelete, seul \u00AB Restaurer \u00BB est propos\u00E9 (view/edit masqu\u00E9s). -->\n @if (!item.pendingDelete && showAction(item, 'view')) {\n <cw-button label=\"_COMMON._ACTION.VIEW\" [withIcon]=\"spriteIcon.search\" [withOnlyIcon]=\"true\"\n [type]=\"buttonType.secondary\" [iconSize]=\"buttonIconSize.xsmall\" (btnAction)=\"view.emit(item)\" />\n }\n @if (!item.pendingDelete && showAction(item, 'edit')) {\n <cw-button label=\"_COMMON._ACTION.EDIT\" [withIcon]=\"spriteIcon.edit\" [withOnlyIcon]=\"true\"\n [type]=\"buttonType.secondary\" [iconSize]=\"buttonIconSize.xsmall\" (btnAction)=\"edit.emit(item)\" />\n }\n @if (showAction(item, 'delete')) {\n @if (item.pendingDelete) {\n <!-- Soft-delete : la corbeille bascule en \u00AB Restaurer \u00BB (d\u00E9sactiv\u00E9 si le niveau est plein). -->\n <cw-button label=\"_COMMON._ACTION.RESTORE\" [withIcon]=\"spriteIcon.toolbarRefresh\" [withOnlyIcon]=\"true\"\n [type]=\"buttonType.secondary\" cssClass=\"ddn-list-action-restore\"\n [isDisabled]=\"isRestoreBlocked(nodes, depth)\"\n [iconSize]=\"buttonIconSize.xsmall\" (btnAction)=\"restore.emit(item)\" />\n } @else {\n <cw-button label=\"_COMMON._ACTION.DELETE\" [withIcon]=\"spriteIcon.trash\" [withOnlyIcon]=\"true\"\n [type]=\"buttonType.secondary\" cssClass=\"ddn-list-action-delete\"\n [iconSize]=\"buttonIconSize.xsmall\" (btnAction)=\"delete.emit(item)\" />\n }\n }\n </div>\n\n <!-- Restauration impossible : niveau plein (mode excludePendingDeleteFromMax). -->\n @if (item.pendingDelete && isRestoreBlocked(nodes, depth)) {\n <cw-alert [type]=\"alertType.warning\" cssClass=\"ddn-list-restore-blocked-alert\">\n {{ (column()?.restoreBlockedLabel ?? '_COMMON.MAX_RESTORE_BLOCKED') | translate:{ max: levelMax(depth) } }}\n </cw-alert>\n }\n\n <!-- Corps masqu\u00E9 sur une carte pendingDelete : on n'affiche que l'en-t\u00EAte (carte compacte,\n non pliable, non d\u00E9pla\u00E7able). L'encart \u00AB restauration impossible \u00BB ci-dessus reste, lui, visible. -->\n @if (!item.pendingDelete) {\n <!-- Corps : template custom (slot) ou fallback -->\n <ng-container\n *ngTemplateOutlet=\"itemTemplate() || defaultTemplate; context: { $implicit: item, depth: depth }\" />\n\n @if (item.children?.length) {\n <ng-container\n *ngTemplateOutlet=\"nodeTpl; context: { $implicit: item.children, depth: depth + 1, parent: item }\" />\n }\n\n @if (canAdd(item, depth)) {\n <div class=\"d-flex-h justify-end\">\n <cw-button class=\"ddn-list-add\" [type]=\"buttonType.link\" [withIcon]=\"spriteIcon.add\"\n [iconPosition]=\"buttonPosition.left\" [label]=\"column()?.addLabel ?? '_COMMON._ACTION.ADD'\"\n [isDisabled]=\"isLevelFull(item.children ?? [], depth + 1)\" (btnAction)=\"onAdd(item, depth + 1)\" />\n </div>\n }\n }\n </cw-card>\n </li>\n }\n\n </ul>\n</ng-template>\n\n<ng-template #defaultTemplate let-item>\n <div class=\"default-item d-flex justify-content-between\">\n <span>\n {{ item.label }}\n @if (item.code) { <span class=\"text-muted\">({{ item.code }})</span> }\n </span>\n </div>\n</ng-template>\n", dependencies: [{ kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "ngmodule", type: TranslateModule }, { kind: "ngmodule", type: DragDropModule }, { kind: "directive", type: i1$1.CdkDropList, selector: "[cdkDropList], cdk-drop-list", inputs: ["cdkDropListConnectedTo", "cdkDropListData", "cdkDropListOrientation", "id", "cdkDropListLockAxis", "cdkDropListDisabled", "cdkDropListSortingDisabled", "cdkDropListEnterPredicate", "cdkDropListSortPredicate", "cdkDropListAutoScrollDisabled", "cdkDropListAutoScrollStep", "cdkDropListElementContainer", "cdkDropListHasAnchor"], outputs: ["cdkDropListDropped", "cdkDropListEntered", "cdkDropListExited", "cdkDropListSorted"], exportAs: ["cdkDropList"] }, { kind: "directive", type: i1$1.CdkDrag, selector: "[cdkDrag]", inputs: ["cdkDragData", "cdkDragLockAxis", "cdkDragRootElement", "cdkDragBoundary", "cdkDragStartDelay", "cdkDragFreeDragPosition", "cdkDragDisabled", "cdkDragConstrainPosition", "cdkDragPreviewClass", "cdkDragPreviewContainer", "cdkDragScale"], outputs: ["cdkDragStarted", "cdkDragReleased", "cdkDragEnded", "cdkDragEntered", "cdkDragExited", "cdkDragDropped", "cdkDragMoved"], exportAs: ["cdkDrag"] }, { kind: "directive", type: i1$1.CdkDragHandle, selector: "[cdkDragHandle]", inputs: ["cdkDragHandleDisabled"] }, { kind: "component", type: CardComponent, selector: "cw-card", inputs: ["title", "subtitle", "type", "titleRank", "cssClass", "collapsible", "collapsed", "disabled", "collapseLocked", "collapseStretched", "collapseId", "destroyOnHide"], outputs: ["collapsibleChange", "destroyOnHideChange", "collapseClicked"] }, { kind: "component", type: BadgeComponent, selector: "cw-badge", inputs: ["type", "label", "withIcon", "iconPosition", "cssClass", "skeletonMode", "dataTest"] }, { kind: "component", type: IconComponent, selector: "cw-icon", inputs: ["icon", "label", "type", "iconSize", "iconCssClass", "iconUiType", "iconColorCustom", "spritePath"] }, { kind: "component", type: ButtonComponent, selector: "cw-button", inputs: ["type", "label", "id", "link", "isDropdown", "hideCaret", "withIcon", "withOnlyIcon", "iconSize", "iconPosition", "dropdownPosition", "isMinWidth", "isDisabled", "isLoading", "cssClass", "dataTest", "skeletonMode", "withTooltip", "tooltipText", "tooltipTitle", "tooltipTrigger", "tooltipPosition", "tooltipType"], outputs: ["btnAction", "dropDownClicked"] }, { kind: "component", type: AlertComponent, selector: "cw-alert", inputs: ["type", "title", "isDismissible", "cssClass", "dataTest"], outputs: ["close"] }, { kind: "pipe", type: i1.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
345
345
  }
346
346
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: DragNDropNestedListComponent, decorators: [{
347
347
  type: Component,
348
- args: [{ selector: 'cw-drag-n-drop-nested-list', standalone: true, imports: [CommonModule, TranslateModule, DragDropModule, CardComponent, BadgeComponent, IconComponent, ButtonComponent, AlertComponent], template: "<div class=\"ddn-list d-flex-v gap-md\">\n <div class=\"d-flex-h justify-between\">\n @if (column()?.title) {\n <h2>{{ column()!.title | translate }} ({{ columnCountLabel() }})</h2>\n }\n\n @if (column()?.showAddRoot) {\n <cw-button cssClass=\"ddn-list-add\" [type]=\"buttonType.link\" [withIcon]=\"spriteIcon.add\"\n [iconPosition]=\"buttonPosition.left\" [label]=\"column()?.addRootLabel ?? column()?.addLabel ?? '_COMMON._ACTION.ADD'\"\n [isDisabled]=\"isLevelFull(_items, 0)\" (btnAction)=\"onAdd(undefined, 0)\" />\n }\n </div>\n\n <ng-container *ngTemplateOutlet=\"nodeTpl; context: { $implicit: _items, depth: 0, parent: undefined }\" />\n</div>\n\n<!--\n Template r\u00E9cursif : \u00E0 chaque niveau, on rend un cdkDropList isol\u00E9\n (pas de cdkDropListConnectedTo => transfert inter-listes impossible),\n puis on r\u00E9-instancie le m\u00EAme template pour la sous-liste de chaque enfant.\n-->\n<ng-template #nodeTpl let-nodes let-depth=\"depth\" let-parent=\"parent\">\n @if (isLevelFull(nodes, depth)) {\n <cw-alert [type]=\"alertType.warning\" cssClass=\"ddn-list-max-alert\">\n {{ (column()?.maxReachedLabel ?? '_COMMON.MAX_ITEMS_REACHED') | translate:{ max: levelMax(depth) } }}\n </cw-alert>\n }\n\n <ul class=\"list-unstyled d-flex-v gap-md ms-none\" [ngClass]=\"column()?.cssClass\" [attr.data-depth]=\"depth\"\n cdkDropList [cdkDropListData]=\"nodes\" (cdkDropListDropped)=\"drop($event)\">\n\n @for (item of nodes; track item.id) {\n <li cdkDrag [cdkDragDisabled]=\"(item.disabled ?? false) || (item.pendingDelete ?? false)\" cdkDragPreviewClass=\"ddn-list-card-preview\">\n <cw-card [cssClass]=\"cardCssClass(item)\" [title]=\"(item.title ?? item.label) || ''\"\n [subtitle]=\"item.subtitle ?? ''\" [type]=\"cardType(depth)\" [collapsible]=\"isCollapsible(item, depth)\"\n [collapsed]=\"isCollapsible(item, depth)\" [collapseStretched]=\"false\">\n\n <!-- Poign\u00E9e de drag (\u00E0 gauche du titre) : le glisser ne d\u00E9marre que d'ici -->\n <button header-start type=\"button\" class=\"ddn-list-handle\" cdkDragHandle\n [disabled]=\"(item.disabled ?? false) || (item.pendingDelete ?? false)\" [attr.aria-label]=\"'_COMMON._ACTION.MOVE' | translate\">\n <cw-icon [icon]=\"spriteIcon.grip\" [iconSize]=\"iconSize['md']\" />\n </button>\n\n <!-- En-t\u00EAte : compteur d'enfants + badge + actions -->\n <div header-custom-area class=\"d-flex-h gap-2xs justify-end align-start\">\n @if (childrenCountLabel(item, depth); as count) {\n <span class=\"ddn-list-count fs fs-xs\">{{ count }}</span>\n }\n\n @if (item.badge) {\n <cw-badge [type]=\"item.badge.type\" [label]=\"item.badge.label\" [withIcon]=\"item.badge.icon\" />\n }\n\n <!-- Sur une carte pendingDelete, seul \u00AB Restaurer \u00BB est propos\u00E9 (view/edit masqu\u00E9s). -->\n @if (!item.pendingDelete && showAction(item, 'view')) {\n <cw-button label=\"_COMMON._ACTION.VIEW\" [withIcon]=\"spriteIcon.search\" [withOnlyIcon]=\"true\"\n [type]=\"buttonType.secondary\" [iconSize]=\"buttonIconSize.xsmall\" (btnAction)=\"view.emit(item)\" />\n }\n @if (!item.pendingDelete && showAction(item, 'edit')) {\n <cw-button label=\"_COMMON._ACTION.EDIT\" [withIcon]=\"spriteIcon.edit\" [withOnlyIcon]=\"true\"\n [type]=\"buttonType.secondary\" [iconSize]=\"buttonIconSize.xsmall\" (btnAction)=\"edit.emit(item)\" />\n }\n @if (showAction(item, 'delete')) {\n @if (item.pendingDelete) {\n <!-- Soft-delete : la corbeille bascule en \u00AB Restaurer \u00BB (d\u00E9sactiv\u00E9 si le niveau est plein). -->\n <cw-button label=\"_COMMON._ACTION.RESTORE\" [withIcon]=\"spriteIcon.toolbarRefresh\" [withOnlyIcon]=\"true\"\n [type]=\"buttonType.secondary\" cssClass=\"ddn-list-action-restore\"\n [isDisabled]=\"isRestoreBlocked(nodes, depth)\"\n [iconSize]=\"buttonIconSize.xsmall\" (btnAction)=\"restore.emit(item)\" />\n } @else {\n <cw-button label=\"_COMMON._ACTION.DELETE\" [withIcon]=\"spriteIcon.trash\" [withOnlyIcon]=\"true\"\n [type]=\"buttonType.secondary\" cssClass=\"ddn-list-action-delete\"\n [iconSize]=\"buttonIconSize.xsmall\" (btnAction)=\"delete.emit(item)\" />\n }\n }\n </div>\n\n <!-- Restauration impossible : niveau plein (mode excludePendingDeleteFromMax). -->\n @if (item.pendingDelete && isRestoreBlocked(nodes, depth)) {\n <cw-alert [type]=\"alertType.warning\" cssClass=\"ddn-list-restore-blocked-alert\">\n {{ (column()?.restoreBlockedLabel ?? '_COMMON.MAX_RESTORE_BLOCKED') | translate:{ max: levelMax(depth) } }}\n </cw-alert>\n }\n\n <!-- Corps masqu\u00E9 sur une carte pendingDelete : on n'affiche que l'en-t\u00EAte (carte compacte,\n non pliable, non d\u00E9pla\u00E7able). L'encart \u00AB restauration impossible \u00BB ci-dessus reste, lui, visible. -->\n @if (!item.pendingDelete) {\n <!-- Corps : template custom (slot) ou fallback -->\n <ng-container\n *ngTemplateOutlet=\"itemTemplate() || defaultTemplate; context: { $implicit: item, depth: depth }\" />\n\n @if (item.children?.length) {\n <ng-container\n *ngTemplateOutlet=\"nodeTpl; context: { $implicit: item.children, depth: depth + 1, parent: item }\" />\n }\n\n @if (canAdd(item, depth)) {\n <div class=\"d-flex-h justify-end\">\n <cw-button class=\"ddn-list-add\" [type]=\"buttonType.link\" [withIcon]=\"spriteIcon.add\"\n [iconPosition]=\"buttonPosition.left\" [label]=\"column()?.addLabel ?? '_COMMON._ACTION.ADD'\"\n [isDisabled]=\"isLevelFull(item.children ?? [], depth + 1)\" (btnAction)=\"onAdd(item, depth + 1)\" />\n </div>\n }\n }\n </cw-card>\n </li>\n }\n\n </ul>\n</ng-template>\n\n<ng-template #defaultTemplate let-item>\n <div class=\"default-item d-flex justify-content-between\">\n <span>\n {{ item.label }}\n @if (item.code) { <span class=\"text-muted\">({{ item.code }})</span> }\n </span>\n <!-- @if (item.order != null) {\n <span class=\"fw-bold\">#{{ item.order }}</span>\n } -->\n </div>\n</ng-template>\n" }]
348
+ args: [{ selector: 'cw-drag-n-drop-nested-list', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, imports: [NgClass, NgTemplateOutlet, TranslateModule, DragDropModule, CardComponent, BadgeComponent, IconComponent, ButtonComponent, AlertComponent], template: "<div class=\"ddn-list d-flex-v gap-md\">\n <div class=\"d-flex-h justify-between\">\n @if (column()?.title) {\n <h2>{{ column()!.title | translate }} ({{ columnCountLabel() }})</h2>\n }\n\n @if (column()?.showAddRoot) {\n <cw-button cssClass=\"ddn-list-add\" [type]=\"buttonType.link\" [withIcon]=\"spriteIcon.add\"\n [iconPosition]=\"buttonPosition.left\" [label]=\"column()?.addRootLabel ?? column()?.addLabel ?? '_COMMON._ACTION.ADD'\"\n [isDisabled]=\"isLevelFull(_items, 0)\" (btnAction)=\"onAdd(undefined, 0)\" />\n }\n </div>\n\n <ng-container *ngTemplateOutlet=\"nodeTpl; context: { $implicit: _items, depth: 0, parent: undefined }\" />\n</div>\n\n<!--\n Template r\u00E9cursif : \u00E0 chaque niveau, on rend un cdkDropList isol\u00E9\n (pas de cdkDropListConnectedTo => transfert inter-listes impossible),\n puis on r\u00E9-instancie le m\u00EAme template pour la sous-liste de chaque enfant.\n-->\n<ng-template #nodeTpl let-nodes let-depth=\"depth\" let-parent=\"parent\">\n @if (isLevelFull(nodes, depth)) {\n <cw-alert [type]=\"alertType.warning\" cssClass=\"ddn-list-max-alert\">\n {{ (column()?.maxReachedLabel ?? '_COMMON.MAX_ITEMS_REACHED') | translate:{ max: levelMax(depth) } }}\n </cw-alert>\n }\n\n <ul class=\"list-unstyled d-flex-v gap-md ms-none\" [ngClass]=\"column()?.cssClass\" [attr.data-depth]=\"depth\"\n cdkDropList [cdkDropListData]=\"nodes\" (cdkDropListDropped)=\"drop($event)\">\n\n @for (item of nodes; track item.id) {\n <li cdkDrag [cdkDragDisabled]=\"(item.disabled ?? false) || (item.pendingDelete ?? false)\" cdkDragPreviewClass=\"ddn-list-card-preview\">\n <cw-card [cssClass]=\"cardCssClass(item)\" [title]=\"(item.title ?? item.label) || ''\"\n [subtitle]=\"item.subtitle ?? ''\" [type]=\"cardType(depth)\" [collapsible]=\"isCollapsible(item, depth)\"\n [collapsed]=\"isCollapsible(item, depth)\" [collapseStretched]=\"false\">\n\n <!-- Poign\u00E9e de drag (\u00E0 gauche du titre) : le glisser ne d\u00E9marre que d'ici -->\n <button header-start type=\"button\" class=\"ddn-list-handle\" cdkDragHandle\n [disabled]=\"(item.disabled ?? false) || (item.pendingDelete ?? false)\" [attr.aria-label]=\"'_COMMON._ACTION.MOVE' | translate\">\n <cw-icon [icon]=\"spriteIcon.grip\" [iconSize]=\"iconSize['md']\" />\n </button>\n\n <!-- En-t\u00EAte : compteur d'enfants + badge + actions -->\n <div header-custom-area class=\"d-flex-h gap-2xs justify-end align-start\">\n @if (childrenCountLabel(item, depth); as count) {\n <span class=\"ddn-list-count fs fs-xs\">{{ count }}</span>\n }\n\n @if (item.badge) {\n <cw-badge [type]=\"item.badge.type\" [label]=\"item.badge.label\" [withIcon]=\"item.badge.icon\" />\n }\n\n <!-- Sur une carte pendingDelete, seul \u00AB Restaurer \u00BB est propos\u00E9 (view/edit masqu\u00E9s). -->\n @if (!item.pendingDelete && showAction(item, 'view')) {\n <cw-button label=\"_COMMON._ACTION.VIEW\" [withIcon]=\"spriteIcon.search\" [withOnlyIcon]=\"true\"\n [type]=\"buttonType.secondary\" [iconSize]=\"buttonIconSize.xsmall\" (btnAction)=\"view.emit(item)\" />\n }\n @if (!item.pendingDelete && showAction(item, 'edit')) {\n <cw-button label=\"_COMMON._ACTION.EDIT\" [withIcon]=\"spriteIcon.edit\" [withOnlyIcon]=\"true\"\n [type]=\"buttonType.secondary\" [iconSize]=\"buttonIconSize.xsmall\" (btnAction)=\"edit.emit(item)\" />\n }\n @if (showAction(item, 'delete')) {\n @if (item.pendingDelete) {\n <!-- Soft-delete : la corbeille bascule en \u00AB Restaurer \u00BB (d\u00E9sactiv\u00E9 si le niveau est plein). -->\n <cw-button label=\"_COMMON._ACTION.RESTORE\" [withIcon]=\"spriteIcon.toolbarRefresh\" [withOnlyIcon]=\"true\"\n [type]=\"buttonType.secondary\" cssClass=\"ddn-list-action-restore\"\n [isDisabled]=\"isRestoreBlocked(nodes, depth)\"\n [iconSize]=\"buttonIconSize.xsmall\" (btnAction)=\"restore.emit(item)\" />\n } @else {\n <cw-button label=\"_COMMON._ACTION.DELETE\" [withIcon]=\"spriteIcon.trash\" [withOnlyIcon]=\"true\"\n [type]=\"buttonType.secondary\" cssClass=\"ddn-list-action-delete\"\n [iconSize]=\"buttonIconSize.xsmall\" (btnAction)=\"delete.emit(item)\" />\n }\n }\n </div>\n\n <!-- Restauration impossible : niveau plein (mode excludePendingDeleteFromMax). -->\n @if (item.pendingDelete && isRestoreBlocked(nodes, depth)) {\n <cw-alert [type]=\"alertType.warning\" cssClass=\"ddn-list-restore-blocked-alert\">\n {{ (column()?.restoreBlockedLabel ?? '_COMMON.MAX_RESTORE_BLOCKED') | translate:{ max: levelMax(depth) } }}\n </cw-alert>\n }\n\n <!-- Corps masqu\u00E9 sur une carte pendingDelete : on n'affiche que l'en-t\u00EAte (carte compacte,\n non pliable, non d\u00E9pla\u00E7able). L'encart \u00AB restauration impossible \u00BB ci-dessus reste, lui, visible. -->\n @if (!item.pendingDelete) {\n <!-- Corps : template custom (slot) ou fallback -->\n <ng-container\n *ngTemplateOutlet=\"itemTemplate() || defaultTemplate; context: { $implicit: item, depth: depth }\" />\n\n @if (item.children?.length) {\n <ng-container\n *ngTemplateOutlet=\"nodeTpl; context: { $implicit: item.children, depth: depth + 1, parent: item }\" />\n }\n\n @if (canAdd(item, depth)) {\n <div class=\"d-flex-h justify-end\">\n <cw-button class=\"ddn-list-add\" [type]=\"buttonType.link\" [withIcon]=\"spriteIcon.add\"\n [iconPosition]=\"buttonPosition.left\" [label]=\"column()?.addLabel ?? '_COMMON._ACTION.ADD'\"\n [isDisabled]=\"isLevelFull(item.children ?? [], depth + 1)\" (btnAction)=\"onAdd(item, depth + 1)\" />\n </div>\n }\n }\n </cw-card>\n </li>\n }\n\n </ul>\n</ng-template>\n\n<ng-template #defaultTemplate let-item>\n <div class=\"default-item d-flex justify-content-between\">\n <span>\n {{ item.label }}\n @if (item.code) { <span class=\"text-muted\">({{ item.code }})</span> }\n </span>\n </div>\n</ng-template>\n" }]
349
349
  }], ctorParameters: () => [], propDecorators: { items: [{ type: i0.Input, args: [{ isSignal: true, alias: "items", required: false }] }], itemTemplate: [{ type: i0.Input, args: [{ isSignal: true, alias: "itemTemplate", required: false }] }], column: [{ type: i0.Input, args: [{ isSignal: true, alias: "column", required: false }] }], reorderOnDrop: [{ type: i0.Input, args: [{ isSignal: true, alias: "reorderOnDrop", required: false }] }], maxDepth: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxDepth", required: false }] }], selectedId: [{ type: i0.Input, args: [{ isSignal: true, alias: "selectedId", required: false }] }], itemsChange: [{ type: i0.Output, args: ["itemsChange"] }], view: [{ type: i0.Output, args: ["view"] }], edit: [{ type: i0.Output, args: ["edit"] }], delete: [{ type: i0.Output, args: ["delete"] }], restore: [{ type: i0.Output, args: ["restore"] }], add: [{ type: i0.Output, args: ["add"] }] } });
350
350
 
351
- class DoubleScrollDirective {
352
- constructor(el, renderer) {
353
- this.el = el;
354
- this.renderer = renderer;
355
- }
356
- onResize() {
357
- this.adaptScrollWidth();
358
- }
359
- // Si scroll le tableau on scroll aussi div.table-responsive-double-scroll
360
- onScroll() {
361
- this.div.scrollLeft = this.el.nativeElement.scrollLeft;
362
- }
363
- ngOnInit() {
364
- // On applique un margin-top à 0 à la table.
365
- this.el.nativeElement.style.marginTop = '0';
366
- // On crée le div.table-responsive-double-scroll et on l'insère avant le tableau
367
- this.div = this.renderer.createElement('div');
368
- this.renderer.addClass(this.div, 'table-responsive-double-scroll');
369
- this.renderer.insertBefore(this.el.nativeElement.parentNode, this.div, this.el.nativeElement);
370
- // On crée le div.scroll et on l'insère dans le div.table-responsive-double-scroll
371
- this.scroll = this.renderer.createElement('div');
372
- this.renderer.addClass(this.scroll, 'scroll');
373
- this.renderer.appendChild(this.div, this.scroll);
374
- // Si on scroll div.table-responsive-double-scroll on scroll aussi le tableau
375
- this.div.addEventListener('scroll', function () {
376
- //this.nextSibling.scrollLeft = this.scrollLeft;
377
- this.nextSibling.style.transform = "translateX(-" + this.scrollLeft + "px)";
378
- });
379
- }
380
- adaptScrollWidth() {
381
- // On donne à div.scroll la taille du tableau
382
- if (this.el.nativeElement.firstChild.offsetWidth > this.el.nativeElement.offsetWidth) {
383
- this.scroll.style.width = (this.el.nativeElement.firstChild.offsetWidth + 17) + 'px';
384
- }
385
- else {
386
- this.scroll.style.widdth = 'auto';
387
- }
388
- }
389
- ngAfterViewChecked() {
390
- this.adaptScrollWidth();
391
- }
392
- ngOnDestroy() {
393
- this.div.removeEventListener('scroll', null);
394
- }
395
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: DoubleScrollDirective, deps: [{ token: i0.ElementRef }, { token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Directive }); }
396
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.20", type: DoubleScrollDirective, isStandalone: true, selector: "[appDoubleScroll]", host: { listeners: { "window:resize": "onResize($event)", "scroll": "onScroll($event)" } }, ngImport: i0 }); }
397
- }
398
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: DoubleScrollDirective, decorators: [{
399
- type: Directive,
400
- args: [{
401
- selector: '[appDoubleScroll]'
402
- }]
403
- }], ctorParameters: () => [{ type: i0.ElementRef }, { type: i0.Renderer2 }], propDecorators: { onResize: [{
404
- type: HostListener,
405
- args: ['window:resize', ['$event']]
406
- }], onScroll: [{
407
- type: HostListener,
408
- args: ['scroll', ['$event']]
409
- }] } });
410
-
411
351
  class PaginationComponent {
412
352
  constructor() {
413
353
  this.pagination = input.required(...(ngDevMode ? [{ debugName: "pagination" }] : []));
@@ -472,7 +412,9 @@ class PaginationComponent {
472
412
  this.itemsPerPageControl.setValue(value.toString(), { emitEvent: false });
473
413
  }
474
414
  });
475
- this.itemsPerPageControl.valueChanges.subscribe(value => {
415
+ this.itemsPerPageControl.valueChanges
416
+ .pipe(takeUntilDestroyed())
417
+ .subscribe(value => {
476
418
  if (value !== null) {
477
419
  this.onItemsPerPageChange(Number(value));
478
420
  }
@@ -491,19 +433,87 @@ class PaginationComponent {
491
433
  });
492
434
  }
493
435
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: PaginationComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
494
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.20", type: PaginationComponent, isStandalone: true, selector: "cw-pagination", inputs: { pagination: { classPropertyName: "pagination", publicName: "pagination", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { paginationChange: "paginationChange" }, ngImport: i0, template: "@if (pagination().totalPages > 0) {\r\n<div class=\"pagination d-flex-h gap-md justify-between fs fs-sm\">\r\n\r\n <!-- LEFT PART -->\r\n <div class=\"d-flex-h gap-sm\">\r\n {{ '_COMMON._PAGINATION.RESULT_P' | translate: {total: pagination().totalItems } }}\r\n -\r\n {{ '_COMMON._PAGINATION.DISPLAY' | translate }}\r\n\r\n <cw-form-field\r\n [label]=\"'_COMMON._PAGINATION.ITEMS_PER_PAGE'\"\r\n [type]=\"typeField.select\"\r\n [control]=\"itemsPerPageControl\"\r\n [options]=\"pageSizesOptions\"\r\n [displayLabel]=\"false\"\r\n [clearable]=\"false\">\r\n </cw-form-field>\r\n\r\n {{ '_COMMON._PAGINATION.ITEMS_PER_PAGE' | translate }}\r\n </div>\r\n\r\n <!-- PAGINATION -->\r\n <ul class=\"list-unstyled d-flex-h gap-3xs\">\r\n\r\n <!-- PREVIOUS -->\r\n <li>\r\n <cw-button\r\n [type]=\"typeButton.ghost\"\r\n [withOnlyIcon]=\"true\"\r\n [withIcon]=\"spriteIcon.nextLeft\"\r\n [isDisabled]=\"pagination().currentPage <= 1\"\r\n [iconSize]=\"buttonIconSize.small\"\r\n cssClass=\"btn-pagination\"\r\n (btnAction)=\"emit(pagination().currentPage - 1)\">\r\n </cw-button>\r\n </li>\r\n\r\n <!-- PAGES -->\r\n @for (item of visiblePages(); track item) {\r\n\r\n <!-- NUMBER -->\r\n @if (typeof item === 'number') {\r\n <li>\r\n <cw-button\r\n [type]=\"typeButton.ghost\"\r\n [label]=\"item.toString()\"\r\n [cssClass]=\"item === pagination().currentPage ? 'btn-pagination btn-pagination-active' : 'btn-pagination'\"\r\n (btnAction)=\"emit(item)\">\r\n </cw-button>\r\n </li>\r\n }\r\n\r\n <!-- JUMP PREV -->\r\n @else if (item.type === 'jump-prev') {\r\n <li>\r\n <cw-button\r\n [type]=\"typeButton.ghost\"\r\n label=\"...\"\r\n cssClass=\"btn-pagination\"\r\n (btnAction)=\"emit(item.page)\">\r\n </cw-button>\r\n </li>\r\n }\r\n\r\n <!-- JUMP NEXT -->\r\n @else if (item.type === 'jump-next') {\r\n <li>\r\n <cw-button\r\n [type]=\"typeButton.ghost\"\r\n label=\"...\"\r\n cssClass=\"btn-pagination\"\r\n (btnAction)=\"emit(item.page)\">\r\n </cw-button>\r\n </li>\r\n }\r\n }\r\n\r\n <!-- NEXT -->\r\n <li>\r\n <cw-button\r\n [type]=\"typeButton.ghost\"\r\n [withOnlyIcon]=\"true\"\r\n [withIcon]=\"spriteIcon.nextRight\"\r\n [isDisabled]=\"pagination().currentPage >= pagination().totalPages\"\r\n [iconSize]=\"buttonIconSize.small\"\r\n cssClass=\"btn-pagination\"\r\n (btnAction)=\"emit(pagination().currentPage + 1)\">\r\n </cw-button>\r\n </li>\r\n\r\n </ul>\r\n</div>\r\n}\r\n", dependencies: [{ kind: "ngmodule", type: TranslateModule }, { kind: "component", type: ButtonComponent, selector: "cw-button", inputs: ["type", "label", "id", "link", "isDropdown", "hideCaret", "withIcon", "withOnlyIcon", "iconSize", "iconPosition", "dropdownPosition", "isMinWidth", "isDisabled", "isLoading", "cssClass", "dataTest", "skeletonMode", "withTooltip", "tooltipText", "tooltipTitle", "tooltipTrigger", "tooltipPosition", "tooltipType"], outputs: ["btnAction", "dropDownClicked"] }, { kind: "component", type: FormFieldComponent, selector: "cw-form-field", inputs: ["control", "formGroup", "type", "label", "displayLabel", "name", "placeholder", "autocomplete", "options", "rangeOptions", "validationOptions", "autocompleteOptions", "errorMessages", "isRequired", "help", "tooltip", "addonLeft", "addonRight", "isInAddon", "isReadonly", "isDisabled", "sliderValue", "sliderOptions", "cssClass", "skeletonMode", "clearable", "appendTo", "initialCountry", "indeterminate"], outputs: ["refreshEvent", "textChanged", "valueChange", "phoneRegionChange"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "pipe", type: i1$1.TranslatePipe, name: "translate" }] }); }
436
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.20", type: PaginationComponent, isStandalone: true, selector: "cw-pagination", inputs: { pagination: { classPropertyName: "pagination", publicName: "pagination", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { paginationChange: "paginationChange" }, ngImport: i0, template: "@if (pagination().totalPages > 0) {\r\n<div class=\"pagination d-flex-h gap-md justify-between fs fs-sm\">\r\n\r\n <!-- LEFT PART -->\r\n <div class=\"d-flex-h gap-sm\">\r\n {{ '_COMMON._PAGINATION.RESULT_P' | translate: {total: pagination().totalItems } }}\r\n -\r\n {{ '_COMMON._PAGINATION.DISPLAY' | translate }}\r\n\r\n <cw-form-field\r\n [label]=\"'_COMMON._PAGINATION.ITEMS_PER_PAGE'\"\r\n [type]=\"typeField.select\"\r\n [control]=\"itemsPerPageControl\"\r\n [options]=\"pageSizesOptions\"\r\n [displayLabel]=\"false\"\r\n [clearable]=\"false\">\r\n </cw-form-field>\r\n\r\n {{ '_COMMON._PAGINATION.ITEMS_PER_PAGE' | translate }}\r\n </div>\r\n\r\n <!-- PAGINATION -->\r\n <ul class=\"list-unstyled d-flex-h gap-3xs\">\r\n\r\n <!-- PREVIOUS -->\r\n <li>\r\n <cw-button\r\n [type]=\"typeButton.ghost\"\r\n [withOnlyIcon]=\"true\"\r\n [withIcon]=\"spriteIcon.nextLeft\"\r\n [isDisabled]=\"pagination().currentPage <= 1\"\r\n [iconSize]=\"buttonIconSize.small\"\r\n cssClass=\"btn-pagination\"\r\n (btnAction)=\"emit(pagination().currentPage - 1)\">\r\n </cw-button>\r\n </li>\r\n\r\n <!-- PAGES -->\r\n @for (item of visiblePages(); track item) {\r\n\r\n <!-- NUMBER -->\r\n @if (typeof item === 'number') {\r\n <li>\r\n <cw-button\r\n [type]=\"typeButton.ghost\"\r\n [label]=\"item.toString()\"\r\n [cssClass]=\"item === pagination().currentPage ? 'btn-pagination btn-pagination-active' : 'btn-pagination'\"\r\n (btnAction)=\"emit(item)\">\r\n </cw-button>\r\n </li>\r\n }\r\n\r\n <!-- JUMP PREV -->\r\n @else if (item.type === 'jump-prev') {\r\n <li>\r\n <cw-button\r\n [type]=\"typeButton.ghost\"\r\n label=\"...\"\r\n cssClass=\"btn-pagination\"\r\n (btnAction)=\"emit(item.page)\">\r\n </cw-button>\r\n </li>\r\n }\r\n\r\n <!-- JUMP NEXT -->\r\n @else if (item.type === 'jump-next') {\r\n <li>\r\n <cw-button\r\n [type]=\"typeButton.ghost\"\r\n label=\"...\"\r\n cssClass=\"btn-pagination\"\r\n (btnAction)=\"emit(item.page)\">\r\n </cw-button>\r\n </li>\r\n }\r\n }\r\n\r\n <!-- NEXT -->\r\n <li>\r\n <cw-button\r\n [type]=\"typeButton.ghost\"\r\n [withOnlyIcon]=\"true\"\r\n [withIcon]=\"spriteIcon.nextRight\"\r\n [isDisabled]=\"pagination().currentPage >= pagination().totalPages\"\r\n [iconSize]=\"buttonIconSize.small\"\r\n cssClass=\"btn-pagination\"\r\n (btnAction)=\"emit(pagination().currentPage + 1)\">\r\n </cw-button>\r\n </li>\r\n\r\n </ul>\r\n</div>\r\n}\r\n", dependencies: [{ kind: "ngmodule", type: TranslateModule }, { kind: "component", type: ButtonComponent, selector: "cw-button", inputs: ["type", "label", "id", "link", "isDropdown", "hideCaret", "withIcon", "withOnlyIcon", "iconSize", "iconPosition", "dropdownPosition", "isMinWidth", "isDisabled", "isLoading", "cssClass", "dataTest", "skeletonMode", "withTooltip", "tooltipText", "tooltipTitle", "tooltipTrigger", "tooltipPosition", "tooltipType"], outputs: ["btnAction", "dropDownClicked"] }, { kind: "component", type: FormFieldComponent, selector: "cw-form-field", inputs: ["control", "formGroup", "type", "label", "displayLabel", "name", "placeholder", "autocomplete", "options", "rangeOptions", "validationOptions", "autocompleteOptions", "richTextOptions", "errorMessages", "isRequired", "help", "tooltip", "addonLeft", "addonRight", "isInAddon", "isReadonly", "isDisabled", "sliderValue", "sliderOptions", "cssClass", "skeletonMode", "clearable", "appendTo", "initialCountry", "indeterminate"], outputs: ["refreshEvent", "textChanged", "valueChange", "phoneRegionChange"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "pipe", type: i1.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
495
437
  }
496
438
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: PaginationComponent, decorators: [{
497
439
  type: Component,
498
- args: [{ selector: 'cw-pagination', standalone: true, imports: [TranslateModule, ButtonComponent, FormFieldComponent, ReactiveFormsModule], template: "@if (pagination().totalPages > 0) {\r\n<div class=\"pagination d-flex-h gap-md justify-between fs fs-sm\">\r\n\r\n <!-- LEFT PART -->\r\n <div class=\"d-flex-h gap-sm\">\r\n {{ '_COMMON._PAGINATION.RESULT_P' | translate: {total: pagination().totalItems } }}\r\n -\r\n {{ '_COMMON._PAGINATION.DISPLAY' | translate }}\r\n\r\n <cw-form-field\r\n [label]=\"'_COMMON._PAGINATION.ITEMS_PER_PAGE'\"\r\n [type]=\"typeField.select\"\r\n [control]=\"itemsPerPageControl\"\r\n [options]=\"pageSizesOptions\"\r\n [displayLabel]=\"false\"\r\n [clearable]=\"false\">\r\n </cw-form-field>\r\n\r\n {{ '_COMMON._PAGINATION.ITEMS_PER_PAGE' | translate }}\r\n </div>\r\n\r\n <!-- PAGINATION -->\r\n <ul class=\"list-unstyled d-flex-h gap-3xs\">\r\n\r\n <!-- PREVIOUS -->\r\n <li>\r\n <cw-button\r\n [type]=\"typeButton.ghost\"\r\n [withOnlyIcon]=\"true\"\r\n [withIcon]=\"spriteIcon.nextLeft\"\r\n [isDisabled]=\"pagination().currentPage <= 1\"\r\n [iconSize]=\"buttonIconSize.small\"\r\n cssClass=\"btn-pagination\"\r\n (btnAction)=\"emit(pagination().currentPage - 1)\">\r\n </cw-button>\r\n </li>\r\n\r\n <!-- PAGES -->\r\n @for (item of visiblePages(); track item) {\r\n\r\n <!-- NUMBER -->\r\n @if (typeof item === 'number') {\r\n <li>\r\n <cw-button\r\n [type]=\"typeButton.ghost\"\r\n [label]=\"item.toString()\"\r\n [cssClass]=\"item === pagination().currentPage ? 'btn-pagination btn-pagination-active' : 'btn-pagination'\"\r\n (btnAction)=\"emit(item)\">\r\n </cw-button>\r\n </li>\r\n }\r\n\r\n <!-- JUMP PREV -->\r\n @else if (item.type === 'jump-prev') {\r\n <li>\r\n <cw-button\r\n [type]=\"typeButton.ghost\"\r\n label=\"...\"\r\n cssClass=\"btn-pagination\"\r\n (btnAction)=\"emit(item.page)\">\r\n </cw-button>\r\n </li>\r\n }\r\n\r\n <!-- JUMP NEXT -->\r\n @else if (item.type === 'jump-next') {\r\n <li>\r\n <cw-button\r\n [type]=\"typeButton.ghost\"\r\n label=\"...\"\r\n cssClass=\"btn-pagination\"\r\n (btnAction)=\"emit(item.page)\">\r\n </cw-button>\r\n </li>\r\n }\r\n }\r\n\r\n <!-- NEXT -->\r\n <li>\r\n <cw-button\r\n [type]=\"typeButton.ghost\"\r\n [withOnlyIcon]=\"true\"\r\n [withIcon]=\"spriteIcon.nextRight\"\r\n [isDisabled]=\"pagination().currentPage >= pagination().totalPages\"\r\n [iconSize]=\"buttonIconSize.small\"\r\n cssClass=\"btn-pagination\"\r\n (btnAction)=\"emit(pagination().currentPage + 1)\">\r\n </cw-button>\r\n </li>\r\n\r\n </ul>\r\n</div>\r\n}\r\n" }]
440
+ args: [{ selector: 'cw-pagination', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, imports: [TranslateModule, ButtonComponent, FormFieldComponent, ReactiveFormsModule], template: "@if (pagination().totalPages > 0) {\r\n<div class=\"pagination d-flex-h gap-md justify-between fs fs-sm\">\r\n\r\n <!-- LEFT PART -->\r\n <div class=\"d-flex-h gap-sm\">\r\n {{ '_COMMON._PAGINATION.RESULT_P' | translate: {total: pagination().totalItems } }}\r\n -\r\n {{ '_COMMON._PAGINATION.DISPLAY' | translate }}\r\n\r\n <cw-form-field\r\n [label]=\"'_COMMON._PAGINATION.ITEMS_PER_PAGE'\"\r\n [type]=\"typeField.select\"\r\n [control]=\"itemsPerPageControl\"\r\n [options]=\"pageSizesOptions\"\r\n [displayLabel]=\"false\"\r\n [clearable]=\"false\">\r\n </cw-form-field>\r\n\r\n {{ '_COMMON._PAGINATION.ITEMS_PER_PAGE' | translate }}\r\n </div>\r\n\r\n <!-- PAGINATION -->\r\n <ul class=\"list-unstyled d-flex-h gap-3xs\">\r\n\r\n <!-- PREVIOUS -->\r\n <li>\r\n <cw-button\r\n [type]=\"typeButton.ghost\"\r\n [withOnlyIcon]=\"true\"\r\n [withIcon]=\"spriteIcon.nextLeft\"\r\n [isDisabled]=\"pagination().currentPage <= 1\"\r\n [iconSize]=\"buttonIconSize.small\"\r\n cssClass=\"btn-pagination\"\r\n (btnAction)=\"emit(pagination().currentPage - 1)\">\r\n </cw-button>\r\n </li>\r\n\r\n <!-- PAGES -->\r\n @for (item of visiblePages(); track item) {\r\n\r\n <!-- NUMBER -->\r\n @if (typeof item === 'number') {\r\n <li>\r\n <cw-button\r\n [type]=\"typeButton.ghost\"\r\n [label]=\"item.toString()\"\r\n [cssClass]=\"item === pagination().currentPage ? 'btn-pagination btn-pagination-active' : 'btn-pagination'\"\r\n (btnAction)=\"emit(item)\">\r\n </cw-button>\r\n </li>\r\n }\r\n\r\n <!-- JUMP PREV -->\r\n @else if (item.type === 'jump-prev') {\r\n <li>\r\n <cw-button\r\n [type]=\"typeButton.ghost\"\r\n label=\"...\"\r\n cssClass=\"btn-pagination\"\r\n (btnAction)=\"emit(item.page)\">\r\n </cw-button>\r\n </li>\r\n }\r\n\r\n <!-- JUMP NEXT -->\r\n @else if (item.type === 'jump-next') {\r\n <li>\r\n <cw-button\r\n [type]=\"typeButton.ghost\"\r\n label=\"...\"\r\n cssClass=\"btn-pagination\"\r\n (btnAction)=\"emit(item.page)\">\r\n </cw-button>\r\n </li>\r\n }\r\n }\r\n\r\n <!-- NEXT -->\r\n <li>\r\n <cw-button\r\n [type]=\"typeButton.ghost\"\r\n [withOnlyIcon]=\"true\"\r\n [withIcon]=\"spriteIcon.nextRight\"\r\n [isDisabled]=\"pagination().currentPage >= pagination().totalPages\"\r\n [iconSize]=\"buttonIconSize.small\"\r\n cssClass=\"btn-pagination\"\r\n (btnAction)=\"emit(pagination().currentPage + 1)\">\r\n </cw-button>\r\n </li>\r\n\r\n </ul>\r\n</div>\r\n}\r\n" }]
499
441
  }], ctorParameters: () => [], propDecorators: { pagination: [{ type: i0.Input, args: [{ isSignal: true, alias: "pagination", required: true }] }], paginationChange: [{ type: i0.Output, args: ["paginationChange"] }] } });
500
442
 
443
+ // Modele du composant `cw-progress-bar` — types alignes sur le DS (BOU)
444
+ // pages Figma `Progressbar / md` et `Progressbar / sm`.
445
+ /** Hauteur de la barre. md = 1rem (16px, libelle inline possible) / sm = 0.5rem (8px). */
446
+ var ProgressBarSizeEnum;
447
+ (function (ProgressBarSizeEnum) {
448
+ ProgressBarSizeEnum["md"] = "md";
449
+ ProgressBarSizeEnum["sm"] = "sm";
450
+ })(ProgressBarSizeEnum || (ProgressBarSizeEnum = {}));
451
+ /** Couleur de remplissage. Mappe sur les tokens DS `component/progressbar/{type}`. */
452
+ var ProgressBarTypeEnum;
453
+ (function (ProgressBarTypeEnum) {
454
+ ProgressBarTypeEnum["information"] = "information";
455
+ ProgressBarTypeEnum["success"] = "success";
456
+ ProgressBarTypeEnum["warning"] = "warning";
457
+ ProgressBarTypeEnum["danger"] = "danger";
458
+ })(ProgressBarTypeEnum || (ProgressBarTypeEnum = {}));
459
+
460
+ class ProgressBarComponent {
461
+ constructor() {
462
+ /** Valeur courante d'avancement. Bornee a `[0, max]` pour le calcul du pourcentage. */
463
+ this.value = input.required(...(ngDevMode ? [{ debugName: "value" }] : []));
464
+ /** Valeur maximale (100% de la barre). Defaut `100`. */
465
+ this.max = input(100, ...(ngDevMode ? [{ debugName: "max" }] : []));
466
+ /** Hauteur de la barre. Defaut `md`. */
467
+ this.size = input(ProgressBarSizeEnum.md, ...(ngDevMode ? [{ debugName: "size" }] : []));
468
+ /** Couleur de remplissage. Defaut `information`. */
469
+ this.type = input(ProgressBarTypeEnum.information, ...(ngDevMode ? [{ debugName: "type" }] : []));
470
+ /** Affiche le pourcentage dans la barre. Uniquement en taille `md` (DS). Defaut `false`. */
471
+ this.showValue = input(false, ...(ngDevMode ? [{ debugName: "showValue" }] : []));
472
+ /** Libelle accessible (aria-label). A fournir si la barre n'est pas deja decrite par un texte voisin. */
473
+ this.label = input(...(ngDevMode ? [undefined, { debugName: "label" }] : []));
474
+ /** Attribut `data-test-ctw` pour le ciblage en test E2E. */
475
+ this.dataTest = input(...(ngDevMode ? [undefined, { debugName: "dataTest" }] : []));
476
+ /** Maximum effectif : un `max` a 0 (ou absent) retombe sur 100. */
477
+ this.effectiveMax = computed(() => this.max() || 100, ...(ngDevMode ? [{ debugName: "effectiveMax" }] : []));
478
+ /** Pourcentage borne `0..100` (arrondi) pilotant la largeur du remplissage. */
479
+ this.percent = computed(() => {
480
+ const ratio = (this.value() / this.effectiveMax()) * 100;
481
+ return Math.max(0, Math.min(100, Math.round(ratio)));
482
+ }, ...(ngDevMode ? [{ debugName: "percent" }] : []));
483
+ /**
484
+ * Valeurs restituees aux technologies d'assistance. Bornees sur la MEME regle que
485
+ * l'affichage : une source qui emet 140 remplit la barre a 100 % mais faisait annoncer
486
+ * « 140 » ; et `aria-valuemax` doit suivre le maximum reellement applique, sans quoi
487
+ * `valuenow` pouvait sortir de l'intervalle annonce.
488
+ */
489
+ this.ariaMax = computed(() => this.effectiveMax(), ...(ngDevMode ? [{ debugName: "ariaMax" }] : []));
490
+ this.ariaValue = computed(() => Math.max(0, Math.min(this.effectiveMax(), this.value())), ...(ngDevMode ? [{ debugName: "ariaValue" }] : []));
491
+ /** Le libelle inline n'existe qu'en `md` (le DS ne fournit pas de couleur `on-*` en `sm`). */
492
+ this.showInlineValue = computed(() => this.showValue() && this.size() === ProgressBarSizeEnum.md, ...(ngDevMode ? [{ debugName: "showInlineValue" }] : []));
493
+ }
494
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: ProgressBarComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
495
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.20", type: ProgressBarComponent, isStandalone: true, selector: "cw-progress-bar", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: true, transformFunction: null }, max: { classPropertyName: "max", publicName: "max", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: false, transformFunction: null }, showValue: { classPropertyName: "showValue", publicName: "showValue", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, dataTest: { classPropertyName: "dataTest", publicName: "dataTest", isSignal: true, isRequired: false, transformFunction: null } }, host: { classAttribute: "cw-progressbar" }, ngImport: i0, template: "<div\n [class]=\"'progress-bar progress-bar-' + size() + ' progress-bar-' + type()\"\n role=\"progressbar\"\n [attr.aria-valuenow]=\"ariaValue()\"\n aria-valuemin=\"0\"\n [attr.aria-valuemax]=\"ariaMax()\"\n [attr.aria-label]=\"label() ?? null\"\n [attr.data-test-ctw]=\"dataTest() ?? null\">\n <div class=\"progress-bar-fill\" [style.width.%]=\"percent()\">\n @if (showInlineValue()) {\n <span class=\"progress-bar-value\">{{ percent() }}%</span>\n }\n </div>\n</div>\n", changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
496
+ }
497
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: ProgressBarComponent, decorators: [{
498
+ type: Component,
499
+ args: [{ selector: 'cw-progress-bar', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, host: { class: 'cw-progressbar' }, template: "<div\n [class]=\"'progress-bar progress-bar-' + size() + ' progress-bar-' + type()\"\n role=\"progressbar\"\n [attr.aria-valuenow]=\"ariaValue()\"\n aria-valuemin=\"0\"\n [attr.aria-valuemax]=\"ariaMax()\"\n [attr.aria-label]=\"label() ?? null\"\n [attr.data-test-ctw]=\"dataTest() ?? null\">\n <div class=\"progress-bar-fill\" [style.width.%]=\"percent()\">\n @if (showInlineValue()) {\n <span class=\"progress-bar-value\">{{ percent() }}%</span>\n }\n </div>\n</div>\n" }]
500
+ }], propDecorators: { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: true }] }], max: [{ type: i0.Input, args: [{ isSignal: true, alias: "max", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], type: [{ type: i0.Input, args: [{ isSignal: true, alias: "type", required: false }] }], showValue: [{ type: i0.Input, args: [{ isSignal: true, alias: "showValue", required: false }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], dataTest: [{ type: i0.Input, args: [{ isSignal: true, alias: "dataTest", required: false }] }] } });
501
+
501
502
  class TableComponent {
502
503
  constructor() {
503
504
  this.modalsService = inject(ModalsService);
505
+ /** Prefixe d'id unique par instance : evite les collisions d'id de checkbox si plusieurs tables coexistent. */
506
+ this.uid = `cw-table-${Math.random().toString(36).substring(2, 9)}`;
507
+ /**
508
+ * Active la colonne de selection (cases a cocher + barre d'actions groupees).
509
+ * PREREQUIS : en mode checkbox, chaque ligne de `data()` DOIT porter un `id` unique
510
+ * — la selection est indexee par `row.id` (robuste au re-fetch d'objets). Sans `id`,
511
+ * toutes les lignes se retrouvent mappees sur la meme cle et la selection est cassee.
512
+ */
504
513
  this.checkbox = input(false, ...(ngDevMode ? [{ debugName: "checkbox" }] : []));
505
514
  this.title = input('', ...(ngDevMode ? [{ debugName: "title" }] : []));
506
515
  this.columns = input([], ...(ngDevMode ? [{ debugName: "columns" }] : []));
516
+ /** Lignes du tableau. En mode `checkbox`, chaque ligne doit avoir un `id` unique (cf. `checkbox`). */
507
517
  this.data = input([], ...(ngDevMode ? [{ debugName: "data" }] : []));
508
518
  this.loading = input(false, ...(ngDevMode ? [{ debugName: "loading" }] : []));
509
519
  this.rowClassFn = input(undefined, ...(ngDevMode ? [{ debugName: "rowClassFn" }] : []));
@@ -531,17 +541,28 @@ class TableComponent {
531
541
  this.spriteIcon = SpriteIconEnum;
532
542
  this.buttonType = BoButtonTypeEnum;
533
543
  this.illustrationEnum = EmptyStateIllustrationEnum;
544
+ this.progressBarSize = ProgressBarSizeEnum;
545
+ this.progressBarType = ProgressBarTypeEnum;
534
546
  /** Config d'etat vide a afficher selon le contexte (filtre ou non). `undefined` -> fallback texte. */
535
547
  this.currentEmptyState = computed(() => this.isFiltered() ? this.emptyStateNoResult() : this.emptyStateNoData(), ...(ngDevMode ? [{ debugName: "currentEmptyState" }] : []));
536
548
  this.currentSortKey = signal(null, ...(ngDevMode ? [{ debugName: "currentSortKey" }] : []));
537
549
  this.currentSortDirection = signal('asc', ...(ngDevMode ? [{ debugName: "currentSortDirection" }] : []));
538
- this.selectedRows = signal(new Set(), ...(ngDevMode ? [{ debugName: "selectedRows" }] : []));
550
+ /**
551
+ * Selection indexee par `row.id` (et non par reference d'objet) : reste correcte
552
+ * si le parent recree les objets `data()` au fetch (memes ids). La valeur du Map
553
+ * conserve l'objet complet pour l'emission de `selectionChange` / bulk actions.
554
+ */
555
+ this.selectedRows = signal(new Map(), ...(ngDevMode ? [{ debugName: "selectedRows" }] : []));
556
+ /** Nombre de colonnes rendues (visibles + colonne de selection) — alimente le colspan des lignes loader/vide. */
557
+ this.visibleColumnCount = computed(() => this.columns().filter(c => !c.hidden).length + (this.checkbox() ? 1 : 0), ...(ngDevMode ? [{ debugName: "visibleColumnCount" }] : []));
539
558
  this.allSelected = computed(() => {
540
559
  const rows = this.data();
541
- return rows.length > 0 && this.selectedRows().size === rows.length;
560
+ const selected = this.selectedRows();
561
+ return rows.length > 0 && rows.every(r => selected.has(r.id));
542
562
  }, ...(ngDevMode ? [{ debugName: "allSelected" }] : []));
543
563
  this.someSelected = computed(() => {
544
- return this.selectedRows().size > 0 && !this.allSelected();
564
+ const selected = this.selectedRows();
565
+ return this.data().some(r => selected.has(r.id)) && !this.allSelected();
545
566
  }, ...(ngDevMode ? [{ debugName: "someSelected" }] : []));
546
567
  this.defaultLabelFn = (row) => row?.name ?? row?.label ?? row?.title ?? String(row?.id ?? row);
547
568
  /**
@@ -600,6 +621,12 @@ class TableComponent {
600
621
  ? SpriteIconEnum.keyboardUp
601
622
  : SpriteIconEnum.keyboardDown;
602
623
  }
624
+ /** Valeur `aria-sort` de l'en-tete (annonce la direction de tri active aux lecteurs d'ecran). */
625
+ getAriaSort(key) {
626
+ if (this.currentSortKey() !== key)
627
+ return 'none';
628
+ return this.currentSortDirection() === 'asc' ? 'ascending' : 'descending';
629
+ }
603
630
  getBadge(column, value) {
604
631
  return column.badges?.find(b => b.value === value)
605
632
  ?? { value, type: BadgeTypeEnum.lightLight };
@@ -615,28 +642,29 @@ class TableComponent {
615
642
  }
616
643
  toggleAll() {
617
644
  this.selectedRows.update(current => {
618
- if (current.size === this.data().length) {
619
- return new Set();
620
- }
621
- return new Set(this.data());
645
+ const rows = this.data();
646
+ const allSelected = rows.length > 0 && rows.every(r => current.has(r.id));
647
+ return allSelected
648
+ ? new Map()
649
+ : new Map(rows.map(r => [r.id, r]));
622
650
  });
623
- this.selectionChange.emit([...this.selectedRows()]);
651
+ this.selectionChange.emit([...this.selectedRows().values()]);
624
652
  }
625
653
  toggleRow(row) {
626
654
  this.selectedRows.update(current => {
627
- const next = new Set(current);
628
- if (next.has(row)) {
629
- next.delete(row);
655
+ const next = new Map(current);
656
+ if (next.has(row.id)) {
657
+ next.delete(row.id);
630
658
  }
631
659
  else {
632
- next.add(row);
660
+ next.set(row.id, row);
633
661
  }
634
662
  return next;
635
663
  });
636
- this.selectionChange.emit([...this.selectedRows()]);
664
+ this.selectionChange.emit([...this.selectedRows().values()]);
637
665
  }
638
666
  isSelected(row) {
639
- return this.selectedRows().has(row);
667
+ return this.selectedRows().has(row.id);
640
668
  }
641
669
  resolveVariant(action) {
642
670
  if (action.variant)
@@ -650,7 +678,7 @@ class TableComponent {
650
678
  return isSignal(value) ? value() : value;
651
679
  }
652
680
  async onBulkActionClick(action) {
653
- const rows = [...this.selectedRows()];
681
+ const rows = [...this.selectedRows().values()];
654
682
  if (action.type === 'delete') {
655
683
  const labelFn = action.itemLabel ?? this.defaultLabelFn;
656
684
  try {
@@ -743,13 +771,12 @@ class TableComponent {
743
771
  return typeof descriptor.link === 'function' ? descriptor.link(row) : descriptor.link;
744
772
  }
745
773
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: TableComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
746
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.20", type: TableComponent, isStandalone: true, selector: "cw-table", inputs: { checkbox: { classPropertyName: "checkbox", publicName: "checkbox", isSignal: true, isRequired: false, transformFunction: null }, title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: false, transformFunction: null }, columns: { classPropertyName: "columns", publicName: "columns", isSignal: true, isRequired: false, transformFunction: null }, data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: false, transformFunction: null }, loading: { classPropertyName: "loading", publicName: "loading", isSignal: true, isRequired: false, transformFunction: null }, rowClassFn: { classPropertyName: "rowClassFn", publicName: "rowClassFn", isSignal: true, isRequired: false, transformFunction: null }, pagination: { classPropertyName: "pagination", publicName: "pagination", isSignal: true, isRequired: false, transformFunction: null }, bulkActions: { classPropertyName: "bulkActions", publicName: "bulkActions", isSignal: true, isRequired: false, transformFunction: null }, rowActions: { classPropertyName: "rowActions", publicName: "rowActions", isSignal: true, isRequired: false, transformFunction: null }, emptyStateNoData: { classPropertyName: "emptyStateNoData", publicName: "emptyStateNoData", isSignal: true, isRequired: false, transformFunction: null }, emptyStateNoResult: { classPropertyName: "emptyStateNoResult", publicName: "emptyStateNoResult", isSignal: true, isRequired: false, transformFunction: null }, isFiltered: { classPropertyName: "isFiltered", publicName: "isFiltered", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { cellClick: "cellClick", sortChange: "sortChange", selectionChange: "selectionChange", paginationChange: "paginationChange", bulkDelete: "bulkDelete", bulkAction: "bulkAction" }, host: { classAttribute: "cw-table" }, queries: [{ propertyName: "actionsTemplate", first: true, predicate: ["actionsTemplate"], descendants: true, isSignal: true }], ngImport: i0, template: "@if (checkbox() && selectedRows().size > 0) {\n <div class=\"table-selection-info mb-2 d-flex align-items-center gap-2 flex-wrap\">\n <span>\n {{ selectedRows().size }} {{ '_COMMON._TABLE._BULK_ACTION.SELECTED_ITEMS_CURRENT_PAGE' | translate }}\n </span>\n @for (action of bulkActions(); track $index) {\n <cw-button\n [type]=\"resolveVariant(action)\"\n [label]=\"action.label\"\n [withIcon]=\"action.icon\"\n [isDisabled]=\"resolveDisabled(action)\"\n (btnAction)=\"onBulkActionClick(action)\">\n </cw-button>\n }\n </div>\n}\n\n<div class=\"table-responsive\">\n <table class=\"table\">\n <caption class=\"visually-hidden\" [innerHTML]=\"'_COMMON._TABLE.CAPTION' | translate: { label: title() } \"></caption>\n <thead>\n <tr>\n @if(checkbox()) {\n <th scope=\"col\" width=\"10\">\n <div class=\"field-check\">\n <input class=\"field-check-input\" type=\"checkbox\" id=\"checkme\" [checked]=\"allSelected()\"\n [indeterminate]=\"someSelected()\" (change)=\"toggleAll()\">\n <label class=\"field-check-label\" for=\"checkme\">\n <span class=\"visually-hidden\">{{ '_COMMON._TABLE._THEAD.CHECK_LINE' | translate }}</span>\n </label>\n </div>\n </th>\n }\n\n @for (column of columns(); track column.key) {\n @if (!column.hidden) {\n <th scope=\"col\" [class.p-0]=\"column.sort\">\n @if (column.sort) {\n <button class=\"d-flex-h gap-2xs\" [class]=\"getSortClass(column.key)\" (click)=\"setSortProperty(column.key)\">\n {{ column.label | translate}}\n <cw-icon\n [icon]=\"getSortIcon(column.key)\"\n [label]=\"'_COMMON._TABLE._SORT.LABEL' | translate\"\n [type]=\"iconType.default\"\n [iconSize]=\"iconSize['xs']\"></cw-icon>\n </button>\n }\n @else {\n {{ column.label | translate }}\n }\n </th>\n }\n }\n </tr>\n </thead>\n <tbody>\n @if (loading()) {\n <tr>\n <td colspan=\"100\">\n <cw-loader></cw-loader>\n </td>\n </tr>\n }\n @else if (!data() || data().length === 0) {\n <tr>\n <td class=\"table-info no-result\" colspan=\"100\">\n @if (currentEmptyState(); as empty) {\n <cw-empty-state\n [illustration]=\"empty.illustration ?? (isFiltered() ? illustrationEnum.noResult : illustrationEnum.noData)\"\n [imageSource]=\"empty.imageSource\"\n [title]=\"empty.title\"\n [description]=\"empty.description\"\n [primaryButton]=\"empty.primaryButton\"\n [secondaryButton]=\"empty.secondaryButton\"\n (primaryClick)=\"empty.primaryButton?.click?.()\"\n (secondaryClick)=\"empty.secondaryButton?.click?.()\">\n </cw-empty-state>\n } @else {\n {{ '_COMMON._TABLE.NO_RESULT' | translate }}\n }\n </td>\n </tr>\n }\n @else {\n @for (row of data(); track row) {\n <tr [class.tr-selected]=\"isSelected(row)\" [class]=\"getRowClass(row)\">\n @if (checkbox()) {\n <td>\n <input class=\"field-check-input\" type=\"checkbox\" [checked]=\"isSelected(row)\" (change)=\"toggleRow(row)\" [id]=\"'check-' + row.id\"\n [attr.aria-label]=\"'S\u00E9lectionner la ligne ' + row.id\">\n <label class=\"visually-hidden\" [for]=\"'check-' + row.id\">S\u00E9lectionner la ligne {{row.id}}</label>\n </td>\n }\n @for (column of columns(); track column.key) {\n @if (!column.hidden) {\n <td [class.text-end]=\"column.align === 'right'\" [class.text-center]=\"column.align === 'center'\"\n [class.td-actions]=\"column.type === 'actions'\">\n @switch (column.type) {\n @case ('link') {\n <a href=\"javascript:void(0)\" (click)=\"onCellClick(row, column)\">\n {{ column.translate ? (row[column.key] | translate) : row[column.key] }}\n </a>\n }\n @case ('badge') {\n <cw-badge\n [type]=\"getBadge(column, row[column.key]).type\"\n [label]=\"getBadge(column, row[column.key]).label ?? row[column.key]\"\n [withIcon]=\"getBadge(column, row[column.key]).withIcon\"\n [iconPosition]=\"getBadge(column, row[column.key]).iconPosition\"></cw-badge>\n }\n @case ('icon') {\n @if (isClickable(column)) {\n <a href=\"javascript:void(0)\" (click)=\"onCellClick(row, column)\" [attr.aria-label]=\"row[column.key].label\">\n <cw-icon\n [icon]=\"row[column.key].icon\"\n [label]=\"row[column.key].label\"\n [type]=\"iconType.default\"\n [iconSize]=\"iconSize['md']\"\n [iconCssClass]=\"row[column.key].iconCssClass\"\n ></cw-icon>\n </a>\n } @else {\n <cw-icon\n [icon]=\"row[column.key].icon\"\n [label]=\"row[column.key].label\"\n [type]=\"iconType.default\"\n [iconSize]=\"iconSize['md']\"\n [iconCssClass]=\"row[column.key].iconCssClass\"\n ></cw-icon>\n }\n }\n @case ('image') {\n @if (isClickable(column)) {\n <a href=\"javascript:void(0)\" (click)=\"onCellClick(row, column)\" [attr.aria-label]=\"row[column.key].label\">\n <cw-image\n [source]=\"row[column.key].source\"\n [alt]=\"row[column.key].label\"\n [isAriaHidden]=\"true\"\n [cssClass]=\"row[column.key].iconCssClass\"\n width=\"32\"\n height=\"32\"\n ></cw-image>\n </a>\n } @else {\n <cw-image\n [source]=\"row[column.key].source\"\n [alt]=\"row[column.key].label\"\n [isAriaHidden]=\"true\"\n [cssClass]=\"row[column.key].iconCssClass\"\n width=\"32\"\n height=\"32\"\n ></cw-image>\n }\n }\n @case ('check') {\n @if (isTruthy(row[column.key])) {\n <cw-icon\n [icon]=\"spriteIcon.checkCircle\"\n [label]=\"'_COMMON._PRO_SENTENCE.YES' | translate\"\n [type]=\"iconType.default\"\n iconCssClass=\"text-success\"\n [iconSize]=\"iconSize['md']\"></cw-icon>\n } @else {\n <cw-icon\n [icon]=\"spriteIcon.closeCircle\"\n [label]=\"'_COMMON._PRO_SENTENCE.NO' | translate\"\n [type]=\"iconType.default\"\n iconCssClass=\"text-danger\"\n [iconSize]=\"iconSize['md']\"></cw-icon>\n }\n }\n @case ('actions') {\n @if (usingRowActions) {\n @let actions = getResolvedActions(row);\n @if (actions.length > 0) {\n @if (!useDropdownActions()) {\n @for (action of actions; track $index) {\n <cw-button\n [type]=\"buttonType.ghost\"\n [label]=\"action.label\"\n [withIcon]=\"action.icon\"\n [link]=\"action.link\"\n [isDisabled]=\"action.disabled\"\n [cssClass]=\"actionCssClass(action)\"\n (btnAction)=\"onRowActionClick(action, row)\">\n </cw-button>\n }\n } @else {\n <cw-button\n [label]=\"'_COMMON._TABLE.ACTIONS_MENU'\"\n [withIcon]=\"spriteIcon.menuVertical\"\n [withOnlyIcon]=\"true\"\n [type]=\"buttonType.ghost\"\n [isDropdown]=\"true\"\n [hideCaret]=\"true\">\n <ul class=\"p-0 m-0\">\n @for (action of actions; track $index) {\n <li>\n @if (action.link) {\n <cw-button\n [type]=\"buttonType.ghost\"\n [label]=\"action.label\"\n [withIcon]=\"action.icon\"\n [link]=\"action.link\"\n [isDisabled]=\"action.disabled\"\n [cssClass]=\"'dropdown-item ' + actionCssClass(action)\">\n </cw-button>\n } @else {\n <cw-button\n [type]=\"buttonType.ghost\"\n [label]=\"action.label\"\n [withIcon]=\"action.icon\"\n [isDisabled]=\"action.disabled\"\n [cssClass]=\"'dropdown-item ' + actionCssClass(action)\"\n (btnAction)=\"onRowActionClick(action, row)\">\n </cw-button>\n }\n </li>\n }\n </ul>\n </cw-button>\n }\n }\n } @else {\n <ng-container\n *ngTemplateOutlet=\"actionsTemplate(); context: { $implicit: row }\">\n </ng-container>\n }\n }\n @default {\n {{ column.translate ? (row[column.key] | translate) : row[column.key] }}\n }\n }\n </td>\n }\n }\n </tr>\n }\n }\n </tbody>\n </table>\n</div>\n\n@if (pagination()) {\n <cw-pagination\n [pagination]=\"pagination()!\"\n (paginationChange)=\"paginationChange.emit($event)\">\n </cw-pagination>\n}\n", dependencies: [{ kind: "ngmodule", type: TranslateModule }, { kind: "component", type: LoaderComponent, selector: "cw-loader", inputs: ["size", "displayText"] }, { kind: "component", type: BadgeComponent, selector: "cw-badge", inputs: ["type", "label", "withIcon", "iconPosition", "cssClass", "skeletonMode", "dataTest"] }, { kind: "component", type: ButtonComponent, selector: "cw-button", inputs: ["type", "label", "id", "link", "isDropdown", "hideCaret", "withIcon", "withOnlyIcon", "iconSize", "iconPosition", "dropdownPosition", "isMinWidth", "isDisabled", "isLoading", "cssClass", "dataTest", "skeletonMode", "withTooltip", "tooltipText", "tooltipTitle", "tooltipTrigger", "tooltipPosition", "tooltipType"], outputs: ["btnAction", "dropDownClicked"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: PaginationComponent, selector: "cw-pagination", inputs: ["pagination"], outputs: ["paginationChange"] }, { kind: "component", type: IconComponent, selector: "cw-icon", inputs: ["icon", "label", "type", "iconSize", "iconCssClass", "iconUiType", "iconColorCustom", "spritePath"] }, { kind: "component", type: ImageComponent, selector: "cw-image", inputs: ["source", "alt", "isAriaHidden", "cssClass", "width", "height"] }, { kind: "component", type: EmptyStateComponent, selector: "cw-empty-state", inputs: ["illustration", "illustrationBasePath", "imageSource", "imageAlt", "title", "description", "primaryButton", "secondaryButton", "dataTest"], outputs: ["primaryClick", "secondaryClick"] }, { kind: "pipe", type: i1$1.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
774
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.20", type: TableComponent, isStandalone: true, selector: "cw-table", inputs: { checkbox: { classPropertyName: "checkbox", publicName: "checkbox", isSignal: true, isRequired: false, transformFunction: null }, title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: false, transformFunction: null }, columns: { classPropertyName: "columns", publicName: "columns", isSignal: true, isRequired: false, transformFunction: null }, data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: false, transformFunction: null }, loading: { classPropertyName: "loading", publicName: "loading", isSignal: true, isRequired: false, transformFunction: null }, rowClassFn: { classPropertyName: "rowClassFn", publicName: "rowClassFn", isSignal: true, isRequired: false, transformFunction: null }, pagination: { classPropertyName: "pagination", publicName: "pagination", isSignal: true, isRequired: false, transformFunction: null }, bulkActions: { classPropertyName: "bulkActions", publicName: "bulkActions", isSignal: true, isRequired: false, transformFunction: null }, rowActions: { classPropertyName: "rowActions", publicName: "rowActions", isSignal: true, isRequired: false, transformFunction: null }, emptyStateNoData: { classPropertyName: "emptyStateNoData", publicName: "emptyStateNoData", isSignal: true, isRequired: false, transformFunction: null }, emptyStateNoResult: { classPropertyName: "emptyStateNoResult", publicName: "emptyStateNoResult", isSignal: true, isRequired: false, transformFunction: null }, isFiltered: { classPropertyName: "isFiltered", publicName: "isFiltered", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { cellClick: "cellClick", sortChange: "sortChange", selectionChange: "selectionChange", paginationChange: "paginationChange", bulkDelete: "bulkDelete", bulkAction: "bulkAction" }, host: { classAttribute: "cw-table" }, queries: [{ propertyName: "actionsTemplate", first: true, predicate: ["actionsTemplate"], descendants: true, isSignal: true }], ngImport: i0, template: "@if (checkbox() && selectedRows().size > 0) {\n <div class=\"table-selection-info mb-2 d-flex align-items-center gap-2 flex-wrap\">\n <span>\n {{ selectedRows().size }} {{ '_COMMON._TABLE._BULK_ACTION.SELECTED_ITEMS_CURRENT_PAGE' | translate }}\n </span>\n @for (action of bulkActions(); track $index) {\n <cw-button\n [type]=\"resolveVariant(action)\"\n [label]=\"action.label\"\n [withIcon]=\"action.icon\"\n [isDisabled]=\"resolveDisabled(action)\"\n (btnAction)=\"onBulkActionClick(action)\">\n </cw-button>\n }\n </div>\n}\n\n<div class=\"table-responsive\">\n <table class=\"table\">\n <caption class=\"visually-hidden\" [innerHTML]=\"'_COMMON._TABLE.CAPTION' | translate: { label: title() } \"></caption>\n <thead>\n <tr>\n @if(checkbox()) {\n <th scope=\"col\" width=\"10\">\n <div class=\"field-check\">\n <input class=\"field-check-input\" type=\"checkbox\" [id]=\"uid + '-all'\" [checked]=\"allSelected()\"\n [indeterminate]=\"someSelected()\" (change)=\"toggleAll()\">\n <label class=\"field-check-label\" [for]=\"uid + '-all'\">\n <span class=\"visually-hidden\">{{ '_COMMON._TABLE._THEAD.CHECK_LINE' | translate }}</span>\n </label>\n </div>\n </th>\n }\n\n @for (column of columns(); track column.key) {\n @if (!column.hidden) {\n <th scope=\"col\" [class.p-0]=\"column.sort\" [attr.aria-sort]=\"column.sort ? getAriaSort(column.key) : null\">\n @if (column.sort) {\n <button class=\"d-flex-h gap-2xs\" [class]=\"getSortClass(column.key)\" (click)=\"setSortProperty(column.key)\">\n {{ column.label | translate}}\n <cw-icon\n [icon]=\"getSortIcon(column.key)\"\n [label]=\"'_COMMON._TABLE._SORT.LABEL' | translate\"\n [type]=\"iconType.default\"\n [iconSize]=\"iconSize['xs']\"></cw-icon>\n </button>\n }\n @else {\n {{ column.label | translate }}\n }\n </th>\n }\n }\n </tr>\n </thead>\n <tbody>\n @if (loading()) {\n <tr>\n <td [attr.colspan]=\"visibleColumnCount()\">\n <cw-loader></cw-loader>\n </td>\n </tr>\n }\n @else if (!data() || data().length === 0) {\n <tr>\n <td class=\"table-info no-result\" [attr.colspan]=\"visibleColumnCount()\">\n @if (currentEmptyState(); as empty) {\n <cw-empty-state\n [illustration]=\"empty.illustration ?? (isFiltered() ? illustrationEnum.noResult : illustrationEnum.noData)\"\n [imageSource]=\"empty.imageSource\"\n [title]=\"empty.title\"\n [description]=\"empty.description\"\n [primaryButton]=\"empty.primaryButton\"\n [secondaryButton]=\"empty.secondaryButton\"\n (primaryClick)=\"empty.primaryButton?.click?.()\"\n (secondaryClick)=\"empty.secondaryButton?.click?.()\">\n </cw-empty-state>\n } @else {\n {{ '_COMMON._TABLE.NO_RESULT' | translate }}\n }\n </td>\n </tr>\n }\n @else {\n @for (row of data(); track row) {\n <tr [class.tr-selected]=\"isSelected(row)\" [class]=\"getRowClass(row)\">\n @if (checkbox()) {\n <td>\n <input class=\"field-check-input\" type=\"checkbox\" [checked]=\"isSelected(row)\" (change)=\"toggleRow(row)\" [id]=\"uid + '-check-' + row.id\"\n [attr.aria-label]=\"('_COMMON._TABLE._THEAD.CHECK_LINE' | translate) + ' ' + row.id\">\n <label class=\"visually-hidden\" [for]=\"uid + '-check-' + row.id\">{{ '_COMMON._TABLE._THEAD.CHECK_LINE' | translate }} {{ row.id }}</label>\n </td>\n }\n @for (column of columns(); track column.key) {\n @if (!column.hidden) {\n <td [class.text-end]=\"column.align === 'right'\" [class.text-center]=\"column.align === 'center'\"\n [class.td-actions]=\"column.type === 'actions'\">\n @switch (column.type) {\n @case ('link') {\n <a href=\"javascript:void(0)\" (click)=\"onCellClick(row, column)\">\n {{ column.translate ? (row[column.key] | translate) : row[column.key] }}\n </a>\n }\n @case ('badge') {\n <cw-badge\n [type]=\"getBadge(column, row[column.key]).type\"\n [label]=\"getBadge(column, row[column.key]).label ?? row[column.key]\"\n [withIcon]=\"getBadge(column, row[column.key]).withIcon\"\n [iconPosition]=\"getBadge(column, row[column.key]).iconPosition\"></cw-badge>\n }\n @case ('icon') {\n @if (isClickable(column)) {\n <a href=\"javascript:void(0)\" (click)=\"onCellClick(row, column)\" [attr.aria-label]=\"row[column.key].label\">\n <cw-icon\n [icon]=\"row[column.key].icon\"\n [label]=\"row[column.key].label\"\n [type]=\"iconType.default\"\n [iconSize]=\"iconSize['md']\"\n [iconCssClass]=\"row[column.key].iconCssClass\"\n ></cw-icon>\n </a>\n } @else {\n <cw-icon\n [icon]=\"row[column.key].icon\"\n [label]=\"row[column.key].label\"\n [type]=\"iconType.default\"\n [iconSize]=\"iconSize['md']\"\n [iconCssClass]=\"row[column.key].iconCssClass\"\n ></cw-icon>\n }\n }\n @case ('image') {\n @if (isClickable(column)) {\n <a href=\"javascript:void(0)\" (click)=\"onCellClick(row, column)\" [attr.aria-label]=\"row[column.key].label\">\n <cw-image\n [source]=\"row[column.key].source\"\n [alt]=\"row[column.key].label\"\n [isAriaHidden]=\"true\"\n [cssClass]=\"row[column.key].iconCssClass\"\n width=\"32\"\n height=\"32\"\n ></cw-image>\n </a>\n } @else {\n <cw-image\n [source]=\"row[column.key].source\"\n [alt]=\"row[column.key].label\"\n [isAriaHidden]=\"true\"\n [cssClass]=\"row[column.key].iconCssClass\"\n width=\"32\"\n height=\"32\"\n ></cw-image>\n }\n }\n @case ('check') {\n @if (isTruthy(row[column.key])) {\n <cw-icon\n [icon]=\"spriteIcon.checkCircle\"\n [label]=\"'_COMMON._PRO_SENTENCE.YES' | translate\"\n [type]=\"iconType.default\"\n iconCssClass=\"text-success\"\n [iconSize]=\"iconSize['md']\"></cw-icon>\n } @else {\n <cw-icon\n [icon]=\"spriteIcon.closeCircle\"\n [label]=\"'_COMMON._PRO_SENTENCE.NO' | translate\"\n [type]=\"iconType.default\"\n iconCssClass=\"text-danger\"\n [iconSize]=\"iconSize['md']\"></cw-icon>\n }\n }\n @case ('progressbar') {\n <div class=\"td-progressbar\">\n <cw-progress-bar\n [value]=\"row[column.key]\"\n [size]=\"progressBarSize.sm\"\n [type]=\"progressBarType.information\"></cw-progress-bar>\n <span class=\"td-progressbar-value\">{{ row[column.key] }}%</span>\n </div>\n }\n @case ('actions') {\n @if (usingRowActions) {\n @let actions = getResolvedActions(row);\n @if (actions.length > 0) {\n @if (!useDropdownActions()) {\n @for (action of actions; track $index) {\n <cw-button\n [type]=\"buttonType.ghost\"\n [label]=\"action.label\"\n [withIcon]=\"action.icon\"\n [link]=\"action.link\"\n [isDisabled]=\"action.disabled\"\n [cssClass]=\"actionCssClass(action)\"\n (btnAction)=\"onRowActionClick(action, row)\">\n </cw-button>\n }\n } @else {\n <cw-button\n [label]=\"'_COMMON._TABLE.ACTIONS_MENU'\"\n [withIcon]=\"spriteIcon.menuVertical\"\n [withOnlyIcon]=\"true\"\n [type]=\"buttonType.ghost\"\n [isDropdown]=\"true\"\n [hideCaret]=\"true\">\n <ul class=\"p-0 m-0\">\n @for (action of actions; track $index) {\n <li>\n @if (action.link) {\n <cw-button\n [type]=\"buttonType.ghost\"\n [label]=\"action.label\"\n [withIcon]=\"action.icon\"\n [link]=\"action.link\"\n [isDisabled]=\"action.disabled\"\n [cssClass]=\"'dropdown-item ' + actionCssClass(action)\">\n </cw-button>\n } @else {\n <cw-button\n [type]=\"buttonType.ghost\"\n [label]=\"action.label\"\n [withIcon]=\"action.icon\"\n [isDisabled]=\"action.disabled\"\n [cssClass]=\"'dropdown-item ' + actionCssClass(action)\"\n (btnAction)=\"onRowActionClick(action, row)\">\n </cw-button>\n }\n </li>\n }\n </ul>\n </cw-button>\n }\n }\n } @else {\n <ng-container\n *ngTemplateOutlet=\"actionsTemplate(); context: { $implicit: row }\">\n </ng-container>\n }\n }\n @default {\n {{ column.translate ? (row[column.key] | translate) : row[column.key] }}\n }\n }\n </td>\n }\n }\n </tr>\n }\n }\n </tbody>\n </table>\n</div>\n\n@if (pagination()) {\n <cw-pagination\n [pagination]=\"pagination()!\"\n (paginationChange)=\"paginationChange.emit($event)\">\n </cw-pagination>\n}\n", dependencies: [{ kind: "ngmodule", type: TranslateModule }, { kind: "component", type: LoaderComponent, selector: "cw-loader", inputs: ["size", "displayText"] }, { kind: "component", type: BadgeComponent, selector: "cw-badge", inputs: ["type", "label", "withIcon", "iconPosition", "cssClass", "skeletonMode", "dataTest"] }, { kind: "component", type: ButtonComponent, selector: "cw-button", inputs: ["type", "label", "id", "link", "isDropdown", "hideCaret", "withIcon", "withOnlyIcon", "iconSize", "iconPosition", "dropdownPosition", "isMinWidth", "isDisabled", "isLoading", "cssClass", "dataTest", "skeletonMode", "withTooltip", "tooltipText", "tooltipTitle", "tooltipTrigger", "tooltipPosition", "tooltipType"], outputs: ["btnAction", "dropDownClicked"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: PaginationComponent, selector: "cw-pagination", inputs: ["pagination"], outputs: ["paginationChange"] }, { kind: "component", type: IconComponent, selector: "cw-icon", inputs: ["icon", "label", "type", "iconSize", "iconCssClass", "iconUiType", "iconColorCustom", "spritePath"] }, { kind: "component", type: ImageComponent, selector: "cw-image", inputs: ["source", "alt", "isAriaHidden", "cssClass", "width", "height"] }, { kind: "component", type: EmptyStateComponent, selector: "cw-empty-state", inputs: ["illustration", "illustrationBasePath", "imageSource", "imageAlt", "title", "description", "primaryButton", "secondaryButton", "dataTest"], outputs: ["primaryClick", "secondaryClick"] }, { kind: "component", type: ProgressBarComponent, selector: "cw-progress-bar", inputs: ["value", "max", "size", "type", "showValue", "label", "dataTest"] }, { kind: "pipe", type: i1.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
747
775
  }
748
776
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: TableComponent, decorators: [{
749
777
  type: Component,
750
778
  args: [{ selector: 'cw-table', standalone: true, host: { class: 'cw-table' }, changeDetection: ChangeDetectionStrategy.OnPush, imports: [
751
779
  TranslateModule,
752
- DoubleScrollDirective,
753
780
  LoaderComponent,
754
781
  BadgeComponent,
755
782
  ButtonComponent,
@@ -757,8 +784,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.20", ngImpo
757
784
  PaginationComponent,
758
785
  IconComponent,
759
786
  ImageComponent,
760
- EmptyStateComponent
761
- ], template: "@if (checkbox() && selectedRows().size > 0) {\n <div class=\"table-selection-info mb-2 d-flex align-items-center gap-2 flex-wrap\">\n <span>\n {{ selectedRows().size }} {{ '_COMMON._TABLE._BULK_ACTION.SELECTED_ITEMS_CURRENT_PAGE' | translate }}\n </span>\n @for (action of bulkActions(); track $index) {\n <cw-button\n [type]=\"resolveVariant(action)\"\n [label]=\"action.label\"\n [withIcon]=\"action.icon\"\n [isDisabled]=\"resolveDisabled(action)\"\n (btnAction)=\"onBulkActionClick(action)\">\n </cw-button>\n }\n </div>\n}\n\n<div class=\"table-responsive\">\n <table class=\"table\">\n <caption class=\"visually-hidden\" [innerHTML]=\"'_COMMON._TABLE.CAPTION' | translate: { label: title() } \"></caption>\n <thead>\n <tr>\n @if(checkbox()) {\n <th scope=\"col\" width=\"10\">\n <div class=\"field-check\">\n <input class=\"field-check-input\" type=\"checkbox\" id=\"checkme\" [checked]=\"allSelected()\"\n [indeterminate]=\"someSelected()\" (change)=\"toggleAll()\">\n <label class=\"field-check-label\" for=\"checkme\">\n <span class=\"visually-hidden\">{{ '_COMMON._TABLE._THEAD.CHECK_LINE' | translate }}</span>\n </label>\n </div>\n </th>\n }\n\n @for (column of columns(); track column.key) {\n @if (!column.hidden) {\n <th scope=\"col\" [class.p-0]=\"column.sort\">\n @if (column.sort) {\n <button class=\"d-flex-h gap-2xs\" [class]=\"getSortClass(column.key)\" (click)=\"setSortProperty(column.key)\">\n {{ column.label | translate}}\n <cw-icon\n [icon]=\"getSortIcon(column.key)\"\n [label]=\"'_COMMON._TABLE._SORT.LABEL' | translate\"\n [type]=\"iconType.default\"\n [iconSize]=\"iconSize['xs']\"></cw-icon>\n </button>\n }\n @else {\n {{ column.label | translate }}\n }\n </th>\n }\n }\n </tr>\n </thead>\n <tbody>\n @if (loading()) {\n <tr>\n <td colspan=\"100\">\n <cw-loader></cw-loader>\n </td>\n </tr>\n }\n @else if (!data() || data().length === 0) {\n <tr>\n <td class=\"table-info no-result\" colspan=\"100\">\n @if (currentEmptyState(); as empty) {\n <cw-empty-state\n [illustration]=\"empty.illustration ?? (isFiltered() ? illustrationEnum.noResult : illustrationEnum.noData)\"\n [imageSource]=\"empty.imageSource\"\n [title]=\"empty.title\"\n [description]=\"empty.description\"\n [primaryButton]=\"empty.primaryButton\"\n [secondaryButton]=\"empty.secondaryButton\"\n (primaryClick)=\"empty.primaryButton?.click?.()\"\n (secondaryClick)=\"empty.secondaryButton?.click?.()\">\n </cw-empty-state>\n } @else {\n {{ '_COMMON._TABLE.NO_RESULT' | translate }}\n }\n </td>\n </tr>\n }\n @else {\n @for (row of data(); track row) {\n <tr [class.tr-selected]=\"isSelected(row)\" [class]=\"getRowClass(row)\">\n @if (checkbox()) {\n <td>\n <input class=\"field-check-input\" type=\"checkbox\" [checked]=\"isSelected(row)\" (change)=\"toggleRow(row)\" [id]=\"'check-' + row.id\"\n [attr.aria-label]=\"'S\u00E9lectionner la ligne ' + row.id\">\n <label class=\"visually-hidden\" [for]=\"'check-' + row.id\">S\u00E9lectionner la ligne {{row.id}}</label>\n </td>\n }\n @for (column of columns(); track column.key) {\n @if (!column.hidden) {\n <td [class.text-end]=\"column.align === 'right'\" [class.text-center]=\"column.align === 'center'\"\n [class.td-actions]=\"column.type === 'actions'\">\n @switch (column.type) {\n @case ('link') {\n <a href=\"javascript:void(0)\" (click)=\"onCellClick(row, column)\">\n {{ column.translate ? (row[column.key] | translate) : row[column.key] }}\n </a>\n }\n @case ('badge') {\n <cw-badge\n [type]=\"getBadge(column, row[column.key]).type\"\n [label]=\"getBadge(column, row[column.key]).label ?? row[column.key]\"\n [withIcon]=\"getBadge(column, row[column.key]).withIcon\"\n [iconPosition]=\"getBadge(column, row[column.key]).iconPosition\"></cw-badge>\n }\n @case ('icon') {\n @if (isClickable(column)) {\n <a href=\"javascript:void(0)\" (click)=\"onCellClick(row, column)\" [attr.aria-label]=\"row[column.key].label\">\n <cw-icon\n [icon]=\"row[column.key].icon\"\n [label]=\"row[column.key].label\"\n [type]=\"iconType.default\"\n [iconSize]=\"iconSize['md']\"\n [iconCssClass]=\"row[column.key].iconCssClass\"\n ></cw-icon>\n </a>\n } @else {\n <cw-icon\n [icon]=\"row[column.key].icon\"\n [label]=\"row[column.key].label\"\n [type]=\"iconType.default\"\n [iconSize]=\"iconSize['md']\"\n [iconCssClass]=\"row[column.key].iconCssClass\"\n ></cw-icon>\n }\n }\n @case ('image') {\n @if (isClickable(column)) {\n <a href=\"javascript:void(0)\" (click)=\"onCellClick(row, column)\" [attr.aria-label]=\"row[column.key].label\">\n <cw-image\n [source]=\"row[column.key].source\"\n [alt]=\"row[column.key].label\"\n [isAriaHidden]=\"true\"\n [cssClass]=\"row[column.key].iconCssClass\"\n width=\"32\"\n height=\"32\"\n ></cw-image>\n </a>\n } @else {\n <cw-image\n [source]=\"row[column.key].source\"\n [alt]=\"row[column.key].label\"\n [isAriaHidden]=\"true\"\n [cssClass]=\"row[column.key].iconCssClass\"\n width=\"32\"\n height=\"32\"\n ></cw-image>\n }\n }\n @case ('check') {\n @if (isTruthy(row[column.key])) {\n <cw-icon\n [icon]=\"spriteIcon.checkCircle\"\n [label]=\"'_COMMON._PRO_SENTENCE.YES' | translate\"\n [type]=\"iconType.default\"\n iconCssClass=\"text-success\"\n [iconSize]=\"iconSize['md']\"></cw-icon>\n } @else {\n <cw-icon\n [icon]=\"spriteIcon.closeCircle\"\n [label]=\"'_COMMON._PRO_SENTENCE.NO' | translate\"\n [type]=\"iconType.default\"\n iconCssClass=\"text-danger\"\n [iconSize]=\"iconSize['md']\"></cw-icon>\n }\n }\n @case ('actions') {\n @if (usingRowActions) {\n @let actions = getResolvedActions(row);\n @if (actions.length > 0) {\n @if (!useDropdownActions()) {\n @for (action of actions; track $index) {\n <cw-button\n [type]=\"buttonType.ghost\"\n [label]=\"action.label\"\n [withIcon]=\"action.icon\"\n [link]=\"action.link\"\n [isDisabled]=\"action.disabled\"\n [cssClass]=\"actionCssClass(action)\"\n (btnAction)=\"onRowActionClick(action, row)\">\n </cw-button>\n }\n } @else {\n <cw-button\n [label]=\"'_COMMON._TABLE.ACTIONS_MENU'\"\n [withIcon]=\"spriteIcon.menuVertical\"\n [withOnlyIcon]=\"true\"\n [type]=\"buttonType.ghost\"\n [isDropdown]=\"true\"\n [hideCaret]=\"true\">\n <ul class=\"p-0 m-0\">\n @for (action of actions; track $index) {\n <li>\n @if (action.link) {\n <cw-button\n [type]=\"buttonType.ghost\"\n [label]=\"action.label\"\n [withIcon]=\"action.icon\"\n [link]=\"action.link\"\n [isDisabled]=\"action.disabled\"\n [cssClass]=\"'dropdown-item ' + actionCssClass(action)\">\n </cw-button>\n } @else {\n <cw-button\n [type]=\"buttonType.ghost\"\n [label]=\"action.label\"\n [withIcon]=\"action.icon\"\n [isDisabled]=\"action.disabled\"\n [cssClass]=\"'dropdown-item ' + actionCssClass(action)\"\n (btnAction)=\"onRowActionClick(action, row)\">\n </cw-button>\n }\n </li>\n }\n </ul>\n </cw-button>\n }\n }\n } @else {\n <ng-container\n *ngTemplateOutlet=\"actionsTemplate(); context: { $implicit: row }\">\n </ng-container>\n }\n }\n @default {\n {{ column.translate ? (row[column.key] | translate) : row[column.key] }}\n }\n }\n </td>\n }\n }\n </tr>\n }\n }\n </tbody>\n </table>\n</div>\n\n@if (pagination()) {\n <cw-pagination\n [pagination]=\"pagination()!\"\n (paginationChange)=\"paginationChange.emit($event)\">\n </cw-pagination>\n}\n" }]
787
+ EmptyStateComponent,
788
+ ProgressBarComponent
789
+ ], template: "@if (checkbox() && selectedRows().size > 0) {\n <div class=\"table-selection-info mb-2 d-flex align-items-center gap-2 flex-wrap\">\n <span>\n {{ selectedRows().size }} {{ '_COMMON._TABLE._BULK_ACTION.SELECTED_ITEMS_CURRENT_PAGE' | translate }}\n </span>\n @for (action of bulkActions(); track $index) {\n <cw-button\n [type]=\"resolveVariant(action)\"\n [label]=\"action.label\"\n [withIcon]=\"action.icon\"\n [isDisabled]=\"resolveDisabled(action)\"\n (btnAction)=\"onBulkActionClick(action)\">\n </cw-button>\n }\n </div>\n}\n\n<div class=\"table-responsive\">\n <table class=\"table\">\n <caption class=\"visually-hidden\" [innerHTML]=\"'_COMMON._TABLE.CAPTION' | translate: { label: title() } \"></caption>\n <thead>\n <tr>\n @if(checkbox()) {\n <th scope=\"col\" width=\"10\">\n <div class=\"field-check\">\n <input class=\"field-check-input\" type=\"checkbox\" [id]=\"uid + '-all'\" [checked]=\"allSelected()\"\n [indeterminate]=\"someSelected()\" (change)=\"toggleAll()\">\n <label class=\"field-check-label\" [for]=\"uid + '-all'\">\n <span class=\"visually-hidden\">{{ '_COMMON._TABLE._THEAD.CHECK_LINE' | translate }}</span>\n </label>\n </div>\n </th>\n }\n\n @for (column of columns(); track column.key) {\n @if (!column.hidden) {\n <th scope=\"col\" [class.p-0]=\"column.sort\" [attr.aria-sort]=\"column.sort ? getAriaSort(column.key) : null\">\n @if (column.sort) {\n <button class=\"d-flex-h gap-2xs\" [class]=\"getSortClass(column.key)\" (click)=\"setSortProperty(column.key)\">\n {{ column.label | translate}}\n <cw-icon\n [icon]=\"getSortIcon(column.key)\"\n [label]=\"'_COMMON._TABLE._SORT.LABEL' | translate\"\n [type]=\"iconType.default\"\n [iconSize]=\"iconSize['xs']\"></cw-icon>\n </button>\n }\n @else {\n {{ column.label | translate }}\n }\n </th>\n }\n }\n </tr>\n </thead>\n <tbody>\n @if (loading()) {\n <tr>\n <td [attr.colspan]=\"visibleColumnCount()\">\n <cw-loader></cw-loader>\n </td>\n </tr>\n }\n @else if (!data() || data().length === 0) {\n <tr>\n <td class=\"table-info no-result\" [attr.colspan]=\"visibleColumnCount()\">\n @if (currentEmptyState(); as empty) {\n <cw-empty-state\n [illustration]=\"empty.illustration ?? (isFiltered() ? illustrationEnum.noResult : illustrationEnum.noData)\"\n [imageSource]=\"empty.imageSource\"\n [title]=\"empty.title\"\n [description]=\"empty.description\"\n [primaryButton]=\"empty.primaryButton\"\n [secondaryButton]=\"empty.secondaryButton\"\n (primaryClick)=\"empty.primaryButton?.click?.()\"\n (secondaryClick)=\"empty.secondaryButton?.click?.()\">\n </cw-empty-state>\n } @else {\n {{ '_COMMON._TABLE.NO_RESULT' | translate }}\n }\n </td>\n </tr>\n }\n @else {\n @for (row of data(); track row) {\n <tr [class.tr-selected]=\"isSelected(row)\" [class]=\"getRowClass(row)\">\n @if (checkbox()) {\n <td>\n <input class=\"field-check-input\" type=\"checkbox\" [checked]=\"isSelected(row)\" (change)=\"toggleRow(row)\" [id]=\"uid + '-check-' + row.id\"\n [attr.aria-label]=\"('_COMMON._TABLE._THEAD.CHECK_LINE' | translate) + ' ' + row.id\">\n <label class=\"visually-hidden\" [for]=\"uid + '-check-' + row.id\">{{ '_COMMON._TABLE._THEAD.CHECK_LINE' | translate }} {{ row.id }}</label>\n </td>\n }\n @for (column of columns(); track column.key) {\n @if (!column.hidden) {\n <td [class.text-end]=\"column.align === 'right'\" [class.text-center]=\"column.align === 'center'\"\n [class.td-actions]=\"column.type === 'actions'\">\n @switch (column.type) {\n @case ('link') {\n <a href=\"javascript:void(0)\" (click)=\"onCellClick(row, column)\">\n {{ column.translate ? (row[column.key] | translate) : row[column.key] }}\n </a>\n }\n @case ('badge') {\n <cw-badge\n [type]=\"getBadge(column, row[column.key]).type\"\n [label]=\"getBadge(column, row[column.key]).label ?? row[column.key]\"\n [withIcon]=\"getBadge(column, row[column.key]).withIcon\"\n [iconPosition]=\"getBadge(column, row[column.key]).iconPosition\"></cw-badge>\n }\n @case ('icon') {\n @if (isClickable(column)) {\n <a href=\"javascript:void(0)\" (click)=\"onCellClick(row, column)\" [attr.aria-label]=\"row[column.key].label\">\n <cw-icon\n [icon]=\"row[column.key].icon\"\n [label]=\"row[column.key].label\"\n [type]=\"iconType.default\"\n [iconSize]=\"iconSize['md']\"\n [iconCssClass]=\"row[column.key].iconCssClass\"\n ></cw-icon>\n </a>\n } @else {\n <cw-icon\n [icon]=\"row[column.key].icon\"\n [label]=\"row[column.key].label\"\n [type]=\"iconType.default\"\n [iconSize]=\"iconSize['md']\"\n [iconCssClass]=\"row[column.key].iconCssClass\"\n ></cw-icon>\n }\n }\n @case ('image') {\n @if (isClickable(column)) {\n <a href=\"javascript:void(0)\" (click)=\"onCellClick(row, column)\" [attr.aria-label]=\"row[column.key].label\">\n <cw-image\n [source]=\"row[column.key].source\"\n [alt]=\"row[column.key].label\"\n [isAriaHidden]=\"true\"\n [cssClass]=\"row[column.key].iconCssClass\"\n width=\"32\"\n height=\"32\"\n ></cw-image>\n </a>\n } @else {\n <cw-image\n [source]=\"row[column.key].source\"\n [alt]=\"row[column.key].label\"\n [isAriaHidden]=\"true\"\n [cssClass]=\"row[column.key].iconCssClass\"\n width=\"32\"\n height=\"32\"\n ></cw-image>\n }\n }\n @case ('check') {\n @if (isTruthy(row[column.key])) {\n <cw-icon\n [icon]=\"spriteIcon.checkCircle\"\n [label]=\"'_COMMON._PRO_SENTENCE.YES' | translate\"\n [type]=\"iconType.default\"\n iconCssClass=\"text-success\"\n [iconSize]=\"iconSize['md']\"></cw-icon>\n } @else {\n <cw-icon\n [icon]=\"spriteIcon.closeCircle\"\n [label]=\"'_COMMON._PRO_SENTENCE.NO' | translate\"\n [type]=\"iconType.default\"\n iconCssClass=\"text-danger\"\n [iconSize]=\"iconSize['md']\"></cw-icon>\n }\n }\n @case ('progressbar') {\n <div class=\"td-progressbar\">\n <cw-progress-bar\n [value]=\"row[column.key]\"\n [size]=\"progressBarSize.sm\"\n [type]=\"progressBarType.information\"></cw-progress-bar>\n <span class=\"td-progressbar-value\">{{ row[column.key] }}%</span>\n </div>\n }\n @case ('actions') {\n @if (usingRowActions) {\n @let actions = getResolvedActions(row);\n @if (actions.length > 0) {\n @if (!useDropdownActions()) {\n @for (action of actions; track $index) {\n <cw-button\n [type]=\"buttonType.ghost\"\n [label]=\"action.label\"\n [withIcon]=\"action.icon\"\n [link]=\"action.link\"\n [isDisabled]=\"action.disabled\"\n [cssClass]=\"actionCssClass(action)\"\n (btnAction)=\"onRowActionClick(action, row)\">\n </cw-button>\n }\n } @else {\n <cw-button\n [label]=\"'_COMMON._TABLE.ACTIONS_MENU'\"\n [withIcon]=\"spriteIcon.menuVertical\"\n [withOnlyIcon]=\"true\"\n [type]=\"buttonType.ghost\"\n [isDropdown]=\"true\"\n [hideCaret]=\"true\">\n <ul class=\"p-0 m-0\">\n @for (action of actions; track $index) {\n <li>\n @if (action.link) {\n <cw-button\n [type]=\"buttonType.ghost\"\n [label]=\"action.label\"\n [withIcon]=\"action.icon\"\n [link]=\"action.link\"\n [isDisabled]=\"action.disabled\"\n [cssClass]=\"'dropdown-item ' + actionCssClass(action)\">\n </cw-button>\n } @else {\n <cw-button\n [type]=\"buttonType.ghost\"\n [label]=\"action.label\"\n [withIcon]=\"action.icon\"\n [isDisabled]=\"action.disabled\"\n [cssClass]=\"'dropdown-item ' + actionCssClass(action)\"\n (btnAction)=\"onRowActionClick(action, row)\">\n </cw-button>\n }\n </li>\n }\n </ul>\n </cw-button>\n }\n }\n } @else {\n <ng-container\n *ngTemplateOutlet=\"actionsTemplate(); context: { $implicit: row }\">\n </ng-container>\n }\n }\n @default {\n {{ column.translate ? (row[column.key] | translate) : row[column.key] }}\n }\n }\n </td>\n }\n }\n </tr>\n }\n }\n </tbody>\n </table>\n</div>\n\n@if (pagination()) {\n <cw-pagination\n [pagination]=\"pagination()!\"\n (paginationChange)=\"paginationChange.emit($event)\">\n </cw-pagination>\n}\n" }]
762
790
  }], ctorParameters: () => [], propDecorators: { checkbox: [{ type: i0.Input, args: [{ isSignal: true, alias: "checkbox", required: false }] }], title: [{ type: i0.Input, args: [{ isSignal: true, alias: "title", required: false }] }], columns: [{ type: i0.Input, args: [{ isSignal: true, alias: "columns", required: false }] }], data: [{ type: i0.Input, args: [{ isSignal: true, alias: "data", required: false }] }], loading: [{ type: i0.Input, args: [{ isSignal: true, alias: "loading", required: false }] }], rowClassFn: [{ type: i0.Input, args: [{ isSignal: true, alias: "rowClassFn", required: false }] }], pagination: [{ type: i0.Input, args: [{ isSignal: true, alias: "pagination", required: false }] }], bulkActions: [{ type: i0.Input, args: [{ isSignal: true, alias: "bulkActions", required: false }] }], rowActions: [{ type: i0.Input, args: [{ isSignal: true, alias: "rowActions", required: false }] }], emptyStateNoData: [{ type: i0.Input, args: [{ isSignal: true, alias: "emptyStateNoData", required: false }] }], emptyStateNoResult: [{ type: i0.Input, args: [{ isSignal: true, alias: "emptyStateNoResult", required: false }] }], isFiltered: [{ type: i0.Input, args: [{ isSignal: true, alias: "isFiltered", required: false }] }], cellClick: [{ type: i0.Output, args: ["cellClick"] }], sortChange: [{ type: i0.Output, args: ["sortChange"] }], selectionChange: [{ type: i0.Output, args: ["selectionChange"] }], paginationChange: [{ type: i0.Output, args: ["paginationChange"] }], bulkDelete: [{ type: i0.Output, args: ["bulkDelete"] }], bulkAction: [{ type: i0.Output, args: ["bulkAction"] }], actionsTemplate: [{ type: i0.ContentChild, args: ['actionsTemplate', { isSignal: true }] }] } });
763
791
 
764
792
  const RANGE_TYPES = new Set([
@@ -787,6 +815,9 @@ class FilterBarComponent {
787
815
  });
788
816
  }
789
817
  buildForm(configs) {
818
+ // Ferme la souscription du form precedent : sans quoi un changement de `filters()`
819
+ // (donc un rebuild) empilerait les souscriptions -> emissions `filtersApplied` multipliees.
820
+ this.valueChangesSub?.unsubscribe();
790
821
  const group = {};
791
822
  const defaults = {};
792
823
  const urlValues = this.readUrlValues(configs);
@@ -810,7 +841,7 @@ class FilterBarComponent {
810
841
  this.defaults = defaults;
811
842
  this.filterForm = new FormGroup(group);
812
843
  if (!this.manual()) {
813
- this.filterForm.valueChanges
844
+ this.valueChangesSub = this.filterForm.valueChanges
814
845
  .pipe(debounceTime(300), takeUntilDestroyed(this.destroyRef))
815
846
  .subscribe(values => {
816
847
  this.filtersApplied.emit(values);
@@ -896,11 +927,11 @@ class FilterBarComponent {
896
927
  }
897
928
  }
898
929
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: FilterBarComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
899
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.20", type: FilterBarComponent, isStandalone: true, selector: "cw-filter-bar", inputs: { filters: { classPropertyName: "filters", publicName: "filters", isSignal: true, isRequired: true, transformFunction: null }, manual: { classPropertyName: "manual", publicName: "manual", isSignal: true, isRequired: false, transformFunction: null }, syncUrl: { classPropertyName: "syncUrl", publicName: "syncUrl", isSignal: true, isRequired: false, transformFunction: null }, applyLabel: { classPropertyName: "applyLabel", publicName: "applyLabel", isSignal: true, isRequired: false, transformFunction: null }, resetLabel: { classPropertyName: "resetLabel", publicName: "resetLabel", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { filtersApplied: "filtersApplied", filtersReset: "filtersReset" }, ngImport: i0, template: "<form [formGroup]=\"filterForm\" (ngSubmit)=\"apply()\" class=\"filter-bar\">\r\n <div class=\"d-flex-h flex-wrap gap-md\">\r\n @for (field of filters(); track field.key) {\r\n <div class=\"filter-field\" [class]=\"field.colClass ?? ''\">\r\n <cw-form-field\r\n [label]=\"field.label | translate\"\r\n [displayLabel]=\"false\"\r\n [type]=\"field.type\"\r\n [placeholder]=\"(field.placeholder ?? '') | translate\"\r\n [options]=\"resolveOptions(field)\"\r\n [control]=\"getControl(field.key)\"\r\n [clearable]=\"false\">\r\n </cw-form-field>\r\n </div>\r\n }\r\n <div class=\"d-flex-h gap-md\">\r\n @if (manual()) {\r\n <cw-button\r\n [label]=\"applyLabel() | translate\"\r\n [type]=\"uiType.link\"\r\n (btnAction)=\"apply()\">\r\n </cw-button>\r\n }\r\n <cw-button\r\n [label]=\"resetLabel() | translate\"\r\n [type]=\"uiType.link\"\r\n (btnAction)=\"reset()\">\r\n </cw-button>\r\n </div>\r\n </div>\r\n</form>\r\n", dependencies: [{ kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1$2.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1$2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1$2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "component", type: FormFieldComponent, selector: "cw-form-field", inputs: ["control", "formGroup", "type", "label", "displayLabel", "name", "placeholder", "autocomplete", "options", "rangeOptions", "validationOptions", "autocompleteOptions", "errorMessages", "isRequired", "help", "tooltip", "addonLeft", "addonRight", "isInAddon", "isReadonly", "isDisabled", "sliderValue", "sliderOptions", "cssClass", "skeletonMode", "clearable", "appendTo", "initialCountry", "indeterminate"], outputs: ["refreshEvent", "textChanged", "valueChange", "phoneRegionChange"] }, { kind: "component", type: ButtonComponent, selector: "cw-button", inputs: ["type", "label", "id", "link", "isDropdown", "hideCaret", "withIcon", "withOnlyIcon", "iconSize", "iconPosition", "dropdownPosition", "isMinWidth", "isDisabled", "isLoading", "cssClass", "dataTest", "skeletonMode", "withTooltip", "tooltipText", "tooltipTitle", "tooltipTrigger", "tooltipPosition", "tooltipType"], outputs: ["btnAction", "dropDownClicked"] }, { kind: "ngmodule", type: TranslateModule }, { kind: "pipe", type: i1$1.TranslatePipe, name: "translate" }] }); }
930
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.20", type: FilterBarComponent, isStandalone: true, selector: "cw-filter-bar", inputs: { filters: { classPropertyName: "filters", publicName: "filters", isSignal: true, isRequired: true, transformFunction: null }, manual: { classPropertyName: "manual", publicName: "manual", isSignal: true, isRequired: false, transformFunction: null }, syncUrl: { classPropertyName: "syncUrl", publicName: "syncUrl", isSignal: true, isRequired: false, transformFunction: null }, applyLabel: { classPropertyName: "applyLabel", publicName: "applyLabel", isSignal: true, isRequired: false, transformFunction: null }, resetLabel: { classPropertyName: "resetLabel", publicName: "resetLabel", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { filtersApplied: "filtersApplied", filtersReset: "filtersReset" }, ngImport: i0, template: "<form [formGroup]=\"filterForm\" (ngSubmit)=\"apply()\" class=\"filter-bar\">\r\n <div class=\"d-flex-h flex-wrap gap-md\">\r\n @for (field of filters(); track field.key) {\r\n <div class=\"filter-field\" [class]=\"field.colClass ?? ''\">\r\n <cw-form-field\r\n [label]=\"field.label | translate\"\r\n [displayLabel]=\"false\"\r\n [type]=\"field.type\"\r\n [placeholder]=\"(field.placeholder ?? '') | translate\"\r\n [options]=\"resolveOptions(field)\"\r\n [control]=\"getControl(field.key)\"\r\n [clearable]=\"false\">\r\n </cw-form-field>\r\n </div>\r\n }\r\n <div class=\"d-flex-h gap-md\">\r\n @if (manual()) {\r\n <cw-button\r\n [label]=\"applyLabel() | translate\"\r\n [type]=\"uiType.link\"\r\n (btnAction)=\"apply()\">\r\n </cw-button>\r\n }\r\n <cw-button\r\n [label]=\"resetLabel() | translate\"\r\n [type]=\"uiType.link\"\r\n (btnAction)=\"reset()\">\r\n </cw-button>\r\n </div>\r\n </div>\r\n</form>\r\n", dependencies: [{ kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1$2.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1$2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1$2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "component", type: FormFieldComponent, selector: "cw-form-field", inputs: ["control", "formGroup", "type", "label", "displayLabel", "name", "placeholder", "autocomplete", "options", "rangeOptions", "validationOptions", "autocompleteOptions", "richTextOptions", "errorMessages", "isRequired", "help", "tooltip", "addonLeft", "addonRight", "isInAddon", "isReadonly", "isDisabled", "sliderValue", "sliderOptions", "cssClass", "skeletonMode", "clearable", "appendTo", "initialCountry", "indeterminate"], outputs: ["refreshEvent", "textChanged", "valueChange", "phoneRegionChange"] }, { kind: "component", type: ButtonComponent, selector: "cw-button", inputs: ["type", "label", "id", "link", "isDropdown", "hideCaret", "withIcon", "withOnlyIcon", "iconSize", "iconPosition", "dropdownPosition", "isMinWidth", "isDisabled", "isLoading", "cssClass", "dataTest", "skeletonMode", "withTooltip", "tooltipText", "tooltipTitle", "tooltipTrigger", "tooltipPosition", "tooltipType"], outputs: ["btnAction", "dropDownClicked"] }, { kind: "ngmodule", type: TranslateModule }, { kind: "pipe", type: i1.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
900
931
  }
901
932
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: FilterBarComponent, decorators: [{
902
933
  type: Component,
903
- args: [{ selector: 'cw-filter-bar', imports: [
934
+ args: [{ selector: 'cw-filter-bar', changeDetection: ChangeDetectionStrategy.OnPush, imports: [
904
935
  ReactiveFormsModule,
905
936
  FormFieldComponent,
906
937
  ButtonComponent,
@@ -908,14 +939,867 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.20", ngImpo
908
939
  ], template: "<form [formGroup]=\"filterForm\" (ngSubmit)=\"apply()\" class=\"filter-bar\">\r\n <div class=\"d-flex-h flex-wrap gap-md\">\r\n @for (field of filters(); track field.key) {\r\n <div class=\"filter-field\" [class]=\"field.colClass ?? ''\">\r\n <cw-form-field\r\n [label]=\"field.label | translate\"\r\n [displayLabel]=\"false\"\r\n [type]=\"field.type\"\r\n [placeholder]=\"(field.placeholder ?? '') | translate\"\r\n [options]=\"resolveOptions(field)\"\r\n [control]=\"getControl(field.key)\"\r\n [clearable]=\"false\">\r\n </cw-form-field>\r\n </div>\r\n }\r\n <div class=\"d-flex-h gap-md\">\r\n @if (manual()) {\r\n <cw-button\r\n [label]=\"applyLabel() | translate\"\r\n [type]=\"uiType.link\"\r\n (btnAction)=\"apply()\">\r\n </cw-button>\r\n }\r\n <cw-button\r\n [label]=\"resetLabel() | translate\"\r\n [type]=\"uiType.link\"\r\n (btnAction)=\"reset()\">\r\n </cw-button>\r\n </div>\r\n </div>\r\n</form>\r\n" }]
909
940
  }], ctorParameters: () => [], propDecorators: { filters: [{ type: i0.Input, args: [{ isSignal: true, alias: "filters", required: true }] }], manual: [{ type: i0.Input, args: [{ isSignal: true, alias: "manual", required: false }] }], syncUrl: [{ type: i0.Input, args: [{ isSignal: true, alias: "syncUrl", required: false }] }], applyLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "applyLabel", required: false }] }], resetLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "resetLabel", required: false }] }], filtersApplied: [{ type: i0.Output, args: ["filtersApplied"] }], filtersReset: [{ type: i0.Output, args: ["filtersReset"] }] } });
910
941
 
942
+ // Type nominal des cles de traduction, partage par tous les composants de la lib.
943
+ //
944
+ // Extrait de `import-wizard.model.ts` le jour ou un deuxieme composant en a eu besoin
945
+ // (`cw-export-button`) : une definition recopiee aurait produit deux types nominaux
946
+ // DISTINCTS, donc mutuellement incompatibles, pour la meme notion.
947
+ /** Declare une chaine comme cle de traduction. */
948
+ const i18nKey = (key) => key;
949
+
950
+ // Remise d'un fichier au navigateur, et petits assembleurs de nom de fichier.
951
+ //
952
+ // `downloadBlob` est utilise par `cw-export-button`. Les trois autres sont des aides
953
+ // OPTIONNELLES pour l'hote : c'est lui qui serialise et nomme (cf. `export.model.ts`),
954
+ // la lib ne les appelle jamais a sa place.
955
+ /**
956
+ * Declenche le telechargement d'un `ExportPayload`.
957
+ *
958
+ * L'URL objet est revoquee dans un `setTimeout(0)` et non juste apres le clic : Firefox
959
+ * annule le telechargement si l'URL est liberee avant qu'il n'ait commence a lire le
960
+ * blob. Un tour de boucle d'evenements suffit, et evite la fuite memoire que serait
961
+ * l'absence de revocation.
962
+ */
963
+ function downloadBlob({ blob, filename }) {
964
+ const url = URL.createObjectURL(blob);
965
+ const link = document.createElement('a');
966
+ link.href = url;
967
+ link.download = filename;
968
+ document.body.appendChild(link);
969
+ link.click();
970
+ link.remove();
971
+ setTimeout(() => URL.revokeObjectURL(url));
972
+ }
973
+ /** Serialise une donnee en blob JSON indente. Aide a l'hote, jamais appelee par la lib. */
974
+ function jsonBlob(data) {
975
+ return new Blob([JSON.stringify(data, null, 2)], { type: 'application/json' });
976
+ }
977
+ /**
978
+ * Date du jour au format `YYYY-MM-DD`, en heure LOCALE.
979
+ *
980
+ * Volontairement pas `toISOString()`, qui convertit en UTC : un export lance a 23 h en
981
+ * France serait date du lendemain.
982
+ */
983
+ function todayIsoDate(date = new Date()) {
984
+ const pad = (value) => String(value).padStart(2, '0');
985
+ return `${date.getFullYear()}-${pad(date.getMonth() + 1)}-${pad(date.getDate())}`;
986
+ }
987
+ /**
988
+ * Assemble un nom de fichier a partir de fragments, en ignorant ceux qui sont absents.
989
+ * Les fragments vides disparaissent sans laisser de tiret orphelin.
990
+ *
991
+ * @example buildFilename(['utilisateurs', customerCode, todayIsoDate()], 'json')
992
+ * // 'utilisateurs-CW01-2026-08-06.json' (ou sans le code s'il est absent)
993
+ */
994
+ function buildFilename(parts, extension) {
995
+ const stem = parts.filter((part) => !!part && part.length > 0).join('-');
996
+ return `${stem}.${extension}`;
997
+ }
998
+
999
+ /**
1000
+ * Bouton « Exporter » : une seule option => bouton simple, deux ou plus => menu deroulant.
1001
+ *
1002
+ * Le composant ne porte AUCUN metier : il ne connait ni le format exporte, ni la facon de
1003
+ * nommer le fichier, ni ce qui est exporte. L'hote serialise et nomme (cf. `ExportPayload`) ;
1004
+ * la lib declenche, restitue l'etat, et remet le fichier au navigateur.
1005
+ *
1006
+ * **L'export n'a deliberement ni interruption ni annulation**, contrairement a l'import :
1007
+ * il n'ecrit rien, un export abandonne n'a aucune consequence sur l'integrite des donnees.
1008
+ * Le traitement de l'interruption de `cw-import-wizard` ne s'applique pas ici, et ce n'est
1009
+ * pas un oubli.
1010
+ */
1011
+ class ExportButtonComponent {
1012
+ constructor() {
1013
+ this.toast = inject(ToastService);
1014
+ this.destroyRef = inject(DestroyRef);
1015
+ /** Options proposees, dans l'ordre d'affichage. Tuple non vide (cf. `ExportOptions`). */
1016
+ this.options = input.required(...(ngDevMode ? [{ debugName: "options" }] : []));
1017
+ /** Cle i18n du libelle du bouton (ou du menu). */
1018
+ this.label = input(i18nKey('_COMMON._ACTION.EXPORT'), ...(ngDevMode ? [{ debugName: "label" }] : []));
1019
+ /** Cle i18n du message du toast d'echec. */
1020
+ this.errorKey = input(i18nKey('_COMMON._EXPORT.ERROR'), ...(ngDevMode ? [{ debugName: "errorKey" }] : []));
1021
+ /**
1022
+ * Cle i18n d'un toast de succes. `null` (defaut) => aucun toast : le fichier qui se
1023
+ * telecharge EST le retour. A ne renseigner que si l'hote veut un accuse explicite.
1024
+ */
1025
+ this.successKey = input(null, ...(ngDevMode ? [{ debugName: "successKey" }] : []));
1026
+ /** Deux options ou plus => menu deroulant. */
1027
+ this.isMenu = computed(() => this.options().length > 1, ...(ngDevMode ? [{ debugName: "isMenu" }] : []));
1028
+ /** Le menu entier se desactive quand plus aucune option n'est disponible. */
1029
+ this.allDisabled = computed(() => this.options().every(option => !!option.disabled), ...(ngDevMode ? [{ debugName: "allDisabled" }] : []));
1030
+ /**
1031
+ * Un export est en vol. Sert de garde-fou au double declenchement : `cw-button
1032
+ * [isLoading]` ne pose PAS `[disabled]`, le bouton reste donc cliquable pendant tout
1033
+ * l'export. Le garde-fou est ici, pas dans le rendu.
1034
+ */
1035
+ this.running = signal(false, ...(ngDevMode ? [{ debugName: "running" }] : []));
1036
+ /**
1037
+ * Contenu de la region live. Vide entre deux annonces — voir `announce()`.
1038
+ *
1039
+ * C'est le composant qui porte la restitution, et non `cw-button [isLoading]` : ce
1040
+ * dernier injecte sa propre region `role="status"` (cf. `basic-ui/button`), ce qui
1041
+ * ferait deux regions concurrentes pour un seul evenement.
1042
+ */
1043
+ this.liveMessage = signal(null, ...(ngDevMode ? [{ debugName: "liveMessage" }] : []));
1044
+ this.buttonType = BoButtonTypeEnum;
1045
+ this.subscription = null;
1046
+ this.announceTimer = null;
1047
+ this.destroyRef.onDestroy(() => {
1048
+ // `unsubscribe()` et non `takeUntilDestroyed` : `takeUntil` EMET un `complete`, que
1049
+ // le handler ci-dessous interprete comme « termine sans fichier » — donc un toast
1050
+ // d'echec parasite a la destruction du composant.
1051
+ this.subscription?.unsubscribe();
1052
+ if (this.announceTimer !== null)
1053
+ clearTimeout(this.announceTimer);
1054
+ });
1055
+ }
1056
+ /**
1057
+ * Lance un export. Ignore le clic si un export est deja en vol ou si l'option est
1058
+ * desactivee : ni l'un ni l'autre n'est garanti par le rendu.
1059
+ */
1060
+ run(option) {
1061
+ if (this.running() || option.disabled)
1062
+ return;
1063
+ this.running.set(true);
1064
+ this.announce('_COMMON._EXPORT._A11Y.RUNNING');
1065
+ let payload = null;
1066
+ this.subscription = option.fn()
1067
+ .pipe(take(1))
1068
+ .subscribe({
1069
+ next: value => (payload = value),
1070
+ error: () => this.settleFailure(),
1071
+ // Une source qui complete sans rien emettre vaut echec : sans ce test, l'export
1072
+ // se terminerait en silence, sans fichier et sans message.
1073
+ complete: () => (payload ? this.settleSuccess(payload) : this.settleFailure()),
1074
+ });
1075
+ }
1076
+ settleSuccess(payload) {
1077
+ this.running.set(false);
1078
+ downloadBlob(payload);
1079
+ this.announce('_COMMON._EXPORT._A11Y.DONE', { filename: payload.filename });
1080
+ const successKey = this.successKey();
1081
+ if (successKey) {
1082
+ this.toast.show({
1083
+ type: AlertTypeEnum.success,
1084
+ title: '_COMMON._ACTION_SUCCESS.LABEL',
1085
+ message: successKey,
1086
+ autohide: true,
1087
+ });
1088
+ }
1089
+ }
1090
+ settleFailure() {
1091
+ this.running.set(false);
1092
+ this.announce('_COMMON._EXPORT._A11Y.FAILED');
1093
+ // `autohide: false` : un echec doit rester a l'ecran jusqu'a lecture.
1094
+ this.toast.show({
1095
+ type: AlertTypeEnum.danger,
1096
+ title: '_COMMON._ACTION_ERROR.LABEL',
1097
+ message: this.errorKey(),
1098
+ autohide: false,
1099
+ });
1100
+ }
1101
+ /**
1102
+ * Ecrit dans la region live en garantissant la RE-annonce.
1103
+ *
1104
+ * Une region `role="status"` n'est reannoncee que si son contenu CHANGE : deux exports
1105
+ * synchrones successifs (`of(payload)`) y ecriraient deux fois « Export termine », et le
1106
+ * second serait muet. Pire, avec une source synchrone, « en cours » et l'etat final
1107
+ * tombent dans le meme cycle de detection : le DOM ne voit jamais le texte intermediaire
1108
+ * qui aurait servi de separateur.
1109
+ *
1110
+ * On vide donc la region, on laisse ce vide etre rendu, et on ecrit au tour de boucle
1111
+ * suivant : deux mutations distinctes, donc une annonce a tous les coups.
1112
+ */
1113
+ announce(key, params) {
1114
+ if (this.announceTimer !== null)
1115
+ clearTimeout(this.announceTimer);
1116
+ this.liveMessage.set(null);
1117
+ this.announceTimer = setTimeout(() => {
1118
+ this.announceTimer = null;
1119
+ this.liveMessage.set({ key, params });
1120
+ });
1121
+ }
1122
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: ExportButtonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
1123
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.20", type: ExportButtonComponent, isStandalone: true, selector: "cw-export-button", inputs: { options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: true, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, errorKey: { classPropertyName: "errorKey", publicName: "errorKey", isSignal: true, isRequired: false, transformFunction: null }, successKey: { classPropertyName: "successKey", publicName: "successKey", isSignal: true, isRequired: false, transformFunction: null } }, host: { classAttribute: "cw-export-button" }, ngImport: i0, template: "@if (isMenu()) {\n <cw-button [type]=\"buttonType.secondary\" [label]=\"label()\" [isDropdown]=\"true\" [isDisabled]=\"allDisabled()\">\n <!-- Motif documente de basic-ui : `<button cwDropdownItem>` en direct, et non un\n `cw-button` imbrique. La directive pose la classe `dropdown-item` sur la CIBLE du\n clic, seule condition pour que `cw-button` referme son menu apres la selection. -->\n <ul>\n @for (option of options(); track $index) {\n <li>\n <button type=\"button\" class=\"btn btn-ghost\" cwDropdownItem [disabled]=\"option.disabled\" (click)=\"run(option)\">\n {{ option.label | translate }}\n </button>\n </li>\n }\n </ul>\n </cw-button>\n} @else {\n <cw-button [type]=\"buttonType.secondary\" [label]=\"label()\" [isDisabled]=\"!!options()[0].disabled\"\n (btnAction)=\"run(options()[0])\">\n </cw-button>\n}\n\n<!-- Region live PERMANENTE : seul son contenu change. La creer et la detruire avec le\n message ferait manquer l'annonce aux technologies d'assistance, qui doivent avoir\n observe la region AVANT sa mise a jour. -->\n<span class=\"visually-hidden\" role=\"status\">\n @if (liveMessage(); as message) {\n {{ message.key | translate: message.params }}\n }\n</span>\n", dependencies: [{ kind: "component", type: ButtonComponent, selector: "cw-button", inputs: ["type", "label", "id", "link", "isDropdown", "hideCaret", "withIcon", "withOnlyIcon", "iconSize", "iconPosition", "dropdownPosition", "isMinWidth", "isDisabled", "isLoading", "cssClass", "dataTest", "skeletonMode", "withTooltip", "tooltipText", "tooltipTitle", "tooltipTrigger", "tooltipPosition", "tooltipType"], outputs: ["btnAction", "dropDownClicked"] }, { kind: "directive", type: DropdownItemDirective, selector: "[cwDropdownItem]" }, { kind: "ngmodule", type: TranslateModule }, { kind: "pipe", type: i1.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
1124
+ }
1125
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: ExportButtonComponent, decorators: [{
1126
+ type: Component,
1127
+ args: [{ selector: 'cw-export-button', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, host: { class: 'cw-export-button' }, imports: [ButtonComponent, DropdownItemDirective, TranslateModule], template: "@if (isMenu()) {\n <cw-button [type]=\"buttonType.secondary\" [label]=\"label()\" [isDropdown]=\"true\" [isDisabled]=\"allDisabled()\">\n <!-- Motif documente de basic-ui : `<button cwDropdownItem>` en direct, et non un\n `cw-button` imbrique. La directive pose la classe `dropdown-item` sur la CIBLE du\n clic, seule condition pour que `cw-button` referme son menu apres la selection. -->\n <ul>\n @for (option of options(); track $index) {\n <li>\n <button type=\"button\" class=\"btn btn-ghost\" cwDropdownItem [disabled]=\"option.disabled\" (click)=\"run(option)\">\n {{ option.label | translate }}\n </button>\n </li>\n }\n </ul>\n </cw-button>\n} @else {\n <cw-button [type]=\"buttonType.secondary\" [label]=\"label()\" [isDisabled]=\"!!options()[0].disabled\"\n (btnAction)=\"run(options()[0])\">\n </cw-button>\n}\n\n<!-- Region live PERMANENTE : seul son contenu change. La creer et la detruire avec le\n message ferait manquer l'annonce aux technologies d'assistance, qui doivent avoir\n observe la region AVANT sa mise a jour. -->\n<span class=\"visually-hidden\" role=\"status\">\n @if (liveMessage(); as message) {\n {{ message.key | translate: message.params }}\n }\n</span>\n" }]
1128
+ }], ctorParameters: () => [], propDecorators: { options: [{ type: i0.Input, args: [{ isSignal: true, alias: "options", required: true }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], errorKey: [{ type: i0.Input, args: [{ isSignal: true, alias: "errorKey", required: false }] }], successKey: [{ type: i0.Input, args: [{ isSignal: true, alias: "successKey", required: false }] }] } });
1129
+
1130
+ // Modele du composant `cw-import-wizard` — assistant d'import de donnees.
1131
+ //
1132
+ // Frontiere lib / metier : le composant possede le parcours (3 etapes, transitions, rendu,
1133
+ // accessibilite, libelles) et RIEN du metier. Il ne connait ni l'objet importe, ni le format
1134
+ // reel du fichier, ni les URLs, ni les regles de validation : les deux allers-retours serveur
1135
+ // (analyse a blanc, puis import) sont delegues a l'hote via `ImportWizardSource`.
1136
+ // `I18nKey` / `i18nKey` vivent desormais dans `i18n-key.model.ts` : ils servent a plusieurs
1137
+ // composants. Reexportes ici pour que les imports existants continuent de fonctionner.
1138
+ /**
1139
+ * Type d'import. Un seul element dans `ImportWizardConfig.modes` => choix impose
1140
+ * (l'utilisateur est informe, sans pouvoir changer) ; plusieurs => choix libre.
1141
+ */
1142
+ var ImportModeEnum;
1143
+ (function (ImportModeEnum) {
1144
+ /** Cree uniquement les lignes qui ne sont pas en doublon. */
1145
+ ImportModeEnum["addOnly"] = "addOnly";
1146
+ /** Met a jour si l'objet existe (champ cle), sinon cree. */
1147
+ ImportModeEnum["upsert"] = "upsert";
1148
+ /** Remplace l'integralite des donnees existantes. */
1149
+ ImportModeEnum["replaceAll"] = "replaceAll";
1150
+ })(ImportModeEnum || (ImportModeEnum = {}));
1151
+ /**
1152
+ * Nature de la donnee importee. Determine le niveau de detail affiche :
1153
+ * `list` => compteurs par operation, `singleConfig` => simple message de conformite/succes.
1154
+ */
1155
+ var ImportScopeEnum;
1156
+ (function (ImportScopeEnum) {
1157
+ ImportScopeEnum["list"] = "list";
1158
+ ImportScopeEnum["singleConfig"] = "singleConfig";
1159
+ })(ImportScopeEnum || (ImportScopeEnum = {}));
1160
+ /** Etapes du parcours. L'ORDRE fait foi via `IMPORT_WIZARD_STEPS`, pas via cette declaration. */
1161
+ var ImportWizardStepEnum;
1162
+ (function (ImportWizardStepEnum) {
1163
+ ImportWizardStepEnum["select"] = "select";
1164
+ ImportWizardStepEnum["analysis"] = "analysis";
1165
+ ImportWizardStepEnum["execution"] = "execution";
1166
+ })(ImportWizardStepEnum || (ImportWizardStepEnum = {}));
1167
+ /**
1168
+ * Rang de chaque etape : SOURCE DE VERITE UNIQUE de l'ordre du parcours. Le pliage des
1169
+ * panneaux et le calcul d'etat en derivent tous les deux, ils ne peuvent donc plus diverger.
1170
+ * Le type `Record` impose l'exhaustivite : ajouter une etape a l'enum sans lui donner de
1171
+ * rang ne compile pas.
1172
+ */
1173
+ const STEP_RANK = {
1174
+ [ImportWizardStepEnum.select]: 0,
1175
+ [ImportWizardStepEnum.analysis]: 1,
1176
+ [ImportWizardStepEnum.execution]: 2,
1177
+ };
1178
+ /** Etapes dans l'ordre du parcours, derivees des rangs. */
1179
+ const IMPORT_WIZARD_STEPS = Object.keys(STEP_RANK).sort((a, b) => STEP_RANK[a] - STEP_RANK[b]);
1180
+ /** Rang d'une etape dans le parcours. Sert a comparer deux etapes entre elles. */
1181
+ const importWizardStepRank = (step) => STEP_RANK[step];
1182
+ /** Etat d'une etape, qui pilote le rendu du panneau (pastille + pliage). */
1183
+ var ImportWizardStepStateEnum;
1184
+ (function (ImportWizardStepStateEnum) {
1185
+ /** Pas encore atteinte : panneau grise et replie. */
1186
+ ImportWizardStepStateEnum["todo"] = "todo";
1187
+ /** En cours : panneau ouvert. */
1188
+ ImportWizardStepStateEnum["current"] = "current";
1189
+ /** Terminee avec succes : pastille verte, panneau replie et verrouille. */
1190
+ ImportWizardStepStateEnum["done"] = "done";
1191
+ /** En echec : pastille rouge, panneau ouvert sur le message d'erreur. */
1192
+ ImportWizardStepStateEnum["error"] = "error";
1193
+ })(ImportWizardStepStateEnum || (ImportWizardStepStateEnum = {}));
1194
+ /** Discriminant commun aux evenements d'execution et aux etats terminaux. */
1195
+ var ImportEventKindEnum;
1196
+ (function (ImportEventKindEnum) {
1197
+ ImportEventKindEnum["progress"] = "progress";
1198
+ ImportEventKindEnum["report"] = "report";
1199
+ ImportEventKindEnum["interruption"] = "interruption";
1200
+ })(ImportEventKindEnum || (ImportEventKindEnum = {}));
1201
+ /** Ce que l'on sait de l'etat des donnees apres une interruption. */
1202
+ var ImportInterruptionStateEnum;
1203
+ (function (ImportInterruptionStateEnum) {
1204
+ /** Atomicite declaree : rien n'a ete ecrit. */
1205
+ ImportInterruptionStateEnum["unchanged"] = "unchanged";
1206
+ /** Le serveur a confirme l'annulation : rien n'a ete ecrit. */
1207
+ ImportInterruptionStateEnum["cancelled"] = "cancelled";
1208
+ /** Personne ne peut le dire : des donnees ont pu etre ecrites. */
1209
+ ImportInterruptionStateEnum["unknown"] = "unknown";
1210
+ })(ImportInterruptionStateEnum || (ImportInterruptionStateEnum = {}));
1211
+ /**
1212
+ * Ce qui se passe REELLEMENT quand l'utilisateur arrete l'import. Declare par objet, sans
1213
+ * defaut : le composant ne peut donc pas affirmer une garantie que personne n'a donnee.
1214
+ */
1215
+ var ImportInterruptionEnum;
1216
+ (function (ImportInterruptionEnum) {
1217
+ /** Back-end transactionnel : l'abandon du flux suffit, rien n'est ecrit. */
1218
+ ImportInterruptionEnum["atomic"] = "atomic";
1219
+ /** Le serveur sait annuler : la source fournit de quoi le lui demander. */
1220
+ ImportInterruptionEnum["serverCancel"] = "serverCancel";
1221
+ /** L'import ne peut pas etre arrete : aucun bouton d'arret n'est rendu. */
1222
+ ImportInterruptionEnum["notInterruptible"] = "notInterruptible";
1223
+ })(ImportInterruptionEnum || (ImportInterruptionEnum = {}));
1224
+
1225
+ // Restitution des decomptes : categorie de pluriel et formatage du nombre.
1226
+ //
1227
+ // Mutualise ici et non dans un composant : tout composant qui affiche un decompte a le
1228
+ // meme besoin, et une regle de pluriel recopiee est une regle qui divergera.
1229
+ //
1230
+ // Pas dans basic-ui : ce paquet est derriere une frontiere de publication, et rien ne
1231
+ // presse. A remonter le jour ou basic-ui affichera lui aussi des decomptes.
1232
+ /** Instances `Intl` mises en cache : une par langue, pas une par decompte affiche. */
1233
+ const PLURAL_RULES = new Map();
1234
+ const NUMBER_FORMATS = new Map();
1235
+ function pluralRules(lang) {
1236
+ let rules = PLURAL_RULES.get(lang);
1237
+ if (!rules) {
1238
+ rules = new Intl.PluralRules(lang);
1239
+ PLURAL_RULES.set(lang, rules);
1240
+ }
1241
+ return rules;
1242
+ }
1243
+ function numberFormat(lang) {
1244
+ let format = NUMBER_FORMATS.get(lang);
1245
+ if (!format) {
1246
+ format = new Intl.NumberFormat(lang);
1247
+ NUMBER_FORMATS.set(lang, format);
1248
+ }
1249
+ return format;
1250
+ }
1251
+ /**
1252
+ * Cle i18n d'un decompte : `base` suffixee de la categorie de pluriel CLDR de `lang`.
1253
+ *
1254
+ * C'est `Intl.PluralRules` qui porte la regle de la langue, et elle differe :
1255
+ * `fr` classe 0 ET 1 en `one` (« 0 objet »), `en` classe 0 en `other` (« 0 objects »).
1256
+ * Une condition ecrite a la main du type `count === 1` produirait donc du faux francais
1257
+ * ou du faux anglais selon la langue.
1258
+ *
1259
+ * Le bundle doit declarer TOUTES les categories que la langue peut produire, sinon la
1260
+ * cle resolue est absente et ngx-translate l'affiche telle quelle. En francais, `many`
1261
+ * apparait sur les grands nombres ; en anglais, `one` et `other` suffisent.
1262
+ *
1263
+ * @example pluralizedCountKey('DOMAIN.ITEMS_CREATED', 0, 'fr') // 'DOMAIN.ITEMS_CREATED.one'
1264
+ * pluralizedCountKey('DOMAIN.ITEMS_CREATED', 0, 'en') // 'DOMAIN.ITEMS_CREATED.other'
1265
+ */
1266
+ function pluralizedCountKey(base, count, lang) {
1267
+ return `${base}.${pluralRules(lang).select(count)}`;
1268
+ }
1269
+ /**
1270
+ * Nombre formate selon `lang` : « 12 000 » en francais, « 12,000 » en anglais.
1271
+ * La langue vient toujours du service de traduction, JAMAIS d'un litteral — une locale
1272
+ * figee dans le code affiche des separateurs francais a un utilisateur anglophone.
1273
+ */
1274
+ function formatCount(count, lang) {
1275
+ return numberFormat(lang).format(count);
1276
+ }
1277
+
1278
+ /**
1279
+ * Assistant d'import de donnees : parcours en 3 etapes (selection du fichier et du type
1280
+ * d'import, analyse, import) rendu en accordeon, destine a etre projete dans une modale
1281
+ * `sidepanel` de `ModalsService`.
1282
+ *
1283
+ * Le composant ne porte AUCUN metier : les deux allers-retours serveur sont delegues a
1284
+ * `config.source` (cf. `ImportWizardSource`). Il ne fait aucun appel reseau lui-meme et ne
1285
+ * connait ni l'objet importe, ni le format du fichier.
1286
+ */
1287
+ class ImportWizardComponent {
1288
+ constructor() {
1289
+ this.destroyRef = inject(DestroyRef);
1290
+ this.config = input.required(...(ngDevMode ? [{ debugName: "config" }] : []));
1291
+ /**
1292
+ * SEULE sortie terminale : succes, echec, ou interruption (avec ce que l'on sait de l'etat
1293
+ * des donnees). L'hote rafraichit systematiquement dessus — y compris quand l'atomicite est
1294
+ * declaree, celle-ci n'etant qu'une affirmation de l'hote, jamais un fait verifie.
1295
+ *
1296
+ * Signal de DONNEES, pas de navigation : le composant ne ferme jamais la modale, pour que
1297
+ * l'utilisateur puisse lire son rapport.
1298
+ */
1299
+ this.completed = output();
1300
+ this.file = new FormControl(null);
1301
+ /**
1302
+ * Mode choisi par l'utilisateur. N'existe que pour le groupe radio du choix libre :
1303
+ * en mode impose, rien ne l'affiche et il n'est PAS alimente — le mode retenu se lit
1304
+ * alors directement dans le tuple (cf. `selectedMode`). Pas d'initialisation par effet,
1305
+ * donc pas de synchronisation a maintenir.
1306
+ */
1307
+ this.mode = new FormControl(null);
1308
+ this.translate = inject(TranslateService);
1309
+ /**
1310
+ * Langue active, en signal : la categorie de pluriel et le format des nombres doivent
1311
+ * suivre un changement de langue a chaud.
1312
+ */
1313
+ this.lang = toSignal(this.translate.onLangChange.pipe(map((event) => event.lang)), { initialValue: this.translate.currentLang || this.translate.getDefaultLang() });
1314
+ /** Pont signal du control : un `computed` lisant `mode.value` resterait fige. */
1315
+ this.modeValue = toSignal(this.mode.valueChanges, { initialValue: null });
1316
+ /** Idem pour le fichier : meme piege de `computed` fige. */
1317
+ this.fileValue = toSignal(this.file.valueChanges, { initialValue: null });
1318
+ this.currentStep = signal(ImportWizardStepEnum.select, ...(ngDevMode ? [{ debugName: "currentStep" }] : []));
1319
+ this.execution = signal(null, ...(ngDevMode ? [{ debugName: "execution" }] : []));
1320
+ this.cancellation = signal(null, ...(ngDevMode ? [{ debugName: "cancellation" }] : []));
1321
+ /**
1322
+ * Panneaux d'etape, dans l'ordre du template : selection, analyse, import.
1323
+ *
1324
+ * Cible les seules cards marquees `#stepPanel`, et NON `viewChildren(CardComponent)` : une
1325
+ * requete de vue traverse tout le template, donc une `cw-card` imbriquee dans le contenu
1326
+ * d'une etape (la card « modele a telecharger ») serait comptee comme un panneau. Elle
1327
+ * decalait l'index des etapes suivantes et recevait un `collapse()`, qui retirait son corps
1328
+ * du DOM (`destroyOnHide`) : le bloc disparaissait 120 ms apres son affichage.
1329
+ */
1330
+ this.panels = viewChildren('stepPanel', ...(ngDevMode ? [{ debugName: "panels", read: CardComponent }] : [{ read: CardComponent }]));
1331
+ // --- Cibles de focus -----------------------------------------------------
1332
+ // Chaque changement d'etat est restitue par un DEPLACEMENT DE FOCUS vers le contenu qui
1333
+ // vient d'arriver : mecanisme unique, donc aucun risque de double annonce, et le focus
1334
+ // ne retombe jamais sur <body> alors que le panneau qui le portait se replie.
1335
+ this.selectionTarget = viewChild('selectionTarget', ...(ngDevMode ? [{ debugName: "selectionTarget" }] : []));
1336
+ this.analysisStatus = viewChild('analysisStatus', ...(ngDevMode ? [{ debugName: "analysisStatus" }] : []));
1337
+ this.analysisOutcome = viewChild('analysisOutcome', ...(ngDevMode ? [{ debugName: "analysisOutcome" }] : []));
1338
+ this.executionStatus = viewChild('executionStatus', ...(ngDevMode ? [{ debugName: "executionStatus" }] : []));
1339
+ this.cancellingStatus = viewChild('cancellingStatus', ...(ngDevMode ? [{ debugName: "cancellingStatus" }] : []));
1340
+ this.reportOutcome = viewChild('reportOutcome', ...(ngDevMode ? [{ debugName: "reportOutcome" }] : []));
1341
+ this.interruptedOutcome = viewChild('interruptedOutcome', ...(ngDevMode ? [{ debugName: "interruptedOutcome" }] : []));
1342
+ this.cardType = CardTypeEnum;
1343
+ this.analyzing = signal(false, ...(ngDevMode ? [{ debugName: "analyzing" }] : []));
1344
+ this.analysis = signal(null, ...(ngDevMode ? [{ debugName: "analysis" }] : []));
1345
+ this.progress = signal(null, ...(ngDevMode ? [{ debugName: "progress" }] : []));
1346
+ this.report = signal(null, ...(ngDevMode ? [{ debugName: "report" }] : []));
1347
+ /** Annulation demandee au serveur, reponse en attente. */
1348
+ this.cancelling = signal(false, ...(ngDevMode ? [{ debugName: "cancelling" }] : []));
1349
+ /** Etat terminal apres interruption. `null` tant qu'aucune interruption n'a abouti. */
1350
+ this.interruptionState = signal(null, ...(ngDevMode ? [{ debugName: "interruptionState" }] : []));
1351
+ /**
1352
+ * Retour a l'etape 1 apres une analyse non conforme. Sert uniquement a monter une cible
1353
+ * de focus : le bouton « Modifier le fichier » qui declenche ce retour se replie avec son
1354
+ * panneau, le focus n'a donc plus de support.
1355
+ */
1356
+ this.selectionReopened = signal(false, ...(ngDevMode ? [{ debugName: "selectionReopened" }] : []));
1357
+ // Enums exposes au template.
1358
+ this.step = ImportWizardStepEnum;
1359
+ this.stepState = ImportWizardStepStateEnum;
1360
+ this.importMode = ImportModeEnum;
1361
+ this.alertType = AlertTypeEnum;
1362
+ this.buttonType = BoButtonTypeEnum;
1363
+ this.fieldType = FormFieldTypeEnum;
1364
+ this.iconType = IconTypeEnum;
1365
+ this.iconSize = IconSizeEnum;
1366
+ this.iconUiType = IconUiTypeEnum;
1367
+ this.spriteIcon = SpriteIconEnum;
1368
+ this.loaderSize = LoaderSizeEnum;
1369
+ this.progressType = ProgressBarTypeEnum;
1370
+ this.scope = computed(() => this.config().scope ?? ImportScopeEnum.list, ...(ngDevMode ? [{ debugName: "scope" }] : []));
1371
+ this.isList = computed(() => this.scope() === ImportScopeEnum.list, ...(ngDevMode ? [{ debugName: "isList" }] : []));
1372
+ this.interruption = computed(() => this.config().interruption, ...(ngDevMode ? [{ debugName: "interruption" }] : []));
1373
+ /** Le bouton d'arret n'existe que si l'interruption est reellement possible. */
1374
+ this.canInterrupt = computed(() => this.interruption().kind !== ImportInterruptionEnum.notInterruptible, ...(ngDevMode ? [{ debugName: "canInterrupt" }] : []));
1375
+ /** Message d'interruption : il decoule de l'etat constate, jamais d'un libelle en dur. */
1376
+ this.interruptionMessageKey = computed(() => {
1377
+ const state = this.interruptionState();
1378
+ return state ? ImportWizardComponent.INTERRUPTION_MESSAGE[state] : undefined;
1379
+ }, ...(ngDevMode ? [{ debugName: "interruptionMessageKey" }] : []));
1380
+ /** Seul l'etat indetermine merite une alerte rouge : l'utilisateur doit aller verifier. */
1381
+ this.interruptionAlertType = computed(() => this.interruptionState() === ImportInterruptionStateEnum.unknown ? AlertTypeEnum.danger : AlertTypeEnum.warning, ...(ngDevMode ? [{ debugName: "interruptionAlertType" }] : []));
1382
+ /**
1383
+ * Echec d'import : le message ne peut promettre l'absence d'ecriture que si l'atomicite
1384
+ * est declaree. Sinon le composant ne sait rien de l'etat des donnees, et le dit.
1385
+ */
1386
+ this.failureMessageKey = computed(() => this.interruption().kind === ImportInterruptionEnum.atomic
1387
+ ? '_COMMON._IMPORT.FAILED_ATOMIC'
1388
+ : '_COMMON._IMPORT.FAILED', ...(ngDevMode ? [{ debugName: "failureMessageKey" }] : []));
1389
+ /** Modes proposes (tuple non vide garanti par le type). Un seul => impose. */
1390
+ this.modes = computed(() => this.config().modes, ...(ngDevMode ? [{ debugName: "modes" }] : []));
1391
+ this.isModeImposed = computed(() => this.modes().length === 1, ...(ngDevMode ? [{ debugName: "isModeImposed" }] : []));
1392
+ this.modeOptions = computed(() => this.modes().map(({ mode }) => ({ value: mode, label: ImportWizardComponent.MODE_LABEL[mode] })), ...(ngDevMode ? [{ debugName: "modeOptions" }] : []));
1393
+ /** Libelle du mode quand il est impose (affiche en lecture seule, sans groupe radio). */
1394
+ this.imposedModeLabel = computed(() => ImportWizardComponent.MODE_LABEL[this.modes()[0].mode], ...(ngDevMode ? [{ debugName: "imposedModeLabel" }] : []));
1395
+ /**
1396
+ * Mode retenu : le seul propose s'il est impose, sinon la selection de l'utilisateur.
1397
+ * `null` en choix libre tant qu'il n'a pas choisi — il n'y a AUCUNE preselection, sous
1398
+ * peine de rendre l'exigence de selection inoperante.
1399
+ */
1400
+ this.selectedMode = computed(() => this.isModeImposed() ? this.modes()[0].mode : this.modeValue(), ...(ngDevMode ? [{ debugName: "selectedMode" }] : []));
1401
+ /**
1402
+ * Ce qui manque pour activer « Continuer ». Un bouton desactive n'etant pas focusable, ce
1403
+ * texte est rendu AVANT lui dans le DOM : c'est le seul chemin qui reste (lecture lineaire,
1404
+ * curseur virtuel). `cw-button` n'expose aucun input `describedBy` et rend son `<button>`
1405
+ * hors de portee : la liaison `aria-describedby` n'est pas possible depuis le consommateur.
1406
+ */
1407
+ this.missingRequirementKey = computed(() => {
1408
+ if (this.analyzing())
1409
+ return undefined;
1410
+ if (!this.fileValue())
1411
+ return '_COMMON._IMPORT._A11Y.MISSING_FILE';
1412
+ if (!this.selectedMode())
1413
+ return '_COMMON._IMPORT._A11Y.MISSING_MODE';
1414
+ return undefined;
1415
+ }, ...(ngDevMode ? [{ debugName: "missingRequirementKey" }] : []));
1416
+ /** Libelle du champ cle du mode retenu. `undefined` pour `replaceAll`, qui n'en a pas. */
1417
+ this.selectedKeyFieldHint = computed(() => {
1418
+ const selected = this.selectedMode();
1419
+ const option = this.modes().find(({ mode }) => mode === selected);
1420
+ return option && 'keyFieldHint' in option ? option.keyFieldHint : undefined;
1421
+ }, ...(ngDevMode ? [{ debugName: "selectedKeyFieldHint" }] : []));
1422
+ /** Avertissement sur la portee du mode retenu : `replaceAll` est destructif, les autres non. */
1423
+ this.modeNoticeType = computed(() => this.selectedMode() === ImportModeEnum.replaceAll ? AlertTypeEnum.warning : AlertTypeEnum.info, ...(ngDevMode ? [{ debugName: "modeNoticeType" }] : []));
1424
+ /** `undefined` tant qu'aucun mode n'est retenu : pas d'alerte decrivant un mode non choisi. */
1425
+ this.modeNoticeKey = computed(() => {
1426
+ const selected = this.selectedMode();
1427
+ return selected ? ImportWizardComponent.MODE_NOTICE[selected] : undefined;
1428
+ }, ...(ngDevMode ? [{ debugName: "modeNoticeKey" }] : []));
1429
+ /**
1430
+ * `cw-file-to-download` attend des `Attachment`, dont la taille est en Ko : conversion
1431
+ * a la frontiere. Le contrat public, lui, n'a qu'une seule unite — l'octet.
1432
+ */
1433
+ this.templateAttachments = computed(() => {
1434
+ const template = this.config().templateFile;
1435
+ if (!template)
1436
+ return [];
1437
+ return [{
1438
+ url: template.url,
1439
+ label: template.label,
1440
+ extension: template.extension,
1441
+ size: template.sizeBytes === undefined ? undefined : template.sizeBytes / 1024,
1442
+ }];
1443
+ }, ...(ngDevMode ? [{ debugName: "templateAttachments" }] : []));
1444
+ /** `cw-file-drop` attend des Mo : meme conversion a la frontiere. */
1445
+ this.maxSizeMb = computed(() => {
1446
+ const bytes = this.config().maxSizeBytes;
1447
+ return bytes === undefined ? undefined : bytes / (1024 * 1024);
1448
+ }, ...(ngDevMode ? [{ debugName: "maxSizeMb" }] : []));
1449
+ this.errors = computed(() => this.config().showErrorDetails ? this.analysis()?.errors ?? [] : [], ...(ngDevMode ? [{ debugName: "errors" }] : []));
1450
+ /**
1451
+ * Compteurs previsionnels (analyse) et reels (rapport), memes lignes, cles distinctes.
1452
+ * `computed` lisant la langue : categorie de pluriel et separateur de milliers suivent
1453
+ * un changement de langue a chaud.
1454
+ */
1455
+ this.previewRows = computed(() => this.countRows(this.analysis()?.counts, 'PREVIEW'), ...(ngDevMode ? [{ debugName: "previewRows" }] : []));
1456
+ this.reportRows = computed(() => this.countRows(this.report()?.counts, 'REPORT'), ...(ngDevMode ? [{ debugName: "reportRows" }] : []));
1457
+ // `cw-card.collapsed` n'est qu'un etat INITIAL (lu au ngOnInit) : le rebinder ne replie
1458
+ // ni ne deplie rien. La progression se pilote donc par les methodes publiques de la card,
1459
+ // qui ignorent volontairement `collapseLocked`.
1460
+ effect(() => {
1461
+ const panels = this.panels();
1462
+ if (!panels.length)
1463
+ return;
1464
+ IMPORT_WIZARD_STEPS.forEach((step, index) => {
1465
+ const panel = panels[index];
1466
+ if (!panel)
1467
+ return;
1468
+ if (this.isPanelOpen(step))
1469
+ panel.expand();
1470
+ else
1471
+ panel.collapse();
1472
+ });
1473
+ });
1474
+ // Un effet par cible : une requete de vue ne change qu'a l'apparition ou a la
1475
+ // disparition de son element, l'effet ne refocalise donc jamais le meme deux fois.
1476
+ // `afterRenderEffect` et non `effect` : focaliser exige un DOM a jour, classe `show`
1477
+ // du panneau comprise (sinon l'element est encore dans un sous-arbre `display: none`
1478
+ // et le focus echoue en silence). La phase post-rendu s'execute dans la MEME tache que
1479
+ // la detection de changements : aucune reprise de la boucle d'evenements entre la
1480
+ // disparition de l'ancienne cible et la prise du focus par la nouvelle.
1481
+ afterRenderEffect(() => this.selectionTarget()?.nativeElement.focus());
1482
+ afterRenderEffect(() => this.analysisStatus()?.nativeElement.focus());
1483
+ afterRenderEffect(() => this.analysisOutcome()?.nativeElement.focus());
1484
+ afterRenderEffect(() => this.executionStatus()?.nativeElement.focus());
1485
+ afterRenderEffect(() => this.cancellingStatus()?.nativeElement.focus());
1486
+ afterRenderEffect(() => this.reportOutcome()?.nativeElement.focus());
1487
+ afterRenderEffect(() => this.interruptedOutcome()?.nativeElement.focus());
1488
+ }
1489
+ static { this.MODE_LABEL = {
1490
+ [ImportModeEnum.addOnly]: '_COMMON._IMPORT._MODE.ADD_ONLY',
1491
+ [ImportModeEnum.upsert]: '_COMMON._IMPORT._MODE.UPSERT',
1492
+ [ImportModeEnum.replaceAll]: '_COMMON._IMPORT._MODE.REPLACE_ALL',
1493
+ }; }
1494
+ static { this.MODE_NOTICE = {
1495
+ [ImportModeEnum.addOnly]: '_COMMON._IMPORT._MODE.ADD_ONLY_NOTICE',
1496
+ [ImportModeEnum.upsert]: '_COMMON._IMPORT._MODE.UPSERT_NOTICE',
1497
+ [ImportModeEnum.replaceAll]: '_COMMON._IMPORT._MODE.REPLACE_ALL_NOTICE',
1498
+ }; }
1499
+ static { this.INTERRUPTION_MESSAGE = {
1500
+ [ImportInterruptionStateEnum.unchanged]: '_COMMON._IMPORT._INTERRUPTED.UNCHANGED',
1501
+ [ImportInterruptionStateEnum.cancelled]: '_COMMON._IMPORT._INTERRUPTED.CANCELLED',
1502
+ [ImportInterruptionStateEnum.unknown]: '_COMMON._IMPORT._INTERRUPTED.UNKNOWN',
1503
+ }; }
1504
+ /**
1505
+ * Panneau deplie ou non. Une etape en echec reste ouverte sur son message ; une etape
1506
+ * reussie se replie, sauf la derniere qui garde son rapport a l'ecran.
1507
+ */
1508
+ isPanelOpen(step) {
1509
+ const state = this.stateOf(step);
1510
+ if (state === ImportWizardStepStateEnum.todo)
1511
+ return false;
1512
+ if (state === ImportWizardStepStateEnum.done)
1513
+ return step === ImportWizardStepEnum.execution;
1514
+ return true;
1515
+ }
1516
+ /**
1517
+ * Etat d'une etape, qui pilote a la fois la pastille et le pliage du panneau.
1518
+ * Une etape en echec reste ouverte sur son message ; une etape reussie est verrouillee.
1519
+ */
1520
+ stateOf(step) {
1521
+ const current = this.currentStep();
1522
+ if (step === ImportWizardStepEnum.analysis && current === step && this.analysis()?.valid === false) {
1523
+ return ImportWizardStepStateEnum.error;
1524
+ }
1525
+ if (step === ImportWizardStepEnum.execution && current === step) {
1526
+ const report = this.report();
1527
+ if (report && !report.success)
1528
+ return ImportWizardStepStateEnum.error;
1529
+ if (this.interruptionState())
1530
+ return ImportWizardStepStateEnum.error;
1531
+ if (report?.success)
1532
+ return ImportWizardStepStateEnum.done;
1533
+ }
1534
+ // Meme source d'ordre que le pliage des panneaux : ils ne peuvent pas diverger.
1535
+ const delta = importWizardStepRank(step) - importWizardStepRank(current);
1536
+ if (delta < 0)
1537
+ return ImportWizardStepStateEnum.done;
1538
+ return delta === 0 ? ImportWizardStepStateEnum.current : ImportWizardStepStateEnum.todo;
1539
+ }
1540
+ /** Libelle accessible de la pastille (le numero visible n'est pas parlant pour un lecteur d'ecran). */
1541
+ stepStatusLabel(step) {
1542
+ return `_COMMON._IMPORT._STEP_STATUS.${this.stateOf(step).toUpperCase()}`;
1543
+ }
1544
+ /**
1545
+ * Variante de la pastille NUMEROTEE : etape en cours pleine en couleur de marque,
1546
+ * etape a venir grisee. C'est le mapping du DS (`_Stepper / Step` : `surface/primary`
1547
+ * pour l'etat courant, `surface/disabled` pour l'etat a venir).
1548
+ *
1549
+ * Le suffixe complete une classe `icon-circular-*` de basic-ui, exactement comme le fait
1550
+ * `cw-icon` en type `circular` : la pastille numerotee EST une icone ronde dont le picto
1551
+ * est remplace par un chiffre. Type litteral plutot que `IconUiTypeEnum` : `disabled` est
1552
+ * present dans les SOURCES de basic-ui mais absent du paquet publie 1.1.0-beta005 qui est
1553
+ * installe, l'enum ne compile donc pas ici. A rebasculer sur `IconUiTypeEnum` au prochain
1554
+ * repack de basic-ui.
1555
+ *
1556
+ * Les etats `done` et `error` ne passent jamais par cette methode : ils sont rendus par
1557
+ * un vrai `cw-icon` (coche / croix), pas par un numero.
1558
+ */
1559
+ badgeVariant(step) {
1560
+ return this.stateOf(step) === ImportWizardStepStateEnum.current ? 'primary' : 'disabled';
1561
+ }
1562
+ /** Un mode est exige : en choix libre, il faut l'avoir choisi (en impose, il l'est deja). */
1563
+ canContinue() {
1564
+ return !!this.file.value && !!this.selectedMode() && !this.analyzing();
1565
+ }
1566
+ /** Etape 1 -> 2 : lance l'analyse a blanc. */
1567
+ continueToAnalysis() {
1568
+ const file = this.file.value;
1569
+ const mode = this.selectedMode();
1570
+ if (!file || !mode || this.analyzing())
1571
+ return;
1572
+ this.analyzing.set(true);
1573
+ this.analysis.set(null);
1574
+ this.selectionReopened.set(false);
1575
+ this.currentStep.set(ImportWizardStepEnum.analysis);
1576
+ const sub = this.config().source.analyze(file, mode).pipe(takeUntilDestroyed(this.destroyRef)).subscribe({
1577
+ next: (analysis) => {
1578
+ this.analysis.set(analysis);
1579
+ this.analyzing.set(false);
1580
+ },
1581
+ // Une erreur reseau/serveur equivaut a un fichier non conforme : meme ecran, meme sortie.
1582
+ error: () => {
1583
+ this.analysis.set({ valid: false });
1584
+ this.analyzing.set(false);
1585
+ },
1586
+ });
1587
+ }
1588
+ /** Retour a l'etape 1 apres une analyse KO (SFD : l'utilisateur revient choisir son fichier). */
1589
+ backToSelection() {
1590
+ this.analysis.set(null);
1591
+ this.currentStep.set(ImportWizardStepEnum.select);
1592
+ this.selectionReopened.set(true);
1593
+ }
1594
+ /** Etape 2 -> 3 : lance l'import reel. */
1595
+ startImport() {
1596
+ const file = this.file.value;
1597
+ const mode = this.selectedMode();
1598
+ if (!file || !mode || this.analysis()?.valid !== true)
1599
+ return;
1600
+ this.report.set(null);
1601
+ this.progress.set(null);
1602
+ this.interruptionState.set(null);
1603
+ this.currentStep.set(ImportWizardStepEnum.execution);
1604
+ const sub = this.config().source
1605
+ .execute(file, mode, this.analysis()?.context)
1606
+ .pipe(takeUntilDestroyed(this.destroyRef))
1607
+ .subscribe({
1608
+ next: (event) => {
1609
+ if (event.kind === ImportEventKindEnum.progress) {
1610
+ this.progress.set(event);
1611
+ return;
1612
+ }
1613
+ this.report.set(event);
1614
+ this.execution.set(null);
1615
+ this.completed.emit(event);
1616
+ },
1617
+ error: () => {
1618
+ const failure = { kind: ImportEventKindEnum.report, success: false };
1619
+ this.report.set(failure);
1620
+ this.execution.set(null);
1621
+ this.completed.emit(failure);
1622
+ },
1623
+ });
1624
+ this.execution.set(sub);
1625
+ }
1626
+ /**
1627
+ * Interruption utilisateur. Le flux est abandonne cote client dans tous les cas ; ce que
1628
+ * cela implique pour les donnees depend de la capacite declaree, et de rien d'autre.
1629
+ */
1630
+ stopImport() {
1631
+ const interruption = this.interruption();
1632
+ if (interruption.kind === ImportInterruptionEnum.notInterruptible)
1633
+ return;
1634
+ this.execution()?.unsubscribe();
1635
+ this.execution.set(null);
1636
+ this.progress.set(null);
1637
+ if (interruption.kind === ImportInterruptionEnum.atomic) {
1638
+ this.settleInterruption(ImportInterruptionStateEnum.unchanged);
1639
+ return;
1640
+ }
1641
+ this.cancelling.set(true);
1642
+ const sub = interruption.cancel(this.analysis()?.context).pipe(takeUntilDestroyed(this.destroyRef)).subscribe({
1643
+ next: ({ confirmed }) => this.settleInterruption(confirmed ? ImportInterruptionStateEnum.cancelled : ImportInterruptionStateEnum.unknown),
1644
+ error: () => this.settleInterruption(ImportInterruptionStateEnum.unknown),
1645
+ });
1646
+ // Une source qui repond de facon SYNCHRONE a deja conclu l'interruption ici : ne pas
1647
+ // ressusciter une souscription terminee, `stopWaiting()` la croirait encore en vol.
1648
+ if (this.cancelling())
1649
+ this.cancellation.set(sub);
1650
+ }
1651
+ /**
1652
+ * L'utilisateur renonce a attendre la reponse du serveur. Aucun delai n'est defendable
1653
+ * depuis le composant : c'est donc lui qui decide, et le resultat est l'etat honnete —
1654
+ * personne ne sait ce qui a ete ecrit.
1655
+ */
1656
+ stopWaiting() {
1657
+ this.settleInterruption(ImportInterruptionStateEnum.unknown);
1658
+ }
1659
+ /** Conclut l'interruption : ecran final, et hote averti qu'il doit rafraichir. */
1660
+ settleInterruption(state) {
1661
+ this.cancellation()?.unsubscribe();
1662
+ this.cancellation.set(null);
1663
+ this.cancelling.set(false);
1664
+ this.interruptionState.set(state);
1665
+ this.completed.emit({ kind: ImportEventKindEnum.interruption, state });
1666
+ }
1667
+ get isImporting() {
1668
+ return this.currentStep() === ImportWizardStepEnum.execution
1669
+ && !this.report()
1670
+ && !this.cancelling()
1671
+ && !this.interruptionState();
1672
+ }
1673
+ /**
1674
+ * Lignes de compteurs dans l'ordre du DS. Un compteur non renseigne par la source est
1675
+ * omis (et non affiche a zero) : toutes les operations ne s'appliquent pas a tous les modes.
1676
+ *
1677
+ * La cle porte la categorie de pluriel de la langue active et le nombre est deja formate :
1678
+ * ni l'une ni l'autre ne peut se deduire d'une condition ecrite a la main (cf.
1679
+ * `count-i18n.util`).
1680
+ *
1681
+ * Nombre et libelle sont RENDUS SEPAREMENT (le DS colore le nombre selon l'operation) :
1682
+ * les libelles i18n ne portent donc plus `{{count}}`, seulement le texte accordé. La
1683
+ * contrepartie assumee est que l'ordre « nombre puis libelle » est fige par le gabarit ;
1684
+ * une langue qui postposerait le nombre demanderait un autre gabarit, pas une autre cle.
1685
+ *
1686
+ * `tone` ne pilote QUE la couleur : le sens reste porte par le libelle, jamais par elle
1687
+ * seule (une couleur n'est pas lue par un lecteur d'ecran, ni vue par un daltonien).
1688
+ */
1689
+ countRows(counts, prefix) {
1690
+ if (!counts)
1691
+ return [];
1692
+ const lang = this.lang();
1693
+ const rows = [
1694
+ ['CREATED', counts.created, 'success'],
1695
+ ['UPDATED', counts.updated, 'primary'],
1696
+ ['DELETED', counts.deleted, 'danger'],
1697
+ ['UNCHANGED', counts.unchanged, 'light'],
1698
+ ];
1699
+ return rows
1700
+ .filter((row) => row[1] !== undefined)
1701
+ .map(([name, value, tone]) => ({
1702
+ key: pluralizedCountKey(`_COMMON._IMPORT._COUNTS.${prefix}_${name}`, value, lang),
1703
+ count: formatCount(value, lang),
1704
+ tone,
1705
+ }));
1706
+ }
1707
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: ImportWizardComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
1708
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.20", type: ImportWizardComponent, isStandalone: true, selector: "cw-import-wizard", inputs: { config: { classPropertyName: "config", publicName: "config", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { completed: "completed" }, host: { classAttribute: "cw-import-wizard" }, viewQueries: [{ propertyName: "panels", predicate: ["stepPanel"], descendants: true, read: CardComponent, isSignal: true }, { propertyName: "selectionTarget", first: true, predicate: ["selectionTarget"], descendants: true, isSignal: true }, { propertyName: "analysisStatus", first: true, predicate: ["analysisStatus"], descendants: true, isSignal: true }, { propertyName: "analysisOutcome", first: true, predicate: ["analysisOutcome"], descendants: true, isSignal: true }, { propertyName: "executionStatus", first: true, predicate: ["executionStatus"], descendants: true, isSignal: true }, { propertyName: "cancellingStatus", first: true, predicate: ["cancellingStatus"], descendants: true, isSignal: true }, { propertyName: "reportOutcome", first: true, predicate: ["reportOutcome"], descendants: true, isSignal: true }, { propertyName: "interruptedOutcome", first: true, predicate: ["interruptedOutcome"], descendants: true, isSignal: true }], ngImport: i0, template: "<!-- Pastille d'etape : icone ronde verte (terminee) / rouge (echec), sinon le numero.\n Rendue dans [header-start] pour etre AVANT le titre, comme sur les maquettes.\n Le numero seul n'etant pas parlant a l'oreille, le statut est double en visually-hidden --\n et c'est LUI qui distingue \u00AB en cours \u00BB de \u00AB a venir \u00BB pour qui ne voit pas la couleur. -->\n<ng-template #badge let-stepKey=\"stepKey\" let-number=\"number\">\n @if (stateOf(stepKey) === stepState.done) {\n <cw-icon [icon]=\"spriteIcon.check\" [type]=\"iconType.circular\" [iconSize]=\"iconSize['sm']\"\n [iconUiType]=\"iconUiType.success\" [label]=\"stepStatusLabel(stepKey) | translate\"></cw-icon>\n }\n @else if (stateOf(stepKey) === stepState.error) {\n <cw-icon [icon]=\"spriteIcon.close\" [type]=\"iconType.circular\" [iconSize]=\"iconSize['sm']\"\n [iconUiType]=\"iconUiType.danger\" [label]=\"stepStatusLabel(stepKey) | translate\"></cw-icon>\n }\n @else {\n <div class=\"icon-circular icon-circular-sm\" [class]=\"'icon-circular-' + badgeVariant(stepKey)\">\n <span aria-hidden=\"true\">{{ number }}</span>\n <span class=\"visually-hidden\">{{ stepStatusLabel(stepKey) | translate }}</span>\n </div>\n }\n</ng-template>\n\n<ng-template #counts let-rows=\"rows\">\n <ul class=\"list-unstyled d-flex-h gap-md\">\n @for (row of rows; track row.key) {\n <li>\n <span class=\"fs-lg fw-bold\" [class]=\"'text-' + row.tone\">{{ row.count }}</span> {{ row.key | translate }}\n </li>\n }\n </ul>\n</ng-template>\n\n<cw-accordion [closeOthers]=\"true\" [destroyOnHide]=\"false\">\n\n <!-- Etape 1 : fichier + type d'import -->\n <cw-card\n #stepPanel\n [title]=\"'_COMMON._IMPORT._STEP.SELECT'\"\n [collapseId]=\"'import-step-select'\"\n [collapsed]=\"!isPanelOpen(step.select)\"\n [collapseLocked]=\"stateOf(step.select) === stepState.done\"\n [disabled]=\"stateOf(step.select) === stepState.todo\"\n [collapseStretched]=\"false\">\n\n <ng-container ngProjectAs=\"[header-start]\">\n <ng-container *ngTemplateOutlet=\"badge; context: { stepKey: step.select, number: 1 }\"></ng-container>\n </ng-container>\n\n <div class=\"d-flex-v gap-md\">\n <div class=\"row\">\n <div class=\"col-lg-6\">\n <!-- Retour depuis une analyse non conforme : cible de focus. Le bouton qui declenche\n ce retour disparait avec le repli du panneau 2, le focus retomberait sur <body>. -->\n @if (selectionReopened()) {\n <h3 class=\"visually-hidden\" tabindex=\"-1\" #selectionTarget>\n {{ '_COMMON._IMPORT._A11Y.SELECTION' | translate }}\n </h3>\n }\n\n <cw-file-drop\n [formControl]=\"file\"\n [accept]=\"config().accept\"\n [acceptLabel]=\"config().acceptLabel\"\n [maxSizeMb]=\"maxSizeMb()\"\n [label]=\"'_COMMON._IMPORT.FILE_TO_IMPORT' | translate\">\n </cw-file-drop>\n </div>\n\n @if (config().templateFile) {\n <div class=\"col-lg-6\">\n <cw-card [type]=\"cardType.light\">\n <strong>{{ '_COMMON._IMPORT._TEMPLATE.TITLE' | translate }}</strong>\n <span>{{ '_COMMON._IMPORT._TEMPLATE.TEXT' | translate }}</span>\n <cw-file-to-download [attachments]=\"templateAttachments()\"></cw-file-to-download>\n </cw-card>\n </div>\n }\n </div>\n\n <!-- Choix impose : on informe sans champ de saisie. Choix libre : groupe radio,\n dont la selection est REQUISE (pas de preselection, cf. `selectedMode`). -->\n @if (isModeImposed()) {\n <div class=\"d-flex-v gap-2xs\">\n <p class=\"mb-none\">\n <strong>{{ '_COMMON._IMPORT._MODE.LABEL' | translate }}</strong>\n {{ imposedModeLabel() | translate }}\n </p>\n <!-- Champ cle affiche ici AUSSI : c'est le cas le plus courant, et le seul ou\n l'utilisateur ne voyait pas sur quoi portait le rapprochement. -->\n @if (selectedKeyFieldHint(); as keyFieldHint) {\n <span class=\"fs fs-xs text-light\">{{ keyFieldHint | translate }}</span>\n }\n </div>\n }\n @else {\n <cw-form-field\n [type]=\"fieldType.radio\"\n [control]=\"mode\"\n [name]=\"'importMode'\"\n [label]=\"'_COMMON._IMPORT._MODE.LABEL'\"\n [options]=\"modeOptions()\"\n [isRequired]=\"true\"\n [help]=\"selectedKeyFieldHint()\">\n </cw-form-field>\n }\n\n <!-- Portee du mode retenu (destructif ou non) : exigence SFD \u00AB l'utilisateur est\n informe du type d'import selectionne ou impose \u00BB. Rien tant qu'aucun mode n'est\n retenu : l'alerte ne decrit jamais un mode que l'utilisateur n'a pas choisi. -->\n @if (modeNoticeKey(); as noticeKey) {\n <cw-alert [type]=\"modeNoticeType()\">\n {{ noticeKey | translate }}\n </cw-alert>\n }\n\n <!-- Un bouton desactive muet est un cul-de-sac : ce texte dit ce qui manque, et il est\n place AVANT le bouton, seul chemin possible puisqu'un bouton desactive n'est pas\n focusable (donc pas d'aria-describedby exploitable). Pas de classe de couleur\n atenuee : c'est une information necessaire, elle garde le contraste du corps. -->\n <div class=\"d-flex-h justify-end gap-md\">\n @if (missingRequirementKey(); as missing) {\n <p class=\"mb-none fs-xs\">{{ missing | translate }}</p>\n }\n\n <cw-button\n [type]=\"buttonType.primary\"\n [label]=\"'_COMMON._IMPORT.CONTINUE'\"\n [dataTest]=\"'btn-import-continue'\"\n [isDisabled]=\"!canContinue()\"\n (btnAction)=\"continueToAnalysis()\">\n </cw-button>\n </div>\n </div>\n </cw-card>\n\n <!-- Etape 2 : analyse a blanc -->\n <cw-card\n #stepPanel\n [title]=\"'_COMMON._IMPORT._STEP.ANALYSIS'\"\n [collapseId]=\"'import-step-analysis'\"\n [collapsed]=\"!isPanelOpen(step.analysis)\"\n [collapseLocked]=\"stateOf(step.analysis) === stepState.done\"\n [disabled]=\"stateOf(step.analysis) === stepState.todo\"\n [collapseStretched]=\"false\">\n\n <ng-container ngProjectAs=\"[header-start]\">\n <ng-container *ngTemplateOutlet=\"badge; context: { stepKey: step.analysis, number: 2 }\"></ng-container>\n </ng-container>\n\n <div class=\"d-flex-v gap-md\">\n @if (analyzing()) {\n <!-- Cible de focus : ce texte EST le message d'etat, il est donc lu une fois et une\n seule (aucune region live en doublon). -->\n <span tabindex=\"-1\" #analysisStatus>{{ '_COMMON._IMPORT.ANALYSIS_IN_PROGRESS' | translate }}</span>\n }\n @else if (analysis(); as result) {\n <!-- Cible de focus a l'arrivee du resultat : libelle de section, pas une reprise du\n message, pour que la lecture enchaine sur l'alerte puis les compteurs. -->\n <h3 class=\"visually-hidden\" tabindex=\"-1\" #analysisOutcome>\n {{ '_COMMON._IMPORT._A11Y.ANALYSIS_RESULT' | translate }}\n </h3>\n\n @if (result.valid) {\n <cw-alert [type]=\"alertType.success\">\n {{ '_COMMON._IMPORT.ANALYSIS_OK' | translate }}\n </cw-alert>\n\n <!-- scope=list : previsualisation chiffree. scope=singleConfig : le message ci-dessus suffit. -->\n @if (isList() && previewRows().length) {\n <ng-container *ngTemplateOutlet=\"counts; context: { rows: previewRows() }\"></ng-container>\n }\n\n <div class=\"list-unstyled d-flex-h justify-end\">\n <cw-button\n [type]=\"buttonType.primary\"\n [label]=\"'_COMMON._IMPORT.START'\"\n [dataTest]=\"'btn-import-start'\"\n (btnAction)=\"startImport()\">\n </cw-button>\n </div>\n }\n @else {\n <cw-alert [type]=\"alertType.danger\">\n {{ '_COMMON._IMPORT.ANALYSIS_KO' | translate }}\n </cw-alert>\n\n @if (errors()?.length) {\n <ul class=\"mb-none\">\n @for (issue of errors(); track $index) {\n <li>\n @if (issue.line !== undefined) {\n <strong>{{ '_COMMON._IMPORT.ERROR_LINE' | translate: { line: issue.line } }}</strong>\n }\n {{ issue.messageKey ? (issue.messageKey | translate: issue.messageParams) : issue.message }}\n </li>\n }\n </ul>\n }\n\n <div class=\"d-flex-h justify-end\">\n <cw-button\n [type]=\"buttonType.secondary\"\n [label]=\"'_COMMON._IMPORT.BACK_TO_SELECTION'\"\n [dataTest]=\"'btn-import-back'\"\n (btnAction)=\"backToSelection()\">\n </cw-button>\n </div>\n }\n }\n </div>\n </cw-card>\n\n <!-- Etape 3 : import -->\n <cw-card\n #stepPanel\n [title]=\"'_COMMON._IMPORT._STEP.EXECUTION'\"\n [collapseId]=\"'import-step-execution'\"\n [collapsed]=\"!isPanelOpen(step.execution)\"\n [disabled]=\"stateOf(step.execution) === stepState.todo\"\n [collapseStretched]=\"false\">\n\n <ng-container ngProjectAs=\"[header-start]\">\n <ng-container *ngTemplateOutlet=\"badge; context: { stepKey: step.execution, number: 3 }\"></ng-container>\n </ng-container>\n\n <div class=\"d-flex-v gap-md\">\n @if (isImporting) {\n <div class=\"d-flex-v gap-2xs\">\n <!-- Cible de focus. Le bouton \u00AB Arreter l'import \u00BB est le focusable suivant. -->\n <span tabindex=\"-1\" #executionStatus>{{ '_COMMON._IMPORT.IN_PROGRESS' | translate }}</span>\n @if (progress()?.remainingLabel; as remaining) {\n <span>{{ '_COMMON._IMPORT.REMAINING' | translate: { value: remaining } }}</span>\n }\n </div>\n\n <!-- Avancement connu => barre deterministe. Aucune progression recue => spinner\n indetermine, plutot qu'une barre figee a 0 %. La bascule se fait a la premiere\n emission `ImportProgress` : une source qui n'en emet jamais reste sur le spinner.\n `displayText` a false : le libelle \u00AB Import en cours \u00BB est deja au-dessus. -->\n @if (progress(); as current) {\n <cw-progress-bar\n [value]=\"current.percent\"\n [type]=\"progressType.information\"\n [label]=\"'_COMMON._IMPORT.IN_PROGRESS' | translate\">\n </cw-progress-bar>\n }\n @else {\n <cw-loader [size]=\"loaderSize.sm\" [displayText]=\"false\"></cw-loader>\n }\n\n <!-- Pas de bouton d'arret quand l'objet declare l'import non interruptible : un\n bouton qui ne peut rien arreter serait pire que son absence. -->\n @if (canInterrupt()) {\n <div class=\"d-flex-h justify-end\">\n <cw-button\n [type]=\"buttonType.dangerOutline\"\n [label]=\"'_COMMON._IMPORT.STOP'\"\n [dataTest]=\"'btn-import-stop'\"\n (btnAction)=\"stopImport()\">\n </cw-button>\n </div>\n }\n }\n @else if (cancelling()) {\n <!-- Annulation demandee au serveur, reponse en attente. Cible de focus. -->\n <span tabindex=\"-1\" #cancellingStatus>{{ '_COMMON._IMPORT.CANCELLING' | translate }}</span>\n\n <cw-loader [size]=\"loaderSize.sm\" [displayText]=\"false\"></cw-loader>\n\n <!-- Sortie de secours : aucun delai n'etant defendable depuis la lib, c'est\n l'utilisateur qui decide d'arreter d'attendre. Conclut en \u00AB etat incertain \u00BB. -->\n <div class=\"d-flex-h justify-end\">\n <cw-button\n [type]=\"buttonType.secondary\"\n [label]=\"'_COMMON._IMPORT.STOP_WAITING'\"\n [dataTest]=\"'btn-import-stop-waiting'\"\n (btnAction)=\"stopWaiting()\">\n </cw-button>\n </div>\n }\n @else if (interruptionMessageKey(); as interruptionMessage) {\n <h3 class=\"visually-hidden\" tabindex=\"-1\" #interruptedOutcome>\n {{ '_COMMON._IMPORT._A11Y.IMPORT_RESULT' | translate }}\n </h3>\n\n <cw-alert [type]=\"interruptionAlertType()\">\n {{ interruptionMessage | translate }}\n </cw-alert>\n }\n @else if (report(); as result) {\n <h3 class=\"visually-hidden\" tabindex=\"-1\" #reportOutcome>\n {{ '_COMMON._IMPORT._A11Y.IMPORT_RESULT' | translate }}\n </h3>\n\n @if (result.success) {\n <cw-alert [type]=\"alertType.success\">\n {{ '_COMMON._IMPORT.SUCCESS' | translate }}\n </cw-alert>\n\n @if (isList() && reportRows().length) {\n <ng-container *ngTemplateOutlet=\"counts; context: { rows: reportRows() }\"></ng-container>\n }\n }\n @else {\n <!-- Le message generique ne promet l'absence d'ecriture que si l'atomicite est\n declaree (cf. `failureMessageKey`). -->\n <cw-alert [type]=\"alertType.danger\">\n {{ result.errorMessage ?? (failureMessageKey() | translate) }}\n </cw-alert>\n }\n }\n </div>\n </cw-card>\n\n</cw-accordion>\n", dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$2.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "ngmodule", type: TranslateModule }, { kind: "component", type: AccordionComponent, selector: "cw-accordion", inputs: ["closeOthers", "allowMultiple", "destroyOnHide"], outputs: ["panelOpened", "panelClosed"] }, { kind: "component", type: AlertComponent, selector: "cw-alert", inputs: ["type", "title", "isDismissible", "cssClass", "dataTest"], outputs: ["close"] }, { kind: "component", type: ButtonComponent, selector: "cw-button", inputs: ["type", "label", "id", "link", "isDropdown", "hideCaret", "withIcon", "withOnlyIcon", "iconSize", "iconPosition", "dropdownPosition", "isMinWidth", "isDisabled", "isLoading", "cssClass", "dataTest", "skeletonMode", "withTooltip", "tooltipText", "tooltipTitle", "tooltipTrigger", "tooltipPosition", "tooltipType"], outputs: ["btnAction", "dropDownClicked"] }, { kind: "component", type: CardComponent, selector: "cw-card", inputs: ["title", "subtitle", "type", "titleRank", "cssClass", "collapsible", "collapsed", "disabled", "collapseLocked", "collapseStretched", "collapseId", "destroyOnHide"], outputs: ["collapsibleChange", "destroyOnHideChange", "collapseClicked"] }, { kind: "component", type: FileDropComponent, selector: "cw-file-drop", inputs: ["mode", "multiple", "maxFiles", "accept", "acceptLabel", "maxSizeMb", "recommendedDimensions", "label", "isDisabled", "errorMessage", "dataTest"], outputs: ["filesChange", "rejected", "retry"] }, { kind: "component", type: FileToDownloadComponent, selector: "cw-file-to-download", inputs: ["attachments"] }, { kind: "component", type: FormFieldComponent, selector: "cw-form-field", inputs: ["control", "formGroup", "type", "label", "displayLabel", "name", "placeholder", "autocomplete", "options", "rangeOptions", "validationOptions", "autocompleteOptions", "richTextOptions", "errorMessages", "isRequired", "help", "tooltip", "addonLeft", "addonRight", "isInAddon", "isReadonly", "isDisabled", "sliderValue", "sliderOptions", "cssClass", "skeletonMode", "clearable", "appendTo", "initialCountry", "indeterminate"], outputs: ["refreshEvent", "textChanged", "valueChange", "phoneRegionChange"] }, { kind: "component", type: IconComponent, selector: "cw-icon", inputs: ["icon", "label", "type", "iconSize", "iconCssClass", "iconUiType", "iconColorCustom", "spritePath"] }, { kind: "component", type: LoaderComponent, selector: "cw-loader", inputs: ["size", "displayText"] }, { kind: "component", type: ProgressBarComponent, selector: "cw-progress-bar", inputs: ["value", "max", "size", "type", "showValue", "label", "dataTest"] }, { kind: "pipe", type: i1.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
1709
+ }
1710
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: ImportWizardComponent, decorators: [{
1711
+ type: Component,
1712
+ args: [{ selector: 'cw-import-wizard', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, host: { class: 'cw-import-wizard' }, imports: [
1713
+ NgTemplateOutlet,
1714
+ ReactiveFormsModule,
1715
+ TranslateModule,
1716
+ AccordionComponent,
1717
+ AlertComponent,
1718
+ ButtonComponent,
1719
+ CardComponent,
1720
+ FileDropComponent,
1721
+ FileToDownloadComponent,
1722
+ FormFieldComponent,
1723
+ IconComponent,
1724
+ LoaderComponent,
1725
+ ProgressBarComponent
1726
+ ], template: "<!-- Pastille d'etape : icone ronde verte (terminee) / rouge (echec), sinon le numero.\n Rendue dans [header-start] pour etre AVANT le titre, comme sur les maquettes.\n Le numero seul n'etant pas parlant a l'oreille, le statut est double en visually-hidden --\n et c'est LUI qui distingue \u00AB en cours \u00BB de \u00AB a venir \u00BB pour qui ne voit pas la couleur. -->\n<ng-template #badge let-stepKey=\"stepKey\" let-number=\"number\">\n @if (stateOf(stepKey) === stepState.done) {\n <cw-icon [icon]=\"spriteIcon.check\" [type]=\"iconType.circular\" [iconSize]=\"iconSize['sm']\"\n [iconUiType]=\"iconUiType.success\" [label]=\"stepStatusLabel(stepKey) | translate\"></cw-icon>\n }\n @else if (stateOf(stepKey) === stepState.error) {\n <cw-icon [icon]=\"spriteIcon.close\" [type]=\"iconType.circular\" [iconSize]=\"iconSize['sm']\"\n [iconUiType]=\"iconUiType.danger\" [label]=\"stepStatusLabel(stepKey) | translate\"></cw-icon>\n }\n @else {\n <div class=\"icon-circular icon-circular-sm\" [class]=\"'icon-circular-' + badgeVariant(stepKey)\">\n <span aria-hidden=\"true\">{{ number }}</span>\n <span class=\"visually-hidden\">{{ stepStatusLabel(stepKey) | translate }}</span>\n </div>\n }\n</ng-template>\n\n<ng-template #counts let-rows=\"rows\">\n <ul class=\"list-unstyled d-flex-h gap-md\">\n @for (row of rows; track row.key) {\n <li>\n <span class=\"fs-lg fw-bold\" [class]=\"'text-' + row.tone\">{{ row.count }}</span> {{ row.key | translate }}\n </li>\n }\n </ul>\n</ng-template>\n\n<cw-accordion [closeOthers]=\"true\" [destroyOnHide]=\"false\">\n\n <!-- Etape 1 : fichier + type d'import -->\n <cw-card\n #stepPanel\n [title]=\"'_COMMON._IMPORT._STEP.SELECT'\"\n [collapseId]=\"'import-step-select'\"\n [collapsed]=\"!isPanelOpen(step.select)\"\n [collapseLocked]=\"stateOf(step.select) === stepState.done\"\n [disabled]=\"stateOf(step.select) === stepState.todo\"\n [collapseStretched]=\"false\">\n\n <ng-container ngProjectAs=\"[header-start]\">\n <ng-container *ngTemplateOutlet=\"badge; context: { stepKey: step.select, number: 1 }\"></ng-container>\n </ng-container>\n\n <div class=\"d-flex-v gap-md\">\n <div class=\"row\">\n <div class=\"col-lg-6\">\n <!-- Retour depuis une analyse non conforme : cible de focus. Le bouton qui declenche\n ce retour disparait avec le repli du panneau 2, le focus retomberait sur <body>. -->\n @if (selectionReopened()) {\n <h3 class=\"visually-hidden\" tabindex=\"-1\" #selectionTarget>\n {{ '_COMMON._IMPORT._A11Y.SELECTION' | translate }}\n </h3>\n }\n\n <cw-file-drop\n [formControl]=\"file\"\n [accept]=\"config().accept\"\n [acceptLabel]=\"config().acceptLabel\"\n [maxSizeMb]=\"maxSizeMb()\"\n [label]=\"'_COMMON._IMPORT.FILE_TO_IMPORT' | translate\">\n </cw-file-drop>\n </div>\n\n @if (config().templateFile) {\n <div class=\"col-lg-6\">\n <cw-card [type]=\"cardType.light\">\n <strong>{{ '_COMMON._IMPORT._TEMPLATE.TITLE' | translate }}</strong>\n <span>{{ '_COMMON._IMPORT._TEMPLATE.TEXT' | translate }}</span>\n <cw-file-to-download [attachments]=\"templateAttachments()\"></cw-file-to-download>\n </cw-card>\n </div>\n }\n </div>\n\n <!-- Choix impose : on informe sans champ de saisie. Choix libre : groupe radio,\n dont la selection est REQUISE (pas de preselection, cf. `selectedMode`). -->\n @if (isModeImposed()) {\n <div class=\"d-flex-v gap-2xs\">\n <p class=\"mb-none\">\n <strong>{{ '_COMMON._IMPORT._MODE.LABEL' | translate }}</strong>\n {{ imposedModeLabel() | translate }}\n </p>\n <!-- Champ cle affiche ici AUSSI : c'est le cas le plus courant, et le seul ou\n l'utilisateur ne voyait pas sur quoi portait le rapprochement. -->\n @if (selectedKeyFieldHint(); as keyFieldHint) {\n <span class=\"fs fs-xs text-light\">{{ keyFieldHint | translate }}</span>\n }\n </div>\n }\n @else {\n <cw-form-field\n [type]=\"fieldType.radio\"\n [control]=\"mode\"\n [name]=\"'importMode'\"\n [label]=\"'_COMMON._IMPORT._MODE.LABEL'\"\n [options]=\"modeOptions()\"\n [isRequired]=\"true\"\n [help]=\"selectedKeyFieldHint()\">\n </cw-form-field>\n }\n\n <!-- Portee du mode retenu (destructif ou non) : exigence SFD \u00AB l'utilisateur est\n informe du type d'import selectionne ou impose \u00BB. Rien tant qu'aucun mode n'est\n retenu : l'alerte ne decrit jamais un mode que l'utilisateur n'a pas choisi. -->\n @if (modeNoticeKey(); as noticeKey) {\n <cw-alert [type]=\"modeNoticeType()\">\n {{ noticeKey | translate }}\n </cw-alert>\n }\n\n <!-- Un bouton desactive muet est un cul-de-sac : ce texte dit ce qui manque, et il est\n place AVANT le bouton, seul chemin possible puisqu'un bouton desactive n'est pas\n focusable (donc pas d'aria-describedby exploitable). Pas de classe de couleur\n atenuee : c'est une information necessaire, elle garde le contraste du corps. -->\n <div class=\"d-flex-h justify-end gap-md\">\n @if (missingRequirementKey(); as missing) {\n <p class=\"mb-none fs-xs\">{{ missing | translate }}</p>\n }\n\n <cw-button\n [type]=\"buttonType.primary\"\n [label]=\"'_COMMON._IMPORT.CONTINUE'\"\n [dataTest]=\"'btn-import-continue'\"\n [isDisabled]=\"!canContinue()\"\n (btnAction)=\"continueToAnalysis()\">\n </cw-button>\n </div>\n </div>\n </cw-card>\n\n <!-- Etape 2 : analyse a blanc -->\n <cw-card\n #stepPanel\n [title]=\"'_COMMON._IMPORT._STEP.ANALYSIS'\"\n [collapseId]=\"'import-step-analysis'\"\n [collapsed]=\"!isPanelOpen(step.analysis)\"\n [collapseLocked]=\"stateOf(step.analysis) === stepState.done\"\n [disabled]=\"stateOf(step.analysis) === stepState.todo\"\n [collapseStretched]=\"false\">\n\n <ng-container ngProjectAs=\"[header-start]\">\n <ng-container *ngTemplateOutlet=\"badge; context: { stepKey: step.analysis, number: 2 }\"></ng-container>\n </ng-container>\n\n <div class=\"d-flex-v gap-md\">\n @if (analyzing()) {\n <!-- Cible de focus : ce texte EST le message d'etat, il est donc lu une fois et une\n seule (aucune region live en doublon). -->\n <span tabindex=\"-1\" #analysisStatus>{{ '_COMMON._IMPORT.ANALYSIS_IN_PROGRESS' | translate }}</span>\n }\n @else if (analysis(); as result) {\n <!-- Cible de focus a l'arrivee du resultat : libelle de section, pas une reprise du\n message, pour que la lecture enchaine sur l'alerte puis les compteurs. -->\n <h3 class=\"visually-hidden\" tabindex=\"-1\" #analysisOutcome>\n {{ '_COMMON._IMPORT._A11Y.ANALYSIS_RESULT' | translate }}\n </h3>\n\n @if (result.valid) {\n <cw-alert [type]=\"alertType.success\">\n {{ '_COMMON._IMPORT.ANALYSIS_OK' | translate }}\n </cw-alert>\n\n <!-- scope=list : previsualisation chiffree. scope=singleConfig : le message ci-dessus suffit. -->\n @if (isList() && previewRows().length) {\n <ng-container *ngTemplateOutlet=\"counts; context: { rows: previewRows() }\"></ng-container>\n }\n\n <div class=\"list-unstyled d-flex-h justify-end\">\n <cw-button\n [type]=\"buttonType.primary\"\n [label]=\"'_COMMON._IMPORT.START'\"\n [dataTest]=\"'btn-import-start'\"\n (btnAction)=\"startImport()\">\n </cw-button>\n </div>\n }\n @else {\n <cw-alert [type]=\"alertType.danger\">\n {{ '_COMMON._IMPORT.ANALYSIS_KO' | translate }}\n </cw-alert>\n\n @if (errors()?.length) {\n <ul class=\"mb-none\">\n @for (issue of errors(); track $index) {\n <li>\n @if (issue.line !== undefined) {\n <strong>{{ '_COMMON._IMPORT.ERROR_LINE' | translate: { line: issue.line } }}</strong>\n }\n {{ issue.messageKey ? (issue.messageKey | translate: issue.messageParams) : issue.message }}\n </li>\n }\n </ul>\n }\n\n <div class=\"d-flex-h justify-end\">\n <cw-button\n [type]=\"buttonType.secondary\"\n [label]=\"'_COMMON._IMPORT.BACK_TO_SELECTION'\"\n [dataTest]=\"'btn-import-back'\"\n (btnAction)=\"backToSelection()\">\n </cw-button>\n </div>\n }\n }\n </div>\n </cw-card>\n\n <!-- Etape 3 : import -->\n <cw-card\n #stepPanel\n [title]=\"'_COMMON._IMPORT._STEP.EXECUTION'\"\n [collapseId]=\"'import-step-execution'\"\n [collapsed]=\"!isPanelOpen(step.execution)\"\n [disabled]=\"stateOf(step.execution) === stepState.todo\"\n [collapseStretched]=\"false\">\n\n <ng-container ngProjectAs=\"[header-start]\">\n <ng-container *ngTemplateOutlet=\"badge; context: { stepKey: step.execution, number: 3 }\"></ng-container>\n </ng-container>\n\n <div class=\"d-flex-v gap-md\">\n @if (isImporting) {\n <div class=\"d-flex-v gap-2xs\">\n <!-- Cible de focus. Le bouton \u00AB Arreter l'import \u00BB est le focusable suivant. -->\n <span tabindex=\"-1\" #executionStatus>{{ '_COMMON._IMPORT.IN_PROGRESS' | translate }}</span>\n @if (progress()?.remainingLabel; as remaining) {\n <span>{{ '_COMMON._IMPORT.REMAINING' | translate: { value: remaining } }}</span>\n }\n </div>\n\n <!-- Avancement connu => barre deterministe. Aucune progression recue => spinner\n indetermine, plutot qu'une barre figee a 0 %. La bascule se fait a la premiere\n emission `ImportProgress` : une source qui n'en emet jamais reste sur le spinner.\n `displayText` a false : le libelle \u00AB Import en cours \u00BB est deja au-dessus. -->\n @if (progress(); as current) {\n <cw-progress-bar\n [value]=\"current.percent\"\n [type]=\"progressType.information\"\n [label]=\"'_COMMON._IMPORT.IN_PROGRESS' | translate\">\n </cw-progress-bar>\n }\n @else {\n <cw-loader [size]=\"loaderSize.sm\" [displayText]=\"false\"></cw-loader>\n }\n\n <!-- Pas de bouton d'arret quand l'objet declare l'import non interruptible : un\n bouton qui ne peut rien arreter serait pire que son absence. -->\n @if (canInterrupt()) {\n <div class=\"d-flex-h justify-end\">\n <cw-button\n [type]=\"buttonType.dangerOutline\"\n [label]=\"'_COMMON._IMPORT.STOP'\"\n [dataTest]=\"'btn-import-stop'\"\n (btnAction)=\"stopImport()\">\n </cw-button>\n </div>\n }\n }\n @else if (cancelling()) {\n <!-- Annulation demandee au serveur, reponse en attente. Cible de focus. -->\n <span tabindex=\"-1\" #cancellingStatus>{{ '_COMMON._IMPORT.CANCELLING' | translate }}</span>\n\n <cw-loader [size]=\"loaderSize.sm\" [displayText]=\"false\"></cw-loader>\n\n <!-- Sortie de secours : aucun delai n'etant defendable depuis la lib, c'est\n l'utilisateur qui decide d'arreter d'attendre. Conclut en \u00AB etat incertain \u00BB. -->\n <div class=\"d-flex-h justify-end\">\n <cw-button\n [type]=\"buttonType.secondary\"\n [label]=\"'_COMMON._IMPORT.STOP_WAITING'\"\n [dataTest]=\"'btn-import-stop-waiting'\"\n (btnAction)=\"stopWaiting()\">\n </cw-button>\n </div>\n }\n @else if (interruptionMessageKey(); as interruptionMessage) {\n <h3 class=\"visually-hidden\" tabindex=\"-1\" #interruptedOutcome>\n {{ '_COMMON._IMPORT._A11Y.IMPORT_RESULT' | translate }}\n </h3>\n\n <cw-alert [type]=\"interruptionAlertType()\">\n {{ interruptionMessage | translate }}\n </cw-alert>\n }\n @else if (report(); as result) {\n <h3 class=\"visually-hidden\" tabindex=\"-1\" #reportOutcome>\n {{ '_COMMON._IMPORT._A11Y.IMPORT_RESULT' | translate }}\n </h3>\n\n @if (result.success) {\n <cw-alert [type]=\"alertType.success\">\n {{ '_COMMON._IMPORT.SUCCESS' | translate }}\n </cw-alert>\n\n @if (isList() && reportRows().length) {\n <ng-container *ngTemplateOutlet=\"counts; context: { rows: reportRows() }\"></ng-container>\n }\n }\n @else {\n <!-- Le message generique ne promet l'absence d'ecriture que si l'atomicite est\n declaree (cf. `failureMessageKey`). -->\n <cw-alert [type]=\"alertType.danger\">\n {{ result.errorMessage ?? (failureMessageKey() | translate) }}\n </cw-alert>\n }\n }\n </div>\n </cw-card>\n\n</cw-accordion>\n" }]
1727
+ }], ctorParameters: () => [], propDecorators: { config: [{ type: i0.Input, args: [{ isSignal: true, alias: "config", required: true }] }], completed: [{ type: i0.Output, args: ["completed"] }], panels: [{ type: i0.ViewChildren, args: ['stepPanel', { ...{ read: CardComponent }, isSignal: true }] }], selectionTarget: [{ type: i0.ViewChild, args: ['selectionTarget', { isSignal: true }] }], analysisStatus: [{ type: i0.ViewChild, args: ['analysisStatus', { isSignal: true }] }], analysisOutcome: [{ type: i0.ViewChild, args: ['analysisOutcome', { isSignal: true }] }], executionStatus: [{ type: i0.ViewChild, args: ['executionStatus', { isSignal: true }] }], cancellingStatus: [{ type: i0.ViewChild, args: ['cancellingStatus', { isSignal: true }] }], reportOutcome: [{ type: i0.ViewChild, args: ['reportOutcome', { isSignal: true }] }], interruptedOutcome: [{ type: i0.ViewChild, args: ['interruptedOutcome', { isSignal: true }] }] } });
1728
+
1729
+ /**
1730
+ * Bouton « Importer » : ouvre `cw-import-wizard` dans une modale `sidepanel`.
1731
+ *
1732
+ * Le composant n'ajoute AUCUN metier ni aucun contrat : il transporte l'`ImportWizardConfig`
1733
+ * de l'hote **tel quel** jusqu'a l'assistant. Pas de type miroir, pas de champ recopie —
1734
+ * toute evolution du wizard est disponible ici sans modification symetrique.
1735
+ *
1736
+ * Ce qu'il apporte : le `ng-template` du corps de modale, l'ouverture au bon type et a la
1737
+ * bonne taille, et la separation des deux signaux de sortie que la SFD de l'assistant
1738
+ * impose de ne pas confondre (cf. `closed` / `completed`).
1739
+ */
1740
+ class ImportButtonComponent {
1741
+ constructor() {
1742
+ this.modals = inject(ModalsService);
1743
+ /** Parametrage de l'assistant, transmis tel quel a `cw-import-wizard`. */
1744
+ this.config = input.required(...(ngDevMode ? [{ debugName: "config" }] : []));
1745
+ /** Cle i18n du titre de la modale. */
1746
+ this.modalTitle = input.required(...(ngDevMode ? [{ debugName: "modalTitle" }] : []));
1747
+ /** Cle i18n du libelle du bouton. */
1748
+ this.label = input(i18nKey('_COMMON._ACTION.IMPORT'), ...(ngDevMode ? [{ debugName: "label" }] : []));
1749
+ this.disabled = input(false, ...(ngDevMode ? [{ debugName: "disabled" }] : []));
1750
+ /**
1751
+ * Modale fermee, par n'importe quel chemin : croix, Echap, clic sur le fond, bouton
1752
+ * « Fermer » du pied. **C'est ici que l'hote recharge ses donnees**, et non sur
1753
+ * `completed` : c'est le seul signal qui couvre la fermeture PENDANT un import, ou des
1754
+ * donnees ont pu etre ecrites sans qu'aucun rapport n'ait ete emis.
1755
+ */
1756
+ this.closed = output();
1757
+ /**
1758
+ * Etat terminal de l'assistant : succes, echec ou interruption. Relais direct de
1759
+ * `cw-import-wizard.completed`. Signal de RESULTAT — a reserver a ce qui depend de
1760
+ * l'issue (message, journalisation, action metier), jamais au rechargement.
1761
+ */
1762
+ this.completed = output();
1763
+ this.bodyTemplate = viewChild.required('bodyTemplate');
1764
+ this.buttonType = BoButtonTypeEnum;
1765
+ }
1766
+ open() {
1767
+ // Pas de `labelBtnAction1`/`2` : le pied par defaut rend exactement le « Fermer »
1768
+ // attendu, et tout bouton d'action configure ici FERMERAIT la modale — l'utilisateur
1769
+ // ne pourrait plus lire son rapport.
1770
+ const ref = this.modals.openModal(ModalsType.sidepanel, {
1771
+ modalTitle: this.modalTitle(),
1772
+ customBodyTemplate: this.bodyTemplate(),
1773
+ });
1774
+ // Les DEUX issues de la promesse mènent au meme geste. `closeModal()` la rejette
1775
+ // aujourd'hui, mais un chemin de fermeture qui la resoudrait (evolution de
1776
+ // `ModalsService`) doit emettre aussi. Traiter les deux marque en outre le rejet
1777
+ // comme gere : un `.catch()` seul laisserait passer l'autre cas en silence.
1778
+ const emitClosed = () => this.closed.emit();
1779
+ ref.result.then(emitClosed, emitClosed);
1780
+ }
1781
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: ImportButtonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
1782
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "20.3.20", type: ImportButtonComponent, isStandalone: true, selector: "cw-import-button", inputs: { config: { classPropertyName: "config", publicName: "config", isSignal: true, isRequired: true, transformFunction: null }, modalTitle: { classPropertyName: "modalTitle", publicName: "modalTitle", isSignal: true, isRequired: true, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { closed: "closed", completed: "completed" }, host: { classAttribute: "cw-import-button" }, viewQueries: [{ propertyName: "bodyTemplate", first: true, predicate: ["bodyTemplate"], descendants: true, isSignal: true }], ngImport: i0, template: "<cw-button [type]=\"buttonType.secondary\" [label]=\"label()\" [isDisabled]=\"disabled()\" (btnAction)=\"open()\">\n</cw-button>\n\n<!-- L'assistant n'est que le CORPS de la modale : titre, croix et bouton \u00AB Fermer \u00BB du\n pied viennent de `ModalsService`. Le composant ne ferme jamais la modale lui-meme. -->\n<ng-template #bodyTemplate>\n <cw-import-wizard [config]=\"config()\" (completed)=\"completed.emit($event)\"></cw-import-wizard>\n</ng-template>\n", dependencies: [{ kind: "component", type: ButtonComponent, selector: "cw-button", inputs: ["type", "label", "id", "link", "isDropdown", "hideCaret", "withIcon", "withOnlyIcon", "iconSize", "iconPosition", "dropdownPosition", "isMinWidth", "isDisabled", "isLoading", "cssClass", "dataTest", "skeletonMode", "withTooltip", "tooltipText", "tooltipTitle", "tooltipTrigger", "tooltipPosition", "tooltipType"], outputs: ["btnAction", "dropDownClicked"] }, { kind: "component", type: ImportWizardComponent, selector: "cw-import-wizard", inputs: ["config"], outputs: ["completed"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
1783
+ }
1784
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: ImportButtonComponent, decorators: [{
1785
+ type: Component,
1786
+ args: [{ selector: 'cw-import-button', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, host: { class: 'cw-import-button' }, imports: [ButtonComponent, ImportWizardComponent], template: "<cw-button [type]=\"buttonType.secondary\" [label]=\"label()\" [isDisabled]=\"disabled()\" (btnAction)=\"open()\">\n</cw-button>\n\n<!-- L'assistant n'est que le CORPS de la modale : titre, croix et bouton \u00AB Fermer \u00BB du\n pied viennent de `ModalsService`. Le composant ne ferme jamais la modale lui-meme. -->\n<ng-template #bodyTemplate>\n <cw-import-wizard [config]=\"config()\" (completed)=\"completed.emit($event)\"></cw-import-wizard>\n</ng-template>\n" }]
1787
+ }], propDecorators: { config: [{ type: i0.Input, args: [{ isSignal: true, alias: "config", required: true }] }], modalTitle: [{ type: i0.Input, args: [{ isSignal: true, alias: "modalTitle", required: true }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], closed: [{ type: i0.Output, args: ["closed"] }], completed: [{ type: i0.Output, args: ["completed"] }], bodyTemplate: [{ type: i0.ViewChild, args: ['bodyTemplate', { isSignal: true }] }] } });
1788
+
1789
+ /**
1790
+ * Actions rendues par `cw-page-header` lui-meme, sur simple declaration.
1791
+ *
1792
+ * L'import et l'export N'EN FONT PAS PARTIE : ils sont portes par `cw-import-button` et
1793
+ * `cw-export-button`, projetes dans les slots `cwPageHeaderImport` / `cwPageHeaderExport`.
1794
+ * Les rendre ici obligerait `cw-page-header` a referencer `cw-import-wizard`, donc a
1795
+ * embarquer l'assistant complet dans TOUTE page qui affiche un titre — un `@defer` n'y
1796
+ * change rien, ng-packagr aplatit la lib en un FESM unique et la reference reste statique.
1797
+ */
911
1798
  var PageHeaderActionEnum;
912
1799
  (function (PageHeaderActionEnum) {
913
1800
  PageHeaderActionEnum["add"] = "add";
914
1801
  PageHeaderActionEnum["save"] = "save";
915
1802
  PageHeaderActionEnum["reset"] = "reset";
916
- PageHeaderActionEnum["exportCurrent"] = "exportCurrent";
917
- PageHeaderActionEnum["exportAll"] = "exportAll";
918
- PageHeaderActionEnum["import"] = "import";
919
1803
  })(PageHeaderActionEnum || (PageHeaderActionEnum = {}));
920
1804
 
921
1805
  // Persistance de la visibilite des colonnes de `cw-table` (pilotee par `cw-page-header`).
@@ -993,10 +1877,6 @@ class PageHeaderComponent {
993
1877
  this.iconSize = ButtonIconSizeEnum;
994
1878
  this.spriteIcon = SpriteIconEnum;
995
1879
  this.actionEnum = PageHeaderActionEnum;
996
- this.hasExport = computed(() => this.actions().some(a => a === PageHeaderActionEnum.exportCurrent || a === PageHeaderActionEnum.exportAll), ...(ngDevMode ? [{ debugName: "hasExport" }] : []));
997
- this.showExportCurrent = computed(() => this.actions().includes(PageHeaderActionEnum.exportCurrent), ...(ngDevMode ? [{ debugName: "showExportCurrent" }] : []));
998
- this.showExportAll = computed(() => this.actions().includes(PageHeaderActionEnum.exportAll), ...(ngDevMode ? [{ debugName: "showExportAll" }] : []));
999
- this.showImport = computed(() => this.actions().includes(PageHeaderActionEnum.import), ...(ngDevMode ? [{ debugName: "showImport" }] : []));
1000
1880
  this.showReset = computed(() => this.actions().includes(PageHeaderActionEnum.reset), ...(ngDevMode ? [{ debugName: "showReset" }] : []));
1001
1881
  this.showAdd = computed(() => this.actions().includes(PageHeaderActionEnum.add), ...(ngDevMode ? [{ debugName: "showAdd" }] : []));
1002
1882
  this.showSave = computed(() => this.actions().includes(PageHeaderActionEnum.save), ...(ngDevMode ? [{ debugName: "showSave" }] : []));
@@ -1061,67 +1941,16 @@ class PageHeaderComponent {
1061
1941
  return !!this.isDisabled()[action];
1062
1942
  }
1063
1943
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: PageHeaderComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
1064
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.20", type: PageHeaderComponent, isStandalone: true, selector: "cw-page-header", inputs: { title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: true, transformFunction: null }, description: { classPropertyName: "description", publicName: "description", isSignal: true, isRequired: false, transformFunction: null }, showBack: { classPropertyName: "showBack", publicName: "showBack", isSignal: true, isRequired: false, transformFunction: null }, actions: { classPropertyName: "actions", publicName: "actions", isSignal: true, isRequired: false, transformFunction: null }, isLoading: { classPropertyName: "isLoading", publicName: "isLoading", isSignal: true, isRequired: false, transformFunction: null }, isDisabled: { classPropertyName: "isDisabled", publicName: "isDisabled", isSignal: true, isRequired: false, transformFunction: null }, columns: { classPropertyName: "columns", publicName: "columns", isSignal: true, isRequired: false, transformFunction: null }, storageKey: { classPropertyName: "storageKey", publicName: "storageKey", isSignal: true, isRequired: false, transformFunction: null }, columnsLabel: { classPropertyName: "columnsLabel", publicName: "columnsLabel", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { action: "action", columnsChange: "columnsChange" }, ngImport: i0, template: "<div class=\"page-header d-flex-v gap-2xs\">\n @if (showBack()) {\n <cw-button [type]=\"buttonType.ghost\" [label]=\"'_COMMON._FORM.BACK'\" [withIcon]=\"spriteIcon.left1\"\n (btnAction)=\"goBack()\" />\n }\n <div class=\"d-flex-h gap-md items-start justify-between flex-wrap\">\n <div class=\"d-flex-v\">\n <h1 class=\"page-header-title\">{{ title() | translate}}</h1>\n @if (description(); as desc) {\n <p class=\"fs-md page-header-description\" [innerHTML]=\"desc | translate\"></p>\n }\n </div>\n\n <div class=\"page-header-actions d-flex-h gap-md flex-wrap items-center\">\n @if (showColumns()) {\n <cw-button [type]=\"buttonType.secondary\" [label]=\"columnsLabel()\" [withIcon]=\"spriteIcon.view\"\n [isDropdown]=\"true\">\n <ul class=\"page-header-columns-menu\">\n @for (col of toggleableColumns(); track col.key) {\n <li class=\"field-check\">\n <input class=\"field-check-input\" type=\"checkbox\" [id]=\"'col-toggle-' + col.key\"\n [checked]=\"!col.hidden\" [disabled]=\"isLastVisible(col)\" (change)=\"toggleColumn(col)\">\n <label class=\"field-check-label\" [for]=\"'col-toggle-' + col.key\">{{ col.label | translate }}</label>\n </li>\n }\n </ul>\n </cw-button>\n }\n\n @if (showImport()) {\n <cw-button [type]=\"buttonType.secondary\" [label]=\"'_COMMON._ACTION.IMPORT'\"\n [isDisabled]=\"disabled(actionEnum.import)\" [isLoading]=\"loading(actionEnum.import)\"\n (btnAction)=\"emit(actionEnum.import)\">\n </cw-button>\n }\n\n @if (showReset()) {\n <cw-button [type]=\"buttonType.secondary\" [label]=\"'_COMMON._ACTION.RESET'\"\n [isDisabled]=\"disabled(actionEnum.reset)\" [isLoading]=\"loading(actionEnum.reset)\"\n (btnAction)=\"emit(actionEnum.reset)\">\n </cw-button>\n }\n\n @if (hasExport()) {\n <cw-button [type]=\"buttonType.secondary\" [label]=\"'_COMMON._ACTION.EXPORT'\" [isDropdown]=\"true\"\n [isDisabled]=\"disabled(actionEnum.exportCurrent) && disabled(actionEnum.exportAll)\">\n <ul>\n <li>\n @if (showExportCurrent()) {\n <cw-button [type]=\"buttonType.ghost\" [label]=\"'_COMMON._ACTION.EXPORT_CURRENT'\"\n [isDisabled]=\"disabled(actionEnum.exportCurrent)\" (btnAction)=\"emit(actionEnum.exportCurrent)\">\n </cw-button>\n }\n </li>\n <li>\n @if (showExportAll()) {\n <cw-button [type]=\"buttonType.ghost\" [label]=\"'_COMMON._ACTION.EXPORT_ALL'\"\n [isDisabled]=\"disabled(actionEnum.exportAll)\" (btnAction)=\"emit(actionEnum.exportAll)\">\n </cw-button>\n }\n </li>\n </ul>\n </cw-button>\n }\n\n <ng-content></ng-content>\n\n @if (showAdd()) {\n <cw-button [type]=\"buttonType.primary\" [label]=\"'_COMMON._ACTION.ADD'\" [withIcon]=\"spriteIcon.add\"\n [isDisabled]=\"disabled(actionEnum.add)\" [isLoading]=\"loading(actionEnum.add)\"\n (btnAction)=\"emit(actionEnum.add)\">\n </cw-button>\n }\n\n @if (showSave()) {\n <cw-button [type]=\"buttonType.primary\" [label]=\"'_COMMON._ACTION.SAVE'\" [isDisabled]=\"disabled(actionEnum.save)\"\n [isLoading]=\"loading(actionEnum.save)\" (btnAction)=\"emit(actionEnum.save)\">\n </cw-button>\n }\n </div>\n </div>\n</div>\n", dependencies: [{ kind: "component", type: ButtonComponent, selector: "cw-button", inputs: ["type", "label", "id", "link", "isDropdown", "hideCaret", "withIcon", "withOnlyIcon", "iconSize", "iconPosition", "dropdownPosition", "isMinWidth", "isDisabled", "isLoading", "cssClass", "dataTest", "skeletonMode", "withTooltip", "tooltipText", "tooltipTitle", "tooltipTrigger", "tooltipPosition", "tooltipType"], outputs: ["btnAction", "dropDownClicked"] }, { kind: "ngmodule", type: TranslateModule }, { kind: "pipe", type: i1$1.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
1944
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.20", type: PageHeaderComponent, isStandalone: true, selector: "cw-page-header", inputs: { title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: true, transformFunction: null }, description: { classPropertyName: "description", publicName: "description", isSignal: true, isRequired: false, transformFunction: null }, showBack: { classPropertyName: "showBack", publicName: "showBack", isSignal: true, isRequired: false, transformFunction: null }, actions: { classPropertyName: "actions", publicName: "actions", isSignal: true, isRequired: false, transformFunction: null }, isLoading: { classPropertyName: "isLoading", publicName: "isLoading", isSignal: true, isRequired: false, transformFunction: null }, isDisabled: { classPropertyName: "isDisabled", publicName: "isDisabled", isSignal: true, isRequired: false, transformFunction: null }, columns: { classPropertyName: "columns", publicName: "columns", isSignal: true, isRequired: false, transformFunction: null }, storageKey: { classPropertyName: "storageKey", publicName: "storageKey", isSignal: true, isRequired: false, transformFunction: null }, columnsLabel: { classPropertyName: "columnsLabel", publicName: "columnsLabel", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { action: "action", columnsChange: "columnsChange" }, ngImport: i0, template: "<div class=\"page-header d-flex-v gap-2xs\">\n @if (showBack()) {\n <cw-button [type]=\"buttonType.ghost\" [label]=\"'_COMMON._FORM.BACK'\" [withIcon]=\"spriteIcon.left1\"\n (btnAction)=\"goBack()\" />\n }\n <div class=\"d-flex-h gap-md items-start justify-between flex-wrap\">\n <div class=\"d-flex-v\">\n <h1 class=\"page-header-title\">{{ title() | translate}}</h1>\n @if (description(); as desc) {\n <p class=\"fs-md page-header-description\" [innerHTML]=\"desc | translate\"></p>\n }\n </div>\n\n <div class=\"page-header-actions d-flex-h gap-md flex-wrap items-center\">\n @if (showColumns()) {\n <cw-button [type]=\"buttonType.secondary\" [label]=\"columnsLabel()\" [withIcon]=\"spriteIcon.miscNews\"\n [isDropdown]=\"true\">\n <ul class=\"d-flex-v gap-2xs p-md\">\n @for (col of toggleableColumns(); track col.key) {\n <li class=\"field-check\">\n <input class=\"field-check-input\" type=\"checkbox\" [id]=\"'col-toggle-' + col.key\"\n [checked]=\"!col.hidden\" [disabled]=\"isLastVisible(col)\" (change)=\"toggleColumn(col)\">\n <label class=\"field-check-label\" [for]=\"'col-toggle-' + col.key\">{{ col.label | translate }}</label>\n </li>\n }\n </ul>\n </cw-button>\n }\n\n <!-- Slot de l'import : `<cw-import-button cwPageHeaderImport \u2026>`. Projete plutot que\n rendu, pour que `cw-page-header` ne reference pas `cw-import-wizard`. -->\n <ng-content select=\"[cwPageHeaderImport]\"></ng-content>\n\n @if (showReset()) {\n <cw-button [type]=\"buttonType.secondary\" [label]=\"'_COMMON._ACTION.RESET'\"\n [isDisabled]=\"disabled(actionEnum.reset)\" [isLoading]=\"loading(actionEnum.reset)\"\n (btnAction)=\"emit(actionEnum.reset)\">\n </cw-button>\n }\n\n <!-- Slot de l'export : `<cw-export-button cwPageHeaderExport \u2026>`. -->\n <ng-content select=\"[cwPageHeaderExport]\"></ng-content>\n\n <!-- Slot libre, inchange : tout ce qui n'est marque ni import ni export atterrit ici.\n C'est l'echappatoire d'un hote qui veut piloter son propre bouton. -->\n <ng-content></ng-content>\n\n @if (showAdd()) {\n <cw-button [type]=\"buttonType.primary\" [label]=\"'_COMMON._ACTION.ADD'\" [withIcon]=\"spriteIcon.add\"\n [isDisabled]=\"disabled(actionEnum.add)\" [isLoading]=\"loading(actionEnum.add)\"\n (btnAction)=\"emit(actionEnum.add)\">\n </cw-button>\n }\n\n @if (showSave()) {\n <cw-button [type]=\"buttonType.primary\" [label]=\"'_COMMON._ACTION.SAVE'\" [isDisabled]=\"disabled(actionEnum.save)\"\n [isLoading]=\"loading(actionEnum.save)\" (btnAction)=\"emit(actionEnum.save)\">\n </cw-button>\n }\n </div>\n </div>\n</div>\n", dependencies: [{ kind: "component", type: ButtonComponent, selector: "cw-button", inputs: ["type", "label", "id", "link", "isDropdown", "hideCaret", "withIcon", "withOnlyIcon", "iconSize", "iconPosition", "dropdownPosition", "isMinWidth", "isDisabled", "isLoading", "cssClass", "dataTest", "skeletonMode", "withTooltip", "tooltipText", "tooltipTitle", "tooltipTrigger", "tooltipPosition", "tooltipType"], outputs: ["btnAction", "dropDownClicked"] }, { kind: "ngmodule", type: TranslateModule }, { kind: "pipe", type: i1.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
1065
1945
  }
1066
1946
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: PageHeaderComponent, decorators: [{
1067
1947
  type: Component,
1068
1948
  args: [{ selector: 'cw-page-header', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, imports: [
1069
1949
  ButtonComponent,
1070
- DropdownItemDirective,
1071
1950
  TranslateModule
1072
- ], template: "<div class=\"page-header d-flex-v gap-2xs\">\n @if (showBack()) {\n <cw-button [type]=\"buttonType.ghost\" [label]=\"'_COMMON._FORM.BACK'\" [withIcon]=\"spriteIcon.left1\"\n (btnAction)=\"goBack()\" />\n }\n <div class=\"d-flex-h gap-md items-start justify-between flex-wrap\">\n <div class=\"d-flex-v\">\n <h1 class=\"page-header-title\">{{ title() | translate}}</h1>\n @if (description(); as desc) {\n <p class=\"fs-md page-header-description\" [innerHTML]=\"desc | translate\"></p>\n }\n </div>\n\n <div class=\"page-header-actions d-flex-h gap-md flex-wrap items-center\">\n @if (showColumns()) {\n <cw-button [type]=\"buttonType.secondary\" [label]=\"columnsLabel()\" [withIcon]=\"spriteIcon.view\"\n [isDropdown]=\"true\">\n <ul class=\"page-header-columns-menu\">\n @for (col of toggleableColumns(); track col.key) {\n <li class=\"field-check\">\n <input class=\"field-check-input\" type=\"checkbox\" [id]=\"'col-toggle-' + col.key\"\n [checked]=\"!col.hidden\" [disabled]=\"isLastVisible(col)\" (change)=\"toggleColumn(col)\">\n <label class=\"field-check-label\" [for]=\"'col-toggle-' + col.key\">{{ col.label | translate }}</label>\n </li>\n }\n </ul>\n </cw-button>\n }\n\n @if (showImport()) {\n <cw-button [type]=\"buttonType.secondary\" [label]=\"'_COMMON._ACTION.IMPORT'\"\n [isDisabled]=\"disabled(actionEnum.import)\" [isLoading]=\"loading(actionEnum.import)\"\n (btnAction)=\"emit(actionEnum.import)\">\n </cw-button>\n }\n\n @if (showReset()) {\n <cw-button [type]=\"buttonType.secondary\" [label]=\"'_COMMON._ACTION.RESET'\"\n [isDisabled]=\"disabled(actionEnum.reset)\" [isLoading]=\"loading(actionEnum.reset)\"\n (btnAction)=\"emit(actionEnum.reset)\">\n </cw-button>\n }\n\n @if (hasExport()) {\n <cw-button [type]=\"buttonType.secondary\" [label]=\"'_COMMON._ACTION.EXPORT'\" [isDropdown]=\"true\"\n [isDisabled]=\"disabled(actionEnum.exportCurrent) && disabled(actionEnum.exportAll)\">\n <ul>\n <li>\n @if (showExportCurrent()) {\n <cw-button [type]=\"buttonType.ghost\" [label]=\"'_COMMON._ACTION.EXPORT_CURRENT'\"\n [isDisabled]=\"disabled(actionEnum.exportCurrent)\" (btnAction)=\"emit(actionEnum.exportCurrent)\">\n </cw-button>\n }\n </li>\n <li>\n @if (showExportAll()) {\n <cw-button [type]=\"buttonType.ghost\" [label]=\"'_COMMON._ACTION.EXPORT_ALL'\"\n [isDisabled]=\"disabled(actionEnum.exportAll)\" (btnAction)=\"emit(actionEnum.exportAll)\">\n </cw-button>\n }\n </li>\n </ul>\n </cw-button>\n }\n\n <ng-content></ng-content>\n\n @if (showAdd()) {\n <cw-button [type]=\"buttonType.primary\" [label]=\"'_COMMON._ACTION.ADD'\" [withIcon]=\"spriteIcon.add\"\n [isDisabled]=\"disabled(actionEnum.add)\" [isLoading]=\"loading(actionEnum.add)\"\n (btnAction)=\"emit(actionEnum.add)\">\n </cw-button>\n }\n\n @if (showSave()) {\n <cw-button [type]=\"buttonType.primary\" [label]=\"'_COMMON._ACTION.SAVE'\" [isDisabled]=\"disabled(actionEnum.save)\"\n [isLoading]=\"loading(actionEnum.save)\" (btnAction)=\"emit(actionEnum.save)\">\n </cw-button>\n }\n </div>\n </div>\n</div>\n" }]
1951
+ ], template: "<div class=\"page-header d-flex-v gap-2xs\">\n @if (showBack()) {\n <cw-button [type]=\"buttonType.ghost\" [label]=\"'_COMMON._FORM.BACK'\" [withIcon]=\"spriteIcon.left1\"\n (btnAction)=\"goBack()\" />\n }\n <div class=\"d-flex-h gap-md items-start justify-between flex-wrap\">\n <div class=\"d-flex-v\">\n <h1 class=\"page-header-title\">{{ title() | translate}}</h1>\n @if (description(); as desc) {\n <p class=\"fs-md page-header-description\" [innerHTML]=\"desc | translate\"></p>\n }\n </div>\n\n <div class=\"page-header-actions d-flex-h gap-md flex-wrap items-center\">\n @if (showColumns()) {\n <cw-button [type]=\"buttonType.secondary\" [label]=\"columnsLabel()\" [withIcon]=\"spriteIcon.miscNews\"\n [isDropdown]=\"true\">\n <ul class=\"d-flex-v gap-2xs p-md\">\n @for (col of toggleableColumns(); track col.key) {\n <li class=\"field-check\">\n <input class=\"field-check-input\" type=\"checkbox\" [id]=\"'col-toggle-' + col.key\"\n [checked]=\"!col.hidden\" [disabled]=\"isLastVisible(col)\" (change)=\"toggleColumn(col)\">\n <label class=\"field-check-label\" [for]=\"'col-toggle-' + col.key\">{{ col.label | translate }}</label>\n </li>\n }\n </ul>\n </cw-button>\n }\n\n <!-- Slot de l'import : `<cw-import-button cwPageHeaderImport \u2026>`. Projete plutot que\n rendu, pour que `cw-page-header` ne reference pas `cw-import-wizard`. -->\n <ng-content select=\"[cwPageHeaderImport]\"></ng-content>\n\n @if (showReset()) {\n <cw-button [type]=\"buttonType.secondary\" [label]=\"'_COMMON._ACTION.RESET'\"\n [isDisabled]=\"disabled(actionEnum.reset)\" [isLoading]=\"loading(actionEnum.reset)\"\n (btnAction)=\"emit(actionEnum.reset)\">\n </cw-button>\n }\n\n <!-- Slot de l'export : `<cw-export-button cwPageHeaderExport \u2026>`. -->\n <ng-content select=\"[cwPageHeaderExport]\"></ng-content>\n\n <!-- Slot libre, inchange : tout ce qui n'est marque ni import ni export atterrit ici.\n C'est l'echappatoire d'un hote qui veut piloter son propre bouton. -->\n <ng-content></ng-content>\n\n @if (showAdd()) {\n <cw-button [type]=\"buttonType.primary\" [label]=\"'_COMMON._ACTION.ADD'\" [withIcon]=\"spriteIcon.add\"\n [isDisabled]=\"disabled(actionEnum.add)\" [isLoading]=\"loading(actionEnum.add)\"\n (btnAction)=\"emit(actionEnum.add)\">\n </cw-button>\n }\n\n @if (showSave()) {\n <cw-button [type]=\"buttonType.primary\" [label]=\"'_COMMON._ACTION.SAVE'\" [isDisabled]=\"disabled(actionEnum.save)\"\n [isLoading]=\"loading(actionEnum.save)\" (btnAction)=\"emit(actionEnum.save)\">\n </cw-button>\n }\n </div>\n </div>\n</div>\n" }]
1073
1952
  }], ctorParameters: () => [], propDecorators: { title: [{ type: i0.Input, args: [{ isSignal: true, alias: "title", required: true }] }], description: [{ type: i0.Input, args: [{ isSignal: true, alias: "description", required: false }] }], showBack: [{ type: i0.Input, args: [{ isSignal: true, alias: "showBack", required: false }] }], actions: [{ type: i0.Input, args: [{ isSignal: true, alias: "actions", required: false }] }], isLoading: [{ type: i0.Input, args: [{ isSignal: true, alias: "isLoading", required: false }] }], isDisabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "isDisabled", required: false }] }], columns: [{ type: i0.Input, args: [{ isSignal: true, alias: "columns", required: false }] }], storageKey: [{ type: i0.Input, args: [{ isSignal: true, alias: "storageKey", required: false }] }], columnsLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "columnsLabel", required: false }] }], action: [{ type: i0.Output, args: ["action"] }], columnsChange: [{ type: i0.Output, args: ["columnsChange"] }] } });
1074
1953
 
1075
- // Modele du composant `cw-progress-bar` — types alignes sur le DS (BOU)
1076
- // pages Figma `Progressbar / md` et `Progressbar / sm`.
1077
- /** Hauteur de la barre. md = 1rem (16px, libelle inline possible) / sm = 0.5rem (8px). */
1078
- var ProgressBarSizeEnum;
1079
- (function (ProgressBarSizeEnum) {
1080
- ProgressBarSizeEnum["md"] = "md";
1081
- ProgressBarSizeEnum["sm"] = "sm";
1082
- })(ProgressBarSizeEnum || (ProgressBarSizeEnum = {}));
1083
- /** Couleur de remplissage. Mappe sur les tokens DS `component/progressbar/{type}`. */
1084
- var ProgressBarTypeEnum;
1085
- (function (ProgressBarTypeEnum) {
1086
- ProgressBarTypeEnum["information"] = "information";
1087
- ProgressBarTypeEnum["success"] = "success";
1088
- ProgressBarTypeEnum["warning"] = "warning";
1089
- ProgressBarTypeEnum["danger"] = "danger";
1090
- })(ProgressBarTypeEnum || (ProgressBarTypeEnum = {}));
1091
-
1092
- class ProgressBarComponent {
1093
- constructor() {
1094
- /** Valeur courante d'avancement. Bornee a `[0, max]` pour le calcul du pourcentage. */
1095
- this.value = input.required(...(ngDevMode ? [{ debugName: "value" }] : []));
1096
- /** Valeur maximale (100% de la barre). Defaut `100`. */
1097
- this.max = input(100, ...(ngDevMode ? [{ debugName: "max" }] : []));
1098
- /** Hauteur de la barre. Defaut `md`. */
1099
- this.size = input(ProgressBarSizeEnum.md, ...(ngDevMode ? [{ debugName: "size" }] : []));
1100
- /** Couleur de remplissage. Defaut `information`. */
1101
- this.type = input(ProgressBarTypeEnum.information, ...(ngDevMode ? [{ debugName: "type" }] : []));
1102
- /** Affiche le pourcentage dans la barre. Uniquement en taille `md` (DS). Defaut `false`. */
1103
- this.showValue = input(false, ...(ngDevMode ? [{ debugName: "showValue" }] : []));
1104
- /** Libelle accessible (aria-label). A fournir si la barre n'est pas deja decrite par un texte voisin. */
1105
- this.label = input(...(ngDevMode ? [undefined, { debugName: "label" }] : []));
1106
- /** Attribut `data-test-ctw` pour le ciblage en test E2E. */
1107
- this.dataTest = input(...(ngDevMode ? [undefined, { debugName: "dataTest" }] : []));
1108
- /** Pourcentage borne `0..100` (arrondi) pilotant la largeur du remplissage. */
1109
- this.percent = computed(() => {
1110
- const max = this.max() || 100;
1111
- const ratio = (this.value() / max) * 100;
1112
- return Math.max(0, Math.min(100, Math.round(ratio)));
1113
- }, ...(ngDevMode ? [{ debugName: "percent" }] : []));
1114
- /** Le libelle inline n'existe qu'en `md` (le DS ne fournit pas de couleur `on-*` en `sm`). */
1115
- this.showInlineValue = computed(() => this.showValue() && this.size() === ProgressBarSizeEnum.md, ...(ngDevMode ? [{ debugName: "showInlineValue" }] : []));
1116
- }
1117
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: ProgressBarComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
1118
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.20", type: ProgressBarComponent, isStandalone: true, selector: "cw-progress-bar", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: true, transformFunction: null }, max: { classPropertyName: "max", publicName: "max", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: false, transformFunction: null }, showValue: { classPropertyName: "showValue", publicName: "showValue", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, dataTest: { classPropertyName: "dataTest", publicName: "dataTest", isSignal: true, isRequired: false, transformFunction: null } }, host: { classAttribute: "cw-progressbar" }, ngImport: i0, template: "<div\n [class]=\"'progress-bar progress-bar-' + size() + ' progress-bar-' + type()\"\n role=\"progressbar\"\n [attr.aria-valuenow]=\"value()\"\n aria-valuemin=\"0\"\n [attr.aria-valuemax]=\"max()\"\n [attr.aria-label]=\"label() ?? null\"\n [attr.data-test-ctw]=\"dataTest() ?? null\">\n <div class=\"progress-bar-fill\" [style.width.%]=\"percent()\">\n @if (showInlineValue()) {\n <span class=\"progress-bar-value\">{{ percent() }}%</span>\n }\n </div>\n</div>\n" }); }
1119
- }
1120
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: ProgressBarComponent, decorators: [{
1121
- type: Component,
1122
- args: [{ selector: 'cw-progress-bar', standalone: true, host: { class: 'cw-progressbar' }, template: "<div\n [class]=\"'progress-bar progress-bar-' + size() + ' progress-bar-' + type()\"\n role=\"progressbar\"\n [attr.aria-valuenow]=\"value()\"\n aria-valuemin=\"0\"\n [attr.aria-valuemax]=\"max()\"\n [attr.aria-label]=\"label() ?? null\"\n [attr.data-test-ctw]=\"dataTest() ?? null\">\n <div class=\"progress-bar-fill\" [style.width.%]=\"percent()\">\n @if (showInlineValue()) {\n <span class=\"progress-bar-value\">{{ percent() }}%</span>\n }\n </div>\n</div>\n" }]
1123
- }], propDecorators: { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: true }] }], max: [{ type: i0.Input, args: [{ isSignal: true, alias: "max", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], type: [{ type: i0.Input, args: [{ isSignal: true, alias: "type", required: false }] }], showValue: [{ type: i0.Input, args: [{ isSignal: true, alias: "showValue", required: false }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], dataTest: [{ type: i0.Input, args: [{ isSignal: true, alias: "dataTest", required: false }] }] } });
1124
-
1125
1954
  class WizardStepComponent {
1126
1955
  constructor() {
1127
1956
  this.title = input.required(...(ngDevMode ? [{ debugName: "title" }] : []));
@@ -1186,14 +2015,14 @@ class WizardStepperComponent {
1186
2015
  }
1187
2016
  }
1188
2017
  endWizard() {
2018
+ // Appele uniquement depuis le bouton « Terminer » (derniere etape) : pas de garde
2019
+ // sur l'index, sinon un wizard mono-etape (index 0 = derniere) n'emettrait jamais stepEnd.
1189
2020
  const current = this.selectedIndex();
1190
- if (current > 0) {
1191
- this.stepEnd.emit(current);
1192
- this.stepChange.emit(current);
1193
- }
2021
+ this.stepEnd.emit(current);
2022
+ this.stepChange.emit(current);
1194
2023
  }
1195
2024
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: WizardStepperComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
1196
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.20", type: WizardStepperComponent, isStandalone: true, selector: "cw-wizard-stepper", outputs: { stepChange: "stepChange", stepNext: "stepNext", stepPrevious: "stepPrevious", stepEnd: "stepEnd" }, queries: [{ propertyName: "steps", predicate: WizardStepComponent, isSignal: true }], ngImport: i0, template: "<nav>\n <ul class=\"list-inline step-list\">\n @for (step of steps(); track step; let i = $index) {\n <li class=\"list-inline-item step-item\">\n <button class=\"btn step-button\" [ngClass]=\"{\n 'step-active': selectedIndex() === i,\n 'step-completed': step.completed(),\n 'step-current': selectedIndex() === i && step.completed() === false\n }\" [disabled]=\"(i > 0 && !steps()[i - 1]?.completed())\" (click)=\"goToStep(i)\" type=\"button\">\n <cw-icon class=\"step-indicator\" [icon]=\"spriteIcon.checkCircle\" aria-hidden=\"true\"></cw-icon>\n <span class=\"step-label\">\n {{ step.title() || ('_COMMON._STEPPER.STEP' | translate) + (i + 1) }}\n </span>\n </button>\n </li>\n }\n </ul>\n</nav>\n\n@for (step of steps(); track step; let i = $index) {\n <section class=\"tab-pane\" [class.active]=\"selectedIndex() === i\" [hidden]=\"selectedIndex() !== i\" role=\"tabpanel\">\n <ng-container *ngTemplateOutlet=\"step.templateRef()\"></ng-container>\n </section>\n}\n\n<div class=\"text-center mt-5\">\n <div class=\"btn-group\">\n <button class=\"btn btn-secondary btn-min-width\" (click)=\"previousStep()\" [disabled]=\"selectedIndex() === 0\"\n type=\"button\">\n {{ '_COMMON._STEPPER.PREVIOUS_STEP' | translate }}\n </button>\n\n @if (selectedIndex() !== steps().length - 1) {\n <button class=\"btn btn-primary btn-min-width\" (click)=\"nextStep()\"\n [disabled]=\"!steps()[selectedIndex()]?.completed()\" type=\"button\">\n {{ '_COMMON._STEPPER.NEXT_STEP' | translate }}\n </button>\n }\n @else {\n <button class=\"btn btn-primary btn-min-width\" (click)=\"endWizard()\" type=\"button\">\n {{ '_COMMON._ACTION.END' | translate }}\n </button>\n }\n </div>\n</div>\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "ngmodule", type: TranslateModule }, { kind: "component", type: IconComponent, selector: "cw-icon", inputs: ["icon", "label", "type", "iconSize", "iconCssClass", "iconUiType", "iconColorCustom", "spritePath"] }, { kind: "pipe", type: i1$1.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
2025
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.20", type: WizardStepperComponent, isStandalone: true, selector: "cw-wizard-stepper", outputs: { stepChange: "stepChange", stepNext: "stepNext", stepPrevious: "stepPrevious", stepEnd: "stepEnd" }, queries: [{ propertyName: "steps", predicate: WizardStepComponent, isSignal: true }], ngImport: i0, template: "<nav>\n <ul class=\"list-inline step-list\" role=\"tablist\">\n @for (step of steps(); track step; let i = $index) {\n <li class=\"list-inline-item step-item\" role=\"presentation\">\n <button class=\"btn step-button\" role=\"tab\" [id]=\"'cw-wizard-tab-' + i\"\n [attr.aria-selected]=\"selectedIndex() === i\" [attr.aria-controls]=\"'cw-wizard-panel-' + i\"\n [ngClass]=\"{\n 'step-active': selectedIndex() === i,\n 'step-completed': step.completed(),\n 'step-current': selectedIndex() === i && step.completed() === false\n }\" [disabled]=\"(i > 0 && !steps()[i - 1]?.completed())\" (click)=\"goToStep(i)\" type=\"button\">\n <cw-icon class=\"step-indicator\" [icon]=\"spriteIcon.checkCircle\" aria-hidden=\"true\"></cw-icon>\n <span class=\"step-label\">\n {{ step.title() || ('_COMMON._STEPPER.STEP' | translate) + (i + 1) }}\n </span>\n </button>\n </li>\n }\n </ul>\n</nav>\n\n@for (step of steps(); track step; let i = $index) {\n <section class=\"tab-pane\" [class.active]=\"selectedIndex() === i\" [hidden]=\"selectedIndex() !== i\"\n role=\"tabpanel\" [id]=\"'cw-wizard-panel-' + i\" [attr.aria-labelledby]=\"'cw-wizard-tab-' + i\"\n [attr.tabindex]=\"selectedIndex() === i ? 0 : null\">\n <ng-container *ngTemplateOutlet=\"step.templateRef()\"></ng-container>\n </section>\n}\n\n<div class=\"text-center mt-5\">\n <div class=\"btn-group\">\n <button class=\"btn btn-secondary btn-min-width\" (click)=\"previousStep()\" [disabled]=\"selectedIndex() === 0\"\n type=\"button\">\n {{ '_COMMON._STEPPER.PREVIOUS_STEP' | translate }}\n </button>\n\n @if (selectedIndex() !== steps().length - 1) {\n <button class=\"btn btn-primary btn-min-width\" (click)=\"nextStep()\"\n [disabled]=\"!steps()[selectedIndex()]?.completed()\" type=\"button\">\n {{ '_COMMON._STEPPER.NEXT_STEP' | translate }}\n </button>\n }\n @else {\n <button class=\"btn btn-primary btn-min-width\" (click)=\"endWizard()\" type=\"button\">\n {{ '_COMMON._ACTION.END' | translate }}\n </button>\n }\n </div>\n</div>\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1$3.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1$3.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "ngmodule", type: TranslateModule }, { kind: "component", type: IconComponent, selector: "cw-icon", inputs: ["icon", "label", "type", "iconSize", "iconCssClass", "iconUiType", "iconColorCustom", "spritePath"] }, { kind: "pipe", type: i1.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
1197
2026
  }
1198
2027
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: WizardStepperComponent, decorators: [{
1199
2028
  type: Component,
@@ -1201,9 +2030,19 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.20", ngImpo
1201
2030
  CommonModule,
1202
2031
  TranslateModule,
1203
2032
  IconComponent
1204
- ], template: "<nav>\n <ul class=\"list-inline step-list\">\n @for (step of steps(); track step; let i = $index) {\n <li class=\"list-inline-item step-item\">\n <button class=\"btn step-button\" [ngClass]=\"{\n 'step-active': selectedIndex() === i,\n 'step-completed': step.completed(),\n 'step-current': selectedIndex() === i && step.completed() === false\n }\" [disabled]=\"(i > 0 && !steps()[i - 1]?.completed())\" (click)=\"goToStep(i)\" type=\"button\">\n <cw-icon class=\"step-indicator\" [icon]=\"spriteIcon.checkCircle\" aria-hidden=\"true\"></cw-icon>\n <span class=\"step-label\">\n {{ step.title() || ('_COMMON._STEPPER.STEP' | translate) + (i + 1) }}\n </span>\n </button>\n </li>\n }\n </ul>\n</nav>\n\n@for (step of steps(); track step; let i = $index) {\n <section class=\"tab-pane\" [class.active]=\"selectedIndex() === i\" [hidden]=\"selectedIndex() !== i\" role=\"tabpanel\">\n <ng-container *ngTemplateOutlet=\"step.templateRef()\"></ng-container>\n </section>\n}\n\n<div class=\"text-center mt-5\">\n <div class=\"btn-group\">\n <button class=\"btn btn-secondary btn-min-width\" (click)=\"previousStep()\" [disabled]=\"selectedIndex() === 0\"\n type=\"button\">\n {{ '_COMMON._STEPPER.PREVIOUS_STEP' | translate }}\n </button>\n\n @if (selectedIndex() !== steps().length - 1) {\n <button class=\"btn btn-primary btn-min-width\" (click)=\"nextStep()\"\n [disabled]=\"!steps()[selectedIndex()]?.completed()\" type=\"button\">\n {{ '_COMMON._STEPPER.NEXT_STEP' | translate }}\n </button>\n }\n @else {\n <button class=\"btn btn-primary btn-min-width\" (click)=\"endWizard()\" type=\"button\">\n {{ '_COMMON._ACTION.END' | translate }}\n </button>\n }\n </div>\n</div>\n" }]
2033
+ ], template: "<nav>\n <ul class=\"list-inline step-list\" role=\"tablist\">\n @for (step of steps(); track step; let i = $index) {\n <li class=\"list-inline-item step-item\" role=\"presentation\">\n <button class=\"btn step-button\" role=\"tab\" [id]=\"'cw-wizard-tab-' + i\"\n [attr.aria-selected]=\"selectedIndex() === i\" [attr.aria-controls]=\"'cw-wizard-panel-' + i\"\n [ngClass]=\"{\n 'step-active': selectedIndex() === i,\n 'step-completed': step.completed(),\n 'step-current': selectedIndex() === i && step.completed() === false\n }\" [disabled]=\"(i > 0 && !steps()[i - 1]?.completed())\" (click)=\"goToStep(i)\" type=\"button\">\n <cw-icon class=\"step-indicator\" [icon]=\"spriteIcon.checkCircle\" aria-hidden=\"true\"></cw-icon>\n <span class=\"step-label\">\n {{ step.title() || ('_COMMON._STEPPER.STEP' | translate) + (i + 1) }}\n </span>\n </button>\n </li>\n }\n </ul>\n</nav>\n\n@for (step of steps(); track step; let i = $index) {\n <section class=\"tab-pane\" [class.active]=\"selectedIndex() === i\" [hidden]=\"selectedIndex() !== i\"\n role=\"tabpanel\" [id]=\"'cw-wizard-panel-' + i\" [attr.aria-labelledby]=\"'cw-wizard-tab-' + i\"\n [attr.tabindex]=\"selectedIndex() === i ? 0 : null\">\n <ng-container *ngTemplateOutlet=\"step.templateRef()\"></ng-container>\n </section>\n}\n\n<div class=\"text-center mt-5\">\n <div class=\"btn-group\">\n <button class=\"btn btn-secondary btn-min-width\" (click)=\"previousStep()\" [disabled]=\"selectedIndex() === 0\"\n type=\"button\">\n {{ '_COMMON._STEPPER.PREVIOUS_STEP' | translate }}\n </button>\n\n @if (selectedIndex() !== steps().length - 1) {\n <button class=\"btn btn-primary btn-min-width\" (click)=\"nextStep()\"\n [disabled]=\"!steps()[selectedIndex()]?.completed()\" type=\"button\">\n {{ '_COMMON._STEPPER.NEXT_STEP' | translate }}\n </button>\n }\n @else {\n <button class=\"btn btn-primary btn-min-width\" (click)=\"endWizard()\" type=\"button\">\n {{ '_COMMON._ACTION.END' | translate }}\n </button>\n }\n </div>\n</div>\n" }]
1205
2034
  }], propDecorators: { steps: [{ type: i0.ContentChildren, args: [i0.forwardRef(() => WizardStepComponent), { isSignal: true }] }], stepChange: [{ type: i0.Output, args: ["stepChange"] }], stepNext: [{ type: i0.Output, args: ["stepNext"] }], stepPrevious: [{ type: i0.Output, args: ["stepPrevious"] }], stepEnd: [{ type: i0.Output, args: ["stepEnd"] }] } });
1206
2035
 
2036
+ // Modele du composant `cw-export-button`.
2037
+ //
2038
+ // Frontiere lib / metier : le composant possede le declenchement, l'etat de progression,
2039
+ // la restitution et le transport du fichier. Il ne connait NI le format exporte, NI la
2040
+ // facon de nommer le fichier, NI ce qui est exporte. L'hote serialise et nomme ; la lib
2041
+ // ne fait que remettre le resultat au navigateur.
2042
+ //
2043
+ // Consequence directe : aucune dependance a `xlsx`, `file-saver` ou quoi que ce soit
2044
+ // d'autre. JSON, CSV, XLSX, PDF sont indifferents au composant.
2045
+
1207
2046
  function buildFilterParams(filters, keyMap) {
1208
2047
  let params = new HttpParams();
1209
2048
  for (const [key, value] of Object.entries(filters)) {
@@ -1236,5 +2075,5 @@ function buildFilterParams(filters, keyMap) {
1236
2075
  * Generated bundle index. Do not edit.
1237
2076
  */
1238
2077
 
1239
- export { ArrayAdapter, CustomListComponent, DragNDropListComponent, DragNDropNestedListComponent, FilterBarComponent, FormArrayAdapter, PageHeaderActionEnum, PageHeaderComponent, PaginationComponent, ProgressBarComponent, ProgressBarSizeEnum, ProgressBarTypeEnum, TableComponent, WizardStepComponent, WizardStepperComponent, buildFilterParams, loadHiddenColumns, saveHiddenColumns };
2078
+ export { ArrayAdapter, CustomListComponent, DragNDropListComponent, DragNDropNestedListComponent, ExportButtonComponent, FilterBarComponent, FormArrayAdapter, IMPORT_WIZARD_STEPS, ImportButtonComponent, ImportEventKindEnum, ImportInterruptionEnum, ImportInterruptionStateEnum, ImportModeEnum, ImportScopeEnum, ImportWizardComponent, ImportWizardStepEnum, ImportWizardStepStateEnum, PageHeaderActionEnum, PageHeaderComponent, PaginationComponent, ProgressBarComponent, ProgressBarSizeEnum, ProgressBarTypeEnum, TableComponent, WizardStepComponent, WizardStepperComponent, buildFilename, buildFilterParams, downloadBlob, formatCount, i18nKey, importWizardStepRank, jsonBlob, loadHiddenColumns, pluralizedCountKey, saveHiddenColumns, todayIsoDate };
1240
2079
  //# sourceMappingURL=cityway-bo-ui.mjs.map