@cityway/bo-ui 1.1.0-beta022 → 1.1.0-beta024
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.
- package/cityway-bo-ui-1.1.0-beta024.tgz +0 -0
- package/docs/components/filter-bar.md +33 -7
- package/docs/components/import-wizard.md +368 -362
- package/docs/i18n.md +67 -66
- package/fesm2022/cityway-bo-ui.mjs +106 -16
- package/fesm2022/cityway-bo-ui.mjs.map +1 -1
- package/index.d.ts +70 -9
- package/lib/assets/i18n/common.en.json +186 -162
- package/lib/assets/i18n/common.fr.json +186 -162
- package/package.json +3 -2
- package/styles/bo-ui.styles.min.css +1 -1
- package/styles/bo-ui.styles.min.css.map +1 -1
- package/cityway-bo-ui-1.1.0-beta022.tgz +0 -0
|
@@ -7,11 +7,13 @@ 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 { takeUntilDestroyed, toSignal } from '@angular/core/rxjs-interop';
|
|
10
|
+
import { takeUntilDestroyed, toSignal, toObservable } from '@angular/core/rxjs-interop';
|
|
11
11
|
import * as i1$2 from '@angular/forms';
|
|
12
12
|
import { FormControl, ReactiveFormsModule, FormGroup } from '@angular/forms';
|
|
13
13
|
import { Router, ActivatedRoute } from '@angular/router';
|
|
14
|
-
import { debounceTime, take, map } from 'rxjs';
|
|
14
|
+
import { switchMap, startWith, debounceTime, take, map } from 'rxjs';
|
|
15
|
+
import * as i2 from '@ng-select/ng-select';
|
|
16
|
+
import { NgSelectModule } from '@ng-select/ng-select';
|
|
15
17
|
import { HttpParams } from '@angular/common/http';
|
|
16
18
|
|
|
17
19
|
class CustomListComponent {
|
|
@@ -980,11 +982,72 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.20", ngImpo
|
|
|
980
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" }]
|
|
981
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 }] }] } });
|
|
982
984
|
|
|
985
|
+
/**
|
|
986
|
+
* Valeur du choix « Tous » d'un filtre simple. Vide = filtre inactif : la barre la retire
|
|
987
|
+
* de l'URL (`syncUrl`) et `buildFilterParams` ne l'envoie pas.
|
|
988
|
+
*/
|
|
989
|
+
const FILTER_ALL_VALUE = '';
|
|
990
|
+
/**
|
|
991
|
+
* Liste de filtre (DS `Filter / Single Selection` et `Filter / Multiple Selection`) :
|
|
992
|
+
* label et valeur empilés dans le champ, valeur en couleur primaire quand le filtre est actif.
|
|
993
|
+
* - simple : choix « Tous » généré en tête de liste (`allLabel`) ;
|
|
994
|
+
* - multiple : cases à cocher, 1re valeur + badge « +N », « Tout désélectionner » en tête.
|
|
995
|
+
*
|
|
996
|
+
* Rendu dédié à la barre de filtres : les selects de formulaire restent sur `cw-form-field`.
|
|
997
|
+
*/
|
|
998
|
+
class FilterSelectComponent {
|
|
999
|
+
constructor() {
|
|
1000
|
+
this.control = input.required(...(ngDevMode ? [{ debugName: "control" }] : []));
|
|
1001
|
+
/** Clé i18n du label, affiché dans le champ au-dessus de la valeur. */
|
|
1002
|
+
this.label = input.required(...(ngDevMode ? [{ debugName: "label" }] : []));
|
|
1003
|
+
this.options = input([], ...(ngDevMode ? [{ debugName: "options" }] : []));
|
|
1004
|
+
this.multiple = input(false, ...(ngDevMode ? [{ debugName: "multiple" }] : []));
|
|
1005
|
+
/** Clé i18n du choix « Tous » (filtre simple). `null` : pas de choix « Tous ». */
|
|
1006
|
+
this.allLabel = input('_COMMON._FILTER.ALL', ...(ngDevMode ? [{ debugName: "allLabel" }] : []));
|
|
1007
|
+
this.inputId = input(...(ngDevMode ? [undefined, { debugName: "inputId" }] : []));
|
|
1008
|
+
this.readonly = input(false, ...(ngDevMode ? [{ debugName: "readonly" }] : []));
|
|
1009
|
+
this.appendTo = input('body', ...(ngDevMode ? [{ debugName: "appendTo" }] : []));
|
|
1010
|
+
this.spriteIcon = SpriteIconEnum;
|
|
1011
|
+
this.iconSize = IconSizeEnum;
|
|
1012
|
+
this.items = computed(() => {
|
|
1013
|
+
const allLabel = this.allLabel();
|
|
1014
|
+
if (this.multiple() || !allLabel) {
|
|
1015
|
+
return this.options();
|
|
1016
|
+
}
|
|
1017
|
+
return [{ value: FILTER_ALL_VALUE, label: allLabel, all: true }, ...this.options()];
|
|
1018
|
+
}, ...(ngDevMode ? [{ debugName: "items" }] : []));
|
|
1019
|
+
this.value = toSignal(toObservable(this.control).pipe(switchMap(control => control.valueChanges.pipe(startWith(control.value)))));
|
|
1020
|
+
/** Filtre actif (valeur ≠ « Tous » / aucune sélection) : la valeur passe en couleur primaire. */
|
|
1021
|
+
this.isActive = computed(() => {
|
|
1022
|
+
const value = this.value();
|
|
1023
|
+
return Array.isArray(value) ? value.length > 0 : value != null && value !== FILTER_ALL_VALUE;
|
|
1024
|
+
}, ...(ngDevMode ? [{ debugName: "isActive" }] : []));
|
|
1025
|
+
}
|
|
1026
|
+
deselectAll() {
|
|
1027
|
+
this.control().setValue([]);
|
|
1028
|
+
this.control().markAsDirty();
|
|
1029
|
+
}
|
|
1030
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: FilterSelectComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1031
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.20", type: FilterSelectComponent, isStandalone: true, selector: "cw-filter-select", inputs: { control: { classPropertyName: "control", publicName: "control", isSignal: true, isRequired: true, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: true, transformFunction: null }, options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: false, transformFunction: null }, multiple: { classPropertyName: "multiple", publicName: "multiple", isSignal: true, isRequired: false, transformFunction: null }, allLabel: { classPropertyName: "allLabel", publicName: "allLabel", isSignal: true, isRequired: false, transformFunction: null }, inputId: { classPropertyName: "inputId", publicName: "inputId", isSignal: true, isRequired: false, transformFunction: null }, readonly: { classPropertyName: "readonly", publicName: "readonly", isSignal: true, isRequired: false, transformFunction: null }, appendTo: { classPropertyName: "appendTo", publicName: "appendTo", isSignal: true, isRequired: false, transformFunction: null } }, host: { classAttribute: "filter-select" }, ngImport: i0, template: "<!-- Cl\u00E9s i18n : label, allLabel et libell\u00E9s d'options sont traduits ici, \u00E0 l'affichage. -->\n<div class=\"field-group\" [class.field-group-disabled]=\"readonly()\" [class.filter-select-active]=\"isActive()\">\n <ng-select class=\"filter-select-field\"\n [formControl]=\"control()\" [items]=\"items()\" bindLabel=\"label\" bindValue=\"value\"\n [multiple]=\"multiple()\" [closeOnSelect]=\"!multiple()\" [clearOnBackspace]=\"false\"\n [searchable]=\"false\" [clearable]=\"false\" [readonly]=\"readonly()\"\n [appendTo]=\"appendTo() ?? ''\" [labelForId]=\"inputId()\" [ariaLabel]=\"label() | translate\">\n\n <!-- Aucune s\u00E9lection : \u00AB Tous \u00BB (simple avec allLabel) ou tiret -->\n <ng-template ng-placeholder-tmp>\n <span class=\"filter-select-text\">\n <span class=\"filter-select-label\">{{ label() | translate }}</span>\n @if (!multiple() && allLabel()) {\n <span class=\"filter-select-value\">{{ allLabel()! | translate }}</span>\n } @else {\n <span class=\"filter-select-value filter-select-value-empty\">\u2013</span>\n }\n </span>\n </ng-template>\n\n <!-- Valeur (simple) -->\n <ng-template ng-label-tmp let-item=\"item\">\n <span class=\"filter-select-text\">\n <span class=\"filter-select-label\">{{ label() | translate }}</span>\n <span class=\"filter-select-value\">{{ item.label | translate }}</span>\n </span>\n </ng-template>\n\n <!-- Valeurs (multiple) : 1re valeur + badge du nombre de valeurs masqu\u00E9es -->\n <ng-template ng-multi-label-tmp let-items=\"items\">\n <span class=\"filter-select-text\">\n <span class=\"filter-select-label\">{{ label() | translate }}</span>\n <span class=\"filter-select-values\">\n <span class=\"filter-select-value\">{{ items[0].label | translate }}</span>\n @if (items.length > 1) {\n <span class=\"filter-select-badge\">+{{ items.length - 1 }}</span>\n }\n </span>\n </span>\n </ng-template>\n\n @if (multiple()) {\n <ng-template ng-header-tmp>\n <button type=\"button\" class=\"filter-select-deselect\" [disabled]=\"!isActive()\" (click)=\"deselectAll()\">\n {{ '_COMMON._FILTER.DESELECT_ALL' | translate }}\n <cw-icon [icon]=\"spriteIcon.close\" [iconSize]=\"iconSize['2xs']\" />\n </button>\n </ng-template>\n }\n\n <!-- Options : case \u00E0 cocher (visuelle, l'\u00E9tat est port\u00E9 par aria-selected de l'option) en multiple -->\n <ng-template ng-option-tmp let-item=\"item\" let-item$=\"item$\">\n @if (multiple()) {\n <span class=\"field-check filter-select-option\">\n <input type=\"checkbox\" class=\"field-check-input\" [checked]=\"item$.selected\" tabindex=\"-1\" aria-hidden=\"true\" />\n {{ item.label | translate }}\n </span>\n } @else {\n <span class=\"filter-select-option\" [class.filter-select-option-all]=\"item.all\">{{ item.label | translate }}</span>\n }\n </ng-template>\n </ng-select>\n</div>\n", dependencies: [{ 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: NgSelectModule }, { kind: "component", type: i2.NgSelectComponent, selector: "ng-select", inputs: ["ariaLabelDropdown", "bindLabel", "bindValue", "ariaLabel", "markFirst", "placeholder", "fixedPlaceholder", "notFoundText", "typeToSearchText", "preventToggleOnRightClick", "addTagText", "loadingText", "clearAllText", "appearance", "dropdownPosition", "appendTo", "loading", "closeOnSelect", "hideSelected", "selectOnTab", "openOnEnter", "maxSelectedItems", "groupBy", "groupValue", "bufferAmount", "virtualScroll", "selectableGroup", "selectableGroupAsModel", "searchFn", "trackByFn", "clearOnBackspace", "labelForId", "inputAttrs", "tabIndex", "tabFocusOnClearButton", "readonly", "searchWhileComposing", "minTermLength", "editableSearchTerm", "ngClass", "typeahead", "multiple", "addTag", "searchable", "clearable", "isOpen", "items", "compareWith", "clearSearchOnAdd", "deselectOnClick", "keyDownFn"], outputs: ["blur", "focus", "change", "open", "close", "search", "clear", "add", "remove", "scroll", "scrollToEnd"] }, { kind: "directive", type: i2.NgOptionTemplateDirective, selector: "[ng-option-tmp]" }, { kind: "directive", type: i2.NgLabelTemplateDirective, selector: "[ng-label-tmp]" }, { kind: "directive", type: i2.NgMultiLabelTemplateDirective, selector: "[ng-multi-label-tmp]" }, { kind: "directive", type: i2.NgHeaderTemplateDirective, selector: "[ng-header-tmp]" }, { kind: "directive", type: i2.NgPlaceholderTemplateDirective, selector: "[ng-placeholder-tmp]" }, { kind: "ngmodule", type: TranslateModule }, { kind: "component", type: IconComponent, selector: "cw-icon", inputs: ["icon", "label", "type", "iconSize", "iconCssClass", "iconUiType", "iconColorCustom", "spritePath"] }, { kind: "pipe", type: i1.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
1032
|
+
}
|
|
1033
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: FilterSelectComponent, decorators: [{
|
|
1034
|
+
type: Component,
|
|
1035
|
+
args: [{ selector: 'cw-filter-select', changeDetection: ChangeDetectionStrategy.OnPush, imports: [ReactiveFormsModule, NgSelectModule, TranslateModule, IconComponent], host: { class: 'filter-select' }, template: "<!-- Cl\u00E9s i18n : label, allLabel et libell\u00E9s d'options sont traduits ici, \u00E0 l'affichage. -->\n<div class=\"field-group\" [class.field-group-disabled]=\"readonly()\" [class.filter-select-active]=\"isActive()\">\n <ng-select class=\"filter-select-field\"\n [formControl]=\"control()\" [items]=\"items()\" bindLabel=\"label\" bindValue=\"value\"\n [multiple]=\"multiple()\" [closeOnSelect]=\"!multiple()\" [clearOnBackspace]=\"false\"\n [searchable]=\"false\" [clearable]=\"false\" [readonly]=\"readonly()\"\n [appendTo]=\"appendTo() ?? ''\" [labelForId]=\"inputId()\" [ariaLabel]=\"label() | translate\">\n\n <!-- Aucune s\u00E9lection : \u00AB Tous \u00BB (simple avec allLabel) ou tiret -->\n <ng-template ng-placeholder-tmp>\n <span class=\"filter-select-text\">\n <span class=\"filter-select-label\">{{ label() | translate }}</span>\n @if (!multiple() && allLabel()) {\n <span class=\"filter-select-value\">{{ allLabel()! | translate }}</span>\n } @else {\n <span class=\"filter-select-value filter-select-value-empty\">\u2013</span>\n }\n </span>\n </ng-template>\n\n <!-- Valeur (simple) -->\n <ng-template ng-label-tmp let-item=\"item\">\n <span class=\"filter-select-text\">\n <span class=\"filter-select-label\">{{ label() | translate }}</span>\n <span class=\"filter-select-value\">{{ item.label | translate }}</span>\n </span>\n </ng-template>\n\n <!-- Valeurs (multiple) : 1re valeur + badge du nombre de valeurs masqu\u00E9es -->\n <ng-template ng-multi-label-tmp let-items=\"items\">\n <span class=\"filter-select-text\">\n <span class=\"filter-select-label\">{{ label() | translate }}</span>\n <span class=\"filter-select-values\">\n <span class=\"filter-select-value\">{{ items[0].label | translate }}</span>\n @if (items.length > 1) {\n <span class=\"filter-select-badge\">+{{ items.length - 1 }}</span>\n }\n </span>\n </span>\n </ng-template>\n\n @if (multiple()) {\n <ng-template ng-header-tmp>\n <button type=\"button\" class=\"filter-select-deselect\" [disabled]=\"!isActive()\" (click)=\"deselectAll()\">\n {{ '_COMMON._FILTER.DESELECT_ALL' | translate }}\n <cw-icon [icon]=\"spriteIcon.close\" [iconSize]=\"iconSize['2xs']\" />\n </button>\n </ng-template>\n }\n\n <!-- Options : case \u00E0 cocher (visuelle, l'\u00E9tat est port\u00E9 par aria-selected de l'option) en multiple -->\n <ng-template ng-option-tmp let-item=\"item\" let-item$=\"item$\">\n @if (multiple()) {\n <span class=\"field-check filter-select-option\">\n <input type=\"checkbox\" class=\"field-check-input\" [checked]=\"item$.selected\" tabindex=\"-1\" aria-hidden=\"true\" />\n {{ item.label | translate }}\n </span>\n } @else {\n <span class=\"filter-select-option\" [class.filter-select-option-all]=\"item.all\">{{ item.label | translate }}</span>\n }\n </ng-template>\n </ng-select>\n</div>\n" }]
|
|
1036
|
+
}], propDecorators: { control: [{ type: i0.Input, args: [{ isSignal: true, alias: "control", required: true }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: true }] }], options: [{ type: i0.Input, args: [{ isSignal: true, alias: "options", required: false }] }], multiple: [{ type: i0.Input, args: [{ isSignal: true, alias: "multiple", required: false }] }], allLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "allLabel", required: false }] }], inputId: [{ type: i0.Input, args: [{ isSignal: true, alias: "inputId", required: false }] }], readonly: [{ type: i0.Input, args: [{ isSignal: true, alias: "readonly", required: false }] }], appendTo: [{ type: i0.Input, args: [{ isSignal: true, alias: "appendTo", required: false }] }] } });
|
|
1037
|
+
|
|
983
1038
|
const RANGE_TYPES = new Set([
|
|
984
1039
|
FormFieldTypeEnum.dateToDate,
|
|
985
1040
|
FormFieldTypeEnum.dateTimeToDateTime,
|
|
986
1041
|
FormFieldTypeEnum.timeToTime
|
|
987
1042
|
]);
|
|
1043
|
+
/** Types rendus en liste de filtre (`cw-filter-select`) plutôt qu'en `cw-form-field`. */
|
|
1044
|
+
const SELECT_TYPES = new Set([
|
|
1045
|
+
FormFieldTypeEnum.select,
|
|
1046
|
+
FormFieldTypeEnum.ngSelect,
|
|
1047
|
+
FormFieldTypeEnum.ngSelectMultiple
|
|
1048
|
+
]);
|
|
1049
|
+
/** Séparateur des valeurs d'un filtre multiple dans les query params de l'URL. */
|
|
1050
|
+
const MULTIPLE_SEPARATOR = ',';
|
|
988
1051
|
class FilterBarComponent {
|
|
989
1052
|
constructor() {
|
|
990
1053
|
this.destroyRef = inject(DestroyRef);
|
|
@@ -1023,10 +1086,10 @@ class FilterBarComponent {
|
|
|
1023
1086
|
defaults[field.key] = { ...def };
|
|
1024
1087
|
}
|
|
1025
1088
|
else {
|
|
1026
|
-
const def = field.defaultValue ?? '';
|
|
1089
|
+
const def = field.defaultValue ?? (this.isMultiple(field) ? [] : '');
|
|
1027
1090
|
const init = urlValues[field.key] ?? def;
|
|
1028
1091
|
group[field.key] = new FormControl(init);
|
|
1029
|
-
defaults[field.key] = def;
|
|
1092
|
+
defaults[field.key] = Array.isArray(def) ? [...def] : def;
|
|
1030
1093
|
}
|
|
1031
1094
|
}
|
|
1032
1095
|
this.defaults = defaults;
|
|
@@ -1061,7 +1124,9 @@ class FilterBarComponent {
|
|
|
1061
1124
|
else {
|
|
1062
1125
|
const value = params.get(field.key);
|
|
1063
1126
|
if (value !== null) {
|
|
1064
|
-
values[field.key] =
|
|
1127
|
+
values[field.key] = this.isMultiple(field)
|
|
1128
|
+
? value.split(MULTIPLE_SEPARATOR).filter(v => v !== '')
|
|
1129
|
+
: value;
|
|
1065
1130
|
}
|
|
1066
1131
|
}
|
|
1067
1132
|
}
|
|
@@ -1089,12 +1154,20 @@ class FilterBarComponent {
|
|
|
1089
1154
|
replaceUrl: true
|
|
1090
1155
|
});
|
|
1091
1156
|
}
|
|
1092
|
-
/** Normalise une valeur en param d'URL ; les valeurs vides sont retirées (null). */
|
|
1157
|
+
/** Normalise une valeur en param d'URL ; les valeurs vides (dont `[]`) sont retirées (null). */
|
|
1093
1158
|
toParam(value) {
|
|
1094
1159
|
if (value === null || value === undefined || value === '')
|
|
1095
1160
|
return null;
|
|
1161
|
+
if (Array.isArray(value))
|
|
1162
|
+
return value.length ? value.join(MULTIPLE_SEPARATOR) : null;
|
|
1096
1163
|
return String(value);
|
|
1097
1164
|
}
|
|
1165
|
+
isSelect(field) {
|
|
1166
|
+
return SELECT_TYPES.has(field.type);
|
|
1167
|
+
}
|
|
1168
|
+
isMultiple(field) {
|
|
1169
|
+
return field.type === FormFieldTypeEnum.ngSelectMultiple;
|
|
1170
|
+
}
|
|
1098
1171
|
getControl(key) {
|
|
1099
1172
|
return this.filterForm.get(key);
|
|
1100
1173
|
}
|
|
@@ -1118,15 +1191,16 @@ class FilterBarComponent {
|
|
|
1118
1191
|
}
|
|
1119
1192
|
}
|
|
1120
1193
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: FilterBarComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1121
|
-
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 <cw-form-field\n
|
|
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 }); }
|
|
1122
1195
|
}
|
|
1123
1196
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: FilterBarComponent, decorators: [{
|
|
1124
1197
|
type: Component,
|
|
1125
1198
|
args: [{ selector: 'cw-filter-bar', changeDetection: ChangeDetectionStrategy.OnPush, imports: [
|
|
1126
1199
|
ReactiveFormsModule,
|
|
1127
1200
|
FormFieldComponent,
|
|
1201
|
+
FilterSelectComponent,
|
|
1128
1202
|
ButtonComponent
|
|
1129
|
-
], 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 <cw-form-field\n
|
|
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" }]
|
|
1130
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"] }] } });
|
|
1131
1205
|
|
|
1132
1206
|
// Type nominal des cles de traduction, partage par tous les composants de la lib.
|
|
@@ -1347,6 +1421,12 @@ var ImportScopeEnum;
|
|
|
1347
1421
|
ImportScopeEnum["list"] = "list";
|
|
1348
1422
|
ImportScopeEnum["singleConfig"] = "singleConfig";
|
|
1349
1423
|
})(ImportScopeEnum || (ImportScopeEnum = {}));
|
|
1424
|
+
/** Genre grammatical du nom de l'objet importe, pour accorder les libelles du rapport. */
|
|
1425
|
+
var ImportObjectGenderEnum;
|
|
1426
|
+
(function (ImportObjectGenderEnum) {
|
|
1427
|
+
ImportObjectGenderEnum["masculine"] = "masculine";
|
|
1428
|
+
ImportObjectGenderEnum["feminine"] = "feminine";
|
|
1429
|
+
})(ImportObjectGenderEnum || (ImportObjectGenderEnum = {}));
|
|
1350
1430
|
/** Etapes du parcours. L'ORDRE fait foi via `IMPORT_WIZARD_STEPS`, pas via cette declaration. */
|
|
1351
1431
|
var ImportWizardStepEnum;
|
|
1352
1432
|
(function (ImportWizardStepEnum) {
|
|
@@ -1587,6 +1667,11 @@ class ImportWizardComponent {
|
|
|
1587
1667
|
const scope = this.scope();
|
|
1588
1668
|
return scope.kind === ImportScopeEnum.list ? scope.objectLabel : undefined;
|
|
1589
1669
|
}, ...(ngDevMode ? [{ debugName: "objectLabelKey" }] : []));
|
|
1670
|
+
/** Genre du nom de l'objet, pour l'accord des libelles du rapport. Masculin par defaut. */
|
|
1671
|
+
this.objectGender = computed(() => {
|
|
1672
|
+
const scope = this.scope();
|
|
1673
|
+
return (scope.kind === ImportScopeEnum.list && scope.objectGender) || ImportObjectGenderEnum.masculine;
|
|
1674
|
+
}, ...(ngDevMode ? [{ debugName: "objectGender" }] : []));
|
|
1590
1675
|
this.interruption = computed(() => this.config().interruption, ...(ngDevMode ? [{ debugName: "interruption" }] : []));
|
|
1591
1676
|
/** Le bouton d'arret n'existe que si l'interruption est reellement possible. */
|
|
1592
1677
|
this.canInterrupt = computed(() => this.interruption().kind !== ImportInterruptionEnum.notInterruptible, ...(ngDevMode ? [{ debugName: "canInterrupt" }] : []));
|
|
@@ -1617,8 +1702,8 @@ class ImportWizardComponent {
|
|
|
1617
1702
|
/**
|
|
1618
1703
|
* Ce qui manque pour activer « Continuer ». Un bouton desactive n'etant pas focusable, ce
|
|
1619
1704
|
* texte est rendu AVANT lui dans le DOM : c'est le seul chemin qui reste (lecture lineaire,
|
|
1620
|
-
* curseur virtuel). `
|
|
1621
|
-
*
|
|
1705
|
+
* curseur virtuel). Une liaison `aria-describedby` (`ariaDescribedBy` de `cw-button`) ne
|
|
1706
|
+
* serait pas lue au focus, puisque le bouton desactive ne le recoit jamais.
|
|
1622
1707
|
*/
|
|
1623
1708
|
this.missingRequirementKey = computed(() => {
|
|
1624
1709
|
if (this.analyzing())
|
|
@@ -1936,6 +2021,10 @@ class ImportWizardComponent {
|
|
|
1936
2021
|
// Le nom de l'objet est lui-meme accorde au nombre : sa cle racine porte les memes
|
|
1937
2022
|
// categories de pluriel que les libelles de compteur (cf. `ImportScope.objectLabel`).
|
|
1938
2023
|
const labelKey = this.objectLabelKey();
|
|
2024
|
+
// Seuls les participes passes du rapport s'accordent ; l'apercu (« a ajouter ») est invariable.
|
|
2025
|
+
const genderSuffix = prefix === 'REPORT' && this.objectGender() === ImportObjectGenderEnum.feminine
|
|
2026
|
+
? '_FEMININE'
|
|
2027
|
+
: '';
|
|
1939
2028
|
const rows = [
|
|
1940
2029
|
['CREATED', counts.created, 'success'],
|
|
1941
2030
|
['UPDATED', counts.updated, 'primary'],
|
|
@@ -1945,7 +2034,7 @@ class ImportWizardComponent {
|
|
|
1945
2034
|
return rows
|
|
1946
2035
|
.filter((row) => row[1] !== undefined)
|
|
1947
2036
|
.map(([name, value, tone]) => ({
|
|
1948
|
-
key: pluralizedCountKey(`_COMMON._IMPORT._COUNTS.${prefix}_${name}`, value, lang),
|
|
2037
|
+
key: pluralizedCountKey(`_COMMON._IMPORT._COUNTS.${prefix}_${name}${genderSuffix}`, value, lang),
|
|
1949
2038
|
params: labelKey
|
|
1950
2039
|
? { label: this.translate.instant(pluralizedCountKey(labelKey, value, lang)) }
|
|
1951
2040
|
: undefined,
|
|
@@ -1954,7 +2043,7 @@ class ImportWizardComponent {
|
|
|
1954
2043
|
}));
|
|
1955
2044
|
}
|
|
1956
2045
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: ImportWizardComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1957
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.20", type: ImportWizardComponent, isStandalone: true, selector: "cw-import-wizard", inputs: { config: { classPropertyName: "config", publicName: "config", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { completed: "completed" }, host: { classAttribute: "cw-import-wizard" }, viewQueries: [{ propertyName: "panels", predicate: ["stepPanel"], descendants: true, read: CardComponent, isSignal: true }, { propertyName: "selectionTarget", first: true, predicate: ["selectionTarget"], descendants: true, isSignal: true }, { propertyName: "analysisStatus", first: true, predicate: ["analysisStatus"], descendants: true, isSignal: true }, { propertyName: "analysisOutcome", first: true, predicate: ["analysisOutcome"], descendants: true, isSignal: true }, { propertyName: "executionStatus", first: true, predicate: ["executionStatus"], descendants: true, isSignal: true }, { propertyName: "cancellingStatus", first: true, predicate: ["cancellingStatus"], descendants: true, isSignal: true }, { propertyName: "reportOutcome", first: true, predicate: ["reportOutcome"], descendants: true, isSignal: true }, { propertyName: "interruptedOutcome", first: true, predicate: ["interruptedOutcome"], descendants: true, isSignal: true }], ngImport: i0, template: "<!-- Pastille d'etape : icone ronde verte (terminee) / rouge (echec), sinon le numero.\n Rendue dans [header-start] pour etre AVANT le titre, comme sur les maquettes.\n Le numero seul n'etant pas parlant a l'oreille, le statut est double en visually-hidden --\n et c'est LUI qui distingue \u00AB en cours \u00BB de \u00AB a venir \u00BB pour qui ne voit pas la couleur. -->\n<ng-template #badge let-stepKey=\"stepKey\" let-number=\"number\">\n @if (stateOf(stepKey) === stepState.done) {\n <cw-icon [icon]=\"spriteIcon.check\" [type]=\"iconType.circular\" [iconSize]=\"iconSize['sm']\"\n [iconUiType]=\"iconUiType.success\" [label]=\"stepStatusLabel(stepKey) | translate\"></cw-icon>\n }\n @else if (stateOf(stepKey) === stepState.error) {\n <cw-icon [icon]=\"spriteIcon.close\" [type]=\"iconType.circular\" [iconSize]=\"iconSize['sm']\"\n [iconUiType]=\"iconUiType.danger\" [label]=\"stepStatusLabel(stepKey) | translate\"></cw-icon>\n }\n @else {\n <div class=\"icon-circular icon-circular-sm\" [class]=\"'icon-circular-' + badgeVariant(stepKey)\">\n <span aria-hidden=\"true\">{{ number }}</span>\n <span class=\"visually-hidden\">{{ stepStatusLabel(stepKey) | translate }}</span>\n </div>\n }\n</ng-template>\n\n<ng-template #counts let-rows=\"rows\">\n <ul class=\"list-unstyled d-flex-h gap-md\">\n @for (row of rows; track row.key) {\n <li>\n <span class=\"fs-lg fw-bold\" [class]=\"'text-' + row.tone\">{{ row.count }}</span> {{ row.key | translate: row.params }}\n </li>\n }\n </ul>\n</ng-template>\n\n<cw-accordion [closeOthers]=\"true\" [destroyOnHide]=\"false\">\n\n <!-- Etape 1 : fichier + type d'import -->\n <cw-card\n #stepPanel\n [title]=\"'_COMMON._IMPORT._STEP.SELECT'\"\n [collapseId]=\"'import-step-select'\"\n [collapsed]=\"!isPanelOpen(step.select)\"\n [collapseLocked]=\"stateOf(step.select) === stepState.done\"\n [disabled]=\"stateOf(step.select) === stepState.todo\"\n [collapseStretched]=\"false\">\n\n <ng-container ngProjectAs=\"[header-start]\">\n <ng-container *ngTemplateOutlet=\"badge; context: { stepKey: step.select, number: 1 }\"></ng-container>\n </ng-container>\n\n <div class=\"d-flex-v gap-md\">\n <div class=\"row\">\n <div class=\"col-lg-6\">\n <!-- Retour depuis une analyse non conforme : cible de focus. Le bouton qui declenche\n ce retour disparait avec le repli du panneau 2, le focus retomberait sur <body>. -->\n @if (selectionReopened()) {\n <h3 class=\"visually-hidden\" tabindex=\"-1\" #selectionTarget>\n {{ '_COMMON._IMPORT._A11Y.SELECTION' | translate }}\n </h3>\n }\n\n <cw-file-drop\n [formControl]=\"file\"\n [accept]=\"config().accept\"\n [acceptLabel]=\"config().acceptLabel\"\n [maxSizeMb]=\"maxSizeMb()\"\n [label]=\"'_COMMON._IMPORT.FILE_TO_IMPORT' | translate\">\n </cw-file-drop>\n </div>\n\n @if (config().templateFile) {\n <div class=\"col-lg-6\">\n <cw-card [type]=\"cardType.light\">\n <strong>{{ '_COMMON._IMPORT._TEMPLATE.TITLE' | translate }}</strong>\n <span>{{ '_COMMON._IMPORT._TEMPLATE.TEXT' | translate }}</span>\n <cw-file-to-download [attachments]=\"templateAttachments()\"></cw-file-to-download>\n </cw-card>\n </div>\n }\n </div>\n\n <!-- Mode IMPOSE : aucun champ, et pas davantage de ligne \u00AB Type d'import : ... \u00BB \u2014 la\n maquette ne rend que l'alerte de portee ci-dessous, qui informe deja du mode retenu.\n Le champ cle de rapprochement y est replie (voir l'alerte).\n Choix LIBRE : groupe radio, dont la selection est REQUISE (pas de preselection). -->\n @if (!isModeImposed()) {\n <cw-form-field\n [type]=\"fieldType.radio\"\n [control]=\"mode\"\n [name]=\"'importMode'\"\n [label]=\"'_COMMON._IMPORT._MODE.LABEL'\"\n [options]=\"modeOptions()\"\n [isRequired]=\"true\"\n [help]=\"selectedKeyFieldHint()\">\n </cw-form-field>\n }\n\n <!-- Portee du mode retenu (destructif ou non) : exigence SFD \u00AB l'utilisateur est\n informe du type d'import selectionne ou impose \u00BB. Rien tant qu'aucun mode n'est\n retenu : l'alerte ne decrit jamais un mode que l'utilisateur n'a pas choisi. -->\n @if (modeNotice(); as notice) {\n <cw-alert [type]=\"modeNoticeType()\">\n {{ notice.lead | translate }}\n @if (notice.items.length) {\n <ul class=\"mb-none\">\n @for (item of notice.items; track $index) {\n <li>{{ item | translate }}</li>\n }\n </ul>\n }\n <!-- Mode impose : l'alerte est le SEUL endroit qui reste pour dire sur quoi porte\n le rapprochement. En choix libre, c'est l'aide du groupe radio qui le porte. -->\n @if (isModeImposed() && selectedKeyFieldHint(); as keyFieldHint) {\n <p class=\"mb-none\">{{ keyFieldHint | translate }}</p>\n }\n </cw-alert>\n }\n\n <!-- Un bouton desactive muet est un cul-de-sac : ce texte dit ce qui manque, et il est\n place AVANT le bouton, seul chemin possible puisqu'un bouton desactive n'est pas\n focusable (donc pas d'aria-describedby exploitable). Pas de classe de couleur\n atenuee : c'est une information necessaire, elle garde le contraste du corps. -->\n <div class=\"d-flex-h justify-end gap-md\">\n @if (missingRequirementKey(); as missing) {\n <p class=\"mb-none fs-xs\">{{ missing | translate }}</p>\n }\n\n <cw-button\n [type]=\"buttonType.primary\"\n [label]=\"'_COMMON._IMPORT.CONTINUE'\"\n [dataTest]=\"'btn-import-continue'\"\n [isDisabled]=\"!canContinue()\"\n (btnAction)=\"continueToAnalysis()\">\n </cw-button>\n </div>\n </div>\n </cw-card>\n\n <!-- Etape 2 : analyse a blanc -->\n <cw-card\n #stepPanel\n [title]=\"'_COMMON._IMPORT._STEP.ANALYSIS'\"\n [collapseId]=\"'import-step-analysis'\"\n [collapsed]=\"!isPanelOpen(step.analysis)\"\n [collapseLocked]=\"stateOf(step.analysis) === stepState.done\"\n [disabled]=\"stateOf(step.analysis) === stepState.todo\"\n [collapseStretched]=\"false\">\n\n <ng-container ngProjectAs=\"[header-start]\">\n <ng-container *ngTemplateOutlet=\"badge; context: { stepKey: step.analysis, number: 2 }\"></ng-container>\n </ng-container>\n\n <div class=\"d-flex-v gap-md\">\n @if (analyzing()) {\n <!-- Cible de focus : ce texte EST le message d'etat, il est donc lu une fois et une\n seule (aucune region live en doublon). -->\n <span tabindex=\"-1\" #analysisStatus>{{ '_COMMON._IMPORT.ANALYSIS_IN_PROGRESS' | translate }}</span>\n }\n @else if (analysis(); as result) {\n <!-- Cible de focus a l'arrivee du resultat : libelle de section, pas une reprise du\n message, pour que la lecture enchaine sur l'alerte puis les compteurs. -->\n <h3 class=\"visually-hidden\" tabindex=\"-1\" #analysisOutcome>\n {{ '_COMMON._IMPORT._A11Y.ANALYSIS_RESULT' | translate }}\n </h3>\n\n @if (result.valid) {\n <cw-alert [type]=\"alertType.success\">\n {{ '_COMMON._IMPORT.ANALYSIS_OK' | translate }}\n </cw-alert>\n\n <!-- scope=list : previsualisation chiffree. scope=singleConfig : le message ci-dessus suffit. -->\n @if (isList() && previewRows().length) {\n <ng-container *ngTemplateOutlet=\"counts; context: { rows: previewRows() }\"></ng-container>\n }\n\n <div class=\"list-unstyled d-flex-h justify-end\">\n <cw-button\n [type]=\"buttonType.primary\"\n [label]=\"'_COMMON._IMPORT.START'\"\n [dataTest]=\"'btn-import-start'\"\n (btnAction)=\"startImport()\">\n </cw-button>\n </div>\n }\n @else {\n <cw-alert [type]=\"alertType.danger\">\n {{ '_COMMON._IMPORT.ANALYSIS_KO' | translate }}\n </cw-alert>\n\n @if (errorCountRow(); as errorCount) {\n <p class=\"mb-none\">\n <span class=\"fs-lg fw-bold\" [class]=\"'text-' + errorCount.tone\">{{ errorCount.count }}</span>\n {{ errorCount.key | translate }}\n </p>\n\n <!-- Une alerte par anomalie, et non une liste a puces : c'est le rendu de la\n maquette, et chaque message reste lisible isolement. -->\n @for (issue of errors(); track $index) {\n <cw-alert [type]=\"alertType.danger\">\n @if (issue.line !== undefined) {\n <strong>{{ '_COMMON._IMPORT.ERROR_LINE' | translate: { line: issue.line } }}</strong>\n }\n {{ issue.messageKey ? (issue.messageKey | translate: issue.messageParams) : issue.message }}\n </cw-alert>\n }\n }\n\n <div class=\"d-flex-h justify-end\">\n <cw-button\n [type]=\"buttonType.secondary\"\n [label]=\"'_COMMON._IMPORT.BACK_TO_SELECTION'\"\n [dataTest]=\"'btn-import-back'\"\n (btnAction)=\"backToSelection()\">\n </cw-button>\n </div>\n }\n }\n </div>\n </cw-card>\n\n <!-- Etape 3 : import -->\n <cw-card\n #stepPanel\n [title]=\"'_COMMON._IMPORT._STEP.EXECUTION'\"\n [collapseId]=\"'import-step-execution'\"\n [collapsed]=\"!isPanelOpen(step.execution)\"\n [disabled]=\"stateOf(step.execution) === stepState.todo\"\n [collapseStretched]=\"false\">\n\n <ng-container ngProjectAs=\"[header-start]\">\n <ng-container *ngTemplateOutlet=\"badge; context: { stepKey: step.execution, number: 3 }\"></ng-container>\n </ng-container>\n\n <div class=\"d-flex-v gap-md\">\n @if (isImporting) {\n <div class=\"d-flex-v gap-2xs\">\n <!-- Cible de focus. Le bouton \u00AB Arreter l'import \u00BB est le focusable suivant. -->\n <span tabindex=\"-1\" #executionStatus>{{ '_COMMON._IMPORT.IN_PROGRESS' | translate }}</span>\n @if (progress()?.remainingLabel; as remaining) {\n <span>{{ '_COMMON._IMPORT.REMAINING' | translate: { value: remaining } }}</span>\n }\n </div>\n\n <!-- Avancement connu => barre deterministe. Aucune progression recue => spinner\n indetermine, plutot qu'une barre figee a 0 %. La bascule se fait a la premiere\n emission `ImportProgress` : une source qui n'en emet jamais reste sur le spinner.\n `displayText` a false : le libelle \u00AB Import en cours \u00BB est deja au-dessus. -->\n @if (progress(); as current) {\n <cw-progress-bar\n [value]=\"current.percent\"\n [type]=\"progressType.information\"\n [label]=\"'_COMMON._IMPORT.IN_PROGRESS' | translate\">\n </cw-progress-bar>\n }\n @else {\n <cw-loader [size]=\"loaderSize.sm\" [displayText]=\"false\"></cw-loader>\n }\n\n <!-- Pas de bouton d'arret quand l'objet declare l'import non interruptible : un\n bouton qui ne peut rien arreter serait pire que son absence. -->\n @if (canInterrupt()) {\n <div class=\"d-flex-h justify-end\">\n <cw-button\n [type]=\"buttonType.dangerOutline\"\n [label]=\"'_COMMON._IMPORT.STOP'\"\n [dataTest]=\"'btn-import-stop'\"\n (btnAction)=\"stopImport()\">\n </cw-button>\n </div>\n }\n }\n @else if (cancelling()) {\n <!-- Annulation demandee au serveur, reponse en attente. Cible de focus. -->\n <span tabindex=\"-1\" #cancellingStatus>{{ '_COMMON._IMPORT.CANCELLING' | translate }}</span>\n\n <cw-loader [size]=\"loaderSize.sm\" [displayText]=\"false\"></cw-loader>\n\n <!-- Sortie de secours : aucun delai n'etant defendable depuis la lib, c'est\n l'utilisateur qui decide d'arreter d'attendre. Conclut en \u00AB etat incertain \u00BB. -->\n <div class=\"d-flex-h justify-end\">\n <cw-button\n [type]=\"buttonType.secondary\"\n [label]=\"'_COMMON._IMPORT.STOP_WAITING'\"\n [dataTest]=\"'btn-import-stop-waiting'\"\n (btnAction)=\"stopWaiting()\">\n </cw-button>\n </div>\n }\n @else if (interruptionMessageKey(); as interruptionMessage) {\n <h3 class=\"visually-hidden\" tabindex=\"-1\" #interruptedOutcome>\n {{ '_COMMON._IMPORT._A11Y.IMPORT_RESULT' | translate }}\n </h3>\n\n <cw-alert [type]=\"interruptionAlertType()\">\n {{ interruptionMessage | translate }}\n </cw-alert>\n }\n @else if (report(); as result) {\n <h3 class=\"visually-hidden\" tabindex=\"-1\" #reportOutcome>\n {{ '_COMMON._IMPORT._A11Y.IMPORT_RESULT' | translate }}\n </h3>\n\n @if (result.success) {\n <cw-alert [type]=\"alertType.success\">\n {{ '_COMMON._IMPORT.SUCCESS' | translate }}\n </cw-alert>\n\n @if (isList() && reportRows().length) {\n <ng-container *ngTemplateOutlet=\"counts; context: { rows: reportRows() }\"></ng-container>\n }\n }\n @else {\n <!-- Le message generique ne promet l'absence d'ecriture que si l'atomicite est\n declaree (cf. `failureMessageKey`). -->\n <cw-alert [type]=\"alertType.danger\">\n {{ result.errorMessage ?? (failureMessageKey() | translate) }}\n </cw-alert>\n }\n }\n </div>\n </cw-card>\n\n</cw-accordion>\n", dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$2.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "ngmodule", type: TranslateModule }, { kind: "component", type: AccordionComponent, selector: "cw-accordion", inputs: ["closeOthers", "allowMultiple", "destroyOnHide"], outputs: ["panelOpened", "panelClosed"] }, { kind: "component", type: AlertComponent, selector: "cw-alert", inputs: ["type", "title", "isDismissible", "cssClass", "dataTest"], outputs: ["close"] }, { kind: "component", type: ButtonComponent, selector: "cw-button", inputs: ["type", "label", "id", "link", "isDropdown", "hideCaret", "withIcon", "withOnlyIcon", "iconSize", "iconPosition", "dropdownPosition", "isMinWidth", "isDisabled", "isLoading", "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 }); }
|
|
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 }); }
|
|
1958
2047
|
}
|
|
1959
2048
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: ImportWizardComponent, decorators: [{
|
|
1960
2049
|
type: Component,
|
|
@@ -1972,7 +2061,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.20", ngImpo
|
|
|
1972
2061
|
IconComponent,
|
|
1973
2062
|
LoaderComponent,
|
|
1974
2063
|
ProgressBarComponent
|
|
1975
|
-
], template: "<!-- Pastille d'etape : icone ronde verte (terminee) / rouge (echec), sinon le numero.\n Rendue dans [header-start] pour etre AVANT le titre, comme sur les maquettes.\n Le numero seul n'etant pas parlant a l'oreille, le statut est double en visually-hidden --\n et c'est LUI qui distingue \u00AB en cours \u00BB de \u00AB a venir \u00BB pour qui ne voit pas la couleur. -->\n<ng-template #badge let-stepKey=\"stepKey\" let-number=\"number\">\n @if (stateOf(stepKey) === stepState.done) {\n <cw-icon [icon]=\"spriteIcon.check\" [type]=\"iconType.circular\" [iconSize]=\"iconSize['sm']\"\n [iconUiType]=\"iconUiType.success\" [label]=\"stepStatusLabel(stepKey) | translate\"></cw-icon>\n }\n @else if (stateOf(stepKey) === stepState.error) {\n <cw-icon [icon]=\"spriteIcon.close\" [type]=\"iconType.circular\" [iconSize]=\"iconSize['sm']\"\n [iconUiType]=\"iconUiType.danger\" [label]=\"stepStatusLabel(stepKey) | translate\"></cw-icon>\n }\n @else {\n <div class=\"icon-circular icon-circular-sm\" [class]=\"'icon-circular-' + badgeVariant(stepKey)\">\n <span aria-hidden=\"true\">{{ number }}</span>\n <span class=\"visually-hidden\">{{ stepStatusLabel(stepKey) | translate }}</span>\n </div>\n }\n</ng-template>\n\n<ng-template #counts let-rows=\"rows\">\n <ul class=\"list-unstyled d-flex-h gap-md\">\n @for (row of rows; track row.key) {\n <li>\n <span class=\"fs-lg fw-bold\" [class]=\"'text-' + row.tone\">{{ row.count }}</span> {{ row.key | translate: row.params }}\n </li>\n }\n </ul>\n</ng-template>\n\n<cw-accordion [closeOthers]=\"true\" [destroyOnHide]=\"false\">\n\n <!-- Etape 1 : fichier + type d'import -->\n <cw-card\n #stepPanel\n [title]=\"'_COMMON._IMPORT._STEP.SELECT'\"\n [collapseId]=\"'import-step-select'\"\n [collapsed]=\"!isPanelOpen(step.select)\"\n [collapseLocked]=\"stateOf(step.select) === stepState.done\"\n [disabled]=\"stateOf(step.select) === stepState.todo\"\n [collapseStretched]=\"false\">\n\n <ng-container ngProjectAs=\"[header-start]\">\n <ng-container *ngTemplateOutlet=\"badge; context: { stepKey: step.select, number: 1 }\"></ng-container>\n </ng-container>\n\n <div class=\"d-flex-v gap-md\">\n <div class=\"row\">\n <div class=\"col-lg-6\">\n <!-- Retour depuis une analyse non conforme : cible de focus. Le bouton qui declenche\n ce retour disparait avec le repli du panneau 2, le focus retomberait sur <body>. -->\n @if (selectionReopened()) {\n <h3 class=\"visually-hidden\" tabindex=\"-1\" #selectionTarget>\n {{ '_COMMON._IMPORT._A11Y.SELECTION' | translate }}\n </h3>\n }\n\n <cw-file-drop\n [formControl]=\"file\"\n [accept]=\"config().accept\"\n [acceptLabel]=\"config().acceptLabel\"\n [maxSizeMb]=\"maxSizeMb()\"\n [label]=\"'_COMMON._IMPORT.FILE_TO_IMPORT' | translate\">\n </cw-file-drop>\n </div>\n\n @if (config().templateFile) {\n <div class=\"col-lg-6\">\n <cw-card [type]=\"cardType.light\">\n <strong>{{ '_COMMON._IMPORT._TEMPLATE.TITLE' | translate }}</strong>\n <span>{{ '_COMMON._IMPORT._TEMPLATE.TEXT' | translate }}</span>\n <cw-file-to-download [attachments]=\"templateAttachments()\"></cw-file-to-download>\n </cw-card>\n </div>\n }\n </div>\n\n <!-- Mode IMPOSE : aucun champ, et pas davantage de ligne \u00AB Type d'import : ... \u00BB \u2014 la\n maquette ne rend que l'alerte de portee ci-dessous, qui informe deja du mode retenu.\n Le champ cle de rapprochement y est replie (voir l'alerte).\n Choix LIBRE : groupe radio, dont la selection est REQUISE (pas de preselection). -->\n @if (!isModeImposed()) {\n <cw-form-field\n [type]=\"fieldType.radio\"\n [control]=\"mode\"\n [name]=\"'importMode'\"\n [label]=\"'_COMMON._IMPORT._MODE.LABEL'\"\n [options]=\"modeOptions()\"\n [isRequired]=\"true\"\n [help]=\"selectedKeyFieldHint()\">\n </cw-form-field>\n }\n\n <!-- Portee du mode retenu (destructif ou non) : exigence SFD \u00AB l'utilisateur est\n informe du type d'import selectionne ou impose \u00BB. Rien tant qu'aucun mode n'est\n retenu : l'alerte ne decrit jamais un mode que l'utilisateur n'a pas choisi. -->\n @if (modeNotice(); as notice) {\n <cw-alert [type]=\"modeNoticeType()\">\n {{ notice.lead | translate }}\n @if (notice.items.length) {\n <ul class=\"mb-none\">\n @for (item of notice.items; track $index) {\n <li>{{ item | translate }}</li>\n }\n </ul>\n }\n <!-- Mode impose : l'alerte est le SEUL endroit qui reste pour dire sur quoi porte\n le rapprochement. En choix libre, c'est l'aide du groupe radio qui le porte. -->\n @if (isModeImposed() && selectedKeyFieldHint(); as keyFieldHint) {\n <p class=\"mb-none\">{{ keyFieldHint | translate }}</p>\n }\n </cw-alert>\n }\n\n <!-- Un bouton desactive muet est un cul-de-sac : ce texte dit ce qui manque, et il est\n place AVANT le bouton, seul chemin possible puisqu'un bouton desactive n'est pas\n focusable (donc pas d'aria-describedby exploitable). Pas de classe de couleur\n atenuee : c'est une information necessaire, elle garde le contraste du corps. -->\n <div class=\"d-flex-h justify-end gap-md\">\n @if (missingRequirementKey(); as missing) {\n <p class=\"mb-none fs-xs\">{{ missing | translate }}</p>\n }\n\n <cw-button\n [type]=\"buttonType.primary\"\n [label]=\"'_COMMON._IMPORT.CONTINUE'\"\n [dataTest]=\"'btn-import-continue'\"\n [isDisabled]=\"!canContinue()\"\n (btnAction)=\"continueToAnalysis()\">\n </cw-button>\n </div>\n </div>\n </cw-card>\n\n <!-- Etape 2 : analyse a blanc -->\n <cw-card\n #stepPanel\n [title]=\"'_COMMON._IMPORT._STEP.ANALYSIS'\"\n [collapseId]=\"'import-step-analysis'\"\n [collapsed]=\"!isPanelOpen(step.analysis)\"\n [collapseLocked]=\"stateOf(step.analysis) === stepState.done\"\n [disabled]=\"stateOf(step.analysis) === stepState.todo\"\n [collapseStretched]=\"false\">\n\n <ng-container ngProjectAs=\"[header-start]\">\n <ng-container *ngTemplateOutlet=\"badge; context: { stepKey: step.analysis, number: 2 }\"></ng-container>\n </ng-container>\n\n <div class=\"d-flex-v gap-md\">\n @if (analyzing()) {\n <!-- Cible de focus : ce texte EST le message d'etat, il est donc lu une fois et une\n seule (aucune region live en doublon). -->\n <span tabindex=\"-1\" #analysisStatus>{{ '_COMMON._IMPORT.ANALYSIS_IN_PROGRESS' | translate }}</span>\n }\n @else if (analysis(); as result) {\n <!-- Cible de focus a l'arrivee du resultat : libelle de section, pas une reprise du\n message, pour que la lecture enchaine sur l'alerte puis les compteurs. -->\n <h3 class=\"visually-hidden\" tabindex=\"-1\" #analysisOutcome>\n {{ '_COMMON._IMPORT._A11Y.ANALYSIS_RESULT' | translate }}\n </h3>\n\n @if (result.valid) {\n <cw-alert [type]=\"alertType.success\">\n {{ '_COMMON._IMPORT.ANALYSIS_OK' | translate }}\n </cw-alert>\n\n <!-- scope=list : previsualisation chiffree. scope=singleConfig : le message ci-dessus suffit. -->\n @if (isList() && previewRows().length) {\n <ng-container *ngTemplateOutlet=\"counts; context: { rows: previewRows() }\"></ng-container>\n }\n\n <div class=\"list-unstyled d-flex-h justify-end\">\n <cw-button\n [type]=\"buttonType.primary\"\n [label]=\"'_COMMON._IMPORT.START'\"\n [dataTest]=\"'btn-import-start'\"\n (btnAction)=\"startImport()\">\n </cw-button>\n </div>\n }\n @else {\n <cw-alert [type]=\"alertType.danger\">\n {{ '_COMMON._IMPORT.ANALYSIS_KO' | translate }}\n </cw-alert>\n\n @if (errorCountRow(); as errorCount) {\n <p class=\"mb-none\">\n <span class=\"fs-lg fw-bold\" [class]=\"'text-' + errorCount.tone\">{{ errorCount.count }}</span>\n {{ errorCount.key | translate }}\n </p>\n\n <!-- Une alerte par anomalie, et non une liste a puces : c'est le rendu de la\n maquette, et chaque message reste lisible isolement. -->\n @for (issue of errors(); track $index) {\n <cw-alert [type]=\"alertType.danger\">\n @if (issue.line !== undefined) {\n <strong>{{ '_COMMON._IMPORT.ERROR_LINE' | translate: { line: issue.line } }}</strong>\n }\n {{ issue.messageKey ? (issue.messageKey | translate: issue.messageParams) : issue.message }}\n </cw-alert>\n }\n }\n\n <div class=\"d-flex-h justify-end\">\n <cw-button\n [type]=\"buttonType.secondary\"\n [label]=\"'_COMMON._IMPORT.BACK_TO_SELECTION'\"\n [dataTest]=\"'btn-import-back'\"\n (btnAction)=\"backToSelection()\">\n </cw-button>\n </div>\n }\n }\n </div>\n </cw-card>\n\n <!-- Etape 3 : import -->\n <cw-card\n #stepPanel\n [title]=\"'_COMMON._IMPORT._STEP.EXECUTION'\"\n [collapseId]=\"'import-step-execution'\"\n [collapsed]=\"!isPanelOpen(step.execution)\"\n [disabled]=\"stateOf(step.execution) === stepState.todo\"\n [collapseStretched]=\"false\">\n\n <ng-container ngProjectAs=\"[header-start]\">\n <ng-container *ngTemplateOutlet=\"badge; context: { stepKey: step.execution, number: 3 }\"></ng-container>\n </ng-container>\n\n <div class=\"d-flex-v gap-md\">\n @if (isImporting) {\n <div class=\"d-flex-v gap-2xs\">\n <!-- Cible de focus. Le bouton \u00AB Arreter l'import \u00BB est le focusable suivant. -->\n <span tabindex=\"-1\" #executionStatus>{{ '_COMMON._IMPORT.IN_PROGRESS' | translate }}</span>\n @if (progress()?.remainingLabel; as remaining) {\n <span>{{ '_COMMON._IMPORT.REMAINING' | translate: { value: remaining } }}</span>\n }\n </div>\n\n <!-- Avancement connu => barre deterministe. Aucune progression recue => spinner\n indetermine, plutot qu'une barre figee a 0 %. La bascule se fait a la premiere\n emission `ImportProgress` : une source qui n'en emet jamais reste sur le spinner.\n `displayText` a false : le libelle \u00AB Import en cours \u00BB est deja au-dessus. -->\n @if (progress(); as current) {\n <cw-progress-bar\n [value]=\"current.percent\"\n [type]=\"progressType.information\"\n [label]=\"'_COMMON._IMPORT.IN_PROGRESS' | translate\">\n </cw-progress-bar>\n }\n @else {\n <cw-loader [size]=\"loaderSize.sm\" [displayText]=\"false\"></cw-loader>\n }\n\n <!-- Pas de bouton d'arret quand l'objet declare l'import non interruptible : un\n bouton qui ne peut rien arreter serait pire que son absence. -->\n @if (canInterrupt()) {\n <div class=\"d-flex-h justify-end\">\n <cw-button\n [type]=\"buttonType.dangerOutline\"\n [label]=\"'_COMMON._IMPORT.STOP'\"\n [dataTest]=\"'btn-import-stop'\"\n (btnAction)=\"stopImport()\">\n </cw-button>\n </div>\n }\n }\n @else if (cancelling()) {\n <!-- Annulation demandee au serveur, reponse en attente. Cible de focus. -->\n <span tabindex=\"-1\" #cancellingStatus>{{ '_COMMON._IMPORT.CANCELLING' | translate }}</span>\n\n <cw-loader [size]=\"loaderSize.sm\" [displayText]=\"false\"></cw-loader>\n\n <!-- Sortie de secours : aucun delai n'etant defendable depuis la lib, c'est\n l'utilisateur qui decide d'arreter d'attendre. Conclut en \u00AB etat incertain \u00BB. -->\n <div class=\"d-flex-h justify-end\">\n <cw-button\n [type]=\"buttonType.secondary\"\n [label]=\"'_COMMON._IMPORT.STOP_WAITING'\"\n [dataTest]=\"'btn-import-stop-waiting'\"\n (btnAction)=\"stopWaiting()\">\n </cw-button>\n </div>\n }\n @else if (interruptionMessageKey(); as interruptionMessage) {\n <h3 class=\"visually-hidden\" tabindex=\"-1\" #interruptedOutcome>\n {{ '_COMMON._IMPORT._A11Y.IMPORT_RESULT' | translate }}\n </h3>\n\n <cw-alert [type]=\"interruptionAlertType()\">\n {{ interruptionMessage | translate }}\n </cw-alert>\n }\n @else if (report(); as result) {\n <h3 class=\"visually-hidden\" tabindex=\"-1\" #reportOutcome>\n {{ '_COMMON._IMPORT._A11Y.IMPORT_RESULT' | translate }}\n </h3>\n\n @if (result.success) {\n <cw-alert [type]=\"alertType.success\">\n {{ '_COMMON._IMPORT.SUCCESS' | translate }}\n </cw-alert>\n\n @if (isList() && reportRows().length) {\n <ng-container *ngTemplateOutlet=\"counts; context: { rows: reportRows() }\"></ng-container>\n }\n }\n @else {\n <!-- Le message generique ne promet l'absence d'ecriture que si l'atomicite est\n declaree (cf. `failureMessageKey`). -->\n <cw-alert [type]=\"alertType.danger\">\n {{ result.errorMessage ?? (failureMessageKey() | translate) }}\n </cw-alert>\n }\n }\n </div>\n </cw-card>\n\n</cw-accordion>\n" }]
|
|
2064
|
+
], 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" }]
|
|
1976
2065
|
}], ctorParameters: () => [], propDecorators: { config: [{ type: i0.Input, args: [{ isSignal: true, alias: "config", required: true }] }], completed: [{ type: i0.Output, args: ["completed"] }], panels: [{ type: i0.ViewChildren, args: ['stepPanel', { ...{ read: CardComponent }, isSignal: true }] }], selectionTarget: [{ type: i0.ViewChild, args: ['selectionTarget', { isSignal: true }] }], analysisStatus: [{ type: i0.ViewChild, args: ['analysisStatus', { isSignal: true }] }], analysisOutcome: [{ type: i0.ViewChild, args: ['analysisOutcome', { isSignal: true }] }], executionStatus: [{ type: i0.ViewChild, args: ['executionStatus', { isSignal: true }] }], cancellingStatus: [{ type: i0.ViewChild, args: ['cancellingStatus', { isSignal: true }] }], reportOutcome: [{ type: i0.ViewChild, args: ['reportOutcome', { isSignal: true }] }], interruptedOutcome: [{ type: i0.ViewChild, args: ['interruptedOutcome', { isSignal: true }] }] } });
|
|
1977
2066
|
|
|
1978
2067
|
/**
|
|
@@ -2303,7 +2392,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.20", ngImpo
|
|
|
2303
2392
|
function buildFilterParams(filters, keyMap) {
|
|
2304
2393
|
let params = new HttpParams();
|
|
2305
2394
|
for (const [key, value] of Object.entries(filters)) {
|
|
2306
|
-
if (value == null || value === '')
|
|
2395
|
+
if (value == null || value === '' || (Array.isArray(value) && value.length === 0))
|
|
2307
2396
|
continue;
|
|
2308
2397
|
const mapping = keyMap?.[key];
|
|
2309
2398
|
if (typeof value === 'object' && 'start' in value && 'end' in value) {
|
|
@@ -2315,7 +2404,8 @@ function buildFilterParams(filters, keyMap) {
|
|
|
2315
2404
|
}
|
|
2316
2405
|
else {
|
|
2317
2406
|
const paramKey = typeof mapping === 'string' ? mapping : key;
|
|
2318
|
-
|
|
2407
|
+
// Filtre multiple : valeurs jointes par des virgules (`role=admin,user`).
|
|
2408
|
+
params = params.set(paramKey, Array.isArray(value) ? value.join(',') : String(value));
|
|
2319
2409
|
}
|
|
2320
2410
|
}
|
|
2321
2411
|
return params;
|
|
@@ -2332,5 +2422,5 @@ function buildFilterParams(filters, keyMap) {
|
|
|
2332
2422
|
* Generated bundle index. Do not edit.
|
|
2333
2423
|
*/
|
|
2334
2424
|
|
|
2335
|
-
export { ArrayAdapter, CW_PAGE_SCOPE, CustomListComponent, DragNDropListComponent, DragNDropNestedListComponent, ExportButtonComponent, FilterBarComponent, FormArrayAdapter, IMPORT_WIZARD_STEPS, ImportButtonComponent, ImportEventKindEnum, ImportInterruptionEnum, ImportInterruptionStateEnum, ImportModeEnum, ImportScopeEnum, ImportWizardComponent, ImportWizardStepEnum, ImportWizardStepStateEnum, PageHeaderActionEnum, PageHeaderComponent, PaginationComponent, ProgressBarComponent, ProgressBarSizeEnum, ProgressBarTypeEnum, TableComponent, WizardStepComponent, WizardStepperComponent, buildFilename, buildFilterParams, downloadBlob, formatCount, i18nKey, importWizardStepRank, jsonBlob, loadHiddenColumns, pluralizedCountKey, provideCwPageScope, saveHiddenColumns, todayIsoDate };
|
|
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 };
|
|
2336
2426
|
//# sourceMappingURL=cityway-bo-ui.mjs.map
|