@cityway/bo-ui 1.1.0-beta018 → 1.1.0-beta019

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.
Binary file
@@ -10,6 +10,7 @@
10
10
  En-tête de page transverse du back-office. Couvre :
11
11
 
12
12
  - **titre** de page (`<h1>`) + **description** optionnelle ;
13
+ - **badge de portée** (instance ou toutes les instances) à côté du titre, piloté par injection (§2 ter) ;
13
14
  - **bouton retour** (navigue via `Location.back()`) ;
14
15
  - une barre d'**actions normalisées** (Ajouter, Enregistrer, Réinitialiser) déclarées par configuration ;
15
16
  - deux **slots dédiés** pour l'import et l'export, aux positions attendues (§2 bis) ;
@@ -32,6 +33,7 @@ En-tête de page transverse du back-office. Couvre :
32
33
  | `actions` | `PageHeaderActionEnum[]` | `[]` | Liste des actions à afficher. Voir enum §3. L'ordre d'affichage est imposé par le template (cf. §5). |
33
34
  | `isLoading` | `PageHeaderActionState` | `{}` | Map action → `boolean` ; passe l'action en état chargement. |
34
35
  | `isDisabled` | `PageHeaderActionState` | `{}` | Map action → `boolean` ; désactive l'action. |
36
+ | `showScope` | `boolean` | `true` | Affiche le badge de portée à côté du titre (§2 ter). Opt-out pour une page qui porte elle-même sa portée. Sans provider de portée, aucun badge, quelle que soit la valeur. |
35
37
  | `columns` | `TableColumn[]` | `[]` | Colonnes du tableau associé. **Fourni → un menu déroulant « Colonnes » apparaît** (cases à cocher afficher/masquer). Voir §6 bis. |
36
38
  | `storageKey` | `string` | — | Identifiant **stable** du tableau pour persister l'état en localStorage (ex. `'users/list'`). Sans clé : le menu fonctionne mais l'état n'est pas mémorisé. |
37
39
  | `columnsLabel` | `string` | `_COMMON._TABLE.COLUMNS` | Clé i18n du libellé du bouton « Colonnes ». |
@@ -79,6 +81,57 @@ d'export — sans passer par le contrat `ExportPayload` — y pose son propre `c
79
81
 
80
82
  ---
81
83
 
84
+ ## 2 ter. Portée de la page (token `CW_PAGE_SCOPE`)
85
+
86
+ Le page-header affiche la portée d'action de la page : l'**instance** sélectionnée (badge
87
+ avec son logo et son nom) ou **toutes les instances** (`cw-badge` `light-info`). La lib ne connaît ni le
88
+ routeur ni la notion d'instance : elle lit un `Signal<CwPageScope | null>` fourni par injection,
89
+ **une seule fois**, dans `app.config` :
90
+
91
+ ```ts
92
+ // app.config.ts
93
+ import { provideCwPageScope } from '@cityway/bo-ui';
94
+
95
+ export const appConfig: ApplicationConfig = {
96
+ providers: [
97
+ // La factory s'exécute dans un contexte d'injection : inject() y est autorisé.
98
+ provideCwPageScope(() => inject(PageScopeService).cwPageScope),
99
+ ],
100
+ };
101
+ ```
102
+
103
+ ```ts
104
+ type CwPageScope =
105
+ | {
106
+ kind: 'instance';
107
+ label: string; // nom de l'instance, donnée brute (jamais traduite)
108
+ imageUrl?: string | null; // logo : SVG recommandé ; absent → icône poiCompany
109
+ }
110
+ | { kind: 'global' };
111
+ ```
112
+
113
+ | Valeur du signal | Rendu |
114
+ |------------------|-------|
115
+ | *pas de provider* ou `null` | rien (comportement antérieur, aucun changement pour les BO qui n'ont pas de notion d'instance) |
116
+ | `{ kind: 'instance', label, imageUrl? }` | badge d'instance : logo `imageUrl` en 16 px (`<img alt="">`, décoratif) ou icône `poiCompany`, puis le nom brut, précédé de `_COMMON._PAGE_SCOPE.INSTANCE_PREFIX` réservé aux lecteurs d'écran |
117
+ | `{ kind: 'global' }` | `cw-badge` `light-info`, icône `mapWorld` (globe) + `_COMMON._PAGE_SCOPE.ALL_INSTANCES` ; et, si l'action `save` est affichée, rappel `_COMMON._PAGE_SCOPE.GLOBAL_SAVE_REMINDER` sous la barre d'actions |
118
+
119
+ **Badge global** : `cw-badge` (basic-ui) utilisé tel quel.
120
+
121
+ **Badge d'instance** : badge maison, parce que `cw-badge` n'accepte pas d'image et que sa
122
+ variante `light-light` se confond avec le fond de page en clair. Il reprend la classe `.badge`
123
+ de basic-ui (hauteur, padding, rayon, typo identiques au badge global) et ne change que les
124
+ couleurs, dans `_page-header.scss` (`.page-header-scope-instance`, `.page-header-scope-logo`) :
125
+
126
+ - fond gris un cran plus foncé que le body (`--cw-surface-main`) : `--cw-border-default` (`#e6edf2` en clair,
127
+ `#21303a` en sombre), seul neutre DS plus foncé que le body dans les deux thèmes ; pas de bordure ;
128
+ - texte `--cw-text-default` : contraste 14,49:1 en clair, 13,23:1 en sombre.
129
+
130
+ Le nom n'est pas tronqué : un nom très long passe à la ligne sous le titre
131
+ (`.page-header-heading` est en `flex-wrap`).
132
+
133
+ ---
134
+
82
135
  ## 3. Enums & Types
83
136
 
84
137
  ```ts
@@ -219,6 +272,9 @@ Règles :
219
272
  - **Bouton retour** : navigue via `Location.back()` (historique du navigateur). Aucune sortie ni cible configurable ; masquer avec `[showBack]="false"` si non pertinent.
220
273
  - **États par action** : `isLoading` / `isDisabled` sont des maps partielles ; une action absente de la map vaut `false`.
221
274
  - **Dépendance** : le composant projette des `cw-button` (`@cityway/basic-ui`) en interne — `basic-ui` doit être disponible.
275
+ - **Badge de portée** : placé à côté du `<h1>`, **hors** du `<h1>` (dans `.page-header-heading`). Le nom accessible du titre reste exactement le titre ; le badge est lu après lui (« Instance : PFP2 », le préfixe étant réservé aux lecteurs d'écran).
276
+ - **Rappel de portée globale** : affiché **uniquement** si la portée est `global` **et** que `save` fait partie des `actions`. Il est rendu sous la barre d'actions, aligné à droite, avec un `id` généré (`cw-page-header-scope-reminder-N`). `cw-button` n'exposant pas encore d'`aria-describedby`, le bouton Enregistrer n'y est pas relié : le rappel est lu dans le flux de la page.
277
+ - **Ordre des actions** : le badge et le rappel ne sont pas dans `.page-header-actions` ; l'ordre ci-dessus est inchangé.
222
278
 
223
279
  ---
224
280
 
@@ -235,4 +291,5 @@ Règles :
235
291
  - Exposer `PageHeaderActionEnum` comme propriété du composant pour la binder dans le template (`actionEnum = PageHeaderActionEnum`).
236
292
  - Utiliser des clés i18n pour `title` et `description` ; les libellés des actions sont fixes (clés `_COMMON._ACTION.*`).
237
293
  - Piloter `isLoading` / `isDisabled` via des objets `{ [action]: boolean }` plutôt que des flags séparés.
294
+ - **Portée** : fournir `provideCwPageScope(...)` **une fois** dans `app.config` ; ne jamais poser le badge de portée à la main ni recréer le rappel « toutes les instances ». Pour masquer le badge sur une page qui affiche déjà sa portée : `[showScope]="false"`.
238
295
  - **L'import et l'export ne sont pas des `actions`** : projeter `<cw-import-button cwPageHeaderImport>` et `<cw-export-button cwPageHeaderExport>` (cf. `import-button.md`, `export-button.md`). Ne jamais réintroduire ces valeurs dans `PageHeaderActionEnum`.
package/docs/i18n.md CHANGED
@@ -21,6 +21,7 @@ Racine `_COMMON`, identique à celle de basic-ui : **les chemins de clés sont i
21
21
  |--------|------|-----------|
22
22
  | `_COMMON._TABLE.*` | `CAPTION`, `NO_RESULT`, `COLUMNS`, `ACTIONS_MENU`, `EXPORT_CURRENT`, `EXPORT_ALL`, `_SORT.*`, `_THEAD.*`, `_BULK_ACTION.*` | `cw-table`, `cw-page-header` |
23
23
  | `_COMMON._PAGINATION.*` | `DISPLAY`, `ITEMS_PER_PAGE`, `FIRST`, `PREVIOUS`, `NEXT`, `LAST`, `PAGE`, `CURRENT_PAGE` | `cw-pagination` |
24
+ | `_COMMON._PAGE_SCOPE.*` | `INSTANCE_PREFIX`, `ALL_INSTANCES`, `GLOBAL_SAVE_REMINDER` | `cw-page-header` |
24
25
  | `_COMMON._STEPPER.*` | `STEP`, `PREVIOUS_STEP`, `NEXT_STEP` | `cw-wizard-stepper` |
25
26
  | `_COMMON.MAX_ITEMS_REACHED`, `MAX_RESTORE_BLOCKED` | — | `cw-drag-n-drop-list`, `cw-drag-n-drop-nested-list` |
26
27
 
@@ -1,5 +1,5 @@
1
1
  import * as i0 from '@angular/core';
2
- import { input, ChangeDetectionStrategy, Component, output, effect, signal, computed, untracked, isDevMode, inject, contentChild, isSignal, DestroyRef, viewChildren, viewChild, afterRenderEffect, afterNextRender, contentChildren } from '@angular/core';
2
+ import { input, ChangeDetectionStrategy, Component, output, effect, signal, computed, untracked, isDevMode, inject, contentChild, isSignal, DestroyRef, viewChildren, viewChild, afterRenderEffect, InjectionToken, makeEnvironmentProviders, afterNextRender, contentChildren } from '@angular/core';
3
3
  import * as i1 from '@ngx-translate/core';
4
4
  import { TranslateModule, TranslateService } from '@ngx-translate/core';
5
5
  import * as i1$3 from '@angular/common';
@@ -2021,6 +2021,23 @@ var PageHeaderActionEnum;
2021
2021
  PageHeaderActionEnum["reset"] = "reset";
2022
2022
  })(PageHeaderActionEnum || (PageHeaderActionEnum = {}));
2023
2023
 
2024
+ /**
2025
+ * Portée courante lue par `cw-page-header`. La lib ne connait ni le routeur ni la notion
2026
+ * d'instance : elle affiche ce que le consommateur fournit via `provideCwPageScope`.
2027
+ */
2028
+ const CW_PAGE_SCOPE = new InjectionToken('CW_PAGE_SCOPE', {
2029
+ providedIn: 'root',
2030
+ // Sans provider : aucun badge. La lib reste utilisable telle quelle par les autres BO.
2031
+ factory: () => signal(null).asReadonly(),
2032
+ });
2033
+ /**
2034
+ * Fournit la portée courante, une seule fois dans `app.config`. `factory` s'exécute dans un
2035
+ * contexte d'injection : elle peut appeler `inject()` (routeur, service d'instance).
2036
+ */
2037
+ function provideCwPageScope(factory) {
2038
+ return makeEnvironmentProviders([{ provide: CW_PAGE_SCOPE, useFactory: factory }]);
2039
+ }
2040
+
2024
2041
  // Persistance de la visibilite des colonnes de `cw-table` (pilotee par `cw-page-header`).
2025
2042
  // Une SEULE cle localStorage pour N tableaux : objet indexe par `storageKey`.
2026
2043
  // On ne stocke QUE les cles des colonnes MASQUEES (eviter de surcharger le localStorage).
@@ -2073,15 +2090,21 @@ function saveHiddenColumns(storageKey, hiddenKeys) {
2073
2090
  }
2074
2091
  }
2075
2092
 
2093
+ /** Compteur de module pour l'id du rappel de portee (pas de `crypto.randomUUID`, cf. ESLint). */
2094
+ let nextReminderId = 0;
2076
2095
  class PageHeaderComponent {
2077
2096
  constructor() {
2078
2097
  this.location = inject(Location);
2098
+ /** Portee courante fournie par l'app (`provideCwPageScope`) ; `null` sans provider. */
2099
+ this.pageScope = inject(CW_PAGE_SCOPE);
2079
2100
  this.title = input.required(...(ngDevMode ? [{ debugName: "title" }] : []));
2080
2101
  this.description = input(...(ngDevMode ? [undefined, { debugName: "description" }] : []));
2081
2102
  this.showBack = input(true, ...(ngDevMode ? [{ debugName: "showBack" }] : []));
2082
2103
  this.actions = input([], ...(ngDevMode ? [{ debugName: "actions" }] : []));
2083
2104
  this.isLoading = input({}, ...(ngDevMode ? [{ debugName: "isLoading" }] : []));
2084
2105
  this.isDisabled = input({}, ...(ngDevMode ? [{ debugName: "isDisabled" }] : []));
2106
+ /** Opt-out du badge de portee, pour une page qui porte elle-meme sa portee. */
2107
+ this.showScope = input(true, ...(ngDevMode ? [{ debugName: "showScope" }] : []));
2085
2108
  // --- Menu « Colonnes » -------------------------------------------------
2086
2109
  /** Colonnes du tableau associe. Fourni => le dropdown « Colonnes » apparait. */
2087
2110
  this.columns = input([], ...(ngDevMode ? [{ debugName: "columns" }] : []));
@@ -2094,11 +2117,18 @@ class PageHeaderComponent {
2094
2117
  this.columnsChange = output();
2095
2118
  this.buttonType = BoButtonTypeEnum;
2096
2119
  this.iconSize = ButtonIconSizeEnum;
2120
+ this.iconSizeEnum = IconSizeEnum;
2097
2121
  this.spriteIcon = SpriteIconEnum;
2098
2122
  this.actionEnum = PageHeaderActionEnum;
2123
+ /** Badge de portee globale (`light-info`) ; l'instance a son badge maison. */
2124
+ this.badgeType = BadgeTypeEnum;
2099
2125
  this.showReset = computed(() => this.actions().includes(PageHeaderActionEnum.reset), ...(ngDevMode ? [{ debugName: "showReset" }] : []));
2100
2126
  this.showAdd = computed(() => this.actions().includes(PageHeaderActionEnum.add), ...(ngDevMode ? [{ debugName: "showAdd" }] : []));
2101
2127
  this.showSave = computed(() => this.actions().includes(PageHeaderActionEnum.save), ...(ngDevMode ? [{ debugName: "showSave" }] : []));
2128
+ /** Rappel sous Enregistrer : portee globale ET action `save` affichee. */
2129
+ this.showScopeReminder = computed(() => this.showSave() && this.pageScope()?.kind === 'global', ...(ngDevMode ? [{ debugName: "showScopeReminder" }] : []));
2130
+ /** Id du rappel (cible d'un futur `aria-describedby` sur Enregistrer). */
2131
+ this.reminderId = `cw-page-header-scope-reminder-${nextReminderId++}`;
2102
2132
  /** Colonnes masquables (hors `actions` et hors `hideable === false`). */
2103
2133
  this.toggleableColumns = computed(() => this.columns().filter(c => c.type !== 'actions' && c.hideable !== false), ...(ngDevMode ? [{ debugName: "toggleableColumns" }] : []));
2104
2134
  /** Le dropdown « Colonnes » n'apparait que s'il existe au moins une colonne masquable. */
@@ -2160,15 +2190,17 @@ class PageHeaderComponent {
2160
2190
  return !!this.isDisabled()[action];
2161
2191
  }
2162
2192
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: PageHeaderComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
2163
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.20", type: PageHeaderComponent, isStandalone: true, selector: "cw-page-header", inputs: { title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: true, transformFunction: null }, description: { classPropertyName: "description", publicName: "description", isSignal: true, isRequired: false, transformFunction: null }, showBack: { classPropertyName: "showBack", publicName: "showBack", isSignal: true, isRequired: false, transformFunction: null }, actions: { classPropertyName: "actions", publicName: "actions", isSignal: true, isRequired: false, transformFunction: null }, isLoading: { classPropertyName: "isLoading", publicName: "isLoading", isSignal: true, isRequired: false, transformFunction: null }, isDisabled: { classPropertyName: "isDisabled", publicName: "isDisabled", isSignal: true, isRequired: false, transformFunction: null }, columns: { classPropertyName: "columns", publicName: "columns", isSignal: true, isRequired: false, transformFunction: null }, storageKey: { classPropertyName: "storageKey", publicName: "storageKey", isSignal: true, isRequired: false, transformFunction: null }, columnsLabel: { classPropertyName: "columnsLabel", publicName: "columnsLabel", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { action: "action", columnsChange: "columnsChange" }, ngImport: i0, template: "<div class=\"page-header d-flex-v gap-2xs\">\n @if (showBack()) {\n <cw-button [type]=\"buttonType.ghost\" [label]=\"'_COMMON._FORM.BACK'\" [withIcon]=\"spriteIcon.left1\"\n (btnAction)=\"goBack()\" />\n }\n <div class=\"d-flex-h gap-md items-start justify-between flex-wrap\">\n <div class=\"d-flex-v\">\n <h1 class=\"page-header-title\">{{ title() | translate}}</h1>\n @if (description(); as desc) {\n <p class=\"fs-md page-header-description\" [innerHTML]=\"desc | translate\"></p>\n }\n </div>\n\n <div class=\"page-header-actions d-flex-h gap-md flex-wrap items-center\">\n @if (showColumns()) {\n <cw-button [type]=\"buttonType.secondary\" [label]=\"columnsLabel()\" [withIcon]=\"spriteIcon.miscNews\"\n [isDropdown]=\"true\">\n <ul class=\"d-flex-v gap-2xs p-md\">\n @for (col of toggleableColumns(); track col.key) {\n <li class=\"field-check\">\n <input class=\"field-check-input\" type=\"checkbox\" [id]=\"'col-toggle-' + col.key\"\n [checked]=\"!col.hidden\" [disabled]=\"isLastVisible(col)\" (change)=\"toggleColumn(col)\">\n <label class=\"field-check-label\" [for]=\"'col-toggle-' + col.key\">{{ col.label | translate }}</label>\n </li>\n }\n </ul>\n </cw-button>\n }\n\n <!-- Slot de l'import : `<cw-import-button cwPageHeaderImport \u2026>`. Projete plutot que\n rendu, pour que `cw-page-header` ne reference pas `cw-import-wizard`. -->\n <ng-content select=\"[cwPageHeaderImport]\"></ng-content>\n\n <!-- Slot de l'export : `<cw-export-button cwPageHeaderExport \u2026>`. -->\n <ng-content select=\"[cwPageHeaderExport]\"></ng-content>\n\n <!-- Slot libre, inchange : tout ce qui n'est marque ni import ni export atterrit ici.\n C'est l'echappatoire d'un hote qui veut piloter son propre bouton. -->\n <ng-content></ng-content>\n\n @if (showReset()) {\n <cw-button [type]=\"buttonType.secondary\" [label]=\"'_COMMON._ACTION.RESET'\"\n [isDisabled]=\"disabled(actionEnum.reset)\" [isLoading]=\"loading(actionEnum.reset)\"\n (btnAction)=\"emit(actionEnum.reset)\">\n </cw-button>\n }\n\n @if (showAdd()) {\n <cw-button [type]=\"buttonType.primary\" [label]=\"'_COMMON._ACTION.ADD'\" [withIcon]=\"spriteIcon.add\"\n [isDisabled]=\"disabled(actionEnum.add)\" [isLoading]=\"loading(actionEnum.add)\"\n (btnAction)=\"emit(actionEnum.add)\">\n </cw-button>\n }\n\n @if (showSave()) {\n <cw-button [type]=\"buttonType.primary\" [label]=\"'_COMMON._ACTION.SAVE'\" [isDisabled]=\"disabled(actionEnum.save)\"\n [isLoading]=\"loading(actionEnum.save)\" (btnAction)=\"emit(actionEnum.save)\">\n </cw-button>\n }\n </div>\n </div>\n</div>\n", dependencies: [{ kind: "component", type: ButtonComponent, selector: "cw-button", inputs: ["type", "label", "id", "link", "isDropdown", "hideCaret", "withIcon", "withOnlyIcon", "iconSize", "iconPosition", "dropdownPosition", "isMinWidth", "isDisabled", "isLoading", "loadingAnnounce", "cssClass", "dataTest", "skeletonMode", "isPressed", "withTooltip", "tooltipText", "tooltipTitle", "tooltipTrigger", "tooltipPosition", "tooltipType"], outputs: ["btnAction", "dropDownClicked"] }, { kind: "ngmodule", type: TranslateModule }, { kind: "pipe", type: i1.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
2193
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.20", type: PageHeaderComponent, isStandalone: true, selector: "cw-page-header", inputs: { title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: true, transformFunction: null }, description: { classPropertyName: "description", publicName: "description", isSignal: true, isRequired: false, transformFunction: null }, showBack: { classPropertyName: "showBack", publicName: "showBack", isSignal: true, isRequired: false, transformFunction: null }, actions: { classPropertyName: "actions", publicName: "actions", isSignal: true, isRequired: false, transformFunction: null }, isLoading: { classPropertyName: "isLoading", publicName: "isLoading", isSignal: true, isRequired: false, transformFunction: null }, isDisabled: { classPropertyName: "isDisabled", publicName: "isDisabled", isSignal: true, isRequired: false, transformFunction: null }, showScope: { classPropertyName: "showScope", publicName: "showScope", isSignal: true, isRequired: false, transformFunction: null }, columns: { classPropertyName: "columns", publicName: "columns", isSignal: true, isRequired: false, transformFunction: null }, storageKey: { classPropertyName: "storageKey", publicName: "storageKey", isSignal: true, isRequired: false, transformFunction: null }, columnsLabel: { classPropertyName: "columnsLabel", publicName: "columnsLabel", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { action: "action", columnsChange: "columnsChange" }, ngImport: i0, template: "<div class=\"page-header d-flex-v gap-2xs\">\n @if (showBack()) {\n <cw-button [type]=\"buttonType.ghost\" [label]=\"'_COMMON._FORM.BACK'\" [withIcon]=\"spriteIcon.left1\"\n (btnAction)=\"goBack()\" />\n }\n <div class=\"d-flex-h gap-md items-start justify-between flex-wrap\">\n <div class=\"d-flex-v\">\n <!-- Badge de portee HORS du <h1> : le nom accessible du titre reste le titre. -->\n <div class=\"page-header-heading d-flex-h gap-sm flex-wrap items-center\">\n <h1 class=\"page-header-title\">{{ title() | translate}}</h1>\n @if (showScope() && pageScope(); as scope) {\n @if (scope.kind === 'instance') {\n <!-- Badge maison : structure `.badge` de basic-ui, couleurs et logo propres (cf. _page-header.scss). -->\n <span class=\"badge page-header-scope-instance\">\n @if (scope.imageUrl; as img) {\n <img class=\"page-header-scope-logo\" [src]=\"img\" alt=\"\" />\n } @else {\n <cw-icon [icon]=\"spriteIcon.poiCompany\" aria-hidden=\"true\" />\n }\n <span class=\"visually-hidden\">{{ '_COMMON._PAGE_SCOPE.INSTANCE_PREFIX' | translate }}</span>\n <span>{{ scope.label }}</span>\n </span>\n } @else {\n <cw-badge [type]=\"badgeType.lightInfo\" [label]=\"'_COMMON._PAGE_SCOPE.ALL_INSTANCES'\"\n [withIcon]=\"spriteIcon.mapWorld\" />\n }\n }\n </div>\n @if (description(); as desc) {\n <p class=\"fs-md page-header-description\" [innerHTML]=\"desc | translate\"></p>\n }\n </div>\n\n <div class=\"d-flex-v gap-2xs\">\n <div class=\"page-header-actions d-flex-h gap-md flex-wrap items-center justify-end\">\n @if (showColumns()) {\n <cw-button [type]=\"buttonType.secondary\" [label]=\"columnsLabel()\" [withIcon]=\"spriteIcon.miscNews\"\n [isDropdown]=\"true\">\n <ul class=\"d-flex-v gap-2xs p-md\">\n @for (col of toggleableColumns(); track col.key) {\n <li class=\"field-check\">\n <input class=\"field-check-input\" type=\"checkbox\" [id]=\"'col-toggle-' + col.key\"\n [checked]=\"!col.hidden\" [disabled]=\"isLastVisible(col)\" (change)=\"toggleColumn(col)\">\n <label class=\"field-check-label\" [for]=\"'col-toggle-' + col.key\">{{ col.label | translate }}</label>\n </li>\n }\n </ul>\n </cw-button>\n }\n\n <!-- Slot de l'import : `<cw-import-button cwPageHeaderImport \u2026>`. Projete plutot que\n rendu, pour que `cw-page-header` ne reference pas `cw-import-wizard`. -->\n <ng-content select=\"[cwPageHeaderImport]\"></ng-content>\n\n <!-- Slot de l'export : `<cw-export-button cwPageHeaderExport \u2026>`. -->\n <ng-content select=\"[cwPageHeaderExport]\"></ng-content>\n\n <!-- Slot libre, inchange : tout ce qui n'est marque ni import ni export atterrit ici.\n C'est l'echappatoire d'un hote qui veut piloter son propre bouton. -->\n <ng-content></ng-content>\n\n @if (showReset()) {\n <cw-button [type]=\"buttonType.secondary\" [label]=\"'_COMMON._ACTION.RESET'\"\n [isDisabled]=\"disabled(actionEnum.reset)\" [isLoading]=\"loading(actionEnum.reset)\"\n (btnAction)=\"emit(actionEnum.reset)\">\n </cw-button>\n }\n\n @if (showAdd()) {\n <cw-button [type]=\"buttonType.primary\" [label]=\"'_COMMON._ACTION.ADD'\" [withIcon]=\"spriteIcon.add\"\n [isDisabled]=\"disabled(actionEnum.add)\" [isLoading]=\"loading(actionEnum.add)\"\n (btnAction)=\"emit(actionEnum.add)\">\n </cw-button>\n }\n\n @if (showSave()) {\n <cw-button [type]=\"buttonType.primary\" [label]=\"'_COMMON._ACTION.SAVE'\" [isDisabled]=\"disabled(actionEnum.save)\"\n [isLoading]=\"loading(actionEnum.save)\" (btnAction)=\"emit(actionEnum.save)\">\n </cw-button>\n }\n </div>\n <!-- Rappel sous Enregistrer, hors de la barre d'actions (ordre DOM des actions inchange).\n `cw-button` n'expose pas d'aria-describedby : le lien vers `reminderId` viendra avec. -->\n @if (showScopeReminder()) {\n <!-- Icone en currentColor : herite de `.text-info`. Decorative (le texte suit). -->\n <p class=\"text-info fs-xs d-flex-h gap-3xs items-center justify-end\" [id]=\"reminderId\">\n <cw-icon [icon]=\"spriteIcon.info\" [iconSize]=\"iconSizeEnum.xs\" aria-hidden=\"true\" />\n <span>{{ '_COMMON._PAGE_SCOPE.GLOBAL_SAVE_REMINDER' | translate }}</span>\n </p>\n }\n </div>\n </div>\n\n</div>\n", dependencies: [{ kind: "component", type: BadgeComponent, selector: "cw-badge", inputs: ["type", "label", "withIcon", "iconPosition", "cssClass", "skeletonMode", "dataTest"] }, { kind: "component", type: ButtonComponent, selector: "cw-button", inputs: ["type", "label", "id", "link", "isDropdown", "hideCaret", "withIcon", "withOnlyIcon", "iconSize", "iconPosition", "dropdownPosition", "isMinWidth", "isDisabled", "isLoading", "loadingAnnounce", "cssClass", "dataTest", "skeletonMode", "isPressed", "withTooltip", "tooltipText", "tooltipTitle", "tooltipTrigger", "tooltipPosition", "tooltipType"], outputs: ["btnAction", "dropDownClicked"] }, { kind: "component", type: IconComponent, selector: "cw-icon", inputs: ["icon", "label", "type", "iconSize", "iconCssClass", "iconUiType", "iconColorCustom", "spritePath"] }, { kind: "ngmodule", type: TranslateModule }, { kind: "pipe", type: i1.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
2164
2194
  }
2165
2195
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: PageHeaderComponent, decorators: [{
2166
2196
  type: Component,
2167
2197
  args: [{ selector: 'cw-page-header', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, imports: [
2198
+ BadgeComponent,
2168
2199
  ButtonComponent,
2200
+ IconComponent,
2169
2201
  TranslateModule
2170
- ], template: "<div class=\"page-header d-flex-v gap-2xs\">\n @if (showBack()) {\n <cw-button [type]=\"buttonType.ghost\" [label]=\"'_COMMON._FORM.BACK'\" [withIcon]=\"spriteIcon.left1\"\n (btnAction)=\"goBack()\" />\n }\n <div class=\"d-flex-h gap-md items-start justify-between flex-wrap\">\n <div class=\"d-flex-v\">\n <h1 class=\"page-header-title\">{{ title() | translate}}</h1>\n @if (description(); as desc) {\n <p class=\"fs-md page-header-description\" [innerHTML]=\"desc | translate\"></p>\n }\n </div>\n\n <div class=\"page-header-actions d-flex-h gap-md flex-wrap items-center\">\n @if (showColumns()) {\n <cw-button [type]=\"buttonType.secondary\" [label]=\"columnsLabel()\" [withIcon]=\"spriteIcon.miscNews\"\n [isDropdown]=\"true\">\n <ul class=\"d-flex-v gap-2xs p-md\">\n @for (col of toggleableColumns(); track col.key) {\n <li class=\"field-check\">\n <input class=\"field-check-input\" type=\"checkbox\" [id]=\"'col-toggle-' + col.key\"\n [checked]=\"!col.hidden\" [disabled]=\"isLastVisible(col)\" (change)=\"toggleColumn(col)\">\n <label class=\"field-check-label\" [for]=\"'col-toggle-' + col.key\">{{ col.label | translate }}</label>\n </li>\n }\n </ul>\n </cw-button>\n }\n\n <!-- Slot de l'import : `<cw-import-button cwPageHeaderImport \u2026>`. Projete plutot que\n rendu, pour que `cw-page-header` ne reference pas `cw-import-wizard`. -->\n <ng-content select=\"[cwPageHeaderImport]\"></ng-content>\n\n <!-- Slot de l'export : `<cw-export-button cwPageHeaderExport \u2026>`. -->\n <ng-content select=\"[cwPageHeaderExport]\"></ng-content>\n\n <!-- Slot libre, inchange : tout ce qui n'est marque ni import ni export atterrit ici.\n C'est l'echappatoire d'un hote qui veut piloter son propre bouton. -->\n <ng-content></ng-content>\n\n @if (showReset()) {\n <cw-button [type]=\"buttonType.secondary\" [label]=\"'_COMMON._ACTION.RESET'\"\n [isDisabled]=\"disabled(actionEnum.reset)\" [isLoading]=\"loading(actionEnum.reset)\"\n (btnAction)=\"emit(actionEnum.reset)\">\n </cw-button>\n }\n\n @if (showAdd()) {\n <cw-button [type]=\"buttonType.primary\" [label]=\"'_COMMON._ACTION.ADD'\" [withIcon]=\"spriteIcon.add\"\n [isDisabled]=\"disabled(actionEnum.add)\" [isLoading]=\"loading(actionEnum.add)\"\n (btnAction)=\"emit(actionEnum.add)\">\n </cw-button>\n }\n\n @if (showSave()) {\n <cw-button [type]=\"buttonType.primary\" [label]=\"'_COMMON._ACTION.SAVE'\" [isDisabled]=\"disabled(actionEnum.save)\"\n [isLoading]=\"loading(actionEnum.save)\" (btnAction)=\"emit(actionEnum.save)\">\n </cw-button>\n }\n </div>\n </div>\n</div>\n" }]
2171
- }], ctorParameters: () => [], propDecorators: { title: [{ type: i0.Input, args: [{ isSignal: true, alias: "title", required: true }] }], description: [{ type: i0.Input, args: [{ isSignal: true, alias: "description", required: false }] }], showBack: [{ type: i0.Input, args: [{ isSignal: true, alias: "showBack", required: false }] }], actions: [{ type: i0.Input, args: [{ isSignal: true, alias: "actions", required: false }] }], isLoading: [{ type: i0.Input, args: [{ isSignal: true, alias: "isLoading", required: false }] }], isDisabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "isDisabled", required: false }] }], columns: [{ type: i0.Input, args: [{ isSignal: true, alias: "columns", required: false }] }], storageKey: [{ type: i0.Input, args: [{ isSignal: true, alias: "storageKey", required: false }] }], columnsLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "columnsLabel", required: false }] }], action: [{ type: i0.Output, args: ["action"] }], columnsChange: [{ type: i0.Output, args: ["columnsChange"] }] } });
2202
+ ], template: "<div class=\"page-header d-flex-v gap-2xs\">\n @if (showBack()) {\n <cw-button [type]=\"buttonType.ghost\" [label]=\"'_COMMON._FORM.BACK'\" [withIcon]=\"spriteIcon.left1\"\n (btnAction)=\"goBack()\" />\n }\n <div class=\"d-flex-h gap-md items-start justify-between flex-wrap\">\n <div class=\"d-flex-v\">\n <!-- Badge de portee HORS du <h1> : le nom accessible du titre reste le titre. -->\n <div class=\"page-header-heading d-flex-h gap-sm flex-wrap items-center\">\n <h1 class=\"page-header-title\">{{ title() | translate}}</h1>\n @if (showScope() && pageScope(); as scope) {\n @if (scope.kind === 'instance') {\n <!-- Badge maison : structure `.badge` de basic-ui, couleurs et logo propres (cf. _page-header.scss). -->\n <span class=\"badge page-header-scope-instance\">\n @if (scope.imageUrl; as img) {\n <img class=\"page-header-scope-logo\" [src]=\"img\" alt=\"\" />\n } @else {\n <cw-icon [icon]=\"spriteIcon.poiCompany\" aria-hidden=\"true\" />\n }\n <span class=\"visually-hidden\">{{ '_COMMON._PAGE_SCOPE.INSTANCE_PREFIX' | translate }}</span>\n <span>{{ scope.label }}</span>\n </span>\n } @else {\n <cw-badge [type]=\"badgeType.lightInfo\" [label]=\"'_COMMON._PAGE_SCOPE.ALL_INSTANCES'\"\n [withIcon]=\"spriteIcon.mapWorld\" />\n }\n }\n </div>\n @if (description(); as desc) {\n <p class=\"fs-md page-header-description\" [innerHTML]=\"desc | translate\"></p>\n }\n </div>\n\n <div class=\"d-flex-v gap-2xs\">\n <div class=\"page-header-actions d-flex-h gap-md flex-wrap items-center justify-end\">\n @if (showColumns()) {\n <cw-button [type]=\"buttonType.secondary\" [label]=\"columnsLabel()\" [withIcon]=\"spriteIcon.miscNews\"\n [isDropdown]=\"true\">\n <ul class=\"d-flex-v gap-2xs p-md\">\n @for (col of toggleableColumns(); track col.key) {\n <li class=\"field-check\">\n <input class=\"field-check-input\" type=\"checkbox\" [id]=\"'col-toggle-' + col.key\"\n [checked]=\"!col.hidden\" [disabled]=\"isLastVisible(col)\" (change)=\"toggleColumn(col)\">\n <label class=\"field-check-label\" [for]=\"'col-toggle-' + col.key\">{{ col.label | translate }}</label>\n </li>\n }\n </ul>\n </cw-button>\n }\n\n <!-- Slot de l'import : `<cw-import-button cwPageHeaderImport \u2026>`. Projete plutot que\n rendu, pour que `cw-page-header` ne reference pas `cw-import-wizard`. -->\n <ng-content select=\"[cwPageHeaderImport]\"></ng-content>\n\n <!-- Slot de l'export : `<cw-export-button cwPageHeaderExport \u2026>`. -->\n <ng-content select=\"[cwPageHeaderExport]\"></ng-content>\n\n <!-- Slot libre, inchange : tout ce qui n'est marque ni import ni export atterrit ici.\n C'est l'echappatoire d'un hote qui veut piloter son propre bouton. -->\n <ng-content></ng-content>\n\n @if (showReset()) {\n <cw-button [type]=\"buttonType.secondary\" [label]=\"'_COMMON._ACTION.RESET'\"\n [isDisabled]=\"disabled(actionEnum.reset)\" [isLoading]=\"loading(actionEnum.reset)\"\n (btnAction)=\"emit(actionEnum.reset)\">\n </cw-button>\n }\n\n @if (showAdd()) {\n <cw-button [type]=\"buttonType.primary\" [label]=\"'_COMMON._ACTION.ADD'\" [withIcon]=\"spriteIcon.add\"\n [isDisabled]=\"disabled(actionEnum.add)\" [isLoading]=\"loading(actionEnum.add)\"\n (btnAction)=\"emit(actionEnum.add)\">\n </cw-button>\n }\n\n @if (showSave()) {\n <cw-button [type]=\"buttonType.primary\" [label]=\"'_COMMON._ACTION.SAVE'\" [isDisabled]=\"disabled(actionEnum.save)\"\n [isLoading]=\"loading(actionEnum.save)\" (btnAction)=\"emit(actionEnum.save)\">\n </cw-button>\n }\n </div>\n <!-- Rappel sous Enregistrer, hors de la barre d'actions (ordre DOM des actions inchange).\n `cw-button` n'expose pas d'aria-describedby : le lien vers `reminderId` viendra avec. -->\n @if (showScopeReminder()) {\n <!-- Icone en currentColor : herite de `.text-info`. Decorative (le texte suit). -->\n <p class=\"text-info fs-xs d-flex-h gap-3xs items-center justify-end\" [id]=\"reminderId\">\n <cw-icon [icon]=\"spriteIcon.info\" [iconSize]=\"iconSizeEnum.xs\" aria-hidden=\"true\" />\n <span>{{ '_COMMON._PAGE_SCOPE.GLOBAL_SAVE_REMINDER' | translate }}</span>\n </p>\n }\n </div>\n </div>\n\n</div>\n" }]
2203
+ }], ctorParameters: () => [], propDecorators: { title: [{ type: i0.Input, args: [{ isSignal: true, alias: "title", required: true }] }], description: [{ type: i0.Input, args: [{ isSignal: true, alias: "description", required: false }] }], showBack: [{ type: i0.Input, args: [{ isSignal: true, alias: "showBack", required: false }] }], actions: [{ type: i0.Input, args: [{ isSignal: true, alias: "actions", required: false }] }], isLoading: [{ type: i0.Input, args: [{ isSignal: true, alias: "isLoading", required: false }] }], isDisabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "isDisabled", required: false }] }], showScope: [{ type: i0.Input, args: [{ isSignal: true, alias: "showScope", required: false }] }], columns: [{ type: i0.Input, args: [{ isSignal: true, alias: "columns", required: false }] }], storageKey: [{ type: i0.Input, args: [{ isSignal: true, alias: "storageKey", required: false }] }], columnsLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "columnsLabel", required: false }] }], action: [{ type: i0.Output, args: ["action"] }], columnsChange: [{ type: i0.Output, args: ["columnsChange"] }] } });
2172
2204
 
2173
2205
  class WizardStepComponent {
2174
2206
  constructor() {
@@ -2294,5 +2326,5 @@ function buildFilterParams(filters, keyMap) {
2294
2326
  * Generated bundle index. Do not edit.
2295
2327
  */
2296
2328
 
2297
- export { ArrayAdapter, CustomListComponent, DragNDropListComponent, DragNDropNestedListComponent, ExportButtonComponent, FilterBarComponent, FormArrayAdapter, IMPORT_WIZARD_STEPS, ImportButtonComponent, ImportEventKindEnum, ImportInterruptionEnum, ImportInterruptionStateEnum, ImportModeEnum, ImportScopeEnum, ImportWizardComponent, ImportWizardStepEnum, ImportWizardStepStateEnum, PageHeaderActionEnum, PageHeaderComponent, PaginationComponent, ProgressBarComponent, ProgressBarSizeEnum, ProgressBarTypeEnum, TableComponent, WizardStepComponent, WizardStepperComponent, buildFilename, buildFilterParams, downloadBlob, formatCount, i18nKey, importWizardStepRank, jsonBlob, loadHiddenColumns, pluralizedCountKey, saveHiddenColumns, todayIsoDate };
2329
+ export { ArrayAdapter, CW_PAGE_SCOPE, CustomListComponent, DragNDropListComponent, DragNDropNestedListComponent, ExportButtonComponent, FilterBarComponent, FormArrayAdapter, IMPORT_WIZARD_STEPS, ImportButtonComponent, ImportEventKindEnum, ImportInterruptionEnum, ImportInterruptionStateEnum, ImportModeEnum, ImportScopeEnum, ImportWizardComponent, ImportWizardStepEnum, ImportWizardStepStateEnum, PageHeaderActionEnum, PageHeaderComponent, PaginationComponent, ProgressBarComponent, ProgressBarSizeEnum, ProgressBarTypeEnum, TableComponent, WizardStepComponent, WizardStepperComponent, buildFilename, buildFilterParams, downloadBlob, formatCount, i18nKey, importWizardStepRank, jsonBlob, loadHiddenColumns, pluralizedCountKey, provideCwPageScope, saveHiddenColumns, todayIsoDate };
2298
2330
  //# sourceMappingURL=cityway-bo-ui.mjs.map