@cityway/basic-ui 1.0.2-beta017 → 1.0.2-beta019
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cityway-basic-ui-1.0.2-beta019.tgz +0 -0
- package/fesm2022/cityway-basic-ui.mjs +420 -480
- package/fesm2022/cityway-basic-ui.mjs.map +1 -1
- package/index.d.ts +243 -192
- package/lib/assets/styles/scss/components/_btn-collapse.scss +8 -0
- package/lib/assets/styles/scss/components/_dropdown.scss +1 -0
- package/lib/assets/styles/scss/components/form-field/_field-check.scss +9 -0
- 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,9 +1,9 @@
|
|
|
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, ChangeDetectionStrategy, Renderer2, ViewChild, TemplateRef, ContentChild, ApplicationRef, Injector, createComponent, viewChildren, Pipe, computed } from '@angular/core';
|
|
5
5
|
import * as i2 from '@ngx-translate/core';
|
|
6
|
-
import {
|
|
6
|
+
import { TranslatePipe, TranslateModule, TranslateService } from '@ngx-translate/core';
|
|
7
7
|
import { BehaviorSubject, fromEvent } from 'rxjs';
|
|
8
8
|
import * as i4 from '@angular-slider/ngx-slider';
|
|
9
9
|
import { NgxSliderModule } from '@angular-slider/ngx-slider';
|
|
@@ -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,60 +731,40 @@ 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() | translate}}</h2>\n }\n @else if (titleRank() == titleRankEnum.h3) {\n <h3>{{title() | translate}}</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"] }, { kind: "pipe", type: TranslatePipe, name: "translate" }] }); }
|
|
746
736
|
}
|
|
747
737
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.19", ngImport: i0, type: CardComponent, decorators: [{
|
|
748
738
|
type: Component,
|
|
749
739
|
args: [{ selector: 'cw-card', standalone: true, imports: [
|
|
750
740
|
CommonModule,
|
|
751
741
|
CollapseDirective,
|
|
752
|
-
IconComponent
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
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
|
-
}] } });
|
|
742
|
+
IconComponent,
|
|
743
|
+
TranslatePipe
|
|
744
|
+
], 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() | translate}}</h2>\n }\n @else if (titleRank() == titleRankEnum.h3) {\n <h3>{{title() | translate}}</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" }]
|
|
745
|
+
}], 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
746
|
|
|
778
747
|
class AccordionComponent {
|
|
779
748
|
constructor() {
|
|
780
|
-
this.closeOthers = true;
|
|
781
|
-
this.allowMultiple = false;
|
|
782
|
-
this.destroyOnHide = true
|
|
783
|
-
this.panelOpened =
|
|
784
|
-
this.panelClosed =
|
|
749
|
+
this.closeOthers = input(true, ...(ngDevMode ? [{ debugName: "closeOthers" }] : []));
|
|
750
|
+
this.allowMultiple = input(false, ...(ngDevMode ? [{ debugName: "allowMultiple" }] : []));
|
|
751
|
+
this.destroyOnHide = input(true, ...(ngDevMode ? [{ debugName: "destroyOnHide" }] : []));
|
|
752
|
+
this.panelOpened = output();
|
|
753
|
+
this.panelClosed = output();
|
|
754
|
+
this.cards = contentChildren(CardComponent, ...(ngDevMode ? [{ debugName: "cards" }] : []));
|
|
785
755
|
this.cardMap = new Map();
|
|
786
756
|
}
|
|
787
757
|
ngAfterContentInit() {
|
|
788
|
-
this.cards.forEach(card => {
|
|
789
|
-
if (!card.collapsible) {
|
|
790
|
-
card.collapsible
|
|
758
|
+
this.cards().forEach(card => {
|
|
759
|
+
if (!card.collapsible()) {
|
|
760
|
+
card.collapsible.set(true);
|
|
791
761
|
}
|
|
792
|
-
if (card.destroyOnHide === true) {
|
|
793
|
-
card.destroyOnHide
|
|
762
|
+
if (card.destroyOnHide() === true) {
|
|
763
|
+
card.destroyOnHide.set(this.destroyOnHide());
|
|
794
764
|
}
|
|
795
|
-
this.cardMap.set(card.collapseId, card);
|
|
765
|
+
this.cardMap.set(card.collapseId(), card);
|
|
796
766
|
card.collapseClicked.subscribe((isCollapsed) => {
|
|
797
|
-
this.onCardToggle(card.collapseId, isCollapsed);
|
|
767
|
+
this.onCardToggle(card.collapseId(), isCollapsed);
|
|
798
768
|
});
|
|
799
769
|
});
|
|
800
770
|
}
|
|
@@ -825,11 +795,11 @@ class AccordionComponent {
|
|
|
825
795
|
}
|
|
826
796
|
}
|
|
827
797
|
closeAll() {
|
|
828
|
-
this.cards.forEach(card => card.collapse());
|
|
798
|
+
this.cards().forEach(card => card.collapse());
|
|
829
799
|
}
|
|
830
800
|
openAll() {
|
|
831
801
|
if (!this.shouldCloseOthers()) {
|
|
832
|
-
this.cards.forEach(card => card.expand());
|
|
802
|
+
this.cards().forEach(card => card.expand());
|
|
833
803
|
}
|
|
834
804
|
}
|
|
835
805
|
onCardToggle(panelId, isCollapsed) {
|
|
@@ -844,35 +814,22 @@ class AccordionComponent {
|
|
|
844
814
|
}
|
|
845
815
|
}
|
|
846
816
|
closeAllExcept(exceptId) {
|
|
847
|
-
this.cards.forEach(card => {
|
|
848
|
-
if (card.collapseId !== exceptId) {
|
|
817
|
+
this.cards().forEach(card => {
|
|
818
|
+
if (card.collapseId() !== exceptId) {
|
|
849
819
|
card.collapse();
|
|
850
820
|
}
|
|
851
821
|
});
|
|
852
822
|
}
|
|
853
823
|
shouldCloseOthers() {
|
|
854
|
-
return this.closeOthers && !this.allowMultiple;
|
|
824
|
+
return this.closeOthers() && !this.allowMultiple();
|
|
855
825
|
}
|
|
856
826
|
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: "
|
|
827
|
+
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
828
|
}
|
|
859
829
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.19", ngImport: i0, type: AccordionComponent, decorators: [{
|
|
860
830
|
type: Component,
|
|
861
831
|
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
|
-
}] } });
|
|
832
|
+
}], 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
833
|
|
|
877
834
|
var AlertTypeEnum;
|
|
878
835
|
(function (AlertTypeEnum) {
|
|
@@ -899,14 +856,14 @@ var IconNotifTypeEnum;
|
|
|
899
856
|
|
|
900
857
|
class IconNotificationComponent {
|
|
901
858
|
constructor() {
|
|
902
|
-
this.type = IconNotifTypeEnum.info;
|
|
903
|
-
this.iconSize = IconNotifSizeEnum['md'];
|
|
859
|
+
this.type = input(IconNotifTypeEnum.info, ...(ngDevMode ? [{ debugName: "type" }] : []));
|
|
860
|
+
this.iconSize = input(IconNotifSizeEnum['md'], ...(ngDevMode ? [{ debugName: "iconSize" }] : []));
|
|
904
861
|
}
|
|
905
862
|
get hostClasses() {
|
|
906
|
-
return 'icon-rounded icon-rounded-' + this.iconSize + ' icon-notification-' + this.type;
|
|
863
|
+
return 'icon-rounded icon-rounded-' + this.iconSize() + ' icon-notification-' + this.type();
|
|
907
864
|
}
|
|
908
865
|
ngOnInit() {
|
|
909
|
-
switch (this.type) {
|
|
866
|
+
switch (this.type()) {
|
|
910
867
|
case IconNotifTypeEnum.info:
|
|
911
868
|
this.icon = SpriteIconEnum.alertHelp;
|
|
912
869
|
this.label = 'Informatiion';
|
|
@@ -930,38 +887,37 @@ class IconNotificationComponent {
|
|
|
930
887
|
}
|
|
931
888
|
}
|
|
932
889
|
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: "
|
|
890
|
+
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
891
|
}
|
|
935
892
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.19", ngImport: i0, type: IconNotificationComponent, decorators: [{
|
|
936
893
|
type: Component,
|
|
937
894
|
args: [{ selector: 'cw-icon-notification', standalone: true, imports: [
|
|
938
895
|
CommonModule,
|
|
939
896
|
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: [{
|
|
897
|
+
], template: "\r\n<span class=\"icon\">\r\n <cw-icon [label]=\"label\" [iconSize]=\"iconSize()['2xs']\" [icon]=\"icon\"></cw-icon>\r\n</span>\r\n" }]
|
|
898
|
+
}], 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
899
|
type: HostBinding,
|
|
947
900
|
args: ['class']
|
|
948
901
|
}] } });
|
|
949
902
|
|
|
950
903
|
class AlertComponent {
|
|
951
|
-
constructor(
|
|
952
|
-
this.cdRef =
|
|
953
|
-
this.type = AlertTypeEnum.info;
|
|
954
|
-
this.
|
|
955
|
-
this.
|
|
956
|
-
this.
|
|
904
|
+
constructor() {
|
|
905
|
+
this.cdRef = inject(ChangeDetectorRef);
|
|
906
|
+
this.type = input(AlertTypeEnum.info, ...(ngDevMode ? [{ debugName: "type" }] : []));
|
|
907
|
+
this.title = input(...(ngDevMode ? [undefined, { debugName: "title" }] : []));
|
|
908
|
+
this.isDismissible = input(false, ...(ngDevMode ? [{ debugName: "isDismissible" }] : []));
|
|
909
|
+
this.cssClass = input('', ...(ngDevMode ? [{ debugName: "cssClass" }] : []));
|
|
910
|
+
this.dataTest = input(...(ngDevMode ? [undefined, { debugName: "dataTest" }] : []));
|
|
911
|
+
this.close = output();
|
|
912
|
+
this.alertContent = viewChild('alertContent', ...(ngDevMode ? [{ debugName: "alertContent" }] : []));
|
|
957
913
|
this.isVisible = true;
|
|
958
914
|
this.showContent = true;
|
|
959
915
|
this.iconSize = IconSizeEnum;
|
|
960
916
|
this.spriteIcon = SpriteIconEnum;
|
|
961
917
|
}
|
|
962
918
|
ngOnInit() {
|
|
963
|
-
this.
|
|
964
|
-
switch (this.type) {
|
|
919
|
+
this.resolvedDataTest = this.dataTest() ? this.dataTest() : 'alert' + this.type();
|
|
920
|
+
switch (this.type()) {
|
|
965
921
|
case AlertTypeEnum.info:
|
|
966
922
|
this.icon = "cw-alert-info2";
|
|
967
923
|
this.iconNotifType = IconNotifTypeEnum.info;
|
|
@@ -985,15 +941,16 @@ class AlertComponent {
|
|
|
985
941
|
}
|
|
986
942
|
}
|
|
987
943
|
ngAfterViewInit() {
|
|
988
|
-
|
|
944
|
+
const el = this.alertContent()?.nativeElement;
|
|
945
|
+
this.showContent = !!el && el.children.length > 0;
|
|
989
946
|
this.cdRef.detectChanges();
|
|
990
947
|
}
|
|
991
948
|
closeAlert() {
|
|
992
949
|
this.isVisible = false;
|
|
993
|
-
this.close.emit();
|
|
950
|
+
this.close.emit(true);
|
|
994
951
|
}
|
|
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) {\
|
|
952
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.19", ngImport: i0, type: AlertComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
953
|
+
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
954
|
}
|
|
998
955
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.19", ngImport: i0, type: AlertComponent, decorators: [{
|
|
999
956
|
type: Component,
|
|
@@ -1002,23 +959,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.19", ngImpo
|
|
|
1002
959
|
TranslateModule,
|
|
1003
960
|
IconNotificationComponent,
|
|
1004
961
|
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
|
-
}] } });
|
|
962
|
+
], 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" }]
|
|
963
|
+
}], 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
964
|
|
|
1023
965
|
class FocusTrackerService {
|
|
1024
966
|
constructor() {
|
|
@@ -1048,11 +990,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.19", ngImpo
|
|
|
1048
990
|
}]
|
|
1049
991
|
}], ctorParameters: () => [] });
|
|
1050
992
|
|
|
993
|
+
const TOAST_AUTOHIDE_DELAY_MS = 6000;
|
|
1051
994
|
class ToastService {
|
|
1052
995
|
constructor() {
|
|
1053
996
|
this.focusService = inject(FocusTrackerService);
|
|
1054
|
-
this.toasts = [];
|
|
1055
|
-
this.
|
|
997
|
+
this.toasts = signal([], ...(ngDevMode ? [{ debugName: "toasts" }] : []));
|
|
998
|
+
this.triggeringElements = new Map();
|
|
1056
999
|
}
|
|
1057
1000
|
show(options) {
|
|
1058
1001
|
if (!this.canShowMessage(options.message)) {
|
|
@@ -1066,38 +1009,25 @@ class ToastService {
|
|
|
1066
1009
|
autohide: options.autohide ?? false,
|
|
1067
1010
|
action: options.action,
|
|
1068
1011
|
};
|
|
1069
|
-
this.toasts.
|
|
1070
|
-
this.
|
|
1071
|
-
// Gestion du autohide
|
|
1072
|
-
if (toast.autohide) {
|
|
1073
|
-
const toastId = toast.id; // Capturer l'ID
|
|
1074
|
-
const timer = setTimeout(() => {
|
|
1075
|
-
this.removeById(toastId);
|
|
1076
|
-
}, 5000);
|
|
1077
|
-
this.autohideTimers.set(toastId, timer);
|
|
1078
|
-
}
|
|
1012
|
+
this.toasts.update(arr => [...arr, toast]);
|
|
1013
|
+
this.triggeringElements.set(toast.id, this.focusService.getFocusedElement());
|
|
1079
1014
|
}
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
// Ne restaurer le focus que si c'était une action manuelle
|
|
1092
|
-
if (timer === undefined || this.autohideTimers.has(toastId) === false) {
|
|
1093
|
-
this.triggeringElement?.focus();
|
|
1015
|
+
/**
|
|
1016
|
+
* Retire un toast.
|
|
1017
|
+
* - Action manuelle (clic sur la croix) : restaure le focus sur l'élément déclencheur (par défaut).
|
|
1018
|
+
* - Autohide depuis cw-toast-item : passer { restoreFocus: false } pour ne pas faire sauter le focus utilisateur.
|
|
1019
|
+
*/
|
|
1020
|
+
remove(toast, opts = { restoreFocus: true }) {
|
|
1021
|
+
this.toasts.update(arr => arr.filter(t => t.id !== toast.id));
|
|
1022
|
+
const triggeringElement = this.triggeringElements.get(toast.id);
|
|
1023
|
+
this.triggeringElements.delete(toast.id);
|
|
1024
|
+
if (opts.restoreFocus) {
|
|
1025
|
+
triggeringElement?.focus();
|
|
1094
1026
|
}
|
|
1095
1027
|
}
|
|
1096
1028
|
clear() {
|
|
1097
|
-
|
|
1098
|
-
this.
|
|
1099
|
-
this.autohideTimers.clear();
|
|
1100
|
-
this.toasts = [];
|
|
1029
|
+
this.triggeringElements.clear();
|
|
1030
|
+
this.toasts.set([]);
|
|
1101
1031
|
}
|
|
1102
1032
|
canShowMessage(message) {
|
|
1103
1033
|
if (!this.lastToast) {
|
|
@@ -1123,16 +1053,134 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.19", ngImpo
|
|
|
1123
1053
|
args: [{ providedIn: 'root' }]
|
|
1124
1054
|
}] });
|
|
1125
1055
|
|
|
1056
|
+
class ToastItemComponent {
|
|
1057
|
+
constructor() {
|
|
1058
|
+
this.toastService = inject(ToastService);
|
|
1059
|
+
this.elRef = inject((ElementRef));
|
|
1060
|
+
this.zone = inject(NgZone);
|
|
1061
|
+
this.toast = input.required(...(ngDevMode ? [{ debugName: "toast" }] : []));
|
|
1062
|
+
this.action = output();
|
|
1063
|
+
this.progress = signal(100, ...(ngDevMode ? [{ debugName: "progress" }] : []));
|
|
1064
|
+
this.rafId = null;
|
|
1065
|
+
this.startTime = 0;
|
|
1066
|
+
this.remaining = TOAST_AUTOHIDE_DELAY_MS;
|
|
1067
|
+
this.isHovered = false;
|
|
1068
|
+
this.isFocused = false;
|
|
1069
|
+
}
|
|
1070
|
+
ngOnInit() {
|
|
1071
|
+
if (this.toast().autohide) {
|
|
1072
|
+
this.startTimer();
|
|
1073
|
+
}
|
|
1074
|
+
}
|
|
1075
|
+
ngOnDestroy() {
|
|
1076
|
+
this.cancelRaf();
|
|
1077
|
+
}
|
|
1078
|
+
onMouseEnter() {
|
|
1079
|
+
this.isHovered = true;
|
|
1080
|
+
this.updatePauseState();
|
|
1081
|
+
}
|
|
1082
|
+
onMouseLeave() {
|
|
1083
|
+
this.isHovered = false;
|
|
1084
|
+
this.updatePauseState();
|
|
1085
|
+
}
|
|
1086
|
+
onFocusIn() {
|
|
1087
|
+
this.isFocused = true;
|
|
1088
|
+
this.updatePauseState();
|
|
1089
|
+
}
|
|
1090
|
+
onFocusOut(event) {
|
|
1091
|
+
// Le focus passe d'un enfant à un autre du même toast → on reste focused.
|
|
1092
|
+
if (this.elRef.nativeElement.contains(event.relatedTarget)) {
|
|
1093
|
+
return;
|
|
1094
|
+
}
|
|
1095
|
+
this.isFocused = false;
|
|
1096
|
+
this.updatePauseState();
|
|
1097
|
+
}
|
|
1098
|
+
onAction() {
|
|
1099
|
+
const action = this.toast().action;
|
|
1100
|
+
if (action) {
|
|
1101
|
+
this.action.emit(action);
|
|
1102
|
+
}
|
|
1103
|
+
}
|
|
1104
|
+
onClose() {
|
|
1105
|
+
this.toastService.remove(this.toast());
|
|
1106
|
+
}
|
|
1107
|
+
updatePauseState() {
|
|
1108
|
+
if (!this.toast().autohide)
|
|
1109
|
+
return;
|
|
1110
|
+
const shouldPause = this.isHovered || this.isFocused;
|
|
1111
|
+
if (shouldPause) {
|
|
1112
|
+
this.pauseTimer();
|
|
1113
|
+
}
|
|
1114
|
+
else {
|
|
1115
|
+
this.resumeTimer();
|
|
1116
|
+
}
|
|
1117
|
+
}
|
|
1118
|
+
startTimer() {
|
|
1119
|
+
this.startTime = performance.now();
|
|
1120
|
+
this.zone.runOutsideAngular(() => {
|
|
1121
|
+
const tick = () => {
|
|
1122
|
+
const elapsed = performance.now() - this.startTime;
|
|
1123
|
+
const current = Math.max(0, this.remaining - elapsed);
|
|
1124
|
+
this.progress.set((current / TOAST_AUTOHIDE_DELAY_MS) * 100);
|
|
1125
|
+
if (current <= 0) {
|
|
1126
|
+
this.rafId = null;
|
|
1127
|
+
this.zone.run(() => this.toastService.remove(this.toast(), { restoreFocus: false }));
|
|
1128
|
+
return;
|
|
1129
|
+
}
|
|
1130
|
+
this.rafId = requestAnimationFrame(tick);
|
|
1131
|
+
};
|
|
1132
|
+
this.rafId = requestAnimationFrame(tick);
|
|
1133
|
+
});
|
|
1134
|
+
}
|
|
1135
|
+
pauseTimer() {
|
|
1136
|
+
if (this.rafId === null)
|
|
1137
|
+
return;
|
|
1138
|
+
const elapsed = performance.now() - this.startTime;
|
|
1139
|
+
this.remaining = Math.max(0, this.remaining - elapsed);
|
|
1140
|
+
this.cancelRaf();
|
|
1141
|
+
}
|
|
1142
|
+
resumeTimer() {
|
|
1143
|
+
if (this.rafId !== null)
|
|
1144
|
+
return;
|
|
1145
|
+
if (this.remaining <= 0)
|
|
1146
|
+
return;
|
|
1147
|
+
this.startTimer();
|
|
1148
|
+
}
|
|
1149
|
+
cancelRaf() {
|
|
1150
|
+
if (this.rafId !== null) {
|
|
1151
|
+
cancelAnimationFrame(this.rafId);
|
|
1152
|
+
this.rafId = null;
|
|
1153
|
+
}
|
|
1154
|
+
}
|
|
1155
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.19", ngImport: i0, type: ToastItemComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1156
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.19", type: ToastItemComponent, isStandalone: true, selector: "cw-toast-item", inputs: { toast: { classPropertyName: "toast", publicName: "toast", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { action: "action" }, host: { listeners: { "mouseenter": "onMouseEnter()", "mouseleave": "onMouseLeave()", "focusin": "onFocusIn()", "focusout": "onFocusOut($event)" } }, ngImport: i0, template: "<cw-alert\n [type]=\"toast().type\"\n [isDismissible]=\"true\"\n [title]=\"toast().title | translate\"\n (close)=\"onClose()\"\n [dataTest]=\"'toast-' + toast().type\">\n <span [innerHTML]=\"toast().message | translate\"></span> \n @if (toast().action; as action) {\n <a href=\"javascript:void(0);\" (click)=\"onAction()\" class=\"alert-link\">{{ action.label }}</a>\n }\n</cw-alert>\n\n@if (toast().autohide) {\n <div class=\"toast-progress\" [style.width.%]=\"progress()\"></div>\n}\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "component", type: AlertComponent, selector: "cw-alert", inputs: ["type", "title", "isDismissible", "cssClass", "dataTest"], outputs: ["close"] }, { kind: "pipe", type: TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
1157
|
+
}
|
|
1158
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.19", ngImport: i0, type: ToastItemComponent, decorators: [{
|
|
1159
|
+
type: Component,
|
|
1160
|
+
args: [{ selector: 'cw-toast-item', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, imports: [CommonModule, AlertComponent, TranslatePipe], template: "<cw-alert\n [type]=\"toast().type\"\n [isDismissible]=\"true\"\n [title]=\"toast().title | translate\"\n (close)=\"onClose()\"\n [dataTest]=\"'toast-' + toast().type\">\n <span [innerHTML]=\"toast().message | translate\"></span> \n @if (toast().action; as action) {\n <a href=\"javascript:void(0);\" (click)=\"onAction()\" class=\"alert-link\">{{ action.label }}</a>\n }\n</cw-alert>\n\n@if (toast().autohide) {\n <div class=\"toast-progress\" [style.width.%]=\"progress()\"></div>\n}\n" }]
|
|
1161
|
+
}], propDecorators: { toast: [{ type: i0.Input, args: [{ isSignal: true, alias: "toast", required: true }] }], action: [{ type: i0.Output, args: ["action"] }], onMouseEnter: [{
|
|
1162
|
+
type: HostListener,
|
|
1163
|
+
args: ['mouseenter']
|
|
1164
|
+
}], onMouseLeave: [{
|
|
1165
|
+
type: HostListener,
|
|
1166
|
+
args: ['mouseleave']
|
|
1167
|
+
}], onFocusIn: [{
|
|
1168
|
+
type: HostListener,
|
|
1169
|
+
args: ['focusin']
|
|
1170
|
+
}], onFocusOut: [{
|
|
1171
|
+
type: HostListener,
|
|
1172
|
+
args: ['focusout', ['$event']]
|
|
1173
|
+
}] } });
|
|
1174
|
+
|
|
1126
1175
|
class ToastComponent {
|
|
1127
1176
|
constructor() {
|
|
1128
1177
|
this.toastService = inject(ToastService);
|
|
1129
1178
|
this.elRef = inject(ElementRef);
|
|
1130
|
-
this.action =
|
|
1131
|
-
this.closed = new EventEmitter();
|
|
1179
|
+
this.action = output();
|
|
1132
1180
|
}
|
|
1133
1181
|
ngAfterViewInit() {
|
|
1134
1182
|
const elemPosition = this.elRef.nativeElement.getBoundingClientRect();
|
|
1135
|
-
document.addEventListener("scroll", (
|
|
1183
|
+
document.addEventListener("scroll", () => {
|
|
1136
1184
|
if (window.scrollY >= elemPosition.top * 2) {
|
|
1137
1185
|
this.elRef.nativeElement.classList.remove('is-absolute');
|
|
1138
1186
|
}
|
|
@@ -1141,29 +1189,13 @@ class ToastComponent {
|
|
|
1141
1189
|
}
|
|
1142
1190
|
});
|
|
1143
1191
|
}
|
|
1144
|
-
onAction(toast) {
|
|
1145
|
-
if (!toast?.action) {
|
|
1146
|
-
return;
|
|
1147
|
-
}
|
|
1148
|
-
this.action.emit(toast.action);
|
|
1149
|
-
}
|
|
1150
|
-
close() {
|
|
1151
|
-
this.closed.emit();
|
|
1152
|
-
}
|
|
1153
1192
|
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"
|
|
1193
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.19", type: ToastComponent, isStandalone: true, selector: "cw-toast", outputs: { action: "action" }, host: { properties: { "class.toast": "true" } }, ngImport: i0, template: "@for (toast of toastService.toasts(); track toast.id) {\n <cw-toast-item [toast]=\"toast\" (action)=\"action.emit($event)\"></cw-toast-item>\n}\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "component", type: ToastItemComponent, selector: "cw-toast-item", inputs: ["toast"], outputs: ["action"] }] }); }
|
|
1155
1194
|
}
|
|
1156
1195
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.19", ngImport: i0, type: ToastComponent, decorators: [{
|
|
1157
1196
|
type: Component,
|
|
1158
|
-
args: [{ selector: 'cw-toast', standalone: true, imports: [
|
|
1159
|
-
|
|
1160
|
-
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
|
-
}] } });
|
|
1197
|
+
args: [{ selector: 'cw-toast', standalone: true, imports: [CommonModule, ToastItemComponent], host: { '[class.toast]': 'true' }, template: "@for (toast of toastService.toasts(); track toast.id) {\n <cw-toast-item [toast]=\"toast\" (action)=\"action.emit($event)\"></cw-toast-item>\n}\n" }]
|
|
1198
|
+
}], propDecorators: { action: [{ type: i0.Output, args: ["action"] }] } });
|
|
1167
1199
|
|
|
1168
1200
|
var BadgeTypeEnum;
|
|
1169
1201
|
(function (BadgeTypeEnum) {
|
|
@@ -1191,37 +1223,27 @@ var BadgePositionEnum;
|
|
|
1191
1223
|
})(BadgePositionEnum || (BadgePositionEnum = {}));
|
|
1192
1224
|
|
|
1193
1225
|
class BadgeComponent {
|
|
1194
|
-
get hostClasses() {
|
|
1195
|
-
return this.skeletonMode ? 'skeleton badge' : '';
|
|
1196
|
-
}
|
|
1197
1226
|
constructor() {
|
|
1198
1227
|
this.badgePositionEnum = BadgePositionEnum;
|
|
1199
|
-
this.
|
|
1200
|
-
this.
|
|
1201
|
-
this.
|
|
1228
|
+
this.type = input.required(...(ngDevMode ? [{ debugName: "type" }] : []));
|
|
1229
|
+
this.label = input(...(ngDevMode ? [undefined, { debugName: "label" }] : []));
|
|
1230
|
+
this.withIcon = input(...(ngDevMode ? [undefined, { debugName: "withIcon" }] : []));
|
|
1231
|
+
this.iconPosition = input(BadgePositionEnum.left, ...(ngDevMode ? [{ debugName: "iconPosition" }] : []));
|
|
1232
|
+
this.cssClass = input('', ...(ngDevMode ? [{ debugName: "cssClass" }] : []));
|
|
1233
|
+
this.skeletonMode = input(false, ...(ngDevMode ? [{ debugName: "skeletonMode" }] : []));
|
|
1234
|
+
this.dataTest = input(...(ngDevMode ? [undefined, { debugName: "dataTest" }] : []));
|
|
1202
1235
|
this.iconSizeEnum = IconSizeEnum;
|
|
1203
1236
|
}
|
|
1237
|
+
get hostClasses() {
|
|
1238
|
+
return this.skeletonMode() ? 'skeleton badge' : '';
|
|
1239
|
+
}
|
|
1204
1240
|
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\">\
|
|
1241
|
+
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
1242
|
}
|
|
1207
1243
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.19", ngImport: i0, type: BadgeComponent, decorators: [{
|
|
1208
1244
|
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: [{
|
|
1245
|
+
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" }]
|
|
1246
|
+
}], 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
1247
|
type: HostBinding,
|
|
1226
1248
|
args: ['class']
|
|
1227
1249
|
}] } });
|
|
@@ -1810,6 +1832,13 @@ class FormFieldComponent {
|
|
|
1810
1832
|
this.skeletonMode = false;
|
|
1811
1833
|
this.clearable = true;
|
|
1812
1834
|
this.appendTo = 'body';
|
|
1835
|
+
/**
|
|
1836
|
+
* Force l'état HTML natif `indeterminate` sur l'input checkbox (3ème état visuel,
|
|
1837
|
+
* carré barré). Indépendant de `value` du FormControl. Ignoré pour les types
|
|
1838
|
+
* autres que checkbox / checkboxInline / checkboxButton.
|
|
1839
|
+
*/
|
|
1840
|
+
this.indeterminate = input(false, ...(ngDevMode ? [{ debugName: "indeterminate" }] : []));
|
|
1841
|
+
this.checkboxInputRef = viewChild('checkboxInput', ...(ngDevMode ? [{ debugName: "checkboxInputRef" }] : []));
|
|
1813
1842
|
this.refreshEvent = new EventEmitter();
|
|
1814
1843
|
this.textChanged = new EventEmitter();
|
|
1815
1844
|
this.valueChange = new EventEmitter();
|
|
@@ -1817,6 +1846,22 @@ class FormFieldComponent {
|
|
|
1817
1846
|
this.spriteIcon = SpriteIconEnum;
|
|
1818
1847
|
this.buttonType = FoButtonTypeEnum && BoButtonTypeEnum;
|
|
1819
1848
|
this.buttonIconSize = ButtonIconSizeEnum;
|
|
1849
|
+
effect(() => {
|
|
1850
|
+
const indeterminateValue = this.indeterminate();
|
|
1851
|
+
const ref = this.checkboxInputRef();
|
|
1852
|
+
if (ref && this.isCheckboxType()) {
|
|
1853
|
+
ref.nativeElement.indeterminate = indeterminateValue;
|
|
1854
|
+
}
|
|
1855
|
+
});
|
|
1856
|
+
}
|
|
1857
|
+
isCheckboxType() {
|
|
1858
|
+
return this.type === this.typeField.checkbox
|
|
1859
|
+
|| this.type === this.typeField.checkboxInline
|
|
1860
|
+
|| this.type === this.typeField.checkboxButton;
|
|
1861
|
+
}
|
|
1862
|
+
isSingleCheckbox() {
|
|
1863
|
+
return (this.type === this.typeField.checkbox || this.type === this.typeField.checkboxInline)
|
|
1864
|
+
&& (!this.options || this.options.length === 0);
|
|
1820
1865
|
}
|
|
1821
1866
|
get isRange() {
|
|
1822
1867
|
if (!this.control)
|
|
@@ -1831,6 +1876,14 @@ class FormFieldComponent {
|
|
|
1831
1876
|
get controlOrGroup() {
|
|
1832
1877
|
return this.control ?? this.formGroup?.get(this.name);
|
|
1833
1878
|
}
|
|
1879
|
+
/**
|
|
1880
|
+
* `true` si le champ doit être désactivé visuellement et fonctionnellement.
|
|
1881
|
+
* Union entre l'input explicite `isDisabled` et l'état `disabled` du FormControl/FormGroup lié,
|
|
1882
|
+
* pour que `control.disable()` ne soit pas écrasé par le binding du template.
|
|
1883
|
+
*/
|
|
1884
|
+
get isEffectivelyDisabled() {
|
|
1885
|
+
return !!this.isDisabled || !!this.controlOrGroup?.disabled;
|
|
1886
|
+
}
|
|
1834
1887
|
ngOnInit() {
|
|
1835
1888
|
if (this.formGroup && this.name) {
|
|
1836
1889
|
const group = this.formGroup.get(this.name);
|
|
@@ -1968,7 +2021,7 @@ class FormFieldComponent {
|
|
|
1968
2021
|
this.formControl.markAsTouched();
|
|
1969
2022
|
}
|
|
1970
2023
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.19", ngImport: i0, type: FormFieldComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1971
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.19", type: FormFieldComponent, isStandalone: true, selector: "cw-form-field", inputs: { control: "control", formGroup: "formGroup", type: "type", label: "label", displayLabel: "displayLabel", name: "name", placeholder: "placeholder", options: "options", rangeOptions: "rangeOptions", isRequired: "isRequired", help: "help", tooltip: "tooltip", addonLeft: "addonLeft", addonRight: "addonRight", isInAddon: "isInAddon", isReadonly: "isReadonly", isDisabled: "isDisabled", sliderValue: "sliderValue", sliderOptions: "sliderOptions", cssClass: "cssClass", skeletonMode: "skeletonMode", clearable: "clearable", appendTo: "appendTo" }, outputs: { refreshEvent: "refreshEvent", textChanged: "textChanged", valueChange: "valueChange" }, host: { properties: { "class": "this.hostClasses" } }, queries: [{ propertyName: "optionTemplate", first: true, predicate: ["ngOptionTpl"], descendants: true, read: TemplateRef }, { propertyName: "labelTemplate", first: true, predicate: ["ngLabelTpl"], descendants: true, read: TemplateRef }], usesOnChanges: true, ngImport: i0, template: "@if (!isInAddon) {\r\n @if (\r\n type !== typeField.checkbox &&\r\n type !== typeField.radio &&\r\n type !== typeField.checkboxButton &&\r\n type !== typeField.radioButton &&\r\n type !== typeField.checkboxInline &&\r\n type !== typeField.radioInline &&\r\n type !== typeField.switch &&\r\n type !== typeField.range &&\r\n type !== typeField.switchSmall\r\n ) {\r\n <label [for]=\"name\" class=\"field-label\" [class.visually-hidden]=\"!displayLabel\">\r\n {{ label | translate }}\r\n\r\n @if (isRequired) {\r\n <span class=\"text-danger\">*</span>\r\n }\r\n\r\n @if (tooltip) {\r\n <!-- <button type=\"button\" class=\"btn btn-link btn-popover\" placement=\"bottom\" [ngbPopover]=\"popContent\" container=\"body\"\r\n triggers=\"mouseenter:mouseleave\">\r\n <span class=\"btn-popover-icon bo-icons bo-help\"></span>\r\n </button>\r\n <ng-template #popContent>\r\n <div [innerHTML]=\"tooltip\"></div>\r\n </ng-template> -->\r\n }\r\n </label>\r\n }\r\n\r\n @if (addonLeft || addonRight) {\r\n <div class=\"field-group\">\r\n @if(addonLeft) {\r\n <ng-container [ngTemplateOutlet]=\"addonLeft\"></ng-container>\r\n }\r\n <ng-container [ngTemplateOutlet]=\"field\"></ng-container>\r\n @if(addonRight) {\r\n <ng-container [ngTemplateOutlet]=\"addonRight\"></ng-container>\r\n }\r\n </div>\r\n }\r\n @else {\r\n @if ( isInInputGroup() ) {\r\n <div class=\"field-group\">\r\n <ng-container [ngTemplateOutlet]=\"field\"></ng-container>\r\n </div>\r\n }\r\n @else {\r\n <ng-container [ngTemplateOutlet]=\"field\"></ng-container>\r\n }\r\n }\r\n\r\n <!-- Error message -->\r\n @if (controlOrGroup?.invalid && controlOrGroup?.touched) {\r\n <div class=\"field-invalid\" [id]=\"'error-' + name\">\r\n @if ((controlOrGroup?.errors?.['required']) || (getControl('start')?.errors?.['required'] || getControl('end')?.errors?.['required'])) {\r\n <span [innerHtml]=\"'_COMMON._FORM.ERROR_IS_MANDATORY' | translate: {label: label | translate}\"></span>\r\n }\r\n @if(controlOrGroup?.errors?.['rangeInvalid']) {\r\n <span>{{'_COMMON._DATES.ERROR_START_END_PERIOD' | translate}}</span>\r\n }\r\n </div>\r\n }\r\n\r\n @if (help) {\r\n <div [id]=\"name + '-help'\" class=\"field-text\">{{help | translate}}</div>\r\n }\r\n}\r\n@else {\r\n <ng-container [ngTemplateOutlet]=\"field\"></ng-container>\r\n}\r\n\r\n<ng-template #field>\r\n <!-- Text -->\r\n @if ([typeField.text, typeField.date, typeField.time, typeField.dateTime, typeField.number, typeField.file,\r\n typeField.email,\r\n typeField.color].includes(type)) {\r\n <input [type]=\"type\" class=\"field-control\" [id]=\"name\" [formControl]=\"formControl\"\r\n [ngClass]=\"[(cssClass || ''), formControl?.value ? 'has-value' : '']\"\r\n [attr.placeholder]=\"placeholder ? (placeholder | translate) : null\" [attr.required]=\"isRequired ? 'required' : null\"\r\n [attr.readonly]=\"isReadonly ? 'readonly' : null\" [disabled]=\"isDisabled\" [attr.aria-required]=\"isRequired\"\r\n [attr.aria-invalid]=\"control.invalid && control.touched\"\r\n [attr.aria-describedby]=\"control.invalid && control.touched ? 'error-' + name : null\" />\r\n }\r\n\r\n @if (type === typeField.password) {\r\n <input showHidePassword [type]=\"type\" class=\"field-control\" [id]=\"name\" [formControl]=\"formControl\"\r\n [ngClass]=\"[(cssClass || ''), formControl?.value ? 'has-value' : '']\"\r\n [attr.required]=\"isRequired ? 'required' : null\" [attr.readonly]=\"isReadonly ? 'readonly' : null\"\r\n [attr.disabled]=\"isDisabled ? 'disabled' : null\" [attr.aria-required]=\"isRequired\"\r\n [attr.aria-invalid]=\"control.invalid && control.touched\"\r\n [attr.aria-describedby]=\"control.invalid && control.touched ? 'error-' + name : null\" />\r\n }\r\n\r\n <!-- Textarea -->\r\n @if (type === typeField.textarea) {\r\n <textarea class=\"field-control\" [id]=\"name\" [formControl]=\"formControl\"\r\n [ngClass]=\"[(cssClass || ''), formControl?.value ? 'has-value' : '']\"\r\n [attr.placeholder]=\"placeholder ? (placeholder | translate) : null\" [attr.required]=\"isRequired ? 'required' : null\"\r\n [attr.readonly]=\"isReadonly ? 'readonly' : null\" [attr.disabled]=\"isDisabled ? 'disabled' : null\"\r\n [attr.aria-required]=\"isRequired\" [attr.aria-invalid]=\"control.invalid && control.touched\"\r\n [attr.aria-describedby]=\"control.invalid && control.touched ? 'error-' + name : null\"></textarea>\r\n }\r\n\r\n <!-- Select -->\r\n @if (type === typeField.select) {\r\n <ng-select [formControl]=\"formControl\" [items]=\"options\" bindLabel=\"label\" [labelForId]=\"name\" [appendTo]=\"appendTo\" bindValue=\"value\"\r\n [ngClass]=\"cssClass\" [searchable]=\"false\" [placeholder]=\"placeholder ? (placeholder | translate) : null\" [readonly]=\"isReadonly\" [clearable]=\"false\"\r\n [attr.disabled]=\"isDisabled ? 'disabled' : null\" [attr.required]=\"isRequired ? 'required' : null\"\r\n [attr.aria-required]=\"isRequired\" [attr.aria-invalid]=\"control.invalid && control.touched\"\r\n [attr.aria-describedby]=\"control.invalid && control.touched ? 'error-' + name : null\" [attr.id]=\"name\"\r\n (blur)=\"onBlur()\">\r\n\r\n <!-- Template pour les options -->\r\n <ng-template ng-option-tmp let-item=\"item\" let-index=\"index\" let-search=\"searchTerm\">\r\n @if (optionTemplate) {\r\n <ng-container *ngTemplateOutlet=\"optionTemplate; context: { item: item | translate, index: index, searchTerm: search }\"></ng-container>\r\n }\r\n @else {\r\n <div>{{ item.label | translate }}</div>\r\n }\r\n </ng-template>\r\n\r\n <!-- Template pour le label -->\r\n <ng-template ng-label-tmp let-item=\"item\">\r\n @if (labelTemplate) {\r\n <ng-container *ngTemplateOutlet=\"labelTemplate; context: { item: item | translate }\"></ng-container>\r\n }\r\n @else {\r\n {{ (item.label | translate) || (placeholder | translate) }}\r\n }\r\n </ng-template>\r\n </ng-select>\r\n }\r\n\r\n <!-- NgSelect -->\r\n @if (type === typeField.ngSelect || type === typeField.ngSelectMultiple) {\r\n <ng-select [formControl]=\"formControl\" [items]=\"options\" bindLabel=\"label\" [labelForId]=\"name\" [appendTo]=\"appendTo\" bindValue=\"value\"\r\n [multiple]=\"type === typeField.ngSelectMultiple\" [ngClass]=\"cssClass\" [clearable]=\"false\"\r\n [placeholder]=\"placeholder ? (placeholder | translate) : null\" [readonly]=\"isReadonly\"\r\n [notFoundText]=\"'_COMMON.NO_RESULT' | translate\" [attr.disabled]=\"isDisabled ? 'disabled' : null\"\r\n [attr.required]=\"isRequired ? 'required' : null\" [attr.aria-required]=\"isRequired\"\r\n [attr.aria-invalid]=\"control.invalid && control.touched\"\r\n [attr.aria-describedby]=\"control.invalid && control.touched ? 'error-' + name : null\" [attr.id]=\"name\"\r\n (blur)=\"onBlur()\" (search)=\"textChanged.emit($event?.term)\">\r\n\r\n <!-- Template pour les options -->\r\n <ng-template ng-option-tmp let-item=\"item\" let-index=\"index\" let-search=\"searchTerm\">\r\n @if (optionTemplate) {\r\n <ng-container *ngTemplateOutlet=\"optionTemplate; context: { item: item, index: index, searchTerm: search }\"></ng-container>\r\n }\r\n @else {\r\n <div>{{ item.label | translate }}</div>\r\n }\r\n </ng-template>\r\n\r\n <!-- Template pour le label -->\r\n <ng-template ng-label-tmp let-item=\"item\" let-clear=\"clear\">\r\n <span class=\"ng-value-icon left\" (click)=\"clear(item)\" aria-hidden=\"true\">\u00D7</span>\r\n @if (labelTemplate) {\r\n <ng-container *ngTemplateOutlet=\"labelTemplate; context: { item: item | translate }\"></ng-container>\r\n }\r\n @else {\r\n {{ (item.label | translate) || (placeholder | translate) }}\r\n }\r\n </ng-template>\r\n </ng-select>\r\n }\r\n\r\n <!-- Radio -->\r\n @if (type === typeField.radioInline || type === typeField.radio) {\r\n <fieldset\r\n [attr.aria-required]=\"isRequired\"\r\n [attr.aria-invalid]=\"control.invalid && control.touched\"\r\n [attr.aria-describedby]=\"control.invalid && control.touched ? 'error-' + name : null\">\r\n <legend class=\"field-label\" [class.visually-hidden]=\"!displayLabel\">\r\n {{label | translate}}\r\n @if(isRequired) {\r\n <span class=\"text-danger\">*</span>\r\n }\r\n </legend>\r\n <ul class=\"list-unstyled mb-none\" [ngClass]=\"type === typeField.radioInline ? 'd-flex-h gap-md flex-wrap' : 'd-flex-v'\">\r\n @for (opt of options; track opt.value) {\r\n <li class=\"field-check\">\r\n <input type=\"radio\" [id]=\"name + '_' + opt.value\" [value]=\"opt.value\" [formControl]=\"formControl\"\r\n class=\"field-check-input\" [attr.disabled]=\"isDisabled ? 'disabled' : null\" (change)=\"onRadioChange(opt.value)\" />\r\n <label [for]=\"name + '_' + opt.value\" class=\"field-check-label\">{{ opt.label | translate }}</label>\r\n </li>\r\n }\r\n </ul>\r\n </fieldset>\r\n }\r\n\r\n <!-- Radio button -->\r\n @if (type === typeField.radioButton) {\r\n <fieldset\r\n [attr.aria-required]=\"isRequired\"\r\n [attr.aria-invalid]=\"control.invalid && control.touched\"\r\n [attr.aria-describedby]=\"control.invalid && control.touched ? 'error-' + name : null\">\r\n <legend class=\"field-label\" [class.visually-hidden]=\"!displayLabel\">\r\n {{label | translate}}\r\n @if(isRequired) {\r\n <span class=\"text-danger\">*</span>\r\n }\r\n </legend>\r\n <div class=\"field-group field-group-btn\">\r\n @for (opt of options; track opt.value) {\r\n <input type=\"radio\" [id]=\"name + '_' + opt.value\" [value]=\"opt.value\" [formControl]=\"formControl\"\r\n class=\"visually-hidden\" [attr.disabled]=\"isDisabled ? 'disabled' : null\" (change)=\"onRadioChange(opt.value)\"/>\r\n <label [for]=\"name + '_' + opt.value\" class=\"btn btn-field-group\">{{ opt.label | translate }}</label>\r\n }\r\n </div>\r\n </fieldset>\r\n }\r\n\r\n <!-- Checkbox Switch -->\r\n @if ( type === typeField.switch || type === typeField.switchSmall)\r\n {\r\n <div class=\"field-check field-switch\" [ngClass]=\"{'field-switch-small': type === typeField.switchSmall}\">\r\n <input type=\"checkbox\" [id]=\"name\" [formControl]=\"formControl\" class=\"field-check-input\" [attr.aria-required]=\"isRequired\"\r\n [attr.aria-invalid]=\"control.invalid && control.touched\"\r\n [attr.aria-describedby]=\"control.invalid && control.touched ? 'error-' + name : null\"\r\n [attr.disabled]=\"isDisabled ? 'disabled' : null\"/>\r\n <label [for]=\"name\" class=\"field-check-label\">{{ label | translate }}</label>\r\n </div>\r\n }\r\n\r\n <!-- Checkbox -->\r\n @if (type === typeField.checkboxInline || type === typeField.checkbox) {\r\n @if( options.length > 1) {\r\n <fieldset\r\n [attr.aria-required]=\"isRequired\"\r\n [attr.aria-invalid]=\"control.invalid && control.touched\"\r\n [attr.aria-describedby]=\"control.invalid && control.touched ? 'error-' + name : null\"\r\n [ngClass]=\"{ 'flex-column': type === typeField.checkbox }\">\r\n <legend class=\"field-label\" [class.visually-hidden]=\"!displayLabel\">\r\n {{label | translate}}\r\n @if(isRequired) {\r\n <span class=\"text-danger\">*</span>\r\n }\r\n </legend>\r\n <ul class=\"list-unstyled mb-none\" [ngClass]=\"type === typeField.checkboxInline ? 'd-flex-h gap-md' : 'd-flex-v'\">\r\n @for (opt of options; track opt.value) {\r\n <li class=\"field-check\" [ngClass]=\"{ 'field-check-inline': type === typeField.checkboxInline }\">\r\n <input type=\"checkbox\" [id]=\"name + '_' + opt.value\" [value]=\"opt.value\" (change)=\"onCheckboxChange($event)\"\r\n [checked]=\"control.value?.includes(opt.value)\" class=\"field-check-input\"\r\n [attr.disabled]=\"isDisabled ? 'disabled' : null\" />\r\n <label [for]=\"name + '_' + opt.value\" class=\"field-check-label\">\r\n {{ opt.label | translate }}\r\n </label>\r\n </li>\r\n }\r\n </ul>\r\n </fieldset>\r\n }\r\n @else {\r\n <fieldset>\r\n <legend class=\"field-label\" [class.visually-hidden]=\"!displayLabel\">\r\n {{label | translate}}\r\n </legend>\r\n <ul class=\"list-unstyled mb-none\" [ngClass]=\"type === typeField.checkboxInline ? 'd-flex-h gap-md' : 'd-flex-v'\">\r\n @for (opt of options; track opt.value) {\r\n <li class=\"field-check\" [ngClass]=\"{ 'field-check-inline': type === typeField.checkboxInline }\">\r\n <input type=\"checkbox\" [id]=\"name + '_' + opt.value\" [value]=\"opt.value\" (change)=\"onCheckboxChange($event)\"\r\n [checked]=\"control.value?.includes(opt.value)\" class=\"field-check-input\"\r\n [attr.aria-required]=\"isRequired\"\r\n [attr.aria-invalid]=\"control.invalid && control.touched\"\r\n [attr.aria-describedby]=\"control.invalid && control.touched ? 'error-' + name : null\"\r\n [attr.disabled]=\"isDisabled ? 'disabled' : null\" />\r\n <label [for]=\"name + '_' + opt.value\" class=\"field-check-label\">\r\n {{ opt.label | translate }}\r\n @if(isRequired) {\r\n <span class=\"text-danger\">*</span>\r\n }\r\n </label>\r\n </li>\r\n }\r\n </ul>\r\n </fieldset>\r\n }\r\n }\r\n\r\n <!-- Checkbox button -->\r\n @if (type === typeField.checkboxButton && options.length > 0) {\r\n\r\n @if(options.length > 1) {\r\n <fieldset\r\n [attr.aria-required]=\"isRequired\"\r\n [attr.aria-invalid]=\"control.invalid && control.touched\"\r\n [attr.aria-describedby]=\"control.invalid && control.touched ? 'error-' + name : null\">\r\n <legend class=\"field-label\" [class.visually-hidden]=\"!displayLabel\">\r\n {{label | translate}}\r\n @if(isRequired) {\r\n <span class=\"text-danger\">*</span>\r\n }\r\n </legend>\r\n <div class=\"field-group field-group-btn\">\r\n @for (opt of options; track opt.value) {\r\n <input type=\"checkbox\" [id]=\"name + '_' + opt.value\" [value]=\"opt.value\" (change)=\"onCheckboxChange($event)\"\r\n [checked]=\"control.value?.includes(opt.value)\" class=\"visually-hidden\"\r\n [attr.disabled]=\"isDisabled ? 'disabled' : null\" />\r\n <label [for]=\"name + '_' + opt.value\" class=\"btn btn-field-group\">{{ opt.label | translate }}</label>\r\n }\r\n </div>\r\n </fieldset>\r\n }\r\n @else {\r\n <fieldset>\r\n <legend class=\"field-label\" [class.visually-hidden]=\"!displayLabel\">\r\n {{label | translate}}\r\n </legend>\r\n <div class=\"btn-group btn-group-secondary\">\r\n @for (opt of options; track opt.value) {\r\n <input type=\"checkbox\" [id]=\"name + '_' + opt.value\" [value]=\"opt.value\" (change)=\"onCheckboxChange($event)\"\r\n [checked]=\"control.value?.includes(opt.value)\" class=\"visually-hidden\"\r\n [attr.aria-required]=\"isRequired\"\r\n [attr.aria-invalid]=\"control.invalid && control.touched\"\r\n [attr.aria-describedby]=\"control.invalid && control.touched ? 'error-' + name : null\"\r\n [attr.disabled]=\"isDisabled ? 'disabled' : null\"/>\r\n <label [for]=\"name + '_' + opt.value\" class=\"btn btn-field-group\">\r\n {{ opt.label | translate}}\r\n @if(isRequired) {\r\n <span class=\"text-danger\">*</span>\r\n }\r\n </label>\r\n }\r\n </div>\r\n </fieldset>\r\n }\r\n }\r\n\r\n <!-- Period - DateToDate / TimeToTime / DateTimeToDateTime -->\r\n @if ([typeField.dateToDate, typeField.timeToTime, typeField.dateTimeToDateTime].includes(type) && isRange) {\r\n\r\n <div class=\"field-group\">\r\n <input [type]=\"getInputType()\" class=\"field-control\" [id]=\"name + '_start'\" [formControl]=\"getControl('start')\"\r\n [attr.placeholder]=\"type === typeField.timeToTime ? ('_COMMON._DATES.FROM' | translate) : ('_COMMON._DATES.FROM_TO_1' | translate)\"\r\n [ngClass]=\"[(cssClass || ''), getControl('start')?.value ? 'has-value' : '']\"\r\n [attr.required]=\"isRequired ? 'required' : null\" [attr.readonly]=\"isReadonly ? 'readonly' : null\"\r\n [attr.disabled]=\"isDisabled ? 'disabled' : null\" [attr.aria-required]=\"isRequired\"\r\n [attr.aria-invalid]=\"getControl('start')?.invalid && getControl('start')?.touched\"\r\n [attr.aria-describedby]=\"getControl('start')?.invalid && getControl('start')?.touched ? 'error-' + name : null\" />\r\n\r\n @if(getControl('start')?.value) {\r\n <button type=\"button\" class=\"btn btn-secondary btn-clear-field\"\r\n (click)=\"onClearFieldPeriod('start')\">\r\n ×\r\n </button>\r\n }\r\n\r\n <input [type]=\"getInputType()\" class=\"field-control\" [id]=\"name + '_end'\" [formControl]=\"getControl('end')\"\r\n [attr.placeholder]=\"type === typeField.timeToTime ? ('_COMMON._DATES.TO' | translate) : ('_COMMON._DATES.FROM_TO_2' | translate)\"\r\n [ngClass]=\"[(cssClass || ''), getControl('end')?.value ? 'has-value' : '']\"\r\n [attr.required]=\"isRequired ? 'required' : null\" [attr.readonly]=\"isReadonly ? 'readonly' : null\"\r\n [attr.disabled]=\"isDisabled ? 'disabled' : null\"\r\n [attr.aria-invalid]=\"getControl('end')?.invalid && getControl('end')?.touched\"\r\n [attr.aria-describedby]=\"getControl('end')?.invalid && getControl('end')?.touched ? 'error-' + name : null\" />\r\n\r\n @if(getControl('end')?.value) {\r\n <button type=\"button\" class=\"btn btn-secondary btn-clear-field\"\r\n (click)=\"onClearFieldPeriod('end')\">\r\n ×\r\n </button>\r\n }\r\n </div>\r\n }\r\n\r\n @if ([typeField.datePlusOne, typeField.datePlusTwo, typeField.datePlusSeven, typeField.dateComplexe].includes(type)) {\r\n\r\n @if (type === typeField.dateComplexe) {\r\n <button class=\"btn btn-secondary\" type=\"button\" (click)=\"onDateAddDay('prev')\"\r\n [attr.disabled]=\"isDisabled ? 'disabled' : null\">\r\n <cw-icon font=\"optyweb\" [icon]=\"spriteIcon.nextLeft\" [label]=\"'Jour pr\u00E9c\u00E9dent'\"></cw-icon>\r\n </button>\r\n }\r\n\r\n <input type=\"date\" class=\"field-control\" [id]=\"name\" [formControl]=\"formControl\"\r\n [ngClass]=\"[(cssClass || ''), formControl?.value ? 'has-value' : '']\"\r\n [attr.placeholder]=\"placeholder ? placeholder : null\" [attr.required]=\"isRequired ? 'required' : null\"\r\n [attr.readonly]=\"isReadonly ? 'readonly' : null\" [disabled]=\"isDisabled\" [attr.aria-required]=\"isRequired\"\r\n [attr.aria-invalid]=\"control.invalid && control.touched\"\r\n [attr.aria-describedby]=\"control.invalid && control.touched ? 'error-' + name : null\" />\r\n\r\n @if(formControl?.value) {\r\n <button class=\"btn btn-secondary btn-clear-field\" type=\"button\"\r\n (click)=\"onClearField(formControl)\">×</button>\r\n }\r\n\r\n @if (type === typeField.dateComplexe) {\r\n <button class=\"btn btn-secondary\" type=\"button\" (click)=\"onDateAddDay('next')\"\r\n [attr.disabled]=\"isDisabled ? 'disabled' : null\">\r\n <cw-icon font=\"optyweb\" [icon]=\"spriteIcon.nextRight\" [label]=\"'Jour suivant'\"></cw-icon>\r\n </button>\r\n <button class=\"btn btn-secondary\" type=\"button\" (click)=\"onRefresh()\"\r\n [attr.disabled]=\"isDisabled ? 'disabled' : null\">\r\n <cw-icon font=\"optyweb\" [icon]=\"spriteIcon.toolbarRefresh\" [label]=\"'Rafra\u00EEchir'\"></cw-icon>\r\n </button>\r\n }\r\n\r\n <button class=\"btn btn-secondary\" type=\"button\" (click)=\"onTodayAddDay(0)\"\r\n [attr.disabled]=\"isDisabled ? 'disabled' : null\">\r\n J\r\n <span class=\"visually-hidden\">Aujourd'hui</span>\r\n </button>\r\n <button class=\"btn btn-secondary\" type=\"button\" (click)=\"onTodayAddDay(1)\"\r\n [attr.disabled]=\"isDisabled ? 'disabled' : null\">\r\n J+1\r\n <span class=\"visually-hidden\">Demain</span>\r\n </button>\r\n\r\n @if (type !== typeField.datePlusOne && type !== typeField.dateComplexe) {\r\n <button class=\"btn btn-secondary \" type=\"button\" (click)=\"onTodayAddDay(2)\"\r\n [attr.disabled]=\"isDisabled ? 'disabled' : null\">\r\n J+2\r\n <span class=\"visually-hidden\">Dans 2 jours</span>\r\n </button>\r\n\r\n @if (type !== typeField.datePlusTwo) {\r\n <button class=\"btn btn-secondary\" type=\"button\" (click)=\"onTodayAddDay(7)\"\r\n [attr.disabled]=\"isDisabled ? 'disabled' : null\">\r\n J+7\r\n <span class=\"visually-hidden\">Dans 7 jours</span>\r\n </button>\r\n }\r\n }\r\n }\r\n\r\n @if (type === typeField.slider) {\r\n <ngx-slider [(value)]=\"sliderValue\" [options]=\"sliderOptions\" [formControl]=\"formControl\"></ngx-slider>\r\n }\r\n\r\n @if (type === typeField.range) {\r\n <div class=\"slider\">\r\n\r\n <cw-button [isDisabled]=\"formControl.value <= rangeOptions.floor\" [label]=\"'Diminuer ' + formControl.value + ' ' + label\"\r\n [withIcon]=\"spriteIcon.toolbarMinus\" [withOnlyIcon]=\"true\" [type]=\"buttonType.primary\"\r\n [iconSize]=\"buttonIconSize.small\" (btnAction)=\"onRangeStep('decrease')\">\r\n </cw-button>\r\n\r\n <div class=\"slider-input\">\r\n <label [for]=\"name\" class=\"slider-tooltip\" [style.left]=\"getRangePercent() + '%'\" aria-live=\"polite\"\r\n aria-atomic=\"true\">\r\n {{ label | translate }} {{ formControl.value }}\r\n @if (rangeOptions.unit) {\r\n <abbr [title]=\"rangeOptions.unit\">{{ rangeOptions.unit }}</abbr>\r\n }\r\n </label>\r\n\r\n <div class=\"slider-custom-bar\">\r\n <div class=\"slider-custom-bar-selection\" [style.width]=\"getRangePercent() + '%'\">\r\n </div>\r\n </div>\r\n\r\n <input type=\"range\" [id]=\"name\" [formControl]=\"formControl\" [min]=\"rangeOptions.floor\" [max]=\"rangeOptions.ceil\"\r\n [step]=\"rangeOptions.step || 1\" class=\"field-control-range\" [attr.aria-required]=\"isRequired\"\r\n [attr.aria-invalid]=\"control.invalid && control.touched\" [disabled]=\"isDisabled\">\r\n </div>\r\n\r\n <cw-button [isDisabled]=\"formControl.value >= rangeOptions.ceil\" [label]=\"'Augmenter ' + formControl.value + ' ' + label\"\r\n [withIcon]=\"spriteIcon.toolbarPlus\" [withOnlyIcon]=\"true\" [type]=\"buttonType.primary\"\r\n [iconSize]=\"buttonIconSize.small\" (btnAction)=\"onRangeStep('increase')\">\r\n </cw-button>\r\n </div>\r\n }\r\n\r\n @if (isInInputGroup() && clearable) {\r\n @if(formControl?.value) {\r\n <button class=\"btn btn-secondary btn-clear-field\" type=\"button\"\r\n (click)=\"onClearField(formControl)\">×</button>\r\n }\r\n }\r\n\r\n</ng-template>\r\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: "ngmodule", type: FormsModule }, { kind: "directive", type: i2$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2$1.RangeValueAccessor, selector: "input[type=range][formControlName],input[type=range][formControl],input[type=range][ngModel]" }, { kind: "directive", type: i2$1.CheckboxControlValueAccessor, selector: "input[type=checkbox][formControlName],input[type=checkbox][formControl],input[type=checkbox][ngModel]" }, { kind: "directive", type: i2$1.RadioControlValueAccessor, selector: "input[type=radio][formControlName],input[type=radio][formControl],input[type=radio][ngModel]", inputs: ["name", "formControlName", "value"] }, { kind: "directive", type: i2$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i2$1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "ngmodule", type: NgSelectModule }, { kind: "component", type: i3.NgSelectComponent, selector: "ng-select", inputs: ["ariaLabelDropdown", "bindLabel", "bindValue", "ariaLabel", "markFirst", "placeholder", "fixedPlaceholder", "notFoundText", "typeToSearchText", "preventToggleOnRightClick", "addTagText", "loadingText", "clearAllText", "appearance", "dropdownPosition", "appendTo", "loading", "closeOnSelect", "hideSelected", "selectOnTab", "openOnEnter", "maxSelectedItems", "groupBy", "groupValue", "bufferAmount", "virtualScroll", "selectableGroup", "selectableGroupAsModel", "searchFn", "trackByFn", "clearOnBackspace", "labelForId", "inputAttrs", "tabIndex", "tabFocusOnClearButton", "readonly", "searchWhileComposing", "minTermLength", "editableSearchTerm", "ngClass", "typeahead", "multiple", "addTag", "searchable", "clearable", "isOpen", "items", "compareWith", "clearSearchOnAdd", "deselectOnClick", "keyDownFn"], outputs: ["blur", "focus", "change", "open", "close", "search", "clear", "add", "remove", "scroll", "scrollToEnd"] }, { kind: "directive", type: i3.NgOptionTemplateDirective, selector: "[ng-option-tmp]" }, { kind: "directive", type: i3.NgLabelTemplateDirective, selector: "[ng-label-tmp]" }, { kind: "ngmodule", type: NgxSliderModule }, { kind: "component", type: i4.SliderComponent, selector: "ngx-slider", inputs: ["value", "highValue", "options", "manualRefresh", "triggerFocus", "cancelUserChange"], outputs: ["valueChange", "highValueChange", "userChangeStart", "userChange", "userChangeEnd"] }, { kind: "directive", type: ShowHidePasswordDirective, selector: "[showHidePassword]" }, { 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"] }, { kind: "pipe", type: i2.TranslatePipe, name: "translate" }] }); }
|
|
2024
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.19", type: FormFieldComponent, isStandalone: true, selector: "cw-form-field", inputs: { control: { classPropertyName: "control", publicName: "control", isSignal: false, isRequired: false, transformFunction: null }, formGroup: { classPropertyName: "formGroup", publicName: "formGroup", isSignal: false, isRequired: false, transformFunction: null }, type: { classPropertyName: "type", publicName: "type", isSignal: false, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: false, isRequired: false, transformFunction: null }, displayLabel: { classPropertyName: "displayLabel", publicName: "displayLabel", isSignal: false, isRequired: false, transformFunction: null }, name: { classPropertyName: "name", publicName: "name", isSignal: false, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: false, isRequired: false, transformFunction: null }, options: { classPropertyName: "options", publicName: "options", isSignal: false, isRequired: false, transformFunction: null }, rangeOptions: { classPropertyName: "rangeOptions", publicName: "rangeOptions", isSignal: false, isRequired: false, transformFunction: null }, isRequired: { classPropertyName: "isRequired", publicName: "isRequired", isSignal: false, isRequired: false, transformFunction: null }, help: { classPropertyName: "help", publicName: "help", isSignal: false, isRequired: false, transformFunction: null }, tooltip: { classPropertyName: "tooltip", publicName: "tooltip", isSignal: false, isRequired: false, transformFunction: null }, addonLeft: { classPropertyName: "addonLeft", publicName: "addonLeft", isSignal: false, isRequired: false, transformFunction: null }, addonRight: { classPropertyName: "addonRight", publicName: "addonRight", isSignal: false, isRequired: false, transformFunction: null }, isInAddon: { classPropertyName: "isInAddon", publicName: "isInAddon", isSignal: false, isRequired: false, transformFunction: null }, isReadonly: { classPropertyName: "isReadonly", publicName: "isReadonly", isSignal: false, isRequired: false, transformFunction: null }, isDisabled: { classPropertyName: "isDisabled", publicName: "isDisabled", isSignal: false, isRequired: false, transformFunction: null }, sliderValue: { classPropertyName: "sliderValue", publicName: "sliderValue", isSignal: false, isRequired: false, transformFunction: null }, sliderOptions: { classPropertyName: "sliderOptions", publicName: "sliderOptions", isSignal: false, isRequired: false, transformFunction: null }, cssClass: { classPropertyName: "cssClass", publicName: "cssClass", isSignal: false, isRequired: false, transformFunction: null }, skeletonMode: { classPropertyName: "skeletonMode", publicName: "skeletonMode", isSignal: false, isRequired: false, transformFunction: null }, clearable: { classPropertyName: "clearable", publicName: "clearable", isSignal: false, isRequired: false, transformFunction: null }, appendTo: { classPropertyName: "appendTo", publicName: "appendTo", isSignal: false, isRequired: false, transformFunction: null }, indeterminate: { classPropertyName: "indeterminate", publicName: "indeterminate", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { refreshEvent: "refreshEvent", textChanged: "textChanged", valueChange: "valueChange" }, host: { properties: { "class": "this.hostClasses" } }, queries: [{ propertyName: "optionTemplate", first: true, predicate: ["ngOptionTpl"], descendants: true, read: TemplateRef }, { propertyName: "labelTemplate", first: true, predicate: ["ngLabelTpl"], descendants: true, read: TemplateRef }], viewQueries: [{ propertyName: "checkboxInputRef", first: true, predicate: ["checkboxInput"], descendants: true, isSignal: true }], usesOnChanges: true, ngImport: i0, template: "@if (!isInAddon) {\r\n @if (\r\n type !== typeField.checkbox &&\r\n type !== typeField.radio &&\r\n type !== typeField.checkboxButton &&\r\n type !== typeField.radioButton &&\r\n type !== typeField.checkboxInline &&\r\n type !== typeField.radioInline &&\r\n type !== typeField.switch &&\r\n type !== typeField.range &&\r\n type !== typeField.switchSmall\r\n ) {\r\n <label [for]=\"name\" class=\"field-label\" [class.visually-hidden]=\"!displayLabel\">\r\n {{ label | translate }}\r\n\r\n @if (isRequired) {\r\n <span class=\"text-danger\">*</span>\r\n }\r\n\r\n @if (tooltip) {\r\n <!-- <button type=\"button\" class=\"btn btn-link btn-popover\" placement=\"bottom\" [ngbPopover]=\"popContent\" container=\"body\"\r\n triggers=\"mouseenter:mouseleave\">\r\n <span class=\"btn-popover-icon bo-icons bo-help\"></span>\r\n </button>\r\n <ng-template #popContent>\r\n <div [innerHTML]=\"tooltip\"></div>\r\n </ng-template> -->\r\n }\r\n </label>\r\n }\r\n\r\n @if (addonLeft || addonRight) {\r\n <div class=\"field-group\">\r\n @if(addonLeft) {\r\n <ng-container [ngTemplateOutlet]=\"addonLeft\"></ng-container>\r\n }\r\n <ng-container [ngTemplateOutlet]=\"field\"></ng-container>\r\n @if(addonRight) {\r\n <ng-container [ngTemplateOutlet]=\"addonRight\"></ng-container>\r\n }\r\n </div>\r\n }\r\n @else {\r\n @if ( isInInputGroup() ) {\r\n <div class=\"field-group\">\r\n <ng-container [ngTemplateOutlet]=\"field\"></ng-container>\r\n </div>\r\n }\r\n @else {\r\n <ng-container [ngTemplateOutlet]=\"field\"></ng-container>\r\n }\r\n }\r\n\r\n <!-- Error message -->\r\n @if (controlOrGroup?.invalid && controlOrGroup?.touched) {\r\n <div class=\"field-invalid\" [id]=\"'error-' + name\">\r\n @if ((controlOrGroup?.errors?.['required']) || (getControl('start')?.errors?.['required'] || getControl('end')?.errors?.['required'])) {\r\n <span [innerHtml]=\"'_COMMON._FORM.ERROR_IS_MANDATORY' | translate: {label: label | translate}\"></span>\r\n }\r\n @if(controlOrGroup?.errors?.['rangeInvalid']) {\r\n <span>{{'_COMMON._DATES.ERROR_START_END_PERIOD' | translate}}</span>\r\n }\r\n </div>\r\n }\r\n\r\n @if (help) {\r\n <div [id]=\"name + '-help'\" class=\"field-text\">{{help | translate}}</div>\r\n }\r\n}\r\n@else {\r\n <ng-container [ngTemplateOutlet]=\"field\"></ng-container>\r\n}\r\n\r\n<ng-template #field>\r\n <!-- Text -->\r\n @if ([typeField.text, typeField.date, typeField.time, typeField.dateTime, typeField.number, typeField.file,\r\n typeField.email,\r\n typeField.color].includes(type)) {\r\n <input [type]=\"type\" class=\"field-control\" [id]=\"name\" [formControl]=\"formControl\"\r\n [ngClass]=\"[(cssClass || ''), formControl?.value ? 'has-value' : '']\"\r\n [attr.placeholder]=\"placeholder ? (placeholder | translate) : null\" [attr.required]=\"isRequired ? 'required' : null\"\r\n [attr.readonly]=\"isReadonly ? 'readonly' : null\" [disabled]=\"isEffectivelyDisabled\" [attr.aria-required]=\"isRequired\"\r\n [attr.aria-invalid]=\"control.invalid && control.touched\"\r\n [attr.aria-describedby]=\"control.invalid && control.touched ? 'error-' + name : null\" />\r\n }\r\n\r\n @if (type === typeField.password) {\r\n <input showHidePassword [type]=\"type\" class=\"field-control\" [id]=\"name\" [formControl]=\"formControl\"\r\n [ngClass]=\"[(cssClass || ''), formControl?.value ? 'has-value' : '']\"\r\n [attr.required]=\"isRequired ? 'required' : null\" [attr.readonly]=\"isReadonly ? 'readonly' : null\"\r\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\" [attr.aria-required]=\"isRequired\"\r\n [attr.aria-invalid]=\"control.invalid && control.touched\"\r\n [attr.aria-describedby]=\"control.invalid && control.touched ? 'error-' + name : null\" />\r\n }\r\n\r\n <!-- Textarea -->\r\n @if (type === typeField.textarea) {\r\n <textarea class=\"field-control\" [id]=\"name\" [formControl]=\"formControl\"\r\n [ngClass]=\"[(cssClass || ''), formControl?.value ? 'has-value' : '']\"\r\n [attr.placeholder]=\"placeholder ? (placeholder | translate) : null\" [attr.required]=\"isRequired ? 'required' : null\"\r\n [attr.readonly]=\"isReadonly ? 'readonly' : null\" [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\"\r\n [attr.aria-required]=\"isRequired\" [attr.aria-invalid]=\"control.invalid && control.touched\"\r\n [attr.aria-describedby]=\"control.invalid && control.touched ? 'error-' + name : null\"></textarea>\r\n }\r\n\r\n <!-- Select -->\r\n @if (type === typeField.select) {\r\n <ng-select [formControl]=\"formControl\" [items]=\"options\" bindLabel=\"label\" [labelForId]=\"name\" [appendTo]=\"appendTo\" bindValue=\"value\"\r\n [ngClass]=\"cssClass\" [searchable]=\"false\" [placeholder]=\"placeholder ? (placeholder | translate) : null\" [readonly]=\"isReadonly\" [clearable]=\"false\"\r\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\" [attr.required]=\"isRequired ? 'required' : null\"\r\n [attr.aria-required]=\"isRequired\" [attr.aria-invalid]=\"control.invalid && control.touched\"\r\n [attr.aria-describedby]=\"control.invalid && control.touched ? 'error-' + name : null\" [attr.id]=\"name\"\r\n (blur)=\"onBlur()\">\r\n\r\n <!-- Template pour les options -->\r\n <ng-template ng-option-tmp let-item=\"item\" let-index=\"index\" let-search=\"searchTerm\">\r\n @if (optionTemplate) {\r\n <ng-container *ngTemplateOutlet=\"optionTemplate; context: { item: item | translate, index: index, searchTerm: search }\"></ng-container>\r\n }\r\n @else {\r\n <div>{{ item.label | translate }}</div>\r\n }\r\n </ng-template>\r\n\r\n <!-- Template pour le label -->\r\n <ng-template ng-label-tmp let-item=\"item\">\r\n @if (labelTemplate) {\r\n <ng-container *ngTemplateOutlet=\"labelTemplate; context: { item: item | translate }\"></ng-container>\r\n }\r\n @else {\r\n {{ (item.label | translate) || (placeholder | translate) }}\r\n }\r\n </ng-template>\r\n </ng-select>\r\n }\r\n\r\n <!-- NgSelect -->\r\n @if (type === typeField.ngSelect || type === typeField.ngSelectMultiple) {\r\n <ng-select [formControl]=\"formControl\" [items]=\"options\" bindLabel=\"label\" [labelForId]=\"name\" [appendTo]=\"appendTo\" bindValue=\"value\"\r\n [multiple]=\"type === typeField.ngSelectMultiple\" [ngClass]=\"cssClass\" [clearable]=\"false\"\r\n [placeholder]=\"placeholder ? (placeholder | translate) : null\" [readonly]=\"isReadonly\"\r\n [notFoundText]=\"'_COMMON.NO_RESULT' | translate\" [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\"\r\n [attr.required]=\"isRequired ? 'required' : null\" [attr.aria-required]=\"isRequired\"\r\n [attr.aria-invalid]=\"control.invalid && control.touched\"\r\n [attr.aria-describedby]=\"control.invalid && control.touched ? 'error-' + name : null\" [attr.id]=\"name\"\r\n (blur)=\"onBlur()\" (search)=\"textChanged.emit($event?.term)\">\r\n\r\n <!-- Template pour les options -->\r\n <ng-template ng-option-tmp let-item=\"item\" let-index=\"index\" let-search=\"searchTerm\">\r\n @if (optionTemplate) {\r\n <ng-container *ngTemplateOutlet=\"optionTemplate; context: { item: item, index: index, searchTerm: search }\"></ng-container>\r\n }\r\n @else {\r\n <div>{{ item.label | translate }}</div>\r\n }\r\n </ng-template>\r\n\r\n <!-- Template pour le label -->\r\n <ng-template ng-label-tmp let-item=\"item\" let-clear=\"clear\">\r\n <span class=\"ng-value-icon left\" (click)=\"clear(item)\" aria-hidden=\"true\">\u00D7</span>\r\n @if (labelTemplate) {\r\n <ng-container *ngTemplateOutlet=\"labelTemplate; context: { item: item | translate }\"></ng-container>\r\n }\r\n @else {\r\n {{ (item.label | translate) || (placeholder | translate) }}\r\n }\r\n </ng-template>\r\n </ng-select>\r\n }\r\n\r\n <!-- Radio -->\r\n @if (type === typeField.radioInline || type === typeField.radio) {\r\n <fieldset\r\n [attr.aria-required]=\"isRequired\"\r\n [attr.aria-invalid]=\"control.invalid && control.touched\"\r\n [attr.aria-describedby]=\"control.invalid && control.touched ? 'error-' + name : null\">\r\n <legend class=\"field-label\" [class.visually-hidden]=\"!displayLabel\">\r\n {{label | translate}}\r\n @if(isRequired) {\r\n <span class=\"text-danger\">*</span>\r\n }\r\n </legend>\r\n <ul class=\"list-unstyled mb-none\" [ngClass]=\"type === typeField.radioInline ? 'd-flex-h gap-md flex-wrap' : 'd-flex-v'\">\r\n @for (opt of options; track opt.value) {\r\n <li class=\"field-check\">\r\n <input type=\"radio\" [id]=\"name + '_' + opt.value\" [value]=\"opt.value\" [formControl]=\"formControl\"\r\n class=\"field-check-input\" [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\" (change)=\"onRadioChange(opt.value)\" />\r\n <label [for]=\"name + '_' + opt.value\" class=\"field-check-label\">{{ opt.label | translate }}</label>\r\n </li>\r\n }\r\n </ul>\r\n </fieldset>\r\n }\r\n\r\n <!-- Radio button -->\r\n @if (type === typeField.radioButton) {\r\n <fieldset\r\n [attr.aria-required]=\"isRequired\"\r\n [attr.aria-invalid]=\"control.invalid && control.touched\"\r\n [attr.aria-describedby]=\"control.invalid && control.touched ? 'error-' + name : null\">\r\n <legend class=\"field-label\" [class.visually-hidden]=\"!displayLabel\">\r\n {{label | translate}}\r\n @if(isRequired) {\r\n <span class=\"text-danger\">*</span>\r\n }\r\n </legend>\r\n <div class=\"field-group field-group-btn\">\r\n @for (opt of options; track opt.value) {\r\n <input type=\"radio\" [id]=\"name + '_' + opt.value\" [value]=\"opt.value\" [formControl]=\"formControl\"\r\n class=\"visually-hidden\" [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\" (change)=\"onRadioChange(opt.value)\"/>\r\n <label [for]=\"name + '_' + opt.value\" class=\"btn btn-field-group\">{{ opt.label | translate }}</label>\r\n }\r\n </div>\r\n </fieldset>\r\n }\r\n\r\n <!-- Checkbox Switch -->\r\n @if ( type === typeField.switch || type === typeField.switchSmall)\r\n {\r\n <div class=\"field-check field-switch\" [ngClass]=\"{'field-switch-small': type === typeField.switchSmall}\">\r\n <input type=\"checkbox\" [id]=\"name\" [formControl]=\"formControl\" class=\"field-check-input\" [attr.aria-required]=\"isRequired\"\r\n [attr.aria-invalid]=\"control.invalid && control.touched\"\r\n [attr.aria-describedby]=\"control.invalid && control.touched ? 'error-' + name : null\"\r\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\"/>\r\n <label [for]=\"name\" class=\"field-check-label\">{{ label | translate }}</label>\r\n </div>\r\n }\r\n\r\n <!-- Checkbox -->\r\n @if (type === typeField.checkboxInline || type === typeField.checkbox) {\r\n @if (isSingleCheckbox()) {\r\n <div class=\"field-check\" [class.field-check-inline]=\"type === typeField.checkboxInline\">\r\n <input #checkboxInput type=\"checkbox\" [id]=\"name\" [formControl]=\"formControl\"\r\n class=\"field-check-input\"\r\n [class.is-invalid]=\"control?.invalid && control?.touched\"\r\n [attr.aria-required]=\"isRequired\"\r\n [attr.aria-invalid]=\"control?.invalid && control?.touched\"\r\n [attr.aria-describedby]=\"control?.invalid && control?.touched ? 'error-' + name : null\"\r\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\" />\r\n <label [for]=\"name\" class=\"field-check-label\">\r\n {{ label | translate }}\r\n @if (isRequired) {\r\n <span class=\"text-danger\">*</span>\r\n }\r\n </label>\r\n </div>\r\n }\r\n @else if( options.length > 1) {\r\n <fieldset\r\n [attr.aria-required]=\"isRequired\"\r\n [attr.aria-invalid]=\"control.invalid && control.touched\"\r\n [attr.aria-describedby]=\"control.invalid && control.touched ? 'error-' + name : null\"\r\n [ngClass]=\"{ 'flex-column': type === typeField.checkbox }\">\r\n <legend class=\"field-label\" [class.visually-hidden]=\"!displayLabel\">\r\n {{label | translate}}\r\n @if(isRequired) {\r\n <span class=\"text-danger\">*</span>\r\n }\r\n </legend>\r\n <ul class=\"list-unstyled mb-none\" [ngClass]=\"type === typeField.checkboxInline ? 'd-flex-h gap-md' : 'd-flex-v'\">\r\n @for (opt of options; track opt.value) {\r\n <li class=\"field-check\" [ngClass]=\"{ 'field-check-inline': type === typeField.checkboxInline }\">\r\n <input type=\"checkbox\" [id]=\"name + '_' + opt.value\" [value]=\"opt.value\" (change)=\"onCheckboxChange($event)\"\r\n [checked]=\"control.value?.includes(opt.value)\" class=\"field-check-input\"\r\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\" />\r\n <label [for]=\"name + '_' + opt.value\" class=\"field-check-label\">\r\n {{ opt.label | translate }}\r\n </label>\r\n </li>\r\n }\r\n </ul>\r\n </fieldset>\r\n }\r\n @else {\r\n <fieldset>\r\n <legend class=\"field-label\" [class.visually-hidden]=\"!displayLabel\">\r\n {{label | translate}}\r\n </legend>\r\n <ul class=\"list-unstyled mb-none\" [ngClass]=\"type === typeField.checkboxInline ? 'd-flex-h gap-md' : 'd-flex-v'\">\r\n @for (opt of options; track opt.value) {\r\n <li class=\"field-check\" [ngClass]=\"{ 'field-check-inline': type === typeField.checkboxInline }\">\r\n <input type=\"checkbox\" [id]=\"name + '_' + opt.value\" [value]=\"opt.value\" (change)=\"onCheckboxChange($event)\"\r\n [checked]=\"control.value?.includes(opt.value)\" class=\"field-check-input\"\r\n [attr.aria-required]=\"isRequired\"\r\n [attr.aria-invalid]=\"control.invalid && control.touched\"\r\n [attr.aria-describedby]=\"control.invalid && control.touched ? 'error-' + name : null\"\r\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\" />\r\n <label [for]=\"name + '_' + opt.value\" class=\"field-check-label\">\r\n {{ opt.label | translate }}\r\n @if(isRequired) {\r\n <span class=\"text-danger\">*</span>\r\n }\r\n </label>\r\n </li>\r\n }\r\n </ul>\r\n </fieldset>\r\n }\r\n }\r\n\r\n <!-- Checkbox button -->\r\n @if (type === typeField.checkboxButton && options.length > 0) {\r\n\r\n @if(options.length > 1) {\r\n <fieldset\r\n [attr.aria-required]=\"isRequired\"\r\n [attr.aria-invalid]=\"control.invalid && control.touched\"\r\n [attr.aria-describedby]=\"control.invalid && control.touched ? 'error-' + name : null\">\r\n <legend class=\"field-label\" [class.visually-hidden]=\"!displayLabel\">\r\n {{label | translate}}\r\n @if(isRequired) {\r\n <span class=\"text-danger\">*</span>\r\n }\r\n </legend>\r\n <div class=\"field-group field-group-btn\">\r\n @for (opt of options; track opt.value) {\r\n <input type=\"checkbox\" [id]=\"name + '_' + opt.value\" [value]=\"opt.value\" (change)=\"onCheckboxChange($event)\"\r\n [checked]=\"control.value?.includes(opt.value)\" class=\"visually-hidden\"\r\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\" />\r\n <label [for]=\"name + '_' + opt.value\" class=\"btn btn-field-group\">{{ opt.label | translate }}</label>\r\n }\r\n </div>\r\n </fieldset>\r\n }\r\n @else {\r\n <fieldset>\r\n <legend class=\"field-label\" [class.visually-hidden]=\"!displayLabel\">\r\n {{label | translate}}\r\n </legend>\r\n <div class=\"btn-group btn-group-secondary\">\r\n @for (opt of options; track opt.value) {\r\n <input type=\"checkbox\" [id]=\"name + '_' + opt.value\" [value]=\"opt.value\" (change)=\"onCheckboxChange($event)\"\r\n [checked]=\"control.value?.includes(opt.value)\" class=\"visually-hidden\"\r\n [attr.aria-required]=\"isRequired\"\r\n [attr.aria-invalid]=\"control.invalid && control.touched\"\r\n [attr.aria-describedby]=\"control.invalid && control.touched ? 'error-' + name : null\"\r\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\"/>\r\n <label [for]=\"name + '_' + opt.value\" class=\"btn btn-field-group\">\r\n {{ opt.label | translate}}\r\n @if(isRequired) {\r\n <span class=\"text-danger\">*</span>\r\n }\r\n </label>\r\n }\r\n </div>\r\n </fieldset>\r\n }\r\n }\r\n\r\n <!-- Period - DateToDate / TimeToTime / DateTimeToDateTime -->\r\n @if ([typeField.dateToDate, typeField.timeToTime, typeField.dateTimeToDateTime].includes(type) && isRange) {\r\n\r\n <div class=\"field-group\">\r\n <input [type]=\"getInputType()\" class=\"field-control\" [id]=\"name + '_start'\" [formControl]=\"getControl('start')\"\r\n [attr.placeholder]=\"type === typeField.timeToTime ? ('_COMMON._DATES.FROM' | translate) : ('_COMMON._DATES.FROM_TO_1' | translate)\"\r\n [ngClass]=\"[(cssClass || ''), getControl('start')?.value ? 'has-value' : '']\"\r\n [attr.required]=\"isRequired ? 'required' : null\" [attr.readonly]=\"isReadonly ? 'readonly' : null\"\r\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\" [attr.aria-required]=\"isRequired\"\r\n [attr.aria-invalid]=\"getControl('start')?.invalid && getControl('start')?.touched\"\r\n [attr.aria-describedby]=\"getControl('start')?.invalid && getControl('start')?.touched ? 'error-' + name : null\" />\r\n\r\n @if(getControl('start')?.value) {\r\n <button type=\"button\" class=\"btn btn-secondary btn-clear-field\"\r\n (click)=\"onClearFieldPeriod('start')\">\r\n ×\r\n </button>\r\n }\r\n\r\n <input [type]=\"getInputType()\" class=\"field-control\" [id]=\"name + '_end'\" [formControl]=\"getControl('end')\"\r\n [attr.placeholder]=\"type === typeField.timeToTime ? ('_COMMON._DATES.TO' | translate) : ('_COMMON._DATES.FROM_TO_2' | translate)\"\r\n [ngClass]=\"[(cssClass || ''), getControl('end')?.value ? 'has-value' : '']\"\r\n [attr.required]=\"isRequired ? 'required' : null\" [attr.readonly]=\"isReadonly ? 'readonly' : null\"\r\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\"\r\n [attr.aria-invalid]=\"getControl('end')?.invalid && getControl('end')?.touched\"\r\n [attr.aria-describedby]=\"getControl('end')?.invalid && getControl('end')?.touched ? 'error-' + name : null\" />\r\n\r\n @if(getControl('end')?.value) {\r\n <button type=\"button\" class=\"btn btn-secondary btn-clear-field\"\r\n (click)=\"onClearFieldPeriod('end')\">\r\n ×\r\n </button>\r\n }\r\n </div>\r\n }\r\n\r\n @if ([typeField.datePlusOne, typeField.datePlusTwo, typeField.datePlusSeven, typeField.dateComplexe].includes(type)) {\r\n\r\n @if (type === typeField.dateComplexe) {\r\n <button class=\"btn btn-secondary\" type=\"button\" (click)=\"onDateAddDay('prev')\"\r\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\">\r\n <cw-icon font=\"optyweb\" [icon]=\"spriteIcon.nextLeft\" [label]=\"'Jour pr\u00E9c\u00E9dent'\"></cw-icon>\r\n </button>\r\n }\r\n\r\n <input type=\"date\" class=\"field-control\" [id]=\"name\" [formControl]=\"formControl\"\r\n [ngClass]=\"[(cssClass || ''), formControl?.value ? 'has-value' : '']\"\r\n [attr.placeholder]=\"placeholder ? placeholder : null\" [attr.required]=\"isRequired ? 'required' : null\"\r\n [attr.readonly]=\"isReadonly ? 'readonly' : null\" [disabled]=\"isEffectivelyDisabled\" [attr.aria-required]=\"isRequired\"\r\n [attr.aria-invalid]=\"control.invalid && control.touched\"\r\n [attr.aria-describedby]=\"control.invalid && control.touched ? 'error-' + name : null\" />\r\n\r\n @if(formControl?.value) {\r\n <button class=\"btn btn-secondary btn-clear-field\" type=\"button\"\r\n (click)=\"onClearField(formControl)\">×</button>\r\n }\r\n\r\n @if (type === typeField.dateComplexe) {\r\n <button class=\"btn btn-secondary\" type=\"button\" (click)=\"onDateAddDay('next')\"\r\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\">\r\n <cw-icon font=\"optyweb\" [icon]=\"spriteIcon.nextRight\" [label]=\"'Jour suivant'\"></cw-icon>\r\n </button>\r\n <button class=\"btn btn-secondary\" type=\"button\" (click)=\"onRefresh()\"\r\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\">\r\n <cw-icon font=\"optyweb\" [icon]=\"spriteIcon.toolbarRefresh\" [label]=\"'Rafra\u00EEchir'\"></cw-icon>\r\n </button>\r\n }\r\n\r\n <button class=\"btn btn-secondary\" type=\"button\" (click)=\"onTodayAddDay(0)\"\r\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\">\r\n J\r\n <span class=\"visually-hidden\">Aujourd'hui</span>\r\n </button>\r\n <button class=\"btn btn-secondary\" type=\"button\" (click)=\"onTodayAddDay(1)\"\r\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\">\r\n J+1\r\n <span class=\"visually-hidden\">Demain</span>\r\n </button>\r\n\r\n @if (type !== typeField.datePlusOne && type !== typeField.dateComplexe) {\r\n <button class=\"btn btn-secondary \" type=\"button\" (click)=\"onTodayAddDay(2)\"\r\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\">\r\n J+2\r\n <span class=\"visually-hidden\">Dans 2 jours</span>\r\n </button>\r\n\r\n @if (type !== typeField.datePlusTwo) {\r\n <button class=\"btn btn-secondary\" type=\"button\" (click)=\"onTodayAddDay(7)\"\r\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\">\r\n J+7\r\n <span class=\"visually-hidden\">Dans 7 jours</span>\r\n </button>\r\n }\r\n }\r\n }\r\n\r\n @if (type === typeField.slider) {\r\n <ngx-slider [(value)]=\"sliderValue\" [options]=\"sliderOptions\" [formControl]=\"formControl\"></ngx-slider>\r\n }\r\n\r\n @if (type === typeField.range) {\r\n <div class=\"slider\">\r\n\r\n <cw-button [isDisabled]=\"formControl.value <= rangeOptions.floor\" [label]=\"'Diminuer ' + formControl.value + ' ' + label\"\r\n [withIcon]=\"spriteIcon.toolbarMinus\" [withOnlyIcon]=\"true\" [type]=\"buttonType.primary\"\r\n [iconSize]=\"buttonIconSize.small\" (btnAction)=\"onRangeStep('decrease')\">\r\n </cw-button>\r\n\r\n <div class=\"slider-input\">\r\n <label [for]=\"name\" class=\"slider-tooltip\" [style.left]=\"getRangePercent() + '%'\" aria-live=\"polite\"\r\n aria-atomic=\"true\">\r\n {{ label | translate }} {{ formControl.value }}\r\n @if (rangeOptions.unit) {\r\n <abbr [title]=\"rangeOptions.unit\">{{ rangeOptions.unit }}</abbr>\r\n }\r\n </label>\r\n\r\n <div class=\"slider-custom-bar\">\r\n <div class=\"slider-custom-bar-selection\" [style.width]=\"getRangePercent() + '%'\">\r\n </div>\r\n </div>\r\n\r\n <input type=\"range\" [id]=\"name\" [formControl]=\"formControl\" [min]=\"rangeOptions.floor\" [max]=\"rangeOptions.ceil\"\r\n [step]=\"rangeOptions.step || 1\" class=\"field-control-range\" [attr.aria-required]=\"isRequired\"\r\n [attr.aria-invalid]=\"control.invalid && control.touched\" [disabled]=\"isEffectivelyDisabled\">\r\n </div>\r\n\r\n <cw-button [isDisabled]=\"formControl.value >= rangeOptions.ceil\" [label]=\"'Augmenter ' + formControl.value + ' ' + label\"\r\n [withIcon]=\"spriteIcon.toolbarPlus\" [withOnlyIcon]=\"true\" [type]=\"buttonType.primary\"\r\n [iconSize]=\"buttonIconSize.small\" (btnAction)=\"onRangeStep('increase')\">\r\n </cw-button>\r\n </div>\r\n }\r\n\r\n @if (isInInputGroup() && clearable) {\r\n @if(formControl?.value) {\r\n <button class=\"btn btn-secondary btn-clear-field\" type=\"button\"\r\n (click)=\"onClearField(formControl)\">×</button>\r\n }\r\n }\r\n\r\n</ng-template>\r\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: "ngmodule", type: FormsModule }, { kind: "directive", type: i2$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2$1.RangeValueAccessor, selector: "input[type=range][formControlName],input[type=range][formControl],input[type=range][ngModel]" }, { kind: "directive", type: i2$1.CheckboxControlValueAccessor, selector: "input[type=checkbox][formControlName],input[type=checkbox][formControl],input[type=checkbox][ngModel]" }, { kind: "directive", type: i2$1.RadioControlValueAccessor, selector: "input[type=radio][formControlName],input[type=radio][formControl],input[type=radio][ngModel]", inputs: ["name", "formControlName", "value"] }, { kind: "directive", type: i2$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i2$1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "ngmodule", type: NgSelectModule }, { kind: "component", type: i3.NgSelectComponent, selector: "ng-select", inputs: ["ariaLabelDropdown", "bindLabel", "bindValue", "ariaLabel", "markFirst", "placeholder", "fixedPlaceholder", "notFoundText", "typeToSearchText", "preventToggleOnRightClick", "addTagText", "loadingText", "clearAllText", "appearance", "dropdownPosition", "appendTo", "loading", "closeOnSelect", "hideSelected", "selectOnTab", "openOnEnter", "maxSelectedItems", "groupBy", "groupValue", "bufferAmount", "virtualScroll", "selectableGroup", "selectableGroupAsModel", "searchFn", "trackByFn", "clearOnBackspace", "labelForId", "inputAttrs", "tabIndex", "tabFocusOnClearButton", "readonly", "searchWhileComposing", "minTermLength", "editableSearchTerm", "ngClass", "typeahead", "multiple", "addTag", "searchable", "clearable", "isOpen", "items", "compareWith", "clearSearchOnAdd", "deselectOnClick", "keyDownFn"], outputs: ["blur", "focus", "change", "open", "close", "search", "clear", "add", "remove", "scroll", "scrollToEnd"] }, { kind: "directive", type: i3.NgOptionTemplateDirective, selector: "[ng-option-tmp]" }, { kind: "directive", type: i3.NgLabelTemplateDirective, selector: "[ng-label-tmp]" }, { kind: "ngmodule", type: NgxSliderModule }, { kind: "component", type: i4.SliderComponent, selector: "ngx-slider", inputs: ["value", "highValue", "options", "manualRefresh", "triggerFocus", "cancelUserChange"], outputs: ["valueChange", "highValueChange", "userChangeStart", "userChange", "userChangeEnd"] }, { kind: "directive", type: ShowHidePasswordDirective, selector: "[showHidePassword]" }, { 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"] }, { kind: "pipe", type: i2.TranslatePipe, name: "translate" }] }); }
|
|
1972
2025
|
}
|
|
1973
2026
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.19", ngImport: i0, type: FormFieldComponent, decorators: [{
|
|
1974
2027
|
type: Component,
|
|
@@ -1982,7 +2035,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.19", ngImpo
|
|
|
1982
2035
|
ShowHidePasswordDirective,
|
|
1983
2036
|
IconComponent,
|
|
1984
2037
|
ButtonComponent
|
|
1985
|
-
], template: "@if (!isInAddon) {\r\n @if (\r\n type !== typeField.checkbox &&\r\n type !== typeField.radio &&\r\n type !== typeField.checkboxButton &&\r\n type !== typeField.radioButton &&\r\n type !== typeField.checkboxInline &&\r\n type !== typeField.radioInline &&\r\n type !== typeField.switch &&\r\n type !== typeField.range &&\r\n type !== typeField.switchSmall\r\n ) {\r\n <label [for]=\"name\" class=\"field-label\" [class.visually-hidden]=\"!displayLabel\">\r\n {{ label | translate }}\r\n\r\n @if (isRequired) {\r\n <span class=\"text-danger\">*</span>\r\n }\r\n\r\n @if (tooltip) {\r\n <!-- <button type=\"button\" class=\"btn btn-link btn-popover\" placement=\"bottom\" [ngbPopover]=\"popContent\" container=\"body\"\r\n triggers=\"mouseenter:mouseleave\">\r\n <span class=\"btn-popover-icon bo-icons bo-help\"></span>\r\n </button>\r\n <ng-template #popContent>\r\n <div [innerHTML]=\"tooltip\"></div>\r\n </ng-template> -->\r\n }\r\n </label>\r\n }\r\n\r\n @if (addonLeft || addonRight) {\r\n <div class=\"field-group\">\r\n @if(addonLeft) {\r\n <ng-container [ngTemplateOutlet]=\"addonLeft\"></ng-container>\r\n }\r\n <ng-container [ngTemplateOutlet]=\"field\"></ng-container>\r\n @if(addonRight) {\r\n <ng-container [ngTemplateOutlet]=\"addonRight\"></ng-container>\r\n }\r\n </div>\r\n }\r\n @else {\r\n @if ( isInInputGroup() ) {\r\n <div class=\"field-group\">\r\n <ng-container [ngTemplateOutlet]=\"field\"></ng-container>\r\n </div>\r\n }\r\n @else {\r\n <ng-container [ngTemplateOutlet]=\"field\"></ng-container>\r\n }\r\n }\r\n\r\n <!-- Error message -->\r\n @if (controlOrGroup?.invalid && controlOrGroup?.touched) {\r\n <div class=\"field-invalid\" [id]=\"'error-' + name\">\r\n @if ((controlOrGroup?.errors?.['required']) || (getControl('start')?.errors?.['required'] || getControl('end')?.errors?.['required'])) {\r\n <span [innerHtml]=\"'_COMMON._FORM.ERROR_IS_MANDATORY' | translate: {label: label | translate}\"></span>\r\n }\r\n @if(controlOrGroup?.errors?.['rangeInvalid']) {\r\n <span>{{'_COMMON._DATES.ERROR_START_END_PERIOD' | translate}}</span>\r\n }\r\n </div>\r\n }\r\n\r\n @if (help) {\r\n <div [id]=\"name + '-help'\" class=\"field-text\">{{help | translate}}</div>\r\n }\r\n}\r\n@else {\r\n <ng-container [ngTemplateOutlet]=\"field\"></ng-container>\r\n}\r\n\r\n<ng-template #field>\r\n <!-- Text -->\r\n @if ([typeField.text, typeField.date, typeField.time, typeField.dateTime, typeField.number, typeField.file,\r\n typeField.email,\r\n typeField.color].includes(type)) {\r\n <input [type]=\"type\" class=\"field-control\" [id]=\"name\" [formControl]=\"formControl\"\r\n [ngClass]=\"[(cssClass || ''), formControl?.value ? 'has-value' : '']\"\r\n [attr.placeholder]=\"placeholder ? (placeholder | translate) : null\" [attr.required]=\"isRequired ? 'required' : null\"\r\n [attr.readonly]=\"isReadonly ? 'readonly' : null\" [disabled]=\"isDisabled\" [attr.aria-required]=\"isRequired\"\r\n [attr.aria-invalid]=\"control.invalid && control.touched\"\r\n [attr.aria-describedby]=\"control.invalid && control.touched ? 'error-' + name : null\" />\r\n }\r\n\r\n @if (type === typeField.password) {\r\n <input showHidePassword [type]=\"type\" class=\"field-control\" [id]=\"name\" [formControl]=\"formControl\"\r\n [ngClass]=\"[(cssClass || ''), formControl?.value ? 'has-value' : '']\"\r\n [attr.required]=\"isRequired ? 'required' : null\" [attr.readonly]=\"isReadonly ? 'readonly' : null\"\r\n [attr.disabled]=\"isDisabled ? 'disabled' : null\" [attr.aria-required]=\"isRequired\"\r\n [attr.aria-invalid]=\"control.invalid && control.touched\"\r\n [attr.aria-describedby]=\"control.invalid && control.touched ? 'error-' + name : null\" />\r\n }\r\n\r\n <!-- Textarea -->\r\n @if (type === typeField.textarea) {\r\n <textarea class=\"field-control\" [id]=\"name\" [formControl]=\"formControl\"\r\n [ngClass]=\"[(cssClass || ''), formControl?.value ? 'has-value' : '']\"\r\n [attr.placeholder]=\"placeholder ? (placeholder | translate) : null\" [attr.required]=\"isRequired ? 'required' : null\"\r\n [attr.readonly]=\"isReadonly ? 'readonly' : null\" [attr.disabled]=\"isDisabled ? 'disabled' : null\"\r\n [attr.aria-required]=\"isRequired\" [attr.aria-invalid]=\"control.invalid && control.touched\"\r\n [attr.aria-describedby]=\"control.invalid && control.touched ? 'error-' + name : null\"></textarea>\r\n }\r\n\r\n <!-- Select -->\r\n @if (type === typeField.select) {\r\n <ng-select [formControl]=\"formControl\" [items]=\"options\" bindLabel=\"label\" [labelForId]=\"name\" [appendTo]=\"appendTo\" bindValue=\"value\"\r\n [ngClass]=\"cssClass\" [searchable]=\"false\" [placeholder]=\"placeholder ? (placeholder | translate) : null\" [readonly]=\"isReadonly\" [clearable]=\"false\"\r\n [attr.disabled]=\"isDisabled ? 'disabled' : null\" [attr.required]=\"isRequired ? 'required' : null\"\r\n [attr.aria-required]=\"isRequired\" [attr.aria-invalid]=\"control.invalid && control.touched\"\r\n [attr.aria-describedby]=\"control.invalid && control.touched ? 'error-' + name : null\" [attr.id]=\"name\"\r\n (blur)=\"onBlur()\">\r\n\r\n <!-- Template pour les options -->\r\n <ng-template ng-option-tmp let-item=\"item\" let-index=\"index\" let-search=\"searchTerm\">\r\n @if (optionTemplate) {\r\n <ng-container *ngTemplateOutlet=\"optionTemplate; context: { item: item | translate, index: index, searchTerm: search }\"></ng-container>\r\n }\r\n @else {\r\n <div>{{ item.label | translate }}</div>\r\n }\r\n </ng-template>\r\n\r\n <!-- Template pour le label -->\r\n <ng-template ng-label-tmp let-item=\"item\">\r\n @if (labelTemplate) {\r\n <ng-container *ngTemplateOutlet=\"labelTemplate; context: { item: item | translate }\"></ng-container>\r\n }\r\n @else {\r\n {{ (item.label | translate) || (placeholder | translate) }}\r\n }\r\n </ng-template>\r\n </ng-select>\r\n }\r\n\r\n <!-- NgSelect -->\r\n @if (type === typeField.ngSelect || type === typeField.ngSelectMultiple) {\r\n <ng-select [formControl]=\"formControl\" [items]=\"options\" bindLabel=\"label\" [labelForId]=\"name\" [appendTo]=\"appendTo\" bindValue=\"value\"\r\n [multiple]=\"type === typeField.ngSelectMultiple\" [ngClass]=\"cssClass\" [clearable]=\"false\"\r\n [placeholder]=\"placeholder ? (placeholder | translate) : null\" [readonly]=\"isReadonly\"\r\n [notFoundText]=\"'_COMMON.NO_RESULT' | translate\" [attr.disabled]=\"isDisabled ? 'disabled' : null\"\r\n [attr.required]=\"isRequired ? 'required' : null\" [attr.aria-required]=\"isRequired\"\r\n [attr.aria-invalid]=\"control.invalid && control.touched\"\r\n [attr.aria-describedby]=\"control.invalid && control.touched ? 'error-' + name : null\" [attr.id]=\"name\"\r\n (blur)=\"onBlur()\" (search)=\"textChanged.emit($event?.term)\">\r\n\r\n <!-- Template pour les options -->\r\n <ng-template ng-option-tmp let-item=\"item\" let-index=\"index\" let-search=\"searchTerm\">\r\n @if (optionTemplate) {\r\n <ng-container *ngTemplateOutlet=\"optionTemplate; context: { item: item, index: index, searchTerm: search }\"></ng-container>\r\n }\r\n @else {\r\n <div>{{ item.label | translate }}</div>\r\n }\r\n </ng-template>\r\n\r\n <!-- Template pour le label -->\r\n <ng-template ng-label-tmp let-item=\"item\" let-clear=\"clear\">\r\n <span class=\"ng-value-icon left\" (click)=\"clear(item)\" aria-hidden=\"true\">\u00D7</span>\r\n @if (labelTemplate) {\r\n <ng-container *ngTemplateOutlet=\"labelTemplate; context: { item: item | translate }\"></ng-container>\r\n }\r\n @else {\r\n {{ (item.label | translate) || (placeholder | translate) }}\r\n }\r\n </ng-template>\r\n </ng-select>\r\n }\r\n\r\n <!-- Radio -->\r\n @if (type === typeField.radioInline || type === typeField.radio) {\r\n <fieldset\r\n [attr.aria-required]=\"isRequired\"\r\n [attr.aria-invalid]=\"control.invalid && control.touched\"\r\n [attr.aria-describedby]=\"control.invalid && control.touched ? 'error-' + name : null\">\r\n <legend class=\"field-label\" [class.visually-hidden]=\"!displayLabel\">\r\n {{label | translate}}\r\n @if(isRequired) {\r\n <span class=\"text-danger\">*</span>\r\n }\r\n </legend>\r\n <ul class=\"list-unstyled mb-none\" [ngClass]=\"type === typeField.radioInline ? 'd-flex-h gap-md flex-wrap' : 'd-flex-v'\">\r\n @for (opt of options; track opt.value) {\r\n <li class=\"field-check\">\r\n <input type=\"radio\" [id]=\"name + '_' + opt.value\" [value]=\"opt.value\" [formControl]=\"formControl\"\r\n class=\"field-check-input\" [attr.disabled]=\"isDisabled ? 'disabled' : null\" (change)=\"onRadioChange(opt.value)\" />\r\n <label [for]=\"name + '_' + opt.value\" class=\"field-check-label\">{{ opt.label | translate }}</label>\r\n </li>\r\n }\r\n </ul>\r\n </fieldset>\r\n }\r\n\r\n <!-- Radio button -->\r\n @if (type === typeField.radioButton) {\r\n <fieldset\r\n [attr.aria-required]=\"isRequired\"\r\n [attr.aria-invalid]=\"control.invalid && control.touched\"\r\n [attr.aria-describedby]=\"control.invalid && control.touched ? 'error-' + name : null\">\r\n <legend class=\"field-label\" [class.visually-hidden]=\"!displayLabel\">\r\n {{label | translate}}\r\n @if(isRequired) {\r\n <span class=\"text-danger\">*</span>\r\n }\r\n </legend>\r\n <div class=\"field-group field-group-btn\">\r\n @for (opt of options; track opt.value) {\r\n <input type=\"radio\" [id]=\"name + '_' + opt.value\" [value]=\"opt.value\" [formControl]=\"formControl\"\r\n class=\"visually-hidden\" [attr.disabled]=\"isDisabled ? 'disabled' : null\" (change)=\"onRadioChange(opt.value)\"/>\r\n <label [for]=\"name + '_' + opt.value\" class=\"btn btn-field-group\">{{ opt.label | translate }}</label>\r\n }\r\n </div>\r\n </fieldset>\r\n }\r\n\r\n <!-- Checkbox Switch -->\r\n @if ( type === typeField.switch || type === typeField.switchSmall)\r\n {\r\n <div class=\"field-check field-switch\" [ngClass]=\"{'field-switch-small': type === typeField.switchSmall}\">\r\n <input type=\"checkbox\" [id]=\"name\" [formControl]=\"formControl\" class=\"field-check-input\" [attr.aria-required]=\"isRequired\"\r\n [attr.aria-invalid]=\"control.invalid && control.touched\"\r\n [attr.aria-describedby]=\"control.invalid && control.touched ? 'error-' + name : null\"\r\n [attr.disabled]=\"isDisabled ? 'disabled' : null\"/>\r\n <label [for]=\"name\" class=\"field-check-label\">{{ label | translate }}</label>\r\n </div>\r\n }\r\n\r\n <!-- Checkbox -->\r\n @if (type === typeField.checkboxInline || type === typeField.checkbox) {\r\n @if( options.length > 1) {\r\n <fieldset\r\n [attr.aria-required]=\"isRequired\"\r\n [attr.aria-invalid]=\"control.invalid && control.touched\"\r\n [attr.aria-describedby]=\"control.invalid && control.touched ? 'error-' + name : null\"\r\n [ngClass]=\"{ 'flex-column': type === typeField.checkbox }\">\r\n <legend class=\"field-label\" [class.visually-hidden]=\"!displayLabel\">\r\n {{label | translate}}\r\n @if(isRequired) {\r\n <span class=\"text-danger\">*</span>\r\n }\r\n </legend>\r\n <ul class=\"list-unstyled mb-none\" [ngClass]=\"type === typeField.checkboxInline ? 'd-flex-h gap-md' : 'd-flex-v'\">\r\n @for (opt of options; track opt.value) {\r\n <li class=\"field-check\" [ngClass]=\"{ 'field-check-inline': type === typeField.checkboxInline }\">\r\n <input type=\"checkbox\" [id]=\"name + '_' + opt.value\" [value]=\"opt.value\" (change)=\"onCheckboxChange($event)\"\r\n [checked]=\"control.value?.includes(opt.value)\" class=\"field-check-input\"\r\n [attr.disabled]=\"isDisabled ? 'disabled' : null\" />\r\n <label [for]=\"name + '_' + opt.value\" class=\"field-check-label\">\r\n {{ opt.label | translate }}\r\n </label>\r\n </li>\r\n }\r\n </ul>\r\n </fieldset>\r\n }\r\n @else {\r\n <fieldset>\r\n <legend class=\"field-label\" [class.visually-hidden]=\"!displayLabel\">\r\n {{label | translate}}\r\n </legend>\r\n <ul class=\"list-unstyled mb-none\" [ngClass]=\"type === typeField.checkboxInline ? 'd-flex-h gap-md' : 'd-flex-v'\">\r\n @for (opt of options; track opt.value) {\r\n <li class=\"field-check\" [ngClass]=\"{ 'field-check-inline': type === typeField.checkboxInline }\">\r\n <input type=\"checkbox\" [id]=\"name + '_' + opt.value\" [value]=\"opt.value\" (change)=\"onCheckboxChange($event)\"\r\n [checked]=\"control.value?.includes(opt.value)\" class=\"field-check-input\"\r\n [attr.aria-required]=\"isRequired\"\r\n [attr.aria-invalid]=\"control.invalid && control.touched\"\r\n [attr.aria-describedby]=\"control.invalid && control.touched ? 'error-' + name : null\"\r\n [attr.disabled]=\"isDisabled ? 'disabled' : null\" />\r\n <label [for]=\"name + '_' + opt.value\" class=\"field-check-label\">\r\n {{ opt.label | translate }}\r\n @if(isRequired) {\r\n <span class=\"text-danger\">*</span>\r\n }\r\n </label>\r\n </li>\r\n }\r\n </ul>\r\n </fieldset>\r\n }\r\n }\r\n\r\n <!-- Checkbox button -->\r\n @if (type === typeField.checkboxButton && options.length > 0) {\r\n\r\n @if(options.length > 1) {\r\n <fieldset\r\n [attr.aria-required]=\"isRequired\"\r\n [attr.aria-invalid]=\"control.invalid && control.touched\"\r\n [attr.aria-describedby]=\"control.invalid && control.touched ? 'error-' + name : null\">\r\n <legend class=\"field-label\" [class.visually-hidden]=\"!displayLabel\">\r\n {{label | translate}}\r\n @if(isRequired) {\r\n <span class=\"text-danger\">*</span>\r\n }\r\n </legend>\r\n <div class=\"field-group field-group-btn\">\r\n @for (opt of options; track opt.value) {\r\n <input type=\"checkbox\" [id]=\"name + '_' + opt.value\" [value]=\"opt.value\" (change)=\"onCheckboxChange($event)\"\r\n [checked]=\"control.value?.includes(opt.value)\" class=\"visually-hidden\"\r\n [attr.disabled]=\"isDisabled ? 'disabled' : null\" />\r\n <label [for]=\"name + '_' + opt.value\" class=\"btn btn-field-group\">{{ opt.label | translate }}</label>\r\n }\r\n </div>\r\n </fieldset>\r\n }\r\n @else {\r\n <fieldset>\r\n <legend class=\"field-label\" [class.visually-hidden]=\"!displayLabel\">\r\n {{label | translate}}\r\n </legend>\r\n <div class=\"btn-group btn-group-secondary\">\r\n @for (opt of options; track opt.value) {\r\n <input type=\"checkbox\" [id]=\"name + '_' + opt.value\" [value]=\"opt.value\" (change)=\"onCheckboxChange($event)\"\r\n [checked]=\"control.value?.includes(opt.value)\" class=\"visually-hidden\"\r\n [attr.aria-required]=\"isRequired\"\r\n [attr.aria-invalid]=\"control.invalid && control.touched\"\r\n [attr.aria-describedby]=\"control.invalid && control.touched ? 'error-' + name : null\"\r\n [attr.disabled]=\"isDisabled ? 'disabled' : null\"/>\r\n <label [for]=\"name + '_' + opt.value\" class=\"btn btn-field-group\">\r\n {{ opt.label | translate}}\r\n @if(isRequired) {\r\n <span class=\"text-danger\">*</span>\r\n }\r\n </label>\r\n }\r\n </div>\r\n </fieldset>\r\n }\r\n }\r\n\r\n <!-- Period - DateToDate / TimeToTime / DateTimeToDateTime -->\r\n @if ([typeField.dateToDate, typeField.timeToTime, typeField.dateTimeToDateTime].includes(type) && isRange) {\r\n\r\n <div class=\"field-group\">\r\n <input [type]=\"getInputType()\" class=\"field-control\" [id]=\"name + '_start'\" [formControl]=\"getControl('start')\"\r\n [attr.placeholder]=\"type === typeField.timeToTime ? ('_COMMON._DATES.FROM' | translate) : ('_COMMON._DATES.FROM_TO_1' | translate)\"\r\n [ngClass]=\"[(cssClass || ''), getControl('start')?.value ? 'has-value' : '']\"\r\n [attr.required]=\"isRequired ? 'required' : null\" [attr.readonly]=\"isReadonly ? 'readonly' : null\"\r\n [attr.disabled]=\"isDisabled ? 'disabled' : null\" [attr.aria-required]=\"isRequired\"\r\n [attr.aria-invalid]=\"getControl('start')?.invalid && getControl('start')?.touched\"\r\n [attr.aria-describedby]=\"getControl('start')?.invalid && getControl('start')?.touched ? 'error-' + name : null\" />\r\n\r\n @if(getControl('start')?.value) {\r\n <button type=\"button\" class=\"btn btn-secondary btn-clear-field\"\r\n (click)=\"onClearFieldPeriod('start')\">\r\n ×\r\n </button>\r\n }\r\n\r\n <input [type]=\"getInputType()\" class=\"field-control\" [id]=\"name + '_end'\" [formControl]=\"getControl('end')\"\r\n [attr.placeholder]=\"type === typeField.timeToTime ? ('_COMMON._DATES.TO' | translate) : ('_COMMON._DATES.FROM_TO_2' | translate)\"\r\n [ngClass]=\"[(cssClass || ''), getControl('end')?.value ? 'has-value' : '']\"\r\n [attr.required]=\"isRequired ? 'required' : null\" [attr.readonly]=\"isReadonly ? 'readonly' : null\"\r\n [attr.disabled]=\"isDisabled ? 'disabled' : null\"\r\n [attr.aria-invalid]=\"getControl('end')?.invalid && getControl('end')?.touched\"\r\n [attr.aria-describedby]=\"getControl('end')?.invalid && getControl('end')?.touched ? 'error-' + name : null\" />\r\n\r\n @if(getControl('end')?.value) {\r\n <button type=\"button\" class=\"btn btn-secondary btn-clear-field\"\r\n (click)=\"onClearFieldPeriod('end')\">\r\n ×\r\n </button>\r\n }\r\n </div>\r\n }\r\n\r\n @if ([typeField.datePlusOne, typeField.datePlusTwo, typeField.datePlusSeven, typeField.dateComplexe].includes(type)) {\r\n\r\n @if (type === typeField.dateComplexe) {\r\n <button class=\"btn btn-secondary\" type=\"button\" (click)=\"onDateAddDay('prev')\"\r\n [attr.disabled]=\"isDisabled ? 'disabled' : null\">\r\n <cw-icon font=\"optyweb\" [icon]=\"spriteIcon.nextLeft\" [label]=\"'Jour pr\u00E9c\u00E9dent'\"></cw-icon>\r\n </button>\r\n }\r\n\r\n <input type=\"date\" class=\"field-control\" [id]=\"name\" [formControl]=\"formControl\"\r\n [ngClass]=\"[(cssClass || ''), formControl?.value ? 'has-value' : '']\"\r\n [attr.placeholder]=\"placeholder ? placeholder : null\" [attr.required]=\"isRequired ? 'required' : null\"\r\n [attr.readonly]=\"isReadonly ? 'readonly' : null\" [disabled]=\"isDisabled\" [attr.aria-required]=\"isRequired\"\r\n [attr.aria-invalid]=\"control.invalid && control.touched\"\r\n [attr.aria-describedby]=\"control.invalid && control.touched ? 'error-' + name : null\" />\r\n\r\n @if(formControl?.value) {\r\n <button class=\"btn btn-secondary btn-clear-field\" type=\"button\"\r\n (click)=\"onClearField(formControl)\">×</button>\r\n }\r\n\r\n @if (type === typeField.dateComplexe) {\r\n <button class=\"btn btn-secondary\" type=\"button\" (click)=\"onDateAddDay('next')\"\r\n [attr.disabled]=\"isDisabled ? 'disabled' : null\">\r\n <cw-icon font=\"optyweb\" [icon]=\"spriteIcon.nextRight\" [label]=\"'Jour suivant'\"></cw-icon>\r\n </button>\r\n <button class=\"btn btn-secondary\" type=\"button\" (click)=\"onRefresh()\"\r\n [attr.disabled]=\"isDisabled ? 'disabled' : null\">\r\n <cw-icon font=\"optyweb\" [icon]=\"spriteIcon.toolbarRefresh\" [label]=\"'Rafra\u00EEchir'\"></cw-icon>\r\n </button>\r\n }\r\n\r\n <button class=\"btn btn-secondary\" type=\"button\" (click)=\"onTodayAddDay(0)\"\r\n [attr.disabled]=\"isDisabled ? 'disabled' : null\">\r\n J\r\n <span class=\"visually-hidden\">Aujourd'hui</span>\r\n </button>\r\n <button class=\"btn btn-secondary\" type=\"button\" (click)=\"onTodayAddDay(1)\"\r\n [attr.disabled]=\"isDisabled ? 'disabled' : null\">\r\n J+1\r\n <span class=\"visually-hidden\">Demain</span>\r\n </button>\r\n\r\n @if (type !== typeField.datePlusOne && type !== typeField.dateComplexe) {\r\n <button class=\"btn btn-secondary \" type=\"button\" (click)=\"onTodayAddDay(2)\"\r\n [attr.disabled]=\"isDisabled ? 'disabled' : null\">\r\n J+2\r\n <span class=\"visually-hidden\">Dans 2 jours</span>\r\n </button>\r\n\r\n @if (type !== typeField.datePlusTwo) {\r\n <button class=\"btn btn-secondary\" type=\"button\" (click)=\"onTodayAddDay(7)\"\r\n [attr.disabled]=\"isDisabled ? 'disabled' : null\">\r\n J+7\r\n <span class=\"visually-hidden\">Dans 7 jours</span>\r\n </button>\r\n }\r\n }\r\n }\r\n\r\n @if (type === typeField.slider) {\r\n <ngx-slider [(value)]=\"sliderValue\" [options]=\"sliderOptions\" [formControl]=\"formControl\"></ngx-slider>\r\n }\r\n\r\n @if (type === typeField.range) {\r\n <div class=\"slider\">\r\n\r\n <cw-button [isDisabled]=\"formControl.value <= rangeOptions.floor\" [label]=\"'Diminuer ' + formControl.value + ' ' + label\"\r\n [withIcon]=\"spriteIcon.toolbarMinus\" [withOnlyIcon]=\"true\" [type]=\"buttonType.primary\"\r\n [iconSize]=\"buttonIconSize.small\" (btnAction)=\"onRangeStep('decrease')\">\r\n </cw-button>\r\n\r\n <div class=\"slider-input\">\r\n <label [for]=\"name\" class=\"slider-tooltip\" [style.left]=\"getRangePercent() + '%'\" aria-live=\"polite\"\r\n aria-atomic=\"true\">\r\n {{ label | translate }} {{ formControl.value }}\r\n @if (rangeOptions.unit) {\r\n <abbr [title]=\"rangeOptions.unit\">{{ rangeOptions.unit }}</abbr>\r\n }\r\n </label>\r\n\r\n <div class=\"slider-custom-bar\">\r\n <div class=\"slider-custom-bar-selection\" [style.width]=\"getRangePercent() + '%'\">\r\n </div>\r\n </div>\r\n\r\n <input type=\"range\" [id]=\"name\" [formControl]=\"formControl\" [min]=\"rangeOptions.floor\" [max]=\"rangeOptions.ceil\"\r\n [step]=\"rangeOptions.step || 1\" class=\"field-control-range\" [attr.aria-required]=\"isRequired\"\r\n [attr.aria-invalid]=\"control.invalid && control.touched\" [disabled]=\"isDisabled\">\r\n </div>\r\n\r\n <cw-button [isDisabled]=\"formControl.value >= rangeOptions.ceil\" [label]=\"'Augmenter ' + formControl.value + ' ' + label\"\r\n [withIcon]=\"spriteIcon.toolbarPlus\" [withOnlyIcon]=\"true\" [type]=\"buttonType.primary\"\r\n [iconSize]=\"buttonIconSize.small\" (btnAction)=\"onRangeStep('increase')\">\r\n </cw-button>\r\n </div>\r\n }\r\n\r\n @if (isInInputGroup() && clearable) {\r\n @if(formControl?.value) {\r\n <button class=\"btn btn-secondary btn-clear-field\" type=\"button\"\r\n (click)=\"onClearField(formControl)\">×</button>\r\n }\r\n }\r\n\r\n</ng-template>\r\n" }]
|
|
2038
|
+
], template: "@if (!isInAddon) {\r\n @if (\r\n type !== typeField.checkbox &&\r\n type !== typeField.radio &&\r\n type !== typeField.checkboxButton &&\r\n type !== typeField.radioButton &&\r\n type !== typeField.checkboxInline &&\r\n type !== typeField.radioInline &&\r\n type !== typeField.switch &&\r\n type !== typeField.range &&\r\n type !== typeField.switchSmall\r\n ) {\r\n <label [for]=\"name\" class=\"field-label\" [class.visually-hidden]=\"!displayLabel\">\r\n {{ label | translate }}\r\n\r\n @if (isRequired) {\r\n <span class=\"text-danger\">*</span>\r\n }\r\n\r\n @if (tooltip) {\r\n <!-- <button type=\"button\" class=\"btn btn-link btn-popover\" placement=\"bottom\" [ngbPopover]=\"popContent\" container=\"body\"\r\n triggers=\"mouseenter:mouseleave\">\r\n <span class=\"btn-popover-icon bo-icons bo-help\"></span>\r\n </button>\r\n <ng-template #popContent>\r\n <div [innerHTML]=\"tooltip\"></div>\r\n </ng-template> -->\r\n }\r\n </label>\r\n }\r\n\r\n @if (addonLeft || addonRight) {\r\n <div class=\"field-group\">\r\n @if(addonLeft) {\r\n <ng-container [ngTemplateOutlet]=\"addonLeft\"></ng-container>\r\n }\r\n <ng-container [ngTemplateOutlet]=\"field\"></ng-container>\r\n @if(addonRight) {\r\n <ng-container [ngTemplateOutlet]=\"addonRight\"></ng-container>\r\n }\r\n </div>\r\n }\r\n @else {\r\n @if ( isInInputGroup() ) {\r\n <div class=\"field-group\">\r\n <ng-container [ngTemplateOutlet]=\"field\"></ng-container>\r\n </div>\r\n }\r\n @else {\r\n <ng-container [ngTemplateOutlet]=\"field\"></ng-container>\r\n }\r\n }\r\n\r\n <!-- Error message -->\r\n @if (controlOrGroup?.invalid && controlOrGroup?.touched) {\r\n <div class=\"field-invalid\" [id]=\"'error-' + name\">\r\n @if ((controlOrGroup?.errors?.['required']) || (getControl('start')?.errors?.['required'] || getControl('end')?.errors?.['required'])) {\r\n <span [innerHtml]=\"'_COMMON._FORM.ERROR_IS_MANDATORY' | translate: {label: label | translate}\"></span>\r\n }\r\n @if(controlOrGroup?.errors?.['rangeInvalid']) {\r\n <span>{{'_COMMON._DATES.ERROR_START_END_PERIOD' | translate}}</span>\r\n }\r\n </div>\r\n }\r\n\r\n @if (help) {\r\n <div [id]=\"name + '-help'\" class=\"field-text\">{{help | translate}}</div>\r\n }\r\n}\r\n@else {\r\n <ng-container [ngTemplateOutlet]=\"field\"></ng-container>\r\n}\r\n\r\n<ng-template #field>\r\n <!-- Text -->\r\n @if ([typeField.text, typeField.date, typeField.time, typeField.dateTime, typeField.number, typeField.file,\r\n typeField.email,\r\n typeField.color].includes(type)) {\r\n <input [type]=\"type\" class=\"field-control\" [id]=\"name\" [formControl]=\"formControl\"\r\n [ngClass]=\"[(cssClass || ''), formControl?.value ? 'has-value' : '']\"\r\n [attr.placeholder]=\"placeholder ? (placeholder | translate) : null\" [attr.required]=\"isRequired ? 'required' : null\"\r\n [attr.readonly]=\"isReadonly ? 'readonly' : null\" [disabled]=\"isEffectivelyDisabled\" [attr.aria-required]=\"isRequired\"\r\n [attr.aria-invalid]=\"control.invalid && control.touched\"\r\n [attr.aria-describedby]=\"control.invalid && control.touched ? 'error-' + name : null\" />\r\n }\r\n\r\n @if (type === typeField.password) {\r\n <input showHidePassword [type]=\"type\" class=\"field-control\" [id]=\"name\" [formControl]=\"formControl\"\r\n [ngClass]=\"[(cssClass || ''), formControl?.value ? 'has-value' : '']\"\r\n [attr.required]=\"isRequired ? 'required' : null\" [attr.readonly]=\"isReadonly ? 'readonly' : null\"\r\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\" [attr.aria-required]=\"isRequired\"\r\n [attr.aria-invalid]=\"control.invalid && control.touched\"\r\n [attr.aria-describedby]=\"control.invalid && control.touched ? 'error-' + name : null\" />\r\n }\r\n\r\n <!-- Textarea -->\r\n @if (type === typeField.textarea) {\r\n <textarea class=\"field-control\" [id]=\"name\" [formControl]=\"formControl\"\r\n [ngClass]=\"[(cssClass || ''), formControl?.value ? 'has-value' : '']\"\r\n [attr.placeholder]=\"placeholder ? (placeholder | translate) : null\" [attr.required]=\"isRequired ? 'required' : null\"\r\n [attr.readonly]=\"isReadonly ? 'readonly' : null\" [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\"\r\n [attr.aria-required]=\"isRequired\" [attr.aria-invalid]=\"control.invalid && control.touched\"\r\n [attr.aria-describedby]=\"control.invalid && control.touched ? 'error-' + name : null\"></textarea>\r\n }\r\n\r\n <!-- Select -->\r\n @if (type === typeField.select) {\r\n <ng-select [formControl]=\"formControl\" [items]=\"options\" bindLabel=\"label\" [labelForId]=\"name\" [appendTo]=\"appendTo\" bindValue=\"value\"\r\n [ngClass]=\"cssClass\" [searchable]=\"false\" [placeholder]=\"placeholder ? (placeholder | translate) : null\" [readonly]=\"isReadonly\" [clearable]=\"false\"\r\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\" [attr.required]=\"isRequired ? 'required' : null\"\r\n [attr.aria-required]=\"isRequired\" [attr.aria-invalid]=\"control.invalid && control.touched\"\r\n [attr.aria-describedby]=\"control.invalid && control.touched ? 'error-' + name : null\" [attr.id]=\"name\"\r\n (blur)=\"onBlur()\">\r\n\r\n <!-- Template pour les options -->\r\n <ng-template ng-option-tmp let-item=\"item\" let-index=\"index\" let-search=\"searchTerm\">\r\n @if (optionTemplate) {\r\n <ng-container *ngTemplateOutlet=\"optionTemplate; context: { item: item | translate, index: index, searchTerm: search }\"></ng-container>\r\n }\r\n @else {\r\n <div>{{ item.label | translate }}</div>\r\n }\r\n </ng-template>\r\n\r\n <!-- Template pour le label -->\r\n <ng-template ng-label-tmp let-item=\"item\">\r\n @if (labelTemplate) {\r\n <ng-container *ngTemplateOutlet=\"labelTemplate; context: { item: item | translate }\"></ng-container>\r\n }\r\n @else {\r\n {{ (item.label | translate) || (placeholder | translate) }}\r\n }\r\n </ng-template>\r\n </ng-select>\r\n }\r\n\r\n <!-- NgSelect -->\r\n @if (type === typeField.ngSelect || type === typeField.ngSelectMultiple) {\r\n <ng-select [formControl]=\"formControl\" [items]=\"options\" bindLabel=\"label\" [labelForId]=\"name\" [appendTo]=\"appendTo\" bindValue=\"value\"\r\n [multiple]=\"type === typeField.ngSelectMultiple\" [ngClass]=\"cssClass\" [clearable]=\"false\"\r\n [placeholder]=\"placeholder ? (placeholder | translate) : null\" [readonly]=\"isReadonly\"\r\n [notFoundText]=\"'_COMMON.NO_RESULT' | translate\" [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\"\r\n [attr.required]=\"isRequired ? 'required' : null\" [attr.aria-required]=\"isRequired\"\r\n [attr.aria-invalid]=\"control.invalid && control.touched\"\r\n [attr.aria-describedby]=\"control.invalid && control.touched ? 'error-' + name : null\" [attr.id]=\"name\"\r\n (blur)=\"onBlur()\" (search)=\"textChanged.emit($event?.term)\">\r\n\r\n <!-- Template pour les options -->\r\n <ng-template ng-option-tmp let-item=\"item\" let-index=\"index\" let-search=\"searchTerm\">\r\n @if (optionTemplate) {\r\n <ng-container *ngTemplateOutlet=\"optionTemplate; context: { item: item, index: index, searchTerm: search }\"></ng-container>\r\n }\r\n @else {\r\n <div>{{ item.label | translate }}</div>\r\n }\r\n </ng-template>\r\n\r\n <!-- Template pour le label -->\r\n <ng-template ng-label-tmp let-item=\"item\" let-clear=\"clear\">\r\n <span class=\"ng-value-icon left\" (click)=\"clear(item)\" aria-hidden=\"true\">\u00D7</span>\r\n @if (labelTemplate) {\r\n <ng-container *ngTemplateOutlet=\"labelTemplate; context: { item: item | translate }\"></ng-container>\r\n }\r\n @else {\r\n {{ (item.label | translate) || (placeholder | translate) }}\r\n }\r\n </ng-template>\r\n </ng-select>\r\n }\r\n\r\n <!-- Radio -->\r\n @if (type === typeField.radioInline || type === typeField.radio) {\r\n <fieldset\r\n [attr.aria-required]=\"isRequired\"\r\n [attr.aria-invalid]=\"control.invalid && control.touched\"\r\n [attr.aria-describedby]=\"control.invalid && control.touched ? 'error-' + name : null\">\r\n <legend class=\"field-label\" [class.visually-hidden]=\"!displayLabel\">\r\n {{label | translate}}\r\n @if(isRequired) {\r\n <span class=\"text-danger\">*</span>\r\n }\r\n </legend>\r\n <ul class=\"list-unstyled mb-none\" [ngClass]=\"type === typeField.radioInline ? 'd-flex-h gap-md flex-wrap' : 'd-flex-v'\">\r\n @for (opt of options; track opt.value) {\r\n <li class=\"field-check\">\r\n <input type=\"radio\" [id]=\"name + '_' + opt.value\" [value]=\"opt.value\" [formControl]=\"formControl\"\r\n class=\"field-check-input\" [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\" (change)=\"onRadioChange(opt.value)\" />\r\n <label [for]=\"name + '_' + opt.value\" class=\"field-check-label\">{{ opt.label | translate }}</label>\r\n </li>\r\n }\r\n </ul>\r\n </fieldset>\r\n }\r\n\r\n <!-- Radio button -->\r\n @if (type === typeField.radioButton) {\r\n <fieldset\r\n [attr.aria-required]=\"isRequired\"\r\n [attr.aria-invalid]=\"control.invalid && control.touched\"\r\n [attr.aria-describedby]=\"control.invalid && control.touched ? 'error-' + name : null\">\r\n <legend class=\"field-label\" [class.visually-hidden]=\"!displayLabel\">\r\n {{label | translate}}\r\n @if(isRequired) {\r\n <span class=\"text-danger\">*</span>\r\n }\r\n </legend>\r\n <div class=\"field-group field-group-btn\">\r\n @for (opt of options; track opt.value) {\r\n <input type=\"radio\" [id]=\"name + '_' + opt.value\" [value]=\"opt.value\" [formControl]=\"formControl\"\r\n class=\"visually-hidden\" [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\" (change)=\"onRadioChange(opt.value)\"/>\r\n <label [for]=\"name + '_' + opt.value\" class=\"btn btn-field-group\">{{ opt.label | translate }}</label>\r\n }\r\n </div>\r\n </fieldset>\r\n }\r\n\r\n <!-- Checkbox Switch -->\r\n @if ( type === typeField.switch || type === typeField.switchSmall)\r\n {\r\n <div class=\"field-check field-switch\" [ngClass]=\"{'field-switch-small': type === typeField.switchSmall}\">\r\n <input type=\"checkbox\" [id]=\"name\" [formControl]=\"formControl\" class=\"field-check-input\" [attr.aria-required]=\"isRequired\"\r\n [attr.aria-invalid]=\"control.invalid && control.touched\"\r\n [attr.aria-describedby]=\"control.invalid && control.touched ? 'error-' + name : null\"\r\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\"/>\r\n <label [for]=\"name\" class=\"field-check-label\">{{ label | translate }}</label>\r\n </div>\r\n }\r\n\r\n <!-- Checkbox -->\r\n @if (type === typeField.checkboxInline || type === typeField.checkbox) {\r\n @if (isSingleCheckbox()) {\r\n <div class=\"field-check\" [class.field-check-inline]=\"type === typeField.checkboxInline\">\r\n <input #checkboxInput type=\"checkbox\" [id]=\"name\" [formControl]=\"formControl\"\r\n class=\"field-check-input\"\r\n [class.is-invalid]=\"control?.invalid && control?.touched\"\r\n [attr.aria-required]=\"isRequired\"\r\n [attr.aria-invalid]=\"control?.invalid && control?.touched\"\r\n [attr.aria-describedby]=\"control?.invalid && control?.touched ? 'error-' + name : null\"\r\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\" />\r\n <label [for]=\"name\" class=\"field-check-label\">\r\n {{ label | translate }}\r\n @if (isRequired) {\r\n <span class=\"text-danger\">*</span>\r\n }\r\n </label>\r\n </div>\r\n }\r\n @else if( options.length > 1) {\r\n <fieldset\r\n [attr.aria-required]=\"isRequired\"\r\n [attr.aria-invalid]=\"control.invalid && control.touched\"\r\n [attr.aria-describedby]=\"control.invalid && control.touched ? 'error-' + name : null\"\r\n [ngClass]=\"{ 'flex-column': type === typeField.checkbox }\">\r\n <legend class=\"field-label\" [class.visually-hidden]=\"!displayLabel\">\r\n {{label | translate}}\r\n @if(isRequired) {\r\n <span class=\"text-danger\">*</span>\r\n }\r\n </legend>\r\n <ul class=\"list-unstyled mb-none\" [ngClass]=\"type === typeField.checkboxInline ? 'd-flex-h gap-md' : 'd-flex-v'\">\r\n @for (opt of options; track opt.value) {\r\n <li class=\"field-check\" [ngClass]=\"{ 'field-check-inline': type === typeField.checkboxInline }\">\r\n <input type=\"checkbox\" [id]=\"name + '_' + opt.value\" [value]=\"opt.value\" (change)=\"onCheckboxChange($event)\"\r\n [checked]=\"control.value?.includes(opt.value)\" class=\"field-check-input\"\r\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\" />\r\n <label [for]=\"name + '_' + opt.value\" class=\"field-check-label\">\r\n {{ opt.label | translate }}\r\n </label>\r\n </li>\r\n }\r\n </ul>\r\n </fieldset>\r\n }\r\n @else {\r\n <fieldset>\r\n <legend class=\"field-label\" [class.visually-hidden]=\"!displayLabel\">\r\n {{label | translate}}\r\n </legend>\r\n <ul class=\"list-unstyled mb-none\" [ngClass]=\"type === typeField.checkboxInline ? 'd-flex-h gap-md' : 'd-flex-v'\">\r\n @for (opt of options; track opt.value) {\r\n <li class=\"field-check\" [ngClass]=\"{ 'field-check-inline': type === typeField.checkboxInline }\">\r\n <input type=\"checkbox\" [id]=\"name + '_' + opt.value\" [value]=\"opt.value\" (change)=\"onCheckboxChange($event)\"\r\n [checked]=\"control.value?.includes(opt.value)\" class=\"field-check-input\"\r\n [attr.aria-required]=\"isRequired\"\r\n [attr.aria-invalid]=\"control.invalid && control.touched\"\r\n [attr.aria-describedby]=\"control.invalid && control.touched ? 'error-' + name : null\"\r\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\" />\r\n <label [for]=\"name + '_' + opt.value\" class=\"field-check-label\">\r\n {{ opt.label | translate }}\r\n @if(isRequired) {\r\n <span class=\"text-danger\">*</span>\r\n }\r\n </label>\r\n </li>\r\n }\r\n </ul>\r\n </fieldset>\r\n }\r\n }\r\n\r\n <!-- Checkbox button -->\r\n @if (type === typeField.checkboxButton && options.length > 0) {\r\n\r\n @if(options.length > 1) {\r\n <fieldset\r\n [attr.aria-required]=\"isRequired\"\r\n [attr.aria-invalid]=\"control.invalid && control.touched\"\r\n [attr.aria-describedby]=\"control.invalid && control.touched ? 'error-' + name : null\">\r\n <legend class=\"field-label\" [class.visually-hidden]=\"!displayLabel\">\r\n {{label | translate}}\r\n @if(isRequired) {\r\n <span class=\"text-danger\">*</span>\r\n }\r\n </legend>\r\n <div class=\"field-group field-group-btn\">\r\n @for (opt of options; track opt.value) {\r\n <input type=\"checkbox\" [id]=\"name + '_' + opt.value\" [value]=\"opt.value\" (change)=\"onCheckboxChange($event)\"\r\n [checked]=\"control.value?.includes(opt.value)\" class=\"visually-hidden\"\r\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\" />\r\n <label [for]=\"name + '_' + opt.value\" class=\"btn btn-field-group\">{{ opt.label | translate }}</label>\r\n }\r\n </div>\r\n </fieldset>\r\n }\r\n @else {\r\n <fieldset>\r\n <legend class=\"field-label\" [class.visually-hidden]=\"!displayLabel\">\r\n {{label | translate}}\r\n </legend>\r\n <div class=\"btn-group btn-group-secondary\">\r\n @for (opt of options; track opt.value) {\r\n <input type=\"checkbox\" [id]=\"name + '_' + opt.value\" [value]=\"opt.value\" (change)=\"onCheckboxChange($event)\"\r\n [checked]=\"control.value?.includes(opt.value)\" class=\"visually-hidden\"\r\n [attr.aria-required]=\"isRequired\"\r\n [attr.aria-invalid]=\"control.invalid && control.touched\"\r\n [attr.aria-describedby]=\"control.invalid && control.touched ? 'error-' + name : null\"\r\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\"/>\r\n <label [for]=\"name + '_' + opt.value\" class=\"btn btn-field-group\">\r\n {{ opt.label | translate}}\r\n @if(isRequired) {\r\n <span class=\"text-danger\">*</span>\r\n }\r\n </label>\r\n }\r\n </div>\r\n </fieldset>\r\n }\r\n }\r\n\r\n <!-- Period - DateToDate / TimeToTime / DateTimeToDateTime -->\r\n @if ([typeField.dateToDate, typeField.timeToTime, typeField.dateTimeToDateTime].includes(type) && isRange) {\r\n\r\n <div class=\"field-group\">\r\n <input [type]=\"getInputType()\" class=\"field-control\" [id]=\"name + '_start'\" [formControl]=\"getControl('start')\"\r\n [attr.placeholder]=\"type === typeField.timeToTime ? ('_COMMON._DATES.FROM' | translate) : ('_COMMON._DATES.FROM_TO_1' | translate)\"\r\n [ngClass]=\"[(cssClass || ''), getControl('start')?.value ? 'has-value' : '']\"\r\n [attr.required]=\"isRequired ? 'required' : null\" [attr.readonly]=\"isReadonly ? 'readonly' : null\"\r\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\" [attr.aria-required]=\"isRequired\"\r\n [attr.aria-invalid]=\"getControl('start')?.invalid && getControl('start')?.touched\"\r\n [attr.aria-describedby]=\"getControl('start')?.invalid && getControl('start')?.touched ? 'error-' + name : null\" />\r\n\r\n @if(getControl('start')?.value) {\r\n <button type=\"button\" class=\"btn btn-secondary btn-clear-field\"\r\n (click)=\"onClearFieldPeriod('start')\">\r\n ×\r\n </button>\r\n }\r\n\r\n <input [type]=\"getInputType()\" class=\"field-control\" [id]=\"name + '_end'\" [formControl]=\"getControl('end')\"\r\n [attr.placeholder]=\"type === typeField.timeToTime ? ('_COMMON._DATES.TO' | translate) : ('_COMMON._DATES.FROM_TO_2' | translate)\"\r\n [ngClass]=\"[(cssClass || ''), getControl('end')?.value ? 'has-value' : '']\"\r\n [attr.required]=\"isRequired ? 'required' : null\" [attr.readonly]=\"isReadonly ? 'readonly' : null\"\r\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\"\r\n [attr.aria-invalid]=\"getControl('end')?.invalid && getControl('end')?.touched\"\r\n [attr.aria-describedby]=\"getControl('end')?.invalid && getControl('end')?.touched ? 'error-' + name : null\" />\r\n\r\n @if(getControl('end')?.value) {\r\n <button type=\"button\" class=\"btn btn-secondary btn-clear-field\"\r\n (click)=\"onClearFieldPeriod('end')\">\r\n ×\r\n </button>\r\n }\r\n </div>\r\n }\r\n\r\n @if ([typeField.datePlusOne, typeField.datePlusTwo, typeField.datePlusSeven, typeField.dateComplexe].includes(type)) {\r\n\r\n @if (type === typeField.dateComplexe) {\r\n <button class=\"btn btn-secondary\" type=\"button\" (click)=\"onDateAddDay('prev')\"\r\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\">\r\n <cw-icon font=\"optyweb\" [icon]=\"spriteIcon.nextLeft\" [label]=\"'Jour pr\u00E9c\u00E9dent'\"></cw-icon>\r\n </button>\r\n }\r\n\r\n <input type=\"date\" class=\"field-control\" [id]=\"name\" [formControl]=\"formControl\"\r\n [ngClass]=\"[(cssClass || ''), formControl?.value ? 'has-value' : '']\"\r\n [attr.placeholder]=\"placeholder ? placeholder : null\" [attr.required]=\"isRequired ? 'required' : null\"\r\n [attr.readonly]=\"isReadonly ? 'readonly' : null\" [disabled]=\"isEffectivelyDisabled\" [attr.aria-required]=\"isRequired\"\r\n [attr.aria-invalid]=\"control.invalid && control.touched\"\r\n [attr.aria-describedby]=\"control.invalid && control.touched ? 'error-' + name : null\" />\r\n\r\n @if(formControl?.value) {\r\n <button class=\"btn btn-secondary btn-clear-field\" type=\"button\"\r\n (click)=\"onClearField(formControl)\">×</button>\r\n }\r\n\r\n @if (type === typeField.dateComplexe) {\r\n <button class=\"btn btn-secondary\" type=\"button\" (click)=\"onDateAddDay('next')\"\r\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\">\r\n <cw-icon font=\"optyweb\" [icon]=\"spriteIcon.nextRight\" [label]=\"'Jour suivant'\"></cw-icon>\r\n </button>\r\n <button class=\"btn btn-secondary\" type=\"button\" (click)=\"onRefresh()\"\r\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\">\r\n <cw-icon font=\"optyweb\" [icon]=\"spriteIcon.toolbarRefresh\" [label]=\"'Rafra\u00EEchir'\"></cw-icon>\r\n </button>\r\n }\r\n\r\n <button class=\"btn btn-secondary\" type=\"button\" (click)=\"onTodayAddDay(0)\"\r\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\">\r\n J\r\n <span class=\"visually-hidden\">Aujourd'hui</span>\r\n </button>\r\n <button class=\"btn btn-secondary\" type=\"button\" (click)=\"onTodayAddDay(1)\"\r\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\">\r\n J+1\r\n <span class=\"visually-hidden\">Demain</span>\r\n </button>\r\n\r\n @if (type !== typeField.datePlusOne && type !== typeField.dateComplexe) {\r\n <button class=\"btn btn-secondary \" type=\"button\" (click)=\"onTodayAddDay(2)\"\r\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\">\r\n J+2\r\n <span class=\"visually-hidden\">Dans 2 jours</span>\r\n </button>\r\n\r\n @if (type !== typeField.datePlusTwo) {\r\n <button class=\"btn btn-secondary\" type=\"button\" (click)=\"onTodayAddDay(7)\"\r\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\">\r\n J+7\r\n <span class=\"visually-hidden\">Dans 7 jours</span>\r\n </button>\r\n }\r\n }\r\n }\r\n\r\n @if (type === typeField.slider) {\r\n <ngx-slider [(value)]=\"sliderValue\" [options]=\"sliderOptions\" [formControl]=\"formControl\"></ngx-slider>\r\n }\r\n\r\n @if (type === typeField.range) {\r\n <div class=\"slider\">\r\n\r\n <cw-button [isDisabled]=\"formControl.value <= rangeOptions.floor\" [label]=\"'Diminuer ' + formControl.value + ' ' + label\"\r\n [withIcon]=\"spriteIcon.toolbarMinus\" [withOnlyIcon]=\"true\" [type]=\"buttonType.primary\"\r\n [iconSize]=\"buttonIconSize.small\" (btnAction)=\"onRangeStep('decrease')\">\r\n </cw-button>\r\n\r\n <div class=\"slider-input\">\r\n <label [for]=\"name\" class=\"slider-tooltip\" [style.left]=\"getRangePercent() + '%'\" aria-live=\"polite\"\r\n aria-atomic=\"true\">\r\n {{ label | translate }} {{ formControl.value }}\r\n @if (rangeOptions.unit) {\r\n <abbr [title]=\"rangeOptions.unit\">{{ rangeOptions.unit }}</abbr>\r\n }\r\n </label>\r\n\r\n <div class=\"slider-custom-bar\">\r\n <div class=\"slider-custom-bar-selection\" [style.width]=\"getRangePercent() + '%'\">\r\n </div>\r\n </div>\r\n\r\n <input type=\"range\" [id]=\"name\" [formControl]=\"formControl\" [min]=\"rangeOptions.floor\" [max]=\"rangeOptions.ceil\"\r\n [step]=\"rangeOptions.step || 1\" class=\"field-control-range\" [attr.aria-required]=\"isRequired\"\r\n [attr.aria-invalid]=\"control.invalid && control.touched\" [disabled]=\"isEffectivelyDisabled\">\r\n </div>\r\n\r\n <cw-button [isDisabled]=\"formControl.value >= rangeOptions.ceil\" [label]=\"'Augmenter ' + formControl.value + ' ' + label\"\r\n [withIcon]=\"spriteIcon.toolbarPlus\" [withOnlyIcon]=\"true\" [type]=\"buttonType.primary\"\r\n [iconSize]=\"buttonIconSize.small\" (btnAction)=\"onRangeStep('increase')\">\r\n </cw-button>\r\n </div>\r\n }\r\n\r\n @if (isInInputGroup() && clearable) {\r\n @if(formControl?.value) {\r\n <button class=\"btn btn-secondary btn-clear-field\" type=\"button\"\r\n (click)=\"onClearField(formControl)\">×</button>\r\n }\r\n }\r\n\r\n</ng-template>\r\n" }]
|
|
1986
2039
|
}], ctorParameters: () => [], propDecorators: { control: [{
|
|
1987
2040
|
type: Input
|
|
1988
2041
|
}], formGroup: [{
|
|
@@ -2029,7 +2082,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.19", ngImpo
|
|
|
2029
2082
|
type: Input
|
|
2030
2083
|
}], appendTo: [{
|
|
2031
2084
|
type: Input
|
|
2032
|
-
}], refreshEvent: [{
|
|
2085
|
+
}], indeterminate: [{ type: i0.Input, args: [{ isSignal: true, alias: "indeterminate", required: false }] }], checkboxInputRef: [{ type: i0.ViewChild, args: ['checkboxInput', { isSignal: true }] }], refreshEvent: [{
|
|
2033
2086
|
type: Output
|
|
2034
2087
|
}], textChanged: [{
|
|
2035
2088
|
type: Output
|
|
@@ -2055,11 +2108,12 @@ var LegendTypeEnum;
|
|
|
2055
2108
|
|
|
2056
2109
|
class LegendComponent {
|
|
2057
2110
|
constructor() {
|
|
2058
|
-
this.
|
|
2111
|
+
this.legend = input.required(...(ngDevMode ? [{ debugName: "legend" }] : []));
|
|
2112
|
+
this.displayInline = input(false, ...(ngDevMode ? [{ debugName: "displayInline" }] : []));
|
|
2059
2113
|
this.legendTypeEnum = LegendTypeEnum;
|
|
2060
2114
|
}
|
|
2061
2115
|
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) {\
|
|
2116
|
+
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
2117
|
}
|
|
2064
2118
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.19", ngImport: i0, type: LegendComponent, decorators: [{
|
|
2065
2119
|
type: Component,
|
|
@@ -2068,12 +2122,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.19", ngImpo
|
|
|
2068
2122
|
IconComponent,
|
|
2069
2123
|
BadgeComponent,
|
|
2070
2124
|
TranslateModule
|
|
2071
|
-
], template: "@if (legend.title) {\
|
|
2072
|
-
}],
|
|
2073
|
-
type: Input
|
|
2074
|
-
}], displayInline: [{
|
|
2075
|
-
type: Input
|
|
2076
|
-
}] } });
|
|
2125
|
+
], 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" }]
|
|
2126
|
+
}], propDecorators: { legend: [{ type: i0.Input, args: [{ isSignal: true, alias: "legend", required: true }] }], displayInline: [{ type: i0.Input, args: [{ isSignal: true, alias: "displayInline", required: false }] }] } });
|
|
2077
2127
|
|
|
2078
2128
|
class LoaderComponent {
|
|
2079
2129
|
constructor() { }
|
|
@@ -2120,48 +2170,43 @@ class ModalsService {
|
|
|
2120
2170
|
* Ouvre une modale et retourne un objet compatible avec l'ancienne syntaxe .result
|
|
2121
2171
|
*/
|
|
2122
2172
|
openModal(type, config, sizeOverride) {
|
|
2123
|
-
// 1. Détermination des propriétés de base
|
|
2124
2173
|
const size = sizeOverride ?? this.getModalSizeByType(type);
|
|
2125
2174
|
const isQuickView = type === ModalsType.quickSideView;
|
|
2126
|
-
// 2. Création dynamique du composant
|
|
2127
2175
|
const componentRef = createComponent(ModalsComponent, {
|
|
2128
2176
|
environmentInjector: this.appRef.injector,
|
|
2129
2177
|
elementInjector: this.injector
|
|
2130
2178
|
});
|
|
2131
|
-
|
|
2132
|
-
componentRef.
|
|
2133
|
-
componentRef.
|
|
2134
|
-
componentRef.
|
|
2135
|
-
componentRef.instance.customClass = isQuickView ? 'quick-view-modal' : '';
|
|
2179
|
+
componentRef.setInput('type', type);
|
|
2180
|
+
componentRef.setInput('size', size);
|
|
2181
|
+
componentRef.setInput('scrollable', isQuickView);
|
|
2182
|
+
componentRef.setInput('customClass', isQuickView ? 'quick-view-modal' : '');
|
|
2136
2183
|
if (config) {
|
|
2137
|
-
Object.
|
|
2184
|
+
for (const [key, value] of Object.entries(config)) {
|
|
2185
|
+
if (value !== undefined) {
|
|
2186
|
+
componentRef.setInput(key, value);
|
|
2187
|
+
}
|
|
2188
|
+
}
|
|
2138
2189
|
}
|
|
2139
|
-
// 4. Gestion de la Promesse (le fameux .result)
|
|
2140
2190
|
const resultPromise = new Promise((resolve, reject) => {
|
|
2141
|
-
// Succès : quand le bouton d'action est cliqué
|
|
2142
2191
|
const subAction = componentRef.instance.btnAction1.subscribe((data) => {
|
|
2143
2192
|
subAction.unsubscribe();
|
|
2144
2193
|
resolve(data || 'confirm');
|
|
2145
2194
|
});
|
|
2146
2195
|
const subAction2 = componentRef.instance.btnAction2.subscribe((data) => {
|
|
2147
|
-
|
|
2196
|
+
subAction2.unsubscribe();
|
|
2148
2197
|
resolve(data || 'confirm');
|
|
2149
2198
|
});
|
|
2150
|
-
// Échec/Fermeture : on intercepte la fermeture via dismissModal
|
|
2151
2199
|
const subDismiss = this.dismissModal.subscribe(() => {
|
|
2152
2200
|
subDismiss.unsubscribe();
|
|
2153
2201
|
reject('closed');
|
|
2154
2202
|
});
|
|
2155
2203
|
});
|
|
2156
|
-
// 5. Intégration au DOM
|
|
2157
2204
|
const domElem = componentRef.hostView.rootNodes[0];
|
|
2158
2205
|
document.body.appendChild(domElem);
|
|
2159
2206
|
this.appRef.attachView(componentRef.hostView);
|
|
2160
2207
|
document.body.classList.add('modal-open');
|
|
2161
|
-
// 6. Gestion de la pile et du focus
|
|
2162
2208
|
this.saveFocus();
|
|
2163
2209
|
this.modalsStack.push(componentRef);
|
|
2164
|
-
// Retourne un objet ModalRef
|
|
2165
2210
|
return {
|
|
2166
2211
|
componentInstance: componentRef.instance,
|
|
2167
2212
|
result: resultPromise
|
|
@@ -2173,17 +2218,13 @@ class ModalsService {
|
|
|
2173
2218
|
closeModal() {
|
|
2174
2219
|
const currentModal = this.modalsStack.pop();
|
|
2175
2220
|
if (currentModal) {
|
|
2176
|
-
const modalClass = currentModal.instance.customClass ?? '';
|
|
2177
|
-
// Retrait du DOM
|
|
2221
|
+
const modalClass = currentModal.instance.customClass() ?? '';
|
|
2178
2222
|
this.appRef.detachView(currentModal.hostView);
|
|
2179
2223
|
currentModal.destroy();
|
|
2180
|
-
// Gestion du body
|
|
2181
2224
|
if (this.modalsStack.length === 0) {
|
|
2182
2225
|
document.body.classList.remove('modal-open');
|
|
2183
2226
|
}
|
|
2184
|
-
// Restauration focus
|
|
2185
2227
|
this.restoreFocus();
|
|
2186
|
-
// On émet l'événement (ce qui déclenchera le reject de la promesse plus haut)
|
|
2187
2228
|
this.dismissModal.emit(modalClass);
|
|
2188
2229
|
}
|
|
2189
2230
|
}
|
|
@@ -2225,14 +2266,21 @@ class ModalsComponent {
|
|
|
2225
2266
|
constructor() {
|
|
2226
2267
|
this.modalService = inject(ModalsService);
|
|
2227
2268
|
this.translateService = inject(TranslateService);
|
|
2228
|
-
this.
|
|
2229
|
-
this.
|
|
2230
|
-
this.
|
|
2231
|
-
this.
|
|
2232
|
-
this.
|
|
2233
|
-
this.
|
|
2234
|
-
this.
|
|
2235
|
-
this.
|
|
2269
|
+
this.modalContainer = viewChild.required('modalContainer');
|
|
2270
|
+
this.size = input(ModalsSize.md, ...(ngDevMode ? [{ debugName: "size" }] : []));
|
|
2271
|
+
this.customClass = input('', ...(ngDevMode ? [{ debugName: "customClass" }] : []));
|
|
2272
|
+
this.scrollable = input(false, ...(ngDevMode ? [{ debugName: "scrollable" }] : []));
|
|
2273
|
+
this.isAutcompModal = input(false, ...(ngDevMode ? [{ debugName: "isAutcompModal" }] : []));
|
|
2274
|
+
this.type = input.required(...(ngDevMode ? [{ debugName: "type" }] : []));
|
|
2275
|
+
this.modalTitle = input(...(ngDevMode ? [undefined, { debugName: "modalTitle" }] : []));
|
|
2276
|
+
this.itemsToDelete = input([], ...(ngDevMode ? [{ debugName: "itemsToDelete" }] : []));
|
|
2277
|
+
this.itemsToDeleteTitle = input(this.translateService.instant('_COMMON._MODAL_DELETE.DEFAULT_TYPE'), ...(ngDevMode ? [{ debugName: "itemsToDeleteTitle" }] : []));
|
|
2278
|
+
this.labelBtnAction1 = input(...(ngDevMode ? [undefined, { debugName: "labelBtnAction1" }] : []));
|
|
2279
|
+
this.labelBtnAction2 = input(...(ngDevMode ? [undefined, { debugName: "labelBtnAction2" }] : []));
|
|
2280
|
+
this.customBodyTemplate = input(...(ngDevMode ? [undefined, { debugName: "customBodyTemplate" }] : []));
|
|
2281
|
+
this.customBodyContext = input(...(ngDevMode ? [undefined, { debugName: "customBodyContext" }] : []));
|
|
2282
|
+
this.btnAction1 = output();
|
|
2283
|
+
this.btnAction2 = output();
|
|
2236
2284
|
this.modalsType = ModalsType;
|
|
2237
2285
|
this.buttonTypeEnum = { ...FoButtonTypeEnum, ...BoButtonTypeEnum };
|
|
2238
2286
|
this.spriteIcon = SpriteIconEnum;
|
|
@@ -2244,10 +2292,10 @@ class ModalsComponent {
|
|
|
2244
2292
|
this.modalService.openedModal.emit(true);
|
|
2245
2293
|
}
|
|
2246
2294
|
ngAfterViewInit() {
|
|
2247
|
-
setTimeout(() => this.trapFocus(this.modalContainer.nativeElement), 0);
|
|
2295
|
+
setTimeout(() => this.trapFocus(this.modalContainer().nativeElement), 0);
|
|
2248
2296
|
}
|
|
2249
2297
|
onKeyDown(e) {
|
|
2250
|
-
if (this.type === this.modalsType.loader) {
|
|
2298
|
+
if (this.type() === this.modalsType.loader) {
|
|
2251
2299
|
e.preventDefault();
|
|
2252
2300
|
return;
|
|
2253
2301
|
}
|
|
@@ -2279,25 +2327,23 @@ class ModalsComponent {
|
|
|
2279
2327
|
return;
|
|
2280
2328
|
const firstFocusableEl = focusableEls[0];
|
|
2281
2329
|
const lastFocusableEl = focusableEls[focusableEls.length - 1];
|
|
2282
|
-
// Logique Autocomplete peut etre à externaliser ou élargir la notion
|
|
2283
2330
|
const autocompleteInput = focusableEls.find(x => x.getAttribute('aria-controls') === 'autocompletion-panel');
|
|
2284
|
-
if (autocompleteInput && this.isAutcompModal) {
|
|
2331
|
+
if (autocompleteInput && this.isAutcompModal()) {
|
|
2285
2332
|
autocompleteInput.focus();
|
|
2286
2333
|
}
|
|
2287
2334
|
else {
|
|
2288
2335
|
firstFocusableEl.focus();
|
|
2289
2336
|
}
|
|
2290
|
-
// Listener pour le Tab (on l'attache au container)
|
|
2291
2337
|
element.addEventListener('keydown', (e) => {
|
|
2292
2338
|
if (e.key !== 'Tab')
|
|
2293
2339
|
return;
|
|
2294
|
-
if (e.shiftKey) {
|
|
2340
|
+
if (e.shiftKey) {
|
|
2295
2341
|
if (document.activeElement === firstFocusableEl) {
|
|
2296
2342
|
lastFocusableEl.focus();
|
|
2297
2343
|
e.preventDefault();
|
|
2298
2344
|
}
|
|
2299
2345
|
}
|
|
2300
|
-
else {
|
|
2346
|
+
else {
|
|
2301
2347
|
if (document.activeElement === lastFocusableEl) {
|
|
2302
2348
|
firstFocusableEl.focus();
|
|
2303
2349
|
e.preventDefault();
|
|
@@ -2306,55 +2352,26 @@ class ModalsComponent {
|
|
|
2306
2352
|
});
|
|
2307
2353
|
}
|
|
2308
2354
|
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>\
|
|
2355
|
+
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
2356
|
}
|
|
2311
2357
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.19", ngImport: i0, type: ModalsComponent, decorators: [{
|
|
2312
2358
|
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
|
-
}] } });
|
|
2359
|
+
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" }]
|
|
2360
|
+
}], 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
2361
|
|
|
2347
2362
|
class TabContentComponent {
|
|
2348
2363
|
constructor() {
|
|
2349
|
-
this.
|
|
2364
|
+
this.title = input.required(...(ngDevMode ? [{ debugName: "title" }] : []));
|
|
2365
|
+
this.disabled = input(false, ...(ngDevMode ? [{ debugName: "disabled" }] : []));
|
|
2366
|
+
this.withIcon = input(...(ngDevMode ? [undefined, { debugName: "withIcon" }] : []));
|
|
2350
2367
|
this.id = 0;
|
|
2351
2368
|
this.active = false;
|
|
2352
2369
|
}
|
|
2353
2370
|
get fragment() {
|
|
2354
|
-
return UtilsHelper.slugify(this.title);
|
|
2371
|
+
return UtilsHelper.slugify(this.title());
|
|
2355
2372
|
}
|
|
2356
2373
|
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: "
|
|
2374
|
+
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
2375
|
<div class="tab-pane"
|
|
2359
2376
|
[class.fade]="!active"
|
|
2360
2377
|
[class.active]="active"
|
|
@@ -2385,13 +2402,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.19", ngImpo
|
|
|
2385
2402
|
`,
|
|
2386
2403
|
standalone: true
|
|
2387
2404
|
}]
|
|
2388
|
-
}], propDecorators: { title: [{
|
|
2389
|
-
type: Input
|
|
2390
|
-
}], disabled: [{
|
|
2391
|
-
type: Input
|
|
2392
|
-
}], withIcon: [{
|
|
2393
|
-
type: Input
|
|
2394
|
-
}] } });
|
|
2405
|
+
}], 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
2406
|
|
|
2396
2407
|
var FoTabTypeEnum;
|
|
2397
2408
|
(function (FoTabTypeEnum) {
|
|
@@ -2405,30 +2416,34 @@ var BoTabTypeEnum;
|
|
|
2405
2416
|
})(BoTabTypeEnum || (BoTabTypeEnum = {}));
|
|
2406
2417
|
|
|
2407
2418
|
class TabComponent {
|
|
2408
|
-
constructor(
|
|
2409
|
-
this.router =
|
|
2410
|
-
this.route =
|
|
2411
|
-
this.type = FoTabTypeEnum.defaultMd;
|
|
2412
|
-
this.
|
|
2413
|
-
this.
|
|
2414
|
-
this.
|
|
2415
|
-
this.
|
|
2419
|
+
constructor() {
|
|
2420
|
+
this.router = inject(Router);
|
|
2421
|
+
this.route = inject(ActivatedRoute);
|
|
2422
|
+
this.type = input(FoTabTypeEnum.defaultMd, ...(ngDevMode ? [{ debugName: "type" }] : []));
|
|
2423
|
+
this.id = input(...(ngDevMode ? [undefined, { debugName: "id" }] : []));
|
|
2424
|
+
this.useFragment = input(true, ...(ngDevMode ? [{ debugName: "useFragment" }] : []));
|
|
2425
|
+
this.title = input(...(ngDevMode ? [undefined, { debugName: "title" }] : []));
|
|
2426
|
+
this.tabContentCssClass = input('', ...(ngDevMode ? [{ debugName: "tabContentCssClass" }] : []));
|
|
2427
|
+
this.activeTabIndex = input(0, ...(ngDevMode ? [{ debugName: "activeTabIndex" }] : []));
|
|
2428
|
+
this.tabs = contentChildren(TabContentComponent, ...(ngDevMode ? [{ debugName: "tabs" }] : []));
|
|
2429
|
+
this.tabLinks = viewChildren('tabLink', ...(ngDevMode ? [{ debugName: "tabLinks" }] : []));
|
|
2430
|
+
this.tabChanged = output();
|
|
2416
2431
|
this.activeId = 0;
|
|
2417
2432
|
this.iconSize = IconSizeEnum['md'];
|
|
2418
2433
|
this.tabTypeEnum = FoTabTypeEnum && BoTabTypeEnum;
|
|
2419
2434
|
}
|
|
2420
2435
|
ngAfterContentInit() {
|
|
2421
|
-
const tabsArray = this.tabs
|
|
2436
|
+
const tabsArray = [...this.tabs()];
|
|
2422
2437
|
tabsArray.forEach((tab, index) => {
|
|
2423
2438
|
tab.id = index;
|
|
2424
2439
|
tab.active = false;
|
|
2425
2440
|
});
|
|
2426
|
-
const firstActiveIndex = tabsArray.findIndex(t => !t.disabled);
|
|
2427
|
-
this.activeId = this.activeTabIndex ?? (firstActiveIndex !== -1 ? firstActiveIndex : 0);
|
|
2428
|
-
if (this.useFragment) {
|
|
2441
|
+
const firstActiveIndex = tabsArray.findIndex(t => !t.disabled());
|
|
2442
|
+
this.activeId = this.activeTabIndex() ?? (firstActiveIndex !== -1 ? firstActiveIndex : 0);
|
|
2443
|
+
if (this.useFragment()) {
|
|
2429
2444
|
this.route.fragment.subscribe(fragment => {
|
|
2430
2445
|
if (fragment) {
|
|
2431
|
-
const foundIndex = tabsArray.findIndex(tab => tab.fragment === fragment && !tab.disabled);
|
|
2446
|
+
const foundIndex = tabsArray.findIndex(tab => tab.fragment === fragment && !tab.disabled());
|
|
2432
2447
|
if (foundIndex !== -1) {
|
|
2433
2448
|
this.activeId = foundIndex;
|
|
2434
2449
|
}
|
|
@@ -2441,12 +2456,12 @@ class TabComponent {
|
|
|
2441
2456
|
}
|
|
2442
2457
|
}
|
|
2443
2458
|
selectTab(tab) {
|
|
2444
|
-
if (tab.disabled)
|
|
2459
|
+
if (tab.disabled())
|
|
2445
2460
|
return;
|
|
2446
|
-
this.tabs.forEach(t => t.active = false);
|
|
2461
|
+
this.tabs().forEach(t => t.active = false);
|
|
2447
2462
|
tab.active = true;
|
|
2448
2463
|
this.activeId = tab.id;
|
|
2449
|
-
if (this.useFragment) {
|
|
2464
|
+
if (this.useFragment()) {
|
|
2450
2465
|
this.router.navigate([], {
|
|
2451
2466
|
relativeTo: this.route,
|
|
2452
2467
|
fragment: tab.fragment,
|
|
@@ -2457,8 +2472,8 @@ class TabComponent {
|
|
|
2457
2472
|
this.tabChanged.emit(this.activeId);
|
|
2458
2473
|
}
|
|
2459
2474
|
activateTabByIndex(index) {
|
|
2460
|
-
const tab = this.tabs
|
|
2461
|
-
if (tab && !tab.disabled) {
|
|
2475
|
+
const tab = this.tabs()[index];
|
|
2476
|
+
if (tab && !tab.disabled()) {
|
|
2462
2477
|
this.selectTab(tab);
|
|
2463
2478
|
}
|
|
2464
2479
|
}
|
|
@@ -2475,42 +2490,42 @@ class TabComponent {
|
|
|
2475
2490
|
}
|
|
2476
2491
|
}
|
|
2477
2492
|
moveFocus() {
|
|
2478
|
-
this.tabLinks
|
|
2493
|
+
this.tabLinks().forEach((link) => {
|
|
2479
2494
|
if (link.nativeElement.getAttribute('aria-selected') === 'true') {
|
|
2480
2495
|
link.nativeElement.focus();
|
|
2481
2496
|
}
|
|
2482
2497
|
});
|
|
2483
2498
|
}
|
|
2484
2499
|
selectPreviousTab() {
|
|
2485
|
-
const tabsArray = this.tabs
|
|
2500
|
+
const tabsArray = [...this.tabs()];
|
|
2486
2501
|
const activeIndex = tabsArray.findIndex(tab => tab.active);
|
|
2487
2502
|
if (activeIndex !== -1) {
|
|
2488
2503
|
let newIndex = (activeIndex - 1 + tabsArray.length) % tabsArray.length;
|
|
2489
|
-
while (tabsArray[newIndex].disabled && newIndex !== activeIndex) {
|
|
2504
|
+
while (tabsArray[newIndex].disabled() && newIndex !== activeIndex) {
|
|
2490
2505
|
newIndex = (newIndex - 1 + tabsArray.length) % tabsArray.length;
|
|
2491
2506
|
}
|
|
2492
|
-
if (!tabsArray[newIndex].disabled) {
|
|
2507
|
+
if (!tabsArray[newIndex].disabled()) {
|
|
2493
2508
|
this.selectTab(tabsArray[newIndex]);
|
|
2494
2509
|
setTimeout(() => this.moveFocus());
|
|
2495
2510
|
}
|
|
2496
2511
|
}
|
|
2497
2512
|
}
|
|
2498
2513
|
selectNextTab() {
|
|
2499
|
-
const tabsArray = this.tabs
|
|
2514
|
+
const tabsArray = [...this.tabs()];
|
|
2500
2515
|
const activeIndex = tabsArray.findIndex(tab => tab.active);
|
|
2501
2516
|
if (activeIndex !== -1) {
|
|
2502
2517
|
let newIndex = (activeIndex + 1) % tabsArray.length;
|
|
2503
|
-
while (tabsArray[newIndex].disabled && newIndex !== activeIndex) {
|
|
2518
|
+
while (tabsArray[newIndex].disabled() && newIndex !== activeIndex) {
|
|
2504
2519
|
newIndex = (newIndex + 1) % tabsArray.length;
|
|
2505
2520
|
}
|
|
2506
|
-
if (!tabsArray[newIndex].disabled) {
|
|
2521
|
+
if (!tabsArray[newIndex].disabled()) {
|
|
2507
2522
|
this.selectTab(tabsArray[newIndex]);
|
|
2508
2523
|
setTimeout(() => this.moveFocus());
|
|
2509
2524
|
}
|
|
2510
2525
|
}
|
|
2511
2526
|
}
|
|
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\">\
|
|
2527
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.19", ngImport: i0, type: TabComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2528
|
+
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
2529
|
}
|
|
2515
2530
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.19", ngImport: i0, type: TabComponent, decorators: [{
|
|
2516
2531
|
type: Component,
|
|
@@ -2518,35 +2533,17 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.19", ngImpo
|
|
|
2518
2533
|
CommonModule,
|
|
2519
2534
|
IconComponent,
|
|
2520
2535
|
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
|
-
}] } });
|
|
2536
|
+
], 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" }]
|
|
2537
|
+
}], 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
2538
|
|
|
2544
2539
|
class WizardStepComponent {
|
|
2545
2540
|
constructor() {
|
|
2546
|
-
this.
|
|
2541
|
+
this.title = input.required(...(ngDevMode ? [{ debugName: "title" }] : []));
|
|
2542
|
+
this.completed = input(false, ...(ngDevMode ? [{ debugName: "completed" }] : []));
|
|
2543
|
+
this.templateRef = viewChild.required('content');
|
|
2547
2544
|
}
|
|
2548
2545
|
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: "
|
|
2546
|
+
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
2547
|
}
|
|
2551
2548
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.19", ngImport: i0, type: WizardStepComponent, decorators: [{
|
|
2552
2549
|
type: Component,
|
|
@@ -2555,43 +2552,37 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.19", ngImpo
|
|
|
2555
2552
|
template: '<ng-template #content><ng-content></ng-content></ng-template>',
|
|
2556
2553
|
standalone: true
|
|
2557
2554
|
}]
|
|
2558
|
-
}], propDecorators: { title: [{
|
|
2559
|
-
type: Input
|
|
2560
|
-
}], completed: [{
|
|
2561
|
-
type: Input
|
|
2562
|
-
}], templateRef: [{
|
|
2563
|
-
type: ViewChild,
|
|
2564
|
-
args: ['content', { static: true }]
|
|
2565
|
-
}] } });
|
|
2555
|
+
}], 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
2556
|
|
|
2567
2557
|
class WizardStepperComponent {
|
|
2568
2558
|
constructor() {
|
|
2569
|
-
this.
|
|
2570
|
-
this.
|
|
2571
|
-
this.
|
|
2572
|
-
this.
|
|
2559
|
+
this.steps = contentChildren(WizardStepComponent, ...(ngDevMode ? [{ debugName: "steps" }] : []));
|
|
2560
|
+
this.stepChange = output();
|
|
2561
|
+
this.stepNext = output();
|
|
2562
|
+
this.stepPrevious = output();
|
|
2563
|
+
this.stepEnd = output();
|
|
2573
2564
|
this.selectedIndex = 0;
|
|
2574
2565
|
}
|
|
2575
2566
|
get stepList() {
|
|
2576
|
-
return this.steps
|
|
2567
|
+
return this.steps();
|
|
2577
2568
|
}
|
|
2578
2569
|
goToStep(index) {
|
|
2579
|
-
|
|
2570
|
+
const stepsArr = this.steps();
|
|
2571
|
+
if (index < 0 || index >= stepsArr.length)
|
|
2580
2572
|
return;
|
|
2581
|
-
// Vérifier que toutes les étapes précédentes sont complétées
|
|
2582
2573
|
for (let i = 0; i < index; i++) {
|
|
2583
|
-
if (!
|
|
2584
|
-
return;
|
|
2574
|
+
if (!stepsArr[i].completed()) {
|
|
2575
|
+
return;
|
|
2585
2576
|
}
|
|
2586
2577
|
}
|
|
2587
2578
|
this.selectedIndex = index;
|
|
2588
2579
|
this.stepChange.emit(this.selectedIndex);
|
|
2589
2580
|
}
|
|
2590
2581
|
nextStep() {
|
|
2591
|
-
|
|
2592
|
-
|
|
2593
|
-
|
|
2594
|
-
|
|
2582
|
+
const stepsArr = this.steps();
|
|
2583
|
+
if (this.selectedIndex < stepsArr.length - 1) {
|
|
2584
|
+
const currentStep = stepsArr[this.selectedIndex];
|
|
2585
|
+
if (!currentStep.completed()) {
|
|
2595
2586
|
return;
|
|
2596
2587
|
}
|
|
2597
2588
|
this.selectedIndex++;
|
|
@@ -2613,49 +2604,32 @@ class WizardStepperComponent {
|
|
|
2613
2604
|
}
|
|
2614
2605
|
}
|
|
2615
2606
|
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>\
|
|
2607
|
+
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
2608
|
}
|
|
2618
2609
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.19", ngImport: i0, type: WizardStepperComponent, decorators: [{
|
|
2619
2610
|
type: Component,
|
|
2620
2611
|
args: [{ selector: 'cw-wizard-stepper', standalone: true, imports: [
|
|
2621
2612
|
CommonModule,
|
|
2622
2613
|
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
|
-
}] } });
|
|
2614
|
+
], 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" }]
|
|
2615
|
+
}], 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
2616
|
|
|
2637
2617
|
class StepperComponent {
|
|
2638
2618
|
constructor() {
|
|
2639
|
-
this.activeStep = 0;
|
|
2640
|
-
this.steps = [];
|
|
2641
|
-
this.label = 'Étapes de progression'
|
|
2619
|
+
this.activeStep = input(0, ...(ngDevMode ? [{ debugName: "activeStep" }] : []));
|
|
2620
|
+
this.steps = input([], ...(ngDevMode ? [{ debugName: "steps" }] : []));
|
|
2621
|
+
this.label = input('Étapes de progression', ...(ngDevMode ? [{ debugName: "label" }] : []));
|
|
2642
2622
|
}
|
|
2643
2623
|
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\">\
|
|
2624
|
+
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
2625
|
}
|
|
2646
2626
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.19", ngImport: i0, type: StepperComponent, decorators: [{
|
|
2647
2627
|
type: Component,
|
|
2648
2628
|
args: [{ selector: 'cw-stepper', standalone: true, imports: [
|
|
2649
2629
|
CommonModule,
|
|
2650
2630
|
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
|
-
}] } });
|
|
2631
|
+
], 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" }]
|
|
2632
|
+
}], 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
2633
|
|
|
2660
2634
|
const FILE_SIZE_UNITS_FR = ['o', 'Ko', 'Mo', 'Go', 'To', 'Po', 'Eo', 'Zo', 'Yo'];
|
|
2661
2635
|
const FILE_SIZE_UNITS_DEFAULT = ['B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'];
|
|
@@ -2686,16 +2660,15 @@ class FileToDownloadComponent {
|
|
|
2686
2660
|
this.iconType = IconTypeEnum;
|
|
2687
2661
|
this.iconSize = IconSizeEnum;
|
|
2688
2662
|
this.spriteIcon = SpriteIconEnum.toolbarDownload;
|
|
2663
|
+
this.attachments = input.required(...(ngDevMode ? [{ debugName: "attachments" }] : []));
|
|
2689
2664
|
}
|
|
2690
2665
|
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 -->\
|
|
2666
|
+
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
2667
|
}
|
|
2693
2668
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.19", ngImport: i0, type: FileToDownloadComponent, decorators: [{
|
|
2694
2669
|
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
|
-
}] } });
|
|
2670
|
+
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" }]
|
|
2671
|
+
}], propDecorators: { attachments: [{ type: i0.Input, args: [{ isSignal: true, alias: "attachments", required: true }] }] } });
|
|
2699
2672
|
|
|
2700
2673
|
var NumericalRangeTypeEnum;
|
|
2701
2674
|
(function (NumericalRangeTypeEnum) {
|
|
@@ -2714,16 +2687,17 @@ var NumericalRangeLabelPositionEnum;
|
|
|
2714
2687
|
|
|
2715
2688
|
class NumericalRangeComponent {
|
|
2716
2689
|
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.
|
|
2690
|
+
this.type = input(NumericalRangeTypeEnum.defaultGrey, ...(ngDevMode ? [{ debugName: "type" }] : []));
|
|
2691
|
+
this.label = input('', ...(ngDevMode ? [{ debugName: "label" }] : []));
|
|
2692
|
+
this.amount = model(0, ...(ngDevMode ? [{ debugName: "amount" }] : []));
|
|
2693
|
+
this.withIcon = input(...(ngDevMode ? [undefined, { debugName: "withIcon" }] : []));
|
|
2694
|
+
this.withLabelVisible = input(true, ...(ngDevMode ? [{ debugName: "withLabelVisible" }] : []));
|
|
2695
|
+
this.labelPosition = input(NumericalRangeLabelPositionEnum.inside, ...(ngDevMode ? [{ debugName: "labelPosition" }] : []));
|
|
2696
|
+
this.ceil = input(9, ...(ngDevMode ? [{ debugName: "ceil" }] : []));
|
|
2697
|
+
this.floor = input(0, ...(ngDevMode ? [{ debugName: "floor" }] : []));
|
|
2698
|
+
this.isDisabled = input(false, ...(ngDevMode ? [{ debugName: "isDisabled" }] : []));
|
|
2699
|
+
this.autoChangeAmount = input(true, ...(ngDevMode ? [{ debugName: "autoChangeAmount" }] : []));
|
|
2700
|
+
this.newAmount = output();
|
|
2727
2701
|
this.numericalRangeType = NumericalRangeTypeEnum;
|
|
2728
2702
|
this.iconTypeEnum = IconTypeEnum;
|
|
2729
2703
|
this.iconSize = IconSizeEnum;
|
|
@@ -2734,80 +2708,46 @@ class NumericalRangeComponent {
|
|
|
2734
2708
|
this.uniqueId = `numerical-range-${Math.random().toString(36).slice(2)}`;
|
|
2735
2709
|
}
|
|
2736
2710
|
increaseAmount() {
|
|
2737
|
-
const
|
|
2738
|
-
if (this.autoChangeAmount) {
|
|
2739
|
-
this.amount
|
|
2711
|
+
const next = this.amount() + 1;
|
|
2712
|
+
if (this.autoChangeAmount()) {
|
|
2713
|
+
this.amount.set(next);
|
|
2740
2714
|
}
|
|
2741
|
-
this.newAmount.emit(
|
|
2715
|
+
this.newAmount.emit(next);
|
|
2742
2716
|
}
|
|
2743
2717
|
decreaseAmount() {
|
|
2744
|
-
|
|
2745
|
-
if (this.autoChangeAmount) {
|
|
2746
|
-
this.
|
|
2747
|
-
|
|
2748
|
-
this.amount = this.floor;
|
|
2718
|
+
let next = this.amount() - 1;
|
|
2719
|
+
if (this.autoChangeAmount()) {
|
|
2720
|
+
if (next < this.floor()) {
|
|
2721
|
+
next = this.floor();
|
|
2749
2722
|
}
|
|
2723
|
+
this.amount.set(next);
|
|
2750
2724
|
}
|
|
2751
|
-
this.newAmount.emit(
|
|
2725
|
+
this.newAmount.emit(next);
|
|
2752
2726
|
}
|
|
2753
2727
|
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\">\
|
|
2728
|
+
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
2729
|
}
|
|
2756
2730
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.19", ngImport: i0, type: NumericalRangeComponent, decorators: [{
|
|
2757
2731
|
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
|
-
}] } });
|
|
2732
|
+
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" }]
|
|
2733
|
+
}], 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
2734
|
|
|
2783
2735
|
class ImageComponent {
|
|
2784
2736
|
constructor() {
|
|
2785
|
-
this.source = '';
|
|
2786
|
-
this.alt = '';
|
|
2787
|
-
this.isAriaHidden = false;
|
|
2788
|
-
this.cssClass = '';
|
|
2789
|
-
this.width = '';
|
|
2790
|
-
this.height = '';
|
|
2737
|
+
this.source = input('', ...(ngDevMode ? [{ debugName: "source" }] : []));
|
|
2738
|
+
this.alt = input('', ...(ngDevMode ? [{ debugName: "alt" }] : []));
|
|
2739
|
+
this.isAriaHidden = input(false, ...(ngDevMode ? [{ debugName: "isAriaHidden" }] : []));
|
|
2740
|
+
this.cssClass = input('', ...(ngDevMode ? [{ debugName: "cssClass" }] : []));
|
|
2741
|
+
this.width = input('', ...(ngDevMode ? [{ debugName: "width" }] : []));
|
|
2742
|
+
this.height = input('', ...(ngDevMode ? [{ debugName: "height" }] : []));
|
|
2791
2743
|
}
|
|
2792
2744
|
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: "
|
|
2745
|
+
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
2746
|
}
|
|
2795
2747
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.19", ngImport: i0, type: ImageComponent, decorators: [{
|
|
2796
2748
|
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
|
-
}] } });
|
|
2749
|
+
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" }]
|
|
2750
|
+
}], 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
2751
|
|
|
2812
2752
|
var TitleTagEnum;
|
|
2813
2753
|
(function (TitleTagEnum) {
|
|
@@ -2887,5 +2827,5 @@ var PlacementEnum;
|
|
|
2887
2827
|
* Generated bundle index. Do not edit.
|
|
2888
2828
|
*/
|
|
2889
2829
|
|
|
2890
|
-
export { AccordionComponent, AlertComponent, AlertTypeEnum, BadgeComponent, BadgePositionEnum, BadgeTypeEnum, BoButtonTypeEnum, BoTabTypeEnum, ButtonComponent, ButtonIconSizeEnum, ButtonPositionEnum, CardComponent, CardTitleRankEnum, CardTypeEnum, ClickOutsideDirective, CollapseDirective, DropdownComponent, DropdownItemDirective, DropdownPositionEnum, FileToDownloadComponent, FoButtonTypeEnum, FoTabTypeEnum, FocusTrackerService, FormFieldComponent, FormFieldTypeEnum, IconComponent, IconNotifSizeEnum, IconNotifTypeEnum, IconNotificationComponent, IconSizeEnum, IconTypeEnum, IconUiTypeEnum, ImageComponent, LegendComponent, LegendTypeEnum, LoaderComponent, ModalsComponent, ModalsService, ModalsSize, ModalsType, NumericalRangeComponent, NumericalRangeLabelPositionEnum, NumericalRangeTypeEnum, PlacementEnum, RequiredInfoComponent, ResponsiveService, SkipLinksComponent, SpriteIconEnum, StepperComponent, TabComponent, TabContentComponent, TitleComponent, TitleContextEnum, TitleTagEnum, ToastComponent, ToastService, TriggerTooltipEnum, TypeTooltipEnum, WizardStepComponent, WizardStepperComponent, rangeValidator };
|
|
2830
|
+
export { AccordionComponent, AlertComponent, AlertTypeEnum, BadgeComponent, BadgePositionEnum, BadgeTypeEnum, BoButtonTypeEnum, BoTabTypeEnum, ButtonComponent, ButtonIconSizeEnum, ButtonPositionEnum, CardComponent, CardTitleRankEnum, CardTypeEnum, ClickOutsideDirective, CollapseDirective, DropdownComponent, DropdownItemDirective, DropdownPositionEnum, FileToDownloadComponent, FoButtonTypeEnum, FoTabTypeEnum, FocusTrackerService, FormFieldComponent, FormFieldTypeEnum, IconComponent, IconNotifSizeEnum, IconNotifTypeEnum, IconNotificationComponent, IconSizeEnum, IconTypeEnum, IconUiTypeEnum, ImageComponent, LegendComponent, LegendTypeEnum, LoaderComponent, ModalsComponent, ModalsService, ModalsSize, ModalsType, NumericalRangeComponent, NumericalRangeLabelPositionEnum, NumericalRangeTypeEnum, PlacementEnum, RequiredInfoComponent, ResponsiveService, SkipLinksComponent, SpriteIconEnum, StepperComponent, TOAST_AUTOHIDE_DELAY_MS, TabComponent, TabContentComponent, TitleComponent, TitleContextEnum, TitleTagEnum, ToastComponent, ToastItemComponent, ToastService, TriggerTooltipEnum, TypeTooltipEnum, WizardStepComponent, WizardStepperComponent, rangeValidator };
|
|
2891
2831
|
//# sourceMappingURL=cityway-basic-ui.mjs.map
|