@cityway/bo-ui 1.1.0-beta027 → 1.1.0-beta028
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-beta028.tgz +0 -0
- package/docs/components/filter-bar.md +32 -0
- package/docs/components/table.md +19 -0
- package/fesm2022/cityway-bo-ui.mjs +12 -6
- package/fesm2022/cityway-bo-ui.mjs.map +1 -1
- package/index.d.ts +17 -1
- package/package.json +2 -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-beta027.tgz +0 -0
|
@@ -577,7 +577,7 @@ class PaginationComponent {
|
|
|
577
577
|
});
|
|
578
578
|
}
|
|
579
579
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: PaginationComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
580
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.20", type: PaginationComponent, isStandalone: true, selector: "cw-pagination", inputs: { pagination: { classPropertyName: "pagination", publicName: "pagination", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { paginationChange: "paginationChange" }, ngImport: i0, template: "@if (pagination().totalPages > 0) {\r\n<div class=\"pagination d-flex-h gap-md justify-between fs fs-sm\">\r\n\r\n <!-- LEFT PART -->\r\n <div class=\"d-flex-h gap-sm\">\r\n {{ '_COMMON._PAGINATION.RESULT_P' | translate: {total: pagination().totalItems } }}\r\n -\r\n {{ '_COMMON._PAGINATION.DISPLAY' | translate }}\r\n\r\n <cw-form-field\r\n [label]=\"'_COMMON._PAGINATION.ITEMS_PER_PAGE'\"\r\n [type]=\"typeField.select\"\r\n [control]=\"itemsPerPageControl\"\r\n [options]=\"pageSizesOptions\"\r\n [displayLabel]=\"false\"\r\n [clearable]=\"false\">\r\n </cw-form-field>\r\n\r\n {{ '_COMMON._PAGINATION.ITEMS_PER_PAGE' | translate }}\r\n </div>\r\n\r\n <!-- PAGINATION -->\r\n <ul class=\"list-unstyled d-flex-h gap-3xs\">\r\n\r\n <!-- PREVIOUS -->\r\n <li>\r\n <cw-button\r\n [type]=\"typeButton.ghost\"\r\n [withOnlyIcon]=\"true\"\r\n [withIcon]=\"spriteIcon.nextLeft\"\r\n [isDisabled]=\"pagination().currentPage <= 1\"\r\n [iconSize]=\"buttonIconSize.small\"\r\n cssClass=\"btn-pagination\"\r\n (btnAction)=\"emit(pagination().currentPage - 1)\">\r\n </cw-button>\r\n </li>\r\n\r\n <!-- PAGES -->\r\n @for (item of visiblePages(); track item) {\r\n\r\n <!-- NUMBER -->\r\n @if (typeof item === 'number') {\r\n <li>\r\n <cw-button\r\n [type]=\"typeButton.ghost\"\r\n [label]=\"item.toString()\"\r\n [cssClass]=\"item === pagination().currentPage ? 'btn-pagination btn-pagination-active' : 'btn-pagination'\"\r\n (btnAction)=\"emit(item)\">\r\n </cw-button>\r\n </li>\r\n }\r\n\r\n <!-- JUMP PREV -->\r\n @else if (item.type === 'jump-prev') {\r\n <li>\r\n <cw-button\r\n [type]=\"typeButton.ghost\"\r\n label=\"...\"\r\n cssClass=\"btn-pagination\"\r\n (btnAction)=\"emit(item.page)\">\r\n </cw-button>\r\n </li>\r\n }\r\n\r\n <!-- JUMP NEXT -->\r\n @else if (item.type === 'jump-next') {\r\n <li>\r\n <cw-button\r\n [type]=\"typeButton.ghost\"\r\n label=\"...\"\r\n cssClass=\"btn-pagination\"\r\n (btnAction)=\"emit(item.page)\">\r\n </cw-button>\r\n </li>\r\n }\r\n }\r\n\r\n <!-- NEXT -->\r\n <li>\r\n <cw-button\r\n [type]=\"typeButton.ghost\"\r\n [withOnlyIcon]=\"true\"\r\n [withIcon]=\"spriteIcon.nextRight\"\r\n [isDisabled]=\"pagination().currentPage >= pagination().totalPages\"\r\n [iconSize]=\"buttonIconSize.small\"\r\n cssClass=\"btn-pagination\"\r\n (btnAction)=\"emit(pagination().currentPage + 1)\">\r\n </cw-button>\r\n </li>\r\n\r\n </ul>\r\n</div>\r\n}\r\n", dependencies: [{ kind: "ngmodule", type: TranslateModule }, { kind: "component", type: ButtonComponent, selector: "cw-button", inputs: ["type", "label", "labelParams", "id", "link", "isDropdown", "hideCaret", "withIcon", "withOnlyIcon", "iconSize", "iconPosition", "dropdownPosition", "isMinWidth", "isDisabled", "isLoading", "loadingAnnounce", "cssClass", "dataTest", "skeletonMode", "isPressed", "ariaDescribedBy", "ariaLabel", "ariaExpanded", "ariaControls", "withTooltip", "tooltipText", "tooltipTitle", "tooltipTrigger", "tooltipPosition", "tooltipType"], outputs: ["btnAction", "dropDownClicked"] }, { kind: "component", type: FormFieldComponent, selector: "cw-form-field", inputs: ["control", "formGroup", "type", "label", "displayLabel", "fieldTitle", "name", "placeholder", "autocomplete", "options", "rangeOptions", "validationOptions", "autocompleteOptions", "richTextOptions", "errorMessages", "isRequired", "requiredStart", "requiredEnd", "help", "helpParams", "tooltip", "ariaDescribedBy", "addonLeft", "addonRight", "isInAddon", "isReadonly", "isDisabled", "sliderValue", "sliderOptions", "cssClass", "skeletonMode", "clearable", "appendTo", "initialCountry", "recommendedDimensions", "showPreview", "existingFile", "indeterminate"], outputs: ["refreshEvent", "fileRemoved", "textChanged", "valueChange", "phoneRegionChange"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "pipe", type: i1.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
580
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.20", type: PaginationComponent, isStandalone: true, selector: "cw-pagination", inputs: { pagination: { classPropertyName: "pagination", publicName: "pagination", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { paginationChange: "paginationChange" }, ngImport: i0, template: "@if (pagination().totalPages > 0) {\r\n<div class=\"pagination d-flex-h gap-md justify-between fs fs-sm\">\r\n\r\n <!-- LEFT PART -->\r\n <div class=\"d-flex-h gap-sm\">\r\n {{ '_COMMON._PAGINATION.RESULT_P' | translate: {total: pagination().totalItems } }}\r\n -\r\n {{ '_COMMON._PAGINATION.DISPLAY' | translate }}\r\n\r\n <cw-form-field\r\n [label]=\"'_COMMON._PAGINATION.ITEMS_PER_PAGE'\"\r\n [type]=\"typeField.select\"\r\n [control]=\"itemsPerPageControl\"\r\n [options]=\"pageSizesOptions\"\r\n [displayLabel]=\"false\"\r\n [clearable]=\"false\">\r\n </cw-form-field>\r\n\r\n {{ '_COMMON._PAGINATION.ITEMS_PER_PAGE' | translate }}\r\n </div>\r\n\r\n <!-- PAGINATION -->\r\n <ul class=\"list-unstyled d-flex-h gap-3xs\">\r\n\r\n <!-- PREVIOUS -->\r\n <li>\r\n <cw-button\r\n [type]=\"typeButton.ghost\"\r\n [withOnlyIcon]=\"true\"\r\n [withIcon]=\"spriteIcon.nextLeft\"\r\n [isDisabled]=\"pagination().currentPage <= 1\"\r\n [iconSize]=\"buttonIconSize.small\"\r\n cssClass=\"btn-pagination\"\r\n (btnAction)=\"emit(pagination().currentPage - 1)\">\r\n </cw-button>\r\n </li>\r\n\r\n <!-- PAGES -->\r\n @for (item of visiblePages(); track item) {\r\n\r\n <!-- NUMBER -->\r\n @if (typeof item === 'number') {\r\n <li>\r\n <cw-button\r\n [type]=\"typeButton.ghost\"\r\n [label]=\"item.toString()\"\r\n [cssClass]=\"item === pagination().currentPage ? 'btn-pagination btn-pagination-active' : 'btn-pagination'\"\r\n (btnAction)=\"emit(item)\">\r\n </cw-button>\r\n </li>\r\n }\r\n\r\n <!-- JUMP PREV -->\r\n @else if (item.type === 'jump-prev') {\r\n <li>\r\n <cw-button\r\n [type]=\"typeButton.ghost\"\r\n label=\"...\"\r\n cssClass=\"btn-pagination\"\r\n (btnAction)=\"emit(item.page)\">\r\n </cw-button>\r\n </li>\r\n }\r\n\r\n <!-- JUMP NEXT -->\r\n @else if (item.type === 'jump-next') {\r\n <li>\r\n <cw-button\r\n [type]=\"typeButton.ghost\"\r\n label=\"...\"\r\n cssClass=\"btn-pagination\"\r\n (btnAction)=\"emit(item.page)\">\r\n </cw-button>\r\n </li>\r\n }\r\n }\r\n\r\n <!-- NEXT -->\r\n <li>\r\n <cw-button\r\n [type]=\"typeButton.ghost\"\r\n [withOnlyIcon]=\"true\"\r\n [withIcon]=\"spriteIcon.nextRight\"\r\n [isDisabled]=\"pagination().currentPage >= pagination().totalPages\"\r\n [iconSize]=\"buttonIconSize.small\"\r\n cssClass=\"btn-pagination\"\r\n (btnAction)=\"emit(pagination().currentPage + 1)\">\r\n </cw-button>\r\n </li>\r\n\r\n </ul>\r\n</div>\r\n}\r\n", dependencies: [{ kind: "ngmodule", type: TranslateModule }, { kind: "component", type: ButtonComponent, selector: "cw-button", inputs: ["type", "label", "labelParams", "id", "link", "isDropdown", "hideCaret", "withIcon", "withOnlyIcon", "iconSize", "iconPosition", "dropdownPosition", "isMinWidth", "isDisabled", "isLoading", "loadingAnnounce", "cssClass", "dataTest", "skeletonMode", "isPressed", "ariaDescribedBy", "ariaLabel", "ariaExpanded", "ariaControls", "withTooltip", "tooltipText", "tooltipTitle", "tooltipTrigger", "tooltipPosition", "tooltipType"], outputs: ["btnAction", "dropDownClicked"] }, { kind: "component", type: FormFieldComponent, selector: "cw-form-field", inputs: ["control", "formGroup", "type", "label", "displayLabel", "fieldTitle", "name", "placeholder", "autocomplete", "options", "rangeOptions", "validationOptions", "autocompleteOptions", "richTextOptions", "errorMessages", "isRequired", "requiredStart", "requiredEnd", "periodShortcuts", "help", "helpParams", "tooltip", "ariaDescribedBy", "addonLeft", "addonRight", "isInAddon", "isReadonly", "isDisabled", "sliderValue", "sliderOptions", "cssClass", "skeletonMode", "clearable", "appendTo", "initialCountry", "recommendedDimensions", "showPreview", "existingFile", "indeterminate"], outputs: ["refreshEvent", "fileRemoved", "textChanged", "valueChange", "phoneRegionChange"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "pipe", type: i1.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
581
581
|
}
|
|
582
582
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: PaginationComponent, decorators: [{
|
|
583
583
|
type: Component,
|
|
@@ -882,6 +882,12 @@ class TableComponent {
|
|
|
882
882
|
const cls = column.cellClass;
|
|
883
883
|
return typeof cls === 'function' ? cls(row) : (cls ?? '');
|
|
884
884
|
}
|
|
885
|
+
/** Seconde ligne d'une cellule `text` / `link` (`secondary` de la colonne), `''` si absente. */
|
|
886
|
+
cellSecondary(row, column) {
|
|
887
|
+
const sec = column.secondary;
|
|
888
|
+
const value = typeof sec === 'function' ? sec(row) : sec ? row[sec] : null;
|
|
889
|
+
return value == null ? '' : String(value);
|
|
890
|
+
}
|
|
885
891
|
getRowClass(row) {
|
|
886
892
|
const fn = this.rowClassFn();
|
|
887
893
|
return fn ? fn(row) : '';
|
|
@@ -1084,7 +1090,7 @@ class TableComponent {
|
|
|
1084
1090
|
return typeof descriptor.link === 'function' ? descriptor.link(row) : descriptor.link;
|
|
1085
1091
|
}
|
|
1086
1092
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: TableComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1087
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.20", type: TableComponent, isStandalone: true, selector: "cw-table", inputs: { checkbox: { classPropertyName: "checkbox", publicName: "checkbox", isSignal: true, isRequired: false, transformFunction: null }, title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: true, transformFunction: null }, columns: { classPropertyName: "columns", publicName: "columns", isSignal: true, isRequired: false, transformFunction: null }, data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: false, transformFunction: null }, loading: { classPropertyName: "loading", publicName: "loading", isSignal: true, isRequired: false, transformFunction: null }, rowClassFn: { classPropertyName: "rowClassFn", publicName: "rowClassFn", isSignal: true, isRequired: false, transformFunction: null }, pagination: { classPropertyName: "pagination", publicName: "pagination", isSignal: true, isRequired: false, transformFunction: null }, bulkActions: { classPropertyName: "bulkActions", publicName: "bulkActions", isSignal: true, isRequired: false, transformFunction: null }, rowActions: { classPropertyName: "rowActions", publicName: "rowActions", isSignal: true, isRequired: false, transformFunction: null }, emptyStateNoData: { classPropertyName: "emptyStateNoData", publicName: "emptyStateNoData", isSignal: true, isRequired: false, transformFunction: null }, emptyStateNoResult: { classPropertyName: "emptyStateNoResult", publicName: "emptyStateNoResult", isSignal: true, isRequired: false, transformFunction: null }, isFiltered: { classPropertyName: "isFiltered", publicName: "isFiltered", isSignal: true, isRequired: false, transformFunction: null }, showScope: { classPropertyName: "showScope", publicName: "showScope", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { cellClick: "cellClick", sortChange: "sortChange", selectionChange: "selectionChange", paginationChange: "paginationChange", bulkDelete: "bulkDelete", bulkAction: "bulkAction" }, host: { classAttribute: "cw-table" }, queries: [{ propertyName: "actionsTemplate", first: true, predicate: ["actionsTemplate"], descendants: true, isSignal: true }], viewQueries: [{ propertyName: "scroller", first: true, predicate: ["scroller"], descendants: true, isSignal: true }, { propertyName: "scrollbarProxy", first: true, predicate: ["scrollbarProxy"], descendants: true, isSignal: true }], ngImport: i0, template: "@if (checkbox() && selectionCount() > 0) {\n <!-- Espacement DS : gap-md = 16px = component/button/set/gap (espacement entre\n boutons d'un set). Utilitaires basic-ui (adosses a l'echelle $sizing des\n tokens) et non ceux de Bootstrap : gap-2 valait 8px. d-flex-h centre deja\n verticalement, align-items-center est donc inutile. -->\n <div class=\"table-selection-info mb-md d-flex-h gap-md flex-wrap\">\n <span class=\"flex-grow-1\">\n {{ selectionCount() }} {{ '_COMMON._TABLE._BULK_ACTION.SELECTED_ITEMS_CURRENT_PAGE' | translate }}\n </span>\n @for (action of bulkActions(); track $index) {\n <cw-button\n [type]=\"resolveVariant(action)\"\n [label]=\"action.label\"\n [withIcon]=\"action.icon\"\n [isDisabled]=\"resolveDisabled(action)\"\n (btnAction)=\"onBulkActionClick(action)\">\n </cw-button>\n }\n </div>\n}\n\n<!-- Defilement horizontal : ombres de bord sur le wrapper, conteneur focusable (clavier) et nomme\n par la legende des qu'il deborde. -->\n<div class=\"table-scroll p-relative\" [class.can-scroll-left]=\"canScrollLeft()\" [class.can-scroll-right]=\"canScrollRight()\"\n [style.--cw-table-sticky-width]=\"stickyWidth() + 'px'\">\n<div #scroller class=\"table-responsive\" [class.is-overflowing]=\"overflowing()\" (scroll)=\"onScroll()\"\n [attr.tabindex]=\"overflowing() ? 0 : null\" [attr.role]=\"overflowing() ? 'region' : null\"\n [attr.aria-labelledby]=\"overflowing() ? uid + '-caption' : null\">\n <table class=\"table\">\n <caption class=\"visually-hidden\" [id]=\"uid + '-caption'\">{{ title() | translate }}</caption>\n <thead>\n <tr>\n @if(checkbox()) {\n <th scope=\"col\" width=\"10\" class=\"table-check\" [class.is-sticky]=\"checkboxSticky()\"\n [style.left.px]=\"checkboxSticky() ? 0 : null\">\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 @let thLeft = stickyLeft(column.key);\n <th scope=\"col\" [class.p-0]=\"column.sort\" [attr.aria-sort]=\"column.sort ? getAriaSort(column.key) : null\"\n [class.is-sticky]=\"thLeft !== null\" [class.is-sticky-last]=\"isLastSticky(column.key)\" [style.left.px]=\"thLeft\"\n [style.min-width]=\"column.minWidth\" [style.max-width]=\"column.maxWidth\">\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 class=\"table-check\" [class.is-sticky]=\"checkboxSticky()\"\n [style.left.px]=\"checkboxSticky() ? 0 : null\">\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 @let tdLeft = stickyLeft(column.key);\n <td [class.text-end]=\"column.align === 'right'\" [class.text-center]=\"column.align === 'center'\"\n [class.td-actions]=\"column.type === 'actions'\"\n [class.is-sticky]=\"tdLeft !== null\" [class.is-sticky-last]=\"isLastSticky(column.key)\" [style.left.px]=\"tdLeft\"\n [class]=\"cellClassOf(row, column)\" [style.min-width]=\"column.minWidth\" [style.max-width]=\"column.maxWidth\"\n [class.text-nowrap]=\"column.nowrap\" [class.text-truncate]=\"column.nowrap && column.maxWidth\">\n @switch (column.type) {\n @case ('link') {\n @let link = cellLink(row, column);\n <!-- `link` declare : vraie navigation (<a>). Sinon action (<button> + cellClick). -->\n @if (link !== undefined) {\n <a class=\"btn btn-link-like\" [routerLink]=\"link\">\n {{ column.translate ? (row[column.key] | translate) : row[column.key] }}\n </a>\n } @else {\n <button type=\"button\" class=\"btn btn-link-like\" (click)=\"onCellClick(row, column)\">\n {{ column.translate ? (row[column.key] | translate) : row[column.key] }}\n </button>\n }\n }\n @case ('badge') {\n <cw-badge\n [type]=\"getBadge(column, row[column.key]).type\"\n [label]=\"getBadge(column, row[column.key]).label ?? row[column.key]\"\n [withIcon]=\"getBadge(column, row[column.key]).withIcon\"\n [iconPosition]=\"getBadge(column, row[column.key]).iconPosition\"></cw-badge>\n }\n @case ('icon') {\n @let link = cellLink(row, column);\n @if (link !== undefined) {\n <a class=\"btn btn-link-like\" [routerLink]=\"link\" [attr.aria-label]=\"row[column.key].label\">\n <cw-icon\n [icon]=\"row[column.key].icon\"\n [label]=\"row[column.key].label\"\n [type]=\"iconType.default\"\n [iconSize]=\"iconSize['md']\"\n [iconCssClass]=\"row[column.key].iconCssClass\"\n ></cw-icon>\n </a>\n } @else if (isClickable(column)) {\n <button type=\"button\" class=\"btn btn-link-like\" (click)=\"onCellClick(row, column)\" [attr.aria-label]=\"row[column.key].label\">\n <cw-icon\n [icon]=\"row[column.key].icon\"\n [label]=\"row[column.key].label\"\n [type]=\"iconType.default\"\n [iconSize]=\"iconSize['md']\"\n [iconCssClass]=\"row[column.key].iconCssClass\"\n ></cw-icon>\n </button>\n } @else {\n <cw-icon\n [icon]=\"row[column.key].icon\"\n [label]=\"row[column.key].label\"\n [type]=\"iconType.default\"\n [iconSize]=\"iconSize['md']\"\n [iconCssClass]=\"row[column.key].iconCssClass\"\n ></cw-icon>\n }\n }\n @case ('image') {\n @let link = cellLink(row, column);\n @if (link !== undefined) {\n <a class=\"btn btn-link-like\" [routerLink]=\"link\" [attr.aria-label]=\"row[column.key].label\">\n <cw-image\n [source]=\"row[column.key].source\"\n [alt]=\"row[column.key].label\"\n [isAriaHidden]=\"true\"\n [cssClass]=\"row[column.key].iconCssClass\"\n width=\"32\"\n height=\"32\"\n ></cw-image>\n </a>\n } @else if (isClickable(column)) {\n <button type=\"button\" class=\"btn btn-link-like\" (click)=\"onCellClick(row, column)\" [attr.aria-label]=\"row[column.key].label\">\n <cw-image\n [source]=\"row[column.key].source\"\n [alt]=\"row[column.key].label\"\n [isAriaHidden]=\"true\"\n [cssClass]=\"row[column.key].iconCssClass\"\n width=\"32\"\n height=\"32\"\n ></cw-image>\n </button>\n } @else {\n <cw-image\n [source]=\"row[column.key].source\"\n [alt]=\"row[column.key].label\"\n [isAriaHidden]=\"true\"\n [cssClass]=\"row[column.key].iconCssClass\"\n width=\"32\"\n height=\"32\"\n ></cw-image>\n }\n }\n @case ('check') {\n @if (isTruthy(row[column.key])) {\n <cw-icon\n [icon]=\"spriteIcon.checkCircle\"\n [label]=\"'_COMMON._PRO_SENTENCE.YES' | translate\"\n [type]=\"iconType.default\"\n iconCssClass=\"text-success\"\n [iconSize]=\"iconSize['md']\"></cw-icon>\n } @else {\n <cw-icon\n [icon]=\"spriteIcon.closeCircle\"\n [label]=\"'_COMMON._PRO_SENTENCE.NO' | translate\"\n [type]=\"iconType.default\"\n iconCssClass=\"text-danger\"\n [iconSize]=\"iconSize['md']\"></cw-icon>\n }\n }\n @case ('progressbar') {\n <div class=\"td-progressbar\">\n <cw-progress-bar\n [value]=\"row[column.key]\"\n [size]=\"progressBarSize.sm\"\n [type]=\"progressBarType.information\"></cw-progress-bar>\n <span class=\"td-progressbar-value\">{{ row[column.key] }}%</span>\n </div>\n }\n @case ('actions') {\n @if (usingRowActions) {\n @let actions = getResolvedActions(row);\n @if (actions.length > 0) {\n @if (!useDropdownActions()) {\n @for (action of actions; track $index) {\n <cw-button\n [type]=\"buttonType.ghost\"\n [label]=\"action.label\"\n [withIcon]=\"action.icon\"\n [link]=\"action.link\"\n [isDisabled]=\"action.disabled\"\n [cssClass]=\"actionCssClass(action)\"\n (btnAction)=\"onRowActionClick(action, row)\">\n </cw-button>\n }\n } @else {\n <cw-button\n [label]=\"'_COMMON._TABLE.ACTIONS_MENU'\"\n [withIcon]=\"spriteIcon.menuVertical\"\n [withOnlyIcon]=\"true\"\n [type]=\"buttonType.ghost\"\n [isDropdown]=\"true\"\n [hideCaret]=\"true\">\n <ul class=\"p-0 m-0\">\n @for (action of actions; track $index) {\n <li>\n @if (action.link) {\n <cw-button\n [type]=\"buttonType.ghost\"\n [label]=\"action.label\"\n [withIcon]=\"action.icon\"\n [link]=\"action.link\"\n [isDisabled]=\"action.disabled\"\n [cssClass]=\"'dropdown-item ' + actionCssClass(action)\">\n </cw-button>\n } @else {\n <cw-button\n [type]=\"buttonType.ghost\"\n [label]=\"action.label\"\n [withIcon]=\"action.icon\"\n [isDisabled]=\"action.disabled\"\n [cssClass]=\"'dropdown-item ' + actionCssClass(action)\"\n (btnAction)=\"onRowActionClick(action, row)\">\n </cw-button>\n }\n </li>\n }\n </ul>\n </cw-button>\n }\n }\n } @else {\n <ng-container\n *ngTemplateOutlet=\"actionsTemplate(); context: { $implicit: row }\">\n </ng-container>\n }\n }\n @default {\n {{ column.translate ? (row[column.key] | translate) : row[column.key] }}\n }\n }\n </td>\n }\n }\n </tr>\n }\n }\n </tbody>\n </table>\n</div>\n</div>\n\n<!-- Barre de defilement collee en bas de la fenetre tant que la table est a l'ecran, puis posee sous\n la table : remplace la barre native (masquee), qui n'est visible qu'au bas de la table. Doublon\n du defilement du conteneur (deja accessible au clavier) : masquee aux technologies d'assistance. -->\n@if (overflowing()) {\n <div #scrollbarProxy class=\"table-scrollbar\" aria-hidden=\"true\" tabindex=\"-1\" (scroll)=\"onProxyScroll()\">\n <div class=\"table-scrollbar-track\" [style.width.px]=\"scrollWidth()\"></div>\n </div>\n}\n\n@if (pagination()) {\n <cw-pagination\n [pagination]=\"pagination()!\"\n (paginationChange)=\"paginationChange.emit($event)\">\n </cw-pagination>\n}\n", dependencies: [{ kind: "directive", type: RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "ngmodule", type: TranslateModule }, { kind: "component", type: LoaderComponent, selector: "cw-loader", inputs: ["size", "displayText"] }, { kind: "component", type: BadgeComponent, selector: "cw-badge", inputs: ["type", "label", "labelParams", "withIcon", "iconPosition", "cssClass", "skeletonMode", "dataTest"] }, { kind: "component", type: ButtonComponent, selector: "cw-button", inputs: ["type", "label", "labelParams", "id", "link", "isDropdown", "hideCaret", "withIcon", "withOnlyIcon", "iconSize", "iconPosition", "dropdownPosition", "isMinWidth", "isDisabled", "isLoading", "loadingAnnounce", "cssClass", "dataTest", "skeletonMode", "isPressed", "ariaDescribedBy", "ariaLabel", "ariaExpanded", "ariaControls", "withTooltip", "tooltipText", "tooltipTitle", "tooltipTrigger", "tooltipPosition", "tooltipType"], outputs: ["btnAction", "dropDownClicked"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: PaginationComponent, selector: "cw-pagination", inputs: ["pagination"], outputs: ["paginationChange"] }, { kind: "component", type: IconComponent, selector: "cw-icon", inputs: ["icon", "text", "label", "type", "iconSize", "iconCssClass", "iconUiType", "iconColorCustom", "spritePath"] }, { kind: "component", type: ImageComponent, selector: "cw-image", inputs: ["source", "alt", "isAriaHidden", "cssClass", "width", "height"] }, { kind: "component", type: EmptyStateComponent, selector: "cw-empty-state", inputs: ["illustration", "illustrationBasePath", "imageSource", "imageAlt", "title", "titleParams", "titleSuffix", "description", "descriptionParams", "primaryButton", "secondaryButton", "dataTest"], outputs: ["primaryClick", "secondaryClick"] }, { kind: "component", type: ProgressBarComponent, selector: "cw-progress-bar", inputs: ["value", "max", "size", "type", "showValue", "label", "dataTest"] }, { kind: "pipe", type: i1.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
1093
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.20", type: TableComponent, isStandalone: true, selector: "cw-table", inputs: { checkbox: { classPropertyName: "checkbox", publicName: "checkbox", isSignal: true, isRequired: false, transformFunction: null }, title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: true, transformFunction: null }, columns: { classPropertyName: "columns", publicName: "columns", isSignal: true, isRequired: false, transformFunction: null }, data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: false, transformFunction: null }, loading: { classPropertyName: "loading", publicName: "loading", isSignal: true, isRequired: false, transformFunction: null }, rowClassFn: { classPropertyName: "rowClassFn", publicName: "rowClassFn", isSignal: true, isRequired: false, transformFunction: null }, pagination: { classPropertyName: "pagination", publicName: "pagination", isSignal: true, isRequired: false, transformFunction: null }, bulkActions: { classPropertyName: "bulkActions", publicName: "bulkActions", isSignal: true, isRequired: false, transformFunction: null }, rowActions: { classPropertyName: "rowActions", publicName: "rowActions", isSignal: true, isRequired: false, transformFunction: null }, emptyStateNoData: { classPropertyName: "emptyStateNoData", publicName: "emptyStateNoData", isSignal: true, isRequired: false, transformFunction: null }, emptyStateNoResult: { classPropertyName: "emptyStateNoResult", publicName: "emptyStateNoResult", isSignal: true, isRequired: false, transformFunction: null }, isFiltered: { classPropertyName: "isFiltered", publicName: "isFiltered", isSignal: true, isRequired: false, transformFunction: null }, showScope: { classPropertyName: "showScope", publicName: "showScope", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { cellClick: "cellClick", sortChange: "sortChange", selectionChange: "selectionChange", paginationChange: "paginationChange", bulkDelete: "bulkDelete", bulkAction: "bulkAction" }, host: { classAttribute: "cw-table" }, queries: [{ propertyName: "actionsTemplate", first: true, predicate: ["actionsTemplate"], descendants: true, isSignal: true }], viewQueries: [{ propertyName: "scroller", first: true, predicate: ["scroller"], descendants: true, isSignal: true }, { propertyName: "scrollbarProxy", first: true, predicate: ["scrollbarProxy"], descendants: true, isSignal: true }], ngImport: i0, template: "@if (checkbox() && selectionCount() > 0) {\n <!-- Espacement DS : gap-md = 16px = component/button/set/gap (espacement entre\n boutons d'un set). Utilitaires basic-ui (adosses a l'echelle $sizing des\n tokens) et non ceux de Bootstrap : gap-2 valait 8px. d-flex-h centre deja\n verticalement, align-items-center est donc inutile. -->\n <div class=\"table-selection-info mb-md d-flex-h gap-md flex-wrap\">\n <span class=\"flex-grow-1\">\n {{ selectionCount() }} {{ '_COMMON._TABLE._BULK_ACTION.SELECTED_ITEMS_CURRENT_PAGE' | translate }}\n </span>\n @for (action of bulkActions(); track $index) {\n <cw-button\n [type]=\"resolveVariant(action)\"\n [label]=\"action.label\"\n [withIcon]=\"action.icon\"\n [isDisabled]=\"resolveDisabled(action)\"\n (btnAction)=\"onBulkActionClick(action)\">\n </cw-button>\n }\n </div>\n}\n\n<!-- Defilement horizontal : ombres de bord sur le wrapper, conteneur focusable (clavier) et nomme\n par la legende des qu'il deborde. -->\n<div class=\"table-scroll p-relative\" [class.can-scroll-left]=\"canScrollLeft()\" [class.can-scroll-right]=\"canScrollRight()\"\n [style.--cw-table-sticky-width]=\"stickyWidth() + 'px'\">\n<div #scroller class=\"table-responsive\" [class.is-overflowing]=\"overflowing()\" (scroll)=\"onScroll()\"\n [attr.tabindex]=\"overflowing() ? 0 : null\" [attr.role]=\"overflowing() ? 'region' : null\"\n [attr.aria-labelledby]=\"overflowing() ? uid + '-caption' : null\">\n <table class=\"table\">\n <caption class=\"visually-hidden\" [id]=\"uid + '-caption'\">{{ title() | translate }}</caption>\n <thead>\n <tr>\n @if(checkbox()) {\n <th scope=\"col\" width=\"10\" class=\"table-check\" [class.is-sticky]=\"checkboxSticky()\"\n [style.left.px]=\"checkboxSticky() ? 0 : null\">\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 @let thLeft = stickyLeft(column.key);\n <th scope=\"col\" [class.p-0]=\"column.sort\" [attr.aria-sort]=\"column.sort ? getAriaSort(column.key) : null\"\n [class.is-sticky]=\"thLeft !== null\" [class.is-sticky-last]=\"isLastSticky(column.key)\" [style.left.px]=\"thLeft\"\n [style.min-width]=\"column.minWidth\" [style.max-width]=\"column.maxWidth\">\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 class=\"table-check\" [class.is-sticky]=\"checkboxSticky()\"\n [style.left.px]=\"checkboxSticky() ? 0 : null\">\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 @let tdLeft = stickyLeft(column.key);\n <td [class.text-end]=\"column.align === 'right'\" [class.text-center]=\"column.align === 'center'\"\n [class.td-actions]=\"column.type === 'actions'\"\n [class.is-sticky]=\"tdLeft !== null\" [class.is-sticky-last]=\"isLastSticky(column.key)\" [style.left.px]=\"tdLeft\"\n [class]=\"cellClassOf(row, column)\" [style.min-width]=\"column.minWidth\" [style.max-width]=\"column.maxWidth\"\n [class.text-nowrap]=\"column.nowrap\" [class.text-truncate]=\"column.nowrap && column.maxWidth\">\n @switch (column.type) {\n @case ('link') {\n @let link = cellLink(row, column);\n <!-- `link` declare : vraie navigation (<a>). Sinon action (<button> + cellClick). -->\n @if (link !== undefined) {\n <a class=\"btn btn-link-like\" [routerLink]=\"link\">\n {{ column.translate ? (row[column.key] | translate) : row[column.key] }}\n </a>\n } @else {\n <button type=\"button\" class=\"btn btn-link-like\" (click)=\"onCellClick(row, column)\">\n {{ column.translate ? (row[column.key] | translate) : row[column.key] }}\n </button>\n }\n <!-- Seconde ligne hors du lien : nom accessible du lien limite a la valeur. -->\n @let linkSecondary = cellSecondary(row, column);\n @if (linkSecondary) {\n <span class=\"td-secondary\">{{ linkSecondary }}</span>\n }\n }\n @case ('badge') {\n <cw-badge\n [type]=\"getBadge(column, row[column.key]).type\"\n [label]=\"getBadge(column, row[column.key]).label ?? row[column.key]\"\n [withIcon]=\"getBadge(column, row[column.key]).withIcon\"\n [iconPosition]=\"getBadge(column, row[column.key]).iconPosition\"></cw-badge>\n }\n @case ('icon') {\n @let link = cellLink(row, column);\n @if (link !== undefined) {\n <a class=\"btn btn-link-like\" [routerLink]=\"link\" [attr.aria-label]=\"row[column.key].label\">\n <cw-icon\n [icon]=\"row[column.key].icon\"\n [label]=\"row[column.key].label\"\n [type]=\"iconType.default\"\n [iconSize]=\"iconSize['md']\"\n [iconCssClass]=\"row[column.key].iconCssClass\"\n ></cw-icon>\n </a>\n } @else if (isClickable(column)) {\n <button type=\"button\" class=\"btn btn-link-like\" (click)=\"onCellClick(row, column)\" [attr.aria-label]=\"row[column.key].label\">\n <cw-icon\n [icon]=\"row[column.key].icon\"\n [label]=\"row[column.key].label\"\n [type]=\"iconType.default\"\n [iconSize]=\"iconSize['md']\"\n [iconCssClass]=\"row[column.key].iconCssClass\"\n ></cw-icon>\n </button>\n } @else {\n <cw-icon\n [icon]=\"row[column.key].icon\"\n [label]=\"row[column.key].label\"\n [type]=\"iconType.default\"\n [iconSize]=\"iconSize['md']\"\n [iconCssClass]=\"row[column.key].iconCssClass\"\n ></cw-icon>\n }\n }\n @case ('image') {\n @let link = cellLink(row, column);\n @if (link !== undefined) {\n <a class=\"btn btn-link-like\" [routerLink]=\"link\" [attr.aria-label]=\"row[column.key].label\">\n <cw-image\n [source]=\"row[column.key].source\"\n [alt]=\"row[column.key].label\"\n [isAriaHidden]=\"true\"\n [cssClass]=\"row[column.key].iconCssClass\"\n width=\"32\"\n height=\"32\"\n ></cw-image>\n </a>\n } @else if (isClickable(column)) {\n <button type=\"button\" class=\"btn btn-link-like\" (click)=\"onCellClick(row, column)\" [attr.aria-label]=\"row[column.key].label\">\n <cw-image\n [source]=\"row[column.key].source\"\n [alt]=\"row[column.key].label\"\n [isAriaHidden]=\"true\"\n [cssClass]=\"row[column.key].iconCssClass\"\n width=\"32\"\n height=\"32\"\n ></cw-image>\n </button>\n } @else {\n <cw-image\n [source]=\"row[column.key].source\"\n [alt]=\"row[column.key].label\"\n [isAriaHidden]=\"true\"\n [cssClass]=\"row[column.key].iconCssClass\"\n width=\"32\"\n height=\"32\"\n ></cw-image>\n }\n }\n @case ('check') {\n @if (isTruthy(row[column.key])) {\n <cw-icon\n [icon]=\"spriteIcon.checkCircle\"\n [label]=\"'_COMMON._PRO_SENTENCE.YES' | translate\"\n [type]=\"iconType.default\"\n iconCssClass=\"text-success\"\n [iconSize]=\"iconSize['md']\"></cw-icon>\n } @else {\n <cw-icon\n [icon]=\"spriteIcon.closeCircle\"\n [label]=\"'_COMMON._PRO_SENTENCE.NO' | translate\"\n [type]=\"iconType.default\"\n iconCssClass=\"text-danger\"\n [iconSize]=\"iconSize['md']\"></cw-icon>\n }\n }\n @case ('progressbar') {\n <div class=\"td-progressbar\">\n <cw-progress-bar\n [value]=\"row[column.key]\"\n [size]=\"progressBarSize.sm\"\n [type]=\"progressBarType.information\"></cw-progress-bar>\n <span class=\"td-progressbar-value\">{{ row[column.key] }}%</span>\n </div>\n }\n @case ('actions') {\n @if (usingRowActions) {\n @let actions = getResolvedActions(row);\n @if (actions.length > 0) {\n @if (!useDropdownActions()) {\n @for (action of actions; track $index) {\n <cw-button\n [type]=\"buttonType.ghost\"\n [label]=\"action.label\"\n [withIcon]=\"action.icon\"\n [link]=\"action.link\"\n [isDisabled]=\"action.disabled\"\n [cssClass]=\"actionCssClass(action)\"\n (btnAction)=\"onRowActionClick(action, row)\">\n </cw-button>\n }\n } @else {\n <cw-button\n [label]=\"'_COMMON._TABLE.ACTIONS_MENU'\"\n [withIcon]=\"spriteIcon.menuVertical\"\n [withOnlyIcon]=\"true\"\n [type]=\"buttonType.ghost\"\n [isDropdown]=\"true\"\n [hideCaret]=\"true\">\n <ul class=\"p-0 m-0\">\n @for (action of actions; track $index) {\n <li>\n @if (action.link) {\n <cw-button\n [type]=\"buttonType.ghost\"\n [label]=\"action.label\"\n [withIcon]=\"action.icon\"\n [link]=\"action.link\"\n [isDisabled]=\"action.disabled\"\n [cssClass]=\"'dropdown-item ' + actionCssClass(action)\">\n </cw-button>\n } @else {\n <cw-button\n [type]=\"buttonType.ghost\"\n [label]=\"action.label\"\n [withIcon]=\"action.icon\"\n [isDisabled]=\"action.disabled\"\n [cssClass]=\"'dropdown-item ' + actionCssClass(action)\"\n (btnAction)=\"onRowActionClick(action, row)\">\n </cw-button>\n }\n </li>\n }\n </ul>\n </cw-button>\n }\n }\n } @else {\n <ng-container\n *ngTemplateOutlet=\"actionsTemplate(); context: { $implicit: row }\">\n </ng-container>\n }\n }\n @default {\n @let secondary = cellSecondary(row, column);\n @if (secondary) {\n <span class=\"td-main\">{{ column.translate ? (row[column.key] | translate) : row[column.key] }}</span>\n <span class=\"td-secondary\">{{ secondary }}</span>\n } @else {\n {{ column.translate ? (row[column.key] | translate) : row[column.key] }}\n }\n }\n }\n </td>\n }\n }\n </tr>\n }\n }\n </tbody>\n </table>\n</div>\n</div>\n\n<!-- Barre de defilement collee en bas de la fenetre tant que la table est a l'ecran, puis posee sous\n la table : remplace la barre native (masquee), qui n'est visible qu'au bas de la table. Doublon\n du defilement du conteneur (deja accessible au clavier) : masquee aux technologies d'assistance. -->\n@if (overflowing()) {\n <div #scrollbarProxy class=\"table-scrollbar\" aria-hidden=\"true\" tabindex=\"-1\" (scroll)=\"onProxyScroll()\">\n <div class=\"table-scrollbar-track\" [style.width.px]=\"scrollWidth()\"></div>\n </div>\n}\n\n@if (pagination()) {\n <cw-pagination\n [pagination]=\"pagination()!\"\n (paginationChange)=\"paginationChange.emit($event)\">\n </cw-pagination>\n}\n", dependencies: [{ kind: "directive", type: RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "ngmodule", type: TranslateModule }, { kind: "component", type: LoaderComponent, selector: "cw-loader", inputs: ["size", "displayText"] }, { kind: "component", type: BadgeComponent, selector: "cw-badge", inputs: ["type", "label", "labelParams", "withIcon", "iconPosition", "cssClass", "skeletonMode", "dataTest"] }, { kind: "component", type: ButtonComponent, selector: "cw-button", inputs: ["type", "label", "labelParams", "id", "link", "isDropdown", "hideCaret", "withIcon", "withOnlyIcon", "iconSize", "iconPosition", "dropdownPosition", "isMinWidth", "isDisabled", "isLoading", "loadingAnnounce", "cssClass", "dataTest", "skeletonMode", "isPressed", "ariaDescribedBy", "ariaLabel", "ariaExpanded", "ariaControls", "withTooltip", "tooltipText", "tooltipTitle", "tooltipTrigger", "tooltipPosition", "tooltipType"], outputs: ["btnAction", "dropDownClicked"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: PaginationComponent, selector: "cw-pagination", inputs: ["pagination"], outputs: ["paginationChange"] }, { kind: "component", type: IconComponent, selector: "cw-icon", inputs: ["icon", "text", "label", "type", "iconSize", "iconCssClass", "iconUiType", "iconColorCustom", "spritePath"] }, { kind: "component", type: ImageComponent, selector: "cw-image", inputs: ["source", "alt", "isAriaHidden", "cssClass", "width", "height"] }, { kind: "component", type: EmptyStateComponent, selector: "cw-empty-state", inputs: ["illustration", "illustrationBasePath", "imageSource", "imageAlt", "title", "titleParams", "titleSuffix", "description", "descriptionParams", "primaryButton", "secondaryButton", "dataTest"], outputs: ["primaryClick", "secondaryClick"] }, { kind: "component", type: ProgressBarComponent, selector: "cw-progress-bar", inputs: ["value", "max", "size", "type", "showValue", "label", "dataTest"] }, { kind: "pipe", type: i1.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
1088
1094
|
}
|
|
1089
1095
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: TableComponent, decorators: [{
|
|
1090
1096
|
type: Component,
|
|
@@ -1100,7 +1106,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.20", ngImpo
|
|
|
1100
1106
|
ImageComponent,
|
|
1101
1107
|
EmptyStateComponent,
|
|
1102
1108
|
ProgressBarComponent
|
|
1103
|
-
], 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<!-- Defilement horizontal : ombres de bord sur le wrapper, conteneur focusable (clavier) et nomme\n par la legende des qu'il deborde. -->\n<div class=\"table-scroll p-relative\" [class.can-scroll-left]=\"canScrollLeft()\" [class.can-scroll-right]=\"canScrollRight()\"\n [style.--cw-table-sticky-width]=\"stickyWidth() + 'px'\">\n<div #scroller class=\"table-responsive\" [class.is-overflowing]=\"overflowing()\" (scroll)=\"onScroll()\"\n [attr.tabindex]=\"overflowing() ? 0 : null\" [attr.role]=\"overflowing() ? 'region' : null\"\n [attr.aria-labelledby]=\"overflowing() ? uid + '-caption' : null\">\n <table class=\"table\">\n <caption class=\"visually-hidden\" [id]=\"uid + '-caption'\">{{ title() | translate }}</caption>\n <thead>\n <tr>\n @if(checkbox()) {\n <th scope=\"col\" width=\"10\" class=\"table-check\" [class.is-sticky]=\"checkboxSticky()\"\n [style.left.px]=\"checkboxSticky() ? 0 : null\">\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 @let thLeft = stickyLeft(column.key);\n <th scope=\"col\" [class.p-0]=\"column.sort\" [attr.aria-sort]=\"column.sort ? getAriaSort(column.key) : null\"\n [class.is-sticky]=\"thLeft !== null\" [class.is-sticky-last]=\"isLastSticky(column.key)\" [style.left.px]=\"thLeft\"\n [style.min-width]=\"column.minWidth\" [style.max-width]=\"column.maxWidth\">\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 class=\"table-check\" [class.is-sticky]=\"checkboxSticky()\"\n [style.left.px]=\"checkboxSticky() ? 0 : null\">\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 @let tdLeft = stickyLeft(column.key);\n <td [class.text-end]=\"column.align === 'right'\" [class.text-center]=\"column.align === 'center'\"\n [class.td-actions]=\"column.type === 'actions'\"\n [class.is-sticky]=\"tdLeft !== null\" [class.is-sticky-last]=\"isLastSticky(column.key)\" [style.left.px]=\"tdLeft\"\n [class]=\"cellClassOf(row, column)\" [style.min-width]=\"column.minWidth\" [style.max-width]=\"column.maxWidth\"\n [class.text-nowrap]=\"column.nowrap\" [class.text-truncate]=\"column.nowrap && column.maxWidth\">\n @switch (column.type) {\n @case ('link') {\n @let link = cellLink(row, column);\n <!-- `link` declare : vraie navigation (<a>). Sinon action (<button> + cellClick). -->\n @if (link !== undefined) {\n <a class=\"btn btn-link-like\" [routerLink]=\"link\">\n {{ column.translate ? (row[column.key] | translate) : row[column.key] }}\n </a>\n } @else {\n <button type=\"button\" class=\"btn btn-link-like\" (click)=\"onCellClick(row, column)\">\n {{ column.translate ? (row[column.key] | translate) : row[column.key] }}\n </button>\n }\n }\n @case ('badge') {\n <cw-badge\n [type]=\"getBadge(column, row[column.key]).type\"\n [label]=\"getBadge(column, row[column.key]).label ?? row[column.key]\"\n [withIcon]=\"getBadge(column, row[column.key]).withIcon\"\n [iconPosition]=\"getBadge(column, row[column.key]).iconPosition\"></cw-badge>\n }\n @case ('icon') {\n @let link = cellLink(row, column);\n @if (link !== undefined) {\n <a class=\"btn btn-link-like\" [routerLink]=\"link\" [attr.aria-label]=\"row[column.key].label\">\n <cw-icon\n [icon]=\"row[column.key].icon\"\n [label]=\"row[column.key].label\"\n [type]=\"iconType.default\"\n [iconSize]=\"iconSize['md']\"\n [iconCssClass]=\"row[column.key].iconCssClass\"\n ></cw-icon>\n </a>\n } @else if (isClickable(column)) {\n <button type=\"button\" class=\"btn btn-link-like\" (click)=\"onCellClick(row, column)\" [attr.aria-label]=\"row[column.key].label\">\n <cw-icon\n [icon]=\"row[column.key].icon\"\n [label]=\"row[column.key].label\"\n [type]=\"iconType.default\"\n [iconSize]=\"iconSize['md']\"\n [iconCssClass]=\"row[column.key].iconCssClass\"\n ></cw-icon>\n </button>\n } @else {\n <cw-icon\n [icon]=\"row[column.key].icon\"\n [label]=\"row[column.key].label\"\n [type]=\"iconType.default\"\n [iconSize]=\"iconSize['md']\"\n [iconCssClass]=\"row[column.key].iconCssClass\"\n ></cw-icon>\n }\n }\n @case ('image') {\n @let link = cellLink(row, column);\n @if (link !== undefined) {\n <a class=\"btn btn-link-like\" [routerLink]=\"link\" [attr.aria-label]=\"row[column.key].label\">\n <cw-image\n [source]=\"row[column.key].source\"\n [alt]=\"row[column.key].label\"\n [isAriaHidden]=\"true\"\n [cssClass]=\"row[column.key].iconCssClass\"\n width=\"32\"\n height=\"32\"\n ></cw-image>\n </a>\n } @else if (isClickable(column)) {\n <button type=\"button\" class=\"btn btn-link-like\" (click)=\"onCellClick(row, column)\" [attr.aria-label]=\"row[column.key].label\">\n <cw-image\n [source]=\"row[column.key].source\"\n [alt]=\"row[column.key].label\"\n [isAriaHidden]=\"true\"\n [cssClass]=\"row[column.key].iconCssClass\"\n width=\"32\"\n height=\"32\"\n ></cw-image>\n </button>\n } @else {\n <cw-image\n [source]=\"row[column.key].source\"\n [alt]=\"row[column.key].label\"\n [isAriaHidden]=\"true\"\n [cssClass]=\"row[column.key].iconCssClass\"\n width=\"32\"\n height=\"32\"\n ></cw-image>\n }\n }\n @case ('check') {\n @if (isTruthy(row[column.key])) {\n <cw-icon\n [icon]=\"spriteIcon.checkCircle\"\n [label]=\"'_COMMON._PRO_SENTENCE.YES' | translate\"\n [type]=\"iconType.default\"\n iconCssClass=\"text-success\"\n [iconSize]=\"iconSize['md']\"></cw-icon>\n } @else {\n <cw-icon\n [icon]=\"spriteIcon.closeCircle\"\n [label]=\"'_COMMON._PRO_SENTENCE.NO' | translate\"\n [type]=\"iconType.default\"\n iconCssClass=\"text-danger\"\n [iconSize]=\"iconSize['md']\"></cw-icon>\n }\n }\n @case ('progressbar') {\n <div class=\"td-progressbar\">\n <cw-progress-bar\n [value]=\"row[column.key]\"\n [size]=\"progressBarSize.sm\"\n [type]=\"progressBarType.information\"></cw-progress-bar>\n <span class=\"td-progressbar-value\">{{ row[column.key] }}%</span>\n </div>\n }\n @case ('actions') {\n @if (usingRowActions) {\n @let actions = getResolvedActions(row);\n @if (actions.length > 0) {\n @if (!useDropdownActions()) {\n @for (action of actions; track $index) {\n <cw-button\n [type]=\"buttonType.ghost\"\n [label]=\"action.label\"\n [withIcon]=\"action.icon\"\n [link]=\"action.link\"\n [isDisabled]=\"action.disabled\"\n [cssClass]=\"actionCssClass(action)\"\n (btnAction)=\"onRowActionClick(action, row)\">\n </cw-button>\n }\n } @else {\n <cw-button\n [label]=\"'_COMMON._TABLE.ACTIONS_MENU'\"\n [withIcon]=\"spriteIcon.menuVertical\"\n [withOnlyIcon]=\"true\"\n [type]=\"buttonType.ghost\"\n [isDropdown]=\"true\"\n [hideCaret]=\"true\">\n <ul class=\"p-0 m-0\">\n @for (action of actions; track $index) {\n <li>\n @if (action.link) {\n <cw-button\n [type]=\"buttonType.ghost\"\n [label]=\"action.label\"\n [withIcon]=\"action.icon\"\n [link]=\"action.link\"\n [isDisabled]=\"action.disabled\"\n [cssClass]=\"'dropdown-item ' + actionCssClass(action)\">\n </cw-button>\n } @else {\n <cw-button\n [type]=\"buttonType.ghost\"\n [label]=\"action.label\"\n [withIcon]=\"action.icon\"\n [isDisabled]=\"action.disabled\"\n [cssClass]=\"'dropdown-item ' + actionCssClass(action)\"\n (btnAction)=\"onRowActionClick(action, row)\">\n </cw-button>\n }\n </li>\n }\n </ul>\n </cw-button>\n }\n }\n } @else {\n <ng-container\n *ngTemplateOutlet=\"actionsTemplate(); context: { $implicit: row }\">\n </ng-container>\n }\n }\n @default {\n {{ column.translate ? (row[column.key] | translate) : row[column.key] }}\n }\n }\n </td>\n }\n }\n </tr>\n }\n }\n </tbody>\n </table>\n</div>\n</div>\n\n<!-- Barre de defilement collee en bas de la fenetre tant que la table est a l'ecran, puis posee sous\n la table : remplace la barre native (masquee), qui n'est visible qu'au bas de la table. Doublon\n du defilement du conteneur (deja accessible au clavier) : masquee aux technologies d'assistance. -->\n@if (overflowing()) {\n <div #scrollbarProxy class=\"table-scrollbar\" aria-hidden=\"true\" tabindex=\"-1\" (scroll)=\"onProxyScroll()\">\n <div class=\"table-scrollbar-track\" [style.width.px]=\"scrollWidth()\"></div>\n </div>\n}\n\n@if (pagination()) {\n <cw-pagination\n [pagination]=\"pagination()!\"\n (paginationChange)=\"paginationChange.emit($event)\">\n </cw-pagination>\n}\n" }]
|
|
1109
|
+
], 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<!-- Defilement horizontal : ombres de bord sur le wrapper, conteneur focusable (clavier) et nomme\n par la legende des qu'il deborde. -->\n<div class=\"table-scroll p-relative\" [class.can-scroll-left]=\"canScrollLeft()\" [class.can-scroll-right]=\"canScrollRight()\"\n [style.--cw-table-sticky-width]=\"stickyWidth() + 'px'\">\n<div #scroller class=\"table-responsive\" [class.is-overflowing]=\"overflowing()\" (scroll)=\"onScroll()\"\n [attr.tabindex]=\"overflowing() ? 0 : null\" [attr.role]=\"overflowing() ? 'region' : null\"\n [attr.aria-labelledby]=\"overflowing() ? uid + '-caption' : null\">\n <table class=\"table\">\n <caption class=\"visually-hidden\" [id]=\"uid + '-caption'\">{{ title() | translate }}</caption>\n <thead>\n <tr>\n @if(checkbox()) {\n <th scope=\"col\" width=\"10\" class=\"table-check\" [class.is-sticky]=\"checkboxSticky()\"\n [style.left.px]=\"checkboxSticky() ? 0 : null\">\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 @let thLeft = stickyLeft(column.key);\n <th scope=\"col\" [class.p-0]=\"column.sort\" [attr.aria-sort]=\"column.sort ? getAriaSort(column.key) : null\"\n [class.is-sticky]=\"thLeft !== null\" [class.is-sticky-last]=\"isLastSticky(column.key)\" [style.left.px]=\"thLeft\"\n [style.min-width]=\"column.minWidth\" [style.max-width]=\"column.maxWidth\">\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 class=\"table-check\" [class.is-sticky]=\"checkboxSticky()\"\n [style.left.px]=\"checkboxSticky() ? 0 : null\">\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 @let tdLeft = stickyLeft(column.key);\n <td [class.text-end]=\"column.align === 'right'\" [class.text-center]=\"column.align === 'center'\"\n [class.td-actions]=\"column.type === 'actions'\"\n [class.is-sticky]=\"tdLeft !== null\" [class.is-sticky-last]=\"isLastSticky(column.key)\" [style.left.px]=\"tdLeft\"\n [class]=\"cellClassOf(row, column)\" [style.min-width]=\"column.minWidth\" [style.max-width]=\"column.maxWidth\"\n [class.text-nowrap]=\"column.nowrap\" [class.text-truncate]=\"column.nowrap && column.maxWidth\">\n @switch (column.type) {\n @case ('link') {\n @let link = cellLink(row, column);\n <!-- `link` declare : vraie navigation (<a>). Sinon action (<button> + cellClick). -->\n @if (link !== undefined) {\n <a class=\"btn btn-link-like\" [routerLink]=\"link\">\n {{ column.translate ? (row[column.key] | translate) : row[column.key] }}\n </a>\n } @else {\n <button type=\"button\" class=\"btn btn-link-like\" (click)=\"onCellClick(row, column)\">\n {{ column.translate ? (row[column.key] | translate) : row[column.key] }}\n </button>\n }\n <!-- Seconde ligne hors du lien : nom accessible du lien limite a la valeur. -->\n @let linkSecondary = cellSecondary(row, column);\n @if (linkSecondary) {\n <span class=\"td-secondary\">{{ linkSecondary }}</span>\n }\n }\n @case ('badge') {\n <cw-badge\n [type]=\"getBadge(column, row[column.key]).type\"\n [label]=\"getBadge(column, row[column.key]).label ?? row[column.key]\"\n [withIcon]=\"getBadge(column, row[column.key]).withIcon\"\n [iconPosition]=\"getBadge(column, row[column.key]).iconPosition\"></cw-badge>\n }\n @case ('icon') {\n @let link = cellLink(row, column);\n @if (link !== undefined) {\n <a class=\"btn btn-link-like\" [routerLink]=\"link\" [attr.aria-label]=\"row[column.key].label\">\n <cw-icon\n [icon]=\"row[column.key].icon\"\n [label]=\"row[column.key].label\"\n [type]=\"iconType.default\"\n [iconSize]=\"iconSize['md']\"\n [iconCssClass]=\"row[column.key].iconCssClass\"\n ></cw-icon>\n </a>\n } @else if (isClickable(column)) {\n <button type=\"button\" class=\"btn btn-link-like\" (click)=\"onCellClick(row, column)\" [attr.aria-label]=\"row[column.key].label\">\n <cw-icon\n [icon]=\"row[column.key].icon\"\n [label]=\"row[column.key].label\"\n [type]=\"iconType.default\"\n [iconSize]=\"iconSize['md']\"\n [iconCssClass]=\"row[column.key].iconCssClass\"\n ></cw-icon>\n </button>\n } @else {\n <cw-icon\n [icon]=\"row[column.key].icon\"\n [label]=\"row[column.key].label\"\n [type]=\"iconType.default\"\n [iconSize]=\"iconSize['md']\"\n [iconCssClass]=\"row[column.key].iconCssClass\"\n ></cw-icon>\n }\n }\n @case ('image') {\n @let link = cellLink(row, column);\n @if (link !== undefined) {\n <a class=\"btn btn-link-like\" [routerLink]=\"link\" [attr.aria-label]=\"row[column.key].label\">\n <cw-image\n [source]=\"row[column.key].source\"\n [alt]=\"row[column.key].label\"\n [isAriaHidden]=\"true\"\n [cssClass]=\"row[column.key].iconCssClass\"\n width=\"32\"\n height=\"32\"\n ></cw-image>\n </a>\n } @else if (isClickable(column)) {\n <button type=\"button\" class=\"btn btn-link-like\" (click)=\"onCellClick(row, column)\" [attr.aria-label]=\"row[column.key].label\">\n <cw-image\n [source]=\"row[column.key].source\"\n [alt]=\"row[column.key].label\"\n [isAriaHidden]=\"true\"\n [cssClass]=\"row[column.key].iconCssClass\"\n width=\"32\"\n height=\"32\"\n ></cw-image>\n </button>\n } @else {\n <cw-image\n [source]=\"row[column.key].source\"\n [alt]=\"row[column.key].label\"\n [isAriaHidden]=\"true\"\n [cssClass]=\"row[column.key].iconCssClass\"\n width=\"32\"\n height=\"32\"\n ></cw-image>\n }\n }\n @case ('check') {\n @if (isTruthy(row[column.key])) {\n <cw-icon\n [icon]=\"spriteIcon.checkCircle\"\n [label]=\"'_COMMON._PRO_SENTENCE.YES' | translate\"\n [type]=\"iconType.default\"\n iconCssClass=\"text-success\"\n [iconSize]=\"iconSize['md']\"></cw-icon>\n } @else {\n <cw-icon\n [icon]=\"spriteIcon.closeCircle\"\n [label]=\"'_COMMON._PRO_SENTENCE.NO' | translate\"\n [type]=\"iconType.default\"\n iconCssClass=\"text-danger\"\n [iconSize]=\"iconSize['md']\"></cw-icon>\n }\n }\n @case ('progressbar') {\n <div class=\"td-progressbar\">\n <cw-progress-bar\n [value]=\"row[column.key]\"\n [size]=\"progressBarSize.sm\"\n [type]=\"progressBarType.information\"></cw-progress-bar>\n <span class=\"td-progressbar-value\">{{ row[column.key] }}%</span>\n </div>\n }\n @case ('actions') {\n @if (usingRowActions) {\n @let actions = getResolvedActions(row);\n @if (actions.length > 0) {\n @if (!useDropdownActions()) {\n @for (action of actions; track $index) {\n <cw-button\n [type]=\"buttonType.ghost\"\n [label]=\"action.label\"\n [withIcon]=\"action.icon\"\n [link]=\"action.link\"\n [isDisabled]=\"action.disabled\"\n [cssClass]=\"actionCssClass(action)\"\n (btnAction)=\"onRowActionClick(action, row)\">\n </cw-button>\n }\n } @else {\n <cw-button\n [label]=\"'_COMMON._TABLE.ACTIONS_MENU'\"\n [withIcon]=\"spriteIcon.menuVertical\"\n [withOnlyIcon]=\"true\"\n [type]=\"buttonType.ghost\"\n [isDropdown]=\"true\"\n [hideCaret]=\"true\">\n <ul class=\"p-0 m-0\">\n @for (action of actions; track $index) {\n <li>\n @if (action.link) {\n <cw-button\n [type]=\"buttonType.ghost\"\n [label]=\"action.label\"\n [withIcon]=\"action.icon\"\n [link]=\"action.link\"\n [isDisabled]=\"action.disabled\"\n [cssClass]=\"'dropdown-item ' + actionCssClass(action)\">\n </cw-button>\n } @else {\n <cw-button\n [type]=\"buttonType.ghost\"\n [label]=\"action.label\"\n [withIcon]=\"action.icon\"\n [isDisabled]=\"action.disabled\"\n [cssClass]=\"'dropdown-item ' + actionCssClass(action)\"\n (btnAction)=\"onRowActionClick(action, row)\">\n </cw-button>\n }\n </li>\n }\n </ul>\n </cw-button>\n }\n }\n } @else {\n <ng-container\n *ngTemplateOutlet=\"actionsTemplate(); context: { $implicit: row }\">\n </ng-container>\n }\n }\n @default {\n @let secondary = cellSecondary(row, column);\n @if (secondary) {\n <span class=\"td-main\">{{ column.translate ? (row[column.key] | translate) : row[column.key] }}</span>\n <span class=\"td-secondary\">{{ secondary }}</span>\n } @else {\n {{ column.translate ? (row[column.key] | translate) : row[column.key] }}\n }\n }\n }\n </td>\n }\n }\n </tr>\n }\n }\n </tbody>\n </table>\n</div>\n</div>\n\n<!-- Barre de defilement collee en bas de la fenetre tant que la table est a l'ecran, puis posee sous\n la table : remplace la barre native (masquee), qui n'est visible qu'au bas de la table. Doublon\n du defilement du conteneur (deja accessible au clavier) : masquee aux technologies d'assistance. -->\n@if (overflowing()) {\n <div #scrollbarProxy class=\"table-scrollbar\" aria-hidden=\"true\" tabindex=\"-1\" (scroll)=\"onProxyScroll()\">\n <div class=\"table-scrollbar-track\" [style.width.px]=\"scrollWidth()\"></div>\n </div>\n}\n\n@if (pagination()) {\n <cw-pagination\n [pagination]=\"pagination()!\"\n (paginationChange)=\"paginationChange.emit($event)\">\n </cw-pagination>\n}\n" }]
|
|
1104
1110
|
}], ctorParameters: () => [], propDecorators: { checkbox: [{ type: i0.Input, args: [{ isSignal: true, alias: "checkbox", required: false }] }], title: [{ type: i0.Input, args: [{ isSignal: true, alias: "title", required: true }] }], columns: [{ type: i0.Input, args: [{ isSignal: true, alias: "columns", required: false }] }], data: [{ type: i0.Input, args: [{ isSignal: true, alias: "data", required: false }] }], loading: [{ type: i0.Input, args: [{ isSignal: true, alias: "loading", required: false }] }], rowClassFn: [{ type: i0.Input, args: [{ isSignal: true, alias: "rowClassFn", required: false }] }], pagination: [{ type: i0.Input, args: [{ isSignal: true, alias: "pagination", required: false }] }], bulkActions: [{ type: i0.Input, args: [{ isSignal: true, alias: "bulkActions", required: false }] }], rowActions: [{ type: i0.Input, args: [{ isSignal: true, alias: "rowActions", required: false }] }], emptyStateNoData: [{ type: i0.Input, args: [{ isSignal: true, alias: "emptyStateNoData", required: false }] }], emptyStateNoResult: [{ type: i0.Input, args: [{ isSignal: true, alias: "emptyStateNoResult", required: false }] }], isFiltered: [{ type: i0.Input, args: [{ isSignal: true, alias: "isFiltered", required: false }] }], showScope: [{ type: i0.Input, args: [{ isSignal: true, alias: "showScope", required: false }] }], cellClick: [{ type: i0.Output, args: ["cellClick"] }], sortChange: [{ type: i0.Output, args: ["sortChange"] }], selectionChange: [{ type: i0.Output, args: ["selectionChange"] }], paginationChange: [{ type: i0.Output, args: ["paginationChange"] }], bulkDelete: [{ type: i0.Output, args: ["bulkDelete"] }], bulkAction: [{ type: i0.Output, args: ["bulkAction"] }], actionsTemplate: [{ type: i0.ContentChild, args: ['actionsTemplate', { isSignal: true }] }], scroller: [{ type: i0.ViewChild, args: ['scroller', { isSignal: true }] }], scrollbarProxy: [{ type: i0.ViewChild, args: ['scrollbarProxy', { isSignal: true }] }] } });
|
|
1105
1111
|
|
|
1106
1112
|
/** Clé par défaut de la recherche unifiée. */
|
|
@@ -1652,7 +1658,7 @@ class FilterBarComponent {
|
|
|
1652
1658
|
this.advancedToggle()?.nativeElement?.querySelector('button')?.focus();
|
|
1653
1659
|
}
|
|
1654
1660
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: FilterBarComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1655
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.20", type: FilterBarComponent, isStandalone: true, selector: "cw-filter-bar", inputs: { filters: { classPropertyName: "filters", publicName: "filters", isSignal: true, isRequired: true, transformFunction: null }, search: { classPropertyName: "search", publicName: "search", isSignal: true, isRequired: false, transformFunction: null }, manual: { classPropertyName: "manual", publicName: "manual", isSignal: true, isRequired: false, transformFunction: null }, syncUrl: { classPropertyName: "syncUrl", publicName: "syncUrl", isSignal: true, isRequired: false, transformFunction: null }, applyLabel: { classPropertyName: "applyLabel", publicName: "applyLabel", isSignal: true, isRequired: false, transformFunction: null }, resetLabel: { classPropertyName: "resetLabel", publicName: "resetLabel", isSignal: true, isRequired: false, transformFunction: null }, columns: { classPropertyName: "columns", publicName: "columns", isSignal: true, isRequired: false, transformFunction: null }, columnsStorageKey: { classPropertyName: "columnsStorageKey", publicName: "columnsStorageKey", isSignal: true, isRequired: false, transformFunction: null }, defaultColumns: { classPropertyName: "defaultColumns", publicName: "defaultColumns", isSignal: true, isRequired: false, transformFunction: null }, columnsLabel: { classPropertyName: "columnsLabel", publicName: "columnsLabel", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { filtersApplied: "filtersApplied", filtersReset: "filtersReset", columnsChange: "columnsChange" }, viewQueries: [{ propertyName: "advancedToggle", first: true, predicate: ["advancedToggle"], descendants: true, read: ElementRef, isSignal: true }], ngImport: i0, template: "<!-- Cl\u00E9s i18n pass\u00E9es telles quelles : cw-form-field et cw-button traduisent label et placeholder eux-m\u00EAmes. -->\n<form [formGroup]=\"filterForm\" (ngSubmit)=\"apply()\" class=\"filter-bar d-flex-v gap-md\">\n <div class=\"d-flex-h gap-md items-start justify-between\">\n <div class=\"d-flex-h flex-wrap gap-md items-center\">\n @if (search(); as searchConfig) {\n <!-- Recherche unifi\u00E9e : remplace les champs list\u00E9s dans `search.fields`. Label masqu\u00E9\n (la loupe + le placeholder l'identifient visuellement) et repris en title au survol. -->\n <div class=\"filter-field\" [class]=\"searchConfig.colClass ?? ''\">\n <cw-form-field\n [name]=\"fieldId(searchKey())\"\n [label]=\"searchLabel()\"\n [displayLabel]=\"false\"\n [fieldTitle]=\"searchLabel()\"\n [type]=\"fieldType.text\"\n [placeholder]=\"searchConfig.placeholder ?? '_COMMON._FILTER.KEYWORDS'\"\n [addonLeft]=\"searchIcon\"\n [control]=\"getControl(searchKey())\">\n </cw-form-field>\n </div>\n }\n @for (field of barFields(); track field.key) {\n <div class=\"filter-field\" [class]=\"field.colClass ?? ''\" [class.filter-field-text]=\"isTextField(field)\">\n <ng-container\n [ngTemplateOutlet]=\"fieldTpl\"\n [ngTemplateOutletContext]=\"{ $implicit: field, control: getControl(field.key) }\">\n </ng-container>\n </div>\n }\n @if (advancedFields().length) {\n <div class=\"d-flex-h items-center gap-5xs\">\n <cw-button #advancedToggle\n [label]=\"advancedLabel()\"\n [type]=\"uiType.link\"\n [ariaExpanded]=\"advancedOpen()\"\n [ariaControls]=\"advancedPanelId\"\n [ariaLabel]=\"!advancedOpen() && advancedChips().length ? '_COMMON._FILTER.MORE_COUNT' : undefined\"\n [labelParams]=\"{ count: advancedChips().length }\"\n (btnAction)=\"toggleAdvanced()\">\n </cw-button>\n @if (!advancedOpen() && advancedChips().length; as count) {\n <!-- Compteur (repli\u00E9 seulement : d\u00E9pli\u00E9, les champs montrent d\u00E9j\u00E0 les valeurs) ;\n d\u00E9coratif : le nombre est dans le nom accessible du bouton (\u00AB Plus de filtres, 2 actifs \u00BB). -->\n <cw-badge [type]=\"badgeType.lightLight\" [label]=\"'' + count\" aria-hidden=\"true\" />\n }\n </div>\n }\n @if (hasFields()) {\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 }\n </div>\n <!-- Menu \u00AB Colonnes \u00BB a droite ; ne s'affiche que si `columns` contient une colonne masquable. -->\n <cw-column-menu\n [columns]=\"columns()\"\n [storageKey]=\"columnsStorageKey()\"\n [defaultColumns]=\"defaultColumns()\"\n [label]=\"columnsLabel()\"\n (columnsChange)=\"columnsChange.emit($event)\">\n </cw-column-menu>\n </div>\n\n @if (advancedFields().length) {\n <!-- Champs avanc\u00E9s : appliqu\u00E9s comme ceux de la barre (\u00E0 la saisie, ou au bouton en mode manuel).\n Toujours dans le DOM (cible de aria-controls), masqu\u00E9s par `hidden` quand repli\u00E9s. -->\n <div class=\"d-flex-h flex-wrap gap-md\" role=\"group\" [id]=\"advancedPanelId\" [hidden]=\"!advancedOpen()\"\n [attr.aria-label]=\"'_COMMON._FILTER.ADVANCED' | translate\">\n @for (field of advancedFields(); track field.key) {\n <div class=\"filter-field\" [class]=\"field.colClass ?? ''\" [class.filter-field-text]=\"isTextField(field)\">\n <ng-container\n [ngTemplateOutlet]=\"fieldTpl\"\n [ngTemplateOutletContext]=\"{ $implicit: field, control: getControl(field.key) }\">\n </ng-container>\n </div>\n }\n </div>\n }\n\n <!-- \u00C9tiquettes : seulement repli\u00E9, sinon doublon avec les champs avanc\u00E9s affich\u00E9s. -->\n @if (!advancedOpen() && advancedChips().length) {\n <ul class=\"filter-bar-chips list-unstyled d-flex-h flex-wrap gap-sm items-center\" [attr.aria-label]=\"'_COMMON._FILTER.ACTIVE' | translate\">\n @for (chip of advancedChips(); track chip.key) {\n <li class=\"badge badge-light-light d-flex-h items-center gap-5xs\">\n <span>\n {{ chip.label | translate }} : {{ chipText(chip) }}\n </span>\n <cw-button\n [label]=\"'_COMMON._FILTER.REMOVE'\"\n [labelParams]=\"{ label: (chip.label | translate), value: chipText(chip) }\"\n [type]=\"uiType.ghost\"\n [withIcon]=\"spriteIcon.close\"\n [withOnlyIcon]=\"true\"\n [iconSize]=\"iconSize.xsmall\"\n (btnAction)=\"removeAdvanced(chip.key)\">\n </cw-button>\n </li>\n }\n </ul>\n }\n</form>\n\n<!-- Addon gauche de la recherche unifi\u00E9e : loupe d\u00E9corative (le nom accessible reste le label du champ). -->\n<ng-template #searchIcon>\n <cw-icon [icon]=\"spriteIcon.search\" />\n</ng-template>\n\n<!-- Rendu d'un champ de filtre, partag\u00E9 par la barre et les champs avanc\u00E9s. -->\n<ng-template #fieldTpl let-field let-control=\"control\">\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]=\"fieldId(field.key)\"\n [control]=\"$any(control)\">\n </cw-filter-select>\n } @else {\n <cw-form-field\n [name]=\"fieldId(field.key)\"\n [label]=\"field.label\"\n [displayLabel]=\"isTextField(field)\"\n [fieldTitle]=\"isTextField(field) ? undefined : field.label\"\n [type]=\"field.type\"\n [placeholder]=\"field.placeholder ?? ''\"\n [options]=\"resolveOptions(field)\"\n [control]=\"control\">\n </cw-form-field>\n }\n</ng-template>\n", dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1$2.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1$2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1$2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "ngmodule", type: TranslateModule }, { kind: "component", type: BadgeComponent, selector: "cw-badge", inputs: ["type", "label", "labelParams", "withIcon", "iconPosition", "cssClass", "skeletonMode", "dataTest"] }, { kind: "component", type: IconComponent, selector: "cw-icon", inputs: ["icon", "text", "label", "type", "iconSize", "iconCssClass", "iconUiType", "iconColorCustom", "spritePath"] }, { kind: "component", type: FormFieldComponent, selector: "cw-form-field", inputs: ["control", "formGroup", "type", "label", "displayLabel", "fieldTitle", "name", "placeholder", "autocomplete", "options", "rangeOptions", "validationOptions", "autocompleteOptions", "richTextOptions", "errorMessages", "isRequired", "requiredStart", "requiredEnd", "help", "helpParams", "tooltip", "ariaDescribedBy", "addonLeft", "addonRight", "isInAddon", "isReadonly", "isDisabled", "sliderValue", "sliderOptions", "cssClass", "skeletonMode", "clearable", "appendTo", "initialCountry", "recommendedDimensions", "showPreview", "existingFile", "indeterminate"], outputs: ["refreshEvent", "fileRemoved", "textChanged", "valueChange", "phoneRegionChange"] }, { kind: "component", type: FilterSelectComponent, selector: "cw-filter-select", inputs: ["control", "label", "options", "multiple", "allLabel", "inputId", "readonly", "appendTo"] }, { kind: "component", type: ButtonComponent, selector: "cw-button", inputs: ["type", "label", "labelParams", "id", "link", "isDropdown", "hideCaret", "withIcon", "withOnlyIcon", "iconSize", "iconPosition", "dropdownPosition", "isMinWidth", "isDisabled", "isLoading", "loadingAnnounce", "cssClass", "dataTest", "skeletonMode", "isPressed", "ariaDescribedBy", "ariaLabel", "ariaExpanded", "ariaControls", "withTooltip", "tooltipText", "tooltipTitle", "tooltipTrigger", "tooltipPosition", "tooltipType"], outputs: ["btnAction", "dropDownClicked"] }, { kind: "component", type: ColumnMenuComponent, selector: "cw-column-menu", inputs: ["columns", "storageKey", "defaultColumns", "label"], outputs: ["columnsChange"] }, { kind: "pipe", type: i1.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
1661
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.20", type: FilterBarComponent, isStandalone: true, selector: "cw-filter-bar", inputs: { filters: { classPropertyName: "filters", publicName: "filters", isSignal: true, isRequired: true, transformFunction: null }, search: { classPropertyName: "search", publicName: "search", isSignal: true, isRequired: false, transformFunction: null }, manual: { classPropertyName: "manual", publicName: "manual", isSignal: true, isRequired: false, transformFunction: null }, syncUrl: { classPropertyName: "syncUrl", publicName: "syncUrl", isSignal: true, isRequired: false, transformFunction: null }, applyLabel: { classPropertyName: "applyLabel", publicName: "applyLabel", isSignal: true, isRequired: false, transformFunction: null }, resetLabel: { classPropertyName: "resetLabel", publicName: "resetLabel", isSignal: true, isRequired: false, transformFunction: null }, columns: { classPropertyName: "columns", publicName: "columns", isSignal: true, isRequired: false, transformFunction: null }, columnsStorageKey: { classPropertyName: "columnsStorageKey", publicName: "columnsStorageKey", isSignal: true, isRequired: false, transformFunction: null }, defaultColumns: { classPropertyName: "defaultColumns", publicName: "defaultColumns", isSignal: true, isRequired: false, transformFunction: null }, columnsLabel: { classPropertyName: "columnsLabel", publicName: "columnsLabel", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { filtersApplied: "filtersApplied", filtersReset: "filtersReset", columnsChange: "columnsChange" }, viewQueries: [{ propertyName: "advancedToggle", first: true, predicate: ["advancedToggle"], descendants: true, read: ElementRef, isSignal: true }], ngImport: i0, template: "<!-- Cl\u00E9s i18n pass\u00E9es telles quelles : cw-form-field et cw-button traduisent label et placeholder eux-m\u00EAmes. -->\n<form [formGroup]=\"filterForm\" (ngSubmit)=\"apply()\" class=\"filter-bar d-flex-v gap-md\">\n <div class=\"d-flex-h gap-md items-start justify-between\">\n <div class=\"d-flex-h flex-wrap gap-md items-center\">\n @if (search(); as searchConfig) {\n <!-- Recherche unifi\u00E9e : remplace les champs list\u00E9s dans `search.fields`. Label masqu\u00E9\n (la loupe + le placeholder l'identifient visuellement) et repris en title au survol. -->\n <div class=\"filter-field\" [class]=\"searchConfig.colClass ?? ''\">\n <cw-form-field\n [name]=\"fieldId(searchKey())\"\n [label]=\"searchLabel()\"\n [displayLabel]=\"false\"\n [fieldTitle]=\"searchLabel()\"\n [type]=\"fieldType.text\"\n [placeholder]=\"searchConfig.placeholder ?? '_COMMON._FILTER.KEYWORDS'\"\n [addonLeft]=\"searchIcon\"\n [control]=\"getControl(searchKey())\">\n </cw-form-field>\n </div>\n }\n @for (field of barFields(); track field.key) {\n <div class=\"filter-field\" [class]=\"field.colClass ?? ''\" [class.filter-field-text]=\"isTextField(field)\">\n <ng-container\n [ngTemplateOutlet]=\"fieldTpl\"\n [ngTemplateOutletContext]=\"{ $implicit: field, control: getControl(field.key) }\">\n </ng-container>\n </div>\n }\n @if (advancedFields().length) {\n <div class=\"d-flex-h items-center gap-5xs\">\n <cw-button #advancedToggle\n [label]=\"advancedLabel()\"\n [type]=\"uiType.link\"\n [ariaExpanded]=\"advancedOpen()\"\n [ariaControls]=\"advancedPanelId\"\n [ariaLabel]=\"!advancedOpen() && advancedChips().length ? '_COMMON._FILTER.MORE_COUNT' : undefined\"\n [labelParams]=\"{ count: advancedChips().length }\"\n (btnAction)=\"toggleAdvanced()\">\n </cw-button>\n @if (!advancedOpen() && advancedChips().length; as count) {\n <!-- Compteur (repli\u00E9 seulement : d\u00E9pli\u00E9, les champs montrent d\u00E9j\u00E0 les valeurs) ;\n d\u00E9coratif : le nombre est dans le nom accessible du bouton (\u00AB Plus de filtres, 2 actifs \u00BB). -->\n <cw-badge [type]=\"badgeType.lightLight\" [label]=\"'' + count\" aria-hidden=\"true\" />\n }\n </div>\n }\n @if (hasFields()) {\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 }\n </div>\n <!-- Menu \u00AB Colonnes \u00BB a droite ; ne s'affiche que si `columns` contient une colonne masquable. -->\n <cw-column-menu\n [columns]=\"columns()\"\n [storageKey]=\"columnsStorageKey()\"\n [defaultColumns]=\"defaultColumns()\"\n [label]=\"columnsLabel()\"\n (columnsChange)=\"columnsChange.emit($event)\">\n </cw-column-menu>\n </div>\n\n @if (advancedFields().length) {\n <!-- Champs avanc\u00E9s : appliqu\u00E9s comme ceux de la barre (\u00E0 la saisie, ou au bouton en mode manuel).\n Toujours dans le DOM (cible de aria-controls), masqu\u00E9s par `hidden` quand repli\u00E9s. -->\n <div class=\"d-flex-h flex-wrap gap-md\" role=\"group\" [id]=\"advancedPanelId\" [hidden]=\"!advancedOpen()\"\n [attr.aria-label]=\"'_COMMON._FILTER.ADVANCED' | translate\">\n @for (field of advancedFields(); track field.key) {\n <div class=\"filter-field\" [class]=\"field.colClass ?? ''\" [class.filter-field-text]=\"isTextField(field)\">\n <ng-container\n [ngTemplateOutlet]=\"fieldTpl\"\n [ngTemplateOutletContext]=\"{ $implicit: field, control: getControl(field.key) }\">\n </ng-container>\n </div>\n }\n </div>\n }\n\n <!-- \u00C9tiquettes : seulement repli\u00E9, sinon doublon avec les champs avanc\u00E9s affich\u00E9s. -->\n @if (!advancedOpen() && advancedChips().length) {\n <ul class=\"filter-bar-chips list-unstyled d-flex-h flex-wrap gap-sm items-center\" [attr.aria-label]=\"'_COMMON._FILTER.ACTIVE' | translate\">\n @for (chip of advancedChips(); track chip.key) {\n <li class=\"badge badge-light-light d-flex-h items-center gap-5xs\">\n <span>\n {{ chip.label | translate }} : {{ chipText(chip) }}\n </span>\n <cw-button\n [label]=\"'_COMMON._FILTER.REMOVE'\"\n [labelParams]=\"{ label: (chip.label | translate), value: chipText(chip) }\"\n [type]=\"uiType.ghost\"\n [withIcon]=\"spriteIcon.close\"\n [withOnlyIcon]=\"true\"\n [iconSize]=\"iconSize.xsmall\"\n (btnAction)=\"removeAdvanced(chip.key)\">\n </cw-button>\n </li>\n }\n </ul>\n }\n</form>\n\n<!-- Addon gauche de la recherche unifi\u00E9e : loupe d\u00E9corative (le nom accessible reste le label du champ). -->\n<ng-template #searchIcon>\n <cw-icon [icon]=\"spriteIcon.search\" />\n</ng-template>\n\n<!-- Rendu d'un champ de filtre, partag\u00E9 par la barre et les champs avanc\u00E9s. -->\n<ng-template #fieldTpl let-field let-control=\"control\">\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]=\"fieldId(field.key)\"\n [control]=\"$any(control)\">\n </cw-filter-select>\n } @else {\n <cw-form-field\n [name]=\"fieldId(field.key)\"\n [label]=\"field.label\"\n [displayLabel]=\"isTextField(field)\"\n [fieldTitle]=\"isTextField(field) ? undefined : field.label\"\n [type]=\"field.type\"\n [placeholder]=\"field.placeholder ?? ''\"\n [options]=\"resolveOptions(field)\"\n [periodShortcuts]=\"field.periodShortcuts\"\n [addonLeft]=\"field.addonLeft\"\n [addonRight]=\"field.addonRight\"\n [control]=\"control\">\n </cw-form-field>\n }\n</ng-template>\n", dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1$2.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1$2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1$2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "ngmodule", type: TranslateModule }, { kind: "component", type: BadgeComponent, selector: "cw-badge", inputs: ["type", "label", "labelParams", "withIcon", "iconPosition", "cssClass", "skeletonMode", "dataTest"] }, { kind: "component", type: IconComponent, selector: "cw-icon", inputs: ["icon", "text", "label", "type", "iconSize", "iconCssClass", "iconUiType", "iconColorCustom", "spritePath"] }, { kind: "component", type: FormFieldComponent, selector: "cw-form-field", inputs: ["control", "formGroup", "type", "label", "displayLabel", "fieldTitle", "name", "placeholder", "autocomplete", "options", "rangeOptions", "validationOptions", "autocompleteOptions", "richTextOptions", "errorMessages", "isRequired", "requiredStart", "requiredEnd", "periodShortcuts", "help", "helpParams", "tooltip", "ariaDescribedBy", "addonLeft", "addonRight", "isInAddon", "isReadonly", "isDisabled", "sliderValue", "sliderOptions", "cssClass", "skeletonMode", "clearable", "appendTo", "initialCountry", "recommendedDimensions", "showPreview", "existingFile", "indeterminate"], outputs: ["refreshEvent", "fileRemoved", "textChanged", "valueChange", "phoneRegionChange"] }, { kind: "component", type: FilterSelectComponent, selector: "cw-filter-select", inputs: ["control", "label", "options", "multiple", "allLabel", "inputId", "readonly", "appendTo"] }, { kind: "component", type: ButtonComponent, selector: "cw-button", inputs: ["type", "label", "labelParams", "id", "link", "isDropdown", "hideCaret", "withIcon", "withOnlyIcon", "iconSize", "iconPosition", "dropdownPosition", "isMinWidth", "isDisabled", "isLoading", "loadingAnnounce", "cssClass", "dataTest", "skeletonMode", "isPressed", "ariaDescribedBy", "ariaLabel", "ariaExpanded", "ariaControls", "withTooltip", "tooltipText", "tooltipTitle", "tooltipTrigger", "tooltipPosition", "tooltipType"], outputs: ["btnAction", "dropDownClicked"] }, { kind: "component", type: ColumnMenuComponent, selector: "cw-column-menu", inputs: ["columns", "storageKey", "defaultColumns", "label"], outputs: ["columnsChange"] }, { kind: "pipe", type: i1.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
1656
1662
|
}
|
|
1657
1663
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: FilterBarComponent, decorators: [{
|
|
1658
1664
|
type: Component,
|
|
@@ -1666,7 +1672,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.20", ngImpo
|
|
|
1666
1672
|
FilterSelectComponent,
|
|
1667
1673
|
ButtonComponent,
|
|
1668
1674
|
ColumnMenuComponent
|
|
1669
|
-
], 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 d-flex-v gap-md\">\n <div class=\"d-flex-h gap-md items-start justify-between\">\n <div class=\"d-flex-h flex-wrap gap-md items-center\">\n @if (search(); as searchConfig) {\n <!-- Recherche unifi\u00E9e : remplace les champs list\u00E9s dans `search.fields`. Label masqu\u00E9\n (la loupe + le placeholder l'identifient visuellement) et repris en title au survol. -->\n <div class=\"filter-field\" [class]=\"searchConfig.colClass ?? ''\">\n <cw-form-field\n [name]=\"fieldId(searchKey())\"\n [label]=\"searchLabel()\"\n [displayLabel]=\"false\"\n [fieldTitle]=\"searchLabel()\"\n [type]=\"fieldType.text\"\n [placeholder]=\"searchConfig.placeholder ?? '_COMMON._FILTER.KEYWORDS'\"\n [addonLeft]=\"searchIcon\"\n [control]=\"getControl(searchKey())\">\n </cw-form-field>\n </div>\n }\n @for (field of barFields(); track field.key) {\n <div class=\"filter-field\" [class]=\"field.colClass ?? ''\" [class.filter-field-text]=\"isTextField(field)\">\n <ng-container\n [ngTemplateOutlet]=\"fieldTpl\"\n [ngTemplateOutletContext]=\"{ $implicit: field, control: getControl(field.key) }\">\n </ng-container>\n </div>\n }\n @if (advancedFields().length) {\n <div class=\"d-flex-h items-center gap-5xs\">\n <cw-button #advancedToggle\n [label]=\"advancedLabel()\"\n [type]=\"uiType.link\"\n [ariaExpanded]=\"advancedOpen()\"\n [ariaControls]=\"advancedPanelId\"\n [ariaLabel]=\"!advancedOpen() && advancedChips().length ? '_COMMON._FILTER.MORE_COUNT' : undefined\"\n [labelParams]=\"{ count: advancedChips().length }\"\n (btnAction)=\"toggleAdvanced()\">\n </cw-button>\n @if (!advancedOpen() && advancedChips().length; as count) {\n <!-- Compteur (repli\u00E9 seulement : d\u00E9pli\u00E9, les champs montrent d\u00E9j\u00E0 les valeurs) ;\n d\u00E9coratif : le nombre est dans le nom accessible du bouton (\u00AB Plus de filtres, 2 actifs \u00BB). -->\n <cw-badge [type]=\"badgeType.lightLight\" [label]=\"'' + count\" aria-hidden=\"true\" />\n }\n </div>\n }\n @if (hasFields()) {\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 }\n </div>\n <!-- Menu \u00AB Colonnes \u00BB a droite ; ne s'affiche que si `columns` contient une colonne masquable. -->\n <cw-column-menu\n [columns]=\"columns()\"\n [storageKey]=\"columnsStorageKey()\"\n [defaultColumns]=\"defaultColumns()\"\n [label]=\"columnsLabel()\"\n (columnsChange)=\"columnsChange.emit($event)\">\n </cw-column-menu>\n </div>\n\n @if (advancedFields().length) {\n <!-- Champs avanc\u00E9s : appliqu\u00E9s comme ceux de la barre (\u00E0 la saisie, ou au bouton en mode manuel).\n Toujours dans le DOM (cible de aria-controls), masqu\u00E9s par `hidden` quand repli\u00E9s. -->\n <div class=\"d-flex-h flex-wrap gap-md\" role=\"group\" [id]=\"advancedPanelId\" [hidden]=\"!advancedOpen()\"\n [attr.aria-label]=\"'_COMMON._FILTER.ADVANCED' | translate\">\n @for (field of advancedFields(); track field.key) {\n <div class=\"filter-field\" [class]=\"field.colClass ?? ''\" [class.filter-field-text]=\"isTextField(field)\">\n <ng-container\n [ngTemplateOutlet]=\"fieldTpl\"\n [ngTemplateOutletContext]=\"{ $implicit: field, control: getControl(field.key) }\">\n </ng-container>\n </div>\n }\n </div>\n }\n\n <!-- \u00C9tiquettes : seulement repli\u00E9, sinon doublon avec les champs avanc\u00E9s affich\u00E9s. -->\n @if (!advancedOpen() && advancedChips().length) {\n <ul class=\"filter-bar-chips list-unstyled d-flex-h flex-wrap gap-sm items-center\" [attr.aria-label]=\"'_COMMON._FILTER.ACTIVE' | translate\">\n @for (chip of advancedChips(); track chip.key) {\n <li class=\"badge badge-light-light d-flex-h items-center gap-5xs\">\n <span>\n {{ chip.label | translate }} : {{ chipText(chip) }}\n </span>\n <cw-button\n [label]=\"'_COMMON._FILTER.REMOVE'\"\n [labelParams]=\"{ label: (chip.label | translate), value: chipText(chip) }\"\n [type]=\"uiType.ghost\"\n [withIcon]=\"spriteIcon.close\"\n [withOnlyIcon]=\"true\"\n [iconSize]=\"iconSize.xsmall\"\n (btnAction)=\"removeAdvanced(chip.key)\">\n </cw-button>\n </li>\n }\n </ul>\n }\n</form>\n\n<!-- Addon gauche de la recherche unifi\u00E9e : loupe d\u00E9corative (le nom accessible reste le label du champ). -->\n<ng-template #searchIcon>\n <cw-icon [icon]=\"spriteIcon.search\" />\n</ng-template>\n\n<!-- Rendu d'un champ de filtre, partag\u00E9 par la barre et les champs avanc\u00E9s. -->\n<ng-template #fieldTpl let-field let-control=\"control\">\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]=\"fieldId(field.key)\"\n [control]=\"$any(control)\">\n </cw-filter-select>\n } @else {\n <cw-form-field\n [name]=\"fieldId(field.key)\"\n [label]=\"field.label\"\n [displayLabel]=\"isTextField(field)\"\n [fieldTitle]=\"isTextField(field) ? undefined : field.label\"\n [type]=\"field.type\"\n [placeholder]=\"field.placeholder ?? ''\"\n [options]=\"resolveOptions(field)\"\n [control]=\"control\">\n </cw-form-field>\n }\n</ng-template>\n" }]
|
|
1675
|
+
], 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 d-flex-v gap-md\">\n <div class=\"d-flex-h gap-md items-start justify-between\">\n <div class=\"d-flex-h flex-wrap gap-md items-center\">\n @if (search(); as searchConfig) {\n <!-- Recherche unifi\u00E9e : remplace les champs list\u00E9s dans `search.fields`. Label masqu\u00E9\n (la loupe + le placeholder l'identifient visuellement) et repris en title au survol. -->\n <div class=\"filter-field\" [class]=\"searchConfig.colClass ?? ''\">\n <cw-form-field\n [name]=\"fieldId(searchKey())\"\n [label]=\"searchLabel()\"\n [displayLabel]=\"false\"\n [fieldTitle]=\"searchLabel()\"\n [type]=\"fieldType.text\"\n [placeholder]=\"searchConfig.placeholder ?? '_COMMON._FILTER.KEYWORDS'\"\n [addonLeft]=\"searchIcon\"\n [control]=\"getControl(searchKey())\">\n </cw-form-field>\n </div>\n }\n @for (field of barFields(); track field.key) {\n <div class=\"filter-field\" [class]=\"field.colClass ?? ''\" [class.filter-field-text]=\"isTextField(field)\">\n <ng-container\n [ngTemplateOutlet]=\"fieldTpl\"\n [ngTemplateOutletContext]=\"{ $implicit: field, control: getControl(field.key) }\">\n </ng-container>\n </div>\n }\n @if (advancedFields().length) {\n <div class=\"d-flex-h items-center gap-5xs\">\n <cw-button #advancedToggle\n [label]=\"advancedLabel()\"\n [type]=\"uiType.link\"\n [ariaExpanded]=\"advancedOpen()\"\n [ariaControls]=\"advancedPanelId\"\n [ariaLabel]=\"!advancedOpen() && advancedChips().length ? '_COMMON._FILTER.MORE_COUNT' : undefined\"\n [labelParams]=\"{ count: advancedChips().length }\"\n (btnAction)=\"toggleAdvanced()\">\n </cw-button>\n @if (!advancedOpen() && advancedChips().length; as count) {\n <!-- Compteur (repli\u00E9 seulement : d\u00E9pli\u00E9, les champs montrent d\u00E9j\u00E0 les valeurs) ;\n d\u00E9coratif : le nombre est dans le nom accessible du bouton (\u00AB Plus de filtres, 2 actifs \u00BB). -->\n <cw-badge [type]=\"badgeType.lightLight\" [label]=\"'' + count\" aria-hidden=\"true\" />\n }\n </div>\n }\n @if (hasFields()) {\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 }\n </div>\n <!-- Menu \u00AB Colonnes \u00BB a droite ; ne s'affiche que si `columns` contient une colonne masquable. -->\n <cw-column-menu\n [columns]=\"columns()\"\n [storageKey]=\"columnsStorageKey()\"\n [defaultColumns]=\"defaultColumns()\"\n [label]=\"columnsLabel()\"\n (columnsChange)=\"columnsChange.emit($event)\">\n </cw-column-menu>\n </div>\n\n @if (advancedFields().length) {\n <!-- Champs avanc\u00E9s : appliqu\u00E9s comme ceux de la barre (\u00E0 la saisie, ou au bouton en mode manuel).\n Toujours dans le DOM (cible de aria-controls), masqu\u00E9s par `hidden` quand repli\u00E9s. -->\n <div class=\"d-flex-h flex-wrap gap-md\" role=\"group\" [id]=\"advancedPanelId\" [hidden]=\"!advancedOpen()\"\n [attr.aria-label]=\"'_COMMON._FILTER.ADVANCED' | translate\">\n @for (field of advancedFields(); track field.key) {\n <div class=\"filter-field\" [class]=\"field.colClass ?? ''\" [class.filter-field-text]=\"isTextField(field)\">\n <ng-container\n [ngTemplateOutlet]=\"fieldTpl\"\n [ngTemplateOutletContext]=\"{ $implicit: field, control: getControl(field.key) }\">\n </ng-container>\n </div>\n }\n </div>\n }\n\n <!-- \u00C9tiquettes : seulement repli\u00E9, sinon doublon avec les champs avanc\u00E9s affich\u00E9s. -->\n @if (!advancedOpen() && advancedChips().length) {\n <ul class=\"filter-bar-chips list-unstyled d-flex-h flex-wrap gap-sm items-center\" [attr.aria-label]=\"'_COMMON._FILTER.ACTIVE' | translate\">\n @for (chip of advancedChips(); track chip.key) {\n <li class=\"badge badge-light-light d-flex-h items-center gap-5xs\">\n <span>\n {{ chip.label | translate }} : {{ chipText(chip) }}\n </span>\n <cw-button\n [label]=\"'_COMMON._FILTER.REMOVE'\"\n [labelParams]=\"{ label: (chip.label | translate), value: chipText(chip) }\"\n [type]=\"uiType.ghost\"\n [withIcon]=\"spriteIcon.close\"\n [withOnlyIcon]=\"true\"\n [iconSize]=\"iconSize.xsmall\"\n (btnAction)=\"removeAdvanced(chip.key)\">\n </cw-button>\n </li>\n }\n </ul>\n }\n</form>\n\n<!-- Addon gauche de la recherche unifi\u00E9e : loupe d\u00E9corative (le nom accessible reste le label du champ). -->\n<ng-template #searchIcon>\n <cw-icon [icon]=\"spriteIcon.search\" />\n</ng-template>\n\n<!-- Rendu d'un champ de filtre, partag\u00E9 par la barre et les champs avanc\u00E9s. -->\n<ng-template #fieldTpl let-field let-control=\"control\">\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]=\"fieldId(field.key)\"\n [control]=\"$any(control)\">\n </cw-filter-select>\n } @else {\n <cw-form-field\n [name]=\"fieldId(field.key)\"\n [label]=\"field.label\"\n [displayLabel]=\"isTextField(field)\"\n [fieldTitle]=\"isTextField(field) ? undefined : field.label\"\n [type]=\"field.type\"\n [placeholder]=\"field.placeholder ?? ''\"\n [options]=\"resolveOptions(field)\"\n [periodShortcuts]=\"field.periodShortcuts\"\n [addonLeft]=\"field.addonLeft\"\n [addonRight]=\"field.addonRight\"\n [control]=\"control\">\n </cw-form-field>\n }\n</ng-template>\n" }]
|
|
1670
1676
|
}], ctorParameters: () => [], propDecorators: { filters: [{ type: i0.Input, args: [{ isSignal: true, alias: "filters", required: true }] }], search: [{ type: i0.Input, args: [{ isSignal: true, alias: "search", required: false }] }], manual: [{ type: i0.Input, args: [{ isSignal: true, alias: "manual", required: false }] }], syncUrl: [{ type: i0.Input, args: [{ isSignal: true, alias: "syncUrl", required: false }] }], applyLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "applyLabel", required: false }] }], resetLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "resetLabel", required: false }] }], columns: [{ type: i0.Input, args: [{ isSignal: true, alias: "columns", required: false }] }], columnsStorageKey: [{ type: i0.Input, args: [{ isSignal: true, alias: "columnsStorageKey", required: false }] }], defaultColumns: [{ type: i0.Input, args: [{ isSignal: true, alias: "defaultColumns", required: false }] }], columnsLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "columnsLabel", required: false }] }], filtersApplied: [{ type: i0.Output, args: ["filtersApplied"] }], filtersReset: [{ type: i0.Output, args: ["filtersReset"] }], columnsChange: [{ type: i0.Output, args: ["columnsChange"] }], advancedToggle: [{ type: i0.ViewChild, args: ['advancedToggle', { ...{ read: ElementRef }, isSignal: true }] }] } });
|
|
1671
1677
|
|
|
1672
1678
|
// Type nominal des cles de traduction, partage par tous les composants de la lib.
|
|
@@ -2509,7 +2515,7 @@ class ImportWizardComponent {
|
|
|
2509
2515
|
}));
|
|
2510
2516
|
}
|
|
2511
2517
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: ImportWizardComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2512
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.20", type: ImportWizardComponent, isStandalone: true, selector: "cw-import-wizard", inputs: { config: { classPropertyName: "config", publicName: "config", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { completed: "completed" }, host: { classAttribute: "cw-import-wizard" }, viewQueries: [{ propertyName: "panels", predicate: ["stepPanel"], descendants: true, read: CardComponent, isSignal: true }, { propertyName: "selectionTarget", first: true, predicate: ["selectionTarget"], descendants: true, isSignal: true }, { propertyName: "analysisStatus", first: true, predicate: ["analysisStatus"], descendants: true, isSignal: true }, { propertyName: "analysisOutcome", first: true, predicate: ["analysisOutcome"], descendants: true, isSignal: true }, { propertyName: "executionStatus", first: true, predicate: ["executionStatus"], descendants: true, isSignal: true }, { propertyName: "cancellingStatus", first: true, predicate: ["cancellingStatus"], descendants: true, isSignal: true }, { propertyName: "reportOutcome", first: true, predicate: ["reportOutcome"], descendants: true, isSignal: true }, { propertyName: "interruptedOutcome", first: true, predicate: ["interruptedOutcome"], descendants: true, isSignal: true }], ngImport: i0, template: "<!-- Pastille d'etape : icone ronde verte (terminee) / rouge (echec), sinon le numero.\r\n Rendue dans [header-start] pour etre AVANT le titre, comme sur les maquettes.\r\n Le numero seul n'etant pas parlant a l'oreille, le statut est double en visually-hidden --\r\n et c'est LUI qui distingue \u00AB en cours \u00BB de \u00AB a venir \u00BB pour qui ne voit pas la couleur. -->\r\n<ng-template #badge let-stepKey=\"stepKey\" let-number=\"number\">\r\n @if (stateOf(stepKey) === stepState.done) {\r\n <cw-icon [icon]=\"spriteIcon.check\" [type]=\"iconType.circular\" [iconSize]=\"iconSize['sm']\"\r\n [iconUiType]=\"iconUiType.success\" [label]=\"stepStatusLabel(stepKey) | translate\"></cw-icon>\r\n }\r\n @else if (stateOf(stepKey) === stepState.error) {\r\n <cw-icon [icon]=\"spriteIcon.close\" [type]=\"iconType.circular\" [iconSize]=\"iconSize['sm']\"\r\n [iconUiType]=\"iconUiType.danger\" [label]=\"stepStatusLabel(stepKey) | translate\"></cw-icon>\r\n }\r\n @else {\r\n <div class=\"icon-circular icon-circular-sm\" [class]=\"'icon-circular-' + badgeVariant(stepKey)\">\r\n <span aria-hidden=\"true\">{{ number }}</span>\r\n <span class=\"visually-hidden\">{{ stepStatusLabel(stepKey) | translate }}</span>\r\n </div>\r\n }\r\n</ng-template>\r\n\r\n<ng-template #counts let-rows=\"rows\">\r\n <ul class=\"list-unstyled d-flex-h gap-md\">\r\n @for (row of rows; track row.key) {\r\n <li>\r\n <span class=\"fs-lg fw-bold\" [class]=\"'text-' + row.tone\">{{ row.count }}</span> {{ row.key | translate: row.params }}\r\n </li>\r\n }\r\n </ul>\r\n</ng-template>\r\n\r\n<cw-accordion [closeOthers]=\"true\" [destroyOnHide]=\"false\">\r\n\r\n <!-- Etape 1 : fichier + type d'import -->\r\n <cw-card\r\n #stepPanel\r\n [title]=\"'_COMMON._IMPORT._STEP.SELECT'\"\r\n [collapseId]=\"'import-step-select'\"\r\n [collapsed]=\"!isPanelOpen(step.select)\"\r\n [collapseLocked]=\"stateOf(step.select) === stepState.done\"\r\n [disabled]=\"stateOf(step.select) === stepState.todo\"\r\n [collapseStretched]=\"false\">\r\n\r\n <ng-container ngProjectAs=\"[header-start]\">\r\n <ng-container *ngTemplateOutlet=\"badge; context: { stepKey: step.select, number: 1 }\"></ng-container>\r\n </ng-container>\r\n\r\n <div class=\"d-flex-v gap-md\">\r\n <div class=\"row\">\r\n <div class=\"col-lg-6\">\r\n <!-- Retour depuis une analyse non conforme : cible de focus. Le bouton qui declenche\r\n ce retour disparait avec le repli du panneau 2, le focus retomberait sur <body>. -->\r\n @if (selectionReopened()) {\r\n <h3 class=\"visually-hidden\" tabindex=\"-1\" #selectionTarget>\r\n {{ '_COMMON._IMPORT._A11Y.SELECTION' | translate }}\r\n </h3>\r\n }\r\n\r\n <cw-file-drop\r\n [formControl]=\"file\"\r\n [accept]=\"config().accept\"\r\n [acceptLabel]=\"config().acceptLabel\"\r\n [maxSizeMb]=\"maxSizeMb()\"\r\n [label]=\"'_COMMON._IMPORT.FILE_TO_IMPORT' | translate\">\r\n </cw-file-drop>\r\n\r\n @if (config().helpText; as helpText) {\r\n <p class=\"mt-2xs\">{{ helpText | translate }}</p>\r\n }\r\n </div>\r\n\r\n @if (config().templateFile) {\r\n <div class=\"col-lg-6\">\r\n <cw-card [type]=\"cardType.light\">\r\n <strong>{{ '_COMMON._IMPORT._TEMPLATE.TITLE' | translate }}</strong>\r\n <span>{{ '_COMMON._IMPORT._TEMPLATE.TEXT' | translate }}</span>\r\n <cw-file-to-download [attachments]=\"templateAttachments()\"></cw-file-to-download>\r\n </cw-card>\r\n </div>\r\n }\r\n </div>\r\n\r\n <!-- Mode IMPOSE : aucun champ, et pas davantage de ligne \u00AB Type d'import : ... \u00BB \u2014 la\r\n maquette ne rend que l'alerte de portee ci-dessous, qui informe deja du mode retenu.\r\n Le champ cle de rapprochement y est replie (voir l'alerte).\r\n Choix LIBRE : groupe radio, dont la selection est REQUISE (pas de preselection). -->\r\n @if (!isModeImposed()) {\r\n <cw-form-field\r\n [type]=\"fieldType.radio\"\r\n [control]=\"mode\"\r\n [name]=\"'importMode'\"\r\n [label]=\"'_COMMON._IMPORT._MODE.LABEL'\"\r\n [options]=\"modeOptions()\"\r\n [isRequired]=\"true\"\r\n [help]=\"selectedKeyFieldHint()\">\r\n </cw-form-field>\r\n }\r\n\r\n <!-- Portee du mode retenu (destructif ou non) : exigence SFD \u00AB l'utilisateur est\r\n informe du type d'import selectionne ou impose \u00BB. Rien tant qu'aucun mode n'est\r\n retenu : l'alerte ne decrit jamais un mode que l'utilisateur n'a pas choisi. -->\r\n @if (modeNotice(); as notice) {\r\n <cw-alert [type]=\"modeNoticeType()\">\r\n {{ notice.lead | translate }}\r\n @if (notice.items.length) {\r\n <ul class=\"mb-none\">\r\n @for (item of notice.items; track $index) {\r\n <li>{{ item | translate }}</li>\r\n }\r\n </ul>\r\n }\r\n <!-- Mode impose : l'alerte est le SEUL endroit qui reste pour dire sur quoi porte\r\n le rapprochement. En choix libre, c'est l'aide du groupe radio qui le porte. -->\r\n @if (isModeImposed() && selectedKeyFieldHint(); as keyFieldHint) {\r\n <p class=\"mb-none\">{{ keyFieldHint | translate }}</p>\r\n }\r\n </cw-alert>\r\n }\r\n\r\n <!-- Un bouton desactive muet est un cul-de-sac : ce texte dit ce qui manque, et il est\r\n place AVANT le bouton, seul chemin possible puisqu'un bouton desactive n'est pas\r\n focusable (donc pas d'aria-describedby exploitable). Pas de classe de couleur\r\n atenuee : c'est une information necessaire, elle garde le contraste du corps. -->\r\n <div class=\"d-flex-h justify-end gap-md\">\r\n @if (missingRequirementKey(); as missing) {\r\n <p class=\"mb-none fs-xs\">{{ missing | translate }}</p>\r\n }\r\n\r\n <cw-button\r\n [type]=\"buttonType.primary\"\r\n [label]=\"'_COMMON._IMPORT.CONTINUE'\"\r\n [dataTest]=\"'btn-import-continue'\"\r\n [isDisabled]=\"!canContinue()\"\r\n (btnAction)=\"continueToAnalysis()\">\r\n </cw-button>\r\n </div>\r\n </div>\r\n </cw-card>\r\n\r\n <!-- Etape 2 : analyse a blanc -->\r\n <cw-card\r\n #stepPanel\r\n [title]=\"'_COMMON._IMPORT._STEP.ANALYSIS'\"\r\n [collapseId]=\"'import-step-analysis'\"\r\n [collapsed]=\"!isPanelOpen(step.analysis)\"\r\n [collapseLocked]=\"stateOf(step.analysis) === stepState.done\"\r\n [disabled]=\"stateOf(step.analysis) === stepState.todo\"\r\n [collapseStretched]=\"false\">\r\n\r\n <ng-container ngProjectAs=\"[header-start]\">\r\n <ng-container *ngTemplateOutlet=\"badge; context: { stepKey: step.analysis, number: 2 }\"></ng-container>\r\n </ng-container>\r\n\r\n <div class=\"d-flex-v gap-md\">\r\n @if (analyzing()) {\r\n <!-- Cible de focus : ce texte EST le message d'etat, il est donc lu une fois et une\r\n seule (aucune region live en doublon). -->\r\n <span tabindex=\"-1\" #analysisStatus>{{ '_COMMON._IMPORT.ANALYSIS_IN_PROGRESS' | translate }}</span>\r\n }\r\n @else if (analysis(); as result) {\r\n <!-- Cible de focus a l'arrivee du resultat : libelle de section, pas une reprise du\r\n message, pour que la lecture enchaine sur l'alerte puis les compteurs. -->\r\n <h3 class=\"visually-hidden\" tabindex=\"-1\" #analysisOutcome>\r\n {{ '_COMMON._IMPORT._A11Y.ANALYSIS_RESULT' | translate }}\r\n </h3>\r\n\r\n @if (result.valid) {\r\n <cw-alert [type]=\"alertType.success\">\r\n {{ '_COMMON._IMPORT.ANALYSIS_OK' | translate }}\r\n </cw-alert>\r\n\r\n <!-- scope=list : previsualisation chiffree. scope=singleConfig : le message ci-dessus suffit. -->\r\n @if (isList() && previewRows().length) {\r\n <ng-container *ngTemplateOutlet=\"counts; context: { rows: previewRows() }\"></ng-container>\r\n }\r\n\r\n <div class=\"list-unstyled d-flex-h justify-end\">\r\n <cw-button\r\n [type]=\"buttonType.primary\"\r\n [label]=\"'_COMMON._IMPORT.START'\"\r\n [dataTest]=\"'btn-import-start'\"\r\n (btnAction)=\"startImport()\">\r\n </cw-button>\r\n </div>\r\n }\r\n @else {\r\n <cw-alert [type]=\"alertType.danger\">\r\n {{ '_COMMON._IMPORT.ANALYSIS_KO' | translate }}\r\n </cw-alert>\r\n\r\n @if (errorCountRow(); as errorCount) {\r\n <p class=\"mb-none\">\r\n <span class=\"fs-lg fw-bold\" [class]=\"'text-' + errorCount.tone\">{{ errorCount.count }}</span>\r\n {{ errorCount.key | translate }}\r\n </p>\r\n\r\n <!-- Une alerte par anomalie, et non une liste a puces : c'est le rendu de la\r\n maquette, et chaque message reste lisible isolement. -->\r\n @for (issue of errors(); track $index) {\r\n <cw-alert [type]=\"alertType.danger\">\r\n @if (issue.line !== undefined) {\r\n <strong>{{ '_COMMON._IMPORT.ERROR_LINE' | translate: { line: issue.line } }}</strong>\r\n }\r\n {{ issue.messageKey ? (issue.messageKey | translate: issue.messageParams) : issue.message }}\r\n </cw-alert>\r\n }\r\n }\r\n\r\n <div class=\"d-flex-h justify-end\">\r\n <cw-button\r\n [type]=\"buttonType.secondary\"\r\n [label]=\"'_COMMON._IMPORT.BACK_TO_SELECTION'\"\r\n [dataTest]=\"'btn-import-back'\"\r\n (btnAction)=\"backToSelection()\">\r\n </cw-button>\r\n </div>\r\n }\r\n }\r\n </div>\r\n </cw-card>\r\n\r\n <!-- Etape 3 : import -->\r\n <cw-card\r\n #stepPanel\r\n [title]=\"'_COMMON._IMPORT._STEP.EXECUTION'\"\r\n [collapseId]=\"'import-step-execution'\"\r\n [collapsed]=\"!isPanelOpen(step.execution)\"\r\n [disabled]=\"stateOf(step.execution) === stepState.todo\"\r\n [collapseStretched]=\"false\">\r\n\r\n <ng-container ngProjectAs=\"[header-start]\">\r\n <ng-container *ngTemplateOutlet=\"badge; context: { stepKey: step.execution, number: 3 }\"></ng-container>\r\n </ng-container>\r\n\r\n <div class=\"d-flex-v gap-md\">\r\n @if (isImporting) {\r\n <div class=\"d-flex-v gap-2xs\">\r\n <!-- Cible de focus. Le bouton \u00AB Arreter l'import \u00BB est le focusable suivant. -->\r\n <span tabindex=\"-1\" #executionStatus>{{ '_COMMON._IMPORT.IN_PROGRESS' | translate }}</span>\r\n @if (progress()?.remainingLabel; as remaining) {\r\n <span>{{ '_COMMON._IMPORT.REMAINING' | translate: { value: remaining } }}</span>\r\n }\r\n </div>\r\n\r\n <!-- Avancement connu => barre deterministe. Aucune progression recue => spinner\r\n indetermine, plutot qu'une barre figee a 0 %. La bascule se fait a la premiere\r\n emission `ImportProgress` : une source qui n'en emet jamais reste sur le spinner.\r\n `displayText` a false : le libelle \u00AB Import en cours \u00BB est deja au-dessus. -->\r\n @if (progress(); as current) {\r\n <cw-progress-bar\r\n [value]=\"current.percent\"\r\n [type]=\"progressType.information\"\r\n [label]=\"'_COMMON._IMPORT.IN_PROGRESS' | translate\">\r\n </cw-progress-bar>\r\n }\r\n @else {\r\n <cw-loader [size]=\"loaderSize.sm\" [displayText]=\"false\"></cw-loader>\r\n }\r\n\r\n <!-- Pas de bouton d'arret quand l'objet declare l'import non interruptible : un\r\n bouton qui ne peut rien arreter serait pire que son absence. -->\r\n @if (canInterrupt()) {\r\n <div class=\"d-flex-h justify-end\">\r\n <cw-button\r\n [type]=\"buttonType.dangerOutline\"\r\n [label]=\"'_COMMON._IMPORT.STOP'\"\r\n [dataTest]=\"'btn-import-stop'\"\r\n (btnAction)=\"stopImport()\">\r\n </cw-button>\r\n </div>\r\n }\r\n }\r\n @else if (cancelling()) {\r\n <!-- Annulation demandee au serveur, reponse en attente. Cible de focus. -->\r\n <span tabindex=\"-1\" #cancellingStatus>{{ '_COMMON._IMPORT.CANCELLING' | translate }}</span>\r\n\r\n <cw-loader [size]=\"loaderSize.sm\" [displayText]=\"false\"></cw-loader>\r\n\r\n <!-- Sortie de secours : aucun delai n'etant defendable depuis la lib, c'est\r\n l'utilisateur qui decide d'arreter d'attendre. Conclut en \u00AB etat incertain \u00BB. -->\r\n <div class=\"d-flex-h justify-end\">\r\n <cw-button\r\n [type]=\"buttonType.secondary\"\r\n [label]=\"'_COMMON._IMPORT.STOP_WAITING'\"\r\n [dataTest]=\"'btn-import-stop-waiting'\"\r\n (btnAction)=\"stopWaiting()\">\r\n </cw-button>\r\n </div>\r\n }\r\n @else if (interruptionMessageKey(); as interruptionMessage) {\r\n <h3 class=\"visually-hidden\" tabindex=\"-1\" #interruptedOutcome>\r\n {{ '_COMMON._IMPORT._A11Y.IMPORT_RESULT' | translate }}\r\n </h3>\r\n\r\n <cw-alert [type]=\"interruptionAlertType()\">\r\n {{ interruptionMessage | translate }}\r\n </cw-alert>\r\n }\r\n @else if (report(); as result) {\r\n <h3 class=\"visually-hidden\" tabindex=\"-1\" #reportOutcome>\r\n {{ '_COMMON._IMPORT._A11Y.IMPORT_RESULT' | translate }}\r\n </h3>\r\n\r\n @if (result.success) {\r\n <cw-alert [type]=\"alertType.success\">\r\n {{ '_COMMON._IMPORT.SUCCESS' | translate }}\r\n </cw-alert>\r\n\r\n @if (isList() && reportRows().length) {\r\n <ng-container *ngTemplateOutlet=\"counts; context: { rows: reportRows() }\"></ng-container>\r\n }\r\n }\r\n @else {\r\n <!-- Le message generique ne promet l'absence d'ecriture que si l'atomicite est\r\n declaree (cf. `failureMessageKey`). -->\r\n <cw-alert [type]=\"alertType.danger\">\r\n {{ result.errorMessage ?? (failureMessageKey() | translate) }}\r\n </cw-alert>\r\n }\r\n }\r\n </div>\r\n </cw-card>\r\n\r\n</cw-accordion>\r\n", dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$2.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "ngmodule", type: TranslateModule }, { kind: "component", type: AccordionComponent, selector: "cw-accordion", inputs: ["closeOthers", "allowMultiple", "destroyOnHide"], outputs: ["panelOpened", "panelClosed"] }, { kind: "component", type: AlertComponent, selector: "cw-alert", inputs: ["type", "title", "titleParams", "isDismissible", "cssClass", "dataTest", "live"], outputs: ["close"] }, { kind: "component", type: ButtonComponent, selector: "cw-button", inputs: ["type", "label", "labelParams", "id", "link", "isDropdown", "hideCaret", "withIcon", "withOnlyIcon", "iconSize", "iconPosition", "dropdownPosition", "isMinWidth", "isDisabled", "isLoading", "loadingAnnounce", "cssClass", "dataTest", "skeletonMode", "isPressed", "ariaDescribedBy", "ariaLabel", "ariaExpanded", "ariaControls", "withTooltip", "tooltipText", "tooltipTitle", "tooltipTrigger", "tooltipPosition", "tooltipType"], outputs: ["btnAction", "dropDownClicked"] }, { kind: "component", type: CardComponent, selector: "cw-card", inputs: ["title", "titleId", "subtitle", "truncateSubtitle", "type", "titleRank", "cssClass", "collapsible", "collapsed", "disabled", "collapseLocked", "collapseStretched", "collapseId", "destroyOnHide", "fullHeight"], outputs: ["collapsibleChange", "destroyOnHideChange", "collapseClicked"] }, { kind: "component", type: FileDropComponent, selector: "cw-file-drop", inputs: ["mode", "multiple", "maxFiles", "accept", "acceptLabel", "maxSizeMb", "recommendedDimensions", "label", "isDisabled", "errorMessage", "dataTest"], outputs: ["filesChange", "rejected", "retry"] }, { kind: "component", type: FileToDownloadComponent, selector: "cw-file-to-download", inputs: ["attachments"] }, { kind: "component", type: FormFieldComponent, selector: "cw-form-field", inputs: ["control", "formGroup", "type", "label", "displayLabel", "fieldTitle", "name", "placeholder", "autocomplete", "options", "rangeOptions", "validationOptions", "autocompleteOptions", "richTextOptions", "errorMessages", "isRequired", "requiredStart", "requiredEnd", "help", "helpParams", "tooltip", "ariaDescribedBy", "addonLeft", "addonRight", "isInAddon", "isReadonly", "isDisabled", "sliderValue", "sliderOptions", "cssClass", "skeletonMode", "clearable", "appendTo", "initialCountry", "recommendedDimensions", "showPreview", "existingFile", "indeterminate"], outputs: ["refreshEvent", "fileRemoved", "textChanged", "valueChange", "phoneRegionChange"] }, { kind: "component", type: IconComponent, selector: "cw-icon", inputs: ["icon", "text", "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 }); }
|
|
2518
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.20", type: ImportWizardComponent, isStandalone: true, selector: "cw-import-wizard", inputs: { config: { classPropertyName: "config", publicName: "config", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { completed: "completed" }, host: { classAttribute: "cw-import-wizard" }, viewQueries: [{ propertyName: "panels", predicate: ["stepPanel"], descendants: true, read: CardComponent, isSignal: true }, { propertyName: "selectionTarget", first: true, predicate: ["selectionTarget"], descendants: true, isSignal: true }, { propertyName: "analysisStatus", first: true, predicate: ["analysisStatus"], descendants: true, isSignal: true }, { propertyName: "analysisOutcome", first: true, predicate: ["analysisOutcome"], descendants: true, isSignal: true }, { propertyName: "executionStatus", first: true, predicate: ["executionStatus"], descendants: true, isSignal: true }, { propertyName: "cancellingStatus", first: true, predicate: ["cancellingStatus"], descendants: true, isSignal: true }, { propertyName: "reportOutcome", first: true, predicate: ["reportOutcome"], descendants: true, isSignal: true }, { propertyName: "interruptedOutcome", first: true, predicate: ["interruptedOutcome"], descendants: true, isSignal: true }], ngImport: i0, template: "<!-- Pastille d'etape : icone ronde verte (terminee) / rouge (echec), sinon le numero.\r\n Rendue dans [header-start] pour etre AVANT le titre, comme sur les maquettes.\r\n Le numero seul n'etant pas parlant a l'oreille, le statut est double en visually-hidden --\r\n et c'est LUI qui distingue \u00AB en cours \u00BB de \u00AB a venir \u00BB pour qui ne voit pas la couleur. -->\r\n<ng-template #badge let-stepKey=\"stepKey\" let-number=\"number\">\r\n @if (stateOf(stepKey) === stepState.done) {\r\n <cw-icon [icon]=\"spriteIcon.check\" [type]=\"iconType.circular\" [iconSize]=\"iconSize['sm']\"\r\n [iconUiType]=\"iconUiType.success\" [label]=\"stepStatusLabel(stepKey) | translate\"></cw-icon>\r\n }\r\n @else if (stateOf(stepKey) === stepState.error) {\r\n <cw-icon [icon]=\"spriteIcon.close\" [type]=\"iconType.circular\" [iconSize]=\"iconSize['sm']\"\r\n [iconUiType]=\"iconUiType.danger\" [label]=\"stepStatusLabel(stepKey) | translate\"></cw-icon>\r\n }\r\n @else {\r\n <div class=\"icon-circular icon-circular-sm\" [class]=\"'icon-circular-' + badgeVariant(stepKey)\">\r\n <span aria-hidden=\"true\">{{ number }}</span>\r\n <span class=\"visually-hidden\">{{ stepStatusLabel(stepKey) | translate }}</span>\r\n </div>\r\n }\r\n</ng-template>\r\n\r\n<ng-template #counts let-rows=\"rows\">\r\n <ul class=\"list-unstyled d-flex-h gap-md\">\r\n @for (row of rows; track row.key) {\r\n <li>\r\n <span class=\"fs-lg fw-bold\" [class]=\"'text-' + row.tone\">{{ row.count }}</span> {{ row.key | translate: row.params }}\r\n </li>\r\n }\r\n </ul>\r\n</ng-template>\r\n\r\n<cw-accordion [closeOthers]=\"true\" [destroyOnHide]=\"false\">\r\n\r\n <!-- Etape 1 : fichier + type d'import -->\r\n <cw-card\r\n #stepPanel\r\n [title]=\"'_COMMON._IMPORT._STEP.SELECT'\"\r\n [collapseId]=\"'import-step-select'\"\r\n [collapsed]=\"!isPanelOpen(step.select)\"\r\n [collapseLocked]=\"stateOf(step.select) === stepState.done\"\r\n [disabled]=\"stateOf(step.select) === stepState.todo\"\r\n [collapseStretched]=\"false\">\r\n\r\n <ng-container ngProjectAs=\"[header-start]\">\r\n <ng-container *ngTemplateOutlet=\"badge; context: { stepKey: step.select, number: 1 }\"></ng-container>\r\n </ng-container>\r\n\r\n <div class=\"d-flex-v gap-md\">\r\n <div class=\"row\">\r\n <div class=\"col-lg-6\">\r\n <!-- Retour depuis une analyse non conforme : cible de focus. Le bouton qui declenche\r\n ce retour disparait avec le repli du panneau 2, le focus retomberait sur <body>. -->\r\n @if (selectionReopened()) {\r\n <h3 class=\"visually-hidden\" tabindex=\"-1\" #selectionTarget>\r\n {{ '_COMMON._IMPORT._A11Y.SELECTION' | translate }}\r\n </h3>\r\n }\r\n\r\n <cw-file-drop\r\n [formControl]=\"file\"\r\n [accept]=\"config().accept\"\r\n [acceptLabel]=\"config().acceptLabel\"\r\n [maxSizeMb]=\"maxSizeMb()\"\r\n [label]=\"'_COMMON._IMPORT.FILE_TO_IMPORT' | translate\">\r\n </cw-file-drop>\r\n\r\n @if (config().helpText; as helpText) {\r\n <p class=\"mt-2xs\">{{ helpText | translate }}</p>\r\n }\r\n </div>\r\n\r\n @if (config().templateFile) {\r\n <div class=\"col-lg-6\">\r\n <cw-card [type]=\"cardType.light\">\r\n <strong>{{ '_COMMON._IMPORT._TEMPLATE.TITLE' | translate }}</strong>\r\n <span>{{ '_COMMON._IMPORT._TEMPLATE.TEXT' | translate }}</span>\r\n <cw-file-to-download [attachments]=\"templateAttachments()\"></cw-file-to-download>\r\n </cw-card>\r\n </div>\r\n }\r\n </div>\r\n\r\n <!-- Mode IMPOSE : aucun champ, et pas davantage de ligne \u00AB Type d'import : ... \u00BB \u2014 la\r\n maquette ne rend que l'alerte de portee ci-dessous, qui informe deja du mode retenu.\r\n Le champ cle de rapprochement y est replie (voir l'alerte).\r\n Choix LIBRE : groupe radio, dont la selection est REQUISE (pas de preselection). -->\r\n @if (!isModeImposed()) {\r\n <cw-form-field\r\n [type]=\"fieldType.radio\"\r\n [control]=\"mode\"\r\n [name]=\"'importMode'\"\r\n [label]=\"'_COMMON._IMPORT._MODE.LABEL'\"\r\n [options]=\"modeOptions()\"\r\n [isRequired]=\"true\"\r\n [help]=\"selectedKeyFieldHint()\">\r\n </cw-form-field>\r\n }\r\n\r\n <!-- Portee du mode retenu (destructif ou non) : exigence SFD \u00AB l'utilisateur est\r\n informe du type d'import selectionne ou impose \u00BB. Rien tant qu'aucun mode n'est\r\n retenu : l'alerte ne decrit jamais un mode que l'utilisateur n'a pas choisi. -->\r\n @if (modeNotice(); as notice) {\r\n <cw-alert [type]=\"modeNoticeType()\">\r\n {{ notice.lead | translate }}\r\n @if (notice.items.length) {\r\n <ul class=\"mb-none\">\r\n @for (item of notice.items; track $index) {\r\n <li>{{ item | translate }}</li>\r\n }\r\n </ul>\r\n }\r\n <!-- Mode impose : l'alerte est le SEUL endroit qui reste pour dire sur quoi porte\r\n le rapprochement. En choix libre, c'est l'aide du groupe radio qui le porte. -->\r\n @if (isModeImposed() && selectedKeyFieldHint(); as keyFieldHint) {\r\n <p class=\"mb-none\">{{ keyFieldHint | translate }}</p>\r\n }\r\n </cw-alert>\r\n }\r\n\r\n <!-- Un bouton desactive muet est un cul-de-sac : ce texte dit ce qui manque, et il est\r\n place AVANT le bouton, seul chemin possible puisqu'un bouton desactive n'est pas\r\n focusable (donc pas d'aria-describedby exploitable). Pas de classe de couleur\r\n atenuee : c'est une information necessaire, elle garde le contraste du corps. -->\r\n <div class=\"d-flex-h justify-end gap-md\">\r\n @if (missingRequirementKey(); as missing) {\r\n <p class=\"mb-none fs-xs\">{{ missing | translate }}</p>\r\n }\r\n\r\n <cw-button\r\n [type]=\"buttonType.primary\"\r\n [label]=\"'_COMMON._IMPORT.CONTINUE'\"\r\n [dataTest]=\"'btn-import-continue'\"\r\n [isDisabled]=\"!canContinue()\"\r\n (btnAction)=\"continueToAnalysis()\">\r\n </cw-button>\r\n </div>\r\n </div>\r\n </cw-card>\r\n\r\n <!-- Etape 2 : analyse a blanc -->\r\n <cw-card\r\n #stepPanel\r\n [title]=\"'_COMMON._IMPORT._STEP.ANALYSIS'\"\r\n [collapseId]=\"'import-step-analysis'\"\r\n [collapsed]=\"!isPanelOpen(step.analysis)\"\r\n [collapseLocked]=\"stateOf(step.analysis) === stepState.done\"\r\n [disabled]=\"stateOf(step.analysis) === stepState.todo\"\r\n [collapseStretched]=\"false\">\r\n\r\n <ng-container ngProjectAs=\"[header-start]\">\r\n <ng-container *ngTemplateOutlet=\"badge; context: { stepKey: step.analysis, number: 2 }\"></ng-container>\r\n </ng-container>\r\n\r\n <div class=\"d-flex-v gap-md\">\r\n @if (analyzing()) {\r\n <!-- Cible de focus : ce texte EST le message d'etat, il est donc lu une fois et une\r\n seule (aucune region live en doublon). -->\r\n <span tabindex=\"-1\" #analysisStatus>{{ '_COMMON._IMPORT.ANALYSIS_IN_PROGRESS' | translate }}</span>\r\n }\r\n @else if (analysis(); as result) {\r\n <!-- Cible de focus a l'arrivee du resultat : libelle de section, pas une reprise du\r\n message, pour que la lecture enchaine sur l'alerte puis les compteurs. -->\r\n <h3 class=\"visually-hidden\" tabindex=\"-1\" #analysisOutcome>\r\n {{ '_COMMON._IMPORT._A11Y.ANALYSIS_RESULT' | translate }}\r\n </h3>\r\n\r\n @if (result.valid) {\r\n <cw-alert [type]=\"alertType.success\">\r\n {{ '_COMMON._IMPORT.ANALYSIS_OK' | translate }}\r\n </cw-alert>\r\n\r\n <!-- scope=list : previsualisation chiffree. scope=singleConfig : le message ci-dessus suffit. -->\r\n @if (isList() && previewRows().length) {\r\n <ng-container *ngTemplateOutlet=\"counts; context: { rows: previewRows() }\"></ng-container>\r\n }\r\n\r\n <div class=\"list-unstyled d-flex-h justify-end\">\r\n <cw-button\r\n [type]=\"buttonType.primary\"\r\n [label]=\"'_COMMON._IMPORT.START'\"\r\n [dataTest]=\"'btn-import-start'\"\r\n (btnAction)=\"startImport()\">\r\n </cw-button>\r\n </div>\r\n }\r\n @else {\r\n <cw-alert [type]=\"alertType.danger\">\r\n {{ '_COMMON._IMPORT.ANALYSIS_KO' | translate }}\r\n </cw-alert>\r\n\r\n @if (errorCountRow(); as errorCount) {\r\n <p class=\"mb-none\">\r\n <span class=\"fs-lg fw-bold\" [class]=\"'text-' + errorCount.tone\">{{ errorCount.count }}</span>\r\n {{ errorCount.key | translate }}\r\n </p>\r\n\r\n <!-- Une alerte par anomalie, et non une liste a puces : c'est le rendu de la\r\n maquette, et chaque message reste lisible isolement. -->\r\n @for (issue of errors(); track $index) {\r\n <cw-alert [type]=\"alertType.danger\">\r\n @if (issue.line !== undefined) {\r\n <strong>{{ '_COMMON._IMPORT.ERROR_LINE' | translate: { line: issue.line } }}</strong>\r\n }\r\n {{ issue.messageKey ? (issue.messageKey | translate: issue.messageParams) : issue.message }}\r\n </cw-alert>\r\n }\r\n }\r\n\r\n <div class=\"d-flex-h justify-end\">\r\n <cw-button\r\n [type]=\"buttonType.secondary\"\r\n [label]=\"'_COMMON._IMPORT.BACK_TO_SELECTION'\"\r\n [dataTest]=\"'btn-import-back'\"\r\n (btnAction)=\"backToSelection()\">\r\n </cw-button>\r\n </div>\r\n }\r\n }\r\n </div>\r\n </cw-card>\r\n\r\n <!-- Etape 3 : import -->\r\n <cw-card\r\n #stepPanel\r\n [title]=\"'_COMMON._IMPORT._STEP.EXECUTION'\"\r\n [collapseId]=\"'import-step-execution'\"\r\n [collapsed]=\"!isPanelOpen(step.execution)\"\r\n [disabled]=\"stateOf(step.execution) === stepState.todo\"\r\n [collapseStretched]=\"false\">\r\n\r\n <ng-container ngProjectAs=\"[header-start]\">\r\n <ng-container *ngTemplateOutlet=\"badge; context: { stepKey: step.execution, number: 3 }\"></ng-container>\r\n </ng-container>\r\n\r\n <div class=\"d-flex-v gap-md\">\r\n @if (isImporting) {\r\n <div class=\"d-flex-v gap-2xs\">\r\n <!-- Cible de focus. Le bouton \u00AB Arreter l'import \u00BB est le focusable suivant. -->\r\n <span tabindex=\"-1\" #executionStatus>{{ '_COMMON._IMPORT.IN_PROGRESS' | translate }}</span>\r\n @if (progress()?.remainingLabel; as remaining) {\r\n <span>{{ '_COMMON._IMPORT.REMAINING' | translate: { value: remaining } }}</span>\r\n }\r\n </div>\r\n\r\n <!-- Avancement connu => barre deterministe. Aucune progression recue => spinner\r\n indetermine, plutot qu'une barre figee a 0 %. La bascule se fait a la premiere\r\n emission `ImportProgress` : une source qui n'en emet jamais reste sur le spinner.\r\n `displayText` a false : le libelle \u00AB Import en cours \u00BB est deja au-dessus. -->\r\n @if (progress(); as current) {\r\n <cw-progress-bar\r\n [value]=\"current.percent\"\r\n [type]=\"progressType.information\"\r\n [label]=\"'_COMMON._IMPORT.IN_PROGRESS' | translate\">\r\n </cw-progress-bar>\r\n }\r\n @else {\r\n <cw-loader [size]=\"loaderSize.sm\" [displayText]=\"false\"></cw-loader>\r\n }\r\n\r\n <!-- Pas de bouton d'arret quand l'objet declare l'import non interruptible : un\r\n bouton qui ne peut rien arreter serait pire que son absence. -->\r\n @if (canInterrupt()) {\r\n <div class=\"d-flex-h justify-end\">\r\n <cw-button\r\n [type]=\"buttonType.dangerOutline\"\r\n [label]=\"'_COMMON._IMPORT.STOP'\"\r\n [dataTest]=\"'btn-import-stop'\"\r\n (btnAction)=\"stopImport()\">\r\n </cw-button>\r\n </div>\r\n }\r\n }\r\n @else if (cancelling()) {\r\n <!-- Annulation demandee au serveur, reponse en attente. Cible de focus. -->\r\n <span tabindex=\"-1\" #cancellingStatus>{{ '_COMMON._IMPORT.CANCELLING' | translate }}</span>\r\n\r\n <cw-loader [size]=\"loaderSize.sm\" [displayText]=\"false\"></cw-loader>\r\n\r\n <!-- Sortie de secours : aucun delai n'etant defendable depuis la lib, c'est\r\n l'utilisateur qui decide d'arreter d'attendre. Conclut en \u00AB etat incertain \u00BB. -->\r\n <div class=\"d-flex-h justify-end\">\r\n <cw-button\r\n [type]=\"buttonType.secondary\"\r\n [label]=\"'_COMMON._IMPORT.STOP_WAITING'\"\r\n [dataTest]=\"'btn-import-stop-waiting'\"\r\n (btnAction)=\"stopWaiting()\">\r\n </cw-button>\r\n </div>\r\n }\r\n @else if (interruptionMessageKey(); as interruptionMessage) {\r\n <h3 class=\"visually-hidden\" tabindex=\"-1\" #interruptedOutcome>\r\n {{ '_COMMON._IMPORT._A11Y.IMPORT_RESULT' | translate }}\r\n </h3>\r\n\r\n <cw-alert [type]=\"interruptionAlertType()\">\r\n {{ interruptionMessage | translate }}\r\n </cw-alert>\r\n }\r\n @else if (report(); as result) {\r\n <h3 class=\"visually-hidden\" tabindex=\"-1\" #reportOutcome>\r\n {{ '_COMMON._IMPORT._A11Y.IMPORT_RESULT' | translate }}\r\n </h3>\r\n\r\n @if (result.success) {\r\n <cw-alert [type]=\"alertType.success\">\r\n {{ '_COMMON._IMPORT.SUCCESS' | translate }}\r\n </cw-alert>\r\n\r\n @if (isList() && reportRows().length) {\r\n <ng-container *ngTemplateOutlet=\"counts; context: { rows: reportRows() }\"></ng-container>\r\n }\r\n }\r\n @else {\r\n <!-- Le message generique ne promet l'absence d'ecriture que si l'atomicite est\r\n declaree (cf. `failureMessageKey`). -->\r\n <cw-alert [type]=\"alertType.danger\">\r\n {{ result.errorMessage ?? (failureMessageKey() | translate) }}\r\n </cw-alert>\r\n }\r\n }\r\n </div>\r\n </cw-card>\r\n\r\n</cw-accordion>\r\n", dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$2.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "ngmodule", type: TranslateModule }, { kind: "component", type: AccordionComponent, selector: "cw-accordion", inputs: ["closeOthers", "allowMultiple", "destroyOnHide"], outputs: ["panelOpened", "panelClosed"] }, { kind: "component", type: AlertComponent, selector: "cw-alert", inputs: ["type", "title", "titleParams", "isDismissible", "cssClass", "dataTest", "live"], outputs: ["close"] }, { kind: "component", type: ButtonComponent, selector: "cw-button", inputs: ["type", "label", "labelParams", "id", "link", "isDropdown", "hideCaret", "withIcon", "withOnlyIcon", "iconSize", "iconPosition", "dropdownPosition", "isMinWidth", "isDisabled", "isLoading", "loadingAnnounce", "cssClass", "dataTest", "skeletonMode", "isPressed", "ariaDescribedBy", "ariaLabel", "ariaExpanded", "ariaControls", "withTooltip", "tooltipText", "tooltipTitle", "tooltipTrigger", "tooltipPosition", "tooltipType"], outputs: ["btnAction", "dropDownClicked"] }, { kind: "component", type: CardComponent, selector: "cw-card", inputs: ["title", "titleId", "subtitle", "truncateSubtitle", "type", "titleRank", "cssClass", "collapsible", "collapsed", "disabled", "collapseLocked", "collapseStretched", "collapseId", "destroyOnHide", "fullHeight"], outputs: ["collapsibleChange", "destroyOnHideChange", "collapseClicked"] }, { kind: "component", type: FileDropComponent, selector: "cw-file-drop", inputs: ["mode", "multiple", "maxFiles", "accept", "acceptLabel", "maxSizeMb", "recommendedDimensions", "label", "isDisabled", "errorMessage", "dataTest"], outputs: ["filesChange", "rejected", "retry"] }, { kind: "component", type: FileToDownloadComponent, selector: "cw-file-to-download", inputs: ["attachments"] }, { kind: "component", type: FormFieldComponent, selector: "cw-form-field", inputs: ["control", "formGroup", "type", "label", "displayLabel", "fieldTitle", "name", "placeholder", "autocomplete", "options", "rangeOptions", "validationOptions", "autocompleteOptions", "richTextOptions", "errorMessages", "isRequired", "requiredStart", "requiredEnd", "periodShortcuts", "help", "helpParams", "tooltip", "ariaDescribedBy", "addonLeft", "addonRight", "isInAddon", "isReadonly", "isDisabled", "sliderValue", "sliderOptions", "cssClass", "skeletonMode", "clearable", "appendTo", "initialCountry", "recommendedDimensions", "showPreview", "existingFile", "indeterminate"], outputs: ["refreshEvent", "fileRemoved", "textChanged", "valueChange", "phoneRegionChange"] }, { kind: "component", type: IconComponent, selector: "cw-icon", inputs: ["icon", "text", "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 }); }
|
|
2513
2519
|
}
|
|
2514
2520
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: ImportWizardComponent, decorators: [{
|
|
2515
2521
|
type: Component,
|