@cityway/basic-ui 1.0.2-beta016 → 1.0.2-beta018
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cityway-basic-ui-1.0.2-beta018.tgz +0 -0
- package/fesm2022/cityway-basic-ui.mjs +321 -451
- package/fesm2022/cityway-basic-ui.mjs.map +1 -1
- package/index.d.ts +239 -186
- package/lib/assets/icons/sprite.ids.txt +47 -0
- package/lib/assets/icons/sprite.preview.html +473 -3
- package/lib/assets/icons/sprite.svg +141 -0
- package/lib/assets/styles/scss/components/_card.scss +20 -4
- package/lib/assets/styles/scss/components/button/_button.scss +2 -0
- package/lib/assets/styles/scss/components/form-field/_form-field.scss +7 -5
- package/lib/assets/styles/scss/components/form-field/_ng-select.scss +9 -0
- 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-beta016.tgz +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as i1 from '@angular/common';
|
|
2
2
|
import { CommonModule, NgClass, NgTemplateOutlet } from '@angular/common';
|
|
3
3
|
import * as i0 from '@angular/core';
|
|
4
|
-
import { inject, ElementRef, signal, EventEmitter, effect, Output, Input, Directive, HostBinding, Component,
|
|
4
|
+
import { inject, ElementRef, signal, EventEmitter, effect, Output, Input, Directive, input, HostBinding, Component, ChangeDetectorRef, model, output, viewChild, contentChildren, Injectable, NgZone, HostListener, Renderer2, ViewChild, TemplateRef, ContentChild, ApplicationRef, Injector, createComponent, viewChildren, Pipe, computed } from '@angular/core';
|
|
5
5
|
import * as i2 from '@ngx-translate/core';
|
|
6
6
|
import { TranslateModule, TranslatePipe, TranslateService } from '@ngx-translate/core';
|
|
7
7
|
import { BehaviorSubject, fromEvent } from 'rxjs';
|
|
@@ -12,7 +12,7 @@ import * as i2$1 from '@angular/forms';
|
|
|
12
12
|
import { FormGroup, FormsModule, ReactiveFormsModule } from '@angular/forms';
|
|
13
13
|
import * as i3 from '@ng-select/ng-select';
|
|
14
14
|
import { NgSelectModule } from '@ng-select/ng-select';
|
|
15
|
-
import
|
|
15
|
+
import { Router, ActivatedRoute } from '@angular/router';
|
|
16
16
|
|
|
17
17
|
class CollapseDirective {
|
|
18
18
|
set cwCollapse(value) {
|
|
@@ -126,24 +126,36 @@ var SpriteIconEnum;
|
|
|
126
126
|
SpriteIconEnum["accountHelp"] = "accountHelp";
|
|
127
127
|
SpriteIconEnum["accountLogout"] = "accountLogout";
|
|
128
128
|
SpriteIconEnum["accountServices"] = "accountServices";
|
|
129
|
+
SpriteIconEnum["add"] = "add";
|
|
129
130
|
SpriteIconEnum["addBag"] = "addBag";
|
|
130
131
|
SpriteIconEnum["addCard"] = "addCard";
|
|
131
132
|
SpriteIconEnum["addPassenger"] = "addPassenger";
|
|
133
|
+
SpriteIconEnum["ai"] = "ai";
|
|
132
134
|
SpriteIconEnum["airQuality"] = "airQuality";
|
|
135
|
+
SpriteIconEnum["alertCircle"] = "alertCircle";
|
|
133
136
|
SpriteIconEnum["alertHelp"] = "alertHelp";
|
|
134
137
|
SpriteIconEnum["alertHelp1"] = "alertHelp1";
|
|
135
138
|
SpriteIconEnum["alertWarning"] = "alertWarning";
|
|
136
139
|
SpriteIconEnum["americanExpress"] = "americanExpress";
|
|
140
|
+
SpriteIconEnum["analyticsBars"] = "analyticsBars";
|
|
141
|
+
SpriteIconEnum["autoMode"] = "autoMode";
|
|
137
142
|
SpriteIconEnum["baby"] = "baby";
|
|
138
143
|
SpriteIconEnum["bad"] = "bad";
|
|
144
|
+
SpriteIconEnum["basket"] = "basket";
|
|
139
145
|
SpriteIconEnum["bmp"] = "bmp";
|
|
140
146
|
SpriteIconEnum["boardingForbidden"] = "boardingForbidden";
|
|
141
147
|
SpriteIconEnum["boardingOnly"] = "boardingOnly";
|
|
142
148
|
SpriteIconEnum["border"] = "border";
|
|
149
|
+
SpriteIconEnum["bus"] = "bus";
|
|
150
|
+
SpriteIconEnum["calendar1"] = "calendar1";
|
|
143
151
|
SpriteIconEnum["card"] = "card";
|
|
144
152
|
SpriteIconEnum["carPlate"] = "carPlate";
|
|
145
153
|
SpriteIconEnum["cash"] = "cash";
|
|
146
154
|
SpriteIconEnum["chat"] = "chat";
|
|
155
|
+
SpriteIconEnum["check"] = "check";
|
|
156
|
+
SpriteIconEnum["checkCircle"] = "checkCircle";
|
|
157
|
+
SpriteIconEnum["close"] = "close";
|
|
158
|
+
SpriteIconEnum["closeCircle"] = "closeCircle";
|
|
147
159
|
SpriteIconEnum["codes"] = "codes";
|
|
148
160
|
SpriteIconEnum["computer"] = "computer";
|
|
149
161
|
SpriteIconEnum["copyright"] = "copyright";
|
|
@@ -165,6 +177,7 @@ var SpriteIconEnum;
|
|
|
165
177
|
SpriteIconEnum["crowdsourcingValidate"] = "crowdsourcingValidate";
|
|
166
178
|
SpriteIconEnum["crowdsourcingVehicle"] = "crowdsourcingVehicle";
|
|
167
179
|
SpriteIconEnum["crowdsourcingWork"] = "crowdsourcingWork";
|
|
180
|
+
SpriteIconEnum["darkMode"] = "darkMode";
|
|
168
181
|
SpriteIconEnum["dataProtection"] = "dataProtection";
|
|
169
182
|
SpriteIconEnum["diamond"] = "diamond";
|
|
170
183
|
SpriteIconEnum["doc"] = "doc";
|
|
@@ -172,6 +185,8 @@ var SpriteIconEnum;
|
|
|
172
185
|
SpriteIconEnum["driver"] = "driver";
|
|
173
186
|
SpriteIconEnum["dropOffForbidden"] = "dropOffForbidden";
|
|
174
187
|
SpriteIconEnum["dropOffOnly"] = "dropOffOnly";
|
|
188
|
+
SpriteIconEnum["duplicate"] = "duplicate";
|
|
189
|
+
SpriteIconEnum["edit"] = "edit";
|
|
175
190
|
SpriteIconEnum["error"] = "error";
|
|
176
191
|
SpriteIconEnum["errorCard"] = "errorCard";
|
|
177
192
|
SpriteIconEnum["eshop"] = "eshop";
|
|
@@ -212,23 +227,35 @@ var SpriteIconEnum;
|
|
|
212
227
|
SpriteIconEnum["file"] = "file";
|
|
213
228
|
SpriteIconEnum["free"] = "free";
|
|
214
229
|
SpriteIconEnum["from"] = "from";
|
|
230
|
+
SpriteIconEnum["gauge"] = "gauge";
|
|
215
231
|
SpriteIconEnum["gif"] = "gif";
|
|
216
232
|
SpriteIconEnum["good"] = "good";
|
|
233
|
+
SpriteIconEnum["graphStatsAscend"] = "graphStatsAscend";
|
|
234
|
+
SpriteIconEnum["graphStatsDescend"] = "graphStatsDescend";
|
|
235
|
+
SpriteIconEnum["grip"] = "grip";
|
|
217
236
|
SpriteIconEnum["handCard"] = "handCard";
|
|
218
237
|
SpriteIconEnum["headphone"] = "headphone";
|
|
238
|
+
SpriteIconEnum["helpCircle"] = "helpCircle";
|
|
219
239
|
SpriteIconEnum["home"] = "home";
|
|
220
240
|
SpriteIconEnum["homeLine"] = "homeLine";
|
|
221
241
|
SpriteIconEnum["hotline"] = "hotline";
|
|
222
242
|
SpriteIconEnum["info"] = "info";
|
|
243
|
+
SpriteIconEnum["infoCircle"] = "infoCircle";
|
|
223
244
|
SpriteIconEnum["interactiveMap"] = "interactiveMap";
|
|
224
245
|
SpriteIconEnum["interactiveMapLine"] = "interactiveMapLine";
|
|
225
246
|
SpriteIconEnum["invert"] = "invert";
|
|
226
247
|
SpriteIconEnum["journey"] = "journey";
|
|
227
248
|
SpriteIconEnum["jpg"] = "jpg";
|
|
228
249
|
SpriteIconEnum["kcal"] = "kcal";
|
|
250
|
+
SpriteIconEnum["keyboardDown"] = "keyboardDown";
|
|
251
|
+
SpriteIconEnum["keyboardUp"] = "keyboardUp";
|
|
252
|
+
SpriteIconEnum["keyboardUpDown"] = "keyboardUpDown";
|
|
253
|
+
SpriteIconEnum["language"] = "language";
|
|
229
254
|
SpriteIconEnum["law"] = "law";
|
|
255
|
+
SpriteIconEnum["layout"] = "layout";
|
|
230
256
|
SpriteIconEnum["left"] = "left";
|
|
231
257
|
SpriteIconEnum["left1"] = "left1";
|
|
258
|
+
SpriteIconEnum["lightMode"] = "lightMode";
|
|
232
259
|
SpriteIconEnum["loading"] = "loading";
|
|
233
260
|
SpriteIconEnum["mailAlternate"] = "mailAlternate";
|
|
234
261
|
SpriteIconEnum["mapCenterMap"] = "mapCenterMap";
|
|
@@ -258,7 +285,9 @@ var SpriteIconEnum;
|
|
|
258
285
|
SpriteIconEnum["medium"] = "medium";
|
|
259
286
|
SpriteIconEnum["meeting"] = "meeting";
|
|
260
287
|
SpriteIconEnum["menu"] = "menu";
|
|
288
|
+
SpriteIconEnum["menuHorizontal"] = "menuHorizontal";
|
|
261
289
|
SpriteIconEnum["menuLine"] = "menuLine";
|
|
290
|
+
SpriteIconEnum["menuVertical"] = "menuVertical";
|
|
262
291
|
SpriteIconEnum["message"] = "message";
|
|
263
292
|
SpriteIconEnum["messageActivateAccount"] = "messageActivateAccount";
|
|
264
293
|
SpriteIconEnum["messageAlert"] = "messageAlert";
|
|
@@ -335,6 +364,9 @@ var SpriteIconEnum;
|
|
|
335
364
|
SpriteIconEnum["moveForward"] = "moveForward";
|
|
336
365
|
SpriteIconEnum["music"] = "music";
|
|
337
366
|
SpriteIconEnum["navDashboard"] = "navDashboard";
|
|
367
|
+
SpriteIconEnum["navDoubleLeft"] = "navDoubleLeft";
|
|
368
|
+
SpriteIconEnum["navDoubleRight"] = "navDoubleRight";
|
|
369
|
+
SpriteIconEnum["navDown"] = "navDown";
|
|
338
370
|
SpriteIconEnum["navFirst"] = "navFirst";
|
|
339
371
|
SpriteIconEnum["navigationApple"] = "navigationApple";
|
|
340
372
|
SpriteIconEnum["navigationFacebook"] = "navigationFacebook";
|
|
@@ -348,7 +380,10 @@ var SpriteIconEnum;
|
|
|
348
380
|
SpriteIconEnum["navigationWhatsapp"] = "navigationWhatsapp";
|
|
349
381
|
SpriteIconEnum["navigationYoutube"] = "navigationYoutube";
|
|
350
382
|
SpriteIconEnum["navLast"] = "navLast";
|
|
383
|
+
SpriteIconEnum["navLeft"] = "navLeft";
|
|
351
384
|
SpriteIconEnum["navMediaPause"] = "navMediaPause";
|
|
385
|
+
SpriteIconEnum["navRight"] = "navRight";
|
|
386
|
+
SpriteIconEnum["navUp"] = "navUp";
|
|
352
387
|
SpriteIconEnum["newWindow"] = "newWindow";
|
|
353
388
|
SpriteIconEnum["nextLeft"] = "nextLeft";
|
|
354
389
|
SpriteIconEnum["nextRight"] = "nextRight";
|
|
@@ -366,6 +401,8 @@ var SpriteIconEnum;
|
|
|
366
401
|
SpriteIconEnum["pet"] = "pet";
|
|
367
402
|
SpriteIconEnum["phone"] = "phone";
|
|
368
403
|
SpriteIconEnum["phoneCard"] = "phoneCard";
|
|
404
|
+
SpriteIconEnum["phoneHand"] = "phoneHand";
|
|
405
|
+
SpriteIconEnum["pin"] = "pin";
|
|
369
406
|
SpriteIconEnum["pinArrival"] = "pinArrival";
|
|
370
407
|
SpriteIconEnum["placeholder"] = "placeholder";
|
|
371
408
|
SpriteIconEnum["plan"] = "plan";
|
|
@@ -458,7 +495,9 @@ var SpriteIconEnum;
|
|
|
458
495
|
SpriteIconEnum["qrcode"] = "qrcode";
|
|
459
496
|
SpriteIconEnum["rar"] = "rar";
|
|
460
497
|
SpriteIconEnum["realtime"] = "realtime";
|
|
498
|
+
SpriteIconEnum["realTime"] = "realTime";
|
|
461
499
|
SpriteIconEnum["recentTrip"] = "recentTrip";
|
|
500
|
+
SpriteIconEnum["refresh"] = "refresh";
|
|
462
501
|
SpriteIconEnum["reloadCard"] = "reloadCard";
|
|
463
502
|
SpriteIconEnum["returnTrip"] = "returnTrip";
|
|
464
503
|
SpriteIconEnum["right"] = "right";
|
|
@@ -468,7 +507,9 @@ var SpriteIconEnum;
|
|
|
468
507
|
SpriteIconEnum["roundFull"] = "roundFull";
|
|
469
508
|
SpriteIconEnum["schedules"] = "schedules";
|
|
470
509
|
SpriteIconEnum["schedulesLine"] = "schedulesLine";
|
|
510
|
+
SpriteIconEnum["search"] = "search";
|
|
471
511
|
SpriteIconEnum["secure"] = "secure";
|
|
512
|
+
SpriteIconEnum["settings"] = "settings";
|
|
472
513
|
SpriteIconEnum["settingsFast"] = "settingsFast";
|
|
473
514
|
SpriteIconEnum["shop"] = "shop";
|
|
474
515
|
SpriteIconEnum["shopLine"] = "shopLine";
|
|
@@ -499,6 +540,7 @@ var SpriteIconEnum;
|
|
|
499
540
|
SpriteIconEnum["stamp"] = "stamp";
|
|
500
541
|
SpriteIconEnum["star"] = "star";
|
|
501
542
|
SpriteIconEnum["straight"] = "straight";
|
|
543
|
+
SpriteIconEnum["subtract"] = "subtract";
|
|
502
544
|
SpriteIconEnum["talk"] = "talk";
|
|
503
545
|
SpriteIconEnum["tarifProfileDollar"] = "tarifProfileDollar";
|
|
504
546
|
SpriteIconEnum["tarifProfileEuro"] = "tarifProfileEuro";
|
|
@@ -551,6 +593,7 @@ var SpriteIconEnum;
|
|
|
551
593
|
SpriteIconEnum["toolbarUpload"] = "toolbarUpload";
|
|
552
594
|
SpriteIconEnum["toolbarUser"] = "toolbarUser";
|
|
553
595
|
SpriteIconEnum["traffic"] = "traffic";
|
|
596
|
+
SpriteIconEnum["trash"] = "trash";
|
|
554
597
|
SpriteIconEnum["tripPlanner"] = "tripPlanner";
|
|
555
598
|
SpriteIconEnum["tripPlannerLine"] = "tripPlannerLine";
|
|
556
599
|
SpriteIconEnum["turnCompletelyLeft"] = "turnCompletelyLeft";
|
|
@@ -568,58 +611,48 @@ var SpriteIconEnum;
|
|
|
568
611
|
SpriteIconEnum["userConnected"] = "userConnected";
|
|
569
612
|
SpriteIconEnum["userConnectedLine"] = "userConnectedLine";
|
|
570
613
|
SpriteIconEnum["userLine"] = "userLine";
|
|
614
|
+
SpriteIconEnum["users"] = "users";
|
|
571
615
|
SpriteIconEnum["userTicket"] = "userTicket";
|
|
572
616
|
SpriteIconEnum["vector"] = "vector";
|
|
573
617
|
SpriteIconEnum["via"] = "via";
|
|
618
|
+
SpriteIconEnum["view"] = "view";
|
|
619
|
+
SpriteIconEnum["viewOff"] = "viewOff";
|
|
574
620
|
SpriteIconEnum["wagon"] = "wagon";
|
|
575
621
|
SpriteIconEnum["wagonHead"] = "wagonHead";
|
|
576
622
|
SpriteIconEnum["wallet"] = "wallet";
|
|
577
623
|
SpriteIconEnum["walletLine"] = "walletLine";
|
|
578
624
|
SpriteIconEnum["watts"] = "watts";
|
|
579
625
|
SpriteIconEnum["wifi"] = "wifi";
|
|
626
|
+
SpriteIconEnum["wrench"] = "wrench";
|
|
580
627
|
SpriteIconEnum["xls"] = "xls";
|
|
581
628
|
SpriteIconEnum["zip"] = "zip";
|
|
582
629
|
})(SpriteIconEnum || (SpriteIconEnum = {}));
|
|
583
630
|
|
|
584
631
|
class IconComponent {
|
|
585
632
|
constructor() {
|
|
586
|
-
this.icon = SpriteIconEnum.alertHelp;
|
|
587
|
-
this.
|
|
588
|
-
this.
|
|
589
|
-
this.
|
|
590
|
-
this.
|
|
591
|
-
this.
|
|
633
|
+
this.icon = input(SpriteIconEnum.alertHelp, ...(ngDevMode ? [{ debugName: "icon" }] : []));
|
|
634
|
+
this.label = input(...(ngDevMode ? [undefined, { debugName: "label" }] : []));
|
|
635
|
+
this.type = input(IconTypeEnum.default, ...(ngDevMode ? [{ debugName: "type" }] : []));
|
|
636
|
+
this.iconSize = input(IconSizeEnum['sm'], ...(ngDevMode ? [{ debugName: "iconSize" }] : []));
|
|
637
|
+
this.iconCssClass = input('', ...(ngDevMode ? [{ debugName: "iconCssClass" }] : []));
|
|
638
|
+
this.iconUiType = input(IconUiTypeEnum.default, ...(ngDevMode ? [{ debugName: "iconUiType" }] : []));
|
|
639
|
+
this.iconColorCustom = input(...(ngDevMode ? [undefined, { debugName: "iconColorCustom" }] : []));
|
|
640
|
+
this.spritePath = input('/assets/icons/sprite.svg', ...(ngDevMode ? [{ debugName: "spritePath" }] : []));
|
|
592
641
|
this.iconTypeEnum = IconTypeEnum;
|
|
593
642
|
}
|
|
594
643
|
get hostClasses() {
|
|
595
|
-
if (this.type === IconTypeEnum.rounded) {
|
|
596
|
-
return `icon-rounded icon-rounded-${this.iconSize} icon-rounded-${this.iconUiType}`;
|
|
644
|
+
if (this.type() === IconTypeEnum.rounded) {
|
|
645
|
+
return `icon-rounded icon-rounded-${this.iconSize()} icon-rounded-${this.iconUiType()}`;
|
|
597
646
|
}
|
|
598
|
-
return `icon icon-${this.iconSize}`;
|
|
647
|
+
return `icon icon-${this.iconSize()}`;
|
|
599
648
|
}
|
|
600
649
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.19", ngImport: i0, type: IconComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
601
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.19", type: IconComponent, isStandalone: true, selector: "cw-icon", inputs: { icon: "icon", label: "label", type: "type", iconSize: "iconSize", iconCssClass: "iconCssClass", iconUiType: "iconUiType", iconColorCustom: "iconColorCustom", spritePath: "spritePath" }, host: { properties: { "class": "this.hostClasses" } }, ngImport: i0, template: "@if (type == iconTypeEnum.rounded) {\
|
|
650
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.19", type: IconComponent, isStandalone: true, selector: "cw-icon", inputs: { icon: { classPropertyName: "icon", publicName: "icon", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: false, transformFunction: null }, iconSize: { classPropertyName: "iconSize", publicName: "iconSize", isSignal: true, isRequired: false, transformFunction: null }, iconCssClass: { classPropertyName: "iconCssClass", publicName: "iconCssClass", isSignal: true, isRequired: false, transformFunction: null }, iconUiType: { classPropertyName: "iconUiType", publicName: "iconUiType", isSignal: true, isRequired: false, transformFunction: null }, iconColorCustom: { classPropertyName: "iconColorCustom", publicName: "iconColorCustom", isSignal: true, isRequired: false, transformFunction: null }, spritePath: { classPropertyName: "spritePath", publicName: "spritePath", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "this.hostClasses" } }, ngImport: i0, template: "@if (type() == iconTypeEnum.rounded) {\n <span class=\"icon\">\n <ng-container *ngTemplateOutlet=\"iconContent\"></ng-container>\n </span>\n} @else {\n <ng-container *ngTemplateOutlet=\"iconContent\"></ng-container>\n}\n\n<ng-template #iconContent>\n <svg class=\"icon-svg\" [ngClass]=\"iconCssClass()\" aria-hidden=\"true\"\n [attr.style]=\"iconColorCustom() ? 'color: ' + iconColorCustom() : null\">\n <use [attr.href]=\"spritePath() + '#' + icon()\" />\n </svg>\n @if (label()) {\n <span class=\"visually-hidden\">{{ label() }}</span>\n }\n</ng-template>\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }] }); }
|
|
602
651
|
}
|
|
603
652
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.19", ngImport: i0, type: IconComponent, decorators: [{
|
|
604
653
|
type: Component,
|
|
605
|
-
args: [{ selector: 'cw-icon', standalone: true, imports: [CommonModule], template: "@if (type == iconTypeEnum.rounded) {\
|
|
606
|
-
}], propDecorators: { icon: [{
|
|
607
|
-
type: Input
|
|
608
|
-
}], label: [{
|
|
609
|
-
type: Input
|
|
610
|
-
}], type: [{
|
|
611
|
-
type: Input
|
|
612
|
-
}], iconSize: [{
|
|
613
|
-
type: Input
|
|
614
|
-
}], iconCssClass: [{
|
|
615
|
-
type: Input
|
|
616
|
-
}], iconUiType: [{
|
|
617
|
-
type: Input
|
|
618
|
-
}], iconColorCustom: [{
|
|
619
|
-
type: Input
|
|
620
|
-
}], spritePath: [{
|
|
621
|
-
type: Input
|
|
622
|
-
}], hostClasses: [{
|
|
654
|
+
args: [{ selector: 'cw-icon', standalone: true, imports: [CommonModule], template: "@if (type() == iconTypeEnum.rounded) {\n <span class=\"icon\">\n <ng-container *ngTemplateOutlet=\"iconContent\"></ng-container>\n </span>\n} @else {\n <ng-container *ngTemplateOutlet=\"iconContent\"></ng-container>\n}\n\n<ng-template #iconContent>\n <svg class=\"icon-svg\" [ngClass]=\"iconCssClass()\" aria-hidden=\"true\"\n [attr.style]=\"iconColorCustom() ? 'color: ' + iconColorCustom() : null\">\n <use [attr.href]=\"spritePath() + '#' + icon()\" />\n </svg>\n @if (label()) {\n <span class=\"visually-hidden\">{{ label() }}</span>\n }\n</ng-template>\n" }]
|
|
655
|
+
}], propDecorators: { icon: [{ type: i0.Input, args: [{ isSignal: true, alias: "icon", required: false }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], type: [{ type: i0.Input, args: [{ isSignal: true, alias: "type", required: false }] }], iconSize: [{ type: i0.Input, args: [{ isSignal: true, alias: "iconSize", required: false }] }], iconCssClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "iconCssClass", required: false }] }], iconUiType: [{ type: i0.Input, args: [{ isSignal: true, alias: "iconUiType", required: false }] }], iconColorCustom: [{ type: i0.Input, args: [{ isSignal: true, alias: "iconColorCustom", required: false }] }], spritePath: [{ type: i0.Input, args: [{ isSignal: true, alias: "spritePath", required: false }] }], hostClasses: [{
|
|
623
656
|
type: HostBinding,
|
|
624
657
|
args: ['class']
|
|
625
658
|
}] } });
|
|
@@ -636,15 +669,18 @@ var CardTitleRankEnum;
|
|
|
636
669
|
})(CardTitleRankEnum || (CardTitleRankEnum = {}));
|
|
637
670
|
|
|
638
671
|
class CardComponent {
|
|
639
|
-
constructor(
|
|
640
|
-
this.cdRef =
|
|
641
|
-
this.
|
|
642
|
-
this.
|
|
643
|
-
this.
|
|
644
|
-
this.
|
|
645
|
-
this.
|
|
646
|
-
this.
|
|
647
|
-
this.
|
|
672
|
+
constructor() {
|
|
673
|
+
this.cdRef = inject(ChangeDetectorRef);
|
|
674
|
+
this.title = input(...(ngDevMode ? [undefined, { debugName: "title" }] : []));
|
|
675
|
+
this.type = input(CardTypeEnum.default, ...(ngDevMode ? [{ debugName: "type" }] : []));
|
|
676
|
+
this.titleRank = input(CardTitleRankEnum.h2, ...(ngDevMode ? [{ debugName: "titleRank" }] : []));
|
|
677
|
+
this.collapsible = model(false, ...(ngDevMode ? [{ debugName: "collapsible" }] : []));
|
|
678
|
+
this.collapsed = input(false, ...(ngDevMode ? [{ debugName: "collapsed" }] : []));
|
|
679
|
+
this.collapseId = input(`collapse-${Math.random().toString(36).substring(2, 11)}`, ...(ngDevMode ? [{ debugName: "collapseId" }] : []));
|
|
680
|
+
this.destroyOnHide = model(true, ...(ngDevMode ? [{ debugName: "destroyOnHide" }] : []));
|
|
681
|
+
this.collapseClicked = output();
|
|
682
|
+
this.collapseDirective = viewChild('collapse', ...(ngDevMode ? [{ debugName: "collapseDirective" }] : []));
|
|
683
|
+
this.cardFooter = viewChild('cardFooter', ...(ngDevMode ? [{ debugName: "cardFooter" }] : []));
|
|
648
684
|
this.showFooter = true;
|
|
649
685
|
this.titleRankEnum = CardTitleRankEnum;
|
|
650
686
|
this.typeEnum = CardTypeEnum;
|
|
@@ -654,17 +690,18 @@ class CardComponent {
|
|
|
654
690
|
this.spriteIcon = SpriteIconEnum;
|
|
655
691
|
}
|
|
656
692
|
ngOnInit() {
|
|
657
|
-
this.isCollapsed.set(this.collapsed);
|
|
658
|
-
if (this.destroyOnHide && this.collapsed) {
|
|
693
|
+
this.isCollapsed.set(this.collapsed());
|
|
694
|
+
if (this.destroyOnHide() && this.collapsed()) {
|
|
659
695
|
this.shouldRenderBody.set(false);
|
|
660
696
|
}
|
|
661
697
|
}
|
|
662
698
|
ngAfterViewInit() {
|
|
663
|
-
|
|
699
|
+
const el = this.cardFooter()?.nativeElement;
|
|
700
|
+
this.showFooter = !!el && el.children.length > 0;
|
|
664
701
|
this.cdRef.detectChanges();
|
|
665
702
|
}
|
|
666
703
|
toggleCollapse() {
|
|
667
|
-
if (this.collapsible) {
|
|
704
|
+
if (this.collapsible()) {
|
|
668
705
|
const newCollapsedState = !this.isCollapsed();
|
|
669
706
|
this.updateCollapseState(newCollapsedState);
|
|
670
707
|
}
|
|
@@ -676,13 +713,13 @@ class CardComponent {
|
|
|
676
713
|
this.updateCollapseState(false);
|
|
677
714
|
}
|
|
678
715
|
updateCollapseState(collapsed) {
|
|
679
|
-
if (!collapsed && this.destroyOnHide && !this.shouldRenderBody()) {
|
|
716
|
+
if (!collapsed && this.destroyOnHide() && !this.shouldRenderBody()) {
|
|
680
717
|
this.shouldRenderBody.set(true);
|
|
681
718
|
this.cdRef.detectChanges();
|
|
682
719
|
}
|
|
683
720
|
this.isCollapsed.set(collapsed);
|
|
684
721
|
this.collapseClicked.emit(collapsed);
|
|
685
|
-
if (collapsed && this.destroyOnHide) {
|
|
722
|
+
if (collapsed && this.destroyOnHide()) {
|
|
686
723
|
setTimeout(() => {
|
|
687
724
|
if (this.isCollapsed()) {
|
|
688
725
|
this.shouldRenderBody.set(false);
|
|
@@ -694,8 +731,8 @@ class CardComponent {
|
|
|
694
731
|
get collapsed_state() {
|
|
695
732
|
return this.isCollapsed();
|
|
696
733
|
}
|
|
697
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.19", ngImport: i0, type: CardComponent, deps: [
|
|
698
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.19", type: CardComponent, isStandalone: true, selector: "cw-card", inputs: { title: "title", type: "type", titleRank: "titleRank", collapsible: "collapsible", collapsed: "collapsed", collapseId: "collapseId", destroyOnHide: "destroyOnHide" }, outputs: { collapseClicked: "collapseClicked" }, viewQueries: [{ propertyName: "collapseDirective", first: true, predicate: ["collapse"], descendants: true }, { propertyName: "cardFooter", first: true, predicate: ["cardFooter"], descendants: true }], ngImport: i0, template: "<div class=\"card\" [class.card-collapse]=\"collapsible\" [class.card-light]=\"type == typeEnum.light\">\n @if (title) {\n <div class=\"card-header\" [class.card-header-collapse]=\"collapsible\"\n [class.card-header-collapsed]=\"collapsible && isCollapsed()\">\n <ng-container *ngTemplateOutlet=\"header\"></ng-container>\n </div>\n }\n\n @if(collapsible) {\n <div [cwCollapse]=\"isCollapsed()\" [id]=\"collapseId\" #collapse=\"cwCollapse\">\n <ng-container *ngTemplateOutlet=\"content\"></ng-container>\n </div>\n }\n @else {\n <ng-container *ngTemplateOutlet=\"content\"></ng-container>\n }\n</div>\n\n<ng-template #header>\n @if (titleRank == titleRankEnum.h2) {\n <h2>{{title}}</h2>\n }\n @else if (titleRank == titleRankEnum.h3) {\n <h3>{{title}}</h3>\n }\n\n <div class=\"card-header-custom-area\">\n <ng-content select=\"[header-custom-area]\"></ng-content>\n </div>\n\n @if (collapsible) {\n <button type=\"button\" class=\"btn btn-collapse stretched-link\" (click)=\"toggleCollapse()\"\n [attr.aria-expanded]=\"!isCollapsed()\" [class.collapsed]=\"isCollapsed()\" [attr.aria-controls]=\"collapseId\">\n <cw-icon [icon]=\"spriteIcon.down\" label=\"D\u00E9plier/Plier\" [iconSize]=\"iconSize['xs']\"></cw-icon>\n <!-- // TODO trad -->\n </button>\n }\n</ng-template>\n\n<ng-template #content>\n @if (shouldRenderBody()) {\n <div class=\"card-body\">\n <ng-content></ng-content>\n </div>\n\n @if (showFooter) {\n <div class=\"card-footer\" #cardFooter>\n <ng-content select=\"[card-footer]\"></ng-content>\n </div>\n }\n }\n</ng-template>\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: CollapseDirective, selector: "[cwCollapse]", inputs: ["cwCollapse"], outputs: ["shown", "hidden"], exportAs: ["cwCollapse"] }, { kind: "component", type: IconComponent, selector: "cw-icon", inputs: ["icon", "label", "type", "iconSize", "iconCssClass", "iconUiType", "iconColorCustom", "spritePath"] }] }); }
|
|
734
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.19", ngImport: i0, type: CardComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
735
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.19", type: CardComponent, isStandalone: true, selector: "cw-card", inputs: { title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: false, transformFunction: null }, type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: false, transformFunction: null }, titleRank: { classPropertyName: "titleRank", publicName: "titleRank", isSignal: true, isRequired: false, transformFunction: null }, collapsible: { classPropertyName: "collapsible", publicName: "collapsible", isSignal: true, isRequired: false, transformFunction: null }, collapsed: { classPropertyName: "collapsed", publicName: "collapsed", isSignal: true, isRequired: false, transformFunction: null }, collapseId: { classPropertyName: "collapseId", publicName: "collapseId", isSignal: true, isRequired: false, transformFunction: null }, destroyOnHide: { classPropertyName: "destroyOnHide", publicName: "destroyOnHide", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { collapsible: "collapsibleChange", destroyOnHide: "destroyOnHideChange", collapseClicked: "collapseClicked" }, viewQueries: [{ propertyName: "collapseDirective", first: true, predicate: ["collapse"], descendants: true, isSignal: true }, { propertyName: "cardFooter", first: true, predicate: ["cardFooter"], descendants: true, isSignal: true }], ngImport: i0, template: "<div class=\"card\" [class.card-collapse]=\"collapsible()\" [class.card-light]=\"type() == typeEnum.light\">\n @if (title()) {\n <div class=\"card-header\" [class.card-header-collapse]=\"collapsible()\"\n [class.card-header-collapsed]=\"collapsible() && isCollapsed()\">\n <ng-container *ngTemplateOutlet=\"header\"></ng-container>\n </div>\n }\n\n @if(collapsible()) {\n <div [cwCollapse]=\"isCollapsed()\" [id]=\"collapseId()\" #collapse=\"cwCollapse\">\n <ng-container *ngTemplateOutlet=\"content\"></ng-container>\n </div>\n }\n @else {\n <ng-container *ngTemplateOutlet=\"content\"></ng-container>\n }\n</div>\n\n<ng-template #header>\n @if (titleRank() == titleRankEnum.h2) {\n <h2>{{title()}}</h2>\n }\n @else if (titleRank() == titleRankEnum.h3) {\n <h3>{{title()}}</h3>\n }\n\n <div class=\"card-header-custom-area\">\n <ng-content select=\"[header-custom-area]\"></ng-content>\n </div>\n\n @if (collapsible()) {\n <button type=\"button\" class=\"btn btn-collapse stretched-link\" (click)=\"toggleCollapse()\"\n [attr.aria-expanded]=\"!isCollapsed()\" [class.collapsed]=\"isCollapsed()\" [attr.aria-controls]=\"collapseId()\">\n <cw-icon [icon]=\"spriteIcon.down\" label=\"D\u00E9plier/Plier\" [iconSize]=\"iconSize['xs']\"></cw-icon>\n <!-- // TODO trad -->\n </button>\n }\n</ng-template>\n\n<ng-template #content>\n @if (shouldRenderBody()) {\n <div class=\"card-body\">\n <ng-content></ng-content>\n </div>\n\n @if (showFooter) {\n <div class=\"card-footer\" #cardFooter>\n <ng-content select=\"[card-footer]\"></ng-content>\n </div>\n }\n }\n</ng-template>\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: CollapseDirective, selector: "[cwCollapse]", inputs: ["cwCollapse"], outputs: ["shown", "hidden"], exportAs: ["cwCollapse"] }, { kind: "component", type: IconComponent, selector: "cw-icon", inputs: ["icon", "label", "type", "iconSize", "iconCssClass", "iconUiType", "iconColorCustom", "spritePath"] }] }); }
|
|
699
736
|
}
|
|
700
737
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.19", ngImport: i0, type: CardComponent, decorators: [{
|
|
701
738
|
type: Component,
|
|
@@ -703,51 +740,30 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.19", ngImpo
|
|
|
703
740
|
CommonModule,
|
|
704
741
|
CollapseDirective,
|
|
705
742
|
IconComponent
|
|
706
|
-
], template: "<div class=\"card\" [class.card-collapse]=\"collapsible\" [class.card-light]=\"type == typeEnum.light\">\n @if (title) {\n <div class=\"card-header\" [class.card-header-collapse]=\"collapsible\"\n [class.card-header-collapsed]=\"collapsible && isCollapsed()\">\n <ng-container *ngTemplateOutlet=\"header\"></ng-container>\n </div>\n }\n\n @if(collapsible) {\n <div [cwCollapse]=\"isCollapsed()\" [id]=\"collapseId\" #collapse=\"cwCollapse\">\n <ng-container *ngTemplateOutlet=\"content\"></ng-container>\n </div>\n }\n @else {\n <ng-container *ngTemplateOutlet=\"content\"></ng-container>\n }\n</div>\n\n<ng-template #header>\n @if (titleRank == titleRankEnum.h2) {\n <h2>{{title}}</h2>\n }\n @else if (titleRank == titleRankEnum.h3) {\n <h3>{{title}}</h3>\n }\n\n <div class=\"card-header-custom-area\">\n <ng-content select=\"[header-custom-area]\"></ng-content>\n </div>\n\n @if (collapsible) {\n <button type=\"button\" class=\"btn btn-collapse stretched-link\" (click)=\"toggleCollapse()\"\n [attr.aria-expanded]=\"!isCollapsed()\" [class.collapsed]=\"isCollapsed()\" [attr.aria-controls]=\"collapseId\">\n <cw-icon [icon]=\"spriteIcon.down\" label=\"D\u00E9plier/Plier\" [iconSize]=\"iconSize['xs']\"></cw-icon>\n <!-- // TODO trad -->\n </button>\n }\n</ng-template>\n\n<ng-template #content>\n @if (shouldRenderBody()) {\n <div class=\"card-body\">\n <ng-content></ng-content>\n </div>\n\n @if (showFooter) {\n <div class=\"card-footer\" #cardFooter>\n <ng-content select=\"[card-footer]\"></ng-content>\n </div>\n }\n }\n</ng-template>\n" }]
|
|
707
|
-
}],
|
|
708
|
-
type: Input
|
|
709
|
-
}], type: [{
|
|
710
|
-
type: Input
|
|
711
|
-
}], titleRank: [{
|
|
712
|
-
type: Input
|
|
713
|
-
}], collapsible: [{
|
|
714
|
-
type: Input
|
|
715
|
-
}], collapsed: [{
|
|
716
|
-
type: Input
|
|
717
|
-
}], collapseId: [{
|
|
718
|
-
type: Input
|
|
719
|
-
}], destroyOnHide: [{
|
|
720
|
-
type: Input
|
|
721
|
-
}], collapseClicked: [{
|
|
722
|
-
type: Output
|
|
723
|
-
}], collapseDirective: [{
|
|
724
|
-
type: ViewChild,
|
|
725
|
-
args: ['collapse']
|
|
726
|
-
}], cardFooter: [{
|
|
727
|
-
type: ViewChild,
|
|
728
|
-
args: ['cardFooter']
|
|
729
|
-
}] } });
|
|
743
|
+
], template: "<div class=\"card\" [class.card-collapse]=\"collapsible()\" [class.card-light]=\"type() == typeEnum.light\">\n @if (title()) {\n <div class=\"card-header\" [class.card-header-collapse]=\"collapsible()\"\n [class.card-header-collapsed]=\"collapsible() && isCollapsed()\">\n <ng-container *ngTemplateOutlet=\"header\"></ng-container>\n </div>\n }\n\n @if(collapsible()) {\n <div [cwCollapse]=\"isCollapsed()\" [id]=\"collapseId()\" #collapse=\"cwCollapse\">\n <ng-container *ngTemplateOutlet=\"content\"></ng-container>\n </div>\n }\n @else {\n <ng-container *ngTemplateOutlet=\"content\"></ng-container>\n }\n</div>\n\n<ng-template #header>\n @if (titleRank() == titleRankEnum.h2) {\n <h2>{{title()}}</h2>\n }\n @else if (titleRank() == titleRankEnum.h3) {\n <h3>{{title()}}</h3>\n }\n\n <div class=\"card-header-custom-area\">\n <ng-content select=\"[header-custom-area]\"></ng-content>\n </div>\n\n @if (collapsible()) {\n <button type=\"button\" class=\"btn btn-collapse stretched-link\" (click)=\"toggleCollapse()\"\n [attr.aria-expanded]=\"!isCollapsed()\" [class.collapsed]=\"isCollapsed()\" [attr.aria-controls]=\"collapseId()\">\n <cw-icon [icon]=\"spriteIcon.down\" label=\"D\u00E9plier/Plier\" [iconSize]=\"iconSize['xs']\"></cw-icon>\n <!-- // TODO trad -->\n </button>\n }\n</ng-template>\n\n<ng-template #content>\n @if (shouldRenderBody()) {\n <div class=\"card-body\">\n <ng-content></ng-content>\n </div>\n\n @if (showFooter) {\n <div class=\"card-footer\" #cardFooter>\n <ng-content select=\"[card-footer]\"></ng-content>\n </div>\n }\n }\n</ng-template>\n" }]
|
|
744
|
+
}], propDecorators: { title: [{ type: i0.Input, args: [{ isSignal: true, alias: "title", required: false }] }], type: [{ type: i0.Input, args: [{ isSignal: true, alias: "type", required: false }] }], titleRank: [{ type: i0.Input, args: [{ isSignal: true, alias: "titleRank", required: false }] }], collapsible: [{ type: i0.Input, args: [{ isSignal: true, alias: "collapsible", required: false }] }, { type: i0.Output, args: ["collapsibleChange"] }], collapsed: [{ type: i0.Input, args: [{ isSignal: true, alias: "collapsed", required: false }] }], collapseId: [{ type: i0.Input, args: [{ isSignal: true, alias: "collapseId", required: false }] }], destroyOnHide: [{ type: i0.Input, args: [{ isSignal: true, alias: "destroyOnHide", required: false }] }, { type: i0.Output, args: ["destroyOnHideChange"] }], collapseClicked: [{ type: i0.Output, args: ["collapseClicked"] }], collapseDirective: [{ type: i0.ViewChild, args: ['collapse', { isSignal: true }] }], cardFooter: [{ type: i0.ViewChild, args: ['cardFooter', { isSignal: true }] }] } });
|
|
730
745
|
|
|
731
746
|
class AccordionComponent {
|
|
732
747
|
constructor() {
|
|
733
|
-
this.closeOthers = true;
|
|
734
|
-
this.allowMultiple = false;
|
|
735
|
-
this.destroyOnHide = true
|
|
736
|
-
this.panelOpened =
|
|
737
|
-
this.panelClosed =
|
|
748
|
+
this.closeOthers = input(true, ...(ngDevMode ? [{ debugName: "closeOthers" }] : []));
|
|
749
|
+
this.allowMultiple = input(false, ...(ngDevMode ? [{ debugName: "allowMultiple" }] : []));
|
|
750
|
+
this.destroyOnHide = input(true, ...(ngDevMode ? [{ debugName: "destroyOnHide" }] : []));
|
|
751
|
+
this.panelOpened = output();
|
|
752
|
+
this.panelClosed = output();
|
|
753
|
+
this.cards = contentChildren(CardComponent, ...(ngDevMode ? [{ debugName: "cards" }] : []));
|
|
738
754
|
this.cardMap = new Map();
|
|
739
755
|
}
|
|
740
756
|
ngAfterContentInit() {
|
|
741
|
-
this.cards.forEach(card => {
|
|
742
|
-
if (!card.collapsible) {
|
|
743
|
-
card.collapsible
|
|
757
|
+
this.cards().forEach(card => {
|
|
758
|
+
if (!card.collapsible()) {
|
|
759
|
+
card.collapsible.set(true);
|
|
744
760
|
}
|
|
745
|
-
if (card.destroyOnHide === true) {
|
|
746
|
-
card.destroyOnHide
|
|
761
|
+
if (card.destroyOnHide() === true) {
|
|
762
|
+
card.destroyOnHide.set(this.destroyOnHide());
|
|
747
763
|
}
|
|
748
|
-
this.cardMap.set(card.collapseId, card);
|
|
764
|
+
this.cardMap.set(card.collapseId(), card);
|
|
749
765
|
card.collapseClicked.subscribe((isCollapsed) => {
|
|
750
|
-
this.onCardToggle(card.collapseId, isCollapsed);
|
|
766
|
+
this.onCardToggle(card.collapseId(), isCollapsed);
|
|
751
767
|
});
|
|
752
768
|
});
|
|
753
769
|
}
|
|
@@ -778,11 +794,11 @@ class AccordionComponent {
|
|
|
778
794
|
}
|
|
779
795
|
}
|
|
780
796
|
closeAll() {
|
|
781
|
-
this.cards.forEach(card => card.collapse());
|
|
797
|
+
this.cards().forEach(card => card.collapse());
|
|
782
798
|
}
|
|
783
799
|
openAll() {
|
|
784
800
|
if (!this.shouldCloseOthers()) {
|
|
785
|
-
this.cards.forEach(card => card.expand());
|
|
801
|
+
this.cards().forEach(card => card.expand());
|
|
786
802
|
}
|
|
787
803
|
}
|
|
788
804
|
onCardToggle(panelId, isCollapsed) {
|
|
@@ -797,35 +813,22 @@ class AccordionComponent {
|
|
|
797
813
|
}
|
|
798
814
|
}
|
|
799
815
|
closeAllExcept(exceptId) {
|
|
800
|
-
this.cards.forEach(card => {
|
|
801
|
-
if (card.collapseId !== exceptId) {
|
|
816
|
+
this.cards().forEach(card => {
|
|
817
|
+
if (card.collapseId() !== exceptId) {
|
|
802
818
|
card.collapse();
|
|
803
819
|
}
|
|
804
820
|
});
|
|
805
821
|
}
|
|
806
822
|
shouldCloseOthers() {
|
|
807
|
-
return this.closeOthers && !this.allowMultiple;
|
|
823
|
+
return this.closeOthers() && !this.allowMultiple();
|
|
808
824
|
}
|
|
809
825
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.19", ngImport: i0, type: AccordionComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
810
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "
|
|
826
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "20.3.19", type: AccordionComponent, isStandalone: true, selector: "cw-accordion", inputs: { closeOthers: { classPropertyName: "closeOthers", publicName: "closeOthers", isSignal: true, isRequired: false, transformFunction: null }, allowMultiple: { classPropertyName: "allowMultiple", publicName: "allowMultiple", isSignal: true, isRequired: false, transformFunction: null }, destroyOnHide: { classPropertyName: "destroyOnHide", publicName: "destroyOnHide", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { panelOpened: "panelOpened", panelClosed: "panelClosed" }, queries: [{ propertyName: "cards", predicate: CardComponent, isSignal: true }], ngImport: i0, template: "<div class=\"accordion\">\r\n <ng-content></ng-content>\r\n</div>\r\n", dependencies: [{ kind: "ngmodule", type: CommonModule }] }); }
|
|
811
827
|
}
|
|
812
828
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.19", ngImport: i0, type: AccordionComponent, decorators: [{
|
|
813
829
|
type: Component,
|
|
814
830
|
args: [{ selector: 'cw-accordion', standalone: true, imports: [CommonModule], template: "<div class=\"accordion\">\r\n <ng-content></ng-content>\r\n</div>\r\n" }]
|
|
815
|
-
}], propDecorators: { closeOthers: [{
|
|
816
|
-
type: Input
|
|
817
|
-
}], allowMultiple: [{
|
|
818
|
-
type: Input
|
|
819
|
-
}], destroyOnHide: [{
|
|
820
|
-
type: Input
|
|
821
|
-
}], panelOpened: [{
|
|
822
|
-
type: Output
|
|
823
|
-
}], panelClosed: [{
|
|
824
|
-
type: Output
|
|
825
|
-
}], cards: [{
|
|
826
|
-
type: ContentChildren,
|
|
827
|
-
args: [CardComponent]
|
|
828
|
-
}] } });
|
|
831
|
+
}], propDecorators: { closeOthers: [{ type: i0.Input, args: [{ isSignal: true, alias: "closeOthers", required: false }] }], allowMultiple: [{ type: i0.Input, args: [{ isSignal: true, alias: "allowMultiple", required: false }] }], destroyOnHide: [{ type: i0.Input, args: [{ isSignal: true, alias: "destroyOnHide", required: false }] }], panelOpened: [{ type: i0.Output, args: ["panelOpened"] }], panelClosed: [{ type: i0.Output, args: ["panelClosed"] }], cards: [{ type: i0.ContentChildren, args: [i0.forwardRef(() => CardComponent), { isSignal: true }] }] } });
|
|
829
832
|
|
|
830
833
|
var AlertTypeEnum;
|
|
831
834
|
(function (AlertTypeEnum) {
|
|
@@ -852,14 +855,14 @@ var IconNotifTypeEnum;
|
|
|
852
855
|
|
|
853
856
|
class IconNotificationComponent {
|
|
854
857
|
constructor() {
|
|
855
|
-
this.type = IconNotifTypeEnum.info;
|
|
856
|
-
this.iconSize = IconNotifSizeEnum['md'];
|
|
858
|
+
this.type = input(IconNotifTypeEnum.info, ...(ngDevMode ? [{ debugName: "type" }] : []));
|
|
859
|
+
this.iconSize = input(IconNotifSizeEnum['md'], ...(ngDevMode ? [{ debugName: "iconSize" }] : []));
|
|
857
860
|
}
|
|
858
861
|
get hostClasses() {
|
|
859
|
-
return 'icon-rounded icon-rounded-' + this.iconSize + ' icon-notification-' + this.type;
|
|
862
|
+
return 'icon-rounded icon-rounded-' + this.iconSize() + ' icon-notification-' + this.type();
|
|
860
863
|
}
|
|
861
864
|
ngOnInit() {
|
|
862
|
-
switch (this.type) {
|
|
865
|
+
switch (this.type()) {
|
|
863
866
|
case IconNotifTypeEnum.info:
|
|
864
867
|
this.icon = SpriteIconEnum.alertHelp;
|
|
865
868
|
this.label = 'Informatiion';
|
|
@@ -883,38 +886,37 @@ class IconNotificationComponent {
|
|
|
883
886
|
}
|
|
884
887
|
}
|
|
885
888
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.19", ngImport: i0, type: IconNotificationComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
886
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "
|
|
889
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "20.3.19", type: IconNotificationComponent, isStandalone: true, selector: "cw-icon-notification", inputs: { type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: false, transformFunction: null }, iconSize: { classPropertyName: "iconSize", publicName: "iconSize", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "this.hostClasses" } }, ngImport: i0, template: "\r\n<span class=\"icon\">\r\n <cw-icon [label]=\"label\" [iconSize]=\"iconSize()['2xs']\" [icon]=\"icon\"></cw-icon>\r\n</span>\r\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "component", type: IconComponent, selector: "cw-icon", inputs: ["icon", "label", "type", "iconSize", "iconCssClass", "iconUiType", "iconColorCustom", "spritePath"] }] }); }
|
|
887
890
|
}
|
|
888
891
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.19", ngImport: i0, type: IconNotificationComponent, decorators: [{
|
|
889
892
|
type: Component,
|
|
890
893
|
args: [{ selector: 'cw-icon-notification', standalone: true, imports: [
|
|
891
894
|
CommonModule,
|
|
892
895
|
IconComponent
|
|
893
|
-
], template: "\r\n<span class=\"icon\">\r\n <cw-icon [label]=\"label\" [iconSize]=\"iconSize['2xs']\" [icon]=\"icon\"></cw-icon>\r\n</span>\r\n" }]
|
|
894
|
-
}],
|
|
895
|
-
type: Input
|
|
896
|
-
}], iconSize: [{
|
|
897
|
-
type: Input
|
|
898
|
-
}], hostClasses: [{
|
|
896
|
+
], template: "\r\n<span class=\"icon\">\r\n <cw-icon [label]=\"label\" [iconSize]=\"iconSize()['2xs']\" [icon]=\"icon\"></cw-icon>\r\n</span>\r\n" }]
|
|
897
|
+
}], propDecorators: { type: [{ type: i0.Input, args: [{ isSignal: true, alias: "type", required: false }] }], iconSize: [{ type: i0.Input, args: [{ isSignal: true, alias: "iconSize", required: false }] }], hostClasses: [{
|
|
899
898
|
type: HostBinding,
|
|
900
899
|
args: ['class']
|
|
901
900
|
}] } });
|
|
902
901
|
|
|
903
902
|
class AlertComponent {
|
|
904
|
-
constructor(
|
|
905
|
-
this.cdRef =
|
|
906
|
-
this.type = AlertTypeEnum.info;
|
|
907
|
-
this.
|
|
908
|
-
this.
|
|
909
|
-
this.
|
|
903
|
+
constructor() {
|
|
904
|
+
this.cdRef = inject(ChangeDetectorRef);
|
|
905
|
+
this.type = input(AlertTypeEnum.info, ...(ngDevMode ? [{ debugName: "type" }] : []));
|
|
906
|
+
this.title = input(...(ngDevMode ? [undefined, { debugName: "title" }] : []));
|
|
907
|
+
this.isDismissible = input(false, ...(ngDevMode ? [{ debugName: "isDismissible" }] : []));
|
|
908
|
+
this.cssClass = input('', ...(ngDevMode ? [{ debugName: "cssClass" }] : []));
|
|
909
|
+
this.dataTest = input(...(ngDevMode ? [undefined, { debugName: "dataTest" }] : []));
|
|
910
|
+
this.close = output();
|
|
911
|
+
this.alertContent = viewChild('alertContent', ...(ngDevMode ? [{ debugName: "alertContent" }] : []));
|
|
910
912
|
this.isVisible = true;
|
|
911
913
|
this.showContent = true;
|
|
912
914
|
this.iconSize = IconSizeEnum;
|
|
913
915
|
this.spriteIcon = SpriteIconEnum;
|
|
914
916
|
}
|
|
915
917
|
ngOnInit() {
|
|
916
|
-
this.
|
|
917
|
-
switch (this.type) {
|
|
918
|
+
this.resolvedDataTest = this.dataTest() ? this.dataTest() : 'alert' + this.type();
|
|
919
|
+
switch (this.type()) {
|
|
918
920
|
case AlertTypeEnum.info:
|
|
919
921
|
this.icon = "cw-alert-info2";
|
|
920
922
|
this.iconNotifType = IconNotifTypeEnum.info;
|
|
@@ -938,15 +940,16 @@ class AlertComponent {
|
|
|
938
940
|
}
|
|
939
941
|
}
|
|
940
942
|
ngAfterViewInit() {
|
|
941
|
-
|
|
943
|
+
const el = this.alertContent()?.nativeElement;
|
|
944
|
+
this.showContent = !!el && el.children.length > 0;
|
|
942
945
|
this.cdRef.detectChanges();
|
|
943
946
|
}
|
|
944
947
|
closeAlert() {
|
|
945
948
|
this.isVisible = false;
|
|
946
|
-
this.close.emit();
|
|
949
|
+
this.close.emit(true);
|
|
947
950
|
}
|
|
948
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.19", ngImport: i0, type: AlertComponent, deps: [
|
|
949
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.19", type: AlertComponent, isStandalone: true, selector: "cw-alert", inputs: { type: "type", title: "title", isDismissible: "isDismissible", cssClass: "cssClass", dataTest: "dataTest" }, outputs: { close: "close" }, viewQueries: [{ propertyName: "alertContent", first: true, predicate: ["alertContent"], descendants: true }], ngImport: i0, template: "@if (isVisible) {\
|
|
951
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.19", ngImport: i0, type: AlertComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
952
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.19", type: AlertComponent, isStandalone: true, selector: "cw-alert", inputs: { type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: false, transformFunction: null }, title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: false, transformFunction: null }, isDismissible: { classPropertyName: "isDismissible", publicName: "isDismissible", isSignal: true, isRequired: false, transformFunction: null }, cssClass: { classPropertyName: "cssClass", publicName: "cssClass", isSignal: true, isRequired: false, transformFunction: null }, dataTest: { classPropertyName: "dataTest", publicName: "dataTest", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { close: "close" }, viewQueries: [{ propertyName: "alertContent", first: true, predicate: ["alertContent"], descendants: true, isSignal: true }], ngImport: i0, template: "@if (isVisible) {\n <div [class]=\"'alert alert-' + type() + ' '+ cssClass()\" [ngClass]=\"{ 'alert-dismissible fade show': isDismissible() }\"\n [attr.data-test-ctw]=\"resolvedDataTest\">\n <cw-icon-notification [type]=\"iconNotifType\"></cw-icon-notification>\n <div class=\"alert-content\">\n @if (title()) {\n <div class=\"fw-bold\">{{ title() }}</div>\n }\n\n @if (showContent) {\n <p class=\"mb-none\" #alertContent>\n <ng-content></ng-content>\n </p>\n }\n </div>\n @if (isDismissible()) {\n <button type=\"button\" class=\"btn-close\" (click)=\"closeAlert()\"\n [attr.aria-label]=\"'_COMMON._ACTION.CLOSE' | translate\"\n [attr.data-test-ctw]=\"'close-' + resolvedDataTest\">\n <cw-icon [label]=\"'_COMMON._ACTION.CLOSE' | translate\" [iconSize]=\"iconSize['2xs']\" [icon]=\"spriteIcon.toolbarClose\"></cw-icon>\n </button>\n }\n </div>\n}\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "ngmodule", type: TranslateModule }, { kind: "component", type: IconNotificationComponent, selector: "cw-icon-notification", inputs: ["type", "iconSize"] }, { kind: "component", type: IconComponent, selector: "cw-icon", inputs: ["icon", "label", "type", "iconSize", "iconCssClass", "iconUiType", "iconColorCustom", "spritePath"] }, { kind: "pipe", type: i2.TranslatePipe, name: "translate" }] }); }
|
|
950
953
|
}
|
|
951
954
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.19", ngImport: i0, type: AlertComponent, decorators: [{
|
|
952
955
|
type: Component,
|
|
@@ -955,23 +958,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.19", ngImpo
|
|
|
955
958
|
TranslateModule,
|
|
956
959
|
IconNotificationComponent,
|
|
957
960
|
IconComponent
|
|
958
|
-
], template: "@if (isVisible) {\
|
|
959
|
-
}],
|
|
960
|
-
type: Input
|
|
961
|
-
}], title: [{
|
|
962
|
-
type: Input
|
|
963
|
-
}], isDismissible: [{
|
|
964
|
-
type: Input
|
|
965
|
-
}], cssClass: [{
|
|
966
|
-
type: Input
|
|
967
|
-
}], dataTest: [{
|
|
968
|
-
type: Input
|
|
969
|
-
}], close: [{
|
|
970
|
-
type: Output
|
|
971
|
-
}], alertContent: [{
|
|
972
|
-
type: ViewChild,
|
|
973
|
-
args: ['alertContent']
|
|
974
|
-
}] } });
|
|
961
|
+
], template: "@if (isVisible) {\n <div [class]=\"'alert alert-' + type() + ' '+ cssClass()\" [ngClass]=\"{ 'alert-dismissible fade show': isDismissible() }\"\n [attr.data-test-ctw]=\"resolvedDataTest\">\n <cw-icon-notification [type]=\"iconNotifType\"></cw-icon-notification>\n <div class=\"alert-content\">\n @if (title()) {\n <div class=\"fw-bold\">{{ title() }}</div>\n }\n\n @if (showContent) {\n <p class=\"mb-none\" #alertContent>\n <ng-content></ng-content>\n </p>\n }\n </div>\n @if (isDismissible()) {\n <button type=\"button\" class=\"btn-close\" (click)=\"closeAlert()\"\n [attr.aria-label]=\"'_COMMON._ACTION.CLOSE' | translate\"\n [attr.data-test-ctw]=\"'close-' + resolvedDataTest\">\n <cw-icon [label]=\"'_COMMON._ACTION.CLOSE' | translate\" [iconSize]=\"iconSize['2xs']\" [icon]=\"spriteIcon.toolbarClose\"></cw-icon>\n </button>\n }\n </div>\n}\n" }]
|
|
962
|
+
}], propDecorators: { type: [{ type: i0.Input, args: [{ isSignal: true, alias: "type", required: false }] }], title: [{ type: i0.Input, args: [{ isSignal: true, alias: "title", required: false }] }], isDismissible: [{ type: i0.Input, args: [{ isSignal: true, alias: "isDismissible", required: false }] }], cssClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "cssClass", required: false }] }], dataTest: [{ type: i0.Input, args: [{ isSignal: true, alias: "dataTest", required: false }] }], close: [{ type: i0.Output, args: ["close"] }], alertContent: [{ type: i0.ViewChild, args: ['alertContent', { isSignal: true }] }] } });
|
|
975
963
|
|
|
976
964
|
class FocusTrackerService {
|
|
977
965
|
constructor() {
|
|
@@ -1001,11 +989,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.19", ngImpo
|
|
|
1001
989
|
}]
|
|
1002
990
|
}], ctorParameters: () => [] });
|
|
1003
991
|
|
|
992
|
+
const AUTOHIDE_DELAY_MS = 5000;
|
|
1004
993
|
class ToastService {
|
|
1005
994
|
constructor() {
|
|
1006
995
|
this.focusService = inject(FocusTrackerService);
|
|
1007
|
-
this.
|
|
996
|
+
this.zone = inject(NgZone);
|
|
997
|
+
this.toasts = signal([], ...(ngDevMode ? [{ debugName: "toasts" }] : []));
|
|
1008
998
|
this.autohideTimers = new Map();
|
|
999
|
+
this.triggeringElements = new Map();
|
|
1009
1000
|
}
|
|
1010
1001
|
show(options) {
|
|
1011
1002
|
if (!this.canShowMessage(options.message)) {
|
|
@@ -1019,38 +1010,41 @@ class ToastService {
|
|
|
1019
1010
|
autohide: options.autohide ?? false,
|
|
1020
1011
|
action: options.action,
|
|
1021
1012
|
};
|
|
1022
|
-
this.toasts.
|
|
1023
|
-
this.
|
|
1024
|
-
// Gestion du autohide
|
|
1013
|
+
this.toasts.update(arr => [...arr, toast]);
|
|
1014
|
+
this.triggeringElements.set(toast.id, this.focusService.getFocusedElement());
|
|
1025
1015
|
if (toast.autohide) {
|
|
1026
|
-
const toastId = toast.id;
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
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
|
+
});
|
|
1031
1023
|
}
|
|
1032
1024
|
}
|
|
1033
1025
|
remove(toast) {
|
|
1034
|
-
this.removeById(toast.id);
|
|
1026
|
+
this.removeById(toast.id, { restoreFocus: true });
|
|
1035
1027
|
}
|
|
1036
|
-
removeById(toastId) {
|
|
1037
|
-
// Nettoyer le timer s'il existe
|
|
1028
|
+
removeById(toastId, opts = {}) {
|
|
1038
1029
|
const timer = this.autohideTimers.get(toastId);
|
|
1039
1030
|
if (timer) {
|
|
1040
1031
|
clearTimeout(timer);
|
|
1041
1032
|
this.autohideTimers.delete(toastId);
|
|
1042
1033
|
}
|
|
1043
|
-
this.toasts
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1034
|
+
this.toasts.update(arr => arr.filter(t => t.id !== toastId));
|
|
1035
|
+
const triggeringElement = this.triggeringElements.get(toastId);
|
|
1036
|
+
this.triggeringElements.delete(toastId);
|
|
1037
|
+
// Ne restaurer le focus que si c'était une action manuelle (clic sur la croix),
|
|
1038
|
+
// pas sur autohide — sinon le focus de l'utilisateur saute toutes les 5s.
|
|
1039
|
+
if (opts.restoreFocus) {
|
|
1040
|
+
triggeringElement?.focus();
|
|
1047
1041
|
}
|
|
1048
1042
|
}
|
|
1049
1043
|
clear() {
|
|
1050
|
-
// Nettoyer tous les timers
|
|
1051
1044
|
this.autohideTimers.forEach(timer => clearTimeout(timer));
|
|
1052
1045
|
this.autohideTimers.clear();
|
|
1053
|
-
this.
|
|
1046
|
+
this.triggeringElements.clear();
|
|
1047
|
+
this.toasts.set([]);
|
|
1054
1048
|
}
|
|
1055
1049
|
canShowMessage(message) {
|
|
1056
1050
|
if (!this.lastToast) {
|
|
@@ -1080,8 +1074,8 @@ class ToastComponent {
|
|
|
1080
1074
|
constructor() {
|
|
1081
1075
|
this.toastService = inject(ToastService);
|
|
1082
1076
|
this.elRef = inject(ElementRef);
|
|
1083
|
-
this.action =
|
|
1084
|
-
this.closed =
|
|
1077
|
+
this.action = output();
|
|
1078
|
+
this.closed = output();
|
|
1085
1079
|
}
|
|
1086
1080
|
ngAfterViewInit() {
|
|
1087
1081
|
const elemPosition = this.elRef.nativeElement.getBoundingClientRect();
|
|
@@ -1104,19 +1098,15 @@ class ToastComponent {
|
|
|
1104
1098
|
this.closed.emit();
|
|
1105
1099
|
}
|
|
1106
1100
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.19", ngImport: i0, type: ToastComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1107
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.19", type: ToastComponent, isStandalone: true, selector: "cw-toast", outputs: { action: "action", closed: "closed" }, host: { attributes: { "role": "alert" }, properties: { "class.toast": "true" } }, ngImport: i0, template: "@for (toast of toastService.toasts; track toast.id) {\r\n <cw-alert [type]=\"toast.type\" [isDismissible]=\"true\" [title]=\"toast.title\" (close)=\"toastService.remove(toast)\" [dataTest]=\"'toast-'+ toast.type\">\r\n <span [innerHTML]=\"toast.message\"></span> \r\n @if (toast.action) {\r\n <a href=\"javascript:void(0);\" (click)=\"onAction(toast)\" class=\"alert-link\">{{ toast.action.label }}</a>\r\n }\r\n </cw-alert>\r\n}\r\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "component", type: AlertComponent, selector: "cw-alert", inputs: ["type", "title", "isDismissible", "cssClass", "dataTest"], outputs: ["close"] }] }); }
|
|
1101
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.19", type: ToastComponent, isStandalone: true, selector: "cw-toast", outputs: { action: "action", closed: "closed" }, host: { attributes: { "role": "alert" }, properties: { "class.toast": "true" } }, ngImport: i0, template: "@for (toast of toastService.toasts(); track toast.id) {\r\n <cw-alert [type]=\"toast.type\" [isDismissible]=\"true\" [title]=\"toast.title\" (close)=\"toastService.remove(toast)\" [dataTest]=\"'toast-'+ toast.type\">\r\n <span [innerHTML]=\"toast.message\"></span> \r\n @if (toast.action) {\r\n <a href=\"javascript:void(0);\" (click)=\"onAction(toast)\" class=\"alert-link\">{{ toast.action.label }}</a>\r\n }\r\n </cw-alert>\r\n}\r\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "component", type: AlertComponent, selector: "cw-alert", inputs: ["type", "title", "isDismissible", "cssClass", "dataTest"], outputs: ["close"] }] }); }
|
|
1108
1102
|
}
|
|
1109
1103
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.19", ngImport: i0, type: ToastComponent, decorators: [{
|
|
1110
1104
|
type: Component,
|
|
1111
1105
|
args: [{ selector: 'cw-toast', standalone: true, imports: [
|
|
1112
1106
|
CommonModule,
|
|
1113
1107
|
AlertComponent
|
|
1114
|
-
], 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" }]
|
|
1115
|
-
}], propDecorators: { action: [{
|
|
1116
|
-
type: Output
|
|
1117
|
-
}], closed: [{
|
|
1118
|
-
type: Output
|
|
1119
|
-
}] } });
|
|
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"] }] } });
|
|
1120
1110
|
|
|
1121
1111
|
var BadgeTypeEnum;
|
|
1122
1112
|
(function (BadgeTypeEnum) {
|
|
@@ -1144,37 +1134,27 @@ var BadgePositionEnum;
|
|
|
1144
1134
|
})(BadgePositionEnum || (BadgePositionEnum = {}));
|
|
1145
1135
|
|
|
1146
1136
|
class BadgeComponent {
|
|
1147
|
-
get hostClasses() {
|
|
1148
|
-
return this.skeletonMode ? 'skeleton badge' : '';
|
|
1149
|
-
}
|
|
1150
1137
|
constructor() {
|
|
1151
1138
|
this.badgePositionEnum = BadgePositionEnum;
|
|
1152
|
-
this.
|
|
1153
|
-
this.
|
|
1154
|
-
this.
|
|
1139
|
+
this.type = input.required(...(ngDevMode ? [{ debugName: "type" }] : []));
|
|
1140
|
+
this.label = input(...(ngDevMode ? [undefined, { debugName: "label" }] : []));
|
|
1141
|
+
this.withIcon = input(...(ngDevMode ? [undefined, { debugName: "withIcon" }] : []));
|
|
1142
|
+
this.iconPosition = input(BadgePositionEnum.left, ...(ngDevMode ? [{ debugName: "iconPosition" }] : []));
|
|
1143
|
+
this.cssClass = input('', ...(ngDevMode ? [{ debugName: "cssClass" }] : []));
|
|
1144
|
+
this.skeletonMode = input(false, ...(ngDevMode ? [{ debugName: "skeletonMode" }] : []));
|
|
1145
|
+
this.dataTest = input(...(ngDevMode ? [undefined, { debugName: "dataTest" }] : []));
|
|
1155
1146
|
this.iconSizeEnum = IconSizeEnum;
|
|
1156
1147
|
}
|
|
1148
|
+
get hostClasses() {
|
|
1149
|
+
return this.skeletonMode() ? 'skeleton badge' : '';
|
|
1150
|
+
}
|
|
1157
1151
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.19", ngImport: i0, type: BadgeComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1158
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.19", type: BadgeComponent, isStandalone: true, selector: "cw-badge", inputs: { type: "type", label: "label", withIcon: "withIcon", iconPosition: "iconPosition", cssClass: "cssClass", skeletonMode: "skeletonMode", dataTest: "dataTest" }, host: { properties: { "class": "this.hostClasses" } }, ngImport: i0, template: "<div [class]=\"'badge badge-' + type + ' '+ cssClass\" [attr.data-test-ctw]=\"dataTest ? dataTest : null\">\
|
|
1152
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.19", type: BadgeComponent, isStandalone: true, selector: "cw-badge", inputs: { type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: true, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, withIcon: { classPropertyName: "withIcon", publicName: "withIcon", isSignal: true, isRequired: false, transformFunction: null }, iconPosition: { classPropertyName: "iconPosition", publicName: "iconPosition", isSignal: true, isRequired: false, transformFunction: null }, cssClass: { classPropertyName: "cssClass", publicName: "cssClass", isSignal: true, isRequired: false, transformFunction: null }, skeletonMode: { classPropertyName: "skeletonMode", publicName: "skeletonMode", isSignal: true, isRequired: false, transformFunction: null }, dataTest: { classPropertyName: "dataTest", publicName: "dataTest", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "this.hostClasses" } }, ngImport: i0, template: "<div [class]=\"'badge badge-' + type() + ' '+ cssClass()\" [attr.data-test-ctw]=\"dataTest() ? dataTest() : null\">\n\n @if (withIcon() && iconPosition() === badgePositionEnum.left) {\n <cw-icon [icon]=\"withIcon()\" [iconSize]=\"iconSizeEnum['2xs']\"></cw-icon>\n }\n\n @if (label()) {\n {{ label() | translate }}\n }\n\n @if (withIcon() && iconPosition() === badgePositionEnum.right) {\n <cw-icon [icon]=\"withIcon()\" [iconSize]=\"iconSizeEnum['2xs']\"></cw-icon>\n }\n</div>\n", dependencies: [{ kind: "component", type: IconComponent, selector: "cw-icon", inputs: ["icon", "label", "type", "iconSize", "iconCssClass", "iconUiType", "iconColorCustom", "spritePath"] }, { kind: "pipe", type: TranslatePipe, name: "translate" }] }); }
|
|
1159
1153
|
}
|
|
1160
1154
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.19", ngImport: i0, type: BadgeComponent, decorators: [{
|
|
1161
1155
|
type: Component,
|
|
1162
|
-
args: [{ selector: 'cw-badge', standalone: true, imports: [IconComponent, TranslatePipe], template: "<div [class]=\"'badge badge-' + type + ' '+ cssClass\" [attr.data-test-ctw]=\"dataTest ? dataTest : null\">\
|
|
1163
|
-
}],
|
|
1164
|
-
type: Input
|
|
1165
|
-
}], label: [{
|
|
1166
|
-
type: Input
|
|
1167
|
-
}], withIcon: [{
|
|
1168
|
-
type: Input
|
|
1169
|
-
}], iconPosition: [{
|
|
1170
|
-
type: Input
|
|
1171
|
-
}], cssClass: [{
|
|
1172
|
-
type: Input
|
|
1173
|
-
}], skeletonMode: [{
|
|
1174
|
-
type: Input
|
|
1175
|
-
}], dataTest: [{
|
|
1176
|
-
type: Input
|
|
1177
|
-
}], hostClasses: [{
|
|
1156
|
+
args: [{ selector: 'cw-badge', standalone: true, imports: [IconComponent, TranslatePipe], template: "<div [class]=\"'badge badge-' + type() + ' '+ cssClass()\" [attr.data-test-ctw]=\"dataTest() ? dataTest() : null\">\n\n @if (withIcon() && iconPosition() === badgePositionEnum.left) {\n <cw-icon [icon]=\"withIcon()\" [iconSize]=\"iconSizeEnum['2xs']\"></cw-icon>\n }\n\n @if (label()) {\n {{ label() | translate }}\n }\n\n @if (withIcon() && iconPosition() === badgePositionEnum.right) {\n <cw-icon [icon]=\"withIcon()\" [iconSize]=\"iconSizeEnum['2xs']\"></cw-icon>\n }\n</div>\n" }]
|
|
1157
|
+
}], propDecorators: { type: [{ type: i0.Input, args: [{ isSignal: true, alias: "type", required: true }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], withIcon: [{ type: i0.Input, args: [{ isSignal: true, alias: "withIcon", required: false }] }], iconPosition: [{ type: i0.Input, args: [{ isSignal: true, alias: "iconPosition", required: false }] }], cssClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "cssClass", required: false }] }], skeletonMode: [{ type: i0.Input, args: [{ isSignal: true, alias: "skeletonMode", required: false }] }], dataTest: [{ type: i0.Input, args: [{ isSignal: true, alias: "dataTest", required: false }] }], hostClasses: [{
|
|
1178
1158
|
type: HostBinding,
|
|
1179
1159
|
args: ['class']
|
|
1180
1160
|
}] } });
|
|
@@ -1762,6 +1742,7 @@ class FormFieldComponent {
|
|
|
1762
1742
|
this.isDisabled = false;
|
|
1763
1743
|
this.skeletonMode = false;
|
|
1764
1744
|
this.clearable = true;
|
|
1745
|
+
this.appendTo = 'body';
|
|
1765
1746
|
this.refreshEvent = new EventEmitter();
|
|
1766
1747
|
this.textChanged = new EventEmitter();
|
|
1767
1748
|
this.valueChange = new EventEmitter();
|
|
@@ -1920,7 +1901,7 @@ class FormFieldComponent {
|
|
|
1920
1901
|
this.formControl.markAsTouched();
|
|
1921
1902
|
}
|
|
1922
1903
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.19", ngImport: i0, type: FormFieldComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1923
|
-
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" }, 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=\"body\" 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 || placeholder }}\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=\"body\" 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" }] }); }
|
|
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" }] }); }
|
|
1924
1905
|
}
|
|
1925
1906
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.19", ngImport: i0, type: FormFieldComponent, decorators: [{
|
|
1926
1907
|
type: Component,
|
|
@@ -1934,7 +1915,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.19", ngImpo
|
|
|
1934
1915
|
ShowHidePasswordDirective,
|
|
1935
1916
|
IconComponent,
|
|
1936
1917
|
ButtonComponent
|
|
1937
|
-
], 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=\"body\" 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 || placeholder }}\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=\"body\" 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" }]
|
|
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" }]
|
|
1938
1919
|
}], ctorParameters: () => [], propDecorators: { control: [{
|
|
1939
1920
|
type: Input
|
|
1940
1921
|
}], formGroup: [{
|
|
@@ -1979,6 +1960,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.19", ngImpo
|
|
|
1979
1960
|
type: Input
|
|
1980
1961
|
}], clearable: [{
|
|
1981
1962
|
type: Input
|
|
1963
|
+
}], appendTo: [{
|
|
1964
|
+
type: Input
|
|
1982
1965
|
}], refreshEvent: [{
|
|
1983
1966
|
type: Output
|
|
1984
1967
|
}], textChanged: [{
|
|
@@ -2005,11 +1988,12 @@ var LegendTypeEnum;
|
|
|
2005
1988
|
|
|
2006
1989
|
class LegendComponent {
|
|
2007
1990
|
constructor() {
|
|
2008
|
-
this.
|
|
1991
|
+
this.legend = input.required(...(ngDevMode ? [{ debugName: "legend" }] : []));
|
|
1992
|
+
this.displayInline = input(false, ...(ngDevMode ? [{ debugName: "displayInline" }] : []));
|
|
2009
1993
|
this.legendTypeEnum = LegendTypeEnum;
|
|
2010
1994
|
}
|
|
2011
1995
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.19", ngImport: i0, type: LegendComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2012
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.19", type: LegendComponent, isStandalone: true, selector: "cw-legend", inputs: { legend: "legend", displayInline: "displayInline" }, ngImport: i0, template: "@if (legend.title) {\
|
|
1996
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.19", type: LegendComponent, isStandalone: true, selector: "cw-legend", inputs: { legend: { classPropertyName: "legend", publicName: "legend", isSignal: true, isRequired: true, transformFunction: null }, displayInline: { classPropertyName: "displayInline", publicName: "displayInline", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "@if (legend().title) {\n <div class=\"legend-title\">\n {{ '_COMMON._TABLE.LEGEND' | translate }}\n </div>\n}\n\n<ul class=\"legend-items\" [class.list-inline]=\"displayInline()\">\n @for (item of legend().data; track $index) {\n <li class=\"legend-item\" [class.list-inline-item]=\"displayInline()\">\n @switch (item.type) {\n @case (legendTypeEnum.icon) {\n <cw-icon [icon]=\"item.icon\" [label]=\"item.label\" [iconCssClass]=\"'text-' + item.colorUi\" [iconColorCustom]=\"item.colorCustom\"></cw-icon>\n }\n @case (legendTypeEnum.badge) {\n <cw-badge [type]=\"item.colorBadge\" [label]=\"item.labelBadge\"></cw-badge>\n {{item.label}}\n }\n @case (legendTypeEnum.color) {\n <span class=\"legend-item-color\" [ngClass]=\"item.colorUi ?'legend-' + item.colorUi : ''\" [style.background-color]=\"item.colorCustom\"></span>\n {{item.label}}\n }\n }\n </li>\n }\n</ul>\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "component", type: IconComponent, selector: "cw-icon", inputs: ["icon", "label", "type", "iconSize", "iconCssClass", "iconUiType", "iconColorCustom", "spritePath"] }, { kind: "component", type: BadgeComponent, selector: "cw-badge", inputs: ["type", "label", "withIcon", "iconPosition", "cssClass", "skeletonMode", "dataTest"] }, { kind: "ngmodule", type: TranslateModule }, { kind: "pipe", type: i2.TranslatePipe, name: "translate" }] }); }
|
|
2013
1997
|
}
|
|
2014
1998
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.19", ngImport: i0, type: LegendComponent, decorators: [{
|
|
2015
1999
|
type: Component,
|
|
@@ -2018,12 +2002,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.19", ngImpo
|
|
|
2018
2002
|
IconComponent,
|
|
2019
2003
|
BadgeComponent,
|
|
2020
2004
|
TranslateModule
|
|
2021
|
-
], template: "@if (legend.title) {\
|
|
2022
|
-
}],
|
|
2023
|
-
type: Input
|
|
2024
|
-
}], displayInline: [{
|
|
2025
|
-
type: Input
|
|
2026
|
-
}] } });
|
|
2005
|
+
], template: "@if (legend().title) {\n <div class=\"legend-title\">\n {{ '_COMMON._TABLE.LEGEND' | translate }}\n </div>\n}\n\n<ul class=\"legend-items\" [class.list-inline]=\"displayInline()\">\n @for (item of legend().data; track $index) {\n <li class=\"legend-item\" [class.list-inline-item]=\"displayInline()\">\n @switch (item.type) {\n @case (legendTypeEnum.icon) {\n <cw-icon [icon]=\"item.icon\" [label]=\"item.label\" [iconCssClass]=\"'text-' + item.colorUi\" [iconColorCustom]=\"item.colorCustom\"></cw-icon>\n }\n @case (legendTypeEnum.badge) {\n <cw-badge [type]=\"item.colorBadge\" [label]=\"item.labelBadge\"></cw-badge>\n {{item.label}}\n }\n @case (legendTypeEnum.color) {\n <span class=\"legend-item-color\" [ngClass]=\"item.colorUi ?'legend-' + item.colorUi : ''\" [style.background-color]=\"item.colorCustom\"></span>\n {{item.label}}\n }\n }\n </li>\n }\n</ul>\n" }]
|
|
2006
|
+
}], propDecorators: { legend: [{ type: i0.Input, args: [{ isSignal: true, alias: "legend", required: true }] }], displayInline: [{ type: i0.Input, args: [{ isSignal: true, alias: "displayInline", required: false }] }] } });
|
|
2027
2007
|
|
|
2028
2008
|
class LoaderComponent {
|
|
2029
2009
|
constructor() { }
|
|
@@ -2070,48 +2050,43 @@ class ModalsService {
|
|
|
2070
2050
|
* Ouvre une modale et retourne un objet compatible avec l'ancienne syntaxe .result
|
|
2071
2051
|
*/
|
|
2072
2052
|
openModal(type, config, sizeOverride) {
|
|
2073
|
-
// 1. Détermination des propriétés de base
|
|
2074
2053
|
const size = sizeOverride ?? this.getModalSizeByType(type);
|
|
2075
2054
|
const isQuickView = type === ModalsType.quickSideView;
|
|
2076
|
-
// 2. Création dynamique du composant
|
|
2077
2055
|
const componentRef = createComponent(ModalsComponent, {
|
|
2078
2056
|
environmentInjector: this.appRef.injector,
|
|
2079
2057
|
elementInjector: this.injector
|
|
2080
2058
|
});
|
|
2081
|
-
|
|
2082
|
-
componentRef.
|
|
2083
|
-
componentRef.
|
|
2084
|
-
componentRef.
|
|
2085
|
-
componentRef.instance.customClass = isQuickView ? 'quick-view-modal' : '';
|
|
2059
|
+
componentRef.setInput('type', type);
|
|
2060
|
+
componentRef.setInput('size', size);
|
|
2061
|
+
componentRef.setInput('scrollable', isQuickView);
|
|
2062
|
+
componentRef.setInput('customClass', isQuickView ? 'quick-view-modal' : '');
|
|
2086
2063
|
if (config) {
|
|
2087
|
-
Object.
|
|
2064
|
+
for (const [key, value] of Object.entries(config)) {
|
|
2065
|
+
if (value !== undefined) {
|
|
2066
|
+
componentRef.setInput(key, value);
|
|
2067
|
+
}
|
|
2068
|
+
}
|
|
2088
2069
|
}
|
|
2089
|
-
// 4. Gestion de la Promesse (le fameux .result)
|
|
2090
2070
|
const resultPromise = new Promise((resolve, reject) => {
|
|
2091
|
-
// Succès : quand le bouton d'action est cliqué
|
|
2092
2071
|
const subAction = componentRef.instance.btnAction1.subscribe((data) => {
|
|
2093
2072
|
subAction.unsubscribe();
|
|
2094
2073
|
resolve(data || 'confirm');
|
|
2095
2074
|
});
|
|
2096
2075
|
const subAction2 = componentRef.instance.btnAction2.subscribe((data) => {
|
|
2097
|
-
|
|
2076
|
+
subAction2.unsubscribe();
|
|
2098
2077
|
resolve(data || 'confirm');
|
|
2099
2078
|
});
|
|
2100
|
-
// Échec/Fermeture : on intercepte la fermeture via dismissModal
|
|
2101
2079
|
const subDismiss = this.dismissModal.subscribe(() => {
|
|
2102
2080
|
subDismiss.unsubscribe();
|
|
2103
2081
|
reject('closed');
|
|
2104
2082
|
});
|
|
2105
2083
|
});
|
|
2106
|
-
// 5. Intégration au DOM
|
|
2107
2084
|
const domElem = componentRef.hostView.rootNodes[0];
|
|
2108
2085
|
document.body.appendChild(domElem);
|
|
2109
2086
|
this.appRef.attachView(componentRef.hostView);
|
|
2110
2087
|
document.body.classList.add('modal-open');
|
|
2111
|
-
// 6. Gestion de la pile et du focus
|
|
2112
2088
|
this.saveFocus();
|
|
2113
2089
|
this.modalsStack.push(componentRef);
|
|
2114
|
-
// Retourne un objet ModalRef
|
|
2115
2090
|
return {
|
|
2116
2091
|
componentInstance: componentRef.instance,
|
|
2117
2092
|
result: resultPromise
|
|
@@ -2123,17 +2098,13 @@ class ModalsService {
|
|
|
2123
2098
|
closeModal() {
|
|
2124
2099
|
const currentModal = this.modalsStack.pop();
|
|
2125
2100
|
if (currentModal) {
|
|
2126
|
-
const modalClass = currentModal.instance.customClass ?? '';
|
|
2127
|
-
// Retrait du DOM
|
|
2101
|
+
const modalClass = currentModal.instance.customClass() ?? '';
|
|
2128
2102
|
this.appRef.detachView(currentModal.hostView);
|
|
2129
2103
|
currentModal.destroy();
|
|
2130
|
-
// Gestion du body
|
|
2131
2104
|
if (this.modalsStack.length === 0) {
|
|
2132
2105
|
document.body.classList.remove('modal-open');
|
|
2133
2106
|
}
|
|
2134
|
-
// Restauration focus
|
|
2135
2107
|
this.restoreFocus();
|
|
2136
|
-
// On émet l'événement (ce qui déclenchera le reject de la promesse plus haut)
|
|
2137
2108
|
this.dismissModal.emit(modalClass);
|
|
2138
2109
|
}
|
|
2139
2110
|
}
|
|
@@ -2175,14 +2146,21 @@ class ModalsComponent {
|
|
|
2175
2146
|
constructor() {
|
|
2176
2147
|
this.modalService = inject(ModalsService);
|
|
2177
2148
|
this.translateService = inject(TranslateService);
|
|
2178
|
-
this.
|
|
2179
|
-
this.
|
|
2180
|
-
this.
|
|
2181
|
-
this.
|
|
2182
|
-
this.
|
|
2183
|
-
this.
|
|
2184
|
-
this.
|
|
2185
|
-
this.
|
|
2149
|
+
this.modalContainer = viewChild.required('modalContainer');
|
|
2150
|
+
this.size = input(ModalsSize.md, ...(ngDevMode ? [{ debugName: "size" }] : []));
|
|
2151
|
+
this.customClass = input('', ...(ngDevMode ? [{ debugName: "customClass" }] : []));
|
|
2152
|
+
this.scrollable = input(false, ...(ngDevMode ? [{ debugName: "scrollable" }] : []));
|
|
2153
|
+
this.isAutcompModal = input(false, ...(ngDevMode ? [{ debugName: "isAutcompModal" }] : []));
|
|
2154
|
+
this.type = input.required(...(ngDevMode ? [{ debugName: "type" }] : []));
|
|
2155
|
+
this.modalTitle = input(...(ngDevMode ? [undefined, { debugName: "modalTitle" }] : []));
|
|
2156
|
+
this.itemsToDelete = input([], ...(ngDevMode ? [{ debugName: "itemsToDelete" }] : []));
|
|
2157
|
+
this.itemsToDeleteTitle = input(this.translateService.instant('_COMMON._MODAL_DELETE.DEFAULT_TYPE'), ...(ngDevMode ? [{ debugName: "itemsToDeleteTitle" }] : []));
|
|
2158
|
+
this.labelBtnAction1 = input(...(ngDevMode ? [undefined, { debugName: "labelBtnAction1" }] : []));
|
|
2159
|
+
this.labelBtnAction2 = input(...(ngDevMode ? [undefined, { debugName: "labelBtnAction2" }] : []));
|
|
2160
|
+
this.customBodyTemplate = input(...(ngDevMode ? [undefined, { debugName: "customBodyTemplate" }] : []));
|
|
2161
|
+
this.customBodyContext = input(...(ngDevMode ? [undefined, { debugName: "customBodyContext" }] : []));
|
|
2162
|
+
this.btnAction1 = output();
|
|
2163
|
+
this.btnAction2 = output();
|
|
2186
2164
|
this.modalsType = ModalsType;
|
|
2187
2165
|
this.buttonTypeEnum = { ...FoButtonTypeEnum, ...BoButtonTypeEnum };
|
|
2188
2166
|
this.spriteIcon = SpriteIconEnum;
|
|
@@ -2194,10 +2172,10 @@ class ModalsComponent {
|
|
|
2194
2172
|
this.modalService.openedModal.emit(true);
|
|
2195
2173
|
}
|
|
2196
2174
|
ngAfterViewInit() {
|
|
2197
|
-
setTimeout(() => this.trapFocus(this.modalContainer.nativeElement), 0);
|
|
2175
|
+
setTimeout(() => this.trapFocus(this.modalContainer().nativeElement), 0);
|
|
2198
2176
|
}
|
|
2199
2177
|
onKeyDown(e) {
|
|
2200
|
-
if (this.type === this.modalsType.loader) {
|
|
2178
|
+
if (this.type() === this.modalsType.loader) {
|
|
2201
2179
|
e.preventDefault();
|
|
2202
2180
|
return;
|
|
2203
2181
|
}
|
|
@@ -2229,25 +2207,23 @@ class ModalsComponent {
|
|
|
2229
2207
|
return;
|
|
2230
2208
|
const firstFocusableEl = focusableEls[0];
|
|
2231
2209
|
const lastFocusableEl = focusableEls[focusableEls.length - 1];
|
|
2232
|
-
// Logique Autocomplete peut etre à externaliser ou élargir la notion
|
|
2233
2210
|
const autocompleteInput = focusableEls.find(x => x.getAttribute('aria-controls') === 'autocompletion-panel');
|
|
2234
|
-
if (autocompleteInput && this.isAutcompModal) {
|
|
2211
|
+
if (autocompleteInput && this.isAutcompModal()) {
|
|
2235
2212
|
autocompleteInput.focus();
|
|
2236
2213
|
}
|
|
2237
2214
|
else {
|
|
2238
2215
|
firstFocusableEl.focus();
|
|
2239
2216
|
}
|
|
2240
|
-
// Listener pour le Tab (on l'attache au container)
|
|
2241
2217
|
element.addEventListener('keydown', (e) => {
|
|
2242
2218
|
if (e.key !== 'Tab')
|
|
2243
2219
|
return;
|
|
2244
|
-
if (e.shiftKey) {
|
|
2220
|
+
if (e.shiftKey) {
|
|
2245
2221
|
if (document.activeElement === firstFocusableEl) {
|
|
2246
2222
|
lastFocusableEl.focus();
|
|
2247
2223
|
e.preventDefault();
|
|
2248
2224
|
}
|
|
2249
2225
|
}
|
|
2250
|
-
else {
|
|
2226
|
+
else {
|
|
2251
2227
|
if (document.activeElement === lastFocusableEl) {
|
|
2252
2228
|
firstFocusableEl.focus();
|
|
2253
2229
|
e.preventDefault();
|
|
@@ -2256,55 +2232,26 @@ class ModalsComponent {
|
|
|
2256
2232
|
});
|
|
2257
2233
|
}
|
|
2258
2234
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.19", ngImport: i0, type: ModalsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2259
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.19", type: ModalsComponent, isStandalone: true, selector: "cw-modals", inputs: { size: "size", customClass: "customClass", scrollable: "scrollable", isAutcompModal: "isAutcompModal", type: "type", modalTitle: "modalTitle", itemsToDelete: "itemsToDelete", itemsToDeleteTitle: "itemsToDeleteTitle", labelBtnAction1: "labelBtnAction1", labelBtnAction2: "labelBtnAction2", customBodyTemplate: "customBodyTemplate", customBodyContext: "customBodyContext" }, outputs: { btnAction1: "btnAction1", btnAction2: "btnAction2" }, viewQueries: [{ propertyName: "modalContainer", first: true, predicate: ["modalContainer"], descendants: true }], ngImport: i0, template: "<div class=\"cityway-v8 modal-backdrop fade show\" style=\"z-index: 1050;\" aria-hidden=\"true\"></div>\
|
|
2235
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.19", type: ModalsComponent, isStandalone: true, selector: "cw-modals", inputs: { size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, customClass: { classPropertyName: "customClass", publicName: "customClass", isSignal: true, isRequired: false, transformFunction: null }, scrollable: { classPropertyName: "scrollable", publicName: "scrollable", isSignal: true, isRequired: false, transformFunction: null }, isAutcompModal: { classPropertyName: "isAutcompModal", publicName: "isAutcompModal", isSignal: true, isRequired: false, transformFunction: null }, type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: true, transformFunction: null }, modalTitle: { classPropertyName: "modalTitle", publicName: "modalTitle", isSignal: true, isRequired: false, transformFunction: null }, itemsToDelete: { classPropertyName: "itemsToDelete", publicName: "itemsToDelete", isSignal: true, isRequired: false, transformFunction: null }, itemsToDeleteTitle: { classPropertyName: "itemsToDeleteTitle", publicName: "itemsToDeleteTitle", isSignal: true, isRequired: false, transformFunction: null }, labelBtnAction1: { classPropertyName: "labelBtnAction1", publicName: "labelBtnAction1", isSignal: true, isRequired: false, transformFunction: null }, labelBtnAction2: { classPropertyName: "labelBtnAction2", publicName: "labelBtnAction2", isSignal: true, isRequired: false, transformFunction: null }, customBodyTemplate: { classPropertyName: "customBodyTemplate", publicName: "customBodyTemplate", isSignal: true, isRequired: false, transformFunction: null }, customBodyContext: { classPropertyName: "customBodyContext", publicName: "customBodyContext", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { btnAction1: "btnAction1", btnAction2: "btnAction2" }, viewQueries: [{ propertyName: "modalContainer", first: true, predicate: ["modalContainer"], descendants: true, isSignal: true }], ngImport: i0, template: "<div class=\"cityway-v8 modal-backdrop fade show\" style=\"z-index: 1050;\" aria-hidden=\"true\"></div>\n\n<div role=\"dialog\" tabindex=\"-1\" aria-modal=\"true\" aria-labelledby=\"modal-basic-title\"\n class=\"cityway-v8 d-flex modal show\" [ngClass]=\"customClass()\" data-test-ctw=\"modal\" (keydown)=\"onKeyDown($event)\">\n\n <div class=\"modal-inner-backdrop\" (click)=\"type() !== modalsType.loader && closeModal()\"></div>\n\n <div #modalContainer role=\"document\" class=\"modal-dialog modal-dialog-centered\"\n [ngClass]=\"['modal-' + size(), scrollable() ? 'modal-dialog-scrollable' : '']\">\n\n <div class=\"modal-content\">\n\n @if (type() !== modalsType.loader) {\n @if (type() == modalsType.delete || type() == modalsType.quickSideView || type() == modalsType.custom) {\n <div class=\"modal-header\">\n @if (type() === modalsType.delete) {\n <h1 class=\"modal-title\" id=\"modal-basic-title\">\n {{ '_COMMON._MODAL_DELETE.TITLE' | translate: { number: itemsToDelete().length, name: itemsToDeleteTitle() | translate } }}\n </h1>\n }\n @else {\n <h1 class=\"modal-title\" id=\"modal-basic-title\">\n {{ modalTitle() | translate }}\n </h1>\n }\n\n <cw-button [label]=\"'_COMMON._ACTION.CLOSE' | translate\" [type]=\"buttonTypeEnum.light\" [withOnlyIcon]=\"true\"\n [withIcon]=\"spriteIcon.toolbarClose\" (btnAction)=\"closeModal()\" dataTest=\"btn-close-modal\"\n cssClass=\"btn-close\">\n </cw-button>\n </div>\n\n <div class=\"modal-body\">\n @if (type() === modalsType.delete) {\n @if (itemsToDelete().length === 1) {\n <div [innerHTML]=\"'_COMMON._MODAL_DELETE.SIMPLE_TEXT' | translate\"></div>\n }\n @if (itemsToDelete().length > 1) {\n <div [innerHTML]=\"'_COMMON._MODAL_DELETE.MULTIPLE_TEXT' | translate\"></div>\n }\n @if (itemsToDelete().length > 0) {\n <ul class=\"mb-none\">\n @for (item of itemsToDelete(); track item) {\n <li>{{ item }}</li>\n }\n </ul>\n }\n }\n @else {\n @if (customBodyTemplate()) {\n <ng-container [ngTemplateOutlet]=\"customBodyTemplate()\" [ngTemplateOutletContext]=\"customBodyContext()\">\n </ng-container>\n }\n }\n </div>\n }\n @else {\n <div class=\"modal-header justify-content-end\">\n <cw-button [label]=\"'_COMMON._ACTION.CLOSE' | translate\" [type]=\"buttonTypeEnum.light\" [withOnlyIcon]=\"true\"\n [withIcon]=\"spriteIcon.toolbarClose\" (btnAction)=\"closeModal()\" dataTest=\"btn-close-modal\"\n cssClass=\"btn-close\">\n </cw-button>\n </div>\n <div class=\"modal-body\">\n <cw-icon [label]=\"'Sucess'\" [iconSize]=\"iconSize['5xl']\" [icon]=\"spriteIcon.toolbarClose\" [type]=\"iconType.rounded\" [iconUiType]=\"iconUiType.success\"></cw-icon>\n\n <h1 class=\"modal-title\" id=\"modal-basic-title\">\n {{ modalTitle() | translate }}\n </h1>\n\n @if (customBodyTemplate()) {\n <ng-container [ngTemplateOutlet]=\"customBodyTemplate()\" [ngTemplateOutletContext]=\"customBodyContext()\">\n </ng-container>\n }\n </div>\n }\n\n <div class=\"modal-footer\">\n @if (type() === modalsType.delete) {\n <cw-button label=\"_COMMON._ACTION.DELETE\" [type]=\"buttonTypeEnum.danger\" [isMinWidth]=\"true\"\n (btnAction)=\"action1Click()\" dataTest=\"btn-action-modal\">\n </cw-button>\n\n <cw-button label=\"_COMMON._ACTION.CLOSE\" [type]=\"buttonTypeEnum.secondary\" [isMinWidth]=\"true\"\n (btnAction)=\"closeModal()\" dataTest=\"btn-close-modal\">\n </cw-button>\n }\n @else {\n @if (labelBtnAction1()) {\n <cw-button [label]=\"labelBtnAction1()\" [type]=\"buttonTypeEnum.primary\" [isMinWidth]=\"true\"\n (btnAction)=\"action1Click()\" dataTest=\"btn-action-modal\">\n </cw-button>\n }\n @if (labelBtnAction2()) {\n <cw-button [label]=\"labelBtnAction2()\" [type]=\"buttonTypeEnum.secondary\" [isMinWidth]=\"true\"\n (btnAction)=\"action2Click()\" dataTest=\"btn-action-modal\">\n </cw-button>\n }\n @else {\n <cw-button label=\"_COMMON._ACTION.CLOSE\" [type]=\"buttonTypeEnum.secondary\" [isMinWidth]=\"true\"\n (btnAction)=\"closeModal()\" dataTest=\"btn-close-modal\">\n </cw-button>\n }\n }\n </div>\n }\n @else {\n <div class=\"modal-body\">\n <cw-loader></cw-loader>\n </div>\n }\n\n </div>\n </div>\n</div>\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "ngmodule", type: TranslateModule }, { kind: "component", type: ButtonComponent, selector: "cw-button", inputs: ["type", "label", "id", "isDropdown", "withIcon", "withOnlyIcon", "iconSize", "iconPosition", "dropdownPosition", "isMinWidth", "isDisabled", "isLoading", "cssClass", "dataTest", "skeletonMode", "withTooltip", "tooltipText", "tooltipTitle", "tooltipTrigger", "tooltipPosition", "tooltipType"], outputs: ["btnAction", "dropDownClicked"] }, { kind: "component", type: LoaderComponent, selector: "cw-loader" }, { kind: "component", type: IconComponent, selector: "cw-icon", inputs: ["icon", "label", "type", "iconSize", "iconCssClass", "iconUiType", "iconColorCustom", "spritePath"] }, { kind: "pipe", type: i2.TranslatePipe, name: "translate" }] }); }
|
|
2260
2236
|
}
|
|
2261
2237
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.19", ngImport: i0, type: ModalsComponent, decorators: [{
|
|
2262
2238
|
type: Component,
|
|
2263
|
-
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>\
|
|
2264
|
-
}], propDecorators: { modalContainer: [{
|
|
2265
|
-
type: ViewChild,
|
|
2266
|
-
args: ['modalContainer']
|
|
2267
|
-
}], size: [{
|
|
2268
|
-
type: Input
|
|
2269
|
-
}], customClass: [{
|
|
2270
|
-
type: Input
|
|
2271
|
-
}], scrollable: [{
|
|
2272
|
-
type: Input
|
|
2273
|
-
}], isAutcompModal: [{
|
|
2274
|
-
type: Input
|
|
2275
|
-
}], type: [{
|
|
2276
|
-
type: Input
|
|
2277
|
-
}], modalTitle: [{
|
|
2278
|
-
type: Input
|
|
2279
|
-
}], itemsToDelete: [{
|
|
2280
|
-
type: Input
|
|
2281
|
-
}], itemsToDeleteTitle: [{
|
|
2282
|
-
type: Input
|
|
2283
|
-
}], labelBtnAction1: [{
|
|
2284
|
-
type: Input
|
|
2285
|
-
}], labelBtnAction2: [{
|
|
2286
|
-
type: Input
|
|
2287
|
-
}], customBodyTemplate: [{
|
|
2288
|
-
type: Input
|
|
2289
|
-
}], customBodyContext: [{
|
|
2290
|
-
type: Input
|
|
2291
|
-
}], btnAction1: [{
|
|
2292
|
-
type: Output
|
|
2293
|
-
}], btnAction2: [{
|
|
2294
|
-
type: Output
|
|
2295
|
-
}] } });
|
|
2239
|
+
args: [{ selector: 'cw-modals', standalone: true, imports: [CommonModule, TranslateModule, NgClass, NgTemplateOutlet, ButtonComponent, LoaderComponent, IconComponent], template: "<div class=\"cityway-v8 modal-backdrop fade show\" style=\"z-index: 1050;\" aria-hidden=\"true\"></div>\n\n<div role=\"dialog\" tabindex=\"-1\" aria-modal=\"true\" aria-labelledby=\"modal-basic-title\"\n class=\"cityway-v8 d-flex modal show\" [ngClass]=\"customClass()\" data-test-ctw=\"modal\" (keydown)=\"onKeyDown($event)\">\n\n <div class=\"modal-inner-backdrop\" (click)=\"type() !== modalsType.loader && closeModal()\"></div>\n\n <div #modalContainer role=\"document\" class=\"modal-dialog modal-dialog-centered\"\n [ngClass]=\"['modal-' + size(), scrollable() ? 'modal-dialog-scrollable' : '']\">\n\n <div class=\"modal-content\">\n\n @if (type() !== modalsType.loader) {\n @if (type() == modalsType.delete || type() == modalsType.quickSideView || type() == modalsType.custom) {\n <div class=\"modal-header\">\n @if (type() === modalsType.delete) {\n <h1 class=\"modal-title\" id=\"modal-basic-title\">\n {{ '_COMMON._MODAL_DELETE.TITLE' | translate: { number: itemsToDelete().length, name: itemsToDeleteTitle() | translate } }}\n </h1>\n }\n @else {\n <h1 class=\"modal-title\" id=\"modal-basic-title\">\n {{ modalTitle() | translate }}\n </h1>\n }\n\n <cw-button [label]=\"'_COMMON._ACTION.CLOSE' | translate\" [type]=\"buttonTypeEnum.light\" [withOnlyIcon]=\"true\"\n [withIcon]=\"spriteIcon.toolbarClose\" (btnAction)=\"closeModal()\" dataTest=\"btn-close-modal\"\n cssClass=\"btn-close\">\n </cw-button>\n </div>\n\n <div class=\"modal-body\">\n @if (type() === modalsType.delete) {\n @if (itemsToDelete().length === 1) {\n <div [innerHTML]=\"'_COMMON._MODAL_DELETE.SIMPLE_TEXT' | translate\"></div>\n }\n @if (itemsToDelete().length > 1) {\n <div [innerHTML]=\"'_COMMON._MODAL_DELETE.MULTIPLE_TEXT' | translate\"></div>\n }\n @if (itemsToDelete().length > 0) {\n <ul class=\"mb-none\">\n @for (item of itemsToDelete(); track item) {\n <li>{{ item }}</li>\n }\n </ul>\n }\n }\n @else {\n @if (customBodyTemplate()) {\n <ng-container [ngTemplateOutlet]=\"customBodyTemplate()\" [ngTemplateOutletContext]=\"customBodyContext()\">\n </ng-container>\n }\n }\n </div>\n }\n @else {\n <div class=\"modal-header justify-content-end\">\n <cw-button [label]=\"'_COMMON._ACTION.CLOSE' | translate\" [type]=\"buttonTypeEnum.light\" [withOnlyIcon]=\"true\"\n [withIcon]=\"spriteIcon.toolbarClose\" (btnAction)=\"closeModal()\" dataTest=\"btn-close-modal\"\n cssClass=\"btn-close\">\n </cw-button>\n </div>\n <div class=\"modal-body\">\n <cw-icon [label]=\"'Sucess'\" [iconSize]=\"iconSize['5xl']\" [icon]=\"spriteIcon.toolbarClose\" [type]=\"iconType.rounded\" [iconUiType]=\"iconUiType.success\"></cw-icon>\n\n <h1 class=\"modal-title\" id=\"modal-basic-title\">\n {{ modalTitle() | translate }}\n </h1>\n\n @if (customBodyTemplate()) {\n <ng-container [ngTemplateOutlet]=\"customBodyTemplate()\" [ngTemplateOutletContext]=\"customBodyContext()\">\n </ng-container>\n }\n </div>\n }\n\n <div class=\"modal-footer\">\n @if (type() === modalsType.delete) {\n <cw-button label=\"_COMMON._ACTION.DELETE\" [type]=\"buttonTypeEnum.danger\" [isMinWidth]=\"true\"\n (btnAction)=\"action1Click()\" dataTest=\"btn-action-modal\">\n </cw-button>\n\n <cw-button label=\"_COMMON._ACTION.CLOSE\" [type]=\"buttonTypeEnum.secondary\" [isMinWidth]=\"true\"\n (btnAction)=\"closeModal()\" dataTest=\"btn-close-modal\">\n </cw-button>\n }\n @else {\n @if (labelBtnAction1()) {\n <cw-button [label]=\"labelBtnAction1()\" [type]=\"buttonTypeEnum.primary\" [isMinWidth]=\"true\"\n (btnAction)=\"action1Click()\" dataTest=\"btn-action-modal\">\n </cw-button>\n }\n @if (labelBtnAction2()) {\n <cw-button [label]=\"labelBtnAction2()\" [type]=\"buttonTypeEnum.secondary\" [isMinWidth]=\"true\"\n (btnAction)=\"action2Click()\" dataTest=\"btn-action-modal\">\n </cw-button>\n }\n @else {\n <cw-button label=\"_COMMON._ACTION.CLOSE\" [type]=\"buttonTypeEnum.secondary\" [isMinWidth]=\"true\"\n (btnAction)=\"closeModal()\" dataTest=\"btn-close-modal\">\n </cw-button>\n }\n }\n </div>\n }\n @else {\n <div class=\"modal-body\">\n <cw-loader></cw-loader>\n </div>\n }\n\n </div>\n </div>\n</div>\n" }]
|
|
2240
|
+
}], propDecorators: { modalContainer: [{ type: i0.ViewChild, args: ['modalContainer', { isSignal: true }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], customClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "customClass", required: false }] }], scrollable: [{ type: i0.Input, args: [{ isSignal: true, alias: "scrollable", required: false }] }], isAutcompModal: [{ type: i0.Input, args: [{ isSignal: true, alias: "isAutcompModal", required: false }] }], type: [{ type: i0.Input, args: [{ isSignal: true, alias: "type", required: true }] }], modalTitle: [{ type: i0.Input, args: [{ isSignal: true, alias: "modalTitle", required: false }] }], itemsToDelete: [{ type: i0.Input, args: [{ isSignal: true, alias: "itemsToDelete", required: false }] }], itemsToDeleteTitle: [{ type: i0.Input, args: [{ isSignal: true, alias: "itemsToDeleteTitle", required: false }] }], labelBtnAction1: [{ type: i0.Input, args: [{ isSignal: true, alias: "labelBtnAction1", required: false }] }], labelBtnAction2: [{ type: i0.Input, args: [{ isSignal: true, alias: "labelBtnAction2", required: false }] }], customBodyTemplate: [{ type: i0.Input, args: [{ isSignal: true, alias: "customBodyTemplate", required: false }] }], customBodyContext: [{ type: i0.Input, args: [{ isSignal: true, alias: "customBodyContext", required: false }] }], btnAction1: [{ type: i0.Output, args: ["btnAction1"] }], btnAction2: [{ type: i0.Output, args: ["btnAction2"] }] } });
|
|
2296
2241
|
|
|
2297
2242
|
class TabContentComponent {
|
|
2298
2243
|
constructor() {
|
|
2299
|
-
this.
|
|
2244
|
+
this.title = input.required(...(ngDevMode ? [{ debugName: "title" }] : []));
|
|
2245
|
+
this.disabled = input(false, ...(ngDevMode ? [{ debugName: "disabled" }] : []));
|
|
2246
|
+
this.withIcon = input(...(ngDevMode ? [undefined, { debugName: "withIcon" }] : []));
|
|
2300
2247
|
this.id = 0;
|
|
2301
2248
|
this.active = false;
|
|
2302
2249
|
}
|
|
2303
2250
|
get fragment() {
|
|
2304
|
-
return UtilsHelper.slugify(this.title);
|
|
2251
|
+
return UtilsHelper.slugify(this.title());
|
|
2305
2252
|
}
|
|
2306
2253
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.19", ngImport: i0, type: TabContentComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2307
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "
|
|
2254
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "20.3.19", type: TabContentComponent, isStandalone: true, selector: "cw-tab-content", inputs: { title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: true, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, withIcon: { classPropertyName: "withIcon", publicName: "withIcon", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: `
|
|
2308
2255
|
<div class="tab-pane"
|
|
2309
2256
|
[class.fade]="!active"
|
|
2310
2257
|
[class.active]="active"
|
|
@@ -2335,13 +2282,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.19", ngImpo
|
|
|
2335
2282
|
`,
|
|
2336
2283
|
standalone: true
|
|
2337
2284
|
}]
|
|
2338
|
-
}], propDecorators: { title: [{
|
|
2339
|
-
type: Input
|
|
2340
|
-
}], disabled: [{
|
|
2341
|
-
type: Input
|
|
2342
|
-
}], withIcon: [{
|
|
2343
|
-
type: Input
|
|
2344
|
-
}] } });
|
|
2285
|
+
}], propDecorators: { title: [{ type: i0.Input, args: [{ isSignal: true, alias: "title", required: true }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], withIcon: [{ type: i0.Input, args: [{ isSignal: true, alias: "withIcon", required: false }] }] } });
|
|
2345
2286
|
|
|
2346
2287
|
var FoTabTypeEnum;
|
|
2347
2288
|
(function (FoTabTypeEnum) {
|
|
@@ -2355,30 +2296,34 @@ var BoTabTypeEnum;
|
|
|
2355
2296
|
})(BoTabTypeEnum || (BoTabTypeEnum = {}));
|
|
2356
2297
|
|
|
2357
2298
|
class TabComponent {
|
|
2358
|
-
constructor(
|
|
2359
|
-
this.router =
|
|
2360
|
-
this.route =
|
|
2361
|
-
this.type = FoTabTypeEnum.defaultMd;
|
|
2362
|
-
this.
|
|
2363
|
-
this.
|
|
2364
|
-
this.
|
|
2365
|
-
this.
|
|
2299
|
+
constructor() {
|
|
2300
|
+
this.router = inject(Router);
|
|
2301
|
+
this.route = inject(ActivatedRoute);
|
|
2302
|
+
this.type = input(FoTabTypeEnum.defaultMd, ...(ngDevMode ? [{ debugName: "type" }] : []));
|
|
2303
|
+
this.id = input(...(ngDevMode ? [undefined, { debugName: "id" }] : []));
|
|
2304
|
+
this.useFragment = input(true, ...(ngDevMode ? [{ debugName: "useFragment" }] : []));
|
|
2305
|
+
this.title = input(...(ngDevMode ? [undefined, { debugName: "title" }] : []));
|
|
2306
|
+
this.tabContentCssClass = input('', ...(ngDevMode ? [{ debugName: "tabContentCssClass" }] : []));
|
|
2307
|
+
this.activeTabIndex = input(0, ...(ngDevMode ? [{ debugName: "activeTabIndex" }] : []));
|
|
2308
|
+
this.tabs = contentChildren(TabContentComponent, ...(ngDevMode ? [{ debugName: "tabs" }] : []));
|
|
2309
|
+
this.tabLinks = viewChildren('tabLink', ...(ngDevMode ? [{ debugName: "tabLinks" }] : []));
|
|
2310
|
+
this.tabChanged = output();
|
|
2366
2311
|
this.activeId = 0;
|
|
2367
2312
|
this.iconSize = IconSizeEnum['md'];
|
|
2368
2313
|
this.tabTypeEnum = FoTabTypeEnum && BoTabTypeEnum;
|
|
2369
2314
|
}
|
|
2370
2315
|
ngAfterContentInit() {
|
|
2371
|
-
const tabsArray = this.tabs
|
|
2316
|
+
const tabsArray = [...this.tabs()];
|
|
2372
2317
|
tabsArray.forEach((tab, index) => {
|
|
2373
2318
|
tab.id = index;
|
|
2374
2319
|
tab.active = false;
|
|
2375
2320
|
});
|
|
2376
|
-
const firstActiveIndex = tabsArray.findIndex(t => !t.disabled);
|
|
2377
|
-
this.activeId = this.activeTabIndex ?? (firstActiveIndex !== -1 ? firstActiveIndex : 0);
|
|
2378
|
-
if (this.useFragment) {
|
|
2321
|
+
const firstActiveIndex = tabsArray.findIndex(t => !t.disabled());
|
|
2322
|
+
this.activeId = this.activeTabIndex() ?? (firstActiveIndex !== -1 ? firstActiveIndex : 0);
|
|
2323
|
+
if (this.useFragment()) {
|
|
2379
2324
|
this.route.fragment.subscribe(fragment => {
|
|
2380
2325
|
if (fragment) {
|
|
2381
|
-
const foundIndex = tabsArray.findIndex(tab => tab.fragment === fragment && !tab.disabled);
|
|
2326
|
+
const foundIndex = tabsArray.findIndex(tab => tab.fragment === fragment && !tab.disabled());
|
|
2382
2327
|
if (foundIndex !== -1) {
|
|
2383
2328
|
this.activeId = foundIndex;
|
|
2384
2329
|
}
|
|
@@ -2391,12 +2336,12 @@ class TabComponent {
|
|
|
2391
2336
|
}
|
|
2392
2337
|
}
|
|
2393
2338
|
selectTab(tab) {
|
|
2394
|
-
if (tab.disabled)
|
|
2339
|
+
if (tab.disabled())
|
|
2395
2340
|
return;
|
|
2396
|
-
this.tabs.forEach(t => t.active = false);
|
|
2341
|
+
this.tabs().forEach(t => t.active = false);
|
|
2397
2342
|
tab.active = true;
|
|
2398
2343
|
this.activeId = tab.id;
|
|
2399
|
-
if (this.useFragment) {
|
|
2344
|
+
if (this.useFragment()) {
|
|
2400
2345
|
this.router.navigate([], {
|
|
2401
2346
|
relativeTo: this.route,
|
|
2402
2347
|
fragment: tab.fragment,
|
|
@@ -2407,8 +2352,8 @@ class TabComponent {
|
|
|
2407
2352
|
this.tabChanged.emit(this.activeId);
|
|
2408
2353
|
}
|
|
2409
2354
|
activateTabByIndex(index) {
|
|
2410
|
-
const tab = this.tabs
|
|
2411
|
-
if (tab && !tab.disabled) {
|
|
2355
|
+
const tab = this.tabs()[index];
|
|
2356
|
+
if (tab && !tab.disabled()) {
|
|
2412
2357
|
this.selectTab(tab);
|
|
2413
2358
|
}
|
|
2414
2359
|
}
|
|
@@ -2425,42 +2370,42 @@ class TabComponent {
|
|
|
2425
2370
|
}
|
|
2426
2371
|
}
|
|
2427
2372
|
moveFocus() {
|
|
2428
|
-
this.tabLinks
|
|
2373
|
+
this.tabLinks().forEach((link) => {
|
|
2429
2374
|
if (link.nativeElement.getAttribute('aria-selected') === 'true') {
|
|
2430
2375
|
link.nativeElement.focus();
|
|
2431
2376
|
}
|
|
2432
2377
|
});
|
|
2433
2378
|
}
|
|
2434
2379
|
selectPreviousTab() {
|
|
2435
|
-
const tabsArray = this.tabs
|
|
2380
|
+
const tabsArray = [...this.tabs()];
|
|
2436
2381
|
const activeIndex = tabsArray.findIndex(tab => tab.active);
|
|
2437
2382
|
if (activeIndex !== -1) {
|
|
2438
2383
|
let newIndex = (activeIndex - 1 + tabsArray.length) % tabsArray.length;
|
|
2439
|
-
while (tabsArray[newIndex].disabled && newIndex !== activeIndex) {
|
|
2384
|
+
while (tabsArray[newIndex].disabled() && newIndex !== activeIndex) {
|
|
2440
2385
|
newIndex = (newIndex - 1 + tabsArray.length) % tabsArray.length;
|
|
2441
2386
|
}
|
|
2442
|
-
if (!tabsArray[newIndex].disabled) {
|
|
2387
|
+
if (!tabsArray[newIndex].disabled()) {
|
|
2443
2388
|
this.selectTab(tabsArray[newIndex]);
|
|
2444
2389
|
setTimeout(() => this.moveFocus());
|
|
2445
2390
|
}
|
|
2446
2391
|
}
|
|
2447
2392
|
}
|
|
2448
2393
|
selectNextTab() {
|
|
2449
|
-
const tabsArray = this.tabs
|
|
2394
|
+
const tabsArray = [...this.tabs()];
|
|
2450
2395
|
const activeIndex = tabsArray.findIndex(tab => tab.active);
|
|
2451
2396
|
if (activeIndex !== -1) {
|
|
2452
2397
|
let newIndex = (activeIndex + 1) % tabsArray.length;
|
|
2453
|
-
while (tabsArray[newIndex].disabled && newIndex !== activeIndex) {
|
|
2398
|
+
while (tabsArray[newIndex].disabled() && newIndex !== activeIndex) {
|
|
2454
2399
|
newIndex = (newIndex + 1) % tabsArray.length;
|
|
2455
2400
|
}
|
|
2456
|
-
if (!tabsArray[newIndex].disabled) {
|
|
2401
|
+
if (!tabsArray[newIndex].disabled()) {
|
|
2457
2402
|
this.selectTab(tabsArray[newIndex]);
|
|
2458
2403
|
setTimeout(() => this.moveFocus());
|
|
2459
2404
|
}
|
|
2460
2405
|
}
|
|
2461
2406
|
}
|
|
2462
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.19", ngImport: i0, type: TabComponent, deps: [
|
|
2463
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.19", type: TabComponent, isStandalone: true, selector: "cw-tab", inputs: { type: "type", id: "id", useFragment: "useFragment", title: "title", tabContentCssClass: "tabContentCssClass", activeTabIndex: "activeTabIndex" }, outputs: { tabChanged: "tabChanged" }, queries: [{ propertyName: "tabs", predicate: TabContentComponent }], viewQueries: [{ propertyName: "tabLinks", predicate: ["tabLink"], descendants: true }], ngImport: i0, template: "<div class=\"tab\" [ngClass]=\"'tab-' + type\">\
|
|
2407
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.19", ngImport: i0, type: TabComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2408
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.19", type: TabComponent, isStandalone: true, selector: "cw-tab", inputs: { type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: false, transformFunction: null }, id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null }, useFragment: { classPropertyName: "useFragment", publicName: "useFragment", isSignal: true, isRequired: false, transformFunction: null }, title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: false, transformFunction: null }, tabContentCssClass: { classPropertyName: "tabContentCssClass", publicName: "tabContentCssClass", isSignal: true, isRequired: false, transformFunction: null }, activeTabIndex: { classPropertyName: "activeTabIndex", publicName: "activeTabIndex", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { tabChanged: "tabChanged" }, queries: [{ propertyName: "tabs", predicate: TabContentComponent, isSignal: true }], viewQueries: [{ propertyName: "tabLinks", predicate: ["tabLink"], descendants: true, isSignal: true }], ngImport: i0, template: "<div class=\"tab\" [ngClass]=\"'tab-' + type()\">\n @if (title()) {\n <h2>{{ title() | translate }}</h2>\n }\n <ul class=\"tab-items d-flex-h\" [ngClass]=\"'tab-items-' + type()\" role=\"tablist\" appRwdTabs>\n @for (tab of tabs(); track tab; let i = $index) {\n <li class=\"tab-item\" role=\"presentation\">\n <button #tabLink type=\"button\" class=\"tab-link btn\" [class.active]=\"tab.active\" [class.disabled]=\"tab.disabled()\"\n [disabled]=\"tab.disabled()\" [attr.id]=\"'cw-nav-' + i\" [attr.data-test-ctw]=\"'link-tab-' + id() + '-' + i\"\n [attr.aria-selected]=\"tab.active\" [attr.aria-controls]=\"'cw-nav-' + i + '-panel'\"\n [attr.tabindex]=\"tab.active ? '0' : '-1'\" (click)=\"selectTab(tab)\" (keydown)=\"onKeydown($event)\" role=\"tab\">\n @if (tab.withIcon()) {\n <cw-icon [icon]=\"tab.withIcon()\" [iconSize]=\"iconSize\"></cw-icon>\n }\n {{ tab.title() | translate }}\n </button>\n </li>\n }\n </ul>\n</div>\n\n<div [class]=\"'tab-content ' + tabContentCssClass()\" [ngClass]=\"'tab-content-' + type()\">\n <ng-content></ng-content>\n</div>\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "component", type: IconComponent, selector: "cw-icon", inputs: ["icon", "label", "type", "iconSize", "iconCssClass", "iconUiType", "iconColorCustom", "spritePath"] }, { kind: "ngmodule", type: TranslateModule }, { kind: "pipe", type: i2.TranslatePipe, name: "translate" }] }); }
|
|
2464
2409
|
}
|
|
2465
2410
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.19", ngImport: i0, type: TabComponent, decorators: [{
|
|
2466
2411
|
type: Component,
|
|
@@ -2468,35 +2413,17 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.19", ngImpo
|
|
|
2468
2413
|
CommonModule,
|
|
2469
2414
|
IconComponent,
|
|
2470
2415
|
TranslateModule
|
|
2471
|
-
], template: "<div class=\"tab\" [ngClass]=\"'tab-' + type\">\
|
|
2472
|
-
}],
|
|
2473
|
-
type: Input
|
|
2474
|
-
}], id: [{
|
|
2475
|
-
type: Input
|
|
2476
|
-
}], useFragment: [{
|
|
2477
|
-
type: Input
|
|
2478
|
-
}], title: [{
|
|
2479
|
-
type: Input
|
|
2480
|
-
}], tabContentCssClass: [{
|
|
2481
|
-
type: Input
|
|
2482
|
-
}], activeTabIndex: [{
|
|
2483
|
-
type: Input
|
|
2484
|
-
}], tabs: [{
|
|
2485
|
-
type: ContentChildren,
|
|
2486
|
-
args: [TabContentComponent]
|
|
2487
|
-
}], tabLinks: [{
|
|
2488
|
-
type: ViewChildren,
|
|
2489
|
-
args: ['tabLink']
|
|
2490
|
-
}], tabChanged: [{
|
|
2491
|
-
type: Output
|
|
2492
|
-
}] } });
|
|
2416
|
+
], template: "<div class=\"tab\" [ngClass]=\"'tab-' + type()\">\n @if (title()) {\n <h2>{{ title() | translate }}</h2>\n }\n <ul class=\"tab-items d-flex-h\" [ngClass]=\"'tab-items-' + type()\" role=\"tablist\" appRwdTabs>\n @for (tab of tabs(); track tab; let i = $index) {\n <li class=\"tab-item\" role=\"presentation\">\n <button #tabLink type=\"button\" class=\"tab-link btn\" [class.active]=\"tab.active\" [class.disabled]=\"tab.disabled()\"\n [disabled]=\"tab.disabled()\" [attr.id]=\"'cw-nav-' + i\" [attr.data-test-ctw]=\"'link-tab-' + id() + '-' + i\"\n [attr.aria-selected]=\"tab.active\" [attr.aria-controls]=\"'cw-nav-' + i + '-panel'\"\n [attr.tabindex]=\"tab.active ? '0' : '-1'\" (click)=\"selectTab(tab)\" (keydown)=\"onKeydown($event)\" role=\"tab\">\n @if (tab.withIcon()) {\n <cw-icon [icon]=\"tab.withIcon()\" [iconSize]=\"iconSize\"></cw-icon>\n }\n {{ tab.title() | translate }}\n </button>\n </li>\n }\n </ul>\n</div>\n\n<div [class]=\"'tab-content ' + tabContentCssClass()\" [ngClass]=\"'tab-content-' + type()\">\n <ng-content></ng-content>\n</div>\n" }]
|
|
2417
|
+
}], propDecorators: { type: [{ type: i0.Input, args: [{ isSignal: true, alias: "type", required: false }] }], id: [{ type: i0.Input, args: [{ isSignal: true, alias: "id", required: false }] }], useFragment: [{ type: i0.Input, args: [{ isSignal: true, alias: "useFragment", required: false }] }], title: [{ type: i0.Input, args: [{ isSignal: true, alias: "title", required: false }] }], tabContentCssClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "tabContentCssClass", required: false }] }], activeTabIndex: [{ type: i0.Input, args: [{ isSignal: true, alias: "activeTabIndex", required: false }] }], tabs: [{ type: i0.ContentChildren, args: [i0.forwardRef(() => TabContentComponent), { isSignal: true }] }], tabLinks: [{ type: i0.ViewChildren, args: ['tabLink', { isSignal: true }] }], tabChanged: [{ type: i0.Output, args: ["tabChanged"] }] } });
|
|
2493
2418
|
|
|
2494
2419
|
class WizardStepComponent {
|
|
2495
2420
|
constructor() {
|
|
2496
|
-
this.
|
|
2421
|
+
this.title = input.required(...(ngDevMode ? [{ debugName: "title" }] : []));
|
|
2422
|
+
this.completed = input(false, ...(ngDevMode ? [{ debugName: "completed" }] : []));
|
|
2423
|
+
this.templateRef = viewChild.required('content');
|
|
2497
2424
|
}
|
|
2498
2425
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.19", ngImport: i0, type: WizardStepComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2499
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "
|
|
2426
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "20.3.19", type: WizardStepComponent, isStandalone: true, selector: "cw-wizard-step", inputs: { title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: true, transformFunction: null }, completed: { classPropertyName: "completed", publicName: "completed", isSignal: true, isRequired: false, transformFunction: null } }, viewQueries: [{ propertyName: "templateRef", first: true, predicate: ["content"], descendants: true, isSignal: true }], ngImport: i0, template: '<ng-template #content><ng-content></ng-content></ng-template>', isInline: true }); }
|
|
2500
2427
|
}
|
|
2501
2428
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.19", ngImport: i0, type: WizardStepComponent, decorators: [{
|
|
2502
2429
|
type: Component,
|
|
@@ -2505,43 +2432,37 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.19", ngImpo
|
|
|
2505
2432
|
template: '<ng-template #content><ng-content></ng-content></ng-template>',
|
|
2506
2433
|
standalone: true
|
|
2507
2434
|
}]
|
|
2508
|
-
}], propDecorators: { title: [{
|
|
2509
|
-
type: Input
|
|
2510
|
-
}], completed: [{
|
|
2511
|
-
type: Input
|
|
2512
|
-
}], templateRef: [{
|
|
2513
|
-
type: ViewChild,
|
|
2514
|
-
args: ['content', { static: true }]
|
|
2515
|
-
}] } });
|
|
2435
|
+
}], propDecorators: { title: [{ type: i0.Input, args: [{ isSignal: true, alias: "title", required: true }] }], completed: [{ type: i0.Input, args: [{ isSignal: true, alias: "completed", required: false }] }], templateRef: [{ type: i0.ViewChild, args: ['content', { isSignal: true }] }] } });
|
|
2516
2436
|
|
|
2517
2437
|
class WizardStepperComponent {
|
|
2518
2438
|
constructor() {
|
|
2519
|
-
this.
|
|
2520
|
-
this.
|
|
2521
|
-
this.
|
|
2522
|
-
this.
|
|
2439
|
+
this.steps = contentChildren(WizardStepComponent, ...(ngDevMode ? [{ debugName: "steps" }] : []));
|
|
2440
|
+
this.stepChange = output();
|
|
2441
|
+
this.stepNext = output();
|
|
2442
|
+
this.stepPrevious = output();
|
|
2443
|
+
this.stepEnd = output();
|
|
2523
2444
|
this.selectedIndex = 0;
|
|
2524
2445
|
}
|
|
2525
2446
|
get stepList() {
|
|
2526
|
-
return this.steps
|
|
2447
|
+
return this.steps();
|
|
2527
2448
|
}
|
|
2528
2449
|
goToStep(index) {
|
|
2529
|
-
|
|
2450
|
+
const stepsArr = this.steps();
|
|
2451
|
+
if (index < 0 || index >= stepsArr.length)
|
|
2530
2452
|
return;
|
|
2531
|
-
// Vérifier que toutes les étapes précédentes sont complétées
|
|
2532
2453
|
for (let i = 0; i < index; i++) {
|
|
2533
|
-
if (!
|
|
2534
|
-
return;
|
|
2454
|
+
if (!stepsArr[i].completed()) {
|
|
2455
|
+
return;
|
|
2535
2456
|
}
|
|
2536
2457
|
}
|
|
2537
2458
|
this.selectedIndex = index;
|
|
2538
2459
|
this.stepChange.emit(this.selectedIndex);
|
|
2539
2460
|
}
|
|
2540
2461
|
nextStep() {
|
|
2541
|
-
|
|
2542
|
-
|
|
2543
|
-
|
|
2544
|
-
|
|
2462
|
+
const stepsArr = this.steps();
|
|
2463
|
+
if (this.selectedIndex < stepsArr.length - 1) {
|
|
2464
|
+
const currentStep = stepsArr[this.selectedIndex];
|
|
2465
|
+
if (!currentStep.completed()) {
|
|
2545
2466
|
return;
|
|
2546
2467
|
}
|
|
2547
2468
|
this.selectedIndex++;
|
|
@@ -2563,49 +2484,32 @@ class WizardStepperComponent {
|
|
|
2563
2484
|
}
|
|
2564
2485
|
}
|
|
2565
2486
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.19", ngImport: i0, type: WizardStepperComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2566
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.19", type: WizardStepperComponent, isStandalone: true, selector: "cw-wizard-stepper", outputs: { stepChange: "stepChange", stepNext: "stepNext", stepPrevious: "stepPrevious", stepEnd: "stepEnd" }, queries: [{ propertyName: "steps", predicate: WizardStepComponent }], ngImport: i0, template: "<nav>\
|
|
2487
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.19", type: WizardStepperComponent, isStandalone: true, selector: "cw-wizard-stepper", outputs: { stepChange: "stepChange", stepNext: "stepNext", stepPrevious: "stepPrevious", stepEnd: "stepEnd" }, queries: [{ propertyName: "steps", predicate: WizardStepComponent, isSignal: true }], ngImport: i0, template: "<nav>\n <ul class=\"list-inline step-list\">\n @for (step of steps(); track step; let i = $index) {\n <li class=\"list-inline-item step-item\">\n <button class=\"btn step-button\" [ngClass]=\"{\n 'step-active': selectedIndex === i,\n 'step-completed': step.completed(),\n 'step-current': selectedIndex === i && step.completed() === false\n }\" [disabled]=\"(i > 0 && !steps()[i - 1]?.completed())\" (click)=\"goToStep(i)\" type=\"button\">\n <span class=\"step-indicator bo-icons bo-alert-success\" aria-hidden=\"true\"></span>\n <span class=\"step-label\">\n {{ step.title() || ('_COMMON._STEPPER.STEP' | translate) + (i + 1) }}\n </span>\n </button>\n </li>\n }\n </ul>\n</nav>\n\n@for (step of steps(); track step; let i = $index) {\n <section class=\"tab-pane\" [class.active]=\"selectedIndex === i\" [hidden]=\"selectedIndex !== i\" role=\"tabpanel\">\n <ng-container *ngTemplateOutlet=\"step.templateRef()\"></ng-container>\n </section>\n}\n\n<div class=\"text-center mt-5\">\n <div class=\"btn-group\">\n <button class=\"btn btn-secondary btn-min-width\" (click)=\"previousStep()\" [disabled]=\"selectedIndex === 0\"\n type=\"button\">\n {{ '_COMMON._STEPPER.PREVIOUS_STEP' | translate }}\n </button>\n\n @if (selectedIndex !== steps().length - 1) {\n <button class=\"btn btn-primary btn-min-width\" (click)=\"nextStep()\"\n [disabled]=\"!steps()[selectedIndex]?.completed()\" type=\"button\">\n {{ '_COMMON._STEPPER.NEXT_STEP' | translate }}\n </button>\n }\n @else {\n <button class=\"btn btn-primary btn-min-width\" (click)=\"endWizard()\" type=\"button\">\n {{ '_COMMON._ACTION.END' | translate }}\n </button>\n }\n </div>\n</div>\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "ngmodule", type: TranslateModule }, { kind: "pipe", type: i2.TranslatePipe, name: "translate" }] }); }
|
|
2567
2488
|
}
|
|
2568
2489
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.19", ngImport: i0, type: WizardStepperComponent, decorators: [{
|
|
2569
2490
|
type: Component,
|
|
2570
2491
|
args: [{ selector: 'cw-wizard-stepper', standalone: true, imports: [
|
|
2571
2492
|
CommonModule,
|
|
2572
2493
|
TranslateModule
|
|
2573
|
-
], template: "<nav>\
|
|
2574
|
-
}], propDecorators: { steps: [{
|
|
2575
|
-
type: ContentChildren,
|
|
2576
|
-
args: [WizardStepComponent]
|
|
2577
|
-
}], stepChange: [{
|
|
2578
|
-
type: Output
|
|
2579
|
-
}], stepNext: [{
|
|
2580
|
-
type: Output
|
|
2581
|
-
}], stepPrevious: [{
|
|
2582
|
-
type: Output
|
|
2583
|
-
}], stepEnd: [{
|
|
2584
|
-
type: Output
|
|
2585
|
-
}] } });
|
|
2494
|
+
], template: "<nav>\n <ul class=\"list-inline step-list\">\n @for (step of steps(); track step; let i = $index) {\n <li class=\"list-inline-item step-item\">\n <button class=\"btn step-button\" [ngClass]=\"{\n 'step-active': selectedIndex === i,\n 'step-completed': step.completed(),\n 'step-current': selectedIndex === i && step.completed() === false\n }\" [disabled]=\"(i > 0 && !steps()[i - 1]?.completed())\" (click)=\"goToStep(i)\" type=\"button\">\n <span class=\"step-indicator bo-icons bo-alert-success\" aria-hidden=\"true\"></span>\n <span class=\"step-label\">\n {{ step.title() || ('_COMMON._STEPPER.STEP' | translate) + (i + 1) }}\n </span>\n </button>\n </li>\n }\n </ul>\n</nav>\n\n@for (step of steps(); track step; let i = $index) {\n <section class=\"tab-pane\" [class.active]=\"selectedIndex === i\" [hidden]=\"selectedIndex !== i\" role=\"tabpanel\">\n <ng-container *ngTemplateOutlet=\"step.templateRef()\"></ng-container>\n </section>\n}\n\n<div class=\"text-center mt-5\">\n <div class=\"btn-group\">\n <button class=\"btn btn-secondary btn-min-width\" (click)=\"previousStep()\" [disabled]=\"selectedIndex === 0\"\n type=\"button\">\n {{ '_COMMON._STEPPER.PREVIOUS_STEP' | translate }}\n </button>\n\n @if (selectedIndex !== steps().length - 1) {\n <button class=\"btn btn-primary btn-min-width\" (click)=\"nextStep()\"\n [disabled]=\"!steps()[selectedIndex]?.completed()\" type=\"button\">\n {{ '_COMMON._STEPPER.NEXT_STEP' | translate }}\n </button>\n }\n @else {\n <button class=\"btn btn-primary btn-min-width\" (click)=\"endWizard()\" type=\"button\">\n {{ '_COMMON._ACTION.END' | translate }}\n </button>\n }\n </div>\n</div>\n" }]
|
|
2495
|
+
}], propDecorators: { steps: [{ type: i0.ContentChildren, args: [i0.forwardRef(() => WizardStepComponent), { isSignal: true }] }], stepChange: [{ type: i0.Output, args: ["stepChange"] }], stepNext: [{ type: i0.Output, args: ["stepNext"] }], stepPrevious: [{ type: i0.Output, args: ["stepPrevious"] }], stepEnd: [{ type: i0.Output, args: ["stepEnd"] }] } });
|
|
2586
2496
|
|
|
2587
2497
|
class StepperComponent {
|
|
2588
2498
|
constructor() {
|
|
2589
|
-
this.activeStep = 0;
|
|
2590
|
-
this.steps = [];
|
|
2591
|
-
this.label = 'Étapes de progression'
|
|
2499
|
+
this.activeStep = input(0, ...(ngDevMode ? [{ debugName: "activeStep" }] : []));
|
|
2500
|
+
this.steps = input([], ...(ngDevMode ? [{ debugName: "steps" }] : []));
|
|
2501
|
+
this.label = input('Étapes de progression', ...(ngDevMode ? [{ debugName: "label" }] : []));
|
|
2592
2502
|
}
|
|
2593
2503
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.19", ngImport: i0, type: StepperComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2594
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.19", type: StepperComponent, isStandalone: true, selector: "cw-stepper", inputs: { activeStep: "activeStep", steps: "steps", label: "label" }, ngImport: i0, template: "<ul class=\"stepper\" role=\"list\" [attr.aria-label]=\"label\">\
|
|
2504
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.19", type: StepperComponent, isStandalone: true, selector: "cw-stepper", inputs: { activeStep: { classPropertyName: "activeStep", publicName: "activeStep", isSignal: true, isRequired: false, transformFunction: null }, steps: { classPropertyName: "steps", publicName: "steps", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<ul class=\"stepper\" role=\"list\" [attr.aria-label]=\"label()\">\n @for (step of steps(); track step; let i = $index) {\n <li id=\"step-{{i}}\" class=\"stepper-item\" [ngClass]=\"{\n 'stepper-item-current': i === activeStep(),\n 'stepper-item-completed': i < activeStep()}\"\n [attr.aria-current]=\"i === activeStep() ? 'step' : null\">\n <span class=\"stepper-label\">\n <span class=\"visually-hidden\">{{i + 1}}</span>\n {{step | translate}}\n </span>\n </li>\n }\n</ul>\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "ngmodule", type: TranslateModule }, { kind: "pipe", type: i2.TranslatePipe, name: "translate" }] }); }
|
|
2595
2505
|
}
|
|
2596
2506
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.19", ngImport: i0, type: StepperComponent, decorators: [{
|
|
2597
2507
|
type: Component,
|
|
2598
2508
|
args: [{ selector: 'cw-stepper', standalone: true, imports: [
|
|
2599
2509
|
CommonModule,
|
|
2600
2510
|
TranslateModule
|
|
2601
|
-
], template: "<ul class=\"stepper\" role=\"list\" [attr.aria-label]=\"label\">\
|
|
2602
|
-
}], propDecorators: { activeStep: [{
|
|
2603
|
-
type: Input
|
|
2604
|
-
}], steps: [{
|
|
2605
|
-
type: Input
|
|
2606
|
-
}], label: [{
|
|
2607
|
-
type: Input
|
|
2608
|
-
}] } });
|
|
2511
|
+
], template: "<ul class=\"stepper\" role=\"list\" [attr.aria-label]=\"label()\">\n @for (step of steps(); track step; let i = $index) {\n <li id=\"step-{{i}}\" class=\"stepper-item\" [ngClass]=\"{\n 'stepper-item-current': i === activeStep(),\n 'stepper-item-completed': i < activeStep()}\"\n [attr.aria-current]=\"i === activeStep() ? 'step' : null\">\n <span class=\"stepper-label\">\n <span class=\"visually-hidden\">{{i + 1}}</span>\n {{step | translate}}\n </span>\n </li>\n }\n</ul>\n" }]
|
|
2512
|
+
}], propDecorators: { activeStep: [{ type: i0.Input, args: [{ isSignal: true, alias: "activeStep", required: false }] }], steps: [{ type: i0.Input, args: [{ isSignal: true, alias: "steps", required: false }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }] } });
|
|
2609
2513
|
|
|
2610
2514
|
const FILE_SIZE_UNITS_FR = ['o', 'Ko', 'Mo', 'Go', 'To', 'Po', 'Eo', 'Zo', 'Yo'];
|
|
2611
2515
|
const FILE_SIZE_UNITS_DEFAULT = ['B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'];
|
|
@@ -2636,16 +2540,15 @@ class FileToDownloadComponent {
|
|
|
2636
2540
|
this.iconType = IconTypeEnum;
|
|
2637
2541
|
this.iconSize = IconSizeEnum;
|
|
2638
2542
|
this.spriteIcon = SpriteIconEnum.toolbarDownload;
|
|
2543
|
+
this.attachments = input.required(...(ngDevMode ? [{ debugName: "attachments" }] : []));
|
|
2639
2544
|
}
|
|
2640
2545
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.19", ngImport: i0, type: FileToDownloadComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2641
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.19", type: FileToDownloadComponent, isStandalone: true, selector: "cw-file-to-download", inputs: { attachments: "attachments" }, ngImport: i0, template: "<!-- If one file -->\
|
|
2546
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.19", type: FileToDownloadComponent, isStandalone: true, selector: "cw-file-to-download", inputs: { attachments: { classPropertyName: "attachments", publicName: "attachments", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0, template: "<!-- If one file -->\n@if (attachments().length === 1 ) {\n<ng-container *ngTemplateOutlet=\"file;context:{attachment:attachments()[0]}\"></ng-container>\n}\n\n<!-- If two files or more, li loop -->\n@if (attachments().length > 1) {\n<ul class=\"list-unstyled file-to-download-items\">\n @for (attachment of attachments(); track attachment) {\n <li class=\"file-to-download-list-item\">\n <ng-container *ngTemplateOutlet=\"file;context:{attachment:attachment}\"></ng-container>\n </li>\n }\n</ul>\n}\n\n<ng-template #file let-attachment=\"attachment\">\n <a [href]=\"attachment.url\" class=\"file-to-download-link\" target=\"_blank\">\n <span class=\"file-to-download-name\">\n {{ attachment.label ? attachment.label : ('_SHARED.ATTACHMENT_DEFAULT_LABEL' | translate ) }}\n </span>\n <span class=\"file-to-download-info\">\n @if (attachment.extension && attachment.size) {\n {{attachment.extension.toUpperCase()}} {{attachment.size * 1024 | formatFileSize}}\n }\n <cw-icon [icon]=\"spriteIcon\" font=\"optyweb\" [label]=\"'_COMMON.NEW_WINDOW' |translate\" [type]=\"iconType.default\"\n [iconSize]=\"iconSize['md']\" iconCssClass=\"file-to-download-download\"></cw-icon>\n </span>\n </a>\n</ng-template>\n", dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: IconComponent, selector: "cw-icon", inputs: ["icon", "label", "type", "iconSize", "iconCssClass", "iconUiType", "iconColorCustom", "spritePath"] }, { kind: "pipe", type: TranslatePipe, name: "translate" }, { kind: "pipe", type: FormatFileSizePipe, name: "formatFileSize" }] }); }
|
|
2642
2547
|
}
|
|
2643
2548
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.19", ngImport: i0, type: FileToDownloadComponent, decorators: [{
|
|
2644
2549
|
type: Component,
|
|
2645
|
-
args: [{ selector: 'cw-file-to-download', imports: [NgTemplateOutlet, TranslatePipe, FormatFileSizePipe, IconComponent], template: "<!-- If one file -->\
|
|
2646
|
-
}], propDecorators: { attachments: [{
|
|
2647
|
-
type: Input
|
|
2648
|
-
}] } });
|
|
2550
|
+
args: [{ selector: 'cw-file-to-download', imports: [NgTemplateOutlet, TranslatePipe, FormatFileSizePipe, IconComponent], template: "<!-- If one file -->\n@if (attachments().length === 1 ) {\n<ng-container *ngTemplateOutlet=\"file;context:{attachment:attachments()[0]}\"></ng-container>\n}\n\n<!-- If two files or more, li loop -->\n@if (attachments().length > 1) {\n<ul class=\"list-unstyled file-to-download-items\">\n @for (attachment of attachments(); track attachment) {\n <li class=\"file-to-download-list-item\">\n <ng-container *ngTemplateOutlet=\"file;context:{attachment:attachment}\"></ng-container>\n </li>\n }\n</ul>\n}\n\n<ng-template #file let-attachment=\"attachment\">\n <a [href]=\"attachment.url\" class=\"file-to-download-link\" target=\"_blank\">\n <span class=\"file-to-download-name\">\n {{ attachment.label ? attachment.label : ('_SHARED.ATTACHMENT_DEFAULT_LABEL' | translate ) }}\n </span>\n <span class=\"file-to-download-info\">\n @if (attachment.extension && attachment.size) {\n {{attachment.extension.toUpperCase()}} {{attachment.size * 1024 | formatFileSize}}\n }\n <cw-icon [icon]=\"spriteIcon\" font=\"optyweb\" [label]=\"'_COMMON.NEW_WINDOW' |translate\" [type]=\"iconType.default\"\n [iconSize]=\"iconSize['md']\" iconCssClass=\"file-to-download-download\"></cw-icon>\n </span>\n </a>\n</ng-template>\n" }]
|
|
2551
|
+
}], propDecorators: { attachments: [{ type: i0.Input, args: [{ isSignal: true, alias: "attachments", required: true }] }] } });
|
|
2649
2552
|
|
|
2650
2553
|
var NumericalRangeTypeEnum;
|
|
2651
2554
|
(function (NumericalRangeTypeEnum) {
|
|
@@ -2664,16 +2567,17 @@ var NumericalRangeLabelPositionEnum;
|
|
|
2664
2567
|
|
|
2665
2568
|
class NumericalRangeComponent {
|
|
2666
2569
|
constructor() {
|
|
2667
|
-
this.type = NumericalRangeTypeEnum.defaultGrey;
|
|
2668
|
-
this.label = '';
|
|
2669
|
-
this.amount = 0;
|
|
2670
|
-
this.
|
|
2671
|
-
this.
|
|
2672
|
-
this.
|
|
2673
|
-
this.
|
|
2674
|
-
this.
|
|
2675
|
-
this.
|
|
2676
|
-
this.
|
|
2570
|
+
this.type = input(NumericalRangeTypeEnum.defaultGrey, ...(ngDevMode ? [{ debugName: "type" }] : []));
|
|
2571
|
+
this.label = input('', ...(ngDevMode ? [{ debugName: "label" }] : []));
|
|
2572
|
+
this.amount = model(0, ...(ngDevMode ? [{ debugName: "amount" }] : []));
|
|
2573
|
+
this.withIcon = input(...(ngDevMode ? [undefined, { debugName: "withIcon" }] : []));
|
|
2574
|
+
this.withLabelVisible = input(true, ...(ngDevMode ? [{ debugName: "withLabelVisible" }] : []));
|
|
2575
|
+
this.labelPosition = input(NumericalRangeLabelPositionEnum.inside, ...(ngDevMode ? [{ debugName: "labelPosition" }] : []));
|
|
2576
|
+
this.ceil = input(9, ...(ngDevMode ? [{ debugName: "ceil" }] : []));
|
|
2577
|
+
this.floor = input(0, ...(ngDevMode ? [{ debugName: "floor" }] : []));
|
|
2578
|
+
this.isDisabled = input(false, ...(ngDevMode ? [{ debugName: "isDisabled" }] : []));
|
|
2579
|
+
this.autoChangeAmount = input(true, ...(ngDevMode ? [{ debugName: "autoChangeAmount" }] : []));
|
|
2580
|
+
this.newAmount = output();
|
|
2677
2581
|
this.numericalRangeType = NumericalRangeTypeEnum;
|
|
2678
2582
|
this.iconTypeEnum = IconTypeEnum;
|
|
2679
2583
|
this.iconSize = IconSizeEnum;
|
|
@@ -2684,80 +2588,46 @@ class NumericalRangeComponent {
|
|
|
2684
2588
|
this.uniqueId = `numerical-range-${Math.random().toString(36).slice(2)}`;
|
|
2685
2589
|
}
|
|
2686
2590
|
increaseAmount() {
|
|
2687
|
-
const
|
|
2688
|
-
if (this.autoChangeAmount) {
|
|
2689
|
-
this.amount
|
|
2591
|
+
const next = this.amount() + 1;
|
|
2592
|
+
if (this.autoChangeAmount()) {
|
|
2593
|
+
this.amount.set(next);
|
|
2690
2594
|
}
|
|
2691
|
-
this.newAmount.emit(
|
|
2595
|
+
this.newAmount.emit(next);
|
|
2692
2596
|
}
|
|
2693
2597
|
decreaseAmount() {
|
|
2694
|
-
|
|
2695
|
-
if (this.autoChangeAmount) {
|
|
2696
|
-
this.
|
|
2697
|
-
|
|
2698
|
-
this.amount = this.floor;
|
|
2598
|
+
let next = this.amount() - 1;
|
|
2599
|
+
if (this.autoChangeAmount()) {
|
|
2600
|
+
if (next < this.floor()) {
|
|
2601
|
+
next = this.floor();
|
|
2699
2602
|
}
|
|
2603
|
+
this.amount.set(next);
|
|
2700
2604
|
}
|
|
2701
|
-
this.newAmount.emit(
|
|
2605
|
+
this.newAmount.emit(next);
|
|
2702
2606
|
}
|
|
2703
2607
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.19", ngImport: i0, type: NumericalRangeComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2704
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.19", type: NumericalRangeComponent, isStandalone: true, selector: "cw-numerical-range", inputs: { type: "type", label: "label", amount: "amount", withIcon: "withIcon", withLabelVisible: "withLabelVisible", labelPosition: "labelPosition", ceil: "ceil", floor: "floor", isDisabled: "isDisabled", autoChangeAmount: "autoChangeAmount" }, outputs: { newAmount: "newAmount" }, ngImport: i0, template: "<div class=\"numerical-range text-center\" [ngClass]=\"'numerical-range-' + type\">\
|
|
2608
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.19", type: NumericalRangeComponent, isStandalone: true, selector: "cw-numerical-range", inputs: { type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, amount: { classPropertyName: "amount", publicName: "amount", isSignal: true, isRequired: false, transformFunction: null }, withIcon: { classPropertyName: "withIcon", publicName: "withIcon", isSignal: true, isRequired: false, transformFunction: null }, withLabelVisible: { classPropertyName: "withLabelVisible", publicName: "withLabelVisible", isSignal: true, isRequired: false, transformFunction: null }, labelPosition: { classPropertyName: "labelPosition", publicName: "labelPosition", isSignal: true, isRequired: false, transformFunction: null }, ceil: { classPropertyName: "ceil", publicName: "ceil", isSignal: true, isRequired: false, transformFunction: null }, floor: { classPropertyName: "floor", publicName: "floor", isSignal: true, isRequired: false, transformFunction: null }, isDisabled: { classPropertyName: "isDisabled", publicName: "isDisabled", isSignal: true, isRequired: false, transformFunction: null }, autoChangeAmount: { classPropertyName: "autoChangeAmount", publicName: "autoChangeAmount", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { amount: "amountChange", newAmount: "newAmount" }, ngImport: i0, template: "<div class=\"numerical-range text-center\" [ngClass]=\"'numerical-range-' + type()\">\n\n @if (labelPosition() == labelPositionValue.outside && withLabelVisible()) {\n <div class=\"numerical-range-label\" aria-hidden=\"true\">\n @if (withIcon() && (type() == numericalRangeType.largeWhite || type() == numericalRangeType.largeGrey)) {\n <cw-icon [icon]=\"withIcon()\" [iconSize]=\"iconSize['lg']\"></cw-icon>\n }\n <span>{{ label() }}</span>\n </div>\n }\n\n <div class=\"numerical-range-container\">\n <cw-button [isDisabled]=\"isDisabled() || amount() <= floor()\" [label]=\"'Diminuer ' + amount() + ' ' + label()\"\n [withIcon]=\"spriteIcon.toolbarMinus\" [withOnlyIcon]=\"true\" [type]=\"buttonType.primary\"\n [iconSize]=\"buttonIconSize.small\" (btnAction)=\"decreaseAmount()\">\n </cw-button>\n\n <div class=\"numerical-range-wrapper\">\n <div class=\"numerical-range-amount\" aria-live=\"polite\" aria-atomic=\"true\">\n {{ amount() }}\n @if (!withLabelVisible() && !withIcon()) {\n <span class=\"sr-only\">{{ label() }}</span>\n }\n </div>\n\n @if ((type() !== numericalRangeType.largeGrey && type() !== numericalRangeType.largeWhite) && (withIcon() ||\n withLabelVisible())) {\n <div class=\"numerical-range-label\">\n @if (withLabelVisible() && labelPosition() == labelPositionValue.inside) {\n @if (withIcon()) {\n <cw-icon [icon]=\"withIcon()\" [iconSize]=\"iconSize['lg']\" aria-hidden=\"true\"></cw-icon>\n }\n <span>{{ label() }}</span>\n }\n @else {\n @if (withIcon()) {\n <cw-icon [icon]=\"withIcon()\" [label]=\"label()\" [iconSize]=\"iconSize['lg']\"></cw-icon>\n }\n }\n </div>\n }\n </div>\n\n <cw-button [isDisabled]=\"isDisabled() || amount() >= ceil()\" [label]=\"'Augmenter ' + amount() + ' ' + label()\"\n [withIcon]=\"spriteIcon.toolbarPlus\" [withOnlyIcon]=\"true\" [type]=\"buttonType.primary\"\n [iconSize]=\"buttonIconSize.small\" (btnAction)=\"increaseAmount()\">\n </cw-button>\n </div>\n</div>\n", dependencies: [{ kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "component", type: IconComponent, selector: "cw-icon", inputs: ["icon", "label", "type", "iconSize", "iconCssClass", "iconUiType", "iconColorCustom", "spritePath"] }, { kind: "component", type: ButtonComponent, selector: "cw-button", inputs: ["type", "label", "id", "isDropdown", "withIcon", "withOnlyIcon", "iconSize", "iconPosition", "dropdownPosition", "isMinWidth", "isDisabled", "isLoading", "cssClass", "dataTest", "skeletonMode", "withTooltip", "tooltipText", "tooltipTitle", "tooltipTrigger", "tooltipPosition", "tooltipType"], outputs: ["btnAction", "dropDownClicked"] }] }); }
|
|
2705
2609
|
}
|
|
2706
2610
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.19", ngImport: i0, type: NumericalRangeComponent, decorators: [{
|
|
2707
2611
|
type: Component,
|
|
2708
|
-
args: [{ selector: 'cw-numerical-range', imports: [NgClass, IconComponent, ButtonComponent], standalone: true, template: "<div class=\"numerical-range text-center\" [ngClass]=\"'numerical-range-' + type\">\
|
|
2709
|
-
}], propDecorators: { type: [{
|
|
2710
|
-
type: Input
|
|
2711
|
-
}], label: [{
|
|
2712
|
-
type: Input
|
|
2713
|
-
}], amount: [{
|
|
2714
|
-
type: Input
|
|
2715
|
-
}], withIcon: [{
|
|
2716
|
-
type: Input
|
|
2717
|
-
}], withLabelVisible: [{
|
|
2718
|
-
type: Input
|
|
2719
|
-
}], labelPosition: [{
|
|
2720
|
-
type: Input
|
|
2721
|
-
}], ceil: [{
|
|
2722
|
-
type: Input
|
|
2723
|
-
}], floor: [{
|
|
2724
|
-
type: Input
|
|
2725
|
-
}], isDisabled: [{
|
|
2726
|
-
type: Input
|
|
2727
|
-
}], autoChangeAmount: [{
|
|
2728
|
-
type: Input
|
|
2729
|
-
}], newAmount: [{
|
|
2730
|
-
type: Output
|
|
2731
|
-
}] } });
|
|
2612
|
+
args: [{ selector: 'cw-numerical-range', imports: [NgClass, IconComponent, ButtonComponent], standalone: true, template: "<div class=\"numerical-range text-center\" [ngClass]=\"'numerical-range-' + type()\">\n\n @if (labelPosition() == labelPositionValue.outside && withLabelVisible()) {\n <div class=\"numerical-range-label\" aria-hidden=\"true\">\n @if (withIcon() && (type() == numericalRangeType.largeWhite || type() == numericalRangeType.largeGrey)) {\n <cw-icon [icon]=\"withIcon()\" [iconSize]=\"iconSize['lg']\"></cw-icon>\n }\n <span>{{ label() }}</span>\n </div>\n }\n\n <div class=\"numerical-range-container\">\n <cw-button [isDisabled]=\"isDisabled() || amount() <= floor()\" [label]=\"'Diminuer ' + amount() + ' ' + label()\"\n [withIcon]=\"spriteIcon.toolbarMinus\" [withOnlyIcon]=\"true\" [type]=\"buttonType.primary\"\n [iconSize]=\"buttonIconSize.small\" (btnAction)=\"decreaseAmount()\">\n </cw-button>\n\n <div class=\"numerical-range-wrapper\">\n <div class=\"numerical-range-amount\" aria-live=\"polite\" aria-atomic=\"true\">\n {{ amount() }}\n @if (!withLabelVisible() && !withIcon()) {\n <span class=\"sr-only\">{{ label() }}</span>\n }\n </div>\n\n @if ((type() !== numericalRangeType.largeGrey && type() !== numericalRangeType.largeWhite) && (withIcon() ||\n withLabelVisible())) {\n <div class=\"numerical-range-label\">\n @if (withLabelVisible() && labelPosition() == labelPositionValue.inside) {\n @if (withIcon()) {\n <cw-icon [icon]=\"withIcon()\" [iconSize]=\"iconSize['lg']\" aria-hidden=\"true\"></cw-icon>\n }\n <span>{{ label() }}</span>\n }\n @else {\n @if (withIcon()) {\n <cw-icon [icon]=\"withIcon()\" [label]=\"label()\" [iconSize]=\"iconSize['lg']\"></cw-icon>\n }\n }\n </div>\n }\n </div>\n\n <cw-button [isDisabled]=\"isDisabled() || amount() >= ceil()\" [label]=\"'Augmenter ' + amount() + ' ' + label()\"\n [withIcon]=\"spriteIcon.toolbarPlus\" [withOnlyIcon]=\"true\" [type]=\"buttonType.primary\"\n [iconSize]=\"buttonIconSize.small\" (btnAction)=\"increaseAmount()\">\n </cw-button>\n </div>\n</div>\n" }]
|
|
2613
|
+
}], propDecorators: { type: [{ type: i0.Input, args: [{ isSignal: true, alias: "type", required: false }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], amount: [{ type: i0.Input, args: [{ isSignal: true, alias: "amount", required: false }] }, { type: i0.Output, args: ["amountChange"] }], withIcon: [{ type: i0.Input, args: [{ isSignal: true, alias: "withIcon", required: false }] }], withLabelVisible: [{ type: i0.Input, args: [{ isSignal: true, alias: "withLabelVisible", required: false }] }], labelPosition: [{ type: i0.Input, args: [{ isSignal: true, alias: "labelPosition", required: false }] }], ceil: [{ type: i0.Input, args: [{ isSignal: true, alias: "ceil", required: false }] }], floor: [{ type: i0.Input, args: [{ isSignal: true, alias: "floor", required: false }] }], isDisabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "isDisabled", required: false }] }], autoChangeAmount: [{ type: i0.Input, args: [{ isSignal: true, alias: "autoChangeAmount", required: false }] }], newAmount: [{ type: i0.Output, args: ["newAmount"] }] } });
|
|
2732
2614
|
|
|
2733
2615
|
class ImageComponent {
|
|
2734
2616
|
constructor() {
|
|
2735
|
-
this.source = '';
|
|
2736
|
-
this.alt = '';
|
|
2737
|
-
this.isAriaHidden = false;
|
|
2738
|
-
this.cssClass = '';
|
|
2739
|
-
this.width = '';
|
|
2740
|
-
this.height = '';
|
|
2617
|
+
this.source = input('', ...(ngDevMode ? [{ debugName: "source" }] : []));
|
|
2618
|
+
this.alt = input('', ...(ngDevMode ? [{ debugName: "alt" }] : []));
|
|
2619
|
+
this.isAriaHidden = input(false, ...(ngDevMode ? [{ debugName: "isAriaHidden" }] : []));
|
|
2620
|
+
this.cssClass = input('', ...(ngDevMode ? [{ debugName: "cssClass" }] : []));
|
|
2621
|
+
this.width = input('', ...(ngDevMode ? [{ debugName: "width" }] : []));
|
|
2622
|
+
this.height = input('', ...(ngDevMode ? [{ debugName: "height" }] : []));
|
|
2741
2623
|
}
|
|
2742
2624
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.19", ngImport: i0, type: ImageComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2743
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "
|
|
2625
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "20.3.19", type: ImageComponent, isStandalone: true, selector: "cw-image", inputs: { source: { classPropertyName: "source", publicName: "source", isSignal: true, isRequired: false, transformFunction: null }, alt: { classPropertyName: "alt", publicName: "alt", isSignal: true, isRequired: false, transformFunction: null }, isAriaHidden: { classPropertyName: "isAriaHidden", publicName: "isAriaHidden", isSignal: true, isRequired: false, transformFunction: null }, cssClass: { classPropertyName: "cssClass", publicName: "cssClass", isSignal: true, isRequired: false, transformFunction: null }, width: { classPropertyName: "width", publicName: "width", isSignal: true, isRequired: false, transformFunction: null }, height: { classPropertyName: "height", publicName: "height", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<img [src]=\"source()\" [attr.aria-hidden]=\"isAriaHidden() ? 'true' : null\" [class]=\"cssClass()\" [alt]=\"alt()\"\n [attr.width]=\"width() ? width() : null\" [attr.height]=\"height() ? height() : null\">\n" }); }
|
|
2744
2626
|
}
|
|
2745
2627
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.19", ngImport: i0, type: ImageComponent, decorators: [{
|
|
2746
2628
|
type: Component,
|
|
2747
|
-
args: [{ selector: 'cw-image', standalone: true, template: "<img [src]=\"source\" [attr.aria-hidden]=\"isAriaHidden ? 'true' : null\" [class]=\"cssClass\" [alt]=\"alt\"\
|
|
2748
|
-
}], propDecorators: { source: [{
|
|
2749
|
-
type: Input
|
|
2750
|
-
}], alt: [{
|
|
2751
|
-
type: Input
|
|
2752
|
-
}], isAriaHidden: [{
|
|
2753
|
-
type: Input
|
|
2754
|
-
}], cssClass: [{
|
|
2755
|
-
type: Input
|
|
2756
|
-
}], width: [{
|
|
2757
|
-
type: Input
|
|
2758
|
-
}], height: [{
|
|
2759
|
-
type: Input
|
|
2760
|
-
}] } });
|
|
2629
|
+
args: [{ selector: 'cw-image', standalone: true, template: "<img [src]=\"source()\" [attr.aria-hidden]=\"isAriaHidden() ? 'true' : null\" [class]=\"cssClass()\" [alt]=\"alt()\"\n [attr.width]=\"width() ? width() : null\" [attr.height]=\"height() ? height() : null\">\n" }]
|
|
2630
|
+
}], propDecorators: { source: [{ type: i0.Input, args: [{ isSignal: true, alias: "source", required: false }] }], alt: [{ type: i0.Input, args: [{ isSignal: true, alias: "alt", required: false }] }], isAriaHidden: [{ type: i0.Input, args: [{ isSignal: true, alias: "isAriaHidden", required: false }] }], cssClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "cssClass", required: false }] }], width: [{ type: i0.Input, args: [{ isSignal: true, alias: "width", required: false }] }], height: [{ type: i0.Input, args: [{ isSignal: true, alias: "height", required: false }] }] } });
|
|
2761
2631
|
|
|
2762
2632
|
var TitleTagEnum;
|
|
2763
2633
|
(function (TitleTagEnum) {
|