@cityway/basic-ui 1.0.2-beta024 → 1.0.2-beta026
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-beta026.tgz +0 -0
- package/fesm2022/cityway-basic-ui.mjs +378 -125
- package/fesm2022/cityway-basic-ui.mjs.map +1 -1
- package/index.d.ts +109 -21
- package/package.json +2 -2
- package/styles/basic-ui.styles.bo.min.css +1 -1
- package/styles/basic-ui.styles.bo.min.css.map +1 -1
- package/styles/basic-ui.styles.fo.min.css +1 -1
- package/styles/basic-ui.styles.fo.min.css.map +1 -1
- package/cityway-basic-ui-1.0.2-beta023.tgz +0 -0
- package/cityway-basic-ui-1.0.2-beta024.tgz +0 -0
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
import * as i1 from '@angular/common';
|
|
2
2
|
import { CommonModule, NgClass, NgTemplateOutlet } from '@angular/common';
|
|
3
3
|
import * as i0 from '@angular/core';
|
|
4
|
-
import { inject, ElementRef, signal, EventEmitter, effect, Output, Input, Directive, input, HostBinding, Component, ChangeDetectorRef, model, output, viewChild, contentChildren, Injectable, NgZone, HostListener, ChangeDetectionStrategy, Renderer2,
|
|
4
|
+
import { inject, ElementRef, signal, EventEmitter, effect, Output, Input, Directive, input, HostBinding, Component, ChangeDetectorRef, model, output, viewChild, contentChildren, Injectable, NgZone, HostListener, ChangeDetectionStrategy, Renderer2, ViewContainerRef, DestroyRef, ViewChild, computed, TemplateRef, ContentChild, ApplicationRef, Injector, createComponent, viewChildren, Pipe } from '@angular/core';
|
|
5
5
|
import * as i2 from '@ngx-translate/core';
|
|
6
6
|
import { TranslatePipe, TranslateModule, TranslateService } from '@ngx-translate/core';
|
|
7
7
|
import { RouterLink, Router, ActivatedRoute } from '@angular/router';
|
|
8
|
+
import { ComponentPortal } from '@angular/cdk/portal';
|
|
9
|
+
import { Overlay, OverlayPositionBuilder } from '@angular/cdk/overlay';
|
|
10
|
+
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
8
11
|
import { BehaviorSubject, fromEvent, tap, filter, debounceTime, switchMap, catchError, of } from 'rxjs';
|
|
9
12
|
import * as i4 from '@angular-slider/ngx-slider';
|
|
10
13
|
import { NgxSliderModule } from '@angular-slider/ngx-slider';
|
|
11
14
|
export { Options } from '@angular-slider/ngx-slider';
|
|
12
|
-
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
13
15
|
import * as i2$1 from '@angular/forms';
|
|
14
16
|
import { FormControl, ReactiveFormsModule, FormGroup, Validators, FormsModule } from '@angular/forms';
|
|
15
17
|
import intlTelInput from 'intl-tel-input';
|
|
@@ -1282,6 +1284,18 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.20", ngImpo
|
|
|
1282
1284
|
args: ['document:click', ['$event']]
|
|
1283
1285
|
}] } });
|
|
1284
1286
|
|
|
1287
|
+
/**
|
|
1288
|
+
* Position du tooltip/popover par rapport à son élément hôte.
|
|
1289
|
+
* Distinct de `DropdownPositionEnum` (qui inclut `static` et sert au placement du menu dropdown).
|
|
1290
|
+
*/
|
|
1291
|
+
var TooltipPositionEnum;
|
|
1292
|
+
(function (TooltipPositionEnum) {
|
|
1293
|
+
TooltipPositionEnum["top"] = "top";
|
|
1294
|
+
TooltipPositionEnum["bottom"] = "bottom";
|
|
1295
|
+
TooltipPositionEnum["left"] = "left";
|
|
1296
|
+
TooltipPositionEnum["right"] = "right";
|
|
1297
|
+
})(TooltipPositionEnum || (TooltipPositionEnum = {}));
|
|
1298
|
+
|
|
1285
1299
|
var FoButtonTypeEnum;
|
|
1286
1300
|
(function (FoButtonTypeEnum) {
|
|
1287
1301
|
FoButtonTypeEnum["primary"] = "primary";
|
|
@@ -1330,6 +1344,257 @@ var TriggerTooltipEnum;
|
|
|
1330
1344
|
TriggerTooltipEnum["hover"] = "hover";
|
|
1331
1345
|
})(TriggerTooltipEnum || (TriggerTooltipEnum = {}));
|
|
1332
1346
|
|
|
1347
|
+
/**
|
|
1348
|
+
* Contenu projeté dans l'overlay CDK par `CwTooltipDirective`.
|
|
1349
|
+
* Composant interne : NON exposé dans la public-api (consommé uniquement via la directive).
|
|
1350
|
+
*/
|
|
1351
|
+
class TooltipContentComponent {
|
|
1352
|
+
constructor() {
|
|
1353
|
+
this.id = '';
|
|
1354
|
+
this.text = '';
|
|
1355
|
+
this.title = '';
|
|
1356
|
+
this.type = TypeTooltipEnum.tooltip;
|
|
1357
|
+
this.arrowPosition = TooltipPositionEnum.right;
|
|
1358
|
+
this.typeTooltipEnum = TypeTooltipEnum;
|
|
1359
|
+
}
|
|
1360
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: TooltipContentComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1361
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.20", type: TooltipContentComponent, isStandalone: true, selector: "cw-tooltip-content", inputs: { id: "id", text: "text", title: "title", type: "type", arrowPosition: "arrowPosition" }, ngImport: i0, template: `
|
|
1362
|
+
<div role="tooltip" [id]="id" [ngClass]="type + ' fade show ' + type + '-' + arrowPosition">
|
|
1363
|
+
<div class="arrow"></div>
|
|
1364
|
+
@if (title) {
|
|
1365
|
+
<div [ngClass]="(type === typeTooltipEnum.popover ? 'popover' : 'tooltip') + '-header'"
|
|
1366
|
+
[innerHTML]="title | translate"></div>
|
|
1367
|
+
}
|
|
1368
|
+
<div [ngClass]="type + '-body'" [innerHTML]="text | translate"></div>
|
|
1369
|
+
</div>
|
|
1370
|
+
`, isInline: true, 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" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
1371
|
+
}
|
|
1372
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: TooltipContentComponent, decorators: [{
|
|
1373
|
+
type: Component,
|
|
1374
|
+
args: [{
|
|
1375
|
+
selector: 'cw-tooltip-content',
|
|
1376
|
+
standalone: true,
|
|
1377
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
1378
|
+
imports: [CommonModule, TranslateModule],
|
|
1379
|
+
template: `
|
|
1380
|
+
<div role="tooltip" [id]="id" [ngClass]="type + ' fade show ' + type + '-' + arrowPosition">
|
|
1381
|
+
<div class="arrow"></div>
|
|
1382
|
+
@if (title) {
|
|
1383
|
+
<div [ngClass]="(type === typeTooltipEnum.popover ? 'popover' : 'tooltip') + '-header'"
|
|
1384
|
+
[innerHTML]="title | translate"></div>
|
|
1385
|
+
}
|
|
1386
|
+
<div [ngClass]="type + '-body'" [innerHTML]="text | translate"></div>
|
|
1387
|
+
</div>
|
|
1388
|
+
`,
|
|
1389
|
+
}]
|
|
1390
|
+
}], propDecorators: { id: [{
|
|
1391
|
+
type: Input
|
|
1392
|
+
}], text: [{
|
|
1393
|
+
type: Input
|
|
1394
|
+
}], title: [{
|
|
1395
|
+
type: Input
|
|
1396
|
+
}], type: [{
|
|
1397
|
+
type: Input
|
|
1398
|
+
}], arrowPosition: [{
|
|
1399
|
+
type: Input
|
|
1400
|
+
}] } });
|
|
1401
|
+
|
|
1402
|
+
/** Espace (px) entre l'hôte et la boîte du tooltip (laisse la place à la flèche). */
|
|
1403
|
+
const TOOLTIP_GAP = 24;
|
|
1404
|
+
/** Compteur d'instances pour générer des `id` stables (sert à `aria-describedby`). */
|
|
1405
|
+
let nextTooltipId = 0;
|
|
1406
|
+
/**
|
|
1407
|
+
* Tooltip/popover porté à la racine du DOM via CDK Overlay et positionné dynamiquement.
|
|
1408
|
+
* Résout les bugs de z-index/clipping liés au rendu inline (overflow + stacking context des ancêtres).
|
|
1409
|
+
*
|
|
1410
|
+
* @example <button cwTooltip="_KEY.TXT" cwTooltipTitle="_KEY.TITLE" cwTooltipPosition="top">…</button>
|
|
1411
|
+
*/
|
|
1412
|
+
class CwTooltipDirective {
|
|
1413
|
+
constructor() {
|
|
1414
|
+
this.overlay = inject(Overlay);
|
|
1415
|
+
this.positionBuilder = inject(OverlayPositionBuilder);
|
|
1416
|
+
this.elementRef = inject((ElementRef));
|
|
1417
|
+
this.renderer = inject(Renderer2);
|
|
1418
|
+
this.viewContainerRef = inject(ViewContainerRef);
|
|
1419
|
+
this.destroyRef = inject(DestroyRef);
|
|
1420
|
+
/** Texte (clé i18n) du tooltip. Alias principal : `[cwTooltip]="key"`. */
|
|
1421
|
+
this.text = '';
|
|
1422
|
+
this.cwTooltipTitle = '';
|
|
1423
|
+
this.cwTooltipType = TypeTooltipEnum.tooltip;
|
|
1424
|
+
this.cwTooltipTrigger = TriggerTooltipEnum.hover;
|
|
1425
|
+
this.cwTooltipPosition = TooltipPositionEnum.right;
|
|
1426
|
+
/** Désactive le tooltip sans retirer la directive (pass-through de `withTooltip`). */
|
|
1427
|
+
this.cwTooltipDisabled = false;
|
|
1428
|
+
this.tooltipId = `ctw-tooltip-${nextTooltipId++}`;
|
|
1429
|
+
}
|
|
1430
|
+
get isHover() {
|
|
1431
|
+
return this.cwTooltipTrigger === TriggerTooltipEnum.hover;
|
|
1432
|
+
}
|
|
1433
|
+
onEnter() {
|
|
1434
|
+
if (this.isHover) {
|
|
1435
|
+
this.show();
|
|
1436
|
+
}
|
|
1437
|
+
}
|
|
1438
|
+
onLeave() {
|
|
1439
|
+
if (this.isHover) {
|
|
1440
|
+
this.hide();
|
|
1441
|
+
}
|
|
1442
|
+
}
|
|
1443
|
+
onClick() {
|
|
1444
|
+
if (!this.isHover) {
|
|
1445
|
+
this.toggle();
|
|
1446
|
+
}
|
|
1447
|
+
}
|
|
1448
|
+
onEscape() {
|
|
1449
|
+
this.hide();
|
|
1450
|
+
}
|
|
1451
|
+
ngOnDestroy() {
|
|
1452
|
+
this.overlayRef?.dispose();
|
|
1453
|
+
}
|
|
1454
|
+
toggle() {
|
|
1455
|
+
this.overlayRef?.hasAttached() ? this.hide() : this.show();
|
|
1456
|
+
}
|
|
1457
|
+
show() {
|
|
1458
|
+
if (this.cwTooltipDisabled || !this.text || this.overlayRef?.hasAttached()) {
|
|
1459
|
+
return;
|
|
1460
|
+
}
|
|
1461
|
+
const overlayRef = this.ensureOverlay();
|
|
1462
|
+
this.contentRef = overlayRef.attach(new ComponentPortal(TooltipContentComponent, this.viewContainerRef));
|
|
1463
|
+
this.contentRef.setInput('id', this.tooltipId);
|
|
1464
|
+
this.contentRef.setInput('text', this.text);
|
|
1465
|
+
this.contentRef.setInput('title', this.cwTooltipTitle);
|
|
1466
|
+
this.contentRef.setInput('type', this.cwTooltipType);
|
|
1467
|
+
this.contentRef.setInput('arrowPosition', this.cwTooltipPosition);
|
|
1468
|
+
this.renderer.setAttribute(this.elementRef.nativeElement, 'aria-describedby', this.tooltipId);
|
|
1469
|
+
}
|
|
1470
|
+
hide() {
|
|
1471
|
+
if (this.overlayRef?.hasAttached()) {
|
|
1472
|
+
this.overlayRef.detach();
|
|
1473
|
+
}
|
|
1474
|
+
this.contentRef = undefined;
|
|
1475
|
+
this.renderer.removeAttribute(this.elementRef.nativeElement, 'aria-describedby');
|
|
1476
|
+
}
|
|
1477
|
+
ensureOverlay() {
|
|
1478
|
+
if (this.overlayRef) {
|
|
1479
|
+
return this.overlayRef;
|
|
1480
|
+
}
|
|
1481
|
+
const positionStrategy = this.positionBuilder
|
|
1482
|
+
.flexibleConnectedTo(this.elementRef)
|
|
1483
|
+
.withPositions(this.buildPositions())
|
|
1484
|
+
.withPush(false);
|
|
1485
|
+
// La position réelle peut différer de celle demandée (flip si débordement viewport) :
|
|
1486
|
+
// on aligne la flèche sur la position effective.
|
|
1487
|
+
positionStrategy.positionChanges
|
|
1488
|
+
.pipe(takeUntilDestroyed(this.destroyRef))
|
|
1489
|
+
.subscribe((change) => {
|
|
1490
|
+
this.contentRef?.setInput('arrowPosition', resolveArrowPos(change.connectionPair));
|
|
1491
|
+
});
|
|
1492
|
+
this.overlayRef = this.overlay.create({
|
|
1493
|
+
positionStrategy,
|
|
1494
|
+
scrollStrategy: this.overlay.scrollStrategies.reposition(),
|
|
1495
|
+
panelClass: 'cw-tooltip-pane',
|
|
1496
|
+
});
|
|
1497
|
+
// Fermeture au clic extérieur (mode click).
|
|
1498
|
+
this.overlayRef
|
|
1499
|
+
.outsidePointerEvents()
|
|
1500
|
+
.pipe(takeUntilDestroyed(this.destroyRef))
|
|
1501
|
+
.subscribe(() => {
|
|
1502
|
+
if (!this.isHover) {
|
|
1503
|
+
this.hide();
|
|
1504
|
+
}
|
|
1505
|
+
});
|
|
1506
|
+
return this.overlayRef;
|
|
1507
|
+
}
|
|
1508
|
+
/** Position préférée (celle demandée) puis fallbacks pour le flip. */
|
|
1509
|
+
buildPositions() {
|
|
1510
|
+
const ordered = [
|
|
1511
|
+
this.cwTooltipPosition,
|
|
1512
|
+
OPPOSITE[this.cwTooltipPosition],
|
|
1513
|
+
...PERPENDICULAR[this.cwTooltipPosition],
|
|
1514
|
+
];
|
|
1515
|
+
return ordered.map((p) => POSITIONS[p]);
|
|
1516
|
+
}
|
|
1517
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: CwTooltipDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
1518
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.20", type: CwTooltipDirective, isStandalone: true, selector: "[cwTooltip]", inputs: { text: ["cwTooltip", "text"], cwTooltipTitle: "cwTooltipTitle", cwTooltipType: "cwTooltipType", cwTooltipTrigger: "cwTooltipTrigger", cwTooltipPosition: "cwTooltipPosition", cwTooltipDisabled: "cwTooltipDisabled" }, host: { listeners: { "mouseenter": "onEnter()", "focusin": "onEnter()", "mouseleave": "onLeave()", "focusout": "onLeave()", "click": "onClick()", "document:keydown.escape": "onEscape()" } }, ngImport: i0 }); }
|
|
1519
|
+
}
|
|
1520
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: CwTooltipDirective, decorators: [{
|
|
1521
|
+
type: Directive,
|
|
1522
|
+
args: [{
|
|
1523
|
+
selector: '[cwTooltip]',
|
|
1524
|
+
standalone: true,
|
|
1525
|
+
}]
|
|
1526
|
+
}], propDecorators: { text: [{
|
|
1527
|
+
type: Input,
|
|
1528
|
+
args: ['cwTooltip']
|
|
1529
|
+
}], cwTooltipTitle: [{
|
|
1530
|
+
type: Input
|
|
1531
|
+
}], cwTooltipType: [{
|
|
1532
|
+
type: Input
|
|
1533
|
+
}], cwTooltipTrigger: [{
|
|
1534
|
+
type: Input
|
|
1535
|
+
}], cwTooltipPosition: [{
|
|
1536
|
+
type: Input
|
|
1537
|
+
}], cwTooltipDisabled: [{
|
|
1538
|
+
type: Input
|
|
1539
|
+
}], onEnter: [{
|
|
1540
|
+
type: HostListener,
|
|
1541
|
+
args: ['mouseenter']
|
|
1542
|
+
}, {
|
|
1543
|
+
type: HostListener,
|
|
1544
|
+
args: ['focusin']
|
|
1545
|
+
}], onLeave: [{
|
|
1546
|
+
type: HostListener,
|
|
1547
|
+
args: ['mouseleave']
|
|
1548
|
+
}, {
|
|
1549
|
+
type: HostListener,
|
|
1550
|
+
args: ['focusout']
|
|
1551
|
+
}], onClick: [{
|
|
1552
|
+
type: HostListener,
|
|
1553
|
+
args: ['click']
|
|
1554
|
+
}], onEscape: [{
|
|
1555
|
+
type: HostListener,
|
|
1556
|
+
args: ['document:keydown.escape']
|
|
1557
|
+
}] } });
|
|
1558
|
+
const POSITIONS = {
|
|
1559
|
+
[TooltipPositionEnum.right]: {
|
|
1560
|
+
originX: 'end', originY: 'center', overlayX: 'start', overlayY: 'center', offsetX: TOOLTIP_GAP,
|
|
1561
|
+
},
|
|
1562
|
+
[TooltipPositionEnum.left]: {
|
|
1563
|
+
originX: 'start', originY: 'center', overlayX: 'end', overlayY: 'center', offsetX: -TOOLTIP_GAP,
|
|
1564
|
+
},
|
|
1565
|
+
[TooltipPositionEnum.top]: {
|
|
1566
|
+
originX: 'center', originY: 'top', overlayX: 'center', overlayY: 'bottom', offsetY: -TOOLTIP_GAP,
|
|
1567
|
+
},
|
|
1568
|
+
[TooltipPositionEnum.bottom]: {
|
|
1569
|
+
originX: 'center', originY: 'bottom', overlayX: 'center', overlayY: 'top', offsetY: TOOLTIP_GAP,
|
|
1570
|
+
},
|
|
1571
|
+
};
|
|
1572
|
+
const OPPOSITE = {
|
|
1573
|
+
[TooltipPositionEnum.right]: TooltipPositionEnum.left,
|
|
1574
|
+
[TooltipPositionEnum.left]: TooltipPositionEnum.right,
|
|
1575
|
+
[TooltipPositionEnum.top]: TooltipPositionEnum.bottom,
|
|
1576
|
+
[TooltipPositionEnum.bottom]: TooltipPositionEnum.top,
|
|
1577
|
+
};
|
|
1578
|
+
const PERPENDICULAR = {
|
|
1579
|
+
[TooltipPositionEnum.right]: [TooltipPositionEnum.top, TooltipPositionEnum.bottom],
|
|
1580
|
+
[TooltipPositionEnum.left]: [TooltipPositionEnum.top, TooltipPositionEnum.bottom],
|
|
1581
|
+
[TooltipPositionEnum.top]: [TooltipPositionEnum.right, TooltipPositionEnum.left],
|
|
1582
|
+
[TooltipPositionEnum.bottom]: [TooltipPositionEnum.right, TooltipPositionEnum.left],
|
|
1583
|
+
};
|
|
1584
|
+
/**
|
|
1585
|
+
* Déduit la classe de flèche (= côté du tooltip par rapport à l'hôte) depuis la
|
|
1586
|
+
* position effective renvoyée par le CDK. Fonction pure, testable isolément.
|
|
1587
|
+
*/
|
|
1588
|
+
function resolveArrowPos(pair) {
|
|
1589
|
+
if (pair.overlayX === 'start') {
|
|
1590
|
+
return TooltipPositionEnum.right;
|
|
1591
|
+
}
|
|
1592
|
+
if (pair.overlayX === 'end') {
|
|
1593
|
+
return TooltipPositionEnum.left;
|
|
1594
|
+
}
|
|
1595
|
+
return pair.overlayY === 'bottom' ? TooltipPositionEnum.top : TooltipPositionEnum.bottom;
|
|
1596
|
+
}
|
|
1597
|
+
|
|
1333
1598
|
class ResponsiveService {
|
|
1334
1599
|
constructor() {
|
|
1335
1600
|
this.checkIsMobileResolution$ = new BehaviorSubject(this.checkIsMobileResolution());
|
|
@@ -1380,6 +1645,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.20", ngImpo
|
|
|
1380
1645
|
args: [{ selector: '[cwDropdownItem]' }]
|
|
1381
1646
|
}] });
|
|
1382
1647
|
class ButtonComponent {
|
|
1648
|
+
/** Mappe `tooltipPosition` (qui peut valoir `static`) vers une position de tooltip exploitable. */
|
|
1649
|
+
get tooltipPositionResolved() {
|
|
1650
|
+
return this.tooltipPosition === DropdownPositionEnum.static
|
|
1651
|
+
? TooltipPositionEnum.right
|
|
1652
|
+
: this.tooltipPosition;
|
|
1653
|
+
}
|
|
1383
1654
|
get hostClasses() {
|
|
1384
1655
|
return this.skeletonMode ? 'skeleton btn' : '';
|
|
1385
1656
|
}
|
|
@@ -1403,7 +1674,7 @@ class ButtonComponent {
|
|
|
1403
1674
|
this.tooltipText = '';
|
|
1404
1675
|
this.tooltipTitle = '';
|
|
1405
1676
|
this.tooltipTrigger = TriggerTooltipEnum.hover;
|
|
1406
|
-
this.tooltipPosition =
|
|
1677
|
+
this.tooltipPosition = TooltipPositionEnum.right;
|
|
1407
1678
|
this.tooltipType = TypeTooltipEnum.tooltip;
|
|
1408
1679
|
this.btnAction = new EventEmitter();
|
|
1409
1680
|
this.dropDownClicked = new EventEmitter();
|
|
@@ -1414,8 +1685,6 @@ class ButtonComponent {
|
|
|
1414
1685
|
this.spriteIcon = SpriteIconEnum;
|
|
1415
1686
|
this.placementCss = '';
|
|
1416
1687
|
this.isOpen = false;
|
|
1417
|
-
this.isTooltipOpened = false;
|
|
1418
|
-
this.typeTooltipEnum = TypeTooltipEnum;
|
|
1419
1688
|
this.focusOutInitialized = false;
|
|
1420
1689
|
this.renderer.listen('window', 'click', (e) => {
|
|
1421
1690
|
const target = e.target;
|
|
@@ -1430,9 +1699,6 @@ class ButtonComponent {
|
|
|
1430
1699
|
this.getPlacement(this.dropdownPosition);
|
|
1431
1700
|
}
|
|
1432
1701
|
});
|
|
1433
|
-
if (this.withTooltip) {
|
|
1434
|
-
this.tooltipRandomId = this.getRandomId(1, 10000);
|
|
1435
|
-
}
|
|
1436
1702
|
this.dataTest ??= `btn-${UtilsHelper.slugify(this.label)}`;
|
|
1437
1703
|
}
|
|
1438
1704
|
getButtonClasses() {
|
|
@@ -1521,29 +1787,8 @@ class ButtonComponent {
|
|
|
1521
1787
|
}
|
|
1522
1788
|
});
|
|
1523
1789
|
}
|
|
1524
|
-
showTooltip() {
|
|
1525
|
-
if (this.tooltipTrigger === 'click') {
|
|
1526
|
-
this.isTooltipOpened = !this.isTooltipOpened;
|
|
1527
|
-
}
|
|
1528
|
-
else {
|
|
1529
|
-
this.isTooltipOpened = true;
|
|
1530
|
-
}
|
|
1531
|
-
}
|
|
1532
|
-
hideTooltip() {
|
|
1533
|
-
if (this.tooltipTrigger === 'hover') {
|
|
1534
|
-
this.isTooltipOpened = false;
|
|
1535
|
-
}
|
|
1536
|
-
}
|
|
1537
|
-
onTooltipClickOutside() {
|
|
1538
|
-
if (this.tooltipTrigger === 'click') {
|
|
1539
|
-
this.isTooltipOpened = false;
|
|
1540
|
-
}
|
|
1541
|
-
}
|
|
1542
|
-
getRandomId(min, max) {
|
|
1543
|
-
return Math.floor(Math.random() * (max - min + 1)) + min;
|
|
1544
|
-
}
|
|
1545
1790
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: ButtonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1546
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.20", type: ButtonComponent, isStandalone: true, selector: "cw-button", inputs: { type: "type", label: "label", id: "id", link: "link", isDropdown: "isDropdown", hideCaret: "hideCaret", withIcon: "withIcon", withOnlyIcon: "withOnlyIcon", iconSize: "iconSize", iconPosition: "iconPosition", dropdownPosition: "dropdownPosition", isMinWidth: "isMinWidth", isDisabled: "isDisabled", isLoading: "isLoading", cssClass: "cssClass", dataTest: "dataTest", skeletonMode: "skeletonMode", withTooltip: "withTooltip", tooltipText: "tooltipText", tooltipTitle: "tooltipTitle", tooltipTrigger: "tooltipTrigger", tooltipPosition: "tooltipPosition", tooltipType: "tooltipType" }, outputs: { btnAction: "btnAction", dropDownClicked: "dropDownClicked" }, host: { properties: { "class": "this.hostClasses" } }, viewQueries: [{ propertyName: "dropdown", first: true, predicate: ["dropdown"], descendants: true }, { propertyName: "dropdownMenu", first: true, predicate: ["dropdownMenu"], descendants: true }, { propertyName: "dropdownToggle", first: true, predicate: ["dropdownToggle"], descendants: true }], ngImport: i0, template: "
|
|
1791
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.20", type: ButtonComponent, isStandalone: true, selector: "cw-button", inputs: { type: "type", label: "label", id: "id", link: "link", isDropdown: "isDropdown", hideCaret: "hideCaret", withIcon: "withIcon", withOnlyIcon: "withOnlyIcon", iconSize: "iconSize", iconPosition: "iconPosition", dropdownPosition: "dropdownPosition", isMinWidth: "isMinWidth", isDisabled: "isDisabled", isLoading: "isLoading", cssClass: "cssClass", dataTest: "dataTest", skeletonMode: "skeletonMode", withTooltip: "withTooltip", tooltipText: "tooltipText", tooltipTitle: "tooltipTitle", tooltipTrigger: "tooltipTrigger", tooltipPosition: "tooltipPosition", tooltipType: "tooltipType" }, outputs: { btnAction: "btnAction", dropDownClicked: "dropDownClicked" }, host: { properties: { "class": "this.hostClasses" } }, viewQueries: [{ propertyName: "dropdown", first: true, predicate: ["dropdown"], descendants: true }, { propertyName: "dropdownMenu", first: true, predicate: ["dropdownMenu"], descendants: true }, { propertyName: "dropdownToggle", first: true, predicate: ["dropdownToggle"], descendants: true }], ngImport: i0, template: "<ng-container *ngTemplateOutlet=\"buttonTemplate\"></ng-container>\r\n\r\n<!-- Template du bouton (code existant envelopp\u00E9) -->\r\n<ng-template #buttonTemplate>\r\n @if (!isDropdown) {\r\n @if (link != null) {\r\n <a class=\"btn\" [class]=\"'btn-' + type + ' ' + cssClass\" [ngClass]=\"getButtonClasses()\"\r\n [class.disabled]=\"isDisabled\"\r\n [routerLink]=\"isDisabled ? null : link\"\r\n [attr.aria-disabled]=\"isDisabled ? 'true' : null\"\r\n [attr.tabindex]=\"isDisabled ? -1 : null\"\r\n [attr.data-test-ctw]=\"dataTest\"\r\n [cwTooltip]=\"tooltipText\" [cwTooltipDisabled]=\"!withTooltip\" [cwTooltipTitle]=\"tooltipTitle\"\r\n [cwTooltipType]=\"tooltipType\" [cwTooltipTrigger]=\"tooltipTrigger\" [cwTooltipPosition]=\"tooltipPositionResolved\"\r\n (click)=\"onLinkClick($event)\">\r\n\r\n <ng-container *ngTemplateOutlet=\"buttonContent\"></ng-container>\r\n </a>\r\n } @else {\r\n <button type=\"button\" class=\"btn\" [class]=\"'btn-' + type + ' ' + cssClass\" [ngClass]=\"getButtonClasses()\"\r\n [disabled]=\"isDisabled\" (click)=\"onBtnAction()\" [attr.data-test-ctw]=\"dataTest\"\r\n [cwTooltip]=\"tooltipText\" [cwTooltipDisabled]=\"!withTooltip\" [cwTooltipTitle]=\"tooltipTitle\"\r\n [cwTooltipType]=\"tooltipType\" [cwTooltipTrigger]=\"tooltipTrigger\" [cwTooltipPosition]=\"tooltipPositionResolved\">\r\n\r\n @if (isLoading) {\r\n <span class=\"spinner-border spinner-border-sm\" aria-hidden=\"true\"></span>\r\n <span class=\"visually-hidden\" role=\"status\">{{ '_COMMON._HTTP.TXT_LOADING' | translate }}</span>\r\n }\r\n\r\n <ng-container *ngTemplateOutlet=\"buttonContent\"></ng-container>\r\n </button>\r\n }\r\n }\r\n @else {\r\n <div (clickOutside)=\"onClickOutside()\" ctwClickOutside #dropdown class=\"dropdown d-inline-block\">\r\n <button class=\"btn\" [class]=\"'btn-' + type + ' ' + cssClass\" type=\"button\"\r\n [ngClass]=\"getButtonClasses()\"\r\n [disabled]=\"isDisabled\" [id]=\"id\" aria-expanded=\"false\" (click)=\"toggleDropdown()\" #dropdownToggle\r\n [attr.data-test-ctw]=\"dataTest\"\r\n [cwTooltip]=\"tooltipText\" [cwTooltipDisabled]=\"!withTooltip\" [cwTooltipTitle]=\"tooltipTitle\"\r\n [cwTooltipType]=\"tooltipType\" [cwTooltipTrigger]=\"tooltipTrigger\" [cwTooltipPosition]=\"tooltipPositionResolved\">\r\n\r\n <ng-container *ngTemplateOutlet=\"buttonContent\"></ng-container>\r\n\r\n @if(!hideCaret) {\r\n <cw-icon [icon]=\"spriteIcon.down\" [iconSize]=\"iconSizeEnum['2xs']\" class=\"dropdown-icon\"></cw-icon>\r\n }\r\n </button>\r\n\r\n <div [attr.aria-labelledby]=\"id\" class=\"dropdown-menu\" [ngClass]=\"placementCss\" #dropdownMenu>\r\n <div class=\"dropdown-menu-inner\">\r\n <ng-content></ng-content>\r\n </div>\r\n </div>\r\n </div>\r\n }\r\n</ng-template>\r\n\r\n<!-- Template existant du contenu du bouton -->\r\n<ng-template #buttonContent>\r\n @if (withIcon && iconPosition === buttonPositionEnum.left) {\r\n <ng-container *ngTemplateOutlet=\"iconContent\"></ng-container>\r\n }\r\n\r\n @if(withOnlyIcon) {\r\n <span class=\"visually-hidden\">{{label | translate }}</span>\r\n }\r\n @else {\r\n {{ label | translate }}\r\n }\r\n\r\n @if (withIcon && iconPosition === buttonPositionEnum.right) {\r\n <ng-container *ngTemplateOutlet=\"iconContent\"></ng-container>\r\n }\r\n</ng-template>\r\n\r\n<ng-template #iconContent>\r\n @if(withOnlyIcon) {\r\n @switch(iconSize) {\r\n @case(buttonIconSizeEnum.xsmall) {\r\n <cw-icon [icon]=\"withIcon\" [iconSize]=\"iconSizeEnum['xs']\"></cw-icon>\r\n }\r\n @case(buttonIconSizeEnum.small) {\r\n <cw-icon [icon]=\"withIcon\" [iconSize]=\"iconSizeEnum['xs']\"></cw-icon>\r\n }\r\n @default {\r\n <cw-icon [icon]=\"withIcon\" [iconSize]=\"iconSizeEnum['sm']\"></cw-icon>\r\n }\r\n }\r\n }\r\n @else {\r\n <cw-icon [icon]=\"withIcon\" [iconSize]=\"iconSizeEnum['sm']\"></cw-icon>\r\n }\r\n</ng-template>\r\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "ngmodule", type: TranslateModule }, { kind: "component", type: IconComponent, selector: "cw-icon", inputs: ["icon", "label", "type", "iconSize", "iconCssClass", "iconUiType", "iconColorCustom", "spritePath"] }, { kind: "directive", type: ClickOutsideDirective, selector: "[clickOutside]", outputs: ["clickOutside"] }, { kind: "directive", type: CwTooltipDirective, selector: "[cwTooltip]", inputs: ["cwTooltip", "cwTooltipTitle", "cwTooltipType", "cwTooltipTrigger", "cwTooltipPosition", "cwTooltipDisabled"] }, { kind: "directive", type: RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "pipe", type: i2.TranslatePipe, name: "translate" }] }); }
|
|
1547
1792
|
}
|
|
1548
1793
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: ButtonComponent, decorators: [{
|
|
1549
1794
|
type: Component,
|
|
@@ -1552,8 +1797,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.20", ngImpo
|
|
|
1552
1797
|
TranslateModule,
|
|
1553
1798
|
IconComponent,
|
|
1554
1799
|
ClickOutsideDirective,
|
|
1800
|
+
CwTooltipDirective,
|
|
1555
1801
|
RouterLink
|
|
1556
|
-
], template: "
|
|
1802
|
+
], template: "<ng-container *ngTemplateOutlet=\"buttonTemplate\"></ng-container>\r\n\r\n<!-- Template du bouton (code existant envelopp\u00E9) -->\r\n<ng-template #buttonTemplate>\r\n @if (!isDropdown) {\r\n @if (link != null) {\r\n <a class=\"btn\" [class]=\"'btn-' + type + ' ' + cssClass\" [ngClass]=\"getButtonClasses()\"\r\n [class.disabled]=\"isDisabled\"\r\n [routerLink]=\"isDisabled ? null : link\"\r\n [attr.aria-disabled]=\"isDisabled ? 'true' : null\"\r\n [attr.tabindex]=\"isDisabled ? -1 : null\"\r\n [attr.data-test-ctw]=\"dataTest\"\r\n [cwTooltip]=\"tooltipText\" [cwTooltipDisabled]=\"!withTooltip\" [cwTooltipTitle]=\"tooltipTitle\"\r\n [cwTooltipType]=\"tooltipType\" [cwTooltipTrigger]=\"tooltipTrigger\" [cwTooltipPosition]=\"tooltipPositionResolved\"\r\n (click)=\"onLinkClick($event)\">\r\n\r\n <ng-container *ngTemplateOutlet=\"buttonContent\"></ng-container>\r\n </a>\r\n } @else {\r\n <button type=\"button\" class=\"btn\" [class]=\"'btn-' + type + ' ' + cssClass\" [ngClass]=\"getButtonClasses()\"\r\n [disabled]=\"isDisabled\" (click)=\"onBtnAction()\" [attr.data-test-ctw]=\"dataTest\"\r\n [cwTooltip]=\"tooltipText\" [cwTooltipDisabled]=\"!withTooltip\" [cwTooltipTitle]=\"tooltipTitle\"\r\n [cwTooltipType]=\"tooltipType\" [cwTooltipTrigger]=\"tooltipTrigger\" [cwTooltipPosition]=\"tooltipPositionResolved\">\r\n\r\n @if (isLoading) {\r\n <span class=\"spinner-border spinner-border-sm\" aria-hidden=\"true\"></span>\r\n <span class=\"visually-hidden\" role=\"status\">{{ '_COMMON._HTTP.TXT_LOADING' | translate }}</span>\r\n }\r\n\r\n <ng-container *ngTemplateOutlet=\"buttonContent\"></ng-container>\r\n </button>\r\n }\r\n }\r\n @else {\r\n <div (clickOutside)=\"onClickOutside()\" ctwClickOutside #dropdown class=\"dropdown d-inline-block\">\r\n <button class=\"btn\" [class]=\"'btn-' + type + ' ' + cssClass\" type=\"button\"\r\n [ngClass]=\"getButtonClasses()\"\r\n [disabled]=\"isDisabled\" [id]=\"id\" aria-expanded=\"false\" (click)=\"toggleDropdown()\" #dropdownToggle\r\n [attr.data-test-ctw]=\"dataTest\"\r\n [cwTooltip]=\"tooltipText\" [cwTooltipDisabled]=\"!withTooltip\" [cwTooltipTitle]=\"tooltipTitle\"\r\n [cwTooltipType]=\"tooltipType\" [cwTooltipTrigger]=\"tooltipTrigger\" [cwTooltipPosition]=\"tooltipPositionResolved\">\r\n\r\n <ng-container *ngTemplateOutlet=\"buttonContent\"></ng-container>\r\n\r\n @if(!hideCaret) {\r\n <cw-icon [icon]=\"spriteIcon.down\" [iconSize]=\"iconSizeEnum['2xs']\" class=\"dropdown-icon\"></cw-icon>\r\n }\r\n </button>\r\n\r\n <div [attr.aria-labelledby]=\"id\" class=\"dropdown-menu\" [ngClass]=\"placementCss\" #dropdownMenu>\r\n <div class=\"dropdown-menu-inner\">\r\n <ng-content></ng-content>\r\n </div>\r\n </div>\r\n </div>\r\n }\r\n</ng-template>\r\n\r\n<!-- Template existant du contenu du bouton -->\r\n<ng-template #buttonContent>\r\n @if (withIcon && iconPosition === buttonPositionEnum.left) {\r\n <ng-container *ngTemplateOutlet=\"iconContent\"></ng-container>\r\n }\r\n\r\n @if(withOnlyIcon) {\r\n <span class=\"visually-hidden\">{{label | translate }}</span>\r\n }\r\n @else {\r\n {{ label | translate }}\r\n }\r\n\r\n @if (withIcon && iconPosition === buttonPositionEnum.right) {\r\n <ng-container *ngTemplateOutlet=\"iconContent\"></ng-container>\r\n }\r\n</ng-template>\r\n\r\n<ng-template #iconContent>\r\n @if(withOnlyIcon) {\r\n @switch(iconSize) {\r\n @case(buttonIconSizeEnum.xsmall) {\r\n <cw-icon [icon]=\"withIcon\" [iconSize]=\"iconSizeEnum['xs']\"></cw-icon>\r\n }\r\n @case(buttonIconSizeEnum.small) {\r\n <cw-icon [icon]=\"withIcon\" [iconSize]=\"iconSizeEnum['xs']\"></cw-icon>\r\n }\r\n @default {\r\n <cw-icon [icon]=\"withIcon\" [iconSize]=\"iconSizeEnum['sm']\"></cw-icon>\r\n }\r\n }\r\n }\r\n @else {\r\n <cw-icon [icon]=\"withIcon\" [iconSize]=\"iconSizeEnum['sm']\"></cw-icon>\r\n }\r\n</ng-template>\r\n" }]
|
|
1557
1803
|
}], ctorParameters: () => [], propDecorators: { type: [{
|
|
1558
1804
|
type: Input
|
|
1559
1805
|
}], label: [{
|
|
@@ -1745,20 +1991,24 @@ var FormFieldTypeEnum;
|
|
|
1745
1991
|
})(FormFieldTypeEnum || (FormFieldTypeEnum = {}));
|
|
1746
1992
|
|
|
1747
1993
|
/**
|
|
1748
|
-
* Logique clavier W3C
|
|
1994
|
+
* Logique clavier W3C combobox + listbox, isolée en fonctions pures pour testabilité.
|
|
1995
|
+
*
|
|
1996
|
+
* Pattern : https://www.w3.org/WAI/ARIA/apg/patterns/combobox/examples/combobox-autocomplete-list/
|
|
1749
1997
|
*
|
|
1750
|
-
*
|
|
1998
|
+
* Le focus DOM reste toujours sur l'input combobox. La navigation dans la liste
|
|
1999
|
+
* est virtuelle, via `aria-activedescendant` pointant l'`option` active. Toutes les
|
|
2000
|
+
* touches sont reçues sur l'input ; ces helpers décident des actions à appliquer.
|
|
1751
2001
|
*
|
|
1752
|
-
*
|
|
1753
|
-
*
|
|
1754
|
-
*
|
|
2002
|
+
* Les flèches ←/→ ne sont PAS interceptées : elles déplacent le curseur dans l'input
|
|
2003
|
+
* (édition native), conformément au pattern listbox (pas de navigation 2D, contrairement
|
|
2004
|
+
* au variant grid).
|
|
1755
2005
|
*
|
|
1756
2006
|
* Conventions sur `activeRow` :
|
|
1757
|
-
* -1 : aucune
|
|
1758
|
-
* -2 :
|
|
2007
|
+
* -1 : aucune option focalisée
|
|
2008
|
+
* -2 : option master (mode multi uniquement — sélection en masse)
|
|
1759
2009
|
* >=0 : index dans `items[]`
|
|
1760
2010
|
*/
|
|
1761
|
-
/** Constante pour identifier
|
|
2011
|
+
/** Constante pour identifier l'option master (mode multi). */
|
|
1762
2012
|
const MASTER_ROW = -2;
|
|
1763
2013
|
/**
|
|
1764
2014
|
* Décide quoi faire quand une touche est pressée sur l'input combobox.
|
|
@@ -1766,26 +2016,26 @@ const MASTER_ROW = -2;
|
|
|
1766
2016
|
* le comportement natif (navigation, édition).
|
|
1767
2017
|
*/
|
|
1768
2018
|
function handleComboboxKey(event, state) {
|
|
1769
|
-
const { isOpen, itemsCount,
|
|
2019
|
+
const { isOpen, itemsCount, activeRow, multi } = state;
|
|
1770
2020
|
switch (event.key) {
|
|
1771
2021
|
case 'ArrowDown': {
|
|
1772
2022
|
event.preventDefault();
|
|
1773
2023
|
if (!isOpen) {
|
|
1774
|
-
// Ouvre la
|
|
2024
|
+
// Ouvre la liste. En multi, on commence par la master pour exposer le toggle global.
|
|
1775
2025
|
const firstRow = multi ? MASTER_ROW : 0;
|
|
1776
|
-
return [{ type: 'open' }, { type: 'setActive', row: firstRow
|
|
2026
|
+
return [{ type: 'open' }, { type: 'setActive', row: firstRow }];
|
|
1777
2027
|
}
|
|
1778
2028
|
if (itemsCount === 0)
|
|
1779
2029
|
return [{ type: 'noop' }];
|
|
1780
|
-
// Master → première
|
|
2030
|
+
// Master → première option réelle
|
|
1781
2031
|
if (multi && activeRow === MASTER_ROW) {
|
|
1782
|
-
return [{ type: 'setActive', row: 0
|
|
2032
|
+
return [{ type: 'setActive', row: 0 }];
|
|
1783
2033
|
}
|
|
1784
|
-
// Dernière
|
|
2034
|
+
// Dernière option → master (en multi) ou wrap haut
|
|
1785
2035
|
if (activeRow + 1 >= itemsCount) {
|
|
1786
|
-
return [{ type: 'setActive', row: multi ? MASTER_ROW : 0
|
|
2036
|
+
return [{ type: 'setActive', row: multi ? MASTER_ROW : 0 }];
|
|
1787
2037
|
}
|
|
1788
|
-
return [{ type: 'setActive', row: activeRow + 1
|
|
2038
|
+
return [{ type: 'setActive', row: activeRow + 1 }];
|
|
1789
2039
|
}
|
|
1790
2040
|
case 'ArrowUp': {
|
|
1791
2041
|
event.preventDefault();
|
|
@@ -1793,46 +2043,20 @@ function handleComboboxKey(event, state) {
|
|
|
1793
2043
|
const lastRow = itemsCount > 0 ? itemsCount - 1 : (multi ? MASTER_ROW : -1);
|
|
1794
2044
|
return [
|
|
1795
2045
|
{ type: 'open' },
|
|
1796
|
-
{ type: 'setActive', row: Math.max(MASTER_ROW, lastRow)
|
|
2046
|
+
{ type: 'setActive', row: Math.max(MASTER_ROW, lastRow) },
|
|
1797
2047
|
];
|
|
1798
2048
|
}
|
|
1799
2049
|
if (itemsCount === 0 && !multi)
|
|
1800
2050
|
return [{ type: 'noop' }];
|
|
1801
|
-
// Master → dernière
|
|
2051
|
+
// Master → dernière option (wrap)
|
|
1802
2052
|
if (multi && activeRow === MASTER_ROW) {
|
|
1803
|
-
return [{ type: 'setActive', row: itemsCount - 1
|
|
2053
|
+
return [{ type: 'setActive', row: itemsCount - 1 }];
|
|
1804
2054
|
}
|
|
1805
|
-
//
|
|
2055
|
+
// Option 0 → master (en multi) ou wrap fin
|
|
1806
2056
|
if (activeRow - 1 < 0) {
|
|
1807
|
-
return [{ type: 'setActive', row: multi ? MASTER_ROW : itemsCount - 1
|
|
2057
|
+
return [{ type: 'setActive', row: multi ? MASTER_ROW : itemsCount - 1 }];
|
|
1808
2058
|
}
|
|
1809
|
-
return [{ type: 'setActive', row: activeRow - 1
|
|
1810
|
-
}
|
|
1811
|
-
case 'ArrowRight': {
|
|
1812
|
-
// W3C : navigation 2D dans la grille quand popup ouverte.
|
|
1813
|
-
// Si grille fermée, master row, aucune ligne active, ou < 2 colonnes : édition native.
|
|
1814
|
-
if (!isOpen || activeRow < 0 || totalCols <= 1)
|
|
1815
|
-
return [{ type: 'noop' }];
|
|
1816
|
-
event.preventDefault();
|
|
1817
|
-
let nextCol = activeCol + 1;
|
|
1818
|
-
let nextRow = activeRow;
|
|
1819
|
-
if (nextCol >= totalCols) {
|
|
1820
|
-
nextCol = 0;
|
|
1821
|
-
nextRow = (nextRow + 1) % itemsCount;
|
|
1822
|
-
}
|
|
1823
|
-
return [{ type: 'setActive', row: nextRow, col: nextCol }];
|
|
1824
|
-
}
|
|
1825
|
-
case 'ArrowLeft': {
|
|
1826
|
-
if (!isOpen || activeRow < 0 || totalCols <= 1)
|
|
1827
|
-
return [{ type: 'noop' }];
|
|
1828
|
-
event.preventDefault();
|
|
1829
|
-
let nextCol = activeCol - 1;
|
|
1830
|
-
let nextRow = activeRow;
|
|
1831
|
-
if (nextCol < 0) {
|
|
1832
|
-
nextCol = totalCols - 1;
|
|
1833
|
-
nextRow = nextRow - 1 < 0 ? itemsCount - 1 : nextRow - 1;
|
|
1834
|
-
}
|
|
1835
|
-
return [{ type: 'setActive', row: nextRow, col: nextCol }];
|
|
2059
|
+
return [{ type: 'setActive', row: activeRow - 1 }];
|
|
1836
2060
|
}
|
|
1837
2061
|
case 'Enter': {
|
|
1838
2062
|
if (!isOpen)
|
|
@@ -1855,7 +2079,7 @@ function handleComboboxKey(event, state) {
|
|
|
1855
2079
|
return [{ type: 'noop' }];
|
|
1856
2080
|
}
|
|
1857
2081
|
case ' ': {
|
|
1858
|
-
// Space dans l'input = caractère par défaut. En multi, si une
|
|
2082
|
+
// Space dans l'input = caractère par défaut. En multi, si une option est focalisée,
|
|
1859
2083
|
// c'est un toggle (sinon on insère un espace dans la recherche, comportement natif).
|
|
1860
2084
|
if (!multi || !isOpen)
|
|
1861
2085
|
return [{ type: 'noop' }];
|
|
@@ -1880,19 +2104,20 @@ function handleComboboxKey(event, state) {
|
|
|
1880
2104
|
case 'Home':
|
|
1881
2105
|
case 'End': {
|
|
1882
2106
|
// W3C : Home/End ramène le focus dans l'input + position curseur natif.
|
|
1883
|
-
// Comme le focus est déjà sur l'input, on ferme juste la
|
|
2107
|
+
// Comme le focus est déjà sur l'input, on ferme juste la liste
|
|
1884
2108
|
// et on laisse le caret se déplacer naturellement (pas de preventDefault).
|
|
1885
2109
|
if (isOpen)
|
|
1886
2110
|
return [{ type: 'close' }];
|
|
1887
2111
|
return [{ type: 'noop' }];
|
|
1888
2112
|
}
|
|
1889
2113
|
case 'Tab': {
|
|
1890
|
-
// Laisser le Tab natif sortir du champ. On ferme juste la
|
|
2114
|
+
// Laisser le Tab natif sortir du champ. On ferme juste la liste.
|
|
1891
2115
|
if (isOpen)
|
|
1892
2116
|
return [{ type: 'close' }];
|
|
1893
2117
|
return [{ type: 'noop' }];
|
|
1894
2118
|
}
|
|
1895
2119
|
default:
|
|
2120
|
+
// ←/→ et toute autre touche : comportement natif de l'input (édition, déplacement caret).
|
|
1896
2121
|
return [{ type: 'noop' }];
|
|
1897
2122
|
}
|
|
1898
2123
|
}
|
|
@@ -1959,7 +2184,7 @@ class AutocompleteComponent {
|
|
|
1959
2184
|
this.itemSelected = output();
|
|
1960
2185
|
this.itemsChange = output();
|
|
1961
2186
|
// ---------- View refs ----------
|
|
1962
|
-
this.
|
|
2187
|
+
this.listboxEl = viewChild('listboxEl', ...(ngDevMode ? [{ debugName: "listboxEl" }] : []));
|
|
1963
2188
|
this.masterCheckbox = viewChild('masterCheckbox', ...(ngDevMode ? [{ debugName: "masterCheckbox" }] : []));
|
|
1964
2189
|
/** Exposé au template pour comparer activeRow() à la sentinelle master. */
|
|
1965
2190
|
this.MASTER_ROW = MASTER_ROW;
|
|
@@ -1972,7 +2197,6 @@ class AutocompleteComponent {
|
|
|
1972
2197
|
this.loading = signal(false, ...(ngDevMode ? [{ debugName: "loading" }] : []));
|
|
1973
2198
|
this.items = signal([], ...(ngDevMode ? [{ debugName: "items" }] : []));
|
|
1974
2199
|
this.activeRow = signal(-1, ...(ngDevMode ? [{ debugName: "activeRow" }] : []));
|
|
1975
|
-
this.activeCol = signal(0, ...(ngDevMode ? [{ debugName: "activeCol" }] : []));
|
|
1976
2200
|
/** Dernier item sélectionné (mono), pour restaurer l'affichage si l'utilisateur quitte sans valider. */
|
|
1977
2201
|
this.lastSelected = null;
|
|
1978
2202
|
/** État interne de la multi-sélection (liste cumulative à travers les recherches). */
|
|
@@ -1983,24 +2207,25 @@ class AutocompleteComponent {
|
|
|
1983
2207
|
this._initialized = signal(false, ...(ngDevMode ? [{ debugName: "_initialized" }] : []));
|
|
1984
2208
|
// ---------- Computed ----------
|
|
1985
2209
|
this.resolvedId = computed(() => this.id() || `cw-ac-${this._randomId}`, ...(ngDevMode ? [{ debugName: "resolvedId" }] : []));
|
|
1986
|
-
this.
|
|
2210
|
+
this.listboxId = computed(() => `${this.resolvedId()}-listbox`, ...(ngDevMode ? [{ debugName: "listboxId" }] : []));
|
|
1987
2211
|
this.liveId = computed(() => `${this.resolvedId()}-live`, ...(ngDevMode ? [{ debugName: "liveId" }] : []));
|
|
2212
|
+
/** Nombre de colonnes visuelles (displayField + colonnes additionnelles) — alimente le layout CSS. */
|
|
1988
2213
|
this.totalCols = computed(() => 1 + this.columns().length, ...(ngDevMode ? [{ debugName: "totalCols" }] : []));
|
|
1989
|
-
this.
|
|
2214
|
+
this.showListbox = computed(() => this.isOpen() && this.items().length > 0, ...(ngDevMode ? [{ debugName: "showListbox" }] : []));
|
|
1990
2215
|
this.showNoResult = computed(() => this.isOpen() &&
|
|
1991
2216
|
!this.loading() &&
|
|
1992
2217
|
this.items().length === 0 &&
|
|
1993
2218
|
this.term().length >= this.minChars(), ...(ngDevMode ? [{ debugName: "showNoResult" }] : []));
|
|
1994
|
-
/** Id de
|
|
2219
|
+
/** Id de l'option active courante (alimente aria-activedescendant sur l'input combobox). */
|
|
1995
2220
|
this.activeDescendant = computed(() => {
|
|
1996
2221
|
if (!this.isOpen())
|
|
1997
2222
|
return null;
|
|
1998
2223
|
const row = this.activeRow();
|
|
1999
2224
|
if (row === MASTER_ROW)
|
|
2000
|
-
return this.
|
|
2225
|
+
return this.masterOptionId();
|
|
2001
2226
|
if (row < 0)
|
|
2002
2227
|
return null;
|
|
2003
|
-
return this.
|
|
2228
|
+
return this.optionId(row);
|
|
2004
2229
|
}, ...(ngDevMode ? [{ debugName: "activeDescendant" }] : []));
|
|
2005
2230
|
/**
|
|
2006
2231
|
* Items visibles éligibles au master (exclut les `disabled` qui ne sont jamais
|
|
@@ -2037,6 +2262,13 @@ class AutocompleteComponent {
|
|
|
2037
2262
|
}
|
|
2038
2263
|
return this.term().length > 0 || this.control().value != null;
|
|
2039
2264
|
}, ...(ngDevMode ? [{ debugName: "hasAnyContent" }] : []));
|
|
2265
|
+
/**
|
|
2266
|
+
* Chips (multi-sélection) exposés pour être rendus PAR le parent `cw-form-field`, hors du
|
|
2267
|
+
* field-group. Chaque entrée porte l'item complet (pour `onChipRemove`) et son `label` résolu
|
|
2268
|
+
* via `displayField`. Le composant ne rend plus les chips lui-même ; le retrait reste géré ici
|
|
2269
|
+
* (`onChipRemove`), seul l'affichage est délégué.
|
|
2270
|
+
*/
|
|
2271
|
+
this.chips = computed(() => this.selectedItemsState().map((item) => ({ item, label: this.getDisplay(item) })), ...(ngDevMode ? [{ debugName: "chips" }] : []));
|
|
2040
2272
|
/** Clé i18n du message de live region (annonces SR). */
|
|
2041
2273
|
this.liveMessageKey = computed(() => {
|
|
2042
2274
|
if (this.loading())
|
|
@@ -2146,22 +2378,15 @@ class AutocompleteComponent {
|
|
|
2146
2378
|
this.items.set(items);
|
|
2147
2379
|
this.loading.set(false);
|
|
2148
2380
|
this.activeRow.set(items.length > 0 ? 0 : -1);
|
|
2149
|
-
this.activeCol.set(0);
|
|
2150
2381
|
}), takeUntilDestroyed(this.destroyRef))
|
|
2151
2382
|
.subscribe();
|
|
2152
2383
|
}
|
|
2153
2384
|
// ---------- Template helpers ----------
|
|
2154
|
-
|
|
2155
|
-
return `${this.resolvedId()}-
|
|
2156
|
-
}
|
|
2157
|
-
rowId(row) {
|
|
2158
|
-
return `${this.resolvedId()}-r${row}`;
|
|
2385
|
+
optionId(row) {
|
|
2386
|
+
return `${this.resolvedId()}-opt${row}`;
|
|
2159
2387
|
}
|
|
2160
|
-
|
|
2161
|
-
return `${this.resolvedId()}-master
|
|
2162
|
-
}
|
|
2163
|
-
masterCellId() {
|
|
2164
|
-
return `${this.resolvedId()}-master-cell`;
|
|
2388
|
+
masterOptionId() {
|
|
2389
|
+
return `${this.resolvedId()}-opt-master`;
|
|
2165
2390
|
}
|
|
2166
2391
|
/** Compare un item à la liste des sélectionnés via valueField. */
|
|
2167
2392
|
isItemSelected(item) {
|
|
@@ -2177,7 +2402,7 @@ class AutocompleteComponent {
|
|
|
2177
2402
|
return '';
|
|
2178
2403
|
return String(item[this.displayField()] ?? '');
|
|
2179
2404
|
}
|
|
2180
|
-
|
|
2405
|
+
getColumnText(item, colIndex) {
|
|
2181
2406
|
const field = colIndex === 0 ? this.displayField() : this.columns()[colIndex - 1].field;
|
|
2182
2407
|
return String(item[field] ?? '');
|
|
2183
2408
|
}
|
|
@@ -2218,9 +2443,7 @@ class AutocompleteComponent {
|
|
|
2218
2443
|
const actions = handleComboboxKey(event, {
|
|
2219
2444
|
isOpen: this.isOpen(),
|
|
2220
2445
|
itemsCount: this.items().length,
|
|
2221
|
-
totalCols: this.totalCols(),
|
|
2222
2446
|
activeRow: this.activeRow(),
|
|
2223
|
-
activeCol: this.activeCol(),
|
|
2224
2447
|
multi: this.multiple(),
|
|
2225
2448
|
});
|
|
2226
2449
|
for (const a of actions)
|
|
@@ -2257,14 +2480,12 @@ class AutocompleteComponent {
|
|
|
2257
2480
|
}
|
|
2258
2481
|
onMasterMouseEnter() {
|
|
2259
2482
|
this.activeRow.set(MASTER_ROW);
|
|
2260
|
-
this.activeCol.set(0);
|
|
2261
2483
|
}
|
|
2262
2484
|
onRowClick(row) {
|
|
2263
2485
|
this.selectRow(row);
|
|
2264
2486
|
}
|
|
2265
2487
|
onRowMouseEnter(row) {
|
|
2266
2488
|
this.activeRow.set(row);
|
|
2267
|
-
this.activeCol.set(0);
|
|
2268
2489
|
}
|
|
2269
2490
|
// ---------- Internal logic ----------
|
|
2270
2491
|
resolveInitialValue() {
|
|
@@ -2316,15 +2537,13 @@ class AutocompleteComponent {
|
|
|
2316
2537
|
this.close();
|
|
2317
2538
|
break;
|
|
2318
2539
|
case 'setActive':
|
|
2319
|
-
//
|
|
2540
|
+
// Option master (-2) valide en multi ; sinon on borne aux items réels.
|
|
2320
2541
|
if (a.row === MASTER_ROW && this.multiple()) {
|
|
2321
2542
|
this.activeRow.set(MASTER_ROW);
|
|
2322
|
-
this.activeCol.set(0);
|
|
2323
2543
|
this.scrollActiveIntoView();
|
|
2324
2544
|
}
|
|
2325
2545
|
else if (a.row >= 0 && a.row < this.items().length) {
|
|
2326
2546
|
this.activeRow.set(a.row);
|
|
2327
|
-
this.activeCol.set(a.col);
|
|
2328
2547
|
this.scrollActiveIntoView();
|
|
2329
2548
|
}
|
|
2330
2549
|
break;
|
|
@@ -2415,7 +2634,6 @@ class AutocompleteComponent {
|
|
|
2415
2634
|
close() {
|
|
2416
2635
|
this.isOpen.set(false);
|
|
2417
2636
|
this.activeRow.set(-1);
|
|
2418
|
-
this.activeCol.set(0);
|
|
2419
2637
|
if (this.multiple()) {
|
|
2420
2638
|
// En multi : on vide le terme tapé à la fermeture, les items sélectionnés
|
|
2421
2639
|
// restent dans formControl + chips. Pas de notion de lastSelected.
|
|
@@ -2434,17 +2652,17 @@ class AutocompleteComponent {
|
|
|
2434
2652
|
}
|
|
2435
2653
|
}
|
|
2436
2654
|
/**
|
|
2437
|
-
* Scroll
|
|
2655
|
+
* Scroll l'option active dans la vue. W3C : les navigateurs ne le font pas
|
|
2438
2656
|
* pour aria-activedescendant, c'est à nous de le faire (critique pour le zoom).
|
|
2439
2657
|
*/
|
|
2440
2658
|
scrollActiveIntoView() {
|
|
2441
2659
|
queueMicrotask(() => {
|
|
2442
|
-
const
|
|
2660
|
+
const listbox = this.listboxEl()?.nativeElement;
|
|
2443
2661
|
const id = this.activeDescendant();
|
|
2444
|
-
if (!
|
|
2662
|
+
if (!listbox || !id)
|
|
2445
2663
|
return;
|
|
2446
|
-
const
|
|
2447
|
-
|
|
2664
|
+
const option = listbox.querySelector(`[id="${id}"]`);
|
|
2665
|
+
option?.scrollIntoView({ block: 'nearest', inline: 'nearest' });
|
|
2448
2666
|
});
|
|
2449
2667
|
}
|
|
2450
2668
|
// ---------- Utilities ----------
|
|
@@ -2462,7 +2680,7 @@ class AutocompleteComponent {
|
|
|
2462
2680
|
return s.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
|
|
2463
2681
|
}
|
|
2464
2682
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: AutocompleteComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2465
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.20", type: AutocompleteComponent, isStandalone: true, selector: "cw-autocomplete", inputs: { control: { classPropertyName: "control", publicName: "control", isSignal: true, isRequired: true, transformFunction: null }, fetcher: { classPropertyName: "fetcher", publicName: "fetcher", isSignal: true, isRequired: true, transformFunction: null }, displayField: { classPropertyName: "displayField", publicName: "displayField", isSignal: true, isRequired: false, transformFunction: null }, valueField: { classPropertyName: "valueField", publicName: "valueField", isSignal: true, isRequired: false, transformFunction: null }, columns: { classPropertyName: "columns", publicName: "columns", isSignal: true, isRequired: false, transformFunction: null }, multiple: { classPropertyName: "multiple", publicName: "multiple", isSignal: true, isRequired: false, transformFunction: null }, minChars: { classPropertyName: "minChars", publicName: "minChars", isSignal: true, isRequired: false, transformFunction: null }, debounceMs: { classPropertyName: "debounceMs", publicName: "debounceMs", isSignal: true, isRequired: false, transformFunction: null }, selectedItem: { classPropertyName: "selectedItem", publicName: "selectedItem", isSignal: true, isRequired: false, transformFunction: null }, resolver: { classPropertyName: "resolver", publicName: "resolver", isSignal: true, isRequired: false, transformFunction: null }, selectedItems: { classPropertyName: "selectedItems", publicName: "selectedItems", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null }, isRequired: { classPropertyName: "isRequired", publicName: "isRequired", isSignal: true, isRequired: false, transformFunction: null }, isReadonly: { classPropertyName: "isReadonly", publicName: "isReadonly", isSignal: true, isRequired: false, transformFunction: null }, isDisabled: { classPropertyName: "isDisabled", publicName: "isDisabled", isSignal: true, isRequired: false, transformFunction: null }, ariaInvalid: { classPropertyName: "ariaInvalid", publicName: "ariaInvalid", isSignal: true, isRequired: false, transformFunction: null }, ariaDescribedBy: { classPropertyName: "ariaDescribedBy", publicName: "ariaDescribedBy", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { itemSelected: "itemSelected", itemsChange: "itemsChange" }, viewQueries: [{ propertyName: "gridEl", first: true, predicate: ["gridEl"], descendants: true, isSignal: true }, { propertyName: "masterCheckbox", first: true, predicate: ["masterCheckbox"], descendants: true, isSignal: true }], ngImport: i0, template: "<div\n class=\"cw-autocomplete-wrapper\"\n (clickOutside)=\"onClickOutside()\">\n\n <div class=\"field-group\">\n <input\n type=\"text\"\n class=\"field-control cw-autocomplete-input\"\n [id]=\"resolvedId()\"\n [formControl]=\"searchInput\"\n [attr.placeholder]=\"placeholder() ? (placeholder() | translate) : null\"\n [attr.readonly]=\"isReadonly() ? 'readonly' : null\"\n role=\"combobox\"\n aria-autocomplete=\"list\"\n aria-haspopup=\"grid\"\n [attr.aria-expanded]=\"isOpen()\"\n [attr.aria-controls]=\"gridId()\"\n [attr.aria-activedescendant]=\"activeDescendant()\"\n [attr.aria-required]=\"isRequired() ? 'true' : null\"\n [attr.aria-invalid]=\"ariaInvalid() ? 'true' : null\"\n [attr.aria-describedby]=\"ariaDescribedBy()\"\n autocomplete=\"off\"\n (focus)=\"onFocus()\"\n (blur)=\"onBlur()\"\n (keydown)=\"onKeyDown($event)\">\n\n @if (loading()) {\n <span class=\"spinner-border spinner-border-sm\" aria-hidden=\"true\"></span>\n }\n </div>\n\n @if (showGrid()) {\n <div\n #gridEl\n class=\"cw-autocomplete-grid\"\n role=\"grid\"\n [id]=\"gridId()\"\n [attr.aria-labelledby]=\"resolvedId()\"\n [style.--cw-ac-cols]=\"totalCols() + (multiple() ? 1 : 0)\"\n (mousedown)=\"$event.preventDefault()\">\n\n @if (multiple()) {\n <div\n role=\"row\"\n [id]=\"masterRowId()\"\n class=\"cw-autocomplete-row cw-autocomplete-row-master\"\n [class.is-active]=\"activeRow() === MASTER_ROW\"\n (mouseenter)=\"onMasterMouseEnter()\"\n (click)=\"onMasterClick()\">\n <div\n role=\"gridcell\"\n [id]=\"masterCellId()\"\n class=\"cw-autocomplete-cell cw-autocomplete-cell-check\"\n [class.is-active]=\"activeRow() === MASTER_ROW\"\n [attr.aria-selected]=\"activeRow() === MASTER_ROW ? 'true' : null\">\n <input\n #masterCheckbox\n type=\"checkbox\"\n class=\"field-check-input\"\n tabindex=\"-1\"\n aria-hidden=\"true\"\n [checked]=\"masterState() === 'checked'\">\n <span class=\"cw-autocomplete-master-label\">\n {{ (masterState() === 'checked'\n ? '_COMMON._ACTION.DESELECT_ALL'\n : '_COMMON._ACTION.SELECT_ALL') | translate }}\n </span>\n </div>\n </div>\n }\n\n @for (item of items(); track $index; let rowIdx = $index) {\n <div\n role=\"row\"\n [id]=\"rowId(rowIdx)\"\n class=\"cw-autocomplete-row\"\n [class.is-active]=\"activeRow() === rowIdx\"\n [class.is-disabled]=\"isItemDisabled(item)\"\n [attr.aria-selected]=\"multiple() ? (isItemSelected(item) ? 'true' : 'false') : null\"\n [attr.aria-disabled]=\"isItemDisabled(item) ? 'true' : null\"\n (mouseenter)=\"onRowMouseEnter(rowIdx)\"\n (click)=\"onRowClick(rowIdx)\">\n\n @if (multiple()) {\n <div\n role=\"gridcell\"\n class=\"cw-autocomplete-cell cw-autocomplete-cell-check\"\n [attr.aria-selected]=\"null\">\n <input\n type=\"checkbox\"\n class=\"field-check-input\"\n tabindex=\"-1\"\n aria-hidden=\"true\"\n [disabled]=\"isItemDisabled(item)\"\n [checked]=\"isItemSelected(item)\">\n </div>\n }\n\n <div\n role=\"gridcell\"\n [id]=\"cellId(rowIdx, 0)\"\n class=\"cw-autocomplete-cell\"\n [class.is-active]=\"activeRow() === rowIdx && activeCol() === 0\"\n [attr.aria-selected]=\"activeRow() === rowIdx && activeCol() === 0 ? 'true' : null\"\n [innerHTML]=\"highlight(getCellText(item, 0))\">\n </div>\n\n @for (col of columns(); track col.field; let colIdx = $index) {\n <div\n role=\"gridcell\"\n [id]=\"cellId(rowIdx, colIdx + 1)\"\n class=\"cw-autocomplete-cell\"\n [class.is-active]=\"activeRow() === rowIdx && activeCol() === (colIdx + 1)\"\n [attr.aria-selected]=\"activeRow() === rowIdx && activeCol() === (colIdx + 1) ? 'true' : null\"\n [innerHTML]=\"highlight(getCellText(item, colIdx + 1))\">\n </div>\n }\n </div>\n }\n </div>\n }\n\n @if (showNoResult()) {\n <div class=\"cw-autocomplete-no-result\" aria-hidden=\"true\">\n {{ '_COMMON.NO_RESULT' | translate }}\n </div>\n }\n</div>\n\n @if (multiple() && selectedItemsState().length > 0) {\n <ul class=\"cw-autocomplete-chips\" role=\"list\">\n @for (item of selectedItemsState(); track item[valueField()]) {\n <li>\n <button\n type=\"button\"\n class=\"cw-autocomplete-chip\"\n [disabled]=\"isDisabled() || isReadonly()\"\n (click)=\"onChipRemove(item)\">\n <span>{{ getDisplay(item) }}</span>\n @if (!isDisabled() && !isReadonly()) {\n <span aria-hidden=\"true\" class=\"cw-autocomplete-chip-x\">×</span>\n <span class=\"visually-hidden\">\n {{ '_COMMON._ACTION.DELETE' | translate }}\n </span>\n }\n </button>\n </li>\n }\n </ul>\n }\n\n <!-- Live region pour annonces lecteur d'\u00E9cran -->\n <div\n [id]=\"liveId()\"\n class=\"visually-hidden\"\n role=\"status\"\n aria-live=\"polite\"\n aria-atomic=\"true\">\n @if (liveMessageKey(); as key) {\n {{ key | translate: { total: items().length } }}\n }\n </div>\n", styles: [":host{display:block;width:100%}.cw-autocomplete-wrapper{position:relative}.cw-autocomplete-grid{position:absolute;top:100%;left:0;right:0;z-index:1100;margin-top:2px;max-height:16rem;overflow-y:auto;background-color:var(--bs-body-bg, #fff);border:1px solid var(--bs-border-color, #dee2e6);border-radius:.25rem;box-shadow:0 .25rem .75rem #0000001a}.cw-autocomplete-row{display:grid;grid-template-columns:repeat(var(--cw-ac-cols, 1),minmax(0,1fr));align-items:center;cursor:pointer;padding:0}.cw-autocomplete-row.is-active{background-color:var(--bs-primary-bg-subtle, rgba(13, 110, 253, .08))}.cw-autocomplete-row.is-disabled{cursor:not-allowed;opacity:.55}.cw-autocomplete-row.is-disabled.is-active{background-color:var(--bs-secondary-bg-subtle, rgba(0, 0, 0, .04))}.cw-autocomplete-row-master{display:flex;align-items:center;gap:.5rem;padding:.375rem .75rem;background-color:var(--bs-tertiary-bg, #f8f9fa);border-bottom:1px solid var(--bs-border-color, #dee2e6);font-weight:500}.cw-autocomplete-row-master.is-active{background-color:var(--bs-primary-bg-subtle, rgba(13, 110, 253, .12))}.cw-autocomplete-cell{padding:.375rem .75rem;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.cw-autocomplete-cell mark{background-color:transparent;color:inherit;font-weight:700;padding:0}.cw-autocomplete-cell-check{display:flex;align-items:center;gap:.5rem;padding:.375rem .5rem;width:auto;flex:0 0 auto}.cw-autocomplete-cell-check input[type=checkbox]{margin:0;pointer-events:none}.cw-autocomplete-master-label{-webkit-user-select:none;user-select:none}.cw-autocomplete-no-result{position:absolute;top:100%;left:0;right:0;z-index:1100;margin-top:2px;padding:.5rem .75rem;background-color:var(--bs-body-bg, #fff);border:1px solid var(--bs-border-color, #dee2e6);border-radius:.25rem;color:var(--bs-secondary-color, #6c757d);font-style:italic}.cw-autocomplete-chips{display:flex;flex-wrap:wrap;gap:.25rem;margin:.5rem 0 0;padding:0;list-style:none}.cw-autocomplete-chip{display:inline-flex;align-items:center;gap:.375rem;padding:.125rem .5rem;background-color:var(--bs-secondary-bg-subtle, #e9ecef);border:1px solid var(--bs-border-color, #dee2e6);border-radius:1rem;font-size:.875rem;line-height:1.4;cursor:pointer;color:inherit}.cw-autocomplete-chip:hover,.cw-autocomplete-chip:focus-visible{background-color:var(--bs-secondary-bg, #dee2e6);outline:none}.cw-autocomplete-chip:disabled{cursor:not-allowed;opacity:.65;pointer-events:none}.cw-autocomplete-chip-x{font-size:1rem;line-height:1;font-weight:700}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: ReactiveFormsModule }, { 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.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2$1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "ngmodule", type: TranslateModule }, { kind: "directive", type: ClickOutsideDirective, selector: "[clickOutside]", outputs: ["clickOutside"] }, { kind: "pipe", type: i2.TranslatePipe, name: "translate" }] }); }
|
|
2683
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.20", type: AutocompleteComponent, isStandalone: true, selector: "cw-autocomplete", inputs: { control: { classPropertyName: "control", publicName: "control", isSignal: true, isRequired: true, transformFunction: null }, fetcher: { classPropertyName: "fetcher", publicName: "fetcher", isSignal: true, isRequired: true, transformFunction: null }, displayField: { classPropertyName: "displayField", publicName: "displayField", isSignal: true, isRequired: false, transformFunction: null }, valueField: { classPropertyName: "valueField", publicName: "valueField", isSignal: true, isRequired: false, transformFunction: null }, columns: { classPropertyName: "columns", publicName: "columns", isSignal: true, isRequired: false, transformFunction: null }, multiple: { classPropertyName: "multiple", publicName: "multiple", isSignal: true, isRequired: false, transformFunction: null }, minChars: { classPropertyName: "minChars", publicName: "minChars", isSignal: true, isRequired: false, transformFunction: null }, debounceMs: { classPropertyName: "debounceMs", publicName: "debounceMs", isSignal: true, isRequired: false, transformFunction: null }, selectedItem: { classPropertyName: "selectedItem", publicName: "selectedItem", isSignal: true, isRequired: false, transformFunction: null }, resolver: { classPropertyName: "resolver", publicName: "resolver", isSignal: true, isRequired: false, transformFunction: null }, selectedItems: { classPropertyName: "selectedItems", publicName: "selectedItems", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null }, isRequired: { classPropertyName: "isRequired", publicName: "isRequired", isSignal: true, isRequired: false, transformFunction: null }, isReadonly: { classPropertyName: "isReadonly", publicName: "isReadonly", isSignal: true, isRequired: false, transformFunction: null }, isDisabled: { classPropertyName: "isDisabled", publicName: "isDisabled", isSignal: true, isRequired: false, transformFunction: null }, ariaInvalid: { classPropertyName: "ariaInvalid", publicName: "ariaInvalid", isSignal: true, isRequired: false, transformFunction: null }, ariaDescribedBy: { classPropertyName: "ariaDescribedBy", publicName: "ariaDescribedBy", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { itemSelected: "itemSelected", itemsChange: "itemsChange" }, viewQueries: [{ propertyName: "listboxEl", first: true, predicate: ["listboxEl"], descendants: true, isSignal: true }, { propertyName: "masterCheckbox", first: true, predicate: ["masterCheckbox"], descendants: true, isSignal: true }], ngImport: i0, template: "<div\n class=\"autocomplete-wrapper\"\n (clickOutside)=\"onClickOutside()\">\n\n <div class=\"field-group\">\n <input\n type=\"text\"\n class=\"field-control autocomplete-input\"\n [class.has-value]=\"hasAnyContent()\"\n [id]=\"resolvedId()\"\n [formControl]=\"searchInput\"\n [attr.placeholder]=\"placeholder() ? (placeholder() | translate) : null\"\n [attr.readonly]=\"isReadonly() ? 'readonly' : null\"\n role=\"combobox\"\n aria-autocomplete=\"list\"\n aria-haspopup=\"listbox\"\n [attr.aria-expanded]=\"isOpen()\"\n [attr.aria-controls]=\"listboxId()\"\n [attr.aria-activedescendant]=\"activeDescendant()\"\n [attr.aria-required]=\"isRequired() ? 'true' : null\"\n [attr.aria-invalid]=\"ariaInvalid() ? 'true' : null\"\n [attr.aria-describedby]=\"ariaDescribedBy()\"\n autocomplete=\"off\"\n (focus)=\"onFocus()\"\n (blur)=\"onBlur()\"\n (keydown)=\"onKeyDown($event)\">\n\n @if (loading()) {\n <div class=\"autocomplete-loader-container d-flex-h\">\n <span class=\"autocomplete-loader spinner-border spinner-border-sm\" aria-hidden=\"true\"></span>\n </div>\n }\n </div>\n\n @if (showListbox()) {\n <ul\n #listboxEl\n class=\"list-unstyled autocomplete-listbox dropdown-menu show\"\n role=\"listbox\"\n [id]=\"listboxId()\"\n [attr.aria-labelledby]=\"resolvedId()\"\n [attr.aria-multiselectable]=\"multiple() ? 'true' : null\"\n (mousedown)=\"$event.preventDefault()\">\n\n @if (multiple()) {\n <li\n role=\"option\"\n [id]=\"masterOptionId()\"\n class=\"autocomplete-option autocomplete-option-master\"\n [class.is-active]=\"activeRow() === MASTER_ROW\"\n [attr.aria-selected]=\"masterState() === 'checked' ? 'true' : 'false'\"\n (mouseenter)=\"onMasterMouseEnter()\"\n (click)=\"onMasterClick()\">\n <input\n #masterCheckbox\n type=\"checkbox\"\n class=\"field-check-input\"\n tabindex=\"-1\"\n aria-hidden=\"true\"\n [checked]=\"masterState() === 'checked'\">\n <span class=\"autocomplete-master-label fs-sm\">\n {{ (masterState() === 'checked'\n ? '_COMMON._ACTION.DESELECT_ALL'\n : '_COMMON._ACTION.SELECT_ALL') | translate }}\n </span>\n </li>\n }\n\n @for (item of items(); track $index; let rowIdx = $index) {\n <li\n role=\"option\"\n [id]=\"optionId(rowIdx)\"\n class=\"autocomplete-option\"\n [class.is-active]=\"activeRow() === rowIdx\"\n [class.is-disabled]=\"isItemDisabled(item)\"\n [attr.aria-selected]=\"multiple() ? (isItemSelected(item) ? 'true' : 'false') : (activeRow() === rowIdx ? 'true' : null)\"\n [attr.aria-disabled]=\"isItemDisabled(item) ? 'true' : null\"\n (mouseenter)=\"onRowMouseEnter(rowIdx)\"\n (click)=\"onRowClick(rowIdx)\">\n\n @if (multiple()) {\n <input\n type=\"checkbox\"\n class=\"field-check-input\"\n tabindex=\"-1\"\n aria-hidden=\"true\"\n [disabled]=\"isItemDisabled(item)\"\n [checked]=\"isItemSelected(item)\">\n }\n\n <span class=\"autocomplete-option-main fs-sm\" [innerHTML]=\"highlight(getColumnText(item, 0))\"></span>\n\n @for (col of columns(); track col.field; let colIdx = $index) {\n <span class=\"autocomplete-option-additionnal text-muted fs-xs\"\n [innerHTML]=\"highlight(getColumnText(item, colIdx + 1))\"></span>\n }\n </li>\n }\n </ul>\n }\n\n @if (showNoResult()) {\n <div class=\"autocomplete-listbox dropdown-menu show fs-sm px-md\" aria-hidden=\"true\">\n {{ '_COMMON.NO_RESULT' | translate }}\n </div>\n }\n</div>\n\n <!-- Les chips de la multi-s\u00E9lection sont rendus par le parent cw-form-field (hors field-group),\n \u00E0 partir de `chips()` + `onChipRemove()`. Voir form-field.component.html. -->\n\n <!-- Live region pour annonces lecteur d'\u00E9cran -->\n <div\n [id]=\"liveId()\"\n class=\"visually-hidden\"\n role=\"status\"\n aria-live=\"polite\"\n aria-atomic=\"true\">\n @if (liveMessageKey(); as key) {\n {{ key | translate: { total: items().length } }}\n }\n </div>\n", styles: [":host{display:block;width:100%}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: ReactiveFormsModule }, { 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.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2$1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "ngmodule", type: TranslateModule }, { kind: "directive", type: ClickOutsideDirective, selector: "[clickOutside]", outputs: ["clickOutside"] }, { kind: "pipe", type: i2.TranslatePipe, name: "translate" }] }); }
|
|
2466
2684
|
}
|
|
2467
2685
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: AutocompleteComponent, decorators: [{
|
|
2468
2686
|
type: Component,
|
|
@@ -2471,8 +2689,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.20", ngImpo
|
|
|
2471
2689
|
ReactiveFormsModule,
|
|
2472
2690
|
TranslateModule,
|
|
2473
2691
|
ClickOutsideDirective
|
|
2474
|
-
], template: "<div\n class=\"
|
|
2475
|
-
}], ctorParameters: () => [], propDecorators: { control: [{ type: i0.Input, args: [{ isSignal: true, alias: "control", required: true }] }], fetcher: [{ type: i0.Input, args: [{ isSignal: true, alias: "fetcher", required: true }] }], displayField: [{ type: i0.Input, args: [{ isSignal: true, alias: "displayField", required: false }] }], valueField: [{ type: i0.Input, args: [{ isSignal: true, alias: "valueField", required: false }] }], columns: [{ type: i0.Input, args: [{ isSignal: true, alias: "columns", required: false }] }], multiple: [{ type: i0.Input, args: [{ isSignal: true, alias: "multiple", required: false }] }], minChars: [{ type: i0.Input, args: [{ isSignal: true, alias: "minChars", required: false }] }], debounceMs: [{ type: i0.Input, args: [{ isSignal: true, alias: "debounceMs", required: false }] }], selectedItem: [{ type: i0.Input, args: [{ isSignal: true, alias: "selectedItem", required: false }] }], resolver: [{ type: i0.Input, args: [{ isSignal: true, alias: "resolver", required: false }] }], selectedItems: [{ type: i0.Input, args: [{ isSignal: true, alias: "selectedItems", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], id: [{ type: i0.Input, args: [{ isSignal: true, alias: "id", required: false }] }], isRequired: [{ type: i0.Input, args: [{ isSignal: true, alias: "isRequired", required: false }] }], isReadonly: [{ type: i0.Input, args: [{ isSignal: true, alias: "isReadonly", required: false }] }], isDisabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "isDisabled", required: false }] }], ariaInvalid: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaInvalid", required: false }] }], ariaDescribedBy: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaDescribedBy", required: false }] }], itemSelected: [{ type: i0.Output, args: ["itemSelected"] }], itemsChange: [{ type: i0.Output, args: ["itemsChange"] }],
|
|
2692
|
+
], template: "<div\n class=\"autocomplete-wrapper\"\n (clickOutside)=\"onClickOutside()\">\n\n <div class=\"field-group\">\n <input\n type=\"text\"\n class=\"field-control autocomplete-input\"\n [class.has-value]=\"hasAnyContent()\"\n [id]=\"resolvedId()\"\n [formControl]=\"searchInput\"\n [attr.placeholder]=\"placeholder() ? (placeholder() | translate) : null\"\n [attr.readonly]=\"isReadonly() ? 'readonly' : null\"\n role=\"combobox\"\n aria-autocomplete=\"list\"\n aria-haspopup=\"listbox\"\n [attr.aria-expanded]=\"isOpen()\"\n [attr.aria-controls]=\"listboxId()\"\n [attr.aria-activedescendant]=\"activeDescendant()\"\n [attr.aria-required]=\"isRequired() ? 'true' : null\"\n [attr.aria-invalid]=\"ariaInvalid() ? 'true' : null\"\n [attr.aria-describedby]=\"ariaDescribedBy()\"\n autocomplete=\"off\"\n (focus)=\"onFocus()\"\n (blur)=\"onBlur()\"\n (keydown)=\"onKeyDown($event)\">\n\n @if (loading()) {\n <div class=\"autocomplete-loader-container d-flex-h\">\n <span class=\"autocomplete-loader spinner-border spinner-border-sm\" aria-hidden=\"true\"></span>\n </div>\n }\n </div>\n\n @if (showListbox()) {\n <ul\n #listboxEl\n class=\"list-unstyled autocomplete-listbox dropdown-menu show\"\n role=\"listbox\"\n [id]=\"listboxId()\"\n [attr.aria-labelledby]=\"resolvedId()\"\n [attr.aria-multiselectable]=\"multiple() ? 'true' : null\"\n (mousedown)=\"$event.preventDefault()\">\n\n @if (multiple()) {\n <li\n role=\"option\"\n [id]=\"masterOptionId()\"\n class=\"autocomplete-option autocomplete-option-master\"\n [class.is-active]=\"activeRow() === MASTER_ROW\"\n [attr.aria-selected]=\"masterState() === 'checked' ? 'true' : 'false'\"\n (mouseenter)=\"onMasterMouseEnter()\"\n (click)=\"onMasterClick()\">\n <input\n #masterCheckbox\n type=\"checkbox\"\n class=\"field-check-input\"\n tabindex=\"-1\"\n aria-hidden=\"true\"\n [checked]=\"masterState() === 'checked'\">\n <span class=\"autocomplete-master-label fs-sm\">\n {{ (masterState() === 'checked'\n ? '_COMMON._ACTION.DESELECT_ALL'\n : '_COMMON._ACTION.SELECT_ALL') | translate }}\n </span>\n </li>\n }\n\n @for (item of items(); track $index; let rowIdx = $index) {\n <li\n role=\"option\"\n [id]=\"optionId(rowIdx)\"\n class=\"autocomplete-option\"\n [class.is-active]=\"activeRow() === rowIdx\"\n [class.is-disabled]=\"isItemDisabled(item)\"\n [attr.aria-selected]=\"multiple() ? (isItemSelected(item) ? 'true' : 'false') : (activeRow() === rowIdx ? 'true' : null)\"\n [attr.aria-disabled]=\"isItemDisabled(item) ? 'true' : null\"\n (mouseenter)=\"onRowMouseEnter(rowIdx)\"\n (click)=\"onRowClick(rowIdx)\">\n\n @if (multiple()) {\n <input\n type=\"checkbox\"\n class=\"field-check-input\"\n tabindex=\"-1\"\n aria-hidden=\"true\"\n [disabled]=\"isItemDisabled(item)\"\n [checked]=\"isItemSelected(item)\">\n }\n\n <span class=\"autocomplete-option-main fs-sm\" [innerHTML]=\"highlight(getColumnText(item, 0))\"></span>\n\n @for (col of columns(); track col.field; let colIdx = $index) {\n <span class=\"autocomplete-option-additionnal text-muted fs-xs\"\n [innerHTML]=\"highlight(getColumnText(item, colIdx + 1))\"></span>\n }\n </li>\n }\n </ul>\n }\n\n @if (showNoResult()) {\n <div class=\"autocomplete-listbox dropdown-menu show fs-sm px-md\" aria-hidden=\"true\">\n {{ '_COMMON.NO_RESULT' | translate }}\n </div>\n }\n</div>\n\n <!-- Les chips de la multi-s\u00E9lection sont rendus par le parent cw-form-field (hors field-group),\n \u00E0 partir de `chips()` + `onChipRemove()`. Voir form-field.component.html. -->\n\n <!-- Live region pour annonces lecteur d'\u00E9cran -->\n <div\n [id]=\"liveId()\"\n class=\"visually-hidden\"\n role=\"status\"\n aria-live=\"polite\"\n aria-atomic=\"true\">\n @if (liveMessageKey(); as key) {\n {{ key | translate: { total: items().length } }}\n }\n </div>\n", styles: [":host{display:block;width:100%}\n"] }]
|
|
2693
|
+
}], ctorParameters: () => [], propDecorators: { control: [{ type: i0.Input, args: [{ isSignal: true, alias: "control", required: true }] }], fetcher: [{ type: i0.Input, args: [{ isSignal: true, alias: "fetcher", required: true }] }], displayField: [{ type: i0.Input, args: [{ isSignal: true, alias: "displayField", required: false }] }], valueField: [{ type: i0.Input, args: [{ isSignal: true, alias: "valueField", required: false }] }], columns: [{ type: i0.Input, args: [{ isSignal: true, alias: "columns", required: false }] }], multiple: [{ type: i0.Input, args: [{ isSignal: true, alias: "multiple", required: false }] }], minChars: [{ type: i0.Input, args: [{ isSignal: true, alias: "minChars", required: false }] }], debounceMs: [{ type: i0.Input, args: [{ isSignal: true, alias: "debounceMs", required: false }] }], selectedItem: [{ type: i0.Input, args: [{ isSignal: true, alias: "selectedItem", required: false }] }], resolver: [{ type: i0.Input, args: [{ isSignal: true, alias: "resolver", required: false }] }], selectedItems: [{ type: i0.Input, args: [{ isSignal: true, alias: "selectedItems", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], id: [{ type: i0.Input, args: [{ isSignal: true, alias: "id", required: false }] }], isRequired: [{ type: i0.Input, args: [{ isSignal: true, alias: "isRequired", required: false }] }], isReadonly: [{ type: i0.Input, args: [{ isSignal: true, alias: "isReadonly", required: false }] }], isDisabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "isDisabled", required: false }] }], ariaInvalid: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaInvalid", required: false }] }], ariaDescribedBy: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaDescribedBy", required: false }] }], itemSelected: [{ type: i0.Output, args: ["itemSelected"] }], itemsChange: [{ type: i0.Output, args: ["itemsChange"] }], listboxEl: [{ type: i0.ViewChild, args: ['listboxEl', { isSignal: true }] }], masterCheckbox: [{ type: i0.ViewChild, args: ['masterCheckbox', { isSignal: true }] }] } });
|
|
2476
2694
|
|
|
2477
2695
|
function rangeValidator(group, type) {
|
|
2478
2696
|
const startControl = group.get('start');
|
|
@@ -2646,6 +2864,15 @@ class FormFieldComponent {
|
|
|
2646
2864
|
get isEffectivelyDisabled() {
|
|
2647
2865
|
return !!this.controlOrGroup?.disabled || !!this.isDisabled;
|
|
2648
2866
|
}
|
|
2867
|
+
/**
|
|
2868
|
+
* `true` si le champ est désactivé OU en lecture seule. Sert à poser une classe d'état
|
|
2869
|
+
* sur le wrapper `.field-group` (même rendu visuel pour les deux états, comme demandé),
|
|
2870
|
+
* pour englober les addons dans le style désactivé/lecture-seule — exactement comme
|
|
2871
|
+
* `isInvalid` le fait avec `.field-group-invalid`.
|
|
2872
|
+
*/
|
|
2873
|
+
get isDisabledOrReadonly() {
|
|
2874
|
+
return this.isEffectivelyDisabled || !!this.isReadonly;
|
|
2875
|
+
}
|
|
2649
2876
|
/**
|
|
2650
2877
|
* Synchronise l'état `disabled` du control lié avec l'input `isDisabled`.
|
|
2651
2878
|
*
|
|
@@ -3173,6 +3400,7 @@ class FormFieldComponent {
|
|
|
3173
3400
|
this.typeField.email,
|
|
3174
3401
|
this.typeField.textarea,
|
|
3175
3402
|
this.typeField.password,
|
|
3403
|
+
this.typeField.phone,
|
|
3176
3404
|
this.typeField.select,
|
|
3177
3405
|
this.typeField.ngSelect,
|
|
3178
3406
|
this.typeField.ngSelectMultiple,
|
|
@@ -3228,6 +3456,22 @@ class FormFieldComponent {
|
|
|
3228
3456
|
// cycle que pour un champ requis vide qu'on focus directement.
|
|
3229
3457
|
this.focusFieldControl();
|
|
3230
3458
|
}
|
|
3459
|
+
/**
|
|
3460
|
+
* Clear du type `autocomplete` : délègue le vidage de l'état interne au composant
|
|
3461
|
+
* `cw-autocomplete` (`clear()` reset texte/grille + remet le control à null), puis reproduit
|
|
3462
|
+
* le comportement de `onClearField` — control remis pristine/untouched et focus redonné au
|
|
3463
|
+
* champ. Sans ça, le clic sur le bouton clear blur l'input (→ `onBlur()` de l'autocomplete
|
|
3464
|
+
* pose `touched`), et un champ requis vidé s'afficherait aussitôt en erreur "obligatoire".
|
|
3465
|
+
* Le refocus n'enchaîne pas sur le `onFocus()` du form-field (l'input est interne au
|
|
3466
|
+
* composant autocomplete), d'où le `markAsUntouched()` explicite ici.
|
|
3467
|
+
*/
|
|
3468
|
+
onClearAutocomplete() {
|
|
3469
|
+
this.autocompleteRef()?.clear();
|
|
3470
|
+
const ctrl = this.controlOrGroup;
|
|
3471
|
+
ctrl?.markAsPristine();
|
|
3472
|
+
ctrl?.markAsUntouched();
|
|
3473
|
+
this.focusFieldControl();
|
|
3474
|
+
}
|
|
3231
3475
|
/** Redonne le focus à l'input principal du champ (`.field-control`) après une action de clear. */
|
|
3232
3476
|
focusFieldControl() {
|
|
3233
3477
|
const el = this.elementRef.nativeElement.querySelector('.field-control');
|
|
@@ -3279,7 +3523,7 @@ class FormFieldComponent {
|
|
|
3279
3523
|
this.formControl.markAsTouched();
|
|
3280
3524
|
}
|
|
3281
3525
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: FormFieldComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
3282
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.20", type: FormFieldComponent, isStandalone: true, selector: "cw-form-field", inputs: { control: { classPropertyName: "control", publicName: "control", isSignal: false, isRequired: false, transformFunction: null }, formGroup: { classPropertyName: "formGroup", publicName: "formGroup", isSignal: false, isRequired: false, transformFunction: null }, type: { classPropertyName: "type", publicName: "type", isSignal: false, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: false, isRequired: false, transformFunction: null }, displayLabel: { classPropertyName: "displayLabel", publicName: "displayLabel", isSignal: false, isRequired: false, transformFunction: null }, name: { classPropertyName: "name", publicName: "name", isSignal: false, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: false, isRequired: false, transformFunction: null }, autocomplete: { classPropertyName: "autocomplete", publicName: "autocomplete", isSignal: false, isRequired: false, transformFunction: null }, options: { classPropertyName: "options", publicName: "options", isSignal: false, isRequired: false, transformFunction: null }, rangeOptions: { classPropertyName: "rangeOptions", publicName: "rangeOptions", isSignal: false, isRequired: false, transformFunction: null }, validationOptions: { classPropertyName: "validationOptions", publicName: "validationOptions", isSignal: false, isRequired: false, transformFunction: null }, autocompleteOptions: { classPropertyName: "autocompleteOptions", publicName: "autocompleteOptions", isSignal: false, isRequired: false, transformFunction: null }, errorMessages: { classPropertyName: "errorMessages", publicName: "errorMessages", isSignal: false, isRequired: false, transformFunction: null }, isRequired: { classPropertyName: "isRequired", publicName: "isRequired", isSignal: false, isRequired: false, transformFunction: null }, help: { classPropertyName: "help", publicName: "help", isSignal: false, isRequired: false, transformFunction: null }, tooltip: { classPropertyName: "tooltip", publicName: "tooltip", isSignal: false, isRequired: false, transformFunction: null }, addonLeft: { classPropertyName: "addonLeft", publicName: "addonLeft", isSignal: false, isRequired: false, transformFunction: null }, addonRight: { classPropertyName: "addonRight", publicName: "addonRight", isSignal: false, isRequired: false, transformFunction: null }, isInAddon: { classPropertyName: "isInAddon", publicName: "isInAddon", isSignal: false, isRequired: false, transformFunction: null }, isReadonly: { classPropertyName: "isReadonly", publicName: "isReadonly", isSignal: false, isRequired: false, transformFunction: null }, isDisabled: { classPropertyName: "isDisabled", publicName: "isDisabled", isSignal: false, isRequired: false, transformFunction: null }, sliderValue: { classPropertyName: "sliderValue", publicName: "sliderValue", isSignal: false, isRequired: false, transformFunction: null }, sliderOptions: { classPropertyName: "sliderOptions", publicName: "sliderOptions", isSignal: false, isRequired: false, transformFunction: null }, cssClass: { classPropertyName: "cssClass", publicName: "cssClass", isSignal: false, isRequired: false, transformFunction: null }, skeletonMode: { classPropertyName: "skeletonMode", publicName: "skeletonMode", isSignal: false, isRequired: false, transformFunction: null }, clearable: { classPropertyName: "clearable", publicName: "clearable", isSignal: false, isRequired: false, transformFunction: null }, appendTo: { classPropertyName: "appendTo", publicName: "appendTo", isSignal: false, isRequired: false, transformFunction: null }, initialCountry: { classPropertyName: "initialCountry", publicName: "initialCountry", isSignal: false, isRequired: false, transformFunction: null }, indeterminate: { classPropertyName: "indeterminate", publicName: "indeterminate", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { refreshEvent: "refreshEvent", textChanged: "textChanged", valueChange: "valueChange", phoneRegionChange: "phoneRegionChange" }, host: { properties: { "class": "this.hostClasses" } }, queries: [{ propertyName: "optionTemplate", first: true, predicate: ["ngOptionTpl"], descendants: true, read: TemplateRef }, { propertyName: "labelTemplate", first: true, predicate: ["ngLabelTpl"], descendants: true, read: TemplateRef }], viewQueries: [{ propertyName: "checkboxInputRef", first: true, predicate: ["checkboxInput"], descendants: true, isSignal: true }, { propertyName: "fileInputRef", first: true, predicate: ["fileInput"], descendants: true, isSignal: true }, { propertyName: "phoneInputRef", first: true, predicate: ["phoneInput"], descendants: true, isSignal: true }, { propertyName: "autocompleteRef", first: true, predicate: AutocompleteComponent, descendants: true, isSignal: true }], usesOnChanges: true, ngImport: i0, template: "@if (!isInAddon) {\r\n @if (\r\n type !== typeField.checkbox &&\r\n type !== typeField.radio &&\r\n type !== typeField.checkboxButton &&\r\n type !== typeField.radioButton &&\r\n type !== typeField.checkboxInline &&\r\n type !== typeField.radioInline &&\r\n type !== typeField.switch &&\r\n type !== typeField.range &&\r\n type !== typeField.switchSmall\r\n ) {\r\n <label [for]=\"name\" class=\"field-label\" [class.visually-hidden]=\"!displayLabel\">\r\n {{ label | translate }}\r\n\r\n @if (isRequired) {\r\n <span class=\"text-danger\">*</span>\r\n }\r\n\r\n @if (tooltip) {\r\n <!-- <button type=\"button\" class=\"btn btn-link btn-popover\" placement=\"bottom\" [ngbPopover]=\"popContent\" container=\"body\"\r\n triggers=\"mouseenter:mouseleave\">\r\n <span class=\"btn-popover-icon bo-icons bo-help\"></span>\r\n </button>\r\n <ng-template #popContent>\r\n <div [innerHTML]=\"tooltip\"></div>\r\n </ng-template> -->\r\n }\r\n </label>\r\n }\r\n\r\n @if (addonLeft || addonRight) {\r\n <div class=\"field-group\" [class.field-group-invalid]=\"isInvalid\">\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\" [class.field-group-invalid]=\"isInvalid\">\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 (\r\n !errorMessages?.['required'] &&\r\n ((controlOrGroup?.errors?.['required']) || (getControl('start')?.errors?.['required'] || getControl('end')?.errors?.['required']))\r\n ) {\r\n <span [innerHtml]=\"'_COMMON._FORM.ERROR_IS_MANDATORY' | translate: {label: label | translate}\"></span>\r\n }\r\n @if (!errorMessages?.['rangeInvalid'] && controlOrGroup?.errors?.['rangeInvalid']) {\r\n <span>{{'_COMMON._DATES.ERROR_START_END_PERIOD' | translate}}</span>\r\n }\r\n @if (!errorMessages?.['fileExtension'] && controlOrGroup?.errors?.['fileExtension']) {\r\n <span>{{ '_COMMON._FORM.ERROR_FILE_EXTENSION' | translate: { accept: acceptLabel } }}</span>\r\n }\r\n @if (!errorMessages?.['fileSize'] && controlOrGroup?.errors?.['fileSize']) {\r\n <span>{{ '_COMMON._FORM.ERROR_FILE_SIZE' | translate: { maxSize: maxSizeLabel } }}</span>\r\n }\r\n @if (!errorMessages?.['email'] && controlOrGroup?.errors?.['email']) {\r\n <span>{{ '_COMMON._FORM.ERROR_INVALID_EMAIL' | translate }}</span>\r\n }\r\n @if (!errorMessages?.['phone'] && controlOrGroup?.errors?.['phone']) {\r\n <span>{{ '_COMMON._FORM.ERROR_INVALID_PHONE' | translate }}</span>\r\n }\r\n @if (errorMessages) {\r\n @for (entry of errorMessages | keyvalue: keepOrder; track entry.key) {\r\n @if (controlOrGroup?.errors?.[entry.key]; as errVal) {\r\n <span>{{ entry.value | translate: (errVal === true ? null : errVal) }}</span>\r\n }\r\n }\r\n }\r\n </div>\r\n }\r\n\r\n @if (help || autoHelpEntries.length) {\r\n <div [id]=\"name + '-help'\" class=\"field-text\">\r\n @if (help) {\r\n <span>{{ help | translate }}</span>\r\n }\r\n @for (entry of autoHelpEntries; track entry.key) {\r\n <span>{{ entry.key | translate: entry.params }}</span>\r\n }\r\n </div>\r\n }\r\n}\r\n@else {\r\n <ng-container [ngTemplateOutlet]=\"field\"></ng-container>\r\n}\r\n\r\n<ng-template #field>\r\n <!-- Autocomplete (mono / multi) -->\r\n @if ((type === typeField.autocomplete || type === typeField.autocompleteMultiple) && autocompleteOptions) {\r\n <cw-autocomplete\r\n [id]=\"name\"\r\n [control]=\"formControl\"\r\n [fetcher]=\"autocompleteOptions.fetcher\"\r\n [displayField]=\"autocompleteOptions.displayField ?? 'label'\"\r\n [valueField]=\"autocompleteOptions.valueField ?? 'id'\"\r\n [columns]=\"autocompleteOptions.columns ?? []\"\r\n [resolver]=\"autocompleteOptions.resolver ?? null\"\r\n [selectedItem]=\"autocompleteOptions.selectedItem ?? null\"\r\n [selectedItems]=\"autocompleteOptions.selectedItems ?? []\"\r\n [minChars]=\"autocompleteOptions.minChars ?? 2\"\r\n [debounceMs]=\"autocompleteOptions.debounceMs ?? 250\"\r\n [multiple]=\"type === typeField.autocompleteMultiple\"\r\n [isRequired]=\"isRequired\"\r\n [isReadonly]=\"!!isReadonly\"\r\n [isDisabled]=\"isEffectivelyDisabled\"\r\n [ariaInvalid]=\"control.invalid && control.touched\"\r\n [ariaDescribedBy]=\"getDescribedBy(control)\"\r\n [placeholder]=\"placeholder\">\r\n </cw-autocomplete>\r\n }\r\n\r\n <!-- Text -->\r\n @if ([typeField.text, typeField.date, typeField.time, typeField.dateTime, typeField.number,\r\n typeField.email,\r\n typeField.color, typeField.zipCode].includes(type)) {\r\n <input [type]=\"type === typeField.zipCode ? 'text' : type\" class=\"field-control\" [id]=\"name\" [formControl]=\"formControl\"\r\n [ngClass]=\"[(cssClass || ''), formControl?.value ? 'has-value' : '', type === typeField.zipCode ? 'field-control-zipcode' : '']\"\r\n [attr.placeholder]=\"placeholder ? (placeholder | translate) : null\" [attr.required]=\"isRequired ? 'required' : null\"\r\n [attr.readonly]=\"isReadonly ? 'readonly' : null\" [attr.aria-required]=\"isRequired\"\r\n [attr.minlength]=\"minLengthAttr\" [attr.maxlength]=\"maxLengthAttr\"\r\n [attr.min]=\"minAttr\" [attr.max]=\"maxAttr\" [attr.step]=\"stepAttr\" [attr.pattern]=\"patternAttr\"\r\n [attr.autocomplete]=\"autocomplete\"\r\n [attr.aria-invalid]=\"control.invalid && control.touched\"\r\n [attr.aria-describedby]=\"getDescribedBy(control)\"\r\n (focus)=\"onFocus()\" (blur)=\"onBlur()\" />\r\n }\r\n\r\n <!-- Phone (intl-tel-input) -->\r\n @if (type === typeField.phone) {\r\n <input #phoneInput type=\"tel\" class=\"field-control\" [id]=\"name\"\r\n [attr.placeholder]=\"placeholder ? (placeholder | translate) : null\" [attr.required]=\"isRequired ? 'required' : null\"\r\n [attr.readonly]=\"isReadonly ? 'readonly' : null\" [disabled]=\"isEffectivelyDisabled\" [attr.aria-required]=\"isRequired\"\r\n [attr.autocomplete]=\"autocomplete\"\r\n [attr.aria-invalid]=\"control.invalid && control.touched\"\r\n [attr.aria-describedby]=\"getDescribedBy(control)\"\r\n (focus)=\"onFocus()\" (blur)=\"onPhoneBlur($event)\" />\r\n }\r\n\r\n <!-- File -->\r\n @if (type === typeField.file) {\r\n <input #fileInput type=\"file\" class=\"field-control\" [id]=\"name\"\r\n [ngClass]=\"[(cssClass || ''), formControl?.value ? 'has-value' : '']\"\r\n [attr.placeholder]=\"placeholder ? (placeholder | translate) : null\" [attr.required]=\"isRequired ? 'required' : null\"\r\n [attr.readonly]=\"isReadonly ? 'readonly' : null\" [disabled]=\"isEffectivelyDisabled\" [attr.aria-required]=\"isRequired\"\r\n [attr.accept]=\"acceptAttr\"\r\n [attr.aria-invalid]=\"control.invalid && control.touched\"\r\n [attr.aria-describedby]=\"getDescribedBy(control)\"\r\n (change)=\"onFileChange($event)\" (focus)=\"onFocus()\" (blur)=\"onBlur()\" />\r\n }\r\n\r\n @if (type === typeField.password) {\r\n <input [type]=\"isPasswordShown ? 'text' : 'password'\" class=\"field-control\" [id]=\"name\" [formControl]=\"formControl\"\r\n [ngClass]=\"[(cssClass || ''), formControl?.value ? 'has-value' : '']\"\r\n [attr.required]=\"isRequired ? 'required' : null\" [attr.readonly]=\"isReadonly ? 'readonly' : null\"\r\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\" [attr.aria-required]=\"isRequired\"\r\n [attr.minlength]=\"minLengthAttr\" [attr.maxlength]=\"maxLengthAttr\" [attr.pattern]=\"patternAttr\"\r\n [attr.autocomplete]=\"autocomplete\"\r\n [attr.aria-invalid]=\"control.invalid && control.touched\"\r\n [attr.aria-describedby]=\"getDescribedBy(control)\"\r\n (focus)=\"onFocus()\" (blur)=\"onBlur()\" />\r\n <cw-button [type]=\"buttonType.secondary\"\r\n [withIcon]=\"isPasswordShown ? spriteIcon.toolbarHidePassword : spriteIcon.toolbarShowPassword\"\r\n [withOnlyIcon]=\"true\"\r\n [label]=\"isPasswordShown ? '_COMMON._FORM._SHOW_HIDE_PWD.HIDE' : '_COMMON._FORM._SHOW_HIDE_PWD.SHOW'\"\r\n (btnAction)=\"togglePasswordVisibility()\">\r\n </cw-button>\r\n }\r\n\r\n <!-- Textarea -->\r\n @if (type === typeField.textarea) {\r\n <textarea class=\"field-control\" [id]=\"name\" [formControl]=\"formControl\"\r\n [ngClass]=\"[(cssClass || ''), formControl?.value ? 'has-value' : '']\"\r\n [attr.placeholder]=\"placeholder ? (placeholder | translate) : null\" [attr.required]=\"isRequired ? 'required' : null\"\r\n [attr.readonly]=\"isReadonly ? 'readonly' : null\" [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\"\r\n [attr.aria-required]=\"isRequired\" [attr.aria-invalid]=\"control.invalid && control.touched\"\r\n [attr.minlength]=\"minLengthAttr\" [attr.maxlength]=\"maxLengthAttr\" [attr.pattern]=\"patternAttr\"\r\n [attr.autocomplete]=\"autocomplete\"\r\n [attr.aria-describedby]=\"getDescribedBy(control)\"\r\n (focus)=\"onFocus()\" (blur)=\"onBlur()\"></textarea>\r\n }\r\n\r\n <!-- Select -->\r\n @if (type === typeField.select) {\r\n <ng-select [formControl]=\"formControl\" [items]=\"options\" bindLabel=\"label\" [labelForId]=\"name\" [appendTo]=\"appendTo\" bindValue=\"value\"\r\n [ngClass]=\"cssClass\" [searchable]=\"false\" [placeholder]=\"placeholder ? (placeholder | translate) : null\" [readonly]=\"isReadonly\" [clearable]=\"false\"\r\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\" [attr.required]=\"isRequired ? 'required' : null\"\r\n [attr.aria-required]=\"isRequired\" [attr.aria-invalid]=\"control.invalid && control.touched\"\r\n [attr.aria-describedby]=\"getDescribedBy(control)\" [attr.id]=\"name\"\r\n (focus)=\"onFocus()\" (blur)=\"onBlur()\">\r\n\r\n <!-- Template pour les options -->\r\n <ng-template ng-option-tmp let-item=\"item\" let-index=\"index\" let-search=\"searchTerm\">\r\n @if (optionTemplate) {\r\n <ng-container *ngTemplateOutlet=\"optionTemplate; context: { item: item | translate, index: index, searchTerm: search }\"></ng-container>\r\n }\r\n @else {\r\n <div>{{ item.label | translate }}</div>\r\n }\r\n </ng-template>\r\n\r\n <!-- Template pour le label -->\r\n <ng-template ng-label-tmp let-item=\"item\">\r\n @if (labelTemplate) {\r\n <ng-container *ngTemplateOutlet=\"labelTemplate; context: { item: item | translate }\"></ng-container>\r\n }\r\n @else {\r\n {{ (item.label | translate) || (placeholder | translate) }}\r\n }\r\n </ng-template>\r\n </ng-select>\r\n }\r\n\r\n <!-- NgSelect -->\r\n @if (type === typeField.ngSelect || type === typeField.ngSelectMultiple) {\r\n <ng-select [formControl]=\"formControl\" [items]=\"options\" bindLabel=\"label\" [labelForId]=\"name\" [appendTo]=\"appendTo\" bindValue=\"value\"\r\n [multiple]=\"type === typeField.ngSelectMultiple\" [ngClass]=\"cssClass\" [clearable]=\"false\"\r\n [placeholder]=\"placeholder ? (placeholder | translate) : null\" [readonly]=\"isReadonly\"\r\n [notFoundText]=\"'_COMMON.NO_RESULT' | translate\" [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\"\r\n [attr.required]=\"isRequired ? 'required' : null\" [attr.aria-required]=\"isRequired\"\r\n [attr.aria-invalid]=\"control.invalid && control.touched\"\r\n [attr.aria-describedby]=\"getDescribedBy(control)\" [attr.id]=\"name\"\r\n (focus)=\"onFocus()\" (blur)=\"onBlur()\" (search)=\"textChanged.emit($event?.term)\">\r\n\r\n <!-- Template pour les options -->\r\n <ng-template ng-option-tmp let-item=\"item\" let-index=\"index\" let-search=\"searchTerm\">\r\n @if (optionTemplate) {\r\n <ng-container *ngTemplateOutlet=\"optionTemplate; context: { item: item, index: index, searchTerm: search }\"></ng-container>\r\n }\r\n @else {\r\n <div>{{ item.label | translate }}</div>\r\n }\r\n </ng-template>\r\n\r\n <!-- Template pour le label -->\r\n <ng-template ng-label-tmp let-item=\"item\" let-clear=\"clear\">\r\n <span class=\"ng-value-icon left\" (click)=\"clear(item)\" aria-hidden=\"true\">\u00D7</span>\r\n @if (labelTemplate) {\r\n <ng-container *ngTemplateOutlet=\"labelTemplate; context: { item: item | translate }\"></ng-container>\r\n }\r\n @else {\r\n {{ (item.label | translate) || (placeholder | translate) }}\r\n }\r\n </ng-template>\r\n </ng-select>\r\n }\r\n\r\n <!-- Radio -->\r\n @if (type === typeField.radioInline || type === typeField.radio) {\r\n <fieldset\r\n [attr.aria-required]=\"isRequired\"\r\n [attr.aria-invalid]=\"control.invalid && control.touched\"\r\n [attr.aria-describedby]=\"getDescribedBy(control)\">\r\n <legend class=\"field-label\" [class.visually-hidden]=\"!displayLabel\">\r\n {{label | translate}}\r\n @if(isRequired) {\r\n <span class=\"text-danger\">*</span>\r\n }\r\n </legend>\r\n <ul class=\"list-unstyled mb-none\" [ngClass]=\"type === typeField.radioInline ? 'd-flex-h gap-md flex-wrap' : 'd-flex-v'\">\r\n @for (opt of options; track opt.value) {\r\n <li class=\"field-check\">\r\n <input type=\"radio\" [id]=\"name + '_' + opt.value\" [value]=\"opt.value\" [formControl]=\"formControl\"\r\n class=\"field-check-input\" [attr.disabled]=\"(isEffectivelyDisabled || opt.disabled) ? 'disabled' : null\" (change)=\"onRadioChange(opt.value)\" />\r\n <label [for]=\"name + '_' + opt.value\" class=\"field-check-label\">{{ opt.label | translate }}</label>\r\n </li>\r\n }\r\n </ul>\r\n </fieldset>\r\n }\r\n\r\n <!-- Radio button -->\r\n @if (type === typeField.radioButton) {\r\n <fieldset\r\n [attr.aria-required]=\"isRequired\"\r\n [attr.aria-invalid]=\"control.invalid && control.touched\"\r\n [attr.aria-describedby]=\"getDescribedBy(control)\">\r\n <legend class=\"field-label\" [class.visually-hidden]=\"!displayLabel\">\r\n {{label | translate}}\r\n @if(isRequired) {\r\n <span class=\"text-danger\">*</span>\r\n }\r\n </legend>\r\n <div class=\"field-group field-group-btn\">\r\n @for (opt of options; track opt.value) {\r\n <input type=\"radio\" [id]=\"name + '_' + opt.value\" [value]=\"opt.value\" [formControl]=\"formControl\"\r\n class=\"visually-hidden\" [attr.disabled]=\"(isEffectivelyDisabled || opt.disabled) ? 'disabled' : null\" (change)=\"onRadioChange(opt.value)\"/>\r\n <label [for]=\"name + '_' + opt.value\" class=\"btn btn-field-group\">{{ opt.label | translate }}</label>\r\n }\r\n </div>\r\n </fieldset>\r\n }\r\n\r\n <!-- Checkbox Switch -->\r\n @if ( type === typeField.switch || type === typeField.switchSmall)\r\n {\r\n <div class=\"field-check field-switch\" [ngClass]=\"{'field-switch-small': type === typeField.switchSmall}\">\r\n <input type=\"checkbox\" [id]=\"name\" [formControl]=\"formControl\" class=\"field-check-input\" [attr.aria-required]=\"isRequired\"\r\n [attr.aria-invalid]=\"control.invalid && control.touched\"\r\n [attr.aria-describedby]=\"getDescribedBy(control)\"\r\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\"/>\r\n <label [for]=\"name\" class=\"field-check-label\">{{ label | translate }}</label>\r\n </div>\r\n }\r\n\r\n <!-- Checkbox -->\r\n @if (type === typeField.checkboxInline || type === typeField.checkbox) {\r\n @if (isSingleCheckbox()) {\r\n <div class=\"field-check\" [class.field-check-inline]=\"type === typeField.checkboxInline\">\r\n <input #checkboxInput type=\"checkbox\" [id]=\"name\" [formControl]=\"formControl\"\r\n class=\"field-check-input\"\r\n [class.is-invalid]=\"control?.invalid && control?.touched\"\r\n [attr.aria-required]=\"isRequired\"\r\n [attr.aria-invalid]=\"control?.invalid && control?.touched\"\r\n [attr.aria-describedby]=\"getDescribedBy(control)\"\r\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\" />\r\n <label [for]=\"name\" class=\"field-check-label\">\r\n {{ label | translate }}\r\n @if (isRequired) {\r\n <span class=\"text-danger\">*</span>\r\n }\r\n </label>\r\n </div>\r\n }\r\n @else if( options.length > 1) {\r\n <fieldset\r\n [attr.aria-required]=\"isRequired\"\r\n [attr.aria-invalid]=\"control.invalid && control.touched\"\r\n [attr.aria-describedby]=\"getDescribedBy(control)\"\r\n [ngClass]=\"{ 'flex-column': type === typeField.checkbox }\">\r\n <legend class=\"field-label\" [class.visually-hidden]=\"!displayLabel\">\r\n {{label | translate}}\r\n @if(isRequired) {\r\n <span class=\"text-danger\">*</span>\r\n }\r\n </legend>\r\n <ul class=\"list-unstyled mb-none\" [ngClass]=\"type === typeField.checkboxInline ? 'd-flex-h gap-md' : 'd-flex-v'\">\r\n @for (opt of options; track opt.value) {\r\n <li class=\"field-check\" [ngClass]=\"{ 'field-check-inline': type === typeField.checkboxInline }\">\r\n <input type=\"checkbox\" [id]=\"name + '_' + opt.value\" [value]=\"opt.value\" (change)=\"onCheckboxChange($event)\"\r\n [checked]=\"control.value?.includes(opt.value)\" class=\"field-check-input\"\r\n [attr.disabled]=\"(isEffectivelyDisabled || opt.disabled) ? 'disabled' : null\" />\r\n <label [for]=\"name + '_' + opt.value\" class=\"field-check-label\">\r\n {{ opt.label | translate }}\r\n </label>\r\n </li>\r\n }\r\n </ul>\r\n </fieldset>\r\n }\r\n @else {\r\n <fieldset>\r\n <legend class=\"field-label\" [class.visually-hidden]=\"!displayLabel\">\r\n {{label | translate}}\r\n </legend>\r\n <ul class=\"list-unstyled mb-none\" [ngClass]=\"type === typeField.checkboxInline ? 'd-flex-h gap-md' : 'd-flex-v'\">\r\n @for (opt of options; track opt.value) {\r\n <li class=\"field-check\" [ngClass]=\"{ 'field-check-inline': type === typeField.checkboxInline }\">\r\n <input type=\"checkbox\" [id]=\"name + '_' + opt.value\" [value]=\"opt.value\" (change)=\"onCheckboxChange($event)\"\r\n [checked]=\"control.value?.includes(opt.value)\" class=\"field-check-input\"\r\n [attr.aria-required]=\"isRequired\"\r\n [attr.aria-invalid]=\"control.invalid && control.touched\"\r\n [attr.aria-describedby]=\"getDescribedBy(control)\"\r\n [attr.disabled]=\"(isEffectivelyDisabled || opt.disabled) ? 'disabled' : null\" />\r\n <label [for]=\"name + '_' + opt.value\" class=\"field-check-label\">\r\n {{ opt.label | translate }}\r\n @if(isRequired) {\r\n <span class=\"text-danger\">*</span>\r\n }\r\n </label>\r\n </li>\r\n }\r\n </ul>\r\n </fieldset>\r\n }\r\n }\r\n\r\n <!-- Checkbox button -->\r\n @if (type === typeField.checkboxButton && options.length > 0) {\r\n\r\n @if(options.length > 1) {\r\n <fieldset\r\n [attr.aria-required]=\"isRequired\"\r\n [attr.aria-invalid]=\"control.invalid && control.touched\"\r\n [attr.aria-describedby]=\"getDescribedBy(control)\">\r\n <legend class=\"field-label\" [class.visually-hidden]=\"!displayLabel\">\r\n {{label | translate}}\r\n @if(isRequired) {\r\n <span class=\"text-danger\">*</span>\r\n }\r\n </legend>\r\n <div class=\"field-group field-group-btn\">\r\n @for (opt of options; track opt.value) {\r\n <input type=\"checkbox\" [id]=\"name + '_' + opt.value\" [value]=\"opt.value\" (change)=\"onCheckboxChange($event)\"\r\n [checked]=\"control.value?.includes(opt.value)\" class=\"visually-hidden\"\r\n [attr.disabled]=\"(isEffectivelyDisabled || opt.disabled) ? 'disabled' : null\" />\r\n <label [for]=\"name + '_' + opt.value\" class=\"btn btn-field-group\">{{ opt.label | translate }}</label>\r\n }\r\n </div>\r\n </fieldset>\r\n }\r\n @else {\r\n <fieldset>\r\n <legend class=\"field-label\" [class.visually-hidden]=\"!displayLabel\">\r\n {{label | translate}}\r\n </legend>\r\n <div class=\"btn-group btn-group-secondary\">\r\n @for (opt of options; track opt.value) {\r\n <input type=\"checkbox\" [id]=\"name + '_' + opt.value\" [value]=\"opt.value\" (change)=\"onCheckboxChange($event)\"\r\n [checked]=\"control.value?.includes(opt.value)\" class=\"visually-hidden\"\r\n [attr.aria-required]=\"isRequired\"\r\n [attr.aria-invalid]=\"control.invalid && control.touched\"\r\n [attr.aria-describedby]=\"getDescribedBy(control)\"\r\n [attr.disabled]=\"(isEffectivelyDisabled || opt.disabled) ? '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 <div class=\"field-group-text\">Du</div>\r\n <input [type]=\"getInputType()\" class=\"field-control\" [id]=\"name + '_start'\" [formControl]=\"getControl('start')\"\r\n [attr.placeholder]=\"type === typeField.timeToTime ? ('_COMMON._DATES.FROM' | translate) : ('_COMMON._DATES.FROM_TO_1' | translate)\"\r\n [ngClass]=\"[(cssClass || ''), getControl('start')?.value ? 'has-value' : '']\"\r\n [attr.required]=\"isRequired ? 'required' : null\" [attr.readonly]=\"isReadonly ? 'readonly' : null\"\r\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\" [attr.aria-required]=\"isRequired\"\r\n [attr.min]=\"minStartAttr\" [attr.max]=\"maxStartAttr\" [attr.step]=\"stepAttr\"\r\n [attr.autocomplete]=\"autocomplete\"\r\n [attr.aria-invalid]=\"getControl('start')?.invalid && getControl('start')?.touched\"\r\n [attr.aria-describedby]=\"getDescribedBy(getControl('start'))\"\r\n (focus)=\"onFocusRange('start')\" />\r\n\r\n @if(getControl('start')?.value && !isEffectivelyDisabled) {\r\n <button type=\"button\" class=\"btn btn-secondary btn-clear-field\"\r\n (click)=\"onClearFieldPeriod('start')\">\r\n ×\r\n </button>\r\n }\r\n <div class=\"field-group-text\">au</div>\r\n <input [type]=\"getInputType()\" class=\"field-control\" [id]=\"name + '_end'\" [formControl]=\"getControl('end')\"\r\n [attr.placeholder]=\"type === typeField.timeToTime ? ('_COMMON._DATES.TO' | translate) : ('_COMMON._DATES.FROM_TO_2' | translate)\"\r\n [ngClass]=\"[(cssClass || ''), getControl('end')?.value ? 'has-value' : '']\"\r\n [attr.required]=\"isRequired ? 'required' : null\" [attr.readonly]=\"isReadonly ? 'readonly' : null\"\r\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\"\r\n [attr.min]=\"minEndAttr\" [attr.max]=\"maxEndAttr\" [attr.step]=\"stepAttr\"\r\n [attr.autocomplete]=\"autocomplete\"\r\n [attr.aria-invalid]=\"getControl('end')?.invalid && getControl('end')?.touched\"\r\n [attr.aria-describedby]=\"getDescribedBy(getControl('end'))\"\r\n (focus)=\"onFocusRange('end')\" />\r\n\r\n @if(getControl('end')?.value && !isEffectivelyDisabled) {\r\n <button type=\"button\" class=\"btn btn-secondary btn-clear-field\"\r\n (click)=\"onClearFieldPeriod('end')\">\r\n ×\r\n </button>\r\n }\r\n </div>\r\n }\r\n\r\n @if ([typeField.datePlusOne, typeField.datePlusTwo, typeField.datePlusSeven, typeField.dateComplexe].includes(type)) {\r\n\r\n <div class=\"field-group\">\r\n @if (type === typeField.dateComplexe) {\r\n <button class=\"btn btn-secondary\" type=\"button\" (click)=\"onDateAddDay('prev')\"\r\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\">\r\n <cw-icon font=\"optyweb\" [icon]=\"spriteIcon.nextLeft\" [label]=\"'Jour pr\u00E9c\u00E9dent'\"></cw-icon>\r\n </button>\r\n }\r\n\r\n <input type=\"date\" class=\"field-control\" [id]=\"name\" [formControl]=\"formControl\"\r\n [ngClass]=\"[(cssClass || ''), formControl?.value ? 'has-value' : '']\"\r\n [attr.placeholder]=\"placeholder ? placeholder : null\" [attr.required]=\"isRequired ? 'required' : null\"\r\n [attr.readonly]=\"isReadonly ? 'readonly' : null\" [attr.aria-required]=\"isRequired\"\r\n [attr.min]=\"minAttr\" [attr.max]=\"maxAttr\" [attr.step]=\"stepAttr\"\r\n [attr.autocomplete]=\"autocomplete\"\r\n [attr.aria-invalid]=\"control.invalid && control.touched\"\r\n [attr.aria-describedby]=\"getDescribedBy(control)\"\r\n (focus)=\"onFocus()\" (blur)=\"onBlur()\" />\r\n\r\n @if(formControl?.value && !isEffectivelyDisabled) {\r\n <button class=\"btn btn-secondary btn-clear-field\" type=\"button\"\r\n (click)=\"onClearField(formControl)\">×</button>\r\n }\r\n\r\n @if (type === typeField.dateComplexe) {\r\n <button class=\"btn btn-secondary\" type=\"button\" (click)=\"onDateAddDay('next')\"\r\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\">\r\n <cw-icon font=\"optyweb\" [icon]=\"spriteIcon.nextRight\" [label]=\"'Jour suivant'\"></cw-icon>\r\n </button>\r\n <button class=\"btn btn-secondary\" type=\"button\" (click)=\"onRefresh()\"\r\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\">\r\n <cw-icon font=\"optyweb\" [icon]=\"spriteIcon.toolbarRefresh\" [label]=\"'Rafra\u00EEchir'\"></cw-icon>\r\n </button>\r\n }\r\n\r\n <button class=\"btn btn-secondary\" type=\"button\" (click)=\"onTodayAddDay(0)\"\r\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\">\r\n J\r\n <span class=\"visually-hidden\">Aujourd'hui</span>\r\n </button>\r\n <button class=\"btn btn-secondary\" type=\"button\" (click)=\"onTodayAddDay(1)\"\r\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\">\r\n J+1\r\n <span class=\"visually-hidden\">Demain</span>\r\n </button>\r\n\r\n @if (type !== typeField.datePlusOne && type !== typeField.dateComplexe) {\r\n <button class=\"btn btn-secondary \" type=\"button\" (click)=\"onTodayAddDay(2)\"\r\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\">\r\n J+2\r\n <span class=\"visually-hidden\">Dans 2 jours</span>\r\n </button>\r\n\r\n @if (type !== typeField.datePlusTwo) {\r\n <button class=\"btn btn-secondary\" type=\"button\" (click)=\"onTodayAddDay(7)\"\r\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\">\r\n J+7\r\n <span class=\"visually-hidden\">Dans 7 jours</span>\r\n </button>\r\n }\r\n }\r\n </div>\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\">\r\n </div>\r\n\r\n <cw-button [isDisabled]=\"formControl.value >= rangeOptions.ceil\" [label]=\"'Augmenter ' + formControl.value + ' ' + label\"\r\n [withIcon]=\"spriteIcon.toolbarPlus\" [withOnlyIcon]=\"true\" [type]=\"buttonType.primary\"\r\n [iconSize]=\"buttonIconSize.small\" (btnAction)=\"onRangeStep('increase')\">\r\n </cw-button>\r\n </div>\r\n }\r\n\r\n @if (isInInputGroup() && clearable && !isEffectivelyDisabled && type !== typeField.autocompleteMultiple && type !== typeField.ngSelectMultiple) {\r\n @if (type === typeField.autocomplete) {\r\n @if (autocompleteRef()?.hasAnyContent()) {\r\n <button class=\"btn btn-secondary btn-clear-field\" type=\"button\"\r\n (click)=\"autocompleteRef()!.clear()\">×</button>\r\n }\r\n } @else {\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\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: "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", "link", "isDropdown", "hideCaret", "withIcon", "withOnlyIcon", "iconSize", "iconPosition", "dropdownPosition", "isMinWidth", "isDisabled", "isLoading", "cssClass", "dataTest", "skeletonMode", "withTooltip", "tooltipText", "tooltipTitle", "tooltipTrigger", "tooltipPosition", "tooltipType"], outputs: ["btnAction", "dropDownClicked"] }, { kind: "component", type: AutocompleteComponent, selector: "cw-autocomplete", inputs: ["control", "fetcher", "displayField", "valueField", "columns", "multiple", "minChars", "debounceMs", "selectedItem", "resolver", "selectedItems", "placeholder", "id", "isRequired", "isReadonly", "isDisabled", "ariaInvalid", "ariaDescribedBy"], outputs: ["itemSelected", "itemsChange"] }, { kind: "pipe", type: i1.KeyValuePipe, name: "keyvalue" }, { kind: "pipe", type: i2.TranslatePipe, name: "translate" }] }); }
|
|
3526
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.20", type: FormFieldComponent, isStandalone: true, selector: "cw-form-field", inputs: { control: { classPropertyName: "control", publicName: "control", isSignal: false, isRequired: false, transformFunction: null }, formGroup: { classPropertyName: "formGroup", publicName: "formGroup", isSignal: false, isRequired: false, transformFunction: null }, type: { classPropertyName: "type", publicName: "type", isSignal: false, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: false, isRequired: false, transformFunction: null }, displayLabel: { classPropertyName: "displayLabel", publicName: "displayLabel", isSignal: false, isRequired: false, transformFunction: null }, name: { classPropertyName: "name", publicName: "name", isSignal: false, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: false, isRequired: false, transformFunction: null }, autocomplete: { classPropertyName: "autocomplete", publicName: "autocomplete", isSignal: false, isRequired: false, transformFunction: null }, options: { classPropertyName: "options", publicName: "options", isSignal: false, isRequired: false, transformFunction: null }, rangeOptions: { classPropertyName: "rangeOptions", publicName: "rangeOptions", isSignal: false, isRequired: false, transformFunction: null }, validationOptions: { classPropertyName: "validationOptions", publicName: "validationOptions", isSignal: false, isRequired: false, transformFunction: null }, autocompleteOptions: { classPropertyName: "autocompleteOptions", publicName: "autocompleteOptions", isSignal: false, isRequired: false, transformFunction: null }, errorMessages: { classPropertyName: "errorMessages", publicName: "errorMessages", isSignal: false, isRequired: false, transformFunction: null }, isRequired: { classPropertyName: "isRequired", publicName: "isRequired", isSignal: false, isRequired: false, transformFunction: null }, help: { classPropertyName: "help", publicName: "help", isSignal: false, isRequired: false, transformFunction: null }, tooltip: { classPropertyName: "tooltip", publicName: "tooltip", isSignal: false, isRequired: false, transformFunction: null }, addonLeft: { classPropertyName: "addonLeft", publicName: "addonLeft", isSignal: false, isRequired: false, transformFunction: null }, addonRight: { classPropertyName: "addonRight", publicName: "addonRight", isSignal: false, isRequired: false, transformFunction: null }, isInAddon: { classPropertyName: "isInAddon", publicName: "isInAddon", isSignal: false, isRequired: false, transformFunction: null }, isReadonly: { classPropertyName: "isReadonly", publicName: "isReadonly", isSignal: false, isRequired: false, transformFunction: null }, isDisabled: { classPropertyName: "isDisabled", publicName: "isDisabled", isSignal: false, isRequired: false, transformFunction: null }, sliderValue: { classPropertyName: "sliderValue", publicName: "sliderValue", isSignal: false, isRequired: false, transformFunction: null }, sliderOptions: { classPropertyName: "sliderOptions", publicName: "sliderOptions", isSignal: false, isRequired: false, transformFunction: null }, cssClass: { classPropertyName: "cssClass", publicName: "cssClass", isSignal: false, isRequired: false, transformFunction: null }, skeletonMode: { classPropertyName: "skeletonMode", publicName: "skeletonMode", isSignal: false, isRequired: false, transformFunction: null }, clearable: { classPropertyName: "clearable", publicName: "clearable", isSignal: false, isRequired: false, transformFunction: null }, appendTo: { classPropertyName: "appendTo", publicName: "appendTo", isSignal: false, isRequired: false, transformFunction: null }, initialCountry: { classPropertyName: "initialCountry", publicName: "initialCountry", isSignal: false, isRequired: false, transformFunction: null }, indeterminate: { classPropertyName: "indeterminate", publicName: "indeterminate", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { refreshEvent: "refreshEvent", textChanged: "textChanged", valueChange: "valueChange", phoneRegionChange: "phoneRegionChange" }, host: { properties: { "class": "this.hostClasses" } }, queries: [{ propertyName: "optionTemplate", first: true, predicate: ["ngOptionTpl"], descendants: true, read: TemplateRef }, { propertyName: "labelTemplate", first: true, predicate: ["ngLabelTpl"], descendants: true, read: TemplateRef }], viewQueries: [{ propertyName: "checkboxInputRef", first: true, predicate: ["checkboxInput"], descendants: true, isSignal: true }, { propertyName: "fileInputRef", first: true, predicate: ["fileInput"], descendants: true, isSignal: true }, { propertyName: "phoneInputRef", first: true, predicate: ["phoneInput"], descendants: true, isSignal: true }, { propertyName: "autocompleteRef", first: true, predicate: AutocompleteComponent, descendants: true, isSignal: true }], usesOnChanges: true, ngImport: i0, template: "@if (!isInAddon) {\r\n @if (\r\n type !== typeField.checkbox &&\r\n type !== typeField.radio &&\r\n type !== typeField.checkboxButton &&\r\n type !== typeField.radioButton &&\r\n type !== typeField.checkboxInline &&\r\n type !== typeField.radioInline &&\r\n type !== typeField.switch &&\r\n type !== typeField.range &&\r\n type !== typeField.switchSmall\r\n ) {\r\n <label [for]=\"name\" class=\"field-label\" [class.visually-hidden]=\"!displayLabel\">\r\n {{ label | translate }}\r\n\r\n @if (isRequired) {\r\n <span class=\"text-danger\">*</span>\r\n }\r\n\r\n @if (tooltip) {\r\n <!-- <button type=\"button\" class=\"btn btn-link btn-popover\" placement=\"bottom\" [ngbPopover]=\"popContent\" container=\"body\"\r\n triggers=\"mouseenter:mouseleave\">\r\n <span class=\"btn-popover-icon bo-icons bo-help\"></span>\r\n </button>\r\n <ng-template #popContent>\r\n <div [innerHTML]=\"tooltip\"></div>\r\n </ng-template> -->\r\n }\r\n </label>\r\n }\r\n\r\n @if (addonLeft || addonRight) {\r\n <div class=\"field-group\" [class.field-group-invalid]=\"isInvalid\" [class.field-group-disabled]=\"isDisabledOrReadonly\">\r\n @if(addonLeft) {\r\n <div class=\"field-group-addon-left\">\r\n <ng-container [ngTemplateOutlet]=\"addonLeft\"></ng-container>\r\n </div>\r\n }\r\n <ng-container [ngTemplateOutlet]=\"field\"></ng-container>\r\n @if(addonRight) {\r\n <div class=\"field-group-addon-right\">\r\n <ng-container [ngTemplateOutlet]=\"addonRight\"></ng-container>\r\n </div>\r\n }\r\n </div>\r\n }\r\n @else {\r\n @if ( isInInputGroup() ) {\r\n <div class=\"field-group\" [class.field-group-invalid]=\"isInvalid\" [class.field-group-disabled]=\"isDisabledOrReadonly\">\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 (\r\n !errorMessages?.['required'] &&\r\n ((controlOrGroup?.errors?.['required']) || (getControl('start')?.errors?.['required'] || getControl('end')?.errors?.['required']))\r\n ) {\r\n <span [innerHtml]=\"'_COMMON._FORM.ERROR_IS_MANDATORY' | translate: {label: label | translate}\"></span>\r\n }\r\n @if (!errorMessages?.['rangeInvalid'] && controlOrGroup?.errors?.['rangeInvalid']) {\r\n <span>{{'_COMMON._DATES.ERROR_START_END_PERIOD' | translate}}</span>\r\n }\r\n @if (!errorMessages?.['fileExtension'] && controlOrGroup?.errors?.['fileExtension']) {\r\n <span>{{ '_COMMON._FORM.ERROR_FILE_EXTENSION' | translate: { accept: acceptLabel } }}</span>\r\n }\r\n @if (!errorMessages?.['fileSize'] && controlOrGroup?.errors?.['fileSize']) {\r\n <span>{{ '_COMMON._FORM.ERROR_FILE_SIZE' | translate: { maxSize: maxSizeLabel } }}</span>\r\n }\r\n @if (!errorMessages?.['email'] && controlOrGroup?.errors?.['email']) {\r\n <span>{{ '_COMMON._FORM.ERROR_INVALID_EMAIL' | translate }}</span>\r\n }\r\n @if (!errorMessages?.['phone'] && controlOrGroup?.errors?.['phone']) {\r\n <span>{{ '_COMMON._FORM.ERROR_INVALID_PHONE' | translate }}</span>\r\n }\r\n @if (errorMessages) {\r\n @for (entry of errorMessages | keyvalue: keepOrder; track entry.key) {\r\n @if (controlOrGroup?.errors?.[entry.key]; as errVal) {\r\n <span>{{ entry.value | translate: (errVal === true ? null : errVal) }}</span>\r\n }\r\n }\r\n }\r\n </div>\r\n }\r\n\r\n @if (help || autoHelpEntries.length) {\r\n <div [id]=\"name + '-help'\" class=\"field-text\">\r\n @if (help) {\r\n <span>{{ help | translate }}</span>\r\n }\r\n @for (entry of autoHelpEntries; track entry.key) {\r\n <span>{{ entry.key | translate: entry.params }}</span>\r\n }\r\n </div>\r\n }\r\n\r\n <!-- Chips de la multi-s\u00E9lection (autocomplete) : rendus ici, hors du field-group et apr\u00E8s\r\n erreur/help, pour \u00EAtre visuellement d\u00E9tach\u00E9s du champ. La donn\u00E9e et le retrait restent\r\n port\u00E9s par cw-autocomplete (`chips()` / `onChipRemove()`), seul l'affichage est d\u00E9l\u00E9gu\u00E9. -->\r\n @if (type === typeField.autocompleteMultiple && autocompleteRef()?.chips()?.length) {\r\n <ul class=\"autocomplete-chips\" role=\"list\">\r\n @for (chip of autocompleteRef()!.chips(); track chip.item) {\r\n <li>\r\n <button type=\"button\" class=\"autocomplete-chip\"\r\n [disabled]=\"isEffectivelyDisabled || isReadonly\"\r\n (click)=\"autocompleteRef()!.onChipRemove(chip.item)\">\r\n <span>{{ chip.label }}</span>\r\n @if (!isEffectivelyDisabled && !isReadonly) {\r\n <span aria-hidden=\"true\" class=\"autocomplete-chip-x\">×</span>\r\n <span class=\"visually-hidden\">{{ '_COMMON._ACTION.DELETE' | translate }}</span>\r\n }\r\n </button>\r\n </li>\r\n }\r\n </ul>\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 <!-- Autocomplete (mono / multi) -->\r\n @if ((type === typeField.autocomplete || type === typeField.autocompleteMultiple) && autocompleteOptions) {\r\n <cw-autocomplete\r\n [id]=\"name\"\r\n [control]=\"formControl\"\r\n [fetcher]=\"autocompleteOptions.fetcher\"\r\n [displayField]=\"autocompleteOptions.displayField ?? 'label'\"\r\n [valueField]=\"autocompleteOptions.valueField ?? 'id'\"\r\n [columns]=\"autocompleteOptions.columns ?? []\"\r\n [resolver]=\"autocompleteOptions.resolver ?? null\"\r\n [selectedItem]=\"autocompleteOptions.selectedItem ?? null\"\r\n [selectedItems]=\"autocompleteOptions.selectedItems ?? []\"\r\n [minChars]=\"autocompleteOptions.minChars ?? 2\"\r\n [debounceMs]=\"autocompleteOptions.debounceMs ?? 250\"\r\n [multiple]=\"type === typeField.autocompleteMultiple\"\r\n [isRequired]=\"isRequired\"\r\n [isReadonly]=\"!!isReadonly\"\r\n [isDisabled]=\"isEffectivelyDisabled\"\r\n [ariaInvalid]=\"control.invalid && control.touched\"\r\n [ariaDescribedBy]=\"getDescribedBy(control)\"\r\n [placeholder]=\"placeholder\">\r\n </cw-autocomplete>\r\n }\r\n\r\n <!-- Text -->\r\n @if ([typeField.text, typeField.date, typeField.time, typeField.dateTime, typeField.number,\r\n typeField.email,\r\n typeField.color, typeField.zipCode].includes(type)) {\r\n <input [type]=\"type === typeField.zipCode ? 'text' : type\" class=\"field-control\" [id]=\"name\" [formControl]=\"formControl\"\r\n [ngClass]=\"[(cssClass || ''), formControl?.value ? 'has-value' : '', type === typeField.zipCode ? 'field-control-zipcode' : '']\"\r\n [attr.placeholder]=\"placeholder ? (placeholder | translate) : null\" [attr.required]=\"isRequired ? 'required' : null\"\r\n [attr.readonly]=\"isReadonly ? 'readonly' : null\" [attr.aria-required]=\"isRequired\"\r\n [attr.minlength]=\"minLengthAttr\" [attr.maxlength]=\"maxLengthAttr\"\r\n [attr.min]=\"minAttr\" [attr.max]=\"maxAttr\" [attr.step]=\"stepAttr\" [attr.pattern]=\"patternAttr\"\r\n [attr.autocomplete]=\"autocomplete\"\r\n [attr.aria-invalid]=\"control.invalid && control.touched\"\r\n [attr.aria-describedby]=\"getDescribedBy(control)\"\r\n (focus)=\"onFocus()\" (blur)=\"onBlur()\" />\r\n }\r\n\r\n <!-- Phone (intl-tel-input) -->\r\n @if (type === typeField.phone) {\r\n <input #phoneInput type=\"tel\" class=\"field-control\" [id]=\"name\"\r\n [attr.placeholder]=\"placeholder ? (placeholder | translate) : null\" [attr.required]=\"isRequired ? 'required' : null\"\r\n [attr.readonly]=\"isReadonly ? 'readonly' : null\" [disabled]=\"isEffectivelyDisabled\" [attr.aria-required]=\"isRequired\"\r\n [attr.autocomplete]=\"autocomplete\"\r\n [attr.aria-invalid]=\"control.invalid && control.touched\"\r\n [attr.aria-describedby]=\"getDescribedBy(control)\"\r\n (focus)=\"onFocus()\" (blur)=\"onPhoneBlur($event)\" />\r\n }\r\n\r\n <!-- File -->\r\n @if (type === typeField.file) {\r\n <input #fileInput type=\"file\" class=\"field-control\" [id]=\"name\"\r\n [ngClass]=\"[(cssClass || ''), formControl?.value ? 'has-value' : '']\"\r\n [attr.placeholder]=\"placeholder ? (placeholder | translate) : null\" [attr.required]=\"isRequired ? 'required' : null\"\r\n [attr.readonly]=\"isReadonly ? 'readonly' : null\" [disabled]=\"isEffectivelyDisabled\" [attr.aria-required]=\"isRequired\"\r\n [attr.accept]=\"acceptAttr\"\r\n [attr.aria-invalid]=\"control.invalid && control.touched\"\r\n [attr.aria-describedby]=\"getDescribedBy(control)\"\r\n (change)=\"onFileChange($event)\" (focus)=\"onFocus()\" (blur)=\"onBlur()\" />\r\n }\r\n\r\n @if (type === typeField.password) {\r\n <input [type]=\"isPasswordShown ? 'text' : 'password'\" class=\"field-control\" [id]=\"name\" [formControl]=\"formControl\"\r\n [ngClass]=\"[(cssClass || ''), formControl?.value ? 'has-value' : '']\"\r\n [attr.required]=\"isRequired ? 'required' : null\" [attr.readonly]=\"isReadonly ? 'readonly' : null\"\r\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\" [attr.aria-required]=\"isRequired\"\r\n [attr.minlength]=\"minLengthAttr\" [attr.maxlength]=\"maxLengthAttr\" [attr.pattern]=\"patternAttr\"\r\n [attr.autocomplete]=\"autocomplete\"\r\n [attr.aria-invalid]=\"control.invalid && control.touched\"\r\n [attr.aria-describedby]=\"getDescribedBy(control)\"\r\n (focus)=\"onFocus()\" (blur)=\"onBlur()\" />\r\n <cw-button [type]=\"buttonType.ghost\"\r\n cssClass=\"btn-password-field\"\r\n [withIcon]=\"isPasswordShown ? spriteIcon.toolbarHidePassword : spriteIcon.toolbarShowPassword\"\r\n [withOnlyIcon]=\"true\"\r\n [label]=\"isPasswordShown ? '_COMMON._FORM._SHOW_HIDE_PWD.HIDE' : '_COMMON._FORM._SHOW_HIDE_PWD.SHOW'\"\r\n (btnAction)=\"togglePasswordVisibility()\">\r\n </cw-button>\r\n }\r\n\r\n <!-- Textarea -->\r\n @if (type === typeField.textarea) {\r\n <textarea class=\"field-control\" [id]=\"name\" [formControl]=\"formControl\"\r\n [ngClass]=\"[(cssClass || ''), formControl?.value ? 'has-value' : '']\"\r\n [attr.placeholder]=\"placeholder ? (placeholder | translate) : null\" [attr.required]=\"isRequired ? 'required' : null\"\r\n [attr.readonly]=\"isReadonly ? 'readonly' : null\" [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\"\r\n [attr.aria-required]=\"isRequired\" [attr.aria-invalid]=\"control.invalid && control.touched\"\r\n [attr.minlength]=\"minLengthAttr\" [attr.maxlength]=\"maxLengthAttr\" [attr.pattern]=\"patternAttr\"\r\n [attr.autocomplete]=\"autocomplete\"\r\n [attr.aria-describedby]=\"getDescribedBy(control)\"\r\n (focus)=\"onFocus()\" (blur)=\"onBlur()\"></textarea>\r\n }\r\n\r\n <!-- Select -->\r\n @if (type === typeField.select) {\r\n <ng-select [formControl]=\"formControl\" [items]=\"options\" bindLabel=\"label\" [labelForId]=\"name\" [appendTo]=\"appendTo\" bindValue=\"value\"\r\n [ngClass]=\"cssClass\" [searchable]=\"false\" [placeholder]=\"placeholder ? (placeholder | translate) : null\" [readonly]=\"isReadonly\" [clearable]=\"false\"\r\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\" [attr.required]=\"isRequired ? 'required' : null\"\r\n [attr.aria-required]=\"isRequired\" [attr.aria-invalid]=\"control.invalid && control.touched\"\r\n [attr.aria-describedby]=\"getDescribedBy(control)\" [attr.id]=\"name\"\r\n (focus)=\"onFocus()\" (blur)=\"onBlur()\">\r\n\r\n <!-- Template pour les options -->\r\n <ng-template ng-option-tmp let-item=\"item\" let-index=\"index\" let-search=\"searchTerm\">\r\n @if (optionTemplate) {\r\n <ng-container *ngTemplateOutlet=\"optionTemplate; context: { item: item | translate, index: index, searchTerm: search }\"></ng-container>\r\n }\r\n @else {\r\n <div>{{ item.label | translate }}</div>\r\n }\r\n </ng-template>\r\n\r\n <!-- Template pour le label -->\r\n <ng-template ng-label-tmp let-item=\"item\">\r\n @if (labelTemplate) {\r\n <ng-container *ngTemplateOutlet=\"labelTemplate; context: { item: item | translate }\"></ng-container>\r\n }\r\n @else {\r\n {{ (item.label | translate) || (placeholder | translate) }}\r\n }\r\n </ng-template>\r\n </ng-select>\r\n }\r\n\r\n <!-- NgSelect -->\r\n @if (type === typeField.ngSelect || type === typeField.ngSelectMultiple) {\r\n <ng-select [formControl]=\"formControl\" [items]=\"options\" bindLabel=\"label\" [labelForId]=\"name\" [appendTo]=\"appendTo\" bindValue=\"value\"\r\n [multiple]=\"type === typeField.ngSelectMultiple\" [ngClass]=\"cssClass\" [clearable]=\"false\"\r\n [placeholder]=\"placeholder ? (placeholder | translate) : null\" [readonly]=\"isReadonly\"\r\n [notFoundText]=\"'_COMMON.NO_RESULT' | translate\" [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\"\r\n [attr.required]=\"isRequired ? 'required' : null\" [attr.aria-required]=\"isRequired\"\r\n [attr.aria-invalid]=\"control.invalid && control.touched\"\r\n [attr.aria-describedby]=\"getDescribedBy(control)\" [attr.id]=\"name\"\r\n (focus)=\"onFocus()\" (blur)=\"onBlur()\" (search)=\"textChanged.emit($event?.term)\">\r\n\r\n <!-- Template pour les options -->\r\n <ng-template ng-option-tmp let-item=\"item\" let-index=\"index\" let-search=\"searchTerm\">\r\n @if (optionTemplate) {\r\n <ng-container *ngTemplateOutlet=\"optionTemplate; context: { item: item, index: index, searchTerm: search }\"></ng-container>\r\n }\r\n @else {\r\n <div>{{ item.label | translate }}</div>\r\n }\r\n </ng-template>\r\n\r\n <!-- Template pour le label -->\r\n <ng-template ng-label-tmp let-item=\"item\" let-clear=\"clear\">\r\n <span class=\"ng-value-icon left\" (click)=\"clear(item)\" aria-hidden=\"true\">\u00D7</span>\r\n @if (labelTemplate) {\r\n <ng-container *ngTemplateOutlet=\"labelTemplate; context: { item: item | translate }\"></ng-container>\r\n }\r\n @else {\r\n {{ (item.label | translate) || (placeholder | translate) }}\r\n }\r\n </ng-template>\r\n </ng-select>\r\n }\r\n\r\n <!-- Radio -->\r\n @if (type === typeField.radioInline || type === typeField.radio) {\r\n <fieldset\r\n [attr.aria-required]=\"isRequired\"\r\n [attr.aria-invalid]=\"control.invalid && control.touched\"\r\n [attr.aria-describedby]=\"getDescribedBy(control)\">\r\n <legend class=\"field-label\" [class.visually-hidden]=\"!displayLabel\">\r\n {{label | translate}}\r\n @if(isRequired) {\r\n <span class=\"text-danger\">*</span>\r\n }\r\n </legend>\r\n <ul class=\"list-unstyled mb-none\" [ngClass]=\"type === typeField.radioInline ? 'd-flex-h gap-md flex-wrap' : 'd-flex-v'\">\r\n @for (opt of options; track opt.value) {\r\n <li class=\"field-check\">\r\n <input type=\"radio\" [id]=\"name + '_' + opt.value\" [value]=\"opt.value\" [formControl]=\"formControl\"\r\n class=\"field-check-input\" [attr.disabled]=\"(isEffectivelyDisabled || opt.disabled) ? 'disabled' : null\" (change)=\"onRadioChange(opt.value)\" />\r\n <label [for]=\"name + '_' + opt.value\" class=\"field-check-label\">{{ opt.label | translate }}</label>\r\n </li>\r\n }\r\n </ul>\r\n </fieldset>\r\n }\r\n\r\n <!-- Radio button -->\r\n @if (type === typeField.radioButton) {\r\n <fieldset\r\n [attr.aria-required]=\"isRequired\"\r\n [attr.aria-invalid]=\"control.invalid && control.touched\"\r\n [attr.aria-describedby]=\"getDescribedBy(control)\">\r\n <legend class=\"field-label\" [class.visually-hidden]=\"!displayLabel\">\r\n {{label | translate}}\r\n @if(isRequired) {\r\n <span class=\"text-danger\">*</span>\r\n }\r\n </legend>\r\n <div class=\"field-group field-group-btn\">\r\n @for (opt of options; track opt.value) {\r\n <input type=\"radio\" [id]=\"name + '_' + opt.value\" [value]=\"opt.value\" [formControl]=\"formControl\"\r\n class=\"visually-hidden\" [attr.disabled]=\"(isEffectivelyDisabled || opt.disabled) ? 'disabled' : null\" (change)=\"onRadioChange(opt.value)\"/>\r\n <label [for]=\"name + '_' + opt.value\" class=\"btn btn-field-group\">{{ opt.label | translate }}</label>\r\n }\r\n </div>\r\n </fieldset>\r\n }\r\n\r\n <!-- Checkbox Switch -->\r\n @if ( type === typeField.switch || type === typeField.switchSmall)\r\n {\r\n <div class=\"field-check field-switch\" [ngClass]=\"{'field-switch-small': type === typeField.switchSmall}\">\r\n <input type=\"checkbox\" [id]=\"name\" [formControl]=\"formControl\" class=\"field-check-input\" [attr.aria-required]=\"isRequired\"\r\n [attr.aria-invalid]=\"control.invalid && control.touched\"\r\n [attr.aria-describedby]=\"getDescribedBy(control)\"\r\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\"/>\r\n <label [for]=\"name\" class=\"field-check-label\">{{ label | translate }}</label>\r\n </div>\r\n }\r\n\r\n <!-- Checkbox -->\r\n @if (type === typeField.checkboxInline || type === typeField.checkbox) {\r\n @if (isSingleCheckbox()) {\r\n <div class=\"field-check\" [class.field-check-inline]=\"type === typeField.checkboxInline\">\r\n <input #checkboxInput type=\"checkbox\" [id]=\"name\" [formControl]=\"formControl\"\r\n class=\"field-check-input\"\r\n [class.is-invalid]=\"control?.invalid && control?.touched\"\r\n [attr.aria-required]=\"isRequired\"\r\n [attr.aria-invalid]=\"control?.invalid && control?.touched\"\r\n [attr.aria-describedby]=\"getDescribedBy(control)\"\r\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\" />\r\n <label [for]=\"name\" class=\"field-check-label\">\r\n {{ label | translate }}\r\n @if (isRequired) {\r\n <span class=\"text-danger\">*</span>\r\n }\r\n </label>\r\n </div>\r\n }\r\n @else if( options.length > 1) {\r\n <fieldset\r\n [attr.aria-required]=\"isRequired\"\r\n [attr.aria-invalid]=\"control.invalid && control.touched\"\r\n [attr.aria-describedby]=\"getDescribedBy(control)\"\r\n [ngClass]=\"{ 'flex-column': type === typeField.checkbox }\">\r\n <legend class=\"field-label\" [class.visually-hidden]=\"!displayLabel\">\r\n {{label | translate}}\r\n @if(isRequired) {\r\n <span class=\"text-danger\">*</span>\r\n }\r\n </legend>\r\n <ul class=\"list-unstyled mb-none\" [ngClass]=\"type === typeField.checkboxInline ? 'd-flex-h gap-md' : 'd-flex-v'\">\r\n @for (opt of options; track opt.value) {\r\n <li class=\"field-check\" [ngClass]=\"{ 'field-check-inline': type === typeField.checkboxInline }\">\r\n <input type=\"checkbox\" [id]=\"name + '_' + opt.value\" [value]=\"opt.value\" (change)=\"onCheckboxChange($event)\"\r\n [checked]=\"control.value?.includes(opt.value)\" class=\"field-check-input\"\r\n [attr.disabled]=\"(isEffectivelyDisabled || opt.disabled) ? 'disabled' : null\" />\r\n <label [for]=\"name + '_' + opt.value\" class=\"field-check-label\">\r\n {{ opt.label | translate }}\r\n </label>\r\n </li>\r\n }\r\n </ul>\r\n </fieldset>\r\n }\r\n @else {\r\n <fieldset>\r\n <legend class=\"field-label\" [class.visually-hidden]=\"!displayLabel\">\r\n {{label | translate}}\r\n </legend>\r\n <ul class=\"list-unstyled mb-none\" [ngClass]=\"type === typeField.checkboxInline ? 'd-flex-h gap-md' : 'd-flex-v'\">\r\n @for (opt of options; track opt.value) {\r\n <li class=\"field-check\" [ngClass]=\"{ 'field-check-inline': type === typeField.checkboxInline }\">\r\n <input type=\"checkbox\" [id]=\"name + '_' + opt.value\" [value]=\"opt.value\" (change)=\"onCheckboxChange($event)\"\r\n [checked]=\"control.value?.includes(opt.value)\" class=\"field-check-input\"\r\n [attr.aria-required]=\"isRequired\"\r\n [attr.aria-invalid]=\"control.invalid && control.touched\"\r\n [attr.aria-describedby]=\"getDescribedBy(control)\"\r\n [attr.disabled]=\"(isEffectivelyDisabled || opt.disabled) ? 'disabled' : null\" />\r\n <label [for]=\"name + '_' + opt.value\" class=\"field-check-label\">\r\n {{ opt.label | translate }}\r\n @if(isRequired) {\r\n <span class=\"text-danger\">*</span>\r\n }\r\n </label>\r\n </li>\r\n }\r\n </ul>\r\n </fieldset>\r\n }\r\n }\r\n\r\n <!-- Checkbox button -->\r\n @if (type === typeField.checkboxButton && options.length > 0) {\r\n\r\n @if(options.length > 1) {\r\n <fieldset\r\n [attr.aria-required]=\"isRequired\"\r\n [attr.aria-invalid]=\"control.invalid && control.touched\"\r\n [attr.aria-describedby]=\"getDescribedBy(control)\">\r\n <legend class=\"field-label\" [class.visually-hidden]=\"!displayLabel\">\r\n {{label | translate}}\r\n @if(isRequired) {\r\n <span class=\"text-danger\">*</span>\r\n }\r\n </legend>\r\n <div class=\"field-group field-group-btn\">\r\n @for (opt of options; track opt.value) {\r\n <input type=\"checkbox\" [id]=\"name + '_' + opt.value\" [value]=\"opt.value\" (change)=\"onCheckboxChange($event)\"\r\n [checked]=\"control.value?.includes(opt.value)\" class=\"visually-hidden\"\r\n [attr.disabled]=\"(isEffectivelyDisabled || opt.disabled) ? 'disabled' : null\" />\r\n <label [for]=\"name + '_' + opt.value\" class=\"btn btn-field-group\">{{ opt.label | translate }}</label>\r\n }\r\n </div>\r\n </fieldset>\r\n }\r\n @else {\r\n <fieldset>\r\n <legend class=\"field-label\" [class.visually-hidden]=\"!displayLabel\">\r\n {{label | translate}}\r\n </legend>\r\n <div class=\"btn-group btn-group-secondary\">\r\n @for (opt of options; track opt.value) {\r\n <input type=\"checkbox\" [id]=\"name + '_' + opt.value\" [value]=\"opt.value\" (change)=\"onCheckboxChange($event)\"\r\n [checked]=\"control.value?.includes(opt.value)\" class=\"visually-hidden\"\r\n [attr.aria-required]=\"isRequired\"\r\n [attr.aria-invalid]=\"control.invalid && control.touched\"\r\n [attr.aria-describedby]=\"getDescribedBy(control)\"\r\n [attr.disabled]=\"(isEffectivelyDisabled || opt.disabled) ? '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 <div class=\"field-group-addon-left\">Du</div>\r\n <input [type]=\"getInputType()\" class=\"field-control\" [id]=\"name + '_start'\" [formControl]=\"getControl('start')\"\r\n [attr.placeholder]=\"type === typeField.timeToTime ? ('_COMMON._DATES.FROM' | translate) : ('_COMMON._DATES.FROM_TO_1' | translate)\"\r\n [ngClass]=\"[(cssClass || ''), getControl('start')?.value ? 'has-value' : '']\"\r\n [attr.required]=\"isRequired ? 'required' : null\" [attr.readonly]=\"isReadonly ? 'readonly' : null\"\r\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\" [attr.aria-required]=\"isRequired\"\r\n [attr.min]=\"minStartAttr\" [attr.max]=\"maxStartAttr\" [attr.step]=\"stepAttr\"\r\n [attr.autocomplete]=\"autocomplete\"\r\n [attr.aria-invalid]=\"getControl('start')?.invalid && getControl('start')?.touched\"\r\n [attr.aria-describedby]=\"getDescribedBy(getControl('start'))\"\r\n (focus)=\"onFocusRange('start')\" />\r\n\r\n @if(getControl('start')?.value && !isEffectivelyDisabled) {\r\n <button type=\"button\" class=\"btn btn-secondary btn-clear-field\"\r\n (click)=\"onClearFieldPeriod('start')\">\r\n ×\r\n </button>\r\n }\r\n <div class=\"field-group-addon-center\">au</div>\r\n <input [type]=\"getInputType()\" class=\"field-control\" [id]=\"name + '_end'\" [formControl]=\"getControl('end')\"\r\n [attr.placeholder]=\"type === typeField.timeToTime ? ('_COMMON._DATES.TO' | translate) : ('_COMMON._DATES.FROM_TO_2' | translate)\"\r\n [ngClass]=\"[(cssClass || ''), getControl('end')?.value ? 'has-value' : '']\"\r\n [attr.required]=\"isRequired ? 'required' : null\" [attr.readonly]=\"isReadonly ? 'readonly' : null\"\r\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\"\r\n [attr.min]=\"minEndAttr\" [attr.max]=\"maxEndAttr\" [attr.step]=\"stepAttr\"\r\n [attr.autocomplete]=\"autocomplete\"\r\n [attr.aria-invalid]=\"getControl('end')?.invalid && getControl('end')?.touched\"\r\n [attr.aria-describedby]=\"getDescribedBy(getControl('end'))\"\r\n (focus)=\"onFocusRange('end')\" />\r\n\r\n @if(getControl('end')?.value && !isEffectivelyDisabled) {\r\n <button type=\"button\" class=\"btn btn-ghost 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 <div class=\"field-group\">\r\n @if (type === typeField.dateComplexe) {\r\n <div class=\"field-group-addon-left\">\r\n <button class=\"btn btn-ghost\" type=\"button\" (click)=\"onDateAddDay('prev')\"\r\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\">\r\n <cw-icon font=\"optyweb\" [icon]=\"spriteIcon.nextLeft\" [label]=\"'Jour pr\u00E9c\u00E9dent'\"></cw-icon>\r\n </button>\r\n </div>\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\" [attr.aria-required]=\"isRequired\"\r\n [attr.min]=\"minAttr\" [attr.max]=\"maxAttr\" [attr.step]=\"stepAttr\"\r\n [attr.autocomplete]=\"autocomplete\"\r\n [attr.aria-invalid]=\"control.invalid && control.touched\"\r\n [attr.aria-describedby]=\"getDescribedBy(control)\"\r\n (focus)=\"onFocus()\" (blur)=\"onBlur()\" />\r\n\r\n @if(formControl?.value && !isEffectivelyDisabled) {\r\n <button class=\"btn btn-ghost btn-clear-field\" type=\"button\"\r\n (click)=\"onClearField(formControl)\">×</button>\r\n }\r\n\r\n\r\n @if (type === typeField.dateComplexe) {\r\n <div class=\"field-group-addon-right\">\r\n <button class=\"btn btn-ghost\" type=\"button\" (click)=\"onDateAddDay('next')\"\r\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\">\r\n <cw-icon font=\"optyweb\" [icon]=\"spriteIcon.nextRight\" [label]=\"'Jour suivant'\"></cw-icon>\r\n </button>\r\n </div>\r\n <div class=\"field-group-addon-right\">\r\n <button class=\"btn btn-ghost\" type=\"button\" (click)=\"onRefresh()\"\r\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\">\r\n <cw-icon font=\"optyweb\" [icon]=\"spriteIcon.toolbarRefresh\" [label]=\"'Rafra\u00EEchir'\"></cw-icon>\r\n </button>\r\n </div>\r\n }\r\n\r\n <div class=\"field-group-addon-right\">\r\n <button class=\"btn btn-ghost\" type=\"button\" (click)=\"onTodayAddDay(0)\"\r\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\">\r\n J\r\n <span class=\"visually-hidden\">Aujourd'hui</span>\r\n </button>\r\n </div>\r\n <div class=\"field-group-addon-right\">\r\n <button class=\"btn btn-ghost\" type=\"button\" (click)=\"onTodayAddDay(1)\"\r\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\">\r\n J+1\r\n <span class=\"visually-hidden\">Demain</span>\r\n </button>\r\n </div>\r\n\r\n @if (type !== typeField.datePlusOne && type !== typeField.dateComplexe) {\r\n <div class=\"field-group-addon-right\">\r\n <button class=\"btn btn-ghost \" type=\"button\" (click)=\"onTodayAddDay(2)\"\r\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\">\r\n J+2\r\n <span class=\"visually-hidden\">Dans 2 jours</span>\r\n </button>\r\n </div>\r\n\r\n @if (type !== typeField.datePlusTwo) {\r\n <div class=\"field-group-addon-right\">\r\n <button class=\"btn btn-ghost\" type=\"button\" (click)=\"onTodayAddDay(7)\"\r\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\">\r\n J+7\r\n <span class=\"visually-hidden\">Dans 7 jours</span>\r\n </button>\r\n </div>\r\n }\r\n }\r\n </div>\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\">\r\n </div>\r\n\r\n <cw-button [isDisabled]=\"formControl.value >= rangeOptions.ceil\" [label]=\"'Augmenter ' + formControl.value + ' ' + label\"\r\n [withIcon]=\"spriteIcon.toolbarPlus\" [withOnlyIcon]=\"true\" [type]=\"buttonType.primary\"\r\n [iconSize]=\"buttonIconSize.small\" (btnAction)=\"onRangeStep('increase')\">\r\n </cw-button>\r\n </div>\r\n }\r\n\r\n @if (isInInputGroup() && clearable && !isEffectivelyDisabled && type !== typeField.autocompleteMultiple) {\r\n @if (type === typeField.autocomplete) {\r\n @if (autocompleteRef()?.hasAnyContent()) {\r\n <button class=\"btn btn-secondary btn-clear-field\" type=\"button\"\r\n (click)=\"onClearAutocomplete()\">×</button>\r\n }\r\n } @else if (type === typeField.ngSelectMultiple) {\r\n <!-- value est un tableau : un [] vide \u00E9tant truthy, on teste .length pour n'afficher le clear global que s'il y a au moins une s\u00E9lection. -->\r\n @if (formControl?.value?.length) {\r\n <button class=\"btn btn-ghost btn-clear-field\" type=\"button\"\r\n (click)=\"onClearField(formControl)\">×</button>\r\n }\r\n } @else {\r\n @if(formControl?.value) {\r\n <button class=\"btn btn-ghost btn-clear-field\" type=\"button\"\r\n (click)=\"onClearField(formControl)\">×</button>\r\n }\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: "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", "link", "isDropdown", "hideCaret", "withIcon", "withOnlyIcon", "iconSize", "iconPosition", "dropdownPosition", "isMinWidth", "isDisabled", "isLoading", "cssClass", "dataTest", "skeletonMode", "withTooltip", "tooltipText", "tooltipTitle", "tooltipTrigger", "tooltipPosition", "tooltipType"], outputs: ["btnAction", "dropDownClicked"] }, { kind: "component", type: AutocompleteComponent, selector: "cw-autocomplete", inputs: ["control", "fetcher", "displayField", "valueField", "columns", "multiple", "minChars", "debounceMs", "selectedItem", "resolver", "selectedItems", "placeholder", "id", "isRequired", "isReadonly", "isDisabled", "ariaInvalid", "ariaDescribedBy"], outputs: ["itemSelected", "itemsChange"] }, { kind: "pipe", type: i1.KeyValuePipe, name: "keyvalue" }, { kind: "pipe", type: i2.TranslatePipe, name: "translate" }] }); }
|
|
3283
3527
|
}
|
|
3284
3528
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: FormFieldComponent, decorators: [{
|
|
3285
3529
|
type: Component,
|
|
@@ -3293,7 +3537,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.20", ngImpo
|
|
|
3293
3537
|
IconComponent,
|
|
3294
3538
|
ButtonComponent,
|
|
3295
3539
|
AutocompleteComponent
|
|
3296
|
-
], 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\" [class.field-group-invalid]=\"isInvalid\">\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\" [class.field-group-invalid]=\"isInvalid\">\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 (\r\n !errorMessages?.['required'] &&\r\n ((controlOrGroup?.errors?.['required']) || (getControl('start')?.errors?.['required'] || getControl('end')?.errors?.['required']))\r\n ) {\r\n <span [innerHtml]=\"'_COMMON._FORM.ERROR_IS_MANDATORY' | translate: {label: label | translate}\"></span>\r\n }\r\n @if (!errorMessages?.['rangeInvalid'] && controlOrGroup?.errors?.['rangeInvalid']) {\r\n <span>{{'_COMMON._DATES.ERROR_START_END_PERIOD' | translate}}</span>\r\n }\r\n @if (!errorMessages?.['fileExtension'] && controlOrGroup?.errors?.['fileExtension']) {\r\n <span>{{ '_COMMON._FORM.ERROR_FILE_EXTENSION' | translate: { accept: acceptLabel } }}</span>\r\n }\r\n @if (!errorMessages?.['fileSize'] && controlOrGroup?.errors?.['fileSize']) {\r\n <span>{{ '_COMMON._FORM.ERROR_FILE_SIZE' | translate: { maxSize: maxSizeLabel } }}</span>\r\n }\r\n @if (!errorMessages?.['email'] && controlOrGroup?.errors?.['email']) {\r\n <span>{{ '_COMMON._FORM.ERROR_INVALID_EMAIL' | translate }}</span>\r\n }\r\n @if (!errorMessages?.['phone'] && controlOrGroup?.errors?.['phone']) {\r\n <span>{{ '_COMMON._FORM.ERROR_INVALID_PHONE' | translate }}</span>\r\n }\r\n @if (errorMessages) {\r\n @for (entry of errorMessages | keyvalue: keepOrder; track entry.key) {\r\n @if (controlOrGroup?.errors?.[entry.key]; as errVal) {\r\n <span>{{ entry.value | translate: (errVal === true ? null : errVal) }}</span>\r\n }\r\n }\r\n }\r\n </div>\r\n }\r\n\r\n @if (help || autoHelpEntries.length) {\r\n <div [id]=\"name + '-help'\" class=\"field-text\">\r\n @if (help) {\r\n <span>{{ help | translate }}</span>\r\n }\r\n @for (entry of autoHelpEntries; track entry.key) {\r\n <span>{{ entry.key | translate: entry.params }}</span>\r\n }\r\n </div>\r\n }\r\n}\r\n@else {\r\n <ng-container [ngTemplateOutlet]=\"field\"></ng-container>\r\n}\r\n\r\n<ng-template #field>\r\n <!-- Autocomplete (mono / multi) -->\r\n @if ((type === typeField.autocomplete || type === typeField.autocompleteMultiple) && autocompleteOptions) {\r\n <cw-autocomplete\r\n [id]=\"name\"\r\n [control]=\"formControl\"\r\n [fetcher]=\"autocompleteOptions.fetcher\"\r\n [displayField]=\"autocompleteOptions.displayField ?? 'label'\"\r\n [valueField]=\"autocompleteOptions.valueField ?? 'id'\"\r\n [columns]=\"autocompleteOptions.columns ?? []\"\r\n [resolver]=\"autocompleteOptions.resolver ?? null\"\r\n [selectedItem]=\"autocompleteOptions.selectedItem ?? null\"\r\n [selectedItems]=\"autocompleteOptions.selectedItems ?? []\"\r\n [minChars]=\"autocompleteOptions.minChars ?? 2\"\r\n [debounceMs]=\"autocompleteOptions.debounceMs ?? 250\"\r\n [multiple]=\"type === typeField.autocompleteMultiple\"\r\n [isRequired]=\"isRequired\"\r\n [isReadonly]=\"!!isReadonly\"\r\n [isDisabled]=\"isEffectivelyDisabled\"\r\n [ariaInvalid]=\"control.invalid && control.touched\"\r\n [ariaDescribedBy]=\"getDescribedBy(control)\"\r\n [placeholder]=\"placeholder\">\r\n </cw-autocomplete>\r\n }\r\n\r\n <!-- Text -->\r\n @if ([typeField.text, typeField.date, typeField.time, typeField.dateTime, typeField.number,\r\n typeField.email,\r\n typeField.color, typeField.zipCode].includes(type)) {\r\n <input [type]=\"type === typeField.zipCode ? 'text' : type\" class=\"field-control\" [id]=\"name\" [formControl]=\"formControl\"\r\n [ngClass]=\"[(cssClass || ''), formControl?.value ? 'has-value' : '', type === typeField.zipCode ? 'field-control-zipcode' : '']\"\r\n [attr.placeholder]=\"placeholder ? (placeholder | translate) : null\" [attr.required]=\"isRequired ? 'required' : null\"\r\n [attr.readonly]=\"isReadonly ? 'readonly' : null\" [attr.aria-required]=\"isRequired\"\r\n [attr.minlength]=\"minLengthAttr\" [attr.maxlength]=\"maxLengthAttr\"\r\n [attr.min]=\"minAttr\" [attr.max]=\"maxAttr\" [attr.step]=\"stepAttr\" [attr.pattern]=\"patternAttr\"\r\n [attr.autocomplete]=\"autocomplete\"\r\n [attr.aria-invalid]=\"control.invalid && control.touched\"\r\n [attr.aria-describedby]=\"getDescribedBy(control)\"\r\n (focus)=\"onFocus()\" (blur)=\"onBlur()\" />\r\n }\r\n\r\n <!-- Phone (intl-tel-input) -->\r\n @if (type === typeField.phone) {\r\n <input #phoneInput type=\"tel\" class=\"field-control\" [id]=\"name\"\r\n [attr.placeholder]=\"placeholder ? (placeholder | translate) : null\" [attr.required]=\"isRequired ? 'required' : null\"\r\n [attr.readonly]=\"isReadonly ? 'readonly' : null\" [disabled]=\"isEffectivelyDisabled\" [attr.aria-required]=\"isRequired\"\r\n [attr.autocomplete]=\"autocomplete\"\r\n [attr.aria-invalid]=\"control.invalid && control.touched\"\r\n [attr.aria-describedby]=\"getDescribedBy(control)\"\r\n (focus)=\"onFocus()\" (blur)=\"onPhoneBlur($event)\" />\r\n }\r\n\r\n <!-- File -->\r\n @if (type === typeField.file) {\r\n <input #fileInput type=\"file\" class=\"field-control\" [id]=\"name\"\r\n [ngClass]=\"[(cssClass || ''), formControl?.value ? 'has-value' : '']\"\r\n [attr.placeholder]=\"placeholder ? (placeholder | translate) : null\" [attr.required]=\"isRequired ? 'required' : null\"\r\n [attr.readonly]=\"isReadonly ? 'readonly' : null\" [disabled]=\"isEffectivelyDisabled\" [attr.aria-required]=\"isRequired\"\r\n [attr.accept]=\"acceptAttr\"\r\n [attr.aria-invalid]=\"control.invalid && control.touched\"\r\n [attr.aria-describedby]=\"getDescribedBy(control)\"\r\n (change)=\"onFileChange($event)\" (focus)=\"onFocus()\" (blur)=\"onBlur()\" />\r\n }\r\n\r\n @if (type === typeField.password) {\r\n <input [type]=\"isPasswordShown ? 'text' : 'password'\" class=\"field-control\" [id]=\"name\" [formControl]=\"formControl\"\r\n [ngClass]=\"[(cssClass || ''), formControl?.value ? 'has-value' : '']\"\r\n [attr.required]=\"isRequired ? 'required' : null\" [attr.readonly]=\"isReadonly ? 'readonly' : null\"\r\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\" [attr.aria-required]=\"isRequired\"\r\n [attr.minlength]=\"minLengthAttr\" [attr.maxlength]=\"maxLengthAttr\" [attr.pattern]=\"patternAttr\"\r\n [attr.autocomplete]=\"autocomplete\"\r\n [attr.aria-invalid]=\"control.invalid && control.touched\"\r\n [attr.aria-describedby]=\"getDescribedBy(control)\"\r\n (focus)=\"onFocus()\" (blur)=\"onBlur()\" />\r\n <cw-button [type]=\"buttonType.secondary\"\r\n [withIcon]=\"isPasswordShown ? spriteIcon.toolbarHidePassword : spriteIcon.toolbarShowPassword\"\r\n [withOnlyIcon]=\"true\"\r\n [label]=\"isPasswordShown ? '_COMMON._FORM._SHOW_HIDE_PWD.HIDE' : '_COMMON._FORM._SHOW_HIDE_PWD.SHOW'\"\r\n (btnAction)=\"togglePasswordVisibility()\">\r\n </cw-button>\r\n }\r\n\r\n <!-- Textarea -->\r\n @if (type === typeField.textarea) {\r\n <textarea class=\"field-control\" [id]=\"name\" [formControl]=\"formControl\"\r\n [ngClass]=\"[(cssClass || ''), formControl?.value ? 'has-value' : '']\"\r\n [attr.placeholder]=\"placeholder ? (placeholder | translate) : null\" [attr.required]=\"isRequired ? 'required' : null\"\r\n [attr.readonly]=\"isReadonly ? 'readonly' : null\" [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\"\r\n [attr.aria-required]=\"isRequired\" [attr.aria-invalid]=\"control.invalid && control.touched\"\r\n [attr.minlength]=\"minLengthAttr\" [attr.maxlength]=\"maxLengthAttr\" [attr.pattern]=\"patternAttr\"\r\n [attr.autocomplete]=\"autocomplete\"\r\n [attr.aria-describedby]=\"getDescribedBy(control)\"\r\n (focus)=\"onFocus()\" (blur)=\"onBlur()\"></textarea>\r\n }\r\n\r\n <!-- Select -->\r\n @if (type === typeField.select) {\r\n <ng-select [formControl]=\"formControl\" [items]=\"options\" bindLabel=\"label\" [labelForId]=\"name\" [appendTo]=\"appendTo\" bindValue=\"value\"\r\n [ngClass]=\"cssClass\" [searchable]=\"false\" [placeholder]=\"placeholder ? (placeholder | translate) : null\" [readonly]=\"isReadonly\" [clearable]=\"false\"\r\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\" [attr.required]=\"isRequired ? 'required' : null\"\r\n [attr.aria-required]=\"isRequired\" [attr.aria-invalid]=\"control.invalid && control.touched\"\r\n [attr.aria-describedby]=\"getDescribedBy(control)\" [attr.id]=\"name\"\r\n (focus)=\"onFocus()\" (blur)=\"onBlur()\">\r\n\r\n <!-- Template pour les options -->\r\n <ng-template ng-option-tmp let-item=\"item\" let-index=\"index\" let-search=\"searchTerm\">\r\n @if (optionTemplate) {\r\n <ng-container *ngTemplateOutlet=\"optionTemplate; context: { item: item | translate, index: index, searchTerm: search }\"></ng-container>\r\n }\r\n @else {\r\n <div>{{ item.label | translate }}</div>\r\n }\r\n </ng-template>\r\n\r\n <!-- Template pour le label -->\r\n <ng-template ng-label-tmp let-item=\"item\">\r\n @if (labelTemplate) {\r\n <ng-container *ngTemplateOutlet=\"labelTemplate; context: { item: item | translate }\"></ng-container>\r\n }\r\n @else {\r\n {{ (item.label | translate) || (placeholder | translate) }}\r\n }\r\n </ng-template>\r\n </ng-select>\r\n }\r\n\r\n <!-- NgSelect -->\r\n @if (type === typeField.ngSelect || type === typeField.ngSelectMultiple) {\r\n <ng-select [formControl]=\"formControl\" [items]=\"options\" bindLabel=\"label\" [labelForId]=\"name\" [appendTo]=\"appendTo\" bindValue=\"value\"\r\n [multiple]=\"type === typeField.ngSelectMultiple\" [ngClass]=\"cssClass\" [clearable]=\"false\"\r\n [placeholder]=\"placeholder ? (placeholder | translate) : null\" [readonly]=\"isReadonly\"\r\n [notFoundText]=\"'_COMMON.NO_RESULT' | translate\" [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\"\r\n [attr.required]=\"isRequired ? 'required' : null\" [attr.aria-required]=\"isRequired\"\r\n [attr.aria-invalid]=\"control.invalid && control.touched\"\r\n [attr.aria-describedby]=\"getDescribedBy(control)\" [attr.id]=\"name\"\r\n (focus)=\"onFocus()\" (blur)=\"onBlur()\" (search)=\"textChanged.emit($event?.term)\">\r\n\r\n <!-- Template pour les options -->\r\n <ng-template ng-option-tmp let-item=\"item\" let-index=\"index\" let-search=\"searchTerm\">\r\n @if (optionTemplate) {\r\n <ng-container *ngTemplateOutlet=\"optionTemplate; context: { item: item, index: index, searchTerm: search }\"></ng-container>\r\n }\r\n @else {\r\n <div>{{ item.label | translate }}</div>\r\n }\r\n </ng-template>\r\n\r\n <!-- Template pour le label -->\r\n <ng-template ng-label-tmp let-item=\"item\" let-clear=\"clear\">\r\n <span class=\"ng-value-icon left\" (click)=\"clear(item)\" aria-hidden=\"true\">\u00D7</span>\r\n @if (labelTemplate) {\r\n <ng-container *ngTemplateOutlet=\"labelTemplate; context: { item: item | translate }\"></ng-container>\r\n }\r\n @else {\r\n {{ (item.label | translate) || (placeholder | translate) }}\r\n }\r\n </ng-template>\r\n </ng-select>\r\n }\r\n\r\n <!-- Radio -->\r\n @if (type === typeField.radioInline || type === typeField.radio) {\r\n <fieldset\r\n [attr.aria-required]=\"isRequired\"\r\n [attr.aria-invalid]=\"control.invalid && control.touched\"\r\n [attr.aria-describedby]=\"getDescribedBy(control)\">\r\n <legend class=\"field-label\" [class.visually-hidden]=\"!displayLabel\">\r\n {{label | translate}}\r\n @if(isRequired) {\r\n <span class=\"text-danger\">*</span>\r\n }\r\n </legend>\r\n <ul class=\"list-unstyled mb-none\" [ngClass]=\"type === typeField.radioInline ? 'd-flex-h gap-md flex-wrap' : 'd-flex-v'\">\r\n @for (opt of options; track opt.value) {\r\n <li class=\"field-check\">\r\n <input type=\"radio\" [id]=\"name + '_' + opt.value\" [value]=\"opt.value\" [formControl]=\"formControl\"\r\n class=\"field-check-input\" [attr.disabled]=\"(isEffectivelyDisabled || opt.disabled) ? 'disabled' : null\" (change)=\"onRadioChange(opt.value)\" />\r\n <label [for]=\"name + '_' + opt.value\" class=\"field-check-label\">{{ opt.label | translate }}</label>\r\n </li>\r\n }\r\n </ul>\r\n </fieldset>\r\n }\r\n\r\n <!-- Radio button -->\r\n @if (type === typeField.radioButton) {\r\n <fieldset\r\n [attr.aria-required]=\"isRequired\"\r\n [attr.aria-invalid]=\"control.invalid && control.touched\"\r\n [attr.aria-describedby]=\"getDescribedBy(control)\">\r\n <legend class=\"field-label\" [class.visually-hidden]=\"!displayLabel\">\r\n {{label | translate}}\r\n @if(isRequired) {\r\n <span class=\"text-danger\">*</span>\r\n }\r\n </legend>\r\n <div class=\"field-group field-group-btn\">\r\n @for (opt of options; track opt.value) {\r\n <input type=\"radio\" [id]=\"name + '_' + opt.value\" [value]=\"opt.value\" [formControl]=\"formControl\"\r\n class=\"visually-hidden\" [attr.disabled]=\"(isEffectivelyDisabled || opt.disabled) ? 'disabled' : null\" (change)=\"onRadioChange(opt.value)\"/>\r\n <label [for]=\"name + '_' + opt.value\" class=\"btn btn-field-group\">{{ opt.label | translate }}</label>\r\n }\r\n </div>\r\n </fieldset>\r\n }\r\n\r\n <!-- Checkbox Switch -->\r\n @if ( type === typeField.switch || type === typeField.switchSmall)\r\n {\r\n <div class=\"field-check field-switch\" [ngClass]=\"{'field-switch-small': type === typeField.switchSmall}\">\r\n <input type=\"checkbox\" [id]=\"name\" [formControl]=\"formControl\" class=\"field-check-input\" [attr.aria-required]=\"isRequired\"\r\n [attr.aria-invalid]=\"control.invalid && control.touched\"\r\n [attr.aria-describedby]=\"getDescribedBy(control)\"\r\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\"/>\r\n <label [for]=\"name\" class=\"field-check-label\">{{ label | translate }}</label>\r\n </div>\r\n }\r\n\r\n <!-- Checkbox -->\r\n @if (type === typeField.checkboxInline || type === typeField.checkbox) {\r\n @if (isSingleCheckbox()) {\r\n <div class=\"field-check\" [class.field-check-inline]=\"type === typeField.checkboxInline\">\r\n <input #checkboxInput type=\"checkbox\" [id]=\"name\" [formControl]=\"formControl\"\r\n class=\"field-check-input\"\r\n [class.is-invalid]=\"control?.invalid && control?.touched\"\r\n [attr.aria-required]=\"isRequired\"\r\n [attr.aria-invalid]=\"control?.invalid && control?.touched\"\r\n [attr.aria-describedby]=\"getDescribedBy(control)\"\r\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\" />\r\n <label [for]=\"name\" class=\"field-check-label\">\r\n {{ label | translate }}\r\n @if (isRequired) {\r\n <span class=\"text-danger\">*</span>\r\n }\r\n </label>\r\n </div>\r\n }\r\n @else if( options.length > 1) {\r\n <fieldset\r\n [attr.aria-required]=\"isRequired\"\r\n [attr.aria-invalid]=\"control.invalid && control.touched\"\r\n [attr.aria-describedby]=\"getDescribedBy(control)\"\r\n [ngClass]=\"{ 'flex-column': type === typeField.checkbox }\">\r\n <legend class=\"field-label\" [class.visually-hidden]=\"!displayLabel\">\r\n {{label | translate}}\r\n @if(isRequired) {\r\n <span class=\"text-danger\">*</span>\r\n }\r\n </legend>\r\n <ul class=\"list-unstyled mb-none\" [ngClass]=\"type === typeField.checkboxInline ? 'd-flex-h gap-md' : 'd-flex-v'\">\r\n @for (opt of options; track opt.value) {\r\n <li class=\"field-check\" [ngClass]=\"{ 'field-check-inline': type === typeField.checkboxInline }\">\r\n <input type=\"checkbox\" [id]=\"name + '_' + opt.value\" [value]=\"opt.value\" (change)=\"onCheckboxChange($event)\"\r\n [checked]=\"control.value?.includes(opt.value)\" class=\"field-check-input\"\r\n [attr.disabled]=\"(isEffectivelyDisabled || opt.disabled) ? 'disabled' : null\" />\r\n <label [for]=\"name + '_' + opt.value\" class=\"field-check-label\">\r\n {{ opt.label | translate }}\r\n </label>\r\n </li>\r\n }\r\n </ul>\r\n </fieldset>\r\n }\r\n @else {\r\n <fieldset>\r\n <legend class=\"field-label\" [class.visually-hidden]=\"!displayLabel\">\r\n {{label | translate}}\r\n </legend>\r\n <ul class=\"list-unstyled mb-none\" [ngClass]=\"type === typeField.checkboxInline ? 'd-flex-h gap-md' : 'd-flex-v'\">\r\n @for (opt of options; track opt.value) {\r\n <li class=\"field-check\" [ngClass]=\"{ 'field-check-inline': type === typeField.checkboxInline }\">\r\n <input type=\"checkbox\" [id]=\"name + '_' + opt.value\" [value]=\"opt.value\" (change)=\"onCheckboxChange($event)\"\r\n [checked]=\"control.value?.includes(opt.value)\" class=\"field-check-input\"\r\n [attr.aria-required]=\"isRequired\"\r\n [attr.aria-invalid]=\"control.invalid && control.touched\"\r\n [attr.aria-describedby]=\"getDescribedBy(control)\"\r\n [attr.disabled]=\"(isEffectivelyDisabled || opt.disabled) ? 'disabled' : null\" />\r\n <label [for]=\"name + '_' + opt.value\" class=\"field-check-label\">\r\n {{ opt.label | translate }}\r\n @if(isRequired) {\r\n <span class=\"text-danger\">*</span>\r\n }\r\n </label>\r\n </li>\r\n }\r\n </ul>\r\n </fieldset>\r\n }\r\n }\r\n\r\n <!-- Checkbox button -->\r\n @if (type === typeField.checkboxButton && options.length > 0) {\r\n\r\n @if(options.length > 1) {\r\n <fieldset\r\n [attr.aria-required]=\"isRequired\"\r\n [attr.aria-invalid]=\"control.invalid && control.touched\"\r\n [attr.aria-describedby]=\"getDescribedBy(control)\">\r\n <legend class=\"field-label\" [class.visually-hidden]=\"!displayLabel\">\r\n {{label | translate}}\r\n @if(isRequired) {\r\n <span class=\"text-danger\">*</span>\r\n }\r\n </legend>\r\n <div class=\"field-group field-group-btn\">\r\n @for (opt of options; track opt.value) {\r\n <input type=\"checkbox\" [id]=\"name + '_' + opt.value\" [value]=\"opt.value\" (change)=\"onCheckboxChange($event)\"\r\n [checked]=\"control.value?.includes(opt.value)\" class=\"visually-hidden\"\r\n [attr.disabled]=\"(isEffectivelyDisabled || opt.disabled) ? 'disabled' : null\" />\r\n <label [for]=\"name + '_' + opt.value\" class=\"btn btn-field-group\">{{ opt.label | translate }}</label>\r\n }\r\n </div>\r\n </fieldset>\r\n }\r\n @else {\r\n <fieldset>\r\n <legend class=\"field-label\" [class.visually-hidden]=\"!displayLabel\">\r\n {{label | translate}}\r\n </legend>\r\n <div class=\"btn-group btn-group-secondary\">\r\n @for (opt of options; track opt.value) {\r\n <input type=\"checkbox\" [id]=\"name + '_' + opt.value\" [value]=\"opt.value\" (change)=\"onCheckboxChange($event)\"\r\n [checked]=\"control.value?.includes(opt.value)\" class=\"visually-hidden\"\r\n [attr.aria-required]=\"isRequired\"\r\n [attr.aria-invalid]=\"control.invalid && control.touched\"\r\n [attr.aria-describedby]=\"getDescribedBy(control)\"\r\n [attr.disabled]=\"(isEffectivelyDisabled || opt.disabled) ? '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 <div class=\"field-group-text\">Du</div>\r\n <input [type]=\"getInputType()\" class=\"field-control\" [id]=\"name + '_start'\" [formControl]=\"getControl('start')\"\r\n [attr.placeholder]=\"type === typeField.timeToTime ? ('_COMMON._DATES.FROM' | translate) : ('_COMMON._DATES.FROM_TO_1' | translate)\"\r\n [ngClass]=\"[(cssClass || ''), getControl('start')?.value ? 'has-value' : '']\"\r\n [attr.required]=\"isRequired ? 'required' : null\" [attr.readonly]=\"isReadonly ? 'readonly' : null\"\r\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\" [attr.aria-required]=\"isRequired\"\r\n [attr.min]=\"minStartAttr\" [attr.max]=\"maxStartAttr\" [attr.step]=\"stepAttr\"\r\n [attr.autocomplete]=\"autocomplete\"\r\n [attr.aria-invalid]=\"getControl('start')?.invalid && getControl('start')?.touched\"\r\n [attr.aria-describedby]=\"getDescribedBy(getControl('start'))\"\r\n (focus)=\"onFocusRange('start')\" />\r\n\r\n @if(getControl('start')?.value && !isEffectivelyDisabled) {\r\n <button type=\"button\" class=\"btn btn-secondary btn-clear-field\"\r\n (click)=\"onClearFieldPeriod('start')\">\r\n ×\r\n </button>\r\n }\r\n <div class=\"field-group-text\">au</div>\r\n <input [type]=\"getInputType()\" class=\"field-control\" [id]=\"name + '_end'\" [formControl]=\"getControl('end')\"\r\n [attr.placeholder]=\"type === typeField.timeToTime ? ('_COMMON._DATES.TO' | translate) : ('_COMMON._DATES.FROM_TO_2' | translate)\"\r\n [ngClass]=\"[(cssClass || ''), getControl('end')?.value ? 'has-value' : '']\"\r\n [attr.required]=\"isRequired ? 'required' : null\" [attr.readonly]=\"isReadonly ? 'readonly' : null\"\r\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\"\r\n [attr.min]=\"minEndAttr\" [attr.max]=\"maxEndAttr\" [attr.step]=\"stepAttr\"\r\n [attr.autocomplete]=\"autocomplete\"\r\n [attr.aria-invalid]=\"getControl('end')?.invalid && getControl('end')?.touched\"\r\n [attr.aria-describedby]=\"getDescribedBy(getControl('end'))\"\r\n (focus)=\"onFocusRange('end')\" />\r\n\r\n @if(getControl('end')?.value && !isEffectivelyDisabled) {\r\n <button type=\"button\" class=\"btn btn-secondary btn-clear-field\"\r\n (click)=\"onClearFieldPeriod('end')\">\r\n ×\r\n </button>\r\n }\r\n </div>\r\n }\r\n\r\n @if ([typeField.datePlusOne, typeField.datePlusTwo, typeField.datePlusSeven, typeField.dateComplexe].includes(type)) {\r\n\r\n <div class=\"field-group\">\r\n @if (type === typeField.dateComplexe) {\r\n <button class=\"btn btn-secondary\" type=\"button\" (click)=\"onDateAddDay('prev')\"\r\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\">\r\n <cw-icon font=\"optyweb\" [icon]=\"spriteIcon.nextLeft\" [label]=\"'Jour pr\u00E9c\u00E9dent'\"></cw-icon>\r\n </button>\r\n }\r\n\r\n <input type=\"date\" class=\"field-control\" [id]=\"name\" [formControl]=\"formControl\"\r\n [ngClass]=\"[(cssClass || ''), formControl?.value ? 'has-value' : '']\"\r\n [attr.placeholder]=\"placeholder ? placeholder : null\" [attr.required]=\"isRequired ? 'required' : null\"\r\n [attr.readonly]=\"isReadonly ? 'readonly' : null\" [attr.aria-required]=\"isRequired\"\r\n [attr.min]=\"minAttr\" [attr.max]=\"maxAttr\" [attr.step]=\"stepAttr\"\r\n [attr.autocomplete]=\"autocomplete\"\r\n [attr.aria-invalid]=\"control.invalid && control.touched\"\r\n [attr.aria-describedby]=\"getDescribedBy(control)\"\r\n (focus)=\"onFocus()\" (blur)=\"onBlur()\" />\r\n\r\n @if(formControl?.value && !isEffectivelyDisabled) {\r\n <button class=\"btn btn-secondary btn-clear-field\" type=\"button\"\r\n (click)=\"onClearField(formControl)\">×</button>\r\n }\r\n\r\n @if (type === typeField.dateComplexe) {\r\n <button class=\"btn btn-secondary\" type=\"button\" (click)=\"onDateAddDay('next')\"\r\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\">\r\n <cw-icon font=\"optyweb\" [icon]=\"spriteIcon.nextRight\" [label]=\"'Jour suivant'\"></cw-icon>\r\n </button>\r\n <button class=\"btn btn-secondary\" type=\"button\" (click)=\"onRefresh()\"\r\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\">\r\n <cw-icon font=\"optyweb\" [icon]=\"spriteIcon.toolbarRefresh\" [label]=\"'Rafra\u00EEchir'\"></cw-icon>\r\n </button>\r\n }\r\n\r\n <button class=\"btn btn-secondary\" type=\"button\" (click)=\"onTodayAddDay(0)\"\r\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\">\r\n J\r\n <span class=\"visually-hidden\">Aujourd'hui</span>\r\n </button>\r\n <button class=\"btn btn-secondary\" type=\"button\" (click)=\"onTodayAddDay(1)\"\r\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\">\r\n J+1\r\n <span class=\"visually-hidden\">Demain</span>\r\n </button>\r\n\r\n @if (type !== typeField.datePlusOne && type !== typeField.dateComplexe) {\r\n <button class=\"btn btn-secondary \" type=\"button\" (click)=\"onTodayAddDay(2)\"\r\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\">\r\n J+2\r\n <span class=\"visually-hidden\">Dans 2 jours</span>\r\n </button>\r\n\r\n @if (type !== typeField.datePlusTwo) {\r\n <button class=\"btn btn-secondary\" type=\"button\" (click)=\"onTodayAddDay(7)\"\r\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\">\r\n J+7\r\n <span class=\"visually-hidden\">Dans 7 jours</span>\r\n </button>\r\n }\r\n }\r\n </div>\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\">\r\n </div>\r\n\r\n <cw-button [isDisabled]=\"formControl.value >= rangeOptions.ceil\" [label]=\"'Augmenter ' + formControl.value + ' ' + label\"\r\n [withIcon]=\"spriteIcon.toolbarPlus\" [withOnlyIcon]=\"true\" [type]=\"buttonType.primary\"\r\n [iconSize]=\"buttonIconSize.small\" (btnAction)=\"onRangeStep('increase')\">\r\n </cw-button>\r\n </div>\r\n }\r\n\r\n @if (isInInputGroup() && clearable && !isEffectivelyDisabled && type !== typeField.autocompleteMultiple && type !== typeField.ngSelectMultiple) {\r\n @if (type === typeField.autocomplete) {\r\n @if (autocompleteRef()?.hasAnyContent()) {\r\n <button class=\"btn btn-secondary btn-clear-field\" type=\"button\"\r\n (click)=\"autocompleteRef()!.clear()\">×</button>\r\n }\r\n } @else {\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\r\n</ng-template>\r\n" }]
|
|
3540
|
+
], 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\" [class.field-group-invalid]=\"isInvalid\" [class.field-group-disabled]=\"isDisabledOrReadonly\">\r\n @if(addonLeft) {\r\n <div class=\"field-group-addon-left\">\r\n <ng-container [ngTemplateOutlet]=\"addonLeft\"></ng-container>\r\n </div>\r\n }\r\n <ng-container [ngTemplateOutlet]=\"field\"></ng-container>\r\n @if(addonRight) {\r\n <div class=\"field-group-addon-right\">\r\n <ng-container [ngTemplateOutlet]=\"addonRight\"></ng-container>\r\n </div>\r\n }\r\n </div>\r\n }\r\n @else {\r\n @if ( isInInputGroup() ) {\r\n <div class=\"field-group\" [class.field-group-invalid]=\"isInvalid\" [class.field-group-disabled]=\"isDisabledOrReadonly\">\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 (\r\n !errorMessages?.['required'] &&\r\n ((controlOrGroup?.errors?.['required']) || (getControl('start')?.errors?.['required'] || getControl('end')?.errors?.['required']))\r\n ) {\r\n <span [innerHtml]=\"'_COMMON._FORM.ERROR_IS_MANDATORY' | translate: {label: label | translate}\"></span>\r\n }\r\n @if (!errorMessages?.['rangeInvalid'] && controlOrGroup?.errors?.['rangeInvalid']) {\r\n <span>{{'_COMMON._DATES.ERROR_START_END_PERIOD' | translate}}</span>\r\n }\r\n @if (!errorMessages?.['fileExtension'] && controlOrGroup?.errors?.['fileExtension']) {\r\n <span>{{ '_COMMON._FORM.ERROR_FILE_EXTENSION' | translate: { accept: acceptLabel } }}</span>\r\n }\r\n @if (!errorMessages?.['fileSize'] && controlOrGroup?.errors?.['fileSize']) {\r\n <span>{{ '_COMMON._FORM.ERROR_FILE_SIZE' | translate: { maxSize: maxSizeLabel } }}</span>\r\n }\r\n @if (!errorMessages?.['email'] && controlOrGroup?.errors?.['email']) {\r\n <span>{{ '_COMMON._FORM.ERROR_INVALID_EMAIL' | translate }}</span>\r\n }\r\n @if (!errorMessages?.['phone'] && controlOrGroup?.errors?.['phone']) {\r\n <span>{{ '_COMMON._FORM.ERROR_INVALID_PHONE' | translate }}</span>\r\n }\r\n @if (errorMessages) {\r\n @for (entry of errorMessages | keyvalue: keepOrder; track entry.key) {\r\n @if (controlOrGroup?.errors?.[entry.key]; as errVal) {\r\n <span>{{ entry.value | translate: (errVal === true ? null : errVal) }}</span>\r\n }\r\n }\r\n }\r\n </div>\r\n }\r\n\r\n @if (help || autoHelpEntries.length) {\r\n <div [id]=\"name + '-help'\" class=\"field-text\">\r\n @if (help) {\r\n <span>{{ help | translate }}</span>\r\n }\r\n @for (entry of autoHelpEntries; track entry.key) {\r\n <span>{{ entry.key | translate: entry.params }}</span>\r\n }\r\n </div>\r\n }\r\n\r\n <!-- Chips de la multi-s\u00E9lection (autocomplete) : rendus ici, hors du field-group et apr\u00E8s\r\n erreur/help, pour \u00EAtre visuellement d\u00E9tach\u00E9s du champ. La donn\u00E9e et le retrait restent\r\n port\u00E9s par cw-autocomplete (`chips()` / `onChipRemove()`), seul l'affichage est d\u00E9l\u00E9gu\u00E9. -->\r\n @if (type === typeField.autocompleteMultiple && autocompleteRef()?.chips()?.length) {\r\n <ul class=\"autocomplete-chips\" role=\"list\">\r\n @for (chip of autocompleteRef()!.chips(); track chip.item) {\r\n <li>\r\n <button type=\"button\" class=\"autocomplete-chip\"\r\n [disabled]=\"isEffectivelyDisabled || isReadonly\"\r\n (click)=\"autocompleteRef()!.onChipRemove(chip.item)\">\r\n <span>{{ chip.label }}</span>\r\n @if (!isEffectivelyDisabled && !isReadonly) {\r\n <span aria-hidden=\"true\" class=\"autocomplete-chip-x\">×</span>\r\n <span class=\"visually-hidden\">{{ '_COMMON._ACTION.DELETE' | translate }}</span>\r\n }\r\n </button>\r\n </li>\r\n }\r\n </ul>\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 <!-- Autocomplete (mono / multi) -->\r\n @if ((type === typeField.autocomplete || type === typeField.autocompleteMultiple) && autocompleteOptions) {\r\n <cw-autocomplete\r\n [id]=\"name\"\r\n [control]=\"formControl\"\r\n [fetcher]=\"autocompleteOptions.fetcher\"\r\n [displayField]=\"autocompleteOptions.displayField ?? 'label'\"\r\n [valueField]=\"autocompleteOptions.valueField ?? 'id'\"\r\n [columns]=\"autocompleteOptions.columns ?? []\"\r\n [resolver]=\"autocompleteOptions.resolver ?? null\"\r\n [selectedItem]=\"autocompleteOptions.selectedItem ?? null\"\r\n [selectedItems]=\"autocompleteOptions.selectedItems ?? []\"\r\n [minChars]=\"autocompleteOptions.minChars ?? 2\"\r\n [debounceMs]=\"autocompleteOptions.debounceMs ?? 250\"\r\n [multiple]=\"type === typeField.autocompleteMultiple\"\r\n [isRequired]=\"isRequired\"\r\n [isReadonly]=\"!!isReadonly\"\r\n [isDisabled]=\"isEffectivelyDisabled\"\r\n [ariaInvalid]=\"control.invalid && control.touched\"\r\n [ariaDescribedBy]=\"getDescribedBy(control)\"\r\n [placeholder]=\"placeholder\">\r\n </cw-autocomplete>\r\n }\r\n\r\n <!-- Text -->\r\n @if ([typeField.text, typeField.date, typeField.time, typeField.dateTime, typeField.number,\r\n typeField.email,\r\n typeField.color, typeField.zipCode].includes(type)) {\r\n <input [type]=\"type === typeField.zipCode ? 'text' : type\" class=\"field-control\" [id]=\"name\" [formControl]=\"formControl\"\r\n [ngClass]=\"[(cssClass || ''), formControl?.value ? 'has-value' : '', type === typeField.zipCode ? 'field-control-zipcode' : '']\"\r\n [attr.placeholder]=\"placeholder ? (placeholder | translate) : null\" [attr.required]=\"isRequired ? 'required' : null\"\r\n [attr.readonly]=\"isReadonly ? 'readonly' : null\" [attr.aria-required]=\"isRequired\"\r\n [attr.minlength]=\"minLengthAttr\" [attr.maxlength]=\"maxLengthAttr\"\r\n [attr.min]=\"minAttr\" [attr.max]=\"maxAttr\" [attr.step]=\"stepAttr\" [attr.pattern]=\"patternAttr\"\r\n [attr.autocomplete]=\"autocomplete\"\r\n [attr.aria-invalid]=\"control.invalid && control.touched\"\r\n [attr.aria-describedby]=\"getDescribedBy(control)\"\r\n (focus)=\"onFocus()\" (blur)=\"onBlur()\" />\r\n }\r\n\r\n <!-- Phone (intl-tel-input) -->\r\n @if (type === typeField.phone) {\r\n <input #phoneInput type=\"tel\" class=\"field-control\" [id]=\"name\"\r\n [attr.placeholder]=\"placeholder ? (placeholder | translate) : null\" [attr.required]=\"isRequired ? 'required' : null\"\r\n [attr.readonly]=\"isReadonly ? 'readonly' : null\" [disabled]=\"isEffectivelyDisabled\" [attr.aria-required]=\"isRequired\"\r\n [attr.autocomplete]=\"autocomplete\"\r\n [attr.aria-invalid]=\"control.invalid && control.touched\"\r\n [attr.aria-describedby]=\"getDescribedBy(control)\"\r\n (focus)=\"onFocus()\" (blur)=\"onPhoneBlur($event)\" />\r\n }\r\n\r\n <!-- File -->\r\n @if (type === typeField.file) {\r\n <input #fileInput type=\"file\" class=\"field-control\" [id]=\"name\"\r\n [ngClass]=\"[(cssClass || ''), formControl?.value ? 'has-value' : '']\"\r\n [attr.placeholder]=\"placeholder ? (placeholder | translate) : null\" [attr.required]=\"isRequired ? 'required' : null\"\r\n [attr.readonly]=\"isReadonly ? 'readonly' : null\" [disabled]=\"isEffectivelyDisabled\" [attr.aria-required]=\"isRequired\"\r\n [attr.accept]=\"acceptAttr\"\r\n [attr.aria-invalid]=\"control.invalid && control.touched\"\r\n [attr.aria-describedby]=\"getDescribedBy(control)\"\r\n (change)=\"onFileChange($event)\" (focus)=\"onFocus()\" (blur)=\"onBlur()\" />\r\n }\r\n\r\n @if (type === typeField.password) {\r\n <input [type]=\"isPasswordShown ? 'text' : 'password'\" class=\"field-control\" [id]=\"name\" [formControl]=\"formControl\"\r\n [ngClass]=\"[(cssClass || ''), formControl?.value ? 'has-value' : '']\"\r\n [attr.required]=\"isRequired ? 'required' : null\" [attr.readonly]=\"isReadonly ? 'readonly' : null\"\r\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\" [attr.aria-required]=\"isRequired\"\r\n [attr.minlength]=\"minLengthAttr\" [attr.maxlength]=\"maxLengthAttr\" [attr.pattern]=\"patternAttr\"\r\n [attr.autocomplete]=\"autocomplete\"\r\n [attr.aria-invalid]=\"control.invalid && control.touched\"\r\n [attr.aria-describedby]=\"getDescribedBy(control)\"\r\n (focus)=\"onFocus()\" (blur)=\"onBlur()\" />\r\n <cw-button [type]=\"buttonType.ghost\"\r\n cssClass=\"btn-password-field\"\r\n [withIcon]=\"isPasswordShown ? spriteIcon.toolbarHidePassword : spriteIcon.toolbarShowPassword\"\r\n [withOnlyIcon]=\"true\"\r\n [label]=\"isPasswordShown ? '_COMMON._FORM._SHOW_HIDE_PWD.HIDE' : '_COMMON._FORM._SHOW_HIDE_PWD.SHOW'\"\r\n (btnAction)=\"togglePasswordVisibility()\">\r\n </cw-button>\r\n }\r\n\r\n <!-- Textarea -->\r\n @if (type === typeField.textarea) {\r\n <textarea class=\"field-control\" [id]=\"name\" [formControl]=\"formControl\"\r\n [ngClass]=\"[(cssClass || ''), formControl?.value ? 'has-value' : '']\"\r\n [attr.placeholder]=\"placeholder ? (placeholder | translate) : null\" [attr.required]=\"isRequired ? 'required' : null\"\r\n [attr.readonly]=\"isReadonly ? 'readonly' : null\" [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\"\r\n [attr.aria-required]=\"isRequired\" [attr.aria-invalid]=\"control.invalid && control.touched\"\r\n [attr.minlength]=\"minLengthAttr\" [attr.maxlength]=\"maxLengthAttr\" [attr.pattern]=\"patternAttr\"\r\n [attr.autocomplete]=\"autocomplete\"\r\n [attr.aria-describedby]=\"getDescribedBy(control)\"\r\n (focus)=\"onFocus()\" (blur)=\"onBlur()\"></textarea>\r\n }\r\n\r\n <!-- Select -->\r\n @if (type === typeField.select) {\r\n <ng-select [formControl]=\"formControl\" [items]=\"options\" bindLabel=\"label\" [labelForId]=\"name\" [appendTo]=\"appendTo\" bindValue=\"value\"\r\n [ngClass]=\"cssClass\" [searchable]=\"false\" [placeholder]=\"placeholder ? (placeholder | translate) : null\" [readonly]=\"isReadonly\" [clearable]=\"false\"\r\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\" [attr.required]=\"isRequired ? 'required' : null\"\r\n [attr.aria-required]=\"isRequired\" [attr.aria-invalid]=\"control.invalid && control.touched\"\r\n [attr.aria-describedby]=\"getDescribedBy(control)\" [attr.id]=\"name\"\r\n (focus)=\"onFocus()\" (blur)=\"onBlur()\">\r\n\r\n <!-- Template pour les options -->\r\n <ng-template ng-option-tmp let-item=\"item\" let-index=\"index\" let-search=\"searchTerm\">\r\n @if (optionTemplate) {\r\n <ng-container *ngTemplateOutlet=\"optionTemplate; context: { item: item | translate, index: index, searchTerm: search }\"></ng-container>\r\n }\r\n @else {\r\n <div>{{ item.label | translate }}</div>\r\n }\r\n </ng-template>\r\n\r\n <!-- Template pour le label -->\r\n <ng-template ng-label-tmp let-item=\"item\">\r\n @if (labelTemplate) {\r\n <ng-container *ngTemplateOutlet=\"labelTemplate; context: { item: item | translate }\"></ng-container>\r\n }\r\n @else {\r\n {{ (item.label | translate) || (placeholder | translate) }}\r\n }\r\n </ng-template>\r\n </ng-select>\r\n }\r\n\r\n <!-- NgSelect -->\r\n @if (type === typeField.ngSelect || type === typeField.ngSelectMultiple) {\r\n <ng-select [formControl]=\"formControl\" [items]=\"options\" bindLabel=\"label\" [labelForId]=\"name\" [appendTo]=\"appendTo\" bindValue=\"value\"\r\n [multiple]=\"type === typeField.ngSelectMultiple\" [ngClass]=\"cssClass\" [clearable]=\"false\"\r\n [placeholder]=\"placeholder ? (placeholder | translate) : null\" [readonly]=\"isReadonly\"\r\n [notFoundText]=\"'_COMMON.NO_RESULT' | translate\" [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\"\r\n [attr.required]=\"isRequired ? 'required' : null\" [attr.aria-required]=\"isRequired\"\r\n [attr.aria-invalid]=\"control.invalid && control.touched\"\r\n [attr.aria-describedby]=\"getDescribedBy(control)\" [attr.id]=\"name\"\r\n (focus)=\"onFocus()\" (blur)=\"onBlur()\" (search)=\"textChanged.emit($event?.term)\">\r\n\r\n <!-- Template pour les options -->\r\n <ng-template ng-option-tmp let-item=\"item\" let-index=\"index\" let-search=\"searchTerm\">\r\n @if (optionTemplate) {\r\n <ng-container *ngTemplateOutlet=\"optionTemplate; context: { item: item, index: index, searchTerm: search }\"></ng-container>\r\n }\r\n @else {\r\n <div>{{ item.label | translate }}</div>\r\n }\r\n </ng-template>\r\n\r\n <!-- Template pour le label -->\r\n <ng-template ng-label-tmp let-item=\"item\" let-clear=\"clear\">\r\n <span class=\"ng-value-icon left\" (click)=\"clear(item)\" aria-hidden=\"true\">\u00D7</span>\r\n @if (labelTemplate) {\r\n <ng-container *ngTemplateOutlet=\"labelTemplate; context: { item: item | translate }\"></ng-container>\r\n }\r\n @else {\r\n {{ (item.label | translate) || (placeholder | translate) }}\r\n }\r\n </ng-template>\r\n </ng-select>\r\n }\r\n\r\n <!-- Radio -->\r\n @if (type === typeField.radioInline || type === typeField.radio) {\r\n <fieldset\r\n [attr.aria-required]=\"isRequired\"\r\n [attr.aria-invalid]=\"control.invalid && control.touched\"\r\n [attr.aria-describedby]=\"getDescribedBy(control)\">\r\n <legend class=\"field-label\" [class.visually-hidden]=\"!displayLabel\">\r\n {{label | translate}}\r\n @if(isRequired) {\r\n <span class=\"text-danger\">*</span>\r\n }\r\n </legend>\r\n <ul class=\"list-unstyled mb-none\" [ngClass]=\"type === typeField.radioInline ? 'd-flex-h gap-md flex-wrap' : 'd-flex-v'\">\r\n @for (opt of options; track opt.value) {\r\n <li class=\"field-check\">\r\n <input type=\"radio\" [id]=\"name + '_' + opt.value\" [value]=\"opt.value\" [formControl]=\"formControl\"\r\n class=\"field-check-input\" [attr.disabled]=\"(isEffectivelyDisabled || opt.disabled) ? 'disabled' : null\" (change)=\"onRadioChange(opt.value)\" />\r\n <label [for]=\"name + '_' + opt.value\" class=\"field-check-label\">{{ opt.label | translate }}</label>\r\n </li>\r\n }\r\n </ul>\r\n </fieldset>\r\n }\r\n\r\n <!-- Radio button -->\r\n @if (type === typeField.radioButton) {\r\n <fieldset\r\n [attr.aria-required]=\"isRequired\"\r\n [attr.aria-invalid]=\"control.invalid && control.touched\"\r\n [attr.aria-describedby]=\"getDescribedBy(control)\">\r\n <legend class=\"field-label\" [class.visually-hidden]=\"!displayLabel\">\r\n {{label | translate}}\r\n @if(isRequired) {\r\n <span class=\"text-danger\">*</span>\r\n }\r\n </legend>\r\n <div class=\"field-group field-group-btn\">\r\n @for (opt of options; track opt.value) {\r\n <input type=\"radio\" [id]=\"name + '_' + opt.value\" [value]=\"opt.value\" [formControl]=\"formControl\"\r\n class=\"visually-hidden\" [attr.disabled]=\"(isEffectivelyDisabled || opt.disabled) ? 'disabled' : null\" (change)=\"onRadioChange(opt.value)\"/>\r\n <label [for]=\"name + '_' + opt.value\" class=\"btn btn-field-group\">{{ opt.label | translate }}</label>\r\n }\r\n </div>\r\n </fieldset>\r\n }\r\n\r\n <!-- Checkbox Switch -->\r\n @if ( type === typeField.switch || type === typeField.switchSmall)\r\n {\r\n <div class=\"field-check field-switch\" [ngClass]=\"{'field-switch-small': type === typeField.switchSmall}\">\r\n <input type=\"checkbox\" [id]=\"name\" [formControl]=\"formControl\" class=\"field-check-input\" [attr.aria-required]=\"isRequired\"\r\n [attr.aria-invalid]=\"control.invalid && control.touched\"\r\n [attr.aria-describedby]=\"getDescribedBy(control)\"\r\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\"/>\r\n <label [for]=\"name\" class=\"field-check-label\">{{ label | translate }}</label>\r\n </div>\r\n }\r\n\r\n <!-- Checkbox -->\r\n @if (type === typeField.checkboxInline || type === typeField.checkbox) {\r\n @if (isSingleCheckbox()) {\r\n <div class=\"field-check\" [class.field-check-inline]=\"type === typeField.checkboxInline\">\r\n <input #checkboxInput type=\"checkbox\" [id]=\"name\" [formControl]=\"formControl\"\r\n class=\"field-check-input\"\r\n [class.is-invalid]=\"control?.invalid && control?.touched\"\r\n [attr.aria-required]=\"isRequired\"\r\n [attr.aria-invalid]=\"control?.invalid && control?.touched\"\r\n [attr.aria-describedby]=\"getDescribedBy(control)\"\r\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\" />\r\n <label [for]=\"name\" class=\"field-check-label\">\r\n {{ label | translate }}\r\n @if (isRequired) {\r\n <span class=\"text-danger\">*</span>\r\n }\r\n </label>\r\n </div>\r\n }\r\n @else if( options.length > 1) {\r\n <fieldset\r\n [attr.aria-required]=\"isRequired\"\r\n [attr.aria-invalid]=\"control.invalid && control.touched\"\r\n [attr.aria-describedby]=\"getDescribedBy(control)\"\r\n [ngClass]=\"{ 'flex-column': type === typeField.checkbox }\">\r\n <legend class=\"field-label\" [class.visually-hidden]=\"!displayLabel\">\r\n {{label | translate}}\r\n @if(isRequired) {\r\n <span class=\"text-danger\">*</span>\r\n }\r\n </legend>\r\n <ul class=\"list-unstyled mb-none\" [ngClass]=\"type === typeField.checkboxInline ? 'd-flex-h gap-md' : 'd-flex-v'\">\r\n @for (opt of options; track opt.value) {\r\n <li class=\"field-check\" [ngClass]=\"{ 'field-check-inline': type === typeField.checkboxInline }\">\r\n <input type=\"checkbox\" [id]=\"name + '_' + opt.value\" [value]=\"opt.value\" (change)=\"onCheckboxChange($event)\"\r\n [checked]=\"control.value?.includes(opt.value)\" class=\"field-check-input\"\r\n [attr.disabled]=\"(isEffectivelyDisabled || opt.disabled) ? 'disabled' : null\" />\r\n <label [for]=\"name + '_' + opt.value\" class=\"field-check-label\">\r\n {{ opt.label | translate }}\r\n </label>\r\n </li>\r\n }\r\n </ul>\r\n </fieldset>\r\n }\r\n @else {\r\n <fieldset>\r\n <legend class=\"field-label\" [class.visually-hidden]=\"!displayLabel\">\r\n {{label | translate}}\r\n </legend>\r\n <ul class=\"list-unstyled mb-none\" [ngClass]=\"type === typeField.checkboxInline ? 'd-flex-h gap-md' : 'd-flex-v'\">\r\n @for (opt of options; track opt.value) {\r\n <li class=\"field-check\" [ngClass]=\"{ 'field-check-inline': type === typeField.checkboxInline }\">\r\n <input type=\"checkbox\" [id]=\"name + '_' + opt.value\" [value]=\"opt.value\" (change)=\"onCheckboxChange($event)\"\r\n [checked]=\"control.value?.includes(opt.value)\" class=\"field-check-input\"\r\n [attr.aria-required]=\"isRequired\"\r\n [attr.aria-invalid]=\"control.invalid && control.touched\"\r\n [attr.aria-describedby]=\"getDescribedBy(control)\"\r\n [attr.disabled]=\"(isEffectivelyDisabled || opt.disabled) ? 'disabled' : null\" />\r\n <label [for]=\"name + '_' + opt.value\" class=\"field-check-label\">\r\n {{ opt.label | translate }}\r\n @if(isRequired) {\r\n <span class=\"text-danger\">*</span>\r\n }\r\n </label>\r\n </li>\r\n }\r\n </ul>\r\n </fieldset>\r\n }\r\n }\r\n\r\n <!-- Checkbox button -->\r\n @if (type === typeField.checkboxButton && options.length > 0) {\r\n\r\n @if(options.length > 1) {\r\n <fieldset\r\n [attr.aria-required]=\"isRequired\"\r\n [attr.aria-invalid]=\"control.invalid && control.touched\"\r\n [attr.aria-describedby]=\"getDescribedBy(control)\">\r\n <legend class=\"field-label\" [class.visually-hidden]=\"!displayLabel\">\r\n {{label | translate}}\r\n @if(isRequired) {\r\n <span class=\"text-danger\">*</span>\r\n }\r\n </legend>\r\n <div class=\"field-group field-group-btn\">\r\n @for (opt of options; track opt.value) {\r\n <input type=\"checkbox\" [id]=\"name + '_' + opt.value\" [value]=\"opt.value\" (change)=\"onCheckboxChange($event)\"\r\n [checked]=\"control.value?.includes(opt.value)\" class=\"visually-hidden\"\r\n [attr.disabled]=\"(isEffectivelyDisabled || opt.disabled) ? 'disabled' : null\" />\r\n <label [for]=\"name + '_' + opt.value\" class=\"btn btn-field-group\">{{ opt.label | translate }}</label>\r\n }\r\n </div>\r\n </fieldset>\r\n }\r\n @else {\r\n <fieldset>\r\n <legend class=\"field-label\" [class.visually-hidden]=\"!displayLabel\">\r\n {{label | translate}}\r\n </legend>\r\n <div class=\"btn-group btn-group-secondary\">\r\n @for (opt of options; track opt.value) {\r\n <input type=\"checkbox\" [id]=\"name + '_' + opt.value\" [value]=\"opt.value\" (change)=\"onCheckboxChange($event)\"\r\n [checked]=\"control.value?.includes(opt.value)\" class=\"visually-hidden\"\r\n [attr.aria-required]=\"isRequired\"\r\n [attr.aria-invalid]=\"control.invalid && control.touched\"\r\n [attr.aria-describedby]=\"getDescribedBy(control)\"\r\n [attr.disabled]=\"(isEffectivelyDisabled || opt.disabled) ? '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 <div class=\"field-group-addon-left\">Du</div>\r\n <input [type]=\"getInputType()\" class=\"field-control\" [id]=\"name + '_start'\" [formControl]=\"getControl('start')\"\r\n [attr.placeholder]=\"type === typeField.timeToTime ? ('_COMMON._DATES.FROM' | translate) : ('_COMMON._DATES.FROM_TO_1' | translate)\"\r\n [ngClass]=\"[(cssClass || ''), getControl('start')?.value ? 'has-value' : '']\"\r\n [attr.required]=\"isRequired ? 'required' : null\" [attr.readonly]=\"isReadonly ? 'readonly' : null\"\r\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\" [attr.aria-required]=\"isRequired\"\r\n [attr.min]=\"minStartAttr\" [attr.max]=\"maxStartAttr\" [attr.step]=\"stepAttr\"\r\n [attr.autocomplete]=\"autocomplete\"\r\n [attr.aria-invalid]=\"getControl('start')?.invalid && getControl('start')?.touched\"\r\n [attr.aria-describedby]=\"getDescribedBy(getControl('start'))\"\r\n (focus)=\"onFocusRange('start')\" />\r\n\r\n @if(getControl('start')?.value && !isEffectivelyDisabled) {\r\n <button type=\"button\" class=\"btn btn-secondary btn-clear-field\"\r\n (click)=\"onClearFieldPeriod('start')\">\r\n ×\r\n </button>\r\n }\r\n <div class=\"field-group-addon-center\">au</div>\r\n <input [type]=\"getInputType()\" class=\"field-control\" [id]=\"name + '_end'\" [formControl]=\"getControl('end')\"\r\n [attr.placeholder]=\"type === typeField.timeToTime ? ('_COMMON._DATES.TO' | translate) : ('_COMMON._DATES.FROM_TO_2' | translate)\"\r\n [ngClass]=\"[(cssClass || ''), getControl('end')?.value ? 'has-value' : '']\"\r\n [attr.required]=\"isRequired ? 'required' : null\" [attr.readonly]=\"isReadonly ? 'readonly' : null\"\r\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\"\r\n [attr.min]=\"minEndAttr\" [attr.max]=\"maxEndAttr\" [attr.step]=\"stepAttr\"\r\n [attr.autocomplete]=\"autocomplete\"\r\n [attr.aria-invalid]=\"getControl('end')?.invalid && getControl('end')?.touched\"\r\n [attr.aria-describedby]=\"getDescribedBy(getControl('end'))\"\r\n (focus)=\"onFocusRange('end')\" />\r\n\r\n @if(getControl('end')?.value && !isEffectivelyDisabled) {\r\n <button type=\"button\" class=\"btn btn-ghost 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 <div class=\"field-group\">\r\n @if (type === typeField.dateComplexe) {\r\n <div class=\"field-group-addon-left\">\r\n <button class=\"btn btn-ghost\" type=\"button\" (click)=\"onDateAddDay('prev')\"\r\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\">\r\n <cw-icon font=\"optyweb\" [icon]=\"spriteIcon.nextLeft\" [label]=\"'Jour pr\u00E9c\u00E9dent'\"></cw-icon>\r\n </button>\r\n </div>\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\" [attr.aria-required]=\"isRequired\"\r\n [attr.min]=\"minAttr\" [attr.max]=\"maxAttr\" [attr.step]=\"stepAttr\"\r\n [attr.autocomplete]=\"autocomplete\"\r\n [attr.aria-invalid]=\"control.invalid && control.touched\"\r\n [attr.aria-describedby]=\"getDescribedBy(control)\"\r\n (focus)=\"onFocus()\" (blur)=\"onBlur()\" />\r\n\r\n @if(formControl?.value && !isEffectivelyDisabled) {\r\n <button class=\"btn btn-ghost btn-clear-field\" type=\"button\"\r\n (click)=\"onClearField(formControl)\">×</button>\r\n }\r\n\r\n\r\n @if (type === typeField.dateComplexe) {\r\n <div class=\"field-group-addon-right\">\r\n <button class=\"btn btn-ghost\" type=\"button\" (click)=\"onDateAddDay('next')\"\r\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\">\r\n <cw-icon font=\"optyweb\" [icon]=\"spriteIcon.nextRight\" [label]=\"'Jour suivant'\"></cw-icon>\r\n </button>\r\n </div>\r\n <div class=\"field-group-addon-right\">\r\n <button class=\"btn btn-ghost\" type=\"button\" (click)=\"onRefresh()\"\r\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\">\r\n <cw-icon font=\"optyweb\" [icon]=\"spriteIcon.toolbarRefresh\" [label]=\"'Rafra\u00EEchir'\"></cw-icon>\r\n </button>\r\n </div>\r\n }\r\n\r\n <div class=\"field-group-addon-right\">\r\n <button class=\"btn btn-ghost\" type=\"button\" (click)=\"onTodayAddDay(0)\"\r\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\">\r\n J\r\n <span class=\"visually-hidden\">Aujourd'hui</span>\r\n </button>\r\n </div>\r\n <div class=\"field-group-addon-right\">\r\n <button class=\"btn btn-ghost\" type=\"button\" (click)=\"onTodayAddDay(1)\"\r\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\">\r\n J+1\r\n <span class=\"visually-hidden\">Demain</span>\r\n </button>\r\n </div>\r\n\r\n @if (type !== typeField.datePlusOne && type !== typeField.dateComplexe) {\r\n <div class=\"field-group-addon-right\">\r\n <button class=\"btn btn-ghost \" type=\"button\" (click)=\"onTodayAddDay(2)\"\r\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\">\r\n J+2\r\n <span class=\"visually-hidden\">Dans 2 jours</span>\r\n </button>\r\n </div>\r\n\r\n @if (type !== typeField.datePlusTwo) {\r\n <div class=\"field-group-addon-right\">\r\n <button class=\"btn btn-ghost\" type=\"button\" (click)=\"onTodayAddDay(7)\"\r\n [attr.disabled]=\"isEffectivelyDisabled ? 'disabled' : null\">\r\n J+7\r\n <span class=\"visually-hidden\">Dans 7 jours</span>\r\n </button>\r\n </div>\r\n }\r\n }\r\n </div>\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\">\r\n </div>\r\n\r\n <cw-button [isDisabled]=\"formControl.value >= rangeOptions.ceil\" [label]=\"'Augmenter ' + formControl.value + ' ' + label\"\r\n [withIcon]=\"spriteIcon.toolbarPlus\" [withOnlyIcon]=\"true\" [type]=\"buttonType.primary\"\r\n [iconSize]=\"buttonIconSize.small\" (btnAction)=\"onRangeStep('increase')\">\r\n </cw-button>\r\n </div>\r\n }\r\n\r\n @if (isInInputGroup() && clearable && !isEffectivelyDisabled && type !== typeField.autocompleteMultiple) {\r\n @if (type === typeField.autocomplete) {\r\n @if (autocompleteRef()?.hasAnyContent()) {\r\n <button class=\"btn btn-secondary btn-clear-field\" type=\"button\"\r\n (click)=\"onClearAutocomplete()\">×</button>\r\n }\r\n } @else if (type === typeField.ngSelectMultiple) {\r\n <!-- value est un tableau : un [] vide \u00E9tant truthy, on teste .length pour n'afficher le clear global que s'il y a au moins une s\u00E9lection. -->\r\n @if (formControl?.value?.length) {\r\n <button class=\"btn btn-ghost btn-clear-field\" type=\"button\"\r\n (click)=\"onClearField(formControl)\">×</button>\r\n }\r\n } @else {\r\n @if(formControl?.value) {\r\n <button class=\"btn btn-ghost btn-clear-field\" type=\"button\"\r\n (click)=\"onClearField(formControl)\">×</button>\r\n }\r\n }\r\n }\r\n\r\n</ng-template>\r\n" }]
|
|
3297
3541
|
}], ctorParameters: () => [], propDecorators: { control: [{
|
|
3298
3542
|
type: Input
|
|
3299
3543
|
}], formGroup: [{
|
|
@@ -3479,7 +3723,10 @@ class ModalsService {
|
|
|
3479
3723
|
this.modalsStack.push(componentRef);
|
|
3480
3724
|
return {
|
|
3481
3725
|
componentInstance: componentRef.instance,
|
|
3482
|
-
result: resultPromise
|
|
3726
|
+
result: resultPromise,
|
|
3727
|
+
setActionDisabled: (action, disabled) => {
|
|
3728
|
+
componentRef.setInput(action === 1 ? 'disableBtnAction1' : 'disableBtnAction2', disabled);
|
|
3729
|
+
}
|
|
3483
3730
|
};
|
|
3484
3731
|
}
|
|
3485
3732
|
/**
|
|
@@ -3547,6 +3794,8 @@ class ModalsComponent {
|
|
|
3547
3794
|
this.itemsToDeleteTitle = input(this.translateService.instant('_COMMON._MODAL_DELETE.DEFAULT_TYPE'), ...(ngDevMode ? [{ debugName: "itemsToDeleteTitle" }] : []));
|
|
3548
3795
|
this.labelBtnAction1 = input(...(ngDevMode ? [undefined, { debugName: "labelBtnAction1" }] : []));
|
|
3549
3796
|
this.labelBtnAction2 = input(...(ngDevMode ? [undefined, { debugName: "labelBtnAction2" }] : []));
|
|
3797
|
+
this.disableBtnAction1 = input(false, ...(ngDevMode ? [{ debugName: "disableBtnAction1" }] : []));
|
|
3798
|
+
this.disableBtnAction2 = input(false, ...(ngDevMode ? [{ debugName: "disableBtnAction2" }] : []));
|
|
3550
3799
|
this.customBodyTemplate = input(...(ngDevMode ? [undefined, { debugName: "customBodyTemplate" }] : []));
|
|
3551
3800
|
this.customBodyContext = input(...(ngDevMode ? [undefined, { debugName: "customBodyContext" }] : []));
|
|
3552
3801
|
this.btnAction1 = output();
|
|
@@ -3580,11 +3829,15 @@ class ModalsComponent {
|
|
|
3580
3829
|
}
|
|
3581
3830
|
}
|
|
3582
3831
|
action1Click() {
|
|
3832
|
+
if (this.disableBtnAction1())
|
|
3833
|
+
return;
|
|
3583
3834
|
this.btnAction1.emit('confirm');
|
|
3584
3835
|
this.closeModal();
|
|
3585
3836
|
}
|
|
3586
3837
|
action2Click() {
|
|
3587
|
-
this.
|
|
3838
|
+
if (this.disableBtnAction2())
|
|
3839
|
+
return;
|
|
3840
|
+
this.btnAction2.emit('confirm');
|
|
3588
3841
|
this.closeModal();
|
|
3589
3842
|
}
|
|
3590
3843
|
closeModal() {
|
|
@@ -3622,12 +3875,12 @@ class ModalsComponent {
|
|
|
3622
3875
|
});
|
|
3623
3876
|
}
|
|
3624
3877
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: ModalsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
3625
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.20", type: ModalsComponent, isStandalone: true, selector: "cw-modals", inputs: { size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, customClass: { classPropertyName: "customClass", publicName: "customClass", isSignal: true, isRequired: false, transformFunction: null }, scrollable: { classPropertyName: "scrollable", publicName: "scrollable", isSignal: true, isRequired: false, transformFunction: null }, isAutcompModal: { classPropertyName: "isAutcompModal", publicName: "isAutcompModal", isSignal: true, isRequired: false, transformFunction: null }, type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: true, transformFunction: null }, modalTitle: { classPropertyName: "modalTitle", publicName: "modalTitle", isSignal: true, isRequired: false, transformFunction: null }, itemsToDelete: { classPropertyName: "itemsToDelete", publicName: "itemsToDelete", isSignal: true, isRequired: false, transformFunction: null }, itemsToDeleteTitle: { classPropertyName: "itemsToDeleteTitle", publicName: "itemsToDeleteTitle", isSignal: true, isRequired: false, transformFunction: null }, labelBtnAction1: { classPropertyName: "labelBtnAction1", publicName: "labelBtnAction1", isSignal: true, isRequired: false, transformFunction: null }, labelBtnAction2: { classPropertyName: "labelBtnAction2", publicName: "labelBtnAction2", isSignal: true, isRequired: false, transformFunction: null }, customBodyTemplate: { classPropertyName: "customBodyTemplate", publicName: "customBodyTemplate", isSignal: true, isRequired: false, transformFunction: null }, customBodyContext: { classPropertyName: "customBodyContext", publicName: "customBodyContext", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { btnAction1: "btnAction1", btnAction2: "btnAction2" }, viewQueries: [{ propertyName: "modalContainer", first: true, predicate: ["modalContainer"], descendants: true, isSignal: true }], ngImport: i0, template: "<div class=\"cityway-v8 modal-backdrop fade show\" style=\"z-index: 1050;\" aria-hidden=\"true\"></div>\n\n<div role=\"dialog\" tabindex=\"-1\" aria-modal=\"true\" aria-labelledby=\"modal-basic-title\"\n class=\"cityway-v8 d-flex modal show\" [ngClass]=\"customClass()\" data-test-ctw=\"modal\" (keydown)=\"onKeyDown($event)\">\n\n <div class=\"modal-inner-backdrop\" (click)=\"type() !== modalsType.loader && closeModal()\"></div>\n\n <div #modalContainer role=\"document\" class=\"modal-dialog modal-dialog-centered\"\n [ngClass]=\"['modal-' + size(), scrollable() ? 'modal-dialog-scrollable' : '']\">\n\n <div class=\"modal-content\">\n\n @if (type() !== modalsType.loader) {\n @if (type() == modalsType.delete || type() == modalsType.quickSideView || type() == modalsType.custom) {\n <div class=\"modal-header\">\n @if (type() === modalsType.delete) {\n <h1 class=\"modal-title\" id=\"modal-basic-title\">\n {{ '_COMMON._MODAL_DELETE.TITLE' | translate: { number: itemsToDelete().length, name: itemsToDeleteTitle() | translate } }}\n </h1>\n }\n @else {\n <h1 class=\"modal-title\" id=\"modal-basic-title\">\n {{ modalTitle() | translate }}\n </h1>\n }\n\n <cw-button [label]=\"'_COMMON._ACTION.CLOSE' | translate\" [type]=\"buttonTypeEnum.light\" [withOnlyIcon]=\"true\"\n [withIcon]=\"spriteIcon.toolbarClose\" (btnAction)=\"closeModal()\" dataTest=\"btn-close-modal\"\n cssClass=\"btn-close\">\n </cw-button>\n </div>\n\n <div class=\"modal-body
|
|
3878
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.20", type: ModalsComponent, isStandalone: true, selector: "cw-modals", inputs: { size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, customClass: { classPropertyName: "customClass", publicName: "customClass", isSignal: true, isRequired: false, transformFunction: null }, scrollable: { classPropertyName: "scrollable", publicName: "scrollable", isSignal: true, isRequired: false, transformFunction: null }, isAutcompModal: { classPropertyName: "isAutcompModal", publicName: "isAutcompModal", isSignal: true, isRequired: false, transformFunction: null }, type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: true, transformFunction: null }, modalTitle: { classPropertyName: "modalTitle", publicName: "modalTitle", isSignal: true, isRequired: false, transformFunction: null }, itemsToDelete: { classPropertyName: "itemsToDelete", publicName: "itemsToDelete", isSignal: true, isRequired: false, transformFunction: null }, itemsToDeleteTitle: { classPropertyName: "itemsToDeleteTitle", publicName: "itemsToDeleteTitle", isSignal: true, isRequired: false, transformFunction: null }, labelBtnAction1: { classPropertyName: "labelBtnAction1", publicName: "labelBtnAction1", isSignal: true, isRequired: false, transformFunction: null }, labelBtnAction2: { classPropertyName: "labelBtnAction2", publicName: "labelBtnAction2", isSignal: true, isRequired: false, transformFunction: null }, disableBtnAction1: { classPropertyName: "disableBtnAction1", publicName: "disableBtnAction1", isSignal: true, isRequired: false, transformFunction: null }, disableBtnAction2: { classPropertyName: "disableBtnAction2", publicName: "disableBtnAction2", 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 d-flex-v gap-md\">\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\n @if (customBodyTemplate()) {\n <ng-container [ngTemplateOutlet]=\"customBodyTemplate()\" [ngTemplateOutletContext]=\"customBodyContext()\">\n </ng-container>\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 [isDisabled]=\"disableBtnAction1()\" (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 [isDisabled]=\"disableBtnAction1()\" (btnAction)=\"action1Click()\" dataTest=\"btn-action-modal\">\n </cw-button>\n }\n @if (labelBtnAction2()) {\n <cw-button [label]=\"labelBtnAction2()\" [type]=\"buttonTypeEnum.secondary\" [isMinWidth]=\"true\"\n [isDisabled]=\"disableBtnAction2()\" (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", "link", "isDropdown", "hideCaret", "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" }] }); }
|
|
3626
3879
|
}
|
|
3627
3880
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: ModalsComponent, decorators: [{
|
|
3628
3881
|
type: Component,
|
|
3629
|
-
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
|
|
3630
|
-
}], 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"] }] } });
|
|
3882
|
+
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 d-flex-v gap-md\">\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\n @if (customBodyTemplate()) {\n <ng-container [ngTemplateOutlet]=\"customBodyTemplate()\" [ngTemplateOutletContext]=\"customBodyContext()\">\n </ng-container>\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 [isDisabled]=\"disableBtnAction1()\" (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 [isDisabled]=\"disableBtnAction1()\" (btnAction)=\"action1Click()\" dataTest=\"btn-action-modal\">\n </cw-button>\n }\n @if (labelBtnAction2()) {\n <cw-button [label]=\"labelBtnAction2()\" [type]=\"buttonTypeEnum.secondary\" [isMinWidth]=\"true\"\n [isDisabled]=\"disableBtnAction2()\" (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" }]
|
|
3883
|
+
}], 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 }] }], disableBtnAction1: [{ type: i0.Input, args: [{ isSignal: true, alias: "disableBtnAction1", required: false }] }], disableBtnAction2: [{ type: i0.Input, args: [{ isSignal: true, alias: "disableBtnAction2", required: false }] }], customBodyTemplate: [{ type: i0.Input, args: [{ isSignal: true, alias: "customBodyTemplate", required: false }] }], customBodyContext: [{ type: i0.Input, args: [{ isSignal: true, alias: "customBodyContext", required: false }] }], btnAction1: [{ type: i0.Output, args: ["btnAction1"] }], btnAction2: [{ type: i0.Output, args: ["btnAction2"] }] } });
|
|
3631
3884
|
|
|
3632
3885
|
class TabContentComponent {
|
|
3633
3886
|
constructor() {
|
|
@@ -4176,5 +4429,5 @@ var PlacementEnum;
|
|
|
4176
4429
|
* Generated bundle index. Do not edit.
|
|
4177
4430
|
*/
|
|
4178
4431
|
|
|
4179
|
-
export { AccordionComponent, AlertComponent, AlertTypeEnum,
|
|
4432
|
+
export { AccordionComponent, AlertComponent, AlertTypeEnum, BadgeComponent, BadgePositionEnum, BadgeTypeEnum, BoButtonTypeEnum, BoTabTypeEnum, BreadcrumbComponent, ButtonComponent, ButtonIconSizeEnum, ButtonPositionEnum, CardComponent, CardTitleRankEnum, CardTypeEnum, ClickOutsideDirective, CollapseDirective, CwTooltipDirective, DropdownComponent, DropdownItemDirective, DropdownPositionEnum, FileToDownloadComponent, FoButtonTypeEnum, FoTabTypeEnum, FocusTrackerService, FormFieldComponent, FormFieldTypeEnum, IconComponent, IconNotifSizeEnum, IconNotifTypeEnum, IconNotificationComponent, IconSizeEnum, IconTypeEnum, IconUiTypeEnum, ImageComponent, LanguageSelectorComponent, LegendComponent, LegendTypeEnum, LoaderComponent, ModalsComponent, ModalsService, ModalsSize, ModalsType, NumericalRangeComponent, NumericalRangeLabelPositionEnum, NumericalRangeTypeEnum, PlacementEnum, RequiredInfoComponent, ResponsiveService, SkipLinksComponent, SpriteIconEnum, StepperComponent, TOAST_AUTOHIDE_DELAY_MS, TabComponent, TabContentComponent, TitleComponent, TitleContextEnum, TitleTagEnum, ToastComponent, ToastItemComponent, ToastService, TooltipPositionEnum, TriggerTooltipEnum, TypeTooltipEnum, WizardStepComponent, WizardStepperComponent, rangeValidator, resolveArrowPos };
|
|
4180
4433
|
//# sourceMappingURL=cityway-basic-ui.mjs.map
|