@cityway/bo-ui 1.1.0-beta020 → 1.1.0-beta022
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-beta022.tgz +0 -0
- package/docs/components/page-header.md +3 -4
- package/docs/components/table.md +2 -2
- package/docs/i18n.md +66 -66
- package/fesm2022/cityway-bo-ui.mjs +10 -17
- package/fesm2022/cityway-bo-ui.mjs.map +1 -1
- package/index.d.ts +4 -9
- package/lib/assets/i18n/common.en.json +162 -163
- package/lib/assets/i18n/common.fr.json +162 -163
- 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-beta020.tgz +0 -0
|
Binary file
|
|
@@ -114,7 +114,7 @@ type CwPageScope =
|
|
|
114
114
|
|------------------|-------|
|
|
115
115
|
| *pas de provider* ou `null` | rien (comportement antérieur, aucun changement pour les BO qui n'ont pas de notion d'instance) |
|
|
116
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`
|
|
117
|
+
| `{ kind: 'global' }` | `cw-badge` `light-info`, icône `mapWorld` (globe) + `_COMMON._PAGE_SCOPE.ALL_INSTANCES` |
|
|
118
118
|
|
|
119
119
|
**Badge global** : `cw-badge` (basic-ui) utilisé tel quel.
|
|
120
120
|
|
|
@@ -273,8 +273,7 @@ Règles :
|
|
|
273
273
|
- **États par action** : `isLoading` / `isDisabled` sont des maps partielles ; une action absente de la map vaut `false`.
|
|
274
274
|
- **Dépendance** : le composant projette des `cw-button` (`@cityway/basic-ui`) en interne — `basic-ui` doit être disponible.
|
|
275
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
|
-
- **
|
|
277
|
-
- **Ordre des actions** : le badge et le rappel ne sont pas dans `.page-header-actions` ; l'ordre ci-dessus est inchangé.
|
|
276
|
+
- **Ordre des actions** : le badge n'est pas dans `.page-header-actions` ; l'ordre ci-dessus est inchangé.
|
|
278
277
|
|
|
279
278
|
---
|
|
280
279
|
|
|
@@ -291,5 +290,5 @@ Règles :
|
|
|
291
290
|
- Exposer `PageHeaderActionEnum` comme propriété du composant pour la binder dans le template (`actionEnum = PageHeaderActionEnum`).
|
|
292
291
|
- Utiliser des clés i18n pour `title` et `description` ; les libellés des actions sont fixes (clés `_COMMON._ACTION.*`).
|
|
293
292
|
- 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
|
|
293
|
+
- **Portée** : fournir `provideCwPageScope(...)` **une fois** dans `app.config` ; ne jamais poser le badge de portée à la main. Pour masquer le badge sur une page qui affiche déjà sa portée : `[showScope]="false"`.
|
|
295
294
|
- **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/components/table.md
CHANGED
|
@@ -39,7 +39,7 @@ Dépend de `@cityway/basic-ui` (badge, button, icon, image, loader, modale de su
|
|
|
39
39
|
| `emptyStateNoData` | `TableEmptyStateConfig` | `undefined` | État vide quand `data` est vide **et** table non filtrée (`cw-empty-state`). |
|
|
40
40
|
| `emptyStateNoResult` | `TableEmptyStateConfig` | `undefined` | État vide quand un filtrage ne renvoie rien (`isFiltered=true`). |
|
|
41
41
|
| `isFiltered` | `boolean` | `false` | Des filtres sont actifs → pilote le choix noData vs noResult. |
|
|
42
|
-
| `showScope` | `boolean` | `true` | En portée **instance** uniquement,
|
|
42
|
+
| `showScope` | `boolean` | `true` | En portée **instance** uniquement, accole « pour l'instance PFP2 » au message vide (lu depuis `CW_PAGE_SCOPE`). Rien en portée globale ni sans provider. `false` pour la retirer. |
|
|
43
43
|
|
|
44
44
|
### Outputs
|
|
45
45
|
|
|
@@ -223,7 +223,7 @@ rowActions: RowActionsConfig = {
|
|
|
223
223
|
- **Colonne `progressbar`** : `type: 'progressbar'` rend une barre `cw-progress-bar` (taille `sm`, type `information`) + le libellé « N% ». La **valeur de cellule** (`row[key]`) est un **nombre 0–100** (le pourcentage). Ex. `{ key: 'progress', label: 'Avancement', type: 'progressbar' }` avec `row.progress = 50`.
|
|
224
224
|
- **Visibilité des colonnes** : le menu « Colonnes » (afficher/masquer + persistance localStorage) est porté par **`cw-page-header`** (lui passer `[columns]` + `storageKey`, relier `(columnsChange)`). La `cw-table` ne fait que rendre les colonnes non `hidden` ; côté colonne, `hideable: false` exclut du menu et `type='actions'` est exclu d'office. Voir la doc `cw-page-header` §4 bis.
|
|
225
225
|
- **État vide** : fournir `emptyStateNoData` et/ou `emptyStateNoResult` (+ `isFiltered`) pour afficher un `cw-empty-state` (illustration + titre + description + 2 boutons avec `click`). Sans config, la table garde le texte `NO_RESULT`. Voir la doc `cw-empty-state`. `TableEmptyStateConfig` accepte `titleParams` / `descriptionParams` (transmis au `translate`) pour interpoler une donnée : `{ title: 'NEWS.EMPTY', titleParams: { instance: scope.label } }` avec la clé « Aucune actualité pour {{instance}} ».
|
|
226
|
-
- **Mention de portée** : si l'app fournit `provideCwPageScope` (cf. `page-header.md` § 2 ter) **et** que la portée est une **instance**, la table
|
|
226
|
+
- **Mention de portée** : si l'app fournit `provideCwPageScope` (cf. `page-header.md` § 2 ter) **et** que la portée est une **instance**, la table **accole** au message vide (texte `NO_RESULT` ou titre du `cw-empty-state`, via son `titleSuffix`) `_COMMON._PAGE_SCOPE.EMPTY_FOR_INSTANCE` (« pour l'instance {{instance}} ») : « Aucun résultat ne correspond aux filtres pour l'instance PFP2 ». En portée globale : aucune mention. Le titre ne doit donc **pas finir par un point**. Désactivable par table avec `[showScope]="false"`, par exemple si le titre interpole déjà l'instance.
|
|
227
227
|
- **Traduction des VALEURS de cellule** : les colonnes `text` / `link` affichent la donnée **brute par défaut**. Mettre `translate: true` **uniquement** quand la valeur est elle-même une clé i18n (enum / statut affiché en texte). Sinon une donnée qui coïncide avec une clé serait traduite à tort — typiquement un code applicatif `"NEWS"` rendu en `[object Object]` car la clé pointe sur une branche d'objet. (Les `badge` traduisent déjà leur `label` ; les en-têtes `label` sont toujours traduits.)
|
|
228
228
|
- **Cellules cliquables** : les colonnes `link`, et les `icon`/`image` avec `clickable`, sont rendues en `<button class="btn btn-link-like">` (et non en `<a href="javascript:void(0)">`, qui s'annonçait comme un lien sans naviguer). Le rendu visuel est celui du DS « Button Link Like ». Un clic émet `cellClick`.
|
|
229
229
|
- **OnPush** : `data`/`columns` sont des signals → fournir des références à jour (set/update du signal).
|
package/docs/i18n.md
CHANGED
|
@@ -1,66 +1,66 @@
|
|
|
1
|
-
# i18n de `@cityway/bo-ui`
|
|
2
|
-
|
|
3
|
-
> Bundle : `@cityway/bo-ui/lib/assets/i18n/common.{fr,en}.json`
|
|
4
|
-
> Vue d'ensemble du dispositif (les deux libs, câblage complet) : `@cityway/basic-ui/docs/00-overview.md` §6 bis.
|
|
5
|
-
|
|
6
|
-
---
|
|
7
|
-
|
|
8
|
-
## 1. Pourquoi un bundle séparé
|
|
9
|
-
|
|
10
|
-
`bo-ui` livre ses propres traductions au lieu de s'appuyer sur celles de `basic-ui`. Un projet qui n'installe que `basic-ui` — cas courant en Front-Office — n'a alors **aucune clé de composant Back-Office** dans ses fichiers de langue.
|
|
11
|
-
|
|
12
|
-
Le bundle bo-ui se déclare en ressource **`optional`** du loader : si le package n'est pas installé, le fichier est absent, le loader renvoie un objet vide et ne journalise rien.
|
|
13
|
-
|
|
14
|
-
---
|
|
15
|
-
|
|
16
|
-
## 2. Ce que contient le bundle
|
|
17
|
-
|
|
18
|
-
Racine `_COMMON`, identique à celle de basic-ui : **les chemins de clés sont inchangés** pour le consommateur (`_COMMON._TABLE.NO_RESULT` reste `_COMMON._TABLE.NO_RESULT`), seul le fichier qui les porte change.
|
|
19
|
-
|
|
20
|
-
| Groupe | Clés | Composant |
|
|
21
|
-
|--------|------|-----------|
|
|
22
|
-
| `_COMMON._TABLE.*` | `CAPTION`, `NO_RESULT`, `COLUMNS`, `ACTIONS_MENU`, `EXPORT_CURRENT`, `EXPORT_ALL`, `_SORT.*`, `_THEAD.*`, `_BULK_ACTION.*` | `cw-table`, `cw-page-header` |
|
|
23
|
-
| `_COMMON._PAGINATION.*` | `DISPLAY`, `ITEMS_PER_PAGE`, `FIRST`, `PREVIOUS`, `NEXT`, `LAST`, `PAGE`, `CURRENT_PAGE` | `cw-pagination` |
|
|
24
|
-
| `_COMMON._PAGE_SCOPE.*` | `INSTANCE_PREFIX`, `ALL_INSTANCES`, `
|
|
25
|
-
| `_COMMON._STEPPER.*` | `STEP`, `PREVIOUS_STEP`, `NEXT_STEP` | `cw-wizard-stepper` |
|
|
26
|
-
| `_COMMON.MAX_ITEMS_REACHED`, `MAX_RESTORE_BLOCKED` | — | `cw-drag-n-drop-list`, `cw-drag-n-drop-nested-list` |
|
|
27
|
-
|
|
28
|
-
### Ce qui reste dans basic-ui
|
|
29
|
-
|
|
30
|
-
Les composants bo-ui consomment aussi du vocabulaire transverse, qui **reste** dans le bundle basic-ui — c'est voulu, `bo-ui` dépend de `basic-ui` :
|
|
31
|
-
|
|
32
|
-
- `_COMMON._ACTION.*` (`ADD`, `SAVE`, `IMPORT`, `EXPORT`, `EXPORT_ALL`, `EXPORT_CURRENT`, `END`…), `_COMMON._FORM.BACK`, `_COMMON._PRO_SENTENCE.*`, `_LABEL.COLON` : verbes et libellés génériques, utiles à toute app.
|
|
33
|
-
- Trois feuilles de groupes « BO » utilisées par des composants **basic-ui**, et qui ne peuvent donc pas partir : `_TABLE.LEGEND` (`cw-legend`), `_PAGINATION.RESULT_S` / `RESULT_P` (`cw-autocomplete`), `_STEPPER.NAV_LABEL` (`cw-stepper`).
|
|
34
|
-
|
|
35
|
-
C'est la raison pour laquelle le découpage se fait **feuille par feuille** et non par groupe : `_TABLE`, `_PAGINATION` et `_STEPPER` sont chacun à cheval sur les deux libs.
|
|
36
|
-
|
|
37
|
-
---
|
|
38
|
-
|
|
39
|
-
## 3. Règle de placement d'une nouvelle clé
|
|
40
|
-
|
|
41
|
-
| La clé est… | Elle va dans… |
|
|
42
|
-
|-------------|---------------|
|
|
43
|
-
| utilisée par un composant `basic-ui` (même si `bo-ui` l'utilise aussi) | `basic-ui` |
|
|
44
|
-
| du vocabulaire générique qu'une app FO pourrait vouloir | `basic-ui` |
|
|
45
|
-
| propre à un composant `bo-ui` | `bo-ui` |
|
|
46
|
-
|
|
47
|
-
**Jamais dans les deux.** Les bundles étant fusionnés par deepmerge, une clé dupliquée se résout par ordre de chargement — donc silencieusement, et différemment selon le câblage du projet. `scripts/check-i18n-bundles.mjs` échoue dans ce cas ; il est lancé par `build-basic-ui.mjs` et `build-bo-ui.mjs`.
|
|
48
|
-
|
|
49
|
-
Le même script signale (en avertissement) les clés présentes en `fr` sans équivalent `en` et inversement, et (en erreur) les clés référencées par le code des libs qui n'existent dans aucun bundle.
|
|
50
|
-
|
|
51
|
-
---
|
|
52
|
-
|
|
53
|
-
## 4. Packaging
|
|
54
|
-
|
|
55
|
-
Aucune étape de build spécifique : `projects/bo-ui/ng-package.json` déclare déjà `src/lib/assets` → `lib/assets`, donc tout fichier ajouté sous `src/lib/assets/i18n/` est embarqué dans le `.tgz`.
|
|
56
|
-
|
|
57
|
-
Un fichier `label.{fr,en}.json` peut être ajouté plus tard sur le même modèle (aucune clé BO ne le justifie aujourd'hui : `_LABEL` ne contient que du vocabulaire de champ générique, resté dans basic-ui). Le déclarer en `optional` côté loader permet de l'ajouter sans toucher au câblage des projets.
|
|
58
|
-
|
|
59
|
-
---
|
|
60
|
-
|
|
61
|
-
## 5. En développement (Storybook)
|
|
62
|
-
|
|
63
|
-
Les bundles sont servis depuis les **sources** des libs, pas depuis `dist/` : une modification de clé est visible au simple reload, sans repack.
|
|
64
|
-
|
|
65
|
-
- `.storybook/main.ts` → `staticDirs` : `projects/basic-ui/src/lib/assets/i18n` → `/i18n/basic-ui`, `projects/bo-ui/src/lib/assets/i18n` → `/i18n/bo-ui`.
|
|
66
|
-
- `.storybook/preview.ts` → `MultiTranslateHttpLoader` du package (**deepmerge obligatoire**, cf. §2 : les deux libs partagent la racine `_COMMON`).
|
|
1
|
+
# i18n de `@cityway/bo-ui`
|
|
2
|
+
|
|
3
|
+
> Bundle : `@cityway/bo-ui/lib/assets/i18n/common.{fr,en}.json`
|
|
4
|
+
> Vue d'ensemble du dispositif (les deux libs, câblage complet) : `@cityway/basic-ui/docs/00-overview.md` §6 bis.
|
|
5
|
+
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
## 1. Pourquoi un bundle séparé
|
|
9
|
+
|
|
10
|
+
`bo-ui` livre ses propres traductions au lieu de s'appuyer sur celles de `basic-ui`. Un projet qui n'installe que `basic-ui` — cas courant en Front-Office — n'a alors **aucune clé de composant Back-Office** dans ses fichiers de langue.
|
|
11
|
+
|
|
12
|
+
Le bundle bo-ui se déclare en ressource **`optional`** du loader : si le package n'est pas installé, le fichier est absent, le loader renvoie un objet vide et ne journalise rien.
|
|
13
|
+
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
## 2. Ce que contient le bundle
|
|
17
|
+
|
|
18
|
+
Racine `_COMMON`, identique à celle de basic-ui : **les chemins de clés sont inchangés** pour le consommateur (`_COMMON._TABLE.NO_RESULT` reste `_COMMON._TABLE.NO_RESULT`), seul le fichier qui les porte change.
|
|
19
|
+
|
|
20
|
+
| Groupe | Clés | Composant |
|
|
21
|
+
|--------|------|-----------|
|
|
22
|
+
| `_COMMON._TABLE.*` | `CAPTION`, `NO_RESULT`, `COLUMNS`, `ACTIONS_MENU`, `EXPORT_CURRENT`, `EXPORT_ALL`, `_SORT.*`, `_THEAD.*`, `_BULK_ACTION.*` | `cw-table`, `cw-page-header` |
|
|
23
|
+
| `_COMMON._PAGINATION.*` | `DISPLAY`, `ITEMS_PER_PAGE`, `FIRST`, `PREVIOUS`, `NEXT`, `LAST`, `PAGE`, `CURRENT_PAGE` | `cw-pagination` |
|
|
24
|
+
| `_COMMON._PAGE_SCOPE.*` | `INSTANCE_PREFIX`, `ALL_INSTANCES`, `EMPTY_FOR_INSTANCE` | `cw-page-header`, `cw-table` |
|
|
25
|
+
| `_COMMON._STEPPER.*` | `STEP`, `PREVIOUS_STEP`, `NEXT_STEP` | `cw-wizard-stepper` |
|
|
26
|
+
| `_COMMON.MAX_ITEMS_REACHED`, `MAX_RESTORE_BLOCKED` | — | `cw-drag-n-drop-list`, `cw-drag-n-drop-nested-list` |
|
|
27
|
+
|
|
28
|
+
### Ce qui reste dans basic-ui
|
|
29
|
+
|
|
30
|
+
Les composants bo-ui consomment aussi du vocabulaire transverse, qui **reste** dans le bundle basic-ui — c'est voulu, `bo-ui` dépend de `basic-ui` :
|
|
31
|
+
|
|
32
|
+
- `_COMMON._ACTION.*` (`ADD`, `SAVE`, `IMPORT`, `EXPORT`, `EXPORT_ALL`, `EXPORT_CURRENT`, `END`…), `_COMMON._FORM.BACK`, `_COMMON._PRO_SENTENCE.*`, `_LABEL.COLON` : verbes et libellés génériques, utiles à toute app.
|
|
33
|
+
- Trois feuilles de groupes « BO » utilisées par des composants **basic-ui**, et qui ne peuvent donc pas partir : `_TABLE.LEGEND` (`cw-legend`), `_PAGINATION.RESULT_S` / `RESULT_P` (`cw-autocomplete`), `_STEPPER.NAV_LABEL` (`cw-stepper`).
|
|
34
|
+
|
|
35
|
+
C'est la raison pour laquelle le découpage se fait **feuille par feuille** et non par groupe : `_TABLE`, `_PAGINATION` et `_STEPPER` sont chacun à cheval sur les deux libs.
|
|
36
|
+
|
|
37
|
+
---
|
|
38
|
+
|
|
39
|
+
## 3. Règle de placement d'une nouvelle clé
|
|
40
|
+
|
|
41
|
+
| La clé est… | Elle va dans… |
|
|
42
|
+
|-------------|---------------|
|
|
43
|
+
| utilisée par un composant `basic-ui` (même si `bo-ui` l'utilise aussi) | `basic-ui` |
|
|
44
|
+
| du vocabulaire générique qu'une app FO pourrait vouloir | `basic-ui` |
|
|
45
|
+
| propre à un composant `bo-ui` | `bo-ui` |
|
|
46
|
+
|
|
47
|
+
**Jamais dans les deux.** Les bundles étant fusionnés par deepmerge, une clé dupliquée se résout par ordre de chargement — donc silencieusement, et différemment selon le câblage du projet. `scripts/check-i18n-bundles.mjs` échoue dans ce cas ; il est lancé par `build-basic-ui.mjs` et `build-bo-ui.mjs`.
|
|
48
|
+
|
|
49
|
+
Le même script signale (en avertissement) les clés présentes en `fr` sans équivalent `en` et inversement, et (en erreur) les clés référencées par le code des libs qui n'existent dans aucun bundle.
|
|
50
|
+
|
|
51
|
+
---
|
|
52
|
+
|
|
53
|
+
## 4. Packaging
|
|
54
|
+
|
|
55
|
+
Aucune étape de build spécifique : `projects/bo-ui/ng-package.json` déclare déjà `src/lib/assets` → `lib/assets`, donc tout fichier ajouté sous `src/lib/assets/i18n/` est embarqué dans le `.tgz`.
|
|
56
|
+
|
|
57
|
+
Un fichier `label.{fr,en}.json` peut être ajouté plus tard sur le même modèle (aucune clé BO ne le justifie aujourd'hui : `_LABEL` ne contient que du vocabulaire de champ générique, resté dans basic-ui). Le déclarer en `optional` côté loader permet de l'ajouter sans toucher au câblage des projets.
|
|
58
|
+
|
|
59
|
+
---
|
|
60
|
+
|
|
61
|
+
## 5. En développement (Storybook)
|
|
62
|
+
|
|
63
|
+
Les bundles sont servis depuis les **sources** des libs, pas depuis `dist/` : une modification de clé est visible au simple reload, sans repack.
|
|
64
|
+
|
|
65
|
+
- `.storybook/main.ts` → `staticDirs` : `projects/basic-ui/src/lib/assets/i18n` → `/i18n/basic-ui`, `projects/bo-ui/src/lib/assets/i18n` → `/i18n/bo-ui`.
|
|
66
|
+
- `.storybook/preview.ts` → `MultiTranslateHttpLoader` du package (**deepmerge obligatoire**, cf. §2 : les deux libs partagent la racine `_COMMON`).
|
|
@@ -34,14 +34,14 @@ class CustomListComponent {
|
|
|
34
34
|
return true;
|
|
35
35
|
}
|
|
36
36
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: CustomListComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
37
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.20", type: CustomListComponent, isStandalone: true, selector: "cw-custom-list", inputs: { customListData: { classPropertyName: "customListData", publicName: "customListData", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<div class=\"card custom-card-light\">\r\n <div class=\"card-body d-flex-v gap-md\">\r\n @for (group of customListData(); track group.title) {\r\n @if (group.title) {\r\n <h3>{{ group.title | translate }}</h3>\r\n }\r\n\r\n <ul class=\"custom-description-list list-unstyled fs fs-sm\">\r\n @for (field of group.fields; track field.label) {\r\n @if (!field.hideIfEmpty || hasValue(field.value)) {\r\n <li>\r\n <div class=\"fs fw-bold\" [innerHTML]=\"'_LABEL.COLON' | translate: { label: (field.label | translate) }\"></div>\r\n <div>\r\n @switch (field.type) {\r\n @case ('date') {\r\n {{ field.value | date: 'short' }}\r\n }\r\n @case ('boolean') {\r\n {{ (field.value ? '_COMMON._PRO_SENTENCE.YES' : '_COMMON._PRO_SENTENCE.NO') | translate }}\r\n }\r\n @case ('html') {\r\n <span [innerHTML]=\"field.value\"></span>\r\n }\r\n @default {\r\n {{ field.translateValue ? (field.value | translate) : field.value }}\r\n }\r\n }\r\n </div>\r\n </li>\r\n }\r\n }\r\n </ul>\r\n }\r\n </div>\r\n</div>\r\n", dependencies: [{ kind: "ngmodule", type: TranslateModule }, { kind: "pipe", type: DatePipe, name: "date" }, { kind: "pipe", type: i1.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
37
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.20", type: CustomListComponent, isStandalone: true, selector: "cw-custom-list", inputs: { customListData: { classPropertyName: "customListData", publicName: "customListData", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<div class=\"card custom-card-light\">\r\n <div class=\"card-body d-flex-v gap-md\">\r\n @for (group of customListData(); track group.title) {\r\n @if (group.title) {\r\n <h3>{{ group.title | translate }}</h3>\r\n }\r\n\r\n <ul class=\"custom-description-list d-flex-v gap-xs list-unstyled fs fs-sm\">\r\n @for (field of group.fields; track field.label) {\r\n @if (!field.hideIfEmpty || hasValue(field.value)) {\r\n <li>\r\n <div class=\"fs fw-bold\" [innerHTML]=\"'_LABEL.COLON' | translate: { label: (field.label | translate) }\"></div>\r\n <div>\r\n @switch (field.type) {\r\n @case ('date') {\r\n {{ field.value | date: 'short' }}\r\n }\r\n @case ('boolean') {\r\n {{ (field.value ? '_COMMON._PRO_SENTENCE.YES' : '_COMMON._PRO_SENTENCE.NO') | translate }}\r\n }\r\n @case ('html') {\r\n <span [innerHTML]=\"field.value\"></span>\r\n }\r\n @default {\r\n {{ field.translateValue ? (field.value | translate) : field.value }}\r\n }\r\n }\r\n </div>\r\n </li>\r\n }\r\n }\r\n </ul>\r\n }\r\n </div>\r\n</div>\r\n", dependencies: [{ kind: "ngmodule", type: TranslateModule }, { kind: "pipe", type: DatePipe, name: "date" }, { kind: "pipe", type: i1.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
38
38
|
}
|
|
39
39
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: CustomListComponent, decorators: [{
|
|
40
40
|
type: Component,
|
|
41
41
|
args: [{ selector: 'cw-custom-list', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, imports: [
|
|
42
42
|
DatePipe,
|
|
43
43
|
TranslateModule
|
|
44
|
-
], template: "<div class=\"card custom-card-light\">\r\n <div class=\"card-body d-flex-v gap-md\">\r\n @for (group of customListData(); track group.title) {\r\n @if (group.title) {\r\n <h3>{{ group.title | translate }}</h3>\r\n }\r\n\r\n <ul class=\"custom-description-list list-unstyled fs fs-sm\">\r\n @for (field of group.fields; track field.label) {\r\n @if (!field.hideIfEmpty || hasValue(field.value)) {\r\n <li>\r\n <div class=\"fs fw-bold\" [innerHTML]=\"'_LABEL.COLON' | translate: { label: (field.label | translate) }\"></div>\r\n <div>\r\n @switch (field.type) {\r\n @case ('date') {\r\n {{ field.value | date: 'short' }}\r\n }\r\n @case ('boolean') {\r\n {{ (field.value ? '_COMMON._PRO_SENTENCE.YES' : '_COMMON._PRO_SENTENCE.NO') | translate }}\r\n }\r\n @case ('html') {\r\n <span [innerHTML]=\"field.value\"></span>\r\n }\r\n @default {\r\n {{ field.translateValue ? (field.value | translate) : field.value }}\r\n }\r\n }\r\n </div>\r\n </li>\r\n }\r\n }\r\n </ul>\r\n }\r\n </div>\r\n</div>\r\n" }]
|
|
44
|
+
], template: "<div class=\"card custom-card-light\">\r\n <div class=\"card-body d-flex-v gap-md\">\r\n @for (group of customListData(); track group.title) {\r\n @if (group.title) {\r\n <h3>{{ group.title | translate }}</h3>\r\n }\r\n\r\n <ul class=\"custom-description-list d-flex-v gap-xs list-unstyled fs fs-sm\">\r\n @for (field of group.fields; track field.label) {\r\n @if (!field.hideIfEmpty || hasValue(field.value)) {\r\n <li>\r\n <div class=\"fs fw-bold\" [innerHTML]=\"'_LABEL.COLON' | translate: { label: (field.label | translate) }\"></div>\r\n <div>\r\n @switch (field.type) {\r\n @case ('date') {\r\n {{ field.value | date: 'short' }}\r\n }\r\n @case ('boolean') {\r\n {{ (field.value ? '_COMMON._PRO_SENTENCE.YES' : '_COMMON._PRO_SENTENCE.NO') | translate }}\r\n }\r\n @case ('html') {\r\n <span [innerHTML]=\"field.value\"></span>\r\n }\r\n @default {\r\n {{ field.translateValue ? (field.value | translate) : field.value }}\r\n }\r\n }\r\n </div>\r\n </li>\r\n }\r\n }\r\n </ul>\r\n }\r\n </div>\r\n</div>\r\n" }]
|
|
45
45
|
}], propDecorators: { customListData: [{ type: i0.Input, args: [{ isSignal: true, alias: "customListData", required: false }] }] } });
|
|
46
46
|
|
|
47
47
|
// Adaptateur pour DragItem[] (identité)
|
|
@@ -646,7 +646,7 @@ let nextTableId = 0;
|
|
|
646
646
|
class TableComponent {
|
|
647
647
|
constructor() {
|
|
648
648
|
this.modalsService = inject(ModalsService);
|
|
649
|
-
/** Portee courante (`provideCwPageScope`) : mentionnee
|
|
649
|
+
/** Portee courante (`provideCwPageScope`) : mentionnee dans le message « pas de donnee ». */
|
|
650
650
|
this.pageScope = inject(CW_PAGE_SCOPE);
|
|
651
651
|
/** Prefixe d'id unique par instance : evite les collisions d'id de checkbox si plusieurs tables coexistent. */
|
|
652
652
|
this.uid = `cw-table-${nextTableId++}`;
|
|
@@ -698,9 +698,9 @@ class TableComponent {
|
|
|
698
698
|
/** Config d'etat vide a afficher selon le contexte (filtre ou non). `undefined` -> fallback texte. */
|
|
699
699
|
this.currentEmptyState = computed(() => this.isFiltered() ? this.emptyStateNoResult() : this.emptyStateNoData(), ...(ngDevMode ? [{ debugName: "currentEmptyState" }] : []));
|
|
700
700
|
/**
|
|
701
|
-
* Nom de l'instance
|
|
702
|
-
* en portee `instance`. Rien en portee globale, sans provider ou en opt-out.
|
|
703
|
-
*
|
|
701
|
+
* Nom de l'instance accole au message vide (« Aucun resultat pour l'instance PFP2 ») :
|
|
702
|
+
* seulement en portee `instance`. Rien en portee globale, sans provider ou en opt-out.
|
|
703
|
+
* Le titre de l'etat vide ne doit donc pas finir par un point.
|
|
704
704
|
*/
|
|
705
705
|
this.scopeInstance = computed(() => {
|
|
706
706
|
const scope = this.showScope() ? this.pageScope() : null;
|
|
@@ -962,7 +962,7 @@ class TableComponent {
|
|
|
962
962
|
return typeof descriptor.link === 'function' ? descriptor.link(row) : descriptor.link;
|
|
963
963
|
}
|
|
964
964
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: TableComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
965
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.20", type: TableComponent, isStandalone: true, selector: "cw-table", inputs: { checkbox: { classPropertyName: "checkbox", publicName: "checkbox", isSignal: true, isRequired: false, transformFunction: null }, title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: false, transformFunction: null }, columns: { classPropertyName: "columns", publicName: "columns", isSignal: true, isRequired: false, transformFunction: null }, data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: false, transformFunction: null }, loading: { classPropertyName: "loading", publicName: "loading", isSignal: true, isRequired: false, transformFunction: null }, rowClassFn: { classPropertyName: "rowClassFn", publicName: "rowClassFn", isSignal: true, isRequired: false, transformFunction: null }, pagination: { classPropertyName: "pagination", publicName: "pagination", isSignal: true, isRequired: false, transformFunction: null }, bulkActions: { classPropertyName: "bulkActions", publicName: "bulkActions", isSignal: true, isRequired: false, transformFunction: null }, rowActions: { classPropertyName: "rowActions", publicName: "rowActions", isSignal: true, isRequired: false, transformFunction: null }, emptyStateNoData: { classPropertyName: "emptyStateNoData", publicName: "emptyStateNoData", isSignal: true, isRequired: false, transformFunction: null }, emptyStateNoResult: { classPropertyName: "emptyStateNoResult", publicName: "emptyStateNoResult", isSignal: true, isRequired: false, transformFunction: null }, isFiltered: { classPropertyName: "isFiltered", publicName: "isFiltered", isSignal: true, isRequired: false, transformFunction: null }, showScope: { classPropertyName: "showScope", publicName: "showScope", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { cellClick: "cellClick", sortChange: "sortChange", selectionChange: "selectionChange", paginationChange: "paginationChange", bulkDelete: "bulkDelete", bulkAction: "bulkAction" }, host: { classAttribute: "cw-table" }, queries: [{ propertyName: "actionsTemplate", first: true, predicate: ["actionsTemplate"], descendants: true, isSignal: true }], ngImport: i0, template: "@if (checkbox() && selectionCount() > 0) {\n <!-- Espacement DS : gap-md = 16px = component/button/set/gap (espacement entre\n boutons d'un set). Utilitaires basic-ui (adosses a l'echelle $sizing des\n tokens) et non ceux de Bootstrap : gap-2 valait 8px. d-flex-h centre deja\n verticalement, align-items-center est donc inutile. -->\n <div class=\"table-selection-info mb-md d-flex-h gap-md flex-wrap\">\n <span class=\"flex-grow-1\">\n {{ selectionCount() }} {{ '_COMMON._TABLE._BULK_ACTION.SELECTED_ITEMS_CURRENT_PAGE' | translate }}\n </span>\n @for (action of bulkActions(); track $index) {\n <cw-button\n [type]=\"resolveVariant(action)\"\n [label]=\"action.label\"\n [withIcon]=\"action.icon\"\n [isDisabled]=\"resolveDisabled(action)\"\n (btnAction)=\"onBulkActionClick(action)\">\n </cw-button>\n }\n </div>\n}\n\n<div class=\"table-responsive\">\n <table class=\"table\">\n <caption class=\"visually-hidden\"\n [innerHTML]=\"'_COMMON._TABLE.CAPTION' | translate: { label: (title() | translate) }\"></caption>\n <thead>\n <tr>\n @if(checkbox()) {\n <th scope=\"col\" width=\"10\">\n <div class=\"field-check\">\n <input class=\"field-check-input\" type=\"checkbox\" [id]=\"uid + '-all'\" [checked]=\"allSelected()\"\n [indeterminate]=\"someSelected()\" (change)=\"toggleAll()\">\n <label class=\"field-check-label\" [for]=\"uid + '-all'\">\n <span class=\"visually-hidden\">{{ '_COMMON._TABLE._THEAD.CHECK_LINE' | translate }}</span>\n </label>\n </div>\n </th>\n }\n\n @for (column of columns(); track column.key) {\n @if (!column.hidden) {\n <th scope=\"col\" [class.p-0]=\"column.sort\" [attr.aria-sort]=\"column.sort ? getAriaSort(column.key) : null\">\n @if (column.sort) {\n <button class=\"d-flex-h gap-2xs\" [class]=\"getSortClass(column.key)\" (click)=\"setSortProperty(column.key)\">\n {{ column.label | translate}}\n <cw-icon\n [icon]=\"getSortIcon(column.key)\"\n [label]=\"'_COMMON._TABLE._SORT.LABEL' | translate\"\n [type]=\"iconType.default\"\n [iconSize]=\"iconSize['xs']\"></cw-icon>\n </button>\n }\n @else {\n {{ column.label | translate }}\n }\n </th>\n }\n }\n </tr>\n </thead>\n <tbody>\n @if (loading()) {\n <tr>\n <td [attr.colspan]=\"visibleColumnCount()\">\n <cw-loader></cw-loader>\n </td>\n </tr>\n }\n @else if (!data() || data().length === 0) {\n <tr>\n <td class=\"table-info no-result\" [attr.colspan]=\"visibleColumnCount()\">\n @if (currentEmptyState(); as empty) {\n <cw-empty-state\n [illustration]=\"empty.illustration ?? (isFiltered() ? illustrationEnum.noResult : illustrationEnum.noData)\"\n [imageSource]=\"empty.imageSource\"\n [title]=\"empty.title\"\n [titleParams]=\"empty.titleParams\"\n [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 @if (scopeInstance(); as instance) {\n <p class=\"empty-state-description table-scope-mention\">\n {{ '_COMMON._PAGE_SCOPE.EMPTY_FOR_INSTANCE' | translate: { instance } }}\n </p>\n }\n </cw-empty-state>\n } @else {\n {{ '_COMMON._TABLE.NO_RESULT' | translate }}\n @if (scopeInstance(); as instance) {\n <br /><span class=\"table-scope-mention\">{{ '_COMMON._PAGE_SCOPE.EMPTY_FOR_INSTANCE' | translate: { instance } }}</span>\n }\n }\n </td>\n </tr>\n }\n @else {\n @for (row of data(); track row) {\n <tr [class.tr-selected]=\"isSelected(row)\" [class]=\"getRowClass(row)\">\n @if (checkbox()) {\n <td>\n <input class=\"field-check-input\" type=\"checkbox\" [checked]=\"isSelected(row)\" (change)=\"toggleRow(row)\" [id]=\"uid + '-check-' + row.id\"\n [attr.aria-label]=\"('_COMMON._TABLE._THEAD.CHECK_LINE' | translate) + ' ' + row.id\">\n <label class=\"visually-hidden\" [for]=\"uid + '-check-' + row.id\">{{ '_COMMON._TABLE._THEAD.CHECK_LINE' | translate }} {{ row.id }}</label>\n </td>\n }\n @for (column of columns(); track column.key) {\n @if (!column.hidden) {\n <td [class.text-end]=\"column.align === 'right'\" [class.text-center]=\"column.align === 'center'\"\n [class.td-actions]=\"column.type === 'actions'\">\n @switch (column.type) {\n @case ('link') {\n <button type=\"button\" class=\"btn btn-link-like\" (click)=\"onCellClick(row, column)\">\n {{ column.translate ? (row[column.key] | translate) : row[column.key] }}\n </button>\n }\n @case ('badge') {\n <cw-badge\n [type]=\"getBadge(column, row[column.key]).type\"\n [label]=\"getBadge(column, row[column.key]).label ?? row[column.key]\"\n [withIcon]=\"getBadge(column, row[column.key]).withIcon\"\n [iconPosition]=\"getBadge(column, row[column.key]).iconPosition\"></cw-badge>\n }\n @case ('icon') {\n @if (isClickable(column)) {\n <button type=\"button\" class=\"btn btn-link-like\" (click)=\"onCellClick(row, column)\" [attr.aria-label]=\"row[column.key].label\">\n <cw-icon\n [icon]=\"row[column.key].icon\"\n [label]=\"row[column.key].label\"\n [type]=\"iconType.default\"\n [iconSize]=\"iconSize['md']\"\n [iconCssClass]=\"row[column.key].iconCssClass\"\n ></cw-icon>\n </button>\n } @else {\n <cw-icon\n [icon]=\"row[column.key].icon\"\n [label]=\"row[column.key].label\"\n [type]=\"iconType.default\"\n [iconSize]=\"iconSize['md']\"\n [iconCssClass]=\"row[column.key].iconCssClass\"\n ></cw-icon>\n }\n }\n @case ('image') {\n @if (isClickable(column)) {\n <button type=\"button\" class=\"btn btn-link-like\" (click)=\"onCellClick(row, column)\" [attr.aria-label]=\"row[column.key].label\">\n <cw-image\n [source]=\"row[column.key].source\"\n [alt]=\"row[column.key].label\"\n [isAriaHidden]=\"true\"\n [cssClass]=\"row[column.key].iconCssClass\"\n width=\"32\"\n height=\"32\"\n ></cw-image>\n </button>\n } @else {\n <cw-image\n [source]=\"row[column.key].source\"\n [alt]=\"row[column.key].label\"\n [isAriaHidden]=\"true\"\n [cssClass]=\"row[column.key].iconCssClass\"\n width=\"32\"\n height=\"32\"\n ></cw-image>\n }\n }\n @case ('check') {\n @if (isTruthy(row[column.key])) {\n <cw-icon\n [icon]=\"spriteIcon.checkCircle\"\n [label]=\"'_COMMON._PRO_SENTENCE.YES' | translate\"\n [type]=\"iconType.default\"\n iconCssClass=\"text-success\"\n [iconSize]=\"iconSize['md']\"></cw-icon>\n } @else {\n <cw-icon\n [icon]=\"spriteIcon.closeCircle\"\n [label]=\"'_COMMON._PRO_SENTENCE.NO' | translate\"\n [type]=\"iconType.default\"\n iconCssClass=\"text-danger\"\n [iconSize]=\"iconSize['md']\"></cw-icon>\n }\n }\n @case ('progressbar') {\n <div class=\"td-progressbar\">\n <cw-progress-bar\n [value]=\"row[column.key]\"\n [size]=\"progressBarSize.sm\"\n [type]=\"progressBarType.information\"></cw-progress-bar>\n <span class=\"td-progressbar-value\">{{ row[column.key] }}%</span>\n </div>\n }\n @case ('actions') {\n @if (usingRowActions) {\n @let actions = getResolvedActions(row);\n @if (actions.length > 0) {\n @if (!useDropdownActions()) {\n @for (action of actions; track $index) {\n <cw-button\n [type]=\"buttonType.ghost\"\n [label]=\"action.label\"\n [withIcon]=\"action.icon\"\n [link]=\"action.link\"\n [isDisabled]=\"action.disabled\"\n [cssClass]=\"actionCssClass(action)\"\n (btnAction)=\"onRowActionClick(action, row)\">\n </cw-button>\n }\n } @else {\n <cw-button\n [label]=\"'_COMMON._TABLE.ACTIONS_MENU'\"\n [withIcon]=\"spriteIcon.menuVertical\"\n [withOnlyIcon]=\"true\"\n [type]=\"buttonType.ghost\"\n [isDropdown]=\"true\"\n [hideCaret]=\"true\">\n <ul class=\"p-0 m-0\">\n @for (action of actions; track $index) {\n <li>\n @if (action.link) {\n <cw-button\n [type]=\"buttonType.ghost\"\n [label]=\"action.label\"\n [withIcon]=\"action.icon\"\n [link]=\"action.link\"\n [isDisabled]=\"action.disabled\"\n [cssClass]=\"'dropdown-item ' + actionCssClass(action)\">\n </cw-button>\n } @else {\n <cw-button\n [type]=\"buttonType.ghost\"\n [label]=\"action.label\"\n [withIcon]=\"action.icon\"\n [isDisabled]=\"action.disabled\"\n [cssClass]=\"'dropdown-item ' + actionCssClass(action)\"\n (btnAction)=\"onRowActionClick(action, row)\">\n </cw-button>\n }\n </li>\n }\n </ul>\n </cw-button>\n }\n }\n } @else {\n <ng-container\n *ngTemplateOutlet=\"actionsTemplate(); context: { $implicit: row }\">\n </ng-container>\n }\n }\n @default {\n {{ column.translate ? (row[column.key] | translate) : row[column.key] }}\n }\n }\n </td>\n }\n }\n </tr>\n }\n }\n </tbody>\n </table>\n</div>\n\n@if (pagination()) {\n <cw-pagination\n [pagination]=\"pagination()!\"\n (paginationChange)=\"paginationChange.emit($event)\">\n </cw-pagination>\n}\n", dependencies: [{ kind: "ngmodule", type: TranslateModule }, { kind: "component", type: LoaderComponent, selector: "cw-loader", inputs: ["size", "displayText"] }, { kind: "component", type: BadgeComponent, selector: "cw-badge", inputs: ["type", "label", "withIcon", "iconPosition", "cssClass", "skeletonMode", "dataTest"] }, { kind: "component", type: ButtonComponent, selector: "cw-button", inputs: ["type", "label", "id", "link", "isDropdown", "hideCaret", "withIcon", "withOnlyIcon", "iconSize", "iconPosition", "dropdownPosition", "isMinWidth", "isDisabled", "isLoading", "loadingAnnounce", "cssClass", "dataTest", "skeletonMode", "isPressed", "ariaDescribedBy", "withTooltip", "tooltipText", "tooltipTitle", "tooltipTrigger", "tooltipPosition", "tooltipType"], outputs: ["btnAction", "dropDownClicked"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: PaginationComponent, selector: "cw-pagination", inputs: ["pagination"], outputs: ["paginationChange"] }, { kind: "component", type: IconComponent, selector: "cw-icon", inputs: ["icon", "label", "type", "iconSize", "iconCssClass", "iconUiType", "iconColorCustom", "spritePath"] }, { kind: "component", type: ImageComponent, selector: "cw-image", inputs: ["source", "alt", "isAriaHidden", "cssClass", "width", "height"] }, { kind: "component", type: EmptyStateComponent, selector: "cw-empty-state", inputs: ["illustration", "illustrationBasePath", "imageSource", "imageAlt", "title", "titleParams", "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 }); }
|
|
965
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.20", type: TableComponent, isStandalone: true, selector: "cw-table", inputs: { checkbox: { classPropertyName: "checkbox", publicName: "checkbox", isSignal: true, isRequired: false, transformFunction: null }, title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: false, transformFunction: null }, columns: { classPropertyName: "columns", publicName: "columns", isSignal: true, isRequired: false, transformFunction: null }, data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: false, transformFunction: null }, loading: { classPropertyName: "loading", publicName: "loading", isSignal: true, isRequired: false, transformFunction: null }, rowClassFn: { classPropertyName: "rowClassFn", publicName: "rowClassFn", isSignal: true, isRequired: false, transformFunction: null }, pagination: { classPropertyName: "pagination", publicName: "pagination", isSignal: true, isRequired: false, transformFunction: null }, bulkActions: { classPropertyName: "bulkActions", publicName: "bulkActions", isSignal: true, isRequired: false, transformFunction: null }, rowActions: { classPropertyName: "rowActions", publicName: "rowActions", isSignal: true, isRequired: false, transformFunction: null }, emptyStateNoData: { classPropertyName: "emptyStateNoData", publicName: "emptyStateNoData", isSignal: true, isRequired: false, transformFunction: null }, emptyStateNoResult: { classPropertyName: "emptyStateNoResult", publicName: "emptyStateNoResult", isSignal: true, isRequired: false, transformFunction: null }, isFiltered: { classPropertyName: "isFiltered", publicName: "isFiltered", isSignal: true, isRequired: false, transformFunction: null }, showScope: { classPropertyName: "showScope", publicName: "showScope", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { cellClick: "cellClick", sortChange: "sortChange", selectionChange: "selectionChange", paginationChange: "paginationChange", bulkDelete: "bulkDelete", bulkAction: "bulkAction" }, host: { classAttribute: "cw-table" }, queries: [{ propertyName: "actionsTemplate", first: true, predicate: ["actionsTemplate"], descendants: true, isSignal: true }], ngImport: i0, template: "@if (checkbox() && selectionCount() > 0) {\n <!-- Espacement DS : gap-md = 16px = component/button/set/gap (espacement entre\n boutons d'un set). Utilitaires basic-ui (adosses a l'echelle $sizing des\n tokens) et non ceux de Bootstrap : gap-2 valait 8px. d-flex-h centre deja\n verticalement, align-items-center est donc inutile. -->\n <div class=\"table-selection-info mb-md d-flex-h gap-md flex-wrap\">\n <span class=\"flex-grow-1\">\n {{ selectionCount() }} {{ '_COMMON._TABLE._BULK_ACTION.SELECTED_ITEMS_CURRENT_PAGE' | translate }}\n </span>\n @for (action of bulkActions(); track $index) {\n <cw-button\n [type]=\"resolveVariant(action)\"\n [label]=\"action.label\"\n [withIcon]=\"action.icon\"\n [isDisabled]=\"resolveDisabled(action)\"\n (btnAction)=\"onBulkActionClick(action)\">\n </cw-button>\n }\n </div>\n}\n\n<div class=\"table-responsive\">\n <table class=\"table\">\n <caption class=\"visually-hidden\"\n [innerHTML]=\"'_COMMON._TABLE.CAPTION' | translate: { label: (title() | translate) }\"></caption>\n <thead>\n <tr>\n @if(checkbox()) {\n <th scope=\"col\" width=\"10\">\n <div class=\"field-check\">\n <input class=\"field-check-input\" type=\"checkbox\" [id]=\"uid + '-all'\" [checked]=\"allSelected()\"\n [indeterminate]=\"someSelected()\" (change)=\"toggleAll()\">\n <label class=\"field-check-label\" [for]=\"uid + '-all'\">\n <span class=\"visually-hidden\">{{ '_COMMON._TABLE._THEAD.CHECK_LINE' | translate }}</span>\n </label>\n </div>\n </th>\n }\n\n @for (column of columns(); track column.key) {\n @if (!column.hidden) {\n <th scope=\"col\" [class.p-0]=\"column.sort\" [attr.aria-sort]=\"column.sort ? getAriaSort(column.key) : null\">\n @if (column.sort) {\n <button class=\"d-flex-h gap-2xs\" [class]=\"getSortClass(column.key)\" (click)=\"setSortProperty(column.key)\">\n {{ column.label | translate}}\n <cw-icon\n [icon]=\"getSortIcon(column.key)\"\n [label]=\"'_COMMON._TABLE._SORT.LABEL' | translate\"\n [type]=\"iconType.default\"\n [iconSize]=\"iconSize['xs']\"></cw-icon>\n </button>\n }\n @else {\n {{ column.label | translate }}\n }\n </th>\n }\n }\n </tr>\n </thead>\n <tbody>\n @if (loading()) {\n <tr>\n <td [attr.colspan]=\"visibleColumnCount()\">\n <cw-loader></cw-loader>\n </td>\n </tr>\n }\n @else if (!data() || data().length === 0) {\n <tr>\n <td class=\"table-info no-result\" [attr.colspan]=\"visibleColumnCount()\">\n @if (currentEmptyState(); as empty) {\n <cw-empty-state\n [illustration]=\"empty.illustration ?? (isFiltered() ? illustrationEnum.noResult : illustrationEnum.noData)\"\n [imageSource]=\"empty.imageSource\"\n [title]=\"empty.title\"\n [titleParams]=\"empty.titleParams\"\n [titleSuffix]=\"scopeInstance() ? ('_COMMON._PAGE_SCOPE.EMPTY_FOR_INSTANCE' | translate: { instance: scopeInstance() }) : undefined\"\n [description]=\"empty.description\"\n [descriptionParams]=\"empty.descriptionParams\"\n [primaryButton]=\"empty.primaryButton\"\n [secondaryButton]=\"empty.secondaryButton\"\n (primaryClick)=\"empty.primaryButton?.click?.()\"\n (secondaryClick)=\"empty.secondaryButton?.click?.()\">\n </cw-empty-state>\n } @else {\n <!-- Meme regle que le titre du cw-empty-state : mention accolee au message. -->\n {{ ('_COMMON._TABLE.NO_RESULT' | translate) + (scopeInstance() ? ' ' + ('_COMMON._PAGE_SCOPE.EMPTY_FOR_INSTANCE' | translate: { instance: scopeInstance() }) : '') }}\n }\n </td>\n </tr>\n }\n @else {\n @for (row of data(); track row) {\n <tr [class.tr-selected]=\"isSelected(row)\" [class]=\"getRowClass(row)\">\n @if (checkbox()) {\n <td>\n <input class=\"field-check-input\" type=\"checkbox\" [checked]=\"isSelected(row)\" (change)=\"toggleRow(row)\" [id]=\"uid + '-check-' + row.id\"\n [attr.aria-label]=\"('_COMMON._TABLE._THEAD.CHECK_LINE' | translate) + ' ' + row.id\">\n <label class=\"visually-hidden\" [for]=\"uid + '-check-' + row.id\">{{ '_COMMON._TABLE._THEAD.CHECK_LINE' | translate }} {{ row.id }}</label>\n </td>\n }\n @for (column of columns(); track column.key) {\n @if (!column.hidden) {\n <td [class.text-end]=\"column.align === 'right'\" [class.text-center]=\"column.align === 'center'\"\n [class.td-actions]=\"column.type === 'actions'\">\n @switch (column.type) {\n @case ('link') {\n <button type=\"button\" class=\"btn btn-link-like\" (click)=\"onCellClick(row, column)\">\n {{ column.translate ? (row[column.key] | translate) : row[column.key] }}\n </button>\n }\n @case ('badge') {\n <cw-badge\n [type]=\"getBadge(column, row[column.key]).type\"\n [label]=\"getBadge(column, row[column.key]).label ?? row[column.key]\"\n [withIcon]=\"getBadge(column, row[column.key]).withIcon\"\n [iconPosition]=\"getBadge(column, row[column.key]).iconPosition\"></cw-badge>\n }\n @case ('icon') {\n @if (isClickable(column)) {\n <button type=\"button\" class=\"btn btn-link-like\" (click)=\"onCellClick(row, column)\" [attr.aria-label]=\"row[column.key].label\">\n <cw-icon\n [icon]=\"row[column.key].icon\"\n [label]=\"row[column.key].label\"\n [type]=\"iconType.default\"\n [iconSize]=\"iconSize['md']\"\n [iconCssClass]=\"row[column.key].iconCssClass\"\n ></cw-icon>\n </button>\n } @else {\n <cw-icon\n [icon]=\"row[column.key].icon\"\n [label]=\"row[column.key].label\"\n [type]=\"iconType.default\"\n [iconSize]=\"iconSize['md']\"\n [iconCssClass]=\"row[column.key].iconCssClass\"\n ></cw-icon>\n }\n }\n @case ('image') {\n @if (isClickable(column)) {\n <button type=\"button\" class=\"btn btn-link-like\" (click)=\"onCellClick(row, column)\" [attr.aria-label]=\"row[column.key].label\">\n <cw-image\n [source]=\"row[column.key].source\"\n [alt]=\"row[column.key].label\"\n [isAriaHidden]=\"true\"\n [cssClass]=\"row[column.key].iconCssClass\"\n width=\"32\"\n height=\"32\"\n ></cw-image>\n </button>\n } @else {\n <cw-image\n [source]=\"row[column.key].source\"\n [alt]=\"row[column.key].label\"\n [isAriaHidden]=\"true\"\n [cssClass]=\"row[column.key].iconCssClass\"\n width=\"32\"\n height=\"32\"\n ></cw-image>\n }\n }\n @case ('check') {\n @if (isTruthy(row[column.key])) {\n <cw-icon\n [icon]=\"spriteIcon.checkCircle\"\n [label]=\"'_COMMON._PRO_SENTENCE.YES' | translate\"\n [type]=\"iconType.default\"\n iconCssClass=\"text-success\"\n [iconSize]=\"iconSize['md']\"></cw-icon>\n } @else {\n <cw-icon\n [icon]=\"spriteIcon.closeCircle\"\n [label]=\"'_COMMON._PRO_SENTENCE.NO' | translate\"\n [type]=\"iconType.default\"\n iconCssClass=\"text-danger\"\n [iconSize]=\"iconSize['md']\"></cw-icon>\n }\n }\n @case ('progressbar') {\n <div class=\"td-progressbar\">\n <cw-progress-bar\n [value]=\"row[column.key]\"\n [size]=\"progressBarSize.sm\"\n [type]=\"progressBarType.information\"></cw-progress-bar>\n <span class=\"td-progressbar-value\">{{ row[column.key] }}%</span>\n </div>\n }\n @case ('actions') {\n @if (usingRowActions) {\n @let actions = getResolvedActions(row);\n @if (actions.length > 0) {\n @if (!useDropdownActions()) {\n @for (action of actions; track $index) {\n <cw-button\n [type]=\"buttonType.ghost\"\n [label]=\"action.label\"\n [withIcon]=\"action.icon\"\n [link]=\"action.link\"\n [isDisabled]=\"action.disabled\"\n [cssClass]=\"actionCssClass(action)\"\n (btnAction)=\"onRowActionClick(action, row)\">\n </cw-button>\n }\n } @else {\n <cw-button\n [label]=\"'_COMMON._TABLE.ACTIONS_MENU'\"\n [withIcon]=\"spriteIcon.menuVertical\"\n [withOnlyIcon]=\"true\"\n [type]=\"buttonType.ghost\"\n [isDropdown]=\"true\"\n [hideCaret]=\"true\">\n <ul class=\"p-0 m-0\">\n @for (action of actions; track $index) {\n <li>\n @if (action.link) {\n <cw-button\n [type]=\"buttonType.ghost\"\n [label]=\"action.label\"\n [withIcon]=\"action.icon\"\n [link]=\"action.link\"\n [isDisabled]=\"action.disabled\"\n [cssClass]=\"'dropdown-item ' + actionCssClass(action)\">\n </cw-button>\n } @else {\n <cw-button\n [type]=\"buttonType.ghost\"\n [label]=\"action.label\"\n [withIcon]=\"action.icon\"\n [isDisabled]=\"action.disabled\"\n [cssClass]=\"'dropdown-item ' + actionCssClass(action)\"\n (btnAction)=\"onRowActionClick(action, row)\">\n </cw-button>\n }\n </li>\n }\n </ul>\n </cw-button>\n }\n }\n } @else {\n <ng-container\n *ngTemplateOutlet=\"actionsTemplate(); context: { $implicit: row }\">\n </ng-container>\n }\n }\n @default {\n {{ column.translate ? (row[column.key] | translate) : row[column.key] }}\n }\n }\n </td>\n }\n }\n </tr>\n }\n }\n </tbody>\n </table>\n</div>\n\n@if (pagination()) {\n <cw-pagination\n [pagination]=\"pagination()!\"\n (paginationChange)=\"paginationChange.emit($event)\">\n </cw-pagination>\n}\n", dependencies: [{ kind: "ngmodule", type: TranslateModule }, { kind: "component", type: LoaderComponent, selector: "cw-loader", inputs: ["size", "displayText"] }, { kind: "component", type: BadgeComponent, selector: "cw-badge", inputs: ["type", "label", "withIcon", "iconPosition", "cssClass", "skeletonMode", "dataTest"] }, { kind: "component", type: ButtonComponent, selector: "cw-button", inputs: ["type", "label", "id", "link", "isDropdown", "hideCaret", "withIcon", "withOnlyIcon", "iconSize", "iconPosition", "dropdownPosition", "isMinWidth", "isDisabled", "isLoading", "loadingAnnounce", "cssClass", "dataTest", "skeletonMode", "isPressed", "ariaDescribedBy", "withTooltip", "tooltipText", "tooltipTitle", "tooltipTrigger", "tooltipPosition", "tooltipType"], outputs: ["btnAction", "dropDownClicked"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: PaginationComponent, selector: "cw-pagination", inputs: ["pagination"], outputs: ["paginationChange"] }, { kind: "component", type: IconComponent, selector: "cw-icon", inputs: ["icon", "label", "type", "iconSize", "iconCssClass", "iconUiType", "iconColorCustom", "spritePath"] }, { kind: "component", type: ImageComponent, selector: "cw-image", inputs: ["source", "alt", "isAriaHidden", "cssClass", "width", "height"] }, { kind: "component", type: EmptyStateComponent, selector: "cw-empty-state", inputs: ["illustration", "illustrationBasePath", "imageSource", "imageAlt", "title", "titleParams", "titleSuffix", "description", "descriptionParams", "primaryButton", "secondaryButton", "dataTest"], outputs: ["primaryClick", "secondaryClick"] }, { kind: "component", type: ProgressBarComponent, selector: "cw-progress-bar", inputs: ["value", "max", "size", "type", "showValue", "label", "dataTest"] }, { kind: "pipe", type: i1.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
966
966
|
}
|
|
967
967
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: TableComponent, decorators: [{
|
|
968
968
|
type: Component,
|
|
@@ -977,7 +977,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.20", ngImpo
|
|
|
977
977
|
ImageComponent,
|
|
978
978
|
EmptyStateComponent,
|
|
979
979
|
ProgressBarComponent
|
|
980
|
-
], template: "@if (checkbox() && selectionCount() > 0) {\n <!-- Espacement DS : gap-md = 16px = component/button/set/gap (espacement entre\n boutons d'un set). Utilitaires basic-ui (adosses a l'echelle $sizing des\n tokens) et non ceux de Bootstrap : gap-2 valait 8px. d-flex-h centre deja\n verticalement, align-items-center est donc inutile. -->\n <div class=\"table-selection-info mb-md d-flex-h gap-md flex-wrap\">\n <span class=\"flex-grow-1\">\n {{ selectionCount() }} {{ '_COMMON._TABLE._BULK_ACTION.SELECTED_ITEMS_CURRENT_PAGE' | translate }}\n </span>\n @for (action of bulkActions(); track $index) {\n <cw-button\n [type]=\"resolveVariant(action)\"\n [label]=\"action.label\"\n [withIcon]=\"action.icon\"\n [isDisabled]=\"resolveDisabled(action)\"\n (btnAction)=\"onBulkActionClick(action)\">\n </cw-button>\n }\n </div>\n}\n\n<div class=\"table-responsive\">\n <table class=\"table\">\n <caption class=\"visually-hidden\"\n [innerHTML]=\"'_COMMON._TABLE.CAPTION' | translate: { label: (title() | translate) }\"></caption>\n <thead>\n <tr>\n @if(checkbox()) {\n <th scope=\"col\" width=\"10\">\n <div class=\"field-check\">\n <input class=\"field-check-input\" type=\"checkbox\" [id]=\"uid + '-all'\" [checked]=\"allSelected()\"\n [indeterminate]=\"someSelected()\" (change)=\"toggleAll()\">\n <label class=\"field-check-label\" [for]=\"uid + '-all'\">\n <span class=\"visually-hidden\">{{ '_COMMON._TABLE._THEAD.CHECK_LINE' | translate }}</span>\n </label>\n </div>\n </th>\n }\n\n @for (column of columns(); track column.key) {\n @if (!column.hidden) {\n <th scope=\"col\" [class.p-0]=\"column.sort\" [attr.aria-sort]=\"column.sort ? getAriaSort(column.key) : null\">\n @if (column.sort) {\n <button class=\"d-flex-h gap-2xs\" [class]=\"getSortClass(column.key)\" (click)=\"setSortProperty(column.key)\">\n {{ column.label | translate}}\n <cw-icon\n [icon]=\"getSortIcon(column.key)\"\n [label]=\"'_COMMON._TABLE._SORT.LABEL' | translate\"\n [type]=\"iconType.default\"\n [iconSize]=\"iconSize['xs']\"></cw-icon>\n </button>\n }\n @else {\n {{ column.label | translate }}\n }\n </th>\n }\n }\n </tr>\n </thead>\n <tbody>\n @if (loading()) {\n <tr>\n <td [attr.colspan]=\"visibleColumnCount()\">\n <cw-loader></cw-loader>\n </td>\n </tr>\n }\n @else if (!data() || data().length === 0) {\n <tr>\n <td class=\"table-info no-result\" [attr.colspan]=\"visibleColumnCount()\">\n @if (currentEmptyState(); as empty) {\n <cw-empty-state\n [illustration]=\"empty.illustration ?? (isFiltered() ? illustrationEnum.noResult : illustrationEnum.noData)\"\n [imageSource]=\"empty.imageSource\"\n [title]=\"empty.title\"\n [titleParams]=\"empty.titleParams\"\n [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 @if (scopeInstance(); as instance) {\n <p class=\"empty-state-description table-scope-mention\">\n {{ '_COMMON._PAGE_SCOPE.EMPTY_FOR_INSTANCE' | translate: { instance } }}\n </p>\n }\n </cw-empty-state>\n } @else {\n {{ '_COMMON._TABLE.NO_RESULT' | translate }}\n @if (scopeInstance(); as instance) {\n <br /><span class=\"table-scope-mention\">{{ '_COMMON._PAGE_SCOPE.EMPTY_FOR_INSTANCE' | translate: { instance } }}</span>\n }\n }\n </td>\n </tr>\n }\n @else {\n @for (row of data(); track row) {\n <tr [class.tr-selected]=\"isSelected(row)\" [class]=\"getRowClass(row)\">\n @if (checkbox()) {\n <td>\n <input class=\"field-check-input\" type=\"checkbox\" [checked]=\"isSelected(row)\" (change)=\"toggleRow(row)\" [id]=\"uid + '-check-' + row.id\"\n [attr.aria-label]=\"('_COMMON._TABLE._THEAD.CHECK_LINE' | translate) + ' ' + row.id\">\n <label class=\"visually-hidden\" [for]=\"uid + '-check-' + row.id\">{{ '_COMMON._TABLE._THEAD.CHECK_LINE' | translate }} {{ row.id }}</label>\n </td>\n }\n @for (column of columns(); track column.key) {\n @if (!column.hidden) {\n <td [class.text-end]=\"column.align === 'right'\" [class.text-center]=\"column.align === 'center'\"\n [class.td-actions]=\"column.type === 'actions'\">\n @switch (column.type) {\n @case ('link') {\n <button type=\"button\" class=\"btn btn-link-like\" (click)=\"onCellClick(row, column)\">\n {{ column.translate ? (row[column.key] | translate) : row[column.key] }}\n </button>\n }\n @case ('badge') {\n <cw-badge\n [type]=\"getBadge(column, row[column.key]).type\"\n [label]=\"getBadge(column, row[column.key]).label ?? row[column.key]\"\n [withIcon]=\"getBadge(column, row[column.key]).withIcon\"\n [iconPosition]=\"getBadge(column, row[column.key]).iconPosition\"></cw-badge>\n }\n @case ('icon') {\n @if (isClickable(column)) {\n <button type=\"button\" class=\"btn btn-link-like\" (click)=\"onCellClick(row, column)\" [attr.aria-label]=\"row[column.key].label\">\n <cw-icon\n [icon]=\"row[column.key].icon\"\n [label]=\"row[column.key].label\"\n [type]=\"iconType.default\"\n [iconSize]=\"iconSize['md']\"\n [iconCssClass]=\"row[column.key].iconCssClass\"\n ></cw-icon>\n </button>\n } @else {\n <cw-icon\n [icon]=\"row[column.key].icon\"\n [label]=\"row[column.key].label\"\n [type]=\"iconType.default\"\n [iconSize]=\"iconSize['md']\"\n [iconCssClass]=\"row[column.key].iconCssClass\"\n ></cw-icon>\n }\n }\n @case ('image') {\n @if (isClickable(column)) {\n <button type=\"button\" class=\"btn btn-link-like\" (click)=\"onCellClick(row, column)\" [attr.aria-label]=\"row[column.key].label\">\n <cw-image\n [source]=\"row[column.key].source\"\n [alt]=\"row[column.key].label\"\n [isAriaHidden]=\"true\"\n [cssClass]=\"row[column.key].iconCssClass\"\n width=\"32\"\n height=\"32\"\n ></cw-image>\n </button>\n } @else {\n <cw-image\n [source]=\"row[column.key].source\"\n [alt]=\"row[column.key].label\"\n [isAriaHidden]=\"true\"\n [cssClass]=\"row[column.key].iconCssClass\"\n width=\"32\"\n height=\"32\"\n ></cw-image>\n }\n }\n @case ('check') {\n @if (isTruthy(row[column.key])) {\n <cw-icon\n [icon]=\"spriteIcon.checkCircle\"\n [label]=\"'_COMMON._PRO_SENTENCE.YES' | translate\"\n [type]=\"iconType.default\"\n iconCssClass=\"text-success\"\n [iconSize]=\"iconSize['md']\"></cw-icon>\n } @else {\n <cw-icon\n [icon]=\"spriteIcon.closeCircle\"\n [label]=\"'_COMMON._PRO_SENTENCE.NO' | translate\"\n [type]=\"iconType.default\"\n iconCssClass=\"text-danger\"\n [iconSize]=\"iconSize['md']\"></cw-icon>\n }\n }\n @case ('progressbar') {\n <div class=\"td-progressbar\">\n <cw-progress-bar\n [value]=\"row[column.key]\"\n [size]=\"progressBarSize.sm\"\n [type]=\"progressBarType.information\"></cw-progress-bar>\n <span class=\"td-progressbar-value\">{{ row[column.key] }}%</span>\n </div>\n }\n @case ('actions') {\n @if (usingRowActions) {\n @let actions = getResolvedActions(row);\n @if (actions.length > 0) {\n @if (!useDropdownActions()) {\n @for (action of actions; track $index) {\n <cw-button\n [type]=\"buttonType.ghost\"\n [label]=\"action.label\"\n [withIcon]=\"action.icon\"\n [link]=\"action.link\"\n [isDisabled]=\"action.disabled\"\n [cssClass]=\"actionCssClass(action)\"\n (btnAction)=\"onRowActionClick(action, row)\">\n </cw-button>\n }\n } @else {\n <cw-button\n [label]=\"'_COMMON._TABLE.ACTIONS_MENU'\"\n [withIcon]=\"spriteIcon.menuVertical\"\n [withOnlyIcon]=\"true\"\n [type]=\"buttonType.ghost\"\n [isDropdown]=\"true\"\n [hideCaret]=\"true\">\n <ul class=\"p-0 m-0\">\n @for (action of actions; track $index) {\n <li>\n @if (action.link) {\n <cw-button\n [type]=\"buttonType.ghost\"\n [label]=\"action.label\"\n [withIcon]=\"action.icon\"\n [link]=\"action.link\"\n [isDisabled]=\"action.disabled\"\n [cssClass]=\"'dropdown-item ' + actionCssClass(action)\">\n </cw-button>\n } @else {\n <cw-button\n [type]=\"buttonType.ghost\"\n [label]=\"action.label\"\n [withIcon]=\"action.icon\"\n [isDisabled]=\"action.disabled\"\n [cssClass]=\"'dropdown-item ' + actionCssClass(action)\"\n (btnAction)=\"onRowActionClick(action, row)\">\n </cw-button>\n }\n </li>\n }\n </ul>\n </cw-button>\n }\n }\n } @else {\n <ng-container\n *ngTemplateOutlet=\"actionsTemplate(); context: { $implicit: row }\">\n </ng-container>\n }\n }\n @default {\n {{ column.translate ? (row[column.key] | translate) : row[column.key] }}\n }\n }\n </td>\n }\n }\n </tr>\n }\n }\n </tbody>\n </table>\n</div>\n\n@if (pagination()) {\n <cw-pagination\n [pagination]=\"pagination()!\"\n (paginationChange)=\"paginationChange.emit($event)\">\n </cw-pagination>\n}\n" }]
|
|
980
|
+
], template: "@if (checkbox() && selectionCount() > 0) {\n <!-- Espacement DS : gap-md = 16px = component/button/set/gap (espacement entre\n boutons d'un set). Utilitaires basic-ui (adosses a l'echelle $sizing des\n tokens) et non ceux de Bootstrap : gap-2 valait 8px. d-flex-h centre deja\n verticalement, align-items-center est donc inutile. -->\n <div class=\"table-selection-info mb-md d-flex-h gap-md flex-wrap\">\n <span class=\"flex-grow-1\">\n {{ selectionCount() }} {{ '_COMMON._TABLE._BULK_ACTION.SELECTED_ITEMS_CURRENT_PAGE' | translate }}\n </span>\n @for (action of bulkActions(); track $index) {\n <cw-button\n [type]=\"resolveVariant(action)\"\n [label]=\"action.label\"\n [withIcon]=\"action.icon\"\n [isDisabled]=\"resolveDisabled(action)\"\n (btnAction)=\"onBulkActionClick(action)\">\n </cw-button>\n }\n </div>\n}\n\n<div class=\"table-responsive\">\n <table class=\"table\">\n <caption class=\"visually-hidden\"\n [innerHTML]=\"'_COMMON._TABLE.CAPTION' | translate: { label: (title() | translate) }\"></caption>\n <thead>\n <tr>\n @if(checkbox()) {\n <th scope=\"col\" width=\"10\">\n <div class=\"field-check\">\n <input class=\"field-check-input\" type=\"checkbox\" [id]=\"uid + '-all'\" [checked]=\"allSelected()\"\n [indeterminate]=\"someSelected()\" (change)=\"toggleAll()\">\n <label class=\"field-check-label\" [for]=\"uid + '-all'\">\n <span class=\"visually-hidden\">{{ '_COMMON._TABLE._THEAD.CHECK_LINE' | translate }}</span>\n </label>\n </div>\n </th>\n }\n\n @for (column of columns(); track column.key) {\n @if (!column.hidden) {\n <th scope=\"col\" [class.p-0]=\"column.sort\" [attr.aria-sort]=\"column.sort ? getAriaSort(column.key) : null\">\n @if (column.sort) {\n <button class=\"d-flex-h gap-2xs\" [class]=\"getSortClass(column.key)\" (click)=\"setSortProperty(column.key)\">\n {{ column.label | translate}}\n <cw-icon\n [icon]=\"getSortIcon(column.key)\"\n [label]=\"'_COMMON._TABLE._SORT.LABEL' | translate\"\n [type]=\"iconType.default\"\n [iconSize]=\"iconSize['xs']\"></cw-icon>\n </button>\n }\n @else {\n {{ column.label | translate }}\n }\n </th>\n }\n }\n </tr>\n </thead>\n <tbody>\n @if (loading()) {\n <tr>\n <td [attr.colspan]=\"visibleColumnCount()\">\n <cw-loader></cw-loader>\n </td>\n </tr>\n }\n @else if (!data() || data().length === 0) {\n <tr>\n <td class=\"table-info no-result\" [attr.colspan]=\"visibleColumnCount()\">\n @if (currentEmptyState(); as empty) {\n <cw-empty-state\n [illustration]=\"empty.illustration ?? (isFiltered() ? illustrationEnum.noResult : illustrationEnum.noData)\"\n [imageSource]=\"empty.imageSource\"\n [title]=\"empty.title\"\n [titleParams]=\"empty.titleParams\"\n [titleSuffix]=\"scopeInstance() ? ('_COMMON._PAGE_SCOPE.EMPTY_FOR_INSTANCE' | translate: { instance: scopeInstance() }) : undefined\"\n [description]=\"empty.description\"\n [descriptionParams]=\"empty.descriptionParams\"\n [primaryButton]=\"empty.primaryButton\"\n [secondaryButton]=\"empty.secondaryButton\"\n (primaryClick)=\"empty.primaryButton?.click?.()\"\n (secondaryClick)=\"empty.secondaryButton?.click?.()\">\n </cw-empty-state>\n } @else {\n <!-- Meme regle que le titre du cw-empty-state : mention accolee au message. -->\n {{ ('_COMMON._TABLE.NO_RESULT' | translate) + (scopeInstance() ? ' ' + ('_COMMON._PAGE_SCOPE.EMPTY_FOR_INSTANCE' | translate: { instance: scopeInstance() }) : '') }}\n }\n </td>\n </tr>\n }\n @else {\n @for (row of data(); track row) {\n <tr [class.tr-selected]=\"isSelected(row)\" [class]=\"getRowClass(row)\">\n @if (checkbox()) {\n <td>\n <input class=\"field-check-input\" type=\"checkbox\" [checked]=\"isSelected(row)\" (change)=\"toggleRow(row)\" [id]=\"uid + '-check-' + row.id\"\n [attr.aria-label]=\"('_COMMON._TABLE._THEAD.CHECK_LINE' | translate) + ' ' + row.id\">\n <label class=\"visually-hidden\" [for]=\"uid + '-check-' + row.id\">{{ '_COMMON._TABLE._THEAD.CHECK_LINE' | translate }} {{ row.id }}</label>\n </td>\n }\n @for (column of columns(); track column.key) {\n @if (!column.hidden) {\n <td [class.text-end]=\"column.align === 'right'\" [class.text-center]=\"column.align === 'center'\"\n [class.td-actions]=\"column.type === 'actions'\">\n @switch (column.type) {\n @case ('link') {\n <button type=\"button\" class=\"btn btn-link-like\" (click)=\"onCellClick(row, column)\">\n {{ column.translate ? (row[column.key] | translate) : row[column.key] }}\n </button>\n }\n @case ('badge') {\n <cw-badge\n [type]=\"getBadge(column, row[column.key]).type\"\n [label]=\"getBadge(column, row[column.key]).label ?? row[column.key]\"\n [withIcon]=\"getBadge(column, row[column.key]).withIcon\"\n [iconPosition]=\"getBadge(column, row[column.key]).iconPosition\"></cw-badge>\n }\n @case ('icon') {\n @if (isClickable(column)) {\n <button type=\"button\" class=\"btn btn-link-like\" (click)=\"onCellClick(row, column)\" [attr.aria-label]=\"row[column.key].label\">\n <cw-icon\n [icon]=\"row[column.key].icon\"\n [label]=\"row[column.key].label\"\n [type]=\"iconType.default\"\n [iconSize]=\"iconSize['md']\"\n [iconCssClass]=\"row[column.key].iconCssClass\"\n ></cw-icon>\n </button>\n } @else {\n <cw-icon\n [icon]=\"row[column.key].icon\"\n [label]=\"row[column.key].label\"\n [type]=\"iconType.default\"\n [iconSize]=\"iconSize['md']\"\n [iconCssClass]=\"row[column.key].iconCssClass\"\n ></cw-icon>\n }\n }\n @case ('image') {\n @if (isClickable(column)) {\n <button type=\"button\" class=\"btn btn-link-like\" (click)=\"onCellClick(row, column)\" [attr.aria-label]=\"row[column.key].label\">\n <cw-image\n [source]=\"row[column.key].source\"\n [alt]=\"row[column.key].label\"\n [isAriaHidden]=\"true\"\n [cssClass]=\"row[column.key].iconCssClass\"\n width=\"32\"\n height=\"32\"\n ></cw-image>\n </button>\n } @else {\n <cw-image\n [source]=\"row[column.key].source\"\n [alt]=\"row[column.key].label\"\n [isAriaHidden]=\"true\"\n [cssClass]=\"row[column.key].iconCssClass\"\n width=\"32\"\n height=\"32\"\n ></cw-image>\n }\n }\n @case ('check') {\n @if (isTruthy(row[column.key])) {\n <cw-icon\n [icon]=\"spriteIcon.checkCircle\"\n [label]=\"'_COMMON._PRO_SENTENCE.YES' | translate\"\n [type]=\"iconType.default\"\n iconCssClass=\"text-success\"\n [iconSize]=\"iconSize['md']\"></cw-icon>\n } @else {\n <cw-icon\n [icon]=\"spriteIcon.closeCircle\"\n [label]=\"'_COMMON._PRO_SENTENCE.NO' | translate\"\n [type]=\"iconType.default\"\n iconCssClass=\"text-danger\"\n [iconSize]=\"iconSize['md']\"></cw-icon>\n }\n }\n @case ('progressbar') {\n <div class=\"td-progressbar\">\n <cw-progress-bar\n [value]=\"row[column.key]\"\n [size]=\"progressBarSize.sm\"\n [type]=\"progressBarType.information\"></cw-progress-bar>\n <span class=\"td-progressbar-value\">{{ row[column.key] }}%</span>\n </div>\n }\n @case ('actions') {\n @if (usingRowActions) {\n @let actions = getResolvedActions(row);\n @if (actions.length > 0) {\n @if (!useDropdownActions()) {\n @for (action of actions; track $index) {\n <cw-button\n [type]=\"buttonType.ghost\"\n [label]=\"action.label\"\n [withIcon]=\"action.icon\"\n [link]=\"action.link\"\n [isDisabled]=\"action.disabled\"\n [cssClass]=\"actionCssClass(action)\"\n (btnAction)=\"onRowActionClick(action, row)\">\n </cw-button>\n }\n } @else {\n <cw-button\n [label]=\"'_COMMON._TABLE.ACTIONS_MENU'\"\n [withIcon]=\"spriteIcon.menuVertical\"\n [withOnlyIcon]=\"true\"\n [type]=\"buttonType.ghost\"\n [isDropdown]=\"true\"\n [hideCaret]=\"true\">\n <ul class=\"p-0 m-0\">\n @for (action of actions; track $index) {\n <li>\n @if (action.link) {\n <cw-button\n [type]=\"buttonType.ghost\"\n [label]=\"action.label\"\n [withIcon]=\"action.icon\"\n [link]=\"action.link\"\n [isDisabled]=\"action.disabled\"\n [cssClass]=\"'dropdown-item ' + actionCssClass(action)\">\n </cw-button>\n } @else {\n <cw-button\n [type]=\"buttonType.ghost\"\n [label]=\"action.label\"\n [withIcon]=\"action.icon\"\n [isDisabled]=\"action.disabled\"\n [cssClass]=\"'dropdown-item ' + actionCssClass(action)\"\n (btnAction)=\"onRowActionClick(action, row)\">\n </cw-button>\n }\n </li>\n }\n </ul>\n </cw-button>\n }\n }\n } @else {\n <ng-container\n *ngTemplateOutlet=\"actionsTemplate(); context: { $implicit: row }\">\n </ng-container>\n }\n }\n @default {\n {{ column.translate ? (row[column.key] | translate) : row[column.key] }}\n }\n }\n </td>\n }\n }\n </tr>\n }\n }\n </tbody>\n </table>\n</div>\n\n@if (pagination()) {\n <cw-pagination\n [pagination]=\"pagination()!\"\n (paginationChange)=\"paginationChange.emit($event)\">\n </cw-pagination>\n}\n" }]
|
|
981
981
|
}], ctorParameters: () => [], propDecorators: { checkbox: [{ type: i0.Input, args: [{ isSignal: true, alias: "checkbox", required: false }] }], title: [{ type: i0.Input, args: [{ isSignal: true, alias: "title", required: false }] }], columns: [{ type: i0.Input, args: [{ isSignal: true, alias: "columns", required: false }] }], data: [{ type: i0.Input, args: [{ isSignal: true, alias: "data", required: false }] }], loading: [{ type: i0.Input, args: [{ isSignal: true, alias: "loading", required: false }] }], rowClassFn: [{ type: i0.Input, args: [{ isSignal: true, alias: "rowClassFn", required: false }] }], pagination: [{ type: i0.Input, args: [{ isSignal: true, alias: "pagination", required: false }] }], bulkActions: [{ type: i0.Input, args: [{ isSignal: true, alias: "bulkActions", required: false }] }], rowActions: [{ type: i0.Input, args: [{ isSignal: true, alias: "rowActions", required: false }] }], emptyStateNoData: [{ type: i0.Input, args: [{ isSignal: true, alias: "emptyStateNoData", required: false }] }], emptyStateNoResult: [{ type: i0.Input, args: [{ isSignal: true, alias: "emptyStateNoResult", required: false }] }], isFiltered: [{ type: i0.Input, args: [{ isSignal: true, alias: "isFiltered", required: false }] }], showScope: [{ type: i0.Input, args: [{ isSignal: true, alias: "showScope", required: false }] }], cellClick: [{ type: i0.Output, args: ["cellClick"] }], sortChange: [{ type: i0.Output, args: ["sortChange"] }], selectionChange: [{ type: i0.Output, args: ["selectionChange"] }], paginationChange: [{ type: i0.Output, args: ["paginationChange"] }], bulkDelete: [{ type: i0.Output, args: ["bulkDelete"] }], bulkAction: [{ type: i0.Output, args: ["bulkAction"] }], actionsTemplate: [{ type: i0.ContentChild, args: ['actionsTemplate', { isSignal: true }] }] } });
|
|
982
982
|
|
|
983
983
|
const RANGE_TYPES = new Set([
|
|
@@ -2103,8 +2103,6 @@ function saveHiddenColumns(storageKey, hiddenKeys) {
|
|
|
2103
2103
|
}
|
|
2104
2104
|
}
|
|
2105
2105
|
|
|
2106
|
-
/** Compteur de module pour l'id du rappel de portee (pas de `crypto.randomUUID`, cf. ESLint). */
|
|
2107
|
-
let nextReminderId = 0;
|
|
2108
2106
|
class PageHeaderComponent {
|
|
2109
2107
|
constructor() {
|
|
2110
2108
|
this.location = inject(Location);
|
|
@@ -2130,7 +2128,6 @@ class PageHeaderComponent {
|
|
|
2130
2128
|
this.columnsChange = output();
|
|
2131
2129
|
this.buttonType = BoButtonTypeEnum;
|
|
2132
2130
|
this.iconSize = ButtonIconSizeEnum;
|
|
2133
|
-
this.iconSizeEnum = IconSizeEnum;
|
|
2134
2131
|
this.spriteIcon = SpriteIconEnum;
|
|
2135
2132
|
this.actionEnum = PageHeaderActionEnum;
|
|
2136
2133
|
/** Badge de portee globale (`light-info`) ; l'instance a son badge maison. */
|
|
@@ -2138,10 +2135,6 @@ class PageHeaderComponent {
|
|
|
2138
2135
|
this.showReset = computed(() => this.actions().includes(PageHeaderActionEnum.reset), ...(ngDevMode ? [{ debugName: "showReset" }] : []));
|
|
2139
2136
|
this.showAdd = computed(() => this.actions().includes(PageHeaderActionEnum.add), ...(ngDevMode ? [{ debugName: "showAdd" }] : []));
|
|
2140
2137
|
this.showSave = computed(() => this.actions().includes(PageHeaderActionEnum.save), ...(ngDevMode ? [{ debugName: "showSave" }] : []));
|
|
2141
|
-
/** Rappel sous Enregistrer : portee globale ET action `save` affichee. */
|
|
2142
|
-
this.showScopeReminder = computed(() => this.showSave() && this.pageScope()?.kind === 'global', ...(ngDevMode ? [{ debugName: "showScopeReminder" }] : []));
|
|
2143
|
-
/** Id du rappel, reference par `aria-describedby` sur le bouton Enregistrer. */
|
|
2144
|
-
this.reminderId = `cw-page-header-scope-reminder-${nextReminderId++}`;
|
|
2145
2138
|
/** Colonnes masquables (hors `actions` et hors `hideable === false`). */
|
|
2146
2139
|
this.toggleableColumns = computed(() => this.columns().filter(c => c.type !== 'actions' && c.hideable !== false), ...(ngDevMode ? [{ debugName: "toggleableColumns" }] : []));
|
|
2147
2140
|
/** Le dropdown « Colonnes » n'apparait que s'il existe au moins une colonne masquable. */
|
|
@@ -2203,7 +2196,7 @@ class PageHeaderComponent {
|
|
|
2203
2196
|
return !!this.isDisabled()[action];
|
|
2204
2197
|
}
|
|
2205
2198
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: PageHeaderComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2206
|
-
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
|
|
2199
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.20", type: PageHeaderComponent, isStandalone: true, selector: "cw-page-header", inputs: { title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: true, transformFunction: null }, description: { classPropertyName: "description", publicName: "description", isSignal: true, isRequired: false, transformFunction: null }, showBack: { classPropertyName: "showBack", publicName: "showBack", isSignal: true, isRequired: false, transformFunction: null }, actions: { classPropertyName: "actions", publicName: "actions", isSignal: true, isRequired: false, transformFunction: null }, isLoading: { classPropertyName: "isLoading", publicName: "isLoading", isSignal: true, isRequired: false, transformFunction: null }, isDisabled: { classPropertyName: "isDisabled", publicName: "isDisabled", isSignal: true, isRequired: false, transformFunction: null }, showScope: { classPropertyName: "showScope", publicName: "showScope", isSignal: true, isRequired: false, transformFunction: null }, columns: { classPropertyName: "columns", publicName: "columns", isSignal: true, isRequired: false, transformFunction: null }, storageKey: { classPropertyName: "storageKey", publicName: "storageKey", isSignal: true, isRequired: false, transformFunction: null }, columnsLabel: { classPropertyName: "columnsLabel", publicName: "columnsLabel", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { action: "action", columnsChange: "columnsChange" }, ngImport: i0, template: "<div class=\"page-header d-flex-v gap-2xs\">\r\n @if (showBack()) {\r\n <cw-button [type]=\"buttonType.ghost\" [label]=\"'_COMMON._FORM.BACK'\" [withIcon]=\"spriteIcon.left1\"\r\n (btnAction)=\"goBack()\" />\r\n }\r\n <div class=\"d-flex-h gap-md items-start justify-between flex-wrap\">\r\n <div class=\"d-flex-v\">\r\n <!-- Badge de portee HORS du <h1> : le nom accessible du titre reste le titre. -->\r\n <div class=\"page-header-heading d-flex-h gap-sm flex-wrap items-center\">\r\n <h1 class=\"page-header-title\">{{ title() | translate}}</h1>\r\n @if (showScope() && pageScope(); as scope) {\r\n @if (scope.kind === 'instance') {\r\n <!-- Badge maison : structure `.badge` de basic-ui, couleurs et logo propres (cf. _page-header.scss). -->\r\n <span class=\"badge page-header-scope-instance\">\r\n @if (scope.imageUrl; as img) {\r\n <img class=\"page-header-scope-logo\" [src]=\"img\" alt=\"\" />\r\n } @else {\r\n <cw-icon [icon]=\"spriteIcon.poiCompany\" aria-hidden=\"true\" />\r\n }\r\n <span class=\"visually-hidden\">{{ '_COMMON._PAGE_SCOPE.INSTANCE_PREFIX' | translate }}</span>\r\n <span>{{ scope.label }}</span>\r\n </span>\r\n } @else {\r\n <cw-badge [type]=\"badgeType.lightInfo\" [label]=\"'_COMMON._PAGE_SCOPE.ALL_INSTANCES'\"\r\n [withIcon]=\"spriteIcon.mapWorld\" />\r\n }\r\n }\r\n </div>\r\n @if (description(); as desc) {\r\n <p class=\"fs-md page-header-description\" [innerHTML]=\"desc | translate\"></p>\r\n }\r\n </div>\r\n\r\n <div class=\"d-flex-v gap-2xs\">\r\n <div class=\"page-header-actions d-flex-h gap-md flex-wrap items-center justify-end\">\r\n @if (showColumns()) {\r\n <cw-button [type]=\"buttonType.secondary\" [label]=\"columnsLabel()\" [withIcon]=\"spriteIcon.miscNews\"\r\n [isDropdown]=\"true\">\r\n <ul class=\"d-flex-v gap-2xs p-md\">\r\n @for (col of toggleableColumns(); track col.key) {\r\n <li class=\"field-check\">\r\n <input class=\"field-check-input\" type=\"checkbox\" [id]=\"'col-toggle-' + col.key\"\r\n [checked]=\"!col.hidden\" [disabled]=\"isLastVisible(col)\" (change)=\"toggleColumn(col)\">\r\n <label class=\"field-check-label\" [for]=\"'col-toggle-' + col.key\">{{ col.label | translate }}</label>\r\n </li>\r\n }\r\n </ul>\r\n </cw-button>\r\n }\r\n\r\n <!-- Slot de l'import : `<cw-import-button cwPageHeaderImport \u2026>`. Projete plutot que\r\n rendu, pour que `cw-page-header` ne reference pas `cw-import-wizard`. -->\r\n <ng-content select=\"[cwPageHeaderImport]\"></ng-content>\r\n\r\n <!-- Slot de l'export : `<cw-export-button cwPageHeaderExport \u2026>`. -->\r\n <ng-content select=\"[cwPageHeaderExport]\"></ng-content>\r\n\r\n <!-- Slot libre, inchange : tout ce qui n'est marque ni import ni export atterrit ici.\r\n C'est l'echappatoire d'un hote qui veut piloter son propre bouton. -->\r\n <ng-content></ng-content>\r\n\r\n @if (showReset()) {\r\n <cw-button [type]=\"buttonType.secondary\" [label]=\"'_COMMON._ACTION.RESET'\"\r\n [isDisabled]=\"disabled(actionEnum.reset)\" [isLoading]=\"loading(actionEnum.reset)\"\r\n (btnAction)=\"emit(actionEnum.reset)\">\r\n </cw-button>\r\n }\r\n\r\n @if (showAdd()) {\r\n <cw-button [type]=\"buttonType.primary\" [label]=\"'_COMMON._ACTION.ADD'\" [withIcon]=\"spriteIcon.add\"\r\n [isDisabled]=\"disabled(actionEnum.add)\" [isLoading]=\"loading(actionEnum.add)\"\r\n (btnAction)=\"emit(actionEnum.add)\">\r\n </cw-button>\r\n }\r\n\r\n @if (showSave()) {\r\n <cw-button [type]=\"buttonType.primary\" [label]=\"'_COMMON._ACTION.SAVE'\" [isDisabled]=\"disabled(actionEnum.save)\"\r\n [isLoading]=\"loading(actionEnum.save)\" (btnAction)=\"emit(actionEnum.save)\">\r\n </cw-button>\r\n }\r\n </div>\r\n </div>\r\n </div>\r\n\r\n</div>\r\n", dependencies: [{ kind: "component", type: BadgeComponent, selector: "cw-badge", inputs: ["type", "label", "withIcon", "iconPosition", "cssClass", "skeletonMode", "dataTest"] }, { kind: "component", type: ButtonComponent, selector: "cw-button", inputs: ["type", "label", "id", "link", "isDropdown", "hideCaret", "withIcon", "withOnlyIcon", "iconSize", "iconPosition", "dropdownPosition", "isMinWidth", "isDisabled", "isLoading", "loadingAnnounce", "cssClass", "dataTest", "skeletonMode", "isPressed", "ariaDescribedBy", "withTooltip", "tooltipText", "tooltipTitle", "tooltipTrigger", "tooltipPosition", "tooltipType"], outputs: ["btnAction", "dropDownClicked"] }, { kind: "component", type: IconComponent, selector: "cw-icon", inputs: ["icon", "label", "type", "iconSize", "iconCssClass", "iconUiType", "iconColorCustom", "spritePath"] }, { kind: "ngmodule", type: TranslateModule }, { kind: "pipe", type: i1.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
2207
2200
|
}
|
|
2208
2201
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: PageHeaderComponent, decorators: [{
|
|
2209
2202
|
type: Component,
|
|
@@ -2212,7 +2205,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.20", ngImpo
|
|
|
2212
2205
|
ButtonComponent,
|
|
2213
2206
|
IconComponent,
|
|
2214
2207
|
TranslateModule
|
|
2215
|
-
], 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
|
|
2208
|
+
], template: "<div class=\"page-header d-flex-v gap-2xs\">\r\n @if (showBack()) {\r\n <cw-button [type]=\"buttonType.ghost\" [label]=\"'_COMMON._FORM.BACK'\" [withIcon]=\"spriteIcon.left1\"\r\n (btnAction)=\"goBack()\" />\r\n }\r\n <div class=\"d-flex-h gap-md items-start justify-between flex-wrap\">\r\n <div class=\"d-flex-v\">\r\n <!-- Badge de portee HORS du <h1> : le nom accessible du titre reste le titre. -->\r\n <div class=\"page-header-heading d-flex-h gap-sm flex-wrap items-center\">\r\n <h1 class=\"page-header-title\">{{ title() | translate}}</h1>\r\n @if (showScope() && pageScope(); as scope) {\r\n @if (scope.kind === 'instance') {\r\n <!-- Badge maison : structure `.badge` de basic-ui, couleurs et logo propres (cf. _page-header.scss). -->\r\n <span class=\"badge page-header-scope-instance\">\r\n @if (scope.imageUrl; as img) {\r\n <img class=\"page-header-scope-logo\" [src]=\"img\" alt=\"\" />\r\n } @else {\r\n <cw-icon [icon]=\"spriteIcon.poiCompany\" aria-hidden=\"true\" />\r\n }\r\n <span class=\"visually-hidden\">{{ '_COMMON._PAGE_SCOPE.INSTANCE_PREFIX' | translate }}</span>\r\n <span>{{ scope.label }}</span>\r\n </span>\r\n } @else {\r\n <cw-badge [type]=\"badgeType.lightInfo\" [label]=\"'_COMMON._PAGE_SCOPE.ALL_INSTANCES'\"\r\n [withIcon]=\"spriteIcon.mapWorld\" />\r\n }\r\n }\r\n </div>\r\n @if (description(); as desc) {\r\n <p class=\"fs-md page-header-description\" [innerHTML]=\"desc | translate\"></p>\r\n }\r\n </div>\r\n\r\n <div class=\"d-flex-v gap-2xs\">\r\n <div class=\"page-header-actions d-flex-h gap-md flex-wrap items-center justify-end\">\r\n @if (showColumns()) {\r\n <cw-button [type]=\"buttonType.secondary\" [label]=\"columnsLabel()\" [withIcon]=\"spriteIcon.miscNews\"\r\n [isDropdown]=\"true\">\r\n <ul class=\"d-flex-v gap-2xs p-md\">\r\n @for (col of toggleableColumns(); track col.key) {\r\n <li class=\"field-check\">\r\n <input class=\"field-check-input\" type=\"checkbox\" [id]=\"'col-toggle-' + col.key\"\r\n [checked]=\"!col.hidden\" [disabled]=\"isLastVisible(col)\" (change)=\"toggleColumn(col)\">\r\n <label class=\"field-check-label\" [for]=\"'col-toggle-' + col.key\">{{ col.label | translate }}</label>\r\n </li>\r\n }\r\n </ul>\r\n </cw-button>\r\n }\r\n\r\n <!-- Slot de l'import : `<cw-import-button cwPageHeaderImport \u2026>`. Projete plutot que\r\n rendu, pour que `cw-page-header` ne reference pas `cw-import-wizard`. -->\r\n <ng-content select=\"[cwPageHeaderImport]\"></ng-content>\r\n\r\n <!-- Slot de l'export : `<cw-export-button cwPageHeaderExport \u2026>`. -->\r\n <ng-content select=\"[cwPageHeaderExport]\"></ng-content>\r\n\r\n <!-- Slot libre, inchange : tout ce qui n'est marque ni import ni export atterrit ici.\r\n C'est l'echappatoire d'un hote qui veut piloter son propre bouton. -->\r\n <ng-content></ng-content>\r\n\r\n @if (showReset()) {\r\n <cw-button [type]=\"buttonType.secondary\" [label]=\"'_COMMON._ACTION.RESET'\"\r\n [isDisabled]=\"disabled(actionEnum.reset)\" [isLoading]=\"loading(actionEnum.reset)\"\r\n (btnAction)=\"emit(actionEnum.reset)\">\r\n </cw-button>\r\n }\r\n\r\n @if (showAdd()) {\r\n <cw-button [type]=\"buttonType.primary\" [label]=\"'_COMMON._ACTION.ADD'\" [withIcon]=\"spriteIcon.add\"\r\n [isDisabled]=\"disabled(actionEnum.add)\" [isLoading]=\"loading(actionEnum.add)\"\r\n (btnAction)=\"emit(actionEnum.add)\">\r\n </cw-button>\r\n }\r\n\r\n @if (showSave()) {\r\n <cw-button [type]=\"buttonType.primary\" [label]=\"'_COMMON._ACTION.SAVE'\" [isDisabled]=\"disabled(actionEnum.save)\"\r\n [isLoading]=\"loading(actionEnum.save)\" (btnAction)=\"emit(actionEnum.save)\">\r\n </cw-button>\r\n }\r\n </div>\r\n </div>\r\n </div>\r\n\r\n</div>\r\n" }]
|
|
2216
2209
|
}], 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"] }] } });
|
|
2217
2210
|
|
|
2218
2211
|
class WizardStepComponent {
|