@cityway/basic-ui 1.1.0-beta026 → 1.1.0-beta027
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/README.md +77 -74
- package/cityway-basic-ui-1.1.0-beta027.tgz +0 -0
- package/docs/00-overview.md +209 -209
- package/docs/components/badge.md +148 -147
- package/docs/components/card.md +264 -253
- package/docs/components/tab.md +239 -192
- package/fesm2022/cityway-basic-ui.mjs +199 -90
- package/fesm2022/cityway-basic-ui.mjs.map +1 -1
- package/index.d.ts +62 -8
- package/package.json +2 -2
- package/styles/basic-ui.styles.bo.min.css +1 -1
- package/styles/basic-ui.styles.bo.min.css.map +1 -1
- package/styles/basic-ui.styles.fo.min.css +1 -1
- package/styles/basic-ui.styles.fo.min.css.map +1 -1
- package/cityway-basic-ui-1.1.0-beta026.tgz +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as i1 from '@angular/common';
|
|
2
2
|
import { CommonModule, DOCUMENT, isPlatformBrowser, NgClass, NgTemplateOutlet } from '@angular/common';
|
|
3
3
|
import * as i0 from '@angular/core';
|
|
4
|
-
import { inject, ElementRef, model, output, effect, Directive, input, HostBinding, ChangeDetectionStrategy, Component, ChangeDetectorRef, viewChild, signal, computed, untracked, contentChildren, DestroyRef, Injectable, NgZone, Renderer2, ViewContainerRef, PLATFORM_ID, Pipe, EventEmitter, TemplateRef, ContentChild, Output, Input, ApplicationRef, Injector, createComponent, viewChildren, forwardRef } from '@angular/core';
|
|
4
|
+
import { inject, ElementRef, model, output, effect, Directive, input, HostBinding, ChangeDetectionStrategy, Component, ChangeDetectorRef, viewChild, signal, computed, untracked, contentChildren, DestroyRef, Injectable, NgZone, Renderer2, ViewContainerRef, PLATFORM_ID, Pipe, EventEmitter, TemplateRef, ContentChild, Output, Input, ApplicationRef, Injector, createComponent, contentChild, viewChildren, forwardRef } from '@angular/core';
|
|
5
5
|
import * as i2 from '@ngx-translate/core';
|
|
6
6
|
import { TranslatePipe, TranslateModule, TranslateService } from '@ngx-translate/core';
|
|
7
7
|
import { LiveAnnouncer } from '@angular/cdk/a11y';
|
|
@@ -1364,6 +1364,8 @@ var BadgeTypeEnum;
|
|
|
1364
1364
|
BadgeTypeEnum["lightWarning"] = "light-warning";
|
|
1365
1365
|
BadgeTypeEnum["lightDanger"] = "light-danger";
|
|
1366
1366
|
BadgeTypeEnum["lightLight"] = "light-light";
|
|
1367
|
+
/** Fond blanc (surface/default) : badge pose sur une surface claire (bande de sous-onglets, card light). */
|
|
1368
|
+
BadgeTypeEnum["lightWhite"] = "light-white";
|
|
1367
1369
|
// Heavy variants
|
|
1368
1370
|
BadgeTypeEnum["heavyPrimary"] = "heavy-primary";
|
|
1369
1371
|
BadgeTypeEnum["heavyInfo"] = "heavy-info";
|
|
@@ -5056,6 +5058,25 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.20", ngImpo
|
|
|
5056
5058
|
args: [{ selector: 'cw-modals', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, imports: [CommonModule, TranslateModule, NgClass, NgTemplateOutlet, ButtonComponent, LoaderComponent, IconComponent], template: "<div class=\"cityway-v8 modal-backdrop fade show\" style=\"z-index: 1050;\" aria-hidden=\"true\"></div>\r\n\r\n<div role=\"dialog\" tabindex=\"-1\" aria-modal=\"true\"\r\n [attr.aria-labelledby]=\"type() === modalsType.loader ? null : titleId\"\r\n [attr.aria-label]=\"type() === modalsType.loader ? ('_COMMON._HTTP.TXT_LOADING' | translate) : null\"\r\n [attr.aria-describedby]=\"modalSubtitle() && !isStateLike() && type() !== modalsType.loader ? subtitleId : null\"\r\n class=\"cityway-v8 d-flex modal show\" [ngClass]=\"customClass()\" data-test-ctw=\"modal\" (keydown)=\"onKeyDown($event)\">\r\n\r\n <!-- Backdrop : fermeture a la souris (confort). Le clavier (Escape) est gere\r\n par onKeyDown du dialog ; le backdrop n'est pas un element interactif focusable.\r\n requestClose() applique le verrou (cf. isCloseLocked) : plus de test sur le type ici. -->\r\n <!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events, @angular-eslint/template/interactive-supports-focus -->\r\n <div class=\"modal-inner-backdrop\" (click)=\"requestClose()\"></div>\r\n\r\n <div #modalContainer role=\"document\" class=\"modal-dialog\"\r\n [ngClass]=\"['modal-' + size(), scrollable() ? 'modal-dialog-scrollable' : '']\">\r\n\r\n <div class=\"modal-content\">\r\n\r\n <!-- Verrou actif : region live qui annonce chaque tentative de fermeture refusee\r\n (Echap, backdrop, croix). Rendue vide au repos car une region live doit\r\n pre-exister dans le DOM pour que son remplissage soit annonce. Absente pour\r\n le loader, qui possede deja la sienne dans cw-loader. -->\r\n @if (showCloseLockedStatus()) {\r\n <span class=\"visually-hidden\" role=\"status\" aria-live=\"polite\">{{ closeLockedAnnouncement() | translate }}</span>\r\n }\r\n\r\n @if (type() === modalsType.loader) {\r\n <div class=\"modal-body\">\r\n <cw-loader></cw-loader>\r\n </div>\r\n }\r\n @else {\r\n @if (isStateLike()) {\r\n <!-- state + delete : close en absolu (top-right, hors flux donc ne reserve\r\n pas de hauteur), body centre avec le picto de statut EN TETE du flux\r\n (il pousse donc le titre normalement) -->\r\n <!-- aria-disabled + .disabled (Bootstrap) plutot que `disabled` natif : la croix\r\n reste focusable et annoncee \u00AB desactivee \u00BB, et le focus trap conserve une\r\n cible. Un `disabled` natif la sortirait du selecteur de focusables. -->\r\n <button type=\"button\" class=\"btn-close modal-close-floating\" [attr.aria-label]=\"'_COMMON._ACTION.CLOSE' | translate\"\r\n [class.disabled]=\"isCloseLocked()\" [attr.aria-disabled]=\"isCloseLocked() ? 'true' : null\"\r\n (click)=\"requestClose()\" data-test-ctw=\"btn-close-modal\">\r\n <cw-icon [icon]=\"spriteIcon.toolbarClose\" [iconSize]=\"iconSize['lg']\" [type]=\"iconType.default\" aria-hidden=\"true\"></cw-icon>\r\n </button>\r\n\r\n <div class=\"modal-body modal-body-state d-flex-v gap-md items-center\" [class.modal-text-center]=\"isBodyCentered()\">\r\n <cw-icon [icon]=\"statusIcon()\" [iconSize]=\"iconSize['xl']\" [type]=\"iconType.square\"\r\n [iconUiType]=\"statusUiType()\" aria-hidden=\"true\"></cw-icon>\r\n\r\n <h1 class=\"modal-title\" [id]=\"titleId\">\r\n @if (type() === modalsType.delete) {\r\n {{ '_COMMON._MODAL_DELETE.TITLE' | translate: { number: itemsToDelete().length, name: itemsToDeleteTitle() | translate } }}\r\n }\r\n @else {\r\n {{ (modalTitle() ?? '') | translate: modalTitleParams() }}\r\n }\r\n </h1>\r\n\r\n @if (type() === modalsType.delete) {\r\n <!-- zone delete en dur : texte + liste + avertissement, pleine largeur aligne a gauche -->\r\n <div class=\"w-100 d-flex-v gap-md\">\r\n @if (itemsToDelete().length > 1) {\r\n <div [innerHTML]=\"'_COMMON._MODAL_DELETE.MULTIPLE_TEXT' | translate\"></div>\r\n }\r\n @else {\r\n <div [innerHTML]=\"'_COMMON._MODAL_DELETE.SIMPLE_TEXT' | translate\"></div>\r\n }\r\n\r\n @if (itemsToDelete().length > 0) {\r\n <ul class=\"mb-none\">\r\n @for (item of itemsToDelete(); track item) {\r\n <li>{{ item }}</li>\r\n }\r\n </ul>\r\n }\r\n\r\n <div [innerHTML]=\"'_COMMON._MODAL_DELETE.IRREVERSIBLE' | translate\"></div>\r\n </div>\r\n }\r\n\r\n @if (customBodyTemplate()) {\r\n <div class=\"w-100\">\r\n <ng-container [ngTemplateOutlet]=\"customBodyTemplate()\" [ngTemplateOutletContext]=\"customBodyContext()\">\r\n </ng-container>\r\n </div>\r\n }\r\n </div>\r\n }\r\n @else {\r\n <!-- default + sidepanel : header titre + close, body = contenu libre (slot) -->\r\n <div class=\"modal-header\">\r\n <!-- Titre + sous-titre empiles ; sous-titre aux classes du sous-titre de cw-card. -->\r\n <div class=\"flex-1\">\r\n <h1 class=\"modal-title\" [id]=\"titleId\">\r\n {{ (modalTitle() ?? '') | translate: modalTitleParams() }}\r\n </h1>\r\n @if (modalSubtitle(); as subtitle) {\r\n <div class=\"modal-subtitle fs fs-xs text-light\" [id]=\"subtitleId\">{{ subtitle }}</div>\r\n }\r\n </div>\r\n\r\n <!-- cf. croix state/delete : aria-disabled, pas `disabled` natif -->\r\n <button type=\"button\" class=\"btn-close\" [attr.aria-label]=\"'_COMMON._ACTION.CLOSE' | translate\"\r\n [class.disabled]=\"isCloseLocked()\" [attr.aria-disabled]=\"isCloseLocked() ? 'true' : null\"\r\n (click)=\"requestClose()\" data-test-ctw=\"btn-close-modal\">\r\n <cw-icon [icon]=\"spriteIcon.toolbarClose\" [iconSize]=\"iconSize['lg']\" [type]=\"iconType.default\" aria-hidden=\"true\"></cw-icon>\r\n </button>\r\n </div>\r\n\r\n <div class=\"modal-body d-flex-v gap-md\">\r\n @if (customBodyTemplate()) {\r\n <ng-container [ngTemplateOutlet]=\"customBodyTemplate()\" [ngTemplateOutletContext]=\"customBodyContext()\">\r\n </ng-container>\r\n }\r\n </div>\r\n }\r\n\r\n <!-- footer commun : secondaire a gauche, primaire/danger a droite (ordre DS) -->\r\n <div class=\"modal-footer\">\r\n @if (type() === modalsType.delete) {\r\n <cw-button label=\"_COMMON._ACTION.CLOSE\" [type]=\"buttonTypeEnum.secondary\"\r\n [isDisabled]=\"isCloseLocked()\" (btnAction)=\"requestClose()\" dataTest=\"btn-close-modal\">\r\n </cw-button>\r\n\r\n <cw-button label=\"_COMMON._ACTION.DELETE\" [type]=\"buttonTypeEnum.danger\"\r\n [isDisabled]=\"disableBtnAction1()\" (btnAction)=\"action1Click()\" dataTest=\"btn-action-modal\">\r\n </cw-button>\r\n }\r\n @else {\r\n @if (labelBtnAction2()) {\r\n <cw-button [label]=\"labelBtnAction2()\" [type]=\"buttonTypeEnum.secondary\"\r\n [isDisabled]=\"disableBtnAction2()\" (btnAction)=\"action2Click()\" dataTest=\"btn-action-modal\">\r\n </cw-button>\r\n }\r\n @else {\r\n <!-- Bouton de repli : il occupe la place de l'action 2, il applique donc\r\n disableBtnAction2 (auparavant le seul bouton du composant a ignorer\r\n son input de desactivation). -->\r\n <cw-button label=\"_COMMON._ACTION.CLOSE\" [type]=\"buttonTypeEnum.secondary\"\r\n [isDisabled]=\"isCloseLocked() || disableBtnAction2()\"\r\n (btnAction)=\"fallbackCloseClick()\" dataTest=\"btn-close-modal\">\r\n </cw-button>\r\n }\r\n @if (labelBtnAction1()) {\r\n <cw-button [label]=\"labelBtnAction1()\" [type]=\"buttonTypeEnum.primary\"\r\n [isDisabled]=\"disableBtnAction1()\" (btnAction)=\"action1Click()\" dataTest=\"btn-action-modal\">\r\n </cw-button>\r\n }\r\n }\r\n </div>\r\n }\r\n\r\n </div>\r\n </div>\r\n</div>\r\n" }]
|
|
5057
5059
|
}], propDecorators: { modalContainer: [{ type: i0.ViewChild, args: ['modalContainer', { isSignal: true }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], customClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "customClass", required: false }] }], scrollable: [{ type: i0.Input, args: [{ isSignal: true, alias: "scrollable", required: false }] }], isAutcompModal: [{ type: i0.Input, args: [{ isSignal: true, alias: "isAutcompModal", required: false }] }], type: [{ type: i0.Input, args: [{ isSignal: true, alias: "type", required: true }] }], state: [{ type: i0.Input, args: [{ isSignal: true, alias: "state", required: false }] }], textType: [{ type: i0.Input, args: [{ isSignal: true, alias: "textType", required: false }] }], modalTitle: [{ type: i0.Input, args: [{ isSignal: true, alias: "modalTitle", required: false }] }], modalTitleParams: [{ type: i0.Input, args: [{ isSignal: true, alias: "modalTitleParams", required: false }] }], modalSubtitle: [{ type: i0.Input, args: [{ isSignal: true, alias: "modalSubtitle", required: false }] }], itemsToDelete: [{ type: i0.Input, args: [{ isSignal: true, alias: "itemsToDelete", required: false }] }], itemsToDeleteTitle: [{ type: i0.Input, args: [{ isSignal: true, alias: "itemsToDeleteTitle", required: false }] }], labelBtnAction1: [{ type: i0.Input, args: [{ isSignal: true, alias: "labelBtnAction1", required: false }] }], labelBtnAction2: [{ type: i0.Input, args: [{ isSignal: true, alias: "labelBtnAction2", required: false }] }], disableBtnAction1: [{ type: i0.Input, args: [{ isSignal: true, alias: "disableBtnAction1", required: false }] }], disableBtnAction2: [{ type: i0.Input, args: [{ isSignal: true, alias: "disableBtnAction2", required: false }] }], customBodyTemplate: [{ type: i0.Input, args: [{ isSignal: true, alias: "customBodyTemplate", required: false }] }], customBodyContext: [{ type: i0.Input, args: [{ isSignal: true, alias: "customBodyContext", required: false }] }], closeLocked: [{ type: i0.Input, args: [{ isSignal: true, alias: "closeLocked", required: false }] }], closeLockedMessage: [{ type: i0.Input, args: [{ isSignal: true, alias: "closeLockedMessage", required: false }] }], keepOpenOnAction1: [{ type: i0.Input, args: [{ isSignal: true, alias: "keepOpenOnAction1", required: false }] }], keepOpenOnAction2: [{ type: i0.Input, args: [{ isSignal: true, alias: "keepOpenOnAction2", required: false }] }], btnAction1: [{ type: i0.Output, args: ["btnAction1"] }], btnAction2: [{ type: i0.Output, args: ["btnAction2"] }] } });
|
|
5058
5060
|
|
|
5061
|
+
/**
|
|
5062
|
+
* Contenu d'onglet cree a la premiere ouverture de l'onglet (puis conserve) :
|
|
5063
|
+
* `<ng-template cwTabLazy>…</ng-template>` dans un `cw-tab-content`. Sans lui, le contenu est cree
|
|
5064
|
+
* des l'arrivee sur la page et seulement masque (tableaux et appels API de tous les onglets).
|
|
5065
|
+
*/
|
|
5066
|
+
class TabLazyDirective {
|
|
5067
|
+
constructor() {
|
|
5068
|
+
this.templateRef = inject(TemplateRef);
|
|
5069
|
+
}
|
|
5070
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: TabLazyDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
5071
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.20", type: TabLazyDirective, isStandalone: true, selector: "ng-template[cwTabLazy]", ngImport: i0 }); }
|
|
5072
|
+
}
|
|
5073
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: TabLazyDirective, decorators: [{
|
|
5074
|
+
type: Directive,
|
|
5075
|
+
args: [{
|
|
5076
|
+
selector: 'ng-template[cwTabLazy]',
|
|
5077
|
+
standalone: true,
|
|
5078
|
+
}]
|
|
5079
|
+
}] });
|
|
5059
5080
|
class TabContentComponent {
|
|
5060
5081
|
constructor() {
|
|
5061
5082
|
this.title = input.required(...(ngDevMode ? [{ debugName: "title" }] : []));
|
|
@@ -5063,45 +5084,71 @@ class TabContentComponent {
|
|
|
5063
5084
|
this.withIcon = input(...(ngDevMode ? [undefined, { debugName: "withIcon" }] : []));
|
|
5064
5085
|
/** Badge affiché après le libellé de l'onglet (compteur, statut). */
|
|
5065
5086
|
this.badge = input(...(ngDevMode ? [undefined, { debugName: "badge" }] : []));
|
|
5087
|
+
/**
|
|
5088
|
+
* Sous-onglets : `cw-tab-content` imbriques directement dans celui-ci. Leur barre est dessinee
|
|
5089
|
+
* par le `cw-tab` parent, sous la barre principale ; leurs panneaux restent dans ce panneau.
|
|
5090
|
+
*/
|
|
5091
|
+
this.children = contentChildren(TabContentComponent, ...(ngDevMode ? [{ debugName: "children" }] : []));
|
|
5092
|
+
/** Contenu differe (`ng-template cwTabLazy`) de CE panneau, pas d'un sous-onglet. */
|
|
5093
|
+
this.lazy = contentChild(TabLazyDirective, ...(ngDevMode ? [{ debugName: "lazy", descendants: false }] : [{ descendants: false }]));
|
|
5066
5094
|
// Etat pilote par le parent `cw-tab` : signaux writable (le parent appelle `.set()`)
|
|
5067
5095
|
// pour declencher la detection de changement sous OnPush.
|
|
5068
5096
|
this.id = signal(0, ...(ngDevMode ? [{ debugName: "id" }] : []));
|
|
5069
5097
|
this.active = signal(false, ...(ngDevMode ? [{ debugName: "active" }] : []));
|
|
5098
|
+
/** Ids DOM de l'onglet et de son panneau, uniques par `cw-tab` (pose par le parent). */
|
|
5099
|
+
this.tabId = signal('', ...(ngDevMode ? [{ debugName: "tabId" }] : []));
|
|
5100
|
+
this.panelId = signal('', ...(ngDevMode ? [{ debugName: "panelId" }] : []));
|
|
5101
|
+
/** Index du sous-onglet choisi, memorise quand on change d'onglet principal. */
|
|
5102
|
+
this.selectedChild = signal(0, ...(ngDevMode ? [{ debugName: "selectedChild" }] : []));
|
|
5103
|
+
/** Le contenu differe est cree a la 1re activation, puis garde (etat, filtres, scroll). */
|
|
5104
|
+
this.opened = signal(false, ...(ngDevMode ? [{ debugName: "opened" }] : []));
|
|
5105
|
+
this.lazyRendered = computed(() => !!this.lazy() && (this.active() || this.opened()), ...(ngDevMode ? [{ debugName: "lazyRendered" }] : []));
|
|
5106
|
+
effect(() => {
|
|
5107
|
+
if (this.active())
|
|
5108
|
+
this.opened.set(true);
|
|
5109
|
+
});
|
|
5070
5110
|
}
|
|
5071
5111
|
get fragment() {
|
|
5072
5112
|
return UtilsHelper.slugify(this.title());
|
|
5073
5113
|
}
|
|
5074
5114
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: TabContentComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
5075
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.
|
|
5076
|
-
<div class="tab-pane"
|
|
5077
|
-
[class.fade]="!active()"
|
|
5078
|
-
[class.active]="active()"
|
|
5079
|
-
[class.show]="active()"
|
|
5080
|
-
[class.d-none]="!active()"
|
|
5081
|
-
[id]="
|
|
5082
|
-
role="tabpanel"
|
|
5083
|
-
[attr.aria-labelledby]="
|
|
5084
|
-
<ng-content></ng-content>
|
|
5085
|
-
|
|
5086
|
-
|
|
5115
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.20", type: TabContentComponent, isStandalone: true, selector: "cw-tab-content", inputs: { title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: true, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, withIcon: { classPropertyName: "withIcon", publicName: "withIcon", isSignal: true, isRequired: false, transformFunction: null }, badge: { classPropertyName: "badge", publicName: "badge", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "attr.title": "null" } }, queries: [{ propertyName: "children", predicate: TabContentComponent, isSignal: true }, { propertyName: "lazy", first: true, predicate: TabLazyDirective, isSignal: true }], ngImport: i0, template: `
|
|
5116
|
+
<div class="tab-pane"
|
|
5117
|
+
[class.fade]="!active()"
|
|
5118
|
+
[class.active]="active()"
|
|
5119
|
+
[class.show]="active()"
|
|
5120
|
+
[class.d-none]="!active()"
|
|
5121
|
+
[id]="panelId()"
|
|
5122
|
+
role="tabpanel"
|
|
5123
|
+
[attr.aria-labelledby]="tabId()">
|
|
5124
|
+
<ng-content></ng-content>
|
|
5125
|
+
@if (lazyRendered()) {
|
|
5126
|
+
<ng-container [ngTemplateOutlet]="lazy()!.templateRef"></ng-container>
|
|
5127
|
+
}
|
|
5128
|
+
</div>
|
|
5129
|
+
`, isInline: true, dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
5087
5130
|
}
|
|
5088
5131
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: TabContentComponent, decorators: [{
|
|
5089
5132
|
type: Component,
|
|
5090
5133
|
args: [{
|
|
5091
5134
|
selector: 'cw-tab-content',
|
|
5092
|
-
template: `
|
|
5093
|
-
<div class="tab-pane"
|
|
5094
|
-
[class.fade]="!active()"
|
|
5095
|
-
[class.active]="active()"
|
|
5096
|
-
[class.show]="active()"
|
|
5097
|
-
[class.d-none]="!active()"
|
|
5098
|
-
[id]="
|
|
5099
|
-
role="tabpanel"
|
|
5100
|
-
[attr.aria-labelledby]="
|
|
5101
|
-
<ng-content></ng-content>
|
|
5102
|
-
|
|
5135
|
+
template: `
|
|
5136
|
+
<div class="tab-pane"
|
|
5137
|
+
[class.fade]="!active()"
|
|
5138
|
+
[class.active]="active()"
|
|
5139
|
+
[class.show]="active()"
|
|
5140
|
+
[class.d-none]="!active()"
|
|
5141
|
+
[id]="panelId()"
|
|
5142
|
+
role="tabpanel"
|
|
5143
|
+
[attr.aria-labelledby]="tabId()">
|
|
5144
|
+
<ng-content></ng-content>
|
|
5145
|
+
@if (lazyRendered()) {
|
|
5146
|
+
<ng-container [ngTemplateOutlet]="lazy()!.templateRef"></ng-container>
|
|
5147
|
+
}
|
|
5148
|
+
</div>
|
|
5103
5149
|
`,
|
|
5104
5150
|
standalone: true,
|
|
5151
|
+
imports: [NgTemplateOutlet],
|
|
5105
5152
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
5106
5153
|
host: {
|
|
5107
5154
|
// `title` est aussi un attribut HTML global : écrit en attribut statique (`title="KEY"`),
|
|
@@ -5110,7 +5157,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.20", ngImpo
|
|
|
5110
5157
|
'[attr.title]': 'null'
|
|
5111
5158
|
}
|
|
5112
5159
|
}]
|
|
5113
|
-
}], propDecorators: { title: [{ type: i0.Input, args: [{ isSignal: true, alias: "title", required: true }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], withIcon: [{ type: i0.Input, args: [{ isSignal: true, alias: "withIcon", required: false }] }], badge: [{ type: i0.Input, args: [{ isSignal: true, alias: "badge", required: false }] }] } });
|
|
5160
|
+
}], ctorParameters: () => [], propDecorators: { title: [{ type: i0.Input, args: [{ isSignal: true, alias: "title", required: true }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], withIcon: [{ type: i0.Input, args: [{ isSignal: true, alias: "withIcon", required: false }] }], badge: [{ type: i0.Input, args: [{ isSignal: true, alias: "badge", required: false }] }], children: [{ type: i0.ContentChildren, args: [i0.forwardRef(() => TabContentComponent), { isSignal: true }] }], lazy: [{ type: i0.ContentChild, args: [i0.forwardRef(() => TabLazyDirective), { ...{ descendants: false }, isSignal: true }] }] } });
|
|
5114
5161
|
|
|
5115
5162
|
var FoTabTypeEnum;
|
|
5116
5163
|
(function (FoTabTypeEnum) {
|
|
@@ -5123,6 +5170,8 @@ var BoTabTypeEnum;
|
|
|
5123
5170
|
BoTabTypeEnum["card"] = "card";
|
|
5124
5171
|
})(BoTabTypeEnum || (BoTabTypeEnum = {}));
|
|
5125
5172
|
|
|
5173
|
+
/** Separateur onglet / sous-onglet dans le fragment d'URL (`#mtickets/validations`). */
|
|
5174
|
+
const FRAGMENT_SEPARATOR = '/';
|
|
5126
5175
|
class TabComponent {
|
|
5127
5176
|
constructor() {
|
|
5128
5177
|
this.router = inject(Router);
|
|
@@ -5134,33 +5183,51 @@ class TabComponent {
|
|
|
5134
5183
|
this.title = input(...(ngDevMode ? [undefined, { debugName: "title" }] : []));
|
|
5135
5184
|
this.tabContentCssClass = input('', ...(ngDevMode ? [{ debugName: "tabContentCssClass" }] : []));
|
|
5136
5185
|
this.activeTabIndex = input(0, ...(ngDevMode ? [{ debugName: "activeTabIndex" }] : []));
|
|
5186
|
+
/** Onglets principaux : `cw-tab-content` enfants directs (les sous-onglets sont dans ceux-ci). */
|
|
5137
5187
|
this.tabs = contentChildren(TabContentComponent, ...(ngDevMode ? [{ debugName: "tabs" }] : []));
|
|
5138
5188
|
this.tabLinks = viewChildren('tabLink', ...(ngDevMode ? [{ debugName: "tabLinks" }] : []));
|
|
5139
5189
|
this.tabChanged = output();
|
|
5190
|
+
/** Emis au choix d'un sous-onglet (clic, clavier, fragment d'URL). */
|
|
5191
|
+
this.subTabChanged = output();
|
|
5192
|
+
/**
|
|
5193
|
+
* Prefixe des ids DOM, unique par instance : deux `cw-tab` sur une page (ou une page qui en
|
|
5194
|
+
* contenait un dans un onglet d'un autre) produisaient deux `cw-nav-0`, et `aria-controls` /
|
|
5195
|
+
* `aria-labelledby` pointaient sur le mauvais element.
|
|
5196
|
+
*/
|
|
5197
|
+
this.uid = uniqueId('cw-tab');
|
|
5140
5198
|
this.activeId = 0;
|
|
5141
5199
|
this.iconSize = IconSizeEnum['md'];
|
|
5200
|
+
/** Onglet principal actif : sa liste de sous-onglets alimente la seconde barre. */
|
|
5201
|
+
this.activeTab = signal(undefined, ...(ngDevMode ? [{ debugName: "activeTab" }] : []));
|
|
5202
|
+
this.subTabs = computed(() => this.activeTab()?.children() ?? [], ...(ngDevMode ? [{ debugName: "subTabs" }] : []));
|
|
5203
|
+
// Ids DOM des onglets et panneaux, recalcules si la liste change (`@for`, `@if`).
|
|
5204
|
+
effect(() => {
|
|
5205
|
+
this.tabs().forEach((tab, i) => {
|
|
5206
|
+
tab.id.set(i);
|
|
5207
|
+
tab.tabId.set(`${this.uid}-tab-${i}`);
|
|
5208
|
+
tab.panelId.set(`${this.uid}-panel-${i}`);
|
|
5209
|
+
tab.children().forEach((child, j) => {
|
|
5210
|
+
child.id.set(j);
|
|
5211
|
+
child.tabId.set(`${this.uid}-tab-${i}-${j}`);
|
|
5212
|
+
child.panelId.set(`${this.uid}-panel-${i}-${j}`);
|
|
5213
|
+
});
|
|
5214
|
+
});
|
|
5215
|
+
});
|
|
5142
5216
|
}
|
|
5143
5217
|
ngAfterContentInit() {
|
|
5144
5218
|
const tabsArray = [...this.tabs()];
|
|
5145
|
-
tabsArray.forEach(
|
|
5146
|
-
|
|
5147
|
-
tab.active.set(false);
|
|
5148
|
-
});
|
|
5149
|
-
const firstActiveIndex = tabsArray.findIndex(t => !t.disabled());
|
|
5219
|
+
tabsArray.forEach(tab => tab.selectedChild.set(this.firstEnabledIndex(tab.children())));
|
|
5220
|
+
const firstActiveIndex = this.firstEnabledIndex(tabsArray);
|
|
5150
5221
|
// Onglet demande s'il est valide et non desactive ; sinon 1er onglet actif ; sinon 0.
|
|
5151
5222
|
const requested = this.activeTabIndex();
|
|
5152
5223
|
const requestedOk = requested >= 0 && requested < tabsArray.length && !tabsArray[requested]?.disabled();
|
|
5153
|
-
this.activeId = requestedOk ? requested :
|
|
5224
|
+
this.activeId = requestedOk ? requested : firstActiveIndex;
|
|
5154
5225
|
if (this.useFragment()) {
|
|
5155
5226
|
this.route.fragment
|
|
5156
5227
|
.pipe(takeUntilDestroyed(this.destroyRef))
|
|
5157
5228
|
.subscribe(fragment => {
|
|
5158
|
-
if (fragment)
|
|
5159
|
-
|
|
5160
|
-
if (foundIndex !== -1) {
|
|
5161
|
-
this.activeId = foundIndex;
|
|
5162
|
-
}
|
|
5163
|
-
}
|
|
5229
|
+
if (fragment)
|
|
5230
|
+
this.applyFragment(fragment);
|
|
5164
5231
|
this.activateTabByIndex(this.activeId);
|
|
5165
5232
|
});
|
|
5166
5233
|
}
|
|
@@ -5171,74 +5238,116 @@ class TabComponent {
|
|
|
5171
5238
|
selectTab(tab) {
|
|
5172
5239
|
if (tab.disabled())
|
|
5173
5240
|
return;
|
|
5174
|
-
this.tabs().forEach(t => t.active.set(false));
|
|
5175
|
-
tab.active.set(true);
|
|
5176
5241
|
this.activeId = tab.id();
|
|
5177
|
-
|
|
5178
|
-
|
|
5179
|
-
relativeTo: this.route,
|
|
5180
|
-
fragment: tab.fragment,
|
|
5181
|
-
queryParamsHandling: 'preserve',
|
|
5182
|
-
replaceUrl: true
|
|
5183
|
-
});
|
|
5184
|
-
}
|
|
5242
|
+
this.syncActive();
|
|
5243
|
+
this.writeFragment();
|
|
5185
5244
|
this.tabChanged.emit(this.activeId);
|
|
5186
5245
|
}
|
|
5187
|
-
|
|
5188
|
-
|
|
5189
|
-
if (
|
|
5190
|
-
|
|
5191
|
-
|
|
5192
|
-
|
|
5193
|
-
|
|
5246
|
+
/** Choisit un sous-onglet de l'onglet principal `parent`. */
|
|
5247
|
+
selectSubTab(parent, child) {
|
|
5248
|
+
if (child.disabled() || parent.disabled())
|
|
5249
|
+
return;
|
|
5250
|
+
this.activeId = parent.id();
|
|
5251
|
+
parent.selectedChild.set(child.id());
|
|
5252
|
+
this.syncActive();
|
|
5253
|
+
this.writeFragment();
|
|
5254
|
+
this.subTabChanged.emit({ tabIndex: parent.id(), subTabIndex: child.id() });
|
|
5255
|
+
}
|
|
5256
|
+
/** Fleches / Debut / Fin dans une barre (principale ou sous-onglets), focus suivant la selection. */
|
|
5257
|
+
onKeydown(event, level = 'tab') {
|
|
5258
|
+
const list = level === 'tab' ? [...this.tabs()] : [...this.subTabs()];
|
|
5259
|
+
const current = level === 'tab' ? this.activeId : (this.activeTab()?.selectedChild() ?? 0);
|
|
5260
|
+
let next;
|
|
5194
5261
|
switch (event.key) {
|
|
5195
5262
|
case 'ArrowLeft':
|
|
5196
|
-
|
|
5197
|
-
this.selectPreviousTab();
|
|
5263
|
+
next = this.nextEnabled(list, current, -1);
|
|
5198
5264
|
break;
|
|
5199
5265
|
case 'ArrowRight':
|
|
5200
|
-
|
|
5201
|
-
this.selectNextTab();
|
|
5266
|
+
next = this.nextEnabled(list, current, 1);
|
|
5202
5267
|
break;
|
|
5268
|
+
case 'Home':
|
|
5269
|
+
next = this.nextEnabled(list, -1, 1);
|
|
5270
|
+
break;
|
|
5271
|
+
case 'End':
|
|
5272
|
+
next = this.nextEnabled(list, list.length, -1);
|
|
5273
|
+
break;
|
|
5274
|
+
default: return;
|
|
5203
5275
|
}
|
|
5276
|
+
event.preventDefault();
|
|
5277
|
+
if (next === undefined || next === current)
|
|
5278
|
+
return;
|
|
5279
|
+
if (level === 'tab') {
|
|
5280
|
+
this.selectTab(list[next]);
|
|
5281
|
+
}
|
|
5282
|
+
else {
|
|
5283
|
+
this.selectSubTab(this.activeTab(), list[next]);
|
|
5284
|
+
}
|
|
5285
|
+
// Focus sur l'onglet selectionne de LA MEME barre (roving tabindex).
|
|
5286
|
+
const tablist = event.currentTarget?.closest('[role="tablist"]');
|
|
5287
|
+
setTimeout(() => tablist?.querySelector('[aria-selected="true"]')?.focus());
|
|
5204
5288
|
}
|
|
5205
|
-
|
|
5206
|
-
|
|
5207
|
-
|
|
5208
|
-
|
|
5209
|
-
|
|
5289
|
+
/** Etat `active` de tous les panneaux : onglet actif, et son sous-onglet choisi. */
|
|
5290
|
+
syncActive() {
|
|
5291
|
+
const tabsArray = [...this.tabs()];
|
|
5292
|
+
tabsArray.forEach((tab, i) => {
|
|
5293
|
+
const isActive = i === this.activeId;
|
|
5294
|
+
tab.active.set(isActive);
|
|
5295
|
+
tab.children().forEach((child, j) => child.active.set(isActive && j === tab.selectedChild()));
|
|
5210
5296
|
});
|
|
5297
|
+
this.activeTab.set(tabsArray[this.activeId]);
|
|
5211
5298
|
}
|
|
5212
|
-
|
|
5213
|
-
const
|
|
5214
|
-
|
|
5215
|
-
|
|
5216
|
-
let newIndex = (activeIndex - 1 + tabsArray.length) % tabsArray.length;
|
|
5217
|
-
while (tabsArray[newIndex].disabled() && newIndex !== activeIndex) {
|
|
5218
|
-
newIndex = (newIndex - 1 + tabsArray.length) % tabsArray.length;
|
|
5219
|
-
}
|
|
5220
|
-
if (!tabsArray[newIndex].disabled()) {
|
|
5221
|
-
this.selectTab(tabsArray[newIndex]);
|
|
5222
|
-
setTimeout(() => this.moveFocus());
|
|
5223
|
-
}
|
|
5299
|
+
activateTabByIndex(index) {
|
|
5300
|
+
const tab = this.tabs()[index];
|
|
5301
|
+
if (tab && !tab.disabled()) {
|
|
5302
|
+
this.selectTab(tab);
|
|
5224
5303
|
}
|
|
5225
5304
|
}
|
|
5226
|
-
|
|
5305
|
+
/** `#onglet` ou `#onglet/sous-onglet` (slugs des titres). Un fragment inconnu est ignore. */
|
|
5306
|
+
applyFragment(fragment) {
|
|
5307
|
+
const [tabSlug, subSlug] = fragment.split(FRAGMENT_SEPARATOR);
|
|
5227
5308
|
const tabsArray = [...this.tabs()];
|
|
5228
|
-
const
|
|
5229
|
-
if (
|
|
5230
|
-
|
|
5231
|
-
|
|
5232
|
-
|
|
5233
|
-
|
|
5234
|
-
|
|
5235
|
-
|
|
5236
|
-
|
|
5237
|
-
}
|
|
5309
|
+
const tabIndex = tabsArray.findIndex(t => t.fragment === tabSlug && !t.disabled());
|
|
5310
|
+
if (tabIndex === -1)
|
|
5311
|
+
return;
|
|
5312
|
+
this.activeId = tabIndex;
|
|
5313
|
+
if (subSlug) {
|
|
5314
|
+
const children = tabsArray[tabIndex].children();
|
|
5315
|
+
const subIndex = children.findIndex(c => c.fragment === subSlug && !c.disabled());
|
|
5316
|
+
if (subIndex !== -1)
|
|
5317
|
+
tabsArray[tabIndex].selectedChild.set(subIndex);
|
|
5238
5318
|
}
|
|
5239
5319
|
}
|
|
5320
|
+
writeFragment() {
|
|
5321
|
+
if (!this.useFragment())
|
|
5322
|
+
return;
|
|
5323
|
+
const tab = this.tabs()[this.activeId];
|
|
5324
|
+
if (!tab)
|
|
5325
|
+
return;
|
|
5326
|
+
const sub = tab.children()[tab.selectedChild()];
|
|
5327
|
+
this.router.navigate([], {
|
|
5328
|
+
relativeTo: this.route,
|
|
5329
|
+
fragment: sub ? `${tab.fragment}${FRAGMENT_SEPARATOR}${sub.fragment}` : tab.fragment,
|
|
5330
|
+
queryParamsHandling: 'preserve',
|
|
5331
|
+
replaceUrl: true
|
|
5332
|
+
});
|
|
5333
|
+
}
|
|
5334
|
+
firstEnabledIndex(list) {
|
|
5335
|
+
const index = list.findIndex(t => !t.disabled());
|
|
5336
|
+
return index === -1 ? 0 : index;
|
|
5337
|
+
}
|
|
5338
|
+
/** Prochain onglet non desactive dans le sens `step`, en bouclant ; `undefined` si aucun. */
|
|
5339
|
+
nextEnabled(list, from, step) {
|
|
5340
|
+
if (!list.length)
|
|
5341
|
+
return undefined;
|
|
5342
|
+
for (let k = 1; k <= list.length; k++) {
|
|
5343
|
+
const index = (((from + step * k) % list.length) + list.length) % list.length;
|
|
5344
|
+
if (!list[index].disabled())
|
|
5345
|
+
return index;
|
|
5346
|
+
}
|
|
5347
|
+
return undefined;
|
|
5348
|
+
}
|
|
5240
5349
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: TabComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
5241
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.20", type: TabComponent, isStandalone: true, selector: "cw-tab", inputs: { type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: false, transformFunction: null }, id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null }, useFragment: { classPropertyName: "useFragment", publicName: "useFragment", isSignal: true, isRequired: false, transformFunction: null }, title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: false, transformFunction: null }, tabContentCssClass: { classPropertyName: "tabContentCssClass", publicName: "tabContentCssClass", isSignal: true, isRequired: false, transformFunction: null }, activeTabIndex: { classPropertyName: "activeTabIndex", publicName: "activeTabIndex", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { tabChanged: "tabChanged" }, host: { classAttribute: "cw-tab" }, queries: [{ propertyName: "tabs", predicate: TabContentComponent, isSignal: true }], viewQueries: [{ propertyName: "tabLinks", predicate: ["tabLink"], descendants: true, isSignal: true }], ngImport: i0, template: "<div class=\"tab\" [ngClass]=\"'tab-' + type()\">\
|
|
5350
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.20", type: TabComponent, isStandalone: true, selector: "cw-tab", inputs: { type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: false, transformFunction: null }, id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null }, useFragment: { classPropertyName: "useFragment", publicName: "useFragment", isSignal: true, isRequired: false, transformFunction: null }, title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: false, transformFunction: null }, tabContentCssClass: { classPropertyName: "tabContentCssClass", publicName: "tabContentCssClass", isSignal: true, isRequired: false, transformFunction: null }, activeTabIndex: { classPropertyName: "activeTabIndex", publicName: "activeTabIndex", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { tabChanged: "tabChanged", subTabChanged: "subTabChanged" }, host: { classAttribute: "cw-tab" }, queries: [{ propertyName: "tabs", predicate: TabContentComponent, isSignal: true }], viewQueries: [{ propertyName: "tabLinks", predicate: ["tabLink"], descendants: true, isSignal: true }], ngImport: i0, template: "<div class=\"tab\" [ngClass]=\"'tab-' + type()\">\n <!-- En-tete libre au-dessus des onglets (identite d'une fiche...), dans la meme carte en variante\n `card`. Masque quand rien n'est projete (`:empty`). -->\n <div class=\"tab-header\"><ng-content select=\"[tab-header]\"></ng-content></div>\n\n @if (title(); as title) {\n <h2>{{ title | translate }}</h2>\n }\n <ul class=\"tab-items d-flex-h\" [ngClass]=\"'tab-items-' + type()\" role=\"tablist\">\n @for (tab of tabs(); track tab; let i = $index) {\n <li class=\"tab-item\" role=\"presentation\">\n <button #tabLink type=\"button\" class=\"tab-link btn\" [class.active]=\"tab.active()\" [class.disabled]=\"tab.disabled()\"\n [disabled]=\"tab.disabled()\" [attr.id]=\"tab.tabId()\" [attr.data-test-ctw]=\"'link-tab-' + id() + '-' + i\"\n [attr.aria-selected]=\"tab.active()\" [attr.aria-controls]=\"tab.panelId()\"\n [attr.tabindex]=\"tab.active() ? '0' : '-1'\" (click)=\"selectTab(tab)\" (keydown)=\"onKeydown($event)\" role=\"tab\">\n <ng-container *ngTemplateOutlet=\"tabLabel; context: { $implicit: tab }\"></ng-container>\n </button>\n </li>\n }\n </ul>\n\n <!-- Sous-onglets de l'onglet actif (`cw-tab-content` imbriques), sous la barre principale :\n seconde tablist, nommee par l'onglet principal actif. -->\n @if (activeTab(); as parent) {\n @if (subTabs().length) {\n <ul class=\"tab-items tab-items-sub d-flex-h\" role=\"tablist\" [attr.aria-labelledby]=\"parent.tabId()\">\n @for (sub of subTabs(); track sub; let j = $index) {\n <li class=\"tab-item\" role=\"presentation\">\n <button type=\"button\" class=\"tab-link btn\" [class.active]=\"sub.active()\" [class.disabled]=\"sub.disabled()\"\n [disabled]=\"sub.disabled()\" [attr.id]=\"sub.tabId()\" [attr.data-test-ctw]=\"'link-tab-' + id() + '-' + activeId + '-' + j\"\n [attr.aria-selected]=\"sub.active()\" [attr.aria-controls]=\"sub.panelId()\"\n [attr.tabindex]=\"sub.active() ? '0' : '-1'\" (click)=\"selectSubTab(parent, sub)\" (keydown)=\"onKeydown($event, 'sub')\" role=\"tab\">\n <ng-container *ngTemplateOutlet=\"tabLabel; context: { $implicit: sub }\"></ng-container>\n </button>\n </li>\n }\n </ul>\n }\n }\n</div>\n\n<div [class]=\"'tab-content ' + tabContentCssClass()\" [ngClass]=\"'tab-content-' + type()\">\n <ng-content></ng-content>\n</div>\n\n<!-- Libelle d'un onglet (principal ou sous-onglet) : picto, titre, badge. -->\n<ng-template #tabLabel let-tab>\n @if (tab.withIcon(); as icon) {\n <cw-icon [icon]=\"icon\" [iconSize]=\"iconSize\"></cw-icon>\n }\n {{ tab.title() | translate }}\n @if (tab.badge(); as badge) {\n <cw-badge [type]=\"badge.type\" [label]=\"badge.label\" [withIcon]=\"badge.withIcon\"\n [iconPosition]=\"badge.iconPosition\" [cssClass]=\"badge.cssClass ?? ''\" [dataTest]=\"badge.dataTest\"></cw-badge>\n }\n</ng-template>\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: IconComponent, selector: "cw-icon", inputs: ["icon", "text", "label", "type", "iconSize", "iconCssClass", "iconUiType", "iconColorCustom", "spritePath"] }, { kind: "component", type: BadgeComponent, selector: "cw-badge", inputs: ["type", "label", "labelParams", "withIcon", "iconPosition", "cssClass", "skeletonMode", "dataTest"] }, { kind: "ngmodule", type: TranslateModule }, { kind: "pipe", type: i2.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
5242
5351
|
}
|
|
5243
5352
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: TabComponent, decorators: [{
|
|
5244
5353
|
type: Component,
|
|
@@ -5251,8 +5360,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.20", ngImpo
|
|
|
5251
5360
|
IconComponent,
|
|
5252
5361
|
BadgeComponent,
|
|
5253
5362
|
TranslateModule
|
|
5254
|
-
], template: "<div class=\"tab\" [ngClass]=\"'tab-' + type()\">\
|
|
5255
|
-
}], propDecorators: { type: [{ type: i0.Input, args: [{ isSignal: true, alias: "type", required: false }] }], id: [{ type: i0.Input, args: [{ isSignal: true, alias: "id", required: false }] }], useFragment: [{ type: i0.Input, args: [{ isSignal: true, alias: "useFragment", required: false }] }], title: [{ type: i0.Input, args: [{ isSignal: true, alias: "title", required: false }] }], tabContentCssClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "tabContentCssClass", required: false }] }], activeTabIndex: [{ type: i0.Input, args: [{ isSignal: true, alias: "activeTabIndex", required: false }] }], tabs: [{ type: i0.ContentChildren, args: [i0.forwardRef(() => TabContentComponent), { isSignal: true }] }], tabLinks: [{ type: i0.ViewChildren, args: ['tabLink', { isSignal: true }] }], tabChanged: [{ type: i0.Output, args: ["tabChanged"] }] } });
|
|
5363
|
+
], template: "<div class=\"tab\" [ngClass]=\"'tab-' + type()\">\n <!-- En-tete libre au-dessus des onglets (identite d'une fiche...), dans la meme carte en variante\n `card`. Masque quand rien n'est projete (`:empty`). -->\n <div class=\"tab-header\"><ng-content select=\"[tab-header]\"></ng-content></div>\n\n @if (title(); as title) {\n <h2>{{ title | translate }}</h2>\n }\n <ul class=\"tab-items d-flex-h\" [ngClass]=\"'tab-items-' + type()\" role=\"tablist\">\n @for (tab of tabs(); track tab; let i = $index) {\n <li class=\"tab-item\" role=\"presentation\">\n <button #tabLink type=\"button\" class=\"tab-link btn\" [class.active]=\"tab.active()\" [class.disabled]=\"tab.disabled()\"\n [disabled]=\"tab.disabled()\" [attr.id]=\"tab.tabId()\" [attr.data-test-ctw]=\"'link-tab-' + id() + '-' + i\"\n [attr.aria-selected]=\"tab.active()\" [attr.aria-controls]=\"tab.panelId()\"\n [attr.tabindex]=\"tab.active() ? '0' : '-1'\" (click)=\"selectTab(tab)\" (keydown)=\"onKeydown($event)\" role=\"tab\">\n <ng-container *ngTemplateOutlet=\"tabLabel; context: { $implicit: tab }\"></ng-container>\n </button>\n </li>\n }\n </ul>\n\n <!-- Sous-onglets de l'onglet actif (`cw-tab-content` imbriques), sous la barre principale :\n seconde tablist, nommee par l'onglet principal actif. -->\n @if (activeTab(); as parent) {\n @if (subTabs().length) {\n <ul class=\"tab-items tab-items-sub d-flex-h\" role=\"tablist\" [attr.aria-labelledby]=\"parent.tabId()\">\n @for (sub of subTabs(); track sub; let j = $index) {\n <li class=\"tab-item\" role=\"presentation\">\n <button type=\"button\" class=\"tab-link btn\" [class.active]=\"sub.active()\" [class.disabled]=\"sub.disabled()\"\n [disabled]=\"sub.disabled()\" [attr.id]=\"sub.tabId()\" [attr.data-test-ctw]=\"'link-tab-' + id() + '-' + activeId + '-' + j\"\n [attr.aria-selected]=\"sub.active()\" [attr.aria-controls]=\"sub.panelId()\"\n [attr.tabindex]=\"sub.active() ? '0' : '-1'\" (click)=\"selectSubTab(parent, sub)\" (keydown)=\"onKeydown($event, 'sub')\" role=\"tab\">\n <ng-container *ngTemplateOutlet=\"tabLabel; context: { $implicit: sub }\"></ng-container>\n </button>\n </li>\n }\n </ul>\n }\n }\n</div>\n\n<div [class]=\"'tab-content ' + tabContentCssClass()\" [ngClass]=\"'tab-content-' + type()\">\n <ng-content></ng-content>\n</div>\n\n<!-- Libelle d'un onglet (principal ou sous-onglet) : picto, titre, badge. -->\n<ng-template #tabLabel let-tab>\n @if (tab.withIcon(); as icon) {\n <cw-icon [icon]=\"icon\" [iconSize]=\"iconSize\"></cw-icon>\n }\n {{ tab.title() | translate }}\n @if (tab.badge(); as badge) {\n <cw-badge [type]=\"badge.type\" [label]=\"badge.label\" [withIcon]=\"badge.withIcon\"\n [iconPosition]=\"badge.iconPosition\" [cssClass]=\"badge.cssClass ?? ''\" [dataTest]=\"badge.dataTest\"></cw-badge>\n }\n</ng-template>\n" }]
|
|
5364
|
+
}], ctorParameters: () => [], propDecorators: { type: [{ type: i0.Input, args: [{ isSignal: true, alias: "type", required: false }] }], id: [{ type: i0.Input, args: [{ isSignal: true, alias: "id", required: false }] }], useFragment: [{ type: i0.Input, args: [{ isSignal: true, alias: "useFragment", required: false }] }], title: [{ type: i0.Input, args: [{ isSignal: true, alias: "title", required: false }] }], tabContentCssClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "tabContentCssClass", required: false }] }], activeTabIndex: [{ type: i0.Input, args: [{ isSignal: true, alias: "activeTabIndex", required: false }] }], tabs: [{ type: i0.ContentChildren, args: [i0.forwardRef(() => TabContentComponent), { isSignal: true }] }], tabLinks: [{ type: i0.ViewChildren, args: ['tabLink', { isSignal: true }] }], tabChanged: [{ type: i0.Output, args: ["tabChanged"] }], subTabChanged: [{ type: i0.Output, args: ["subTabChanged"] }] } });
|
|
5256
5365
|
|
|
5257
5366
|
class StepperComponent {
|
|
5258
5367
|
constructor() {
|
|
@@ -6146,5 +6255,5 @@ const CW_DEFAULT_THEME_OPTIONS = [
|
|
|
6146
6255
|
* Generated bundle index. Do not edit.
|
|
6147
6256
|
*/
|
|
6148
6257
|
|
|
6149
|
-
export { AccordionComponent, AlertComponent, AlertLiveEnum, AlertTypeEnum, BadgeComponent, BadgePositionEnum, BadgeTypeEnum, BoButtonTypeEnum, BoTabTypeEnum, BreadcrumbComponent, ButtonComponent, ButtonIconSizeEnum, ButtonPositionEnum, CW_DEFAULT_THEME_OPTIONS, CardComponent, CardTitleRankEnum, CardTypeEnum, ClickOutsideDirective, CollapseDirective, CwThemeKeyEnum, CwTooltipDirective, DividerComponent, DropdownComponent, DropdownItemDirective, DropdownPositionEnum, EmptyStateComponent, EmptyStateIllustrationEnum, FileDropComponent, FileDropFileStatusEnum, FileDropModeEnum, FileDropRejectReasonEnum, FilePreviewComponent, FileToDownloadComponent, FoButtonTypeEnum, FoTabTypeEnum, FocusTrackerService, FormFieldComponent, FormFieldTypeEnum, IconComponent, IconNotifSizeEnum, IconNotifTypeEnum, IconNotificationComponent, IconSizeEnum, IconTypeEnum, IconUiTypeEnum, ImageComponent, LanguageSelectorComponent, LegendColorEnum, LegendComponent, LegendTypeEnum, LoaderComponent, LoaderSizeEnum, ModalsComponent, ModalsService, ModalsSize, ModalsState, ModalsTextType, ModalsType, NumericalRangeComponent, NumericalRangeLabelPositionEnum, NumericalRangeTypeEnum, PlacementEnum, RequiredInfoComponent, ResponsiveService, SkipLinksComponent, SpriteIconEnum, StepperComponent, TOAST_AUTOHIDE_DELAY_MS, TabComponent, TabContentComponent, ThemeSelectorComponent, ThemeService, TitleComponent, TitleContextEnum, TitleTagEnum, ToastComponent, ToastItemComponent, ToastService, TooltipPositionEnum, TriggerTooltipEnum, TypeTooltipEnum, rangeValidator, resolveArrowPos };
|
|
6258
|
+
export { AccordionComponent, AlertComponent, AlertLiveEnum, AlertTypeEnum, BadgeComponent, BadgePositionEnum, BadgeTypeEnum, BoButtonTypeEnum, BoTabTypeEnum, BreadcrumbComponent, ButtonComponent, ButtonIconSizeEnum, ButtonPositionEnum, CW_DEFAULT_THEME_OPTIONS, CardComponent, CardTitleRankEnum, CardTypeEnum, ClickOutsideDirective, CollapseDirective, CwThemeKeyEnum, CwTooltipDirective, DividerComponent, DropdownComponent, DropdownItemDirective, DropdownPositionEnum, EmptyStateComponent, EmptyStateIllustrationEnum, FileDropComponent, FileDropFileStatusEnum, FileDropModeEnum, FileDropRejectReasonEnum, FilePreviewComponent, FileToDownloadComponent, FoButtonTypeEnum, FoTabTypeEnum, FocusTrackerService, FormFieldComponent, FormFieldTypeEnum, IconComponent, IconNotifSizeEnum, IconNotifTypeEnum, IconNotificationComponent, IconSizeEnum, IconTypeEnum, IconUiTypeEnum, ImageComponent, LanguageSelectorComponent, LegendColorEnum, LegendComponent, LegendTypeEnum, LoaderComponent, LoaderSizeEnum, ModalsComponent, ModalsService, ModalsSize, ModalsState, ModalsTextType, ModalsType, NumericalRangeComponent, NumericalRangeLabelPositionEnum, NumericalRangeTypeEnum, PlacementEnum, RequiredInfoComponent, ResponsiveService, SkipLinksComponent, SpriteIconEnum, StepperComponent, TOAST_AUTOHIDE_DELAY_MS, TabComponent, TabContentComponent, TabLazyDirective, ThemeSelectorComponent, ThemeService, TitleComponent, TitleContextEnum, TitleTagEnum, ToastComponent, ToastItemComponent, ToastService, TooltipPositionEnum, TriggerTooltipEnum, TypeTooltipEnum, rangeValidator, resolveArrowPos };
|
|
6150
6259
|
//# sourceMappingURL=cityway-basic-ui.mjs.map
|