@cityway/basic-ui 1.0.2-beta017 → 1.0.2-beta018
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-basic-ui-1.0.2-beta018.tgz +0 -0
- package/fesm2022/cityway-basic-ui.mjs +269 -449
- package/fesm2022/cityway-basic-ui.mjs.map +1 -1
- package/index.d.ts +191 -186
- package/lib/assets/styles/scss/components/form-field/_form-field.scss +3 -3
- package/package.json +1 -1
- 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.0.2-beta017.tgz +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as i1 from '@angular/common';
|
|
2
2
|
import { CommonModule, NgClass, NgTemplateOutlet } from '@angular/common';
|
|
3
3
|
import * as i0 from '@angular/core';
|
|
4
|
-
import { inject, ElementRef, signal, EventEmitter, effect, Output, Input, Directive, HostBinding, Component,
|
|
4
|
+
import { inject, ElementRef, signal, EventEmitter, effect, Output, Input, Directive, input, HostBinding, Component, ChangeDetectorRef, model, output, viewChild, contentChildren, Injectable, NgZone, HostListener, Renderer2, ViewChild, TemplateRef, ContentChild, ApplicationRef, Injector, createComponent, viewChildren, Pipe, computed } from '@angular/core';
|
|
5
5
|
import * as i2 from '@ngx-translate/core';
|
|
6
6
|
import { TranslateModule, TranslatePipe, TranslateService } from '@ngx-translate/core';
|
|
7
7
|
import { BehaviorSubject, fromEvent } from 'rxjs';
|
|
@@ -12,7 +12,7 @@ import * as i2$1 from '@angular/forms';
|
|
|
12
12
|
import { FormGroup, FormsModule, ReactiveFormsModule } from '@angular/forms';
|
|
13
13
|
import * as i3 from '@ng-select/ng-select';
|
|
14
14
|
import { NgSelectModule } from '@ng-select/ng-select';
|
|
15
|
-
import
|
|
15
|
+
import { Router, ActivatedRoute } from '@angular/router';
|
|
16
16
|
|
|
17
17
|
class CollapseDirective {
|
|
18
18
|
set cwCollapse(value) {
|
|
@@ -630,43 +630,29 @@ var SpriteIconEnum;
|
|
|
630
630
|
|
|
631
631
|
class IconComponent {
|
|
632
632
|
constructor() {
|
|
633
|
-
this.icon = SpriteIconEnum.alertHelp;
|
|
634
|
-
this.
|
|
635
|
-
this.
|
|
636
|
-
this.
|
|
637
|
-
this.
|
|
638
|
-
this.
|
|
633
|
+
this.icon = input(SpriteIconEnum.alertHelp, ...(ngDevMode ? [{ debugName: "icon" }] : []));
|
|
634
|
+
this.label = input(...(ngDevMode ? [undefined, { debugName: "label" }] : []));
|
|
635
|
+
this.type = input(IconTypeEnum.default, ...(ngDevMode ? [{ debugName: "type" }] : []));
|
|
636
|
+
this.iconSize = input(IconSizeEnum['sm'], ...(ngDevMode ? [{ debugName: "iconSize" }] : []));
|
|
637
|
+
this.iconCssClass = input('', ...(ngDevMode ? [{ debugName: "iconCssClass" }] : []));
|
|
638
|
+
this.iconUiType = input(IconUiTypeEnum.default, ...(ngDevMode ? [{ debugName: "iconUiType" }] : []));
|
|
639
|
+
this.iconColorCustom = input(...(ngDevMode ? [undefined, { debugName: "iconColorCustom" }] : []));
|
|
640
|
+
this.spritePath = input('/assets/icons/sprite.svg', ...(ngDevMode ? [{ debugName: "spritePath" }] : []));
|
|
639
641
|
this.iconTypeEnum = IconTypeEnum;
|
|
640
642
|
}
|
|
641
643
|
get hostClasses() {
|
|
642
|
-
if (this.type === IconTypeEnum.rounded) {
|
|
643
|
-
return `icon-rounded icon-rounded-${this.iconSize} icon-rounded-${this.iconUiType}`;
|
|
644
|
+
if (this.type() === IconTypeEnum.rounded) {
|
|
645
|
+
return `icon-rounded icon-rounded-${this.iconSize()} icon-rounded-${this.iconUiType()}`;
|
|
644
646
|
}
|
|
645
|
-
return `icon icon-${this.iconSize}`;
|
|
647
|
+
return `icon icon-${this.iconSize()}`;
|
|
646
648
|
}
|
|
647
649
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.19", ngImport: i0, type: IconComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
648
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.19", type: IconComponent, isStandalone: true, selector: "cw-icon", inputs: { icon: "icon", label: "label", type: "type", iconSize: "iconSize", iconCssClass: "iconCssClass", iconUiType: "iconUiType", iconColorCustom: "iconColorCustom", spritePath: "spritePath" }, host: { properties: { "class": "this.hostClasses" } }, ngImport: i0, template: "@if (type == iconTypeEnum.rounded) {\
|
|
650
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.19", type: IconComponent, isStandalone: true, selector: "cw-icon", inputs: { icon: { classPropertyName: "icon", publicName: "icon", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: false, transformFunction: null }, iconSize: { classPropertyName: "iconSize", publicName: "iconSize", isSignal: true, isRequired: false, transformFunction: null }, iconCssClass: { classPropertyName: "iconCssClass", publicName: "iconCssClass", isSignal: true, isRequired: false, transformFunction: null }, iconUiType: { classPropertyName: "iconUiType", publicName: "iconUiType", isSignal: true, isRequired: false, transformFunction: null }, iconColorCustom: { classPropertyName: "iconColorCustom", publicName: "iconColorCustom", isSignal: true, isRequired: false, transformFunction: null }, spritePath: { classPropertyName: "spritePath", publicName: "spritePath", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "this.hostClasses" } }, ngImport: i0, template: "@if (type() == iconTypeEnum.rounded) {\n <span class=\"icon\">\n <ng-container *ngTemplateOutlet=\"iconContent\"></ng-container>\n </span>\n} @else {\n <ng-container *ngTemplateOutlet=\"iconContent\"></ng-container>\n}\n\n<ng-template #iconContent>\n <svg class=\"icon-svg\" [ngClass]=\"iconCssClass()\" aria-hidden=\"true\"\n [attr.style]=\"iconColorCustom() ? 'color: ' + iconColorCustom() : null\">\n <use [attr.href]=\"spritePath() + '#' + icon()\" />\n </svg>\n @if (label()) {\n <span class=\"visually-hidden\">{{ label() }}</span>\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"] }] }); }
|
|
649
651
|
}
|
|
650
652
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.19", ngImport: i0, type: IconComponent, decorators: [{
|
|
651
653
|
type: Component,
|
|
652
|
-
args: [{ selector: 'cw-icon', standalone: true, imports: [CommonModule], template: "@if (type == iconTypeEnum.rounded) {\
|
|
653
|
-
}], propDecorators: { icon: [{
|
|
654
|
-
type: Input
|
|
655
|
-
}], label: [{
|
|
656
|
-
type: Input
|
|
657
|
-
}], type: [{
|
|
658
|
-
type: Input
|
|
659
|
-
}], iconSize: [{
|
|
660
|
-
type: Input
|
|
661
|
-
}], iconCssClass: [{
|
|
662
|
-
type: Input
|
|
663
|
-
}], iconUiType: [{
|
|
664
|
-
type: Input
|
|
665
|
-
}], iconColorCustom: [{
|
|
666
|
-
type: Input
|
|
667
|
-
}], spritePath: [{
|
|
668
|
-
type: Input
|
|
669
|
-
}], hostClasses: [{
|
|
654
|
+
args: [{ selector: 'cw-icon', standalone: true, imports: [CommonModule], template: "@if (type() == iconTypeEnum.rounded) {\n <span class=\"icon\">\n <ng-container *ngTemplateOutlet=\"iconContent\"></ng-container>\n </span>\n} @else {\n <ng-container *ngTemplateOutlet=\"iconContent\"></ng-container>\n}\n\n<ng-template #iconContent>\n <svg class=\"icon-svg\" [ngClass]=\"iconCssClass()\" aria-hidden=\"true\"\n [attr.style]=\"iconColorCustom() ? 'color: ' + iconColorCustom() : null\">\n <use [attr.href]=\"spritePath() + '#' + icon()\" />\n </svg>\n @if (label()) {\n <span class=\"visually-hidden\">{{ label() }}</span>\n }\n</ng-template>\n" }]
|
|
655
|
+
}], propDecorators: { icon: [{ type: i0.Input, args: [{ isSignal: true, alias: "icon", required: false }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], type: [{ type: i0.Input, args: [{ isSignal: true, alias: "type", required: false }] }], iconSize: [{ type: i0.Input, args: [{ isSignal: true, alias: "iconSize", required: false }] }], iconCssClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "iconCssClass", required: false }] }], iconUiType: [{ type: i0.Input, args: [{ isSignal: true, alias: "iconUiType", required: false }] }], iconColorCustom: [{ type: i0.Input, args: [{ isSignal: true, alias: "iconColorCustom", required: false }] }], spritePath: [{ type: i0.Input, args: [{ isSignal: true, alias: "spritePath", required: false }] }], hostClasses: [{
|
|
670
656
|
type: HostBinding,
|
|
671
657
|
args: ['class']
|
|
672
658
|
}] } });
|
|
@@ -683,15 +669,18 @@ var CardTitleRankEnum;
|
|
|
683
669
|
})(CardTitleRankEnum || (CardTitleRankEnum = {}));
|
|
684
670
|
|
|
685
671
|
class CardComponent {
|
|
686
|
-
constructor(
|
|
687
|
-
this.cdRef =
|
|
688
|
-
this.
|
|
689
|
-
this.
|
|
690
|
-
this.
|
|
691
|
-
this.
|
|
692
|
-
this.
|
|
693
|
-
this.
|
|
694
|
-
this.
|
|
672
|
+
constructor() {
|
|
673
|
+
this.cdRef = inject(ChangeDetectorRef);
|
|
674
|
+
this.title = input(...(ngDevMode ? [undefined, { debugName: "title" }] : []));
|
|
675
|
+
this.type = input(CardTypeEnum.default, ...(ngDevMode ? [{ debugName: "type" }] : []));
|
|
676
|
+
this.titleRank = input(CardTitleRankEnum.h2, ...(ngDevMode ? [{ debugName: "titleRank" }] : []));
|
|
677
|
+
this.collapsible = model(false, ...(ngDevMode ? [{ debugName: "collapsible" }] : []));
|
|
678
|
+
this.collapsed = input(false, ...(ngDevMode ? [{ debugName: "collapsed" }] : []));
|
|
679
|
+
this.collapseId = input(`collapse-${Math.random().toString(36).substring(2, 11)}`, ...(ngDevMode ? [{ debugName: "collapseId" }] : []));
|
|
680
|
+
this.destroyOnHide = model(true, ...(ngDevMode ? [{ debugName: "destroyOnHide" }] : []));
|
|
681
|
+
this.collapseClicked = output();
|
|
682
|
+
this.collapseDirective = viewChild('collapse', ...(ngDevMode ? [{ debugName: "collapseDirective" }] : []));
|
|
683
|
+
this.cardFooter = viewChild('cardFooter', ...(ngDevMode ? [{ debugName: "cardFooter" }] : []));
|
|
695
684
|
this.showFooter = true;
|
|
696
685
|
this.titleRankEnum = CardTitleRankEnum;
|
|
697
686
|
this.typeEnum = CardTypeEnum;
|
|
@@ -701,17 +690,18 @@ class CardComponent {
|
|
|
701
690
|
this.spriteIcon = SpriteIconEnum;
|
|
702
691
|
}
|
|
703
692
|
ngOnInit() {
|
|
704
|
-
this.isCollapsed.set(this.collapsed);
|
|
705
|
-
if (this.destroyOnHide && this.collapsed) {
|
|
693
|
+
this.isCollapsed.set(this.collapsed());
|
|
694
|
+
if (this.destroyOnHide() && this.collapsed()) {
|
|
706
695
|
this.shouldRenderBody.set(false);
|
|
707
696
|
}
|
|
708
697
|
}
|
|
709
698
|
ngAfterViewInit() {
|
|
710
|
-
|
|
699
|
+
const el = this.cardFooter()?.nativeElement;
|
|
700
|
+
this.showFooter = !!el && el.children.length > 0;
|
|
711
701
|
this.cdRef.detectChanges();
|
|
712
702
|
}
|
|
713
703
|
toggleCollapse() {
|
|
714
|
-
if (this.collapsible) {
|
|
704
|
+
if (this.collapsible()) {
|
|
715
705
|
const newCollapsedState = !this.isCollapsed();
|
|
716
706
|
this.updateCollapseState(newCollapsedState);
|
|
717
707
|
}
|
|
@@ -723,13 +713,13 @@ class CardComponent {
|
|
|
723
713
|
this.updateCollapseState(false);
|
|
724
714
|
}
|
|
725
715
|
updateCollapseState(collapsed) {
|
|
726
|
-
if (!collapsed && this.destroyOnHide && !this.shouldRenderBody()) {
|
|
716
|
+
if (!collapsed && this.destroyOnHide() && !this.shouldRenderBody()) {
|
|
727
717
|
this.shouldRenderBody.set(true);
|
|
728
718
|
this.cdRef.detectChanges();
|
|
729
719
|
}
|
|
730
720
|
this.isCollapsed.set(collapsed);
|
|
731
721
|
this.collapseClicked.emit(collapsed);
|
|
732
|
-
if (collapsed && this.destroyOnHide) {
|
|
722
|
+
if (collapsed && this.destroyOnHide()) {
|
|
733
723
|
setTimeout(() => {
|
|
734
724
|
if (this.isCollapsed()) {
|
|
735
725
|
this.shouldRenderBody.set(false);
|
|
@@ -741,8 +731,8 @@ class CardComponent {
|
|
|
741
731
|
get collapsed_state() {
|
|
742
732
|
return this.isCollapsed();
|
|
743
733
|
}
|
|
744
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.19", ngImport: i0, type: CardComponent, deps: [
|
|
745
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.19", type: CardComponent, isStandalone: true, selector: "cw-card", inputs: { title: "title", type: "type", titleRank: "titleRank", collapsible: "collapsible", collapsed: "collapsed", collapseId: "collapseId", destroyOnHide: "destroyOnHide" }, outputs: { collapseClicked: "collapseClicked" }, viewQueries: [{ propertyName: "collapseDirective", first: true, predicate: ["collapse"], descendants: true }, { propertyName: "cardFooter", first: true, predicate: ["cardFooter"], descendants: true }], ngImport: i0, template: "<div class=\"card\" [class.card-collapse]=\"collapsible\" [class.card-light]=\"type == typeEnum.light\">\n @if (title) {\n <div class=\"card-header\" [class.card-header-collapse]=\"collapsible\"\n [class.card-header-collapsed]=\"collapsible && isCollapsed()\">\n <ng-container *ngTemplateOutlet=\"header\"></ng-container>\n </div>\n }\n\n @if(collapsible) {\n <div [cwCollapse]=\"isCollapsed()\" [id]=\"collapseId\" #collapse=\"cwCollapse\">\n <ng-container *ngTemplateOutlet=\"content\"></ng-container>\n </div>\n }\n @else {\n <ng-container *ngTemplateOutlet=\"content\"></ng-container>\n }\n</div>\n\n<ng-template #header>\n @if (titleRank == titleRankEnum.h2) {\n <h2>{{title}}</h2>\n }\n @else if (titleRank == titleRankEnum.h3) {\n <h3>{{title}}</h3>\n }\n\n <div class=\"card-header-custom-area\">\n <ng-content select=\"[header-custom-area]\"></ng-content>\n </div>\n\n @if (collapsible) {\n <button type=\"button\" class=\"btn btn-collapse stretched-link\" (click)=\"toggleCollapse()\"\n [attr.aria-expanded]=\"!isCollapsed()\" [class.collapsed]=\"isCollapsed()\" [attr.aria-controls]=\"collapseId\">\n <cw-icon [icon]=\"spriteIcon.down\" label=\"D\u00E9plier/Plier\" [iconSize]=\"iconSize['xs']\"></cw-icon>\n <!-- // TODO trad -->\n </button>\n }\n</ng-template>\n\n<ng-template #content>\n @if (shouldRenderBody()) {\n <div class=\"card-body\">\n <ng-content></ng-content>\n </div>\n\n @if (showFooter) {\n <div class=\"card-footer\" #cardFooter>\n <ng-content select=\"[card-footer]\"></ng-content>\n </div>\n }\n }\n</ng-template>\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: CollapseDirective, selector: "[cwCollapse]", inputs: ["cwCollapse"], outputs: ["shown", "hidden"], exportAs: ["cwCollapse"] }, { kind: "component", type: IconComponent, selector: "cw-icon", inputs: ["icon", "label", "type", "iconSize", "iconCssClass", "iconUiType", "iconColorCustom", "spritePath"] }] }); }
|
|
734
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.19", ngImport: i0, type: CardComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
735
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.19", type: CardComponent, isStandalone: true, selector: "cw-card", inputs: { title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: false, transformFunction: null }, type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: false, transformFunction: null }, titleRank: { classPropertyName: "titleRank", publicName: "titleRank", isSignal: true, isRequired: false, transformFunction: null }, collapsible: { classPropertyName: "collapsible", publicName: "collapsible", isSignal: true, isRequired: false, transformFunction: null }, collapsed: { classPropertyName: "collapsed", publicName: "collapsed", isSignal: true, isRequired: false, transformFunction: null }, collapseId: { classPropertyName: "collapseId", publicName: "collapseId", isSignal: true, isRequired: false, transformFunction: null }, destroyOnHide: { classPropertyName: "destroyOnHide", publicName: "destroyOnHide", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { collapsible: "collapsibleChange", destroyOnHide: "destroyOnHideChange", collapseClicked: "collapseClicked" }, viewQueries: [{ propertyName: "collapseDirective", first: true, predicate: ["collapse"], descendants: true, isSignal: true }, { propertyName: "cardFooter", first: true, predicate: ["cardFooter"], descendants: true, isSignal: true }], ngImport: i0, template: "<div class=\"card\" [class.card-collapse]=\"collapsible()\" [class.card-light]=\"type() == typeEnum.light\">\n @if (title()) {\n <div class=\"card-header\" [class.card-header-collapse]=\"collapsible()\"\n [class.card-header-collapsed]=\"collapsible() && isCollapsed()\">\n <ng-container *ngTemplateOutlet=\"header\"></ng-container>\n </div>\n }\n\n @if(collapsible()) {\n <div [cwCollapse]=\"isCollapsed()\" [id]=\"collapseId()\" #collapse=\"cwCollapse\">\n <ng-container *ngTemplateOutlet=\"content\"></ng-container>\n </div>\n }\n @else {\n <ng-container *ngTemplateOutlet=\"content\"></ng-container>\n }\n</div>\n\n<ng-template #header>\n @if (titleRank() == titleRankEnum.h2) {\n <h2>{{title()}}</h2>\n }\n @else if (titleRank() == titleRankEnum.h3) {\n <h3>{{title()}}</h3>\n }\n\n <div class=\"card-header-custom-area\">\n <ng-content select=\"[header-custom-area]\"></ng-content>\n </div>\n\n @if (collapsible()) {\n <button type=\"button\" class=\"btn btn-collapse stretched-link\" (click)=\"toggleCollapse()\"\n [attr.aria-expanded]=\"!isCollapsed()\" [class.collapsed]=\"isCollapsed()\" [attr.aria-controls]=\"collapseId()\">\n <cw-icon [icon]=\"spriteIcon.down\" label=\"D\u00E9plier/Plier\" [iconSize]=\"iconSize['xs']\"></cw-icon>\n <!-- // TODO trad -->\n </button>\n }\n</ng-template>\n\n<ng-template #content>\n @if (shouldRenderBody()) {\n <div class=\"card-body\">\n <ng-content></ng-content>\n </div>\n\n @if (showFooter) {\n <div class=\"card-footer\" #cardFooter>\n <ng-content select=\"[card-footer]\"></ng-content>\n </div>\n }\n }\n</ng-template>\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: CollapseDirective, selector: "[cwCollapse]", inputs: ["cwCollapse"], outputs: ["shown", "hidden"], exportAs: ["cwCollapse"] }, { kind: "component", type: IconComponent, selector: "cw-icon", inputs: ["icon", "label", "type", "iconSize", "iconCssClass", "iconUiType", "iconColorCustom", "spritePath"] }] }); }
|
|
746
736
|
}
|
|
747
737
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.19", ngImport: i0, type: CardComponent, decorators: [{
|
|
748
738
|
type: Component,
|
|
@@ -750,51 +740,30 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.19", ngImpo
|
|
|
750
740
|
CommonModule,
|
|
751
741
|
CollapseDirective,
|
|
752
742
|
IconComponent
|
|
753
|
-
], template: "<div class=\"card\" [class.card-collapse]=\"collapsible\" [class.card-light]=\"type == typeEnum.light\">\n @if (title) {\n <div class=\"card-header\" [class.card-header-collapse]=\"collapsible\"\n [class.card-header-collapsed]=\"collapsible && isCollapsed()\">\n <ng-container *ngTemplateOutlet=\"header\"></ng-container>\n </div>\n }\n\n @if(collapsible) {\n <div [cwCollapse]=\"isCollapsed()\" [id]=\"collapseId\" #collapse=\"cwCollapse\">\n <ng-container *ngTemplateOutlet=\"content\"></ng-container>\n </div>\n }\n @else {\n <ng-container *ngTemplateOutlet=\"content\"></ng-container>\n }\n</div>\n\n<ng-template #header>\n @if (titleRank == titleRankEnum.h2) {\n <h2>{{title}}</h2>\n }\n @else if (titleRank == titleRankEnum.h3) {\n <h3>{{title}}</h3>\n }\n\n <div class=\"card-header-custom-area\">\n <ng-content select=\"[header-custom-area]\"></ng-content>\n </div>\n\n @if (collapsible) {\n <button type=\"button\" class=\"btn btn-collapse stretched-link\" (click)=\"toggleCollapse()\"\n [attr.aria-expanded]=\"!isCollapsed()\" [class.collapsed]=\"isCollapsed()\" [attr.aria-controls]=\"collapseId\">\n <cw-icon [icon]=\"spriteIcon.down\" label=\"D\u00E9plier/Plier\" [iconSize]=\"iconSize['xs']\"></cw-icon>\n <!-- // TODO trad -->\n </button>\n }\n</ng-template>\n\n<ng-template #content>\n @if (shouldRenderBody()) {\n <div class=\"card-body\">\n <ng-content></ng-content>\n </div>\n\n @if (showFooter) {\n <div class=\"card-footer\" #cardFooter>\n <ng-content select=\"[card-footer]\"></ng-content>\n </div>\n }\n }\n</ng-template>\n" }]
|
|
754
|
-
}],
|
|
755
|
-
type: Input
|
|
756
|
-
}], type: [{
|
|
757
|
-
type: Input
|
|
758
|
-
}], titleRank: [{
|
|
759
|
-
type: Input
|
|
760
|
-
}], collapsible: [{
|
|
761
|
-
type: Input
|
|
762
|
-
}], collapsed: [{
|
|
763
|
-
type: Input
|
|
764
|
-
}], collapseId: [{
|
|
765
|
-
type: Input
|
|
766
|
-
}], destroyOnHide: [{
|
|
767
|
-
type: Input
|
|
768
|
-
}], collapseClicked: [{
|
|
769
|
-
type: Output
|
|
770
|
-
}], collapseDirective: [{
|
|
771
|
-
type: ViewChild,
|
|
772
|
-
args: ['collapse']
|
|
773
|
-
}], cardFooter: [{
|
|
774
|
-
type: ViewChild,
|
|
775
|
-
args: ['cardFooter']
|
|
776
|
-
}] } });
|
|
743
|
+
], template: "<div class=\"card\" [class.card-collapse]=\"collapsible()\" [class.card-light]=\"type() == typeEnum.light\">\n @if (title()) {\n <div class=\"card-header\" [class.card-header-collapse]=\"collapsible()\"\n [class.card-header-collapsed]=\"collapsible() && isCollapsed()\">\n <ng-container *ngTemplateOutlet=\"header\"></ng-container>\n </div>\n }\n\n @if(collapsible()) {\n <div [cwCollapse]=\"isCollapsed()\" [id]=\"collapseId()\" #collapse=\"cwCollapse\">\n <ng-container *ngTemplateOutlet=\"content\"></ng-container>\n </div>\n }\n @else {\n <ng-container *ngTemplateOutlet=\"content\"></ng-container>\n }\n</div>\n\n<ng-template #header>\n @if (titleRank() == titleRankEnum.h2) {\n <h2>{{title()}}</h2>\n }\n @else if (titleRank() == titleRankEnum.h3) {\n <h3>{{title()}}</h3>\n }\n\n <div class=\"card-header-custom-area\">\n <ng-content select=\"[header-custom-area]\"></ng-content>\n </div>\n\n @if (collapsible()) {\n <button type=\"button\" class=\"btn btn-collapse stretched-link\" (click)=\"toggleCollapse()\"\n [attr.aria-expanded]=\"!isCollapsed()\" [class.collapsed]=\"isCollapsed()\" [attr.aria-controls]=\"collapseId()\">\n <cw-icon [icon]=\"spriteIcon.down\" label=\"D\u00E9plier/Plier\" [iconSize]=\"iconSize['xs']\"></cw-icon>\n <!-- // TODO trad -->\n </button>\n }\n</ng-template>\n\n<ng-template #content>\n @if (shouldRenderBody()) {\n <div class=\"card-body\">\n <ng-content></ng-content>\n </div>\n\n @if (showFooter) {\n <div class=\"card-footer\" #cardFooter>\n <ng-content select=\"[card-footer]\"></ng-content>\n </div>\n }\n }\n</ng-template>\n" }]
|
|
744
|
+
}], propDecorators: { title: [{ type: i0.Input, args: [{ isSignal: true, alias: "title", required: false }] }], type: [{ type: i0.Input, args: [{ isSignal: true, alias: "type", required: false }] }], titleRank: [{ type: i0.Input, args: [{ isSignal: true, alias: "titleRank", required: false }] }], collapsible: [{ type: i0.Input, args: [{ isSignal: true, alias: "collapsible", required: false }] }, { type: i0.Output, args: ["collapsibleChange"] }], collapsed: [{ type: i0.Input, args: [{ isSignal: true, alias: "collapsed", required: false }] }], collapseId: [{ type: i0.Input, args: [{ isSignal: true, alias: "collapseId", required: false }] }], destroyOnHide: [{ type: i0.Input, args: [{ isSignal: true, alias: "destroyOnHide", required: false }] }, { type: i0.Output, args: ["destroyOnHideChange"] }], collapseClicked: [{ type: i0.Output, args: ["collapseClicked"] }], collapseDirective: [{ type: i0.ViewChild, args: ['collapse', { isSignal: true }] }], cardFooter: [{ type: i0.ViewChild, args: ['cardFooter', { isSignal: true }] }] } });
|
|
777
745
|
|
|
778
746
|
class AccordionComponent {
|
|
779
747
|
constructor() {
|
|
780
|
-
this.closeOthers = true;
|
|
781
|
-
this.allowMultiple = false;
|
|
782
|
-
this.destroyOnHide = true
|
|
783
|
-
this.panelOpened =
|
|
784
|
-
this.panelClosed =
|
|
748
|
+
this.closeOthers = input(true, ...(ngDevMode ? [{ debugName: "closeOthers" }] : []));
|
|
749
|
+
this.allowMultiple = input(false, ...(ngDevMode ? [{ debugName: "allowMultiple" }] : []));
|
|
750
|
+
this.destroyOnHide = input(true, ...(ngDevMode ? [{ debugName: "destroyOnHide" }] : []));
|
|
751
|
+
this.panelOpened = output();
|
|
752
|
+
this.panelClosed = output();
|
|
753
|
+
this.cards = contentChildren(CardComponent, ...(ngDevMode ? [{ debugName: "cards" }] : []));
|
|
785
754
|
this.cardMap = new Map();
|
|
786
755
|
}
|
|
787
756
|
ngAfterContentInit() {
|
|
788
|
-
this.cards.forEach(card => {
|
|
789
|
-
if (!card.collapsible) {
|
|
790
|
-
card.collapsible
|
|
757
|
+
this.cards().forEach(card => {
|
|
758
|
+
if (!card.collapsible()) {
|
|
759
|
+
card.collapsible.set(true);
|
|
791
760
|
}
|
|
792
|
-
if (card.destroyOnHide === true) {
|
|
793
|
-
card.destroyOnHide
|
|
761
|
+
if (card.destroyOnHide() === true) {
|
|
762
|
+
card.destroyOnHide.set(this.destroyOnHide());
|
|
794
763
|
}
|
|
795
|
-
this.cardMap.set(card.collapseId, card);
|
|
764
|
+
this.cardMap.set(card.collapseId(), card);
|
|
796
765
|
card.collapseClicked.subscribe((isCollapsed) => {
|
|
797
|
-
this.onCardToggle(card.collapseId, isCollapsed);
|
|
766
|
+
this.onCardToggle(card.collapseId(), isCollapsed);
|
|
798
767
|
});
|
|
799
768
|
});
|
|
800
769
|
}
|
|
@@ -825,11 +794,11 @@ class AccordionComponent {
|
|
|
825
794
|
}
|
|
826
795
|
}
|
|
827
796
|
closeAll() {
|
|
828
|
-
this.cards.forEach(card => card.collapse());
|
|
797
|
+
this.cards().forEach(card => card.collapse());
|
|
829
798
|
}
|
|
830
799
|
openAll() {
|
|
831
800
|
if (!this.shouldCloseOthers()) {
|
|
832
|
-
this.cards.forEach(card => card.expand());
|
|
801
|
+
this.cards().forEach(card => card.expand());
|
|
833
802
|
}
|
|
834
803
|
}
|
|
835
804
|
onCardToggle(panelId, isCollapsed) {
|
|
@@ -844,35 +813,22 @@ class AccordionComponent {
|
|
|
844
813
|
}
|
|
845
814
|
}
|
|
846
815
|
closeAllExcept(exceptId) {
|
|
847
|
-
this.cards.forEach(card => {
|
|
848
|
-
if (card.collapseId !== exceptId) {
|
|
816
|
+
this.cards().forEach(card => {
|
|
817
|
+
if (card.collapseId() !== exceptId) {
|
|
849
818
|
card.collapse();
|
|
850
819
|
}
|
|
851
820
|
});
|
|
852
821
|
}
|
|
853
822
|
shouldCloseOthers() {
|
|
854
|
-
return this.closeOthers && !this.allowMultiple;
|
|
823
|
+
return this.closeOthers() && !this.allowMultiple();
|
|
855
824
|
}
|
|
856
825
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.19", ngImport: i0, type: AccordionComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
857
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "
|
|
826
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "20.3.19", type: AccordionComponent, isStandalone: true, selector: "cw-accordion", inputs: { closeOthers: { classPropertyName: "closeOthers", publicName: "closeOthers", isSignal: true, isRequired: false, transformFunction: null }, allowMultiple: { classPropertyName: "allowMultiple", publicName: "allowMultiple", isSignal: true, isRequired: false, transformFunction: null }, destroyOnHide: { classPropertyName: "destroyOnHide", publicName: "destroyOnHide", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { panelOpened: "panelOpened", panelClosed: "panelClosed" }, queries: [{ propertyName: "cards", predicate: CardComponent, isSignal: true }], ngImport: i0, template: "<div class=\"accordion\">\r\n <ng-content></ng-content>\r\n</div>\r\n", dependencies: [{ kind: "ngmodule", type: CommonModule }] }); }
|
|
858
827
|
}
|
|
859
828
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.19", ngImport: i0, type: AccordionComponent, decorators: [{
|
|
860
829
|
type: Component,
|
|
861
830
|
args: [{ selector: 'cw-accordion', standalone: true, imports: [CommonModule], template: "<div class=\"accordion\">\r\n <ng-content></ng-content>\r\n</div>\r\n" }]
|
|
862
|
-
}], propDecorators: { closeOthers: [{
|
|
863
|
-
type: Input
|
|
864
|
-
}], allowMultiple: [{
|
|
865
|
-
type: Input
|
|
866
|
-
}], destroyOnHide: [{
|
|
867
|
-
type: Input
|
|
868
|
-
}], panelOpened: [{
|
|
869
|
-
type: Output
|
|
870
|
-
}], panelClosed: [{
|
|
871
|
-
type: Output
|
|
872
|
-
}], cards: [{
|
|
873
|
-
type: ContentChildren,
|
|
874
|
-
args: [CardComponent]
|
|
875
|
-
}] } });
|
|
831
|
+
}], propDecorators: { closeOthers: [{ type: i0.Input, args: [{ isSignal: true, alias: "closeOthers", required: false }] }], allowMultiple: [{ type: i0.Input, args: [{ isSignal: true, alias: "allowMultiple", required: false }] }], destroyOnHide: [{ type: i0.Input, args: [{ isSignal: true, alias: "destroyOnHide", required: false }] }], panelOpened: [{ type: i0.Output, args: ["panelOpened"] }], panelClosed: [{ type: i0.Output, args: ["panelClosed"] }], cards: [{ type: i0.ContentChildren, args: [i0.forwardRef(() => CardComponent), { isSignal: true }] }] } });
|
|
876
832
|
|
|
877
833
|
var AlertTypeEnum;
|
|
878
834
|
(function (AlertTypeEnum) {
|
|
@@ -899,14 +855,14 @@ var IconNotifTypeEnum;
|
|
|
899
855
|
|
|
900
856
|
class IconNotificationComponent {
|
|
901
857
|
constructor() {
|
|
902
|
-
this.type = IconNotifTypeEnum.info;
|
|
903
|
-
this.iconSize = IconNotifSizeEnum['md'];
|
|
858
|
+
this.type = input(IconNotifTypeEnum.info, ...(ngDevMode ? [{ debugName: "type" }] : []));
|
|
859
|
+
this.iconSize = input(IconNotifSizeEnum['md'], ...(ngDevMode ? [{ debugName: "iconSize" }] : []));
|
|
904
860
|
}
|
|
905
861
|
get hostClasses() {
|
|
906
|
-
return 'icon-rounded icon-rounded-' + this.iconSize + ' icon-notification-' + this.type;
|
|
862
|
+
return 'icon-rounded icon-rounded-' + this.iconSize() + ' icon-notification-' + this.type();
|
|
907
863
|
}
|
|
908
864
|
ngOnInit() {
|
|
909
|
-
switch (this.type) {
|
|
865
|
+
switch (this.type()) {
|
|
910
866
|
case IconNotifTypeEnum.info:
|
|
911
867
|
this.icon = SpriteIconEnum.alertHelp;
|
|
912
868
|
this.label = 'Informatiion';
|
|
@@ -930,38 +886,37 @@ class IconNotificationComponent {
|
|
|
930
886
|
}
|
|
931
887
|
}
|
|
932
888
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.19", ngImport: i0, type: IconNotificationComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
933
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "
|
|
889
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "20.3.19", type: IconNotificationComponent, isStandalone: true, selector: "cw-icon-notification", inputs: { type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: false, transformFunction: null }, iconSize: { classPropertyName: "iconSize", publicName: "iconSize", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "this.hostClasses" } }, ngImport: i0, template: "\r\n<span class=\"icon\">\r\n <cw-icon [label]=\"label\" [iconSize]=\"iconSize()['2xs']\" [icon]=\"icon\"></cw-icon>\r\n</span>\r\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "component", type: IconComponent, selector: "cw-icon", inputs: ["icon", "label", "type", "iconSize", "iconCssClass", "iconUiType", "iconColorCustom", "spritePath"] }] }); }
|
|
934
890
|
}
|
|
935
891
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.19", ngImport: i0, type: IconNotificationComponent, decorators: [{
|
|
936
892
|
type: Component,
|
|
937
893
|
args: [{ selector: 'cw-icon-notification', standalone: true, imports: [
|
|
938
894
|
CommonModule,
|
|
939
895
|
IconComponent
|
|
940
|
-
], template: "\r\n<span class=\"icon\">\r\n <cw-icon [label]=\"label\" [iconSize]=\"iconSize['2xs']\" [icon]=\"icon\"></cw-icon>\r\n</span>\r\n" }]
|
|
941
|
-
}],
|
|
942
|
-
type: Input
|
|
943
|
-
}], iconSize: [{
|
|
944
|
-
type: Input
|
|
945
|
-
}], hostClasses: [{
|
|
896
|
+
], template: "\r\n<span class=\"icon\">\r\n <cw-icon [label]=\"label\" [iconSize]=\"iconSize()['2xs']\" [icon]=\"icon\"></cw-icon>\r\n</span>\r\n" }]
|
|
897
|
+
}], propDecorators: { type: [{ type: i0.Input, args: [{ isSignal: true, alias: "type", required: false }] }], iconSize: [{ type: i0.Input, args: [{ isSignal: true, alias: "iconSize", required: false }] }], hostClasses: [{
|
|
946
898
|
type: HostBinding,
|
|
947
899
|
args: ['class']
|
|
948
900
|
}] } });
|
|
949
901
|
|
|
950
902
|
class AlertComponent {
|
|
951
|
-
constructor(
|
|
952
|
-
this.cdRef =
|
|
953
|
-
this.type = AlertTypeEnum.info;
|
|
954
|
-
this.
|
|
955
|
-
this.
|
|
956
|
-
this.
|
|
903
|
+
constructor() {
|
|
904
|
+
this.cdRef = inject(ChangeDetectorRef);
|
|
905
|
+
this.type = input(AlertTypeEnum.info, ...(ngDevMode ? [{ debugName: "type" }] : []));
|
|
906
|
+
this.title = input(...(ngDevMode ? [undefined, { debugName: "title" }] : []));
|
|
907
|
+
this.isDismissible = input(false, ...(ngDevMode ? [{ debugName: "isDismissible" }] : []));
|
|
908
|
+
this.cssClass = input('', ...(ngDevMode ? [{ debugName: "cssClass" }] : []));
|
|
909
|
+
this.dataTest = input(...(ngDevMode ? [undefined, { debugName: "dataTest" }] : []));
|
|
910
|
+
this.close = output();
|
|
911
|
+
this.alertContent = viewChild('alertContent', ...(ngDevMode ? [{ debugName: "alertContent" }] : []));
|
|
957
912
|
this.isVisible = true;
|
|
958
913
|
this.showContent = true;
|
|
959
914
|
this.iconSize = IconSizeEnum;
|
|
960
915
|
this.spriteIcon = SpriteIconEnum;
|
|
961
916
|
}
|
|
962
917
|
ngOnInit() {
|
|
963
|
-
this.
|
|
964
|
-
switch (this.type) {
|
|
918
|
+
this.resolvedDataTest = this.dataTest() ? this.dataTest() : 'alert' + this.type();
|
|
919
|
+
switch (this.type()) {
|
|
965
920
|
case AlertTypeEnum.info:
|
|
966
921
|
this.icon = "cw-alert-info2";
|
|
967
922
|
this.iconNotifType = IconNotifTypeEnum.info;
|
|
@@ -985,15 +940,16 @@ class AlertComponent {
|
|
|
985
940
|
}
|
|
986
941
|
}
|
|
987
942
|
ngAfterViewInit() {
|
|
988
|
-
|
|
943
|
+
const el = this.alertContent()?.nativeElement;
|
|
944
|
+
this.showContent = !!el && el.children.length > 0;
|
|
989
945
|
this.cdRef.detectChanges();
|
|
990
946
|
}
|
|
991
947
|
closeAlert() {
|
|
992
948
|
this.isVisible = false;
|
|
993
|
-
this.close.emit();
|
|
949
|
+
this.close.emit(true);
|
|
994
950
|
}
|
|
995
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.19", ngImport: i0, type: AlertComponent, deps: [
|
|
996
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.19", type: AlertComponent, isStandalone: true, selector: "cw-alert", inputs: { type: "type", title: "title", isDismissible: "isDismissible", cssClass: "cssClass", dataTest: "dataTest" }, outputs: { close: "close" }, viewQueries: [{ propertyName: "alertContent", first: true, predicate: ["alertContent"], descendants: true }], ngImport: i0, template: "@if (isVisible) {\
|
|
951
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.19", ngImport: i0, type: AlertComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
952
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.19", type: AlertComponent, isStandalone: true, selector: "cw-alert", inputs: { type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: false, transformFunction: null }, title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: false, transformFunction: null }, isDismissible: { classPropertyName: "isDismissible", publicName: "isDismissible", isSignal: true, isRequired: false, transformFunction: null }, cssClass: { classPropertyName: "cssClass", publicName: "cssClass", isSignal: true, isRequired: false, transformFunction: null }, dataTest: { classPropertyName: "dataTest", publicName: "dataTest", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { close: "close" }, viewQueries: [{ propertyName: "alertContent", first: true, predicate: ["alertContent"], descendants: true, isSignal: true }], ngImport: i0, template: "@if (isVisible) {\n <div [class]=\"'alert alert-' + type() + ' '+ cssClass()\" [ngClass]=\"{ 'alert-dismissible fade show': isDismissible() }\"\n [attr.data-test-ctw]=\"resolvedDataTest\">\n <cw-icon-notification [type]=\"iconNotifType\"></cw-icon-notification>\n <div class=\"alert-content\">\n @if (title()) {\n <div class=\"fw-bold\">{{ title() }}</div>\n }\n\n @if (showContent) {\n <p class=\"mb-none\" #alertContent>\n <ng-content></ng-content>\n </p>\n }\n </div>\n @if (isDismissible()) {\n <button type=\"button\" class=\"btn-close\" (click)=\"closeAlert()\"\n [attr.aria-label]=\"'_COMMON._ACTION.CLOSE' | translate\"\n [attr.data-test-ctw]=\"'close-' + resolvedDataTest\">\n <cw-icon [label]=\"'_COMMON._ACTION.CLOSE' | translate\" [iconSize]=\"iconSize['2xs']\" [icon]=\"spriteIcon.toolbarClose\"></cw-icon>\n </button>\n }\n </div>\n}\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "ngmodule", type: TranslateModule }, { kind: "component", type: IconNotificationComponent, selector: "cw-icon-notification", inputs: ["type", "iconSize"] }, { kind: "component", type: IconComponent, selector: "cw-icon", inputs: ["icon", "label", "type", "iconSize", "iconCssClass", "iconUiType", "iconColorCustom", "spritePath"] }, { kind: "pipe", type: i2.TranslatePipe, name: "translate" }] }); }
|
|
997
953
|
}
|
|
998
954
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.19", ngImport: i0, type: AlertComponent, decorators: [{
|
|
999
955
|
type: Component,
|
|
@@ -1002,23 +958,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.19", ngImpo
|
|
|
1002
958
|
TranslateModule,
|
|
1003
959
|
IconNotificationComponent,
|
|
1004
960
|
IconComponent
|
|
1005
|
-
], template: "@if (isVisible) {\
|
|
1006
|
-
}],
|
|
1007
|
-
type: Input
|
|
1008
|
-
}], title: [{
|
|
1009
|
-
type: Input
|
|
1010
|
-
}], isDismissible: [{
|
|
1011
|
-
type: Input
|
|
1012
|
-
}], cssClass: [{
|
|
1013
|
-
type: Input
|
|
1014
|
-
}], dataTest: [{
|
|
1015
|
-
type: Input
|
|
1016
|
-
}], close: [{
|
|
1017
|
-
type: Output
|
|
1018
|
-
}], alertContent: [{
|
|
1019
|
-
type: ViewChild,
|
|
1020
|
-
args: ['alertContent']
|
|
1021
|
-
}] } });
|
|
961
|
+
], template: "@if (isVisible) {\n <div [class]=\"'alert alert-' + type() + ' '+ cssClass()\" [ngClass]=\"{ 'alert-dismissible fade show': isDismissible() }\"\n [attr.data-test-ctw]=\"resolvedDataTest\">\n <cw-icon-notification [type]=\"iconNotifType\"></cw-icon-notification>\n <div class=\"alert-content\">\n @if (title()) {\n <div class=\"fw-bold\">{{ title() }}</div>\n }\n\n @if (showContent) {\n <p class=\"mb-none\" #alertContent>\n <ng-content></ng-content>\n </p>\n }\n </div>\n @if (isDismissible()) {\n <button type=\"button\" class=\"btn-close\" (click)=\"closeAlert()\"\n [attr.aria-label]=\"'_COMMON._ACTION.CLOSE' | translate\"\n [attr.data-test-ctw]=\"'close-' + resolvedDataTest\">\n <cw-icon [label]=\"'_COMMON._ACTION.CLOSE' | translate\" [iconSize]=\"iconSize['2xs']\" [icon]=\"spriteIcon.toolbarClose\"></cw-icon>\n </button>\n }\n </div>\n}\n" }]
|
|
962
|
+
}], propDecorators: { type: [{ type: i0.Input, args: [{ isSignal: true, alias: "type", required: false }] }], title: [{ type: i0.Input, args: [{ isSignal: true, alias: "title", required: false }] }], isDismissible: [{ type: i0.Input, args: [{ isSignal: true, alias: "isDismissible", required: false }] }], cssClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "cssClass", required: false }] }], dataTest: [{ type: i0.Input, args: [{ isSignal: true, alias: "dataTest", required: false }] }], close: [{ type: i0.Output, args: ["close"] }], alertContent: [{ type: i0.ViewChild, args: ['alertContent', { isSignal: true }] }] } });
|
|
1022
963
|
|
|
1023
964
|
class FocusTrackerService {
|
|
1024
965
|
constructor() {
|
|
@@ -1048,11 +989,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.19", ngImpo
|
|
|
1048
989
|
}]
|
|
1049
990
|
}], ctorParameters: () => [] });
|
|
1050
991
|
|
|
992
|
+
const AUTOHIDE_DELAY_MS = 5000;
|
|
1051
993
|
class ToastService {
|
|
1052
994
|
constructor() {
|
|
1053
995
|
this.focusService = inject(FocusTrackerService);
|
|
1054
|
-
this.
|
|
996
|
+
this.zone = inject(NgZone);
|
|
997
|
+
this.toasts = signal([], ...(ngDevMode ? [{ debugName: "toasts" }] : []));
|
|
1055
998
|
this.autohideTimers = new Map();
|
|
999
|
+
this.triggeringElements = new Map();
|
|
1056
1000
|
}
|
|
1057
1001
|
show(options) {
|
|
1058
1002
|
if (!this.canShowMessage(options.message)) {
|
|
@@ -1066,38 +1010,41 @@ class ToastService {
|
|
|
1066
1010
|
autohide: options.autohide ?? false,
|
|
1067
1011
|
action: options.action,
|
|
1068
1012
|
};
|
|
1069
|
-
this.toasts.
|
|
1070
|
-
this.
|
|
1071
|
-
// Gestion du autohide
|
|
1013
|
+
this.toasts.update(arr => [...arr, toast]);
|
|
1014
|
+
this.triggeringElements.set(toast.id, this.focusService.getFocusedElement());
|
|
1072
1015
|
if (toast.autohide) {
|
|
1073
|
-
const toastId = toast.id;
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1016
|
+
const toastId = toast.id;
|
|
1017
|
+
// Force le timer à tourner DANS la zone Angular pour garantir un tick CD,
|
|
1018
|
+
// au cas où show() serait appelé depuis du code qui a runOutsideAngular.
|
|
1019
|
+
this.zone.run(() => {
|
|
1020
|
+
const timer = setTimeout(() => this.removeById(toastId), AUTOHIDE_DELAY_MS);
|
|
1021
|
+
this.autohideTimers.set(toastId, timer);
|
|
1022
|
+
});
|
|
1078
1023
|
}
|
|
1079
1024
|
}
|
|
1080
1025
|
remove(toast) {
|
|
1081
|
-
this.removeById(toast.id);
|
|
1026
|
+
this.removeById(toast.id, { restoreFocus: true });
|
|
1082
1027
|
}
|
|
1083
|
-
removeById(toastId) {
|
|
1084
|
-
// Nettoyer le timer s'il existe
|
|
1028
|
+
removeById(toastId, opts = {}) {
|
|
1085
1029
|
const timer = this.autohideTimers.get(toastId);
|
|
1086
1030
|
if (timer) {
|
|
1087
1031
|
clearTimeout(timer);
|
|
1088
1032
|
this.autohideTimers.delete(toastId);
|
|
1089
1033
|
}
|
|
1090
|
-
this.toasts
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1034
|
+
this.toasts.update(arr => arr.filter(t => t.id !== toastId));
|
|
1035
|
+
const triggeringElement = this.triggeringElements.get(toastId);
|
|
1036
|
+
this.triggeringElements.delete(toastId);
|
|
1037
|
+
// Ne restaurer le focus que si c'était une action manuelle (clic sur la croix),
|
|
1038
|
+
// pas sur autohide — sinon le focus de l'utilisateur saute toutes les 5s.
|
|
1039
|
+
if (opts.restoreFocus) {
|
|
1040
|
+
triggeringElement?.focus();
|
|
1094
1041
|
}
|
|
1095
1042
|
}
|
|
1096
1043
|
clear() {
|
|
1097
|
-
// Nettoyer tous les timers
|
|
1098
1044
|
this.autohideTimers.forEach(timer => clearTimeout(timer));
|
|
1099
1045
|
this.autohideTimers.clear();
|
|
1100
|
-
this.
|
|
1046
|
+
this.triggeringElements.clear();
|
|
1047
|
+
this.toasts.set([]);
|
|
1101
1048
|
}
|
|
1102
1049
|
canShowMessage(message) {
|
|
1103
1050
|
if (!this.lastToast) {
|
|
@@ -1127,8 +1074,8 @@ class ToastComponent {
|
|
|
1127
1074
|
constructor() {
|
|
1128
1075
|
this.toastService = inject(ToastService);
|
|
1129
1076
|
this.elRef = inject(ElementRef);
|
|
1130
|
-
this.action =
|
|
1131
|
-
this.closed =
|
|
1077
|
+
this.action = output();
|
|
1078
|
+
this.closed = output();
|
|
1132
1079
|
}
|
|
1133
1080
|
ngAfterViewInit() {
|
|
1134
1081
|
const elemPosition = this.elRef.nativeElement.getBoundingClientRect();
|
|
@@ -1151,19 +1098,15 @@ class ToastComponent {
|
|
|
1151
1098
|
this.closed.emit();
|
|
1152
1099
|
}
|
|
1153
1100
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.19", ngImport: i0, type: ToastComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1154
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.19", type: ToastComponent, isStandalone: true, selector: "cw-toast", outputs: { action: "action", closed: "closed" }, host: { attributes: { "role": "alert" }, properties: { "class.toast": "true" } }, ngImport: i0, template: "@for (toast of toastService.toasts; track toast.id) {\r\n <cw-alert [type]=\"toast.type\" [isDismissible]=\"true\" [title]=\"toast.title\" (close)=\"toastService.remove(toast)\" [dataTest]=\"'toast-'+ toast.type\">\r\n <span [innerHTML]=\"toast.message\"></span> \r\n @if (toast.action) {\r\n <a href=\"javascript:void(0);\" (click)=\"onAction(toast)\" class=\"alert-link\">{{ toast.action.label }}</a>\r\n }\r\n </cw-alert>\r\n}\r\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "component", type: AlertComponent, selector: "cw-alert", inputs: ["type", "title", "isDismissible", "cssClass", "dataTest"], outputs: ["close"] }] }); }
|
|
1101
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.19", type: ToastComponent, isStandalone: true, selector: "cw-toast", outputs: { action: "action", closed: "closed" }, host: { attributes: { "role": "alert" }, properties: { "class.toast": "true" } }, ngImport: i0, template: "@for (toast of toastService.toasts(); track toast.id) {\r\n <cw-alert [type]=\"toast.type\" [isDismissible]=\"true\" [title]=\"toast.title\" (close)=\"toastService.remove(toast)\" [dataTest]=\"'toast-'+ toast.type\">\r\n <span [innerHTML]=\"toast.message\"></span> \r\n @if (toast.action) {\r\n <a href=\"javascript:void(0);\" (click)=\"onAction(toast)\" class=\"alert-link\">{{ toast.action.label }}</a>\r\n }\r\n </cw-alert>\r\n}\r\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "component", type: AlertComponent, selector: "cw-alert", inputs: ["type", "title", "isDismissible", "cssClass", "dataTest"], outputs: ["close"] }] }); }
|
|
1155
1102
|
}
|
|
1156
1103
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.19", ngImport: i0, type: ToastComponent, decorators: [{
|
|
1157
1104
|
type: Component,
|
|
1158
1105
|
args: [{ selector: 'cw-toast', standalone: true, imports: [
|
|
1159
1106
|
CommonModule,
|
|
1160
1107
|
AlertComponent
|
|
1161
|
-
], host: { '[class.toast]': 'true', role: 'alert' }, template: "@for (toast of toastService.toasts; track toast.id) {\r\n <cw-alert [type]=\"toast.type\" [isDismissible]=\"true\" [title]=\"toast.title\" (close)=\"toastService.remove(toast)\" [dataTest]=\"'toast-'+ toast.type\">\r\n <span [innerHTML]=\"toast.message\"></span> \r\n @if (toast.action) {\r\n <a href=\"javascript:void(0);\" (click)=\"onAction(toast)\" class=\"alert-link\">{{ toast.action.label }}</a>\r\n }\r\n </cw-alert>\r\n}\r\n" }]
|
|
1162
|
-
}], propDecorators: { action: [{
|
|
1163
|
-
type: Output
|
|
1164
|
-
}], closed: [{
|
|
1165
|
-
type: Output
|
|
1166
|
-
}] } });
|
|
1108
|
+
], host: { '[class.toast]': 'true', role: 'alert' }, template: "@for (toast of toastService.toasts(); track toast.id) {\r\n <cw-alert [type]=\"toast.type\" [isDismissible]=\"true\" [title]=\"toast.title\" (close)=\"toastService.remove(toast)\" [dataTest]=\"'toast-'+ toast.type\">\r\n <span [innerHTML]=\"toast.message\"></span> \r\n @if (toast.action) {\r\n <a href=\"javascript:void(0);\" (click)=\"onAction(toast)\" class=\"alert-link\">{{ toast.action.label }}</a>\r\n }\r\n </cw-alert>\r\n}\r\n" }]
|
|
1109
|
+
}], propDecorators: { action: [{ type: i0.Output, args: ["action"] }], closed: [{ type: i0.Output, args: ["closed"] }] } });
|
|
1167
1110
|
|
|
1168
1111
|
var BadgeTypeEnum;
|
|
1169
1112
|
(function (BadgeTypeEnum) {
|
|
@@ -1191,37 +1134,27 @@ var BadgePositionEnum;
|
|
|
1191
1134
|
})(BadgePositionEnum || (BadgePositionEnum = {}));
|
|
1192
1135
|
|
|
1193
1136
|
class BadgeComponent {
|
|
1194
|
-
get hostClasses() {
|
|
1195
|
-
return this.skeletonMode ? 'skeleton badge' : '';
|
|
1196
|
-
}
|
|
1197
1137
|
constructor() {
|
|
1198
1138
|
this.badgePositionEnum = BadgePositionEnum;
|
|
1199
|
-
this.
|
|
1200
|
-
this.
|
|
1201
|
-
this.
|
|
1139
|
+
this.type = input.required(...(ngDevMode ? [{ debugName: "type" }] : []));
|
|
1140
|
+
this.label = input(...(ngDevMode ? [undefined, { debugName: "label" }] : []));
|
|
1141
|
+
this.withIcon = input(...(ngDevMode ? [undefined, { debugName: "withIcon" }] : []));
|
|
1142
|
+
this.iconPosition = input(BadgePositionEnum.left, ...(ngDevMode ? [{ debugName: "iconPosition" }] : []));
|
|
1143
|
+
this.cssClass = input('', ...(ngDevMode ? [{ debugName: "cssClass" }] : []));
|
|
1144
|
+
this.skeletonMode = input(false, ...(ngDevMode ? [{ debugName: "skeletonMode" }] : []));
|
|
1145
|
+
this.dataTest = input(...(ngDevMode ? [undefined, { debugName: "dataTest" }] : []));
|
|
1202
1146
|
this.iconSizeEnum = IconSizeEnum;
|
|
1203
1147
|
}
|
|
1148
|
+
get hostClasses() {
|
|
1149
|
+
return this.skeletonMode() ? 'skeleton badge' : '';
|
|
1150
|
+
}
|
|
1204
1151
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.19", ngImport: i0, type: BadgeComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1205
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.19", type: BadgeComponent, isStandalone: true, selector: "cw-badge", inputs: { type: "type", label: "label", withIcon: "withIcon", iconPosition: "iconPosition", cssClass: "cssClass", skeletonMode: "skeletonMode", dataTest: "dataTest" }, host: { properties: { "class": "this.hostClasses" } }, ngImport: i0, template: "<div [class]=\"'badge badge-' + type + ' '+ cssClass\" [attr.data-test-ctw]=\"dataTest ? dataTest : null\">\
|
|
1152
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.19", type: BadgeComponent, isStandalone: true, selector: "cw-badge", inputs: { type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: true, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, withIcon: { classPropertyName: "withIcon", publicName: "withIcon", isSignal: true, isRequired: false, transformFunction: null }, iconPosition: { classPropertyName: "iconPosition", publicName: "iconPosition", isSignal: true, isRequired: false, transformFunction: null }, cssClass: { classPropertyName: "cssClass", publicName: "cssClass", isSignal: true, isRequired: false, transformFunction: null }, skeletonMode: { classPropertyName: "skeletonMode", publicName: "skeletonMode", isSignal: true, isRequired: false, transformFunction: null }, dataTest: { classPropertyName: "dataTest", publicName: "dataTest", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "this.hostClasses" } }, ngImport: i0, template: "<div [class]=\"'badge badge-' + type() + ' '+ cssClass()\" [attr.data-test-ctw]=\"dataTest() ? dataTest() : null\">\n\n @if (withIcon() && iconPosition() === badgePositionEnum.left) {\n <cw-icon [icon]=\"withIcon()\" [iconSize]=\"iconSizeEnum['2xs']\"></cw-icon>\n }\n\n @if (label()) {\n {{ label() | translate }}\n }\n\n @if (withIcon() && iconPosition() === badgePositionEnum.right) {\n <cw-icon [icon]=\"withIcon()\" [iconSize]=\"iconSizeEnum['2xs']\"></cw-icon>\n }\n</div>\n", dependencies: [{ kind: "component", type: IconComponent, selector: "cw-icon", inputs: ["icon", "label", "type", "iconSize", "iconCssClass", "iconUiType", "iconColorCustom", "spritePath"] }, { kind: "pipe", type: TranslatePipe, name: "translate" }] }); }
|
|
1206
1153
|
}
|
|
1207
1154
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.19", ngImport: i0, type: BadgeComponent, decorators: [{
|
|
1208
1155
|
type: Component,
|
|
1209
|
-
args: [{ selector: 'cw-badge', standalone: true, imports: [IconComponent, TranslatePipe], template: "<div [class]=\"'badge badge-' + type + ' '+ cssClass\" [attr.data-test-ctw]=\"dataTest ? dataTest : null\">\
|
|
1210
|
-
}],
|
|
1211
|
-
type: Input
|
|
1212
|
-
}], label: [{
|
|
1213
|
-
type: Input
|
|
1214
|
-
}], withIcon: [{
|
|
1215
|
-
type: Input
|
|
1216
|
-
}], iconPosition: [{
|
|
1217
|
-
type: Input
|
|
1218
|
-
}], cssClass: [{
|
|
1219
|
-
type: Input
|
|
1220
|
-
}], skeletonMode: [{
|
|
1221
|
-
type: Input
|
|
1222
|
-
}], dataTest: [{
|
|
1223
|
-
type: Input
|
|
1224
|
-
}], hostClasses: [{
|
|
1156
|
+
args: [{ selector: 'cw-badge', standalone: true, imports: [IconComponent, TranslatePipe], template: "<div [class]=\"'badge badge-' + type() + ' '+ cssClass()\" [attr.data-test-ctw]=\"dataTest() ? dataTest() : null\">\n\n @if (withIcon() && iconPosition() === badgePositionEnum.left) {\n <cw-icon [icon]=\"withIcon()\" [iconSize]=\"iconSizeEnum['2xs']\"></cw-icon>\n }\n\n @if (label()) {\n {{ label() | translate }}\n }\n\n @if (withIcon() && iconPosition() === badgePositionEnum.right) {\n <cw-icon [icon]=\"withIcon()\" [iconSize]=\"iconSizeEnum['2xs']\"></cw-icon>\n }\n</div>\n" }]
|
|
1157
|
+
}], propDecorators: { type: [{ type: i0.Input, args: [{ isSignal: true, alias: "type", required: true }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], withIcon: [{ type: i0.Input, args: [{ isSignal: true, alias: "withIcon", required: false }] }], iconPosition: [{ type: i0.Input, args: [{ isSignal: true, alias: "iconPosition", required: false }] }], cssClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "cssClass", required: false }] }], skeletonMode: [{ type: i0.Input, args: [{ isSignal: true, alias: "skeletonMode", required: false }] }], dataTest: [{ type: i0.Input, args: [{ isSignal: true, alias: "dataTest", required: false }] }], hostClasses: [{
|
|
1225
1158
|
type: HostBinding,
|
|
1226
1159
|
args: ['class']
|
|
1227
1160
|
}] } });
|
|
@@ -2055,11 +1988,12 @@ var LegendTypeEnum;
|
|
|
2055
1988
|
|
|
2056
1989
|
class LegendComponent {
|
|
2057
1990
|
constructor() {
|
|
2058
|
-
this.
|
|
1991
|
+
this.legend = input.required(...(ngDevMode ? [{ debugName: "legend" }] : []));
|
|
1992
|
+
this.displayInline = input(false, ...(ngDevMode ? [{ debugName: "displayInline" }] : []));
|
|
2059
1993
|
this.legendTypeEnum = LegendTypeEnum;
|
|
2060
1994
|
}
|
|
2061
1995
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.19", ngImport: i0, type: LegendComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2062
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.19", type: LegendComponent, isStandalone: true, selector: "cw-legend", inputs: { legend: "legend", displayInline: "displayInline" }, ngImport: i0, template: "@if (legend.title) {\
|
|
1996
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.19", type: LegendComponent, isStandalone: true, selector: "cw-legend", inputs: { legend: { classPropertyName: "legend", publicName: "legend", isSignal: true, isRequired: true, transformFunction: null }, displayInline: { classPropertyName: "displayInline", publicName: "displayInline", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "@if (legend().title) {\n <div class=\"legend-title\">\n {{ '_COMMON._TABLE.LEGEND' | translate }}\n </div>\n}\n\n<ul class=\"legend-items\" [class.list-inline]=\"displayInline()\">\n @for (item of legend().data; track $index) {\n <li class=\"legend-item\" [class.list-inline-item]=\"displayInline()\">\n @switch (item.type) {\n @case (legendTypeEnum.icon) {\n <cw-icon [icon]=\"item.icon\" [label]=\"item.label\" [iconCssClass]=\"'text-' + item.colorUi\" [iconColorCustom]=\"item.colorCustom\"></cw-icon>\n }\n @case (legendTypeEnum.badge) {\n <cw-badge [type]=\"item.colorBadge\" [label]=\"item.labelBadge\"></cw-badge>\n {{item.label}}\n }\n @case (legendTypeEnum.color) {\n <span class=\"legend-item-color\" [ngClass]=\"item.colorUi ?'legend-' + item.colorUi : ''\" [style.background-color]=\"item.colorCustom\"></span>\n {{item.label}}\n }\n }\n </li>\n }\n</ul>\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "component", type: IconComponent, selector: "cw-icon", inputs: ["icon", "label", "type", "iconSize", "iconCssClass", "iconUiType", "iconColorCustom", "spritePath"] }, { kind: "component", type: BadgeComponent, selector: "cw-badge", inputs: ["type", "label", "withIcon", "iconPosition", "cssClass", "skeletonMode", "dataTest"] }, { kind: "ngmodule", type: TranslateModule }, { kind: "pipe", type: i2.TranslatePipe, name: "translate" }] }); }
|
|
2063
1997
|
}
|
|
2064
1998
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.19", ngImport: i0, type: LegendComponent, decorators: [{
|
|
2065
1999
|
type: Component,
|
|
@@ -2068,12 +2002,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.19", ngImpo
|
|
|
2068
2002
|
IconComponent,
|
|
2069
2003
|
BadgeComponent,
|
|
2070
2004
|
TranslateModule
|
|
2071
|
-
], template: "@if (legend.title) {\
|
|
2072
|
-
}],
|
|
2073
|
-
type: Input
|
|
2074
|
-
}], displayInline: [{
|
|
2075
|
-
type: Input
|
|
2076
|
-
}] } });
|
|
2005
|
+
], template: "@if (legend().title) {\n <div class=\"legend-title\">\n {{ '_COMMON._TABLE.LEGEND' | translate }}\n </div>\n}\n\n<ul class=\"legend-items\" [class.list-inline]=\"displayInline()\">\n @for (item of legend().data; track $index) {\n <li class=\"legend-item\" [class.list-inline-item]=\"displayInline()\">\n @switch (item.type) {\n @case (legendTypeEnum.icon) {\n <cw-icon [icon]=\"item.icon\" [label]=\"item.label\" [iconCssClass]=\"'text-' + item.colorUi\" [iconColorCustom]=\"item.colorCustom\"></cw-icon>\n }\n @case (legendTypeEnum.badge) {\n <cw-badge [type]=\"item.colorBadge\" [label]=\"item.labelBadge\"></cw-badge>\n {{item.label}}\n }\n @case (legendTypeEnum.color) {\n <span class=\"legend-item-color\" [ngClass]=\"item.colorUi ?'legend-' + item.colorUi : ''\" [style.background-color]=\"item.colorCustom\"></span>\n {{item.label}}\n }\n }\n </li>\n }\n</ul>\n" }]
|
|
2006
|
+
}], propDecorators: { legend: [{ type: i0.Input, args: [{ isSignal: true, alias: "legend", required: true }] }], displayInline: [{ type: i0.Input, args: [{ isSignal: true, alias: "displayInline", required: false }] }] } });
|
|
2077
2007
|
|
|
2078
2008
|
class LoaderComponent {
|
|
2079
2009
|
constructor() { }
|
|
@@ -2120,48 +2050,43 @@ class ModalsService {
|
|
|
2120
2050
|
* Ouvre une modale et retourne un objet compatible avec l'ancienne syntaxe .result
|
|
2121
2051
|
*/
|
|
2122
2052
|
openModal(type, config, sizeOverride) {
|
|
2123
|
-
// 1. Détermination des propriétés de base
|
|
2124
2053
|
const size = sizeOverride ?? this.getModalSizeByType(type);
|
|
2125
2054
|
const isQuickView = type === ModalsType.quickSideView;
|
|
2126
|
-
// 2. Création dynamique du composant
|
|
2127
2055
|
const componentRef = createComponent(ModalsComponent, {
|
|
2128
2056
|
environmentInjector: this.appRef.injector,
|
|
2129
2057
|
elementInjector: this.injector
|
|
2130
2058
|
});
|
|
2131
|
-
|
|
2132
|
-
componentRef.
|
|
2133
|
-
componentRef.
|
|
2134
|
-
componentRef.
|
|
2135
|
-
componentRef.instance.customClass = isQuickView ? 'quick-view-modal' : '';
|
|
2059
|
+
componentRef.setInput('type', type);
|
|
2060
|
+
componentRef.setInput('size', size);
|
|
2061
|
+
componentRef.setInput('scrollable', isQuickView);
|
|
2062
|
+
componentRef.setInput('customClass', isQuickView ? 'quick-view-modal' : '');
|
|
2136
2063
|
if (config) {
|
|
2137
|
-
Object.
|
|
2064
|
+
for (const [key, value] of Object.entries(config)) {
|
|
2065
|
+
if (value !== undefined) {
|
|
2066
|
+
componentRef.setInput(key, value);
|
|
2067
|
+
}
|
|
2068
|
+
}
|
|
2138
2069
|
}
|
|
2139
|
-
// 4. Gestion de la Promesse (le fameux .result)
|
|
2140
2070
|
const resultPromise = new Promise((resolve, reject) => {
|
|
2141
|
-
// Succès : quand le bouton d'action est cliqué
|
|
2142
2071
|
const subAction = componentRef.instance.btnAction1.subscribe((data) => {
|
|
2143
2072
|
subAction.unsubscribe();
|
|
2144
2073
|
resolve(data || 'confirm');
|
|
2145
2074
|
});
|
|
2146
2075
|
const subAction2 = componentRef.instance.btnAction2.subscribe((data) => {
|
|
2147
|
-
|
|
2076
|
+
subAction2.unsubscribe();
|
|
2148
2077
|
resolve(data || 'confirm');
|
|
2149
2078
|
});
|
|
2150
|
-
// Échec/Fermeture : on intercepte la fermeture via dismissModal
|
|
2151
2079
|
const subDismiss = this.dismissModal.subscribe(() => {
|
|
2152
2080
|
subDismiss.unsubscribe();
|
|
2153
2081
|
reject('closed');
|
|
2154
2082
|
});
|
|
2155
2083
|
});
|
|
2156
|
-
// 5. Intégration au DOM
|
|
2157
2084
|
const domElem = componentRef.hostView.rootNodes[0];
|
|
2158
2085
|
document.body.appendChild(domElem);
|
|
2159
2086
|
this.appRef.attachView(componentRef.hostView);
|
|
2160
2087
|
document.body.classList.add('modal-open');
|
|
2161
|
-
// 6. Gestion de la pile et du focus
|
|
2162
2088
|
this.saveFocus();
|
|
2163
2089
|
this.modalsStack.push(componentRef);
|
|
2164
|
-
// Retourne un objet ModalRef
|
|
2165
2090
|
return {
|
|
2166
2091
|
componentInstance: componentRef.instance,
|
|
2167
2092
|
result: resultPromise
|
|
@@ -2173,17 +2098,13 @@ class ModalsService {
|
|
|
2173
2098
|
closeModal() {
|
|
2174
2099
|
const currentModal = this.modalsStack.pop();
|
|
2175
2100
|
if (currentModal) {
|
|
2176
|
-
const modalClass = currentModal.instance.customClass ?? '';
|
|
2177
|
-
// Retrait du DOM
|
|
2101
|
+
const modalClass = currentModal.instance.customClass() ?? '';
|
|
2178
2102
|
this.appRef.detachView(currentModal.hostView);
|
|
2179
2103
|
currentModal.destroy();
|
|
2180
|
-
// Gestion du body
|
|
2181
2104
|
if (this.modalsStack.length === 0) {
|
|
2182
2105
|
document.body.classList.remove('modal-open');
|
|
2183
2106
|
}
|
|
2184
|
-
// Restauration focus
|
|
2185
2107
|
this.restoreFocus();
|
|
2186
|
-
// On émet l'événement (ce qui déclenchera le reject de la promesse plus haut)
|
|
2187
2108
|
this.dismissModal.emit(modalClass);
|
|
2188
2109
|
}
|
|
2189
2110
|
}
|
|
@@ -2225,14 +2146,21 @@ class ModalsComponent {
|
|
|
2225
2146
|
constructor() {
|
|
2226
2147
|
this.modalService = inject(ModalsService);
|
|
2227
2148
|
this.translateService = inject(TranslateService);
|
|
2228
|
-
this.
|
|
2229
|
-
this.
|
|
2230
|
-
this.
|
|
2231
|
-
this.
|
|
2232
|
-
this.
|
|
2233
|
-
this.
|
|
2234
|
-
this.
|
|
2235
|
-
this.
|
|
2149
|
+
this.modalContainer = viewChild.required('modalContainer');
|
|
2150
|
+
this.size = input(ModalsSize.md, ...(ngDevMode ? [{ debugName: "size" }] : []));
|
|
2151
|
+
this.customClass = input('', ...(ngDevMode ? [{ debugName: "customClass" }] : []));
|
|
2152
|
+
this.scrollable = input(false, ...(ngDevMode ? [{ debugName: "scrollable" }] : []));
|
|
2153
|
+
this.isAutcompModal = input(false, ...(ngDevMode ? [{ debugName: "isAutcompModal" }] : []));
|
|
2154
|
+
this.type = input.required(...(ngDevMode ? [{ debugName: "type" }] : []));
|
|
2155
|
+
this.modalTitle = input(...(ngDevMode ? [undefined, { debugName: "modalTitle" }] : []));
|
|
2156
|
+
this.itemsToDelete = input([], ...(ngDevMode ? [{ debugName: "itemsToDelete" }] : []));
|
|
2157
|
+
this.itemsToDeleteTitle = input(this.translateService.instant('_COMMON._MODAL_DELETE.DEFAULT_TYPE'), ...(ngDevMode ? [{ debugName: "itemsToDeleteTitle" }] : []));
|
|
2158
|
+
this.labelBtnAction1 = input(...(ngDevMode ? [undefined, { debugName: "labelBtnAction1" }] : []));
|
|
2159
|
+
this.labelBtnAction2 = input(...(ngDevMode ? [undefined, { debugName: "labelBtnAction2" }] : []));
|
|
2160
|
+
this.customBodyTemplate = input(...(ngDevMode ? [undefined, { debugName: "customBodyTemplate" }] : []));
|
|
2161
|
+
this.customBodyContext = input(...(ngDevMode ? [undefined, { debugName: "customBodyContext" }] : []));
|
|
2162
|
+
this.btnAction1 = output();
|
|
2163
|
+
this.btnAction2 = output();
|
|
2236
2164
|
this.modalsType = ModalsType;
|
|
2237
2165
|
this.buttonTypeEnum = { ...FoButtonTypeEnum, ...BoButtonTypeEnum };
|
|
2238
2166
|
this.spriteIcon = SpriteIconEnum;
|
|
@@ -2244,10 +2172,10 @@ class ModalsComponent {
|
|
|
2244
2172
|
this.modalService.openedModal.emit(true);
|
|
2245
2173
|
}
|
|
2246
2174
|
ngAfterViewInit() {
|
|
2247
|
-
setTimeout(() => this.trapFocus(this.modalContainer.nativeElement), 0);
|
|
2175
|
+
setTimeout(() => this.trapFocus(this.modalContainer().nativeElement), 0);
|
|
2248
2176
|
}
|
|
2249
2177
|
onKeyDown(e) {
|
|
2250
|
-
if (this.type === this.modalsType.loader) {
|
|
2178
|
+
if (this.type() === this.modalsType.loader) {
|
|
2251
2179
|
e.preventDefault();
|
|
2252
2180
|
return;
|
|
2253
2181
|
}
|
|
@@ -2279,25 +2207,23 @@ class ModalsComponent {
|
|
|
2279
2207
|
return;
|
|
2280
2208
|
const firstFocusableEl = focusableEls[0];
|
|
2281
2209
|
const lastFocusableEl = focusableEls[focusableEls.length - 1];
|
|
2282
|
-
// Logique Autocomplete peut etre à externaliser ou élargir la notion
|
|
2283
2210
|
const autocompleteInput = focusableEls.find(x => x.getAttribute('aria-controls') === 'autocompletion-panel');
|
|
2284
|
-
if (autocompleteInput && this.isAutcompModal) {
|
|
2211
|
+
if (autocompleteInput && this.isAutcompModal()) {
|
|
2285
2212
|
autocompleteInput.focus();
|
|
2286
2213
|
}
|
|
2287
2214
|
else {
|
|
2288
2215
|
firstFocusableEl.focus();
|
|
2289
2216
|
}
|
|
2290
|
-
// Listener pour le Tab (on l'attache au container)
|
|
2291
2217
|
element.addEventListener('keydown', (e) => {
|
|
2292
2218
|
if (e.key !== 'Tab')
|
|
2293
2219
|
return;
|
|
2294
|
-
if (e.shiftKey) {
|
|
2220
|
+
if (e.shiftKey) {
|
|
2295
2221
|
if (document.activeElement === firstFocusableEl) {
|
|
2296
2222
|
lastFocusableEl.focus();
|
|
2297
2223
|
e.preventDefault();
|
|
2298
2224
|
}
|
|
2299
2225
|
}
|
|
2300
|
-
else {
|
|
2226
|
+
else {
|
|
2301
2227
|
if (document.activeElement === lastFocusableEl) {
|
|
2302
2228
|
firstFocusableEl.focus();
|
|
2303
2229
|
e.preventDefault();
|
|
@@ -2306,55 +2232,26 @@ class ModalsComponent {
|
|
|
2306
2232
|
});
|
|
2307
2233
|
}
|
|
2308
2234
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.19", ngImport: i0, type: ModalsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2309
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.19", type: ModalsComponent, isStandalone: true, selector: "cw-modals", inputs: { size: "size", customClass: "customClass", scrollable: "scrollable", isAutcompModal: "isAutcompModal", type: "type", modalTitle: "modalTitle", itemsToDelete: "itemsToDelete", itemsToDeleteTitle: "itemsToDeleteTitle", labelBtnAction1: "labelBtnAction1", labelBtnAction2: "labelBtnAction2", customBodyTemplate: "customBodyTemplate", customBodyContext: "customBodyContext" }, outputs: { btnAction1: "btnAction1", btnAction2: "btnAction2" }, viewQueries: [{ propertyName: "modalContainer", first: true, predicate: ["modalContainer"], descendants: true }], ngImport: i0, template: "<div class=\"cityway-v8 modal-backdrop fade show\" style=\"z-index: 1050;\" aria-hidden=\"true\"></div>\
|
|
2235
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.19", type: ModalsComponent, isStandalone: true, selector: "cw-modals", inputs: { size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, customClass: { classPropertyName: "customClass", publicName: "customClass", isSignal: true, isRequired: false, transformFunction: null }, scrollable: { classPropertyName: "scrollable", publicName: "scrollable", isSignal: true, isRequired: false, transformFunction: null }, isAutcompModal: { classPropertyName: "isAutcompModal", publicName: "isAutcompModal", isSignal: true, isRequired: false, transformFunction: null }, type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: true, transformFunction: null }, modalTitle: { classPropertyName: "modalTitle", publicName: "modalTitle", isSignal: true, isRequired: false, transformFunction: null }, itemsToDelete: { classPropertyName: "itemsToDelete", publicName: "itemsToDelete", isSignal: true, isRequired: false, transformFunction: null }, itemsToDeleteTitle: { classPropertyName: "itemsToDeleteTitle", publicName: "itemsToDeleteTitle", isSignal: true, isRequired: false, transformFunction: null }, labelBtnAction1: { classPropertyName: "labelBtnAction1", publicName: "labelBtnAction1", isSignal: true, isRequired: false, transformFunction: null }, labelBtnAction2: { classPropertyName: "labelBtnAction2", publicName: "labelBtnAction2", isSignal: true, isRequired: false, transformFunction: null }, customBodyTemplate: { classPropertyName: "customBodyTemplate", publicName: "customBodyTemplate", isSignal: true, isRequired: false, transformFunction: null }, customBodyContext: { classPropertyName: "customBodyContext", publicName: "customBodyContext", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { btnAction1: "btnAction1", btnAction2: "btnAction2" }, viewQueries: [{ propertyName: "modalContainer", first: true, predicate: ["modalContainer"], descendants: true, isSignal: true }], ngImport: i0, template: "<div class=\"cityway-v8 modal-backdrop fade show\" style=\"z-index: 1050;\" aria-hidden=\"true\"></div>\n\n<div role=\"dialog\" tabindex=\"-1\" aria-modal=\"true\" aria-labelledby=\"modal-basic-title\"\n class=\"cityway-v8 d-flex modal show\" [ngClass]=\"customClass()\" data-test-ctw=\"modal\" (keydown)=\"onKeyDown($event)\">\n\n <div class=\"modal-inner-backdrop\" (click)=\"type() !== modalsType.loader && closeModal()\"></div>\n\n <div #modalContainer role=\"document\" class=\"modal-dialog modal-dialog-centered\"\n [ngClass]=\"['modal-' + size(), scrollable() ? 'modal-dialog-scrollable' : '']\">\n\n <div class=\"modal-content\">\n\n @if (type() !== modalsType.loader) {\n @if (type() == modalsType.delete || type() == modalsType.quickSideView || type() == modalsType.custom) {\n <div class=\"modal-header\">\n @if (type() === modalsType.delete) {\n <h1 class=\"modal-title\" id=\"modal-basic-title\">\n {{ '_COMMON._MODAL_DELETE.TITLE' | translate: { number: itemsToDelete().length, name: itemsToDeleteTitle() | translate } }}\n </h1>\n }\n @else {\n <h1 class=\"modal-title\" id=\"modal-basic-title\">\n {{ modalTitle() | translate }}\n </h1>\n }\n\n <cw-button [label]=\"'_COMMON._ACTION.CLOSE' | translate\" [type]=\"buttonTypeEnum.light\" [withOnlyIcon]=\"true\"\n [withIcon]=\"spriteIcon.toolbarClose\" (btnAction)=\"closeModal()\" dataTest=\"btn-close-modal\"\n cssClass=\"btn-close\">\n </cw-button>\n </div>\n\n <div class=\"modal-body\">\n @if (type() === modalsType.delete) {\n @if (itemsToDelete().length === 1) {\n <div [innerHTML]=\"'_COMMON._MODAL_DELETE.SIMPLE_TEXT' | translate\"></div>\n }\n @if (itemsToDelete().length > 1) {\n <div [innerHTML]=\"'_COMMON._MODAL_DELETE.MULTIPLE_TEXT' | translate\"></div>\n }\n @if (itemsToDelete().length > 0) {\n <ul class=\"mb-none\">\n @for (item of itemsToDelete(); track item) {\n <li>{{ item }}</li>\n }\n </ul>\n }\n }\n @else {\n @if (customBodyTemplate()) {\n <ng-container [ngTemplateOutlet]=\"customBodyTemplate()\" [ngTemplateOutletContext]=\"customBodyContext()\">\n </ng-container>\n }\n }\n </div>\n }\n @else {\n <div class=\"modal-header justify-content-end\">\n <cw-button [label]=\"'_COMMON._ACTION.CLOSE' | translate\" [type]=\"buttonTypeEnum.light\" [withOnlyIcon]=\"true\"\n [withIcon]=\"spriteIcon.toolbarClose\" (btnAction)=\"closeModal()\" dataTest=\"btn-close-modal\"\n cssClass=\"btn-close\">\n </cw-button>\n </div>\n <div class=\"modal-body\">\n <cw-icon [label]=\"'Sucess'\" [iconSize]=\"iconSize['5xl']\" [icon]=\"spriteIcon.toolbarClose\" [type]=\"iconType.rounded\" [iconUiType]=\"iconUiType.success\"></cw-icon>\n\n <h1 class=\"modal-title\" id=\"modal-basic-title\">\n {{ modalTitle() | translate }}\n </h1>\n\n @if (customBodyTemplate()) {\n <ng-container [ngTemplateOutlet]=\"customBodyTemplate()\" [ngTemplateOutletContext]=\"customBodyContext()\">\n </ng-container>\n }\n </div>\n }\n\n <div class=\"modal-footer\">\n @if (type() === modalsType.delete) {\n <cw-button label=\"_COMMON._ACTION.DELETE\" [type]=\"buttonTypeEnum.danger\" [isMinWidth]=\"true\"\n (btnAction)=\"action1Click()\" dataTest=\"btn-action-modal\">\n </cw-button>\n\n <cw-button label=\"_COMMON._ACTION.CLOSE\" [type]=\"buttonTypeEnum.secondary\" [isMinWidth]=\"true\"\n (btnAction)=\"closeModal()\" dataTest=\"btn-close-modal\">\n </cw-button>\n }\n @else {\n @if (labelBtnAction1()) {\n <cw-button [label]=\"labelBtnAction1()\" [type]=\"buttonTypeEnum.primary\" [isMinWidth]=\"true\"\n (btnAction)=\"action1Click()\" dataTest=\"btn-action-modal\">\n </cw-button>\n }\n @if (labelBtnAction2()) {\n <cw-button [label]=\"labelBtnAction2()\" [type]=\"buttonTypeEnum.secondary\" [isMinWidth]=\"true\"\n (btnAction)=\"action2Click()\" dataTest=\"btn-action-modal\">\n </cw-button>\n }\n @else {\n <cw-button label=\"_COMMON._ACTION.CLOSE\" [type]=\"buttonTypeEnum.secondary\" [isMinWidth]=\"true\"\n (btnAction)=\"closeModal()\" dataTest=\"btn-close-modal\">\n </cw-button>\n }\n }\n </div>\n }\n @else {\n <div class=\"modal-body\">\n <cw-loader></cw-loader>\n </div>\n }\n\n </div>\n </div>\n</div>\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: "ngmodule", type: TranslateModule }, { kind: "component", type: ButtonComponent, selector: "cw-button", inputs: ["type", "label", "id", "isDropdown", "withIcon", "withOnlyIcon", "iconSize", "iconPosition", "dropdownPosition", "isMinWidth", "isDisabled", "isLoading", "cssClass", "dataTest", "skeletonMode", "withTooltip", "tooltipText", "tooltipTitle", "tooltipTrigger", "tooltipPosition", "tooltipType"], outputs: ["btnAction", "dropDownClicked"] }, { kind: "component", type: LoaderComponent, selector: "cw-loader" }, { kind: "component", type: IconComponent, selector: "cw-icon", inputs: ["icon", "label", "type", "iconSize", "iconCssClass", "iconUiType", "iconColorCustom", "spritePath"] }, { kind: "pipe", type: i2.TranslatePipe, name: "translate" }] }); }
|
|
2310
2236
|
}
|
|
2311
2237
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.19", ngImport: i0, type: ModalsComponent, decorators: [{
|
|
2312
2238
|
type: Component,
|
|
2313
|
-
args: [{ selector: 'cw-modals', standalone: true, 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>\
|
|
2314
|
-
}], propDecorators: { modalContainer: [{
|
|
2315
|
-
type: ViewChild,
|
|
2316
|
-
args: ['modalContainer']
|
|
2317
|
-
}], size: [{
|
|
2318
|
-
type: Input
|
|
2319
|
-
}], customClass: [{
|
|
2320
|
-
type: Input
|
|
2321
|
-
}], scrollable: [{
|
|
2322
|
-
type: Input
|
|
2323
|
-
}], isAutcompModal: [{
|
|
2324
|
-
type: Input
|
|
2325
|
-
}], type: [{
|
|
2326
|
-
type: Input
|
|
2327
|
-
}], modalTitle: [{
|
|
2328
|
-
type: Input
|
|
2329
|
-
}], itemsToDelete: [{
|
|
2330
|
-
type: Input
|
|
2331
|
-
}], itemsToDeleteTitle: [{
|
|
2332
|
-
type: Input
|
|
2333
|
-
}], labelBtnAction1: [{
|
|
2334
|
-
type: Input
|
|
2335
|
-
}], labelBtnAction2: [{
|
|
2336
|
-
type: Input
|
|
2337
|
-
}], customBodyTemplate: [{
|
|
2338
|
-
type: Input
|
|
2339
|
-
}], customBodyContext: [{
|
|
2340
|
-
type: Input
|
|
2341
|
-
}], btnAction1: [{
|
|
2342
|
-
type: Output
|
|
2343
|
-
}], btnAction2: [{
|
|
2344
|
-
type: Output
|
|
2345
|
-
}] } });
|
|
2239
|
+
args: [{ selector: 'cw-modals', standalone: true, 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>\n\n<div role=\"dialog\" tabindex=\"-1\" aria-modal=\"true\" aria-labelledby=\"modal-basic-title\"\n class=\"cityway-v8 d-flex modal show\" [ngClass]=\"customClass()\" data-test-ctw=\"modal\" (keydown)=\"onKeyDown($event)\">\n\n <div class=\"modal-inner-backdrop\" (click)=\"type() !== modalsType.loader && closeModal()\"></div>\n\n <div #modalContainer role=\"document\" class=\"modal-dialog modal-dialog-centered\"\n [ngClass]=\"['modal-' + size(), scrollable() ? 'modal-dialog-scrollable' : '']\">\n\n <div class=\"modal-content\">\n\n @if (type() !== modalsType.loader) {\n @if (type() == modalsType.delete || type() == modalsType.quickSideView || type() == modalsType.custom) {\n <div class=\"modal-header\">\n @if (type() === modalsType.delete) {\n <h1 class=\"modal-title\" id=\"modal-basic-title\">\n {{ '_COMMON._MODAL_DELETE.TITLE' | translate: { number: itemsToDelete().length, name: itemsToDeleteTitle() | translate } }}\n </h1>\n }\n @else {\n <h1 class=\"modal-title\" id=\"modal-basic-title\">\n {{ modalTitle() | translate }}\n </h1>\n }\n\n <cw-button [label]=\"'_COMMON._ACTION.CLOSE' | translate\" [type]=\"buttonTypeEnum.light\" [withOnlyIcon]=\"true\"\n [withIcon]=\"spriteIcon.toolbarClose\" (btnAction)=\"closeModal()\" dataTest=\"btn-close-modal\"\n cssClass=\"btn-close\">\n </cw-button>\n </div>\n\n <div class=\"modal-body\">\n @if (type() === modalsType.delete) {\n @if (itemsToDelete().length === 1) {\n <div [innerHTML]=\"'_COMMON._MODAL_DELETE.SIMPLE_TEXT' | translate\"></div>\n }\n @if (itemsToDelete().length > 1) {\n <div [innerHTML]=\"'_COMMON._MODAL_DELETE.MULTIPLE_TEXT' | translate\"></div>\n }\n @if (itemsToDelete().length > 0) {\n <ul class=\"mb-none\">\n @for (item of itemsToDelete(); track item) {\n <li>{{ item }}</li>\n }\n </ul>\n }\n }\n @else {\n @if (customBodyTemplate()) {\n <ng-container [ngTemplateOutlet]=\"customBodyTemplate()\" [ngTemplateOutletContext]=\"customBodyContext()\">\n </ng-container>\n }\n }\n </div>\n }\n @else {\n <div class=\"modal-header justify-content-end\">\n <cw-button [label]=\"'_COMMON._ACTION.CLOSE' | translate\" [type]=\"buttonTypeEnum.light\" [withOnlyIcon]=\"true\"\n [withIcon]=\"spriteIcon.toolbarClose\" (btnAction)=\"closeModal()\" dataTest=\"btn-close-modal\"\n cssClass=\"btn-close\">\n </cw-button>\n </div>\n <div class=\"modal-body\">\n <cw-icon [label]=\"'Sucess'\" [iconSize]=\"iconSize['5xl']\" [icon]=\"spriteIcon.toolbarClose\" [type]=\"iconType.rounded\" [iconUiType]=\"iconUiType.success\"></cw-icon>\n\n <h1 class=\"modal-title\" id=\"modal-basic-title\">\n {{ modalTitle() | translate }}\n </h1>\n\n @if (customBodyTemplate()) {\n <ng-container [ngTemplateOutlet]=\"customBodyTemplate()\" [ngTemplateOutletContext]=\"customBodyContext()\">\n </ng-container>\n }\n </div>\n }\n\n <div class=\"modal-footer\">\n @if (type() === modalsType.delete) {\n <cw-button label=\"_COMMON._ACTION.DELETE\" [type]=\"buttonTypeEnum.danger\" [isMinWidth]=\"true\"\n (btnAction)=\"action1Click()\" dataTest=\"btn-action-modal\">\n </cw-button>\n\n <cw-button label=\"_COMMON._ACTION.CLOSE\" [type]=\"buttonTypeEnum.secondary\" [isMinWidth]=\"true\"\n (btnAction)=\"closeModal()\" dataTest=\"btn-close-modal\">\n </cw-button>\n }\n @else {\n @if (labelBtnAction1()) {\n <cw-button [label]=\"labelBtnAction1()\" [type]=\"buttonTypeEnum.primary\" [isMinWidth]=\"true\"\n (btnAction)=\"action1Click()\" dataTest=\"btn-action-modal\">\n </cw-button>\n }\n @if (labelBtnAction2()) {\n <cw-button [label]=\"labelBtnAction2()\" [type]=\"buttonTypeEnum.secondary\" [isMinWidth]=\"true\"\n (btnAction)=\"action2Click()\" dataTest=\"btn-action-modal\">\n </cw-button>\n }\n @else {\n <cw-button label=\"_COMMON._ACTION.CLOSE\" [type]=\"buttonTypeEnum.secondary\" [isMinWidth]=\"true\"\n (btnAction)=\"closeModal()\" dataTest=\"btn-close-modal\">\n </cw-button>\n }\n }\n </div>\n }\n @else {\n <div class=\"modal-body\">\n <cw-loader></cw-loader>\n </div>\n }\n\n </div>\n </div>\n</div>\n" }]
|
|
2240
|
+
}], 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 }] }], modalTitle: [{ type: i0.Input, args: [{ isSignal: true, alias: "modalTitle", 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 }] }], customBodyTemplate: [{ type: i0.Input, args: [{ isSignal: true, alias: "customBodyTemplate", required: false }] }], customBodyContext: [{ type: i0.Input, args: [{ isSignal: true, alias: "customBodyContext", required: false }] }], btnAction1: [{ type: i0.Output, args: ["btnAction1"] }], btnAction2: [{ type: i0.Output, args: ["btnAction2"] }] } });
|
|
2346
2241
|
|
|
2347
2242
|
class TabContentComponent {
|
|
2348
2243
|
constructor() {
|
|
2349
|
-
this.
|
|
2244
|
+
this.title = input.required(...(ngDevMode ? [{ debugName: "title" }] : []));
|
|
2245
|
+
this.disabled = input(false, ...(ngDevMode ? [{ debugName: "disabled" }] : []));
|
|
2246
|
+
this.withIcon = input(...(ngDevMode ? [undefined, { debugName: "withIcon" }] : []));
|
|
2350
2247
|
this.id = 0;
|
|
2351
2248
|
this.active = false;
|
|
2352
2249
|
}
|
|
2353
2250
|
get fragment() {
|
|
2354
|
-
return UtilsHelper.slugify(this.title);
|
|
2251
|
+
return UtilsHelper.slugify(this.title());
|
|
2355
2252
|
}
|
|
2356
2253
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.19", ngImport: i0, type: TabContentComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2357
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "
|
|
2254
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "20.3.19", 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 } }, ngImport: i0, template: `
|
|
2358
2255
|
<div class="tab-pane"
|
|
2359
2256
|
[class.fade]="!active"
|
|
2360
2257
|
[class.active]="active"
|
|
@@ -2385,13 +2282,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.19", ngImpo
|
|
|
2385
2282
|
`,
|
|
2386
2283
|
standalone: true
|
|
2387
2284
|
}]
|
|
2388
|
-
}], propDecorators: { title: [{
|
|
2389
|
-
type: Input
|
|
2390
|
-
}], disabled: [{
|
|
2391
|
-
type: Input
|
|
2392
|
-
}], withIcon: [{
|
|
2393
|
-
type: Input
|
|
2394
|
-
}] } });
|
|
2285
|
+
}], 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 }] }] } });
|
|
2395
2286
|
|
|
2396
2287
|
var FoTabTypeEnum;
|
|
2397
2288
|
(function (FoTabTypeEnum) {
|
|
@@ -2405,30 +2296,34 @@ var BoTabTypeEnum;
|
|
|
2405
2296
|
})(BoTabTypeEnum || (BoTabTypeEnum = {}));
|
|
2406
2297
|
|
|
2407
2298
|
class TabComponent {
|
|
2408
|
-
constructor(
|
|
2409
|
-
this.router =
|
|
2410
|
-
this.route =
|
|
2411
|
-
this.type = FoTabTypeEnum.defaultMd;
|
|
2412
|
-
this.
|
|
2413
|
-
this.
|
|
2414
|
-
this.
|
|
2415
|
-
this.
|
|
2299
|
+
constructor() {
|
|
2300
|
+
this.router = inject(Router);
|
|
2301
|
+
this.route = inject(ActivatedRoute);
|
|
2302
|
+
this.type = input(FoTabTypeEnum.defaultMd, ...(ngDevMode ? [{ debugName: "type" }] : []));
|
|
2303
|
+
this.id = input(...(ngDevMode ? [undefined, { debugName: "id" }] : []));
|
|
2304
|
+
this.useFragment = input(true, ...(ngDevMode ? [{ debugName: "useFragment" }] : []));
|
|
2305
|
+
this.title = input(...(ngDevMode ? [undefined, { debugName: "title" }] : []));
|
|
2306
|
+
this.tabContentCssClass = input('', ...(ngDevMode ? [{ debugName: "tabContentCssClass" }] : []));
|
|
2307
|
+
this.activeTabIndex = input(0, ...(ngDevMode ? [{ debugName: "activeTabIndex" }] : []));
|
|
2308
|
+
this.tabs = contentChildren(TabContentComponent, ...(ngDevMode ? [{ debugName: "tabs" }] : []));
|
|
2309
|
+
this.tabLinks = viewChildren('tabLink', ...(ngDevMode ? [{ debugName: "tabLinks" }] : []));
|
|
2310
|
+
this.tabChanged = output();
|
|
2416
2311
|
this.activeId = 0;
|
|
2417
2312
|
this.iconSize = IconSizeEnum['md'];
|
|
2418
2313
|
this.tabTypeEnum = FoTabTypeEnum && BoTabTypeEnum;
|
|
2419
2314
|
}
|
|
2420
2315
|
ngAfterContentInit() {
|
|
2421
|
-
const tabsArray = this.tabs
|
|
2316
|
+
const tabsArray = [...this.tabs()];
|
|
2422
2317
|
tabsArray.forEach((tab, index) => {
|
|
2423
2318
|
tab.id = index;
|
|
2424
2319
|
tab.active = false;
|
|
2425
2320
|
});
|
|
2426
|
-
const firstActiveIndex = tabsArray.findIndex(t => !t.disabled);
|
|
2427
|
-
this.activeId = this.activeTabIndex ?? (firstActiveIndex !== -1 ? firstActiveIndex : 0);
|
|
2428
|
-
if (this.useFragment) {
|
|
2321
|
+
const firstActiveIndex = tabsArray.findIndex(t => !t.disabled());
|
|
2322
|
+
this.activeId = this.activeTabIndex() ?? (firstActiveIndex !== -1 ? firstActiveIndex : 0);
|
|
2323
|
+
if (this.useFragment()) {
|
|
2429
2324
|
this.route.fragment.subscribe(fragment => {
|
|
2430
2325
|
if (fragment) {
|
|
2431
|
-
const foundIndex = tabsArray.findIndex(tab => tab.fragment === fragment && !tab.disabled);
|
|
2326
|
+
const foundIndex = tabsArray.findIndex(tab => tab.fragment === fragment && !tab.disabled());
|
|
2432
2327
|
if (foundIndex !== -1) {
|
|
2433
2328
|
this.activeId = foundIndex;
|
|
2434
2329
|
}
|
|
@@ -2441,12 +2336,12 @@ class TabComponent {
|
|
|
2441
2336
|
}
|
|
2442
2337
|
}
|
|
2443
2338
|
selectTab(tab) {
|
|
2444
|
-
if (tab.disabled)
|
|
2339
|
+
if (tab.disabled())
|
|
2445
2340
|
return;
|
|
2446
|
-
this.tabs.forEach(t => t.active = false);
|
|
2341
|
+
this.tabs().forEach(t => t.active = false);
|
|
2447
2342
|
tab.active = true;
|
|
2448
2343
|
this.activeId = tab.id;
|
|
2449
|
-
if (this.useFragment) {
|
|
2344
|
+
if (this.useFragment()) {
|
|
2450
2345
|
this.router.navigate([], {
|
|
2451
2346
|
relativeTo: this.route,
|
|
2452
2347
|
fragment: tab.fragment,
|
|
@@ -2457,8 +2352,8 @@ class TabComponent {
|
|
|
2457
2352
|
this.tabChanged.emit(this.activeId);
|
|
2458
2353
|
}
|
|
2459
2354
|
activateTabByIndex(index) {
|
|
2460
|
-
const tab = this.tabs
|
|
2461
|
-
if (tab && !tab.disabled) {
|
|
2355
|
+
const tab = this.tabs()[index];
|
|
2356
|
+
if (tab && !tab.disabled()) {
|
|
2462
2357
|
this.selectTab(tab);
|
|
2463
2358
|
}
|
|
2464
2359
|
}
|
|
@@ -2475,42 +2370,42 @@ class TabComponent {
|
|
|
2475
2370
|
}
|
|
2476
2371
|
}
|
|
2477
2372
|
moveFocus() {
|
|
2478
|
-
this.tabLinks
|
|
2373
|
+
this.tabLinks().forEach((link) => {
|
|
2479
2374
|
if (link.nativeElement.getAttribute('aria-selected') === 'true') {
|
|
2480
2375
|
link.nativeElement.focus();
|
|
2481
2376
|
}
|
|
2482
2377
|
});
|
|
2483
2378
|
}
|
|
2484
2379
|
selectPreviousTab() {
|
|
2485
|
-
const tabsArray = this.tabs
|
|
2380
|
+
const tabsArray = [...this.tabs()];
|
|
2486
2381
|
const activeIndex = tabsArray.findIndex(tab => tab.active);
|
|
2487
2382
|
if (activeIndex !== -1) {
|
|
2488
2383
|
let newIndex = (activeIndex - 1 + tabsArray.length) % tabsArray.length;
|
|
2489
|
-
while (tabsArray[newIndex].disabled && newIndex !== activeIndex) {
|
|
2384
|
+
while (tabsArray[newIndex].disabled() && newIndex !== activeIndex) {
|
|
2490
2385
|
newIndex = (newIndex - 1 + tabsArray.length) % tabsArray.length;
|
|
2491
2386
|
}
|
|
2492
|
-
if (!tabsArray[newIndex].disabled) {
|
|
2387
|
+
if (!tabsArray[newIndex].disabled()) {
|
|
2493
2388
|
this.selectTab(tabsArray[newIndex]);
|
|
2494
2389
|
setTimeout(() => this.moveFocus());
|
|
2495
2390
|
}
|
|
2496
2391
|
}
|
|
2497
2392
|
}
|
|
2498
2393
|
selectNextTab() {
|
|
2499
|
-
const tabsArray = this.tabs
|
|
2394
|
+
const tabsArray = [...this.tabs()];
|
|
2500
2395
|
const activeIndex = tabsArray.findIndex(tab => tab.active);
|
|
2501
2396
|
if (activeIndex !== -1) {
|
|
2502
2397
|
let newIndex = (activeIndex + 1) % tabsArray.length;
|
|
2503
|
-
while (tabsArray[newIndex].disabled && newIndex !== activeIndex) {
|
|
2398
|
+
while (tabsArray[newIndex].disabled() && newIndex !== activeIndex) {
|
|
2504
2399
|
newIndex = (newIndex + 1) % tabsArray.length;
|
|
2505
2400
|
}
|
|
2506
|
-
if (!tabsArray[newIndex].disabled) {
|
|
2401
|
+
if (!tabsArray[newIndex].disabled()) {
|
|
2507
2402
|
this.selectTab(tabsArray[newIndex]);
|
|
2508
2403
|
setTimeout(() => this.moveFocus());
|
|
2509
2404
|
}
|
|
2510
2405
|
}
|
|
2511
2406
|
}
|
|
2512
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.19", ngImport: i0, type: TabComponent, deps: [
|
|
2513
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.19", type: TabComponent, isStandalone: true, selector: "cw-tab", inputs: { type: "type", id: "id", useFragment: "useFragment", title: "title", tabContentCssClass: "tabContentCssClass", activeTabIndex: "activeTabIndex" }, outputs: { tabChanged: "tabChanged" }, queries: [{ propertyName: "tabs", predicate: TabContentComponent }], viewQueries: [{ propertyName: "tabLinks", predicate: ["tabLink"], descendants: true }], ngImport: i0, template: "<div class=\"tab\" [ngClass]=\"'tab-' + type\">\
|
|
2407
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.19", ngImport: i0, type: TabComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2408
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.19", 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" }, 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 @if (title()) {\n <h2>{{ title() | translate }}</h2>\n }\n <ul class=\"tab-items d-flex-h\" [ngClass]=\"'tab-items-' + type()\" role=\"tablist\" appRwdTabs>\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]=\"'cw-nav-' + i\" [attr.data-test-ctw]=\"'link-tab-' + id() + '-' + i\"\n [attr.aria-selected]=\"tab.active\" [attr.aria-controls]=\"'cw-nav-' + i + '-panel'\"\n [attr.tabindex]=\"tab.active ? '0' : '-1'\" (click)=\"selectTab(tab)\" (keydown)=\"onKeydown($event)\" role=\"tab\">\n @if (tab.withIcon()) {\n <cw-icon [icon]=\"tab.withIcon()\" [iconSize]=\"iconSize\"></cw-icon>\n }\n {{ tab.title() | translate }}\n </button>\n </li>\n }\n </ul>\n</div>\n\n<div [class]=\"'tab-content ' + tabContentCssClass()\" [ngClass]=\"'tab-content-' + type()\">\n <ng-content></ng-content>\n</div>\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "component", type: IconComponent, selector: "cw-icon", inputs: ["icon", "label", "type", "iconSize", "iconCssClass", "iconUiType", "iconColorCustom", "spritePath"] }, { kind: "ngmodule", type: TranslateModule }, { kind: "pipe", type: i2.TranslatePipe, name: "translate" }] }); }
|
|
2514
2409
|
}
|
|
2515
2410
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.19", ngImport: i0, type: TabComponent, decorators: [{
|
|
2516
2411
|
type: Component,
|
|
@@ -2518,35 +2413,17 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.19", ngImpo
|
|
|
2518
2413
|
CommonModule,
|
|
2519
2414
|
IconComponent,
|
|
2520
2415
|
TranslateModule
|
|
2521
|
-
], template: "<div class=\"tab\" [ngClass]=\"'tab-' + type\">\
|
|
2522
|
-
}],
|
|
2523
|
-
type: Input
|
|
2524
|
-
}], id: [{
|
|
2525
|
-
type: Input
|
|
2526
|
-
}], useFragment: [{
|
|
2527
|
-
type: Input
|
|
2528
|
-
}], title: [{
|
|
2529
|
-
type: Input
|
|
2530
|
-
}], tabContentCssClass: [{
|
|
2531
|
-
type: Input
|
|
2532
|
-
}], activeTabIndex: [{
|
|
2533
|
-
type: Input
|
|
2534
|
-
}], tabs: [{
|
|
2535
|
-
type: ContentChildren,
|
|
2536
|
-
args: [TabContentComponent]
|
|
2537
|
-
}], tabLinks: [{
|
|
2538
|
-
type: ViewChildren,
|
|
2539
|
-
args: ['tabLink']
|
|
2540
|
-
}], tabChanged: [{
|
|
2541
|
-
type: Output
|
|
2542
|
-
}] } });
|
|
2416
|
+
], template: "<div class=\"tab\" [ngClass]=\"'tab-' + type()\">\n @if (title()) {\n <h2>{{ title() | translate }}</h2>\n }\n <ul class=\"tab-items d-flex-h\" [ngClass]=\"'tab-items-' + type()\" role=\"tablist\" appRwdTabs>\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]=\"'cw-nav-' + i\" [attr.data-test-ctw]=\"'link-tab-' + id() + '-' + i\"\n [attr.aria-selected]=\"tab.active\" [attr.aria-controls]=\"'cw-nav-' + i + '-panel'\"\n [attr.tabindex]=\"tab.active ? '0' : '-1'\" (click)=\"selectTab(tab)\" (keydown)=\"onKeydown($event)\" role=\"tab\">\n @if (tab.withIcon()) {\n <cw-icon [icon]=\"tab.withIcon()\" [iconSize]=\"iconSize\"></cw-icon>\n }\n {{ tab.title() | translate }}\n </button>\n </li>\n }\n </ul>\n</div>\n\n<div [class]=\"'tab-content ' + tabContentCssClass()\" [ngClass]=\"'tab-content-' + type()\">\n <ng-content></ng-content>\n</div>\n" }]
|
|
2417
|
+
}], 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"] }] } });
|
|
2543
2418
|
|
|
2544
2419
|
class WizardStepComponent {
|
|
2545
2420
|
constructor() {
|
|
2546
|
-
this.
|
|
2421
|
+
this.title = input.required(...(ngDevMode ? [{ debugName: "title" }] : []));
|
|
2422
|
+
this.completed = input(false, ...(ngDevMode ? [{ debugName: "completed" }] : []));
|
|
2423
|
+
this.templateRef = viewChild.required('content');
|
|
2547
2424
|
}
|
|
2548
2425
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.19", ngImport: i0, type: WizardStepComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2549
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "
|
|
2426
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "20.3.19", type: WizardStepComponent, isStandalone: true, selector: "cw-wizard-step", inputs: { title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: true, transformFunction: null }, completed: { classPropertyName: "completed", publicName: "completed", isSignal: true, isRequired: false, transformFunction: null } }, viewQueries: [{ propertyName: "templateRef", first: true, predicate: ["content"], descendants: true, isSignal: true }], ngImport: i0, template: '<ng-template #content><ng-content></ng-content></ng-template>', isInline: true }); }
|
|
2550
2427
|
}
|
|
2551
2428
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.19", ngImport: i0, type: WizardStepComponent, decorators: [{
|
|
2552
2429
|
type: Component,
|
|
@@ -2555,43 +2432,37 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.19", ngImpo
|
|
|
2555
2432
|
template: '<ng-template #content><ng-content></ng-content></ng-template>',
|
|
2556
2433
|
standalone: true
|
|
2557
2434
|
}]
|
|
2558
|
-
}], propDecorators: { title: [{
|
|
2559
|
-
type: Input
|
|
2560
|
-
}], completed: [{
|
|
2561
|
-
type: Input
|
|
2562
|
-
}], templateRef: [{
|
|
2563
|
-
type: ViewChild,
|
|
2564
|
-
args: ['content', { static: true }]
|
|
2565
|
-
}] } });
|
|
2435
|
+
}], propDecorators: { title: [{ type: i0.Input, args: [{ isSignal: true, alias: "title", required: true }] }], completed: [{ type: i0.Input, args: [{ isSignal: true, alias: "completed", required: false }] }], templateRef: [{ type: i0.ViewChild, args: ['content', { isSignal: true }] }] } });
|
|
2566
2436
|
|
|
2567
2437
|
class WizardStepperComponent {
|
|
2568
2438
|
constructor() {
|
|
2569
|
-
this.
|
|
2570
|
-
this.
|
|
2571
|
-
this.
|
|
2572
|
-
this.
|
|
2439
|
+
this.steps = contentChildren(WizardStepComponent, ...(ngDevMode ? [{ debugName: "steps" }] : []));
|
|
2440
|
+
this.stepChange = output();
|
|
2441
|
+
this.stepNext = output();
|
|
2442
|
+
this.stepPrevious = output();
|
|
2443
|
+
this.stepEnd = output();
|
|
2573
2444
|
this.selectedIndex = 0;
|
|
2574
2445
|
}
|
|
2575
2446
|
get stepList() {
|
|
2576
|
-
return this.steps
|
|
2447
|
+
return this.steps();
|
|
2577
2448
|
}
|
|
2578
2449
|
goToStep(index) {
|
|
2579
|
-
|
|
2450
|
+
const stepsArr = this.steps();
|
|
2451
|
+
if (index < 0 || index >= stepsArr.length)
|
|
2580
2452
|
return;
|
|
2581
|
-
// Vérifier que toutes les étapes précédentes sont complétées
|
|
2582
2453
|
for (let i = 0; i < index; i++) {
|
|
2583
|
-
if (!
|
|
2584
|
-
return;
|
|
2454
|
+
if (!stepsArr[i].completed()) {
|
|
2455
|
+
return;
|
|
2585
2456
|
}
|
|
2586
2457
|
}
|
|
2587
2458
|
this.selectedIndex = index;
|
|
2588
2459
|
this.stepChange.emit(this.selectedIndex);
|
|
2589
2460
|
}
|
|
2590
2461
|
nextStep() {
|
|
2591
|
-
|
|
2592
|
-
|
|
2593
|
-
|
|
2594
|
-
|
|
2462
|
+
const stepsArr = this.steps();
|
|
2463
|
+
if (this.selectedIndex < stepsArr.length - 1) {
|
|
2464
|
+
const currentStep = stepsArr[this.selectedIndex];
|
|
2465
|
+
if (!currentStep.completed()) {
|
|
2595
2466
|
return;
|
|
2596
2467
|
}
|
|
2597
2468
|
this.selectedIndex++;
|
|
@@ -2613,49 +2484,32 @@ class WizardStepperComponent {
|
|
|
2613
2484
|
}
|
|
2614
2485
|
}
|
|
2615
2486
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.19", ngImport: i0, type: WizardStepperComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2616
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.19", type: WizardStepperComponent, isStandalone: true, selector: "cw-wizard-stepper", outputs: { stepChange: "stepChange", stepNext: "stepNext", stepPrevious: "stepPrevious", stepEnd: "stepEnd" }, queries: [{ propertyName: "steps", predicate: WizardStepComponent }], ngImport: i0, template: "<nav>\
|
|
2487
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.19", type: WizardStepperComponent, isStandalone: true, selector: "cw-wizard-stepper", outputs: { stepChange: "stepChange", stepNext: "stepNext", stepPrevious: "stepPrevious", stepEnd: "stepEnd" }, queries: [{ propertyName: "steps", predicate: WizardStepComponent, isSignal: true }], ngImport: i0, template: "<nav>\n <ul class=\"list-inline step-list\">\n @for (step of steps(); track step; let i = $index) {\n <li class=\"list-inline-item step-item\">\n <button class=\"btn step-button\" [ngClass]=\"{\n 'step-active': selectedIndex === i,\n 'step-completed': step.completed(),\n 'step-current': selectedIndex === i && step.completed() === false\n }\" [disabled]=\"(i > 0 && !steps()[i - 1]?.completed())\" (click)=\"goToStep(i)\" type=\"button\">\n <span class=\"step-indicator bo-icons bo-alert-success\" aria-hidden=\"true\"></span>\n <span class=\"step-label\">\n {{ step.title() || ('_COMMON._STEPPER.STEP' | translate) + (i + 1) }}\n </span>\n </button>\n </li>\n }\n </ul>\n</nav>\n\n@for (step of steps(); track step; let i = $index) {\n <section class=\"tab-pane\" [class.active]=\"selectedIndex === i\" [hidden]=\"selectedIndex !== i\" role=\"tabpanel\">\n <ng-container *ngTemplateOutlet=\"step.templateRef()\"></ng-container>\n </section>\n}\n\n<div class=\"text-center mt-5\">\n <div class=\"btn-group\">\n <button class=\"btn btn-secondary btn-min-width\" (click)=\"previousStep()\" [disabled]=\"selectedIndex === 0\"\n type=\"button\">\n {{ '_COMMON._STEPPER.PREVIOUS_STEP' | translate }}\n </button>\n\n @if (selectedIndex !== steps().length - 1) {\n <button class=\"btn btn-primary btn-min-width\" (click)=\"nextStep()\"\n [disabled]=\"!steps()[selectedIndex]?.completed()\" type=\"button\">\n {{ '_COMMON._STEPPER.NEXT_STEP' | translate }}\n </button>\n }\n @else {\n <button class=\"btn btn-primary btn-min-width\" (click)=\"endWizard()\" type=\"button\">\n {{ '_COMMON._ACTION.END' | translate }}\n </button>\n }\n </div>\n</div>\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: "ngmodule", type: TranslateModule }, { kind: "pipe", type: i2.TranslatePipe, name: "translate" }] }); }
|
|
2617
2488
|
}
|
|
2618
2489
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.19", ngImport: i0, type: WizardStepperComponent, decorators: [{
|
|
2619
2490
|
type: Component,
|
|
2620
2491
|
args: [{ selector: 'cw-wizard-stepper', standalone: true, imports: [
|
|
2621
2492
|
CommonModule,
|
|
2622
2493
|
TranslateModule
|
|
2623
|
-
], template: "<nav>\
|
|
2624
|
-
}], propDecorators: { steps: [{
|
|
2625
|
-
type: ContentChildren,
|
|
2626
|
-
args: [WizardStepComponent]
|
|
2627
|
-
}], stepChange: [{
|
|
2628
|
-
type: Output
|
|
2629
|
-
}], stepNext: [{
|
|
2630
|
-
type: Output
|
|
2631
|
-
}], stepPrevious: [{
|
|
2632
|
-
type: Output
|
|
2633
|
-
}], stepEnd: [{
|
|
2634
|
-
type: Output
|
|
2635
|
-
}] } });
|
|
2494
|
+
], template: "<nav>\n <ul class=\"list-inline step-list\">\n @for (step of steps(); track step; let i = $index) {\n <li class=\"list-inline-item step-item\">\n <button class=\"btn step-button\" [ngClass]=\"{\n 'step-active': selectedIndex === i,\n 'step-completed': step.completed(),\n 'step-current': selectedIndex === i && step.completed() === false\n }\" [disabled]=\"(i > 0 && !steps()[i - 1]?.completed())\" (click)=\"goToStep(i)\" type=\"button\">\n <span class=\"step-indicator bo-icons bo-alert-success\" aria-hidden=\"true\"></span>\n <span class=\"step-label\">\n {{ step.title() || ('_COMMON._STEPPER.STEP' | translate) + (i + 1) }}\n </span>\n </button>\n </li>\n }\n </ul>\n</nav>\n\n@for (step of steps(); track step; let i = $index) {\n <section class=\"tab-pane\" [class.active]=\"selectedIndex === i\" [hidden]=\"selectedIndex !== i\" role=\"tabpanel\">\n <ng-container *ngTemplateOutlet=\"step.templateRef()\"></ng-container>\n </section>\n}\n\n<div class=\"text-center mt-5\">\n <div class=\"btn-group\">\n <button class=\"btn btn-secondary btn-min-width\" (click)=\"previousStep()\" [disabled]=\"selectedIndex === 0\"\n type=\"button\">\n {{ '_COMMON._STEPPER.PREVIOUS_STEP' | translate }}\n </button>\n\n @if (selectedIndex !== steps().length - 1) {\n <button class=\"btn btn-primary btn-min-width\" (click)=\"nextStep()\"\n [disabled]=\"!steps()[selectedIndex]?.completed()\" type=\"button\">\n {{ '_COMMON._STEPPER.NEXT_STEP' | translate }}\n </button>\n }\n @else {\n <button class=\"btn btn-primary btn-min-width\" (click)=\"endWizard()\" type=\"button\">\n {{ '_COMMON._ACTION.END' | translate }}\n </button>\n }\n </div>\n</div>\n" }]
|
|
2495
|
+
}], propDecorators: { steps: [{ type: i0.ContentChildren, args: [i0.forwardRef(() => WizardStepComponent), { isSignal: true }] }], stepChange: [{ type: i0.Output, args: ["stepChange"] }], stepNext: [{ type: i0.Output, args: ["stepNext"] }], stepPrevious: [{ type: i0.Output, args: ["stepPrevious"] }], stepEnd: [{ type: i0.Output, args: ["stepEnd"] }] } });
|
|
2636
2496
|
|
|
2637
2497
|
class StepperComponent {
|
|
2638
2498
|
constructor() {
|
|
2639
|
-
this.activeStep = 0;
|
|
2640
|
-
this.steps = [];
|
|
2641
|
-
this.label = 'Étapes de progression'
|
|
2499
|
+
this.activeStep = input(0, ...(ngDevMode ? [{ debugName: "activeStep" }] : []));
|
|
2500
|
+
this.steps = input([], ...(ngDevMode ? [{ debugName: "steps" }] : []));
|
|
2501
|
+
this.label = input('Étapes de progression', ...(ngDevMode ? [{ debugName: "label" }] : []));
|
|
2642
2502
|
}
|
|
2643
2503
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.19", ngImport: i0, type: StepperComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2644
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.19", type: StepperComponent, isStandalone: true, selector: "cw-stepper", inputs: { activeStep: "activeStep", steps: "steps", label: "label" }, ngImport: i0, template: "<ul class=\"stepper\" role=\"list\" [attr.aria-label]=\"label\">\
|
|
2504
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.19", type: StepperComponent, isStandalone: true, selector: "cw-stepper", inputs: { activeStep: { classPropertyName: "activeStep", publicName: "activeStep", isSignal: true, isRequired: false, transformFunction: null }, steps: { classPropertyName: "steps", publicName: "steps", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<ul class=\"stepper\" role=\"list\" [attr.aria-label]=\"label()\">\n @for (step of steps(); track step; let i = $index) {\n <li id=\"step-{{i}}\" class=\"stepper-item\" [ngClass]=\"{\n 'stepper-item-current': i === activeStep(),\n 'stepper-item-completed': i < activeStep()}\"\n [attr.aria-current]=\"i === activeStep() ? 'step' : null\">\n <span class=\"stepper-label\">\n <span class=\"visually-hidden\">{{i + 1}}</span>\n {{step | translate}}\n </span>\n </li>\n }\n</ul>\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "ngmodule", type: TranslateModule }, { kind: "pipe", type: i2.TranslatePipe, name: "translate" }] }); }
|
|
2645
2505
|
}
|
|
2646
2506
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.19", ngImport: i0, type: StepperComponent, decorators: [{
|
|
2647
2507
|
type: Component,
|
|
2648
2508
|
args: [{ selector: 'cw-stepper', standalone: true, imports: [
|
|
2649
2509
|
CommonModule,
|
|
2650
2510
|
TranslateModule
|
|
2651
|
-
], template: "<ul class=\"stepper\" role=\"list\" [attr.aria-label]=\"label\">\
|
|
2652
|
-
}], propDecorators: { activeStep: [{
|
|
2653
|
-
type: Input
|
|
2654
|
-
}], steps: [{
|
|
2655
|
-
type: Input
|
|
2656
|
-
}], label: [{
|
|
2657
|
-
type: Input
|
|
2658
|
-
}] } });
|
|
2511
|
+
], template: "<ul class=\"stepper\" role=\"list\" [attr.aria-label]=\"label()\">\n @for (step of steps(); track step; let i = $index) {\n <li id=\"step-{{i}}\" class=\"stepper-item\" [ngClass]=\"{\n 'stepper-item-current': i === activeStep(),\n 'stepper-item-completed': i < activeStep()}\"\n [attr.aria-current]=\"i === activeStep() ? 'step' : null\">\n <span class=\"stepper-label\">\n <span class=\"visually-hidden\">{{i + 1}}</span>\n {{step | translate}}\n </span>\n </li>\n }\n</ul>\n" }]
|
|
2512
|
+
}], propDecorators: { activeStep: [{ type: i0.Input, args: [{ isSignal: true, alias: "activeStep", required: false }] }], steps: [{ type: i0.Input, args: [{ isSignal: true, alias: "steps", required: false }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }] } });
|
|
2659
2513
|
|
|
2660
2514
|
const FILE_SIZE_UNITS_FR = ['o', 'Ko', 'Mo', 'Go', 'To', 'Po', 'Eo', 'Zo', 'Yo'];
|
|
2661
2515
|
const FILE_SIZE_UNITS_DEFAULT = ['B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'];
|
|
@@ -2686,16 +2540,15 @@ class FileToDownloadComponent {
|
|
|
2686
2540
|
this.iconType = IconTypeEnum;
|
|
2687
2541
|
this.iconSize = IconSizeEnum;
|
|
2688
2542
|
this.spriteIcon = SpriteIconEnum.toolbarDownload;
|
|
2543
|
+
this.attachments = input.required(...(ngDevMode ? [{ debugName: "attachments" }] : []));
|
|
2689
2544
|
}
|
|
2690
2545
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.19", ngImport: i0, type: FileToDownloadComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2691
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.19", type: FileToDownloadComponent, isStandalone: true, selector: "cw-file-to-download", inputs: { attachments: "attachments" }, ngImport: i0, template: "<!-- If one file -->\
|
|
2546
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.19", type: FileToDownloadComponent, isStandalone: true, selector: "cw-file-to-download", inputs: { attachments: { classPropertyName: "attachments", publicName: "attachments", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0, template: "<!-- If one file -->\n@if (attachments().length === 1 ) {\n<ng-container *ngTemplateOutlet=\"file;context:{attachment:attachments()[0]}\"></ng-container>\n}\n\n<!-- If two files or more, li loop -->\n@if (attachments().length > 1) {\n<ul class=\"list-unstyled file-to-download-items\">\n @for (attachment of attachments(); track attachment) {\n <li class=\"file-to-download-list-item\">\n <ng-container *ngTemplateOutlet=\"file;context:{attachment:attachment}\"></ng-container>\n </li>\n }\n</ul>\n}\n\n<ng-template #file let-attachment=\"attachment\">\n <a [href]=\"attachment.url\" class=\"file-to-download-link\" target=\"_blank\">\n <span class=\"file-to-download-name\">\n {{ attachment.label ? attachment.label : ('_SHARED.ATTACHMENT_DEFAULT_LABEL' | translate ) }}\n </span>\n <span class=\"file-to-download-info\">\n @if (attachment.extension && attachment.size) {\n {{attachment.extension.toUpperCase()}} {{attachment.size * 1024 | formatFileSize}}\n }\n <cw-icon [icon]=\"spriteIcon\" font=\"optyweb\" [label]=\"'_COMMON.NEW_WINDOW' |translate\" [type]=\"iconType.default\"\n [iconSize]=\"iconSize['md']\" iconCssClass=\"file-to-download-download\"></cw-icon>\n </span>\n </a>\n</ng-template>\n", dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: IconComponent, selector: "cw-icon", inputs: ["icon", "label", "type", "iconSize", "iconCssClass", "iconUiType", "iconColorCustom", "spritePath"] }, { kind: "pipe", type: TranslatePipe, name: "translate" }, { kind: "pipe", type: FormatFileSizePipe, name: "formatFileSize" }] }); }
|
|
2692
2547
|
}
|
|
2693
2548
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.19", ngImport: i0, type: FileToDownloadComponent, decorators: [{
|
|
2694
2549
|
type: Component,
|
|
2695
|
-
args: [{ selector: 'cw-file-to-download', imports: [NgTemplateOutlet, TranslatePipe, FormatFileSizePipe, IconComponent], template: "<!-- If one file -->\
|
|
2696
|
-
}], propDecorators: { attachments: [{
|
|
2697
|
-
type: Input
|
|
2698
|
-
}] } });
|
|
2550
|
+
args: [{ selector: 'cw-file-to-download', imports: [NgTemplateOutlet, TranslatePipe, FormatFileSizePipe, IconComponent], template: "<!-- If one file -->\n@if (attachments().length === 1 ) {\n<ng-container *ngTemplateOutlet=\"file;context:{attachment:attachments()[0]}\"></ng-container>\n}\n\n<!-- If two files or more, li loop -->\n@if (attachments().length > 1) {\n<ul class=\"list-unstyled file-to-download-items\">\n @for (attachment of attachments(); track attachment) {\n <li class=\"file-to-download-list-item\">\n <ng-container *ngTemplateOutlet=\"file;context:{attachment:attachment}\"></ng-container>\n </li>\n }\n</ul>\n}\n\n<ng-template #file let-attachment=\"attachment\">\n <a [href]=\"attachment.url\" class=\"file-to-download-link\" target=\"_blank\">\n <span class=\"file-to-download-name\">\n {{ attachment.label ? attachment.label : ('_SHARED.ATTACHMENT_DEFAULT_LABEL' | translate ) }}\n </span>\n <span class=\"file-to-download-info\">\n @if (attachment.extension && attachment.size) {\n {{attachment.extension.toUpperCase()}} {{attachment.size * 1024 | formatFileSize}}\n }\n <cw-icon [icon]=\"spriteIcon\" font=\"optyweb\" [label]=\"'_COMMON.NEW_WINDOW' |translate\" [type]=\"iconType.default\"\n [iconSize]=\"iconSize['md']\" iconCssClass=\"file-to-download-download\"></cw-icon>\n </span>\n </a>\n</ng-template>\n" }]
|
|
2551
|
+
}], propDecorators: { attachments: [{ type: i0.Input, args: [{ isSignal: true, alias: "attachments", required: true }] }] } });
|
|
2699
2552
|
|
|
2700
2553
|
var NumericalRangeTypeEnum;
|
|
2701
2554
|
(function (NumericalRangeTypeEnum) {
|
|
@@ -2714,16 +2567,17 @@ var NumericalRangeLabelPositionEnum;
|
|
|
2714
2567
|
|
|
2715
2568
|
class NumericalRangeComponent {
|
|
2716
2569
|
constructor() {
|
|
2717
|
-
this.type = NumericalRangeTypeEnum.defaultGrey;
|
|
2718
|
-
this.label = '';
|
|
2719
|
-
this.amount = 0;
|
|
2720
|
-
this.
|
|
2721
|
-
this.
|
|
2722
|
-
this.
|
|
2723
|
-
this.
|
|
2724
|
-
this.
|
|
2725
|
-
this.
|
|
2726
|
-
this.
|
|
2570
|
+
this.type = input(NumericalRangeTypeEnum.defaultGrey, ...(ngDevMode ? [{ debugName: "type" }] : []));
|
|
2571
|
+
this.label = input('', ...(ngDevMode ? [{ debugName: "label" }] : []));
|
|
2572
|
+
this.amount = model(0, ...(ngDevMode ? [{ debugName: "amount" }] : []));
|
|
2573
|
+
this.withIcon = input(...(ngDevMode ? [undefined, { debugName: "withIcon" }] : []));
|
|
2574
|
+
this.withLabelVisible = input(true, ...(ngDevMode ? [{ debugName: "withLabelVisible" }] : []));
|
|
2575
|
+
this.labelPosition = input(NumericalRangeLabelPositionEnum.inside, ...(ngDevMode ? [{ debugName: "labelPosition" }] : []));
|
|
2576
|
+
this.ceil = input(9, ...(ngDevMode ? [{ debugName: "ceil" }] : []));
|
|
2577
|
+
this.floor = input(0, ...(ngDevMode ? [{ debugName: "floor" }] : []));
|
|
2578
|
+
this.isDisabled = input(false, ...(ngDevMode ? [{ debugName: "isDisabled" }] : []));
|
|
2579
|
+
this.autoChangeAmount = input(true, ...(ngDevMode ? [{ debugName: "autoChangeAmount" }] : []));
|
|
2580
|
+
this.newAmount = output();
|
|
2727
2581
|
this.numericalRangeType = NumericalRangeTypeEnum;
|
|
2728
2582
|
this.iconTypeEnum = IconTypeEnum;
|
|
2729
2583
|
this.iconSize = IconSizeEnum;
|
|
@@ -2734,80 +2588,46 @@ class NumericalRangeComponent {
|
|
|
2734
2588
|
this.uniqueId = `numerical-range-${Math.random().toString(36).slice(2)}`;
|
|
2735
2589
|
}
|
|
2736
2590
|
increaseAmount() {
|
|
2737
|
-
const
|
|
2738
|
-
if (this.autoChangeAmount) {
|
|
2739
|
-
this.amount
|
|
2591
|
+
const next = this.amount() + 1;
|
|
2592
|
+
if (this.autoChangeAmount()) {
|
|
2593
|
+
this.amount.set(next);
|
|
2740
2594
|
}
|
|
2741
|
-
this.newAmount.emit(
|
|
2595
|
+
this.newAmount.emit(next);
|
|
2742
2596
|
}
|
|
2743
2597
|
decreaseAmount() {
|
|
2744
|
-
|
|
2745
|
-
if (this.autoChangeAmount) {
|
|
2746
|
-
this.
|
|
2747
|
-
|
|
2748
|
-
this.amount = this.floor;
|
|
2598
|
+
let next = this.amount() - 1;
|
|
2599
|
+
if (this.autoChangeAmount()) {
|
|
2600
|
+
if (next < this.floor()) {
|
|
2601
|
+
next = this.floor();
|
|
2749
2602
|
}
|
|
2603
|
+
this.amount.set(next);
|
|
2750
2604
|
}
|
|
2751
|
-
this.newAmount.emit(
|
|
2605
|
+
this.newAmount.emit(next);
|
|
2752
2606
|
}
|
|
2753
2607
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.19", ngImport: i0, type: NumericalRangeComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2754
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.19", type: NumericalRangeComponent, isStandalone: true, selector: "cw-numerical-range", inputs: { type: "type", label: "label", amount: "amount", withIcon: "withIcon", withLabelVisible: "withLabelVisible", labelPosition: "labelPosition", ceil: "ceil", floor: "floor", isDisabled: "isDisabled", autoChangeAmount: "autoChangeAmount" }, outputs: { newAmount: "newAmount" }, ngImport: i0, template: "<div class=\"numerical-range text-center\" [ngClass]=\"'numerical-range-' + type\">\
|
|
2608
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.19", type: NumericalRangeComponent, isStandalone: true, selector: "cw-numerical-range", inputs: { type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, amount: { classPropertyName: "amount", publicName: "amount", isSignal: true, isRequired: false, transformFunction: null }, withIcon: { classPropertyName: "withIcon", publicName: "withIcon", isSignal: true, isRequired: false, transformFunction: null }, withLabelVisible: { classPropertyName: "withLabelVisible", publicName: "withLabelVisible", isSignal: true, isRequired: false, transformFunction: null }, labelPosition: { classPropertyName: "labelPosition", publicName: "labelPosition", isSignal: true, isRequired: false, transformFunction: null }, ceil: { classPropertyName: "ceil", publicName: "ceil", isSignal: true, isRequired: false, transformFunction: null }, floor: { classPropertyName: "floor", publicName: "floor", isSignal: true, isRequired: false, transformFunction: null }, isDisabled: { classPropertyName: "isDisabled", publicName: "isDisabled", isSignal: true, isRequired: false, transformFunction: null }, autoChangeAmount: { classPropertyName: "autoChangeAmount", publicName: "autoChangeAmount", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { amount: "amountChange", newAmount: "newAmount" }, ngImport: i0, template: "<div class=\"numerical-range text-center\" [ngClass]=\"'numerical-range-' + type()\">\n\n @if (labelPosition() == labelPositionValue.outside && withLabelVisible()) {\n <div class=\"numerical-range-label\" aria-hidden=\"true\">\n @if (withIcon() && (type() == numericalRangeType.largeWhite || type() == numericalRangeType.largeGrey)) {\n <cw-icon [icon]=\"withIcon()\" [iconSize]=\"iconSize['lg']\"></cw-icon>\n }\n <span>{{ label() }}</span>\n </div>\n }\n\n <div class=\"numerical-range-container\">\n <cw-button [isDisabled]=\"isDisabled() || amount() <= floor()\" [label]=\"'Diminuer ' + amount() + ' ' + label()\"\n [withIcon]=\"spriteIcon.toolbarMinus\" [withOnlyIcon]=\"true\" [type]=\"buttonType.primary\"\n [iconSize]=\"buttonIconSize.small\" (btnAction)=\"decreaseAmount()\">\n </cw-button>\n\n <div class=\"numerical-range-wrapper\">\n <div class=\"numerical-range-amount\" aria-live=\"polite\" aria-atomic=\"true\">\n {{ amount() }}\n @if (!withLabelVisible() && !withIcon()) {\n <span class=\"sr-only\">{{ label() }}</span>\n }\n </div>\n\n @if ((type() !== numericalRangeType.largeGrey && type() !== numericalRangeType.largeWhite) && (withIcon() ||\n withLabelVisible())) {\n <div class=\"numerical-range-label\">\n @if (withLabelVisible() && labelPosition() == labelPositionValue.inside) {\n @if (withIcon()) {\n <cw-icon [icon]=\"withIcon()\" [iconSize]=\"iconSize['lg']\" aria-hidden=\"true\"></cw-icon>\n }\n <span>{{ label() }}</span>\n }\n @else {\n @if (withIcon()) {\n <cw-icon [icon]=\"withIcon()\" [label]=\"label()\" [iconSize]=\"iconSize['lg']\"></cw-icon>\n }\n }\n </div>\n }\n </div>\n\n <cw-button [isDisabled]=\"isDisabled() || amount() >= ceil()\" [label]=\"'Augmenter ' + amount() + ' ' + label()\"\n [withIcon]=\"spriteIcon.toolbarPlus\" [withOnlyIcon]=\"true\" [type]=\"buttonType.primary\"\n [iconSize]=\"buttonIconSize.small\" (btnAction)=\"increaseAmount()\">\n </cw-button>\n </div>\n</div>\n", dependencies: [{ kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "component", type: IconComponent, selector: "cw-icon", inputs: ["icon", "label", "type", "iconSize", "iconCssClass", "iconUiType", "iconColorCustom", "spritePath"] }, { kind: "component", type: ButtonComponent, selector: "cw-button", inputs: ["type", "label", "id", "isDropdown", "withIcon", "withOnlyIcon", "iconSize", "iconPosition", "dropdownPosition", "isMinWidth", "isDisabled", "isLoading", "cssClass", "dataTest", "skeletonMode", "withTooltip", "tooltipText", "tooltipTitle", "tooltipTrigger", "tooltipPosition", "tooltipType"], outputs: ["btnAction", "dropDownClicked"] }] }); }
|
|
2755
2609
|
}
|
|
2756
2610
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.19", ngImport: i0, type: NumericalRangeComponent, decorators: [{
|
|
2757
2611
|
type: Component,
|
|
2758
|
-
args: [{ selector: 'cw-numerical-range', imports: [NgClass, IconComponent, ButtonComponent], standalone: true, template: "<div class=\"numerical-range text-center\" [ngClass]=\"'numerical-range-' + type\">\
|
|
2759
|
-
}], propDecorators: { type: [{
|
|
2760
|
-
type: Input
|
|
2761
|
-
}], label: [{
|
|
2762
|
-
type: Input
|
|
2763
|
-
}], amount: [{
|
|
2764
|
-
type: Input
|
|
2765
|
-
}], withIcon: [{
|
|
2766
|
-
type: Input
|
|
2767
|
-
}], withLabelVisible: [{
|
|
2768
|
-
type: Input
|
|
2769
|
-
}], labelPosition: [{
|
|
2770
|
-
type: Input
|
|
2771
|
-
}], ceil: [{
|
|
2772
|
-
type: Input
|
|
2773
|
-
}], floor: [{
|
|
2774
|
-
type: Input
|
|
2775
|
-
}], isDisabled: [{
|
|
2776
|
-
type: Input
|
|
2777
|
-
}], autoChangeAmount: [{
|
|
2778
|
-
type: Input
|
|
2779
|
-
}], newAmount: [{
|
|
2780
|
-
type: Output
|
|
2781
|
-
}] } });
|
|
2612
|
+
args: [{ selector: 'cw-numerical-range', imports: [NgClass, IconComponent, ButtonComponent], standalone: true, template: "<div class=\"numerical-range text-center\" [ngClass]=\"'numerical-range-' + type()\">\n\n @if (labelPosition() == labelPositionValue.outside && withLabelVisible()) {\n <div class=\"numerical-range-label\" aria-hidden=\"true\">\n @if (withIcon() && (type() == numericalRangeType.largeWhite || type() == numericalRangeType.largeGrey)) {\n <cw-icon [icon]=\"withIcon()\" [iconSize]=\"iconSize['lg']\"></cw-icon>\n }\n <span>{{ label() }}</span>\n </div>\n }\n\n <div class=\"numerical-range-container\">\n <cw-button [isDisabled]=\"isDisabled() || amount() <= floor()\" [label]=\"'Diminuer ' + amount() + ' ' + label()\"\n [withIcon]=\"spriteIcon.toolbarMinus\" [withOnlyIcon]=\"true\" [type]=\"buttonType.primary\"\n [iconSize]=\"buttonIconSize.small\" (btnAction)=\"decreaseAmount()\">\n </cw-button>\n\n <div class=\"numerical-range-wrapper\">\n <div class=\"numerical-range-amount\" aria-live=\"polite\" aria-atomic=\"true\">\n {{ amount() }}\n @if (!withLabelVisible() && !withIcon()) {\n <span class=\"sr-only\">{{ label() }}</span>\n }\n </div>\n\n @if ((type() !== numericalRangeType.largeGrey && type() !== numericalRangeType.largeWhite) && (withIcon() ||\n withLabelVisible())) {\n <div class=\"numerical-range-label\">\n @if (withLabelVisible() && labelPosition() == labelPositionValue.inside) {\n @if (withIcon()) {\n <cw-icon [icon]=\"withIcon()\" [iconSize]=\"iconSize['lg']\" aria-hidden=\"true\"></cw-icon>\n }\n <span>{{ label() }}</span>\n }\n @else {\n @if (withIcon()) {\n <cw-icon [icon]=\"withIcon()\" [label]=\"label()\" [iconSize]=\"iconSize['lg']\"></cw-icon>\n }\n }\n </div>\n }\n </div>\n\n <cw-button [isDisabled]=\"isDisabled() || amount() >= ceil()\" [label]=\"'Augmenter ' + amount() + ' ' + label()\"\n [withIcon]=\"spriteIcon.toolbarPlus\" [withOnlyIcon]=\"true\" [type]=\"buttonType.primary\"\n [iconSize]=\"buttonIconSize.small\" (btnAction)=\"increaseAmount()\">\n </cw-button>\n </div>\n</div>\n" }]
|
|
2613
|
+
}], propDecorators: { type: [{ type: i0.Input, args: [{ isSignal: true, alias: "type", required: false }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], amount: [{ type: i0.Input, args: [{ isSignal: true, alias: "amount", required: false }] }, { type: i0.Output, args: ["amountChange"] }], withIcon: [{ type: i0.Input, args: [{ isSignal: true, alias: "withIcon", required: false }] }], withLabelVisible: [{ type: i0.Input, args: [{ isSignal: true, alias: "withLabelVisible", required: false }] }], labelPosition: [{ type: i0.Input, args: [{ isSignal: true, alias: "labelPosition", required: false }] }], ceil: [{ type: i0.Input, args: [{ isSignal: true, alias: "ceil", required: false }] }], floor: [{ type: i0.Input, args: [{ isSignal: true, alias: "floor", required: false }] }], isDisabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "isDisabled", required: false }] }], autoChangeAmount: [{ type: i0.Input, args: [{ isSignal: true, alias: "autoChangeAmount", required: false }] }], newAmount: [{ type: i0.Output, args: ["newAmount"] }] } });
|
|
2782
2614
|
|
|
2783
2615
|
class ImageComponent {
|
|
2784
2616
|
constructor() {
|
|
2785
|
-
this.source = '';
|
|
2786
|
-
this.alt = '';
|
|
2787
|
-
this.isAriaHidden = false;
|
|
2788
|
-
this.cssClass = '';
|
|
2789
|
-
this.width = '';
|
|
2790
|
-
this.height = '';
|
|
2617
|
+
this.source = input('', ...(ngDevMode ? [{ debugName: "source" }] : []));
|
|
2618
|
+
this.alt = input('', ...(ngDevMode ? [{ debugName: "alt" }] : []));
|
|
2619
|
+
this.isAriaHidden = input(false, ...(ngDevMode ? [{ debugName: "isAriaHidden" }] : []));
|
|
2620
|
+
this.cssClass = input('', ...(ngDevMode ? [{ debugName: "cssClass" }] : []));
|
|
2621
|
+
this.width = input('', ...(ngDevMode ? [{ debugName: "width" }] : []));
|
|
2622
|
+
this.height = input('', ...(ngDevMode ? [{ debugName: "height" }] : []));
|
|
2791
2623
|
}
|
|
2792
2624
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.19", ngImport: i0, type: ImageComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2793
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "
|
|
2625
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "20.3.19", type: ImageComponent, isStandalone: true, selector: "cw-image", inputs: { source: { classPropertyName: "source", publicName: "source", isSignal: true, isRequired: false, transformFunction: null }, alt: { classPropertyName: "alt", publicName: "alt", isSignal: true, isRequired: false, transformFunction: null }, isAriaHidden: { classPropertyName: "isAriaHidden", publicName: "isAriaHidden", isSignal: true, isRequired: false, transformFunction: null }, cssClass: { classPropertyName: "cssClass", publicName: "cssClass", isSignal: true, isRequired: false, transformFunction: null }, width: { classPropertyName: "width", publicName: "width", isSignal: true, isRequired: false, transformFunction: null }, height: { classPropertyName: "height", publicName: "height", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<img [src]=\"source()\" [attr.aria-hidden]=\"isAriaHidden() ? 'true' : null\" [class]=\"cssClass()\" [alt]=\"alt()\"\n [attr.width]=\"width() ? width() : null\" [attr.height]=\"height() ? height() : null\">\n" }); }
|
|
2794
2626
|
}
|
|
2795
2627
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.19", ngImport: i0, type: ImageComponent, decorators: [{
|
|
2796
2628
|
type: Component,
|
|
2797
|
-
args: [{ selector: 'cw-image', standalone: true, template: "<img [src]=\"source\" [attr.aria-hidden]=\"isAriaHidden ? 'true' : null\" [class]=\"cssClass\" [alt]=\"alt\"\
|
|
2798
|
-
}], propDecorators: { source: [{
|
|
2799
|
-
type: Input
|
|
2800
|
-
}], alt: [{
|
|
2801
|
-
type: Input
|
|
2802
|
-
}], isAriaHidden: [{
|
|
2803
|
-
type: Input
|
|
2804
|
-
}], cssClass: [{
|
|
2805
|
-
type: Input
|
|
2806
|
-
}], width: [{
|
|
2807
|
-
type: Input
|
|
2808
|
-
}], height: [{
|
|
2809
|
-
type: Input
|
|
2810
|
-
}] } });
|
|
2629
|
+
args: [{ selector: 'cw-image', standalone: true, template: "<img [src]=\"source()\" [attr.aria-hidden]=\"isAriaHidden() ? 'true' : null\" [class]=\"cssClass()\" [alt]=\"alt()\"\n [attr.width]=\"width() ? width() : null\" [attr.height]=\"height() ? height() : null\">\n" }]
|
|
2630
|
+
}], propDecorators: { source: [{ type: i0.Input, args: [{ isSignal: true, alias: "source", required: false }] }], alt: [{ type: i0.Input, args: [{ isSignal: true, alias: "alt", required: false }] }], isAriaHidden: [{ type: i0.Input, args: [{ isSignal: true, alias: "isAriaHidden", required: false }] }], cssClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "cssClass", required: false }] }], width: [{ type: i0.Input, args: [{ isSignal: true, alias: "width", required: false }] }], height: [{ type: i0.Input, args: [{ isSignal: true, alias: "height", required: false }] }] } });
|
|
2811
2631
|
|
|
2812
2632
|
var TitleTagEnum;
|
|
2813
2633
|
(function (TitleTagEnum) {
|