@cityway/bo-ui 1.1.0-beta024 → 1.1.0-beta025

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,5 +1,5 @@
1
1
  import * as i0 from '@angular/core';
2
- import { input, ChangeDetectionStrategy, Component, output, effect, signal, computed, untracked, isDevMode, InjectionToken, makeEnvironmentProviders, inject, contentChild, isSignal, DestroyRef, viewChildren, viewChild, afterRenderEffect, afterNextRender, contentChildren } from '@angular/core';
2
+ import { input, ChangeDetectionStrategy, Component, output, effect, signal, computed, untracked, isDevMode, InjectionToken, makeEnvironmentProviders, inject, contentChild, isSignal, afterNextRender, DestroyRef, Injector, ElementRef, viewChild, viewChildren, afterRenderEffect, contentChildren } from '@angular/core';
3
3
  import * as i1 from '@ngx-translate/core';
4
4
  import { TranslateModule, TranslateService } from '@ngx-translate/core';
5
5
  import * as i1$3 from '@angular/common';
@@ -7,10 +7,10 @@ import { DatePipe, NgClass, NgTemplateOutlet, Location, CommonModule } from '@an
7
7
  import * as i1$1 from '@angular/cdk/drag-drop';
8
8
  import { moveItemInArray, transferArrayItem, DragDropModule } from '@angular/cdk/drag-drop';
9
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 { RouterLink, Router, ActivatedRoute } from '@angular/router';
10
11
  import { takeUntilDestroyed, toSignal, toObservable } from '@angular/core/rxjs-interop';
11
12
  import * as i1$2 from '@angular/forms';
12
13
  import { FormControl, ReactiveFormsModule, FormGroup } from '@angular/forms';
13
- import { Router, ActivatedRoute } from '@angular/router';
14
14
  import { switchMap, startWith, debounceTime, take, map } from 'rxjs';
15
15
  import * as i2 from '@ng-select/ng-select';
16
16
  import { NgSelectModule } from '@ng-select/ng-select';
@@ -151,7 +151,7 @@ class DragNDropListComponent {
151
151
  this.activeItemsChange.emit(this.activeItems());
152
152
  }
153
153
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: DragNDropListComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
154
- 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\">\n <div class=\"col-lg-6 d-flex-v gap-4xs\">\n <div class=\"fs fs-xs fw-bold\">{{ availableColumn().title | translate }}</div>\n @if (availableColumn().description; as description) {\n <p class=\"fs fs-xs\">{{ description | translate }}</p>\n }\n @if (availableColumn().descriptionRwd; as descriptionRwd) {\n <p class=\"d-sm-none fs fs-xs\" [innerHTML]=\"descriptionRwd | translate\"></p>\n }\n <ul class=\"list-unstyled drag-drop-list-column drag-drop-list-column-available\" [ngClass]=\"availableColumn().cssClass\"\n cdkDropList #availableList=\"cdkDropList\"\n [cdkDropListData]=\"_available\"\n [cdkDropListConnectedTo]=\"[activeList]\"\n (cdkDropListDropped)=\"drop($event)\">\n @for (item of _available; track item.id) {\n <li cdkDrag [cdkDragDisabled]=\"item.disabled ?? false\">\n <cw-card>\n <ng-container *ngTemplateOutlet=\"itemTemplate() || defaultTemplate; context: { $implicit: item }\"/>\n </cw-card>\n </li>\n }\n </ul>\n </div>\n\n <div class=\"col-lg-6 d-flex-v gap-4xs\">\n <div class=\"fs fs-xs fw-bold\">{{ activeColumn().title | translate }}</div>\n @if (activeColumn().description; as description) {\n <p class=\"fs fs-xs\">{{ description | translate }}</p>\n }\n @if (activeColumn().descriptionRwd; as descriptionRwd) {\n <p class=\"d-sm-none fs fs-xs\" [innerHTML]=\"descriptionRwd | translate\"></p>\n }\n <ul class=\"list-unstyled drag-drop-list-column drag-drop-list-column-active\" [ngClass]=\"activeColumn().cssClass\"\n cdkDropList #activeList=\"cdkDropList\"\n [cdkDropListData]=\"_active\"\n [cdkDropListConnectedTo]=\"[availableList]\"\n (cdkDropListDropped)=\"drop($event)\">\n @for (item of _active; track item.id) {\n <li cdkDrag [cdkDragDisabled]=\"item.disabled ?? false\">\n <cw-card>\n <ng-container *ngTemplateOutlet=\"itemTemplate() || defaultTemplate; context: { $implicit: item }\"/>\n </cw-card>\n </li>\n }\n </ul>\n </div>\n</div>\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: "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", "truncateSubtitle", "type", "titleRank", "cssClass", "collapsible", "collapsed", "disabled", "collapseLocked", "collapseStretched", "collapseId", "destroyOnHide", "fullHeight"], outputs: ["collapsibleChange", "destroyOnHideChange", "collapseClicked"] }, { kind: "pipe", type: i1.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
154
+ 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\">\n <div class=\"col-lg-6 d-flex-v gap-4xs\">\n <div class=\"fs fs-xs fw-bold\">{{ availableColumn().title | translate }}</div>\n @if (availableColumn().description; as description) {\n <p class=\"fs fs-xs\">{{ description | translate }}</p>\n }\n @if (availableColumn().descriptionRwd; as descriptionRwd) {\n <p class=\"d-sm-none fs fs-xs\" [innerHTML]=\"descriptionRwd | translate\"></p>\n }\n <ul class=\"list-unstyled drag-drop-list-column drag-drop-list-column-available\" [ngClass]=\"availableColumn().cssClass\"\n cdkDropList #availableList=\"cdkDropList\"\n [cdkDropListData]=\"_available\"\n [cdkDropListConnectedTo]=\"[activeList]\"\n (cdkDropListDropped)=\"drop($event)\">\n @for (item of _available; track item.id) {\n <li cdkDrag [cdkDragDisabled]=\"item.disabled ?? false\">\n <cw-card>\n <ng-container *ngTemplateOutlet=\"itemTemplate() || defaultTemplate; context: { $implicit: item }\"/>\n </cw-card>\n </li>\n }\n </ul>\n </div>\n\n <div class=\"col-lg-6 d-flex-v gap-4xs\">\n <div class=\"fs fs-xs fw-bold\">{{ activeColumn().title | translate }}</div>\n @if (activeColumn().description; as description) {\n <p class=\"fs fs-xs\">{{ description | translate }}</p>\n }\n @if (activeColumn().descriptionRwd; as descriptionRwd) {\n <p class=\"d-sm-none fs fs-xs\" [innerHTML]=\"descriptionRwd | translate\"></p>\n }\n <ul class=\"list-unstyled drag-drop-list-column drag-drop-list-column-active\" [ngClass]=\"activeColumn().cssClass\"\n cdkDropList #activeList=\"cdkDropList\"\n [cdkDropListData]=\"_active\"\n [cdkDropListConnectedTo]=\"[availableList]\"\n (cdkDropListDropped)=\"drop($event)\">\n @for (item of _active; track item.id) {\n <li cdkDrag [cdkDragDisabled]=\"item.disabled ?? false\">\n <cw-card>\n <ng-container *ngTemplateOutlet=\"itemTemplate() || defaultTemplate; context: { $implicit: item }\"/>\n </cw-card>\n </li>\n }\n </ul>\n </div>\n</div>\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: "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", "titleId", "subtitle", "truncateSubtitle", "type", "titleRank", "cssClass", "collapsible", "collapsed", "disabled", "collapseLocked", "collapseStretched", "collapseId", "destroyOnHide", "fullHeight"], outputs: ["collapsibleChange", "destroyOnHideChange", "collapseClicked"] }, { kind: "pipe", type: i1.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
155
155
  }
156
156
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: DragNDropListComponent, decorators: [{
157
157
  type: Component,
@@ -468,7 +468,7 @@ class DragNDropNestedListComponent {
468
468
  }));
469
469
  }
470
470
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: DragNDropNestedListComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
471
- 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", expandedChange: "expandedChange" }, 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]=\"!isSortable(item) || (item.disabled ?? false) || (item.pendingDelete ?? false)\" cdkDragPreviewClass=\"ddn-list-card-preview\">\n <cw-card [cssClass]=\"cardCssClass(item, depth)\" [title]=\"(item.title ?? item.label) || ''\"\n [subtitle]=\"item.subtitle ?? ''\" [truncateSubtitle]=\"true\" [type]=\"cardType(depth)\" [collapsible]=\"isCollapsible(item, depth)\"\n [collapsed]=\"isCollapsedCard(item, depth)\" [collapseStretched]=\"false\"\n (collapseClicked)=\"onCollapseChange(item, $event)\">\n\n <!-- Poign\u00E9e de drag (\u00E0 gauche du titre) : le glisser ne d\u00E9marre que d'ici.\n Non rendue si la carte n'est pas triable (ordre non manipulable) ; `disabled`\n la garde affich\u00E9e mais inerte. -->\n @if (isSortable(item)) {\n <button header-start type=\"button\" class=\"ddn-list-handle btn btn-ghost\" 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\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). Sans slot, on ne rend que ce que l'en-t\u00EAte ne porte\n pas d\u00E9j\u00E0 (le titre vaut `title ?? label`) : le code seul, s'il existe. -->\n @if (itemTemplate(); as tpl) {\n <ng-container *ngTemplateOutlet=\"tpl; context: { $implicit: item, depth: depth }\" />\n } @else if (item.code) {\n <div class=\"default-item\"><span class=\"text-muted\">({{ item.code }})</span></div>\n }\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", 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", "truncateSubtitle", "type", "titleRank", "cssClass", "collapsible", "collapsed", "disabled", "collapseLocked", "collapseStretched", "collapseId", "destroyOnHide", "fullHeight"], 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", "loadingAnnounce", "cssClass", "dataTest", "skeletonMode", "isPressed", "ariaDescribedBy", "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 }); }
471
+ 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", expandedChange: "expandedChange" }, 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]=\"!isSortable(item) || (item.disabled ?? false) || (item.pendingDelete ?? false)\" cdkDragPreviewClass=\"ddn-list-card-preview\">\n <cw-card [cssClass]=\"cardCssClass(item, depth)\" [title]=\"(item.title ?? item.label) || ''\"\n [subtitle]=\"item.subtitle ?? ''\" [truncateSubtitle]=\"true\" [type]=\"cardType(depth)\" [collapsible]=\"isCollapsible(item, depth)\"\n [collapsed]=\"isCollapsedCard(item, depth)\" [collapseStretched]=\"false\"\n (collapseClicked)=\"onCollapseChange(item, $event)\">\n\n <!-- Poign\u00E9e de drag (\u00E0 gauche du titre) : le glisser ne d\u00E9marre que d'ici.\n Non rendue si la carte n'est pas triable (ordre non manipulable) ; `disabled`\n la garde affich\u00E9e mais inerte. -->\n @if (isSortable(item)) {\n <button header-start type=\"button\" class=\"ddn-list-handle btn btn-ghost\" 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\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). Sans slot, on ne rend que ce que l'en-t\u00EAte ne porte\n pas d\u00E9j\u00E0 (le titre vaut `title ?? label`) : le code seul, s'il existe. -->\n @if (itemTemplate(); as tpl) {\n <ng-container *ngTemplateOutlet=\"tpl; context: { $implicit: item, depth: depth }\" />\n } @else if (item.code) {\n <div class=\"default-item\"><span class=\"text-muted\">({{ item.code }})</span></div>\n }\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", 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", "titleId", "subtitle", "truncateSubtitle", "type", "titleRank", "cssClass", "collapsible", "collapsed", "disabled", "collapseLocked", "collapseStretched", "collapseId", "destroyOnHide", "fullHeight"], outputs: ["collapsibleChange", "destroyOnHideChange", "collapseClicked"] }, { kind: "component", type: BadgeComponent, selector: "cw-badge", inputs: ["type", "label", "labelParams", "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", "labelParams", "id", "link", "isDropdown", "hideCaret", "withIcon", "withOnlyIcon", "iconSize", "iconPosition", "dropdownPosition", "isMinWidth", "isDisabled", "isLoading", "loadingAnnounce", "cssClass", "dataTest", "skeletonMode", "isPressed", "ariaDescribedBy", "ariaLabel", "ariaExpanded", "ariaControls", "withTooltip", "tooltipText", "tooltipTitle", "tooltipTrigger", "tooltipPosition", "tooltipType"], outputs: ["btnAction", "dropDownClicked"] }, { kind: "component", type: AlertComponent, selector: "cw-alert", inputs: ["type", "title", "titleParams", "isDismissible", "cssClass", "dataTest", "live"], outputs: ["close"] }, { kind: "pipe", type: i1.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
472
472
  }
473
473
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: DragNDropNestedListComponent, decorators: [{
474
474
  type: Component,
@@ -577,7 +577,7 @@ class PaginationComponent {
577
577
  });
578
578
  }
579
579
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: PaginationComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
580
- 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", "loadingAnnounce", "cssClass", "dataTest", "skeletonMode", "isPressed", "ariaDescribedBy", "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", "recommendedDimensions", "showPreview", "existingFile", "indeterminate"], outputs: ["refreshEvent", "fileRemoved", "textChanged", "valueChange", "phoneRegionChange"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "pipe", type: i1.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
580
+ 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", "labelParams", "id", "link", "isDropdown", "hideCaret", "withIcon", "withOnlyIcon", "iconSize", "iconPosition", "dropdownPosition", "isMinWidth", "isDisabled", "isLoading", "loadingAnnounce", "cssClass", "dataTest", "skeletonMode", "isPressed", "ariaDescribedBy", "ariaLabel", "ariaExpanded", "ariaControls", "withTooltip", "tooltipText", "tooltipTitle", "tooltipTrigger", "tooltipPosition", "tooltipType"], outputs: ["btnAction", "dropDownClicked"] }, { kind: "component", type: FormFieldComponent, selector: "cw-form-field", inputs: ["control", "formGroup", "type", "label", "displayLabel", "fieldTitle", "name", "placeholder", "autocomplete", "options", "rangeOptions", "validationOptions", "autocompleteOptions", "richTextOptions", "errorMessages", "isRequired", "help", "tooltip", "ariaDescribedBy", "addonLeft", "addonRight", "isInAddon", "isReadonly", "isDisabled", "sliderValue", "sliderOptions", "cssClass", "skeletonMode", "clearable", "appendTo", "initialCountry", "recommendedDimensions", "showPreview", "existingFile", "indeterminate"], outputs: ["refreshEvent", "fileRemoved", "textChanged", "valueChange", "phoneRegionChange"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "pipe", type: i1.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
581
581
  }
582
582
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: PaginationComponent, decorators: [{
583
583
  type: Component,
@@ -660,10 +660,13 @@ class TableComponent {
660
660
  */
661
661
  this.checkbox = input(false, ...(ngDevMode ? [{ debugName: "checkbox" }] : []));
662
662
  /**
663
- * Titre du tableau. Passe au pipe `translate` : fournir une CLE i18n, pas du texte
664
- * en dur. Alimente le `<caption>` (lu par les lecteurs d'ecran, masque visuellement).
663
+ * Legende du tableau : CLE i18n, traduite telle quelle dans le `<caption>` (lu par les
664
+ * lecteurs d'ecran, masque visuellement). La lib n'ajoute aucun texte autour : la cle
665
+ * porte la legende complete (« Liste des utilisateurs », « Journal d'audit »...).
666
+ *
667
+ * Requis : une table sans legende annoncait un caption vide ou tronque, sans erreur.
665
668
  */
666
- this.title = input('', ...(ngDevMode ? [{ debugName: "title" }] : []));
669
+ this.title = input.required(...(ngDevMode ? [{ debugName: "title" }] : []));
667
670
  this.columns = input([], ...(ngDevMode ? [{ debugName: "columns" }] : []));
668
671
  /** Lignes du tableau. En mode `checkbox`, chaque ligne doit avoir un `id` unique (cf. `checkbox`). */
669
672
  this.data = input([], ...(ngDevMode ? [{ debugName: "data" }] : []));
@@ -808,7 +811,13 @@ class TableComponent {
808
811
  this.cellClick.emit({ row, column });
809
812
  }
810
813
  isClickable(column) {
811
- return column.type === 'link' || !!column.clickable;
814
+ return column.type === 'link' || !!column.clickable || column.link !== undefined;
815
+ }
816
+ /** Destination de la cellule si la colonne declare `link` (vraie navigation), sinon `undefined`. */
817
+ cellLink(row, column) {
818
+ if (column.link === undefined)
819
+ return undefined;
820
+ return typeof column.link === 'function' ? column.link(row) : column.link;
812
821
  }
813
822
  isTruthy(value) {
814
823
  return value === true || value === 1 || value === '1' || value === 'true';
@@ -964,11 +973,12 @@ class TableComponent {
964
973
  return typeof descriptor.link === 'function' ? descriptor.link(row) : descriptor.link;
965
974
  }
966
975
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: TableComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
967
- 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 }, showScope: { classPropertyName: "showScope", publicName: "showScope", 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() && selectionCount() > 0) {\n <!-- Espacement DS : gap-md = 16px = component/button/set/gap (espacement entre\n boutons d'un set). Utilitaires basic-ui (adosses a l'echelle $sizing des\n tokens) et non ceux de Bootstrap : gap-2 valait 8px. d-flex-h centre deja\n verticalement, align-items-center est donc inutile. -->\n <div class=\"table-selection-info mb-md d-flex-h gap-md flex-wrap\">\n <span class=\"flex-grow-1\">\n {{ selectionCount() }} {{ '_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\"\n [innerHTML]=\"'_COMMON._TABLE.CAPTION' | translate: { label: (title() | translate) }\"></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 [titleParams]=\"empty.titleParams\"\n [titleSuffix]=\"scopeInstance() ? ('_COMMON._PAGE_SCOPE.EMPTY_FOR_INSTANCE' | translate: { instance: scopeInstance() }) : undefined\"\n [description]=\"empty.description\"\n [descriptionParams]=\"empty.descriptionParams\"\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 <!-- Meme regle que le titre du cw-empty-state : mention accolee au message. -->\n {{ ('_COMMON._TABLE.NO_RESULT' | translate) + (scopeInstance() ? ' ' + ('_COMMON._PAGE_SCOPE.EMPTY_FOR_INSTANCE' | translate: { instance: scopeInstance() }) : '') }}\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 <button type=\"button\" class=\"btn btn-link-like\" (click)=\"onCellClick(row, column)\">\n {{ column.translate ? (row[column.key] | translate) : row[column.key] }}\n </button>\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 <button type=\"button\" class=\"btn btn-link-like\" (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 </button>\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 <button type=\"button\" class=\"btn btn-link-like\" (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 </button>\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", "loadingAnnounce", "cssClass", "dataTest", "skeletonMode", "isPressed", "ariaDescribedBy", "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", "titleParams", "titleSuffix", "description", "descriptionParams", "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 }); }
976
+ 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: true, 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 }, showScope: { classPropertyName: "showScope", publicName: "showScope", 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() && selectionCount() > 0) {\n <!-- Espacement DS : gap-md = 16px = component/button/set/gap (espacement entre\n boutons d'un set). Utilitaires basic-ui (adosses a l'echelle $sizing des\n tokens) et non ceux de Bootstrap : gap-2 valait 8px. d-flex-h centre deja\n verticalement, align-items-center est donc inutile. -->\n <div class=\"table-selection-info mb-md d-flex-h gap-md flex-wrap\">\n <span class=\"flex-grow-1\">\n {{ selectionCount() }} {{ '_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\">{{ title() | translate }}</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 [titleParams]=\"empty.titleParams\"\n [titleSuffix]=\"scopeInstance() ? ('_COMMON._PAGE_SCOPE.EMPTY_FOR_INSTANCE' | translate: { instance: scopeInstance() }) : undefined\"\n [description]=\"empty.description\"\n [descriptionParams]=\"empty.descriptionParams\"\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 <!-- Meme regle que le titre du cw-empty-state : mention accolee au message. -->\n {{ ('_COMMON._TABLE.NO_RESULT' | translate) + (scopeInstance() ? ' ' + ('_COMMON._PAGE_SCOPE.EMPTY_FOR_INSTANCE' | translate: { instance: scopeInstance() }) : '') }}\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 @let link = cellLink(row, column);\n <!-- `link` declare : vraie navigation (<a>). Sinon action (<button> + cellClick). -->\n @if (link !== undefined) {\n <a class=\"btn btn-link-like\" [routerLink]=\"link\">\n {{ column.translate ? (row[column.key] | translate) : row[column.key] }}\n </a>\n } @else {\n <button type=\"button\" class=\"btn btn-link-like\" (click)=\"onCellClick(row, column)\">\n {{ column.translate ? (row[column.key] | translate) : row[column.key] }}\n </button>\n }\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 @let link = cellLink(row, column);\n @if (link !== undefined) {\n <a class=\"btn btn-link-like\" [routerLink]=\"link\" [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 if (isClickable(column)) {\n <button type=\"button\" class=\"btn btn-link-like\" (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 </button>\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 @let link = cellLink(row, column);\n @if (link !== undefined) {\n <a class=\"btn btn-link-like\" [routerLink]=\"link\" [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 if (isClickable(column)) {\n <button type=\"button\" class=\"btn btn-link-like\" (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 </button>\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: "directive", type: RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "ngmodule", type: TranslateModule }, { kind: "component", type: LoaderComponent, selector: "cw-loader", inputs: ["size", "displayText"] }, { kind: "component", type: BadgeComponent, selector: "cw-badge", inputs: ["type", "label", "labelParams", "withIcon", "iconPosition", "cssClass", "skeletonMode", "dataTest"] }, { kind: "component", type: ButtonComponent, selector: "cw-button", inputs: ["type", "label", "labelParams", "id", "link", "isDropdown", "hideCaret", "withIcon", "withOnlyIcon", "iconSize", "iconPosition", "dropdownPosition", "isMinWidth", "isDisabled", "isLoading", "loadingAnnounce", "cssClass", "dataTest", "skeletonMode", "isPressed", "ariaDescribedBy", "ariaLabel", "ariaExpanded", "ariaControls", "withTooltip", "tooltipText", "tooltipTitle", "tooltipTrigger", "tooltipPosition", "tooltipType"], outputs: ["btnAction", "dropDownClicked"] }, { kind: "directive", type: 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", "titleParams", "titleSuffix", "description", "descriptionParams", "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 }); }
968
977
  }
969
978
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: TableComponent, decorators: [{
970
979
  type: Component,
971
980
  args: [{ selector: 'cw-table', standalone: true, host: { class: 'cw-table' }, changeDetection: ChangeDetectionStrategy.OnPush, imports: [
981
+ RouterLink,
972
982
  TranslateModule,
973
983
  LoaderComponent,
974
984
  BadgeComponent,
@@ -979,8 +989,135 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.20", ngImpo
979
989
  ImageComponent,
980
990
  EmptyStateComponent,
981
991
  ProgressBarComponent
982
- ], template: "@if (checkbox() && selectionCount() > 0) {\n <!-- Espacement DS : gap-md = 16px = component/button/set/gap (espacement entre\n boutons d'un set). Utilitaires basic-ui (adosses a l'echelle $sizing des\n tokens) et non ceux de Bootstrap : gap-2 valait 8px. d-flex-h centre deja\n verticalement, align-items-center est donc inutile. -->\n <div class=\"table-selection-info mb-md d-flex-h gap-md flex-wrap\">\n <span class=\"flex-grow-1\">\n {{ selectionCount() }} {{ '_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\"\n [innerHTML]=\"'_COMMON._TABLE.CAPTION' | translate: { label: (title() | translate) }\"></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 [titleParams]=\"empty.titleParams\"\n [titleSuffix]=\"scopeInstance() ? ('_COMMON._PAGE_SCOPE.EMPTY_FOR_INSTANCE' | translate: { instance: scopeInstance() }) : undefined\"\n [description]=\"empty.description\"\n [descriptionParams]=\"empty.descriptionParams\"\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 <!-- Meme regle que le titre du cw-empty-state : mention accolee au message. -->\n {{ ('_COMMON._TABLE.NO_RESULT' | translate) + (scopeInstance() ? ' ' + ('_COMMON._PAGE_SCOPE.EMPTY_FOR_INSTANCE' | translate: { instance: scopeInstance() }) : '') }}\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 <button type=\"button\" class=\"btn btn-link-like\" (click)=\"onCellClick(row, column)\">\n {{ column.translate ? (row[column.key] | translate) : row[column.key] }}\n </button>\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 <button type=\"button\" class=\"btn btn-link-like\" (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 </button>\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 <button type=\"button\" class=\"btn btn-link-like\" (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 </button>\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" }]
983
- }], 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 }] }], showScope: [{ type: i0.Input, args: [{ isSignal: true, alias: "showScope", 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 }] }] } });
992
+ ], template: "@if (checkbox() && selectionCount() > 0) {\n <!-- Espacement DS : gap-md = 16px = component/button/set/gap (espacement entre\n boutons d'un set). Utilitaires basic-ui (adosses a l'echelle $sizing des\n tokens) et non ceux de Bootstrap : gap-2 valait 8px. d-flex-h centre deja\n verticalement, align-items-center est donc inutile. -->\n <div class=\"table-selection-info mb-md d-flex-h gap-md flex-wrap\">\n <span class=\"flex-grow-1\">\n {{ selectionCount() }} {{ '_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\">{{ title() | translate }}</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 [titleParams]=\"empty.titleParams\"\n [titleSuffix]=\"scopeInstance() ? ('_COMMON._PAGE_SCOPE.EMPTY_FOR_INSTANCE' | translate: { instance: scopeInstance() }) : undefined\"\n [description]=\"empty.description\"\n [descriptionParams]=\"empty.descriptionParams\"\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 <!-- Meme regle que le titre du cw-empty-state : mention accolee au message. -->\n {{ ('_COMMON._TABLE.NO_RESULT' | translate) + (scopeInstance() ? ' ' + ('_COMMON._PAGE_SCOPE.EMPTY_FOR_INSTANCE' | translate: { instance: scopeInstance() }) : '') }}\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 @let link = cellLink(row, column);\n <!-- `link` declare : vraie navigation (<a>). Sinon action (<button> + cellClick). -->\n @if (link !== undefined) {\n <a class=\"btn btn-link-like\" [routerLink]=\"link\">\n {{ column.translate ? (row[column.key] | translate) : row[column.key] }}\n </a>\n } @else {\n <button type=\"button\" class=\"btn btn-link-like\" (click)=\"onCellClick(row, column)\">\n {{ column.translate ? (row[column.key] | translate) : row[column.key] }}\n </button>\n }\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 @let link = cellLink(row, column);\n @if (link !== undefined) {\n <a class=\"btn btn-link-like\" [routerLink]=\"link\" [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 if (isClickable(column)) {\n <button type=\"button\" class=\"btn btn-link-like\" (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 </button>\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 @let link = cellLink(row, column);\n @if (link !== undefined) {\n <a class=\"btn btn-link-like\" [routerLink]=\"link\" [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 if (isClickable(column)) {\n <button type=\"button\" class=\"btn btn-link-like\" (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 </button>\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" }]
993
+ }], ctorParameters: () => [], propDecorators: { checkbox: [{ type: i0.Input, args: [{ isSignal: true, alias: "checkbox", required: false }] }], title: [{ type: i0.Input, args: [{ isSignal: true, alias: "title", required: true }] }], 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 }] }], showScope: [{ type: i0.Input, args: [{ isSignal: true, alias: "showScope", 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 }] }] } });
994
+
995
+ /** Clé par défaut de la recherche unifiée. */
996
+ const FILTER_SEARCH_DEFAULT_KEY = 'keywords';
997
+
998
+ // Persistance de la visibilite des colonnes de `cw-table` (pilotee par `cw-page-header`).
999
+ // Une SEULE cle localStorage pour N tableaux : objet indexe par `storageKey`.
1000
+ // On ne stocke QUE les cles des colonnes MASQUEES (eviter de surcharger le localStorage).
1001
+ //
1002
+ // localStorage['cw-table-columns'] = {
1003
+ // "publictransport/events": ["col1", "col2"],
1004
+ // "users/list": ["createdAt"]
1005
+ // }
1006
+ const STORAGE_KEY = 'cw-table-columns';
1007
+ /** Acces localStorage tolerant (SSR / quota / mode prive) : ne jette jamais. */
1008
+ function readStore() {
1009
+ try {
1010
+ if (typeof localStorage === 'undefined')
1011
+ return {};
1012
+ const raw = localStorage.getItem(STORAGE_KEY);
1013
+ const parsed = raw ? JSON.parse(raw) : {};
1014
+ return parsed && typeof parsed === 'object' ? parsed : {};
1015
+ }
1016
+ catch {
1017
+ return {};
1018
+ }
1019
+ }
1020
+ /**
1021
+ * Cles des colonnes masquees memorisees pour ce tableau.
1022
+ * - `null` : aucune entree => l'utilisateur n'a jamais personnalise, on garde les defauts du config.
1023
+ * - `string[]` (meme vide) : etat autoritatif memorise (`[]` = tout visible, choisi par l'utilisateur).
1024
+ */
1025
+ function loadHiddenColumns(storageKey) {
1026
+ if (!storageKey)
1027
+ return null;
1028
+ const entry = readStore()[storageKey];
1029
+ return Array.isArray(entry) ? entry : null;
1030
+ }
1031
+ /**
1032
+ * Memorise les cles des colonnes masquees pour ce tableau.
1033
+ * Ecrit toujours l'entree (meme vide) : sa presence marque « personnalise par l'utilisateur ».
1034
+ */
1035
+ function saveHiddenColumns(storageKey, hiddenKeys) {
1036
+ if (!storageKey)
1037
+ return;
1038
+ try {
1039
+ if (typeof localStorage === 'undefined')
1040
+ return;
1041
+ const store = readStore();
1042
+ store[storageKey] = hiddenKeys;
1043
+ localStorage.setItem(STORAGE_KEY, JSON.stringify(store));
1044
+ }
1045
+ catch {
1046
+ /* localStorage indisponible : persistance silencieusement ignoree. */
1047
+ }
1048
+ }
1049
+
1050
+ /**
1051
+ * Menu « Colonnes » : dropdown de cases a cocher pour afficher/masquer les colonnes
1052
+ * d'une `cw-table`, avec persistance localStorage. Interne a la lib (rendu par `cw-filter-bar`).
1053
+ */
1054
+ class ColumnMenuComponent {
1055
+ constructor() {
1056
+ /** Colonnes du tableau associe. */
1057
+ this.columns = input([], ...(ngDevMode ? [{ debugName: "columns" }] : []));
1058
+ /** Identifiant stable du tableau pour la persistance localStorage (ex. 'users/list'). */
1059
+ this.storageKey = input(...(ngDevMode ? [undefined, { debugName: "storageKey" }] : []));
1060
+ /** Cle i18n du libelle du bouton. */
1061
+ this.label = input('_COMMON._TABLE.COLUMNS', ...(ngDevMode ? [{ debugName: "label" }] : []));
1062
+ /** Emis quand la visibilite des colonnes change (colonnes avec `hidden` a jour). */
1063
+ this.columnsChange = output();
1064
+ this.buttonType = BoButtonTypeEnum;
1065
+ this.spriteIcon = SpriteIconEnum;
1066
+ /** Colonnes masquables (hors `actions` et hors `hideable === false`). */
1067
+ this.toggleableColumns = computed(() => this.columns().filter(c => c.type !== 'actions' && c.hideable !== false), ...(ngDevMode ? [{ debugName: "toggleableColumns" }] : []));
1068
+ /** Le menu n'apparait que s'il existe au moins une colonne masquable. */
1069
+ this.visible = computed(() => this.toggleableColumns().length > 0, ...(ngDevMode ? [{ debugName: "visible" }] : []));
1070
+ /** Nombre de colonnes masquables actuellement visibles. */
1071
+ this.visibleToggleableCount = computed(() => this.toggleableColumns().filter(c => !c.hidden).length, ...(ngDevMode ? [{ debugName: "visibleToggleableCount" }] : []));
1072
+ // Reconciliation au 1er rendu (navigateur) : si un etat est memorise, il prime
1073
+ // sur les defauts du config et est emis une fois vers le parent.
1074
+ afterNextRender(() => this.applyStoredVisibility());
1075
+ }
1076
+ /** Une colonne visible est « la derniere » si la masquer laisserait 0 colonne visible. */
1077
+ isLastVisible(col) {
1078
+ return !col.hidden && this.visibleToggleableCount() <= 1;
1079
+ }
1080
+ /** Coche/decoche une colonne : applique le garde-fou, persiste et emet. */
1081
+ toggleColumn(col) {
1082
+ const willHide = !col.hidden;
1083
+ if (willHide && this.visibleToggleableCount() <= 1)
1084
+ return; // garde-fou : min 1 visible
1085
+ const updated = this.columns().map(c => (c.key === col.key ? { ...c, hidden: willHide } : c));
1086
+ this.persistAndEmit(updated);
1087
+ }
1088
+ applyStoredVisibility() {
1089
+ const key = this.storageKey();
1090
+ if (!key)
1091
+ return;
1092
+ const stored = loadHiddenColumns(key);
1093
+ if (!stored)
1094
+ return; // jamais personnalise -> on garde les `hidden` du config
1095
+ const hidden = new Set(stored);
1096
+ const reconciled = this.columns().map(c => c.type === 'actions' || c.hideable === false ? c : { ...c, hidden: hidden.has(c.key) });
1097
+ this.columnsChange.emit(this.ensureMinVisible(reconciled));
1098
+ }
1099
+ /** Garantit au moins une colonne masquable visible (re-affiche la 1re sinon). */
1100
+ ensureMinVisible(cols) {
1101
+ const toggleable = cols.filter(c => c.type !== 'actions' && c.hideable !== false);
1102
+ if (toggleable.length === 0 || toggleable.some(c => !c.hidden))
1103
+ return cols;
1104
+ const firstKey = toggleable[0].key;
1105
+ return cols.map(c => (c.key === firstKey ? { ...c, hidden: false } : c));
1106
+ }
1107
+ persistAndEmit(cols) {
1108
+ const hiddenKeys = cols
1109
+ .filter(c => c.hidden && c.type !== 'actions' && c.hideable !== false)
1110
+ .map(c => c.key);
1111
+ saveHiddenColumns(this.storageKey() ?? '', hiddenKeys);
1112
+ this.columnsChange.emit(cols);
1113
+ }
1114
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: ColumnMenuComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
1115
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.20", type: ColumnMenuComponent, isStandalone: true, selector: "cw-column-menu", inputs: { columns: { classPropertyName: "columns", publicName: "columns", isSignal: true, isRequired: false, transformFunction: null }, storageKey: { classPropertyName: "storageKey", publicName: "storageKey", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { columnsChange: "columnsChange" }, ngImport: i0, template: "@if (visible()) {\n <cw-button [type]=\"buttonType.secondary\" [label]=\"label()\" [withIcon]=\"spriteIcon.miscNews\" [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", dependencies: [{ kind: "component", type: ButtonComponent, selector: "cw-button", inputs: ["type", "label", "labelParams", "id", "link", "isDropdown", "hideCaret", "withIcon", "withOnlyIcon", "iconSize", "iconPosition", "dropdownPosition", "isMinWidth", "isDisabled", "isLoading", "loadingAnnounce", "cssClass", "dataTest", "skeletonMode", "isPressed", "ariaDescribedBy", "ariaLabel", "ariaExpanded", "ariaControls", "withTooltip", "tooltipText", "tooltipTitle", "tooltipTrigger", "tooltipPosition", "tooltipType"], outputs: ["btnAction", "dropDownClicked"] }, { kind: "ngmodule", type: TranslateModule }, { kind: "pipe", type: i1.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
1116
+ }
1117
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: ColumnMenuComponent, decorators: [{
1118
+ type: Component,
1119
+ args: [{ selector: 'cw-column-menu', changeDetection: ChangeDetectionStrategy.OnPush, imports: [ButtonComponent, TranslateModule], template: "@if (visible()) {\n <cw-button [type]=\"buttonType.secondary\" [label]=\"label()\" [withIcon]=\"spriteIcon.miscNews\" [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" }]
1120
+ }], ctorParameters: () => [], propDecorators: { columns: [{ type: i0.Input, args: [{ isSignal: true, alias: "columns", required: false }] }], storageKey: [{ type: i0.Input, args: [{ isSignal: true, alias: "storageKey", required: false }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], columnsChange: [{ type: i0.Output, args: ["columnsChange"] }] } });
984
1121
 
985
1122
  /**
986
1123
  * Valeur du choix « Tous » d'un filtre simple. Vide = filtre inactif : la barre la retire
@@ -1048,71 +1185,136 @@ const SELECT_TYPES = new Set([
1048
1185
  ]);
1049
1186
  /** Séparateur des valeurs d'un filtre multiple dans les query params de l'URL. */
1050
1187
  const MULTIPLE_SEPARATOR = ',';
1188
+ /** Compteur d'instances : ids uniques quand plusieurs barres cohabitent sur la page. */
1189
+ let nextId = 0;
1051
1190
  class FilterBarComponent {
1052
1191
  constructor() {
1053
1192
  this.destroyRef = inject(DestroyRef);
1054
1193
  this.router = inject(Router, { optional: true });
1055
1194
  this.route = inject(ActivatedRoute, { optional: true });
1195
+ this.translate = inject(TranslateService);
1196
+ this.injector = inject(Injector);
1197
+ this.host = inject((ElementRef));
1056
1198
  this.filters = input.required(...(ngDevMode ? [{ debugName: "filters" }] : []));
1199
+ /** Recherche unifiée (mots-clés). Absente = comportement historique (champs isolés). */
1200
+ this.search = input(...(ngDevMode ? [undefined, { debugName: "search" }] : []));
1057
1201
  this.manual = input(false, ...(ngDevMode ? [{ debugName: "manual" }] : []));
1058
1202
  /** Synchronise l'état appliqué des filtres avec les query params de l'URL (mémorisation / partage). */
1059
1203
  this.syncUrl = input(false, ...(ngDevMode ? [{ debugName: "syncUrl" }] : []));
1060
1204
  this.applyLabel = input('_COMMON._ACTION.FILTER', ...(ngDevMode ? [{ debugName: "applyLabel" }] : []));
1061
1205
  this.resetLabel = input('_COMMON._ACTION.RESET', ...(ngDevMode ? [{ debugName: "resetLabel" }] : []));
1206
+ // --- Menu « Colonnes » (optionnel, a droite de la barre) ---------------
1207
+ /** Colonnes du tableau associe. Fourni => le dropdown « Colonnes » apparait. */
1208
+ this.columns = input([], ...(ngDevMode ? [{ debugName: "columns" }] : []));
1209
+ /** Identifiant stable du tableau pour la persistance localStorage (ex. 'users/list'). */
1210
+ this.columnsStorageKey = input(...(ngDevMode ? [undefined, { debugName: "columnsStorageKey" }] : []));
1211
+ /** Cle i18n du libelle du bouton « Colonnes ». */
1212
+ this.columnsLabel = input('_COMMON._TABLE.COLUMNS', ...(ngDevMode ? [{ debugName: "columnsLabel" }] : []));
1062
1213
  this.filtersApplied = output();
1063
1214
  this.filtersReset = output();
1215
+ /** Emis quand la visibilite des colonnes change (colonnes avec `hidden` a jour). */
1216
+ this.columnsChange = output();
1064
1217
  this.uiType = BoButtonTypeEnum;
1218
+ this.spriteIcon = SpriteIconEnum;
1219
+ this.iconSize = ButtonIconSizeEnum;
1220
+ this.fieldType = FormFieldTypeEnum;
1221
+ this.badgeType = BadgeTypeEnum;
1222
+ /** Préfixe des ids de la barre : uniques même avec plusieurs barres sur la page. */
1223
+ this.idPrefix = `cw-filter-bar-${nextId++}`;
1224
+ /** Id de la zone des filtres avancés (cible de l'`aria-controls` du bouton « Plus de filtres »). */
1225
+ this.advancedPanelId = `${this.idPrefix}-advanced`;
1065
1226
  this.filterForm = new FormGroup({});
1227
+ /** Clé de la recherche unifiée dans `FilterValues` / l'URL. */
1228
+ this.searchKey = computed(() => this.search()?.key || FILTER_SEARCH_DEFAULT_KEY, ...(ngDevMode ? [{ debugName: "searchKey" }] : []));
1229
+ /** Champs couverts par la recherche unifiée (vide si la recherche n'est pas activée). */
1230
+ this.unifiedKeys = computed(() => new Set(this.search() ? this.search().fields ?? [] : []), ...(ngDevMode ? [{ debugName: "unifiedKeys" }] : []));
1231
+ /** Champs rendus dans la barre (hors avancés, hors champs fusionnés dans la recherche). */
1232
+ this.barFields = computed(() => this.filters().filter(f => f.placement !== 'advanced' && !this.unifiedKeys().has(f.key)), ...(ngDevMode ? [{ debugName: "barFields" }] : []));
1233
+ /** Champs du panneau « Recherche avancée ». */
1234
+ this.advancedFields = computed(() => this.filters().filter(f => f.placement === 'advanced'), ...(ngDevMode ? [{ debugName: "advancedFields" }] : []));
1235
+ /** Champs masqués par la recherche unifiée : retirés de l'URL pour ne pas laisser de filtre invisible. */
1236
+ this.unifiedHiddenFields = computed(() => this.filters().filter(f => f.placement !== 'advanced' && this.unifiedKeys().has(f.key)), ...(ngDevMode ? [{ debugName: "unifiedHiddenFields" }] : []));
1237
+ /** La barre a-t-elle au moins un champ (recherche comprise) ? Sinon pas de boutons Appliquer/Réinitialiser. */
1238
+ this.hasFields = computed(() => !!this.search() || this.filters().length > 0, ...(ngDevMode ? [{ debugName: "hasFields" }] : []));
1239
+ this.advancedOpen = signal(false, ...(ngDevMode ? [{ debugName: "advancedOpen" }] : []));
1240
+ /** Dernières valeurs émises : source des étiquettes et du compteur (en mode manuel, la saisie non appliquée n'y figure pas). */
1241
+ this.appliedValues = signal({}, ...(ngDevMode ? [{ debugName: "appliedValues" }] : []));
1242
+ /** Filtres avancés actifs, rappelés en étiquettes supprimables sous la barre. */
1243
+ this.advancedChips = computed(() => {
1244
+ const applied = this.appliedValues();
1245
+ return this.advancedFields()
1246
+ .filter(f => !this.isEmptyValue(applied[f.key]))
1247
+ .map(f => ({ key: f.key, label: f.label, values: this.displayValues(f, applied[f.key]) }));
1248
+ }, ...(ngDevMode ? [{ debugName: "advancedChips" }] : []));
1249
+ this.advancedLabel = computed(() => this.advancedOpen() ? '_COMMON._FILTER.LESS' : '_COMMON._FILTER.MORE', ...(ngDevMode ? [{ debugName: "advancedLabel" }] : []));
1250
+ this.advancedToggle = viewChild('advancedToggle', ...(ngDevMode ? [{ debugName: "advancedToggle", read: ElementRef }] : [{ read: ElementRef }]));
1066
1251
  this.defaults = {};
1067
1252
  effect(() => {
1068
- this.buildForm(this.filters());
1253
+ this.buildForm(this.barFields(), this.advancedFields(), this.search());
1069
1254
  });
1070
1255
  }
1071
- buildForm(configs) {
1256
+ buildForm(barFields, advancedFields, search) {
1072
1257
  // Ferme la souscription du form precedent : sans quoi un changement de `filters()`
1073
1258
  // (donc un rebuild) empilerait les souscriptions -> emissions `filtersApplied` multipliees.
1074
1259
  this.valueChangesSub?.unsubscribe();
1075
- const group = {};
1260
+ const searchKey = search ? this.searchKey() : null;
1076
1261
  const defaults = {};
1077
- const urlValues = this.readUrlValues(configs);
1078
- for (const field of configs) {
1079
- if (RANGE_TYPES.has(field.type)) {
1080
- const def = field.defaultValue ?? { start: '', end: '' };
1081
- const init = urlValues[field.key] ?? def;
1082
- group[field.key] = new FormGroup({
1083
- start: new FormControl(init.start ?? ''),
1084
- end: new FormControl(init.end ?? '')
1085
- });
1086
- defaults[field.key] = { ...def };
1087
- }
1088
- else {
1089
- const def = field.defaultValue ?? (this.isMultiple(field) ? [] : '');
1090
- const init = urlValues[field.key] ?? def;
1091
- group[field.key] = new FormControl(init);
1092
- defaults[field.key] = Array.isArray(def) ? [...def] : def;
1093
- }
1262
+ const urlValues = this.readUrlValues([...barFields, ...advancedFields], searchKey);
1263
+ // Un seul form : les champs avancés s'appliquent comme ceux de la barre (à la saisie, ou au bouton en manuel).
1264
+ const group = {};
1265
+ if (searchKey) {
1266
+ group[searchKey] = new FormControl(urlValues[searchKey] ?? '');
1267
+ defaults[searchKey] = '';
1268
+ }
1269
+ for (const field of [...barFields, ...advancedFields]) {
1270
+ group[field.key] = this.createControl(field, urlValues, defaults);
1094
1271
  }
1095
1272
  this.defaults = defaults;
1096
1273
  this.filterForm = new FormGroup(group);
1274
+ this.appliedValues.set(this.filterForm.value);
1097
1275
  if (!this.manual()) {
1098
1276
  this.valueChangesSub = this.filterForm.valueChanges
1099
1277
  .pipe(debounceTime(300), takeUntilDestroyed(this.destroyRef))
1100
- .subscribe(values => {
1101
- this.filtersApplied.emit(values);
1102
- this.syncFiltersToUrl(values);
1103
- });
1278
+ .subscribe(() => this.emitAndSync());
1104
1279
  }
1105
1280
  // Restaure le filtrage présent dans l'URL au chargement.
1106
1281
  if (Object.keys(urlValues).length > 0) {
1107
- this.filtersApplied.emit(this.filterForm.value);
1282
+ this.filtersApplied.emit(this.currentValues());
1108
1283
  }
1109
1284
  }
1110
- /** Lit les valeurs de filtre présentes dans les query params de l'URL. */
1111
- readUrlValues(configs) {
1285
+ /** Crée le control d'un champ (sous-`FormGroup` pour une plage) et enregistre sa valeur par défaut. */
1286
+ createControl(field, urlValues, defaults) {
1287
+ if (RANGE_TYPES.has(field.type)) {
1288
+ const def = field.defaultValue ?? { start: '', end: '' };
1289
+ const init = urlValues[field.key] ?? def;
1290
+ defaults[field.key] = { ...def };
1291
+ return new FormGroup({
1292
+ start: new FormControl(init.start ?? ''),
1293
+ end: new FormControl(init.end ?? '')
1294
+ });
1295
+ }
1296
+ const def = field.defaultValue ?? (this.isMultiple(field) ? [] : '');
1297
+ defaults[field.key] = Array.isArray(def) ? [...def] : def;
1298
+ return new FormControl(urlValues[field.key] ?? def);
1299
+ }
1300
+ currentValues() {
1301
+ return this.filterForm.value;
1302
+ }
1303
+ emitAndSync() {
1304
+ const values = this.currentValues();
1305
+ this.appliedValues.set(values);
1306
+ this.filtersApplied.emit(values);
1307
+ this.syncFiltersToUrl(values);
1308
+ }
1309
+ /** Lit les valeurs de filtre (et la recherche unifiée) présentes dans les query params de l'URL. */
1310
+ readUrlValues(configs, searchKey) {
1112
1311
  const values = {};
1113
1312
  if (!this.syncUrl() || !this.route)
1114
1313
  return values;
1115
1314
  const params = this.route.snapshot.queryParamMap;
1315
+ if (searchKey && params.get(searchKey) !== null) {
1316
+ values[searchKey] = params.get(searchKey);
1317
+ }
1116
1318
  for (const field of configs) {
1117
1319
  if (RANGE_TYPES.has(field.type)) {
1118
1320
  const start = params.get(`${field.key}.start`);
@@ -1137,7 +1339,10 @@ class FilterBarComponent {
1137
1339
  if (!this.syncUrl() || !this.router || !this.route)
1138
1340
  return;
1139
1341
  const queryParams = {};
1140
- for (const field of this.filters()) {
1342
+ if (this.search()) {
1343
+ queryParams[this.searchKey()] = this.toParam(values[this.searchKey()]);
1344
+ }
1345
+ for (const field of [...this.barFields(), ...this.advancedFields()]) {
1141
1346
  const value = values[field.key];
1142
1347
  if (RANGE_TYPES.has(field.type)) {
1143
1348
  queryParams[`${field.key}.start`] = this.toParam(value?.start);
@@ -1147,6 +1352,16 @@ class FilterBarComponent {
1147
1352
  queryParams[field.key] = this.toParam(value);
1148
1353
  }
1149
1354
  }
1355
+ // Un champ fusionné dans la recherche n'a plus de saisie : on purge un éventuel ancien param.
1356
+ for (const field of this.unifiedHiddenFields()) {
1357
+ if (RANGE_TYPES.has(field.type)) {
1358
+ queryParams[`${field.key}.start`] = null;
1359
+ queryParams[`${field.key}.end`] = null;
1360
+ }
1361
+ else {
1362
+ queryParams[field.key] = null;
1363
+ }
1364
+ }
1150
1365
  this.router.navigate([], {
1151
1366
  relativeTo: this.route,
1152
1367
  queryParams,
@@ -1162,6 +1377,37 @@ class FilterBarComponent {
1162
1377
  return value.length ? value.join(MULTIPLE_SEPARATOR) : null;
1163
1378
  return String(value);
1164
1379
  }
1380
+ isEmptyValue(value) {
1381
+ if (value === null || value === undefined || value === '')
1382
+ return true;
1383
+ if (Array.isArray(value))
1384
+ return value.length === 0;
1385
+ if (typeof value === 'object' && 'start' in value && 'end' in value)
1386
+ return !value.start && !value.end;
1387
+ return false;
1388
+ }
1389
+ /** Valeurs lisibles d'un filtre avancé : libellés d'options pour les listes, `début – fin` pour une plage. */
1390
+ displayValues(field, value) {
1391
+ if (RANGE_TYPES.has(field.type)) {
1392
+ return [{ text: `${value.start || '…'} – ${value.end || '…'}`, translate: false }];
1393
+ }
1394
+ if (this.isSelect(field)) {
1395
+ const options = this.resolveOptions(field);
1396
+ return (Array.isArray(value) ? value : [value]).map(v => {
1397
+ const option = options.find(o => o.value === v);
1398
+ return option ? { text: option.label, translate: true } : { text: String(v), translate: false };
1399
+ });
1400
+ }
1401
+ return [{ text: String(value), translate: false }];
1402
+ }
1403
+ /** Id du champ (`name` de cw-form-field / `inputId` de cw-filter-select) : relie label et input. */
1404
+ fieldId(key) {
1405
+ return `${this.idPrefix}-${key}`;
1406
+ }
1407
+ /** Champ de saisie simple (ni liste, ni période) : son libellé est intégré au champ (cf. `.filter-field-text`). */
1408
+ isTextField(field) {
1409
+ return !this.isSelect(field) && !RANGE_TYPES.has(field.type);
1410
+ }
1165
1411
  isSelect(field) {
1166
1412
  return SELECT_TYPES.has(field.type);
1167
1413
  }
@@ -1177,31 +1423,68 @@ class FilterBarComponent {
1177
1423
  return typeof field.options === 'function' ? field.options() : field.options;
1178
1424
  }
1179
1425
  apply() {
1180
- const values = this.filterForm.value;
1181
- this.filtersApplied.emit(values);
1182
- this.syncFiltersToUrl(values);
1426
+ this.emitAndSync();
1183
1427
  }
1184
1428
  reset() {
1185
1429
  this.filterForm.reset(this.defaults);
1186
1430
  this.filtersReset.emit();
1187
1431
  if (this.manual()) {
1188
- const values = this.filterForm.value;
1189
- this.filtersApplied.emit(values);
1190
- this.syncFiltersToUrl(values);
1432
+ this.emitAndSync();
1191
1433
  }
1192
1434
  }
1435
+ // --- Recherche avancée -------------------------------------------------
1436
+ toggleAdvanced() {
1437
+ this.advancedOpen.update(open => !open);
1438
+ }
1439
+ /** Retire un filtre avancé (étiquette) : effet immédiat, même en mode manuel. */
1440
+ removeAdvanced(key) {
1441
+ const index = this.advancedChips().findIndex(c => c.key === key);
1442
+ // Sans emitEvent, le valueChanges (auto) ne ré-émet pas après coup : une seule émission.
1443
+ this.filterForm.get(key)?.reset(this.defaults[key], { emitEvent: false });
1444
+ this.emitAndSync();
1445
+ // Focus sur l'étiquette suivante (désormais au même index), la précédente si c'était la dernière,
1446
+ // sinon sur « Plus de filtres » : le focus ne doit pas retomber sur <body>.
1447
+ afterNextRender(() => {
1448
+ const buttons = this.host.nativeElement.querySelectorAll('.filter-bar-chips button');
1449
+ const next = buttons[Math.min(index, buttons.length - 1)];
1450
+ next ? next.focus() : this.focusAdvancedToggle();
1451
+ }, { injector: this.injector });
1452
+ }
1453
+ /** Nom accessible de la recherche unifiée : `search.label`, sinon « Rechercher (Nom, Email) » d'après les champs couverts. */
1454
+ searchLabel() {
1455
+ const config = this.search();
1456
+ if (config?.label)
1457
+ return config.label;
1458
+ const labels = this.filters().filter(f => this.unifiedKeys().has(f.key)).map(f => this.translate.instant(f.label));
1459
+ return labels.length
1460
+ ? this.translate.instant('_COMMON._FILTER.KEYWORDS_IN', { fields: labels.join(', ') })
1461
+ : '_COMMON._FILTER.KEYWORDS';
1462
+ }
1463
+ /** Valeur(s) lisible(s) d'une étiquette (libellés d'options traduits). */
1464
+ chipText(chip) {
1465
+ return chip.values.map(v => (v.translate ? this.translate.instant(v.text) : v.text)).join(', ');
1466
+ }
1467
+ /** L'étiquette disparaît : le focus revient sur le bouton « Plus de filtres ». */
1468
+ focusAdvancedToggle() {
1469
+ this.advancedToggle()?.nativeElement?.querySelector('button')?.focus();
1470
+ }
1193
1471
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: FilterBarComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
1194
- 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: "<!-- Cl\u00E9s i18n pass\u00E9es telles quelles : cw-form-field et cw-button traduisent label et placeholder eux-m\u00EAmes. -->\n<form [formGroup]=\"filterForm\" (ngSubmit)=\"apply()\" class=\"filter-bar\">\n <div class=\"d-flex-h flex-wrap gap-md\">\n @for (field of filters(); track field.key) {\n <div class=\"filter-field\" [class]=\"field.colClass ?? ''\">\n @if (isSelect(field)) {\n <cw-filter-select\n [label]=\"field.label\"\n [options]=\"resolveOptions(field)\"\n [multiple]=\"isMultiple(field)\"\n [allLabel]=\"field.allLabel === undefined ? '_COMMON._FILTER.ALL' : field.allLabel\"\n [inputId]=\"'filter-' + field.key\"\n [control]=\"$any(getControl(field.key))\">\n </cw-filter-select>\n } @else {\n <cw-form-field\n [label]=\"field.label\"\n [displayLabel]=\"false\"\n [type]=\"field.type\"\n [placeholder]=\"field.placeholder ?? ''\"\n [options]=\"resolveOptions(field)\"\n [control]=\"getControl(field.key)\">\n </cw-form-field>\n }\n </div>\n }\n <div class=\"d-flex-h gap-md\">\n @if (manual()) {\n <cw-button\n [label]=\"applyLabel()\"\n [type]=\"uiType.link\"\n (btnAction)=\"apply()\">\n </cw-button>\n }\n <cw-button\n [label]=\"resetLabel()\"\n [type]=\"uiType.link\"\n (btnAction)=\"reset()\">\n </cw-button>\n </div>\n </div>\n</form>\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", "recommendedDimensions", "showPreview", "existingFile", "indeterminate"], outputs: ["refreshEvent", "fileRemoved", "textChanged", "valueChange", "phoneRegionChange"] }, { kind: "component", type: FilterSelectComponent, selector: "cw-filter-select", inputs: ["control", "label", "options", "multiple", "allLabel", "inputId", "readonly", "appendTo"] }, { kind: "component", type: ButtonComponent, selector: "cw-button", inputs: ["type", "label", "id", "link", "isDropdown", "hideCaret", "withIcon", "withOnlyIcon", "iconSize", "iconPosition", "dropdownPosition", "isMinWidth", "isDisabled", "isLoading", "loadingAnnounce", "cssClass", "dataTest", "skeletonMode", "isPressed", "ariaDescribedBy", "withTooltip", "tooltipText", "tooltipTitle", "tooltipTrigger", "tooltipPosition", "tooltipType"], outputs: ["btnAction", "dropDownClicked"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
1472
+ 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 }, search: { classPropertyName: "search", publicName: "search", isSignal: true, isRequired: false, 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 }, columns: { classPropertyName: "columns", publicName: "columns", isSignal: true, isRequired: false, transformFunction: null }, columnsStorageKey: { classPropertyName: "columnsStorageKey", publicName: "columnsStorageKey", isSignal: true, isRequired: false, transformFunction: null }, columnsLabel: { classPropertyName: "columnsLabel", publicName: "columnsLabel", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { filtersApplied: "filtersApplied", filtersReset: "filtersReset", columnsChange: "columnsChange" }, viewQueries: [{ propertyName: "advancedToggle", first: true, predicate: ["advancedToggle"], descendants: true, read: ElementRef, isSignal: true }], ngImport: i0, template: "<!-- Cl\u00E9s i18n pass\u00E9es telles quelles : cw-form-field et cw-button traduisent label et placeholder eux-m\u00EAmes. -->\r\n<form [formGroup]=\"filterForm\" (ngSubmit)=\"apply()\" class=\"filter-bar d-flex-v gap-md\">\r\n <div class=\"d-flex-h gap-md items-start justify-between\">\r\n <div class=\"d-flex-h flex-wrap gap-md items-center\">\r\n @if (search(); as searchConfig) {\r\n <!-- Recherche unifi\u00E9e : remplace les champs list\u00E9s dans `search.fields`. Label masqu\u00E9\r\n (la loupe + le placeholder l'identifient visuellement) et repris en title au survol. -->\r\n <div class=\"filter-field\" [class]=\"searchConfig.colClass ?? ''\">\r\n <cw-form-field\r\n [name]=\"fieldId(searchKey())\"\r\n [label]=\"searchLabel()\"\r\n [displayLabel]=\"false\"\r\n [fieldTitle]=\"searchLabel()\"\r\n [type]=\"fieldType.text\"\r\n [placeholder]=\"searchConfig.placeholder ?? '_COMMON._FILTER.KEYWORDS'\"\r\n [addonLeft]=\"searchIcon\"\r\n [control]=\"getControl(searchKey())\">\r\n </cw-form-field>\r\n </div>\r\n }\r\n @for (field of barFields(); track field.key) {\r\n <div class=\"filter-field\" [class]=\"field.colClass ?? ''\" [class.filter-field-text]=\"isTextField(field)\">\r\n <ng-container\r\n [ngTemplateOutlet]=\"fieldTpl\"\r\n [ngTemplateOutletContext]=\"{ $implicit: field, control: getControl(field.key) }\">\r\n </ng-container>\r\n </div>\r\n }\r\n @if (advancedFields().length) {\r\n <div class=\"d-flex-h items-center gap-5xs\">\r\n <cw-button #advancedToggle\r\n [label]=\"advancedLabel()\"\r\n [type]=\"uiType.link\"\r\n [ariaExpanded]=\"advancedOpen()\"\r\n [ariaControls]=\"advancedPanelId\"\r\n [ariaLabel]=\"!advancedOpen() && advancedChips().length ? '_COMMON._FILTER.MORE_COUNT' : undefined\"\r\n [labelParams]=\"{ count: advancedChips().length }\"\r\n (btnAction)=\"toggleAdvanced()\">\r\n </cw-button>\r\n @if (!advancedOpen() && advancedChips().length; as count) {\r\n <!-- Compteur (repli\u00E9 seulement : d\u00E9pli\u00E9, les champs montrent d\u00E9j\u00E0 les valeurs) ;\r\n d\u00E9coratif : le nombre est dans le nom accessible du bouton (\u00AB Plus de filtres, 2 actifs \u00BB). -->\r\n <cw-badge [type]=\"badgeType.lightLight\" [label]=\"'' + count\" aria-hidden=\"true\" />\r\n }\r\n </div>\r\n }\r\n @if (hasFields()) {\r\n <div class=\"d-flex-h gap-md\">\r\n @if (manual()) {\r\n <cw-button\r\n [label]=\"applyLabel()\"\r\n [type]=\"uiType.link\"\r\n (btnAction)=\"apply()\">\r\n </cw-button>\r\n }\r\n <cw-button\r\n [label]=\"resetLabel()\"\r\n [type]=\"uiType.link\"\r\n (btnAction)=\"reset()\">\r\n </cw-button>\r\n </div>\r\n }\r\n </div>\r\n <!-- Menu \u00AB Colonnes \u00BB a droite ; ne s'affiche que si `columns` contient une colonne masquable. -->\r\n <cw-column-menu\r\n [columns]=\"columns()\"\r\n [storageKey]=\"columnsStorageKey()\"\r\n [label]=\"columnsLabel()\"\r\n (columnsChange)=\"columnsChange.emit($event)\">\r\n </cw-column-menu>\r\n </div>\r\n\r\n @if (advancedFields().length) {\r\n <!-- Champs avanc\u00E9s : appliqu\u00E9s comme ceux de la barre (\u00E0 la saisie, ou au bouton en mode manuel).\r\n Toujours dans le DOM (cible de aria-controls), masqu\u00E9s par `hidden` quand repli\u00E9s. -->\r\n <div class=\"d-flex-h flex-wrap gap-md\" role=\"group\" [id]=\"advancedPanelId\" [hidden]=\"!advancedOpen()\"\r\n [attr.aria-label]=\"'_COMMON._FILTER.ADVANCED' | translate\">\r\n @for (field of advancedFields(); track field.key) {\r\n <div class=\"filter-field\" [class]=\"field.colClass ?? ''\" [class.filter-field-text]=\"isTextField(field)\">\r\n <ng-container\r\n [ngTemplateOutlet]=\"fieldTpl\"\r\n [ngTemplateOutletContext]=\"{ $implicit: field, control: getControl(field.key) }\">\r\n </ng-container>\r\n </div>\r\n }\r\n </div>\r\n }\r\n\r\n <!-- \u00C9tiquettes : seulement repli\u00E9, sinon doublon avec les champs avanc\u00E9s affich\u00E9s. -->\r\n @if (!advancedOpen() && advancedChips().length) {\r\n <ul class=\"filter-bar-chips list-unstyled d-flex-h flex-wrap gap-sm items-center\" [attr.aria-label]=\"'_COMMON._FILTER.ACTIVE' | translate\">\r\n @for (chip of advancedChips(); track chip.key) {\r\n <li class=\"badge badge-light-light d-flex-h items-center gap-5xs\">\r\n <span>\r\n {{ chip.label | translate }} : {{ chipText(chip) }}\r\n </span>\r\n <cw-button\r\n [label]=\"'_COMMON._FILTER.REMOVE'\"\r\n [labelParams]=\"{ label: (chip.label | translate), value: chipText(chip) }\"\r\n [type]=\"uiType.ghost\"\r\n [withIcon]=\"spriteIcon.close\"\r\n [withOnlyIcon]=\"true\"\r\n [iconSize]=\"iconSize.xsmall\"\r\n (btnAction)=\"removeAdvanced(chip.key)\">\r\n </cw-button>\r\n </li>\r\n }\r\n </ul>\r\n }\r\n</form>\r\n\r\n<!-- Addon gauche de la recherche unifi\u00E9e : loupe d\u00E9corative (le nom accessible reste le label du champ). -->\r\n<ng-template #searchIcon>\r\n <cw-icon [icon]=\"spriteIcon.search\" />\r\n</ng-template>\r\n\r\n<!-- Rendu d'un champ de filtre, partag\u00E9 par la barre et les champs avanc\u00E9s. -->\r\n<ng-template #fieldTpl let-field let-control=\"control\">\r\n @if (isSelect(field)) {\r\n <cw-filter-select\r\n [label]=\"field.label\"\r\n [options]=\"resolveOptions(field)\"\r\n [multiple]=\"isMultiple(field)\"\r\n [allLabel]=\"field.allLabel === undefined ? '_COMMON._FILTER.ALL' : field.allLabel\"\r\n [inputId]=\"fieldId(field.key)\"\r\n [control]=\"$any(control)\">\r\n </cw-filter-select>\r\n } @else {\r\n <cw-form-field\r\n [name]=\"fieldId(field.key)\"\r\n [label]=\"field.label\"\r\n [displayLabel]=\"isTextField(field)\"\r\n [fieldTitle]=\"isTextField(field) ? undefined : field.label\"\r\n [type]=\"field.type\"\r\n [placeholder]=\"field.placeholder ?? ''\"\r\n [options]=\"resolveOptions(field)\"\r\n [control]=\"control\">\r\n </cw-form-field>\r\n }\r\n</ng-template>\r\n", dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { 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: "ngmodule", type: TranslateModule }, { kind: "component", type: BadgeComponent, selector: "cw-badge", inputs: ["type", "label", "labelParams", "withIcon", "iconPosition", "cssClass", "skeletonMode", "dataTest"] }, { kind: "component", type: IconComponent, selector: "cw-icon", inputs: ["icon", "label", "type", "iconSize", "iconCssClass", "iconUiType", "iconColorCustom", "spritePath"] }, { kind: "component", type: FormFieldComponent, selector: "cw-form-field", inputs: ["control", "formGroup", "type", "label", "displayLabel", "fieldTitle", "name", "placeholder", "autocomplete", "options", "rangeOptions", "validationOptions", "autocompleteOptions", "richTextOptions", "errorMessages", "isRequired", "help", "tooltip", "ariaDescribedBy", "addonLeft", "addonRight", "isInAddon", "isReadonly", "isDisabled", "sliderValue", "sliderOptions", "cssClass", "skeletonMode", "clearable", "appendTo", "initialCountry", "recommendedDimensions", "showPreview", "existingFile", "indeterminate"], outputs: ["refreshEvent", "fileRemoved", "textChanged", "valueChange", "phoneRegionChange"] }, { kind: "component", type: FilterSelectComponent, selector: "cw-filter-select", inputs: ["control", "label", "options", "multiple", "allLabel", "inputId", "readonly", "appendTo"] }, { kind: "component", type: ButtonComponent, selector: "cw-button", inputs: ["type", "label", "labelParams", "id", "link", "isDropdown", "hideCaret", "withIcon", "withOnlyIcon", "iconSize", "iconPosition", "dropdownPosition", "isMinWidth", "isDisabled", "isLoading", "loadingAnnounce", "cssClass", "dataTest", "skeletonMode", "isPressed", "ariaDescribedBy", "ariaLabel", "ariaExpanded", "ariaControls", "withTooltip", "tooltipText", "tooltipTitle", "tooltipTrigger", "tooltipPosition", "tooltipType"], outputs: ["btnAction", "dropDownClicked"] }, { kind: "component", type: ColumnMenuComponent, selector: "cw-column-menu", inputs: ["columns", "storageKey", "label"], outputs: ["columnsChange"] }, { kind: "pipe", type: i1.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
1195
1473
  }
1196
1474
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: FilterBarComponent, decorators: [{
1197
1475
  type: Component,
1198
1476
  args: [{ selector: 'cw-filter-bar', changeDetection: ChangeDetectionStrategy.OnPush, imports: [
1477
+ NgTemplateOutlet,
1199
1478
  ReactiveFormsModule,
1479
+ TranslateModule,
1480
+ BadgeComponent,
1481
+ IconComponent,
1200
1482
  FormFieldComponent,
1201
1483
  FilterSelectComponent,
1202
- ButtonComponent
1203
- ], template: "<!-- Cl\u00E9s i18n pass\u00E9es telles quelles : cw-form-field et cw-button traduisent label et placeholder eux-m\u00EAmes. -->\n<form [formGroup]=\"filterForm\" (ngSubmit)=\"apply()\" class=\"filter-bar\">\n <div class=\"d-flex-h flex-wrap gap-md\">\n @for (field of filters(); track field.key) {\n <div class=\"filter-field\" [class]=\"field.colClass ?? ''\">\n @if (isSelect(field)) {\n <cw-filter-select\n [label]=\"field.label\"\n [options]=\"resolveOptions(field)\"\n [multiple]=\"isMultiple(field)\"\n [allLabel]=\"field.allLabel === undefined ? '_COMMON._FILTER.ALL' : field.allLabel\"\n [inputId]=\"'filter-' + field.key\"\n [control]=\"$any(getControl(field.key))\">\n </cw-filter-select>\n } @else {\n <cw-form-field\n [label]=\"field.label\"\n [displayLabel]=\"false\"\n [type]=\"field.type\"\n [placeholder]=\"field.placeholder ?? ''\"\n [options]=\"resolveOptions(field)\"\n [control]=\"getControl(field.key)\">\n </cw-form-field>\n }\n </div>\n }\n <div class=\"d-flex-h gap-md\">\n @if (manual()) {\n <cw-button\n [label]=\"applyLabel()\"\n [type]=\"uiType.link\"\n (btnAction)=\"apply()\">\n </cw-button>\n }\n <cw-button\n [label]=\"resetLabel()\"\n [type]=\"uiType.link\"\n (btnAction)=\"reset()\">\n </cw-button>\n </div>\n </div>\n</form>\n" }]
1204
- }], 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"] }] } });
1484
+ ButtonComponent,
1485
+ ColumnMenuComponent
1486
+ ], template: "<!-- Cl\u00E9s i18n pass\u00E9es telles quelles : cw-form-field et cw-button traduisent label et placeholder eux-m\u00EAmes. -->\r\n<form [formGroup]=\"filterForm\" (ngSubmit)=\"apply()\" class=\"filter-bar d-flex-v gap-md\">\r\n <div class=\"d-flex-h gap-md items-start justify-between\">\r\n <div class=\"d-flex-h flex-wrap gap-md items-center\">\r\n @if (search(); as searchConfig) {\r\n <!-- Recherche unifi\u00E9e : remplace les champs list\u00E9s dans `search.fields`. Label masqu\u00E9\r\n (la loupe + le placeholder l'identifient visuellement) et repris en title au survol. -->\r\n <div class=\"filter-field\" [class]=\"searchConfig.colClass ?? ''\">\r\n <cw-form-field\r\n [name]=\"fieldId(searchKey())\"\r\n [label]=\"searchLabel()\"\r\n [displayLabel]=\"false\"\r\n [fieldTitle]=\"searchLabel()\"\r\n [type]=\"fieldType.text\"\r\n [placeholder]=\"searchConfig.placeholder ?? '_COMMON._FILTER.KEYWORDS'\"\r\n [addonLeft]=\"searchIcon\"\r\n [control]=\"getControl(searchKey())\">\r\n </cw-form-field>\r\n </div>\r\n }\r\n @for (field of barFields(); track field.key) {\r\n <div class=\"filter-field\" [class]=\"field.colClass ?? ''\" [class.filter-field-text]=\"isTextField(field)\">\r\n <ng-container\r\n [ngTemplateOutlet]=\"fieldTpl\"\r\n [ngTemplateOutletContext]=\"{ $implicit: field, control: getControl(field.key) }\">\r\n </ng-container>\r\n </div>\r\n }\r\n @if (advancedFields().length) {\r\n <div class=\"d-flex-h items-center gap-5xs\">\r\n <cw-button #advancedToggle\r\n [label]=\"advancedLabel()\"\r\n [type]=\"uiType.link\"\r\n [ariaExpanded]=\"advancedOpen()\"\r\n [ariaControls]=\"advancedPanelId\"\r\n [ariaLabel]=\"!advancedOpen() && advancedChips().length ? '_COMMON._FILTER.MORE_COUNT' : undefined\"\r\n [labelParams]=\"{ count: advancedChips().length }\"\r\n (btnAction)=\"toggleAdvanced()\">\r\n </cw-button>\r\n @if (!advancedOpen() && advancedChips().length; as count) {\r\n <!-- Compteur (repli\u00E9 seulement : d\u00E9pli\u00E9, les champs montrent d\u00E9j\u00E0 les valeurs) ;\r\n d\u00E9coratif : le nombre est dans le nom accessible du bouton (\u00AB Plus de filtres, 2 actifs \u00BB). -->\r\n <cw-badge [type]=\"badgeType.lightLight\" [label]=\"'' + count\" aria-hidden=\"true\" />\r\n }\r\n </div>\r\n }\r\n @if (hasFields()) {\r\n <div class=\"d-flex-h gap-md\">\r\n @if (manual()) {\r\n <cw-button\r\n [label]=\"applyLabel()\"\r\n [type]=\"uiType.link\"\r\n (btnAction)=\"apply()\">\r\n </cw-button>\r\n }\r\n <cw-button\r\n [label]=\"resetLabel()\"\r\n [type]=\"uiType.link\"\r\n (btnAction)=\"reset()\">\r\n </cw-button>\r\n </div>\r\n }\r\n </div>\r\n <!-- Menu \u00AB Colonnes \u00BB a droite ; ne s'affiche que si `columns` contient une colonne masquable. -->\r\n <cw-column-menu\r\n [columns]=\"columns()\"\r\n [storageKey]=\"columnsStorageKey()\"\r\n [label]=\"columnsLabel()\"\r\n (columnsChange)=\"columnsChange.emit($event)\">\r\n </cw-column-menu>\r\n </div>\r\n\r\n @if (advancedFields().length) {\r\n <!-- Champs avanc\u00E9s : appliqu\u00E9s comme ceux de la barre (\u00E0 la saisie, ou au bouton en mode manuel).\r\n Toujours dans le DOM (cible de aria-controls), masqu\u00E9s par `hidden` quand repli\u00E9s. -->\r\n <div class=\"d-flex-h flex-wrap gap-md\" role=\"group\" [id]=\"advancedPanelId\" [hidden]=\"!advancedOpen()\"\r\n [attr.aria-label]=\"'_COMMON._FILTER.ADVANCED' | translate\">\r\n @for (field of advancedFields(); track field.key) {\r\n <div class=\"filter-field\" [class]=\"field.colClass ?? ''\" [class.filter-field-text]=\"isTextField(field)\">\r\n <ng-container\r\n [ngTemplateOutlet]=\"fieldTpl\"\r\n [ngTemplateOutletContext]=\"{ $implicit: field, control: getControl(field.key) }\">\r\n </ng-container>\r\n </div>\r\n }\r\n </div>\r\n }\r\n\r\n <!-- \u00C9tiquettes : seulement repli\u00E9, sinon doublon avec les champs avanc\u00E9s affich\u00E9s. -->\r\n @if (!advancedOpen() && advancedChips().length) {\r\n <ul class=\"filter-bar-chips list-unstyled d-flex-h flex-wrap gap-sm items-center\" [attr.aria-label]=\"'_COMMON._FILTER.ACTIVE' | translate\">\r\n @for (chip of advancedChips(); track chip.key) {\r\n <li class=\"badge badge-light-light d-flex-h items-center gap-5xs\">\r\n <span>\r\n {{ chip.label | translate }} : {{ chipText(chip) }}\r\n </span>\r\n <cw-button\r\n [label]=\"'_COMMON._FILTER.REMOVE'\"\r\n [labelParams]=\"{ label: (chip.label | translate), value: chipText(chip) }\"\r\n [type]=\"uiType.ghost\"\r\n [withIcon]=\"spriteIcon.close\"\r\n [withOnlyIcon]=\"true\"\r\n [iconSize]=\"iconSize.xsmall\"\r\n (btnAction)=\"removeAdvanced(chip.key)\">\r\n </cw-button>\r\n </li>\r\n }\r\n </ul>\r\n }\r\n</form>\r\n\r\n<!-- Addon gauche de la recherche unifi\u00E9e : loupe d\u00E9corative (le nom accessible reste le label du champ). -->\r\n<ng-template #searchIcon>\r\n <cw-icon [icon]=\"spriteIcon.search\" />\r\n</ng-template>\r\n\r\n<!-- Rendu d'un champ de filtre, partag\u00E9 par la barre et les champs avanc\u00E9s. -->\r\n<ng-template #fieldTpl let-field let-control=\"control\">\r\n @if (isSelect(field)) {\r\n <cw-filter-select\r\n [label]=\"field.label\"\r\n [options]=\"resolveOptions(field)\"\r\n [multiple]=\"isMultiple(field)\"\r\n [allLabel]=\"field.allLabel === undefined ? '_COMMON._FILTER.ALL' : field.allLabel\"\r\n [inputId]=\"fieldId(field.key)\"\r\n [control]=\"$any(control)\">\r\n </cw-filter-select>\r\n } @else {\r\n <cw-form-field\r\n [name]=\"fieldId(field.key)\"\r\n [label]=\"field.label\"\r\n [displayLabel]=\"isTextField(field)\"\r\n [fieldTitle]=\"isTextField(field) ? undefined : field.label\"\r\n [type]=\"field.type\"\r\n [placeholder]=\"field.placeholder ?? ''\"\r\n [options]=\"resolveOptions(field)\"\r\n [control]=\"control\">\r\n </cw-form-field>\r\n }\r\n</ng-template>\r\n" }]
1487
+ }], ctorParameters: () => [], propDecorators: { filters: [{ type: i0.Input, args: [{ isSignal: true, alias: "filters", required: true }] }], search: [{ type: i0.Input, args: [{ isSignal: true, alias: "search", required: false }] }], 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 }] }], columns: [{ type: i0.Input, args: [{ isSignal: true, alias: "columns", required: false }] }], columnsStorageKey: [{ type: i0.Input, args: [{ isSignal: true, alias: "columnsStorageKey", required: false }] }], columnsLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "columnsLabel", required: false }] }], filtersApplied: [{ type: i0.Output, args: ["filtersApplied"] }], filtersReset: [{ type: i0.Output, args: ["filtersReset"] }], columnsChange: [{ type: i0.Output, args: ["columnsChange"] }], advancedToggle: [{ type: i0.ViewChild, args: ['advancedToggle', { ...{ read: ElementRef }, isSignal: true }] }] } });
1205
1488
 
1206
1489
  // Type nominal des cles de traduction, partage par tous les composants de la lib.
1207
1490
  //
@@ -1384,7 +1667,7 @@ class ExportButtonComponent {
1384
1667
  });
1385
1668
  }
1386
1669
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: ExportButtonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
1387
- 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 [isLoading]=\"running()\" [loadingAnnounce]=\"false\">\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 <!-- Option unique : c'est le libelle de L'OPTION qui nomme le bouton, pas `label()`.\n L'inverse rendait `ExportOption.label` obligatoire mais mort dans ce mode \u2014 l'hote\n ecrivait un libelle qui n'apparaissait nulle part. `label()` reste le libelle du\n declencheur de MENU, ou les options sont nommees une a une. -->\n <cw-button [type]=\"buttonType.secondary\" [label]=\"options()[0].label\" [isDisabled]=\"!!options()[0].disabled\"\n [isLoading]=\"running()\" [loadingAnnounce]=\"false\" (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", "loadingAnnounce", "cssClass", "dataTest", "skeletonMode", "isPressed", "ariaDescribedBy", "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 }); }
1670
+ 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 [isLoading]=\"running()\" [loadingAnnounce]=\"false\">\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 <!-- Option unique : c'est le libelle de L'OPTION qui nomme le bouton, pas `label()`.\n L'inverse rendait `ExportOption.label` obligatoire mais mort dans ce mode \u2014 l'hote\n ecrivait un libelle qui n'apparaissait nulle part. `label()` reste le libelle du\n declencheur de MENU, ou les options sont nommees une a une. -->\n <cw-button [type]=\"buttonType.secondary\" [label]=\"options()[0].label\" [isDisabled]=\"!!options()[0].disabled\"\n [isLoading]=\"running()\" [loadingAnnounce]=\"false\" (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", "labelParams", "id", "link", "isDropdown", "hideCaret", "withIcon", "withOnlyIcon", "iconSize", "iconPosition", "dropdownPosition", "isMinWidth", "isDisabled", "isLoading", "loadingAnnounce", "cssClass", "dataTest", "skeletonMode", "isPressed", "ariaDescribedBy", "ariaLabel", "ariaExpanded", "ariaControls", "withTooltip", "tooltipText", "tooltipTitle", "tooltipTrigger", "tooltipPosition", "tooltipType"], outputs: ["btnAction", "dropDownClicked"] }, { kind: "directive", type: DropdownItemDirective, selector: "[cwDropdownItem]" }, { kind: "ngmodule", type: TranslateModule }, { kind: "pipe", type: i1.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
1388
1671
  }
1389
1672
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: ExportButtonComponent, decorators: [{
1390
1673
  type: Component,
@@ -2043,7 +2326,7 @@ class ImportWizardComponent {
2043
2326
  }));
2044
2327
  }
2045
2328
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: ImportWizardComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
2046
- 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.\r\n Rendue dans [header-start] pour etre AVANT le titre, comme sur les maquettes.\r\n Le numero seul n'etant pas parlant a l'oreille, le statut est double en visually-hidden --\r\n et c'est LUI qui distingue \u00AB en cours \u00BB de \u00AB a venir \u00BB pour qui ne voit pas la couleur. -->\r\n<ng-template #badge let-stepKey=\"stepKey\" let-number=\"number\">\r\n @if (stateOf(stepKey) === stepState.done) {\r\n <cw-icon [icon]=\"spriteIcon.check\" [type]=\"iconType.circular\" [iconSize]=\"iconSize['sm']\"\r\n [iconUiType]=\"iconUiType.success\" [label]=\"stepStatusLabel(stepKey) | translate\"></cw-icon>\r\n }\r\n @else if (stateOf(stepKey) === stepState.error) {\r\n <cw-icon [icon]=\"spriteIcon.close\" [type]=\"iconType.circular\" [iconSize]=\"iconSize['sm']\"\r\n [iconUiType]=\"iconUiType.danger\" [label]=\"stepStatusLabel(stepKey) | translate\"></cw-icon>\r\n }\r\n @else {\r\n <div class=\"icon-circular icon-circular-sm\" [class]=\"'icon-circular-' + badgeVariant(stepKey)\">\r\n <span aria-hidden=\"true\">{{ number }}</span>\r\n <span class=\"visually-hidden\">{{ stepStatusLabel(stepKey) | translate }}</span>\r\n </div>\r\n }\r\n</ng-template>\r\n\r\n<ng-template #counts let-rows=\"rows\">\r\n <ul class=\"list-unstyled d-flex-h gap-md\">\r\n @for (row of rows; track row.key) {\r\n <li>\r\n <span class=\"fs-lg fw-bold\" [class]=\"'text-' + row.tone\">{{ row.count }}</span> {{ row.key | translate: row.params }}\r\n </li>\r\n }\r\n </ul>\r\n</ng-template>\r\n\r\n<cw-accordion [closeOthers]=\"true\" [destroyOnHide]=\"false\">\r\n\r\n <!-- Etape 1 : fichier + type d'import -->\r\n <cw-card\r\n #stepPanel\r\n [title]=\"'_COMMON._IMPORT._STEP.SELECT'\"\r\n [collapseId]=\"'import-step-select'\"\r\n [collapsed]=\"!isPanelOpen(step.select)\"\r\n [collapseLocked]=\"stateOf(step.select) === stepState.done\"\r\n [disabled]=\"stateOf(step.select) === stepState.todo\"\r\n [collapseStretched]=\"false\">\r\n\r\n <ng-container ngProjectAs=\"[header-start]\">\r\n <ng-container *ngTemplateOutlet=\"badge; context: { stepKey: step.select, number: 1 }\"></ng-container>\r\n </ng-container>\r\n\r\n <div class=\"d-flex-v gap-md\">\r\n <div class=\"row\">\r\n <div class=\"col-lg-6\">\r\n <!-- Retour depuis une analyse non conforme : cible de focus. Le bouton qui declenche\r\n ce retour disparait avec le repli du panneau 2, le focus retomberait sur <body>. -->\r\n @if (selectionReopened()) {\r\n <h3 class=\"visually-hidden\" tabindex=\"-1\" #selectionTarget>\r\n {{ '_COMMON._IMPORT._A11Y.SELECTION' | translate }}\r\n </h3>\r\n }\r\n\r\n <cw-file-drop\r\n [formControl]=\"file\"\r\n [accept]=\"config().accept\"\r\n [acceptLabel]=\"config().acceptLabel\"\r\n [maxSizeMb]=\"maxSizeMb()\"\r\n [label]=\"'_COMMON._IMPORT.FILE_TO_IMPORT' | translate\">\r\n </cw-file-drop>\r\n\r\n @if (config().helpText; as helpText) {\r\n <p class=\"mt-2xs\">{{ helpText | translate }}</p>\r\n }\r\n </div>\r\n\r\n @if (config().templateFile) {\r\n <div class=\"col-lg-6\">\r\n <cw-card [type]=\"cardType.light\">\r\n <strong>{{ '_COMMON._IMPORT._TEMPLATE.TITLE' | translate }}</strong>\r\n <span>{{ '_COMMON._IMPORT._TEMPLATE.TEXT' | translate }}</span>\r\n <cw-file-to-download [attachments]=\"templateAttachments()\"></cw-file-to-download>\r\n </cw-card>\r\n </div>\r\n }\r\n </div>\r\n\r\n <!-- Mode IMPOSE : aucun champ, et pas davantage de ligne \u00AB Type d'import : ... \u00BB \u2014 la\r\n maquette ne rend que l'alerte de portee ci-dessous, qui informe deja du mode retenu.\r\n Le champ cle de rapprochement y est replie (voir l'alerte).\r\n Choix LIBRE : groupe radio, dont la selection est REQUISE (pas de preselection). -->\r\n @if (!isModeImposed()) {\r\n <cw-form-field\r\n [type]=\"fieldType.radio\"\r\n [control]=\"mode\"\r\n [name]=\"'importMode'\"\r\n [label]=\"'_COMMON._IMPORT._MODE.LABEL'\"\r\n [options]=\"modeOptions()\"\r\n [isRequired]=\"true\"\r\n [help]=\"selectedKeyFieldHint()\">\r\n </cw-form-field>\r\n }\r\n\r\n <!-- Portee du mode retenu (destructif ou non) : exigence SFD \u00AB l'utilisateur est\r\n informe du type d'import selectionne ou impose \u00BB. Rien tant qu'aucun mode n'est\r\n retenu : l'alerte ne decrit jamais un mode que l'utilisateur n'a pas choisi. -->\r\n @if (modeNotice(); as notice) {\r\n <cw-alert [type]=\"modeNoticeType()\">\r\n {{ notice.lead | translate }}\r\n @if (notice.items.length) {\r\n <ul class=\"mb-none\">\r\n @for (item of notice.items; track $index) {\r\n <li>{{ item | translate }}</li>\r\n }\r\n </ul>\r\n }\r\n <!-- Mode impose : l'alerte est le SEUL endroit qui reste pour dire sur quoi porte\r\n le rapprochement. En choix libre, c'est l'aide du groupe radio qui le porte. -->\r\n @if (isModeImposed() && selectedKeyFieldHint(); as keyFieldHint) {\r\n <p class=\"mb-none\">{{ keyFieldHint | translate }}</p>\r\n }\r\n </cw-alert>\r\n }\r\n\r\n <!-- Un bouton desactive muet est un cul-de-sac : ce texte dit ce qui manque, et il est\r\n place AVANT le bouton, seul chemin possible puisqu'un bouton desactive n'est pas\r\n focusable (donc pas d'aria-describedby exploitable). Pas de classe de couleur\r\n atenuee : c'est une information necessaire, elle garde le contraste du corps. -->\r\n <div class=\"d-flex-h justify-end gap-md\">\r\n @if (missingRequirementKey(); as missing) {\r\n <p class=\"mb-none fs-xs\">{{ missing | translate }}</p>\r\n }\r\n\r\n <cw-button\r\n [type]=\"buttonType.primary\"\r\n [label]=\"'_COMMON._IMPORT.CONTINUE'\"\r\n [dataTest]=\"'btn-import-continue'\"\r\n [isDisabled]=\"!canContinue()\"\r\n (btnAction)=\"continueToAnalysis()\">\r\n </cw-button>\r\n </div>\r\n </div>\r\n </cw-card>\r\n\r\n <!-- Etape 2 : analyse a blanc -->\r\n <cw-card\r\n #stepPanel\r\n [title]=\"'_COMMON._IMPORT._STEP.ANALYSIS'\"\r\n [collapseId]=\"'import-step-analysis'\"\r\n [collapsed]=\"!isPanelOpen(step.analysis)\"\r\n [collapseLocked]=\"stateOf(step.analysis) === stepState.done\"\r\n [disabled]=\"stateOf(step.analysis) === stepState.todo\"\r\n [collapseStretched]=\"false\">\r\n\r\n <ng-container ngProjectAs=\"[header-start]\">\r\n <ng-container *ngTemplateOutlet=\"badge; context: { stepKey: step.analysis, number: 2 }\"></ng-container>\r\n </ng-container>\r\n\r\n <div class=\"d-flex-v gap-md\">\r\n @if (analyzing()) {\r\n <!-- Cible de focus : ce texte EST le message d'etat, il est donc lu une fois et une\r\n seule (aucune region live en doublon). -->\r\n <span tabindex=\"-1\" #analysisStatus>{{ '_COMMON._IMPORT.ANALYSIS_IN_PROGRESS' | translate }}</span>\r\n }\r\n @else if (analysis(); as result) {\r\n <!-- Cible de focus a l'arrivee du resultat : libelle de section, pas une reprise du\r\n message, pour que la lecture enchaine sur l'alerte puis les compteurs. -->\r\n <h3 class=\"visually-hidden\" tabindex=\"-1\" #analysisOutcome>\r\n {{ '_COMMON._IMPORT._A11Y.ANALYSIS_RESULT' | translate }}\r\n </h3>\r\n\r\n @if (result.valid) {\r\n <cw-alert [type]=\"alertType.success\">\r\n {{ '_COMMON._IMPORT.ANALYSIS_OK' | translate }}\r\n </cw-alert>\r\n\r\n <!-- scope=list : previsualisation chiffree. scope=singleConfig : le message ci-dessus suffit. -->\r\n @if (isList() && previewRows().length) {\r\n <ng-container *ngTemplateOutlet=\"counts; context: { rows: previewRows() }\"></ng-container>\r\n }\r\n\r\n <div class=\"list-unstyled d-flex-h justify-end\">\r\n <cw-button\r\n [type]=\"buttonType.primary\"\r\n [label]=\"'_COMMON._IMPORT.START'\"\r\n [dataTest]=\"'btn-import-start'\"\r\n (btnAction)=\"startImport()\">\r\n </cw-button>\r\n </div>\r\n }\r\n @else {\r\n <cw-alert [type]=\"alertType.danger\">\r\n {{ '_COMMON._IMPORT.ANALYSIS_KO' | translate }}\r\n </cw-alert>\r\n\r\n @if (errorCountRow(); as errorCount) {\r\n <p class=\"mb-none\">\r\n <span class=\"fs-lg fw-bold\" [class]=\"'text-' + errorCount.tone\">{{ errorCount.count }}</span>\r\n {{ errorCount.key | translate }}\r\n </p>\r\n\r\n <!-- Une alerte par anomalie, et non une liste a puces : c'est le rendu de la\r\n maquette, et chaque message reste lisible isolement. -->\r\n @for (issue of errors(); track $index) {\r\n <cw-alert [type]=\"alertType.danger\">\r\n @if (issue.line !== undefined) {\r\n <strong>{{ '_COMMON._IMPORT.ERROR_LINE' | translate: { line: issue.line } }}</strong>\r\n }\r\n {{ issue.messageKey ? (issue.messageKey | translate: issue.messageParams) : issue.message }}\r\n </cw-alert>\r\n }\r\n }\r\n\r\n <div class=\"d-flex-h justify-end\">\r\n <cw-button\r\n [type]=\"buttonType.secondary\"\r\n [label]=\"'_COMMON._IMPORT.BACK_TO_SELECTION'\"\r\n [dataTest]=\"'btn-import-back'\"\r\n (btnAction)=\"backToSelection()\">\r\n </cw-button>\r\n </div>\r\n }\r\n }\r\n </div>\r\n </cw-card>\r\n\r\n <!-- Etape 3 : import -->\r\n <cw-card\r\n #stepPanel\r\n [title]=\"'_COMMON._IMPORT._STEP.EXECUTION'\"\r\n [collapseId]=\"'import-step-execution'\"\r\n [collapsed]=\"!isPanelOpen(step.execution)\"\r\n [disabled]=\"stateOf(step.execution) === stepState.todo\"\r\n [collapseStretched]=\"false\">\r\n\r\n <ng-container ngProjectAs=\"[header-start]\">\r\n <ng-container *ngTemplateOutlet=\"badge; context: { stepKey: step.execution, number: 3 }\"></ng-container>\r\n </ng-container>\r\n\r\n <div class=\"d-flex-v gap-md\">\r\n @if (isImporting) {\r\n <div class=\"d-flex-v gap-2xs\">\r\n <!-- Cible de focus. Le bouton \u00AB Arreter l'import \u00BB est le focusable suivant. -->\r\n <span tabindex=\"-1\" #executionStatus>{{ '_COMMON._IMPORT.IN_PROGRESS' | translate }}</span>\r\n @if (progress()?.remainingLabel; as remaining) {\r\n <span>{{ '_COMMON._IMPORT.REMAINING' | translate: { value: remaining } }}</span>\r\n }\r\n </div>\r\n\r\n <!-- Avancement connu => barre deterministe. Aucune progression recue => spinner\r\n indetermine, plutot qu'une barre figee a 0 %. La bascule se fait a la premiere\r\n emission `ImportProgress` : une source qui n'en emet jamais reste sur le spinner.\r\n `displayText` a false : le libelle \u00AB Import en cours \u00BB est deja au-dessus. -->\r\n @if (progress(); as current) {\r\n <cw-progress-bar\r\n [value]=\"current.percent\"\r\n [type]=\"progressType.information\"\r\n [label]=\"'_COMMON._IMPORT.IN_PROGRESS' | translate\">\r\n </cw-progress-bar>\r\n }\r\n @else {\r\n <cw-loader [size]=\"loaderSize.sm\" [displayText]=\"false\"></cw-loader>\r\n }\r\n\r\n <!-- Pas de bouton d'arret quand l'objet declare l'import non interruptible : un\r\n bouton qui ne peut rien arreter serait pire que son absence. -->\r\n @if (canInterrupt()) {\r\n <div class=\"d-flex-h justify-end\">\r\n <cw-button\r\n [type]=\"buttonType.dangerOutline\"\r\n [label]=\"'_COMMON._IMPORT.STOP'\"\r\n [dataTest]=\"'btn-import-stop'\"\r\n (btnAction)=\"stopImport()\">\r\n </cw-button>\r\n </div>\r\n }\r\n }\r\n @else if (cancelling()) {\r\n <!-- Annulation demandee au serveur, reponse en attente. Cible de focus. -->\r\n <span tabindex=\"-1\" #cancellingStatus>{{ '_COMMON._IMPORT.CANCELLING' | translate }}</span>\r\n\r\n <cw-loader [size]=\"loaderSize.sm\" [displayText]=\"false\"></cw-loader>\r\n\r\n <!-- Sortie de secours : aucun delai n'etant defendable depuis la lib, c'est\r\n l'utilisateur qui decide d'arreter d'attendre. Conclut en \u00AB etat incertain \u00BB. -->\r\n <div class=\"d-flex-h justify-end\">\r\n <cw-button\r\n [type]=\"buttonType.secondary\"\r\n [label]=\"'_COMMON._IMPORT.STOP_WAITING'\"\r\n [dataTest]=\"'btn-import-stop-waiting'\"\r\n (btnAction)=\"stopWaiting()\">\r\n </cw-button>\r\n </div>\r\n }\r\n @else if (interruptionMessageKey(); as interruptionMessage) {\r\n <h3 class=\"visually-hidden\" tabindex=\"-1\" #interruptedOutcome>\r\n {{ '_COMMON._IMPORT._A11Y.IMPORT_RESULT' | translate }}\r\n </h3>\r\n\r\n <cw-alert [type]=\"interruptionAlertType()\">\r\n {{ interruptionMessage | translate }}\r\n </cw-alert>\r\n }\r\n @else if (report(); as result) {\r\n <h3 class=\"visually-hidden\" tabindex=\"-1\" #reportOutcome>\r\n {{ '_COMMON._IMPORT._A11Y.IMPORT_RESULT' | translate }}\r\n </h3>\r\n\r\n @if (result.success) {\r\n <cw-alert [type]=\"alertType.success\">\r\n {{ '_COMMON._IMPORT.SUCCESS' | translate }}\r\n </cw-alert>\r\n\r\n @if (isList() && reportRows().length) {\r\n <ng-container *ngTemplateOutlet=\"counts; context: { rows: reportRows() }\"></ng-container>\r\n }\r\n }\r\n @else {\r\n <!-- Le message generique ne promet l'absence d'ecriture que si l'atomicite est\r\n declaree (cf. `failureMessageKey`). -->\r\n <cw-alert [type]=\"alertType.danger\">\r\n {{ result.errorMessage ?? (failureMessageKey() | translate) }}\r\n </cw-alert>\r\n }\r\n }\r\n </div>\r\n </cw-card>\r\n\r\n</cw-accordion>\r\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", "loadingAnnounce", "cssClass", "dataTest", "skeletonMode", "isPressed", "ariaDescribedBy", "withTooltip", "tooltipText", "tooltipTitle", "tooltipTrigger", "tooltipPosition", "tooltipType"], outputs: ["btnAction", "dropDownClicked"] }, { kind: "component", type: CardComponent, selector: "cw-card", inputs: ["title", "subtitle", "truncateSubtitle", "type", "titleRank", "cssClass", "collapsible", "collapsed", "disabled", "collapseLocked", "collapseStretched", "collapseId", "destroyOnHide", "fullHeight"], 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", "recommendedDimensions", "showPreview", "existingFile", "indeterminate"], outputs: ["refreshEvent", "fileRemoved", "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 }); }
2329
+ 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.\r\n Rendue dans [header-start] pour etre AVANT le titre, comme sur les maquettes.\r\n Le numero seul n'etant pas parlant a l'oreille, le statut est double en visually-hidden --\r\n et c'est LUI qui distingue \u00AB en cours \u00BB de \u00AB a venir \u00BB pour qui ne voit pas la couleur. -->\r\n<ng-template #badge let-stepKey=\"stepKey\" let-number=\"number\">\r\n @if (stateOf(stepKey) === stepState.done) {\r\n <cw-icon [icon]=\"spriteIcon.check\" [type]=\"iconType.circular\" [iconSize]=\"iconSize['sm']\"\r\n [iconUiType]=\"iconUiType.success\" [label]=\"stepStatusLabel(stepKey) | translate\"></cw-icon>\r\n }\r\n @else if (stateOf(stepKey) === stepState.error) {\r\n <cw-icon [icon]=\"spriteIcon.close\" [type]=\"iconType.circular\" [iconSize]=\"iconSize['sm']\"\r\n [iconUiType]=\"iconUiType.danger\" [label]=\"stepStatusLabel(stepKey) | translate\"></cw-icon>\r\n }\r\n @else {\r\n <div class=\"icon-circular icon-circular-sm\" [class]=\"'icon-circular-' + badgeVariant(stepKey)\">\r\n <span aria-hidden=\"true\">{{ number }}</span>\r\n <span class=\"visually-hidden\">{{ stepStatusLabel(stepKey) | translate }}</span>\r\n </div>\r\n }\r\n</ng-template>\r\n\r\n<ng-template #counts let-rows=\"rows\">\r\n <ul class=\"list-unstyled d-flex-h gap-md\">\r\n @for (row of rows; track row.key) {\r\n <li>\r\n <span class=\"fs-lg fw-bold\" [class]=\"'text-' + row.tone\">{{ row.count }}</span> {{ row.key | translate: row.params }}\r\n </li>\r\n }\r\n </ul>\r\n</ng-template>\r\n\r\n<cw-accordion [closeOthers]=\"true\" [destroyOnHide]=\"false\">\r\n\r\n <!-- Etape 1 : fichier + type d'import -->\r\n <cw-card\r\n #stepPanel\r\n [title]=\"'_COMMON._IMPORT._STEP.SELECT'\"\r\n [collapseId]=\"'import-step-select'\"\r\n [collapsed]=\"!isPanelOpen(step.select)\"\r\n [collapseLocked]=\"stateOf(step.select) === stepState.done\"\r\n [disabled]=\"stateOf(step.select) === stepState.todo\"\r\n [collapseStretched]=\"false\">\r\n\r\n <ng-container ngProjectAs=\"[header-start]\">\r\n <ng-container *ngTemplateOutlet=\"badge; context: { stepKey: step.select, number: 1 }\"></ng-container>\r\n </ng-container>\r\n\r\n <div class=\"d-flex-v gap-md\">\r\n <div class=\"row\">\r\n <div class=\"col-lg-6\">\r\n <!-- Retour depuis une analyse non conforme : cible de focus. Le bouton qui declenche\r\n ce retour disparait avec le repli du panneau 2, le focus retomberait sur <body>. -->\r\n @if (selectionReopened()) {\r\n <h3 class=\"visually-hidden\" tabindex=\"-1\" #selectionTarget>\r\n {{ '_COMMON._IMPORT._A11Y.SELECTION' | translate }}\r\n </h3>\r\n }\r\n\r\n <cw-file-drop\r\n [formControl]=\"file\"\r\n [accept]=\"config().accept\"\r\n [acceptLabel]=\"config().acceptLabel\"\r\n [maxSizeMb]=\"maxSizeMb()\"\r\n [label]=\"'_COMMON._IMPORT.FILE_TO_IMPORT' | translate\">\r\n </cw-file-drop>\r\n\r\n @if (config().helpText; as helpText) {\r\n <p class=\"mt-2xs\">{{ helpText | translate }}</p>\r\n }\r\n </div>\r\n\r\n @if (config().templateFile) {\r\n <div class=\"col-lg-6\">\r\n <cw-card [type]=\"cardType.light\">\r\n <strong>{{ '_COMMON._IMPORT._TEMPLATE.TITLE' | translate }}</strong>\r\n <span>{{ '_COMMON._IMPORT._TEMPLATE.TEXT' | translate }}</span>\r\n <cw-file-to-download [attachments]=\"templateAttachments()\"></cw-file-to-download>\r\n </cw-card>\r\n </div>\r\n }\r\n </div>\r\n\r\n <!-- Mode IMPOSE : aucun champ, et pas davantage de ligne \u00AB Type d'import : ... \u00BB \u2014 la\r\n maquette ne rend que l'alerte de portee ci-dessous, qui informe deja du mode retenu.\r\n Le champ cle de rapprochement y est replie (voir l'alerte).\r\n Choix LIBRE : groupe radio, dont la selection est REQUISE (pas de preselection). -->\r\n @if (!isModeImposed()) {\r\n <cw-form-field\r\n [type]=\"fieldType.radio\"\r\n [control]=\"mode\"\r\n [name]=\"'importMode'\"\r\n [label]=\"'_COMMON._IMPORT._MODE.LABEL'\"\r\n [options]=\"modeOptions()\"\r\n [isRequired]=\"true\"\r\n [help]=\"selectedKeyFieldHint()\">\r\n </cw-form-field>\r\n }\r\n\r\n <!-- Portee du mode retenu (destructif ou non) : exigence SFD \u00AB l'utilisateur est\r\n informe du type d'import selectionne ou impose \u00BB. Rien tant qu'aucun mode n'est\r\n retenu : l'alerte ne decrit jamais un mode que l'utilisateur n'a pas choisi. -->\r\n @if (modeNotice(); as notice) {\r\n <cw-alert [type]=\"modeNoticeType()\">\r\n {{ notice.lead | translate }}\r\n @if (notice.items.length) {\r\n <ul class=\"mb-none\">\r\n @for (item of notice.items; track $index) {\r\n <li>{{ item | translate }}</li>\r\n }\r\n </ul>\r\n }\r\n <!-- Mode impose : l'alerte est le SEUL endroit qui reste pour dire sur quoi porte\r\n le rapprochement. En choix libre, c'est l'aide du groupe radio qui le porte. -->\r\n @if (isModeImposed() && selectedKeyFieldHint(); as keyFieldHint) {\r\n <p class=\"mb-none\">{{ keyFieldHint | translate }}</p>\r\n }\r\n </cw-alert>\r\n }\r\n\r\n <!-- Un bouton desactive muet est un cul-de-sac : ce texte dit ce qui manque, et il est\r\n place AVANT le bouton, seul chemin possible puisqu'un bouton desactive n'est pas\r\n focusable (donc pas d'aria-describedby exploitable). Pas de classe de couleur\r\n atenuee : c'est une information necessaire, elle garde le contraste du corps. -->\r\n <div class=\"d-flex-h justify-end gap-md\">\r\n @if (missingRequirementKey(); as missing) {\r\n <p class=\"mb-none fs-xs\">{{ missing | translate }}</p>\r\n }\r\n\r\n <cw-button\r\n [type]=\"buttonType.primary\"\r\n [label]=\"'_COMMON._IMPORT.CONTINUE'\"\r\n [dataTest]=\"'btn-import-continue'\"\r\n [isDisabled]=\"!canContinue()\"\r\n (btnAction)=\"continueToAnalysis()\">\r\n </cw-button>\r\n </div>\r\n </div>\r\n </cw-card>\r\n\r\n <!-- Etape 2 : analyse a blanc -->\r\n <cw-card\r\n #stepPanel\r\n [title]=\"'_COMMON._IMPORT._STEP.ANALYSIS'\"\r\n [collapseId]=\"'import-step-analysis'\"\r\n [collapsed]=\"!isPanelOpen(step.analysis)\"\r\n [collapseLocked]=\"stateOf(step.analysis) === stepState.done\"\r\n [disabled]=\"stateOf(step.analysis) === stepState.todo\"\r\n [collapseStretched]=\"false\">\r\n\r\n <ng-container ngProjectAs=\"[header-start]\">\r\n <ng-container *ngTemplateOutlet=\"badge; context: { stepKey: step.analysis, number: 2 }\"></ng-container>\r\n </ng-container>\r\n\r\n <div class=\"d-flex-v gap-md\">\r\n @if (analyzing()) {\r\n <!-- Cible de focus : ce texte EST le message d'etat, il est donc lu une fois et une\r\n seule (aucune region live en doublon). -->\r\n <span tabindex=\"-1\" #analysisStatus>{{ '_COMMON._IMPORT.ANALYSIS_IN_PROGRESS' | translate }}</span>\r\n }\r\n @else if (analysis(); as result) {\r\n <!-- Cible de focus a l'arrivee du resultat : libelle de section, pas une reprise du\r\n message, pour que la lecture enchaine sur l'alerte puis les compteurs. -->\r\n <h3 class=\"visually-hidden\" tabindex=\"-1\" #analysisOutcome>\r\n {{ '_COMMON._IMPORT._A11Y.ANALYSIS_RESULT' | translate }}\r\n </h3>\r\n\r\n @if (result.valid) {\r\n <cw-alert [type]=\"alertType.success\">\r\n {{ '_COMMON._IMPORT.ANALYSIS_OK' | translate }}\r\n </cw-alert>\r\n\r\n <!-- scope=list : previsualisation chiffree. scope=singleConfig : le message ci-dessus suffit. -->\r\n @if (isList() && previewRows().length) {\r\n <ng-container *ngTemplateOutlet=\"counts; context: { rows: previewRows() }\"></ng-container>\r\n }\r\n\r\n <div class=\"list-unstyled d-flex-h justify-end\">\r\n <cw-button\r\n [type]=\"buttonType.primary\"\r\n [label]=\"'_COMMON._IMPORT.START'\"\r\n [dataTest]=\"'btn-import-start'\"\r\n (btnAction)=\"startImport()\">\r\n </cw-button>\r\n </div>\r\n }\r\n @else {\r\n <cw-alert [type]=\"alertType.danger\">\r\n {{ '_COMMON._IMPORT.ANALYSIS_KO' | translate }}\r\n </cw-alert>\r\n\r\n @if (errorCountRow(); as errorCount) {\r\n <p class=\"mb-none\">\r\n <span class=\"fs-lg fw-bold\" [class]=\"'text-' + errorCount.tone\">{{ errorCount.count }}</span>\r\n {{ errorCount.key | translate }}\r\n </p>\r\n\r\n <!-- Une alerte par anomalie, et non une liste a puces : c'est le rendu de la\r\n maquette, et chaque message reste lisible isolement. -->\r\n @for (issue of errors(); track $index) {\r\n <cw-alert [type]=\"alertType.danger\">\r\n @if (issue.line !== undefined) {\r\n <strong>{{ '_COMMON._IMPORT.ERROR_LINE' | translate: { line: issue.line } }}</strong>\r\n }\r\n {{ issue.messageKey ? (issue.messageKey | translate: issue.messageParams) : issue.message }}\r\n </cw-alert>\r\n }\r\n }\r\n\r\n <div class=\"d-flex-h justify-end\">\r\n <cw-button\r\n [type]=\"buttonType.secondary\"\r\n [label]=\"'_COMMON._IMPORT.BACK_TO_SELECTION'\"\r\n [dataTest]=\"'btn-import-back'\"\r\n (btnAction)=\"backToSelection()\">\r\n </cw-button>\r\n </div>\r\n }\r\n }\r\n </div>\r\n </cw-card>\r\n\r\n <!-- Etape 3 : import -->\r\n <cw-card\r\n #stepPanel\r\n [title]=\"'_COMMON._IMPORT._STEP.EXECUTION'\"\r\n [collapseId]=\"'import-step-execution'\"\r\n [collapsed]=\"!isPanelOpen(step.execution)\"\r\n [disabled]=\"stateOf(step.execution) === stepState.todo\"\r\n [collapseStretched]=\"false\">\r\n\r\n <ng-container ngProjectAs=\"[header-start]\">\r\n <ng-container *ngTemplateOutlet=\"badge; context: { stepKey: step.execution, number: 3 }\"></ng-container>\r\n </ng-container>\r\n\r\n <div class=\"d-flex-v gap-md\">\r\n @if (isImporting) {\r\n <div class=\"d-flex-v gap-2xs\">\r\n <!-- Cible de focus. Le bouton \u00AB Arreter l'import \u00BB est le focusable suivant. -->\r\n <span tabindex=\"-1\" #executionStatus>{{ '_COMMON._IMPORT.IN_PROGRESS' | translate }}</span>\r\n @if (progress()?.remainingLabel; as remaining) {\r\n <span>{{ '_COMMON._IMPORT.REMAINING' | translate: { value: remaining } }}</span>\r\n }\r\n </div>\r\n\r\n <!-- Avancement connu => barre deterministe. Aucune progression recue => spinner\r\n indetermine, plutot qu'une barre figee a 0 %. La bascule se fait a la premiere\r\n emission `ImportProgress` : une source qui n'en emet jamais reste sur le spinner.\r\n `displayText` a false : le libelle \u00AB Import en cours \u00BB est deja au-dessus. -->\r\n @if (progress(); as current) {\r\n <cw-progress-bar\r\n [value]=\"current.percent\"\r\n [type]=\"progressType.information\"\r\n [label]=\"'_COMMON._IMPORT.IN_PROGRESS' | translate\">\r\n </cw-progress-bar>\r\n }\r\n @else {\r\n <cw-loader [size]=\"loaderSize.sm\" [displayText]=\"false\"></cw-loader>\r\n }\r\n\r\n <!-- Pas de bouton d'arret quand l'objet declare l'import non interruptible : un\r\n bouton qui ne peut rien arreter serait pire que son absence. -->\r\n @if (canInterrupt()) {\r\n <div class=\"d-flex-h justify-end\">\r\n <cw-button\r\n [type]=\"buttonType.dangerOutline\"\r\n [label]=\"'_COMMON._IMPORT.STOP'\"\r\n [dataTest]=\"'btn-import-stop'\"\r\n (btnAction)=\"stopImport()\">\r\n </cw-button>\r\n </div>\r\n }\r\n }\r\n @else if (cancelling()) {\r\n <!-- Annulation demandee au serveur, reponse en attente. Cible de focus. -->\r\n <span tabindex=\"-1\" #cancellingStatus>{{ '_COMMON._IMPORT.CANCELLING' | translate }}</span>\r\n\r\n <cw-loader [size]=\"loaderSize.sm\" [displayText]=\"false\"></cw-loader>\r\n\r\n <!-- Sortie de secours : aucun delai n'etant defendable depuis la lib, c'est\r\n l'utilisateur qui decide d'arreter d'attendre. Conclut en \u00AB etat incertain \u00BB. -->\r\n <div class=\"d-flex-h justify-end\">\r\n <cw-button\r\n [type]=\"buttonType.secondary\"\r\n [label]=\"'_COMMON._IMPORT.STOP_WAITING'\"\r\n [dataTest]=\"'btn-import-stop-waiting'\"\r\n (btnAction)=\"stopWaiting()\">\r\n </cw-button>\r\n </div>\r\n }\r\n @else if (interruptionMessageKey(); as interruptionMessage) {\r\n <h3 class=\"visually-hidden\" tabindex=\"-1\" #interruptedOutcome>\r\n {{ '_COMMON._IMPORT._A11Y.IMPORT_RESULT' | translate }}\r\n </h3>\r\n\r\n <cw-alert [type]=\"interruptionAlertType()\">\r\n {{ interruptionMessage | translate }}\r\n </cw-alert>\r\n }\r\n @else if (report(); as result) {\r\n <h3 class=\"visually-hidden\" tabindex=\"-1\" #reportOutcome>\r\n {{ '_COMMON._IMPORT._A11Y.IMPORT_RESULT' | translate }}\r\n </h3>\r\n\r\n @if (result.success) {\r\n <cw-alert [type]=\"alertType.success\">\r\n {{ '_COMMON._IMPORT.SUCCESS' | translate }}\r\n </cw-alert>\r\n\r\n @if (isList() && reportRows().length) {\r\n <ng-container *ngTemplateOutlet=\"counts; context: { rows: reportRows() }\"></ng-container>\r\n }\r\n }\r\n @else {\r\n <!-- Le message generique ne promet l'absence d'ecriture que si l'atomicite est\r\n declaree (cf. `failureMessageKey`). -->\r\n <cw-alert [type]=\"alertType.danger\">\r\n {{ result.errorMessage ?? (failureMessageKey() | translate) }}\r\n </cw-alert>\r\n }\r\n }\r\n </div>\r\n </cw-card>\r\n\r\n</cw-accordion>\r\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", "titleParams", "isDismissible", "cssClass", "dataTest", "live"], outputs: ["close"] }, { kind: "component", type: ButtonComponent, selector: "cw-button", inputs: ["type", "label", "labelParams", "id", "link", "isDropdown", "hideCaret", "withIcon", "withOnlyIcon", "iconSize", "iconPosition", "dropdownPosition", "isMinWidth", "isDisabled", "isLoading", "loadingAnnounce", "cssClass", "dataTest", "skeletonMode", "isPressed", "ariaDescribedBy", "ariaLabel", "ariaExpanded", "ariaControls", "withTooltip", "tooltipText", "tooltipTitle", "tooltipTrigger", "tooltipPosition", "tooltipType"], outputs: ["btnAction", "dropDownClicked"] }, { kind: "component", type: CardComponent, selector: "cw-card", inputs: ["title", "titleId", "subtitle", "truncateSubtitle", "type", "titleRank", "cssClass", "collapsible", "collapsed", "disabled", "collapseLocked", "collapseStretched", "collapseId", "destroyOnHide", "fullHeight"], 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", "fieldTitle", "name", "placeholder", "autocomplete", "options", "rangeOptions", "validationOptions", "autocompleteOptions", "richTextOptions", "errorMessages", "isRequired", "help", "tooltip", "ariaDescribedBy", "addonLeft", "addonRight", "isInAddon", "isReadonly", "isDisabled", "sliderValue", "sliderOptions", "cssClass", "skeletonMode", "clearable", "appendTo", "initialCountry", "recommendedDimensions", "showPreview", "existingFile", "indeterminate"], outputs: ["refreshEvent", "fileRemoved", "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 }); }
2047
2330
  }
2048
2331
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: ImportWizardComponent, decorators: [{
2049
2332
  type: Component,
@@ -2117,7 +2400,7 @@ class ImportButtonComponent {
2117
2400
  ref.result.then(emitClosed, emitClosed);
2118
2401
  }
2119
2402
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: ImportButtonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
2120
- 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", "loadingAnnounce", "cssClass", "dataTest", "skeletonMode", "isPressed", "ariaDescribedBy", "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 }); }
2403
+ 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", "labelParams", "id", "link", "isDropdown", "hideCaret", "withIcon", "withOnlyIcon", "iconSize", "iconPosition", "dropdownPosition", "isMinWidth", "isDisabled", "isLoading", "loadingAnnounce", "cssClass", "dataTest", "skeletonMode", "isPressed", "ariaDescribedBy", "ariaLabel", "ariaExpanded", "ariaControls", "withTooltip", "tooltipText", "tooltipTitle", "tooltipTrigger", "tooltipPosition", "tooltipType"], outputs: ["btnAction", "dropDownClicked"] }, { kind: "component", type: ImportWizardComponent, selector: "cw-import-wizard", inputs: ["config"], outputs: ["completed"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
2121
2404
  }
2122
2405
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: ImportButtonComponent, decorators: [{
2123
2406
  type: Component,
@@ -2140,58 +2423,6 @@ var PageHeaderActionEnum;
2140
2423
  PageHeaderActionEnum["reset"] = "reset";
2141
2424
  })(PageHeaderActionEnum || (PageHeaderActionEnum = {}));
2142
2425
 
2143
- // Persistance de la visibilite des colonnes de `cw-table` (pilotee par `cw-page-header`).
2144
- // Une SEULE cle localStorage pour N tableaux : objet indexe par `storageKey`.
2145
- // On ne stocke QUE les cles des colonnes MASQUEES (eviter de surcharger le localStorage).
2146
- //
2147
- // localStorage['cw-table-columns'] = {
2148
- // "publictransport/events": ["col1", "col2"],
2149
- // "users/list": ["createdAt"]
2150
- // }
2151
- const STORAGE_KEY = 'cw-table-columns';
2152
- /** Acces localStorage tolerant (SSR / quota / mode prive) : ne jette jamais. */
2153
- function readStore() {
2154
- try {
2155
- if (typeof localStorage === 'undefined')
2156
- return {};
2157
- const raw = localStorage.getItem(STORAGE_KEY);
2158
- const parsed = raw ? JSON.parse(raw) : {};
2159
- return parsed && typeof parsed === 'object' ? parsed : {};
2160
- }
2161
- catch {
2162
- return {};
2163
- }
2164
- }
2165
- /**
2166
- * Cles des colonnes masquees memorisees pour ce tableau.
2167
- * - `null` : aucune entree => l'utilisateur n'a jamais personnalise, on garde les defauts du config.
2168
- * - `string[]` (meme vide) : etat autoritatif memorise (`[]` = tout visible, choisi par l'utilisateur).
2169
- */
2170
- function loadHiddenColumns(storageKey) {
2171
- if (!storageKey)
2172
- return null;
2173
- const entry = readStore()[storageKey];
2174
- return Array.isArray(entry) ? entry : null;
2175
- }
2176
- /**
2177
- * Memorise les cles des colonnes masquees pour ce tableau.
2178
- * Ecrit toujours l'entree (meme vide) : sa presence marque « personnalise par l'utilisateur ».
2179
- */
2180
- function saveHiddenColumns(storageKey, hiddenKeys) {
2181
- if (!storageKey)
2182
- return;
2183
- try {
2184
- if (typeof localStorage === 'undefined')
2185
- return;
2186
- const store = readStore();
2187
- store[storageKey] = hiddenKeys;
2188
- localStorage.setItem(STORAGE_KEY, JSON.stringify(store));
2189
- }
2190
- catch {
2191
- /* localStorage indisponible : persistance silencieusement ignoree. */
2192
- }
2193
- }
2194
-
2195
2426
  class PageHeaderComponent {
2196
2427
  constructor() {
2197
2428
  this.location = inject(Location);
@@ -2205,16 +2436,7 @@ class PageHeaderComponent {
2205
2436
  this.isDisabled = input({}, ...(ngDevMode ? [{ debugName: "isDisabled" }] : []));
2206
2437
  /** Opt-out du badge de portee, pour une page qui porte elle-meme sa portee. */
2207
2438
  this.showScope = input(true, ...(ngDevMode ? [{ debugName: "showScope" }] : []));
2208
- // --- Menu « Colonnes » -------------------------------------------------
2209
- /** Colonnes du tableau associe. Fourni => le dropdown « Colonnes » apparait. */
2210
- this.columns = input([], ...(ngDevMode ? [{ debugName: "columns" }] : []));
2211
- /** Identifiant stable du tableau pour la persistance localStorage (ex. 'users/list'). */
2212
- this.storageKey = input(...(ngDevMode ? [undefined, { debugName: "storageKey" }] : []));
2213
- /** Cle i18n du libelle du bouton « Colonnes ». */
2214
- this.columnsLabel = input('_COMMON._TABLE.COLUMNS', ...(ngDevMode ? [{ debugName: "columnsLabel" }] : []));
2215
2439
  this.action = output();
2216
- /** Emis quand la visibilite des colonnes change (colonnes avec `hidden` a jour). */
2217
- this.columnsChange = output();
2218
2440
  this.buttonType = BoButtonTypeEnum;
2219
2441
  this.iconSize = ButtonIconSizeEnum;
2220
2442
  this.spriteIcon = SpriteIconEnum;
@@ -2224,53 +2446,6 @@ class PageHeaderComponent {
2224
2446
  this.showReset = computed(() => this.actions().includes(PageHeaderActionEnum.reset), ...(ngDevMode ? [{ debugName: "showReset" }] : []));
2225
2447
  this.showAdd = computed(() => this.actions().includes(PageHeaderActionEnum.add), ...(ngDevMode ? [{ debugName: "showAdd" }] : []));
2226
2448
  this.showSave = computed(() => this.actions().includes(PageHeaderActionEnum.save), ...(ngDevMode ? [{ debugName: "showSave" }] : []));
2227
- /** Colonnes masquables (hors `actions` et hors `hideable === false`). */
2228
- this.toggleableColumns = computed(() => this.columns().filter(c => c.type !== 'actions' && c.hideable !== false), ...(ngDevMode ? [{ debugName: "toggleableColumns" }] : []));
2229
- /** Le dropdown « Colonnes » n'apparait que s'il existe au moins une colonne masquable. */
2230
- this.showColumns = computed(() => this.toggleableColumns().length > 0, ...(ngDevMode ? [{ debugName: "showColumns" }] : []));
2231
- /** Nombre de colonnes masquables actuellement visibles. */
2232
- this.visibleToggleableCount = computed(() => this.toggleableColumns().filter(c => !c.hidden).length, ...(ngDevMode ? [{ debugName: "visibleToggleableCount" }] : []));
2233
- // Reconciliation au 1er rendu (navigateur) : si un etat est memorise, il prime
2234
- // sur les defauts du config et est emis une fois vers le parent.
2235
- afterNextRender(() => this.applyStoredVisibility());
2236
- }
2237
- /** Une colonne visible est « la derniere » si la masquer laisserait 0 colonne visible. */
2238
- isLastVisible(col) {
2239
- return !col.hidden && this.visibleToggleableCount() <= 1;
2240
- }
2241
- /** Coche/decoche une colonne : applique le garde-fou, persiste et emet. */
2242
- toggleColumn(col) {
2243
- const willHide = !col.hidden;
2244
- if (willHide && this.visibleToggleableCount() <= 1)
2245
- return; // garde-fou : min 1 visible
2246
- const updated = this.columns().map(c => (c.key === col.key ? { ...c, hidden: willHide } : c));
2247
- this.persistAndEmit(updated);
2248
- }
2249
- applyStoredVisibility() {
2250
- const key = this.storageKey();
2251
- if (!key)
2252
- return;
2253
- const stored = loadHiddenColumns(key);
2254
- if (!stored)
2255
- return; // jamais personnalise -> on garde les `hidden` du config
2256
- const hidden = new Set(stored);
2257
- const reconciled = this.columns().map(c => c.type === 'actions' || c.hideable === false ? c : { ...c, hidden: hidden.has(c.key) });
2258
- this.columnsChange.emit(this.ensureMinVisible(reconciled));
2259
- }
2260
- /** Garantit au moins une colonne masquable visible (re-affiche la 1re sinon). */
2261
- ensureMinVisible(cols) {
2262
- const toggleable = cols.filter(c => c.type !== 'actions' && c.hideable !== false);
2263
- if (toggleable.length === 0 || toggleable.some(c => !c.hidden))
2264
- return cols;
2265
- const firstKey = toggleable[0].key;
2266
- return cols.map(c => (c.key === firstKey ? { ...c, hidden: false } : c));
2267
- }
2268
- persistAndEmit(cols) {
2269
- const hiddenKeys = cols
2270
- .filter(c => c.hidden && c.type !== 'actions' && c.hideable !== false)
2271
- .map(c => c.key);
2272
- saveHiddenColumns(this.storageKey() ?? '', hiddenKeys);
2273
- this.columnsChange.emit(cols);
2274
2449
  }
2275
2450
  goBack() {
2276
2451
  this.location.back();
@@ -2285,7 +2460,7 @@ class PageHeaderComponent {
2285
2460
  return !!this.isDisabled()[action];
2286
2461
  }
2287
2462
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: PageHeaderComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
2288
- 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 }, showScope: { classPropertyName: "showScope", publicName: "showScope", 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\">\r\n @if (showBack()) {\r\n <cw-button [type]=\"buttonType.ghost\" [label]=\"'_COMMON._FORM.BACK'\" [withIcon]=\"spriteIcon.left1\"\r\n (btnAction)=\"goBack()\" />\r\n }\r\n <div class=\"d-flex-h gap-md items-start justify-between flex-wrap\">\r\n <div class=\"d-flex-v\">\r\n <!-- Badge de portee HORS du <h1> : le nom accessible du titre reste le titre. -->\r\n <div class=\"page-header-heading d-flex-h gap-sm flex-wrap items-center\">\r\n <h1 class=\"page-header-title\">{{ title() | translate}}</h1>\r\n @if (showScope() && pageScope(); as scope) {\r\n @if (scope.kind === 'instance') {\r\n <!-- Badge maison : structure `.badge` de basic-ui, couleurs et logo propres (cf. _page-header.scss). -->\r\n <span class=\"badge page-header-scope-instance\">\r\n @if (scope.imageUrl; as img) {\r\n <img class=\"page-header-scope-logo\" [src]=\"img\" alt=\"\" />\r\n } @else {\r\n <cw-icon [icon]=\"spriteIcon.poiCompany\" aria-hidden=\"true\" />\r\n }\r\n <span class=\"visually-hidden\">{{ '_COMMON._PAGE_SCOPE.INSTANCE_PREFIX' | translate }}</span>\r\n <span>{{ scope.label }}</span>\r\n </span>\r\n } @else {\r\n <cw-badge [type]=\"badgeType.lightInfo\" [label]=\"'_COMMON._PAGE_SCOPE.ALL_INSTANCES'\"\r\n [withIcon]=\"spriteIcon.mapWorld\" />\r\n }\r\n }\r\n </div>\r\n @if (description(); as desc) {\r\n <p class=\"fs-md page-header-description\" [innerHTML]=\"desc | translate\"></p>\r\n }\r\n </div>\r\n\r\n <div class=\"d-flex-v gap-2xs\">\r\n <div class=\"page-header-actions d-flex-h gap-md flex-wrap items-center justify-end\">\r\n @if (showColumns()) {\r\n <cw-button [type]=\"buttonType.secondary\" [label]=\"columnsLabel()\" [withIcon]=\"spriteIcon.miscNews\"\r\n [isDropdown]=\"true\">\r\n <ul class=\"d-flex-v gap-2xs p-md\">\r\n @for (col of toggleableColumns(); track col.key) {\r\n <li class=\"field-check\">\r\n <input class=\"field-check-input\" type=\"checkbox\" [id]=\"'col-toggle-' + col.key\"\r\n [checked]=\"!col.hidden\" [disabled]=\"isLastVisible(col)\" (change)=\"toggleColumn(col)\">\r\n <label class=\"field-check-label\" [for]=\"'col-toggle-' + col.key\">{{ col.label | translate }}</label>\r\n </li>\r\n }\r\n </ul>\r\n </cw-button>\r\n }\r\n\r\n <!-- Slot de l'import : `<cw-import-button cwPageHeaderImport \u2026>`. Projete plutot que\r\n rendu, pour que `cw-page-header` ne reference pas `cw-import-wizard`. -->\r\n <ng-content select=\"[cwPageHeaderImport]\"></ng-content>\r\n\r\n <!-- Slot de l'export : `<cw-export-button cwPageHeaderExport \u2026>`. -->\r\n <ng-content select=\"[cwPageHeaderExport]\"></ng-content>\r\n\r\n <!-- Slot libre, inchange : tout ce qui n'est marque ni import ni export atterrit ici.\r\n C'est l'echappatoire d'un hote qui veut piloter son propre bouton. -->\r\n <ng-content></ng-content>\r\n\r\n @if (showReset()) {\r\n <cw-button [type]=\"buttonType.secondary\" [label]=\"'_COMMON._ACTION.RESET'\"\r\n [isDisabled]=\"disabled(actionEnum.reset)\" [isLoading]=\"loading(actionEnum.reset)\"\r\n (btnAction)=\"emit(actionEnum.reset)\">\r\n </cw-button>\r\n }\r\n\r\n @if (showAdd()) {\r\n <cw-button [type]=\"buttonType.primary\" [label]=\"'_COMMON._ACTION.ADD'\" [withIcon]=\"spriteIcon.add\"\r\n [isDisabled]=\"disabled(actionEnum.add)\" [isLoading]=\"loading(actionEnum.add)\"\r\n (btnAction)=\"emit(actionEnum.add)\">\r\n </cw-button>\r\n }\r\n\r\n @if (showSave()) {\r\n <cw-button [type]=\"buttonType.primary\" [label]=\"'_COMMON._ACTION.SAVE'\" [isDisabled]=\"disabled(actionEnum.save)\"\r\n [isLoading]=\"loading(actionEnum.save)\" (btnAction)=\"emit(actionEnum.save)\">\r\n </cw-button>\r\n }\r\n </div>\r\n </div>\r\n </div>\r\n\r\n</div>\r\n", dependencies: [{ 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", "loadingAnnounce", "cssClass", "dataTest", "skeletonMode", "isPressed", "ariaDescribedBy", "withTooltip", "tooltipText", "tooltipTitle", "tooltipTrigger", "tooltipPosition", "tooltipType"], outputs: ["btnAction", "dropDownClicked"] }, { kind: "component", type: IconComponent, selector: "cw-icon", inputs: ["icon", "label", "type", "iconSize", "iconCssClass", "iconUiType", "iconColorCustom", "spritePath"] }, { kind: "ngmodule", type: TranslateModule }, { kind: "pipe", type: i1.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
2463
+ 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 }, showScope: { classPropertyName: "showScope", publicName: "showScope", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { action: "action" }, ngImport: i0, template: "<div class=\"page-header d-flex-v gap-2xs\">\r\n @if (showBack()) {\r\n <cw-button [type]=\"buttonType.ghost\" [label]=\"'_COMMON._FORM.BACK'\" [withIcon]=\"spriteIcon.left1\"\r\n (btnAction)=\"goBack()\" />\r\n }\r\n <div class=\"d-flex-h gap-md items-start justify-between flex-wrap\">\r\n <div class=\"d-flex-v\">\r\n <!-- Badge de portee HORS du <h1> : le nom accessible du titre reste le titre. -->\r\n <div class=\"page-header-heading d-flex-h gap-sm flex-wrap items-center\">\r\n <h1 class=\"page-header-title\">{{ title() | translate}}</h1>\r\n @if (showScope() && pageScope(); as scope) {\r\n @if (scope.kind === 'instance') {\r\n <!-- Badge maison : structure `.badge` de basic-ui, couleurs et logo propres (cf. _page-header.scss). -->\r\n <span class=\"badge page-header-scope-instance\">\r\n @if (scope.imageUrl; as img) {\r\n <img class=\"page-header-scope-logo\" [src]=\"img\" alt=\"\" />\r\n } @else {\r\n <cw-icon [icon]=\"spriteIcon.poiCompany\" aria-hidden=\"true\" />\r\n }\r\n <span class=\"visually-hidden\">{{ '_COMMON._PAGE_SCOPE.INSTANCE_PREFIX' | translate }}</span>\r\n <span>{{ scope.label }}</span>\r\n </span>\r\n } @else {\r\n <cw-badge [type]=\"badgeType.lightInfo\" [label]=\"'_COMMON._PAGE_SCOPE.ALL_INSTANCES'\"\r\n [withIcon]=\"spriteIcon.mapWorld\" />\r\n }\r\n }\r\n </div>\r\n @if (description(); as desc) {\r\n <p class=\"fs-md page-header-description\" [innerHTML]=\"desc | translate\"></p>\r\n }\r\n </div>\r\n\r\n <div class=\"d-flex-v gap-2xs\">\r\n <div class=\"page-header-actions d-flex-h gap-md flex-wrap items-center justify-end\">\r\n <!-- Slot de l'import : `<cw-import-button cwPageHeaderImport \u2026>`. Projete plutot que\r\n rendu, pour que `cw-page-header` ne reference pas `cw-import-wizard`. -->\r\n <ng-content select=\"[cwPageHeaderImport]\"></ng-content>\r\n\r\n <!-- Slot de l'export : `<cw-export-button cwPageHeaderExport \u2026>`. -->\r\n <ng-content select=\"[cwPageHeaderExport]\"></ng-content>\r\n\r\n <!-- Slot libre, inchange : tout ce qui n'est marque ni import ni export atterrit ici.\r\n C'est l'echappatoire d'un hote qui veut piloter son propre bouton. -->\r\n <ng-content></ng-content>\r\n\r\n @if (showReset()) {\r\n <cw-button [type]=\"buttonType.secondary\" [label]=\"'_COMMON._ACTION.RESET'\"\r\n [isDisabled]=\"disabled(actionEnum.reset)\" [isLoading]=\"loading(actionEnum.reset)\"\r\n (btnAction)=\"emit(actionEnum.reset)\">\r\n </cw-button>\r\n }\r\n\r\n @if (showAdd()) {\r\n <cw-button [type]=\"buttonType.primary\" [label]=\"'_COMMON._ACTION.ADD'\" [withIcon]=\"spriteIcon.add\"\r\n [isDisabled]=\"disabled(actionEnum.add)\" [isLoading]=\"loading(actionEnum.add)\"\r\n (btnAction)=\"emit(actionEnum.add)\">\r\n </cw-button>\r\n }\r\n\r\n @if (showSave()) {\r\n <cw-button [type]=\"buttonType.primary\" [label]=\"'_COMMON._ACTION.SAVE'\" [isDisabled]=\"disabled(actionEnum.save)\"\r\n [isLoading]=\"loading(actionEnum.save)\" (btnAction)=\"emit(actionEnum.save)\">\r\n </cw-button>\r\n }\r\n </div>\r\n </div>\r\n </div>\r\n\r\n</div>\r\n", dependencies: [{ kind: "component", type: BadgeComponent, selector: "cw-badge", inputs: ["type", "label", "labelParams", "withIcon", "iconPosition", "cssClass", "skeletonMode", "dataTest"] }, { kind: "component", type: ButtonComponent, selector: "cw-button", inputs: ["type", "label", "labelParams", "id", "link", "isDropdown", "hideCaret", "withIcon", "withOnlyIcon", "iconSize", "iconPosition", "dropdownPosition", "isMinWidth", "isDisabled", "isLoading", "loadingAnnounce", "cssClass", "dataTest", "skeletonMode", "isPressed", "ariaDescribedBy", "ariaLabel", "ariaExpanded", "ariaControls", "withTooltip", "tooltipText", "tooltipTitle", "tooltipTrigger", "tooltipPosition", "tooltipType"], outputs: ["btnAction", "dropDownClicked"] }, { kind: "component", type: IconComponent, selector: "cw-icon", inputs: ["icon", "label", "type", "iconSize", "iconCssClass", "iconUiType", "iconColorCustom", "spritePath"] }, { kind: "ngmodule", type: TranslateModule }, { kind: "pipe", type: i1.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
2289
2464
  }
2290
2465
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: PageHeaderComponent, decorators: [{
2291
2466
  type: Component,
@@ -2294,8 +2469,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.20", ngImpo
2294
2469
  ButtonComponent,
2295
2470
  IconComponent,
2296
2471
  TranslateModule
2297
- ], template: "<div class=\"page-header d-flex-v gap-2xs\">\r\n @if (showBack()) {\r\n <cw-button [type]=\"buttonType.ghost\" [label]=\"'_COMMON._FORM.BACK'\" [withIcon]=\"spriteIcon.left1\"\r\n (btnAction)=\"goBack()\" />\r\n }\r\n <div class=\"d-flex-h gap-md items-start justify-between flex-wrap\">\r\n <div class=\"d-flex-v\">\r\n <!-- Badge de portee HORS du <h1> : le nom accessible du titre reste le titre. -->\r\n <div class=\"page-header-heading d-flex-h gap-sm flex-wrap items-center\">\r\n <h1 class=\"page-header-title\">{{ title() | translate}}</h1>\r\n @if (showScope() && pageScope(); as scope) {\r\n @if (scope.kind === 'instance') {\r\n <!-- Badge maison : structure `.badge` de basic-ui, couleurs et logo propres (cf. _page-header.scss). -->\r\n <span class=\"badge page-header-scope-instance\">\r\n @if (scope.imageUrl; as img) {\r\n <img class=\"page-header-scope-logo\" [src]=\"img\" alt=\"\" />\r\n } @else {\r\n <cw-icon [icon]=\"spriteIcon.poiCompany\" aria-hidden=\"true\" />\r\n }\r\n <span class=\"visually-hidden\">{{ '_COMMON._PAGE_SCOPE.INSTANCE_PREFIX' | translate }}</span>\r\n <span>{{ scope.label }}</span>\r\n </span>\r\n } @else {\r\n <cw-badge [type]=\"badgeType.lightInfo\" [label]=\"'_COMMON._PAGE_SCOPE.ALL_INSTANCES'\"\r\n [withIcon]=\"spriteIcon.mapWorld\" />\r\n }\r\n }\r\n </div>\r\n @if (description(); as desc) {\r\n <p class=\"fs-md page-header-description\" [innerHTML]=\"desc | translate\"></p>\r\n }\r\n </div>\r\n\r\n <div class=\"d-flex-v gap-2xs\">\r\n <div class=\"page-header-actions d-flex-h gap-md flex-wrap items-center justify-end\">\r\n @if (showColumns()) {\r\n <cw-button [type]=\"buttonType.secondary\" [label]=\"columnsLabel()\" [withIcon]=\"spriteIcon.miscNews\"\r\n [isDropdown]=\"true\">\r\n <ul class=\"d-flex-v gap-2xs p-md\">\r\n @for (col of toggleableColumns(); track col.key) {\r\n <li class=\"field-check\">\r\n <input class=\"field-check-input\" type=\"checkbox\" [id]=\"'col-toggle-' + col.key\"\r\n [checked]=\"!col.hidden\" [disabled]=\"isLastVisible(col)\" (change)=\"toggleColumn(col)\">\r\n <label class=\"field-check-label\" [for]=\"'col-toggle-' + col.key\">{{ col.label | translate }}</label>\r\n </li>\r\n }\r\n </ul>\r\n </cw-button>\r\n }\r\n\r\n <!-- Slot de l'import : `<cw-import-button cwPageHeaderImport \u2026>`. Projete plutot que\r\n rendu, pour que `cw-page-header` ne reference pas `cw-import-wizard`. -->\r\n <ng-content select=\"[cwPageHeaderImport]\"></ng-content>\r\n\r\n <!-- Slot de l'export : `<cw-export-button cwPageHeaderExport \u2026>`. -->\r\n <ng-content select=\"[cwPageHeaderExport]\"></ng-content>\r\n\r\n <!-- Slot libre, inchange : tout ce qui n'est marque ni import ni export atterrit ici.\r\n C'est l'echappatoire d'un hote qui veut piloter son propre bouton. -->\r\n <ng-content></ng-content>\r\n\r\n @if (showReset()) {\r\n <cw-button [type]=\"buttonType.secondary\" [label]=\"'_COMMON._ACTION.RESET'\"\r\n [isDisabled]=\"disabled(actionEnum.reset)\" [isLoading]=\"loading(actionEnum.reset)\"\r\n (btnAction)=\"emit(actionEnum.reset)\">\r\n </cw-button>\r\n }\r\n\r\n @if (showAdd()) {\r\n <cw-button [type]=\"buttonType.primary\" [label]=\"'_COMMON._ACTION.ADD'\" [withIcon]=\"spriteIcon.add\"\r\n [isDisabled]=\"disabled(actionEnum.add)\" [isLoading]=\"loading(actionEnum.add)\"\r\n (btnAction)=\"emit(actionEnum.add)\">\r\n </cw-button>\r\n }\r\n\r\n @if (showSave()) {\r\n <cw-button [type]=\"buttonType.primary\" [label]=\"'_COMMON._ACTION.SAVE'\" [isDisabled]=\"disabled(actionEnum.save)\"\r\n [isLoading]=\"loading(actionEnum.save)\" (btnAction)=\"emit(actionEnum.save)\">\r\n </cw-button>\r\n }\r\n </div>\r\n </div>\r\n </div>\r\n\r\n</div>\r\n" }]
2298
- }], 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 }] }], showScope: [{ type: i0.Input, args: [{ isSignal: true, alias: "showScope", 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"] }] } });
2472
+ ], template: "<div class=\"page-header d-flex-v gap-2xs\">\r\n @if (showBack()) {\r\n <cw-button [type]=\"buttonType.ghost\" [label]=\"'_COMMON._FORM.BACK'\" [withIcon]=\"spriteIcon.left1\"\r\n (btnAction)=\"goBack()\" />\r\n }\r\n <div class=\"d-flex-h gap-md items-start justify-between flex-wrap\">\r\n <div class=\"d-flex-v\">\r\n <!-- Badge de portee HORS du <h1> : le nom accessible du titre reste le titre. -->\r\n <div class=\"page-header-heading d-flex-h gap-sm flex-wrap items-center\">\r\n <h1 class=\"page-header-title\">{{ title() | translate}}</h1>\r\n @if (showScope() && pageScope(); as scope) {\r\n @if (scope.kind === 'instance') {\r\n <!-- Badge maison : structure `.badge` de basic-ui, couleurs et logo propres (cf. _page-header.scss). -->\r\n <span class=\"badge page-header-scope-instance\">\r\n @if (scope.imageUrl; as img) {\r\n <img class=\"page-header-scope-logo\" [src]=\"img\" alt=\"\" />\r\n } @else {\r\n <cw-icon [icon]=\"spriteIcon.poiCompany\" aria-hidden=\"true\" />\r\n }\r\n <span class=\"visually-hidden\">{{ '_COMMON._PAGE_SCOPE.INSTANCE_PREFIX' | translate }}</span>\r\n <span>{{ scope.label }}</span>\r\n </span>\r\n } @else {\r\n <cw-badge [type]=\"badgeType.lightInfo\" [label]=\"'_COMMON._PAGE_SCOPE.ALL_INSTANCES'\"\r\n [withIcon]=\"spriteIcon.mapWorld\" />\r\n }\r\n }\r\n </div>\r\n @if (description(); as desc) {\r\n <p class=\"fs-md page-header-description\" [innerHTML]=\"desc | translate\"></p>\r\n }\r\n </div>\r\n\r\n <div class=\"d-flex-v gap-2xs\">\r\n <div class=\"page-header-actions d-flex-h gap-md flex-wrap items-center justify-end\">\r\n <!-- Slot de l'import : `<cw-import-button cwPageHeaderImport \u2026>`. Projete plutot que\r\n rendu, pour que `cw-page-header` ne reference pas `cw-import-wizard`. -->\r\n <ng-content select=\"[cwPageHeaderImport]\"></ng-content>\r\n\r\n <!-- Slot de l'export : `<cw-export-button cwPageHeaderExport \u2026>`. -->\r\n <ng-content select=\"[cwPageHeaderExport]\"></ng-content>\r\n\r\n <!-- Slot libre, inchange : tout ce qui n'est marque ni import ni export atterrit ici.\r\n C'est l'echappatoire d'un hote qui veut piloter son propre bouton. -->\r\n <ng-content></ng-content>\r\n\r\n @if (showReset()) {\r\n <cw-button [type]=\"buttonType.secondary\" [label]=\"'_COMMON._ACTION.RESET'\"\r\n [isDisabled]=\"disabled(actionEnum.reset)\" [isLoading]=\"loading(actionEnum.reset)\"\r\n (btnAction)=\"emit(actionEnum.reset)\">\r\n </cw-button>\r\n }\r\n\r\n @if (showAdd()) {\r\n <cw-button [type]=\"buttonType.primary\" [label]=\"'_COMMON._ACTION.ADD'\" [withIcon]=\"spriteIcon.add\"\r\n [isDisabled]=\"disabled(actionEnum.add)\" [isLoading]=\"loading(actionEnum.add)\"\r\n (btnAction)=\"emit(actionEnum.add)\">\r\n </cw-button>\r\n }\r\n\r\n @if (showSave()) {\r\n <cw-button [type]=\"buttonType.primary\" [label]=\"'_COMMON._ACTION.SAVE'\" [isDisabled]=\"disabled(actionEnum.save)\"\r\n [isLoading]=\"loading(actionEnum.save)\" (btnAction)=\"emit(actionEnum.save)\">\r\n </cw-button>\r\n }\r\n </div>\r\n </div>\r\n </div>\r\n\r\n</div>\r\n" }]
2473
+ }], 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 }] }], showScope: [{ type: i0.Input, args: [{ isSignal: true, alias: "showScope", required: false }] }], action: [{ type: i0.Output, args: ["action"] }] } });
2299
2474
 
2300
2475
  class WizardStepComponent {
2301
2476
  constructor() {
@@ -2422,5 +2597,5 @@ function buildFilterParams(filters, keyMap) {
2422
2597
  * Generated bundle index. Do not edit.
2423
2598
  */
2424
2599
 
2425
- export { ArrayAdapter, CW_PAGE_SCOPE, CustomListComponent, DragNDropListComponent, DragNDropNestedListComponent, ExportButtonComponent, FILTER_ALL_VALUE, FilterBarComponent, FilterSelectComponent, FormArrayAdapter, IMPORT_WIZARD_STEPS, ImportButtonComponent, ImportEventKindEnum, ImportInterruptionEnum, ImportInterruptionStateEnum, ImportModeEnum, ImportObjectGenderEnum, ImportScopeEnum, ImportWizardComponent, ImportWizardStepEnum, ImportWizardStepStateEnum, PageHeaderActionEnum, PageHeaderComponent, PaginationComponent, ProgressBarComponent, ProgressBarSizeEnum, ProgressBarTypeEnum, TableComponent, WizardStepComponent, WizardStepperComponent, buildFilename, buildFilterParams, downloadBlob, formatCount, i18nKey, importWizardStepRank, jsonBlob, loadHiddenColumns, pluralizedCountKey, provideCwPageScope, saveHiddenColumns, todayIsoDate };
2600
+ export { ArrayAdapter, CW_PAGE_SCOPE, CustomListComponent, DragNDropListComponent, DragNDropNestedListComponent, ExportButtonComponent, FILTER_ALL_VALUE, FILTER_SEARCH_DEFAULT_KEY, FilterBarComponent, FilterSelectComponent, FormArrayAdapter, IMPORT_WIZARD_STEPS, ImportButtonComponent, ImportEventKindEnum, ImportInterruptionEnum, ImportInterruptionStateEnum, ImportModeEnum, ImportObjectGenderEnum, ImportScopeEnum, ImportWizardComponent, ImportWizardStepEnum, ImportWizardStepStateEnum, PageHeaderActionEnum, PageHeaderComponent, PaginationComponent, ProgressBarComponent, ProgressBarSizeEnum, ProgressBarTypeEnum, TableComponent, WizardStepComponent, WizardStepperComponent, buildFilename, buildFilterParams, downloadBlob, formatCount, i18nKey, importWizardStepRank, jsonBlob, loadHiddenColumns, pluralizedCountKey, provideCwPageScope, saveHiddenColumns, todayIsoDate };
2426
2601
  //# sourceMappingURL=cityway-bo-ui.mjs.map