@cityway/basic-ui 1.0.2-beta018 → 1.0.2-beta020
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-beta020.tgz +0 -0
- package/fesm2022/cityway-basic-ui.mjs +550 -156
- package/fesm2022/cityway-basic-ui.mjs.map +1 -1
- package/index.d.ts +148 -14
- package/lib/assets/i18n/common.en.json +11 -0
- package/lib/assets/i18n/common.fr.json +11 -0
- package/lib/assets/styles/scss/_reboot.scss +10 -0
- package/lib/assets/styles/scss/components/_btn-collapse.scss +8 -0
- package/lib/assets/styles/scss/components/_card.scss +7 -2
- package/lib/assets/styles/scss/components/_dropdown.scss +1 -0
- package/lib/assets/styles/scss/components/form-field/_field-check.scss +9 -2
- package/lib/assets/styles/scss/components/form-field/_form-field.scss +8 -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-beta018.tgz +0 -0
|
@@ -1,15 +1,15 @@
|
|
|
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, input, HostBinding, Component, ChangeDetectorRef, model, output, viewChild, contentChildren, Injectable, NgZone, HostListener, Renderer2, ViewChild, TemplateRef, ContentChild, ApplicationRef, Injector, createComponent, viewChildren, Pipe, computed } from '@angular/core';
|
|
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';
|
|
10
10
|
export { Options } from '@angular-slider/ngx-slider';
|
|
11
11
|
import * as i2$1 from '@angular/forms';
|
|
12
|
-
import { FormGroup, FormsModule, ReactiveFormsModule } from '@angular/forms';
|
|
12
|
+
import { FormGroup, Validators, 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
15
|
import { Router, ActivatedRoute } from '@angular/router';
|
|
@@ -57,10 +57,10 @@ class CollapseDirective {
|
|
|
57
57
|
hide() {
|
|
58
58
|
this.collapsedSignal.set(true);
|
|
59
59
|
}
|
|
60
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.
|
|
61
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.
|
|
60
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: CollapseDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
61
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.20", type: CollapseDirective, isStandalone: true, selector: "[cwCollapse]", inputs: { cwCollapse: "cwCollapse" }, outputs: { shown: "shown", hidden: "hidden" }, exportAs: ["cwCollapse"], ngImport: i0 }); }
|
|
62
62
|
}
|
|
63
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.
|
|
63
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: CollapseDirective, decorators: [{
|
|
64
64
|
type: Directive,
|
|
65
65
|
args: [{
|
|
66
66
|
selector: '[cwCollapse]',
|
|
@@ -646,10 +646,10 @@ class IconComponent {
|
|
|
646
646
|
}
|
|
647
647
|
return `icon icon-${this.iconSize()}`;
|
|
648
648
|
}
|
|
649
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.
|
|
650
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.
|
|
649
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: IconComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
650
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.20", 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"] }] }); }
|
|
651
651
|
}
|
|
652
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.
|
|
652
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: IconComponent, decorators: [{
|
|
653
653
|
type: Component,
|
|
654
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
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: [{
|
|
@@ -672,6 +672,7 @@ class CardComponent {
|
|
|
672
672
|
constructor() {
|
|
673
673
|
this.cdRef = inject(ChangeDetectorRef);
|
|
674
674
|
this.title = input(...(ngDevMode ? [undefined, { debugName: "title" }] : []));
|
|
675
|
+
this.subtitle = input(...(ngDevMode ? [undefined, { debugName: "subtitle" }] : []));
|
|
675
676
|
this.type = input(CardTypeEnum.default, ...(ngDevMode ? [{ debugName: "type" }] : []));
|
|
676
677
|
this.titleRank = input(CardTitleRankEnum.h2, ...(ngDevMode ? [{ debugName: "titleRank" }] : []));
|
|
677
678
|
this.collapsible = model(false, ...(ngDevMode ? [{ debugName: "collapsible" }] : []));
|
|
@@ -731,17 +732,18 @@ class CardComponent {
|
|
|
731
732
|
get collapsed_state() {
|
|
732
733
|
return this.isCollapsed();
|
|
733
734
|
}
|
|
734
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.
|
|
735
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.
|
|
735
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: CardComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
736
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.20", type: CardComponent, isStandalone: true, selector: "cw-card", inputs: { title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: false, transformFunction: null }, subtitle: { classPropertyName: "subtitle", publicName: "subtitle", 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 <div>\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-subtitle fs fs-xs text-light\" [innerHTML]=\"subtitle()\"></div>\n </div>\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" }] }); }
|
|
736
737
|
}
|
|
737
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.
|
|
738
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: CardComponent, decorators: [{
|
|
738
739
|
type: Component,
|
|
739
740
|
args: [{ selector: 'cw-card', standalone: true, imports: [
|
|
740
741
|
CommonModule,
|
|
741
742
|
CollapseDirective,
|
|
742
|
-
IconComponent
|
|
743
|
-
|
|
744
|
-
|
|
743
|
+
IconComponent,
|
|
744
|
+
TranslatePipe
|
|
745
|
+
], 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 <div>\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-subtitle fs fs-xs text-light\" [innerHTML]=\"subtitle()\"></div>\n </div>\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" }]
|
|
746
|
+
}], propDecorators: { title: [{ type: i0.Input, args: [{ isSignal: true, alias: "title", required: false }] }], subtitle: [{ type: i0.Input, args: [{ isSignal: true, alias: "subtitle", 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 }] }] } });
|
|
745
747
|
|
|
746
748
|
class AccordionComponent {
|
|
747
749
|
constructor() {
|
|
@@ -822,10 +824,10 @@ class AccordionComponent {
|
|
|
822
824
|
shouldCloseOthers() {
|
|
823
825
|
return this.closeOthers() && !this.allowMultiple();
|
|
824
826
|
}
|
|
825
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.
|
|
826
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "20.3.
|
|
827
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: AccordionComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
828
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "20.3.20", 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 }] }); }
|
|
827
829
|
}
|
|
828
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.
|
|
830
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: AccordionComponent, decorators: [{
|
|
829
831
|
type: Component,
|
|
830
832
|
args: [{ selector: 'cw-accordion', standalone: true, imports: [CommonModule], template: "<div class=\"accordion\">\r\n <ng-content></ng-content>\r\n</div>\r\n" }]
|
|
831
833
|
}], 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 }] }] } });
|
|
@@ -885,10 +887,10 @@ class IconNotificationComponent {
|
|
|
885
887
|
break;
|
|
886
888
|
}
|
|
887
889
|
}
|
|
888
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.
|
|
889
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "20.3.
|
|
890
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: IconNotificationComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
891
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "20.3.20", 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"] }] }); }
|
|
890
892
|
}
|
|
891
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.
|
|
893
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: IconNotificationComponent, decorators: [{
|
|
892
894
|
type: Component,
|
|
893
895
|
args: [{ selector: 'cw-icon-notification', standalone: true, imports: [
|
|
894
896
|
CommonModule,
|
|
@@ -941,24 +943,24 @@ class AlertComponent {
|
|
|
941
943
|
}
|
|
942
944
|
ngAfterViewInit() {
|
|
943
945
|
const el = this.alertContent()?.nativeElement;
|
|
944
|
-
this.showContent = !!el && el.children.length > 0;
|
|
946
|
+
this.showContent = !!el && (el.children.length > 0 || (el.textContent ?? '').trim().length > 0);
|
|
945
947
|
this.cdRef.detectChanges();
|
|
946
948
|
}
|
|
947
949
|
closeAlert() {
|
|
948
950
|
this.isVisible = false;
|
|
949
951
|
this.close.emit(true);
|
|
950
952
|
}
|
|
951
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.
|
|
952
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.
|
|
953
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: AlertComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
954
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.20", 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 #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" }] }); }
|
|
953
955
|
}
|
|
954
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.
|
|
956
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: AlertComponent, decorators: [{
|
|
955
957
|
type: Component,
|
|
956
958
|
args: [{ selector: 'cw-alert', standalone: true, imports: [
|
|
957
959
|
CommonModule,
|
|
958
960
|
TranslateModule,
|
|
959
961
|
IconNotificationComponent,
|
|
960
962
|
IconComponent
|
|
961
|
-
], template: "@if (isVisible) {\n <div [class]=\"'alert alert-' + type() + ' '+ cssClass()\" [ngClass]=\"{ 'alert-dismissible fade show': isDismissible() }\"\n [attr.data-test-ctw]=\"resolvedDataTest\">\n <cw-icon-notification [type]=\"iconNotifType\"></cw-icon-notification>\n <div class=\"alert-content\">\n @if (title()) {\n <div class=\"fw-bold\">{{ title() }}</div>\n }\n\n @if (showContent) {\n <p
|
|
963
|
+
], 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 #alertContent>\n <ng-content></ng-content>\n </p>\n }\n </div>\n @if (isDismissible()) {\n <button type=\"button\" class=\"btn-close\" (click)=\"closeAlert()\"\n [attr.aria-label]=\"'_COMMON._ACTION.CLOSE' | translate\"\n [attr.data-test-ctw]=\"'close-' + resolvedDataTest\">\n <cw-icon [label]=\"'_COMMON._ACTION.CLOSE' | translate\" [iconSize]=\"iconSize['2xs']\" [icon]=\"spriteIcon.toolbarClose\"></cw-icon>\n </button>\n }\n </div>\n}\n" }]
|
|
962
964
|
}], 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 }] }] } });
|
|
963
965
|
|
|
964
966
|
class FocusTrackerService {
|
|
@@ -979,23 +981,21 @@ class FocusTrackerService {
|
|
|
979
981
|
ngOnDestroy() {
|
|
980
982
|
document.removeEventListener('focus', this.focusListener, true);
|
|
981
983
|
}
|
|
982
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.
|
|
983
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.
|
|
984
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: FocusTrackerService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
985
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: FocusTrackerService, providedIn: 'root' }); }
|
|
984
986
|
}
|
|
985
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.
|
|
987
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: FocusTrackerService, decorators: [{
|
|
986
988
|
type: Injectable,
|
|
987
989
|
args: [{
|
|
988
990
|
providedIn: 'root',
|
|
989
991
|
}]
|
|
990
992
|
}], ctorParameters: () => [] });
|
|
991
993
|
|
|
992
|
-
const
|
|
994
|
+
const TOAST_AUTOHIDE_DELAY_MS = 6000;
|
|
993
995
|
class ToastService {
|
|
994
996
|
constructor() {
|
|
995
997
|
this.focusService = inject(FocusTrackerService);
|
|
996
|
-
this.zone = inject(NgZone);
|
|
997
998
|
this.toasts = signal([], ...(ngDevMode ? [{ debugName: "toasts" }] : []));
|
|
998
|
-
this.autohideTimers = new Map();
|
|
999
999
|
this.triggeringElements = new Map();
|
|
1000
1000
|
}
|
|
1001
1001
|
show(options) {
|
|
@@ -1012,37 +1012,21 @@ class ToastService {
|
|
|
1012
1012
|
};
|
|
1013
1013
|
this.toasts.update(arr => [...arr, toast]);
|
|
1014
1014
|
this.triggeringElements.set(toast.id, this.focusService.getFocusedElement());
|
|
1015
|
-
if (toast.autohide) {
|
|
1016
|
-
const toastId = toast.id;
|
|
1017
|
-
// Force le timer à tourner DANS la zone Angular pour garantir un tick CD,
|
|
1018
|
-
// au cas où show() serait appelé depuis du code qui a runOutsideAngular.
|
|
1019
|
-
this.zone.run(() => {
|
|
1020
|
-
const timer = setTimeout(() => this.removeById(toastId), AUTOHIDE_DELAY_MS);
|
|
1021
|
-
this.autohideTimers.set(toastId, timer);
|
|
1022
|
-
});
|
|
1023
|
-
}
|
|
1024
|
-
}
|
|
1025
|
-
remove(toast) {
|
|
1026
|
-
this.removeById(toast.id, { restoreFocus: true });
|
|
1027
1015
|
}
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
this.toasts.update(arr => arr.filter(t => t.id !==
|
|
1035
|
-
const triggeringElement = this.triggeringElements.get(
|
|
1036
|
-
this.triggeringElements.delete(
|
|
1037
|
-
// Ne restaurer le focus que si c'était une action manuelle (clic sur la croix),
|
|
1038
|
-
// pas sur autohide — sinon le focus de l'utilisateur saute toutes les 5s.
|
|
1016
|
+
/**
|
|
1017
|
+
* Retire un toast.
|
|
1018
|
+
* - Action manuelle (clic sur la croix) : restaure le focus sur l'élément déclencheur (par défaut).
|
|
1019
|
+
* - Autohide depuis cw-toast-item : passer { restoreFocus: false } pour ne pas faire sauter le focus utilisateur.
|
|
1020
|
+
*/
|
|
1021
|
+
remove(toast, opts = { restoreFocus: true }) {
|
|
1022
|
+
this.toasts.update(arr => arr.filter(t => t.id !== toast.id));
|
|
1023
|
+
const triggeringElement = this.triggeringElements.get(toast.id);
|
|
1024
|
+
this.triggeringElements.delete(toast.id);
|
|
1039
1025
|
if (opts.restoreFocus) {
|
|
1040
1026
|
triggeringElement?.focus();
|
|
1041
1027
|
}
|
|
1042
1028
|
}
|
|
1043
1029
|
clear() {
|
|
1044
|
-
this.autohideTimers.forEach(timer => clearTimeout(timer));
|
|
1045
|
-
this.autohideTimers.clear();
|
|
1046
1030
|
this.triggeringElements.clear();
|
|
1047
1031
|
this.toasts.set([]);
|
|
1048
1032
|
}
|
|
@@ -1062,24 +1046,142 @@ class ToastService {
|
|
|
1062
1046
|
setLastToast(message) {
|
|
1063
1047
|
this.lastToast = { message, date: new Date() };
|
|
1064
1048
|
}
|
|
1065
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.
|
|
1066
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.
|
|
1049
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: ToastService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
1050
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: ToastService, providedIn: 'root' }); }
|
|
1067
1051
|
}
|
|
1068
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.
|
|
1052
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: ToastService, decorators: [{
|
|
1069
1053
|
type: Injectable,
|
|
1070
1054
|
args: [{ providedIn: 'root' }]
|
|
1071
1055
|
}] });
|
|
1072
1056
|
|
|
1057
|
+
class ToastItemComponent {
|
|
1058
|
+
constructor() {
|
|
1059
|
+
this.toastService = inject(ToastService);
|
|
1060
|
+
this.elRef = inject((ElementRef));
|
|
1061
|
+
this.zone = inject(NgZone);
|
|
1062
|
+
this.toast = input.required(...(ngDevMode ? [{ debugName: "toast" }] : []));
|
|
1063
|
+
this.action = output();
|
|
1064
|
+
this.progress = signal(100, ...(ngDevMode ? [{ debugName: "progress" }] : []));
|
|
1065
|
+
this.rafId = null;
|
|
1066
|
+
this.startTime = 0;
|
|
1067
|
+
this.remaining = TOAST_AUTOHIDE_DELAY_MS;
|
|
1068
|
+
this.isHovered = false;
|
|
1069
|
+
this.isFocused = false;
|
|
1070
|
+
}
|
|
1071
|
+
ngOnInit() {
|
|
1072
|
+
if (this.toast().autohide) {
|
|
1073
|
+
this.startTimer();
|
|
1074
|
+
}
|
|
1075
|
+
}
|
|
1076
|
+
ngOnDestroy() {
|
|
1077
|
+
this.cancelRaf();
|
|
1078
|
+
}
|
|
1079
|
+
onMouseEnter() {
|
|
1080
|
+
this.isHovered = true;
|
|
1081
|
+
this.updatePauseState();
|
|
1082
|
+
}
|
|
1083
|
+
onMouseLeave() {
|
|
1084
|
+
this.isHovered = false;
|
|
1085
|
+
this.updatePauseState();
|
|
1086
|
+
}
|
|
1087
|
+
onFocusIn() {
|
|
1088
|
+
this.isFocused = true;
|
|
1089
|
+
this.updatePauseState();
|
|
1090
|
+
}
|
|
1091
|
+
onFocusOut(event) {
|
|
1092
|
+
// Le focus passe d'un enfant à un autre du même toast → on reste focused.
|
|
1093
|
+
if (this.elRef.nativeElement.contains(event.relatedTarget)) {
|
|
1094
|
+
return;
|
|
1095
|
+
}
|
|
1096
|
+
this.isFocused = false;
|
|
1097
|
+
this.updatePauseState();
|
|
1098
|
+
}
|
|
1099
|
+
onAction() {
|
|
1100
|
+
const action = this.toast().action;
|
|
1101
|
+
if (action) {
|
|
1102
|
+
this.action.emit(action);
|
|
1103
|
+
}
|
|
1104
|
+
}
|
|
1105
|
+
onClose() {
|
|
1106
|
+
this.toastService.remove(this.toast());
|
|
1107
|
+
}
|
|
1108
|
+
updatePauseState() {
|
|
1109
|
+
if (!this.toast().autohide)
|
|
1110
|
+
return;
|
|
1111
|
+
const shouldPause = this.isHovered || this.isFocused;
|
|
1112
|
+
if (shouldPause) {
|
|
1113
|
+
this.pauseTimer();
|
|
1114
|
+
}
|
|
1115
|
+
else {
|
|
1116
|
+
this.resumeTimer();
|
|
1117
|
+
}
|
|
1118
|
+
}
|
|
1119
|
+
startTimer() {
|
|
1120
|
+
this.startTime = performance.now();
|
|
1121
|
+
this.zone.runOutsideAngular(() => {
|
|
1122
|
+
const tick = () => {
|
|
1123
|
+
const elapsed = performance.now() - this.startTime;
|
|
1124
|
+
const current = Math.max(0, this.remaining - elapsed);
|
|
1125
|
+
this.progress.set((current / TOAST_AUTOHIDE_DELAY_MS) * 100);
|
|
1126
|
+
if (current <= 0) {
|
|
1127
|
+
this.rafId = null;
|
|
1128
|
+
this.zone.run(() => this.toastService.remove(this.toast(), { restoreFocus: false }));
|
|
1129
|
+
return;
|
|
1130
|
+
}
|
|
1131
|
+
this.rafId = requestAnimationFrame(tick);
|
|
1132
|
+
};
|
|
1133
|
+
this.rafId = requestAnimationFrame(tick);
|
|
1134
|
+
});
|
|
1135
|
+
}
|
|
1136
|
+
pauseTimer() {
|
|
1137
|
+
if (this.rafId === null)
|
|
1138
|
+
return;
|
|
1139
|
+
const elapsed = performance.now() - this.startTime;
|
|
1140
|
+
this.remaining = Math.max(0, this.remaining - elapsed);
|
|
1141
|
+
this.cancelRaf();
|
|
1142
|
+
}
|
|
1143
|
+
resumeTimer() {
|
|
1144
|
+
if (this.rafId !== null)
|
|
1145
|
+
return;
|
|
1146
|
+
if (this.remaining <= 0)
|
|
1147
|
+
return;
|
|
1148
|
+
this.startTimer();
|
|
1149
|
+
}
|
|
1150
|
+
cancelRaf() {
|
|
1151
|
+
if (this.rafId !== null) {
|
|
1152
|
+
cancelAnimationFrame(this.rafId);
|
|
1153
|
+
this.rafId = null;
|
|
1154
|
+
}
|
|
1155
|
+
}
|
|
1156
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: ToastItemComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1157
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.20", 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 }); }
|
|
1158
|
+
}
|
|
1159
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: ToastItemComponent, decorators: [{
|
|
1160
|
+
type: Component,
|
|
1161
|
+
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" }]
|
|
1162
|
+
}], propDecorators: { toast: [{ type: i0.Input, args: [{ isSignal: true, alias: "toast", required: true }] }], action: [{ type: i0.Output, args: ["action"] }], onMouseEnter: [{
|
|
1163
|
+
type: HostListener,
|
|
1164
|
+
args: ['mouseenter']
|
|
1165
|
+
}], onMouseLeave: [{
|
|
1166
|
+
type: HostListener,
|
|
1167
|
+
args: ['mouseleave']
|
|
1168
|
+
}], onFocusIn: [{
|
|
1169
|
+
type: HostListener,
|
|
1170
|
+
args: ['focusin']
|
|
1171
|
+
}], onFocusOut: [{
|
|
1172
|
+
type: HostListener,
|
|
1173
|
+
args: ['focusout', ['$event']]
|
|
1174
|
+
}] } });
|
|
1175
|
+
|
|
1073
1176
|
class ToastComponent {
|
|
1074
1177
|
constructor() {
|
|
1075
1178
|
this.toastService = inject(ToastService);
|
|
1076
1179
|
this.elRef = inject(ElementRef);
|
|
1077
1180
|
this.action = output();
|
|
1078
|
-
this.closed = output();
|
|
1079
1181
|
}
|
|
1080
1182
|
ngAfterViewInit() {
|
|
1081
1183
|
const elemPosition = this.elRef.nativeElement.getBoundingClientRect();
|
|
1082
|
-
document.addEventListener("scroll", (
|
|
1184
|
+
document.addEventListener("scroll", () => {
|
|
1083
1185
|
if (window.scrollY >= elemPosition.top * 2) {
|
|
1084
1186
|
this.elRef.nativeElement.classList.remove('is-absolute');
|
|
1085
1187
|
}
|
|
@@ -1088,25 +1190,13 @@ class ToastComponent {
|
|
|
1088
1190
|
}
|
|
1089
1191
|
});
|
|
1090
1192
|
}
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
return;
|
|
1094
|
-
}
|
|
1095
|
-
this.action.emit(toast.action);
|
|
1096
|
-
}
|
|
1097
|
-
close() {
|
|
1098
|
-
this.closed.emit();
|
|
1099
|
-
}
|
|
1100
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.19", ngImport: i0, type: ToastComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1101
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.19", type: ToastComponent, isStandalone: true, selector: "cw-toast", outputs: { action: "action", closed: "closed" }, host: { attributes: { "role": "alert" }, properties: { "class.toast": "true" } }, ngImport: i0, template: "@for (toast of toastService.toasts(); track toast.id) {\r\n <cw-alert [type]=\"toast.type\" [isDismissible]=\"true\" [title]=\"toast.title\" (close)=\"toastService.remove(toast)\" [dataTest]=\"'toast-'+ toast.type\">\r\n <span [innerHTML]=\"toast.message\"></span> \r\n @if (toast.action) {\r\n <a href=\"javascript:void(0);\" (click)=\"onAction(toast)\" class=\"alert-link\">{{ toast.action.label }}</a>\r\n }\r\n </cw-alert>\r\n}\r\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "component", type: AlertComponent, selector: "cw-alert", inputs: ["type", "title", "isDismissible", "cssClass", "dataTest"], outputs: ["close"] }] }); }
|
|
1193
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: ToastComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1194
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.20", 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"] }] }); }
|
|
1102
1195
|
}
|
|
1103
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.
|
|
1196
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: ToastComponent, decorators: [{
|
|
1104
1197
|
type: Component,
|
|
1105
|
-
args: [{ selector: 'cw-toast', standalone: true, imports: [
|
|
1106
|
-
|
|
1107
|
-
AlertComponent
|
|
1108
|
-
], host: { '[class.toast]': 'true', role: 'alert' }, template: "@for (toast of toastService.toasts(); track toast.id) {\r\n <cw-alert [type]=\"toast.type\" [isDismissible]=\"true\" [title]=\"toast.title\" (close)=\"toastService.remove(toast)\" [dataTest]=\"'toast-'+ toast.type\">\r\n <span [innerHTML]=\"toast.message\"></span> \r\n @if (toast.action) {\r\n <a href=\"javascript:void(0);\" (click)=\"onAction(toast)\" class=\"alert-link\">{{ toast.action.label }}</a>\r\n }\r\n </cw-alert>\r\n}\r\n" }]
|
|
1109
|
-
}], propDecorators: { action: [{ type: i0.Output, args: ["action"] }], closed: [{ type: i0.Output, args: ["closed"] }] } });
|
|
1198
|
+
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" }]
|
|
1199
|
+
}], propDecorators: { action: [{ type: i0.Output, args: ["action"] }] } });
|
|
1110
1200
|
|
|
1111
1201
|
var BadgeTypeEnum;
|
|
1112
1202
|
(function (BadgeTypeEnum) {
|
|
@@ -1148,10 +1238,10 @@ class BadgeComponent {
|
|
|
1148
1238
|
get hostClasses() {
|
|
1149
1239
|
return this.skeletonMode() ? 'skeleton badge' : '';
|
|
1150
1240
|
}
|
|
1151
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.
|
|
1152
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.
|
|
1241
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: BadgeComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1242
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.20", 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" }] }); }
|
|
1153
1243
|
}
|
|
1154
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.
|
|
1244
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: BadgeComponent, decorators: [{
|
|
1155
1245
|
type: Component,
|
|
1156
1246
|
args: [{ selector: 'cw-badge', standalone: true, imports: [IconComponent, TranslatePipe], template: "<div [class]=\"'badge badge-' + type() + ' '+ cssClass()\" [attr.data-test-ctw]=\"dataTest() ? dataTest() : null\">\n\n @if (withIcon() && iconPosition() === badgePositionEnum.left) {\n <cw-icon [icon]=\"withIcon()\" [iconSize]=\"iconSizeEnum['2xs']\"></cw-icon>\n }\n\n @if (label()) {\n {{ label() | translate }}\n }\n\n @if (withIcon() && iconPosition() === badgePositionEnum.right) {\n <cw-icon [icon]=\"withIcon()\" [iconSize]=\"iconSizeEnum['2xs']\"></cw-icon>\n }\n</div>\n" }]
|
|
1157
1247
|
}], 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: [{
|
|
@@ -1171,10 +1261,10 @@ class ClickOutsideDirective {
|
|
|
1171
1261
|
this.elementRef = elementRef;
|
|
1172
1262
|
this.clickOutside = new EventEmitter();
|
|
1173
1263
|
}
|
|
1174
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.
|
|
1175
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.
|
|
1264
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: ClickOutsideDirective, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
1265
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.20", type: ClickOutsideDirective, isStandalone: true, selector: "[clickOutside]", outputs: { clickOutside: "clickOutside" }, host: { listeners: { "document:click": "onClick($event)" } }, ngImport: i0 }); }
|
|
1176
1266
|
}
|
|
1177
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.
|
|
1267
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: ClickOutsideDirective, decorators: [{
|
|
1178
1268
|
type: Directive,
|
|
1179
1269
|
args: [{
|
|
1180
1270
|
selector: '[clickOutside]',
|
|
@@ -1245,10 +1335,10 @@ class ResponsiveService {
|
|
|
1245
1335
|
checkIsMobileResolution() {
|
|
1246
1336
|
return window.innerWidth < 768;
|
|
1247
1337
|
}
|
|
1248
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.
|
|
1249
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.
|
|
1338
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: ResponsiveService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
1339
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: ResponsiveService, providedIn: 'root' }); }
|
|
1250
1340
|
}
|
|
1251
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.
|
|
1341
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: ResponsiveService, decorators: [{
|
|
1252
1342
|
type: Injectable,
|
|
1253
1343
|
args: [{
|
|
1254
1344
|
providedIn: 'root'
|
|
@@ -1277,10 +1367,10 @@ class DropdownItemDirective {
|
|
|
1277
1367
|
this.elementRef.nativeElement.classList.add('dropdown-item');
|
|
1278
1368
|
this.elementRef.nativeElement.setAttribute('tabindex', '0');
|
|
1279
1369
|
}
|
|
1280
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.
|
|
1281
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.
|
|
1370
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: DropdownItemDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
1371
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.20", type: DropdownItemDirective, isStandalone: true, selector: "[cwDropdownItem]", ngImport: i0 }); }
|
|
1282
1372
|
}
|
|
1283
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.
|
|
1373
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: DropdownItemDirective, decorators: [{
|
|
1284
1374
|
type: Directive,
|
|
1285
1375
|
args: [{ selector: '[cwDropdownItem]' }]
|
|
1286
1376
|
}] });
|
|
@@ -1430,17 +1520,17 @@ class ButtonComponent {
|
|
|
1430
1520
|
getRandomId(min, max) {
|
|
1431
1521
|
return Math.floor(Math.random() * (max - min + 1)) + min;
|
|
1432
1522
|
}
|
|
1433
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.
|
|
1434
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.
|
|
1523
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: ButtonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1524
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.20", type: ButtonComponent, isStandalone: true, selector: "cw-button", inputs: { type: "type", label: "label", id: "id", isDropdown: "isDropdown", withIcon: "withIcon", withOnlyIcon: "withOnlyIcon", iconSize: "iconSize", iconPosition: "iconPosition", dropdownPosition: "dropdownPosition", isMinWidth: "isMinWidth", isDisabled: "isDisabled", isLoading: "isLoading", cssClass: "cssClass", dataTest: "dataTest", skeletonMode: "skeletonMode", withTooltip: "withTooltip", tooltipText: "tooltipText", tooltipTitle: "tooltipTitle", tooltipTrigger: "tooltipTrigger", tooltipPosition: "tooltipPosition", tooltipType: "tooltipType" }, outputs: { btnAction: "btnAction", dropDownClicked: "dropDownClicked" }, host: { properties: { "class": "this.hostClasses" } }, viewQueries: [{ propertyName: "dropdown", first: true, predicate: ["dropdown"], descendants: true }, { propertyName: "dropdownMenu", first: true, predicate: ["dropdownMenu"], descendants: true }, { propertyName: "dropdownToggle", first: true, predicate: ["dropdownToggle"], descendants: true }], ngImport: i0, template: "<!-- Wrapper pour le tooltip -->\r\n@if (withTooltip) {\r\n <div class=\"d-inline-block p-relative\" (clickOutside)=\"onTooltipClickOutside()\" ctwClickOutside>\r\n\r\n <ng-container *ngTemplateOutlet=\"buttonTemplate\"></ng-container>\r\n\r\n <!-- Tooltip/Popover -->\r\n @if (isTooltipOpened) {\r\n <div role=\"tooltip\" [id]=\"'ctw-tooltip-' + tooltipRandomId\" [ngClass]=\"tooltipType + ' fade show ' + tooltipType + '-' + tooltipPosition\">\r\n <div class=\"arrow\"></div>\r\n @if (tooltipTitle) {\r\n <div [ngClass]=\"(tooltipType === typeTooltipEnum.popover ? 'popover' : 'tooltip') + '-header'\"\r\n [innerHTML]=\"tooltipTitle | translate\"></div>\r\n }\r\n <div [ngClass]=\"tooltipType + '-body'\"\r\n [innerHTML]=\"tooltipText | translate\"></div>\r\n </div>\r\n }\r\n </div>\r\n}\r\n@else {\r\n <ng-container *ngTemplateOutlet=\"buttonTemplate\"></ng-container>\r\n}\r\n\r\n<!-- Template du bouton (code existant envelopp\u00E9) -->\r\n<ng-template #buttonTemplate>\r\n @if (!isDropdown) {\r\n <button type=\"button\" class=\"btn\" [class]=\"'btn-' + type + ' ' + cssClass\" [ngClass]=\"getButtonClasses()\"\r\n [disabled]=\"isDisabled\" (click)=\"onBtnAction()\" [attr.data-test-ctw]=\"dataTest\"\r\n [attr.aria-describedby]=\"withTooltip && isTooltipOpened ? 'ctw-tooltip-' + tooltipRandomId : null\"\r\n (mouseenter)=\"withTooltip && tooltipTrigger === 'hover' ? showTooltip() : null\"\r\n (mouseleave)=\"withTooltip && tooltipTrigger === 'hover' ? hideTooltip() : null\"\r\n (click)=\"withTooltip && tooltipTrigger === 'click' ? showTooltip() : null\">\r\n\r\n @if (isLoading) {\r\n <span class=\"spinner-border spinner-border-sm\" aria-hidden=\"true\"></span>\r\n <span class=\"visually-hidden\" role=\"status\">{{ '_COMMON._HTTP.TXT_LOADING' | translate }}</span>\r\n }\r\n\r\n <ng-container *ngTemplateOutlet=\"buttonContent\"></ng-container>\r\n </button>\r\n }\r\n @else {\r\n <div (clickOutside)=\"onClickOutside()\" ctwClickOutside #dropdown class=\"dropdown d-inline-block\">\r\n <button class=\"btn\" [class]=\"'btn-' + type + ' ' + cssClass\" type=\"button\"\r\n [ngClass]=\"getButtonClasses()\"\r\n [disabled]=\"isDisabled\" [id]=\"id\" aria-expanded=\"false\" (click)=\"toggleDropdown()\" #dropdownToggle\r\n [attr.data-test-ctw]=\"dataTest\"\r\n [attr.aria-describedby]=\"withTooltip && isTooltipOpened ? 'ctw-tooltip-' + tooltipRandomId : null\"\r\n (mouseenter)=\"withTooltip && tooltipTrigger === 'hover' ? showTooltip() : null\"\r\n (mouseleave)=\"withTooltip && tooltipTrigger === 'hover' ? hideTooltip() : null\">\r\n\r\n <ng-container *ngTemplateOutlet=\"buttonContent\"></ng-container>\r\n\r\n @if(!withOnlyIcon) {\r\n <cw-icon [icon]=\"spriteIcon.down\" [iconSize]=\"iconSizeEnum['2xs']\" class=\"dropdown-icon\"></cw-icon>\r\n }\r\n </button>\r\n\r\n <div [attr.aria-labelledby]=\"id\" class=\"dropdown-menu\" [ngClass]=\"placementCss\" #dropdownMenu>\r\n <ng-content></ng-content>\r\n </div>\r\n </div>\r\n }\r\n</ng-template>\r\n\r\n<!-- Template existant du contenu du bouton -->\r\n<ng-template #buttonContent>\r\n @if (withIcon && iconPosition === buttonPositionEnum.left) {\r\n <ng-container *ngTemplateOutlet=\"iconContent\"></ng-container>\r\n }\r\n\r\n @if(withOnlyIcon) {\r\n <span class=\"visually-hidden\">{{label | translate }}</span>\r\n }\r\n @else {\r\n {{ label | translate }}\r\n }\r\n\r\n @if (withIcon && iconPosition === buttonPositionEnum.right) {\r\n <ng-container *ngTemplateOutlet=\"iconContent\"></ng-container>\r\n }\r\n</ng-template>\r\n\r\n<ng-template #iconContent>\r\n @if(withOnlyIcon) {\r\n @switch(iconSize) {\r\n @case(buttonIconSizeEnum.xsmall) {\r\n <cw-icon [icon]=\"withIcon\" [iconSize]=\"iconSizeEnum['xs']\"></cw-icon>\r\n }\r\n @case(buttonIconSizeEnum.small) {\r\n <cw-icon [icon]=\"withIcon\" [iconSize]=\"iconSizeEnum['xs']\"></cw-icon>\r\n }\r\n @default {\r\n <cw-icon [icon]=\"withIcon\" [iconSize]=\"iconSizeEnum['sm']\"></cw-icon>\r\n }\r\n }\r\n }\r\n @else {\r\n <cw-icon [icon]=\"withIcon\" [iconSize]=\"iconSizeEnum['sm']\"></cw-icon>\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: "component", type: IconComponent, selector: "cw-icon", inputs: ["icon", "label", "type", "iconSize", "iconCssClass", "iconUiType", "iconColorCustom", "spritePath"] }, { kind: "directive", type: ClickOutsideDirective, selector: "[clickOutside]", outputs: ["clickOutside"] }, { kind: "pipe", type: i2.TranslatePipe, name: "translate" }] }); }
|
|
1435
1525
|
}
|
|
1436
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.
|
|
1526
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: ButtonComponent, decorators: [{
|
|
1437
1527
|
type: Component,
|
|
1438
1528
|
args: [{ selector: 'cw-button', standalone: true, imports: [
|
|
1439
1529
|
CommonModule,
|
|
1440
1530
|
TranslateModule,
|
|
1441
1531
|
IconComponent,
|
|
1442
1532
|
ClickOutsideDirective
|
|
1443
|
-
], template: "<!-- Wrapper pour le tooltip -->\r\n@if (withTooltip) {\r\n <div class=\"d-inline-block p-relative\" (clickOutside)=\"onTooltipClickOutside()\" ctwClickOutside>\r\n\r\n <ng-container *ngTemplateOutlet=\"buttonTemplate\"></ng-container>\r\n\r\n <!-- Tooltip/Popover -->\r\n @if (isTooltipOpened) {\r\n <div role=\"tooltip\" [id]=\"'ctw-tooltip-' + tooltipRandomId\" [ngClass]=\"tooltipType + ' fade show ' + tooltipType + '-' + tooltipPosition\">\r\n <div class=\"arrow\"></div>\r\n @if (tooltipTitle) {\r\n <div [ngClass]=\"(tooltipType === typeTooltipEnum.popover ? 'popover' : 'tooltip') + '-header'\"\r\n [innerHTML]=\"tooltipTitle\"></div>\r\n }\r\n <div [ngClass]=\"tooltipType + '-body'\"\r\n [innerHTML]=\"tooltipText\"></div>\r\n </div>\r\n }\r\n </div>\r\n}\r\n@else {\r\n <ng-container *ngTemplateOutlet=\"buttonTemplate\"></ng-container>\r\n}\r\n\r\n<!-- Template du bouton (code existant envelopp\u00E9) -->\r\n<ng-template #buttonTemplate>\r\n @if (!isDropdown) {\r\n <button type=\"button\" class=\"btn\" [class]=\"'btn-' + type + ' ' + cssClass\" [ngClass]=\"getButtonClasses()\"\r\n [disabled]=\"isDisabled\" (click)=\"onBtnAction()\" [attr.data-test-ctw]=\"dataTest\"\r\n [attr.aria-describedby]=\"withTooltip && isTooltipOpened ? 'ctw-tooltip-' + tooltipRandomId : null\"\r\n (mouseenter)=\"withTooltip && tooltipTrigger === 'hover' ? showTooltip() : null\"\r\n (mouseleave)=\"withTooltip && tooltipTrigger === 'hover' ? hideTooltip() : null\"\r\n (click)=\"withTooltip && tooltipTrigger === 'click' ? showTooltip() : null\">\r\n\r\n @if (isLoading) {\r\n <span class=\"spinner-border spinner-border-sm\" aria-hidden=\"true\"></span>\r\n <span class=\"visually-hidden\" role=\"status\">{{ '_COMMON._HTTP.TXT_LOADING' | translate }}</span>\r\n }\r\n\r\n <ng-container *ngTemplateOutlet=\"buttonContent\"></ng-container>\r\n </button>\r\n }\r\n @else {\r\n <div (clickOutside)=\"onClickOutside()\" ctwClickOutside #dropdown class=\"dropdown d-inline-block\">\r\n <button class=\"btn\" [class]=\"'btn-' + type + ' ' + cssClass\" type=\"button\"\r\n [ngClass]=\"getButtonClasses()\"\r\n [disabled]=\"isDisabled\" [id]=\"id\" aria-expanded=\"false\" (click)=\"toggleDropdown()\" #dropdownToggle\r\n [attr.data-test-ctw]=\"dataTest\"\r\n [attr.aria-describedby]=\"withTooltip && isTooltipOpened ? 'ctw-tooltip-' + tooltipRandomId : null\"\r\n (mouseenter)=\"withTooltip && tooltipTrigger === 'hover' ? showTooltip() : null\"\r\n (mouseleave)=\"withTooltip && tooltipTrigger === 'hover' ? hideTooltip() : null\">\r\n\r\n <ng-container *ngTemplateOutlet=\"buttonContent\"></ng-container>\r\n\r\n @if(!withOnlyIcon) {\r\n <cw-icon [icon]=\"spriteIcon.down\" [iconSize]=\"iconSizeEnum['2xs']\" class=\"dropdown-icon\"></cw-icon>\r\n }\r\n </button>\r\n\r\n <div [attr.aria-labelledby]=\"id\" class=\"dropdown-menu\" [ngClass]=\"placementCss\" #dropdownMenu>\r\n <ng-content></ng-content>\r\n </div>\r\n </div>\r\n }\r\n</ng-template>\r\n\r\n<!-- Template existant du contenu du bouton -->\r\n<ng-template #buttonContent>\r\n @if (withIcon && iconPosition === buttonPositionEnum.left) {\r\n <ng-container *ngTemplateOutlet=\"iconContent\"></ng-container>\r\n }\r\n\r\n @if(withOnlyIcon) {\r\n <span class=\"visually-hidden\">{{label | translate }}</span>\r\n }\r\n @else {\r\n {{ label | translate }}\r\n }\r\n\r\n @if (withIcon && iconPosition === buttonPositionEnum.right) {\r\n <ng-container *ngTemplateOutlet=\"iconContent\"></ng-container>\r\n }\r\n</ng-template>\r\n\r\n<ng-template #iconContent>\r\n @if(withOnlyIcon) {\r\n @switch(iconSize) {\r\n @case(buttonIconSizeEnum.xsmall) {\r\n <cw-icon [icon]=\"withIcon\" [iconSize]=\"iconSizeEnum['xs']\"></cw-icon>\r\n }\r\n @case(buttonIconSizeEnum.small) {\r\n <cw-icon [icon]=\"withIcon\" [iconSize]=\"iconSizeEnum['xs']\"></cw-icon>\r\n }\r\n @default {\r\n <cw-icon [icon]=\"withIcon\" [iconSize]=\"iconSizeEnum['sm']\"></cw-icon>\r\n }\r\n }\r\n }\r\n @else {\r\n <cw-icon [icon]=\"withIcon\" [iconSize]=\"iconSizeEnum['sm']\"></cw-icon>\r\n }\r\n</ng-template>\r\n" }]
|
|
1533
|
+
], template: "<!-- Wrapper pour le tooltip -->\r\n@if (withTooltip) {\r\n <div class=\"d-inline-block p-relative\" (clickOutside)=\"onTooltipClickOutside()\" ctwClickOutside>\r\n\r\n <ng-container *ngTemplateOutlet=\"buttonTemplate\"></ng-container>\r\n\r\n <!-- Tooltip/Popover -->\r\n @if (isTooltipOpened) {\r\n <div role=\"tooltip\" [id]=\"'ctw-tooltip-' + tooltipRandomId\" [ngClass]=\"tooltipType + ' fade show ' + tooltipType + '-' + tooltipPosition\">\r\n <div class=\"arrow\"></div>\r\n @if (tooltipTitle) {\r\n <div [ngClass]=\"(tooltipType === typeTooltipEnum.popover ? 'popover' : 'tooltip') + '-header'\"\r\n [innerHTML]=\"tooltipTitle | translate\"></div>\r\n }\r\n <div [ngClass]=\"tooltipType + '-body'\"\r\n [innerHTML]=\"tooltipText | translate\"></div>\r\n </div>\r\n }\r\n </div>\r\n}\r\n@else {\r\n <ng-container *ngTemplateOutlet=\"buttonTemplate\"></ng-container>\r\n}\r\n\r\n<!-- Template du bouton (code existant envelopp\u00E9) -->\r\n<ng-template #buttonTemplate>\r\n @if (!isDropdown) {\r\n <button type=\"button\" class=\"btn\" [class]=\"'btn-' + type + ' ' + cssClass\" [ngClass]=\"getButtonClasses()\"\r\n [disabled]=\"isDisabled\" (click)=\"onBtnAction()\" [attr.data-test-ctw]=\"dataTest\"\r\n [attr.aria-describedby]=\"withTooltip && isTooltipOpened ? 'ctw-tooltip-' + tooltipRandomId : null\"\r\n (mouseenter)=\"withTooltip && tooltipTrigger === 'hover' ? showTooltip() : null\"\r\n (mouseleave)=\"withTooltip && tooltipTrigger === 'hover' ? hideTooltip() : null\"\r\n (click)=\"withTooltip && tooltipTrigger === 'click' ? showTooltip() : null\">\r\n\r\n @if (isLoading) {\r\n <span class=\"spinner-border spinner-border-sm\" aria-hidden=\"true\"></span>\r\n <span class=\"visually-hidden\" role=\"status\">{{ '_COMMON._HTTP.TXT_LOADING' | translate }}</span>\r\n }\r\n\r\n <ng-container *ngTemplateOutlet=\"buttonContent\"></ng-container>\r\n </button>\r\n }\r\n @else {\r\n <div (clickOutside)=\"onClickOutside()\" ctwClickOutside #dropdown class=\"dropdown d-inline-block\">\r\n <button class=\"btn\" [class]=\"'btn-' + type + ' ' + cssClass\" type=\"button\"\r\n [ngClass]=\"getButtonClasses()\"\r\n [disabled]=\"isDisabled\" [id]=\"id\" aria-expanded=\"false\" (click)=\"toggleDropdown()\" #dropdownToggle\r\n [attr.data-test-ctw]=\"dataTest\"\r\n [attr.aria-describedby]=\"withTooltip && isTooltipOpened ? 'ctw-tooltip-' + tooltipRandomId : null\"\r\n (mouseenter)=\"withTooltip && tooltipTrigger === 'hover' ? showTooltip() : null\"\r\n (mouseleave)=\"withTooltip && tooltipTrigger === 'hover' ? hideTooltip() : null\">\r\n\r\n <ng-container *ngTemplateOutlet=\"buttonContent\"></ng-container>\r\n\r\n @if(!withOnlyIcon) {\r\n <cw-icon [icon]=\"spriteIcon.down\" [iconSize]=\"iconSizeEnum['2xs']\" class=\"dropdown-icon\"></cw-icon>\r\n }\r\n </button>\r\n\r\n <div [attr.aria-labelledby]=\"id\" class=\"dropdown-menu\" [ngClass]=\"placementCss\" #dropdownMenu>\r\n <ng-content></ng-content>\r\n </div>\r\n </div>\r\n }\r\n</ng-template>\r\n\r\n<!-- Template existant du contenu du bouton -->\r\n<ng-template #buttonContent>\r\n @if (withIcon && iconPosition === buttonPositionEnum.left) {\r\n <ng-container *ngTemplateOutlet=\"iconContent\"></ng-container>\r\n }\r\n\r\n @if(withOnlyIcon) {\r\n <span class=\"visually-hidden\">{{label | translate }}</span>\r\n }\r\n @else {\r\n {{ label | translate }}\r\n }\r\n\r\n @if (withIcon && iconPosition === buttonPositionEnum.right) {\r\n <ng-container *ngTemplateOutlet=\"iconContent\"></ng-container>\r\n }\r\n</ng-template>\r\n\r\n<ng-template #iconContent>\r\n @if(withOnlyIcon) {\r\n @switch(iconSize) {\r\n @case(buttonIconSizeEnum.xsmall) {\r\n <cw-icon [icon]=\"withIcon\" [iconSize]=\"iconSizeEnum['xs']\"></cw-icon>\r\n }\r\n @case(buttonIconSizeEnum.small) {\r\n <cw-icon [icon]=\"withIcon\" [iconSize]=\"iconSizeEnum['xs']\"></cw-icon>\r\n }\r\n @default {\r\n <cw-icon [icon]=\"withIcon\" [iconSize]=\"iconSizeEnum['sm']\"></cw-icon>\r\n }\r\n }\r\n }\r\n @else {\r\n <cw-icon [icon]=\"withIcon\" [iconSize]=\"iconSizeEnum['sm']\"></cw-icon>\r\n }\r\n</ng-template>\r\n" }]
|
|
1444
1534
|
}], ctorParameters: () => [], propDecorators: { type: [{
|
|
1445
1535
|
type: Input
|
|
1446
1536
|
}], label: [{
|
|
@@ -1552,10 +1642,10 @@ class DropdownComponent {
|
|
|
1552
1642
|
this.closeDropdown();
|
|
1553
1643
|
}
|
|
1554
1644
|
}
|
|
1555
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.
|
|
1556
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.
|
|
1645
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: DropdownComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1646
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.20", type: DropdownComponent, isStandalone: true, selector: "cw-dropdown", inputs: { id: "id", title: "title", icon: "icon", btnCustom: "btnCustom", btnCssClass: "btnCssClass", menuClass: "menuClass", placement: "placement", autoClose: "autoClose" }, outputs: { opened: "opened", closed: "closed" }, viewQueries: [{ propertyName: "dropdownElement", first: true, predicate: ["dropdown"], descendants: true }, { propertyName: "dropdownMenu", first: true, predicate: ["dropdownMenu"], descendants: true }, { propertyName: "dropdownToggle", first: true, predicate: ["dropdownToggle"], descendants: true }], ngImport: i0, template: "<div class=\"dropdown\" [class.show]=\"isOpen()\" (clickOutside)=\"onClickOutside()\" clickOutside #dropdown>\r\n\r\n <button type=\"button\" class=\"dropdown-toggle btn\" [id]=\"dropdownId\" [attr.aria-expanded]=\"isOpen()\"\r\n [attr.aria-haspopup]=\"true\" (click)=\"toggleDropdown()\" [ngClass]=\"btnCssClass\" #dropdownToggle>\r\n\r\n <!-- Custom button content -->\r\n <ng-content select=\"[button]\"></ng-content>\r\n\r\n <!-- Classic button with icon -->\r\n @if (!btnCustom) {\r\n <cw-icon label=\"Menu\"></cw-icon>\r\n }\r\n </button>\r\n\r\n <div [attr.aria-labelledby]=\"dropdownId\" class=\"dropdown-menu\" [class.show]=\"isOpen()\"\r\n [ngClass]=\"placementCss + ' ' + menuClass\" #dropdownMenu>\r\n <ng-content></ng-content>\r\n </div>\r\n</div>\r\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: ClickOutsideDirective, selector: "[clickOutside]", outputs: ["clickOutside"] }, { kind: "component", type: IconComponent, selector: "cw-icon", inputs: ["icon", "label", "type", "iconSize", "iconCssClass", "iconUiType", "iconColorCustom", "spritePath"] }] }); }
|
|
1557
1647
|
}
|
|
1558
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.
|
|
1648
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: DropdownComponent, decorators: [{
|
|
1559
1649
|
type: Component,
|
|
1560
1650
|
args: [{ selector: 'cw-dropdown', standalone: true, imports: [
|
|
1561
1651
|
CommonModule,
|
|
@@ -1632,10 +1722,10 @@ class ShowHidePasswordDirective {
|
|
|
1632
1722
|
}
|
|
1633
1723
|
});
|
|
1634
1724
|
}
|
|
1635
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.
|
|
1636
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.
|
|
1725
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: ShowHidePasswordDirective, deps: [{ token: i0.ElementRef }, { token: i0.Renderer2 }, { token: i2.TranslateService }], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
1726
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.20", type: ShowHidePasswordDirective, isStandalone: true, selector: "[showHidePassword]", ngImport: i0 }); }
|
|
1637
1727
|
}
|
|
1638
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.
|
|
1728
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: ShowHidePasswordDirective, decorators: [{
|
|
1639
1729
|
type: Directive,
|
|
1640
1730
|
args: [{
|
|
1641
1731
|
// eslint-disable-next-line @angular-eslint/directive-selector
|
|
@@ -1735,7 +1825,6 @@ class FormFieldComponent {
|
|
|
1735
1825
|
constructor() {
|
|
1736
1826
|
this.displayLabel = true;
|
|
1737
1827
|
this.options = [];
|
|
1738
|
-
// TODO ajouter un boolean pour display ou pas le btn clear
|
|
1739
1828
|
this.isRequired = false;
|
|
1740
1829
|
this.isInAddon = false;
|
|
1741
1830
|
this.isReadonly = false;
|
|
@@ -1743,6 +1832,13 @@ class FormFieldComponent {
|
|
|
1743
1832
|
this.skeletonMode = false;
|
|
1744
1833
|
this.clearable = true;
|
|
1745
1834
|
this.appendTo = 'body';
|
|
1835
|
+
this.indeterminate = input(false, ...(ngDevMode ? [{ debugName: "indeterminate" }] : []));
|
|
1836
|
+
this.checkboxInputRef = viewChild('checkboxInput', ...(ngDevMode ? [{ debugName: "checkboxInputRef" }] : []));
|
|
1837
|
+
this.fileInputRef = viewChild('fileInput', ...(ngDevMode ? [{ debugName: "fileInputRef" }] : []));
|
|
1838
|
+
/** True si on a ajouté `Validators.required` nous-mêmes — sert à ne retirer que ce qu'on a mis. */
|
|
1839
|
+
this.requiredAppliedMain = false;
|
|
1840
|
+
this.requiredAppliedStart = false;
|
|
1841
|
+
this.requiredAppliedEnd = false;
|
|
1746
1842
|
this.refreshEvent = new EventEmitter();
|
|
1747
1843
|
this.textChanged = new EventEmitter();
|
|
1748
1844
|
this.valueChange = new EventEmitter();
|
|
@@ -1750,6 +1846,22 @@ class FormFieldComponent {
|
|
|
1750
1846
|
this.spriteIcon = SpriteIconEnum;
|
|
1751
1847
|
this.buttonType = FoButtonTypeEnum && BoButtonTypeEnum;
|
|
1752
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);
|
|
1753
1865
|
}
|
|
1754
1866
|
get isRange() {
|
|
1755
1867
|
if (!this.control)
|
|
@@ -1764,6 +1876,126 @@ class FormFieldComponent {
|
|
|
1764
1876
|
get controlOrGroup() {
|
|
1765
1877
|
return this.control ?? this.formGroup?.get(this.name);
|
|
1766
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
|
+
}
|
|
1887
|
+
/** Types dont min/max représentent un nombre de caractères (→ minlength/maxlength). */
|
|
1888
|
+
isTextLengthBased() {
|
|
1889
|
+
return [
|
|
1890
|
+
this.typeField.text,
|
|
1891
|
+
this.typeField.email,
|
|
1892
|
+
this.typeField.password,
|
|
1893
|
+
this.typeField.textarea,
|
|
1894
|
+
].includes(this.type);
|
|
1895
|
+
}
|
|
1896
|
+
get minLengthAttr() {
|
|
1897
|
+
return this.isTextLengthBased() ? (this.validationOptions?.min ?? null) : null;
|
|
1898
|
+
}
|
|
1899
|
+
get maxLengthAttr() {
|
|
1900
|
+
return this.isTextLengthBased() ? (this.validationOptions?.max ?? null) : null;
|
|
1901
|
+
}
|
|
1902
|
+
get minAttr() {
|
|
1903
|
+
return !this.isTextLengthBased() ? (this.validationOptions?.min ?? null) : null;
|
|
1904
|
+
}
|
|
1905
|
+
get maxAttr() {
|
|
1906
|
+
return !this.isTextLengthBased() ? (this.validationOptions?.max ?? null) : null;
|
|
1907
|
+
}
|
|
1908
|
+
get minStartAttr() {
|
|
1909
|
+
return this.validationOptions?.minStart ?? this.validationOptions?.min ?? null;
|
|
1910
|
+
}
|
|
1911
|
+
get maxStartAttr() {
|
|
1912
|
+
return this.validationOptions?.maxStart ?? this.validationOptions?.max ?? null;
|
|
1913
|
+
}
|
|
1914
|
+
get minEndAttr() {
|
|
1915
|
+
return this.validationOptions?.minEnd ?? this.validationOptions?.min ?? null;
|
|
1916
|
+
}
|
|
1917
|
+
get maxEndAttr() {
|
|
1918
|
+
return this.validationOptions?.maxEnd ?? this.validationOptions?.max ?? null;
|
|
1919
|
+
}
|
|
1920
|
+
get stepAttr() {
|
|
1921
|
+
return this.validationOptions?.step ?? null;
|
|
1922
|
+
}
|
|
1923
|
+
get patternAttr() {
|
|
1924
|
+
return this.isTextLengthBased() ? (this.validationOptions?.pattern ?? null) : null;
|
|
1925
|
+
}
|
|
1926
|
+
get acceptAttr() {
|
|
1927
|
+
const accept = this.validationOptions?.accept;
|
|
1928
|
+
return this.type === this.typeField.file && accept?.length ? accept.join(',') : null;
|
|
1929
|
+
}
|
|
1930
|
+
/** Formate une taille en octets en "Ko" si < 1000 Ko, sinon en "Mo" (ex. "500 Ko", "2 Mo"). */
|
|
1931
|
+
formatFileSize(bytes) {
|
|
1932
|
+
const ko = bytes / 1024;
|
|
1933
|
+
if (ko < 1000) {
|
|
1934
|
+
return `${Math.round(ko)} Ko`;
|
|
1935
|
+
}
|
|
1936
|
+
const mo = ko / 1024;
|
|
1937
|
+
return `${Math.round(mo * 10) / 10} Mo`;
|
|
1938
|
+
}
|
|
1939
|
+
get maxSizeLabel() {
|
|
1940
|
+
return this.validationOptions?.maxSize != null
|
|
1941
|
+
? this.formatFileSize(this.validationOptions.maxSize)
|
|
1942
|
+
: '';
|
|
1943
|
+
}
|
|
1944
|
+
get acceptLabel() {
|
|
1945
|
+
return this.validationOptions?.accept
|
|
1946
|
+
?.map(a => a.startsWith('.') ? a.slice(1).toUpperCase() : a)
|
|
1947
|
+
.join(', ') ?? '';
|
|
1948
|
+
}
|
|
1949
|
+
/**
|
|
1950
|
+
* Lignes d'aide auto-générées à partir de `validationOptions`, affichées après le `help` input.
|
|
1951
|
+
* Couvre : longueur min/max sur les types texte, valeur min/max sur number, et accept/maxSize sur file.
|
|
1952
|
+
*/
|
|
1953
|
+
/**
|
|
1954
|
+
* Concatène les ids à exposer dans `aria-describedby` :
|
|
1955
|
+
* l'id du bloc d'erreur (si le control est invalide+touched) et l'id du bloc help (si présent).
|
|
1956
|
+
* Retourne `null` si aucun, pour ne pas polluer le DOM avec un attribut vide.
|
|
1957
|
+
*/
|
|
1958
|
+
getDescribedBy(target) {
|
|
1959
|
+
const ids = [];
|
|
1960
|
+
if (target?.invalid && target?.touched) {
|
|
1961
|
+
ids.push(`error-${this.name}`);
|
|
1962
|
+
}
|
|
1963
|
+
if (this.help || this.autoHelpEntries.length) {
|
|
1964
|
+
ids.push(`${this.name}-help`);
|
|
1965
|
+
}
|
|
1966
|
+
return ids.length ? ids.join(' ') : null;
|
|
1967
|
+
}
|
|
1968
|
+
get autoHelpEntries() {
|
|
1969
|
+
const entries = [];
|
|
1970
|
+
const opts = this.validationOptions;
|
|
1971
|
+
if (!opts)
|
|
1972
|
+
return entries;
|
|
1973
|
+
const hasMin = opts.min != null;
|
|
1974
|
+
const hasMax = opts.max != null;
|
|
1975
|
+
if (this.isTextLengthBased()) {
|
|
1976
|
+
if (hasMin && hasMax)
|
|
1977
|
+
entries.push({ key: '_COMMON._FORM.HELP_LENGTH_RANGE', params: { min: opts.min, max: opts.max } });
|
|
1978
|
+
else if (hasMin)
|
|
1979
|
+
entries.push({ key: '_COMMON._FORM.HELP_LENGTH_MIN', params: { min: opts.min } });
|
|
1980
|
+
else if (hasMax)
|
|
1981
|
+
entries.push({ key: '_COMMON._FORM.HELP_LENGTH_MAX', params: { max: opts.max } });
|
|
1982
|
+
}
|
|
1983
|
+
else if (this.type === this.typeField.number) {
|
|
1984
|
+
if (hasMin && hasMax)
|
|
1985
|
+
entries.push({ key: '_COMMON._FORM.HELP_NUMBER_RANGE', params: { min: opts.min, max: opts.max } });
|
|
1986
|
+
else if (hasMin)
|
|
1987
|
+
entries.push({ key: '_COMMON._FORM.HELP_NUMBER_MIN', params: { min: opts.min } });
|
|
1988
|
+
else if (hasMax)
|
|
1989
|
+
entries.push({ key: '_COMMON._FORM.HELP_NUMBER_MAX', params: { max: opts.max } });
|
|
1990
|
+
}
|
|
1991
|
+
else if (this.type === this.typeField.file) {
|
|
1992
|
+
if (opts.accept?.length)
|
|
1993
|
+
entries.push({ key: '_COMMON._FORM.HELP_FILE_ACCEPT', params: { accept: this.acceptLabel } });
|
|
1994
|
+
if (opts.maxSize != null)
|
|
1995
|
+
entries.push({ key: '_COMMON._FORM.HELP_FILE_SIZE', params: { maxSize: this.maxSizeLabel } });
|
|
1996
|
+
}
|
|
1997
|
+
return entries;
|
|
1998
|
+
}
|
|
1767
1999
|
ngOnInit() {
|
|
1768
2000
|
if (this.formGroup && this.name) {
|
|
1769
2001
|
const group = this.formGroup.get(this.name);
|
|
@@ -1782,11 +2014,157 @@ class FormFieldComponent {
|
|
|
1782
2014
|
group.updateValueAndValidity();
|
|
1783
2015
|
}
|
|
1784
2016
|
}
|
|
2017
|
+
if (this.validationOptions?.applyValidators) {
|
|
2018
|
+
this.applyAngularValidators();
|
|
2019
|
+
}
|
|
2020
|
+
this.syncRequiredValidator();
|
|
2021
|
+
}
|
|
2022
|
+
/**
|
|
2023
|
+
* Synchronise `Validators.required` sur le control lié en fonction de `isRequired`.
|
|
2024
|
+
* - Ne mute que ce qui a été ajouté ici (tracking via flags) pour ne pas écraser un validator du parent.
|
|
2025
|
+
* - Étend aux sous-controls `start`/`end` pour les types période.
|
|
2026
|
+
*/
|
|
2027
|
+
syncRequiredValidator() {
|
|
2028
|
+
if (this.isRange) {
|
|
2029
|
+
const startCtrl = this.getControl('start');
|
|
2030
|
+
const endCtrl = this.getControl('end');
|
|
2031
|
+
if (startCtrl)
|
|
2032
|
+
this.requiredAppliedStart = this.toggleRequired(startCtrl, this.requiredAppliedStart);
|
|
2033
|
+
if (endCtrl)
|
|
2034
|
+
this.requiredAppliedEnd = this.toggleRequired(endCtrl, this.requiredAppliedEnd);
|
|
2035
|
+
}
|
|
2036
|
+
else {
|
|
2037
|
+
const ctrl = this.controlOrGroup;
|
|
2038
|
+
if (ctrl)
|
|
2039
|
+
this.requiredAppliedMain = this.toggleRequired(ctrl, this.requiredAppliedMain);
|
|
2040
|
+
}
|
|
2041
|
+
}
|
|
2042
|
+
/** Ajoute/retire `Validators.required` selon `isRequired`, et retourne le nouveau flag "appliqué par nous". */
|
|
2043
|
+
toggleRequired(ctrl, alreadyApplied) {
|
|
2044
|
+
if (this.isRequired) {
|
|
2045
|
+
if (!ctrl.hasValidator(Validators.required)) {
|
|
2046
|
+
ctrl.addValidators(Validators.required);
|
|
2047
|
+
ctrl.updateValueAndValidity();
|
|
2048
|
+
return true;
|
|
2049
|
+
}
|
|
2050
|
+
return alreadyApplied;
|
|
2051
|
+
}
|
|
2052
|
+
if (alreadyApplied) {
|
|
2053
|
+
ctrl.removeValidators(Validators.required);
|
|
2054
|
+
ctrl.updateValueAndValidity();
|
|
2055
|
+
return false;
|
|
2056
|
+
}
|
|
2057
|
+
return false;
|
|
2058
|
+
}
|
|
2059
|
+
/**
|
|
2060
|
+
* Reflète les options de validation HTML dans les Validators Angular du contrôle lié,
|
|
2061
|
+
* pour que `control.invalid` réponde aux mêmes règles que la validation native du navigateur.
|
|
2062
|
+
*/
|
|
2063
|
+
applyAngularValidators() {
|
|
2064
|
+
const opts = this.validationOptions;
|
|
2065
|
+
if (!opts)
|
|
2066
|
+
return;
|
|
2067
|
+
const isRangeType = this.isRange;
|
|
2068
|
+
const validators = [];
|
|
2069
|
+
const startValidators = [];
|
|
2070
|
+
const endValidators = [];
|
|
2071
|
+
if (this.isTextLengthBased()) {
|
|
2072
|
+
if (opts.min != null)
|
|
2073
|
+
validators.push(Validators.minLength(Number(opts.min)));
|
|
2074
|
+
if (opts.max != null)
|
|
2075
|
+
validators.push(Validators.maxLength(Number(opts.max)));
|
|
2076
|
+
if (opts.pattern)
|
|
2077
|
+
validators.push(Validators.pattern(opts.pattern));
|
|
2078
|
+
}
|
|
2079
|
+
else if (this.type === this.typeField.number) {
|
|
2080
|
+
if (opts.min != null)
|
|
2081
|
+
validators.push(Validators.min(Number(opts.min)));
|
|
2082
|
+
if (opts.max != null)
|
|
2083
|
+
validators.push(Validators.max(Number(opts.max)));
|
|
2084
|
+
}
|
|
2085
|
+
else if (this.type === this.typeField.file) {
|
|
2086
|
+
if (opts.accept?.length)
|
|
2087
|
+
validators.push(this.makeFileExtensionValidator(opts.accept));
|
|
2088
|
+
if (opts.maxSize != null)
|
|
2089
|
+
validators.push(this.makeFileSizeValidator(opts.maxSize));
|
|
2090
|
+
}
|
|
2091
|
+
if (isRangeType) {
|
|
2092
|
+
const minS = opts.minStart ?? opts.min;
|
|
2093
|
+
const maxS = opts.maxStart ?? opts.max;
|
|
2094
|
+
const minE = opts.minEnd ?? opts.min;
|
|
2095
|
+
const maxE = opts.maxEnd ?? opts.max;
|
|
2096
|
+
if (minS != null)
|
|
2097
|
+
startValidators.push(this.makeBoundValidator(minS, 'min'));
|
|
2098
|
+
if (maxS != null)
|
|
2099
|
+
startValidators.push(this.makeBoundValidator(maxS, 'max'));
|
|
2100
|
+
if (minE != null)
|
|
2101
|
+
endValidators.push(this.makeBoundValidator(minE, 'min'));
|
|
2102
|
+
if (maxE != null)
|
|
2103
|
+
endValidators.push(this.makeBoundValidator(maxE, 'max'));
|
|
2104
|
+
const startCtrl = this.getControl('start');
|
|
2105
|
+
const endCtrl = this.getControl('end');
|
|
2106
|
+
if (startCtrl && startValidators.length) {
|
|
2107
|
+
startCtrl.addValidators(startValidators);
|
|
2108
|
+
startCtrl.updateValueAndValidity();
|
|
2109
|
+
}
|
|
2110
|
+
if (endCtrl && endValidators.length) {
|
|
2111
|
+
endCtrl.addValidators(endValidators);
|
|
2112
|
+
endCtrl.updateValueAndValidity();
|
|
2113
|
+
}
|
|
2114
|
+
}
|
|
2115
|
+
else if (validators.length && this.control) {
|
|
2116
|
+
this.control.addValidators(validators);
|
|
2117
|
+
this.control.updateValueAndValidity();
|
|
2118
|
+
}
|
|
2119
|
+
}
|
|
2120
|
+
/** Validator d'extension/MIME : vérifie que le File ou son nom matche l'une des entrées `accept`. */
|
|
2121
|
+
makeFileExtensionValidator(accept) {
|
|
2122
|
+
const normalized = accept.map(a => a.trim().toLowerCase()).filter(Boolean);
|
|
2123
|
+
return (ctrl) => {
|
|
2124
|
+
const v = ctrl.value;
|
|
2125
|
+
if (!v)
|
|
2126
|
+
return null;
|
|
2127
|
+
const file = v instanceof File ? v : null;
|
|
2128
|
+
const name = (file?.name ?? (typeof v === 'string' ? v : '')).toLowerCase();
|
|
2129
|
+
const mime = file?.type?.toLowerCase() ?? '';
|
|
2130
|
+
if (!name && !mime)
|
|
2131
|
+
return null;
|
|
2132
|
+
const matches = normalized.some(rule => {
|
|
2133
|
+
if (rule.startsWith('.'))
|
|
2134
|
+
return name.endsWith(rule);
|
|
2135
|
+
if (rule.endsWith('/*'))
|
|
2136
|
+
return mime.startsWith(rule.slice(0, -1));
|
|
2137
|
+
return mime === rule;
|
|
2138
|
+
});
|
|
2139
|
+
return matches ? null : { fileExtension: { accept } };
|
|
2140
|
+
};
|
|
2141
|
+
}
|
|
2142
|
+
/** Validator de taille : vérifie que le File a une taille <= maxSize (octets). */
|
|
2143
|
+
makeFileSizeValidator(maxSize) {
|
|
2144
|
+
return (ctrl) => {
|
|
2145
|
+
const v = ctrl.value;
|
|
2146
|
+
if (!(v instanceof File))
|
|
2147
|
+
return null;
|
|
2148
|
+
return v.size > maxSize ? { fileSize: { maxSize, actual: v.size } } : null;
|
|
2149
|
+
};
|
|
2150
|
+
}
|
|
2151
|
+
/** Validator générique de borne pour les types date/time/datetime (comparaison lexicographique sur string ISO). */
|
|
2152
|
+
makeBoundValidator(bound, kind) {
|
|
2153
|
+
return (ctrl) => {
|
|
2154
|
+
const v = ctrl.value;
|
|
2155
|
+
if (v == null || v === '')
|
|
2156
|
+
return null;
|
|
2157
|
+
const violates = kind === 'min' ? v < bound : v > bound;
|
|
2158
|
+
return violates ? { [kind]: { [kind]: bound, actual: v } } : null;
|
|
2159
|
+
};
|
|
1785
2160
|
}
|
|
1786
2161
|
ngOnChanges(changes) {
|
|
1787
2162
|
if (changes['options'] && changes['options'].currentValue) {
|
|
1788
2163
|
this.options = [...changes['options'].currentValue];
|
|
1789
2164
|
}
|
|
2165
|
+
if (changes['isRequired'] && !changes['isRequired'].firstChange) {
|
|
2166
|
+
this.syncRequiredValidator();
|
|
2167
|
+
}
|
|
1790
2168
|
}
|
|
1791
2169
|
onCheckboxChange(event) {
|
|
1792
2170
|
const checkbox = event.target;
|
|
@@ -1803,6 +2181,14 @@ class FormFieldComponent {
|
|
|
1803
2181
|
onRadioChange(value) {
|
|
1804
2182
|
this.valueChange.emit(value);
|
|
1805
2183
|
}
|
|
2184
|
+
onFileChange(event) {
|
|
2185
|
+
const input = event.target;
|
|
2186
|
+
const file = input.files?.[0] ?? null;
|
|
2187
|
+
this.formControl.setValue(file);
|
|
2188
|
+
this.formControl.markAsTouched();
|
|
2189
|
+
this.formControl.updateValueAndValidity();
|
|
2190
|
+
this.valueChange.emit(file);
|
|
2191
|
+
}
|
|
1806
2192
|
onBlur() {
|
|
1807
2193
|
if (this.control && !this.control.touched) {
|
|
1808
2194
|
this.control.markAsTouched();
|
|
@@ -1811,6 +2197,7 @@ class FormFieldComponent {
|
|
|
1811
2197
|
isInInputGroup() {
|
|
1812
2198
|
const inInputGroup = [
|
|
1813
2199
|
this.typeField.text,
|
|
2200
|
+
this.typeField.file,
|
|
1814
2201
|
this.typeField.date,
|
|
1815
2202
|
this.typeField.time,
|
|
1816
2203
|
this.typeField.dateTime,
|
|
@@ -1854,6 +2241,11 @@ class FormFieldComponent {
|
|
|
1854
2241
|
control?.setValue(null);
|
|
1855
2242
|
control?.markAsPristine();
|
|
1856
2243
|
control?.markAsUntouched();
|
|
2244
|
+
if (this.type === this.typeField.file) {
|
|
2245
|
+
const ref = this.fileInputRef();
|
|
2246
|
+
if (ref)
|
|
2247
|
+
ref.nativeElement.value = '';
|
|
2248
|
+
}
|
|
1857
2249
|
}
|
|
1858
2250
|
onDateAddDay(direction) {
|
|
1859
2251
|
const current = this.getDateValue();
|
|
@@ -1900,10 +2292,10 @@ class FormFieldComponent {
|
|
|
1900
2292
|
}
|
|
1901
2293
|
this.formControl.markAsTouched();
|
|
1902
2294
|
}
|
|
1903
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.
|
|
1904
|
-
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" }] }); }
|
|
2295
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: FormFieldComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2296
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.20", 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 }, validationOptions: { classPropertyName: "validationOptions", publicName: "validationOptions", 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 }, { propertyName: "fileInputRef", first: true, predicate: ["fileInput"], 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 @if (controlOrGroup?.errors?.['fileExtension']) {\r\n <span>{{ '_COMMON._FORM.ERROR_FILE_EXTENSION' | translate: { accept: acceptLabel } }}</span>\r\n }\r\n @if (controlOrGroup?.errors?.['fileSize']) {\r\n <span>{{ '_COMMON._FORM.ERROR_FILE_SIZE' | translate: { maxSize: maxSizeLabel } }}</span>\r\n }\r\n </div>\r\n }\r\n\r\n @if (help || autoHelpEntries.length) {\r\n <div [id]=\"name + '-help'\" class=\"field-text\">\r\n @if (help) {\r\n <div>{{ help | translate }}</div>\r\n }\r\n @for (entry of autoHelpEntries; track entry.key) {\r\n <div>{{ entry.key | translate: entry.params }}</div>\r\n }\r\n </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,\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.minlength]=\"minLengthAttr\" [attr.maxlength]=\"maxLengthAttr\"\r\n [attr.min]=\"minAttr\" [attr.max]=\"maxAttr\" [attr.step]=\"stepAttr\" [attr.pattern]=\"patternAttr\"\r\n [attr.aria-invalid]=\"control.invalid && control.touched\"\r\n [attr.aria-describedby]=\"getDescribedBy(control)\" />\r\n }\r\n\r\n <!-- File -->\r\n @if (type === typeField.file) {\r\n <input #fileInput type=\"file\" class=\"field-control\" [id]=\"name\"\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.accept]=\"acceptAttr\"\r\n [attr.aria-invalid]=\"control.invalid && control.touched\"\r\n [attr.aria-describedby]=\"getDescribedBy(control)\"\r\n (change)=\"onFileChange($event)\" (blur)=\"onBlur()\" />\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.minlength]=\"minLengthAttr\" [attr.maxlength]=\"maxLengthAttr\" [attr.pattern]=\"patternAttr\"\r\n [attr.aria-invalid]=\"control.invalid && control.touched\"\r\n [attr.aria-describedby]=\"getDescribedBy(control)\" />\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.minlength]=\"minLengthAttr\" [attr.maxlength]=\"maxLengthAttr\" [attr.pattern]=\"patternAttr\"\r\n [attr.aria-describedby]=\"getDescribedBy(control)\"></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]=\"getDescribedBy(control)\" [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]=\"getDescribedBy(control)\" [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]=\"getDescribedBy(control)\">\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]=\"getDescribedBy(control)\">\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]=\"getDescribedBy(control)\"\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]=\"getDescribedBy(control)\"\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]=\"getDescribedBy(control)\"\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]=\"getDescribedBy(control)\"\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]=\"getDescribedBy(control)\">\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]=\"getDescribedBy(control)\"\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.min]=\"minStartAttr\" [attr.max]=\"maxStartAttr\" [attr.step]=\"stepAttr\"\r\n [attr.aria-invalid]=\"getControl('start')?.invalid && getControl('start')?.touched\"\r\n [attr.aria-describedby]=\"getDescribedBy(getControl('start'))\" />\r\n\r\n @if(getControl('start')?.value && !isEffectivelyDisabled) {\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.min]=\"minEndAttr\" [attr.max]=\"maxEndAttr\" [attr.step]=\"stepAttr\"\r\n [attr.aria-invalid]=\"getControl('end')?.invalid && getControl('end')?.touched\"\r\n [attr.aria-describedby]=\"getDescribedBy(getControl('end'))\" />\r\n\r\n @if(getControl('end')?.value && !isEffectivelyDisabled) {\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.min]=\"minAttr\" [attr.max]=\"maxAttr\" [attr.step]=\"stepAttr\"\r\n [attr.aria-invalid]=\"control.invalid && control.touched\"\r\n [attr.aria-describedby]=\"getDescribedBy(control)\" />\r\n\r\n @if(formControl?.value && !isEffectivelyDisabled) {\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 && !isEffectivelyDisabled) {\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" }] }); }
|
|
1905
2297
|
}
|
|
1906
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.
|
|
2298
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: FormFieldComponent, decorators: [{
|
|
1907
2299
|
type: Component,
|
|
1908
2300
|
args: [{ selector: 'cw-form-field', standalone: true, imports: [
|
|
1909
2301
|
CommonModule,
|
|
@@ -1915,7 +2307,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.19", ngImpo
|
|
|
1915
2307
|
ShowHidePasswordDirective,
|
|
1916
2308
|
IconComponent,
|
|
1917
2309
|
ButtonComponent
|
|
1918
|
-
], 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" }]
|
|
2310
|
+
], 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 @if (controlOrGroup?.errors?.['fileExtension']) {\r\n <span>{{ '_COMMON._FORM.ERROR_FILE_EXTENSION' | translate: { accept: acceptLabel } }}</span>\r\n }\r\n @if (controlOrGroup?.errors?.['fileSize']) {\r\n <span>{{ '_COMMON._FORM.ERROR_FILE_SIZE' | translate: { maxSize: maxSizeLabel } }}</span>\r\n }\r\n </div>\r\n }\r\n\r\n @if (help || autoHelpEntries.length) {\r\n <div [id]=\"name + '-help'\" class=\"field-text\">\r\n @if (help) {\r\n <div>{{ help | translate }}</div>\r\n }\r\n @for (entry of autoHelpEntries; track entry.key) {\r\n <div>{{ entry.key | translate: entry.params }}</div>\r\n }\r\n </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,\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.minlength]=\"minLengthAttr\" [attr.maxlength]=\"maxLengthAttr\"\r\n [attr.min]=\"minAttr\" [attr.max]=\"maxAttr\" [attr.step]=\"stepAttr\" [attr.pattern]=\"patternAttr\"\r\n [attr.aria-invalid]=\"control.invalid && control.touched\"\r\n [attr.aria-describedby]=\"getDescribedBy(control)\" />\r\n }\r\n\r\n <!-- File -->\r\n @if (type === typeField.file) {\r\n <input #fileInput type=\"file\" class=\"field-control\" [id]=\"name\"\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.accept]=\"acceptAttr\"\r\n [attr.aria-invalid]=\"control.invalid && control.touched\"\r\n [attr.aria-describedby]=\"getDescribedBy(control)\"\r\n (change)=\"onFileChange($event)\" (blur)=\"onBlur()\" />\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.minlength]=\"minLengthAttr\" [attr.maxlength]=\"maxLengthAttr\" [attr.pattern]=\"patternAttr\"\r\n [attr.aria-invalid]=\"control.invalid && control.touched\"\r\n [attr.aria-describedby]=\"getDescribedBy(control)\" />\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.minlength]=\"minLengthAttr\" [attr.maxlength]=\"maxLengthAttr\" [attr.pattern]=\"patternAttr\"\r\n [attr.aria-describedby]=\"getDescribedBy(control)\"></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]=\"getDescribedBy(control)\" [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]=\"getDescribedBy(control)\" [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]=\"getDescribedBy(control)\">\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]=\"getDescribedBy(control)\">\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]=\"getDescribedBy(control)\"\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]=\"getDescribedBy(control)\"\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]=\"getDescribedBy(control)\"\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]=\"getDescribedBy(control)\"\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]=\"getDescribedBy(control)\">\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]=\"getDescribedBy(control)\"\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.min]=\"minStartAttr\" [attr.max]=\"maxStartAttr\" [attr.step]=\"stepAttr\"\r\n [attr.aria-invalid]=\"getControl('start')?.invalid && getControl('start')?.touched\"\r\n [attr.aria-describedby]=\"getDescribedBy(getControl('start'))\" />\r\n\r\n @if(getControl('start')?.value && !isEffectivelyDisabled) {\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.min]=\"minEndAttr\" [attr.max]=\"maxEndAttr\" [attr.step]=\"stepAttr\"\r\n [attr.aria-invalid]=\"getControl('end')?.invalid && getControl('end')?.touched\"\r\n [attr.aria-describedby]=\"getDescribedBy(getControl('end'))\" />\r\n\r\n @if(getControl('end')?.value && !isEffectivelyDisabled) {\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.min]=\"minAttr\" [attr.max]=\"maxAttr\" [attr.step]=\"stepAttr\"\r\n [attr.aria-invalid]=\"control.invalid && control.touched\"\r\n [attr.aria-describedby]=\"getDescribedBy(control)\" />\r\n\r\n @if(formControl?.value && !isEffectivelyDisabled) {\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 && !isEffectivelyDisabled) {\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" }]
|
|
1919
2311
|
}], ctorParameters: () => [], propDecorators: { control: [{
|
|
1920
2312
|
type: Input
|
|
1921
2313
|
}], formGroup: [{
|
|
@@ -1934,6 +2326,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.19", ngImpo
|
|
|
1934
2326
|
type: Input
|
|
1935
2327
|
}], rangeOptions: [{
|
|
1936
2328
|
type: Input
|
|
2329
|
+
}], validationOptions: [{
|
|
2330
|
+
type: Input
|
|
1937
2331
|
}], isRequired: [{
|
|
1938
2332
|
type: Input
|
|
1939
2333
|
}], help: [{
|
|
@@ -1962,7 +2356,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.19", ngImpo
|
|
|
1962
2356
|
type: Input
|
|
1963
2357
|
}], appendTo: [{
|
|
1964
2358
|
type: Input
|
|
1965
|
-
}], refreshEvent: [{
|
|
2359
|
+
}], indeterminate: [{ type: i0.Input, args: [{ isSignal: true, alias: "indeterminate", required: false }] }], checkboxInputRef: [{ type: i0.ViewChild, args: ['checkboxInput', { isSignal: true }] }], fileInputRef: [{ type: i0.ViewChild, args: ['fileInput', { isSignal: true }] }], refreshEvent: [{
|
|
1966
2360
|
type: Output
|
|
1967
2361
|
}], textChanged: [{
|
|
1968
2362
|
type: Output
|
|
@@ -1992,10 +2386,10 @@ class LegendComponent {
|
|
|
1992
2386
|
this.displayInline = input(false, ...(ngDevMode ? [{ debugName: "displayInline" }] : []));
|
|
1993
2387
|
this.legendTypeEnum = LegendTypeEnum;
|
|
1994
2388
|
}
|
|
1995
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.
|
|
1996
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.
|
|
2389
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: LegendComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2390
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.20", 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" }] }); }
|
|
1997
2391
|
}
|
|
1998
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.
|
|
2392
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: LegendComponent, decorators: [{
|
|
1999
2393
|
type: Component,
|
|
2000
2394
|
args: [{ selector: 'cw-legend', standalone: true, imports: [
|
|
2001
2395
|
CommonModule,
|
|
@@ -2007,10 +2401,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.19", ngImpo
|
|
|
2007
2401
|
|
|
2008
2402
|
class LoaderComponent {
|
|
2009
2403
|
constructor() { }
|
|
2010
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.
|
|
2011
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.
|
|
2404
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: LoaderComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2405
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.20", type: LoaderComponent, isStandalone: true, selector: "cw-loader", ngImport: i0, template: "<div class=\"d-flex-v gap-md loader items-center\">\r\n <span class=\"spinner-border spinner-border\" aria-hidden=\"true\"></span>\r\n <span role=\"status\">{{ '_COMMON._HTTP.TXT_LOADING' | translate }}</span>\r\n</div>\r\n", dependencies: [{ kind: "ngmodule", type: TranslateModule }, { kind: "pipe", type: i2.TranslatePipe, name: "translate" }] }); }
|
|
2012
2406
|
}
|
|
2013
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.
|
|
2407
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: LoaderComponent, decorators: [{
|
|
2014
2408
|
type: Component,
|
|
2015
2409
|
args: [{ selector: 'cw-loader', standalone: true, imports: [
|
|
2016
2410
|
TranslateModule
|
|
@@ -2132,10 +2526,10 @@ class ModalsService {
|
|
|
2132
2526
|
previousEl.focus();
|
|
2133
2527
|
}
|
|
2134
2528
|
}
|
|
2135
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.
|
|
2136
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.
|
|
2529
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: ModalsService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
2530
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: ModalsService, providedIn: 'root' }); }
|
|
2137
2531
|
}
|
|
2138
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.
|
|
2532
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: ModalsService, decorators: [{
|
|
2139
2533
|
type: Injectable,
|
|
2140
2534
|
args: [{
|
|
2141
2535
|
providedIn: 'root',
|
|
@@ -2231,10 +2625,10 @@ class ModalsComponent {
|
|
|
2231
2625
|
}
|
|
2232
2626
|
});
|
|
2233
2627
|
}
|
|
2234
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.
|
|
2235
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.
|
|
2628
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: ModalsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2629
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.20", 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" }] }); }
|
|
2236
2630
|
}
|
|
2237
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.
|
|
2631
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: ModalsComponent, decorators: [{
|
|
2238
2632
|
type: Component,
|
|
2239
2633
|
args: [{ selector: 'cw-modals', standalone: true, imports: [CommonModule, TranslateModule, NgClass, NgTemplateOutlet, ButtonComponent, LoaderComponent, IconComponent], template: "<div class=\"cityway-v8 modal-backdrop fade show\" style=\"z-index: 1050;\" aria-hidden=\"true\"></div>\n\n<div role=\"dialog\" tabindex=\"-1\" aria-modal=\"true\" aria-labelledby=\"modal-basic-title\"\n class=\"cityway-v8 d-flex modal show\" [ngClass]=\"customClass()\" data-test-ctw=\"modal\" (keydown)=\"onKeyDown($event)\">\n\n <div class=\"modal-inner-backdrop\" (click)=\"type() !== modalsType.loader && closeModal()\"></div>\n\n <div #modalContainer role=\"document\" class=\"modal-dialog modal-dialog-centered\"\n [ngClass]=\"['modal-' + size(), scrollable() ? 'modal-dialog-scrollable' : '']\">\n\n <div class=\"modal-content\">\n\n @if (type() !== modalsType.loader) {\n @if (type() == modalsType.delete || type() == modalsType.quickSideView || type() == modalsType.custom) {\n <div class=\"modal-header\">\n @if (type() === modalsType.delete) {\n <h1 class=\"modal-title\" id=\"modal-basic-title\">\n {{ '_COMMON._MODAL_DELETE.TITLE' | translate: { number: itemsToDelete().length, name: itemsToDeleteTitle() | translate } }}\n </h1>\n }\n @else {\n <h1 class=\"modal-title\" id=\"modal-basic-title\">\n {{ modalTitle() | translate }}\n </h1>\n }\n\n <cw-button [label]=\"'_COMMON._ACTION.CLOSE' | translate\" [type]=\"buttonTypeEnum.light\" [withOnlyIcon]=\"true\"\n [withIcon]=\"spriteIcon.toolbarClose\" (btnAction)=\"closeModal()\" dataTest=\"btn-close-modal\"\n cssClass=\"btn-close\">\n </cw-button>\n </div>\n\n <div class=\"modal-body\">\n @if (type() === modalsType.delete) {\n @if (itemsToDelete().length === 1) {\n <div [innerHTML]=\"'_COMMON._MODAL_DELETE.SIMPLE_TEXT' | translate\"></div>\n }\n @if (itemsToDelete().length > 1) {\n <div [innerHTML]=\"'_COMMON._MODAL_DELETE.MULTIPLE_TEXT' | translate\"></div>\n }\n @if (itemsToDelete().length > 0) {\n <ul class=\"mb-none\">\n @for (item of itemsToDelete(); track item) {\n <li>{{ item }}</li>\n }\n </ul>\n }\n }\n @else {\n @if (customBodyTemplate()) {\n <ng-container [ngTemplateOutlet]=\"customBodyTemplate()\" [ngTemplateOutletContext]=\"customBodyContext()\">\n </ng-container>\n }\n }\n </div>\n }\n @else {\n <div class=\"modal-header justify-content-end\">\n <cw-button [label]=\"'_COMMON._ACTION.CLOSE' | translate\" [type]=\"buttonTypeEnum.light\" [withOnlyIcon]=\"true\"\n [withIcon]=\"spriteIcon.toolbarClose\" (btnAction)=\"closeModal()\" dataTest=\"btn-close-modal\"\n cssClass=\"btn-close\">\n </cw-button>\n </div>\n <div class=\"modal-body\">\n <cw-icon [label]=\"'Sucess'\" [iconSize]=\"iconSize['5xl']\" [icon]=\"spriteIcon.toolbarClose\" [type]=\"iconType.rounded\" [iconUiType]=\"iconUiType.success\"></cw-icon>\n\n <h1 class=\"modal-title\" id=\"modal-basic-title\">\n {{ modalTitle() | translate }}\n </h1>\n\n @if (customBodyTemplate()) {\n <ng-container [ngTemplateOutlet]=\"customBodyTemplate()\" [ngTemplateOutletContext]=\"customBodyContext()\">\n </ng-container>\n }\n </div>\n }\n\n <div class=\"modal-footer\">\n @if (type() === modalsType.delete) {\n <cw-button label=\"_COMMON._ACTION.DELETE\" [type]=\"buttonTypeEnum.danger\" [isMinWidth]=\"true\"\n (btnAction)=\"action1Click()\" dataTest=\"btn-action-modal\">\n </cw-button>\n\n <cw-button label=\"_COMMON._ACTION.CLOSE\" [type]=\"buttonTypeEnum.secondary\" [isMinWidth]=\"true\"\n (btnAction)=\"closeModal()\" dataTest=\"btn-close-modal\">\n </cw-button>\n }\n @else {\n @if (labelBtnAction1()) {\n <cw-button [label]=\"labelBtnAction1()\" [type]=\"buttonTypeEnum.primary\" [isMinWidth]=\"true\"\n (btnAction)=\"action1Click()\" dataTest=\"btn-action-modal\">\n </cw-button>\n }\n @if (labelBtnAction2()) {\n <cw-button [label]=\"labelBtnAction2()\" [type]=\"buttonTypeEnum.secondary\" [isMinWidth]=\"true\"\n (btnAction)=\"action2Click()\" dataTest=\"btn-action-modal\">\n </cw-button>\n }\n @else {\n <cw-button label=\"_COMMON._ACTION.CLOSE\" [type]=\"buttonTypeEnum.secondary\" [isMinWidth]=\"true\"\n (btnAction)=\"closeModal()\" dataTest=\"btn-close-modal\">\n </cw-button>\n }\n }\n </div>\n }\n @else {\n <div class=\"modal-body\">\n <cw-loader></cw-loader>\n </div>\n }\n\n </div>\n </div>\n</div>\n" }]
|
|
2240
2634
|
}], 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"] }] } });
|
|
@@ -2250,8 +2644,8 @@ class TabContentComponent {
|
|
|
2250
2644
|
get fragment() {
|
|
2251
2645
|
return UtilsHelper.slugify(this.title());
|
|
2252
2646
|
}
|
|
2253
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.
|
|
2254
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "20.3.
|
|
2647
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: TabContentComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2648
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "20.3.20", type: TabContentComponent, isStandalone: true, selector: "cw-tab-content", inputs: { title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: true, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, withIcon: { classPropertyName: "withIcon", publicName: "withIcon", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: `
|
|
2255
2649
|
<div class="tab-pane"
|
|
2256
2650
|
[class.fade]="!active"
|
|
2257
2651
|
[class.active]="active"
|
|
@@ -2264,7 +2658,7 @@ class TabContentComponent {
|
|
|
2264
2658
|
</div>
|
|
2265
2659
|
`, isInline: true }); }
|
|
2266
2660
|
}
|
|
2267
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.
|
|
2661
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: TabContentComponent, decorators: [{
|
|
2268
2662
|
type: Component,
|
|
2269
2663
|
args: [{
|
|
2270
2664
|
selector: 'cw-tab-content',
|
|
@@ -2404,10 +2798,10 @@ class TabComponent {
|
|
|
2404
2798
|
}
|
|
2405
2799
|
}
|
|
2406
2800
|
}
|
|
2407
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.
|
|
2408
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.
|
|
2801
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: TabComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2802
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.20", type: TabComponent, isStandalone: true, selector: "cw-tab", inputs: { type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: false, transformFunction: null }, id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null }, useFragment: { classPropertyName: "useFragment", publicName: "useFragment", isSignal: true, isRequired: false, transformFunction: null }, title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: false, transformFunction: null }, tabContentCssClass: { classPropertyName: "tabContentCssClass", publicName: "tabContentCssClass", isSignal: true, isRequired: false, transformFunction: null }, activeTabIndex: { classPropertyName: "activeTabIndex", publicName: "activeTabIndex", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { tabChanged: "tabChanged" }, 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" }] }); }
|
|
2409
2803
|
}
|
|
2410
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.
|
|
2804
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: TabComponent, decorators: [{
|
|
2411
2805
|
type: Component,
|
|
2412
2806
|
args: [{ selector: 'cw-tab', standalone: true, imports: [
|
|
2413
2807
|
CommonModule,
|
|
@@ -2422,10 +2816,10 @@ class WizardStepComponent {
|
|
|
2422
2816
|
this.completed = input(false, ...(ngDevMode ? [{ debugName: "completed" }] : []));
|
|
2423
2817
|
this.templateRef = viewChild.required('content');
|
|
2424
2818
|
}
|
|
2425
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.
|
|
2426
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "20.3.
|
|
2819
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: WizardStepComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2820
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "20.3.20", 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 }); }
|
|
2427
2821
|
}
|
|
2428
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.
|
|
2822
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: WizardStepComponent, decorators: [{
|
|
2429
2823
|
type: Component,
|
|
2430
2824
|
args: [{
|
|
2431
2825
|
selector: 'cw-wizard-step',
|
|
@@ -2483,10 +2877,10 @@ class WizardStepperComponent {
|
|
|
2483
2877
|
this.stepChange.emit(this.selectedIndex);
|
|
2484
2878
|
}
|
|
2485
2879
|
}
|
|
2486
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.
|
|
2487
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.
|
|
2880
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: WizardStepperComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2881
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.20", 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" }] }); }
|
|
2488
2882
|
}
|
|
2489
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.
|
|
2883
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: WizardStepperComponent, decorators: [{
|
|
2490
2884
|
type: Component,
|
|
2491
2885
|
args: [{ selector: 'cw-wizard-stepper', standalone: true, imports: [
|
|
2492
2886
|
CommonModule,
|
|
@@ -2500,10 +2894,10 @@ class StepperComponent {
|
|
|
2500
2894
|
this.steps = input([], ...(ngDevMode ? [{ debugName: "steps" }] : []));
|
|
2501
2895
|
this.label = input('Étapes de progression', ...(ngDevMode ? [{ debugName: "label" }] : []));
|
|
2502
2896
|
}
|
|
2503
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.
|
|
2504
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.
|
|
2897
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: StepperComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2898
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.20", 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" }] }); }
|
|
2505
2899
|
}
|
|
2506
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.
|
|
2900
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: StepperComponent, decorators: [{
|
|
2507
2901
|
type: Component,
|
|
2508
2902
|
args: [{ selector: 'cw-stepper', standalone: true, imports: [
|
|
2509
2903
|
CommonModule,
|
|
@@ -2526,10 +2920,10 @@ class FormatFileSizePipe {
|
|
|
2526
2920
|
const unit = units[power];
|
|
2527
2921
|
return `${formattedSize} ${unit}`;
|
|
2528
2922
|
}
|
|
2529
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.
|
|
2530
|
-
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "20.3.
|
|
2923
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: FormatFileSizePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
|
|
2924
|
+
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "20.3.20", ngImport: i0, type: FormatFileSizePipe, isStandalone: true, name: "formatFileSize" }); }
|
|
2531
2925
|
}
|
|
2532
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.
|
|
2926
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: FormatFileSizePipe, decorators: [{
|
|
2533
2927
|
type: Pipe,
|
|
2534
2928
|
args: [{ name: 'formatFileSize' }]
|
|
2535
2929
|
}] });
|
|
@@ -2542,10 +2936,10 @@ class FileToDownloadComponent {
|
|
|
2542
2936
|
this.spriteIcon = SpriteIconEnum.toolbarDownload;
|
|
2543
2937
|
this.attachments = input.required(...(ngDevMode ? [{ debugName: "attachments" }] : []));
|
|
2544
2938
|
}
|
|
2545
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.
|
|
2546
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.
|
|
2939
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: FileToDownloadComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2940
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.20", 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" }] }); }
|
|
2547
2941
|
}
|
|
2548
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.
|
|
2942
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: FileToDownloadComponent, decorators: [{
|
|
2549
2943
|
type: Component,
|
|
2550
2944
|
args: [{ selector: 'cw-file-to-download', imports: [NgTemplateOutlet, TranslatePipe, FormatFileSizePipe, IconComponent], template: "<!-- If one file -->\n@if (attachments().length === 1 ) {\n<ng-container *ngTemplateOutlet=\"file;context:{attachment:attachments()[0]}\"></ng-container>\n}\n\n<!-- If two files or more, li loop -->\n@if (attachments().length > 1) {\n<ul class=\"list-unstyled file-to-download-items\">\n @for (attachment of attachments(); track attachment) {\n <li class=\"file-to-download-list-item\">\n <ng-container *ngTemplateOutlet=\"file;context:{attachment:attachment}\"></ng-container>\n </li>\n }\n</ul>\n}\n\n<ng-template #file let-attachment=\"attachment\">\n <a [href]=\"attachment.url\" class=\"file-to-download-link\" target=\"_blank\">\n <span class=\"file-to-download-name\">\n {{ attachment.label ? attachment.label : ('_SHARED.ATTACHMENT_DEFAULT_LABEL' | translate ) }}\n </span>\n <span class=\"file-to-download-info\">\n @if (attachment.extension && attachment.size) {\n {{attachment.extension.toUpperCase()}} {{attachment.size * 1024 | formatFileSize}}\n }\n <cw-icon [icon]=\"spriteIcon\" font=\"optyweb\" [label]=\"'_COMMON.NEW_WINDOW' |translate\" [type]=\"iconType.default\"\n [iconSize]=\"iconSize['md']\" iconCssClass=\"file-to-download-download\"></cw-icon>\n </span>\n </a>\n</ng-template>\n" }]
|
|
2551
2945
|
}], propDecorators: { attachments: [{ type: i0.Input, args: [{ isSignal: true, alias: "attachments", required: true }] }] } });
|
|
@@ -2604,10 +2998,10 @@ class NumericalRangeComponent {
|
|
|
2604
2998
|
}
|
|
2605
2999
|
this.newAmount.emit(next);
|
|
2606
3000
|
}
|
|
2607
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.
|
|
2608
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.
|
|
3001
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: NumericalRangeComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
3002
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.20", 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"] }] }); }
|
|
2609
3003
|
}
|
|
2610
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.
|
|
3004
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: NumericalRangeComponent, decorators: [{
|
|
2611
3005
|
type: Component,
|
|
2612
3006
|
args: [{ selector: 'cw-numerical-range', imports: [NgClass, IconComponent, ButtonComponent], standalone: true, template: "<div class=\"numerical-range text-center\" [ngClass]=\"'numerical-range-' + type()\">\n\n @if (labelPosition() == labelPositionValue.outside && withLabelVisible()) {\n <div class=\"numerical-range-label\" aria-hidden=\"true\">\n @if (withIcon() && (type() == numericalRangeType.largeWhite || type() == numericalRangeType.largeGrey)) {\n <cw-icon [icon]=\"withIcon()\" [iconSize]=\"iconSize['lg']\"></cw-icon>\n }\n <span>{{ label() }}</span>\n </div>\n }\n\n <div class=\"numerical-range-container\">\n <cw-button [isDisabled]=\"isDisabled() || amount() <= floor()\" [label]=\"'Diminuer ' + amount() + ' ' + label()\"\n [withIcon]=\"spriteIcon.toolbarMinus\" [withOnlyIcon]=\"true\" [type]=\"buttonType.primary\"\n [iconSize]=\"buttonIconSize.small\" (btnAction)=\"decreaseAmount()\">\n </cw-button>\n\n <div class=\"numerical-range-wrapper\">\n <div class=\"numerical-range-amount\" aria-live=\"polite\" aria-atomic=\"true\">\n {{ amount() }}\n @if (!withLabelVisible() && !withIcon()) {\n <span class=\"sr-only\">{{ label() }}</span>\n }\n </div>\n\n @if ((type() !== numericalRangeType.largeGrey && type() !== numericalRangeType.largeWhite) && (withIcon() ||\n withLabelVisible())) {\n <div class=\"numerical-range-label\">\n @if (withLabelVisible() && labelPosition() == labelPositionValue.inside) {\n @if (withIcon()) {\n <cw-icon [icon]=\"withIcon()\" [iconSize]=\"iconSize['lg']\" aria-hidden=\"true\"></cw-icon>\n }\n <span>{{ label() }}</span>\n }\n @else {\n @if (withIcon()) {\n <cw-icon [icon]=\"withIcon()\" [label]=\"label()\" [iconSize]=\"iconSize['lg']\"></cw-icon>\n }\n }\n </div>\n }\n </div>\n\n <cw-button [isDisabled]=\"isDisabled() || amount() >= ceil()\" [label]=\"'Augmenter ' + amount() + ' ' + label()\"\n [withIcon]=\"spriteIcon.toolbarPlus\" [withOnlyIcon]=\"true\" [type]=\"buttonType.primary\"\n [iconSize]=\"buttonIconSize.small\" (btnAction)=\"increaseAmount()\">\n </cw-button>\n </div>\n</div>\n" }]
|
|
2613
3007
|
}], 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"] }] } });
|
|
@@ -2621,10 +3015,10 @@ class ImageComponent {
|
|
|
2621
3015
|
this.width = input('', ...(ngDevMode ? [{ debugName: "width" }] : []));
|
|
2622
3016
|
this.height = input('', ...(ngDevMode ? [{ debugName: "height" }] : []));
|
|
2623
3017
|
}
|
|
2624
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.
|
|
2625
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "20.3.
|
|
3018
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: ImageComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
3019
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "20.3.20", 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" }); }
|
|
2626
3020
|
}
|
|
2627
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.
|
|
3021
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: ImageComponent, decorators: [{
|
|
2628
3022
|
type: Component,
|
|
2629
3023
|
args: [{ selector: 'cw-image', standalone: true, template: "<img [src]=\"source()\" [attr.aria-hidden]=\"isAriaHidden() ? 'true' : null\" [class]=\"cssClass()\" [alt]=\"alt()\"\n [attr.width]=\"width() ? width() : null\" [attr.height]=\"height() ? height() : null\">\n" }]
|
|
2630
3024
|
}], 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 }] }] } });
|
|
@@ -2653,10 +3047,10 @@ class TitleComponent {
|
|
|
2653
3047
|
`${this.context()}-${this.tag()}`
|
|
2654
3048
|
].filter(Boolean).join(' '), ...(ngDevMode ? [{ debugName: "classes" }] : []));
|
|
2655
3049
|
}
|
|
2656
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.
|
|
2657
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.
|
|
3050
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: TitleComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
3051
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.20", type: TitleComponent, isStandalone: true, selector: "cw-title", inputs: { tag: { classPropertyName: "tag", publicName: "tag", isSignal: true, isRequired: false, transformFunction: null }, context: { classPropertyName: "context", publicName: "context", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "@switch (tag()) {\r\n @case ('h1') {\r\n <h1 [class]=\"classes()\">\r\n <ng-container *ngTemplateOutlet=\"content\" />\r\n </h1>\r\n }\r\n @case ('h2') {\r\n <h2 [class]=\"classes()\">\r\n <ng-container *ngTemplateOutlet=\"content\" />\r\n </h2>\r\n }\r\n @case ('h3') {\r\n <h3 [class]=\"classes()\">\r\n <ng-container *ngTemplateOutlet=\"content\" />\r\n </h3>\r\n }\r\n @case ('h4') {\r\n <h4 [class]=\"classes()\">\r\n <ng-container *ngTemplateOutlet=\"content\" />\r\n </h4>\r\n }\r\n}\r\n\r\n<ng-template #content>\r\n <ng-content />\r\n</ng-template>\r\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }] }); }
|
|
2658
3052
|
}
|
|
2659
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.
|
|
3053
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: TitleComponent, decorators: [{
|
|
2660
3054
|
type: Component,
|
|
2661
3055
|
args: [{ selector: 'cw-title', standalone: true, imports: [
|
|
2662
3056
|
CommonModule
|
|
@@ -2667,10 +3061,10 @@ class SkipLinksComponent {
|
|
|
2667
3061
|
constructor() {
|
|
2668
3062
|
this.links = input([], ...(ngDevMode ? [{ debugName: "links" }] : []));
|
|
2669
3063
|
}
|
|
2670
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.
|
|
2671
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.
|
|
3064
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: SkipLinksComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
3065
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.20", type: SkipLinksComponent, isStandalone: true, selector: "cw-skiplinks", inputs: { links: { classPropertyName: "links", publicName: "links", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<ul class=\"skip-links d-flex-h mb-0\">\r\n @for (link of links(); track link.id) {\r\n <li class=\"list-inline-item\">\r\n <a [href]=\"'#' + link.id\">{{ link.label }}</a>\r\n </li>\r\n }\r\n</ul>\r\n", dependencies: [{ kind: "ngmodule", type: CommonModule }] }); }
|
|
2672
3066
|
}
|
|
2673
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.
|
|
3067
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: SkipLinksComponent, decorators: [{
|
|
2674
3068
|
type: Component,
|
|
2675
3069
|
args: [{ selector: 'cw-skiplinks', standalone: true, imports: [CommonModule], template: "<ul class=\"skip-links d-flex-h mb-0\">\r\n @for (link of links(); track link.id) {\r\n <li class=\"list-inline-item\">\r\n <a [href]=\"'#' + link.id\">{{ link.label }}</a>\r\n </li>\r\n }\r\n</ul>\r\n" }]
|
|
2676
3070
|
}], propDecorators: { links: [{ type: i0.Input, args: [{ isSignal: true, alias: "links", required: false }] }] } });
|
|
@@ -2679,10 +3073,10 @@ class RequiredInfoComponent {
|
|
|
2679
3073
|
constructor() {
|
|
2680
3074
|
this.allFieldsRequired = input(false, ...(ngDevMode ? [{ debugName: "allFieldsRequired" }] : []));
|
|
2681
3075
|
}
|
|
2682
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.
|
|
2683
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.
|
|
3076
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: RequiredInfoComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
3077
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.20", type: RequiredInfoComponent, isStandalone: true, selector: "cw-required-info", inputs: { allFieldsRequired: { classPropertyName: "allFieldsRequired", publicName: "allFieldsRequired", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<p class=\"field-required text-end\">\r\n @if (allFieldsRequired()) {\r\n Tous les champs sont obligatoires.\r\n }\r\n @else {\r\n <span class=\"text-danger\">*</span> champs obligatoires\r\n }\r\n</p>\r\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: TranslateModule }] }); }
|
|
2684
3078
|
}
|
|
2685
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.
|
|
3079
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: RequiredInfoComponent, decorators: [{
|
|
2686
3080
|
type: Component,
|
|
2687
3081
|
args: [{ selector: 'cw-required-info', standalone: true, imports: [
|
|
2688
3082
|
CommonModule,
|
|
@@ -2707,5 +3101,5 @@ var PlacementEnum;
|
|
|
2707
3101
|
* Generated bundle index. Do not edit.
|
|
2708
3102
|
*/
|
|
2709
3103
|
|
|
2710
|
-
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 };
|
|
3104
|
+
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 };
|
|
2711
3105
|
//# sourceMappingURL=cityway-basic-ui.mjs.map
|